Documentation
¶
Index ¶
- type Option
- type Runtime
- func (r *Runtime) AddSkill(ctx context.Context, def spec.SkillDef) (spec.SkillRecord, error)
- func (r *Runtime) CloseSession(ctx context.Context, sid spec.SessionID) error
- func (r *Runtime) ListSkills(ctx context.Context, filter *SkillListFilter) ([]spec.SkillRecord, error)
- func (r *Runtime) NewSession(ctx context.Context, opts ...SessionOption) (spec.SessionID, []spec.SkillDef, error)
- func (r *Runtime) NewSessionRegistry(ctx context.Context, sid spec.SessionID, opts ...llmtools.RegistryOption) (*llmtools.Registry, error)
- func (r *Runtime) ProviderTypes() []string
- func (r *Runtime) RemoveSkill(ctx context.Context, def spec.SkillDef) (spec.SkillRecord, error)
- func (r *Runtime) SkillsPromptXML(ctx context.Context, f *SkillFilter) (string, error)
- type SessionOption
- type SkillFilter
- type SkillListFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*runtimeOptions) error
func WithLogger ¶
func WithMaxActivePerSession ¶
func WithMaxSessions ¶
func WithProvider ¶
func WithProvider(p spec.SkillProvider) Option
func WithProvidersByType ¶ added in v0.7.0
func WithProvidersByType(m map[string]spec.SkillProvider) Option
func WithSessionTTL ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func (*Runtime) AddSkill ¶
AddSkill indexes and registers a skill into the runtime-owned catalog.
IMPORTANT CONTRACT:
- This is a HOST/LIFECYCLE API.
- It accepts and returns only the user-provided skill definition (spec.SkillDef).
- Provider canonicalization/cleanup is internal only and MUST NOT be exposed via this API.
func (*Runtime) CloseSession ¶
func (*Runtime) ListSkills ¶
func (r *Runtime) ListSkills(ctx context.Context, filter *SkillListFilter) ([]spec.SkillRecord, error)
ListSkills lists skills for HOST/LIFECYCLE usage.
IMPORTANT CONTRACT:
- Returns only user-provided skill definitions in SkillRecord.Def.
- Filters (NamePrefix/LocationPrefix) apply to user-provided Def fields (not LLM-facing names).
func (*Runtime) NewSession ¶
func (r *Runtime) NewSession(ctx context.Context, opts ...SessionOption) (spec.SessionID, []spec.SkillDef, error)
NewSession creates a new session.
IMPORTANT CONTRACT:
- This is a HOST/LIFECYCLE API.
- It accepts and returns skill definitions (spec.SkillDef), never LLM handles.
func (*Runtime) NewSessionRegistry ¶
func (*Runtime) ProviderTypes ¶
ProviderTypes returns the registered provider type keys (e.g. "fs").
func (*Runtime) RemoveSkill ¶
RemoveSkill removes a skill from the catalog (and prunes it from all sessions).
IMPORTANT CONTRACT:
- This is a HOST/LIFECYCLE API.
- Removal is by the exact user-provided definition that was added.
- No canonicalization-based matching is performed (to avoid internal cleanup becoming user-facing).
func (*Runtime) SkillsPromptXML ¶ added in v0.6.0
SkillsPromptXML is the single prompt API.
Output compatibility rules (to preserve previous XML “standards” as much as possible):
- If only one section is requested, the root is exactly one of:
- <availableSkills>...</availableSkills>
- <activeSkills>...</activeSkills> (matching the historical outputs from internal/catalog XML builders).
- If both sections are requested simultaneously, the output is wrapped in: <skillsPrompt> ... </skillsPrompt>
type SessionOption ¶ added in v0.6.0
type SessionOption func(*newSessionOptions) error
SessionOption configures Runtime.NewSession.
func WithSessionActiveSkills ¶ added in v0.7.0
func WithSessionActiveSkills(defs []spec.SkillDef) SessionOption
WithSessionActiveSkills sets the initial active skills for the new session (host/lifecycle defs). These are activated during session creation.
func WithSessionMaxActivePerSession ¶ added in v0.6.0
func WithSessionMaxActivePerSession(n int) SessionOption
WithSessionMaxActivePerSession overrides the max active skills for this session only. If n <= 0, it is ignored (defaults apply).
type SkillFilter ¶
type SkillFilter struct {
// Types restricts to provider types (e.g. ["fs"]). Empty means "all".
Types []string
// NamePrefix restricts to LLM-visible names with this prefix.
NamePrefix string
// LocationPrefix restricts to skills whose (user-provided) location starts with this prefix.
LocationPrefix string
// AllowSkills restricts to an explicit allowlist of host/lifecycle skill defs. Empty means "all".
AllowSkills []spec.SkillDef
// SessionID optionally scopes active/inactive filtering.
SessionID spec.SessionID
// Activity defaults to spec.SkillActivityAny.
Activity spec.SkillActivity
}
SkillFilter is an optional filter for listing/prompting skills (LLM/prompt-facing).
Semantics:
- Types/NamePrefix/LocationPrefix/AllowSkills always apply.
- SessionID (optional) allows filtering/annotating by "active in this session".
- Activity controls whether to include active, inactive, or both.
Defaults:
- Activity defaults to "any".
- If SessionID is empty, no active skills exist.
IMPORTANT CONTRACT:
- NamePrefix matches the LLM-visible computed handle name (not the host skill def name).
- LocationPrefix matches the user-provided location (not provider-canonicalized).
type SkillListFilter ¶ added in v0.7.0
type SkillListFilter struct {
Types []string
NamePrefix string
LocationPrefix string
AllowSkills []spec.SkillDef
SessionID spec.SessionID
Activity spec.SkillActivity
}
SkillListFilter is a HOST/LIFECYCLE listing filter. Unlike SkillFilter (prompt), NamePrefix applies to the user-provided skill name (def.name), not the LLM-visible computed handle name.