Documentation
¶
Index ¶
- func DefaultCatalogBundledSkillSpecs() ([]pkgplugins.BundledSkillSpec, error)
- func NewAuthService(store pluginAuthStore) pkgplugins.Auth
- func NewScopedStateStore(store StateStoreBackend, pluginID string) pkgplugins.StateStore
- func NewSkillStoreAdapter(s skills.Store) pkgplugins.SkillStore
- type ChannelPlatform
- type ConfigBackend
- type Host
- func (h *Host) AddAdmin(reg pkgplugins.AdminSpec)
- func (h *Host) AddAfterToolResult(reg pkgplugins.AfterToolResultSpec)
- func (h *Host) AddBeforeRun(reg pkgplugins.BeforeRunSpec)
- func (h *Host) AddBeforeToolCall(reg pkgplugins.BeforeToolCallSpec)
- func (h *Host) AddBundledSkill(spec pkgplugins.BundledSkillSpec)
- func (h *Host) AddChannel(reg pkgplugins.ChannelSpec)
- func (h *Host) AddHook(reg pkgplugins.HookSpec)
- func (h *Host) AddPromptInventory(reg pkgplugins.PromptInventorySpec)
- func (h *Host) AddProvider(reg pkgplugins.ProviderSpec)
- func (h *Host) AddRuntime(reg pkgplugins.RuntimeSpec)
- func (h *Host) AddSessionEnv(spec pkgplugins.SessionEnvSpec)
- func (h *Host) AddSystemPrompt(reg pkgplugins.SystemPromptSpec)
- func (h *Host) AddTool(reg pkgplugins.ToolSpec)
- func (h *Host) AfterToolResult(ctx context.Context, build pkgplugins.AfterToolResultContext) (pkgplugins.AfterToolResult, error)
- func (h *Host) AllBundledSkillSpecs() []pkgplugins.BundledSkillSpec
- func (h *Host) AllSessionEnvSpecs() []pkgplugins.SessionEnvSpec
- func (h *Host) ApplyChannel(ctx context.Context, channel config.Channel) error
- func (h *Host) ApplyPlugin(ctx context.Context, pluginID string) error
- func (h *Host) Auth() pkgplugins.Auth
- func (h *Host) BeforeRun(ctx context.Context, build pkgplugins.BeforeRunContext) (pkgplugins.BeforeRunResult, error)
- func (h *Host) BeforeToolCall(ctx context.Context, build pkgplugins.BeforeToolCallContext) (pkgplugins.BeforeToolCallResult, error)
- func (h *Host) BuildEnabledHooks(ctx context.Context, bc pluginhooks.BuildContext) []hooks.HookPlugin
- func (h *Host) BuildEnabledTools(ctx context.Context, bc pkgplugins.ToolBuildContext) []tools.Tool
- func (h *Host) BuildProvider(name string, stateConfig map[string]any) (providers.ProviderAdapter, error)
- func (h *Host) BuildStreamFunc(name string, stateConfig map[string]any) (providers.StreamFunc, error)
- func (h *Host) BundledSkillSpecs(pluginID string) []pkgplugins.BundledSkillSpec
- func (h *Host) ChannelConfigured(ctx context.Context, name string) bool
- func (h *Host) ChannelInstanceConfigured(channel config.Channel) bool
- func (h *Host) ChannelRuntime() pkgplugins.ChannelPlatform
- func (h *Host) Config() ConfigBackend
- func (h *Host) ConfigSchema(pluginID string) map[string]any
- func (h *Host) DesiredState(ctx context.Context, pluginID string) (pkgplugins.PluginState, error)
- func (h *Host) HasConfig(pluginID string) bool
- func (h *Host) HasRuntime(pluginID string) bool
- func (h *Host) HasStatus(pluginID string) bool
- func (h *Host) IsConfigurable(pluginID string) bool
- func (h *Host) ListAdminVisiblePlugins(ctx context.Context) ([]pkgplugins.RegisteredPlugin, error)
- func (h *Host) ListChannels(ctx context.Context) ([]config.Channel, error)
- func (h *Host) ListProviderTypes() []ProviderType
- func (h *Host) ListRegisteredPlugins() []pkgplugins.PluginInfo
- func (h *Host) LoadCatalog(catalog *pkgplugins.Catalog) error
- func (h *Host) LoadDefaultCatalog() error
- func (h *Host) Logger(pluginID string) *slog.Logger
- func (h *Host) ManagedPlugins() []string
- func (h *Host) ManifestPluginPrompts() []pkgplugins.SystemPromptSection
- func (h *Host) Notifications() pkgplugins.Notifier
- func (h *Host) PluginsByKind(kind string) []string
- func (h *Host) PromptTools(ctx context.Context, pluginID string) ([]pkgplugins.PromptToolInfo, error)
- func (h *Host) RedactConfig(pluginID string, raw map[string]any) map[string]any
- func (h *Host) RegisterManifestPlugins(m *manifestplugins.Manifest)
- func (h *Host) RegisterPluginID(id string)
- func (h *Host) Runtime() pkgplugins.RuntimeLookup
- func (h *Host) Scheduler() SchedulerBackend
- func (h *Host) SessionEnvSpecs(pluginID string) []pkgplugins.SessionEnvSpec
- func (h *Host) SessionPluginView(ctx context.Context) (pkgplugins.SessionPluginView, error)
- func (h *Host) SetAuthService(service pkgplugins.Auth)
- func (h *Host) SetChannelRuntimeServices(services pkgplugins.ChannelPlatform)
- func (h *Host) SetEnabled(ctx context.Context, pluginID string, enabled bool) error
- func (h *Host) SetInfo(info pkgplugins.PluginInfo)
- func (h *Host) SetNotificationService(service pkgplugins.Notifier)
- func (h *Host) SetSchedulerService(service SchedulerBackend)
- func (h *Host) SetSkillStore(store skills.Store)
- func (h *Host) SetStateStore(store StateStoreBackend)
- func (h *Host) SkillStore() skills.Store
- func (h *Host) StateStore() StateStoreBackend
- func (h *Host) Status(ctx context.Context, pluginID string) (any, error)
- func (h *Host) Stop(ctx context.Context) error
- func (h *Host) SystemPromptSections(ctx context.Context, build pkgplugins.SystemPromptContext) ([]pkgplugins.SystemPromptSection, error)
- func (h *Host) ValidateConfig(pluginID string, raw map[string]any) error
- func (h *Host) ValidateRegistrations() error
- type Option
- func WithAuthService(service pkgplugins.Auth) Option
- func WithChannelRuntimeServices(services pkgplugins.ChannelPlatform) Option
- func WithNotificationService(service pkgplugins.Notifier) Option
- func WithSchedulerService(service SchedulerBackend) Option
- func WithSkillStore(store skills.Store) Option
- func WithStateStore(store StateStoreBackend) Option
- type ProviderType
- type RuntimeHost
- func (h *RuntimeHost) ApplyChannel(ctx context.Context, channel config.Channel) error
- func (h *RuntimeHost) ApplyPlugin(ctx context.Context, pluginID string) error
- func (h *RuntimeHost) Get(_ context.Context, runtimeID string, runtimeName string) (pkgplugins.RuntimeHandle, bool)
- func (h *RuntimeHost) Lookup(ctx context.Context, runtimeID string, runtimeName string) (pkgplugins.RuntimeHandle, bool)
- func (h *RuntimeHost) Snapshot(ctx context.Context, runtimeID string, runtimeName string) (pkgplugins.RuntimeStatus, error)
- func (h *RuntimeHost) Stop(ctx context.Context) error
- type SchedulerBackend
- type StateStoreBackend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultCatalogBundledSkillSpecs ¶
func DefaultCatalogBundledSkillSpecs() ([]pkgplugins.BundledSkillSpec, error)
DefaultCatalogBundledSkillSpecs loads the default plugin catalog into a throw-away host and returns all registered bundled skill specs, sorted by skill name then plugin ID.
func NewAuthService ¶
func NewAuthService(store pluginAuthStore) pkgplugins.Auth
func NewScopedStateStore ¶ added in v0.38.0
func NewScopedStateStore(store StateStoreBackend, pluginID string) pkgplugins.StateStore
NewScopedStateStore wraps a StateStoreBackend as a pkgplugins.StateStore whose calls are namespaced to the given pluginID. Used by gateway wiring for built-in subsystems (e.g. reflect) that need a state store but don't run inside the plugin runtime.
func NewSkillStoreAdapter ¶
func NewSkillStoreAdapter(s skills.Store) pkgplugins.SkillStore
NewSkillStoreAdapter wraps an internal/skills.Store as a pkgplugins.SkillStore. The returned value also satisfies pkgplugins.KnowledgeStore when the underlying store implements skills.KnowledgeStore. Exported so that test code and CLI code can construct a typed adapter without depending on the unexported adapter type.
Types ¶
type ChannelPlatform ¶
type ChannelPlatform struct {
// contains filtered or unexported fields
}
ChannelPlatform is a mutable host extension bag for managed channel runtimes.
func NewChannelRuntimeServices ¶
func NewChannelRuntimeServices() *ChannelPlatform
func (*ChannelPlatform) Handler ¶
func (s *ChannelPlatform) Handler() pkgchannel.Handler
func (*ChannelPlatform) Notifications ¶
func (s *ChannelPlatform) Notifications() pkgplugins.ChannelRegistry
func (*ChannelPlatform) ParentContext ¶
func (s *ChannelPlatform) ParentContext() context.Context
func (*ChannelPlatform) Set ¶
func (s *ChannelPlatform) Set(parent context.Context, handler pkgchannel.Handler, notifications pkgplugins.ChannelRegistry)
type ConfigBackend ¶
type ConfigBackend interface {
Get(ctx context.Context, pluginID string) (pkgplugins.PluginState, error)
Set(ctx context.Context, pluginID string, config map[string]any) error
SetEnabled(ctx context.Context, pluginID string, enabled bool) error
}
ConfigBackend is the host-owned unscoped plugin config backend.
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
func (*Host) AddAdmin ¶
func (h *Host) AddAdmin(reg pkgplugins.AdminSpec)
func (*Host) AddAfterToolResult ¶
func (h *Host) AddAfterToolResult(reg pkgplugins.AfterToolResultSpec)
func (*Host) AddBeforeRun ¶
func (h *Host) AddBeforeRun(reg pkgplugins.BeforeRunSpec)
func (*Host) AddBeforeToolCall ¶
func (h *Host) AddBeforeToolCall(reg pkgplugins.BeforeToolCallSpec)
func (*Host) AddBundledSkill ¶
func (h *Host) AddBundledSkill(spec pkgplugins.BundledSkillSpec)
func (*Host) AddChannel ¶
func (h *Host) AddChannel(reg pkgplugins.ChannelSpec)
func (*Host) AddHook ¶
func (h *Host) AddHook(reg pkgplugins.HookSpec)
func (*Host) AddPromptInventory ¶
func (h *Host) AddPromptInventory(reg pkgplugins.PromptInventorySpec)
func (*Host) AddProvider ¶
func (h *Host) AddProvider(reg pkgplugins.ProviderSpec)
func (*Host) AddRuntime ¶
func (h *Host) AddRuntime(reg pkgplugins.RuntimeSpec)
func (*Host) AddSessionEnv ¶
func (h *Host) AddSessionEnv(spec pkgplugins.SessionEnvSpec)
func (*Host) AddSystemPrompt ¶
func (h *Host) AddSystemPrompt(reg pkgplugins.SystemPromptSpec)
func (*Host) AddTool ¶
func (h *Host) AddTool(reg pkgplugins.ToolSpec)
func (*Host) AfterToolResult ¶
func (h *Host) AfterToolResult(ctx context.Context, build pkgplugins.AfterToolResultContext) (pkgplugins.AfterToolResult, error)
func (*Host) AllBundledSkillSpecs ¶
func (h *Host) AllBundledSkillSpecs() []pkgplugins.BundledSkillSpec
func (*Host) AllSessionEnvSpecs ¶
func (h *Host) AllSessionEnvSpecs() []pkgplugins.SessionEnvSpec
func (*Host) ApplyChannel ¶
func (*Host) Auth ¶
func (h *Host) Auth() pkgplugins.Auth
Auth returns the injected auth service, if any.
func (*Host) BeforeRun ¶
func (h *Host) BeforeRun(ctx context.Context, build pkgplugins.BeforeRunContext) (pkgplugins.BeforeRunResult, error)
func (*Host) BeforeToolCall ¶
func (h *Host) BeforeToolCall(ctx context.Context, build pkgplugins.BeforeToolCallContext) (pkgplugins.BeforeToolCallResult, error)
func (*Host) BuildEnabledHooks ¶
func (h *Host) BuildEnabledHooks(ctx context.Context, bc pluginhooks.BuildContext) []hooks.HookPlugin
func (*Host) BuildEnabledTools ¶
func (h *Host) BuildEnabledTools(ctx context.Context, bc pkgplugins.ToolBuildContext) []tools.Tool
func (*Host) BuildProvider ¶
func (*Host) BuildStreamFunc ¶ added in v0.28.0
func (*Host) BundledSkillSpecs ¶
func (h *Host) BundledSkillSpecs(pluginID string) []pkgplugins.BundledSkillSpec
func (*Host) ChannelConfigured ¶
func (*Host) ChannelInstanceConfigured ¶
func (*Host) ChannelRuntime ¶
func (h *Host) ChannelRuntime() pkgplugins.ChannelPlatform
ChannelRuntime returns the injected channel runtime service extension, if any.
func (*Host) Config ¶
func (h *Host) Config() ConfigBackend
func (*Host) DesiredState ¶
func (h *Host) DesiredState(ctx context.Context, pluginID string) (pkgplugins.PluginState, error)
func (*Host) HasRuntime ¶
func (*Host) IsConfigurable ¶ added in v0.38.0
IsConfigurable reports whether the plugin has an admin config schema registered. Used by the admin API to reject writes to plugin IDs that no longer exist in code (orphan plugin rows from old installs) or to typo'd IDs, instead of silently accepting them.
func (*Host) ListAdminVisiblePlugins ¶
func (h *Host) ListAdminVisiblePlugins(ctx context.Context) ([]pkgplugins.RegisteredPlugin, error)
func (*Host) ListChannels ¶
func (*Host) ListProviderTypes ¶
func (h *Host) ListProviderTypes() []ProviderType
func (*Host) ListRegisteredPlugins ¶
func (h *Host) ListRegisteredPlugins() []pkgplugins.PluginInfo
func (*Host) LoadCatalog ¶
func (h *Host) LoadCatalog(catalog *pkgplugins.Catalog) error
func (*Host) LoadDefaultCatalog ¶
func (*Host) ManagedPlugins ¶
func (*Host) ManifestPluginPrompts ¶
func (h *Host) ManifestPluginPrompts() []pkgplugins.SystemPromptSection
func (*Host) Notifications ¶
func (h *Host) Notifications() pkgplugins.Notifier
Notifications returns the injected notification service, if any.
func (*Host) PluginsByKind ¶
func (*Host) PromptTools ¶
func (h *Host) PromptTools(ctx context.Context, pluginID string) ([]pkgplugins.PromptToolInfo, error)
func (*Host) RedactConfig ¶
func (*Host) RegisterManifestPlugins ¶
func (h *Host) RegisterManifestPlugins(m *manifestplugins.Manifest)
RegisterManifestPlugins registers plugins declared in a manifest. For each enabled plugin:
- New plugins (not already Go-registered) are fully registered with ID, info, and session envs.
- Existing plugins (already Go-registered) get manifest session envs registered so the manifest is the single source of truth for env injection. Go code should no longer call AddSessionEnv for manifest-declared env vars.
func (*Host) RegisterPluginID ¶
func (*Host) Runtime ¶
func (h *Host) Runtime() pkgplugins.RuntimeLookup
func (*Host) Scheduler ¶
func (h *Host) Scheduler() SchedulerBackend
Scheduler returns the injected scheduler backend, if any.
func (*Host) SessionEnvSpecs ¶
func (h *Host) SessionEnvSpecs(pluginID string) []pkgplugins.SessionEnvSpec
func (*Host) SessionPluginView ¶
func (h *Host) SessionPluginView(ctx context.Context) (pkgplugins.SessionPluginView, error)
SessionPluginView returns the enabled plugin-owned session env setup used by runner sessions plus the registered/enabled plugin IDs prompt builders may need for visibility-aware output.
func (*Host) SetAuthService ¶
func (h *Host) SetAuthService(service pkgplugins.Auth)
SetAuthService updates the auth service extension after host construction.
func (*Host) SetChannelRuntimeServices ¶
func (h *Host) SetChannelRuntimeServices(services pkgplugins.ChannelPlatform)
SetChannelRuntimeServices updates the channel runtime service extension after host construction.
func (*Host) SetEnabled ¶
func (*Host) SetInfo ¶
func (h *Host) SetInfo(info pkgplugins.PluginInfo)
func (*Host) SetNotificationService ¶
func (h *Host) SetNotificationService(service pkgplugins.Notifier)
SetNotificationService updates the notification service extension after host construction.
func (*Host) SetSchedulerService ¶
func (h *Host) SetSchedulerService(service SchedulerBackend)
SetSchedulerService updates the scheduler backend after host construction.
func (*Host) SetSkillStore ¶
SetSkillStore updates the skill store after host construction.
func (*Host) SetStateStore ¶
func (h *Host) SetStateStore(store StateStoreBackend)
SetStateStore updates the plugin state backend after host construction.
func (*Host) SkillStore ¶
SkillStore returns the injected skill store, if any.
func (*Host) StateStore ¶
func (h *Host) StateStore() StateStoreBackend
StateStore returns the injected plugin state backend, if any.
func (*Host) SystemPromptSections ¶
func (h *Host) SystemPromptSections(ctx context.Context, build pkgplugins.SystemPromptContext) ([]pkgplugins.SystemPromptSection, error)
func (*Host) ValidateConfig ¶
func (*Host) ValidateRegistrations ¶
type Option ¶
type Option func(*Host)
func WithAuthService ¶
func WithAuthService(service pkgplugins.Auth) Option
WithAuthService injects the narrow auth directory available to plugins.
func WithChannelRuntimeServices ¶
func WithChannelRuntimeServices(services pkgplugins.ChannelPlatform) Option
WithChannelRuntimeServices injects the narrow services used by managed channel runtimes.
func WithNotificationService ¶
func WithNotificationService(service pkgplugins.Notifier) Option
WithNotificationService injects the narrow notification service available to plugins.
func WithSchedulerService ¶
func WithSchedulerService(service SchedulerBackend) Option
WithSchedulerService injects the host scheduler backend available to plugins.
func WithSkillStore ¶
WithSkillStore injects the skill store available to plugins.
func WithStateStore ¶
func WithStateStore(store StateStoreBackend) Option
WithStateStore injects the host plugin state backend available to plugins.
type ProviderType ¶
type RuntimeHost ¶
type RuntimeHost struct {
// contains filtered or unexported fields
}
RuntimeHost owns the map of managed runtime instances.
func NewRuntimeHost ¶
func NewRuntimeHost(host *Host) *RuntimeHost
func (*RuntimeHost) ApplyChannel ¶
func (*RuntimeHost) ApplyPlugin ¶
func (h *RuntimeHost) ApplyPlugin(ctx context.Context, pluginID string) error
func (*RuntimeHost) Get ¶
func (h *RuntimeHost) Get(_ context.Context, runtimeID string, runtimeName string) (pkgplugins.RuntimeHandle, bool)
Get resolves a managed runtime.
func (*RuntimeHost) Lookup ¶
func (h *RuntimeHost) Lookup(ctx context.Context, runtimeID string, runtimeName string) (pkgplugins.RuntimeHandle, bool)
Lookup is an alias for Get to match the pkgplugins.RuntimeLookup interface.
func (*RuntimeHost) Snapshot ¶
func (h *RuntimeHost) Snapshot(ctx context.Context, runtimeID string, runtimeName string) (pkgplugins.RuntimeStatus, error)
type SchedulerBackend ¶
type SchedulerBackend interface {
ReconcilePluginJobs(ctx context.Context, pluginID string, jobs []pkgplugins.SchedulerJobSpec) error
DeletePluginJobs(ctx context.Context, pluginID string) error
DeletePluginJob(ctx context.Context, pluginID string, key string) error
ListPluginJobs(ctx context.Context, pluginID string) ([]pkgplugins.SchedulerJob, error)
}
SchedulerBackend is the host-owned unscoped scheduler backend.
type StateStoreBackend ¶
type StateStoreBackend interface {
Get(ctx context.Context, pluginID string, scope pkgplugins.StateScope, key string) (map[string]any, bool, error)
Set(ctx context.Context, pluginID string, scope pkgplugins.StateScope, key string, value map[string]any) error
Delete(ctx context.Context, pluginID string, scope pkgplugins.StateScope, key string) error
}
StateStoreBackend is the host-owned unscoped plugin state backend.