bundle

package
v0.2.20 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DiscoveryPolicyRevision = "skill.bundle.discovery.v1"

	RoleExternal basespec.AttachmentRole = "external"
	RoleLibrary  basespec.AttachmentRole = "library"
)
View Source
const AttachmentDataSchemaVersion = "v1"

Variables

This section is empty.

Functions

func BuiltInCollectionPackageAddress

func BuiltInCollectionPackageAddress(
	name basespec.LogicalName,
	version basespec.LogicalVersion,
) (source.ManagedPackageAddress, error)

func EncodeAttachmentData

func EncodeAttachmentData(
	value AttachmentData,
) (json.RawMessage, error)

func EncodeCollectionData

func EncodeCollectionData(value CollectionData) (json.RawMessage, error)

func NewCollectionBehavior

func NewCollectionBehavior() providerapi.CollectionBehavior

func NewShareableCodec

func NewShareableCodec() providerapi.SchemaCodec

func ValidateCollectionData

func ValidateCollectionData(value CollectionData) error

Types

type API

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

func New

func New(dependencies Dependencies) (*API, error)

func (*API) AdoptSkill

func (a *API) AdoptSkill(
	ctx context.Context,
	request AdoptSkillRequest,
) (artifact.Artifact, error)

func (*API) AttachSource

func (a *API) AttachSource(
	ctx context.Context,
	bundle collection.CollectionRef,
	expectedCollectionRevision uint64,
	draft AttachmentDraft,
) (Bundle, error)

func (*API) Close

func (a *API) Close() error

func (*API) CreateBundle

func (a *API) CreateBundle(
	ctx context.Context,
	request CreateBundleRequest,
) (Bundle, error)

func (*API) CreateManagedSkill

func (a *API) CreateManagedSkill(
	ctx context.Context,
	request CreateManagedSkillRequest,
) (CreateManagedSkillResponse, error)

func (*API) EnsureBuiltInBundleCurrent

func (a *API) EnsureBuiltInBundleCurrent(
	ctx context.Context,
	ref collection.CollectionRef,
) error

EnsureBuiltInBundleCurrent preserves startup convergence without publishing a new catalog when the protected bundle is already current. It is reserved for the trusted built-in installer and explicit built-in update paths.

func (*API) EnsureBuiltInBundleTopology

func (a *API) EnsureBuiltInBundleTopology(
	ctx context.Context,
	request BuiltInBundleTopology,
) (Bundle, error)

func (*API) GetBundle

func (a *API) GetBundle(
	ctx context.Context,
	ref collection.CollectionRef,
) (Bundle, error)

func (*API) GetManagedSkillDocument

func (a *API) GetManagedSkillDocument(
	ctx context.Context,
	ref artifact.ArtifactRef,
) (ManagedSkillDocument, error)

GetManagedSkillDocument reads the canonical definition for a managed Skill package. External and discovered Skills remain source-owned and intentionally do not expose an editable document through this API.

func (*API) GetSkill

func (a *API) GetSkill(
	ctx context.Context,
	ref artifact.ArtifactRef,
) (artifact.Artifact, error)

func (*API) InstallBuiltInCollection

func (a *API) InstallBuiltInCollection(
	ctx context.Context,
	request BuiltInCollectionInstallRequest,
) ([]CreateManagedSkillResponse, error)

func (*API) ListBundles

func (a *API) ListBundles(
	ctx context.Context,
	rootID basespec.RootID,
) ([]Bundle, error)

func (*API) ListResolvedSkills

func (a *API) ListResolvedSkills(
	ctx context.Context,
	bundle collection.CollectionRef,
) ([]ResolvedSkill, error)

ListResolvedSkills is deliberately fail-closed. A collection reconciliation must not retain a previous runtime definition when a current Artifact can no longer be projected.

func (*API) ListSkills

func (a *API) ListSkills(
	ctx context.Context,
	bundle collection.CollectionRef,
) ([]artifact.Artifact, error)

func (*API) PinSkill

func (a *API) PinSkill(
	ctx context.Context,
	request PinSkillRequest,
) (artifact.Artifact, error)

func (*API) PurgeBundle

func (a *API) PurgeBundle(
	ctx context.Context,
	ref collection.CollectionRef,
	expectedRevision uint64,
) error

func (*API) PurgeSkill

func (a *API) PurgeSkill(
	ctx context.Context,
	ref artifact.ArtifactRef,
	expectedRevision uint64,
) error

func (*API) Ready

func (a *API) Ready() error

func (*API) RefreshBundle

func (a *API) RefreshBundle(
	ctx context.Context,
	ref collection.CollectionRef,
) (refresh.Result, error)

func (*API) ResolveSkill

func (a *API) ResolveSkill(
	ctx context.Context,
	ref artifact.ArtifactRef,
) (ResolvedSkill, error)

ResolveSkill resolves one Artifact-backed Skill Bundle member.

It verifies Artifact membership, Collection kind, Collection and Artifact enablement, catalog currentness, definition compatibility, and the source snapshot generation. Source adapters and MapStore remain responsible for their own containment and filesystem behavior.

func (*API) RetireBundle

func (a *API) RetireBundle(
	ctx context.Context,
	ref collection.CollectionRef,
	expectedRevision uint64,
) (collection.Collection, error)

func (*API) SetSkillEnabled

func (a *API) SetSkillEnabled(
	ctx context.Context,
	ref artifact.ArtifactRef,
	expectedRevision uint64,
	enabled bool,
) (artifact.Artifact, error)

func (*API) UnadoptSkill

func (a *API) UnadoptSkill(
	ctx context.Context,
	ref artifact.ArtifactRef,
	expectedRevision uint64,
	suppress bool,
) error

func (*API) UpdateBundle

func (a *API) UpdateBundle(
	ctx context.Context,
	request UpdateBundleRequest,
) (Bundle, error)

type AdoptSkillRequest

type AdoptSkillRequest struct {
	Bundle                  collection.CollectionRef
	Occurrence              catalog.OccurrenceKey
	ArtifactID              basespec.ArtifactID
	ExpectedCatalogRevision uint64
	Name                    string
	Enabled                 bool
}

type AttachmentData

type AttachmentData struct {
	SchemaVersion         string                                 `json:"schemaVersion"`
	DiscoveryRoot         basespec.Locator                       `json:"discoveryRoot"`
	ExpectedMemberDigests map[basespec.Locator]cryptoutil.Digest `json:"expectedMemberDigests,omitempty"`
}

AttachmentData is Collection-owned local mount configuration. It is never portable Collection payload data. ExpectedMemberDigests keys are relative to DiscoveryRoot, not to the Source root.

func DecodeAttachmentData

func DecodeAttachmentData(
	raw json.RawMessage,
) (AttachmentData, error)

func NewAttachmentData

func NewAttachmentData(
	discoveryRoot basespec.Locator,
	expectedMemberDigests map[basespec.Locator]cryptoutil.Digest,
) (AttachmentData, error)

func (AttachmentData) Clone

func (d AttachmentData) Clone() AttachmentData

func (AttachmentData) SourceExpectedContentDigests

func (d AttachmentData) SourceExpectedContentDigests() (
	map[basespec.Locator]cryptoutil.Digest,
	error,
)

SourceExpectedContentDigests maps Collection-relative expected members into Source-relative locators used by generic Artifact Store discovery.

func (AttachmentData) Validate

func (d AttachmentData) Validate() error

type AttachmentDraft

type AttachmentDraft struct {
	SourceID              basespec.SourceID
	Role                  basespec.AttachmentRole
	Enabled               bool
	DiscoveryRoot         basespec.Locator
	ExpectedMemberDigests map[basespec.Locator]cryptoutil.Digest
}

type BuiltInBundleTopology

type BuiltInBundleTopology struct {
	RootID                basespec.RootID                        `json:"-"`
	CollectionID          basespec.CollectionID                  `json:"-"`
	SourceID              basespec.SourceID                      `json:"-"`
	LogicalName           basespec.LogicalName                   `json:"-"`
	LogicalVersion        basespec.LogicalVersion                `json:"-"`
	DisplayName           string                                 `json:"-"`
	Description           string                                 `json:"-"`
	Labels                map[string]string                      `json:"-"`
	Enabled               bool                                   `json:"-"`
	DiscoveryRoot         basespec.Locator                       `json:"-"`
	ExpectedMemberDigests map[basespec.Locator]cryptoutil.Digest `json:"-"`
}

type BuiltInCollectionInstallRequest

type BuiltInCollectionInstallRequest struct {
	Bundle                     collection.CollectionRef
	ExpectedCollectionRevision uint64
	PackageAddress             source.ManagedPackageAddress
	PackageFiles               []source.ManagedPackageFile
	Skills                     []BuiltInCollectionSkill
}

BuiltInCollectionInstallRequest is trusted installer input. It materializes exactly one complete portable Collection package in one managed Source package directory, pins all static Artifacts, and then refreshes once.

type BuiltInCollectionSkill

type BuiltInCollectionSkill struct {
	ArtifactID basespec.ArtifactID
	Member     basespec.Locator
	Enabled    bool
}

type Bundle

type Bundle struct {
	Collection  collection.Collection   `json:"collection"`
	Data        CollectionData          `json:"data"`
	Attachments []collection.Attachment `json:"attachments"`
	Sources     []source.Summary        `json:"sources"`
}

type CollectionData

type CollectionData struct {
	SchemaVersion           string                  `json:"schemaVersion"`
	DiscoveryPolicyRevision string                  `json:"discoveryPolicyRevision"`
	LogicalName             basespec.LogicalName    `json:"logicalName"`
	LogicalVersion          basespec.LogicalVersion `json:"logicalVersion,omitempty"`
	Labels                  map[string]string       `json:"labels,omitempty"`

	// ManagedSourceID identifies the managed Source provisioned exclusively
	// for this bundle. An empty value means attached Sources are externally
	// administered and are not deleted with the bundle.
	ManagedSourceID basespec.SourceID `json:"managedSourceID,omitempty"`
}

func DecodeCollectionData

func DecodeCollectionData(
	raw json.RawMessage,
) (CollectionData, error)

func (CollectionData) Clone

func (d CollectionData) Clone() CollectionData

type CreateBundleRequest

type CreateBundleRequest struct {
	RootID                  basespec.RootID
	CollectionID            basespec.CollectionID
	ManagedSourceID         basespec.SourceID
	ManagedSourceStorageKey basespec.StorageKey
	DisplayName             string
	Description             string
	Enabled                 bool
	LogicalName             basespec.LogicalName
	LogicalVersion          basespec.LogicalVersion
	Labels                  map[string]string
	Attachments             []AttachmentDraft
}

type CreateManagedSkillRequest

type CreateManagedSkillRequest struct {
	Bundle                     collection.CollectionRef
	ExpectedCollectionRevision uint64
	ArtifactID                 basespec.ArtifactID
	SkillName                  string
	SKILLMD                    []byte
	ExpectedArtifactRevision   uint64

	// Document is an optional structured authoring input. Serialization is
	// delegated to agentskills-go. It is mutually exclusive with SKILLMD.
	Document *document.SkillDocument
	Files    []source.ManagedPackageFile
	Enabled  bool
}

type CreateManagedSkillResponse

type CreateManagedSkillResponse struct {
	Artifact artifact.Artifact
	Address  artifact.ArtifactAddress
}

type Dependencies

type Dependencies struct {
	Store artifactAPI.ConsumerAPI
}

func (Dependencies) Validate

func (d Dependencies) Validate() error

type ManagedSkillDocument

type ManagedSkillDocument struct {
	Artifact artifact.Artifact
	Document document.SkillDocument
}

ManagedSkillDocument is the editable projection for a managed Skill. It deliberately contains the canonical SKILL.md document only. It never exposes Source configuration, a native filesystem path, or package internals.

type PinSkillRequest

type PinSkillRequest struct {
	Bundle                     collection.CollectionRef
	ExpectedCollectionRevision uint64
	ArtifactID                 basespec.ArtifactID
	Binding                    artifact.SourceBinding
	Name                       string
	Enabled                    bool
}

type Provider

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

Provider registers the Agent Skill artifact family with Artifact Store. Bundle lifecycle and runtime projection remain owned by this package.

func NewProvider

func NewProvider() (*Provider, error)

func (*Provider) Descriptor

func (p *Provider) Descriptor() providerapi.Descriptor

type ResolvedSkill

type ResolvedSkill struct {
	Artifact   artifact.ArtifactRef
	Collection collection.CollectionRef

	Name     string
	Location string
	Version  string
}

ResolvedSkill is the typed Skill Bundle handoff to application composition. It is not persisted and is never exposed as a durable runtime identity.

type StoreLoader

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

StoreLoader is the Skill Bundle feature adapter registered with the generic Artifact Skill router. It owns skill.bundle projection only.

func NewStoreLoader

func NewStoreLoader(api *API) (*StoreLoader, error)

func (*StoreLoader) ListCollectionSkills

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

func (*StoreLoader) ResolveArtifactSkill

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

type UpdateBundleRequest

type UpdateBundleRequest struct {
	Bundle           collection.CollectionRef
	ExpectedRevision uint64
	DisplayName      string
	Description      string
	Enabled          bool
}

Jump to

Keyboard shortcuts

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