config

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClaudeProjectsDir

func ClaudeProjectsDir() (string, error)

ClaudeProjectsDir returns the path to Claude Code's projects directory.

func ClaudeSettingsGlobal

func ClaudeSettingsGlobal() (string, error)

ClaudeSettingsGlobal returns the path to Claude Code's global settings.

func ClaudeSettingsLocal

func ClaudeSettingsLocal(projectDir string) string

ClaudeSettingsLocal returns the path to Claude Code's local project settings.

func ClaudeSkillsGlobal

func ClaudeSkillsGlobal() (string, error)

ClaudeSkillsGlobal returns the path to Claude Code's global skills directory.

func GetField

func GetField(cfg Config, key string) (interface{}, error)

GetField retrieves a value from Config by dot-notation key (e.g. "compile.trigger_mode").

func Save

func Save(path string, cfg Config) error

Save writes config to the given path.

Types

type CompileConfig

type CompileConfig struct {
	TriggerMode            string  `json:"trigger_mode"`
	TriggerIntervalMinutes int     `json:"trigger_interval_minutes"`
	TriggerEventThreshold  int     `json:"trigger_event_threshold"`
	MaxContextLines        int     `json:"max_context_lines"`
	MinPatternFrequency    int     `json:"min_pattern_frequency"`
	MinTokenSavings        int     `json:"min_token_savings"`
	DeprecateAfterSessions int     `json:"deprecate_after_sessions"`
	DeterministicThreshold float64 `json:"deterministic_threshold"`
	Platform               string  `json:"platform,omitempty"` // "windows", "linux", "darwin" — auto-detected if empty
}

func (CompileConfig) ResolvePlatform

func (c CompileConfig) ResolvePlatform() string

ResolvePlatform returns the configured platform, or runtime.GOOS if not set.

type Config

type Config struct {
	Daemon    DaemonConfig    `json:"daemon"`
	Ingestion IngestionConfig `json:"ingestion"`
	Compile   CompileConfig   `json:"compile"`
	Scope     ScopeConfig     `json:"scope"`
}

func DefaultConfig

func DefaultConfig() Config

func Load

func Load(path string) (Config, error)

Load reads config from the given path. Returns default config if file doesn't exist.

func SetField

func SetField(cfg Config, key, value string) (Config, error)

SetField updates a value in Config by dot-notation key. Values are auto-typed (numbers become float64, "true"/"false" become bool, everything else stays string).

type DaemonConfig

type DaemonConfig struct {
	IdleTimeoutMinutes int    `json:"idle_timeout_minutes"`
	SocketPath         string `json:"socket_path,omitempty"`
}

type IngestionConfig

type IngestionConfig struct {
	MaxResponseBytes int `json:"max_response_bytes"`
	LogRetentionDays int `json:"log_retention_days"`
}

type Paths

type Paths struct {
	Root               string // ~/.aj
	Config             string // ~/.aj/config.json
	Logs               string // ~/.aj/logs
	Skills             string // ~/.aj/skills
	PID                string // ~/.aj/daemon.pid
	Socket             string // ~/.aj/daemon.sock
	CompileLog         string // ~/.aj/compile-log.jsonl
	CompileMarker      string // ~/.aj/last_compile_marker
	BootstrapProcessed string // ~/.aj/bootstrap_processed.json
	Stats              string // ~/.aj/stats.jsonl
}

Paths holds all filesystem paths used by AJ.

func DefaultPaths

func DefaultPaths() (Paths, error)

DefaultPaths returns Paths rooted at ~/.aj.

func PathsFromRoot

func PathsFromRoot(root string) Paths

PathsFromRoot returns Paths rooted at the given directory. Useful for testing with a temp directory.

func (Paths) EnsureDirs

func (p Paths) EnsureDirs() error

EnsureDirs creates the root, logs, and skills directories if they don't exist.

func (Paths) SessionLogDir

func (p Paths) SessionLogDir(date string) string

SessionLogDir returns the log directory for a given date string (YYYY-MM-DD).

func (Paths) SessionLogFile

func (p Paths) SessionLogFile(date, sessionID string) string

SessionLogFile returns the JSONL file path for a given date and session ID.

type ScopeConfig

type ScopeConfig struct {
	GlobalCLITools        []string `json:"global_cli_tools"`
	CrossProjectThreshold int      `json:"cross_project_threshold"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL