Documentation
¶
Overview ¶
Nested configuration document with dotted path navigation, deep merge and default stripping
Index ¶
- Constants
- Variables
- func ActiveConfigParseFailure(h string) (string, bool)
- func AddIssue(issues *[]ConfigIssue, severity, message, hint string)
- func AppendMappingKey(m map[string]any, key string)
- func ApplyManagedOverlay(doc map[string]any) map[string]any
- func ApplyTerminalConfigToEnv(ctx context.Context, h string, opts TerminalEnvOptions) error
- func AsBool(v any) (bool, bool)
- func AsFloat(v any) (float64, bool)
- func AsInt(v any) (int, bool)
- func AsMap(v any) map[string]any
- func AsStrings(v any) []string
- func AtomicConfigReplace(ctx context.Context, h, configPath string, data map[string]any, ...) error
- func AtomicConfigWrite(ctx context.Context, h, configPath string, data map[string]any, ...) error
- func AtomicJSONWrite(ctx context.Context, path string, data any) error
- func AtomicJSONWriteMode(ctx context.Context, path string, data any, mode os.FileMode, ...) error
- func AtomicJSONWriteModeSyncDir(ctx context.Context, path string, data any, mode os.FileMode, ...) error
- func AtomicJSONWriteWith(ctx context.Context, path string, data any, opts ...jsonutil.Option) error
- func AtomicWrite(path string, data []byte, mode os.FileMode) error
- func AtomicYAMLWrite(ctx context.Context, path string, data any, extra string) error
- func AtomicYAMLWriteCreateMode(ctx context.Context, path string, data any, extra string, ...) error
- func BackupConfig(ctx context.Context, configPath, reason string, keep int) (string, error)
- func BackupsDir(configPath string) string
- func BackupsDirDisplay(h string) string
- func BootstrapDeployment(ctx context.Context, home, projectEnv string) error
- func BundledPlatformDirNames(h string) []string
- func Canonicalize(doc map[string]any) (map[string]any, error)
- func CfgGet(cfg map[string]any, keys ...string) (any, bool)
- func CheckNonASCIICredential(key, value string) string
- func Clone(v any) any
- func ConfigCacheVersion(ctx context.Context, configPath string) ([]any, error)
- func ConfigCacheVersionOrNone(ctx context.Context, configPath string) ([]any, error)
- func ConfigCheckDiagnostics(cfg map[string]any, getEnv func(name string) string, ...) ([]string, error)
- func ConfigCommand(ctx context.Context, h string, args ConfigArgs, src ConfigCommandSources) error
- func ConfigDestination(ctx context.Context, configPath string) (string, error)
- func ConfigExists(ctx context.Context, configPath string) (bool, error)
- func ConfigFromJSON(v any) any
- func ConfigStructureIssueLines(issues []ConfigIssue) []string
- func ConfigVersion(ctx context.Context, configPath string) ([]any, error)
- func ConfigVersionOrNone(ctx context.Context, configPath string) ([]any, error)
- func ContainerSlots() map[string]string
- func ContentDigest(data []byte) string
- func CoreDeclaredEnvNames() (map[string]bool, error)
- func CustomEndpointKeyEnv(identity string) string
- func DecodeEnvBytes(raw []byte) string
- func DeepMerge(base, override map[string]any) map[string]any
- func DeploymentEnvNames(ctx context.Context) ([]string, error)
- func DetectInstallMethod(ctx context.Context, h, projectRoot string) (string, error)
- func DiagnosticMetadata(event WakeEvent) map[string]any
- func DiagnosticTurnMuted(ctx context.Context, displayMetadata map[string]any, platform string) bool
- func DiagnosticWakeMuted(ctx context.Context, event WakeEvent) bool
- func DisplayLanguageError(value string, cat LanguageCatalog) string
- func DropOtherAccess(ctx context.Context, path string)
- func EditConfig(ctx context.Context, h string) error
- func EffectiveUserConfig(ctx context.Context) map[string]any
- func EnsureIcebathHome(ctx context.Context, h string) error
- func EnvFloat(key string, def float64) float64
- func EnvInt(key string, def int64) int64
- func EnvLineDefinesKey(line, key string) bool
- func EnvRefLookup(name string) (string, bool)
- func EnvRefVarName(body string) string
- func EnvVarEnabled(name string) bool
- func EnvWriteRefusal(ctx context.Context, h, key, action string) string
- func ExecInContainer(info *ContainerExecInfo, cliArgs []string) (code int, err error)
- func Expand(v any, lookup Lookup) any
- func ExpandString(s string, lookup Lookup) string
- func ExplicitPaths(doc map[string]any) map[string]bool
- func FailedReadError(m map[string]any) error
- func FastSafeLoad(data []byte) (any, error)
- func FileCacheVersion(path string, alwaysDigest bool) ([]any, error)
- func FileCacheVersionOf(path string, fi os.FileInfo) []any
- func FileSignature(fi os.FileInfo) [4]int64
- func FormatConfigParseFailure(configPath string, err error, fallback string) string
- func FormatDockerUpdateMessage() string
- func FormatManagedMessage(ctx context.Context, h, action string) string
- func GetActiveGoodbye(ctx context.Context, fallback string) string
- func GetActiveSkinName(ctx context.Context) string
- func GetConfigPath(h string) string
- func GetConfigValue(ctx context.Context, h, key string, asJSON, raw bool, src ConfigCommandSources) error
- func GetEnvPath(h string) string
- func GetEnvValue(ctx context.Context, h, key string) (string, bool, error)
- func GetEnvValuePreferDotenv(ctx context.Context, h, key string) (string, error)
- func GetManagedUpdateCommand(ctx context.Context, h string) string
- func GetProjectRoot() string
- func InitSkinFromConfig(ctx context.Context, cfg map[string]any)
- func InitializeHome(ctx context.Context, h string, subdirs []string, ensured map[string]bool) error
- func InstallMethodStamp(root string) (string, error)
- func InstallSkinColorFilter(fn func(string) string)
- func InvalidateEnvCache()
- func InvalidateEnvFileCache(path string)
- func InvalidateManagedCache()
- func IsDiagnosticNotice(level, key string) bool
- func IsEnvConfigKey(key string) bool
- func IsEnvManaged(name string) bool
- func IsKeyManaged(dotted string) bool
- func IsLegacyTemplateSoul(text string) bool
- func IsManaged(ctx context.Context, h string) bool
- func IsNixInstallMethod(method string) bool
- func IsOSError(err error) bool
- func IsPackageManagerInstallMethod(method string) bool
- func IsReleaseBinaryInstallMethod(method string) bool
- func IsSSHRemoteTildeCwd(backend, cwd string) bool
- func IsWarningStatus(eventType string, message any) bool
- func IsYAMLError(err error) bool
- func KeepingReadBase[T any](ctx context.Context, read func() (T, error)) (T, error)
- func KeyString(keyValue any) string
- func ListConfigBackups(configPath, reason string) []string
- func LoadEnv(h string) map[string]string
- func LoadEnvFile(path string) map[string]string
- func LoadManagedConfig() map[string]any
- func LoadManagedEnv() map[string]string
- func LoadNewestGoodBackup(ctx context.Context, configPath string) (map[string]any, error)
- func LoadUserEffective(configPath string, lookup Lookup) (map[string]any, error)
- func LoadUserEffectiveFailClosed(configPath string, lookup Lookup) (map[string]any, error)
- func LoadYAMLFileReadonly(path string) (any, error)
- func LockConfig(ctx context.Context) (context.Context, func())
- func LooksStructuredValue(value string) bool
- func ManagedConfigKeys() []string
- func ManagedDir() string
- func ManagedError(ctx context.Context, h, action string)
- func ManagedSystem(ctx context.Context, h string) string
- func MappingKeyOrder(path string, keys ...string) []string
- func MappingKeys(m map[string]any) []string
- func MappingPyKey(m map[string]any, key string) (any, bool)
- func MaskSecret(value, empty string) string
- func MergePartialSave(raw, override map[string]any) map[string]any
- func ModelForcesMaxCompletionTokens(model string) bool
- func MtimeIsRacy(mtimeNS int64) bool
- func NixMergeConfig(nixJSONPath, configPath string) error
- func NixRenderSettings(settingsJSON string) (string, error)
- func NormalizeProxyEnvVars()
- func NormalizeProxyURL(proxyURL string) string
- func NoteRuntimeImport(name string)
- func PackageManagerOfPath(binary string) string
- func ParseCLIValue(key, value string) (any, error)
- func ParseEnv(text string) map[string]string
- func ParseEnvValue(raw string) string
- func ParseReasoningEffort(effort any) map[string]any
- func PatchUpdateCommandForMethod(method, command string) func()
- func PinnedKeys(ctx context.Context) []string
- func PinnedTerminalBackend() string
- func PinningKeys(ctx context.Context, keys ...string) context.Context
- func PlatformManifestSecretEnvs(h, source string, strict bool) (map[string]bool, error)
- func PlatformManifestSecretScan(h string) (map[string]bool, bool, error)
- func PlatformManifestStamp(h string) string
- func PlatformPluginManifestDirNames(h string) ([]string, error)
- func PresentNotification(ctx context.Context, present func(context.Context) error, platform string, ...) (bool, error)
- func PrintConfigWarnings(ctx context.Context, h string, cfg map[string]any, ...)
- func ProbeConfigReadable(ctx context.Context, configPath string) error
- func QuoteEnvValue(value string) string
- func RacyContentDigest(path string, sig [4]int64) string
- func ReadConfigDoc(ctx context.Context, configPath string) (any, error)
- func ReadConfigDocReadonly(ctx context.Context, configPath string) (any, error)
- func ReadDocument(path string) (map[string]any, error)
- func ReadEnvLines(path string) ([]string, error)
- func ReadErrorFix(err error) string
- func ReadRawConfig(ctx context.Context, h string) (map[string]any, error)
- func ReadRawConfigReadonly(ctx context.Context, h string) (map[string]any, error)
- func ReadUser(h string) (map[string]any, error)
- func ReadUserConfigRaw(ctx context.Context, configPath string) (map[string]any, error)
- func RebaseForSave(cfg, liveRaw map[string]any, mergeExisting bool, ...) map[string]any
- func RecommendedUpdateCommand(ctx context.Context, h string) (string, error)
- func RecommendedUpdateCommandForMethod(method string) string
- func RedactConfigValue(value any) any
- func RedactKey(key string) string
- func RefSnapshot(v any, lookup Lookup) map[string]*string
- func RefuseFailedRead(h, configPath string, data any) error
- func RefuseOverwrite(configPath, reason string, err error, fix string) error
- func RefusedLockedOmissionPrefixes(ctx context.Context) []string
- func RefusingLockedOmissions(ctx context.Context, prefixes ...string) context.Context
- func RegisterConfigBackend(kind string, factory func() ConfigBackend)
- func RegisterConfigBootstrapEnv(...)
- func RegisterConfigFacade(h FacadeHooks)
- func RegisterPolicyNote(note func(setter, homeKey string, raw any))
- func RegisterRedactionSwitch(enabled func(ctx context.Context) bool)
- func RegisterSettingsHooks(h SettingsHooks)
- func RegisterSkillConfigVars(fn func() ([]SkillConfigVar, error))
- func ReloadEnv(h string) (int, error)
- func RemoveEnvValue(path, key string) (bool, error)
- func RemoveHomeEnvValue(ctx context.Context, h, key string) (bool, error)
- func RenderNotification(ctx context.Context, render func() error, platform string, diagnostic bool) (bool, error)
- func RequireEnvWritable(ctx context.Context, h, key, action string) error
- func RequireFileTooling(ctx context.Context, what string) error
- func RequireParseableUserConfig(ctx context.Context, h string, ignoreUserConfig bool) error
- func RequireReadableConfigBeforeWrite(ctx context.Context, configPath string) (map[string]any, error)
- func ResetActiveSkinsForTests()
- func ResetBootstrapForTests()
- func ResetCache()
- func ResetConfigParseFailures()
- func ResetTimezoneCache()
- func ResetWorkerPolicyForTests()
- func ResolveDisplayLanguage(value string, cat LanguageCatalog) (string, bool)
- func ResolvePerModelProviderRouting(model string, models any) map[string]any
- func ResolvePerModelReasoningEffort(model string, overrides any) map[string]any
- func ResolveTurnLimit(raw any, fallback int) int
- func RunBudgetSeconds(value any) *float64
- func RunningSourceTree() string
- func SafeDump(data any) ([]byte, error)
- func SafeDumpTo(w io.Writer, data any, opts SafeDumpOptions) error
- func SafeDumpWith(data any, opts SafeDumpOptions) ([]byte, error)
- func SafeLoad(stream any) (any, error)
- func SafeLoadText(data []byte, sig bool) (any, error)
- func SafeStrftime(value time.Time, format string) string
- func SafeWorkerEnabled() bool
- func SanitizeEnvFile(ctx context.Context, h string) (int, error)
- func SanitizeEnvLines(lines []string) []string
- func SanitizeNoProxyEntries(noProxyValue string) string
- func Save(h string, doc Tree) error
- func SaveAnthropicAPIKey(ctx context.Context, h, value string, save func(name, value string) error) error
- func SaveAnthropicOAuthToken(ctx context.Context, h, value string, save func(name, value string) error) error
- func SaveConfig(ctx context.Context, h string, cfg map[string]any, opts SaveOptions) error
- func SaveEnvValue(h, key, value string) error
- func SaveEnvValueContext(ctx context.Context, h, key, value string) error
- func SaveUser(ctx context.Context, h string, doc map[string]any) error
- func ScopedEnvironGet(ctx context.Context, key string) (string, bool, error)
- func SecureDir(ctx context.Context, h, path string)
- func SecureFile(ctx context.Context, h, path string)
- func SeedConfigFile(ctx context.Context, h, configPath, template string) (bool, error)
- func SetConfigValue(ctx context.Context, h, key, value string, src ConfigCommandSources) error
- func SetEnvValue(path, key, value string) error
- func SetMappingClass(m map[string]any, class string)
- func SetMappingKeys(m map[string]any, keys []string)
- func SetMappingPyKey(m map[string]any, key string, keyValue any)
- func ShlexQuote(s string) string
- func ShowConfig(ctx context.Context, out io.Writer, src ShowSources) error
- func ShowValue(v any) string
- func SkinCommand(ctx context.Context, args SkinArgs, src ConfigCommandSources, ...) (int, error)
- func SnapshotCurrent(snap map[string]*string, lookup Lookup) bool
- func SortedEnvNames(table map[string]EnvVar) []string
- func SortedKeys(m map[string]any) []string
- func SplitPath(key string) []string
- func StaticCoreEnvNames() map[string]bool
- func StripDefaults(doc, defaults map[string]any, preserve map[string]bool) map[string]any
- func SupportsFileTooling(ctx context.Context) (bool, error)
- func SwapConfigVersion(f func(ctx context.Context, configPath string) ([]any, error)) (restore func())
- func SwapFileReadUserDoc(f func(b FileBackend, ctx context.Context, home string) (any, error)) (restore func())
- func SwapParseEnvText(fn func(string) map[string]string) func(string) map[string]string
- func SwapSafeDump(f func(any) ([]byte, error)) func()
- func TerminalConfigEnvVarForKey(key string) (string, bool)
- func TerminalEnvValueText(v any) string
- func TimeNow(ctx context.Context) time.Time
- func TimeZone(ctx context.Context) (*time.Location, bool)
- func TimezoneName(ctx context.Context) string
- func Truthy(v any) bool
- func TryLockConfig(ctx context.Context) (context.Context, func(), bool)
- func UnsetConfigValue(ctx context.Context, h, key string, src ConfigCommandSources) error
- func UseAnthropicClaudeCodeCredentials(ctx context.Context, h string, save func(name, value string) error) error
- func ValidateEnvName(key string) error
- func ValidateEnvNameForWrite(key string) error
- func ValidateQuotedContainers(cfg map[string]any, issues *[]ConfigIssue)
- func ValidateTimezone(cfg map[string]any, issues *[]ConfigIssue)
- func ValidateVoice(cfg map[string]any, issues *[]ConfigIssue)
- func ValidateWebBackends(cfg map[string]any, issues *[]ConfigIssue, ...)
- func VersionToken(version []any) float64
- func WarnConfigParseFailure(ctx context.Context, configPath string, err error, fallback string) error
- func WarnDeprecatedCwdEnvVars(w io.Writer, h string)
- func WarnIfCredentialFileBroadlyReadable(path, label string, log *slog.Logger) bool
- func WarningNotificationsEnabled(ctx context.Context, platform string) bool
- func WorkerConfigSnapshot() map[string]any
- func WriteChanges(ctx context.Context, configPath string, changes Changes) error
- func WriteConfigDocument(ctx context.Context, configPath string, document map[string]any, ...) error
- func WriteConfigKey(ctx context.Context, configPath, keyPath string, value any) error
- func WriteConfigKeys(ctx context.Context, configPath string, updates []KeyValue) error
- func WriteEnvLines(ctx context.Context, path string, lines []string, preserveMode bool) error
- func WritePlatformConfigField(ctx context.Context, h, platformKey, fieldKey string, value any, raw bool) error
- func WriteUserConfig(ctx context.Context, h, configPath string, userConfig map[string]any) error
- func YAMLErrorDetails(err error) string
- func YAMLErrorLocation(err error) string
- type BotProfile
- type Changes
- type CheckDiagnosticsSources
- type ConfigArgs
- type ConfigBackend
- type ConfigBackendUnavailable
- type ConfigCommandSources
- type ConfigExit
- type ConfigIssue
- type ConfigLockedError
- type ConfigValueError
- type ConfigWriteError
- type ContainerExecInfo
- type DiagnosticText
- type DoctorWarning
- type EnvValueError
- type EnvVar
- type FacadeHooks
- type FailedConfigRead
- type FileBackend
- func (FileBackend) ApplyInMemory(context.Context, string, map[string]any) error
- func (FileBackend) Boot(context.Context, string) error
- func (FileBackend) BootstrapEnvNames() []string
- func (b FileBackend) CacheVersion(ctx context.Context, home string, version []any) ([]any, error)
- func (b FileBackend) ConfigPath(home string) string
- func (FileBackend) DeploymentEnvNames() []string
- func (b FileBackend) Describe(_ context.Context, home string) string
- func (b FileBackend) Destination(_ context.Context, home string) (string, error)
- func (FileBackend) DoctorWarnings(context.Context, string) []DoctorWarning
- func (b FileBackend) Exists(_ context.Context, home string) (bool, error)
- func (FileBackend) HonorsManagedConfig() bool
- func (FileBackend) Locked(context.Context, string, string) (string, bool, error)
- func (b FileBackend) Name() string
- func (FileBackend) PreserveReadBase(context.Context) func()
- func (b FileBackend) ProbeReadable(_ context.Context, home string) error
- func (FileBackend) ProtectedEnvNames() []string
- func (FileBackend) ReadPath(path string) (any, error)
- func (FileBackend) ReadPathReadonly(path string) (any, error)
- func (b FileBackend) ReadUserDoc(ctx context.Context, home string) (any, error)
- func (b FileBackend) ReadUserDocReadonly(_ context.Context, home string) (any, error)
- func (FileBackend) SupportsFileTooling() bool
- func (b FileBackend) Version(_ context.Context, home string) ([]any, error)
- func (FileBackend) VersionPath(path string) ([]any, error)
- func (b FileBackend) WriteChanges(ctx context.Context, home string, changes Changes) error
- func (FileBackend) WritePath(ctx context.Context, path string, changes Changes) error
- type HomeInitializationError
- type InvalidUserConfigError
- type KeyValue
- type LanguageCatalog
- type Lookup
- type MissingEnvVar
- type NamedEnvVar
- type NamedPlatformManifest
- type NonASCIICredentialError
- type OptionalEnvState
- type OptionalEnvTable
- func (t *OptionalEnvTable) Arm(fill func() []NamedEnvVar, published func([]NamedEnvVar))
- func (t *OptionalEnvTable) Copy() map[string]EnvVar
- func (t *OptionalEnvTable) Delete(name string)
- func (t *OptionalEnvTable) Entry(name string) EnvVar
- func (t *OptionalEnvTable) Get(name string) (EnvVar, bool)
- func (t *OptionalEnvTable) Has(name string) bool
- func (t *OptionalEnvTable) Items() []NamedEnvVar
- func (t *OptionalEnvTable) Names() []string
- func (t *OptionalEnvTable) RawGet(name string) (EnvVar, bool)
- func (t *OptionalEnvTable) RawNames() []string
- func (t *OptionalEnvTable) Set(name string, entry EnvVar)
- type PathError
- type PhantomKeyError
- type PlatformManifest
- type RoundtripDoc
- type RoundtripYAML
- type RuntimeError
- type SafeDumpIndent
- type SafeDumpOptions
- type SafeWorkerPolicy
- type SaveOptions
- type Secrets
- func (s *Secrets) File() map[string]string
- func (s *Secrets) First(names ...string) (string, string, bool)
- func (s *Secrets) Get(name string) (string, bool)
- func (s *Secrets) Lookup() Lookup
- func (s *Secrets) Path() string
- func (s *Secrets) Remove(name string) (bool, error)
- func (s *Secrets) Set(name, value string) error
- func (s *Secrets) String(name string) string
- type SecureSaveResult
- type SettingsHooks
- type ShowGroup
- type ShowRow
- type ShowSources
- type SkillConfigVar
- type SkinArgs
- type SkinConfig
- type SkinListing
- type SystemExitError
- type TerminalEnvOptions
- type Tree
- func (t Tree) Bool(path string, fallback bool) bool
- func (t Tree) Clone() Tree
- func (t Tree) Float(path string, fallback float64) float64
- func (t Tree) Get(path string) any
- func (t Tree) Has(path string) bool
- func (t Tree) Int(path string, fallback int) int
- func (t Tree) Lookup(path string) (any, bool)
- func (t Tree) Map(path string) map[string]any
- func (t Tree) Set(path string, value any) error
- func (t Tree) String(path, fallback string) string
- func (t Tree) Strings(path string) []string
- func (t Tree) Sub(path string) Tree
- func (t Tree) Unset(path string) bool
- type UserLayer
- type WakeEvent
- type WorkerPolicyError
- type YAMLError
- type YAMLSet
Constants ¶
const ( ConfigFilename = "config.yaml" BackendEnv = "ICEBATH_CONFIG_BACKEND" )
const ( ColorReset = "\033[0m" ColorBold = "\033[1m" ColorDim = "\033[2m" ColorYellow = "\033[33m" ColorCyan = "\033[36m" )
Terminal color codes the config notices use
const ( PlatformSourceAll = "all" PlatformSourceBundled = "bundled" PlatformSourceUser = "user" )
Platform manifest sources a scan reads, the bundled tree, the home's user plugins or both
const DefaultBackupKeep = 5
Backups a config writer keeps per reason
const DefaultIdentity = "You are Icebath Agent, built by " + IdentityAuthor + ". Be direct: match the length of your reply to the weight of " +
"the ask \u2014 a one-line question gets a one-line answer, and finished work gets a short report of what " +
"changed, what's verified, and what's left, never a replay of the process. No filler (\"Great question,\" " +
"\"I'd be happy to\"), no restating the request back, no re-summarizing what you already said, no narrating " +
"tool calls the user can see. Plain claims over adjectives; when unsure, say so plainly. Agree because it's " +
"right, not because the user said it. Depth is earned \u2014 give it when the user asks for detail, teaches, or " +
"the stakes demand it, not by default."
Identity text seeded into SOUL.md on first run and used when a home carries no SOUL.md
const DefaultSandboxImage = "localhost/icebath-sandbox:desktop"
Image icebath builds from docker/sandbox/Dockerfile for every container terminal backend unless pinned
const DefaultSkinName = "blackwall"
DefaultSkinName is the built in skin a config without display.skin gets, also reachable as "default"
const DefaultToolset = "icebath-cli"
Toolset selection every new config starts from
const DefaultVercelImage = "vercel/sandbox/universal:latest"
Image fresh Vercel sandboxes start from
const DisplayLanguageKey = "display.language"
Config key holding the display language
const EnvManagedDir = "ICEBATH_MANAGED_DIR"
EnvManagedDir is the IT only override naming the managed scope directory
const IdentityAuthor = "Nicholas W. Heyer"
IdentityAuthor is the builder the default identity names
const LegacySandboxImage = "nikolaik/python-nodejs:python3.11-nodejs20"
Container image the default sandbox used before the display stack, dropped by the v48 step
const LegacyVercelRuntime = "node24"
Vercel runtime the setup wizard seeded before images replaced runtimes
const RacyMtimeWindowNS int64 = 2_000_000_000
Age under which a stat signature cannot rule out a same tick write after the stat
const TermuxInstallCommand = "pkg install proot-distro && proot-distro install debian && proot-distro login debian -- " +
"sh -c 'apt-get update && apt-get install -y curl ca-certificates && curl -fsSL https://icebath.app | sh'"
Installs icebath on Termux inside a Debian userland, the Linux release having no Termux build
const TurnLimitUnlimited = math.MaxInt
Iteration cap meaning no limit
Variables ¶
Streams the facade prompts read from and its plain output is printed to
var EnvRefusalOut io.Writer = os.Stderr
Stream that receives env write refusals, standard error outside tests
var EnvWriterLaunchDenylist = func() map[string]bool { return map[string]bool{} }
External provider launch env names, installed by pkg/provider so ACP argv authority stays unwritable
var ErrCoreEnvNamesUnregistered = errors.New("config: the provider bridge must register CoreDeclaredEnvNames before platform secrets are listed")
Errors when the provider bridge has not registered the core declared env names
var ErrEnvPermissions = errors.New(".env file is readable by other users")
Error of a .env file that is not owner only readable
var FacadeNoticeOut io.Writer = os.Stderr
Stream that receives managed mode refusals and managed key notices, standard error outside tests
var HomeSubdirs = []string{"cron", "sessions", "logs", "logs/curator", "memories", "pairing", "hooks", "image_cache", "audio_cache", "skills"}
Subdirectories every home carries
var IsMultiplexActive func(ctx context.Context) bool
Multiplex predicate of agent.secret_scope that pkg/provider installs, nil in a process without a multiplexer
var KnownContainerTypes = map[string]string{
"providers": "mapping",
"model.aliases": "mapping",
"plugins.enabled": "list",
"plugins.disabled": "list",
}
Container roots absent from the defaults whose readers fix their shape
var LegacySandboxImages = []string{LegacySandboxImage, "nikolaik/python-nodejs:python3.14-nodejs22"}
Every earlier default sandbox image a saved terminal image may still equal
var ManagedConfigHonored = func() bool { backend, err := GetConfigBackend(context.Background()) if err != nil { panic(err) } return backend.HonorsManagedConfig() }
Whether the selected config backend takes managed files, an unavailable backend exiting like the Python SystemExit
var OptionalEnvVars = NewOptionalEnvTable(optionalEnvDecl)
Optional env table of setup, the keys page and the child env policy, provider and platform entries joining later
var ParseFailureOut io.Writer = os.Stderr
Stream the parse failure warning is written to
var PlatformSecretEnvSuffixes = []string{"_TOKEN", "_SECRET", "_KEY", "_PASSWORD", "_JSON"}
Env name suffixes that make a platform variable a secret unless its declaration says otherwise
var RequiredEnvVars = map[string]EnvVar{}
Env variables every install must set, none since the setup wizard picks the provider
var RuamelDefaultIndent = SafeDumpIndent{Mapping: 2, Sequence: 2, Offset: 0}
Indentation of a ruamel YAML instance left at its defaults, sequences indentless under a mapping key
var ScalarAsOneItemListKeys = map[string]bool{"agent.disabled_toolsets": true, "skills.disabled": true}
List slots whose readers accept a bare name as a one item list
var SecretConfigKeys = secretConfigKeys
Exported lowercase config key names whose values are secrets
var SuppressWarningsOn func(ctx context.Context, platform string) bool
Whether a chat platform hides warning notices, installed by the settings package
var TerminalConfigEnvMap = func() [][2]string { out := [][2]string{{"backend", "TERMINAL_ENV"}} for _, key := range []string{ "degraded_mode", "cwd", "temp_dir", "timeout", "lifetime_seconds", "docker_image", "docker_forward_env", "modal_image", "daytona_image", "vercel_runtime", "vercel_image", "ssh_host", "ssh_user", "ssh_port", "ssh_key", "container_cpu", "container_memory", "container_disk", "container_persistent", "docker_volumes", "docker_env", "docker_mount_cwd_to_workspace", "docker_network", "docker_extra_args", "docker_shm_size", "docker_run_as_host_user", "docker_snap_compat", "docker_persist_across_processes", "docker_shared_container_key", "docker_orphan_reaper", "sandbox_dir", "persistent_shell", } { out = append(out, [2]string{key, "TERMINAL_" + strings.ToUpper(key)}) } return out }()
Terminal config keys in declaration order with the env var each one mirrors
var ValidReasoningEfforts = []string{"minimal", "low", "medium", "high", "xhigh", "max", "ultra"}
Reasoning effort levels a bare string may name
var YAMLWarningOut io.Writer = os.Stderr
Stream Python warnings of YAML loads are written to
Functions ¶
func ActiveConfigParseFailure ¶
Recorded parse error while the active config file is byte identical to the one that failed
func AddIssue ¶
func AddIssue(issues *[]ConfigIssue, severity, message, hint string)
Appends an issue built from its severity, message and fix hint
func AppendMappingKey ¶
Moves a key to the end of the mapping order the way a Python dict insert of a new key does
func ApplyManagedOverlay ¶
ApplyManagedOverlay deep merges administrator pinned values on top of the document, unchanged without a scope
func ApplyTerminalConfigToEnv ¶
func ApplyTerminalConfigToEnv(ctx context.Context, h string, opts TerminalEnvOptions) error
Bridges terminal config keys into the env vars terminal tools read, explicit file keys overriding env values
func AsBool ¶
Boolean view of a YAML scalar: a boolean, a number of any Go kind as nonzero, or the usual truthy and falsy spellings
func AsFloat ¶
Float view of a YAML scalar: a number of any Go kind, a *big.Int included, or numeric text
func AsInt ¶
Integer view of a YAML scalar: an integer of any Go kind within the int range, a whole float within it or decimal text
func AsStrings ¶
String list view of a list or a comma separated string, null items skipped and other items as their plain text
func AtomicConfigReplace ¶
func AtomicConfigReplace(ctx context.Context, h, configPath string, data map[string]any, extraContentOnCreate string) error
Persists the complete desired config state, omitted mapping keys deliberately deleted
func AtomicConfigWrite ¶
func AtomicConfigWrite(ctx context.Context, h, configPath string, data map[string]any, extraContentOnCreate string) error
Persists a config without letting an incomplete mapping delete existing settings
func AtomicJSONWrite ¶
Writes data as two space indented JSON through a synced temp file keeping the existing mode and owner
func AtomicJSONWriteMode ¶
func AtomicJSONWriteMode(ctx context.Context, path string, data any, mode os.FileMode, opts ...jsonutil.Option) error
Atomic json.dump with the given dump options whose temp file and target carry the given mode
func AtomicJSONWriteModeSyncDir ¶
func AtomicJSONWriteModeSyncDir(ctx context.Context, path string, data any, mode os.FileMode, opts ...jsonutil.Option) error
Mode carrying atomic JSON write that also syncs the resolved target directory so the rename survives power loss
func AtomicJSONWriteWith ¶
Atomic json.dump with the given dump options, ensure_ascii escapes only for a payload that is not valid UTF-8
func AtomicWrite ¶
Writes data to path through a temporary sibling and a rename
func AtomicYAMLWrite ¶
Writes data as YAML plus extra through a synced temp file, keeping the existing mode and owner
func AtomicYAMLWriteCreateMode ¶
func AtomicYAMLWriteCreateMode(ctx context.Context, path string, data any, extra string, createMode os.FileMode) error
Writes like AtomicYAMLWrite with a new file created at the given mode
func BackupConfig ¶
Copies config into the backups dir, empty when skipped or failed, errors when no backend serves config
func BackupsDir ¶
Directory holding the dated config backups beside a config file
func BackupsDirDisplay ¶
Display form of the config backups dir of a home
func BootstrapDeployment ¶
Publishes the deployment from an explicit dotenv load home and project file before its first config read
func BundledPlatformDirNames ¶
Directory names of the bundled platform plugins that have a manifest path
func Canonicalize ¶
Document as stored, refused when its agent section is set to something other than a mapping
func CheckNonASCIICredential ¶
CheckNonASCIICredential strips non ASCII characters from a credential and warns on stderr which ones went
func ConfigCacheVersion ¶
Signature for a parse cache that also changes on a same tick same size rewrite
func ConfigCacheVersionOrNone ¶
Cache version, nil when the config is absent or cannot be read, other errors returned
func ConfigCheckDiagnostics ¶
func ConfigCheckDiagnostics(cfg map[string]any, getEnv func(name string) string, src CheckDiagnosticsSources) ([]string, error)
Saved toolset problems plus each disabled bundled platform whose required credentials are all configured
func ConfigCommand ¶
func ConfigCommand(ctx context.Context, h string, args ConfigArgs, src ConfigCommandSources) error
Runs one config subcommand, a backend write refusal printed as an error with status 1
func ConfigDestination ¶
Where a write to a config path lands, the file path or the backend own name
func ConfigExists ¶
Reports whether a config file exists
func ConfigFromJSON ¶
Decoded JSON as config mappings in document key order with integers as Go ints
func ConfigStructureIssueLines ¶
func ConfigStructureIssueLines(issues []ConfigIssue) []string
Severity tagged lines with each first hint line for an unknown provider error
func ConfigVersion ¶
Cache signature of a config file, the stat error when it cannot be stat'ed
func ConfigVersionOrNone ¶
Version, nil when the config is absent or cannot be stat'ed, other errors returned
func ContainerSlots ¶
Dotted key to list or mapping for every container slot the defaults and known container table fix
func CoreDeclaredEnvNames ¶
Every env name core declares, the static table plus provider profile names, from the provider bridge
func CustomEndpointKeyEnv ¶
Env name holding a custom endpoint key, one slot per endpoint identity
func DecodeEnvBytes ¶
Text of a dotenv file, the BOM dropped and invalid UTF-8 read as Latin-1
func DeploymentEnvNames ¶
Deployment env names of the selected backend, never launch residue
func DetectInstallMethod ¶
Install method from the code stamp, a home stamp, the managed marker, a package manager layout or a git checkout
func DiagnosticMetadata ¶
Diagnostic notification category of a trusted internal diagnostic only wake, empty for everything else
func DiagnosticTurnMuted ¶
A diagnostic category wake mutes its turn only when the owning policy hides diagnostics
func DiagnosticWakeMuted ¶
Only trusted diagnostic only wakes mute a turn, a recorded mute snapshot winning
func DisplayLanguageError ¶
func DisplayLanguageError(value string, cat LanguageCatalog) string
Refusal for an unsupported display language, empty when the value is blank or resolves
func DropOtherAccess ¶
Strips the world permission bits of a config file a writer just placed, group bits and setgid staying for shared group homes, managed installs and containers keeping their modes
func EditConfig ¶
Opens the config file in the user editor, seeding a missing file first
func EffectiveUserConfig ¶
Active profile effective user config, empty when it cannot be read so presentation fails open
func EnsureIcebathHome ¶
Ensures the home skeleton once per home path, refusing a deleted named profile
func EnvFloat ¶
Float value of an environment variable, an infinity for one too large, def when unset, blank or not a number
func EnvInt ¶
Integer value of an environment variable saturated to int64, def when unset, blank or not a decimal integer
func EnvLineDefinesKey ¶
Reports whether a dotenv line assigns key in exactly the shapes the env loader parses
func EnvRefLookup ¶
Env reference lookup load_config expands config templates with, the process env
func EnvRefVarName ¶
Variable name a reference body reads, empty for a non env source or a blank env source
func EnvVarEnabled ¶
True when the named variable trimmed and lowercased is 1, true, yes or on
func EnvWriteRefusal ¶
Refusal text when a managed install or an administrator pinned key forbids writing key, empty when allowed
func ExecInContainer ¶
func ExecInContainer(info *ContainerExecInfo, cliArgs []string) (code int, err error)
Replaces this process with the same command inside the managed container
func ExpandString ¶
Value with every ${VAR} and ${env:VAR} reference replaced, unresolved references kept verbatim
func ExplicitPaths ¶
Leaf paths present in a raw document
func FailedReadError ¶
Read error of a mapping served as the fallback for an unreadable config, nil for ordinary data
func FastSafeLoad ¶
Parsed YAML root of file bytes read as utf-8 text under the shared safe_load policy, nil for an empty document
func FileCacheVersion ¶
Signature plus content digest of a file, digesting on every call when alwaysDigest is set
func FileCacheVersionOf ¶
Cache version of a file from a stat result the caller took, with the racy digest
func FileSignature ¶
Change detection key of a stat result as mtime ns, size, inode and ctime ns
func FormatConfigParseFailure ¶
User copy for an unreadable or unparseable config file naming what happens and how to fix it
func FormatDockerUpdateMessage ¶
func FormatDockerUpdateMessage() string
User facing guidance for icebath update inside the published Docker image
func FormatManagedMessage ¶
User facing refusal for an action on a package manager managed install
func GetActiveSkinName ¶
Name of the active skin, default for a routed home that never chose one
func GetConfigValue ¶
func GetConfigValue(ctx context.Context, h, key string, asJSON, raw bool, src ConfigCommandSources) error
Prints the value in effect for a setting or an env shaped key, credentials masked unless raw or redaction is off
func GetEnvPath ¶
Secrets file holding the API keys of the resolved home
func GetEnvValue ¶
Value from the scoped process env, else the home .env, a failed scoped read returned as an error
func GetEnvValuePreferDotenv ¶
Credential from the home .env first, an unresolved op reference yielding to the scoped value
func GetManagedUpdateCommand ¶
Upgrade guidance for a nix managed install, empty when no nix system manages it
func GetProjectRoot ¶
func GetProjectRoot() string
Source tree the running code was built from, else the directory holding the running binary
func InitSkinFromConfig ¶
Activates display.skin of a config, default when it is unset, blank or not a string
func InitializeHome ¶
Creates the home skeleton, private unless managed, and seeds the default soul
func InstallMethodStamp ¶
Install method the stamp beside the binary of root names, empty when unstamped or unsupported
func InstallSkinColorFilter ¶
InstallSkinColorFilter routes every GetColor result through fn, nil removing the filter
func InvalidateEnvCache ¶
func InvalidateEnvCache()
Drops every .env memo so the next load sees a write even on coarse mtime filesystems
func InvalidateEnvFileCache ¶
func InvalidateEnvFileCache(path string)
InvalidateEnvFileCache drops one path from the dotenv memo, every path when the path is empty
func InvalidateManagedCache ¶
func InvalidateManagedCache()
InvalidateManagedCache drops cached managed config and env
func IsDiagnosticNotice ¶
Warning or error notices and every credit service notice are diagnostics
func IsEnvConfigKey ¶
Reports whether config set routes this credential shaped dotless key to .env
func IsEnvManaged ¶
IsEnvManaged is true when the env var name is pinned by the managed .env layer
func IsKeyManaged ¶
IsKeyManaged is true when the exact dotted key is pinned by the managed layer
func IsLegacyTemplateSoul ¶
Reports whether a SOUL.md still holds an earlier auto seeded text nobody edited, never the current default
func IsNixInstallMethod ¶
Reports whether nix owns the method, a nix store install or a nixos or home-manager module
func IsPackageManagerInstallMethod ¶
Reports whether a package manager other than nix or docker owns the install and its updates
func IsReleaseBinaryInstallMethod ¶
Reports whether icebath update replaces the binary from a published release for the method
func IsSSHRemoteTildeCwd ¶
Reports whether the remote SSH shell must expand a tilde cwd itself
func IsWarningStatus ¶
Warn events and diagnostic classified messages are warning statuses
func IsYAMLError ¶
Reports whether err is a failure of the shared YAML reader or writer
func KeepingReadBase ¶
Runs a pre write guard read without making it the base a later document save diffs against
func KeyString ¶
Map key under which a non str Python key is stored, never equal to a key a YAML str produces
func ListConfigBackups ¶
Existing backups newest first, filtered to one reason when given
func LoadEnv ¶
Parsed .env of a home, empty for a frozen worker whose secrets arrive through its scope
func LoadEnvFile ¶
Assignments of a dotenv file memoised on its exact bytes, a fresh map per call, empty when unreadable
func LoadManagedConfig ¶
LoadManagedConfig is the parsed managed config.yaml, empty when absent, malformed, or not honored
func LoadManagedEnv ¶
LoadManagedEnv is the parsed managed .env, empty when absent
func LoadNewestGoodBackup ¶
Raw mapping of the newest good backup, nil when absent, unreadable, not a mapping or the backend has no files
func LoadUserEffective ¶
Effective user layer of a config path, a broken file served from the last good parse
func LoadUserEffectiveFailClosed ¶
Effective user layer of a config path, a broken file returning its parse error
func LoadYAMLFileReadonly ¶
Parse of a YAML file shared until its cache version changes, the result must never be mutated
func LockConfig ¶
Takes the process config lock unless ctx already holds it, returning the holding ctx and its release
func LooksStructuredValue ¶
Reports whether a string plausibly encodes a YAML or JSON list or mapping
func ManagedConfigKeys ¶
func ManagedConfigKeys() []string
ManagedConfigKeys lists the dotted leaf keys the managed config pins
func ManagedDir ¶
func ManagedDir() string
ManagedDir resolves the managed scope directory, empty when no scope is present
func ManagedError ¶
Prints the managed install refusal for an action to standard error
func ManagedSystem ¶
Package manager owning the install from ICEBATH_MANAGED or the home marker, empty when unmanaged
func MappingKeyOrder ¶
Keys of the mapping at a key path of a YAML file in loaded dict order, nil when the file or the mapping is absent
func MappingKeys ¶
Keys of a mapping in file or insertion order, keys without a recorded position following in sorted order
func MappingPyKey ¶
Non str Python key a string key of a mapping stands for, false for an ordinary str key
func MaskSecret ¶
Masks a secret for display as head...tail, shorter values become stars and empty ones the empty label
func MergePartialSave ¶
Override over raw for a partial save, omitted sections kept and shared sections deep merged
func ModelForcesMaxCompletionTokens ¶
Whether an OpenAI model family rejects max_tokens and needs max_completion_tokens
func MtimeIsRacy ¶
Reports whether a timestamp is too recent to rule out a same tick write after the stat
func NixMergeConfig ¶
Deep merges the Nix settings JSON into config.yaml, Nix keys replacing those on disk and every other key kept
func NixRenderSettings ¶
Nix module settings JSON with the package config version added when absent, as json.dump writes it
func NormalizeProxyEnvVars ¶
func NormalizeProxyEnvVars()
Rewrites the proxy and bypass variables of the process to their canonical forms in place
func NormalizeProxyURL ¶
The socks5 form of a socks proxy URL, other values stripped, empty for a blank value
func NoteRuntimeImport ¶
func NoteRuntimeImport(name string)
Records that a runtime component started, after which no worker policy may bind
func PackageManagerOfPath ¶
Package manager whose install layout a binary path sits in, empty for none
func ParseCLIValue ¶
Value the CLI writes for typed text: bool, null, int, float, list or mapping, text of string settings kept verbatim
func ParseEnvValue ¶
Dotenv value with surrounding quotes removed and double quote escapes reversed
func ParseReasoningEffort ¶
Reasoning config of a level, nil for empty or unknown input and enabled false for a disable spelling
func PatchUpdateCommandForMethod ¶
func PatchUpdateCommandForMethod(method, command string) func()
Makes method's update command read command until the returned restore runs
func PinnedKeys ¶
Dotted keys a document save in ctx stores even when unchanged
func PinnedTerminalBackend ¶
func PinnedTerminalBackend() string
PinnedTerminalBackend is the non empty terminal.backend the managed config pins, else empty
func PinningKeys ¶
Context in which a document save stores keys at the user layer even when unchanged from the inherited value
func PlatformManifestSecretEnvs ¶
Secret env names one source's platform manifests declare, the bundled set read once at startup minus core names
func PlatformManifestSecretScan ¶
A home's user platform plugin secrets read strictly and whether every plugin dir and manifest was read
func PlatformManifestStamp ¶
Change detection key over every user platform plugin manifest of a home, changing on any add, removal or edit
func PlatformPluginManifestDirNames ¶
Directory names of every readable platform plugin manifest across the bundled and user sources
func PresentNotification ¶
func PresentNotification(ctx context.Context, present func(context.Context) error, platform string, diagnostic bool) (bool, error)
Awaits the presenter only when its classified content is visible and reports whether it ran
func PrintConfigWarnings ¶
func PrintConfigWarnings(ctx context.Context, h string, cfg map[string]any, removedNote func(section, name string) string)
Writes config structure warnings to stderr, the loaded config checked when cfg is nil
func ProbeConfigReadable ¶
Error while a config file cannot be read, with no parse
func QuoteEnvValue ¶
Value quoted for a dotenv line when it carries whitespace, quotes, a hash or a backslash
func RacyContentDigest ¶
Empty once the signature has settled, a digest of the file bytes while the later of mtime and ctime is racy
func ReadConfigDoc ¶
Parsed root of a config file, nil when empty
func ReadConfigDocReadonly ¶
Signature cached parse of a config file, shared and never to be mutated
func ReadDocument ¶
Parsed user document of a YAML file, empty when the file is absent or blank
func ReadEnvLines ¶
Dotenv lines decoded as utf-8-sig with replacement, each normalized and ending in one newline
func ReadRawConfig ¶
Raw config.yaml of a home with no defaults or expansion, a private copy the caller may mutate
func ReadRawConfigReadonly ¶
Raw config.yaml of a home shared with the cache, the result must never be mutated
func ReadUserConfigRaw ¶
User config.yaml as written with no cache, ONLY legal for write-back round-trips and raw-file diagnostics, behavioral reads use load_config()
func RebaseForSave ¶
func RebaseForSave(cfg, liveRaw map[string]any, mergeExisting bool, loadConfig func() map[string]any) map[string]any
Config a save persists, a frozen worker landing only its own edits on the live file
func RecommendedUpdateCommand ¶
Update command for this install, the managed guidance winning over a stale code stamp
func RecommendedUpdateCommandForMethod ¶
Update command or guidance for an install method, icebath update when the method has no steward
func RedactConfigValue ¶
Copy of a config value with credential shaped keys masked, env templates left visible
func RefSnapshot ¶
Names referenced by the document mapped to the values the expansion saw
func RefuseFailedRead ¶
Refusal to save a fail open fallback, nil for ordinary data
func RefuseOverwrite ¶
Error for a write that must not replace an existing config file
func RefusedLockedOmissionPrefixes ¶
Dotted prefixes a document save in ctx must write whole
func RefusingLockedOmissions ¶
Context in which a document save refuses a locked changed key under prefixes instead of omitting it
func RegisterConfigBackend ¶
func RegisterConfigBackend(kind string, factory func() ConfigBackend)
Serves backend kind from factory, panicking on an invalid kind or a second registration
func RegisterConfigBootstrapEnv ¶
func RegisterConfigBootstrapEnv(apply func(ctx context.Context, backendNames func(kind string) []string, home, projectEnv string) error)
Installs the env loader publication of the deployment env the bootstrap runs before the first selection
func RegisterConfigFacade ¶
func RegisterConfigFacade(h FacadeHooks)
Installs the facade collaborators, called from an init of the package that owns them
func RegisterPolicyNote ¶
Installs the redaction policy recorder the log formatter reads, setter names the policy kind
func RegisterRedactionSwitch ¶
Installs the effective redaction switch for the active profile, called from the redaction owner init
func RegisterSettingsHooks ¶
func RegisterSettingsHooks(h SettingsHooks)
Installs the settings registry lookups the CLI writer consults
func RegisterSkillConfigVars ¶
func RegisterSkillConfigVars(fn func() ([]SkillConfigVar, error))
Installs the reader of the skill declared config variables
func ReloadEnv ¶
Re-reads the home .env into the process env, removing known keys it dropped unless the file is unreadable
func RemoveEnvValue ¶
Removes every assignment of key from a dotenv file, reporting whether one existed
func RemoveHomeEnvValue ¶
Removes key from the home .env and the published env, reporting whether a line defined it
func RenderNotification ¶
func RenderNotification(ctx context.Context, render func() error, platform string, diagnostic bool) (bool, error)
Runs the renderer only when its classified content is visible and reports whether it ran
func RequireEnvWritable ¶
Error carrying the refusal when the .env write lock forbids key
func RequireFileTooling ¶
Refuses a file copy tool when the selected backend has no config file
func RequireParseableUserConfig ¶
Refuses an existing invalid config before a non interactive run, missing and empty files pass
func RequireReadableConfigBeforeWrite ¶
func RequireReadableConfigBeforeWrite(ctx context.Context, configPath string) (map[string]any, error)
Mapping of an existing config file, refusing an unreadable or unparseable one before a write replaces it
func ResetActiveSkinsForTests ¶
func ResetActiveSkinsForTests()
Drops the process and per home active skins so the next read loads the default skin again
func ResetBootstrapForTests ¶
func ResetBootstrapForTests()
Marks the process as not yet bootstrapped so the next backend selection publishes the deployment again
func ResetCache ¶
func ResetCache()
Forgets every cached config document and the last good expansions
func ResetConfigParseFailures ¶
func ResetConfigParseFailures()
Clears the warned signatures and recorded parse failures
func ResetTimezoneCache ¶
func ResetTimezoneCache()
Drops every cached zone so the next call resolves the env and config again
func ResetWorkerPolicyForTests ¶
func ResetWorkerPolicyForTests()
Clears the process worker policy and runtime marks, the seam tests reach by replacing policy
func ResolveDisplayLanguage ¶
func ResolveDisplayLanguage(value string, cat LanguageCatalog) (string, bool)
Canonical language id after plugin discovery, false when no layer supplies it
func ResolvePerModelProviderRouting ¶
Per model provider routing entry matched with the override spelling tolerance, empty when none matches
func ResolvePerModelReasoningEffort ¶
Per model reasoning override with spelling tolerance, prefixed keys matched in reverse, nil when none parses
func ResolveTurnLimit ¶
Iteration cap from a raw max_turns value, the fallback for null, a bool, a NaN and unparseable values
func RunBudgetSeconds ¶
Positive seconds of a run budget from a number of any Go kind or numeric text, nil for no budget: absent, a bool, unreadable, zero or less
func RunningSourceTree ¶
func RunningSourceTree() string
RunningSourceTree is the module tree holding this binary's own source, empty when no such tree exists here
func SafeDump ¶
YAML text of data as safe_dump writes it with sort_keys off, the setting every caller in the tree passes
func SafeDumpTo ¶
func SafeDumpTo(w io.Writer, data any, opts SafeDumpOptions) error
Writes data to w as YAML under the given options, nothing written when the data cannot be represented
func SafeDumpWith ¶
func SafeDumpWith(data any, opts SafeDumpOptions) ([]byte, error)
YAML text of data under the given safe_dump options
func SafeLoad ¶
Value of one YAML document given as a Python str, bytes or a reader yielding bytes, as builds it
func SafeLoadText ¶
Value of a YAML file's bytes read the way open with utf-8 or utf-8-sig and read does, universal newlines included
func SafeStrftime ¶
Time written in a strftime format
func SafeWorkerEnabled ¶
func SafeWorkerEnabled() bool
Reports whether a safe mode worker policy is bound
func SanitizeEnvFile ¶
Rewrites the home .env with normalized line formatting and returns how many lines changed
func SanitizeEnvLines ¶
Lines with endings normalized to one newline, assignments trimmed and comments or blanks kept verbatim
func SanitizeNoProxyEntries ¶
Bypass list with bracketed and CIDR IPv6 entries rewritten to bare literals, the input itself when nothing changed
func Save ¶
Writes the effective document of a home, dropping values equal to the defaults the user never set
func SaveAnthropicAPIKey ¶
func SaveAnthropicAPIKey(ctx context.Context, h, value string, save func(name, value string) error) error
Persists an Anthropic API key and clears the OAuth token slot
func SaveAnthropicOAuthToken ¶
func SaveAnthropicOAuthToken(ctx context.Context, h, value string, save func(name, value string) error) error
Persists an Anthropic OAuth or setup token and clears the API key slot
func SaveConfig ¶
Saves a config to the home config.yaml, defaults the user never set stripped and managed leaves dropped
func SaveEnvValue ¶
Saves or replaces one assignment in the home .env, refused writes printed and skipped
func SaveEnvValueContext ¶
Saves one .env assignment, matching export lines too, and publishes it to the scope or process env
func ScopedEnvironGet ¶
Reads an env name through the registered secret scope, the plain process env when none is registered
func SecureDir ¶
Owner only directory unless managed, container defaults or ICEBATH_HOME_MODE say otherwise
func SecureFile ¶
Owner only config file unless managed or in a container
func SeedConfigFile ¶
Creates a missing config by copying the example template, else writing the stripped defaults
func SetConfigValue ¶
func SetConfigValue(ctx context.Context, h, key, value string, src ConfigCommandSources) error
Sets a setting through the settings writer, env shaped keys going to .env; any other key is refused
func SetEnvValue ¶
Writes or replaces one assignment in a dotenv file, keeping every other line
func SetMappingClass ¶
Records the Python dict subclass a mapping loaded as, such as ordereddict for a YAML omap
func SetMappingKeys ¶
Records the key order of a mapping so later readers iterate it the way the file or builder did
func SetMappingPyKey ¶
Records that a string key of a mapping stands for a non str Python key such as True, 1 or None
func ShlexQuote ¶
Word quoted for a POSIX shell: as it is when every character is safe unquoted, otherwise in single quotes with each inner single quote closed, escaped and reopened
func ShowConfig ¶
Prints the configuration of the home in ctx: paths, masked keys, then every settings group
func ShowValue ¶
Text of a config value as a person reads it: text as it is, null, true or false, numbers and times as YAML writes them, containers as compact JSON
func SkinCommand ¶
func SkinCommand(ctx context.Context, args SkinArgs, src ConfigCommandSources, stdout, stderr io.Writer) (int, error)
Runs icebath skin list, use or set and returns the process exit status
func SnapshotCurrent ¶
Reports whether every referenced name still resolves to the snapshot value
func SortedEnvNames ¶
Names of an env catalog in sorted order
func StaticCoreEnvNames ¶
Copy of the names core declared before platform manifests were read
func StripDefaults ¶
Document without values equal to the defaults, preserved paths kept even when equal
func SupportsFileTooling ¶
Reports whether tools that copy, edit or back up the config file itself may run
func SwapConfigVersion ¶
func SwapConfigVersion(f func(ctx context.Context, configPath string) ([]any, error)) (restore func())
Replaces the config version answer until the returned restore runs
func SwapFileReadUserDoc ¶
func SwapFileReadUserDoc(f func(b FileBackend, ctx context.Context, home string) (any, error)) (restore func())
Replaces the file layer user document read until the returned restore runs
func SwapParseEnvText ¶
SwapParseEnvText installs the dotenv parser the memo calls and returns the one it replaced
func SwapSafeDump ¶
Replaces the dumper behind AtomicYAMLWrite and returns the restore func, for tests simulating a failed dump
func TerminalConfigEnvVarForKey ¶
Env var mirrored by a dotted terminal config key, false outside the terminal section
func TerminalEnvValueText ¶
Env text of a terminal config value, JSON for a list or mapping and the Python str otherwise
func TimeNow ¶
Current time in the configured zone, else in server local time so later and earlier instants keep their own offsets
func TimezoneName ¶
Configured IANA name of the active profile even when invalid, empty for server local time
func TryLockConfig ¶
Takes the process config lock without blocking, true when ctx already holds it or the lock was free
func UnsetConfigValue ¶
func UnsetConfigValue(ctx context.Context, h, key string, src ConfigCommandSources) error
Removes a setting's value through the settings writer or an env shaped key from .env, refusing managed, locked and unknown keys
func UseAnthropicClaudeCodeCredentials ¶
func UseAnthropicClaudeCodeCredentials(ctx context.Context, h string, save func(name, value string) error) error
Clears both Anthropic slots so the Claude Code credential files are used
func ValidateEnvName ¶
Fails when key is not a portable environment variable name
func ValidateEnvNameForWrite ¶
Rejects an invalid name or one on the writer denylist before a generic persistence write
func ValidateQuotedContainers ¶
func ValidateQuotedContainers(cfg map[string]any, issues *[]ConfigIssue)
Warning for each container slot holding one quoted string that parses as a list or mapping
func ValidateTimezone ¶
func ValidateTimezone(cfg map[string]any, issues *[]ConfigIssue)
Error when timezone is not a string or names a zone the tz database cannot load
func ValidateVoice ¶
func ValidateVoice(cfg map[string]any, issues *[]ConfigIssue)
Error when voice submit_mode is present and neither direct nor draft
func ValidateWebBackends ¶
func ValidateWebBackends(cfg map[string]any, issues *[]ConfigIssue, removedNote func(section, name string) string)
Warning for each web backend selection naming a backend removed from the tree
func VersionToken ¶
Number that changes with a backend version, zero for no config
func WarnConfigParseFailure ¶
func WarnConfigParseFailure(ctx context.Context, configPath string, err error, fallback string) error
Records a config parse failure and warns once per signature, errors when the corrupt backup has no backend
func WarnDeprecatedCwdEnvVars ¶
Warns about MESSAGING_CWD and TERMINAL_CWD left in the home .env instead of terminal.cwd
func WarnIfCredentialFileBroadlyReadable ¶
Warns with a chmod 600 hint when a POSIX credential file is group or world readable, true when it warned
func WarningNotificationsEnabled ¶
Whether diagnostics show on the platform of the profile in ctx
func WorkerConfigSnapshot ¶
Detached copy of the frozen worker config, nil when the ordinary loader owns config
func WriteChanges ¶
One changes write where a nil set value stores an explicit null for a backend with levels
func WriteConfigDocument ¶
func WriteConfigDocument(ctx context.Context, configPath string, document map[string]any, extraContentOnCreate string) error
Replaces a config document, merged comment preserving onto the file by the file backend
func WriteConfigKey ¶
Sets one dotted key, nil removing it
func WriteConfigKeys ¶
Sets several related dotted keys as one write, a nil value removing its key
func WriteEnvLines ¶
Replaces a dotenv file with lines verbatim, keeping its mode when asked or securing it under the process home
func WritePlatformConfigField ¶
func WritePlatformConfigField(ctx context.Context, h, platformKey, fieldKey string, value any, raw bool) error
Persists one field under platforms.<platform>, raw edits only the user file
func WriteUserConfig ¶
Writes the raw user config of home h, reporting the change to the saved observer when one is installed
func YAMLErrorDetails ¶
Single line details text, the YAML problem or the exception text with whitespace runs collapsed
func YAMLErrorLocation ¶
Line of the problem mark, else the context mark, of a YAML error such as line 12, empty without one
Types ¶
type BotProfile ¶
Profile directory the bot mode roster names
type Changes ¶
type Changes struct {
Document map[string]any
Set []KeyValue
Unset []string
ExtraContentOnCreate string
}
Write to one profile user layer, the document applied first
type CheckDiagnosticsSources ¶
type CheckDiagnosticsSources struct {
PlatformToolsetDiagnostics func(platformToolsets any, cfg map[string]any) []string
DisabledPlugins func() map[string]bool
BundledPlatformManifests func() ([]PlatformManifest, error)
}
Readers the check diagnostics consult, supplied by the toolset validation and plugin discovery owners
type ConfigArgs ¶
Parsed config command line, an empty command meaning show
type ConfigBackend ¶
type ConfigBackend interface {
Name() string
ReadUserDoc(ctx context.Context, home string) (any, error)
ReadUserDocReadonly(ctx context.Context, home string) (any, error)
Version(ctx context.Context, home string) ([]any, error)
CacheVersion(ctx context.Context, home string, version []any) ([]any, error)
Exists(ctx context.Context, home string) (bool, error)
ProbeReadable(ctx context.Context, home string) error
WriteChanges(ctx context.Context, home string, changes Changes) error
Locked(ctx context.Context, home, dotted string) (string, bool, error)
SupportsFileTooling() bool
HonorsManagedConfig() bool
Boot(ctx context.Context, home string) error
ProtectedEnvNames() []string
DeploymentEnvNames() []string
BootstrapEnvNames() []string
PreserveReadBase(ctx context.Context) (restore func())
DoctorWarnings(ctx context.Context, home string) []DoctorWarning
ApplyInMemory(ctx context.Context, home string, doc map[string]any) error
Describe(ctx context.Context, home string) string
Destination(ctx context.Context, home string) (string, error)
}
Store of the user config layer every config read and write goes through
func GetConfigBackend ¶
func GetConfigBackend(ctx context.Context) (ConfigBackend, error)
Backend the environment selects, file by default, unavailable for a kind this build lacks
func LocalFileLayer ¶
func LocalFileLayer(configPath string) (ConfigBackend, string)
Local file backend of a path whichever backend is selected, for the PM dependency runtime
type ConfigBackendUnavailable ¶
Selected backend cannot serve config, an exit and never a fall back to defaults
func (*ConfigBackendUnavailable) Error ¶
func (e *ConfigBackendUnavailable) Error() string
func (*ConfigBackendUnavailable) SystemExitCode ¶
func (e *ConfigBackendUnavailable) SystemExitCode() string
type ConfigCommandSources ¶
type ConfigCommandSources struct {
// Registers the settings blocks plugins declare, so their keys are known before a lookup
LoadPluginSettings func()
IsEnvSettingKey func(key string) bool
SaveEnvSetting func(ctx context.Context, h, key, value string) error
ReadEnvSetting func(h, key string) (string, bool)
RemoveEnvSetting func(ctx context.Context, h, key string) (bool, error)
DropStaleModelRoute func(modelCfg map[string]any, provider string, cfg map[string]any) (map[string]any, bool)
Language LanguageCatalog
Show func(ctx context.Context, h string) (ShowSources, error)
CheckDiagnostics CheckDiagnosticsSources
}
Readers and writers config set, get, unset, show and check reach outside this package
type ConfigExit ¶
type ConfigExit struct{ Code int }
Process exit status a config command ends with, its message already printed
func (*ConfigExit) Error ¶
func (e *ConfigExit) Error() string
type ConfigIssue ¶
One detected config structure problem with severity error or warning
func ConfigLoadIssue ¶
func ConfigLoadIssue(err error) ConfigIssue
Config issue for a load failure, storage problems kept apart from a broken config file
func ValidateConfigStructure ¶
func ValidateConfigStructure(cfg map[string]any, removedNote func(section, name string) string) []ConfigIssue
Structure problems of a loaded config, removedNote explains a removed tool backend or returns empty
func ValidateLoadedConfigStructure ¶
func ValidateLoadedConfigStructure(ctx context.Context, h string, lookup Lookup, removedNote func(section, name string) string) []ConfigIssue
Structure issues of the loaded config, a single load issue when the config cannot be loaded
type ConfigLockedError ¶
type ConfigLockedError struct {
*ConfigWriteError
Path string
LockedBy string
}
Write touching a path an upper level locks
func NewConfigLockedError ¶
func NewConfigLockedError(path, lockedBy, message string) *ConfigLockedError
Builds a lock refusal with the default message naming the locking level
func (*ConfigLockedError) Unwrap ¶
func (e *ConfigLockedError) Unwrap() error
type ConfigValueError ¶
type ConfigValueError struct{ *ConfigWriteError }
Value the backend cannot store with nothing sent
func NewConfigValueError ¶
func NewConfigValueError(message, code string) *ConfigValueError
Builds a value refusal, the code defaulting to config_value_invalid
func (*ConfigValueError) Unwrap ¶
func (e *ConfigValueError) Unwrap() error
type ConfigWriteError ¶
Config write the backend refused or could not complete with nothing changed
func NewConfigWriteError ¶
func NewConfigWriteError(message, code string) *ConfigWriteError
Builds a write refusal, the code defaulting to config_write_failed
func (*ConfigWriteError) Error ¶
func (e *ConfigWriteError) Error() string
type ContainerExecInfo ¶
type ContainerExecInfo struct {
Backend string
ContainerName string
ExecUser string
IcebathBin string
}
Container mode metadata the NixOS activation wrote, nil when off, inside the container or in dev mode
func GetContainerExecInfo ¶
func GetContainerExecInfo(h string) (*ContainerExecInfo, error)
Reads the home container mode file, only a missing file reads as container mode off
type DiagnosticText ¶
type DiagnosticText string
Producer owned diagnostic classification carried on the two argument status callback, a plain string otherwise
type DoctorWarning ¶
Message, hint and issue line of one doctor warning a backend raises
type EnvValueError ¶
type EnvValueError struct{ Msg string }
Refusal of a .env write for an invalid, denylisted or locked key
func (*EnvValueError) Error ¶
func (e *EnvValueError) Error() string
func (*EnvValueError) ErrorKind ¶
func (e *EnvValueError) ErrorKind() string
Kind of the refusal, the ValueError family invalid values belong to
type EnvVar ¶
type EnvVar struct {
Description string
Prompt string
URL string
Help string
// Masked when typed and shown
Password bool
// provider, tool, skill, messaging or setting
Category string
// Model tools the variable unlocks
Tools []string
// Hidden from the setup checklist
Advanced bool
// Entry declares no password key, readers fall back to their own default
PasswordOmitted bool
}
Setting shown in the setup checklist and the keys page, with the file it routes to
type FacadeHooks ¶
type FacadeHooks struct {
ApplyUserMoAPresets func(merged map[string]any, raw any)
DotenvUnreadable func(path string) bool
ExtraEnvKeys func() []string
MaskedSecretPrompt func(prompt string) (string, error)
ScopedSecret func(ctx context.Context, key string) (string, bool, error)
SecretScopeBound func(ctx context.Context) bool
PublishScopedEnv func(ctx context.Context, key string, value *string) bool
SaveProviderEnvCredential func(ctx context.Context, h, key, value string) error
RemoveProviderEnvCredential func(ctx context.Context, h, key string) (bool, error)
CoreDeclaredEnvNames func() map[string]bool
}
Collaborators the config facade runs from packages that import config
type FailedConfigRead ¶
Fail open fallback a reader serves for an unreadable config that writers refuse to persist
type FileBackend ¶
type FileBackend struct {
// contains filtered or unexported fields
}
User layer as a local YAML file, a home config.yaml or one explicit path
func (FileBackend) ApplyInMemory ¶
The file backend persists migrations to the file and refuses an in memory apply
func (FileBackend) BootstrapEnvNames ¶
func (FileBackend) BootstrapEnvNames() []string
func (FileBackend) CacheVersion ¶
Version plus the racy content digest of the file taken from its own signature
func (FileBackend) ConfigPath ¶
func (b FileBackend) ConfigPath(home string) string
File a home user layer lives in, or the explicit file
func (FileBackend) DeploymentEnvNames ¶
func (FileBackend) DeploymentEnvNames() []string
func (FileBackend) Destination ¶
func (FileBackend) DoctorWarnings ¶
func (FileBackend) DoctorWarnings(context.Context, string) []DoctorWarning
func (FileBackend) HonorsManagedConfig ¶
func (FileBackend) HonorsManagedConfig() bool
func (FileBackend) Name ¶
func (b FileBackend) Name() string
func (FileBackend) PreserveReadBase ¶
func (FileBackend) PreserveReadBase(context.Context) func()
func (FileBackend) ProbeReadable ¶
func (b FileBackend) ProbeReadable(_ context.Context, home string) error
Reads one byte so an unreadable file reports its error without a parse
func (FileBackend) ProtectedEnvNames ¶
func (FileBackend) ProtectedEnvNames() []string
func (FileBackend) ReadPath ¶
func (FileBackend) ReadPath(path string) (any, error)
Parsed root of a file, nil when empty, the open error when it cannot be read
func (FileBackend) ReadPathReadonly ¶
func (FileBackend) ReadPathReadonly(path string) (any, error)
Shared cached parse of a file, never to be mutated
func (FileBackend) ReadUserDoc ¶
func (FileBackend) ReadUserDocReadonly ¶
func (FileBackend) SupportsFileTooling ¶
func (FileBackend) SupportsFileTooling() bool
func (FileBackend) VersionPath ¶
func (FileBackend) VersionPath(path string) ([]any, error)
Stat signature of a file as the file backend versions it
func (FileBackend) WriteChanges ¶
type HomeInitializationError ¶
Home skeleton that cannot be used, distinct from an invalid YAML document
func (*HomeInitializationError) Error ¶
func (e *HomeInitializationError) Error() string
func (*HomeInitializationError) Unwrap ¶
func (e *HomeInitializationError) Unwrap() error
type InvalidUserConfigError ¶
Error of a config.yaml that does not parse
func (*InvalidUserConfigError) Error ¶
func (e *InvalidUserConfigError) Error() string
func (*InvalidUserConfigError) Unwrap ¶
func (e *InvalidUserConfigError) Unwrap() error
type LanguageCatalog ¶
type LanguageCatalog interface {
DiscoverPlugins() error
ResetLanguageCache()
ResolveLanguageID(value string) (string, bool)
SupportedLanguages() []string
}
Language layers the display language check consults, implemented by the i18n and plugin owners
type Lookup ¶
Resolves an environment variable name to its value, false when unset
func EnvRefLookupContext ¶
Lookup a config reference expands through, the bound profile secret scope when one is installed and the process env otherwise
type MissingEnvVar ¶
One env variable the install lacks, its catalog entry and whether it is required
func GetMissingEnvVars ¶
Env variables with no value in the scoped process env or the home .env, required ones first
type NamedEnvVar ¶
One optional env entry under its variable name, the unit an ordered table or fill is made of
type NamedPlatformManifest ¶
Platform plugin manifest with the directory it was found in
type NonASCIICredentialError ¶
type NonASCIICredentialError struct {
Key string
}
Error of a credential whose bytes are not plain ASCII
func (*NonASCIICredentialError) Error ¶
func (e *NonASCIICredentialError) Error() string
type OptionalEnvState ¶
type OptionalEnvState struct {
// contains filtered or unexported fields
}
Saved table contents and armed fill a test puts back afterwards
type OptionalEnvTable ¶
type OptionalEnvTable struct {
// contains filtered or unexported fields
}
Insertion ordered optional env table that runs one armed fill before it is first read
func NewOptionalEnvTable ¶
func NewOptionalEnvTable(decl []NamedEnvVar) *OptionalEnvTable
Table holding the declared entries in declaration order with no fill armed
func (*OptionalEnvTable) Arm ¶
func (t *OptionalEnvTable) Arm(fill func() []NamedEnvVar, published func([]NamedEnvVar))
Arms the fill the next read runs and the callback its published entries are handed to, nil disarms
func (*OptionalEnvTable) Copy ¶
func (t *OptionalEnvTable) Copy() map[string]EnvVar
Plain map copy of the entries after the armed fill ran
func (*OptionalEnvTable) Delete ¶
func (t *OptionalEnvTable) Delete(name string)
Removes a name without running the fill
func (*OptionalEnvTable) Entry ¶
func (t *OptionalEnvTable) Entry(name string) EnvVar
Entry of a name after the armed fill ran, the zero entry when the table has none
func (*OptionalEnvTable) Get ¶
func (t *OptionalEnvTable) Get(name string) (EnvVar, bool)
Entry of a name after the armed fill ran, false when the table has none
func (*OptionalEnvTable) Has ¶
func (t *OptionalEnvTable) Has(name string) bool
Reports whether the table holds a name after the armed fill ran
func (*OptionalEnvTable) Items ¶
func (t *OptionalEnvTable) Items() []NamedEnvVar
Entries in insertion order after the armed fill ran
func (*OptionalEnvTable) Names ¶
func (t *OptionalEnvTable) Names() []string
Names in insertion order after the armed fill ran
func (*OptionalEnvTable) RawGet ¶
func (t *OptionalEnvTable) RawGet(name string) (EnvVar, bool)
Entry of a name as the table stands with no fill run, the read a fill itself makes
func (*OptionalEnvTable) RawNames ¶
func (t *OptionalEnvTable) RawNames() []string
Names in insertion order as the table stands with no fill run
func (*OptionalEnvTable) Set ¶
func (t *OptionalEnvTable) Set(name string, entry EnvVar)
Stores an entry without running the fill, a new name going last and a known one keeping its place
type PhantomKeyError ¶
type PhantomKeyError struct {
Part, Path, Shadowed, Escaped string
}
Refusal to create a nested key beside a literal dotted sibling it would shadow
func (*PhantomKeyError) Error ¶
func (e *PhantomKeyError) Error() string
type PlatformManifest ¶
Bundled platform plugin manifest as the diagnostics read it
func BundledPlatformManifests ¶
func BundledPlatformManifests(h string) ([]PlatformManifest, error)
Bundled platform plugins with their manifest name and required env, the shape config check reads
type RoundtripDoc ¶
One loaded round trip document with the source it came from
type RoundtripYAML ¶
type RoundtripYAML struct{}
Comment, quote and order keeping editor for user authored YAML, lines never folded
func NewRoundtripYAML ¶
func NewRoundtripYAML() *RoundtripYAML
Fresh round trip editor, every operation owns its own parser and emitter state
func (*RoundtripYAML) Dump ¶
func (r *RoundtripYAML) Dump(doc *RoundtripDoc, w io.Writer) error
Writes the document with two space mappings, indented block sequences and untouched source lines kept
func (*RoundtripYAML) Load ¶
func (r *RoundtripYAML) Load(stream any) (*RoundtripDoc, error)
Parses a document for editing through the round trip loader, nil node for an empty stream
type RuntimeError ¶
type RuntimeError struct{ Msg string }
Python RuntimeError a config writer raises, the class the config command turns into a clean refusal
func (*RuntimeError) Error ¶
func (e *RuntimeError) Error() string
type SafeDumpIndent ¶
type SafeDumpIndent struct {
Mapping, Sequence, Offset int
}
Block indentation of mappings and sequences and the dash offset inside a sequence indent
type SafeDumpOptions ¶
type SafeDumpOptions struct {
DefaultFlowStyle bool
SortKeys bool
AllowUnicode bool
Width int
Indent *SafeDumpIndent
Version string
}
Formatting choices of safe_dump, DefaultSafeDumpOptions holds the values a caller gets by passing none
func DefaultSafeDumpOptions ¶
func DefaultSafeDumpOptions() SafeDumpOptions
Options safe_dump writes with when the caller passes none
type SafeWorkerPolicy ¶
type SafeWorkerPolicy struct {
// contains filtered or unexported fields
}
Frozen bootstrap policy of an admission owned worker
func BindSafeWorkerPolicy ¶
func BindSafeWorkerPolicy(safeMode, ignoreUserConfig bool, cfg map[string]any) (*SafeWorkerPolicy, error)
Binds a troubleshooting worker bypass that always ignores user config, refusing ordinary execution
func BindWorkerConfig ¶
func BindWorkerConfig(cfg map[string]any) (*SafeWorkerPolicy, error)
Binds an ordinary managed worker frozen session config with plugins and providers loading as usual
func CurrentSafeWorkerPolicy ¶
func CurrentSafeWorkerPolicy() *SafeWorkerPolicy
Bound worker policy, nil when the ordinary loader owns config
type SaveOptions ¶
How a save treats defaults and the file already on disk
type Secrets ¶
type Secrets struct {
// contains filtered or unexported fields
}
Secrets of one home, the .env file layered over the process environment
type SecureSaveResult ¶
Outcome of a secure env save through the credential lifecycle
func SaveEnvValueSecure ¶
func SaveEnvValueSecure(ctx context.Context, h, key, value string) (SecureSaveResult, error)
Saves a credential through the provider credential lifecycle, refreshing config mirrors of the old value
type SettingsHooks ¶
type SettingsHooks struct {
// Whether the registry holds a key
Known func(key string) bool
// Writes the text typed for a registered key through the settings writer, the stored value back; known false for any other key
Set func(ctx context.Context, key, text string) (stored any, known bool, err error)
// Removes the value a registered key holds in config.yaml, whether one was there; known false for any other key
Reset func(ctx context.Context, key string) (wasSet, known bool, err error)
// Value in effect for a registered key, known false for any other key
Get func(ctx context.Context, key string) (value any, known bool)
// Settings groups config show prints for the home in ctx
Show func(ctx context.Context) []ShowGroup
// Every registered key, for the closest-match suggestion
Keys func() []string
}
Settings registry calls the CLI makes, installed by the settings package
type ShowRow ¶
type ShowRow struct {
Label, Value, Source string
}
One setting as config show prints it: its label, its value as text and where the value came from
type ShowSources ¶
type ShowSources struct {
ConfigPath string
EnvPath string
ProjectRoot string
EnvValue func(name string) string
AnthropicKey func() string
SkillSettings func() ([]SkillConfigVar, map[string]any, error)
MaskSecret func(value, empty string) string
}
Readers config show consults, supplied by the facade, auth, skills and redaction owners
type SkillConfigVar ¶
One skill declared config variable as config show lists it
func GetMissingSkillConfigVars ¶
func GetMissingSkillConfigVars(ctx context.Context, h string) ([]SkillConfigVar, error)
Skill declared settings under skills.config that are missing or blank in the loaded config
type SkinConfig ¶
type SkinConfig struct {
Name string
// Where the definition came from, builtin or user
Source string
Description any
Colors map[string]any
LightColors map[string]any
DarkColors map[string]any
Spinner map[string]any
Branding map[string]any
ToolPrefix any
ToolEmojis map[string]any
BannerLogo any
BannerHero any
CustomCSS string
}
Complete skin configuration, every mapping keeping its file or definition key order
func GetActiveSkin ¶
func GetActiveSkin(ctx context.Context) *SkinConfig
Active skin of the routed home or the process, initialized from the profile config on first use
func LoadSkin ¶
func LoadSkin(ctx context.Context, name string) *SkinConfig
Skin by name, a user file first, then the built in, then the default
func SetActiveSkin ¶
func SetActiveSkin(ctx context.Context, name string) *SkinConfig
Switches the active skin of the routed home or the process and returns it
func (*SkinConfig) GetBranding ¶
func (s *SkinConfig) GetBranding(key, fallback string) string
Branding string under key, fallback when the skin lacks it or sets it to null
func (*SkinConfig) GetColor ¶
func (s *SkinConfig) GetColor(key, fallback string) string
Color under key as text, fallback when the skin lacks it or sets it to null, both through the installed filter
func (*SkinConfig) GetSpinnerWings ¶
func (s *SkinConfig) GetSpinnerWings() [][2]string
Spinner wing pairs of two, a null side left empty and any other entry skipped
type SkinListing ¶
One listed skin with its name, description and source
func ListSkins ¶
func ListSkins(ctx context.Context) []SkinListing
Built in skins then user skins whose names no earlier entry took
type SystemExitError ¶
Error a config backend raises when it cannot serve the config, carrying its exit message
type TerminalEnvOptions ¶
Where the terminal bridge reads and writes env values, the process environment when Env is nil
type Tree ¶
Configuration document as nested maps the way YAML decodes it
func Defaults ¶
func Defaults() Tree
Schema defaults with every mapping iterating in the upstream declaration order
func LoadContext ¶
Effective config of a home, defaults merged under the user file, references expanded and the managed overlay on top
func LoadReadonly ¶
Effective config of a home without the defensive copy, the cached value must never be mutated
func (Tree) Set ¶
Sets the value at a dotted path, creating intermediate maps and refusing to shadow a dotted sibling
func (Tree) String ¶
Text at a path: a string as it is, a boolean or number in plain decimal, the fallback when absent, null or another kind
type WakeEvent ¶
type WakeEvent interface {
WakeInternal() bool
WakeMetadata() map[string]any
WakeReplyMuted() (muted bool, set bool)
WakeSourcePlatform() string
}
Message event surface the diagnostic wake policy reads, the gateway MessageEvent satisfying it
type WorkerPolicyError ¶
type WorkerPolicyError struct{ Kind, Msg string }
TypeError, ValueError or RuntimeError a worker policy bind raises
func (*WorkerPolicyError) Error ¶
func (e *WorkerPolicyError) Error() string
func (*WorkerPolicyError) ErrorKind ¶
func (e *WorkerPolicyError) ErrorKind() string
Kind of refusal, TypeError, ValueError or RuntimeError
type YAMLError ¶
type YAMLError struct{ Err error }
Failure of the shared YAML reader or writer, a ruamel YAMLError or the Python exception a load raised
Source Files
¶
- atomic_json.go
- backend.go
- bot_profile.go
- config_backups.go
- config_check_diagnostics.go
- config_home.go
- config_home_unix.go
- config_issues.go
- config_key_notices.go
- config_language.go
- config_paths.go
- config_read_errors.go
- config_show.go
- config_structure.go
- config_value_checks.go
- config_write.go
- config_write_restore.go
- container_exec.go
- container_exec_unix.go
- credential_file_perms.go
- defaults.go
- defaults_order.go
- effective.go
- env.go
- env_credential_check.go
- env_file_cache.go
- env_lines.go
- env_number.go
- env_ref_export.go
- env_save.go
- env_value_error.go
- env_var_enabled.go
- expand.go
- facade_cli.go
- facade_cli_export.go
- facade_env.go
- facade_env_export.go
- facade_env_vars.go
- facade_install.go
- facade_install_table.go
- facade_load.go
- facade_misc.go
- facade_platform.go
- facade_platform_compiled.go
- facade_save.go
- facade_secrets.go
- file_version.go
- file_version_linux.go
- icebath_time.go
- icebath_yaml.go
- key_order.go
- load.go
- log.go
- managed.go
- map_meta.go
- nix_module.go
- optional_env.go
- platform_manifest_names.go
- reasoning_config.go
- run_budget.go
- safe_dump.go
- safe_worker_policy.go
- skin_cmd.go
- skin_engine.go
- skin_reset_export.go
- soul.go
- tree.go
- turns.go
- utils_proxy.go
- value_text.go
- warning_notifications.go
- worker_save.go
- yaml11_resolve.go
- yaml_construct.go
- yaml_construct_rt.go