| File | Content |
|---|---|
types.go |
Plugin, Metadata, PluginType, RuntimeContext |
channel.go |
Channel, ChannelPlugin |
provider.go |
ProviderPlugin (including CreateProviderFromModelConfig, SupportsProtocol, etc.) |
tool.go |
ToolPlugin |
registry.go |
Registry, RegisterPlugin, GlobalRegistry, type-based retrieval |
manager.go |
Manager: Initialize, InitializeToolsOnly, type-based init |
builtin.go |
LoadBuiltin() no-op + comments explaining import location |
- Each plugin package calls
plugin.RegisterPlugin(...)ininit(). - Global singleton accessed via
plugin.GlobalRegistry(); internally stored byPluginTypein separate maps. - Order: Gateway startup ensures all plugin
initfunctions have executed via imports before reading Registry.
InitializeToolsOnly: Only initializes Tool plugins and writes tools to internalToolRegistry. Current Gateway path: tool plugins first, then construct AgentLoop (merge tools), Channels still started bychannels.Managerbased on Registry.Initialize: Tools → Provider plugin instances → Channel plugin instances (full orchestration; call only if needed by entry point).
Injected when creating Manager: Config, MessageBus, optional MediaStore. Tool / Provider / Channel Init(ctx *RuntimeContext) runs within this context.