catalog

package
v1.0.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package catalog provides catalog management for AI development agents.

Index

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

func (a AgentDef) GetExecutable() string

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

func (a AgentDef) IsSupported(platformID string) bool

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) GetAgent

func (c *Catalog) GetAgent(id string) (AgentDef, bool)

GetAgent returns a specific agent by ID.

func (*Catalog) GetAgents

func (c *Catalog) GetAgents() []AgentDef

GetAgents returns all agents in the catalog.

func (*Catalog) GetAgentsByCategory

func (c *Catalog) GetAgentsByCategory(category string) []AgentDef

GetAgentsByCategory returns agents that match the given category.

func (*Catalog) GetAgentsByPlatform

func (c *Catalog) GetAgentsByPlatform(platformID string) []AgentDef

GetAgentsByPlatform returns all agents supported on the given platform.

func (*Catalog) GetAgentsByTag

func (c *Catalog) GetAgentsByTag(tag string) []AgentDef

GetAgentsByTag returns agents that have the given tag.

func (*Catalog) GetCategories

func (c *Catalog) GetCategories() []string

GetCategories returns all unique categories in the catalog.

func (*Catalog) GetTags

func (c *Catalog) GetTags() []string

GetTags returns all unique tags in the catalog.

func (*Catalog) GroupByCategory

func (c *Catalog) GroupByCategory() map[string][]AgentDef

GroupByCategory returns agents grouped by their category.

func (*Catalog) Search

func (c *Catalog) Search(query string) []AgentDef

Search searches agents by name or description.

func (*Catalog) Validate

func (c *Catalog) Validate() error

Validate validates the catalog structure.

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

func NewManager(cfg *config.Config, store storage.Store) *Manager

NewManager creates a new catalog manager.

func (*Manager) Get

func (m *Manager) Get(ctx context.Context) (*Catalog, error)

Get returns the current catalog, loading from cache or embedded if needed.

func (*Manager) GetAgent

func (m *Manager) GetAgent(ctx context.Context, id string) (*AgentDef, error)

GetAgent returns a specific agent definition.

func (*Manager) GetAgentsForPlatform

func (m *Manager) GetAgentsForPlatform(ctx context.Context, platformID string) ([]AgentDef, error)

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.

func (*Manager) Refresh

func (m *Manager) Refresh(ctx context.Context) (*RefreshResult, error)

Refresh fetches the latest catalog from the remote source. It only updates if the remote version is newer than the current version. Returns a RefreshResult indicating whether an update occurred.

func (*Manager) Search

func (m *Manager) Search(ctx context.Context, query string) ([]AgentDef, error)

Search searches the catalog for agents matching the query.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL