Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandPath ¶
ExpandPath expands ~ to the user's home directory.
Types ¶
type HookFunc ¶
HookFunc is a lifecycle hook handler. For "before" events, returning a non-nil error cancels the action. For "after" events, return values are ignored.
type JSPlugin ¶
type JSPlugin struct {
// contains filtered or unexported fields
}
JSPlugin wraps a single JS extension loaded via QJS. All JS calls are serialized via mu since QJS runtimes are not goroutine-safe.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager discovers, loads, and manages JS plugins.
func NewManager ¶
NewManager creates a plugin manager.
func (*Manager) LoadAll ¶
func (m *Manager) LoadAll(configs []config.PluginConfig)
LoadAll loads JS plugins from config. Best-effort: logs warnings for failures and continues loading remaining plugins.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry collects tools and hooks from all plugins.
func NewRegistry ¶
NewRegistry creates a registry with the given built-in tool names reserved.
func (*Registry) RegisterHook ¶
RegisterHook adds a lifecycle hook for the given event kind.
func (*Registry) RegisterTool ¶
RegisterTool adds a tool. Returns error on duplicate or reserved name.
func (*Registry) RunHooks ¶
RunHooks executes all hooks for the given event kind sequentially.
Only before_tool_call is blocking: the first hook that returns an error stops execution and the error is returned, cancelling the tool call. All other events (after_tool_call, session_start, session_end) are fire-and-forget — hook errors are silently ignored.
The event parameter is a string (not EventKind) so that callers in the engine package can use this method without importing internal/plugin directly, avoiding circular imports.