Documentation
¶
Index ¶
- Constants
- Variables
- func ExpandHome(path string) string
- func GetAppDir() (string, error)
- func GetConfigPath() string
- func GetIndexPath() (string, error)
- func GetPIDPath() (string, error)
- func InitConfig() error
- func ResetForTesting()
- func SafePath(path string) error
- func ValidateBinaryPath(path string) error
- func ValidateConfig(cfg *Config) error
- func ValidateReload(oldCfg, newCfg *Config) error
- func WriteConfig(path string, cfg *Config) error
- type AnalysisConfig
- type ClaudeConfig
- type Config
- type DaemonConfig
- type IntegrationsConfig
- type MCPConfig
- type OutputConfig
- type ValidationError
- type Validator
Constants ¶
const ( AppDirName = ".agentic-memorizer" MemoryDirName = "memory" CacheDirName = ".cache" ConfigFile = "config.yaml" IndexFile = "index.json" DaemonLogFile = "daemon.log" DaemonPIDFile = "daemon.pid" MCPLogFile = "mcp.log" )
Variables ¶
var DefaultConfig = Config{ MemoryRoot: "~/" + AppDirName + "/" + MemoryDirName, Claude: ClaudeConfig{ APIKeyEnv: "ANTHROPIC_API_KEY", Model: "claude-sonnet-4-5-20250929", MaxTokens: 1500, EnableVision: true, TimeoutSeconds: 30, }, Output: OutputConfig{ Format: "xml", ShowRecentDays: 7, }, Analysis: AnalysisConfig{ Enable: true, MaxFileSize: 10485760, SkipExtensions: DefaultSkipExtensions, SkipFiles: DefaultSkipFiles, CacheDir: "~/" + AppDirName + "/" + CacheDirName, }, Daemon: DaemonConfig{ DebounceMs: 500, Workers: 3, RateLimitPerMin: 20, FullRebuildIntervalMinutes: 60, HealthCheckPort: 0, LogFile: "~/" + AppDirName + "/" + DaemonLogFile, LogLevel: "info", }, MCP: MCPConfig{ LogFile: "~/" + AppDirName + "/" + MCPLogFile, LogLevel: "info", }, Integrations: IntegrationsConfig{ Enabled: []string{}, }, }
var DefaultSkipExtensions = []string{".zip", ".tar", ".gz", ".exe", ".bin", ".dmg", ".iso"}
var DefaultSkipFiles = []string{"agentic-memorizer"}
Functions ¶
func ExpandHome ¶
func GetAppDir ¶
GetAppDir returns the application directory path. Checks MEMORIZER_APP_DIR environment variable first, then falls back to ~/.agentic-memorizer
func GetConfigPath ¶
func GetConfigPath() string
func GetIndexPath ¶
GetIndexPath returns the path to the precomputed index file. The index is stored at ~/.agentic-memorizer/index.json
func GetPIDPath ¶
GetPIDPath returns the daemon PID file path. The PID file is stored at ~/.agentic-memorizer/daemon.pid
func InitConfig ¶
func InitConfig() error
func ResetForTesting ¶
func ResetForTesting()
ResetForTesting resets viper state for testing purposes. This allows tests to use different config files without interference. Should only be called from test code.
func ValidateBinaryPath ¶
ValidateBinaryPath validates a binary path for execution
func ValidateConfig ¶
ValidateConfig validates the complete configuration
func ValidateReload ¶
ValidateReload checks if configuration changes are compatible with hot-reload Returns an error if any immutable fields have changed
func WriteConfig ¶
Types ¶
type AnalysisConfig ¶
type AnalysisConfig struct {
Enable bool `mapstructure:"enable" yaml:"enable"`
MaxFileSize int64 `mapstructure:"max_file_size" yaml:"max_file_size"`
SkipExtensions []string `mapstructure:"skip_extensions" yaml:"skip_extensions"`
SkipFiles []string `mapstructure:"skip_files" yaml:"skip_files"`
CacheDir string `mapstructure:"cache_dir" yaml:"cache_dir"`
}
type ClaudeConfig ¶
type ClaudeConfig struct {
APIKey string `mapstructure:"api_key" yaml:"api_key"`
APIKeyEnv string `mapstructure:"api_key_env" yaml:"api_key_env"`
Model string `mapstructure:"model" yaml:"model"`
MaxTokens int `mapstructure:"max_tokens" yaml:"max_tokens"`
EnableVision bool `mapstructure:"enable_vision" yaml:"enable_vision"`
TimeoutSeconds int `mapstructure:"timeout_seconds" yaml:"timeout_seconds"`
}
type Config ¶
type Config struct {
MemoryRoot string `mapstructure:"memory_root" yaml:"memory_root"`
Claude ClaudeConfig `mapstructure:"claude" yaml:"claude"`
Output OutputConfig `mapstructure:"output" yaml:"output"`
Analysis AnalysisConfig `mapstructure:"analysis" yaml:"analysis"`
Daemon DaemonConfig `mapstructure:"daemon" yaml:"daemon"`
MCP MCPConfig `mapstructure:"mcp" yaml:"mcp"`
Integrations IntegrationsConfig `mapstructure:"integrations" yaml:"integrations"`
}
type DaemonConfig ¶
type DaemonConfig struct {
DebounceMs int `mapstructure:"debounce_ms" yaml:"debounce_ms"`
Workers int `mapstructure:"workers" yaml:"workers"`
RateLimitPerMin int `mapstructure:"rate_limit_per_min" yaml:"rate_limit_per_min"`
FullRebuildIntervalMinutes int `mapstructure:"full_rebuild_interval_minutes" yaml:"full_rebuild_interval_minutes"`
HealthCheckPort int `mapstructure:"health_check_port" yaml:"health_check_port"`
LogFile string `mapstructure:"log_file" yaml:"log_file"`
LogLevel string `mapstructure:"log_level" yaml:"log_level"`
}
type IntegrationsConfig ¶
type IntegrationsConfig struct {
Enabled []string `mapstructure:"enabled" yaml:"enabled"`
}
IntegrationsConfig represents the complete integrations configuration section. The Enabled list tracks which integrations have been configured via setup commands. Integration-specific configuration (hooks, tools, etc.) is stored in framework-specific files (e.g., ~/.claude.json, ~/.claude/settings.json) rather than in this config file.
type OutputConfig ¶
type ValidationError ¶
ValidationError represents a configuration validation error
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface