Documentation
¶
Overview ¶
Package config holds the layered Antares configuration: file defaults, YAML overrides from the profile config, then environment variables.
Index ¶
- Constants
- Variables
- func ActiveProfile() string
- func CheckPassword(hash, plain string) bool
- func ConfigFile() string
- func EnsureHome() error
- func Expand(p string) string
- func HashPassword(plain string) (string, error)
- func Home() string
- func Normalize(c *Config)
- func NormalizeModules(modules []string) []string
- func NormalizeProviderHeaders(headers map[string]string) (map[string]string, error)
- func Path(parts ...string) string
- func PersistedModules() (modules *[]string, preset string, err error)
- func ProxyHTTPClient(proxyURL string, timeout time.Duration) (*http.Client, error)
- func Raw() (string, error)
- func ReloadMode(path string) string
- func Save(cfg *Config) error
- func SaveAt(path string, cfg *Config) error
- func SaveNormalizedAt(path string, cfg *Config) error
- func SaveRaw(text string) error
- func SaveSoul(content string) error
- func SetActiveProfile(name string) error
- func Soul() string
- func SoulIsUnset() bool
- func SoulPath() string
- func ValidateModules(modules []string) error
- func ValidatePreset(preset string) error
- type Agent
- type Autopilot
- type Binding
- type Browser
- type CodeExecution
- type Compression
- type Config
- func Default() *Config
- func Effective(current, desired *Config) (*Config, []string)
- func Get() *Config
- func Load() (*Config, error)
- func MigrateSkillState(disabled []string) (*Config, error)
- func Reload() (*Config, error)
- func SetModules(modules []string, preset string) (*Config, error)
- func SetSkillEnabled(name string, enabled bool) (*Config, error)
- func (c *Config) ClearInlineModelCredentials()
- func (c *Config) Clone() *Config
- func (c *Config) GetPath(path string) (any, error)
- func (c *Config) Redacted() map[string]any
- func (c *Config) ResolveProvider(name string) (string, Provider)
- func (c *Config) SetPath(path string, value any) error
- func (c *Config) Validate() error
- type Cron
- type Database
- type Delegation
- type Discord
- type Display
- type Feishu
- type Field
- type Gateway
- type Guardrails
- type HTTP
- type ImageGen
- type Logging
- type MCP
- type MCPServer
- type Matrix
- type Memory
- type Model
- type ModelMeta
- type OSINT
- type Plugins
- type PromptCaching
- type Provider
- type Proxies
- type ProxyEntry
- type RAG
- type Roles
- type Securitydeprecated
- type Server
- type SessionReset
- type Signal
- type Skills
- type Slack
- type Social
- type Streaming
- type Telegram
- type Terminal
- type Tools
- type VideoGen
- type WebSearch
- type WhatsApp
Constants ¶
const ( TierEssential = "essential" TierCommon = "common" TierAdvanced = "advanced" )
Tiers a field can belong to.
Variables ¶
var ( ErrInvalidHeaderName = errors.New("invalid header name") ErrInvalidHeaderValue = errors.New("invalid header value") ErrDuplicateHeaderName = errors.New("duplicate header name") )
var KnownModules = []string{"automation", "security", "studio"}
KnownModules are the optional dashboard modules, in display order. The dashboard keeps the same ids in web/src/lib/modules.ts (MODULE_IDS); a parity test fails if the two lists drift.
var KnownPresets = []string{"general", "coding", "security", "creator", "full", "custom"}
KnownPresets are the preset labels the dashboard may store alongside display.modules. "custom" marks a module set that matches no preset.
Functions ¶
func ActiveProfile ¶
func ActiveProfile() string
ActiveProfile returns the currently selected config profile name.
func CheckPassword ¶
CheckPassword reports whether plain matches the stored bcrypt hash.
func ConfigFile ¶
func ConfigFile() string
ConfigFile is the active config path, honouring the selected profile.
func HashPassword ¶
HashPassword returns a bcrypt hash suitable for Server.DashboardPasswordHash.
func Home ¶
func Home() string
Home is the Antares state directory: ~/.antares (override with ANTARES_HOME).
func Normalize ¶ added in v0.4.0
func Normalize(c *Config)
Normalize applies the same defaulting and cleanup that a save would, without writing anything. Callers that publish a config to other goroutines and then persist it in the background use this to normalize up front, so the async write does not mutate a shared struct. See SaveNormalizedAt.
func NormalizeModules ¶ added in v0.5.0
NormalizeModules returns the modules in KnownModules order. The result is never nil, so it always persists as an explicit list. Callers validate first.
func NormalizeProviderHeaders ¶ added in v0.4.0
NormalizeProviderHeaders validates an HTTP header map, canonicalizes names, and returns an independent map. A nil map remains nil; an allocated empty map remains allocated so callers can distinguish an omitted value from a clear.
func PersistedModules ¶ added in v0.5.0
PersistedModules reports display.modules and display.preset as stored in the active profile's file. modules is nil when the key is absent.
func ProxyHTTPClient ¶
ProxyHTTPClient builds an *http.Client that dials through the given proxy URL. http/https proxies use the standard transport proxy; socks5/socks5h use a x/net SOCKS dialer. It is the one place that turns a proxy URL into a client, shared by the tools and the server's proxy-test endpoint. An empty proxyURL yields a plain client with the given timeout.
func ReloadMode ¶ added in v0.4.0
ReloadMode describes when a saved field becomes effective. Services owning processes, connections or caches retain their boot configuration until restart.
func SaveNormalizedAt ¶ added in v0.4.0
SaveNormalizedAt writes an already-normalized config without mutating it further. Callers that hand the same *Config to another goroutine (for example, a live model switch that publishes the config to the agent and then persists it in the background) MUST normalize synchronously and use this, so the background write never mutates a struct another goroutine is reading.
func SaveSoul ¶
SaveSoul writes the soul file (creating the home dir if needed). Passing empty content resets it to the unset default so the interview can run again.
func SetActiveProfile ¶
SetActiveProfile persists the profile selection.
func Soul ¶
func Soul() string
Soul returns the current soul text, creating the default file if none exists.
func SoulIsUnset ¶
func SoulIsUnset() bool
SoulIsUnset reports whether the agent still lacks an identity — the default is in place (marker present) or the file is missing/empty. This is what triggers the first-conversation identity interview.
func SoulPath ¶
func SoulPath() string
SoulPath is where the agent's identity lives — a Markdown file the user (and the agent itself, during its first conversation) can shape. It is global: one soul across web, TUI, and every gateway.
func ValidateModules ¶ added in v0.5.0
ValidateModules rejects unknown module ids and duplicates.
func ValidatePreset ¶ added in v0.5.0
ValidatePreset rejects a preset label the dashboard does not know.
Types ¶
type Agent ¶
type Agent struct {
MaxTurns int `yaml:"max_turns" json:"max_turns"`
MaxToolCalls int `yaml:"max_tool_calls_per_turn" json:"max_tool_calls_per_turn"`
Verbose bool `yaml:"verbose" json:"verbose"`
ReasoningEffort string `yaml:"reasoning_effort" json:"reasoning_effort"`
Personality string `yaml:"personality" json:"personality"`
SystemPromptExtra string `yaml:"system_prompt_extra" json:"system_prompt_extra"`
Workspace string `yaml:"workspace" json:"workspace"`
Timezone string `yaml:"timezone" json:"timezone"`
Language string `yaml:"language" json:"language"`
IdleTimeoutSecs int `yaml:"idle_timeout_seconds" json:"idle_timeout_seconds"`
StopSequences []string `yaml:"stop_sequences" json:"stop_sequences"`
// RepeatLimit is how many identical tool calls are tolerated before the
// agent is told to change approach. Zero uses the default.
RepeatLimit int `yaml:"repeat_limit" json:"repeat_limit"`
// VerifyReplies runs a cheap second model over a finished answer to catch
// work that was described but not done.
VerifyReplies bool `yaml:"verify_replies" json:"verify_replies"`
// VerifyMax bounds how many times one turn can be sent back for more work.
VerifyMax int `yaml:"verify_max" json:"verify_max"`
// GoalMaxIterations bounds a standing goal so it cannot run forever.
GoalMaxIterations int `yaml:"goal_max_iterations" json:"goal_max_iterations"`
// GoalAutonomousMaxIterations is the default iteration cap for a "confident"
// autonomous goal (`/goal auto`), which keeps working across turns on its
// own. It is separate from — and normally higher than — GoalMaxIterations
// because an autonomous goal is expected to run much longer unattended. A
// per-goal cap of 0 means unlimited; this default only applies when the goal
// did not set its own. At the cap the goal pauses (resumable), it does not
// stop.
GoalAutonomousMaxIterations int `yaml:"goal_autonomous_max_iterations" json:"goal_autonomous_max_iterations"`
// WrapUntrustedOutput fences tool output that carries external content
// (web pages, HTTP bodies, MCP results) so the model treats it as data and
// not as instructions — a defence against prompt injection. On by default.
WrapUntrustedOutput bool `yaml:"wrap_untrusted_output" json:"wrap_untrusted_output"`
// SmartTitles names a new conversation with a short model-written title
// instead of a truncation of the first message. On by default; it costs one
// cheap auxiliary-model call per session.
SmartTitles bool `yaml:"smart_titles" json:"smart_titles"`
}
Agent tunes the conversation loop.
type Autopilot ¶
type Autopilot struct {
// VerifyCommand runs in each card's workspace to check the work (e.g.
// "go build ./... && go test ./..."). Empty skips verification.
VerifyCommand string `yaml:"verify_command" json:"verify_command"`
// BaseBranch is the PR base when autopilot runs with --pr. Default "main".
BaseBranch string `yaml:"base_branch" json:"base_branch"`
}
Cron configures the built-in scheduler. Autopilot configures the unattended work-queue runner.
type Binding ¶
type Binding struct {
ID string `yaml:"id" json:"id"`
Platform string `yaml:"platform" json:"platform"` // discord|telegram
GuildID string `yaml:"guild_id" json:"guild_id"` // discord server; empty = any
ChannelID string `yaml:"channel_id" json:"channel_id"` // channel/chat id; empty = any in guild
Label string `yaml:"label" json:"label"` // human label for the UI
Enabled bool `yaml:"enabled" json:"enabled"`
// Policy applied when this binding matches.
Role string `yaml:"role" json:"role"` // agent/role name; empty = default
Model string `yaml:"model" json:"model"` // model override; empty = default
Toolset string `yaml:"toolset" json:"toolset"` // toolset override; empty = role/default
AllowedUsers []string `yaml:"allowed_users" json:"allowed_users"` // platform user ids; empty = anyone paired
// AllowedRoles gates a Discord server binding by the sender's server roles:
// the bot answers only members holding one of these role ids. Empty means
// NO ONE in the server is served by this binding (strict — a server binding
// with no roles is off). Ignored for DMs and Telegram.
AllowedRoles []string `yaml:"allowed_roles" json:"allowed_roles"`
ReplyMode string `yaml:"reply_mode" json:"reply_mode"` // mention|always (groups only)
PromptPrefix string `yaml:"prompt_prefix" json:"prompt_prefix"` // appended to the system prompt
// RelevanceFilter, when set, gates messages: a cheap model call decides
// whether the message fits the criteria before the full agent runs. Empty
// answers everything.
RelevanceFilter string `yaml:"relevance_filter" json:"relevance_filter"`
}
Binding is a per-scope routing and policy rule for a messaging channel. The most specific match wins: a rule naming both guild and channel beats one naming only the guild, which beats a platform-wide rule.
type Browser ¶
type Browser struct {
Enabled bool `yaml:"enabled" json:"enabled"`
// Executable overrides Chrome discovery; empty means look for one.
Executable string `yaml:"executable" json:"executable"`
// RemoteURL attaches to a Chrome already running with a debugging port,
// e.g. http://127.0.0.1:9222, instead of starting one.
RemoteURL string `yaml:"remote_url" json:"remote_url"`
// UserDataDir keeps cookies and logins between runs.
UserDataDir string `yaml:"user_data_dir" json:"user_data_dir"`
// Headed shows the window; it needs a display to be of any use.
Headed bool `yaml:"headed" json:"headed"`
Width int `yaml:"width" json:"width"`
Height int `yaml:"height" json:"height"`
// Stealth launches a source-patched anti-detection Chromium (downloaded and
// verified on first use) instead of the system Chrome, so pages guarded by
// bot-detection challenges — Cloudflare Turnstile and the like — load. The
// binary is fetched once and cached; it carries its own upstream license.
Stealth bool `yaml:"stealth" json:"stealth"`
// Proxy routes the stealth browser through a proxy, e.g. "http://host:3128"
// or "socks5://host:1080".
Proxy string `yaml:"proxy" json:"proxy"`
// Timezone and Locale spoof the stealth fingerprint, e.g. "America/New_York"
// and "en-US".
Timezone string `yaml:"timezone" json:"timezone"`
Locale string `yaml:"locale" json:"locale"`
}
WebSearch configures the search backend used by the web_search tool. Browser configures the real-browser tool.
type CodeExecution ¶
type CodeExecution struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Timeout int `yaml:"timeout" json:"timeout"`
MaxToolCalls int `yaml:"max_tool_calls" json:"max_tool_calls"`
}
CodeExecution bounds the sandboxed code tool.
type Compression ¶
type Compression struct {
Enabled bool `yaml:"enabled" json:"enabled"`
ProgressNotices bool `yaml:"progress_notices" json:"progress_notices"`
Threshold float64 `yaml:"threshold" json:"threshold"`
TargetRatio float64 `yaml:"target_ratio" json:"target_ratio"`
ProtectLastN int `yaml:"protect_last_n" json:"protect_last_n"`
ProtectFirstN int `yaml:"protect_first_n" json:"protect_first_n"`
MinTailUserMessages int `yaml:"min_tail_user_messages" json:"min_tail_user_messages"`
MaxAttempts int `yaml:"max_attempts" json:"max_attempts"`
IdleCompactAfterSecs int `yaml:"idle_compact_after_seconds" json:"idle_compact_after_seconds"`
ProactivePruneTokens int `yaml:"proactive_prune_tokens" json:"proactive_prune_tokens"`
ProactivePruneMinChars int `yaml:"proactive_prune_min_result_chars" json:"proactive_prune_min_result_chars"`
}
Compression controls automatic context compaction.
type Config ¶
type Config struct {
Model Model `yaml:"model" json:"model"`
Providers map[string]Provider `yaml:"providers" json:"providers"`
Database Database `yaml:"database" json:"database"`
Server Server `yaml:"server" json:"server"`
Agent Agent `yaml:"agent" json:"agent"`
Tools Tools `yaml:"tools" json:"tools"`
Terminal Terminal `yaml:"terminal" json:"terminal"`
Compression Compression `yaml:"compression" json:"compression"`
PromptCaching PromptCaching `yaml:"prompt_caching" json:"prompt_caching"`
Memory Memory `yaml:"memory" json:"memory"`
RAG RAG `yaml:"rag" json:"rag"`
Skills Skills `yaml:"skills" json:"skills"`
Plugins Plugins `yaml:"plugins" json:"plugins"`
Roles Roles `yaml:"roles" json:"roles"`
Security Security `yaml:"security" json:"security"`
OSINT OSINT `yaml:"osint" json:"osint"`
ImageGen ImageGen `yaml:"image_gen" json:"image_gen"`
VideoGen VideoGen `yaml:"video_gen" json:"video_gen"`
Cron Cron `yaml:"cron" json:"cron"`
Autopilot Autopilot `yaml:"autopilot" json:"autopilot"`
Gateway Gateway `yaml:"gateway" json:"gateway"`
Delegation Delegation `yaml:"delegation" json:"delegation"`
CodeExecution CodeExecution `yaml:"code_execution" json:"code_execution"`
Guardrails Guardrails `yaml:"tool_loop_guardrails" json:"tool_loop_guardrails"`
SessionReset SessionReset `yaml:"session_reset" json:"session_reset"`
Streaming Streaming `yaml:"streaming" json:"streaming"`
Display Display `yaml:"display" json:"display"`
Logging Logging `yaml:"logging" json:"logging"`
MCP MCP `yaml:"mcp" json:"mcp"`
Proxies Proxies `yaml:"proxies" json:"proxies"`
MaxConcurrentSessions int `yaml:"max_concurrent_sessions" json:"max_concurrent_sessions"`
GroupSessionsPerUser bool `yaml:"group_sessions_per_user" json:"group_sessions_per_user"`
Social Social `yaml:"social" json:"social"`
// contains filtered or unexported fields
}
Config is the complete runtime configuration tree.
func Default ¶
func Default() *Config
Default returns a fully populated configuration. Every field the dashboard can edit has a sensible value here so the UI never renders a blank form.
func Effective ¶ added in v0.4.0
Effective keeps restart-bound values from the running configuration. The desired configuration remains on disk and is never overwritten with this view.
func Get ¶
func Get() *Config
Get returns the cached config, loading it on first use. It never returns nil.
func Load ¶
Load reads defaults, merges the profile YAML file, then applies env overrides. It is safe to call repeatedly; the result is cached until Reload or Save.
func MigrateSkillState ¶ added in v0.5.0
MigrateSkillState imports legacy frontmatter opt-outs exactly once. Imported names are merged with preferences already present in the active profile.
func SetModules ¶ added in v0.5.0
SetModules validates and persists the dashboard module set and preset label. Like SetSkillEnabled it edits the file as written, never the env-overridden runtime view, so environment overrides are not saved back, and it shares SetSkillEnabled's lock so neither edit can drop the other.
func SetSkillEnabled ¶ added in v0.5.0
SetSkillEnabled updates one exact skill name in the active profile. Skill state must be migrated before requests can alter it, so a later migration cannot unexpectedly reapply stale frontmatter state.
func (*Config) ClearInlineModelCredentials ¶ added in v0.4.0
func (c *Config) ClearInlineModelCredentials()
ClearInlineModelCredentials wipes top-level model.base_url and model.api_key. Call this whenever the active provider changes so a previous provider's credentials cannot leak into ResolveProvider for the next one.
func (*Config) Clone ¶ added in v0.4.0
Clone returns an independent configuration, including environment provenance.
func (*Config) Redacted ¶
Redacted returns a deep copy with secret values masked, for API responses.
func (*Config) ResolveProvider ¶
ResolveProvider returns the provider entry used for a model call, falling back to the inline model.* fields when no named provider matches.
Top-level model.base_url / model.api_key are legacy "inline provider" overrides. A value left in the *config file* must NOT clobber a named provider that already has its own base_url or api_key — otherwise switching the UI to antigravity/gemini while stale CodeBuddy values remain in model.* silently routes Claude to /v1 with the wrong key (cascading 401s).
ANTARES_BASE_URL / ANTARES_API_KEY are the documented exception: an env var is an explicit, per-run instruction from the operator, so it still wins over the named provider's stored credentials.
type Database ¶
type Database struct {
Driver string `yaml:"driver" json:"driver"` // sqlite|postgres|memory
DSN string `yaml:"dsn" json:"dsn"`
MaxConns int `yaml:"max_conns" json:"max_conns"`
Busy int `yaml:"busy_timeout_ms" json:"busy_timeout_ms"`
WAL bool `yaml:"wal" json:"wal"`
}
Database picks the persistence driver.
type Delegation ¶
type Delegation struct {
Enabled bool `yaml:"enabled" json:"enabled"`
MaxIterations int `yaml:"max_iterations" json:"max_iterations"`
MaxDepth int `yaml:"max_depth" json:"max_depth"`
MaxParallel int `yaml:"max_parallel" json:"max_parallel"`
// Subprocess runs each top-level sub-agent as its own antares process
// instead of in-process, so a crashing sub-agent cannot take the parent
// down. Findings, intel, and sessions are file-backed, so state still
// flows. Off by default.
Subprocess bool `yaml:"subprocess" json:"subprocess"`
}
Delegation bounds subagent recursion.
type Discord ¶
type Discord struct {
Enabled bool `yaml:"enabled" json:"enabled"`
BotToken string `yaml:"bot_token" json:"bot_token"`
AllowedUsers []string `yaml:"allowed_users" json:"allowed_users"`
AllowedGuilds []string `yaml:"allowed_guilds" json:"allowed_guilds"`
RequirePairing bool `yaml:"require_pairing" json:"require_pairing"`
Intents int `yaml:"intents" json:"intents"`
// ReplyStyle is how the bot renders answers: "embed" (coloured card, the
// default) or "plain" (a normal message). Empty means embed.
ReplyStyle string `yaml:"reply_style" json:"reply_style"`
}
Discord bot settings.
type Display ¶
type Display struct {
Compact bool `yaml:"compact" json:"compact"`
ToolProgress bool `yaml:"tool_progress" json:"tool_progress"`
ShowReasoning bool `yaml:"show_reasoning" json:"show_reasoning"`
// MaxLiveReasoningChars caps how much of a streaming reasoning trace the
// dashboard keeps in React state (trailing window). High-effort models can
// emit hundreds of KB per turn; unbounded string growth freezes the tab.
// 0 means unlimited. The full text is still persisted server-side and is
// restored on hydrate after the turn completes.
MaxLiveReasoningChars int `yaml:"max_live_reasoning_chars" json:"max_live_reasoning_chars"`
Theme string `yaml:"theme" json:"theme"`
Skin string `yaml:"skin" json:"skin"`
Language string `yaml:"language" json:"language"`
BellOnComplete bool `yaml:"bell_on_complete" json:"bell_on_complete"`
InterimAssistant bool `yaml:"interim_assistant_messages" json:"interim_assistant_messages"`
// Modules lists the optional dashboard modules shown in the sidebar (see
// KnownModules). It is a pointer so "absent" and "empty" stay distinct:
// nil means the key is missing, as in every install that predates modules,
// and resolves to all modules on; a pointer to an empty slice is the
// deliberate General preset. A plain slice would turn an old config into
// General the first time it was re-saved and silently hide navigation.
Modules *[]string `yaml:"modules,omitempty" json:"modules"`
// Preset is the label of the use-case preset last chosen. Display only;
// Modules decides visibility.
Preset string `yaml:"preset,omitempty" json:"preset,omitempty"`
}
Display holds UI preferences shared by the dashboard.
type Feishu ¶
type Feishu struct {
Enabled bool `yaml:"enabled" json:"enabled"`
AppID string `yaml:"app_id" json:"app_id"`
AppSecret string `yaml:"app_secret" json:"app_secret"`
VerifyToken string `yaml:"verify_token" json:"verify_token"`
ListenAddr string `yaml:"listen_addr" json:"listen_addr"` // :8091
Path string `yaml:"path" json:"path"` // /webhook
AllowedUsers []string `yaml:"allowed_users" json:"allowed_users"`
AllowedChats []string `yaml:"allowed_chats" json:"allowed_chats"`
}
Feishu (Lark) uses a webhook for events and a tenant token for sending. The adapter runs its own listener on ListenAddr.
type Field ¶
type Field struct {
Path string `json:"path"`
Label string `json:"label"`
Group string `json:"group"`
Type string `json:"type"` // string|number|boolean|string[]|object
// Tier drives disclosure in the dashboard: essential fields surface on the
// landing view, common ones sit in their group, advanced ones stay folded
// away. Most of the tree is advanced — it exists to be tunable, not read.
Tier string `json:"tier"` // essential|common|advanced
Default any `json:"default"`
Secret bool `json:"secret"`
Enum []string `json:"enum,omitempty"`
Help string `json:"help,omitempty"`
}
Field describes one editable config leaf for the dashboard form builder.
type Gateway ¶
type Gateway struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Telegram Telegram `yaml:"telegram" json:"telegram"`
Discord Discord `yaml:"discord" json:"discord"`
Slack Slack `yaml:"slack" json:"slack"`
Matrix Matrix `yaml:"matrix" json:"matrix"`
Signal Signal `yaml:"signal" json:"signal"`
WhatsApp WhatsApp `yaml:"whatsapp" json:"whatsapp"`
Feishu Feishu `yaml:"feishu" json:"feishu"`
// Bindings route a specific server/channel to a specific agent, model, and
// policy. When any binding exists for a platform, that platform answers ONLY
// in bound channels — an unbound channel is ignored (a strict allowlist).
Bindings []Binding `yaml:"bindings" json:"bindings"`
}
Gateway holds messaging platform credentials.
type Guardrails ¶
type Guardrails struct {
WarningsEnabled bool `yaml:"warnings_enabled" json:"warnings_enabled"`
HardStopEnabled bool `yaml:"hard_stop_enabled" json:"hard_stop_enabled"`
WarnAfter int `yaml:"warn_after" json:"warn_after"`
HardStopAfter int `yaml:"hard_stop_after" json:"hard_stop_after"`
AbsoluteMaxToolCalls int `yaml:"absolute_max_tool_calls" json:"absolute_max_tool_calls"`
}
Guardrails detects and stops runaway tool loops.
type HTTP ¶
type HTTP struct {
// Preset is the browser fingerprint to mimic, e.g. "chrome-131" (the
// default), "chrome-131-windows", "chrome-133". Empty uses the default.
Preset string `yaml:"preset" json:"preset"`
// Proxy routes requests through a proxy, e.g. "http://host:3128" or
// "socks5://host:1080".
Proxy string `yaml:"proxy" json:"proxy"`
// TimeoutSeconds bounds a single request; 0 uses the built-in default.
TimeoutSeconds int `yaml:"timeout_seconds" json:"timeout_seconds"`
// WrapTerminal puts curl/wget shims on the terminal's PATH so those
// commands go through the fingerprinted client too, falling back to the
// real binary for anything the shim cannot handle. On by default.
WrapTerminal bool `yaml:"wrap_terminal" json:"wrap_terminal"`
}
HTTP configures the http_request tool, which calls HTTP APIs with a browser-identical TLS/HTTP2 fingerprint so requests are not rejected by bot-detection layers at the cryptographic level.
type ImageGen ¶
type ImageGen struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Provider string `yaml:"provider" json:"provider"` // a configured provider id, or "openai"
Model string `yaml:"model" json:"model"`
BaseURL string `yaml:"base_url" json:"base_url"`
APIKey string `yaml:"api_key" json:"api_key"`
Size string `yaml:"size" json:"size"`
// ReferenceMode is how reference images reach the provider. "edits" is
// OpenAI's POST /images/edits with images:[{image_url}]. "generations"
// sends them as image:[...] on POST /images/generations, the shape some
// OpenAI-compatible gateways accept instead of an edits route.
ReferenceMode string `yaml:"reference_mode" json:"reference_mode"`
}
ImageGen configures text-to-image generation.
type Logging ¶
type Logging struct {
Level string `yaml:"level" json:"level"`
File string `yaml:"file" json:"file"`
JSON bool `yaml:"json" json:"json"`
}
Logging controls log level and sinks.
type MCP ¶
type MCP struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Servers map[string]MCPServer `yaml:"servers" json:"servers"`
}
MCP holds Model Context Protocol server registrations.
type MCPServer ¶
type MCPServer struct {
Transport string `yaml:"transport" json:"transport"` // stdio|http
Command string `yaml:"command" json:"command"`
Args []string `yaml:"args" json:"args"`
Env map[string]string `yaml:"env" json:"env"`
URL string `yaml:"url" json:"url"`
Headers map[string]string `yaml:"headers" json:"headers"`
Enabled bool `yaml:"enabled" json:"enabled"`
}
MCPServer is one registered MCP server (stdio or http transport).
type Matrix ¶
type Matrix struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Homeserver string `yaml:"homeserver" json:"homeserver"` // https://matrix.org
AccessToken string `yaml:"access_token" json:"access_token"`
UserID string `yaml:"user_id" json:"user_id"` // @bot:matrix.org
AllowedUsers []string `yaml:"allowed_users" json:"allowed_users"`
AllowedRooms []string `yaml:"allowed_rooms" json:"allowed_rooms"`
RequirePairing bool `yaml:"require_pairing" json:"require_pairing"`
}
Matrix bot settings. Connects to a homeserver with an access token and long-polls /sync.
type Memory ¶
type Memory struct {
Enabled bool `yaml:"memory_enabled" json:"memory_enabled"`
UserProfileEnabled bool `yaml:"user_profile_enabled" json:"user_profile_enabled"`
MemoryCharLimit int `yaml:"memory_char_limit" json:"memory_char_limit"`
UserCharLimit int `yaml:"user_char_limit" json:"user_char_limit"`
NudgeInterval int `yaml:"nudge_interval" json:"nudge_interval"`
FlushMinTurns int `yaml:"flush_min_turns" json:"flush_min_turns"`
SearchLimit int `yaml:"search_limit" json:"search_limit"`
}
Memory is the agent-curated long-term memory.
type Model ¶
type Model struct {
Default string `yaml:"default" json:"default"`
Provider string `yaml:"provider" json:"provider"`
BaseURL string `yaml:"base_url" json:"base_url"`
APIKey string `yaml:"api_key" json:"api_key"`
Auxiliary string `yaml:"auxiliary" json:"auxiliary"`
Vision string `yaml:"vision" json:"vision"`
Embedding string `yaml:"embedding" json:"embedding"`
// TTS, STT, and Voice configure the voice tools. Empty uses sensible
// defaults (tts-1 / whisper-1 / alloy) against an OpenAI-compatible provider.
TTS string `yaml:"tts" json:"tts"`
STT string `yaml:"stt" json:"stt"`
Voice string `yaml:"voice" json:"voice"`
Temperature float64 `yaml:"temperature" json:"temperature"`
TopP float64 `yaml:"top_p" json:"top_p"`
MaxTokens int `yaml:"max_tokens" json:"max_tokens"`
ContextWindow int `yaml:"context_window" json:"context_window"`
ReasoningEffort string `yaml:"reasoning_effort" json:"reasoning_effort"`
ParallelToolCall bool `yaml:"parallel_tool_calls" json:"parallel_tool_calls"`
// MaxRetries is how many times a transient provider failure (429, 5xx,
// dropped connection) is retried with backoff. Zero uses a safe default.
MaxRetries int `yaml:"max_retries" json:"max_retries"`
// Fallback lists models to try, in order, when the primary fails after its
// retries — each a bare model id or "provider/model". A whole provider
// outage or a decommissioned model then degrades instead of erroring.
Fallback []string `yaml:"fallback" json:"fallback"`
// Panel is the set of models /panel asks. Two or more, or the command has
// nothing to compare.
Panel []string `yaml:"panel" json:"panel"`
}
Model selects which LLM answers by default.
type ModelMeta ¶
type ModelMeta struct {
ContextWindow int `yaml:"context_window,omitempty" json:"context_window,omitempty"`
}
ModelMeta overrides or supplies model details the provider cannot report.
type OSINT ¶
type OSINT struct {
// GoogleCookie is a full Cookie header from a logged-in Google session,
// used by osint_google to resolve an email/gaia id to its public Google
// profile (GHunt-style). Optional and ToS-sensitive: supplying your own
// session cookie is your decision. Empty disables the tool with a hint.
GoogleCookie string `yaml:"google_cookie" json:"google_cookie"`
// GoogleAuthUser selects which account in a multi-account cookie session the
// Google lookups act as — the /u/<N>/ index. 0 is the default account.
GoogleAuthUser int `yaml:"google_authuser" json:"google_authuser"`
}
OSINT holds optional credentials that unlock deeper open-source lookups. All OSINT tools work keyless by default; these only enable extras.
type Plugins ¶
type Plugins struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Dirs []string `yaml:"dirs" json:"dirs"`
}
Plugins configures external programs that hook into the agent.
type PromptCaching ¶
type PromptCaching struct {
Enabled bool `yaml:"enabled" json:"enabled"`
CacheTTL string `yaml:"cache_ttl" json:"cache_ttl"`
}
PromptCaching mirrors provider-side cache controls.
type Provider ¶
type Provider struct {
Kind string `yaml:"kind" json:"kind"` // openai-compatible|anthropic|openai|gemini|custom|cursor-agent
BaseURL string `yaml:"base_url" json:"base_url"`
APIKey string `yaml:"api_key" json:"api_key"`
APIKeyEnv string `yaml:"api_key_env" json:"api_key_env"`
Headers map[string]string `yaml:"headers" json:"headers"`
Models []string `yaml:"models" json:"models"`
Enabled bool `yaml:"enabled" json:"enabled"`
Label string `yaml:"label" json:"label"`
TimeoutSecs int `yaml:"timeout_seconds" json:"timeout_seconds"`
APIVersion string `yaml:"api_version" json:"api_version"`
Region string `yaml:"region" json:"region"`
// ModelMeta carries metadata for models the provider's /models endpoint does
// not describe — chiefly a manually added model's context window. Keyed by
// model id. Empty for the common case where everything is auto-discovered.
ModelMeta map[string]ModelMeta `yaml:"model_meta,omitempty" json:"model_meta,omitempty"`
}
Provider is one configured external AI service.
type Proxies ¶
type Proxies struct {
// Entries are the saved proxies, each with a stable ID.
Entries []ProxyEntry `yaml:"entries" json:"entries"`
}
Proxies is a global store of named proxy endpoints — nothing more. It does not decide when a proxy is used; a tool or the agent chooses an entry by id (or label) when it wants one. Think of it as shared proxy storage the app draws from on demand.
func (Proxies) Find ¶
Find returns the dial URL of the entry matching ref (an id or a label, case-insensitive), or "" when nothing matches. This is how a tool resolves an agent-supplied proxy choice to something dial-ready.
type ProxyEntry ¶
type ProxyEntry struct {
ID string `yaml:"id" json:"id"`
Label string `yaml:"label" json:"label"`
URL string `yaml:"url" json:"url"`
Scheme string `yaml:"scheme" json:"scheme"` // http|https|socks5 (default http)
Host string `yaml:"host" json:"host"`
Port int `yaml:"port" json:"port"`
Username string `yaml:"username" json:"username"`
Password string `yaml:"password" json:"password"`
}
ProxyEntry is one saved proxy. URL is the full endpoint; the convenience fields (Scheme/Host/Port/Username/Password) let the dashboard edit parts without re-typing the whole URL, and ProxyURL() composes them when URL is empty.
func ParseProxyLine ¶
func ParseProxyLine(line string) (ProxyEntry, error)
ParseProxyLine reads one proxy in any of the common shapes and returns a populated entry (Scheme/Host/Port/Username/Password). Supported forms:
scheme://user:pass@host:port scheme://host:port user:pass@host:port host:port host:port:user:pass host:port:user label = <any of the above> (an optional "name = …" prefix)
The default scheme is http. It errors only when it cannot find a host:port.
func (ProxyEntry) ProxyURL ¶
func (p ProxyEntry) ProxyURL() string
ProxyURL returns the entry as a dial-ready URL, e.g. "http://user:pass@host:port". It prefers an explicit URL, else composes one from the parts. Empty if the entry has neither.
type RAG ¶
type RAG struct {
Enabled bool `yaml:"enabled" json:"enabled"`
// Embedding + vector store settings.
EmbedProvider string `yaml:"embed_provider" json:"embed_provider"`
EmbedModel string `yaml:"embed_model" json:"embed_model"`
EmbedBaseURL string `yaml:"embed_base_url" json:"embed_base_url"`
EmbedAPIKey string `yaml:"embed_api_key" json:"embed_api_key"`
ChunkSize int `yaml:"chunk_size" json:"chunk_size"`
ChunkOverlap int `yaml:"chunk_overlap" json:"chunk_overlap"`
TopK int `yaml:"top_k" json:"top_k"`
Hybrid bool `yaml:"hybrid" json:"hybrid"`
// Recall is how many candidates to pull before rerank/dedup narrow to TopK.
Recall int `yaml:"recall" json:"recall"`
// Reranking, applied to the recalled candidates. Mode: llm | api | off.
RerankMode string `yaml:"rerank_mode" json:"rerank_mode"`
RerankURL string `yaml:"rerank_url" json:"rerank_url"`
RerankModel string `yaml:"rerank_model" json:"rerank_model"`
RerankAPIKey string `yaml:"rerank_api_key" json:"rerank_api_key"`
// Compress collapses near-duplicate results (exact content) before TopK.
Compress bool `yaml:"compress" json:"compress"`
// AutoContext feeds every chat turn: index the conversation and surface
// relevant memory/docs into the prompt automatically.
AutoContext bool `yaml:"auto_context" json:"auto_context"`
// PerUser keeps a separate RAG collection per gateway user (keyed by
// platform+user id), on top of the shared conversation collection. Each
// person's turns are summarised into their own collection, and that
// collection is folded into auto-context when they chat — so the agent can
// recall topics and facts tied to that specific user. Off by default; it
// stores cross-conversation data about individuals, so it is opt-in.
PerUser bool `yaml:"per_user" json:"per_user"`
}
RAG is the native retrieval store: embeds chunks with the configured model, keeps vectors in the Antares database, and layers rerank + dedup on top. There is no external backend anymore — it is all in-process.
type Roles ¶
type Roles struct {
Dirs []string `yaml:"dirs" json:"dirs"`
}
Roles configures the specialist agent roles.
type Security
deprecated
type Security struct {
// Scope is a list of declared targets, surfaced in engagement views.
// No longer enforced.
Scope []string `yaml:"scope" json:"scope"`
// RequireScope is ignored. Kept for backward compatibility.
RequireScope bool `yaml:"require_scope" json:"require_scope"`
}
Security holds settings for the authorized-security roles.
Deprecated: scope-gating was removed — the scope_check tool and /scope command are gone, and security tools no longer refuse targets. The fields remain so existing config.yaml files keep loading, and Scope is still surfaced in engagement views as a "declared targets" list for the user's own bookkeeping. RequireScope has no effect.
type Server ¶
type Server struct {
Host string `yaml:"host" json:"host"`
Port int `yaml:"port" json:"port"`
AuthToken string `yaml:"auth_token" json:"auth_token"`
AuthDisabled bool `yaml:"auth_disabled" json:"auth_disabled"`
// DashboardPasswordHash gates the web dashboard behind a login when set
// (bcrypt hash of the password). Empty leaves the dashboard open. This is
// web-only: the TUI, gateways, and any client presenting AuthToken as a
// bearer bypass it.
DashboardPasswordHash string `yaml:"dashboard_password_hash" json:"dashboard_password_hash"`
CORSOrigins []string `yaml:"cors_origins" json:"cors_origins"`
PublicURL string `yaml:"public_url" json:"public_url"`
TrustProxy bool `yaml:"trust_proxy" json:"trust_proxy"`
}
Server configures the HTTP API + dashboard host.
func (Server) DashboardLocked ¶
DashboardLocked reports whether the web dashboard requires a password.
func (Server) ValidateListen ¶ added in v0.4.0
ValidateListen refuses accidental exposure; AuthDisabled is the explicit opt-out.
type SessionReset ¶
type SessionReset struct {
Mode string `yaml:"mode" json:"mode"` // never|idle|daily
IdleMinutes int `yaml:"idle_minutes" json:"idle_minutes"`
AtHour int `yaml:"at_hour" json:"at_hour"`
}
SessionReset controls automatic session rotation.
type Signal ¶
type Signal struct {
Enabled bool `yaml:"enabled" json:"enabled"`
APIURL string `yaml:"api_url" json:"api_url"` // http://localhost:8080
Number string `yaml:"number" json:"number"` // the bot's own +number
AllowedUsers []string `yaml:"allowed_users" json:"allowed_users"`
RequirePairing bool `yaml:"require_pairing" json:"require_pairing"`
}
Signal talks to a signal-cli REST API daemon (bbernhard/signal-cli-rest-api), which the user runs. It polls for messages and posts to send.
type Skills ¶
type Skills struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Dirs []string `yaml:"dirs" json:"dirs"`
Disabled []string `yaml:"disabled" json:"disabled"`
FrontmatterMigrated bool `yaml:"frontmatter_migrated" json:"frontmatter_migrated"`
CreationNudgeInterval int `yaml:"creation_nudge_interval" json:"creation_nudge_interval"`
AutoCreate bool `yaml:"auto_create" json:"auto_create"`
HubSources []string `yaml:"hub_sources" json:"hub_sources"`
}
Skills configures the self-improving skill library.
type Slack ¶
type Slack struct {
Enabled bool `yaml:"enabled" json:"enabled"`
AppToken string `yaml:"app_token" json:"app_token"`
BotToken string `yaml:"bot_token" json:"bot_token"`
AllowedUsers []string `yaml:"allowed_users" json:"allowed_users"`
AllowedChannels []string `yaml:"allowed_channels" json:"allowed_channels"`
RequirePairing bool `yaml:"require_pairing" json:"require_pairing"`
StreamEdits bool `yaml:"stream_edits" json:"stream_edits"`
}
Slack bot settings. Uses Socket Mode, so no public URL is needed: an app-level token (xapp-…) opens the socket and a bot token (xoxb-…) sends.
type Social ¶ added in v0.4.0
type Social struct {
Enabled bool `yaml:"enabled" json:"enabled"`
IMAPHost string `yaml:"imap_host" json:"imap_host"`
IMAPPort int `yaml:"imap_port" json:"imap_port"`
IMAPUsername string `yaml:"imap_username" json:"imap_username"`
BrowserEnabled bool `yaml:"browser_enabled" json:"browser_enabled"`
AutopilotEnabled bool `yaml:"autopilot_enabled" json:"autopilot_enabled"`
}
Social configures the Social Media feature: IMAP mailbox, persistent browser, and autopilot toggle. Secrets (IMAP password, social account passwords) are NOT stored here; they live encrypted in SQLite.
type Streaming ¶
type Streaming struct {
Enabled bool `yaml:"enabled" json:"enabled"`
}
Streaming toggles incremental responses.
type Telegram ¶
type Telegram struct {
Enabled bool `yaml:"enabled" json:"enabled"`
BotToken string `yaml:"bot_token" json:"bot_token"`
AllowedUsers []string `yaml:"allowed_users" json:"allowed_users"`
AllowedChats []string `yaml:"allowed_chats" json:"allowed_chats"`
RequirePairing bool `yaml:"require_pairing" json:"require_pairing"`
StreamEdits bool `yaml:"stream_edits" json:"stream_edits"`
}
Telegram bot settings.
type Terminal ¶
type Terminal struct {
Backend string `yaml:"backend" json:"backend"` // local|docker|ssh
CWD string `yaml:"cwd" json:"cwd"`
Timeout int `yaml:"timeout" json:"timeout"`
HomeMode string `yaml:"home_mode" json:"home_mode"`
LifetimeSeconds int `yaml:"lifetime_seconds" json:"lifetime_seconds"`
Shell string `yaml:"shell" json:"shell"`
BlockedCommands []string `yaml:"blocked_commands" json:"blocked_commands"`
AllowNetwork bool `yaml:"allow_network" json:"allow_network"`
// Sandbox confines what a command can reach: none, auto, bubblewrap, or
// namespace. Auto uses the strongest thing this machine has.
Sandbox string `yaml:"sandbox" json:"sandbox"`
// SandboxHidden are paths kept out of the sandbox. Empty uses the default
// list, which is the credential directories.
SandboxHidden []string `yaml:"sandbox_hidden" json:"sandbox_hidden"`
DockerImage string `yaml:"docker_image" json:"docker_image"`
SSHHost string `yaml:"ssh_host" json:"ssh_host"`
}
Terminal configures the shell execution backend.
type Tools ¶
type Tools struct {
Enabled []string `yaml:"enabled" json:"enabled"`
Disabled []string `yaml:"disabled" json:"disabled"`
Toolset string `yaml:"toolset" json:"toolset"`
ApprovalMode string `yaml:"approval_mode" json:"approval_mode"` // auto|prompt|deny
MaxOutputChars int `yaml:"max_output_chars" json:"max_output_chars"`
Timeouts map[string]int `yaml:"timeouts" json:"timeouts"`
WebSearch WebSearch `yaml:"web_search" json:"web_search"`
Browser Browser `yaml:"browser" json:"browser"`
HTTP HTTP `yaml:"http" json:"http"`
ComputerUse bool `yaml:"computer_use" json:"computer_use"`
Platform map[string]string `yaml:"platform_toolsets" json:"platform_toolsets"`
}
Tools controls which toolsets are exposed to the model.
type VideoGen ¶ added in v0.4.0
type VideoGen struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Provider string `yaml:"provider" json:"provider"` // a configured provider id, or "openai"
Model string `yaml:"model" json:"model"`
BaseURL string `yaml:"base_url" json:"base_url"`
APIKey string `yaml:"api_key" json:"api_key"`
Size string `yaml:"size" json:"size"` // WxH, e.g. "720x1280"
Seconds int `yaml:"seconds" json:"seconds"` // clip duration in seconds, default 8
}
VideoGen configures the async video generation used by the Content Creator workflow. It points at an OpenAI-compatible /videos endpoint (Sora-2 style): POST /videos creates a job, GET /videos/{id} polls it, GET /videos/{id}/content downloads the finished MP4. When Enabled is false, no network call is ever made — media tools refuse to run.
type WhatsApp ¶
type WhatsApp struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Token string `yaml:"token" json:"token"` // Graph API access token
PhoneNumberID string `yaml:"phone_number_id" json:"phone_number_id"` // for sending
VerifyToken string `yaml:"verify_token" json:"verify_token"` // webhook challenge secret
ListenAddr string `yaml:"listen_addr" json:"listen_addr"` // :8090
Path string `yaml:"path" json:"path"` // /webhook
AllowedUsers []string `yaml:"allowed_users" json:"allowed_users"`
}
WhatsApp uses the Meta Cloud API: a webhook receives messages, the Graph API sends them. The adapter runs its own listener on ListenAddr.