Help us shape the future of Go! Take the 2026 Go Developer Survey

skill

package
v1.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrInvalidPackage  = "INVALID_SKILL_PACKAGE"
	ErrDigestMismatch  = "SKILL_DIGEST_MISMATCH"
	ErrDocumentInvalid = "SKILL_DOCUMENT_INVALID"
	ErrInstallFailed   = "SKILL_INSTALL_FAILED"
	ErrUninstallFailed = "SKILL_UNINSTALL_FAILED"
	ErrPurgeFailed     = "SKILL_PURGE_FAILED"
)

Variables

This section is empty.

Functions

func DigestDirectory

func DigestDirectory(root string) (string, error)

func DigestFile

func DigestFile(path string) (string, error)

func DigestPackageContent added in v0.9.0

func DigestPackageContent(root string) (string, error)

DigestPackageContent returns the stable digest of the effective Skill package content.

func FinalizeLegacyMigration added in v0.9.0

func FinalizeLegacyMigration(agentDockHome string) (string, error)

FinalizeLegacyMigration archives the preserved legacy roots after the outer install/update transaction has committed. It is safe to call repeatedly.

func IsIgnoredPackageMetadataPath added in v0.9.0

func IsIgnoredPackageMetadataPath(relative string) bool

IsIgnoredPackageMetadataPath reports transport/OS metadata that is outside the semantic Skill/Plugin package content. These entries are intentionally excluded from package snapshots/digests so Finder or macOS ZIP metadata cannot mutate an installed package after review.

func ValidatePackage

func ValidatePackage(packageDir string) error

Types

type ErrDocumentIdentityMismatch

type ErrDocumentIdentityMismatch struct {
	Skill    string
	Document SkillDocument
}

func (ErrDocumentIdentityMismatch) Error

type Error

type Error struct {
	Code  string
	Stage string
	Err   error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type InstallRequest

type InstallRequest struct {
	Source       string
	DigestSHA256 string
}

type InstallResult

type InstallResult struct {
	Skill         string `json:"skill"`
	ContentDigest string `json:"content_digest"`
	Path          string `json:"path"`
	Changed       bool   `json:"changed"`
}

type LegacyMigrationResult added in v0.9.0

type LegacyMigrationResult struct {
	MigratedSkills []string
	MigratedData   []string
	PendingPath    string
}

func MigrateLegacyLayout added in v0.9.0

func MigrateLegacyLayout(ctx context.Context, agentDockHome string, manager *Manager) (LegacyMigrationResult, error)

MigrateLegacyLayout prepares the one-time transition from the historical skill-store/skill-data layout to current managed Skill content.

Preparation is deliberately non-destructive: the old roots stay in place until the outer install/update transaction has committed. That keeps pre-migration binaries rollback-safe even when a legacy updater does not understand the new migration protocol.

func MigrateLegacyLayoutForUpdate added in v0.9.0

func MigrateLegacyLayoutForUpdate(ctx context.Context, agentDockHome string, manager *Manager) (LegacyMigrationResult, error)

MigrateLegacyLayoutForUpdate may refresh paths already created by a pending migration from the still-authoritative legacy roots. Only update/bootstrap paths may use it: normal runtime startup must never overwrite data produced by the new runtime after a successful legacy upgrade.

type Manager

type Manager struct {
	State       *skillstate.Store
	HTTPClient  *http.Client
	MaxDownload int64
	MaxFiles    int
}

func New

func New(state *skillstate.Store) (*Manager, error)

func (*Manager) Install

func (m *Manager) Install(ctx context.Context, req InstallRequest) (InstallResult, error)

func (*Manager) Remove added in v0.9.0

func (m *Manager) Remove(ctx context.Context, skill string) (RemoveResult, error)

func (*Manager) RemoveWithPurge added in v0.9.0

func (m *Manager) RemoveWithPurge(ctx context.Context, skill string, purge func() error) (RemoveResult, error)

RemoveWithPurge removes the managed package and runs purge while the same Skill lifecycle write lock is still held. It is intentionally idempotent: when the package is already absent, purge still runs so preserved env/data from an earlier keep removal can be cleaned safely.

func (*Manager) Validate

func (m *Manager) Validate(ctx context.Context, req ValidateRequest) (ValidateResult, error)

type RemoveResult added in v0.9.0

type RemoveResult struct {
	Skill                string `json:"skill"`
	Removed              bool   `json:"removed"`
	PreservedEnvironment bool   `json:"preserved_environment"`
	PreservedData        bool   `json:"preserved_data"`
}

type SkillDocument

type SkillDocument struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Body        string `json:"body,omitempty"`
}

func LoadSkillDocument

func LoadSkillDocument(packageDir string) (SkillDocument, error)

func ParseSkillDocument

func ParseSkillDocument(data []byte) (SkillDocument, error)

type SkillMetadata added in v0.8.2

type SkillMetadata struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

func ParseSkillMetadata added in v0.8.2

func ParseSkillMetadata(data []byte) (SkillMetadata, error)

type ValidateIssue

type ValidateIssue struct {
	Code    string `json:"code"`
	Stage   string `json:"stage"`
	Message string `json:"message"`
}

type ValidateRequest

type ValidateRequest struct {
	Source       string
	DigestSHA256 string
}

type ValidateResult

type ValidateResult struct {
	Valid         bool            `json:"valid"`
	Source        string          `json:"source"`
	SourceDigest  string          `json:"source_digest,omitempty"`
	ContentDigest string          `json:"content_digest,omitempty"`
	Document      SkillDocument   `json:"document,omitempty"`
	Issues        []ValidateIssue `json:"issues"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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