Documentation
¶
Overview ¶
Package catalog provides catalog management for AI development agents.
Index ¶
- type AgentCategory
- type AgentDef
- type Catalog
- func (c *Catalog) GetAgent(id string) (AgentDef, bool)
- func (c *Catalog) GetAgents() []AgentDef
- func (c *Catalog) GetAgentsByCategory(category string) []AgentDef
- func (c *Catalog) GetAgentsByPlatform(platformID string) []AgentDef
- func (c *Catalog) GetAgentsByTag(tag string) []AgentDef
- func (c *Catalog) GetCategories() []string
- func (c *Catalog) GetTags() []string
- func (c *Catalog) GroupByCategory() map[string][]AgentDef
- func (c *Catalog) Search(query string) []AgentDef
- func (c *Catalog) Validate() error
- type ChangelogDef
- type DetectionDef
- type InstallMethodDef
- type Manager
- func (m *Manager) Get(ctx context.Context) (*Catalog, error)
- func (m *Manager) GetAgent(ctx context.Context, id string) (*AgentDef, error)
- func (m *Manager) GetAgentsForPlatform(ctx context.Context, platformID string) ([]AgentDef, error)
- func (m *Manager) GetChangelog(ctx context.Context, agentID string, from, to agent.Version) (string, error)
- func (m *Manager) GetLatestVersion(ctx context.Context, agentID, method string) (*agent.Version, error)
- func (m *Manager) Refresh(ctx context.Context) (*RefreshResult, error)
- func (m *Manager) Search(ctx context.Context, query string) ([]AgentDef, error)
- type RefreshResult
- type SignatureDef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentCategory ¶
type AgentCategory string
AgentCategory represents a category for grouping agents.
const ( CategoryCoding AgentCategory = "coding" CategoryDevOps AgentCategory = "devops" CategoryTerminal AgentCategory = "terminal" CategoryResearch AgentCategory = "research" CategoryProductivity AgentCategory = "productivity" CategoryOther AgentCategory = "other" )
type AgentDef ¶
type AgentDef struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Category string `json:"category,omitempty"`
Tags []string `json:"tags,omitempty"`
Homepage string `json:"homepage,omitempty"`
Repository string `json:"repository,omitempty"`
Documentation string `json:"documentation,omitempty"`
Icon string `json:"icon,omitempty"`
InstallMethods map[string]InstallMethodDef `json:"install_methods"`
Detection DetectionDef `json:"detection"`
Changelog ChangelogDef `json:"changelog,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
AgentDef defines an agent in the catalog.
func (AgentDef) GetExecutable ¶
GetExecutable returns the primary executable name for this agent.
func (AgentDef) GetInstallMethod ¶
func (a AgentDef) GetInstallMethod(method string) (InstallMethodDef, bool)
GetInstallMethod returns the install method definition for the given method.
func (AgentDef) GetSupportedMethods ¶
func (a AgentDef) GetSupportedMethods(platformID string) []InstallMethodDef
GetSupportedMethods returns all installation methods supported on the given platform. Methods are sorted by preference, with package managers (npm, pip, brew) preferred over native installers for easier management and updates.
func (AgentDef) IsSupported ¶
IsSupported returns true if the agent is supported on the given platform.
type Catalog ¶
type Catalog struct {
Version string `json:"version"`
SchemaVersion int `json:"schema_version"`
LastUpdated time.Time `json:"last_updated"`
Agents map[string]AgentDef `json:"agents"`
}
Catalog represents the complete agent catalog.
func (*Catalog) GetAgentsByCategory ¶
GetAgentsByCategory returns agents that match the given category.
func (*Catalog) GetAgentsByPlatform ¶
GetAgentsByPlatform returns all agents supported on the given platform.
func (*Catalog) GetAgentsByTag ¶
GetAgentsByTag returns agents that have the given tag.
func (*Catalog) GetCategories ¶
GetCategories returns all unique categories in the catalog.
func (*Catalog) GroupByCategory ¶
GroupByCategory returns agents grouped by their category.
type ChangelogDef ¶
type ChangelogDef struct {
Type string `json:"type"` // "github_releases", "file", "api"
URL string `json:"url"`
FileFormat string `json:"file_format,omitempty"` // "markdown", "json", "plain"
}
ChangelogDef defines where to fetch changelogs.
type DetectionDef ¶
type DetectionDef struct {
Executables []string `json:"executables"`
VersionCmd string `json:"version_cmd"`
VersionRegex string `json:"version_regex,omitempty"`
Signatures map[string]SignatureDef `json:"signatures,omitempty"`
}
DetectionDef defines how to detect an agent.
type InstallMethodDef ¶
type InstallMethodDef struct {
Method string `json:"method"`
Package string `json:"package,omitempty"`
Command string `json:"command"`
UpdateCmd string `json:"update_cmd,omitempty"`
UninstallCmd string `json:"uninstall_cmd,omitempty"`
Platforms []string `json:"platforms"`
GlobalFlag string `json:"global_flag,omitempty"`
PreReqs []string `json:"prereqs,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
InstallMethodDef defines how to install via a specific method.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the agent catalog.
func NewManager ¶
NewManager creates a new catalog manager.
func (*Manager) GetAgentsForPlatform ¶
GetAgentsForPlatform returns all agents supported on the given platform.
func (*Manager) GetChangelog ¶
func (m *Manager) GetChangelog(ctx context.Context, agentID string, from, to agent.Version) (string, error)
GetChangelog fetches the changelog between two versions.
func (*Manager) GetLatestVersion ¶
func (m *Manager) GetLatestVersion(ctx context.Context, agentID, method string) (*agent.Version, error)
GetLatestVersion returns the latest version for an agent and installation method.
type RefreshResult ¶
type RefreshResult struct {
Updated bool // Whether the catalog was updated
CurrentVersion string // The current catalog version after refresh
RemoteVersion string // The remote catalog version that was fetched
}
RefreshResult contains the result of a catalog refresh operation.
type SignatureDef ¶
type SignatureDef struct {
CheckCmd string `json:"check_cmd,omitempty"`
PathPattern string `json:"path_pattern,omitempty"`
Paths []string `json:"paths,omitempty"`
}
SignatureDef defines detection signatures for a specific install method.