Documentation
¶
Index ¶
- func BuildSystemPrompt(projectContext, globalContext string) string
- func FindProjectContext(startDir string) (string, string, error)
- func LoadGlobalContext() (string, string, error)
- type AgentLoop
- type ContextManager
- type Session
- func (s *Session) AddMessage(msg provider.Message)
- func (s *Session) Clear()
- func (s *Session) ClearModifiedFiles()
- func (s *Session) History() []provider.Message
- func (s *Session) ID() string
- func (s *Session) LastAssistantMessage() string
- func (s *Session) LoadMessages(msgs []provider.Message)
- func (s *Session) Model() string
- func (s *Session) ModifiedFiles() []string
- func (s *Session) Provider() string
- func (s *Session) SetID(id string)
- func (s *Session) SetModel(model string)
- func (s *Session) SetProvider(p string)
- func (s *Session) Store() *session.SessionStore
- func (s *Session) TrackModifiedFile(path string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSystemPrompt ¶ added in v0.2.0
BuildSystemPrompt constructs the complete system prompt with project and global context.
func FindProjectContext ¶ added in v0.2.0
FindProjectContext scans startDir and parent directories for AGENTS.md, .gocode/AGENTS.md, or docs/AGENTS.md.
func LoadGlobalContext ¶ added in v0.2.0
LoadGlobalContext loads ~/.config/gocode/CONTEXT.md or %APPDATA%\gocode\CONTEXT.md.
Types ¶
type AgentLoop ¶
type AgentLoop struct {
Registry *provider.Registry
Session *Session
ToolRegistry *tools.Registry
Approval *tools.ApprovalGate
ContextManager *ContextManager
}
func NewAgentLoop ¶
type ContextManager ¶
type ContextManager struct {
MaxTokens int
}
func NewContextManager ¶
func NewContextManager(maxTokens int) *ContextManager
func (*ContextManager) EstimateTokens ¶
func (cm *ContextManager) EstimateTokens(msg provider.Message) int
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSessionWithStore ¶ added in v0.2.0
func NewSessionWithStore(id, providerName, model string, store *session.SessionStore) *Session
func (*Session) AddMessage ¶
func (*Session) ClearModifiedFiles ¶ added in v0.2.0
func (s *Session) ClearModifiedFiles()
func (*Session) LastAssistantMessage ¶
func (*Session) LoadMessages ¶ added in v0.2.0
func (*Session) ModifiedFiles ¶ added in v0.2.0
func (*Session) SetProvider ¶ added in v0.2.0
func (*Session) Store ¶ added in v0.2.0
func (s *Session) Store() *session.SessionStore