@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
@@ -2,7 +2,6 @@ import { randomUUID } from "node:crypto"
2
2
  import { assertModelAccess } from "../../authorization"
3
3
  import type { BlobStorage } from "../../blob-storage/types"
4
4
  import type { ExecutionContext } from "../../execution"
5
- import type { SixbRuntimeContext } from "../../runtime/types"
6
5
  import type { ModelCatalog } from "../catalog"
7
6
  import type { ModelCallEndEvent } from "../events"
8
7
  import type { AiModelCallRecorder } from "../execution/model-call-recorder"
@@ -10,6 +9,7 @@ import type { ModelExecutionSession } from "../execution/session"
10
9
  import { estimateModelCall, type ModelMoney } from "../pricing"
11
10
  import { assertSpeechModel } from "./catalog"
12
11
  import { SpeechModelResponseError } from "./errors"
12
+ import type { AudioRuntimeContext } from "./runtime"
13
13
  import type {
14
14
  AudioModelsRuntime,
15
15
  AudioSpeakInput,
@@ -23,7 +23,7 @@ import type {
23
23
  type PreparedRequest = Omit<SpeechModelRequest, "signal">
24
24
 
25
25
  export function createSpeak(
26
- runtime: SixbRuntimeContext,
26
+ runtime: AudioRuntimeContext,
27
27
  execution: ExecutionContext,
28
28
  catalog: ModelCatalog | undefined,
29
29
  session: ModelExecutionSession,
@@ -8,7 +8,10 @@ export interface TranscriptionModelDefinition extends ModelDefinition {
8
8
  readonly kind: "transcription"
9
9
  /** Bounds memory consumption before a file is opened. Providers may impose lower limits. */
10
10
  readonly maxInputBytes: number
11
- /** Omitted when the provider does not publish a reliable format list. */
11
+ /**
12
+ * Omitted when the provider does not publish a reliable format list. Requests carry registered
13
+ * names, such as `audio/mp4` for a file labelled `audio/x-m4a`, so list those.
14
+ */
12
15
  readonly mediaTypes?: readonly string[]
13
16
  }
14
17
 
@@ -32,14 +35,32 @@ export interface TranscriptionWord {
32
35
  readonly speaker?: string
33
36
  }
34
37
 
38
+ /** A stretch of speech the provider timed, such as a sentence, and who said it. */
39
+ export interface TranscriptionSegment {
40
+ readonly text: string
41
+ /** Milliseconds from the start of the audio. */
42
+ readonly startMs: number
43
+ readonly endMs: number
44
+ /** The provider's label for who said it, as on a word. */
45
+ readonly speaker?: string
46
+ }
47
+
35
48
  export interface TranscriptionOutput {
36
49
  readonly text: string
37
50
  /**
38
51
  * The words the provider timed, in spoken order. Text alone cannot say who was speaking at
39
- * 12:04, or where to put the playhead. Absent when the provider returns none, which is what
40
- * every provider that neither diarizes nor times words does.
52
+ * 12:04, or where to put the playhead. Absent when the provider times none, or the words of
53
+ * some phrases only: a phrase is never handed on as a word, since a cut on its bounds would
54
+ * fall mid-speech, and a phrase left untimed would read as silence. Fall back on `segments`.
41
55
  */
42
56
  readonly words?: readonly TranscriptionWord[]
57
+ /**
58
+ * The stretches the provider timed, in spoken order: sentences for most, each word for some,
59
+ * with who said each where it labels voices. Absent when it returns none.
60
+ */
61
+ readonly segments?: readonly TranscriptionSegment[]
62
+ /** The language the provider heard, as it names it, such as `en`. */
63
+ readonly language?: string
43
64
  }
44
65
 
45
66
  export interface TranscriptionModelResponseMetadata {
@@ -37,6 +37,35 @@ export function createModelCallsRuntime(
37
37
  /** The execution reading; it reads what it produced, whoever can see its run. */
38
38
  executionId?: string
39
39
  ): ModelCallsRuntime {
40
+ const canReadCallsOf = createModelCallVisibility(runtime, runs, executionId)
41
+
42
+ return {
43
+ async files(callId) {
44
+ if (typeof callId !== "string" || !callId.trim()) {
45
+ throw new TypeError("[SixbModels] A model call ID must be a nonblank string.")
46
+ }
47
+ const record = await runtime.storage.aiUsage?.getModelCallFiles({
48
+ projectId: runtime.projectId,
49
+ callId,
50
+ })
51
+ if (!record) return null
52
+
53
+ const visible = { callId: record.callId, files: record.files, recordedAt: record.recordedAt }
54
+ return (await canReadCallsOf(record.executionId)) ? visible : null
55
+ },
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Whether the caller sees what an execution's model calls produced: the request's own principal,
61
+ * the agent thread's readers, or the action or workflow run's viewers.
62
+ */
63
+ export function createModelCallVisibility(
64
+ runtime: Pick<SixbRuntimeContext, "projectId" | "runtimeAuthorization" | "storage">,
65
+ runs: ModelCallRunVisibility,
66
+ /** The execution reading; it reads what it produced, whoever can see its run. */
67
+ executionId?: string
68
+ ): (callExecutionId: string) => Promise<boolean> {
40
69
  const projectId = runtime.projectId
41
70
 
42
71
  async function canRead(execution: ExecutionRecord): Promise<boolean> {
@@ -77,24 +106,12 @@ export function createModelCallsRuntime(
77
106
  return false
78
107
  }
79
108
 
80
- return {
81
- async files(callId) {
82
- if (typeof callId !== "string" || !callId.trim()) {
83
- throw new TypeError("[SixbModels] A model call ID must be a nonblank string.")
84
- }
85
- const record = await runtime.storage.aiUsage?.getModelCallFiles({ projectId, callId })
86
- if (!record) return null
87
-
88
- // A workflow's agent step runs as a service account that cannot view its own workflow run,
89
- // yet must read back the image it just made.
90
- const visible = { callId: record.callId, files: record.files, recordedAt: record.recordedAt }
91
- if (record.executionId === executionId) return visible
109
+ return async (callExecutionId) => {
110
+ // A workflow's agent step runs as a service account that cannot view its own workflow run,
111
+ // yet must read back the image it just made.
112
+ if (callExecutionId === executionId) return true
92
113
 
93
- const execution = await runtime.storage.executions.getById({
94
- projectId,
95
- id: record.executionId,
96
- })
97
- return execution && (await canRead(execution)) ? visible : null
98
- },
114
+ const execution = await runtime.storage.executions.getById({ projectId, id: callExecutionId })
115
+ return execution !== null && (await canRead(execution))
99
116
  }
100
117
  }
@@ -21,6 +21,8 @@ import {
21
21
  modelReasoningSupportIssue,
22
22
  } from "./language-model"
23
23
  import { assertRerankingModel, type RerankingModel } from "./reranking-model"
24
+ import { createVideoCatalog, type VideoModelCatalog } from "./video/catalog"
25
+ import type { VideoModel } from "./video/types"
24
26
  import { assertWebSearchModel, type WebSearchModel } from "./web-search-model"
25
27
 
26
28
  /** Stable identity of a configured provider binding. */
@@ -118,6 +120,7 @@ export interface ModelCatalog {
118
120
  readonly decision?: DecisionModelCatalog
119
121
  readonly embedding: EmbeddingModelCatalog
120
122
  readonly image?: ImageModelCatalog
123
+ readonly video?: VideoModelCatalog
121
124
  readonly reranking?: RerankingModelCatalog
122
125
  readonly webSearch?: WebSearchModelCatalog
123
126
  }
@@ -134,6 +137,8 @@ export interface ModelCatalogInput {
134
137
  readonly embedding?: readonly EmbeddingModel[]
135
138
  /** Ordered; the first entry is the default image model. */
136
139
  readonly image?: readonly ImageModel[]
140
+ /** Ordered; the first entry is the default video model. */
141
+ readonly video?: readonly VideoModel[]
137
142
  /** Available rerankers; no default model and no automatic activation. */
138
143
  readonly reranking?: readonly RerankingModel[]
139
144
  /**
@@ -183,6 +188,7 @@ export function createModelCatalog(input: ModelCatalogInput): ModelCatalog {
183
188
  const decision = createDecisionCatalog(input.decision)
184
189
  const audio = createAudioCatalog(input.audio)
185
190
  const image = createImageCatalog(input.image)
191
+ const video = createVideoCatalog(input.video)
186
192
  const reranking = createRerankingCatalog(input.reranking)
187
193
  const webSearch = createWebSearchCatalog(input.webSearch, language)
188
194
 
@@ -191,16 +197,17 @@ export function createModelCatalog(input: ModelCatalogInput): ModelCatalog {
191
197
  !decision &&
192
198
  !audio &&
193
199
  !image &&
200
+ !video &&
194
201
  embedding.list().length === 0 &&
195
202
  !reranking?.list().length &&
196
203
  !webSearch
197
204
  ) {
198
205
  throw new RuntimeError(
199
- "[Sixb] Configure at least one language, embedding, decision, audio, image, reranking or web search model."
206
+ "[Sixb] Configure at least one language, embedding, decision, audio, image, video, reranking or web search model."
200
207
  )
201
208
  }
202
209
 
203
- return Object.freeze({ language, embedding, decision, audio, image, reranking, webSearch })
210
+ return Object.freeze({ language, embedding, decision, audio, image, video, reranking, webSearch })
204
211
  }
205
212
 
206
213
  function createRerankingCatalog(
@@ -21,8 +21,9 @@ export const MODEL_KINDS = [
21
21
  export type ModelKind = (typeof MODEL_KINDS)[number]
22
22
 
23
23
  /**
24
- * @internal Kinds billed per audio second, search, image or character, whose providers mostly
25
- * report no tokens. Token limits skip them, and a missing token count from one is not a gap.
24
+ * @internal Kinds billed per audio second, search, image, character or second of video, whose
25
+ * providers mostly report no tokens. Token limits skip them, and a missing token count from one
26
+ * is not a gap.
26
27
  */
27
28
  export const TOKENLESS_MODEL_KINDS: readonly ModelKind[] = [
28
29
  "transcription",
@@ -30,6 +31,7 @@ export const TOKENLESS_MODEL_KINDS: readonly ModelKind[] = [
30
31
  "web-search",
31
32
  "image",
32
33
  "speech",
34
+ "video",
33
35
  ]
34
36
 
35
37
  /** Common catalog identity shared by every present and future model runtime. */
@@ -8,10 +8,12 @@ export class ModelCatalogUnavailableError extends Error {
8
8
 
9
9
  /**
10
10
  * Why a provider rejected a request, when the provider says so in terms Sixb acts on:
11
- * `context-window-exceeded` means the request was too long for the model's context window, and a
12
- * shorter one may succeed.
11
+ * - `context-window-exceeded`: the request was too long for the model's context window, and a
12
+ * shorter one may succeed.
13
+ * - `interrupted`: the response broke off once it had started, overloaded, rate limited, failing
14
+ * on the provider's side or closed before its end, and the same request may succeed again.
13
15
  */
14
- export type ModelProviderErrorReason = "context-window-exceeded"
16
+ export type ModelProviderErrorReason = "context-window-exceeded" | "interrupted"
15
17
 
16
18
  /** A provider or provider protocol rejected a model request. */
17
19
  export class ModelProviderError extends Error {
@@ -65,6 +65,8 @@ export interface ModelUsage {
65
65
  readonly outputImages?: number
66
66
  /** Input characters, counted by the provider's own billing rule. */
67
67
  readonly inputCharacters?: number
68
+ /** Milliseconds of video the call returned, every clip together, as the provider bills them. */
69
+ readonly outputVideoMs?: number
68
70
  readonly raw?: JsonObject
69
71
  }
70
72
 
@@ -1,6 +1,6 @@
1
1
  # Model execution accounting
2
2
 
3
- Internal execution and accounting shared by language, embedding, decision, reranking, web search, image and speech calls. Application usage is
3
+ Internal execution and accounting shared by language, embedding, decision, reranking, web search, image, video and speech calls. Application usage is
4
4
  documented in [Usage and limits](../../../../../docs/models/usage-and-limits.md).
5
5
 
6
6
  ## Execution boundary
@@ -24,6 +24,13 @@ The model records each call itself, whoever reads its stream: the Agent's loop,
24
24
  or a server that streams it to a remote runner. A call whose record cannot be written fails before
25
25
  its reader sees it finish, and the record goes to recovery.
26
26
 
27
+ Bindings retry an HTTP refusal (429, 5xx) inside the call: nothing was billed, so it stays one
28
+ call. An interrupted call is ambiguous: a dropped connection, or a response its provider broke off
29
+ (an overloaded or server error event, a stream closed before its end, which the protocols mark
30
+ `interrupted`). The model loop (`../../agents/model-loop.ts`) makes it again as a new call,
31
+ admitted and recorded on its own. What the lost call cost stays unknown:
32
+ its reservation is kept, and a call that had started streaming is recorded with its usage unknown.
33
+
27
34
  ## Embedding flow
28
35
 
29
36
  ```text
@@ -78,7 +85,7 @@ and ranking validation. A complete permutation with finite scores is required; t
78
85
  candidate order. `RerankingModelResponseError` carries metadata from malformed billable responses.
79
86
 
80
87
  Provider charges remain distinct from token usage: absent tokens stay unknown. Token limits
81
- neither admit nor count reranking, web search, transcription, image or speech calls (`aiLimitMeterApplies` in
88
+ neither admit nor count reranking, web search, transcription, image, video or speech calls (`aiLimitMeterApplies` in
82
89
  the limit storage helpers), so their unmetered records cannot make a token meter unavailable. Reported
83
90
  costs reconcile monetary reservations; missing tariffs fail admission under cost limits. Recovery
84
91
  remains the existing accounting-only replay.
@@ -144,3 +151,62 @@ Characters and voice tiers are provider rules, so the binding owns both: `estima
144
151
  receives the text and voice and counts characters itself, providers report `inputCharacters` in
145
152
  usage, and `pricingDimensions` in the reply names the tier the provider billed, which selects the
146
153
  rate-card variant.
154
+
155
+ ## Video flow
156
+
157
+ A video takes minutes, longer than any request, so `../video/runtime.ts` splits the call across
158
+ requests:
159
+
160
+ ```text
161
+ start(): admit the call, reserve its budget → keep the operation, queue its check
162
+ → provider start(callId) → keep the provider's handle
163
+ get(): provider status(operation) → pending: answer as is
164
+ → ended: record it as the attempt that admitted it,
165
+ store the videos, settle the operation
166
+ ```
167
+
168
+ `start` admits the call like an image, then keeps it in `aiUsage.createModelCallOperation`, with
169
+ the execution attempt that admitted it and whether that reserved budget, and queues its check,
170
+ all before the provider sees it: a job the provider may bill always has a record, and a check
171
+ that settles it. Only then does it ask the provider to start the job, and keep the handle it
172
+ returns, with the price variant the provider bills the job at, through `startModelCallOperation`.
173
+ The call ID is the provider's idempotency key, so a retried start never bills a second job. A
174
+ start that fails, queueing its check included, settles the operation as failed and keeps its
175
+ reservation unknown, as a language call does. A process that stops between the provider's start
176
+ and keeping its handle leaves an operation with no handle, which its check settles the same way
177
+ at the ceiling.
178
+
179
+ Any later `get`, from the same request or another process, looks at the job once. The look that
180
+ sees it end records the call through `accountingFor` the starting execution and `resumeCall`, so the
181
+ ledger row and the reservation it reconciles are that attempt's, then writes the videos to blob
182
+ storage, records them against the call ID, and settles the operation with its usage and cost.
183
+ Settling is first-wins: two looks that see the end at once record the same ledger identity, keep
184
+ the first files, and both answer with the first settlement. A look that fails to ask, such as a
185
+ network error, leaves the job pending. `generate` is `start`, then `get` every five seconds.
186
+
187
+ No client has to come back. The `agent.model-call.check.requested` job `start` queued on the
188
+ agent lane looks at the job with the same code (`../video/check.ts`) in the agent worker, then
189
+ queues the next look, a quarter of the generation's age later, between one and five minutes. Since
190
+ the handle lives in storage and the check in the queue, a process that stops between start and
191
+ end loses nothing: whichever worker claims the check finishes it. A check that cannot ask is
192
+ retried by the worker with backoff, twenty times in a row at most: about seventy minutes, past the
193
+ ceiling below, after which a check that still fails stops, and the next `get` settles it.
194
+
195
+ A generation is checked with the catalog entry its model has in `models.video`, so `start` takes
196
+ only a listed model. Past `VIDEO_GENERATION_CEILING_MS`, one hour, a look settles a generation
197
+ still running, or one it cannot ask about, as failed. The Gateway gives up on a provider's task
198
+ after ten minutes and providers time their own out sooner, so an hour is far past any job that
199
+ will still finish. Whether the provider billed it is unknown, so its reservation becomes unknown,
200
+ as for a language call that never finished, rather than recorded as free.
201
+
202
+ A generation the ledger already records is different: the look that sees it end keeps its result
203
+ on the operation (`recordModelCallOperationResult`) before storing the videos. If they cannot be
204
+ stored by the ceiling, it settles as failed with that usage and cost, its budget reconciled, and
205
+ the check stops. One whose result could not be kept settles as failed too: the limits store
206
+ refuses to mark its reconciled reservation unknown, and the ledger keeps what the provider billed.
207
+
208
+ Usage is `outputVideoMs`: what the provider reports, else the requested length times the clips
209
+ returned, which is what providers bill. The job's price variant, such as `{ resolution: "720p",
210
+ audio: "audio" }`, comes from the binding at start, since the binding knows how its catalog names
211
+ tiers.
212
+
@@ -6,6 +6,7 @@ export {
6
6
  export { reportModelCalls } from "../language-call"
7
7
  export { modelCacheLifetimeMs } from "../language-model"
8
8
  export { resolveLanguageModel } from "../resolve"
9
+ export { runScheduledVideoCheck } from "../video/check"
9
10
  export { isModelCallAccountingFailure, ModelUsageRecordingError } from "./errors"
10
11
  export type {
11
12
  AiModelCallAdmissionDecision,
@@ -1,10 +1,11 @@
1
1
  import { isSixbError } from "../../errors/internal"
2
2
  import type { AuthorizablePrincipal } from "../../execution"
3
- import type {
4
- AiLimitPolicy,
5
- AiLimitQuantity,
6
- AiModelCallReservationIdentity,
7
- ReserveAiModelCallResult,
3
+ import {
4
+ type AiLimitPolicy,
5
+ type AiLimitQuantity,
6
+ AiLimitStorageError,
7
+ type AiModelCallReservationIdentity,
8
+ type ReserveAiModelCallResult,
8
9
  } from "../../storage"
9
10
  import {
10
11
  aiLimitSubjectsFromAttribution,
@@ -88,6 +89,11 @@ export function createAiModelCallLimitController(input: {
88
89
  try {
89
90
  await input.storage.aiLimits.markReservationUnknown(identity)
90
91
  } catch (error) {
92
+ // Recording the call already reconciled the reservation: its outcome is known, and the
93
+ // store is not unavailable. The caller decides what that means for the call.
94
+ if (error instanceof AiLimitStorageError && error.code === "invalid_reservation_state") {
95
+ throw error
96
+ }
91
97
  throw limitStorageUnavailable(error)
92
98
  }
93
99
  },
@@ -150,6 +150,20 @@ export class AiModelCallRecorder {
150
150
  }
151
151
  }
152
152
 
153
+ /** Whether admitting this call reserved budget that recording it must reconcile. */
154
+ hasReservation(callId: string): boolean {
155
+ return this.reservations.has(callId)
156
+ }
157
+
158
+ /**
159
+ * Take over a call an earlier request of this execution attempt admitted, such as a video the
160
+ * provider kept rendering after that request ended, so that recording its end reconciles the
161
+ * budget it reserved.
162
+ */
163
+ resumeCall(callId: string, reserved: boolean): void {
164
+ if (reserved) this.reservations.add(callId)
165
+ }
166
+
153
167
  /** Keep an unresolved reservation when an attempted call's billable outcome is unknown. */
154
168
  async markCallUnknown(callId: string): Promise<void> {
155
169
  if (!this.reservations.has(callId)) return
@@ -1,6 +1,7 @@
1
1
  import type { ExecutionContext, RuntimeAuthorization } from "../../execution"
2
2
  import { ensureExecutionRecord, executionRecordInputFromRuntime } from "../../execution/durable"
3
3
  import type { SixbHostContext } from "../../runtime/types"
4
+ import type { ExecutionRecord } from "../../storage/executions"
4
5
  import type { ModelExecutionAttempt } from "./binding"
5
6
  import { requireAccountingCapabilities } from "./model-call-accounting"
6
7
  import { createAiModelCallLimitController } from "./model-call-limits"
@@ -39,6 +40,19 @@ export class ModelExecutionSession {
39
40
  return this.recorder
40
41
  }
41
42
 
43
+ /**
44
+ * The recorder of the execution attempt that admitted a call, to record how it ended when a
45
+ * later request learns it: a video generation outlives the request that started it.
46
+ */
47
+ async accountingFor(execution: ExecutionRecord, attempt: number): Promise<AiModelCallRecorder> {
48
+ const binding = this.requireBinding()
49
+ if (execution.id === this.execution.id && attempt === binding.attempt) {
50
+ return this.accounting()
51
+ }
52
+
53
+ return this.recorderFor(execution, attempt)
54
+ }
55
+
42
56
  private requireBinding(): ModelExecutionAttempt {
43
57
  if (!this.binding) {
44
58
  throw new Error(
@@ -49,33 +63,48 @@ export class ModelExecutionSession {
49
63
  }
50
64
 
51
65
  private async createRecorder(): Promise<AiModelCallRecorder> {
52
- const runtime = this.runtime
53
- const execution = this.execution
54
66
  const { attempt } = this.requireBinding()
55
- const storage = {
56
- ...requireAccountingCapabilities(runtime.storage),
57
- transaction: runtime.storage.transaction.bind(runtime.storage),
58
- }
59
- const { requesterGroupIds } = await ensureExecutionRecord(
60
- runtime.storage.executions,
67
+ const record = await ensureExecutionRecord(
68
+ this.runtime.storage.executions,
61
69
  executionRecordInputFromRuntime({
62
- execution,
63
- runtimeAuthorization: runtime.runtimeAuthorization,
70
+ execution: this.execution,
71
+ runtimeAuthorization: this.runtime.runtimeAuthorization,
64
72
  })
65
73
  )
66
- return new AiModelCallRecorder({
74
+ return this.recorderFor(record, attempt)
75
+ }
76
+
77
+ private recorderFor(execution: ExecutionRecord, attempt: number): AiModelCallRecorder {
78
+ return createExecutionRecorder(this.runtime, execution, attempt)
79
+ }
80
+ }
81
+
82
+ /**
83
+ * A recorder for one execution attempt, outside any bound request: a queue job that learns how a
84
+ * call ended records it as the attempt that admitted it.
85
+ */
86
+ export function createExecutionRecorder(
87
+ host: Pick<SixbHostContext, "projectId" | "storage" | "queues">,
88
+ execution: ExecutionRecord,
89
+ attempt: number
90
+ ): AiModelCallRecorder {
91
+ const storage = {
92
+ ...requireAccountingCapabilities(host.storage),
93
+ transaction: host.storage.transaction.bind(host.storage),
94
+ }
95
+ const requesterGroupIds = execution.requesterGroupIds
96
+ return new AiModelCallRecorder({
97
+ storage,
98
+ projectId: host.projectId,
99
+ executionId: execution.id,
100
+ attempt,
101
+ requesterGroupIds,
102
+ limits: createAiModelCallLimitController({
67
103
  storage,
68
- projectId: runtime.projectId,
69
- executionId: execution.id,
70
- attempt,
104
+ projectId: host.projectId,
105
+ requestedBy: execution.requestedBy,
71
106
  requesterGroupIds,
72
- limits: createAiModelCallLimitController({
73
- storage,
74
- projectId: runtime.projectId,
75
- requestedBy: execution.requestedBy,
76
- requesterGroupIds,
77
- }),
78
- recoverAiModelCall: (input) => enqueueAiModelCallRecovery(runtime.queues.agents, input),
79
- })
80
- }
107
+ }),
108
+ recoverAiModelCall: (input) => enqueueAiModelCallRecovery(host.queues.agents, input),
109
+ })
81
110
  }
@@ -28,5 +28,6 @@ export function aiModelCallUsageFromModel(usage: ModelUsage): AiModelCallUsageIn
28
28
  : { audioOutputTokens: usage.audioOutputTokens }),
29
29
  ...(usage.outputImages === undefined ? {} : { outputImages: usage.outputImages }),
30
30
  ...(usage.inputCharacters === undefined ? {} : { inputCharacters: usage.inputCharacters }),
31
+ ...(usage.outputVideoMs === undefined ? {} : { outputVideoMs: usage.outputVideoMs }),
31
32
  }
32
33
  }
@@ -5,7 +5,11 @@ import type { BlobStorage } from "../blob-storage/types"
5
5
  import type { ExecutionContext } from "../execution"
6
6
  import type { SixbRuntimeContext } from "../runtime/types"
7
7
  import { createAudioRuntime } from "./audio/runtime"
8
- import { createModelCallsRuntime, type ModelCallRunVisibility } from "./calls"
8
+ import {
9
+ createModelCallsRuntime,
10
+ createModelCallVisibility,
11
+ type ModelCallRunVisibility,
12
+ } from "./calls"
9
13
  import { type ModelCatalog, selectLanguageModel } from "./catalog"
10
14
  import { createDecisionRuntime } from "./decision/runtime"
11
15
  import { ModelProviderError, ModelStreamError, UnsupportedModelFeatureError } from "./errors"
@@ -24,6 +28,7 @@ import { modelReasoningSupportIssue } from "./language-model"
24
28
  import type { ModelMessage } from "./messages"
25
29
  import { languageModelOutput } from "./output"
26
30
  import { resolveLanguageModel } from "./resolve"
31
+ import { createVideoRuntime } from "./video/runtime"
27
32
 
28
33
  export function createModelsRuntime(
29
34
  runtime: SixbRuntimeContext,
@@ -31,7 +36,8 @@ export function createModelsRuntime(
31
36
  catalog: ModelCatalog | undefined,
32
37
  session: ModelExecutionSession,
33
38
  runs: ModelCallRunVisibility,
34
- blobs?: BlobStorage
39
+ blobs?: BlobStorage,
40
+ apiPublicOrigin: () => string | undefined = () => undefined
35
41
  ): ModelsRuntime {
36
42
  function generate<const TShape extends LanguageModelOutputShape | undefined = undefined>(
37
43
  input: LanguageModelGenerateInput<TShape>
@@ -127,6 +133,11 @@ export function createModelsRuntime(
127
133
  decision: createDecisionRuntime(runtime, execution, catalog, session, "models"),
128
134
  audio: createAudioRuntime(runtime, execution, catalog, session, blobs),
129
135
  image: createImageRuntime(runtime, execution, catalog, session, blobs),
136
+ video: createVideoRuntime(runtime, execution, catalog, session, {
137
+ blobs,
138
+ canReadCallsOf: createModelCallVisibility(runtime, runs, execution.id),
139
+ apiPublicOrigin,
140
+ }),
130
141
  calls: createModelCallsRuntime(runtime, runs, execution.id),
131
142
  }
132
143
  registerModelExecutionBinding(models, (input) => {
@@ -8,6 +8,7 @@ import type { ImageModelsRuntime } from "./image/types"
8
8
  import type { LanguageModel, ModelReasoning } from "./language-model"
9
9
  import type { ModelMessage } from "./messages"
10
10
  import type { ModelCallCost } from "./pricing"
11
+ import type { VideoModelsRuntime } from "./video/types"
11
12
 
12
13
  export type LanguageModelOutputShape = Readonly<Record<string, SchemaOrRef>>
13
14
 
@@ -61,6 +62,7 @@ export interface ModelsRuntime {
61
62
  readonly language: LanguageModelsRuntime
62
63
  readonly decision: DecisionModelsRuntime
63
64
  readonly image: ImageModelsRuntime
65
+ readonly video: VideoModelsRuntime
64
66
  /** What past calls produced, as visible as the runs that made them. */
65
67
  readonly calls: ModelCallsRuntime
66
68
  }
@@ -1,5 +1,5 @@
1
1
  export type { FileRef } from "../blob-storage/types"
2
- export type { JsonObject, JsonPrimitive, JsonValue } from "../json"
2
+ export type { JsonObject, JsonPrimitive, JsonValue, ReadonlyJsonValue } from "../json"
3
3
  export { assertJsonObject, assertJsonValue, isJsonObject, isJsonValue } from "../json"
4
4
  export type {
5
5
  AudioModelCatalog,
@@ -31,6 +31,7 @@ export type {
31
31
  TranscriptionModelResponseMetadata,
32
32
  TranscriptionModelResult,
33
33
  TranscriptionOutput,
34
+ TranscriptionSegment,
34
35
  TranscriptionWord,
35
36
  } from "./audio/types"
36
37
  export type { ModelCallFiles, ModelCallsRuntime } from "./calls"
@@ -205,6 +206,24 @@ export type {
205
206
  } from "./reranking-model"
206
207
  export { RerankingModelResponseError } from "./reranking-model"
207
208
  export type { ModelOutput, ModelTool, ModelToolExecutionContext } from "./tools"
209
+ export type { VideoModelCatalog, VideoModelEntry } from "./video/catalog"
210
+ export type {
211
+ VideoCostEstimator,
212
+ VideoData,
213
+ VideoGenerateInput,
214
+ VideoGenerateResult,
215
+ VideoGeneration,
216
+ VideoGenerationStatus,
217
+ VideoInputImage,
218
+ VideoModel,
219
+ VideoModelDefinition,
220
+ VideoModelRequest,
221
+ VideoModelResponseMetadata,
222
+ VideoModelStart,
223
+ VideoModelStatus,
224
+ VideoModelsRuntime,
225
+ VideoReservationInput,
226
+ } from "./video/types"
208
227
  export type {
209
228
  WebSearchCostEstimator,
210
229
  WebSearchHit,
@@ -1,4 +1,5 @@
1
1
  import { createHash } from "node:crypto"
2
+ import { unaliasMediaType } from "../blob-storage/media-type"
2
3
  import type { BlobStorage, FileRef } from "../blob-storage/types"
3
4
  import { isFileRef } from "../blob-storage/validation"
4
5
 
@@ -39,11 +40,15 @@ export function prepareModelInputBytes(
39
40
  return { bytes: input.data.slice(), mediaType }
40
41
  }
41
42
 
42
- /** The essence of a media type, such as `audio/webm` for `audio/webm;codecs=opus`. */
43
+ /**
44
+ * The essence of a media type, such as `audio/webm` for `audio/webm;codecs=opus`, under its
45
+ * registered name (`audio/x-m4a` -> `audio/mp4`, `audio/x-wav` -> `audio/wav`).
46
+ */
43
47
  function modelInputMediaType(value: unknown, type: "audio" | "image"): string | undefined {
44
48
  if (typeof value !== "string") return undefined
45
49
 
46
- const mediaType = value.split(";", 1)[0]?.trim().toLowerCase()
50
+ const essence = value.split(";", 1)[0]?.trim().toLowerCase()
51
+ const mediaType = essence && unaliasMediaType(essence)
47
52
  return mediaType && new RegExp(`^${type}/[a-z0-9.+-]+$`).test(mediaType) ? mediaType : undefined
48
53
  }
49
54