skillpackage

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Overview

Package skillpackage owns the private package registry and its Core contracts. It never executes package contents or changes Runtime Worker delivery semantics.

Index

Constants

View Source
const Feature = "skill_packages.v1"
View Source
const MaxBindings = 5
View Source
const MaxPayloadBytes = 65536
View Source
const MetadataKey = "_openlinker_skill_packages"

Variables

View Source
var ErrInvalidReceipt = errors.New("invalid skill package receipt")

Functions

func ArchiveDirectory added in v0.4.0

func ArchiveDirectory(name string, packageID uuid.UUID) string

func BuildArchive added in v0.4.0

func BuildArchive(directory string, files map[string]string) ([]byte, error)

BuildArchive writes only the package files, sorted, stored uncompressed and with fixed metadata so identical versions produce identical bytes.

func CompatibleProviders

func CompatibleProviders(features []string) []string

func RecordReceipt

func RecordReceipt(ctx context.Context, tx pgx.Tx, runID, agentID uuid.UUID, event string, payload []byte) error

RecordReceipt is called only after Core's ordinary event principal, active Attempt, lease, fence and sequence checks, in that same transaction.

func Snapshot

func Snapshot(ctx context.Context, tx pgx.Tx, runID, agentID uuid.UUID) error

Snapshot uses the Run creation transaction. It never places private files in caller-visible request_metadata; only authenticated assignment queries join it.

func ValidateAssignment

func ValidateAssignment(value any, features []string) error

Types

type Bundle

type Bundle struct {
	RequiredCommands []string          `json:"required_commands"`
	Name             string            `json:"name"`
	Description      string            `json:"description"`
	Files            map[string]string `json:"files"`
	CapabilityIDs    []string          `json:"capability_ids"`
	Providers        []string          `json:"providers"`
}

func ValidateImport

func ValidateImport(req ImportRequest) (Bundle, string, string, error)

type Handler

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

func NewHandler

func NewHandler(pool *pgxpool.Pool) *Handler

func (*Handler) Bind

func (h *Handler) Bind(c echo.Context) error

func (*Handler) Bindings

func (h *Handler) Bindings(c echo.Context) error

func (*Handler) Detail

func (h *Handler) Detail(c echo.Context) error

func (*Handler) Import

func (h *Handler) Import(c echo.Context) error

func (*Handler) ImportPublished added in v0.4.0

func (h *Handler) ImportPublished(c echo.Context) error

ImportPublished creates the caller's own private copy of a published version. Exact stored bytes are copied after re-validation; the copy keeps provenance IDs but no foreign key, so later withdrawal never affects it. Retrying the same source version returns the existing copy with 200.

func (*Handler) List

func (h *Handler) List(c echo.Context) error

func (*Handler) PublicArchive added in v0.4.0

func (h *Handler) PublicArchive(c echo.Context) error

func (*Handler) PublicBundle added in v0.4.0

func (h *Handler) PublicBundle(c echo.Context) error

PublicBundle returns the exact stored bytes so `sha256sum` matches digest. It is an archival/verification format, not an owner import request.

func (*Handler) PublicDetail added in v0.4.0

func (h *Handler) PublicDetail(c echo.Context) error

func (*Handler) PublicFile added in v0.4.0

func (h *Handler) PublicFile(c echo.Context) error

func (*Handler) PublicList added in v0.4.0

func (h *Handler) PublicList(c echo.Context) error

func (*Handler) PublicVersion added in v0.4.0

func (h *Handler) PublicVersion(c echo.Context) error

func (*Handler) Publish added in v0.4.0

func (h *Handler) Publish(c echo.Context) error

func (*Handler) Register

func (h *Handler) Register(api *echo.Group, auth echo.MiddlewareFunc)

func (*Handler) RegisterPublic added in v0.4.0

func (h *Handler) RegisterPublic(api *echo.Group)

func (*Handler) SetVisibility added in v0.4.0

func (h *Handler) SetVisibility(c echo.Context) error

func (*Handler) Unbind

func (h *Handler) Unbind(c echo.Context) error

func (*Handler) Version

func (h *Handler) Version(c echo.Context) error

func (*Handler) Withdraw added in v0.4.0

func (h *Handler) Withdraw(c echo.Context) error

type ImportRequest

type ImportRequest struct {
	RequiredCommands []string          `json:"required_commands"`
	Version          string            `json:"version"`
	Files            map[string]string `json:"files"`
	CapabilityIDs    []string          `json:"capability_ids"`
	Providers        []string          `json:"providers"`
}

type Receipt

type Receipt struct {
	Bindings  []ReceiptBinding `json:"bindings"`
	ErrorCode string           `json:"error_code,omitempty"`
}

type ReceiptBinding

type ReceiptBinding struct {
	BindingID uuid.UUID `json:"binding_id"`
	VersionID uuid.UUID `json:"version_id"`
	Digest    string    `json:"digest"`
}

type ValidationError

type ValidationError struct{ Code, Message string }

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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