Documentation
¶
Overview ¶
Package plugin is part of the GoFastr harness.
See docs/harness-architecture.md for the architecture this package implements.
Package plugin defines the Plugin interface. Plugins are compile-time: a plugin author imports the harness as a library, implements Plugin, and links it into a custom binary. Go's plugin.Open is rejected for ABI fragility (see § Plugin distribution model). The recommended distribution channel for third-party tools is an MCP server bridged via mcpclient.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventEnvelope ¶
type EventEnvelope = any // control.EventEnvelope
type Host ¶
type Host interface {
// ClaimSlashCommand reserves a namespace prefix for this
// plugin's commands (e.g. "custom" for `/custom:foo`). Returns
// an error on conflict with built-in or another plugin.
ClaimSlashCommand(namespace string) error
// AddRequestMiddleware appends a RequestMiddleware to the
// engine's chain. The host wires it into every per-session
// engine that boots after this point.
AddRequestMiddleware(mw RequestMiddleware)
// AddToolMiddleware appends a ToolMiddleware to the dispatcher
// chain.
AddToolMiddleware(mw ToolMiddleware)
// RegisterToolSource adds a ToolSource (e.g. plugin-defined
// tools) to the registry.
RegisterToolSource(src ToolSource) error
// RegisterProvider adds an LLM provider implementation.
RegisterProvider(p Provider) error
// SubscribeEvents returns a channel of canonical event
// envelopes for cross-session subscribers (cost dashboards,
// telemetry, etc.).
SubscribeEvents() <-chan EventEnvelope
}
Host is the API surface plugins access. Concrete harness.Harness satisfies this; we declare only what's needed so the interface doesn't drift.
Subsystem-shaped methods take the subsystem's package-level type; this package re-declares minimal interfaces below to avoid heavy imports.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager holds the registered plugins for a harness process and drives Register on boot.
func (*Manager) InitAll ¶
InitAll calls Register(h) on every registered plugin in registration order. Returns the first error.
type Plugin ¶
Plugin is the single extension contract. On Register, a plugin attaches middleware, subscribes to events, registers backends, and claims slash-command namespaces.
The Host is the subset of the harness API a plugin may touch; concrete *harness.Harness satisfies it. Defining Host as an interface in this package keeps plugin/ free of the harness/ import (which would create a cycle).
type RequestMiddleware ¶
type RequestMiddleware = any // engine.RequestMiddleware
type ToolMiddleware ¶
type ToolMiddleware = any // tool.Middleware
type ToolSource ¶
type ToolSource = any // tool.ToolSource