skills

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package skills indexes the canonical ZIP bundles of local Skills repositories.

Index

Constants

View Source
const (
	MaxArchiveBytes = 32 << 20
	MaxSkillBytes   = 5 << 20
	MaxFiles        = 256
)

Variables

View Source
var ErrArchive = errors.New("skills: invalid skills bundle")

Functions

func ParsePath

func ParsePath(p string) (slug, version string, ok bool)

func Path

func Path(slug, version string) string

func Serves

func Serves(t repo.PackageType) bool

func ValidSlug

func ValidSlug(v string) bool

func ValidVersion

func ValidVersion(v string) bool

Types

type Handler

type Handler struct{ generic.Handler }

func (Handler) Admit

func (Handler) Admit(
	ctx context.Context, env format.Env, c repo.Config, w format.Write,
) (format.Write, error)

func (Handler) Deleted

func (Handler) Deleting

func (Handler) Deployed

func (Handler) Deployed(ctx context.Context, env format.Env, c repo.Config, it types.Item) error

func (Handler) Inspect

func (Handler) Inspect(
	ctx context.Context,
	env format.Env,
	_ repo.Config,
	w format.Write,
) (any, error)

func (Handler) Reindex

func (Handler) Reindex(ctx context.Context, env format.Env, c repo.Config) error

type Metadata

type Metadata struct {
	Slug        string   `json:"slug"`
	Version     string   `json:"version"`
	Fingerprint string   `json:"fingerprint"`
	Name        string   `json:"name,omitempty"`
	Description string   `json:"description,omitempty"`
	Author      string   `json:"author,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	DisplayName string   `json:"displayName,omitempty"` //nolint:tagliatelle // ClawHub's wire name
	Summary     string   `json:"summary,omitempty"`
	Changelog   string   `json:"changelog,omitempty"`
}

Metadata is the package record derived from the canonical path and SKILL.md. The publish request may supply display fields when the manifest omits them; the format's path and digest remain authoritative.

func ReadArchive

func ReadArchive(r io.Reader, size int64) (Metadata, error)

ReadArchive validates a bounded ZIP without extracting it. Every archived name is checked before parsing metadata so a bundle cannot smuggle paths outside the skill directory into a later single-file download.

Jump to

Keyboard shortcuts

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