@cueframe/kernel 0.2.31 → 0.2.33

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 (43) hide show
  1. package/dist/_members/errors/registry.d.ts +4 -18
  2. package/dist/_members/render-harness/assetRefs.d.ts +26 -0
  3. package/dist/_members/render-harness/assetRefs.d.ts.map +1 -0
  4. package/dist/_members/render-harness/cardAssetAdmission.d.ts.map +1 -1
  5. package/dist/_members/render-harness/cardFonts.d.ts +13 -0
  6. package/dist/_members/render-harness/cardFonts.d.ts.map +1 -0
  7. package/dist/_members/render-harness/cardRender.d.ts +1 -0
  8. package/dist/_members/render-harness/cardRender.d.ts.map +1 -1
  9. package/dist/_members/render-harness/css-tree-subpaths.d.ts +5 -0
  10. package/dist/_members/render-harness/renderInputAssets.d.ts.map +1 -1
  11. package/dist/authoring.js +2 -2
  12. package/dist/{chunk-UFPIGQWM.js → chunk-3GNTA646.js} +1 -1
  13. package/dist/{chunk-GCRF2RPU.js → chunk-4RREA7VA.js} +7 -6
  14. package/dist/{chunk-XGDPYHQK.js → chunk-A3MXR6JI.js} +39 -4
  15. package/dist/{chunk-NPBY2DID.js → chunk-DLKCGEKP.js} +1 -1
  16. package/dist/{chunk-RHWNZUU3.js → chunk-GMVUJYPM.js} +1 -1
  17. package/dist/{chunk-MN6D3U5N.js → chunk-KSRFYFUZ.js} +8 -1
  18. package/dist/chunk-OSMXQV5V.js +18 -0
  19. package/dist/chunk-RAPDICTC.js +82 -0
  20. package/dist/{chunk-PYJN6R7F.js → chunk-TCYULWNP.js} +1 -1
  21. package/dist/{chunk-ISO3IYNJ.js → chunk-W44ASS4N.js} +2 -2
  22. package/dist/compose.js +4 -4
  23. package/dist/composition/projection.js +2 -2
  24. package/dist/composition-ops.js +5 -5
  25. package/dist/composition.js +2 -2
  26. package/dist/core/render.js +3 -3
  27. package/dist/core/select.js +2 -2
  28. package/dist/core.js +3 -3
  29. package/dist/director/ai-sdk.js +3 -3
  30. package/dist/director/domain.js +2 -2
  31. package/dist/director.js +3 -3
  32. package/dist/errors.js +3 -1
  33. package/dist/primitives/lib/index.js +6 -6
  34. package/dist/primitives/lib.js +6 -6
  35. package/dist/primitives/text.js +2 -2
  36. package/dist/primitives.js +2 -2
  37. package/dist/render-harness/cardAssetAdmission.js +3 -2
  38. package/dist/render-harness/cardFonts.d.ts +1 -0
  39. package/dist/render-harness/cardFonts.js +13 -0
  40. package/dist/render-harness/renderInputAssets.js +2 -1
  41. package/dist/render-harness.js +28 -7
  42. package/package.json +15 -11
  43. package/dist/{chunk-ZS3A3QUM.js → chunk-RBWS5XHE.js} +3 -3
@@ -5,6 +5,8 @@ export interface ErrorSpec {
5
5
  category: ErrorCategory;
6
6
  retryable: boolean;
7
7
  httpStatus: number;
8
+ /** Overrides the derived wait; see `retryAfterSecondsFor`. */
9
+ retryAfterSeconds?: number;
8
10
  }
9
11
  export declare const ERROR_CODES: {
10
12
  readonly unauthorized: {
@@ -499,12 +501,6 @@ export declare const ERROR_CODES: {
499
501
  readonly retryable: false;
500
502
  readonly httpStatus: 422;
501
503
  };
502
- readonly invalid_trim_bounds: {
503
- readonly stage: "validate";
504
- readonly category: "authoring";
505
- readonly retryable: false;
506
- readonly httpStatus: 422;
507
- };
508
504
  readonly invalid_window: {
509
505
  readonly stage: "validate";
510
506
  readonly category: "authoring";
@@ -547,12 +543,6 @@ export declare const ERROR_CODES: {
547
543
  readonly retryable: false;
548
544
  readonly httpStatus: 404;
549
545
  };
550
- readonly no_composition: {
551
- readonly stage: "validate";
552
- readonly category: "authoring";
553
- readonly retryable: false;
554
- readonly httpStatus: 422;
555
- };
556
546
  readonly scratch_not_found: {
557
547
  readonly stage: "validate";
558
548
  readonly category: "authoring";
@@ -583,12 +573,6 @@ export declare const ERROR_CODES: {
583
573
  readonly retryable: false;
584
574
  readonly httpStatus: 413;
585
575
  };
586
- readonly invalid_media_id: {
587
- readonly stage: "validate";
588
- readonly category: "authoring";
589
- readonly retryable: false;
590
- readonly httpStatus: 422;
591
- };
592
576
  readonly invalid_webhook_url: {
593
577
  readonly stage: "validate";
594
578
  readonly category: "authoring";
@@ -1667,6 +1651,8 @@ export declare class CueframeError extends Error {
1667
1651
  export declare function encodeError(e: CueframeError): string;
1668
1652
  export declare function decodeError(msg: string): CueframeError | null;
1669
1653
  export declare function scrubSensitive(s: string): string;
1654
+ /** Seconds to wait before retrying, or undefined when retrying will not help. */
1655
+ export declare function retryAfterSecondsFor(code: ErrorCode): number | undefined;
1670
1656
  export declare function toWireEnvelope(e: Envelope, opts?: {
1671
1657
  trusted?: boolean;
1672
1658
  }): Envelope;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * What counts as a reference to something OUTSIDE this document.
3
+ *
4
+ * Two guards ask that question about card HTML — `cardAssetAdmission`'s CSS/HTML
5
+ * walk and `renderInputAssets`'s `suspiciousUnannotatedAsset` sweep — and they
6
+ * disagreed. The walk knew that `url(#local-id)` is a same-document fragment;
7
+ * the sweep matched a bare `url(` and refused it.
8
+ *
9
+ * The visible cost: an inline `<svg>` using `clip-path="url(#mark-clip)"` passed
10
+ * the guard that understands SVG and was refused by the one that does not, so the
11
+ * org's own logo could not be inlined without rewriting it (CUE-31 sibling,
12
+ * reported 2026-09-17). A fragment reference is the OPPOSITE of remote — it
13
+ * cannot leave the document — and every guard has to agree on that.
14
+ *
15
+ * One definition, imported by both.
16
+ */
17
+ /** `url(#id)`, `href="#id"` — resolves inside this document, never over a network. */
18
+ export declare function isFragmentReference(value: string): boolean;
19
+ /** Every `url(...)` payload in a CSS value, unquoted. */
20
+ export declare function cssUrlPayloads(value: string): string[];
21
+ /**
22
+ * Does this CSS value reach outside the document? True only when it carries a
23
+ * `url()` whose payload is not a same-document fragment.
24
+ */
25
+ export declare function hasNonFragmentCssUrl(value: string): boolean;
26
+ //# sourceMappingURL=assetRefs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assetRefs.d.ts","sourceRoot":"","sources":["../src/assetRefs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,sFAAsF;AACtF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,yDAAyD;AACzD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAEtD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"cardAssetAdmission.d.ts","sourceRoot":"","sources":["../src/cardAssetAdmission.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AA+GzD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAQhE"}
1
+ {"version":3,"file":"cardAssetAdmission.d.ts","sourceRoot":"","sources":["../src/cardAssetAdmission.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AA4GzD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAQhE"}
@@ -0,0 +1,13 @@
1
+ /** The `font-family` stacks a card's HTML declares, deduplicated. */
2
+ export declare function cardFontFamilyStacks(html: string): string[];
3
+ /**
4
+ * The bundled families a card's HTML names, in the order a renderer should load them.
5
+ *
6
+ * The loader half of the same question `assertCardFontsAdmitted` gates on, off the
7
+ * same extraction, so the faces a card is ALLOWED to name and the faces a renderer
8
+ * actually registers cannot drift apart. Entries that are not bundled (a generic,
9
+ * a system face) are dropped: there is nothing to load for them.
10
+ */
11
+ export declare function cardBundledFamilies(html: string): string[];
12
+ export declare function assertCardFontsAdmitted(html: string, locator: string): void;
13
+ //# sourceMappingURL=cardFonts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardFonts.d.ts","sourceRoot":"","sources":["../src/cardFonts.ts"],"names":[],"mappings":"AAqEA,qEAAqE;AACrE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAI3D;AAmCD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAQ1D;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAa3E"}
@@ -5,6 +5,7 @@ export declare function generateCardRootSource(opts: {
5
5
  width: number;
6
6
  height: number;
7
7
  fps: number;
8
+ renderEntryRoot: string;
8
9
  }): string;
9
10
  export declare function generateCardEntrySource(): string;
10
11
  export declare function buildCardWebpackOverride(renderEntryRoot: string): (config: any) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"cardRender.d.ts","sourceRoot":"","sources":["../src/cardRender.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AACvD,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAE1D,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CA6BnG;AAED,wBAAgB,uBAAuB,IAAI,MAAM,CAMhD;AAED,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,MAAM,IACtD,QAAQ,GAAG,SAOpB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CA0D7F"}
1
+ {"version":3,"file":"cardRender.d.ts","sourceRoot":"","sources":["../src/cardRender.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AACvD,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAE1D,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;CACzB,GAAG,MAAM,CAkDT;AAED,wBAAgB,uBAAuB,IAAI,MAAM,CAMhD;AAED,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,MAAM,IACtD,QAAQ,GAAG,SAOpB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAgE7F"}
@@ -9,3 +9,8 @@ declare module 'css-tree/walker' {
9
9
  const walk: typeof import('css-tree').walk;
10
10
  export default walk;
11
11
  }
12
+
13
+ declare module 'css-tree/generator' {
14
+ const generate: typeof import('css-tree').generate;
15
+ export default generate;
16
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"renderInputAssets.d.ts","sourceRoot":"","sources":["../src/renderInputAssets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,OAAO,GACP,cAAc,GACd,MAAM,GACN,YAAY,GACZ,gBAAgB,CAAC;AAErB,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAM/C;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,IAAI,MAAM,GAAG,SAAS,CAAC;IAC1B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AA8GD,wBAAiB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,CAoDpE;AAsBD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,EAAE,CAYhE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CA2C3D"}
1
+ {"version":3,"file":"renderInputAssets.d.ts","sourceRoot":"","sources":["../src/renderInputAssets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzD,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,OAAO,GACP,cAAc,GACd,MAAM,GACN,YAAY,GACZ,gBAAgB,CAAC;AAErB,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAM/C;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,IAAI,MAAM,GAAG,SAAS,CAAC;IAC1B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAkHD,wBAAiB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,CAoDpE;AAsBD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,EAAE,CAYhE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CA2C3D"}
package/dist/authoring.js CHANGED
@@ -48,7 +48,7 @@ import {
48
48
  formatPlanSteps,
49
49
  initCodeGenPrompts
50
50
  } from "./chunk-Y4HPN4BC.js";
51
- import "./chunk-RHWNZUU3.js";
51
+ import "./chunk-GMVUJYPM.js";
52
52
  import {
53
53
  cssLayoutVars
54
54
  } from "./chunk-W5W3FDDI.js";
@@ -62,7 +62,7 @@ import "./chunk-WPZKOVYF.js";
62
62
  import "./chunk-B7J5UUUV.js";
63
63
  import "./chunk-KYRDKK2D.js";
64
64
  import "./chunk-WREYUH2E.js";
65
- import "./chunk-XGDPYHQK.js";
65
+ import "./chunk-A3MXR6JI.js";
66
66
  import "./chunk-7PA7FGLD.js";
67
67
  import {
68
68
  collectSceneClipIssues,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CueframeError,
3
3
  encodeError
4
- } from "./chunk-XGDPYHQK.js";
4
+ } from "./chunk-A3MXR6JI.js";
5
5
 
6
6
  // ../execution/core/src/render/vcam/constants.ts
7
7
  var P_MIN = 0.5;
@@ -1,6 +1,10 @@
1
+ import {
2
+ cssUrlPayloads,
3
+ isFragmentReference
4
+ } from "./chunk-OSMXQV5V.js";
1
5
  import {
2
6
  CueframeError
3
- } from "./chunk-XGDPYHQK.js";
7
+ } from "./chunk-A3MXR6JI.js";
4
8
 
5
9
  // ../execution/render-harness/src/cardAssetAdmission.ts
6
10
  import parseCss from "css-tree/parser";
@@ -41,9 +45,6 @@ var CSS_VALUE_ATTRIBUTES = /* @__PURE__ */ new Set([
41
45
  "mask",
42
46
  "stroke"
43
47
  ]);
44
- function isFragmentReference(value) {
45
- return value.trim().startsWith("#");
46
- }
47
48
  function refuse(locator, reason) {
48
49
  throw new CueframeError(
49
50
  "card_external_asset_forbidden",
@@ -84,8 +85,8 @@ function assertNodeAssetFree(node, locator) {
84
85
  }
85
86
  if (name === "style") assertCssAssetFree(attr.value, "declarationList", locator);
86
87
  if (CSS_VALUE_ATTRIBUTES.has(name)) {
87
- for (const match of attr.value.matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)/gi)) {
88
- if (!isFragmentReference(match[2] ?? "")) {
88
+ for (const payload of cssUrlPayloads(attr.value)) {
89
+ if (!isFragmentReference(payload)) {
89
90
  refuse(locator, `contains an unmanifested ${name} url() asset reference`);
90
91
  }
91
92
  }
@@ -95,9 +95,14 @@ var ERROR_CODES = {
95
95
  brief_graphic_conflict: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
96
96
  brief_graphic_excluded: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
97
97
  brief_graphic_invalid_role: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
98
+ // NOT here on purpose: `invalid_trim_bounds`, `no_composition` and
99
+ // `invalid_media_id` are already mapped by `CODE_ALIASES` in the backend's
100
+ // errors.ts onto the canonical `trim_out_of_bounds` / `invalid_composition`.
101
+ // They were never surfacing as 500s, and registering them directly bypassed
102
+ // the alias and changed the code a caller sees. The alias table is the
103
+ // narrower vocabulary on purpose; leave it owning them.
98
104
  // Composition / timeline authoring
99
105
  invalid_clip_window: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
100
- invalid_trim_bounds: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
101
106
  invalid_window: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
102
107
  window_out_of_range: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
103
108
  timeline_empty: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
@@ -105,13 +110,11 @@ var ERROR_CODES = {
105
110
  invalid_transition: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
106
111
  composition_active: { stage: "validate", category: "authoring", retryable: false, httpStatus: 409 },
107
112
  composition_not_found: { stage: "validate", category: "authoring", retryable: false, httpStatus: 404 },
108
- no_composition: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
109
113
  scratch_not_found: { stage: "validate", category: "authoring", retryable: false, httpStatus: 404 },
110
114
  stale_revision: { stage: "validate", category: "authoring", retryable: false, httpStatus: 409 },
111
115
  project_not_found: { stage: "validate", category: "authoring", retryable: false, httpStatus: 404 },
112
116
  batch_too_large: { stage: "validate", category: "authoring", retryable: false, httpStatus: 413 },
113
117
  payload_too_large: { stage: "validate", category: "authoring", retryable: false, httpStatus: 413 },
114
- invalid_media_id: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
115
118
  invalid_webhook_url: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
116
119
  invalid_age: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
117
120
  unsupported_fact_scope: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
@@ -437,6 +440,34 @@ function scrubAll(obj) {
437
440
  for (const [k, v] of Object.entries(obj)) out[k] = scrubVal(v);
438
441
  return Object.keys(out).length ? out : void 0;
439
442
  }
443
+ var DEFAULT_RETRY_AFTER_SECONDS = 30;
444
+ var BUSY_RETRY_AFTER_SECONDS = 5;
445
+ var PROVIDER_RETRY_AFTER_SECONDS = 60;
446
+ var RETRY_AFTER_OVERRIDES = {
447
+ idempotency_conflict: BUSY_RETRY_AFTER_SECONDS,
448
+ resource_import_in_flight: BUSY_RETRY_AFTER_SECONDS,
449
+ capture_busy: BUSY_RETRY_AFTER_SECONDS,
450
+ snapshot_stale: BUSY_RETRY_AFTER_SECONDS,
451
+ too_many_active_sessions: BUSY_RETRY_AFTER_SECONDS,
452
+ rate_limited: PROVIDER_RETRY_AFTER_SECONDS,
453
+ billing_unavailable: PROVIDER_RETRY_AFTER_SECONDS,
454
+ render_provider_unreachable: PROVIDER_RETRY_AFTER_SECONDS,
455
+ render_provider_start_failed: PROVIDER_RETRY_AFTER_SECONDS,
456
+ render_pipeline_unavailable: PROVIDER_RETRY_AFTER_SECONDS,
457
+ sighted_provider_unreachable: PROVIDER_RETRY_AFTER_SECONDS,
458
+ lambda_infra_failed: PROVIDER_RETRY_AFTER_SECONDS,
459
+ pipeline_unavailable: PROVIDER_RETRY_AFTER_SECONDS,
460
+ mux_unavailable: PROVIDER_RETRY_AFTER_SECONDS,
461
+ import_unavailable: PROVIDER_RETRY_AFTER_SECONDS,
462
+ import_source_unreachable: PROVIDER_RETRY_AFTER_SECONDS,
463
+ generator_unavailable: PROVIDER_RETRY_AFTER_SECONDS,
464
+ service_unavailable: PROVIDER_RETRY_AFTER_SECONDS
465
+ };
466
+ function retryAfterSecondsFor(code) {
467
+ const spec = ERROR_CODES[code];
468
+ if (!spec?.retryable) return void 0;
469
+ return spec.retryAfterSeconds ?? RETRY_AFTER_OVERRIDES[code] ?? DEFAULT_RETRY_AFTER_SECONDS;
470
+ }
440
471
  function toWireEnvelope(e, opts) {
441
472
  const trusted = opts?.trusted ?? false;
442
473
  let message;
@@ -452,7 +483,10 @@ function toWireEnvelope(e, opts) {
452
483
  fix = pickScrub(e.fix, FIX_ALLOW);
453
484
  }
454
485
  const locator = pickScrub(e.locator, LOCATOR_ALLOW);
455
- return { ...e, message, fix, locator };
486
+ const thrown = typeof fix?.retryAfter === "number" ? fix.retryAfter : void 0;
487
+ const retryAfter = thrown ?? retryAfterSecondsFor(e.code);
488
+ const withRetry = retryAfter === void 0 ? fix : { ...fix ?? {}, retryAfter };
489
+ return { ...e, message, fix: withRetry, locator };
456
490
  }
457
491
 
458
492
  export {
@@ -461,5 +495,6 @@ export {
461
495
  encodeError,
462
496
  decodeError,
463
497
  scrubSensitive,
498
+ retryAfterSecondsFor,
464
499
  toWireEnvelope
465
500
  };
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  decodeError,
11
11
  scrubSensitive
12
- } from "./chunk-XGDPYHQK.js";
12
+ } from "./chunk-A3MXR6JI.js";
13
13
 
14
14
  // ../director/src/domain/chat.ts
15
15
  import { z } from "zod";
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  CueframeError,
8
8
  encodeError
9
- } from "./chunk-XGDPYHQK.js";
9
+ } from "./chunk-A3MXR6JI.js";
10
10
 
11
11
  // ../composition/src/projection/cardTokens.ts
12
12
  var CARD_MOTION_VAR_NAMES = [
@@ -1,3 +1,6 @@
1
+ import {
2
+ hasNonFragmentCssUrl
3
+ } from "./chunk-OSMXQV5V.js";
1
4
  import {
2
5
  getPrimitiveCatalogMeta
3
6
  } from "./chunk-7AZLFN26.js";
@@ -86,7 +89,11 @@ function parameterAssetPaths(primitiveId) {
86
89
  }
87
90
  function suspiciousUnannotatedAsset(value) {
88
91
  if (typeof value === "string") {
89
- return /^(?:https?:\/\/|\/\/|data:|blob:|file:|\.\.?\/)/i.test(value) || /url\(\s*['"]?/i.test(value) || /^[^\s]+\.(?:png|jpe?g|gif|webp|svg|json|lottie|mp4|mov|webm|m4a|mp3|wav|woff2?|ttf|otf)(?:\?.*)?$/i.test(value);
92
+ return /^(?:https?:\/\/|\/\/|data:|blob:|file:|\.\.?\/)/i.test(value) || // A `url()` counts only when it leaves the document. `url(#mark-clip)` is a
93
+ // same-document fragment — the SVG/CSS walk in `cardAssetAdmission` has
94
+ // always known that, and this sweep did not, so an inline logo passed one
95
+ // guard and was refused by the other. Same predicate, both places.
96
+ hasNonFragmentCssUrl(value) || /^[^\s]+\.(?:png|jpe?g|gif|webp|svg|json|lottie|mp4|mov|webm|m4a|mp3|wav|woff2?|ttf|otf)(?:\?.*)?$/i.test(value);
90
97
  }
91
98
  if (Array.isArray(value)) return value.some(suspiciousUnannotatedAsset);
92
99
  if (value && typeof value === "object") return Object.values(value).some(suspiciousUnannotatedAsset);
@@ -0,0 +1,18 @@
1
+ // ../execution/render-harness/src/assetRefs.ts
2
+ function isFragmentReference(value) {
3
+ return value.trim().startsWith("#");
4
+ }
5
+ function cssUrlPayloads(value) {
6
+ return [...value.matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)/gi)].map((m) => m[2] ?? "");
7
+ }
8
+ function hasNonFragmentCssUrl(value) {
9
+ const payloads = cssUrlPayloads(value);
10
+ if (payloads.length === 0) return false;
11
+ return payloads.some((payload) => !isFragmentReference(payload));
12
+ }
13
+
14
+ export {
15
+ isFragmentReference,
16
+ cssUrlPayloads,
17
+ hasNonFragmentCssUrl
18
+ };
@@ -0,0 +1,82 @@
1
+ import {
2
+ CueframeError
3
+ } from "./chunk-A3MXR6JI.js";
4
+ import {
5
+ bundledFontFamilyFaces,
6
+ isGenericOnlyStack,
7
+ parseFontStack
8
+ } from "./chunk-AVTEPAWI.js";
9
+
10
+ // ../execution/render-harness/src/cardFonts.ts
11
+ import parseCss from "css-tree/parser";
12
+ import walkCss from "css-tree/walker";
13
+ import generateCss from "css-tree/generator";
14
+ import { parseFragment } from "parse5";
15
+ function collectFontFamilyStacks(css, context, out) {
16
+ let ast;
17
+ try {
18
+ ast = parseCss(css, { context });
19
+ } catch {
20
+ return;
21
+ }
22
+ walkCss(ast, (node) => {
23
+ if (node.type !== "Declaration") return;
24
+ if (node.property.toLowerCase() !== "font-family") return;
25
+ const value = generateCss(node.value).trim();
26
+ if (value.length > 0) out.add(value);
27
+ });
28
+ }
29
+ function collectFromNode(node, out) {
30
+ if ("tagName" in node) {
31
+ for (const attr of node.attrs) {
32
+ if (attr.name.toLowerCase() === "style") {
33
+ collectFontFamilyStacks(attr.value, "declarationList", out);
34
+ }
35
+ if (attr.name.toLowerCase() === "font-family" && attr.value.trim().length > 0) {
36
+ out.add(attr.value.trim());
37
+ }
38
+ }
39
+ if (node.tagName.toLowerCase() === "style" && "childNodes" in node) {
40
+ const css = node.childNodes.filter((child) => child.nodeName === "#text").map((child) => child.value).join("");
41
+ collectFontFamilyStacks(css, "stylesheet", out);
42
+ }
43
+ }
44
+ if ("childNodes" in node) for (const child of node.childNodes) collectFromNode(child, out);
45
+ }
46
+ function cardFontFamilyStacks(html) {
47
+ const out = /* @__PURE__ */ new Set();
48
+ for (const node of parseFragment(html).childNodes) collectFromNode(node, out);
49
+ return [...out];
50
+ }
51
+ function stackDrawsSomethingReal(stack) {
52
+ const entries = parseFontStack(stack);
53
+ if (entries.length === 0) return true;
54
+ return entries.some((entry) => bundledFontFamilyFaces(entry) !== void 0 || isGenericOnlyStack(entry));
55
+ }
56
+ function cardBundledFamilies(html) {
57
+ const out = /* @__PURE__ */ new Set();
58
+ for (const stack of cardFontFamilyStacks(html)) {
59
+ for (const entry of parseFontStack(stack)) {
60
+ if (bundledFontFamilyFaces(entry) !== void 0) out.add(entry);
61
+ }
62
+ }
63
+ return [...out];
64
+ }
65
+ function assertCardFontsAdmitted(html, locator) {
66
+ for (const stack of cardFontFamilyStacks(html)) {
67
+ if (!stackDrawsSomethingReal(stack)) {
68
+ throw new CueframeError(
69
+ "font_not_reproducible",
70
+ `Card ${locator} asks for font-family '${stack}', which the renderer has no bytes for. Read GET /v1/fonts (list_render_fonts) for the admitted families; a stack naming one of them resolves to it. @import and remote font files are not available inside a card.`,
71
+ void 0,
72
+ { card: locator, fontFamily: stack }
73
+ );
74
+ }
75
+ }
76
+ }
77
+
78
+ export {
79
+ cardFontFamilyStacks,
80
+ cardBundledFamilies,
81
+ assertCardFontsAdmitted
82
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ChatErrorView,
3
3
  DirectorTurnContext
4
- } from "./chunk-NPBY2DID.js";
4
+ } from "./chunk-DLKCGEKP.js";
5
5
  import {
6
6
  GenerationArtifact
7
7
  } from "./chunk-73DQTUWY.js";
@@ -24,7 +24,7 @@ import {
24
24
  scoreAndRank,
25
25
  segmentShots,
26
26
  stabilizeSelectionHysteresis
27
- } from "./chunk-UFPIGQWM.js";
27
+ } from "./chunk-3GNTA646.js";
28
28
  import {
29
29
  compositionHasVo,
30
30
  roleDefaultGainDb
@@ -36,7 +36,7 @@ import {
36
36
  import {
37
37
  CueframeError,
38
38
  encodeError
39
- } from "./chunk-XGDPYHQK.js";
39
+ } from "./chunk-A3MXR6JI.js";
40
40
  import {
41
41
  SCENE_CAPTURE_IDENTITY_FIELDS_V1,
42
42
  SCENE_PRESET_TRIANGLES,
package/dist/compose.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import "./chunk-JVDUSOYG.js";
2
+ import "./chunk-GULDS3VE.js";
2
3
  import {
3
4
  isContrastCritical
4
5
  } from "./chunk-QDBVYZSF.js";
5
6
  import "./chunk-JQMPHKLU.js";
6
7
  import "./chunk-ZZRBKGDA.js";
7
- import "./chunk-GULDS3VE.js";
8
8
  import {
9
9
  catalog as catalog4
10
10
  } from "./chunk-JRJQECCF.js";
@@ -13,9 +13,9 @@ import {
13
13
  } from "./chunk-TE3PNQG6.js";
14
14
  import {
15
15
  catalog
16
- } from "./chunk-ZS3A3QUM.js";
17
- import "./chunk-U4V4FZGE.js";
16
+ } from "./chunk-RBWS5XHE.js";
18
17
  import "./chunk-DLF4WVSE.js";
18
+ import "./chunk-U4V4FZGE.js";
19
19
  import {
20
20
  catalog as catalog3
21
21
  } from "./chunk-FVDFPJHT.js";
@@ -54,7 +54,7 @@ import {
54
54
  import {
55
55
  CueframeError,
56
56
  encodeError
57
- } from "./chunk-XGDPYHQK.js";
57
+ } from "./chunk-A3MXR6JI.js";
58
58
  import "./chunk-7PA7FGLD.js";
59
59
  import "./chunk-XACXNDFL.js";
60
60
  import "./chunk-2L7PYYJK.js";
@@ -32,7 +32,7 @@ import {
32
32
  silhouetteKeepOutForWindow,
33
33
  sourceRectToOutput,
34
34
  sourceWindowKey
35
- } from "../chunk-RHWNZUU3.js";
35
+ } from "../chunk-GMVUJYPM.js";
36
36
  import {
37
37
  BRAND_TOKEN_REFS,
38
38
  BRAND_TOKEN_ROOT_KEYS,
@@ -74,7 +74,7 @@ import {
74
74
  contrastRatio
75
75
  } from "../chunk-ILO4NEZ3.js";
76
76
  import "../chunk-VG2ND6PX.js";
77
- import "../chunk-XGDPYHQK.js";
77
+ import "../chunk-A3MXR6JI.js";
78
78
  import "../chunk-AVTEPAWI.js";
79
79
  import "../chunk-2ESYSVXG.js";
80
80
  export {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  playableSpans
3
- } from "./chunk-ISO3IYNJ.js";
3
+ } from "./chunk-W44ASS4N.js";
4
4
  import "./chunk-QH3YI3ND.js";
5
5
  import "./chunk-QISFYLBB.js";
6
- import "./chunk-UFPIGQWM.js";
6
+ import "./chunk-3GNTA646.js";
7
7
  import "./chunk-VZ7TYX6Z.js";
8
8
  import "./chunk-DENF4TPI.js";
9
9
  import {
@@ -30,7 +30,7 @@ import {
30
30
  } from "./chunk-B7J5UUUV.js";
31
31
  import "./chunk-KYRDKK2D.js";
32
32
  import "./chunk-WREYUH2E.js";
33
- import "./chunk-XGDPYHQK.js";
33
+ import "./chunk-A3MXR6JI.js";
34
34
  import "./chunk-7PA7FGLD.js";
35
35
  import {
36
36
  SCENE_SLOT_MEDIA_FORMATS,
@@ -578,7 +578,7 @@ var CompositionOp = z.discriminatedUnion("type", [
578
578
  "Set the output format \u2014 `aspectRatio` (16:9|9:16|1:1|4:5) plus optional `fps` and `resolution`. Merges: an omitted field keeps the current value."
579
579
  ),
580
580
  z.object({ type: z.literal("addTrack"), kind: Track.shape.kind, name: z.string().optional(), id: z.string().optional() }).strict().describe(
581
- "Add an EMPTY track of a given family (video|audio|image|overlay|effect). Optional pinned `id`."
581
+ "Add an EMPTY track of a given family (video|audio|image|overlay|effect). Optional pinned `id`. The new track is appended, so it starts at the BACK: index 0 is the top layer and higher indices are further back (see `reorderTracks`). Track order only ranks clips on the same plane \u2014 every overlay draws above the video lane unless its `zPlane` is `behind-subject`, whatever its track index."
582
582
  ),
583
583
  z.object({ type: z.literal("removeTrack"), trackId: z.string() }).strict().describe(
584
584
  "Remove a track AND all its clips by id."
@@ -587,7 +587,7 @@ var CompositionOp = z.discriminatedUnion("type", [
587
587
  "Patch a track's `name` / `enabled` by id."
588
588
  ),
589
589
  z.object({ type: z.literal("reorderTracks"), fromIndex: z.number(), toIndex: z.number() }).strict().describe(
590
- "Move a track from one index to another (changes layer/compositing order)."
590
+ 'Move a track from one index to another. ORDER: index 0 is the TOP layer, not the bottom \u2014 moving a backdrop to index 0 puts it in FRONT of everything and hides the composition. Higher index = further back. PRECEDENCE: track order decides compositing only among clips on the same plane. Overlays are composited in a lane ABOVE the video lane whatever their track index; the one exception is `zPlane:"behind-subject"`, which moves the overlay inside its host clip, behind the segmented foreground. So if reordering tracks does not change what you see, the plane split already decided it.'
591
591
  ),
592
592
  z.object({ type: z.literal("moveClipToTrack"), clipId: z.string(), targetTrackId: z.string(), newStartTime: z.number().optional() }).strict().describe(
593
593
  "Move a clip to another SAME-family track, optionally at a new `newStartTime`."
@@ -46,7 +46,7 @@ import {
46
46
  silhouetteKeepOutForWindow,
47
47
  sourceRectToOutput,
48
48
  sourceWindowKey
49
- } from "./chunk-RHWNZUU3.js";
49
+ } from "./chunk-GMVUJYPM.js";
50
50
  import {
51
51
  BRAND_TOKEN_REFS,
52
52
  BRAND_TOKEN_ROOT_KEYS,
@@ -194,7 +194,7 @@ import {
194
194
  ReframeSegmentFields
195
195
  } from "./chunk-B7J5UUUV.js";
196
196
  import "./chunk-WREYUH2E.js";
197
- import "./chunk-XGDPYHQK.js";
197
+ import "./chunk-A3MXR6JI.js";
198
198
  import "./chunk-AVTEPAWI.js";
199
199
  import "./chunk-2ESYSVXG.js";
200
200
 
@@ -66,19 +66,19 @@ import {
66
66
  sliceTranscriptWords,
67
67
  splitIntoSentences,
68
68
  validateComposition
69
- } from "../chunk-ISO3IYNJ.js";
69
+ } from "../chunk-W44ASS4N.js";
70
70
  import {
71
71
  buildEasedZooms,
72
72
  buildPannedCenters,
73
73
  easeOutCubic
74
74
  } from "../chunk-QH3YI3ND.js";
75
75
  import "../chunk-QISFYLBB.js";
76
- import "../chunk-UFPIGQWM.js";
76
+ import "../chunk-3GNTA646.js";
77
77
  import "../chunk-VZ7TYX6Z.js";
78
78
  import "../chunk-DENF4TPI.js";
79
79
  import "../chunk-KYRDKK2D.js";
80
80
  import "../chunk-WREYUH2E.js";
81
- import "../chunk-XGDPYHQK.js";
81
+ import "../chunk-A3MXR6JI.js";
82
82
  import "../chunk-7PA7FGLD.js";
83
83
  import "../chunk-XACXNDFL.js";
84
84
  import "../chunk-2L7PYYJK.js";
@@ -7,8 +7,8 @@ import {
7
7
  stabilizeIncumbentChallenger,
8
8
  stabilizePresenceGate,
9
9
  stabilizeSelectionHysteresis
10
- } from "../chunk-UFPIGQWM.js";
11
- import "../chunk-XGDPYHQK.js";
10
+ } from "../chunk-3GNTA646.js";
11
+ import "../chunk-A3MXR6JI.js";
12
12
  import "../chunk-2ESYSVXG.js";
13
13
 
14
14
  // ../execution/core/src/select/errorCodes.ts
package/dist/core.js CHANGED
@@ -10,15 +10,15 @@ import {
10
10
  ensureEven,
11
11
  extractCaptionWordsFromDoc,
12
12
  isEmphasized
13
- } from "./chunk-ISO3IYNJ.js";
13
+ } from "./chunk-W44ASS4N.js";
14
14
  import "./chunk-QH3YI3ND.js";
15
15
  import "./chunk-QISFYLBB.js";
16
- import "./chunk-UFPIGQWM.js";
16
+ import "./chunk-3GNTA646.js";
17
17
  import "./chunk-VZ7TYX6Z.js";
18
18
  import "./chunk-DENF4TPI.js";
19
19
  import "./chunk-KYRDKK2D.js";
20
20
  import "./chunk-WREYUH2E.js";
21
- import "./chunk-XGDPYHQK.js";
21
+ import "./chunk-A3MXR6JI.js";
22
22
  import "./chunk-7PA7FGLD.js";
23
23
  import "./chunk-XACXNDFL.js";
24
24
  import "./chunk-2L7PYYJK.js";
@@ -10,13 +10,13 @@ import {
10
10
  dataChunk,
11
11
  generationArtifactFromToolResult,
12
12
  projectDirectorHistory
13
- } from "../chunk-PYJN6R7F.js";
14
- import "../chunk-NPBY2DID.js";
13
+ } from "../chunk-TCYULWNP.js";
14
+ import "../chunk-DLKCGEKP.js";
15
15
  import "../chunk-73DQTUWY.js";
16
16
  import "../chunk-BADZHXLR.js";
17
17
  import "../chunk-U3JPILZS.js";
18
18
  import "../chunk-XELS2BGA.js";
19
- import "../chunk-XGDPYHQK.js";
19
+ import "../chunk-A3MXR6JI.js";
20
20
  import "../chunk-2ESYSVXG.js";
21
21
  export {
22
22
  CueFrameIteration,
@@ -9,7 +9,7 @@ import {
9
9
  ProjectRef,
10
10
  chatErrorViewFromEnvelope,
11
11
  chatErrorViewFromUnknown
12
- } from "../chunk-NPBY2DID.js";
12
+ } from "../chunk-DLKCGEKP.js";
13
13
  import {
14
14
  ClientRequestId,
15
15
  GenerateMediaCommand,
@@ -31,7 +31,7 @@ import {
31
31
  import "../chunk-BADZHXLR.js";
32
32
  import "../chunk-U3JPILZS.js";
33
33
  import "../chunk-XELS2BGA.js";
34
- import "../chunk-XGDPYHQK.js";
34
+ import "../chunk-A3MXR6JI.js";
35
35
  import "../chunk-2ESYSVXG.js";
36
36
  export {
37
37
  ChatErrorView,
package/dist/director.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  dataChunk,
11
11
  generationArtifactFromToolResult,
12
12
  projectDirectorHistory
13
- } from "./chunk-PYJN6R7F.js";
13
+ } from "./chunk-TCYULWNP.js";
14
14
  import "./chunk-FTVZF4GO.js";
15
15
  import {
16
16
  ChatErrorView,
@@ -22,7 +22,7 @@ import {
22
22
  ProjectRef,
23
23
  chatErrorViewFromEnvelope,
24
24
  chatErrorViewFromUnknown
25
- } from "./chunk-NPBY2DID.js";
25
+ } from "./chunk-DLKCGEKP.js";
26
26
  import {
27
27
  ClientRequestId,
28
28
  GenerateMediaCommand,
@@ -44,7 +44,7 @@ import {
44
44
  import "./chunk-BADZHXLR.js";
45
45
  import "./chunk-U3JPILZS.js";
46
46
  import "./chunk-XELS2BGA.js";
47
- import "./chunk-XGDPYHQK.js";
47
+ import "./chunk-A3MXR6JI.js";
48
48
  import "./chunk-2ESYSVXG.js";
49
49
  export {
50
50
  ChatErrorView,
package/dist/errors.js CHANGED
@@ -3,15 +3,17 @@ import {
3
3
  ERROR_CODES,
4
4
  decodeError,
5
5
  encodeError,
6
+ retryAfterSecondsFor,
6
7
  scrubSensitive,
7
8
  toWireEnvelope
8
- } from "./chunk-XGDPYHQK.js";
9
+ } from "./chunk-A3MXR6JI.js";
9
10
  import "./chunk-2ESYSVXG.js";
10
11
  export {
11
12
  CueframeError,
12
13
  ERROR_CODES,
13
14
  decodeError,
14
15
  encodeError,
16
+ retryAfterSecondsFor,
15
17
  scrubSensitive,
16
18
  toWireEnvelope
17
19
  };
@@ -1,4 +1,10 @@
1
1
  import "../../chunk-JVDUSOYG.js";
2
+ import {
3
+ SeededPRNG,
4
+ gauss,
5
+ pick,
6
+ range
7
+ } from "../../chunk-GULDS3VE.js";
2
8
  import {
3
9
  ALLOWED_BRAND_PATHS,
4
10
  CONTRAST_CRITICAL_PATHS,
@@ -18,12 +24,6 @@ import {
18
24
  zodToDefaults,
19
25
  zodToJsonSchemaFor
20
26
  } from "../../chunk-ZZRBKGDA.js";
21
- import {
22
- SeededPRNG,
23
- gauss,
24
- pick,
25
- range
26
- } from "../../chunk-GULDS3VE.js";
27
27
  import {
28
28
  FRAME_BASELINE_WIDTH,
29
29
  frameScale,
@@ -1,4 +1,10 @@
1
1
  import "../chunk-JVDUSOYG.js";
2
+ import {
3
+ SeededPRNG,
4
+ gauss,
5
+ pick,
6
+ range
7
+ } from "../chunk-GULDS3VE.js";
2
8
  import {
3
9
  ALLOWED_BRAND_PATHS,
4
10
  CONTRAST_CRITICAL_PATHS,
@@ -18,12 +24,6 @@ import {
18
24
  zodToDefaults,
19
25
  zodToJsonSchemaFor
20
26
  } from "../chunk-ZZRBKGDA.js";
21
- import {
22
- SeededPRNG,
23
- gauss,
24
- pick,
25
- range
26
- } from "../chunk-GULDS3VE.js";
27
27
  import {
28
28
  FRAME_BASELINE_WIDTH,
29
29
  frameScale,
@@ -21,9 +21,9 @@ import {
21
21
  TrackingIn,
22
22
  Typewriter,
23
23
  catalog
24
- } from "../chunk-ZS3A3QUM.js";
25
- import "../chunk-U4V4FZGE.js";
24
+ } from "../chunk-RBWS5XHE.js";
26
25
  import "../chunk-DLF4WVSE.js";
26
+ import "../chunk-U4V4FZGE.js";
27
27
  import "../chunk-LT4PWSR2.js";
28
28
  import "../chunk-FWSJLHSV.js";
29
29
  import "../chunk-ZFEXATWN.js";
@@ -6,9 +6,9 @@ import {
6
6
  } from "./chunk-TE3PNQG6.js";
7
7
  import {
8
8
  catalog
9
- } from "./chunk-ZS3A3QUM.js";
10
- import "./chunk-U4V4FZGE.js";
9
+ } from "./chunk-RBWS5XHE.js";
11
10
  import "./chunk-DLF4WVSE.js";
11
+ import "./chunk-U4V4FZGE.js";
12
12
  import {
13
13
  catalog as catalog3
14
14
  } from "./chunk-FVDFPJHT.js";
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  assertCardHtmlAssetFree
3
- } from "../chunk-GCRF2RPU.js";
4
- import "../chunk-XGDPYHQK.js";
3
+ } from "../chunk-4RREA7VA.js";
4
+ import "../chunk-OSMXQV5V.js";
5
+ import "../chunk-A3MXR6JI.js";
5
6
  import "../chunk-2ESYSVXG.js";
6
7
  export {
7
8
  assertCardHtmlAssetFree
@@ -0,0 +1 @@
1
+ export * from "../_members/render-harness/cardFonts.js";
@@ -0,0 +1,13 @@
1
+ import {
2
+ assertCardFontsAdmitted,
3
+ cardBundledFamilies,
4
+ cardFontFamilyStacks
5
+ } from "../chunk-RAPDICTC.js";
6
+ import "../chunk-A3MXR6JI.js";
7
+ import "../chunk-AVTEPAWI.js";
8
+ import "../chunk-2ESYSVXG.js";
9
+ export {
10
+ assertCardFontsAdmitted,
11
+ cardBundledFamilies,
12
+ cardFontFamilyStacks
13
+ };
@@ -4,7 +4,8 @@ import {
4
4
  assetUrlKey,
5
5
  isRemoteUrl,
6
6
  renderInputAssets
7
- } from "../chunk-MN6D3U5N.js";
7
+ } from "../chunk-KSRFYFUZ.js";
8
+ import "../chunk-OSMXQV5V.js";
8
9
  import "../chunk-7AZLFN26.js";
9
10
  import "../chunk-7PA7FGLD.js";
10
11
  import "../chunk-2ESYSVXG.js";
@@ -1,13 +1,17 @@
1
1
  import {
2
2
  assertCardHtmlAssetFree
3
- } from "./chunk-GCRF2RPU.js";
3
+ } from "./chunk-4RREA7VA.js";
4
+ import {
5
+ assertCardFontsAdmitted
6
+ } from "./chunk-RAPDICTC.js";
4
7
  import {
5
8
  assertNoRemoteRefs,
6
9
  assetSlots,
7
10
  assetUrlKey,
8
11
  isRemoteUrl,
9
12
  renderInputAssets
10
- } from "./chunk-MN6D3U5N.js";
13
+ } from "./chunk-KSRFYFUZ.js";
14
+ import "./chunk-OSMXQV5V.js";
11
15
  import "./chunk-256ZO323.js";
12
16
  import "./chunk-BVA3537Z.js";
13
17
  import {
@@ -42,17 +46,17 @@ import {
42
46
  parseSceneComponentCaptureIntentV1,
43
47
  prepareSceneShotRenderInput,
44
48
  readSceneShotManifest
45
- } from "./chunk-ISO3IYNJ.js";
49
+ } from "./chunk-W44ASS4N.js";
46
50
  import "./chunk-QH3YI3ND.js";
47
51
  import "./chunk-QISFYLBB.js";
48
- import "./chunk-UFPIGQWM.js";
52
+ import "./chunk-3GNTA646.js";
49
53
  import "./chunk-VZ7TYX6Z.js";
50
54
  import "./chunk-DENF4TPI.js";
51
55
  import "./chunk-KYRDKK2D.js";
52
56
  import "./chunk-WREYUH2E.js";
53
57
  import {
54
58
  CueframeError
55
- } from "./chunk-XGDPYHQK.js";
59
+ } from "./chunk-A3MXR6JI.js";
56
60
  import "./chunk-7PA7FGLD.js";
57
61
  import {
58
62
  evaluateScene,
@@ -1109,12 +1113,25 @@ var CARD_COMPOSITION_ID = "CueFrameCardStill";
1109
1113
  var CARD_ROOT_FILENAME = "card.Root.local.tsx";
1110
1114
  var CARD_ENTRY_FILENAME = "card.entry.local.tsx";
1111
1115
  function generateCardRootSource(opts) {
1116
+ const fontsModule = JSON.stringify(join6(opts.renderEntryRoot, "src", "fonts"));
1112
1117
  return `// GENERATED by @cueframe/render-harness generateCardRootSource \u2014 DO NOT EDIT.
1113
1118
  import React from 'react';
1114
- import { Composition, AbsoluteFill, getInputProps } from 'remotion';
1119
+ import { Composition, AbsoluteFill, getInputProps, delayRender, continueRender } from 'remotion';
1120
+ import { ensureAllFontsLoaded } from ${fontsModule};
1115
1121
 
1116
1122
  const Card: React.FC = () => {
1117
1123
  const { html, cssVars } = getInputProps() as { html: string; cssVars?: Record<string, string> };
1124
+ // Hold the frame until the faces are registered. Without this the still can be
1125
+ // captured mid-load and fall back to a system face \u2014 the same silent
1126
+ // substitution, just intermittent instead of constant.
1127
+ const [handle] = React.useState(() => delayRender('card-fonts'));
1128
+ React.useEffect(() => {
1129
+ let cancelled = false;
1130
+ ensureAllFontsLoaded()
1131
+ .catch(() => undefined)
1132
+ .then(() => { if (!cancelled) continueRender(handle); });
1133
+ return () => { cancelled = true; };
1134
+ }, [handle]);
1118
1135
  return (
1119
1136
  <AbsoluteFill>
1120
1137
  <div
@@ -1162,7 +1179,11 @@ async function renderCardStill(opts) {
1162
1179
  const renderEntryRoot = resolveRenderEntryRoot(opts.renderEntryRoot);
1163
1180
  const browserExecutable = (await verifyLocalStagedBrowser(renderEntryRoot)).path;
1164
1181
  mkdirSync(opts.outDir, { recursive: true });
1165
- writeFileSync(join6(opts.outDir, CARD_ROOT_FILENAME), generateCardRootSource({ width, height, fps }));
1182
+ assertCardFontsAdmitted(opts.html, "still");
1183
+ writeFileSync(
1184
+ join6(opts.outDir, CARD_ROOT_FILENAME),
1185
+ generateCardRootSource({ width, height, fps, renderEntryRoot })
1186
+ );
1166
1187
  const entryPoint = join6(opts.outDir, CARD_ENTRY_FILENAME);
1167
1188
  writeFileSync(entryPoint, generateCardEntrySource());
1168
1189
  const { bundle } = await importFromRenderEntry(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cueframe/kernel",
3
- "version": "0.2.31",
3
+ "version": "0.2.33",
4
4
  "type": "module",
5
5
  "description": "Publish-only aggregate of CueFrame's isomorphic kernel packages — composition, primitives, authoring, MCP, and friends shipped as one npm artifact. Members remain separate workspace packages; this only changes what ships.",
6
6
  "files": [
@@ -19,22 +19,22 @@
19
19
  "@cueframe/account-model": "0.1.0",
20
20
  "@cueframe/animate": "0.1.0",
21
21
  "@cueframe/authoring": "0.1.0",
22
+ "@cueframe/cloud-import": "0.1.0",
23
+ "@cueframe/composition": "0.1.0",
24
+ "@cueframe/compose": "0.1.0",
25
+ "@cueframe/errors": "0.1.0",
26
+ "@cueframe/director": "0.1.0",
22
27
  "@cueframe/composition-ops": "0.1.0",
23
- "@cueframe/brand-derivation": "0.1.0",
24
28
  "@cueframe/component-runtime": "0.1.0",
25
29
  "@cueframe/core": "0.1.0",
26
- "@cueframe/director": "0.1.0",
27
- "@cueframe/cloud-import": "0.1.0",
28
- "@cueframe/compose": "0.1.0",
29
- "@cueframe/composition": "0.1.0",
30
- "@cueframe/foundation": "0.1.0",
31
- "@cueframe/perception": "0.1.0",
30
+ "@cueframe/brand-derivation": "0.1.0",
32
31
  "@cueframe/media-model": "0.1.0",
33
- "@cueframe/nle-export": "0.1.0",
32
+ "@cueframe/foundation": "0.1.0",
34
33
  "@cueframe/plane": "0.1.0",
35
- "@cueframe/errors": "0.1.0",
36
- "@cueframe/render-harness": "0.1.0",
34
+ "@cueframe/nle-export": "0.1.0",
37
35
  "@cueframe/mcp": "0.1.0",
36
+ "@cueframe/perception": "0.1.0",
37
+ "@cueframe/render-harness": "0.1.0",
38
38
  "@cueframe/primitives": "0.1.0"
39
39
  },
40
40
  "peerDependencies": {
@@ -457,6 +457,10 @@
457
457
  "types": "./dist/render-harness/cardAssetAdmission.d.ts",
458
458
  "default": "./dist/render-harness/cardAssetAdmission.js"
459
459
  },
460
+ "./render-harness/cardFonts": {
461
+ "types": "./dist/render-harness/cardFonts.d.ts",
462
+ "default": "./dist/render-harness/cardFonts.js"
463
+ },
460
464
  "./render-harness/renderInputAssets": {
461
465
  "types": "./dist/render-harness/renderInputAssets.d.ts",
462
466
  "default": "./dist/render-harness/renderInputAssets.js"
@@ -1,9 +1,9 @@
1
- import {
2
- TextStage
3
- } from "./chunk-U4V4FZGE.js";
4
1
  import {
5
2
  recolor
6
3
  } from "./chunk-DLF4WVSE.js";
4
+ import {
5
+ TextStage
6
+ } from "./chunk-U4V4FZGE.js";
7
7
  import {
8
8
  resolveTypeface
9
9
  } from "./chunk-LT4PWSR2.js";