Documentation
¶
Overview ¶
Package plugins embeds JavaScript tools using the pure-Go moejs runtime.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Path string `yaml:"path"`
Timeout int `yaml:"timeout,omitempty"` // seconds; default 30
MemoryLimitMB int `yaml:"memory_limit_mb,omitempty"` // default 64
Config map[string]any `yaml:"config,omitempty"`
}
Config describes one ES module. Paths are resolved relative to config.yml.
type Event ¶
type Event struct {
Type string `json:"type"`
Agent string `json:"agent,omitempty"`
Model string `json:"model,omitempty"`
Tool string `json:"tool,omitempty"`
CallID string `json:"call_id,omitempty"`
Prompt string `json:"prompt,omitempty"`
Arguments string `json:"arguments,omitempty"`
Result string `json:"result"`
Error string `json:"error,omitempty"`
}
Event is the immutable JSON snapshot sent to lifecycle hooks. Hooks observe events; their return value does not replace prompts, arguments or results.
type Plugin ¶
type Plugin struct {
Tools []*Tool
Agents map[string]json.RawMessage
Models map[string]json.RawMessage
Providers map[string]json.RawMessage
Themes map[string]Theme
// contains filtered or unexported fields
}
Plugin contains the extensions exported by one ES module. Agents and models use the same fields as YAML configuration; registration is owned by config.
func Load ¶
Load compiles a plugin and reads its exported `tools` object. Tool names are namespaced as <plugin>__<tool> so multiple plugins can use the same local name.
type Theme ¶
type Theme struct {
Description string `json:"description"`
Light ThemeVariant `json:"light"`
Dark ThemeVariant `json:"dark"`
}
Theme has matching light and dark variants.
type ThemeVariant ¶
type ThemeVariant struct {
Primary string `json:"primary"`
Accent string `json:"accent"`
Success string `json:"success"`
Warning string `json:"warning"`
Error string `json:"error"`
User string `json:"user"`
Muted string `json:"muted"`
}
ThemeVariant defines foreground colors for a light or dark terminal.