@cueframe/kernel 0.1.2 → 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 (126) hide show
  1. package/dist/_members/authoring/agent/errors.d.ts +8 -0
  2. package/dist/_members/authoring/index.d.ts +1 -1
  3. package/dist/_members/authoring/motion/materializeMotionPresetOps.d.ts +4 -0
  4. package/dist/_members/authoring/prompts/index.d.ts +0 -1
  5. package/dist/_members/authoring/types.d.ts +1 -1
  6. package/dist/_members/cloud-import/CloudImportService.d.ts +3 -4
  7. package/dist/_members/cloud-import/ImportProvider.d.ts +3 -7
  8. package/dist/_members/cloud-import/cloudConfig.d.ts +0 -6
  9. package/dist/_members/cloud-import/index.d.ts +2 -4
  10. package/dist/_members/composition/graphics-plan/schemas.d.ts +20 -20
  11. package/dist/_members/composition/primitive-catalog/projection.d.ts +2 -1
  12. package/dist/_members/composition/projection/behind-readiness.d.ts +4 -2
  13. package/dist/_members/composition/validators/brandKit.d.ts +54 -94
  14. package/dist/_members/composition/validators/composePlan.d.ts +52 -52
  15. package/dist/_members/composition/validators/composition.d.ts +213 -253
  16. package/dist/_members/composition/validators/font.d.ts +2 -2
  17. package/dist/_members/composition/validators/index.d.ts +1 -0
  18. package/dist/_members/composition/validators/opaqueId.d.ts +13 -0
  19. package/dist/_members/composition/validators/project.d.ts +11 -15
  20. package/dist/_members/composition/validators/render.d.ts +372 -534
  21. package/dist/_members/composition/validators/session.d.ts +19 -39
  22. package/dist/_members/composition/validators/webhook.d.ts +8 -16
  23. package/dist/_members/composition-ops/index.d.ts +192 -228
  24. package/dist/_members/director/ai-sdk/messages.d.ts +2 -2
  25. package/dist/_members/director/domain/chat.d.ts +4 -4
  26. package/dist/_members/director/testing/contract.d.ts +1 -1
  27. package/dist/_members/errors/registry.d.ts +115 -1
  28. package/dist/_members/mcp/adapter.d.ts +19 -0
  29. package/dist/_members/mcp/core.d.ts +1 -1
  30. package/dist/_members/mcp/curation.d.ts +4 -0
  31. package/dist/_members/mcp/generated/harness.d.ts +1 -1
  32. package/dist/_members/mcp/generated/operations.d.ts +12 -0
  33. package/dist/_members/mcp/wait.d.ts +1 -1
  34. package/dist/_members/media-model/api.d.ts +53 -109
  35. package/dist/_members/media-model/generation.d.ts +2 -2
  36. package/dist/_members/media-model/index.d.ts +1 -0
  37. package/dist/_members/media-model/opaqueId.d.ts +10 -0
  38. package/dist/_members/render-harness/localRender.d.ts +3 -0
  39. package/dist/_members/render-harness/localRender.d.ts.map +1 -1
  40. package/dist/_members/render-harness/remotion-runtime.d.ts +53 -0
  41. package/dist/authoring/build-tools.js +6 -6
  42. package/dist/authoring/context.js +4 -4
  43. package/dist/authoring/prompts.js +1 -5
  44. package/dist/authoring/tools.js +5 -5
  45. package/dist/authoring.js +40 -27
  46. package/dist/chunk-2SNY75AR.js +498 -0
  47. package/dist/{chunk-XQ72DZKJ.js → chunk-7TQCR7AB.js} +1 -1
  48. package/dist/{chunk-QETYXKQQ.js → chunk-7V3F5HO4.js} +97 -14
  49. package/dist/{chunk-BZZTVOGG.js → chunk-D2EGO543.js} +5 -5
  50. package/dist/{chunk-ZPLJ24OV.js → chunk-D6S3ZKIY.js} +1 -1
  51. package/dist/{chunk-K2IUBCND.js → chunk-HFC3MKXA.js} +0 -51
  52. package/dist/{chunk-ICSZF37W.js → chunk-JRIPQ7DN.js} +1 -1
  53. package/dist/{chunk-TFGKUWHY.js → chunk-JTVFIN6H.js} +15 -19
  54. package/dist/{chunk-DCVJWGIA.js → chunk-JY26PIRP.js} +2 -2
  55. package/dist/{chunk-DWLNPNC4.js → chunk-LSP4HN5N.js} +1 -1
  56. package/dist/{chunk-AO744WIK.js → chunk-PJ4R4N4Q.js} +123 -38
  57. package/dist/{chunk-VFMW3JUY.js → chunk-QSDFTYKV.js} +1 -1
  58. package/dist/{chunk-LLUW26BS.js → chunk-R5BMJ2NX.js} +38 -2
  59. package/dist/{chunk-W3SIWT7J.js → chunk-RQ2G4DXI.js} +406 -174
  60. package/dist/{chunk-VHF66LCQ.js → chunk-RXCEPCAQ.js} +102 -41
  61. package/dist/{chunk-LJ5W4ZBU.js → chunk-TLVPDT4R.js} +1 -1
  62. package/dist/{chunk-PIURX6IZ.js → chunk-WTT3GGCA.js} +9 -4
  63. package/dist/{chunk-CAJQ7H5A.js → chunk-YE3F4LNJ.js} +17 -17
  64. package/dist/{chunk-TD347SSX.js → chunk-YXEZ75MB.js} +31 -20
  65. package/dist/{chunk-TPA6PYN2.js → chunk-ZBRPF6GV.js} +25 -10
  66. package/dist/cloud-import.js +20 -116
  67. package/dist/compose/renderer.js +17 -17
  68. package/dist/compose.js +18 -18
  69. package/dist/composition/graphics-plan.js +1 -1
  70. package/dist/composition/ops.js +3 -3
  71. package/dist/composition/primitive-catalog.js +1 -1
  72. package/dist/composition/projection.js +2 -2
  73. package/dist/composition/validators.js +4 -2
  74. package/dist/composition-ops.js +6 -6
  75. package/dist/composition.js +6 -4
  76. package/dist/{context-JLLU3MYD.js → context-XWNT6QZH.js} +4 -4
  77. package/dist/core/render.js +3 -3
  78. package/dist/core/select.js +2 -2
  79. package/dist/core.js +3 -3
  80. package/dist/director/ai-sdk.js +3 -3
  81. package/dist/director/domain.js +2 -2
  82. package/dist/director.js +3 -3
  83. package/dist/errors.js +1 -1
  84. package/dist/mcp/adapter.js +59 -22
  85. package/dist/mcp/core.js +1 -1
  86. package/dist/mcp/curation.js +5 -1
  87. package/dist/mcp/server.js +4 -4
  88. package/dist/mcp.js +4 -4
  89. package/dist/media-model/media-kind.js +98 -9
  90. package/dist/media-model/testing.js +6 -6
  91. package/dist/media-model.js +83 -77
  92. package/dist/nle-export.js +18 -18
  93. package/dist/primitives/backgrounds.js +2 -2
  94. package/dist/primitives/captions.js +3 -3
  95. package/dist/primitives/effects.js +2 -2
  96. package/dist/primitives/hero-text.js +2 -2
  97. package/dist/primitives/layouts.js +2 -2
  98. package/dist/primitives/lib/index.js +12 -12
  99. package/dist/primitives/lib.js +12 -12
  100. package/dist/primitives/scenes.js +2 -2
  101. package/dist/primitives/text.js +2 -2
  102. package/dist/primitives/ui-blocks.js +2 -2
  103. package/dist/primitives.js +19 -19
  104. package/dist/render-harness.js +4 -2
  105. package/package.json +13 -37
  106. package/dist/_members/authoring/prompts/designReviewerPrompt.d.ts +0 -2
  107. package/dist/_members/cloud-import/MediaItemPreprocessor.d.ts +0 -18
  108. package/dist/_members/cloud-import/multipartUpload.d.ts +0 -12
  109. package/dist/_members/convex-api/api.d.ts +0 -2
  110. package/dist/_members/convex-api/dataModel.d.ts +0 -4
  111. package/dist/chunk-6IU2UQI5.js +0 -107
  112. package/dist/chunk-EP2Y6M2J.js +0 -64
  113. package/dist/chunk-WZH57M53.js +0 -494
  114. package/dist/cloud-import/multipart.d.ts +0 -1
  115. package/dist/cloud-import/multipart.js +0 -8
  116. package/dist/convex-api/dataModel.d.ts +0 -1
  117. package/dist/convex-api/dataModel.js +0 -0
  118. package/dist/convex-api.d.ts +0 -1
  119. package/dist/convex-api.js +0 -8
  120. package/dist/{chunk-RP4SXXLJ.js → chunk-3PM6VICZ.js} +3 -3
  121. package/dist/{chunk-UQSOS726.js → chunk-6ABIXGLO.js} +4 -4
  122. package/dist/{chunk-SAMQUUO5.js → chunk-BIBYZJL3.js} +3 -3
  123. package/dist/{chunk-GMD33ZD7.js → chunk-O7GNE4BQ.js} +3 -3
  124. package/dist/{chunk-BKHGL4MB.js → chunk-THJAY7QS.js} +4 -4
  125. package/dist/{chunk-DYZE7JZA.js → chunk-TMIBBD5E.js} +3 -3
  126. package/dist/{chunk-G5BFI32U.js → chunk-XATRRDVG.js} +3 -3
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,
@@ -13,8 +13,6 @@ import {
13
13
  CODE_GEN_FEW_SHOT_EXAMPLES,
14
14
  COMPONENT_CONTRACT,
15
15
  DESIGN_QUALITY_RULES,
16
- DESIGN_REVIEWER_PROMPT,
17
- DESIGN_REVIEWER_TOOLS,
18
16
  EVALUATOR_PROMPT,
19
17
  PLANNING_INSTRUCTIONS,
20
18
  TOOLKIT_REFERENCE,
@@ -22,14 +20,14 @@ import {
22
20
  buildPlannerUserMessage,
23
21
  formatPlanSteps,
24
22
  initCodeGenPrompts
25
- } from "./chunk-K2IUBCND.js";
23
+ } from "./chunk-HFC3MKXA.js";
26
24
  import {
27
25
  ZERO_USAGE,
28
26
  buildDirectorTools,
29
27
  buildPlannerTools,
30
28
  buildToolsFromSchemas,
31
29
  extractProviderError
32
- } from "./chunk-TPA6PYN2.js";
30
+ } from "./chunk-ZBRPF6GV.js";
33
31
  import {
34
32
  COMPOSE_MOTION_TOOLS,
35
33
  COMPOSE_MOTION_VERIFY_TOOLS,
@@ -38,27 +36,27 @@ import {
38
36
  COMPOSE_ROLE_TOOLS,
39
37
  COMPOSE_ROLE_TOOL_NAMES,
40
38
  dispatchComposeRoleTool
41
- } from "./chunk-BZZTVOGG.js";
39
+ } from "./chunk-D2EGO543.js";
42
40
  import {
43
41
  AgentFixableCaptureError,
44
42
  getExcludedTools
45
43
  } from "./chunk-JOURGVOR.js";
46
- import "./chunk-DCVJWGIA.js";
47
- import "./chunk-ICSZF37W.js";
44
+ import "./chunk-JY26PIRP.js";
45
+ import "./chunk-JRIPQ7DN.js";
48
46
  import "./chunk-7PA7FGLD.js";
49
47
  import "./chunk-KYRDKK2D.js";
50
- import "./chunk-PIURX6IZ.js";
48
+ import "./chunk-WTT3GGCA.js";
51
49
  import {
52
50
  cssLayoutVars
53
51
  } from "./chunk-YQ7FFW3G.js";
54
52
  import "./chunk-DSMLHYJ4.js";
55
53
  import "./chunk-JF4JJAFP.js";
56
- import "./chunk-TFGKUWHY.js";
57
- import "./chunk-WZH57M53.js";
54
+ import "./chunk-JTVFIN6H.js";
55
+ import "./chunk-2SNY75AR.js";
58
56
  import "./chunk-WPZKOVYF.js";
59
57
  import "./chunk-2B5VJZHL.js";
60
58
  import "./chunk-WREYUH2E.js";
61
- import "./chunk-LLUW26BS.js";
59
+ import "./chunk-R5BMJ2NX.js";
62
60
  import "./chunk-2ESYSVXG.js";
63
61
 
64
62
  // ../authoring/src/agent.ts
@@ -1137,20 +1135,38 @@ var isMotionPresetOp = (op) => !!op && typeof op === "object" && op.type === "ap
1137
1135
  var hasMotionPresetOp = (ops) => ops.some(isMotionPresetOp);
1138
1136
  async function materializeMotionPresetOpsCore(composition, ops, opts, deps) {
1139
1137
  const out = [];
1138
+ let current = composition;
1140
1139
  for (let i = 0; i < ops.length; i++) {
1141
1140
  const op = ops[i];
1142
1141
  if (!isMotionPresetOp(op)) {
1143
1142
  out.push(op);
1143
+ if (deps.apply) current = deps.apply(current, op);
1144
1144
  continue;
1145
1145
  }
1146
1146
  let card;
1147
1147
  try {
1148
- card = resolveMotionPresetCard(composition, { clipId: op.clipId, preset: op.preset });
1148
+ card = resolveMotionPresetCard(current, { clipId: op.clipId, preset: op.preset });
1149
1149
  } catch (err) {
1150
1150
  if (err instanceof MotionPresetError) err.opIndex = i;
1151
1151
  throw err;
1152
1152
  }
1153
- 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
+ }
1154
1170
  const tsxSource = generateMotionShell(card.cardHtml, {
1155
1171
  preset: op.preset,
1156
1172
  ...op.params?.enterMs !== void 0 ? { enterMs: op.params.enterMs } : {},
@@ -1158,18 +1174,17 @@ async function materializeMotionPresetOpsCore(composition, ops, opts, deps) {
1158
1174
  ...op.params?.staggerMs !== void 0 ? { staggerMs: op.params.staggerMs } : {},
1159
1175
  ...card.tokens !== void 0 ? { tokens: card.tokens } : {}
1160
1176
  });
1161
- const componentId = `motion-shell-${op.clipId}`;
1162
1177
  const { jsSource } = await deps.transpile(componentId, tsxSource);
1163
- out.push(
1164
- await deps.sink({
1165
- componentId,
1166
- clipId: op.clipId,
1167
- preset: op.preset,
1168
- tsxSource,
1169
- jsSource,
1170
- ...card.zPlane !== void 0 ? { zPlane: card.zPlane } : {}
1171
- })
1172
- );
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);
1173
1188
  }
1174
1189
  return out;
1175
1190
  }
@@ -1186,8 +1201,6 @@ export {
1186
1201
  COMPOSE_ROLE_TOOLS,
1187
1202
  COMPOSE_ROLE_TOOL_NAMES,
1188
1203
  DESIGN_QUALITY_RULES,
1189
- DESIGN_REVIEWER_PROMPT,
1190
- DESIGN_REVIEWER_TOOLS,
1191
1204
  EVALUATOR_PROMPT,
1192
1205
  MOTION_PRESETS,
1193
1206
  MotionPresetError,
@@ -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-LLUW26BS.js";
4
+ } from "./chunk-R5BMJ2NX.js";
5
5
 
6
6
  // ../execution/core/src/render/vcam/constants.ts
7
7
  var P_MIN = 0.5;