@cueframe/kernel 0.2.59-rc.2 → 0.2.59-rc.3
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/_members/component-runtime/componentBundleServer.d.ts +7 -2
- package/dist/_members/component-runtime/componentBundleServer.d.ts.map +1 -1
- package/dist/_members/component-runtime/contracts.d.ts +0 -14
- package/dist/_members/component-runtime/contracts.d.ts.map +1 -1
- package/dist/_members/component-runtime/template/schema.d.ts +0 -6
- package/dist/_members/component-runtime/template/schema.d.ts.map +1 -1
- package/dist/_members/composition/componentClip.d.ts +96 -0
- package/dist/_members/composition/depth.d.ts +1 -1
- package/dist/_members/composition/scene/clipRules.d.ts +1 -1
- package/dist/_members/composition/validators/composition.d.ts +0 -52
- package/dist/_members/composition/validators/graphicKinds.d.ts +1 -1
- package/dist/_members/composition-ops/componentClips.d.ts +11 -0
- package/dist/_members/composition-ops/index.d.ts +6 -28
- package/dist/_members/errors/registry.d.ts +12 -0
- package/dist/_members/mcp/generated/harness.d.ts +1 -1
- package/dist/animate/preparation-facts.js +2 -2
- package/dist/animate.js +3 -3
- package/dist/authoring/context.js +6 -6
- package/dist/authoring/motion.js +3 -3
- package/dist/authoring/scene.js +2 -2
- package/dist/authoring.js +12 -12
- package/dist/{chunk-ZCEYEIRB.js → chunk-3KFQM7DG.js} +1 -1
- package/dist/{chunk-JNBNDHEF.js → chunk-3SMYBRYD.js} +2 -2
- package/dist/{chunk-H2ZZXISB.js → chunk-6D3KCUWA.js} +1 -1
- package/dist/{chunk-BZVOCVQV.js → chunk-BLVSFN6J.js} +0 -17
- package/dist/{chunk-NECN7TT4.js → chunk-BR6QZZEI.js} +4 -4
- package/dist/{chunk-3JEUNKDK.js → chunk-CMPRHO6D.js} +1 -1
- package/dist/{chunk-CEO47DIE.js → chunk-D5QWWPDL.js} +2 -2
- package/dist/{chunk-AK6QPX7A.js → chunk-DBBKM74E.js} +22 -45
- package/dist/{chunk-J44R72DZ.js → chunk-DPMS7I65.js} +1 -1
- package/dist/{chunk-G2OTMC72.js → chunk-E2DVOSUE.js} +38 -16
- package/dist/{chunk-4OHLOBXS.js → chunk-EA3J5XUJ.js} +1 -1
- package/dist/{chunk-3HLDIIWA.js → chunk-F5UOF52Q.js} +1 -1
- package/dist/{chunk-I2HNC4PQ.js → chunk-FZCVNHML.js} +1 -1
- package/dist/{chunk-DCKADD5B.js → chunk-HEMRBFLN.js} +1 -1
- package/dist/{chunk-ZT3LVL2U.js → chunk-HOQ45246.js} +17 -18
- package/dist/{chunk-T56BK7NS.js → chunk-JRGALHBZ.js} +1 -1
- package/dist/{chunk-FZB7UX44.js → chunk-KEQTT67U.js} +7 -49
- package/dist/{chunk-ML3HG2AZ.js → chunk-KRIEZVXX.js} +1 -1
- package/dist/{chunk-PLWDYWK6.js → chunk-KWWWMU5S.js} +1 -1
- package/dist/{chunk-GQFJKDCH.js → chunk-L53YKOK4.js} +4 -4
- package/dist/{chunk-QCETEKQX.js → chunk-LRS32NU7.js} +6 -6
- package/dist/{chunk-6KZCXAYL.js → chunk-MRLC4HLJ.js} +1 -1
- package/dist/{chunk-P6RVYHLT.js → chunk-NASGAME6.js} +4 -4
- package/dist/{chunk-XQGQ5EFS.js → chunk-O3RHY4ZI.js} +2 -0
- package/dist/{chunk-WPZKOVYF.js → chunk-OL3ULF5Q.js} +1 -1
- package/dist/{chunk-AFUITAH6.js → chunk-S6YSOEK5.js} +3 -12
- package/dist/{chunk-U7KSOA2L.js → chunk-SBKCVRJB.js} +1 -1
- package/dist/{chunk-MMJYII7Y.js → chunk-SBWXIK5K.js} +4 -4
- package/dist/{chunk-7II5OM7R.js → chunk-TBZEIN45.js} +1 -1
- package/dist/{chunk-RWJHZCOR.js → chunk-TG756AMB.js} +2 -2
- package/dist/{chunk-X2RTLS6K.js → chunk-TPQA5TPU.js} +1 -1
- package/dist/{chunk-CL5Y6V6K.js → chunk-UB6Z7RY4.js} +3 -3
- package/dist/{chunk-KC4LNZL5.js → chunk-VSHAP22Q.js} +2 -2
- package/dist/{chunk-LVMWPFV4.js → chunk-VW22APZC.js} +1 -1
- package/dist/chunk-WHYTCQYZ.js +161 -0
- package/dist/{chunk-XV2K3AQT.js → chunk-WONOHP4G.js} +1 -1
- package/dist/{chunk-ZPJQ3TQL.js → chunk-WYMJ5RXC.js} +1 -1
- package/dist/{chunk-6HA55CRU.js → chunk-X7DGPNSV.js} +1 -1
- package/dist/{chunk-2K2GBFLU.js → chunk-Y2NR3Y6J.js} +1 -1
- package/dist/{chunk-UGWJC4GA.js → chunk-ZTJYOHS3.js} +1 -1
- package/dist/{chunk-6HPEMDQW.js → chunk-ZUCLQVXD.js} +1 -1
- package/dist/component-runtime/browserOptions.js +3 -3
- package/dist/component-runtime/contracts.js +3 -11
- package/dist/component-runtime/importPolicy.js +2 -2
- package/dist/component-runtime/render.js +5 -5
- package/dist/component-runtime/sourceAdmission.js +2 -2
- package/dist/component-runtime/template/testing.js +11 -11
- package/dist/component-runtime/template.js +11 -11
- package/dist/component-runtime.js +8 -16
- package/dist/compose.js +11 -11
- package/dist/composition/component-clip.d.ts +1 -0
- package/dist/composition/component-clip.js +29 -0
- package/dist/composition/depth.js +1 -1
- package/dist/composition/graphics-plan.js +2 -2
- package/dist/composition/invariants.js +2 -2
- package/dist/composition/ops.js +5 -5
- package/dist/composition/projection.js +3 -3
- package/dist/composition/scene.js +1 -1
- package/dist/composition/timeline.js +2 -2
- package/dist/composition/validators/brand-kit-body.js +4 -4
- package/dist/composition/validators/graphic-kinds.js +1 -1
- package/dist/composition/validators.js +4 -6
- package/dist/composition-ops.js +17 -18
- package/dist/composition.js +9 -11
- package/dist/{context-7SWSVJ6Z.js → context-WOYP7QBB.js} +6 -6
- package/dist/core/render.js +9 -8
- package/dist/core/select.js +2 -2
- package/dist/core.js +9 -8
- package/dist/director/ai-sdk.js +3 -3
- package/dist/director/domain.js +2 -2
- package/dist/director.js +4 -4
- package/dist/errors.js +1 -1
- package/dist/mcp/adapter.js +3 -3
- package/dist/mcp/composition-ops.js +1 -1
- package/dist/mcp/core.js +1 -1
- package/dist/mcp/curation.js +1 -1
- package/dist/mcp/scene-shot.js +2 -2
- package/dist/mcp/server.js +6 -6
- package/dist/mcp.js +10 -10
- package/dist/primitives/captions.js +3 -3
- package/dist/primitives/effects.js +5 -5
- package/dist/primitives/layouts.js +4 -4
- package/dist/primitives/lib/index.js +3 -3
- package/dist/primitives/lib.js +3 -3
- package/dist/primitives/scenes.js +4 -4
- package/dist/primitives/ui-blocks.js +2 -2
- package/dist/primitives.js +9 -9
- package/dist/render-harness/cardAssetAdmission.js +2 -2
- package/dist/render-harness/cardFonts.js +2 -2
- package/dist/render-harness.js +20 -19
- package/dist/{src-XQYRJ27W.js → src-XYW7BEJ5.js} +17 -18
- package/package.json +15 -11
- package/dist/_members/composition-ops/alphaLayers.d.ts +0 -17
- package/dist/{chunk-UGEUB763.js → chunk-7PSQUTL5.js} +3 -3
|
@@ -1392,7 +1392,7 @@ var BriefCreateRequest = zod19.strictObject({
|
|
|
1392
1392
|
"kind": zod19.literal("component"),
|
|
1393
1393
|
"componentId": zod19.string().min(1),
|
|
1394
1394
|
"props": zod19.record(zod19.string(), zod19.unknown()),
|
|
1395
|
-
"assets": zod19.record(zod19.string(), zod19.string().min(1)).optional(),
|
|
1395
|
+
"assets": zod19.record(zod19.string(), zod19.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
1396
1396
|
"zPlane": zod19.enum(["front", "behind-subject"]).optional()
|
|
1397
1397
|
}), zod19.strictObject({
|
|
1398
1398
|
"kind": zod19.literal("overlay"),
|
|
@@ -1409,12 +1409,6 @@ var BriefCreateRequest = zod19.strictObject({
|
|
|
1409
1409
|
"kind": zod19.literal("effect"),
|
|
1410
1410
|
"primitiveId": zod19.string().min(1),
|
|
1411
1411
|
"params": zod19.record(zod19.string(), zod19.unknown()).optional()
|
|
1412
|
-
}), zod19.strictObject({
|
|
1413
|
-
"kind": zod19.literal("alpha-layer"),
|
|
1414
|
-
"componentId": zod19.string().min(1),
|
|
1415
|
-
"props": zod19.record(zod19.string(), zod19.unknown()),
|
|
1416
|
-
"assets": zod19.record(zod19.string(), zod19.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
1417
|
-
"zPlane": zod19.enum(["front", "behind-subject"]).optional()
|
|
1418
1412
|
}), zod19.strictObject({
|
|
1419
1413
|
"kind": zod19.literal("card"),
|
|
1420
1414
|
"html": zod19.string().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),
|
|
@@ -1654,7 +1648,7 @@ var BriefResponse = zod21.strictObject({
|
|
|
1654
1648
|
"kind": zod21.literal("component"),
|
|
1655
1649
|
"componentId": zod21.string().min(1),
|
|
1656
1650
|
"props": zod21.record(zod21.string(), zod21.unknown()),
|
|
1657
|
-
"assets": zod21.record(zod21.string(), zod21.string().min(1)).optional(),
|
|
1651
|
+
"assets": zod21.record(zod21.string(), zod21.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
1658
1652
|
"zPlane": zod21.enum(["front", "behind-subject"]).optional()
|
|
1659
1653
|
}), zod21.strictObject({
|
|
1660
1654
|
"kind": zod21.literal("overlay"),
|
|
@@ -1671,12 +1665,6 @@ var BriefResponse = zod21.strictObject({
|
|
|
1671
1665
|
"kind": zod21.literal("effect"),
|
|
1672
1666
|
"primitiveId": zod21.string().min(1),
|
|
1673
1667
|
"params": zod21.record(zod21.string(), zod21.unknown()).optional()
|
|
1674
|
-
}), zod21.strictObject({
|
|
1675
|
-
"kind": zod21.literal("alpha-layer"),
|
|
1676
|
-
"componentId": zod21.string().min(1),
|
|
1677
|
-
"props": zod21.record(zod21.string(), zod21.unknown()),
|
|
1678
|
-
"assets": zod21.record(zod21.string(), zod21.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
1679
|
-
"zPlane": zod21.enum(["front", "behind-subject"]).optional()
|
|
1680
1668
|
}), zod21.strictObject({
|
|
1681
1669
|
"kind": zod21.literal("card"),
|
|
1682
1670
|
"html": zod21.string().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),
|
|
@@ -1905,7 +1893,7 @@ var BriefPatchRequest = zod23.strictObject({
|
|
|
1905
1893
|
"kind": zod23.literal("component"),
|
|
1906
1894
|
"componentId": zod23.string().min(1),
|
|
1907
1895
|
"props": zod23.record(zod23.string(), zod23.unknown()),
|
|
1908
|
-
"assets": zod23.record(zod23.string(), zod23.string().min(1)).optional(),
|
|
1896
|
+
"assets": zod23.record(zod23.string(), zod23.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
1909
1897
|
"zPlane": zod23.enum(["front", "behind-subject"]).optional()
|
|
1910
1898
|
}), zod23.strictObject({
|
|
1911
1899
|
"kind": zod23.literal("overlay"),
|
|
@@ -1922,12 +1910,6 @@ var BriefPatchRequest = zod23.strictObject({
|
|
|
1922
1910
|
"kind": zod23.literal("effect"),
|
|
1923
1911
|
"primitiveId": zod23.string().min(1),
|
|
1924
1912
|
"params": zod23.record(zod23.string(), zod23.unknown()).optional()
|
|
1925
|
-
}), zod23.strictObject({
|
|
1926
|
-
"kind": zod23.literal("alpha-layer"),
|
|
1927
|
-
"componentId": zod23.string().min(1),
|
|
1928
|
-
"props": zod23.record(zod23.string(), zod23.unknown()),
|
|
1929
|
-
"assets": zod23.record(zod23.string(), zod23.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
1930
|
-
"zPlane": zod23.enum(["front", "behind-subject"]).optional()
|
|
1931
1913
|
}), zod23.strictObject({
|
|
1932
1914
|
"kind": zod23.literal("card"),
|
|
1933
1915
|
"html": zod23.string().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),
|
|
@@ -2812,7 +2794,7 @@ var Composition = zod58.strictObject({
|
|
|
2812
2794
|
"kind": zod58.literal("component"),
|
|
2813
2795
|
"componentId": zod58.string().min(1),
|
|
2814
2796
|
"props": zod58.record(zod58.string(), zod58.unknown()),
|
|
2815
|
-
"assets": zod58.record(zod58.string(), zod58.string().min(1)).optional(),
|
|
2797
|
+
"assets": zod58.record(zod58.string(), zod58.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
2816
2798
|
"zPlane": zod58.enum(["front", "behind-subject"]).optional()
|
|
2817
2799
|
}), zod58.strictObject({
|
|
2818
2800
|
"kind": zod58.literal("overlay"),
|
|
@@ -2829,12 +2811,6 @@ var Composition = zod58.strictObject({
|
|
|
2829
2811
|
"kind": zod58.literal("effect"),
|
|
2830
2812
|
"primitiveId": zod58.string().min(1),
|
|
2831
2813
|
"params": zod58.record(zod58.string(), zod58.unknown()).optional()
|
|
2832
|
-
}), zod58.strictObject({
|
|
2833
|
-
"kind": zod58.literal("alpha-layer"),
|
|
2834
|
-
"componentId": zod58.string().min(1),
|
|
2835
|
-
"props": zod58.record(zod58.string(), zod58.unknown()),
|
|
2836
|
-
"assets": zod58.record(zod58.string(), zod58.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
2837
|
-
"zPlane": zod58.enum(["front", "behind-subject"]).optional()
|
|
2838
2814
|
}), zod58.strictObject({
|
|
2839
2815
|
"kind": zod58.literal("card"),
|
|
2840
2816
|
"html": zod58.string().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),
|
|
@@ -6520,7 +6496,7 @@ var CompositionOp = zod67.union([zod67.strictObject({
|
|
|
6520
6496
|
"kind": zod67.literal("component"),
|
|
6521
6497
|
"componentId": zod67.string().min(1),
|
|
6522
6498
|
"props": zod67.record(zod67.string(), zod67.unknown()),
|
|
6523
|
-
"assets": zod67.record(zod67.string(), zod67.string().min(1)).optional(),
|
|
6499
|
+
"assets": zod67.record(zod67.string(), zod67.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
6524
6500
|
"zPlane": zod67.enum(["front", "behind-subject"]).optional()
|
|
6525
6501
|
}), zod67.strictObject({
|
|
6526
6502
|
"kind": zod67.literal("overlay"),
|
|
@@ -6537,12 +6513,6 @@ var CompositionOp = zod67.union([zod67.strictObject({
|
|
|
6537
6513
|
"kind": zod67.literal("effect"),
|
|
6538
6514
|
"primitiveId": zod67.string().min(1),
|
|
6539
6515
|
"params": zod67.record(zod67.string(), zod67.unknown()).optional()
|
|
6540
|
-
}), zod67.strictObject({
|
|
6541
|
-
"kind": zod67.literal("alpha-layer"),
|
|
6542
|
-
"componentId": zod67.string().min(1),
|
|
6543
|
-
"props": zod67.record(zod67.string(), zod67.unknown()),
|
|
6544
|
-
"assets": zod67.record(zod67.string(), zod67.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
6545
|
-
"zPlane": zod67.enum(["front", "behind-subject"]).optional()
|
|
6546
6516
|
}), zod67.strictObject({
|
|
6547
6517
|
"kind": zod67.literal("card"),
|
|
6548
6518
|
"html": zod67.string().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),
|
|
@@ -6670,7 +6640,7 @@ var CompositionOp = zod67.union([zod67.strictObject({
|
|
|
6670
6640
|
"kind": zod67.literal("component"),
|
|
6671
6641
|
"componentId": zod67.string().min(1),
|
|
6672
6642
|
"props": zod67.record(zod67.string(), zod67.unknown()),
|
|
6673
|
-
"assets": zod67.record(zod67.string(), zod67.string().min(1)).optional(),
|
|
6643
|
+
"assets": zod67.record(zod67.string(), zod67.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
6674
6644
|
"zPlane": zod67.enum(["front", "behind-subject"]).optional()
|
|
6675
6645
|
}), zod67.strictObject({
|
|
6676
6646
|
"kind": zod67.literal("overlay"),
|
|
@@ -6687,12 +6657,6 @@ var CompositionOp = zod67.union([zod67.strictObject({
|
|
|
6687
6657
|
"kind": zod67.literal("effect"),
|
|
6688
6658
|
"primitiveId": zod67.string().min(1),
|
|
6689
6659
|
"params": zod67.record(zod67.string(), zod67.unknown()).optional()
|
|
6690
|
-
}), zod67.strictObject({
|
|
6691
|
-
"kind": zod67.literal("alpha-layer"),
|
|
6692
|
-
"componentId": zod67.string().min(1),
|
|
6693
|
-
"props": zod67.record(zod67.string(), zod67.unknown()),
|
|
6694
|
-
"assets": zod67.record(zod67.string(), zod67.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
6695
|
-
"zPlane": zod67.enum(["front", "behind-subject"]).optional()
|
|
6696
6660
|
}), zod67.strictObject({
|
|
6697
6661
|
"kind": zod67.literal("card"),
|
|
6698
6662
|
"html": zod67.string().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),
|
|
@@ -6816,7 +6780,7 @@ var CompositionOp = zod67.union([zod67.strictObject({
|
|
|
6816
6780
|
"kind": zod67.literal("component"),
|
|
6817
6781
|
"componentId": zod67.string().min(1),
|
|
6818
6782
|
"props": zod67.record(zod67.string(), zod67.unknown()),
|
|
6819
|
-
"assets": zod67.record(zod67.string(), zod67.string().min(1)).optional(),
|
|
6783
|
+
"assets": zod67.record(zod67.string(), zod67.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
6820
6784
|
"zPlane": zod67.enum(["front", "behind-subject"]).optional()
|
|
6821
6785
|
}), zod67.strictObject({
|
|
6822
6786
|
"kind": zod67.literal("overlay"),
|
|
@@ -6833,12 +6797,6 @@ var CompositionOp = zod67.union([zod67.strictObject({
|
|
|
6833
6797
|
"kind": zod67.literal("effect"),
|
|
6834
6798
|
"primitiveId": zod67.string().min(1),
|
|
6835
6799
|
"params": zod67.record(zod67.string(), zod67.unknown()).optional()
|
|
6836
|
-
}), zod67.strictObject({
|
|
6837
|
-
"kind": zod67.literal("alpha-layer"),
|
|
6838
|
-
"componentId": zod67.string().min(1),
|
|
6839
|
-
"props": zod67.record(zod67.string(), zod67.unknown()),
|
|
6840
|
-
"assets": zod67.record(zod67.string(), zod67.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),
|
|
6841
|
-
"zPlane": zod67.enum(["front", "behind-subject"]).optional()
|
|
6842
6800
|
}), zod67.strictObject({
|
|
6843
6801
|
"kind": zod67.literal("card"),
|
|
6844
6802
|
"html": zod67.string().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),
|
|
@@ -5,7 +5,7 @@ var DescribeCompositionOpsInput = z.object({
|
|
|
5
5
|
type: z.string().optional().describe("Exact CompositionOp type, such as captions.fromComposition. Omit for the operation list.")
|
|
6
6
|
});
|
|
7
7
|
async function describeCompositionOps(type) {
|
|
8
|
-
const { CompositionOp } = await import("./src-
|
|
8
|
+
const { CompositionOp } = await import("./src-XYW7BEJ5.js");
|
|
9
9
|
const variants = CompositionOp.options;
|
|
10
10
|
const knownTypes = variants.map((variant2) => variant2.shape.type.value);
|
|
11
11
|
if (type === void 0) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isBehindSubjectDepthSource
|
|
3
|
+
} from "./chunk-DPMS7I65.js";
|
|
1
4
|
import {
|
|
2
5
|
activeFaceKeepOutSeries,
|
|
3
6
|
boundingBox,
|
|
4
7
|
resolveBrandRefsDeep
|
|
5
8
|
} from "./chunk-DKBFAQCW.js";
|
|
6
|
-
import {
|
|
7
|
-
isBehindSubjectDepthSource
|
|
8
|
-
} from "./chunk-J44R72DZ.js";
|
|
9
9
|
import {
|
|
10
10
|
CueframeError,
|
|
11
11
|
encodeError
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-O3RHY4ZI.js";
|
|
13
13
|
|
|
14
14
|
// ../composition/src/projection/cardTokens.ts
|
|
15
15
|
var CARD_MOTION_VAR_NAMES = [
|
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
SCENE_SHOT_RESOURCE_DESCRIPTION,
|
|
3
3
|
SCENE_SHOT_RESOURCE_URI,
|
|
4
4
|
sceneShotContract
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FZCVNHML.js";
|
|
6
6
|
import {
|
|
7
7
|
WAIT_KINDS,
|
|
8
8
|
querySchemaShape,
|
|
9
9
|
serializeQuery,
|
|
10
10
|
waitForJob
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-TBZEIN45.js";
|
|
12
12
|
import {
|
|
13
13
|
DESCRIBE_COMPOSITION_OPS_DESCRIPTION,
|
|
14
14
|
DescribeCompositionOpsInput,
|
|
15
15
|
describeCompositionOps
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KRIEZVXX.js";
|
|
17
17
|
import {
|
|
18
18
|
GENERATED_OPERATIONS,
|
|
19
19
|
apiErrorFrom,
|
|
@@ -31,10 +31,10 @@ import {
|
|
|
31
31
|
text,
|
|
32
32
|
textWithData,
|
|
33
33
|
withMedia
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-KEQTT67U.js";
|
|
35
35
|
import {
|
|
36
36
|
CURATED_TOOLS
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-EA3J5XUJ.js";
|
|
38
38
|
|
|
39
39
|
// ../mcp/src/prompts.ts
|
|
40
40
|
var skillListCache = null;
|
|
@@ -117,7 +117,7 @@ Every long job is either polled or pushed \u2014 never guessed:
|
|
|
117
117
|
- Webhooks (\`create_webhook\`): ONE terminal event per kind with status INSIDE the payload \u2014 \`render.completed\`, \`compose.completed\`, \`media.completed\`, \`suggest.completed\` \u2014 plus \`checkpoint.ready\` (a held compose paused for review). Read \`cueframe://webhook-events\` for the full contract before building a receiver.
|
|
118
118
|
- Presigned URLs (stills, clips, render outputs) expire \u2014 render outputs last ~7 days (refresh via the render's refresh-url op); preview stills/clips ~1 hour. Re-read for a fresh link instead of caching one.
|
|
119
119
|
|
|
120
|
-
CUSTOM GRAPHICS \u2014 author or FORK: \`create_component\` (tsxSource + contract-v2 manifest) from scratch, or \`get_component_source\` on a built-in primitive (e.g. \`cinematic-title\`) to fork its editable module. Iterate author\u2192preview\u2192fix with \`preview_component\` (202 + jobId; \`wait_job(kind:"preview")\` returns the verified artifact from the same immutable bundle used by production; a compile/runtime/capability failure lands on the job's FAILED terminal carrying the sanitized author-fixable message) \u2192 fix via \`update_component\` \u2192 preview again. Place the verified component via \`apply_composition\` as a \`{kind:'component', componentId, props}\` clip.
|
|
120
|
+
CUSTOM GRAPHICS \u2014 author or FORK: \`create_component\` (tsxSource + contract-v2 manifest) from scratch, or \`get_component_source\` on a built-in primitive (e.g. \`cinematic-title\`) to fork its editable module. Iterate author\u2192preview\u2192fix with \`preview_component\` (202 + jobId; \`wait_job(kind:"preview")\` returns the verified artifact from the same immutable bundle used by production; a compile/runtime/capability failure lands on the job's FAILED terminal carrying the sanitized author-fixable message) \u2192 fix via \`update_component\` \u2192 preview again. Place the verified component via \`apply_composition\` as a \`{kind:'component', componentId, props}\` clip.
|
|
121
121
|
|
|
122
122
|
Cleanup: \`delete_project\` / \`delete_media\` / \`delete_webhook\` / \`delete_composition\`. \`list_projects\` re-orients you in an existing workspace; \`list_media\` (filter by \`source\`/\`tag\`) lists the library.
|
|
123
123
|
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
assertSceneShotParamsAdmitted,
|
|
4
4
|
materializeComponentSource,
|
|
5
5
|
renderComponentAlpha
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DBBKM74E.js";
|
|
7
7
|
import {
|
|
8
8
|
assertSourceReadsDeclaredAssets
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZUCLQVXD.js";
|
|
10
10
|
import {
|
|
11
11
|
resolvedComponentRenderer
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VSHAP22Q.js";
|
|
13
13
|
import {
|
|
14
14
|
componentArtifactId,
|
|
15
15
|
componentBundleId,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
ComponentRuntimeError,
|
|
26
26
|
assertGraphicsReceiptMatches,
|
|
27
27
|
assertRendererReceiptMatches
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-BLVSFN6J.js";
|
|
29
29
|
|
|
30
30
|
// ../execution/component-runtime/src/assetServer.ts
|
|
31
31
|
import { createHash, randomBytes } from "crypto";
|
|
@@ -66,6 +66,7 @@ var ERROR_CODES = {
|
|
|
66
66
|
component_does_not_compile: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
|
|
67
67
|
component_runtime_error: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
|
|
68
68
|
component_source_unavailable: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
|
|
69
|
+
component_source_unpinned: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
|
|
69
70
|
scene_materialization_failed: { stage: "validate", category: "authoring", retryable: false, httpStatus: 422 },
|
|
70
71
|
// ── CUE-28: codes that were thrown typed and arrived as internal_error 500 ──
|
|
71
72
|
//
|
|
@@ -182,6 +183,7 @@ var ERROR_CODES = {
|
|
|
182
183
|
wrong_status: { stage: "billing", category: "authoring", retryable: false, httpStatus: 409 },
|
|
183
184
|
transcript_payload_empty: { stage: "import", category: "authoring", retryable: false, httpStatus: 422 },
|
|
184
185
|
render_job_no_snapshot: { stage: "render", category: "internal", retryable: false, httpStatus: 500 },
|
|
186
|
+
composition_unreadable: { stage: "validate", category: "internal", retryable: false, httpStatus: 500 },
|
|
185
187
|
project_revision_invariant: { stage: "system", category: "internal", retryable: false, httpStatus: 500 },
|
|
186
188
|
// ── INTERNAL: the message would describe our infrastructure, not the request.
|
|
187
189
|
// Registered anyway, so the CODE and `retryable` are still honest even though
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../composition/src/validators/graphicKinds.ts
|
|
2
|
-
var AUTHORED_GRAPHIC_KINDS = ["overlay", "component", "card"
|
|
2
|
+
var AUTHORED_GRAPHIC_KINDS = ["overlay", "component", "card"];
|
|
3
3
|
var GRAPHIC_ROLE_CANONICAL_KIND = {
|
|
4
4
|
"title-card": "overlay",
|
|
5
5
|
stat: "overlay",
|
|
@@ -62,7 +62,9 @@ var ComponentClipSource = z2.object({
|
|
|
62
62
|
kind: z2.literal("component"),
|
|
63
63
|
componentId: z2.string().min(1),
|
|
64
64
|
props: z2.record(z2.string(), z2.unknown()),
|
|
65
|
-
assets: z2.record(z2.string().min(1), z2.string().min(1)).optional()
|
|
65
|
+
assets: z2.record(z2.string().min(1), z2.string().min(1)).optional().describe(
|
|
66
|
+
"Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."
|
|
67
|
+
),
|
|
66
68
|
zPlane: z2.enum(["front", "behind-subject"]).optional()
|
|
67
69
|
});
|
|
68
70
|
var OverlayClipSource = z2.object({
|
|
@@ -78,15 +80,6 @@ var EffectClipSource = z2.object({
|
|
|
78
80
|
primitiveId: z2.string().min(1),
|
|
79
81
|
params: z2.record(z2.string(), z2.unknown()).optional()
|
|
80
82
|
});
|
|
81
|
-
var AlphaLayerClipSource = z2.object({
|
|
82
|
-
kind: z2.literal("alpha-layer"),
|
|
83
|
-
componentId: z2.string().min(1),
|
|
84
|
-
props: z2.record(z2.string(), z2.unknown()),
|
|
85
|
-
assets: z2.record(z2.string().min(1), z2.string().min(1)).optional().describe(
|
|
86
|
-
"Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."
|
|
87
|
-
),
|
|
88
|
-
zPlane: z2.enum(["front", "behind-subject"]).optional()
|
|
89
|
-
});
|
|
90
83
|
var CardClipSource = z2.object({
|
|
91
84
|
kind: z2.literal("card"),
|
|
92
85
|
html: CardHtml,
|
|
@@ -103,7 +96,6 @@ var ClipSource = z2.discriminatedUnion("kind", [
|
|
|
103
96
|
ComponentClipSource,
|
|
104
97
|
OverlayClipSource,
|
|
105
98
|
EffectClipSource,
|
|
106
|
-
AlphaLayerClipSource,
|
|
107
99
|
CardClipSource,
|
|
108
100
|
CompositionClipSource
|
|
109
101
|
]);
|
|
@@ -636,7 +628,6 @@ export {
|
|
|
636
628
|
ComponentClipSource,
|
|
637
629
|
OverlayClipSource,
|
|
638
630
|
EffectClipSource,
|
|
639
|
-
AlphaLayerClipSource,
|
|
640
631
|
CardClipSource,
|
|
641
632
|
CompositionClipSource,
|
|
642
633
|
ClipSource,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FitText
|
|
3
|
-
} from "./chunk-XHGZ2E77.js";
|
|
4
1
|
import {
|
|
5
2
|
EASING_BY_INTENT
|
|
6
3
|
} from "./chunk-MFHXCHRI.js";
|
|
4
|
+
import {
|
|
5
|
+
FitText
|
|
6
|
+
} from "./chunk-XHGZ2E77.js";
|
|
7
7
|
import {
|
|
8
8
|
ACCENT,
|
|
9
9
|
ACCENT_STRONG,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
perspectiveFor,
|
|
27
27
|
resolveCamera,
|
|
28
28
|
useStage
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-TG756AMB.js";
|
|
30
30
|
|
|
31
31
|
// ../execution/primitives/src/effects/blur/index.tsx
|
|
32
32
|
import React2 from "react";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
slabTriangleCount,
|
|
20
20
|
takeSceneEnvironment,
|
|
21
21
|
useSceneActualResourceRegistrarV1
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-WONOHP4G.js";
|
|
23
23
|
import {
|
|
24
24
|
PHOTOGRAPHIC_STUDIO_RIG_ID,
|
|
25
25
|
SCENE_SLAB_CONTENT_OFFSET,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
sceneTextureBytes,
|
|
32
32
|
sceneVideoMidpointAddressV1,
|
|
33
33
|
selectSceneBakeScale
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-UB6Z7RY4.js";
|
|
35
35
|
import {
|
|
36
36
|
resolveCaptionFaces
|
|
37
37
|
} from "./chunk-OOL7ZUG7.js";
|
|
@@ -1340,7 +1340,7 @@ function isTimelineClip(content) {
|
|
|
1340
1340
|
return "source" in content;
|
|
1341
1341
|
}
|
|
1342
1342
|
function isSceneShotClip(content, resolveSource) {
|
|
1343
|
-
if (!isTimelineClip(content) || content.source.kind !== "component"
|
|
1343
|
+
if (!isTimelineClip(content) || content.source.kind !== "component") return false;
|
|
1344
1344
|
const ref = readSceneSourceRef(content.source.props);
|
|
1345
1345
|
if (!ref) return false;
|
|
1346
1346
|
const declaration = resolveSource(content.source.componentId, ref.sourceVersionId);
|
|
@@ -1445,8 +1445,8 @@ function bindingIssues(spec2, assets, path, mediaKindById) {
|
|
|
1445
1445
|
function sceneClipShapeIssues(clip, ctx, options = {}) {
|
|
1446
1446
|
const issues = [];
|
|
1447
1447
|
const source = clip.source;
|
|
1448
|
-
if (source.kind !== "component"
|
|
1449
|
-
return [{ path: "source.kind", detail: `a scene shot is a 'component'
|
|
1448
|
+
if (source.kind !== "component") {
|
|
1449
|
+
return [{ path: "source.kind", detail: `a scene shot is a 'component' clip; got '${source.kind}'.`, code: "invalid_composition" }];
|
|
1450
1450
|
}
|
|
1451
1451
|
if (source.zPlane !== void 0 && source.zPlane !== "front") {
|
|
1452
1452
|
issues.push({
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComponentHostAttestationV2,
|
|
3
3
|
ComponentRuntimeError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BLVSFN6J.js";
|
|
5
5
|
import {
|
|
6
6
|
canonicalJson
|
|
7
7
|
} from "./chunk-XHMKPTHV.js";
|
|
8
8
|
import {
|
|
9
9
|
STUDIO_SHADOW_MAP_BUDGET
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UB6Z7RY4.js";
|
|
11
11
|
|
|
12
12
|
// ../execution/component-runtime/src/webglProbe.ts
|
|
13
13
|
function webglBackend(platform, hardware) {
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// ../composition/src/componentClip.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var ComponentSourceRefV1 = z.object({
|
|
4
|
+
version: z.literal(1),
|
|
5
|
+
sourceVersionId: z.string().regex(/^[a-f0-9]{64}$/)
|
|
6
|
+
}).strict();
|
|
7
|
+
var COMPONENT_SOURCE_REF_PROP = "componentRef";
|
|
8
|
+
var COMPONENT_RENDER_SEED_PROP = "renderSeed";
|
|
9
|
+
function readComponentSourceRef(props) {
|
|
10
|
+
const parsed = ComponentSourceRefV1.safeParse(props[COMPONENT_SOURCE_REF_PROP]);
|
|
11
|
+
return parsed.success ? parsed.data : null;
|
|
12
|
+
}
|
|
13
|
+
function authoredComponentProps(props) {
|
|
14
|
+
const { [COMPONENT_SOURCE_REF_PROP]: _ref, [COMPONENT_RENDER_SEED_PROP]: _seed, ...authored } = props;
|
|
15
|
+
return authored;
|
|
16
|
+
}
|
|
17
|
+
var COMPONENT_SOURCE_UNPINNED = "component_source_unpinned";
|
|
18
|
+
function componentClipRenderInput(clip) {
|
|
19
|
+
const ref = readComponentSourceRef(clip.props);
|
|
20
|
+
if (!ref) {
|
|
21
|
+
return {
|
|
22
|
+
ok: false,
|
|
23
|
+
refusal: {
|
|
24
|
+
code: COMPONENT_SOURCE_UNPINNED,
|
|
25
|
+
message: `component clip ${clip.id} of '${clip.componentId}' pins no immutable source version (props.componentRef)`
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const seed = clip.props[COMPONENT_RENDER_SEED_PROP];
|
|
30
|
+
if (seed !== void 0 && (typeof seed !== "string" || seed.length === 0)) {
|
|
31
|
+
return {
|
|
32
|
+
ok: false,
|
|
33
|
+
refusal: { code: "invalid_composition", message: `component clip ${clip.id}: props.renderSeed must be a non-empty string` }
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
ok: true,
|
|
38
|
+
input: {
|
|
39
|
+
sourceVersionId: ref.sourceVersionId,
|
|
40
|
+
params: authoredComponentProps(clip.props),
|
|
41
|
+
seed: seed ?? `${clip.componentId}:${clip.id}`
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function sceneSurfacePins(scene) {
|
|
46
|
+
const pins = [];
|
|
47
|
+
const visit = (objects, prefix) => {
|
|
48
|
+
if (!Array.isArray(objects)) return;
|
|
49
|
+
objects.forEach((candidate, index) => {
|
|
50
|
+
if (!candidate || typeof candidate !== "object") return;
|
|
51
|
+
const object = candidate;
|
|
52
|
+
const path = `${prefix}.${index}`;
|
|
53
|
+
if (object.kind === "group") visit(object.children, `${path}.children`);
|
|
54
|
+
const surfaces = object.surfaces;
|
|
55
|
+
if (!surfaces || typeof surfaces !== "object") return;
|
|
56
|
+
for (const [slot, raw] of Object.entries(surfaces)) {
|
|
57
|
+
if (!raw || typeof raw !== "object" || raw.source !== "component") continue;
|
|
58
|
+
const component = raw.component;
|
|
59
|
+
pins.push({
|
|
60
|
+
surfacePath: `${path}.surfaces.${slot}`,
|
|
61
|
+
componentId: typeof component?.componentId === "string" ? component.componentId : "",
|
|
62
|
+
sourceVersionId: typeof component?.sourceVersionId === "string" ? component.sourceVersionId : ""
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
visit(scene?.layers, "layers");
|
|
68
|
+
return pins;
|
|
69
|
+
}
|
|
70
|
+
function compositionComponentPins(composition) {
|
|
71
|
+
const pins = /* @__PURE__ */ new Map();
|
|
72
|
+
const add = ({ componentId, sourceVersionId }) => {
|
|
73
|
+
if (componentId && sourceVersionId) pins.set(`${componentId}:${sourceVersionId}`, { componentId, sourceVersionId });
|
|
74
|
+
};
|
|
75
|
+
for (const track of composition.tracks) {
|
|
76
|
+
for (const clip of track.contents) {
|
|
77
|
+
const source = clip.source;
|
|
78
|
+
if (source?.kind !== "component" || typeof source.componentId !== "string") continue;
|
|
79
|
+
const props = source.props ?? {};
|
|
80
|
+
const ref = readComponentSourceRef(props);
|
|
81
|
+
if (ref) add({ componentId: source.componentId, sourceVersionId: ref.sourceVersionId });
|
|
82
|
+
for (const pin of sceneSurfacePins(authoredComponentProps(props).scene)) add(pin);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return [...pins.values()];
|
|
86
|
+
}
|
|
87
|
+
function repinnedScene(scene, repin) {
|
|
88
|
+
let moved = 0;
|
|
89
|
+
const visit = (objects) => {
|
|
90
|
+
if (!Array.isArray(objects)) return objects;
|
|
91
|
+
return objects.map((candidate) => {
|
|
92
|
+
if (!candidate || typeof candidate !== "object") return candidate;
|
|
93
|
+
let object = candidate;
|
|
94
|
+
if (object.kind === "group") object = { ...object, children: visit(object.children) };
|
|
95
|
+
const surfaces = object.surfaces;
|
|
96
|
+
if (!surfaces || typeof surfaces !== "object") return object;
|
|
97
|
+
const next = {};
|
|
98
|
+
for (const [slot, raw] of Object.entries(surfaces)) {
|
|
99
|
+
const surface = raw;
|
|
100
|
+
const component = surface?.component;
|
|
101
|
+
if (surface?.source === "component" && component?.componentId === repin.componentId && component.sourceVersionId === repin.from) {
|
|
102
|
+
next[slot] = { ...surface, component: { ...component, sourceVersionId: repin.to } };
|
|
103
|
+
moved += 1;
|
|
104
|
+
} else {
|
|
105
|
+
next[slot] = raw;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return { ...object, surfaces: next };
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
if (!scene || typeof scene !== "object" || !("layers" in scene)) return { scene, moved: 0 };
|
|
112
|
+
const layers = visit(scene.layers);
|
|
113
|
+
return moved === 0 ? { scene, moved: 0 } : { scene: { ...scene, layers }, moved };
|
|
114
|
+
}
|
|
115
|
+
function repinnedComponentProps(clipComponentId, props, repin) {
|
|
116
|
+
let next = props;
|
|
117
|
+
let moved = 0;
|
|
118
|
+
if (clipComponentId === repin.componentId && readComponentSourceRef(props)?.sourceVersionId === repin.from) {
|
|
119
|
+
next = { ...next, [COMPONENT_SOURCE_REF_PROP]: { version: 1, sourceVersionId: repin.to } };
|
|
120
|
+
moved += 1;
|
|
121
|
+
}
|
|
122
|
+
const nested = repinnedScene(props.scene, repin);
|
|
123
|
+
if (nested.moved > 0) {
|
|
124
|
+
next = { ...next, scene: nested.scene };
|
|
125
|
+
moved += nested.moved;
|
|
126
|
+
}
|
|
127
|
+
return { props: next, moved };
|
|
128
|
+
}
|
|
129
|
+
function componentPinCount(composition, componentId, sourceVersionId) {
|
|
130
|
+
let count = 0;
|
|
131
|
+
for (const track of composition.tracks) {
|
|
132
|
+
for (const clip of track.contents) {
|
|
133
|
+
const source = clip.source;
|
|
134
|
+
if (source?.kind !== "component" || typeof source.componentId !== "string") continue;
|
|
135
|
+
count += placedPinCount(source.componentId, source.props ?? {}, componentId, sourceVersionId);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return count;
|
|
139
|
+
}
|
|
140
|
+
function placedPinCount(clipComponentId, props, componentId, sourceVersionId) {
|
|
141
|
+
const own = clipComponentId === componentId && readComponentSourceRef(props)?.sourceVersionId === sourceVersionId ? 1 : 0;
|
|
142
|
+
const nested = sceneSurfacePins(authoredComponentProps(props).scene).filter(
|
|
143
|
+
(pin) => pin.componentId === componentId && pin.sourceVersionId === sourceVersionId
|
|
144
|
+
).length;
|
|
145
|
+
return own + nested;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export {
|
|
149
|
+
ComponentSourceRefV1,
|
|
150
|
+
COMPONENT_SOURCE_REF_PROP,
|
|
151
|
+
COMPONENT_RENDER_SEED_PROP,
|
|
152
|
+
readComponentSourceRef,
|
|
153
|
+
authoredComponentProps,
|
|
154
|
+
COMPONENT_SOURCE_UNPINNED,
|
|
155
|
+
componentClipRenderInput,
|
|
156
|
+
sceneSurfacePins,
|
|
157
|
+
compositionComponentPins,
|
|
158
|
+
repinnedComponentProps,
|
|
159
|
+
componentPinCount,
|
|
160
|
+
placedPinCount
|
|
161
|
+
};
|