plugin

package
v0.14.11 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package plugin implements Agent Plugins v1.0.0. It loads plugin directories and exposes their skills, MCP servers, and namespaced lifecycle hooks.

https://agent-plugins.org

Index

Constants

View Source
const MCPSchema = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json"

MCPSchema is the canonical Agent Plugins 1.0.0 MCP configuration identifier.

View Source
const ManifestSchema = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json"

ManifestSchema is the canonical Agent Plugins 1.0.0 manifest identifier. It selects local validation rules and is never retrieved.

Variables

This section is empty.

Functions

func Discover

func Discover(workDir, projectData, personalData string) ([]Plugin, []Diagnostic)

Discover loads every plugin reachable from the project and the user's home directory. A plugin name resolves once: the first directory that provides it wins and later copies are reported. Plugins whose manifest is invalid are reported and skipped.

projectData and personalData are the roots under which each scope's PLUGIN_DATA directories are created; the caller owns their location so plugin state sits alongside the rest of a project's state.

func Skills

func Skills(plugins []Plugin) []skill.Skill

Skills returns every plugin's skills in discovery order.

Types

type Author

type Author struct {
	Name  string `json:"name,omitempty"`
	Email string `json:"email,omitempty"`
	URL   string `json:"url,omitempty"`
}

type Diagnostic

type Diagnostic struct {
	Path    string
	Message string
}

Diagnostic reports something a plugin got wrong that did not stop the rest of it from loading.

func Servers

func Servers(plugins []Plugin) (map[string]mcp.ServerConfig, []Diagnostic)

Servers returns every plugin's MCP servers keyed by their declared name. Earlier plugins win a contested name, matching skill precedence.

func (Diagnostic) String

func (d Diagnostic) String() string

type Manifest

type Manifest struct {
	Schema string `json:"$schema"`
	Name   string `json:"name"`

	Version     string   `json:"version,omitempty"`
	Description string   `json:"description,omitempty"`
	Author      *Author  `json:"author,omitempty"`
	Homepage    string   `json:"homepage,omitempty"`
	Repository  string   `json:"repository,omitempty"`
	License     string   `json:"license,omitempty"`
	Keywords    []string `json:"keywords,omitempty"`

	Extensions map[string]json.RawMessage `json:"extensions,omitempty"`
}

Manifest is the closed set of portable plugin.json fields.

type Plugin

type Plugin struct {
	Name string

	Root string
	Data string

	Manifest Manifest

	Skills  []skill.Skill
	Servers map[string]mcp.ServerConfig
	Hooks   *external.Config
}

Plugin is one loaded plugin package.

func Load

func Load(dir, dataRoot string) (*Plugin, []string, error)

Load reads one plugin directory. It returns an error only when the manifest is unusable; a component that fails to load is reported and skipped so the remaining components still work.

Jump to

Keyboard shortcuts

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