inspect

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package inspect derives a bounded, sanitized description of what a plugin package contributes.

It reads a package the way a run would — the same manifest, MCP, hook, and subagent parsers — but produces a report rather than a runtime. Publication and `plugin validate` both use it, which is why it depends only on core: a second implementation would let a package pass one check and fail the other.

It is a subpackage because internal/core/subagent already depends on internal/core/plugin for the layer vocabulary, so the parent cannot import it back.

What it deliberately does not carry: command arguments, header values, environment values, prompt text, and file contents. A catalog record is not a place to publish the inside of somebody's configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook struct {
	Event      string `json:"event"`
	Type       string `json:"type"`
	Matcher    string `json:"matcher,omitempty"`
	Executable string `json:"executable,omitempty"`
	Host       string `json:"host,omitempty"`
	MCPServer  string `json:"mcp_server,omitempty"`
	MCPTool    string `json:"mcp_tool,omitempty"`
}

Hook is one contributed hook, without its prompt, headers, or input.

type MCPServer

type MCPServer struct {
	ID        string `json:"id"`
	Transport string `json:"transport"`
	// Executable is the program name only, so a reader can see what starts
	// without seeing what it is told to do.
	Executable string `json:"executable,omitempty"`
	// Host is the URL host only, never its path or query.
	Host string `json:"host,omitempty"`
}

MCPServer is one contributed server, without its arguments or environment.

type Package

type Package struct {
	Manifest  plugin.Manifest
	Skills    []string
	Subagents []Subagent
	MCP       []MCPServer
	Hooks     []Hook

	// EnvRefs are the environment variable names the payload reads, sorted.
	// Names only: a value here would be a secret in a catalog record.
	EnvRefs []string

	// PluginPaths are files inside the package that its own configuration
	// reaches for, sorted and relative to the plugin root.
	PluginPaths []string

	Findings []plugin.Finding
}

Package is what one plugin directory contributes.

func Dir

func Dir(fsys fs.FS) (Package, error)

Dir inspects a plugin package rooted at fsys.

The returned error means there is no manifest to describe — every other problem is a finding, so one broken file still yields a report of everything else the package holds.

func (Package) HasErrors

func (p Package) HasErrors() bool

HasErrors reports whether anything found would stop the package loading.

type Subagent

type Subagent struct {
	Name  string   `json:"name"`
	Tools []string `json:"tools,omitempty"`
	Model string   `json:"model,omitempty"`
}

Subagent is one contributed subagent, without its system prompt.

Jump to

Keyboard shortcuts

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