agentplugin

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package agentplugin loads portable Agent Plugins 1.0.0 packages.

Index

Constants

View Source
const (
	// ManifestSchema is the canonical Agent Plugins 1.0.0 manifest schema ID.
	ManifestSchema = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json"
	// MCPSchema is the canonical Agent Plugins 1.0.0 MCP schema ID.
	MCPSchema = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json"
)

Variables

View Source
var (
	// ErrInvalid reports a package or component that violates Agent Plugins.
	ErrInvalid = errors.New("agent plugin: invalid")
	// ErrLimitExceeded reports bounded discovery or content exhaustion.
	ErrLimitExceeded = errors.New("agent plugin: limit exceeded")
)

Functions

This section is empty.

Types

type Author

type Author struct {
	Name  string
	Email string
	URL   string
}

Author is optional portable plugin author metadata.

type Diagnostic

type Diagnostic struct {
	Plugin    string `json:"plugin"`
	Component string `json:"component"`
	Code      string `json:"code"`
	Message   string `json:"message"`
}

Diagnostic describes a non-fatal package or component decision.

type Limits

type Limits struct {
	MaxPlugins            int
	MaxManifestBytes      int64
	MaxMCPBytes           int64
	MaxMCPServers         int
	MaxSkills             int
	MaxSkillBytes         int64
	MaxResourcesPerSkill  int
	MaxResourceBytes      int64
	MaxTotalResourceBytes int64
}

Limits bound local package discovery and reads.

func DefaultLimits

func DefaultLimits() Limits

DefaultLimits returns conservative Agent Plugin loading bounds.

type Manifest

type Manifest struct {
	Name        string
	Version     string
	Description string
	Author      *Author
	Homepage    string
	Repository  string
	License     string
	Keywords    []string
}

Manifest is the portable metadata from plugin.json.

type Options

type Options struct {
	Paths          paths.Layout
	Tree           *workspace.Tree
	ProjectTrusted bool
	Limits         Limits
}

Options select user and optional trusted-project plugin roots.

type Package

type Package struct {
	Manifest    Manifest
	Provenance  string
	Root        string
	Data        string
	SkillCount  int
	ServerCount int
	// contains filtered or unexported fields
}

Package is one accepted portable plugin package.

type Result

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

Result is one fully decoded Agent Plugin generation.

func Load

func Load(ctx context.Context, options Options) (Result, error)

Load discovers immediate plugin package directories from the user root and, only when trusted, the project root. Each package is then loaded according to the Agent Plugins 1.0.0 fixed-location contract.

func LoadDirectory

func LoadDirectory(
	ctx context.Context,
	directory string,
	dataBase string,
	limits Limits,
) (Result, error)

LoadDirectory validates and decodes one explicit Agent Plugin package root. It is intended for client validation surfaces; runtime discovery uses Load.

func (Result) Diagnostics

func (r Result) Diagnostics() []Diagnostic

Diagnostics returns deterministic load diagnostics.

func (Result) MCPDefinitions

func (r Result) MCPDefinitions() codingmcp.Definitions

MCPDefinitions returns validated portable MCP server definitions.

func (Result) Packages

func (r Result) Packages() []Package

Packages returns accepted portable packages in deterministic order.

func (Result) SkillEntries

func (r Result) SkillEntries() []extension.SkillEntry

SkillEntries returns accepted Agent Skills with plugin provenance.

Jump to

Keyboard shortcuts

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