Documentation
¶
Index ¶
- func BaseURL(port int) string
- func CallTool(route ToolRoute, args json.RawMessage) (json.RawMessage, error)
- func DefaultShelvesStateDir(projectRoot string) string
- func PackageDir(workspace, pkg string) string
- func PluginPort(entry PluginEntry, def int) int
- func ResolveConfigPath(getwd func() (string, error)) (string, error)
- type Config
- type HostConfig
- type Manager
- type Manifest
- type ManifestEntry
- type ManifestTool
- type PluginEntry
- type Status
- type ToolRoute
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallTool ¶
func CallTool(route ToolRoute, args json.RawMessage) (json.RawMessage, error)
CallTool forwards args to a plugin HTTP handler from manifest.
func DefaultShelvesStateDir ¶
DefaultShelvesStateDir is .imprint/.shelves/.cache under the project root.
func PackageDir ¶
PackageDir resolves entry.Package relative to workspace.
func PluginPort ¶
func PluginPort(entry PluginEntry, def int) int
PluginPort returns the configured port for a plugin id.
Types ¶
type Config ¶
type Config struct {
Vault string `yaml:"vault"`
Host HostConfig `yaml:"host"`
Plugins map[string]PluginEntry `yaml:"plugins"`
// contains filtered or unexported fields
}
Config is imprint.yaml under .imprint/ in the project.
func (*Config) ResolveVaultAbs ¶
ResolveVaultAbs returns the absolute vault directory for this config.
type HostConfig ¶
type HostConfig struct {
Listen string `yaml:"listen"`
}
HostConfig is the imprint plugin host section.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager starts and stops plugin processes.
func (*Manager) StartPlugin ¶
StartPlugin starts one plugin by id.
type Manifest ¶
type Manifest struct {
APIVersion int `json:"apiVersion"`
ID string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
Capabilities []string `json:"capabilities"`
Entry ManifestEntry `json:"entry"`
ConfigSchema map[string]any `json:"configSchema,omitempty"`
Tools []ManifestTool `json:"tools"`
// contains filtered or unexported fields
}
Manifest is imprint.plugin.json in a plugin package root.
func LoadManifest ¶
LoadManifest reads imprint.plugin.json from packageDir.
type ManifestEntry ¶
ManifestEntry describes how to start and health-check a plugin.
type ManifestTool ¶
type ManifestTool struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema map[string]any `json:"inputSchema,omitempty"`
Handler string `json:"handler"`
RegisteredAs string `json:"-"`
}
ManifestTool is one MCP tool proxied through imprint-mcp.
func ResolveTools ¶
func ResolveTools(pluginID string, tools []ManifestTool, taken map[string]struct{}) []ManifestTool
ResolveTools assigns RegisteredAs names with optional pluginId prefix on collision.
type PluginEntry ¶
type PluginEntry struct {
Enabled bool `yaml:"enabled"`
Package string `yaml:"package"`
Config map[string]any `yaml:"config"`
}
PluginEntry is one plugin in imprint.yaml.
type Status ¶
type Status struct {
ID string `json:"id"`
Enabled bool `json:"enabled"`
Package string `json:"package"`
Port int `json:"port"`
Running bool `json:"running"`
Healthy bool `json:"healthy"`
URL string `json:"url,omitempty"`
Error string `json:"error,omitempty"`
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
Manifest *Manifest `json:"-"`
}
Status is one plugin row for list/reload.
type ToolRoute ¶
type ToolRoute struct {
PluginID string
Tool ManifestTool
BaseURL string
Registered string
}
ToolRoute is one MCP tool proxied to a plugin HTTP handler.
func EnabledTools ¶
EnabledTools returns proxied tools from enabled plugins with resolved names.