Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadInstructions ¶
LoadInstructions loads and concatenates instructions from multiple sources:
- Repo-level: .polycode/instructions.md in workDir
- User-level: ~/.config/polycode/instructions.md
- Built-in default
All sources that exist are concatenated, separated by "\n\n".
Types ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore manages persistent memory files stored as markdown.
func NewMemoryStore ¶
func NewMemoryStore(memDir string) *MemoryStore
NewMemoryStore creates a MemoryStore that reads from and writes to memDir.
func (*MemoryStore) FormatForPrompt ¶
func (s *MemoryStore) FormatForPrompt() string
FormatForPrompt formats all loaded memory files into a single string suitable for inclusion in a system prompt.
func (*MemoryStore) Get ¶
func (s *MemoryStore) Get(name string) (string, error)
Get reads a single memory file by name (without the .md extension).
func (*MemoryStore) Load ¶
func (s *MemoryStore) Load() map[string]string
Load reads all .md files from the memory directory and returns a map of name (without extension) to file content. Returns an empty map if the directory does not exist.
func (*MemoryStore) Save ¶
func (s *MemoryStore) Save(name, content string) error
Save writes content to a memory file with the given name (the .md extension is appended automatically). It creates the memory directory if it does not exist.