Documentation
¶
Index ¶
- Constants
- func DefaultPath() (string, error)
- func Ensure(path string) (created bool, returnErr error)
- func IsWorkspaceTrusted(configuration File, workspace string) bool
- func Path(lookupEnv func(string) (string, bool)) (string, error)
- func ProjectPath(workspace string) string
- func Save(path string, configuration File) error
- func TrustWorkspace(path, workspace string) error
- type File
- type Hook
- type MCPServer
- type ProviderConfig
Constants ¶
const ( DefaultURL = "https://api.openai.com/v1" DefaultModel = "gpt-5.6" )
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
func Ensure ¶
Ensure creates a secure configuration directory and starter file. Existing configuration content is never overwritten. It returns true when a new file was created.
func IsWorkspaceTrusted ¶
IsWorkspaceTrusted compares canonical paths so symlink aliases cannot grant trust to a different directory.
func ProjectPath ¶
func TrustWorkspace ¶
TrustWorkspace atomically records an explicit trust decision in the user configuration. This intentionally happens only through --trust-project.
Types ¶
type File ¶
type File struct {
ConfigVersion int `yaml:"config_version,omitempty"`
URL string `yaml:"url"`
Model string `yaml:"model"`
Models []string `yaml:"models,omitempty"`
Providers []ProviderConfig `yaml:"providers,omitempty"`
ModelCatalog map[string]modelcatalog.Capabilities `yaml:"model_catalog,omitempty"`
ReasoningEffort string `yaml:"reasoning_effort,omitempty"`
ServiceTier string `yaml:"service_tier,omitempty"`
FallbackModels []string `yaml:"fallback_models,omitempty"`
Token string `yaml:"token"`
TokenCommand []string `yaml:"token_command,omitempty"`
Instructions string `yaml:"instructions,omitempty"`
ProjectDocFallbacks []string `yaml:"project_doc_fallback_filenames,omitempty"`
ProjectDocMaxBytes int `yaml:"project_doc_max_bytes,omitempty"`
ReadRoots []string `yaml:"read_roots,omitempty"`
WriteRoots []string `yaml:"write_roots,omitempty"`
DenyRoots []string `yaml:"deny_roots,omitempty"`
MemoryMaxTokens int `yaml:"memory_max_tokens,omitempty"`
MemoryAutoCapture *bool `yaml:"memory_auto_capture,omitempty"`
MemoryGenerate *bool `yaml:"memory_generate,omitempty"`
MemoryUse *bool `yaml:"memory_use,omitempty"`
MemoryDedicatedTools *bool `yaml:"memory_dedicated_tools,omitempty"`
MemoryMaxRolloutsPerStartup int `yaml:"memory_max_rollouts_per_startup,omitempty"`
MemoryMaxRolloutAgeDays int `yaml:"memory_max_rollout_age_days,omitempty"`
MemoryMinRolloutIdleHours int `yaml:"memory_min_rollout_idle_hours,omitempty"`
MemoryMaxRawForConsolidation int `yaml:"memory_max_raw_memories_for_consolidation,omitempty"`
MemoryMaxUnusedDays int `yaml:"memory_max_unused_days,omitempty"`
MemoryExtractModel string `yaml:"memory_extract_model,omitempty"`
MemoryConsolidationModel string `yaml:"memory_consolidation_model,omitempty"`
Theme string `yaml:"theme,omitempty"`
Keymap string `yaml:"keymap,omitempty"`
Notification string `yaml:"notification,omitempty"`
TerminalTitle string `yaml:"terminal_title,omitempty"`
DebugLog string `yaml:"debug_log,omitempty"`
Stream *bool `yaml:"stream,omitempty"`
Timeout string `yaml:"timeout,omitempty"`
MaxRetries int `yaml:"max_retries,omitempty"`
Approval string `yaml:"approval,omitempty"`
ApprovalCategories map[string]bool `yaml:"approval_categories,omitempty"`
MaxTurns int `yaml:"max_turns,omitempty"`
ContextWindowTokens int `yaml:"context_window_tokens,omitempty"`
AutoCompactTokens int `yaml:"auto_compact_tokens,omitempty"`
UsableContextTokens int `yaml:"usable_context_tokens,omitempty"`
ToolOutputTokens int `yaml:"tool_output_tokens,omitempty"`
GoalAutoContinue *bool `yaml:"goal_auto_continue,omitempty"`
AlternateScreen *bool `yaml:"alternate_screen,omitempty"`
TrustedWorkspaces []string `yaml:"trusted_workspaces,omitempty"`
MCPServers map[string]MCPServer `yaml:"mcp_servers,omitempty"`
Hooks map[string][]Hook `yaml:"hooks,omitempty"`
}
File is the user-editable YAML configuration stored in ~/.supercode. Stream is a pointer so an omitted value can be distinguished from false.
type MCPServer ¶
type MCPServer struct {
Transport string `yaml:"transport,omitempty"`
Command string `yaml:"command,omitempty"`
Args []string `yaml:"args,omitempty"`
Env map[string]string `yaml:"env,omitempty"`
URL string `yaml:"url,omitempty"`
Headers map[string]string `yaml:"headers,omitempty"`
OAuthTokenCommand []string `yaml:"oauth_token_command,omitempty"`
Enabled *bool `yaml:"enabled,omitempty"`
}
type ProviderConfig ¶
type ProviderConfig struct {
Name string `yaml:"name"`
Provider string `yaml:"provider"`
URL string `yaml:"url,omitempty"`
Token string `yaml:"token,omitempty"`
TokenCommand []string `yaml:"token_command,omitempty"`
Models []string `yaml:"models"`
MaxTokens int64 `yaml:"maxTokens,omitempty"`
Headers map[string]string `yaml:"headers,omitempty"`
}
ProviderConfig describes one named model endpoint. Provider selects the wire protocol: openai, openai_responses, anthropic, or openrouter.