@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,103 +0,0 @@
1
- /**
2
- * @cueframe/perception — `activeSpeaker` signal provider (per-angle AV active-
3
- * speaker FACT).
4
- *
5
- * A DECISION-FREE measurement (perception is a leaf — it produces a FACT, never a
6
- * choice): per-angle audio-visual active-speaker detection (TalkNet-style ASD,
7
- * arxiv:2107.06592) → a per-window speaking probability for THAT angle's dominant
8
- * tracked face, calibrated to an ABSOLUTE [0,1] scalar so the Selector core can
9
- * compare "who is talking" across angles (selector-abstraction spec §1.2, the
10
- * `activeSpeaker` signal; §9.1 P3, switch on who's-talking).
11
- *
12
- * Perception NEVER imports the Selector core (the rot-guard direction): this module
13
- * emits a plain `{ value, rawScore, confidence, evidence }` envelope that STRUCTURALLY
14
- * matches `@cueframe/core`'s `Signal`, but the type lives here (a leaf owns its own
15
- * fact shape; the core projects it). Adding/upgrading the model = a version stamp
16
- * here; the core is untouched.
17
- *
18
- * This module is the PURE FACT CONTRACT (perception is a leaf — NO node I/O here,
19
- * so it stays importable by every framework leaf):
20
- * - `activeSpeakerSignal(series, sourceInSec, sourceOutSec)` — PURE: windows the
21
- * per-frame ASD probabilities (over the angle's OWN source timeline) and maps the
22
- * windowed speaking probability to the absolute [0,1] value + reasons.
23
- *
24
- * The MEASUREMENT (the TalkNet/Light-ASD model that PRODUCES an `ActiveSpeakerSeries`)
25
- * lives OUTSIDE the leaf — the real perception build is the Modal skill
26
- * (services/modal/video_router/skills/detect_active_speaker.py). It is PER-ANGLE:
27
- * one angle's audio + that angle's tracked dominant face → that angle's speaking
28
- * probability over time. This REPLACES the within-source Light-ASD (broken on 2+
29
- * faces) — each angle's track is conditioned on its own audio, never the mixed
30
- * podcast track (spec §10 — "Cannot be Deepgram-word-gated per-angle"). Both the
31
- * Modal skill and any local harness feed this one calibration.
32
- *
33
- * LANDMINE (spec §scope-1): vocal activity ≠ SPEECH. Laughing, chewing, coughing,
34
- * a hot reaction mic all raise audio energy and can fool a naive VAD — but a proper
35
- * AV-ASD model (TalkNet) keys on lip-motion↔audio SYNC, so a chewing/laughing
36
- * reaction shot (mouth moves, but not in speech-sync, or audio is non-speech)
37
- * scores LOW. The calibration here trusts the AV model's probability; it does NOT
38
- * re-derive "is talking" from audio energy alone (that would cut to the chewer).
39
- * `audioEnergy` (the hot-mic VAD) is a SEPARATE, weaker signal — never conflate the
40
- * two. The resolver test asserts a high-audio-energy / low-activeSpeaker fixture
41
- * does NOT trigger a cut.
42
- *
43
- * Pure + deterministic.
44
- */
45
- /** Bump when the ASD-probability→value calibration changes (the 3-stamp lesson — a
46
- * stale cached activeSpeaker is served if a consumer doesn't bump alongside). The
47
- * Modal model version is a DISTINCT stamp carried on the series (`modelVersion`). */
48
- export const ACTIVE_SPEAKER_VERSION = 'active-speaker-v1-2026.06.21';
49
- const clamp01 = (x) => (x < 0 ? 0 : x > 1 ? 1 : x);
50
- /**
51
- * Window the per-frame ASD probabilities over `[sourceInSec, sourceOutSec)` (the
52
- * angle's OWN source span — the resolver has already mapped the output grid through
53
- * the angle's declared offset) and map them to the absolute [0,1] activeSpeaker
54
- * value (PURE).
55
- *
56
- * Returns `null` — NOT 0 — when the window has no measurable signal:
57
- * - the angle has no ASD series at all (no detected face → no track to score), OR
58
- * - every frame in the window is `null` (the dominant face was absent the whole
59
- * window).
60
- * `null` is "not measured" (absence); a weight over an all-null activeSpeaker is
61
- * fail-loud upstream (`selector_signal_absent`), never silently 0
62
- * (`feedback_never_add_fallbacks`). A measured-but-quiet angle returns a real low
63
- * value (e.g. 0.05) — that IS a measurement and DOES suppress a cut.
64
- *
65
- * Calibration (absolute, NOT softmax-across-angles): the AV model's per-frame
66
- * probability is already an absolute speaking likelihood, so the value is the
67
- * face-present mean over the window. The TalkNet/Light-ASD model keys on lip↔audio
68
- * SYNC, so a laughing/chewing reaction (mouth moving, non-speech audio) already
69
- * scores low at the model — this calibration trusts that and does NOT re-inflate
70
- * from audio energy (the landmine). Confidence scales with face COVERAGE over the
71
- * window (a face present 2/20 frames is a weak vote).
72
- */
73
- export function activeSpeakerSignal(series, sourceInSec, sourceOutSec) {
74
- if (!series || series.probs.length === 0 || series.fps <= 0)
75
- return null;
76
- const f0 = Math.max(0, Math.floor((sourceInSec - series.windowStartSec) * series.fps));
77
- const f1 = Math.min(series.probs.length, Math.ceil((sourceOutSec - series.windowStartSec) * series.fps));
78
- if (f1 <= f0)
79
- return null;
80
- let sum = 0;
81
- let present = 0;
82
- for (let f = f0; f < f1; f++) {
83
- const p = series.probs[f];
84
- if (p === null || p === undefined)
85
- continue; // face absent this frame — NOT 0
86
- sum += clamp01(p);
87
- present++;
88
- }
89
- const totalFrames = f1 - f0;
90
- // No face in the window at all → absence, not silence. `null` so a weight over an
91
- // all-absent angle fails loud rather than reading as "definitely not speaking".
92
- if (present === 0)
93
- return null;
94
- const rawScore = sum / present; // face-present mean (absence does NOT dilute it)
95
- const value = clamp01(rawScore);
96
- // Confidence = face coverage over the window. A face present every frame is a
97
- // strong vote; a face present a handful of frames is a weak one (the model saw
98
- // little of it). Floor at 0.3 so a sparse-but-real measurement still counts.
99
- const coverage = present / totalFrames;
100
- const confidence = clamp01(0.3 + 0.7 * coverage);
101
- const evidence = `speaking ${rawScore.toFixed(2)}, ${present}/${totalFrames} frames faced`;
102
- return { value, rawScore, confidence, evidence };
103
- }
@@ -1,76 +0,0 @@
1
- /**
2
- * @cueframe/perception — `audioQuality` signal provider (per-source audio fact).
3
- *
4
- * A DECISION-FREE measurement (perception is a leaf — it produces a FACT, never a
5
- * choice): per-source loudness + clarity over the source's audio track, calibrated
6
- * to an ABSOLUTE [0,1] scalar so the Selector core can compare the clearest mic
7
- * across angles (selector-abstraction spec §1.2, the audioQuality signal; §9.1 P2,
8
- * the best-audio bed = instance #3).
9
- *
10
- * Perception NEVER imports the Selector core (the rot-guard direction): this module
11
- * emits a plain `{ value, rawScore, confidence, evidence }` envelope that STRUCTURALLY
12
- * matches `@cueframe/core`'s `Signal`, but the type lives here (a leaf owns its own
13
- * fact shape; the core projects it). Adding/upgrading the analysis = a version stamp
14
- * here; the core is untouched.
15
- *
16
- * This module is the PURE FACT CONTRACT (perception is a leaf — NO node I/O here,
17
- * so it stays importable by every framework leaf):
18
- * - `audioQualitySignal(metrics)` — PURE: maps the raw per-source acoustic metrics
19
- * (integrated loudness LUFS, true-peak, a clarity proxy) to the absolute [0,1]
20
- * value + reasons. This is the contract; the production Modal skill and the local
21
- * ffmpeg harness BOTH feed it the same `AudioQualityMetrics`.
22
- *
23
- * The MEASUREMENT (the ffmpeg/Modal I/O that PRODUCES an `AudioQualityMetrics`)
24
- * lives OUTSIDE the leaf — the local deploy-free analyzer is in the switch
25
- * resolver's processing helper (services/convex/api/selector/audioAnalysis.ts);
26
- * the Modal per-angle path (Phase 4) produces the SAME `AudioQualityMetrics`. Both
27
- * feed this one calibration. Keeping the I/O out of perception keeps the leaf pure
28
- * (no node-only deps) and the rot-guard direction clean.
29
- *
30
- * Pure + deterministic.
31
- */
32
- /** Bump when the loudness→value calibration changes (the 3-stamp lesson — a stale
33
- * cached audioQuality is served if a consumer doesn't bump alongside). */
34
- export const AUDIO_QUALITY_VERSION = 'audio-quality-v1-2026.06.21';
35
- const clamp01 = (x) => (x < 0 ? 0 : x > 1 ? 1 : x);
36
- /**
37
- * Map raw acoustic metrics → the absolute [0,1] audioQuality value (PURE).
38
- *
39
- * Calibration (absolute, NOT softmax-across-angles):
40
- * - LOUDNESS: a piecewise-linear preference centered on broadcast speech. -16 LUFS
41
- * is ideal (1.0); it falls off toward silence (-50 LUFS → ~0) and toward
42
- * too-hot (> -10 LUFS → penalized, an over-driven/distorted mic).
43
- * - CLIPPING: a hard penalty as true-peak approaches/exceeds 0 dBTP (a clipped
44
- * mic is unusable however loud).
45
- * - CLARITY: when provided, multiplies the loudness score (a loud-but-noisy mic
46
- * loses to a clean one); absent → loudness alone (the local harness path).
47
- *
48
- * The result is the clearest-mic ranking signal: over a span the Selector picks the
49
- * argmax of this across angles, stabilized (best-audio bed).
50
- */
51
- export function audioQualitySignal(m) {
52
- // Loudness preference: peak at -16 LUFS, linear ramps on both sides.
53
- const IDEAL = -16;
54
- const FLOOR = -50; // ≤ this → effectively silent
55
- const HOT = -6; // ≥ this → over-driven
56
- let loud;
57
- if (m.integratedLufs <= FLOOR)
58
- loud = 0;
59
- else if (m.integratedLufs <= IDEAL)
60
- loud = (m.integratedLufs - FLOOR) / (IDEAL - FLOOR);
61
- else if (m.integratedLufs >= HOT)
62
- loud = 0.35; // hot but present — usable, penalized
63
- else
64
- loud = 1 - (0.65 * (m.integratedLufs - IDEAL)) / (HOT - IDEAL); // 1.0 → 0.35
65
- loud = clamp01(loud);
66
- // Clipping penalty: linear from 1.0 (≤ -3 dBTP) to 0.2 (≥ 0 dBTP).
67
- const clipPenalty = m.truePeakDbtp <= -3 ? 1 : m.truePeakDbtp >= 0 ? 0.2 : 1 - (0.8 * (m.truePeakDbtp + 3)) / 3;
68
- const clarityMul = m.clarity === undefined ? 1 : 0.4 + 0.6 * clamp01(m.clarity);
69
- const value = clamp01(loud * clipPenalty * clarityMul);
70
- // Confidence is lower when we lack a clarity measurement (loudness alone).
71
- const confidence = m.clarity === undefined ? 0.75 : 0.95;
72
- const evidence = `${m.integratedLufs.toFixed(1)} LUFS, ${m.truePeakDbtp.toFixed(1)} dBTP` +
73
- (m.loudnessRangeLu !== undefined ? `, LRA ${m.loudnessRangeLu.toFixed(1)}` : '') +
74
- (m.clarity !== undefined ? `, clarity ${m.clarity.toFixed(2)}` : '');
75
- return { value, rawScore: m.integratedLufs, confidence, evidence };
76
- }
@@ -1,99 +0,0 @@
1
- /**
2
- * @cueframe/perception — `energyBeat` signal provider (per-source motion/dynamics
3
- * energy FACT).
4
- *
5
- * A DECISION-FREE measurement (perception is a leaf — it produces a FACT, never a
6
- * choice): per-source visual MOTION / dynamics energy over a window, calibrated to
7
- * an ABSOLUTE [0,1] scalar so the Selector core can compare "which angle is the
8
- * most DYNAMIC right now" across angles (selector-abstraction spec §1.2, the
9
- * `energyBeat` signal; §9.1 P6, the fancam/CrowdCut switch signal — "cut to the
10
- * most dynamic angle" on chorus/beat).
11
- *
12
- * Perception NEVER imports the Selector core (the rot-guard direction): this module
13
- * emits a plain `{ value, rawScore, confidence, evidence }` envelope that STRUCTURALLY
14
- * matches `@cueframe/core`'s `Signal`, but the type lives here (a leaf owns its own
15
- * fact shape; the core projects it). Adding/upgrading the model = a version stamp
16
- * here; the core is untouched.
17
- *
18
- * LOCALLY COMPUTABLE — NO MODAL (spec §9.1 P6 scope-1, the CRITICAL constraint): the
19
- * raw measurement is CHEAP frame statistics — the per-frame MEAN-ABS INTER-FRAME
20
- * LUMA DELTA (a normalized "how much did the picture change frame-to-frame" motion
21
- * magnitude). That is a single decode + a mean over |luma[t] − luma[t−1]|, with NO
22
- * GPU model — so the no-deploy CrowdCut validation can derive it host-side (the
23
- * local node helper `services/convex/api/selector/frameStats.ts`, exactly like
24
- * `audioAnalysis.ts` for audioQuality). The pure CALIBRATION here is identical
25
- * whether the deltas come from the local ffmpeg-frame harness or a future Modal
26
- * skill — this is the interface, not a fork.
27
- *
28
- * This module is the PURE FACT CONTRACT (perception is a leaf — NO node I/O here,
29
- * so it stays importable by every framework leaf):
30
- * - `energyBeatSignal(series, sourceInSec, sourceOutSec)` — PURE: windows the
31
- * per-frame inter-frame deltas (over the angle's OWN source timeline) and maps
32
- * the windowed mean motion magnitude to the absolute [0,1] value + reasons.
33
- *
34
- * Pure + deterministic.
35
- */
36
- /** Bump when the motion-delta→value calibration changes (the 3-stamp lesson — a
37
- * stale cached energyBeat is served if a consumer doesn't bump alongside). */
38
- export const ENERGY_BEAT_VERSION = 'energy-beat-v1-2026.06.21';
39
- // ── Calibration constants (EXPLICIT + versioned — spec §9.1 P6 scope-1) ───────
40
- // Inter-frame luma delta is in [0,1] units (luma normalized to [0,1], delta is an
41
- // absolute difference, so a full black↔white flip is 1.0). Real footage motion sits
42
- // well below that: a static talking head ≈ 0.005–0.02, lively hand/body motion ≈
43
- // 0.03–0.08, a fast pan / dance move / strobe ≈ 0.10+. We map this onto [0,1] with a
44
- // floor (below which the picture is effectively still) and a saturation point
45
- // (above which it is "maximally dynamic"). These are the energyBeat calibration
46
- // curve — they are part of ENERGY_BEAT_VERSION (bump it if you retune them).
47
- const STILL_DELTA = 0.004; // ≤ this normalized delta ⇒ effectively static ⇒ 0.0
48
- const DYNAMIC_DELTA = 0.09; // ≥ this normalized delta ⇒ maximally dynamic ⇒ 1.0
49
- const clamp01 = (x) => (x < 0 ? 0 : x > 1 ? 1 : x);
50
- /**
51
- * Window the per-frame inter-frame deltas over `[sourceInSec, sourceOutSec)` (the
52
- * angle's OWN source span — the resolver has already mapped the output grid through
53
- * the angle's declared offset) and map the windowed mean motion magnitude to the
54
- * absolute [0,1] energyBeat value (PURE).
55
- *
56
- * Returns `null` — NOT 0 — when the window has no measurable signal:
57
- * - the angle has no series at all (no frames decoded), OR
58
- * - every frame in the window is `null` (undecodable the whole window).
59
- * `null` is "not measured" (absence); a weight over an all-null energyBeat is
60
- * fail-loud upstream (`selector_signal_absent`), never silently 0
61
- * (`feedback_never_add_fallbacks`). A measured-but-static angle returns a real low
62
- * value (e.g. 0.02) — that IS a measurement and DOES suppress a cut to it.
63
- *
64
- * Calibration (absolute, NOT softmax-across-angles): the windowed mean delta is
65
- * mapped through a piecewise-linear ramp from STILL_DELTA (→ 0) to DYNAMIC_DELTA
66
- * (→ 1). Confidence scales with the fraction of decodable frames over the window (a
67
- * window where most frames failed to decode is a weak vote).
68
- */
69
- export function energyBeatSignal(series, sourceInSec, sourceOutSec) {
70
- if (!series || series.deltas.length === 0 || series.fps <= 0)
71
- return null;
72
- const f0 = Math.max(0, Math.floor((sourceInSec - series.windowStartSec) * series.fps));
73
- const f1 = Math.min(series.deltas.length, Math.ceil((sourceOutSec - series.windowStartSec) * series.fps));
74
- if (f1 <= f0)
75
- return null;
76
- let sum = 0;
77
- let present = 0;
78
- for (let f = f0; f < f1; f++) {
79
- const d = series.deltas[f];
80
- if (d === null || d === undefined)
81
- continue; // frame undecodable — NOT 0
82
- sum += clamp01(d);
83
- present++;
84
- }
85
- const totalFrames = f1 - f0;
86
- // No decodable frame in the window at all → absence, not stillness. `null` so a
87
- // weight over an all-undecodable angle fails loud rather than reading as "static".
88
- if (present === 0)
89
- return null;
90
- const rawScore = sum / present; // mean over DECODED frames (absence does NOT dilute it)
91
- // Piecewise-linear ramp: STILL_DELTA → 0, DYNAMIC_DELTA → 1.
92
- const value = clamp01((rawScore - STILL_DELTA) / (DYNAMIC_DELTA - STILL_DELTA));
93
- // Confidence = decoded-frame coverage over the window. Floor at 0.3 so a sparse-
94
- // but-real measurement still counts.
95
- const coverage = present / totalFrames;
96
- const confidence = clamp01(0.3 + 0.7 * coverage);
97
- const evidence = `motion ${rawScore.toFixed(4)}, ${present}/${totalFrames} frames decoded`;
98
- return { value, rawScore, confidence, evidence };
99
- }
@@ -1,91 +0,0 @@
1
- /**
2
- * @cueframe/perception — cross-source identity MATCHING (the `lockPersonId` fact).
3
- *
4
- * A DECISION-FREE measurement (perception is a leaf — it produces a FACT, never a
5
- * choice): given a LOCKED person's reference ArcFace embedding and a candidate
6
- * angle's per-person median ArcFace embeddings, answer "is the locked person present
7
- * in this angle, and how confidently" — a cosine match over the stored vectors
8
- * (selector-abstraction spec §4 cross-source identity; §9.1 P6, `lockPersonId` =
9
- * lock-to-member across angles).
10
- *
11
- * Perception NEVER imports the Selector core (the rot-guard direction): this module
12
- * is the pure embedding→similarity MATH. The ROUTING decision it feeds — "restrict
13
- * the candidate set to angles where the locked person is present" — is the
14
- * RESOLVER's job (services/convex/api/selector/resolver.ts), which turns this
15
- * presence fact into a per-candidate eligibility the candidate-agnostic core reads
16
- * as an opaque scalar. The core never learns about embeddings (the §9.1 P6
17
- * ROT-GUARD: cross-source identity is a resolver concern; the core reads only id /
18
- * Signal.value / policy).
19
- *
20
- * THE EXTRACTION IS DEPLOY-DEFERRED, THE MATCHING IS LOCAL: the per-person median
21
- * ArcFace embedding is PRODUCED by the Modal `detect_subjects` skill (it already
22
- * computes per-id ArcFace embeddings for the appearance-merge — they were
23
- * computed-then-discarded; P6 persists the per-person MEDIAN into the SubjectTrack,
24
- * `+DETECTOR_VERSION`). That extraction needs a `modal deploy` (deploy-deferred,
25
- * never from a worktree — feedback_never_deploy_from_worktree). This MATCHING (the
26
- * cosine over the stored vectors) is PURE TS and runs with no deploy — the resolver
27
- * consumes the persisted embeddings and matches here.
28
- *
29
- * Pure + deterministic.
30
- */
31
- /** Bump when the matching math / threshold semantics change. The embeddings
32
- * themselves carry the Modal `DETECTOR_VERSION` (a DISTINCT stamp) — a stale
33
- * detector version on an embedding is fail-loud in the resolver
34
- * (`selector_identity_detector_version_mismatch`). */
35
- export const IDENTITY_MATCH_VERSION = 'identity-match-v1-2026.06.21';
36
- // ── Calibration: the cosine threshold above which two ArcFace embeddings are the
37
- // SAME person. ArcFace embeddings are L2-NORMALIZED, so cosine == dot product and
38
- // sits in [-1,1]; the SAME identity across angles/poses typically scores ≳ 0.4,
39
- // different people ≲ 0.2. We use the SAME default as the detector's intra-source
40
- // appearance-merge (scrfd_track.py APPEARANCE_MERGE_THRESHOLD) so cross-angle
41
- // matching is consistent with within-source re-linking. Part of
42
- // IDENTITY_MATCH_VERSION (bump if retuned).
43
- export const IDENTITY_MATCH_COSINE = 0.4;
44
- /** Cosine similarity of two embeddings. ArcFace vectors are L2-normalized, so this
45
- * is the dot product, but we normalize defensively (a non-normalized input — e.g. a
46
- * hand-built test vector — still yields a true cosine). Returns 0 for a zero vector
47
- * or a length mismatch (degenerate — never a false high match). */
48
- export function cosineSimilarity(a, b) {
49
- if (a.length === 0 || a.length !== b.length)
50
- return 0;
51
- let dot = 0;
52
- let na = 0;
53
- let nb = 0;
54
- for (let i = 0; i < a.length; i++) {
55
- dot += a[i] * b[i];
56
- na += a[i] * a[i];
57
- nb += b[i] * b[i];
58
- }
59
- const denom = Math.sqrt(na) * Math.sqrt(nb);
60
- if (denom <= 0)
61
- return 0;
62
- return dot / denom;
63
- }
64
- /**
65
- * Match a LOCKED person's reference embedding against ONE angle's per-person median
66
- * embeddings (PURE). The locked person is "present" in this angle iff the BEST cosine
67
- * over the angle's people is at/above `cosineThreshold`.
68
- *
69
- * Returns `{ present: false, bestCosine: -1, matchedFaceId: null }` when the angle
70
- * has NO people (a faceless wide) — absence of the locked person, NOT an error. The
71
- * resolver turns this into "this angle is not eligible while locked" (it has no
72
- * decodable identity to lock to). A version mismatch between the reference and a
73
- * candidate embedding is NOT silently tolerated — the resolver checks
74
- * `detectorVersion` BEFORE calling this and fails loud
75
- * (`selector_identity_detector_version_mismatch`); this pure math assumes the
76
- * versions already agree.
77
- */
78
- export function matchPerson(reference, anglePeople, cosineThreshold = IDENTITY_MATCH_COSINE) {
79
- if (anglePeople.length === 0)
80
- return { present: false, bestCosine: -1, matchedFaceId: null };
81
- let bestCosine = -1;
82
- let matchedFaceId = null;
83
- for (const p of anglePeople) {
84
- const c = cosineSimilarity(reference, p.embedding);
85
- if (c > bestCosine) {
86
- bestCosine = c;
87
- matchedFaceId = p.faceId;
88
- }
89
- }
90
- return { present: bestCosine >= cosineThreshold, bestCosine, matchedFaceId };
91
- }
@@ -1,48 +0,0 @@
1
- /**
2
- * @cueframe/perception — facts + assets.
3
- *
4
- * Owns: the subject track (faces, active speaker, dims), the silhouette matte,
5
- * the transcript — decision-free measurements derived from the source.
6
- * MUST NOT: choose anything (no framing, no "good enough" gate); zero editorial
7
- * intent.
8
- * Allowed dependencies: NONE (this is a leaf).
9
- *
10
- * SSOT for the SOURCE-COORDS perception facts — what the detector saw, in the
11
- * source video's coordinate space. This is the one home for these shapes; the
12
- * director's detect/derive code imports them from here (was re-declared inline).
13
- *
14
- * DISTINCT from composition's OUTPUT-coords layout shape
15
- * (`@cueframe/composition/projection` `Subject` / `FaceBoxOutput` = crop∘face,
16
- * a render-layout resolution). Those legitimately differ (different coordinate
17
- * space) and the `composition-is-a-leaf` gate forbids composition→perception, so
18
- * they must NOT be unified. The Python detector (services/modal/.../detect_subjects.py,
19
- * person_matting.py) is the IMPLEMENTATION of this contract; it emits JSON matching
20
- * these shapes, cached on `mediaItems.subjectTracks` (Convex).
21
- */
22
- // ── audioQuality signal provider (per-source audio fact; spec §1.2 + §9.1 P2) ──
23
- // The PURE fact calibration only — the ffmpeg/Modal MEASUREMENT that produces an
24
- // AudioQualityMetrics lives outside this leaf (the switch resolver's processing
25
- // helper), so perception stays node-free.
26
- export { AUDIO_QUALITY_VERSION, audioQualitySignal, } from './audioQuality';
27
- // ── activeSpeaker signal provider (per-angle AV-ASD fact; spec §1.2 + §9.1 P3) ──
28
- // The PURE fact calibration only — the TalkNet/Light-ASD MEASUREMENT that produces
29
- // an ActiveSpeakerSeries lives in the Modal skill (detect_active_speaker.py), so
30
- // perception stays node-free + model-dep-free (the leaf rule).
31
- export { ACTIVE_SPEAKER_VERSION, activeSpeakerSignal, } from './activeSpeaker';
32
- // ── energyBeat signal provider (per-source motion/dynamics fact; spec §1.2 + §9.1 P6) ──
33
- // The PURE fact calibration only — the LOCALLY-COMPUTABLE measurement (cheap inter-
34
- // frame luma deltas) lives in the resolver's node helper (frameStats.ts), so
35
- // perception stays node-free. No Modal: a no-deploy CrowdCut validation derives the
36
- // deltas host-side and feeds this same calibration.
37
- export { ENERGY_BEAT_VERSION, energyBeatSignal, } from './energyBeat';
38
- // ── visualQuality signal provider (per-source image-quality fact; spec §1.2 + §9.1 P6) ──
39
- // The PURE fact calibration only — the LOCALLY-COMPUTABLE measurement (Laplacian-
40
- // variance sharpness + exposure sanity) lives in the resolver's node helper
41
- // (frameStats.ts), so perception stays node-free. No Modal: locally computable.
42
- export { VISUAL_QUALITY_VERSION, visualQualitySignal, } from './visualQuality';
43
- // ── cross-source identity MATCHING (the lockPersonId fact; spec §4 + §9.1 P6) ──
44
- // The PURE cosine-match math only — the per-person median ArcFace embedding EXTRACTION
45
- // is Modal-deploy-deferred (detect_subjects.py persists it into the SubjectTrack);
46
- // the MATCHING (which candidate is the locked person) runs with no deploy and feeds
47
- // the resolver's eligibility (the core never learns about embeddings — the rot-guard).
48
- export { IDENTITY_MATCH_VERSION, IDENTITY_MATCH_COSINE, cosineSimilarity, matchPerson, } from './identityMatch';
@@ -1,95 +0,0 @@
1
- /**
2
- * @cueframe/perception — `visualQuality` signal provider (per-source image quality
3
- * FACT).
4
- *
5
- * A DECISION-FREE measurement (perception is a leaf — it produces a FACT, never a
6
- * choice): per-source image quality — SHARPNESS (focus) + EXPOSURE sanity — over a
7
- * window, calibrated to an ABSOLUTE [0,1] scalar so the Selector core can prefer the
8
- * cleanest angle (selector-abstraction spec §1.2, the `visualQuality` signal; §9.1
9
- * P6, the fancam/CrowdCut signal — don't cut to a blurry/blown-out angle).
10
- *
11
- * Perception NEVER imports the Selector core (the rot-guard direction): this module
12
- * emits a plain `{ value, rawScore, confidence, evidence }` envelope that STRUCTURALLY
13
- * matches `@cueframe/core`'s `Signal`, but the type lives here (a leaf owns its own
14
- * fact shape; the core projects it). Adding/upgrading the analysis = a version stamp
15
- * here; the core is untouched.
16
- *
17
- * LOCALLY COMPUTABLE — NO MODAL (spec §9.1 P6 scope-2, the CRITICAL constraint): the
18
- * raw measurement is CHEAP image statistics — SHARPNESS via the variance of the
19
- * Laplacian (a classic blur metric: a focused frame has a high Laplacian variance, a
20
- * blurred one a low variance) + EXPOSURE via mean luma / clipped-pixel fraction
21
- * (under/over-exposed frames are a quality DEFECT). Both are a single decode + a
22
- * convolution/histogram with NO GPU model — so the no-deploy CrowdCut validation can
23
- * derive them host-side (the local node helper `frameStats.ts`, like `audioAnalysis.ts`
24
- * for audioQuality). The pure CALIBRATION here is identical whether the metrics come
25
- * from the local frame harness or a future Modal skill — the interface, not a fork.
26
- *
27
- * This module is the PURE FACT CONTRACT (perception is a leaf — NO node I/O here):
28
- * - `visualQualitySignal(metrics)` — PURE: maps the raw per-source image metrics
29
- * (Laplacian-variance sharpness, mean luma, clipped fraction) to the absolute
30
- * [0,1] value + reasons.
31
- *
32
- * `null` on an UNDECODABLE source (no frame to measure) — NEVER 0 (absence ≠ a bad
33
- * picture; a weight over an all-null visualQuality fails loud upstream, never reads
34
- * as "definitely low quality" — feedback_never_add_fallbacks).
35
- *
36
- * Pure + deterministic.
37
- */
38
- /** Bump when the metrics→value calibration changes (the 3-stamp lesson — a stale
39
- * cached visualQuality is served if a consumer doesn't bump alongside). */
40
- export const VISUAL_QUALITY_VERSION = 'visual-quality-v1-2026.06.21';
41
- // ── Calibration constants (EXPLICIT + versioned — spec §9.1 P6 scope-2) ───────
42
- // SHARPNESS: the variance of the Laplacian, computed on luma normalized to [0,1].
43
- // On that scale a sharply-focused frame has a Laplacian variance roughly in the
44
- // 1e-3..1e-2 range; a soft/blurred frame an order of magnitude lower. We map it
45
- // through a log-ish piecewise ramp from BLUR_VAR (→ 0, clearly out of focus) to
46
- // SHARP_VAR (→ 1, crisp). EXPOSURE: a sanity penalty centered on a mid-grey mean
47
- // luma, plus a hard penalty as the clipped-pixel fraction (pure-black/white) grows
48
- // (a blown-out or crushed frame is a defect however sharp). These are the
49
- // visualQuality calibration curve — part of VISUAL_QUALITY_VERSION (bump if retuned).
50
- const BLUR_VAR = 0.0003; // ≤ this Laplacian variance ⇒ clearly out of focus ⇒ sharpness 0
51
- const SHARP_VAR = 0.006; // ≥ this Laplacian variance ⇒ crisp ⇒ sharpness 1
52
- const IDEAL_LUMA = 0.45; // mean luma (normalized) of a well-exposed frame
53
- const LUMA_TOLERANCE = 0.4; // |meanLuma − IDEAL| beyond this ⇒ exposure penalty maxes out
54
- const CLIP_PENALTY_AT = 0.25; // clipped fraction at/above this ⇒ exposure score floored
55
- const clamp01 = (x) => (x < 0 ? 0 : x > 1 ? 1 : x);
56
- /**
57
- * Map raw image metrics → the absolute [0,1] visualQuality value (PURE).
58
- *
59
- * Returns `null` — NOT 0 — when the source is UNDECODABLE (no frame measured):
60
- * pass `undefined` for an angle whose frame the harness could not read. `null` is
61
- * "not measured" (absence); a weight over an all-null visualQuality is fail-loud
62
- * upstream (`selector_signal_absent`), never silently 0. A real measurement of a
63
- * blurry frame returns a genuine LOW value (e.g. 0.05) — that DOES suppress a cut.
64
- *
65
- * Calibration (absolute, NOT softmax-across-angles):
66
- * - SHARPNESS: a piecewise-linear ramp from BLUR_VAR (→ 0) to SHARP_VAR (→ 1).
67
- * - EXPOSURE: a sanity multiplier — full when `meanLuma` is near IDEAL_LUMA, falling
68
- * off toward crushed/blown, with a hard clip-fraction penalty. A sharp-but-blown
69
- * frame loses to a sharp well-exposed one.
70
- * - value = sharpness · exposure (a blurry OR a blown frame both score low).
71
- */
72
- export function visualQualitySignal(m) {
73
- if (m === undefined)
74
- return null;
75
- if (!Number.isFinite(m.laplacianVariance) || !Number.isFinite(m.meanLuma))
76
- return null;
77
- // SHARPNESS: BLUR_VAR → 0, SHARP_VAR → 1.
78
- const sharpness = clamp01((m.laplacianVariance - BLUR_VAR) / (SHARP_VAR - BLUR_VAR));
79
- // EXPOSURE: 1.0 at IDEAL_LUMA, linear falloff to 0 at IDEAL ± LUMA_TOLERANCE.
80
- const lumaErr = Math.abs(m.meanLuma - IDEAL_LUMA);
81
- let exposure = clamp01(1 - lumaErr / LUMA_TOLERANCE);
82
- // Hard clip penalty: linear from 1.0 (no clipping) to 0 (≥ CLIP_PENALTY_AT clipped).
83
- if (m.clippedFraction !== undefined) {
84
- const clipPenalty = clamp01(1 - clamp01(m.clippedFraction) / CLIP_PENALTY_AT);
85
- exposure *= clipPenalty;
86
- }
87
- const value = clamp01(sharpness * exposure);
88
- // Confidence is lower when we lack a clip measurement (exposure leans on luma alone).
89
- const confidence = m.clippedFraction === undefined ? 0.75 : 0.95;
90
- const evidence = `sharpness ${sharpness.toFixed(2)}, exposure ${exposure.toFixed(2)} ` +
91
- `(lapVar ${m.laplacianVariance.toFixed(4)}, luma ${m.meanLuma.toFixed(2)}` +
92
- (m.clippedFraction !== undefined ? `, clip ${m.clippedFraction.toFixed(3)}` : '') +
93
- ')';
94
- return { value, rawScore: m.laplacianVariance, confidence, evidence };
95
- }
@@ -1,90 +0,0 @@
1
- /**
2
- * ONE composition every row is judged against: 16:9 @ 30fps, five seconds of
3
- * media with a card over the first four. Duration is therefore 5s / 150 frames,
4
- * which is what makes the out-of-bounds row unambiguous.
5
- */
6
- export const CONFORMANCE_COMPOSITION = {
7
- v: 1,
8
- format: { aspectRatio: "16:9", fps: 30, resolution: "fhd" },
9
- tracks: [
10
- {
11
- id: "t-video",
12
- kind: "video",
13
- contents: [
14
- {
15
- id: "c1",
16
- startTime: 0,
17
- duration: 5,
18
- source: { kind: "media", mediaId: "m1", trim: { start: 0, end: 5 } },
19
- },
20
- ],
21
- },
22
- {
23
- id: "t-overlay",
24
- kind: "overlay",
25
- contents: [
26
- {
27
- id: "card-1",
28
- startTime: 0,
29
- duration: 4,
30
- source: { kind: "overlay", primitiveId: "lower-third", params: { text: "hi" } },
31
- },
32
- ],
33
- },
34
- ],
35
- };
36
- /** The composition's own duration, in seconds — derived once, used by the rows. */
37
- export const CONFORMANCE_DURATION_SEC = 5;
38
- export const PREVIEW_FRAME_CASES = [
39
- {
40
- name: "a timestamp inside the composition is answered",
41
- why: "The happy path. If this diverges, nothing below means anything.",
42
- body: { timestamps: [1] },
43
- expect: { status: 200 },
44
- },
45
- {
46
- name: "an empty timestamps array is refused",
47
- why: "Both lanes already reject this — local by hand, cloud via zod `.min(1)`. Here as the " +
48
- "control that proves agreement is achievable and that the runners are wired correctly.",
49
- body: { timestamps: [] },
50
- expect: { status: 400, code: "validation_error" },
51
- },
52
- {
53
- name: "a timestamp PAST the composition end is refused, not clamped",
54
- why: "THE 2026-08-15 WRONG-PIXELS BUG. Asked 6s past the end of a 5s composition, the local " +
55
- "lane answers 200 with the LAST frame (Remotion's Thumbnail pins), and the founder's " +
56
- "agent read that as evidence about its own timeline. " +
57
- "NEITHER LANE DECIDES THIS AT THE ROUTE. The cloud's 422 comes from its RENDERER — " +
58
- "`rethrowCoded` forwarding a downstream 422 (internal/sightedAction.ts:63) — so with the " +
59
- "executor stubbed, as it is on both sides here, the cloud answers 200 too. That is the " +
60
- "finding, not a gap in the harness: a rule enforced only by one lane's renderer is not a " +
61
- "rule the API applies. `timestamp_out_of_bounds` already exists in the shared registry " +
62
- "(packages/errors/src/registry.ts:94, httpStatus 422) — the vocabulary is single-sourced; " +
63
- "the DECISION has no home. Stage 2 gives it one: a pure precondition both lanes run " +
64
- "before reaching for an executor.",
65
- body: { timestamps: [CONFORMANCE_DURATION_SEC + 6] },
66
- expect: { status: 422, code: "timestamp_out_of_bounds" },
67
- knownRed: ["local", "cloud"],
68
- },
69
- {
70
- name: "an unrecognised body key is refused",
71
- why: "THREE DEFINITIONS, AND THE PUBLISHED ONE IS THE STRICTEST. The generated " +
72
- "`previewFrameBody` ends `.strict()`, and SDK + MCP clients enforce it. But the route's " +
73
- "own `PreviewFrameRequest` (evidence.ts:72) — the schema `zodJson` actually runs — ends " +
74
- "`});` with NO `.strict()`, and the local handler has no unknown-key check either " +
75
- "(ALLOWED_KEYS covers apply only). So a typo like `timestamp` or `dryRun` is accepted and " +
76
- "ignored by BOTH servers while the published contract says it is rejected. " +
77
- "This row asserts the STRICT reading because that is what is published and what every " +
78
- "generated client already enforces; a server looser than its own spec is the divergence. " +
79
- "Note this inverts the obvious stage-1 move: adopting the generated schema locally and " +
80
- "nowhere else would make the desktop stricter than the cloud — a NEW divergence pointing " +
81
- "the other way. Stage 1 has to settle strictness once, for both.",
82
- body: { timestamps: [1], nonsenseKey: true },
83
- expect: { status: 400, code: "validation_error" },
84
- knownRed: ["local", "cloud"],
85
- },
86
- ];
87
- /** Does this row currently fail on `lane`? */
88
- export function isKnownRed(c, lane) {
89
- return c.knownRed?.includes(lane) ?? false;
90
- }