Documentation
¶
Overview ¶
Package hub is where new capabilities come from: a browsable catalogue of skills and MCP servers, and the machinery to install one.
A curated set ships inside the binary so the hub is useful with no network and no account. Beyond that it reads plain GitHub repositories and any URL serving a SKILL.md, which means publishing to it needs nothing more than a public repo.
Index ¶
- func InstallMCP(id string, cfg *config.Config, overrides map[string]string) ([]string, error)
- func SafeFileName(name string) string
- func Seed(dir string) (int, error)
- type Entry
- func BundledSkills() []Entry
- func InstallSkill(ctx context.Context, id, dir string) (Entry, string, error)
- func LookupMCP(id string) (Entry, bool)
- func MCPCatalogue() []Entry
- func SearchMCP(_ context.Context, query string, cfg *config.Config) []Entry
- func SearchSkills(ctx context.Context, query string) ([]Entry, error)
- type PluginEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallMCP ¶
InstallMCP adds a catalogue server to the configuration. Keys the server needs are taken from env when they are set there, so a machine that already exports GITHUB_PERSONAL_ACCESS_TOKEN needs no further setup.
It returns the names of any keys still missing, which the caller shows to the user rather than leaving a server that fails silently on first use.
func SafeFileName ¶
SafeFileName turns a skill name into a filename that cannot escape its directory or surprise a filesystem.
func Seed ¶
Seed writes the bundled skills into dir the first time Antares runs, so a fresh install has something to work with rather than an empty library.
It only ever runs once — the marker file is what stops a skill the user deleted on purpose from reappearing on the next start. Skills that already exist are left alone, since a user's edit outranks the shipped copy.
Types ¶
type Entry ¶
type Entry struct {
// ID is what an install command takes, e.g. "builtin/code-review" or
// "github/owner/repo/path".
ID string `json:"id"`
Kind string `json:"kind"` // skill|mcp
Name string `json:"name"`
Summary string `json:"summary"`
Source string `json:"source"` // builtin|github|url|registry
Tags []string `json:"tags,omitempty"`
Homepage string `json:"homepage,omitempty"`
Author string `json:"author,omitempty"`
// Installed is filled in by the caller that knows the local state.
Installed bool `json:"installed"`
// Skill-only.
Body string `json:"-"`
// MCP-only: how to run the server.
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
URL string `json:"url,omitempty"`
Env map[string]string `json:"env,omitempty"`
NeedsKeys []string `json:"needs_keys,omitempty"`
Setup string `json:"setup,omitempty"`
}
Entry is one catalogue item, whether a skill or an MCP server.
func BundledSkills ¶
func BundledSkills() []Entry
BundledSkills returns the skills that ship with the binary.
func InstallSkill ¶
InstallSkill writes a skill into dir and returns its path. The id is either "builtin/<name>", a GitHub reference, or a URL.
type PluginEntry ¶
type PluginEntry struct {
ID string `json:"id"`
Name string `json:"name"`
Summary string `json:"summary"`
Author string `json:"author,omitempty"`
Homepage string `json:"homepage,omitempty"`
Tags []string `json:"tags,omitempty"`
Command string `json:"command"`
Args []string `json:"args,omitempty"`
Hooks []string `json:"hooks"`
TimeoutMS int `json:"timeout_ms,omitempty"`
Description string `json:"description,omitempty"`
// ScriptName + Script is the bundled executable dropped alongside the
// manifest. Empty for a plugin that only shells out to a tool on PATH.
ScriptName string `json:"script_name,omitempty"`
Script string `json:"script,omitempty"`
// Installed is filled in by the caller from local state.
Installed bool `json:"installed"`
}
PluginEntry is one catalogue plugin. Unlike skills (prose) or MCP servers (a command reference), a plugin is an executable that runs on this machine, so the whole thing ships inside the binary: the manifest and the script are bundled here rather than fetched. Nothing is downloaded at install time — the operator sees exactly what will run before saying yes.
func InstallPlugin ¶
func InstallPlugin(id, dir string) (PluginEntry, string, error)
InstallPlugin writes a catalogue plugin's manifest (and bundled script, if any) into dir/<name>/. It returns the directory it wrote to. The caller is expected to have shown the command to the operator first — a plugin runs code, so installing one is a decision, not a convenience.
func LookupPlugin ¶
func LookupPlugin(id string) (PluginEntry, bool)
LookupPlugin returns one catalogue plugin.
func PluginCatalogue ¶
func PluginCatalogue() []PluginEntry
PluginCatalogue returns the plugins that ship with the binary.
func SearchPlugins ¶
SearchPlugins finds catalogue plugins matching a query, marking the ones already present on disk.