Documentation
¶
Index ¶
- Constants
- func CanonicalURL(schemaType string) string
- func DetectType(inputData []byte, filename string) string
- func EmbeddedSchema(schemaType string) []byte
- func EmbeddedSchemaInfo(schemaType string) (id string, title string)
- type Manager
- func (m *Manager) CachedPath(schemaType string) string
- func (m *Manager) Reset(schemaType string) error
- func (m *Manager) Resolve(schemaType string, override string) (*SchemaInfo, error)
- func (m *Manager) Show(schemaType string) (*SchemaInfo, error)
- func (m *Manager) Update(schemaType string, targetURL string) (*SchemaInfo, error)
- type SchemaInfo
Constants ¶
const ( SchemaTypeManifest = "manifest" SchemaTypeMCP = "mcp" CanonicalPluginSchemaURL = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json" CanonicalMCPSchemaURL = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json" CachePluginFileName = "plugin.schema.json" CacheMCPFileName = "mcp.schema.json" )
Variables ¶
This section is empty.
Functions ¶
func CanonicalURL ¶ added in v1.2.0
CanonicalURL returns the default canonical schema URL for a schema type.
func DetectType ¶ added in v1.2.0
DetectType inspects input document content and filename to determine if it is "mcp" or "manifest".
func EmbeddedSchema ¶
EmbeddedSchema returns the raw byte content for the given schema type ("manifest" or "mcp").
func EmbeddedSchemaInfo ¶
EmbeddedSchemaInfo parses basic metadata ($id, title) from the embedded schema.
Types ¶
type Manager ¶
type Manager struct {
CacheDir string
}
Manager manages local schema caching, resolution, and updating.
func NewManager ¶
NewManager creates a Manager with the default cache directory (~/.apv/schemas).
func (*Manager) CachedPath ¶
CachedPath returns the absolute path to the cached schema file for a schema type.
func (*Manager) Reset ¶
Reset removes the cached schema for a schema type (or all if schemaType is empty).
func (*Manager) Resolve ¶
func (m *Manager) Resolve(schemaType string, override string) (*SchemaInfo, error)
Resolve resolves the active schema based on precedence: 1. Explicit override (file path or URL) 2. Cached schema in ~/.apv/schemas/ 3. Embedded default schema
type SchemaInfo ¶
type SchemaInfo struct {
Type string `json:"type"` // "manifest" | "mcp"
Source string `json:"source"` // "embedded default" | "cached" | "override"
Path string `json:"path"` // filesystem path, URL, or "(embedded)"
ID string `json:"id"` // $id value from the schema
Title string `json:"title"` // title from the schema
RawSchema []byte `json:"-"` // Raw schema byte content
}
SchemaInfo holds information about a resolved or loaded schema.