Documentation
¶
Index ¶
- Variables
- func ClawPath() string
- func CoerceJSONNumbers(v interface{})
- func ConfigDir() (string, error)
- func ConfigPath() (string, error)
- func EnrichedEnv() []string
- func ExpandHome(path string) string
- func LookPathEnriched(command string) string
- func ParseJSONFile(path string, target any) error
- func ParseTOMLFile(path string, target any) error
- func PatchConfigFile(path string, format string, fields map[string]any) error
- func Save(cfg Config) error
- func SetNestedValue(m map[string]any, path string, value any) bool
- func ValidateRawFormat(format, content string) error
- func WriteConfigAtomic(path string, format string, data interface{}) error
- func WriteJSONAtomic(path string, data interface{}) error
- func WriteRawAtomic(path string, content string) error
- func WriteTOMLAtomic(path string, data interface{}) error
- func WriteYAMLAtomic(path string, data interface{}) error
- type Config
- type DashboardConfig
- type DiscoveryConfig
- type HiddenStore
- type KeyVault
- func (v *KeyVault) Delete(provider string) error
- func (v *KeyVault) EnvSlice() []string
- func (v *KeyVault) Get(provider string) string
- func (v *KeyVault) List() map[string]string
- func (v *KeyVault) Set(provider, key string) error
- func (v *KeyVault) ValidateKey(ctx context.Context, provider, key string) error
- type ManualAgent
- type TokenStore
Constants ¶
This section is empty.
Variables ¶
var Version = "0.2.1"
Functions ¶
func ClawPath ¶
func ClawPath() string
ClawPath returns the root directory for framework installations. When CLAW_PATH is set, all framework config/binary paths (e.g., ~/.zeroclaw/config.toml) resolve under CLAW_PATH instead of ~. This enables isolated testing without disturbing real installations.
func CoerceJSONNumbers ¶
func CoerceJSONNumbers(v interface{})
CoerceJSONNumbers recursively walks a value decoded from JSON and converts float64 values that are whole numbers (e.g., 42617.0) to int64 (42617). This prevents the TOML encoder from writing "port = 42617.0" when the original config had "port = 42617".
func ConfigPath ¶
func EnrichedEnv ¶
func EnrichedEnv() []string
EnrichedEnv returns a copy of the current environment with common tool directories prepended to PATH. This ensures exec.Command can find binaries like cargo, go, npm, pip, etc. even when the Eyrie server is started from a non-interactive shell (e.g., launchd, systemd) that doesn't source ~/.bashrc or ~/.zshrc.
func ExpandHome ¶
ExpandHome replaces a leading ~ with the user's home directory, or with CLAW_PATH if set. This means all framework paths like ~/.zeroclaw/config.toml automatically resolve to $CLAW_PATH/.zeroclaw/config.toml when the env var is present.
func LookPathEnriched ¶
LookPathEnriched resolves a command name against the enriched PATH (the same dirs added by EnrichedEnv). Use this before exec.Command so binaries in ~/go/bin, ~/.cargo/bin, etc. are found even when the Eyrie process's own PATH doesn't include them.
func ParseJSONFile ¶
ParseJSONFile reads and unmarshals a JSON file into the given target.
func ParseTOMLFile ¶
ParseTOMLFile reads and unmarshals a TOML file into the given target.
func PatchConfigFile ¶
PatchConfigFile reads a config file, patches the given dot-path fields, and writes back atomically. Creates the file (with parent dirs) if it doesn't exist. format is "toml", "json", or "yaml".
func SetNestedValue ¶
SetNestedValue sets a value at a dot-separated path in a nested map, creating intermediate maps as needed. Returns false if a non-map node blocked the path (e.g., "a.b" where "a" is a string, not a map).
func ValidateRawFormat ¶
ValidateRawFormat checks that a raw config string is syntactically valid for the given format (toml, json, yaml). Returns nil on success.
func WriteConfigAtomic ¶
WriteConfigAtomic writes config file atomically based on format
func WriteJSONAtomic ¶
WriteJSONAtomic writes JSON config atomically using temp file + rename
func WriteRawAtomic ¶
WriteRawAtomic writes a raw string to a file atomically. Used when the config is already in its target format (e.g., raw TOML text from the editor) and should be preserved as-is without re-encoding.
func WriteTOMLAtomic ¶
WriteTOMLAtomic writes TOML config atomically using temp file + rename
func WriteYAMLAtomic ¶
WriteYAMLAtomic writes YAML config atomically using temp file + rename
Types ¶
type Config ¶
type Config struct {
Dashboard DashboardConfig `toml:"dashboard"`
Discovery DiscoveryConfig `toml:"discovery"`
Agents []ManualAgent `toml:"agents"`
}
func DefaultConfig ¶
func DefaultConfig() Config
type DashboardConfig ¶
type DiscoveryConfig ¶
type HiddenStore ¶
type HiddenStore struct {
// contains filtered or unexported fields
}
HiddenStore persists hidden session keys per agent. Stored in ~/.eyrie/hidden_sessions.json with mode 0600.
func NewHiddenStore ¶
func NewHiddenStore() (*HiddenStore, error)
func (*HiddenStore) Hide ¶
func (hs *HiddenStore) Hide(agentName, sessionKey string) error
func (*HiddenStore) IsHidden ¶
func (hs *HiddenStore) IsHidden(agentName, sessionKey string) bool
func (*HiddenStore) Unhide ¶
func (hs *HiddenStore) Unhide(agentName, sessionKey string) error
type KeyVault ¶
type KeyVault struct {
// contains filtered or unexported fields
}
KeyVault centralizes API key management across all agent frameworks. Keys are stored in ~/.eyrie/keys.json with mode 0600. Environment variables take precedence over the on-disk store (e.g. ANTHROPIC_API_KEY overrides the "anthropic" key). Follows the TokenStore pattern exactly.
func GetKeyVault ¶
func GetKeyVault() *KeyVault
GetKeyVault returns the process-wide KeyVault singleton, creating it on first call. Safe to call from any goroutine.
func NewKeyVault ¶
func (*KeyVault) Delete ¶
Delete removes an API key for the given provider and saves. On save() failure the key is restored so memory doesn't diverge from disk.
func (*KeyVault) EnvSlice ¶
EnvSlice builds environment variable assignments for all stored keys using the provider-to-envvar mapping. Unknown providers are skipped because we don't know which env var the framework expects.
func (*KeyVault) Get ¶
Get returns the API key for the given provider. Environment variable takes precedence: the vault checks the provider's mapped env var (from providerEnvMap, consistent with EnvSlice) before falling back to <PROVIDER>_API_KEY (uppercased), then the on-disk store.
type ManualAgent ¶
type TokenStore ¶
type TokenStore struct {
// contains filtered or unexported fields
}
TokenStore persists bearer tokens keyed by agent name. Tokens are stored in ~/.eyrie/tokens.json with mode 0600.
func NewTokenStore ¶
func NewTokenStore() (*TokenStore, error)
func (*TokenStore) Get ¶
func (ts *TokenStore) Get(agentName string) string
func (*TokenStore) Set ¶
func (ts *TokenStore) Set(agentName, token string) error