config

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigDirName = ".pi"
	EnvAgentDir   = "PI_CODING_AGENT_DIR"
	EnvSessionDir = "PI_CODING_AGENT_SESSION_DIR"
)

Variables

View Source
var HTTPIdleTimeoutChoices = []HTTPIdleTimeoutChoice{
	{Label: "30 sec", TimeoutMS: 30_000},
	{Label: "1 min", TimeoutMS: 60_000},
	{Label: "2 min", TimeoutMS: 120_000},
	{Label: "5 min", TimeoutMS: 300_000},
	{Label: "disabled", TimeoutMS: 0},
}

HTTPIdleTimeoutChoices lists the /settings selector values in upstream order.

Functions

func ApplyHTTPProxySettings

func ApplyHTTPProxySettings(proxy string)

ApplyHTTPProxySettings exports the configured proxy as HTTP_PROXY and HTTPS_PROXY unless the environment already sets them, matching upstream's applyHttpProxySettings; Go's default transport then honors them.

func ApplyModelConfig

func ApplyModelConfig(base []ai.Model, config *ModelConfig) ([]ai.Model, error)

ApplyModelConfig overlays models.json using upstream's built-in/custom upsert order.

func ClearConfigValueCache

func ClearConfigValueCache()

func FallbackRequestAuthResolver

func FallbackRequestAuthResolver(credentials aiauth.CredentialStore) func(context.Context, ai.ProviderID) (*RequestAuth, error)

FallbackRequestAuthResolver resolves auth using only stored credentials and built-in provider auth methods, without a ModelRegistry.

func FormatHTTPIdleTimeoutMS

func FormatHTTPIdleTimeoutMS(timeoutMS int64) string

FormatHTTPIdleTimeoutMS renders a timeout as its choice label, falling back to upstream's "<seconds> sec" (JS number formatting) for custom values.

func FormatProjectTrustPrompt

func FormatProjectTrustPrompt(cwd string) string

FormatProjectTrustPrompt is the prompt shown when asking for project trust (upstream project-trust.ts formatProjectTrustPrompt).

func GetAgentDir

func GetAgentDir() (string, error)

func GetConfigValueEnvVarName

func GetConfigValueEnvVarName(value string) (string, bool)

func GetConfigValueEnvVarNames

func GetConfigValueEnvVarNames(value string) []string

func GetMissingConfigValueEnvVarNames

func GetMissingConfigValueEnvVarNames(value string, scopedEnv map[string]string) []string

func GetProjectTrustParentPath

func GetProjectTrustParentPath(cwd string) string

func HasTrustRequiringProjectResources

func HasTrustRequiringProjectResources(cwd string) bool

HasTrustRequiringProjectResources reports whether cwd has project-local resources gated by project trust: trust-requiring entries under cwd/.pi, or .agents/skills in cwd or an ancestor. The user-global ~/.agents/skills is always a trusted user resource and is ignored here, even when cwd is $HOME.

func IsCommandConfigValue

func IsCommandConfigValue(value string) bool

func IsConfigValueConfigured

func IsConfigValueConfigured(value string, scopedEnv map[string]string) bool

func MigrateAuthToAuthJSON

func MigrateAuthToAuthJSON(agentDir string) ([]string, error)

func NormalizePath

func NormalizePath(path string) (string, error)

func ProjectNpmInstallRoot added in v0.4.7

func ProjectNpmInstallRoot(cwd string) string

func ReadStoredCredential

func ReadStoredCredential(provider, path string) *aiauth.Credential

func ResolveAuthConfigValue

func ResolveAuthConfigValue(value string, scopedEnv map[string]string) (string, bool)

func ResolveAuthConfigValueUncached

func ResolveAuthConfigValueUncached(value string, scopedEnv map[string]string) (string, bool)

func ResolveConfigValue

func ResolveConfigValue(ctx context.Context, value string, scopedEnv map[string]string) (string, error)

ResolveConfigValue resolves a models.json value without the process-lifetime command cache used by stored auth credentials.

func ResolveConfigValueOrThrow

func ResolveConfigValueOrThrow(value, description string, scopedEnv map[string]string) (string, error)

func ResolveHeaders

func ResolveHeaders(headers map[string]string, scopedEnv map[string]string) map[string]string

func ResolveHeadersOrThrow

func ResolveHeadersOrThrow(headers map[string]string, description string, scopedEnv map[string]string) (map[string]string, error)

func ResolveSessionDir

func ResolveSessionDir(cliValue string, manager *SettingsManager) (string, error)

ResolveSessionDir applies CLI, environment, then merged-settings precedence.

func UserNpmInstallRoot added in v0.4.7

func UserNpmInstallRoot(agentDir string) string

UserNpmInstallRoot and ProjectNpmInstallRoot name the npm projects pigo manages itself — the only trees it installs packages into, and the only ones the extension host resolves the pi SDK from. Both the package manager and the host read them from here so the layout is stated once.

Types

type AuthStorage

type AuthStorage struct {
	// contains filtered or unexported fields
}

func NewAuthStorage

func NewAuthStorage(path string) (*AuthStorage, error)

func NewDefaultAuthStorage

func NewDefaultAuthStorage() (*AuthStorage, error)

func (*AuthStorage) Delete

func (storage *AuthStorage) Delete(ctx context.Context, provider string) error

func (*AuthStorage) List

func (storage *AuthStorage) List(_ context.Context) ([]aiauth.CredentialInfo, error)

func (*AuthStorage) Modify

func (storage *AuthStorage) Modify(
	ctx context.Context,
	provider string,
	modify aiauth.ModifyFunc,
) (*aiauth.Credential, error)

func (*AuthStorage) Path

func (storage *AuthStorage) Path() string

func (*AuthStorage) Read

func (storage *AuthStorage) Read(_ context.Context, provider string) (*aiauth.Credential, error)

func (*AuthStorage) Reload

func (storage *AuthStorage) Reload()

type BranchSummarySettings

type BranchSummarySettings struct {
	ReserveTokens int64
	SkipPrompt    bool
}

type CompactionSettings

type CompactionSettings struct {
	Enabled          bool
	ReserveTokens    int64
	KeepRecentTokens int64
}

type HTTPIdleTimeoutChoice

type HTTPIdleTimeoutChoice struct {
	Label     string
	TimeoutMS int64
}

HTTPIdleTimeoutChoice pairs an /settings label with its timeout value, mirroring upstream http-dispatcher HTTP_IDLE_TIMEOUT_CHOICES.

type ModelConfig

type ModelConfig struct {
	Providers map[string]ModelProviderConfig `json:"providers"`
	// contains filtered or unexported fields
}

func LoadModelConfig

func LoadModelConfig(path string) (*ModelConfig, error)

LoadModelConfig loads one immutable models.json snapshot. Missing files are empty configs.

func (*ModelConfig) Error

func (config *ModelConfig) Error() string

func (*ModelConfig) HasConfiguredAPIKey

func (config *ModelConfig) HasConfiguredAPIKey(providerID string, env map[string]string) bool

HasConfiguredAPIKey checks configured auth presence without executing shell commands.

func (*ModelConfig) ResolveAPIKey

func (config *ModelConfig) ResolveAPIKey(ctx context.Context, providerID string, env map[string]string) (*string, error)

ResolveAPIKey resolves one models.json key at request time.

func (*ModelConfig) ResolveModelHeaders

func (config *ModelConfig) ResolveModelHeaders(ctx context.Context, model ai.Model, env map[string]string, apiKeys ...*string) (*map[string]string, error)

ResolveModelHeaders resolves provider and model header values without caching commands.

type ModelCostOverride

type ModelCostOverride struct {
	Input      *float64            `json:"input,omitempty"`
	Output     *float64            `json:"output,omitempty"`
	CacheRead  *float64            `json:"cacheRead,omitempty"`
	CacheWrite *float64            `json:"cacheWrite,omitempty"`
	Tiers      *[]ai.ModelCostTier `json:"tiers,omitempty"`
}

type ModelDefinition

type ModelDefinition struct {
	ID               string                             `json:"id"`
	Name             *string                            `json:"name,omitempty"`
	API              *ai.API                            `json:"api,omitempty"`
	BaseURL          *string                            `json:"baseUrl,omitempty"`
	Reasoning        *bool                              `json:"reasoning,omitempty"`
	ThinkingLevelMap *map[ai.ModelThinkingLevel]*string `json:"thinkingLevelMap,omitempty"`
	Input            *ai.InputModalities                `json:"input,omitempty"`
	Cost             *ai.ModelCost                      `json:"cost,omitempty"`
	ContextWindow    *float64                           `json:"contextWindow,omitempty"`
	MaxTokens        *float64                           `json:"maxTokens,omitempty"`
	Headers          map[string]string                  `json:"headers,omitempty"`
	Compat           json.RawMessage                    `json:"compat,omitempty"`
}

type ModelOverride

type ModelOverride struct {
	Name             *string                            `json:"name,omitempty"`
	Reasoning        *bool                              `json:"reasoning,omitempty"`
	ThinkingLevelMap *map[ai.ModelThinkingLevel]*string `json:"thinkingLevelMap,omitempty"`
	Input            *ai.InputModalities                `json:"input,omitempty"`
	Cost             *ModelCostOverride                 `json:"cost,omitempty"`
	ContextWindow    *float64                           `json:"contextWindow,omitempty"`
	MaxTokens        *float64                           `json:"maxTokens,omitempty"`
	Headers          map[string]string                  `json:"headers,omitempty"`
	Compat           json.RawMessage                    `json:"compat,omitempty"`
}

type ModelProviderConfig

type ModelProviderConfig struct {
	Name           *string                  `json:"name,omitempty"`
	BaseURL        *string                  `json:"baseUrl,omitempty"`
	APIKey         *string                  `json:"apiKey,omitempty"`
	API            *ai.API                  `json:"api,omitempty"`
	OAuth          *string                  `json:"oauth,omitempty"`
	Headers        map[string]string        `json:"headers,omitempty"`
	Compat         json.RawMessage          `json:"compat,omitempty"`
	AuthHeader     *bool                    `json:"authHeader,omitempty"`
	Models         []ModelDefinition        `json:"models,omitempty"`
	ModelOverrides map[string]ModelOverride `json:"modelOverrides,omitempty"`
}

type ModelRegistry

type ModelRegistry struct {
	// contains filtered or unexported fields
}

func NewModelRegistry

func NewModelRegistry(agentDir string) (*ModelRegistry, error)

func (*ModelRegistry) Available

func (registry *ModelRegistry) Available(env map[string]string) []ai.Model

func (*ModelRegistry) AvailableWithError

func (registry *ModelRegistry) AvailableWithError(env map[string]string) ([]ai.Model, error)

func (*ModelRegistry) DefaultModelHeadersResolver

func (registry *ModelRegistry) DefaultModelHeadersResolver() func(context.Context, *ai.Model, *string, ai.ProviderEnv) (*map[string]string, error)

DefaultModelHeadersResolver returns a resolver for per-request headers from models.json configuration.

func (*ModelRegistry) DefaultRequestAuthResolver

func (registry *ModelRegistry) DefaultRequestAuthResolver(credentials aiauth.CredentialStore) func(context.Context, ai.ProviderID) (*RequestAuth, error)

DefaultRequestAuthResolver returns a resolver that checks stored credentials, models.json overrides, and built-in provider auth methods (env vars, ADC, etc.) for a given provider. This is the canonical implementation used by both the CLI and the SDK. When credentials is nil, the registry's own auth.json data is used.

func (*ModelRegistry) Error

func (registry *ModelRegistry) Error() string

func (*ModelRegistry) Find

func (registry *ModelRegistry) Find(provider, id string) (ai.Model, bool)

func (*ModelRegistry) GetProviderAuthStatus

func (registry *ModelRegistry) GetProviderAuthStatus(provider string, env map[string]string) extensions.AuthStatus

func (*ModelRegistry) HasConfiguredAuth

func (registry *ModelRegistry) HasConfiguredAuth(provider string, env map[string]string) bool

func (*ModelRegistry) IsUsingOAuth

func (registry *ModelRegistry) IsUsingOAuth(provider string) bool

func (*ModelRegistry) Models

func (registry *ModelRegistry) Models() []ai.Model

func (*ModelRegistry) Provider

func (registry *ModelRegistry) Provider(id string) (extensions.Provider, bool)

func (*ModelRegistry) ProviderAuth

func (registry *ModelRegistry) ProviderAuth(id string) aiauth.ProviderAuth

func (*ModelRegistry) ProviderDisplayName

func (registry *ModelRegistry) ProviderDisplayName(id string) string

func (*ModelRegistry) ProviderIDs

func (registry *ModelRegistry) ProviderIDs() []string

ProviderIDs returns the complete composed provider order: built-ins, native extension providers, models.json providers, then extension provider configs.

func (*ModelRegistry) RefreshAuth

func (registry *ModelRegistry) RefreshAuth() error

RefreshAuth re-reads credentials without reloading models.json or the model store. Login and logout use this path so unrelated config edits remain behind the explicit reload boundary.

func (*ModelRegistry) RegisterProvider

func (registry *ModelRegistry) RegisterProvider(provider extensions.Provider) error

func (*ModelRegistry) RegisterProviderConfig

func (registry *ModelRegistry) RegisterProviderConfig(id string, incoming extensions.ProviderConfig) error

func (*ModelRegistry) RegisteredNativeProvider

func (registry *ModelRegistry) RegisteredNativeProvider(id string) (extensions.Provider, bool)

func (*ModelRegistry) RegisteredProviderConfig

func (registry *ModelRegistry) RegisteredProviderConfig(id string) (extensions.ProviderConfig, bool)

func (*ModelRegistry) RegisteredProviderIDs

func (registry *ModelRegistry) RegisteredProviderIDs() []string

func (*ModelRegistry) Reload

func (registry *ModelRegistry) Reload() error

Reload re-reads both the dynamic model cache and models.json.

func (*ModelRegistry) ResolveAPIKey

func (registry *ModelRegistry) ResolveAPIKey(ctx context.Context, provider string, env map[string]string) (*string, error)

func (*ModelRegistry) ResolveConfiguredAPIKey

func (registry *ModelRegistry) ResolveConfiguredAPIKey(ctx context.Context, provider string, env map[string]string) (*string, error)

ResolveConfiguredAPIKey resolves only a models.json provider override. Stored credentials and ambient provider sources are handled by the auth layer.

func (*ModelRegistry) ResolveModelHeaders

func (registry *ModelRegistry) ResolveModelHeaders(ctx context.Context, model ai.Model, env map[string]string, apiKeys ...*string) (*map[string]string, error)

func (*ModelRegistry) ResolveProviderAuth

func (registry *ModelRegistry) ResolveProviderAuth(ctx context.Context, provider string, env map[string]string) (*aiauth.AuthResult, error)

func (*ModelRegistry) StreamSimple

func (registry *ModelRegistry) StreamSimple(
	ctx context.Context,
	model *ai.Model,
	request ai.Context,
	options *ai.SimpleStreamOptions,
) (ai.AssistantMessageEventStream, error)

func (*ModelRegistry) UnregisterProvider

func (registry *ModelRegistry) UnregisterProvider(id string) error

type Option

type Option func(*managerOptions)

func WithAgentDir

func WithAgentDir(path string) Option

func WithProjectTrusted

func WithProjectTrusted(trusted bool) Option

WithProjectTrusted gates project settings: untrusted managers load and merge only global settings (upstream SettingsManager projectTrusted option).

type PackageSource

type PackageSource struct {
	Source     string
	Autoload   *bool
	Extensions []string
	Skills     []string
	Prompts    []string
	Themes     []string
	IsObject   bool
}

PackageSource mirrors upstream's string-or-object package entry. Nil slices mean the key is absent (load all of that type); empty slices mean an explicit [] (load none).

func PackageSourcesFrom

func PackageSourcesFrom(settings Settings) []PackageSource

PackageSourcesFrom reads the "packages" array from a settings document.

func (PackageSource) WithSource

func (source PackageSource) WithSource(newSource string) PackageSource

WithSource returns a copy pointing at newSource, preserving filters.

type ProjectTrustOption

type ProjectTrustOption struct {
	Label     string
	Trusted   bool
	Updates   []ProjectTrustUpdate
	SavedPath string
}

func GetProjectTrustOptions

func GetProjectTrustOptions(cwd string, includeSessionOnly bool) []ProjectTrustOption

type ProjectTrustStore

type ProjectTrustStore struct {
	// contains filtered or unexported fields
}

ProjectTrustStore persists project trust decisions in <agentDir>/trust.json.

func NewProjectTrustStore

func NewProjectTrustStore(agentDir string) *ProjectTrustStore

func (*ProjectTrustStore) Get

func (store *ProjectTrustStore) Get(cwd string) (*bool, error)

Get returns the nearest stored decision for cwd, or nil when undecided.

func (*ProjectTrustStore) GetEntry

func (store *ProjectTrustStore) GetEntry(cwd string) (*ProjectTrustStoreEntry, error)

func (*ProjectTrustStore) Set

func (store *ProjectTrustStore) Set(cwd string, decision *bool) error

func (*ProjectTrustStore) SetMany

func (store *ProjectTrustStore) SetMany(decisions []ProjectTrustUpdate) error

type ProjectTrustStoreEntry

type ProjectTrustStoreEntry struct {
	Path     string `json:"path"`
	Decision bool   `json:"decision"`
}

type ProjectTrustUpdate

type ProjectTrustUpdate struct {
	Path     string
	Decision *bool
}

ProjectTrustUpdate carries a decision; nil removes the stored entry.

type ProviderRetrySettings

type ProviderRetrySettings struct {
	TimeoutMS       *int64
	MaxRetries      *int
	MaxRetryDelayMS int64
}

type RequestAuth

type RequestAuth struct {
	APIKey  *string
	Headers ai.ProviderHeaders
	Env     ai.ProviderEnv
	BaseURL *string
}

RequestAuth mirrors agent.RequestAuth without importing the agent package.

type RetrySettings

type RetrySettings struct {
	Enabled     bool
	MaxRetries  int
	BaseDelayMS int64
}

type Settings

type Settings map[string]any

type SettingsError

type SettingsError struct {
	Scope SettingsScope
	Err   error
}

func (SettingsError) Error

func (e SettingsError) Error() string

func (SettingsError) Unwrap

func (e SettingsError) Unwrap() error

type SettingsManager

type SettingsManager struct {
	// contains filtered or unexported fields
}

SettingsManager keeps the source documents untyped so unknown keys and invalid known values do not make an otherwise valid settings file unreadable.

func NewSettingsManager

func NewSettingsManager(cwd string, options ...Option) (*SettingsManager, error)

func (*SettingsManager) AgentDir

func (manager *SettingsManager) AgentDir() string

func (*SettingsManager) CWD

func (manager *SettingsManager) CWD() string

func (*SettingsManager) DrainErrors

func (manager *SettingsManager) DrainErrors() []SettingsError

func (*SettingsManager) GetAutocompleteMaxVisible

func (manager *SettingsManager) GetAutocompleteMaxVisible() int

func (*SettingsManager) GetBlockImages

func (manager *SettingsManager) GetBlockImages() bool

func (*SettingsManager) GetBranchSummarySettings

func (manager *SettingsManager) GetBranchSummarySettings() BranchSummarySettings

func (*SettingsManager) GetClearOnShrink

func (manager *SettingsManager) GetClearOnShrink() bool

Settings value takes precedence, then PI_CLEAR_ON_SHRINK, then false.

func (*SettingsManager) GetCompactionSettings

func (manager *SettingsManager) GetCompactionSettings() CompactionSettings

func (*SettingsManager) GetDefaultModel

func (manager *SettingsManager) GetDefaultModel() string

func (*SettingsManager) GetDefaultProjectTrust

func (manager *SettingsManager) GetDefaultProjectTrust() string

GetDefaultProjectTrust returns "always", "never", or "ask" (global-only).

func (*SettingsManager) GetDefaultProvider

func (manager *SettingsManager) GetDefaultProvider() string

func (*SettingsManager) GetDefaultThinkingLevel

func (manager *SettingsManager) GetDefaultThinkingLevel() ai.ModelThinkingLevel

func (*SettingsManager) GetDoubleEscapeAction

func (manager *SettingsManager) GetDoubleEscapeAction() string

func (*SettingsManager) GetEditorPaddingX

func (manager *SettingsManager) GetEditorPaddingX() int

func (*SettingsManager) GetEnableSkillCommands

func (manager *SettingsManager) GetEnableSkillCommands() bool

func (*SettingsManager) GetEnabledModels

func (manager *SettingsManager) GetEnabledModels() []string

func (*SettingsManager) GetExternalEditor

func (manager *SettingsManager) GetExternalEditor() string

func (*SettingsManager) GetFollowUpMode

func (manager *SettingsManager) GetFollowUpMode() string

func (*SettingsManager) GetGlobalExtensionPaths

func (manager *SettingsManager) GetGlobalExtensionPaths() []string

func (*SettingsManager) GetGlobalPackages

func (manager *SettingsManager) GetGlobalPackages() []PackageSource

func (*SettingsManager) GetGlobalPromptTemplatePaths

func (manager *SettingsManager) GetGlobalPromptTemplatePaths() []string

func (*SettingsManager) GetGlobalSettings

func (manager *SettingsManager) GetGlobalSettings() Settings

func (*SettingsManager) GetGlobalSkillPaths

func (manager *SettingsManager) GetGlobalSkillPaths() []string

func (*SettingsManager) GetGlobalThemePaths

func (manager *SettingsManager) GetGlobalThemePaths() []string

func (*SettingsManager) GetGoExtensions

func (manager *SettingsManager) GetGoExtensions() map[string]bool

func (*SettingsManager) GetHTTPIdleTimeoutMS

func (manager *SettingsManager) GetHTTPIdleTimeoutMS() (int64, error)

GetHTTPIdleTimeoutMS returns the provider idle timeout. Zero is preserved so SDK callers can translate upstream's disabled-timeout sentinel.

func (*SettingsManager) GetHTTPProxy

func (manager *SettingsManager) GetHTTPProxy() string

GetHTTPProxy returns the settings-configured proxy for pi-managed HTTP clients (upstream http-dispatcher's httpProxy key).

func (*SettingsManager) GetHideThinkingBlock

func (manager *SettingsManager) GetHideThinkingBlock() bool

func (*SettingsManager) GetImageAutoResize

func (manager *SettingsManager) GetImageAutoResize() bool

func (*SettingsManager) GetImageWidthCells

func (manager *SettingsManager) GetImageWidthCells() int

func (*SettingsManager) GetMarkdownCodeBlockIndent

func (manager *SettingsManager) GetMarkdownCodeBlockIndent() string

func (*SettingsManager) GetOutputPad

func (manager *SettingsManager) GetOutputPad() int

func (*SettingsManager) GetPluginSettings added in v0.3.0

func (manager *SettingsManager) GetPluginSettings(name string) map[string]any

GetPluginSettings returns a copy of one structured plugin configuration.

func (*SettingsManager) GetPlugins added in v0.3.0

func (manager *SettingsManager) GetPlugins() map[string]bool

GetPlugins returns the effective bundled-plugin gates. Missing entries are intentionally false so first-party plugins stay dormant by default.

func (*SettingsManager) GetProjectExtensionPaths

func (manager *SettingsManager) GetProjectExtensionPaths() []string

func (*SettingsManager) GetProjectPackages

func (manager *SettingsManager) GetProjectPackages() []PackageSource

func (*SettingsManager) GetProjectPromptTemplatePaths

func (manager *SettingsManager) GetProjectPromptTemplatePaths() []string

func (*SettingsManager) GetProjectSettings

func (manager *SettingsManager) GetProjectSettings() Settings

func (*SettingsManager) GetProjectSkillPaths

func (manager *SettingsManager) GetProjectSkillPaths() []string

func (*SettingsManager) GetProjectThemePaths

func (manager *SettingsManager) GetProjectThemePaths() []string

func (*SettingsManager) GetProviderRetrySettings

func (manager *SettingsManager) GetProviderRetrySettings() ProviderRetrySettings

func (*SettingsManager) GetQuietStartup

func (manager *SettingsManager) GetQuietStartup() bool

func (*SettingsManager) GetRetrySettings

func (manager *SettingsManager) GetRetrySettings() RetrySettings

func (*SettingsManager) GetSessionDir

func (manager *SettingsManager) GetSessionDir() (string, error)

func (*SettingsManager) GetSettings

func (manager *SettingsManager) GetSettings() Settings

func (*SettingsManager) GetShellCommandPrefix

func (manager *SettingsManager) GetShellCommandPrefix() string

func (*SettingsManager) GetShellPath

func (manager *SettingsManager) GetShellPath() (string, error)

func (*SettingsManager) GetShowCacheMissNotices

func (manager *SettingsManager) GetShowCacheMissNotices() bool

func (*SettingsManager) GetShowHardwareCursor

func (manager *SettingsManager) GetShowHardwareCursor() bool

Settings value takes precedence, then PI_HARDWARE_CURSOR, then false.

func (*SettingsManager) GetShowImages

func (manager *SettingsManager) GetShowImages() bool

func (*SettingsManager) GetShowTerminalProgress

func (manager *SettingsManager) GetShowTerminalProgress() bool

func (*SettingsManager) GetSteeringMode

func (manager *SettingsManager) GetSteeringMode() string

func (*SettingsManager) GetTheme

func (manager *SettingsManager) GetTheme() string

func (*SettingsManager) GetThemePaths

func (manager *SettingsManager) GetThemePaths() []string

func (*SettingsManager) GetThemeSetting

func (manager *SettingsManager) GetThemeSetting() string

func (*SettingsManager) GetThinkingBudgets

func (manager *SettingsManager) GetThinkingBudgets() *ai.ThinkingBudgets

GetThinkingBudgets returns custom token budgets for each thinking level.

func (*SettingsManager) GetTransport

func (manager *SettingsManager) GetTransport() ai.Transport

func (*SettingsManager) GetTreeFilterMode

func (manager *SettingsManager) GetTreeFilterMode() string

func (*SettingsManager) GetWarningAnthropicExtraUsage

func (manager *SettingsManager) GetWarningAnthropicExtraUsage() bool

GetWarningAnthropicExtraUsage reads warnings.anthropicExtraUsage, the gate for the Anthropic subscription-auth warning (upstream settings-manager WarningSettings.anthropicExtraUsage; default true).

func (*SettingsManager) GetWebSocketConnectTimeoutMS

func (manager *SettingsManager) GetWebSocketConnectTimeoutMS() (*int64, error)

GetWebSocketConnectTimeoutMS returns the optional WebSocket handshake timeout.

func (*SettingsManager) IsProjectTrusted

func (manager *SettingsManager) IsProjectTrusted() bool

func (*SettingsManager) Reload

func (manager *SettingsManager) Reload()

func (*SettingsManager) SetAutocompleteMaxVisible

func (manager *SettingsManager) SetAutocompleteMaxVisible(maxVisible int)

func (*SettingsManager) SetBlockImages

func (manager *SettingsManager) SetBlockImages(blocked bool)

func (*SettingsManager) SetClearOnShrink

func (manager *SettingsManager) SetClearOnShrink(enabled bool)

func (*SettingsManager) SetCompactionEnabled

func (manager *SettingsManager) SetCompactionEnabled(enabled bool)

func (*SettingsManager) SetDefaultModelAndProvider

func (manager *SettingsManager) SetDefaultModelAndProvider(provider, modelID string)

func (*SettingsManager) SetDefaultProjectTrust

func (manager *SettingsManager) SetDefaultProjectTrust(value string)

func (*SettingsManager) SetDefaultThinkingLevel

func (manager *SettingsManager) SetDefaultThinkingLevel(level ai.ModelThinkingLevel)

func (*SettingsManager) SetDoubleEscapeAction

func (manager *SettingsManager) SetDoubleEscapeAction(action string)

func (*SettingsManager) SetEditorPaddingX

func (manager *SettingsManager) SetEditorPaddingX(padding int)

func (*SettingsManager) SetEnableSkillCommands

func (manager *SettingsManager) SetEnableSkillCommands(enabled bool)

func (*SettingsManager) SetEnabledModels

func (manager *SettingsManager) SetEnabledModels(models []string)

func (*SettingsManager) SetExtensionPaths

func (manager *SettingsManager) SetExtensionPaths(paths []string) error

func (*SettingsManager) SetFollowUpMode

func (manager *SettingsManager) SetFollowUpMode(mode string)

func (*SettingsManager) SetHTTPIdleTimeoutMS

func (manager *SettingsManager) SetHTTPIdleTimeoutMS(timeoutMS int64)

SetHTTPIdleTimeoutMS persists the provider idle timeout; negative values are rejected upstream before reaching the store, so they are ignored here.

func (*SettingsManager) SetHideThinkingBlock

func (manager *SettingsManager) SetHideThinkingBlock(hidden bool)

func (*SettingsManager) SetImageAutoResize

func (manager *SettingsManager) SetImageAutoResize(enabled bool)

func (*SettingsManager) SetImageWidthCells

func (manager *SettingsManager) SetImageWidthCells(width int)

func (*SettingsManager) SetOutputPad

func (manager *SettingsManager) SetOutputPad(padding int)

func (*SettingsManager) SetPackages

func (manager *SettingsManager) SetPackages(sources []PackageSource) error

SetPackages writes the global packages array.

func (*SettingsManager) SetPluginEnabled added in v0.3.0

func (manager *SettingsManager) SetPluginEnabled(name string, enabled bool)

SetPluginEnabled persists a user-level gate while project settings continue to overlay it through the existing one-level merge.

func (*SettingsManager) SetPluginSetting added in v0.3.0

func (manager *SettingsManager) SetPluginSetting(name, key string, value any)

SetPluginSetting persists one value without discarding the plugin's rules.

func (*SettingsManager) SetProjectExtensionPaths

func (manager *SettingsManager) SetProjectExtensionPaths(paths []string) error

func (*SettingsManager) SetProjectPackages

func (manager *SettingsManager) SetProjectPackages(sources []PackageSource) error

SetProjectPackages writes the project packages array; it refuses when the project is untrusted (upstream assertProjectTrustedForWrite).

func (*SettingsManager) SetProjectPromptTemplatePaths

func (manager *SettingsManager) SetProjectPromptTemplatePaths(paths []string) error

func (*SettingsManager) SetProjectSkillPaths

func (manager *SettingsManager) SetProjectSkillPaths(paths []string) error

func (*SettingsManager) SetProjectThemePaths

func (manager *SettingsManager) SetProjectThemePaths(paths []string) error

func (*SettingsManager) SetProjectTrusted

func (manager *SettingsManager) SetProjectTrusted(trusted bool)

SetProjectTrusted matches upstream: revoking trust drops project settings, granting it reloads them from disk.

func (*SettingsManager) SetPromptTemplatePaths

func (manager *SettingsManager) SetPromptTemplatePaths(paths []string) error

func (*SettingsManager) SetQuietStartup

func (manager *SettingsManager) SetQuietStartup(quiet bool)

func (*SettingsManager) SetRetryEnabled

func (manager *SettingsManager) SetRetryEnabled(enabled bool)

func (*SettingsManager) SetShowCacheMissNotices

func (manager *SettingsManager) SetShowCacheMissNotices(show bool)

func (*SettingsManager) SetShowHardwareCursor

func (manager *SettingsManager) SetShowHardwareCursor(enabled bool)

func (*SettingsManager) SetShowImages

func (manager *SettingsManager) SetShowImages(show bool)

func (*SettingsManager) SetShowTerminalProgress

func (manager *SettingsManager) SetShowTerminalProgress(enabled bool)

func (*SettingsManager) SetSkillPaths

func (manager *SettingsManager) SetSkillPaths(paths []string) error

func (*SettingsManager) SetSteeringMode

func (manager *SettingsManager) SetSteeringMode(mode string)

func (*SettingsManager) SetTheme

func (manager *SettingsManager) SetTheme(value string)

func (*SettingsManager) SetThemePaths

func (manager *SettingsManager) SetThemePaths(paths []string) error

func (*SettingsManager) SetTransport

func (manager *SettingsManager) SetTransport(transport ai.Transport)

func (*SettingsManager) SetTreeFilterMode

func (manager *SettingsManager) SetTreeFilterMode(mode string)

type SettingsScope

type SettingsScope string
const (
	GlobalSettings  SettingsScope = "global"
	ProjectSettings SettingsScope = "project"
)

Jump to

Keyboard shortcuts

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