workspaceadapter

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

func NewAdapter

func NewAdapter(
	query WorkspaceDataSource,
	runtimePolicy artifactadapter.SourceUsePolicy,
	resourceAPI ArtifactResourceReader,
) (*Adapter, error)

func (*Adapter) List

func (f *Adapter) List(
	ctx context.Context,
	workspace collection.CollectionRef,
) ([]WorkspaceSkill, error)

func (*Adapter) Load

func (f *Adapter) Load(
	ctx context.Context,
	workspace collection.CollectionRef,
	artifactRefs []artifact.ArtifactRef,
) (SkillLoadPlan, error)

func (*Adapter) LoadAll added in v0.2.21

func (f *Adapter) LoadAll(
	ctx context.Context,
	workspace collection.CollectionRef,
) (SkillLoadPlan, error)

LoadAll resolves every currently runtime-eligible Workspace Skill. It is used by the Skill catalog bridge, which must fail closed when one selected runtime registration cannot be materialized.

func (*Adapter) LoadArtifact

func (f *Adapter) LoadArtifact(
	ctx context.Context,
	ref artifact.ArtifactRef,
) (WorkspaceSkill, error)

type ArtifactResourceReader added in v0.2.21

type ArtifactResourceReader interface {
	ResolveVerifiedLocalPath(
		ctx context.Context,
		resolved resource.ResolvedArtifact,
		localLocator basespec.Locator,
	) (string, error)

	SupportsLocalPath(
		kind source.SourceKind,
	) bool
}

type SkillArgument

type SkillArgument struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Default     string `json:"default,omitempty"`
}

type SkillLoadPlan

type SkillLoadPlan struct {
	Workspace       collection.CollectionRef `json:"workspace"`
	CatalogRevision uint64                   `json:"catalogRevision"`
	Skills          []WorkspaceSkill         `json:"skills"`
	Diagnostics     []diagnostic.Diagnostic  `json:"diagnostics,omitempty"`
}

type SkillSummary

type SkillSummary struct {
	SchemaVersion string              `json:"schemaVersion"`
	ID            artifact.ArtifactID `json:"id"`
	Slug          string              `json:"slug"`
	Name          string              `json:"name"`
	DisplayName   string              `json:"displayName"`
	Description   string              `json:"description"`
	Tags          []string            `json:"tags,omitempty"`
	Insert        string              `json:"insert"`
	Arguments     []SkillArgument     `json:"arguments,omitempty"`
	IsEnabled     bool                `json:"isEnabled"`
	CreatedAt     time.Time           `json:"createdAt"`
	ModifiedAt    time.Time           `json:"modifiedAt"`
}

type StoreLoader

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

StoreLoader adapts Workspace-owned Artifact projection to the generic Artifact Skill router. Runtime does not import Workspace and cannot infer Workspace ownership from a reference shape.

func NewStoreLoader

func NewStoreLoader(adapter *Adapter) (*StoreLoader, error)

func (*StoreLoader) ListCollectionSkills

func (r *StoreLoader) ListCollectionSkills(
	ctx context.Context,
	workspace collection.CollectionRef,
) ([]skillAggregate.ResolvedArtifactSkill, error)

func (*StoreLoader) ResolveArtifactSkill

func (r *StoreLoader) ResolveArtifactSkill(
	ctx context.Context,
	ref artifact.ArtifactRef,
) (skillAggregate.ResolvedArtifactSkill, error)

type WorkspaceDataSource added in v0.2.21

type WorkspaceDataSource interface {
	Catalog(
		ctx context.Context,
		workspace collection.CollectionRef,
	) (workspaceDomain.CatalogView, error)

	ResolveArtifact(
		ctx context.Context,
		ref artifact.ArtifactRef,
	) (workspaceDomain.Workspace, workspaceDomain.Resource, error)

	ComposeLoadPlanFromCatalog(
		view workspaceDomain.CatalogView,
		artifactRefs []artifact.ArtifactRef,
	) (workspaceDomain.LoadPlan, error)
}

type WorkspaceSkill

type WorkspaceSkill struct {
	Workspace        collection.CollectionRef `json:"workspace"`
	Artifact         artifact.ArtifactRef     `json:"artifact"`
	DefinitionDigest cryptoutil.Digest        `json:"definitionDigest"`
	SourceID         source.SourceID          `json:"sourceID"`
	Locator          basespec.Locator         `json:"locator"`
	Skill            SkillSummary             `json:"skill"`
	MarkdownBody     string                   `json:"markdownBody,omitempty"`
	ArtifactRevision uint64                   `json:"artifactRevision"`
	State            artifact.State           `json:"state"`
	CatalogCurrent   bool                     `json:"catalogCurrent"`
	WorkspaceEnabled bool                     `json:"-"`
	RuntimeDisabled  bool                     `json:"runtimeDisabled"`
	Diagnostics      []diagnostic.Diagnostic  `json:"diagnostics,omitempty"`

	ProjectionValid     bool              `json:"-"`
	RuntimePathBacked   bool              `json:"-"`
	SourceContentDigest cryptoutil.Digest `json:"-"`
	SourceGeneration    string            `json:"-"`
	RuntimeLocation     string            `json:"-"`
}

Jump to

Keyboard shortcuts

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