skillhub

package
v0.32.17 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 18 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)

func LoadWorkspaceMCPServers added in v0.31.180

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

Types

type InstallResult added in v0.7.1

type InstallResult struct {
	RequiresPlugin string        `json:"requires_plugin,omitempty"` // non-empty if the skill depends on a plugin
	Sandbox        SandboxReport `json:"sandbox_report"`
}

InstallResult contains the sandboxed result of a hub package 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, plugins, and MCP packages.

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) (*InstallResult, error)

InstallMCP downloads and installs an MCP package from the registry.

func (*Installer) InstallPack added in v0.31.113

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

InstallPack installs every package in a pack using the standard sandboxed installers.

func (*Installer) InstallPlugin added in v0.7.1

func (inst *Installer) InstallPlugin(ctx context.Context, name string) (*InstallResult, 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) PlanPackInstall added in v0.31.113

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

PlanPackInstall resolves a pack into the ordered packages that would be installed.

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) (UpdateResult, 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) (UpdateResult, 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) (UpdateResult, 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"`
	Quality     *QualityMetadata `json:"quality,omitempty"`
}

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 PackEntry added in v0.31.113

type PackEntry struct {
	Name        string           `json:"name"`
	Description string           `json:"description"`
	Version     string           `json:"version"`
	Author      string           `json:"author"`
	Tags        []string         `json:"tags,omitempty"`
	Skills      []string         `json:"skills,omitempty"`
	Plugins     []string         `json:"plugins,omitempty"`
	MCPServers  []string         `json:"mcp_servers,omitempty"`
	Quality     *QualityMetadata `json:"quality,omitempty"`
}

PackEntry describes a domain pack that installs multiple hub packages.

type PackInstallItem added in v0.31.113

type PackInstallItem struct {
	Type        string `json:"type"`
	Name        string `json:"name"`
	Version     string `json:"version"`
	Description string `json:"description,omitempty"`
	Action      string `json:"action"`
}

PackInstallItem captures one package in a pack install plan.

type PackInstallPlan added in v0.31.113

type PackInstallPlan struct {
	Pack  PackEntry         `json:"pack"`
	Items []PackInstallItem `json:"items"`
}

PackInstallPlan previews which hub packages a pack will install or update.

type PackInstallResult added in v0.31.113

type PackInstallResult struct {
	Plan           PackInstallPlan   `json:"plan"`
	Installed      []PackInstallItem `json:"installed,omitempty"`
	Skipped        []PackInstallItem `json:"skipped,omitempty"`
	SandboxReports []SandboxReport   `json:"sandbox_reports,omitempty"`
}

PackInstallResult reports the outcome of installing a pack.

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"`
	Quality     *QualityMetadata `json:"quality,omitempty"`
}

PluginEntry describes a plugin in the registry.

type QualityMetadata added in v0.31.112

type QualityMetadata struct {
	Score         int      `json:"score"`
	LastUpdated   string   `json:"last_updated,omitempty"`
	TestsPassing  *bool    `json:"tests_passing,omitempty"`
	RequiredTools []string `json:"required_tools,omitempty"`
	Permissions   []string `json:"permissions,omitempty"`
	CompanionCLI  *bool    `json:"companion_cli,omitempty"`
	InstallCount  int      `json:"install_count,omitempty"`
}

QualityMetadata carries install-time trust signals published by the hub 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) FindPackByName added in v0.31.113

func (r *Registry) FindPackByName(ctx context.Context, name string) (*PackEntry, error)

FindPackByName returns the exact-match pack 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) SearchPacks added in v0.31.113

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

SearchPacks returns pack 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"`
	Quality        *QualityMetadata `json:"quality,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"`
	Packs      []PackEntry     `json:"packs,omitempty"`
}

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

type SandboxCheck added in v0.31.102

type SandboxCheck struct {
	Name       string             `json:"name"`
	Command    string             `json:"command,omitempty"`
	Status     SandboxCheckStatus `json:"status"`
	Output     string             `json:"output,omitempty"`
	Error      string             `json:"error,omitempty"`
	DurationMS int64              `json:"duration_ms,omitempty"`
}

SandboxCheck captures one validation step from a skill install sandbox.

type SandboxCheckStatus added in v0.31.102

type SandboxCheckStatus string
const (
	SandboxCheckPassed SandboxCheckStatus = "passed"
	SandboxCheckFailed SandboxCheckStatus = "failed"
)

type SandboxError added in v0.31.102

type SandboxError struct {
	Report SandboxReport
}

SandboxError is returned when a package passes download verification but fails sandbox checks.

func (*SandboxError) Error added in v0.31.102

func (e *SandboxError) Error() string

type SandboxReport added in v0.31.102

type SandboxReport struct {
	PackageType  string         `json:"package_type,omitempty"`
	PackageName  string         `json:"package_name,omitempty"`
	SkillName    string         `json:"skill_name"`
	WorkspaceDir string         `json:"workspace_dir,omitempty"`
	SkillDir     string         `json:"skill_dir,omitempty"`
	PluginDir    string         `json:"plugin_dir,omitempty"`
	MCPDir       string         `json:"mcp_dir,omitempty"`
	Passed       bool           `json:"passed"`
	Checks       []SandboxCheck `json:"checks"`
}

SandboxReport describes the isolated workspace validation performed before install.

type UpdateDiagnostic added in v0.31.71

type UpdateDiagnostic struct {
	Name   string
	Reason string
	Err    error
}

UpdateDiagnostic captures a per-entry update outcome that is not a success.

func (UpdateDiagnostic) Detail added in v0.31.71

func (d UpdateDiagnostic) Detail() string

Detail returns the human-readable reason for a skipped or failed update.

type UpdateResult added in v0.31.71

type UpdateResult struct {
	Updated []string
	Skipped []UpdateDiagnostic
	Failed  []UpdateDiagnostic
}

UpdateResult reports updated, skipped, and failed entries from a hub update.

Jump to

Keyboard shortcuts

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