skillhub

package
v0.31.27 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRegistryURL  = "https://raw.githubusercontent.com/devlikebear/tars-skills/main/registry.json"
	DefaultSkillBaseURL = "https://raw.githubusercontent.com/devlikebear/tars-skills/main"
)

Variables

This section is empty.

Functions

func LoadInstalledMCPServers added in v0.9.0

func LoadInstalledMCPServers(workspaceDir string) ([]config.MCPServer, []string)

Types

type InstallResult added in v0.7.1

type InstallResult struct {
	RequiresPlugin string // non-empty if the skill depends on a plugin
}

InstallResult contains the result of a skill installation.

type InstalledDB

type InstalledDB struct {
	Skills  []InstalledSkill  `json:"skills"`
	Plugins []InstalledPlugin `json:"plugins,omitempty"`
	MCPs    []InstalledMCP    `json:"mcps,omitempty"`
}

InstalledDB tracks installed hub skills and plugins.

type InstalledMCP added in v0.9.0

type InstalledMCP struct {
	Name     string `json:"name"`
	Version  string `json:"version"`
	Source   string `json:"source"`
	Dir      string `json:"dir"`
	Manifest string `json:"manifest"`
}

InstalledMCP tracks a managed MCP package that has been installed locally.

type InstalledPlugin added in v0.7.1

type InstalledPlugin struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Source  string `json:"source"`
	Dir     string `json:"dir"`
}

InstalledPlugin tracks a plugin that has been installed locally.

type InstalledSkill

type InstalledSkill struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Source  string `json:"source"` // "tars-hub" or "openclaw"
	Dir     string `json:"dir"`
}

InstalledSkill tracks a skill that has been installed locally.

type Installer

type Installer struct {
	WorkspaceDir string
	Registry     *Registry
}

Installer handles installing and managing hub skills.

func NewInstaller

func NewInstaller(workspaceDir string) *Installer

NewInstaller creates an installer for the given workspace.

func (*Installer) Install

func (inst *Installer) Install(ctx context.Context, name string) (*InstallResult, error)

Install downloads and installs a skill from the registry.

func (*Installer) InstallMCP added in v0.9.0

func (inst *Installer) InstallMCP(ctx context.Context, name string) error

InstallMCP downloads and installs an MCP package from the registry.

func (*Installer) InstallPlugin added in v0.7.1

func (inst *Installer) InstallPlugin(ctx context.Context, name string) error

InstallPlugin downloads and installs a plugin from the registry.

func (*Installer) List

func (inst *Installer) List() ([]InstalledSkill, error)

List returns all installed hub skills.

func (*Installer) ListMCPs added in v0.9.0

func (inst *Installer) ListMCPs() ([]InstalledMCP, error)

ListMCPs returns all installed hub MCP packages.

func (*Installer) ListPlugins added in v0.7.1

func (inst *Installer) ListPlugins() ([]InstalledPlugin, error)

ListPlugins returns all installed hub plugins.

func (*Installer) Uninstall

func (inst *Installer) Uninstall(name string) error

Uninstall removes an installed skill.

func (*Installer) UninstallMCP added in v0.9.0

func (inst *Installer) UninstallMCP(name string) error

UninstallMCP removes an installed MCP package.

func (*Installer) UninstallPlugin added in v0.7.1

func (inst *Installer) UninstallPlugin(name string) error

UninstallPlugin removes an installed plugin.

func (*Installer) Update

func (inst *Installer) Update(ctx context.Context) ([]string, error)

Update re-installs all installed skills with the latest version.

func (*Installer) UpdateMCPs added in v0.9.0

func (inst *Installer) UpdateMCPs(ctx context.Context) ([]string, error)

UpdateMCPs re-installs all installed MCP packages with the latest version.

func (*Installer) UpdatePlugins added in v0.7.1

func (inst *Installer) UpdatePlugins(ctx context.Context) ([]string, error)

UpdatePlugins re-installs all installed plugins with the latest version.

type MCPEntry added in v0.9.0

type MCPEntry struct {
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Version     string         `json:"version"`
	Author      string         `json:"author"`
	Tags        []string       `json:"tags"`
	Path        string         `json:"path"`
	Manifest    string         `json:"manifest,omitempty"`
	Files       []RegistryFile `json:"files"`
}

MCPEntry describes a managed MCP package in the registry.

type MCPManifest added in v0.9.0

type MCPManifest struct {
	SchemaVersion int              `json:"schema_version,omitempty"`
	Server        config.MCPServer `json:"server"`
}

type PluginEntry added in v0.7.1

type PluginEntry struct {
	Name        string        `json:"name"`
	Description string        `json:"description"`
	Version     string        `json:"version"`
	Author      string        `json:"author"`
	Tags        []string      `json:"tags"`
	Path        string        `json:"path"`
	Files       RegistryFiles `json:"files"`
}

PluginEntry describes a plugin in the registry.

type Registry

type Registry struct {
	RegistryURL  string
	SkillBaseURL string
	HTTPClient   *http.Client
}

Registry fetches and searches the remote skill registry.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a registry with default URLs.

func (*Registry) FetchFile

func (r *Registry) FetchFile(ctx context.Context, entry *RegistryEntry, relPath string) ([]byte, error)

FetchFile downloads a companion file relative to the skill's path.

func (*Registry) FetchIndex

func (r *Registry) FetchIndex(ctx context.Context) (*RegistryIndex, error)

FetchIndex downloads and parses registry.json.

func (*Registry) FetchMCPFile added in v0.9.0

func (r *Registry) FetchMCPFile(ctx context.Context, entry *MCPEntry, relPath string) ([]byte, error)

FetchMCPFile downloads a file relative to the MCP package path.

func (*Registry) FetchPluginFile added in v0.7.1

func (r *Registry) FetchPluginFile(ctx context.Context, entry *PluginEntry, relPath string) ([]byte, error)

FetchPluginFile downloads a file relative to the plugin's path.

func (*Registry) FetchSkillContent

func (r *Registry) FetchSkillContent(ctx context.Context, entry *RegistryEntry) ([]byte, error)

FetchSkillContent downloads the SKILL.md for the given entry.

func (*Registry) FindByName

func (r *Registry) FindByName(ctx context.Context, name string) (*RegistryEntry, error)

FindByName returns the exact-match entry.

func (*Registry) FindMCPByName added in v0.9.0

func (r *Registry) FindMCPByName(ctx context.Context, name string) (*MCPEntry, error)

FindMCPByName returns the exact-match MCP entry.

func (*Registry) FindPluginByName added in v0.7.1

func (r *Registry) FindPluginByName(ctx context.Context, name string) (*PluginEntry, error)

FindPluginByName returns the exact-match plugin entry.

func (*Registry) Search

func (r *Registry) Search(ctx context.Context, query string) ([]RegistryEntry, error)

Search returns entries matching the query (substring match on name, description, tags).

func (*Registry) SearchMCPServers added in v0.9.0

func (r *Registry) SearchMCPServers(ctx context.Context, query string) ([]MCPEntry, error)

SearchMCPServers returns MCP entries matching the query.

func (*Registry) SearchPlugins added in v0.7.1

func (r *Registry) SearchPlugins(ctx context.Context, query string) ([]PluginEntry, error)

SearchPlugins returns plugin entries matching the query.

type RegistryEntry

type RegistryEntry struct {
	Name           string        `json:"name"`
	Description    string        `json:"description"`
	Version        string        `json:"version"`
	Author         string        `json:"author"`
	Tags           []string      `json:"tags"`
	Path           string        `json:"path"`
	UserInvocable  bool          `json:"user_invocable"`
	RequiresPlugin string        `json:"requires_plugin,omitempty"`
	Files          RegistryFiles `json:"files,omitempty"`
}

RegistryEntry describes a single skill in the registry.

type RegistryFile added in v0.9.0

type RegistryFile struct {
	Path   string `json:"path"`
	SHA256 string `json:"sha256"`
}

RegistryFile describes a downloadable file and its checksum.

type RegistryFiles added in v0.15.0

type RegistryFiles []RegistryFile

RegistryFiles accepts both legacy path arrays and checksum-bearing file objects.

func (RegistryFiles) Paths added in v0.15.0

func (files RegistryFiles) Paths() []string

func (*RegistryFiles) UnmarshalJSON added in v0.15.0

func (files *RegistryFiles) UnmarshalJSON(data []byte) error

type RegistryIndex

type RegistryIndex struct {
	Version    int             `json:"version"`
	Skills     []RegistryEntry `json:"skills"`
	Plugins    []PluginEntry   `json:"plugins,omitempty"`
	MCPServers []MCPEntry      `json:"mcp_servers,omitempty"`
}

RegistryIndex is the top-level structure of registry.json.

Jump to

Keyboard shortcuts

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