agentplugin

package
v0.3.0-beta.25 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package agentplugin reads and validates portable Agent Plugins packages.

Index

Constants

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"
)

Variables

This section is empty.

Functions

func ReadManifestName

func ReadManifestName(dir string) (string, error)

ReadManifestName reads only the authored package name needed to resolve its data directory. Load still performs the complete schema and component validation exactly once afterward.

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 Diagnostic

type Diagnostic struct {
	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
}

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

type ManifestError

type ManifestError struct {
	Issues []Issue
}

ManifestError contains every deterministic fatal manifest issue.

func (*ManifestError) Error

func (e *ManifestError) Error() string

Error renders all issues without discarding their field paths.

type Package

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

Package is the validated, portable package projection.

func Load

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

Load validates the root manifest and independently discovers portable components. Only root-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 reads a regular, non-symlinked root plugin.json and triages its declared schema identifier.

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 ServerSpec

type ServerSpec struct {
	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