@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
|
@@ -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
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ARTIFACT_COMMENT_LIMITS, ARTIFACT_RESTORE_POINTS } from "../../artifacts/limits"
|
|
2
2
|
import { type Principal, principalsEqual } from "../../auth"
|
|
3
3
|
import type { FileRef } from "../../blob-storage"
|
|
4
|
+
import type { AgentStorage } from "../agents"
|
|
4
5
|
import { paginate } from "../pagination"
|
|
5
6
|
import {
|
|
6
7
|
artifactStateBytes,
|
|
7
8
|
artifactStorageErrors,
|
|
8
9
|
checkArtifactStateWrite,
|
|
9
10
|
othersCommented,
|
|
11
|
+
storedCommentAnchor,
|
|
10
12
|
turnUndoable,
|
|
11
13
|
} from "./record"
|
|
12
14
|
import type {
|
|
@@ -14,6 +16,7 @@ import type {
|
|
|
14
16
|
ArtifactCommentKey,
|
|
15
17
|
ArtifactCommentRecord,
|
|
16
18
|
ArtifactFrameGrantRecord,
|
|
19
|
+
ArtifactMediaRecord,
|
|
17
20
|
ArtifactPdfKeyInput,
|
|
18
21
|
ArtifactPdfRecord,
|
|
19
22
|
ArtifactRecord,
|
|
@@ -27,6 +30,9 @@ import type {
|
|
|
27
30
|
ArtifactTurnWriteRecord,
|
|
28
31
|
ArtifactVersionInput,
|
|
29
32
|
ArtifactVersionRecord,
|
|
33
|
+
ArtifactVideoExportAskRecord,
|
|
34
|
+
ArtifactVideoRenderKey,
|
|
35
|
+
ArtifactVideoRenderRecord,
|
|
30
36
|
CopyArtifactInput,
|
|
31
37
|
CreateArtifactCommentInput,
|
|
32
38
|
CreateArtifactInput,
|
|
@@ -38,10 +44,13 @@ import type {
|
|
|
38
44
|
GetArtifactRestorePointInput,
|
|
39
45
|
GetArtifactVersionInput,
|
|
40
46
|
ListArtifactBoardPreviewsInput,
|
|
47
|
+
ListArtifactMediaInput,
|
|
41
48
|
ListArtifactsInput,
|
|
42
49
|
ListArtifactsResult,
|
|
50
|
+
ListArtifactThreadIdsInput,
|
|
43
51
|
ListArtifactVersionsInput,
|
|
44
52
|
ListArtifactVersionsResult,
|
|
53
|
+
ListArtifactVideoRendersInput,
|
|
45
54
|
ListReferencingVersionsInput,
|
|
46
55
|
PublishArtifactVersionInput,
|
|
47
56
|
PublishedArtifactVersion,
|
|
@@ -84,9 +93,18 @@ interface InMemoryArtifactSnapshot {
|
|
|
84
93
|
readonly state: ReadonlyMap<string, ReadonlyMap<string, ArtifactStateEntry>>
|
|
85
94
|
readonly boardPreviews: ReadonlyMap<string, ArtifactBoardPreviewRecord>
|
|
86
95
|
readonly pdfs: ReadonlyMap<string, ArtifactPdfRecord>
|
|
96
|
+
readonly media: ReadonlyMap<string, ArtifactMediaRecord>
|
|
97
|
+
readonly videoRenders: ReadonlyMap<string, ArtifactVideoRenderRecord>
|
|
98
|
+
readonly videoExportAsks: ReadonlyMap<string, ArtifactVideoExportAskRecord>
|
|
87
99
|
}
|
|
88
100
|
|
|
89
101
|
export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
102
|
+
/**
|
|
103
|
+
* `agents` says who owns a thread and takes part in it, which a database joins: the threads of a
|
|
104
|
+
* reader are listed from it.
|
|
105
|
+
*/
|
|
106
|
+
constructor(private readonly agents?: Pick<AgentStorage, "threads">) {}
|
|
107
|
+
|
|
90
108
|
private artifacts = new Map<string, StoredArtifact>()
|
|
91
109
|
private frameGrants = new Map<string, ArtifactFrameGrantRecord>()
|
|
92
110
|
/** By artifact and reader, then by key. */
|
|
@@ -95,6 +113,12 @@ export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
|
95
113
|
private boardPreviews = new Map<string, ArtifactBoardPreviewRecord>()
|
|
96
114
|
/** By project and render key; no artifact owns one. */
|
|
97
115
|
private pdfs = new Map<string, ArtifactPdfRecord>()
|
|
116
|
+
/** By project and digest; no artifact owns one. */
|
|
117
|
+
private media = new Map<string, ArtifactMediaRecord>()
|
|
118
|
+
/** By project and key; no artifact owns one. */
|
|
119
|
+
private videoRenders = new Map<string, ArtifactVideoRenderRecord>()
|
|
120
|
+
/** By project and export key; no artifact owns one. */
|
|
121
|
+
private videoExportAsks = new Map<string, ArtifactVideoExportAskRecord>()
|
|
98
122
|
|
|
99
123
|
async create(input: CreateArtifactInput): Promise<PublishedArtifactVersion> {
|
|
100
124
|
const key = artifactKey(input.projectId, input.id)
|
|
@@ -356,10 +380,35 @@ export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
|
356
380
|
return { versions: structuredClone(page), hasMore, total }
|
|
357
381
|
}
|
|
358
382
|
|
|
359
|
-
async listThreadIds(input:
|
|
383
|
+
async listThreadIds(input: ListArtifactThreadIdsInput): Promise<string[]> {
|
|
360
384
|
const stored = this.artifacts.get(artifactKey(input.projectId, input.id))
|
|
361
385
|
// Code-unit order, as SQLite compares text.
|
|
362
|
-
|
|
386
|
+
const threadIds = [...(stored?.threads.keys() ?? [])].sort((left, right) =>
|
|
387
|
+
left < right ? -1 : 1
|
|
388
|
+
)
|
|
389
|
+
const { reader } = input
|
|
390
|
+
if (!reader || threadIds.length === 0) return threadIds
|
|
391
|
+
|
|
392
|
+
if (!this.agents) {
|
|
393
|
+
throw new Error("[Sixb] Listing a reader's threads needs the agent storage beside it.")
|
|
394
|
+
}
|
|
395
|
+
const query = { projectId: input.projectId, threadIds }
|
|
396
|
+
const [threads, participants] = await Promise.all([
|
|
397
|
+
this.agents.threads.getByIds({ projectId: input.projectId, ids: threadIds }),
|
|
398
|
+
this.agents.threads.listParticipants(query),
|
|
399
|
+
])
|
|
400
|
+
const read = new Set([
|
|
401
|
+
...threads
|
|
402
|
+
.filter(
|
|
403
|
+
(thread) =>
|
|
404
|
+
thread.kind === "conversation" && principalsEqual(thread.ownerPrincipal, reader)
|
|
405
|
+
)
|
|
406
|
+
.map((thread) => thread.id),
|
|
407
|
+
...participants
|
|
408
|
+
.filter((participant) => principalsEqual(participant.principal, reader))
|
|
409
|
+
.map((participant) => participant.threadId),
|
|
410
|
+
])
|
|
411
|
+
return threadIds.filter((threadId) => read.has(threadId))
|
|
363
412
|
}
|
|
364
413
|
|
|
365
414
|
async copy(input: CopyArtifactInput): Promise<ArtifactRecord> {
|
|
@@ -517,6 +566,56 @@ export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
|
517
566
|
if (kept && "failure" in kept) this.pdfs.delete(key)
|
|
518
567
|
}
|
|
519
568
|
|
|
569
|
+
async listMedia(input: ListArtifactMediaInput): Promise<ArtifactMediaRecord[]> {
|
|
570
|
+
const kept = [...new Set(input.digests)].flatMap((digest) => {
|
|
571
|
+
const media = this.media.get(`${input.projectId}\0${digest}`)
|
|
572
|
+
return media ? [media] : []
|
|
573
|
+
})
|
|
574
|
+
return structuredClone(kept.sort((left, right) => (left.digest < right.digest ? -1 : 1)))
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
async putMedia(input: ArtifactMediaRecord): Promise<void> {
|
|
578
|
+
this.media.set(`${input.projectId}\0${input.digest}`, structuredClone(input))
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
async listVideoRenders(
|
|
582
|
+
input: ListArtifactVideoRendersInput
|
|
583
|
+
): Promise<ArtifactVideoRenderRecord[]> {
|
|
584
|
+
const kept = [...new Set(input.keys)].flatMap((key) => {
|
|
585
|
+
const render = this.videoRenders.get(`${input.projectId}\0${key}`)
|
|
586
|
+
return render ? [render] : []
|
|
587
|
+
})
|
|
588
|
+
return structuredClone(kept.sort((left, right) => (left.key < right.key ? -1 : 1)))
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
async putVideoRender(input: ArtifactVideoRenderRecord): Promise<void> {
|
|
592
|
+
const key = `${input.projectId}\0${input.key}`
|
|
593
|
+
const kept = this.videoRenders.get(key)
|
|
594
|
+
if (!kept || ("failure" in kept && !("failure" in input))) {
|
|
595
|
+
this.videoRenders.set(key, structuredClone(input))
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
async clearVideoRenderFailures(input: ListArtifactVideoRendersInput): Promise<void> {
|
|
600
|
+
for (const each of input.keys) {
|
|
601
|
+
const key = `${input.projectId}\0${each}`
|
|
602
|
+
const kept = this.videoRenders.get(key)
|
|
603
|
+
if (kept && "failure" in kept) this.videoRenders.delete(key)
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
async getVideoExportAsk(
|
|
608
|
+
input: ArtifactVideoRenderKey
|
|
609
|
+
): Promise<ArtifactVideoExportAskRecord | null> {
|
|
610
|
+
const kept = this.videoExportAsks.get(`${input.projectId}\0${input.key}`)
|
|
611
|
+
return kept ? structuredClone(kept) : null
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
async putVideoExportAsk(input: ArtifactVideoExportAskRecord): Promise<void> {
|
|
615
|
+
const key = `${input.projectId}\0${input.key}`
|
|
616
|
+
if (!this.videoExportAsks.has(key)) this.videoExportAsks.set(key, structuredClone(input))
|
|
617
|
+
}
|
|
618
|
+
|
|
520
619
|
async createComment(input: CreateArtifactCommentInput): Promise<ArtifactCommentRecord> {
|
|
521
620
|
const key = artifactKey(input.projectId, input.artifactId)
|
|
522
621
|
const stored = this.artifacts.get(key)
|
|
@@ -543,15 +642,7 @@ export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
|
543
642
|
artifactId: input.artifactId,
|
|
544
643
|
id: input.id,
|
|
545
644
|
...(input.parentId === undefined ? {} : { parentId: input.parentId }),
|
|
546
|
-
anchor:
|
|
547
|
-
...(input.anchor.board === undefined ? {} : { board: input.anchor.board }),
|
|
548
|
-
...(input.anchor.element === undefined ? {} : { element: input.anchor.element }),
|
|
549
|
-
...(input.anchor.label === undefined ? {} : { label: input.anchor.label }),
|
|
550
|
-
...(input.anchor.point === undefined
|
|
551
|
-
? {}
|
|
552
|
-
: { point: { x: input.anchor.point.x, y: input.anchor.point.y } }),
|
|
553
|
-
revision: input.anchor.revision,
|
|
554
|
-
},
|
|
645
|
+
anchor: storedCommentAnchor(input.anchor),
|
|
555
646
|
body: input.body,
|
|
556
647
|
author:
|
|
557
648
|
input.author.type === "guest"
|
|
@@ -633,6 +724,9 @@ export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
|
633
724
|
state: this.state,
|
|
634
725
|
boardPreviews: this.boardPreviews,
|
|
635
726
|
pdfs: this.pdfs,
|
|
727
|
+
media: this.media,
|
|
728
|
+
videoRenders: this.videoRenders,
|
|
729
|
+
videoExportAsks: this.videoExportAsks,
|
|
636
730
|
})
|
|
637
731
|
}
|
|
638
732
|
|
|
@@ -643,6 +737,9 @@ export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
|
643
737
|
this.state = new Map([...restored.state].map(([key, kept]) => [key, new Map(kept)]))
|
|
644
738
|
this.boardPreviews = new Map(restored.boardPreviews)
|
|
645
739
|
this.pdfs = new Map(restored.pdfs)
|
|
740
|
+
this.media = new Map(restored.media)
|
|
741
|
+
this.videoRenders = new Map(restored.videoRenders)
|
|
742
|
+
this.videoExportAsks = new Map(restored.videoExportAsks)
|
|
646
743
|
}
|
|
647
744
|
|
|
648
745
|
/**
|
|
@@ -14,6 +14,13 @@ export type {
|
|
|
14
14
|
ArtifactFrameTarget,
|
|
15
15
|
ArtifactGuest,
|
|
16
16
|
ArtifactKind,
|
|
17
|
+
ArtifactMediaFilmstrip,
|
|
18
|
+
ArtifactMediaLack,
|
|
19
|
+
ArtifactMediaPart,
|
|
20
|
+
ArtifactMediaPartName,
|
|
21
|
+
ArtifactMediaParts,
|
|
22
|
+
ArtifactMediaProbe,
|
|
23
|
+
ArtifactMediaRecord,
|
|
17
24
|
ArtifactOrigin,
|
|
18
25
|
ArtifactOutline,
|
|
19
26
|
ArtifactPdfKeyInput,
|
|
@@ -31,6 +38,10 @@ export type {
|
|
|
31
38
|
ArtifactTurnWriteRecord,
|
|
32
39
|
ArtifactVersionInput,
|
|
33
40
|
ArtifactVersionRecord,
|
|
41
|
+
ArtifactVideoExportAskRecord,
|
|
42
|
+
ArtifactVideoRenderKey,
|
|
43
|
+
ArtifactVideoRenderLack,
|
|
44
|
+
ArtifactVideoRenderRecord,
|
|
34
45
|
CopyArtifactInput,
|
|
35
46
|
CreateArtifactCommentInput,
|
|
36
47
|
CreateArtifactInput,
|
|
@@ -42,10 +53,13 @@ export type {
|
|
|
42
53
|
GetArtifactRestorePointInput,
|
|
43
54
|
GetArtifactVersionInput,
|
|
44
55
|
ListArtifactBoardPreviewsInput,
|
|
56
|
+
ListArtifactMediaInput,
|
|
45
57
|
ListArtifactsInput,
|
|
46
58
|
ListArtifactsResult,
|
|
59
|
+
ListArtifactThreadIdsInput,
|
|
47
60
|
ListArtifactVersionsInput,
|
|
48
61
|
ListArtifactVersionsResult,
|
|
62
|
+
ListArtifactVideoRendersInput,
|
|
49
63
|
ListReferencingVersionsInput,
|
|
50
64
|
PublishArtifactVersionInput,
|
|
51
65
|
PublishedArtifactVersion,
|
|
@@ -7,6 +7,7 @@ import { isFileRef } from "../../blob-storage"
|
|
|
7
7
|
import { type ArtifactLatestVersion, ArtifactStorageError } from "./errors"
|
|
8
8
|
import type {
|
|
9
9
|
ArtifactBoardPreviewRecord,
|
|
10
|
+
ArtifactCommentAnchor,
|
|
10
11
|
ArtifactCommentAuthor,
|
|
11
12
|
ArtifactCommentRecord,
|
|
12
13
|
ArtifactDocument,
|
|
@@ -14,12 +15,20 @@ import type {
|
|
|
14
15
|
ArtifactFrameGrantRecord,
|
|
15
16
|
ArtifactFrameTarget,
|
|
16
17
|
ArtifactKind,
|
|
18
|
+
ArtifactMediaFilmstrip,
|
|
19
|
+
ArtifactMediaLack,
|
|
20
|
+
ArtifactMediaPart,
|
|
21
|
+
ArtifactMediaPartName,
|
|
22
|
+
ArtifactMediaProbe,
|
|
23
|
+
ArtifactMediaRecord,
|
|
17
24
|
ArtifactPdfRecord,
|
|
18
25
|
ArtifactRecord,
|
|
19
26
|
ArtifactRestorePointRecord,
|
|
20
27
|
ArtifactStateEntry,
|
|
21
28
|
ArtifactTurnWriteRecord,
|
|
22
29
|
ArtifactVersionRecord,
|
|
30
|
+
ArtifactVideoExportAskRecord,
|
|
31
|
+
ArtifactVideoRenderRecord,
|
|
23
32
|
} from "./types"
|
|
24
33
|
|
|
25
34
|
// Rows arrive from providers with camelCase keys. JSON columns may arrive parsed (jsonb) or as text
|
|
@@ -230,6 +239,39 @@ export function parseArtifactPdfRow(row: Row): ArtifactPdfRecord {
|
|
|
230
239
|
return { ...kept, file, pages: positiveInteger(row.pages, "pages", where) }
|
|
231
240
|
}
|
|
232
241
|
|
|
242
|
+
export function parseArtifactVideoRenderRow(row: Row): ArtifactVideoRenderRecord {
|
|
243
|
+
const key = text(row.key, "key", "video render")
|
|
244
|
+
const where = `video render '${key}'`
|
|
245
|
+
const kept = {
|
|
246
|
+
projectId: text(row.projectId, "projectId", where),
|
|
247
|
+
key,
|
|
248
|
+
createdAt: date(row.createdAt, "createdAt", where),
|
|
249
|
+
}
|
|
250
|
+
if (row.failure !== null && row.failure !== undefined) {
|
|
251
|
+
const failure = text(row.failure, "failure", where)
|
|
252
|
+
if (row.lacks === null || row.lacks === undefined) return { ...kept, failure }
|
|
253
|
+
|
|
254
|
+
const lacks = row.lacks
|
|
255
|
+
if (lacks !== "sandboxes" && lacks !== "sandbox_tools") {
|
|
256
|
+
throw corrupt(where, "lacks is not sandboxes or sandbox_tools")
|
|
257
|
+
}
|
|
258
|
+
return { ...kept, failure, lacks }
|
|
259
|
+
}
|
|
260
|
+
const file = json(row.file, "file", where)
|
|
261
|
+
if (!isFileRef(file)) throw corrupt(where, "file is not a file reference")
|
|
262
|
+
return { ...kept, file }
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export function parseArtifactVideoExportAskRow(row: Row): ArtifactVideoExportAskRecord {
|
|
266
|
+
const key = text(row.key, "key", "video export ask")
|
|
267
|
+
const where = `video export ask '${key}'`
|
|
268
|
+
return {
|
|
269
|
+
projectId: text(row.projectId, "projectId", where),
|
|
270
|
+
key,
|
|
271
|
+
askedAt: date(row.askedAt, "askedAt", where),
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
233
275
|
export function parseArtifactBoardPreviewRow(row: Row): ArtifactBoardPreviewRecord {
|
|
234
276
|
const renderKey = text(row.renderKey, "renderKey", "board preview")
|
|
235
277
|
const where = `board preview '${renderKey}'`
|
|
@@ -249,6 +291,133 @@ export function parseArtifactBoardPreviewRow(row: Row): ArtifactBoardPreviewReco
|
|
|
249
291
|
}
|
|
250
292
|
}
|
|
251
293
|
|
|
294
|
+
/** What is derived of a media, each part checked as the column it is read from. */
|
|
295
|
+
export function parseArtifactMediaRow(row: Row): ArtifactMediaRecord {
|
|
296
|
+
const digest = text(row.digest, "digest", "media")
|
|
297
|
+
const where = `media '${digest}'`
|
|
298
|
+
|
|
299
|
+
const parts = json(row.parts, "parts", where)
|
|
300
|
+
if (!isObject(parts)) throw corrupt(where, "parts is not an object")
|
|
301
|
+
const part = <T extends object>(name: ArtifactMediaPartName, ready: (part: Row) => T | null) =>
|
|
302
|
+
mediaPart(parts[name], ready, () => corrupt(where, `${name} is not a media part`))
|
|
303
|
+
|
|
304
|
+
return {
|
|
305
|
+
projectId: text(row.projectId, "projectId", where),
|
|
306
|
+
digest,
|
|
307
|
+
parts: {
|
|
308
|
+
probe: part("probe", parseArtifactMediaProbe),
|
|
309
|
+
proxy: part("proxy", (ready) => (isFileRef(ready.file) ? { file: ready.file } : null)),
|
|
310
|
+
poster: part("poster", (ready) =>
|
|
311
|
+
isFileRef(ready.file) && isCount(ready.atMs) ? { file: ready.file, atMs: ready.atMs } : null
|
|
312
|
+
),
|
|
313
|
+
filmstrip: part("filmstrip", filmstrip),
|
|
314
|
+
waveform: part("waveform", (ready) => (isFileRef(ready.file) ? { file: ready.file } : null)),
|
|
315
|
+
cuts: part("cuts", (ready) =>
|
|
316
|
+
Array.isArray(ready.atMs) && ready.atMs.every(isCount) ? { atMs: ready.atMs } : null
|
|
317
|
+
),
|
|
318
|
+
transcript: part("transcript", (ready) => {
|
|
319
|
+
const { file, language } = ready
|
|
320
|
+
if (!isFileRef(file) || (language !== undefined && typeof language !== "string"))
|
|
321
|
+
return null
|
|
322
|
+
return { file, ...(language === undefined ? {} : { language }) }
|
|
323
|
+
}),
|
|
324
|
+
},
|
|
325
|
+
attempts: count(row.attempts, "attempts", where),
|
|
326
|
+
updatedAt: date(row.updatedAt, "updatedAt", where),
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function isMediaLack(value: unknown): value is ArtifactMediaLack {
|
|
331
|
+
return value === "sandboxes" || value === "sandbox_tools" || value === "transcription_model"
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/** A part pending, ready with what `ready` reads of it, or why it is not. */
|
|
335
|
+
function mediaPart<T extends object>(
|
|
336
|
+
value: unknown,
|
|
337
|
+
ready: (part: Row) => T | null,
|
|
338
|
+
corrupted: () => Error
|
|
339
|
+
): ArtifactMediaPart<T> {
|
|
340
|
+
if (!isObject(value)) throw corrupted()
|
|
341
|
+
|
|
342
|
+
const { status } = value
|
|
343
|
+
if (status === "pending") return { status }
|
|
344
|
+
if (status === "failed" && typeof value.reason === "string")
|
|
345
|
+
return { status, reason: value.reason }
|
|
346
|
+
if (status === "unavailable" && typeof value.reason === "string") {
|
|
347
|
+
const { lacks } = value
|
|
348
|
+
if (lacks === undefined) return { status, reason: value.reason }
|
|
349
|
+
if (!isMediaLack(lacks)) throw corrupted()
|
|
350
|
+
return { status, reason: value.reason, lacks }
|
|
351
|
+
}
|
|
352
|
+
const fields = status === "ready" ? ready(value) : null
|
|
353
|
+
if (!fields) throw corrupted()
|
|
354
|
+
return { status: "ready", ...fields }
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/** What a media holds, as a probe reports it; null when it is not one. */
|
|
358
|
+
export function parseArtifactMediaProbe(value: unknown): ArtifactMediaProbe | null {
|
|
359
|
+
if (!isObject(value)) return null
|
|
360
|
+
const { durationMs, container, bitRate, faststart, video, audio } = value
|
|
361
|
+
if (!isCount(durationMs) || typeof container !== "string") return null
|
|
362
|
+
if (bitRate !== undefined && !isCount(bitRate)) return null
|
|
363
|
+
if (faststart !== undefined && typeof faststart !== "boolean") return null
|
|
364
|
+
|
|
365
|
+
const picture = video === undefined ? undefined : mediaVideo(video)
|
|
366
|
+
const sound = audio === undefined ? undefined : mediaAudio(audio)
|
|
367
|
+
if (picture === null || sound === null) return null
|
|
368
|
+
|
|
369
|
+
return {
|
|
370
|
+
durationMs,
|
|
371
|
+
container,
|
|
372
|
+
...(bitRate === undefined ? {} : { bitRate }),
|
|
373
|
+
...(faststart === undefined ? {} : { faststart }),
|
|
374
|
+
...(picture ? { video: picture } : {}),
|
|
375
|
+
...(sound ? { audio: sound } : {}),
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function mediaVideo(value: unknown): ArtifactMediaProbe["video"] | null {
|
|
380
|
+
if (!isObject(value)) return null
|
|
381
|
+
const { codec, width, height, rotation, fps } = value
|
|
382
|
+
if (typeof codec !== "string" || !isPositive(width) || !isPositive(height)) return null
|
|
383
|
+
if (
|
|
384
|
+
typeof rotation !== "number" ||
|
|
385
|
+
(fps !== undefined && !(typeof fps === "number" && fps > 0))
|
|
386
|
+
) {
|
|
387
|
+
return null
|
|
388
|
+
}
|
|
389
|
+
return { codec, width, height, rotation, ...(fps === undefined ? {} : { fps }) }
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function mediaAudio(value: unknown): ArtifactMediaProbe["audio"] | null {
|
|
393
|
+
if (!isObject(value)) return null
|
|
394
|
+
const { codec, sampleRate, channels } = value
|
|
395
|
+
if (typeof codec !== "string") return null
|
|
396
|
+
if (sampleRate !== undefined && !isPositive(sampleRate)) return null
|
|
397
|
+
if (channels !== undefined && !isPositive(channels)) return null
|
|
398
|
+
return {
|
|
399
|
+
codec,
|
|
400
|
+
...(sampleRate === undefined ? {} : { sampleRate }),
|
|
401
|
+
...(channels === undefined ? {} : { channels }),
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function filmstrip(part: Row): ArtifactMediaFilmstrip | null {
|
|
406
|
+
const { file, intervalMs, count, columns, width, height } = part
|
|
407
|
+
if (!isFileRef(file) || !isPositive(intervalMs) || !isPositive(count)) return null
|
|
408
|
+
if (!isPositive(columns) || !isPositive(width) || !isPositive(height)) return null
|
|
409
|
+
return { file, intervalMs, count, columns, width, height }
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/** A whole number from 0, such as milliseconds. */
|
|
413
|
+
function isCount(value: unknown): value is number {
|
|
414
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
function isPositive(value: unknown): value is number {
|
|
418
|
+
return isCount(value) && value > 0
|
|
419
|
+
}
|
|
420
|
+
|
|
252
421
|
export function parseArtifactStateRow(row: Row): ArtifactStateEntry {
|
|
253
422
|
const key = text(row.key, "key", "artifact state")
|
|
254
423
|
const where = `artifact state '${key}'`
|
|
@@ -340,6 +509,23 @@ export const artifactStorageErrors = {
|
|
|
340
509
|
),
|
|
341
510
|
}
|
|
342
511
|
|
|
512
|
+
/**
|
|
513
|
+
* A comment's anchor as storage writes it: only what it names, field by field, so a caller's other
|
|
514
|
+
* keys never reach the column, and every provider keeps the same anchor.
|
|
515
|
+
*/
|
|
516
|
+
export function storedCommentAnchor(anchor: ArtifactCommentAnchor): ArtifactCommentAnchor {
|
|
517
|
+
return {
|
|
518
|
+
...(anchor.board === undefined ? {} : { board: anchor.board }),
|
|
519
|
+
...(anchor.element === undefined ? {} : { element: anchor.element }),
|
|
520
|
+
...(anchor.label === undefined ? {} : { label: anchor.label }),
|
|
521
|
+
...(anchor.at === undefined ? {} : { at: anchor.at }),
|
|
522
|
+
...(anchor.scene === undefined ? {} : { scene: anchor.scene }),
|
|
523
|
+
...(anchor.offset === undefined ? {} : { offset: anchor.offset }),
|
|
524
|
+
...(anchor.point === undefined ? {} : { point: { x: anchor.point.x, y: anchor.point.y } }),
|
|
525
|
+
revision: anchor.revision,
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
343
529
|
export function parseArtifactCommentRow(row: Row): ArtifactCommentRecord {
|
|
344
530
|
const id = text(row.id, "id", "artifact comment")
|
|
345
531
|
const where = `artifact comment '${id}'`
|
|
@@ -350,11 +536,16 @@ export function parseArtifactCommentRow(row: Row): ArtifactCommentRecord {
|
|
|
350
536
|
if (!isObject(anchor) || !Number.isSafeInteger(anchor.revision) || Number(anchor.revision) < 1) {
|
|
351
537
|
throw corrupt(where, "anchor names no revision")
|
|
352
538
|
}
|
|
353
|
-
for (const key of ["board", "element", "label"] as const) {
|
|
539
|
+
for (const key of ["board", "element", "label", "scene"] as const) {
|
|
354
540
|
if (anchor[key] !== undefined && typeof anchor[key] !== "string") {
|
|
355
541
|
throw corrupt(where, `anchor's ${key} is not text`)
|
|
356
542
|
}
|
|
357
543
|
}
|
|
544
|
+
for (const key of ["at", "offset"] as const) {
|
|
545
|
+
if (anchor[key] !== undefined && !Number.isSafeInteger(anchor[key])) {
|
|
546
|
+
throw corrupt(where, `anchor's ${key} is not a whole number of milliseconds`)
|
|
547
|
+
}
|
|
548
|
+
}
|
|
358
549
|
const { point } = anchor
|
|
359
550
|
if (
|
|
360
551
|
point !== undefined &&
|
|
@@ -371,6 +562,9 @@ export function parseArtifactCommentRow(row: Row): ArtifactCommentRecord {
|
|
|
371
562
|
...(typeof anchor.board === "string" ? { board: anchor.board } : {}),
|
|
372
563
|
...(typeof anchor.element === "string" ? { element: anchor.element } : {}),
|
|
373
564
|
...(typeof anchor.label === "string" ? { label: anchor.label } : {}),
|
|
565
|
+
...(typeof anchor.at === "number" ? { at: anchor.at } : {}),
|
|
566
|
+
...(typeof anchor.scene === "string" ? { scene: anchor.scene } : {}),
|
|
567
|
+
...(typeof anchor.offset === "number" ? { offset: anchor.offset } : {}),
|
|
374
568
|
...(isObject(point) ? { point: { x: Number(point.x), y: Number(point.y) } } : {}),
|
|
375
569
|
revision: Number(anchor.revision),
|
|
376
570
|
},
|
|
@@ -510,6 +704,14 @@ function text(value: unknown, column: string, where: string): string {
|
|
|
510
704
|
return value
|
|
511
705
|
}
|
|
512
706
|
|
|
707
|
+
function count(value: unknown, column: string, where: string): number {
|
|
708
|
+
const number = typeof value === "bigint" ? Number(value) : value
|
|
709
|
+
if (typeof number !== "number" || !Number.isSafeInteger(number) || number < 0) {
|
|
710
|
+
throw corrupt(where, `${column} is not a count`)
|
|
711
|
+
}
|
|
712
|
+
return number
|
|
713
|
+
}
|
|
714
|
+
|
|
513
715
|
function positiveInteger(value: unknown, column: string, where: string): number {
|
|
514
716
|
const number = typeof value === "bigint" ? Number(value) : value
|
|
515
717
|
if (typeof number !== "number" || !Number.isSafeInteger(number) || number < 1) {
|