@hypit/hypit 0.1.3 → 0.1.5

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 (486) hide show
  1. package/README.md +5 -3
  2. package/dist/public/caption.d.ts +206 -183
  3. package/dist/public/composition.d.ts +25 -3
  4. package/dist/public/endpoint-kit.d.ts +24 -2
  5. package/dist/public/generation.d.ts +5 -1
  6. package/dist/public/hyperframes.d.ts +19 -1
  7. package/dist/public/narrative.d.ts +17 -3
  8. package/dist/public/performance.d.ts +1590 -0
  9. package/dist/public/program-space.d.ts +179 -32
  10. package/dist/public/runtime-kit.d.ts +21 -8
  11. package/dist/public/sound.d.ts +822 -0
  12. package/dist/public/speech.d.ts +41 -0
  13. package/dist/public/studio-adapter.d.ts +107 -16
  14. package/dist/public/temporal-markup.d.ts +9 -44
  15. package/dist/public/temporal.d.ts +37 -28
  16. package/dist/public/{semantic-track.d.ts → timeline.d.ts} +62 -49
  17. package/examples/README.md +18 -10
  18. package/examples/minimal-author-package/packages/example-component/preview/preview.svml +19 -12
  19. package/examples/minimal-author-package/packages/example-component/src/component.ts +5 -5
  20. package/examples/minimal-author-package/packages/example-component/src/fragment.ts +3 -5
  21. package/examples/minimal-author-package/packages/example-component/src/manifest.ts +8 -10
  22. package/examples/minimal-author-package/packages/example-component/src/surface.ts +2 -2
  23. package/examples/provider-package/README.md +78 -0
  24. package/examples/provider-package/hypit.runtime.json +12 -0
  25. package/examples/provider-package/packages/provider-images/package.json +11 -0
  26. package/examples/provider-package/packages/provider-images/src/activation.ts +24 -0
  27. package/examples/provider-package/packages/provider-images/src/provider.ts +122 -0
  28. package/examples/provider-package/packages/provider-images/tsconfig.json +9 -0
  29. package/examples/semantic-composition/README.md +6 -0
  30. package/examples/semantic-composition/chat.svml +6 -5
  31. package/examples/semantic-composition/packages/chat-scene/README.md +3 -3
  32. package/examples/semantic-composition/packages/chat-scene/src/activation.ts +18 -21
  33. package/examples/semantic-composition/packages/chat-scene/src/render.ts +4 -4
  34. package/examples/semantic-composition/packages/performance-styles/README.md +42 -0
  35. package/examples/semantic-composition/packages/performance-styles/package.json +25 -0
  36. package/examples/semantic-composition/packages/performance-styles/src/activation.ts +57 -0
  37. package/examples/semantic-composition/packages/performance-styles/src/render.ts +54 -0
  38. package/examples/semantic-composition/packages/performance-styles/src/studio.ts +28 -0
  39. package/examples/semantic-composition/packages/performance-styles/tsconfig.json +18 -0
  40. package/examples/semantic-composition/packages/responsive-explainer/README.md +16 -9
  41. package/examples/semantic-composition/packages/responsive-explainer/src/activation.ts +12 -12
  42. package/examples/semantic-composition/packages/responsive-explainer/src/render.ts +5 -5
  43. package/examples/semantic-composition/packages/sound-styles/README.md +36 -0
  44. package/examples/semantic-composition/packages/sound-styles/package.json +25 -0
  45. package/examples/semantic-composition/packages/sound-styles/src/activation.ts +53 -0
  46. package/examples/semantic-composition/packages/sound-styles/src/render.ts +14 -0
  47. package/examples/semantic-composition/packages/sound-styles/tsconfig.json +18 -0
  48. package/package.json +35 -15
  49. package/packages/audio-track/README.md +20 -13
  50. package/packages/audio-track/package.json +1 -1
  51. package/packages/audio-track/src/component.ts +4 -4
  52. package/packages/audio-track/src/fragment.ts +6 -5
  53. package/packages/audio-track/src/index.ts +1 -1
  54. package/packages/audio-track/src/manifest.ts +17 -16
  55. package/packages/audio-track/src/program.ts +21 -25
  56. package/packages/audio-track/src/surface.ts +19 -18
  57. package/packages/audio-track-studio/README.md +23 -0
  58. package/packages/audio-track-studio/src/index.ts +33 -19
  59. package/packages/author-kit/README.md +1 -1
  60. package/packages/background-removal/README.md +4 -7
  61. package/packages/browser-capture/package.json +1 -1
  62. package/packages/build-result/README.md +69 -0
  63. package/packages/build-result/package.json +2 -1
  64. package/packages/build-result/src/decode.ts +12 -8
  65. package/packages/build-result/src/execution-log.ts +17 -0
  66. package/packages/build-result/src/file-reference.ts +42 -0
  67. package/packages/build-result/src/index.ts +4 -0
  68. package/packages/build-result/src/replace-file-windows.ts +58 -0
  69. package/packages/build-result/src/replace-file.ts +11 -0
  70. package/packages/build-result/src/store.ts +58 -14
  71. package/packages/build-result/src/types.ts +41 -8
  72. package/packages/build-result/src/writer.ts +12 -1
  73. package/packages/build-result-fs/README.md +23 -1
  74. package/packages/build-result-s3/README.md +5 -0
  75. package/packages/build-result-s3/src/repository.ts +23 -5
  76. package/packages/caption/README.md +61 -73
  77. package/packages/caption/package.json +3 -2
  78. package/packages/caption/src/activation.ts +2 -2
  79. package/packages/caption/src/component.ts +20 -5
  80. package/packages/caption/src/display.ts +3 -18
  81. package/packages/caption/src/fragment.ts +3 -7
  82. package/packages/caption/src/index.ts +6 -5
  83. package/packages/caption/src/manifest.ts +29 -46
  84. package/packages/caption/src/style.ts +24 -135
  85. package/packages/caption/src/surface.ts +12 -92
  86. package/packages/caption/src/temporalize.ts +18 -53
  87. package/packages/caption/src/types.ts +8 -35
  88. package/packages/caption/src/visibility.ts +23 -0
  89. package/packages/caption-fine/README.md +31 -11
  90. package/packages/caption-fine/package.json +4 -2
  91. package/packages/caption-fine/src/component.ts +3 -3
  92. package/packages/caption-fine/src/fragment.ts +7 -19
  93. package/packages/caption-fine/src/index.ts +2 -0
  94. package/packages/caption-fine/src/manifest.ts +27 -18
  95. package/packages/caption-fine/src/recipe.ts +7 -0
  96. package/packages/caption-fine/src/render.ts +62 -49
  97. package/packages/caption-fine/src/schedule.ts +39 -35
  98. package/packages/caption-fine/src/style.ts +10 -9
  99. package/packages/caption-fine/src/surface.ts +62 -35
  100. package/packages/caption-fine/src/types.ts +2 -0
  101. package/packages/caption-fine-studio/README.md +24 -2
  102. package/packages/caption-fine-studio/package.json +10 -3
  103. package/packages/caption-fine-studio/src/activation.ts +3 -3
  104. package/packages/caption-fine-studio/src/index.ts +61 -40
  105. package/packages/cli/README.md +81 -3
  106. package/packages/cli/package.json +1 -0
  107. package/packages/cli/src/arguments.ts +39 -15
  108. package/packages/cli/src/build-planning.ts +9 -3
  109. package/packages/cli/src/command.ts +7 -1
  110. package/packages/cli/src/commands/environment.ts +66 -27
  111. package/packages/cli/src/commands/execution.ts +81 -26
  112. package/packages/cli/src/commands/results.ts +7 -11
  113. package/packages/cli/src/index.ts +2 -2
  114. package/packages/cli/src/machine-view.ts +15 -5
  115. package/packages/cli/src/main.ts +38 -42
  116. package/packages/cli/src/observation.ts +7 -1
  117. package/packages/cli/src/output.ts +92 -34
  118. package/packages/cli/src/result-export.ts +22 -13
  119. package/packages/cli/src/run-file.ts +19 -8
  120. package/packages/cli/src/view.ts +64 -18
  121. package/packages/comment-sticker/README.md +3 -3
  122. package/packages/comment-sticker/package.json +1 -1
  123. package/packages/comment-sticker/src/component.ts +4 -4
  124. package/packages/comment-sticker/src/fragment.ts +5 -4
  125. package/packages/comment-sticker/src/manifest.ts +7 -6
  126. package/packages/comment-sticker/src/program.ts +9 -9
  127. package/packages/comment-sticker/src/surface.ts +6 -7
  128. package/packages/comment-sticker-studio/src/index.ts +2 -1
  129. package/packages/compiler-node/src/compiler.ts +1 -0
  130. package/packages/composition/README.md +21 -0
  131. package/packages/composition/src/audio-presentation.ts +44 -0
  132. package/packages/composition/src/index.ts +3 -0
  133. package/packages/composition/src/schema.ts +8 -3
  134. package/packages/composition/src/track.ts +15 -1
  135. package/packages/credential-store-env/README.md +1 -1
  136. package/packages/deck-track/README.md +3 -3
  137. package/packages/deck-track/package.json +1 -1
  138. package/packages/deck-track/src/component.ts +5 -5
  139. package/packages/deck-track/src/fragment.ts +6 -5
  140. package/packages/deck-track/src/lower.ts +12 -12
  141. package/packages/deck-track/src/manifest.ts +8 -7
  142. package/packages/deck-track/src/program.ts +13 -16
  143. package/packages/deck-track/src/surface.ts +9 -10
  144. package/packages/driver-node/src/driver.ts +41 -3
  145. package/packages/elevenlabs-speech/README.md +27 -0
  146. package/packages/{provider-xiaomi-mimo → elevenlabs-speech}/package.json +5 -8
  147. package/packages/elevenlabs-speech/src/activation.ts +26 -0
  148. package/packages/elevenlabs-speech/src/fragment.ts +11 -0
  149. package/packages/elevenlabs-speech/src/index.ts +111 -0
  150. package/packages/elevenlabs-speech/src/surface.ts +167 -0
  151. package/packages/endpoint-kit/README.md +24 -0
  152. package/packages/endpoint-kit/src/index.ts +7 -1
  153. package/packages/estimate/README.md +56 -3
  154. package/packages/estimate/src/program.ts +7 -8
  155. package/packages/film/README.md +12 -7
  156. package/packages/film/package.json +1 -1
  157. package/packages/film/src/component.ts +4 -4
  158. package/packages/film/src/fragment.ts +6 -5
  159. package/packages/film/src/manifest.ts +11 -10
  160. package/packages/film/src/program.ts +5 -5
  161. package/packages/film/src/recipe.ts +2 -1
  162. package/packages/film/src/surface.ts +6 -6
  163. package/packages/film-studio/package.json +1 -1
  164. package/packages/film-studio/src/index.ts +2 -2
  165. package/packages/fishaudio-speech/README.md +33 -0
  166. package/packages/fishaudio-speech/package.json +21 -0
  167. package/packages/fishaudio-speech/src/activation.ts +32 -0
  168. package/packages/fishaudio-speech/src/fragment.ts +11 -0
  169. package/packages/fishaudio-speech/src/index.ts +156 -0
  170. package/packages/fishaudio-speech/src/surface.ts +192 -0
  171. package/packages/fonts-open/README.md +5 -0
  172. package/packages/fonts-open/package.json +5 -1
  173. package/packages/fonts-open/src/studio.ts +21 -0
  174. package/packages/generation/README.md +11 -1
  175. package/packages/generation/src/mapping.ts +28 -30
  176. package/packages/gpt-image/README.md +1 -2
  177. package/packages/grok-imagine/README.md +1 -2
  178. package/packages/hyperframes/README.md +7 -3
  179. package/packages/hyperframes/src/browser-program.ts +11 -2
  180. package/packages/hyperframes/src/document.ts +15 -2
  181. package/packages/interview-emoji-reveal/README.md +4 -4
  182. package/packages/interview-emoji-reveal/package.json +1 -1
  183. package/packages/interview-emoji-reveal/src/component.ts +4 -4
  184. package/packages/interview-emoji-reveal/src/fragment.ts +6 -5
  185. package/packages/interview-emoji-reveal/src/manifest.ts +9 -8
  186. package/packages/interview-emoji-reveal/src/program.ts +14 -14
  187. package/packages/interview-emoji-reveal/src/surface.ts +8 -9
  188. package/packages/media-execution/README.md +7 -3
  189. package/packages/media-execution/src/audio-presentation.ts +23 -0
  190. package/packages/media-execution/src/execute.ts +2 -0
  191. package/packages/media-pipeline/README.md +7 -3
  192. package/packages/media-pipeline/src/audio-plan.ts +4 -1
  193. package/packages/media-pipeline/src/component.ts +16 -2
  194. package/packages/media-pipeline/src/manifest.ts +3 -1
  195. package/packages/media-pipeline/src/types.ts +2 -1
  196. package/packages/media-track/README.md +14 -47
  197. package/packages/media-track/package.json +1 -1
  198. package/packages/media-track/preview/preview.svml +5 -5
  199. package/packages/media-track/src/author.ts +12 -6
  200. package/packages/media-track/src/component.ts +10 -16
  201. package/packages/media-track/src/fragment.ts +8 -7
  202. package/packages/media-track/src/index.ts +3 -1
  203. package/packages/media-track/src/lower.ts +7 -7
  204. package/packages/media-track/src/manifest.ts +16 -38
  205. package/packages/media-track/src/program.ts +62 -67
  206. package/packages/media-track/src/sampling.ts +6 -6
  207. package/packages/media-track/src/sequence.ts +8 -8
  208. package/packages/media-track/src/surface.ts +25 -43
  209. package/packages/media-track-studio/README.md +9 -0
  210. package/packages/media-track-studio/src/index.ts +23 -13
  211. package/packages/mimo-speech/README.md +1 -1
  212. package/packages/minimax-h3/README.md +1 -1
  213. package/packages/nano-banana/README.md +1 -1
  214. package/packages/narrative/README.md +23 -1
  215. package/packages/narrative/src/identity.ts +11 -0
  216. package/packages/narrative/src/index.ts +3 -0
  217. package/packages/narrative/src/schema.ts +28 -27
  218. package/packages/narrative/src/selection.ts +52 -0
  219. package/packages/narrative/src/types.ts +2 -0
  220. package/packages/package-loader-node/README.md +30 -0
  221. package/packages/package-loader-node/package.json +5 -2
  222. package/packages/package-loader-node/src/distribution-resolution.ts +10 -3
  223. package/packages/package-loader-node/src/index.ts +1 -0
  224. package/packages/package-loader-node/src/loader.ts +12 -15
  225. package/packages/package-loader-node/src/location.ts +27 -1
  226. package/packages/package-loader-node/src/module-scope.ts +183 -0
  227. package/packages/package-loader-node/src/types.ts +4 -0
  228. package/packages/performance/README.md +83 -0
  229. package/packages/performance/package.json +30 -0
  230. package/packages/performance/src/activation.ts +11 -0
  231. package/packages/performance/src/component.ts +46 -0
  232. package/packages/performance/src/index.ts +6 -0
  233. package/packages/performance/src/manifest.ts +53 -0
  234. package/packages/{media-track/src/performance.ts → performance/src/media.ts} +9 -10
  235. package/packages/performance/src/program.ts +51 -0
  236. package/packages/performance/src/style.ts +35 -0
  237. package/packages/performance/src/surface.ts +99 -0
  238. package/packages/performance-studio/README.md +25 -0
  239. package/packages/performance-studio/package.json +21 -0
  240. package/packages/performance-studio/src/activation.ts +6 -0
  241. package/packages/performance-studio/src/index.ts +84 -0
  242. package/packages/program-space/README.md +9 -18
  243. package/packages/program-space/src/activation.ts +1 -5
  244. package/packages/program-space/src/index.ts +2 -11
  245. package/packages/program-space/src/surface.ts +1 -20
  246. package/packages/project-context-node/README.md +20 -0
  247. package/packages/project-context-node/package.json +10 -0
  248. package/packages/project-context-node/src/index.ts +3 -0
  249. package/packages/{cli → project-context-node}/src/runtime-selection.ts +7 -2
  250. package/packages/provider-hyperframes-local/README.md +43 -15
  251. package/packages/provider-hyperframes-local/src/activation.ts +4 -3
  252. package/packages/provider-hyperframes-local/src/capture-process.ts +26 -4
  253. package/packages/provider-hyperframes-local/src/capture.ts +96 -26
  254. package/packages/provider-hyperframes-local/src/concurrency.ts +86 -0
  255. package/packages/provider-hyperframes-local/src/opaque-capture.ts +92 -0
  256. package/packages/provider-hyperframes-local/src/options.ts +2 -0
  257. package/packages/provider-hyperframes-local/src/program.ts +6 -3
  258. package/packages/provider-hyperframes-local/src/progress.ts +53 -0
  259. package/packages/provider-hyperframes-local/src/provider.ts +18 -5
  260. package/packages/provider-hyperframes-local/src/render.ts +48 -7
  261. package/packages/provider-hypihub/README.md +48 -17
  262. package/packages/provider-hypihub/package.json +2 -0
  263. package/packages/provider-hypihub/src/mapping.ts +31 -7
  264. package/packages/provider-hypihub/src/oauth.ts +6 -0
  265. package/packages/provider-hypihub/src/provider.ts +25 -13
  266. package/packages/provider-hypihub/src/routes.ts +1 -2
  267. package/packages/provider-hypihub/src/upload.ts +2 -0
  268. package/packages/provider-media-local/README.md +3 -4
  269. package/packages/provider-whisperx-local/README.md +57 -0
  270. package/packages/provider-whisperx-local/src/program.ts +1 -0
  271. package/packages/provider-whisperx-local/src/provider.ts +3 -0
  272. package/packages/ranking/README.md +8 -6
  273. package/packages/ranking/package.json +1 -1
  274. package/packages/ranking/src/component.ts +6 -6
  275. package/packages/ranking/src/fragment.ts +11 -7
  276. package/packages/ranking/src/manifest.ts +21 -14
  277. package/packages/ranking/src/render.ts +33 -35
  278. package/packages/ranking/src/schedule.ts +16 -19
  279. package/packages/ranking/src/surface.ts +12 -13
  280. package/packages/ranking-studio/README.md +29 -0
  281. package/packages/ranking-studio/package.json +8 -3
  282. package/packages/ranking-studio/src/index.ts +71 -12
  283. package/packages/render-hyperframes/README.md +7 -7
  284. package/packages/render-hyperframes/package.json +1 -1
  285. package/packages/render-hyperframes/src/component.ts +11 -1
  286. package/packages/render-hyperframes/src/fragment.ts +7 -4
  287. package/packages/render-hyperframes/src/manifest.ts +4 -4
  288. package/packages/render-hyperframes/src/surface.ts +6 -6
  289. package/packages/runtime/README.md +8 -1
  290. package/packages/runtime/src/catalog.ts +2 -0
  291. package/packages/runtime/src/execution.ts +15 -4
  292. package/packages/runtime/src/index.ts +2 -1
  293. package/packages/runtime/src/log.ts +51 -0
  294. package/packages/runtime/src/types.ts +5 -8
  295. package/packages/runtime-host-node/README.md +30 -0
  296. package/packages/runtime-host-node/package.json +1 -0
  297. package/packages/runtime-host-node/src/index.ts +25 -9
  298. package/packages/runtime-host-node/src/packages.ts +47 -50
  299. package/packages/runtime-kit/README.md +5 -0
  300. package/packages/runtime-kit/src/index.ts +3 -1
  301. package/packages/runtime-local/README.md +111 -4
  302. package/packages/runtime-local/src/config.ts +202 -56
  303. package/packages/runtime-local/src/control.ts +9 -1
  304. package/packages/runtime-local/src/executor.ts +66 -0
  305. package/packages/runtime-local/src/host.ts +37 -17
  306. package/packages/runtime-local/src/log.ts +48 -0
  307. package/packages/runtime-local/src/programs.ts +41 -25
  308. package/packages/runtime-local/src/result-writer.ts +2 -0
  309. package/packages/runtime-local/src/runtime.ts +10 -6
  310. package/packages/runtime-local/src/supervisor.ts +142 -0
  311. package/packages/runtime-local/src/types.ts +9 -2
  312. package/packages/runtime-local/src/worker-process.ts +7 -24
  313. package/packages/runtime-local/src/worker.ts +55 -83
  314. package/packages/screen-overlay/README.md +3 -3
  315. package/packages/screen-overlay/package.json +1 -1
  316. package/packages/screen-overlay/src/component.ts +3 -3
  317. package/packages/screen-overlay/src/fragment.ts +5 -4
  318. package/packages/screen-overlay/src/manifest.ts +7 -6
  319. package/packages/screen-overlay/src/program.ts +9 -9
  320. package/packages/screen-overlay/src/surface.ts +6 -7
  321. package/packages/script/README.md +37 -2
  322. package/packages/script/src/edit.ts +123 -73
  323. package/packages/script/src/lexical.ts +40 -6
  324. package/packages/script/src/manifest.ts +2 -2
  325. package/packages/script/src/narrative.ts +1 -0
  326. package/packages/script/src/parser.ts +36 -8
  327. package/packages/script/src/surface.ts +4 -3
  328. package/packages/script/src/types.ts +5 -1
  329. package/packages/script-studio/package.json +9 -3
  330. package/packages/script-studio/src/index.ts +2 -0
  331. package/packages/script-studio/src/projection.ts +105 -0
  332. package/packages/seedance/README.md +30 -1
  333. package/packages/seedance/src/index.ts +18 -7
  334. package/packages/seedance/src/surface.ts +17 -4
  335. package/packages/seedance-kits/README.md +10 -2
  336. package/packages/seedance-kits/kits/speaker-v1.svs +5 -5
  337. package/packages/seedream/README.md +1 -1
  338. package/packages/sound/README.md +81 -0
  339. package/packages/sound/package.json +25 -0
  340. package/packages/sound/src/activation.ts +11 -0
  341. package/packages/sound/src/component.ts +28 -0
  342. package/packages/sound/src/index.ts +5 -0
  343. package/packages/sound/src/manifest.ts +47 -0
  344. package/packages/sound/src/program.ts +84 -0
  345. package/packages/sound/src/style.ts +34 -0
  346. package/packages/sound/src/surface.ts +90 -0
  347. package/packages/sound-studio/README.md +22 -0
  348. package/packages/sound-studio/package.json +20 -0
  349. package/packages/sound-studio/src/activation.ts +6 -0
  350. package/packages/sound-studio/src/index.ts +74 -0
  351. package/packages/speech/README.md +2 -2
  352. package/packages/speech-alignment/src/align.ts +45 -21
  353. package/packages/speech-alignment/src/local.ts +8 -0
  354. package/packages/speech-alignment/src/locate.ts +1 -1
  355. package/packages/store-sqlite/README.md +7 -0
  356. package/packages/store-sqlite/src/store.ts +84 -83
  357. package/packages/studio/INSPECTOR.md +117 -0
  358. package/packages/studio/README.md +149 -14
  359. package/packages/studio/package.json +8 -7
  360. package/packages/studio/src/build-library.ts +99 -84
  361. package/packages/studio/src/companion-assembly.ts +1 -0
  362. package/packages/studio/src/domain.ts +1 -1
  363. package/packages/studio/src/fallback-companions.ts +3 -3
  364. package/packages/studio/src/feedback-server.ts +51 -0
  365. package/packages/studio/src/feedback-store.ts +66 -0
  366. package/packages/studio/src/feedback.ts +60 -0
  367. package/packages/studio/src/library-media.ts +19 -0
  368. package/packages/studio/src/parameter-values.ts +83 -1
  369. package/packages/studio/src/parameters.ts +132 -43
  370. package/packages/studio/src/preview/render.ts +5 -1
  371. package/packages/studio/src/preview/runtime-shim.ts +49 -3
  372. package/packages/studio/src/programme.ts +14 -30
  373. package/packages/studio/src/server.ts +66 -34
  374. package/packages/studio/src/shared.ts +24 -8
  375. package/packages/studio/src/snapshot.ts +21 -132
  376. package/packages/studio/src/studio-preflight.ts +3 -3
  377. package/packages/studio/src/studio-registry.ts +72 -6
  378. package/packages/studio/src/style.css +342 -190
  379. package/packages/studio/src/temporal-edit.ts +131 -0
  380. package/packages/studio/src/ui/artifact-name.ts +80 -0
  381. package/packages/studio/src/ui/artifact-preview.ts +99 -0
  382. package/packages/studio/src/ui/comments.ts +233 -0
  383. package/packages/studio/src/ui/icons.ts +10 -1
  384. package/packages/studio/src/ui/library.ts +373 -192
  385. package/packages/studio/src/ui/main.ts +291 -110
  386. package/packages/studio/src/ui/material-preview.ts +1 -1
  387. package/packages/studio/src/ui/overlay.ts +31 -26
  388. package/packages/studio/src/ui/scrub-preview.ts +108 -0
  389. package/packages/studio/src/ui/sidebar-panel.ts +31 -0
  390. package/packages/studio/src/ui/stage.ts +188 -9
  391. package/packages/studio/src/ui/timeline.ts +187 -281
  392. package/packages/studio/start.ts +19 -5
  393. package/packages/studio-adapter/README.md +151 -11
  394. package/packages/studio-adapter/src/index.ts +126 -14
  395. package/packages/temporal/README.md +6 -6
  396. package/packages/temporal/package.json +1 -1
  397. package/packages/temporal/src/component.ts +5 -6
  398. package/packages/temporal/src/index.ts +8 -6
  399. package/packages/temporal/src/location.ts +11 -11
  400. package/packages/temporal/src/projection.ts +19 -19
  401. package/packages/temporal/src/rational.ts +4 -4
  402. package/packages/temporal-markup/EDITING.md +183 -0
  403. package/packages/temporal-markup/README.md +31 -11
  404. package/packages/temporal-markup/package.json +1 -1
  405. package/packages/temporal-markup/src/index.ts +20 -25
  406. package/packages/temporal-markup/src/space.ts +10 -41
  407. package/packages/timeline/README.md +31 -0
  408. package/packages/{semantic-track → timeline}/package.json +1 -1
  409. package/packages/timeline/src/activation.ts +8 -0
  410. package/packages/timeline/src/component.ts +24 -0
  411. package/packages/timeline/src/identity.ts +60 -0
  412. package/packages/timeline/src/index.ts +6 -0
  413. package/packages/{semantic-track → timeline}/src/location.ts +20 -20
  414. package/packages/timeline/src/manifest.ts +39 -0
  415. package/packages/{semantic-track → timeline}/src/projection.ts +14 -14
  416. package/packages/timeline/src/types.ts +24 -0
  417. package/packages/timeline-author/README.md +68 -0
  418. package/packages/{speech-track → timeline-author}/package.json +6 -4
  419. package/packages/timeline-author/src/activation.ts +22 -0
  420. package/packages/{speech-track → timeline-author}/src/component.ts +15 -13
  421. package/packages/{speech-track → timeline-author}/src/fragment.ts +14 -23
  422. package/packages/timeline-author/src/index.ts +7 -0
  423. package/packages/timeline-author/src/manifest.ts +78 -0
  424. package/packages/timeline-author/src/program.ts +107 -0
  425. package/packages/timeline-author/src/surface.ts +46 -0
  426. package/packages/timeline-author/src/types.ts +6 -0
  427. package/packages/typography-track/README.md +4 -4
  428. package/packages/typography-track/package.json +1 -1
  429. package/packages/typography-track/src/component.ts +4 -4
  430. package/packages/typography-track/src/fragment.ts +4 -3
  431. package/packages/typography-track/src/manifest.ts +11 -9
  432. package/packages/typography-track/src/program.ts +15 -15
  433. package/packages/typography-track/src/surface.ts +17 -18
  434. package/packages/typography-track-studio/package.json +8 -3
  435. package/packages/typography-track-studio/src/index.ts +5 -1
  436. package/packages/video-cli/README.md +16 -4
  437. package/packages/video-cli/package.json +2 -1
  438. package/packages/video-cli/src/creation.ts +25 -9
  439. package/packages/video-cli/src/index.ts +1 -1
  440. package/packages/video-cli/src/studio-distribution.ts +2 -1
  441. package/packages/volcengine-matting/README.md +3 -3
  442. package/packages/whisperx/README.md +8 -1
  443. package/packages/workspace/src/index.ts +2 -0
  444. package/packages/workspace-fs-node/README.md +4 -1
  445. package/packages/workspace-fs-node/src/workspace.ts +3 -1
  446. package/services/whisperx/README.md +14 -0
  447. package/services/whisperx/pyproject.toml +2 -0
  448. package/services/whisperx/uv.lock +20 -20
  449. package/packages/provider-hyperframes-aws-lambda/README.md +0 -30
  450. package/packages/provider-hyperframes-aws-lambda/package.json +0 -30
  451. package/packages/provider-hyperframes-aws-lambda/src/activation.ts +0 -97
  452. package/packages/provider-hyperframes-aws-lambda/src/client.ts +0 -114
  453. package/packages/provider-hyperframes-aws-lambda/src/index.ts +0 -21
  454. package/packages/provider-hyperframes-aws-lambda/src/provider.ts +0 -522
  455. package/packages/provider-kie/README.md +0 -134
  456. package/packages/provider-kie/package.json +0 -43
  457. package/packages/provider-kie/src/activation.ts +0 -71
  458. package/packages/provider-kie/src/index.ts +0 -10
  459. package/packages/provider-kie/src/mapping.ts +0 -182
  460. package/packages/provider-kie/src/provider.ts +0 -657
  461. package/packages/provider-kie/src/routes.ts +0 -150
  462. package/packages/provider-xiaomi-mimo/README.md +0 -32
  463. package/packages/provider-xiaomi-mimo/src/activation.ts +0 -57
  464. package/packages/provider-xiaomi-mimo/src/index.ts +0 -5
  465. package/packages/provider-xiaomi-mimo/src/provider.ts +0 -214
  466. package/packages/runtime/src/environment.ts +0 -6
  467. package/packages/semantic-track/README.md +0 -21
  468. package/packages/semantic-track/src/activation.ts +0 -8
  469. package/packages/semantic-track/src/component.ts +0 -24
  470. package/packages/semantic-track/src/identity.ts +0 -58
  471. package/packages/semantic-track/src/index.ts +0 -6
  472. package/packages/semantic-track/src/manifest.ts +0 -38
  473. package/packages/semantic-track/src/types.ts +0 -26
  474. package/packages/speech-track/README.md +0 -51
  475. package/packages/speech-track/src/activation.ts +0 -19
  476. package/packages/speech-track/src/index.ts +0 -7
  477. package/packages/speech-track/src/manifest.ts +0 -73
  478. package/packages/speech-track/src/program.ts +0 -64
  479. package/packages/speech-track/src/surface.ts +0 -35
  480. package/packages/speech-track/src/types.ts +0 -6
  481. package/packages/speech-track-studio/README.md +0 -3
  482. package/packages/speech-track-studio/package.json +0 -14
  483. package/packages/speech-track-studio/src/activation.ts +0 -7
  484. package/packages/speech-track-studio/src/index.ts +0 -40
  485. /package/packages/{cli → project-context-node}/src/project-context.ts +0 -0
  486. /package/packages/{speech-track → timeline-author}/preview/Track.png +0 -0
@@ -15,12 +15,13 @@ import type { ServedFile } from "./compile.js";
15
15
  import type { StudioDomain } from "./domain.js";
16
16
  import type { StudioCompanionRegistry } from "./studio-registry.js";
17
17
  import { loadStudioRun } from "./run.js";
18
- import { serializeParameterValue, validateParameterValue } from "./parameter-values.js";
18
+ import { parameterAuthorValue, parameterOption, serializeParameterValue, serializeAttributeGroup, validateParameterValue } from "./parameter-values.js";
19
19
  import { readStudioSession } from "./session.js";
20
- import type { Range, StudioFailure, StudioLibraryView, StudioMutation, StudioSnapshot } from "./shared.js";
20
+ import type { Range, StudioFailure, StudioLibraryRequest, StudioLibraryView, StudioMutation, StudioSnapshot } from "./shared.js";
21
21
  import { createStudioStoryboard } from "./storyboard.js";
22
22
  import type { StudioStoryboard } from "./storyboard.js";
23
23
  import { findSurfacePreview } from "./surface-preview.js";
24
+ import { formatTemporalPointEdit, semanticGestureSpan } from "./temporal-edit.js";
24
25
  import { replaceSourceFiles } from "./source-transaction.js";
25
26
 
26
27
  export type StudioPluginOptions = {
@@ -93,8 +94,9 @@ export function studioPlugin(options: StudioPluginOptions): Plugin {
93
94
  const watchedFiles = new Set<string>();
94
95
  const storyboards = new Map<string, Promise<StudioStoryboard>>();
95
96
 
96
- const readLibrary = async (before?: string): Promise<StudioLibraryView> => {
97
- return await options.buildLibrary?.library(before) ?? {
97
+ const readLibrary = async (request: StudioLibraryRequest): Promise<StudioLibraryView> => {
98
+ return await options.buildLibrary?.library(request) ?? {
99
+ section: request.section,
98
100
  environment: options.workspaceRoot,
99
101
  tasks: [],
100
102
  artifacts: [],
@@ -271,7 +273,7 @@ export function studioPlugin(options: StudioPluginOptions): Plugin {
271
273
  throw new Error("A timeline target must use valid whole frames.");
272
274
  }
273
275
  if (temporal.kind === "window") {
274
- if (mutation.gesture === "move"
276
+ if (mutation.gesture === "move" && handle.semantic?.kind !== "selection"
275
277
  && endFrameExclusive - startFrame !== clip.endFrameExclusive - clip.startFrame) {
276
278
  throw new Error("Move must preserve the Window duration.");
277
279
  }
@@ -287,6 +289,7 @@ export function studioPlugin(options: StudioPluginOptions): Plugin {
287
289
 
288
290
  const patches: Patch[] = [];
289
291
  const semanticTarget = mutation.target.semantic;
292
+ if (handle.semantic !== undefined && semanticTarget === undefined) throw new Error("A semantic edit requires explicit target anchors.");
290
293
  if (semanticTarget !== undefined) {
291
294
  if (handle.semantic?.kind !== semanticTarget.kind) {
292
295
  throw new Error(`Entity ${mutation.entityId} is not bound to a writable ${semanticTarget.kind}.`);
@@ -298,15 +301,9 @@ export function studioPlugin(options: StudioPluginOptions): Plugin {
298
301
  || script.narrativeId !== current.semantic.narrativeId) {
299
302
  throw new Error("The timeline entity and writable Script do not belong to the selected Narrative.");
300
303
  }
301
- if (semanticTarget.kind === "selection") {
302
- const startIndex = current.semantic.anchors.findIndex((anchor) => anchor.id === semanticTarget.startAnchorId);
303
- const endIndex = current.semantic.anchors.findIndex((anchor) => anchor.id === semanticTarget.endAnchorId);
304
- if (startIndex < 0 || endIndex < 0 || startIndex >= endIndex
305
- || current.semantic.anchors[startIndex]!.frame >= current.semantic.anchors[endIndex]!.frame) {
306
- throw new Error("A Selection must span two ordered semantic Anchors with positive time.");
307
- }
308
- } else if (!current.semantic.anchors.some((anchor) => anchor.id === semanticTarget.anchorId)) {
309
- throw new Error(`Moment Anchor ${semanticTarget.anchorId} does not exist in the current semantic Candidate.`);
304
+ const projected = semanticGestureSpan(current.semantic.anchors, handle, semanticTarget);
305
+ if (projected === undefined || projected.startFrame !== startFrame || projected.endFrameExclusive !== endFrameExclusive) {
306
+ throw new Error("The semantic edit does not produce the requested timeline projection.");
310
307
  }
311
308
  const absolute = resolve(options.workspaceRoot, script.sourcePath);
312
309
  const source = await readFile(absolute, "utf8");
@@ -366,20 +363,15 @@ export function studioPlugin(options: StudioPluginOptions): Plugin {
366
363
  }
367
364
  return snapshot?.semantic?.moments.find((candidate) => candidate.id === id)?.frame;
368
365
  };
369
- const projectedPointValue = (endpoint: StudioTemporalInstantProjection, desired: number): string => {
370
- if (endpoint.reference === "absolute") return frame(desired);
371
- const base = projectionBaseFrame(endpoint);
372
- if (base === undefined) throw new Error(`The ${endpoint.reference} projection base is unavailable.`);
373
- const offset = desired - base;
374
- return offset === 0 ? endpoint.reference : `${endpoint.reference}${offset > 0 ? "+" : ""}${offset}f`;
375
- };
366
+ const projectedPointValue = (endpoint: StudioTemporalInstantProjection, desired: number): string =>
367
+ formatTemporalPointEdit(endpoint.reference, desired, projectionBaseFrame(endpoint));
376
368
  const writeEndpoint = (
377
369
  endpoint: StudioTemporalInstantProjection,
378
370
  desired: number,
379
371
  role: "start" | "end",
380
372
  ): void => {
381
373
  if (desired === endpoint.frame) return;
382
- if (endpoint.authority.kind === "fixed") throw new Error(`The ${role} endpoint is structurally fixed.`);
374
+ if (endpoint.authority.kind === "fixed") throw new Error(`The ${role} endpoint has no timeline write target.`);
383
375
  if (endpoint.authority.kind === "semantic") {
384
376
  if (semanticFrame(endpoint) !== desired) throw new Error(`The ${role} endpoint does not match its semantic Anchor.`);
385
377
  return;
@@ -410,26 +402,32 @@ export function studioPlugin(options: StudioPluginOptions): Plugin {
410
402
  if (mutation.type === "timeline.adjust") return timelinePatches(mutation);
411
403
  const clip = currentClip(mutation.entityId);
412
404
  const parameter = clip.inspector.find((candidate) => candidate.id === mutation.parameterId);
413
- if (parameter === undefined) {
405
+ if (parameter?.edit === undefined) {
414
406
  throw new Error(`Entity ${mutation.entityId} has no writable parameter ${mutation.parameterId}.`);
415
407
  }
408
+ const authorValue = parameterAuthorValue(parameter, mutation.value);
416
409
  if (parameter.schema !== undefined) {
417
- validateParameterValue(mutation.value, parameter.schema, parameter.label);
410
+ validateParameterValue(authorValue, parameter.schema, parameter.label);
418
411
  } else if (parameter.control === "boolean" && typeof mutation.value !== "boolean") {
419
412
  throw new Error(`${parameter.label} expects true or false.`);
420
413
  } else if (parameter.control === "number" && (typeof mutation.value !== "number" || !Number.isFinite(mutation.value))) {
421
414
  throw new Error(`${parameter.label} expects a number.`);
422
- } else if ((parameter.control === "text" || parameter.control === "color" || parameter.control === "select")
415
+ } else if ((parameter.control === "text" || parameter.control === "color")
423
416
  && typeof mutation.value !== "string") {
424
417
  throw new Error(`${parameter.label} expects text.`);
425
418
  }
426
- if (parameter.options !== undefined && (typeof mutation.value !== "string" || !parameter.options.includes(mutation.value))) {
419
+ if (parameter.options !== undefined && !parameter.options.some(option => parameterOption(option).value === authorValue)) {
427
420
  throw new Error(`${parameter.label} does not accept ${mutation.value}.`);
428
421
  }
429
- const encoded = serializeParameterValue(mutation.value, parameter.language);
430
- const replacement = `${parameter.source.prefix ?? ""}${encoded}${parameter.source.suffix ?? ""}`;
431
- return replacement === parameter.source.preimage ? [] : [{
432
- ...parameter.source,
422
+ if (parameter.control === "color") validateParameterValue(authorValue, { kind: "string", format: "color" }, parameter.label);
423
+ if (parameter.edit.attributes) {
424
+ const replacement = serializeAttributeGroup(parameter, authorValue);
425
+ return replacement === parameter.edit.source.preimage ? [] : [{ ...parameter.edit.source, replacement }];
426
+ }
427
+ const encoded = serializeParameterValue(authorValue, parameter.edit.language);
428
+ const replacement = `${parameter.edit.source.prefix ?? ""}${encoded}${parameter.edit.source.suffix ?? ""}`;
429
+ return replacement === parameter.edit.source.preimage ? [] : [{
430
+ ...parameter.edit.source,
433
431
  replacement,
434
432
  }];
435
433
  };
@@ -525,6 +523,28 @@ export function studioPlugin(options: StudioPluginOptions): Plugin {
525
523
  })();
526
524
  return;
527
525
  }
526
+ if (request.method === "PUT" && url.pathname === "/__studio/artifact-name") {
527
+ void (async () => {
528
+ try {
529
+ const chunks: Buffer[] = [];
530
+ for await (const chunk of request) chunks.push(Buffer.from(chunk));
531
+ const body = JSON.parse(Buffer.concat(chunks).toString("utf8")) as {
532
+ build?: unknown; output?: unknown; displayName?: unknown;
533
+ };
534
+ if (typeof body.build !== "string" || typeof body.output !== "string"
535
+ || (typeof body.displayName !== "string" && body.displayName !== null)) {
536
+ json(response, 400, { error: "Expected Build, Output and displayName" });
537
+ return;
538
+ }
539
+ if (options.buildLibrary === undefined) throw new Error("Result Repository is unavailable");
540
+ const displayName = await options.buildLibrary.renameArtifact(body.build, body.output, body.displayName);
541
+ json(response, 200, { displayName: displayName ?? null });
542
+ } catch (error) {
543
+ json(response, 422, { error: error instanceof Error ? error.message : String(error) });
544
+ }
545
+ })();
546
+ return;
547
+ }
528
548
  if (request.method === "POST" && url.pathname === "/__studio/mutation") {
529
549
  void (async () => {
530
550
  try {
@@ -577,8 +597,21 @@ export function studioPlugin(options: StudioPluginOptions): Plugin {
577
597
  return;
578
598
  }
579
599
  if (url.pathname === "/__studio/library") {
600
+ const section = url.searchParams.get("section");
601
+ if (section !== "tasks" && section !== "artifacts") {
602
+ json(response, 400, { error: "Choose tasks or artifacts with the section parameter" });
603
+ return;
604
+ }
605
+ const media = url.searchParams.get("media") ?? undefined;
606
+ if (media !== undefined && media !== "image" && media !== "video" && media !== "audio") {
607
+ json(response, 400, { error: "Choose image, video or audio with the media parameter" });
608
+ return;
609
+ }
580
610
  const before = url.searchParams.get("before") ?? undefined;
581
- void readLibrary(before).then(
611
+ const run = url.searchParams.get("run") ?? undefined;
612
+ const build = url.searchParams.get("build") ?? undefined;
613
+ void readLibrary({ section, ...(media === undefined ? {} : { media }), ...(before === undefined ? {} : { before }),
614
+ ...(run === undefined ? {} : { run }), ...(build === undefined ? {} : { build }) }).then(
582
615
  (view) => json(response, 200, view),
583
616
  (error) => json(response, 500, { error: error instanceof Error ? error.message : String(error) }),
584
617
  );
@@ -662,13 +695,12 @@ export function studioPlugin(options: StudioPluginOptions): Plugin {
662
695
  void (async () => {
663
696
  const build = url.searchParams.get("build");
664
697
  const output = url.searchParams.get("output");
665
- const valuePath = url.searchParams.get("path");
666
- if (build === null || output === null || valuePath === null || options.buildLibrary === undefined) {
698
+ if (build === null || output === null || options.buildLibrary === undefined) {
667
699
  response.statusCode = 404;
668
700
  response.end();
669
701
  return;
670
702
  }
671
- const artifact = await options.buildLibrary.openArtifact(build, output, valuePath);
703
+ const artifact = await options.buildLibrary.openArtifact(build, output);
672
704
  if (artifact === undefined) {
673
705
  response.statusCode = 404;
674
706
  response.end();
@@ -9,6 +9,7 @@ import type {
9
9
  StudioIcon,
10
10
  StudioEditHandle,
11
11
  StudioLaneDescription,
12
+ StudioTrackBand,
12
13
  StudioMaterialPreview,
13
14
  StudioInspectorField,
14
15
  StudioInspectorDomain,
@@ -63,6 +64,7 @@ export type StudioTrackBinding = {
63
64
  readonly companion: string;
64
65
  /** Studio-local partition key for an attached projection. */
65
66
  readonly attachmentId?: string;
67
+ readonly bands?: readonly Omit<StudioTrackBand, "bindings" | "inspector">[];
66
68
  readonly lane: StudioLaneDescription;
67
69
  readonly authoredTag?: string;
68
70
  readonly references: readonly { readonly name: string; readonly type: string }[];
@@ -95,6 +97,8 @@ export type Clip = {
95
97
  readonly presentId?: string;
96
98
  /** The authored id this Present is named after, when it names one. */
97
99
  readonly authoredId: string;
100
+ readonly selectionGroup?: string;
101
+ readonly band?: string;
98
102
  /** The Script marker that placed it, when something said put it there. */
99
103
  readonly markerId?: string;
100
104
  readonly display: StudioEntityDisplay;
@@ -190,12 +194,14 @@ export type StudioTaskView = {
190
194
  readonly note?: string;
191
195
  readonly highlightedOutputs?: readonly string[];
192
196
  readonly createdAt: number;
193
- readonly status: "queued" | "running" | "waiting" | "complete" | "failed" | "cancelled" | "active" | "blocked" | "unknown";
197
+ readonly finishedAt?: number;
198
+ readonly ongoing: boolean;
199
+ readonly status: "queued" | "running" | "waiting" | "complete" | "failed" | "cancelled" | "saving-result" | "attention";
200
+ readonly detail?: string;
201
+ readonly requests?: { readonly total: number; readonly completed: number };
194
202
  readonly source: string;
195
203
  readonly run?: string;
196
204
  readonly targets: readonly string[];
197
- readonly acceptedRecords: number;
198
- readonly outstandingCommands: number;
199
205
  readonly operations: readonly {
200
206
  readonly status: "pending" | "completed" | "failed" | "cancelled";
201
207
  readonly phase?: string;
@@ -206,7 +212,10 @@ export type StudioTaskView = {
206
212
  };
207
213
 
208
214
  export type StudioArtifactView = {
209
- /** Build-qualified identity derived from the public Output and its value path. */
215
+ readonly nameEditable?: boolean;
216
+ /** Author-provided display name; the Output identifier remains unchanged. */
217
+ readonly displayName?: string;
218
+ /** File-owner identity; references to the same file share one card. */
210
219
  readonly id: string;
211
220
  readonly build: string;
212
221
  readonly createdAt: number;
@@ -214,18 +223,27 @@ export type StudioArtifactView = {
214
223
  readonly highlighted: boolean;
215
224
  readonly buildTitle?: string;
216
225
  readonly buildNote?: string;
217
- readonly valuePath: string;
218
- readonly ownerBuild: string;
226
+ readonly ownerBuild?: string;
219
227
  readonly ownerOutput: string;
220
228
  readonly filePath: string;
221
229
  readonly size: number;
222
230
  readonly mediaType: string;
223
231
  readonly source: string;
224
232
  readonly run?: string;
233
+ readonly origins: readonly { readonly build: string; readonly output: string; readonly run?: string; readonly source: string }[];
234
+ };
235
+
236
+ export type StudioLibraryRequest = {
237
+ readonly media?: "image" | "video" | "audio";
238
+ readonly section: "tasks" | "artifacts";
239
+ readonly before?: string;
240
+ readonly run?: string;
241
+ readonly build?: string;
225
242
  };
226
243
 
227
244
  /** Read-only view of the Runtime context selected for this Studio environment. */
228
245
  export type StudioLibraryView = {
246
+ readonly section: StudioLibraryRequest["section"];
229
247
  readonly environment: string;
230
248
  readonly runtime?: string;
231
249
  /** Cursor for the next older page of immutable Build Results. */
@@ -267,8 +285,6 @@ export type StudioSnapshot = {
267
285
  /** The Tracks, compiled into the document the renderer photographs. */
268
286
  readonly preview: { readonly kind: "hyperframes"; readonly srcdoc: string };
269
287
  readonly provenance: {
270
- /** Where the timeline came from. The frame domain always shares its source. */
271
- readonly timing: "measured" | "authored";
272
288
  readonly picture: "resolved";
273
289
  /** What the badges above are standing for, in one sentence. */
274
290
  readonly note: string;
@@ -1,16 +1,15 @@
1
+ import { composeParameterDeclarations } from "./parameters.js";
1
2
  /**
2
3
  * Turn a built programme into what the panels read.
3
4
  *
4
- * A timeline is the Presents of every Track, and a Present carries a span, an
5
- * identity and a stacking order - the whole contract, for every package. So the
6
- * timeline is assembled without knowing what made any of it, and a package that
7
- * grows a new Track shows up without this file changing.
5
+ * The Timeline owns the work range. Companions project selectable entities onto
6
+ * that range without extending it or requiring component-specific editor code.
8
7
  */
9
8
  import { relative } from "node:path";
10
9
 
11
10
  import type { MarkupSurfaceRegistryLike } from "@hypit/markup";
12
11
  import { compositionTypes } from "@hypit/composition";
13
- import { narrativeTypes } from "@hypit/narrative";
12
+ import { programSpaceFrameCount } from "@hypit/program-space";
14
13
  import { sameModule, sameType } from "@hypit/protocol";
15
14
 
16
15
  import type {
@@ -138,43 +137,10 @@ function scriptMap(
138
137
  };
139
138
  }
140
139
 
141
- type NarrativeValue = {
142
- readonly id?: string;
143
- readonly segments?: readonly {
144
- readonly id: string;
145
- readonly startAnchorId: string;
146
- readonly endAnchorId: string;
147
- }[];
148
- readonly tokens?: readonly {
149
- readonly id: string;
150
- readonly segmentId: string;
151
- readonly startAnchorId: string;
152
- readonly endAnchorId: string;
153
- readonly text: string;
154
- }[];
155
- readonly selections?: readonly {
156
- readonly id: string;
157
- readonly startAnchorId: string;
158
- readonly endAnchorId: string;
159
- }[];
160
- readonly moments?: readonly {
161
- readonly id: string;
162
- readonly anchorId: string;
163
- }[];
164
- readonly semanticIndex?: {
165
- readonly anchors?: readonly {
166
- readonly id: string;
167
- readonly kind: "program-start" | "segment-start" | "segment-end" | "token-start" | "token-end" | "program-end";
168
- readonly segmentId?: string;
169
- readonly tokenId?: string;
170
- }[];
171
- };
172
- };
173
-
174
140
  /**
175
141
  * Project the compiled Narrative into the frame domain that the preview is
176
142
  * already using. No frontend timing is invented here: if an anchor is absent
177
- * from the built SemanticTrack, the corresponding item is simply not drawable yet.
143
+ * from the built Timeline, the corresponding item is simply not drawable yet.
178
144
  */
179
145
  function semanticTimeline(
180
146
  registry: StudioCompanionRegistry,
@@ -182,77 +148,13 @@ function semanticTimeline(
182
148
  script: ScriptMap | undefined,
183
149
  ): SemanticTimeline | undefined {
184
150
  if (built.narrativeId === undefined) return undefined;
185
- const records = built.source.compiled.program.records.filter((item) =>
186
- sameType(item.type, narrativeTypes.narrative)
187
- && item.value.kind === "inline"
188
- && (item.value.value as NarrativeValue).id === built.narrativeId);
189
- if (records.length > 1) {
190
- throw new Error(`Studio Narrative id ${built.narrativeId} resolves to more than one authored value.`);
191
- }
192
- const record = records[0];
193
- const narrative = record?.value.kind === "inline"
194
- ? record.value.value as NarrativeValue
195
- : undefined;
196
- if (narrative === undefined) throw new Error("Studio Narrative is not an inline authored value.");
197
-
198
- const segmentRanges = new Map((script?.segments ?? []).map((item) => [item.id, item.range]));
199
- const tokenRanges = new Map((script?.tokens ?? []).map((item) => [item.id, item.range]));
200
- const frame = (id: string): number | undefined => built.anchors.get(id);
201
-
202
- const segments = (narrative.segments ?? []).flatMap((segment) => {
203
- const startFrame = frame(segment.startAnchorId);
204
- const endFrame = frame(segment.endAnchorId);
205
- if (startFrame === undefined || endFrame === undefined) return [];
206
- return [{
207
- id: segment.id,
208
- startFrame,
209
- endFrameExclusive: Math.max(startFrame + 1, endFrame),
210
- ...(segmentRanges.has(segment.id) ? { range: segmentRanges.get(segment.id)! } : {}),
211
- }];
151
+ if (script === undefined) throw new Error("Timeline's Script has no Studio source mapping.");
152
+ const projected = registry.projectScript({ source: script, anchors: built.anchors,
153
+ values: built.source.compiled.program.records.flatMap(record => record.value.kind === "inline"
154
+ ? [{ id: record.id, type: record.type, value: record.value.value }] : []),
212
155
  });
213
- const tokens = (narrative.tokens ?? []).flatMap((token) => {
214
- const startFrame = frame(token.startAnchorId);
215
- const endFrame = frame(token.endAnchorId);
216
- if (startFrame === undefined || endFrame === undefined) return [];
217
- return [{
218
- id: token.id,
219
- segmentId: token.segmentId,
220
- text: token.text,
221
- startFrame,
222
- endFrameExclusive: Math.max(startFrame + 1, endFrame),
223
- ...(tokenRanges.has(token.id) ? { range: tokenRanges.get(token.id)! } : {}),
224
- }];
225
- });
226
- const anchors = (narrative.semanticIndex?.anchors ?? []).flatMap((anchor) => {
227
- const at = frame(anchor.id);
228
- if (at === undefined) return [];
229
- return [{
230
- id: anchor.id,
231
- kind: anchor.kind,
232
- frame: at,
233
- ...(anchor.segmentId === undefined ? {} : { segmentId: anchor.segmentId }),
234
- ...(anchor.tokenId === undefined ? {} : { tokenId: anchor.tokenId }),
235
- }];
236
- });
237
- const selections = (narrative.selections ?? []).flatMap((selection) => {
238
- const startFrame = frame(selection.startAnchorId);
239
- const endFrameExclusive = frame(selection.endAnchorId);
240
- if (startFrame === undefined || endFrameExclusive === undefined || endFrameExclusive <= startFrame) return [];
241
- return [{
242
- id: selection.id,
243
- startAnchorId: selection.startAnchorId,
244
- endAnchorId: selection.endAnchorId,
245
- startFrame,
246
- endFrameExclusive,
247
- }];
248
- });
249
- const moments = (narrative.moments ?? []).flatMap((moment) => {
250
- const at = frame(moment.anchorId);
251
- return at === undefined ? [] : [{ id: moment.id, anchorId: moment.anchorId, frame: at }];
252
- });
253
- if (segments.length === 0) throw new Error("Studio SemanticTrack resolves no authored Segment anchors.");
254
156
  const provenance: CandidateProvenance = {
255
- output: built.timingOutput?.name ?? "SemanticTrack",
157
+ output: built.timingOutput?.name ?? "Timeline",
256
158
  ...(built.timingOutput?.ref === undefined ? {} : { outputRef: built.timingOutput.ref }),
257
159
  ...(built.timingCandidateId === undefined ? {} : { candidateId: built.timingCandidateId }),
258
160
  origin: built.timingCandidateOrigin,
@@ -262,17 +164,10 @@ function semanticTimeline(
262
164
  return {
263
165
  spaceId: built.space.id,
264
166
  narrativeId: built.narrativeId,
265
- // Semantic is a Studio lane with its own registered meaning. Do not copy
266
- // the authored Speech Track id into this label: it is the timebase, not a
267
- // second Speech output.
167
+ // The generic ruler presentation is independent of the authored Timeline id.
268
168
  presentation: registry.semanticTimelinePresentation(),
269
- // Narrative order is the semantic ruler. Frame ties are common and must
270
- // not erase the discrete 2M+2N+2 anchor ordering used by writeback.
271
- anchors,
272
- segments: segments.sort((left, right) => left.startFrame - right.startFrame || left.id.localeCompare(right.id)),
273
- tokens: tokens.sort((left, right) => left.startFrame - right.startFrame || left.id.localeCompare(right.id)),
274
- selections: selections.sort((left, right) => left.startFrame - right.startFrame || left.id.localeCompare(right.id)),
275
- moments: moments.sort((left, right) => left.frame - right.frame || left.id.localeCompare(right.id)),
169
+ // Preserve the Companion's ordered anchors, including coincident boundaries.
170
+ ...projected,
276
171
  provenance,
277
172
  };
278
173
  }
@@ -338,13 +233,18 @@ export function snapshot(registry: StudioCompanionRegistry, built: Preview, inpu
338
233
  semantic,
339
234
  generic,
340
235
  }).map((draft) => {
236
+ const declarations = composeParameterDeclarations({
237
+ placement, draft, placements: built.source.observations.placements, registry,
238
+ bindings: registry.bindingDeclarations(item, placement, draft.lane, draft.band),
239
+ inspector: registry.inspectorDeclarations(item, placement, draft.lane, draft.band),
240
+ });
341
241
  const bindings = sourceBindingsForDraft({
342
242
  root: input.workspaceRoot,
343
243
  files: input.sourceFiles,
344
244
  placement,
345
245
  draft,
346
246
  declarations: [
347
- ...registry.bindingDeclarations(item, placement, draft.lane),
247
+ ...declarations.bindings,
348
248
  ...temporalBindingDeclarations(draft.temporal),
349
249
  ],
350
250
  placements: built.source.observations.placements,
@@ -352,7 +252,7 @@ export function snapshot(registry: StudioCompanionRegistry, built: Preview, inpu
352
252
  const inspector = inspectorFieldsForBindings(
353
253
  draft,
354
254
  bindings,
355
- registry.inspectorDeclarations(item, placement, draft.lane),
255
+ declarations.inspector,
356
256
  );
357
257
  const editHandles = resolveTimelineEditHandles(
358
258
  bindings,
@@ -404,17 +304,7 @@ export function snapshot(registry: StudioCompanionRegistry, built: Preview, inpu
404
304
  // root that produced them in this list.
405
305
  const rows = tracks.map((track, row) => ({ ...track, row }));
406
306
 
407
- const declared = (built.space as { durationSec?: number; frameRate?: { numerator: number; denominator: number } })
408
- ?.durationSec;
409
- const frameCount = Math.max(
410
- 1,
411
- declared === undefined
412
- ? 0
413
- : Math.round(declared * input.frameRate.numerator / input.frameRate.denominator),
414
- ...rows.flatMap((track) => track.clips.map((clip) => clip.endFrameExclusive)),
415
- ...(semantic?.segments ?? []).map((segment) => segment.endFrameExclusive),
416
- ...(semantic?.tokens ?? []).map((token) => token.endFrameExclusive),
417
- );
307
+ const frameCount = programSpaceFrameCount(built.space);
418
308
  return {
419
309
  revision: input.revision,
420
310
  source: {
@@ -442,7 +332,6 @@ export function snapshot(registry: StudioCompanionRegistry, built: Preview, inpu
442
332
  ...(semantic === undefined ? {} : { semantic }),
443
333
  preview: input.preview,
444
334
  provenance: {
445
- timing: built.timing,
446
335
  picture: "resolved",
447
336
  note: note(built),
448
337
  },
@@ -1,7 +1,7 @@
1
1
  import type { Candidate } from "@hypit/protocol";
2
2
  import { sameType } from "@hypit/protocol";
3
3
  import type { StudioFilmCompanion } from "@hypit/studio-adapter";
4
- import { semanticTrackTypes } from "@hypit/semantic-track";
4
+ import { timelineTypes } from "@hypit/timeline";
5
5
 
6
6
  import type { CompiledSource } from "./compile.js";
7
7
  import type { Placement } from "./observe.js";
@@ -137,7 +137,7 @@ export function inspectStudioRun(
137
137
  });
138
138
  const timeOutput = times[0];
139
139
  if (times.length !== 1) issues.push("Film requires one traceable time source.");
140
- const semanticOutput = timeOutput !== undefined && sameType(timeOutput.typeRef, semanticTrackTypes.track) ? timeOutput : undefined;
140
+ const semanticOutput = timeOutput !== undefined && sameType(timeOutput.typeRef, timelineTypes.track) ? timeOutput : undefined;
141
141
  let companionValueRefs: readonly string[] = [];
142
142
  try {
143
143
  companionValueRefs = unique(filmTrackRefs.flatMap((ref) =>
@@ -149,7 +149,7 @@ export function inspectStudioRun(
149
149
 
150
150
  const projectionRefs = unique([
151
151
  ...filmTrackRefs,
152
- ...(semanticOutput !== undefined && sameType(semanticOutput.typeRef, semanticTrackTypes.track) ? [semanticOutput.ref] : []),
152
+ ...(semanticOutput !== undefined && sameType(semanticOutput.typeRef, timelineTypes.track) ? [semanticOutput.ref] : []),
153
153
  ...companionValueRefs,
154
154
  ]);
155
155
  const projections: StudioViewRequirement[] = [];