@sixb/core 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/index.js +53 -50
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run/context.d.ts.map +1 -1
- package/dist/actions/run/execute.d.ts +3 -0
- package/dist/actions/run/execute.d.ts.map +1 -1
- package/dist/actions/run/executor.d.ts +3 -0
- package/dist/actions/run/executor.d.ts.map +1 -1
- package/dist/actions/run/normalize.d.ts.map +1 -1
- package/dist/actions/run/types.d.ts +6 -0
- package/dist/actions/run/types.d.ts.map +1 -1
- package/dist/actions/types/context.d.ts +7 -0
- package/dist/actions/types/context.d.ts.map +1 -1
- package/dist/agents/context/entries.d.ts +17 -0
- package/dist/agents/context/entries.d.ts.map +1 -1
- package/dist/agents/context/index.js +3 -2
- package/dist/agents/context/index.js.map +1 -1
- package/dist/agents/context-model.d.ts.map +1 -1
- package/dist/agents/context-resolution.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +7 -0
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +62 -57
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-call-retry.d.ts +28 -0
- package/dist/agents/model-call-retry.d.ts.map +1 -0
- package/dist/agents/model-loop.d.ts +4 -2
- package/dist/agents/model-loop.d.ts.map +1 -1
- package/dist/agents/model-routing.d.ts +15 -4
- package/dist/agents/model-routing.d.ts.map +1 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/run-artifacts.d.ts +2 -0
- package/dist/agents/run-artifacts.d.ts.map +1 -1
- package/dist/agents/run-plan.d.ts +1 -1
- package/dist/agents/run-plan.d.ts.map +1 -1
- package/dist/agents/run-session-http.d.ts.map +1 -1
- package/dist/agents/run-session-serve.d.ts.map +1 -1
- package/dist/agents/run-session-wire.d.ts +6 -0
- package/dist/agents/run-session-wire.d.ts.map +1 -1
- package/dist/agents/run-token.d.ts +6 -0
- package/dist/agents/run-token.d.ts.map +1 -1
- package/dist/agents/streams/index.js +1 -1
- package/dist/agents/streams/internal.js +2 -2
- package/dist/agents/thread-access.d.ts +13 -0
- package/dist/agents/thread-access.d.ts.map +1 -1
- package/dist/agents/tool-files.d.ts.map +1 -1
- package/dist/artifacts/caller.d.ts +10 -0
- package/dist/artifacts/caller.d.ts.map +1 -0
- package/dist/artifacts/comment-place.d.ts +26 -0
- package/dist/artifacts/comment-place.d.ts.map +1 -0
- package/dist/artifacts/comment-text.d.ts +12 -4
- package/dist/artifacts/comment-text.d.ts.map +1 -1
- package/dist/artifacts/comments.d.ts +8 -2
- package/dist/artifacts/comments.d.ts.map +1 -1
- package/dist/artifacts/errors.d.ts +1 -1
- package/dist/artifacts/errors.d.ts.map +1 -1
- package/dist/artifacts/execution.d.ts +73 -5
- package/dist/artifacts/execution.d.ts.map +1 -1
- package/dist/artifacts/frames/assets.d.ts +27 -7
- package/dist/artifacts/frames/assets.d.ts.map +1 -1
- package/dist/artifacts/frames/entries.d.ts +5 -4
- package/dist/artifacts/frames/entries.d.ts.map +1 -1
- package/dist/artifacts/frames/hyperframes.d.ts +12 -0
- package/dist/artifacts/frames/hyperframes.d.ts.map +1 -0
- package/dist/artifacts/frames/index.d.ts +3 -1
- package/dist/artifacts/frames/index.d.ts.map +1 -1
- package/dist/artifacts/frames/index.js +20 -6
- package/dist/artifacts/frames/index.js.map +3 -3
- package/dist/artifacts/frames/kit.d.ts.map +1 -1
- package/dist/artifacts/frames/protocol.d.ts +33 -0
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/video-runtime.d.ts +21 -0
- package/dist/artifacts/frames/video-runtime.d.ts.map +1 -0
- package/dist/artifacts/html.d.ts +23 -0
- package/dist/artifacts/html.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +5 -3
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +71 -10
- package/dist/artifacts/index.js.map +4 -4
- package/dist/artifacts/kinds.d.ts +1 -1
- package/dist/artifacts/kinds.d.ts.map +1 -1
- package/dist/artifacts/limits.d.ts +37 -0
- package/dist/artifacts/limits.d.ts.map +1 -1
- package/dist/artifacts/live/document.d.ts.map +1 -1
- package/dist/artifacts/live/index.d.ts +6 -2
- package/dist/artifacts/live/index.d.ts.map +1 -1
- package/dist/artifacts/live/index.js +3432 -13
- package/dist/artifacts/live/index.js.map +6 -3
- package/dist/artifacts/live/presence.d.ts +7 -5
- package/dist/artifacts/live/presence.d.ts.map +1 -1
- package/dist/artifacts/live/protocol.d.ts +4 -2
- package/dist/artifacts/live/protocol.d.ts.map +1 -1
- package/dist/artifacts/live/server.d.ts +1 -1
- package/dist/artifacts/live/server.d.ts.map +1 -1
- package/dist/artifacts/live/server.js +36 -31
- package/dist/artifacts/live/server.js.map +1 -1
- package/dist/artifacts/live/state.d.ts +2 -2
- package/dist/artifacts/media/media.d.ts +96 -0
- package/dist/artifacts/media/media.d.ts.map +1 -0
- package/dist/artifacts/media/transcriber.d.ts +29 -0
- package/dist/artifacts/media/transcriber.d.ts.map +1 -0
- package/dist/artifacts/outline.d.ts +26 -1
- package/dist/artifacts/outline.d.ts.map +1 -1
- package/dist/artifacts/publish/files.d.ts +5 -2
- package/dist/artifacts/publish/files.d.ts.map +1 -1
- package/dist/artifacts/publish/index.d.ts +11 -2
- package/dist/artifacts/publish/index.d.ts.map +1 -1
- package/dist/artifacts/publish/index.js +110 -33
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/pdf.d.ts.map +1 -1
- package/dist/artifacts/publish/previews.d.ts +7 -2
- package/dist/artifacts/publish/previews.d.ts.map +1 -1
- package/dist/artifacts/publish/publish.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/html.d.ts +5 -4
- package/dist/artifacts/publish/validate/html.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/video.d.ts +36 -0
- package/dist/artifacts/publish/validate/video.d.ts.map +1 -0
- package/dist/artifacts/publish/video.d.ts +79 -0
- package/dist/artifacts/publish/video.d.ts.map +1 -0
- package/dist/artifacts/resolve.d.ts +9 -0
- package/dist/artifacts/resolve.d.ts.map +1 -1
- package/dist/artifacts/video/composition.d.ts +183 -0
- package/dist/artifacts/video/composition.d.ts.map +1 -0
- package/dist/artifacts/video/edit.d.ts +298 -0
- package/dist/artifacts/video/edit.d.ts.map +1 -0
- package/dist/artifacts/video/export.d.ts +142 -0
- package/dist/artifacts/video/export.d.ts.map +1 -0
- package/dist/artifacts/video/looks.d.ts +133 -0
- package/dist/artifacts/video/looks.d.ts.map +1 -0
- package/dist/artifacts/video/project.d.ts +74 -0
- package/dist/artifacts/video/project.d.ts.map +1 -0
- package/dist/artifacts/video/stills.d.ts +65 -0
- package/dist/artifacts/video/stills.d.ts.map +1 -0
- package/dist/artifacts/video/timeline.d.ts +153 -0
- package/dist/artifacts/video/timeline.d.ts.map +1 -0
- package/dist/auth/index.js +9 -8
- package/dist/auth/index.js.map +1 -1
- package/dist/authorization/index.js +5 -4
- package/dist/authorization/index.js.map +1 -1
- package/dist/blob-storage/browser.d.ts +1 -1
- package/dist/blob-storage/browser.d.ts.map +1 -1
- package/dist/blob-storage/browser.js +8 -4
- package/dist/blob-storage/browser.js.map +1 -1
- package/dist/blob-storage/constants.d.ts +8 -3
- package/dist/blob-storage/constants.d.ts.map +1 -1
- package/dist/blob-storage/download-urls.d.ts +2 -2
- package/dist/blob-storage/download-urls.d.ts.map +1 -1
- package/dist/blob-storage/index.d.ts +1 -1
- package/dist/blob-storage/index.d.ts.map +1 -1
- package/dist/blob-storage/index.js +9 -5
- package/dist/blob-storage/index.js.map +1 -1
- package/dist/blob-storage/internal.d.ts +2 -2
- package/dist/blob-storage/internal.d.ts.map +1 -1
- package/dist/blob-storage/internal.js +10 -4
- package/dist/blob-storage/internal.js.map +1 -1
- package/dist/blob-storage/media-type.d.ts +12 -3
- package/dist/blob-storage/media-type.d.ts.map +1 -1
- package/dist/bootstrap/discovery.d.ts +6 -0
- package/dist/bootstrap/discovery.d.ts.map +1 -1
- package/dist/bootstrap/index.js +63 -60
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/{chunk-az95tsh3.js → chunk-0fjryajn.js} +3 -2
- package/dist/chunk-0fjryajn.js.map +11 -0
- package/dist/{chunk-9tpmfh3n.js → chunk-0mk8qqp9.js} +3 -3
- package/dist/{chunk-9tpmfh3n.js.map → chunk-0mk8qqp9.js.map} +3 -3
- package/dist/{chunk-88xeh6zx.js → chunk-1g4me5f2.js} +182 -7
- package/dist/{chunk-88xeh6zx.js.map → chunk-1g4me5f2.js.map} +3 -3
- package/dist/{chunk-7mhbs9yy.js → chunk-1z8ccj53.js} +1 -1
- package/dist/{chunk-wkv3h3q7.js → chunk-2138b0ng.js} +115 -8
- package/dist/chunk-2138b0ng.js.map +12 -0
- package/dist/chunk-23eaayw4.js +3757 -0
- package/dist/chunk-23eaayw4.js.map +22 -0
- package/dist/{chunk-s8xxef60.js → chunk-2mxq1yd9.js} +48 -41
- package/dist/{chunk-s8xxef60.js.map → chunk-2mxq1yd9.js.map} +6 -6
- package/dist/{chunk-dmnd9ea6.js → chunk-30a0ftnm.js} +2 -2
- package/dist/{chunk-nxysqbt0.js → chunk-389ybvw9.js} +6 -2
- package/dist/chunk-389ybvw9.js.map +10 -0
- package/dist/{chunk-qbd282aa.js → chunk-39q9ybav.js} +2 -2
- package/dist/{chunk-9c9yknwt.js → chunk-3d9w8t4n.js} +111 -23
- package/dist/{chunk-9c9yknwt.js.map → chunk-3d9w8t4n.js.map} +5 -5
- package/dist/chunk-3dvcdn9w.js +8 -0
- package/dist/chunk-3dvcdn9w.js.map +10 -0
- package/dist/{chunk-bcz9dxtf.js → chunk-3x902cja.js} +3 -3
- package/dist/{chunk-c4nrycdy.js → chunk-4q4a5a96.js} +1 -1
- package/dist/{chunk-7r9mqpva.js → chunk-4tdm3fsj.js} +100 -36
- package/dist/{chunk-7r9mqpva.js.map → chunk-4tdm3fsj.js.map} +10 -10
- package/dist/{chunk-ykchk644.js → chunk-4w8qzy9w.js} +6 -6
- package/dist/{chunk-c29729me.js → chunk-4z9xtxke.js} +8 -7
- package/dist/chunk-4z9xtxke.js.map +12 -0
- package/dist/chunk-5278qwax.js +270 -0
- package/dist/chunk-5278qwax.js.map +11 -0
- package/dist/{chunk-kft7mp7z.js → chunk-5xkqasvn.js} +1 -1
- package/dist/{chunk-k1g14kk3.js → chunk-6a4hp405.js} +4 -5
- package/dist/{chunk-k1g14kk3.js.map → chunk-6a4hp405.js.map} +3 -3
- package/dist/{chunk-xavet0qs.js → chunk-6whr25gw.js} +2 -2
- package/dist/{chunk-mbwsgjn7.js → chunk-7zygtcqq.js} +14 -2
- package/dist/chunk-7zygtcqq.js.map +11 -0
- package/dist/chunk-88s9z5pf.js +3 -0
- package/dist/{chunk-de5sfbc3.js.map → chunk-88s9z5pf.js.map} +1 -1
- package/dist/{chunk-ygvay56w.js → chunk-896te58g.js} +2 -2
- package/dist/{chunk-pqj8vff9.js → chunk-8eqqqc1h.js} +3 -3
- package/dist/{chunk-425ydk65.js → chunk-8tefbhdx.js} +14 -14
- package/dist/{chunk-425ydk65.js.map → chunk-8tefbhdx.js.map} +1 -1
- package/dist/{chunk-jka26v8c.js → chunk-8x1bsp68.js} +1 -1
- package/dist/{chunk-wzcjhv54.js → chunk-93e4w7te.js} +113 -1
- package/dist/chunk-93e4w7te.js.map +11 -0
- package/dist/{chunk-ym1bqd98.js → chunk-990a5bkc.js} +424 -76
- package/dist/chunk-990a5bkc.js.map +21 -0
- package/dist/{chunk-fmgf9h5e.js → chunk-9az7kjv4.js} +6 -6
- package/dist/{chunk-eg6xqef7.js → chunk-9e5t53z0.js} +3 -3
- package/dist/{chunk-eg6xqef7.js.map → chunk-9e5t53z0.js.map} +3 -3
- package/dist/{chunk-bs1sd0e0.js → chunk-9p7kyeqz.js} +4 -4
- package/dist/chunk-a68zz4r0.js +537 -0
- package/dist/chunk-a68zz4r0.js.map +11 -0
- package/dist/{chunk-d7vyc7k6.js → chunk-a700gjc8.js} +10 -2
- package/dist/chunk-a700gjc8.js.map +10 -0
- package/dist/{chunk-gfdh9kqa.js → chunk-a9qzjaz2.js} +2 -5
- package/dist/chunk-a9qzjaz2.js.map +10 -0
- package/dist/{chunk-ats8y3d9.js → chunk-as94vcty.js} +688 -504
- package/dist/{chunk-ats8y3d9.js.map → chunk-as94vcty.js.map} +21 -21
- package/dist/{chunk-brybqw5k.js → chunk-bkxm2dzx.js} +1 -1
- package/dist/{chunk-ppxf7gw2.js → chunk-d7t9jnym.js} +3 -3
- package/dist/{chunk-tapdssb5.js → chunk-e3b1r4d2.js} +8 -7
- package/dist/{chunk-tapdssb5.js.map → chunk-e3b1r4d2.js.map} +4 -4
- package/dist/{chunk-cg7cygfj.js → chunk-fdmvaz7x.js} +1 -1
- package/dist/{chunk-191jz8a6.js → chunk-ff0qdk7z.js} +1 -1
- package/dist/{chunk-9vsc919v.js → chunk-fgxvrxx4.js} +22 -2
- package/dist/chunk-fgxvrxx4.js.map +10 -0
- package/dist/{chunk-wx7smkn2.js → chunk-fq8drkp0.js} +1 -1
- package/dist/{chunk-60662fyv.js → chunk-fqms1a8c.js} +132 -4
- package/dist/{chunk-60662fyv.js.map → chunk-fqms1a8c.js.map} +8 -6
- package/dist/{chunk-v8a1qjzp.js → chunk-hpswfrjj.js} +1 -1
- package/dist/{chunk-qttqe1ah.js → chunk-jbg905hn.js} +80 -13
- package/dist/chunk-jbg905hn.js.map +25 -0
- package/dist/{chunk-bz5bnjjt.js → chunk-jjte0h4p.js} +1 -1
- package/dist/{chunk-jt012fxq.js → chunk-jwjwvzj1.js} +797 -51
- package/dist/chunk-jwjwvzj1.js.map +38 -0
- package/dist/{chunk-f05994as.js → chunk-k3vd2vyz.js} +6 -2
- package/dist/chunk-k3vd2vyz.js.map +10 -0
- package/dist/chunk-kcqpk9w1.js.map +2 -2
- package/dist/chunk-mvz89age.js.map +2 -2
- package/dist/{chunk-xrmbhap8.js → chunk-mwg0nwkb.js} +1 -1
- package/dist/{chunk-a3faa34j.js → chunk-nfjt8k8j.js} +1 -1
- package/dist/{chunk-394zjzjs.js → chunk-nhgqz3g3.js} +3 -3
- package/dist/{chunk-bqr703h4.js → chunk-p0c5kkhn.js} +23 -6
- package/dist/{chunk-bqr703h4.js.map → chunk-p0c5kkhn.js.map} +3 -3
- package/dist/{chunk-92wrka15.js → chunk-q150fnj9.js} +1 -1
- package/dist/{chunk-w3t94hm6.js → chunk-qk3zq25v.js} +1 -1
- package/dist/{chunk-6hfbz4d0.js → chunk-r588h4ev.js} +1 -1
- package/dist/chunk-rtkqczbr.js.map +2 -2
- package/dist/{chunk-3qtk0070.js → chunk-ssqbrts1.js} +86 -9
- package/dist/chunk-ssqbrts1.js.map +14 -0
- package/dist/{chunk-5qqmndhm.js → chunk-szzhrn3e.js} +1 -1
- package/dist/{chunk-n1hbwc6y.js → chunk-t6pfch4e.js} +1 -1
- package/dist/{chunk-xtztwpkh.js → chunk-v6h4tc2v.js} +86 -5
- package/dist/chunk-v6h4tc2v.js.map +12 -0
- package/dist/{chunk-brhp9d97.js → chunk-vmqjndb3.js} +2 -2
- package/dist/chunk-vtjzwymr.js.map +2 -2
- package/dist/{chunk-t19wjmnc.js → chunk-wpba6hhd.js} +54 -20
- package/dist/{chunk-t19wjmnc.js.map → chunk-wpba6hhd.js.map} +3 -3
- package/dist/{chunk-htdzx40w.js → chunk-wrb1x1ss.js} +12 -4
- package/dist/{chunk-htdzx40w.js.map → chunk-wrb1x1ss.js.map} +3 -3
- package/dist/{chunk-5sswe5ej.js → chunk-wsv23wvr.js} +2 -2
- package/dist/{chunk-90nqenq8.js → chunk-x0hqc54n.js} +4 -4
- package/dist/{chunk-sgx82nnt.js → chunk-xg31er4p.js} +43 -4
- package/dist/chunk-xg31er4p.js.map +10 -0
- package/dist/{chunk-3neam1y5.js → chunk-y3qb965a.js} +2 -2
- package/dist/{chunk-gaj8djsw.js → chunk-y57eawng.js} +10 -5
- package/dist/{chunk-gaj8djsw.js.map → chunk-y57eawng.js.map} +3 -3
- package/dist/{chunk-8ncg20rd.js → chunk-yah25st6.js} +5 -5
- package/dist/chunk-yah25st6.js.map +10 -0
- package/dist/{chunk-grt2j5vp.js → chunk-ywvxcmqj.js} +106 -13
- package/dist/{chunk-grt2j5vp.js.map → chunk-ywvxcmqj.js.map} +8 -7
- package/dist/{chunk-xf76csps.js → chunk-zmq9xc9s.js} +70 -31
- package/dist/{chunk-xf76csps.js.map → chunk-zmq9xc9s.js.map} +4 -3
- package/dist/datasets/write.js +8 -7
- package/dist/datasets/write.js.map +1 -1
- package/dist/deploy/index.d.ts +1 -1
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/internal.js +2 -2
- package/dist/deploy/internal.js.map +2 -2
- package/dist/deploy/types.d.ts +8 -58
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/env/index.d.ts +10 -3
- package/dist/env/index.d.ts.map +1 -1
- package/dist/env/index.js.map +2 -2
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/execution/agent.js +53 -50
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/kernel-operation.d.ts +1 -0
- package/dist/execution/kernel-operation.d.ts.map +1 -1
- package/dist/execution/primitive.js +53 -50
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.js +54 -51
- package/dist/execution/request.js.map +2 -2
- package/dist/execution/types.d.ts +5 -0
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +73 -67
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/index.js +9 -8
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/maintenance/index.js +9 -8
- package/dist/maintenance/index.js.map +2 -2
- package/dist/materializer/index.js +26 -24
- package/dist/materializer/index.js.map +1 -1
- package/dist/models/audio/runtime.d.ts +3 -1
- package/dist/models/audio/runtime.d.ts.map +1 -1
- package/dist/models/audio/speech.d.ts +2 -2
- package/dist/models/audio/speech.d.ts.map +1 -1
- package/dist/models/audio/types.d.ts +23 -3
- package/dist/models/audio/types.d.ts.map +1 -1
- package/dist/models/calls.d.ts +7 -0
- package/dist/models/calls.d.ts.map +1 -1
- package/dist/models/catalog.d.ts +5 -0
- package/dist/models/catalog.d.ts.map +1 -1
- package/dist/models/definitions.d.ts +3 -2
- package/dist/models/definitions.d.ts.map +1 -1
- package/dist/models/errors.d.ts +5 -3
- package/dist/models/errors.d.ts.map +1 -1
- package/dist/models/events.d.ts +2 -0
- package/dist/models/events.d.ts.map +1 -1
- package/dist/models/execution/index.d.ts +1 -0
- package/dist/models/execution/index.d.ts.map +1 -1
- package/dist/models/execution/index.js +33 -28
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/execution/model-call-limits.d.ts.map +1 -1
- package/dist/models/execution/model-call-recorder.d.ts +8 -0
- package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
- package/dist/models/execution/session.d.ts +12 -0
- package/dist/models/execution/session.d.ts.map +1 -1
- package/dist/models/execution/usage.d.ts.map +1 -1
- package/dist/models/execution.d.ts +1 -1
- package/dist/models/execution.d.ts.map +1 -1
- package/dist/models/generation-types.d.ts +2 -0
- package/dist/models/generation-types.d.ts.map +1 -1
- package/dist/models/index.d.ts +4 -2
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +2 -2
- package/dist/models/input-file.d.ts.map +1 -1
- package/dist/models/pricing.d.ts +2 -1
- package/dist/models/pricing.d.ts.map +1 -1
- package/dist/models/rate-card.d.ts +6 -0
- package/dist/models/rate-card.d.ts.map +1 -1
- package/dist/models/tools.d.ts +5 -0
- package/dist/models/tools.d.ts.map +1 -1
- package/dist/models/video/catalog.d.ts +13 -0
- package/dist/models/video/catalog.d.ts.map +1 -0
- package/dist/models/video/check.d.ts +76 -0
- package/dist/models/video/check.d.ts.map +1 -0
- package/dist/models/video/runtime.d.ts +21 -0
- package/dist/models/video/runtime.d.ts.map +1 -0
- package/dist/models/video/types.d.ts +188 -0
- package/dist/models/video/types.d.ts.map +1 -0
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +53 -50
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/index.js +25 -23
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/sdk/object-set.d.ts.map +1 -1
- package/dist/ontology/index.js +4 -4
- package/dist/ontology/internal.js +4 -4
- package/dist/pipelines/index.js +28 -26
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/internal.js +26 -24
- package/dist/projections/internal.js.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/types.d.ts +103 -6
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/definitions.d.ts +14 -0
- package/dist/runtime/definitions.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +3 -1
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +3 -1
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +49 -43
- package/dist/runtime/internal.js.map +2 -2
- package/dist/runtime/resolve-definitions.d.ts +2 -1
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/sandboxes/errors.d.ts +19 -0
- package/dist/sandboxes/errors.d.ts.map +1 -1
- package/dist/sandboxes/exec.d.ts +2 -0
- package/dist/sandboxes/exec.d.ts.map +1 -1
- package/dist/sandboxes/index.d.ts +1 -1
- package/dist/sandboxes/index.d.ts.map +1 -1
- package/dist/sandboxes/index.js +14 -8
- package/dist/sandboxes/index.js.map +1 -1
- package/dist/sandboxes/sandbox.d.ts +15 -1
- package/dist/sandboxes/sandbox.d.ts.map +1 -1
- package/dist/security/public.d.ts +6 -4
- package/dist/security/public.d.ts.map +1 -1
- package/dist/security/public.js +5 -3
- package/dist/security/public.js.map +1 -1
- package/dist/shares/internal.js +25 -23
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/agents/in-memory.d.ts +2 -1
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +1 -1
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +5 -5
- package/dist/storage/agents/types.d.ts +27 -1
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/analytics.d.ts +1 -0
- package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
- package/dist/storage/ai-cost/groups.d.ts +2 -0
- package/dist/storage/ai-cost/groups.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +5 -5
- package/dist/storage/ai-cost/types.d.ts +2 -1
- package/dist/storage/ai-cost/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/validation.d.ts.map +1 -1
- package/dist/storage/ai-limits/enforcement.js +3 -3
- package/dist/storage/ai-limits/provider.js +2 -2
- package/dist/storage/ai-usage/in-memory.d.ts +8 -1
- package/dist/storage/ai-usage/in-memory.d.ts.map +1 -1
- package/dist/storage/ai-usage/index.d.ts +2 -2
- package/dist/storage/ai-usage/index.d.ts.map +1 -1
- package/dist/storage/ai-usage/record.d.ts +11 -1
- package/dist/storage/ai-usage/record.d.ts.map +1 -1
- package/dist/storage/ai-usage/types.d.ts +80 -1
- package/dist/storage/ai-usage/types.d.ts.map +1 -1
- package/dist/storage/ai-usage/usage.d.ts +1 -1
- package/dist/storage/ai-usage/usage.d.ts.map +1 -1
- package/dist/storage/artifacts/in-memory.d.ts +25 -2
- package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
- package/dist/storage/artifacts/index.d.ts +1 -1
- package/dist/storage/artifacts/index.d.ts.map +1 -1
- package/dist/storage/artifacts/record.d.ts +12 -1
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +198 -6
- package/dist/storage/artifacts/types.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +3 -2
- package/dist/storage/executions/provider.js.map +1 -1
- package/dist/storage/file-upload-sessions/provider.js +10 -9
- package/dist/storage/file-upload-sessions/provider.js.map +1 -1
- package/dist/storage/in-memory/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +25 -23
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +2 -2
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +34 -14
- package/dist/storage/internal.js.map +2 -2
- package/dist/storage/workflow-runs/provider.js +10 -9
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/syncs/index.js +29 -27
- package/dist/syncs/index.js.map +1 -1
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
- package/dist/testing/artifact-storage-contract.d.ts +3 -0
- package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.js +686 -75
- package/dist/testing/index.js.map +10 -10
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/testing/sandboxes-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +26 -24
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workers/index.js +5 -5
- package/dist/workers/index.js.map +1 -1
- package/dist/workflows/index.js +60 -57
- package/dist/workflows/index.js.map +1 -1
- package/package.json +3 -1
- package/src/actions/request.ts +2 -0
- package/src/actions/run/context.ts +1 -0
- package/src/actions/run/execute.ts +5 -1
- package/src/actions/run/executor.ts +4 -0
- package/src/actions/run/normalize.ts +4 -0
- package/src/actions/run/types.ts +6 -0
- package/src/actions/types/context.ts +7 -0
- package/src/agents/README.md +3 -1
- package/src/agents/context/entries.ts +63 -9
- package/src/agents/context-model.ts +9 -0
- package/src/agents/context-resolution.ts +7 -0
- package/src/agents/execution.ts +39 -0
- package/src/agents/index.ts +1 -0
- package/src/agents/model-call-retry.ts +69 -0
- package/src/agents/model-loop.ts +86 -12
- package/src/agents/model-routing.ts +104 -38
- package/src/agents/request.ts +27 -1
- package/src/agents/run-artifacts.ts +10 -5
- package/src/agents/run-plan.ts +2 -1
- package/src/agents/run-session-http.ts +1 -0
- package/src/agents/run-session-serve.ts +23 -2
- package/src/agents/run-session-wire.ts +45 -0
- package/src/agents/run-token.ts +7 -0
- package/src/agents/thread-access.ts +34 -1
- package/src/agents/tool-files.ts +23 -7
- package/src/artifacts/caller.ts +42 -0
- package/src/artifacts/comment-place.ts +51 -0
- package/src/artifacts/comment-text.ts +50 -7
- package/src/artifacts/comments.ts +132 -34
- package/src/artifacts/errors.ts +1 -0
- package/src/artifacts/execution.ts +249 -5
- package/src/artifacts/frames/assets.ts +93 -15
- package/src/artifacts/frames/entries.ts +7 -4
- package/src/artifacts/frames/generated/hyperframes-notices.txt +290 -0
- package/src/artifacts/frames/generated/hyperframes.txt +1145 -0
- package/src/artifacts/frames/generated.d.ts +5 -0
- package/src/artifacts/frames/hyperframes.ts +14 -0
- package/src/artifacts/frames/index.ts +5 -0
- package/src/artifacts/frames/kit.ts +7 -3
- package/src/artifacts/frames/protocol.ts +56 -0
- package/src/artifacts/frames/video-runtime.ts +165 -0
- package/src/artifacts/html.ts +13 -0
- package/src/artifacts/index.ts +7 -0
- package/src/artifacts/kinds.ts +9 -1
- package/src/artifacts/limits.ts +43 -0
- package/src/artifacts/live/document.ts +27 -3
- package/src/artifacts/live/index.ts +58 -2
- package/src/artifacts/live/presence.ts +17 -5
- package/src/artifacts/live/protocol.ts +4 -2
- package/src/artifacts/live/server.ts +1 -1
- package/src/artifacts/live/state.ts +3 -3
- package/src/artifacts/media/README.md +75 -0
- package/src/artifacts/media/media.ts +316 -0
- package/src/artifacts/media/transcriber.ts +84 -0
- package/src/artifacts/outline.ts +28 -0
- package/src/artifacts/publish/files.ts +19 -6
- package/src/artifacts/publish/index.ts +49 -2
- package/src/artifacts/publish/pdf.ts +3 -1
- package/src/artifacts/publish/previews.ts +22 -8
- package/src/artifacts/publish/publish.ts +4 -1
- package/src/artifacts/publish/validate/html.ts +23 -18
- package/src/artifacts/publish/validate/video.ts +309 -0
- package/src/artifacts/publish/video.ts +235 -0
- package/src/artifacts/resolve.ts +45 -0
- package/src/artifacts/video/README.md +402 -0
- package/src/artifacts/video/composition.ts +898 -0
- package/src/artifacts/video/edit.ts +3967 -0
- package/src/artifacts/video/export.ts +352 -0
- package/src/artifacts/video/looks.ts +694 -0
- package/src/artifacts/video/project.ts +198 -0
- package/src/artifacts/video/stills.ts +168 -0
- package/src/artifacts/video/timeline.ts +658 -0
- package/src/blob-storage/browser.ts +1 -1
- package/src/blob-storage/constants.ts +9 -3
- package/src/blob-storage/download-urls.ts +5 -3
- package/src/blob-storage/index.ts +1 -0
- package/src/blob-storage/internal.ts +13 -2
- package/src/blob-storage/media-type.ts +149 -8
- package/src/bootstrap/discovery.ts +61 -11
- package/src/deploy/index.ts +0 -5
- package/src/deploy/types.ts +8 -63
- package/src/deploy/validation.ts +1 -1
- package/src/env/index.ts +10 -4
- package/src/errors/catalog.ts +2 -1
- package/src/execution/authorization.ts +2 -2
- package/src/execution/kernel-operation.ts +14 -0
- package/src/execution/types.ts +2 -0
- package/src/http/api-routes.ts +117 -0
- package/src/index.ts +21 -1
- package/src/lake-storage/definition-updates.ts +3 -9
- package/src/models/audio/runtime.ts +48 -3
- package/src/models/audio/speech.ts +2 -2
- package/src/models/audio/types.ts +24 -3
- package/src/models/calls.ts +35 -18
- package/src/models/catalog.ts +9 -2
- package/src/models/definitions.ts +4 -2
- package/src/models/errors.ts +5 -3
- package/src/models/events.ts +2 -0
- package/src/models/execution/README.md +68 -2
- package/src/models/execution/index.ts +1 -0
- package/src/models/execution/model-call-limits.ts +11 -5
- package/src/models/execution/model-call-recorder.ts +14 -0
- package/src/models/execution/session.ts +52 -23
- package/src/models/execution/usage.ts +1 -0
- package/src/models/execution.ts +13 -2
- package/src/models/generation-types.ts +2 -0
- package/src/models/index.ts +20 -1
- package/src/models/input-file.ts +7 -2
- package/src/models/pricing.ts +19 -1
- package/src/models/rate-card.ts +15 -3
- package/src/models/tools.ts +5 -0
- package/src/models/video/catalog.ts +101 -0
- package/src/models/video/check.ts +441 -0
- package/src/models/video/runtime.ts +550 -0
- package/src/models/video/types.ts +194 -0
- package/src/objects/execution.ts +2 -0
- package/src/objects/sdk/object-set.ts +2 -0
- package/src/queues/index.ts +5 -0
- package/src/queues/types.ts +126 -5
- package/src/runtime/create.ts +1 -0
- package/src/runtime/definitions.ts +25 -0
- package/src/runtime/host.ts +6 -1
- package/src/runtime/index.ts +6 -1
- package/src/runtime/internal.ts +3 -1
- package/src/runtime/resolve-definitions.ts +7 -1
- package/src/runtime/sixb.ts +12 -4
- package/src/sandboxes/README.md +12 -2
- package/src/sandboxes/errors.ts +27 -0
- package/src/sandboxes/exec.ts +3 -1
- package/src/sandboxes/index.ts +3 -0
- package/src/sandboxes/sandbox.ts +15 -1
- package/src/security/public.ts +6 -4
- package/src/storage/agents/in-memory.ts +39 -0
- package/src/storage/agents/index.ts +1 -0
- package/src/storage/agents/provider.ts +8 -0
- package/src/storage/agents/types.ts +32 -1
- package/src/storage/ai-cost/analytics.ts +2 -0
- package/src/storage/ai-cost/codec.ts +1 -0
- package/src/storage/ai-cost/groups.ts +7 -0
- package/src/storage/ai-cost/types.ts +2 -0
- package/src/storage/ai-cost/validation.ts +2 -0
- package/src/storage/ai-usage/in-memory.ts +93 -0
- package/src/storage/ai-usage/index.ts +10 -0
- package/src/storage/ai-usage/record.ts +106 -0
- package/src/storage/ai-usage/types.ts +102 -1
- package/src/storage/ai-usage/usage.ts +2 -0
- package/src/storage/artifacts/in-memory.ts +108 -11
- package/src/storage/artifacts/index.ts +14 -0
- package/src/storage/artifacts/record.ts +203 -1
- package/src/storage/artifacts/types.ts +199 -6
- package/src/storage/executions/validation.ts +2 -2
- package/src/storage/in-memory/index.ts +1 -1
- package/src/storage/index.ts +22 -1
- package/src/storage/internal.ts +9 -0
- package/src/testing/agent-storage-contract.ts +135 -0
- package/src/testing/ai-cost-storage-contract.ts +1 -0
- package/src/testing/ai-usage-storage-contract.ts +145 -1
- package/src/testing/artifact-storage-contract.ts +330 -0
- package/src/testing/execution-storage-contract.ts +10 -2
- package/src/testing/lake-storage-contract.ts +27 -0
- package/src/testing/queues-contract.ts +71 -0
- package/src/testing/sandboxes-contract.ts +50 -0
- package/dist/chunk-3723kgba.js +0 -29
- package/dist/chunk-3723kgba.js.map +0 -10
- package/dist/chunk-3qtk0070.js.map +0 -14
- package/dist/chunk-8ncg20rd.js.map +0 -10
- package/dist/chunk-9vsc919v.js.map +0 -10
- package/dist/chunk-az95tsh3.js.map +0 -11
- package/dist/chunk-c29729me.js.map +0 -12
- package/dist/chunk-d7vyc7k6.js.map +0 -10
- package/dist/chunk-de5sfbc3.js +0 -3
- package/dist/chunk-f05994as.js.map +0 -10
- package/dist/chunk-gfdh9kqa.js.map +0 -11
- package/dist/chunk-jt012fxq.js.map +0 -34
- package/dist/chunk-mbwsgjn7.js.map +0 -11
- package/dist/chunk-nxysqbt0.js.map +0 -10
- package/dist/chunk-qttqe1ah.js.map +0 -24
- package/dist/chunk-sgx82nnt.js.map +0 -10
- package/dist/chunk-vs2s3p8n.js +0 -2274
- package/dist/chunk-vs2s3p8n.js.map +0 -20
- package/dist/chunk-wkv3h3q7.js.map +0 -12
- package/dist/chunk-wzcjhv54.js.map +0 -11
- package/dist/chunk-xtztwpkh.js.map +0 -12
- package/dist/chunk-ym1bqd98.js.map +0 -19
- /package/dist/{chunk-7mhbs9yy.js.map → chunk-1z8ccj53.js.map} +0 -0
- /package/dist/{chunk-dmnd9ea6.js.map → chunk-30a0ftnm.js.map} +0 -0
- /package/dist/{chunk-qbd282aa.js.map → chunk-39q9ybav.js.map} +0 -0
- /package/dist/{chunk-bcz9dxtf.js.map → chunk-3x902cja.js.map} +0 -0
- /package/dist/{chunk-c4nrycdy.js.map → chunk-4q4a5a96.js.map} +0 -0
- /package/dist/{chunk-ykchk644.js.map → chunk-4w8qzy9w.js.map} +0 -0
- /package/dist/{chunk-kft7mp7z.js.map → chunk-5xkqasvn.js.map} +0 -0
- /package/dist/{chunk-xavet0qs.js.map → chunk-6whr25gw.js.map} +0 -0
- /package/dist/{chunk-ygvay56w.js.map → chunk-896te58g.js.map} +0 -0
- /package/dist/{chunk-pqj8vff9.js.map → chunk-8eqqqc1h.js.map} +0 -0
- /package/dist/{chunk-jka26v8c.js.map → chunk-8x1bsp68.js.map} +0 -0
- /package/dist/{chunk-fmgf9h5e.js.map → chunk-9az7kjv4.js.map} +0 -0
- /package/dist/{chunk-bs1sd0e0.js.map → chunk-9p7kyeqz.js.map} +0 -0
- /package/dist/{chunk-brybqw5k.js.map → chunk-bkxm2dzx.js.map} +0 -0
- /package/dist/{chunk-ppxf7gw2.js.map → chunk-d7t9jnym.js.map} +0 -0
- /package/dist/{chunk-cg7cygfj.js.map → chunk-fdmvaz7x.js.map} +0 -0
- /package/dist/{chunk-191jz8a6.js.map → chunk-ff0qdk7z.js.map} +0 -0
- /package/dist/{chunk-wx7smkn2.js.map → chunk-fq8drkp0.js.map} +0 -0
- /package/dist/{chunk-v8a1qjzp.js.map → chunk-hpswfrjj.js.map} +0 -0
- /package/dist/{chunk-bz5bnjjt.js.map → chunk-jjte0h4p.js.map} +0 -0
- /package/dist/{chunk-xrmbhap8.js.map → chunk-mwg0nwkb.js.map} +0 -0
- /package/dist/{chunk-a3faa34j.js.map → chunk-nfjt8k8j.js.map} +0 -0
- /package/dist/{chunk-394zjzjs.js.map → chunk-nhgqz3g3.js.map} +0 -0
- /package/dist/{chunk-92wrka15.js.map → chunk-q150fnj9.js.map} +0 -0
- /package/dist/{chunk-w3t94hm6.js.map → chunk-qk3zq25v.js.map} +0 -0
- /package/dist/{chunk-6hfbz4d0.js.map → chunk-r588h4ev.js.map} +0 -0
- /package/dist/{chunk-5qqmndhm.js.map → chunk-szzhrn3e.js.map} +0 -0
- /package/dist/{chunk-n1hbwc6y.js.map → chunk-t6pfch4e.js.map} +0 -0
- /package/dist/{chunk-brhp9d97.js.map → chunk-vmqjndb3.js.map} +0 -0
- /package/dist/{chunk-5sswe5ej.js.map → chunk-wsv23wvr.js.map} +0 -0
- /package/dist/{chunk-90nqenq8.js.map → chunk-x0hqc54n.js.map} +0 -0
- /package/dist/{chunk-3neam1y5.js.map → chunk-y3qb965a.js.map} +0 -0
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
import type { BlobStorage, FileRef } from "../../blob-storage/types"
|
|
2
|
+
import type { ReadonlyJsonObject } from "../../json"
|
|
3
|
+
import type { AgentQueueJob, Queue } from "../../queues"
|
|
4
|
+
import type { SixbHostContext } from "../../runtime/types"
|
|
5
|
+
import {
|
|
6
|
+
AiLimitStorageError,
|
|
7
|
+
type AiModelCallOperationRecord,
|
|
8
|
+
type AiUsageStorage,
|
|
9
|
+
} from "../../storage"
|
|
10
|
+
import type { ExecutionRecord } from "../../storage/executions"
|
|
11
|
+
import type { ModelCatalog } from "../catalog"
|
|
12
|
+
import { ModelProviderError } from "../errors"
|
|
13
|
+
import type { ModelCallEndEvent, ModelUsage } from "../events"
|
|
14
|
+
import type { AiModelCallRecorder } from "../execution/model-call-recorder"
|
|
15
|
+
import { createExecutionRecorder } from "../execution/session"
|
|
16
|
+
import { estimateModelCall, type ModelCallCost } from "../pricing"
|
|
17
|
+
import type { ModelPricingDimensions } from "../rate-card"
|
|
18
|
+
import { assertVideoModel } from "./catalog"
|
|
19
|
+
import type { VideoData, VideoModel, VideoModelResponseMetadata, VideoModelStatus } from "./types"
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* How long a generation may stay pending before Sixb gives up on it. The Gateway waits ten minutes
|
|
23
|
+
* on a provider's task, and providers' own task timeouts are ten minutes at most: a job pending for
|
|
24
|
+
* an hour will not finish, and a hosted result that late would be gone anyway.
|
|
25
|
+
*/
|
|
26
|
+
export const VIDEO_GENERATION_CEILING_MS = 60 * 60_000
|
|
27
|
+
|
|
28
|
+
/** The scheduled check waits a quarter of a generation's age, from one minute up to five. */
|
|
29
|
+
const SCHEDULED_CHECK_MIN_DELAY_MS = 60_000
|
|
30
|
+
const SCHEDULED_CHECK_MAX_DELAY_MS = 5 * 60_000
|
|
31
|
+
|
|
32
|
+
/** What the operation record keeps to price the call once it ends. */
|
|
33
|
+
export interface StoredVideoRequest {
|
|
34
|
+
readonly n: number
|
|
35
|
+
readonly durationSeconds?: number
|
|
36
|
+
readonly dimensions?: ModelPricingDimensions
|
|
37
|
+
readonly warnings: readonly string[]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** What a settled call reported, for every later look at it. */
|
|
41
|
+
export interface StoredVideoResult {
|
|
42
|
+
readonly usage: Omit<ModelUsage, "raw">
|
|
43
|
+
readonly cost: ModelCallCost
|
|
44
|
+
readonly warnings: readonly string[]
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** What checking on a generation needs, in a request or in a queue job. */
|
|
48
|
+
export interface VideoCheckContext {
|
|
49
|
+
readonly projectId: string
|
|
50
|
+
readonly storage: Pick<SixbHostContext["storage"], "executions"> & {
|
|
51
|
+
readonly aiUsage: AiUsageStorage
|
|
52
|
+
}
|
|
53
|
+
readonly catalog: ModelCatalog | undefined
|
|
54
|
+
readonly blobs: BlobStorage | undefined
|
|
55
|
+
/** The recorder of the execution attempt that admitted the call. */
|
|
56
|
+
accountingFor(execution: ExecutionRecord, attempt: number): Promise<AiModelCallRecorder>
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Look at a pending generation once. The look that sees it end records the call as the attempt
|
|
61
|
+
* that admitted it, stores the videos and settles it; past the ceiling, a job still running, or
|
|
62
|
+
* one Sixb can no longer ask about, is settled as failed. Returns the record as it now stands.
|
|
63
|
+
*/
|
|
64
|
+
export async function checkVideoOperation(
|
|
65
|
+
context: VideoCheckContext,
|
|
66
|
+
record: AiModelCallOperationRecord,
|
|
67
|
+
options: { readonly binding?: VideoModel; readonly signal: AbortSignal }
|
|
68
|
+
): Promise<AiModelCallOperationRecord> {
|
|
69
|
+
const pastCeiling = Date.now() - record.createdAt.getTime() >= VIDEO_GENERATION_CEILING_MS
|
|
70
|
+
|
|
71
|
+
// Its start is under way, or the process starting it stopped before keeping the handle.
|
|
72
|
+
const operation = record.operation
|
|
73
|
+
if (operation === undefined) return pastCeiling ? expire(context, record) : record
|
|
74
|
+
|
|
75
|
+
let model: VideoModel
|
|
76
|
+
let status: VideoModelStatus
|
|
77
|
+
try {
|
|
78
|
+
model = await resolveVideoModel(options.binding ?? catalogModel(context.catalog, record))
|
|
79
|
+
status = await model.status({ operation, signal: options.signal })
|
|
80
|
+
if (!isStatus(status)) {
|
|
81
|
+
throw new ModelProviderError(
|
|
82
|
+
"[SixbModels] Invalid video status response.",
|
|
83
|
+
model.providerId,
|
|
84
|
+
model.modelId,
|
|
85
|
+
{ code: "invalid_video_response", retryable: false }
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
} catch (error) {
|
|
89
|
+
if (pastCeiling) return expire(context, record)
|
|
90
|
+
throw error
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (status.status === "pending") return pastCeiling ? expire(context, record) : record
|
|
94
|
+
|
|
95
|
+
const accounting = await originAccounting(context, record)
|
|
96
|
+
const stored = storedVideoRequest(record)
|
|
97
|
+
if (status.status === "failed") {
|
|
98
|
+
const event = await recordVideos(accounting, model, record, stored, status, 0)
|
|
99
|
+
return settle(context, record, event, stored.warnings, describeFailure(status.error))
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// A completed, billable reply is recorded before its videos are checked or stored.
|
|
103
|
+
const returned = Array.isArray(status.output?.videos) ? status.output.videos : undefined
|
|
104
|
+
const event = await recordVideos(accounting, model, record, stored, status, returned?.length)
|
|
105
|
+
const warnings = [...stored.warnings, ...(isWarnings(status.warnings) ? status.warnings : [])]
|
|
106
|
+
if (!returned?.length || !returned.every(isVideoData)) {
|
|
107
|
+
return settle(context, record, event, warnings, "The provider returned no readable video.")
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Kept before the videos are stored: a check that cannot store them still knows the call is in
|
|
111
|
+
// the ledger, so it never marks the budget the call spent as unknown.
|
|
112
|
+
const result = videoResult(event, warnings)
|
|
113
|
+
await context.storage.aiUsage.recordModelCallOperationResult({
|
|
114
|
+
projectId: record.projectId,
|
|
115
|
+
callId: record.callId,
|
|
116
|
+
result: result as unknown as ReadonlyJsonObject,
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
try {
|
|
120
|
+
const files = await storeVideos(context.blobs, returned)
|
|
121
|
+
await accounting.recordFiles(record.callId, files)
|
|
122
|
+
} catch (error) {
|
|
123
|
+
// Past the ceiling, the call ends without its videos instead of being retried forever.
|
|
124
|
+
if (pastCeiling) return settleRecord(context.storage.aiUsage, record, unstored(result))
|
|
125
|
+
throw error
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return settleRecord(context.storage.aiUsage, record, { result })
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function storedVideoRequest(record: AiModelCallOperationRecord): StoredVideoRequest {
|
|
132
|
+
return record.request as unknown as StoredVideoRequest
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function storedVideoResult(record: AiModelCallOperationRecord): StoredVideoResult {
|
|
136
|
+
return record.result as unknown as StoredVideoResult
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// ── The scheduled check ─────────────────────────────────────
|
|
140
|
+
|
|
141
|
+
/** The host a queue job checks a generation with, outside any request. */
|
|
142
|
+
export type VideoCheckHost = Pick<SixbHostContext, "projectId" | "storage" | "queues"> & {
|
|
143
|
+
readonly catalog: ModelCatalog | undefined
|
|
144
|
+
readonly blobs: BlobStorage | undefined
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function checkJobId(callId: string): string {
|
|
148
|
+
return `agt_model_call_check_${callId}`
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Check on a generation later from the agent worker's queue, so it settles, and its budget is
|
|
153
|
+
* released, even when no client asks again. One job per call: scheduling again moves it.
|
|
154
|
+
*/
|
|
155
|
+
export async function scheduleVideoCheck(
|
|
156
|
+
queue: Pick<Queue<AgentQueueJob>, "enqueue">,
|
|
157
|
+
record: Pick<AiModelCallOperationRecord, "projectId" | "callId" | "createdAt">
|
|
158
|
+
): Promise<void> {
|
|
159
|
+
const age = Date.now() - record.createdAt.getTime()
|
|
160
|
+
const delay = Math.min(
|
|
161
|
+
Math.max(age / 4, SCHEDULED_CHECK_MIN_DELAY_MS),
|
|
162
|
+
SCHEDULED_CHECK_MAX_DELAY_MS
|
|
163
|
+
)
|
|
164
|
+
await queue.enqueue({
|
|
165
|
+
projectId: record.projectId,
|
|
166
|
+
jobs: [
|
|
167
|
+
{
|
|
168
|
+
id: checkJobId(record.callId),
|
|
169
|
+
type: "agent.model-call.check.requested",
|
|
170
|
+
payload: { callId: record.callId },
|
|
171
|
+
availableAt: new Date(Date.now() + delay).toISOString(),
|
|
172
|
+
replace: true,
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
})
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The agent worker's check job: look at the generation once, then schedule the next look while it
|
|
180
|
+
* runs. A failure to ask throws, and the worker retries the job.
|
|
181
|
+
*/
|
|
182
|
+
export async function runScheduledVideoCheck(
|
|
183
|
+
host: VideoCheckHost,
|
|
184
|
+
callId: string,
|
|
185
|
+
signal: AbortSignal
|
|
186
|
+
): Promise<void> {
|
|
187
|
+
const aiUsage = host.storage.aiUsage
|
|
188
|
+
if (!aiUsage) throw new Error("[SixbModels] Video generation requires storage.aiUsage.")
|
|
189
|
+
|
|
190
|
+
const record = await aiUsage.getModelCallOperation({ projectId: host.projectId, callId })
|
|
191
|
+
if (!record || record.modelKind !== "video" || record.status !== "pending") return
|
|
192
|
+
|
|
193
|
+
const checked = await checkVideoOperation(
|
|
194
|
+
{
|
|
195
|
+
projectId: host.projectId,
|
|
196
|
+
storage: { executions: host.storage.executions, aiUsage },
|
|
197
|
+
catalog: host.catalog,
|
|
198
|
+
blobs: host.blobs,
|
|
199
|
+
accountingFor: async (execution, attempt) =>
|
|
200
|
+
createExecutionRecorder(host, execution, attempt),
|
|
201
|
+
},
|
|
202
|
+
record,
|
|
203
|
+
{ signal }
|
|
204
|
+
)
|
|
205
|
+
if (checked.status === "pending") await scheduleVideoCheck(host.queues.agents, checked)
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// ── Settling ────────────────────────────────────────────────
|
|
209
|
+
|
|
210
|
+
/** The recorder of the attempt that admitted the call, holding the budget it reserved. */
|
|
211
|
+
async function originAccounting(
|
|
212
|
+
context: VideoCheckContext,
|
|
213
|
+
record: AiModelCallOperationRecord
|
|
214
|
+
): Promise<AiModelCallRecorder> {
|
|
215
|
+
const origin = await context.storage.executions.getById({
|
|
216
|
+
projectId: context.projectId,
|
|
217
|
+
id: record.executionId,
|
|
218
|
+
})
|
|
219
|
+
if (!origin) {
|
|
220
|
+
throw new Error(`[SixbModels] Video generation '${record.callId}' has no execution record.`)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const accounting = await context.accountingFor(origin, record.attempt)
|
|
224
|
+
accounting.resumeCall(record.callId, record.reserved)
|
|
225
|
+
return accounting
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/** Give up on a generation past the ceiling. */
|
|
229
|
+
async function expire(
|
|
230
|
+
context: VideoCheckContext,
|
|
231
|
+
record: AiModelCallOperationRecord
|
|
232
|
+
): Promise<AiModelCallOperationRecord> {
|
|
233
|
+
// Already in the ledger: what the provider billed stands, only the videos are missing.
|
|
234
|
+
if (record.result !== undefined) {
|
|
235
|
+
return settleRecord(context.storage.aiUsage, record, unstored(storedVideoResult(record)))
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const minutes = VIDEO_GENERATION_CEILING_MS / 60_000
|
|
239
|
+
return abandonVideoOperation(
|
|
240
|
+
context.storage.aiUsage,
|
|
241
|
+
record,
|
|
242
|
+
await originAccounting(context, record),
|
|
243
|
+
`The provider did not finish the video within ${minutes} minutes.`
|
|
244
|
+
)
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Settle a generation whose end Sixb cannot learn as failed. Whether the provider billed it is
|
|
249
|
+
* unknown, so its reservation becomes unknown, as for a language call that never finished:
|
|
250
|
+
* recording it as free could under-count a job the provider charged for.
|
|
251
|
+
*/
|
|
252
|
+
export async function abandonVideoOperation(
|
|
253
|
+
storage: AiUsageStorage,
|
|
254
|
+
record: AiModelCallOperationRecord,
|
|
255
|
+
accounting: AiModelCallRecorder,
|
|
256
|
+
error: string
|
|
257
|
+
): Promise<AiModelCallOperationRecord> {
|
|
258
|
+
const result: StoredVideoResult = {
|
|
259
|
+
usage: {},
|
|
260
|
+
cost: { status: "unpriceable", reason: "missing-usage" },
|
|
261
|
+
warnings: storedVideoRequest(record).warnings,
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
try {
|
|
265
|
+
await accounting.markCallUnknown(record.callId)
|
|
266
|
+
} catch (markError) {
|
|
267
|
+
if (!isReconciled(markError)) throw markError
|
|
268
|
+
|
|
269
|
+
// A check put the call in the ledger, then could not keep what it reported: what the provider
|
|
270
|
+
// billed stands there, and only this record misses it.
|
|
271
|
+
return settleRecord(storage, record, { error: LOST_OUTCOME, result })
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return settleRecord(storage, record, { error, result })
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
const LOST_OUTCOME = "The provider ended the video, but Sixb could not keep its outcome."
|
|
278
|
+
|
|
279
|
+
/** The limits store refuses to mark unknown a reservation that recording the call reconciled. */
|
|
280
|
+
function isReconciled(error: unknown): boolean {
|
|
281
|
+
return error instanceof AiLimitStorageError && error.code === "invalid_reservation_state"
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
async function settle(
|
|
285
|
+
context: VideoCheckContext,
|
|
286
|
+
record: AiModelCallOperationRecord,
|
|
287
|
+
event: ModelCallEndEvent,
|
|
288
|
+
warnings: readonly string[],
|
|
289
|
+
error?: string
|
|
290
|
+
): Promise<AiModelCallOperationRecord> {
|
|
291
|
+
return settleRecord(context.storage.aiUsage, record, {
|
|
292
|
+
...(error === undefined ? {} : { error }),
|
|
293
|
+
result: videoResult(event, warnings),
|
|
294
|
+
})
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function videoResult(event: ModelCallEndEvent, warnings: readonly string[]): StoredVideoResult {
|
|
298
|
+
const { raw: _, ...usage } = event.usage
|
|
299
|
+
return { usage, cost: event.cost, warnings }
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/** A call recorded in the ledger whose videos Sixb could not store. */
|
|
303
|
+
function unstored(result: StoredVideoResult) {
|
|
304
|
+
return { error: "The provider made the video, but Sixb could not store it.", result }
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
async function storeVideos(
|
|
308
|
+
blobs: BlobStorage | undefined,
|
|
309
|
+
videos: readonly VideoData[]
|
|
310
|
+
): Promise<FileRef[]> {
|
|
311
|
+
if (!blobs) throw new Error("[SixbModels] Video generation requires blob storage.")
|
|
312
|
+
|
|
313
|
+
const files: FileRef[] = []
|
|
314
|
+
for (const video of videos) {
|
|
315
|
+
files.push(
|
|
316
|
+
await blobs.put({
|
|
317
|
+
body: video.data,
|
|
318
|
+
expectedSizeBytes: video.data.byteLength,
|
|
319
|
+
mediaType: video.mediaType,
|
|
320
|
+
})
|
|
321
|
+
)
|
|
322
|
+
}
|
|
323
|
+
return files
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/** Two checks may see the job end at once; both answer with the first one's outcome. */
|
|
327
|
+
async function settleRecord(
|
|
328
|
+
storage: AiUsageStorage,
|
|
329
|
+
record: AiModelCallOperationRecord,
|
|
330
|
+
outcome: { readonly error?: string; readonly result: StoredVideoResult }
|
|
331
|
+
): Promise<AiModelCallOperationRecord> {
|
|
332
|
+
const settled = await storage.settleModelCallOperation({
|
|
333
|
+
projectId: record.projectId,
|
|
334
|
+
callId: record.callId,
|
|
335
|
+
status: outcome.error === undefined ? "completed" : "failed",
|
|
336
|
+
...(outcome.error === undefined ? {} : { error: outcome.error }),
|
|
337
|
+
result: outcome.result as unknown as ReadonlyJsonObject,
|
|
338
|
+
})
|
|
339
|
+
if (!settled) {
|
|
340
|
+
throw new Error(`[SixbModels] Video generation '${record.callId}' disappeared.`)
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return settled
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
async function recordVideos(
|
|
347
|
+
accounting: AiModelCallRecorder,
|
|
348
|
+
model: VideoModel,
|
|
349
|
+
record: AiModelCallOperationRecord,
|
|
350
|
+
stored: StoredVideoRequest,
|
|
351
|
+
metadata: VideoModelResponseMetadata,
|
|
352
|
+
returnedVideos: number | undefined
|
|
353
|
+
): Promise<ModelCallEndEvent> {
|
|
354
|
+
// Providers bill the length they were asked for, per clip they returned.
|
|
355
|
+
const outputVideoMs =
|
|
356
|
+
metadata.usage?.outputVideoMs ??
|
|
357
|
+
(returnedVideos === 0
|
|
358
|
+
? 0
|
|
359
|
+
: returnedVideos !== undefined && stored.durationSeconds !== undefined
|
|
360
|
+
? returnedVideos * stored.durationSeconds * 1_000
|
|
361
|
+
: undefined)
|
|
362
|
+
const usage: ModelUsage = {
|
|
363
|
+
...metadata.usage,
|
|
364
|
+
...(outputVideoMs === undefined ? {} : { outputVideoMs }),
|
|
365
|
+
}
|
|
366
|
+
const estimate = estimateModelCall(model, {
|
|
367
|
+
usage,
|
|
368
|
+
route: metadata.route,
|
|
369
|
+
responseModelId: metadata.responseModelId,
|
|
370
|
+
dimensions: stored.dimensions,
|
|
371
|
+
})
|
|
372
|
+
const event: ModelCallEndEvent = {
|
|
373
|
+
callId: record.callId,
|
|
374
|
+
modelKind: "video",
|
|
375
|
+
providerId: model.providerId,
|
|
376
|
+
modelId: model.modelId,
|
|
377
|
+
responseId: metadata.providerIds?.responseId ?? record.callId,
|
|
378
|
+
providerIds: metadata.providerIds,
|
|
379
|
+
responseModelId: metadata.responseModelId,
|
|
380
|
+
usage,
|
|
381
|
+
cost: metadata.reportedCost ? { status: "reported", ...metadata.reportedCost } : estimate,
|
|
382
|
+
...(metadata.reportedCost ? { estimate } : {}),
|
|
383
|
+
route: metadata.route,
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
await accounting.onModelCallEnd(event)
|
|
387
|
+
return event
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// ── Models and replies ──────────────────────────────────────
|
|
391
|
+
|
|
392
|
+
export async function resolveVideoModel(binding: VideoModel): Promise<VideoModel> {
|
|
393
|
+
assertVideoModel(binding)
|
|
394
|
+
const model = binding.resolve ? await binding.resolve() : binding
|
|
395
|
+
assertVideoModel(model)
|
|
396
|
+
if (model.providerId !== binding.providerId || model.modelId !== binding.modelId) {
|
|
397
|
+
throw new TypeError(
|
|
398
|
+
"[SixbModels] Resolved video model identity does not match the selected model."
|
|
399
|
+
)
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
return model
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/** The binding a stored generation names; checking on it needs the project to still list it. */
|
|
406
|
+
function catalogModel(
|
|
407
|
+
catalog: ModelCatalog | undefined,
|
|
408
|
+
record: AiModelCallOperationRecord
|
|
409
|
+
): VideoModel {
|
|
410
|
+
const entry = catalog?.video?.getByRef({ provider: record.providerId, modelId: record.modelId })
|
|
411
|
+
if (!entry) {
|
|
412
|
+
throw new Error(
|
|
413
|
+
`[SixbModels] Video model '${record.providerId}/${record.modelId}' is no longer configured, so generation '${record.callId}' cannot be checked.`
|
|
414
|
+
)
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
return entry.model
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
function isStatus(value: unknown): value is VideoModelStatus {
|
|
421
|
+
const status = (value as Partial<VideoModelStatus> | null)?.status
|
|
422
|
+
return status === "pending" || status === "completed" || status === "failed"
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
function describeFailure(error: unknown): string {
|
|
426
|
+
return typeof error === "string" && error.trim() ? error : "The provider failed the generation."
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
function isVideoData(value: unknown): value is VideoData {
|
|
430
|
+
const video = value as Partial<VideoData> | null
|
|
431
|
+
return (
|
|
432
|
+
video?.data instanceof Uint8Array &&
|
|
433
|
+
video.data.byteLength > 0 &&
|
|
434
|
+
typeof video.mediaType === "string" &&
|
|
435
|
+
/^video\/[a-z0-9.+-]+$/.test(video.mediaType)
|
|
436
|
+
)
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
export function isWarnings(value: unknown): value is readonly string[] {
|
|
440
|
+
return Array.isArray(value) && value.every((warning) => typeof warning === "string")
|
|
441
|
+
}
|