agentplugin

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package agentplugin reads and validates portable Agent Plugins packages.

Index

Constants

View Source
const (
	ClientComponentIgnored = "client_component_ignored"
	ClientFieldIgnored     = "client_field_ignored"
	ClientMCPDiscovered    = "client_mcp_discovered"
)
View Source
const (
	PluginSchemaID = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json"
	MCPSchemaID    = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json"

	PluginSchemaSHA256 = "0a4aad95ce337878ad38802ebf0daa3fde76abe3f65400c86bcbb1ec0b3ab883"
	MCPSchemaSHA256    = "6539175bfcdf43085855183e86da40ea94b166547a72b47ae9a0a390516d3acb"
)
View Source
const ClientPlaceholderInvalid = "client_placeholder_invalid"
View Source
const LayoutStandard = "standard"

LayoutStandard identifies the portable root manifest grammar.

Variables

View Source
var ErrManifestInvalid = errors.New("extension: agent plugin manifest invalid")

ErrManifestInvalid identifies invalid plugin manifests at acquisition and load time.

View Source
var ErrSchemaUnsupported = errors.New("extension: Agent Plugins schema is unsupported")

Functions

func LocateManifest

func LocateManifest(root string) (string, string, error)

LocateManifest selects a manifest when only its path and layout are needed.

func PackageManifestPath

func PackageManifestPath(path string) string

PackageManifestPath returns the recognized manifest location without the host directory.

func ValidateName

func ValidateName(name string) error

ValidateName enforces the portable manifest name grammar byte-for-byte.

Types

type AuthorInfo

type AuthorInfo struct {
	Name  string
	Email string
	URL   string
}

AuthorInfo mirrors the closed author object in the standard.

type DerivedInput

type DerivedInput struct {
	ID       string
	Secret   bool
	Required bool
	Default  string
	Servers  []string
}

type Diagnostic

type Diagnostic struct {
	Code    string
	Scope   string
	Message string
}

Diagnostic records one non-fatal component skip.

type Issue

type Issue struct {
	Path    string
	Message string
}

Issue identifies one fatal manifest validation problem.

type LoadOptions

type LoadOptions struct {
	DataDir string
	Name    string
}

LoadOptions supplies the instance-specific data root used for expansion.

type ManifestDocument

type ManifestDocument struct {
	Path   string
	Layout string
	// contains filtered or unexported fields
}

ManifestDocument retains one securely acquired manifest for classification and loading.

func ReadManifest

func ReadManifest(root string) (*ManifestDocument, error)

func (*ManifestDocument) Classify

func (m *ManifestDocument) Classify() (SchemaStatus, string)

func (*ManifestDocument) Load

func (m *ManifestDocument) Load(opts LoadOptions) (*Package, error)

func (*ManifestDocument) Name

func (m *ManifestDocument) Name() (string, error)

func (*ManifestDocument) ValidJSON

func (m *ManifestDocument) ValidJSON() bool

type ManifestError

type ManifestError struct {
	Cause        error
	Issues       []Issue
	ManifestPath string
}

ManifestError contains every deterministic fatal manifest issue.

func (*ManifestError) Error

func (e *ManifestError) Error() string

Error renders all issues without discarding their field paths.

func (*ManifestError) Is

func (e *ManifestError) Is(target error) bool

func (*ManifestError) Unwrap

func (e *ManifestError) Unwrap() error

type NotManifestError

type NotManifestError struct {
	Root    string
	Checked []string
}

NotManifestError records the candidate paths checked during lookup.

func (*NotManifestError) Error

func (e *NotManifestError) Error() string

type OAuthConfig

type OAuthConfig struct {
	ClientID     string
	ClientSecret string
	Scopes       []string
}

type Package

type Package struct {
	Layout      string
	Name        string
	Version     string
	Description string
	Author      *AuthorInfo
	Homepage    string
	Repository  string
	License     string
	Keywords    []string
	Skills      []SkillRef
	Inputs      []DerivedInput
	Servers     []ServerSpec
	Diagnostics []Diagnostic
}

Package is the validated, portable package projection.

func Load

func Load(dir string, opts LoadOptions) (*Package, error)

Load validates the selected manifest and independently discovers its components. Only manifest failures are returned as errors.

type SchemaStatus

type SchemaStatus int

SchemaStatus classifies a root manifest without selecting a fallback.

const (
	SchemaSupported SchemaStatus = iota
	SchemaUnsupportedVersion
	SchemaUnrelated
)

func ClassifyManifest

func ClassifyManifest(dir string) (SchemaStatus, string, error)

ClassifyManifest locates the authored manifest and triages its declared schema.

func ClassifyManifestContent

func ClassifyManifestContent(content []byte) (SchemaStatus, string)

ClassifyManifestContent applies the same schema triage to manifest bytes already acquired through a caller-owned filesystem capability.

type SchemaUnsupportedError

type SchemaUnsupportedError struct {
	Path     string
	Root     string
	Declared string
}

SchemaUnsupportedError retains manifest identity across acquisition and loading boundaries.

func (*SchemaUnsupportedError) Error

func (e *SchemaUnsupportedError) Error() string

func (*SchemaUnsupportedError) Unwrap

func (e *SchemaUnsupportedError) Unwrap() error

type ServerSpec

type ServerSpec struct {
	Auth      *OAuthConfig
	Name      string
	Transport string
	Command   string
	CWD       string
	Args      []string
	Env       map[string]string
	URL       string
	Headers   map[string]string
}

ServerSpec is a normalized stdio or Streamable HTTP MCP server.

type SkillRef

type SkillRef struct {
	Name      string
	Dir       string
	SkillFile string
}

SkillRef identifies one immediate-child Agent Skill.

Jump to

Keyboard shortcuts

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