Documentation
¶
Index ¶
- Variables
- type ArtifactRouter
- func (r *ArtifactRouter) ListCollectionSkills(ctx context.Context, ref collection.CollectionRef) ([]ResolvedArtifactSkill, error)
- func (r *ArtifactRouter) Register(kind basespec.CollectionKind, loader ArtifactSkillLoader) error
- func (r *ArtifactRouter) ResolveArtifactSkill(ctx context.Context, ref artifact.ArtifactRef) (ResolvedArtifactSkill, error)
- type ArtifactSkillLoader
- type ArtifactSkillSummary
- type CloseSkillSessionRequest
- type CloseSkillSessionResponse
- type CreateSkillSessionRequest
- type CreateSkillSessionRequestBody
- type CreateSkillSessionResponse
- type CreateSkillSessionResponseBody
- type GetSkillsPromptRequest
- type GetSkillsPromptRequestBody
- type GetSkillsPromptResponse
- type GetSkillsPromptResponseBody
- type InvokeSkillToolRequest
- type InvokeSkillToolRequestBody
- type InvokeSkillToolResponse
- type InvokeSkillToolResponseBody
- type JSONRawString
- type ListRuntimeSkillsRequest
- type ListRuntimeSkillsRequestBody
- type ListRuntimeSkillsResponse
- type ListRuntimeSkillsResponseBody
- type RenderSkillRequest
- type RenderSkillRequestBody
- type RenderSkillResponse
- type RenderSkillResponseBody
- type ResolvedArtifactSkill
- type RuntimeSkillFilter
- type RuntimeSkillListItem
- type SkillRuntime
- func (s *SkillRuntime) AgentSkillsRuntime() *agentskills.Runtime
- func (s *SkillRuntime) Close()
- func (s *SkillRuntime) CloseSkillSession(ctx context.Context, req *CloseSkillSessionRequest) (*CloseSkillSessionResponse, error)
- func (s *SkillRuntime) CreateSkillSession(ctx context.Context, req *CreateSkillSessionRequest) (*CreateSkillSessionResponse, error)
- func (s *SkillRuntime) DescribeArtifactSkill(ctx context.Context, ref artifact.ArtifactRef) (ArtifactSkillSummary, error)
- func (s *SkillRuntime) GetSkillsPrompt(ctx context.Context, req *GetSkillsPromptRequest) (*GetSkillsPromptResponse, error)
- func (s *SkillRuntime) InvokeSkillTool(ctx context.Context, req *InvokeSkillToolRequest) (*InvokeSkillToolResponse, error)
- func (s *SkillRuntime) ListRuntimeSkills(ctx context.Context, req *ListRuntimeSkillsRequest) (*ListRuntimeSkillsResponse, error)
- func (s *SkillRuntime) ManagedCollectionRefs() []collection.CollectionRef
- func (s *SkillRuntime) RemoveCollection(ctx context.Context, ref collection.CollectionRef) error
- func (s *SkillRuntime) RenderSkill(ctx context.Context, req *RenderSkillRequest) (*RenderSkillResponse, error)
- func (s *SkillRuntime) ResyncCollection(ctx context.Context, ref collection.CollectionRef) error
- func (s *SkillRuntime) RunScriptsEnabled() bool
- func (s *SkillRuntime) WarmCollections(ctx context.Context, refs []collection.CollectionRef) error
- type SkillRuntimeOption
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidRequest = errors.New("invalid Skill runtime request") ErrSkillNotFound = errors.New("runtime Skill not found") )
Functions ¶
This section is empty.
Types ¶
type ArtifactRouter ¶
type ArtifactRouter struct {
// contains filtered or unexported fields
}
func NewArtifactRouter ¶
func NewArtifactRouter( artifacts artifact.Reader, collections collection.Reader, ) (*ArtifactRouter, error)
func (*ArtifactRouter) ListCollectionSkills ¶
func (r *ArtifactRouter) ListCollectionSkills( ctx context.Context, ref collection.CollectionRef, ) ([]ResolvedArtifactSkill, error)
func (*ArtifactRouter) Register ¶
func (r *ArtifactRouter) Register( kind basespec.CollectionKind, loader ArtifactSkillLoader, ) error
func (*ArtifactRouter) ResolveArtifactSkill ¶
func (r *ArtifactRouter) ResolveArtifactSkill( ctx context.Context, ref artifact.ArtifactRef, ) (ResolvedArtifactSkill, error)
type ArtifactSkillLoader ¶
type ArtifactSkillLoader interface {
ResolveArtifactSkill(
ctx context.Context,
ref artifact.ArtifactRef,
) (ResolvedArtifactSkill, error)
ListCollectionSkills(
ctx context.Context,
ref collection.CollectionRef,
) ([]ResolvedArtifactSkill, error)
}
ArtifactSkillLoader is implemented by feature adapters. It does not decide ownership from a durable reference shape. ArtifactRouter resolves ownership from the Artifact Record and its current Collection membership first.
type ArtifactSkillSummary ¶
type ArtifactSkillSummary struct {
Artifact artifact.ArtifactRef
IsEnabled bool
Insert agentskillsSpec.SkillInsert
HasArguments bool
HasResources bool
}
ArtifactSkillSummary is the runtime-derived summary used by durable selection validators. It contains no filesystem path and no process-local SkillDef identity.
type CloseSkillSessionRequest ¶
type CloseSkillSessionRequest struct {
SessionID agentskillsSpec.SessionID `path:"sessionID" required:"true"`
}
type CloseSkillSessionResponse ¶
type CloseSkillSessionResponse struct{}
type CreateSkillSessionRequest ¶
type CreateSkillSessionRequest struct {
Body *CreateSkillSessionRequestBody
}
CreateSkillSessionRequest creates a session using Artifact Store identities.
type CreateSkillSessionRequestBody ¶
type CreateSkillSessionRequestBody struct {
// Optional: close this previous session (best-effort) before creating a new one.
CloseSessionID agentskillsSpec.SessionID `json:"closeSessionID,omitempty"`
MaxActivePerSession int `json:"maxActivePerSession,omitempty"`
AllowArtifacts []artifact.ArtifactRef `json:"allowArtifacts,omitempty"`
ActiveArtifacts []artifact.ArtifactRef `json:"activeArtifacts,omitempty"`
}
type CreateSkillSessionResponse ¶
type CreateSkillSessionResponse struct {
Body *CreateSkillSessionResponseBody
}
type CreateSkillSessionResponseBody ¶
type CreateSkillSessionResponseBody struct {
SessionID agentskillsSpec.SessionID `json:"sessionID"`
ActiveArtifacts []artifact.ArtifactRef `json:"activeArtifacts"`
}
type GetSkillsPromptRequest ¶
type GetSkillsPromptRequest struct {
Body *GetSkillsPromptRequestBody
}
type GetSkillsPromptRequestBody ¶
type GetSkillsPromptRequestBody struct {
Filter *RuntimeSkillFilter `json:"filter,omitempty"`
}
type GetSkillsPromptResponse ¶
type GetSkillsPromptResponse struct {
Body *GetSkillsPromptResponseBody
}
type GetSkillsPromptResponseBody ¶
type GetSkillsPromptResponseBody struct {
Prompt string `json:"prompt"`
}
type InvokeSkillToolRequest ¶
type InvokeSkillToolRequest struct {
Body *InvokeSkillToolRequestBody
}
type InvokeSkillToolRequestBody ¶
type InvokeSkillToolRequestBody struct {
SessionID agentskillsSpec.SessionID `json:"sessionID" required:"true"`
ToolName string `json:"toolName" required:"true"` // "skills-load" | "skills-unload" | "skills-readresource" | "skills-runscript"
Args JSONRawString `json:"args,omitempty"` // JSON object string
}
type InvokeSkillToolResponse ¶
type InvokeSkillToolResponse struct {
Body *InvokeSkillToolResponseBody
}
type InvokeSkillToolResponseBody ¶
type InvokeSkillToolResponseBody struct {
Outputs []llmtoolsSpec.ToolOutputUnion `json:"outputs,omitempty"`
Meta map[string]any `json:"meta,omitempty"`
IsBuiltIn bool `json:"isBuiltIn"`
IsError bool `json:"isError,omitempty"`
ErrorMessage string `json:"errorMessage,omitempty"`
}
type JSONRawString ¶
type JSONRawString = string
JSONRawString mirrors the ToolRuntime API style; it's a raw JSON string.
type ListRuntimeSkillsRequest ¶
type ListRuntimeSkillsRequest struct {
Body *ListRuntimeSkillsRequestBody
}
type ListRuntimeSkillsRequestBody ¶
type ListRuntimeSkillsRequestBody struct {
Filter *RuntimeSkillFilter `json:"filter,omitempty"`
}
type ListRuntimeSkillsResponse ¶
type ListRuntimeSkillsResponse struct {
Body *ListRuntimeSkillsResponseBody
}
type ListRuntimeSkillsResponseBody ¶
type ListRuntimeSkillsResponseBody struct {
Skills []RuntimeSkillListItem `json:"skills"`
}
type RenderSkillRequest ¶
type RenderSkillRequest struct {
Body *RenderSkillRequestBody
}
type RenderSkillRequestBody ¶
type RenderSkillRequestBody struct {
Artifact artifact.ArtifactRef `json:"artifact" required:"true"`
Arguments map[string]string `json:"arguments,omitempty"`
}
type RenderSkillResponse ¶
type RenderSkillResponse struct {
Body *RenderSkillResponseBody
}
type RenderSkillResponseBody ¶
type RenderSkillResponseBody struct {
Text string `json:"text"`
Insert agentskillsSpec.SkillInsert `json:"insert"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
DisplayName string `json:"displayName,omitempty"`
// SourceTags are tags parsed from SKILL.md frontmatter.
SourceTags []string `json:"sourceTags,omitempty"`
Resources agentskillsSpec.SkillResourceInfo `json:"resources"`
Arguments []agentskillsSpec.SkillArgument `json:"arguments,omitempty"`
AppliedArguments map[string]string `json:"appliedArguments,omitempty"`
RawFrontmatter map[string]any `json:"rawFrontmatter,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
type ResolvedArtifactSkill ¶
type ResolvedArtifactSkill struct {
Artifact artifact.ArtifactRef
Collection collection.CollectionRef
Definition agentskillsSpec.SkillDef
Version string
}
func (ResolvedArtifactSkill) Validate ¶
func (s ResolvedArtifactSkill) Validate() error
type RuntimeSkillFilter ¶
type RuntimeSkillFilter struct {
Types []string `json:"types,omitempty"`
Inserts []agentskillsSpec.SkillInsert `json:"inserts,omitempty"`
LocationPrefix string `json:"locationPrefix,omitempty"`
AllowArtifacts []artifact.ArtifactRef `json:"allowArtifacts,omitempty"`
SessionID agentskillsSpec.SessionID `json:"sessionID,omitempty"`
Activity agentskillsSpec.SkillActivity `json:"activity,omitempty"`
}
type RuntimeSkillListItem ¶
type RuntimeSkillListItem struct {
SkillRef artifact.ArtifactRef `json:"skillRef"`
// Copy of the runtime-facing identity fields (excluding Location) + runtime-indexed metadata.
// These are read-only and exist only for display/debug.
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"`
DisplayName string `json:"displayName,omitempty"`
Description string `json:"description,omitempty"`
Digest string `json:"digest,omitempty"`
Insert agentskillsSpec.SkillInsert `json:"insert,omitempty"`
Arguments []agentskillsSpec.SkillArgument `json:"arguments,omitempty"`
// SourceTags are tags parsed from SKILL.md frontmatter.
SourceTags []string `json:"sourceTags,omitempty"`
Resources agentskillsSpec.SkillResourceInfo `json:"resources"`
RawFrontmatter map[string]any `json:"rawFrontmatter,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Session-scoped.
IsActive bool `json:"isActive,omitempty"`
// Runtime/provider error (if any) for this skill record.
ErrorMessage string `json:"errorMessage,omitempty"`
}
RuntimeSkillListItem is keyed only by durable Artifact Store identity. SkillDef is intentionally process-local and never exposed.
type SkillRuntime ¶
type SkillRuntime struct {
// contains filtered or unexported fields
}
SkillRuntime owns the in-memory Agent Skills catalog, provider lifecycle, sessions, prompt generation, rendering, and tool invocation.
func NewSkillRuntime ¶
func NewSkillRuntime( opts ...SkillRuntimeOption, ) (*SkillRuntime, error)
NewSkillRuntime creates an Artifact-backed Agent Skills runtime. Durable Skill identity is always artifact.ArtifactRef; no standalone Skill Store, bundle slug, legacy Skill ID, or source location enters this package.
func (*SkillRuntime) AgentSkillsRuntime ¶
func (s *SkillRuntime) AgentSkillsRuntime() *agentskills.Runtime
func (*SkillRuntime) Close ¶
func (s *SkillRuntime) Close()
func (*SkillRuntime) CloseSkillSession ¶
func (s *SkillRuntime) CloseSkillSession( ctx context.Context, req *CloseSkillSessionRequest, ) (*CloseSkillSessionResponse, error)
func (*SkillRuntime) CreateSkillSession ¶
func (s *SkillRuntime) CreateSkillSession( ctx context.Context, req *CreateSkillSessionRequest, ) (*CreateSkillSessionResponse, error)
func (*SkillRuntime) DescribeArtifactSkill ¶
func (s *SkillRuntime) DescribeArtifactSkill( ctx context.Context, ref artifact.ArtifactRef, ) (ArtifactSkillSummary, error)
DescribeArtifactSkill resolves and indexes a selected ArtifactRef through the ownership router before reading Agent Skills metadata. The Artifact record and its Collection membership, rather than reference shape, decide the owning feature adapter.
func (*SkillRuntime) GetSkillsPrompt ¶
func (s *SkillRuntime) GetSkillsPrompt( ctx context.Context, req *GetSkillsPromptRequest, ) (*GetSkillsPromptResponse, error)
func (*SkillRuntime) InvokeSkillTool ¶
func (s *SkillRuntime) InvokeSkillTool( ctx context.Context, req *InvokeSkillToolRequest, ) (*InvokeSkillToolResponse, error)
func (*SkillRuntime) ListRuntimeSkills ¶
func (s *SkillRuntime) ListRuntimeSkills( ctx context.Context, req *ListRuntimeSkillsRequest, ) (*ListRuntimeSkillsResponse, error)
func (*SkillRuntime) ManagedCollectionRefs ¶
func (s *SkillRuntime) ManagedCollectionRefs() []collection.CollectionRef
ManagedCollectionRefs returns derived runtime partitions. Collection kind is deliberately not encoded in a Skill reference; application feature synchronizers use their own typed Collection discovery to decide removal.
func (*SkillRuntime) RemoveCollection ¶
func (s *SkillRuntime) RemoveCollection( ctx context.Context, ref collection.CollectionRef, ) error
func (*SkillRuntime) RenderSkill ¶
func (s *SkillRuntime) RenderSkill( ctx context.Context, req *RenderSkillRequest, ) (*RenderSkillResponse, error)
func (*SkillRuntime) ResyncCollection ¶
func (s *SkillRuntime) ResyncCollection( ctx context.Context, ref collection.CollectionRef, ) error
func (*SkillRuntime) RunScriptsEnabled ¶
func (s *SkillRuntime) RunScriptsEnabled() bool
RunScriptsEnabled reports the effective shared filesystem-provider policy. Inference composition uses this value only to decide whether skills-runscript is advertised to the model.
func (*SkillRuntime) WarmCollections ¶
func (s *SkillRuntime) WarmCollections( ctx context.Context, refs []collection.CollectionRef, ) error
WarmCollections best-effort warms process-local runtime registrations for known Collections. It is intended for optional background startup warmup.
Durable Artifact Store state remains authoritative. Failed Collections are omitted from this pass and can be resolved again through normal lazy foreground reconciliation.
type SkillRuntimeOption ¶
type SkillRuntimeOption func(*skillRuntimeOptions) error
func WithArtifactResolver ¶
func WithArtifactResolver( value *ArtifactRouter, ) SkillRuntimeOption
func WithRunScripts ¶
func WithRunScripts(enabled bool) SkillRuntimeOption
WithRunScripts configures the shared filesystem-provider execution policy. Workspace filesystem skills and installed filesystem skills always use this same provider and therefore this same policy.
func WithRuntime ¶
func WithRuntime(value *agentskills.Runtime) SkillRuntimeOption