artifact

package
v0.2.15 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Kind      basespec.ArtifactKind = "agent.skill"
	SchemaID  basespec.SchemaID     = "agent.skill.v1"
	DecoderID basespec.DecoderID    = "agent.skill-markdown"

	SchemaVersion      = "v1"
	DefinitionFileName = "SKILL.md"
	InsertLabelKey     = "skill.insert"
)

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 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 converts a verified Skill source locator into the native package directory required by the Agent Skills filesystem provider.

Source adapters retain ownership of native path resolution, containment, and platform-specific behavior. Agentskills-go retains ownership of SKILL.md parsing, resource access, script policy, sandboxing, and execution.

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)
}

type RuntimePackageResolutionSession

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

RuntimePackageResolutionSession reuses confirmed source snapshots while a caller resolves multiple Agent Skill packages. Callers must Close it before returning any successfully resolved package locations to their caller.

func NewRuntimePackageResolutionSession

func NewRuntimePackageResolutionSession(
	ctx context.Context,
) (context.Context, *RuntimePackageResolutionSession, error)

func (*RuntimePackageResolutionSession) Close

Jump to

Keyboard shortcuts

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