@cueframe/kernel 0.1.3 → 0.1.4

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 (118) hide show
  1. package/dist/_members/authoring/agent/errors.d.ts +8 -0
  2. package/dist/_members/authoring/motion/materializeMotionPresetOps.d.ts +4 -0
  3. package/dist/_members/authoring/types.d.ts +1 -1
  4. package/dist/_members/cloud-import/CloudImportService.d.ts +3 -4
  5. package/dist/_members/cloud-import/ImportProvider.d.ts +3 -7
  6. package/dist/_members/cloud-import/cloudConfig.d.ts +0 -6
  7. package/dist/_members/cloud-import/index.d.ts +2 -4
  8. package/dist/_members/composition/graphics-plan/schemas.d.ts +20 -20
  9. package/dist/_members/composition/primitive-catalog/projection.d.ts +2 -1
  10. package/dist/_members/composition/projection/behind-readiness.d.ts +4 -2
  11. package/dist/_members/composition/validators/brandKit.d.ts +54 -94
  12. package/dist/_members/composition/validators/composePlan.d.ts +52 -52
  13. package/dist/_members/composition/validators/composition.d.ts +213 -253
  14. package/dist/_members/composition/validators/font.d.ts +2 -2
  15. package/dist/_members/composition/validators/index.d.ts +1 -0
  16. package/dist/_members/composition/validators/opaqueId.d.ts +13 -0
  17. package/dist/_members/composition/validators/project.d.ts +11 -15
  18. package/dist/_members/composition/validators/render.d.ts +372 -534
  19. package/dist/_members/composition/validators/session.d.ts +19 -39
  20. package/dist/_members/composition/validators/webhook.d.ts +8 -16
  21. package/dist/_members/composition-ops/index.d.ts +192 -228
  22. package/dist/_members/director/ai-sdk/messages.d.ts +2 -2
  23. package/dist/_members/director/domain/chat.d.ts +4 -4
  24. package/dist/_members/director/testing/contract.d.ts +1 -1
  25. package/dist/_members/errors/registry.d.ts +12 -0
  26. package/dist/_members/mcp/adapter.d.ts +19 -0
  27. package/dist/_members/mcp/curation.d.ts +4 -0
  28. package/dist/_members/mcp/generated/operations.d.ts +2 -2
  29. package/dist/_members/media-model/api.d.ts +53 -109
  30. package/dist/_members/media-model/generation.d.ts +2 -2
  31. package/dist/_members/media-model/index.d.ts +1 -0
  32. package/dist/_members/media-model/opaqueId.d.ts +10 -0
  33. package/dist/_members/render-harness/localRender.d.ts +3 -0
  34. package/dist/_members/render-harness/localRender.d.ts.map +1 -1
  35. package/dist/authoring/build-tools.js +6 -6
  36. package/dist/authoring/context.js +4 -4
  37. package/dist/authoring/tools.js +5 -5
  38. package/dist/authoring.js +39 -22
  39. package/dist/chunk-2SNY75AR.js +498 -0
  40. package/dist/{chunk-ZPRBGW4Y.js → chunk-7TQCR7AB.js} +1 -1
  41. package/dist/{chunk-SDCEJAO2.js → chunk-7V3F5HO4.js} +1 -1
  42. package/dist/{chunk-BZZTVOGG.js → chunk-D2EGO543.js} +5 -5
  43. package/dist/{chunk-TO4BFNLJ.js → chunk-D6S3ZKIY.js} +1 -1
  44. package/dist/{chunk-ICSZF37W.js → chunk-JRIPQ7DN.js} +1 -1
  45. package/dist/{chunk-TFGKUWHY.js → chunk-JTVFIN6H.js} +15 -19
  46. package/dist/{chunk-DCVJWGIA.js → chunk-JY26PIRP.js} +2 -2
  47. package/dist/{chunk-DWLNPNC4.js → chunk-LSP4HN5N.js} +1 -1
  48. package/dist/{chunk-DJW3UGBH.js → chunk-PJ4R4N4Q.js} +83 -9
  49. package/dist/{chunk-TXSFYUZH.js → chunk-QSDFTYKV.js} +1 -1
  50. package/dist/{chunk-AW57IWNW.js → chunk-R5BMJ2NX.js} +20 -1
  51. package/dist/{chunk-DL7WYISQ.js → chunk-RQ2G4DXI.js} +201 -223
  52. package/dist/{chunk-NQSMEUJ6.js → chunk-RXCEPCAQ.js} +102 -41
  53. package/dist/{chunk-TMB5AY6Q.js → chunk-TLVPDT4R.js} +1 -1
  54. package/dist/{chunk-GIA2SVVB.js → chunk-WTT3GGCA.js} +9 -4
  55. package/dist/{chunk-HBVAZXYO.js → chunk-YE3F4LNJ.js} +17 -17
  56. package/dist/{chunk-KFECIHED.js → chunk-YXEZ75MB.js} +5 -5
  57. package/dist/{chunk-TPA6PYN2.js → chunk-ZBRPF6GV.js} +25 -10
  58. package/dist/cloud-import.js +20 -116
  59. package/dist/compose/renderer.js +17 -17
  60. package/dist/compose.js +18 -18
  61. package/dist/composition/graphics-plan.js +1 -1
  62. package/dist/composition/ops.js +3 -3
  63. package/dist/composition/primitive-catalog.js +1 -1
  64. package/dist/composition/projection.js +2 -2
  65. package/dist/composition/validators.js +4 -2
  66. package/dist/composition-ops.js +6 -6
  67. package/dist/composition.js +6 -4
  68. package/dist/{context-JLLU3MYD.js → context-XWNT6QZH.js} +4 -4
  69. package/dist/core/render.js +3 -3
  70. package/dist/core/select.js +2 -2
  71. package/dist/core.js +3 -3
  72. package/dist/director/ai-sdk.js +3 -3
  73. package/dist/director/domain.js +2 -2
  74. package/dist/director.js +3 -3
  75. package/dist/errors.js +1 -1
  76. package/dist/mcp/adapter.js +18 -11
  77. package/dist/mcp/core.js +1 -1
  78. package/dist/mcp/curation.js +5 -1
  79. package/dist/mcp/server.js +4 -4
  80. package/dist/mcp.js +4 -4
  81. package/dist/media-model/media-kind.js +98 -9
  82. package/dist/media-model.js +83 -77
  83. package/dist/nle-export.js +18 -18
  84. package/dist/primitives/backgrounds.js +2 -2
  85. package/dist/primitives/captions.js +3 -3
  86. package/dist/primitives/effects.js +2 -2
  87. package/dist/primitives/hero-text.js +2 -2
  88. package/dist/primitives/layouts.js +2 -2
  89. package/dist/primitives/lib/index.js +12 -12
  90. package/dist/primitives/lib.js +12 -12
  91. package/dist/primitives/scenes.js +2 -2
  92. package/dist/primitives/text.js +2 -2
  93. package/dist/primitives/ui-blocks.js +2 -2
  94. package/dist/primitives.js +19 -19
  95. package/dist/render-harness.js +4 -2
  96. package/package.json +9 -34
  97. package/dist/_members/authoring/prompts/designReviewerPrompt.d.ts +0 -2
  98. package/dist/_members/cloud-import/MediaItemPreprocessor.d.ts +0 -18
  99. package/dist/_members/cloud-import/multipartUpload.d.ts +0 -12
  100. package/dist/_members/convex-api/api.d.ts +0 -5
  101. package/dist/_members/convex-api/api.generated.d.ts +0 -1444
  102. package/dist/_members/convex-api/dataModel.d.ts +0 -6
  103. package/dist/chunk-6IU2UQI5.js +0 -107
  104. package/dist/chunk-EP2Y6M2J.js +0 -64
  105. package/dist/chunk-WZH57M53.js +0 -494
  106. package/dist/cloud-import/multipart.d.ts +0 -1
  107. package/dist/cloud-import/multipart.js +0 -8
  108. package/dist/convex-api/dataModel.d.ts +0 -1
  109. package/dist/convex-api/dataModel.js +0 -0
  110. package/dist/convex-api.d.ts +0 -1
  111. package/dist/convex-api.js +0 -8
  112. package/dist/{chunk-RP4SXXLJ.js → chunk-3PM6VICZ.js} +3 -3
  113. package/dist/{chunk-UQSOS726.js → chunk-6ABIXGLO.js} +4 -4
  114. package/dist/{chunk-SAMQUUO5.js → chunk-BIBYZJL3.js} +3 -3
  115. package/dist/{chunk-GMD33ZD7.js → chunk-O7GNE4BQ.js} +3 -3
  116. package/dist/{chunk-BKHGL4MB.js → chunk-THJAY7QS.js} +4 -4
  117. package/dist/{chunk-DYZE7JZA.js → chunk-TMIBBD5E.js} +3 -3
  118. package/dist/{chunk-G5BFI32U.js → chunk-XATRRDVG.js} +3 -3
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  buildDirectorContext
3
- } from "../chunk-DWLNPNC4.js";
4
- import "../chunk-ICSZF37W.js";
3
+ } from "../chunk-LSP4HN5N.js";
4
+ import "../chunk-JRIPQ7DN.js";
5
5
  import "../chunk-KYRDKK2D.js";
6
- import "../chunk-TFGKUWHY.js";
7
- import "../chunk-WZH57M53.js";
6
+ import "../chunk-JTVFIN6H.js";
7
+ import "../chunk-2SNY75AR.js";
8
8
  import "../chunk-WPZKOVYF.js";
9
9
  import "../chunk-2B5VJZHL.js";
10
10
  import "../chunk-WREYUH2E.js";
@@ -6,14 +6,14 @@ import {
6
6
  COMPOSE_ROLE_TOOLS,
7
7
  COMPOSE_ROLE_TOOL_NAMES,
8
8
  dispatchComposeRoleTool
9
- } from "../chunk-BZZTVOGG.js";
9
+ } from "../chunk-D2EGO543.js";
10
10
  import "../chunk-JOURGVOR.js";
11
- import "../chunk-DCVJWGIA.js";
12
- import "../chunk-ICSZF37W.js";
11
+ import "../chunk-JY26PIRP.js";
12
+ import "../chunk-JRIPQ7DN.js";
13
13
  import "../chunk-7PA7FGLD.js";
14
14
  import "../chunk-KYRDKK2D.js";
15
- import "../chunk-TFGKUWHY.js";
16
- import "../chunk-WZH57M53.js";
15
+ import "../chunk-JTVFIN6H.js";
16
+ import "../chunk-2SNY75AR.js";
17
17
  import "../chunk-WPZKOVYF.js";
18
18
  import "../chunk-2B5VJZHL.js";
19
19
  import "../chunk-WREYUH2E.js";
package/dist/authoring.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildDirectorContext
3
- } from "./chunk-DWLNPNC4.js";
3
+ } from "./chunk-LSP4HN5N.js";
4
4
  import {
5
5
  buildFastModel,
6
6
  buildModel,
@@ -27,7 +27,7 @@ import {
27
27
  buildPlannerTools,
28
28
  buildToolsFromSchemas,
29
29
  extractProviderError
30
- } from "./chunk-TPA6PYN2.js";
30
+ } from "./chunk-ZBRPF6GV.js";
31
31
  import {
32
32
  COMPOSE_MOTION_TOOLS,
33
33
  COMPOSE_MOTION_VERIFY_TOOLS,
@@ -36,27 +36,27 @@ import {
36
36
  COMPOSE_ROLE_TOOLS,
37
37
  COMPOSE_ROLE_TOOL_NAMES,
38
38
  dispatchComposeRoleTool
39
- } from "./chunk-BZZTVOGG.js";
39
+ } from "./chunk-D2EGO543.js";
40
40
  import {
41
41
  AgentFixableCaptureError,
42
42
  getExcludedTools
43
43
  } from "./chunk-JOURGVOR.js";
44
- import "./chunk-DCVJWGIA.js";
45
- import "./chunk-ICSZF37W.js";
44
+ import "./chunk-JY26PIRP.js";
45
+ import "./chunk-JRIPQ7DN.js";
46
46
  import "./chunk-7PA7FGLD.js";
47
47
  import "./chunk-KYRDKK2D.js";
48
- import "./chunk-GIA2SVVB.js";
48
+ import "./chunk-WTT3GGCA.js";
49
49
  import {
50
50
  cssLayoutVars
51
51
  } from "./chunk-YQ7FFW3G.js";
52
52
  import "./chunk-DSMLHYJ4.js";
53
53
  import "./chunk-JF4JJAFP.js";
54
- import "./chunk-TFGKUWHY.js";
55
- import "./chunk-WZH57M53.js";
54
+ import "./chunk-JTVFIN6H.js";
55
+ import "./chunk-2SNY75AR.js";
56
56
  import "./chunk-WPZKOVYF.js";
57
57
  import "./chunk-2B5VJZHL.js";
58
58
  import "./chunk-WREYUH2E.js";
59
- import "./chunk-AW57IWNW.js";
59
+ import "./chunk-R5BMJ2NX.js";
60
60
  import "./chunk-2ESYSVXG.js";
61
61
 
62
62
  // ../authoring/src/agent.ts
@@ -1135,20 +1135,38 @@ var isMotionPresetOp = (op) => !!op && typeof op === "object" && op.type === "ap
1135
1135
  var hasMotionPresetOp = (ops) => ops.some(isMotionPresetOp);
1136
1136
  async function materializeMotionPresetOpsCore(composition, ops, opts, deps) {
1137
1137
  const out = [];
1138
+ let current = composition;
1138
1139
  for (let i = 0; i < ops.length; i++) {
1139
1140
  const op = ops[i];
1140
1141
  if (!isMotionPresetOp(op)) {
1141
1142
  out.push(op);
1143
+ if (deps.apply) current = deps.apply(current, op);
1142
1144
  continue;
1143
1145
  }
1144
1146
  let card;
1145
1147
  try {
1146
- card = resolveMotionPresetCard(composition, { clipId: op.clipId, preset: op.preset });
1148
+ card = resolveMotionPresetCard(current, { clipId: op.clipId, preset: op.preset });
1147
1149
  } catch (err) {
1148
1150
  if (err instanceof MotionPresetError) err.opIndex = i;
1149
1151
  throw err;
1150
1152
  }
1151
- if (opts.dryRun) continue;
1153
+ const componentId = `motion-shell-${op.clipId}`;
1154
+ const projectedUpdate = {
1155
+ type: "clip.update",
1156
+ clipId: op.clipId,
1157
+ patch: {
1158
+ source: {
1159
+ kind: "component",
1160
+ componentId,
1161
+ props: {},
1162
+ ...card.zPlane !== void 0 ? { zPlane: card.zPlane } : {}
1163
+ }
1164
+ }
1165
+ };
1166
+ if (opts.dryRun) {
1167
+ if (deps.apply) current = deps.apply(current, projectedUpdate);
1168
+ continue;
1169
+ }
1152
1170
  const tsxSource = generateMotionShell(card.cardHtml, {
1153
1171
  preset: op.preset,
1154
1172
  ...op.params?.enterMs !== void 0 ? { enterMs: op.params.enterMs } : {},
@@ -1156,18 +1174,17 @@ async function materializeMotionPresetOpsCore(composition, ops, opts, deps) {
1156
1174
  ...op.params?.staggerMs !== void 0 ? { staggerMs: op.params.staggerMs } : {},
1157
1175
  ...card.tokens !== void 0 ? { tokens: card.tokens } : {}
1158
1176
  });
1159
- const componentId = `motion-shell-${op.clipId}`;
1160
1177
  const { jsSource } = await deps.transpile(componentId, tsxSource);
1161
- out.push(
1162
- await deps.sink({
1163
- componentId,
1164
- clipId: op.clipId,
1165
- preset: op.preset,
1166
- tsxSource,
1167
- jsSource,
1168
- ...card.zPlane !== void 0 ? { zPlane: card.zPlane } : {}
1169
- })
1170
- );
1178
+ const materialized = await deps.sink({
1179
+ componentId,
1180
+ clipId: op.clipId,
1181
+ preset: op.preset,
1182
+ tsxSource,
1183
+ jsSource,
1184
+ ...card.zPlane !== void 0 ? { zPlane: card.zPlane } : {}
1185
+ });
1186
+ out.push(materialized);
1187
+ if (deps.apply) current = deps.apply(current, materialized);
1171
1188
  }
1172
1189
  return out;
1173
1190
  }
@@ -0,0 +1,498 @@
1
+ import {
2
+ Reframe
3
+ } from "./chunk-2B5VJZHL.js";
4
+
5
+ // ../composition/src/validators/opaqueId.ts
6
+ import { z } from "zod";
7
+ var OpaqueId = z.string();
8
+
9
+ // ../composition/src/validators/composition.ts
10
+ import { z as z2 } from "zod";
11
+ var Format = z2.object({
12
+ aspectRatio: z2.enum(["16:9", "9:16", "1:1", "4:5"]),
13
+ fps: z2.union([z2.literal(24), z2.literal(25), z2.literal(30), z2.literal(60)]).optional(),
14
+ resolution: z2.enum(["hd", "fhd", "4k"]).optional(),
15
+ platform: z2.string().optional()
16
+ });
17
+ var Trim = z2.object({
18
+ start: z2.number().nonnegative(),
19
+ end: z2.number().nonnegative()
20
+ });
21
+ var ExcludedRange = z2.object({
22
+ start: z2.number().nonnegative(),
23
+ end: z2.number().nonnegative(),
24
+ reason: z2.string().optional()
25
+ });
26
+ var MediaClipSource = z2.object({
27
+ kind: z2.literal("media"),
28
+ mediaId: OpaqueId,
29
+ trim: Trim.optional(),
30
+ excludedRanges: z2.array(ExcludedRange).optional(),
31
+ volume: z2.number().min(0).max(4).optional(),
32
+ muted: z2.boolean().optional(),
33
+ playbackRate: z2.number().positive().optional(),
34
+ sync: z2.enum(["video", "independent"]).optional(),
35
+ kenBurns: z2.enum(["in", "out", "pan-l", "pan-r", "none"]).optional(),
36
+ volumeDb: z2.number().optional(),
37
+ fadeInMs: z2.number().nonnegative().optional(),
38
+ fadeOutMs: z2.number().nonnegative().optional(),
39
+ loop: z2.boolean().optional(),
40
+ audioRole: z2.enum(["sfx", "music", "vo", "ambience"]).optional(),
41
+ duck: z2.object({
42
+ duckDb: z2.number().max(0),
43
+ attackMs: z2.number().nonnegative(),
44
+ releaseMs: z2.number().nonnegative(),
45
+ windows: z2.array(z2.object({ startMs: z2.number(), endMs: z2.number() })).optional()
46
+ }).optional(),
47
+ anchor: z2.object({
48
+ clipId: z2.string().min(1),
49
+ offsetMs: z2.number()
50
+ }).optional(),
51
+ reframe: Reframe.optional()
52
+ });
53
+ var ComponentClipSource = z2.object({
54
+ kind: z2.literal("component"),
55
+ componentId: z2.string().min(1),
56
+ props: z2.record(z2.string(), z2.unknown()),
57
+ zPlane: z2.enum(["front", "behind-subject"]).optional()
58
+ });
59
+ var OverlayClipSource = z2.object({
60
+ kind: z2.literal("overlay"),
61
+ primitiveId: z2.string().min(1),
62
+ params: z2.record(z2.string(), z2.unknown()),
63
+ zPlane: z2.enum(["front", "behind-subject"]).optional(),
64
+ anchor: z2.object({ space: z2.literal("scene"), x: z2.number().min(0).max(1), y: z2.number().min(0).max(1) }).optional(),
65
+ parallax: z2.number().min(-0.3).max(0.3).optional()
66
+ });
67
+ var EffectClipSource = z2.object({
68
+ kind: z2.literal("effect"),
69
+ primitiveId: z2.string().min(1),
70
+ params: z2.record(z2.string(), z2.unknown()).optional()
71
+ });
72
+ var AlphaLayerClipSource = z2.object({
73
+ kind: z2.literal("alpha-layer"),
74
+ componentId: z2.string().min(1),
75
+ props: z2.record(z2.string(), z2.unknown()),
76
+ zPlane: z2.enum(["front", "behind-subject"]).optional()
77
+ });
78
+ var CardClipSource = z2.object({
79
+ kind: z2.literal("card"),
80
+ html: z2.string().min(1),
81
+ tokens: z2.record(z2.string(), z2.string()).optional(),
82
+ zPlane: z2.literal("front").optional()
83
+ });
84
+ var CompositionClipSource = z2.object({
85
+ kind: z2.literal("composition"),
86
+ compositionId: z2.string().min(1),
87
+ trim: Trim.optional()
88
+ }).strict();
89
+ var ClipSource = z2.discriminatedUnion("kind", [
90
+ MediaClipSource,
91
+ ComponentClipSource,
92
+ OverlayClipSource,
93
+ EffectClipSource,
94
+ AlphaLayerClipSource,
95
+ CardClipSource,
96
+ CompositionClipSource
97
+ ]);
98
+ var Transition = z2.object({
99
+ type: z2.string().min(1),
100
+ duration: z2.number().positive()
101
+ });
102
+ var Position = z2.object({
103
+ x: z2.number(),
104
+ y: z2.number()
105
+ });
106
+ var Region = z2.object({
107
+ x: z2.number().min(0).max(1),
108
+ y: z2.number().min(0).max(1),
109
+ w: z2.number().positive().max(1),
110
+ h: z2.number().positive().max(1)
111
+ });
112
+ var ClipFit = z2.enum(["cover", "contain"]);
113
+ var PerClipEffect = z2.object({
114
+ primitiveId: z2.string().min(1),
115
+ params: z2.record(z2.string(), z2.unknown()).optional()
116
+ });
117
+ var KeyframeEasing = z2.union([
118
+ z2.enum(["linear", "ease", "easeIn", "easeOut", "easeInOut"]),
119
+ z2.object({ cubicBezier: z2.tuple([z2.number(), z2.number(), z2.number(), z2.number()]) }).strict()
120
+ ]);
121
+ var Keyframe = z2.object({
122
+ time: z2.number().nonnegative(),
123
+ value: z2.number(),
124
+ easing: KeyframeEasing.optional()
125
+ }).strict();
126
+ var KeyframeChannel = z2.array(Keyframe).min(2);
127
+ var ANIMATABLE_PARAMS = [
128
+ "opacity",
129
+ "scale",
130
+ "rotation",
131
+ "position.x",
132
+ "position.y",
133
+ "volume"
134
+ ];
135
+ var TimelineClip = z2.object({
136
+ id: z2.string().min(1),
137
+ startTime: z2.number().nonnegative(),
138
+ duration: z2.number().positive(),
139
+ source: ClipSource,
140
+ kind: z2.enum(["video", "audio", "image", "overlay", "effect"]).optional(),
141
+ opacity: z2.number().min(0).max(1).optional(),
142
+ scale: z2.number().positive().optional(),
143
+ rotation: z2.number().optional(),
144
+ position: Position.optional(),
145
+ region: Region.optional(),
146
+ fit: ClipFit.optional(),
147
+ effects: z2.array(PerClipEffect).optional(),
148
+ transitionIn: Transition.optional(),
149
+ linkGroupId: z2.string().min(1).optional(),
150
+ animate: z2.record(z2.string(), KeyframeChannel).superRefine((channels, ctx) => {
151
+ for (const key of Object.keys(channels)) {
152
+ if (!ANIMATABLE_PARAMS.includes(key)) {
153
+ ctx.addIssue({
154
+ code: z2.ZodIssueCode.custom,
155
+ path: [key],
156
+ message: `"${key}" is not an animatable param (${ANIMATABLE_PARAMS.join(", ")})`
157
+ });
158
+ }
159
+ }
160
+ }).optional()
161
+ }).strict();
162
+ var Gap = z2.object({
163
+ id: z2.string().min(1),
164
+ startTime: z2.number().nonnegative(),
165
+ duration: z2.number().positive()
166
+ }).strict();
167
+ var TrackContent = z2.unknown().transform((val, ctx) => {
168
+ const hasSource = !!val && typeof val === "object" && "source" in val;
169
+ const res = (hasSource ? TimelineClip : Gap).safeParse(val);
170
+ if (!res.success) {
171
+ for (const issue of res.error.issues) ctx.addIssue(issue);
172
+ return z2.NEVER;
173
+ }
174
+ return res.data;
175
+ });
176
+ var Track = z2.object({
177
+ id: z2.string().min(1),
178
+ kind: z2.enum(["video", "audio", "image", "overlay", "effect"]),
179
+ name: z2.string().optional(),
180
+ enabled: z2.boolean().optional(),
181
+ volume: z2.number().min(0).max(4).optional(),
182
+ contents: z2.array(TrackContent)
183
+ }).strict();
184
+ var Marker = z2.object({
185
+ id: z2.string().min(1),
186
+ startTime: z2.number().nonnegative(),
187
+ endTime: z2.number().nonnegative().optional(),
188
+ kind: z2.string().min(1),
189
+ name: z2.string().optional(),
190
+ metadata: z2.record(z2.string(), z2.unknown()).optional()
191
+ }).strict();
192
+ var AccessControl = z2.object({
193
+ public: z2.boolean().optional(),
194
+ readerOrgIds: z2.array(z2.string()).optional(),
195
+ writerOrgIds: z2.array(z2.string()).optional()
196
+ });
197
+ var LicenseDeclaration = z2.object({
198
+ type: z2.string().min(1),
199
+ source: z2.string().optional(),
200
+ notes: z2.string().optional()
201
+ });
202
+ var CompositionAccessibility = z2.object({
203
+ audioDescriptionTrackId: z2.string().optional(),
204
+ captionsTrackId: z2.string().optional(),
205
+ signLanguageTrackId: z2.string().optional(),
206
+ notes: z2.string().optional()
207
+ });
208
+ var CaptionWord = z2.object({
209
+ text: z2.string().min(1),
210
+ startMs: z2.number().nonnegative().describe("Word start on the composition timeline, in milliseconds."),
211
+ endMs: z2.number().nonnegative().describe("Word end on the composition timeline, in milliseconds."),
212
+ emphasis: z2.boolean().optional(),
213
+ annotate: z2.enum(["circle", "underline"]).optional()
214
+ });
215
+ var CaptionStyle = z2.object({
216
+ fontFamily: z2.string().min(1).optional(),
217
+ fontSize: z2.number().min(1, "captions style.fontSize is PERCENT of composition height (1-15, default 5) \u2014 px values are not accepted").max(15, "captions style.fontSize is PERCENT of composition height (1-15, default 5) \u2014 px values are not accepted").optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),
218
+ fontWeight: z2.number().int().min(100).max(900).optional(),
219
+ color: z2.string().min(1).optional(),
220
+ highlightColor: z2.string().min(1).optional(),
221
+ backgroundColor: z2.string().optional(),
222
+ plate: z2.enum(["glass", "solid", "none"]).optional(),
223
+ position: z2.enum(["top", "center", "bottom"]).optional(),
224
+ textTransform: z2.enum(["none", "uppercase", "capitalize"]).optional(),
225
+ emphasisColor: z2.string().optional(),
226
+ emphasisGradient: z2.string().optional(),
227
+ emphasisScale: z2.number().positive().optional(),
228
+ emphasisFontFamily: z2.string().optional(),
229
+ emphasisFontWeight: z2.number().int().min(100).max(900).optional(),
230
+ emphasisTextTransform: z2.enum(["none", "uppercase", "capitalize"]).optional(),
231
+ emphasisLetterSpacing: z2.number().optional(),
232
+ emphasisFontStyle: z2.enum(["normal", "italic"]).optional(),
233
+ entrance: z2.enum(["none", "fade", "word-pop", "stagger-up"]).optional(),
234
+ entranceMs: z2.number().nonnegative().optional(),
235
+ entranceStaggerMs: z2.number().nonnegative().optional(),
236
+ exitMs: z2.number().nonnegative().optional(),
237
+ emphasisPlate: z2.boolean().optional(),
238
+ emphasisPlateColor: z2.string().optional(),
239
+ emphasisPlateTextColor: z2.string().optional(),
240
+ emphasisPlateAltColor: z2.string().optional(),
241
+ emphasisPlateAltTextColor: z2.string().optional(),
242
+ emphasisPlateRadius: z2.number().nonnegative().optional(),
243
+ emphasisPlatePadX: z2.number().optional(),
244
+ emphasisPlatePadY: z2.number().optional(),
245
+ annotationColor: z2.string().optional(),
246
+ maxWidthPercent: z2.number().positive().max(100, "captions style.maxWidthPercent is % of composition width (max 100)").optional()
247
+ });
248
+ var CaptionSegment = z2.object({
249
+ words: z2.array(CaptionWord)
250
+ });
251
+ var CaptionDepth = z2.enum(["front", "behind-subject"]).optional();
252
+ var CompositionCaptions = z2.discriminatedUnion("source", [
253
+ z2.object({
254
+ source: z2.literal("derived"),
255
+ from: z2.object({ clipId: z2.string() }),
256
+ segments: z2.array(CaptionSegment),
257
+ style: CaptionStyle.optional(),
258
+ zPlane: CaptionDepth
259
+ }),
260
+ z2.object({
261
+ source: z2.literal("authored"),
262
+ segments: z2.array(CaptionSegment),
263
+ style: CaptionStyle.optional(),
264
+ zPlane: CaptionDepth
265
+ })
266
+ ]);
267
+ function captionsAreBehindSubject(captions) {
268
+ return captions?.zPlane === "behind-subject";
269
+ }
270
+ function captionWords(c) {
271
+ return c.segments.flatMap((s) => s.words);
272
+ }
273
+ var Composition = z2.object({
274
+ v: z2.literal(1, {
275
+ errorMap: (_issue, ctx) => ctx.data === void 0 ? { message: 'Missing version envelope: add top-level "v": 1 to the composition.' } : { message: `Invalid version envelope: top-level "v" must be the literal 1 (got ${JSON.stringify(ctx.data)}).` }
276
+ }),
277
+ format: Format,
278
+ tracks: z2.array(Track),
279
+ markers: z2.array(Marker).optional(),
280
+ captions: CompositionCaptions.optional(),
281
+ sourceSuggestionId: z2.string().optional(),
282
+ license: LicenseDeclaration.optional(),
283
+ licenseVerification: z2.enum([
284
+ "attested",
285
+ "cueframe-verified",
286
+ "third-party-verified"
287
+ ]).optional(),
288
+ accessibility: CompositionAccessibility.optional(),
289
+ ownerOrgId: z2.string().optional(),
290
+ acl: AccessControl.optional()
291
+ }).strict();
292
+ var CompositionAuthorKind = z2.enum(["user", "agent", "import"]);
293
+ var CompositionVersion = z2.object({
294
+ id: z2.string().min(1),
295
+ compositionId: OpaqueId,
296
+ predecessorId: z2.string().optional(),
297
+ createdAt: z2.number(),
298
+ // epoch ms — see CONVEX_ADAPTATIONS.md
299
+ etag: z2.string().min(1),
300
+ authorKind: CompositionAuthorKind,
301
+ // load-bearing for multi-agent lineage
302
+ authorId: z2.string().optional(),
303
+ // userId for 'user', agentId for 'agent', source for 'import'
304
+ composition: Composition
305
+ });
306
+
307
+ // ../composition/src/graphics-plan/schemas.ts
308
+ import { z as z3 } from "zod";
309
+ var GRAPHICS_PLAN_VERSION = "gp-1";
310
+ var Version = z3.literal(GRAPHICS_PLAN_VERSION);
311
+ var PlanRect = Region;
312
+ var GraphicRole = z3.enum([
313
+ "title-card",
314
+ // topic-setter / opener card
315
+ "stat",
316
+ // a single headline number + label
317
+ "lower-third",
318
+ // name/title tag over the speaker
319
+ "pull-quote",
320
+ // a short quoted line
321
+ "hero",
322
+ // big behind-subject phrase (zPlane: behind-subject)
323
+ "logo-tag",
324
+ // small brand mark / watermark beat
325
+ "enumeration",
326
+ "sequence",
327
+ // an ordered chain of steps — often the POINT is that it is too long
328
+ "comparison"
329
+ // labelled values set against each other (a benchmark, a before/after)
330
+ ]);
331
+ var Copy = z3.object({
332
+ headline: z3.string().max(120).optional(),
333
+ sub: z3.string().max(200).optional(),
334
+ value: z3.string().max(40).optional(),
335
+ label: z3.string().max(80).optional(),
336
+ items: z3.array(z3.string().max(80)).max(8).optional(),
337
+ series: z3.array(z3.object({ label: z3.string().max(40), value: z3.string().max(16) })).max(8).optional()
338
+ }).strict();
339
+ var ContentBeat = z3.object({
340
+ id: z3.string().min(1),
341
+ atSec: z3.number().min(0),
342
+ durSec: z3.number().positive(),
343
+ role: GraphicRole,
344
+ copy: Copy,
345
+ intent: z3.string().min(1).max(400),
346
+ priority: z3.number().int().min(0).max(10).default(5)
347
+ }).strict();
348
+ var ContentPlan = z3.object({
349
+ version: Version,
350
+ beats: z3.array(ContentBeat)
351
+ }).strict();
352
+ var ElementRole = z3.enum([
353
+ "headline",
354
+ // primary large text
355
+ "value",
356
+ // the stat number / the one word to remember
357
+ "label",
358
+ // supporting text
359
+ "sublabel",
360
+ // secondary supporting text
361
+ "logo",
362
+ // brand mark
363
+ "accent-shape",
364
+ // decorative block/line/underline
365
+ "backdrop"
366
+ // solid fill (takeover cards only)
367
+ ]);
368
+ var StyleRole = z3.enum([
369
+ "heading",
370
+ "body",
371
+ "accent",
372
+ "surface",
373
+ "on-accent",
374
+ "on-surface"
375
+ ]);
376
+ var ZPlane = z3.enum(["front", "behind-subject"]);
377
+ var LayoutElement = z3.object({
378
+ elId: z3.string().min(1),
379
+ role: ElementRole,
380
+ box: PlanRect,
381
+ styleRole: StyleRole,
382
+ z: ZPlane.default("front"),
383
+ text: z3.string().max(200).optional(),
384
+ typeScaleStep: z3.number().int().min(0).max(8).optional()
385
+ }).strict();
386
+ var EPS = 1e-6;
387
+ var rectsOverlapEps = (a, b) => a.x < b.x + b.w - EPS && a.x + a.w > b.x + EPS && a.y < b.y + b.h - EPS && a.y + a.h > b.y + EPS;
388
+ var LayoutPlan = z3.object({
389
+ version: Version,
390
+ beatId: z3.string().min(1),
391
+ frame: z3.object({ w: z3.number().positive(), h: z3.number().positive() }).strict(),
392
+ keepOut: z3.array(PlanRect),
393
+ safe: z3.object({
394
+ titleSafe: z3.number().min(0).max(1),
395
+ actionSafe: z3.number().min(0).max(1)
396
+ }).strict(),
397
+ elements: z3.array(LayoutElement),
398
+ dropped: z3.object({ reason: z3.string().min(1) }).strict().optional()
399
+ }).strict().superRefine((plan, ctx) => {
400
+ for (const el of plan.elements) {
401
+ if (el.z === "behind-subject") continue;
402
+ const b = el.box;
403
+ if (b.x + b.w > 1 + EPS || b.y + b.h > 1 + EPS) {
404
+ ctx.addIssue({ code: z3.ZodIssueCode.custom, message: `element ${el.elId} box spills past the frame`, path: ["elements"] });
405
+ }
406
+ for (const ko of plan.keepOut) {
407
+ if (rectsOverlapEps(b, ko)) {
408
+ ctx.addIssue({ code: z3.ZodIssueCode.custom, message: `element ${el.elId} overlaps a face keep-out (text on the speaker)`, path: ["elements"] });
409
+ }
410
+ }
411
+ }
412
+ });
413
+ var EnterType = z3.enum(["reveal", "fade", "rise", "count-up", "wipe"]);
414
+ var EmphasisType = z3.enum(["pulse", "underline", "color-shift"]);
415
+ var ExitType = z3.enum(["fade", "fall", "wipe", "cut"]);
416
+ var Ease = z3.enum(["spring", "ease-out", "ease-in-out", "linear"]);
417
+ var EnterMotion = z3.object({
418
+ type: EnterType,
419
+ atMs: z3.number().min(0),
420
+ durMs: z3.number().positive(),
421
+ ease: Ease.default("spring"),
422
+ stagger: z3.number().min(0).optional()
423
+ }).strict();
424
+ var EmphasisMotion = z3.object({ type: EmphasisType, atMs: z3.number().min(0), durMs: z3.number().positive() }).strict();
425
+ var ExitMotion = z3.object({ type: ExitType, atMs: z3.number().min(0), durMs: z3.number().positive() }).strict();
426
+ var MotionElement = z3.object({
427
+ elId: z3.string().min(1),
428
+ enter: EnterMotion,
429
+ emphasis: EmphasisMotion.optional(),
430
+ exit: ExitMotion.optional()
431
+ }).strict();
432
+ var MotionPlan = z3.object({
433
+ version: Version,
434
+ beatId: z3.string().min(1),
435
+ elements: z3.array(MotionElement)
436
+ }).strict();
437
+ var GraphicsPlan = z3.object({
438
+ version: Version,
439
+ content: ContentPlan,
440
+ layouts: z3.array(LayoutPlan),
441
+ motions: z3.array(MotionPlan)
442
+ }).strict();
443
+
444
+ export {
445
+ OpaqueId,
446
+ Format,
447
+ MediaClipSource,
448
+ ComponentClipSource,
449
+ OverlayClipSource,
450
+ EffectClipSource,
451
+ AlphaLayerClipSource,
452
+ CardClipSource,
453
+ CompositionClipSource,
454
+ ClipSource,
455
+ Transition,
456
+ Region,
457
+ ClipFit,
458
+ PerClipEffect,
459
+ KeyframeEasing,
460
+ Keyframe,
461
+ KeyframeChannel,
462
+ ANIMATABLE_PARAMS,
463
+ TimelineClip,
464
+ Gap,
465
+ TrackContent,
466
+ Track,
467
+ Marker,
468
+ CaptionWord,
469
+ CaptionStyle,
470
+ CaptionSegment,
471
+ CompositionCaptions,
472
+ captionsAreBehindSubject,
473
+ captionWords,
474
+ Composition,
475
+ CompositionAuthorKind,
476
+ CompositionVersion,
477
+ GRAPHICS_PLAN_VERSION,
478
+ PlanRect,
479
+ GraphicRole,
480
+ Copy,
481
+ ContentBeat,
482
+ ContentPlan,
483
+ ElementRole,
484
+ StyleRole,
485
+ ZPlane,
486
+ LayoutElement,
487
+ LayoutPlan,
488
+ EnterType,
489
+ EmphasisType,
490
+ ExitType,
491
+ Ease,
492
+ EnterMotion,
493
+ EmphasisMotion,
494
+ ExitMotion,
495
+ MotionElement,
496
+ MotionPlan,
497
+ GraphicsPlan
498
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CueframeError,
3
3
  encodeError
4
- } from "./chunk-AW57IWNW.js";
4
+ } from "./chunk-R5BMJ2NX.js";
5
5
 
6
6
  // ../execution/core/src/render/vcam/constants.ts
7
7
  var P_MIN = 0.5;
@@ -5,7 +5,7 @@ import {
5
5
  isOk,
6
6
  opById,
7
7
  safeParse
8
- } from "./chunk-DL7WYISQ.js";
8
+ } from "./chunk-RQ2G4DXI.js";
9
9
 
10
10
  // ../mcp/src/wait.ts
11
11
  var defaultSleep = (ms) => new Promise((r) => setTimeout(r, ms));