skillruntime

package
v0.2.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Installed

type Installed struct {
	// contains filtered or unexported fields
}

func NewInstalled

func NewInstalled(value *skillstore.SkillStore, runtime *SkillRuntime) (*Installed, error)

func (*Installed) List

func (p *Installed) List(ctx context.Context, _ Scope) ([]Skill, error)

func (*Installed) Owns

func (*Installed) Owns(ref spec.SkillRef) bool

func (*Installed) Render

func (p *Installed) Render(ctx context.Context, request RenderRequest) (RenderedSkill, error)

type ListProvidedSkillsRequest

type ListProvidedSkillsRequest struct {
	Workspace *collection.CollectionRef `json:"workspace,omitempty"`
}

type ListProvidedSkillsResponse

type ListProvidedSkillsResponse struct {
	Body *ListProvidedSkillsResponseBody
}

type ListProvidedSkillsResponseBody

type ListProvidedSkillsResponseBody struct {
	Skills []Skill `json:"skills"`
}

type Origin

type Origin string
const (
	OriginInstalled Origin = "installed"
	OriginWorkspace Origin = "workspace"
)

type Provider

type Provider interface {
	Owns(ref skillruntimeSpec.SkillRef) bool
	List(ctx context.Context, scope Scope) ([]Skill, error)
	Render(ctx context.Context, request RenderRequest) (RenderedSkill, error)
}

type RenderProvidedSkillRequest

type RenderProvidedSkillRequest struct {
	Body *RenderProvidedSkillRequestBody
}

type RenderProvidedSkillRequestBody

type RenderProvidedSkillRequestBody struct {
	Workspace *collection.CollectionRef `json:"workspace,omitempty"`
	Ref       skillruntimeSpec.SkillRef `json:"ref"                 required:"true"`
	Arguments map[string]string         `json:"arguments,omitempty"`
}

type RenderProvidedSkillResponse

type RenderProvidedSkillResponse struct {
	Body *RenderedSkill
}

type RenderRequest

type RenderRequest struct {
	Scope     Scope                     `json:"scope"`
	Ref       skillruntimeSpec.SkillRef `json:"ref"`
	Arguments map[string]string         `json:"arguments,omitempty"`
}

type RenderedSkill

type RenderedSkill struct {
	Skill            Skill                           `json:"skill"`
	Available        bool                            `json:"available"`
	Text             string                          `json:"text,omitempty"`
	Insert           agentskillsSpec.SkillInsert     `json:"insert,omitempty"`
	Arguments        []agentskillsSpec.SkillArgument `json:"arguments,omitempty"`
	AppliedArguments map[string]string               `json:"appliedArguments,omitempty"`
	Diagnostics      []diagnostic.Diagnostic         `json:"diagnostics,omitempty"`
}

type Scope

type Scope struct {
	Workspace *collection.CollectionRef `json:"workspace,omitempty"`
}

type Skill

type Skill struct {
	Ref    skillruntimeSpec.SkillRef `json:"ref"`
	Origin Origin                    `json:"origin"`

	InstalledRef     *skillstoreSpec.SkillRef  `json:"installedRef,omitempty"`
	Workspace        *collection.CollectionRef `json:"workspace,omitempty"`
	ArtifactRevision uint64                    `json:"artifactRevision,omitempty"`

	Name        string                          `json:"name"`
	DisplayName string                          `json:"displayName"`
	Description string                          `json:"description"`
	Insert      agentskillsSpec.SkillInsert     `json:"insert"`
	Arguments   []agentskillsSpec.SkillArgument `json:"arguments,omitempty"`
	Tags        []string                        `json:"tags,omitempty"`

	Enabled        bool `json:"enabled"`
	Available      bool `json:"available"`
	RuntimeAllowed bool `json:"runtimeAllowed"`
	BuiltIn        bool `json:"builtIn"`

	CatalogCurrent bool   `json:"catalogCurrent"`
	State          string `json:"state,omitempty"`

	DefinitionDigest string                  `json:"definitionDigest,omitempty"`
	SourceID         basespec.SourceID       `json:"sourceID,omitempty"`
	Locator          basespec.Locator        `json:"locator,omitempty"`
	Diagnostics      []diagnostic.Diagnostic `json:"diagnostics,omitempty"`

	CreatedAt  time.Time `json:"createdAt"`
	ModifiedAt time.Time `json:"modifiedAt"`
}

func (Skill) Validate

func (s Skill) Validate() error

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(
	store *skillstore.SkillStore,
	opts ...SkillRuntimeOption,
) (*SkillRuntime, error)

func (*SkillRuntime) AgentSkillsRuntime

func (s *SkillRuntime) AgentSkillsRuntime() *agentskills.Runtime

func (*SkillRuntime) Close added in v0.2.13

func (s *SkillRuntime) Close()

Close stops derived-state reconciliation before the owning Skill Store is closed. Runtime registration is process-local, so no durable mutation occurs during shutdown.

func (*SkillRuntime) CloseSkillSession

func (*SkillRuntime) CreateSkillSession

func (*SkillRuntime) GetSkillsPrompt

func (*SkillRuntime) InvokeSkillTool

func (*SkillRuntime) ListRuntimeSkills

func (*SkillRuntime) ManagedWorkspaceRefs added in v0.2.13

func (s *SkillRuntime) ManagedWorkspaceRefs() []collection.CollectionRef

ManagedWorkspaceRefs returns the process-local Workspace partitions that currently have derived Agent Skills runtime state. Application composition uses this to remove a partition after a Workspace was retired or purged through a generic Artifact Store lifecycle operation.

func (*SkillRuntime) RemoveWorkspace

func (s *SkillRuntime) RemoveWorkspace(
	ctx context.Context,
	workspace collection.CollectionRef,
) error

func (*SkillRuntime) RenderSkill

func (*SkillRuntime) RequestInstalledResync added in v0.2.13

func (s *SkillRuntime) RequestInstalledResync()

RequestInstalledResync schedules one coalesced reconciliation of the legacy standalone Skill Store partition. It intentionally does not make a durable Skill Store mutation fail after persistence has committed.

func (*SkillRuntime) RequestWorkspaceRemoval added in v0.2.13

func (s *SkillRuntime) RequestWorkspaceRemoval(
	workspace collection.CollectionRef,
)

RequestWorkspaceRemoval schedules removal of one retired Workspace's derived Agent Skills runtime partition.

func (*SkillRuntime) RequestWorkspaceResync added in v0.2.13

func (s *SkillRuntime) RequestWorkspaceResync(
	workspace collection.CollectionRef,
)

RequestWorkspaceResync schedules one coalesced rebuild of a Workspace's derived Agent Skills runtime partition. Durable Workspace mutations must not wait for this rebuild or report its transient failures as metadata failures.

func (*SkillRuntime) ResyncInstalled

func (s *SkillRuntime) ResyncInstalled(ctx context.Context) error

ResyncInstalled updates only the installed desired partition. Runtime ownership is tracked independently from provider type because installed and Workspace filesystem skills both intentionally use provider type "fs".

func (*SkillRuntime) ResyncWorkspace

func (s *SkillRuntime) ResyncWorkspace(
	ctx context.Context,
	workspace 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) Store

func (s *SkillRuntime) Store() *skillstore.SkillStore

type SkillRuntimeOption

type SkillRuntimeOption func(*skillRuntimeOptions) error

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

func WithWorkspaceSkillAdapter

func WithWorkspaceSkillAdapter(
	value *skilladapter.Adapter,
) SkillRuntimeOption

type Workspace

type Workspace struct {
	// contains filtered or unexported fields
}

func NewWorkspace

func NewWorkspace(
	runtime *SkillRuntime,
) (*Workspace, error)

func (*Workspace) List

func (p *Workspace) List(
	ctx context.Context,
	scope Scope,
) ([]Skill, error)

func (*Workspace) Owns

func (*Workspace) Render

func (p *Workspace) Render(
	ctx context.Context,
	request RenderRequest,
) (RenderedSkill, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL