@cueframe/kernel 0.0.1 → 0.1.1

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 (432) hide show
  1. package/LICENSE +661 -0
  2. package/dist/_members/account-model/testing/conversationStoreContract.d.ts +1 -1
  3. package/dist/_members/authoring/providers/resourceApi.d.ts +1 -1
  4. package/dist/_members/authoring/transpileComponent.d.ts +1 -1
  5. package/dist/_members/cloud-import/CloudImportService.d.ts +35 -0
  6. package/dist/_members/cloud-import/ImportProvider.d.ts +73 -0
  7. package/dist/_members/cloud-import/MediaItemPreprocessor.d.ts +27 -0
  8. package/dist/_members/cloud-import/cloudConfig.d.ts +23 -0
  9. package/dist/_members/cloud-import/index.d.ts +9 -0
  10. package/dist/_members/cloud-import/multipartUpload.d.ts +12 -0
  11. package/dist/_members/composition/ops/compositionOps.d.ts +2 -1
  12. package/dist/_members/composition/ops/types.d.ts +1 -1
  13. package/dist/_members/composition/projection/behind-readiness.d.ts +127 -0
  14. package/dist/_members/composition/projection/index.d.ts +2 -0
  15. package/dist/_members/composition/projection/reframe-readiness.d.ts +156 -0
  16. package/dist/_members/composition/timeline/placement.d.ts +1 -1
  17. package/dist/_members/composition/validators/composition.d.ts +43 -26
  18. package/dist/_members/composition/validators/render.d.ts +32 -0
  19. package/dist/_members/composition-ops/index.d.ts +1 -1
  20. package/dist/_members/composition-ops/opRecorder.d.ts +1 -1
  21. package/dist/_members/convex-api/api.d.ts +5 -0
  22. package/dist/_members/convex-api/dataModel.d.ts +6 -0
  23. package/dist/_members/core/render/compositionRender.d.ts +17 -1
  24. package/dist/_members/core/render/exportSettings.d.ts +1 -1
  25. package/dist/_members/core/render/types.d.ts +31 -0
  26. package/dist/_members/mcp/curation.d.ts +1 -1
  27. package/dist/_members/plane/conformance.d.ts +1 -1
  28. package/dist/_members/render-harness/localRender.d.ts +1 -1
  29. package/dist/animate.js +828 -79187
  30. package/dist/authoring/build-tools.js +8 -11
  31. package/dist/authoring/context.js +5 -5
  32. package/dist/authoring/models.js +1 -2
  33. package/dist/authoring/prompts.js +1 -1
  34. package/dist/authoring/tools.js +7 -7
  35. package/dist/authoring/transpileComponent.js +3 -2220
  36. package/dist/authoring.js +30 -30
  37. package/dist/brand-derivation.js +1 -1
  38. package/dist/chunk-6IU2UQI5.js +107 -0
  39. package/dist/{chunk-5I7VDCAC.js → chunk-7FO3ZJ43.js} +4 -1
  40. package/dist/{chunk-N67PDTKQ.js → chunk-ABL557OT.js} +1 -1
  41. package/dist/{chunk-MC5DLSEV.js → chunk-AP6ZIVAV.js} +15 -15
  42. package/dist/{chunk-QLAQHR3L.js → chunk-AQBREB5O.js} +1 -1
  43. package/dist/{chunk-DSNG6WLU.js → chunk-AYVJXDLB.js} +1 -4
  44. package/dist/{chunk-6CMVBTTP.js → chunk-DK2ODBNT.js} +19 -9
  45. package/dist/chunk-DSMLHYJ4.js +82 -0
  46. package/dist/{chunk-BRKJKB33.js → chunk-FYZVH3MC.js} +1 -1
  47. package/dist/{chunk-MVEE6HEC.js → chunk-GA23TRNR.js} +5 -7
  48. package/dist/chunk-HCCBDJLW.js +68 -0
  49. package/dist/{chunk-JRQVPFLF.js → chunk-HY3RIEZW.js} +1 -1
  50. package/dist/{chunk-OIRUO5P7.js → chunk-JJ6XD7NG.js} +152 -2
  51. package/dist/{_members/primitives/chunk-IDAL6G3Y.js → chunk-JQMPHKLU.js} +19 -27
  52. package/dist/{chunk-G3PBH53P.js → chunk-MBCXCJOE.js} +1 -1
  53. package/dist/{chunk-UEI3NLNK.js → chunk-MHOQTPOB.js} +1 -4
  54. package/dist/{chunk-37NJ27UU.js → chunk-OCFDUCF4.js} +3 -0
  55. package/dist/{chunk-WZTTZHNR.js → chunk-OLFOPQCA.js} +12 -9
  56. package/dist/{chunk-P43IE4WB.js → chunk-P727GZVO.js} +2 -4
  57. package/dist/{chunk-52AHXNKM.js → chunk-PDYO3DOJ.js} +5 -5
  58. package/dist/{chunk-S3P5BFFL.js → chunk-PMY24FUD.js} +2 -4
  59. package/dist/{chunk-ATAF24QG.js → chunk-PODIYN2K.js} +10 -3
  60. package/dist/chunk-RF7U3SCL.js +606 -0
  61. package/dist/{chunk-JD77Y2WM.js → chunk-SW336CJP.js} +1 -4
  62. package/dist/{chunk-TULRCY6U.js → chunk-TOJEXFXL.js} +1 -1
  63. package/dist/{chunk-ELLSET2N.js → chunk-UHGSZZDI.js} +3 -6
  64. package/dist/{chunk-M3I5LMAB.js → chunk-UY4SWJVE.js} +1 -1
  65. package/dist/{chunk-6QJ3V3VS.js → chunk-YX2GSJK7.js} +1 -1
  66. package/dist/chunk-ZT7MHRQU.js +104 -0
  67. package/dist/{chunk-NV4I6GJV.js → chunk-ZWMV6DD2.js} +27 -4
  68. package/dist/cloud-import/multipart.d.ts +1 -0
  69. package/dist/cloud-import/multipart.js +8 -0
  70. package/dist/cloud-import.d.ts +1 -0
  71. package/dist/cloud-import.js +234 -0
  72. package/dist/compose/renderer.js +19 -22
  73. package/dist/compose.js +19 -22
  74. package/dist/composition/graphics-plan.js +3 -3
  75. package/dist/composition/ops.js +4 -4
  76. package/dist/composition/primitive-catalog.js +1 -1
  77. package/dist/composition/projection.js +21 -5
  78. package/dist/composition/validators.js +6 -4
  79. package/dist/composition-ops.js +15 -13
  80. package/dist/composition.js +26 -8
  81. package/dist/{context-CEAKQ5T7.js → context-YWUZDG5X.js} +5 -5
  82. package/dist/convex-api/dataModel.d.ts +1 -0
  83. package/dist/convex-api/dataModel.js +0 -0
  84. package/dist/convex-api.d.ts +1 -0
  85. package/dist/convex-api.js +8 -0
  86. package/dist/core/render.js +3 -3
  87. package/dist/core/select.js +2 -2
  88. package/dist/core.js +3 -3
  89. package/dist/errors.js +1 -1
  90. package/dist/mcp/adapter.js +2 -5
  91. package/dist/mcp/server.js +1 -2
  92. package/dist/mcp.js +2 -95
  93. package/dist/media-model/media-kind.js +9 -98
  94. package/dist/media-model/testing.js +1071 -718
  95. package/dist/nle-export/server.js +328 -130
  96. package/dist/nle-export/xml.js +5 -22799
  97. package/dist/nle-export.js +20 -22
  98. package/dist/primitives/backgrounds.js +2 -3
  99. package/dist/primitives/captions.js +4 -243
  100. package/dist/primitives/effects.js +2 -3
  101. package/dist/primitives/hero-text.js +2 -3
  102. package/dist/primitives/layouts.js +2 -3
  103. package/dist/primitives/lib/index.js +8 -10
  104. package/dist/primitives/lib/preview.js +1 -2
  105. package/dist/primitives/lib/schema.js +1 -2
  106. package/dist/primitives/lib/text/fitText.js +1 -2
  107. package/dist/primitives/lib.js +8 -10
  108. package/dist/primitives/scenes.js +1 -2
  109. package/dist/primitives/text.js +2 -3
  110. package/dist/primitives/ui-blocks.js +4 -5
  111. package/dist/primitives.js +19 -21
  112. package/package.json +125 -16
  113. package/dist/TextureLoader-UQOFUSAP.js +0 -422
  114. package/dist/VideoTexture-AQWSPIJG.js +0 -62
  115. package/dist/_members/account-model/index.js +0 -4
  116. package/dist/_members/account-model/testing/conversationStoreContract.js +0 -168
  117. package/dist/_members/account-model/testing/index.js +0 -7
  118. package/dist/_members/account-model/testing/restorePointStoreContract.js +0 -69
  119. package/dist/_members/account-model/types/index.js +0 -1
  120. package/dist/_members/account-model/validators/contextFile.js +0 -18
  121. package/dist/_members/account-model/validators/conversation.js +0 -95
  122. package/dist/_members/account-model/validators/dashboardInsight.js +0 -16
  123. package/dist/_members/account-model/validators/index.js +0 -7
  124. package/dist/_members/account-model/validators/sessionToken.js +0 -49
  125. package/dist/_members/account-model/validators/uploadToken.js +0 -16
  126. package/dist/_members/account-model/validators/userSettings.js +0 -12
  127. package/dist/_members/account-model/validators/workingComposition.js +0 -20
  128. package/dist/_members/brand-derivation/constants.js +0 -20
  129. package/dist/_members/brand-derivation/contrastSafe.js +0 -114
  130. package/dist/_members/brand-derivation/index.js +0 -1
  131. package/dist/_members/composition/audio/audioMix.js +0 -61
  132. package/dist/_members/composition/audio/index.js +0 -5
  133. package/dist/_members/composition/audio/mixStaging.js +0 -195
  134. package/dist/_members/composition/audio/musicPack.generated.js +0 -136
  135. package/dist/_members/composition/audio/musicPack.js +0 -36
  136. package/dist/_members/composition/audio/pack.generated.js +0 -603
  137. package/dist/_members/composition/audio/pack.js +0 -48
  138. package/dist/_members/composition/audio/palette.js +0 -134
  139. package/dist/_members/composition/autozoom/index.js +0 -83
  140. package/dist/_members/composition/brand-kit.js +0 -45
  141. package/dist/_members/composition/brief/contract.js +0 -209
  142. package/dist/_members/composition/color-grade.js +0 -80
  143. package/dist/_members/composition/depth.js +0 -8
  144. package/dist/_members/composition/fixtures/index.js +0 -143
  145. package/dist/_members/composition/fixtures/vaayaErrored.d.ts +0 -25
  146. package/dist/_members/composition/fixtures/vaayaErrored.js +0 -203
  147. package/dist/_members/composition/fonts.js +0 -162
  148. package/dist/_members/composition/graphics-plan/compile.js +0 -221
  149. package/dist/_members/composition/graphics-plan/index.js +0 -10
  150. package/dist/_members/composition/graphics-plan/instantiateMotif.js +0 -44
  151. package/dist/_members/composition/graphics-plan/motion.js +0 -66
  152. package/dist/_members/composition/graphics-plan/schemas.js +0 -261
  153. package/dist/_members/composition/graphics-plan/solve.js +0 -145
  154. package/dist/_members/composition/index.js +0 -5
  155. package/dist/_members/composition/invariants/clipPlacement.js +0 -69
  156. package/dist/_members/composition/invariants/composition.js +0 -28
  157. package/dist/_members/composition/invariants/errors.js +0 -10
  158. package/dist/_members/composition/invariants/etag.js +0 -38
  159. package/dist/_members/composition/invariants/ids.js +0 -33
  160. package/dist/_members/composition/invariants/index.js +0 -9
  161. package/dist/_members/composition/invariants/keyframes.js +0 -45
  162. package/dist/_members/composition/invariants/markers.js +0 -29
  163. package/dist/_members/composition/invariants/time.js +0 -20
  164. package/dist/_members/composition/invariants/tracks.js +0 -304
  165. package/dist/_members/composition/ops/compositionOps.js +0 -1056
  166. package/dist/_members/composition/ops/headlessStore.js +0 -94
  167. package/dist/_members/composition/ops/index.js +0 -4
  168. package/dist/_members/composition/ops/selectors.js +0 -118
  169. package/dist/_members/composition/ops/timeline-word.js +0 -1
  170. package/dist/_members/composition/ops/transcript.js +0 -77
  171. package/dist/_members/composition/ops/types.js +0 -16
  172. package/dist/_members/composition/primitive-catalog/catalogQuery.js +0 -150
  173. package/dist/_members/composition/primitive-catalog/disabled.js +0 -32
  174. package/dist/_members/composition/primitive-catalog/generated/meta.js +0 -15161
  175. package/dist/_members/composition/primitive-catalog/index.js +0 -46
  176. package/dist/_members/composition/primitive-catalog/paramValidation.js +0 -231
  177. package/dist/_members/composition/primitive-catalog/projection.js +0 -164
  178. package/dist/_members/composition/primitive-catalog/types.js +0 -14
  179. package/dist/_members/composition/projection/behind-placement.js +0 -62
  180. package/dist/_members/composition/projection/brandKit.js +0 -482
  181. package/dist/_members/composition/projection/cardTokens.js +0 -209
  182. package/dist/_members/composition/projection/composition-floor.js +0 -582
  183. package/dist/_members/composition/projection/cropProjection.js +0 -257
  184. package/dist/_members/composition/projection/index.js +0 -7
  185. package/dist/_members/composition/projection/occlusion-budget.js +0 -104
  186. package/dist/_members/composition/projection/safe-zones.js +0 -99
  187. package/dist/_members/composition/reframe/aspectLoss.js +0 -115
  188. package/dist/_members/composition/reframe/coverage.js +0 -62
  189. package/dist/_members/composition/reframe/derive.js +0 -73
  190. package/dist/_members/composition/reframe/index.js +0 -109
  191. package/dist/_members/composition/reframe/kenBurns.js +0 -64
  192. package/dist/_members/composition/reframe/shotScale.js +0 -176
  193. package/dist/_members/composition/reframe/trajectory.js +0 -124
  194. package/dist/_members/composition/timeline/compound.js +0 -134
  195. package/dist/_members/composition/timeline/index.js +0 -9
  196. package/dist/_members/composition/timeline/intent.js +0 -228
  197. package/dist/_members/composition/timeline/keyframes.js +0 -121
  198. package/dist/_members/composition/timeline/link.js +0 -59
  199. package/dist/_members/composition/timeline/occupancy.js +0 -36
  200. package/dist/_members/composition/timeline/placement.js +0 -74
  201. package/dist/_members/composition/timeline/plan.js +0 -31
  202. package/dist/_members/composition/timeline/resolve.js +0 -170
  203. package/dist/_members/composition/timeline/trims.js +0 -278
  204. package/dist/_members/composition/types/index.js +0 -1
  205. package/dist/_members/composition/validators/brandKit.js +0 -295
  206. package/dist/_members/composition/validators/composePlan.js +0 -113
  207. package/dist/_members/composition/validators/composition.js +0 -703
  208. package/dist/_members/composition/validators/font.js +0 -34
  209. package/dist/_members/composition/validators/graphicKinds.js +0 -30
  210. package/dist/_members/composition/validators/index.js +0 -9
  211. package/dist/_members/composition/validators/project.js +0 -29
  212. package/dist/_members/composition/validators/registry.js +0 -41
  213. package/dist/_members/composition/validators/render.js +0 -139
  214. package/dist/_members/composition/validators/session.js +0 -37
  215. package/dist/_members/composition/validators/webhook.js +0 -72
  216. package/dist/_members/composition-ops/alphaLayers.js +0 -141
  217. package/dist/_members/composition-ops/index.js +0 -637
  218. package/dist/_members/composition-ops/materializeGrid.js +0 -99
  219. package/dist/_members/composition-ops/opRecorder.js +0 -196
  220. package/dist/_members/composition-ops/recordingStore.js +0 -14
  221. package/dist/_members/composition-ops/replaceRegion.js +0 -102
  222. package/dist/_members/composition-ops/testFixtures.js +0 -19
  223. package/dist/_members/core/index.js +0 -5
  224. package/dist/_members/core/render/bookends.js +0 -53
  225. package/dist/_members/core/render/captions.js +0 -127
  226. package/dist/_members/core/render/compositionRender.js +0 -1249
  227. package/dist/_members/core/render/deriveTrajectory.js +0 -889
  228. package/dist/_members/core/render/emphasis.js +0 -16
  229. package/dist/_members/core/render/eval/cropBox.js +0 -139
  230. package/dist/_members/core/render/eval/inclusion.js +0 -96
  231. package/dist/_members/core/render/eval/index.js +0 -146
  232. package/dist/_members/core/render/eval/metrics.js +0 -94
  233. package/dist/_members/core/render/exportSettings.js +0 -65
  234. package/dist/_members/core/render/index.js +0 -20
  235. package/dist/_members/core/render/mapFaceToPerson.js +0 -73
  236. package/dist/_members/core/render/types.js +0 -8
  237. package/dist/_members/core/render/vcam/cameraPath.js +0 -248
  238. package/dist/_members/core/render/vcam/constants.js +0 -115
  239. package/dist/_members/core/render/vcam/errorCodes.js +0 -39
  240. package/dist/_members/core/render/vcam/framing.js +0 -136
  241. package/dist/_members/core/render/vcam/requiredRegion.js +0 -137
  242. package/dist/_members/core/render/vcam/shots.js +0 -53
  243. package/dist/_members/core/render/vcam/subjectSet.js +0 -388
  244. package/dist/_members/core/select/errorCodes.js +0 -38
  245. package/dist/_members/core/select/index.js +0 -26
  246. package/dist/_members/core/select/model.js +0 -18
  247. package/dist/_members/core/select/select.js +0 -244
  248. package/dist/_members/core/select/stabilize.js +0 -242
  249. package/dist/_members/core/types.js +0 -7
  250. package/dist/_members/errors/index.js +0 -1
  251. package/dist/_members/errors/registry.js +0 -560
  252. package/dist/_members/foundation/codes/index.js +0 -31
  253. package/dist/_members/foundation/index.js +0 -2
  254. package/dist/_members/foundation/primitives/index.js +0 -5
  255. package/dist/_members/mcp/adapter.js +0 -771
  256. package/dist/_members/mcp/burnedNames.js +0 -73
  257. package/dist/_members/mcp/core.js +0 -390
  258. package/dist/_members/mcp/curation.js +0 -792
  259. package/dist/_members/mcp/executor.js +0 -142
  260. package/dist/_members/mcp/format.js +0 -9
  261. package/dist/_members/mcp/generated/catalogPreviews.js +0 -95
  262. package/dist/_members/mcp/generated/harness.js +0 -81
  263. package/dist/_members/mcp/generated/operations.js +0 -131
  264. package/dist/_members/mcp/index.js +0 -50
  265. package/dist/_members/mcp/internalLoopTools.js +0 -109
  266. package/dist/_members/mcp/prompts.js +0 -45
  267. package/dist/_members/mcp/resources.js +0 -166
  268. package/dist/_members/mcp/server.js +0 -340
  269. package/dist/_members/mcp/wait.js +0 -378
  270. package/dist/_members/mcp/x402Meta.js +0 -66
  271. package/dist/_members/media-model/api.js +0 -175
  272. package/dist/_members/media-model/index.js +0 -1
  273. package/dist/_members/media-model/media-kind.js +0 -116
  274. package/dist/_members/media-model/testing/index.js +0 -1
  275. package/dist/_members/media-model/testing/mediaStoreContract.js +0 -82
  276. package/dist/_members/media-model/transcriptSearch.js +0 -70
  277. package/dist/_members/media-model/transcriptSearchCases.json +0 -79
  278. package/dist/_members/nle-export/compact-timeline.js +0 -73
  279. package/dist/_members/nle-export/compact-timeline.js.map +0 -1
  280. package/dist/_members/nle-export/composition-to-input.js +0 -147
  281. package/dist/_members/nle-export/composition-to-input.js.map +0 -1
  282. package/dist/_members/nle-export/fcpxml.js +0 -159
  283. package/dist/_members/nle-export/fcpxml.js.map +0 -1
  284. package/dist/_members/nle-export/index.js +0 -12
  285. package/dist/_members/nle-export/index.js.map +0 -1
  286. package/dist/_members/nle-export/premiere.js +0 -161
  287. package/dist/_members/nle-export/premiere.js.map +0 -1
  288. package/dist/_members/nle-export/server/index.js +0 -2
  289. package/dist/_members/nle-export/server/index.js.map +0 -1
  290. package/dist/_members/nle-export/server/pack-zip.js +0 -38
  291. package/dist/_members/nle-export/server/pack-zip.js.map +0 -1
  292. package/dist/_members/nle-export/srt.js +0 -50
  293. package/dist/_members/nle-export/srt.js.map +0 -1
  294. package/dist/_members/nle-export/types.js +0 -9
  295. package/dist/_members/nle-export/types.js.map +0 -1
  296. package/dist/_members/nle-export/xml/index.js +0 -11
  297. package/dist/_members/nle-export/xml/index.js.map +0 -1
  298. package/dist/_members/nle-export/xml-utils.js +0 -48
  299. package/dist/_members/nle-export/xml-utils.js.map +0 -1
  300. package/dist/_members/perception/activeSpeaker.js +0 -103
  301. package/dist/_members/perception/audioQuality.js +0 -76
  302. package/dist/_members/perception/energyBeat.js +0 -99
  303. package/dist/_members/perception/identityMatch.js +0 -91
  304. package/dist/_members/perception/index.js +0 -48
  305. package/dist/_members/perception/visualQuality.js +0 -95
  306. package/dist/_members/plane/conformance.js +0 -90
  307. package/dist/_members/plane/contract.js +0 -49
  308. package/dist/_members/plane/index.js +0 -16
  309. package/dist/_members/primitives/backgrounds/index.js +0 -32
  310. package/dist/_members/primitives/backgrounds/index.js.map +0 -1
  311. package/dist/_members/primitives/captions/index.js +0 -398
  312. package/dist/_members/primitives/captions/index.js.map +0 -1
  313. package/dist/_members/primitives/chunk-2LVE4UIT.js +0 -139
  314. package/dist/_members/primitives/chunk-2LVE4UIT.js.map +0 -1
  315. package/dist/_members/primitives/chunk-3IQUH6KK.js +0 -20
  316. package/dist/_members/primitives/chunk-3IQUH6KK.js.map +0 -1
  317. package/dist/_members/primitives/chunk-3OMURV6Q.js +0 -112
  318. package/dist/_members/primitives/chunk-3OMURV6Q.js.map +0 -1
  319. package/dist/_members/primitives/chunk-4IS6TMEG.js +0 -21
  320. package/dist/_members/primitives/chunk-4IS6TMEG.js.map +0 -1
  321. package/dist/_members/primitives/chunk-5MWGAEGQ.js +0 -1644
  322. package/dist/_members/primitives/chunk-5MWGAEGQ.js.map +0 -1
  323. package/dist/_members/primitives/chunk-7RRPFPQK.js +0 -15
  324. package/dist/_members/primitives/chunk-7RRPFPQK.js.map +0 -1
  325. package/dist/_members/primitives/chunk-DH5TRZK2.js +0 -125
  326. package/dist/_members/primitives/chunk-DH5TRZK2.js.map +0 -1
  327. package/dist/_members/primitives/chunk-E3KNUSFG.js +0 -2337
  328. package/dist/_members/primitives/chunk-E3KNUSFG.js.map +0 -1
  329. package/dist/_members/primitives/chunk-G2B3G4HK.js +0 -47
  330. package/dist/_members/primitives/chunk-G2B3G4HK.js.map +0 -1
  331. package/dist/_members/primitives/chunk-HFPFGZXT.js +0 -1494
  332. package/dist/_members/primitives/chunk-HFPFGZXT.js.map +0 -1
  333. package/dist/_members/primitives/chunk-HIWVFZVH.js +0 -19
  334. package/dist/_members/primitives/chunk-HIWVFZVH.js.map +0 -1
  335. package/dist/_members/primitives/chunk-IDAL6G3Y.js.map +0 -1
  336. package/dist/_members/primitives/chunk-KNC6JP5F.js +0 -34
  337. package/dist/_members/primitives/chunk-KNC6JP5F.js.map +0 -1
  338. package/dist/_members/primitives/chunk-KYRDVZST.js +0 -459
  339. package/dist/_members/primitives/chunk-KYRDVZST.js.map +0 -1
  340. package/dist/_members/primitives/chunk-LWLHS2NS.js +0 -3410
  341. package/dist/_members/primitives/chunk-LWLHS2NS.js.map +0 -1
  342. package/dist/_members/primitives/chunk-QAQ3P7DR.js +0 -8855
  343. package/dist/_members/primitives/chunk-QAQ3P7DR.js.map +0 -1
  344. package/dist/_members/primitives/chunk-ROV2ODWC.js +0 -81
  345. package/dist/_members/primitives/chunk-ROV2ODWC.js.map +0 -1
  346. package/dist/_members/primitives/chunk-TCRC2FH3.js +0 -183
  347. package/dist/_members/primitives/chunk-TCRC2FH3.js.map +0 -1
  348. package/dist/_members/primitives/chunk-US4YEDAA.js +0 -96
  349. package/dist/_members/primitives/chunk-US4YEDAA.js.map +0 -1
  350. package/dist/_members/primitives/chunk-UVKRO5ER.js +0 -13
  351. package/dist/_members/primitives/chunk-UVKRO5ER.js.map +0 -1
  352. package/dist/_members/primitives/chunk-W4EIIF2I.js +0 -10
  353. package/dist/_members/primitives/chunk-W4EIIF2I.js.map +0 -1
  354. package/dist/_members/primitives/chunk-WPGKIPCO.js +0 -3563
  355. package/dist/_members/primitives/chunk-WPGKIPCO.js.map +0 -1
  356. package/dist/_members/primitives/chunk-WZFLEGMD.js +0 -1435
  357. package/dist/_members/primitives/chunk-WZFLEGMD.js.map +0 -1
  358. package/dist/_members/primitives/chunk-XHU3WBEI.js +0 -33
  359. package/dist/_members/primitives/chunk-XHU3WBEI.js.map +0 -1
  360. package/dist/_members/primitives/chunk-YN7WTZZ7.js +0 -46
  361. package/dist/_members/primitives/chunk-YN7WTZZ7.js.map +0 -1
  362. package/dist/_members/primitives/effects/index.js +0 -30
  363. package/dist/_members/primitives/effects/index.js.map +0 -1
  364. package/dist/_members/primitives/hero-text/index.js +0 -14
  365. package/dist/_members/primitives/hero-text/index.js.map +0 -1
  366. package/dist/_members/primitives/index.js +0 -64
  367. package/dist/_members/primitives/index.js.map +0 -1
  368. package/dist/_members/primitives/layouts/index.js +0 -24
  369. package/dist/_members/primitives/layouts/index.js.map +0 -1
  370. package/dist/_members/primitives/lib/easings.js +0 -26
  371. package/dist/_members/primitives/lib/easings.js.map +0 -1
  372. package/dist/_members/primitives/lib/index.js +0 -74
  373. package/dist/_members/primitives/lib/index.js.map +0 -1
  374. package/dist/_members/primitives/lib/palette.js +0 -72
  375. package/dist/_members/primitives/lib/palette.js.map +0 -1
  376. package/dist/_members/primitives/lib/preview.js +0 -8
  377. package/dist/_members/primitives/lib/preview.js.map +0 -1
  378. package/dist/_members/primitives/lib/schema.js +0 -12
  379. package/dist/_members/primitives/lib/schema.js.map +0 -1
  380. package/dist/_members/primitives/lib/seeded-random.js +0 -14
  381. package/dist/_members/primitives/lib/seeded-random.js.map +0 -1
  382. package/dist/_members/primitives/lib/text/contrast.js +0 -12
  383. package/dist/_members/primitives/lib/text/contrast.js.map +0 -1
  384. package/dist/_members/primitives/lib/text/fill.js +0 -8
  385. package/dist/_members/primitives/lib/text/fill.js.map +0 -1
  386. package/dist/_members/primitives/lib/text/fitText.js +0 -10
  387. package/dist/_members/primitives/lib/text/fitText.js.map +0 -1
  388. package/dist/_members/primitives/lib/text/marker.js +0 -8
  389. package/dist/_members/primitives/lib/text/marker.js.map +0 -1
  390. package/dist/_members/primitives/lib/text/motion.js +0 -16
  391. package/dist/_members/primitives/lib/text/motion.js.map +0 -1
  392. package/dist/_members/primitives/lib/text/recolor.js +0 -8
  393. package/dist/_members/primitives/lib/text/recolor.js.map +0 -1
  394. package/dist/_members/primitives/lib/text/spec.js +0 -1
  395. package/dist/_members/primitives/lib/text/spec.js.map +0 -1
  396. package/dist/_members/primitives/lib/text/stage.js +0 -8
  397. package/dist/_members/primitives/lib/text/stage.js.map +0 -1
  398. package/dist/_members/primitives/lib/text/typeface.js +0 -8
  399. package/dist/_members/primitives/lib/text/typeface.js.map +0 -1
  400. package/dist/_members/primitives/lib/tokens.js +0 -24
  401. package/dist/_members/primitives/lib/tokens.js.map +0 -1
  402. package/dist/_members/primitives/lib/types.js +0 -1
  403. package/dist/_members/primitives/lib/types.js.map +0 -1
  404. package/dist/_members/primitives/params-required.json +0 -153
  405. package/dist/_members/primitives/scenes/index.js +0 -25
  406. package/dist/_members/primitives/scenes/index.js.map +0 -1
  407. package/dist/_members/primitives/subject-foreground/index.js +0 -30
  408. package/dist/_members/primitives/subject-foreground/index.js.map +0 -1
  409. package/dist/_members/primitives/text/index.js +0 -57
  410. package/dist/_members/primitives/text/index.js.map +0 -1
  411. package/dist/_members/primitives/transitions/index.js +0 -67
  412. package/dist/_members/primitives/transitions/index.js.map +0 -1
  413. package/dist/_members/primitives/ui-blocks/index.js +0 -76
  414. package/dist/_members/primitives/ui-blocks/index.js.map +0 -1
  415. package/dist/_members/primitives/version-map.json +0 -105
  416. package/dist/_members/primitives/workspace.js +0 -60
  417. package/dist/_members/primitives/workspace.js.map +0 -1
  418. package/dist/chunk-7GISRVON.js +0 -14176
  419. package/dist/chunk-DIBOJJMU.js +0 -16838
  420. package/dist/chunk-EAUSEGB7.js +0 -420
  421. package/dist/chunk-FUWJOVVK.js +0 -3633
  422. package/dist/chunk-G75E7YA4.js +0 -11883
  423. package/dist/chunk-JCZQT7K3.js +0 -3266
  424. package/dist/chunk-KF5ETMKB.js +0 -544
  425. package/dist/chunk-NDKERSXY.js +0 -1296
  426. package/dist/chunk-V43Y7IE4.js +0 -3621
  427. package/dist/chunk-VIVQHIGZ.js +0 -4319
  428. package/dist/chunk-YA3OR2KK.js +0 -249
  429. package/dist/hls-HD4C5G6W.js +0 -33000
  430. package/dist/token-RGFIT24D.js +0 -69
  431. package/dist/token-util-GPLSGYVO.js +0 -5
  432. package/dist/vision_bundle-5Y376MAR.js +0 -4084
@@ -1,703 +0,0 @@
1
- import { z } from "zod";
2
- import { zid } from "convex-helpers/server/zod3";
3
- // Re-export the canonical reframe model so consumers importing from
4
- // `@cueframe/composition/validators` resolve `Focus` / `ReframeSegment` /
5
- // `Reframe` here (the camera channel lives in ../reframe; this is the wire
6
- // validator surface). Replaces the deleted subject-centric CropSubject /
7
- // CropIntentSegment model — there is one viewport primitive now.
8
- export { Focus, ReframeSegment, ReframeSegmentFields, Reframe } from "../reframe/index";
9
- import { Reframe } from "../reframe/index";
10
- export const Format = z.object({
11
- aspectRatio: z.enum(["16:9", "9:16", "1:1", "4:5"]),
12
- fps: z.union([z.literal(24), z.literal(30), z.literal(60)]).optional(),
13
- resolution: z.enum(["hd", "fhd", "4k"]).optional(),
14
- // Target platform (the suggestion's primary platform: tiktok/ig/youtube/…),
15
- // frozen into the snapshot so the floor's safe-zone placement clears that
16
- // surface's UI chrome. Output-determining → part of the render cache key.
17
- // Normalized at lookup (see safe-zones normalizePlatform); absent → broadcast.
18
- platform: z.string().optional(),
19
- });
20
- const Trim = z.object({
21
- start: z.number().nonnegative(),
22
- end: z.number().nonnegative(),
23
- });
24
- const ExcludedRange = z.object({
25
- start: z.number().nonnegative(),
26
- end: z.number().nonnegative(),
27
- reason: z.string().optional(),
28
- });
29
- // (CropOverride deleted 2026-05-25 — replaced by baked-variants substrate.
30
- // Framing decisions now happen at bake time, not render time.)
31
- //
32
- // (CropSubject + CropIntentSegment deleted 2026-06-14 — the subject-centric
33
- // crop model is fully replaced by the canonical `reframe` model. `Focus` is
34
- // the WHO/WHAT (re-exported above from ../reframe), `ReframeSegment` is the
35
- // time-aligned camera segment, `Reframe` = { segments } is the camera channel.
36
- // Field map: subject.kind→focus.mode (shotScale now lives on the `face`
37
- // focus variant only), zoomScale→zoom (<1 punches in; default 1), verticalBias
38
- // →bias.y, lateralBias→bias.x (now OPTIONAL, default 0 when read), intent kept.
39
- // See ~/brain plan 2026-06-14-cropintents-to-reframe-migration.)
40
- export const MediaClipSource = z.object({
41
- kind: z.literal("media"),
42
- mediaId: zid("mediaItems"),
43
- trim: Trim.optional(),
44
- excludedRanges: z.array(ExcludedRange).optional(),
45
- volume: z.number().min(0).max(4).optional(),
46
- muted: z.boolean().optional(),
47
- playbackRate: z.number().positive().optional(),
48
- sync: z.enum(["video", "independent"]).optional(),
49
- /**
50
- * Ken-Burns motion preset for `kind: "image"` tracks. The renderer's
51
- * `<StillFrame>` reads this to drive a per-frame transform over the
52
- * clip's duration. Default is `"in"` (gentle zoom-in) — chosen because
53
- * still photos with zero motion read as "broken video" against
54
- * surrounding b-roll. Set to `"none"` to opt out. Ignored on non-image
55
- * tracks.
56
- */
57
- kenBurns: z.enum(["in", "out", "pan-l", "pan-r", "none"]).optional(),
58
- /**
59
- * Audio mix override for `kind: "audio"` tracks (SFX / music beds).
60
- * `volumeDb` is decibels relative to source (negative = quieter); the
61
- * renderer converts to linear gain via `10^(dB/20)`. Default at render
62
- * time is -12 dB for stock SFX beds — quiet enough to sit under VO
63
- * without ducking. `fadeInMs` / `fadeOutMs` interpolate linearly from
64
- * silence to `volumeDb` (and back) at the clip's edges; default 200 ms
65
- * each. All three are ignored on non-audio tracks.
66
- */
67
- volumeDb: z.number().optional(),
68
- fadeInMs: z.number().nonnegative().optional(),
69
- fadeOutMs: z.number().nonnegative().optional(),
70
- /**
71
- * Loop the underlying media until the clip's `duration` runs out, instead
72
- * of letting the media play to its natural end and freezing on the last
73
- * frame (video / gif) or going silent (audio). Used by gif enrichment
74
- * clips that may be shorter than the moment they cover, and by sfx
75
- * ambient beds. Ignored on `kind: "image"` tracks (stills don't have a
76
- * source timeline to loop).
77
- */
78
- loop: z.boolean().optional(),
79
- /**
80
- * What this audio-track clip IS, for mix policy + eval. Absent on video/image
81
- * clips (the track-family enum on TimelineClip stays untouched — nothing
82
- * downstream switches on family; `audioRole` lives on the SOURCE like
83
- * `volumeDb`). SFX vs music vs VO is otherwise indistinguishable to the
84
- * duck/master/eval logic. (`sfxCompile` stamps `sfx`/`music`; VO is future.)
85
- * `ambience` is a bed that HOLDS under VO — it loops, sits at the BOTTOM of the
86
- * mix, and is NEVER duck-stamped (founder ruling: ambience does not duck under
87
- * speech; no beat map, no anchor semantics).
88
- */
89
- audioRole: z.enum(["sfx", "music", "vo", "ambience"]).optional(),
90
- /**
91
- * Speech-aware ducking (music / vo roles only). Deterministic: the render
92
- * derives the duck envelope from the composition's OWN timeline-aligned
93
- * caption words — no audio analysis, no ffmpeg sidechain. `duckDb` is the
94
- * gain applied during speech (e.g. -12); `attackMs`/`releaseMs` ramp the
95
- * envelope in/out (defaults 150 / 400). `windows` are explicit speech spans
96
- * (timeline ms) — REQUIRED when the composition has no captions; when
97
- * captions exist the projection derives windows from `captions.segments`
98
- * words and `windows` MUST be absent (one SSOT, no drift).
99
- */
100
- duck: z
101
- .object({
102
- duckDb: z.number().max(0),
103
- attackMs: z.number().nonnegative(),
104
- releaseMs: z.number().nonnegative(),
105
- windows: z
106
- .array(z.object({ startMs: z.number(), endMs: z.number() }))
107
- .optional(),
108
- })
109
- .optional(),
110
- /**
111
- * SFX event anchor — provenance + re-resolution handle for a hit bound to a
112
- * graphic/transition entrance. NOT consumed at render (`startTime` stays the
113
- * single placement truth; see the sfxCompile drift note). `clipId` is the
114
- * overlay/video clip whose entrance this hits; `offsetMs` is vs that clip's
115
- * `startTime` (usually 0). Exists so re-resolution + eval can re-derive the
116
- * binding after an amendment. Absent on non-SFX audio clips.
117
- */
118
- anchor: z
119
- .object({
120
- clipId: z.string().min(1),
121
- offsetMs: z.number(),
122
- })
123
- .optional(),
124
- /**
125
- * The camera channel — the canonical `reframe` model. `segments` tile the
126
- * clip's duration and animate a source→output viewport: each carries WHO
127
- * the camera tracks (`focus`), HOW TIGHT (`zoom`, <1 punches in), an optional
128
- * fine framing nudge (`bias`), and optional zoom-ramp easing (`ease`). The
129
- * derive math (deriveTrajectory) honors these directly — no closed-enum
130
- * framing names, no hardcoded scale constants.
131
- *
132
- * When omitted, the renderer plays the raw source (no crop). When present,
133
- * the variant cache keys by `hashReframe(reframe.segments)`.
134
- *
135
- * Replaces the deleted subject-centric `cropIntents` (2026-06-14 cutover —
136
- * one viewport primitive for all clip kinds).
137
- */
138
- reframe: Reframe.optional(),
139
- });
140
- export const ComponentClipSource = z.object({
141
- kind: z.literal("component"),
142
- componentId: z.string().min(1),
143
- props: z.record(z.string(), z.unknown()),
144
- /** Depth plane, mirroring OverlayClipSource — without this field the cloud
145
- * motion-preset sink's zPlane carry was silently STRIPPED at parse (Opus
146
- * review F1), planting a lane asymmetry that would fire the day cards are
147
- * allowed behind-subject. NOTE: the save-time component→custom desugar must
148
- * also carry it when behind-cards land. */
149
- zPlane: z.enum(["front", "behind-subject"]).optional(),
150
- });
151
- export const OverlayClipSource = z.object({
152
- kind: z.literal("overlay"),
153
- primitiveId: z.string().min(1),
154
- params: z.record(z.string(), z.unknown()),
155
- /** Launch-grade depth (spec 2026-06-11): which z-plane this overlay renders on.
156
- * 'behind-subject' = under the subject cut-out (the matte occludes it).
157
- * Extensible enum, NOT a boolean — later planes ('behind-background') are additive.
158
- * Default front. Depth fields (zPlane/anchor/parallax) mirror the TS shape in
159
- * `@cueframe/core/render/types#CompositionOverlay`. */
160
- zPlane: z.enum(["front", "behind-subject"]).optional(),
161
- /** Durable anchor in SCENE space (source-normalized [0,1]); projected through the
162
- * clip's crop trajectory at render (world-lock). System-computed default; agent may set. */
163
- anchor: z.object({ space: z.literal("scene"), x: z.number().min(0).max(1), y: z.number().min(0).max(1) }).optional(),
164
- /** Differential vs camera motion: 0 = locked to scene; small ± = depth parallax. */
165
- parallax: z.number().min(-0.3).max(0.3).optional(),
166
- });
167
- export const EffectClipSource = z.object({
168
- kind: z.literal("effect"),
169
- primitiveId: z.string().min(1),
170
- params: z.record(z.string(), z.unknown()).optional(),
171
- });
172
- /**
173
- * An owned `.cueframe` component composited as a BAKED ALPHA video (Task 2.6b).
174
- * Per-tenant component code is NEVER run in the shared cloud renderer — it is
175
- * baked locally/isolated to an alpha video and composited as trusted pixels. This
176
- * variant carries only the AUTHORED truth (the component file + its props + the
177
- * composite z-plane). The DERIVED baked-alpha R2 key is a render artifact and
178
- * lives in the `renderAssets` envelope (render-assets SSOT), NOT here — the
179
- * composition round-trips `Composition.parse` as pure authored intent, and the
180
- * alpha is re-baked on edit. zPlane mirrors OverlayClipSource (compose over/under
181
- * the subject matte). Lands on overlay tracks.
182
- */
183
- export const AlphaLayerClipSource = z.object({
184
- kind: z.literal("alpha-layer"),
185
- componentId: z.string().min(1),
186
- props: z.record(z.string(), z.unknown()),
187
- zPlane: z.enum(["front", "behind-subject"]).optional(),
188
- });
189
- /**
190
- * A graphic authored as a standalone HTML/CSS fragment, carried VERBATIM into the
191
- * render (dangerouslySetInnerHTML) — the storyboard-first medium. Remotion IS
192
- * Chromium (probe #1: AE@fuzz-3% = 0 px), so the cheap headless still and the
193
- * final Remotion wrap draw the IDENTICAL markup — the port is a WRAPPER, not a
194
- * translation. This variant carries the AUTHORED truth only: the markup + an
195
- * optional brand-token map. The graphic's output-space keep-out box is the clip's
196
- * `region` (on TimelineClip), NOT here. Lands on overlay tracks; zPlane mirrors
197
- * OverlayClipSource (front default; behind-subject world-lock is a follow-up).
198
- */
199
- export const CardClipSource = z.object({
200
- kind: z.literal("card"),
201
- /** Standard HTML/CSS, verbatim. A `<style>` block may be inlined. No <script>
202
- * (innerHTML never executes it) — decoration only. Required + non-empty. */
203
- html: z.string().min(1),
204
- /** Brand-token bindings: each value is a literal OR a whole-string `$brand:<path>`
205
- * ref. Resolved deep at render (resolveBrandRefsDeep — the SAME resolver the
206
- * graphics compiler + alpha bake use) into `--cf-<key>` CSS custom properties on
207
- * the wrapper box; the authored CSS references them as `var(--cf-<key>)`. Keeps
208
- * the payload standard CSS while staying brand-resolvable, with no inline-string
209
- * substitution. */
210
- tokens: z.record(z.string(), z.string()).optional(),
211
- /** Depth plane. FRONT ONLY for now — behind-subject cards are not wired into
212
- * the matte pipeline (the depth predicates in depth.ts / variant-keys /
213
- * resolve-behind-placement exclude card), so admitting "behind-subject" here
214
- * would render the card unoccluded with no matte and no error. The wire
215
- * refuses it LOUDLY instead; widen to the OverlayClipSource enum when the
216
- * behind wiring lands (review finding 2026-07-10). */
217
- zPlane: z.literal("front").optional(),
218
- });
219
- /**
220
- * COMPOUND CLIP — a clip whose source is another composition.
221
- *
222
- * The content union was `TimelineClip | Gap` with a CLOSED source union, so a
223
- * sequence could never contain a sequence: a reusable segment (an intro, a
224
- * lower-third package, last week's cut) had to be flattened by hand into every
225
- * composition that wanted it, and edits to the original reached none of them.
226
- *
227
- * This is deliberately strategic surface, not an NLE luxury: it is the same
228
- * shape `derive_composition` / `fromComposition` traffic in — a composition
229
- * addressable AS a clip is how "every format from one edit" becomes a
230
- * timeline object rather than a workflow.
231
- *
232
- * `compositionId` is a REFERENCE — the document does not embed the child, so
233
- * the child's edits flow through. Resolution (id → Composition) happens at
234
- * projection time via a caller-supplied map; the wire stays self-contained.
235
- * `trim` selects a window of the child's own timeline, like a media trim.
236
- */
237
- export const CompositionClipSource = z.object({
238
- kind: z.literal("composition"),
239
- compositionId: z.string().min(1),
240
- trim: Trim.optional(),
241
- }).strict();
242
- export const ClipSource = z.discriminatedUnion("kind", [
243
- MediaClipSource,
244
- ComponentClipSource,
245
- OverlayClipSource,
246
- EffectClipSource,
247
- AlphaLayerClipSource,
248
- CardClipSource,
249
- CompositionClipSource,
250
- ]);
251
- // AUTHORED_GRAPHIC_KINDS lives in ./graphicKinds (pure, zero-import) so the
252
- // Temporal workflow bundle can value-import it without dragging this file's
253
- // convex-helpers (`zid`) edge into the sandbox. Re-exported here for every
254
- // non-workflow consumer.
255
- export { AUTHORED_GRAPHIC_KINDS } from "./graphicKinds";
256
- export const Transition = z.object({
257
- type: z.string().min(1),
258
- duration: z.number().positive(),
259
- });
260
- const Position = z.object({
261
- x: z.number(),
262
- y: z.number(),
263
- });
264
- /** Phase 5 layer model: the single placement primitive — the output-space rect
265
- * (fractions of the output frame, 0..1) a layer occupies. Mirrors the
266
- * composition-floor `Rect` placement vocabulary already used for captions/overlays.
267
- * Default (omitted) = full frame {x:0,y:0,w:1,h:1}. */
268
- export const Region = z.object({
269
- // Output-space fractions in [0,1]. Bounded like opacity / overlay anchors so a
270
- // mis-authored rect (x<0, w>1) fails LOUD at the wire boundary instead of the
271
- // renderer sizing the source to e.g. 2× the frame. (x+w ≤ 1 / y+h ≤ 1 is the
272
- // intent but left unrefined to keep `Region` a plain object for zodToConvex
273
- // derivation; a rect that fits the bounds but spills past an edge is clipped by
274
- // the box's overflow:hidden, not a crash.)
275
- x: z.number().min(0).max(1),
276
- y: z.number().min(0).max(1),
277
- w: z.number().positive().max(1),
278
- h: z.number().positive().max(1),
279
- });
280
- /** How a layer's source fills its `region`: `cover` (fill + crop, the renderer
281
- * default) or `contain` (letterbox — routed through a designed band, not flat
282
- * black bars). Omitted = `cover`. */
283
- export const ClipFit = z.enum(["cover", "contain"]);
284
- /** One entry of a clip's EFFECT channel — a registered effect primitive plus its
285
- * params. Exported because the `setEffects` op reuses this exact wire shape (the
286
- * op vocabulary never re-describes a validator shape with its own z.object). */
287
- export const PerClipEffect = z.object({
288
- primitiveId: z.string().min(1),
289
- params: z.record(z.string(), z.unknown()).optional(),
290
- });
291
- /**
292
- * KEYFRAMES — a value that changes over a clip's life.
293
- *
294
- * The composition had NO time-varying model. `TimelineClip` carried scalar
295
- * `opacity` / `scale` / `rotation` / `position`, and the only trace of an
296
- * intent to animate them was two error codes with no producer
297
- * (`invariants/errors.ts`: `varying_keyframe_time_out_of_range`,
298
- * `varying_keyframe_duplicate_time`). Two brain docs read
299
- * `registry.ts varyingParams` as the model; it is a list of param NAMES a
300
- * primitive accepts, not a value over time. So "we sell motion" was true of the
301
- * renderer and false of the document.
302
- *
303
- * TIME IS CLIP-RELATIVE, and that is the load-bearing decision. Absolute
304
- * timeline seconds would desync every keyframe on the clip the moment a ripple
305
- * moved it — silently, because nothing about the clip itself would look wrong.
306
- * Clip-relative time survives moves, ripples and lane changes untouched; only a
307
- * TRIM has to think about it.
308
- *
309
- * VALUES ARE SCALAR in v1. A vector channel like `position` decomposes into
310
- * `position.x` / `position.y` without needing a second shape, so nothing is
311
- * lost and the interpolator stays one function.
312
- *
313
- * `cubicBezier` ships from day one even though the UI will only offer named
314
- * easings at first — so the curve editor is additive later rather than a
315
- * migration of everything authored before it.
316
- */
317
- export const KeyframeEasing = z.union([
318
- z.enum(["linear", "ease", "easeIn", "easeOut", "easeInOut"]),
319
- z.object({ cubicBezier: z.tuple([z.number(), z.number(), z.number(), z.number()]) }).strict(),
320
- ]);
321
- export const Keyframe = z.object({
322
- /** Seconds from the clip's own start — NOT timeline time. See above. */
323
- time: z.number().nonnegative(),
324
- value: z.number(),
325
- /** How to reach this keyframe from the previous one. Default `linear`. */
326
- easing: KeyframeEasing.optional(),
327
- }).strict();
328
- /** A channel needs two points to vary; one point is just a scalar with extra steps. */
329
- export const KeyframeChannel = z.array(Keyframe).min(2);
330
- /** Param paths that may be animated. Closed, so a typo fails loud. */
331
- export const ANIMATABLE_PARAMS = [
332
- "opacity",
333
- "scale",
334
- "rotation",
335
- "position.x",
336
- "position.y",
337
- "volume",
338
- ];
339
- export const TimelineClip = z.object({
340
- id: z.string().min(1),
341
- startTime: z.number().nonnegative(),
342
- duration: z.number().positive(),
343
- source: ClipSource,
344
- /** The clip's track FAMILY — mirrors `Track.kind`, distinct from `source.kind`
345
- * (content). OPTIONAL: most clips' family derives unambiguously from the
346
- * source (overlay/effect/component/alpha-layer → overlay/effect), so existing
347
- * authored clips need no migration. It is load-bearing ONLY for `media`
348
- * sources, which are ambiguous (a media clip can be video | audio | image) —
349
- * there `kind` is the clip's self-describing family and `clip.add` requires it
350
- * (or a target track) to route. See `resolveClipKind` (@cueframe/composition-ops). */
351
- kind: z.enum(["video", "audio", "image", "overlay", "effect"]).optional(),
352
- opacity: z.number().min(0).max(1).optional(),
353
- scale: z.number().positive().optional(),
354
- rotation: z.number().optional(),
355
- position: Position.optional(),
356
- /** Phase 5: output-space placement rect (default = full frame). The single
357
- * placement primitive; position/scale/rotation are the animation channel. */
358
- region: Region.optional(),
359
- /** Phase 5: how the source fills `region` (default `cover`). */
360
- fit: ClipFit.optional(),
361
- effects: z.array(PerClipEffect).optional(),
362
- transitionIn: Transition.optional(),
363
- /**
364
- * A/V LINK GROUP. Clips sharing an id move, trim and delete together.
365
- *
366
- * Not polish — a correctness property. Without it, selecting a video clip
367
- * does not select its audio, so every ripple, move and trim silently desyncs
368
- * sound from picture and the user finds out at playback. Every editor this
369
- * repo has been measured against carries the same field; ours had none
370
- * (`grep linkGroup` returned nothing across `cueframe/src` and
371
- * `packages/composition/src` on 2026-08-23).
372
- *
373
- * Membership is the ONLY thing stored. What a link implies — expand the
374
- * selection, carry the group through a move — is behaviour, and lives in
375
- * `../timeline/link.ts` so both lanes get it from one implementation.
376
- */
377
- linkGroupId: z.string().min(1).optional(),
378
- /**
379
- * Time-varying parameter channels, keyed by param path. A param present here
380
- * OVERRIDES its scalar sibling for the clip's whole duration — the scalar
381
- * stays as the value a still frame or a non-animating renderer reads.
382
- */
383
- // STRING-keyed with a refine, not enum-keyed — deliberately. An enum-keyed
384
- // record derives to a convex validator zodToConvexFields cannot build
385
- // ("Record keys must be strings or ids"), which made the convex-schemas
386
- // module THROW AT IMPORT — a deploy-path failure no typecheck showed (review
387
- // finding 2026-08-24; caught only by a module-load check). The closed-set
388
- // guarantee survives in the refine: an unknown param still fails loud.
389
- animate: z
390
- .record(z.string(), KeyframeChannel)
391
- .superRefine((channels, ctx) => {
392
- for (const key of Object.keys(channels)) {
393
- if (!ANIMATABLE_PARAMS.includes(key)) {
394
- ctx.addIssue({
395
- code: z.ZodIssueCode.custom,
396
- path: [key],
397
- message: `"${key}" is not an animatable param (${ANIMATABLE_PARAMS.join(", ")})`,
398
- });
399
- }
400
- }
401
- })
402
- .optional(),
403
- }).strict(); // unknown top-level keys fail loud (e.g. clips under the wrong key, or
404
- // `.strict()` is load-bearing, not cosmetic: Track.contents is a structural
405
- // union `TimelineClip | Gap`. Without strict, a TimelineClip that fails its OWN
406
- // validation (e.g. `source.reframe.segments[].zoom > 1`) falls through to Gap,
407
- // whose default `.strip()` silently DROPS `source`/`fit`/`muted`/… and parses
408
- // the clip as a bare spacer — the projection then skips the sourceless gap and
409
- // the clip vanishes with no error (a silent data-loss bug). Strict makes a
410
- // `source`-bearing object fail Gap too, so the union fails loud and the real
411
- // per-field error (`zoom must be ≤ 1`) surfaces as a 400. Canonical gaps are
412
- // authored as exactly {id,startTime,duration}; the renderer's `_kind` tag lives
413
- // in the RenderInput projection, not here, so strict is safe.
414
- export const Gap = z
415
- .object({
416
- id: z.string().min(1),
417
- startTime: z.number().nonnegative(),
418
- duration: z.number().positive(),
419
- })
420
- .strict();
421
- // Track.contents is a structural union of TimelineClip | Gap. Discrimination is done
422
- // by the presence of `source`: TimelineClip has it, Gap does not. Consumers narrowing
423
- // the union should use `'source' in item` rather than tag-based checks.
424
- // (The renderer's RenderInput projection adds an explicit `_kind` tag — that
425
- // lives in the projection layer, not the canonical Composition shape.)
426
- //
427
- // ROUTE by that discriminator EXPLICITLY rather than a plain
428
- // `z.union([TimelineClip, Gap])`. A plain union parses valid clips fine, but on
429
- // FAILURE it surfaces Gap.strict()'s "Unrecognized key(s): 'source'" for a
430
- // malformed source-bearing clip — burying the clip's REAL field error (e.g. a
431
- // component source missing `props`) behind a message that reads as if the clip
432
- // shouldn't carry a source at all (B4: an author "only found the required shape
433
- // by tracing the validator"). Here a `source`-bearing item is validated ONLY as
434
- // a TimelineClip, so ITS error (`source.props` required) surfaces; a sourceless
435
- // item ONLY as a Gap. Single parse; returns the parsed data (defaults preserved).
436
- export const TrackContent = z.unknown().transform((val, ctx) => {
437
- const hasSource = !!val && typeof val === "object" && "source" in val;
438
- const res = (hasSource ? TimelineClip : Gap).safeParse(val);
439
- if (!res.success) {
440
- for (const issue of res.error.issues)
441
- ctx.addIssue(issue);
442
- return z.NEVER;
443
- }
444
- return res.data;
445
- });
446
- export const Track = z.object({
447
- id: z.string().min(1),
448
- kind: z.enum(["video", "audio", "image", "overlay", "effect"]),
449
- name: z.string().optional(),
450
- enabled: z.boolean().optional(),
451
- /**
452
- * TRACK-LEVEL GAIN, linear, multiplied into every clip on the track.
453
- *
454
- * The mixer had per-clip volume and nothing above it, so "turn the music
455
- * down" meant editing every music clip and re-editing each new one. Absent =
456
- * unity; the projection only multiplies when it is present, so an untouched
457
- * composition renders byte-identically to before this field existed.
458
- */
459
- volume: z.number().min(0).max(4).optional(),
460
- contents: z.array(TrackContent),
461
- }).strict(); // unknown Track keys fail loud — notably a PUT that puts clips under
462
- export const Marker = z.object({
463
- id: z.string().min(1),
464
- startTime: z.number().nonnegative(),
465
- endTime: z.number().nonnegative().optional(),
466
- kind: z.string().min(1),
467
- name: z.string().optional(),
468
- metadata: z.record(z.string(), z.unknown()).optional(),
469
- }).strict(); // unknown top-level keys fail loud; marker extensions go through `metadata`.
470
- const AccessControl = z.object({
471
- public: z.boolean().optional(),
472
- readerOrgIds: z.array(z.string()).optional(),
473
- writerOrgIds: z.array(z.string()).optional(),
474
- });
475
- const LicenseDeclaration = z.object({
476
- type: z.string().min(1),
477
- source: z.string().optional(),
478
- notes: z.string().optional(),
479
- });
480
- const CompositionAccessibility = z.object({
481
- audioDescriptionTrackId: z.string().optional(),
482
- captionsTrackId: z.string().optional(),
483
- signLanguageTrackId: z.string().optional(),
484
- notes: z.string().optional(),
485
- });
486
- /**
487
- * Word-level caption timing. Mirrors the TS shape in
488
- * `@cueframe/core/render/types#CaptionWord` — kept here as a zod schema
489
- * so it validates at the wire boundary. Times are millisecond-based to
490
- * match `@remotion/captions`. `emphasis: true` opts a word into the
491
- * Captions primitive's emphasis styling (separate font/scale/color).
492
- */
493
- export const CaptionWord = z.object({
494
- text: z.string().min(1),
495
- startMs: z.number().nonnegative(),
496
- endMs: z.number().nonnegative(),
497
- emphasis: z.boolean().optional(),
498
- // Hand-drawn marker annotation drawn over this word (color via
499
- // CaptionStyle.annotationColor). Mirrors the renderer's CaptionWord.
500
- annotate: z.enum(["circle", "underline"]).optional(),
501
- });
502
- /**
503
- * Caption styling — mirrors `@cueframe/core/render/types#CaptionStyle`.
504
- * All fields optional on the wire so the renderer falls back to the
505
- * primitive's defaults / brand kit's `captionStyle` per-field.
506
- */
507
- export const CaptionStyle = z.object({
508
- fontFamily: z.string().min(1).optional(),
509
- // Font size in PERCENT OF COMPOSITION HEIGHT — the caption sizing unit across
510
- // the whole system: the Captions primitive resolves `height * fontSize/100`,
511
- // the composition floor sizes the caption band from the same percent
512
- // (buildFloorInput's DEFAULT_CAPTION_FONT_PCT = 5), and the authoring tools
513
- // already document it as "% of video height (default 5)" bounded 1-15. NOT
514
- // px: the wire previously accepted any positive number, so a px-intent value
515
- // (e.g. 31 — memoir/P2surf E2E 2026-07-22) silently rendered 31% of 1080 =
516
- // 335px giant tokens whose multi-line page overflowed the frame: the
517
- // bottom-anchored block spilled into the upper half while unspoken page words
518
- // sat at opacity 0 ("giant pale ghost, no caption at the bottom"). Bounded
519
- // [1,15] so px-intent values are rejected LOUDLY at author time instead of
520
- // rendering garbage.
521
- fontSize: z
522
- .number()
523
- .min(1, "captions style.fontSize is PERCENT of composition height (1-15, default 5) — px values are not accepted")
524
- .max(15, "captions style.fontSize is PERCENT of composition height (1-15, default 5) — px values are not accepted")
525
- .optional()
526
- .describe("Font size as % of composition height (1-15, default 5). NOT px."),
527
- fontWeight: z.number().int().min(100).max(900).optional(),
528
- color: z.string().min(1).optional(),
529
- highlightColor: z.string().min(1).optional(),
530
- backgroundColor: z.string().optional(),
531
- // Caption backdrop plate — the legibility background behind the WHOLE caption
532
- // block (distinct from emphasisPlate, which plates individual emphasis runs).
533
- // 'glass' — a frosted backdrop-blur pill (DEFAULT); premium, footage reads through.
534
- // 'solid' — an opaque dark plate (punchy / social look).
535
- // 'none' — no plate; captions rely on the text shadow (legible only on
536
- // controlled / dark backdrops — a deliberate opt-out).
537
- // Replaces the old per-frame legibility scrim.
538
- plate: z.enum(["glass", "solid", "none"]).optional(),
539
- position: z.enum(["top", "center", "bottom"]).optional(),
540
- textTransform: z.enum(["none", "uppercase", "capitalize"]).optional(),
541
- emphasisColor: z.string().optional(),
542
- // CSS gradient for emphasis TEXT fill (bg-clip-text) — overrides
543
- // emphasisColor when set, ignored under a plate.
544
- emphasisGradient: z.string().optional(),
545
- emphasisScale: z.number().positive().optional(),
546
- emphasisFontFamily: z.string().optional(),
547
- emphasisFontWeight: z.number().int().min(100).max(900).optional(),
548
- emphasisTextTransform: z.enum(["none", "uppercase", "capitalize"]).optional(),
549
- emphasisLetterSpacing: z.number().optional(),
550
- // Italic vs normal slope on emphasis words. The serif-emphasis style
551
- // mirrors the SFxP reference set's italic serif emphasis treatment.
552
- // Default 'normal' (most variants are upright); preset 'serif-emphasis@1'
553
- // ships 'italic'.
554
- emphasisFontStyle: z.enum(["normal", "italic"]).optional(),
555
- // Per-word entrance motion (the shared TextMotion vocabulary). Each word
556
- // enters on its spoken beat, staggered so two never fire together:
557
- // 'fade' — opacity-only reveal.
558
- // 'word-pop' — opacity + spring scale-settle.
559
- // 'stagger-up' — opacity + upward translate.
560
- // 'none' — static (no entrance).
561
- // Brand kits drive this via $brand:motion.entrance; an author may set it too.
562
- entrance: z.enum(["none", "fade", "word-pop", "stagger-up"]).optional(),
563
- entranceMs: z.number().nonnegative().optional(),
564
- entranceStaggerMs: z.number().nonnegative().optional(),
565
- exitMs: z.number().nonnegative().optional(),
566
- // Emphasis highlighter plate (editorial caption look): a rounded plate
567
- // behind each contiguous emphasis run, with an alternating second color.
568
- emphasisPlate: z.boolean().optional(),
569
- emphasisPlateColor: z.string().optional(),
570
- emphasisPlateTextColor: z.string().optional(),
571
- emphasisPlateAltColor: z.string().optional(),
572
- emphasisPlateAltTextColor: z.string().optional(),
573
- emphasisPlateRadius: z.number().nonnegative().optional(),
574
- emphasisPlatePadX: z.number().optional(),
575
- emphasisPlatePadY: z.number().optional(),
576
- // Marker stroke color for CaptionWord.annotate.
577
- annotationColor: z.string().optional(),
578
- // Caption block max width as % of composition width (wider = phrase spreads).
579
- // Bounded ≤100: a >100 value cannot mean anything but overflow (same
580
- // unit-misread class as fontSize above).
581
- maxWidthPercent: z
582
- .number()
583
- .positive()
584
- .max(100, "captions style.maxWidthPercent is % of composition width (max 100)")
585
- .optional(),
586
- });
587
- /**
588
- * Top-level captions layer on a Composition. Spans the whole timeline
589
- * with consistent style — sibling of `tracks` / `markers`, not an
590
- * overlay primitive.
591
- *
592
- * `words` are timeline-aligned milliseconds (NOT source-relative). The
593
- * agent / API path slices the source's transcript to the clip window
594
- * and re-bases timestamps to t=0 on insert. `style` is optional; the
595
- * renderer falls back to brand kit's `captionStyle` then primitive
596
- * defaults.
597
- */
598
- /** One caption SEGMENT (a phrase / sentence) — the content unit the agent
599
- * authors AND a hard caption-page boundary at render: the renderer paginates
600
- * within a segment and never pools words across two, so sentence-bounded
601
- * segments (see `splitIntoSentences`) cut captions at sentence ends. Captions
602
- * are FRONT-ONLY; depth ("behind subject") lives on overlays
603
- * (`OverlayClipSource.zPlane`), never on captions. */
604
- export const CaptionSegment = z.object({
605
- words: z.array(CaptionWord),
606
- });
607
- /**
608
- * PROVENANCE IS REQUIRED. `segments` is a materialized projection, and until
609
- * 2026-08-14 it carried no record of where it came from — which is the whole
610
- * bug. `useCaptionMaterialization` said so itself: "once segments exist there is
611
- * no reliable way to distinguish 'materialized from this doc' from
612
- * 'API-authored', and guessing risks destroying" the authored ones. So nothing
613
- * dared re-derive, and captions silently outlived the edits that invalidated
614
- * them — a real project carried words timed 1940–4400ms inside a 2.4s
615
- * composition, with the render reading those stale times.
616
- *
617
- * `derived` — a projection of a clip's transcript. Anything that changes that
618
- * clip (trim, cut, an excluded range, playback rate) MUST re-derive it, and may,
619
- * because `from` says exactly what to recompute from.
620
- *
621
- * `authored` — a human or agent wrote these words. Never rewritten
622
- * automatically; the segmentation is a deliberate choice.
623
- *
624
- * Segments stay MATERIALIZED rather than resolved at read time on purpose:
625
- * `compositionToRenderInput(composition, srcUrls)` takes no transcripts, and a
626
- * renderer that had to fetch them would stop being self-contained and
627
- * deterministic — which the render cache key depends on.
628
- */
629
- export const CompositionCaptions = z.discriminatedUnion("source", [
630
- z.object({
631
- source: z.literal("derived"),
632
- /** The clip these words are a projection OF. Re-derive from this. */
633
- from: z.object({ clipId: z.string() }),
634
- segments: z.array(CaptionSegment),
635
- style: CaptionStyle.optional(),
636
- }),
637
- z.object({
638
- source: z.literal("authored"),
639
- segments: z.array(CaptionSegment),
640
- style: CaptionStyle.optional(),
641
- }),
642
- ]);
643
- /** All caption words across the layer's segments, in order — the flattened view
644
- * consumers that don't care about behind use. */
645
- export function captionWords(c) {
646
- return c.segments.flatMap((s) => s.words);
647
- }
648
- export const Composition = z.object({
649
- // Self-diagnosing version envelope. Zod's default "Invalid literal value,
650
- // expected 1" reads like a value-range complaint; the agent's most common
651
- // first-run mistake is OMITTING the envelope entirely (ctx.data === undefined),
652
- // so name it. A present-but-wrong value still gets the explicit literal-1
653
- // instruction. (errorMap is runtime-only — the emitted JSON Schema stays
654
- // `const: 1`, so no codegen regen.)
655
- v: z.literal(1, {
656
- errorMap: (_issue, ctx) => ctx.data === undefined
657
- ? { message: 'Missing version envelope: add top-level "v": 1 to the composition.' }
658
- : { message: `Invalid version envelope: top-level "v" must be the literal 1 (got ${JSON.stringify(ctx.data)}).` },
659
- }),
660
- format: Format,
661
- tracks: z.array(Track),
662
- markers: z.array(Marker).optional(),
663
- captions: CompositionCaptions.optional(),
664
- // (fitMode deleted 2026-05-25 baked-variants substrate replacement.
665
- // The variant + composition.format.aspectRatio together pick the
666
- // output; no render-time fit decision needed. Historical snapshots in
667
- // `compositionVersions.snapshotJson` that still carry this field are
668
- // tolerated by the .passthrough() at the Composition schema's tail —
669
- // the field is inert at render time.)
670
- // (brandKitId removed 2026-06-29 — brand is PROJECT-scoped. `projects.brandKitId`
671
- // is the brand SSOT; render resolves the kit from the project (P1.1) and the
672
- // compose-time brand eval sources the kit id from a non-wire side channel. A
673
- // composition no longer carries a brand pointer.)
674
- sourceSuggestionId: z.string().optional(),
675
- license: LicenseDeclaration.optional(),
676
- licenseVerification: z.enum([
677
- "attested",
678
- "cueframe-verified",
679
- "third-party-verified",
680
- ]).optional(),
681
- accessibility: CompositionAccessibility.optional(),
682
- ownerOrgId: z.string().optional(),
683
- acl: AccessControl.optional(),
684
- // TOP-LEVEL STRICT (was .passthrough()): an unknown top-level key is almost
685
- // always a client mistake — most importantly a whole composition wrapped one
686
- // level too deep (`{composition:{…}}`), which under passthrough produced the
687
- // misdirecting "v/format/tracks required" with no clue about the stray key.
688
- // strict() makes zod emit a standard `unrecognized_keys` issue naming the
689
- // offending key, so the error is self-diagnosing — uniformly for any stray
690
- // top-level key, not a special-case. Nested objects keep their own (lenient)
691
- // behavior, preserving forward-compat for fields inside tracks/clips/etc.
692
- }).strict();
693
- export const CompositionAuthorKind = z.enum(["user", "agent", "import"]);
694
- export const CompositionVersion = z.object({
695
- id: z.string().min(1),
696
- compositionId: zid("compositions"),
697
- predecessorId: z.string().optional(),
698
- createdAt: z.number(), // epoch ms — see CONVEX_ADAPTATIONS.md
699
- etag: z.string().min(1),
700
- authorKind: CompositionAuthorKind, // load-bearing for multi-agent lineage
701
- authorId: z.string().optional(), // userId for 'user', agentId for 'agent', source for 'import'
702
- composition: Composition,
703
- });