Documentation
¶
Index ¶
Constants ¶
const ( // CacheTTL defines how long cached registry data is valid CacheTTL = 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func CompareVersions ¶
CompareVersions compares two dotted version strings (e.g. "1.2.3"). Returns -1 if a < b, 0 if a == b, 1 if a > b. Returns 0 if either string is empty or unparseable (unknown = no opinion).
func ComputeVersionStatus ¶
ComputeVersionStatus extracts a semver from raw --version output and compares it against a framework's min/latest constraints. Convenience wrapper used by API handlers to avoid duplicating the extract+compare.
func ExtractVersion ¶
ExtractVersion pulls the first semver-ish version (X.Y.Z) from arbitrary --version output. Returns "" if no version pattern is found.
"zeroclaw 0.7.2" → "0.7.2" "v1.2.3-beta" → "1.2.3" "OpenClaw CLI version 2.1.0" → "2.1.0"
func VersionStatus ¶
VersionStatus determines the version state given the installed version and the registry's min/latest constraints. Returns:
"" — no version data available "outdated" — below min_version (may have compatibility issues) "update_available" — meets min_version but below latest_version "current" — at or above latest_version
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client fetches and caches the Claw frameworks registry
func (*Client) GetFramework ¶
GetFramework retrieves a specific framework by ID
type ConfigField ¶
type ConfigField struct {
Key string `json:"key"` // Config key (dot notation for nested: "gateway.port")
Label string `json:"label"` // Display label
Type string `json:"type"` // "text", "number", "select", "checkbox", "multiselect"
Default any `json:"default,omitempty"` // Default value
Required bool `json:"required"` // Whether field is required
Description string `json:"description"` // Help text
Options []string `json:"options,omitempty"` // For select/multiselect types
Suggestions json.RawMessage `json:"suggestions,omitempty"` // string[] or map[string]string[] for provider-keyed models
SuggestionsKey string `json:"suggestions_key,omitempty"` // field key to select from suggestions map
Min *int `json:"min,omitempty"` // For number types
Max *int `json:"max,omitempty"` // For number types
Advanced bool `json:"advanced,omitempty"` // Hide behind "advanced" toggle in quick setup
Group string `json:"group,omitempty"` // Layout group: same-group fields render side-by-side
}
ConfigField represents a single editable configuration field
type ConfigSchema ¶
type ConfigSchema struct {
CommonFields []ConfigField `json:"common_fields"` // Editable fields for the config form
APIKeyHint string `json:"api_key_hint"` // Instructions for setting API keys
}
ConfigSchema defines editable configuration fields for a framework
type Framework ¶
type Framework struct {
// Identity
ID string `json:"id"` // "hermes", "zeroclaw", "openclaw"
Name string `json:"name"` // Display name
Description string `json:"description"` // Short description
Language string `json:"language"` // "python", "rust", "typescript"
Repository string `json:"repository"` // GitHub URL
Website string `json:"website,omitempty"` // Official website URL (optional)
// Installation
InstallMethod string `json:"install_method"` // "script", "cargo", "npm", "pip", "manual"
InstallCmd string `json:"install_cmd"` // Command or script URL
Requirements []string `json:"requirements"` // ["python>=3.11", "node>=22"]
// Version constraints (optional — empty means "no constraint" / "unknown")
MinVersion string `json:"min_version,omitempty"` // Minimum compatible version (e.g. "0.7.0")
LatestVersion string `json:"latest_version,omitempty"` // Latest known release version
// Configuration
ConfigFormat string `json:"config_format"` // "toml", "json", "yaml"
ConfigPath string `json:"config_path"` // "~/.hermes/config.yaml"
ConfigDir string `json:"config_dir"` // "~/.hermes"
ConfigSchema *ConfigSchema `json:"config_schema,omitempty"` // Optional config form schema
// Runtime
BinaryPath string `json:"binary_path"` // "~/.local/bin/hermes"
AdapterType string `json:"adapter_type"` // "http", "websocket", "cli", "hybrid"
DefaultPort int `json:"default_port,omitempty"` // 0 if not applicable
// Lifecycle commands
StartCmd string `json:"start_cmd"` // "hermes gateway start"
StopCmd string `json:"stop_cmd"` // "" (means PID-based)
StatusCmd string `json:"status_cmd"` // "hermes status" or ""
RestartCmd string `json:"restart_cmd"` // Optional explicit restart command
// Status detection (for adapters without HTTP APIs)
PIDFile string `json:"pid_file,omitempty"` // "~/.hermes/gateway.pid"
StateFile string `json:"state_file,omitempty"` // "~/.hermes/gateway_state.json"
HealthURL string `json:"health_url,omitempty"` // "http://localhost:42617/health"
// Logs and activity
LogDir string `json:"log_dir"` // "~/.hermes/logs"
LogFormat string `json:"log_format"` // "text", "json"
}
Framework describes a single Claw agent framework
func (Framework) DefaultInstallCmd ¶
DefaultInstallCmd returns the default package-manager command for this framework (e.g. "cargo install zeroclaw"). Returns "" for non-package-manager install methods (script, manual).
func (Framework) IsCustomInstallCmd ¶
IsCustomInstallCmd reports whether the registry specifies a non-default install command for this framework (e.g. --git, @version, custom flags).