@paged-media/plugin-sdk 0.2.29-canary.0 → 0.2.30-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.
Files changed (2) hide show
  1. package/dist/index.js +26 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -827,7 +827,7 @@ function createBundleHost(getEditor, manifest, options) {
827
827
  return;
828
828
  }
829
829
  submitted.add(elementId);
830
- await ch.submit(elementId, layer);
830
+ await ch.submit(elementId, layer, manifest.id);
831
831
  },
832
832
  async clear(elementId) {
833
833
  submitted.delete(elementId);
@@ -1597,7 +1597,31 @@ function createBundleHost(getEditor, manifest, options) {
1597
1597
  async write(path, bytes) {
1598
1598
  const reply = await getEditor().client.send({
1599
1599
  kind: "writePagedPart",
1600
- payload: { path: partsFull(path), bytes: Array.from(bytes) }
1600
+ payload: {
1601
+ path: partsFull(path),
1602
+ bytes: Array.from(bytes),
1603
+ // C-34 — DECLARE WHO IS WRITING, so the engine
1604
+ // confines this to `paged/<id>/` instead of trusting that we
1605
+ // built the path correctly. `partsFull` already scopes it;
1606
+ // that is a convention held in THIS file, and a convention is
1607
+ // not a boundary — a bundle reaching the raw handle bypasses
1608
+ // it entirely. Saying the caller moves the check to the one
1609
+ // place that cannot be routed around.
1610
+ //
1611
+ // Safe against an older worker: the wire has no
1612
+ // `deny_unknown_fields`, so an engine without the gate
1613
+ // ignores this and behaves exactly as before. No `supports()`
1614
+ // probe needed — there is no degraded path to choose between.
1615
+ caller: manifest.id
1616
+ }
1617
+ // THE CAST, named rather than left to be discovered. `wire.d.ts`
1618
+ // is vendored from the PUBLISHED `@paged-media/canvas-wasm`
1619
+ // (0.61.0), whose `writePagedPart` has no `caller` — the field
1620
+ // exists in core today and reaches these types only when the
1621
+ // next canvas-wasm publishes and `sync-wire` runs. Same escape-hatch
1622
+ // shape the repo already uses elsewhere: a cast pointing at a
1623
+ // contract that EXISTS AND IS COMMITTED, not at a hope. It
1624
+ // deletes itself at the repin.
1601
1625
  });
1602
1626
  if (reply.kind !== "pagedPartWritten") {
1603
1627
  const err = reply.kind === "pagedPartFailed" ? reply.payload.error : `unexpected ${reply.kind}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paged-media/plugin-sdk",
3
- "version": "0.2.29-canary.0",
3
+ "version": "0.2.30-canary.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  }
12
12
  },
13
13
  "dependencies": {
14
- "@paged-media/plugin-api": "0.2.29-canary.0"
14
+ "@paged-media/plugin-api": "0.2.30-canary.0"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "react": "^18.3.0"