@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,136 @@
1
+ import { type ResolvedCamera } from "./camera.js";
2
+ import { type Px } from "./screen.js";
3
+ import type { Vec3 } from "./vec.js";
4
+ /** A sensor that films the scenery layer (scenery({ sensor })). */
5
+ export interface SensorOptions {
6
+ /** Photosites across the frame's longer side (a 12 MP phone's 4:3 sensor, cropped to 16:9: 4032). */
7
+ photosites?: number;
8
+ /** The lens's own blur, a Gaussian's standard deviation in photosites. */
9
+ lens?: number;
10
+ /** How strong the moiré is, a share of what the model gives (0: none). */
11
+ moire?: number;
12
+ /**
13
+ * How much of the false colour the phone's processing leaves (0: bands of
14
+ * light and dark only; 1: as the Bayer grid made them).
15
+ */
16
+ chroma?: number;
17
+ /**
18
+ * The lens's barrel (negative) or pincushion (positive) distortion before
19
+ * the phone corrects the picture, k1 over the frame's half diagonal: the
20
+ * sensor's grid, as the corrected picture sees it, bends, and so do the
21
+ * bands.
22
+ */
23
+ distortion?: number;
24
+ }
25
+ /** A screen's physical pixels (screen({ pixels })). */
26
+ export interface PanelOptions {
27
+ /** Physical pixels per content pixel each way (a Retina laptop: 2). */
28
+ density?: number;
29
+ /** How much the dark lines between rows of pixels darken them (0–1). */
30
+ rows?: number;
31
+ }
32
+ export declare const SENSOR_DEFAULTS: {
33
+ photosites: number;
34
+ lens: number;
35
+ moire: number;
36
+ chroma: number;
37
+ distortion: number;
38
+ };
39
+ export declare const PANEL_DEFAULTS: {
40
+ density: number;
41
+ rows: number;
42
+ };
43
+ /**
44
+ * The depth a stripe a third of a pixel wide gives its fundamental,
45
+ * against its mean (2 sin(π/3) / (π/3)), half of it left by a phone's
46
+ * demosaicing: with a phone's lens (sharp to about half at the sensor's
47
+ * Nyquist), a screen at the worst distance shows bands of a fifth to a
48
+ * third of its brightness.
49
+ */
50
+ export declare const STRIPE_DEPTH: number;
51
+ /** What the moiré of one screen at one moment is drawn from. */
52
+ export interface MoireScreen {
53
+ /** The homography from the layer's px to the content's px (row-major, 3 × 3). */
54
+ inverse: number[];
55
+ /** The content's size, px. */
56
+ size: [number, number];
57
+ /** Physical pixels per content pixel. */
58
+ density: number;
59
+ /** How much the rows darken. */
60
+ rows: number;
61
+ /** Depth along the view at the content's (0, 0), and its change per content px along x and y, m. */
62
+ depth: [d0: number, dx: number, dy: number];
63
+ }
64
+ /** The camera's part: the sensor and its depth of field. */
65
+ export interface MoireCamera {
66
+ /** Layer px per photosite. */
67
+ pitch: number;
68
+ /** The lens's blur, photosites. */
69
+ lens: number;
70
+ strength: number;
71
+ /** The share of false colour left. */
72
+ chroma: number;
73
+ /** k1, and the frame's centre and half diagonal in layer px. */
74
+ distortion: {
75
+ k1: number;
76
+ centre: Px;
77
+ radius: number;
78
+ };
79
+ /**
80
+ * The circle of confusion's diameter in layer px at a depth d:
81
+ * k · |d − focus| / max(d, near); none without an aperture.
82
+ */
83
+ blur?: {
84
+ k: number;
85
+ focus: number;
86
+ near: number;
87
+ };
88
+ }
89
+ /**
90
+ * The factor per channel (red, green, blue) a layer pixel of a screen is
91
+ * multiplied by; undefined where the pixel is not on the screen.
92
+ */
93
+ export declare function moireAt(screen: MoireScreen, camera: MoireCamera, at: Px): [number, number, number] | undefined;
94
+ /**
95
+ * The deepest band at a layer pixel of a screen, of any channel and of
96
+ * the stripes or the rows: how much it darkens at its darkest (0–1, before
97
+ * the phone takes out its colour) and how far apart its bands are, layer
98
+ * px. Undefined off the screen.
99
+ */
100
+ export declare function moireBand(screen: MoireScreen, camera: MoireCamera, at: Px): {
101
+ depth: number;
102
+ period: number;
103
+ } | undefined;
104
+ /** The most screens one layer's moiré is drawn for. */
105
+ export declare const MOIRE_SCREENS = 4;
106
+ /**
107
+ * The same arithmetic for the page: a fragment shader over the layer that
108
+ * gives, at each pixel, the factors of the nearest screen there (clear
109
+ * elsewhere), to multiply what is under it by.
110
+ */
111
+ export declare const MOIRE_GLSL: string;
112
+ /** A 3 × 3 matrix's inverse (row-major); undefined when it has none. */
113
+ export declare function invert3(m: readonly number[]): number[] | undefined;
114
+ /**
115
+ * One screen's part of the moiré at a moment: its content's corners on the
116
+ * layer (top left, top right, bottom right, bottom left, layer px) and in
117
+ * the scenery, its content's size and its panel.
118
+ */
119
+ export declare function moireScreen(o: {
120
+ quad: readonly [Px, Px, Px, Px];
121
+ corners: readonly [Vec3, Vec3, Vec3, Vec3];
122
+ size: readonly [number, number];
123
+ camera: ResolvedCamera;
124
+ panel?: PanelOptions;
125
+ }): MoireScreen | undefined;
126
+ /**
127
+ * The camera's part: its sensor on a frame `frame` px (the photosites span
128
+ * its longer side) and, with an aperture, its blur on a layer `height` px
129
+ * tall (blurDiameter's frame).
130
+ */
131
+ export declare function moireCamera(camera: ResolvedCamera, frame: readonly [number, number], height: number, sensor?: SensorOptions,
132
+ /** Where the layer's box starts on the frame, px. */
133
+ origin?: Px): MoireCamera;
134
+ /** Problems with a sensor's or a panel's options, each a sentence. */
135
+ export declare function moireProblems(sensor: SensorOptions | undefined, panel: PanelOptions | undefined): string[];
136
+ //# sourceMappingURL=moire.d.ts.map
@@ -0,0 +1,93 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{blurDiameter as z}from"./camera.js";import{homography as C}from"./screen.js";export const SENSOR_DEFAULTS={photosites:4032,lens:.35,moire:1,chroma:.3,distortion:-.03},PANEL_DEFAULTS={density:2,rows:.15},STRIPE_DEPTH=2*Math.sin(Math.PI/3)/(Math.PI/3)/2;const g=2*Math.PI,P=o=>Math.abs(o)<1e-6?1:Math.sin(Math.PI*o)/(Math.PI*o);function R(o,n){if(n===1){const i=Math.round(o[0]+o[1]),t=Math.round(o[0]-o[1]);return[(i+t)/2,(i-t)/2]}return[Math.round(2*o[0])/2,Math.round(2*o[1])/2]}const T={0:[0,0],1:[1,0],2:[1,1]};function D(o,n,i,t,f,s,e){return E(o,n,i,t,f,s,e).factor}function E(o,n,i,t,f,s,e){const r=s.pitch,c=[i[0]*r,i[1]*r],d=F(t,s),h=[d[0]/r,d[1]/r],u=R(c,o),p=T[o],a=[(c[0]-u[0])/r,(c[1]-u[1])/r],m=Math.hypot(a[0],a[1]);if(m>=.5)return{factor:1,depth:0,period:1/0};const w=c[0]*c[0]+c[1]*c[1],S=Math.exp(-2*Math.PI**2*s.lens**2*w),x=e/4,b=Math.exp(-2*Math.PI**2*x**2*(i[0]*i[0]+i[1]*i[1])),y=Math.abs(P(c[0])*P(c[1])),M=Math.abs(P(a[0])*P(a[1]))*(1-2*m),l=Math.min(1,s.strength*f*S*b*y*M),v=n-g*(u[0]*h[0]+u[1]*h[1])+g*(u[0]*p[0]+u[1]*p[1]);return{factor:1-l*(1-Math.cos(v))/2,depth:l,period:m>0?1/m:1/0}}function F(o,n){const{k1:i,centre:t,radius:f}=n.distortion,s=o[0]-t[0],e=o[1]-t[1],r=(s*s+e*e)/(f*f),c=1+i*r;return[t[0]+s*c,t[1]+e*c]}const I=[.299,.587,.114];export function moireAt(o,n,i){const t=o.inverse,[f,s]=i,e=(t[6]??0)*f+(t[7]??0)*s+(t[8]??1);if(e<=0)return;const r=((t[0]??0)*f+(t[1]??0)*s+(t[2]??0))/e,c=((t[3]??0)*f+(t[4]??0)*s+(t[5]??0))/e,[d,h]=o.size;if(r<0||c<0||r>d||c>h)return;const u=[((t[0]??0)-(t[6]??0)*r)/e,((t[1]??0)-(t[7]??0)*r)/e],p=[((t[3]??0)-(t[6]??0)*c)/e,((t[4]??0)-(t[7]??0)*c)/e],a=o.density,[m,w,S]=o.depth,x=m+w*r+S*c,b=n.blur?n.blur.k*Math.abs(x-n.blur.focus)/Math.max(x,n.blur.near):0,y=[a*u[0],a*u[1]],M=[a*p[0],a*p[1]],l=[1,1,1];for(const k of[0,1,2]){const A=D(k,g*(a*r-k/3),y,i,STRIPE_DEPTH,n,b),N=D(k,g*a*c,M,i,o.rows*STRIPE_DEPTH,n,b);l[k]=A*N}const v=I[0]*l[0]+I[1]*l[1]+I[2]*l[2];return[v+n.chroma*(l[0]-v),v+n.chroma*(l[1]-v),v+n.chroma*(l[2]-v)]}export function moireBand(o,n,i){const t=o.inverse,[f,s]=i,e=(t[6]??0)*f+(t[7]??0)*s+(t[8]??1);if(e<=0)return;const r=((t[0]??0)*f+(t[1]??0)*s+(t[2]??0))/e,c=((t[3]??0)*f+(t[4]??0)*s+(t[5]??0))/e,[d,h]=o.size;if(r<0||c<0||r>d||c>h)return;const u=[((t[0]??0)-(t[6]??0)*r)/e,((t[1]??0)-(t[7]??0)*r)/e],p=[((t[3]??0)-(t[6]??0)*c)/e,((t[4]??0)-(t[7]??0)*c)/e],a=o.density,[m,w,S]=o.depth,x=m+w*r+S*c,b=n.blur?n.blur.k*Math.abs(x-n.blur.focus)/Math.max(x,n.blur.near):0;let y={depth:0,period:1/0};for(const M of[0,1,2])for(const l of[E(M,g*(a*r-M/3),[a*u[0],a*u[1]],i,STRIPE_DEPTH,n,b),E(M,g*a*c,[a*p[0],a*p[1]],i,o.rows*STRIPE_DEPTH,n,b)])l.depth>y.depth&&(y={depth:l.depth,period:l.period});return y}export const MOIRE_SCREENS=4,MOIRE_GLSL=`#version 300 es
3
+ precision highp float;
4
+ #define SCREENS ${String(MOIRE_SCREENS)}
5
+ uniform int count;
6
+ uniform mat3 inverse[SCREENS];
7
+ uniform vec2 size[SCREENS];
8
+ uniform vec2 panel[SCREENS];
9
+ uniform vec3 depth[SCREENS];
10
+ uniform vec2 layer;
11
+ uniform float pitch;
12
+ uniform float lensBlur;
13
+ uniform float strength;
14
+ uniform vec3 blur;
15
+ uniform float stripeDepth;
16
+ uniform float chroma;
17
+ uniform vec4 distortion;
18
+ out vec4 colour;
19
+ const float PI = 3.14159265358979;
20
+ const float TAU = 6.28318530717959;
21
+
22
+ float sinc(float x) { return abs(x) < 1e-6 ? 1.0 : sin(PI * x) / (PI * x); }
23
+
24
+ vec2 nearestPoint(vec2 k, int channel) {
25
+ if (channel == 1) {
26
+ float p = floor(k.x + k.y + 0.5);
27
+ float r = floor(k.x - k.y + 0.5);
28
+ return vec2(p + r, p - r) / 2.0;
29
+ }
30
+ return floor(2.0 * k + 0.5) / 2.0;
31
+ }
32
+
33
+ vec2 sensorAt(vec2 at) {
34
+ vec2 d = at - distortion.yz;
35
+ float r2 = dot(d, d) / (distortion.w * distortion.w);
36
+ return distortion.yz + d * (1.0 + distortion.x * r2);
37
+ }
38
+
39
+ float aliased(int channel, float phase, vec2 k, vec2 at, float lines, float blurPx) {
40
+ vec2 ks = k * pitch;
41
+ vec2 s = sensorAt(at) / pitch;
42
+ vec2 g = nearestPoint(ks, channel);
43
+ vec2 o = channel == 0 ? vec2(0.0) : channel == 1 ? vec2(1.0, 0.0) : vec2(1.0);
44
+ vec2 ka = (ks - g) / pitch;
45
+ float fine = length(ka);
46
+ if (fine >= 0.5) return 1.0;
47
+ float lens = exp(-2.0 * PI * PI * lensBlur * lensBlur * dot(ks, ks));
48
+ float sigma = blurPx / 4.0;
49
+ float defocus = exp(-2.0 * PI * PI * sigma * sigma * dot(k, k));
50
+ float site = abs(sinc(ks.x) * sinc(ks.y));
51
+ float outMtf = abs(sinc(ka.x) * sinc(ka.y)) * (1.0 - 2.0 * fine);
52
+ float d = min(1.0, strength * lines * lens * defocus * site * outMtf);
53
+ float psi = phase - TAU * dot(g, s) + TAU * dot(g, o);
54
+ return 1.0 - d * (1.0 - cos(psi)) / 2.0;
55
+ }
56
+
57
+ void main() {
58
+ // Layer px, from the top left, at the pixel's centre.
59
+ vec2 at = vec2(gl_FragCoord.x, layer.y - gl_FragCoord.y);
60
+ vec3 factor = vec3(1.0);
61
+ bool on = false;
62
+ float nearestDepth = 1e9;
63
+ for (int i = 0; i < SCREENS; i++) {
64
+ if (i >= count) break;
65
+ // Sent transposed: m[col][row] is the homography's row, column.
66
+ mat3 m = inverse[i];
67
+ float w = m[0][2] * at.x + m[1][2] * at.y + m[2][2];
68
+ if (w <= 0.0) continue;
69
+ float u = (m[0][0] * at.x + m[1][0] * at.y + m[2][0]) / w;
70
+ float v = (m[0][1] * at.x + m[1][1] * at.y + m[2][1]) / w;
71
+ if (u < 0.0 || v < 0.0 || u > size[i].x || v > size[i].y) continue;
72
+ float d = depth[i].x + depth[i].y * u + depth[i].z * v;
73
+ if (d >= nearestDepth) continue;
74
+ nearestDepth = d;
75
+ vec2 du = vec2(m[0][0] - m[0][2] * u, m[1][0] - m[1][2] * u) / w;
76
+ vec2 dv = vec2(m[0][1] - m[0][2] * v, m[1][1] - m[1][2] * v) / w;
77
+ float D = panel[i].x;
78
+ float blurPx = blur.x > 0.0 ? blur.x * abs(d - blur.y) / max(d, blur.z) : 0.0;
79
+ vec2 ku = D * du;
80
+ vec2 kv = D * dv;
81
+ vec3 f;
82
+ for (int c = 0; c < 3; c++) {
83
+ float stripes = aliased(c, TAU * (D * u - float(c) / 3.0), ku, at, stripeDepth, blurPx);
84
+ float rows = aliased(c, TAU * D * v, kv, at, panel[i].y * stripeDepth, blurPx);
85
+ f[c] = stripes * rows;
86
+ }
87
+ float light = dot(f, vec3(0.299, 0.587, 0.114));
88
+ factor = vec3(light) + chroma * (f - vec3(light));
89
+ on = true;
90
+ }
91
+ // Off every screen: nothing (premultiplied).
92
+ colour = on ? vec4(factor, 1.0) : vec4(0.0);
93
+ }`;export function invert3(o){const[n=0,i=0,t=0,f=0,s=0,e=0,r=0,c=0,d=1]=o,h=s*d-e*c,u=-(f*d-e*r),p=f*c-s*r,a=n*h+i*u+t*p;if(!(Math.abs(a)<1e-18))return[h/a,-(i*d-t*c)/a,(i*e-t*s)/a,u/a,(n*d-t*r)/a,-(n*e-t*f)/a,p/a,-(n*c-i*r)/a,(n*s-i*f)/a]}export function moireScreen(o){const[n,i]=o.size,t=C(n,i,o.quad),f=t?invert3(t):void 0;if(!f)return;const s=o.camera,e=u=>(u[0]-s.position[0])*s.forward[0]+(u[1]-s.position[1])*s.forward[1]+(u[2]-s.position[2])*s.forward[2],[r,c,,d]=o.corners,h=e(r);return{inverse:f,size:[n,i],density:o.panel?.density??PANEL_DEFAULTS.density,rows:o.panel?.rows??PANEL_DEFAULTS.rows,depth:[h,(e(c)-h)/n,(e(d)-h)/i]}}export function moireCamera(o,n,i,t={},f=[0,0]){const s=t.photosites??SENSOR_DEFAULTS.photosites,e={pitch:Math.max(n[0],n[1])/s,lens:t.lens??SENSOR_DEFAULTS.lens,strength:t.moire??SENSOR_DEFAULTS.moire,chroma:t.chroma??SENSOR_DEFAULTS.chroma,distortion:{k1:t.distortion??SENSOR_DEFAULTS.distortion,centre:[n[0]/2-f[0],n[1]/2-f[1]],radius:Math.hypot(n[0],n[1])/2}},r=o.dof;if(r){const c=2*r.focus,d=z(o,c,i)*Math.max(c,o.near)/Math.abs(c-r.focus);e.blur={k:d,focus:r.focus,near:o.near}}return e}export function moireProblems(o,n){const i=[],t=(s,e)=>{s!==void 0&&!(Number.isFinite(s)&&s>0)&&i.push(`${e} is a positive number, not ${String(s)}.`)};t(o?.photosites,"sensor.photosites"),t(o?.lens,"sensor.lens"),t(n?.density,"pixels.density");const f=(s,e,r)=>{s!==void 0&&!(Number.isFinite(s)&&s>=0&&s<=r)&&i.push(`${e} is from 0 to ${String(r)}, not ${String(s)}.`)};return f(o?.moire,"sensor.moire",4),f(o?.chroma,"sensor.chroma",1),o?.distortion!==void 0&&!(Number.isFinite(o.distortion)&&Math.abs(o.distortion)<=.5)&&i.push(`sensor.distortion is from -0.5 to 0.5, not ${String(o.distortion)}.`),f(n?.rows,"pixels.rows",1),i}
@@ -0,0 +1,48 @@
1
+ import type { Channel } from "./report.js";
2
+ import { type Vec3 } from "./vec.js";
3
+ /** A camera at a moment, resolved. */
4
+ export interface CameraSample {
5
+ t: number;
6
+ position: Vec3;
7
+ forward: Vec3;
8
+ up: Vec3;
9
+ right: Vec3;
10
+ /** The lens in the diagonal convention, mm. */
11
+ lens: number;
12
+ yaw: number;
13
+ pitch: number;
14
+ roll: number;
15
+ target?: Vec3;
16
+ }
17
+ export interface MotionNumbers {
18
+ length: number;
19
+ truck: Channel;
20
+ pedestal: Channel;
21
+ dolly: Channel;
22
+ pan: Channel;
23
+ tilt: Channel;
24
+ roll: Channel;
25
+ zoom: Channel;
26
+ arc?: Channel;
27
+ speed: Channel;
28
+ turn: Channel;
29
+ acceleration: Channel;
30
+ jerk: Channel;
31
+ smoothness: number | null;
32
+ step: {
33
+ distance: number;
34
+ angle: number;
35
+ at: number;
36
+ };
37
+ /** The cuts inside it, times: what is measured stops at each and starts again after. */
38
+ cuts: number[];
39
+ }
40
+ /** A channel from values at moments: its largest magnitude and when, its mean magnitude. */
41
+ export declare function channel(values: readonly number[], times: readonly number[]): Channel;
42
+ /**
43
+ * The motion of samples taken at a steady rate. A cut (a time between two
44
+ * samples) is no motion: the step across it is not measured, and neither
45
+ * acceleration nor jerk spans it; smoothness is the least smooth shot's.
46
+ */
47
+ export declare function motionOf(samples: readonly CameraSample[], cuts?: readonly number[]): MotionNumbers;
48
+ //# sourceMappingURL=motion.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{distance as V,dot as k,length as L,normalize as N,sub as j}from"./vec.js";const u=a=>Math.round(a*1e6)/1e6;export function channel(a,d){let r=0,m=d[0]??0,g=0;return a.forEach((x,h)=>{const i=Math.abs(x);g+=i,i>r&&(r=i,m=d[h]??m)}),{peak:u(r),at:u(m),mean:u(a.length>0?g/a.length:0)}}const Q=(a,d)=>{let r=d-a;for(;r>180;)r-=360;for(;r<-180;)r+=360;return r},R=(a,d)=>{const r=Math.max(-1,Math.min(1,k(N(a),N(d))));return Math.acos(r)*180/Math.PI};export function motionOf(a,d=[]){const r=a.length,m=[...d].sort((t,n)=>t-n),g=t=>m.filter(n=>n<=t).length,x=m.filter(t=>t>(a[0]?.t??0)&&t<=(a[r-1]?.t??0)),h={peak:0,at:a[0]?.t??0,mean:0};if(r<2)return{length:0,truck:h,pedestal:h,dolly:h,pan:h,tilt:h,roll:h,zoom:h,speed:h,turn:h,acceleration:h,jerk:h,smoothness:null,step:{distance:0,angle:0,at:a[0]?.t??0},cuts:x.map(u)};const i=[],T=[],q=[],B=[],C=[],D=[],F=[],G=[],S=[],_=[],H=[],y=[],M=[];let J=0,f={distance:0,angle:0,at:a[0]?.t??0},K=!0;for(let t=0;t+1<r;t++){const n=a[t],e=a[t+1];if(!n||!e)continue;const o=e.t-n.t;if(!(o>0)||g(n.t)!==g(e.t))continue;const s=j(e.position,n.position),l=[s[0]/o,s[1]/o,s[2]/o];y.push(l),M.push(g(n.t)),i.push((n.t+e.t)/2),T.push(k(l,n.right)),q.push(k(l,n.up)),B.push(k(l,n.forward)),C.push(Q(n.yaw,e.yaw)/o),D.push((e.pitch-n.pitch)/o),F.push(Q(n.roll,e.roll)/o),G.push((Math.log2(e.lens)-Math.log2(n.lens))/o),_.push(L(l));const w=R(n.forward,e.forward);H.push(w/o),n.target&&e.target?S.push(R(j(n.position,n.target),j(e.position,e.target))/o):K=!1;const c=V(n.position,e.position);J+=c,(c>f.distance||w>f.angle)&&(f={distance:Math.max(f.distance,c),angle:Math.max(f.angle,w),at:n.t})}const b=[],z=[],v=[];for(let t=0;t+1<y.length;t++){if(M[t]!==M[t+1])continue;const n=y[t],e=y[t+1],o=i[t],s=i[t+1];if(!n||!e||o===void 0||s===void 0||!(s>o))continue;const l=j(e,n);b.push([l[0]/(s-o),l[1]/(s-o),l[2]/(s-o)]),z.push((o+s)/2),v.push(M[t]??0)}const P=[],E=[],A=[];for(let t=0;t+1<b.length;t++){if(v[t]!==v[t+1])continue;const n=b[t],e=b[t+1],o=z[t],s=z[t+1];if(!n||!e||o===void 0||s===void 0||!(s>o))continue;const l=j(e,n);P.push([l[0]/(s-o),l[1]/(s-o),l[2]/(s-o)]),E.push((o+s)/2),A.push(v[t]??0)}let O=null;for(const t of new Set(A)){const n=P.filter((c,p)=>A[p]===t),e=E.filter((c,p)=>A[p]===t),o=a.filter(c=>g(c.t)===t).map(c=>c.t),s=Math.max(0,..._.filter((c,p)=>M[p]===t));if(!(s>1e-9)||n.length<2)continue;let l=0;for(let c=0;c+1<n.length;c++){const p=n[c],I=n[c+1],U=(e[c+1]??0)-(e[c]??0);!p||!I||(l+=(k(p,p)+k(I,I))/2*U)}const w=(o.at(-1)??0)-(o[0]??0);if(l>0){const c=u(-Math.log(w**3/(s*s)*l));(O===null||c<O)&&(O=c)}}return{length:u(J),truck:channel(T,i),pedestal:channel(q,i),dolly:channel(B,i),pan:channel(C,i),tilt:channel(D,i),roll:channel(F,i),zoom:channel(G,i),...K&&S.length>0?{arc:channel(S,i)}:{},speed:channel(_,i),turn:channel(H,i),acceleration:channel(b.map(L),z),jerk:channel(P.map(L),E),smoothness:O,step:{distance:u(f.distance),angle:u(f.angle),at:u(f.at)},cuts:x.map(u)}}
@@ -0,0 +1,260 @@
1
+ import { type CameraState } from "./camera.js";
2
+ import { Curve } from "./curve.js";
3
+ import type { LensFrame } from "./lens.js";
4
+ import { type Ease } from "./timing.js";
5
+ import { type Vec3 } from "./vec.js";
6
+ /** What a move may ask of the scenery at its moment. */
7
+ export interface SceneryView {
8
+ /** Where a named object is now (the centre of its box), or undefined. */
9
+ pointOf(name: string): Vec3 | undefined;
10
+ /**
11
+ * The scenery time, s, of a word or anchor reference ("@turn", "@turn+0.2",
12
+ * a word): there where the scenery is drawn in a part, from that part's
13
+ * speech and anchors, or where its host was given the times. Undefined
14
+ * elsewhere.
15
+ */
16
+ time?: (ref: string) => number;
17
+ /** The frame's width over height, where the camera is drawn for one. */
18
+ aspect?: number;
19
+ /** A screen's face (an object's first mesh, its +Z side), as it is now; undefined for no such object. */
20
+ screen?: (name: string) => ScreenFace | undefined;
21
+ }
22
+ /**
23
+ * A screen's face in the scenery: a point of it from its content's top left
24
+ * (x, y as shares of its width and height), the way it faces, its up, and
25
+ * its size in metres.
26
+ */
27
+ export interface ScreenFace {
28
+ point(x: number, y: number): Vec3;
29
+ center: Vec3;
30
+ normal: Vec3;
31
+ up: Vec3;
32
+ width: number;
33
+ height: number;
34
+ }
35
+ /**
36
+ * A move's moment written as a word or anchor reference, asked for where
37
+ * the scenery has no times (no part shows it, and its host was given
38
+ * none). A host that can be given times catches it to say how.
39
+ */
40
+ export declare class NeedsTimeError extends Error {
41
+ /** The reference, as written. */
42
+ readonly ref: string;
43
+ /** What the reference was given as ("A shot's from", "keys()' t"). */
44
+ readonly what: string;
45
+ constructor(ref: string, what: string);
46
+ }
47
+ /**
48
+ * A moment a move is written with: seconds of scenery time, or a word or
49
+ * anchor reference of the part that shows the scenery (SceneryView.time).
50
+ */
51
+ export type MoveTime = number | string;
52
+ /**
53
+ * A camera as a function of scenery time. A move made by shots() also says
54
+ * where it cuts (`cuts`, read with cutsOf), so no measurement of motion
55
+ * spans a cut.
56
+ */
57
+ export interface Move {
58
+ (t: number, scenery?: SceneryView): CameraState;
59
+ /** Its cuts, s of scenery time: fixed, or found from the scenery's reference times. */
60
+ readonly cuts?: Cuts;
61
+ }
62
+ /** Where a move cuts: scenery times, or a function of the scenery that finds them. */
63
+ export type Cuts = readonly number[] | ((scenery?: SceneryView) => readonly number[]);
64
+ /** What every move passes on to the camera it returns. */
65
+ export interface LensOptions {
66
+ /** 35 mm-equivalent focal length, mm (CameraState.lens). */
67
+ lens?: number;
68
+ lensFrame?: LensFrame;
69
+ /** Vertical degrees, instead of a lens. */
70
+ fov?: number;
71
+ roll?: number;
72
+ up?: Vec3;
73
+ near?: number;
74
+ far?: number;
75
+ /** The f-number (CameraState.aperture). */
76
+ aperture?: number;
77
+ /** Where it focuses (CameraState.focus). */
78
+ focus?: number | Vec3 | string;
79
+ /** Its exposure, EV at ISO 100 (CameraState.ev). */
80
+ ev?: number;
81
+ }
82
+ /** A camera key: a moment and what the camera is then. Channels a key leaves out are interpolated from the keys that have them. */
83
+ export interface CameraKey {
84
+ /** Seconds of scenery time, or a word or anchor reference of the part that shows the scenery ("@turn"). */
85
+ t: MoveTime;
86
+ position?: Vec3;
87
+ /** A point, or an object's name. */
88
+ target?: Vec3 | string;
89
+ yaw?: number;
90
+ pitch?: number;
91
+ lens?: number;
92
+ fov?: number;
93
+ roll?: number;
94
+ /** The f-number (CameraState.aperture), passed on a log scale: every key or none. */
95
+ aperture?: number;
96
+ /** Its exposure, EV at ISO 100 (CameraState.ev), passed straight: every key or none. */
97
+ ev?: number;
98
+ /**
99
+ * Where it focuses (CameraState.focus): distances pass in dioptres (one
100
+ * over the distance), as a focus is pulled; points move like the
101
+ * position; names are blended stretch by stretch, as targets are.
102
+ */
103
+ focus?: number | Vec3 | string;
104
+ /** How the stretch arriving at this key runs, in every channel; breaks the speed at its ends. */
105
+ ease?: Ease;
106
+ }
107
+ export interface KeysOptions extends LensOptions {
108
+ /**
109
+ * How a lens changes between keys: "log" (default), in log focal
110
+ * length, so a zoom changes size at a constant ratio; "fov", in degrees
111
+ * of field of view.
112
+ */
113
+ lensSpace?: "log" | "fov";
114
+ }
115
+ /**
116
+ * A camera through keyframes. Position passes each key at its time along a
117
+ * curve through the keys, at a speed continuous across keys (except at a
118
+ * key with an ease); a key that repeats the last position holds. Targets
119
+ * that are points move the same way; targets that are names are found in
120
+ * the scenery at each moment and blended stretch by stretch. Lens, fov,
121
+ * roll, yaw and pitch pass their keys on monotone cubics.
122
+ */
123
+ export declare function keys(list: readonly CameraKey[], opts?: KeysOptions): Move;
124
+ export interface PathOptions extends LensOptions {
125
+ /** When the camera leaves the first point: s of scenery time, or a word or anchor reference; default 0. */
126
+ start?: MoveTime;
127
+ /** How long it takes to reach the last point, s. Give this or speed. */
128
+ dur?: number;
129
+ /** Its speed, m/s. Give this or dur. */
130
+ speed?: number;
131
+ /** How the distance travelled runs over the time; default "linear" (constant speed). */
132
+ ease?: Ease;
133
+ /** Where it looks: a point, an object's name, or "ahead" (the default), along the path. */
134
+ target?: Vec3 | string;
135
+ /** With target "ahead": how far on along the path it looks, m; default 1. */
136
+ ahead?: number;
137
+ /**
138
+ * Which way is up: "scenery" (the default) keeps `up`; "rmf" carries it
139
+ * along the path in a frame that does not twist about it.
140
+ */
141
+ frame?: "scenery" | "rmf";
142
+ /** Curve tension: 0.5 centripetal (the default), 0 uniform, 1 chordal. */
143
+ alpha?: number;
144
+ }
145
+ export declare const PATH_DEFAULTS: {
146
+ start: number;
147
+ ahead: number;
148
+ alpha: number;
149
+ };
150
+ /** A camera moving along a curve through points at constant speed (or an ease on the distance). */
151
+ export declare function path(points: readonly Vec3[], opts: PathOptions): Move;
152
+ /** The curve a path() follows, for measuring it: its length and points along it. */
153
+ export declare function pathCurve(points: readonly Vec3[], alpha?: number): Curve;
154
+ export interface OrbitOptions extends LensOptions {
155
+ /** The point or the object's name it goes round. */
156
+ around: Vec3 | string;
157
+ /** Distance from the centre on the floor's plane, m. */
158
+ radius: number;
159
+ /** Height above the centre, m; default 0. */
160
+ height?: number;
161
+ /**
162
+ * Angles in degrees: 0 on the centre's +Z side (in front of a model that
163
+ * faces +Z), 90 on its +X side; counterclockwise seen from above. Not
164
+ * wrapped: 0 → 540 goes round one and a half times.
165
+ */
166
+ from: number;
167
+ to: number;
168
+ /** When it starts: s of scenery time, or a word or anchor reference; default 0. */
169
+ start?: MoveTime;
170
+ /** How long it takes, s. */
171
+ dur: number;
172
+ /** How the angle runs over the time; default "linear". */
173
+ ease?: Ease;
174
+ /** Where it looks; default the centre. */
175
+ target?: Vec3 | string;
176
+ }
177
+ /** A camera going round a point at a radius and height. */
178
+ export declare function orbit(opts: OrbitOptions): Move;
179
+ /** One shot of shots(): when it starts, and the camera it holds or the move it makes. */
180
+ export interface Shot {
181
+ /** Seconds of scenery time, or a word or anchor reference of the part. The first shot also holds before its start. */
182
+ from: MoveTime;
183
+ /** A camera that holds still, or a move (keys, path, orbit, your own), in scenery time. */
184
+ camera: CameraState | Move;
185
+ }
186
+ /**
187
+ * A camera made of shots joined by cuts, as a film is: each shot from its
188
+ * start until the next one's, a still camera or a move of its own; at each
189
+ * start the picture cuts. A pause before a cut is a shot that holds. The
190
+ * measurements of motion stop at each cut (cutsOf).
191
+ */
192
+ export declare function shots(list: readonly Shot[]): Move;
193
+ /** The cuts of a camera made by shots(), scenery times (none for any other camera, or one wrapped in a function of yours). */
194
+ export declare function cutsOf(camera: CameraState | Move, scenery?: SceneryView): number[];
195
+ /**
196
+ * `move` with the cuts of `camera` (a camera made by shots()), so a move
197
+ * of yours wrapped round it keeps them for the measurements; returns
198
+ * `move`.
199
+ */
200
+ export declare function withCuts(camera: CameraState | Move, move: (t: number, scenery?: SceneryView) => CameraState): Move;
201
+ export interface FocusScreenOptions {
202
+ /** How far toward the frame's edges the rectangle may reach, 0–1 (fitCamera's fill); default 1. */
203
+ fill?: number;
204
+ /** The lens (35 mm-equivalent), or a vertical fov in degrees; default the camera default's. */
205
+ lens?: number;
206
+ fov?: number;
207
+ /**
208
+ * Degrees off looking at the screen square on, default 0: `yaw` turns
209
+ * about the screen's up (positive: the camera to the right of someone
210
+ * facing the screen, looking left at it), then `pitch` up or down
211
+ * (positive: below the screen, looking up, as a camera's pitch looks up).
212
+ */
213
+ yaw?: number;
214
+ pitch?: number;
215
+ /** The frame's width over height; default the scenery layer's. */
216
+ aspect?: number;
217
+ /** Its exposure, EV at ISO 100 (CameraState.ev). */
218
+ ev?: number;
219
+ /** What `lens` is measured on (CameraState.lensFrame): "phone" for a phone's own "26 mm". */
220
+ lensFrame?: LensFrame;
221
+ }
222
+ /**
223
+ * A camera framing a rectangle of a screen's content exactly: `rect` is
224
+ * [x, y, width, height] as shares of the content (from its top left: a
225
+ * button at px [1200, 80, 160, 48] of 1920 × 1200 is [0.625, 0.067,
226
+ * 0.083, 0.04]), seen square on (or `yaw`/`pitch` off it), the screen's up
227
+ * kept up. A camera of the scenery's, so the room is framed with it.
228
+ */
229
+ export declare function focusScreen(screen: string, rect: readonly [number, number, number, number], opts?: FocusScreenOptions): Move;
230
+ /** A camera, or a move's camera at `t`. */
231
+ export declare const stateOf: (c: CameraState | Move, t: number, scenery?: SceneryView) => CameraState;
232
+ /**
233
+ * The camera `x` of the way from `sa` to `sb` (past 1 or under 0 goes on
234
+ * past them): its position, its view and its up, its lens at a constant
235
+ * zoom ratio, its depth of field (the aperture's area and the focus in
236
+ * dioptres), its exposure in stops. `xEv`, when given, is the exposure's
237
+ * own share of the way. `what` names the caller in its errors.
238
+ */
239
+ export declare function mixCameras(sa: CameraState, sb: CameraState, x: number, scenery: SceneryView | undefined, what: string, xEv?: number): CameraState;
240
+ /** A move's moment: seconds, or a reference's scenery time (or why it has none). */
241
+ export declare function momentOf(scenery: SceneryView | undefined, at: MoveTime, what: string): number;
242
+ export interface BlendOptions {
243
+ /** When it leaves the first camera, and when it is the second: seconds of scenery time or references. */
244
+ from: MoveTime;
245
+ to: MoveTime;
246
+ /**
247
+ * How it runs between them; default "smooth" (still at both ends, at
248
+ * one and a half times its mean speed half way).
249
+ */
250
+ ease?: Ease;
251
+ }
252
+ /**
253
+ * From one camera to another over a stretch of time: the first before
254
+ * `from`, the second after `to`, and between them its position, its
255
+ * view, its up and its lens on their way from one to the other (the lens
256
+ * at a constant zoom ratio). A push in to a screen and a pull back out are
257
+ * blends; each camera may itself move.
258
+ */
259
+ export declare function blend(a: CameraState | Move, b: CameraState | Move, opts: BlendOptions): Move;
260
+ //# sourceMappingURL=move.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{resolveCamera as R}from"./camera.js";import{Curve as V,SAME_POINT as X}from"./curve.js";import{easeValue as O,timedNumber as Y}from"./timing.js";import{fitCamera as fe}from"./fit.js";import{cross as Z,distance as ee,dot as ue,lerp3 as T,normalize as _,scale as ce}from"./vec.js";export class NeedsTimeError extends Error{ref;what;constructor(n,t){super(`${t} "${n}" is a word or anchor reference: it has a time only in a part that shows the scenery, or where the scenery's host is given the times.`),this.name="NeedsTimeError",this.ref=n,this.what=t}}function b(e,n,t){if(!e?.time)throw new NeedsTimeError(n,t);const a=e.time(n);if(!Number.isFinite(a))throw new Error(`${t} "${n}" has no time (${String(a)}).`);return a}function z(e,n,t){const a=new WeakMap;return(f,o)=>{const u=e[0]??"";b(o,u,n);const c=o.time;let r=a.get(c);return r||(r=t(i=>b(o,i,n)),a.set(c,r)),r(f,o)}}const D=(e,n)=>Object.assign(e,{cuts:n}),L=e=>({...e.lens!==void 0?{lens:e.lens}:{},...e.lensFrame!==void 0?{lensFrame:e.lensFrame}:{},...e.fov!==void 0?{fov:e.fov}:{},...e.roll!==void 0?{roll:e.roll}:{},...e.up!==void 0?{up:e.up}:{},...e.near!==void 0?{near:e.near}:{},...e.far!==void 0?{far:e.far}:{},...e.aperture!==void 0?{aperture:e.aperture}:{},...e.focus!==void 0?{focus:e.focus}:{},...e.ev!==void 0?{ev:e.ev}:{}});function I(e,n,t){if(typeof e!="string")return e;const a=n?.pointOf(e);if(!a)throw new Error(n?`${t} "${e}" names nothing in the scenery.`:`${t} "${e}" is a name, and the move was not given the scenery to find it in.`);return a}function W(e){const n=e[0];if(!n)throw new Error("A point over time needs at least one key.");const t=[],a=[0];let f=0,o=0;for(;o+1<e.length;){if(ee(e[o]?.v??n.v,e[o+1]?.v??n.v)<=X){a.push(f),o++;continue}let r=o+1;for(;r+1<e.length&&ee(e[r]?.v??n.v,e[r+1]?.v??n.v)>X;)r++;const i=new V(e.slice(o,r+1).map(d=>d.v));t.push({from:o,to:r,curve:i,start:f});for(let d=o+1;d<=r;d++)a.push(f+(i.knots[d-o]??0));f+=i.length,o=r}const u=Y(e.map((r,i)=>({t:r.t,v:a[i]??0,...r.ease!==void 0?{ease:r.ease}:{}}))),c=e.at(-1)??n;return r=>{if(!(r>n.t))return n.v;if(r>=c.t)return c.v;let i=0;for(;i+1<e.length&&(e[i+1]?.t??1/0)<=r;)i++;const d=t.find(h=>i>=h.from&&i<h.to);return d?d.curve.at(u(r)-d.start).point:e[i]?.v??n.v}}function E(e,n){const t=[];for(const a of e){const f=n(a);f!==void 0&&t.push({t:a.t,v:f,...a.ease!==void 0?{ease:a.ease}:{}})}return t}export function keys(e,n={}){if(e.length===0)throw new Error("keys() needs at least one key.");const t=e.flatMap(a=>typeof a.t=="string"?[a.t]:[]);return t.length===0?re(e,n):(te(e),z(t,"A key's t",a=>{const f=e.map(o=>({...o,t:typeof o.t=="string"?a(o.t):o.t}));return f.forEach((o,u)=>{const c=f[u-1];if(c&&!(o.t>c.t)){const r=(i,d)=>typeof i.t=="string"?`"${i.t}" (${d.toFixed(3)} s)`:`${d.toFixed(3)} s`;throw new Error(`Keys must be in time order: the key at ${r(e[u]??o,o.t)} does not come after the one at ${r(e[u-1]??c,c.t)}.`)}}),re(f,n)}))}const ne=e=>typeof e.t=="string"?`"${e.t}"`:`${String(e.t)} s`;function te(e){for(const n of e){if(typeof n.t=="number"&&!Number.isFinite(n.t))throw new Error(`A key's t must be a number of seconds or a reference, not ${String(n.t)}.`);if(typeof n.t=="string"&&n.t.trim()==="")throw new Error("A key's t is an empty reference.");if(n.target!==void 0&&(n.yaw!==void 0||n.pitch!==void 0))throw new Error(`The key at ${ne(n)} points two ways (a target and yaw/pitch): give one.`);if(n.lens!==void 0&&n.fov!==void 0)throw new Error(`The key at ${ne(n)} has both a lens and a fov: give one.`)}}function re(e,n){te(e);const t=E(e,s=>s.position);if(t.length===0)throw new Error("keys() needs a position in at least one key.");const a=W(t),f=E(e,s=>s.target),o=e.some(s=>s.yaw!==void 0||s.pitch!==void 0);if(f.length>0&&o)throw new Error("keys() points by target in some keys and by yaw/pitch in others: use one way throughout.");const u=f.some(s=>typeof s.v=="string"),c=f.length>0&&!u?W(f.map(s=>({...s,v:s.v}))):void 0,r=f[0],i=u&&f.every(s=>s.v===r?.v)?r?.v:void 0,d=(s,$)=>{const g=E(e,s);return g.length===0?void 0:Y(g.map(A=>({...A,v:$?$(A.v):A.v})))},h=E(e,s=>s.lens),m=E(e,s=>s.fov);if(h.length>0&&m.length>0)throw new Error("keys() sets a lens in some keys and a fov in others: use one throughout.");const M=(n.lensSpace??"log")==="log",P=d(s=>s.lens,M?Math.log:void 0),S=d(s=>s.fov),F=d(s=>s.roll),K=d(s=>s.yaw),N=d(s=>s.pitch),H=E(e,s=>s.aperture);if(H.length>0&&H.length<e.length)throw new Error("keys() gives an aperture in some keys and not in others: give it in every key, or in none (a pinhole is no aperture).");const se=d(s=>s.aperture,Math.log),J=E(e,s=>s.ev);if(J.length>0&&J.length<e.length)throw new Error("keys() gives an ev in some keys and not in others: give it in every key, or in none (the scenery's own exposure).");const ie=d(s=>s.ev),w=E(e,s=>s.focus),C=new Set(w.map(s=>typeof s.v=="number"?"distance":typeof s.v=="string"?"name":"point"));if(C.has("distance")&&C.size>1)throw new Error("keys() focuses by distance in some keys and on a point or an object in others: use one way throughout.");const j=C.has("distance")?d(s=>typeof s.focus=="number"?s.focus:void 0,s=>1/s):void 0,U=C.has("name"),q=w.length>0&&!U&&!j?W(w.map(s=>({...s,v:s.v}))):void 0;return(s,$)=>{let g;if(c)g=c(s);else if(i!==void 0)g=i;else if(u&&r){const p=f.at(-1)??r;if(!(s>r.t))g=r.v;else if(s>=p.t)g=p.v;else{let v=0;for(;v+1<f.length&&(f[v+1]?.t??1/0)<=s;)v++;const l=f[v]??r,x=f[v+1]??p,k=O(x.ease??"in-out",(s-l.t)/(x.t-l.t));g=T(I(l.v,$,"A key's target"),I(x.v,$,"A key's target"),k)}}const A=P?.(s);let y;if(j)y=1/j(s);else if(q)y=q(s);else if(U){const p=w[0],v=w.at(-1);if(p&&v)if(w.every(l=>l.v===p.v))y=p.v;else if(!(s>p.t))y=p.v;else if(s>=v.t)y=v.v;else{let l=0;for(;l+1<w.length&&(w[l+1]?.t??1/0)<=s;)l++;const x=w[l]??p,k=w[l+1]??v,ae=O(k.ease??"in-out",(s-x.t)/(k.t-x.t));y=T(I(x.v,$,"A key's focus"),I(k.v,$,"A key's focus"),ae)}}const G=se?.(s),Q=ie?.(s);return{...L(n),...Q!==void 0?{ev:Q}:{},...G!==void 0?{aperture:Math.exp(G)}:{},...y!==void 0?{focus:y}:{},position:a(s),...g!==void 0?{target:g}:{},...K?{yaw:K(s)}:{},...N?{pitch:N(s)}:{},...A!==void 0?{lens:M?Math.exp(A):A}:{},...S?{fov:S(s)}:{},...F?{roll:F(s)}:{}}}}export const PATH_DEFAULTS={start:0,ahead:1,alpha:.5};export function path(e,n){if(e.length===0)throw new Error("path() needs at least one point.");const t=n.start??PATH_DEFAULTS.start;return typeof t=="string"?(B(e,{...n,start:0}),z([t],"path()'s start",a=>B(e,{...n,start:a(t)}))):B(e,{...n,start:t})}function B(e,n){if(n.dur===void 0==(n.speed===void 0))throw new Error("path() needs dur (seconds) or speed (m/s): give one.");const t=new V(e,n.alpha??PATH_DEFAULTS.alpha),a=n.dur??t.length/(n.speed??1);if(!(Number.isFinite(a)&&a>=0))throw new Error(`path()'s duration ${String(a)} s is not a number of seconds.`);const f=n.start,o=n.ahead??PATH_DEFAULTS.ahead,u=n.target??"ahead";return c=>{const r=a>0?(c-f)/a:c>=f?1:0,i=t.length*O(n.ease,r),d=t.at(i),h={...L(n),position:d.point,target:u==="ahead"?t.extended(i+o):u};return n.frame==="rmf"&&(h.up=t.upAt(i,n.up)),h}}export function pathCurve(e,n=PATH_DEFAULTS.alpha){return new V(e,n)}export function orbit(e){if(!(Number.isFinite(e.radius)&&e.radius>=0))throw new Error(`orbit()'s radius ${String(e.radius)} is not a distance.`);if(!(Number.isFinite(e.dur)&&e.dur>=0))throw new Error(`orbit()'s dur ${String(e.dur)} is not a number of seconds.`);return(n,t)=>{const a=typeof e.start=="string"?b(t,e.start,"orbit()'s start"):e.start??0,f=I(e.around,t,"orbit()'s centre"),o=e.dur>0?(n-a)/e.dur:n>=a?1:0,u=(e.from+(e.to-e.from)*O(e.ease,o))*Math.PI/180;return{...L(e),position:[f[0]+e.radius*Math.sin(u),f[1]+(e.height??0),f[2]+e.radius*Math.cos(u)],target:e.target??f}}}export function shots(e){if(e.length===0)throw new Error("shots() needs at least one shot.");for(const o of e){if(typeof o.from=="number"&&!Number.isFinite(o.from))throw new Error(`A shot's from must be seconds or a reference, not ${String(o.from)}.`);if(typeof o.camera!="function"&&!Array.isArray(o.camera.position))throw new Error("A shot's camera is a camera state or a move.")}const n=e.flatMap(o=>typeof o.from=="string"?[o.from]:[]),t=o=>{const u=e.map(c=>typeof c.from=="number"?c.from:o?o(c.from):b(void 0,c.from,"A shot's from"));return u.forEach((c,r)=>{const i=u[r-1];if(i!==void 0&&!(c>i)){const d=h=>{const m=e[h]?.from;return typeof m=="string"?`"${m}"`:`${String(m)} s`};throw new Error(`Shots must be in time order: the shot from ${d(r)} (${c.toFixed(3)} s) does not come after the one from ${d(r-1)} (${i.toFixed(3)} s).`)}}),u},a=o=>D((u,c)=>{let r=0;for(;r+1<o.length&&(o[r+1]??1/0)<=u;)r++;const i=e[r]?.camera;if(i===void 0)throw new Error("No shot.");return typeof i=="function"?i(u,c):i},o.slice(1));if(n.length===0)return a(t(void 0));const f=new WeakMap;return D((o,u)=>{b(u,n[0]??"","A shot's from");const c=u.time;let r=f.get(c);return r||(r=a(t(i=>b(u,i,"A shot's from"))),f.set(c,r)),r(o,u)},o=>o?.time?t(u=>b(o,u,"A shot's from")).slice(1):[])}export function cutsOf(e,n){if(typeof e!="function")return[];const t=e.cuts;return t===void 0?[]:typeof t=="function"?[...t(n)]:[...t]}export function withCuts(e,n){const t=typeof e=="function"?e.cuts:void 0;return t===void 0?n:D(n,t)}function oe(e,n,t){const a=t*Math.PI/180,f=Math.cos(a),o=Math.sin(a),u=_(n),c=Z(u,e),r=ue(u,e)*(1-f);return[e[0]*f+c[0]*o+u[0]*r,e[1]*f+c[1]*o+u[1]*r,e[2]*f+c[2]*o+u[2]*r]}export function focusScreen(e,n,t={}){const[a,f,o,u]=n;if(![a,f,o,u].every(c=>Number.isFinite(c))||!(o>0&&u>0))throw new Error(`focusScreen()'s rect is [x, y, width, height] as shares of the screen's content, not ${JSON.stringify(n)}.`);return(c,r)=>{const i=r?.screen?.(e);if(!i)throw new Error(r?.screen?`focusScreen(): the scenery has no screen "${e}" (an object with a mesh).`:"focusScreen() needs the scenery it is drawn in.");const d=t.aspect??r?.aspect;if(d===void 0)throw new Error("focusScreen() needs the frame's aspect: a scenery layer gives it; elsewhere pass aspect.");let h=ce(i.normal,-1);t.yaw&&(h=oe(h,i.up,t.yaw)),t.pitch&&(h=oe(h,Z(h,i.up),t.pitch));const m=fe({points:[i.point(a,f),i.point(a+o,f),i.point(a+o,f+u),i.point(a,f+u)],direction:h,up:i.up,aspect:d,...t.lens!==void 0?{lens:t.lens}:{},...t.lensFrame!==void 0?{lensFrame:t.lensFrame}:{},...t.fov!==void 0?{fov:t.fov}:{},...t.fill!==void 0?{fill:t.fill}:{}});return t.ev!==void 0?{...m,ev:t.ev}:m}}export const stateOf=(e,n,t)=>typeof e=="function"?e(n,t):e;export function mixCameras(e,n,t,a,f,o=t){const u=a?.aspect??1,c=M=>a?.pointOf(M),r=R(e,u,c),i=R(n,u,c);if(r.ev===void 0!=(i.ev===void 0))throw new Error(`${f} goes between a camera with an ev and one without: give both an ev, or neither (the scenery's own exposure).`);const d=r.dof,h=i.dof;let m;if(d||h){const M=d?d.aperture*(r.lens/d.lens):1/0,P=h?h.aperture*(i.lens/h.lens):1/0,S=1/M*(1-t)+1/P*t,F=d?.focus??h?.focus??1,K=h?.focus??F,N=1/F*(1-t)+1/K*t;S>0&&N>0&&(m={aperture:1/S,focus:1/N})}return{position:T(r.position,i.position,t),direction:_(T(r.forward,i.forward,t)),up:_(T(r.up,i.up,t)),lens:Math.exp(Math.log(r.lens)+(Math.log(i.lens)-Math.log(r.lens))*t),near:Math.min(r.near,i.near),far:Math.max(r.far,i.far),...m??{},...r.ev!==void 0&&i.ev!==void 0?{ev:r.ev*(1-o)+i.ev*o}:{}}}export function momentOf(e,n,t){return typeof n=="number"?n:b(e,n,t)}export function blend(e,n,t){const a=(o,u)=>{if(!(u>o))throw new Error(`blend()'s to (${String(u)} s) must come after its from (${String(o)} s).`);return(c,r)=>{if(c<=o)return stateOf(e,c,r);if(c>=u)return stateOf(n,c,r);const i=O(t.ease??"smooth",(c-o)/(u-o));return mixCameras(stateOf(e,c,r),stateOf(n,c,r),i,r,"blend()")}},f=[t.from,t.to].filter(o=>typeof o=="string");return f.length===0?a(t.from,t.to):z(f,"blend()'s from or to",o=>a(typeof t.from=="string"?o(t.from):t.from,typeof t.to=="string"?o(t.to):t.to))}
@@ -0,0 +1,41 @@
1
+ /** A band of frequencies: its centre and its spread (the spectrum's standard deviation), Hz. */
2
+ export interface Band {
3
+ /** Hz; 0 for low-pass noise. */
4
+ center: number;
5
+ /** Hz, above 0: how far the spectrum spreads either side of the centre. */
6
+ spread: number;
7
+ }
8
+ /** A hash of three whole numbers, 0 to 2³² − 1. */
9
+ export declare function hash3(a: number, b: number, c: number): number;
10
+ /** A number from 0 to 1 (never 0 or 1) for three whole numbers. */
11
+ export declare function unit3(a: number, b: number, c: number): number;
12
+ /** A standard normal number for three whole numbers (Box–Muller). */
13
+ export declare function gauss3(a: number, b: number, c: number): number;
14
+ /**
15
+ * Noise of standard deviation 1 (in expectation) whose spectrum is a
16
+ * Gaussian bump of `band.spread` Hz round `band.center` (and round 0 for
17
+ * a centre of 0): a lattice of seeded normal numbers, filtered by a Gabor
18
+ * kernel. Each `channel` of a seed is another noise.
19
+ */
20
+ export declare function bandNoise(seed: number, channel: number, band: Band): (t: number) => number;
21
+ /** A power-law spectrum: its power density falls as 1/f^alpha from `low` to `high` Hz. */
22
+ export interface Slope {
23
+ low: number;
24
+ high: number;
25
+ /** 0 is white, 1 pink, 2 brown (a hand's sway is near 2). */
26
+ alpha: number;
27
+ }
28
+ /**
29
+ * Noise of standard deviation 1 whose spectrum falls as 1/f^alpha between
30
+ * `low` and `high` Hz: half-octave bands, each with its share of the
31
+ * power. Each `channel` is another noise. `gain`, by a band's centre,
32
+ * takes part of it out (a stabiliser): the deviation is then less than 1.
33
+ */
34
+ export declare function powerNoise(seed: number, channel: number, slope: Slope, gain?: (center: number) => number): (t: number) => number;
35
+ /**
36
+ * A gain that waxes and wanes about 1 (exp(β·g − β²) over low-pass noise
37
+ * g), so that what it multiplies keeps its standard deviation in
38
+ * expectation: `swell` is β, `period` the seconds of its slow swing.
39
+ */
40
+ export declare function swellOf(seed: number, channel: number, swell: number, period: number): (t: number) => number;
41
+ //# sourceMappingURL=noise.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ function b(e){let t=e|0;return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,t>>>0}export function hash3(e,t,n){return b(b(b(e^2654435769)^Math.imul(t|0,1663821227))^Math.imul(n|0,668265263))}export function unit3(e,t,n){return(hash3(e,t,n)+.5)/4294967296}export function gauss3(e,t,n){const a=unit3(e,t,n),s=unit3(e^1540483477,n,t);return Math.sqrt(-2*Math.log(a))*Math.cos(2*Math.PI*s)}const I=4;export function bandNoise(e,t,n){const a=Math.max(0,n.center),s=Math.max(1e-6,n.spread),r=1/(2*Math.PI*s),h=2.5*(a+I*s),M=1/h,f=h*(Math.sqrt(Math.PI)*r/2)*(1+Math.exp(-4*Math.PI*Math.PI*a*a*r*r)),i=1/Math.sqrt(f),u=I*r,m=e|0,l=t|0;return o=>{if(!Number.isFinite(o))return 0;const c=Math.ceil((o-u)*h),x=Math.floor((o+u)*h);let g=0;for(let p=c;p<=x;p++){const d=o-p*M,P=Math.exp(-d*d/(2*r*r));g+=gauss3(m,l,p)*P*(a>0?Math.cos(2*Math.PI*a*d):1)}return g*i}}export function powerNoise(e,t,n,a=()=>1){const{low:s,high:r,alpha:h}=n,M=Math.max(1,Math.round(2*Math.log2(Math.max(r/s,1)))),f=(r/s)**(1/M),i=Array.from({length:M},(o,c)=>s*f**(c+.5)),u=i.map(o=>o**(1-h)),m=u.reduce((o,c)=>o+c,0),l=i.map((o,c)=>({noise:bandNoise(e,t*64+c,{center:o,spread:o*.2}),k:a(o)*Math.sqrt((u[c]??0)/m)}));return o=>l.reduce((c,x)=>c+x.k*x.noise(o),0)}export function swellOf(e,t,n,a){if(n<=0)return()=>1;const s=bandNoise(e,t,{center:0,spread:1/a});return r=>Math.exp(n*s(r)-n*n)}