skills

package
v0.0.91 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tools

func Tools(registry *Registry, installer *Installer, workDir string) []agentsdk.Tool

Tools returns the skill search, install, and list-installed tools.

Types

type FilterOption

type FilterOption func(*filterConfig)

FilterOption configures skill filtering.

func WithCategory

func WithCategory(cat string) FilterOption

WithCategory filters skills by category.

func WithTags

func WithTags(tags ...string) FilterOption

WithTags filters skills that have any of the given tags.

func WithVerifiedOnly

func WithVerifiedOnly() FilterOption

WithVerifiedOnly filters to only verified skills.

type InstallTool

type InstallTool struct {
	Installer *Installer
	WorkDir   string
}

InstallTool installs a skill from the catalog into the workspace's .mcp.json.

func (*InstallTool) Description

func (t *InstallTool) Description() string

func (*InstallTool) Execute

func (t *InstallTool) Execute(_ context.Context, input json.RawMessage, workDir string) (agentsdk.ToolResult, error)

func (*InstallTool) InputSchema

func (t *InstallTool) InputSchema() json.RawMessage

func (*InstallTool) IsEnabled

func (t *InstallTool) IsEnabled(ctx *agentsdk.RunContext) bool

func (*InstallTool) IsReadOnly

func (t *InstallTool) IsReadOnly() bool

func (*InstallTool) Name

func (t *InstallTool) Name() string

func (*InstallTool) NeedsApproval

func (t *InstallTool) NeedsApproval() bool

func (*InstallTool) TimeoutSeconds

func (t *InstallTool) TimeoutSeconds() int

type Installer

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

Installer manages skill installation in workspaces via .mcp.json.

func NewInstaller

func NewInstaller(registry *Registry) *Installer

NewInstaller creates an installer backed by the given registry.

func (*Installer) Install

func (inst *Installer) Install(workDir, skillName string) error

Install adds the named skill's MCP server config to the workspace's .mcp.json.

The entry's allowEnv is seeded from the skill's requiresEnvVars so that credential-looking variables the server genuinely needs pass the SDK's credential env filter once the host supplies them (via the entry's env map or a host-level secret mechanism). If an entry with the same name already exists, its hardening fields (allowEnv, allowedTools, enabled, env) are preserved and merged rather than silently clobbered.

func (*Installer) ListInstalled

func (inst *Installer) ListInstalled(workDir string) ([]string, error)

ListInstalled returns the names of skills currently configured in .mcp.json.

func (*Installer) Skill added in v0.0.53

func (inst *Installer) Skill(name string) (*SkillEntry, bool)

Skill returns the catalog entry for name from the installer's registry.

func (*Installer) Uninstall

func (inst *Installer) Uninstall(workDir, skillName string) error

Uninstall removes the named skill's MCP server config from .mcp.json.

type ListInstalledTool

type ListInstalledTool struct {
	Installer *Installer
	WorkDir   string
}

ListInstalledTool lists skills currently installed in the workspace.

func (*ListInstalledTool) Description

func (t *ListInstalledTool) Description() string

func (*ListInstalledTool) Execute

func (*ListInstalledTool) InputSchema

func (t *ListInstalledTool) InputSchema() json.RawMessage

func (*ListInstalledTool) IsEnabled

func (t *ListInstalledTool) IsEnabled(_ *agentsdk.RunContext) bool

func (*ListInstalledTool) IsReadOnly

func (t *ListInstalledTool) IsReadOnly() bool

func (*ListInstalledTool) Name

func (t *ListInstalledTool) Name() string

func (*ListInstalledTool) NeedsApproval

func (t *ListInstalledTool) NeedsApproval() bool

func (*ListInstalledTool) TimeoutSeconds

func (t *ListInstalledTool) TimeoutSeconds() int

type MCPServerConfig

type MCPServerConfig struct {
	Type    string            `json:"type"`
	Command string            `json:"command"`
	Args    []string          `json:"args,omitempty"`
	Env     map[string]string `json:"env,omitempty"`
}

MCPServerConfig defines how to run an MCP server.

type Registry

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

Registry manages the skill catalog for discovery and installation.

func NewRegistry

func NewRegistry() (*Registry, error)

NewRegistry creates a registry loaded with the default embedded catalog.

func NewRegistryFromEntries

func NewRegistryFromEntries(entries []SkillEntry) *Registry

NewRegistryFromEntries creates a registry from provided entries.

func (*Registry) Categories

func (r *Registry) Categories() []string

Categories returns all unique categories in the catalog.

func (*Registry) Get

func (r *Registry) Get(name string) (*SkillEntry, bool)

Get returns a skill by name, or nil if not found.

func (*Registry) List

func (r *Registry) List(opts ...FilterOption) []SkillEntry

List returns all skills, optionally filtered.

func (*Registry) Search

func (r *Registry) Search(query string) []SkillEntry

Search finds skills matching a query string against name, description, and tags.

type SearchTool

type SearchTool struct {
	Registry *Registry
}

SearchTool searches the skill catalog by query, category, or tag.

func (*SearchTool) Description

func (t *SearchTool) Description() string

func (*SearchTool) Execute

func (*SearchTool) InputSchema

func (t *SearchTool) InputSchema() json.RawMessage

func (*SearchTool) IsEnabled

func (t *SearchTool) IsEnabled(_ *agentsdk.RunContext) bool

func (*SearchTool) IsReadOnly

func (t *SearchTool) IsReadOnly() bool

func (*SearchTool) Name

func (t *SearchTool) Name() string

func (*SearchTool) NeedsApproval

func (t *SearchTool) NeedsApproval() bool

func (*SearchTool) TimeoutSeconds

func (t *SearchTool) TimeoutSeconds() int

type SkillEntry

type SkillEntry struct {
	Name            string          `json:"name"`
	Description     string          `json:"description"`
	Category        string          `json:"category"`
	Version         string          `json:"version"`
	Source          SkillSource     `json:"source"`
	MCPConfig       MCPServerConfig `json:"mcpConfig"`
	Tags            []string        `json:"tags,omitempty"`
	Verified        bool            `json:"verified"`
	RequiresEnvVars []string        `json:"requiresEnvVars,omitempty"`
}

SkillEntry represents a single skill in the catalog.

func LoadDefaultCatalog

func LoadDefaultCatalog() ([]SkillEntry, error)

LoadDefaultCatalog parses the embedded default skill catalog.

type SkillSource

type SkillSource struct {
	Repository string `json:"repository,omitempty"`
	Ref        string `json:"ref,omitempty"`
	URL        string `json:"url,omitempty"`
}

SkillSource identifies where a skill package comes from.

Jump to

Keyboard shortcuts

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