Documentation
¶
Index ¶
- Constants
- Variables
- func CanonicalJSON(raw []byte) ([]byte, error)
- func DescriptorHashInput(m Manifest) ([]byte, error)
- func MarshalCanonical(current Manifest) ([]byte, error)
- func PresentationCatalogSHA256(catalog PresentationCatalog) (string, error)
- func Validate(m Manifest) error
- type BackgroundSpec
- type BackgroundStartStrategy
- type CancelPolicySpec
- type CapabilityBinding
- type CompiledMethodSchemas
- type ConfirmationMode
- type ConfirmationSpec
- type FeatureID
- type IntentSpec
- type LocalizedSettingPresentation
- type LocalizedSurfacePresentation
- type Manifest
- type MethodBrokerAccessSpec
- type MethodEffect
- type MethodExecutionMode
- type MethodRouteKind
- type MethodRouteSpec
- type MethodSpec
- type NetworkAccessSpec
- type NetworkBrokerAccessSpec
- type NetworkConnectorSpec
- type PermissionID
- type Plugin
- type PresentationCatalog
- type PresentationIconSpec
- type PresentationLocale
- type PresentationLocalizationSpec
- type PresentationSpec
- type ProcessBrokerAccessSpec
- type ProcessResourceLimits
- type ProcessSpec
- type PublicAPIRequirement
- type Publisher
- type ResolvedPresentation
- type ResolvedSettingPresentation
- type ResolvedSurfacePresentation
- type SettingFieldSpec
- type SettingOptionSpec
- type SettingsSpec
- type StorageBrokerAccessSpec
- type StorageSpec
- type StoreSpec
- type SurfaceIntent
- type SurfaceKind
- type SurfaceSpec
- type ValidationError
- type WidgetSizeSpec
- type WorkerMode
- type WorkerSpec
Constants ¶
const ( CancelDisableBehaviorCancel = "cancel" CancelDisableBehaviorOrphan = "orphan" CancelDisableBehaviorWait = "wait" CancelUninstallBehaviorCancelThenBlockDelete = "cancel_then_block_delete" CancelUninstallBehaviorForceCleanupAllowed = "force_cleanup_allowed" )
const ( WorkerModeJob WorkerMode = "job" MaxWorkerMemoryLimitBytes int64 = 256 << 20 MaxStorageStores = 16 MaxStoreQuotaBytes int64 = 1 << 30 MaxStoreQuotaFiles int64 = 100_000 DefaultStoreQuotaFiles int64 = 10_000 )
const PluginAPIMajor uint16 = 1
const SchemaVersionV9 = "redevplugin.manifest.v9"
Variables ¶
var ErrUnsupportedFeature = errors.New("UNSUPPORTED_FEATURE")
var ErrUnsupportedPermission = errors.New("UNSUPPORTED_PERMISSION")
Functions ¶
func CanonicalJSON ¶
CanonicalJSON returns the exact hash input for the current manifest.
func DescriptorHashInput ¶
func MarshalCanonical ¶
MarshalCanonical returns the current manifest wire representation. Package installation should retain the original canonical bytes; this encoder is for current in-memory records and deterministic tests only.
func PresentationCatalogSHA256 ¶
func PresentationCatalogSHA256(catalog PresentationCatalog) (string, error)
Types ¶
type BackgroundSpec ¶ added in v3.0.34
type BackgroundSpec struct {
Strategy BackgroundStartStrategy `json:"strategy"`
WorkerID string `json:"worker_id"`
}
type BackgroundStartStrategy ¶ added in v3.0.34
type BackgroundStartStrategy string
const ( BackgroundRuntimeStart BackgroundStartStrategy = "runtime_start" BackgroundOnDemand BackgroundStartStrategy = "on_demand" )
type CancelPolicySpec ¶
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 FeatureID ¶
type FeatureID string
const ( FeatureIOStream FeatureID = "io.stream.v1" FeatureFSWorkspace FeatureID = "fs.workspace.v1" FeatureFSHome FeatureID = "fs.home.v1" FeatureFSEnvironment FeatureID = "fs.environment.v1" FeatureFSWatch FeatureID = "fs.watch.v1" FeatureNetHTTP FeatureID = "net.http.v1" FeatureNetWebSocket FeatureID = "net.websocket.v1" FeatureNetTCP FeatureID = "net.tcp.v1" FeatureNetUDP FeatureID = "net.udp.v1" FeatureProcessLocal FeatureID = "process.local.v1" )
type IntentSpec ¶
type LocalizedSettingPresentation ¶
type LocalizedSettingPresentation struct {
Key string `json:"key"`
Label string `json:"label"`
Options []SettingOptionSpec `json:"options"`
}
type Manifest ¶
type Manifest struct {
SchemaVersion string `json:"schema_version"`
Publisher Publisher `json:"publisher"`
Plugin Plugin `json:"plugin"`
API PublicAPIRequirement `json:"api"`
Permissions []PermissionID `json:"permissions"`
Presentation PresentationSpec `json:"presentation"`
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"`
Process *ProcessSpec `json:"process,omitempty"`
Background *BackgroundSpec `json:"background,omitempty"`
Settings *SettingsSpec `json:"settings,omitempty"`
Intents []IntentSpec `json:"intents,omitempty"`
}
func DecodeCanonical ¶ added in v3.0.33
DecodeCanonical validates the current manifest and returns both its normalized value and original canonical wire representation used for signatures and hashes. It returns no canonical bytes when any manifest validation fails.
func (Manifest) OptionalFeatureIDs ¶
func (Manifest) PermissionIDs ¶
func (m Manifest) PermissionIDs() []PermissionID
func (Manifest) PresentationCatalog ¶
func (m Manifest) PresentationCatalog() PresentationCatalog
func (Manifest) RequiredFeatureIDs ¶
type MethodBrokerAccessSpec ¶
type MethodBrokerAccessSpec struct {
Storage []StorageBrokerAccessSpec `json:"storage,omitempty"`
Network []NetworkBrokerAccessSpec `json:"network,omitempty"`
Process []ProcessBrokerAccessSpec `json:"process,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 ¶
type NetworkConnectorSpec ¶
type PermissionID ¶
type PermissionID string
const ( PermissionFSWorkspaceRead PermissionID = "fs.workspace.read" PermissionFSWorkspaceWrite PermissionID = "fs.workspace.write" PermissionFSHomeRead PermissionID = "fs.home.read" PermissionFSHomeWrite PermissionID = "fs.home.write" PermissionFSEnvironmentRead PermissionID = "fs.environment.read" PermissionFSEnvironmentWrite PermissionID = "fs.environment.write" PermissionNetworkClient PermissionID = "network.client" PermissionNetworkListen PermissionID = "network.listen" PermissionProcessLocal PermissionID = "process.local" )
type PresentationCatalog ¶
type PresentationCatalog struct {
DefaultLocale string `json:"default_locale"`
Locales []PresentationLocale `json:"locales"`
Icon *PresentationIconSpec `json:"icon,omitempty"`
}
type PresentationIconSpec ¶
type PresentationIconSpec struct {
Path string `json:"path"`
}
type PresentationLocale ¶
type PresentationLocale struct {
Locale string `json:"locale"`
PluginName string `json:"plugin_name"`
PublisherName string `json:"publisher_name,omitempty"`
Summary string `json:"summary"`
Description []string `json:"description"`
Highlights []string `json:"highlights"`
Keywords []string `json:"keywords"`
Surfaces []ResolvedSurfacePresentation `json:"surfaces"`
Settings []ResolvedSettingPresentation `json:"settings"`
}
type PresentationLocalizationSpec ¶
type PresentationLocalizationSpec struct {
Locale string `json:"locale"`
PluginName string `json:"plugin_name"`
PublisherName string `json:"publisher_name,omitempty"`
Summary string `json:"summary"`
Description []string `json:"description"`
Highlights []string `json:"highlights"`
Keywords []string `json:"keywords"`
Surfaces []LocalizedSurfacePresentation `json:"surfaces"`
Settings []LocalizedSettingPresentation `json:"settings"`
}
type PresentationSpec ¶
type PresentationSpec struct {
DefaultLocale string `json:"default_locale"`
Summary string `json:"summary"`
Description []string `json:"description"`
Highlights []string `json:"highlights"`
Keywords []string `json:"keywords"`
Localizations []PresentationLocalizationSpec `json:"localizations"`
Icon *PresentationIconSpec `json:"icon,omitempty"`
}
type ProcessBrokerAccessSpec ¶ added in v3.0.34
type ProcessBrokerAccessSpec struct {
Operations []string `json:"operations"`
}
type ProcessResourceLimits ¶ added in v3.0.34
type ProcessSpec ¶ added in v3.0.34
type ProcessSpec struct {
ResourceLimits ProcessResourceLimits `json:"resource_limits,omitempty"`
}
type PublicAPIRequirement ¶
type ResolvedPresentation ¶
type ResolvedPresentation struct {
RequestedLocale string `json:"requested_locale,omitempty"`
ResolvedLocale string `json:"resolved_locale"`
DefaultLocale string `json:"default_locale"`
PluginName string `json:"plugin_name"`
PublisherName string `json:"publisher_name,omitempty"`
Summary string `json:"summary"`
Description []string `json:"description"`
Highlights []string `json:"highlights"`
Keywords []string `json:"keywords"`
Surfaces []ResolvedSurfacePresentation `json:"surfaces"`
Settings []ResolvedSettingPresentation `json:"settings"`
Icon *PresentationIconSpec `json:"icon,omitempty"`
}
func ResolvePresentation ¶
func ResolvePresentation(catalog PresentationCatalog, requestedLocale string) ResolvedPresentation
type ResolvedSettingPresentation ¶
type ResolvedSettingPresentation struct {
Key string `json:"key"`
Label string `json:"label"`
Options []SettingOptionSpec `json:"options"`
}
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 []SettingOptionSpec `json:"options,omitempty"`
Validation map[string]any `json:"validation,omitempty"`
}
type SettingOptionSpec ¶
type SettingsSpec ¶
type SettingsSpec struct {
SchemaVersion int `json:"schema_version"`
Fields []SettingFieldSpec `json:"fields,omitempty"`
}
type StorageBrokerAccessSpec ¶
type StorageSpec ¶
type StorageSpec struct {
Stores []StoreSpec `json:"stores,omitempty"`
}
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 ¶
func (ValidationError) Error ¶
func (e ValidationError) Error() string
type WidgetSizeSpec ¶
type WorkerMode ¶
type WorkerMode string