@sixb/core 0.2.7 → 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 (627) hide show
  1. package/dist/actions/index.js +52 -49
  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.js +57 -54
  23. package/dist/agents/index.js.map +1 -1
  24. package/dist/agents/model-call-retry.d.ts +28 -0
  25. package/dist/agents/model-call-retry.d.ts.map +1 -0
  26. package/dist/agents/model-loop.d.ts +4 -2
  27. package/dist/agents/model-loop.d.ts.map +1 -1
  28. package/dist/agents/run-artifacts.d.ts +2 -0
  29. package/dist/agents/run-artifacts.d.ts.map +1 -1
  30. package/dist/agents/run-plan.d.ts +1 -1
  31. package/dist/agents/run-plan.d.ts.map +1 -1
  32. package/dist/agents/run-session-http.d.ts.map +1 -1
  33. package/dist/agents/run-session-serve.d.ts.map +1 -1
  34. package/dist/agents/run-session-wire.d.ts +6 -0
  35. package/dist/agents/run-session-wire.d.ts.map +1 -1
  36. package/dist/agents/thread-access.d.ts +13 -0
  37. package/dist/agents/thread-access.d.ts.map +1 -1
  38. package/dist/agents/tool-files.d.ts.map +1 -1
  39. package/dist/artifacts/caller.d.ts +10 -0
  40. package/dist/artifacts/caller.d.ts.map +1 -0
  41. package/dist/artifacts/comment-place.d.ts +26 -0
  42. package/dist/artifacts/comment-place.d.ts.map +1 -0
  43. package/dist/artifacts/comment-text.d.ts +12 -4
  44. package/dist/artifacts/comment-text.d.ts.map +1 -1
  45. package/dist/artifacts/comments.d.ts +8 -2
  46. package/dist/artifacts/comments.d.ts.map +1 -1
  47. package/dist/artifacts/errors.d.ts +1 -1
  48. package/dist/artifacts/errors.d.ts.map +1 -1
  49. package/dist/artifacts/execution.d.ts +73 -5
  50. package/dist/artifacts/execution.d.ts.map +1 -1
  51. package/dist/artifacts/frames/assets.d.ts +27 -7
  52. package/dist/artifacts/frames/assets.d.ts.map +1 -1
  53. package/dist/artifacts/frames/entries.d.ts +5 -4
  54. package/dist/artifacts/frames/entries.d.ts.map +1 -1
  55. package/dist/artifacts/frames/hyperframes.d.ts +12 -0
  56. package/dist/artifacts/frames/hyperframes.d.ts.map +1 -0
  57. package/dist/artifacts/frames/index.d.ts +3 -1
  58. package/dist/artifacts/frames/index.d.ts.map +1 -1
  59. package/dist/artifacts/frames/index.js +20 -6
  60. package/dist/artifacts/frames/index.js.map +3 -3
  61. package/dist/artifacts/frames/kit.d.ts.map +1 -1
  62. package/dist/artifacts/frames/protocol.d.ts +33 -0
  63. package/dist/artifacts/frames/protocol.d.ts.map +1 -1
  64. package/dist/artifacts/frames/video-runtime.d.ts +21 -0
  65. package/dist/artifacts/frames/video-runtime.d.ts.map +1 -0
  66. package/dist/artifacts/html.d.ts +23 -0
  67. package/dist/artifacts/html.d.ts.map +1 -1
  68. package/dist/artifacts/index.d.ts +5 -3
  69. package/dist/artifacts/index.d.ts.map +1 -1
  70. package/dist/artifacts/index.js +71 -10
  71. package/dist/artifacts/index.js.map +4 -4
  72. package/dist/artifacts/kinds.d.ts +1 -1
  73. package/dist/artifacts/kinds.d.ts.map +1 -1
  74. package/dist/artifacts/limits.d.ts +37 -0
  75. package/dist/artifacts/limits.d.ts.map +1 -1
  76. package/dist/artifacts/live/document.d.ts.map +1 -1
  77. package/dist/artifacts/live/index.d.ts +6 -2
  78. package/dist/artifacts/live/index.d.ts.map +1 -1
  79. package/dist/artifacts/live/index.js +3432 -13
  80. package/dist/artifacts/live/index.js.map +6 -3
  81. package/dist/artifacts/live/presence.d.ts +7 -5
  82. package/dist/artifacts/live/presence.d.ts.map +1 -1
  83. package/dist/artifacts/live/protocol.d.ts +4 -2
  84. package/dist/artifacts/live/protocol.d.ts.map +1 -1
  85. package/dist/artifacts/live/server.d.ts +1 -1
  86. package/dist/artifacts/live/server.d.ts.map +1 -1
  87. package/dist/artifacts/live/server.js +36 -31
  88. package/dist/artifacts/live/server.js.map +1 -1
  89. package/dist/artifacts/live/state.d.ts +2 -2
  90. package/dist/artifacts/media/media.d.ts +96 -0
  91. package/dist/artifacts/media/media.d.ts.map +1 -0
  92. package/dist/artifacts/media/transcriber.d.ts +29 -0
  93. package/dist/artifacts/media/transcriber.d.ts.map +1 -0
  94. package/dist/artifacts/outline.d.ts +26 -1
  95. package/dist/artifacts/outline.d.ts.map +1 -1
  96. package/dist/artifacts/publish/files.d.ts +5 -2
  97. package/dist/artifacts/publish/files.d.ts.map +1 -1
  98. package/dist/artifacts/publish/index.d.ts +11 -2
  99. package/dist/artifacts/publish/index.d.ts.map +1 -1
  100. package/dist/artifacts/publish/index.js +110 -33
  101. package/dist/artifacts/publish/index.js.map +1 -1
  102. package/dist/artifacts/publish/pdf.d.ts.map +1 -1
  103. package/dist/artifacts/publish/previews.d.ts +7 -2
  104. package/dist/artifacts/publish/previews.d.ts.map +1 -1
  105. package/dist/artifacts/publish/publish.d.ts.map +1 -1
  106. package/dist/artifacts/publish/validate/html.d.ts +5 -4
  107. package/dist/artifacts/publish/validate/html.d.ts.map +1 -1
  108. package/dist/artifacts/publish/validate/video.d.ts +36 -0
  109. package/dist/artifacts/publish/validate/video.d.ts.map +1 -0
  110. package/dist/artifacts/publish/video.d.ts +79 -0
  111. package/dist/artifacts/publish/video.d.ts.map +1 -0
  112. package/dist/artifacts/resolve.d.ts +9 -0
  113. package/dist/artifacts/resolve.d.ts.map +1 -1
  114. package/dist/artifacts/video/composition.d.ts +183 -0
  115. package/dist/artifacts/video/composition.d.ts.map +1 -0
  116. package/dist/artifacts/video/edit.d.ts +298 -0
  117. package/dist/artifacts/video/edit.d.ts.map +1 -0
  118. package/dist/artifacts/video/export.d.ts +142 -0
  119. package/dist/artifacts/video/export.d.ts.map +1 -0
  120. package/dist/artifacts/video/looks.d.ts +133 -0
  121. package/dist/artifacts/video/looks.d.ts.map +1 -0
  122. package/dist/artifacts/video/project.d.ts +74 -0
  123. package/dist/artifacts/video/project.d.ts.map +1 -0
  124. package/dist/artifacts/video/stills.d.ts +65 -0
  125. package/dist/artifacts/video/stills.d.ts.map +1 -0
  126. package/dist/artifacts/video/timeline.d.ts +153 -0
  127. package/dist/artifacts/video/timeline.d.ts.map +1 -0
  128. package/dist/auth/index.js +9 -8
  129. package/dist/auth/index.js.map +1 -1
  130. package/dist/authorization/index.js +5 -4
  131. package/dist/authorization/index.js.map +1 -1
  132. package/dist/blob-storage/browser.d.ts +1 -1
  133. package/dist/blob-storage/browser.d.ts.map +1 -1
  134. package/dist/blob-storage/browser.js +8 -4
  135. package/dist/blob-storage/browser.js.map +1 -1
  136. package/dist/blob-storage/constants.d.ts +8 -3
  137. package/dist/blob-storage/constants.d.ts.map +1 -1
  138. package/dist/blob-storage/download-urls.d.ts +2 -2
  139. package/dist/blob-storage/download-urls.d.ts.map +1 -1
  140. package/dist/blob-storage/index.d.ts +1 -1
  141. package/dist/blob-storage/index.d.ts.map +1 -1
  142. package/dist/blob-storage/index.js +9 -5
  143. package/dist/blob-storage/index.js.map +1 -1
  144. package/dist/blob-storage/internal.d.ts +2 -2
  145. package/dist/blob-storage/internal.d.ts.map +1 -1
  146. package/dist/blob-storage/internal.js +10 -4
  147. package/dist/blob-storage/internal.js.map +1 -1
  148. package/dist/blob-storage/media-type.d.ts +12 -3
  149. package/dist/blob-storage/media-type.d.ts.map +1 -1
  150. package/dist/bootstrap/index.js +61 -58
  151. package/dist/bootstrap/index.js.map +2 -2
  152. package/dist/{chunk-az95tsh3.js → chunk-0fjryajn.js} +3 -2
  153. package/dist/chunk-0fjryajn.js.map +11 -0
  154. package/dist/{chunk-9tpmfh3n.js → chunk-0mk8qqp9.js} +3 -3
  155. package/dist/{chunk-9tpmfh3n.js.map → chunk-0mk8qqp9.js.map} +3 -3
  156. package/dist/{chunk-88xeh6zx.js → chunk-1g4me5f2.js} +182 -7
  157. package/dist/{chunk-88xeh6zx.js.map → chunk-1g4me5f2.js.map} +3 -3
  158. package/dist/{chunk-7mhbs9yy.js → chunk-1z8ccj53.js} +1 -1
  159. package/dist/{chunk-wkv3h3q7.js → chunk-2138b0ng.js} +115 -8
  160. package/dist/chunk-2138b0ng.js.map +12 -0
  161. package/dist/chunk-23eaayw4.js +3757 -0
  162. package/dist/chunk-23eaayw4.js.map +22 -0
  163. package/dist/{chunk-m1cwncee.js → chunk-2mxq1yd9.js} +45 -40
  164. package/dist/{chunk-m1cwncee.js.map → chunk-2mxq1yd9.js.map} +3 -3
  165. package/dist/{chunk-dmnd9ea6.js → chunk-30a0ftnm.js} +2 -2
  166. package/dist/chunk-389ybvw9.js.map +2 -2
  167. package/dist/{chunk-qbd282aa.js → chunk-39q9ybav.js} +2 -2
  168. package/dist/{chunk-06kpaqg4.js → chunk-3d9w8t4n.js} +110 -22
  169. package/dist/{chunk-06kpaqg4.js.map → chunk-3d9w8t4n.js.map} +5 -5
  170. package/dist/chunk-3dvcdn9w.js +8 -0
  171. package/dist/chunk-3dvcdn9w.js.map +10 -0
  172. package/dist/{chunk-fdk0ks9p.js → chunk-3x902cja.js} +3 -3
  173. package/dist/{chunk-c4nrycdy.js → chunk-4q4a5a96.js} +1 -1
  174. package/dist/{chunk-9cyq87qa.js → chunk-4tdm3fsj.js} +95 -32
  175. package/dist/{chunk-9cyq87qa.js.map → chunk-4tdm3fsj.js.map} +9 -9
  176. package/dist/{chunk-cpy282b8.js → chunk-4w8qzy9w.js} +6 -6
  177. package/dist/{chunk-c29729me.js → chunk-4z9xtxke.js} +8 -7
  178. package/dist/chunk-4z9xtxke.js.map +12 -0
  179. package/dist/chunk-5278qwax.js +270 -0
  180. package/dist/chunk-5278qwax.js.map +11 -0
  181. package/dist/{chunk-k1g14kk3.js → chunk-6a4hp405.js} +4 -5
  182. package/dist/{chunk-k1g14kk3.js.map → chunk-6a4hp405.js.map} +3 -3
  183. package/dist/{chunk-xavet0qs.js → chunk-6whr25gw.js} +2 -2
  184. package/dist/{chunk-mbwsgjn7.js → chunk-7zygtcqq.js} +14 -2
  185. package/dist/chunk-7zygtcqq.js.map +11 -0
  186. package/dist/chunk-88s9z5pf.js +3 -0
  187. package/dist/{chunk-de5sfbc3.js.map → chunk-88s9z5pf.js.map} +1 -1
  188. package/dist/{chunk-ygvay56w.js → chunk-896te58g.js} +2 -2
  189. package/dist/{chunk-pfdq1ga6.js → chunk-8eqqqc1h.js} +3 -3
  190. package/dist/{chunk-yyj009tv.js → chunk-8tefbhdx.js} +14 -14
  191. package/dist/{chunk-yyj009tv.js.map → chunk-8tefbhdx.js.map} +1 -1
  192. package/dist/{chunk-jka26v8c.js → chunk-8x1bsp68.js} +1 -1
  193. package/dist/{chunk-wzcjhv54.js → chunk-93e4w7te.js} +113 -1
  194. package/dist/chunk-93e4w7te.js.map +11 -0
  195. package/dist/{chunk-phs5fbff.js → chunk-990a5bkc.js} +424 -76
  196. package/dist/chunk-990a5bkc.js.map +21 -0
  197. package/dist/{chunk-6md802cc.js → chunk-9az7kjv4.js} +6 -6
  198. package/dist/{chunk-95ps0k5q.js → chunk-9e5t53z0.js} +1 -1
  199. package/dist/{chunk-js9e6487.js → chunk-9p7kyeqz.js} +4 -4
  200. package/dist/chunk-a68zz4r0.js +537 -0
  201. package/dist/chunk-a68zz4r0.js.map +11 -0
  202. package/dist/{chunk-d7vyc7k6.js → chunk-a700gjc8.js} +10 -2
  203. package/dist/chunk-a700gjc8.js.map +10 -0
  204. package/dist/{chunk-gfdh9kqa.js → chunk-a9qzjaz2.js} +2 -5
  205. package/dist/chunk-a9qzjaz2.js.map +10 -0
  206. package/dist/{chunk-8qmp9fpa.js → chunk-as94vcty.js} +619 -482
  207. package/dist/{chunk-8qmp9fpa.js.map → chunk-as94vcty.js.map} +19 -19
  208. package/dist/{chunk-brybqw5k.js → chunk-bkxm2dzx.js} +1 -1
  209. package/dist/{chunk-ppxf7gw2.js → chunk-d7t9jnym.js} +3 -3
  210. package/dist/{chunk-tapdssb5.js → chunk-e3b1r4d2.js} +8 -7
  211. package/dist/{chunk-tapdssb5.js.map → chunk-e3b1r4d2.js.map} +4 -4
  212. package/dist/{chunk-cg7cygfj.js → chunk-fdmvaz7x.js} +1 -1
  213. package/dist/{chunk-191jz8a6.js → chunk-ff0qdk7z.js} +1 -1
  214. package/dist/{chunk-9vsc919v.js → chunk-fgxvrxx4.js} +22 -2
  215. package/dist/chunk-fgxvrxx4.js.map +10 -0
  216. package/dist/{chunk-wx7smkn2.js → chunk-fq8drkp0.js} +1 -1
  217. package/dist/{chunk-60662fyv.js → chunk-fqms1a8c.js} +132 -4
  218. package/dist/{chunk-60662fyv.js.map → chunk-fqms1a8c.js.map} +8 -6
  219. package/dist/{chunk-v8a1qjzp.js → chunk-hpswfrjj.js} +1 -1
  220. package/dist/{chunk-qttqe1ah.js → chunk-jbg905hn.js} +80 -13
  221. package/dist/chunk-jbg905hn.js.map +25 -0
  222. package/dist/{chunk-bz5bnjjt.js → chunk-jjte0h4p.js} +1 -1
  223. package/dist/{chunk-hvq8xs66.js → chunk-jwjwvzj1.js} +797 -51
  224. package/dist/chunk-jwjwvzj1.js.map +38 -0
  225. package/dist/{chunk-k29rdc3h.js → chunk-k3vd2vyz.js} +6 -2
  226. package/dist/chunk-k3vd2vyz.js.map +10 -0
  227. package/dist/chunk-kcqpk9w1.js.map +2 -2
  228. package/dist/chunk-mvz89age.js.map +2 -2
  229. package/dist/{chunk-xrmbhap8.js → chunk-mwg0nwkb.js} +1 -1
  230. package/dist/{chunk-a3faa34j.js → chunk-nfjt8k8j.js} +1 -1
  231. package/dist/{chunk-394zjzjs.js → chunk-nhgqz3g3.js} +3 -3
  232. package/dist/{chunk-bqr703h4.js → chunk-p0c5kkhn.js} +23 -6
  233. package/dist/{chunk-bqr703h4.js.map → chunk-p0c5kkhn.js.map} +3 -3
  234. package/dist/{chunk-92wrka15.js → chunk-q150fnj9.js} +1 -1
  235. package/dist/{chunk-w3t94hm6.js → chunk-qk3zq25v.js} +1 -1
  236. package/dist/chunk-rtkqczbr.js.map +2 -2
  237. package/dist/{chunk-3qtk0070.js → chunk-ssqbrts1.js} +86 -9
  238. package/dist/chunk-ssqbrts1.js.map +14 -0
  239. package/dist/{chunk-5qqmndhm.js → chunk-szzhrn3e.js} +1 -1
  240. package/dist/{chunk-n1hbwc6y.js → chunk-t6pfch4e.js} +1 -1
  241. package/dist/{chunk-xtztwpkh.js → chunk-v6h4tc2v.js} +86 -5
  242. package/dist/chunk-v6h4tc2v.js.map +12 -0
  243. package/dist/{chunk-brhp9d97.js → chunk-vmqjndb3.js} +2 -2
  244. package/dist/chunk-vtjzwymr.js.map +2 -2
  245. package/dist/{chunk-fycac8e9.js → chunk-wpba6hhd.js} +10 -10
  246. package/dist/{chunk-fycac8e9.js.map → chunk-wpba6hhd.js.map} +1 -1
  247. package/dist/{chunk-t58sktr5.js → chunk-wrb1x1ss.js} +2 -2
  248. package/dist/{chunk-5sswe5ej.js → chunk-wsv23wvr.js} +2 -2
  249. package/dist/{chunk-04r2fdsd.js → chunk-x0hqc54n.js} +4 -4
  250. package/dist/{chunk-sgx82nnt.js → chunk-xg31er4p.js} +43 -4
  251. package/dist/chunk-xg31er4p.js.map +10 -0
  252. package/dist/{chunk-3neam1y5.js → chunk-y3qb965a.js} +2 -2
  253. package/dist/{chunk-5pz3htbe.js → chunk-y57eawng.js} +3 -3
  254. package/dist/{chunk-8ncg20rd.js → chunk-yah25st6.js} +5 -5
  255. package/dist/chunk-yah25st6.js.map +10 -0
  256. package/dist/{chunk-mrs7jy17.js → chunk-ywvxcmqj.js} +106 -13
  257. package/dist/{chunk-mrs7jy17.js.map → chunk-ywvxcmqj.js.map} +8 -7
  258. package/dist/{chunk-44hrfmbk.js → chunk-zmq9xc9s.js} +70 -31
  259. package/dist/{chunk-44hrfmbk.js.map → chunk-zmq9xc9s.js.map} +4 -3
  260. package/dist/datasets/write.js +8 -7
  261. package/dist/datasets/write.js.map +1 -1
  262. package/dist/errors/catalog.d.ts.map +1 -1
  263. package/dist/execution/agent.js +52 -49
  264. package/dist/execution/agent.js.map +1 -1
  265. package/dist/execution/kernel-operation.d.ts +1 -0
  266. package/dist/execution/kernel-operation.d.ts.map +1 -1
  267. package/dist/execution/primitive.js +52 -49
  268. package/dist/execution/primitive.js.map +1 -1
  269. package/dist/execution/request.js +53 -50
  270. package/dist/execution/request.js.map +2 -2
  271. package/dist/execution/types.d.ts +5 -0
  272. package/dist/execution/types.d.ts.map +1 -1
  273. package/dist/http/api-routes.d.ts.map +1 -1
  274. package/dist/http/index.js +1 -1
  275. package/dist/index.d.ts +5 -3
  276. package/dist/index.d.ts.map +1 -1
  277. package/dist/index.js +69 -65
  278. package/dist/index.js.map +1 -1
  279. package/dist/lake-storage/index.js +9 -8
  280. package/dist/lake-storage/index.js.map +1 -1
  281. package/dist/maintenance/index.js +9 -8
  282. package/dist/maintenance/index.js.map +2 -2
  283. package/dist/materializer/index.js +26 -24
  284. package/dist/materializer/index.js.map +1 -1
  285. package/dist/models/audio/runtime.d.ts +3 -1
  286. package/dist/models/audio/runtime.d.ts.map +1 -1
  287. package/dist/models/audio/speech.d.ts +2 -2
  288. package/dist/models/audio/speech.d.ts.map +1 -1
  289. package/dist/models/audio/types.d.ts +23 -3
  290. package/dist/models/audio/types.d.ts.map +1 -1
  291. package/dist/models/calls.d.ts +7 -0
  292. package/dist/models/calls.d.ts.map +1 -1
  293. package/dist/models/catalog.d.ts +5 -0
  294. package/dist/models/catalog.d.ts.map +1 -1
  295. package/dist/models/definitions.d.ts +3 -2
  296. package/dist/models/definitions.d.ts.map +1 -1
  297. package/dist/models/errors.d.ts +5 -3
  298. package/dist/models/errors.d.ts.map +1 -1
  299. package/dist/models/events.d.ts +2 -0
  300. package/dist/models/events.d.ts.map +1 -1
  301. package/dist/models/execution/index.d.ts +1 -0
  302. package/dist/models/execution/index.d.ts.map +1 -1
  303. package/dist/models/execution/index.js +33 -28
  304. package/dist/models/execution/index.js.map +1 -1
  305. package/dist/models/execution/model-call-limits.d.ts.map +1 -1
  306. package/dist/models/execution/model-call-recorder.d.ts +8 -0
  307. package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
  308. package/dist/models/execution/session.d.ts +12 -0
  309. package/dist/models/execution/session.d.ts.map +1 -1
  310. package/dist/models/execution/usage.d.ts.map +1 -1
  311. package/dist/models/execution.d.ts +1 -1
  312. package/dist/models/execution.d.ts.map +1 -1
  313. package/dist/models/generation-types.d.ts +2 -0
  314. package/dist/models/generation-types.d.ts.map +1 -1
  315. package/dist/models/index.d.ts +4 -2
  316. package/dist/models/index.d.ts.map +1 -1
  317. package/dist/models/index.js +2 -2
  318. package/dist/models/input-file.d.ts.map +1 -1
  319. package/dist/models/pricing.d.ts +2 -1
  320. package/dist/models/pricing.d.ts.map +1 -1
  321. package/dist/models/rate-card.d.ts +6 -0
  322. package/dist/models/rate-card.d.ts.map +1 -1
  323. package/dist/models/tools.d.ts +5 -0
  324. package/dist/models/tools.d.ts.map +1 -1
  325. package/dist/models/video/catalog.d.ts +13 -0
  326. package/dist/models/video/catalog.d.ts.map +1 -0
  327. package/dist/models/video/check.d.ts +76 -0
  328. package/dist/models/video/check.d.ts.map +1 -0
  329. package/dist/models/video/runtime.d.ts +21 -0
  330. package/dist/models/video/runtime.d.ts.map +1 -0
  331. package/dist/models/video/types.d.ts +188 -0
  332. package/dist/models/video/types.d.ts.map +1 -0
  333. package/dist/objects/execution.d.ts.map +1 -1
  334. package/dist/objects/index.js +52 -49
  335. package/dist/objects/index.js.map +1 -1
  336. package/dist/objects/query/index.js +25 -23
  337. package/dist/objects/query/index.js.map +1 -1
  338. package/dist/objects/sdk/object-set.d.ts.map +1 -1
  339. package/dist/ontology/index.js +4 -4
  340. package/dist/ontology/internal.js +4 -4
  341. package/dist/pipelines/index.js +28 -26
  342. package/dist/pipelines/index.js.map +1 -1
  343. package/dist/projections/internal.js +26 -24
  344. package/dist/projections/internal.js.map +1 -1
  345. package/dist/queues/index.d.ts +1 -1
  346. package/dist/queues/index.d.ts.map +1 -1
  347. package/dist/queues/types.d.ts +103 -6
  348. package/dist/queues/types.d.ts.map +1 -1
  349. package/dist/runtime/host.d.ts.map +1 -1
  350. package/dist/runtime/internal.d.ts +3 -1
  351. package/dist/runtime/internal.d.ts.map +1 -1
  352. package/dist/runtime/internal.js +49 -43
  353. package/dist/runtime/internal.js.map +2 -2
  354. package/dist/runtime/sixb.d.ts.map +1 -1
  355. package/dist/sandboxes/index.js +6 -6
  356. package/dist/security/public.d.ts +6 -4
  357. package/dist/security/public.d.ts.map +1 -1
  358. package/dist/security/public.js +5 -3
  359. package/dist/security/public.js.map +1 -1
  360. package/dist/shares/internal.js +25 -23
  361. package/dist/shares/internal.js.map +2 -2
  362. package/dist/storage/agents/in-memory.d.ts +2 -1
  363. package/dist/storage/agents/in-memory.d.ts.map +1 -1
  364. package/dist/storage/agents/index.d.ts +1 -1
  365. package/dist/storage/agents/index.d.ts.map +1 -1
  366. package/dist/storage/agents/provider.js +4 -4
  367. package/dist/storage/agents/types.d.ts +13 -0
  368. package/dist/storage/agents/types.d.ts.map +1 -1
  369. package/dist/storage/ai-cost/analytics.d.ts +1 -0
  370. package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
  371. package/dist/storage/ai-cost/groups.d.ts +2 -0
  372. package/dist/storage/ai-cost/groups.d.ts.map +1 -1
  373. package/dist/storage/ai-cost/provider.js +5 -5
  374. package/dist/storage/ai-cost/types.d.ts +2 -1
  375. package/dist/storage/ai-cost/types.d.ts.map +1 -1
  376. package/dist/storage/ai-cost/validation.d.ts.map +1 -1
  377. package/dist/storage/ai-limits/enforcement.js +3 -3
  378. package/dist/storage/ai-limits/provider.js +2 -2
  379. package/dist/storage/ai-usage/in-memory.d.ts +8 -1
  380. package/dist/storage/ai-usage/in-memory.d.ts.map +1 -1
  381. package/dist/storage/ai-usage/index.d.ts +2 -2
  382. package/dist/storage/ai-usage/index.d.ts.map +1 -1
  383. package/dist/storage/ai-usage/record.d.ts +11 -1
  384. package/dist/storage/ai-usage/record.d.ts.map +1 -1
  385. package/dist/storage/ai-usage/types.d.ts +80 -1
  386. package/dist/storage/ai-usage/types.d.ts.map +1 -1
  387. package/dist/storage/ai-usage/usage.d.ts +1 -1
  388. package/dist/storage/ai-usage/usage.d.ts.map +1 -1
  389. package/dist/storage/artifacts/in-memory.d.ts +25 -2
  390. package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
  391. package/dist/storage/artifacts/index.d.ts +1 -1
  392. package/dist/storage/artifacts/index.d.ts.map +1 -1
  393. package/dist/storage/artifacts/record.d.ts +12 -1
  394. package/dist/storage/artifacts/record.d.ts.map +1 -1
  395. package/dist/storage/artifacts/types.d.ts +198 -6
  396. package/dist/storage/artifacts/types.d.ts.map +1 -1
  397. package/dist/storage/executions/provider.js +3 -2
  398. package/dist/storage/executions/provider.js.map +1 -1
  399. package/dist/storage/file-upload-sessions/provider.js +10 -9
  400. package/dist/storage/file-upload-sessions/provider.js.map +1 -1
  401. package/dist/storage/in-memory/index.d.ts.map +1 -1
  402. package/dist/storage/index.d.ts +4 -4
  403. package/dist/storage/index.d.ts.map +1 -1
  404. package/dist/storage/index.js +24 -22
  405. package/dist/storage/index.js.map +1 -1
  406. package/dist/storage/internal.d.ts +2 -2
  407. package/dist/storage/internal.d.ts.map +1 -1
  408. package/dist/storage/internal.js +34 -14
  409. package/dist/storage/internal.js.map +2 -2
  410. package/dist/storage/workflow-runs/provider.js +10 -9
  411. package/dist/storage/workflow-runs/provider.js.map +1 -1
  412. package/dist/syncs/index.js +29 -27
  413. package/dist/syncs/index.js.map +1 -1
  414. package/dist/testing/agent-storage-contract.d.ts.map +1 -1
  415. package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
  416. package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
  417. package/dist/testing/artifact-storage-contract.d.ts +3 -0
  418. package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
  419. package/dist/testing/execution-storage-contract.d.ts.map +1 -1
  420. package/dist/testing/index.js +619 -72
  421. package/dist/testing/index.js.map +9 -9
  422. package/dist/testing/lake-storage-contract.d.ts.map +1 -1
  423. package/dist/testing/queues-contract.d.ts.map +1 -1
  424. package/dist/webhooks/internal.js +26 -24
  425. package/dist/webhooks/internal.js.map +2 -2
  426. package/dist/workers/index.js +5 -5
  427. package/dist/workers/index.js.map +1 -1
  428. package/dist/workflows/index.js +58 -55
  429. package/dist/workflows/index.js.map +1 -1
  430. package/package.json +3 -1
  431. package/src/actions/request.ts +2 -0
  432. package/src/actions/run/context.ts +1 -0
  433. package/src/actions/run/execute.ts +5 -1
  434. package/src/actions/run/executor.ts +4 -0
  435. package/src/actions/run/normalize.ts +4 -0
  436. package/src/actions/run/types.ts +6 -0
  437. package/src/actions/types/context.ts +7 -0
  438. package/src/agents/README.md +3 -1
  439. package/src/agents/context/entries.ts +63 -9
  440. package/src/agents/context-model.ts +9 -0
  441. package/src/agents/context-resolution.ts +7 -0
  442. package/src/agents/execution.ts +39 -0
  443. package/src/agents/model-call-retry.ts +69 -0
  444. package/src/agents/model-loop.ts +86 -12
  445. package/src/agents/run-artifacts.ts +10 -5
  446. package/src/agents/run-plan.ts +2 -1
  447. package/src/agents/run-session-http.ts +1 -0
  448. package/src/agents/run-session-serve.ts +23 -2
  449. package/src/agents/run-session-wire.ts +45 -0
  450. package/src/agents/thread-access.ts +34 -1
  451. package/src/agents/tool-files.ts +23 -7
  452. package/src/artifacts/caller.ts +42 -0
  453. package/src/artifacts/comment-place.ts +51 -0
  454. package/src/artifacts/comment-text.ts +50 -7
  455. package/src/artifacts/comments.ts +132 -34
  456. package/src/artifacts/errors.ts +1 -0
  457. package/src/artifacts/execution.ts +249 -5
  458. package/src/artifacts/frames/assets.ts +93 -15
  459. package/src/artifacts/frames/entries.ts +7 -4
  460. package/src/artifacts/frames/generated/hyperframes-notices.txt +290 -0
  461. package/src/artifacts/frames/generated/hyperframes.txt +1145 -0
  462. package/src/artifacts/frames/generated.d.ts +5 -0
  463. package/src/artifacts/frames/hyperframes.ts +14 -0
  464. package/src/artifacts/frames/index.ts +5 -0
  465. package/src/artifacts/frames/kit.ts +7 -3
  466. package/src/artifacts/frames/protocol.ts +56 -0
  467. package/src/artifacts/frames/video-runtime.ts +165 -0
  468. package/src/artifacts/html.ts +13 -0
  469. package/src/artifacts/index.ts +7 -0
  470. package/src/artifacts/kinds.ts +9 -1
  471. package/src/artifacts/limits.ts +43 -0
  472. package/src/artifacts/live/document.ts +27 -3
  473. package/src/artifacts/live/index.ts +58 -2
  474. package/src/artifacts/live/presence.ts +17 -5
  475. package/src/artifacts/live/protocol.ts +4 -2
  476. package/src/artifacts/live/server.ts +1 -1
  477. package/src/artifacts/live/state.ts +3 -3
  478. package/src/artifacts/media/README.md +75 -0
  479. package/src/artifacts/media/media.ts +316 -0
  480. package/src/artifacts/media/transcriber.ts +84 -0
  481. package/src/artifacts/outline.ts +28 -0
  482. package/src/artifacts/publish/files.ts +19 -6
  483. package/src/artifacts/publish/index.ts +49 -2
  484. package/src/artifacts/publish/pdf.ts +3 -1
  485. package/src/artifacts/publish/previews.ts +22 -8
  486. package/src/artifacts/publish/publish.ts +4 -1
  487. package/src/artifacts/publish/validate/html.ts +23 -18
  488. package/src/artifacts/publish/validate/video.ts +309 -0
  489. package/src/artifacts/publish/video.ts +235 -0
  490. package/src/artifacts/resolve.ts +45 -0
  491. package/src/artifacts/video/README.md +402 -0
  492. package/src/artifacts/video/composition.ts +898 -0
  493. package/src/artifacts/video/edit.ts +3967 -0
  494. package/src/artifacts/video/export.ts +352 -0
  495. package/src/artifacts/video/looks.ts +694 -0
  496. package/src/artifacts/video/project.ts +198 -0
  497. package/src/artifacts/video/stills.ts +168 -0
  498. package/src/artifacts/video/timeline.ts +658 -0
  499. package/src/blob-storage/browser.ts +1 -1
  500. package/src/blob-storage/constants.ts +9 -3
  501. package/src/blob-storage/download-urls.ts +5 -3
  502. package/src/blob-storage/index.ts +1 -0
  503. package/src/blob-storage/internal.ts +13 -2
  504. package/src/blob-storage/media-type.ts +149 -8
  505. package/src/errors/catalog.ts +2 -1
  506. package/src/execution/authorization.ts +2 -2
  507. package/src/execution/kernel-operation.ts +14 -0
  508. package/src/execution/types.ts +2 -0
  509. package/src/http/api-routes.ts +117 -0
  510. package/src/index.ts +18 -1
  511. package/src/lake-storage/definition-updates.ts +3 -9
  512. package/src/models/audio/runtime.ts +48 -3
  513. package/src/models/audio/speech.ts +2 -2
  514. package/src/models/audio/types.ts +24 -3
  515. package/src/models/calls.ts +35 -18
  516. package/src/models/catalog.ts +9 -2
  517. package/src/models/definitions.ts +4 -2
  518. package/src/models/errors.ts +5 -3
  519. package/src/models/events.ts +2 -0
  520. package/src/models/execution/README.md +68 -2
  521. package/src/models/execution/index.ts +1 -0
  522. package/src/models/execution/model-call-limits.ts +11 -5
  523. package/src/models/execution/model-call-recorder.ts +14 -0
  524. package/src/models/execution/session.ts +52 -23
  525. package/src/models/execution/usage.ts +1 -0
  526. package/src/models/execution.ts +13 -2
  527. package/src/models/generation-types.ts +2 -0
  528. package/src/models/index.ts +20 -1
  529. package/src/models/input-file.ts +7 -2
  530. package/src/models/pricing.ts +19 -1
  531. package/src/models/rate-card.ts +15 -3
  532. package/src/models/tools.ts +5 -0
  533. package/src/models/video/catalog.ts +101 -0
  534. package/src/models/video/check.ts +441 -0
  535. package/src/models/video/runtime.ts +550 -0
  536. package/src/models/video/types.ts +194 -0
  537. package/src/objects/execution.ts +2 -0
  538. package/src/objects/sdk/object-set.ts +2 -0
  539. package/src/queues/index.ts +5 -0
  540. package/src/queues/types.ts +126 -5
  541. package/src/runtime/host.ts +3 -0
  542. package/src/runtime/internal.ts +3 -1
  543. package/src/runtime/sixb.ts +12 -4
  544. package/src/sandboxes/README.md +3 -2
  545. package/src/security/public.ts +6 -4
  546. package/src/storage/agents/in-memory.ts +39 -0
  547. package/src/storage/agents/index.ts +1 -0
  548. package/src/storage/agents/types.ts +14 -0
  549. package/src/storage/ai-cost/analytics.ts +2 -0
  550. package/src/storage/ai-cost/codec.ts +1 -0
  551. package/src/storage/ai-cost/groups.ts +7 -0
  552. package/src/storage/ai-cost/types.ts +2 -0
  553. package/src/storage/ai-cost/validation.ts +2 -0
  554. package/src/storage/ai-usage/in-memory.ts +93 -0
  555. package/src/storage/ai-usage/index.ts +10 -0
  556. package/src/storage/ai-usage/record.ts +106 -0
  557. package/src/storage/ai-usage/types.ts +102 -1
  558. package/src/storage/ai-usage/usage.ts +2 -0
  559. package/src/storage/artifacts/in-memory.ts +108 -11
  560. package/src/storage/artifacts/index.ts +14 -0
  561. package/src/storage/artifacts/record.ts +203 -1
  562. package/src/storage/artifacts/types.ts +199 -6
  563. package/src/storage/executions/validation.ts +2 -2
  564. package/src/storage/in-memory/index.ts +1 -1
  565. package/src/storage/index.ts +22 -1
  566. package/src/storage/internal.ts +9 -0
  567. package/src/testing/agent-storage-contract.ts +108 -0
  568. package/src/testing/ai-cost-storage-contract.ts +1 -0
  569. package/src/testing/ai-usage-storage-contract.ts +145 -1
  570. package/src/testing/artifact-storage-contract.ts +320 -0
  571. package/src/testing/execution-storage-contract.ts +10 -2
  572. package/src/testing/lake-storage-contract.ts +27 -0
  573. package/src/testing/queues-contract.ts +71 -0
  574. package/dist/chunk-3723kgba.js +0 -29
  575. package/dist/chunk-3723kgba.js.map +0 -10
  576. package/dist/chunk-3qtk0070.js.map +0 -14
  577. package/dist/chunk-8ncg20rd.js.map +0 -10
  578. package/dist/chunk-9vsc919v.js.map +0 -10
  579. package/dist/chunk-az95tsh3.js.map +0 -11
  580. package/dist/chunk-c29729me.js.map +0 -12
  581. package/dist/chunk-d7vyc7k6.js.map +0 -10
  582. package/dist/chunk-de5sfbc3.js +0 -3
  583. package/dist/chunk-gfdh9kqa.js.map +0 -11
  584. package/dist/chunk-hvq8xs66.js.map +0 -34
  585. package/dist/chunk-k29rdc3h.js.map +0 -10
  586. package/dist/chunk-mbwsgjn7.js.map +0 -11
  587. package/dist/chunk-phs5fbff.js.map +0 -19
  588. package/dist/chunk-qttqe1ah.js.map +0 -24
  589. package/dist/chunk-sgx82nnt.js.map +0 -10
  590. package/dist/chunk-vs2s3p8n.js +0 -2274
  591. package/dist/chunk-vs2s3p8n.js.map +0 -20
  592. package/dist/chunk-wkv3h3q7.js.map +0 -12
  593. package/dist/chunk-wzcjhv54.js.map +0 -11
  594. package/dist/chunk-xtztwpkh.js.map +0 -12
  595. /package/dist/{chunk-7mhbs9yy.js.map → chunk-1z8ccj53.js.map} +0 -0
  596. /package/dist/{chunk-dmnd9ea6.js.map → chunk-30a0ftnm.js.map} +0 -0
  597. /package/dist/{chunk-qbd282aa.js.map → chunk-39q9ybav.js.map} +0 -0
  598. /package/dist/{chunk-fdk0ks9p.js.map → chunk-3x902cja.js.map} +0 -0
  599. /package/dist/{chunk-c4nrycdy.js.map → chunk-4q4a5a96.js.map} +0 -0
  600. /package/dist/{chunk-cpy282b8.js.map → chunk-4w8qzy9w.js.map} +0 -0
  601. /package/dist/{chunk-xavet0qs.js.map → chunk-6whr25gw.js.map} +0 -0
  602. /package/dist/{chunk-ygvay56w.js.map → chunk-896te58g.js.map} +0 -0
  603. /package/dist/{chunk-pfdq1ga6.js.map → chunk-8eqqqc1h.js.map} +0 -0
  604. /package/dist/{chunk-jka26v8c.js.map → chunk-8x1bsp68.js.map} +0 -0
  605. /package/dist/{chunk-6md802cc.js.map → chunk-9az7kjv4.js.map} +0 -0
  606. /package/dist/{chunk-95ps0k5q.js.map → chunk-9e5t53z0.js.map} +0 -0
  607. /package/dist/{chunk-js9e6487.js.map → chunk-9p7kyeqz.js.map} +0 -0
  608. /package/dist/{chunk-brybqw5k.js.map → chunk-bkxm2dzx.js.map} +0 -0
  609. /package/dist/{chunk-ppxf7gw2.js.map → chunk-d7t9jnym.js.map} +0 -0
  610. /package/dist/{chunk-cg7cygfj.js.map → chunk-fdmvaz7x.js.map} +0 -0
  611. /package/dist/{chunk-191jz8a6.js.map → chunk-ff0qdk7z.js.map} +0 -0
  612. /package/dist/{chunk-wx7smkn2.js.map → chunk-fq8drkp0.js.map} +0 -0
  613. /package/dist/{chunk-v8a1qjzp.js.map → chunk-hpswfrjj.js.map} +0 -0
  614. /package/dist/{chunk-bz5bnjjt.js.map → chunk-jjte0h4p.js.map} +0 -0
  615. /package/dist/{chunk-xrmbhap8.js.map → chunk-mwg0nwkb.js.map} +0 -0
  616. /package/dist/{chunk-a3faa34j.js.map → chunk-nfjt8k8j.js.map} +0 -0
  617. /package/dist/{chunk-394zjzjs.js.map → chunk-nhgqz3g3.js.map} +0 -0
  618. /package/dist/{chunk-92wrka15.js.map → chunk-q150fnj9.js.map} +0 -0
  619. /package/dist/{chunk-w3t94hm6.js.map → chunk-qk3zq25v.js.map} +0 -0
  620. /package/dist/{chunk-5qqmndhm.js.map → chunk-szzhrn3e.js.map} +0 -0
  621. /package/dist/{chunk-n1hbwc6y.js.map → chunk-t6pfch4e.js.map} +0 -0
  622. /package/dist/{chunk-brhp9d97.js.map → chunk-vmqjndb3.js.map} +0 -0
  623. /package/dist/{chunk-t58sktr5.js.map → chunk-wrb1x1ss.js.map} +0 -0
  624. /package/dist/{chunk-5sswe5ej.js.map → chunk-wsv23wvr.js.map} +0 -0
  625. /package/dist/{chunk-04r2fdsd.js.map → chunk-x0hqc54n.js.map} +0 -0
  626. /package/dist/{chunk-3neam1y5.js.map → chunk-y3qb965a.js.map} +0 -0
  627. /package/dist/{chunk-5pz3htbe.js.map → chunk-y57eawng.js.map} +0 -0
@@ -4,12 +4,12 @@ import {
4
4
  validateObjectQueryWithAdmission,
5
5
  SYSTEM_PRINCIPAL2,
6
6
  principalsEqual2
7
- } from "./chunk-394zjzjs.js";
7
+ } from "./chunk-nhgqz3g3.js";
8
8
  import {
9
9
  resolveRuntimeAuthorizationForProject,
10
10
  AuthorizationError2,
11
11
  isRuntimeAllowed2
12
- } from "./chunk-tapdssb5.js";
12
+ } from "./chunk-e3b1r4d2.js";
13
13
  import {
14
14
  createArtifactId,
15
15
  createArtifactCommentId
@@ -17,64 +17,82 @@ import {
17
17
  import {
18
18
  inferFileMediaType2,
19
19
  isValidFileRef
20
- } from "./chunk-wkv3h3q7.js";
20
+ } from "./chunk-2138b0ng.js";
21
21
  import {
22
22
  collectArtifactRefIds
23
- } from "./chunk-7mhbs9yy.js";
23
+ } from "./chunk-1z8ccj53.js";
24
24
  import {
25
25
  ArtifactStorageError,
26
26
  turnUndoable2
27
- } from "./chunk-88xeh6zx.js";
27
+ } from "./chunk-1g4me5f2.js";
28
28
  import {
29
29
  ARTIFACT_LIMITS2,
30
30
  ARTIFACT_STATE_LIMITS2,
31
31
  ARTIFACT_HOLDERS_LIMIT2,
32
32
  ARTIFACT_COMMENT_LIMITS2
33
- } from "./chunk-9vsc919v.js";
33
+ } from "./chunk-fgxvrxx4.js";
34
34
  import {
35
35
  computeBlobDigest2
36
- } from "./chunk-xrmbhap8.js";
36
+ } from "./chunk-mwg0nwkb.js";
37
37
  import {
38
38
  objectBatchKey2
39
- } from "./chunk-06kpaqg4.js";
39
+ } from "./chunk-3d9w8t4n.js";
40
40
  import {
41
41
  objectReadersIn,
42
42
  getAuthorizedOntologyView,
43
43
  getQueryDiscovery,
44
44
  readerClearance
45
- } from "./chunk-6md802cc.js";
45
+ } from "./chunk-9az7kjv4.js";
46
46
  import {
47
47
  ArtifactRequestError2,
48
48
  documentData,
49
49
  documentMarks,
50
50
  fillDocumentHtml,
51
51
  frozenDocumentHtml2,
52
+ isMediaFile2,
53
+ unmadeMediaParts2,
54
+ requestArtifactMedia,
55
+ refreshArtifactMedia,
56
+ retryArtifactMedia,
52
57
  checkArtifactFiles,
53
58
  readArtifactText,
59
+ titleFileName2,
54
60
  invalidArtifact,
55
- decodeHtmlEntities,
56
61
  HTML_ENTRY2,
57
62
  refuseFrameAssetPaths,
58
63
  readHtmlReferences,
64
+ HYPERFRAMES_VERSION2,
59
65
  FRAME_DEFAULT_THEMES2,
60
66
  FRAME_CDN_ALLOWLIST2,
61
67
  FRAME_ASSETS2,
62
68
  serializeArtifactQueryResult2
63
- } from "./chunk-vs2s3p8n.js";
69
+ } from "./chunk-23eaayw4.js";
64
70
  import {
65
71
  isArtifactAddress2,
66
72
  parseArtifactAddress2,
67
73
  CANVAS_FILE2,
68
74
  parseCanvas2
69
- } from "./chunk-bz5bnjjt.js";
75
+ } from "./chunk-jjte0h4p.js";
76
+ import {
77
+ decodeHtmlEntities,
78
+ VIDEO_ENTRY2,
79
+ missingScene,
80
+ parseVideoRoot,
81
+ parseVideoScene,
82
+ composeVideo,
83
+ videoFilePath,
84
+ cssMoves,
85
+ videoPageMedia
86
+ } from "./chunk-a68zz4r0.js";
70
87
  import {
71
- isLiveTextPath,
88
+ isLiveTextPath2,
72
89
  createArtifactDocument,
73
90
  documentFiles2,
74
91
  mergeIntoDocument2,
75
92
  holdPage
76
- } from "./chunk-bqr703h4.js";
93
+ } from "./chunk-p0c5kkhn.js";
77
94
  import {
95
+ videoSceneAt2,
78
96
  BOARD_PREVIEW_JOB2,
79
97
  BOARD_PREVIEW_WAIT_MS2,
80
98
  canvasArrowLine2,
@@ -103,8 +121,12 @@ import {
103
121
  liveSheetColumns2,
104
122
  sheetColumnsProblem,
105
123
  sheetFormulasProblem,
106
- sheetChartsProblem
107
- } from "./chunk-60662fyv.js";
124
+ sheetChartsProblem,
125
+ videoSegmentFrames,
126
+ videoSegmentMiddleMs,
127
+ scenesOnScreen,
128
+ videoFrameCount2
129
+ } from "./chunk-fqms1a8c.js";
108
130
  import {
109
131
  ObjectQueryValidationError2,
110
132
  ObjectQueryPlanningError2,
@@ -148,7 +170,24 @@ function createAgentThreadAccessRule(runtime, authority, agents) {
148
170
  const access = readThrough ? accessIn(readThrough) : null;
149
171
  return thread && access ? { thread, access } : null;
150
172
  };
151
- return { caller, read };
173
+ const readConversations = async (threadIds) => {
174
+ if (blocked || threadIds.length === 0)
175
+ return [];
176
+ const storage = agents ?? runtime.storage.agents;
177
+ const stored = await storage?.threads.getByIds({ projectId: runtime.projectId, ids: threadIds }) ?? [];
178
+ const conversations = stored.filter((thread) => thread.kind === "conversation");
179
+ const views = await agentThreadViews(runtime, conversations, storage);
180
+ return views.flatMap((thread) => {
181
+ const access = accessIn(thread);
182
+ return access ? [{ thread, access }] : [];
183
+ });
184
+ };
185
+ const scope = () => {
186
+ if (blocked || !isRuntimeAllowed2(runtime, { kind: "agent.run" }))
187
+ return "none";
188
+ return authority.type === "principal" ? { reader: caller } : "every";
189
+ };
190
+ return { caller, read, readConversations, scope };
152
191
  }
153
192
  function assertConversationThread2(thread) {
154
193
  if (thread.kind === "conversation")
@@ -388,37 +427,85 @@ async function checkAnchor(storage, artifact, anchor) {
388
427
  if (!Number.isSafeInteger(revision) || revision < 1 || revision > artifact.revision) {
389
428
  throw invalid(`A comment is about a revision of the artifact, 1 to ${artifact.revision}.`);
390
429
  }
391
- if (anchor.element !== undefined && anchor.board === undefined) {
430
+ const { label: named, ...place } = await checkPlace(storage, artifact, anchor);
431
+ const label = (named ?? anchor.label)?.replace(/\s+/g, " ").trim().slice(0, ARTIFACT_COMMENT_LIMITS2.maxLabelLength);
432
+ return { ...place, ...label ? { label } : {}, revision };
433
+ }
434
+ async function checkPlace(storage, artifact, anchor) {
435
+ const { board, element, at, scene, point } = anchor;
436
+ const placed = [board, element, at, scene, point].some((value) => value !== undefined);
437
+ if (!placed)
438
+ return {};
439
+ if (point !== undefined && ![point.x, point.y].every((value) => Number.isFinite(value) && value >= 0 && value <= 1)) {
440
+ throw invalid("A comment's point is on what it is about: x and y from 0 to 1.");
441
+ }
442
+ const latest = async () => (await storage.getVersion({
443
+ projectId: artifact.projectId,
444
+ artifactId: artifact.id,
445
+ version: artifact.latestVersion
446
+ }))?.outline;
447
+ switch (artifact.kind) {
448
+ case "canvas":
449
+ return checkBoardPlace(anchor, latest);
450
+ case "video":
451
+ return checkScenePlace(anchor, latest);
452
+ default:
453
+ throw invalid(`A comment on a ${artifact.kind} is about the whole artifact: it names no board, scene, or instant.`);
454
+ }
455
+ }
456
+ async function checkBoardPlace(anchor, latest) {
457
+ const { board, element, point } = anchor;
458
+ if (anchor.at !== undefined || anchor.scene !== undefined) {
459
+ throw invalid("A comment on a canvas is about a board, not an instant or a scene.");
460
+ }
461
+ if (element !== undefined && board === undefined) {
392
462
  throw invalid("A comment on an element names the board it is on.");
393
463
  }
394
- if (anchor.element !== undefined && (anchor.element.length > MAX_ELEMENT_ADDRESS_LENGTH || !ELEMENT_ADDRESS.test(anchor.element))) {
395
- throw invalid(`'${anchor.element}' is no element's address, as a board's elements have.`);
464
+ if (element !== undefined && (element.length > MAX_ELEMENT_ADDRESS_LENGTH || !ELEMENT_ADDRESS.test(element))) {
465
+ throw invalid(`'${element}' is no element's address, as a board's elements have.`);
396
466
  }
397
- if (anchor.board !== undefined) {
398
- const latest = await storage.getVersion({
399
- projectId: artifact.projectId,
400
- artifactId: artifact.id,
401
- version: artifact.latestVersion
402
- });
403
- const outline = latest?.outline;
404
- const shows = outline?.kind === "canvas" && outline.items.some((item) => item.type === "board" && item.id === anchor.board);
467
+ if (point !== undefined && board === undefined) {
468
+ throw invalid("A comment's point is on the board it names.");
469
+ }
470
+ if (board !== undefined) {
471
+ const outline = await latest();
472
+ const shows = outline?.kind === "canvas" && outline.items.some((item) => item.type === "board" && item.id === board);
405
473
  if (!shows)
406
- throw invalid(`The artifact shows no board '${anchor.board}'.`);
474
+ throw invalid(`The artifact shows no board '${board}'.`);
407
475
  }
408
- const { point } = anchor;
409
- if (point !== undefined && anchor.board === undefined) {
410
- throw invalid("A comment's point is on the board it names.");
476
+ return {
477
+ ...board === undefined ? {} : { board },
478
+ ...element === undefined ? {} : { element },
479
+ ...point === undefined ? {} : { point: { x: point.x, y: point.y } }
480
+ };
481
+ }
482
+ async function checkScenePlace(anchor, latest) {
483
+ const { at, scene, point } = anchor;
484
+ if (anchor.board !== undefined || anchor.element !== undefined) {
485
+ throw invalid("A comment on a video is about an instant or a scene, not a board.");
411
486
  }
412
- if (point !== undefined && ![point.x, point.y].every((value) => Number.isFinite(value) && value >= 0 && value <= 1)) {
413
- throw invalid("A comment's point is on its board: x and y from 0 to 1.");
487
+ if (point !== undefined && at === undefined) {
488
+ throw invalid("A comment's point is on the frame at its instant: give it `at` too.");
414
489
  }
415
- const label = anchor.label?.replace(/\s+/g, " ").trim().slice(0, ARTIFACT_COMMENT_LIMITS2.maxLabelLength);
490
+ const outline = await latest();
491
+ if (outline?.kind !== "video")
492
+ throw invalid("The artifact has no video to comment on.");
493
+ if (at !== undefined && !(Number.isSafeInteger(at) && at >= 0 && at <= outline.durationMs)) {
494
+ throw invalid(`A comment's instant is in the video: \`at\` is 0 to ${outline.durationMs} milliseconds.`);
495
+ }
496
+ const named = scene === undefined ? undefined : outline.scenes.find((each) => each.id === scene);
497
+ if (scene !== undefined && !named)
498
+ throw invalid(`The video has no scene '${scene}'.`);
499
+ if (named && at !== undefined && (at < named.startMs || at > named.startMs + named.durationMs)) {
500
+ throw invalid(`Scene '${named.id}' plays from ${named.startMs} to ${named.startMs + named.durationMs} milliseconds: a comment's \`at\` is in the scene it names, or names none.`);
501
+ }
502
+ const playing = named ?? (at === undefined ? undefined : videoSceneAt2(outline, at));
503
+ const instant = at === undefined ? {} : playing ? { offset: at - playing.startMs } : { at };
416
504
  return {
417
- ...anchor.board === undefined ? {} : { board: anchor.board },
418
- ...anchor.element === undefined ? {} : { element: anchor.element },
419
- ...label ? { label } : {},
420
- ...point === undefined ? {} : { point: { x: point.x, y: point.y } },
421
- revision
505
+ ...playing ? { scene: playing.id } : {},
506
+ ...playing?.label === undefined ? {} : { label: playing.label },
507
+ ...instant,
508
+ ...point === undefined ? {} : { point: { x: point.x, y: point.y } }
422
509
  };
423
510
  }
424
511
  function commentRequestError(error) {
@@ -509,7 +596,7 @@ import { posix } from "path";
509
596
  var strictUtf8 = new TextDecoder("utf-8", { fatal: true });
510
597
  async function readLiveFiles2(blobStorage, files) {
511
598
  const read = await Promise.all(files.map(async ({ path, file }) => {
512
- if (!isLiveTextPath(path) || file.sizeBytes > ARTIFACT_LIMITS2.maxFileBytes) {
599
+ if (!isLiveTextPath2(path) || file.sizeBytes > ARTIFACT_LIMITS2.maxFileBytes) {
513
600
  return [path, { file }];
514
601
  }
515
602
  const bytes = new Uint8Array(await new Response(await blobStorage.open(file.blobId)).arrayBuffer());
@@ -550,7 +637,7 @@ function sameArtifactFiles2(left, right) {
550
637
 
551
638
  // src/artifacts/live/state.ts
552
639
  function keepsDocument2(kind) {
553
- return kind === "canvas" || kind === "document";
640
+ return kind === "canvas" || kind === "document" || kind === "video";
554
641
  }
555
642
  async function loadArtifactDocument2(blobStorage, artifact, files) {
556
643
  const doc = new Y.Doc;
@@ -827,7 +914,7 @@ function boardRenderKey(input) {
827
914
  const reader = boardsReadLiveData2({ files }) ? [author.type, author.id] : null;
828
915
  return createHash2("sha256").update(JSON.stringify([
829
916
  RENDER_KEY_FORMAT,
830
- frameKitDigest(),
917
+ frameKitDigest("page"),
831
918
  board.file,
832
919
  board.w,
833
920
  board.h,
@@ -1007,10 +1094,15 @@ async function storeQueryAnswers(input, version) {
1007
1094
  mediaType: "application/json"
1008
1095
  });
1009
1096
  }
1010
- var kitDigest;
1011
- function frameKitDigest() {
1012
- kitDigest ??= createHash2("sha256").update(JSON.stringify([FRAME_ASSETS2, FRAME_DEFAULT_THEMES2])).digest("hex");
1013
- return kitDigest;
1097
+ var kitDigests = new Map;
1098
+ function frameKitDigest(layout) {
1099
+ let digest = kitDigests.get(layout);
1100
+ if (digest === undefined) {
1101
+ const assets = Object.fromEntries(Object.entries(FRAME_ASSETS2).filter(([, asset]) => asset.layout === undefined || asset.layout === layout));
1102
+ digest = createHash2("sha256").update(JSON.stringify([assets, FRAME_DEFAULT_THEMES2])).digest("hex");
1103
+ kitDigests.set(layout, digest);
1104
+ }
1105
+ return digest;
1014
1106
  }
1015
1107
 
1016
1108
  // src/artifacts/publish/validate/document-html.ts
@@ -1334,7 +1426,7 @@ function documentPdfKey2(version, document) {
1334
1426
  entry.path,
1335
1427
  document && entry.path === DOCUMENT_HTML_ENTRY ? document.digest : entry.file.digest
1336
1428
  ]).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
1337
- return createHash3("sha256").update(JSON.stringify([RENDER_KEY_FORMAT2, frameKitDigest(), version.artifactId, files])).digest("hex");
1429
+ return createHash3("sha256").update(JSON.stringify([RENDER_KEY_FORMAT2, frameKitDigest("document"), version.artifactId, files])).digest("hex");
1338
1430
  }
1339
1431
  async function requestDocumentPdf(context, version, options = {}) {
1340
1432
  const renderKey = documentPdfKey2(version, options.document);
@@ -2432,6 +2524,301 @@ async function validateSlides(blobStorage, files) {
2432
2524
  };
2433
2525
  }
2434
2526
 
2527
+ // src/artifacts/publish/video.ts
2528
+ import { createHash as createHash4 } from "crypto";
2529
+ var RENDER_KEY_FORMAT3 = "sixb-video-scene/1";
2530
+ var HOST_TIMES = ["data-start", "data-duration", "data-label"];
2531
+ var HOST_PLACE = "<!-- scene -->";
2532
+ var HYPERFRAMES_STATE = ".hyperframes/";
2533
+ function sceneRenderKeys(input) {
2534
+ const { index, composition, files, rootLoads, rootTimeline, loads } = input;
2535
+ const { scenes } = composition;
2536
+ const { attributes } = composition.root;
2537
+ const root = cut(index, [
2538
+ ...scenes.map((scene) => ({ ...scene.host.element, with: HOST_PLACE })),
2539
+ ...[
2540
+ ...["data-duration", "data-poster"].flatMap((name) => attributes[name] ?? []),
2541
+ ...composition.sounds
2542
+ ].map((span) => ({ ...withSpaceBefore(index, span), with: "" }))
2543
+ ]);
2544
+ const hostOf = (scene) => {
2545
+ const { element, attributes } = scene.host;
2546
+ const times = HOST_TIMES.flatMap((name) => {
2547
+ const at = attributes[name];
2548
+ return at ? [{ start: at.start - element.start, end: at.end - element.start, with: "" }] : [];
2549
+ });
2550
+ return cut(index.slice(element.start, element.end), times);
2551
+ };
2552
+ const segments = videoSegmentFrames(composition);
2553
+ return new Map(scenes.map((scene) => {
2554
+ const segment = segments.get(scene.id);
2555
+ const beside = (segment ? scenesOnScreen(composition, segment) : [scene]).sort((a, b) => a.host.element.start - b.host.element.start);
2556
+ const loaded = videoSceneFiles2({
2557
+ files,
2558
+ composition,
2559
+ rootLoads,
2560
+ loads,
2561
+ scenes: beside.map((each) => each.id)
2562
+ }).filter(({ path }) => path !== VIDEO_ENTRY2).map((entry) => [entry.path, entry.file.digest]).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
2563
+ const key = [
2564
+ RENDER_KEY_FORMAT3,
2565
+ frameKitDigest("video"),
2566
+ scene.id,
2567
+ sha256(root),
2568
+ beside.map((each) => [hostOf(each), each.startMs - scene.startMs, each.durationMs]),
2569
+ rootTimeline ? scene.startMs : null,
2570
+ loaded
2571
+ ];
2572
+ return [scene.id, sha256(JSON.stringify(key))];
2573
+ }));
2574
+ }
2575
+ function videoSceneFiles2(input) {
2576
+ const { files, composition, rootLoads, loads } = input;
2577
+ const sceneFiles = new Set(composition.scenes.map((scene) => scene.src));
2578
+ const own = new Set([...rootLoads, ...input.scenes.flatMap((id) => [...loads.get(id) ?? []])]);
2579
+ return files.filter(({ path, file }) => {
2580
+ const type = file.mediaType ?? "";
2581
+ if (path === VIDEO_ENTRY2)
2582
+ return true;
2583
+ if (type.startsWith("audio/") && !input.sounds)
2584
+ return false;
2585
+ if (own.has(path))
2586
+ return true;
2587
+ if (path.startsWith(HYPERFRAMES_STATE))
2588
+ return false;
2589
+ return !sceneFiles.has(path) && !/^(video|audio)\//.test(type);
2590
+ });
2591
+ }
2592
+ function withSpaceBefore(text, span) {
2593
+ let start = span.start;
2594
+ while (start > 0 && /\s/.test(text[start - 1] ?? ""))
2595
+ start--;
2596
+ return { start, end: span.end };
2597
+ }
2598
+ function videoSoundProject2(input) {
2599
+ const paths = new Set(input.files.map((entry) => entry.path));
2600
+ const exists = (path) => paths.has(path);
2601
+ const heard = new Set;
2602
+ const pages = new Map;
2603
+ for (const [path, html] of input.pages) {
2604
+ const media = videoPageMedia(path, html);
2605
+ for (const { value, muted } of media) {
2606
+ if (muted)
2607
+ continue;
2608
+ const written = value.trim();
2609
+ const played = isArtifactAddress2(written) ? written : videoFilePath(path, written, exists);
2610
+ if (played)
2611
+ heard.add(played);
2612
+ }
2613
+ const cuts = media.filter((each) => each.muted).map((each) => ({ ...each.at, with: "" }));
2614
+ if (cuts.length > 0)
2615
+ pages.set(path, cut(html, cuts));
2616
+ }
2617
+ const isVideo = (file) => (file.mediaType ?? "").startsWith("video/");
2618
+ return {
2619
+ files: input.files.filter(({ path, file }) => !isVideo(file) || heard.has(path)),
2620
+ pages,
2621
+ media: input.media.filter(({ address, file }) => !file || !isVideo(file) || heard.has(address))
2622
+ };
2623
+ }
2624
+ function cut(text, spans) {
2625
+ let out = "";
2626
+ let kept = 0;
2627
+ for (const span of [...spans].sort((a, b) => a.start - b.start)) {
2628
+ out += text.slice(kept, span.start) + span.with;
2629
+ kept = span.end;
2630
+ }
2631
+ return out + text.slice(kept);
2632
+ }
2633
+ function sha256(text) {
2634
+ return createHash4("sha256").update(text).digest("hex");
2635
+ }
2636
+
2637
+ // src/artifacts/publish/validate/video.ts
2638
+ async function validateVideo(blobStorage, files) {
2639
+ const { outline, references } = await readVideoVersion2(blobStorage, files);
2640
+ return { entry: VIDEO_ENTRY2, outline, references };
2641
+ }
2642
+ async function readVideoVersion2(blobStorage, files) {
2643
+ const byPath = new Map(files.map((file) => [file.path, file]));
2644
+ const index = byPath.get(VIDEO_ENTRY2);
2645
+ if (!index) {
2646
+ throw invalidArtifact(`A video needs '${VIDEO_ENTRY2}', its root composition, with a <template> file for each scene and the media they play beside it.`);
2647
+ }
2648
+ refuseFrameAssetPaths(files, "the video");
2649
+ refuseTooManyRecordings(files);
2650
+ refuseLargePages(files);
2651
+ const read = (file) => readArtifactText(blobStorage, file, ARTIFACT_LIMITS2.maxSceneBytes);
2652
+ const indexText = await read(index);
2653
+ const root = parseVideoRoot(indexText);
2654
+ if ("error" in root)
2655
+ throw invalidArtifact(root.error);
2656
+ const scenes = new Map;
2657
+ for (const { id, src } of root.root.scenes) {
2658
+ const file = byPath.get(src);
2659
+ if (!file)
2660
+ throw invalidArtifact(missingScene(id, src));
2661
+ const scene = parseVideoScene(await read(file), src);
2662
+ if ("error" in scene)
2663
+ throw invalidArtifact(scene.error);
2664
+ scenes.set(src, scene.scene);
2665
+ }
2666
+ const composed = composeVideo(root.root, scenes);
2667
+ if ("error" in composed)
2668
+ throw invalidArtifact(composed.error);
2669
+ const { composition } = composed;
2670
+ const references = [];
2671
+ const exists = (path) => byPath.has(path);
2672
+ const nestedFiles = new Map;
2673
+ const parsed = async (file) => {
2674
+ const known = scenes.get(file.path) ?? nestedFiles.get(file.path);
2675
+ if (known)
2676
+ return known;
2677
+ const scene = parseVideoScene(await read(file), file.path);
2678
+ if ("error" in scene)
2679
+ throw invalidArtifact(scene.error);
2680
+ nestedFiles.set(file.path, scene.scene);
2681
+ return scene.scene;
2682
+ };
2683
+ const load = async (path, file, at, nesting, loaded) => {
2684
+ const known = loaded.get(path);
2685
+ if (known)
2686
+ return known;
2687
+ const paths = new Set([
2688
+ path,
2689
+ ...played({ file: path, at, media: file.media, exists, references })
2690
+ ]);
2691
+ for (const { element, value } of file.compositions) {
2692
+ const nested = videoFilePath(VIDEO_ENTRY2, value, exists);
2693
+ const nestedEntry = nested === undefined ? undefined : byPath.get(nested);
2694
+ const tag = `<${element} data-composition-src="${value.trim()}">`;
2695
+ if (nested === undefined || !nestedEntry) {
2696
+ throw invalidArtifact(`${path}: ${tag} nests a composition that is not one of the video's files: name it by its path from the video's root, such as compositions/lower-third.html.`);
2697
+ }
2698
+ if (nested === path || nesting.includes(nested)) {
2699
+ throw invalidArtifact(`${path}: ${tag} nests '${nested}', which nests ${path} in turn: a composition never holds itself.`);
2700
+ }
2701
+ const nestedFile = await parsed(nestedEntry);
2702
+ for (const each of await load(nested, nestedFile, at, [...nesting, path], loaded)) {
2703
+ paths.add(each);
2704
+ }
2705
+ }
2706
+ loaded.set(path, paths);
2707
+ return paths;
2708
+ };
2709
+ const rootLoads = played({
2710
+ file: VIDEO_ENTRY2,
2711
+ at: "",
2712
+ media: composition.media,
2713
+ exists,
2714
+ references
2715
+ });
2716
+ const loads = new Map;
2717
+ for (const scene of composition.scenes) {
2718
+ const file = scenes.get(scene.src);
2719
+ if (file)
2720
+ loads.set(scene.id, await load(scene.src, file, scene.id, [], new Map));
2721
+ }
2722
+ const rootTimeline = composition.rootTimeline || await linksMove(composition, byPath, read, exists);
2723
+ const keys = sceneRenderKeys({
2724
+ index: indexText,
2725
+ composition,
2726
+ files,
2727
+ rootLoads,
2728
+ rootTimeline,
2729
+ loads
2730
+ });
2731
+ return {
2732
+ index: indexText,
2733
+ composition,
2734
+ rootLoads,
2735
+ loads,
2736
+ rootTimeline,
2737
+ outline: {
2738
+ kind: "video",
2739
+ width: composition.width,
2740
+ height: composition.height,
2741
+ fps: composition.fps,
2742
+ durationMs: composition.durationMs,
2743
+ ...composition.posterMs === undefined ? {} : { posterMs: composition.posterMs },
2744
+ scenes: composition.scenes.map((scene) => ({
2745
+ id: scene.id,
2746
+ ...scene.label ? { label: scene.label } : {},
2747
+ startMs: scene.startMs,
2748
+ durationMs: scene.durationMs,
2749
+ renderKey: keys.get(scene.id) ?? ""
2750
+ }))
2751
+ },
2752
+ references
2753
+ };
2754
+ }
2755
+ var FONT_HOSTS = [
2756
+ "https://fonts.googleapis.com",
2757
+ "https://fonts.gstatic.com"
2758
+ ];
2759
+ async function linksMove(composition, byPath, read, exists) {
2760
+ const fileOf = (value) => {
2761
+ const path = videoFilePath(VIDEO_ENTRY2, value, exists);
2762
+ return path === undefined ? undefined : byPath.get(path);
2763
+ };
2764
+ const readable = (file) => file.file.sizeBytes <= ARTIFACT_LIMITS2.maxSceneBytes;
2765
+ for (const { value } of composition.links.stylesheets) {
2766
+ const file = fileOf(value);
2767
+ if (!file) {
2768
+ if (!FONT_HOSTS.some((origin) => value.trim().startsWith(`${origin}/`)))
2769
+ return true;
2770
+ continue;
2771
+ }
2772
+ if (!readable(file) || cssMoves(await read(file)))
2773
+ return true;
2774
+ }
2775
+ for (const { value } of composition.links.scripts) {
2776
+ const file = fileOf(value);
2777
+ if (file && (!readable(file) || /__timelines/.test(await read(file))))
2778
+ return true;
2779
+ }
2780
+ return false;
2781
+ }
2782
+ function played(input) {
2783
+ const { file, at, media, exists, references } = input;
2784
+ const paths = new Set;
2785
+ for (const { element, attribute, value } of media) {
2786
+ const written = value.trim();
2787
+ const tag = `<${element} ${attribute}="${written}">`;
2788
+ if (isArtifactAddress2(written)) {
2789
+ if (!parseArtifactAddress2(written)?.path) {
2790
+ throw invalidArtifact(`${file}: ${tag} names no file of that artifact: name one, such as artifact:art_k3m9q2x7tp/media/intro.mp4.`);
2791
+ }
2792
+ references.push({ address: written, as: "embed", at });
2793
+ continue;
2794
+ }
2795
+ if (/^(data|blob):/i.test(written))
2796
+ continue;
2797
+ const path = videoFilePath(file, written, exists);
2798
+ if (path === undefined) {
2799
+ throw invalidArtifact(`${file}: ${tag} plays a file from outside the video, which neither the player nor an export can load: add it to the video, such as media/<name>, and name it by that path.`);
2800
+ }
2801
+ if (!exists(path)) {
2802
+ throw invalidArtifact(`${file}: ${tag} plays '${path}', which is not one of the video's files.`);
2803
+ }
2804
+ paths.add(path);
2805
+ }
2806
+ return paths;
2807
+ }
2808
+ function refuseLargePages(files) {
2809
+ const limit = ARTIFACT_LIMITS2.maxSceneBytes;
2810
+ const large = files.find(({ path, file }) => /\.html?$/i.test(path) && file.sizeBytes > limit);
2811
+ if (large) {
2812
+ throw invalidArtifact(`'${large.path}' is ${large.file.sizeBytes} bytes: each of a video's HTML files holds at most ${limit}.`);
2813
+ }
2814
+ }
2815
+ function refuseTooManyRecordings(files) {
2816
+ const recordings = files.filter(({ file }) => /^(video|audio)\//.test(file.mediaType ?? ""));
2817
+ if (recordings.length > ARTIFACT_LIMITS2.maxVideoMediaFiles) {
2818
+ throw invalidArtifact(`A video holds at most ${ARTIFACT_LIMITS2.maxVideoMediaFiles} video and sound files; this one has ${recordings.length}. Leave out the ones it no longer plays.`);
2819
+ }
2820
+ }
2821
+
2435
2822
  // src/artifacts/publish/publish.ts
2436
2823
  var CREATE_ATTEMPTS = 3;
2437
2824
  var LIVE_BOARD_PREVIEWS = {
@@ -2445,7 +2832,7 @@ async function publishArtifact2(context, input, access) {
2445
2832
  }
2446
2833
  async function prepareArtifactVersion2(context, input) {
2447
2834
  const title = checkTitle(input.title);
2448
- await checkArtifactFiles(context.blobStorage, input.files);
2835
+ await checkArtifactFiles(context.blobStorage, input.kind, input.files);
2449
2836
  const theme = input.kind === "file" ? undefined : await readTheme(context.blobStorage, input.files);
2450
2837
  const document = input.kind === "document" ? await validateDocument(context.blobStorage, input.files) : null;
2451
2838
  const queries = await checkArtifactQueries(context.blobStorage, input.kind, input.files, input.checkQuery, document?.outline.holder ? { holder: document.outline.holder.objectTypeId } : {});
@@ -2534,6 +2921,8 @@ async function validateKind(blobStorage, kind, files, queries) {
2534
2921
  return validatePage(blobStorage, files);
2535
2922
  case "canvas":
2536
2923
  return validateCanvas(blobStorage, files);
2924
+ case "video":
2925
+ return validateVideo(blobStorage, files);
2537
2926
  default:
2538
2927
  throw invalidArtifact(`'${kind}' is not a kind of artifact.`);
2539
2928
  }
@@ -2610,6 +2999,250 @@ async function createArtifact(context, prepared) {
2610
2999
  }
2611
3000
  }
2612
3001
 
3002
+ // src/artifacts/video/export.ts
3003
+ import { createHash as createHash5 } from "crypto";
3004
+ var VIDEO_ENGINE2 = `hyperframes@${HYPERFRAMES_VERSION2}`;
3005
+ var VIDEO_SEGMENT_SETTINGS2 = { crf: 20, keyframeSeconds: 2, workers: 2 };
3006
+ var VIDEO_EXPORT_JOB2 = {
3007
+ timeoutMs: 20 * 60000,
3008
+ attempts: 3,
3009
+ backoffMs: 15000,
3010
+ recheckMs: 5000,
3011
+ waitMs: 12 * 60 * 60000
3012
+ };
3013
+ var VIDEO_SEGMENT_JOB2 = { attempts: 2, backoffMs: 30000 };
3014
+ function videoSegmentTimeoutMs2(segment, video) {
3015
+ if (segment.kind === "sound")
3016
+ return 5 * 60000 + video.durationMs;
3017
+ const seconds = (segment.endFrame - segment.startFrame) / video.fps;
3018
+ const pixels = Math.max(1, video.width * video.height / (1920 * 1080));
3019
+ return 5 * 60000 + Math.ceil(seconds * pixels * 20000);
3020
+ }
3021
+ var EXPORT_FORMAT = "sixb-video-export/1";
3022
+ var SEGMENT_FORMAT = "sixb-video-segment/1";
3023
+ var SOUND_FORMAT = "sixb-video-sound/1";
3024
+ function videoExportPlan2(source) {
3025
+ const { outline } = source;
3026
+ const { fps } = outline;
3027
+ const frames = videoFrameCount2(outline.durationMs, fps);
3028
+ const cuts = videoSegmentFrames(outline);
3029
+ const scenes = outline.scenes.flatMap((scene) => {
3030
+ const cut = cuts.get(scene.id);
3031
+ if (cut?.scene !== scene.id)
3032
+ return [];
3033
+ const { startFrame, endFrame } = cut;
3034
+ const beside = scenesOnScreen(outline, cut);
3035
+ const key = hash([
3036
+ SEGMENT_FORMAT,
3037
+ VIDEO_ENGINE2,
3038
+ VIDEO_SEGMENT_SETTINGS2,
3039
+ scene.renderKey,
3040
+ Math.round((startFrame * 1000 / fps - scene.startMs) * 1000) / 1000,
3041
+ endFrame - startFrame,
3042
+ resolved(source, ["", ...beside.map((each) => each.id)])
3043
+ ]);
3044
+ const label = scene.label ? { label: scene.label } : {};
3045
+ return [{ kind: "scene", scene: scene.id, ...label, startFrame, endFrame, key }];
3046
+ });
3047
+ const sound = {
3048
+ kind: "sound",
3049
+ key: hash([
3050
+ SOUND_FORMAT,
3051
+ VIDEO_ENGINE2,
3052
+ fps,
3053
+ frames,
3054
+ sorted(source.files.map((entry) => [entry.path, entry.file.digest])),
3055
+ resolved(source)
3056
+ ])
3057
+ };
3058
+ const segments = [...scenes, sound];
3059
+ return { key: hash([EXPORT_FORMAT, segments.map((each) => each.key)]), frames, segments };
3060
+ }
3061
+ function videoExportJobId2(key) {
3062
+ return `art_vexp_${key}`;
3063
+ }
3064
+ function videoExportRetryJobId(key) {
3065
+ return `art_vexp_retry_${key}`;
3066
+ }
3067
+ function videoSegmentJobId2(key) {
3068
+ return `art_vseg_${key}`;
3069
+ }
3070
+ function videoExportStatus2(plan, kept) {
3071
+ const byKey = new Map(kept.map((record) => [record.key, record]));
3072
+ const done = byKey.get(plan.key);
3073
+ if (done && "failure" in done)
3074
+ return failed(done);
3075
+ if (done)
3076
+ return { status: "ready", file: done.file };
3077
+ for (const segment of plan.segments) {
3078
+ const record = byKey.get(segment.key);
3079
+ if (record && "failure" in record)
3080
+ return failed(record);
3081
+ }
3082
+ return { status: "rendering", progress: videoExportProgress(plan, kept) };
3083
+ }
3084
+ function failed(record) {
3085
+ const lacks = record.lacks ? { lacks: record.lacks } : {};
3086
+ return { status: "failed", reason: record.failure, ...lacks };
3087
+ }
3088
+ function videoExportProgress(plan, kept) {
3089
+ const rendered = new Set(kept.flatMap((record) => ("failure" in record) ? [] : [record.key]));
3090
+ const ready = plan.segments.filter((segment) => rendered.has(segment.key)).length;
3091
+ const total = plan.segments.length;
3092
+ return { ready, total, assembling: ready === total };
3093
+ }
3094
+ function videoExportKeys2(plan) {
3095
+ return [plan.key, ...plan.segments.map((segment) => segment.key)];
3096
+ }
3097
+ async function requestVideoExport(context, version, source, options) {
3098
+ const { plan } = options;
3099
+ if (options.retry) {
3100
+ await context.storage.clearVideoRenderFailures({
3101
+ projectId: version.projectId,
3102
+ keys: videoExportKeys2(plan)
3103
+ });
3104
+ }
3105
+ await context.queue.enqueue({
3106
+ projectId: version.projectId,
3107
+ jobs: [
3108
+ {
3109
+ ...options.retry ? { id: videoExportRetryJobId(plan.key), replace: true } : { id: videoExportJobId2(plan.key) },
3110
+ type: "artifact.video.export.requested",
3111
+ payload: {
3112
+ artifactId: version.artifactId,
3113
+ version: version.version,
3114
+ key: plan.key,
3115
+ outline: source.outline,
3116
+ files: source.files,
3117
+ references: source.references,
3118
+ media: source.media,
3119
+ askedAt: new Date().toISOString(),
3120
+ ...options.retry ? { retry: true } : {}
3121
+ }
3122
+ }
3123
+ ]
3124
+ });
3125
+ await context.storage.putVideoExportAsk({
3126
+ projectId: version.projectId,
3127
+ key: plan.key,
3128
+ askedAt: new Date
3129
+ });
3130
+ }
3131
+ async function resolveVideoMedia2(version, read) {
3132
+ const addresses = [
3133
+ ...new Set(version.references.filter((each) => each.as === "embed").map((each) => each.address))
3134
+ ];
3135
+ const media = [];
3136
+ for (const address of addresses) {
3137
+ const parsed = parseArtifactAddress2(address);
3138
+ if (!parsed?.path)
3139
+ continue;
3140
+ const target = await read(parsed.artifactId, parsed.version ?? "latest").catch(() => null);
3141
+ const file = target?.files.find((each) => each.path === parsed.path)?.file;
3142
+ media.push(file ? { address, file } : { address });
3143
+ }
3144
+ return media;
3145
+ }
3146
+ function resolved(source, at) {
3147
+ const played = new Set(source.references.filter((reference) => at === undefined || at.includes(reference.at)).map((reference) => reference.address));
3148
+ return sorted(source.media.filter((each) => played.has(each.address)).map((each) => [each.address, each.file?.digest ?? null]));
3149
+ }
3150
+ function sorted(pairs) {
3151
+ return [...pairs].sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
3152
+ }
3153
+ function hash(value) {
3154
+ return createHash5("sha256").update(JSON.stringify(value)).digest("hex");
3155
+ }
3156
+
3157
+ // src/artifacts/video/stills.ts
3158
+ import { createHash as createHash6 } from "crypto";
3159
+ var VIDEO_STILLS_JOB2 = {
3160
+ timeoutMs: 10 * 60000,
3161
+ attempts: 3,
3162
+ backoffMs: 30000,
3163
+ settleMs: 15000
3164
+ };
3165
+ var VIDEO_STILL_WIDTH2 = 1280;
3166
+ var STILL_FORMAT = "sixb-video-still/1";
3167
+ var POSTER_FORMAT = "sixb-video-poster/1";
3168
+ function videoSceneStills2(outline) {
3169
+ const segments = videoSegmentFrames(outline);
3170
+ return outline.scenes.flatMap((scene) => {
3171
+ const segment = segments.get(scene.id);
3172
+ if (!segment)
3173
+ return [];
3174
+ const atMs = videoSegmentMiddleMs(segment, outline.fps);
3175
+ const key = hash2([STILL_FORMAT, VIDEO_ENGINE2, scene.renderKey, atMs - scene.startMs]);
3176
+ return [{ key, atMs, scene: scene.id }];
3177
+ });
3178
+ }
3179
+ function videoStills2(outline) {
3180
+ const scenes = videoSceneStills2(outline);
3181
+ const poster = posterStill(outline);
3182
+ return poster ? [...scenes, poster] : scenes;
3183
+ }
3184
+ function videoPoster2(outline) {
3185
+ const [first] = videoStills2(outline);
3186
+ return posterStill(outline) ?? first;
3187
+ }
3188
+ function posterStill(outline) {
3189
+ const { posterMs } = outline;
3190
+ if (posterMs === undefined)
3191
+ return;
3192
+ const scene = [...outline.scenes].reverse().find((each) => each.startMs <= posterMs) ?? outline.scenes[0];
3193
+ if (!scene)
3194
+ return;
3195
+ return {
3196
+ key: hash2([POSTER_FORMAT, VIDEO_ENGINE2, scene.renderKey, posterMs - scene.startMs]),
3197
+ atMs: posterMs,
3198
+ scene: scene.id
3199
+ };
3200
+ }
3201
+ async function missingVideoStills2(storage, version) {
3202
+ if (version.outline.kind !== "video")
3203
+ return [];
3204
+ const stills = videoStills2(version.outline);
3205
+ const kept = await storage.listVideoRenders({
3206
+ projectId: version.projectId,
3207
+ keys: stills.map((still) => still.key)
3208
+ });
3209
+ const done = new Set(kept.flatMap((record) => ("failure" in record) ? [] : [record.key]));
3210
+ return stills.filter((still) => !done.has(still.key));
3211
+ }
3212
+ function videoStillsJobId(artifactId) {
3213
+ return `art_vstills_${artifactId}`;
3214
+ }
3215
+ async function requestVideoStills(input, version) {
3216
+ if (version.outline.kind !== "video")
3217
+ return;
3218
+ try {
3219
+ if ((await missingVideoStills2(input.storage, version)).length === 0)
3220
+ return;
3221
+ await input.queue.enqueue({
3222
+ projectId: version.projectId,
3223
+ jobs: [
3224
+ {
3225
+ id: videoStillsJobId(version.artifactId),
3226
+ replace: true,
3227
+ type: "artifact.video.stills.requested",
3228
+ payload: {
3229
+ artifactId: version.artifactId,
3230
+ version: version.version,
3231
+ updatedAt: version.updatedAt.toISOString(),
3232
+ media: await resolveVideoMedia2(version, input.read)
3233
+ },
3234
+ availableAt: new Date(Date.now() + VIDEO_STILLS_JOB2.settleMs).toISOString()
3235
+ }
3236
+ ]
3237
+ });
3238
+ } catch (error) {
3239
+ console.error(`[Sixb] Could not ask for the stills of version ${version.version} of '${version.artifactId}'; its scenes show without pictures.`, error);
3240
+ }
3241
+ }
3242
+ function hash2(value) {
3243
+ return createHash6("sha256").update(JSON.stringify(value)).digest("hex");
3244
+ }
3245
+
2613
3246
  // src/artifacts/execution.ts
2614
3247
  var publishers = new WeakMap;
2615
3248
  function publisherOf(artifacts) {
@@ -2791,10 +3424,25 @@ function createArtifactsRuntime(runtime, blobStorage, options = {}) {
2791
3424
  }
2792
3425
  return { objectTypeId: holder.objectTypeId, primaryId };
2793
3426
  };
3427
+ const mediaContext = (storage) => ({
3428
+ storage,
3429
+ queue: runtime.queues.renders,
3430
+ transcribes: options.transcribesMedia === true
3431
+ });
2794
3432
  const requestPreviews = async (version, requestOptions) => {
2795
3433
  const storage = runtime.storage.artifacts;
2796
3434
  if (!options.rendersInSandboxes || !storage)
2797
3435
  return;
3436
+ const borrowed = await borrowedRecordings(version);
3437
+ await requestArtifactMedia(mediaContext(storage), {
3438
+ ...version,
3439
+ files: [...version.files, ...borrowed]
3440
+ });
3441
+ await requestVideoStills({
3442
+ storage,
3443
+ queue: runtime.queues.renders,
3444
+ read: (id, number) => artifacts.getVersion(id, number)
3445
+ }, version);
2798
3446
  await requestBoardPreviews({
2799
3447
  storage,
2800
3448
  queue: runtime.queues.renders,
@@ -2802,6 +3450,25 @@ function createArtifactsRuntime(runtime, blobStorage, options = {}) {
2802
3450
  query: (name) => artifacts.query(version.artifactId, name, { version: version.version })
2803
3451
  }, version, requestOptions);
2804
3452
  };
3453
+ const borrowedRecordings = async (version) => {
3454
+ if (version.outline.kind !== "video")
3455
+ return [];
3456
+ const recordings = [];
3457
+ try {
3458
+ for (const reference of version.references) {
3459
+ const address = parseArtifactAddress2(reference.address);
3460
+ if (reference.as !== "embed" || !address?.path)
3461
+ continue;
3462
+ const lender = await readVersion(address.artifactId, reference.resolvedVersion);
3463
+ const file = lender?.version.files.find((candidate) => candidate.path === address.path);
3464
+ if (file && isMediaFile2(file))
3465
+ recordings.push(file);
3466
+ }
3467
+ } catch (error) {
3468
+ console.error(`[Sixb] Could not read the recordings version ${version.version} of '${version.artifactId}' plays from other artifacts; they play as they are.`, error);
3469
+ }
3470
+ return recordings;
3471
+ };
2805
3472
  const reach = async (artifactId) => {
2806
3473
  const artifact = await requireStorage().get({ projectId: runtime.projectId, id: artifactId });
2807
3474
  return artifact ? { artifact, access: await rule().accessTo(artifact) } : null;
@@ -3089,6 +3756,85 @@ function createArtifactsRuntime(runtime, blobStorage, options = {}) {
3089
3756
  });
3090
3757
  return { status: "printing", ...keyed };
3091
3758
  },
3759
+ async media(artifactId, mediaOptions) {
3760
+ const read = await readVersion(artifactId, mediaOptions.version ?? "latest");
3761
+ if (!read)
3762
+ return null;
3763
+ const { version } = read;
3764
+ const file = version.files.find((candidate) => candidate.path === mediaOptions.path);
3765
+ if (!file || !isMediaFile2(file)) {
3766
+ throw invalidArtifact(`Version ${version.version} of '${artifactId}' holds no video or sound at '${mediaOptions.path}'.`);
3767
+ }
3768
+ const storage = requireStorage();
3769
+ const media = { version: version.version, path: file.path, file: file.file };
3770
+ const [kept] = await storage.listMedia({
3771
+ projectId: runtime.projectId,
3772
+ digests: [file.file.digest]
3773
+ });
3774
+ if (!options.rendersInSandboxes) {
3775
+ const reason = "This project has no sandboxes to derive it in.";
3776
+ const lacking = { status: "unavailable", reason, lacks: "sandboxes" };
3777
+ return { ...media, parts: kept?.parts ?? unmadeMediaParts2(() => lacking) };
3778
+ }
3779
+ const context = mediaContext(storage);
3780
+ if (kept && mediaOptions.retry) {
3781
+ return { ...media, parts: await retryArtifactMedia(context, kept, file.file) };
3782
+ }
3783
+ if (kept && mediaOptions.derive === false)
3784
+ return { ...media, parts: kept.parts };
3785
+ if (kept)
3786
+ return { ...media, parts: await refreshArtifactMedia(context, kept, file.file) };
3787
+ if (mediaOptions.derive !== false)
3788
+ await requestArtifactMedia(context, version);
3789
+ return { ...media, parts: unmadeMediaParts2(() => ({ status: "pending" })) };
3790
+ },
3791
+ async video(artifactId, videoOptions = {}) {
3792
+ const read = await readVersion(artifactId, videoOptions.version ?? "latest");
3793
+ if (!read)
3794
+ return null;
3795
+ const { version } = read;
3796
+ const { outline } = version;
3797
+ if (outline.kind !== "video") {
3798
+ throw invalidArtifact(`Version ${version.version} of '${artifactId}' is not a video, which alone renders to MP4.`);
3799
+ }
3800
+ const media = await resolveVideoMedia2(version, (id, number) => artifacts.getVersion(id, number));
3801
+ const source = { outline, files: version.files, references: version.references, media };
3802
+ const plan = videoExportPlan2(source);
3803
+ const storage = requireStorage();
3804
+ const kept = await storage.listVideoRenders({
3805
+ projectId: runtime.projectId,
3806
+ keys: videoExportKeys2(plan)
3807
+ });
3808
+ const status = videoExportStatus2(plan, kept);
3809
+ const progress = () => videoExportProgress(plan, kept);
3810
+ if (status.status === "ready") {
3811
+ const fileName = `${titleFileName2(version.title, "Video")}.mp4`;
3812
+ return {
3813
+ status: "ready",
3814
+ file: { ...status.file, fileName },
3815
+ durationMs: outline.durationMs,
3816
+ sizeBytes: status.file.sizeBytes
3817
+ };
3818
+ }
3819
+ if (status.status === "failed" && !videoOptions.retry)
3820
+ return status;
3821
+ if (videoOptions.render === false) {
3822
+ const asked = await storage.getVideoExportAsk({
3823
+ projectId: runtime.projectId,
3824
+ key: plan.key
3825
+ });
3826
+ return asked ? { status: "rendering", progress: progress() } : { status: "idle" };
3827
+ }
3828
+ if (!options.rendersInSandboxes) {
3829
+ throw new ArtifactRequestError2("video_unavailable", "[Sixb] A video renders to MP4 in sandboxes, and this project has no sandbox provider.");
3830
+ }
3831
+ const retry = status.status === "failed";
3832
+ await requestVideoExport({ storage, queue: runtime.queues.renders }, version, source, {
3833
+ plan,
3834
+ retry
3835
+ });
3836
+ return { status: "rendering", progress: progress() };
3837
+ },
3092
3838
  async query(artifactId, name, options = {}) {
3093
3839
  const read = await readVersion(artifactId, options.version ?? "latest");
3094
3840
  if (!read)
@@ -3204,6 +3950,6 @@ function notFound3(artifactId) {
3204
3950
  return new ArtifactRequestError2("artifact_not_found", `[Sixb] Artifact '${artifactId}' was not found.`);
3205
3951
  }
3206
3952
 
3207
- export { agentRunEndedShort, createAgentThreadAccessRule, assertConversationThread2, conversationThreadId2, agentThreadViews, announceArtifactUpdates, readLiveFiles2, storeLiveFiles2, sameArtifactFiles2, keepsDocument2, loadArtifactDocument2, readDocumentState2, firstArtifactDocument, withMergedWrite, undoneTurnDocuments, answerArtifactQueries2, parseArtifactQueryAnswers2, BOARD_PREVIEW_MEDIA_TYPES2, MAX_BOARD_PREVIEW_BYTES2, boardRenderKey, boardPreviewsOfCopy, boardsReadLiveData2, boardPreviews2, boardPreview2, missingBoardPreviews2, boardPreviewStatuses2, storeBoardPreviews2, MAX_DOCUMENT_PDF_BYTES2, documentPdfKey2, publishArtifact2, prepareArtifactVersion2, storeArtifactVersion2, artifactVersionWarnings2, artifactAccessRule2, artifactTransactionRules, artifactQueryChecker2, artifactPreviewRequester, writeLiveArtifact2, createRuntimeArtifactAccessRule, transactionArtifactAccessRules, updatableArtifactIds, createArtifactsRuntime };
3953
+ export { agentRunEndedShort, createAgentThreadAccessRule, assertConversationThread2, conversationThreadId2, agentThreadViews, announceArtifactUpdates, readLiveFiles2, storeLiveFiles2, sameArtifactFiles2, keepsDocument2, loadArtifactDocument2, readDocumentState2, firstArtifactDocument, withMergedWrite, undoneTurnDocuments, answerArtifactQueries2, parseArtifactQueryAnswers2, BOARD_PREVIEW_MEDIA_TYPES2, MAX_BOARD_PREVIEW_BYTES2, boardRenderKey, boardPreviewsOfCopy, boardsReadLiveData2, boardPreviews2, boardPreview2, missingBoardPreviews2, boardPreviewStatuses2, storeBoardPreviews2, MAX_DOCUMENT_PDF_BYTES2, documentPdfKey2, videoSceneFiles2, videoSoundProject2, readVideoVersion2, publishArtifact2, prepareArtifactVersion2, storeArtifactVersion2, artifactVersionWarnings2, VIDEO_ENGINE2, VIDEO_SEGMENT_SETTINGS2, VIDEO_EXPORT_JOB2, VIDEO_SEGMENT_JOB2, videoSegmentTimeoutMs2, videoExportPlan2, videoExportJobId2, videoSegmentJobId2, videoExportStatus2, videoExportKeys2, resolveVideoMedia2, VIDEO_STILLS_JOB2, VIDEO_STILL_WIDTH2, videoSceneStills2, videoStills2, videoPoster2, missingVideoStills2, artifactAccessRule2, artifactTransactionRules, artifactQueryChecker2, artifactPreviewRequester, writeLiveArtifact2, createRuntimeArtifactAccessRule, transactionArtifactAccessRules, updatableArtifactIds, createArtifactsRuntime };
3208
3954
 
3209
- //# debugId=1B316407BA72A01964756E2164756E21
3955
+ //# debugId=AE409D6B61EF8AD264756E2164756E21