domain

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: 20 Imported by: 0

Documentation

Index

Constants

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

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

Variables

This section is empty.

Functions

func DecodeSkillDocument

func DecodeSkillDocument(
	content []byte,
	expectedName string,
) (definition.Definition, []diagnostic.Diagnostic, error)

DecodeSkillDocument is the shared SKILL.md parse-and-definition path used by discovery, managed Skill publication, and built-in Skill hydration.

func DefinitionForArtifact

func DefinitionForArtifact(
	snapshot catalog.Snapshot,
	record artifact.Artifact,
) (definition.Definition, error)

DefinitionForArtifact returns the catalog definition currently resolved by an Artifact. It verifies that the catalog and Artifact have matching Collection identities and matching definition digests.

func DocumentFromDefinition

func DocumentFromDefinition(
	value definition.Definition,
) (document.SkillDocument, error)

DocumentFromDefinition validates the canonical Artifact definition and returns the corresponding agentskills-go document. Consumers must use this projection instead of decoding the Skill body independently.

Raw SKILL.md parsing remains exclusively in DecodeSkillDocument, which delegates to agentskills-go.ParseSkillDocument.

func EncodeAttachmentData

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

func EncodeCollectionData

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

func ManagedPackageAddressForSkill

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

func ManagedPackageAddressFromSkillLocator

func ManagedPackageAddressFromSkillLocator(
	locator basespec.Locator,
) (source.ManagedPackageAddress, error)

func ManagedPackageLocatorForSkill

func ManagedPackageLocatorForSkill(
	address source.ManagedPackageAddress,
) (basespec.Locator, error)

func RuntimePackageLocator

func RuntimePackageLocator(
	locator basespec.Locator,
	subresource basespec.SubresourceLocator,
) (basespec.Locator, error)

RuntimePackageLocator applies only Agent Skill binding rules. Artifact Store owns source generation verification, digest verification, snapshot lifecycle, and native path resolution.

func ValidateAttachmentRole

func ValidateAttachmentRole(role collection.AttachmentRole) error

func ValidateAttachmentRoleSourceKind

func ValidateAttachmentRoleSourceKind(
	role collection.AttachmentRole,
	kind source.SourceKind,
) error

func ValidateAttachmentTopology

func ValidateAttachmentTopology(
	data CollectionData,
	attachments []AttachmentTopologyEntry,
) error

func ValidateDefinition

func ValidateDefinition(value definition.Definition) error

Types

type Argument

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

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              source.SourceID                        `json:"sourceId"`
	Role                  collection.AttachmentRole              `json:"role"`
	Enabled               bool                                   `json:"enabled"`
	DiscoveryRoot         basespec.Locator                       `json:"discoveryRoot"`
	ExpectedMemberDigests map[basespec.Locator]cryptoutil.Digest `json:"expectedMemberDigests"`
}

type AttachmentTopologyEntry

type AttachmentTopologyEntry struct {
	SourceID source.SourceID
	Role     collection.AttachmentRole
}

type Body

type Body struct {
	Name           string         `json:"name"`
	DisplayName    string         `json:"displayName,omitempty"`
	Description    string         `json:"description"`
	Insert         string         `json:"insert"`
	Arguments      []Argument     `json:"arguments,omitempty"`
	Tags           []string       `json:"tags,omitempty"`
	MarkdownBody   string         `json:"markdownBody"`
	RawFrontmatter map[string]any `json:"rawFrontmatter,omitempty"`
}

type BuiltInBundleTopology

type BuiltInBundleTopology struct {
	RootID                root.RootID                            `json:"rootId"`
	CollectionID          collection.CollectionID                `json:"collectionId"`
	SourceID              source.SourceID                        `json:"sourceId"`
	LogicalName           basespec.LogicalName                   `json:"logicalName"`
	LogicalVersion        basespec.LogicalVersion                `json:"logicalVersion"`
	DisplayName           string                                 `json:"displayName"`
	Description           string                                 `json:"description"`
	Labels                map[string]string                      `json:"labels"`
	Enabled               bool                                   `json:"enabled"`
	DiscoveryRoot         basespec.Locator                       `json:"discoveryRoot"`
	ExpectedMemberDigests map[basespec.Locator]cryptoutil.Digest `json:"expectedMemberDigests"`
}

BuiltInBundleTopology is trusted bootstrap input. SkillStoreWrapper does not expose this type through Wails.

type BuiltInCollectionSkill

type BuiltInCollectionSkill struct {
	ArtifactID artifact.ArtifactID `json:"artifactId"`
	Member     basespec.Locator    `json:"member"`
	Enabled    bool                `json:"enabled"`
}

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 source.SourceID `json:"managedSourceID,omitempty"`
}

func DecodeCollectionData

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

func (CollectionData) Clone

func (d CollectionData) Clone() CollectionData

func (CollectionData) Validate

func (d CollectionData) Validate() error

type ManagedSkillDocument

type ManagedSkillDocument struct {
	Artifact artifact.Artifact      `json:"artifact"`
	Document document.SkillDocument `json:"document"`
}

type SkillBundle

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

Jump to

Keyboard shortcuts

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