@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
@@ -8,11 +8,10 @@ import {
8
8
  } from "./chunk-7j4yydm2.js";
9
9
  import {
10
10
  canonicalMediaType2,
11
- isFileRef2,
12
11
  isValidFileRef,
13
12
  supportsDirectUpload2,
14
13
  supportsRangeRead2
15
- } from "./chunk-wkv3h3q7.js";
14
+ } from "./chunk-2138b0ng.js";
16
15
  import {
17
16
  withFailureMessage2
18
17
  } from "./chunk-6eqsgvxk.js";
@@ -35,11 +34,11 @@ import {
35
34
  normalizeLinkProperties2,
36
35
  validateLinkProperties2,
37
36
  assertTelemetryProperty2
38
- } from "./chunk-7mhbs9yy.js";
37
+ } from "./chunk-1z8ccj53.js";
39
38
  import {
40
39
  isObjectRefSchema2,
41
40
  validateSchemaOrRefValue2
42
- } from "./chunk-brybqw5k.js";
41
+ } from "./chunk-bkxm2dzx.js";
43
42
  import {
44
43
  ActionDefinitionError2,
45
44
  missingActionMutationMessage,
@@ -60,7 +59,7 @@ import {
60
59
  createUsersRuntime,
61
60
  SYSTEM_PRINCIPAL2,
62
61
  principalsEqual2
63
- } from "./chunk-394zjzjs.js";
62
+ } from "./chunk-nhgqz3g3.js";
64
63
  import {
65
64
  ActionValidationError2,
66
65
  SIXB_ERROR_CODES2,
@@ -97,7 +96,7 @@ import {
97
96
  canViewProjectionRun2,
98
97
  canViewPrimitiveRun2,
99
98
  canViewProjection2
100
- } from "./chunk-tapdssb5.js";
99
+ } from "./chunk-e3b1r4d2.js";
101
100
  import {
102
101
  compileSelectedObjectReadScope2
103
102
  } from "./chunk-rt9deb92.js";
@@ -107,7 +106,7 @@ import {
107
106
  resolveAgentExecutionAuthorization2,
108
107
  userCanRunAgent2,
109
108
  resolveInheritedAgentExecutionAuthorization2
110
- } from "./chunk-5sswe5ej.js";
109
+ } from "./chunk-wsv23wvr.js";
111
110
  import {
112
111
  ACTION_RUN_FAILURE_CODES2,
113
112
  parseActionRunFailure2
@@ -115,12 +114,8 @@ import {
115
114
  import {
116
115
  isModelReasoning2,
117
116
  modelReasoningSupportIssue2
118
- } from "./chunk-az95tsh3.js";
117
+ } from "./chunk-0fjryajn.js";
119
118
  import {
120
- TranscriptionModelResponseError2,
121
- SpeechModelResponseError2,
122
- assertTranscriptionModel,
123
- assertSpeechModel,
124
119
  assertDecisionContent,
125
120
  assertDecisionQuestions,
126
121
  assertDecisionModel,
@@ -128,6 +123,7 @@ import {
128
123
  supportsQuestion,
129
124
  validateDecisionAnswers,
130
125
  assertImageModel,
126
+ assertVideoModel,
131
127
  LANGUAGE_MODEL_TIERS2,
132
128
  isLanguageModelTier2,
133
129
  selectLanguageModel2,
@@ -136,7 +132,7 @@ import {
136
132
  question2,
137
133
  ImageModelResponseError2,
138
134
  estimateModelCall
139
- } from "./chunk-qttqe1ah.js";
135
+ } from "./chunk-jbg905hn.js";
140
136
  import {
141
137
  AgentStorageError2,
142
138
  createAgentThreadId2,
@@ -151,7 +147,7 @@ import {
151
147
  runPlaceKey2,
152
148
  isAgentApprovalMode2,
153
149
  agentApprovalHoldsRun2
154
- } from "./chunk-5pz3htbe.js";
150
+ } from "./chunk-y57eawng.js";
155
151
  import {
156
152
  canonicalLocale,
157
153
  canonicalTimeZone2
@@ -160,10 +156,10 @@ import {
160
156
  actionRunRequestsEqual,
161
157
  ObjectNotFoundError2,
162
158
  ArtifactStorageError
163
- } from "./chunk-88xeh6zx.js";
159
+ } from "./chunk-1g4me5f2.js";
164
160
  import {
165
161
  ExecutionStorageError2
166
- } from "./chunk-c29729me.js";
162
+ } from "./chunk-4z9xtxke.js";
167
163
  import {
168
164
  objectRefKey2,
169
165
  linkRefKey2,
@@ -174,10 +170,10 @@ import {
174
170
  objectBatchKey2,
175
171
  matchesPredicate,
176
172
  WORKFLOW_RUN_FAILURE_CODES2
177
- } from "./chunk-06kpaqg4.js";
173
+ } from "./chunk-3d9w8t4n.js";
178
174
  import {
179
175
  explainObjectQuery2
180
- } from "./chunk-js9e6487.js";
176
+ } from "./chunk-9p7kyeqz.js";
181
177
  import {
182
178
  redactDomainEvent,
183
179
  uniqueLookupKeyOf,
@@ -187,7 +183,7 @@ import {
187
183
  readerClearance,
188
184
  readerEventClearance,
189
185
  readerViewConditions
190
- } from "./chunk-6md802cc.js";
186
+ } from "./chunk-9az7kjv4.js";
191
187
  import {
192
188
  agentRunEndedShort,
193
189
  createAgentThreadAccessRule,
@@ -200,7 +196,7 @@ import {
200
196
  transactionArtifactAccessRules,
201
197
  updatableArtifactIds,
202
198
  createArtifactsRuntime
203
- } from "./chunk-hvq8xs66.js";
199
+ } from "./chunk-jwjwvzj1.js";
204
200
  import {
205
201
  shareSixbErrorReporter2,
206
202
  reportActionPhaseFailure2,
@@ -221,8 +217,10 @@ import {
221
217
  createActivityRuntime,
222
218
  createActivityCaptureRuntime,
223
219
  registerActivityCaptureRuntime,
224
- ModelExecutionSession
225
- } from "./chunk-phs5fbff.js";
220
+ prepareModelInputFile,
221
+ readModelInputFile,
222
+ createAudioRuntime
223
+ } from "./chunk-990a5bkc.js";
226
224
  import {
227
225
  publishAgentThreadMoved2,
228
226
  publishAgentApprovalActivity,
@@ -235,37 +233,48 @@ import {
235
233
  applicableAiLimitPolicyStatuses2,
236
234
  aiUsageLimitExceededError2,
237
235
  aiUsageLimitUnavailableError2
238
- } from "./chunk-5qqmndhm.js";
236
+ } from "./chunk-szzhrn3e.js";
239
237
  import {
240
238
  normalizeAgentContextEntries2
241
- } from "./chunk-sgx82nnt.js";
239
+ } from "./chunk-xg31er4p.js";
242
240
  import {
243
- createFileDownloadUrl,
244
- revokeFileDownloadUrl
245
- } from "./chunk-8ncg20rd.js";
241
+ createFileDownloadUrl2,
242
+ revokeFileDownloadUrl2
243
+ } from "./chunk-yah25st6.js";
246
244
  import {
247
245
  registerConnectorConnectionsRuntime
248
246
  } from "./chunk-0pmpwn3g.js";
249
247
  import {
250
248
  createConnectorRuntime
251
- } from "./chunk-n1hbwc6y.js";
249
+ } from "./chunk-t6pfch4e.js";
252
250
  import {
253
251
  DatasetValidationError2
254
- } from "./chunk-wx7smkn2.js";
252
+ } from "./chunk-fq8drkp0.js";
255
253
  import {
256
254
  lakeDatasetDefinition2,
257
255
  validateDatasetMergeChanges2
258
- } from "./chunk-ppxf7gw2.js";
256
+ } from "./chunk-d7t9jnym.js";
259
257
  import {
260
258
  datasetDefinitionHash,
261
259
  tryEnqueueIngestFlush
262
- } from "./chunk-191jz8a6.js";
260
+ } from "./chunk-ff0qdk7z.js";
263
261
  import {
264
262
  AI_MODEL_CALL_OUTPUT_TOKEN_ALLOWANCE,
265
263
  aiModelCallOutputTokenAllowance,
266
264
  ModelUsageRecordingError2,
267
- LanguageModelCallMeter
268
- } from "./chunk-mrs7jy17.js";
265
+ LanguageModelCallMeter,
266
+ ModelExecutionSession
267
+ } from "./chunk-ywvxcmqj.js";
268
+ import {
269
+ resolveLanguageModel2,
270
+ checkVideoOperation,
271
+ storedVideoRequest,
272
+ storedVideoResult,
273
+ scheduleVideoCheck,
274
+ abandonVideoOperation,
275
+ resolveVideoModel,
276
+ isWarnings
277
+ } from "./chunk-5278qwax.js";
269
278
  import {
270
279
  createLinkScopeFingerprint2,
271
280
  normalizeJsonProperties2,
@@ -275,7 +284,7 @@ import {
275
284
  resolveEffectiveLink,
276
285
  resolveEffectiveLinkSlotMember,
277
286
  linkCardinality
278
- } from "./chunk-cpy282b8.js";
287
+ } from "./chunk-4w8qzy9w.js";
279
288
  import {
280
289
  createSyncConnections,
281
290
  mayRunConnection,
@@ -283,7 +292,7 @@ import {
283
292
  seesConnection,
284
293
  SyncValidationError2,
285
294
  requestSyncRun2
286
- } from "./chunk-04r2fdsd.js";
295
+ } from "./chunk-x0hqc54n.js";
287
296
  import {
288
297
  resolveLoggingService2
289
298
  } from "./chunk-1vg43g9q.js";
@@ -293,10 +302,10 @@ import {
293
302
  } from "./chunk-m427qgq0.js";
294
303
  import {
295
304
  compileShareAccessPlan
296
- } from "./chunk-qbd282aa.js";
305
+ } from "./chunk-39q9ybav.js";
297
306
  import {
298
307
  requestPipelineRun2
299
- } from "./chunk-pfdq1ga6.js";
308
+ } from "./chunk-8eqqqc1h.js";
300
309
  import {
301
310
  PipelineError2
302
311
  } from "./chunk-hke9aeen.js";
@@ -304,20 +313,21 @@ import {
304
313
  createObjectQueryBuilder2,
305
314
  decorateObjectQueryExecutor
306
315
  } from "./chunk-80nh73br.js";
316
+ import {
317
+ backoffDelay2,
318
+ waitUnlessAborted2
319
+ } from "./chunk-mwcqz3e3.js";
307
320
  import {
308
321
  SandboxError2,
309
322
  sandboxCredentialIssue2,
310
323
  staticSandboxRecipe2
311
- } from "./chunk-t58sktr5.js";
324
+ } from "./chunk-wrb1x1ss.js";
312
325
  import {
313
326
  executionRecordInputFromRuntime,
314
327
  ensureExecutionRecord2,
315
328
  createPrimitiveExecutionRecord,
316
329
  restoreTrustedPrimitiveExecutionScope
317
- } from "./chunk-xavet0qs.js";
318
- import {
319
- resolveLanguageModel2
320
- } from "./chunk-3723kgba.js";
330
+ } from "./chunk-6whr25gw.js";
321
331
  import {
322
332
  schemaRecordToJsonSchema2
323
333
  } from "./chunk-0kgrghqx.js";
@@ -331,7 +341,7 @@ import {
331
341
  } from "./chunk-d9xbwh3h.js";
332
342
  import {
333
343
  getDatasetPrimaryKeyColumns2
334
- } from "./chunk-w3t94hm6.js";
344
+ } from "./chunk-qk3zq25v.js";
335
345
  import {
336
346
  LakeValueRefusedError2
337
347
  } from "./chunk-hgj98cbb.js";
@@ -346,7 +356,7 @@ import {
346
356
  AI_USAGE_FIELDS,
347
357
  normalizeAiModelCallUsage2,
348
358
  aggregateAiModelCallUsage2
349
- } from "./chunk-xtztwpkh.js";
359
+ } from "./chunk-v6h4tc2v.js";
350
360
  import {
351
361
  RuntimeError2
352
362
  } from "./chunk-m4ehq95f.js";
@@ -361,7 +371,7 @@ import {
361
371
  } from "./chunk-0k1h5hmr.js";
362
372
  import {
363
373
  normalizeParams
364
- } from "./chunk-3neam1y5.js";
374
+ } from "./chunk-y3qb965a.js";
365
375
  import {
366
376
  MaterializationValidationError2,
367
377
  MaterializationObjectNotFoundError2,
@@ -390,7 +400,7 @@ import {
390
400
  resolveFileRefAtPath2,
391
401
  openFileRef2,
392
402
  jsonPointerSegment2
393
- } from "./chunk-a3faa34j.js";
403
+ } from "./chunk-nfjt8k8j.js";
394
404
  import {
395
405
  isJsonValue2,
396
406
  assertJsonValue2,
@@ -689,6 +699,32 @@ class ActionRegistry2 {
689
699
  return null;
690
700
  }
691
701
  }
702
+ // src/artifacts/caller.ts
703
+ var callerArtifactsKey = Symbol("sixb.callerArtifacts");
704
+ function registerCallerArtifacts(owner, artifacts) {
705
+ const registered = owner[callerArtifactsKey];
706
+ if (registered && registered !== artifacts) {
707
+ throw new Error("[Sixb] The caller's artifacts are already registered for this owner.");
708
+ }
709
+ Object.defineProperty(owner, callerArtifactsKey, {
710
+ configurable: false,
711
+ enumerable: true,
712
+ value: artifacts,
713
+ writable: false
714
+ });
715
+ }
716
+ function getCallerArtifacts(owner) {
717
+ const artifacts = owner[callerArtifactsKey];
718
+ if (artifacts)
719
+ return artifacts;
720
+ throw new Error("[Sixb] The caller's artifacts are not registered for this runtime context.");
721
+ }
722
+ function shareCallerArtifacts(source, target) {
723
+ const artifacts = source[callerArtifactsKey];
724
+ if (artifacts)
725
+ registerCallerArtifacts(target, artifacts);
726
+ }
727
+
692
728
  // src/execution/request-client.ts
693
729
  var MAX_USER_AGENT_LENGTH = 512;
694
730
  var requestClients = new WeakMap;
@@ -2600,6 +2636,12 @@ import { randomUUID as randomUUID5 } from "crypto";
2600
2636
  async function resolveAgentContextParts2(runtime, input) {
2601
2637
  const entries = normalizeAgentContextEntries2(input);
2602
2638
  for (const entry of entries) {
2639
+ if (entry.context.kind === "artifact") {
2640
+ const artifact = await getCallerArtifacts(runtime).get(entry.context.id);
2641
+ if (!artifact)
2642
+ invalidContext(`context references an unknown artifact '${entry.context.id}'`);
2643
+ continue;
2644
+ }
2603
2645
  if (entry.context.kind !== "object")
2604
2646
  continue;
2605
2647
  const { objectTypeId, primaryId } = entry.context.ref;
@@ -4437,6 +4479,26 @@ function createAgentRuntime(runtime, execution, models, decision, sandbox, secur
4437
4479
  const views = await agentThreadViews(runtime, result.threads);
4438
4480
  return { ...result, threads: await withThreadState(views, readViewer()) };
4439
4481
  },
4482
+ listForArtifact: async (artifactId) => {
4483
+ if (!await getCallerArtifacts(runtime).get(artifactId))
4484
+ return null;
4485
+ const scope = rule.scope();
4486
+ if (scope === "none")
4487
+ return [];
4488
+ const projectId = runtime.projectId;
4489
+ const reader = scope === "every" ? {} : { reader: scope.reader };
4490
+ const [shared, carried] = await Promise.all([
4491
+ runtime.storage.artifacts?.listThreadIds({ projectId, id: artifactId, ...reader }) ?? [],
4492
+ runtime.storage.agents?.messages.listThreadIdsByArtifactContext({
4493
+ projectId,
4494
+ artifactId,
4495
+ ...reader
4496
+ }) ?? []
4497
+ ]);
4498
+ const readable = await rule.readConversations([...shared, ...carried]);
4499
+ const threads = readable.map(({ thread }) => thread).sort((left, right) => right.updatedAt.getTime() - left.updatedAt.getTime() || (left.id < right.id ? 1 : -1));
4500
+ return withThreadState(threads, readViewer());
4501
+ },
4440
4502
  participants: {
4441
4503
  add: (threadId, users) => addAgentThreadParticipants(runtime, rule, security, threadId, users),
4442
4504
  remove: (threadId, user) => removeAgentThreadParticipant(runtime, rule, threadId, user)
@@ -4768,11 +4830,11 @@ function createBlobsRuntime(runtime, execution, blobStorage, apiPublicOrigin) {
4768
4830
  },
4769
4831
  createDownloadUrl: async (file, options) => {
4770
4832
  assertAccess();
4771
- return createFileDownloadUrl(downloadUrlContext(), file, options);
4833
+ return createFileDownloadUrl2(downloadUrlContext(), file, options);
4772
4834
  },
4773
4835
  revokeDownloadUrl: async (id) => {
4774
4836
  assertAccess();
4775
- return revokeFileDownloadUrl(downloadUrlContext(), id);
4837
+ return revokeFileDownloadUrl2(downloadUrlContext(), id);
4776
4838
  }
4777
4839
  };
4778
4840
  if (supportsRangeRead2(blobStorage)) {
@@ -6545,11 +6607,54 @@ async function recordDecision(accounting, model, callId, metadata) {
6545
6607
  }
6546
6608
 
6547
6609
  // src/models/execution.ts
6548
- import { randomUUID as randomUUID13 } from "crypto";
6610
+ import { randomUUID as randomUUID12 } from "crypto";
6549
6611
 
6550
6612
  // src/agents/model-loop.ts
6551
6613
  import { randomUUID as randomUUID9 } from "crypto";
6552
6614
 
6615
+ // src/agents/model-call-retry.ts
6616
+ var MODEL_CALL_RETRY = {
6617
+ retries: 4,
6618
+ initialMs: 1000,
6619
+ maxMs: 8000
6620
+ };
6621
+ var CONNECTION_LOST_CODES = new Set([
6622
+ "ECONNREFUSED",
6623
+ "ECONNRESET",
6624
+ "ECONNABORTED",
6625
+ "EPIPE",
6626
+ "ETIMEDOUT",
6627
+ "EAI_AGAIN",
6628
+ "EHOSTUNREACH",
6629
+ "ENETUNREACH",
6630
+ "ConnectionRefused",
6631
+ "ConnectionClosed",
6632
+ "FailedToOpenSocket",
6633
+ "UND_ERR_SOCKET",
6634
+ "UND_ERR_CONNECT_TIMEOUT",
6635
+ "UND_ERR_HEADERS_TIMEOUT",
6636
+ "UND_ERR_BODY_TIMEOUT"
6637
+ ]);
6638
+ function lostConnectionCode(error) {
6639
+ const code = errorCode(error) ?? (error instanceof TypeError ? errorCode(error.cause) : undefined);
6640
+ return code !== undefined && CONNECTION_LOST_CODES.has(code) ? code : undefined;
6641
+ }
6642
+ function modelCallInterrupted(error) {
6643
+ if (lostConnectionCode(error) !== undefined)
6644
+ return true;
6645
+ return error instanceof ModelProviderError2 && error.reason === "interrupted";
6646
+ }
6647
+ function modelCallRetryDelay(retry) {
6648
+ const ceiling = backoffDelay2(retry, MODEL_CALL_RETRY);
6649
+ return Math.round(ceiling / 2 + Math.random() * ceiling / 2);
6650
+ }
6651
+ function errorCode(error) {
6652
+ if (typeof error !== "object" || error === null)
6653
+ return;
6654
+ const code = Reflect.get(error, "code");
6655
+ return typeof code === "string" ? code : undefined;
6656
+ }
6657
+
6553
6658
  // src/agents/tool-input-coercion.ts
6554
6659
  function coerceToolInput(schema, input) {
6555
6660
  return coerce(schema, input);
@@ -6703,7 +6808,9 @@ async function runModelLoop2(input) {
6703
6808
  let callId;
6704
6809
  let cost;
6705
6810
  let completed;
6706
- for (let attempt = 0;; attempt += 1) {
6811
+ let recoveryAsked = false;
6812
+ let retries = 0;
6813
+ for (;; ) {
6707
6814
  callId = generateCallId();
6708
6815
  if (!callId || callIds.has(callId)) {
6709
6816
  throw new ModelStreamError2(`[SixbModels] Model call IDs must be nonempty and unique.`);
@@ -6721,11 +6828,23 @@ async function runModelLoop2(input) {
6721
6828
  if (call.aborted) {
6722
6829
  return { status: "aborted", steps, partialContent: accumulator.partialContent() };
6723
6830
  }
6831
+ if (call.failure?.interrupted && retries < MODEL_CALL_RETRY.retries) {
6832
+ const delayMs = modelCallRetryDelay(retries);
6833
+ retries += 1;
6834
+ console.warn(`[SixbModels] Model call '${callId}' was interrupted; asking again in ${delayMs} ms.`, call.failure.error);
6835
+ if (accumulator.streamed)
6836
+ await input.onEvent?.({ type: "start-step", retry: true });
6837
+ await waitUnlessAborted2(delayMs, input.signal);
6838
+ if (input.signal.aborted)
6839
+ return { status: "aborted", steps, partialContent: [] };
6840
+ continue;
6841
+ }
6724
6842
  const finished = call.failure && !accumulator.isFinished() ? undefined : accumulator.complete();
6725
6843
  const failure = call.failure ?? (finished?.finishReason === "length" && finished.contextWindowExceeded ? {
6726
6844
  error: new ModelProviderError2("[SixbModels] The answer filled the model's context window.", input.model.providerId, input.model.modelId, { reason: "context-window-exceeded" })
6727
6845
  } : undefined);
6728
- if (failure && attempt === 0 && input.recoverStep) {
6846
+ if (failure && !recoveryAsked && input.recoverStep) {
6847
+ recoveryAsked = true;
6729
6848
  let recovered;
6730
6849
  try {
6731
6850
  recovered = await input.recoverStep({
@@ -6833,7 +6952,7 @@ async function runModelLoop2(input) {
6833
6952
  const output = responseText(response);
6834
6953
  return { status: "completed", output, steps, finishReason: response.finishReason };
6835
6954
  }
6836
- const toolResults = await Promise.all(localCalls.map((call) => executeToolCall(call, tools, callId, input.signal, input.onEvent)));
6955
+ const toolResults = await executeToolCalls(localCalls, (call) => tools.get(call.part.toolName)?.readOnly === true, (call) => executeToolCall(call, tools, callId, input.signal, input.onEvent));
6837
6956
  const step = modelStep(response, responseId, [...response.content, ...toolResults], cost);
6838
6957
  steps.push(step);
6839
6958
  await input.onStepEnd?.(step);
@@ -6901,10 +7020,12 @@ async function callModel(input, call) {
6901
7020
  } catch (error) {
6902
7021
  if (error instanceof ModelUsageRecordingError2)
6903
7022
  throw error;
6904
- if (input.signal.aborted || isAbortError2(error))
7023
+ if (input.signal.aborted || isAbortError2(error)) {
6905
7024
  cancelled = true;
6906
- else
6907
- failure = { error };
7025
+ } else {
7026
+ const interrupted = !accumulator.readerFailed && modelCallInterrupted(error);
7027
+ failure = { error, interrupted };
7028
+ }
6908
7029
  } finally {
6909
7030
  if (accepted)
6910
7031
  cost = accumulator.meter.end({ model: input.model, callId: call.callId }).cost;
@@ -6985,8 +7106,33 @@ function modelStep(response, responseId, content, cost) {
6985
7106
  ...response.route === undefined ? {} : { route: response.route }
6986
7107
  };
6987
7108
  }
7109
+ async function executeToolCalls(calls, readOnly, execute) {
7110
+ const results = [];
7111
+ let reads = [];
7112
+ for (const call of calls) {
7113
+ if (readOnly(call)) {
7114
+ reads.push(call);
7115
+ continue;
7116
+ }
7117
+ results.push(...await Promise.all(reads.map(execute)));
7118
+ reads = [];
7119
+ results.push(await execute(call));
7120
+ }
7121
+ results.push(...await Promise.all(reads.map(execute)));
7122
+ return results;
7123
+ }
6988
7124
  async function executeToolCall(call, tools, callId, signal, onEvent) {
6989
7125
  const { part } = call;
7126
+ if (signal.aborted) {
7127
+ const errorText = "The run stopped before this call started.";
7128
+ await onEvent?.({
7129
+ type: "tool-output-error",
7130
+ toolCallId: part.toolCallId,
7131
+ toolName: part.toolName,
7132
+ errorText
7133
+ });
7134
+ return toolErrorResult(part, errorText);
7135
+ }
6990
7136
  if (call.inputError) {
6991
7137
  const errorText = `Tool input is not valid JSON: ${call.inputError.message}`;
6992
7138
  await onEvent?.({
@@ -7106,6 +7252,7 @@ class StreamAccumulator {
7106
7252
  rawFinishReason;
7107
7253
  contextWindowExceeded = false;
7108
7254
  streamed = false;
7255
+ readerFailed = false;
7109
7256
  meter = new LanguageModelCallMeter;
7110
7257
  projectionError;
7111
7258
  constructor(reader) {
@@ -7113,7 +7260,12 @@ class StreamAccumulator {
7113
7260
  }
7114
7261
  async onEvent(chunk) {
7115
7262
  this.streamed = true;
7116
- await this.reader?.(chunk);
7263
+ try {
7264
+ await this.reader?.(chunk);
7265
+ } catch (error) {
7266
+ this.readerFailed = true;
7267
+ throw error;
7268
+ }
7117
7269
  }
7118
7270
  isFinished() {
7119
7271
  return this.finished;
@@ -7500,389 +7652,27 @@ function isAbortError2(error) {
7500
7652
  return error instanceof DOMException && error.name === "AbortError" || error instanceof Error && error.name === "AbortError";
7501
7653
  }
7502
7654
 
7503
- // src/models/audio/runtime.ts
7504
- import { randomUUID as randomUUID11 } from "crypto";
7505
-
7506
- // src/models/input-file.ts
7507
- import { createHash } from "crypto";
7508
- function prepareModelInputFile(input, type) {
7509
- if (!isFileRef2(input) || !Number.isSafeInteger(input.sizeBytes) || input.sizeBytes <= 0) {
7510
- throw new TypeError(`[SixbModels] ${capitalize(type)} input must be a nonempty FileRef.`);
7511
- }
7512
- const file = { ...input };
7513
- const mediaType = modelInputMediaType(file.mediaType, type);
7514
- if (!mediaType) {
7515
- throw new TypeError(`[SixbModels] ${capitalize(type)} FileRef must declare an ${type} mediaType.`);
7516
- }
7517
- return { file, mediaType };
7518
- }
7519
- function prepareModelInputBytes(input, type) {
7520
- if (!(input.data instanceof Uint8Array) || input.data.byteLength === 0) {
7521
- throw new TypeError(`[SixbModels] ${capitalize(type)} data must be a nonempty Uint8Array.`);
7522
- }
7523
- const mediaType = modelInputMediaType(input.mediaType, type);
7524
- if (!mediaType) {
7525
- throw new TypeError(`[SixbModels] ${capitalize(type)} data must declare an ${type} mediaType.`);
7526
- }
7527
- return { bytes: input.data.slice(), mediaType };
7528
- }
7529
- function modelInputMediaType(value, type) {
7530
- if (typeof value !== "string")
7531
- return;
7532
- const mediaType = value.split(";", 1)[0]?.trim().toLowerCase();
7533
- return mediaType && new RegExp(`^${type}/[a-z0-9.+-]+$`).test(mediaType) ? mediaType : undefined;
7534
- }
7535
- function capitalize(type) {
7536
- return type === "audio" ? "Audio" : "Image";
7537
- }
7538
- async function readModelInputFile(storage, file, signal) {
7539
- const info = await storage.stat(file.blobId);
7540
- signal.throwIfAborted();
7541
- if (!info || info.blobId !== file.blobId || info.digest !== file.digest || info.sizeBytes !== file.sizeBytes) {
7542
- throw new Error("[SixbModels] File reference does not match the stored file.");
7543
- }
7544
- const stream = await storage.open(file.blobId);
7545
- const reader = stream.getReader();
7546
- const cancel = () => {
7547
- reader.cancel(signal.reason).catch(() => {
7548
- return;
7549
- });
7550
- };
7551
- signal.addEventListener("abort", cancel, { once: true });
7552
- let complete = false;
7553
- try {
7554
- signal.throwIfAborted();
7555
- const bytes = new Uint8Array(file.sizeBytes);
7556
- const hash = createHash("sha256");
7557
- let offset = 0;
7558
- while (true) {
7559
- const { value, done } = await reader.read();
7560
- signal.throwIfAborted();
7561
- if (done)
7562
- break;
7563
- if (!(value instanceof Uint8Array) || value.byteLength > bytes.byteLength - offset) {
7564
- throw new Error("[SixbModels] File stream exceeds its declared size.");
7565
- }
7566
- bytes.set(value, offset);
7567
- hash.update(value);
7568
- offset += value.byteLength;
7569
- }
7570
- if (offset !== file.sizeBytes || `sha256:${hash.digest("hex")}` !== file.digest) {
7571
- throw new Error("[SixbModels] File stream does not match its content-addressed reference.");
7572
- }
7573
- complete = true;
7574
- return bytes;
7575
- } finally {
7576
- signal.removeEventListener("abort", cancel);
7577
- if (!complete) {
7578
- reader.cancel().catch(() => {
7579
- return;
7580
- });
7581
- }
7582
- reader.releaseLock();
7583
- }
7584
- }
7585
-
7586
- // src/models/audio/speech.ts
7587
- import { randomUUID as randomUUID10 } from "crypto";
7588
- function createSpeak(runtime, execution, catalog, session, blobs) {
7589
- return async (input) => {
7590
- assertModelAccess2(runtime, execution, "models.audio.speak");
7591
- const prepared = prepareRequest(input);
7592
- if (!blobs) {
7593
- throw new Error("[SixbModels] Speech generation requires blob storage.");
7594
- }
7595
- const signal = session.signal(input.signal);
7596
- signal.throwIfAborted();
7597
- const binding = selectModel(catalog, input.model);
7598
- assertSpeechModel(binding);
7599
- assertRequestSupport(binding, withVoice(binding, prepared));
7600
- const accounting = await session.accounting();
7601
- accounting.assertHealthy();
7602
- const model = binding.resolve ? await binding.resolve() : binding;
7603
- assertSpeechModel(model);
7604
- if (model.providerId !== binding.providerId || model.modelId !== binding.modelId) {
7605
- throw new TypeError("[SixbModels] Resolved speech model identity does not match the selected model.");
7606
- }
7607
- const request = withVoice(model, prepared);
7608
- assertRequestSupport(model, request);
7609
- signal.throwIfAborted();
7610
- const callId = `call_${randomUUID10()}`;
7611
- await accounting.admitCall({
7612
- callId,
7613
- providerId: model.providerId,
7614
- modelId: model.modelId,
7615
- modelKind: "speech",
7616
- inputTokens: {
7617
- status: "estimated",
7618
- tokens: Math.ceil(new TextEncoder().encode(request.text).byteLength / 4),
7619
- method: "utf8BytesDividedByFour"
7620
- },
7621
- outputTokenAllowance: 0,
7622
- reservationCost: estimateReservationCost(model, {
7623
- text: request.text,
7624
- ...request.voice === undefined ? {} : { voice: request.voice },
7625
- ...request.instructions === undefined ? {} : { instructions: request.instructions }
7626
- })
7627
- });
7628
- let result;
7629
- try {
7630
- signal.throwIfAborted();
7631
- result = await model.speak({ ...request, signal });
7632
- } catch (error) {
7633
- await recordSpeech(accounting, model, callId, error instanceof SpeechModelResponseError2 ? error.metadata : {});
7634
- throw error;
7635
- }
7636
- const event = await recordSpeech(accounting, model, callId, result ?? {});
7637
- signal.throwIfAborted();
7638
- const audio = result?.output?.audio;
7639
- if (!(audio?.data instanceof Uint8Array) || audio.data.byteLength === 0 || typeof audio.mediaType !== "string" || !/^audio\/[a-z0-9.+-]+$/.test(audio.mediaType) || request.mediaType !== undefined && audio.mediaType !== request.mediaType || !isWarnings(result.warnings)) {
7640
- throw new SpeechModelResponseError2("[SixbModels] Invalid speech response.", model.providerId, model.modelId, result ?? {});
7641
- }
7642
- const file = await blobs.put({
7643
- body: audio.data,
7644
- expectedSizeBytes: audio.data.byteLength,
7645
- mediaType: audio.mediaType,
7646
- signal
7647
- });
7648
- await accounting.recordFiles(callId, [file]);
7649
- return {
7650
- file,
7651
- warnings: [...result.warnings ?? []],
7652
- usage: event.usage,
7653
- cost: event.cost,
7654
- callId
7655
- };
7656
- };
7657
- }
7658
- function prepareRequest(input) {
7659
- if (typeof input?.text !== "string" || !input.text.trim()) {
7660
- throw new TypeError("[SixbModels] Speech generation requires nonblank text.");
7661
- }
7662
- for (const field of ["voice", "instructions", "language"]) {
7663
- const value = input[field];
7664
- if (value !== undefined && (typeof value !== "string" || !value.trim())) {
7665
- throw new TypeError(`[SixbModels] Speech ${field} must be a nonblank string.`);
7666
- }
7667
- }
7668
- const mediaType = input.mediaType?.split(";", 1)[0]?.trim().toLowerCase();
7669
- if (input.mediaType !== undefined && !/^audio\/[a-z0-9.+-]+$/.test(mediaType ?? "")) {
7670
- throw new TypeError("[SixbModels] Speech mediaType must be an audio media type.");
7671
- }
7672
- if (input.speed !== undefined && (typeof input.speed !== "number" || !Number.isFinite(input.speed) || input.speed <= 0)) {
7673
- throw new TypeError("[SixbModels] Speech speed must be a positive number.");
7674
- }
7675
- return {
7676
- text: input.text,
7677
- ...input.voice === undefined ? {} : { voice: input.voice },
7678
- ...input.instructions === undefined ? {} : { instructions: input.instructions },
7679
- ...mediaType === undefined ? {} : { mediaType },
7680
- ...input.speed === undefined ? {} : { speed: input.speed },
7681
- ...input.language === undefined ? {} : { language: input.language }
7682
- };
7683
- }
7684
- function withVoice(model, request) {
7685
- const voice = request.voice ?? model.defaultVoice;
7686
- return voice === undefined ? request : { ...request, voice };
7687
- }
7688
- function selectModel(catalog, requested) {
7689
- const selected = requested ?? catalog?.audio?.speech?.default.model;
7690
- if (!selected) {
7691
- throw new Error("[SixbModels] Configure models.audio.speech in createSixb() or supply a model to speak().");
7692
- }
7693
- return selected;
7694
- }
7695
- function assertRequestSupport(model, request) {
7696
- const definition = model.definition;
7697
- if (definition.maxInputCharacters !== undefined && request.text.length > definition.maxInputCharacters) {
7698
- throw new RangeError(`[SixbModels] Text exceeds the model's ${definition.maxInputCharacters}-character input limit.`);
7699
- }
7700
- if (request.voice !== undefined && definition.voices && !definition.voices.includes(request.voice)) {
7701
- throw new TypeError(`[SixbModels] Voice '${request.voice}' is not supported by the selected model. Use one of: ${definition.voices.join(", ")}.`);
7702
- }
7703
- if (request.mediaType !== undefined && definition.outputMediaTypes && !definition.outputMediaTypes.includes(request.mediaType)) {
7704
- throw new TypeError(`[SixbModels] Speech media type '${request.mediaType}' is not supported by the selected model. Use one of: ${definition.outputMediaTypes.join(", ")}.`);
7705
- }
7706
- if (request.instructions !== undefined && definition.instructions === false) {
7707
- throw new TypeError("[SixbModels] The selected model does not take speech instructions.");
7708
- }
7709
- }
7710
- function estimateReservationCost(model, input) {
7711
- try {
7712
- return model.costEstimator?.estimateReservation?.(input);
7713
- } catch {
7714
- return;
7715
- }
7716
- }
7717
- async function recordSpeech(accounting, model, callId, metadata) {
7718
- const usage = metadata.usage ?? {};
7719
- const estimate = estimateModelCall(model, {
7720
- usage,
7721
- route: metadata.route,
7722
- responseModelId: metadata.responseModelId,
7723
- ...metadata.pricingDimensions === undefined ? {} : { dimensions: metadata.pricingDimensions }
7724
- });
7725
- const event = {
7726
- callId,
7727
- modelKind: "speech",
7728
- providerId: model.providerId,
7729
- modelId: model.modelId,
7730
- responseId: metadata.providerIds?.responseId ?? callId,
7731
- providerIds: metadata.providerIds,
7732
- responseModelId: metadata.responseModelId,
7733
- usage,
7734
- cost: metadata.reportedCost ? { status: "reported", ...metadata.reportedCost } : estimate,
7735
- ...metadata.reportedCost ? { estimate } : {},
7736
- route: metadata.route
7737
- };
7738
- await accounting.onModelCallEnd(event);
7739
- return event;
7740
- }
7741
- function isWarnings(value) {
7742
- return value === undefined || Array.isArray(value) && value.every((w) => typeof w === "string");
7743
- }
7744
-
7745
- // src/models/audio/runtime.ts
7746
- function createAudioRuntime(runtime, execution, catalog, session, blobs) {
7655
+ // src/models/calls.ts
7656
+ var MAX_SUBAGENT_DEPTH = 32;
7657
+ function createModelCallsRuntime(runtime, runs, executionId) {
7658
+ const canReadCallsOf = createModelCallVisibility(runtime, runs, executionId);
7747
7659
  return {
7748
- speak: createSpeak(runtime, execution, catalog, session, blobs),
7749
- async transcribe(input) {
7750
- assertModelAccess2(runtime, execution, "models.audio.transcribe");
7751
- const { mediaType, sizeBytes, read } = prepareAudio(input.audio, blobs);
7752
- const signal = session.signal(input.signal);
7753
- signal.throwIfAborted();
7754
- const binding = selectModel2(catalog, input.model);
7755
- assertTranscriptionModel(binding);
7756
- assertFileSupport(binding, sizeBytes, mediaType);
7757
- const accounting = await session.accounting();
7758
- accounting.assertHealthy();
7759
- const model = binding.resolve ? await binding.resolve() : binding;
7760
- assertTranscriptionModel(model);
7761
- if (model.providerId !== binding.providerId || model.modelId !== binding.modelId) {
7762
- throw new TypeError("[SixbModels] Resolved transcription model identity does not match the selected model.");
7660
+ async files(callId) {
7661
+ if (typeof callId !== "string" || !callId.trim()) {
7662
+ throw new TypeError("[SixbModels] A model call ID must be a nonblank string.");
7763
7663
  }
7764
- assertFileSupport(model, sizeBytes, mediaType);
7765
- signal.throwIfAborted();
7766
- const bytes = await read(signal);
7767
- accounting.assertHealthy();
7768
- const reservationCost = estimateReservationCost2(model, bytes.byteLength, mediaType);
7769
- const callId = `call_${randomUUID11()}`;
7770
- await accounting.admitCall({
7771
- callId,
7772
- providerId: model.providerId,
7773
- modelId: model.modelId,
7774
- modelKind: "transcription",
7775
- inputTokens: { status: "unavailable", reason: "nonTextInput" },
7776
- outputTokenAllowance: 0,
7777
- reservationCost
7664
+ const record = await runtime.storage.aiUsage?.getModelCallFiles({
7665
+ projectId: runtime.projectId,
7666
+ callId
7778
7667
  });
7779
- let result;
7780
- try {
7781
- signal.throwIfAborted();
7782
- result = await model.transcribe({ audio: bytes, mediaType, signal });
7783
- } catch (error) {
7784
- await recordTranscription(accounting, model, callId, error instanceof TranscriptionModelResponseError2 ? error.metadata : {});
7785
- throw error;
7786
- }
7787
- const event = await recordTranscription(accounting, model, callId, result ?? {});
7788
- signal.throwIfAborted();
7789
- const output = transcriptOutput(result, model);
7790
- return { output, usage: event.usage, cost: event.cost, callId };
7791
- }
7792
- };
7793
- }
7794
- function transcriptOutput(result, model) {
7795
- const refuse = () => new TranscriptionModelResponseError2("[SixbModels] Invalid transcription response.", model.providerId, model.modelId, result ?? {});
7796
- const output = result?.output;
7797
- if (typeof output?.text !== "string")
7798
- throw refuse();
7799
- const words = output.words;
7800
- if (words === undefined)
7801
- return { text: output.text };
7802
- if (!Array.isArray(words))
7803
- throw refuse();
7804
- const timed = [];
7805
- for (const word of words) {
7806
- const entry = word;
7807
- if (typeof entry?.text !== "string" || !entry.text || !isMillisecond(entry.startMs) || !isMillisecond(entry.endMs) || entry.endMs < entry.startMs || entry.speaker !== undefined && (typeof entry.speaker !== "string" || !entry.speaker)) {
7808
- throw refuse();
7809
- }
7810
- timed.push({
7811
- text: entry.text,
7812
- startMs: entry.startMs,
7813
- endMs: entry.endMs,
7814
- ...entry.speaker === undefined ? {} : { speaker: entry.speaker }
7815
- });
7816
- }
7817
- return timed.length ? { text: output.text, words: timed } : { text: output.text };
7818
- }
7819
- function isMillisecond(value) {
7820
- return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
7821
- }
7822
- function prepareAudio(input, blobs) {
7823
- if (typeof input === "object" && input !== null && "data" in input) {
7824
- const { bytes, mediaType } = prepareModelInputBytes(input, "audio");
7825
- return { mediaType, sizeBytes: bytes.byteLength, read: async () => bytes };
7826
- }
7827
- const { file, mediaType } = prepareModelInputFile(input, "audio");
7828
- if (!blobs) {
7829
- throw new Error("[SixbModels] Transcribing a stored file requires blob storage.");
7830
- }
7831
- return {
7832
- mediaType,
7833
- sizeBytes: file.sizeBytes,
7834
- read: (signal) => readModelInputFile(blobs, file, signal)
7835
- };
7836
- }
7837
- function selectModel2(catalog, requested) {
7838
- const selected = requested ?? catalog?.audio?.transcription?.default.model;
7839
- if (!selected) {
7840
- throw new Error("[SixbModels] Configure models.audio.transcription in createSixb() or supply a model to transcribe().");
7841
- }
7842
- return selected;
7843
- }
7844
- function assertFileSupport(model, sizeBytes, mediaType) {
7845
- if (sizeBytes > model.definition.maxInputBytes) {
7846
- throw new RangeError(`[SixbModels] Audio exceeds the model's ${model.definition.maxInputBytes}-byte input limit.`);
7847
- }
7848
- if (model.definition.mediaTypes && !model.definition.mediaTypes.includes(mediaType)) {
7849
- throw new TypeError(`[SixbModels] Audio media type '${mediaType}' is not supported by the selected model.`);
7850
- }
7851
- }
7852
- function estimateReservationCost2(model, sizeBytes, mediaType) {
7853
- try {
7854
- return model.costEstimator?.estimateReservation?.({ sizeBytes, mediaType });
7855
- } catch {
7856
- return;
7857
- }
7858
- }
7859
- async function recordTranscription(accounting, model, callId, metadata) {
7860
- const usage = metadata.usage ?? {};
7861
- const estimate = estimateModelCall(model, {
7862
- usage,
7863
- route: metadata.route,
7864
- responseModelId: metadata.responseModelId
7865
- });
7866
- const event = {
7867
- callId,
7868
- modelKind: "transcription",
7869
- providerId: model.providerId,
7870
- modelId: model.modelId,
7871
- responseId: metadata.providerIds?.responseId ?? callId,
7872
- providerIds: metadata.providerIds,
7873
- responseModelId: metadata.responseModelId,
7874
- usage,
7875
- cost: metadata.reportedCost ? { status: "reported", ...metadata.reportedCost } : estimate,
7876
- ...metadata.reportedCost ? { estimate } : {},
7877
- route: metadata.route
7668
+ if (!record)
7669
+ return null;
7670
+ const visible = { callId: record.callId, files: record.files, recordedAt: record.recordedAt };
7671
+ return await canReadCallsOf(record.executionId) ? visible : null;
7672
+ }
7878
7673
  };
7879
- await accounting.onModelCallEnd(event);
7880
- return event;
7881
7674
  }
7882
-
7883
- // src/models/calls.ts
7884
- var MAX_SUBAGENT_DEPTH = 32;
7885
- function createModelCallsRuntime(runtime, runs, executionId) {
7675
+ function createModelCallVisibility(runtime, runs, executionId) {
7886
7676
  const projectId = runtime.projectId;
7887
7677
  async function canRead(execution) {
7888
7678
  const authority = resolveRuntimeAuthorizationForProject(runtime);
@@ -7921,41 +7711,29 @@ function createModelCallsRuntime(runtime, runs, executionId) {
7921
7711
  }
7922
7712
  return false;
7923
7713
  }
7924
- return {
7925
- async files(callId) {
7926
- if (typeof callId !== "string" || !callId.trim()) {
7927
- throw new TypeError("[SixbModels] A model call ID must be a nonblank string.");
7928
- }
7929
- const record = await runtime.storage.aiUsage?.getModelCallFiles({ projectId, callId });
7930
- if (!record)
7931
- return null;
7932
- const visible = { callId: record.callId, files: record.files, recordedAt: record.recordedAt };
7933
- if (record.executionId === executionId)
7934
- return visible;
7935
- const execution = await runtime.storage.executions.getById({
7936
- projectId,
7937
- id: record.executionId
7938
- });
7939
- return execution && await canRead(execution) ? visible : null;
7940
- }
7714
+ return async (callExecutionId) => {
7715
+ if (callExecutionId === executionId)
7716
+ return true;
7717
+ const execution = await runtime.storage.executions.getById({ projectId, id: callExecutionId });
7718
+ return execution !== null && await canRead(execution);
7941
7719
  };
7942
7720
  }
7943
7721
 
7944
7722
  // src/models/image/runtime.ts
7945
- import { randomUUID as randomUUID12 } from "crypto";
7723
+ import { randomUUID as randomUUID10 } from "crypto";
7946
7724
  function createImageRuntime(runtime, execution, catalog, session, blobs) {
7947
7725
  return {
7948
7726
  async generate(input) {
7949
7727
  assertModelAccess2(runtime, execution, "models.image.generate");
7950
- const request = prepareRequest2(input);
7728
+ const request = prepareRequest(input);
7951
7729
  if (!blobs) {
7952
7730
  throw new Error("[SixbModels] Image generation requires blob storage.");
7953
7731
  }
7954
7732
  const signal = session.signal(input.signal);
7955
7733
  signal.throwIfAborted();
7956
- const binding = selectModel3(catalog, input.model);
7734
+ const binding = selectModel(catalog, input.model);
7957
7735
  assertImageModel(binding);
7958
- assertRequestSupport2(binding, request);
7736
+ assertRequestSupport(binding, request);
7959
7737
  const accounting = await session.accounting();
7960
7738
  accounting.assertHealthy();
7961
7739
  const model = binding.resolve ? await binding.resolve() : binding;
@@ -7963,7 +7741,7 @@ function createImageRuntime(runtime, execution, catalog, session, blobs) {
7963
7741
  if (model.providerId !== binding.providerId || model.modelId !== binding.modelId) {
7964
7742
  throw new TypeError("[SixbModels] Resolved image model identity does not match the selected model.");
7965
7743
  }
7966
- assertRequestSupport2(model, request);
7744
+ assertRequestSupport(model, request);
7967
7745
  const images = [];
7968
7746
  for (const image of request.images) {
7969
7747
  signal.throwIfAborted();
@@ -7975,7 +7753,7 @@ function createImageRuntime(runtime, execution, catalog, session, blobs) {
7975
7753
  accounting.assertHealthy();
7976
7754
  const dimensions = pricingDimensions(request);
7977
7755
  const promptTokens = Math.ceil(new TextEncoder().encode(request.prompt).byteLength / 4);
7978
- const callId = `call_${randomUUID12()}`;
7756
+ const callId = `call_${randomUUID10()}`;
7979
7757
  await accounting.admitCall({
7980
7758
  callId,
7981
7759
  providerId: model.providerId,
@@ -7983,7 +7761,7 @@ function createImageRuntime(runtime, execution, catalog, session, blobs) {
7983
7761
  modelKind: "image",
7984
7762
  inputTokens: images.length > 0 ? { status: "unavailable", reason: "nonTextInput" } : { status: "estimated", tokens: promptTokens, method: "utf8BytesDividedByFour" },
7985
7763
  outputTokenAllowance: 0,
7986
- reservationCost: estimateReservationCost3(model, {
7764
+ reservationCost: estimateReservationCost(model, {
7987
7765
  n: request.n,
7988
7766
  promptTokens,
7989
7767
  inputImages: images.length,
@@ -8034,7 +7812,7 @@ function createImageRuntime(runtime, execution, catalog, session, blobs) {
8034
7812
  }
8035
7813
  };
8036
7814
  }
8037
- function prepareRequest2(input) {
7815
+ function prepareRequest(input) {
8038
7816
  if (typeof input?.prompt !== "string" || !input.prompt.trim()) {
8039
7817
  throw new TypeError("[SixbModels] Image generation requires a nonblank prompt.");
8040
7818
  }
@@ -8065,14 +7843,14 @@ function prepareRequest2(input) {
8065
7843
  images: (input.images ?? []).map((image) => prepareModelInputFile(image, "image"))
8066
7844
  };
8067
7845
  }
8068
- function selectModel3(catalog, requested) {
7846
+ function selectModel(catalog, requested) {
8069
7847
  const selected = requested ?? catalog?.image?.default.model;
8070
7848
  if (!selected) {
8071
7849
  throw new Error("[SixbModels] Configure models.image in createSixb() or supply a model to generate().");
8072
7850
  }
8073
7851
  return selected;
8074
7852
  }
8075
- function assertRequestSupport2(model, request) {
7853
+ function assertRequestSupport(model, request) {
8076
7854
  const definition = model.definition;
8077
7855
  if (definition.maxImagesPerCall !== undefined && request.n > definition.maxImagesPerCall) {
8078
7856
  throw new RangeError(`[SixbModels] The selected model returns at most ${definition.maxImagesPerCall} images per call.`);
@@ -8113,7 +7891,7 @@ function pricingDimensions(request) {
8113
7891
  ...request.style === undefined ? {} : { style: request.style }
8114
7892
  };
8115
7893
  }
8116
- function estimateReservationCost3(model, input) {
7894
+ function estimateReservationCost(model, input) {
8117
7895
  try {
8118
7896
  return model.costEstimator?.estimateReservation?.(input);
8119
7897
  } catch {
@@ -8184,8 +7962,352 @@ function languageModelOutput(shape, valueTypesById) {
8184
7962
  };
8185
7963
  }
8186
7964
 
7965
+ // src/models/video/runtime.ts
7966
+ import { randomUUID as randomUUID11 } from "crypto";
7967
+ var POLL_INTERVAL_MS = 5000;
7968
+ var INPUT_URL_EXPIRY_MS = 60 * 60000;
7969
+ function createVideoRuntime(runtime, execution, catalog, session, dependencies) {
7970
+ const projectId = runtime.projectId;
7971
+ async function start(input) {
7972
+ assertModelAccess2(runtime, execution, "models.video.generate");
7973
+ const request = prepareRequest2(input);
7974
+ const blobs = requireBlobs(dependencies.blobs);
7975
+ const operations = requireOperationStorage(runtime.storage.aiUsage);
7976
+ const signal = session.signal(input.signal);
7977
+ signal.throwIfAborted();
7978
+ const binding = selectModel2(catalog, input.model);
7979
+ assertVideoModel(binding);
7980
+ assertRequestSupport2(binding, request);
7981
+ const accounting = await session.accounting();
7982
+ accounting.assertHealthy();
7983
+ const model = await resolveVideoModel(binding);
7984
+ assertRequestSupport2(model, request);
7985
+ const images = {
7986
+ ...request.firstFrame ? { firstFrame: await inputImage(blobs, request.firstFrame, signal) } : {},
7987
+ ...request.lastFrame ? { lastFrame: await inputImage(blobs, request.lastFrame, signal) } : {},
7988
+ referenceImages: await Promise.all(request.referenceImages.map((image) => inputImage(blobs, image, signal)))
7989
+ };
7990
+ accounting.assertHealthy();
7991
+ const imageCount = countImages(request);
7992
+ const promptTokens = Math.ceil(new TextEncoder().encode(request.prompt).byteLength / 4);
7993
+ const callId = `call_${randomUUID11()}`;
7994
+ await accounting.admitCall({
7995
+ callId,
7996
+ providerId: model.providerId,
7997
+ modelId: model.modelId,
7998
+ modelKind: "video",
7999
+ inputTokens: imageCount > 0 ? { status: "unavailable", reason: "nonTextInput" } : { status: "estimated", tokens: promptTokens, method: "utf8BytesDividedByFour" },
8000
+ outputTokenAllowance: 0,
8001
+ reservationCost: estimateReservationCost2(model, {
8002
+ n: request.n,
8003
+ ...optional("durationSeconds", request.durationSeconds),
8004
+ ...optional("resolution", request.resolution),
8005
+ ...optional("audio", request.audio),
8006
+ promptTokens,
8007
+ inputImages: imageCount
8008
+ })
8009
+ });
8010
+ const initial = {
8011
+ n: request.n,
8012
+ ...optional("durationSeconds", request.durationSeconds),
8013
+ warnings: []
8014
+ };
8015
+ let record;
8016
+ try {
8017
+ record = await operations.createModelCallOperation({
8018
+ projectId,
8019
+ callId,
8020
+ executionId: accounting.executionId,
8021
+ attempt: accounting.attempt,
8022
+ modelKind: "video",
8023
+ providerId: model.providerId,
8024
+ modelId: model.modelId,
8025
+ request: initial,
8026
+ reserved: accounting.hasReservation(callId)
8027
+ });
8028
+ } catch (error) {
8029
+ await accounting.markCallUnknown(callId);
8030
+ throw error;
8031
+ }
8032
+ let started;
8033
+ try {
8034
+ await scheduleVideoCheck(runtime.queues.agents, record);
8035
+ signal.throwIfAborted();
8036
+ started = await model.start({
8037
+ callId,
8038
+ prompt: request.prompt,
8039
+ n: request.n,
8040
+ ...optional("durationSeconds", request.durationSeconds),
8041
+ ...optional("resolution", request.resolution),
8042
+ ...optional("aspectRatio", request.aspectRatio),
8043
+ ...optional("audio", request.audio),
8044
+ ...optional("seed", request.seed),
8045
+ ...images,
8046
+ signal
8047
+ });
8048
+ if (!isStart(started)) {
8049
+ throw new ModelProviderError2("[SixbModels] Invalid video start response.", model.providerId, model.modelId, { code: "invalid_video_response", retryable: false });
8050
+ }
8051
+ } catch (error) {
8052
+ await abandonVideoOperation(operations, record, accounting, "The video could not be started.");
8053
+ throw error;
8054
+ }
8055
+ const stored = {
8056
+ ...initial,
8057
+ ...optional("dimensions", started.pricingDimensions),
8058
+ warnings: [...started.warnings ?? []]
8059
+ };
8060
+ try {
8061
+ const kept = await operations.startModelCallOperation({
8062
+ projectId,
8063
+ callId,
8064
+ operation: started.operation,
8065
+ request: stored
8066
+ });
8067
+ if (!kept)
8068
+ throw new Error(`[SixbModels] Video generation '${callId}' disappeared.`);
8069
+ record = kept;
8070
+ } catch (error) {
8071
+ await accounting.markCallUnknown(callId);
8072
+ throw new Error(`[SixbModels] Video generation '${callId}' started, but Sixb could not keep track of it.`, { cause: error });
8073
+ }
8074
+ return { generation: await generationFrom(record), model };
8075
+ }
8076
+ async function check(callId, binding, callerSignal) {
8077
+ if (typeof callId !== "string" || !callId.trim()) {
8078
+ throw new TypeError("[SixbModels] A model call ID must be a nonblank string.");
8079
+ }
8080
+ const operations = requireOperationStorage(runtime.storage.aiUsage);
8081
+ const record = await operations.getModelCallOperation({ projectId, callId });
8082
+ if (!record || record.modelKind !== "video")
8083
+ return null;
8084
+ if (!await dependencies.canReadCallsOf(record.executionId))
8085
+ return null;
8086
+ if (record.status !== "pending")
8087
+ return generationFrom(record);
8088
+ const checked = await checkVideoOperation({
8089
+ projectId,
8090
+ storage: { executions: runtime.storage.executions, aiUsage: operations },
8091
+ catalog,
8092
+ blobs: dependencies.blobs,
8093
+ accountingFor: (origin, attempt) => session.accountingFor(origin, attempt)
8094
+ }, record, { ...binding ? { binding } : {}, signal: session.signal(callerSignal) });
8095
+ return generationFrom(checked);
8096
+ }
8097
+ async function generationFrom(record) {
8098
+ const stored = storedVideoRequest(record);
8099
+ const base = {
8100
+ callId: record.callId,
8101
+ model: { providerId: record.providerId, modelId: record.modelId },
8102
+ createdAt: record.createdAt
8103
+ };
8104
+ if (record.status === "pending") {
8105
+ return { ...base, status: "pending", files: [], warnings: [...stored.warnings] };
8106
+ }
8107
+ const result = storedVideoResult(record);
8108
+ const files = record.status === "completed" ? (await runtime.storage.aiUsage?.getModelCallFiles({ projectId, callId: record.callId }))?.files ?? [] : [];
8109
+ return {
8110
+ ...base,
8111
+ status: record.status,
8112
+ files,
8113
+ warnings: [...result.warnings],
8114
+ ...optional("error", record.error),
8115
+ usage: result.usage,
8116
+ cost: result.cost
8117
+ };
8118
+ }
8119
+ async function inputImage(blobs, image, signal) {
8120
+ const origin = dependencies.apiPublicOrigin();
8121
+ if (isReachableOrigin(origin) && runtime.storage.fileDownloadGrants) {
8122
+ const download = await createFileDownloadUrl2({
8123
+ projectId,
8124
+ storage: runtime.storage,
8125
+ blobStorage: blobs,
8126
+ executionId: execution.id,
8127
+ apiPublicOrigin: origin
8128
+ }, image.file, { expiresInMs: INPUT_URL_EXPIRY_MS });
8129
+ return { url: download.url, mediaType: image.mediaType };
8130
+ }
8131
+ return { data: await readModelInputFile(blobs, image.file, signal), mediaType: image.mediaType };
8132
+ }
8133
+ return {
8134
+ async generate(input) {
8135
+ const { generation, model } = await start(input);
8136
+ let current = generation;
8137
+ while (current.status === "pending") {
8138
+ await delay(POLL_INTERVAL_MS, session.signal(input.signal));
8139
+ const next = await check(generation.callId, model, input.signal);
8140
+ if (!next) {
8141
+ throw new Error(`[SixbModels] Video generation '${generation.callId}' disappeared.`);
8142
+ }
8143
+ current = next;
8144
+ }
8145
+ if (current.status === "failed") {
8146
+ throw new ModelProviderError2(`[SixbModels] Video generation failed: ${current.error}`, model.providerId, model.modelId);
8147
+ }
8148
+ return {
8149
+ files: current.files,
8150
+ warnings: current.warnings,
8151
+ usage: current.usage ?? {},
8152
+ cost: current.cost ?? { status: "unpriceable", reason: "missing-usage" },
8153
+ callId: current.callId
8154
+ };
8155
+ },
8156
+ async start(input) {
8157
+ return (await start(input)).generation;
8158
+ },
8159
+ get(callId) {
8160
+ return check(callId);
8161
+ }
8162
+ };
8163
+ }
8164
+ function prepareRequest2(input) {
8165
+ if (typeof input?.prompt !== "string" || !input.prompt.trim()) {
8166
+ throw new TypeError("[SixbModels] Video generation requires a nonblank prompt.");
8167
+ }
8168
+ const n = input.n ?? 1;
8169
+ if (!Number.isSafeInteger(n) || n <= 0) {
8170
+ throw new TypeError("[SixbModels] Video count 'n' must be a positive safe integer.");
8171
+ }
8172
+ if (input.duration !== undefined && (!Number.isSafeInteger(input.duration) || input.duration <= 0)) {
8173
+ throw new TypeError("[SixbModels] Video duration must be a positive whole number of seconds.");
8174
+ }
8175
+ if (input.resolution !== undefined && (typeof input.resolution !== "string" || !/^[1-9]\d*x[1-9]\d*$/.test(input.resolution))) {
8176
+ throw new TypeError("[SixbModels] Video resolution must be a frame size such as '1280x720'.");
8177
+ }
8178
+ if (input.aspectRatio !== undefined && (typeof input.aspectRatio !== "string" || !input.aspectRatio.trim())) {
8179
+ throw new TypeError("[SixbModels] Video aspectRatio must be a nonblank string.");
8180
+ }
8181
+ if (input.audio !== undefined && typeof input.audio !== "boolean") {
8182
+ throw new TypeError("[SixbModels] Video audio must be a boolean.");
8183
+ }
8184
+ if (input.seed !== undefined && !Number.isSafeInteger(input.seed)) {
8185
+ throw new TypeError("[SixbModels] Video seed must be a safe integer.");
8186
+ }
8187
+ if (input.referenceImages !== undefined && !Array.isArray(input.referenceImages)) {
8188
+ throw new TypeError("[SixbModels] Reference images must be an array of FileRefs.");
8189
+ }
8190
+ return {
8191
+ prompt: input.prompt,
8192
+ n,
8193
+ ...optional("durationSeconds", input.duration),
8194
+ ...optional("resolution", input.resolution),
8195
+ ...optional("aspectRatio", input.aspectRatio),
8196
+ ...optional("audio", input.audio),
8197
+ ...optional("seed", input.seed),
8198
+ ...input.firstFrame ? { firstFrame: prepareModelInputFile(input.firstFrame, "image") } : {},
8199
+ ...input.lastFrame ? { lastFrame: prepareModelInputFile(input.lastFrame, "image") } : {},
8200
+ referenceImages: (input.referenceImages ?? []).map((image) => prepareModelInputFile(image, "image"))
8201
+ };
8202
+ }
8203
+ function selectModel2(catalog, requested) {
8204
+ const videos = catalog?.video;
8205
+ if (!videos)
8206
+ throw new Error("[SixbModels] Configure models.video in createSixb().");
8207
+ if (!requested)
8208
+ return videos.default.model;
8209
+ const ref = { provider: requested.providerId, modelId: requested.modelId };
8210
+ if (!videos.getByRef(ref)) {
8211
+ throw new Error(`[SixbModels] Video model '${ref.provider}/${ref.modelId}' is not in models.video: list it in createSixb() to generate with it.`);
8212
+ }
8213
+ return requested;
8214
+ }
8215
+ function assertRequestSupport2(model, request) {
8216
+ const definition = model.definition;
8217
+ if (definition.maxVideosPerCall !== undefined && request.n > definition.maxVideosPerCall) {
8218
+ throw new RangeError(`[SixbModels] The selected model returns at most ${definition.maxVideosPerCall} videos per call.`);
8219
+ }
8220
+ for (const [field, list] of [
8221
+ ["resolution", definition.resolutions],
8222
+ ["aspectRatio", definition.aspectRatios]
8223
+ ]) {
8224
+ const value = request[field];
8225
+ if (value !== undefined && list && !list.includes(value)) {
8226
+ throw new TypeError(`[SixbModels] Video ${field} '${value}' is not supported by the selected model. Use one of: ${list.join(", ")}.`);
8227
+ }
8228
+ }
8229
+ const durations = definition.durations;
8230
+ if (request.durationSeconds !== undefined && durations && !durations.includes(request.durationSeconds)) {
8231
+ throw new TypeError(`[SixbModels] A ${request.durationSeconds}-second video is not supported by the selected model. Use one of: ${durations.join(", ")} seconds.`);
8232
+ }
8233
+ if (request.audio === true && definition.audio === false) {
8234
+ throw new TypeError("[SixbModels] The selected model makes videos without sound.");
8235
+ }
8236
+ const images = [
8237
+ ...request.firstFrame ? [request.firstFrame] : [],
8238
+ ...request.lastFrame ? [request.lastFrame] : [],
8239
+ ...request.referenceImages
8240
+ ];
8241
+ if (images.length === 0)
8242
+ return;
8243
+ const accepted = definition.inputImages;
8244
+ if (!accepted) {
8245
+ throw new TypeError("[SixbModels] The selected model does not accept input images.");
8246
+ }
8247
+ if (images.length > accepted.maxCount) {
8248
+ throw new RangeError(`[SixbModels] The selected model accepts at most ${accepted.maxCount} input images.`);
8249
+ }
8250
+ for (const image of images) {
8251
+ if (image.file.sizeBytes > accepted.maxBytes) {
8252
+ throw new RangeError(`[SixbModels] Input image exceeds the model's ${accepted.maxBytes}-byte input limit.`);
8253
+ }
8254
+ if (accepted.mediaTypes && !accepted.mediaTypes.includes(image.mediaType)) {
8255
+ throw new TypeError(`[SixbModels] Image media type '${image.mediaType}' is not supported by the selected model.`);
8256
+ }
8257
+ }
8258
+ }
8259
+ function countImages(request) {
8260
+ return (request.firstFrame ? 1 : 0) + (request.lastFrame ? 1 : 0) + request.referenceImages.length;
8261
+ }
8262
+ function estimateReservationCost2(model, input) {
8263
+ try {
8264
+ return model.costEstimator?.estimateReservation?.(input);
8265
+ } catch {
8266
+ return;
8267
+ }
8268
+ }
8269
+ function requireBlobs(blobs) {
8270
+ if (!blobs)
8271
+ throw new Error("[SixbModels] Video generation requires blob storage.");
8272
+ return blobs;
8273
+ }
8274
+ function requireOperationStorage(storage) {
8275
+ if (!storage)
8276
+ throw new Error("[SixbModels] Video generation requires storage.aiUsage.");
8277
+ return storage;
8278
+ }
8279
+ function isReachableOrigin(origin) {
8280
+ if (!origin)
8281
+ return false;
8282
+ const host = new URL(origin).hostname;
8283
+ return !(host === "localhost" || host.endsWith(".localhost") || host === "[::1]" || host === "0.0.0.0" || host.startsWith("127."));
8284
+ }
8285
+ function isStart(value) {
8286
+ const start = value;
8287
+ return start !== null && typeof start === "object" && start.operation !== undefined && start.operation !== null && (start.warnings === undefined || isWarnings(start.warnings));
8288
+ }
8289
+ function optional(key, value) {
8290
+ return value === undefined ? {} : { [key]: value };
8291
+ }
8292
+ function delay(ms, signal) {
8293
+ return new Promise((resolve, reject) => {
8294
+ signal.throwIfAborted();
8295
+ const timer = setTimeout(() => {
8296
+ signal.removeEventListener("abort", abort);
8297
+ resolve();
8298
+ }, ms);
8299
+ const abort = () => {
8300
+ clearTimeout(timer);
8301
+ reject(signal.reason);
8302
+ };
8303
+ signal.addEventListener("abort", abort, { once: true });
8304
+ });
8305
+ }
8306
+
8187
8307
  // src/models/execution.ts
8188
- function createModelsRuntime(runtime, execution, catalog, session, runs, blobs) {
8308
+ function createModelsRuntime(runtime, execution, catalog, session, runs, blobs, apiPublicOrigin = () => {
8309
+ return;
8310
+ }) {
8189
8311
  async function generate(input) {
8190
8312
  assertModelAccess2(runtime, execution, "models.language.generate");
8191
8313
  const messages = generationMessages(input);
@@ -8211,7 +8333,7 @@ function createModelsRuntime(runtime, execution, catalog, session, runs, blobs)
8211
8333
  const accounting = await session.accounting();
8212
8334
  accounting.assertHealthy();
8213
8335
  signal.throwIfAborted();
8214
- const callId = `model_call_${randomUUID13()}`;
8336
+ const callId = `model_call_${randomUUID12()}`;
8215
8337
  const options = {
8216
8338
  model: accounting.wrapModel(model),
8217
8339
  generateCallId: () => callId,
@@ -8248,6 +8370,11 @@ function createModelsRuntime(runtime, execution, catalog, session, runs, blobs)
8248
8370
  decision: createDecisionRuntime(runtime, execution, catalog, session, "models"),
8249
8371
  audio: createAudioRuntime(runtime, execution, catalog, session, blobs),
8250
8372
  image: createImageRuntime(runtime, execution, catalog, session, blobs),
8373
+ video: createVideoRuntime(runtime, execution, catalog, session, {
8374
+ blobs,
8375
+ canReadCallsOf: createModelCallVisibility(runtime, runs, execution.id),
8376
+ apiPublicOrigin
8377
+ }),
8251
8378
  calls: createModelCallsRuntime(runtime, runs, execution.id)
8252
8379
  };
8253
8380
  registerModelExecutionBinding(models, (input) => {
@@ -8294,7 +8421,7 @@ async function requestAction2(ctx, params) {
8294
8421
  });
8295
8422
  }
8296
8423
  // src/objects/materializer-adapter.ts
8297
- import { randomUUID as randomUUID14 } from "crypto";
8424
+ import { randomUUID as randomUUID13 } from "crypto";
8298
8425
 
8299
8426
  // src/objects/errors.ts
8300
8427
  class ObjectError2 extends Error {
@@ -8330,7 +8457,7 @@ async function commitRuntimeOperations(ctx, operations, expectedObjects = [], un
8330
8457
  try {
8331
8458
  return await mutations.commitEdits({
8332
8459
  mode: "atomic",
8333
- source: { kind: "runtime", requestId: randomUUID14() },
8460
+ source: { kind: "runtime", requestId: randomUUID13() },
8334
8461
  operations,
8335
8462
  expectedObjects,
8336
8463
  expectedLinks: [],
@@ -8352,7 +8479,7 @@ async function commitRuntimeBatch(ctx, groups, expectedObjects = [], unchangeabl
8352
8479
  try {
8353
8480
  commit = await mutations.commitEdits({
8354
8481
  mode: "continue",
8355
- source: { kind: "runtime", requestId: randomUUID14() },
8482
+ source: { kind: "runtime", requestId: randomUUID13() },
8356
8483
  operations,
8357
8484
  ...operationGroups.length > 0 ? { operationGroups } : {},
8358
8485
  ...expectedObjects.length > 0 ? { expectedObjects } : {},
@@ -8834,7 +8961,7 @@ async function upsertObjectBatch2(ctx, items) {
8834
8961
  });
8835
8962
  }
8836
8963
  // src/objects/vectors/handle.ts
8837
- import { randomUUID as randomUUID15 } from "crypto";
8964
+ import { randomUUID as randomUUID14 } from "crypto";
8838
8965
  function createObjectVectorHandle(ctx, primaryId, profileName) {
8839
8966
  const ref = Object.freeze({ objectTypeId: ctx.objectType.id, primaryId });
8840
8967
  const profileDefinition = ctx.ontology.resolveObjectType(ref.objectTypeId).search?.vectors?.[profileName];
@@ -8888,7 +9015,7 @@ function createObjectVectorHandle(ctx, primaryId, profileName) {
8888
9015
  await assertReadable();
8889
9016
  await mutations.commitEdits({
8890
9017
  mode: "atomic",
8891
- source: { kind: "runtime", requestId: randomUUID15() },
9018
+ source: { kind: "runtime", requestId: randomUUID14() },
8892
9019
  operations: [],
8893
9020
  vectorWrites: [{ input, values }],
8894
9021
  expectedObjects: [input.expectedObject],
@@ -8942,7 +9069,7 @@ function filePropertyPath(objectTypeId, property, index) {
8942
9069
  }
8943
9070
 
8944
9071
  // src/objects/telemetry/write-batch.ts
8945
- import { randomUUID as randomUUID16 } from "crypto";
9072
+ import { randomUUID as randomUUID15 } from "crypto";
8946
9073
  async function writeTelemetryBatch2(ctx, points) {
8947
9074
  for (const objectTypeId of new Set(points.map((point) => point.series.object.objectTypeId))) {
8948
9075
  assertCanAppendTelemetry2(ctx, objectTypeId);
@@ -8952,7 +9079,7 @@ async function writeTelemetryBatch2(ctx, points) {
8952
9079
  let commit;
8953
9080
  try {
8954
9081
  commit = await getOntologyMutationRuntime2(ctx).appendTelemetry({
8955
- source: { kind: "runtime", requestId: randomUUID16() },
9082
+ source: { kind: "runtime", requestId: randomUUID15() },
8956
9083
  points
8957
9084
  });
8958
9085
  } catch (error) {
@@ -10044,6 +10171,7 @@ function createObjectSet2(params) {
10044
10171
  shareOntologyMutationRuntime2(params, resolvedCtx);
10045
10172
  shareSixbErrorReporter2(params, resolvedCtx);
10046
10173
  shareActionRunExecutor(params, resolvedCtx);
10174
+ shareCallerArtifacts(params, resolvedCtx);
10047
10175
  const objectSet = {
10048
10176
  get: async (id) => {
10049
10177
  const row = await objectReader.getByPrimaryId({
@@ -10248,6 +10376,7 @@ function createObjectsRuntime(runtime, execution, blobStorage, lineage) {
10248
10376
  shareOntologyMutationRuntime2(runtime, capturedRuntime);
10249
10377
  shareSixbErrorReporter2(runtime, capturedRuntime);
10250
10378
  shareActionRunExecutor(runtime, capturedRuntime);
10379
+ shareCallerArtifacts(runtime, capturedRuntime);
10251
10380
  Object.freeze(capturedRuntime);
10252
10381
  const ontologyView = () => getAuthorizedOntologyView(objectReader);
10253
10382
  const objects = Object.assign((objectType) => {
@@ -10576,7 +10705,7 @@ function createSchedulesRuntime(runtime, schedules) {
10576
10705
  }
10577
10706
 
10578
10707
  // src/shares/execution.ts
10579
- import { createHash as createHash2, randomBytes, randomUUID as randomUUID17 } from "crypto";
10708
+ import { createHash, randomBytes, randomUUID as randomUUID16 } from "crypto";
10580
10709
  var MAX_CREATE_ATTEMPTS = 5;
10581
10710
 
10582
10711
  class ShareError2 extends Error {
@@ -10655,7 +10784,7 @@ function createSharesRuntime(runtime, execution, definitions) {
10655
10784
  const secret = randomBytes(32).toString("base64url");
10656
10785
  try {
10657
10786
  const grant = await storage.create({
10658
- id: `shr_${randomUUID17()}`,
10787
+ id: `shr_${randomUUID16()}`,
10659
10788
  projectId: runtime.projectId,
10660
10789
  definitionId: definition.id,
10661
10790
  target,
@@ -10831,7 +10960,7 @@ function validFutureDate(value, now) {
10831
10960
  return new Date(value);
10832
10961
  }
10833
10962
  function sha256(value) {
10834
- return createHash2("sha256").update(value).digest("hex");
10963
+ return createHash("sha256").update(value).digest("hex");
10835
10964
  }
10836
10965
  function publicGrant(record) {
10837
10966
  const {
@@ -11189,6 +11318,11 @@ function isBoundSixb(value) {
11189
11318
  return typeof value === "object" && value !== null && boundSixbInstances.has(value);
11190
11319
  }
11191
11320
  function createExecutionFacades(runtime, execution, dependencies) {
11321
+ const artifacts = createArtifactsRuntime(runtime, dependencies.blobStorage, {
11322
+ rendersInSandboxes: dependencies.rendersInSandboxes,
11323
+ transcribesMedia: dependencies.definitions.models?.audio?.transcription !== undefined
11324
+ });
11325
+ registerCallerArtifacts(runtime, artifacts);
11192
11326
  const actions = createActionsRuntime(runtime, execution);
11193
11327
  const syncConnections = createSyncConnections(dependencies.connectorService);
11194
11328
  const workflows = createWorkflowsRuntime(runtime, execution, dependencies.definitions.workflows);
@@ -11207,14 +11341,12 @@ function createExecutionFacades(runtime, execution, dependencies) {
11207
11341
  projections: createProjectionsRuntime(runtime, dependencies.definitions.projections),
11208
11342
  rules: createRulesRuntime(runtime, dependencies.definitions.rules),
11209
11343
  agent,
11210
- artifacts: createArtifactsRuntime(runtime, dependencies.blobStorage, {
11211
- rendersInSandboxes: dependencies.rendersInSandboxes
11212
- }),
11344
+ artifacts,
11213
11345
  models: createModelsRuntime(runtime, execution, dependencies.definitions.models, session, {
11214
11346
  canViewActionRun: async (id) => await actions.runs.getById(id) !== null,
11215
11347
  canViewWorkflowRun: async (id) => await workflows.runs.getById(id) !== null,
11216
11348
  canViewAgentRun: async (id) => await agent.runs.getById(id) !== null
11217
- }, dependencies.blobStorage),
11349
+ }, dependencies.blobStorage, dependencies.apiPublicOrigin),
11218
11350
  aiUsage: createAiUsageRuntime(runtime, dependencies.definitions.security),
11219
11351
  events: createEventsRuntime(runtime, {
11220
11352
  visibleSyncConnectionIds: (syncIds) => visibleSyncConnectionIds(runtime, execution, syncIds.map((syncId) => dependencies.definitions.syncs.getById(syncId)), syncConnections)
@@ -11497,6 +11629,7 @@ function toLinkSnapshot(row) {
11497
11629
  // src/actions/run/context.ts
11498
11630
  function toActionRuntimeFacade(runtime) {
11499
11631
  return {
11632
+ artifacts: runtime.artifactsAsRequester,
11500
11633
  blobs: {
11501
11634
  put(input) {
11502
11635
  return runtime.sixb.blobs.put(input);
@@ -11705,6 +11838,7 @@ function translateActionPhaseError(error, phase, input) {
11705
11838
  return error;
11706
11839
  }
11707
11840
  if (error instanceof ActionValidationError2) {
11841
+ withFailureMessage2(error, error.message);
11708
11842
  return createSixbError2("action.rejected", error.message, { cause: error, details });
11709
11843
  }
11710
11844
  if (phase === "commit" && isMaterializationConflictError2(error) && error.kind === "expectation") {
@@ -11834,7 +11968,7 @@ function isValidatorErrorResult(value) {
11834
11968
  }
11835
11969
 
11836
11970
  // src/edits/recorder.ts
11837
- import { createHash as createHash3 } from "crypto";
11971
+ import { createHash as createHash2 } from "crypto";
11838
11972
 
11839
11973
  // src/edits/properties.ts
11840
11974
  function normalizeObjectEditProperties(params) {
@@ -12110,7 +12244,7 @@ function createRef(objectTypeId, primaryId) {
12110
12244
  };
12111
12245
  }
12112
12246
  function generatePrimaryId(params) {
12113
- const hash = createHash3("sha256").update(`${params.runId}:${params.operationPath}:${params.objectTypeId}`).digest("hex").slice(0, 24);
12247
+ const hash = createHash2("sha256").update(`${params.runId}:${params.operationPath}:${params.objectTypeId}`).digest("hex").slice(0, 24);
12114
12248
  return `edit_${hash}`;
12115
12249
  }
12116
12250
  function withoutPrimaryProperty(properties, primaryPropertyId) {
@@ -12554,6 +12688,7 @@ function buildActionContext(host, actionRunsStorage, execution, input) {
12554
12688
  sixb,
12555
12689
  actions: host.definitions.actions,
12556
12690
  requestedBy: execution.sixb.execution.requestedBy,
12691
+ artifactsAsRequester: input.artifactsAsRequester,
12557
12692
  client: input.client,
12558
12693
  ...readSubjectAsRequester === undefined ? {} : { readSubjectAsRequester }
12559
12694
  };
@@ -12628,6 +12763,7 @@ class ActionRunExecutor {
12628
12763
  run,
12629
12764
  execution,
12630
12765
  signal: request.signal,
12766
+ artifactsAsRequester: request.artifactsAsRequester,
12631
12767
  ...request.readSubjectAsRequester === undefined ? {} : { readSubjectAsRequester: request.readSubjectAsRequester },
12632
12768
  ...request.client === undefined ? {} : { client: request.client }
12633
12769
  });
@@ -12768,6 +12904,7 @@ async function requestAction3(runtime, execution, input) {
12768
12904
  assertCanReuse,
12769
12905
  signal: request.signal,
12770
12906
  onRequested: request.onRequested,
12907
+ artifactsAsRequester: getCallerArtifacts(runtime),
12771
12908
  ...client === undefined ? {} : { client },
12772
12909
  ...conditioned ? {
12773
12910
  readSubjectAsRequester: ({ objectTypeId, primaryId }) => objectReader.getByPrimaryId({ objectTypeId, primaryId })
@@ -12936,6 +13073,6 @@ function snapshotActionRequest(input) {
12936
13073
  ...onRequested === undefined ? {} : { onRequested }
12937
13074
  };
12938
13075
  }
12939
- export { defineAction2, param2, optional2, ActionRegistry2, bindRequestClient, bindModelExecutionAttempt, canInheritAgentRequestAuthorization2, createAgentExecutionRecord2, createInheritedAgentExecutionRecord2, bindDurableAgentExecution2, bindAgentRunRequestExecution2, bindAgentModelExecution2, restoreAgentExecutionScope2, assertAgentExecutionRecord2, resumeDecidedAgentTurn2, agentRunApprovalMode2, holdAgentApprovalCall2, approvalCallSummary2, listChildApprovalsAwaiting2, isAwaitingApprovalRun2, isPausedSubagentRun2, AGENT_APPROVAL_EXECUTION_LEASE_MS2, turnResumeReadiness2, turnPausesOnHeldCalls2, hasActiveChildren2, listTurnApprovals2, stopAgentTurn2, announceAgentApprovals2, agentApprovalCallers2, AgentRunScopeError2, resolveAgentRunExecutionScope2, createAgentApprovalExecutor, registerAgentApprovalExecutor, getAgentApprovalExecutor2, requestAgentRunCancel2, cancelQueuedRun, AGENT_QUESTION_LIMITS2, agentQuestionsText2, isChildAskTool2, isAwaitingAnswerRun2, deferredChildQuestion2, listSubagentThreadRuns2, subagentSandboxFiles2, assertTurnModelRouting, registerAgentQueuedTurn2, startQueuedAgentTurn2, resolveAgentContextParts2, agentRunQueueJobId2, workflowAgentNodeQueueJobId2, dispatchQueuedAgentRuns2, assertNoAgentDefinitions, turnAnsweredEveryMessage, requestAgentRun2, isEditableAgentMessage2, editAgentMessage2, isRetryableAgentRun2, retryAgentRun2, AGENT_MESSAGE_DELIVERIES2, sendAgentMessage2, promoteAgentInboxItem2, withdrawAgentInboxItem2, startQueuedAgentTurnFromInbox2, WorkflowDefinitionError2, WorkflowValidationError2, assertNonEmpty, isStepDefinition2, isAgentStepDefinition2, isInterventionDefinition2, isWorkflowDefinition2, validateWorkflowDefinition2, validateWorkflowsAtStartup2, validateWorkflowAgentStepGroupReferences2, validateWorkflowInput2, validateWorkflowStepInput2, validateWorkflowStepOutput2, validateWorkflowInterventionInput2, validateWorkflowInterventionResponse2, validateWorkflowInterventionDefaultResponse2, assertAgentStepSandbox, validateWorkflowAgentStepInput2, validateWorkflowAgentStepOutput2, snapshotWorkflowAgentStepInput2, snapshotWorkflowAgentStepOutput2, snapshotWorkflowInput2, snapshotWorkflowStepInput2, snapshotWorkflowStepOutput2, snapshotWorkflowInterventionInput2, snapshotWorkflowInterventionResponse2, snapshotWorkflowInterventionDefaultResponse2, snapshotWorkflowActionInput2, WorkflowRunDispatcher2, requestWorkflowRun2, prepareBoundActionRequest2, prepareBoundWorkflowRequest2, runModelLoop2, requestAction2, ObjectError2, removeLink2, upsertLink2, upsertLinkBatch2, deleteObject2, restoreObject2, upsertObject2, upsertObjectBatch2, writeTelemetryBatch2, appendTelemetryBatch2, getTelemetryHistoryBatch2, requireLinkDefinition2, resolveObjectContext2, resolveLinkContext2, createObjectSet2, exports_service, ShareError2, createBoundSixb, isBoundSixb, bindDurablePrimitiveExecution2, ACTION_RUN_DRAIN_TIMEOUT_MS2, ActionRunExecutor, registerActionRunExecutor, drainActionRuns2, requestAction3 };
13076
+ export { defineAction2, param2, optional2, ActionRegistry2, bindRequestClient, bindModelExecutionAttempt, canInheritAgentRequestAuthorization2, createAgentExecutionRecord2, createInheritedAgentExecutionRecord2, bindDurableAgentExecution2, bindAgentRunRequestExecution2, bindAgentModelExecution2, restoreAgentExecutionScope2, assertAgentExecutionRecord2, resumeDecidedAgentTurn2, agentRunApprovalMode2, holdAgentApprovalCall2, approvalCallSummary2, listChildApprovalsAwaiting2, isAwaitingApprovalRun2, isPausedSubagentRun2, AGENT_APPROVAL_EXECUTION_LEASE_MS2, turnResumeReadiness2, turnPausesOnHeldCalls2, hasActiveChildren2, listTurnApprovals2, stopAgentTurn2, announceAgentApprovals2, agentApprovalCallers2, AgentRunScopeError2, resolveAgentRunExecutionScope2, createAgentApprovalExecutor, registerAgentApprovalExecutor, getAgentApprovalExecutor2, requestAgentRunCancel2, cancelQueuedRun, AGENT_QUESTION_LIMITS2, agentQuestionsText2, isChildAskTool2, isAwaitingAnswerRun2, deferredChildQuestion2, listSubagentThreadRuns2, subagentSandboxFiles2, assertTurnModelRouting, registerAgentQueuedTurn2, startQueuedAgentTurn2, resolveAgentContextParts2, agentRunQueueJobId2, workflowAgentNodeQueueJobId2, dispatchQueuedAgentRuns2, assertNoAgentDefinitions, turnAnsweredEveryMessage, requestAgentRun2, isEditableAgentMessage2, editAgentMessage2, isRetryableAgentRun2, retryAgentRun2, AGENT_MESSAGE_DELIVERIES2, sendAgentMessage2, promoteAgentInboxItem2, withdrawAgentInboxItem2, startQueuedAgentTurnFromInbox2, WorkflowDefinitionError2, WorkflowValidationError2, assertNonEmpty, isStepDefinition2, isAgentStepDefinition2, isInterventionDefinition2, isWorkflowDefinition2, validateWorkflowDefinition2, validateWorkflowsAtStartup2, validateWorkflowAgentStepGroupReferences2, validateWorkflowInput2, validateWorkflowStepInput2, validateWorkflowStepOutput2, validateWorkflowInterventionInput2, validateWorkflowInterventionResponse2, validateWorkflowInterventionDefaultResponse2, assertAgentStepSandbox, validateWorkflowAgentStepInput2, validateWorkflowAgentStepOutput2, snapshotWorkflowAgentStepInput2, snapshotWorkflowAgentStepOutput2, snapshotWorkflowInput2, snapshotWorkflowStepInput2, snapshotWorkflowStepOutput2, snapshotWorkflowInterventionInput2, snapshotWorkflowInterventionResponse2, snapshotWorkflowInterventionDefaultResponse2, snapshotWorkflowActionInput2, WorkflowRunDispatcher2, requestWorkflowRun2, prepareBoundActionRequest2, prepareBoundWorkflowRequest2, lostConnectionCode, runModelLoop2, requestAction2, ObjectError2, removeLink2, upsertLink2, upsertLinkBatch2, deleteObject2, restoreObject2, upsertObject2, upsertObjectBatch2, writeTelemetryBatch2, appendTelemetryBatch2, getTelemetryHistoryBatch2, requireLinkDefinition2, resolveObjectContext2, resolveLinkContext2, createObjectSet2, exports_service, ShareError2, createBoundSixb, isBoundSixb, bindDurablePrimitiveExecution2, ACTION_RUN_DRAIN_TIMEOUT_MS2, ActionRunExecutor, registerActionRunExecutor, drainActionRuns2, requestAction3 };
12940
13077
 
12941
- //# debugId=F06C1A95F7E3542964756E2164756E21
13078
+ //# debugId=F9483E747CF0F2C264756E2164756E21