@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
@@ -252,6 +252,11 @@ export interface GetArtifactInput {
252
252
  readonly id: string
253
253
  }
254
254
 
255
+ export interface ListArtifactThreadIdsInput extends GetArtifactInput {
256
+ /** Only the conversations this principal owns or takes part in; every one without it. */
257
+ readonly reader?: Principal
258
+ }
259
+
255
260
  export interface ListArtifactsInput {
256
261
  readonly projectId: string
257
262
  readonly owner?: Principal
@@ -441,18 +446,185 @@ export interface ArtifactPdfKeyInput {
441
446
  readonly renderKey: string
442
447
  }
443
448
 
449
+ /**
450
+ * What a video renders to, kept under a key that hashes what it is made of: a scene's segment of
451
+ * its export, the whole video's sound, a scene's still, or the export itself. Versions and
452
+ * artifacts that hold the same share it, so deleting an artifact keeps them. When one could not
453
+ * be made, why is kept in its place, until it is made or someone asks for it again.
454
+ */
455
+ export type ArtifactVideoRenderRecord = ArtifactVideoRenderKey & { readonly createdAt: Date } & (
456
+ | { readonly file: FileRef }
457
+ | {
458
+ /** Why it could not be made, as whoever asked for it hears it. */
459
+ readonly failure: string
460
+ /**
461
+ * What the project lacks to make it, when the video is not why: sandboxes, or the tools in
462
+ * them. Asking again makes it once the project has them, and only then.
463
+ */
464
+ readonly lacks?: ArtifactVideoRenderLack
465
+ }
466
+ )
467
+
468
+ /** What a project lacks to render a video: sandboxes, or HyperFrames as the agent image has it. */
469
+ export type ArtifactVideoRenderLack = Exclude<ArtifactMediaLack, "transcription_model">
470
+
471
+ export interface ArtifactVideoRenderKey {
472
+ readonly projectId: string
473
+ readonly key: string
474
+ }
475
+
476
+ /**
477
+ * That someone asked for a video's export, kept under the export's key: what is kept under its
478
+ * other keys may have been rendered for another video, made in part the same.
479
+ */
480
+ export interface ArtifactVideoExportAskRecord extends ArtifactVideoRenderKey {
481
+ readonly askedAt: Date
482
+ }
483
+
484
+ export interface ListArtifactVideoRendersInput {
485
+ readonly projectId: string
486
+ readonly keys: readonly string[]
487
+ }
488
+
489
+ /**
490
+ * What Sixb derives once from a video or a sound, kept under the digest of its bytes: every file
491
+ * that holds them, in any version of any artifact, shares it. Each part is ready, still to come,
492
+ * or says why it will not come, so a poster can be ready while the proxy failed.
493
+ */
494
+ export interface ArtifactMediaRecord {
495
+ readonly projectId: string
496
+ /** The digest of the original's bytes, as its `FileRef` names it. */
497
+ readonly digest: string
498
+ readonly parts: ArtifactMediaParts
499
+ /**
500
+ * How many times the render worker has tried to derive what is pending since it was last asked
501
+ * for: 0 once `retry`, or a project that now has what a part lacked, asks again.
502
+ */
503
+ readonly attempts: number
504
+ readonly updatedAt: Date
505
+ }
506
+
507
+ export interface ArtifactMediaParts {
508
+ /** What the file holds. */
509
+ readonly probe: ArtifactMediaPart<ArtifactMediaProbe>
510
+ /**
511
+ * What plays in its place: for a video, H.264 with its shorter side at most 720 pixels and a
512
+ * keyframe every half second, so it scrubs; for a sound, AAC, only when browsers cannot play
513
+ * the original.
514
+ */
515
+ readonly proxy: ArtifactMediaPart<{ readonly file: FileRef }>
516
+ /** A JPEG of a representative moment, not a black first frame. */
517
+ readonly poster: ArtifactMediaPart<{ readonly file: FileRef; readonly atMs: number }>
518
+ readonly filmstrip: ArtifactMediaPart<ArtifactMediaFilmstrip>
519
+ /** The sound's peaks, as JSON: `{ peaksPerSecond, peaks }`, each from 0 to 100. */
520
+ readonly waveform: ArtifactMediaPart<{ readonly file: FileRef }>
521
+ /** Where the picture cuts to another shot. */
522
+ readonly cuts: ArtifactMediaPart<{ readonly atMs: readonly number[] }>
523
+ /**
524
+ * What is said, as JSON: `{ text, language?, words?, segments? }`, timed in milliseconds as the
525
+ * project's transcription model timed it.
526
+ */
527
+ readonly transcript: ArtifactMediaPart<{
528
+ readonly file: FileRef
529
+ readonly language?: string
530
+ }>
531
+ }
532
+
533
+ export type ArtifactMediaPartName = keyof ArtifactMediaParts
534
+
535
+ /**
536
+ * One part of what is derived from a media. `unavailable` is no error: it does not apply, as a
537
+ * sound's poster, or the project lacks what makes it, as `lacks` says.
538
+ */
539
+ export type ArtifactMediaPart<T extends object> =
540
+ | { readonly status: "pending" }
541
+ | ({ readonly status: "ready" } & T)
542
+ | {
543
+ readonly status: "unavailable"
544
+ readonly reason: string
545
+ /**
546
+ * What the project lacks to make it, when the media is not why: it is made once the project
547
+ * has it, asked with `retry`, and a transcript on the next read once the project has a
548
+ * transcription model.
549
+ */
550
+ readonly lacks?: ArtifactMediaLack
551
+ }
552
+ | { readonly status: "failed"; readonly reason: string }
553
+
554
+ /**
555
+ * What a project lacks to derive a part: sandboxes, the tools in them (Node.js and FFmpeg, as the
556
+ * agent image has them), or a transcription model.
557
+ */
558
+ export type ArtifactMediaLack = "sandboxes" | "sandbox_tools" | "transcription_model"
559
+
560
+ /** What a media file holds: its streams are absent when it has none. */
561
+ export interface ArtifactMediaProbe {
562
+ readonly durationMs: number
563
+ /** Its container, as FFmpeg names it, such as `mov,mp4,m4a,3gp,3g2,mj2`. */
564
+ readonly container: string
565
+ readonly bitRate?: number
566
+ /**
567
+ * For an MP4 or a MOV: whether its index comes before its data, so it plays before it has
568
+ * arrived whole.
569
+ */
570
+ readonly faststart?: boolean
571
+ readonly video?: {
572
+ readonly codec: string
573
+ /** As it shows, once turned by `rotation`. */
574
+ readonly width: number
575
+ readonly height: number
576
+ /** Degrees clockwise the picture is turned to show, as the file says. */
577
+ readonly rotation: number
578
+ readonly fps?: number
579
+ }
580
+ readonly audio?: {
581
+ readonly codec: string
582
+ readonly sampleRate?: number
583
+ readonly channels?: number
584
+ }
585
+ }
586
+
587
+ /** Thumbnails of a video at a regular interval, in rows of one JPEG, the first at 0. */
588
+ export interface ArtifactMediaFilmstrip {
589
+ readonly file: FileRef
590
+ readonly intervalMs: number
591
+ readonly count: number
592
+ readonly columns: number
593
+ /** One thumbnail's size in pixels. */
594
+ readonly width: number
595
+ readonly height: number
596
+ }
597
+
598
+ export interface ListArtifactMediaInput {
599
+ readonly projectId: string
600
+ readonly digests: readonly string[]
601
+ }
602
+
444
603
  /**
445
604
  * What a comment is about: a canvas's board, an element of it by its address, as
446
- * `boardElements` writes one, or the artifact itself, at the revision the author saw.
605
+ * `boardElements` writes one, an instant of a video and the scene it plays, or the artifact
606
+ * itself, at the revision the author saw.
447
607
  */
448
608
  export interface ArtifactCommentAnchor {
449
609
  readonly board?: string
450
610
  readonly element?: string
451
- /** The element's first words, which name it once it is gone. */
611
+ /** The element's first words, or the video scene's label: what names it once it is gone. */
452
612
  readonly label?: string
453
613
  /**
454
- * Where on the board its pin is, as fractions of the board's width and height from its top left:
455
- * where its author clicked.
614
+ * A video's instant that plays no scene, between two or past the last, in milliseconds from its
615
+ * start. An instant within a scene is kept as `offset` into it instead.
616
+ */
617
+ readonly at?: number
618
+ /** The id of the video's scene it is about. */
619
+ readonly scene?: string
620
+ /**
621
+ * How far into `scene` its instant is, in milliseconds: it follows the scene wherever a later
622
+ * version moves it, and stops at its end once it is shorter.
623
+ */
624
+ readonly offset?: number
625
+ /**
626
+ * Where its pin is, as fractions of the width and height from the top left: where its author
627
+ * clicked, on the board, or on the video's frame at its instant.
456
628
  */
457
629
  readonly point?: { readonly x: number; readonly y: number }
458
630
  readonly revision: number
@@ -565,9 +737,9 @@ export interface ArtifactStorage {
565
737
  listVersions(input: ListArtifactVersionsInput): Promise<ListArtifactVersionsResult>
566
738
  /**
567
739
  * The threads the artifact is shared in, by id: each one it was written from, and the one it was
568
- * copied for.
740
+ * copied for. With a reader, only theirs or those they take part in, found from their side.
569
741
  */
570
- listThreadIds(input: GetArtifactInput): Promise<string[]>
742
+ listThreadIds(input: ListArtifactThreadIdsInput): Promise<string[]>
571
743
  /**
572
744
  * Copies an artifact with every version under its number, frozen or open as it is, each without
573
745
  * its origin, as a new artifact shared in `threadId` for as long as it lasts: a fork's copy,
@@ -618,6 +790,27 @@ export interface ArtifactStorage {
618
790
  putPdf(input: ArtifactPdfRecord): Promise<void>
619
791
  /** Forgets why the PDF under a render key could not be printed. A PDF kept there stays. */
620
792
  clearPdfFailure(input: ArtifactPdfKeyInput): Promise<void>
793
+ /** What a video rendered to under these keys, or why it could not, by key; one without is left out. */
794
+ listVideoRenders(input: ListArtifactVideoRendersInput): Promise<ArtifactVideoRenderRecord[]>
795
+ /**
796
+ * Keeps what a video rendered to, or why it could not, under its key. A file replaces a
797
+ * failure; anything else already kept there stays: the key names what it is made of. Deleting an
798
+ * artifact keeps them.
799
+ */
800
+ putVideoRender(input: ArtifactVideoRenderRecord): Promise<void>
801
+ /** Forgets why each render under these keys could not be made. A file kept there stays. */
802
+ clearVideoRenderFailures(input: ListArtifactVideoRendersInput): Promise<void>
803
+ /** When someone first asked for the export under this key; null when no one has. */
804
+ getVideoExportAsk(input: ArtifactVideoRenderKey): Promise<ArtifactVideoExportAskRecord | null>
805
+ /** Keeps that someone asked for the export under its key. The first ask stays. */
806
+ putVideoExportAsk(input: ArtifactVideoExportAskRecord): Promise<void>
807
+ /** What is derived of the media under these digests, by digest; one without any is left out. */
808
+ listMedia(input: ListArtifactMediaInput): Promise<ArtifactMediaRecord[]>
809
+ /**
810
+ * Keeps what is derived of a media under its digest, in place of what was kept there. Deleting
811
+ * an artifact keeps it: other files may hold the same bytes.
812
+ */
813
+ putMedia(input: ArtifactMediaRecord): Promise<void>
621
814
  /**
622
815
  * Adds a comment, or a reply to one. Throws `artifact_not_found`; `comment_not_found` when
623
816
  * `parentId` names no comment of the artifact, or a reply; and `artifact_comments_full` past
@@ -1,6 +1,6 @@
1
1
  import { isDeepStrictEqual } from "node:util"
2
2
  import { normalizeRequesterGroupIds, snapshotRequesterGroupIds } from "../../auth/attribution"
3
- import { kernelOperationId } from "../../execution/kernel-operation"
3
+ import { isKernelOperationType, kernelOperationId } from "../../execution/kernel-operation"
4
4
  import { isScriptPath } from "../../execution/script"
5
5
  import type {
6
6
  AuthorizablePrincipal,
@@ -458,7 +458,7 @@ function assertPrincipal(principal: AuthorizablePrincipal, label: string): void
458
458
  }
459
459
 
460
460
  function assertKernelOperation(operation: KernelOperation, label: string): void {
461
- if (operation.type !== "ontology.recover" && operation.type !== "ontology.indexVectors") {
461
+ if (!isKernelOperationType(operation.type)) {
462
462
  invalid(`${label} has unsupported type '${String((operation as { type?: unknown }).type)}'.`)
463
463
  }
464
464
  assertNonBlank(kernelOperationId(operation), `${label} operation id`)
@@ -91,7 +91,7 @@ export class InMemoryStorage implements Storage {
91
91
  shareSessions: this.shareSessionStorage,
92
92
  })
93
93
  private readonly agentStorage = new InMemoryAgentStorage(this.executionStorage)
94
- private readonly artifactStorage = new InMemoryArtifactStorage()
94
+ private readonly artifactStorage = new InMemoryArtifactStorage(this.agentStorage)
95
95
  private readonly aiUsageStorage = new InMemoryAiUsageStorage(this.executionStorage)
96
96
  private readonly aiCostStorage = new InMemoryAiCostStorage(this.aiUsageStorage, {
97
97
  resolve: (input) => this.resolveAiAccountingAttribution(input),
@@ -10,7 +10,7 @@ export type { SealedConnectorCredential } from "../connectors/credentials"
10
10
  export type { MergeChange } from "../datasets/changes"
11
11
  export type { SixbFailure } from "../errors/types"
12
12
  export type { StoredRuleResolvedEvent, StoredRuleTriggeredEvent } from "../events"
13
- export type { ReadonlyJsonObject } from "../json"
13
+ export type { ReadonlyJsonObject, ReadonlyJsonValue } from "../json"
14
14
  export { stableJsonStringify } from "../json"
15
15
  export type { DatasetRow } from "../lake-storage/types"
16
16
  export type {
@@ -170,6 +170,7 @@ export type {
170
170
  ListAgentRunsInput,
171
171
  ListAgentRunsResult,
172
172
  ListAgentThreadChildrenInput,
173
+ ListAgentThreadIdsByArtifactContextInput,
173
174
  ListAgentThreadParticipantsInput,
174
175
  ListAgentThreadReadsInput,
175
176
  ListAgentThreadsInput,
@@ -294,6 +295,8 @@ export type {
294
295
  export { AiLimitStorageError, aiLimitCalendarMonth, InMemoryAiLimitStorage } from "./ai-limits"
295
296
  export type {
296
297
  AiModelCallFilesRecord,
298
+ AiModelCallOperationRecord,
299
+ AiModelCallOperationStatus,
297
300
  AiModelCallUsage,
298
301
  AiModelCallUsageInput,
299
302
  AiModelCallUsageRecord,
@@ -301,13 +304,17 @@ export type {
301
304
  AiUsageReportingStatus,
302
305
  AiUsageStorage,
303
306
  AiUsageStorageErrorCode,
307
+ CreateAiModelCallOperationInput,
304
308
  GetAiModelCallFilesInput,
305
309
  GetLatestAiModelCallForExecutionInput,
306
310
  InMemoryAiUsageGroupRow,
307
311
  InMemoryAiUsageStorageSnapshot,
308
312
  RecordAiModelCallFilesInput,
309
313
  RecordAiModelCallInput,
314
+ RecordAiModelCallOperationResultInput,
310
315
  RecordAiModelCallResult,
316
+ SettleAiModelCallOperationInput,
317
+ StartAiModelCallOperationInput,
311
318
  SummarizeAiUsageExecutionInput,
312
319
  SummarizeAiUsageExecutionsInput,
313
320
  } from "./ai-usage"
@@ -326,6 +333,13 @@ export type {
326
333
  ArtifactGuest,
327
334
  ArtifactKind,
328
335
  ArtifactLatestVersion,
336
+ ArtifactMediaFilmstrip,
337
+ ArtifactMediaLack,
338
+ ArtifactMediaPart,
339
+ ArtifactMediaPartName,
340
+ ArtifactMediaParts,
341
+ ArtifactMediaProbe,
342
+ ArtifactMediaRecord,
329
343
  ArtifactOrigin,
330
344
  ArtifactOutline,
331
345
  ArtifactPdfKeyInput,
@@ -345,6 +359,10 @@ export type {
345
359
  ArtifactTurnWriteRecord,
346
360
  ArtifactVersionInput,
347
361
  ArtifactVersionRecord,
362
+ ArtifactVideoExportAskRecord,
363
+ ArtifactVideoRenderKey,
364
+ ArtifactVideoRenderLack,
365
+ ArtifactVideoRenderRecord,
348
366
  CopyArtifactInput,
349
367
  CreateArtifactCommentInput,
350
368
  CreateArtifactInput,
@@ -356,10 +374,13 @@ export type {
356
374
  GetArtifactRestorePointInput,
357
375
  GetArtifactVersionInput,
358
376
  ListArtifactBoardPreviewsInput,
377
+ ListArtifactMediaInput,
359
378
  ListArtifactsInput,
360
379
  ListArtifactsResult,
380
+ ListArtifactThreadIdsInput,
361
381
  ListArtifactVersionsInput,
362
382
  ListArtifactVersionsResult,
383
+ ListArtifactVideoRendersInput,
363
384
  ListReferencingVersionsInput,
364
385
  PublishArtifactVersionInput,
365
386
  PublishedArtifactVersion,
@@ -30,7 +30,11 @@ export {
30
30
  assertAiUsageExecutionId,
31
31
  assertSameCallExecution,
32
32
  normalizeAiModelCallFilesRecord,
33
+ normalizeAiModelCallOperation,
34
+ normalizeAiModelCallOperationResult,
33
35
  normalizeAiModelCallRecord,
36
+ normalizeAiModelCallSettlement,
37
+ normalizeAiModelCallStart,
34
38
  } from "./ai-usage/record"
35
39
  export { normalizeAiModelCallUsage } from "./ai-usage/usage"
36
40
  export {
@@ -41,12 +45,17 @@ export {
41
45
  parseArtifactBoardPreviewRow,
42
46
  parseArtifactCommentRow,
43
47
  parseArtifactFrameGrantRow,
48
+ parseArtifactMediaProbe,
49
+ parseArtifactMediaRow,
44
50
  parseArtifactPdfRow,
45
51
  parseArtifactRestorePointRow,
46
52
  parseArtifactRow,
47
53
  parseArtifactStateRow,
48
54
  parseArtifactTurnWriteRow,
49
55
  parseArtifactVersionRow,
56
+ parseArtifactVideoExportAskRow,
57
+ parseArtifactVideoRenderRow,
58
+ storedCommentAnchor,
50
59
  turnUndoable,
51
60
  } from "./artifacts/record"
52
61
  export { parseFileDownloadGrantRow } from "./file-download-grants/record"
@@ -3626,6 +3626,114 @@ export function runAgentStorageContractSuite<TStorage extends AgentStorageContra
3626
3626
  })
3627
3627
  })
3628
3628
 
3629
+ test("finds the threads whose messages carry an artifact as context, each once", async () => {
3630
+ await withStorage(async (storage) => {
3631
+ const artifact = (id: string) =>
3632
+ ({ type: "context", context: { kind: "artifact", id }, origin: "ambient" }) as const
3633
+ const say = (
3634
+ id: string,
3635
+ threadId: string,
3636
+ parts: AgentMessagePart[],
3637
+ project = projectId
3638
+ ) =>
3639
+ storage.messages.append({
3640
+ id,
3641
+ projectId: project,
3642
+ threadId,
3643
+ runId: null,
3644
+ role: "user",
3645
+ parts,
3646
+ })
3647
+
3648
+ for (const id of ["thr_b", "thr_a", "thr_other", "thr_mention"]) {
3649
+ await storage.threads.create(threadInput({ id }))
3650
+ }
3651
+ await storage.threads.create(threadInput({ id: "thr_a", projectId: otherProjectId }))
3652
+
3653
+ // Created out of id order, and carried twice in thr_b.
3654
+ await say("m1", "thr_b", [
3655
+ { type: "text", text: "Tighten the intro" },
3656
+ artifact("art_teaser"),
3657
+ ])
3658
+ await say("m2", "thr_b", [artifact("art_teaser")])
3659
+ await say("m3", "thr_a", [artifact("art_poster"), artifact("art_teaser")])
3660
+ await say("m4", "thr_other", [artifact("art_poster")])
3661
+ // Naming the artifact elsewhere is not carrying it: in text, or in an app's own state.
3662
+ await say("m5", "thr_mention", [
3663
+ { type: "text", text: '{"kind":"artifact","id":"art_teaser"}' },
3664
+ {
3665
+ type: "context",
3666
+ context: {
3667
+ kind: "app-state",
3668
+ id: "editor",
3669
+ label: "Editor",
3670
+ description: "The open editor",
3671
+ value: { kind: "artifact", id: "art_teaser" },
3672
+ },
3673
+ origin: "ambient",
3674
+ },
3675
+ ])
3676
+ await say("m6", "thr_a", [artifact("art_teaser")], otherProjectId)
3677
+
3678
+ const threadIds = (artifactId: string) =>
3679
+ storage.messages.listThreadIdsByArtifactContext({ projectId, artifactId })
3680
+ expect(await threadIds("art_teaser")).toEqual(["thr_a", "thr_b"])
3681
+ expect(await threadIds("art_poster")).toEqual(["thr_a", "thr_other"])
3682
+ expect(await threadIds("art_missing")).toEqual([])
3683
+
3684
+ // An edit rewinds thr_a past its only message that carried it.
3685
+ await storage.messages.deleteFromSeq({ projectId, threadId: "thr_a", fromSeq: 1 })
3686
+ expect(await threadIds("art_teaser")).toEqual(["thr_b"])
3687
+ })
3688
+ })
3689
+
3690
+ // Regression proof: drop the reader's condition from a provider's
3691
+ // listThreadIdsByArtifactContext; the other user's conversation is then listed to the owner.
3692
+ test("finds a reader's conversations carrying an artifact, theirs or those they take part in", async () => {
3693
+ await withStorage(async (storage) => {
3694
+ const brought = {
3695
+ type: "context",
3696
+ context: { kind: "artifact", id: "art_teaser" },
3697
+ origin: "ambient",
3698
+ } as const
3699
+
3700
+ for (const [id, ownerPrincipal] of [
3701
+ ["thr_mine", owner],
3702
+ ["thr_joined", otherUser],
3703
+ ["thr_theirs", otherUser],
3704
+ ["thr_service", serviceAccount],
3705
+ ] as const) {
3706
+ await storage.threads.create(threadInput({ id, ownerPrincipal }))
3707
+ await storage.messages.append({
3708
+ id: `msg_${id}`,
3709
+ projectId,
3710
+ threadId: id,
3711
+ runId: null,
3712
+ role: "user",
3713
+ parts: [brought],
3714
+ })
3715
+ }
3716
+ await storage.threads.addParticipants({
3717
+ projectId,
3718
+ threadId: "thr_joined",
3719
+ principals: [{ type: "user", id: owner.id }],
3720
+ addedBy: otherUser,
3721
+ maxParticipants: 10,
3722
+ })
3723
+
3724
+ const threadIds = (reader?: Principal) =>
3725
+ storage.messages.listThreadIdsByArtifactContext({
3726
+ projectId,
3727
+ artifactId: "art_teaser",
3728
+ ...(reader ? { reader } : {}),
3729
+ })
3730
+ expect(await threadIds()).toEqual(["thr_joined", "thr_mine", "thr_service", "thr_theirs"])
3731
+ expect(await threadIds(owner)).toEqual(["thr_joined", "thr_mine"])
3732
+ expect(await threadIds(otherUser)).toEqual(["thr_joined", "thr_theirs"])
3733
+ expect(await threadIds(serviceAccount)).toEqual(["thr_service"])
3734
+ })
3735
+ })
3736
+
3629
3737
  test("rejects appends to missing threads, duplicate messages, and unknown runs", async () => {
3630
3738
  await withStorage(async (storage) => {
3631
3739
  await expectAgentError(
@@ -255,6 +255,7 @@ export function runAiCostStorageContractSuite<TStorage extends AiCostStorage>(
255
255
  audioOutputTokens: 0,
256
256
  outputImages: 0,
257
257
  inputCharacters: 0,
258
+ outputVideoMs: 0,
258
259
  },
259
260
  },
260
261
  costs: {
@@ -1,6 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test"
2
2
  import type { FileRef } from "../blob-storage/types"
3
3
  import {
4
+ type AiModelCallOperationRecord,
4
5
  type AiUsageStorage,
5
6
  AiUsageStorageError,
6
7
  type RecordAiModelCallInput,
@@ -119,7 +120,7 @@ export function runAiUsageStorageContractSuite<TStorage extends AiUsageStorage>(
119
120
  })
120
121
  // Removal proof: omit a media count from a row codec, or 'speech' from a storage migration's
121
122
  // model_kind check; the round trip or the write fails.
122
- test("persists generated-media usage and the speech kind", async () => {
123
+ test("persists generated-media usage and the speech and video kinds", async () => {
123
124
  await withStorage(async (storage) => {
124
125
  const latest = () =>
125
126
  storage.getLatestForExecution({ projectId, executionId: agentExecutionId })
@@ -160,6 +161,22 @@ export function runAiUsageStorageContractSuite<TStorage extends AiUsageStorage>(
160
161
  outputImages: 1,
161
162
  reportingStatus: "complete",
162
163
  })
164
+
165
+ await storage.recordModelCall(
166
+ modelCallInput({
167
+ id: "usage_video",
168
+ callId: "call_video",
169
+ responseId: "response_video",
170
+ modelKind: "video",
171
+ usage: { outputVideoMs: 4000 },
172
+ occurredAt: at("2026-06-23T10:02:00.000Z"),
173
+ })
174
+ )
175
+ expect((await latest())?.modelKind).toBe("video")
176
+ expect((await latest())?.usage).toEqual({
177
+ outputVideoMs: 4000,
178
+ reportingStatus: "partial",
179
+ })
163
180
  })
164
181
  })
165
182
  test("retains native provider IDs across reads and replay", async () => {
@@ -705,6 +722,133 @@ export function runAiUsageStorageContractSuite<TStorage extends AiUsageStorage>(
705
722
  expect(await storage.getModelCallFiles({ projectId, callId: "call_image" })).toBeNull()
706
723
  })
707
724
  })
725
+
726
+ // Removal proof: drop `operation IS NULL` from a provider's start update, or `result IS NULL`
727
+ // from its result update; the second call replaces the first value.
728
+ test("keeps a running call's operation until its first settlement", async () => {
729
+ await withStorage(async (storage) => {
730
+ const input = {
731
+ projectId,
732
+ callId: "call_video",
733
+ executionId: agentExecutionId,
734
+ attempt: 1,
735
+ modelKind: "video" as const,
736
+ providerId: "vercel-ai-gateway",
737
+ modelId: "google/veo-3.1-fast-generate-001",
738
+ request: { durationSeconds: 4 },
739
+ reserved: true,
740
+ createdAt: at("2026-06-23T10:00:00.000Z"),
741
+ }
742
+ const created: AiModelCallOperationRecord = { ...input, status: "pending" }
743
+ expect(await storage.createModelCallOperation(input)).toEqual(created)
744
+
745
+ const duplicate = await storage.createModelCallOperation(input).catch((error) => error)
746
+ expect(duplicate).toMatchObject({ code: "duplicate_id" })
747
+
748
+ // The provider accepted the call: its handle and what it said of the request.
749
+ const start = {
750
+ projectId,
751
+ callId: "call_video",
752
+ operation: { gatewayJobId: "job_1", nested: [1, "two", null] },
753
+ request: { durationSeconds: 4, dimensions: { resolution: "720p" } },
754
+ }
755
+ const pending: AiModelCallOperationRecord = {
756
+ ...created,
757
+ operation: start.operation,
758
+ request: start.request,
759
+ }
760
+ expect(await storage.startModelCallOperation(start)).toEqual(pending)
761
+ expect(
762
+ await storage.startModelCallOperation({ ...start, operation: "job_2", request: {} })
763
+ ).toEqual(pending)
764
+ expect(await storage.getModelCallOperation({ projectId, callId: "call_video" })).toEqual(
765
+ pending
766
+ )
767
+ expect(await storage.startModelCallOperation({ ...start, callId: "call_other" })).toBeNull()
768
+
769
+ // Its result, kept once it is in the ledger, before its files are stored.
770
+ const result = { usage: { outputVideoMs: 0 }, cost: { status: "reported" } }
771
+ const recorded: AiModelCallOperationRecord = { ...pending, result }
772
+ const keep = { projectId, callId: "call_video", result }
773
+ expect(await storage.recordModelCallOperationResult(keep)).toEqual(recorded)
774
+ expect(
775
+ await storage.recordModelCallOperationResult({ ...keep, result: { other: true } })
776
+ ).toEqual(recorded)
777
+ expect(
778
+ await storage.recordModelCallOperationResult({ ...keep, callId: "call_other" })
779
+ ).toBeNull()
780
+
781
+ const failed: AiModelCallOperationRecord = {
782
+ ...pending,
783
+ status: "failed",
784
+ error: "The provider refused the prompt.",
785
+ result,
786
+ settledAt: at("2026-06-23T10:01:00.000Z"),
787
+ }
788
+ expect(
789
+ await storage.settleModelCallOperation({
790
+ projectId,
791
+ callId: "call_video",
792
+ status: "failed",
793
+ error: "The provider refused the prompt.",
794
+ result,
795
+ settledAt: at("2026-06-23T10:01:00.000Z"),
796
+ })
797
+ ).toEqual(failed)
798
+
799
+ // A second poller that saw it complete keeps the first outcome.
800
+ expect(
801
+ await storage.settleModelCallOperation({
802
+ projectId,
803
+ callId: "call_video",
804
+ status: "completed",
805
+ result: {},
806
+ settledAt: at("2026-06-23T10:02:00.000Z"),
807
+ })
808
+ ).toEqual(failed)
809
+ expect(await storage.getModelCallOperation({ projectId, callId: "call_video" })).toEqual(
810
+ failed
811
+ )
812
+
813
+ expect(
814
+ await storage.settleModelCallOperation({
815
+ projectId,
816
+ callId: "call_other",
817
+ status: "failed",
818
+ result: {},
819
+ })
820
+ ).toBeNull()
821
+ expect(
822
+ await storage.getModelCallOperation({ projectId: "other-project", callId: "call_video" })
823
+ ).toBeNull()
824
+ })
825
+ })
826
+
827
+ test("refuses an operation without a known execution or a JSON request", async () => {
828
+ await withStorage(async (storage) => {
829
+ const input = {
830
+ projectId,
831
+ callId: "call_video",
832
+ executionId: agentExecutionId,
833
+ attempt: 1,
834
+ modelKind: "video" as const,
835
+ providerId: "vercel-ai-gateway",
836
+ modelId: "google/veo-3.1-fast-generate-001",
837
+ request: {},
838
+ reserved: false,
839
+ }
840
+ const missing = await storage
841
+ .createModelCallOperation({ ...input, executionId: "exec_missing" })
842
+ .catch((error) => error)
843
+ expect(missing).toMatchObject({ code: "missing_execution" })
844
+
845
+ const invalid = await storage
846
+ .createModelCallOperation({ ...input, request: [] as never })
847
+ .catch((error) => error)
848
+ expect(invalid).toBeInstanceOf(TypeError)
849
+ expect(await storage.getModelCallOperation({ projectId, callId: "call_video" })).toBeNull()
850
+ })
851
+ })
708
852
  })
709
853
  }
710
854