@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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/runtime/ontology-mutations.ts", "../src/actions/run-authorization.ts", "../src/activity/device.ts", "../src/activity/connection.ts", "../src/activity/shares.ts", "../src/execution/lineage.ts", "../src/runtime/ai-cost.ts", "../src/activity/timeline.ts", "../src/activity/execution.ts", "../src/models/audio/runtime.ts", "../src/models/input-file.ts", "../src/models/audio/speech.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type {\n EditCommitResult,\n OntologyEditCommit,\n ProjectionCommitResult,\n ProjectionRunFinishInput,\n ProjectionSourceRef,\n ProjectionSourceReplacement,\n TelemetryAppend,\n TelemetryCommitResult,\n} from \"../materialization/model\"\nimport type { BoundOntologyMaterializer } from \"../materializer\"\nimport type { OntologySourceRecord } from \"../storage/ontology\"\n\nexport interface OntologyMutationRuntime {\n getProjectionSource?(source: ProjectionSourceRef): Promise<OntologySourceRecord | null>\n commitEdits(input: OntologyEditCommit): Promise<EditCommitResult>\n replaceProjection(input: ProjectionSourceReplacement): Promise<ProjectionCommitResult>\n finishProjection(input: ProjectionRunFinishInput): Promise<void>\n appendTelemetry(input: TelemetryAppend): Promise<TelemetryCommitResult>\n}\n\nconst ontologyMutationRuntimeKey: unique symbol = Symbol(\"sixb.ontologyMutationRuntime\")\n\ninterface OntologyMutationRuntimeOwner {\n readonly [ontologyMutationRuntimeKey]?: OntologyMutationRuntime\n}\n\nexport function registerOntologyMutationRuntime(\n owner: object,\n runtime: OntologyMutationRuntime\n): void {\n const registered = (owner as OntologyMutationRuntimeOwner)[ontologyMutationRuntimeKey]\n if (registered && registered !== runtime) {\n throw new Error(\"[Sixb] Ontology mutation runtime is already registered for this owner.\")\n }\n Object.defineProperty(owner, ontologyMutationRuntimeKey, {\n configurable: false,\n enumerable: true,\n value: runtime,\n writable: false,\n })\n}\n\nexport function getOntologyMutationRuntime(owner: object): OntologyMutationRuntime {\n const runtime = (owner as OntologyMutationRuntimeOwner)[ontologyMutationRuntimeKey]\n if (runtime) return runtime\n throw new Error(\"[Sixb] Ontology mutation runtime is not registered for this runtime context.\")\n}\n\n/** Copies the opaque capability when an internal runtime context is reconstructed. */\nexport function shareOntologyMutationRuntime(source: object, target: object): void {\n registerOntologyMutationRuntime(target, getOntologyMutationRuntime(source))\n}\n\n/** Adapt an already-bound Materializer to the internal ontology mutation runtime. */\nexport function createOntologyMutationRuntime(input: {\n readonly materializer: BoundOntologyMaterializer\n readonly notifyCommittedFacts: () => void\n /** Called once a projection may have changed the dataset version its source applied. */\n readonly onProjectionApplied?: () => void\n}): OntologyMutationRuntime {\n const applied = <TResult>(work: Promise<TResult>): Promise<TResult> =>\n work.finally(() => notifyWithoutAffecting(input.onProjectionApplied))\n\n const runtime: OntologyMutationRuntime = {\n getProjectionSource: (source) => input.materializer.projections.getActive(source),\n commitEdits: (command) =>\n commitAndNotify(() => input.materializer.edits.commit(command), input.notifyCommittedFacts),\n replaceProjection: (command) =>\n applied(\n commitAndNotify(\n () => input.materializer.projections.replace(command),\n input.notifyCommittedFacts\n )\n ),\n finishProjection: (command) => applied(input.materializer.projections.finishRun(command)),\n appendTelemetry: (command) =>\n commitAndNotify(\n () => input.materializer.telemetry.append(command),\n input.notifyCommittedFacts\n ),\n }\n return Object.freeze(runtime)\n}\n\nasync function commitAndNotify<TResult extends { readonly eventCount: number }>(\n commit: () => Promise<TResult>,\n notify: () => void\n): Promise<TResult> {\n const result = await commit()\n if (result.eventCount > 0) notifyWithoutAffectingCommit(notify)\n return result\n}\n\nfunction notifyWithoutAffectingCommit(notify: () => void): void {\n try {\n notify()\n } catch (error) {\n // The ontology commit is already durable. A wake-up failure must never turn it into an apparent\n // mutation failure; the orchestrator's ontology maintenance remains the correctness fallback.\n console.error(\"[Sixb] Failed to wake the ontology outbox dispatcher:\", error)\n }\n}\n\nfunction notifyWithoutAffecting(notify: (() => void) | undefined): void {\n try {\n notify?.()\n } catch (error) {\n console.error(\"[Sixb] Failed to report an applied projection:\", error)\n }\n}\n",
|
|
6
|
+
"import { type AuthorizationContext, canViewActionRun, isAllowed } from \"../authorization\"\nimport { AuthorizationError } from \"../authorization/errors\"\nimport type { ResolvedRuntimeAuthorization } from \"../execution/authorization\"\nimport { type AuthorizedObjectReader, readerClearance } from \"../execution/authorized-object-reader\"\nimport type { Storage } from \"../storage\"\nimport type { ActionRunRecord } from \"../storage/action-runs\"\nimport { findPrimitiveParentRequestExecution } from \"../storage/executions/run-link\"\nimport { objectBatchKey } from \"../storage/objects/keys\"\nimport type { ActionObjectSubject } from \"./types\"\n\n/**\n * The runs among these a principal may view. `canViewActionRun` decides on the subject's type,\n * which a type the principal views through a condition fails: a run on one is viewable while the\n * condition shows its subject now. A deleted subject shows nothing, so its runs stay hidden.\n */\nexport async function viewableActionRuns<\n TRun extends Pick<ActionRunRecord, \"actionId\" | \"subject\">,\n>(\n objectReader: AuthorizedObjectReader,\n authorization: AuthorizationContext | null | undefined,\n runs: readonly TRun[]\n): Promise<readonly TRun[]> {\n if (!authorization) return runs\n\n const subjectThroughCondition = (run: TRun): ActionObjectSubject | undefined =>\n run.subject.kind === \"object\" &&\n authorization.viewConditions?.has(run.subject.objectTypeId) === true &&\n isAllowed(authorization, { kind: \"action.apply\", actionId: run.actionId })\n ? run.subject\n : undefined\n\n const subjects = runs.flatMap((run) => subjectThroughCondition(run) ?? [])\n const shown = subjects.length === 0 ? new Set() : await readableSubjects(objectReader, subjects)\n\n return runs.filter((run) => {\n if (canViewActionRun(authorization, run)) return true\n\n const subject = subjectThroughCondition(run)\n return (\n subject !== undefined && shown.has(objectBatchKey(subject.objectTypeId, subject.primaryId))\n )\n })\n}\n\n/**\n * The action subjects the reader reads now, by `objectBatchKey`: object type grants, conditions,\n * markings and existence alike. One batch per object type, as a type the reader cannot see fails\n * its whole batch.\n */\nexport async function readableSubjects(\n objectReader: AuthorizedObjectReader,\n subjects: readonly ActionObjectSubject[]\n): Promise<ReadonlySet<string>> {\n const byType = new Map<string, Map<string, ActionObjectSubject>>()\n for (const subject of subjects) {\n const items = byType.get(subject.objectTypeId) ?? new Map()\n items.set(subject.primaryId, subject)\n byType.set(subject.objectTypeId, items)\n }\n\n const readable = new Set<string>()\n await Promise.all(\n [...byType.values()].map(async (items) => {\n try {\n const rows = await objectReader.getByPrimaryIdBatch({ items: [...items.values()] })\n for (const key of rows.keys()) {\n readable.add(key)\n }\n } catch (error) {\n if (!(error instanceof AuthorizationError)) {\n throw error\n }\n }\n })\n )\n return readable\n}\n\n/**\n * Whether the reader can read the object type of a run's subject under the markings of the\n * versions projections applied. A run names its subject's id, so a run on a type the reader\n * cannot read is hidden like one on a type it has no view grant for.\n */\nexport async function canReadActionRunSubject(\n objectReader: AuthorizedObjectReader,\n run: Pick<ActionRunRecord, \"subject\">\n): Promise<boolean> {\n if (run.subject.kind !== \"object\") return true\n const clearance = await readerClearance(objectReader)\n return clearance?.unreadableType(run.subject.objectTypeId) === undefined\n}\n\n/** The object types whose runs the reader cannot read, to leave out of a run listing. */\nexport async function unreadableActionRunTypes(\n objectReader: AuthorizedObjectReader\n): Promise<ReadonlySet<string>> {\n const clearance = await readerClearance(objectReader)\n return new Set(clearance?.unreadable().types.keys())\n}\n\n/** Check both current grant scope and immutable request provenance for a delegated Action run. */\nexport async function canDelegationAccessActionRun(input: {\n readonly storage: Storage\n readonly projectId: string\n readonly authority: Extract<ResolvedRuntimeAuthorization, { readonly type: \"delegated\" }>\n readonly run: ActionRunRecord\n}): Promise<boolean> {\n const subject = input.run.subject\n if (\n !input.authority.delegation ||\n subject.kind !== \"object\" ||\n !input.authority.actionApply.some(\n (target) =>\n target.actionId === input.run.actionId &&\n target.subject.objectTypeId === subject.objectTypeId &&\n target.subject.primaryId === subject.primaryId\n )\n ) {\n return false\n }\n return actionRunBelongsToShareGrant({\n storage: input.storage,\n projectId: input.projectId,\n run: input.run,\n grantId: input.authority.delegation.grantId,\n })\n}\n\n/** Session ids remain audit provenance; the issued grant is the durable capability identity. */\nexport async function actionRunBelongsToShareGrant(input: {\n readonly storage: Storage\n readonly projectId: string\n readonly run: Pick<ActionRunRecord, \"id\" | \"actionId\" | \"executionId\">\n readonly grantId: string\n}): Promise<boolean> {\n const parent = await findPrimitiveParentRequestExecution({\n executions: input.storage.executions,\n projectId: input.projectId,\n executionId: input.run.executionId,\n primitive: { kind: \"action\", id: input.run.actionId, runId: input.run.id },\n })\n const authorization = parent?.authorizationRef\n return (\n authorization?.type === \"delegated\" &&\n authorization.delegation.kind === \"share\" &&\n authorization.delegation.grantId === input.grantId\n )\n}\n",
|
|
7
|
+
"/** What a user agent says about the device that signed in. Display only, never authorization. */\nexport interface ActivityDevice {\n readonly browser?: string\n readonly os?: string\n}\n\n// First match wins: Edge and Opera also name Chrome, Chrome names Safari, iOS names Mac OS X, and\n// Android names Linux.\nconst BROWSERS: readonly (readonly [RegExp, string])[] = [\n [/\\bEdg(?:e|A|iOS)?\\//, \"Edge\"],\n [/\\b(?:OPR|Opera)\\//, \"Opera\"],\n [/\\bSamsungBrowser\\//, \"Samsung Internet\"],\n [/\\b(?:Firefox|FxiOS)\\//, \"Firefox\"],\n [/\\b(?:Chrome|Chromium|CriOS|HeadlessChrome)\\//, \"Chrome\"],\n [/\\bVersion\\/[\\d.]+.*\\bSafari\\//, \"Safari\"],\n]\n\nconst SYSTEMS: readonly (readonly [RegExp, string])[] = [\n [/\\bWindows\\b/, \"Windows\"],\n [/\\biPad\\b/, \"iPadOS\"],\n [/\\b(?:iPhone|iPod)\\b/, \"iOS\"],\n [/\\bAndroid\\b/, \"Android\"],\n [/\\bCrOS\\b/, \"ChromeOS\"],\n [/\\bMac OS X\\b|\\bMacintosh\\b/, \"macOS\"],\n [/\\bLinux\\b/, \"Linux\"],\n]\n\n/** The browser and operating system a user agent names, when it names a common one. */\nexport function describeUserAgent(userAgent: string | undefined): ActivityDevice {\n if (!userAgent) {\n return {}\n }\n\n const browser = BROWSERS.find(([pattern]) => pattern.test(userAgent))?.[1]\n const os = SYSTEMS.find(([pattern]) => pattern.test(userAgent))?.[1]\n\n return {\n ...(browser === undefined ? {} : { browser }),\n ...(os === undefined ? {} : { os }),\n }\n}\n",
|
|
8
|
+
"import type { SixbRuntimeContext } from \"../runtime/types\"\nimport type { ActivityVisit, StoredActivityVisitPage } from \"../storage/activity/types\"\nimport type { SessionRecord } from \"../storage/auth\"\nimport type { ShareGrantRecord } from \"../storage/share-grants\"\nimport { type ActivityDevice, describeUserAgent } from \"./device\"\nimport type { ActivityService } from \"./service\"\n\nexport type ActivityConnectionStatus = \"active\" | \"expired\" | \"revoked\"\n\n/** A signed-in session. No address or token is kept here. */\nexport interface ActivitySessionConnection {\n readonly type: \"session\"\n readonly device: ActivityDevice\n /** A native client's own label, such as a CLI's. */\n readonly clientName?: string\n readonly status: ActivityConnectionStatus\n readonly createdAt: Date\n readonly lastSeenAt?: Date\n readonly revokedAt?: Date\n}\n\n/** The shared link a visitor opened, and the session it gave them. */\nexport interface ActivityShareConnection {\n readonly type: \"share\"\n readonly grantId: string\n /** Absent once the link's grant is gone. */\n readonly definitionId?: string\n readonly status: ActivityConnectionStatus\n readonly createdAt: Date\n readonly revokedAt?: Date\n}\n\nexport type ActivityConnection = ActivitySessionConnection | ActivityShareConnection\n\n/** A user's sign-in, with the visits it opened. */\nexport interface ActivityUserConnection extends ActivitySessionConnection {\n /** Every visit the session opened. */\n readonly visits: number\n /** Its latest visits, newest first. */\n readonly latestVisits: readonly ActivityVisit[]\n}\n\nexport interface ActivityConnectionsPage {\n readonly connections: readonly ActivityUserConnection[]\n /** Pass it back as `cursor` for the next, older connections; absent on the last page. */\n readonly nextCursor?: string\n}\n\nexport interface ActivityConnectionsQuery {\n readonly userId: string\n /** 1 to 100. Default: 20. */\n readonly limit?: number\n /** The previous page's `nextCursor`. */\n readonly cursor?: string\n}\n\n/** Where a list of sessions continues: a creation time, and how many created then it returned. */\nexport interface ActivityConnectionsCursor {\n readonly createdAt: Date\n readonly skip: number\n}\n\n/** A user's sign-ins, newest first, revoked and expired ones too: one read per store. */\nexport async function readActivityConnections(\n runtime: SixbRuntimeContext,\n service: ActivityService,\n query: ActivityConnectionsQuery,\n now: Date\n): Promise<ActivityConnectionsPage> {\n const { userId, limit, before } = service.connectionsQuery(query)\n const sessions = runtime.storage.auth?.sessions\n if (!sessions) {\n return { connections: [] }\n }\n\n const page = await sessions.listByUserId({\n projectId: runtime.projectId,\n userId,\n limit,\n ...(before === undefined ? {} : { before }),\n })\n const visits = await service.sessionVisits({\n userId,\n sessionIds: page.sessions.map((session) => session.id),\n })\n const bySession = new Map(visits.map((entry) => [entry.sessionId, entry]))\n\n const connections = page.sessions.map((session) => ({\n ...sessionConnection(session, now),\n visits: bySession.get(session.id)?.visits ?? 0,\n latestVisits: bySession.get(session.id)?.latest ?? [],\n }))\n const last = page.sessions.at(-1)\n\n return {\n connections,\n ...(page.hasMore && last\n ? { nextCursor: nextConnectionsCursor(page.sessions, last, before) }\n : {}),\n }\n}\n\n/**\n * The cursor after a page: its last creation time, and how many sessions created then this page\n * and the ones before it returned. It names no session, so the session id never leaves core.\n */\nfunction nextConnectionsCursor(\n sessions: readonly SessionRecord[],\n last: SessionRecord,\n before: ActivityConnectionsCursor | undefined\n): string {\n const { createdAt } = last\n const tied = sessions.filter((session) => session.createdAt.getTime() === createdAt.getTime())\n const earlier = before && before.createdAt.getTime() === createdAt.getTime() ? before.skip : 0\n\n return encodeActivityConnectionsCursor({ createdAt, skip: earlier + tied.length })\n}\n\nexport function encodeActivityConnectionsCursor(cursor: ActivityConnectionsCursor): string {\n return Buffer.from(JSON.stringify([cursor.createdAt.toISOString(), cursor.skip])).toString(\n \"base64url\"\n )\n}\n\nexport function decodeActivityConnectionsCursor(value: string): ActivityConnectionsCursor {\n try {\n const parsed: unknown = JSON.parse(Buffer.from(value, \"base64url\").toString(\"utf8\"))\n if (Array.isArray(parsed) && parsed.length === 2) {\n const [at, skip] = parsed\n const createdAt = new Date(typeof at === \"string\" ? at : Number.NaN)\n if (Number.isFinite(createdAt.getTime()) && Number.isSafeInteger(skip) && skip >= 0) {\n return { createdAt, skip }\n }\n }\n } catch {\n // Reported below, like any other malformed cursor.\n }\n throw new Error(\"[Sixb] Invalid activity connections cursor.\")\n}\n\n/**\n * The session a visit came through: a sign-in, or a shared link, whose grant the caller read with\n * the visit's share name.\n */\nexport async function readActivityConnection(\n runtime: SixbRuntimeContext,\n page: StoredActivityVisitPage,\n grant: ShareGrantRecord | undefined,\n now: Date\n): Promise<ActivityConnection | undefined> {\n const { storage, projectId } = runtime\n const { actor } = page.visit\n\n if (actor.type === \"user\") {\n const session = await storage.auth?.sessions.getById({ projectId, id: page.sessionId })\n return session ? sessionConnection(session, now) : undefined\n }\n\n const session = await storage.shareSessions?.getById({ projectId, id: page.sessionId })\n if (!session) {\n return undefined\n }\n\n // A session lasts no longer than its link: revoking or expiring the grant ends it too.\n const revokedAt = [session.revokedAt, grant?.revokedAt]\n .flatMap((at) => (at === undefined ? [] : [at.getTime()]))\n .sort((left, right) => left - right)[0]\n const statuses = [\n connectionStatus(session, now),\n ...(grant ? [connectionStatus(grant, now)] : []),\n ]\n const status = statuses.includes(\"revoked\")\n ? \"revoked\"\n : statuses.includes(\"expired\")\n ? \"expired\"\n : \"active\"\n\n return {\n type: \"share\",\n grantId: actor.grantId,\n ...(grant ? { definitionId: grant.definitionId } : {}),\n status,\n createdAt: new Date(session.createdAt),\n ...(revokedAt === undefined ? {} : { revokedAt: new Date(revokedAt) }),\n }\n}\n\nfunction connectionStatus(\n session: {\n readonly expiresAt: Date\n readonly absoluteExpiresAt?: Date\n readonly revokedAt?: Date\n },\n now: Date\n): ActivityConnectionStatus {\n if (session.revokedAt) {\n return \"revoked\"\n }\n\n const expired =\n session.expiresAt <= now ||\n (session.absoluteExpiresAt !== undefined && session.absoluteExpiresAt <= now)\n return expired ? \"expired\" : \"active\"\n}\n\n/** A signed-in session as a connection, from its record and the time it is read at. */\nfunction sessionConnection(session: SessionRecord, now: Date): ActivitySessionConnection {\n return {\n type: \"session\",\n device: describeUserAgent(session.userAgent),\n ...(session.bearer === undefined ? {} : { clientName: session.bearer.clientName }),\n status: connectionStatus(session, now),\n createdAt: new Date(session.createdAt),\n ...(session.lastSeenAt === undefined ? {} : { lastSeenAt: new Date(session.lastSeenAt) }),\n ...(session.revokedAt === undefined ? {} : { revokedAt: new Date(session.revokedAt) }),\n }\n}\n",
|
|
9
|
+
"import type { SixbRuntimeContext } from \"../runtime/types\"\nimport type { ActivityActor, ActivityVisit } from \"../storage/activity/types\"\nimport type { ShareGrantRecord } from \"../storage/share-grants\"\n\n/** Who a visit belongs to, as `sixb.activity` returns it: a shared link also names its share. */\nexport type ActivityVisitActor =\n | Extract<ActivityActor, { readonly type: \"user\" }>\n | (Extract<ActivityActor, { readonly type: \"share\" }> & {\n /** The link's share definition; absent once its grant is gone. */\n readonly definitionId?: string\n })\n\n/** A visit as `sixb.activity` returns it. */\nexport interface ActivityVisitView extends Omit<ActivityVisit, \"actor\"> {\n readonly actor: ActivityVisitActor\n}\n\n/** Visits named by their links' shares, from one grant read for all of them. */\nexport async function nameSharedVisits(\n runtime: SixbRuntimeContext,\n visits: readonly ActivityVisit[]\n): Promise<readonly ActivityVisitView[]> {\n const grants = await readGrants(runtime, visits)\n return visits.map((visit) => withShare(visit, grants))\n}\n\n/** One visit named by its link's share, with that link's grant when it still exists. */\nexport async function nameSharedVisit(\n runtime: SixbRuntimeContext,\n visit: ActivityVisit\n): Promise<{ readonly visit: ActivityVisitView; readonly grant?: ShareGrantRecord }> {\n const grants = await readGrants(runtime, [visit])\n const grant = visit.actor.type === \"share\" ? grants.get(visit.actor.grantId) : undefined\n\n return { visit: withShare(visit, grants), ...(grant === undefined ? {} : { grant }) }\n}\n\nasync function readGrants(\n runtime: SixbRuntimeContext,\n visits: readonly ActivityVisit[]\n): Promise<ReadonlyMap<string, ShareGrantRecord>> {\n const ids = visits.flatMap((visit) => (visit.actor.type === \"share\" ? [visit.actor.grantId] : []))\n if (ids.length === 0 || !runtime.storage.shareGrants) {\n return new Map()\n }\n\n const grants = await runtime.storage.shareGrants.getByIds({ projectId: runtime.projectId, ids })\n return new Map(grants.map((grant) => [grant.id, grant]))\n}\n\nfunction withShare(\n visit: ActivityVisit,\n grants: ReadonlyMap<string, ShareGrantRecord>\n): ActivityVisitView {\n const { actor } = visit\n const grant = actor.type === \"share\" ? grants.get(actor.grantId) : undefined\n if (actor.type !== \"share\" || grant === undefined) {\n return visit\n }\n\n return { ...visit, actor: { ...actor, definitionId: grant.definitionId } }\n}\n",
|
|
10
|
+
"/**\n * The nearest of an execution and its ancestors that `isOwner` accepts, walking up through\n * `parentOf`: where a roll-up counts what the execution spent. Undefined when the walk runs out of\n * known parents first.\n */\nexport function nearestOwner(\n executionId: string,\n parentOf: (executionId: string) => string | undefined,\n isOwner: (executionId: string) => boolean\n): string | undefined {\n let current: string | undefined = executionId\n while (current !== undefined && !isOwner(current)) current = parentOf(current)\n return current\n}\n",
|
|
11
|
+
"import type { AiCostStorage, AiCostSummary } from \"../storage/ai-cost\"\n\n/** Resolve preferred cost summaries in input order without inventing unavailable accounting. */\nexport async function resolveExecutionCosts(input: {\n readonly storage: AiCostStorage | undefined\n readonly projectId: string\n readonly executionIds: readonly string[]\n}): Promise<readonly (AiCostSummary | undefined)[]> {\n if (input.executionIds.length === 0) return []\n if (!input.storage) return input.executionIds.map(() => undefined)\n return input.storage.summarizeExecutions({\n projectId: input.projectId,\n executionIds: input.executionIds,\n })\n}\n\n/** The cost of several executions together; nothing when none made a call. */\nexport function addCostSummaries(summaries: readonly AiCostSummary[]): AiCostSummary | undefined {\n const amounts = new Map<string, bigint>()\n let ratedCallCount = 0\n let unpriceableCallCount = 0\n let unvaluedCallCount = 0\n\n for (const summary of summaries) {\n for (const money of summary.amounts) {\n amounts.set(money.currency, (amounts.get(money.currency) ?? 0n) + BigInt(money.amountNanos))\n }\n ratedCallCount += summary.ratedCallCount\n unpriceableCallCount += summary.unpriceableCallCount\n unvaluedCallCount += summary.unvaluedCallCount\n }\n\n if (ratedCallCount + unpriceableCallCount + unvaluedCallCount === 0) {\n return undefined\n }\n\n return {\n amounts: [...amounts]\n .sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))\n .map(([currency, amount]) => ({ currency, amountNanos: amount.toString() })),\n ratedCallCount,\n unpriceableCallCount,\n unvaluedCallCount,\n }\n}\n",
|
|
12
|
+
"import {\n readableSubjects,\n unreadableActionRunTypes,\n viewableActionRuns,\n} from \"../actions/run-authorization\"\nimport { canViewWorkflowRun, isRuntimeAllowed } from \"../authorization\"\nimport { nearestOwner } from \"../execution/lineage\"\nimport { addCostSummaries, resolveExecutionCosts } from \"../runtime/ai-cost\"\nimport type { SixbRuntimeContext } from \"../runtime/types\"\nimport type { ActionRunStatus } from \"../storage/action-runs\"\nimport { ACTIVITY_MAX_VISIT_MS, ACTIVITY_MIN_IDLE_TIMEOUT_MS } from \"../storage/activity/policy\"\nimport type { ActivityVisit, StoredActivityVisitPage } from \"../storage/activity/types\"\nimport type { AgentRunStatus, ConversationAgentRunRecord } from \"../storage/agents\"\nimport type { AiCostSummary } from \"../storage/ai-cost\"\nimport type { ExecutionRecord } from \"../storage/executions\"\nimport { objectBatchKey } from \"../storage/objects/keys\"\nimport type { ShareGrantRecord } from \"../storage/share-grants\"\nimport type { WorkflowRunStatus } from \"../storage/workflow-runs\"\nimport { type ActivityConnection, readActivityConnection } from \"./connection\"\nimport type { ActivityVisitView } from \"./shares\"\n\n/**\n * At most this many page views and interactions together, and as many recorded executions, make a\n * visit's timeline.\n */\nexport const ACTIVITY_TIMELINE_LIMIT = 200\n\n/**\n * How far around its activity a visit claims its session's executions. A click right after a\n * return reaches the server before the activity that opens the visit, and the last action before\n * leaving may come after the last activity sent. Half the shortest idle timeout keeps the visits of\n * one session from claiming the same execution.\n */\nconst SESSION_GRACE_MS = ACTIVITY_MIN_IDLE_TIMEOUT_MS / 2\n\nexport interface ActivityPageEntry {\n readonly kind: \"page\"\n readonly at: Date\n readonly sequence: number\n readonly route: string\n}\n\n/** An interaction the app marked, on the page it happened on. */\nexport interface ActivityInteractionEntry {\n readonly kind: \"interaction\"\n readonly at: Date\n readonly sequence: number\n readonly name: string\n readonly route: string\n}\n\nexport interface ActivityActionEntry {\n readonly kind: \"action\"\n readonly at: Date\n readonly executionId: string\n readonly actionId: string\n readonly runId: string\n /** `incomplete` when no outcome is recorded: the run is in flight, or was interrupted. */\n readonly status: ActionRunStatus | \"incomplete\"\n /** Whether the viewer may read the run itself, as Observability › Runs shows it. */\n readonly runVisible: boolean\n /** The object it applied to, only when the viewer can read that object. */\n readonly object?: { readonly objectTypeId: string; readonly primaryId: string }\n}\n\nexport interface ActivityWorkflowEntry {\n readonly kind: \"workflow\"\n readonly at: Date\n readonly executionId: string\n readonly workflowId: string\n readonly runId: string\n readonly status: WorkflowRunStatus | \"incomplete\"\n /** Whether the viewer may read the run itself, as Observability › Runs shows it. */\n readonly runVisible: boolean\n}\n\n/** A conversation's run: its metadata, and its thread's title only for those who read threads. */\nexport interface ActivityAgentEntry {\n readonly kind: \"agent\"\n readonly at: Date\n readonly executionId: string\n readonly runId: string\n readonly threadId: string\n /**\n * Present only when the viewer can read the conversation, with `can.observe(agent.threads)`.\n * Activity alone never shows a title or a message.\n */\n readonly thread?: { readonly title?: string }\n readonly status: AgentRunStatus\n /** Messages in the thread now, every run's. */\n readonly messages: number\n /** The run's model calls with those of its subagents and tools; absent without any. */\n readonly cost?: AiCostSummary\n}\n\nexport type ActivityTimelineEntry =\n | ActivityPageEntry\n | ActivityInteractionEntry\n | ActivityActionEntry\n | ActivityWorkflowEntry\n | ActivityAgentEntry\n\nexport interface ActivityVisitTimeline {\n readonly visit: ActivityVisitView\n /** Absent once the session is gone, or without an auth or share store. */\n readonly connection?: ActivityConnection\n /**\n * By time. Page views and interactions come in their sequence, and before executions at the same\n * instant.\n */\n readonly entries: readonly ActivityTimelineEntry[]\n /**\n * More than {@link ACTIVITY_TIMELINE_LIMIT} page views and interactions, or recorded executions.\n * The timeline then stops at the last page view or interaction, or the last root execution, it\n * could keep.\n */\n readonly truncated: boolean\n}\n\n/**\n * A visit's timeline: its page views and interactions, and what its session started while it\n * lasted. One bounded read per source, each batched over the visit; see `README.md`.\n */\nexport async function composeActivityTimeline(\n runtime: SixbRuntimeContext,\n input: {\n readonly page: StoredActivityVisitPage\n /** The visit, named by its link's share. */\n readonly visit: ActivityVisitView\n /** That link's grant, read with the name. */\n readonly grant?: ShareGrantRecord\n },\n now: Date\n): Promise<ActivityVisitTimeline> {\n const { page, visit } = input\n const { storage, projectId } = runtime\n\n const [ledger, connection] = await Promise.all([\n storage.executions.listBySession({\n projectId,\n session: { type: visit.actor.type, id: page.sessionId },\n ...sessionWindow(visit),\n limit: ACTIVITY_TIMELINE_LIMIT,\n }),\n readActivityConnection(runtime, page, input.grant, now),\n ])\n const executions = ledger.executions\n\n const ofKind = (kind: \"action\" | \"workflow\") =>\n executions.flatMap((execution) =>\n execution.executor.type === \"primitive\" && execution.executor.kind === kind\n ? [execution.id]\n : []\n )\n const agentRunIds = executions.flatMap((execution) =>\n execution.executor.type === \"agent\" ? [execution.executor.runId] : []\n )\n\n // Only what an Agent ran can count toward a conversation's cost.\n const byId = new Map(executions.map((execution) => [execution.id, execution]))\n const withAgent = executions.filter((execution) =>\n lineage(execution, byId).some((ancestor) => ancestor.executor.type === \"agent\")\n )\n\n const [actionRuns, workflowRuns, agentRuns, costs] = await Promise.all([\n storage.actionRuns?.getByExecutionIds({ projectId, executionIds: ofKind(\"action\") }) ?? [],\n storage.workflowRuns?.getByExecutionIds({ projectId, executionIds: ofKind(\"workflow\") }) ?? [],\n storage.agents?.runs.getByIds({ projectId, ids: agentRunIds }) ?? [],\n resolveExecutionCosts({\n storage: storage.aiCosts,\n projectId,\n executionIds: withAgent.map((execution) => execution.id),\n }),\n ])\n\n // A subagent's cost goes to the conversation above it. A Workflow's Agent steps have none.\n const conversations = new Map(\n agentRuns.flatMap((run) =>\n run.kind === \"conversation\" ? [[run.executionId, run] as const] : []\n )\n )\n const subjects = actionRuns.flatMap((run) => (run.subject.kind === \"object\" ? [run.subject] : []))\n\n const [threads, readable, unreadableRunTypes, viewableRuns] = await Promise.all([\n storage.agents?.threads.getByIds({\n projectId,\n ids: [...conversations.values()].map((run) => run.threadId),\n }) ?? [],\n readableSubjects(runtime.objectReader, subjects),\n subjects.length > 0 ? unreadableActionRunTypes(runtime.objectReader) : new Set<string>(),\n viewableActionRuns(runtime.objectReader, runtime.authorization, actionRuns),\n ])\n\n const actionRunByExecution = new Map(actionRuns.map((run) => [run.executionId, run]))\n const viewableRunIds = new Set(viewableRuns.map((run) => run.id))\n const workflowRunByExecution = new Map(workflowRuns.map((run) => [run.executionId, run]))\n const threadById = new Map(threads.map((thread) => [thread.id, thread]))\n const observesThreads = isRuntimeAllowed(runtime, { kind: \"agentThreads.observe\" })\n const costByAgent = rollUpCosts(byId, conversations, withAgent, costs)\n\n const executionEntries = executions.flatMap((execution): ActivityTimelineEntry[] => {\n const at = new Date(execution.createdAt)\n const executor = execution.executor\n const authority = execution.authorizationRef\n\n if (executor.type === \"primitive\" && authority.type === \"trustedPrimitive\") {\n if (executor.kind === \"action\") {\n const run = actionRunByExecution.get(execution.id)\n const subject = run?.subject.kind === \"object\" ? run.subject : undefined\n const object =\n subject && readable.has(objectBatchKey(subject.objectTypeId, subject.primaryId))\n ? { objectTypeId: subject.objectTypeId, primaryId: subject.primaryId }\n : undefined\n\n // As the runs page decides: the action, its subject's type or, through a condition, the\n // subject itself, and the type's markings.\n const runVisible =\n run !== undefined &&\n viewableRunIds.has(run.id) &&\n (subject === undefined || !unreadableRunTypes.has(subject.objectTypeId))\n\n return [\n {\n kind: \"action\",\n at,\n executionId: execution.id,\n actionId: authority.primitive.id,\n runId: executor.runId,\n status: run?.status ?? \"incomplete\",\n runVisible,\n ...(object === undefined ? {} : { object }),\n },\n ]\n }\n\n if (executor.kind === \"workflow\") {\n const run = workflowRunByExecution.get(execution.id)\n return [\n {\n kind: \"workflow\",\n at,\n executionId: execution.id,\n workflowId: authority.primitive.id,\n runId: executor.runId,\n status: run?.status ?? \"incomplete\",\n runVisible: run !== undefined && canViewWorkflowRun(runtime.authorization, run),\n },\n ]\n }\n }\n\n const conversation = conversations.get(execution.id)\n if (conversation) {\n const cost = costByAgent.get(execution.id)\n const thread = threadById.get(conversation.threadId)\n const title = thread?.title\n\n return [\n {\n kind: \"agent\",\n at,\n executionId: execution.id,\n runId: conversation.id,\n threadId: conversation.threadId,\n ...(observesThreads && thread ? { thread: title === undefined ? {} : { title } } : {}),\n status: conversation.status,\n messages: thread?.messageCount ?? 0,\n ...(cost === undefined ? {} : { cost }),\n },\n ]\n }\n\n return []\n })\n\n // Recorded entries come first at an equal instant, in their sequence: the sort is stable.\n const recorded = [\n ...page.pageViews.map(\n (pageView): ActivityPageEntry => ({\n kind: \"page\",\n at: new Date(pageView.receivedAt),\n sequence: pageView.sequence,\n route: pageView.route,\n })\n ),\n ...page.interactions.map(\n (interaction): ActivityInteractionEntry => ({\n kind: \"interaction\",\n at: new Date(interaction.receivedAt),\n sequence: interaction.sequence,\n name: interaction.name,\n route: interaction.route,\n })\n ),\n ].sort((left, right) => left.sequence - right.sequence)\n\n // Past the last page view, interaction or root kept, a source left rows out: the timeline stops\n // there.\n const cutoffs = [\n page.hasMore ? recorded.at(-1)?.at : undefined,\n ledger.truncated\n ? executions.filter((execution) => execution.source.type !== \"execution\").at(-1)?.createdAt\n : undefined,\n ].flatMap((at) => (at === undefined ? [] : [at.getTime()]))\n const cutoff = cutoffs.length > 0 ? Math.min(...cutoffs) : Number.POSITIVE_INFINITY\n\n const entries = [...recorded, ...executionEntries]\n .filter((entry) => entry.at.getTime() <= cutoff)\n .sort((left, right) => left.at.getTime() - right.at.getTime())\n\n return {\n visit,\n ...(connection === undefined ? {} : { connection }),\n entries,\n truncated: page.hasMore || ledger.truncated,\n }\n}\n\n/**\n * Roots created in `[start - grace, last activity + grace)`, cut where the session's next visit\n * may start once this one is a day old.\n */\nfunction sessionWindow(visit: ActivityVisit): { readonly from: Date; readonly to: Date } {\n const startedAt = visit.startedAt.getTime()\n return {\n from: new Date(startedAt - SESSION_GRACE_MS),\n to: new Date(\n Math.min(\n visit.lastSeenAt.getTime() + SESSION_GRACE_MS,\n startedAt + ACTIVITY_MAX_VISIT_MS - SESSION_GRACE_MS\n )\n ),\n }\n}\n\n/** An execution, then its parent and the parent's, as far as the visit's executions go. */\nfunction lineage(\n execution: ExecutionRecord,\n byId: ReadonlyMap<string, ExecutionRecord>\n): readonly ExecutionRecord[] {\n const chain: ExecutionRecord[] = []\n let current: ExecutionRecord | undefined = execution\n\n while (current) {\n chain.push(current)\n current = current.source.type === \"execution\" ? byId.get(current.source.executionId) : undefined\n }\n return chain\n}\n\n/** Each conversation's cost: its own calls and those of everything below it, each counted once. */\nfunction rollUpCosts(\n byId: ReadonlyMap<string, ExecutionRecord>,\n conversations: ReadonlyMap<string, ConversationAgentRunRecord>,\n withAgent: readonly ExecutionRecord[],\n costs: readonly (AiCostSummary | undefined)[]\n): ReadonlyMap<string, AiCostSummary> {\n const grouped = new Map<string, AiCostSummary[]>()\n\n withAgent.forEach((execution, index) => {\n const cost = costs[index]\n const owner = nearestOwner(\n execution.id,\n (id) => {\n const source = byId.get(id)?.source\n return source?.type === \"execution\" ? source.executionId : undefined\n },\n (id) => conversations.has(id)\n )\n if (!cost || !owner) {\n return\n }\n\n const summaries = grouped.get(owner) ?? []\n summaries.push(cost)\n grouped.set(owner, summaries)\n })\n\n return new Map(\n [...grouped].flatMap(([owner, summaries]) => {\n const total = addCostSummaries(summaries)\n return total ? [[owner, total] as const] : []\n })\n )\n}\n",
|
|
13
|
+
"import { AuthorizationError, assertAuthorized } from \"../authorization\"\nimport { getAuthorizationRef } from \"../execution/authorization\"\nimport type { SixbRuntimeContext } from \"../runtime/types\"\nimport type { ActivityEventInput, ActivitySummary, ActivityUser } from \"../storage/activity/types\"\nimport {\n type ActivityConnectionsPage,\n type ActivityConnectionsQuery,\n readActivityConnections,\n} from \"./connection\"\nimport type {\n ActivityCalendar,\n ActivityCalendarQuery,\n ActivityCaptureOptions,\n ActivityCaptureResult,\n ActivityPageQuery,\n ActivityPeriodQuery,\n ActivityService,\n ActivitySource,\n} from \"./service\"\nimport { type ActivityVisitView, nameSharedVisit, nameSharedVisits } from \"./shares\"\nimport {\n ACTIVITY_TIMELINE_LIMIT,\n type ActivityVisitTimeline,\n composeActivityTimeline,\n} from \"./timeline\"\n\nexport interface ActivityVisitList {\n readonly visits: readonly ActivityVisitView[]\n readonly hasMore: boolean\n}\n\nexport interface ActivityUsersResult {\n /** `displayName` is the account's profile name; no other profile field is read. */\n readonly users: readonly (ActivityUser & { readonly displayName?: string })[]\n readonly hasMore: boolean\n}\n\n/** `sixb.activity`: the app's recorded visits. Every read needs `can.observe(project.activity)`. */\nexport interface ActivityRuntime {\n /** Shared visits name their link's share: see `ActivityVisitView`. */\n list(query: ActivityPageQuery): Promise<ActivityVisitList>\n users(query: ActivityPageQuery): Promise<ActivityUsersResult>\n summarize(query: ActivityPeriodQuery): Promise<ActivitySummary>\n calendar(query: ActivityCalendarQuery): Promise<ActivityCalendar>\n /**\n * The visit's page views and interactions with the actions, workflows and Agent runs its session\n * started, and the connection it came through. Bounded: see `truncated`.\n */\n timeline(visitId: string): Promise<ActivityVisitTimeline | null>\n /** A user's sign-ins, newest first, with the visits each opened. */\n connections(query: ActivityConnectionsQuery): Promise<ActivityConnectionsPage>\n}\n\n/**\n * Recording, for the server's capture route only: it is not on `sixb.activity`, so project code\n * cannot record visits under whatever authority it runs with.\n */\nexport interface ActivityCaptureRuntime {\n /** The settings a browser session reads before it sends anything. */\n captureOptions(): ActivityCaptureOptions\n /** Records a batch for the calling user or shared session. */\n capture(events: readonly ActivityEventInput[]): Promise<ActivityCaptureResult>\n}\n\n// Display names are read one account at a time; a page of users reads a few at once.\nconst PROFILE_READ_CONCURRENCY = 8\n\nexport function createActivityRuntime(\n runtime: SixbRuntimeContext,\n service: ActivityService\n): ActivityRuntime {\n const assertObservable = () => assertAuthorized(runtime, { kind: \"activity.observe\" })\n\n return {\n async list(query) {\n assertObservable()\n const page = await service.list(query)\n return { ...page, visits: await nameSharedVisits(runtime, page.visits) }\n },\n\n async users(query) {\n assertObservable()\n const page = await service.users(query)\n\n // Only accounts in this bounded page are looked up, and only their name is kept.\n const users = await mapInChunks(page.users, PROFILE_READ_CONCURRENCY, async (user) => {\n const profile = await runtime.storage.auth?.users.getById({\n projectId: runtime.projectId,\n id: user.userId,\n })\n return profile?.displayName ? { ...user, displayName: profile.displayName } : user\n })\n\n return { users, hasMore: page.hasMore }\n },\n\n async summarize(query) {\n assertObservable()\n return service.summarize(query)\n },\n\n async calendar(query) {\n assertObservable()\n return service.calendar(query)\n },\n\n async timeline(visitId) {\n assertObservable()\n const page = await service.readWithSession({ id: visitId, limit: ACTIVITY_TIMELINE_LIMIT })\n if (!page) {\n return null\n }\n\n const shared = await nameSharedVisit(runtime, page.visit)\n return composeActivityTimeline(runtime, { ...shared, page }, new Date())\n },\n\n async connections(query) {\n assertObservable()\n return readActivityConnections(runtime, service, query, new Date())\n },\n }\n}\n\nexport function createActivityCaptureRuntime(\n runtime: SixbRuntimeContext,\n service: ActivityService\n): ActivityCaptureRuntime {\n return {\n captureOptions() {\n captureSource(runtime)\n return service.captureOptions\n },\n\n async capture(events) {\n return service.capture(captureSource(runtime), events)\n },\n }\n}\n\nconst activityCaptureKey: unique symbol = Symbol(\"sixb.activityCapture\")\n\ninterface ActivityCaptureOwner {\n readonly [activityCaptureKey]?: ActivityCaptureRuntime\n}\n\nexport function registerActivityCaptureRuntime(\n owner: object,\n capture: ActivityCaptureRuntime\n): void {\n Object.defineProperty(owner, activityCaptureKey, {\n configurable: false,\n enumerable: false,\n value: capture,\n writable: false,\n })\n}\n\n/** The recording side of a bound SDK, such as a request's. */\nexport function getActivityCaptureRuntime(owner: object): ActivityCaptureRuntime {\n const capture = (owner as ActivityCaptureOwner)[activityCaptureKey]\n if (!capture) {\n throw new Error(\"[Sixb] Activity capture is not registered for this execution.\")\n }\n return capture\n}\n\n/**\n * The session the batch came through, from verified authorization only. A browser never names an\n * actor, and an access token or a trusted primitive is not a visit.\n */\nfunction captureSource(runtime: SixbRuntimeContext): ActivitySource {\n const ref = getAuthorizationRef(runtime.runtimeAuthorization)\n\n if (\n ref.type === \"principal\" &&\n ref.principal.type === \"user\" &&\n ref.credential?.type === \"session\"\n ) {\n return {\n actor: { type: \"user\", userId: ref.principal.id },\n sessionId: ref.credential.id,\n }\n }\n\n if (ref.type === \"delegated\") {\n return {\n actor: { type: \"share\", grantId: ref.delegation.grantId },\n sessionId: ref.delegation.sessionId,\n }\n }\n\n throw new AuthorizationError(\n \"activity.capture\",\n \"[Sixb] Activity is recorded only for a signed-in user's session or a shared link's session.\"\n )\n}\n\nasync function mapInChunks<T, R>(\n items: readonly T[],\n size: number,\n map: (item: T) => Promise<R>\n): Promise<R[]> {\n const results: R[] = []\n for (let start = 0; start < items.length; start += size) {\n const chunk = await Promise.all(items.slice(start, start + size).map(map))\n results.push(...chunk)\n }\n return results\n}\n",
|
|
14
|
+
"import { randomUUID } from \"node:crypto\"\nimport { assertModelAccess } from \"../../authorization\"\nimport type { BlobStorage, FileRef } from \"../../blob-storage/types\"\nimport type { ExecutionContext } from \"../../execution\"\nimport type { SixbRuntimeContext } from \"../../runtime/types\"\nimport type { ModelCatalog } from \"../catalog\"\nimport type { ModelCallEndEvent } from \"../events\"\nimport type { AiModelCallRecorder } from \"../execution/model-call-recorder\"\nimport type { ModelExecutionSession } from \"../execution/session\"\nimport { prepareModelInputBytes, prepareModelInputFile, readModelInputFile } from \"../input-file\"\nimport { estimateModelCall, type ModelMoney } from \"../pricing\"\nimport { assertTranscriptionModel } from \"./catalog\"\nimport { TranscriptionModelResponseError } from \"./errors\"\nimport { createSpeak } from \"./speech\"\nimport type {\n AudioData,\n AudioModelsRuntime,\n TranscriptionModel,\n TranscriptionModelResponseMetadata,\n TranscriptionModelResult,\n TranscriptionOutput,\n TranscriptionSegment,\n TranscriptionWord,\n} from \"./types\"\n\n/** What audio calls read of their runtime: who calls, to admit them. */\nexport type AudioRuntimeContext = Pick<\n SixbRuntimeContext,\n \"projectId\" | \"runtimeAuthorization\" | \"authorization\"\n>\n\nexport function createAudioRuntime(\n runtime: AudioRuntimeContext,\n execution: ExecutionContext,\n catalog: ModelCatalog | undefined,\n session: ModelExecutionSession,\n blobs: BlobStorage | undefined\n): AudioModelsRuntime {\n return {\n speak: createSpeak(runtime, execution, catalog, session, blobs),\n async transcribe(input) {\n assertModelAccess(runtime, execution, \"models.audio.transcribe\")\n\n const { mediaType, sizeBytes, read } = prepareAudio(input.audio, blobs)\n\n const signal = session.signal(input.signal)\n signal.throwIfAborted()\n\n const binding = selectModel(catalog, input.model)\n assertTranscriptionModel(binding)\n assertFileSupport(binding, sizeBytes, mediaType)\n\n const accounting = await session.accounting()\n accounting.assertHealthy()\n\n const model = binding.resolve ? await binding.resolve() : binding\n assertTranscriptionModel(model)\n if (model.providerId !== binding.providerId || model.modelId !== binding.modelId) {\n throw new TypeError(\n \"[SixbModels] Resolved transcription model identity does not match the selected model.\"\n )\n }\n assertFileSupport(model, sizeBytes, mediaType)\n\n signal.throwIfAborted()\n const bytes = await read(signal)\n accounting.assertHealthy()\n\n const reservationCost = estimateReservationCost(model, bytes.byteLength, mediaType)\n const callId = `call_${randomUUID()}`\n await accounting.admitCall({\n callId,\n providerId: model.providerId,\n modelId: model.modelId,\n modelKind: \"transcription\",\n inputTokens: { status: \"unavailable\", reason: \"nonTextInput\" },\n outputTokenAllowance: 0,\n reservationCost,\n })\n\n let result: TranscriptionModelResult\n try {\n signal.throwIfAborted()\n result = await model.transcribe({ audio: bytes, mediaType, signal })\n } catch (error) {\n await recordTranscription(\n accounting,\n model,\n callId,\n error instanceof TranscriptionModelResponseError ? error.metadata : {}\n )\n throw error\n }\n\n // A completed, billable reply must survive cancellation and transcript validation failures.\n const event = await recordTranscription(accounting, model, callId, result ?? {})\n signal.throwIfAborted()\n const output = transcriptOutput(result, model)\n\n return { output, usage: event.usage, cost: event.cost, callId }\n },\n }\n}\n\n/**\n * The validated transcript. A word list a caller cannot trust is worse than none: a playhead\n * would seek to a timestamp that is not there. Refuse the reply instead, as for a missing text;\n * billing for it was recorded already.\n */\nfunction transcriptOutput(\n result: TranscriptionModelResult | undefined,\n model: TranscriptionModel\n): TranscriptionOutput {\n const refuse = () =>\n new TranscriptionModelResponseError(\n \"[SixbModels] Invalid transcription response.\",\n model.providerId,\n model.modelId,\n result ?? {}\n )\n\n const output = result?.output\n if (typeof output?.text !== \"string\") throw refuse()\n if (output.language !== undefined && (typeof output.language !== \"string\" || !output.language)) {\n throw refuse()\n }\n\n const segments = transcriptSegments(output.segments)\n if (segments === null) throw refuse()\n const described = {\n text: output.text,\n ...(segments.length ? { segments } : {}),\n ...(output.language ? { language: output.language } : {}),\n }\n\n const words: readonly unknown[] | undefined = output.words\n if (words === undefined) return described\n if (!Array.isArray(words)) throw refuse()\n\n const timed: TranscriptionWord[] = []\n for (const word of words) {\n const entry = word as Partial<TranscriptionWord> | null | undefined\n if (\n typeof entry?.text !== \"string\" ||\n !entry.text ||\n !isMillisecond(entry.startMs) ||\n !isMillisecond(entry.endMs) ||\n entry.endMs < entry.startMs ||\n (entry.speaker !== undefined && (typeof entry.speaker !== \"string\" || !entry.speaker))\n ) {\n throw refuse()\n }\n timed.push({\n text: entry.text,\n startMs: entry.startMs,\n endMs: entry.endMs,\n ...(entry.speaker === undefined ? {} : { speaker: entry.speaker }),\n })\n }\n\n // An empty list says nothing; the absent field is the one way to say \"no words\".\n return timed.length ? { ...described, words: timed } : described\n}\n\n/** The segments as they were timed; null when one cannot be trusted, as a word cannot. */\nfunction transcriptSegments(segments: unknown): TranscriptionSegment[] | null {\n if (segments === undefined) return []\n if (!Array.isArray(segments)) return null\n\n const timed: TranscriptionSegment[] = []\n for (const segment of segments) {\n const entry = segment as Partial<TranscriptionSegment> | null | undefined\n if (\n typeof entry?.text !== \"string\" ||\n !isMillisecond(entry.startMs) ||\n !isMillisecond(entry.endMs) ||\n entry.endMs < entry.startMs ||\n (entry.speaker !== undefined && (typeof entry.speaker !== \"string\" || !entry.speaker))\n ) {\n return null\n }\n timed.push({\n text: entry.text,\n startMs: entry.startMs,\n endMs: entry.endMs,\n ...(entry.speaker === undefined ? {} : { speaker: entry.speaker }),\n })\n }\n return timed\n}\n\nfunction isMillisecond(value: unknown): value is number {\n return typeof value === \"number\" && Number.isSafeInteger(value) && value >= 0\n}\n\ninterface PreparedAudio {\n readonly mediaType: string\n readonly sizeBytes: number\n read(signal: AbortSignal): Promise<Uint8Array>\n}\n\n/** Snapshot the caller's audio before the first await: its bytes, or a stored file's reference. */\nfunction prepareAudio(input: FileRef | AudioData, blobs: BlobStorage | undefined): PreparedAudio {\n if (typeof input === \"object\" && input !== null && \"data\" in input) {\n const { bytes, mediaType } = prepareModelInputBytes(input, \"audio\")\n return { mediaType, sizeBytes: bytes.byteLength, read: async () => bytes }\n }\n\n const { file, mediaType } = prepareModelInputFile(input, \"audio\")\n if (!blobs) {\n throw new Error(\"[SixbModels] Transcribing a stored file requires blob storage.\")\n }\n\n return {\n mediaType,\n sizeBytes: file.sizeBytes,\n read: (signal) => readModelInputFile(blobs, file, signal),\n }\n}\n\nfunction selectModel(\n catalog: ModelCatalog | undefined,\n requested: TranscriptionModel | undefined\n): TranscriptionModel {\n // A model the caller passes runs as given, listed or not; the catalog supplies the default.\n const selected = requested ?? catalog?.audio?.transcription?.default.model\n if (!selected) {\n throw new Error(\n \"[SixbModels] Configure models.audio.transcription in createSixb() or supply a model to transcribe().\"\n )\n }\n\n return selected\n}\n\nfunction assertFileSupport(model: TranscriptionModel, sizeBytes: number, mediaType: string): void {\n if (sizeBytes > model.definition.maxInputBytes) {\n throw new RangeError(\n `[SixbModels] Audio exceeds the model's ${model.definition.maxInputBytes}-byte input limit.`\n )\n }\n if (model.definition.mediaTypes && !model.definition.mediaTypes.includes(mediaType)) {\n throw new TypeError(\n `[SixbModels] Audio media type '${mediaType}' is not supported by the selected model.`\n )\n }\n}\n\nfunction estimateReservationCost(\n model: TranscriptionModel,\n sizeBytes: number,\n mediaType: string\n): ModelMoney | undefined {\n try {\n return model.costEstimator?.estimateReservation?.({ sizeBytes, mediaType })\n } catch {\n // Optional pricing cannot bypass an enforced budget: admission fails closed without it.\n return undefined\n }\n}\n\nasync function recordTranscription(\n accounting: AiModelCallRecorder,\n model: TranscriptionModel,\n callId: string,\n metadata: TranscriptionModelResponseMetadata\n): Promise<ModelCallEndEvent> {\n const usage = metadata.usage ?? {}\n const estimate = estimateModelCall(model, {\n usage,\n route: metadata.route,\n responseModelId: metadata.responseModelId,\n })\n const event: ModelCallEndEvent = {\n callId,\n modelKind: \"transcription\",\n providerId: model.providerId,\n modelId: model.modelId,\n responseId: metadata.providerIds?.responseId ?? callId,\n providerIds: metadata.providerIds,\n responseModelId: metadata.responseModelId,\n usage,\n cost: metadata.reportedCost ? { status: \"reported\", ...metadata.reportedCost } : estimate,\n ...(metadata.reportedCost ? { estimate } : {}),\n route: metadata.route,\n }\n\n await accounting.onModelCallEnd(event)\n return event\n}\n",
|
|
15
|
+
"import { createHash } from \"node:crypto\"\nimport { unaliasMediaType } from \"../blob-storage/media-type\"\nimport type { BlobStorage, FileRef } from \"../blob-storage/types\"\nimport { isFileRef } from \"../blob-storage/validation\"\n\n/** Snapshot caller-owned metadata before model resolution or storage introduces an await. */\nexport function prepareModelInputFile(\n input: FileRef,\n type: \"audio\" | \"image\"\n): { file: FileRef; mediaType: string } {\n if (!isFileRef(input) || !Number.isSafeInteger(input.sizeBytes) || input.sizeBytes <= 0) {\n throw new TypeError(`[SixbModels] ${capitalize(type)} input must be a nonempty FileRef.`)\n }\n\n const file = { ...input }\n const mediaType = modelInputMediaType(file.mediaType, type)\n if (!mediaType) {\n throw new TypeError(\n `[SixbModels] ${capitalize(type)} FileRef must declare an ${type} mediaType.`\n )\n }\n\n return { file, mediaType }\n}\n\n/** Copy caller-owned bytes, so changing the array after the call cannot reach the model. */\nexport function prepareModelInputBytes(\n input: { readonly data: unknown; readonly mediaType: unknown },\n type: \"audio\"\n): { bytes: Uint8Array; mediaType: string } {\n if (!(input.data instanceof Uint8Array) || input.data.byteLength === 0) {\n throw new TypeError(`[SixbModels] ${capitalize(type)} data must be a nonempty Uint8Array.`)\n }\n\n const mediaType = modelInputMediaType(input.mediaType, type)\n if (!mediaType) {\n throw new TypeError(`[SixbModels] ${capitalize(type)} data must declare an ${type} mediaType.`)\n }\n\n return { bytes: input.data.slice(), mediaType }\n}\n\n/**\n * The essence of a media type, such as `audio/webm` for `audio/webm;codecs=opus`, under its\n * registered name (`audio/x-m4a` -> `audio/mp4`, `audio/x-wav` -> `audio/wav`).\n */\nfunction modelInputMediaType(value: unknown, type: \"audio\" | \"image\"): string | undefined {\n if (typeof value !== \"string\") return undefined\n\n const essence = value.split(\";\", 1)[0]?.trim().toLowerCase()\n const mediaType = essence && unaliasMediaType(essence)\n return mediaType && new RegExp(`^${type}/[a-z0-9.+-]+$`).test(mediaType) ? mediaType : undefined\n}\n\nfunction capitalize(type: \"audio\" | \"image\"): string {\n return type === \"audio\" ? \"Audio\" : \"Image\"\n}\n\n/** Read an already validated reference, bounded by its verified size and the model's limit. */\nexport async function readModelInputFile(\n storage: BlobStorage,\n file: FileRef,\n signal: AbortSignal\n): Promise<Uint8Array> {\n const info = await storage.stat(file.blobId)\n signal.throwIfAborted()\n if (\n !info ||\n info.blobId !== file.blobId ||\n info.digest !== file.digest ||\n info.sizeBytes !== file.sizeBytes\n ) {\n throw new Error(\"[SixbModels] File reference does not match the stored file.\")\n }\n\n const stream = await storage.open(file.blobId)\n const reader = stream.getReader()\n const cancel = () => {\n void reader.cancel(signal.reason).catch(() => undefined)\n }\n signal.addEventListener(\"abort\", cancel, { once: true })\n\n let complete = false\n try {\n signal.throwIfAborted()\n\n const bytes = new Uint8Array(file.sizeBytes)\n const hash = createHash(\"sha256\")\n let offset = 0\n\n while (true) {\n const { value, done } = await reader.read()\n signal.throwIfAborted()\n if (done) break\n if (!(value instanceof Uint8Array) || value.byteLength > bytes.byteLength - offset) {\n throw new Error(\"[SixbModels] File stream exceeds its declared size.\")\n }\n\n bytes.set(value, offset)\n hash.update(value)\n offset += value.byteLength\n }\n\n if (offset !== file.sizeBytes || `sha256:${hash.digest(\"hex\")}` !== file.digest) {\n throw new Error(\"[SixbModels] File stream does not match its content-addressed reference.\")\n }\n\n complete = true\n return bytes\n } finally {\n signal.removeEventListener(\"abort\", cancel)\n if (!complete) {\n void reader.cancel().catch(() => undefined)\n }\n reader.releaseLock()\n }\n}\n",
|
|
16
|
+
"import { randomUUID } from \"node:crypto\"\nimport { assertModelAccess } from \"../../authorization\"\nimport type { BlobStorage } from \"../../blob-storage/types\"\nimport type { ExecutionContext } from \"../../execution\"\nimport type { ModelCatalog } from \"../catalog\"\nimport type { ModelCallEndEvent } from \"../events\"\nimport type { AiModelCallRecorder } from \"../execution/model-call-recorder\"\nimport type { ModelExecutionSession } from \"../execution/session\"\nimport { estimateModelCall, type ModelMoney } from \"../pricing\"\nimport { assertSpeechModel } from \"./catalog\"\nimport { SpeechModelResponseError } from \"./errors\"\nimport type { AudioRuntimeContext } from \"./runtime\"\nimport type {\n AudioModelsRuntime,\n AudioSpeakInput,\n SpeechModel,\n SpeechModelRequest,\n SpeechModelResponseMetadata,\n SpeechModelResult,\n SpeechReservationInput,\n} from \"./types\"\n\ntype PreparedRequest = Omit<SpeechModelRequest, \"signal\">\n\nexport function createSpeak(\n runtime: AudioRuntimeContext,\n execution: ExecutionContext,\n catalog: ModelCatalog | undefined,\n session: ModelExecutionSession,\n blobs: BlobStorage | undefined\n): AudioModelsRuntime[\"speak\"] {\n return async (input) => {\n assertModelAccess(runtime, execution, \"models.audio.speak\")\n\n const prepared = prepareRequest(input)\n if (!blobs) {\n throw new Error(\"[SixbModels] Speech generation requires blob storage.\")\n }\n\n const signal = session.signal(input.signal)\n signal.throwIfAborted()\n\n const binding = selectModel(catalog, input.model)\n assertSpeechModel(binding)\n assertRequestSupport(binding, withVoice(binding, prepared))\n\n const accounting = await session.accounting()\n accounting.assertHealthy()\n\n const model = binding.resolve ? await binding.resolve() : binding\n assertSpeechModel(model)\n if (model.providerId !== binding.providerId || model.modelId !== binding.modelId) {\n throw new TypeError(\n \"[SixbModels] Resolved speech model identity does not match the selected model.\"\n )\n }\n const request = withVoice(model, prepared)\n assertRequestSupport(model, request)\n signal.throwIfAborted()\n\n const callId = `call_${randomUUID()}`\n await accounting.admitCall({\n callId,\n providerId: model.providerId,\n modelId: model.modelId,\n modelKind: \"speech\",\n inputTokens: {\n status: \"estimated\",\n tokens: Math.ceil(new TextEncoder().encode(request.text).byteLength / 4),\n method: \"utf8BytesDividedByFour\",\n },\n outputTokenAllowance: 0,\n reservationCost: estimateReservationCost(model, {\n text: request.text,\n ...(request.voice === undefined ? {} : { voice: request.voice }),\n ...(request.instructions === undefined ? {} : { instructions: request.instructions }),\n }),\n })\n\n let result: SpeechModelResult\n try {\n signal.throwIfAborted()\n result = await model.speak({ ...request, signal })\n } catch (error) {\n await recordSpeech(\n accounting,\n model,\n callId,\n error instanceof SpeechModelResponseError ? error.metadata : {}\n )\n throw error\n }\n\n // A completed, billable reply must survive cancellation and audio validation failures.\n const event = await recordSpeech(accounting, model, callId, result ?? {})\n signal.throwIfAborted()\n const audio = result?.output?.audio\n if (\n !(audio?.data instanceof Uint8Array) ||\n audio.data.byteLength === 0 ||\n typeof audio.mediaType !== \"string\" ||\n !/^audio\\/[a-z0-9.+-]+$/.test(audio.mediaType) ||\n (request.mediaType !== undefined && audio.mediaType !== request.mediaType) ||\n !isWarnings(result.warnings)\n ) {\n throw new SpeechModelResponseError(\n \"[SixbModels] Invalid speech response.\",\n model.providerId,\n model.modelId,\n result ?? {}\n )\n }\n\n const file = await blobs.put({\n body: audio.data,\n expectedSizeBytes: audio.data.byteLength,\n mediaType: audio.mediaType,\n signal,\n })\n await accounting.recordFiles(callId, [file])\n return {\n file,\n warnings: [...(result.warnings ?? [])],\n usage: event.usage,\n cost: event.cost,\n callId,\n }\n }\n}\n\n/** Validate and snapshot the caller's request before the first await. */\nfunction prepareRequest(input: AudioSpeakInput): PreparedRequest {\n if (typeof input?.text !== \"string\" || !input.text.trim()) {\n throw new TypeError(\"[SixbModels] Speech generation requires nonblank text.\")\n }\n for (const field of [\"voice\", \"instructions\", \"language\"] as const) {\n const value = input[field]\n if (value !== undefined && (typeof value !== \"string\" || !value.trim())) {\n throw new TypeError(`[SixbModels] Speech ${field} must be a nonblank string.`)\n }\n }\n const mediaType = input.mediaType?.split(\";\", 1)[0]?.trim().toLowerCase()\n if (input.mediaType !== undefined && !/^audio\\/[a-z0-9.+-]+$/.test(mediaType ?? \"\")) {\n throw new TypeError(\"[SixbModels] Speech mediaType must be an audio media type.\")\n }\n if (\n input.speed !== undefined &&\n (typeof input.speed !== \"number\" || !Number.isFinite(input.speed) || input.speed <= 0)\n ) {\n throw new TypeError(\"[SixbModels] Speech speed must be a positive number.\")\n }\n\n return {\n text: input.text,\n ...(input.voice === undefined ? {} : { voice: input.voice }),\n ...(input.instructions === undefined ? {} : { instructions: input.instructions }),\n ...(mediaType === undefined ? {} : { mediaType }),\n ...(input.speed === undefined ? {} : { speed: input.speed }),\n ...(input.language === undefined ? {} : { language: input.language }),\n }\n}\n\nfunction withVoice(model: SpeechModel, request: PreparedRequest): PreparedRequest {\n const voice = request.voice ?? model.defaultVoice\n return voice === undefined ? request : { ...request, voice }\n}\n\nfunction selectModel(\n catalog: ModelCatalog | undefined,\n requested: SpeechModel | undefined\n): SpeechModel {\n // A model the caller passes runs as given, listed or not; the catalog supplies the default.\n const selected = requested ?? catalog?.audio?.speech?.default.model\n if (!selected) {\n throw new Error(\n \"[SixbModels] Configure models.audio.speech in createSixb() or supply a model to speak().\"\n )\n }\n\n return selected\n}\n\nfunction assertRequestSupport(model: SpeechModel, request: PreparedRequest): void {\n const definition = model.definition\n if (\n definition.maxInputCharacters !== undefined &&\n request.text.length > definition.maxInputCharacters\n ) {\n throw new RangeError(\n `[SixbModels] Text exceeds the model's ${definition.maxInputCharacters}-character input limit.`\n )\n }\n if (\n request.voice !== undefined &&\n definition.voices &&\n !definition.voices.includes(request.voice)\n ) {\n throw new TypeError(\n `[SixbModels] Voice '${request.voice}' is not supported by the selected model. Use one of: ${definition.voices.join(\", \")}.`\n )\n }\n if (\n request.mediaType !== undefined &&\n definition.outputMediaTypes &&\n !definition.outputMediaTypes.includes(request.mediaType)\n ) {\n throw new TypeError(\n `[SixbModels] Speech media type '${request.mediaType}' is not supported by the selected model. Use one of: ${definition.outputMediaTypes.join(\", \")}.`\n )\n }\n if (request.instructions !== undefined && definition.instructions === false) {\n throw new TypeError(\"[SixbModels] The selected model does not take speech instructions.\")\n }\n}\n\nfunction estimateReservationCost(\n model: SpeechModel,\n input: SpeechReservationInput\n): ModelMoney | undefined {\n try {\n return model.costEstimator?.estimateReservation?.(input)\n } catch {\n // Optional pricing cannot bypass an enforced budget: admission fails closed without it.\n return undefined\n }\n}\n\nasync function recordSpeech(\n accounting: AiModelCallRecorder,\n model: SpeechModel,\n callId: string,\n metadata: SpeechModelResponseMetadata\n): Promise<ModelCallEndEvent> {\n const usage = metadata.usage ?? {}\n const estimate = estimateModelCall(model, {\n usage,\n route: metadata.route,\n responseModelId: metadata.responseModelId,\n ...(metadata.pricingDimensions === undefined ? {} : { dimensions: metadata.pricingDimensions }),\n })\n const event: ModelCallEndEvent = {\n callId,\n modelKind: \"speech\",\n providerId: model.providerId,\n modelId: model.modelId,\n responseId: metadata.providerIds?.responseId ?? callId,\n providerIds: metadata.providerIds,\n responseModelId: metadata.responseModelId,\n usage,\n cost: metadata.reportedCost ? { status: \"reported\", ...metadata.reportedCost } : estimate,\n ...(metadata.reportedCost ? { estimate } : {}),\n route: metadata.route,\n }\n\n await accounting.onModelCallEnd(event)\n return event\n}\n\nfunction isWarnings(value: unknown): value is readonly string[] | undefined {\n return value === undefined || (Array.isArray(value) && value.every((w) => typeof w === \"string\"))\n}\n"
|
|
17
|
+
],
|
|
18
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAM,6BAA4C,OAAO,8BAA8B;AAMhF,SAAS,gCAA+B,CAC7C,OACA,SACM;AAAA,EACN,MAAM,aAAc,MAAuC;AAAA,EAC3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B;AAAA,IACA,MAAM,SAAS,eAAe,EAAE,QAAQ,eAAe,SAAS,aAAa,IAAI;AAAA,OAC7E,SAAS,eAAe,EAAE,SAAS,IAAI,CAAC;AAAA,IAC5C,OAAO,SAAS;AAAA,EAClB;AAAA,EAEA,MAAM,WAAW,eAAe,KAAK;AAAA,EACrC,OAAO;AAAA;",
|
|
19
|
+
"debugId": "753B3F5C996565E064756E2164756E21",
|
|
20
|
+
"names": []
|
|
21
|
+
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
assertAuthorized2,
|
|
10
10
|
isRuntimeAllowed2,
|
|
11
11
|
assertRuntimeAuthorizationBound2
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-e3b1r4d2.js";
|
|
13
13
|
import {
|
|
14
14
|
isUserRef,
|
|
15
15
|
isUserRefPropertySchema
|
|
@@ -22,21 +22,21 @@ import {
|
|
|
22
22
|
normalizeSchemaValue2,
|
|
23
23
|
uniqueValueKind,
|
|
24
24
|
uniqueValueKey
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-1z8ccj53.js";
|
|
26
26
|
import {
|
|
27
27
|
unreadableError,
|
|
28
28
|
resolvePropertyClearance
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-wsv23wvr.js";
|
|
30
30
|
import {
|
|
31
31
|
composeObjectQueryAdmissions,
|
|
32
32
|
validateObjectQuery2,
|
|
33
33
|
validateObjectQueryWithAdmission,
|
|
34
34
|
viewConditionReadCondition,
|
|
35
35
|
toUserProfile
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-nhgqz3g3.js";
|
|
37
37
|
import {
|
|
38
38
|
snapshotVectorProfiles
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-hpswfrjj.js";
|
|
40
40
|
import {
|
|
41
41
|
userExpansionPlan,
|
|
42
42
|
executeObjectQuery2,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
validateObjectFacetRequests,
|
|
47
47
|
preflightObjectQueryLinks,
|
|
48
48
|
executeObjectQueryLinks2
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-9p7kyeqz.js";
|
|
50
50
|
import {
|
|
51
51
|
ObjectQueryValidationError2,
|
|
52
52
|
normalizeObjectQuery2
|
|
@@ -9,15 +9,15 @@ import {
|
|
|
9
9
|
collectObjectQueryValidationIssues2,
|
|
10
10
|
resolveObjectQueryResultShape2,
|
|
11
11
|
bindCurrentUser
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-nhgqz3g3.js";
|
|
13
13
|
import {
|
|
14
14
|
MAX_OBJECT_READ_FACETS2,
|
|
15
15
|
isAllowed2,
|
|
16
16
|
assertAuthorized2
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-e3b1r4d2.js";
|
|
18
18
|
import {
|
|
19
19
|
validateRerankingResults
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-jbg905hn.js";
|
|
21
21
|
import {
|
|
22
22
|
objectBatchKey2,
|
|
23
23
|
linkBatchKey2,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
compareQueryScalarValues,
|
|
26
26
|
matchesPredicate,
|
|
27
27
|
sortTieDirection2
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-3d9w8t4n.js";
|
|
29
29
|
import {
|
|
30
30
|
ObjectQueryValidationError2,
|
|
31
31
|
ObjectQueryPlanningError2,
|