Documentation
¶
Index ¶
- Variables
- func ClearSession() error
- func ConfigDir() string
- func ConfigPath() string
- func ExportSession(s *Session, path string) error
- func FormatCapabilities(m ModelSummary) string
- func SaveSession(s *Session) error
- func SessionPath() string
- type AuthMethod
- type Config
- type ConsensusConfig
- type HooksConfig
- type MCPConfig
- type MCPServerConfig
- type MetadataConfig
- type ModelSummary
- type ProviderConfig
- type ProviderType
- type RolesConfig
- type RoutingConfig
- type Session
- type SessionExchange
- type SessionMessage
- type TUIConfig
- type ToolCallRecord
- type ToolResultRecord
Constants ¶
This section is empty.
Variables ¶
var AuthMethodsByType = map[ProviderType][]AuthMethod{ ProviderTypeAnthropic: {AuthMethodAPIKey}, ProviderTypeOpenAI: {AuthMethodAPIKey}, ProviderTypeGoogle: {AuthMethodAPIKey, AuthMethodOAuth}, ProviderTypeOpenAICompatible: {AuthMethodAPIKey, AuthMethodNone}, }
AuthMethodsByType maps provider type to valid auth methods. Note: OAuth is only offered for Google (which has a public device flow). Anthropic and OpenAI do not support OAuth for third-party apps.
var DefaultModelByType = map[ProviderType]string{
ProviderTypeAnthropic: "claude-sonnet-4-20250514",
ProviderTypeOpenAI: "gpt-4o",
ProviderTypeGoogle: "gemini-2.5-pro",
}
DefaultModelByType maps provider type to its most popular model.
Functions ¶
func ClearSession ¶ added in v0.2.0
func ClearSession() error
ClearSession removes the saved session file.
func ConfigPath ¶
func ConfigPath() string
func ExportSession ¶ added in v1.4.0
ExportSession writes the session as JSON to the given file path.
func FormatCapabilities ¶ added in v1.1.0
func FormatCapabilities(m ModelSummary) string
FormatCapabilities returns a human-readable capability string. e.g. "200K context | tools | vision | reasoning"
func SaveSession ¶ added in v0.2.0
SaveSession writes the session to disk.
func SessionPath ¶ added in v0.2.0
func SessionPath() string
SessionPath returns the path to the session file.
Types ¶
type AuthMethod ¶
type AuthMethod string
const ( AuthMethodAPIKey AuthMethod = "api_key" AuthMethodOAuth AuthMethod = "oauth" AuthMethodNone AuthMethod = "none" )
type Config ¶
type Config struct {
Providers []ProviderConfig `yaml:"providers"`
Consensus ConsensusConfig `yaml:"consensus"`
TUI TUIConfig `yaml:"tui"`
Metadata MetadataConfig `yaml:"metadata,omitempty"`
Roles RolesConfig `yaml:"roles,omitempty"`
Routing RoutingConfig `yaml:"routing,omitempty"`
Hooks HooksConfig `yaml:"hooks,omitempty"`
DefaultMode string `yaml:"mode,omitempty"`
MCP MCPConfig `yaml:"mcp,omitempty"`
}
func DefaultConfig ¶
func DefaultConfig() Config
func (*Config) PrimaryProvider ¶
func (c *Config) PrimaryProvider() *ProviderConfig
type ConsensusConfig ¶
type HooksConfig ¶ added in v1.0.0
type HooksConfig struct {
PreQuery string `yaml:"pre_query,omitempty"`
PostQuery string `yaml:"post_query,omitempty"`
PostTool string `yaml:"post_tool,omitempty"`
OnError string `yaml:"on_error,omitempty"`
}
HooksConfig defines shell commands to run at lifecycle events.
type MCPConfig ¶ added in v1.0.0
type MCPConfig struct {
Servers []MCPServerConfig `yaml:"servers,omitempty"`
}
MCPConfig holds MCP client configuration.
type MCPServerConfig ¶ added in v1.0.0
type MCPServerConfig struct {
Name string `yaml:"name"`
Command string `yaml:"command,omitempty"` // for stdio transport
Args []string `yaml:"args,omitempty"`
URL string `yaml:"url,omitempty"` // for SSE transport
}
MCPServerConfig defines an external MCP server to connect to.
type MetadataConfig ¶
type ModelSummary ¶ added in v1.1.0
type ModelSummary struct {
Name string
MaxInputTokens int
SupportsFunctionCalling bool
SupportsVision bool
SupportsReasoning bool
}
ModelSummary holds display info for a model in the wizard.
type ProviderConfig ¶
type ProviderConfig struct {
Name string `yaml:"name"`
Type ProviderType `yaml:"type"`
Auth AuthMethod `yaml:"auth"`
Model string `yaml:"model"`
Primary bool `yaml:"primary,omitempty"`
BaseURL string `yaml:"base_url,omitempty"`
MaxContext int `yaml:"max_context,omitempty"`
OAuthClientID string `yaml:"oauth_client_id,omitempty"`
OAuthDeviceURL string `yaml:"oauth_device_url,omitempty"`
OAuthTokenURL string `yaml:"oauth_token_url,omitempty"`
}
type ProviderType ¶
type ProviderType string
const ( ProviderTypeAnthropic ProviderType = "anthropic" ProviderTypeOpenAI ProviderType = "openai" ProviderTypeGoogle ProviderType = "google" ProviderTypeOpenAICompatible ProviderType = "openai_compatible" )
type RolesConfig ¶ added in v0.2.0
type RoutingConfig ¶ added in v0.2.0
type RoutingConfig struct {
CalibrationInterval int `yaml:"calibration_interval,omitempty"` // default 10
}
type Session ¶ added in v0.2.0
type Session struct {
Messages []SessionMessage `json:"messages"`
Exchanges []SessionExchange `json:"exchanges"`
UpdatedAt time.Time `json:"updated_at"`
}
Session holds the full conversation state for persistence.
func LoadSession ¶ added in v0.2.0
LoadSession reads a saved session from disk. Returns nil (no error) if no session file exists.
type SessionExchange ¶ added in v0.2.0
type SessionExchange struct {
Prompt string `json:"prompt"`
ConsensusResponse string `json:"consensus_response"`
Individual map[string]string `json:"individual,omitempty"`
}
SessionExchange is a serializable prompt/response pair for display history.
type SessionMessage ¶ added in v0.2.0
type SessionMessage struct {
Role string `json:"role"`
Content string `json:"content"`
ToolCalls []ToolCallRecord `json:"tool_calls,omitempty"`
ToolResult *ToolResultRecord `json:"tool_result,omitempty"`
}
SessionMessage is a serializable conversation message.
type ToolCallRecord ¶ added in v0.2.0
type ToolCallRecord struct {
ID string `json:"id"`
Name string `json:"name"`
Arguments string `json:"arguments"`
}
ToolCallRecord is a serializable tool call.
type ToolResultRecord ¶ added in v0.2.0
type ToolResultRecord struct {
ToolCallID string `json:"tool_call_id"`
Output string `json:"output"`
Error string `json:"error,omitempty"`
}
ToolResultRecord is a serializable tool result.