hub

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallMCP

func InstallMCP(id string, cfg *config.Config, overrides map[string]string) ([]string, error)

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

func SafeFileName(name string) string

SafeFileName turns a skill name into a filename that cannot escape its directory or surprise a filesystem.

func Seed

func Seed(dir string) (int, error)

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

func InstallSkill(ctx context.Context, id, dir string) (Entry, string, error)

InstallSkill writes a skill into dir and returns its path. The id is either "builtin/<name>", a GitHub reference, or a URL.

func LookupMCP

func LookupMCP(id string) (Entry, bool)

LookupMCP returns one catalogue entry.

func MCPCatalogue

func MCPCatalogue() []Entry

MCPCatalogue returns the known MCP servers.

func SearchMCP

func SearchMCP(_ context.Context, query string, cfg *config.Config) []Entry

SearchMCP finds MCP servers in the catalogue, marking the ones already configured so the UI does not offer to install them twice.

func SearchSkills

func SearchSkills(ctx context.Context, query string) ([]Entry, error)

SearchSkills finds skills matching a query. The bundled set always answers; remote sources are consulted only when the query names one, so browsing the hub never depends on the network.

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

func SearchPlugins(_ context.Context, query string, installed map[string]bool) []PluginEntry

SearchPlugins finds catalogue plugins matching a query, marking the ones already present on disk.

Jump to

Keyboard shortcuts

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