@paged-media/plugin-api 0.2.16-canary.0 → 0.2.19-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.
@@ -1 +1 @@
1
- export type { ShellRegistries, ToolRegistry, PanelRegistry, CommandRegistry, KeybindingRegistry, OverlayRegistry, EditContextRegistry, ObjectTypeRegistry, ImporterRegistry, ExporterRegistry, ToolContribution, ToolId, ToolGroupId, ToolSectionId, ToolOptionsSpec, ToolOptionField, CursorSpec, CssCursorToken, GestureHandler, CanvasPointerEvent, OverlayContext, OverlayPrimitive, DeactivateReason, PanelContribution, PanelProps, PanelApi, OverlayContribution, OverlayProps, OverlayPageRect, CommandContribution, KeybindingContribution, ImporterContribution, ImportRequest, ExporterContribution, ExportResult, DockEdge, VisibilityPredicate, PagedEditor, PagedClient, ToolPreviewShape, ToolPreviewPolyline, ToolPreviewPath, MarqueeRectPageLocal, } from "./editor";
1
+ export type { ShellRegistries, ToolRegistry, PanelRegistry, CommandRegistry, KeybindingRegistry, OverlayRegistry, EditContextRegistry, ObjectTypeRegistry, ImporterRegistry, ExporterRegistry, ToolContribution, ToolId, ToolGroupId, ToolSectionId, ToolOptionsSpec, ToolOptionField, CursorSpec, CssCursorToken, GestureHandler, CanvasPointerEvent, OverlayContext, OverlayPrimitive, DeactivateReason, PanelContribution, PanelProps, PanelApi, OverlayContribution, OverlayProps, OverlayPageRect, CommandContribution, KeybindingContribution, ImporterContribution, ImportRequest, ExporterContribution, ExportResult, DockEdge, VisibilityPredicate, PagedEditor, PagedClient, ImageResourceClaim, ResourceTilesNeeded, ToolPreviewShape, ToolPreviewPolyline, ToolPreviewPath, MarqueeRectPageLocal, } from "./editor";
package/dist/editor.d.ts CHANGED
@@ -1,6 +1,21 @@
1
1
  import type { ComponentType } from "react";
2
2
  import type { EditContextContribution, ObjectTypeContribution } from "./host";
3
- import type { CollectionName, ContentSelection, DocumentMeta, ElementGeometryItem, ElementId, MainToWorkerKind, Mutation, PageId, PathAnchorsResult, SceneLayer, SelectionMode, WorkerToMain } from "./wire";
3
+ import type { CollectionName, ContentSelection, DocumentMeta, ElementGeometryItem, ElementId, MainToWorkerKind, Mutation, PageId, PathAnchorsResult, ProviderTileWire, ResourceTilesNeededWire, SceneLayer, SelectionMode, WorkerToMain } from "./wire";
4
+ /** C-6 (I-06) — the editor-channel claim shape (the v44
5
+ * `claimImageResource` payload, named for the `PagedEditor.images`
6
+ * member). The SDK adapter derives it from
7
+ * `ImageResourceClaimOptions` + the bundle-supplied revision. */
8
+ export interface ImageResourceClaim {
9
+ imageId: string;
10
+ levels: number;
11
+ tileSize: number;
12
+ baseWidth: number;
13
+ baseHeight: number;
14
+ revision: number;
15
+ }
16
+ /** C-6 — the worker's tile-miss notification, as the editor channel
17
+ * surfaces it (the v44 `resourceTilesNeeded` payload). */
18
+ export type ResourceTilesNeeded = ResourceTilesNeededWire;
4
19
  export interface Disposable {
5
20
  dispose(): void;
6
21
  }
@@ -386,6 +401,23 @@ export interface PagedEditor {
386
401
  submit(elementId: string, layer: SceneLayer): Promise<void>;
387
402
  clear(elementId: string): Promise<void>;
388
403
  };
404
+ /** C-6 (I-06) — the renderer RESOURCE-PROVIDER channel. The editor
405
+ * routes these to the canvas-wasm `claimImageResource` /
406
+ * `submitResourceTiles` / `releaseImageResource` messages (the v44
407
+ * wire) AND surfaces the worker's `resourceTilesNeeded` events
408
+ * (`onResourceTilesNeeded`) so the SDK adapter can pull + submit the
409
+ * tiles. `undefined` when the host build wires no resource channel
410
+ * (headless / older editor); `host.images.claimImageResource()` then
411
+ * warns + no-ops and `supports("rendering.resourceProvider@1")` is
412
+ * false. All four members mirror the editor's CanvasClient surface. */
413
+ images?: {
414
+ claim(claim: ImageResourceClaim): Promise<void>;
415
+ release(imageId: string): Promise<void>;
416
+ submitTiles(imageId: string, level: number, tiles: ProviderTileWire[], generation: number): Promise<void>;
417
+ /** Subscribe to the worker's `resourceTilesNeeded` notifications
418
+ * (worker → main). The returned function unsubscribes. */
419
+ onResourceTilesNeeded(listener: (need: ResourceTilesNeeded) => void): () => void;
420
+ };
389
421
  overlaySignals: {
390
422
  setToolPreview(value: ToolPreviewShape | null): void;
391
423
  };
package/dist/host.d.ts CHANGED
@@ -275,6 +275,166 @@ export interface SceneLayerSurface extends Disposable {
275
275
  * content). */
276
276
  clear(elementId: string): Promise<void>;
277
277
  }
278
+ /** One pyramid tile the bundle's `source` callback returns (C-6). `rgba`
279
+ * is tightly packed RGBA8 (`width*height*4` bytes, row-major); `[x, y]`
280
+ * is the tile's origin in LEVEL-space px (the provider's grid origin at
281
+ * that mip level). Returning `null` is the honest "no pixels for this
282
+ * tile yet" answer — the renderer keeps the best cached/fallback level. */
283
+ export interface TileBytes {
284
+ /** Tile origin x in level-space px. */
285
+ x: number;
286
+ /** Tile origin y in level-space px. */
287
+ y: number;
288
+ /** Pixel width of the buffer. */
289
+ width: number;
290
+ /** Pixel height of the buffer. */
291
+ height: number;
292
+ /** Tightly packed RGBA8, row-major (`width*height*4` bytes). */
293
+ rgba: Uint8Array;
294
+ }
295
+ /** What `host.images.claimImageResource` is handed (C-6). The first four
296
+ * fields describe the provider-owned pyramid; `source` serves a tile,
297
+ * `revision` is a monotonic damage signal (bump it and the renderer
298
+ * re-pulls — same etag discipline as the data provider). */
299
+ export interface ImageResourceClaimOptions {
300
+ /** Number of mip levels the provider serves (0 = full res; each level
301
+ * halves). */
302
+ levels: number;
303
+ /** Tile edge in level-space px (the grid step). */
304
+ tileSize: number;
305
+ /** Natural pixel width of the level-0 image. */
306
+ baseWidth: number;
307
+ /** Natural pixel height of the level-0 image. */
308
+ baseHeight: number;
309
+ /** Serve one tile at pyramid `level` whose origin is `(x, y)` in
310
+ * level-space px, or `null` when the provider has no pixels for it
311
+ * yet (the renderer holds the fallback level). Invoked by the SDK
312
+ * adapter for each tile the renderer reports needing. */
313
+ source(level: number, x: number, y: number): Promise<TileBytes | null>;
314
+ /** The current content revision — a monotonic counter the SDK sends
315
+ * on claim; bump the value your closure returns and re-claim (or rely
316
+ * on the renderer's damage) to invalidate. */
317
+ revision(): number;
318
+ }
319
+ /**
320
+ * The renderer resource-provider door (C-6 / I-06). A bundle claims a
321
+ * placed image's tiled mip pyramid; the renderer pulls tiles at the
322
+ * level its current scale needs. The SDK adapter owns the
323
+ * needed → source → submit plumbing (the bundle supplies only the
324
+ * `source` + `revision` callbacks). Always present — when the host wires
325
+ * no resource channel, `claimImageResource` warns + returns an inert
326
+ * Disposable and `supports("rendering.resourceProvider@1")` is false (the
327
+ * honest no-provider door). Capability-gated: `capabilities.rendering`
328
+ * must include `"resourceProvider"`.
329
+ */
330
+ export interface ImagesSurface {
331
+ /** Claim `elementId`'s image resource (the v44 wire's `image_id`). The
332
+ * renderer registers the claim and pulls tiles as it composites;
333
+ * disposing the returned handle releases the claim (the renderer drops
334
+ * to the whole-image fallback lane). */
335
+ claimImageResource(elementId: string, opts: ImageResourceClaimOptions): Disposable;
336
+ }
337
+ /** Options for `host.workers.spawn` (K-3). `module` is a bundle-relative
338
+ * path the host resolves through the bundle's own asset base (the same
339
+ * `/@fs/`-allowed sibling path the wasm artifacts use) — never an
340
+ * arbitrary URL. `name` is an optional debug label. */
341
+ export interface SpawnWorkerOptions {
342
+ /** Bundle-relative path to the worker module (an ES-module worker — JS
343
+ * or wasm-bindgen worker glue). Resolved through the bundle's asset
344
+ * base; a bundle can only spawn a module it ships. */
345
+ module: string;
346
+ /** Optional debug label (surfaced in the host log / devtools). */
347
+ name?: string;
348
+ }
349
+ /**
350
+ * A host-spawned, bundle-owned worker (K-3). Talk over `post`/`onMessage`
351
+ * (structured-clone, optional transfer); `allocateShared` hands back a
352
+ * host-budgeted `SharedArrayBuffer` (or `null` when SAB is unavailable or
353
+ * the bundle didn't declare `sharedMemory` / would exceed its budget).
354
+ * `terminate` stops the worker — and the host runs it automatically on
355
+ * bundle dispose, so a bundle that forgets to terminate still leaks
356
+ * nothing (the platform-honesty smoke test by construction).
357
+ */
358
+ export interface BundleWorker {
359
+ /** Post a message to the worker (structured-clone; `transfer` moves
360
+ * ownership of the listed transferables, e.g. an `ArrayBuffer`). */
361
+ post(message: unknown, transfer?: Transferable[]): void;
362
+ /** Subscribe to messages FROM the worker. Dispose to stop listening
363
+ * (and free the listener); all subscriptions drop on `terminate`. */
364
+ onMessage(handler: (message: unknown) => void): Disposable;
365
+ /**
366
+ * Allocate a `SharedArrayBuffer` of `bytes` for zero-copy hand-off,
367
+ * host-budgeted against the per-bundle shared-memory ceiling. Returns
368
+ * `null` when the bundle did not declare `capabilities.workers.
369
+ * sharedMemory`, the environment is not cross-origin-isolated (SAB is
370
+ * unconstructible), or the request would exceed the budget — the
371
+ * honest, frequent answer. Pass the returned buffer through `post` to
372
+ * share it with the worker.
373
+ */
374
+ allocateShared(bytes: number): SharedArrayBuffer | null;
375
+ /** Stop the worker + drop its listeners. Idempotent; also run by the
376
+ * host on bundle dispose. */
377
+ terminate(): void;
378
+ }
379
+ /**
380
+ * The capability-gated WORKER door (K-3 / S-07 / I-02). `spawn` resolves
381
+ * a bundle-relative `module`, constructs a host-owned `Worker`, and tracks
382
+ * it for automatic teardown. Always present — when the host injects no
383
+ * `WorkerBackend`, `spawn` REJECTS honestly (no worker realm to give) and
384
+ * `supports("workers@1")` is false. Capability-gated:
385
+ * `capabilities.workers` must be declared (the host gate throws on an
386
+ * undeclared spawn); the granted worker-count cap is
387
+ * `min(declared.max, hardwareConcurrency, 8)` (read it via `concurrency`).
388
+ */
389
+ export interface WorkersSurface {
390
+ /** Spawn `opts.module` (a declared, bundle-relative path) as a
391
+ * host-owned `BundleWorker`. Rejects when the use is undeclared
392
+ * (capability gate), the host wired no backend, the count cap is
393
+ * reached, or the module fails to resolve/construct. */
394
+ spawn(opts: SpawnWorkerOptions): Promise<BundleWorker>;
395
+ /** The granted worker-count cap (`min(declared.max, hardwareConcurrency,
396
+ * 8)`, or 0 when undeclared / no backend) — a bundle sizes its pool to
397
+ * this rather than guessing. */
398
+ concurrency(): number;
399
+ }
400
+ /** The secret a `host.secrets.set` carries (D-11). v1 is a connection
401
+ * string / token / password as a UTF-8 string — opaque to the contract;
402
+ * the host stores it under the `ref` and injects it at attach/fetch time.
403
+ * This is the ONLY place a secret value crosses the door, inbound; there
404
+ * is no outbound read (no `get`). */
405
+ export type SecretMaterial = string;
406
+ /**
407
+ * The capability-gated, REFERENCE-ONLY credential store (D-11;
408
+ * rfc-credential-store). The plugin maps a source to a `credentialRef`
409
+ * string and asks the host to `set` (prompting the user), `exists`, or
410
+ * `forget` it — but it can NEVER read the secret back. `set` resolves once
411
+ * the host has stored the material (its backing decides whether to prompt;
412
+ * the editor reference backing PROMPTS — "via host UI only"). Always
413
+ * present — when the host injects no `SecretStoreBackend`, `set`/`forget`
414
+ * reject and `exists` answers `false` (the honest no-store door), and
415
+ * `supports("secrets@1")` is false. Capability-gated:
416
+ * `capabilities.secrets` must be declared (the host gate throws on an
417
+ * undeclared use).
418
+ *
419
+ * NOTE: this surface has NO `get`. That absence IS the contract (the
420
+ * trust line — secret bytes never enter the plugin realm); a `get` here
421
+ * would defeat the entire D-11 design.
422
+ */
423
+ export interface SecretsSurface {
424
+ /** Store `secret` under `ref` (the editor backing PROMPTS the user — the
425
+ * RFC's "via host UI only"). Rejects when undeclared (capability gate),
426
+ * no backend is wired, or the user declines the prompt. The plugin
427
+ * keeps only the `ref`. */
428
+ set(ref: string, secret: SecretMaterial): Promise<void>;
429
+ /** Does the host hold a secret under `ref`? `false` when none is stored
430
+ * OR no backend is wired (the honest no-store answer). A bundle uses
431
+ * this to decide whether a source still needs its credential entered. */
432
+ exists(ref: string): Promise<boolean>;
433
+ /** Forget the secret under `ref` (the source goes inert until re-entered
434
+ * — the RFC's honest degradation). Idempotent; rejects only when the
435
+ * door is undeclared (capability gate). A no-op when no backend wired. */
436
+ forget(ref: string): Promise<void>;
437
+ }
278
438
  /** Expected mutation failures are results, not throws — mirroring the
279
439
  * editor's mutate-never-throws convention. */
280
440
  export type MutationOutcome = {
@@ -697,6 +857,32 @@ export interface BundleHost {
697
857
  * `supports("assets.fonts@1")` is false. Capability-gated:
698
858
  * `getFontFace` requires `capabilities.assets` ∋ `"fonts"`. */
699
859
  readonly assets: AssetSurface;
860
+ /** The capability-gated RENDERER RESOURCE-PROVIDER door (C-6 / I-06):
861
+ * claim a placed image's tiled mip pyramid so the renderer pulls tiles
862
+ * at the level its current scale needs (the v44 wire). The SDK adapter
863
+ * owns the needed → source → submit plumbing; the bundle supplies the
864
+ * `source` + `revision` callbacks. Always present — when the host wires
865
+ * no resource channel, `claimImageResource` warns + returns an inert
866
+ * Disposable and `supports("rendering.resourceProvider@1")` is false.
867
+ * Capability-gated on `capabilities.rendering` ∋ `"resourceProvider"`. */
868
+ readonly images: ImagesSurface;
869
+ /** The capability-gated WORKER door (K-3 / S-07 / I-02): spawn a
870
+ * host-owned, bundle-owned worker (declared-only module, no ambient
871
+ * authority) + allocate a host-budgeted `SharedArrayBuffer`. Always
872
+ * present — when the host injects no `WorkerBackend`, `spawn` rejects
873
+ * honestly, `concurrency()` is 0, and `supports("workers@1")` is false.
874
+ * Capability-gated on `capabilities.workers`. The host facade tracks
875
+ * every spawned worker for automatic teardown on bundle dispose. */
876
+ readonly workers: WorkersSurface;
877
+ /** The capability-gated, REFERENCE-ONLY CREDENTIAL STORE (D-11;
878
+ * rfc-credential-store): `set` (host-UI-prompted) / `exists` / `forget`
879
+ * a `credentialRef` — and DELIBERATELY NO `get` (secret bytes never
880
+ * enter the plugin realm; the HOST injects them at the attach/fetch
881
+ * door). Always present — when the host injects no `SecretStoreBackend`,
882
+ * `set`/`forget` reject, `exists` is false, and `supports("secrets@1")`
883
+ * is false (the honest no-store door). Capability-gated on
884
+ * `capabilities.secrets`. */
885
+ readonly secrets: SecretsSurface;
700
886
  /** The capability-gated CLIPBOARD door (K-6 / S-14): read/write the
701
887
  * SYSTEM clipboard with a rich `{ text?, tabular? }` payload (the
702
888
  * sheets grid's range copy/paste interchange). Always present — when
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- export type { PluginId, PluginManifest, PluginCapabilities, PluginContributions, NetworkCapability, DataProvidersCapability, StorageCapability, WasmArtifact, WasmPurpose, } from "./manifest";
1
+ export type { PluginId, PluginManifest, PluginCapabilities, PluginContributions, NetworkCapability, DataProvidersCapability, StorageCapability, WasmArtifact, WasmPurpose, WorkersCapability, SecretsCapability, } from "./manifest";
2
2
  export type { BundleHandle, PagedBundle } from "./bundle";
3
- export type { BundleHost, ContributionSurface, SceneLayerSurface, 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";
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";
5
5
  export type { WidgetSurface, CodeEditorProps, CodeEditorDiagnostic, CodeEditorLanguage, } from "./widgets";
6
6
  export type { AssetSurface, AssetKind, FontFaceAsset, FontFaceFormat, } from "./assets";
7
+ export type { ProviderTileWire } from "./wire";
7
8
  export type { ClipboardSurface, ClipboardPayload, TabularClipboard, } from "./clipboard";
8
9
  export type * from "./contributions";
9
10
  export type * from "./mutations";
@@ -28,13 +28,14 @@ export interface PluginCapabilities {
28
28
  read?: "broad" | "scoped";
29
29
  write?: "broad" | "scoped";
30
30
  };
31
- /** Render-pipeline surfaces the bundle uses. v0: `overlay` means
32
- * the shared TS overlay signals (tool previews) AND
33
- * `contribute.overlay`; `hitTest` gates `document.hitTest`;
34
- * `sceneLayer` is reserved for the P2 channel. Declaring a surface
35
- * is the prerequisite for the matching door (the host gate throws
36
- * on an undeclared use). */
37
- rendering?: Array<"sceneLayer" | "overlay" | "hitTest">;
31
+ /** Render-pipeline surfaces the bundle uses. `overlay` means the
32
+ * shared TS overlay signals (tool previews) AND `contribute.overlay`;
33
+ * `hitTest` gates `document.hitTest`; `sceneLayer` gates the in-frame
34
+ * `contribute.sceneLayer()` channel (C-1); `resourceProvider` gates
35
+ * the renderer pyramid-tile door `host.images.claimImageResource`
36
+ * (C-6 / I-06). Declaring a surface is the prerequisite for the
37
+ * matching door (the host gate throws on an undeclared use). */
38
+ rendering?: Array<"sceneLayer" | "overlay" | "hitTest" | "resourceProvider">;
38
39
  /** The bundle registers keybindings directly via
39
40
  * `contribute.keybinding`. Keybindings have no id to list under
40
41
  * `contributes`, so this boolean is their declaration. v0 first-
@@ -111,6 +112,66 @@ export interface PluginCapabilities {
111
112
  * JS. Threads/SharedArrayBuffer are OFF in v1.
112
113
  */
113
114
  wasm?: WasmArtifact[];
115
+ /**
116
+ * Worker spawn + SharedArrayBuffer reach the bundle declares (K-3 /
117
+ * S-07 / I-02). Gates `host.workers`: a bundle CANNOT spawn a worker
118
+ * without declaring it, and only modules listed under a declared path
119
+ * (bundle-relative, like the wasm artifacts) may be spawned — never an
120
+ * arbitrary URL. `max` is the worker-count ceiling the host grants
121
+ * (clamped to `min(declared, hardwareConcurrency, 8)`); `sharedMemory`
122
+ * declares `SharedArrayBuffer` use (gates `allocateShared`; absent ⇒
123
+ * message-copy only). Declaring `workers` is the prerequisite for the
124
+ * door (the host gate throws on an undeclared spawn).
125
+ *
126
+ * The worker gets NO ambient authority — no engine/DOM/network handle,
127
+ * only the bundle's already-gated JS talks to it; the SAB is a separate
128
+ * bundle-owned allocation, host-budgeted (a per-bundle shared-memory
129
+ * ceiling the host enforces, default 256 MiB, which a manifest
130
+ * `maxSharedBytes` may only TIGHTEN). v1 stance: honesty +
131
+ * accident-prevention, not a security boundary (the isolate migration
132
+ * is the real boundary). See the K-3 design note.
133
+ */
134
+ workers?: WorkersCapability;
135
+ /**
136
+ * The host CREDENTIAL-STORE door's grant (D-11; rfc-credential-store).
137
+ * Gates `host.secrets`: a bundle that does not declare `secrets` cannot
138
+ * reach the store (the host gate throws). `sources: true` is the v1
139
+ * grant — credentials for authenticated DB-attach / remote sources.
140
+ *
141
+ * The store is REFERENCE-ONLY and host-owned: a bundle holds
142
+ * `credentialRef` strings (e.g. `keychain:source-4`), NEVER secret
143
+ * material. The surface has `set` (host-UI-prompted) / `exists` /
144
+ * `forget` and DELIBERATELY NO `get` — secret bytes never enter the
145
+ * plugin realm. The plugin passes the ref to the host attach/fetch door
146
+ * and the HOST injects the connection string / Authorization header on
147
+ * its side of the wire (pairs with the D-03 consent door). See the RFC
148
+ * and DESIGN.md §16.
149
+ */
150
+ secrets?: SecretsCapability;
151
+ }
152
+ /** Credential-store declaration (D-11; rfc-credential-store). `sources`
153
+ * gates the `host.secrets` door for authenticated DB-attach / remote
154
+ * sources — the v1 (and only) grant. A closed vocabulary so the host can
155
+ * reason about it; an absent/false `sources` denies the door. */
156
+ export interface SecretsCapability {
157
+ /** Grant the credential store for data sources (DB-attach / remote). */
158
+ sources: boolean;
159
+ }
160
+ /** Worker spawn + SAB declaration (K-3 / S-07). `max` is the requested
161
+ * worker-count ceiling (the host clamps to a hard cap); `sharedMemory`
162
+ * declares `SharedArrayBuffer` use; `maxSharedBytes`, when present,
163
+ * REQUESTS a per-bundle shared-memory ceiling — the host enforces the
164
+ * stricter of it and its hard cap. */
165
+ export interface WorkersCapability {
166
+ /** Worker-count ceiling the bundle requests; the host grants
167
+ * `min(max, hardwareConcurrency, 8)`. */
168
+ max: number;
169
+ /** Declares `SharedArrayBuffer` use — gates `BundleWorker.allocateShared`.
170
+ * Absent/false ⇒ message-copy only (`allocateShared` returns `null`). */
171
+ sharedMemory?: boolean;
172
+ /** Optional per-bundle shared-memory ceiling, in bytes. Tightens —
173
+ * never widens — the host's hard cap (default 256 MiB). */
174
+ maxSharedBytes?: number;
114
175
  }
115
176
  /** Persistent binary-storage declaration (K-4 / S-08). `blob` gates the
116
177
  * OPFS-backed `host.blob` byte store; `quotaBytes` requests a ceiling
package/dist/wire.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // GENERATED — do not edit. Vendored verbatim from the published
2
2
  // @paged-media/canvas-wasm .d.ts (tsify output from paged-media/core,
3
3
  // MPL-2.0 OR PMEL). Sync: node scripts/sync-wire.mjs · Check: --check.
4
- // Synced from @paged-media/canvas-wasm@0.44.0
4
+ // Synced from @paged-media/canvas-wasm@0.44.1
5
5
  /* tslint:disable */
6
6
  /* eslint-disable */
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paged-media/plugin-api",
3
- "version": "0.2.16-canary.0",
3
+ "version": "0.2.19-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",
@@ -59,7 +59,8 @@
59
59
  "enum": [
60
60
  "sceneLayer",
61
61
  "overlay",
62
- "hitTest"
62
+ "hitTest",
63
+ "resourceProvider"
63
64
  ]
64
65
  }
65
66
  },
@@ -134,6 +135,42 @@
134
135
  "full"
135
136
  ]
136
137
  },
138
+ "workers": {
139
+ "type": "object",
140
+ "description": "Worker spawn + SharedArrayBuffer (K-3 / S-07 / I-02). 'max' is the worker-count ceiling requested (host clamps to min(declared, hardwareConcurrency, 8)); 'sharedMemory' declares SAB use (gates allocateShared); 'maxSharedBytes' requests a per-bundle shared-memory ceiling (host enforces the stricter of it and its 256 MiB default cap). Gates host.workers.",
141
+ "additionalProperties": false,
142
+ "required": [
143
+ "max"
144
+ ],
145
+ "properties": {
146
+ "max": {
147
+ "type": "integer",
148
+ "minimum": 1,
149
+ "maximum": 8
150
+ },
151
+ "sharedMemory": {
152
+ "type": "boolean"
153
+ },
154
+ "maxSharedBytes": {
155
+ "type": "integer",
156
+ "minimum": 1,
157
+ "maximum": 268435456
158
+ }
159
+ }
160
+ },
161
+ "secrets": {
162
+ "type": "object",
163
+ "description": "Host credential-store door (D-11; rfc-credential-store). 'sources' grants host.secrets for authenticated DB-attach / remote sources. REFERENCE-ONLY + host-owned: plugins hold credentialRef strings, never secret material; the surface has set/exists/forget and NO get. Gates host.secrets.",
164
+ "additionalProperties": false,
165
+ "required": [
166
+ "sources"
167
+ ],
168
+ "properties": {
169
+ "sources": {
170
+ "type": "boolean"
171
+ }
172
+ }
173
+ },
137
174
  "wasm": {
138
175
  "type": "array",
139
176
  "description": "Declared WebAssembly artifacts the bundle ships and loads at runtime (capability-gated, declared-only, budgeted). See docs/wasm-packaging.md.",