diff options
Diffstat (limited to 'internal/config/config.go')
| -rw-r--r-- | internal/config/config.go | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 6f6b958..80777ff 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -45,6 +45,24 @@ func (m LocalModel) UseForElaborate() bool { return *m.PreferForElaborate } +// RunnersConfig controls which agent runners are registered. Each field is a +// *bool so that nil (absent from TOML) means "enabled by default", while an +// explicit false disables the runner without affecting others. +// +// The local runner also requires LocalModel.Endpoint to be set; setting +// Local = true without an endpoint has no effect. +type RunnersConfig struct { + Claude *bool `toml:"claude"` + Gemini *bool `toml:"gemini"` + Local *bool `toml:"local"` + Container *bool `toml:"container"` +} + +func (r RunnersConfig) ClaudeEnabled() bool { return r.Claude == nil || *r.Claude } +func (r RunnersConfig) GeminiEnabled() bool { return r.Gemini == nil || *r.Gemini } +func (r RunnersConfig) LocalEnabled() bool { return r.Local == nil || *r.Local } +func (r RunnersConfig) ContainerEnabled() bool { return r.Container == nil || *r.Container } + type Config struct { DataDir string `toml:"data_dir"` DBPath string `toml:"-"` @@ -69,20 +87,16 @@ type Config struct { VAPIDEmail string `toml:"vapid_email"` ClaudeConfigDir string `toml:"claude_config_dir"` LocalModel LocalModel `toml:"local_model"` + Runners RunnersConfig `toml:"runners"` Budget BudgetConfig `toml:"budget"` // ExternalBindAllowed must be explicitly true to bind a non-loopback address. - // Default external access should go through a reverse proxy (Tailscale / - // Cloudflare Access / Caddy); binding the server directly is a footgun. ExternalBindAllowed bool `toml:"external_bind_allowed"` } // BudgetConfig configures rolling per-provider spend caps. With no providers -// set, budget gating is disabled (nothing is blocked) — there is intentionally -// no default cap; the user must opt in by configuring limits. +// set, budget gating is disabled. type BudgetConfig struct { - // Window is the rolling lookback duration (e.g. "5h"); defaults to 5h. - Window string `toml:"window"` - // Provider5hUSD maps a provider (claude/gemini) to its USD cap within Window. + Window string `toml:"window"` Provider5hUSD map[string]float64 `toml:"provider_5h_usd"` } |
