manifest

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CancelDisableBehaviorCancel = "cancel"
	CancelDisableBehaviorOrphan = "orphan"
	CancelDisableBehaviorWait   = "wait"

	CancelUninstallBehaviorCancelThenBlockDelete = "cancel_then_block_delete"
	CancelUninstallBehaviorForceCleanupAllowed   = "force_cleanup_allowed"
)
View Source
const (
	WorkerModeJob             WorkerMode = "job"
	MaxWorkerMemoryLimitBytes int64      = 256 << 20
	MaxStorageStores                     = 16
	MaxStoreQuotaBytes        int64      = 1 << 30
	MaxStoreQuotaFiles        int64      = 100_000
	DefaultStoreQuotaFiles    int64      = 10_000
)

Variables

This section is empty.

Functions

func DescriptorHashInput

func DescriptorHashInput(m Manifest) ([]byte, error)

func Validate

func Validate(m Manifest) error

Types

type CancelPolicySpec

type CancelPolicySpec struct {
	Cancelable        bool   `json:"cancelable"`
	DisableBehavior   string `json:"disable_behavior,omitempty"`
	UninstallBehavior string `json:"uninstall_behavior,omitempty"`
	AckTimeoutMS      int    `json:"ack_timeout_ms,omitempty"`
}

type CapabilityBinding

type CapabilityBinding struct {
	BindingID string                 `json:"binding_id"`
	Contract  capabilitycontract.Pin `json:"contract"`
}

type CompiledMethodSchemas

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

CompiledMethodSchemas holds the closed request and response contracts for one manifest method. The compiled validators are safe for concurrent validation.

func CompileMethodSchemas

func CompileMethodSchemas(method MethodSpec) (*CompiledMethodSchemas, error)

CompileMethodSchemas validates and compiles a method's JSON Schema contracts. Remote schema loading is disabled so package validation remains deterministic and cannot perform network I/O.

func (*CompiledMethodSchemas) ValidateRequest

func (s *CompiledMethodSchemas) ValidateRequest(value map[string]any) error

func (*CompiledMethodSchemas) ValidateResponse

func (s *CompiledMethodSchemas) ValidateResponse(value any) error

type ConfirmationMode

type ConfirmationMode string
const (
	ConfirmationNone      ConfirmationMode = "none"
	ConfirmationRequired  ConfirmationMode = "required"
	ConfirmationRiskBased ConfirmationMode = "risk_based"
)

type ConfirmationSpec

type ConfirmationSpec struct {
	Mode              ConfirmationMode `json:"mode"`
	PreflightMethod   *string          `json:"preflight_method,omitempty"`
	RequestHashFields []string         `json:"request_hash_fields,omitempty"`
	PlanHashRequired  bool             `json:"plan_hash_required,omitempty"`
}

type IntentSpec

type IntentSpec struct {
	IntentID      string         `json:"intent_id"`
	Method        string         `json:"method"`
	PayloadSchema map[string]any `json:"payload_schema,omitempty"`
}

type Manifest

type Manifest struct {
	SchemaVersion      string              `json:"schema_version"`
	Publisher          Publisher           `json:"publisher"`
	Plugin             Plugin              `json:"plugin"`
	Surfaces           []SurfaceSpec       `json:"surfaces,omitempty"`
	CapabilityBindings []CapabilityBinding `json:"capability_bindings,omitempty"`
	Methods            []MethodSpec        `json:"methods,omitempty"`
	Workers            []WorkerSpec        `json:"workers,omitempty"`
	Storage            *StorageSpec        `json:"storage,omitempty"`
	NetworkAccess      *NetworkAccessSpec  `json:"network_access,omitempty"`
	Settings           *SettingsSpec       `json:"settings,omitempty"`
	Intents            []IntentSpec        `json:"intents,omitempty"`
}

func Decode

func Decode(r io.Reader) (Manifest, error)

func (Manifest) APIVersion

func (m Manifest) APIVersion() string

func (Manifest) PluginID

func (m Manifest) PluginID() string

func (Manifest) Version

func (m Manifest) Version() string

type MethodBrokerAccessSpec added in v0.4.0

type MethodBrokerAccessSpec struct {
	Storage []StorageBrokerAccessSpec `json:"storage,omitempty"`
	Network []NetworkBrokerAccessSpec `json:"network,omitempty"`
}

type MethodEffect

type MethodEffect string
const (
	MethodEffectRead    MethodEffect = "read"
	MethodEffectWrite   MethodEffect = "write"
	MethodEffectExecute MethodEffect = "execute"
	MethodEffectDelete  MethodEffect = "delete"
	MethodEffectAdmin   MethodEffect = "admin"
)

type MethodExecutionMode

type MethodExecutionMode string
const (
	MethodExecutionSync         MethodExecutionMode = "sync"
	MethodExecutionOperation    MethodExecutionMode = "operation"
	MethodExecutionSubscription MethodExecutionMode = "subscription"
)

type MethodRouteKind

type MethodRouteKind string
const (
	MethodRouteCapability MethodRouteKind = "capability"
	MethodRouteWorker     MethodRouteKind = "worker"
	MethodRouteCoreAction MethodRouteKind = "core_action"
)

type MethodRouteSpec

type MethodRouteSpec struct {
	Kind         MethodRouteKind `json:"kind"`
	BindingID    string          `json:"binding_id,omitempty"`
	TargetMethod string          `json:"target_method,omitempty"`
	WorkerID     string          `json:"worker_id,omitempty"`
	ActionID     string          `json:"action_id,omitempty"`
}

type MethodSpec

type MethodSpec struct {
	Method         string                  `json:"method"`
	Effect         MethodEffect            `json:"effect,omitempty"`
	Execution      MethodExecutionMode     `json:"execution,omitempty"`
	Dangerous      bool                    `json:"dangerous,omitempty"`
	PreflightOnly  bool                    `json:"preflight_only,omitempty"`
	Confirmation   *ConfirmationSpec       `json:"confirmation,omitempty"`
	CancelPolicy   *CancelPolicySpec       `json:"cancel_policy,omitempty"`
	RequestSchema  map[string]any          `json:"request_schema,omitempty"`
	ResponseSchema map[string]any          `json:"response_schema,omitempty"`
	Route          MethodRouteSpec         `json:"route"`
	BrokerAccess   *MethodBrokerAccessSpec `json:"broker_access,omitempty"`
}

type NetworkAccessSpec

type NetworkAccessSpec struct {
	Connectors []NetworkConnectorSpec `json:"connectors,omitempty"`
}

type NetworkBrokerAccessSpec added in v0.4.0

type NetworkBrokerAccessSpec struct {
	ConnectorID string   `json:"connector_id"`
	Transport   string   `json:"transport"`
	Scope       string   `json:"scope,omitempty"`
	Operations  []string `json:"operations"`
	HTTPMethods []string `json:"http_methods,omitempty"`
}

type NetworkConnectorSpec

type NetworkConnectorSpec struct {
	ConnectorID  string         `json:"connector_id"`
	Transport    string         `json:"transport"`
	Scope        string         `json:"scope"`
	Destinations []string       `json:"destinations"`
	Auth         map[string]any `json:"auth,omitempty"`
	TLS          map[string]any `json:"tls,omitempty"`
}

type Plugin

type Plugin struct {
	PluginID          string `json:"plugin_id"`
	DisplayName       string `json:"display_name"`
	Version           string `json:"version"`
	APIVersion        string `json:"api_version"`
	MinRuntimeVersion string `json:"min_runtime_version"`
	UIProtocolVersion string `json:"ui_protocol_version"`
}

type Publisher

type Publisher struct {
	PublisherID string `json:"publisher_id"`
	DisplayName string `json:"display_name,omitempty"`
}

type SettingFieldSpec

type SettingFieldSpec struct {
	Key        string         `json:"key"`
	Type       string         `json:"type"`
	Label      string         `json:"label"`
	Scope      string         `json:"scope"`
	Default    any            `json:"default,omitempty"`
	SecretRef  string         `json:"secret_ref,omitempty"`
	Options    []string       `json:"options,omitempty"`
	Validation map[string]any `json:"validation,omitempty"`
}

type SettingsSpec

type SettingsSpec struct {
	SchemaVersion int                `json:"schema_version"`
	Fields        []SettingFieldSpec `json:"fields,omitempty"`
}

type StorageBrokerAccessSpec added in v0.4.0

type StorageBrokerAccessSpec struct {
	StoreID    string   `json:"store_id"`
	Operations []string `json:"operations"`
}

type StorageSpec

type StorageSpec struct {
	Stores []StoreSpec `json:"stores,omitempty"`
}

type StoreSpec

type StoreSpec struct {
	StoreID       string `json:"store_id"`
	Kind          string `json:"kind"`
	Scope         string `json:"scope"`
	QuotaBytes    int64  `json:"quota_bytes"`
	QuotaFiles    *int64 `json:"quota_files,omitempty"`
	SchemaVersion int    `json:"schema_version"`
}

type SurfaceIntent

type SurfaceIntent string
const (
	SurfaceIntentPrimary   SurfaceIntent = "primary"
	SurfaceIntentSecondary SurfaceIntent = "secondary"
	SurfaceIntentUtility   SurfaceIntent = "utility"
)

type SurfaceKind

type SurfaceKind string
const (
	SurfaceView       SurfaceKind = "view"
	SurfaceCommand    SurfaceKind = "command"
	SurfaceBackground SurfaceKind = "background"
)

type SurfaceSpec

type SurfaceSpec struct {
	SurfaceID   string          `json:"surface_id"`
	Kind        SurfaceKind     `json:"kind"`
	Intent      SurfaceIntent   `json:"intent,omitempty"`
	Label       string          `json:"label"`
	Entry       string          `json:"entry"`
	Icon        string          `json:"icon,omitempty"`
	DefaultSize *WidgetSizeSpec `json:"default_size,omitempty"`
}

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

func (ValidationError) Error

func (e ValidationError) Error() string

type WidgetSizeSpec

type WidgetSizeSpec struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

type WorkerMode

type WorkerMode string

type WorkerSpec

type WorkerSpec struct {
	WorkerID         string     `json:"worker_id"`
	Artifact         string     `json:"artifact"`
	ABI              string     `json:"abi"`
	Mode             WorkerMode `json:"mode"`
	Scope            string     `json:"scope"`
	MemoryLimitBytes int64      `json:"memory_limit_bytes"`
	IdleTimeoutMS    int        `json:"idle_timeout_ms,omitempty"`
}

Jump to

Keyboard shortcuts

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