artifact

package
v0.2.19 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 and managed Skill publication. It deliberately delegates parsing and semantic validation to agentskills-go.

func DocumentFromDefinition

func DocumentFromDefinition(
	value definition.Definition,
) (agentskillsSpec.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 ManagedPackageAddressForSkill added in v0.2.17

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

func ManagedPackageAddressFromSkillLocator added in v0.2.17

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

func ManagedPackageLocatorForSkill added in v0.2.17

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

func ResolveRuntimePackage

func ResolveRuntimePackage(
	ctx context.Context,
	runtime source.Runtime,
	value source.Source,
	locator basespec.Locator,
	subresource basespec.SubresourceLocator,
	expectedGeneration string,
	expectedContentDigest cryptoutil.Digest,
) (string, error)

ResolveRuntimePackage applies only Agent Skill binding rules. Source generation verification, digest verification, snapshot reuse, safe close, and native path resolution belong to source.ResolveVerifiedLocalPath.

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 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 Decoder

type Decoder struct{}

func NewDecoder

func NewDecoder() (*Decoder, error)

func (*Decoder) Decode

func (d *Decoder) Decode(
	_ context.Context,
	candidate discovery.Candidate,
) ([]discovery.Decoded, []diagnostic.Diagnostic)

func (*Decoder) ID

func (*Decoder) ID() basespec.DecoderID

func (*Decoder) Recognize

func (d *Decoder) Recognize(
	_ context.Context,
	candidate discovery.Candidate,
) discovery.Recognition

func (*Decoder) Revision

func (*Decoder) Revision() string

type LocatorPolicy

type LocatorPolicy interface {
	ExpectedName(
		locator basespec.Locator,
	) (string, bool)
}

Jump to

Keyboard shortcuts

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