@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.
- package/dist/actions/index.js +52 -49
- 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.js +57 -54
- 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/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/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/index.js +61 -58
- 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-m1cwncee.js → chunk-2mxq1yd9.js} +45 -40
- package/dist/{chunk-m1cwncee.js.map → chunk-2mxq1yd9.js.map} +3 -3
- package/dist/{chunk-dmnd9ea6.js → chunk-30a0ftnm.js} +2 -2
- package/dist/chunk-389ybvw9.js.map +2 -2
- package/dist/{chunk-qbd282aa.js → chunk-39q9ybav.js} +2 -2
- package/dist/{chunk-06kpaqg4.js → chunk-3d9w8t4n.js} +110 -22
- package/dist/{chunk-06kpaqg4.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-fdk0ks9p.js → chunk-3x902cja.js} +3 -3
- package/dist/{chunk-c4nrycdy.js → chunk-4q4a5a96.js} +1 -1
- package/dist/{chunk-9cyq87qa.js → chunk-4tdm3fsj.js} +95 -32
- package/dist/{chunk-9cyq87qa.js.map → chunk-4tdm3fsj.js.map} +9 -9
- package/dist/{chunk-cpy282b8.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-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-pfdq1ga6.js → chunk-8eqqqc1h.js} +3 -3
- package/dist/{chunk-yyj009tv.js → chunk-8tefbhdx.js} +14 -14
- package/dist/{chunk-yyj009tv.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-phs5fbff.js → chunk-990a5bkc.js} +424 -76
- package/dist/chunk-990a5bkc.js.map +21 -0
- package/dist/{chunk-6md802cc.js → chunk-9az7kjv4.js} +6 -6
- package/dist/{chunk-95ps0k5q.js → chunk-9e5t53z0.js} +1 -1
- package/dist/{chunk-js9e6487.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-8qmp9fpa.js → chunk-as94vcty.js} +619 -482
- package/dist/{chunk-8qmp9fpa.js.map → chunk-as94vcty.js.map} +19 -19
- 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-hvq8xs66.js → chunk-jwjwvzj1.js} +797 -51
- package/dist/chunk-jwjwvzj1.js.map +38 -0
- package/dist/{chunk-k29rdc3h.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-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-fycac8e9.js → chunk-wpba6hhd.js} +10 -10
- package/dist/{chunk-fycac8e9.js.map → chunk-wpba6hhd.js.map} +1 -1
- package/dist/{chunk-t58sktr5.js → chunk-wrb1x1ss.js} +2 -2
- package/dist/{chunk-5sswe5ej.js → chunk-wsv23wvr.js} +2 -2
- package/dist/{chunk-04r2fdsd.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-5pz3htbe.js → chunk-y57eawng.js} +3 -3
- package/dist/{chunk-8ncg20rd.js → chunk-yah25st6.js} +5 -5
- package/dist/chunk-yah25st6.js.map +10 -0
- package/dist/{chunk-mrs7jy17.js → chunk-ywvxcmqj.js} +106 -13
- package/dist/{chunk-mrs7jy17.js.map → chunk-ywvxcmqj.js.map} +8 -7
- package/dist/{chunk-44hrfmbk.js → chunk-zmq9xc9s.js} +70 -31
- package/dist/{chunk-44hrfmbk.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/errors/catalog.d.ts.map +1 -1
- package/dist/execution/agent.js +52 -49
- 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 +52 -49
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.js +53 -50
- 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 +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +69 -65
- 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 +52 -49
- 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/host.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/sixb.d.ts.map +1 -1
- package/dist/sandboxes/index.js +6 -6
- 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.js +4 -4
- package/dist/storage/agents/types.d.ts +13 -0
- 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 +24 -22
- 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 +619 -72
- package/dist/testing/index.js.map +9 -9
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-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 +58 -55
- 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/model-call-retry.ts +69 -0
- package/src/agents/model-loop.ts +86 -12
- 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/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/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 +18 -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/host.ts +3 -0
- package/src/runtime/internal.ts +3 -1
- package/src/runtime/sixb.ts +12 -4
- package/src/sandboxes/README.md +3 -2
- 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/types.ts +14 -0
- 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 +108 -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 +320 -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/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-gfdh9kqa.js.map +0 -11
- package/dist/chunk-hvq8xs66.js.map +0 -34
- package/dist/chunk-k29rdc3h.js.map +0 -10
- package/dist/chunk-mbwsgjn7.js.map +0 -11
- package/dist/chunk-phs5fbff.js.map +0 -19
- 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-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-fdk0ks9p.js.map → chunk-3x902cja.js.map} +0 -0
- /package/dist/{chunk-c4nrycdy.js.map → chunk-4q4a5a96.js.map} +0 -0
- /package/dist/{chunk-cpy282b8.js.map → chunk-4w8qzy9w.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-pfdq1ga6.js.map → chunk-8eqqqc1h.js.map} +0 -0
- /package/dist/{chunk-jka26v8c.js.map → chunk-8x1bsp68.js.map} +0 -0
- /package/dist/{chunk-6md802cc.js.map → chunk-9az7kjv4.js.map} +0 -0
- /package/dist/{chunk-95ps0k5q.js.map → chunk-9e5t53z0.js.map} +0 -0
- /package/dist/{chunk-js9e6487.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-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-t58sktr5.js.map → chunk-wrb1x1ss.js.map} +0 -0
- /package/dist/{chunk-5sswe5ej.js.map → chunk-wsv23wvr.js.map} +0 -0
- /package/dist/{chunk-04r2fdsd.js.map → chunk-x0hqc54n.js.map} +0 -0
- /package/dist/{chunk-3neam1y5.js.map → chunk-y3qb965a.js.map} +0 -0
- /package/dist/{chunk-5pz3htbe.js.map → chunk-y57eawng.js.map} +0 -0
|
@@ -56,6 +56,7 @@ export interface AiModelCallGroupFragment {
|
|
|
56
56
|
readonly outputImages: string | null
|
|
57
57
|
readonly inputCharacters: string | null
|
|
58
58
|
readonly audioDurationMs: string | null
|
|
59
|
+
readonly outputVideoMs: string | null
|
|
59
60
|
readonly valuationStatus: "rated" | "unpriceable" | "unvalued"
|
|
60
61
|
readonly money?: AiMoney
|
|
61
62
|
}
|
|
@@ -78,6 +79,7 @@ export interface AiModelCallGroupRow {
|
|
|
78
79
|
readonly output_images: string | null
|
|
79
80
|
readonly input_characters: string | null
|
|
80
81
|
readonly audio_duration_ms: string | null
|
|
82
|
+
readonly output_video_ms: string | null
|
|
81
83
|
readonly valuation_status: AiModelCallGroupFragment["valuationStatus"]
|
|
82
84
|
readonly amount_currency: string | null
|
|
83
85
|
readonly amount_high: string | null
|
|
@@ -148,6 +150,7 @@ export function aiModelCallGroupFragmentFromRow(
|
|
|
148
150
|
outputImages: row.output_images,
|
|
149
151
|
inputCharacters: row.input_characters,
|
|
150
152
|
audioDurationMs: row.audio_duration_ms,
|
|
153
|
+
outputVideoMs: row.output_video_ms,
|
|
151
154
|
valuationStatus: row.valuation_status,
|
|
152
155
|
...(row.amount_currency === null
|
|
153
156
|
? {}
|
|
@@ -277,6 +280,7 @@ export function buildAiModelCallGroups(
|
|
|
277
280
|
outputImages: item.usage.usage.outputImages?.toString() ?? null,
|
|
278
281
|
inputCharacters: item.usage.usage.inputCharacters?.toString() ?? null,
|
|
279
282
|
audioDurationMs: item.usage.usage.audioDurationMs?.toString() ?? null,
|
|
283
|
+
outputVideoMs: item.usage.usage.outputVideoMs?.toString() ?? null,
|
|
280
284
|
valuationStatus: item.cost?.status ?? "unvalued",
|
|
281
285
|
...(item.cost && item.cost.status !== "unpriceable" ? { money: item.cost.money } : {}),
|
|
282
286
|
})
|
|
@@ -301,6 +305,7 @@ function summarize(items: readonly AiModelCallGroupFragment[]): AiModelCallGroup
|
|
|
301
305
|
outputImages: undefined as bigint | undefined,
|
|
302
306
|
inputCharacters: undefined as bigint | undefined,
|
|
303
307
|
audioDurationMs: undefined as bigint | undefined,
|
|
308
|
+
outputVideoMs: undefined as bigint | undefined,
|
|
304
309
|
}
|
|
305
310
|
const counts = { rated: 0n, unpriceable: 0n, unvalued: 0n }
|
|
306
311
|
const money = new Map<string, bigint>()
|
|
@@ -316,6 +321,7 @@ function summarize(items: readonly AiModelCallGroupFragment[]): AiModelCallGroup
|
|
|
316
321
|
"outputImages",
|
|
317
322
|
"inputCharacters",
|
|
318
323
|
"audioDurationMs",
|
|
324
|
+
"outputVideoMs",
|
|
319
325
|
] as const) {
|
|
320
326
|
const value = item[field]
|
|
321
327
|
if (value !== null) media[field] = (media[field] ?? 0n) + BigInt(value)
|
|
@@ -351,6 +357,7 @@ function summarize(items: readonly AiModelCallGroupFragment[]): AiModelCallGroup
|
|
|
351
357
|
...(media.audioDurationMs === undefined
|
|
352
358
|
? {}
|
|
353
359
|
: { audioDurationMs: safeCount(media.audioDurationMs) }),
|
|
360
|
+
...(media.outputVideoMs === undefined ? {} : { outputVideoMs: safeCount(media.outputVideoMs) }),
|
|
354
361
|
costs,
|
|
355
362
|
}
|
|
356
363
|
}
|
|
@@ -10,6 +10,7 @@ export type AiBillableMeter =
|
|
|
10
10
|
| "audio.input.milliseconds"
|
|
11
11
|
| "characters.input"
|
|
12
12
|
| "images.output"
|
|
13
|
+
| "video.output.milliseconds"
|
|
13
14
|
| "tokens.input.total"
|
|
14
15
|
| "tokens.input.uncached"
|
|
15
16
|
| "tokens.input.cacheRead"
|
|
@@ -308,6 +309,7 @@ export interface AiModelCallGroupSummary {
|
|
|
308
309
|
readonly outputImages?: number
|
|
309
310
|
readonly inputCharacters?: number
|
|
310
311
|
readonly audioDurationMs?: number
|
|
312
|
+
readonly outputVideoMs?: number
|
|
311
313
|
readonly costs: AiCostSummary
|
|
312
314
|
}
|
|
313
315
|
|
|
@@ -33,6 +33,7 @@ const METER_ORDER: Readonly<Record<AiBillableMeter, number>> = {
|
|
|
33
33
|
"tokens.output.audio": 11,
|
|
34
34
|
"images.output": 12,
|
|
35
35
|
"characters.input": 13,
|
|
36
|
+
"video.output.milliseconds": 14,
|
|
36
37
|
}
|
|
37
38
|
const METERS = new Set(Object.keys(METER_ORDER) as AiBillableMeter[])
|
|
38
39
|
const UNPRICEABLE_REASONS = new Set<AiUnpriceableReason>([
|
|
@@ -141,6 +142,7 @@ const UNIT_METERS = [
|
|
|
141
142
|
["audio.input.milliseconds", "audioDurationMs"],
|
|
142
143
|
["characters.input", "inputCharacters"],
|
|
143
144
|
["images.output", "outputImages"],
|
|
145
|
+
["video.output.milliseconds", "outputVideoMs"],
|
|
144
146
|
] as const
|
|
145
147
|
|
|
146
148
|
function componentsMatchUsage(
|
|
@@ -4,18 +4,27 @@ import {
|
|
|
4
4
|
assertAiUsageExecutionId,
|
|
5
5
|
assertSameCallExecution,
|
|
6
6
|
normalizeAiModelCallFilesRecord,
|
|
7
|
+
normalizeAiModelCallOperation,
|
|
8
|
+
normalizeAiModelCallOperationResult,
|
|
7
9
|
normalizeAiModelCallRecord,
|
|
10
|
+
normalizeAiModelCallSettlement,
|
|
11
|
+
normalizeAiModelCallStart,
|
|
8
12
|
} from "./record"
|
|
9
13
|
import type {
|
|
10
14
|
AiModelCallFilesRecord,
|
|
15
|
+
AiModelCallOperationRecord,
|
|
11
16
|
AiModelCallUsageRecord,
|
|
12
17
|
AiUsageExecutionSummary,
|
|
13
18
|
AiUsageStorage,
|
|
19
|
+
CreateAiModelCallOperationInput,
|
|
14
20
|
GetAiModelCallFilesInput,
|
|
15
21
|
GetLatestAiModelCallForExecutionInput,
|
|
16
22
|
RecordAiModelCallFilesInput,
|
|
17
23
|
RecordAiModelCallInput,
|
|
24
|
+
RecordAiModelCallOperationResultInput,
|
|
18
25
|
RecordAiModelCallResult,
|
|
26
|
+
SettleAiModelCallOperationInput,
|
|
27
|
+
StartAiModelCallOperationInput,
|
|
19
28
|
SummarizeAiUsageExecutionInput,
|
|
20
29
|
SummarizeAiUsageExecutionsInput,
|
|
21
30
|
} from "./types"
|
|
@@ -33,6 +42,7 @@ export interface InMemoryAiUsageStorageSnapshot {
|
|
|
33
42
|
readonly recordKeysByIdempotencyKey: Map<string, string>
|
|
34
43
|
readonly groupRows: Map<string, InMemoryAiUsageGroupRow>
|
|
35
44
|
readonly callFiles: Map<string, AiModelCallFilesRecord>
|
|
45
|
+
readonly operations: Map<string, AiModelCallOperationRecord>
|
|
36
46
|
}
|
|
37
47
|
|
|
38
48
|
/** In-memory model-call ledger used by development runtimes and storage contract tests. */
|
|
@@ -41,6 +51,7 @@ export class InMemoryAiUsageStorage implements AiUsageStorage {
|
|
|
41
51
|
private readonly recordKeysByIdempotencyKey = new Map<string, string>()
|
|
42
52
|
private readonly groupRows = new Map<string, InMemoryAiUsageGroupRow>()
|
|
43
53
|
private readonly callFiles = new Map<string, AiModelCallFilesRecord>()
|
|
54
|
+
private readonly operations = new Map<string, AiModelCallOperationRecord>()
|
|
44
55
|
|
|
45
56
|
constructor(private readonly executions: Pick<ExecutionStorage, "getById">) {}
|
|
46
57
|
|
|
@@ -155,12 +166,93 @@ export class InMemoryAiUsageStorage implements AiUsageStorage {
|
|
|
155
166
|
return record ? structuredClone(record) : null
|
|
156
167
|
}
|
|
157
168
|
|
|
169
|
+
async createModelCallOperation(
|
|
170
|
+
input: CreateAiModelCallOperationInput
|
|
171
|
+
): Promise<AiModelCallOperationRecord> {
|
|
172
|
+
const record = normalizeAiModelCallOperation(input)
|
|
173
|
+
const key = modelCallRecordKey(record.projectId, record.callId)
|
|
174
|
+
if (this.operations.has(key)) {
|
|
175
|
+
throw new AiUsageStorageError(
|
|
176
|
+
"duplicate_id",
|
|
177
|
+
`[Sixb] AI model call '${record.callId}' already has an operation.`
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
await this.assertExecutionExists(record.projectId, record.executionId)
|
|
182
|
+
this.operations.set(key, structuredClone(record))
|
|
183
|
+
return structuredClone(record)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
async getModelCallOperation(
|
|
187
|
+
input: GetAiModelCallFilesInput
|
|
188
|
+
): Promise<AiModelCallOperationRecord | null> {
|
|
189
|
+
const record = this.operations.get(modelCallRecordKey(input.projectId, input.callId))
|
|
190
|
+
return record ? structuredClone(record) : null
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
async startModelCallOperation(
|
|
194
|
+
input: StartAiModelCallOperationInput
|
|
195
|
+
): Promise<AiModelCallOperationRecord | null> {
|
|
196
|
+
const start = normalizeAiModelCallStart(input)
|
|
197
|
+
const key = modelCallRecordKey(start.projectId, start.callId)
|
|
198
|
+
const existing = this.operations.get(key)
|
|
199
|
+
if (!existing) return null
|
|
200
|
+
if (existing.status !== "pending" || existing.operation !== undefined) {
|
|
201
|
+
return structuredClone(existing)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const started: AiModelCallOperationRecord = {
|
|
205
|
+
...existing,
|
|
206
|
+
operation: start.operation,
|
|
207
|
+
request: start.request,
|
|
208
|
+
}
|
|
209
|
+
this.operations.set(key, structuredClone(started))
|
|
210
|
+
return structuredClone(started)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
async recordModelCallOperationResult(
|
|
214
|
+
input: RecordAiModelCallOperationResultInput
|
|
215
|
+
): Promise<AiModelCallOperationRecord | null> {
|
|
216
|
+
const recorded = normalizeAiModelCallOperationResult(input)
|
|
217
|
+
const key = modelCallRecordKey(recorded.projectId, recorded.callId)
|
|
218
|
+
const existing = this.operations.get(key)
|
|
219
|
+
if (!existing) return null
|
|
220
|
+
if (existing.status !== "pending" || existing.result !== undefined) {
|
|
221
|
+
return structuredClone(existing)
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const kept: AiModelCallOperationRecord = { ...existing, result: recorded.result }
|
|
225
|
+
this.operations.set(key, structuredClone(kept))
|
|
226
|
+
return structuredClone(kept)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
async settleModelCallOperation(
|
|
230
|
+
input: SettleAiModelCallOperationInput
|
|
231
|
+
): Promise<AiModelCallOperationRecord | null> {
|
|
232
|
+
const settlement = normalizeAiModelCallSettlement(input)
|
|
233
|
+
const key = modelCallRecordKey(settlement.projectId, settlement.callId)
|
|
234
|
+
const existing = this.operations.get(key)
|
|
235
|
+
if (!existing) return null
|
|
236
|
+
if (existing.status !== "pending") return structuredClone(existing)
|
|
237
|
+
|
|
238
|
+
const settled: AiModelCallOperationRecord = {
|
|
239
|
+
...existing,
|
|
240
|
+
status: settlement.status,
|
|
241
|
+
...(settlement.error === undefined ? {} : { error: settlement.error }),
|
|
242
|
+
result: settlement.result,
|
|
243
|
+
settledAt: settlement.settledAt,
|
|
244
|
+
}
|
|
245
|
+
this.operations.set(key, structuredClone(settled))
|
|
246
|
+
return structuredClone(settled)
|
|
247
|
+
}
|
|
248
|
+
|
|
158
249
|
snapshot(): InMemoryAiUsageStorageSnapshot {
|
|
159
250
|
return structuredClone({
|
|
160
251
|
records: this.records,
|
|
161
252
|
recordKeysByIdempotencyKey: this.recordKeysByIdempotencyKey,
|
|
162
253
|
groupRows: this.groupRows,
|
|
163
254
|
callFiles: this.callFiles,
|
|
255
|
+
operations: this.operations,
|
|
164
256
|
})
|
|
165
257
|
}
|
|
166
258
|
|
|
@@ -169,6 +261,7 @@ export class InMemoryAiUsageStorage implements AiUsageStorage {
|
|
|
169
261
|
replaceMap(this.recordKeysByIdempotencyKey, snapshot.recordKeysByIdempotencyKey)
|
|
170
262
|
replaceMap(this.groupRows, snapshot.groupRows)
|
|
171
263
|
replaceMap(this.callFiles, snapshot.callFiles)
|
|
264
|
+
replaceMap(this.operations, snapshot.operations)
|
|
172
265
|
}
|
|
173
266
|
|
|
174
267
|
/** @internal Immutable accounting source used by in-memory AI limit enforcement. */
|
|
@@ -9,21 +9,31 @@ export {
|
|
|
9
9
|
assertAiUsageExecutionId,
|
|
10
10
|
assertSameCallExecution,
|
|
11
11
|
normalizeAiModelCallFilesRecord,
|
|
12
|
+
normalizeAiModelCallOperation,
|
|
13
|
+
normalizeAiModelCallOperationResult,
|
|
12
14
|
normalizeAiModelCallRecord,
|
|
15
|
+
normalizeAiModelCallSettlement,
|
|
16
|
+
normalizeAiModelCallStart,
|
|
13
17
|
} from "./record"
|
|
14
18
|
export type {
|
|
15
19
|
AiModelCallFilesRecord,
|
|
20
|
+
AiModelCallOperationRecord,
|
|
21
|
+
AiModelCallOperationStatus,
|
|
16
22
|
AiModelCallUsage,
|
|
17
23
|
AiModelCallUsageInput,
|
|
18
24
|
AiModelCallUsageRecord,
|
|
19
25
|
AiUsageExecutionSummary,
|
|
20
26
|
AiUsageReportingStatus,
|
|
21
27
|
AiUsageStorage,
|
|
28
|
+
CreateAiModelCallOperationInput,
|
|
22
29
|
GetAiModelCallFilesInput,
|
|
23
30
|
GetLatestAiModelCallForExecutionInput,
|
|
24
31
|
RecordAiModelCallFilesInput,
|
|
25
32
|
RecordAiModelCallInput,
|
|
33
|
+
RecordAiModelCallOperationResultInput,
|
|
26
34
|
RecordAiModelCallResult,
|
|
35
|
+
SettleAiModelCallOperationInput,
|
|
36
|
+
StartAiModelCallOperationInput,
|
|
27
37
|
SummarizeAiUsageExecutionInput,
|
|
28
38
|
SummarizeAiUsageExecutionsInput,
|
|
29
39
|
} from "./types"
|
|
@@ -7,9 +7,14 @@ import { isModelReasoning } from "../../models/language-model"
|
|
|
7
7
|
import { AiUsageStorageError } from "./errors"
|
|
8
8
|
import type {
|
|
9
9
|
AiModelCallFilesRecord,
|
|
10
|
+
AiModelCallOperationRecord,
|
|
10
11
|
AiModelCallUsageRecord,
|
|
12
|
+
CreateAiModelCallOperationInput,
|
|
11
13
|
RecordAiModelCallFilesInput,
|
|
12
14
|
RecordAiModelCallInput,
|
|
15
|
+
RecordAiModelCallOperationResultInput,
|
|
16
|
+
SettleAiModelCallOperationInput,
|
|
17
|
+
StartAiModelCallOperationInput,
|
|
13
18
|
} from "./types"
|
|
14
19
|
import { normalizeAiModelCallUsage } from "./usage"
|
|
15
20
|
|
|
@@ -103,6 +108,107 @@ function cloneRequestedReasoning(
|
|
|
103
108
|
return typeof reasoning === "string" ? reasoning : { budgetTokens: reasoning.budgetTokens }
|
|
104
109
|
}
|
|
105
110
|
|
|
111
|
+
/** Validate and defensively snapshot a call about to start, before the provider has it. */
|
|
112
|
+
export function normalizeAiModelCallOperation(
|
|
113
|
+
input: CreateAiModelCallOperationInput
|
|
114
|
+
): AiModelCallOperationRecord {
|
|
115
|
+
assertNonBlank(input.projectId, "projectId")
|
|
116
|
+
assertNonBlank(input.callId, "callId")
|
|
117
|
+
assertAiUsageExecutionId(input.executionId)
|
|
118
|
+
assertPositiveSafeInteger(input.attempt, "attempt")
|
|
119
|
+
if (!MODEL_KINDS.includes(input.modelKind)) {
|
|
120
|
+
throw new TypeError("[Sixb] AI model kind is invalid.")
|
|
121
|
+
}
|
|
122
|
+
assertNonBlank(input.providerId, "providerId")
|
|
123
|
+
assertNonBlank(input.modelId, "modelId")
|
|
124
|
+
|
|
125
|
+
assertOperationRequest(input.request)
|
|
126
|
+
if (typeof input.reserved !== "boolean") {
|
|
127
|
+
throw new TypeError("[Sixb] AI model-call operation reserved must be a boolean.")
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
projectId: input.projectId,
|
|
132
|
+
callId: input.callId,
|
|
133
|
+
executionId: input.executionId,
|
|
134
|
+
attempt: input.attempt,
|
|
135
|
+
modelKind: input.modelKind,
|
|
136
|
+
providerId: input.providerId,
|
|
137
|
+
modelId: input.modelId,
|
|
138
|
+
request: structuredClone(input.request),
|
|
139
|
+
reserved: input.reserved,
|
|
140
|
+
status: "pending",
|
|
141
|
+
createdAt: cloneValidDate(input.createdAt ?? new Date(), "createdAt"),
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** Validate the handle of a call the provider accepted. */
|
|
146
|
+
export function normalizeAiModelCallStart(
|
|
147
|
+
input: StartAiModelCallOperationInput
|
|
148
|
+
): StartAiModelCallOperationInput {
|
|
149
|
+
assertNonBlank(input.projectId, "projectId")
|
|
150
|
+
assertNonBlank(input.callId, "callId")
|
|
151
|
+
if (input.operation === null || input.operation === undefined) {
|
|
152
|
+
throw new TypeError("[Sixb] AI model-call operation handle is required.")
|
|
153
|
+
}
|
|
154
|
+
assertJsonValue(input.operation, "AI model-call operation")
|
|
155
|
+
assertOperationRequest(input.request)
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
projectId: input.projectId,
|
|
159
|
+
callId: input.callId,
|
|
160
|
+
operation: structuredClone(input.operation),
|
|
161
|
+
request: structuredClone(input.request),
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** Validate what a pending call reported once it is in the ledger. */
|
|
166
|
+
export function normalizeAiModelCallOperationResult(
|
|
167
|
+
input: RecordAiModelCallOperationResultInput
|
|
168
|
+
): RecordAiModelCallOperationResultInput {
|
|
169
|
+
assertNonBlank(input.projectId, "projectId")
|
|
170
|
+
assertNonBlank(input.callId, "callId")
|
|
171
|
+
assertOperationResult(input.result)
|
|
172
|
+
|
|
173
|
+
return { projectId: input.projectId, callId: input.callId, result: structuredClone(input.result) }
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function assertOperationResult(result: unknown): void {
|
|
177
|
+
if (!isPlainRecord(result)) {
|
|
178
|
+
throw new TypeError("[Sixb] AI model-call operation result must be a JSON object.")
|
|
179
|
+
}
|
|
180
|
+
assertJsonValue(result, "AI model-call operation result")
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function assertOperationRequest(request: unknown): void {
|
|
184
|
+
if (!isPlainRecord(request)) {
|
|
185
|
+
throw new TypeError("[Sixb] AI model-call operation request must be a JSON object.")
|
|
186
|
+
}
|
|
187
|
+
assertJsonValue(request, "AI model-call operation request")
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** Validate how a running call ended. */
|
|
191
|
+
export function normalizeAiModelCallSettlement(
|
|
192
|
+
input: SettleAiModelCallOperationInput
|
|
193
|
+
): Required<Omit<SettleAiModelCallOperationInput, "error">> & { readonly error?: string } {
|
|
194
|
+
assertNonBlank(input.projectId, "projectId")
|
|
195
|
+
assertNonBlank(input.callId, "callId")
|
|
196
|
+
if (input.status !== "completed" && input.status !== "failed") {
|
|
197
|
+
throw new TypeError("[Sixb] AI model-call operation status must be 'completed' or 'failed'.")
|
|
198
|
+
}
|
|
199
|
+
if (input.error !== undefined) assertNonBlank(input.error, "operation error")
|
|
200
|
+
assertOperationResult(input.result)
|
|
201
|
+
|
|
202
|
+
return {
|
|
203
|
+
projectId: input.projectId,
|
|
204
|
+
callId: input.callId,
|
|
205
|
+
status: input.status,
|
|
206
|
+
...(input.error === undefined ? {} : { error: input.error }),
|
|
207
|
+
result: structuredClone(input.result),
|
|
208
|
+
settledAt: cloneValidDate(input.settledAt ?? new Date(), "settledAt"),
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
106
212
|
/** Validate a durable execution reference at storage and query boundaries. */
|
|
107
213
|
export function assertAiUsageExecutionId(executionId: string): void {
|
|
108
214
|
assertNonBlank(executionId, "executionId")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FileRef } from "../../blob-storage/types"
|
|
2
|
-
import type { ReadonlyJsonObject } from "../../json"
|
|
2
|
+
import type { ReadonlyJsonObject, ReadonlyJsonValue } from "../../json"
|
|
3
3
|
import type { ModelReasoning } from "../../models/language-model"
|
|
4
4
|
|
|
5
5
|
/** Coverage of normalized usage. Complete means both token totals are known; duration alone is partial. */
|
|
@@ -24,6 +24,8 @@ export interface AiModelCallUsageInput {
|
|
|
24
24
|
readonly outputImages?: number
|
|
25
25
|
/** Input characters, counted by the provider's own billing rule. */
|
|
26
26
|
readonly inputCharacters?: number
|
|
27
|
+
/** Milliseconds of video the call returned, every clip together, as the provider bills them. */
|
|
28
|
+
readonly outputVideoMs?: number
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
/** Normalized usage for one completed model call. Token details overlap their input/output totals. */
|
|
@@ -123,6 +125,70 @@ export interface GetAiModelCallFilesInput {
|
|
|
123
125
|
readonly callId: string
|
|
124
126
|
}
|
|
125
127
|
|
|
128
|
+
export type AiModelCallOperationStatus = "pending" | "completed" | "failed"
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* A model call the provider keeps running after the request that started it, such as a video
|
|
132
|
+
* generation: what a later request needs to check on it and record how it ended.
|
|
133
|
+
*/
|
|
134
|
+
export interface AiModelCallOperationRecord {
|
|
135
|
+
readonly projectId: string
|
|
136
|
+
readonly callId: string
|
|
137
|
+
/** The execution attempt that admitted the call, which its ledger record belongs to. */
|
|
138
|
+
readonly executionId: string
|
|
139
|
+
readonly attempt: number
|
|
140
|
+
readonly modelKind: import("../../models/definitions").ModelKind
|
|
141
|
+
readonly providerId: string
|
|
142
|
+
readonly modelId: string
|
|
143
|
+
/** The provider's handle on the running call, opaque to Sixb; absent until it accepted the call. */
|
|
144
|
+
readonly operation?: ReadonlyJsonValue
|
|
145
|
+
/** The request facts that price the call once it ends, owned by the model kind's runtime. */
|
|
146
|
+
readonly request: ReadonlyJsonObject
|
|
147
|
+
/** Whether admission reserved budget that recording the call must reconcile. */
|
|
148
|
+
readonly reserved: boolean
|
|
149
|
+
readonly status: AiModelCallOperationStatus
|
|
150
|
+
/** Why the provider failed the call, when it did. */
|
|
151
|
+
readonly error?: string
|
|
152
|
+
/**
|
|
153
|
+
* What the call reported, such as its usage and cost, owned by the kind's runtime. Kept while
|
|
154
|
+
* pending once the call is in the ledger, before its files are stored.
|
|
155
|
+
*/
|
|
156
|
+
readonly result?: ReadonlyJsonObject
|
|
157
|
+
readonly createdAt: Date
|
|
158
|
+
readonly settledAt?: Date
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export type CreateAiModelCallOperationInput = Omit<
|
|
162
|
+
AiModelCallOperationRecord,
|
|
163
|
+
"operation" | "status" | "error" | "result" | "createdAt" | "settledAt"
|
|
164
|
+
> & {
|
|
165
|
+
readonly createdAt?: Date
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface StartAiModelCallOperationInput {
|
|
169
|
+
readonly projectId: string
|
|
170
|
+
readonly callId: string
|
|
171
|
+
/** The provider's handle on the running call. */
|
|
172
|
+
readonly operation: ReadonlyJsonValue
|
|
173
|
+
/** The request facts as the provider accepted the call, in place of those kept at creation. */
|
|
174
|
+
readonly request: ReadonlyJsonObject
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface RecordAiModelCallOperationResultInput {
|
|
178
|
+
readonly projectId: string
|
|
179
|
+
readonly callId: string
|
|
180
|
+
readonly result: ReadonlyJsonObject
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface SettleAiModelCallOperationInput {
|
|
184
|
+
readonly projectId: string
|
|
185
|
+
readonly callId: string
|
|
186
|
+
readonly status: Exclude<AiModelCallOperationStatus, "pending">
|
|
187
|
+
readonly error?: string
|
|
188
|
+
readonly result: ReadonlyJsonObject
|
|
189
|
+
readonly settledAt?: Date
|
|
190
|
+
}
|
|
191
|
+
|
|
126
192
|
/** Durable, provider-neutral accounting for completed model calls. */
|
|
127
193
|
export interface AiUsageStorage {
|
|
128
194
|
/**
|
|
@@ -155,4 +221,39 @@ export interface AiUsageStorage {
|
|
|
155
221
|
recordModelCallFiles(input: RecordAiModelCallFilesInput): Promise<AiModelCallFilesRecord>
|
|
156
222
|
|
|
157
223
|
getModelCallFiles(input: GetAiModelCallFilesInput): Promise<AiModelCallFilesRecord | null>
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Keep a call before the provider starts it, once per project and call ID, so a call the
|
|
227
|
+
* provider bills always has a record to settle.
|
|
228
|
+
*/
|
|
229
|
+
createModelCallOperation(
|
|
230
|
+
input: CreateAiModelCallOperationInput
|
|
231
|
+
): Promise<AiModelCallOperationRecord>
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Keep the provider's handle once it accepted the call. Only a pending call without one takes
|
|
235
|
+
* it; returns the record as it now stands, or null when no such call exists.
|
|
236
|
+
*/
|
|
237
|
+
startModelCallOperation(
|
|
238
|
+
input: StartAiModelCallOperationInput
|
|
239
|
+
): Promise<AiModelCallOperationRecord | null>
|
|
240
|
+
|
|
241
|
+
getModelCallOperation(input: GetAiModelCallFilesInput): Promise<AiModelCallOperationRecord | null>
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Keep what a pending call reported once it is in the ledger, before its files are stored, so a
|
|
245
|
+
* call settled without them still reports it. The first result wins; returns the record as it
|
|
246
|
+
* now stands, or null when no such call exists.
|
|
247
|
+
*/
|
|
248
|
+
recordModelCallOperationResult(
|
|
249
|
+
input: RecordAiModelCallOperationResultInput
|
|
250
|
+
): Promise<AiModelCallOperationRecord | null>
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Record how a pending call ended. The first settlement wins: settling it again returns that
|
|
254
|
+
* record unchanged. Null when no such call exists.
|
|
255
|
+
*/
|
|
256
|
+
settleModelCallOperation(
|
|
257
|
+
input: SettleAiModelCallOperationInput
|
|
258
|
+
): Promise<AiModelCallOperationRecord | null>
|
|
158
259
|
}
|
|
@@ -14,6 +14,7 @@ export const AI_USAGE_FIELDS = [
|
|
|
14
14
|
"audioOutputTokens",
|
|
15
15
|
"outputImages",
|
|
16
16
|
"inputCharacters",
|
|
17
|
+
"outputVideoMs",
|
|
17
18
|
] as const
|
|
18
19
|
const USAGE_FIELDS = AI_USAGE_FIELDS
|
|
19
20
|
|
|
@@ -62,6 +63,7 @@ export function normalizeAiModelCallUsage(input: AiModelCallUsageInput): AiModel
|
|
|
62
63
|
: { audioOutputTokens: input.audioOutputTokens }),
|
|
63
64
|
...(input.outputImages === undefined ? {} : { outputImages: input.outputImages }),
|
|
64
65
|
...(input.inputCharacters === undefined ? {} : { inputCharacters: input.inputCharacters }),
|
|
66
|
+
...(input.outputVideoMs === undefined ? {} : { outputVideoMs: input.outputVideoMs }),
|
|
65
67
|
reportingStatus,
|
|
66
68
|
}
|
|
67
69
|
}
|