Documentation
¶
Index ¶
- Constants
- Variables
- func ActiveProfilePath() string
- func BuildAliasMap() (map[string]string, error)
- func CanonValid(name string) (string, error)
- func Casefold(s string) string
- func CheckAliasCollision(name string) (string, error)
- func CreateWrapperScript(name, target string) (string, error)
- func CurrentProfileName(ctx context.Context) string
- func DefaultHome() string
- func ExistingProfileDir(name string) (string, string, error)
- func FindAliasForProfile(profileName string) (string, error)
- func FindOurWrapper(alias string) (string, error)
- func FormatProfileLabel(name, displayName string) string
- func GetActiveProfile(root string) string
- func GetActiveProfileName(ctx context.Context) string
- func GetProfileDir(name string) (string, error)
- func InvalidProfileNameError(name string) error
- func IsWrapperDirInPath() (bool, error)
- func IterNamedProfileDirs(liveOnly bool) ([]string, error)
- func ListProfileNames() []string
- func MissingProfileError(canon string) error
- func NormalizeProfileName(name string) (string, error)
- func NormalizeProfileNameValue(name any) (string, error)
- func ParkedMarkerPath(home string) string
- func ProfileExists(name string) bool
- func ProfileExistsError(canon string) error
- func ProfileIsParked(home string) bool
- func ProfileIsStandalone(ctx context.Context, home string) (bool, error)
- func ProfileMatchesHome(ctx context.Context, name, homeDir string) bool
- func ProfilePathContainsPrivateStore(parts []string) bool
- func ProfilePathIsPrivate(parts []string) bool
- func ProfileRootForEnvHome(envHome, defaultRoot string) string
- func ProfilesRoot() string
- func ReadConfigModel(ctx context.Context, profileDir string) (model, provider any, err error)
- func ReadDistributionMeta(profileDir string) (name, version, source any)
- func RemoveWrapperScript(name string) (bool, error)
- func ResetFileCache()
- func ResetStandaloneMemo()
- func ResolveProfileEnv(profileName string) (string, error)
- func RetargetActiveProfile(old, new, message string)
- func SecretCacheStores() []string
- func SetActiveProfile(name string) error
- func SetProfileDisplayName(ctx context.Context, profileName, displayName string) (string, error)
- func SharedProfileWarning(ctx context.Context, homeDir, projectRoot string) string
- func SuggestProfileName(name string) string
- func UnknownProfileError(canon string) error
- func ValidateAliasName(name string) error
- func ValidateProfileName(name string) error
- func WrapperDir() (string, error)
- func WrapperPath(alias string) (string, error)
- func WriteManifest(ctx context.Context, profileDir string, manifest *DistributionManifest) (string, error)
- func WriteProfileMeta(ctx context.Context, profileDir string, upd MetaUpdate) error
- type DistributionError
- type DistributionManifest
- type EnvRequirement
- type ExistsError
- type GatewayOwnershipConflict
- type MetaUpdate
- type NotFoundError
- type ProfileMeta
- type ProfileServiceManager
- type ServedProfile
- type ValueError
Constants ¶
const ( ManifestFilename = "distribution.yaml" EnvTemplateFilename = ".env.template" EnvExampleFilename = ".env.EXAMPLE" )
const NoBundledSkillsMarker = ".no-bundled-skills"
Marker file at a profile root opting out of bundled skill seeding
const PlaceholderEnv = "# Per-profile secrets for this icebath profile.\n" +
"# API keys and tokens set here override the shell environment.\n" +
"# Behavioral settings belong in config.yaml, not here.\n"
Header seeded into the empty env file of a new profile
const RetiredRequiresKey = "hermes_requires"
Text of a manifest key, default when the value is falsy Version floor key distribution manifests written before the rename carry, read when icebath_requires is unset
Variables ¶
var CLISubcommands = map[string]bool{ "chat": true, "model": true, "gateway": true, "whatsapp": true, "login": true, "logout": true, "status": true, "cron": true, "doctor": true, "dump": true, "config": true, "pairing": true, "skills": true, "tools": true, "mcp": true, "sessions": true, "insights": true, "version": true, "update": true, "uninstall": true, "profile": true, "plugins": true, "acp": true, }
Top level icebath subcommands an alias must not shadow
var CloneAllDefaultExcludeRoot = map[string]bool{ "icebath-agent": true, ".worktrees": true, "profiles": true, "bin": true, "node_modules": true, ".icebath-runtime": true, "node": true, "models": true, "runtimes": true, }
Root entries of the default home never copied by a full clone
var CloneAllHistoryExcludeRoot = map[string]bool{ "state.db": true, "state.db-wal": true, "state.db-shm": true, "sessions": true, "backups": true, "state-snapshots": true, "checkpoints": true, "cron": true, "webapp": true, }
Per profile history and stored Webapp sign in state never copied by a full clone from any source
var CloneAllStrip = []string{
"gateway.pid", "gateway_state.json", "processes.json",
"bot-desktop/launcher.pid", "bot-desktop/env", "bot-desktop/rfb.sock",
"bot-desktop/lease.json", "bot-desktop/lease.lock",
"bot-desktop/browser-profile/DevToolsActivePort",
"bot-desktop/browser-profile/SingletonLock",
"bot-desktop/browser-profile/SingletonCookie",
"bot-desktop/browser-profile/SingletonSocket",
}
Runtime files stripped after a full clone so the copy never attaches to the source processes
var CloneConfigFiles = []string{"config.yaml", ".env", "SOUL.md"}
Files copied by a config clone when the source has them
var CloneSubdirFiles = []string{"memories/MEMORY.md", "memories/USER.md"}
Memory files copied by a config clone
var CronDistributionHooks struct { LoadJobs func(ctx context.Context, home string) ([]any, error) ImportJobDefinitions func(ctx context.Context, home string, shipped *jsonutil.Object, pausedReason string) error }
Cron store access pkg/cron installs in init for the distribution installer, nil in a binary that does not link it
var DefaultExportExcludeRoot = func() map[string]bool { out := map[string]bool{} for _, n := range []string{ "icebath-agent", ".worktrees", "profiles", "bin", "node_modules", ".icebath-runtime", "node", "state.db", "state.db-shm", "state.db-wal", "icebath_state.db", "response_store.db", "response_store.db-shm", "response_store.db-wal", "gateway.pid", "gateway_state.json", "processes.json", "auth.json", ".env", "auth.lock", ".config.yaml.lock", ".env.lock", "active_profile", ".update_check", "source-checks", "errors.log", ".icebath_history", "image_cache", "audio_cache", "document_cache", "browser_screenshots", "checkpoints", "sandboxes", "logs", } { out[n] = true } for n := range PMRuntimeRootDirs { out[n] = true } return out }()
Root entries of the default home a full export never carries
var DefaultExportIncludeRoot = map[string]bool{ "config.yaml": true, "SOUL.md": true, "MEMORY.md": true, "USER.md": true, "todo.json": true, "system_prompt.md": true, "AGENTS.md": true, "CLAUDE.md": true, ".cursorrules": true, "skills": true, "cron": true, "scripts": true, "sessions": true, "plugins": true, "memories": true, "knowledge": true, "preferences": true, }
Root entries of the default home a default profile export keeps, everything else at the root is dropped
var GatewayChannelHooks struct { PlatformMembers func() []string PlatformEntries func(ctx context.Context) ([]map[string]any, error) EnvEnableCredentials func() [][2]any }
Gateway platform facts pkg/gateway installs in init, entries and steps as attribute name mappings
var GatewayServiceHooks struct { ServiceName func(ctx context.Context) string UserSystemdUnitDir func(ctx context.Context) string SystemUnitDir func() string LaunchdPlistPath func(ctx context.Context) string PinnedHome func(definition string) (string, bool) WindowsTaskName func(ctx context.Context) string WindowsTaskRegistered func(ctx context.Context) bool ExecSchtasks func(args []string) (int, string, string) WindowsStartupEntryPath func(ctx context.Context) string WindowsLegacyStartupEntryPath func(ctx context.Context) string ServiceManagerDetect func() (string, error) ServiceManagerGet func() (ProfileServiceManager, error) }
Gateway service naming and Windows task facts pkg/gatewaycli installs in init, nil in a binary that does not link it
var GatewayStatusHooks struct { ProfileRunning func(profileDir string) bool ServesNamedProfile func(name string) bool NotifyProfilesChanged func(name string) RecordedServedProfiles func() ([]string, bool, error) ExclusiveMaintenance func(dirs []string) (func(), error) PidExists func(pid int) bool ProcessStartTime func(pid int) (int64, bool) TerminatePid func(pid int, force bool, expectedStart *int64) error RecordedHomeConflicts func(record map[string]any, expectedHome string) bool Identify func(root string) (any, error) MigrateProfileIdentity func(root, oldName, newName string) (any, error) PurgeProfileIdentity func(root, name string) (any, error) }
Gateway runtime facts pkg/gateway installs in init, nil in a binary that does not link it
var OSCredentialStores = osCredentialStores
Home relative OS credential stores dropped from every profile export
Package manager runtime trees at a home root, foreign state an export or import never carries
var ProfileCredentialPaths = func() map[string]bool { paths := []string{ "auth.json", ".env", "auth/google_oauth.json", ".op.env", "npmrc", ".anthropic_oauth.json", "google_token.json", "google_oauth_pending.json", "google_client_secret.json", "google_chat_user_tokens", "google_chat_user_client_secret.json", "google_chat_user_oauth_pending.json", "google_chat_user_token.json", "google_chat_user_oauth_pending", "slack_tokens.json", "webhook_subscriptions.json", "teams_pipeline_store.json", "mcp-tokens", "vault", "browser-profile", "browser_auth", "bot-desktop", "webapp", "browser-profiles", "browser_profiles", "pairing", "platforms/pairing", "feishu_comment_pairing.json", "whatsapp/session", "platforms/whatsapp/session", "matrix/store", "platforms/matrix/store", "workspace/meetings/node_token.json", "weixin/accounts", ".copilot_jwt.json", "proxy", "chrome-debug", "home", "backups", "state-snapshots", } paths = append(paths, secretCacheStores...) paths = append(paths, osCredentialStores...) set := map[string]bool{} for _, p := range paths { set[p] = true } return set }()
Profile relative stores holding credentials, never cloned, exported or shared
var ProfileDirs = []string{"memories", "sessions", "skills", "skins", "logs", "plans", "workspace", "cron", "home"}
Directories bootstrapped inside every new profile
var ReservedNames = map[string]bool{"icebath": true, "default": true, "test": true, "tmp": true, "root": true, "sudo": true}
Names that collide with the installation itself or a common system binary
Functions ¶
func ActiveProfilePath ¶
func ActiveProfilePath() string
File recording the sticky active profile of the root home
func BuildAliasMap ¶
Map from canonical profile to alias read in one pass over the wrapper directory, custom aliases winning
func CanonValid ¶
Canonical id of name after normalizing and validating it
func CheckAliasCollision ¶
Collision message for an alias name, empty when the name is safe to use
func CreateWrapperScript ¶
Writes the wrapper alias launching profile target, or the alias itself, returning empty after a printed write failure
func CurrentProfileName ¶
Profile the current task runs for, the home override first, then a launcher pinned name, then the process home
func DefaultHome ¶
func DefaultHome() string
Root home owning the profile tree, the configured home itself in custom deployments
func ExistingProfileDir ¶
Canonical id and directory of an existing profile, a not found error otherwise
func FindAliasForProfile ¶
Alias of the wrapper launching a profile, empty when none does
func FindOurWrapper ¶
Generated wrapper of alias, also a bare pre bat wrapper on Windows, empty when none is ours
func FormatProfileLabel ¶
Display name followed by the canonical id in parentheses, the bare id when they match or no name is set
func GetActiveProfile ¶
Sticky active profile name of root, the process root when empty, default when unset or unreadable
func GetActiveProfileName ¶
Profile name of the current home, default for the root, the id under profiles, custom for any other path
func GetProfileDir ¶
Home directory of a profile name, the root home for default
func InvalidProfileNameError ¶
Error for a name that fails the profile id grammar, with a suggested valid name
func IsWrapperDirInPath ¶
Reports whether the wrapper directory is on PATH
func IterNamedProfileDirs ¶
Sorted directories of named profiles carrying identity, skipping tombstoned ones when liveOnly
func ListProfileNames ¶
func ListProfileNames() []string
Default plus every live named profile without reading any profile config
func MissingProfileError ¶
Error for a profile a command needs but that was never created
func NormalizeProfileName ¶
Canonical profile id, lowercase with default matched case insensitively
func NormalizeProfileNameValue ¶
Canonical profile id of an untyped value, refusing anything but a string so numeric ids never become directories
func ParkedMarkerPath ¶
Marker file whose presence parks a profile out of the host gateway
func ProfileExists ¶
Reports whether a live profile exists under name, default always existing
func ProfileExistsError ¶
Error for creating a profile whose name is taken
func ProfileIsParked ¶
Whether the parked marker exists, its contents never matter
func ProfileIsStandalone ¶
Whether the home config opts out of the host multiplexer, never true for the default profile
func ProfileMatchesHome ¶
Reports whether name refers to the profile served from homeDir, the current home when empty
func ProfilePathContainsPrivateStore ¶
Reports whether parts name a strict ancestor of a credential store
func ProfilePathIsPrivate ¶
Reports whether parts name a credential store, anything below one, or a root copy of one
func ProfileRootForEnvHome ¶
Root named by an exported home, the grandparent of a profile shaped value, defaultRoot when unset
func ProfilesRoot ¶
func ProfilesRoot() string
Directory holding every named profile under the root home
func ReadConfigModel ¶
Model and provider from the profile config.yaml read raw, nil for an absent file or a failed read
func ReadDistributionMeta ¶
Name, version and source from distribution.yaml, all nil when the file is absent or not a mapping
func RemoveWrapperScript ¶
Removes the generated wrapper of a profile alias, reporting whether one was removed
func ResetStandaloneMemo ¶
func ResetStandaloneMemo()
Clears the standalone memo and the one shot warnings
func ResolveProfileEnv ¶
Home path of a profile keeping the configured spelling of the root, an error for a missing named profile
func RetargetActiveProfile ¶
func RetargetActiveProfile(old, new, message string)
Points the sticky active profile from old to new and prints message, swallowing every failure
func SecretCacheStores ¶
func SecretCacheStores() []string
Home relative secret cache stores of home_data_layout, a fresh copy per call
func SetActiveProfile ¶
Sets the sticky active profile, default removing the file
func SetProfileDisplayName ¶
Stores or clears a presentation only display name, refusing names over 64 characters
func SharedProfileWarning ¶
Warning when another live install verifiably uses the same home, empty otherwise
func SuggestProfileName ¶
Valid profile id derived from a typed name, my-work when nothing usable remains
func UnknownProfileError ¶
Error for a delete, rename or export naming no profile, likely a typo
func ValidateAliasName ¶
Error unless name is safe as a wrapper file name under the wrapper directory
func ValidateProfileName ¶
Error unless name is a lowercase profile id outside the reserved names, default passing
func WrapperPath ¶
Wrapper script path of an alias in the wrapper dir
func WriteManifest ¶
func WriteManifest(ctx context.Context, profileDir string, manifest *DistributionManifest) (string, error)
Atomically writes distribution.yaml, keeping an existing file's mode and creating a new one 0644
func WriteProfileMeta ¶
func WriteProfileMeta(ctx context.Context, profileDir string, upd MetaUpdate) error
Updates profile.yaml in place overwriting only the given fields, the profile directory must exist
Types ¶
type DistributionError ¶
type DistributionError struct{ Msg string }
Install, update and manifest failure of a profile distribution
func (*DistributionError) Error ¶
func (e *DistributionError) Error() string
type DistributionManifest ¶
type DistributionManifest struct {
Name string
Version string
Description string
IcebathRequires string
Author string
License string
EnvRequires []EnvRequirement
DistributionOwned []string
Source string
InstalledAt string
}
Parsed distribution.yaml plus the source and install stamp recorded after install
func DistributionManifestFromDict ¶
func DistributionManifestFromDict(data any) (*DistributionManifest, error)
Manifest of a parsed YAML root, rejecting a non mapping, a missing name and malformed lists
func NewDistributionManifest ¶
func NewDistributionManifest(name string) *DistributionManifest
Manifest with the dataclass defaults, version 0.1.0
func ReadManifest ¶
func ReadManifest(profileDir string) (*DistributionManifest, error)
Manifest of profileDir, nil without a distribution.yaml and an error when it does not parse
func (*DistributionManifest) ToDict ¶
func (d *DistributionManifest) ToDict() map[string]any
Mapping in on disk key order, optional keys written only when set
type EnvRequirement ¶
One env_requires row, Default nil when the manifest gives none
func EnvRequirementFromDict ¶
func EnvRequirementFromDict(data any) (EnvRequirement, error)
Requirement parsed from one env_requires entry, which must be a mapping with a name
func NewEnvRequirement ¶
func NewEnvRequirement(name, description string) EnvRequirement
Requirement with the dataclass defaults, required and without a default
func (EnvRequirement) ToDict ¶
func (r EnvRequirement) ToDict() map[string]any
Mapping of the requirement with required and default written only when they differ from the defaults
type ExistsError ¶
type ExistsError struct{ Msg string }
Profile that already exists, matching fs.ErrExist like Python FileExistsError
func (*ExistsError) Error ¶
func (e *ExistsError) Error() string
func (*ExistsError) Is ¶
func (e *ExistsError) Is(target error) bool
type GatewayOwnershipConflict ¶
type GatewayOwnershipConflict struct{ Msg string }
A profile home whose gateway.lock another holder owns, the gateway OwnershipConflict seen from profiles
func (*GatewayOwnershipConflict) Error ¶
func (e *GatewayOwnershipConflict) Error() string
type MetaUpdate ¶
type MetaUpdate struct {
Description *string
DescriptionAuto *bool
DisplayName *string
PreviousNames *[]string
}
Fields of profile.yaml to overwrite, nil fields keep their stored value
type NotFoundError ¶
type NotFoundError struct{ Msg string }
Missing profile, matching fs.ErrNotExist like Python FileNotFoundError
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
func (*NotFoundError) Is ¶
func (e *NotFoundError) Is(target error) bool
type ProfileMeta ¶
type ProfileMeta struct {
Description string
DescriptionAuto bool
DisplayName string
BotTitle string
PreviousNames []string
}
Presentation metadata of a profile read from profile.yaml
func ReadProfileMeta ¶
func ReadProfileMeta(profileDir string) ProfileMeta
Profile metadata with empty defaults for a missing or corrupt file, cached by file signature
type ProfileServiceManager ¶
type ProfileServiceManager interface {
SupportsRuntimeRegistration() bool
RegisterProfileGateway(name string, startNow bool) error
UnregisterProfileGateway(name string) error
}
Service manager able to register profile gateways at runtime inside a container
type ServedProfile ¶
Profile name and home a gateway serves
func ProfilesToServe ¶
func ProfilesToServe(ctx context.Context, multiplex, includeStandalone, includeParked bool) ([]ServedProfile, error)
Profiles a gateway serves, the active one alone without multiplex, else default plus live named profiles
type ValueError ¶
type ValueError struct{ Msg string }
Invalid input, the Python ValueError of the profile helpers
func (*ValueError) Error ¶
func (e *ValueError) Error() string
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package gatewaycreate has the gateway that serves this terminal create a profile, one request answered by one receipt
|
Package gatewaycreate has the gateway that serves this terminal create a profile, one request answered by one receipt |