Documentation
¶
Index ¶
- type Config
- type ContextFile
- type ContextSummary
- type FileType
- type Manager
- func (m *Manager) ExtractVariables(content string) []string
- func (m *Manager) GetLoadedContent(path string) string
- func (m *Manager) GetSummary() *ContextSummary
- func (m *Manager) ListContextFiles() []*ContextFile
- func (m *Manager) LoadContext(cfg *Config) (string, error)
- func (m *Manager) LoadContextCache() error
- func (m *Manager) RegisterContextFile(file *ContextFile)
- func (m *Manager) RenderTemplate(content string, variables map[string]string) string
- func (m *Manager) SaveContext() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Enabled bool `yaml:"enabled"`
ProjectRoot string `yaml:"project_root"`
ContextFiles []string `yaml:"context_files"`
AutoLoad []string `yaml:"auto_load_patterns"`
ExcludePatterns []string `yaml:"exclude_patterns"`
MaxContextSize int `yaml:"max_context_size"` // in tokens
IncludeHidden bool `yaml:"include_hidden"`
}
Config holds context manager configuration
type ContextFile ¶
type ContextFile struct {
Path string `json:"path"`
Type FileType `json:"type"`
Weight float64 `json:"weight"` // Priority weight (0.0-1.0)
Variables []string `json:"variables"` // Template variables
MaxTokens int `json:"max_tokens"` // Max tokens to include
AutoLoad bool `json:"auto_load"` // Auto-load on startup
Tags []string `json:"tags"` // Category tags
Content string `json:"-"` // Actual content (not serialized)
LoadedAt int64 `json:"loaded_at"` // When it was last loaded
}
ContextFile represents a context file entry
type ContextSummary ¶
type ContextSummary struct {
TotalFiles int `json:"total_files"`
TotalSize int `json:"total_size"`
ByType map[string]int `json:"by_type"`
ByTag map[string]int `json:"by_tag"`
Variables []string `json:"variables"`
ProjectRoot string `json:"project_root"`
}
ContextSummary provides a summary of loaded context
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles project context files
func NewManager ¶
NewManager creates a new context manager
func (*Manager) ExtractVariables ¶
ExtractVariables extracts template variables from content
func (*Manager) GetLoadedContent ¶
GetLoadedContent returns the loaded content for a file
func (*Manager) GetSummary ¶
func (m *Manager) GetSummary() *ContextSummary
GetSummary returns a summary of the loaded context
func (*Manager) ListContextFiles ¶
func (m *Manager) ListContextFiles() []*ContextFile
ListContextFiles returns all registered context files
func (*Manager) LoadContext ¶
LoadContext loads all context files for a project
func (*Manager) LoadContextCache ¶
LoadContextCache loads cached context
func (*Manager) RegisterContextFile ¶
func (m *Manager) RegisterContextFile(file *ContextFile)
RegisterContextFile registers a context file manually
func (*Manager) RenderTemplate ¶
RenderTemplate renders a template with variables
func (*Manager) SaveContext ¶
SaveContext saves current context state