@sixb/core 0.2.6 → 0.2.8

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 (691) hide show
  1. package/dist/actions/index.js +53 -50
  2. package/dist/actions/index.js.map +1 -1
  3. package/dist/actions/request.d.ts.map +1 -1
  4. package/dist/actions/run/context.d.ts.map +1 -1
  5. package/dist/actions/run/execute.d.ts +3 -0
  6. package/dist/actions/run/execute.d.ts.map +1 -1
  7. package/dist/actions/run/executor.d.ts +3 -0
  8. package/dist/actions/run/executor.d.ts.map +1 -1
  9. package/dist/actions/run/normalize.d.ts.map +1 -1
  10. package/dist/actions/run/types.d.ts +6 -0
  11. package/dist/actions/run/types.d.ts.map +1 -1
  12. package/dist/actions/types/context.d.ts +7 -0
  13. package/dist/actions/types/context.d.ts.map +1 -1
  14. package/dist/agents/context/entries.d.ts +17 -0
  15. package/dist/agents/context/entries.d.ts.map +1 -1
  16. package/dist/agents/context/index.js +3 -2
  17. package/dist/agents/context/index.js.map +1 -1
  18. package/dist/agents/context-model.d.ts.map +1 -1
  19. package/dist/agents/context-resolution.d.ts.map +1 -1
  20. package/dist/agents/execution.d.ts +7 -0
  21. package/dist/agents/execution.d.ts.map +1 -1
  22. package/dist/agents/index.d.ts +1 -1
  23. package/dist/agents/index.d.ts.map +1 -1
  24. package/dist/agents/index.js +62 -57
  25. package/dist/agents/index.js.map +1 -1
  26. package/dist/agents/model-call-retry.d.ts +28 -0
  27. package/dist/agents/model-call-retry.d.ts.map +1 -0
  28. package/dist/agents/model-loop.d.ts +4 -2
  29. package/dist/agents/model-loop.d.ts.map +1 -1
  30. package/dist/agents/model-routing.d.ts +15 -4
  31. package/dist/agents/model-routing.d.ts.map +1 -1
  32. package/dist/agents/request.d.ts.map +1 -1
  33. package/dist/agents/run-artifacts.d.ts +2 -0
  34. package/dist/agents/run-artifacts.d.ts.map +1 -1
  35. package/dist/agents/run-plan.d.ts +1 -1
  36. package/dist/agents/run-plan.d.ts.map +1 -1
  37. package/dist/agents/run-session-http.d.ts.map +1 -1
  38. package/dist/agents/run-session-serve.d.ts.map +1 -1
  39. package/dist/agents/run-session-wire.d.ts +6 -0
  40. package/dist/agents/run-session-wire.d.ts.map +1 -1
  41. package/dist/agents/run-token.d.ts +6 -0
  42. package/dist/agents/run-token.d.ts.map +1 -1
  43. package/dist/agents/streams/index.js +1 -1
  44. package/dist/agents/streams/internal.js +2 -2
  45. package/dist/agents/thread-access.d.ts +13 -0
  46. package/dist/agents/thread-access.d.ts.map +1 -1
  47. package/dist/agents/tool-files.d.ts.map +1 -1
  48. package/dist/artifacts/caller.d.ts +10 -0
  49. package/dist/artifacts/caller.d.ts.map +1 -0
  50. package/dist/artifacts/comment-place.d.ts +26 -0
  51. package/dist/artifacts/comment-place.d.ts.map +1 -0
  52. package/dist/artifacts/comment-text.d.ts +12 -4
  53. package/dist/artifacts/comment-text.d.ts.map +1 -1
  54. package/dist/artifacts/comments.d.ts +8 -2
  55. package/dist/artifacts/comments.d.ts.map +1 -1
  56. package/dist/artifacts/errors.d.ts +1 -1
  57. package/dist/artifacts/errors.d.ts.map +1 -1
  58. package/dist/artifacts/execution.d.ts +73 -5
  59. package/dist/artifacts/execution.d.ts.map +1 -1
  60. package/dist/artifacts/frames/assets.d.ts +27 -7
  61. package/dist/artifacts/frames/assets.d.ts.map +1 -1
  62. package/dist/artifacts/frames/entries.d.ts +5 -4
  63. package/dist/artifacts/frames/entries.d.ts.map +1 -1
  64. package/dist/artifacts/frames/hyperframes.d.ts +12 -0
  65. package/dist/artifacts/frames/hyperframes.d.ts.map +1 -0
  66. package/dist/artifacts/frames/index.d.ts +3 -1
  67. package/dist/artifacts/frames/index.d.ts.map +1 -1
  68. package/dist/artifacts/frames/index.js +20 -6
  69. package/dist/artifacts/frames/index.js.map +3 -3
  70. package/dist/artifacts/frames/kit.d.ts.map +1 -1
  71. package/dist/artifacts/frames/protocol.d.ts +33 -0
  72. package/dist/artifacts/frames/protocol.d.ts.map +1 -1
  73. package/dist/artifacts/frames/video-runtime.d.ts +21 -0
  74. package/dist/artifacts/frames/video-runtime.d.ts.map +1 -0
  75. package/dist/artifacts/html.d.ts +23 -0
  76. package/dist/artifacts/html.d.ts.map +1 -1
  77. package/dist/artifacts/index.d.ts +5 -3
  78. package/dist/artifacts/index.d.ts.map +1 -1
  79. package/dist/artifacts/index.js +71 -10
  80. package/dist/artifacts/index.js.map +4 -4
  81. package/dist/artifacts/kinds.d.ts +1 -1
  82. package/dist/artifacts/kinds.d.ts.map +1 -1
  83. package/dist/artifacts/limits.d.ts +37 -0
  84. package/dist/artifacts/limits.d.ts.map +1 -1
  85. package/dist/artifacts/live/document.d.ts.map +1 -1
  86. package/dist/artifacts/live/index.d.ts +6 -2
  87. package/dist/artifacts/live/index.d.ts.map +1 -1
  88. package/dist/artifacts/live/index.js +3432 -13
  89. package/dist/artifacts/live/index.js.map +6 -3
  90. package/dist/artifacts/live/presence.d.ts +7 -5
  91. package/dist/artifacts/live/presence.d.ts.map +1 -1
  92. package/dist/artifacts/live/protocol.d.ts +4 -2
  93. package/dist/artifacts/live/protocol.d.ts.map +1 -1
  94. package/dist/artifacts/live/server.d.ts +1 -1
  95. package/dist/artifacts/live/server.d.ts.map +1 -1
  96. package/dist/artifacts/live/server.js +36 -31
  97. package/dist/artifacts/live/server.js.map +1 -1
  98. package/dist/artifacts/live/state.d.ts +2 -2
  99. package/dist/artifacts/media/media.d.ts +96 -0
  100. package/dist/artifacts/media/media.d.ts.map +1 -0
  101. package/dist/artifacts/media/transcriber.d.ts +29 -0
  102. package/dist/artifacts/media/transcriber.d.ts.map +1 -0
  103. package/dist/artifacts/outline.d.ts +26 -1
  104. package/dist/artifacts/outline.d.ts.map +1 -1
  105. package/dist/artifacts/publish/files.d.ts +5 -2
  106. package/dist/artifacts/publish/files.d.ts.map +1 -1
  107. package/dist/artifacts/publish/index.d.ts +11 -2
  108. package/dist/artifacts/publish/index.d.ts.map +1 -1
  109. package/dist/artifacts/publish/index.js +110 -33
  110. package/dist/artifacts/publish/index.js.map +1 -1
  111. package/dist/artifacts/publish/pdf.d.ts.map +1 -1
  112. package/dist/artifacts/publish/previews.d.ts +7 -2
  113. package/dist/artifacts/publish/previews.d.ts.map +1 -1
  114. package/dist/artifacts/publish/publish.d.ts.map +1 -1
  115. package/dist/artifacts/publish/validate/html.d.ts +5 -4
  116. package/dist/artifacts/publish/validate/html.d.ts.map +1 -1
  117. package/dist/artifacts/publish/validate/video.d.ts +36 -0
  118. package/dist/artifacts/publish/validate/video.d.ts.map +1 -0
  119. package/dist/artifacts/publish/video.d.ts +79 -0
  120. package/dist/artifacts/publish/video.d.ts.map +1 -0
  121. package/dist/artifacts/resolve.d.ts +9 -0
  122. package/dist/artifacts/resolve.d.ts.map +1 -1
  123. package/dist/artifacts/video/composition.d.ts +183 -0
  124. package/dist/artifacts/video/composition.d.ts.map +1 -0
  125. package/dist/artifacts/video/edit.d.ts +298 -0
  126. package/dist/artifacts/video/edit.d.ts.map +1 -0
  127. package/dist/artifacts/video/export.d.ts +142 -0
  128. package/dist/artifacts/video/export.d.ts.map +1 -0
  129. package/dist/artifacts/video/looks.d.ts +133 -0
  130. package/dist/artifacts/video/looks.d.ts.map +1 -0
  131. package/dist/artifacts/video/project.d.ts +74 -0
  132. package/dist/artifacts/video/project.d.ts.map +1 -0
  133. package/dist/artifacts/video/stills.d.ts +65 -0
  134. package/dist/artifacts/video/stills.d.ts.map +1 -0
  135. package/dist/artifacts/video/timeline.d.ts +153 -0
  136. package/dist/artifacts/video/timeline.d.ts.map +1 -0
  137. package/dist/auth/index.js +9 -8
  138. package/dist/auth/index.js.map +1 -1
  139. package/dist/authorization/index.js +5 -4
  140. package/dist/authorization/index.js.map +1 -1
  141. package/dist/blob-storage/browser.d.ts +1 -1
  142. package/dist/blob-storage/browser.d.ts.map +1 -1
  143. package/dist/blob-storage/browser.js +8 -4
  144. package/dist/blob-storage/browser.js.map +1 -1
  145. package/dist/blob-storage/constants.d.ts +8 -3
  146. package/dist/blob-storage/constants.d.ts.map +1 -1
  147. package/dist/blob-storage/download-urls.d.ts +2 -2
  148. package/dist/blob-storage/download-urls.d.ts.map +1 -1
  149. package/dist/blob-storage/index.d.ts +1 -1
  150. package/dist/blob-storage/index.d.ts.map +1 -1
  151. package/dist/blob-storage/index.js +9 -5
  152. package/dist/blob-storage/index.js.map +1 -1
  153. package/dist/blob-storage/internal.d.ts +2 -2
  154. package/dist/blob-storage/internal.d.ts.map +1 -1
  155. package/dist/blob-storage/internal.js +10 -4
  156. package/dist/blob-storage/internal.js.map +1 -1
  157. package/dist/blob-storage/media-type.d.ts +12 -3
  158. package/dist/blob-storage/media-type.d.ts.map +1 -1
  159. package/dist/bootstrap/discovery.d.ts +6 -0
  160. package/dist/bootstrap/discovery.d.ts.map +1 -1
  161. package/dist/bootstrap/index.js +63 -60
  162. package/dist/bootstrap/index.js.map +2 -2
  163. package/dist/{chunk-az95tsh3.js → chunk-0fjryajn.js} +3 -2
  164. package/dist/chunk-0fjryajn.js.map +11 -0
  165. package/dist/{chunk-9tpmfh3n.js → chunk-0mk8qqp9.js} +3 -3
  166. package/dist/{chunk-9tpmfh3n.js.map → chunk-0mk8qqp9.js.map} +3 -3
  167. package/dist/{chunk-88xeh6zx.js → chunk-1g4me5f2.js} +182 -7
  168. package/dist/{chunk-88xeh6zx.js.map → chunk-1g4me5f2.js.map} +3 -3
  169. package/dist/{chunk-7mhbs9yy.js → chunk-1z8ccj53.js} +1 -1
  170. package/dist/{chunk-wkv3h3q7.js → chunk-2138b0ng.js} +115 -8
  171. package/dist/chunk-2138b0ng.js.map +12 -0
  172. package/dist/chunk-23eaayw4.js +3757 -0
  173. package/dist/chunk-23eaayw4.js.map +22 -0
  174. package/dist/{chunk-s8xxef60.js → chunk-2mxq1yd9.js} +48 -41
  175. package/dist/{chunk-s8xxef60.js.map → chunk-2mxq1yd9.js.map} +6 -6
  176. package/dist/{chunk-dmnd9ea6.js → chunk-30a0ftnm.js} +2 -2
  177. package/dist/{chunk-nxysqbt0.js → chunk-389ybvw9.js} +6 -2
  178. package/dist/chunk-389ybvw9.js.map +10 -0
  179. package/dist/{chunk-qbd282aa.js → chunk-39q9ybav.js} +2 -2
  180. package/dist/{chunk-9c9yknwt.js → chunk-3d9w8t4n.js} +111 -23
  181. package/dist/{chunk-9c9yknwt.js.map → chunk-3d9w8t4n.js.map} +5 -5
  182. package/dist/chunk-3dvcdn9w.js +8 -0
  183. package/dist/chunk-3dvcdn9w.js.map +10 -0
  184. package/dist/{chunk-bcz9dxtf.js → chunk-3x902cja.js} +3 -3
  185. package/dist/{chunk-c4nrycdy.js → chunk-4q4a5a96.js} +1 -1
  186. package/dist/{chunk-7r9mqpva.js → chunk-4tdm3fsj.js} +100 -36
  187. package/dist/{chunk-7r9mqpva.js.map → chunk-4tdm3fsj.js.map} +10 -10
  188. package/dist/{chunk-ykchk644.js → chunk-4w8qzy9w.js} +6 -6
  189. package/dist/{chunk-c29729me.js → chunk-4z9xtxke.js} +8 -7
  190. package/dist/chunk-4z9xtxke.js.map +12 -0
  191. package/dist/chunk-5278qwax.js +270 -0
  192. package/dist/chunk-5278qwax.js.map +11 -0
  193. package/dist/{chunk-kft7mp7z.js → chunk-5xkqasvn.js} +1 -1
  194. package/dist/{chunk-k1g14kk3.js → chunk-6a4hp405.js} +4 -5
  195. package/dist/{chunk-k1g14kk3.js.map → chunk-6a4hp405.js.map} +3 -3
  196. package/dist/{chunk-xavet0qs.js → chunk-6whr25gw.js} +2 -2
  197. package/dist/{chunk-mbwsgjn7.js → chunk-7zygtcqq.js} +14 -2
  198. package/dist/chunk-7zygtcqq.js.map +11 -0
  199. package/dist/chunk-88s9z5pf.js +3 -0
  200. package/dist/{chunk-de5sfbc3.js.map → chunk-88s9z5pf.js.map} +1 -1
  201. package/dist/{chunk-ygvay56w.js → chunk-896te58g.js} +2 -2
  202. package/dist/{chunk-pqj8vff9.js → chunk-8eqqqc1h.js} +3 -3
  203. package/dist/{chunk-425ydk65.js → chunk-8tefbhdx.js} +14 -14
  204. package/dist/{chunk-425ydk65.js.map → chunk-8tefbhdx.js.map} +1 -1
  205. package/dist/{chunk-jka26v8c.js → chunk-8x1bsp68.js} +1 -1
  206. package/dist/{chunk-wzcjhv54.js → chunk-93e4w7te.js} +113 -1
  207. package/dist/chunk-93e4w7te.js.map +11 -0
  208. package/dist/{chunk-ym1bqd98.js → chunk-990a5bkc.js} +424 -76
  209. package/dist/chunk-990a5bkc.js.map +21 -0
  210. package/dist/{chunk-fmgf9h5e.js → chunk-9az7kjv4.js} +6 -6
  211. package/dist/{chunk-eg6xqef7.js → chunk-9e5t53z0.js} +3 -3
  212. package/dist/{chunk-eg6xqef7.js.map → chunk-9e5t53z0.js.map} +3 -3
  213. package/dist/{chunk-bs1sd0e0.js → chunk-9p7kyeqz.js} +4 -4
  214. package/dist/chunk-a68zz4r0.js +537 -0
  215. package/dist/chunk-a68zz4r0.js.map +11 -0
  216. package/dist/{chunk-d7vyc7k6.js → chunk-a700gjc8.js} +10 -2
  217. package/dist/chunk-a700gjc8.js.map +10 -0
  218. package/dist/{chunk-gfdh9kqa.js → chunk-a9qzjaz2.js} +2 -5
  219. package/dist/chunk-a9qzjaz2.js.map +10 -0
  220. package/dist/{chunk-ats8y3d9.js → chunk-as94vcty.js} +688 -504
  221. package/dist/{chunk-ats8y3d9.js.map → chunk-as94vcty.js.map} +21 -21
  222. package/dist/{chunk-brybqw5k.js → chunk-bkxm2dzx.js} +1 -1
  223. package/dist/{chunk-ppxf7gw2.js → chunk-d7t9jnym.js} +3 -3
  224. package/dist/{chunk-tapdssb5.js → chunk-e3b1r4d2.js} +8 -7
  225. package/dist/{chunk-tapdssb5.js.map → chunk-e3b1r4d2.js.map} +4 -4
  226. package/dist/{chunk-cg7cygfj.js → chunk-fdmvaz7x.js} +1 -1
  227. package/dist/{chunk-191jz8a6.js → chunk-ff0qdk7z.js} +1 -1
  228. package/dist/{chunk-9vsc919v.js → chunk-fgxvrxx4.js} +22 -2
  229. package/dist/chunk-fgxvrxx4.js.map +10 -0
  230. package/dist/{chunk-wx7smkn2.js → chunk-fq8drkp0.js} +1 -1
  231. package/dist/{chunk-60662fyv.js → chunk-fqms1a8c.js} +132 -4
  232. package/dist/{chunk-60662fyv.js.map → chunk-fqms1a8c.js.map} +8 -6
  233. package/dist/{chunk-v8a1qjzp.js → chunk-hpswfrjj.js} +1 -1
  234. package/dist/{chunk-qttqe1ah.js → chunk-jbg905hn.js} +80 -13
  235. package/dist/chunk-jbg905hn.js.map +25 -0
  236. package/dist/{chunk-bz5bnjjt.js → chunk-jjte0h4p.js} +1 -1
  237. package/dist/{chunk-jt012fxq.js → chunk-jwjwvzj1.js} +797 -51
  238. package/dist/chunk-jwjwvzj1.js.map +38 -0
  239. package/dist/{chunk-f05994as.js → chunk-k3vd2vyz.js} +6 -2
  240. package/dist/chunk-k3vd2vyz.js.map +10 -0
  241. package/dist/chunk-kcqpk9w1.js.map +2 -2
  242. package/dist/chunk-mvz89age.js.map +2 -2
  243. package/dist/{chunk-xrmbhap8.js → chunk-mwg0nwkb.js} +1 -1
  244. package/dist/{chunk-a3faa34j.js → chunk-nfjt8k8j.js} +1 -1
  245. package/dist/{chunk-394zjzjs.js → chunk-nhgqz3g3.js} +3 -3
  246. package/dist/{chunk-bqr703h4.js → chunk-p0c5kkhn.js} +23 -6
  247. package/dist/{chunk-bqr703h4.js.map → chunk-p0c5kkhn.js.map} +3 -3
  248. package/dist/{chunk-92wrka15.js → chunk-q150fnj9.js} +1 -1
  249. package/dist/{chunk-w3t94hm6.js → chunk-qk3zq25v.js} +1 -1
  250. package/dist/{chunk-6hfbz4d0.js → chunk-r588h4ev.js} +1 -1
  251. package/dist/chunk-rtkqczbr.js.map +2 -2
  252. package/dist/{chunk-3qtk0070.js → chunk-ssqbrts1.js} +86 -9
  253. package/dist/chunk-ssqbrts1.js.map +14 -0
  254. package/dist/{chunk-5qqmndhm.js → chunk-szzhrn3e.js} +1 -1
  255. package/dist/{chunk-n1hbwc6y.js → chunk-t6pfch4e.js} +1 -1
  256. package/dist/{chunk-xtztwpkh.js → chunk-v6h4tc2v.js} +86 -5
  257. package/dist/chunk-v6h4tc2v.js.map +12 -0
  258. package/dist/{chunk-brhp9d97.js → chunk-vmqjndb3.js} +2 -2
  259. package/dist/chunk-vtjzwymr.js.map +2 -2
  260. package/dist/{chunk-t19wjmnc.js → chunk-wpba6hhd.js} +54 -20
  261. package/dist/{chunk-t19wjmnc.js.map → chunk-wpba6hhd.js.map} +3 -3
  262. package/dist/{chunk-htdzx40w.js → chunk-wrb1x1ss.js} +12 -4
  263. package/dist/{chunk-htdzx40w.js.map → chunk-wrb1x1ss.js.map} +3 -3
  264. package/dist/{chunk-5sswe5ej.js → chunk-wsv23wvr.js} +2 -2
  265. package/dist/{chunk-90nqenq8.js → chunk-x0hqc54n.js} +4 -4
  266. package/dist/{chunk-sgx82nnt.js → chunk-xg31er4p.js} +43 -4
  267. package/dist/chunk-xg31er4p.js.map +10 -0
  268. package/dist/{chunk-3neam1y5.js → chunk-y3qb965a.js} +2 -2
  269. package/dist/{chunk-gaj8djsw.js → chunk-y57eawng.js} +10 -5
  270. package/dist/{chunk-gaj8djsw.js.map → chunk-y57eawng.js.map} +3 -3
  271. package/dist/{chunk-8ncg20rd.js → chunk-yah25st6.js} +5 -5
  272. package/dist/chunk-yah25st6.js.map +10 -0
  273. package/dist/{chunk-grt2j5vp.js → chunk-ywvxcmqj.js} +106 -13
  274. package/dist/{chunk-grt2j5vp.js.map → chunk-ywvxcmqj.js.map} +8 -7
  275. package/dist/{chunk-xf76csps.js → chunk-zmq9xc9s.js} +70 -31
  276. package/dist/{chunk-xf76csps.js.map → chunk-zmq9xc9s.js.map} +4 -3
  277. package/dist/datasets/write.js +8 -7
  278. package/dist/datasets/write.js.map +1 -1
  279. package/dist/deploy/index.d.ts +1 -1
  280. package/dist/deploy/index.d.ts.map +1 -1
  281. package/dist/deploy/internal.js +2 -2
  282. package/dist/deploy/internal.js.map +2 -2
  283. package/dist/deploy/types.d.ts +8 -58
  284. package/dist/deploy/types.d.ts.map +1 -1
  285. package/dist/env/index.d.ts +10 -3
  286. package/dist/env/index.d.ts.map +1 -1
  287. package/dist/env/index.js.map +2 -2
  288. package/dist/errors/catalog.d.ts.map +1 -1
  289. package/dist/execution/agent.js +53 -50
  290. package/dist/execution/agent.js.map +1 -1
  291. package/dist/execution/kernel-operation.d.ts +1 -0
  292. package/dist/execution/kernel-operation.d.ts.map +1 -1
  293. package/dist/execution/primitive.js +53 -50
  294. package/dist/execution/primitive.js.map +1 -1
  295. package/dist/execution/request.js +54 -51
  296. package/dist/execution/request.js.map +2 -2
  297. package/dist/execution/types.d.ts +5 -0
  298. package/dist/execution/types.d.ts.map +1 -1
  299. package/dist/http/api-routes.d.ts.map +1 -1
  300. package/dist/http/index.js +1 -1
  301. package/dist/index.d.ts +7 -5
  302. package/dist/index.d.ts.map +1 -1
  303. package/dist/index.js +73 -67
  304. package/dist/index.js.map +1 -1
  305. package/dist/lake-storage/index.js +9 -8
  306. package/dist/lake-storage/index.js.map +1 -1
  307. package/dist/maintenance/index.js +9 -8
  308. package/dist/maintenance/index.js.map +2 -2
  309. package/dist/materializer/index.js +26 -24
  310. package/dist/materializer/index.js.map +1 -1
  311. package/dist/models/audio/runtime.d.ts +3 -1
  312. package/dist/models/audio/runtime.d.ts.map +1 -1
  313. package/dist/models/audio/speech.d.ts +2 -2
  314. package/dist/models/audio/speech.d.ts.map +1 -1
  315. package/dist/models/audio/types.d.ts +23 -3
  316. package/dist/models/audio/types.d.ts.map +1 -1
  317. package/dist/models/calls.d.ts +7 -0
  318. package/dist/models/calls.d.ts.map +1 -1
  319. package/dist/models/catalog.d.ts +5 -0
  320. package/dist/models/catalog.d.ts.map +1 -1
  321. package/dist/models/definitions.d.ts +3 -2
  322. package/dist/models/definitions.d.ts.map +1 -1
  323. package/dist/models/errors.d.ts +5 -3
  324. package/dist/models/errors.d.ts.map +1 -1
  325. package/dist/models/events.d.ts +2 -0
  326. package/dist/models/events.d.ts.map +1 -1
  327. package/dist/models/execution/index.d.ts +1 -0
  328. package/dist/models/execution/index.d.ts.map +1 -1
  329. package/dist/models/execution/index.js +33 -28
  330. package/dist/models/execution/index.js.map +1 -1
  331. package/dist/models/execution/model-call-limits.d.ts.map +1 -1
  332. package/dist/models/execution/model-call-recorder.d.ts +8 -0
  333. package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
  334. package/dist/models/execution/session.d.ts +12 -0
  335. package/dist/models/execution/session.d.ts.map +1 -1
  336. package/dist/models/execution/usage.d.ts.map +1 -1
  337. package/dist/models/execution.d.ts +1 -1
  338. package/dist/models/execution.d.ts.map +1 -1
  339. package/dist/models/generation-types.d.ts +2 -0
  340. package/dist/models/generation-types.d.ts.map +1 -1
  341. package/dist/models/index.d.ts +4 -2
  342. package/dist/models/index.d.ts.map +1 -1
  343. package/dist/models/index.js +2 -2
  344. package/dist/models/input-file.d.ts.map +1 -1
  345. package/dist/models/pricing.d.ts +2 -1
  346. package/dist/models/pricing.d.ts.map +1 -1
  347. package/dist/models/rate-card.d.ts +6 -0
  348. package/dist/models/rate-card.d.ts.map +1 -1
  349. package/dist/models/tools.d.ts +5 -0
  350. package/dist/models/tools.d.ts.map +1 -1
  351. package/dist/models/video/catalog.d.ts +13 -0
  352. package/dist/models/video/catalog.d.ts.map +1 -0
  353. package/dist/models/video/check.d.ts +76 -0
  354. package/dist/models/video/check.d.ts.map +1 -0
  355. package/dist/models/video/runtime.d.ts +21 -0
  356. package/dist/models/video/runtime.d.ts.map +1 -0
  357. package/dist/models/video/types.d.ts +188 -0
  358. package/dist/models/video/types.d.ts.map +1 -0
  359. package/dist/objects/execution.d.ts.map +1 -1
  360. package/dist/objects/index.js +53 -50
  361. package/dist/objects/index.js.map +1 -1
  362. package/dist/objects/query/index.js +25 -23
  363. package/dist/objects/query/index.js.map +1 -1
  364. package/dist/objects/sdk/object-set.d.ts.map +1 -1
  365. package/dist/ontology/index.js +4 -4
  366. package/dist/ontology/internal.js +4 -4
  367. package/dist/pipelines/index.js +28 -26
  368. package/dist/pipelines/index.js.map +1 -1
  369. package/dist/projections/internal.js +26 -24
  370. package/dist/projections/internal.js.map +1 -1
  371. package/dist/queues/index.d.ts +1 -1
  372. package/dist/queues/index.d.ts.map +1 -1
  373. package/dist/queues/types.d.ts +103 -6
  374. package/dist/queues/types.d.ts.map +1 -1
  375. package/dist/runtime/create.d.ts.map +1 -1
  376. package/dist/runtime/definitions.d.ts +14 -0
  377. package/dist/runtime/definitions.d.ts.map +1 -1
  378. package/dist/runtime/host.d.ts +3 -1
  379. package/dist/runtime/host.d.ts.map +1 -1
  380. package/dist/runtime/index.d.ts +1 -1
  381. package/dist/runtime/index.d.ts.map +1 -1
  382. package/dist/runtime/internal.d.ts +3 -1
  383. package/dist/runtime/internal.d.ts.map +1 -1
  384. package/dist/runtime/internal.js +49 -43
  385. package/dist/runtime/internal.js.map +2 -2
  386. package/dist/runtime/resolve-definitions.d.ts +2 -1
  387. package/dist/runtime/resolve-definitions.d.ts.map +1 -1
  388. package/dist/runtime/sixb.d.ts.map +1 -1
  389. package/dist/sandboxes/errors.d.ts +19 -0
  390. package/dist/sandboxes/errors.d.ts.map +1 -1
  391. package/dist/sandboxes/exec.d.ts +2 -0
  392. package/dist/sandboxes/exec.d.ts.map +1 -1
  393. package/dist/sandboxes/index.d.ts +1 -1
  394. package/dist/sandboxes/index.d.ts.map +1 -1
  395. package/dist/sandboxes/index.js +14 -8
  396. package/dist/sandboxes/index.js.map +1 -1
  397. package/dist/sandboxes/sandbox.d.ts +15 -1
  398. package/dist/sandboxes/sandbox.d.ts.map +1 -1
  399. package/dist/security/public.d.ts +6 -4
  400. package/dist/security/public.d.ts.map +1 -1
  401. package/dist/security/public.js +5 -3
  402. package/dist/security/public.js.map +1 -1
  403. package/dist/shares/internal.js +25 -23
  404. package/dist/shares/internal.js.map +2 -2
  405. package/dist/storage/agents/in-memory.d.ts +2 -1
  406. package/dist/storage/agents/in-memory.d.ts.map +1 -1
  407. package/dist/storage/agents/index.d.ts +1 -1
  408. package/dist/storage/agents/index.d.ts.map +1 -1
  409. package/dist/storage/agents/provider.d.ts.map +1 -1
  410. package/dist/storage/agents/provider.js +5 -5
  411. package/dist/storage/agents/types.d.ts +27 -1
  412. package/dist/storage/agents/types.d.ts.map +1 -1
  413. package/dist/storage/ai-cost/analytics.d.ts +1 -0
  414. package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
  415. package/dist/storage/ai-cost/groups.d.ts +2 -0
  416. package/dist/storage/ai-cost/groups.d.ts.map +1 -1
  417. package/dist/storage/ai-cost/provider.js +5 -5
  418. package/dist/storage/ai-cost/types.d.ts +2 -1
  419. package/dist/storage/ai-cost/types.d.ts.map +1 -1
  420. package/dist/storage/ai-cost/validation.d.ts.map +1 -1
  421. package/dist/storage/ai-limits/enforcement.js +3 -3
  422. package/dist/storage/ai-limits/provider.js +2 -2
  423. package/dist/storage/ai-usage/in-memory.d.ts +8 -1
  424. package/dist/storage/ai-usage/in-memory.d.ts.map +1 -1
  425. package/dist/storage/ai-usage/index.d.ts +2 -2
  426. package/dist/storage/ai-usage/index.d.ts.map +1 -1
  427. package/dist/storage/ai-usage/record.d.ts +11 -1
  428. package/dist/storage/ai-usage/record.d.ts.map +1 -1
  429. package/dist/storage/ai-usage/types.d.ts +80 -1
  430. package/dist/storage/ai-usage/types.d.ts.map +1 -1
  431. package/dist/storage/ai-usage/usage.d.ts +1 -1
  432. package/dist/storage/ai-usage/usage.d.ts.map +1 -1
  433. package/dist/storage/artifacts/in-memory.d.ts +25 -2
  434. package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
  435. package/dist/storage/artifacts/index.d.ts +1 -1
  436. package/dist/storage/artifacts/index.d.ts.map +1 -1
  437. package/dist/storage/artifacts/record.d.ts +12 -1
  438. package/dist/storage/artifacts/record.d.ts.map +1 -1
  439. package/dist/storage/artifacts/types.d.ts +198 -6
  440. package/dist/storage/artifacts/types.d.ts.map +1 -1
  441. package/dist/storage/executions/provider.js +3 -2
  442. package/dist/storage/executions/provider.js.map +1 -1
  443. package/dist/storage/file-upload-sessions/provider.js +10 -9
  444. package/dist/storage/file-upload-sessions/provider.js.map +1 -1
  445. package/dist/storage/in-memory/index.d.ts.map +1 -1
  446. package/dist/storage/index.d.ts +4 -4
  447. package/dist/storage/index.d.ts.map +1 -1
  448. package/dist/storage/index.js +25 -23
  449. package/dist/storage/index.js.map +1 -1
  450. package/dist/storage/internal.d.ts +2 -2
  451. package/dist/storage/internal.d.ts.map +1 -1
  452. package/dist/storage/internal.js +34 -14
  453. package/dist/storage/internal.js.map +2 -2
  454. package/dist/storage/workflow-runs/provider.js +10 -9
  455. package/dist/storage/workflow-runs/provider.js.map +1 -1
  456. package/dist/syncs/index.js +29 -27
  457. package/dist/syncs/index.js.map +1 -1
  458. package/dist/testing/agent-storage-contract.d.ts.map +1 -1
  459. package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
  460. package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
  461. package/dist/testing/artifact-storage-contract.d.ts +3 -0
  462. package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
  463. package/dist/testing/execution-storage-contract.d.ts.map +1 -1
  464. package/dist/testing/index.js +686 -75
  465. package/dist/testing/index.js.map +10 -10
  466. package/dist/testing/lake-storage-contract.d.ts.map +1 -1
  467. package/dist/testing/queues-contract.d.ts.map +1 -1
  468. package/dist/testing/sandboxes-contract.d.ts.map +1 -1
  469. package/dist/webhooks/internal.js +26 -24
  470. package/dist/webhooks/internal.js.map +2 -2
  471. package/dist/workers/index.js +5 -5
  472. package/dist/workers/index.js.map +1 -1
  473. package/dist/workflows/index.js +60 -57
  474. package/dist/workflows/index.js.map +1 -1
  475. package/package.json +3 -1
  476. package/src/actions/request.ts +2 -0
  477. package/src/actions/run/context.ts +1 -0
  478. package/src/actions/run/execute.ts +5 -1
  479. package/src/actions/run/executor.ts +4 -0
  480. package/src/actions/run/normalize.ts +4 -0
  481. package/src/actions/run/types.ts +6 -0
  482. package/src/actions/types/context.ts +7 -0
  483. package/src/agents/README.md +3 -1
  484. package/src/agents/context/entries.ts +63 -9
  485. package/src/agents/context-model.ts +9 -0
  486. package/src/agents/context-resolution.ts +7 -0
  487. package/src/agents/execution.ts +39 -0
  488. package/src/agents/index.ts +1 -0
  489. package/src/agents/model-call-retry.ts +69 -0
  490. package/src/agents/model-loop.ts +86 -12
  491. package/src/agents/model-routing.ts +104 -38
  492. package/src/agents/request.ts +27 -1
  493. package/src/agents/run-artifacts.ts +10 -5
  494. package/src/agents/run-plan.ts +2 -1
  495. package/src/agents/run-session-http.ts +1 -0
  496. package/src/agents/run-session-serve.ts +23 -2
  497. package/src/agents/run-session-wire.ts +45 -0
  498. package/src/agents/run-token.ts +7 -0
  499. package/src/agents/thread-access.ts +34 -1
  500. package/src/agents/tool-files.ts +23 -7
  501. package/src/artifacts/caller.ts +42 -0
  502. package/src/artifacts/comment-place.ts +51 -0
  503. package/src/artifacts/comment-text.ts +50 -7
  504. package/src/artifacts/comments.ts +132 -34
  505. package/src/artifacts/errors.ts +1 -0
  506. package/src/artifacts/execution.ts +249 -5
  507. package/src/artifacts/frames/assets.ts +93 -15
  508. package/src/artifacts/frames/entries.ts +7 -4
  509. package/src/artifacts/frames/generated/hyperframes-notices.txt +290 -0
  510. package/src/artifacts/frames/generated/hyperframes.txt +1145 -0
  511. package/src/artifacts/frames/generated.d.ts +5 -0
  512. package/src/artifacts/frames/hyperframes.ts +14 -0
  513. package/src/artifacts/frames/index.ts +5 -0
  514. package/src/artifacts/frames/kit.ts +7 -3
  515. package/src/artifacts/frames/protocol.ts +56 -0
  516. package/src/artifacts/frames/video-runtime.ts +165 -0
  517. package/src/artifacts/html.ts +13 -0
  518. package/src/artifacts/index.ts +7 -0
  519. package/src/artifacts/kinds.ts +9 -1
  520. package/src/artifacts/limits.ts +43 -0
  521. package/src/artifacts/live/document.ts +27 -3
  522. package/src/artifacts/live/index.ts +58 -2
  523. package/src/artifacts/live/presence.ts +17 -5
  524. package/src/artifacts/live/protocol.ts +4 -2
  525. package/src/artifacts/live/server.ts +1 -1
  526. package/src/artifacts/live/state.ts +3 -3
  527. package/src/artifacts/media/README.md +75 -0
  528. package/src/artifacts/media/media.ts +316 -0
  529. package/src/artifacts/media/transcriber.ts +84 -0
  530. package/src/artifacts/outline.ts +28 -0
  531. package/src/artifacts/publish/files.ts +19 -6
  532. package/src/artifacts/publish/index.ts +49 -2
  533. package/src/artifacts/publish/pdf.ts +3 -1
  534. package/src/artifacts/publish/previews.ts +22 -8
  535. package/src/artifacts/publish/publish.ts +4 -1
  536. package/src/artifacts/publish/validate/html.ts +23 -18
  537. package/src/artifacts/publish/validate/video.ts +309 -0
  538. package/src/artifacts/publish/video.ts +235 -0
  539. package/src/artifacts/resolve.ts +45 -0
  540. package/src/artifacts/video/README.md +402 -0
  541. package/src/artifacts/video/composition.ts +898 -0
  542. package/src/artifacts/video/edit.ts +3967 -0
  543. package/src/artifacts/video/export.ts +352 -0
  544. package/src/artifacts/video/looks.ts +694 -0
  545. package/src/artifacts/video/project.ts +198 -0
  546. package/src/artifacts/video/stills.ts +168 -0
  547. package/src/artifacts/video/timeline.ts +658 -0
  548. package/src/blob-storage/browser.ts +1 -1
  549. package/src/blob-storage/constants.ts +9 -3
  550. package/src/blob-storage/download-urls.ts +5 -3
  551. package/src/blob-storage/index.ts +1 -0
  552. package/src/blob-storage/internal.ts +13 -2
  553. package/src/blob-storage/media-type.ts +149 -8
  554. package/src/bootstrap/discovery.ts +61 -11
  555. package/src/deploy/index.ts +0 -5
  556. package/src/deploy/types.ts +8 -63
  557. package/src/deploy/validation.ts +1 -1
  558. package/src/env/index.ts +10 -4
  559. package/src/errors/catalog.ts +2 -1
  560. package/src/execution/authorization.ts +2 -2
  561. package/src/execution/kernel-operation.ts +14 -0
  562. package/src/execution/types.ts +2 -0
  563. package/src/http/api-routes.ts +117 -0
  564. package/src/index.ts +21 -1
  565. package/src/lake-storage/definition-updates.ts +3 -9
  566. package/src/models/audio/runtime.ts +48 -3
  567. package/src/models/audio/speech.ts +2 -2
  568. package/src/models/audio/types.ts +24 -3
  569. package/src/models/calls.ts +35 -18
  570. package/src/models/catalog.ts +9 -2
  571. package/src/models/definitions.ts +4 -2
  572. package/src/models/errors.ts +5 -3
  573. package/src/models/events.ts +2 -0
  574. package/src/models/execution/README.md +68 -2
  575. package/src/models/execution/index.ts +1 -0
  576. package/src/models/execution/model-call-limits.ts +11 -5
  577. package/src/models/execution/model-call-recorder.ts +14 -0
  578. package/src/models/execution/session.ts +52 -23
  579. package/src/models/execution/usage.ts +1 -0
  580. package/src/models/execution.ts +13 -2
  581. package/src/models/generation-types.ts +2 -0
  582. package/src/models/index.ts +20 -1
  583. package/src/models/input-file.ts +7 -2
  584. package/src/models/pricing.ts +19 -1
  585. package/src/models/rate-card.ts +15 -3
  586. package/src/models/tools.ts +5 -0
  587. package/src/models/video/catalog.ts +101 -0
  588. package/src/models/video/check.ts +441 -0
  589. package/src/models/video/runtime.ts +550 -0
  590. package/src/models/video/types.ts +194 -0
  591. package/src/objects/execution.ts +2 -0
  592. package/src/objects/sdk/object-set.ts +2 -0
  593. package/src/queues/index.ts +5 -0
  594. package/src/queues/types.ts +126 -5
  595. package/src/runtime/create.ts +1 -0
  596. package/src/runtime/definitions.ts +25 -0
  597. package/src/runtime/host.ts +6 -1
  598. package/src/runtime/index.ts +6 -1
  599. package/src/runtime/internal.ts +3 -1
  600. package/src/runtime/resolve-definitions.ts +7 -1
  601. package/src/runtime/sixb.ts +12 -4
  602. package/src/sandboxes/README.md +12 -2
  603. package/src/sandboxes/errors.ts +27 -0
  604. package/src/sandboxes/exec.ts +3 -1
  605. package/src/sandboxes/index.ts +3 -0
  606. package/src/sandboxes/sandbox.ts +15 -1
  607. package/src/security/public.ts +6 -4
  608. package/src/storage/agents/in-memory.ts +39 -0
  609. package/src/storage/agents/index.ts +1 -0
  610. package/src/storage/agents/provider.ts +8 -0
  611. package/src/storage/agents/types.ts +32 -1
  612. package/src/storage/ai-cost/analytics.ts +2 -0
  613. package/src/storage/ai-cost/codec.ts +1 -0
  614. package/src/storage/ai-cost/groups.ts +7 -0
  615. package/src/storage/ai-cost/types.ts +2 -0
  616. package/src/storage/ai-cost/validation.ts +2 -0
  617. package/src/storage/ai-usage/in-memory.ts +93 -0
  618. package/src/storage/ai-usage/index.ts +10 -0
  619. package/src/storage/ai-usage/record.ts +106 -0
  620. package/src/storage/ai-usage/types.ts +102 -1
  621. package/src/storage/ai-usage/usage.ts +2 -0
  622. package/src/storage/artifacts/in-memory.ts +108 -11
  623. package/src/storage/artifacts/index.ts +14 -0
  624. package/src/storage/artifacts/record.ts +203 -1
  625. package/src/storage/artifacts/types.ts +199 -6
  626. package/src/storage/executions/validation.ts +2 -2
  627. package/src/storage/in-memory/index.ts +1 -1
  628. package/src/storage/index.ts +22 -1
  629. package/src/storage/internal.ts +9 -0
  630. package/src/testing/agent-storage-contract.ts +135 -0
  631. package/src/testing/ai-cost-storage-contract.ts +1 -0
  632. package/src/testing/ai-usage-storage-contract.ts +145 -1
  633. package/src/testing/artifact-storage-contract.ts +330 -0
  634. package/src/testing/execution-storage-contract.ts +10 -2
  635. package/src/testing/lake-storage-contract.ts +27 -0
  636. package/src/testing/queues-contract.ts +71 -0
  637. package/src/testing/sandboxes-contract.ts +50 -0
  638. package/dist/chunk-3723kgba.js +0 -29
  639. package/dist/chunk-3723kgba.js.map +0 -10
  640. package/dist/chunk-3qtk0070.js.map +0 -14
  641. package/dist/chunk-8ncg20rd.js.map +0 -10
  642. package/dist/chunk-9vsc919v.js.map +0 -10
  643. package/dist/chunk-az95tsh3.js.map +0 -11
  644. package/dist/chunk-c29729me.js.map +0 -12
  645. package/dist/chunk-d7vyc7k6.js.map +0 -10
  646. package/dist/chunk-de5sfbc3.js +0 -3
  647. package/dist/chunk-f05994as.js.map +0 -10
  648. package/dist/chunk-gfdh9kqa.js.map +0 -11
  649. package/dist/chunk-jt012fxq.js.map +0 -34
  650. package/dist/chunk-mbwsgjn7.js.map +0 -11
  651. package/dist/chunk-nxysqbt0.js.map +0 -10
  652. package/dist/chunk-qttqe1ah.js.map +0 -24
  653. package/dist/chunk-sgx82nnt.js.map +0 -10
  654. package/dist/chunk-vs2s3p8n.js +0 -2274
  655. package/dist/chunk-vs2s3p8n.js.map +0 -20
  656. package/dist/chunk-wkv3h3q7.js.map +0 -12
  657. package/dist/chunk-wzcjhv54.js.map +0 -11
  658. package/dist/chunk-xtztwpkh.js.map +0 -12
  659. package/dist/chunk-ym1bqd98.js.map +0 -19
  660. /package/dist/{chunk-7mhbs9yy.js.map → chunk-1z8ccj53.js.map} +0 -0
  661. /package/dist/{chunk-dmnd9ea6.js.map → chunk-30a0ftnm.js.map} +0 -0
  662. /package/dist/{chunk-qbd282aa.js.map → chunk-39q9ybav.js.map} +0 -0
  663. /package/dist/{chunk-bcz9dxtf.js.map → chunk-3x902cja.js.map} +0 -0
  664. /package/dist/{chunk-c4nrycdy.js.map → chunk-4q4a5a96.js.map} +0 -0
  665. /package/dist/{chunk-ykchk644.js.map → chunk-4w8qzy9w.js.map} +0 -0
  666. /package/dist/{chunk-kft7mp7z.js.map → chunk-5xkqasvn.js.map} +0 -0
  667. /package/dist/{chunk-xavet0qs.js.map → chunk-6whr25gw.js.map} +0 -0
  668. /package/dist/{chunk-ygvay56w.js.map → chunk-896te58g.js.map} +0 -0
  669. /package/dist/{chunk-pqj8vff9.js.map → chunk-8eqqqc1h.js.map} +0 -0
  670. /package/dist/{chunk-jka26v8c.js.map → chunk-8x1bsp68.js.map} +0 -0
  671. /package/dist/{chunk-fmgf9h5e.js.map → chunk-9az7kjv4.js.map} +0 -0
  672. /package/dist/{chunk-bs1sd0e0.js.map → chunk-9p7kyeqz.js.map} +0 -0
  673. /package/dist/{chunk-brybqw5k.js.map → chunk-bkxm2dzx.js.map} +0 -0
  674. /package/dist/{chunk-ppxf7gw2.js.map → chunk-d7t9jnym.js.map} +0 -0
  675. /package/dist/{chunk-cg7cygfj.js.map → chunk-fdmvaz7x.js.map} +0 -0
  676. /package/dist/{chunk-191jz8a6.js.map → chunk-ff0qdk7z.js.map} +0 -0
  677. /package/dist/{chunk-wx7smkn2.js.map → chunk-fq8drkp0.js.map} +0 -0
  678. /package/dist/{chunk-v8a1qjzp.js.map → chunk-hpswfrjj.js.map} +0 -0
  679. /package/dist/{chunk-bz5bnjjt.js.map → chunk-jjte0h4p.js.map} +0 -0
  680. /package/dist/{chunk-xrmbhap8.js.map → chunk-mwg0nwkb.js.map} +0 -0
  681. /package/dist/{chunk-a3faa34j.js.map → chunk-nfjt8k8j.js.map} +0 -0
  682. /package/dist/{chunk-394zjzjs.js.map → chunk-nhgqz3g3.js.map} +0 -0
  683. /package/dist/{chunk-92wrka15.js.map → chunk-q150fnj9.js.map} +0 -0
  684. /package/dist/{chunk-w3t94hm6.js.map → chunk-qk3zq25v.js.map} +0 -0
  685. /package/dist/{chunk-6hfbz4d0.js.map → chunk-r588h4ev.js.map} +0 -0
  686. /package/dist/{chunk-5qqmndhm.js.map → chunk-szzhrn3e.js.map} +0 -0
  687. /package/dist/{chunk-n1hbwc6y.js.map → chunk-t6pfch4e.js.map} +0 -0
  688. /package/dist/{chunk-brhp9d97.js.map → chunk-vmqjndb3.js.map} +0 -0
  689. /package/dist/{chunk-5sswe5ej.js.map → chunk-wsv23wvr.js.map} +0 -0
  690. /package/dist/{chunk-90nqenq8.js.map → chunk-x0hqc54n.js.map} +0 -0
  691. /package/dist/{chunk-3neam1y5.js.map → chunk-y3qb965a.js.map} +0 -0
@@ -10,11 +10,11 @@ import { readLiveFiles } from "./files"
10
10
  // the same history, so their changes merge as Yjs merges concurrent edits.
11
11
 
12
12
  /**
13
- * Whether an artifact is edited live, and so keeps its content as a document: a canvas, and a
14
- * document, Markdown or designed, which people edit in place.
13
+ * Whether an artifact is edited live, and so keeps its content as a document: a canvas, a
14
+ * document, Markdown or designed, which people edit in place, and a video, cut on its timeline.
15
15
  */
16
16
  export function keepsDocument(kind: ArtifactKind): boolean {
17
- return kind === "canvas" || kind === "document"
17
+ return kind === "canvas" || kind === "document" || kind === "video"
18
18
  }
19
19
 
20
20
  /**
@@ -0,0 +1,75 @@
1
+ # What is derived of a media
2
+
3
+ A video or a sound of any artifact version gets a probe, a proxy, a poster, a filmstrip, its peaks,
4
+ its cuts and its transcript, once for every file that holds the same bytes. They are kept under the
5
+ digest of the original (`ArtifactStorage.listMedia` / `putMedia`), so no artifact owns them and
6
+ deleting one keeps them.
7
+
8
+ ```text
9
+ publish (create, update, restore, the Agent's publish)
10
+ → requestArtifactMedia: one artifact.media.requested job per digest with nothing kept,
11
+ refreshArtifactMedia for one kept; a video's own media and those it plays from other artifacts
12
+ render worker (packages/render-worker/src/media.ts)
13
+ → putMedia: the attempt, counted before it starts
14
+ → sandbox: fetch the original by download URL, derive.cjs probes it
15
+ → putMedia: the probe, which gives the rest its time (mediaJobBudget)
16
+ → derive.cjs derives each part with FFmpeg
17
+ → putMedia: every part as it stands, the transcript pending
18
+ → MediaTranscriber: the project's transcription model, as a kernel operation
19
+ → putMedia: the transcript
20
+ readers
21
+ → sixb.artifacts.media(): read through the artifact, as the caller reads it
22
+ → GET …/versions/:v/media and …/media/content: each part's file, with Range; a run's
23
+ `sixb artifacts media` reads them
24
+ → the Agent's sandbox: a video's copy lists each part of its recordings, and holds their
25
+ transcripts and cuts (packages/agent/src/artifacts/materialize.ts)
26
+ ```
27
+
28
+ ## Invariants
29
+
30
+ - One job id per digest (`mediaJobId`), enqueued with `replace`: asking while a job waits takes
31
+ its place, asking while one runs waits behind it, and that one finds nothing left to derive.
32
+ - A job derives only the parts still `pending` in what is kept, so an attempt cut short between its
33
+ writes transcribes without deriving the proxy again. It keeps only the parts it made, over what
34
+ is kept by then: a part a retry made pending while it ran stays so for the job behind it.
35
+ - `attempts` counts the attempts since the media was last asked for, in what is kept, not in the
36
+ job: a job asked for again keeps counting, and one asked for past `MEDIA_JOB.attempts` fails what
37
+ is pending without deriving. Then what was derived stays.
38
+ - Each attempt has the time `mediaJobBudget` gives the probe: the proxy by the pixels it decodes,
39
+ twice for HEVC, ProRes, AV1 or VP9, every other part by the media's length, at most
40
+ `MEDIA_JOB.maxTimeoutMs`. Before the probe, the most.
41
+ - A job lost with its queue: nothing is written for longer than an attempt and its backoff take
42
+ (`isMediaLost`), so the next publish or read asks for it again, its attempts kept.
43
+ - A part that fails is kept `failed` with a reason a reader can hear; FFmpeg's own words go to the
44
+ logs. `unavailable` is no failure. Without `lacks`, the media is why: a sound has no poster, a
45
+ sound browsers play needs no proxy, the media is longer than `MAX_MEDIA_DURATION_MS`, or its
46
+ sound is longer than the model takes. With `lacks`, the project is why: no sandboxes, no FFmpeg
47
+ or Node.js in them, no transcription model.
48
+ - `media({ retry: true })` (`retryArtifactMedia`) makes each failed part, and each the project
49
+ lacked something for, pending again, counts the attempts from 0, and asks for the job. A
50
+ transcript that lacked a model is asked for on its own at the next publish or read once the
51
+ project has one; a sandbox's tools cannot be known without a sandbox, so they wait for a retry.
52
+
53
+ ## Proxies in frames
54
+
55
+ Frames serve each file as its version holds it: a deck's or a page's clip plays its original,
56
+ whatever is derived of it. A video's frame plays proxies, through `mediaProxyReference` and
57
+ `requestedMediaProxy` (`media.ts`). The first names a ready proxy as the file's path with
58
+ `?sixb-proxy=<the proxy's digest>`: `rewriteVideoProxies` (`frames/assets.ts`) adds that query to
59
+ each recording a video's HTML file plays, its scenes' included. The second reads that name back on
60
+ the frame's request (`server/src/routes/artifact-frames.ts`). The original's address always serves
61
+ the original, so a page that loaded it keeps the bytes it loaded, and a page opened once the proxy
62
+ is ready plays the proxy. A name that is not the ready proxy's is a 404, never other bytes.
63
+
64
+ A recording a video plays from another artifact (`artifact:<id>/clip.mov`) plays its proxy the
65
+ same way, at the path the frame lends it under (`__sixb/ref/…`), and only where its original is
66
+ served: the reader's frame was issued a target for it. Publishing the video asks for what is
67
+ derived of it, as its author reads it, in case the version holding it predates media or its job
68
+ was lost. Media are a project's, so the project pays, as for its own.
69
+
70
+ ## Who pays for the transcript
71
+
72
+ Nobody asked for it but the project, and the same bytes are transcribed once for every artifact
73
+ that holds them, so it runs as the kernel operation `artifacts.transcribeMedia` (`transcriber.ts`):
74
+ one execution per digest, with no requester, on the project's model budget, recorded like any
75
+ model call. Its accounting reads `requesterGroupIds: []`, so no one person's limits apply.
@@ -0,0 +1,316 @@
1
+ import { inferFileMediaType } from "../../blob-storage/media-type"
2
+ import type { FileRef } from "../../blob-storage/types"
3
+ import type { Queue, RenderQueueJob } from "../../queues"
4
+ import type {
5
+ ArtifactFile,
6
+ ArtifactMediaPart,
7
+ ArtifactMediaPartName,
8
+ ArtifactMediaParts,
9
+ ArtifactMediaProbe,
10
+ ArtifactMediaRecord,
11
+ ArtifactStorage,
12
+ ArtifactVersionRecord,
13
+ } from "../../storage/artifacts/types"
14
+
15
+ // What Sixb derives from a video or a sound of any artifact version, once: what it holds, a proxy,
16
+ // a poster, a filmstrip, its peaks, its cuts and its transcript, kept under the digest of its
17
+ // bytes. See README.md beside this file.
18
+
19
+ /**
20
+ * How the render worker derives a media: up to `attempts` since it was last asked for, counted in
21
+ * what is kept, `backoffMs` apart, each within the time {@link mediaJobBudget} gives the media,
22
+ * never past `maxTimeoutMs`.
23
+ */
24
+ export const MEDIA_JOB = {
25
+ maxTimeoutMs: 2 * 60 * 60_000,
26
+ attempts: 3,
27
+ backoffMs: 30_000,
28
+ } as const
29
+
30
+ /** The longest media Sixb derives anything from but what it holds. */
31
+ export const MAX_MEDIA_DURATION_MS = 30 * 60_000
32
+
33
+ /** Before the probe: a sandbox opens, the original arrives in it, and ffprobe reads it. */
34
+ const PREPARE_MS = 15 * 60_000
35
+ /** The transcription model's call, outside the sandbox. */
36
+ const TRANSCRIBE_MS = 5 * 60_000
37
+ /** The pixels a second that `PROXY_SHARE` encodes in: 1080p at 30 frames a second. */
38
+ const PROXY_REFERENCE = 1920 * 1080 * 30
39
+ /** Of a 1080p30 media's length, how long its proxy may take, with FFmpeg's `veryfast` preset. */
40
+ const PROXY_SHARE = 0.4
41
+ /** Codecs that decode several times slower than H.264. */
42
+ const SLOW_CODECS = new Set(["hevc", "prores", "av1", "vp9"])
43
+
44
+ /** The time one attempt has: `timeoutMs` in all, of which the proxy and the sandbox's script. */
45
+ export interface MediaJobBudget {
46
+ readonly timeoutMs: number
47
+ /** The script, every part in turn: the proxy, then what derive.cjs bounds by the length. */
48
+ readonly deriveMs: number
49
+ readonly proxyMs: number
50
+ readonly transcribeMs: number
51
+ }
52
+
53
+ /**
54
+ * The time a media takes to derive, by what it holds: its proxy by the pixels it decodes, every
55
+ * other part by its length. Before it is probed, the most any media has.
56
+ */
57
+ export function mediaJobBudget(probe: ArtifactMediaProbe | undefined): MediaJobBudget {
58
+ if (!probe) {
59
+ const deriveMs = MEDIA_JOB.maxTimeoutMs - PREPARE_MS - TRANSCRIBE_MS
60
+ return {
61
+ timeoutMs: MEDIA_JOB.maxTimeoutMs,
62
+ deriveMs,
63
+ proxyMs: deriveMs,
64
+ transcribeMs: TRANSCRIBE_MS,
65
+ }
66
+ }
67
+
68
+ const durationMs = Math.min(probe.durationMs, MAX_MEDIA_DURATION_MS)
69
+ const { video } = probe
70
+ const rate = video
71
+ ? (video.width * video.height * Math.min(video.fps ?? 30, 60)) / PROXY_REFERENCE
72
+ : 0
73
+ const slow = video && SLOW_CODECS.has(video.codec) ? 2 : 1
74
+ const proxyMs = Math.round(2 * 60_000 + durationMs * Math.max(0.2, PROXY_SHARE * rate) * slow)
75
+ // As derive.cjs bounds them: a poster in a few looks, then the filmstrip, cuts, peaks and sound.
76
+ const restMs = 8 * 60_000 + durationMs * 1.1
77
+ const deriveMs = Math.round(proxyMs + restMs)
78
+
79
+ const timeoutMs = Math.min(MEDIA_JOB.maxTimeoutMs, PREPARE_MS + deriveMs + TRANSCRIBE_MS)
80
+ return { timeoutMs, deriveMs, proxyMs, transcribeMs: TRANSCRIBE_MS }
81
+ }
82
+
83
+ /**
84
+ * Whether what is pending of a media will not come: no write for longer than an attempt and its
85
+ * backoff take, as the job asked for it was lost with its queue. Asked for again, its job counts
86
+ * the attempts already made.
87
+ */
88
+ export function isMediaLost(media: ArtifactMediaRecord, now: Date): boolean {
89
+ if (!MEDIA_PARTS.some((name) => media.parts[name].status === "pending")) return false
90
+
91
+ const { probe } = media.parts
92
+ const { timeoutMs } = mediaJobBudget(probe.status === "ready" ? probe : undefined)
93
+ return now.getTime() - media.updatedAt.getTime() > timeoutMs + MEDIA_JOB.backoffMs + 60_000
94
+ }
95
+
96
+ /** Every part, in the order the worker makes them. */
97
+ export const MEDIA_PARTS: readonly ArtifactMediaPartName[] = [
98
+ "probe",
99
+ "proxy",
100
+ "poster",
101
+ "filmstrip",
102
+ "waveform",
103
+ "cuts",
104
+ "transcript",
105
+ ]
106
+
107
+ /** A video or a sound, by its type, or by its name for a file stored without one. */
108
+ export function isMediaFile(file: ArtifactFile): boolean {
109
+ const type = file.file.mediaType ?? inferFileMediaType(file.path)
110
+ return type.startsWith("video/") || type.startsWith("audio/")
111
+ }
112
+
113
+ /** One job per media, by its bytes. */
114
+ export function mediaJobId(digest: string): string {
115
+ return `art_media_${digest.replace(/^sha256:/, "")}`
116
+ }
117
+
118
+ /** Every part, none made yet: each pending, or saying why it will not come, as `part` says. */
119
+ export function unmadeMediaParts(
120
+ part: (name: ArtifactMediaPartName) => ArtifactMediaPart<never>
121
+ ): ArtifactMediaParts {
122
+ return {
123
+ probe: part("probe"),
124
+ proxy: part("proxy"),
125
+ poster: part("poster"),
126
+ filmstrip: part("filmstrip"),
127
+ waveform: part("waveform"),
128
+ cuts: part("cuts"),
129
+ transcript: part("transcript"),
130
+ }
131
+ }
132
+
133
+ /** Each part as `map` makes it of what is kept. */
134
+ export function mapMediaParts(
135
+ parts: ArtifactMediaParts,
136
+ map: <T extends object>(part: ArtifactMediaPart<T>) => ArtifactMediaPart<T>
137
+ ): ArtifactMediaParts {
138
+ return {
139
+ probe: map(parts.probe),
140
+ proxy: map(parts.proxy),
141
+ poster: map(parts.poster),
142
+ filmstrip: map(parts.filmstrip),
143
+ waveform: map(parts.waveform),
144
+ cuts: map(parts.cuts),
145
+ transcript: map(parts.transcript),
146
+ }
147
+ }
148
+
149
+ /** What reads and asks for what is derived of a project's media. */
150
+ export interface MediaContext {
151
+ readonly storage: Pick<ArtifactStorage, "listMedia" | "putMedia">
152
+ readonly queue: Pick<Queue<RenderQueueJob>, "enqueue">
153
+ /** The project has a transcription model now. */
154
+ readonly transcribes: boolean
155
+ }
156
+
157
+ /**
158
+ * Asks the render worker to derive each video and sound of a stored version that nothing has been
159
+ * derived from yet, in one job per digest: a file published again, in this version or any other,
160
+ * asks for nothing once its derivatives are kept. Until then, asking again takes the place of the
161
+ * job still waiting, or waits for the one running, which then finds nothing left to derive. A
162
+ * media kept is asked for again as {@link refreshArtifactMedia} says.
163
+ *
164
+ * The version exists by now and what is derived from it is not, so a request that fails is
165
+ * reported, not thrown: the publish succeeded, and the file plays as it is.
166
+ */
167
+ export async function requestArtifactMedia(
168
+ context: MediaContext,
169
+ version: Pick<ArtifactVersionRecord, "projectId" | "artifactId" | "version" | "files">
170
+ ): Promise<void> {
171
+ const media = new Map<string, FileRef>()
172
+ for (const file of version.files) {
173
+ if (isMediaFile(file)) media.set(file.file.digest, file.file)
174
+ }
175
+ if (media.size === 0) return
176
+
177
+ try {
178
+ const kept = await context.storage.listMedia({
179
+ projectId: version.projectId,
180
+ digests: [...media.keys()],
181
+ })
182
+ for (const each of kept) {
183
+ const file = media.get(each.digest)
184
+ media.delete(each.digest)
185
+ if (file) await refreshArtifactMedia(context, each, file)
186
+ }
187
+ await enqueueMedia(context.queue, version.projectId, [...media.values()])
188
+ } catch (error) {
189
+ console.error(
190
+ `[Sixb] Could not ask for what is derived of the media in version ${version.version} of '${version.artifactId}'; they play as they are.`,
191
+ error
192
+ )
193
+ }
194
+ }
195
+
196
+ /**
197
+ * Asks again for what is kept of a media when it is due, and returns its parts as they stand:
198
+ *
199
+ * - a transcript that waited for a transcription model, once the project has one, is pending
200
+ * again, as a new ask whose attempts start over;
201
+ * - what is pending of a media whose job was lost ({@link isMediaLost}) is asked for again as it
202
+ * stands, its attempts kept, so a media that keeps failing still stops.
203
+ */
204
+ export async function refreshArtifactMedia(
205
+ context: MediaContext,
206
+ media: ArtifactMediaRecord,
207
+ file: FileRef
208
+ ): Promise<ArtifactMediaParts> {
209
+ const { transcript } = media.parts
210
+ if (
211
+ context.transcribes &&
212
+ transcript.status === "unavailable" &&
213
+ transcript.lacks === "transcription_model"
214
+ ) {
215
+ const parts = { ...media.parts, transcript: { status: "pending" } as const }
216
+ await context.storage.putMedia({ ...media, parts, attempts: 0, updatedAt: new Date() })
217
+ await enqueueMedia(context.queue, media.projectId, [file])
218
+ return parts
219
+ }
220
+
221
+ if (isMediaLost(media, new Date())) await enqueueMedia(context.queue, media.projectId, [file])
222
+ return media.parts
223
+ }
224
+
225
+ /**
226
+ * Asks again for what failed of a media, and for what the project lacked to make it: each is
227
+ * pending again, as a new ask whose attempts start over, and the render worker derives what is
228
+ * pending, as it does after an attempt cut short. What is ready, or unavailable for what the media
229
+ * is, stays. Returns the parts as they stand now: as they were when nothing is to be asked for.
230
+ */
231
+ export async function retryArtifactMedia(
232
+ context: Pick<MediaContext, "storage" | "queue">,
233
+ media: ArtifactMediaRecord,
234
+ file: FileRef
235
+ ): Promise<ArtifactMediaParts> {
236
+ const parts = mapMediaParts(media.parts, (part) =>
237
+ part.status === "failed" || (part.status === "unavailable" && part.lacks)
238
+ ? { status: "pending" }
239
+ : part
240
+ )
241
+ if (MEDIA_PARTS.every((name) => parts[name].status !== "pending")) return media.parts
242
+
243
+ await context.storage.putMedia({ ...media, parts, attempts: 0, updatedAt: new Date() })
244
+ await enqueueMedia(context.queue, media.projectId, [file])
245
+ return parts
246
+ }
247
+
248
+ /**
249
+ * The query a frame names a media's proxy by: the proxy's own digest, so the original's address
250
+ * keeps serving the original. A page that loaded one keeps the bytes it loaded, and one opened once
251
+ * the proxy is ready plays the proxy.
252
+ */
253
+ export const MEDIA_PROXY_PARAM = "sixb-proxy"
254
+
255
+ /**
256
+ * Where a frame loads `file`'s proxy once it is ready, as a reference relative to the frame's
257
+ * root: its path, naming the proxy's bytes. `null` until then: the frame loads the original.
258
+ */
259
+ export function mediaProxyReference(
260
+ file: ArtifactFile,
261
+ media: ArtifactMediaRecord | undefined
262
+ ): string | null {
263
+ const proxy = readyProxy(file, media)
264
+ if (!proxy) return null
265
+ return `${encodeURI(file.path)}?${MEDIA_PROXY_PARAM}=${proxyName(proxy)}`
266
+ }
267
+
268
+ /**
269
+ * The proxy a frame's request for `file` names, by {@link MEDIA_PROXY_PARAM}: `undefined` when it
270
+ * names none, so the frame serves the original; `null` when it names one that is not this media's
271
+ * ready proxy, which the frame answers 404, never with other bytes under that address.
272
+ */
273
+ export function requestedMediaProxy(
274
+ file: ArtifactFile,
275
+ media: ArtifactMediaRecord | undefined,
276
+ search: URLSearchParams
277
+ ): FileRef | null | undefined {
278
+ const named = search.get(MEDIA_PROXY_PARAM)
279
+ if (named === null) return undefined
280
+
281
+ const proxy = readyProxy(file, media)
282
+ return proxy && proxyName(proxy) === named ? proxy : null
283
+ }
284
+
285
+ function readyProxy(file: ArtifactFile, media: ArtifactMediaRecord | undefined): FileRef | null {
286
+ if (!media || media.digest !== file.file.digest) return null
287
+ const { proxy } = media.parts
288
+ return proxy.status === "ready" ? proxy.file : null
289
+ }
290
+
291
+ /** A proxy's bytes, as an address names them: the first 16 hex digits of its digest. */
292
+ function proxyName(proxy: FileRef): string {
293
+ return proxy.digest.replace(/^sha256:/, "").slice(0, 16)
294
+ }
295
+
296
+ /**
297
+ * One job per media, enqueued with `replace`: asking while a job waits takes its place, asking
298
+ * while one runs waits behind it.
299
+ */
300
+ async function enqueueMedia(
301
+ queue: Pick<Queue<RenderQueueJob>, "enqueue">,
302
+ projectId: string,
303
+ files: readonly FileRef[]
304
+ ): Promise<void> {
305
+ if (files.length === 0) return
306
+
307
+ await queue.enqueue({
308
+ projectId,
309
+ jobs: files.map((file) => ({
310
+ id: mediaJobId(file.digest),
311
+ replace: true,
312
+ type: "artifact.media.requested" as const,
313
+ payload: { file },
314
+ })),
315
+ })
316
+ }
@@ -0,0 +1,84 @@
1
+ import { createKernelRuntimeAuthorization } from "../../execution/authorization"
2
+ import { ensureExecutionRecord, executionRecordInputFromRuntime } from "../../execution/durable"
3
+ import type { ExecutionContext } from "../../execution/types"
4
+ import { createAudioRuntime } from "../../models/audio/runtime"
5
+ import type { AudioData, TranscriptionOutput } from "../../models/audio/types"
6
+ import type { ModelCatalog } from "../../models/catalog"
7
+ import { ModelExecutionSession } from "../../models/execution/session"
8
+ import type { SixbHostContext } from "../../runtime/types"
9
+
10
+ /**
11
+ * Transcribes a media's sound for what Sixb derives from it, with the project's transcription
12
+ * model. No one asked but the project, which derives it once for every file that holds the same
13
+ * bytes, so it runs as the kernel operation `artifacts.transcribeMedia`: on the project's model
14
+ * budget, under no one's own limits, recorded as any model call is.
15
+ */
16
+ export interface MediaTranscriber {
17
+ /** The project's transcription model, which takes audio up to `maxInputBytes`; null without. */
18
+ readonly model: { readonly maxInputBytes: number } | null
19
+ transcribe(input: {
20
+ /** The media's digest, which names the operation. */
21
+ readonly digest: string
22
+ /** The job that asked, which the operation's execution names as its source. */
23
+ readonly jobId: string
24
+ readonly attempt: number
25
+ readonly audio: AudioData
26
+ readonly signal: AbortSignal
27
+ }): Promise<TranscriptionOutput>
28
+ }
29
+
30
+ export function createMediaTranscriber(
31
+ context: SixbHostContext,
32
+ catalog: ModelCatalog | undefined
33
+ ): MediaTranscriber {
34
+ const model = catalog?.audio?.transcription?.default.model
35
+
36
+ return {
37
+ model: model ? { maxInputBytes: model.definition.maxInputBytes } : null,
38
+
39
+ async transcribe(input) {
40
+ const operation = { type: "artifacts.transcribeMedia", digest: input.digest } as const
41
+ const name = input.digest.replace(/^sha256:/, "")
42
+ // One execution per media, which each attempt records its calls under.
43
+ const execution: ExecutionContext = {
44
+ id: `exec_media_${name}`,
45
+ projectId: context.projectId,
46
+ executor: { type: "kernel", operation },
47
+ source: { type: "event", eventId: input.jobId },
48
+ correlationId: `media_${name}`,
49
+ }
50
+ const authorization = createKernelRuntimeAuthorization({ execution, operation })
51
+ await ensureExecutionRecord(context.storage.executions, {
52
+ ...executionRecordInputFromRuntime({ execution, runtimeAuthorization: authorization }),
53
+ requesterGroupIds: [],
54
+ })
55
+
56
+ const session = new ModelExecutionSession(
57
+ { ...context, runtimeAuthorization: authorization },
58
+ execution
59
+ )
60
+ session.bind({ attempt: input.attempt, signal: input.signal })
61
+ const audio = createAudioRuntime(
62
+ { projectId: context.projectId, runtimeAuthorization: authorization },
63
+ execution,
64
+ catalog,
65
+ session,
66
+ undefined
67
+ )
68
+
69
+ const result = await audio.transcribe({ audio: input.audio, signal: input.signal })
70
+ return result.output
71
+ },
72
+ }
73
+ }
74
+
75
+ const transcribers = new WeakMap<object, MediaTranscriber>()
76
+
77
+ export function registerMediaTranscriber(host: object, transcriber: MediaTranscriber): void {
78
+ transcribers.set(host, transcriber)
79
+ }
80
+
81
+ /** The transcriber a host registered: a render worker's host is the project's. */
82
+ export function findMediaTranscriber(host: object): MediaTranscriber | undefined {
83
+ return transcribers.get(host)
84
+ }
@@ -11,6 +11,7 @@ export type ArtifactOutline =
11
11
  | SlidesOutline
12
12
  | PageOutline
13
13
  | CanvasOutline
14
+ | VideoOutline
14
15
  | FileOutline
15
16
 
16
17
  export interface DocumentOutline {
@@ -97,6 +98,33 @@ export type CanvasOutlineItem =
97
98
  }
98
99
  | { readonly id: string; readonly type: "section"; readonly title?: string }
99
100
 
101
+ export interface VideoOutline {
102
+ readonly kind: "video"
103
+ /** The frame's size in pixels, and how many frames a second it plays. */
104
+ readonly width: number
105
+ readonly height: number
106
+ readonly fps: number
107
+ readonly durationMs: number
108
+ /** The instant that shows it before it plays, its root's `data-poster`, when it writes one. */
109
+ readonly posterMs?: number
110
+ /** Its scenes, the chapters a reader skips between, in the order they start. */
111
+ readonly scenes: readonly VideoOutlineScene[]
112
+ }
113
+
114
+ export interface VideoOutlineScene {
115
+ /** What `#part` names in an address to the scene. */
116
+ readonly id: string
117
+ /** Its host's `data-label`. */
118
+ readonly label?: string
119
+ readonly startMs: number
120
+ readonly durationMs: number
121
+ /**
122
+ * What the scene renders to, as a hash of everything it shows: a version that keeps a scene as
123
+ * it was keeps its key, and so its rendered segment.
124
+ */
125
+ readonly renderKey: string
126
+ }
127
+
100
128
  export interface FileOutline {
101
129
  readonly kind: "file"
102
130
  readonly mediaType: string
@@ -3,16 +3,18 @@ import type { BlobStorage } from "../../blob-storage/types"
3
3
  import { isValidFileRef } from "../../blob-storage/validation"
4
4
  import type { ArtifactFile } from "../../storage/artifacts/types"
5
5
  import { ArtifactRequestError } from "../errors"
6
- import { ARTIFACT_LIMITS } from "../limits"
6
+ import type { ArtifactKind } from "../kinds"
7
+ import { ARTIFACT_LIMITS, artifactSizeLimits } from "../limits"
7
8
 
8
9
  export type ArtifactBlobStorage = Pick<BlobStorage, "stat" | "open">
9
10
 
10
11
  /**
11
- * Checks a version's files before anything reads them: safe unique paths, the per-version limits,
12
+ * Checks a version's files before anything reads them: safe unique paths, the limits of its kind,
12
13
  * and stored bytes that match each reference.
13
14
  */
14
15
  export async function checkArtifactFiles(
15
16
  blobStorage: ArtifactBlobStorage,
17
+ kind: ArtifactKind,
16
18
  files: readonly ArtifactFile[]
17
19
  ): Promise<void> {
18
20
  if (files.length === 0) throw invalidArtifact("A version needs at least one file.")
@@ -22,6 +24,7 @@ export async function checkArtifactFiles(
22
24
  )
23
25
  }
24
26
 
27
+ const { maxFileBytes, maxVersionBytes } = artifactSizeLimits(kind)
25
28
  const paths = new Set<string>()
26
29
  let totalBytes = 0
27
30
  for (const entry of files) {
@@ -35,16 +38,16 @@ export async function checkArtifactFiles(
35
38
  if (!isValidFileRef(entry.file)) {
36
39
  throw invalidArtifact(`'${entry.path}' does not have a valid file reference.`)
37
40
  }
38
- if (entry.file.sizeBytes > ARTIFACT_LIMITS.maxFileBytes) {
41
+ if (entry.file.sizeBytes > maxFileBytes) {
39
42
  throw invalidArtifact(
40
- `'${entry.path}' is ${entry.file.sizeBytes} bytes; a file may be at most ${ARTIFACT_LIMITS.maxFileBytes}.`
43
+ `'${entry.path}' is ${entry.file.sizeBytes} bytes; in a ${kind} artifact, a file may be at most ${maxFileBytes}.`
41
44
  )
42
45
  }
43
46
  totalBytes += entry.file.sizeBytes
44
47
  }
45
- if (totalBytes > ARTIFACT_LIMITS.maxVersionBytes) {
48
+ if (totalBytes > maxVersionBytes) {
46
49
  throw invalidArtifact(
47
- `The files total ${totalBytes} bytes; a version may hold at most ${ARTIFACT_LIMITS.maxVersionBytes}.`
50
+ `The files total ${totalBytes} bytes; a version of a ${kind} artifact may hold at most ${maxVersionBytes}.`
48
51
  )
49
52
  }
50
53
 
@@ -82,6 +85,16 @@ export function isArtifactPath(path: string): boolean {
82
85
  )
83
86
  }
84
87
 
88
+ /** A title as a file name: what one may not hold, and each run of spaces, one space. */
89
+ export function titleFileName(title: string, fallback: string): string {
90
+ const name = [...title]
91
+ .map((char) => (char < " " || '\\/:*?"<>|'.includes(char) ? " " : char))
92
+ .join("")
93
+ .replace(/\s+/g, " ")
94
+ .trim()
95
+ return name || fallback
96
+ }
97
+
85
98
  export function invalidArtifact(message: string): ArtifactRequestError {
86
99
  return new ArtifactRequestError("invalid_artifact", `[Sixb] ${message}`)
87
100
  }
@@ -1,14 +1,59 @@
1
1
  /**
2
2
  * Publishing for this repo's packages: the Agent publishes through the same checks as the API, and
3
- * the pictures of a canvas's boards are kept beside what it publishes.
3
+ * the pictures of a canvas's boards, and what is derived of a version's media, are kept beside
4
+ * what it publishes.
4
5
  */
5
6
 
6
7
  export { BOARD_PREVIEW_JOB } from "../canvas-display"
7
8
  export { artifactAccessRule, artifactQueryChecker } from "../execution"
8
9
  export { isArtifactId } from "../ids"
9
- export { ARTIFACT_LIMITS } from "../limits"
10
+ export { ARTIFACT_LIMITS, artifactSizeLimits } from "../limits"
11
+ export {
12
+ isMediaFile,
13
+ MAX_MEDIA_DURATION_MS,
14
+ MEDIA_JOB,
15
+ MEDIA_PARTS,
16
+ type MediaJobBudget,
17
+ mapMediaParts,
18
+ mediaJobBudget,
19
+ unmadeMediaParts,
20
+ } from "../media/media"
10
21
  export { artifactQueryName, DOCUMENT_HOLDER_QUERY } from "../queries"
11
22
  export { artifactThemeModes } from "../theme"
23
+ export { VIDEO_ENTRY, videoFilesPlayed } from "../video/composition"
24
+ export {
25
+ resolveVideoMedia,
26
+ VIDEO_ENGINE,
27
+ VIDEO_EXPORT_JOB,
28
+ VIDEO_SEGMENT_JOB,
29
+ VIDEO_SEGMENT_SETTINGS,
30
+ type VideoExportPlan,
31
+ type VideoMediaFile,
32
+ type VideoSegment,
33
+ videoExportJobId,
34
+ videoExportKeys,
35
+ videoExportPlan,
36
+ videoExportStatus,
37
+ videoSegmentJobId,
38
+ videoSegmentTimeoutMs,
39
+ } from "../video/export"
40
+ export {
41
+ frameAtOrBefore,
42
+ playTogether,
43
+ videoFrameCount,
44
+ videoSegmentIndex,
45
+ videoSegmentRender,
46
+ } from "../video/project"
47
+ export {
48
+ missingVideoStills,
49
+ VIDEO_STILL_WIDTH,
50
+ VIDEO_STILLS_JOB,
51
+ type VideoStill,
52
+ videoPoster,
53
+ videoSceneStills,
54
+ videoStills,
55
+ } from "../video/stills"
56
+ export { titleFileName } from "./files"
12
57
  export {
13
58
  DOCUMENT_PDF_JOB,
14
59
  documentPdfKey,
@@ -43,3 +88,5 @@ export {
43
88
  answerArtifactQueries,
44
89
  parseArtifactQueryAnswers,
45
90
  } from "./query-answers"
91
+ export { readVideoVersion, type VideoVersionRead } from "./validate/video"
92
+ export { videoSceneFiles, videoSoundProject } from "./video"
@@ -39,7 +39,9 @@ export function documentPdfKey(
39
39
  )
40
40
  .sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))
41
41
  return createHash("sha256")
42
- .update(JSON.stringify([RENDER_KEY_FORMAT, frameKitDigest(), version.artifactId, files]))
42
+ .update(
43
+ JSON.stringify([RENDER_KEY_FORMAT, frameKitDigest("document"), version.artifactId, files])
44
+ )
43
45
  .digest("hex")
44
46
  }
45
47