Documentation
¶
Overview ¶
Package config loads Prism configuration from prism.yaml and environment.
Index ¶
Constants ¶
const ( AgentModeMCP = "mcp" // MCP tools only (prism_query, prism_read, …) AgentModeCLI = "cli" // CLI via Bash only (prism query --format text, …) AgentModeBoth = "both" // MCP primary + CLI fallback (default) )
AgentMode controls which steering instructions prism init writes.
Variables ¶
This section is empty.
Functions ¶
func ModelContextWindow ¶
ModelContextWindow maps known model name substrings to their context window. Matching is case-insensitive prefix/substring to handle versioned IDs like "claude-sonnet-4-6" or "gpt-4o-2024-11-20" without exhaustive enumeration.
Types ¶
type Config ¶
type Config struct {
GroveURL string
GroveBinary string
// Model is the active AI model identifier. Empty means "auto" — Prism
// will use whatever is reported by the MCP client at initialize time or
// passed per-call. When empty, ContextWindow() returns a safe 200k
// default that covers all current production models.
Model string
Profile string
EmbeddingsBackend string // "tfidf" (only backend implemented today)
MaxCacheFiles int
Port int
// AgentMode controls which steering instructions are written by prism init.
// Valid values: "mcp", "cli", "both" (default).
AgentMode string
}
Config holds the resolved Prism configuration.
func Default ¶
func Default() *Config
Default returns config values with environment overrides applied. Model intentionally defaults to "" (auto-detect at runtime).
func LoadFromDir ¶
LoadFromDir looks for prism.yaml in dir and merges over Default(). Parser is intentionally minimal: KEY: VALUE per line, comments with '#'. This keeps Prism single-binary with no YAML dep.
func (*Config) ContextWindow ¶
ContextWindow returns the total context window in tokens for the model. When Model is empty or unrecognised, returns a safe 200k default that is correct for all current Claude models and generous for others.