@allyhub/sdk 0.1.0-alpha.8 → 0.2.0-next.0

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 (370) hide show
  1. package/NOTICE +85 -0
  2. package/client.d.ts +45 -1
  3. package/dist/anim.js +2 -75
  4. package/dist/define.d.ts +10 -4
  5. package/dist/define.js +2 -95
  6. package/dist/dom.d.ts +1 -1
  7. package/dist/dom.js +2 -457
  8. package/dist/fit.js +2 -60
  9. package/dist/free.d.ts +18 -0
  10. package/dist/free.js +2 -0
  11. package/dist/index.d.ts +28 -13
  12. package/dist/index.js +2 -11
  13. package/dist/input.d.ts +306 -0
  14. package/dist/input.js +2 -0
  15. package/dist/media.d.ts +3 -6
  16. package/dist/media.js +2 -27
  17. package/dist/messages.d.ts +3 -2
  18. package/dist/messages.js +2 -2
  19. package/dist/module.d.ts +24 -0
  20. package/dist/module.js +2 -0
  21. package/dist/noise.js +2 -233
  22. package/dist/parts.d.ts +97 -21
  23. package/dist/parts.js +2 -414
  24. package/dist/paths.d.ts +1 -1
  25. package/dist/paths.js +2 -720
  26. package/dist/phone.d.ts +26 -0
  27. package/dist/phone.js +2 -0
  28. package/dist/piece.d.ts +106 -35
  29. package/dist/piece.js +2 -38
  30. package/dist/props.d.ts +1 -1
  31. package/dist/props.js +2 -35
  32. package/dist/scenery.d.ts +2 -0
  33. package/dist/scenery.js +2 -0
  34. package/dist/text.js +2 -38
  35. package/dist/written.d.ts +12 -0
  36. package/dist/written.js +2 -0
  37. package/docs/README.md +18 -0
  38. package/docs/batches.md +148 -0
  39. package/docs/contract.md +51 -0
  40. package/docs/defaults.md +703 -0
  41. package/docs/docs.md +148 -0
  42. package/docs/footage.md +249 -0
  43. package/docs/layers.md +317 -0
  44. package/docs/modeling.md +143 -0
  45. package/docs/project.md +265 -0
  46. package/docs/scenery.md +308 -0
  47. package/docs/sheets.md +119 -0
  48. package/docs/slides.md +111 -0
  49. package/docs/sound.md +170 -0
  50. package/docs/speech.md +289 -0
  51. package/docs/video.md +265 -0
  52. package/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +52 -0
  53. package/node_modules/@allyhub-next/audio/dist/at-cut.js +2 -0
  54. package/node_modules/@allyhub-next/audio/dist/decode.d.ts +33 -0
  55. package/node_modules/@allyhub-next/audio/dist/decode.js +2 -0
  56. package/node_modules/@allyhub-next/audio/dist/envelope.d.ts +37 -0
  57. package/node_modules/@allyhub-next/audio/dist/envelope.js +2 -0
  58. package/node_modules/@allyhub-next/audio/dist/index.d.ts +17 -0
  59. package/node_modules/@allyhub-next/audio/dist/index.js +2 -0
  60. package/node_modules/@allyhub-next/audio/dist/levels.d.ts +97 -0
  61. package/node_modules/@allyhub-next/audio/dist/levels.js +2 -0
  62. package/node_modules/@allyhub-next/audio/dist/master.d.ts +29 -0
  63. package/node_modules/@allyhub-next/audio/dist/master.js +2 -0
  64. package/node_modules/@allyhub-next/audio/dist/music.d.ts +11 -0
  65. package/node_modules/@allyhub-next/audio/dist/music.js +2 -0
  66. package/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +39 -0
  67. package/node_modules/@allyhub-next/audio/dist/node/decode.js +2 -0
  68. package/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +25 -0
  69. package/node_modules/@allyhub-next/audio/dist/node/ebur128.js +2 -0
  70. package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +31 -0
  71. package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.js +2 -0
  72. package/node_modules/@allyhub-next/audio/dist/node/index.d.ts +8 -0
  73. package/node_modules/@allyhub-next/audio/dist/node/index.js +2 -0
  74. package/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +18 -0
  75. package/node_modules/@allyhub-next/audio/dist/node/loudness.js +2 -0
  76. package/node_modules/@allyhub-next/audio/dist/node/master.d.ts +42 -0
  77. package/node_modules/@allyhub-next/audio/dist/node/master.js +2 -0
  78. package/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +60 -0
  79. package/node_modules/@allyhub-next/audio/dist/node/measure.js +2 -0
  80. package/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +31 -0
  81. package/node_modules/@allyhub-next/audio/dist/node/mix.js +2 -0
  82. package/node_modules/@allyhub-next/audio/dist/plan.d.ts +143 -0
  83. package/node_modules/@allyhub-next/audio/dist/plan.js +2 -0
  84. package/node_modules/@allyhub-next/audio/dist/recorded.d.ts +26 -0
  85. package/node_modules/@allyhub-next/audio/dist/recorded.js +2 -0
  86. package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +47 -0
  87. package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.js +2 -0
  88. package/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +89 -0
  89. package/node_modules/@allyhub-next/audio/dist/recording/chain.js +2 -0
  90. package/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +64 -0
  91. package/node_modules/@allyhub-next/audio/dist/recording/dynamics.js +2 -0
  92. package/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +26 -0
  93. package/node_modules/@allyhub-next/audio/dist/recording/fft.js +2 -0
  94. package/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +42 -0
  95. package/node_modules/@allyhub-next/audio/dist/recording/filters.js +2 -0
  96. package/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +56 -0
  97. package/node_modules/@allyhub-next/audio/dist/recording/fit.js +2 -0
  98. package/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +10 -0
  99. package/node_modules/@allyhub-next/audio/dist/recording/index.js +2 -0
  100. package/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +12 -0
  101. package/node_modules/@allyhub-next/audio/dist/recording/loudness.js +2 -0
  102. package/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +67 -0
  103. package/node_modules/@allyhub-next/audio/dist/recording/measure.js +2 -0
  104. package/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +32 -0
  105. package/node_modules/@allyhub-next/audio/dist/recording/mic.js +2 -0
  106. package/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +27 -0
  107. package/node_modules/@allyhub-next/audio/dist/recording/noise.js +2 -0
  108. package/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +64 -0
  109. package/node_modules/@allyhub-next/audio/dist/recording/presets.js +2 -0
  110. package/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +78 -0
  111. package/node_modules/@allyhub-next/audio/dist/recording/room.js +2 -0
  112. package/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +111 -0
  113. package/node_modules/@allyhub-next/audio/dist/recording/setup.js +2 -0
  114. package/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +3 -0
  115. package/node_modules/@allyhub-next/audio/dist/recording/vec.js +2 -0
  116. package/node_modules/@allyhub-next/audio/dist/render.d.ts +26 -0
  117. package/node_modules/@allyhub-next/audio/dist/render.js +2 -0
  118. package/node_modules/@allyhub-next/audio/dist/sfx.d.ts +10 -0
  119. package/node_modules/@allyhub-next/audio/dist/sfx.js +2 -0
  120. package/node_modules/@allyhub-next/audio/dist/shape.d.ts +118 -0
  121. package/node_modules/@allyhub-next/audio/dist/shape.js +2 -0
  122. package/node_modules/@allyhub-next/audio/dist/voice.d.ts +45 -0
  123. package/node_modules/@allyhub-next/audio/dist/voice.js +2 -0
  124. package/node_modules/@allyhub-next/audio/package.json +17 -0
  125. package/node_modules/@allyhub-next/formats/dist/data/comments.d.ts +94 -0
  126. package/node_modules/@allyhub-next/formats/dist/data/comments.js +2 -0
  127. package/node_modules/@allyhub-next/formats/dist/data/config.d.ts +10 -0
  128. package/node_modules/@allyhub-next/formats/dist/data/config.js +2 -0
  129. package/node_modules/@allyhub-next/formats/dist/data/edits.d.ts +28 -0
  130. package/node_modules/@allyhub-next/formats/dist/data/edits.js +2 -0
  131. package/node_modules/@allyhub-next/formats/dist/data/elements.d.ts +6 -0
  132. package/node_modules/@allyhub-next/formats/dist/data/elements.js +2 -0
  133. package/node_modules/@allyhub-next/formats/dist/data/faces.d.ts +38 -0
  134. package/node_modules/@allyhub-next/formats/dist/data/faces.js +2 -0
  135. package/node_modules/@allyhub-next/formats/dist/data/file.d.ts +11 -0
  136. package/node_modules/@allyhub-next/formats/dist/data/file.js +2 -0
  137. package/node_modules/@allyhub-next/formats/dist/data/gen.d.ts +31 -0
  138. package/node_modules/@allyhub-next/formats/dist/data/gen.js +2 -0
  139. package/node_modules/@allyhub-next/formats/dist/data/messages.d.ts +34 -0
  140. package/node_modules/@allyhub-next/formats/dist/data/messages.js +2 -0
  141. package/node_modules/@allyhub-next/formats/dist/data/reference.d.ts +676 -0
  142. package/node_modules/@allyhub-next/formats/dist/data/reference.js +2 -0
  143. package/node_modules/@allyhub-next/formats/dist/data/script.d.ts +37 -0
  144. package/node_modules/@allyhub-next/formats/dist/data/script.js +2 -0
  145. package/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +214 -0
  146. package/node_modules/@allyhub-next/formats/dist/data/sheet.js +2 -0
  147. package/node_modules/@allyhub-next/formats/dist/data/words.d.ts +25 -0
  148. package/node_modules/@allyhub-next/formats/dist/data/words.js +2 -0
  149. package/node_modules/@allyhub-next/formats/dist/index.d.ts +16 -0
  150. package/node_modules/@allyhub-next/formats/dist/index.js +2 -0
  151. package/node_modules/@allyhub-next/formats/dist/items.d.ts +94 -0
  152. package/node_modules/@allyhub-next/formats/dist/items.js +2 -0
  153. package/node_modules/@allyhub-next/formats/dist/layout.d.ts +50 -0
  154. package/node_modules/@allyhub-next/formats/dist/layout.js +5 -0
  155. package/node_modules/@allyhub-next/formats/dist/schemas.d.ts +301 -0
  156. package/node_modules/@allyhub-next/formats/dist/schemas.js +2 -0
  157. package/node_modules/@allyhub-next/formats/package.json +14 -0
  158. package/node_modules/@allyhub-next/formats/schemas/comments.schema.json +152 -0
  159. package/node_modules/@allyhub-next/formats/schemas/config.schema.json +43 -0
  160. package/node_modules/@allyhub-next/formats/schemas/edits.schema.json +112 -0
  161. package/node_modules/@allyhub-next/formats/schemas/elements.schema.json +33 -0
  162. package/node_modules/@allyhub-next/formats/schemas/gen.schema.json +97 -0
  163. package/node_modules/@allyhub-next/formats/schemas/interpretation.schema.json +125 -0
  164. package/node_modules/@allyhub-next/formats/schemas/items.json +75 -0
  165. package/node_modules/@allyhub-next/formats/schemas/messages.schema.json +11 -0
  166. package/node_modules/@allyhub-next/formats/schemas/script.schema.json +162 -0
  167. package/node_modules/@allyhub-next/formats/schemas/sheet.schema.json +395 -0
  168. package/node_modules/@allyhub-next/formats/schemas/words.schema.json +63 -0
  169. package/node_modules/@allyhub-next/protocol/dist/app.d.ts +98 -0
  170. package/node_modules/@allyhub-next/protocol/dist/app.js +2 -0
  171. package/node_modules/@allyhub-next/protocol/dist/auth.d.ts +116 -0
  172. package/node_modules/@allyhub-next/protocol/dist/auth.js +2 -0
  173. package/node_modules/@allyhub-next/protocol/dist/cli.d.ts +59 -0
  174. package/node_modules/@allyhub-next/protocol/dist/cli.js +2 -0
  175. package/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +272 -0
  176. package/node_modules/@allyhub-next/protocol/dist/cloud.js +2 -0
  177. package/node_modules/@allyhub-next/protocol/dist/editor.d.ts +405 -0
  178. package/node_modules/@allyhub-next/protocol/dist/editor.js +2 -0
  179. package/node_modules/@allyhub-next/protocol/dist/files.d.ts +101 -0
  180. package/node_modules/@allyhub-next/protocol/dist/files.js +2 -0
  181. package/node_modules/@allyhub-next/protocol/dist/index.d.ts +12 -0
  182. package/node_modules/@allyhub-next/protocol/dist/index.js +2 -0
  183. package/node_modules/@allyhub-next/protocol/dist/jsonrpc.d.ts +83 -0
  184. package/node_modules/@allyhub-next/protocol/dist/jsonrpc.js +2 -0
  185. package/node_modules/@allyhub-next/protocol/dist/registry.d.ts +53 -0
  186. package/node_modules/@allyhub-next/protocol/dist/registry.js +2 -0
  187. package/node_modules/@allyhub-next/protocol/dist/runtimes.d.ts +93 -0
  188. package/node_modules/@allyhub-next/protocol/dist/runtimes.js +2 -0
  189. package/node_modules/@allyhub-next/protocol/dist/teams.d.ts +67 -0
  190. package/node_modules/@allyhub-next/protocol/dist/teams.js +2 -0
  191. package/node_modules/@allyhub-next/protocol/dist/tools.d.ts +345 -0
  192. package/node_modules/@allyhub-next/protocol/dist/tools.js +2 -0
  193. package/node_modules/@allyhub-next/protocol/package.json +13 -0
  194. package/node_modules/@allyhub-next/runtimes/dist/bundled.d.ts +10 -0
  195. package/node_modules/@allyhub-next/runtimes/dist/bundled.js +2 -0
  196. package/node_modules/@allyhub-next/runtimes/dist/download.d.ts +15 -0
  197. package/node_modules/@allyhub-next/runtimes/dist/download.js +2 -0
  198. package/node_modules/@allyhub-next/runtimes/dist/errors.d.ts +16 -0
  199. package/node_modules/@allyhub-next/runtimes/dist/errors.js +2 -0
  200. package/node_modules/@allyhub-next/runtimes/dist/home.d.ts +2 -0
  201. package/node_modules/@allyhub-next/runtimes/dist/home.js +2 -0
  202. package/node_modules/@allyhub-next/runtimes/dist/index.d.ts +9 -0
  203. package/node_modules/@allyhub-next/runtimes/dist/index.js +2 -0
  204. package/node_modules/@allyhub-next/runtimes/dist/lock.d.ts +6 -0
  205. package/node_modules/@allyhub-next/runtimes/dist/lock.js +2 -0
  206. package/node_modules/@allyhub-next/runtimes/dist/manifest.d.ts +3 -0
  207. package/node_modules/@allyhub-next/runtimes/dist/manifest.js +2 -0
  208. package/node_modules/@allyhub-next/runtimes/dist/runtimes.d.ts +63 -0
  209. package/node_modules/@allyhub-next/runtimes/dist/runtimes.js +3 -0
  210. package/node_modules/@allyhub-next/runtimes/dist/unpack.d.ts +7 -0
  211. package/node_modules/@allyhub-next/runtimes/dist/unpack.js +2 -0
  212. package/node_modules/@allyhub-next/runtimes/manifest.json +395 -0
  213. package/node_modules/@allyhub-next/runtimes/package.json +14 -0
  214. package/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +153 -0
  215. package/node_modules/@allyhub-next/scenery/NOTICE +42 -0
  216. package/node_modules/@allyhub-next/scenery/dist/aim.d.ts +55 -0
  217. package/node_modules/@allyhub-next/scenery/dist/aim.js +2 -0
  218. package/node_modules/@allyhub-next/scenery/dist/bake.d.ts +203 -0
  219. package/node_modules/@allyhub-next/scenery/dist/bake.js +2 -0
  220. package/node_modules/@allyhub-next/scenery/dist/camera.d.ts +150 -0
  221. package/node_modules/@allyhub-next/scenery/dist/camera.js +2 -0
  222. package/node_modules/@allyhub-next/scenery/dist/curve.d.ts +40 -0
  223. package/node_modules/@allyhub-next/scenery/dist/curve.js +2 -0
  224. package/node_modules/@allyhub-next/scenery/dist/define.d.ts +164 -0
  225. package/node_modules/@allyhub-next/scenery/dist/define.js +2 -0
  226. package/node_modules/@allyhub-next/scenery/dist/fit.d.ts +64 -0
  227. package/node_modules/@allyhub-next/scenery/dist/fit.js +2 -0
  228. package/node_modules/@allyhub-next/scenery/dist/glass.d.ts +34 -0
  229. package/node_modules/@allyhub-next/scenery/dist/glass.js +2 -0
  230. package/node_modules/@allyhub-next/scenery/dist/handheld.d.ts +184 -0
  231. package/node_modules/@allyhub-next/scenery/dist/handheld.js +2 -0
  232. package/node_modules/@allyhub-next/scenery/dist/hull.d.ts +23 -0
  233. package/node_modules/@allyhub-next/scenery/dist/hull.js +2 -0
  234. package/node_modules/@allyhub-next/scenery/dist/index.d.ts +22 -0
  235. package/node_modules/@allyhub-next/scenery/dist/index.js +2 -0
  236. package/node_modules/@allyhub-next/scenery/dist/lens.d.ts +48 -0
  237. package/node_modules/@allyhub-next/scenery/dist/lens.js +2 -0
  238. package/node_modules/@allyhub-next/scenery/dist/moire.d.ts +136 -0
  239. package/node_modules/@allyhub-next/scenery/dist/moire.js +93 -0
  240. package/node_modules/@allyhub-next/scenery/dist/motion.d.ts +48 -0
  241. package/node_modules/@allyhub-next/scenery/dist/motion.js +2 -0
  242. package/node_modules/@allyhub-next/scenery/dist/move.d.ts +260 -0
  243. package/node_modules/@allyhub-next/scenery/dist/move.js +2 -0
  244. package/node_modules/@allyhub-next/scenery/dist/noise.d.ts +41 -0
  245. package/node_modules/@allyhub-next/scenery/dist/noise.js +2 -0
  246. package/node_modules/@allyhub-next/scenery/dist/phone.d.ts +34 -0
  247. package/node_modules/@allyhub-next/scenery/dist/phone.js +2 -0
  248. package/node_modules/@allyhub-next/scenery/dist/report.d.ts +677 -0
  249. package/node_modules/@allyhub-next/scenery/dist/report.js +2 -0
  250. package/node_modules/@allyhub-next/scenery/dist/screen-focus.d.ts +55 -0
  251. package/node_modules/@allyhub-next/scenery/dist/screen-focus.js +2 -0
  252. package/node_modules/@allyhub-next/scenery/dist/screen.d.ts +71 -0
  253. package/node_modules/@allyhub-next/scenery/dist/screen.js +2 -0
  254. package/node_modules/@allyhub-next/scenery/dist/solve.d.ts +82 -0
  255. package/node_modules/@allyhub-next/scenery/dist/solve.js +2 -0
  256. package/node_modules/@allyhub-next/scenery/dist/timing.d.ts +26 -0
  257. package/node_modules/@allyhub-next/scenery/dist/timing.js +2 -0
  258. package/node_modules/@allyhub-next/scenery/dist/vec.d.ts +19 -0
  259. package/node_modules/@allyhub-next/scenery/dist/vec.js +2 -0
  260. package/node_modules/@allyhub-next/scenery/package.json +13 -0
  261. package/node_modules/@allyhub-next/video-core/dist/anchors.d.ts +164 -0
  262. package/node_modules/@allyhub-next/video-core/dist/anchors.js +2 -0
  263. package/node_modules/@allyhub-next/video-core/dist/audio-types.d.ts +148 -0
  264. package/node_modules/@allyhub-next/video-core/dist/audio-types.js +2 -0
  265. package/node_modules/@allyhub-next/video-core/dist/backdrop.d.ts +87 -0
  266. package/node_modules/@allyhub-next/video-core/dist/backdrop.js +2 -0
  267. package/node_modules/@allyhub-next/video-core/dist/captions.d.ts +122 -0
  268. package/node_modules/@allyhub-next/video-core/dist/captions.js +11 -0
  269. package/node_modules/@allyhub-next/video-core/dist/console.d.ts +91 -0
  270. package/node_modules/@allyhub-next/video-core/dist/console.js +2 -0
  271. package/node_modules/@allyhub-next/video-core/dist/contrast.d.ts +98 -0
  272. package/node_modules/@allyhub-next/video-core/dist/contrast.js +2 -0
  273. package/node_modules/@allyhub-next/video-core/dist/cut-report.d.ts +77 -0
  274. package/node_modules/@allyhub-next/video-core/dist/cut-report.js +2 -0
  275. package/node_modules/@allyhub-next/video-core/dist/edit.d.ts +77 -0
  276. package/node_modules/@allyhub-next/video-core/dist/edit.js +13 -0
  277. package/node_modules/@allyhub-next/video-core/dist/edits.d.ts +163 -0
  278. package/node_modules/@allyhub-next/video-core/dist/edits.js +2 -0
  279. package/node_modules/@allyhub-next/video-core/dist/export.d.ts +96 -0
  280. package/node_modules/@allyhub-next/video-core/dist/export.js +2 -0
  281. package/node_modules/@allyhub-next/video-core/dist/fact.d.ts +965 -0
  282. package/node_modules/@allyhub-next/video-core/dist/fact.js +2 -0
  283. package/node_modules/@allyhub-next/video-core/dist/footage-motion.d.ts +168 -0
  284. package/node_modules/@allyhub-next/video-core/dist/footage-motion.js +2 -0
  285. package/node_modules/@allyhub-next/video-core/dist/formats.d.ts +240 -0
  286. package/node_modules/@allyhub-next/video-core/dist/formats.js +2 -0
  287. package/node_modules/@allyhub-next/video-core/dist/gen.d.ts +37 -0
  288. package/node_modules/@allyhub-next/video-core/dist/gen.js +2 -0
  289. package/node_modules/@allyhub-next/video-core/dist/index.d.ts +40 -0
  290. package/node_modules/@allyhub-next/video-core/dist/index.js +2 -0
  291. package/node_modules/@allyhub-next/video-core/dist/look.d.ts +66 -0
  292. package/node_modules/@allyhub-next/video-core/dist/look.js +2 -0
  293. package/node_modules/@allyhub-next/video-core/dist/marks.d.ts +34 -0
  294. package/node_modules/@allyhub-next/video-core/dist/marks.js +2 -0
  295. package/node_modules/@allyhub-next/video-core/dist/matrix.d.ts +289 -0
  296. package/node_modules/@allyhub-next/video-core/dist/matrix.js +2 -0
  297. package/node_modules/@allyhub-next/video-core/dist/measure.d.ts +465 -0
  298. package/node_modules/@allyhub-next/video-core/dist/measure.js +5 -0
  299. package/node_modules/@allyhub-next/video-core/dist/media.d.ts +226 -0
  300. package/node_modules/@allyhub-next/video-core/dist/media.js +2 -0
  301. package/node_modules/@allyhub-next/video-core/dist/messages.d.ts +88 -0
  302. package/node_modules/@allyhub-next/video-core/dist/messages.js +2 -0
  303. package/node_modules/@allyhub-next/video-core/dist/motion.d.ts +56 -0
  304. package/node_modules/@allyhub-next/video-core/dist/motion.js +2 -0
  305. package/node_modules/@allyhub-next/video-core/dist/music.d.ts +110 -0
  306. package/node_modules/@allyhub-next/video-core/dist/music.js +2 -0
  307. package/node_modules/@allyhub-next/video-core/dist/piece.d.ts +1146 -0
  308. package/node_modules/@allyhub-next/video-core/dist/piece.js +2 -0
  309. package/node_modules/@allyhub-next/video-core/dist/placement.d.ts +37 -0
  310. package/node_modules/@allyhub-next/video-core/dist/placement.js +2 -0
  311. package/node_modules/@allyhub-next/video-core/dist/problem.d.ts +262 -0
  312. package/node_modules/@allyhub-next/video-core/dist/problem.js +2 -0
  313. package/node_modules/@allyhub-next/video-core/dist/render-types.d.ts +49 -0
  314. package/node_modules/@allyhub-next/video-core/dist/render-types.js +2 -0
  315. package/node_modules/@allyhub-next/video-core/dist/schema.d.ts +352 -0
  316. package/node_modules/@allyhub-next/video-core/dist/schema.js +2 -0
  317. package/node_modules/@allyhub-next/video-core/dist/script-edit.d.ts +176 -0
  318. package/node_modules/@allyhub-next/video-core/dist/script-edit.js +2 -0
  319. package/node_modules/@allyhub-next/video-core/dist/script.d.ts +67 -0
  320. package/node_modules/@allyhub-next/video-core/dist/script.js +2 -0
  321. package/node_modules/@allyhub-next/video-core/dist/seams.d.ts +214 -0
  322. package/node_modules/@allyhub-next/video-core/dist/seams.js +2 -0
  323. package/node_modules/@allyhub-next/video-core/dist/slides.d.ts +37 -0
  324. package/node_modules/@allyhub-next/video-core/dist/slides.js +2 -0
  325. package/node_modules/@allyhub-next/video-core/dist/sound-under.d.ts +72 -0
  326. package/node_modules/@allyhub-next/video-core/dist/sound-under.js +2 -0
  327. package/node_modules/@allyhub-next/video-core/dist/speech.d.ts +83 -0
  328. package/node_modules/@allyhub-next/video-core/dist/speech.js +5 -0
  329. package/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +616 -0
  330. package/node_modules/@allyhub-next/video-core/dist/timeline.js +2 -0
  331. package/node_modules/@allyhub-next/video-core/dist/timing.d.ts +88 -0
  332. package/node_modules/@allyhub-next/video-core/dist/timing.js +2 -0
  333. package/node_modules/@allyhub-next/video-core/dist/transcript.d.ts +288 -0
  334. package/node_modules/@allyhub-next/video-core/dist/transcript.js +2 -0
  335. package/node_modules/@allyhub-next/video-core/dist/transition.d.ts +289 -0
  336. package/node_modules/@allyhub-next/video-core/dist/transition.js +2 -0
  337. package/node_modules/@allyhub-next/video-core/dist/voice.d.ts +175 -0
  338. package/node_modules/@allyhub-next/video-core/dist/voice.js +2 -0
  339. package/node_modules/@allyhub-next/video-core/dist/words.d.ts +128 -0
  340. package/node_modules/@allyhub-next/video-core/dist/words.js +2 -0
  341. package/node_modules/@allyhub-next/video-core/package.json +14 -0
  342. package/package.json +52 -41
  343. package/README.md +0 -17
  344. package/dist/anim.d.ts.map +0 -1
  345. package/dist/anim.js.map +0 -1
  346. package/dist/define.d.ts.map +0 -1
  347. package/dist/define.js.map +0 -1
  348. package/dist/dom.d.ts.map +0 -1
  349. package/dist/dom.js.map +0 -1
  350. package/dist/fit.d.ts.map +0 -1
  351. package/dist/fit.js.map +0 -1
  352. package/dist/index.d.ts.map +0 -1
  353. package/dist/index.js.map +0 -1
  354. package/dist/media.d.ts.map +0 -1
  355. package/dist/media.js.map +0 -1
  356. package/dist/messages.d.ts.map +0 -1
  357. package/dist/messages.js.map +0 -1
  358. package/dist/noise.d.ts.map +0 -1
  359. package/dist/noise.js.map +0 -1
  360. package/dist/parts.d.ts.map +0 -1
  361. package/dist/parts.js.map +0 -1
  362. package/dist/paths.d.ts.map +0 -1
  363. package/dist/paths.js.map +0 -1
  364. package/dist/piece.d.ts.map +0 -1
  365. package/dist/piece.js.map +0 -1
  366. package/dist/props.d.ts.map +0 -1
  367. package/dist/props.js.map +0 -1
  368. package/dist/text.d.ts.map +0 -1
  369. package/dist/text.js.map +0 -1
  370. /package/{LICENSE → LICENSE.md} +0 -0
@@ -0,0 +1,289 @@
1
+ import { type Ease, type ScalarKey } from "./motion.js";
2
+ import type { Part, TimelineFootage } from "./timeline.js";
3
+ export declare const TRANSITION_TYPES: readonly ["fade", "dip", "slide", "push", "wipe", "zoom", "custom"];
4
+ export type TransitionType = (typeof TRANSITION_TYPES)[number];
5
+ /** The way a slide, a push or a wipe travels. */
6
+ export declare const DIRECTIONS: readonly ["left", "right", "up", "down"];
7
+ export type Direction = (typeof DIRECTIONS)[number];
8
+ /** What a transition gets when it does not say. */
9
+ export declare const TRANSITION_DEFAULTS: {
10
+ /** Seconds the window lasts. */
11
+ readonly dur: 0.4;
12
+ /** The share of the window before the join. */
13
+ readonly split: 0.5;
14
+ /** Where a slide, a push or a wipe travels. */
15
+ readonly direction: "left";
16
+ /** zoom: how large the outgoing picture grows. */
17
+ readonly scale: 1.2;
18
+ };
19
+ /** The longest a transition may last, seconds. */
20
+ export declare const TRANSITION_MAX_DUR = 10;
21
+ /** The easing a type gets when it gives none: moves ease in and out, fades run evenly. */
22
+ export declare function transitionEase(type: TransitionType): Ease;
23
+ /**
24
+ * A channel of a custom transition over the progress (0 at the window's
25
+ * start, 1 at its end): a number that holds, `[from, to]`, or keys
26
+ * `[{ p, v }]` in order of p, linear between them.
27
+ */
28
+ export type TransitionChannel = number | [from: number, to: number] | {
29
+ p: number;
30
+ v: number;
31
+ }[];
32
+ /** What a custom transition does to one of the two pictures. */
33
+ export interface TransitionPicture {
34
+ /** Moved right by this share of the frame's width (−1: a frame to the left); default 0. */
35
+ x?: TransitionChannel;
36
+ /** Moved down by this share of the frame's height; default 0. */
37
+ y?: TransitionChannel;
38
+ /** Scaled about the frame's centre; default 1. */
39
+ scale?: TransitionChannel;
40
+ /** 0 (gone) to 1; default 1. */
41
+ opacity?: TransitionChannel;
42
+ /** This share of the picture cut off at each edge, 0 to 1; default 0. */
43
+ clip?: {
44
+ left?: TransitionChannel;
45
+ right?: TransitionChannel;
46
+ top?: TransitionChannel;
47
+ bottom?: TransitionChannel;
48
+ };
49
+ }
50
+ interface TransitionCommon {
51
+ /** Seconds the window lasts; default 0.4. */
52
+ dur?: number;
53
+ /**
54
+ * How the progress runs; default "linear" for fade, dip and custom,
55
+ * "in-out" for slide, push, wipe and zoom.
56
+ */
57
+ ease?: Ease;
58
+ /**
59
+ * The share of the window before the join, 0 to 1; default 0.5. With 1
60
+ * the whole window is the end of the part before (this part holds its
61
+ * first frame until its own time starts), with 0 the start of this part.
62
+ */
63
+ split?: number;
64
+ }
65
+ /** How a part comes in from the part before it. */
66
+ export type TransitionSpec =
67
+ /** A crossfade. */
68
+ (TransitionCommon & {
69
+ type: "fade";
70
+ })
71
+ /**
72
+ * Through a colour: the part before fades to it, this part fades in
73
+ * from it. Any CSS colour; default the look's background.
74
+ */
75
+ | (TransitionCommon & {
76
+ type: "dip";
77
+ color?: string;
78
+ })
79
+ /**
80
+ * slide: this part's picture travels in over the part before, which
81
+ * stays. push: it pushes the part before out, both travelling. wipe: an
82
+ * edge travels across and uncovers it, neither picture moving.
83
+ * `direction` is the way it travels; default "left".
84
+ */
85
+ | (TransitionCommon & {
86
+ type: "slide" | "push" | "wipe";
87
+ direction?: Direction;
88
+ })
89
+ /**
90
+ * The part before grows to `scale` (default 1.2) while this part fades
91
+ * in over it, settling from `from` to its size: `from` is `scale` by
92
+ * default (both pictures always fill the frame); under 1 it grows in
93
+ * instead, the part before showing round it.
94
+ */
95
+ | (TransitionCommon & {
96
+ type: "zoom";
97
+ scale?: number;
98
+ from?: number;
99
+ })
100
+ /**
101
+ * The channels given directly: `out` for the part before, `in` for this
102
+ * part (over it), and a colour between them with an opacity channel.
103
+ */
104
+ | (TransitionCommon & {
105
+ type: "custom";
106
+ out?: TransitionPicture;
107
+ in?: TransitionPicture;
108
+ color?: {
109
+ value?: string;
110
+ opacity: TransitionChannel;
111
+ };
112
+ });
113
+ /** What `part({ transition })` takes: a type's name, or a type with its options. */
114
+ export type TransitionInput = Exclude<TransitionType, "custom"> | TransitionSpec;
115
+ /** What is wrong with a `transition` value, or undefined when it is one. */
116
+ export declare function transitionProblem(v: unknown): string | undefined;
117
+ /** A transition as an object: a type's name becomes `{ type }`. */
118
+ export declare function transitionSpec(input: TransitionInput): TransitionSpec;
119
+ /** Channels over the progress: `t` is the progress, linear between keys. */
120
+ export type ProgressKeys = ScalarKey[];
121
+ /** The channels of one picture that are not at rest (absent: 0, or 1 for scale and opacity). */
122
+ export interface PictureKeys {
123
+ x?: ProgressKeys;
124
+ y?: ProgressKeys;
125
+ scale?: ProgressKeys;
126
+ opacity?: ProgressKeys;
127
+ left?: ProgressKeys;
128
+ right?: ProgressKeys;
129
+ top?: ProgressKeys;
130
+ bottom?: ProgressKeys;
131
+ }
132
+ /** A transition resolved to channels: what the render, stills and the preview draw from. */
133
+ export interface TransitionKeys {
134
+ /** The outgoing part's picture. */
135
+ out: PictureKeys;
136
+ /** The incoming part's picture, drawn over it. */
137
+ in: PictureKeys;
138
+ /** A plain colour between the two ("#rrggbb" or "#rrggbbaa"). */
139
+ color?: {
140
+ value: string;
141
+ opacity: ProgressKeys;
142
+ };
143
+ /**
144
+ * A dissolve of pictures that may be see-through (a transparent video):
145
+ * the two are added, the outgoing one weighted by 1 − the incoming
146
+ * one's opacity, instead of one drawn over the other.
147
+ */
148
+ add?: true;
149
+ }
150
+ /**
151
+ * A transition's channels. `transparent`: the video has no background, so
152
+ * a fade is a true dissolve (`add`). `background` is the look's background
153
+ * as the timeline carries it; `color` the transition's own colour,
154
+ * resolved the same way, when it gives one.
155
+ */
156
+ export declare function transitionKeys(spec: TransitionSpec, o: {
157
+ transparent: boolean;
158
+ background: string;
159
+ color?: string;
160
+ }): TransitionKeys;
161
+ /** A transition on the film's clock, as the timeline carries it. */
162
+ export interface TimelineTransition {
163
+ /** The incoming part's key (the part that asked for it). */
164
+ part: string;
165
+ /** The outgoing part's key. */
166
+ from: string;
167
+ type: TransitionType;
168
+ /**
169
+ * Film seconds of the window, [start, end) on the frame grid, and of the
170
+ * join inside it (the incoming part's start).
171
+ */
172
+ start: number;
173
+ at: number;
174
+ end: number;
175
+ ease: Ease;
176
+ /** What it does to the two pictures. */
177
+ keys: TransitionKeys;
178
+ /** Seconds it asked for (the window is shorter when a part is short). */
179
+ dur: number;
180
+ /** As asked, for people: a slide's, push's or wipe's direction, a zoom's scale. */
181
+ direction?: Direction;
182
+ scale?: number;
183
+ }
184
+ /**
185
+ * A window's frames either side of the join: `dur` on the frame grid (at
186
+ * least one frame), `split` of it before; at most half of either part, so
187
+ * two windows never meet inside a part.
188
+ */
189
+ export declare function transitionWindow(spec: Pick<TransitionCommon, "dur" | "split">, fps: number, outFrames: number, inFrames: number): {
190
+ before: number;
191
+ after: number;
192
+ };
193
+ /** A window in film frames: its first frame, how many, and the join's frame. */
194
+ export declare function windowFrames(tr: Pick<TimelineTransition, "start" | "end" | "at">, fps: number): {
195
+ first: number;
196
+ frames: number;
197
+ join: number;
198
+ };
199
+ /** The transition whose window holds film time t. */
200
+ export declare function transitionAt<T extends Pick<TimelineTransition, "start" | "end">>(transitions: readonly T[] | undefined, t: number, fps: number): T | undefined;
201
+ /**
202
+ * The progress before easing at frame `i` of a window of `frames`: the
203
+ * frames split the way evenly, so the frame before the window is 0, the
204
+ * one after it 1, and a window of one frame shows the middle.
205
+ */
206
+ export declare const rawProgress: (i: number, frames: number) => number;
207
+ /** The eased progress of a transition at film frame `frame`. */
208
+ export declare function progressAt(tr: Pick<TimelineTransition, "start" | "end" | "at" | "ease">, frame: number, fps: number): number;
209
+ /** One picture at a moment of a transition. */
210
+ export interface PictureState {
211
+ /** Moved by these shares of the frame's width and height. */
212
+ x: number;
213
+ y: number;
214
+ /** Scaled about the frame's centre. */
215
+ scale: number;
216
+ opacity: number;
217
+ /** The share cut off at each edge. */
218
+ left: number;
219
+ right: number;
220
+ top: number;
221
+ bottom: number;
222
+ }
223
+ export interface TransitionState {
224
+ out: PictureState;
225
+ in: PictureState;
226
+ color?: {
227
+ value: string;
228
+ opacity: number;
229
+ };
230
+ /** The two are added (TransitionKeys.add); `out.opacity` is then its weight. */
231
+ add: boolean;
232
+ }
233
+ /** A picture's channels at progress p. */
234
+ export declare function pictureAt(keys: PictureKeys, p: number): PictureState;
235
+ /** Both pictures and the colour at (eased) progress p. */
236
+ export declare function stateAt(keys: TransitionKeys, p: number): TransitionState;
237
+ /** A transition's state at film frame `frame`. */
238
+ export declare function transitionState(tr: TimelineTransition, frame: number, fps: number): TransitionState;
239
+ /** A picture's place in whole pixels, as the render and the preview both round it. */
240
+ export declare function pictureOffset(s: Pick<PictureState, "x" | "y">, width: number, height: number): [x: number, y: number];
241
+ /**
242
+ * A picture's state as CSS on an element the size of the frame
243
+ * (transform-origin at its centre): what the preview sets on a part.
244
+ */
245
+ export declare function pictureCss(s: PictureState, width: number, height: number): {
246
+ transform: string;
247
+ opacity: string;
248
+ clipPath: string;
249
+ };
250
+ /**
251
+ * The eased progress as an ffmpeg expression of `n`, a frame counter that
252
+ * is 0 at frame `offset` of a window of `frames` frames (progressAt, for
253
+ * a filter that counts its own frames).
254
+ */
255
+ export declare function progressExpr(ease: Ease, frames: number, n: string, offset?: number): string;
256
+ /**
257
+ * A channel as an ffmpeg expression of the progress expression `p` (the
258
+ * value pictureAt gives): a number when it never changes.
259
+ */
260
+ export declare function channelExpr(keys: ProgressKeys | undefined, rest: number, p: string): string;
261
+ /** Whether a channel is there and moves, or rests somewhere other than `rest`. */
262
+ export declare const channelActive: (keys: ProgressKeys | undefined, rest: number) => keys is ProgressKeys;
263
+ /** The lowest value a channel takes (its keys are linear in between). */
264
+ export declare const channelMin: (keys: ProgressKeys | undefined, rest: number) => number;
265
+ /**
266
+ * The film time a part's graphics are drawn at when the film is at frame
267
+ * time t: t inside the part's own time, else its first or its last frame,
268
+ * which holds through a transition's window.
269
+ */
270
+ export declare function heldTime(part: Pick<Part, "start" | "end">, t: number, fps: number): number;
271
+ /**
272
+ * A footage layer shown from `start` until `end` instead of its own
273
+ * window, playing on in its file: before its start it plays what comes
274
+ * before in the file (a cut take: before its first stretch, as far as the
275
+ * file goes), after its end what comes after. Where the file has no more,
276
+ * a frame holds.
277
+ */
278
+ export declare function extendFootage<F extends TimelineFootage>(f: F, start: number, end: number): F;
279
+ /**
280
+ * The footage with handles: a layer showing at its part's last frame runs
281
+ * on through the window of the transition out of the part, and one
282
+ * showing at its part's first frame starts at the start of the window into
283
+ * it. Layers no window touches are returned as they are.
284
+ */
285
+ export declare function withHandles<F extends TimelineFootage>(footage: readonly F[], parts: readonly Pick<Part, "key" | "start" | "end">[], transitions: readonly TimelineTransition[] | undefined, fps: number): F[];
286
+ /** A transition in a few words, for people: "push up 0.5 s". */
287
+ export declare function transitionLabel(tr: TimelineTransition): string;
288
+ export {};
289
+ //# sourceMappingURL=transition.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{EASES as M,easeExpr as A,easeValue as E,keyAt as J,keyExpr as T}from"./motion.js";export const TRANSITION_TYPES=["fade","dip","slide","push","wipe","zoom","custom"],DIRECTIONS=["left","right","up","down"],TRANSITION_DEFAULTS={dur:.4,split:.5,direction:"left",scale:1.2},TRANSITION_MAX_DUR=10;export function transitionEase(t){return t==="fade"||t==="dip"||t==="custom"?"linear":"in-out"}const u=t=>typeof t=="number"&&Number.isFinite(t);function $(t){if(u(t))return[{t:0,v:t},{t:1,v:t}];if(!Array.isArray(t)||t.length===0)return;const n=t;if(n.length===2&&u(n[0])&&u(n[1]))return[{t:0,v:n[0]},{t:1,v:n[1]}];const o=[];for(const e of n){if(typeof e!="object"||e===null)return;const{p:r,v:i}=e;if(!u(r)||!u(i)||r<0||r>1||o.length>0&&r<(o.at(-1)?.t??0))return;o.push({t:r,v:i})}return o}const w=[["x",-4,4],["y",-4,4],["scale",.01,8],["opacity",0,1]],S=["left","right","top","bottom"];function x(t,n,o,e){const r=$(n);if(!r)return`${t} ${JSON.stringify(n)} is not a number, [from, to] or keys [{ p, v }] with p from 0 to 1 in order`;if(r.some(i=>i.v<o||i.v>e))return`${t} ${JSON.stringify(n)} is not from ${String(o)} to ${String(e)}`}function v(t,n){if(n===void 0)return;if(typeof n!="object"||n===null)return`${t} is { x, y, scale, opacity, clip }, not ${JSON.stringify(n)}`;const o=n;for(const[e,r,i]of w){if(o[e]===void 0)continue;const c=x(`${t}.${e}`,o[e],r,i);if(c)return c}if(o.clip!==void 0){if(typeof o.clip!="object"||o.clip===null)return`${t}.clip is { left, right, top, bottom }, not ${JSON.stringify(o.clip)}`;const e=o.clip;for(const r of S){if(e[r]===void 0)continue;const i=x(`${t}.clip.${r}`,e[r],0,1);if(i)return i}}}const b=TRANSITION_TYPES.map(t=>`"${t}"`).join(", ");export function transitionProblem(t){if(typeof t=="string")return TRANSITION_TYPES.includes(t)&&t!=="custom"?void 0:`"${t}" is not a transition: use ${b.replace(', "custom"',"")}, or { type, … } ("custom" takes its channels: { type: "custom", out, in })`;if(typeof t!="object"||t===null)return`${JSON.stringify(t)} is not a transition: a type's name or { type, dur?, ease?, … }`;const n=t,o=n.type;if(typeof o!="string"||!TRANSITION_TYPES.includes(o))return`type ${JSON.stringify(o)} is not one of ${b}`;const e=n.dur;if(e!==void 0&&(!u(e)||e<=0||e>TRANSITION_MAX_DUR))return`dur ${JSON.stringify(e)} is not seconds over 0 and up to ${String(TRANSITION_MAX_DUR)}`;const r=n.ease;if(r!==void 0&&!M.includes(r))return`ease ${JSON.stringify(r)} is not one of ${M.map(s=>`"${s}"`).join(", ")}`;const i=n.split;if(i!==void 0&&(!u(i)||i<0||i>1))return`split ${JSON.stringify(i)} is not from 0 (all of it after the join) to 1 (all of it before)`;const c=n.direction;if(c!==void 0&&!DIRECTIONS.includes(c))return`direction ${JSON.stringify(c)} is not one of ${DIRECTIONS.map(s=>`"${s}"`).join(", ")}`;if(o==="zoom"){const s=n.scale;if(s!==void 0&&(!u(s)||s<=1||s>4))return`scale ${JSON.stringify(s)} is not over 1 and up to 4 (1.2 is the default)`;const a=n.from;if(a!==void 0&&(!u(a)||a<.1||a>4))return`from ${JSON.stringify(a)} is not a scale from 0.1 to 4 (default: the same as scale)`}if(o==="dip"&&n.color!==void 0&&(typeof n.color!="string"||n.color.trim()===""))return`color ${JSON.stringify(n.color)} is not a CSS colour such as "#000000"`;if(o==="custom"){const s=v("out",n.out)??v("in",n.in);if(s)return s;const a=n.color;if(a!==void 0){if(typeof a!="object"||a===null)return`color is { value?, opacity }, not ${JSON.stringify(a)}`;const d=a;if(d.value!==void 0&&(typeof d.value!="string"||d.value.trim()===""))return`color.value ${JSON.stringify(d.value)} is not a CSS colour such as "#000000"`;const h=x("color.opacity",d.opacity,0,1);if(h)return h}}}export function transitionSpec(t){return typeof t=="string"?{type:t}:t}const l=(t,n)=>[{t:0,v:t},{t:1,v:n}],g=(t,n)=>t.every(o=>Math.abs(o.v-n)<1e-9);function N(t){const n={};if(!t)return n;const o=(e,r,i)=>{const c=r===void 0?void 0:$(r);c&&!g(c,i)&&(n[e]=c)};o("x",t.x,0),o("y",t.y,0),o("scale",t.scale,1),o("opacity",t.opacity,1);for(const e of S)o(e,t.clip?.[e],0);return n}const O=t=>t==="transparent"||/^#[0-9a-f]{6}00$/i.test(t);export function transitionKeys(t,n){const o=n.transparent?{add:!0}:{};switch(t.type){case"fade":return{out:{},in:{opacity:l(0,1)},...o};case"dip":{const e=n.color??n.background,r=[{t:0,v:0},{t:.5,v:0},{t:1,v:1}];return O(e)?{out:{opacity:[{t:0,v:1},{t:.5,v:0},{t:1,v:0}]},in:{opacity:r}}:{out:{},in:{opacity:r},color:{value:e,opacity:[{t:0,v:0},{t:.5,v:1},{t:1,v:1}]}}}case"slide":case"push":{const e=t.direction??TRANSITION_DEFAULTS.direction,r=e==="left"||e==="right",i=e==="left"||e==="up"?1:-1,c=s=>r?{x:s}:{y:s};return{out:t.type==="push"?c(l(0,-i)):{},in:c(l(i,0))}}case"wipe":{const e=t.direction??TRANSITION_DEFAULTS.direction,r=l(1,0);return{out:{},in:e==="left"?{left:r}:e==="right"?{right:r}:e==="up"?{top:r}:{bottom:r}}}case"zoom":{const e=t.scale??TRANSITION_DEFAULTS.scale,r=t.from??e;return{out:{scale:l(1,e)},in:{...Math.abs(r-1)<1e-9?{}:{scale:l(r,1)},opacity:l(0,1)},...o}}case"custom":{const e=t.color===void 0?void 0:$(t.color.opacity),r=n.color??n.background;return{out:N(t.out),in:N(t.in),...e&&!g(e,0)&&!O(r)?{color:{value:r,opacity:e}}:{}}}}}export function transitionWindow(t,n,o,e){const r=Math.max(1,Math.round((t.dur??TRANSITION_DEFAULTS.dur)*n)),i=Math.min(Math.max(t.split??TRANSITION_DEFAULTS.split,0),1),c=Math.round(r*i);return{before:Math.max(0,Math.min(c,Math.floor(o/2))),after:Math.max(0,Math.min(r-c,Math.floor(e/2)))}}export function windowFrames(t,n){const o=Math.round(t.start*n);return{first:o,frames:Math.round(t.end*n)-o,join:Math.round(t.at*n)}}export function transitionAt(t,n,o){if(!t||t.length===0)return;const e=Math.floor(n*o+1e-6);return t.find(r=>e>=Math.round(r.start*o)&&e<Math.round(r.end*o))}export const rawProgress=(t,n)=>Math.min(Math.max((t+1)/(n+1),0),1);export function progressAt(t,n,o){const e=windowFrames(t,o);return E(t.ease,rawProgress(n-e.first,e.frames))}const f=(t,n,o)=>t?J(t,o):n;export function pictureAt(t,n){return{x:f(t.x,0,n),y:f(t.y,0,n),scale:f(t.scale,1,n),opacity:f(t.opacity,1,n),left:f(t.left,0,n),right:f(t.right,0,n),top:f(t.top,0,n),bottom:f(t.bottom,0,n)}}export function stateAt(t,n){const o=pictureAt(t.in,n),e=pictureAt(t.out,n),r=t.add===!0;return{out:r?{...e,opacity:1-o.opacity}:e,in:o,...t.color?{color:{value:t.color.value,opacity:f(t.color.opacity,0,n)}}:{},add:r}}export function transitionState(t,n,o){return stateAt(t.keys,progressAt(t,n,o))}export function pictureOffset(t,n,o){return[Math.floor(t.x*n+.5),Math.floor(t.y*o+.5)]}const p=t=>{const n=(Math.round(t*1e4)/1e4).toString();return n==="-0"?"0":n};export function pictureCss(t,n,o){const[e,r]=pictureOffset(t,n,o),i=e!==0||r!==0,c=Math.abs(t.scale-1)>1e-9,s=t.left>0||t.right>0||t.top>0||t.bottom>0;return{transform:`${i?`translate(${String(e)}px, ${String(r)}px)`:""}${i&&c?" ":""}${c?`scale(${p(t.scale)})`:""}`,opacity:t.opacity>=1?"":p(Math.max(0,t.opacity)),clipPath:s?`inset(${p(t.top*o)}px ${p(t.right*n)}px ${p(t.bottom*o)}px ${p(t.left*n)}px)`:""}}const y=t=>{const n=(Math.round(t*1e6)/1e6).toFixed(6).replace(/\.?0+$/,"");return n==="-0"||n===""?"0":n};export function progressExpr(t,n,o,e=0){const r=`((${o}+${String(e+1)})/${String(n+1)})`;return t==="linear"?r:`(${A(t,r)})`}export function channelExpr(t,n,o){if(!t||t.length===0)return y(n);const[e,r]=t;return t.length===2&&e&&r&&e.t===0&&r.t===1&&r.ease===void 0?Math.abs(r.v-e.v)<1e-9?y(e.v):`(${y(e.v)}+${y(r.v-e.v)}*${o})`:T(t,o)}export const channelActive=(t,n)=>t!==void 0&&!g(t,n),channelMin=(t,n)=>t?Math.min(...t.map(o=>o.v)):n;export function heldTime(t,n,o){if(n>=t.start&&n<t.end-.5/o)return n;const e=Math.round(t.start*o),r=Math.max(e,Math.round(t.end*o)-1),i=Math.min(Math.max(Math.round(n*o),e),r);return i===e?t.start:i/o}export function extendFootage(t,n,o){const e=t.cuts?.[0],r=e?Math.max(n,t.start-Math.max(0,e.from)):n;if(r===t.start&&o===t.end)return t;const i=t.start-r;return{...t,start:r,end:o,from:e?e.from-i:t.from-i*t.speed,...t.cuts&&e?{cuts:[{at:r,from:e.from-i},...t.cuts.slice(1)]}:{}}}export function withHandles(t,n,o,e){if(!o||o.length===0)return[...t];const r=(i,c)=>Math.round(i*e)===Math.round(c*e);return t.map(i=>{const c=n.find(m=>m.key===i.part);if(!c)return i;const s=o.find(m=>m.part===i.part),a=o.find(m=>m.from===i.part),d=s&&r(i.start,c.start)&&s.start<i.start?s.start:i.start,h=a&&r(i.end,c.end)&&a.end>i.end?a.end:i.end;return extendFootage(i,d,h)})}export function transitionLabel(t){const n=`${String(Math.round((t.end-t.start)*1e3)/1e3)} s`,o=t.direction!==void 0?` ${t.direction}`:t.scale!==void 0?` ×${String(t.scale)}`:t.keys.color?` ${t.keys.color.value}`:"";return`${t.type}${o} ${n}`}
@@ -0,0 +1,175 @@
1
+ import type { Word } from "./media.js";
2
+ /** Seconds between two frames. */
3
+ export declare const VOICE_HOP = 0.01;
4
+ /**
5
+ * A take's sound, frame by frame: frame f is centred on f × hop seconds.
6
+ * `db` is the level in dBFS (rounded, −120 to 0); `voicing` how periodic
7
+ * the frame is, 0 to 100 (a voice is, a breath or a hiss is not).
8
+ */
9
+ export interface VoiceFrames {
10
+ hop: number;
11
+ db: Uint8Array;
12
+ voicing: Uint8Array;
13
+ }
14
+ /** The level of frame f in dBFS (−120 past the end). */
15
+ export declare function frameDb(frames: Pick<VoiceFrames, "db">, f: number): number;
16
+ /**
17
+ * Measures mono samples (any rate, 16 kHz is plenty): each frame's level
18
+ * and voicing, the latter the strongest normalized autocorrelation over the
19
+ * lags of a 70–400 Hz pitch.
20
+ */
21
+ export declare function measureVoice(samples: Float32Array, rate: number): VoiceFrames;
22
+ /** A take's level per frame as the media value carries it: base64 of −dB per 10 ms. */
23
+ export type Envelope = string;
24
+ /** The level frames of an envelope. */
25
+ export declare function envelopeFrames(envelope: Envelope): Pick<VoiceFrames, "db" | "hop">;
26
+ /**
27
+ * The quietest moment in [lo, hi] (seconds of the file): the centre of the
28
+ * frame with the lowest level, the one nearest `t` among equals; `t`
29
+ * itself (clamped) when no frame's centre is inside.
30
+ */
31
+ export declare function quietest(frames: Pick<VoiceFrames, "db" | "hop">, t: number, lo: number, hi: number): number;
32
+ /**
33
+ * A stretch between words where the take is not silent: something said
34
+ * that is not a word (a filler, a hum, a false start's sound) or a breath.
35
+ * Seconds of the file.
36
+ */
37
+ export interface UnheardSound {
38
+ start: number;
39
+ end: number;
40
+ /** Its loudest frame, dB against the take's speech level (the median frame inside words). */
41
+ peak: number;
42
+ /** Its mean frame level, dB against the speech level. */
43
+ mean: number;
44
+ /** The share of its frames that are voiced (periodic, like a vowel or a hum), 0 to 1. */
45
+ voiced: number;
46
+ /** The index of the word before it (−1: before the first word). */
47
+ after: number;
48
+ }
49
+ /**
50
+ * A stretch between words above the take's noise floor (`all`), measured
51
+ * whether or not the thresholds report a sound in it.
52
+ */
53
+ export interface SoundStretch extends UnheardSound {
54
+ /** Its loudest frame, dB above the take's noise floor. */
55
+ aboveFloor: number;
56
+ /** Whether it holds a sound the thresholds report (`sounds`). */
57
+ passes: boolean;
58
+ }
59
+ /** What counts as a sound between words. */
60
+ export interface UnheardOptions {
61
+ /** A frame is sound when at most this many dB below the take's speech level. */
62
+ within: number;
63
+ /** …and at least this many dB above the take's noise floor (its quietest tenth of frames). */
64
+ aboveFloor: number;
65
+ /** Stretches shorter than this, seconds, are not reported. */
66
+ shortest: number;
67
+ /** A frame counts as voiced from this voicing, 0 to 1. */
68
+ voiced: number;
69
+ }
70
+ /** The thresholds the build measures every take with (the media index's `sounds`). */
71
+ export declare const UNHEARD_DEFAULTS: Readonly<UnheardOptions>;
72
+ /** What a take's measured sound says about it. */
73
+ export interface TakeSound {
74
+ /** The median level of the frames inside words, dBFS. */
75
+ speech: number;
76
+ /** The take's noise floor: the level of its quietest tenth of frames, dBFS. */
77
+ floor: number;
78
+ /** The thresholds used. */
79
+ options: UnheardOptions;
80
+ sounds: UnheardSound[];
81
+ /** With `all`: every stretch between words above the floor, each marked whether it passes. */
82
+ stretches?: SoundStretch[];
83
+ }
84
+ /**
85
+ * The stretches of sound in a take where no word was heard: in each gap
86
+ * between words (and before the first, after the last), frames at most
87
+ * `within` dB (default 22) under the take's speech level and `aboveFloor`
88
+ * dB (default 8) over its noise floor, less what runs on from the words
89
+ * on either side, joined across short silences, at least `shortest`
90
+ * seconds (default 0.1) long. Each is measured, never judged: a voiced
91
+ * stretch is likely a filler or a hesitation, an unvoiced one a breath.
92
+ * With `all`, also every stretch above the noise floor at all, found the
93
+ * same way, each marked whether it holds a reported sound.
94
+ */
95
+ export declare function unheardSounds(words: readonly Word[], frames: VoiceFrames, opts?: Partial<UnheardOptions> & {
96
+ all?: boolean;
97
+ }): TakeSound;
98
+ /**
99
+ * The noise floor of a stretch of the file: the mean power of the quietest
100
+ * quarter of its 10 ms frames (at least three), dBFS, so a breath or a
101
+ * word's first frames in it do not count. Undefined with fewer than
102
+ * `least` frames in it (three by default: 30 ms is too little to call a
103
+ * level).
104
+ */
105
+ export declare function floorLevel(frames: Pick<VoiceFrames, "db" | "hop">, from: number, to: number, least?: number): number | undefined;
106
+ /** How a room tone fill is matched to the take beside it, when the take does not say. */
107
+ export declare const ROOM_MATCH: {
108
+ /** Seconds on each side of the join whose floor is measured: of the fill, and of the take's kept sound. */
109
+ readonly near: 0.3;
110
+ /**
111
+ * The least of its own room the take must keep at the join for its
112
+ * floor there to be measured, seconds: less is a word's edge, not a room.
113
+ */
114
+ readonly least: 0.1;
115
+ /** Seconds the fill and the take cross-fade over at the join. */
116
+ readonly fade: 0.04;
117
+ /**
118
+ * The most a matched gain raises or lowers the fill, dB: a floor read
119
+ * too high (a breath, a word's tail in the room beside the join) must
120
+ * not turn the fill into a burst of noise.
121
+ */
122
+ readonly limitDb: 6;
123
+ };
124
+ /** How a room tone fill's level was set at the join it meets. */
125
+ export interface RoomLevel {
126
+ /**
127
+ * The floor of the room tone the fill plays next to the join, dBFS (a
128
+ * room tone stretch is not perfectly steady, so it is measured where it
129
+ * meets the take); null when it could not be measured.
130
+ */
131
+ level: number | null;
132
+ /**
133
+ * The floor of the take's kept sound next to the join (the room it keeps
134
+ * before its first word or after its last), dBFS; null when it keeps
135
+ * under ROOM_MATCH.least seconds of it, or the take's levels are unknown.
136
+ */
137
+ floor: number | null;
138
+ /** The gain the fill plays at, dB. */
139
+ gainDb: number;
140
+ /**
141
+ * Where the gain came from: `matched` (floor − level), `given` (the
142
+ * take's roomTone({ gainDb })), `off` (matching turned off) or
143
+ * `unmeasured` (a level is missing: the fill plays as recorded).
144
+ */
145
+ from: "matched" | "given" | "off" | "unmeasured";
146
+ /** The matched gain was more than the limit allows and is held at it. */
147
+ limited?: true;
148
+ }
149
+ /**
150
+ * The gain that brings room tone to the floor of the take `beside` a join:
151
+ * `played` is the stretch of room tone the fill plays next to the join,
152
+ * `beside` the take's own kept sound on the other side of it, both in
153
+ * seconds of the same file. The gain is floor − level, held within
154
+ * ±`limitDb`. Mechanics, not taste: the fill should not step in noise
155
+ * against the sound it meets. A missing level leaves the fill as recorded,
156
+ * and says so.
157
+ */
158
+ export declare function matchRoom(frames: Pick<VoiceFrames, "db" | "hop"> | undefined, played: {
159
+ from: number;
160
+ to: number;
161
+ }, beside: {
162
+ from: number;
163
+ to: number;
164
+ }, limitDb?: number): RoomLevel;
165
+ /**
166
+ * The take's room tone: its longest stretch of frames within 6 dB of its
167
+ * quietest tenth (at least 0.2 s), to fill a part's lead and tail where the
168
+ * take has no silence of its own there. Seconds of the file, undefined when
169
+ * the take has no such stretch.
170
+ */
171
+ export declare function roomTone(frames: Pick<VoiceFrames, "db" | "hop">): {
172
+ from: number;
173
+ to: number;
174
+ } | undefined;
175
+ //# sourceMappingURL=voice.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ export const VOICE_HOP=.01;const K=.03,X=70,Y=400,Z=-65,G=t=>Math.min(120,Math.max(0,Math.round(-t)));export function frameDb(t,n){const i=t.db[n];return i===void 0?-120:-i}export function measureVoice(t,n){const i=Math.round(.01*n),l=Math.round(.03*n),e=Math.floor(l/2),h=Math.max(1,Math.floor(n/400)),r=Math.ceil(n/70),c=Math.max(0,Math.ceil(t.length/i)),p=new Uint8Array(c),s=new Uint8Array(c),f=d=>d>=0&&d<t.length?t[d]??0:0,g=new Float32Array(l+r);for(let d=0;d<c;d++){const P=d*i-e;let T=0;for(let u=0;u<l;u++)T+=f(P+u);T/=l;for(let u=0;u<l+r;u++)g[u]=f(P+u)-T;let H=0;for(let u=0;u<l;u++){const I=g[u]??0;H+=I*I}const C=10*Math.log10(H/l+1e-12);if(p[d]=G(C),C<-65)continue;let D=0;for(let u=h;u<=r;u++){let I=0,w=0;for(let o=0;o<l;o++){const a=g[o+u]??0;I+=(g[o]??0)*a,w+=a*a}const R=I/Math.sqrt(H*w+1e-12);R>D&&(D=R)}s[d]=Math.round(Math.min(1,Math.max(0,D))*100)}return{hop:.01,db:p,voicing:s}}export function envelopeFrames(t){return{hop:.01,db:Uint8Array.from(atob(t),n=>n.charCodeAt(0))}}export function quietest(t,n,i,l){const e=s=>Math.min(Math.max(s,i),l);if(!(l>=i))return n;const h=Math.ceil(i/t.hop-1e-9),r=Math.floor(l/t.hop+1e-9);let c,p=1/0;for(let s=Math.max(0,h);s<=r&&s<t.db.length;s++){const f=frameDb(t,s),g=s*t.hop;(f<p||f===p&&c!==void 0&&Math.abs(g-n)<Math.abs(c-n))&&(c=g,p=f)}return e(c===void 0?n:Math.round(c*1e3)/1e3)}export const UNHEARD_DEFAULTS={within:22,aboveFloor:8,shortest:.1,voiced:.6};const Q=.15,j=.04,U=t=>Math.round(t*1e3)/1e3,m=t=>Math.round(t*10)/10;export function unheardSounds(t,n,i={}){const l={within:i.within??UNHEARD_DEFAULTS.within,aboveFloor:i.aboveFloor??UNHEARD_DEFAULTS.aboveFloor,shortest:i.shortest??UNHEARD_DEFAULTS.shortest,voiced:i.voiced??UNHEARD_DEFAULTS.voiced},e=n.hop,h=n.db.length,r=o=>Math.round(o/e),c=[];for(const o of t)for(let a=r(o.start);a<r(o.end)&&a<h;a++)c.push(frameDb(n,a));c.sort((o,a)=>o-a);const p=c.length?c[Math.floor(c.length/2)]??-120:-120,s=Array.from(n.db,o=>-o).sort((o,a)=>o-a),f=s[Math.floor(s.length*.1)]??-120,g=Math.round(l.voiced*100),d=o=>(n.voicing[o]??0)>=g,P=Math.round(Q/e),T=Math.round(j/e),H=(o,a)=>({speech:m(p),floor:m(f),options:l,sounds:o,...a?{stretches:a}:{}});if(t.length===0)return H([],i.all?[]:void 0);const C=[{a:0,b:t[0]?.start??0,after:-1}];for(let o=0;o+1<t.length;o++)C.push({a:t[o]?.end??0,b:t[o+1]?.start??0,after:o});C.push({a:t.at(-1)?.end??0,b:h*e,after:t.length-1});const D=(o,a)=>{const v=M=>M>=0&&M<h&&frameDb(n,M)>=o,b=[];for(const M of C){const _=Math.max(0,r(M.a)),E=Math.min(h,r(M.b));if(E<=_||E-_<a/e-1e-9)continue;let F=0;if(M.after>=0)for(;F<P&&_+F<E&&v(_+F);)F++;let L=0;if(M.after+1<t.length)for(;L<P&&E-1-L>=_+F&&v(E-1-L);)L++;const k=_+F,V=E-L;let A=k;for(;A<V;){if(!v(A)){A++;continue}let y=A,B=A,N=0;for(;y<V;){if(v(y))B=y,N=0;else if(++N>T)break;y++}let x=A,O=B+1;A=y;let q=-120;for(let W=x;W<O;W++)q=Math.max(q,frameDb(n,W));if(O===V&&L>0&&d(O-1))for(;O<E&&d(O)&&frameDb(n,O)<=q+3;)O++;if(x===k&&F>0&&d(x))for(;x>_&&d(x-1)&&frameDb(n,x-1)<=q+3;)x--;(O-x)*e<a-1e-9||b.push({a:x,b:O,after:M.after})}}return b},u=o=>{let a=0,v=0,b=-120;for(let M=o.a;M<o.b;M++)d(M)&&a++,v+=frameDb(n,M),b=Math.max(b,frameDb(n,M));return{sound:{start:U(o.a*e),end:U(o.b*e),peak:m(b-p),mean:m(v/(o.b-o.a)-p),voiced:Math.round(a/(o.b-o.a)*100)/100,after:o.after},top:b}},I=Math.max(p-l.within,f+l.aboveFloor),w=D(I,l.shortest).map(o=>u(o).sound);if(i.all!==!0)return H(w);const R=D(f+1,e).map(o=>{const{sound:a,top:v}=u(o);return{...a,aboveFloor:m(v-f),passes:w.some(b=>b.start<a.end&&b.end>a.start)}});return H(w,R)}const z=.25,S=3;export function floorLevel(t,n,i,l=S){const e=Math.max(0,Math.ceil(n/t.hop-1e-9)),h=Math.min(t.db.length,Math.ceil(i/t.hop-1e-9)),r=[];for(let s=e;s<h;s++)r.push(frameDb(t,s));if(r.length<Math.max(S,l))return;r.sort((s,f)=>s-f);const c=r.slice(0,Math.max(S,Math.ceil(r.length*z))),p=c.reduce((s,f)=>s+10**(f/10),0)/c.length;return m(10*Math.log10(p+1e-12))}export const ROOM_MATCH={near:.3,least:.1,fade:.04,limitDb:6};export function matchRoom(t,n,i,l=ROOM_MATCH.limitDb){const e=t?floorLevel(t,n.from,n.to):void 0,h=t?floorLevel(t,i.from,i.to,Math.round(ROOM_MATCH.least/t.hop)):void 0;if(e===void 0||h===void 0)return{level:e??null,floor:h??null,gainDb:0,from:"unmeasured"};const r=h-e,c=m(Math.min(l,Math.max(-l,r)));return{level:e,floor:h,gainDb:c,from:"matched",...c===m(r)?{}:{limited:!0}}}const J=6;export function roomTone(t){const n=t.db.length;if(n===0)return;const l=Array.from(t.db,r=>-r).sort((r,c)=>r-c)[Math.floor(n*.1)]??-120;let e,h=-1;for(let r=0;r<=n;r++){const c=r<n&&frameDb(t,r)<=l+J;c&&h<0&&(h=r),!c&&h>=0&&((!e||r-h>e[1]-e[0])&&(e=[h,r]),h=-1)}if(!(!e||(e[1]-e[0])*t.hop<.2))return{from:U((e[0]+1)*t.hop),to:U((e[1]-1)*t.hop)}}
@@ -0,0 +1,128 @@
1
+ import type { Word } from "./media.js";
2
+ /** Case, accents and punctuation removed; letters and digits kept. */
3
+ export declare function normText(s: string): string;
4
+ export declare class WordStream {
5
+ readonly text: string;
6
+ /** For every character of `text`, the index of the word it belongs to. */
7
+ private readonly owner;
8
+ /** For every word, where it starts in `text`. */
9
+ private readonly wordStart;
10
+ readonly words: readonly Word[];
11
+ constructor(words: readonly Word[]);
12
+ /** The word a character of `text` belongs to. */
13
+ wordAt(pos: number): number;
14
+ /** Character offset where word `i` starts (the end of the text past the last word). */
15
+ charOf(i: number): number;
16
+ /**
17
+ * The word where the `nth` match of `needle` starts, searching the
18
+ * characters of words [fromWord, toWord]. Latin needles must start at the
19
+ * start of a word; CJK needles may start anywhere. -1 when not found.
20
+ */
21
+ find(needle: string, fromWord: number, toWord: number, nth?: number): number;
22
+ /**
23
+ * The first and last word of the `nth` match of `needle` in words
24
+ * [fromWord, toWord], with the rules of find(); undefined when not found.
25
+ */
26
+ span(needle: string, fromWord: number, toWord: number, nth?: number): {
27
+ first: number;
28
+ last: number;
29
+ } | undefined;
30
+ }
31
+ /**
32
+ * Some of a take's words (those not in `skip`, such as the words its edits
33
+ * remove), as one stream to search, with the way back to the take's own
34
+ * word indices. A phrase found here is said by kept words only, so a cut
35
+ * take is searched as it plays.
36
+ */
37
+ export declare class WordView {
38
+ /** The take's index of each word in the view. */
39
+ readonly index: readonly number[];
40
+ readonly stream: WordStream;
41
+ constructor(words: readonly Word[], skip?: ReadonlySet<number>);
42
+ /** The view's first word at or after the take's word `i` (the view's length past the end). */
43
+ at(i: number): number;
44
+ /** The take's index of the view's word `v`. */
45
+ take(v: number): number;
46
+ /** Where a line is said in the view's words from the take's word `from` on, in the take's indices. */
47
+ findLine(line: string, from?: number): LineMatch | undefined;
48
+ /** The nth match of a phrase in the view's words between the take's words `from` and `to`, in the take's indices. */
49
+ span(needle: string, from: number, to: number, nth?: number): {
50
+ first: number;
51
+ last: number;
52
+ } | undefined;
53
+ }
54
+ /**
55
+ * The script (a part's line, as spoken) aligned to what the take actually
56
+ * says, character by character. Recognition makes mistakes (digits for
57
+ * numerals, homophones, a brand name spelled wrong); the script is the
58
+ * truth, so every script character gets a place in the take: matched ones
59
+ * directly, the rest interpolated between their neighbours (the script
60
+ * wins, missing words are interpolated).
61
+ *
62
+ * Global edit-distance alignment over a band around the diagonal: matching
63
+ * characters cost 0, a substitution, a missing or an extra character 1.
64
+ */
65
+ export declare class ScriptAlignment {
66
+ private readonly stream;
67
+ /** Each line, normalized. */
68
+ readonly lines: string[];
69
+ private readonly offsets;
70
+ /** Script character → take character, or -1 when not aligned. */
71
+ private readonly map;
72
+ /**
73
+ * Per line, how many of its characters matched exactly inside a run of at
74
+ * least 3 that is also consecutive in the take. Scattered single-letter
75
+ * matches happen by chance; runs do not.
76
+ */
77
+ readonly matched: number[];
78
+ /** Take character → 1 when a script character matched it exactly. */
79
+ readonly takeHits: Uint8Array;
80
+ constructor(stream: WordStream, lines: readonly string[]);
81
+ /** Where script character i is in the take (interpolated if unaligned). */
82
+ private textPos;
83
+ /** The take's word where character `pos` of line k (normalized) is said. */
84
+ wordAtChar(k: number, pos: number): number;
85
+ /** The take's word where line k starts. */
86
+ lineStart(k: number): number;
87
+ /** The take's word where the nth `ref` in line k is said; -1 if the line does not have it. */
88
+ wordFor(k: number, ref: string, nth?: number): number;
89
+ }
90
+ /** Where a line is said in a take: its first and last word. */
91
+ export interface LineMatch {
92
+ first: number;
93
+ last: number;
94
+ /** Characters of the line matched in runs of 3 or more, over its length (0 to 1). */
95
+ score: number;
96
+ }
97
+ /** A line counts as found in a take when this much of it matched. */
98
+ export declare const LINE_FOUND = 0.4;
99
+ /**
100
+ * Where a line is said in a take, from word `fromWord` on: the stretch whose
101
+ * text is closest to the line. Edit-distance alignment where the take may
102
+ * start and end anywhere (the line must be said whole), so recognition
103
+ * errors are tolerated the way ScriptAlignment tolerates them. Undefined
104
+ * when the line or what is left of the take is empty.
105
+ */
106
+ export declare function findLine(stream: WordStream, line: string, fromWord?: number): LineMatch | undefined;
107
+ /** The stretches of a take that read most like a phrase that is not in it, best first. */
108
+ export declare function nearestPhrases(words: readonly Word[], phrase: string, count?: number): string[];
109
+ /** Words as text: spaces between them, none between two CJK words. */
110
+ export declare function joinWords(words: readonly Word[]): string;
111
+ export interface ParsedWordRef {
112
+ text: string;
113
+ nth: number;
114
+ shift: number;
115
+ }
116
+ /** "deposit", "deposit@2", "deposit-0.35", "deposit@2+0.1". */
117
+ export declare function parseWordRef(ref: string): ParsedWordRef;
118
+ /** A numeric ref: a number, or a string that is only a number ("1.8"). */
119
+ export declare function numericRef(ref: unknown): number | undefined;
120
+ /**
121
+ * A cut at `at` seconds put on the frame grid without going into a word:
122
+ * the nearest frame, unless that frame is inside a word the moment asked
123
+ * for is not inside (a cut at a word's start or end), then the frame on
124
+ * the asked moment's side of that word. A moment asked for inside a word
125
+ * stays there (the `cut-in-word` fact reports it). Within 0 and `total`.
126
+ */
127
+ export declare function cutOnFrame(at: number, fps: number, words: readonly Pick<Word, "start" | "end">[], total: number): number;
128
+ //# sourceMappingURL=words.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ const N=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;export function normText(r){return r.normalize("NFKD").replace(/\p{M}/gu,"").toLowerCase().replace(/[^\p{L}\p{N}]/gu,"")}export class WordStream{text;owner=[];wordStart=[];words;constructor(t){this.words=t;let i="";t.forEach((s,n)=>{const e=normText(s.text);this.wordStart.push(i.length),this.owner.push(...new Array(e.length).fill(n)),i+=e}),this.text=i}wordAt(t){const i=Math.min(Math.max(t,0),this.owner.length-1);return this.owner[i]??0}charOf(t){return this.wordStart[t]??this.text.length}find(t,i,s,n=1){if(!t)return-1;const e=this.charOf(i),a=this.charOf(s+1),h=N.test(t);let c=0,l=this.text.indexOf(t,e);for(;l>=0&&l+t.length<=a;){const d=this.owner[l];if(d!==void 0&&(h||this.wordStart[d]===l)&&(c++,c===n))return d;l=this.text.indexOf(t,l+1)}return-1}span(t,i,s,n=1){if(!t)return;const e=this.charOf(i),a=this.charOf(s+1),h=N.test(t);let c=0,l=this.text.indexOf(t,e);for(;l>=0&&l+t.length<=a;){const d=this.owner[l];if(d!==void 0&&(h||this.wordStart[d]===l)&&(c++,c===n))return{first:d,last:this.wordAt(l+t.length-1)};l=this.text.indexOf(t,l+1)}}}export class WordView{index;stream;constructor(t,i=new Set){const s=[];t.forEach((n,e)=>{i.has(e)||s.push(e)}),this.index=s,this.stream=new WordStream(s.map(n=>t[n]??{text:"",start:0,end:0}))}at(t){let i=0,s=this.index.length;for(;i<s;){const n=i+s>>1;(this.index[n]??0)<t?i=n+1:s=n}return i}take(t){return this.index[t]??this.index.at(-1)??0}findLine(t,i=0){const s=this.at(i);if(s>=this.index.length)return;const n=findLine(this.stream,t,s);return n&&{...n,first:this.take(n.first),last:this.take(n.last)}}span(t,i,s,n=1){const e=this.at(i),a=this.at(s+1)-1;if(e>a)return;const h=this.stream.span(t,e,a,n);return h&&{first:this.take(h.first),last:this.take(h.last)}}}export class ScriptAlignment{stream;lines;offsets;map;matched;takeHits;constructor(t,i){this.stream=t,this.lines=i.map(normText),this.offsets=[];let s="";for(const o of this.lines)this.offsets.push(s.length),s+=o;const n=t.text,e=s.length,a=n.length;if(this.map=new Int32Array(e).fill(-1),this.matched=this.lines.map(()=>0),this.takeHits=new Uint8Array(t.text.length),e===0||a===0)return;const h=Math.max(64,Math.ceil(.25*Math.max(e,a))),c=2*h+1,l=new Int32Array(e+1),d=new Uint8Array((e+1)*c),A=1<<29,O=o=>Math.round(o*a/e);let I=new Int32Array(c).fill(A),M=0;for(let o=0;o<=e;o++){const f=Math.max(0,O(o)-h),S=Math.min(a,O(o)+h);l[o]=f;const g=new Int32Array(c).fill(A);for(let x=f;x<=S;x++){const m=x-f;if(o===0){g[m]=x,d[m]=2;continue}if(x===0){g[m]=o,d[o*c+m]=1;continue}const k=E=>{const v=E-M;return v>=0&&v<c?I[v]??A:A},C=k(x-1)+(s[o-1]===n[x-1]?0:1),j=k(x)+1,H=m>0?(g[m-1]??A)+1:A;let L=C,b=0;j<L&&(L=j,b=1),H<L&&(L=H,b=2),g[m]=L,d[o*c+m]=b}I=g,M=f}const w=new Uint8Array(e);let p=e,y=a;for(;p>0&&y>0;){const o=d[p*c+(y-(l[p]??0))];o===0?(s[p-1]===n[y-1]&&(w[p-1]=1,this.takeHits[y-1]=1),this.map[p-1]=y-1,p--,y--):o===1?p--:y--}let u=0;for(let o=0;o<e;){let f=o;for(;f+1<e&&w[o]===1&&w[f+1]===1&&(this.map[f+1]??-1)===(this.map[f]??-1)+1;)f++;if(w[o]===1&&f-o+1>=3)for(let S=o;S<=f;S++){for(;u+1<this.offsets.length&&(this.offsets[u+1]??e)<=S;)u++;this.matched[u]=(this.matched[u]??0)+1}o=f+1}this.lines.forEach((o,f)=>{if(o.length===0||o.length>=3)return;const S=this.offsets[f]??0;let g=!0;for(let x=S;x<S+o.length;x++)w[x]!==1&&(g=!1);g&&(this.matched[f]=o.length)})}textPos(t){const i=this.map.length,s=this.map[t]??-1;if(s>=0)return s;let n=t-1;for(;n>=0&&(this.map[n]??-1)<0;)n--;let e=t+1;for(;e<i&&(this.map[e]??-1)<0;)e++;const a=n>=0?this.map[n]??0:0,h=e<i?this.map[e]??0:this.stream.text.length-1,c=n>=0?n:-1,l=e<i?e:i;return Math.round(a+(t-c)*(h-a)/(l-c))}wordAtChar(t,i){const s=this.lines[t]??"",n=Math.max(0,Math.min(i,Math.max(0,s.length-1)));return this.stream.wordAt(this.textPos((this.offsets[t]??0)+n))}lineStart(t){return this.stream.wordAt(this.textPos(this.offsets[t]??0))}wordFor(t,i,s=1){const n=normText(i),e=this.lines[t]??"";if(!n)return-1;let a=-1;for(let h=0;h<s;h++)if(a=e.indexOf(n,a+1),a<0)return-1;return this.stream.wordAt(this.textPos((this.offsets[t]??0)+a))}}function F(r,t,i){let s=0;for(let n=0;n<i;){let e=n;for(;e+1<i&&r[n]===1&&r[e+1]===1&&(t[e+1]??-1)===(t[e]??-1)+1;)e++;r[n]===1&&e-n+1>=3&&(s+=e-n+1),n=e+1}return i>0&&i<3&&r.every(n=>n===1)?i:s}export const LINE_FOUND=.4;const U=4e7;export function findLine(r,t,i=0){const s=normText(t),n=r.charOf(i),e=s.length,a=Math.min(r.text.length-n,Math.max(1,Math.floor(U/(e+1))));if(e===0||a<=0)return;const h=r.text.slice(n,n+a),c=a+1,l=new Uint8Array((e+1)*c);let d=new Int32Array(c);for(let u=1;u<=e;u++){const o=new Int32Array(c);o[0]=u,l[u*c]=1;for(let f=1;f<=a;f++){const S=(d[f-1]??0)+(s[u-1]===h[f-1]?0:1),g=(d[f]??0)+1,x=(o[f-1]??0)+1;let m=S,k=0;g<m&&(m=g,k=1),x<m&&(m=x,k=2),o[f]=m,l[u*c+f]=k}d=o}let A=0;for(let u=1;u<=a;u++)(d[u]??0)<(d[A]??0)&&(A=u);const O=new Int32Array(e).fill(-1),I=new Uint8Array(e);let M=e,w=A;for(;M>0&&w>0;){const u=l[M*c+w];u===0?(s[M-1]===h[w-1]&&(I[M-1]=1),O[M-1]=w-1,M--,w--):u===1?M--:w--}let p=-1,y=-1;for(let u=0;u<e;u++){const o=O[u]??-1;o<0||(p<0&&(p=o),y=o)}return p<0?{first:i,last:i,score:0}:{first:r.wordAt(n+p),last:r.wordAt(n+y),score:F(I,O,e)/e}}function _(r,t){let i=Array.from({length:t.length+1},(s,n)=>n);for(let s=1;s<=r.length;s++){const n=[s];for(let e=1;e<=t.length;e++)n[e]=Math.min((i[e-1]??0)+(r[s-1]===t[e-1]?0:1),(i[e]??0)+1,(n[e-1]??0)+1);i=n}return i[t.length]??0}export function nearestPhrases(r,t,i=3){const s=normText(t);if(!s||r.length===0)return[];const n=Math.max(1,N.test(t)?1:t.trim().split(/\s+/u).length),e=[];for(let h=0;h+n<=r.length;h++){const c=joinWords(r.slice(h,h+n));e.push({text:c,d:_(s,normText(c))})}e.sort((h,c)=>h.d-c.d);const a=[];for(const h of e)if(a.includes(h.text)||a.push(h.text),a.length>=i)break;return a}export function joinWords(r){let t="";for(const i of r){const s=i.text.trim();if(!s)continue;const n=t===""||N.test(t.slice(-1))&&N.test(s.charAt(0))?"":" ";t+=n+s}return t}export function parseWordRef(r){const t=/^(.+?)(?:@(\d+))?([+-]\d*\.?\d+)?$/su.exec(r.trim());return t?{text:t[1]??r,nth:t[2]===void 0?1:Number(t[2]),shift:t[3]===void 0?0:Number(t[3])}:{text:r,nth:1,shift:0}}export function numericRef(r){if(typeof r=="number"&&Number.isFinite(r))return r;if(typeof r=="string"&&/^\s*-?\d*\.?\d+\s*$/.test(r))return Number(r)}export function cutOnFrame(r,t,i,s){const n=c=>Math.min(Math.max(c,0),s),e=c=>i.find(l=>l.start<c-1e-6&&l.end>c+1e-6),a=n(Math.round(r*t)/t),h=e(a);return!h||e(r)===h?a:n(r<=h.start+1e-6?Math.floor(h.start*t+1e-6)/t:Math.ceil(h.end*t-1e-6)/t)}
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@allyhub-next/video-core",
3
+ "version": "0.2.0-next.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "default": "./dist/index.js"
9
+ }
10
+ },
11
+ "sideEffects": false,
12
+ "private": true,
13
+ "license": "SEE LICENSE IN LICENSE.md"
14
+ }