Documentation
¶
Index ¶
- Constants
- func DecodeSkillDocument(content []byte, expectedName string) (definition.Definition, []diagnostic.Diagnostic, error)
- func DocumentFromDefinition(value definition.Definition) (agentskillsSpec.SkillDocument, error)
- func ResolveRuntimePackage(ctx context.Context, runtime source.Runtime, value source.Source, ...) (string, error)
- func ValidateDefinition(value definition.Definition) error
- type Argument
- type Body
- type Decoder
- type LocatorPolicy
- type RuntimePackageResolutionSession
Constants ¶
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 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 (*Decoder) Decode ¶
func (d *Decoder) Decode( _ context.Context, candidate discovery.Candidate, ) ([]discovery.Decoded, []diagnostic.Diagnostic)
type LocatorPolicy ¶
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.