Documentation
¶
Index ¶
- func DefaultCatalogBundledSkillSpecs() ([]pkgplugins.BundledSkillSpec, error)
- func NewAuthService(store auth.AuthStore) pkgplugins.Auth
- 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) AddMemory(reg pkgplugins.MemorySpec)
- 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 plugintools.BuildContext) []tools.Tool
- func (h *Host) BuildMemory(ctx context.Context, name string, db *sql.DB, annaHome string, ...) (memory.Provider, error)
- func (h *Host) BuildProvider(name string, stateConfig map[string]any) (providers.ProviderAdapter, error)
- func (h *Host) BuildProviderRegistry(name string, stateConfig map[string]any) (*providers.Registry, 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) ChannelNotificationsEnabled(ctx context.Context, name string) 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) 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) 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) ReflectRuntime() pkgplugins.ReflectPlatform
- 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) SetReflectRuntimeServices(services pkgplugins.ReflectPlatform)
- 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 WithReflectRuntimeServices(services pkgplugins.ReflectPlatform) Option
- func WithSchedulerService(service SchedulerBackend) Option
- func WithSkillStore(store skills.Store) Option
- func WithStateStore(store StateStoreBackend) Option
- type ProviderType
- type ReflectPlatform
- func (s *ReflectPlatform) BuildProviders(api, apiKey, baseURL string) (*providers.Registry, error)
- func (s *ReflectPlatform) Memory() memory.Provider
- func (s *ReflectPlatform) ParentContext() context.Context
- func (s *ReflectPlatform) Set(parent context.Context, mem memory.Provider, store config.Store, ...)
- func (s *ReflectPlatform) Store() pkgplugins.ReflectStore
- func (s *ReflectPlatform) Workspace() string
- 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(pluginID string, runtimeName string) (pkgplugins.RuntimeHandle, bool)
- func (h *RuntimeHost) Lookup(pluginID string, runtimeName string) (pkgplugins.RuntimeHandle, bool)
- func (h *RuntimeHost) Snapshot(ctx context.Context, pluginID 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 ¶ added in v0.16.0
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 auth.AuthStore) pkgplugins.Auth
func NewSkillStoreAdapter ¶ added in v0.13.0
func NewSkillStoreAdapter(s skills.Store) pkgplugins.SkillStore
NewSkillStoreAdapter wraps an internal/skills.Store as a pkgplugins.SkillStore. 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 ¶ added in v0.16.0
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) AddMemory ¶
func (h *Host) AddMemory(reg pkgplugins.MemorySpec)
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 ¶ added in v0.16.0
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 ¶ added in v0.16.0
func (h *Host) AllBundledSkillSpecs() []pkgplugins.BundledSkillSpec
func (*Host) AllSessionEnvSpecs ¶ added in v0.16.0
func (h *Host) AllSessionEnvSpecs() []pkgplugins.SessionEnvSpec
func (*Host) ApplyChannel ¶ added in v0.10.0
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 plugintools.BuildContext) []tools.Tool
func (*Host) BuildMemory ¶
func (*Host) BuildProvider ¶
func (*Host) BuildProviderRegistry ¶
func (*Host) BundledSkillSpecs ¶ added in v0.16.0
func (h *Host) BundledSkillSpecs(pluginID string) []pkgplugins.BundledSkillSpec
func (*Host) ChannelConfigured ¶
func (*Host) ChannelInstanceConfigured ¶ added in v0.10.0
func (*Host) ChannelNotificationsEnabled ¶
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) ListAdminVisiblePlugins ¶
func (h *Host) ListAdminVisiblePlugins(ctx context.Context) ([]pkgplugins.RegisteredPlugin, error)
func (*Host) ListChannels ¶ added in v0.10.0
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) 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) ReflectRuntime ¶
func (h *Host) ReflectRuntime() pkgplugins.ReflectPlatform
ReflectRuntime returns the injected reflect runtime service extension, if any.
func (*Host) RegisterManifestPlugins ¶ added in v0.16.0
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 ¶ added in v0.16.0
func (h *Host) SessionEnvSpecs(pluginID string) []pkgplugins.SessionEnvSpec
func (*Host) SessionPluginView ¶ added in v0.16.0
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) SetReflectRuntimeServices ¶
func (h *Host) SetReflectRuntimeServices(services pkgplugins.ReflectPlatform)
SetReflectRuntimeServices updates the reflect runtime 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 ¶ added in v0.13.0
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 ¶ added in v0.13.0
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 WithReflectRuntimeServices ¶
func WithReflectRuntimeServices(services pkgplugins.ReflectPlatform) Option
WithReflectRuntimeServices injects the narrow services used by the reflect managed runtime.
func WithSchedulerService ¶
func WithSchedulerService(service SchedulerBackend) Option
WithSchedulerService injects the host scheduler backend available to plugins.
func WithSkillStore ¶ added in v0.13.0
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 ReflectPlatform ¶
type ReflectPlatform struct {
// contains filtered or unexported fields
}
ReflectPlatform is a mutable host extension bag for the reflect managed runtime.
func NewReflectRuntimeServices ¶
func NewReflectRuntimeServices() *ReflectPlatform
func (*ReflectPlatform) BuildProviders ¶
func (s *ReflectPlatform) BuildProviders(api, apiKey, baseURL string) (*providers.Registry, error)
func (*ReflectPlatform) Memory ¶
func (s *ReflectPlatform) Memory() memory.Provider
func (*ReflectPlatform) ParentContext ¶
func (s *ReflectPlatform) ParentContext() context.Context
func (*ReflectPlatform) Store ¶
func (s *ReflectPlatform) Store() pkgplugins.ReflectStore
func (*ReflectPlatform) Workspace ¶
func (s *ReflectPlatform) Workspace() string
type RuntimeHost ¶
type RuntimeHost struct {
// contains filtered or unexported fields
}
func NewRuntimeHost ¶
func NewRuntimeHost(host *Host) *RuntimeHost
func (*RuntimeHost) ApplyChannel ¶ added in v0.10.0
func (*RuntimeHost) ApplyPlugin ¶
func (h *RuntimeHost) ApplyPlugin(ctx context.Context, pluginID string) error
func (*RuntimeHost) Get ¶
func (h *RuntimeHost) Get(pluginID string, runtimeName string) (pkgplugins.RuntimeHandle, bool)
func (*RuntimeHost) Lookup ¶
func (h *RuntimeHost) Lookup(pluginID string, runtimeName string) (pkgplugins.RuntimeHandle, bool)
func (*RuntimeHost) Snapshot ¶
func (h *RuntimeHost) Snapshot(ctx context.Context, pluginID 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.