@paged-media/plugin-sdk 0.2.31-canary.0 → 0.2.32-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
@@ -698,19 +698,38 @@ declare function loadBundle(getEditor: () => PagedEditor, bundle: PagedBundle, o
698
698
  * KEEP IN SYNC with plugin-cli's WASM_MAX_* and the schema's `maxBytes`
699
699
  * maximum — the CLI hand-mirrors the contract. */
700
700
  declare const WASM_BUDGETS: {
701
- /** Hard per-artifact byte ceiling for layout/codec/compute. A
702
- * release-optimised wasm layout engine (Blitz-class) lands in the
703
- * low-single-digit MiB; 8 MiB rejects an accidentally-bundled debug
704
- * build while leaving headroom for one real engine. A manifest
705
- * `maxBytes` may only TIGHTEN this. */
701
+ /**
702
+ * THE budget, as of 2026-08-19 (maintainer decision): **100 MB for the
703
+ * whole app including every plugin.**
704
+ *
705
+ * The per-thing ceilings below used to be the governance. They were
706
+ * the wrong shape: each capped one artifact or one bundle, so eight
707
+ * bundles could each pass their own gate while the app shipped a
708
+ * quarter of a gigabyte, and nothing in any repo measured the sum.
709
+ * What a user downloads is the sum, so the sum is what is governed.
710
+ *
711
+ * This constant is the CONTRACT; the enforcement lives where the app
712
+ * is assembled, in the editor's `scripts/wasm-budget.mjs` (run in its
713
+ * `checks` CI job), because only the app knows which bundles ship. It
714
+ * deduplicates by real path — pnpm links one store entry from many
715
+ * packages, and a naive walk over-counts nearly 6x. Measured 2026-08-19:
716
+ * 49.4 MB across 9 distinct artifacts, ~50 MB of headroom.
717
+ */
718
+ readonly maxAppTotalBytes: number;
719
+ /** Per-artifact ceiling for layout/codec/compute. Folded into the
720
+ * app-wide envelope on 2026-08-19 (was 8 MiB, briefly 25): a single
721
+ * artifact is no longer independently interesting, since the sum is
722
+ * bounded. Kept — not deleted — so a manifest `maxBytes` still has
723
+ * something to TIGHTEN and the loader keeps a hard upper stop. */
706
724
  readonly maxArtifactBytes: number;
707
- /** D-07b — the governed HIGHER ceiling for `purpose: "engine"` (a
708
- * vendored DB/query engine like DuckDB-WASM ≈ 36 MiB). 64 MiB fits the
709
- * real artifacts with headroom; still a hard cap a manifest may only
710
- * tighten. Only the `engine` purpose earns it. */
725
+ /** D-07b — was the HIGHER ceiling for `purpose: "engine"` (a vendored
726
+ * DB/query engine like DuckDB-WASM ≈ 36 MiB) back when ordinary
727
+ * artifacts were capped far lower. Now equal to the ordinary cap; the
728
+ * `purpose` distinction survives for governance/telemetry, not size. */
711
729
  readonly maxEngineArtifactBytes: number;
712
- /** Total declared wasm across one bundle. Sized so one `engine`
713
- * artifact + a codec fit. */
730
+ /** Total declared wasm across ONE bundle. Also the app-wide number —
731
+ * one bundle may in principle spend the entire envelope, and the
732
+ * app-wide check is what stops the app as a whole. */
714
733
  readonly maxTotalBytes: number;
715
734
  /** Wall-clock budget for fetch + compile + instantiate. Protects the
716
735
  * editor's main flow from a pathological module; advisory, the loader
package/dist/index.js CHANGED
@@ -2625,20 +2625,39 @@ function loadBundle(getEditor, bundle, options) {
2625
2625
 
2626
2626
  // src/wasm-bundle-loader.ts
2627
2627
  var WASM_BUDGETS = {
2628
- /** Hard per-artifact byte ceiling for layout/codec/compute. A
2629
- * release-optimised wasm layout engine (Blitz-class) lands in the
2630
- * low-single-digit MiB; 8 MiB rejects an accidentally-bundled debug
2631
- * build while leaving headroom for one real engine. A manifest
2632
- * `maxBytes` may only TIGHTEN this. */
2633
- maxArtifactBytes: 8 * 1024 * 1024,
2634
- /** D-07b — the governed HIGHER ceiling for `purpose: "engine"` (a
2635
- * vendored DB/query engine like DuckDB-WASM ≈ 36 MiB). 64 MiB fits the
2636
- * real artifacts with headroom; still a hard cap a manifest may only
2637
- * tighten. Only the `engine` purpose earns it. */
2638
- maxEngineArtifactBytes: 64 * 1024 * 1024,
2639
- /** Total declared wasm across one bundle. Sized so one `engine`
2640
- * artifact + a codec fit. */
2641
- maxTotalBytes: 80 * 1024 * 1024,
2628
+ /**
2629
+ * THE budget, as of 2026-08-19 (maintainer decision): **100 MB for the
2630
+ * whole app including every plugin.**
2631
+ *
2632
+ * The per-thing ceilings below used to be the governance. They were
2633
+ * the wrong shape: each capped one artifact or one bundle, so eight
2634
+ * bundles could each pass their own gate while the app shipped a
2635
+ * quarter of a gigabyte, and nothing in any repo measured the sum.
2636
+ * What a user downloads is the sum, so the sum is what is governed.
2637
+ *
2638
+ * This constant is the CONTRACT; the enforcement lives where the app
2639
+ * is assembled, in the editor's `scripts/wasm-budget.mjs` (run in its
2640
+ * `checks` CI job), because only the app knows which bundles ship. It
2641
+ * deduplicates by real path — pnpm links one store entry from many
2642
+ * packages, and a naive walk over-counts nearly 6x. Measured 2026-08-19:
2643
+ * 49.4 MB across 9 distinct artifacts, ~50 MB of headroom.
2644
+ */
2645
+ maxAppTotalBytes: 100 * 1e3 * 1e3,
2646
+ /** Per-artifact ceiling for layout/codec/compute. Folded into the
2647
+ * app-wide envelope on 2026-08-19 (was 8 MiB, briefly 25): a single
2648
+ * artifact is no longer independently interesting, since the sum is
2649
+ * bounded. Kept — not deleted — so a manifest `maxBytes` still has
2650
+ * something to TIGHTEN and the loader keeps a hard upper stop. */
2651
+ maxArtifactBytes: 100 * 1e3 * 1e3,
2652
+ /** D-07b — was the HIGHER ceiling for `purpose: "engine"` (a vendored
2653
+ * DB/query engine like DuckDB-WASM ≈ 36 MiB) back when ordinary
2654
+ * artifacts were capped far lower. Now equal to the ordinary cap; the
2655
+ * `purpose` distinction survives for governance/telemetry, not size. */
2656
+ maxEngineArtifactBytes: 100 * 1e3 * 1e3,
2657
+ /** Total declared wasm across ONE bundle. Also the app-wide number —
2658
+ * one bundle may in principle spend the entire envelope, and the
2659
+ * app-wide check is what stops the app as a whole. */
2660
+ maxTotalBytes: 100 * 1e3 * 1e3,
2642
2661
  /** Wall-clock budget for fetch + compile + instantiate. Protects the
2643
2662
  * editor's main flow from a pathological module; advisory, the loader
2644
2663
  * aborts with a clear error when exceeded. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paged-media/plugin-sdk",
3
- "version": "0.2.31-canary.0",
3
+ "version": "0.2.32-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.31-canary.0"
14
+ "@paged-media/plugin-api": "0.2.32-canary.0"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "react": "^18.3.0"
@@ -22,7 +22,7 @@
22
22
  }
23
23
  },
24
24
  "devDependencies": {
25
- "@paged-media/canvas-wasm": "0.61.0",
25
+ "@paged-media/canvas-wasm": "0.62.0",
26
26
  "@types/node": "20.19.39",
27
27
  "@types/react": "^18.3.12",
28
28
  "react": "^18.3.0",