skillhub

package
v0.32.59 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LicenseMIT         = "MIT"
	LicenseApache2     = "Apache-2.0"
	LicenseProprietary = "Proprietary"
	LicenseUnknown     = "Unknown"
)

LicenseLabels recognised by BuildAttribution.

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

AttributionFilename is the filename written alongside imported skills.

View Source
const DefaultSourceID = "tars-hub"

DefaultSourceID is the source identifier assigned to legacy InstalledSkill rows with an empty Source field and to entries from the built-in hub.

Variables

View Source
var ErrInstallAborted = fmt.Errorf("skillhub: install aborted by user")

ErrInstallAborted is returned when ConfirmFn declines an install.

Functions

func BuildAttribution added in v0.32.44

func BuildAttribution(in AttributionInput) ([]byte, error)

BuildAttribution renders the ATTRIBUTION.md body. It returns an error for licenses we refuse to materialize (Proprietary, Unknown, empty body).

func DetectLicenseLabel added in v0.32.44

func DetectLicenseLabel(body []byte) string

DetectLicenseLabel returns one of LicenseMIT / LicenseApache2 / LicenseProprietary / LicenseUnknown based on simple textual markers in a license body. Used by adapters that don't get SPDX metadata from their upstream.

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)

func ResolveSkillRef added in v0.32.43

func ResolveSkillRef(ref string) (sourceID, name string)

ResolveSkillRef parses a user-facing reference like "openclaw:foo" and returns the source ID plus the bare skill name. An empty sourceID means "search every registered source" — the install path is expected to handle that ambiguity.

Whitespace around either component is trimmed. A trailing colon with no name (e.g. "openclaw:") yields the source plus an empty name. A leading colon (":foo") is treated as no source plus "foo".

func SkillFileChecksums added in v0.32.44

func SkillFileChecksums(files map[string][]byte) map[string]string

SkillFileChecksums computes sha256 hashes for every file in the map. Used by the dry-run preview (Phase 3) and exposed here so the openclaw adapter does not need to duplicate the helper.

Types

type AttributionInput added in v0.32.44

type AttributionInput struct {
	SourceID       string    // e.g. "openclaw"
	OriginalName   string    // skill name as published by the source
	OriginalURL    string    // permalink (with commit SHA if available)
	CommitSHA      string    // optional
	OriginalAuthor string    // resolved author (frontmatter or hub default)
	LicenseLabel   string    // "MIT", "Apache-2.0", ...
	LicenseBody    []byte    // raw license text from the source repo
	NoticeBody     []byte    // optional NOTICE file body (Apache-2.0 §4)
	ImportedAt     time.Time // when the import was performed
}

AttributionInput collects everything BuildAttribution needs.

type CompanionFileLister added in v0.32.44

type CompanionFileLister interface {
	// ListCompanionFiles returns the relative paths (relative to the
	// skill's directory in the source repo) of every non-SKILL.md file
	// that should be materialized alongside the skill.
	ListCompanionFiles(ctx context.Context, entry *RegistryEntry) ([]string, error)
}

CompanionFileLister is implemented by hubs whose registry entries do not pre-declare every companion file. The adapter discovers them at install time (directory listing) and returns relative paths the installer should download via FetchSkillFile. Built-in tars-hub relies on RegistryEntry.Files instead and does not implement this.

type ConfirmFn added in v0.32.44

type ConfirmFn func(*DryRunResult) (bool, error)

ConfirmFn lets the caller approve or reject an external-hub install after downloading + converting (but before materialize). Returning false without an error aborts the install cleanly. The preview is the same struct PreviewInstall and OnPreview surface, so the CLI can render once and decide once with the same data.

type DryRunResult added in v0.32.45

type DryRunResult struct {
	SourceID         string        `json:"source_id"`
	Ref              string        `json:"ref"`
	OriginalName     string        `json:"original_name"`
	OriginalPath     string        `json:"original_path,omitempty"`
	OriginalURL      string        `json:"original_url,omitempty"`
	CommitSHA        string        `json:"commit_sha,omitempty"`
	TargetDir        string        `json:"target_dir"`
	ConvertedSkill   SkillPreview  `json:"converted_skill"`
	Files            []FilePreview `json:"files"`
	AdapterWarnings  []string      `json:"adapter_warnings,omitempty"`
	LicenseLabel     string        `json:"license_label,omitempty"`
	LicenseSource    string        `json:"license_source,omitempty"`
	ChecksumWarnings []string      `json:"checksum_warnings,omitempty"`
}

DryRunResult is the structured preview that PreviewInstall returns and Phase 5's HTTP API renders to the console. It is JSON-marshalable.

The shape is deliberately a superset of InstallPreview (Phase 2): the short preview was a minimal "yes/no prompt payload"; DryRunResult adds per-file SHA256, the converted SKILL.md frontmatter snapshot, and license metadata so the user can verify exactly what would land on disk.

type FilePreview added in v0.32.45

type FilePreview struct {
	Path   string `json:"path"`
	Size   int64  `json:"size"`
	SHA256 string `json:"sha256"`
	// ExpectedSHA256 is set only for tars-hub manifests whose registry
	// entries carry pre-published checksums. The PreviewInstall caller
	// compares it against SHA256 and records mismatches in
	// ChecksumWarnings.
	ExpectedSHA256 string `json:"expected_sha256,omitempty"`
}

FilePreview describes one file that would be materialized.

type HubSource added in v0.32.43

type HubSource interface {
	// ID returns the stable identifier used in `--from` flags and the
	// InstalledSkill.Source field (e.g. "tars-hub", "openclaw").
	ID() string

	// SearchSkills returns skill entries matching the query. Empty query
	// returns every available skill from this source.
	SearchSkills(ctx context.Context, query string) ([]RegistryEntry, error)

	// FindSkillByName returns an exact-match entry, or an error if the
	// source does not advertise a skill with the given name.
	FindSkillByName(ctx context.Context, name string) (*RegistryEntry, error)

	// FetchSkillContent returns the raw SKILL.md bytes for the entry.
	FetchSkillContent(ctx context.Context, entry *RegistryEntry) ([]byte, error)

	// FetchSkillFile returns a companion file relative to the entry's path.
	FetchSkillFile(ctx context.Context, entry *RegistryEntry, relPath string) ([]byte, error)
}

HubSource is one place TARS can fetch skill packages from. The built-in tars-hub implementation is TarsHubSource. External hubs (openclaw, hermes, anthropic) live in internal/skillhub/sources/.

type InstallOptions added in v0.32.44

type InstallOptions struct {
	// Yes auto-approves the install (Confirm is ignored). Used by `--yes`.
	Yes bool
	// Confirm receives the dry-run preview when an external-hub skill is
	// about to be materialized. Called only for non-tars-hub sources. If
	// nil and Yes is false, InstallWithOptions errors out instead of
	// materializing.
	Confirm ConfirmFn
	// DryRun runs everything Install would do up to but not including
	// sandbox + materialize. The returned InstallResult has DryRunPreview
	// set and a zero Sandbox report; the workspace is left untouched.
	DryRun bool
	// OnPreview receives the DryRunResult once it is built, regardless of
	// whether DryRun is set. Used by the CLI to render the preview before
	// the confirmation prompt. Called exactly once per install attempt and
	// only for non-tars-hub sources (the built-in hub keeps the legacy
	// no-preview flow).
	OnPreview func(*DryRunResult)
}

InstallOptions controls how (and whether) Installer.InstallWithOptions asks the caller for confirmation before materializing an external-hub skill. Empty InstallOptions preserves the legacy Install behaviour.

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"`
	// DryRunPreview is populated when InstallOptions.DryRun was true. In
	// that case the workspace is untouched and Sandbox is the zero value.
	DryRunPreview *DryRunResult `json:"dry_run_preview,omitempty"`
}

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"`
	Dir     string `json:"dir"`
}

InstalledSkill tracks a skill that has been installed locally. Source is the HubSource ID the skill was fetched from (e.g. "tars-hub", "openclaw", "hermes", "anthropic"). Legacy rows with an empty Source are migrated to DefaultSourceID at load time.

type Installer

type Installer struct {
	WorkspaceDir string
	Registry     *Registry
	// Sources routes skill operations to the appropriate HubSource. The
	// built-in tars-hub source is registered by NewInstaller; external
	// hubs are added in later phases.
	Sources *SourceRegistry
}

Installer handles installing and managing hub skills.

func NewInstaller

func NewInstaller(workspaceDir string) *Installer

NewInstaller creates an installer for the given workspace. It registers the built-in tars-hub source so existing call sites and tests keep working without modification. External hubs (openclaw, hermes, anthropic) are wired by the caller — see cmd/tars and internal/tarsserver — so the skillhub package does not import its own subpackages.

func (*Installer) Install

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

Install downloads and installs a skill. The ref may be a bare name (any registered source is searched) or a "<source>:<name>" pair (e.g. "openclaw:foo").

This is the legacy entry point: external-hub installs without explicit confirmation use the auto-approve path (Yes: true) to preserve existing callers that have no way to surface a prompt. CLI install grows a real prompt via InstallWithOptions.

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) InstallWithOptions added in v0.32.44

func (inst *Installer) InstallWithOptions(ctx context.Context, ref string, opts InstallOptions) (*InstallResult, error)

InstallWithOptions is the source-aware install entry point. The built-in tars-hub source keeps the legacy flow (no prompt, no preview); external hubs route through the converter / license fetcher, expose adapter warnings, and only materialize after explicit approval (Yes or Confirm).

When opts.DryRun is true the function downloads + converts, surfaces the preview through OnPreview, and returns early without touching disk. This is the contract the CLI's `--dry-run` flag relies on.

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) LookupSkill added in v0.32.44

func (inst *Installer) LookupSkill(ctx context.Context, ref string) (*RegistryEntry, string, error)

LookupSkill resolves a "<source>:<name>" or bare-name ref through the SourceRegistry and returns the entry plus the source it came from. Used by `tars skill info` so the output can show the hub of origin.

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) PreviewInstall added in v0.32.45

func (inst *Installer) PreviewInstall(ctx context.Context, ref string) (*DryRunResult, error)

PreviewInstall runs everything Install would do up to (but not including) the sandbox + materialize steps, then returns a structured preview the caller can render or feed into a confirmation prompt. Materialize is never reached so the workspace is untouched.

func (*Installer) SearchAllSkills added in v0.32.44

func (inst *Installer) SearchAllSkills(ctx context.Context, query, fromID string) ([]SkillSearchResult, error)

SearchAllSkills queries every registered HubSource (or a single one, if fromID is non-empty) and returns the combined result set. The CLI uses this for `tars skill search [--from <hub>] [query]`.

A source-level error is downgraded to a per-source skip so a transient network failure on one hub does not blank the whole listing.

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, routing each row to its recorded HubSource. External hubs (where the upstream `version` field is often a placeholder) compare the freshly computed SKILL.md sha256 against the stored manifest sha256 to decide whether anything changed.

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 LicenseFetcher added in v0.32.44

type LicenseFetcher interface {
	// FetchLicense returns the license body and label for the given entry.
	// Implementations may return a Proprietary label to make the installer
	// refuse the import (see the federation mapping doc).
	FetchLicense(ctx context.Context, entry *RegistryEntry) (body []byte, label string, err error)
}

LicenseFetcher is implemented by hubs that need to emit an ATTRIBUTION.md alongside the skill (i.e. external MIT/Apache-2.0 hubs). It returns the canonical license body for the imported skill plus a SPDX-like label ("MIT", "Apache-2.0", "Proprietary", "Unknown"). Built-in tars-hub does not implement this — TARS owns those skills.

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 SkillContentConverter added in v0.32.44

type SkillContentConverter interface {
	// ConvertSkillContent takes the raw SKILL.md bytes for an entry and
	// returns the converted bytes (in TARS frontmatter form) plus any
	// human-readable adapter warnings to surface to the user.
	ConvertSkillContent(entry *RegistryEntry, raw []byte) (converted []byte, warnings []string, err error)
}

SkillContentConverter is implemented by external hub adapters whose SKILL.md frontmatter must be rewritten before TARS can load the skill. Built-in tars-hub does not implement this — the Installer treats a missing implementation as identity (raw == converted, no warnings).

type SkillPreview added in v0.32.45

type SkillPreview struct {
	Name          string   `json:"name"`
	Description   string   `json:"description"`
	Author        string   `json:"author,omitempty"`
	Version       string   `json:"version,omitempty"`
	Tags          []string `json:"tags,omitempty"`
	UserInvocable bool     `json:"user_invocable"`
}

SkillPreview is the subset of the converted SKILL.md frontmatter we surface to the user. Pulled directly from the converter output so the user sees what TARS would load — not what the upstream raw file looked like.

type SkillSearchResult added in v0.32.44

type SkillSearchResult struct {
	SourceID string
	Entry    RegistryEntry
}

SkillSearchResult is one item produced by Installer.SearchAllSkills. The SourceID field lets the CLI render the hub a result came from.

type SourceRegistry added in v0.32.43

type SourceRegistry struct {
	// contains filtered or unexported fields
}

SourceRegistry holds the set of registered HubSources. It is safe for concurrent use.

func NewSourceRegistry added in v0.32.43

func NewSourceRegistry() *SourceRegistry

NewSourceRegistry returns an empty registry.

func (*SourceRegistry) Get added in v0.32.43

func (r *SourceRegistry) Get(id string) (HubSource, bool)

Get returns the source registered under id (case-insensitive).

func (*SourceRegistry) IDs added in v0.32.43

func (r *SourceRegistry) IDs() []string

IDs returns the registered source IDs in registration order.

func (*SourceRegistry) Len added in v0.32.43

func (r *SourceRegistry) Len() int

Len returns the number of registered sources.

func (*SourceRegistry) List added in v0.32.43

func (r *SourceRegistry) List() []HubSource

List returns all registered sources in registration order.

func (*SourceRegistry) Register added in v0.32.43

func (r *SourceRegistry) Register(src HubSource) error

Register adds a source. Returns an error if the source has an empty ID or if another source with the same canonical ID is already registered.

type TarsHubSource added in v0.32.43

type TarsHubSource struct {
	Registry *Registry
}

TarsHubSource adapts the built-in tars-skills registry to the HubSource interface. It is a thin wrapper around *Registry — preserving the existing fetch and search behaviour while letting the installer route skill operations through the same code path as future external hubs.

func NewTarsHubSource added in v0.32.43

func NewTarsHubSource() *TarsHubSource

NewTarsHubSource returns a TarsHubSource backed by a default Registry.

func (*TarsHubSource) FetchSkillContent added in v0.32.43

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

FetchSkillContent returns the SKILL.md for the entry.

func (*TarsHubSource) FetchSkillFile added in v0.32.43

func (s *TarsHubSource) FetchSkillFile(ctx context.Context, entry *RegistryEntry, relPath string) ([]byte, error)

FetchSkillFile returns a companion file relative to the entry path.

func (*TarsHubSource) FindSkillByName added in v0.32.43

func (s *TarsHubSource) FindSkillByName(ctx context.Context, name string) (*RegistryEntry, error)

FindSkillByName delegates to the underlying Registry.

func (*TarsHubSource) ID added in v0.32.43

func (s *TarsHubSource) ID() string

ID returns the canonical built-in hub identifier.

func (*TarsHubSource) SearchSkills added in v0.32.43

func (s *TarsHubSource) SearchSkills(ctx context.Context, query string) ([]RegistryEntry, error)

SearchSkills delegates to the underlying Registry.

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.

Directories

Path Synopsis
sources
anthropic
Package anthropic is the HubSource adapter for anthropics/skills.
Package anthropic is the HubSource adapter for anthropics/skills.
hermes
Package hermes is the HubSource adapter for NousResearch/hermes-agent.
Package hermes is the HubSource adapter for NousResearch/hermes-agent.
openclaw
Package openclaw is the HubSource adapter for steipete/openclaw.
Package openclaw is the HubSource adapter for steipete/openclaw.

Jump to

Keyboard shortcuts

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