skillruntime

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MPL-2.0 Imports: 24 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(identity string) bool

func (*Installed) Render

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

type ListProvidedSkillsRequest

type ListProvidedSkillsRequest struct {
	WorkspaceRootID artifactstore.RootID `json:"workspaceRootID,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(identity string) 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 {
	WorkspaceRootID artifactstore.RootID `json:"workspaceRootID,omitempty"`
	Identity        string               `json:"identity"                  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"`
	Identity  string            `json:"identity"`
	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      []artifactstore.Diagnostic      `json:"diagnostics,omitempty"`
}

type Scope

type Scope struct {
	WorkspaceRootID artifactstore.RootID `json:"workspaceRootID,omitempty"`
}

type Skill

type Skill struct {
	Identity string `json:"identity"`
	Origin   Origin `json:"origin"`

	InstalledRef      *skillstoreSpec.SkillRef `json:"installedRef,omitempty"`
	WorkspaceRootID   artifactstore.RootID     `json:"workspaceRootID,omitempty"`
	WorkspaceRecordID artifactstore.RecordID   `json:"workspaceRecordID,omitempty"`
	RecordRevision    uint64                   `json:"recordRevision,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"`
	Shadowed       bool   `json:"shadowed"`
	ShadowedBy     string `json:"shadowedBy,omitempty"`

	DefinitionDigest string                     `json:"definitionDigest,omitempty"`
	SourceID         artifactstore.SourceID     `json:"sourceID,omitempty"`
	Locator          artifactstore.Locator      `json:"locator,omitempty"`
	Diagnostics      []artifactstore.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) CloseSkillSession

func (*SkillRuntime) CreateSkillSession

func (*SkillRuntime) GetSkillsPrompt

func (*SkillRuntime) InvokeSkillTool

func (*SkillRuntime) ListRuntimeSkills

func (*SkillRuntime) RemoveWorkspace

func (s *SkillRuntime) RemoveWorkspace(
	ctx context.Context,
	rootID artifactstore.RootID,
) error

func (*SkillRuntime) RenderSkill

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,
	rootID artifactstore.RootID,
) 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) Owns(identity string) bool

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