Documentation
¶
Index ¶
- Constants
- func AllDigits(s string) bool
- func AppendOrUpdateProvider(r *Root, p Provider)
- func ApplyOAuthTokens(p *Provider, t codex.TokenSet)
- func ApplyOnboardMerge(dst *Root, res *OnboardResult)
- func BackupConfig() (string, error)
- func ClampTimeoutMinutes(n int) error
- func ConfigExists() (bool, error)
- func ConfirmOnboardRerun(pio PromptIO) (bool, error)
- func EffectiveCompactionThresholdTokens(r *Root) int64
- func EffectiveSkillSearchMinNorm(r *Root) float64
- func EnsureChatGPTSubBaseURL(p *Provider)
- func EnsureClaudeSubBaseURL(p *Provider)
- func FirstProviderName(r *Root) string
- func IsOAuthAuthKind(kind string) bool
- func ModelPassesChatGPTSubFilter(modelID string) bool
- func ModelPassesClaudeSubFilter(modelID string) bool
- func NeedsOnboard(r *Root) bool
- func NormalizeAPIBase(raw string) (string, error)
- func NormalizeAnthropicBase(raw string) (string, error)
- func NoteRecentModelUse(r *Root, providerName, modelID string)
- func ParseReasoningEffortToken(s string) (string, error)
- func PickModelInteractive(pio PromptIO, p *Provider, providerLabel string, ids []string, allowSkip bool) (string, error)
- func PrintConfigSkipHint(out io.Writer, topic string)
- func ProviderCredentialsReady(p *Provider) bool
- func ReadPromptLine(p PromptIO, prompt string) (string, error)
- func ResolveExecConfig(existing *Root, opts ExecResolveOpts) (*Root, *Provider, error)
- func ResolveProviderBearer(ctx context.Context, r *Root, p *Provider) (string, error)
- func RunInitialSetup(pio PromptIO, errOut io.Writer, cfg *Root, configExists bool) error
- func Save(r *Root) error
- func SubagentTimeout(r *Root) int
- func WriteConfigSetupWarning(w io.Writer, r *Root)
- type APIResilienceConfig
- type APIResiliencePolicy
- type Current
- type ExecResolveOpts
- type ModelPickChoice
- type OAuthTokenSet
- type OnboardOpts
- type OnboardResult
- type PromptIO
- type Provider
- func (p *Provider) EffectiveAPIProtocol() string
- func (p *Provider) EffectiveAuthKind() string
- func (p *Provider) IsAnthropic() bool
- func (p *Provider) IsChatGPTSub() bool
- func (p *Provider) IsClaudeSub() bool
- func (p *Provider) IsCursorAPI() bool
- func (p *Provider) IsOAuthProvider() bool
- func (p *Provider) UsesAnthropicOAuthBearer() bool
- type RecentModelUse
- type Root
- func (r *Root) EffectiveResponseLanguage() string
- func (r *Root) EffectiveWebSearchEngine() string
- func (r *Root) GlobalReasoningEffort() shared.ReasoningEffort
- func (r *Root) LegacyToolsEnabled() bool
- func (r *Root) LegacyToolsForceEnabled() bool
- func (r *Root) ReasoningEffortIsNone() bool
- func (r *Root) ReasoningEffortLabel() string
- func (r *Root) UsageStatsEnabled() bool
- type ToolOutput
- type Tools
Constants ¶
View Source
const ( EnvOpenAIBaseURL = "OPENAI_BASE_URL" EnvOpenAIAPIKey = "OPENAI_API_KEY" EnvModelID = "MODEL_ID" )
View Source
const ( ProviderNameChatGPTSub = "ChatGPT Sub" ProviderNameClaudeSub = "Claude Sub" ProviderNameCursorAPI = "Cursor API" OpenAIPlatformBase = "https://api.openai.com" AnthropicPlatformBase = "https://api.anthropic.com" AuthKindAPIKey = "api_key" AuthKindOAuthChatGPT = "oauth_chatgpt" AuthKindOAuthClaude = "oauth_claude" AuthKindCursorAPI = "cursor_api" ClaudeSubExpectedDate = "2026-06-15" )
View Source
const APIProtocolAnthropic = "anthropic"
View Source
const APIProtocolOpenAI = "openai"
View Source
const DefaultAPIBaseDelayMS = 1000
View Source
const DefaultAPICircuitOpenSec = 60
View Source
const DefaultAPIConnectTimeoutSec = 30
View Source
const DefaultAPIMaxDelayMS = 30000
View Source
const DefaultAPIMaxRetries = 3
View Source
const DefaultCompactionThresholdTokens int64 = 131072
View Source
const DefaultResponseLanguage = "English"
View Source
const DefaultSkillSearchMinNormalizedScore = 0.05
View Source
const DefaultSubagentTimeoutMinutes = 20
View Source
const DefaultToolOutputMaxBytes = 65536
View Source
const DefaultToolOutputMaxLines = 2048
View Source
const DefaultWebSearchEngine = "duckduckgo"
View Source
const MinCompactionThresholdTokens int64 = 32768
Variables ¶
This section is empty.
Functions ¶
func AppendOrUpdateProvider ¶ added in v0.20260521.1
func ApplyOAuthTokens ¶ added in v0.20260521.1
func ApplyOnboardMerge ¶
func ApplyOnboardMerge(dst *Root, res *OnboardResult)
func BackupConfig ¶
func ClampTimeoutMinutes ¶
func ConfigExists ¶
func ConfirmOnboardRerun ¶
func EnsureChatGPTSubBaseURL ¶ added in v0.20260521.1
func EnsureChatGPTSubBaseURL(p *Provider)
func EnsureClaudeSubBaseURL ¶ added in v0.20260521.2
func EnsureClaudeSubBaseURL(p *Provider)
func FirstProviderName ¶ added in v0.20260521.2
func IsOAuthAuthKind ¶ added in v0.20260521.2
func ModelPassesChatGPTSubFilter ¶ added in v0.20260521.1
func ModelPassesClaudeSubFilter ¶ added in v0.20260521.2
func NeedsOnboard ¶
func NormalizeAPIBase ¶
func NormalizeAnthropicBase ¶ added in v0.20260521.2
func NoteRecentModelUse ¶
func PickModelInteractive ¶
func PrintConfigSkipHint ¶
func ProviderCredentialsReady ¶ added in v0.20260521.1
func ReadPromptLine ¶ added in v0.20260521.2
func ResolveExecConfig ¶
func ResolveExecConfig(existing *Root, opts ExecResolveOpts) (*Root, *Provider, error)
func ResolveProviderBearer ¶ added in v0.20260521.1
func RunInitialSetup ¶
func SubagentTimeout ¶
func WriteConfigSetupWarning ¶
Types ¶
type APIResilienceConfig ¶ added in v0.20260523.0
type APIResilienceConfig struct {
MaxRetries int `toml:"max_retries,omitempty"`
BaseDelayMS int `toml:"base_delay_ms,omitempty"`
MaxDelayMS int `toml:"max_delay_ms,omitempty"`
Jitter *bool `toml:"jitter,omitempty"`
ConnectTimeoutSec int `toml:"connect_timeout_sec,omitempty"`
ReadTimeoutSec int `toml:"read_timeout_sec,omitempty"`
CircuitOpenSec int `toml:"circuit_open_sec,omitempty"`
}
type APIResiliencePolicy ¶ added in v0.20260523.0
type APIResiliencePolicy struct {
MaxRetries int
BaseDelay time.Duration
MaxDelay time.Duration
Jitter bool
ConnectTimeout time.Duration
ReadTimeout time.Duration
CircuitOpen time.Duration
}
func EffectiveAPIResilience ¶ added in v0.20260523.0
func EffectiveAPIResilience(r *Root) APIResiliencePolicy
type ExecResolveOpts ¶
type ExecResolveOpts struct {
EnvFile string
}
type ModelPickChoice ¶
func PickModelAfterAdd ¶
type OAuthTokenSet ¶ added in v0.20260521.2
type OnboardOpts ¶
type OnboardOpts struct {
RequireProvider bool
}
type OnboardResult ¶
type OnboardResult struct {
UserName string
ResponseLanguage string
SubagentTimeoutMinutes int
CompactionThresholdTokens int64
NewProvider *Provider
SwitchCurrent bool
CurrentProvider string
CurrentModel string
}
func RunOnboardWizard ¶
func RunOnboardWizard(pio PromptIO, existing *Root, opts OnboardOpts) (*OnboardResult, error)
type Provider ¶
type Provider struct {
Name string `toml:"-"`
BaseURL string `toml:"base_url"`
APIKey string `toml:"api_key"`
APIProtocol string `toml:"api_protocol,omitempty"`
AuthKind string `toml:"auth_kind,omitempty"`
OAuthAccessToken string `toml:"oauth_access_token,omitempty"`
OAuthRefreshToken string `toml:"oauth_refresh_token,omitempty"`
OAuthExpiresAt string `toml:"oauth_expires_at,omitempty"`
OAuthAccountID string `toml:"oauth_account_id,omitempty"`
}
func NewChatGPTSubProvider ¶ added in v0.20260521.1
func ProviderByName ¶ added in v0.20260521.2
func ProviderList ¶ added in v0.20260521.2
func ResolveProvider ¶
func (*Provider) EffectiveAPIProtocol ¶ added in v0.20260521.2
func (*Provider) EffectiveAuthKind ¶ added in v0.20260521.1
func (*Provider) IsAnthropic ¶ added in v0.20260521.2
func (*Provider) IsChatGPTSub ¶ added in v0.20260521.1
func (*Provider) IsClaudeSub ¶ added in v0.20260521.2
func (*Provider) IsCursorAPI ¶ added in v0.20260525.0
func (*Provider) IsOAuthProvider ¶ added in v0.20260521.2
func (*Provider) UsesAnthropicOAuthBearer ¶ added in v0.20260521.2
type RecentModelUse ¶
func RecentModelUseEntries ¶ added in v0.20260521.2
func RecentModelUseEntries(r *Root, preferProvider string) []RecentModelUse
type Root ¶
type Root struct {
UserName string `toml:"user_name"`
Providers map[string]*Provider `toml:"-"`
Current Current `toml:"current"`
RecentModels map[string][]string `toml:"recent_models,omitempty"`
SubagentTimeoutMinutes int `toml:"subagent_timeout_minutes"`
ReasoningEffort string `toml:"reasoning_effort"`
LogLevel string `toml:"log_level"`
MaxResponseTokens int `toml:"max_response_tokens"`
ShowThinking bool `toml:"show_thinking"`
Tools Tools `toml:"tools,omitempty"`
ShowUsageStats *bool `toml:"show_usage_stats"`
ResponseLanguage string `toml:"response_language"`
CompactionThresholdTokens int64 `toml:"compaction_threshold_tokens"`
SkillSearchMinNorm *float64 `toml:"skill_search_min_normalized_score,omitempty"`
WebSearchEngine string `toml:"web_search_engine,omitempty"`
WebSearchAPIKey string `toml:"web_search_api_key,omitempty"`
WebSearchBaseURL string `toml:"web_search_base_url,omitempty"`
WebSearchCX string `toml:"web_search_cx,omitempty"`
ToolOutput ToolOutput `toml:"tool_output,omitempty"`
APIResilience APIResilienceConfig `toml:"api_resilience,omitempty"`
}
func LoadOptional ¶
func (*Root) EffectiveResponseLanguage ¶
func (*Root) EffectiveWebSearchEngine ¶
func (*Root) GlobalReasoningEffort ¶
func (r *Root) GlobalReasoningEffort() shared.ReasoningEffort
func (*Root) LegacyToolsEnabled ¶ added in v0.20260523.0
func (*Root) LegacyToolsForceEnabled ¶ added in v0.20260523.0
func (*Root) ReasoningEffortIsNone ¶
func (*Root) ReasoningEffortLabel ¶
func (*Root) UsageStatsEnabled ¶
type ToolOutput ¶ added in v0.20260522.0
Click to show internal directories.
Click to hide internal directories.