@hypit/hypit 0.1.4 → 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 (449) hide show
  1. package/README.md +4 -2
  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 +77 -15
  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 +32 -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 +28 -17
  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 +11 -0
  63. package/packages/build-result/src/decode.ts +2 -0
  64. package/packages/build-result/src/execution-log.ts +17 -0
  65. package/packages/build-result/src/index.ts +1 -0
  66. package/packages/build-result/src/store.ts +14 -1
  67. package/packages/build-result/src/types.ts +3 -0
  68. package/packages/build-result-s3/src/repository.ts +4 -0
  69. package/packages/caption/README.md +61 -73
  70. package/packages/caption/package.json +3 -2
  71. package/packages/caption/src/activation.ts +2 -2
  72. package/packages/caption/src/component.ts +20 -5
  73. package/packages/caption/src/display.ts +3 -18
  74. package/packages/caption/src/fragment.ts +3 -7
  75. package/packages/caption/src/index.ts +6 -5
  76. package/packages/caption/src/manifest.ts +29 -46
  77. package/packages/caption/src/style.ts +24 -135
  78. package/packages/caption/src/surface.ts +12 -92
  79. package/packages/caption/src/temporalize.ts +18 -53
  80. package/packages/caption/src/types.ts +8 -35
  81. package/packages/caption/src/visibility.ts +23 -0
  82. package/packages/caption-fine/README.md +14 -9
  83. package/packages/caption-fine/package.json +4 -2
  84. package/packages/caption-fine/src/component.ts +3 -3
  85. package/packages/caption-fine/src/fragment.ts +7 -19
  86. package/packages/caption-fine/src/index.ts +2 -0
  87. package/packages/caption-fine/src/manifest.ts +26 -17
  88. package/packages/caption-fine/src/recipe.ts +7 -0
  89. package/packages/caption-fine/src/render.ts +14 -13
  90. package/packages/caption-fine/src/schedule.ts +39 -35
  91. package/packages/caption-fine/src/style.ts +10 -9
  92. package/packages/caption-fine/src/surface.ts +62 -35
  93. package/packages/caption-fine/src/types.ts +2 -0
  94. package/packages/caption-fine-studio/README.md +24 -2
  95. package/packages/caption-fine-studio/package.json +3 -1
  96. package/packages/caption-fine-studio/src/activation.ts +3 -3
  97. package/packages/caption-fine-studio/src/index.ts +54 -42
  98. package/packages/cli/README.md +57 -4
  99. package/packages/cli/package.json +1 -0
  100. package/packages/cli/src/arguments.ts +25 -6
  101. package/packages/cli/src/build-planning.ts +3 -2
  102. package/packages/cli/src/command.ts +6 -0
  103. package/packages/cli/src/commands/environment.ts +28 -18
  104. package/packages/cli/src/commands/execution.ts +81 -26
  105. package/packages/cli/src/commands/results.ts +7 -11
  106. package/packages/cli/src/index.ts +2 -2
  107. package/packages/cli/src/machine-view.ts +3 -2
  108. package/packages/cli/src/main.ts +34 -42
  109. package/packages/cli/src/observation.ts +7 -1
  110. package/packages/cli/src/output.ts +65 -23
  111. package/packages/cli/src/view.ts +64 -18
  112. package/packages/comment-sticker/README.md +3 -3
  113. package/packages/comment-sticker/package.json +1 -1
  114. package/packages/comment-sticker/src/component.ts +4 -4
  115. package/packages/comment-sticker/src/fragment.ts +5 -4
  116. package/packages/comment-sticker/src/manifest.ts +7 -6
  117. package/packages/comment-sticker/src/program.ts +9 -9
  118. package/packages/comment-sticker/src/surface.ts +6 -7
  119. package/packages/composition/README.md +21 -0
  120. package/packages/composition/src/audio-presentation.ts +44 -0
  121. package/packages/composition/src/index.ts +3 -0
  122. package/packages/composition/src/schema.ts +8 -3
  123. package/packages/composition/src/track.ts +15 -1
  124. package/packages/credential-store-env/README.md +1 -1
  125. package/packages/deck-track/README.md +3 -3
  126. package/packages/deck-track/package.json +1 -1
  127. package/packages/deck-track/src/component.ts +5 -5
  128. package/packages/deck-track/src/fragment.ts +6 -5
  129. package/packages/deck-track/src/lower.ts +12 -12
  130. package/packages/deck-track/src/manifest.ts +8 -7
  131. package/packages/deck-track/src/program.ts +13 -16
  132. package/packages/deck-track/src/surface.ts +9 -10
  133. package/packages/driver-node/src/driver.ts +41 -3
  134. package/packages/elevenlabs-speech/README.md +27 -0
  135. package/packages/{provider-xiaomi-mimo → elevenlabs-speech}/package.json +5 -8
  136. package/packages/elevenlabs-speech/src/activation.ts +26 -0
  137. package/packages/elevenlabs-speech/src/fragment.ts +11 -0
  138. package/packages/elevenlabs-speech/src/index.ts +111 -0
  139. package/packages/elevenlabs-speech/src/surface.ts +167 -0
  140. package/packages/endpoint-kit/README.md +24 -0
  141. package/packages/endpoint-kit/src/index.ts +7 -1
  142. package/packages/film/README.md +12 -7
  143. package/packages/film/package.json +1 -1
  144. package/packages/film/src/component.ts +4 -4
  145. package/packages/film/src/fragment.ts +6 -5
  146. package/packages/film/src/manifest.ts +11 -10
  147. package/packages/film/src/program.ts +5 -5
  148. package/packages/film/src/recipe.ts +2 -1
  149. package/packages/film/src/surface.ts +6 -6
  150. package/packages/film-studio/package.json +1 -1
  151. package/packages/film-studio/src/index.ts +2 -2
  152. package/packages/fishaudio-speech/README.md +33 -0
  153. package/packages/fishaudio-speech/package.json +21 -0
  154. package/packages/fishaudio-speech/src/activation.ts +32 -0
  155. package/packages/fishaudio-speech/src/fragment.ts +11 -0
  156. package/packages/fishaudio-speech/src/index.ts +156 -0
  157. package/packages/fishaudio-speech/src/surface.ts +192 -0
  158. package/packages/generation/README.md +11 -1
  159. package/packages/generation/src/mapping.ts +28 -30
  160. package/packages/gpt-image/README.md +1 -2
  161. package/packages/grok-imagine/README.md +1 -2
  162. package/packages/hyperframes/README.md +7 -3
  163. package/packages/hyperframes/src/browser-program.ts +11 -2
  164. package/packages/hyperframes/src/document.ts +15 -2
  165. package/packages/interview-emoji-reveal/README.md +4 -4
  166. package/packages/interview-emoji-reveal/package.json +1 -1
  167. package/packages/interview-emoji-reveal/src/component.ts +4 -4
  168. package/packages/interview-emoji-reveal/src/fragment.ts +6 -5
  169. package/packages/interview-emoji-reveal/src/manifest.ts +9 -8
  170. package/packages/interview-emoji-reveal/src/program.ts +14 -14
  171. package/packages/interview-emoji-reveal/src/surface.ts +8 -9
  172. package/packages/media-execution/README.md +7 -3
  173. package/packages/media-execution/src/audio-presentation.ts +23 -0
  174. package/packages/media-execution/src/execute.ts +2 -0
  175. package/packages/media-pipeline/README.md +7 -3
  176. package/packages/media-pipeline/src/audio-plan.ts +4 -1
  177. package/packages/media-pipeline/src/component.ts +16 -2
  178. package/packages/media-pipeline/src/manifest.ts +3 -1
  179. package/packages/media-pipeline/src/types.ts +2 -1
  180. package/packages/media-track/README.md +14 -47
  181. package/packages/media-track/package.json +1 -1
  182. package/packages/media-track/preview/preview.svml +5 -5
  183. package/packages/media-track/src/author.ts +12 -6
  184. package/packages/media-track/src/component.ts +10 -16
  185. package/packages/media-track/src/fragment.ts +8 -7
  186. package/packages/media-track/src/index.ts +3 -1
  187. package/packages/media-track/src/lower.ts +7 -7
  188. package/packages/media-track/src/manifest.ts +16 -38
  189. package/packages/media-track/src/program.ts +62 -67
  190. package/packages/media-track/src/sampling.ts +6 -6
  191. package/packages/media-track/src/sequence.ts +8 -8
  192. package/packages/media-track/src/surface.ts +25 -43
  193. package/packages/media-track-studio/README.md +9 -0
  194. package/packages/media-track-studio/src/index.ts +16 -11
  195. package/packages/mimo-speech/README.md +1 -1
  196. package/packages/minimax-h3/README.md +1 -1
  197. package/packages/nano-banana/README.md +1 -1
  198. package/packages/narrative/README.md +23 -1
  199. package/packages/narrative/src/identity.ts +11 -0
  200. package/packages/narrative/src/index.ts +3 -0
  201. package/packages/narrative/src/schema.ts +28 -27
  202. package/packages/narrative/src/selection.ts +52 -0
  203. package/packages/narrative/src/types.ts +2 -0
  204. package/packages/package-loader-node/README.md +30 -0
  205. package/packages/package-loader-node/package.json +5 -2
  206. package/packages/package-loader-node/src/distribution-resolution.ts +10 -3
  207. package/packages/package-loader-node/src/index.ts +1 -0
  208. package/packages/package-loader-node/src/loader.ts +12 -15
  209. package/packages/package-loader-node/src/location.ts +27 -1
  210. package/packages/package-loader-node/src/module-scope.ts +183 -0
  211. package/packages/package-loader-node/src/types.ts +4 -0
  212. package/packages/performance/README.md +83 -0
  213. package/packages/performance/package.json +30 -0
  214. package/packages/performance/src/activation.ts +11 -0
  215. package/packages/performance/src/component.ts +46 -0
  216. package/packages/performance/src/index.ts +6 -0
  217. package/packages/performance/src/manifest.ts +53 -0
  218. package/packages/{media-track/src/performance.ts → performance/src/media.ts} +9 -10
  219. package/packages/performance/src/program.ts +51 -0
  220. package/packages/performance/src/style.ts +35 -0
  221. package/packages/performance/src/surface.ts +99 -0
  222. package/packages/performance-studio/README.md +25 -0
  223. package/packages/performance-studio/package.json +21 -0
  224. package/packages/performance-studio/src/activation.ts +6 -0
  225. package/packages/performance-studio/src/index.ts +84 -0
  226. package/packages/program-space/README.md +9 -18
  227. package/packages/program-space/src/activation.ts +1 -5
  228. package/packages/program-space/src/index.ts +2 -11
  229. package/packages/program-space/src/surface.ts +1 -20
  230. package/packages/project-context-node/README.md +20 -0
  231. package/packages/project-context-node/package.json +10 -0
  232. package/packages/project-context-node/src/index.ts +3 -0
  233. package/packages/{cli → project-context-node}/src/runtime-selection.ts +7 -2
  234. package/packages/provider-hyperframes-local/README.md +43 -15
  235. package/packages/provider-hyperframes-local/src/activation.ts +4 -3
  236. package/packages/provider-hyperframes-local/src/capture-process.ts +26 -4
  237. package/packages/provider-hyperframes-local/src/capture.ts +96 -26
  238. package/packages/provider-hyperframes-local/src/concurrency.ts +86 -0
  239. package/packages/provider-hyperframes-local/src/opaque-capture.ts +92 -0
  240. package/packages/provider-hyperframes-local/src/options.ts +2 -0
  241. package/packages/provider-hyperframes-local/src/program.ts +6 -3
  242. package/packages/provider-hyperframes-local/src/progress.ts +53 -0
  243. package/packages/provider-hyperframes-local/src/provider.ts +18 -5
  244. package/packages/provider-hyperframes-local/src/render.ts +48 -7
  245. package/packages/provider-hypihub/README.md +48 -17
  246. package/packages/provider-hypihub/package.json +2 -0
  247. package/packages/provider-hypihub/src/mapping.ts +31 -7
  248. package/packages/provider-hypihub/src/oauth.ts +6 -0
  249. package/packages/provider-hypihub/src/provider.ts +25 -13
  250. package/packages/provider-hypihub/src/routes.ts +1 -2
  251. package/packages/provider-hypihub/src/upload.ts +2 -0
  252. package/packages/provider-media-local/README.md +3 -4
  253. package/packages/provider-whisperx-local/src/program.ts +1 -0
  254. package/packages/provider-whisperx-local/src/provider.ts +3 -0
  255. package/packages/ranking/README.md +8 -6
  256. package/packages/ranking/package.json +1 -1
  257. package/packages/ranking/src/component.ts +6 -6
  258. package/packages/ranking/src/fragment.ts +11 -7
  259. package/packages/ranking/src/manifest.ts +21 -14
  260. package/packages/ranking/src/render.ts +22 -26
  261. package/packages/ranking/src/schedule.ts +16 -19
  262. package/packages/ranking/src/surface.ts +12 -13
  263. package/packages/ranking-studio/README.md +18 -0
  264. package/packages/ranking-studio/src/index.ts +61 -9
  265. package/packages/render-hyperframes/README.md +7 -7
  266. package/packages/render-hyperframes/package.json +1 -1
  267. package/packages/render-hyperframes/src/component.ts +11 -1
  268. package/packages/render-hyperframes/src/fragment.ts +7 -4
  269. package/packages/render-hyperframes/src/manifest.ts +4 -4
  270. package/packages/render-hyperframes/src/surface.ts +6 -6
  271. package/packages/runtime/README.md +8 -1
  272. package/packages/runtime/src/execution.ts +15 -4
  273. package/packages/runtime/src/index.ts +2 -1
  274. package/packages/runtime/src/log.ts +51 -0
  275. package/packages/runtime/src/types.ts +5 -8
  276. package/packages/runtime-host-node/README.md +30 -0
  277. package/packages/runtime-host-node/package.json +1 -0
  278. package/packages/runtime-host-node/src/index.ts +24 -9
  279. package/packages/runtime-host-node/src/packages.ts +47 -50
  280. package/packages/runtime-kit/README.md +5 -0
  281. package/packages/runtime-kit/src/index.ts +3 -1
  282. package/packages/runtime-local/README.md +92 -4
  283. package/packages/runtime-local/src/config.ts +202 -56
  284. package/packages/runtime-local/src/control.ts +9 -1
  285. package/packages/runtime-local/src/executor.ts +66 -0
  286. package/packages/runtime-local/src/host.ts +37 -17
  287. package/packages/runtime-local/src/log.ts +48 -0
  288. package/packages/runtime-local/src/programs.ts +2 -1
  289. package/packages/runtime-local/src/result-writer.ts +2 -0
  290. package/packages/runtime-local/src/runtime.ts +8 -6
  291. package/packages/runtime-local/src/supervisor.ts +142 -0
  292. package/packages/runtime-local/src/types.ts +9 -2
  293. package/packages/runtime-local/src/worker-process.ts +7 -24
  294. package/packages/runtime-local/src/worker.ts +55 -83
  295. package/packages/screen-overlay/README.md +3 -3
  296. package/packages/screen-overlay/package.json +1 -1
  297. package/packages/screen-overlay/src/component.ts +3 -3
  298. package/packages/screen-overlay/src/fragment.ts +5 -4
  299. package/packages/screen-overlay/src/manifest.ts +7 -6
  300. package/packages/screen-overlay/src/program.ts +9 -9
  301. package/packages/screen-overlay/src/surface.ts +6 -7
  302. package/packages/script/README.md +15 -2
  303. package/packages/script/src/manifest.ts +2 -2
  304. package/packages/script/src/narrative.ts +1 -0
  305. package/packages/script/src/surface.ts +4 -3
  306. package/packages/script/src/types.ts +1 -1
  307. package/packages/script-studio/package.json +9 -3
  308. package/packages/script-studio/src/index.ts +2 -0
  309. package/packages/script-studio/src/projection.ts +105 -0
  310. package/packages/seedance/README.md +30 -1
  311. package/packages/seedance/src/index.ts +18 -7
  312. package/packages/seedance/src/surface.ts +17 -4
  313. package/packages/seedance-kits/README.md +7 -1
  314. package/packages/seedream/README.md +1 -1
  315. package/packages/sound/README.md +81 -0
  316. package/packages/sound/package.json +25 -0
  317. package/packages/sound/src/activation.ts +11 -0
  318. package/packages/sound/src/component.ts +28 -0
  319. package/packages/sound/src/index.ts +5 -0
  320. package/packages/sound/src/manifest.ts +47 -0
  321. package/packages/sound/src/program.ts +84 -0
  322. package/packages/sound/src/style.ts +34 -0
  323. package/packages/sound/src/surface.ts +90 -0
  324. package/packages/sound-studio/README.md +22 -0
  325. package/packages/sound-studio/package.json +20 -0
  326. package/packages/sound-studio/src/activation.ts +6 -0
  327. package/packages/sound-studio/src/index.ts +74 -0
  328. package/packages/speech/README.md +2 -2
  329. package/packages/speech-alignment/src/local.ts +8 -0
  330. package/packages/speech-alignment/src/locate.ts +1 -1
  331. package/packages/store-sqlite/README.md +7 -0
  332. package/packages/store-sqlite/src/store.ts +84 -83
  333. package/packages/studio/INSPECTOR.md +15 -2
  334. package/packages/studio/README.md +88 -14
  335. package/packages/studio/package.json +8 -7
  336. package/packages/studio/src/companion-assembly.ts +1 -0
  337. package/packages/studio/src/domain.ts +1 -1
  338. package/packages/studio/src/fallback-companions.ts +3 -3
  339. package/packages/studio/src/feedback-server.ts +51 -0
  340. package/packages/studio/src/feedback-store.ts +66 -0
  341. package/packages/studio/src/feedback.ts +60 -0
  342. package/packages/studio/src/parameter-values.ts +43 -1
  343. package/packages/studio/src/parameters.ts +114 -24
  344. package/packages/studio/src/preview/render.ts +5 -1
  345. package/packages/studio/src/preview/runtime-shim.ts +49 -3
  346. package/packages/studio/src/programme.ts +14 -30
  347. package/packages/studio/src/server.ts +10 -6
  348. package/packages/studio/src/shared.ts +4 -2
  349. package/packages/studio/src/snapshot.ts +21 -132
  350. package/packages/studio/src/studio-preflight.ts +3 -3
  351. package/packages/studio/src/studio-registry.ts +50 -6
  352. package/packages/studio/src/style.css +209 -48
  353. package/packages/studio/src/ui/comments.ts +233 -0
  354. package/packages/studio/src/ui/icons.ts +5 -0
  355. package/packages/studio/src/ui/main.ts +145 -86
  356. package/packages/studio/src/ui/overlay.ts +12 -8
  357. package/packages/studio/src/ui/scrub-preview.ts +108 -0
  358. package/packages/studio/src/ui/stage.ts +67 -4
  359. package/packages/studio/src/ui/timeline.ts +177 -108
  360. package/packages/studio/start.ts +4 -2
  361. package/packages/studio-adapter/README.md +130 -11
  362. package/packages/studio-adapter/src/index.ts +100 -13
  363. package/packages/temporal/README.md +6 -6
  364. package/packages/temporal/package.json +1 -1
  365. package/packages/temporal/src/component.ts +5 -6
  366. package/packages/temporal/src/index.ts +8 -6
  367. package/packages/temporal/src/location.ts +11 -11
  368. package/packages/temporal/src/projection.ts +19 -19
  369. package/packages/temporal/src/rational.ts +4 -4
  370. package/packages/temporal-markup/EDITING.md +2 -2
  371. package/packages/temporal-markup/README.md +27 -11
  372. package/packages/temporal-markup/package.json +1 -1
  373. package/packages/temporal-markup/src/index.ts +20 -25
  374. package/packages/temporal-markup/src/space.ts +10 -41
  375. package/packages/timeline/README.md +31 -0
  376. package/packages/{semantic-track → timeline}/package.json +1 -1
  377. package/packages/timeline/src/activation.ts +8 -0
  378. package/packages/timeline/src/component.ts +24 -0
  379. package/packages/timeline/src/identity.ts +60 -0
  380. package/packages/timeline/src/index.ts +6 -0
  381. package/packages/{semantic-track → timeline}/src/location.ts +20 -20
  382. package/packages/timeline/src/manifest.ts +39 -0
  383. package/packages/{semantic-track → timeline}/src/projection.ts +14 -14
  384. package/packages/timeline/src/types.ts +24 -0
  385. package/packages/timeline-author/README.md +68 -0
  386. package/packages/{speech-track → timeline-author}/package.json +6 -4
  387. package/packages/timeline-author/src/activation.ts +22 -0
  388. package/packages/{speech-track → timeline-author}/src/component.ts +15 -13
  389. package/packages/{speech-track → timeline-author}/src/fragment.ts +14 -23
  390. package/packages/timeline-author/src/index.ts +7 -0
  391. package/packages/timeline-author/src/manifest.ts +78 -0
  392. package/packages/timeline-author/src/program.ts +107 -0
  393. package/packages/timeline-author/src/surface.ts +46 -0
  394. package/packages/timeline-author/src/types.ts +6 -0
  395. package/packages/typography-track/README.md +4 -4
  396. package/packages/typography-track/package.json +1 -1
  397. package/packages/typography-track/src/component.ts +4 -4
  398. package/packages/typography-track/src/fragment.ts +4 -3
  399. package/packages/typography-track/src/manifest.ts +11 -9
  400. package/packages/typography-track/src/program.ts +15 -15
  401. package/packages/typography-track/src/surface.ts +17 -18
  402. package/packages/video-cli/README.md +4 -1
  403. package/packages/video-cli/package.json +2 -1
  404. package/packages/video-cli/src/creation.ts +14 -4
  405. package/packages/video-cli/src/index.ts +1 -1
  406. package/packages/video-cli/src/studio-distribution.ts +2 -1
  407. package/packages/volcengine-matting/README.md +3 -3
  408. package/packages/whisperx/README.md +1 -1
  409. package/services/whisperx/README.md +14 -0
  410. package/services/whisperx/pyproject.toml +2 -0
  411. package/services/whisperx/uv.lock +20 -20
  412. package/packages/provider-hyperframes-aws-lambda/README.md +0 -30
  413. package/packages/provider-hyperframes-aws-lambda/package.json +0 -30
  414. package/packages/provider-hyperframes-aws-lambda/src/activation.ts +0 -97
  415. package/packages/provider-hyperframes-aws-lambda/src/client.ts +0 -114
  416. package/packages/provider-hyperframes-aws-lambda/src/index.ts +0 -21
  417. package/packages/provider-hyperframes-aws-lambda/src/provider.ts +0 -522
  418. package/packages/provider-kie/README.md +0 -134
  419. package/packages/provider-kie/package.json +0 -43
  420. package/packages/provider-kie/src/activation.ts +0 -71
  421. package/packages/provider-kie/src/index.ts +0 -10
  422. package/packages/provider-kie/src/mapping.ts +0 -182
  423. package/packages/provider-kie/src/provider.ts +0 -657
  424. package/packages/provider-kie/src/routes.ts +0 -150
  425. package/packages/provider-xiaomi-mimo/README.md +0 -32
  426. package/packages/provider-xiaomi-mimo/src/activation.ts +0 -57
  427. package/packages/provider-xiaomi-mimo/src/index.ts +0 -5
  428. package/packages/provider-xiaomi-mimo/src/provider.ts +0 -214
  429. package/packages/runtime/src/environment.ts +0 -6
  430. package/packages/semantic-track/README.md +0 -21
  431. package/packages/semantic-track/src/activation.ts +0 -8
  432. package/packages/semantic-track/src/component.ts +0 -24
  433. package/packages/semantic-track/src/identity.ts +0 -58
  434. package/packages/semantic-track/src/index.ts +0 -6
  435. package/packages/semantic-track/src/manifest.ts +0 -38
  436. package/packages/semantic-track/src/types.ts +0 -26
  437. package/packages/speech-track/README.md +0 -51
  438. package/packages/speech-track/src/activation.ts +0 -19
  439. package/packages/speech-track/src/index.ts +0 -7
  440. package/packages/speech-track/src/manifest.ts +0 -73
  441. package/packages/speech-track/src/program.ts +0 -64
  442. package/packages/speech-track/src/surface.ts +0 -35
  443. package/packages/speech-track/src/types.ts +0 -6
  444. package/packages/speech-track-studio/README.md +0 -3
  445. package/packages/speech-track-studio/package.json +0 -14
  446. package/packages/speech-track-studio/src/activation.ts +0 -7
  447. package/packages/speech-track-studio/src/index.ts +0 -40
  448. /package/packages/{cli → project-context-node}/src/project-context.ts +0 -0
  449. /package/packages/{speech-track → timeline-author}/preview/Track.png +0 -0
@@ -0,0 +1,34 @@
1
+ import { sealGraphFragment } from "@hypit/elaborator";
2
+ import type { GraphFragment } from "@hypit/elaborator";
3
+ import { compositionTypes } from "@hypit/composition";
4
+ import { timelineTypes } from "@hypit/timeline";
5
+ import { temporalTypes } from "@hypit/temporal";
6
+ import { sameType } from "@hypit/protocol";
7
+ import type { SurfaceResolvedReference } from "@hypit/markup";
8
+
9
+ /** Author-time closure: bound references become ordinary graph edges at each Use. */
10
+ export type SoundStyle = {
11
+ readonly fragment: GraphFragment;
12
+ readonly bindings: Readonly<Record<string, { readonly type: SurfaceResolvedReference["type"]; readonly ref: SurfaceResolvedReference["ref"] }>>;
13
+ };
14
+ export function soundStyle(fragment: GraphFragment, bindings: SoundStyle["bindings"] = {}): SoundStyle {
15
+ fragment = sealGraphFragment(fragment);
16
+ const common = { timeline: timelineTypes.track, window: temporalTypes.window };
17
+ for (const [name, type] of Object.entries(common)) {
18
+ const port = fragment.inputs.find(port => port.name === name);
19
+ if (port === undefined || !sameType(port.type, type)) throw new Error(`Sound Style requires ${name} input.`);
20
+ if (bindings[name] !== undefined) throw new Error(`Sound supplies ${name} at each Use.`);
21
+ }
22
+ for (const port of fragment.inputs) {
23
+ if (port.name in common) continue;
24
+ const binding = bindings[port.name];
25
+ if (binding === undefined || !sameType(port.type, binding.type)) throw new Error(`Sound Style binding ${port.name} has the wrong Type.`);
26
+ }
27
+ for (const name of Object.keys(bindings)) {
28
+ if (!fragment.inputs.some(port => port.name === name)) throw new Error(`Sound Style has unknown binding ${name}.`);
29
+ }
30
+ if (fragment.exports.length !== 1 || fragment.exports[0]?.name !== "audio" || !sameType(fragment.exports[0].type, compositionTypes.audioTrack)) {
31
+ throw new Error("Sound Style must export audio: AudioTrack.");
32
+ }
33
+ return { fragment, bindings: Object.fromEntries(Object.entries(bindings).map(([name, value]) => [name, { ref: value.ref, type: value.type }])) };
34
+ }
@@ -0,0 +1,90 @@
1
+ import { assertAttributes, assertEmptyElement, textAttribute, optionalTextAttribute } from "@hypit/markup";
2
+ import type { StructuredSurfaceHandler, SurfaceResolvedReference, SurfaceRecordDraft, SurfaceComponentDraft, StructuredElement } from "@hypit/markup";
3
+ import { canonicalize, sameType } from "@hypit/protocol";
4
+ import type { TypeRef } from "@hypit/protocol";
5
+ import { sealGraphFragment } from "@hypit/elaborator";
6
+ import type { FragmentOperation } from "@hypit/elaborator";
7
+ import { createTemporalWindowProjection, resolveTemporalContext, temporalWindowAttributeNames } from "@hypit/temporal-markup";
8
+ import { temporalTypes } from "@hypit/temporal";
9
+ import { compositionTypes } from "@hypit/composition";
10
+ import { timelineTypes } from "@hypit/timeline";
11
+ import { soundStyle } from "./style.js";
12
+ import type { SoundStyle } from "./style.js";
13
+ import { soundTypes, soundProducers, ordinaryInputs } from "./manifest.js";
14
+
15
+ const input = (name: string) => ({ kind: "fragment-input" as const, name });
16
+ const operation = (id: string) => ({ kind: "fragment-operation" as const, operation: id });
17
+ function reference(element: StructuredElement, name: string, type: TypeRef, resolve: (path: string) => SurfaceResolvedReference | undefined): SurfaceResolvedReference {
18
+ const raw = element.attributes[name];
19
+ if (typeof raw !== "object" || raw.kind !== "reference") throw new Error(`${element.name}.${name} must be a reference.`);
20
+ const found = resolve(raw.path);
21
+ if (found === undefined || !sameType(found.type, type)) throw new Error(`${element.name}.${name} has the wrong Type.`);
22
+ return found;
23
+ }
24
+ function authored<T>(value: SurfaceResolvedReference): T {
25
+ if (value.record?.value.kind !== "inline") throw new Error("A presentation Style or Recipe must be an authored inline value.");
26
+ return value.record.value.value as unknown as T;
27
+ }
28
+ export const decodeSoundTrackSurface: StructuredSurfaceHandler = ({ element, resolveReference }) => {
29
+ assertAttributes(element, ["id", "timeline"]);
30
+ const id = textAttribute(element, "id"), context = resolveTemporalContext({ element, resolveReference });
31
+ const records: SurfaceRecordDraft[] = [{ id: `${id}.header`, type: soundTypes.header, value: { kind: "inline", value: { id } }, range: element.range }];
32
+ const components: SurfaceComponentDraft[] = [];
33
+ const fragments = [] as ReturnType<typeof sealGraphFragment>[];
34
+ const collectorInputs = [{ name: "timeline", type: timelineTypes.track }, { name: "header", type: soundTypes.header }];
35
+ const bindings: Record<string, SurfaceResolvedReference["ref"]> = { timeline: context.timeline.ref, header: { kind: "record", id: `${id}.header` } };
36
+ const operations: FragmentOperation[] = [{ id: "empty", producer: soundProducers.create, inputs: {}, result: { kind: "output", name: "set" } }];
37
+ let previous = "empty", index = 0;
38
+ for (const child of element.children) {
39
+ if (child.kind === "text") { if (child.value.trim()) throw new Error("Sound Track accepts Use children."); continue; }
40
+ if (child.name.split(":").at(-1) !== "Use") throw new Error("Sound Track accepts Use children.");
41
+ assertAttributes(child, ["id", "style", ...temporalWindowAttributeNames]); assertEmptyElement(child);
42
+ const useId = optionalTextAttribute(child, "id") ?? `${id}.use.${index + 1}`;
43
+ index += 1;
44
+ const hasTime = temporalWindowAttributeNames.some(name => child.attributes[name] !== undefined);
45
+ const temporal = createTemporalWindowProjection({ id: useId, ...context, resolveReference,
46
+ element: hasTime ? child : { ...child, attributes: { ...child.attributes, during: "program" } } });
47
+ records.push(...temporal.records); components.push(...temporal.components); fragments.push(...temporal.fragments);
48
+ const value = authored<SoundStyle>(reference(child, "style", soundTypes.style, resolveReference));
49
+ const style = soundStyle(value.fragment, value.bindings);
50
+ fragments.push(style.fragment);
51
+ const audioId = `${useId}.audio`;
52
+ components.push({ id: `${useId}.__style`, fragment: style.fragment.id,
53
+ inputs: { ...Object.fromEntries(Object.entries(style.bindings).map(([key, bound]) => [key, bound.ref])),
54
+ timeline: context.timeline.ref, window: temporal.ref }, outputs: { audio: audioId }, range: child.range });
55
+ const suffix = `use-${operations.length}`;
56
+ collectorInputs.push({ name: `${suffix}-window`, type: temporalTypes.window }, { name: `${suffix}-audio`, type: compositionTypes.audioTrack });
57
+ bindings[`${suffix}-window`] = temporal.ref; bindings[`${suffix}-audio`] = { kind: "component-output", component: `${useId}.__style`, output: "audio" };
58
+ operations.push({ id: suffix, producer: soundProducers.append, inputs: { set: operation(previous), window: input(`${suffix}-window`), audio: input(`${suffix}-audio`) }, result: { kind: "output", name: "set" } });
59
+ previous = suffix;
60
+ }
61
+ operations.push({ id: "resolve", producer: soundProducers.resolve, inputs: { set: operation(previous), timeline: input("timeline"), header: input("header") }, result: { kind: "output", name: "audio" } });
62
+ const collector = sealGraphFragment({ inputs: collectorInputs, operations, exports: [{ name: "audio", type: compositionTypes.audioTrack, root: operation("resolve") }, { name: "program", type: soundTypes.set, root: operation(previous) }] });
63
+ fragments.push(collector);
64
+ components.push({ id, fragment: collector.id, inputs: bindings, outputs: { audio: `${id}.audio`, program: `${id}.program` }, range: element.range });
65
+ return { records, components, fragments, exports: [`${id}.audio`, `${id}.program`] };
66
+ };
67
+
68
+ export const ordinarySoundFragment = sealGraphFragment({
69
+ inputs: ordinaryInputs,
70
+ operations: [{ id: "ordinary", producer: soundProducers.ordinary,
71
+ inputs: Object.fromEntries(ordinaryInputs.map(port => [port.name, input(port.name)])), result: { kind: "output", name: "audio" } }],
72
+ exports: [{ name: "audio", type: compositionTypes.audioTrack, root: operation("ordinary") }],
73
+ });
74
+ export const decodeSoundStyleSurface: StructuredSurfaceHandler = ({ element }) => {
75
+ assertAttributes(element, ["id", "gain", "end-gain"]); assertEmptyElement(element);
76
+ const id = textAttribute(element, "id");
77
+ const number = (name: string, fallback: number): number => {
78
+ const raw = optionalTextAttribute(element, name);
79
+ const value = raw === undefined ? fallback : raw.trim() === "" ? NaN : Number(raw);
80
+ if (!Number.isFinite(value) || value < 0 || value > 64) throw new Error(`Sound Style ${name} must be a gain from 0 to 64.`);
81
+ return value;
82
+ };
83
+ const gain = number("gain", 1), endGain = number("end-gain", gain);
84
+ const specId = `${id}.gain`;
85
+ const style = soundStyle(ordinarySoundFragment, { spec: { ref: { kind: "record", id: specId }, type: soundTypes.gain } });
86
+ return { records: [
87
+ { id: specId, type: soundTypes.gain, value: { kind: "inline", value: { gain, endGain } }, range: element.range },
88
+ { id, type: soundTypes.style, value: { kind: "inline", value: canonicalize(style) }, range: element.range },
89
+ ], components: [], fragments: [] };
90
+ };
@@ -0,0 +1,22 @@
1
+ # Sound Studio Companion
2
+
3
+ Sound contributes one Track with content and a bottom Uses band through the public Companion interface:
4
+
5
+ - The content lane shows placed audio Takes with waveforms. Each Take retains its actual interval, including gaps and overlaps. Picture-only Takes contribute no sound item.
6
+ - The Uses label band shows each authored Style application. Later declarations appear over earlier ones; selection raises an item for editing without changing that priority. Silent and fully covered Uses remain selectable.
7
+
8
+ One Sound label spans the waveform content and Uses band. Selecting a Take shows its Segment and placed frame range.
9
+ Selecting a Use shows its Style and resolved frame range, alongside the ordinary Style's authored
10
+ `gain` and `end-gain` parameters. Gain is displayed as a percentage: 100% writes the linear value 1.
11
+ The end gain defaults to the start gain. The parameter Companion exposes this dependent default;
12
+ the first edit inserts an explicit attribute into the Style.
13
+
14
+ The fields live in When and How. Shared Style edits affect all Uses selecting that Style.
15
+ Temporal gestures follow the existing Selection/Moment/clock projection and exact source endpoint
16
+ rules. Project Styles expose their own parameters through `createStudioCompanionHostFacet({ parameters })`,
17
+ matching their own Module and Surface. The Track opts `style` into this owner with `companion: true`.
18
+
19
+ `Sound Track.program` exports the already-computed ordered Use set before presentation coverage
20
+ is resolved. `Sound Track.audio` exports the effective audio arrangement. The Companion reads the
21
+ former to preserve editing choices even when they currently produce no sound; rendering consumes
22
+ the latter. Studio does not reconstruct the rule set from audible output or inspect Sound internals.
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@hypit/sound-studio",
3
+ "version": "0.0.0-dev",
4
+ "license": "SEE LICENSE IN LICENSE",
5
+ "private": true,
6
+ "type": "module",
7
+ "exports": {
8
+ ".": "./src/index.ts"
9
+ },
10
+ "hypit": {
11
+ "activation": "./src/activation.ts"
12
+ },
13
+ "dependencies": {
14
+ "@hypit/timeline": "workspace:*",
15
+ "@hypit/temporal": "workspace:*",
16
+ "@hypit/composition": "workspace:*",
17
+ "@hypit/studio-adapter": "workspace:*",
18
+ "@hypit/sound": "workspace:*"
19
+ }
20
+ }
@@ -0,0 +1,6 @@
1
+ import { createStudioCompanionHostFacet } from "@hypit/studio-adapter";
2
+ import { soundStudioTrackCompanions, soundStudioParameterCompanions } from "./index.js";
3
+ export default {
4
+ format: "hypit.node-package@1" as const,
5
+ hostFacets: [createStudioCompanionHostFacet({ tracks: soundStudioTrackCompanions, parameters: soundStudioParameterCompanions })],
6
+ };
@@ -0,0 +1,74 @@
1
+ import { soundModuleRef } from "@hypit/sound";
2
+ import type { SoundSet } from "@hypit/sound";
3
+ import { projectTimelineMedia, timelineTypes } from "@hypit/timeline";
4
+ import type { Timeline } from "@hypit/timeline";
5
+ import { temporalTypes } from "@hypit/temporal";
6
+ import { compositionTypes } from "@hypit/composition";
7
+ import { artifactPreview, authoredChildFor, previewLayer, requiredReferencedValue, requiredSurfaceValue, temporalLineageFor, temporalSemanticSource } from "@hypit/studio-adapter";
8
+ import type { StudioTrackCompanion, StudioTrackCompanionContext, StudioEntityDraft } from "@hypit/studio-adapter";
9
+
10
+ export function projectSound(context: StudioTrackCompanionContext): readonly StudioEntityDraft[] {
11
+ const timeline = requiredReferencedValue(context, "timeline", timelineTypes.track) as Timeline;
12
+ const program = requiredSurfaceValue(context, "program") as SoundSet;
13
+ // Source content keeps its own placement. A Use changes its presentation, not its media clock.
14
+ const content: StudioEntityDraft[] = projectTimelineMedia(timeline).flatMap((clip, index) => {
15
+ if (clip.media.audio === undefined) return [];
16
+ return [{
17
+ id: `${context.track.outputRef}:content:${clip.segmentId}`,
18
+ authoredId: clip.segmentId,
19
+ display: { title: clip.segmentId, layers: [previewLayer(artifactPreview("audio", clip.media.audio.artifact.resource), "waveform")] },
20
+ ...clip.span, stackOrder: index,
21
+ inspector: [
22
+ { id: "segment", label: "Segment", domain: "how", section: { id: "content", label: "Content" }, value: clip.segmentId },
23
+ { id: "range", label: "Range", domain: "when", section: { id: "placement", label: "Placement" }, value: `${clip.span.startFrame}–${clip.span.endFrameExclusive}`, unit: "f", summary: "Placed interval; the end frame is exclusive." },
24
+ ],
25
+ presentation: { entity: "sound-content", chrome: "standard" },
26
+ }];
27
+ });
28
+ const uses: StudioEntityDraft[] = program.uses.map((use, index) => {
29
+ const authoredId = use.window.subjectId;
30
+ const child = authoredChildFor(context, authoredId, [temporalTypes.windowSpec]);
31
+ if (child === undefined) throw new Error(`Sound Use ${authoredId} has no author provenance.`);
32
+ const style = child.referenceAttributes.style;
33
+ const temporal = temporalLineageFor(context, authoredId, "window");
34
+ const semantic = temporalSemanticSource(temporal);
35
+ return {
36
+ id: `${context.track.outputRef}:use:${authoredId}`, authoredId,
37
+ display: { title: style ?? authoredId, layers: [] },
38
+ ...use.window.span, stackOrder: index,
39
+ elementRange: child.range,
40
+ ...(temporal === undefined ? {} : { temporal }),
41
+ ...(semantic === undefined ? {} : { markerId: semantic.id }),
42
+ presentation: { entity: "sound-use", chrome: "standard" },
43
+ band: "uses",
44
+ inspector: [{ id: "range", label: "Range", domain: "when", section: { id: "placement", label: "Placement" }, value: `${use.window.span.startFrame}–${use.window.span.endFrameExclusive}`, unit: "f", summary: "Resolved Use interval; the end frame is exclusive. Timeline gestures follow this Use's author timing." }],
45
+ };
46
+ });
47
+ return [...content, ...uses];
48
+ }
49
+
50
+ export const soundStudioTrackCompanions: readonly StudioTrackCompanion[] = [{
51
+ id: "audio", role: "track",
52
+ output: { type: compositionTypes.audioTrack, surface: "track", modules: [soundModuleRef] },
53
+ family: "sound", label: "Sound", tone: "green", icon: "waveform",
54
+ lane: { heightPx: 48 },
55
+ requiredValues: ["program"],
56
+ bands: [{
57
+ id: "uses", placement: "after", heightPx: 15, display: "label",
58
+ bindings: [{ name: "style", companion: true }],
59
+ inspector: [{ binding: "style", label: "Style", domain: "how", section: { id: "sound", label: "Sound" }, control: "text", summary: "This Style is shared by every Use that selects it." }],
60
+ }],
61
+ project: projectSound,
62
+ }];
63
+
64
+ export const soundStudioParameterCompanions: readonly import("@hypit/studio-adapter").StudioParameterCompanion[] = [{
65
+ id: "style", match: { module: soundModuleRef, surface: "style" },
66
+ bindings: [ { name: "gain", writable: true, fallback: 1 },
67
+ { name: "end-gain", writable: true, fallback: authored => Number(authored.gain ?? 1) } ],
68
+ inspector: (["gain", "end-gain"] as const).map(name => ({
69
+ binding: name, label: name === "gain" ? "Gain" : "End Gain", domain: "how",
70
+ section: { id: "sound", label: "Sound" }, control: "number", unit: "%",
71
+ number: { scale: 100, minimum: 0, maximum: 6400, step: 1 },
72
+ summary: name === "gain" ? "Linear gain at the start of each Use. 100% preserves the source level." : "Linear gain at the end of each Use. The Use interval owns the ramp.",
73
+ })),
74
+ }];
@@ -6,8 +6,8 @@ owns the types and helpers below; Source imports retain the `@hypit/speech@1` Mo
6
6
 
7
7
  Public contracts for speech duration, normalized semantic Takes and provider-neutral evidence audio.
8
8
  A `SemanticTake` contains one normalized media product, one authored Segment, its words and local
9
- frame anchors. Ordered Takes are assembled by `@hypit/speech-track` into a `SemanticTrack`, which is
10
- the program's continuous semantic skeleton. `SpeechEvidenceAudio` carries canonical 16 kHz WAV bytes
9
+ frame anchors. Ordered Takes are assembled by `@hypit/timeline-author` into a `Timeline`, which is
10
+ the complete Program range and Take placements, including gaps or overlap. `SpeechEvidenceAudio` carries canonical 16 kHz WAV bytes
11
11
  and their exact sample count; it never carries Script or Segment identity.
12
12
 
13
13
  The package also owns deterministic boundary materialization for a Segment with no Tokens. It maps
@@ -16,8 +16,16 @@ function segmentNarrative(narrative: Narrative, excerpt: NarrativeExcerpt): Narr
16
16
  throw new Error(`NarrativeExcerpt ${excerpt.id} does not describe its authored Segment.`);
17
17
  }
18
18
  const tokens = narrative.tokens.slice(segment.tokenStart, segment.tokenEndExclusive);
19
+ const units = narrative.caption.units.filter((unit) => unit.segmentId === segment.id);
20
+ const unitIds = new Set(units.map((unit) => unit.id));
19
21
  return {
20
22
  id: narrative.id,
23
+ caption: {
24
+ ...narrative.caption,
25
+ units,
26
+ words: narrative.caption.words.filter((word) => unitIds.has(word.unitId)),
27
+ cueBreaks: narrative.caption.cueBreaks.filter((cue) => unitIds.has(cue.afterUnitId)),
28
+ },
21
29
  segments: [{ ...segment, tokenStart: 0, tokenEndExclusive: tokens.length }],
22
30
  tokens,
23
31
  turns: narrative.turns
@@ -456,7 +456,7 @@ export function locateAlignedSegmentTiming(
456
456
  const tokensById = new Map(timedTokens.map((token) => [token.tokenId, token]));
457
457
  const segmentsById = new Map(timedSegments.map((segment) => [segment.segmentId, segment]));
458
458
  const anchors: LocalSemanticTimePoint[] = narrative.semanticIndex.anchors.flatMap((anchor): LocalSemanticTimePoint[] => {
459
- // Program boundaries belong to the assembled SemanticTrack, never to one Segment-local Take.
459
+ // Program boundaries belong to the assembled Timeline, never to one Segment-local Take.
460
460
  if (anchor.kind === "program-start" || anchor.kind === "program-end") return [];
461
461
  if (anchor.kind === "segment-start" || anchor.kind === "segment-end") {
462
462
  const segment = segmentsById.get(anchor.segmentId)!;
@@ -12,3 +12,10 @@ has recorded them. Unknown remote outcomes do not keep a failed Build active.
12
12
  Artifact bytes and secret credential values never enter this database. Components and Endpoint packages do not import
13
13
  SQLite. `SqliteRuntimeState` exposes the narrow stores needed by the local Runtime and owns their shared
14
14
  connection.
15
+
16
+ Execution choices live in `context_json` on the existing submission/execution records. The store treats
17
+ that value as opaque Host data. `started_at` distinguishes queued work from an executor that was lost.
18
+ `listUnstarted` and `listReady` return only IDs for dispatch, without parsing every Profile or graph.
19
+ Scoped claims and shared capacity updates remain atomic across execution contexts and processes. No global Profile
20
+ pin prevents a new Build from using new selections. An interrupted executor is concluded only after
21
+ its supervisor knows the process has exited; stored Operation receipts are retained for Result writing.
@@ -35,7 +35,6 @@ import type {
35
35
  OperationSnapshot,
36
36
  OperationStore,
37
37
  OperationUpdate,
38
- RuntimeEnvironmentStore,
39
38
  } from "@hypit/runtime";
40
39
 
41
40
  export type SqliteRuntimeStateOptions = {
@@ -224,6 +223,7 @@ function parseExecutionRequest(row: Row, subject: string): BuildExecutionRequest
224
223
  `SQLite ${subject} Result location is invalid`);
225
224
  return {
226
225
  build: row.build_id,
226
+ ...(typeof row.context_json === "string" ? { context: JSON.parse(row.context_json) as NonNullable<BuildExecutionRequest["context"]> } : {}),
227
227
  componentPackages,
228
228
  result: result as BuildExecutionRequest["result"],
229
229
  };
@@ -263,12 +263,13 @@ class SqlitePendingBuildStore implements PendingBuildStore {
263
263
  assert(occupied === undefined, `Build ${request.build} already has Runtime state`);
264
264
  this.#database.prepare(`
265
265
  INSERT INTO hypit_submissions (
266
- build_id, component_packages_json, result_location_json, created_at
267
- ) VALUES (?, ?, ?, ?)
266
+ build_id, component_packages_json, result_location_json, context_json, created_at
267
+ ) VALUES (?, ?, ?, ?, ?)
268
268
  `).run(
269
269
  request.build,
270
270
  JSON.stringify(request.componentPackages),
271
271
  JSON.stringify(request.result),
272
+ request.context === undefined ? null : JSON.stringify(request.context),
272
273
  now,
273
274
  );
274
275
  return parsePendingBuildSubmission(
@@ -295,7 +296,8 @@ class SqlitePendingBuildStore implements PendingBuildStore {
295
296
  if (row === undefined) throw new Error(`Build submission ${request.build} was not prepared`);
296
297
  const submission = parsePendingBuildSubmission(row);
297
298
  assert(JSON.stringify(submission.componentPackages) === JSON.stringify(request.componentPackages)
298
- && JSON.stringify(submission.result) === JSON.stringify(request.result),
299
+ && JSON.stringify(submission.result) === JSON.stringify(request.result)
300
+ && JSON.stringify(submission.context) === JSON.stringify(request.context),
299
301
  `Build submission ${request.build} does not match its prepared state`);
300
302
  this.#database.prepare(`
301
303
  INSERT INTO hypit_builds (build_id, definition_json) VALUES (?, ?)
@@ -305,15 +307,16 @@ class SqlitePendingBuildStore implements PendingBuildStore {
305
307
  `).run(request.build, Date.now(), JSON.stringify(request.catalog));
306
308
  this.#database.prepare(`
307
309
  INSERT INTO hypit_executions (
308
- build_id, component_packages_json, result_location_json, created_at, wake_at,
310
+ build_id, component_packages_json, result_location_json, context_json, created_at, wake_at,
309
311
  turn_owner, turn_acquired_at, result_writer_owner, result_writer_acquired_at,
310
312
  stop_cause, stop_reason,
311
313
  decision_outcome, decision_reason, attention_step, attention_error
312
- ) VALUES (?, ?, ?, ?, ?, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
314
+ ) VALUES (?, ?, ?, ?, ?, ?, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
313
315
  `).run(
314
316
  request.build,
315
317
  JSON.stringify(request.componentPackages),
316
318
  JSON.stringify(request.result),
319
+ request.context === undefined ? null : JSON.stringify(request.context),
317
320
  submission.createdAt,
318
321
  Date.now(),
319
322
  );
@@ -424,6 +427,9 @@ function parseCommandExecution(row: Row): CommandExecutionReceipt {
424
427
  command: row.command_id,
425
428
  status: row.status,
426
429
  ...(event === undefined ? {} : { event }),
430
+ ...(row.status !== "started" || typeof row.activity_json !== "string" ? {} : {
431
+ activity: JSON.parse(row.activity_json) as NonNullable<CommandExecutionReceipt["activity"]>,
432
+ }),
427
433
  };
428
434
  }
429
435
 
@@ -456,7 +462,7 @@ class SqliteCommandExecutionStore implements CommandExecutionStore {
456
462
  const current = parseCommandExecution(row);
457
463
  if (current.status === "completed") return current;
458
464
  this.#database.prepare(`
459
- UPDATE hypit_command_executions SET status = 'completed', event_json = ?
465
+ UPDATE hypit_command_executions SET status = 'completed', event_json = ?, activity_json = NULL
460
466
  WHERE build_id = ? AND command_id = ? AND status = 'started'
461
467
  `).run(JSON.stringify(event), build, command);
462
468
  return parseCommandExecution(this.#database.prepare(`
@@ -471,54 +477,18 @@ class SqliteCommandExecutionStore implements CommandExecutionStore {
471
477
  `).all(build) as Row[]).map(parseCommandExecution);
472
478
  }
473
479
 
474
- async removeBuild(build: string): Promise<void> {
475
- this.#database.prepare("DELETE FROM hypit_command_executions WHERE build_id = ?").run(build);
476
- }
477
- }
478
-
479
- class SqliteRuntimeEnvironmentStore implements RuntimeEnvironmentStore {
480
- readonly #database: DatabaseSync;
481
-
482
- constructor(database: DatabaseSync) {
483
- this.#database = database;
484
- }
485
-
486
- async use(config: string): Promise<void> {
487
- assert(config.length > 0, "Runtime environment configuration is empty");
488
- transaction(this.#database, () => {
489
- const active = this.#database.prepare(
490
- `SELECT
491
- (SELECT COUNT(*) FROM hypit_submissions)
492
- + (SELECT COUNT(*) FROM hypit_executions) AS count`,
493
- ).get() as Row;
494
- assert(typeof active.count === "number", "SQLite active Runtime work count is invalid");
495
- const row = this.#database.prepare(
496
- "SELECT config_json FROM hypit_runtime_environment WHERE singleton = 1",
497
- ).get() as Row | undefined;
498
- if (active.count > 0) {
499
- assert(typeof row?.config_json === "string",
500
- "Active Runtime work has no recorded environment; use its original Profile or resolve it explicitly");
501
- assert(row.config_json === config,
502
- "Runtime Profile differs from the environment pinned by active Builds");
503
- return;
504
- }
505
- this.#database.prepare(`
506
- INSERT INTO hypit_runtime_environment (singleton, config_json) VALUES (1, ?)
507
- ON CONFLICT(singleton) DO UPDATE SET config_json = excluded.config_json
508
- `).run(config);
509
- });
480
+ async reportProgress(build: string, command: string, activity: NonNullable<CommandExecutionReceipt["activity"]>): Promise<void> {
481
+ this.#database.prepare(`
482
+ UPDATE hypit_command_executions SET activity_json = ?
483
+ WHERE build_id = ? AND command_id = ? AND status = 'started'
484
+ `).run(JSON.stringify(activity), build, command);
510
485
  }
511
486
 
512
- async assert(config: string): Promise<void> {
513
- const row = this.#database.prepare(
514
- "SELECT config_json FROM hypit_runtime_environment WHERE singleton = 1",
515
- ).get() as Row | undefined;
516
- assert(typeof row?.config_json === "string" && row.config_json === config,
517
- "Runtime Profile no longer matches this Worker's active environment");
487
+ async removeBuild(build: string): Promise<void> {
488
+ this.#database.prepare("DELETE FROM hypit_command_executions WHERE build_id = ?").run(build);
518
489
  }
519
490
  }
520
491
 
521
-
522
492
  function parseExecutionSnapshot(row: Row): BuildExecutionSnapshot {
523
493
  assert(typeof row.created_at === "number", "SQLite Execution creation time is invalid");
524
494
  assert(row.wake_at === null || typeof row.wake_at === "number", "SQLite Execution wake time is invalid");
@@ -538,6 +508,7 @@ function parseExecutionSnapshot(row: Row): BuildExecutionSnapshot {
538
508
  return {
539
509
  ...parseExecutionRequest(row, "Execution"),
540
510
  createdAt: row.created_at,
511
+ ...(typeof row.started_at === "number" ? { startedAt: row.started_at } : {}),
541
512
  ...(typeof row.wake_at === "number" ? { wakeAt: row.wake_at } : {}),
542
513
  ...(typeof row.operation_wait_json === "string" ? { operationWait: JSON.parse(row.operation_wait_json) as string[] } : {}),
543
514
  ...(typeof row.turn_owner === "string" ? {
@@ -582,12 +553,12 @@ class SqliteBuildExecutionStore implements BuildExecutionStore {
582
553
  nonNegativeInteger(now, "Execution creation time");
583
554
  this.#database.prepare(`
584
555
  INSERT INTO hypit_executions (
585
- build_id, component_packages_json, result_location_json, created_at, wake_at,
556
+ build_id, component_packages_json, result_location_json, context_json, created_at, wake_at,
586
557
  turn_owner, turn_acquired_at, result_writer_owner, result_writer_acquired_at,
587
558
  stop_cause, stop_reason,
588
559
  decision_outcome, decision_reason, attention_step, attention_error
589
- ) VALUES (?, ?, ?, ?, ?, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
590
- `).run(request.build, JSON.stringify(request.componentPackages), JSON.stringify(request.result), now, now);
560
+ ) VALUES (?, ?, ?, ?, ?, ?, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
561
+ `).run(request.build, JSON.stringify(request.componentPackages), JSON.stringify(request.result), request.context === undefined ? null : JSON.stringify(request.context), now, now);
591
562
  return {
592
563
  ...copy(request),
593
564
  createdAt: now,
@@ -608,19 +579,20 @@ class SqliteBuildExecutionStore implements BuildExecutionStore {
608
579
  return rows.map(parseExecutionSnapshot);
609
580
  }
610
581
 
611
- async claim(owner: string, now = Date.now()): Promise<BuildExecutionSnapshot | undefined> {
582
+ async claim(owner: string, now = Date.now(), build?: string): Promise<BuildExecutionSnapshot | undefined> {
612
583
  assert(owner.trim().length > 0, "Execution turn owner is empty");
613
584
  nonNegativeInteger(now, "Execution claim time");
614
585
  return transaction(this.#database, () => {
615
586
  const row = this.#database.prepare(`
616
587
  SELECT execution.build_id FROM hypit_executions AS execution
617
588
  WHERE decision_outcome IS NULL AND turn_owner IS NULL AND wake_at <= ?
589
+ AND (? IS NULL OR execution.build_id = ?)
618
590
  ORDER BY EXISTS (
619
591
  SELECT 1 FROM hypit_capacity AS capacity
620
592
  WHERE capacity.build_id = execution.build_id
621
593
  ) DESC, wake_at ASC, created_at ASC, execution.build_id ASC
622
594
  LIMIT 1
623
- `).get(now) as Row | undefined;
595
+ `).get(now, build ?? null, build ?? null) as Row | undefined;
624
596
  if (row === undefined) return undefined;
625
597
  assert(typeof row.build_id === "string", "SQLite ready Execution has no Build id");
626
598
  const updated = this.#database.prepare(`
@@ -635,6 +607,45 @@ class SqliteBuildExecutionStore implements BuildExecutionStore {
635
607
  });
636
608
  }
637
609
 
610
+ async listUnstarted(): Promise<readonly string[]> {
611
+ return (this.#database.prepare(`SELECT build_id FROM hypit_executions
612
+ WHERE decision_outcome IS NULL AND started_at IS NULL ORDER BY created_at, build_id`).all() as Row[])
613
+ .map((row) => row.build_id as string);
614
+ }
615
+
616
+ async listReady(now = Date.now()): Promise<readonly string[]> {
617
+ return (this.#database.prepare(`SELECT build_id FROM hypit_executions
618
+ WHERE decision_outcome IS NULL AND turn_owner IS NULL AND wake_at <= ?
619
+ ORDER BY wake_at, created_at, build_id`).all(now) as Row[]).map((row) => row.build_id as string);
620
+ }
621
+
622
+ async start(build: string, now = Date.now()): Promise<BuildExecutionSnapshot> {
623
+ nonNegativeInteger(now, "Execution start time");
624
+ const updated = this.#database.prepare(`
625
+ UPDATE hypit_executions SET started_at = ?
626
+ WHERE build_id = ? AND started_at IS NULL AND decision_outcome IS NULL
627
+ `).run(now, build);
628
+ assert(updated.changes === 1, `Execution ${build} has already started or ended`);
629
+ return (await this.read(build))!;
630
+ }
631
+
632
+ async interrupt(build: string, reason: string): Promise<BuildExecutionSnapshot> {
633
+ return transaction(this.#database, () => {
634
+ const row = this.#database.prepare("SELECT * FROM hypit_executions WHERE build_id = ?").get(build) as Row | undefined;
635
+ assert(row !== undefined, `Execution ${build} does not exist`);
636
+ const current = parseExecutionSnapshot(row);
637
+ if (current.decision !== undefined) return current;
638
+ this.#release(build);
639
+ this.#database.prepare(`
640
+ UPDATE hypit_executions SET decision_outcome = ?, decision_reason = ?,
641
+ turn_owner = NULL, turn_acquired_at = NULL,
642
+ result_writer_owner = NULL, result_writer_acquired_at = NULL
643
+ WHERE build_id = ?
644
+ `).run(current.stop?.cause === "user-cancelled" ? "cancelled" : "failed", current.stop?.reason ?? reason, build);
645
+ return parseExecutionSnapshot(this.#database.prepare("SELECT * FROM hypit_executions WHERE build_id = ?").get(build) as Row);
646
+ });
647
+ }
648
+
638
649
  async releaseTurn(build: string, owner: string, wakeAt: number | undefined, operationWait?: readonly string[]): Promise<BuildExecutionSnapshot> {
639
650
  if (wakeAt !== undefined) nonNegativeInteger(wakeAt, "Execution wakeAt");
640
651
  return transaction(this.#database, () => {
@@ -902,28 +913,6 @@ class SqliteBuildExecutionStore implements BuildExecutionStore {
902
913
  transaction(this.#database, () => this.#release(build));
903
914
  }
904
915
 
905
- async reclaimTurns(now = Date.now()): Promise<readonly string[]> {
906
- nonNegativeInteger(now, "Execution turn reclaim time");
907
- return transaction(this.#database, () => {
908
- const rows = this.#database.prepare(
909
- "SELECT build_id FROM hypit_executions WHERE turn_owner IS NOT NULL AND decision_outcome IS NULL",
910
- ).all() as Row[];
911
- const builds = rows.map((row) => {
912
- assert(typeof row.build_id === "string", "SQLite owned Execution has no Build id");
913
- return row.build_id;
914
- });
915
- for (const row of rows) {
916
- assert(typeof row.build_id === "string", "SQLite active Execution is invalid");
917
- this.#database.prepare(`
918
- UPDATE hypit_executions
919
- SET turn_owner = NULL, turn_acquired_at = NULL, wake_at = ?
920
- WHERE build_id = ? AND decision_outcome IS NULL
921
- `).run(now, row.build_id);
922
- }
923
- return builds;
924
- });
925
- }
926
-
927
916
  async listCapacity(): Promise<readonly CapacityReservation[]> {
928
917
  return (this.#database.prepare(
929
918
  "SELECT * FROM hypit_capacity ORDER BY created_at ASC, build_id ASC, command_id ASC",
@@ -961,7 +950,6 @@ export class SqliteRuntimeState {
961
950
  readonly commandExecutions: CommandExecutionStore;
962
951
  readonly execution: BuildExecutionStore;
963
952
  readonly catalog: BuildCatalog;
964
- readonly environment: RuntimeEnvironmentStore;
965
953
  readonly submissions: PendingBuildStore;
966
954
  readonly #database: DatabaseSync;
967
955
 
@@ -1007,6 +995,7 @@ export class SqliteRuntimeState {
1007
995
  command_id TEXT NOT NULL,
1008
996
  status TEXT NOT NULL CHECK (status IN ('started', 'completed')),
1009
997
  event_json TEXT,
998
+ activity_json TEXT,
1010
999
  PRIMARY KEY (build_id, command_id)
1011
1000
  ) STRICT;
1012
1001
  CREATE TABLE IF NOT EXISTS hypit_build_catalog (
@@ -1018,13 +1007,16 @@ export class SqliteRuntimeState {
1018
1007
  build_id TEXT PRIMARY KEY,
1019
1008
  component_packages_json TEXT NOT NULL,
1020
1009
  result_location_json TEXT NOT NULL,
1010
+ context_json TEXT,
1021
1011
  created_at INTEGER NOT NULL
1022
1012
  ) STRICT;
1023
1013
  CREATE TABLE IF NOT EXISTS hypit_executions (
1024
1014
  build_id TEXT PRIMARY KEY,
1025
1015
  component_packages_json TEXT NOT NULL,
1026
1016
  result_location_json TEXT NOT NULL,
1017
+ context_json TEXT,
1027
1018
  created_at INTEGER NOT NULL,
1019
+ started_at INTEGER,
1028
1020
  wake_at INTEGER,
1029
1021
  operation_wait_json TEXT,
1030
1022
  turn_owner TEXT,
@@ -1062,17 +1054,26 @@ export class SqliteRuntimeState {
1062
1054
  resource_id TEXT PRIMARY KEY, limit_units INTEGER NOT NULL, period_ms INTEGER NOT NULL,
1063
1055
  tokens REAL NOT NULL, updated_at INTEGER NOT NULL
1064
1056
  ) STRICT;
1065
- CREATE TABLE IF NOT EXISTS hypit_runtime_environment (
1066
- singleton INTEGER PRIMARY KEY CHECK (singleton = 1),
1067
- config_json TEXT NOT NULL
1068
- ) STRICT;
1069
1057
  `);
1058
+ if (!options.readOnly) transaction(database, () => {
1059
+ for (const table of ["hypit_submissions", "hypit_executions"]) {
1060
+ const columns = database.prepare(`PRAGMA table_info(${table})`).all() as Row[];
1061
+ if (!columns.some((column) => column.name === "context_json")) database.exec(`ALTER TABLE ${table} ADD COLUMN context_json TEXT`);
1062
+ if (table === "hypit_executions" && !columns.some((column) => column.name === "started_at")) database.exec("ALTER TABLE hypit_executions ADD COLUMN started_at INTEGER");
1063
+ }
1064
+ });
1065
+ // Add the nullable live-activity column without touching any accepted facts or Results.
1066
+ if (!options.readOnly) transaction(database, () => {
1067
+ if (!(database.prepare("PRAGMA table_info(hypit_command_executions)").all() as Row[])
1068
+ .some((column) => column.name === "activity_json")) {
1069
+ database.exec("ALTER TABLE hypit_command_executions ADD COLUMN activity_json TEXT");
1070
+ }
1071
+ });
1070
1072
  this.builds = new SqliteBuildStore(database);
1071
1073
  this.operations = new SqliteOperationStore(database);
1072
1074
  this.commandExecutions = new SqliteCommandExecutionStore(database);
1073
1075
  this.execution = new SqliteBuildExecutionStore(database);
1074
1076
  this.catalog = new SqliteBuildCatalog(database);
1075
- this.environment = new SqliteRuntimeEnvironmentStore(database);
1076
1077
  this.submissions = new SqlitePendingBuildStore(database);
1077
1078
  }
1078
1079