config

package
v0.99.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgentsFileName    = "agents.yaml"
	DefaultAgentsPath = ConfigDirName + "/" + AgentsFileName
)
View Source
const (
	ConfigDirName     = ".infer"
	ConfigFileName    = "config.yaml"
	GitignoreFileName = ".gitignore"
	LogsDirName       = "logs"

	DefaultConfigPath = ConfigDirName + "/" + ConfigFileName
	DefaultLogsPath   = ConfigDirName + "/" + LogsDirName
)
View Source
const (
	MCPFileName    = "mcp.yaml"
	DefaultMCPPath = ConfigDirName + "/" + MCPFileName
)
View Source
const DefaultContextWindow = 8192

DefaultContextWindow is the fallback context window size when no pattern matches.

Variables

View Source
var ContextMatchers = []ModelMatcher{
	{Patterns: []string{"deepseek"}, ContextWindow: 128000},
	{Patterns: []string{"o1", "o3"}, ContextWindow: 200000},
	{Patterns: []string{"gpt-4o", "gpt-4-turbo"}, ContextWindow: 128000},
	{Patterns: []string{"gpt-4-32k"}, ContextWindow: 32768},
	{Patterns: []string{"gpt-4"}, ContextWindow: 8192},
	{Patterns: []string{"gpt-3.5"}, ContextWindow: 16384},
	{Patterns: []string{"claude-4", "claude-3.5", "claude-3"}, ContextWindow: 200000},
	{Patterns: []string{"claude-2"}, ContextWindow: 100000},
	{Patterns: []string{"claude"}, ContextWindow: 200000},
	{Patterns: []string{"gemini-2", "gemini-1.5"}, ContextWindow: 1000000},
	{Patterns: []string{"gemini"}, ContextWindow: 32768},
	{Patterns: []string{"mistral-large"}, ContextWindow: 128000},
	{Patterns: []string{"mistral", "mixtral"}, ContextWindow: 32768},
	{Patterns: []string{"llama-3.1", "llama-3.2", "llama-3.3"}, ContextWindow: 128000},
	{Patterns: []string{"llama-3"}, ContextWindow: 8192},
	{Patterns: []string{"llama"}, ContextWindow: 4096},
	{Patterns: []string{"qwen3", "qwen-3"}, ContextWindow: 262144},
	{Patterns: []string{"qwen2.5", "qwen-2.5"}, ContextWindow: 131072},
	{Patterns: []string{"qwen"}, ContextWindow: 128000},
	{Patterns: []string{"command-r"}, ContextWindow: 128000},
	{Patterns: []string{"kimi-k2", "kimi-latest"}, ContextWindow: 262144},
	{Patterns: []string{"moonshot-v1-128k"}, ContextWindow: 131072},
	{Patterns: []string{"moonshot-v1-32k"}, ContextWindow: 32768},
	{Patterns: []string{"moonshot-v1-8k", "moonshot-v1-auto"}, ContextWindow: 8192},
}

ContextMatchers defines all model patterns in priority order. More specific patterns must come before less specific ones.

View Source
var DefaultModelPricing = map[string]ModelPricing{
	"anthropic/claude-opus-4-5-20251101": {
		Provider:             "anthropic",
		Model:                "claude-opus-4-5-20251101",
		InputPricePerMToken:  5.00,
		OutputPricePerMToken: 25.00,
		Currency:             "USD",
	},
	"anthropic/claude-haiku-4-5-20251001": {
		Provider:             "anthropic",
		Model:                "claude-haiku-4-5-20251001",
		InputPricePerMToken:  1.00,
		OutputPricePerMToken: 5.00,
		Currency:             "USD",
	},
	"anthropic/claude-sonnet-4-5-20250929": {
		Provider:             "anthropic",
		Model:                "claude-sonnet-4-5-20250929",
		InputPricePerMToken:  3.00,
		OutputPricePerMToken: 15.00,
		Currency:             "USD",
	},
	"anthropic/claude-opus-4-1-20250805": {
		Provider:             "anthropic",
		Model:                "claude-opus-4-1-20250805",
		InputPricePerMToken:  15.00,
		OutputPricePerMToken: 75.00,
		Currency:             "USD",
	},
	"anthropic/claude-opus-4-20250514": {
		Provider:             "anthropic",
		Model:                "claude-opus-4-20250514",
		InputPricePerMToken:  15.00,
		OutputPricePerMToken: 75.00,
		Currency:             "USD",
	},
	"anthropic/claude-sonnet-4-20250514": {
		Provider:             "anthropic",
		Model:                "claude-sonnet-4-20250514",
		InputPricePerMToken:  3.00,
		OutputPricePerMToken: 15.00,
		Currency:             "USD",
	},
	"anthropic/claude-3-7-sonnet-20250219": {
		Provider:             "anthropic",
		Model:                "claude-3-7-sonnet-20250219",
		InputPricePerMToken:  3.00,
		OutputPricePerMToken: 15.00,
		Currency:             "USD",
	},
	"anthropic/claude-3-5-haiku-20241022": {
		Provider:             "anthropic",
		Model:                "claude-3-5-haiku-20241022",
		InputPricePerMToken:  0.80,
		OutputPricePerMToken: 4.00,
		Currency:             "USD",
	},
	"anthropic/claude-3-haiku-20240307": {
		Provider:             "anthropic",
		Model:                "claude-3-haiku-20240307",
		InputPricePerMToken:  0.25,
		OutputPricePerMToken: 1.25,
		Currency:             "USD",
	},
	"anthropic/claude-3-opus-20240229": {
		Provider:             "anthropic",
		Model:                "claude-3-opus-20240229",
		InputPricePerMToken:  15.00,
		OutputPricePerMToken: 75.00,
		Currency:             "USD",
	},
	"openai/gpt-4o": {
		Provider:             "openai",
		Model:                "gpt-4o",
		InputPricePerMToken:  2.50,
		OutputPricePerMToken: 10.00,
		Currency:             "USD",
	},
	"openai/gpt-4o-mini": {
		Provider:             "openai",
		Model:                "gpt-4o-mini",
		InputPricePerMToken:  0.150,
		OutputPricePerMToken: 0.600,
		Currency:             "USD",
	},
	"openai/gpt-4-turbo": {
		Provider:             "openai",
		Model:                "gpt-4-turbo",
		InputPricePerMToken:  10.00,
		OutputPricePerMToken: 30.00,
		Currency:             "USD",
	},
	"openai/gpt-4": {
		Provider:             "openai",
		Model:                "gpt-4",
		InputPricePerMToken:  30.00,
		OutputPricePerMToken: 60.00,
		Currency:             "USD",
	},
	"openai/gpt-3.5-turbo": {
		Provider:             "openai",
		Model:                "gpt-3.5-turbo",
		InputPricePerMToken:  0.50,
		OutputPricePerMToken: 1.50,
		Currency:             "USD",
	},
	"openai/o1": {
		Provider:             "openai",
		Model:                "o1",
		InputPricePerMToken:  15.00,
		OutputPricePerMToken: 60.00,
		Currency:             "USD",
	},
	"openai/o1-mini": {
		Provider:             "openai",
		Model:                "o1-mini",
		InputPricePerMToken:  3.00,
		OutputPricePerMToken: 12.00,
		Currency:             "USD",
	},
	"openai/o1-preview": {
		Provider:             "openai",
		Model:                "o1-preview",
		InputPricePerMToken:  15.00,
		OutputPricePerMToken: 60.00,
		Currency:             "USD",
	},
	"google/gemini-2.0-flash": {
		Provider:             "google",
		Model:                "gemini-2.0-flash",
		InputPricePerMToken:  0.00,
		OutputPricePerMToken: 0.00,
		Currency:             "USD",
	},
	"google/gemini-1.5-pro": {
		Provider:             "google",
		Model:                "gemini-1.5-pro",
		InputPricePerMToken:  1.25,
		OutputPricePerMToken: 5.00,
		Currency:             "USD",
	},
	"google/gemini-1.5-flash": {
		Provider:             "google",
		Model:                "gemini-1.5-flash",
		InputPricePerMToken:  0.075,
		OutputPricePerMToken: 0.30,
		Currency:             "USD",
	},
	"google/gemini-pro": {
		Provider:             "google",
		Model:                "gemini-pro",
		InputPricePerMToken:  0.50,
		OutputPricePerMToken: 1.50,
		Currency:             "USD",
	},
	"deepseek/deepseek-chat": {
		Provider:             "deepseek",
		Model:                "deepseek-chat",
		InputPricePerMToken:  0.28,
		OutputPricePerMToken: 0.42,
		Currency:             "USD",
	},
	"deepseek/deepseek-reasoner": {
		Provider:             "deepseek",
		Model:                "deepseek-reasoner",
		InputPricePerMToken:  0.28,
		OutputPricePerMToken: 0.42,
		Currency:             "USD",
	},
	"groq/llama-3.3-70b-versatile": {
		Provider:             "groq",
		Model:                "llama-3.3-70b-versatile",
		InputPricePerMToken:  0.59,
		OutputPricePerMToken: 0.79,
		Currency:             "USD",
	},
	"groq/llama-3.1-8b-instant": {
		Provider:             "groq",
		Model:                "llama-3.1-8b-instant",
		InputPricePerMToken:  0.05,
		OutputPricePerMToken: 0.08,
		Currency:             "USD",
	},
	"groq/meta-llama/llama-4-scout-17b-16e-instruct": {
		Provider:             "groq",
		Model:                "meta-llama/llama-4-scout-17b-16e-instruct",
		InputPricePerMToken:  0.11,
		OutputPricePerMToken: 0.34,
		Currency:             "USD",
	},
	"groq/meta-llama/llama-4-maverick-17b-128e-instruct": {
		Provider:             "groq",
		Model:                "meta-llama/llama-4-maverick-17b-128e-instruct",
		InputPricePerMToken:  0.20,
		OutputPricePerMToken: 0.60,
		Currency:             "USD",
	},
	"groq/meta-llama/llama-guard-4-12b": {
		Provider:             "groq",
		Model:                "meta-llama/llama-guard-4-12b",
		InputPricePerMToken:  0.20,
		OutputPricePerMToken: 0.20,
		Currency:             "USD",
	},
	"groq/qwen/qwen3-32b": {
		Provider:             "groq",
		Model:                "qwen/qwen3-32b",
		InputPricePerMToken:  0.29,
		OutputPricePerMToken: 0.59,
		Currency:             "USD",
	},
	"groq/openai/gpt-oss-20b": {
		Provider:             "groq",
		Model:                "openai/gpt-oss-20b",
		InputPricePerMToken:  0.075,
		OutputPricePerMToken: 0.30,
		Currency:             "USD",
	},
	"groq/openai/gpt-oss-safeguard-20b": {
		Provider:             "groq",
		Model:                "openai/gpt-oss-safeguard-20b",
		InputPricePerMToken:  0.075,
		OutputPricePerMToken: 0.30,
		Currency:             "USD",
	},
	"groq/openai/gpt-oss-120b": {
		Provider:             "groq",
		Model:                "openai/gpt-oss-120b",
		InputPricePerMToken:  0.15,
		OutputPricePerMToken: 0.60,
		Currency:             "USD",
	},
	"groq/moonshotai/kimi-k2-instruct-0905": {
		Provider:             "groq",
		Model:                "moonshotai/kimi-k2-instruct-0905",
		InputPricePerMToken:  1.00,
		OutputPricePerMToken: 3.00,
		Currency:             "USD",
	},
	"mistral/mistral-large": {
		Provider:             "mistral",
		Model:                "mistral-large",
		InputPricePerMToken:  2.00,
		OutputPricePerMToken: 6.00,
		Currency:             "USD",
	},
	"mistral/mistral-medium": {
		Provider:             "mistral",
		Model:                "mistral-medium",
		InputPricePerMToken:  2.70,
		OutputPricePerMToken: 8.10,
		Currency:             "USD",
	},
	"mistral/mistral-small": {
		Provider:             "mistral",
		Model:                "mistral-small",
		InputPricePerMToken:  0.20,
		OutputPricePerMToken: 0.60,
		Currency:             "USD",
	},
	"mistral/mistral-7b": {
		Provider:             "mistral",
		Model:                "mistral-7b",
		InputPricePerMToken:  0.25,
		OutputPricePerMToken: 0.25,
		Currency:             "USD",
	},
	"mistral/mixtral-8x7b": {
		Provider:             "mistral",
		Model:                "mixtral-8x7b",
		InputPricePerMToken:  0.70,
		OutputPricePerMToken: 0.70,
		Currency:             "USD",
	},
	"cohere/command-r-plus": {
		Provider:             "cohere",
		Model:                "command-r-plus",
		InputPricePerMToken:  2.50,
		OutputPricePerMToken: 10.00,
		Currency:             "USD",
	},
	"cohere/command-r": {
		Provider:             "cohere",
		Model:                "command-r",
		InputPricePerMToken:  0.50,
		OutputPricePerMToken: 1.50,
		Currency:             "USD",
	},
	"cohere/command": {
		Provider:             "cohere",
		Model:                "command",
		InputPricePerMToken:  1.00,
		OutputPricePerMToken: 2.00,
		Currency:             "USD",
	},
	"cohere/command-light": {
		Provider:             "cohere",
		Model:                "command-light",
		InputPricePerMToken:  0.30,
		OutputPricePerMToken: 0.60,
		Currency:             "USD",
	},
	"ollama/llama3.2": {
		Provider:             "ollama",
		Model:                "llama3.2",
		InputPricePerMToken:  0.0,
		OutputPricePerMToken: 0.0,
		Currency:             "USD",
	},
	"ollama/llama3.1": {
		Provider:             "ollama",
		Model:                "llama3.1",
		InputPricePerMToken:  0.0,
		OutputPricePerMToken: 0.0,
		Currency:             "USD",
	},
	"ollama/codellama": {
		Provider:             "ollama",
		Model:                "codellama",
		InputPricePerMToken:  0.0,
		OutputPricePerMToken: 0.0,
		Currency:             "USD",
	},
	"ollama/mistral": {
		Provider:             "ollama",
		Model:                "mistral",
		InputPricePerMToken:  0.0,
		OutputPricePerMToken: 0.0,
		Currency:             "USD",
	},
	"cloudflare/llama-2-7b": {
		Provider:             "cloudflare",
		Model:                "llama-2-7b",
		InputPricePerMToken:  0.0,
		OutputPricePerMToken: 0.0,
		Currency:             "USD",
	},
	"cloudflare/mistral-7b": {
		Provider:             "cloudflare",
		Model:                "mistral-7b",
		InputPricePerMToken:  0.0,
		OutputPricePerMToken: 0.0,
		Currency:             "USD",
	},
	"moonshot/kimi-k2-0905-preview": {
		Provider:             "moonshot",
		Model:                "kimi-k2-0905-preview",
		InputPricePerMToken:  0.60,
		OutputPricePerMToken: 2.50,
		Currency:             "USD",
	},
	"moonshot/kimi-k2-0711-preview": {
		Provider:             "moonshot",
		Model:                "kimi-k2-0711-preview",
		InputPricePerMToken:  0.60,
		OutputPricePerMToken: 2.50,
		Currency:             "USD",
	},
	"moonshot/kimi-k2-turbo-preview": {
		Provider:             "moonshot",
		Model:                "kimi-k2-turbo-preview",
		InputPricePerMToken:  1.15,
		OutputPricePerMToken: 8.00,
		Currency:             "USD",
	},
	"moonshot/kimi-k2-thinking": {
		Provider:             "moonshot",
		Model:                "kimi-k2-thinking",
		InputPricePerMToken:  0.60,
		OutputPricePerMToken: 2.50,
		Currency:             "USD",
	},
	"moonshot/kimi-k2-thinking-turbo": {
		Provider:             "moonshot",
		Model:                "kimi-k2-thinking-turbo",
		InputPricePerMToken:  1.15,
		OutputPricePerMToken: 8.00,
		Currency:             "USD",
	},
	"moonshot/kimi-latest": {
		Provider:             "moonshot",
		Model:                "kimi-latest",
		InputPricePerMToken:  1.00,
		OutputPricePerMToken: 3.00,
		Currency:             "USD",
	},
	"moonshot/moonshot-v1-8k": {
		Provider:             "moonshot",
		Model:                "moonshot-v1-8k",
		InputPricePerMToken:  0.20,
		OutputPricePerMToken: 2.00,
		Currency:             "USD",
	},
	"moonshot/moonshot-v1-32k": {
		Provider:             "moonshot",
		Model:                "moonshot-v1-32k",
		InputPricePerMToken:  1.00,
		OutputPricePerMToken: 3.00,
		Currency:             "USD",
	},
	"moonshot/moonshot-v1-128k": {
		Provider:             "moonshot",
		Model:                "moonshot-v1-128k",
		InputPricePerMToken:  2.00,
		OutputPricePerMToken: 5.00,
		Currency:             "USD",
	},
	"moonshot/moonshot-v1-8k-vision-preview": {
		Provider:             "moonshot",
		Model:                "moonshot-v1-8k-vision-preview",
		InputPricePerMToken:  0.20,
		OutputPricePerMToken: 2.00,
		Currency:             "USD",
	},
	"moonshot/moonshot-v1-32k-vision-preview": {
		Provider:             "moonshot",
		Model:                "moonshot-v1-32k-vision-preview",
		InputPricePerMToken:  1.00,
		OutputPricePerMToken: 3.00,
		Currency:             "USD",
	},
	"moonshot/moonshot-v1-128k-vision-preview": {
		Provider:             "moonshot",
		Model:                "moonshot-v1-128k-vision-preview",
		InputPricePerMToken:  2.00,
		OutputPricePerMToken: 5.00,
		Currency:             "USD",
	},
	"moonshot/moonshot-v1-auto": {
		Provider:             "moonshot",
		Model:                "moonshot-v1-auto",
		InputPricePerMToken:  1.00,
		OutputPricePerMToken: 3.00,
		Currency:             "USD",
	},
}

DefaultModelPricing contains hardcoded pricing for common models. Prices are based on publicly available pricing as of December 2024. Users can override these in their config files.

Functions

func ActionID added in v0.77.0

func ActionID(namespace KeyNamespace, action string) string

ActionID constructs a namespaced action ID from namespace and action name Format: "namespace_action" (e.g., "global_quit", "chat_enter_key_handler")

func DetectGithubOwner added in v0.66.0

func DetectGithubOwner() string

DetectGithubOwner attempts to detect the GitHub owner from the git remote URL Returns empty string if not a git repository or not a GitHub remote

func FindAvailablePort added in v0.80.0

func FindAvailablePort(basePort int) int

FindAvailablePort finds the next available port starting from basePort It checks up to 100 ports after the base port Binds to all interfaces (0.0.0.0) to match Docker's behavior Thread-safe: uses global port registry to prevent race conditions

func GetDefaultKeybindings added in v0.77.0

func GetDefaultKeybindings() map[string]KeyBindingEntry

GetDefaultKeybindings returns the default keybinding configuration Users can override these in their config file, and any missing entries will fall back to these defaults

func IsKnownAgent added in v0.67.0

func IsKnownAgent(name string) bool

IsKnownAgent returns true if the agent name has default configuration

func ListKnownAgents added in v0.67.0

func ListKnownAgents() []string

ListKnownAgents returns a list of all known agent names

func ParseModel added in v0.54.0

func ParseModel(model string) (provider, modelName string)

ParseModel parses a model string in the format "provider/model" and returns the provider and model separately. If the format is invalid, returns empty strings.

func ReleasePort added in v0.94.0

func ReleasePort(port int)

ReleasePort releases a previously allocated port Should be called when containers are stopped

func ResolveEnvironmentVariables added in v0.31.0

func ResolveEnvironmentVariables(value string) string

ResolveEnvironmentVariables resolves environment variable references in the format %VAR_NAME%

Types

type A2AAgentInfo added in v0.49.0

type A2AAgentInfo struct {
	Name        string            `yaml:"name" mapstructure:"name"`
	URL         string            `yaml:"url" mapstructure:"url"`
	APIKey      string            `yaml:"api_key" mapstructure:"api_key"`
	Description string            `yaml:"description,omitempty" mapstructure:"description,omitempty"`
	Timeout     int               `yaml:"timeout" mapstructure:"timeout"`
	Enabled     bool              `yaml:"enabled" mapstructure:"enabled"`
	Metadata    map[string]string `yaml:"metadata,omitempty" mapstructure:"metadata,omitempty"`
}

A2AAgentInfo contains information about an A2A agent connection

type A2ACacheConfig added in v0.49.0

type A2ACacheConfig struct {
	Enabled bool `yaml:"enabled" mapstructure:"enabled"`
	TTL     int  `yaml:"ttl" mapstructure:"ttl"`
}

A2ACacheConfig contains settings for A2A agent card caching

type A2AConfig added in v0.49.0

type A2AConfig struct {
	Enabled bool           `yaml:"enabled" mapstructure:"enabled"`
	Agents  []string       `yaml:"agents,omitempty" mapstructure:"agents"`
	Cache   A2ACacheConfig `yaml:"cache" mapstructure:"cache"`
	Task    A2ATaskConfig  `yaml:"task" mapstructure:"task"`
	Tools   A2AToolsConfig `yaml:"tools" mapstructure:"tools"`
}

A2AConfig contains A2A agent configuration

type A2ATaskConfig added in v0.49.0

type A2ATaskConfig struct {
	StatusPollSeconds      int     `yaml:"status_poll_seconds" mapstructure:"status_poll_seconds"`
	PollingStrategy        string  `yaml:"polling_strategy" mapstructure:"polling_strategy"`
	InitialPollIntervalSec int     `yaml:"initial_poll_interval_sec" mapstructure:"initial_poll_interval_sec"`
	MaxPollIntervalSec     int     `yaml:"max_poll_interval_sec" mapstructure:"max_poll_interval_sec"`
	BackoffMultiplier      float64 `yaml:"backoff_multiplier" mapstructure:"backoff_multiplier"`
	BackgroundMonitoring   bool    `yaml:"background_monitoring" mapstructure:"background_monitoring"`
	CompletedTaskRetention int     `yaml:"completed_task_retention" mapstructure:"completed_task_retention"`
}

A2ATaskConfig contains configuration for A2A task processing

type A2AToolsConfig added in v0.51.0

type A2AToolsConfig struct {
	QueryAgent QueryAgentToolConfig `yaml:"query_agent" mapstructure:"query_agent"`
	QueryTask  QueryTaskToolConfig  `yaml:"query_task" mapstructure:"query_task"`
	SubmitTask SubmitTaskToolConfig `yaml:"submit_task" mapstructure:"submit_task"`
}

A2AToolsConfig contains A2A-specific tool configurations

type ActivateAppToolConfig added in v0.96.0

type ActivateAppToolConfig struct {
	Enabled bool `yaml:"enabled" mapstructure:"enabled"`
}

ActivateAppToolConfig contains activate app-specific tool settings

type AgentConfig added in v0.36.0

type AgentConfig struct {
	Model              string                `yaml:"model" mapstructure:"model"`
	SystemPrompt       string                `yaml:"system_prompt" mapstructure:"system_prompt"`
	SystemPromptPlan   string                `yaml:"system_prompt_plan" mapstructure:"system_prompt_plan"`
	SystemPromptRemote string                `yaml:"system_prompt_remote" mapstructure:"system_prompt_remote"`
	SystemReminders    SystemRemindersConfig `yaml:"system_reminders" mapstructure:"system_reminders"`
	Context            AgentContextConfig    `yaml:"context" mapstructure:"context"`
	VerboseTools       bool                  `yaml:"verbose_tools" mapstructure:"verbose_tools"`
	MaxTurns           int                   `yaml:"max_turns" mapstructure:"max_turns"`
	MaxTokens          int                   `yaml:"max_tokens" mapstructure:"max_tokens"`
	MaxConcurrentTools int                   `yaml:"max_concurrent_tools" mapstructure:"max_concurrent_tools"`
}

AgentConfig contains agent command-specific settings

type AgentContextConfig added in v0.99.0

type AgentContextConfig struct {
	GitContextEnabled      bool `yaml:"git_context_enabled" mapstructure:"git_context_enabled"`
	WorkingDirEnabled      bool `yaml:"working_dir_enabled" mapstructure:"working_dir_enabled"`
	GitContextRefreshTurns int  `yaml:"git_context_refresh_turns" mapstructure:"git_context_refresh_turns"`
}

AgentContextConfig contains settings for agent context enrichment

type AgentDefaults added in v0.67.0

type AgentDefaults struct {
	URL          string
	ArtifactsURL string
	OCI          string
	Run          bool
	Model        string
	Environment  map[string]string
}

AgentDefaults contains default configuration for a known agent type

func GetAgentDefaults added in v0.67.0

func GetAgentDefaults(name string) *AgentDefaults

GetAgentDefaults returns the default configuration for a known agent with dynamically assigned available ports to avoid collisions. Returns nil if the agent is not known.

type AgentEntry added in v0.54.0

type AgentEntry struct {
	Name         string            `yaml:"name" mapstructure:"name"`
	URL          string            `yaml:"url" mapstructure:"url"`
	ArtifactsURL string            `yaml:"artifacts_url,omitempty" mapstructure:"artifacts_url,omitempty"`
	OCI          string            `yaml:"oci,omitempty" mapstructure:"oci,omitempty"`
	Run          bool              `yaml:"run" mapstructure:"run"`
	Model        string            `yaml:"model,omitempty" mapstructure:"model,omitempty"`
	Environment  map[string]string `yaml:"environment,omitempty" mapstructure:"environment,omitempty"`
	Enabled      bool              `yaml:"enabled" mapstructure:"enabled"`
}

AgentEntry represents a single A2A agent configuration

func (*AgentEntry) GetEnvironmentWithModel added in v0.54.0

func (a *AgentEntry) GetEnvironmentWithModel() map[string]string

GetEnvironmentWithModel returns the environment variables with model-related variables added if a model is specified.

type AgentsConfig added in v0.54.0

type AgentsConfig struct {
	Agents []AgentEntry `yaml:"agents" mapstructure:"agents"`
}

AgentsConfig represents the agents.yaml configuration file

func DefaultAgentsConfig added in v0.54.0

func DefaultAgentsConfig() *AgentsConfig

DefaultAgentsConfig returns a default agents configuration

type BackgroundShellsConfig added in v0.81.0

type BackgroundShellsConfig struct {
	Enabled           bool `yaml:"enabled" mapstructure:"enabled"`
	MaxConcurrent     int  `yaml:"max_concurrent" mapstructure:"max_concurrent"`
	MaxOutputBufferMB int  `yaml:"max_output_buffer_mb" mapstructure:"max_output_buffer_mb"`
	RetentionMinutes  int  `yaml:"retention_minutes" mapstructure:"retention_minutes"`
}

BackgroundShellsConfig contains background shell execution settings

type BashToolConfig added in v0.14.1

type BashToolConfig struct {
	Enabled          bool                   `yaml:"enabled" mapstructure:"enabled"`
	Timeout          int                    `yaml:"timeout" mapstructure:"timeout"`
	Whitelist        ToolWhitelistConfig    `yaml:"whitelist" mapstructure:"whitelist"`
	RequireApproval  *bool                  `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
	BackgroundShells BackgroundShellsConfig `yaml:"background_shells" mapstructure:"background_shells"`
}

BashToolConfig contains bash-specific tool settings

type ChatConfig added in v0.8.0

type ChatConfig struct {
	Theme       string            `yaml:"theme" mapstructure:"theme"`
	Keybindings KeybindingsConfig `yaml:"keybindings" mapstructure:"keybindings"`
	StatusBar   StatusBarConfig   `yaml:"status_bar" mapstructure:"status_bar"`
}

ChatConfig contains chat interface settings

type ClientConfig added in v0.36.0

type ClientConfig struct {
	Timeout int         `yaml:"timeout" mapstructure:"timeout"`
	Retry   RetryConfig `yaml:"retry" mapstructure:"retry"`
}

ClientConfig contains HTTP client settings

type ClipboardImageOptimizeConfig added in v0.89.0

type ClipboardImageOptimizeConfig struct {
	Enabled     bool `yaml:"enabled" mapstructure:"enabled"`
	MaxWidth    int  `yaml:"max_width" mapstructure:"max_width"`
	MaxHeight   int  `yaml:"max_height" mapstructure:"max_height"`
	Quality     int  `yaml:"quality" mapstructure:"quality"`
	ConvertJPEG bool `yaml:"convert_jpeg" mapstructure:"convert_jpeg"`
}

ClipboardImageOptimizeConfig contains clipboard image optimization settings

type CompactConfig added in v0.2.0

type CompactConfig struct {
	Enabled           bool `yaml:"enabled" mapstructure:"enabled"`
	AutoAt            int  `yaml:"auto_at" mapstructure:"auto_at"`
	KeepFirstMessages int  `yaml:"keep_first_messages" mapstructure:"keep_first_messages"`
}

CompactConfig contains conversation compaction settings

type ComputerUseConfig added in v0.96.0

type ComputerUseConfig struct {
	Enabled        bool                   `yaml:"enabled" mapstructure:"enabled"`
	FloatingWindow FloatingWindowConfig   `yaml:"floating_window" mapstructure:"floating_window"`
	Screenshot     ScreenshotToolConfig   `yaml:"screenshot" mapstructure:"screenshot"`
	RateLimit      RateLimitConfig        `yaml:"rate_limit" mapstructure:"rate_limit"`
	Tools          ComputerUseToolsConfig `yaml:"tools" mapstructure:"tools"`
}

ComputerUseConfig contains computer use tool settings

type ComputerUseToolsConfig added in v0.97.0

type ComputerUseToolsConfig struct {
	MouseMove     MouseMoveToolConfig     `yaml:"mouse_move" mapstructure:"mouse_move"`
	MouseClick    MouseClickToolConfig    `yaml:"mouse_click" mapstructure:"mouse_click"`
	MouseScroll   MouseScrollToolConfig   `yaml:"mouse_scroll" mapstructure:"mouse_scroll"`
	KeyboardType  KeyboardTypeToolConfig  `yaml:"keyboard_type" mapstructure:"keyboard_type"`
	GetFocusedApp GetFocusedAppToolConfig `yaml:"get_focused_app" mapstructure:"get_focused_app"`
	ActivateApp   ActivateAppToolConfig   `yaml:"activate_app" mapstructure:"activate_app"`
}

ComputerUseToolsConfig contains individual computer use tool settings

type Config

type Config struct {
	ContainerRuntime ContainerRuntimeConfig `yaml:"container_runtime" mapstructure:"container_runtime"`
	Gateway          GatewayConfig          `yaml:"gateway" mapstructure:"gateway"`
	Client           ClientConfig           `yaml:"client" mapstructure:"client"`
	Logging          LoggingConfig          `yaml:"logging" mapstructure:"logging"`
	Tools            ToolsConfig            `yaml:"tools" mapstructure:"tools"`
	Image            ImageConfig            `yaml:"image" mapstructure:"image"`
	Export           ExportConfig           `yaml:"export" mapstructure:"export"`
	Agent            AgentConfig            `yaml:"agent" mapstructure:"agent"`
	Git              GitConfig              `yaml:"git" mapstructure:"git"`
	SCM              SCMConfig              `yaml:"scm" mapstructure:"scm"`
	Storage          StorageConfig          `yaml:"storage" mapstructure:"storage"`
	Conversation     ConversationConfig     `yaml:"conversation" mapstructure:"conversation"`
	Chat             ChatConfig             `yaml:"chat" mapstructure:"chat"`
	A2A              A2AConfig              `yaml:"a2a" mapstructure:"a2a"`
	MCP              MCPConfig              `yaml:"mcp" mapstructure:"mcp"`
	Pricing          PricingConfig          `yaml:"pricing" mapstructure:"pricing"`
	Init             InitConfig             `yaml:"init" mapstructure:"init"`
	Compact          CompactConfig          `yaml:"compact" mapstructure:"compact"`
	Web              WebConfig              `yaml:"web" mapstructure:"web"`
	ComputerUse      ComputerUseConfig      `yaml:"computer_use" mapstructure:"computer_use"`
	// contains filtered or unexported fields
}

Config represents the CLI configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default configuration

func (*Config) GetAPIKey added in v0.27.0

func (c *Config) GetAPIKey() string

func (*Config) GetAgentConfig added in v0.48.0

func (c *Config) GetAgentConfig() *AgentConfig

func (*Config) GetConfigDir added in v0.90.0

func (c *Config) GetConfigDir() string

GetConfigDir returns the configuration directory path

func (*Config) GetDefaultModel added in v0.27.0

func (c *Config) GetDefaultModel() string

func (*Config) GetExcludeModels added in v0.57.1

func (c *Config) GetExcludeModels() []string

func (*Config) GetGatewayURL added in v0.27.0

func (c *Config) GetGatewayURL() string

func (*Config) GetIncludeModels added in v0.57.1

func (c *Config) GetIncludeModels() []string

func (*Config) GetOutputDirectory added in v0.27.0

func (c *Config) GetOutputDirectory() string

func (*Config) GetProtectedPaths added in v0.45.3

func (c *Config) GetProtectedPaths() []string

func (*Config) GetSandboxDirectories added in v0.45.3

func (c *Config) GetSandboxDirectories() []string

func (*Config) GetSystemPrompt added in v0.27.0

func (c *Config) GetSystemPrompt() string

func (*Config) GetTheme added in v0.47.0

func (c *Config) GetTheme() string

func (*Config) GetTimeout added in v0.27.0

func (c *Config) GetTimeout() int

func (*Config) IsA2AToolsEnabled added in v0.51.0

func (c *Config) IsA2AToolsEnabled() bool

IsA2AToolsEnabled checks if A2A tools should be enabled A2A tools are enabled when a2a.enabled is true, regardless of tools.enabled

func (*Config) IsApprovalRequired added in v0.14.1

func (c *Config) IsApprovalRequired(toolName string) bool

IsApprovalRequired checks if approval is required for a specific tool It returns true if tool-specific approval is set to true, or if global approval is true and tool-specific is not set to false ConfigService interface implementation

func (*Config) IsBashCommandWhitelisted added in v0.56.0

func (c *Config) IsBashCommandWhitelisted(command string) bool

IsBashCommandWhitelisted checks if a specific bash command is whitelisted

func (*Config) SetConfigDir added in v0.90.0

func (c *Config) SetConfigDir(dir string)

SetConfigDir sets the configuration directory path

func (*Config) ValidatePathInSandbox added in v0.29.0

func (c *Config) ValidatePathInSandbox(path string) error

ValidatePathInSandbox checks if a path is within the configured sandbox directories

type ContainerRuntimeConfig added in v0.82.0

type ContainerRuntimeConfig struct {
	Type string `yaml:"type" mapstructure:"type"` // "docker", "podman", or "" for auto-detect
}

ContainerRuntimeConfig contains container runtime settings

type ConversationConfig added in v0.46.0

type ConversationConfig struct {
	TitleGeneration ConversationTitleConfig `yaml:"title_generation" mapstructure:"title_generation"`
}

ConversationConfig contains conversation-specific settings

type ConversationTitleConfig added in v0.46.0

type ConversationTitleConfig struct {
	Enabled      bool   `yaml:"enabled" mapstructure:"enabled"`
	Model        string `yaml:"model" mapstructure:"model"`
	SystemPrompt string `yaml:"system_prompt" mapstructure:"system_prompt"`
	BatchSize    int    `yaml:"batch_size" mapstructure:"batch_size"`
	Interval     int    `yaml:"interval" mapstructure:"interval"`
}

ConversationTitleConfig contains settings for AI-generated conversation titles

type CustomPricing added in v0.86.0

type CustomPricing struct {
	InputPricePerMToken  float64 `yaml:"input_price_per_mtoken" mapstructure:"input_price_per_mtoken"`
	OutputPricePerMToken float64 `yaml:"output_price_per_mtoken" mapstructure:"output_price_per_mtoken"`
}

CustomPricing allows users to override default pricing for specific models.

type DeleteToolConfig added in v0.18.0

type DeleteToolConfig struct {
	Enabled         bool  `yaml:"enabled" mapstructure:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
}

DeleteToolConfig contains delete-specific tool settings

type EditToolConfig added in v0.21.0

type EditToolConfig struct {
	Enabled         bool  `yaml:"enabled" mapstructure:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
}

EditToolConfig contains edit-specific tool settings

type ExportConfig added in v0.63.0

type ExportConfig struct {
	OutputDir    string `yaml:"output_dir" mapstructure:"output_dir"`
	SummaryModel string `yaml:"summary_model" mapstructure:"summary_model"`
}

ExportConfig contains settings for export command

type FetchCacheConfig added in v0.11.0

type FetchCacheConfig struct {
	Enabled bool  `yaml:"enabled" mapstructure:"enabled"`
	TTL     int   `yaml:"ttl" mapstructure:"ttl"`
	MaxSize int64 `yaml:"max_size" mapstructure:"max_size"`
}

FetchCacheConfig contains cache settings for fetch operations

type FetchSafetyConfig added in v0.11.0

type FetchSafetyConfig struct {
	MaxSize       int64 `yaml:"max_size" mapstructure:"max_size"`
	Timeout       int   `yaml:"timeout" mapstructure:"timeout"`
	AllowRedirect bool  `yaml:"allow_redirect" mapstructure:"allow_redirect"`
}

FetchSafetyConfig contains safety settings for fetch operations

type FloatingWindowConfig added in v0.96.0

type FloatingWindowConfig struct {
	Enabled        bool   `yaml:"enabled" mapstructure:"enabled"`
	RespawnOnClose bool   `yaml:"respawn_on_close" mapstructure:"respawn_on_close"`
	Position       string `yaml:"position" mapstructure:"position"`
	AlwaysOnTop    bool   `yaml:"always_on_top" mapstructure:"always_on_top"`
}

FloatingWindowConfig contains floating progress window settings

type GatewayConfig

type GatewayConfig struct {
	URL              string   `yaml:"url" mapstructure:"url"`
	APIKey           string   `yaml:"api_key" mapstructure:"api_key"`
	Timeout          int      `yaml:"timeout" mapstructure:"timeout"`
	OCI              string   `yaml:"oci,omitempty" mapstructure:"oci,omitempty"`
	Run              bool     `yaml:"run" mapstructure:"run"`
	StandaloneBinary bool     `yaml:"standalone_binary" mapstructure:"standalone_binary"`
	Debug            bool     `yaml:"debug,omitempty" mapstructure:"debug,omitempty"`
	IncludeModels    []string `yaml:"include_models,omitempty" mapstructure:"include_models,omitempty"`
	ExcludeModels    []string `yaml:"exclude_models,omitempty" mapstructure:"exclude_models,omitempty"`
	VisionEnabled    bool     `yaml:"vision_enabled" mapstructure:"vision_enabled"`
}

GatewayConfig contains gateway connection settings

type GetFocusedAppToolConfig added in v0.96.0

type GetFocusedAppToolConfig struct {
	Enabled bool `yaml:"enabled" mapstructure:"enabled"`
}

GetFocusedAppToolConfig contains get focused app-specific tool settings

type GitCommitMessageConfig added in v0.42.0

type GitCommitMessageConfig struct {
	Model        string `yaml:"model" mapstructure:"model"`
	SystemPrompt string `yaml:"system_prompt" mapstructure:"system_prompt"`
}

GitCommitMessageConfig contains settings for AI-generated commit messages

type GitConfig added in v0.42.0

type GitConfig struct {
	CommitMessage GitCommitMessageConfig `yaml:"commit_message" mapstructure:"commit_message"`
}

GitConfig contains git shortcut-specific settings

type GithubSafetyConfig added in v0.31.0

type GithubSafetyConfig struct {
	MaxSize int64 `yaml:"max_size" mapstructure:"max_size"`
	Timeout int   `yaml:"timeout" mapstructure:"timeout"`
}

GithubSafetyConfig contains safety settings for GitHub fetch operations

type GithubToolConfig added in v0.31.0

type GithubToolConfig struct {
	Enabled         bool               `yaml:"enabled" mapstructure:"enabled"`
	Token           string             `yaml:"token" mapstructure:"token"`
	BaseURL         string             `yaml:"base_url" mapstructure:"base_url"`
	Owner           string             `yaml:"owner" mapstructure:"owner"`
	Repo            string             `yaml:"repo,omitempty" mapstructure:"repo,omitempty"`
	Safety          GithubSafetyConfig `yaml:"safety" mapstructure:"safety"`
	RequireApproval *bool              `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
}

GithubToolConfig contains GitHub fetch-specific tool settings

type GrepToolConfig added in v0.19.0

type GrepToolConfig struct {
	Enabled         bool   `yaml:"enabled" mapstructure:"enabled"`
	Backend         string `yaml:"backend" mapstructure:"backend"`
	RequireApproval *bool  `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
}

GrepToolConfig contains grep-specific tool settings

type ImageConfig added in v0.72.0

type ImageConfig struct {
	MaxSize           int64                        `yaml:"max_size" mapstructure:"max_size"`
	Timeout           int                          `yaml:"timeout" mapstructure:"timeout"`
	ClipboardOptimize ClipboardImageOptimizeConfig `yaml:"clipboard_optimize" mapstructure:"clipboard_optimize"`
}

ImageConfig contains image service settings

type InitConfig added in v0.59.0

type InitConfig struct {
	Prompt string `yaml:"prompt" mapstructure:"prompt"`
}

InitConfig contains settings for the /init shortcut

type JsonlStorageConfig added in v0.92.6

type JsonlStorageConfig struct {
	Path string `yaml:"path" mapstructure:"path"`
}

JsonlStorageConfig contains JSONL-specific configuration

type KeyBindingEntry added in v0.77.0

type KeyBindingEntry struct {
	Keys        []string `yaml:"keys" mapstructure:"keys"`
	Description string   `yaml:"description,omitempty" mapstructure:"description,omitempty"`
	Category    string   `yaml:"category,omitempty" mapstructure:"category,omitempty"`
	Enabled     *bool    `yaml:"enabled,omitempty" mapstructure:"enabled,omitempty"`
}

KeyBindingEntry defines a complete keybinding with its properties

type KeyNamespace added in v0.77.0

type KeyNamespace string

KeyNamespace represents the namespace for key binding actions

const (
	NamespaceGlobal       KeyNamespace = "global"
	NamespaceChat         KeyNamespace = "chat"
	NamespaceClipboard    KeyNamespace = "clipboard"
	NamespaceDisplay      KeyNamespace = "display"
	NamespaceHelp         KeyNamespace = "help"
	NamespaceMode         KeyNamespace = "mode"
	NamespaceNavigation   KeyNamespace = "navigation"
	NamespacePlanApproval KeyNamespace = "plan_approval"
	NamespaceSelection    KeyNamespace = "selection"
	NamespaceTextEditing  KeyNamespace = "text_editing"
	NamespaceTools        KeyNamespace = "tools"
)

Namespace constants for organizing key binding actions

type KeybindingsConfig added in v0.77.0

type KeybindingsConfig struct {
	Enabled  bool                       `yaml:"enabled" mapstructure:"enabled"`
	Bindings map[string]KeyBindingEntry `yaml:"bindings,omitempty" mapstructure:"bindings,omitempty"`
}

KeybindingsConfig contains settings for customizing keybindings

type KeyboardTypeToolConfig added in v0.96.0

type KeyboardTypeToolConfig struct {
	Enabled       bool `yaml:"enabled" mapstructure:"enabled"`
	MaxTextLength int  `yaml:"max_text_length" mapstructure:"max_text_length"`
	TypingDelayMs int  `yaml:"typing_delay_ms" mapstructure:"typing_delay_ms"`
}

KeyboardTypeToolConfig contains keyboard type-specific tool settings

type LoggingConfig added in v0.29.4

type LoggingConfig struct {
	Debug         bool   `yaml:"debug" mapstructure:"debug"`
	Dir           string `yaml:"dir" mapstructure:"dir"`
	ConsoleOutput string `yaml:"console_output" mapstructure:"console_output"`
}

LoggingConfig contains logging settings

func (*LoggingConfig) ValidateConsoleOutput added in v0.96.0

func (l *LoggingConfig) ValidateConsoleOutput() error

ValidateConsoleOutput validates the console_output field value

type MCPConfig added in v0.79.0

type MCPConfig struct {
	Enabled               bool             `yaml:"enabled" mapstructure:"enabled"`
	ConnectionTimeout     int              `yaml:"connection_timeout,omitempty" mapstructure:"connection_timeout,omitempty"`
	DiscoveryTimeout      int              `yaml:"discovery_timeout,omitempty" mapstructure:"discovery_timeout,omitempty"`
	LivenessProbeEnabled  bool             `yaml:"liveness_probe_enabled,omitempty" mapstructure:"liveness_probe_enabled,omitempty"`
	LivenessProbeInterval int              `yaml:"liveness_probe_interval,omitempty" mapstructure:"liveness_probe_interval,omitempty"`
	MaxRetries            int              `yaml:"max_retries,omitempty" mapstructure:"max_retries,omitempty"`
	Servers               []MCPServerEntry `yaml:"servers" mapstructure:"servers"`
}

MCPConfig represents the mcp.yaml configuration file

func DefaultMCPConfig added in v0.79.0

func DefaultMCPConfig() *MCPConfig

DefaultMCPConfig returns a default MCP configuration

type MCPServerEntry added in v0.79.0

type MCPServerEntry struct {
	Name           string            `yaml:"name" mapstructure:"name"`
	Enabled        bool              `yaml:"enabled" mapstructure:"enabled"`
	Timeout        int               `yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"`
	Description    string            `yaml:"description,omitempty" mapstructure:"description,omitempty"`
	IncludeTools   []string          `yaml:"include_tools,omitempty" mapstructure:"include_tools,omitempty"`
	ExcludeTools   []string          `yaml:"exclude_tools,omitempty" mapstructure:"exclude_tools,omitempty"`
	Run            bool              `yaml:"run" mapstructure:"run"`
	Host           string            `yaml:"host,omitempty" mapstructure:"host,omitempty"`
	Scheme         string            `yaml:"scheme,omitempty" mapstructure:"scheme,omitempty"`
	Port           int               `yaml:"port,omitempty" mapstructure:"port,omitempty"`
	Ports          []string          `yaml:"ports,omitempty" mapstructure:"ports,omitempty"`
	Path           string            `yaml:"path,omitempty" mapstructure:"path,omitempty"`
	OCI            string            `yaml:"oci,omitempty" mapstructure:"oci,omitempty"`
	Entrypoint     []string          `yaml:"entrypoint,omitempty" mapstructure:"entrypoint,omitempty"`
	Command        []string          `yaml:"command,omitempty" mapstructure:"command,omitempty"`
	Args           []string          `yaml:"args,omitempty" mapstructure:"args,omitempty"`
	Env            map[string]string `yaml:"env,omitempty" mapstructure:"env,omitempty"`
	Volumes        []string          `yaml:"volumes,omitempty" mapstructure:"volumes,omitempty"`
	StartupTimeout int               `yaml:"startup_timeout,omitempty" mapstructure:"startup_timeout,omitempty"`
	HealthCmd      string            `yaml:"health_cmd,omitempty" mapstructure:"health_cmd,omitempty"`
}

MCPServerEntry represents a single MCP server configuration

func (*MCPServerEntry) GetPrimaryPort added in v0.80.0

func (e *MCPServerEntry) GetPrimaryPort() int

GetPrimaryPort returns the primary (first) host port Priority: port field > ports array > 0

func (*MCPServerEntry) GetStartupTimeout added in v0.80.0

func (e *MCPServerEntry) GetStartupTimeout() int

GetStartupTimeout returns the effective startup timeout for this server

func (*MCPServerEntry) GetTimeout added in v0.79.0

func (e *MCPServerEntry) GetTimeout(globalTimeout int) int

GetTimeout returns the effective timeout for this server

func (*MCPServerEntry) GetURL added in v0.80.0

func (e *MCPServerEntry) GetURL() string

GetURL returns the full URL for the server Builds from host, scheme, ports, and path

func (*MCPServerEntry) ShouldIncludeTool added in v0.79.0

func (e *MCPServerEntry) ShouldIncludeTool(toolName string) bool

ShouldIncludeTool determines if a tool should be included based on include/exclude lists

type ModelMatcher added in v0.98.0

type ModelMatcher struct {
	Patterns      []string
	ContextWindow int
}

ModelMatcher defines a pattern match for context window estimation.

type ModelPricing added in v0.86.0

type ModelPricing struct {
	Provider             string
	Model                string
	InputPricePerMToken  float64
	OutputPricePerMToken float64
	Currency             string
}

ModelPricing represents pricing information for a specific model. Prices are per million tokens to align with common pricing conventions.

type MouseClickToolConfig added in v0.96.0

type MouseClickToolConfig struct {
	Enabled bool `yaml:"enabled" mapstructure:"enabled"`
}

MouseClickToolConfig contains mouse click-specific tool settings

type MouseMoveToolConfig added in v0.96.0

type MouseMoveToolConfig struct {
	Enabled bool `yaml:"enabled" mapstructure:"enabled"`
}

MouseMoveToolConfig contains mouse move-specific tool settings

type MouseScrollToolConfig added in v0.96.0

type MouseScrollToolConfig struct {
	Enabled bool `yaml:"enabled" mapstructure:"enabled"`
}

MouseScrollToolConfig contains mouse scroll-specific tool settings

type PostgresStorageConfig added in v0.45.0

type PostgresStorageConfig struct {
	Host     string `yaml:"host" mapstructure:"host"`
	Port     int    `yaml:"port" mapstructure:"port"`
	Database string `yaml:"database" mapstructure:"database"`
	Username string `yaml:"username" mapstructure:"username"`
	Password string `yaml:"password" mapstructure:"password"`
	SSLMode  string `yaml:"ssl_mode" mapstructure:"ssl_mode"`
}

PostgresStorageConfig contains Postgres-specific configuration

type PricingConfig added in v0.86.0

type PricingConfig struct {
	Enabled      bool                     `yaml:"enabled" mapstructure:"enabled"`
	Currency     string                   `yaml:"currency" mapstructure:"currency"`
	CustomPrices map[string]CustomPricing `yaml:"custom_prices" mapstructure:"custom_prices"`
}

PricingConfig holds configuration for model pricing and cost tracking.

func GetDefaultPricingConfig added in v0.86.0

func GetDefaultPricingConfig() PricingConfig

GetDefaultPricingConfig returns the default pricing configuration.

type QueryAgentToolConfig added in v0.51.0

type QueryAgentToolConfig struct {
	Enabled         bool  `yaml:"enabled" mapstructure:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
}

QueryAgentToolConfig contains Query-specific tool settings

type QueryTaskToolConfig added in v0.51.0

type QueryTaskToolConfig struct {
	Enabled         bool  `yaml:"enabled" mapstructure:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
}

QueryTaskToolConfig contains QueryTask-specific tool settings

type RateLimitConfig added in v0.96.0

type RateLimitConfig struct {
	Enabled             bool `yaml:"enabled" mapstructure:"enabled"`
	MaxActionsPerMinute int  `yaml:"max_actions_per_minute" mapstructure:"max_actions_per_minute"`
	WindowSeconds       int  `yaml:"window_seconds" mapstructure:"window_seconds"`
}

RateLimitConfig contains rate limiting settings

type ReadToolConfig added in v0.14.1

type ReadToolConfig struct {
	Enabled         bool  `yaml:"enabled" mapstructure:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
}

ReadToolConfig contains read-specific tool settings

type RedisStorageConfig added in v0.45.0

type RedisStorageConfig struct {
	Host     string `yaml:"host" mapstructure:"host"`
	Port     int    `yaml:"port" mapstructure:"port"`
	Password string `yaml:"password" mapstructure:"password"`
	DB       int    `yaml:"db" mapstructure:"db"`
}

RedisStorageConfig contains Redis-specific configuration

type RetryConfig added in v0.36.0

type RetryConfig struct {
	Enabled              bool  `yaml:"enabled" mapstructure:"enabled"`
	MaxAttempts          int   `yaml:"max_attempts" mapstructure:"max_attempts"`
	InitialBackoffSec    int   `yaml:"initial_backoff_sec" mapstructure:"initial_backoff_sec"`
	MaxBackoffSec        int   `yaml:"max_backoff_sec" mapstructure:"max_backoff_sec"`
	BackoffMultiplier    int   `yaml:"backoff_multiplier" mapstructure:"backoff_multiplier"`
	RetryableStatusCodes []int `yaml:"retryable_status_codes" mapstructure:"retryable_status_codes"`
}

RetryConfig contains retry logic settings

type SCMCleanupConfig added in v0.62.0

type SCMCleanupConfig struct {
	ReturnToBase      bool `yaml:"return_to_base" mapstructure:"return_to_base"`
	DeleteLocalBranch bool `yaml:"delete_local_branch" mapstructure:"delete_local_branch"`
}

SCMCleanupConfig contains settings for cleanup after PR creation

type SCMConfig added in v0.62.0

type SCMConfig struct {
	PRCreate SCMPRCreateConfig `yaml:"pr_create" mapstructure:"pr_create"`
	Cleanup  SCMCleanupConfig  `yaml:"cleanup" mapstructure:"cleanup"`
}

SCMConfig contains settings for source control management shortcuts

type SCMPRCreateConfig added in v0.62.0

type SCMPRCreateConfig struct {
	Prompt       string `yaml:"prompt" mapstructure:"prompt"`
	BaseBranch   string `yaml:"base_branch" mapstructure:"base_branch"`
	BranchPrefix string `yaml:"branch_prefix" mapstructure:"branch_prefix"`
	Model        string `yaml:"model" mapstructure:"model"`
}

SCMPRCreateConfig contains settings for the /scm pr create shortcut

type SQLiteStorageConfig added in v0.45.0

type SQLiteStorageConfig struct {
	Path string `yaml:"path" mapstructure:"path"`
}

SQLiteStorageConfig contains SQLite-specific configuration

type SSHServerConfig added in v0.95.0

type SSHServerConfig struct {
	Name        string   `yaml:"name" mapstructure:"name"`
	ID          string   `yaml:"id" mapstructure:"id"`
	RemoteHost  string   `yaml:"remote_host" mapstructure:"remote_host"`
	RemotePort  int      `yaml:"remote_port" mapstructure:"remote_port"`
	RemoteUser  string   `yaml:"remote_user" mapstructure:"remote_user"`
	CommandPath string   `yaml:"command_path" mapstructure:"command_path"`
	CommandArgs []string `yaml:"command_args" mapstructure:"command_args"`
	AutoInstall *bool    `yaml:"auto_install,omitempty" mapstructure:"auto_install"`
	InstallPath string   `yaml:"install_path" mapstructure:"install_path"`
	Description string   `yaml:"description" mapstructure:"description"`
	Tags        []string `yaml:"tags" mapstructure:"tags"`
}

SSHServerConfig contains configuration for a single remote SSH server

type SafetyConfig added in v0.3.0

type SafetyConfig struct {
	RequireApproval bool `yaml:"require_approval" mapstructure:"require_approval"`
}

SafetyConfig contains safety approval settings

type SandboxConfig added in v0.29.0

type SandboxConfig struct {
	Directories    []string `yaml:"directories" mapstructure:"directories"`
	ProtectedPaths []string `yaml:"protected_paths" mapstructure:"protected_paths"`
}

SandboxConfig contains sandbox directory settings

type ScreenshotToolConfig added in v0.96.0

type ScreenshotToolConfig struct {
	Enabled          bool   `yaml:"enabled" mapstructure:"enabled"`
	MaxWidth         int    `yaml:"max_width" mapstructure:"max_width"`
	MaxHeight        int    `yaml:"max_height" mapstructure:"max_height"`
	TargetWidth      int    `yaml:"target_width" mapstructure:"target_width"`
	TargetHeight     int    `yaml:"target_height" mapstructure:"target_height"`
	Format           string `yaml:"format" mapstructure:"format"`
	Quality          int    `yaml:"quality" mapstructure:"quality"`
	StreamingEnabled bool   `yaml:"streaming_enabled" mapstructure:"streaming_enabled"`
	CaptureInterval  int    `yaml:"capture_interval" mapstructure:"capture_interval"`
	BufferSize       int    `yaml:"buffer_size" mapstructure:"buffer_size"`
	TempDir          string `yaml:"temp_dir" mapstructure:"temp_dir"`
	LogCaptures      bool   `yaml:"log_captures" mapstructure:"log_captures"`
	ShowOverlay      bool   `yaml:"show_overlay" mapstructure:"show_overlay"`
}

ScreenshotToolConfig contains screenshot-specific tool settings

type StatusBarConfig added in v0.83.0

type StatusBarConfig struct {
	Enabled    bool                `yaml:"enabled" mapstructure:"enabled"`
	Indicators StatusBarIndicators `yaml:"indicators" mapstructure:"indicators"`
}

StatusBarConfig contains settings for the chat status bar The status bar displays model information and system status indicators

func GetDefaultStatusBarConfig added in v0.83.0

func GetDefaultStatusBarConfig() StatusBarConfig

GetDefaultStatusBarConfig returns the default status bar configuration All indicators are enabled by default except MaxOutput to maintain current behavior

type StatusBarIndicators added in v0.83.0

type StatusBarIndicators struct {
	Model            bool `yaml:"model" mapstructure:"model"`
	Theme            bool `yaml:"theme" mapstructure:"theme"`
	MaxOutput        bool `yaml:"max_output" mapstructure:"max_output"`
	A2AAgents        bool `yaml:"a2a_agents" mapstructure:"a2a_agents"`
	Tools            bool `yaml:"tools" mapstructure:"tools"`
	BackgroundShells bool `yaml:"background_shells" mapstructure:"background_shells"`
	A2ATasks         bool `yaml:"a2a_tasks" mapstructure:"a2a_tasks"`
	MCP              bool `yaml:"mcp" mapstructure:"mcp"`
	ContextUsage     bool `yaml:"context_usage" mapstructure:"context_usage"`
	SessionTokens    bool `yaml:"session_tokens" mapstructure:"session_tokens"`
	Cost             bool `yaml:"cost" mapstructure:"cost"`
	GitBranch        bool `yaml:"git_branch" mapstructure:"git_branch"`
}

StatusBarIndicators contains individual enable/disable toggles for each indicator All indicators are enabled by default to maintain current behavior

type StorageConfig added in v0.45.0

type StorageConfig struct {
	Enabled  bool                  `yaml:"enabled" mapstructure:"enabled"`
	Type     StorageType           `yaml:"type" mapstructure:"type"`
	SQLite   SQLiteStorageConfig   `yaml:"sqlite,omitempty" mapstructure:"sqlite,omitempty"`
	Postgres PostgresStorageConfig `yaml:"postgres,omitempty" mapstructure:"postgres,omitempty"`
	Redis    RedisStorageConfig    `yaml:"redis,omitempty" mapstructure:"redis,omitempty"`
	Jsonl    JsonlStorageConfig    `yaml:"jsonl,omitempty" mapstructure:"jsonl,omitempty"`
}

StorageConfig contains storage backend configuration

type StorageType added in v0.45.0

type StorageType string

StorageType represents the type of storage backend

const (
	StorageTypeMemory   StorageType = "memory"
	StorageTypeSQLite   StorageType = "sqlite"
	StorageTypePostgres StorageType = "postgres"
	StorageTypeRedis    StorageType = "redis"
	StorageTypeJsonl    StorageType = "jsonl"
)

type SubmitTaskToolConfig added in v0.51.0

type SubmitTaskToolConfig struct {
	Enabled         bool  `yaml:"enabled" mapstructure:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
}

SubmitTaskToolConfig contains SubmitTask-specific tool settings

type SystemRemindersConfig added in v0.35.0

type SystemRemindersConfig struct {
	Enabled      bool   `yaml:"enabled" mapstructure:"enabled"`
	Interval     int    `yaml:"interval" mapstructure:"interval"`
	ReminderText string `yaml:"reminder_text" mapstructure:"reminder_text"`
}

SystemRemindersConfig contains settings for dynamic system reminders

type TodoWriteToolConfig added in v0.20.0

type TodoWriteToolConfig struct {
	Enabled         bool  `yaml:"enabled" mapstructure:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
}

TodoWriteToolConfig contains TodoWrite-specific tool settings

type ToolWhitelistConfig

type ToolWhitelistConfig struct {
	Commands []string `yaml:"commands" mapstructure:"commands"`
	Patterns []string `yaml:"patterns" mapstructure:"patterns"`
}

ToolWhitelistConfig contains whitelisted commands and patterns

type ToolsConfig

type ToolsConfig struct {
	Enabled   bool                `yaml:"enabled" mapstructure:"enabled"`
	Sandbox   SandboxConfig       `yaml:"sandbox" mapstructure:"sandbox"`
	Bash      BashToolConfig      `yaml:"bash" mapstructure:"bash"`
	Read      ReadToolConfig      `yaml:"read" mapstructure:"read"`
	Write     WriteToolConfig     `yaml:"write" mapstructure:"write"`
	Edit      EditToolConfig      `yaml:"edit" mapstructure:"edit"`
	Delete    DeleteToolConfig    `yaml:"delete" mapstructure:"delete"`
	Grep      GrepToolConfig      `yaml:"grep" mapstructure:"grep"`
	Tree      TreeToolConfig      `yaml:"tree" mapstructure:"tree"`
	WebFetch  WebFetchToolConfig  `yaml:"web_fetch" mapstructure:"web_fetch"`
	WebSearch WebSearchToolConfig `yaml:"web_search" mapstructure:"web_search"`
	Github    GithubToolConfig    `yaml:"github" mapstructure:"github"`
	TodoWrite TodoWriteToolConfig `yaml:"todo_write" mapstructure:"todo_write"`

	Safety SafetyConfig `yaml:"safety" mapstructure:"safety"`
}

ToolsConfig contains tool execution settings

type TreeToolConfig added in v0.16.0

type TreeToolConfig struct {
	Enabled         bool  `yaml:"enabled" mapstructure:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
}

TreeToolConfig contains tree-specific tool settings

type WebConfig added in v0.94.0

type WebConfig struct {
	Enabled               bool              `yaml:"enabled" mapstructure:"enabled"`
	Port                  int               `yaml:"port" mapstructure:"port"`
	Host                  string            `yaml:"host" mapstructure:"host"`
	SessionInactivityMins int               `yaml:"session_inactivity_mins" mapstructure:"session_inactivity_mins"`
	SSH                   WebSSHConfig      `yaml:"ssh" mapstructure:"ssh"`
	Servers               []SSHServerConfig `yaml:"servers" mapstructure:"servers"`
}

WebConfig contains web terminal settings

type WebFetchToolConfig added in v0.24.1

type WebFetchToolConfig struct {
	Enabled            bool              `yaml:"enabled" mapstructure:"enabled"`
	WhitelistedDomains []string          `yaml:"whitelisted_domains" mapstructure:"whitelisted_domains"`
	Safety             FetchSafetyConfig `yaml:"safety" mapstructure:"safety"`
	Cache              FetchCacheConfig  `yaml:"cache" mapstructure:"cache"`
	RequireApproval    *bool             `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
}

WebFetchToolConfig contains fetch-specific tool settings

type WebSSHConfig added in v0.95.0

type WebSSHConfig struct {
	Enabled        bool   `yaml:"enabled" mapstructure:"enabled"`
	UseSSHConfig   bool   `yaml:"use_ssh_config" mapstructure:"use_ssh_config"`
	KnownHostsPath string `yaml:"known_hosts_path" mapstructure:"known_hosts_path"`
	AutoInstall    bool   `yaml:"auto_install" mapstructure:"auto_install"`
	InstallVersion string `yaml:"install_version" mapstructure:"install_version"`
	InstallDir     string `yaml:"install_dir" mapstructure:"install_dir"`
}

WebSSHConfig contains SSH connection settings for remote servers

type WebSearchToolConfig added in v0.14.1

type WebSearchToolConfig struct {
	Enabled         bool     `yaml:"enabled" mapstructure:"enabled"`
	DefaultEngine   string   `yaml:"default_engine" mapstructure:"default_engine"`
	MaxResults      int      `yaml:"max_results" mapstructure:"max_results"`
	Engines         []string `yaml:"engines" mapstructure:"engines"`
	Timeout         int      `yaml:"timeout" mapstructure:"timeout"`
	RequireApproval *bool    `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
}

WebSearchToolConfig contains web search-specific tool settings

type WriteToolConfig added in v0.17.0

type WriteToolConfig struct {
	Enabled         bool  `yaml:"enabled" mapstructure:"enabled"`
	RequireApproval *bool `yaml:"require_approval,omitempty" mapstructure:"require_approval,omitempty"`
}

WriteToolConfig contains write-specific tool settings

Jump to

Keyboard shortcuts

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