@paged-media/plugin-api 0.2.19-canary.0 → 0.2.20-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { PluginId, PluginManifest, PluginCapabilities, PluginContributions, NetworkCapability, DataProvidersCapability, StorageCapability, WasmArtifact, WasmPurpose, WorkersCapability, SecretsCapability, } from "./manifest";
1
+ export type { PluginId, PluginManifest, PluginCapabilities, PluginContributions, NetworkCapability, DataProvidersCapability, StorageCapability, WasmArtifact, WasmPurpose, WorkersCapability, SecretsCapability, GpuCapability, } from "./manifest";
2
2
  export type { BundleHandle, PagedBundle } from "./bundle";
3
3
  export type { BundleHost, ContributionSurface, SceneLayerSurface, ImagesSurface, ImageResourceClaimOptions, TileBytes, WorkersSurface, BundleWorker, SpawnWorkerOptions, SecretsSurface, SecretMaterial, DocumentSurface, SelectionSurface, ViewportSurface, TextSurface, TextMetrics, FrameChainLink, OverlaySurface, ShellSurface, FilePickerOptions, PickedFile, StorageSurface, BlobSurface, BlobUsage, NetworkSurface, ConsentResult, DataProvidersSurface, DataProviderRegistration, DataProviderHandle, DataProviderInfo, DataProviderSnapshot, ProviderSchema, ProviderField, ProviderRecordSet, DiagnosticsSurface, BindingsSurface, Diagnostic, DocumentChangeEvent, MutationOutcome, Disposable, PluginLogger, EditContextContribution, ObjectTypeContribution, EditContextCandidate, EnteredEditContext, ContentPointerEvent, EditContextDescriptor, ObjectTypeDescriptor, PluginMetadataEnvelope, ObjectTypeBaker, BakeContext, } from "./host";
4
4
  export type { PanelSchema, PanelSchemaSection, PanelSchemaRow, SchemaPanelContribution, SchemaPanelRenderer, SchemaPanelRendererProps, WidgetValueBinding, BindingRef, SchemaGate, } from "./panel-schema";
@@ -148,6 +148,38 @@ export interface PluginCapabilities {
148
148
  * and DESIGN.md §16.
149
149
  */
150
150
  secrets?: SecretsCapability;
151
+ /**
152
+ * GPU (WebGPU) usage the bundle declares (I-07 / C-1 Stage B — the
153
+ * buildable, realm-local half; ADR-018). DECLARE-ONLY: this does NOT hand
154
+ * the bundle a `GPUDevice` (the bundle already has `navigator.gpu` in its
155
+ * own JS realm — paged.image's Engine-B drives WebGPU there today). It
156
+ * LEGITIMIZES that usage within the capability contract so the host can
157
+ * surface "this plugin uses the GPU" to the user, exactly as the wasm
158
+ * artifacts are declare-only.
159
+ *
160
+ * `realm: "bundle"` is the ONLY value that validates today: the plugin uses
161
+ * WebGPU in its OWN realm (no host involvement, no zero-copy composite into
162
+ * the page scene). `realm: "shared"` is RESERVED in the vocabulary for the
163
+ * future host-device-sharing path (a host-blessed `GPUDevice` + a
164
+ * `SceneItem::Texture` zero-copy composite) and is REJECTED by validation —
165
+ * that path is blocked on TWO walls (Vello has no external-texture import;
166
+ * WebGPU can't transfer a device across the render-worker/main-thread realm
167
+ * boundary) and stays deferred record-only (ADR-018). There is NO
168
+ * `requestGpuDevice` / device surface; adding one would be a fake.
169
+ */
170
+ gpu?: GpuCapability;
171
+ }
172
+ /** WebGPU usage declaration (I-07 / C-1 Stage B realm-local; ADR-018).
173
+ * DECLARE-ONLY — no device is handed to the bundle. `realm: "bundle"` is the
174
+ * only value validation accepts today (the plugin uses WebGPU in its own JS
175
+ * realm); `realm: "shared"` is reserved for the future host-device-sharing
176
+ * path and rejected until the zero-copy walls lift. A closed vocabulary so
177
+ * the host can reason about the grant. */
178
+ export interface GpuCapability {
179
+ /** `"bundle"` — the plugin uses WebGPU in its own JS realm (the only value
180
+ * accepted today). `"shared"` is reserved for future host-device-sharing
181
+ * (currently rejected by validation). */
182
+ realm: "bundle" | "shared";
151
183
  }
152
184
  /** Credential-store declaration (D-11; rfc-credential-store). `sources`
153
185
  * gates the `host.secrets` door for authenticated DB-attach / remote
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paged-media/plugin-api",
3
- "version": "0.2.19-canary.0",
3
+ "version": "0.2.20-canary.0",
4
4
  "description": "The Paged plugin contract: manifest, bundle lifecycle, the BundleHost surface, and the contribution + engine wire types. Type-only.",
5
5
  "license": "MPL-2.0 OR LicenseRef-PMEL",
6
6
  "type": "module",
@@ -171,6 +171,19 @@
171
171
  }
172
172
  }
173
173
  },
174
+ "gpu": {
175
+ "type": "object",
176
+ "description": "WebGPU usage declaration (I-07 / C-1 Stage B realm-local; ADR-018). DECLARE-ONLY: no GPUDevice is handed to the bundle — it legitimizes the realm-local WebGPU usage the bundle already does in its own JS realm (paged.image Engine-B). realm:\"bundle\" is the only value accepted today; realm:\"shared\" (future host-device-sharing) is reserved and REJECTED until the zero-copy walls lift. No requestGpuDevice surface exists.",
177
+ "additionalProperties": false,
178
+ "required": [
179
+ "realm"
180
+ ],
181
+ "properties": {
182
+ "realm": {
183
+ "const": "bundle"
184
+ }
185
+ }
186
+ },
174
187
  "wasm": {
175
188
  "type": "array",
176
189
  "description": "Declared WebAssembly artifacts the bundle ships and loads at runtime (capability-gated, declared-only, budgeted). See docs/wasm-packaging.md.",