Documentation
¶
Overview ¶
Package config loads Prism configuration from prism.yaml and environment.
Index ¶
Constants ¶
This section is empty.
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. There is NO auto-detection —
// the MCP initialize handshake does not carry the model — so it is set
// only via prism.yaml, PRISM_MODEL, or a per-call model= argument. When
// empty, ContextWindow() returns a safe 200k default that covers all
// current production models.
Model string
Profile string
MaxCacheFiles int
Port int
// ArchDeny holds declared architecture rules, one per `arch_deny:` line
// in prism.yaml: "<from> -> <to>" where each side is a component name
// (directory), a prefix (covers subdirectories), a glob, or "*".
// Validated by prism arch / prism_arch_check against the induced
// component view; every violation cites concrete file:line sites.
ArchDeny []string
}
Config holds the resolved Prism configuration.
func Default ¶
func Default() *Config
Default returns config values with environment overrides applied. Model intentionally defaults to "" (unset — 200k-window default applies).
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.