@cueframe/kernel 0.2.49 → 0.2.51

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 (40) hide show
  1. package/dist/_members/composition/validators/composition.d.ts +49 -0
  2. package/dist/_members/composition/validators/render.d.ts +24 -0
  3. package/dist/_members/composition-ops/index.d.ts +12 -0
  4. package/dist/_members/primitives/captions/placement.d.ts +6 -1
  5. package/dist/authoring/build-tools.js +5 -5
  6. package/dist/authoring/context.js +4 -4
  7. package/dist/authoring/tools.js +4 -4
  8. package/dist/authoring.js +12 -12
  9. package/dist/{chunk-AOIY7NGF.js → chunk-2LUAUF46.js} +56 -0
  10. package/dist/{chunk-4QMRY7KU.js → chunk-4CNJGY7P.js} +46 -9
  11. package/dist/{chunk-CFIQY4OE.js → chunk-4WBSXHQA.js} +8 -4
  12. package/dist/{chunk-XSBVOXSB.js → chunk-FSA3UBVR.js} +1 -1
  13. package/dist/{chunk-4FKNPTLX.js → chunk-IHWC75AN.js} +1 -1
  14. package/dist/{chunk-BBNF4QLD.js → chunk-KY3QBG7O.js} +4 -4
  15. package/dist/{chunk-AG7HKF2U.js → chunk-LO3DH776.js} +1 -1
  16. package/dist/{chunk-ID5QY7V6.js → chunk-LZEX2GAY.js} +8 -0
  17. package/dist/{chunk-DJRKEUK3.js → chunk-M665ZQYB.js} +3 -3
  18. package/dist/{chunk-FYS2XUKJ.js → chunk-MOUWO53S.js} +1 -1
  19. package/dist/{chunk-VEQTURKN.js → chunk-NLXQ7WTH.js} +1 -1
  20. package/dist/{chunk-SLUTOUWI.js → chunk-OVV35ZS2.js} +1 -1
  21. package/dist/{chunk-E3FYYVCG.js → chunk-YKXOAGY3.js} +9 -9
  22. package/dist/compose.js +3 -3
  23. package/dist/composition/graphics-plan.js +7 -7
  24. package/dist/composition/ops.js +3 -3
  25. package/dist/composition/projection.js +1 -1
  26. package/dist/composition/validators.js +4 -2
  27. package/dist/composition-ops.js +10 -6
  28. package/dist/composition.js +80 -78
  29. package/dist/{context-YNR73FNI.js → context-AIUJG7R4.js} +4 -4
  30. package/dist/core/render.js +6 -2
  31. package/dist/core.js +6 -2
  32. package/dist/mcp/adapter.js +3 -3
  33. package/dist/mcp/core.js +1 -1
  34. package/dist/mcp/curation.js +1 -1
  35. package/dist/mcp/scene-shot.js +2 -2
  36. package/dist/mcp/server.js +15 -11
  37. package/dist/mcp.js +15 -11
  38. package/dist/primitives/captions.js +34 -12
  39. package/dist/render-harness.js +6 -2
  40. package/package.json +10 -10
@@ -323,6 +323,13 @@ export declare const Region: z.ZodObject<{
323
323
  h: z.ZodNumber;
324
324
  }, z.core.$strip>;
325
325
  export type Region = z.infer<typeof Region>;
326
+ /** A caption layout box must stay wholly within the output frame. */
327
+ export declare const CaptionRegion: z.ZodObject<{
328
+ x: z.ZodNumber;
329
+ y: z.ZodNumber;
330
+ w: z.ZodNumber;
331
+ h: z.ZodNumber;
332
+ }, z.core.$strip>;
326
333
  export declare const ClipFit: z.ZodEnum<{
327
334
  contain: "contain";
328
335
  cover: "cover";
@@ -910,6 +917,12 @@ export declare const CaptionStyle: z.ZodObject<{
910
917
  center: "center";
911
918
  bottom: "bottom";
912
919
  }>>;
920
+ region: z.ZodOptional<z.ZodObject<{
921
+ x: z.ZodNumber;
922
+ y: z.ZodNumber;
923
+ w: z.ZodNumber;
924
+ h: z.ZodNumber;
925
+ }, z.core.$strip>>;
913
926
  textTransform: z.ZodOptional<z.ZodEnum<{
914
927
  none: "none";
915
928
  uppercase: "uppercase";
@@ -998,6 +1011,12 @@ export declare const CompositionCaptions: z.ZodDiscriminatedUnion<[z.ZodObject<{
998
1011
  center: "center";
999
1012
  bottom: "bottom";
1000
1013
  }>>;
1014
+ region: z.ZodOptional<z.ZodObject<{
1015
+ x: z.ZodNumber;
1016
+ y: z.ZodNumber;
1017
+ w: z.ZodNumber;
1018
+ h: z.ZodNumber;
1019
+ }, z.core.$strip>>;
1001
1020
  textTransform: z.ZodOptional<z.ZodEnum<{
1002
1021
  none: "none";
1003
1022
  uppercase: "uppercase";
@@ -1073,6 +1092,12 @@ export declare const CompositionCaptions: z.ZodDiscriminatedUnion<[z.ZodObject<{
1073
1092
  center: "center";
1074
1093
  bottom: "bottom";
1075
1094
  }>>;
1095
+ region: z.ZodOptional<z.ZodObject<{
1096
+ x: z.ZodNumber;
1097
+ y: z.ZodNumber;
1098
+ w: z.ZodNumber;
1099
+ h: z.ZodNumber;
1100
+ }, z.core.$strip>>;
1076
1101
  textTransform: z.ZodOptional<z.ZodEnum<{
1077
1102
  none: "none";
1078
1103
  uppercase: "uppercase";
@@ -1341,6 +1366,12 @@ export declare const Composition: z.ZodObject<{
1341
1366
  center: "center";
1342
1367
  bottom: "bottom";
1343
1368
  }>>;
1369
+ region: z.ZodOptional<z.ZodObject<{
1370
+ x: z.ZodNumber;
1371
+ y: z.ZodNumber;
1372
+ w: z.ZodNumber;
1373
+ h: z.ZodNumber;
1374
+ }, z.core.$strip>>;
1344
1375
  textTransform: z.ZodOptional<z.ZodEnum<{
1345
1376
  none: "none";
1346
1377
  uppercase: "uppercase";
@@ -1416,6 +1447,12 @@ export declare const Composition: z.ZodObject<{
1416
1447
  center: "center";
1417
1448
  bottom: "bottom";
1418
1449
  }>>;
1450
+ region: z.ZodOptional<z.ZodObject<{
1451
+ x: z.ZodNumber;
1452
+ y: z.ZodNumber;
1453
+ w: z.ZodNumber;
1454
+ h: z.ZodNumber;
1455
+ }, z.core.$strip>>;
1419
1456
  textTransform: z.ZodOptional<z.ZodEnum<{
1420
1457
  none: "none";
1421
1458
  uppercase: "uppercase";
@@ -1725,6 +1762,12 @@ export declare const CompositionVersion: z.ZodObject<{
1725
1762
  center: "center";
1726
1763
  bottom: "bottom";
1727
1764
  }>>;
1765
+ region: z.ZodOptional<z.ZodObject<{
1766
+ x: z.ZodNumber;
1767
+ y: z.ZodNumber;
1768
+ w: z.ZodNumber;
1769
+ h: z.ZodNumber;
1770
+ }, z.core.$strip>>;
1728
1771
  textTransform: z.ZodOptional<z.ZodEnum<{
1729
1772
  none: "none";
1730
1773
  uppercase: "uppercase";
@@ -1800,6 +1843,12 @@ export declare const CompositionVersion: z.ZodObject<{
1800
1843
  center: "center";
1801
1844
  bottom: "bottom";
1802
1845
  }>>;
1846
+ region: z.ZodOptional<z.ZodObject<{
1847
+ x: z.ZodNumber;
1848
+ y: z.ZodNumber;
1849
+ w: z.ZodNumber;
1850
+ h: z.ZodNumber;
1851
+ }, z.core.$strip>>;
1803
1852
  textTransform: z.ZodOptional<z.ZodEnum<{
1804
1853
  none: "none";
1805
1854
  uppercase: "uppercase";
@@ -269,6 +269,12 @@ export declare const RenderSnapshot: z.ZodObject<{
269
269
  center: "center";
270
270
  bottom: "bottom";
271
271
  }>>;
272
+ region: z.ZodOptional<z.ZodObject<{
273
+ x: z.ZodNumber;
274
+ y: z.ZodNumber;
275
+ w: z.ZodNumber;
276
+ h: z.ZodNumber;
277
+ }, z.core.$strip>>;
272
278
  textTransform: z.ZodOptional<z.ZodEnum<{
273
279
  none: "none";
274
280
  uppercase: "uppercase";
@@ -344,6 +350,12 @@ export declare const RenderSnapshot: z.ZodObject<{
344
350
  center: "center";
345
351
  bottom: "bottom";
346
352
  }>>;
353
+ region: z.ZodOptional<z.ZodObject<{
354
+ x: z.ZodNumber;
355
+ y: z.ZodNumber;
356
+ w: z.ZodNumber;
357
+ h: z.ZodNumber;
358
+ }, z.core.$strip>>;
347
359
  textTransform: z.ZodOptional<z.ZodEnum<{
348
360
  none: "none";
349
361
  uppercase: "uppercase";
@@ -1101,6 +1113,12 @@ export declare const RenderJob: z.ZodObject<{
1101
1113
  center: "center";
1102
1114
  bottom: "bottom";
1103
1115
  }>>;
1116
+ region: z.ZodOptional<z.ZodObject<{
1117
+ x: z.ZodNumber;
1118
+ y: z.ZodNumber;
1119
+ w: z.ZodNumber;
1120
+ h: z.ZodNumber;
1121
+ }, z.core.$strip>>;
1104
1122
  textTransform: z.ZodOptional<z.ZodEnum<{
1105
1123
  none: "none";
1106
1124
  uppercase: "uppercase";
@@ -1176,6 +1194,12 @@ export declare const RenderJob: z.ZodObject<{
1176
1194
  center: "center";
1177
1195
  bottom: "bottom";
1178
1196
  }>>;
1197
+ region: z.ZodOptional<z.ZodObject<{
1198
+ x: z.ZodNumber;
1199
+ y: z.ZodNumber;
1200
+ w: z.ZodNumber;
1201
+ h: z.ZodNumber;
1202
+ }, z.core.$strip>>;
1179
1203
  textTransform: z.ZodOptional<z.ZodEnum<{
1180
1204
  none: "none";
1181
1205
  uppercase: "uppercase";
@@ -661,6 +661,12 @@ export declare const CompositionOp: z.ZodDiscriminatedUnion<[z.ZodObject<{
661
661
  center: "center";
662
662
  bottom: "bottom";
663
663
  }>>>;
664
+ region: z.ZodOptional<z.ZodOptional<z.ZodObject<{
665
+ x: z.ZodNumber;
666
+ y: z.ZodNumber;
667
+ w: z.ZodNumber;
668
+ h: z.ZodNumber;
669
+ }, z.core.$strip>>>;
664
670
  textTransform: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
665
671
  none: "none";
666
672
  uppercase: "uppercase";
@@ -738,6 +744,12 @@ export declare const CompositionOp: z.ZodDiscriminatedUnion<[z.ZodObject<{
738
744
  center: "center";
739
745
  bottom: "bottom";
740
746
  }>>>;
747
+ region: z.ZodOptional<z.ZodOptional<z.ZodObject<{
748
+ x: z.ZodNumber;
749
+ y: z.ZodNumber;
750
+ w: z.ZodNumber;
751
+ h: z.ZodNumber;
752
+ }, z.core.$strip>>>;
741
753
  textTransform: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
742
754
  none: "none";
743
755
  uppercase: "uppercase";
@@ -2,4 +2,9 @@ import type { CSSProperties } from 'react';
2
2
  export declare function resolveCaptionPlacement(position: 'top' | 'center' | 'bottom' | undefined, region: {
3
3
  y: number;
4
4
  h: number;
5
- } | undefined): CSSProperties;
5
+ } | undefined, authoredRegion?: {
6
+ x: number;
7
+ y: number;
8
+ w: number;
9
+ h: number;
10
+ }): CSSProperties;
@@ -4,13 +4,13 @@ import {
4
4
  buildPlannerTools,
5
5
  buildToolsFromSchemas,
6
6
  extractProviderError
7
- } from "../chunk-4FKNPTLX.js";
8
- import "../chunk-BBNF4QLD.js";
7
+ } from "../chunk-IHWC75AN.js";
8
+ import "../chunk-KY3QBG7O.js";
9
9
  import "../chunk-JOURGVOR.js";
10
10
  import "../chunk-7AZLFN26.js";
11
- import "../chunk-VEQTURKN.js";
12
- import "../chunk-AG7HKF2U.js";
13
- import "../chunk-ID5QY7V6.js";
11
+ import "../chunk-NLXQ7WTH.js";
12
+ import "../chunk-LO3DH776.js";
13
+ import "../chunk-LZEX2GAY.js";
14
14
  import "../chunk-WPZKOVYF.js";
15
15
  import "../chunk-B7J5UUUV.js";
16
16
  import "../chunk-KYRDKK2D.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  buildDirectorContext
3
- } from "../chunk-SLUTOUWI.js";
4
- import "../chunk-VEQTURKN.js";
5
- import "../chunk-AG7HKF2U.js";
6
- import "../chunk-ID5QY7V6.js";
3
+ } from "../chunk-OVV35ZS2.js";
4
+ import "../chunk-NLXQ7WTH.js";
5
+ import "../chunk-LO3DH776.js";
6
+ import "../chunk-LZEX2GAY.js";
7
7
  import "../chunk-WPZKOVYF.js";
8
8
  import "../chunk-B7J5UUUV.js";
9
9
  import "../chunk-KYRDKK2D.js";
@@ -6,12 +6,12 @@ import {
6
6
  COMPOSE_ROLE_TOOLS,
7
7
  COMPOSE_ROLE_TOOL_NAMES,
8
8
  dispatchComposeRoleTool
9
- } from "../chunk-BBNF4QLD.js";
9
+ } from "../chunk-KY3QBG7O.js";
10
10
  import "../chunk-JOURGVOR.js";
11
11
  import "../chunk-7AZLFN26.js";
12
- import "../chunk-VEQTURKN.js";
13
- import "../chunk-AG7HKF2U.js";
14
- import "../chunk-ID5QY7V6.js";
12
+ import "../chunk-NLXQ7WTH.js";
13
+ import "../chunk-LO3DH776.js";
14
+ import "../chunk-LZEX2GAY.js";
15
15
  import "../chunk-WPZKOVYF.js";
16
16
  import "../chunk-B7J5UUUV.js";
17
17
  import "../chunk-KYRDKK2D.js";
package/dist/authoring.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  buildPlannerTools,
12
12
  buildToolsFromSchemas,
13
13
  extractProviderError
14
- } from "./chunk-4FKNPTLX.js";
14
+ } from "./chunk-IHWC75AN.js";
15
15
  import {
16
16
  COMPOSE_MOTION_TOOLS,
17
17
  COMPOSE_MOTION_VERIFY_TOOLS,
@@ -20,14 +20,14 @@ import {
20
20
  COMPOSE_ROLE_TOOLS,
21
21
  COMPOSE_ROLE_TOOL_NAMES,
22
22
  dispatchComposeRoleTool
23
- } from "./chunk-BBNF4QLD.js";
23
+ } from "./chunk-KY3QBG7O.js";
24
24
  import {
25
25
  AgentFixableCaptureError,
26
26
  getExcludedTools
27
27
  } from "./chunk-JOURGVOR.js";
28
28
  import {
29
29
  buildDirectorContext
30
- } from "./chunk-SLUTOUWI.js";
30
+ } from "./chunk-OVV35ZS2.js";
31
31
  import {
32
32
  buildFastModel,
33
33
  buildModel,
@@ -48,22 +48,22 @@ import {
48
48
  formatPlanSteps,
49
49
  initCodeGenPrompts
50
50
  } from "./chunk-Y4HPN4BC.js";
51
- import "./chunk-6WQHVYJD.js";
52
- import {
53
- cssLayoutVars
54
- } from "./chunk-Z6NY6MCL.js";
55
- import "./chunk-ILO4NEZ3.js";
56
51
  import "./chunk-7AZLFN26.js";
57
- import "./chunk-VG2ND6PX.js";
58
- import "./chunk-VEQTURKN.js";
59
- import "./chunk-AG7HKF2U.js";
60
- import "./chunk-ID5QY7V6.js";
52
+ import "./chunk-NLXQ7WTH.js";
53
+ import "./chunk-LO3DH776.js";
54
+ import "./chunk-LZEX2GAY.js";
61
55
  import "./chunk-WPZKOVYF.js";
62
56
  import "./chunk-B7J5UUUV.js";
63
57
  import "./chunk-KYRDKK2D.js";
58
+ import "./chunk-6WQHVYJD.js";
59
+ import {
60
+ cssLayoutVars
61
+ } from "./chunk-Z6NY6MCL.js";
64
62
  import "./chunk-WREYUH2E.js";
63
+ import "./chunk-ILO4NEZ3.js";
65
64
  import "./chunk-E63UEO5C.js";
66
65
  import "./chunk-7PA7FGLD.js";
66
+ import "./chunk-VG2ND6PX.js";
67
67
  import {
68
68
  collectSceneClipIssues,
69
69
  isSceneShotClip
@@ -2584,6 +2584,14 @@ var compositionCaptionsOneSegmentsItemWordsItemEndMsMin = 0;
2584
2584
  var compositionCaptionsOneStyleFontSizeMax = 15;
2585
2585
  var compositionCaptionsOneStyleFontWeightMin = 100;
2586
2586
  var compositionCaptionsOneStyleFontWeightMax = 900;
2587
+ var compositionCaptionsOneStyleRegionXMin = 0;
2588
+ var compositionCaptionsOneStyleRegionXMax = 1;
2589
+ var compositionCaptionsOneStyleRegionYMin = 0;
2590
+ var compositionCaptionsOneStyleRegionYMax = 1;
2591
+ var compositionCaptionsOneStyleRegionWExclusiveMin = 0;
2592
+ var compositionCaptionsOneStyleRegionWMax = 1;
2593
+ var compositionCaptionsOneStyleRegionHExclusiveMin = 0;
2594
+ var compositionCaptionsOneStyleRegionHMax = 1;
2587
2595
  var compositionCaptionsOneStyleEmphasisScaleExclusiveMin = 0;
2588
2596
  var compositionCaptionsOneStyleEmphasisFontWeightMin = 100;
2589
2597
  var compositionCaptionsOneStyleEmphasisFontWeightMax = 900;
@@ -2598,6 +2606,14 @@ var compositionCaptionsTwoSegmentsItemWordsItemEndMsMin = 0;
2598
2606
  var compositionCaptionsTwoStyleFontSizeMax = 15;
2599
2607
  var compositionCaptionsTwoStyleFontWeightMin = 100;
2600
2608
  var compositionCaptionsTwoStyleFontWeightMax = 900;
2609
+ var compositionCaptionsTwoStyleRegionXMin = 0;
2610
+ var compositionCaptionsTwoStyleRegionXMax = 1;
2611
+ var compositionCaptionsTwoStyleRegionYMin = 0;
2612
+ var compositionCaptionsTwoStyleRegionYMax = 1;
2613
+ var compositionCaptionsTwoStyleRegionWExclusiveMin = 0;
2614
+ var compositionCaptionsTwoStyleRegionWMax = 1;
2615
+ var compositionCaptionsTwoStyleRegionHExclusiveMin = 0;
2616
+ var compositionCaptionsTwoStyleRegionHMax = 1;
2601
2617
  var compositionCaptionsTwoStyleEmphasisScaleExclusiveMin = 0;
2602
2618
  var compositionCaptionsTwoStyleEmphasisFontWeightMin = 100;
2603
2619
  var compositionCaptionsTwoStyleEmphasisFontWeightMax = 900;
@@ -2797,6 +2813,12 @@ var Composition = zod58.strictObject({
2797
2813
  "backgroundColor": zod58.string().optional(),
2798
2814
  "plate": zod58.enum(["glass", "solid", "none"]).optional(),
2799
2815
  "position": zod58.enum(["top", "center", "bottom"]).optional(),
2816
+ "region": zod58.strictObject({
2817
+ "x": zod58.number().min(compositionCaptionsOneStyleRegionXMin).max(compositionCaptionsOneStyleRegionXMax),
2818
+ "y": zod58.number().min(compositionCaptionsOneStyleRegionYMin).max(compositionCaptionsOneStyleRegionYMax),
2819
+ "w": zod58.number().gt(compositionCaptionsOneStyleRegionWExclusiveMin).max(compositionCaptionsOneStyleRegionWMax),
2820
+ "h": zod58.number().gt(compositionCaptionsOneStyleRegionHExclusiveMin).max(compositionCaptionsOneStyleRegionHMax)
2821
+ }).optional().describe("Optional caption layout box {x,y,w,h} in normalized output-frame coordinates. Overrides position; text starts at its top edge and wraps/pages within its width and height."),
2800
2822
  "textTransform": zod58.enum(["none", "uppercase", "capitalize"]).optional(),
2801
2823
  "emphasisColor": zod58.string().optional(),
2802
2824
  "emphasisGradient": zod58.string().optional(),
@@ -2842,6 +2864,12 @@ var Composition = zod58.strictObject({
2842
2864
  "backgroundColor": zod58.string().optional(),
2843
2865
  "plate": zod58.enum(["glass", "solid", "none"]).optional(),
2844
2866
  "position": zod58.enum(["top", "center", "bottom"]).optional(),
2867
+ "region": zod58.strictObject({
2868
+ "x": zod58.number().min(compositionCaptionsTwoStyleRegionXMin).max(compositionCaptionsTwoStyleRegionXMax),
2869
+ "y": zod58.number().min(compositionCaptionsTwoStyleRegionYMin).max(compositionCaptionsTwoStyleRegionYMax),
2870
+ "w": zod58.number().gt(compositionCaptionsTwoStyleRegionWExclusiveMin).max(compositionCaptionsTwoStyleRegionWMax),
2871
+ "h": zod58.number().gt(compositionCaptionsTwoStyleRegionHExclusiveMin).max(compositionCaptionsTwoStyleRegionHMax)
2872
+ }).optional().describe("Optional caption layout box {x,y,w,h} in normalized output-frame coordinates. Overrides position; text starts at its top edge and wraps/pages within its width and height."),
2845
2873
  "textTransform": zod58.enum(["none", "uppercase", "capitalize"]).optional(),
2846
2874
  "emphasisColor": zod58.string().optional(),
2847
2875
  "emphasisGradient": zod58.string().optional(),
@@ -6072,6 +6100,14 @@ var compositionOpOneoneSegmentsOneItemBiasYMax = 0.3;
6072
6100
  var compositionOpOnethreeStyleFontSizeMax = 15;
6073
6101
  var compositionOpOnethreeStyleFontWeightMin = 100;
6074
6102
  var compositionOpOnethreeStyleFontWeightMax = 900;
6103
+ var compositionOpOnethreeStyleRegionXMin = 0;
6104
+ var compositionOpOnethreeStyleRegionXMax = 1;
6105
+ var compositionOpOnethreeStyleRegionYMin = 0;
6106
+ var compositionOpOnethreeStyleRegionYMax = 1;
6107
+ var compositionOpOnethreeStyleRegionWExclusiveMin = 0;
6108
+ var compositionOpOnethreeStyleRegionWMax = 1;
6109
+ var compositionOpOnethreeStyleRegionHExclusiveMin = 0;
6110
+ var compositionOpOnethreeStyleRegionHMax = 1;
6075
6111
  var compositionOpOnethreeStyleEmphasisScaleExclusiveMin = 0;
6076
6112
  var compositionOpOnethreeStyleEmphasisFontWeightMin = 100;
6077
6113
  var compositionOpOnethreeStyleEmphasisFontWeightMax = 900;
@@ -6086,6 +6122,14 @@ var compositionOpOnefiveSegmentsItemWordsItemEndMsMin = 0;
6086
6122
  var compositionOpOnefiveStyleFontSizeMax = 15;
6087
6123
  var compositionOpOnefiveStyleFontWeightMin = 100;
6088
6124
  var compositionOpOnefiveStyleFontWeightMax = 900;
6125
+ var compositionOpOnefiveStyleRegionXMin = 0;
6126
+ var compositionOpOnefiveStyleRegionXMax = 1;
6127
+ var compositionOpOnefiveStyleRegionYMin = 0;
6128
+ var compositionOpOnefiveStyleRegionYMax = 1;
6129
+ var compositionOpOnefiveStyleRegionWExclusiveMin = 0;
6130
+ var compositionOpOnefiveStyleRegionWMax = 1;
6131
+ var compositionOpOnefiveStyleRegionHExclusiveMin = 0;
6132
+ var compositionOpOnefiveStyleRegionHMax = 1;
6089
6133
  var compositionOpOnefiveStyleEmphasisScaleExclusiveMin = 0;
6090
6134
  var compositionOpOnefiveStyleEmphasisFontWeightMin = 100;
6091
6135
  var compositionOpOnefiveStyleEmphasisFontWeightMax = 900;
@@ -6628,6 +6672,12 @@ var CompositionOp = zod67.union([zod67.strictObject({
6628
6672
  "backgroundColor": zod67.string().optional(),
6629
6673
  "plate": zod67.enum(["glass", "solid", "none"]).optional(),
6630
6674
  "position": zod67.enum(["top", "center", "bottom"]).optional(),
6675
+ "region": zod67.strictObject({
6676
+ "x": zod67.number().min(compositionOpOnethreeStyleRegionXMin).max(compositionOpOnethreeStyleRegionXMax),
6677
+ "y": zod67.number().min(compositionOpOnethreeStyleRegionYMin).max(compositionOpOnethreeStyleRegionYMax),
6678
+ "w": zod67.number().gt(compositionOpOnethreeStyleRegionWExclusiveMin).max(compositionOpOnethreeStyleRegionWMax),
6679
+ "h": zod67.number().gt(compositionOpOnethreeStyleRegionHExclusiveMin).max(compositionOpOnethreeStyleRegionHMax)
6680
+ }).optional().describe("Optional caption layout box {x,y,w,h} in normalized output-frame coordinates. Overrides position; text starts at its top edge and wraps/pages within its width and height."),
6631
6681
  "textTransform": zod67.enum(["none", "uppercase", "capitalize"]).optional(),
6632
6682
  "emphasisColor": zod67.string().optional(),
6633
6683
  "emphasisGradient": zod67.string().optional(),
@@ -6675,6 +6725,12 @@ var CompositionOp = zod67.union([zod67.strictObject({
6675
6725
  "backgroundColor": zod67.string().optional(),
6676
6726
  "plate": zod67.enum(["glass", "solid", "none"]).optional(),
6677
6727
  "position": zod67.enum(["top", "center", "bottom"]).optional(),
6728
+ "region": zod67.strictObject({
6729
+ "x": zod67.number().min(compositionOpOnefiveStyleRegionXMin).max(compositionOpOnefiveStyleRegionXMax),
6730
+ "y": zod67.number().min(compositionOpOnefiveStyleRegionYMin).max(compositionOpOnefiveStyleRegionYMax),
6731
+ "w": zod67.number().gt(compositionOpOnefiveStyleRegionWExclusiveMin).max(compositionOpOnefiveStyleRegionWMax),
6732
+ "h": zod67.number().gt(compositionOpOnefiveStyleRegionHExclusiveMin).max(compositionOpOnefiveStyleRegionHMax)
6733
+ }).optional().describe("Optional caption layout box {x,y,w,h} in normalized output-frame coordinates. Overrides position; text starts at its top edge and wraps/pages within its width and height."),
6678
6734
  "textTransform": zod67.enum(["none", "uppercase", "capitalize"]).optional(),
6679
6735
  "emphasisColor": zod67.string().optional(),
6680
6736
  "emphasisGradient": zod67.string().optional(),
@@ -3,14 +3,6 @@ import {
3
3
  buildEasedZooms,
4
4
  buildPannedCenters
5
5
  } from "./chunk-QH3YI3ND.js";
6
- import {
7
- flattenCompoundClips,
8
- hasCompoundClips
9
- } from "./chunk-IMIUHG2E.js";
10
- import {
11
- compositionHasVo,
12
- roleDefaultGainDb
13
- } from "./chunk-VZ7TYX6Z.js";
14
6
  import {
15
7
  DOMINANCE_WEIGHTS,
16
8
  ENTER_SEC,
@@ -29,6 +21,17 @@ import {
29
21
  segmentShots,
30
22
  stabilizeSelectionHysteresis
31
23
  } from "./chunk-JPMVNMF3.js";
24
+ import {
25
+ flattenCompoundClips,
26
+ hasCompoundClips
27
+ } from "./chunk-IMIUHG2E.js";
28
+ import {
29
+ compositionHasVo,
30
+ roleDefaultGainDb
31
+ } from "./chunk-VZ7TYX6Z.js";
32
+ import {
33
+ resolveBrandRef
34
+ } from "./chunk-Z6NY6MCL.js";
32
35
  import {
33
36
  SHOT_SCALE_TARGET,
34
37
  shotScaleZoom
@@ -1810,6 +1813,39 @@ function projectEffectTrack(track, trackIndex, trackCount, fps) {
1810
1813
  }
1811
1814
 
1812
1815
  // ../execution/core/src/render/compositionRender.ts
1816
+ var CAPTION_COLOR_FIELDS = [
1817
+ "color",
1818
+ "highlightColor",
1819
+ "backgroundColor",
1820
+ "emphasisColor",
1821
+ "emphasisPlateColor",
1822
+ "emphasisPlateTextColor",
1823
+ "emphasisPlateAltColor",
1824
+ "emphasisPlateAltTextColor",
1825
+ "annotationColor"
1826
+ ];
1827
+ function resolveCaptionColorRefs(style, brandKit) {
1828
+ const resolvedStyle = { ...style };
1829
+ for (const field of CAPTION_COLOR_FIELDS) {
1830
+ const authored = resolvedStyle[field];
1831
+ if (typeof authored !== "string") continue;
1832
+ if (authored.startsWith("\\$brand:")) {
1833
+ resolvedStyle[field] = authored.slice(1);
1834
+ continue;
1835
+ }
1836
+ if (!authored.startsWith("$brand:")) continue;
1837
+ const resolved = authored.startsWith("$brand:colors.") && brandKit ? resolveBrandRef(authored, brandKit) : null;
1838
+ if (typeof resolved !== "string" || !resolved) {
1839
+ throw renderInputError(
1840
+ "brand_kit_unresolved",
1841
+ `Caption color ${field} references ${authored}, but the bound brand kit has no matching color. Use $brand:colors.<name> or a literal color.`,
1842
+ { compositionPath: `captions.style.${field}`, brandRef: authored }
1843
+ );
1844
+ }
1845
+ resolvedStyle[field] = resolved;
1846
+ }
1847
+ return resolvedStyle;
1848
+ }
1813
1849
  function compositionFormatDimensions(format) {
1814
1850
  const fps = format.fps ?? 30;
1815
1851
  const resolution = format.resolution ?? "fhd";
@@ -1992,6 +2028,7 @@ function compositionToRenderInput(composition, srcUrls, trajectoryUrls, coViewUr
1992
2028
  ...cap?.entranceStaggerMs != null ? { entranceStaggerMs: cap.entranceStaggerMs } : {},
1993
2029
  ...cap?.exitMs != null ? { exitMs: cap.exitMs } : {}
1994
2030
  } : void 0;
2031
+ const resolvedCaptionStyle = captionStyle ? resolveCaptionColorRefs(captionStyle, brandKit) : void 0;
1995
2032
  return {
1996
2033
  clips,
1997
2034
  overlays,
@@ -2004,7 +2041,7 @@ function compositionToRenderInput(composition, srcUrls, trajectoryUrls, coViewUr
2004
2041
  ...effects.length > 0 ? { effects } : {},
2005
2042
  ...hasCaptions ? { captionSegments } : {},
2006
2043
  ...hasCaptions && composition.captions?.zPlane === "behind-subject" ? { captionsBehind: true } : {},
2007
- ...captionStyle ? { captionStyle } : {},
2044
+ ...resolvedCaptionStyle ? { captionStyle: resolvedCaptionStyle } : {},
2008
2045
  ...brandKit ? { brandKit } : {}
2009
2046
  };
2010
2047
  }
@@ -525,21 +525,25 @@ ${j.tsxSource}`,
525
525
  name: "prepare_media",
526
526
  operationId: "purchaseMediaFact",
527
527
  pathArgs: { mediaItemId: "id" },
528
- description: 'Prepare the perception artifact an authored edit needs BEFORE sighted review. Pass body.kind="subjectTrack" for face/active-speaker reframing, or body.kind="matte" for a true zPlane:"behind-subject" graphic. Pass body.intent {startSec,endSec} using SOURCE time (the media trim, not timeline time); it is required for mattes and strongly recommended for subject tracks so the prepared fact exactly matches the clip and quote. This is the supported product path \u2014 never accept a preview that silently flattens depth or ignores speaker tracking. Returns a fact receipt; poll get_media_facts with the same kind/window until exact.state is ready (failed is terminal). Existing pending/ready facts are reused without another charge.',
529
- okFormat: (j, a) => `Media preparation ${j.alreadyExisted ? "reused" : "started"}.
528
+ description: 'Prepare the perception artifact an authored edit needs BEFORE sighted review. Pass body.kind="subjectTrack" for face/active-speaker reframing, or body.kind="matte" for a true zPlane:"behind-subject" graphic. Pass body.intent {startSec,endSec} using SOURCE time (the media trim, not timeline time); it is required for mattes and strongly recommended for subject tracks so the prepared fact exactly matches the clip and quote. This is the supported product path \u2014 never accept a preview that silently flattens depth or ignores speaker tracking. Returns a fact receipt; with intent, poll get_media_facts using the same kind/window until exact.state is ready; without intent, omit all three filters and find the whole-source subjectTrack in facts until status is ready (failed is terminal). Existing pending/ready facts are reused without another charge.',
529
+ okFormat: (j, a) => {
530
+ const intent = a.body?.intent;
531
+ const poll = intent ? `Poll get_media_facts(mediaItemId="${a.mediaItemId}", kind="${a.body.kind}", startSec=${intent.startSec}, endSec=${intent.endSec}) until exact.state is ready before preview_frame or score_composition.` : `Poll get_media_facts(mediaItemId="${a.mediaItemId}") without filters; find the subjectTrack fact in facts whose source window runs from 0 to the media duration (get_media_context.durationSec) and wait until its status is ready before preview_frame or score_composition.`;
532
+ return `Media preparation ${j.alreadyExisted ? "reused" : "started"}.
530
533
 
531
534
  factId: ${j.factId}
532
535
  status: ${j.status}
533
536
  quotedUsd: ${j.quotedUsd}
534
537
 
535
- Poll get_media_facts(mediaItemId="${a.mediaItemId}", kind="${a.body?.kind}", startSec="${a.body?.intent?.startSec}", endSec="${a.body?.intent?.endSec}") until exact.state is ready before preview_frame or score_composition.`,
538
+ ${poll}`;
539
+ },
536
540
  annotations: { idempotentHint: true }
537
541
  },
538
542
  {
539
543
  name: "get_media_facts",
540
544
  operationId: "listMediaFacts",
541
545
  pathArgs: { mediaItemId: "id" },
542
- description: "Read prepared subject tracks and behind-subject mattes for one media item. For an exact readiness check, pass kind + startSec + endSec together using the same SOURCE window sent to prepare_media; exact.state is pending | ready | failed | available | unavailable. Use this after prepare_media and do not call preview_frame / score_composition until the required exact fact is ready.",
546
+ description: "Read prepared subject tracks and behind-subject mattes for one media item. For an exact readiness check, pass kind + startSec + endSec together using the same SOURCE window sent to prepare_media; exact.state is pending | ready | failed | available | unavailable. If subjectTrack was prepared without intent, omit all three filters and check the whole-source subjectTrack in facts instead. Wait for the required fact to be ready before preview_frame / score_composition.",
543
547
  annotations: { readOnlyHint: true, idempotentHint: true }
544
548
  },
545
549
  {
@@ -5,7 +5,7 @@ import {
5
5
  isOk,
6
6
  opById,
7
7
  safeParse
8
- } from "./chunk-AOIY7NGF.js";
8
+ } from "./chunk-2LUAUF46.js";
9
9
 
10
10
  // ../mcp/src/wait.ts
11
11
  var defaultSleep = (ms) => new Promise((r) => setTimeout(r, ms));
@@ -2,7 +2,7 @@ import {
2
2
  COMPOSE_PLANNER_TOOLS,
3
3
  COMPOSE_ROLE_TOOLS,
4
4
  dispatchComposeRoleTool
5
- } from "./chunk-BBNF4QLD.js";
5
+ } from "./chunk-KY3QBG7O.js";
6
6
 
7
7
  // ../authoring/src/agent/buildTools.ts
8
8
  import { tool } from "ai";
@@ -7,13 +7,13 @@ import {
7
7
  } from "./chunk-7AZLFN26.js";
8
8
  import {
9
9
  selectAllOverlays
10
- } from "./chunk-VEQTURKN.js";
10
+ } from "./chunk-NLXQ7WTH.js";
11
11
  import {
12
12
  ComposePlan
13
- } from "./chunk-AG7HKF2U.js";
13
+ } from "./chunk-LO3DH776.js";
14
14
  import {
15
15
  OverlayClipSource
16
- } from "./chunk-ID5QY7V6.js";
16
+ } from "./chunk-LZEX2GAY.js";
17
17
 
18
18
  // ../authoring/src/tools/toolSets.ts
19
19
  var COMPOSE_PLANNER_TOOLS = [
@@ -63,7 +63,7 @@ var COMPOSE_ROLE_TOOLS = Object.freeze({
63
63
  schema: z.object({}),
64
64
  metadata: { label: "Get Context" },
65
65
  handler: async (_args, capabilities) => {
66
- const { buildDirectorContext } = await import("./context-YNR73FNI.js");
66
+ const { buildDirectorContext } = await import("./context-AIUJG7R4.js");
67
67
  return buildDirectorContext(capabilities);
68
68
  }
69
69
  },
@@ -4,7 +4,7 @@ import {
4
4
  Format,
5
5
  GraphicRole,
6
6
  OpaqueId
7
- } from "./chunk-ID5QY7V6.js";
7
+ } from "./chunk-LZEX2GAY.js";
8
8
  import {
9
9
  brandKitCaptionFaceIssues
10
10
  } from "./chunk-AVTEPAWI.js";
@@ -119,6 +119,10 @@ var Region = z2.object({
119
119
  w: z2.number().positive().max(1),
120
120
  h: z2.number().positive().max(1)
121
121
  });
122
+ var CaptionRegion = Region.refine(
123
+ (r) => r.x + r.w <= 1 && r.y + r.h <= 1,
124
+ "captions style.region must fit within the normalized frame"
125
+ );
122
126
  var ClipFit = z2.enum(["cover", "contain"]);
123
127
  var PerClipEffect = z2.object({
124
128
  primitiveId: z2.string().min(1),
@@ -253,6 +257,9 @@ var CaptionStyle = z2.object({
253
257
  backgroundColor: z2.string().optional(),
254
258
  plate: z2.enum(["glass", "solid", "none"]).optional(),
255
259
  position: z2.enum(["top", "center", "bottom"]).optional(),
260
+ region: CaptionRegion.optional().describe(
261
+ "Optional caption layout box {x,y,w,h} in normalized output-frame coordinates. Overrides position; text starts at its top edge and wraps/pages within its width and height."
262
+ ),
256
263
  textTransform: z2.enum(["none", "uppercase", "capitalize"]).optional(),
257
264
  emphasisColor: z2.string().optional(),
258
265
  emphasisGradient: z2.string().optional(),
@@ -493,6 +500,7 @@ export {
493
500
  POSITION_MIN,
494
501
  POSITION_MAX,
495
502
  Region,
503
+ CaptionRegion,
496
504
  ClipFit,
497
505
  PerClipEffect,
498
506
  KeyframeEasing,
@@ -3,13 +3,13 @@ import {
3
3
  projectMediaPlaybackSpans,
4
4
  sliceTranscriptWords,
5
5
  splitIntoSentences
6
- } from "./chunk-4QMRY7KU.js";
6
+ } from "./chunk-4CNJGY7P.js";
7
7
  import {
8
8
  createHeadlessStore,
9
9
  findClipById,
10
10
  findMarkerById,
11
11
  findTrackContainingClipId
12
- } from "./chunk-VEQTURKN.js";
12
+ } from "./chunk-NLXQ7WTH.js";
13
13
  import {
14
14
  CaptionSegment,
15
15
  CaptionStyle,
@@ -20,7 +20,7 @@ import {
20
20
  TimelineClip,
21
21
  Track,
22
22
  Transition
23
- } from "./chunk-ID5QY7V6.js";
23
+ } from "./chunk-LZEX2GAY.js";
24
24
  import {
25
25
  ReframeSegment
26
26
  } from "./chunk-B7J5UUUV.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  bodySchemaFor,
3
3
  opById
4
- } from "./chunk-AOIY7NGF.js";
4
+ } from "./chunk-2LUAUF46.js";
5
5
 
6
6
  // ../mcp/src/generated/sceneContract.ts
7
7
  function deepFreeze(value) {