Documentation
¶
Index ¶
- Constants
- Variables
- func CanonicalJSON(raw []byte) ([]byte, error)
- func DescriptorHashInput(m Manifest) ([]byte, error)
- func PresentationCatalogSHA256(catalog PresentationCatalog) (string, error)
- func Validate(m Manifest) error
- 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 Model
- type NetworkAccessSpec
- type NetworkBrokerAccessSpec
- type NetworkConnectorSpec
- type PermissionID
- type Plugin
- type PresentationCatalog
- type PresentationIconSpec
- type PresentationLocale
- type PresentationLocalizationSpec
- type PresentationSpec
- 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 (
SchemaVersionV8 = "redevplugin.manifest.v8"
)
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 either the frozen v8 typed manifest or the forward-compatible v9 lossless document.
func DescriptorHashInput ¶
func PresentationCatalogSHA256 ¶
func PresentationCatalogSHA256(catalog PresentationCatalog) (string, error)
Types ¶
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" )
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"`
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"`
Settings *SettingsSpec `json:"settings,omitempty"`
Intents []IntentSpec `json:"intents,omitempty"`
}
func (Manifest) APIVersion ¶
func (Manifest) PresentationCatalog ¶
func (m Manifest) PresentationCatalog() PresentationCatalog
type MethodBrokerAccessSpec ¶
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 Model ¶
type Model struct {
Manifest
SchemaSource string
API PublicAPIRequirement
Permissions []PermissionID
}
Model is the single normalized manifest representation consumed after the decode boundary. Manifest is embedded for source compatibility while downstream packages migrate away from schema-specific fields.
func Normalize ¶
Normalize converts a previously decoded manifest into the current behavior model. It is used by durable-record migration and legacy callers.
func RestoreModel ¶
func RestoreModel(legacy Manifest, source string, api PublicAPIRequirement, permissions []PermissionID) (Model, error)
RestoreModel rebuilds the normalized behavior projection persisted by the registry. The manifest payload remains the legacy-compatible typed form; source and public API fields carry the author schema facts not represented in that payload.
func (Model) OptionalFeatureIDs ¶
func (Model) PermissionIDs ¶
func (m Model) PermissionIDs() []PermissionID
func (Model) RequiredFeatureIDs ¶
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" )
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 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