Documentation
¶
Overview ¶
Package config handles application configuration loading and defaults.
Index ¶
- type ColorConfig
- type Config
- type FileReader
- type FileSystem
- type Manager
- type ModelConfig
- type ProviderConfig
- type ToolsConfig
- type UIConfig
- func (c UIConfig) BashOutputHeight() int
- func (c UIConfig) ChatWindowWidth() int
- func (c UIConfig) ErrorColor() ColorConfig
- func (c UIConfig) MutedColor() ColorConfig
- func (c UIConfig) PrimaryColor() ColorConfig
- func (c *UIConfig) SetChatWindowWidth(w int)
- func (c UIConfig) SuccessColor() ColorConfig
- func (c UIConfig) TextColor() ColorConfig
- func (c UIConfig) ThinkingHeight() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColorConfig ¶
type ColorConfig struct {
// contains filtered or unexported fields
}
ColorConfig holds light and dark hex codes for a specific semantic role.
func (ColorConfig) Dark ¶
func (c ColorConfig) Dark() string
Dark returns the hex code for dark mode.
func (ColorConfig) Light ¶
func (c ColorConfig) Light() string
Light returns the hex code for light mode.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config holds all application configuration values.
func (*Config) Providers ¶
func (c *Config) Providers() ProviderConfig
Providers returns the configuration for AI providers.
func (*Config) Tools ¶
func (c *Config) Tools() ToolsConfig
Tools returns the configuration for tools.
type FileReader ¶
type FileReader struct{}
FileReader implements FileSystem using the real OS for config loading.
func (FileReader) MkdirAll ¶
func (FileReader) MkdirAll(path string, perm os.FileMode) error
MkdirAll creates a directory named path, along with any necessary parents.
func (FileReader) ReadFile ¶
func (FileReader) ReadFile(path string) ([]byte, error)
ReadFile reads the file named by path and returns the contents.
func (FileReader) UserHomeDir ¶
func (FileReader) UserHomeDir() (string, error)
UserHomeDir returns the current user's home directory.
type FileSystem ¶
type FileSystem interface {
UserHomeDir() (string, error)
ReadFile(path string) ([]byte, error)
WriteFile(path string, data []byte, perm os.FileMode) error
MkdirAll(path string, perm os.FileMode) error
}
FileSystem abstracts file operations for testability.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles configuration loading with injected dependencies.
func NewManager ¶
func NewManager(fs FileSystem) *Manager
NewManager creates a Manager with the provided filesystem.
type ModelConfig ¶
type ModelConfig struct {
ID string `json:"id"`
Name string `json:"name"`
ContextWindow int `json:"context_window"`
}
ModelConfig represents an AI model configuration.
type ProviderConfig ¶
type ProviderConfig map[string][]ModelConfig
ProviderConfig maps provider names to their available models.
type ToolsConfig ¶
type ToolsConfig struct {
// contains filtered or unexported fields
}
ToolsConfig holds tool-specific configuration.
func (ToolsConfig) MaxFileSize ¶
func (c ToolsConfig) MaxFileSize() int64
MaxFileSize returns the maximum file size allowed for tool operations.
func (ToolsConfig) MaxIterations ¶
func (c ToolsConfig) MaxIterations() int
MaxIterations returns the maximum number of tool iterations per request.
func (ToolsConfig) PermissionDefault ¶
func (c ToolsConfig) PermissionDefault() string
PermissionDefault returns the default permission level for tools.
func (ToolsConfig) ToolPermissions ¶
func (c ToolsConfig) ToolPermissions() map[string]string
ToolPermissions returns a copy of the tool-specific permission levels.
type UIConfig ¶
type UIConfig struct {
// contains filtered or unexported fields
}
UIConfig holds styling configuration for the terminal UI.
func (UIConfig) BashOutputHeight ¶
BashOutputHeight returns the maximum height of bash output blocks.
func (UIConfig) ChatWindowWidth ¶
ChatWindowWidth returns the width of the chat UI in characters.
func (UIConfig) ErrorColor ¶
func (c UIConfig) ErrorColor() ColorConfig
ErrorColor returns the color used for error indicators.
func (UIConfig) MutedColor ¶
func (c UIConfig) MutedColor() ColorConfig
MutedColor returns the color used for secondary or less important text.
func (UIConfig) PrimaryColor ¶
func (c UIConfig) PrimaryColor() ColorConfig
PrimaryColor returns the primary brand color.
func (*UIConfig) SetChatWindowWidth ¶
SetChatWindowWidth updates the chat window width.
func (UIConfig) SuccessColor ¶
func (c UIConfig) SuccessColor() ColorConfig
SuccessColor returns the color used for success indicators.
func (UIConfig) TextColor ¶
func (c UIConfig) TextColor() ColorConfig
TextColor returns the color used for primary body text.
func (UIConfig) ThinkingHeight ¶
ThinkingHeight returns the height of the thinking/process indicator.