Documentation
¶
Index ¶
- func CompareVersions(v1, v2 string) (int, error)
- func GetInstalledVersion(command string) string
- type AgentDefinition
- func (a *AgentDefinition) GetInstallCommand() (string, error)
- func (a *AgentDefinition) GetLatestVersion() (string, error)
- func (a *AgentDefinition) GetUninstallCommand() (string, error)
- func (a *AgentDefinition) GetUpgradeCommand() (string, error)
- func (a *AgentDefinition) GetVersionInfo(installedVersion string) (*VersionInfo, error)
- func (a *AgentDefinition) IsInstallable() bool
- type AgentRegistry
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareVersions ¶
CompareVersions compares two semantic version strings Returns:
-1 if v1 < v2 0 if v1 == v2 1 if v1 > v2 error if versions cannot be parsed
func GetInstalledVersion ¶
GetInstalledVersion gets the currently installed version of an agent
Types ¶
type AgentDefinition ¶
type AgentDefinition struct {
Name string `json:"name"`
Command string `json:"command"`
Description string `json:"description"`
Docs string `json:"docs"`
PackageManager string `json:"package_manager,omitempty"` // npm, homebrew, or empty for manual install
PackageName string `json:"package_name,omitempty"` // Package name for the package manager
Install map[string]string `json:"install"`
Uninstall map[string]string `json:"uninstall"`
Upgrade map[string]string `json:"upgrade"`
RequiresAuth bool `json:"requires_auth"`
}
AgentDefinition represents an AI agent CLI with installation metadata
func GetAll ¶
func GetAll() []*AgentDefinition
GetAll returns all agent definitions from the default registry
func GetByCommand ¶
func GetByCommand(command string) (*AgentDefinition, error)
GetByCommand returns an agent definition by command from the default registry
func GetByName ¶
func GetByName(name string) (*AgentDefinition, error)
GetByName returns an agent definition by name from the default registry
func (*AgentDefinition) GetInstallCommand ¶
func (a *AgentDefinition) GetInstallCommand() (string, error)
GetInstallCommand returns the install command for the current OS
func (*AgentDefinition) GetLatestVersion ¶
func (a *AgentDefinition) GetLatestVersion() (string, error)
GetLatestVersion fetches the latest version for an agent from its package manager
func (*AgentDefinition) GetUninstallCommand ¶
func (a *AgentDefinition) GetUninstallCommand() (string, error)
GetUninstallCommand returns the uninstall command for the current OS
func (*AgentDefinition) GetUpgradeCommand ¶
func (a *AgentDefinition) GetUpgradeCommand() (string, error)
GetUpgradeCommand returns the upgrade command for the current OS
func (*AgentDefinition) GetVersionInfo ¶
func (a *AgentDefinition) GetVersionInfo(installedVersion string) (*VersionInfo, error)
GetVersionInfo returns complete version information for an agent
func (*AgentDefinition) IsInstallable ¶
func (a *AgentDefinition) IsInstallable() bool
IsInstallable returns true if the agent can be installed via a command (not just instructions)
type AgentRegistry ¶
type AgentRegistry struct {
// contains filtered or unexported fields
}
AgentRegistry holds all agent definitions
func LoadRegistry ¶
func LoadRegistry() (*AgentRegistry, error)
LoadRegistry loads agent definitions from the embedded JSON file
func (*AgentRegistry) GetAll ¶
func (r *AgentRegistry) GetAll() []*AgentDefinition
GetAll returns all agent definitions
func (*AgentRegistry) GetByCommand ¶
func (r *AgentRegistry) GetByCommand(command string) (*AgentDefinition, error)
GetByCommand returns an agent definition by command name
func (*AgentRegistry) GetByName ¶
func (r *AgentRegistry) GetByName(name string) (*AgentDefinition, error)
GetByName returns an agent definition by name (case-insensitive)
type VersionInfo ¶
type VersionInfo struct {
Installed string // Version currently installed (empty if not installed)
Latest string // Latest version available
HasUpdate bool // True if installed version is older than latest
}
VersionInfo contains version information for an agent