Documentation
¶
Index ¶
- Constants
- func CanonicalizePortableBundleDefinition(input definition.CollectionDefinition) (definition.CollectionDefinition, error)
- func EncodeAttachmentData(value AttachmentData) (json.RawMessage, error)
- func EncodeCollectionData(value CollectionData) (json.RawMessage, error)
- func MarshalPortableBundleDefinition(input definition.CollectionDefinition) ([]byte, error)
- func NewPortableBundleDefinition(metadata PortableBundleMetadata, members []definition.ContentRef) (definition.CollectionDefinition, error)
- func ParsePortableBundleDefinition(raw []byte) (definition.CollectionDefinition, error)
- func ValidateCollectionData(value CollectionData) error
- func ValidatePortableBundleDefinition(value definition.CollectionDefinition) error
- func ValidatePortableBundleMetadata(metadata PortableBundleMetadata) error
- type API
- func (a *API) AdoptSkill(ctx context.Context, request AdoptSkillRequest) (artifact.Artifact, error)
- func (a *API) AttachSource(ctx context.Context, bundle collection.CollectionRef, ...) (Bundle, error)
- func (a *API) BuildLinkedPortableBundleDefinition(ctx context.Context, ref collection.CollectionRef) (definition.CollectionDefinition, error)
- func (a *API) BuildLinkedPortableBundleJSON(ctx context.Context, ref collection.CollectionRef) ([]byte, error)
- func (a *API) Close() error
- func (a *API) CreateBundle(ctx context.Context, request CreateBundleRequest) (Bundle, error)
- func (a *API) CreateManagedSkill(ctx context.Context, request CreateManagedSkillRequest) (CreateManagedSkillResponse, error)
- func (a *API) EnsureBuiltInBundleCurrent(ctx context.Context, ref collection.CollectionRef) error
- func (a *API) EnsureBuiltInBundleTopology(ctx context.Context, request BuiltInBundleTopology) (Bundle, error)
- func (a *API) GetBundle(ctx context.Context, ref collection.CollectionRef) (Bundle, error)
- func (a *API) GetManagedSkillDocument(ctx context.Context, ref artifact.ArtifactRef) (ManagedSkillDocument, error)
- func (a *API) GetSkill(ctx context.Context, ref artifact.ArtifactRef) (artifact.Artifact, error)
- func (a *API) InstallBuiltInCollection(ctx context.Context, request BuiltInCollectionInstallRequest) ([]CreateManagedSkillResponse, error)
- func (a *API) InstallBuiltInSkill(ctx context.Context, _ CreateManagedSkillRequest) (CreateManagedSkillResponse, error)
- func (a *API) ListBundles(ctx context.Context, rootID basespec.RootID) ([]Bundle, error)
- func (a *API) ListRuntimeSkills(ctx context.Context, bundle collection.CollectionRef) (output []RuntimeSkill, returnErr error)
- func (a *API) ListSkills(ctx context.Context, bundle collection.CollectionRef) ([]artifact.Artifact, error)
- func (a *API) LoadRuntimeSkill(ctx context.Context, ref artifact.ArtifactRef) (RuntimeSkill, error)
- func (a *API) PinSkill(ctx context.Context, request PinSkillRequest) (artifact.Artifact, error)
- func (a *API) PurgeBundle(ctx context.Context, ref collection.CollectionRef, expectedRevision uint64) error
- func (a *API) PurgeSkill(ctx context.Context, ref artifact.ArtifactRef, expectedRevision uint64) error
- func (a *API) Ready() error
- func (a *API) RefreshBuiltInBundle(ctx context.Context, ref collection.CollectionRef) (refresh.Result, error)
- func (a *API) RefreshBundle(ctx context.Context, ref collection.CollectionRef) (refresh.Result, error)
- func (a *API) RetireBundle(ctx context.Context, ref collection.CollectionRef, expectedRevision uint64) (collection.Collection, error)
- func (a *API) SetSkillEnabled(ctx context.Context, ref artifact.ArtifactRef, expectedRevision uint64, ...) (artifact.Artifact, error)
- func (a *API) SkillBundleRefs(ctx context.Context) ([]collection.CollectionRef, error)
- func (a *API) UnadoptSkill(ctx context.Context, ref artifact.ArtifactRef, expectedRevision uint64, ...) error
- func (a *API) UpdateBundle(ctx context.Context, request UpdateBundleRequest) (Bundle, error)
- type AdoptSkillRequest
- type AttachmentData
- type AttachmentDraft
- type BuiltInBundleTopology
- type BuiltInCollectionInstallRequest
- type BuiltInCollectionSkill
- type Bundle
- type CollectionData
- type CreateBundleRequest
- type CreateManagedSkillRequest
- type CreateManagedSkillResponse
- type Dependencies
- type ManagedSkillDocument
- type ManagedSourceStateFunc
- type PinSkillRequest
- type PortableBundleMetadata
- type PublishManagedPackageFunc
- type RemoveManagedPackageFunc
- type RootLister
- type RuntimeResolver
- type RuntimeSkill
- type UpdateBundleRequest
Constants ¶
const ( CollectionKind basespec.CollectionKind = "skill.bundle" CollectionSchemaVersion = "v1" DiscoveryPolicyRevision = "skill.bundle.discovery.v1" RoleManaged basespec.AttachmentRole = "managed" RoleBuiltIn basespec.AttachmentRole = "builtin" RoleExternal basespec.AttachmentRole = "external" RoleImported basespec.AttachmentRole = "imported" RoleLibrary basespec.AttachmentRole = "library" )
const ( PortableBundleSchemaVersion = "v1" PortableCollectionFileName = "collection.json" PortableBundleSchemaID basespec.SchemaID = "skill.bundle.v1" )
const AttachmentDataSchemaVersion = "v1"
Variables ¶
This section is empty.
Functions ¶
func CanonicalizePortableBundleDefinition ¶
func CanonicalizePortableBundleDefinition( input definition.CollectionDefinition, ) (definition.CollectionDefinition, error)
func EncodeAttachmentData ¶
func EncodeAttachmentData( value AttachmentData, ) (json.RawMessage, error)
func EncodeCollectionData ¶
func EncodeCollectionData(value CollectionData) (json.RawMessage, error)
func MarshalPortableBundleDefinition ¶
func MarshalPortableBundleDefinition( input definition.CollectionDefinition, ) ([]byte, error)
func NewPortableBundleDefinition ¶
func NewPortableBundleDefinition( metadata PortableBundleMetadata, members []definition.ContentRef, ) (definition.CollectionDefinition, error)
NewPortableBundleDefinition creates a canonical shareable Skill Bundle JSON manifest. ContentRef.Digest is the digest of the raw SKILL.md member bytes, not the digest of the derived Artifact Definition.
Members identify package entrypoint documents; the package closure itself remains the responsibility of future import/export code.
func ParsePortableBundleDefinition ¶
func ParsePortableBundleDefinition( raw []byte, ) (definition.CollectionDefinition, error)
func ValidateCollectionData ¶
func ValidateCollectionData(value CollectionData) error
func ValidatePortableBundleDefinition ¶
func ValidatePortableBundleDefinition( value definition.CollectionDefinition, ) error
func ValidatePortableBundleMetadata ¶
func ValidatePortableBundleMetadata( metadata PortableBundleMetadata, ) error
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func New ¶
func New(dependencies Dependencies) (*API, error)
func (*API) AdoptSkill ¶
func (*API) AttachSource ¶
func (a *API) AttachSource( ctx context.Context, bundle collection.CollectionRef, expectedCollectionRevision uint64, draft AttachmentDraft, ) (Bundle, error)
func (*API) BuildLinkedPortableBundleDefinition ¶
func (a *API) BuildLinkedPortableBundleDefinition( ctx context.Context, ref collection.CollectionRef, ) (definition.CollectionDefinition, error)
BuildLinkedPortableBundleDefinition is intentionally unavailable.
Previous implementations emitted current Source locators as portable member locators. Managed Source locators can contain local Artifact UUIDs and are therefore not shareable. A future exporter must construct a package-relative closure with logical names and an externally supplied package SHA-256.
func (*API) BuildLinkedPortableBundleJSON ¶
func (a *API) BuildLinkedPortableBundleJSON( ctx context.Context, ref collection.CollectionRef, ) ([]byte, error)
BuildLinkedPortableBundleJSON returns the canonical shareable linked bundle descriptor. It deliberately does not claim to contain a package closure.
func (*API) CreateBundle ¶
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 (*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) InstallBuiltInCollection ¶
func (a *API) InstallBuiltInCollection( ctx context.Context, request BuiltInCollectionInstallRequest, ) ([]CreateManagedSkillResponse, error)
func (*API) InstallBuiltInSkill ¶
func (a *API) InstallBuiltInSkill( ctx context.Context, _ CreateManagedSkillRequest, ) (CreateManagedSkillResponse, error)
func (*API) ListBundles ¶
func (*API) ListRuntimeSkills ¶
func (a *API) ListRuntimeSkills( ctx context.Context, bundle collection.CollectionRef, ) (output []RuntimeSkill, returnErr error)
ListRuntimeSkills 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) LoadRuntimeSkill ¶
func (a *API) LoadRuntimeSkill( ctx context.Context, ref artifact.ArtifactRef, ) (RuntimeSkill, error)
LoadRuntimeSkill 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) PurgeBundle ¶
func (a *API) PurgeBundle( ctx context.Context, ref collection.CollectionRef, expectedRevision uint64, ) error
func (*API) PurgeSkill ¶
func (*API) RefreshBuiltInBundle ¶
func (a *API) RefreshBuiltInBundle( ctx context.Context, ref collection.CollectionRef, ) (refresh.Result, error)
RefreshBuiltInBundle is the trusted feature-level refresh path for a protected built-in Skill Bundle. It is intentionally unavailable through ordinary Skill Bundle mutation APIs.
func (*API) RefreshBundle ¶
func (a *API) RefreshBundle( ctx context.Context, ref collection.CollectionRef, ) (refresh.Result, error)
func (*API) RetireBundle ¶
func (a *API) RetireBundle( ctx context.Context, ref collection.CollectionRef, expectedRevision uint64, ) (collection.Collection, error)
func (*API) SetSkillEnabled ¶
func (*API) SkillBundleRefs ¶
func (a *API) SkillBundleRefs( ctx context.Context, ) ([]collection.CollectionRef, error)
SkillBundleRefs returns every active Skill Bundle Collection. Runtime startup inventory and maintenance code may use this without treating a runtime ref shape as a source-of-truth ownership discriminator. Process-local runtime registration is resolved and reconciled lazily from Artifact identity.
func (*API) UnadoptSkill ¶
func (*API) UpdateBundle ¶
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 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:"-"`
// Optional local provenance. Embedded package bytes and member digests
// remain independently verified during built-in installation.
PortableDefinitionDigest *cryptoutil.Digest `json:"-"`
}
type BuiltInCollectionInstallRequest ¶
type BuiltInCollectionInstallRequest struct {
Bundle collection.CollectionRef
ExpectedCollectionRevision uint64
PackageDirectory basespec.Locator
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
Data CollectionData
Attachments []collection.Attachment
Sources []source.Summary
}
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"`
// PortableDefinitionDigest is local provenance only. It identifies the
// canonical portable Collection payload from which this local Collection
// was installed without embedding that portable payload in SQLite.
PortableDefinitionDigest *cryptoutil.Digest `json:"portableDefinitionDigest,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
DisplayName string
Description string
Enabled bool
LogicalName basespec.LogicalName
LogicalVersion basespec.LogicalVersion
Labels map[string]string
PortableDefinitionDigest *cryptoutil.Digest
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 *agentskillsSpec.SkillDocument
Files []source.ManagedPackageFile
Enabled bool
}
type CreateManagedSkillResponse ¶
type CreateManagedSkillResponse struct {
Artifact artifact.Artifact
Address artifact.ArtifactAddress
}
type Dependencies ¶
type Dependencies struct {
Roots RootLister
Sources *source.Service
Collections *collection.Service
Artifacts *artifact.Service
Refresh refresh.Runner
Catalogs catalog.Reader
Definitions definition.Reader
SourceRuntime source.Runtime
HasDecoder func(basespec.DecoderID) bool
DecoderFingerprint func() (cryptoutil.Digest, error)
RootMutationPolicy protection.RootPolicy
AutoAdoptionIDProvider artifact.ArtifactIDProvider
GetManagedSourceState ManagedSourceStateFunc
PublishManagedPackage PublishManagedPackageFunc
PublishProtectedManagedPackage PublishManagedPackageFunc
RemoveManagedPackage RemoveManagedPackageFunc
}
func (Dependencies) Validate ¶
func (d Dependencies) Validate() error
type ManagedSkillDocument ¶
type ManagedSkillDocument struct {
Artifact artifact.Artifact
Document agentskillsSpec.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 ManagedSourceStateFunc ¶
type PinSkillRequest ¶
type PinSkillRequest struct {
Bundle collection.CollectionRef
ExpectedCollectionRevision uint64
ArtifactID basespec.ArtifactID
Binding artifact.SourceBinding
Name string
Enabled bool
}
type PortableBundleMetadata ¶
type PortableBundleMetadata struct {
LogicalName basespec.LogicalName
LogicalVersion basespec.LogicalVersion
DisplayName string
Description string
Labels map[string]string
}
type RuntimeResolver ¶
type RuntimeResolver struct {
// contains filtered or unexported fields
}
RuntimeResolver is the Skill Bundle feature adapter registered with the Artifact-backed Skill Runtime router. It owns only skill.bundle projection; collection ownership itself is resolved by the generic router.
func NewRuntimeResolver ¶
func NewRuntimeResolver(api *API) (*RuntimeResolver, error)
func (*RuntimeResolver) ListCollectionSkills ¶
func (r *RuntimeResolver) ListCollectionSkills( ctx context.Context, ref collection.CollectionRef, ) ([]skillRuntime.ResolvedArtifactSkill, error)
func (*RuntimeResolver) ResolveArtifactSkill ¶
func (r *RuntimeResolver) ResolveArtifactSkill( ctx context.Context, ref artifact.ArtifactRef, ) (skillRuntime.ResolvedArtifactSkill, error)
type RuntimeSkill ¶
type RuntimeSkill struct {
Artifact artifact.ArtifactRef
Collection collection.CollectionRef
Name string
Location string
Version string
}
RuntimeSkill is the typed Skill Bundle handoff to application composition. It is not persisted and is never exposed as a durable runtime identity.
type UpdateBundleRequest ¶
type UpdateBundleRequest struct {
Bundle collection.CollectionRef
ExpectedRevision uint64
DisplayName string
Description string
Enabled bool
}