@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,73 +0,0 @@
1
- const area = (f) => Math.max(0, f.bbox.width) * Math.max(0, f.bbox.height);
2
- /**
3
- * Geometric single-subject focus for the target aspect:
4
- * - no faces → frame-center (screen-recording / faceless b-roll; honest center crop).
5
- * - 2+ faces carry a speakingShare signal → active-speaker (the wedge follows the speaker).
6
- * - otherwise → the single largest detected face (dominant subject).
7
- */
8
- export function pickGeometricFocus(faces) {
9
- if (!faces || faces.length === 0)
10
- return { mode: "frame-center" };
11
- const withSpeaking = faces.filter((f) => typeof f.speakingShare === "number");
12
- if (faces.length >= 2 && withSpeaking.length >= 2)
13
- return { mode: "active-speaker" };
14
- // Equal-area tie-break: Array.prototype.sort is STABLE (ES2019+), so ties keep
15
- // roster order and `[0]` resolves to the FIRST-in-roster face — a deterministic
16
- // pick that P5.3 content-addressing relies on.
17
- const dominant = [...faces].sort((a, b) => area(b) - area(a))[0];
18
- return { mode: "face", faceId: dominant.faceId };
19
- }
20
- /** Clip-relative full-clip span [0, duration]. deriveTrajectory indexes segments
21
- * clip-relative (frame 0 = the clip's source-window start). */
22
- function fullClipDurationSec(content) {
23
- const d = content.duration;
24
- if (typeof d === "number" && d > 0)
25
- return d;
26
- const trim = content.source?.trim;
27
- if (trim && typeof trim.start === "number" && typeof trim.end === "number" && trim.end > trim.start) {
28
- return trim.end - trim.start;
29
- }
30
- return 0;
31
- }
32
- export function deriveReframedComposition(source, targetFormat, perceptionByClipId) {
33
- // Deep copy so the source row is never mutated (structuredClone is available in
34
- // the V8 isolate + Node test runtime; the wire shape is plain JSON).
35
- const out = structuredClone(source);
36
- // Format = target aspect; fps/resolution default to source (intrinsic to the
37
- // edit unless the caller overrides); platform carried over from source.
38
- out.format = {
39
- aspectRatio: targetFormat.aspectRatio,
40
- ...(targetFormat.fps ?? source.format.fps ? { fps: (targetFormat.fps ?? source.format.fps) } : {}),
41
- ...(targetFormat.resolution ?? source.format.resolution
42
- ? { resolution: (targetFormat.resolution ?? source.format.resolution) }
43
- : {}),
44
- ...(source.format.platform ? { platform: source.format.platform } : {}),
45
- };
46
- for (const track of out.tracks) {
47
- // Audio clips are MediaClipSource too (`source.kind === "media"`) but live on
48
- // audio tracks — a geometric viewport reframe is meaningless for sound, so skip
49
- // the whole track. Target AUDIO specifically: IMAGE clips are also `kind:"media"`
50
- // and legitimately keep a pan/zoom reframe, so this is not a "non-video" skip.
51
- if (track.kind === "audio")
52
- continue;
53
- const contents = track.contents;
54
- if (!Array.isArray(contents))
55
- continue;
56
- for (const content of contents) {
57
- const src = content.source;
58
- if (!src || src.kind !== "media")
59
- continue; // overlay/component untouched
60
- if (src.reframe)
61
- continue; // already authored → copied verbatim
62
- const dur = fullClipDurationSec(content);
63
- if (dur <= 0)
64
- continue; // degenerate clip: no crop target
65
- const clipId = content.id;
66
- const roster = typeof clipId === "string" ? perceptionByClipId[clipId] : undefined;
67
- src.reframe = {
68
- segments: [{ startSec: 0, endSec: dur, focus: pickGeometricFocus(roster), zoom: 1 }],
69
- };
70
- }
71
- }
72
- return out;
73
- }
@@ -1,109 +0,0 @@
1
- /**
2
- * Reframe — the canonical, typed model for "the camera": an at-most-one
3
- * top-slot transform whose segments animate a source→output viewport over
4
- * time. This is the REAL model the new pipeline derives + renders from
5
- * natively (not a facade over `cropIntents`).
6
- *
7
- * Status: `reframe` is built correctly here as the canonical shape. The legacy
8
- * `cropIntents` (subject-centric, source-level, required `lateralBias`, no
9
- * `ease`) remains the live podcast path for now and is MIGRATED onto `reframe`
10
- * later — at which point `cropIntents` is deleted. No lowering shim exists;
11
- * the two coexist only during the migration window and share the per-frame
12
- * trajectory back-end + the renderer.
13
- *
14
- * Design vs legacy:
15
- * - `focus` (not `subject`): adds `point`; `shotScale` lives on `face` only.
16
- * - `zoom` (not `zoomScale`): same meaning (<1 punches in).
17
- * - `bias` optional (legacy `lateralBias` was required — podcast baggage).
18
- * - `ease` is HONORED: the reframe derive bakes the eased zoom/center ramp
19
- * into the per-frame trajectory channel, so the renderer is unchanged.
20
- */
21
- import { z } from "zod";
22
- // The shot-scale table + the punch-in warrant (the SSOT both the plan-time guard
23
- // and the bake's `calibrateShotScale` read).
24
- export * from "./shotScale.js";
25
- // Render-time advisory for media cropped hard by an aspect mismatch with no
26
- // authored camera. Pure; no zod, no I/O.
27
- export * from "./aspectLoss.js";
28
- export const Focus = z.discriminatedUnion("mode", [
29
- z.object({ mode: z.literal("frame-center") }),
30
- z.object({ mode: z.literal("point"), x: z.number().min(0).max(1), y: z.number().min(0).max(1) }),
31
- z.object({
32
- mode: z.literal("face"),
33
- faceId: z.string().min(1),
34
- shotScale: z.enum(["close", "standard", "wide"]).optional(),
35
- }),
36
- z.object({ mode: z.literal("all-faces") }),
37
- z.object({ mode: z.literal("active-speaker") }),
38
- ]);
39
- /**
40
- * The segment's FIELDS, unrefined. `ReframeSegment` below wraps this in the
41
- * shotScale-XOR-zoom refine, which makes it a ZodEffects with no `.shape` — so
42
- * anything introspecting the field set (the OpenAPI doc-mirror lockstep guard)
43
- * reads THIS. Validation always goes through `ReframeSegment`.
44
- */
45
- export const ReframeSegmentFields = z.object({
46
- startSec: z.number().nonnegative().describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),
47
- endSec: z.number().positive().describe("Segment END in seconds, clip-relative. The span (endSec − startSec) is this segment's duration — the window `ease` ramps over."),
48
- /** WHO/WHAT the camera tracks — see the `.describe()` for per-mode guidance. */
49
- focus: Focus.describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: " +
50
- "`frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); " +
51
- "`point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); " +
52
- "`face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; " +
53
- "`all-faces` = frame the bounding box of every detected face (group/ensemble shots); " +
54
- "`active-speaker` = follow whoever is speaking (diarized talking-head / podcast). " +
55
- "Pick by what the beat is about; pair with `zoom` for how tight."),
56
- /** Editorial language for diff/log readability ("speaker-tight",
57
- * "wide-context", "interviewer-reaction"). Not honored by the derive math
58
- * — a relabel must not bust the variant cache, so it is EXCLUDED from
59
- * `hashReframe`. */
60
- intent: z.string().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic — NOT honored by the derive math and excluded from the variant cache key."),
61
- /** <1 punches in; 1 = full frame. Omitted when `focus.shotScale` governs — the
62
- * two are MUTUALLY EXCLUSIVE (see the refine below). Absent = 1 (full frame),
63
- * which is how `hashReframe` has always canonicalized it. */
64
- zoom: z.number().min(0.1).max(1).optional().describe("How TIGHT the framing is — the fraction of the source the output viewport shows. " +
65
- "<1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). " +
66
- "~0.6–0.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. " +
67
- "There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. " +
68
- "MUTUALLY EXCLUSIVE with `focus.shotScale`: a face-tracked shot is sized EITHER by the editorial " +
69
- "scale (shotScale, calibrated to the detected face) OR by an explicit zoom — never both."),
70
- /** Ease-in / ease-out durations (seconds) for the zoom ramp at this segment's
71
- * edges. Honored at derive time (baked into the per-frame channel). */
72
- ease: z
73
- .object({
74
- in: z.number().nonnegative().describe("Ease-IN ramp DURATION in seconds at the segment START."),
75
- out: z.number().nonnegative().describe("Ease-OUT ramp DURATION in seconds at the segment END."),
76
- })
77
- .optional()
78
- .describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges — NOT a unitless 0–1 curve. " +
79
- "~0.3–0.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` ≤ the segment's duration " +
80
- "(endSec − startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge " +
81
- "to the full duration and the other to 0. Omit for an instant cut to this framing."),
82
- /** Optional fine framing nudge, source-normalized [-0.3,0.3]. */
83
- bias: z
84
- .object({
85
- x: z.number().min(-0.3).max(0.3).describe("Horizontal nudge, source-normalized (+ = right)."),
86
- y: z.number().min(-0.3).max(0.3).describe("Vertical nudge, source-normalized (+ = down)."),
87
- })
88
- .optional()
89
- .describe("Optional FINE framing nudge off the focus center, source-normalized in [−0.3, 0.3]. " +
90
- "A small correction (headroom, rule-of-thirds), NOT a reframe — use `focus`/`zoom` for the actual shot. " +
91
- "Omit (treated as 0) to sit dead-center on the focus."),
92
- });
93
- export const ReframeSegment = ReframeSegmentFields.refine(
94
- // ONE knob sizes the crop. `shotScale` and `zoom` both do, and the bake gives
95
- // shotScale precedence (calibrateShotScale takes zoom only as a FALLBACK) — so a
96
- // segment carrying both SILENTLY discards the zoom. That is how a stored
97
- // composition came to claim `zoom: 1` (full frame) on a segment the renderer
98
- // punched in to 0.55: reading the artifact said "no zoom" while the render
99
- // plainly zoomed (2026-07-13). The state is incoherent, so make it
100
- // unrepresentable — here, at the wire shape, not just at the authoring tools.
101
- //
102
- // Rows written before compile stopped stamping `zoom: 1` are MIGRATED (convex
103
- // migrations: dropZoomUnderShotScale), not tolerated.
104
- (s) => !(s.focus.mode === "face" && s.focus.shotScale !== undefined && s.zoom !== undefined), {
105
- message: "a face segment takes EITHER focus.shotScale (editorial scale, calibrated to the detected face) OR an explicit zoom — never both; shotScale wins at bake time and the zoom would be silently discarded",
106
- path: ["zoom"],
107
- });
108
- /** The camera channel: exactly one per layer; segments tile the clip. */
109
- export const Reframe = z.object({ segments: z.array(ReframeSegment).min(1) });
@@ -1,64 +0,0 @@
1
- /** The punched-in zoom a Ken-Burns ramp reaches (crop-window scale; <1 = tighter). */
2
- export const KEN_BURNS_ZOOM_TIGHT = 0.84;
3
- /** The held zoom a pan preset sits at so the lateral move has room before edges. */
4
- export const KEN_BURNS_PAN_ZOOM = 0.9;
5
- /** How far (source-normalized) a pan preset slides the focus point laterally. */
6
- export const KEN_BURNS_PAN_BIAS = 0.08;
7
- /**
8
- * Lower a Ken-Burns preset to a single-segment `Reframe` over `[0, durationSec)`.
9
- * Pure; no detection. `durationSec` sets the segment span (and the ease edge
10
- * length, so the ramp fills the whole clip).
11
- */
12
- export function kenBurnsToReframe(mode, durationSec) {
13
- const endSec = durationSec > 0 ? durationSec : 1e-3;
14
- // "none" → identity viewport: frame-center, full frame, no ease. The derive
15
- // emits a scalar zoom_scale=1 and NO per-frame zooms (byte-parity with a
16
- // plain face segment), so the renderer plays the still uncropped.
17
- if (mode === "none") {
18
- const seg = {
19
- startSec: 0,
20
- endSec,
21
- focus: { mode: "frame-center" },
22
- zoom: 1,
23
- intent: "ken-burns-none",
24
- };
25
- return { segments: [seg] };
26
- }
27
- if (mode === "in" || mode === "out") {
28
- // A monotonic zoom ramp across the whole clip. We author the segment at the
29
- // ramp's END zoom and let the FULL-clip ease edge sweep from the start zoom:
30
- // "in" start 1.0 → end 0.84 → ease.in spans the clip (ramp head→settle).
31
- // "out" start 0.84 → end 1.0 → ease.out spans the clip (ramp settle→head).
32
- // deriveTrajectory reads `ease` + `zoom` and emits the per-frame `zooms`.
33
- const seg = {
34
- startSec: 0,
35
- endSec,
36
- focus: { mode: "frame-center" },
37
- zoom: mode === "in" ? KEN_BURNS_ZOOM_TIGHT : 1,
38
- ease: mode === "in"
39
- ? { in: endSec, out: 0 } // ramp 1.0 → zoom over the clip head
40
- : { in: 0, out: endSec }, // ramp zoom → 1.0 over the clip tail
41
- intent: `ken-burns-${mode}`,
42
- };
43
- return { segments: [seg] };
44
- }
45
- // pan-l / pan-r — a held slight zoom with the focus point sliding laterally.
46
- // The point starts off-center one way and eases to the other; ease spans the
47
- // clip so the derive ramps the CENTER (not the zoom) across the segment.
48
- const fromX = mode === "pan-l" ? 0.5 + KEN_BURNS_PAN_BIAS : 0.5 - KEN_BURNS_PAN_BIAS;
49
- const toX = mode === "pan-l" ? 0.5 - KEN_BURNS_PAN_BIAS : 0.5 + KEN_BURNS_PAN_BIAS;
50
- const seg = {
51
- startSec: 0,
52
- endSec,
53
- // `point` focus: detection-free, centers on the authored location. The pan
54
- // sweep is expressed as a center ramp the derive bakes from ease (from→to).
55
- focus: { mode: "point", x: toX, y: 0.5 },
56
- zoom: KEN_BURNS_PAN_ZOOM,
57
- ease: { in: endSec, out: 0 },
58
- // `bias.x` carries the pan ORIGIN offset (fromX − toX) so the derive can ramp
59
- // the center from origin→authored-point across the ease edge. Source-normalized.
60
- bias: { x: fromX - toX, y: 0 },
61
- intent: `ken-burns-${mode}`,
62
- };
63
- return { segments: [seg] };
64
- }
@@ -1,176 +0,0 @@
1
- /**
2
- * Shot scale — the ONE table that turns an editorial shot scale into a crop
3
- * zoom, and the DECIDE-point test for whether that punch-in is earned at all.
4
- *
5
- * `shotScale` is a TARGET, not a zoom: put the tracked face at `target` of the
6
- * output frame's height. The bake (`deriveTrajectory.calibrateShotScale`) reads
7
- * the same table from here, so the plan-time guard and the render agree by
8
- * construction — neither side keeps a copy.
9
- *
10
- * WHY THE WARRANT EXISTS: the bake honors ANY shotScale. It computes
11
- * `zoom = faceHeight / target`, clamps to [0.4, 1.0], and crops — with no idea
12
- * whether the source has the ROOM or the PIXELS to give. On 2026-07-13 a planner
13
- * asked for `close` on a 720x900 talking-head already framed chest-up and
14
- * centred; the bake dutifully cropped to ~392x490 and magnified it 2.7x to fill
15
- * a 1080x1350 output. Nothing objected. The shot was already the shot.
16
- *
17
- * A punch-in is warranted only when all three hold:
18
- * no-gain — the face is genuinely SMALLER than the scale asks for, so the
19
- * crop reframes rather than merely resampling.
20
- * no-room — the crop window, centred on the face and widened by how far the
21
- * subject DRIFTS across the span, still fits inside the source.
22
- * Otherwise the window clamps, the subject slides off its framing,
23
- * and heads get clipped.
24
- * no-pixels — the crop still has enough source pixels to fill the output
25
- * without magnifying past MAX_SOURCE_MAGNIFICATION.
26
- *
27
- * Pure numbers in, pure verdict out — no perception types, no I/O. The caller
28
- * supplies the face facts (the director reads them off the SubjectTrack) and the
29
- * frame geometry.
30
- */
31
- /** Face height as a fraction of the OUTPUT frame height, per editorial scale. */
32
- export const SHOT_SCALE_TARGET = {
33
- close: 0.55,
34
- standard: 0.42,
35
- wide: 0.3,
36
- };
37
- /** The bake clamps the derived zoom to this range. */
38
- export const ZOOM_MIN = 0.4;
39
- export const ZOOM_MAX = 1.0;
40
- /**
41
- * A crop showing this much of the frame or more is not a reframe — it is a
42
- * resample. Below the threshold the punch-in has to actually change the shot.
43
- */
44
- export const NO_GAIN_ZOOM = 0.9;
45
- /**
46
- * Ceiling on how far the render may magnify SOURCE pixels to fill the output.
47
- * 2x is the practical blow-up limit — past it the punch-in reads soft and mushy
48
- * next to the un-cropped spans it cuts against. (A 4K source punches in freely;
49
- * a 720p source has nothing to give.)
50
- */
51
- export const MAX_SOURCE_MAGNIFICATION = 2.0;
52
- /**
53
- * The source rect the output viewport sees at zoom 1.0 — the aspect-fit window.
54
- * Mirrors `calibrateShotScale`'s `fitH`.
55
- */
56
- export function fitWindow(g) {
57
- const outAr = g.outW / g.outH;
58
- const srcAr = g.srcW / g.srcH;
59
- const fitH = srcAr > outAr ? g.srcH : g.srcW / outAr;
60
- return { fitW: fitH * outAr, fitH };
61
- }
62
- /** The zoom a shotScale implies for a face of this height (fraction of the FIT window). */
63
- export function shotScaleZoom(heightFracOfFit, shotScale) {
64
- const target = SHOT_SCALE_TARGET[shotScale];
65
- return Math.max(ZOOM_MIN, Math.min(ZOOM_MAX, heightFracOfFit / target));
66
- }
67
- const pct = (n) => `${Math.round(n * 100)}%`;
68
- const px = (n) => Math.round(n);
69
- /**
70
- * Is this punch-in earned? Refusals carry the NUMBERS — they route back to the
71
- * planner verbatim as its next-turn instruction, so they must say what is true
72
- * of THIS footage and what to do instead.
73
- */
74
- export function punchInWarrant(face, shotScale, g) {
75
- const { fitW, fitH } = fitWindow(g);
76
- if (fitH <= 0 || face.heightFrac <= 0) {
77
- return {
78
- ok: false,
79
- zoom: 1,
80
- rule: "no-gain",
81
- reason: `shotScale '${shotScale}' on ${face.faceId}: no face height detected on this span — nothing to calibrate a punch-in against. Omit shotScale.`,
82
- };
83
- }
84
- // The bake sizes the face against the FIT window, not the raw source.
85
- const heightOfFit = (face.heightFrac * g.srcH) / fitH;
86
- const zoom = shotScaleZoom(heightOfFit, shotScale);
87
- // ── no-gain: the shot is already the shot ──
88
- if (zoom >= NO_GAIN_ZOOM) {
89
- return {
90
- ok: false,
91
- zoom,
92
- rule: "no-gain",
93
- reason: `shotScale '${shotScale}' on ${face.faceId}: the face already fills ${pct(heightOfFit)} of the frame height, ` +
94
- `so this scale computes zoom ${zoom.toFixed(2)} — a crop that shows ${pct(zoom)} of the frame and changes nothing but the resampling. ` +
95
- `Omit shotScale and show the shot as it was captured.`,
96
- };
97
- }
98
- const cropW = zoom * fitW;
99
- const cropH = zoom * fitH;
100
- // ── no-room: the window must fit around the subject WHERE THE SUBJECT IS ──
101
- // Clearance the crop window needs from each source edge, source-normalized.
102
- const halfW = cropW / 2 / g.srcW;
103
- const halfH = cropH / 2 / g.srcH;
104
- if (face.cxMin < halfW ||
105
- face.cxMax > 1 - halfW ||
106
- face.cyMin < halfH ||
107
- face.cyMax > 1 - halfH) {
108
- return {
109
- ok: false,
110
- zoom,
111
- rule: "no-room",
112
- reason: `shotScale '${shotScale}' on ${face.faceId}: a ${px(cropW)}x${px(cropH)} window centred on the subject needs ` +
113
- `${pct(halfW)} horizontal / ${pct(halfH)} vertical clearance from every edge, but the subject's centre sits at ` +
114
- `x ${pct(face.cxMin)}–${pct(face.cxMax)}, y ${pct(face.cyMin)}–${pct(face.cyMax)} of a ${g.srcW}x${g.srcH} source. ` +
115
- `The window would run off the frame and clamp — the subject slides out of its framing and the head clips. ` +
116
- `There is not enough room around this face to punch in.`,
117
- };
118
- }
119
- // ── no-pixels: the crop must still be able to fill the output ──
120
- const magnification = g.outW / cropW;
121
- if (magnification > MAX_SOURCE_MAGNIFICATION) {
122
- return {
123
- ok: false,
124
- zoom,
125
- rule: "no-pixels",
126
- reason: `shotScale '${shotScale}' on ${face.faceId}: crops to ${px(cropW)}x${px(cropH)} of a ${g.srcW}x${g.srcH} source, ` +
127
- `which must then be magnified ${magnification.toFixed(1)}x to fill ${g.outW}x${g.outH} (limit ${MAX_SOURCE_MAGNIFICATION}x). ` +
128
- `This source has no pixels to spare — it renders soft against the un-cropped spans it cuts against. Omit shotScale.`,
129
- };
130
- }
131
- return { ok: true, zoom };
132
- }
133
- /**
134
- * Aggregate per-second face rows into the facts a warrant needs over ONE span:
135
- * the MEDIAN height (robust to a stray frame) and the RANGE the centre travels
136
- * (a walking subject spreads it; a static one collapses it to a point).
137
- *
138
- * Returns null when the face is absent for more than half the span — there is
139
- * nothing to frame, and the caller must refuse rather than invent a box. Shared
140
- * by the planner's guard and the author's `set_crop_intents`, so both judge a
141
- * punch-in against the same aggregate.
142
- */
143
- export function faceOverSpan(perSecond, faceId, startSec, endSec) {
144
- const from = Math.max(0, Math.floor(startSec));
145
- const to = Math.min(perSecond.length, Math.ceil(endSec));
146
- const rows = [];
147
- for (let s = from; s < to; s++) {
148
- const f = perSecond[s]?.[faceId];
149
- if (f)
150
- rows.push(f);
151
- }
152
- const spanSeconds = Math.max(1, to - from);
153
- if (rows.length < spanSeconds / 2)
154
- return null;
155
- const heights = rows.map((r) => r.heightFrac).sort((a, b) => a - b);
156
- return {
157
- faceId,
158
- heightFrac: heights[Math.floor(heights.length / 2)],
159
- cxMin: Math.min(...rows.map((r) => r.cx)),
160
- cxMax: Math.max(...rows.map((r) => r.cx)),
161
- cyMin: Math.min(...rows.map((r) => r.cy)),
162
- cyMax: Math.max(...rows.map((r) => r.cy)),
163
- };
164
- }
165
- /**
166
- * The tightest scale this face+source actually supports, or null when none does
167
- * (the source is already framed as tight as it can usefully go). This is what
168
- * the PLANNER is told, so it never has to guess at a punch-in the guard refuses.
169
- */
170
- export function tightestWarrantedShotScale(face, g) {
171
- for (const s of ["close", "standard", "wide"]) {
172
- if (punchInWarrant(face, s, g).ok)
173
- return s;
174
- }
175
- return null;
176
- }
@@ -1,124 +0,0 @@
1
- /** Clamp to [0,1]. */
2
- export function clip01(v) {
3
- return Math.max(0, Math.min(1, v));
4
- }
5
- /**
6
- * Cubic ease-out `1 - (1-t)^3` for t∈[0,1] — matches the legacy StillFrame's
7
- * `Easing.out(Easing.cubic)` so motion decelerates ("settled").
8
- */
9
- export function easeOutCubic(t) {
10
- const x = Math.max(0, Math.min(1, t));
11
- return 1 - (1 - x) * (1 - x) * (1 - x);
12
- }
13
- /**
14
- * Per-frame crop-window zoom for an EASED segment. Holds at `targetZoom` through
15
- * the body; ramps to/from full-frame (1.0) at the eased edges:
16
- * - `easeInSec` at the HEAD: 1.0 → targetZoom.
17
- * - `easeOutSec` at the TAIL: targetZoom → 1.0.
18
- * Frame times are `frameIdx / srcFps` (segment-local). Edges clamp to the span.
19
- */
20
- export function buildEasedZooms(frameCount, srcFps, targetZoom, easeInSec, easeOutSec) {
21
- const segSec = frameCount / srcFps;
22
- const inDur = Math.max(0, Math.min(easeInSec, segSec));
23
- const outDur = Math.max(0, Math.min(easeOutSec, segSec));
24
- const zooms = new Array(frameCount);
25
- for (let i = 0; i < frameCount; i++) {
26
- const tSec = i / srcFps;
27
- let z = targetZoom;
28
- if (inDur > 0 && tSec < inDur) {
29
- const p = easeOutCubic(tSec / inDur);
30
- z = 1.0 + (targetZoom - 1.0) * p;
31
- }
32
- else if (outDur > 0 && tSec > segSec - outDur) {
33
- const p = easeOutCubic((tSec - (segSec - outDur)) / outDur);
34
- z = targetZoom + (1.0 - targetZoom) * p;
35
- }
36
- zooms[i] = z;
37
- }
38
- return zooms;
39
- }
40
- /**
41
- * Ramp per-frame CENTERS for a `point`-focus pan: from an ORIGIN
42
- * (`point + biasOffset`) to the authored `point`, eased over `easeInSec` at the
43
- * head (then held). Used by Ken-Burns `pan-l` / `pan-r`.
44
- */
45
- export function buildPannedCenters(frameCount, srcFps, point, biasOffset, easeInSec) {
46
- const segSec = frameCount / srcFps;
47
- const inDur = Math.max(0, Math.min(easeInSec, segSec));
48
- const origin = [point[0] + biasOffset[0], point[1] + biasOffset[1]];
49
- const out = new Array(frameCount);
50
- for (let i = 0; i < frameCount; i++) {
51
- const tSec = i / srcFps;
52
- const p = inDur > 0 ? easeOutCubic(Math.min(tSec / inDur, 1)) : 1;
53
- out[i] = [
54
- clip01(origin[0] + (point[0] - origin[0]) * p),
55
- clip01(origin[1] + (point[1] - origin[1]) * p),
56
- ];
57
- }
58
- return out;
59
- }
60
- /** Per-aspect caption keep-out band (fraction of output height). SSOT — the
61
- * execution derive imports this rather than re-declaring it. */
62
- export const CAPTION_BAND_RESERVE = {
63
- "9:16": 0.15,
64
- "4:5": 0.12,
65
- "1:1": 0.1,
66
- "16:9": 0.0,
67
- };
68
- /**
69
- * Derive a FACELESS still-image trajectory from a `Reframe` (typically the one
70
- * `kenBurnsToReframe` produced). A still has no detection, so every focus reduces
71
- * to a constant authored center (`point` → `[x,y]`; everything else → frame-center
72
- * `[0.5,0.5]`), and the only motion is the eased zoom (`buildEasedZooms`) / center
73
- * pan (`buildPannedCenters`). Output is the SAME `TrajectoryData` shape the video
74
- * path produces, so the renderer (CropFromTrajectory) consumes both identically.
75
- *
76
- * `srcW`/`srcH` are the IMAGE pixel dims (used by the renderer's crop-window math).
77
- * Each segment's `[startSec, endSec)` × `fps` sets its per-frame series length.
78
- * `fps` is the OUTPUT fps (the trajectory is sampled at this rate — `src_fps = fps`
79
- * for a still, since the "source" is one frozen image with no native timeline).
80
- */
81
- export function deriveStillTrajectory(reframe, srcW, srcH, fps, aspect, bakeVersion) {
82
- const segments = [];
83
- let cursorSec = 0;
84
- for (const seg of reframe.segments) {
85
- const startSec = seg.startSec;
86
- const endSec = seg.endSec;
87
- const frameCount = Math.max(1, Math.round((endSec - startSec) * fps));
88
- // Faceless center: `point` → authored location; anything else → frame-center.
89
- const point = seg.focus.mode === "point" ? [seg.focus.x, seg.focus.y] : [0.5, 0.5];
90
- const isPan = seg.focus.mode === "point" && !!seg.ease && !!seg.bias;
91
- const targetZoom = seg.zoom ?? 1;
92
- const centers = isPan
93
- ? buildPannedCenters(frameCount, fps, point, [seg.bias?.x ?? 0, seg.bias?.y ?? 0], seg.ease?.in ?? 0)
94
- : new Array(frameCount).fill(null).map(() => [point[0], point[1]]);
95
- // A pan expresses its motion via centers → zero the crop bias (mirror of the
96
- // director's isEasedPan handling). Otherwise pass the authored bias through.
97
- const verticalBias = isPan ? 0 : seg.bias?.y ?? 0;
98
- const lateralBias = isPan ? 0 : seg.bias?.x ?? 0;
99
- const zooms = seg.ease
100
- ? buildEasedZooms(frameCount, fps, targetZoom, seg.ease.in, seg.ease.out)
101
- : undefined;
102
- segments.push({
103
- idx: segments.length,
104
- start_sec: cursorSec,
105
- end_sec: cursorSec + frameCount / fps,
106
- zoom_scale: targetZoom,
107
- vertical_bias: verticalBias,
108
- lateral_bias: lateralBias,
109
- centers,
110
- subjects: [],
111
- caption_band_reserve: CAPTION_BAND_RESERVE[aspect] ?? 0,
112
- ...(zooms ? { zooms } : {}),
113
- });
114
- cursorSec += frameCount / fps;
115
- }
116
- return {
117
- bake_version: bakeVersion,
118
- aspect,
119
- src_w: srcW,
120
- src_h: srcH,
121
- src_fps: fps,
122
- segments,
123
- };
124
- }