Documentation
¶
Index ¶
- Variables
- type BootstrapLoader
- type ContextBuilder
- type DailyNote
- type MemoryStore
- func (ms *MemoryStore) AppendLongTerm(entry string) error
- func (ms *MemoryStore) EnsureDirectories() error
- func (ms *MemoryStore) GetMemoryContext() string
- func (ms *MemoryStore) GetRecentDailyNotes(days int) []DailyNote
- func (ms *MemoryStore) ReadLongTerm() string
- func (ms *MemoryStore) TodayNotePath() string
- func (ms *MemoryStore) WriteDailyNote(entry string) error
- func (ms *MemoryStore) WriteLongTerm(content string) error
Constants ¶
This section is empty.
Variables ¶
var BootstrapFiles = []string{
"AGENTS.md",
"SOUL.md",
"USER.md",
"IDENTITY.md",
"RULES.md",
}
BootstrapFiles are loaded in this order (all optional).
Functions ¶
This section is empty.
Types ¶
type BootstrapLoader ¶
type BootstrapLoader struct {
// contains filtered or unexported fields
}
BootstrapLoader loads and caches workspace bootstrap files.
func NewBootstrapLoader ¶
func NewBootstrapLoader(workspaceDir, globalDir string, logger *zap.Logger) *BootstrapLoader
NewBootstrapLoader creates a new loader.
func (*BootstrapLoader) InvalidateCache ¶
func (bl *BootstrapLoader) InvalidateCache()
InvalidateCache forces reload on next call.
func (*BootstrapLoader) IsStale ¶
func (bl *BootstrapLoader) IsStale() bool
IsStale checks if any cached file has been modified on disk.
func (*BootstrapLoader) LoadBootstrapContent ¶
func (bl *BootstrapLoader) LoadBootstrapContent() string
LoadBootstrapContent loads all bootstrap files with mtime-based cache invalidation. Priority: workspace > global (workspace files override global).
type ContextBuilder ¶
type ContextBuilder struct {
// contains filtered or unexported fields
}
ContextBuilder assembles the full system prompt from workspace sources.
func NewContextBuilder ¶
func NewContextBuilder(bootstrap *BootstrapLoader, memory *MemoryStore) *ContextBuilder
NewContextBuilder creates a new context builder.
func (*ContextBuilder) BuildDynamicContext ¶
func (cb *ContextBuilder) BuildDynamicContext() string
BuildDynamicContext returns time-sensitive context.
func (*ContextBuilder) BuildSystemPromptPrefix ¶
func (cb *ContextBuilder) BuildSystemPromptPrefix() string
BuildSystemPromptPrefix returns workspace context to prepend to the system prompt. Includes: bootstrap files + memory context. Does NOT include mode-specific instructions (coder/agent prompts).
func (*ContextBuilder) InvalidateCache ¶
func (cb *ContextBuilder) InvalidateCache()
InvalidateCache forces rebuild on next call.
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore manages persistent AI memory.
func NewMemoryStore ¶
func NewMemoryStore(baseDir string, logger *zap.Logger) *MemoryStore
NewMemoryStore creates a new memory store.
func (*MemoryStore) AppendLongTerm ¶
func (ms *MemoryStore) AppendLongTerm(entry string) error
AppendLongTerm appends to MEMORY.md.
func (*MemoryStore) EnsureDirectories ¶
func (ms *MemoryStore) EnsureDirectories() error
EnsureDirectories creates the memory directory structure.
func (*MemoryStore) GetMemoryContext ¶
func (ms *MemoryStore) GetMemoryContext() string
GetMemoryContext builds the memory section for the system prompt.
func (*MemoryStore) GetRecentDailyNotes ¶
func (ms *MemoryStore) GetRecentDailyNotes(days int) []DailyNote
GetRecentDailyNotes returns the last N days of notes.
func (*MemoryStore) ReadLongTerm ¶
func (ms *MemoryStore) ReadLongTerm() string
ReadLongTerm reads the main MEMORY.md file.
func (*MemoryStore) TodayNotePath ¶
func (ms *MemoryStore) TodayNotePath() string
TodayNotePath returns the path for today's note.
func (*MemoryStore) WriteDailyNote ¶
func (ms *MemoryStore) WriteDailyNote(entry string) error
WriteDailyNote appends to today's daily note.
func (*MemoryStore) WriteLongTerm ¶
func (ms *MemoryStore) WriteLongTerm(content string) error
WriteLongTerm writes the entire MEMORY.md file.