skills

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 17 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"
	ErrRollbackUnavailable = "SKILL_ROLLBACK_UNAVAILABLE"
)

Variables

This section is empty.

Functions

func DigestDirectory

func DigestDirectory(root string) (string, error)

func DigestFile

func DigestFile(path string) (string, error)

func ValidatePackage

func ValidatePackage(packageDir string) error

Types

type ErrDocumentIdentityMismatch

type ErrDocumentIdentityMismatch struct {
	Skill    string
	Version  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
	Activate     bool
	Channel      skillstate.Channel
	MaxBytes     int64
}

type InstallResult

type InstallResult struct {
	Skill       string             `json:"skill"`
	Version     string             `json:"version"`
	Digest      string             `json:"digest"`
	InstalledAt time.Time          `json:"installed_at"`
	Activated   bool               `json:"activated"`
	Channel     skillstate.Channel `json:"channel,omitempty"`
	Path        string             `json:"path"`
}

type Manager

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

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

func (m *Manager) Rollback(ctx context.Context, skill string, channel skillstate.Channel) (RollbackResult, error)

func (*Manager) Validate

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

type RollbackResult

type RollbackResult struct {
	Skill       string `json:"skill"`
	FromVersion string `json:"from_version"`
	ToVersion   string `json:"to_version"`
	Verified    bool   `json:"verified"`
}

type SkillDocument

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

func LoadSkillDocument

func LoadSkillDocument(packageDir string) (SkillDocument, error)

func ParseSkillDocument

func ParseSkillDocument(data []byte) (SkillDocument, 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
	MaxBytes     int64
}

type ValidateResult

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

Jump to

Keyboard shortcuts

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