registry

package
v0.0.0-...-bea457f Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package registry resolves tool/extension/MCP/skill manifests by name.

MVP scope: scans a root directory laid out as

<root>/tools/<name>/manifest.yaml
<root>/extensions/<name>/manifest.yaml

Post-MVP, the registry will also resolve installed manifests from ~/.agent-controller/registry/ — same shape, different root.

Every manifest is validated against schemas/manifest.v1.json during scan. Invalid manifests cause Scan to return an error and a nil index — surfacing the schema authority at compile time, not at first run.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	APIVersion string   `json:"apiVersion"`
	Kind       string   `json:"kind"`
	Metadata   Metadata `json:"metadata"`
	Spec       Spec     `json:"spec"`
}

type ManifestIndex

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

ManifestIndex stores manifests keyed by (kind, name).

func Scan

func Scan(root string) (*ManifestIndex, error)

Scan walks <root>/tools, <root>/extensions, <root>/skills, and <root>/agents and returns an index of every manifest found.

Tools and extensions: each directory must contain manifest.yaml, validated against the embedded manifest schema. The first invalid manifest aborts the scan with a descriptive error. Entrypoint paths are rewritten to absolute paths anchored at the manifest's directory.

Skills: each directory under <root>/skills must contain SKILL.md. No manifest.yaml is required; the registry synthesises a Manifest with Kind="Skill" and Entrypoint pointing to the SKILL.md file. The directory name is used as the skill name. This matches Pi's loadSkillsFromDir discovery rule (a directory containing SKILL.md is treated as a skill root).

Agents (Subagent kind): each <root>/agents/<slug>.md file is treated as an agent definition. No manifest.yaml is required. The registry synthesises a Manifest with Kind="Subagent" and Entrypoint pointing to the .md file. This matches Pi's subagent extension discovery rule (discoverAgents reads .md files from a directory).

func (*ManifestIndex) Lookup

func (i *ManifestIndex) Lookup(kind, name string) (Manifest, bool)

Lookup returns the manifest for (kind, name), if any.

type Metadata

type Metadata struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Owner       string `json:"owner,omitempty"`
	Description string `json:"description,omitempty"`
}

type Spec

type Spec struct {
	Entrypoint          string         `json:"entrypoint"`
	InputSchema         map[string]any `json:"inputSchema,omitempty"`
	OutputSchema        map[string]any `json:"outputSchema,omitempty"`
	ConfigSchema        map[string]any `json:"configSchema,omitempty"`
	Hooks               []string       `json:"hooks,omitempty"`
	RiskLevel           string         `json:"riskLevel,omitempty"`
	RequiredPermissions []string       `json:"requiredPermissions,omitempty"`
	SupportsDryRun      bool           `json:"supportsDryRun,omitempty"`
}

Jump to

Keyboard shortcuts

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