@sixb/core 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/index.js +53 -50
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run/context.d.ts.map +1 -1
- package/dist/actions/run/execute.d.ts +3 -0
- package/dist/actions/run/execute.d.ts.map +1 -1
- package/dist/actions/run/executor.d.ts +3 -0
- package/dist/actions/run/executor.d.ts.map +1 -1
- package/dist/actions/run/normalize.d.ts.map +1 -1
- package/dist/actions/run/types.d.ts +6 -0
- package/dist/actions/run/types.d.ts.map +1 -1
- package/dist/actions/types/context.d.ts +7 -0
- package/dist/actions/types/context.d.ts.map +1 -1
- package/dist/agents/context/entries.d.ts +17 -0
- package/dist/agents/context/entries.d.ts.map +1 -1
- package/dist/agents/context/index.js +3 -2
- package/dist/agents/context/index.js.map +1 -1
- package/dist/agents/context-model.d.ts.map +1 -1
- package/dist/agents/context-resolution.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +7 -0
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +62 -57
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-call-retry.d.ts +28 -0
- package/dist/agents/model-call-retry.d.ts.map +1 -0
- package/dist/agents/model-loop.d.ts +4 -2
- package/dist/agents/model-loop.d.ts.map +1 -1
- package/dist/agents/model-routing.d.ts +15 -4
- package/dist/agents/model-routing.d.ts.map +1 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/run-artifacts.d.ts +2 -0
- package/dist/agents/run-artifacts.d.ts.map +1 -1
- package/dist/agents/run-plan.d.ts +1 -1
- package/dist/agents/run-plan.d.ts.map +1 -1
- package/dist/agents/run-session-http.d.ts.map +1 -1
- package/dist/agents/run-session-serve.d.ts.map +1 -1
- package/dist/agents/run-session-wire.d.ts +6 -0
- package/dist/agents/run-session-wire.d.ts.map +1 -1
- package/dist/agents/run-token.d.ts +6 -0
- package/dist/agents/run-token.d.ts.map +1 -1
- package/dist/agents/streams/index.js +1 -1
- package/dist/agents/streams/internal.js +2 -2
- package/dist/agents/thread-access.d.ts +13 -0
- package/dist/agents/thread-access.d.ts.map +1 -1
- package/dist/agents/tool-files.d.ts.map +1 -1
- package/dist/artifacts/caller.d.ts +10 -0
- package/dist/artifacts/caller.d.ts.map +1 -0
- package/dist/artifacts/comment-place.d.ts +26 -0
- package/dist/artifacts/comment-place.d.ts.map +1 -0
- package/dist/artifacts/comment-text.d.ts +12 -4
- package/dist/artifacts/comment-text.d.ts.map +1 -1
- package/dist/artifacts/comments.d.ts +8 -2
- package/dist/artifacts/comments.d.ts.map +1 -1
- package/dist/artifacts/errors.d.ts +1 -1
- package/dist/artifacts/errors.d.ts.map +1 -1
- package/dist/artifacts/execution.d.ts +73 -5
- package/dist/artifacts/execution.d.ts.map +1 -1
- package/dist/artifacts/frames/assets.d.ts +27 -7
- package/dist/artifacts/frames/assets.d.ts.map +1 -1
- package/dist/artifacts/frames/entries.d.ts +5 -4
- package/dist/artifacts/frames/entries.d.ts.map +1 -1
- package/dist/artifacts/frames/hyperframes.d.ts +12 -0
- package/dist/artifacts/frames/hyperframes.d.ts.map +1 -0
- package/dist/artifacts/frames/index.d.ts +3 -1
- package/dist/artifacts/frames/index.d.ts.map +1 -1
- package/dist/artifacts/frames/index.js +20 -6
- package/dist/artifacts/frames/index.js.map +3 -3
- package/dist/artifacts/frames/kit.d.ts.map +1 -1
- package/dist/artifacts/frames/protocol.d.ts +33 -0
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/video-runtime.d.ts +21 -0
- package/dist/artifacts/frames/video-runtime.d.ts.map +1 -0
- package/dist/artifacts/html.d.ts +23 -0
- package/dist/artifacts/html.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +5 -3
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +71 -10
- package/dist/artifacts/index.js.map +4 -4
- package/dist/artifacts/kinds.d.ts +1 -1
- package/dist/artifacts/kinds.d.ts.map +1 -1
- package/dist/artifacts/limits.d.ts +37 -0
- package/dist/artifacts/limits.d.ts.map +1 -1
- package/dist/artifacts/live/document.d.ts.map +1 -1
- package/dist/artifacts/live/index.d.ts +6 -2
- package/dist/artifacts/live/index.d.ts.map +1 -1
- package/dist/artifacts/live/index.js +3432 -13
- package/dist/artifacts/live/index.js.map +6 -3
- package/dist/artifacts/live/presence.d.ts +7 -5
- package/dist/artifacts/live/presence.d.ts.map +1 -1
- package/dist/artifacts/live/protocol.d.ts +4 -2
- package/dist/artifacts/live/protocol.d.ts.map +1 -1
- package/dist/artifacts/live/server.d.ts +1 -1
- package/dist/artifacts/live/server.d.ts.map +1 -1
- package/dist/artifacts/live/server.js +36 -31
- package/dist/artifacts/live/server.js.map +1 -1
- package/dist/artifacts/live/state.d.ts +2 -2
- package/dist/artifacts/media/media.d.ts +96 -0
- package/dist/artifacts/media/media.d.ts.map +1 -0
- package/dist/artifacts/media/transcriber.d.ts +29 -0
- package/dist/artifacts/media/transcriber.d.ts.map +1 -0
- package/dist/artifacts/outline.d.ts +26 -1
- package/dist/artifacts/outline.d.ts.map +1 -1
- package/dist/artifacts/publish/files.d.ts +5 -2
- package/dist/artifacts/publish/files.d.ts.map +1 -1
- package/dist/artifacts/publish/index.d.ts +11 -2
- package/dist/artifacts/publish/index.d.ts.map +1 -1
- package/dist/artifacts/publish/index.js +110 -33
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/pdf.d.ts.map +1 -1
- package/dist/artifacts/publish/previews.d.ts +7 -2
- package/dist/artifacts/publish/previews.d.ts.map +1 -1
- package/dist/artifacts/publish/publish.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/html.d.ts +5 -4
- package/dist/artifacts/publish/validate/html.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/video.d.ts +36 -0
- package/dist/artifacts/publish/validate/video.d.ts.map +1 -0
- package/dist/artifacts/publish/video.d.ts +79 -0
- package/dist/artifacts/publish/video.d.ts.map +1 -0
- package/dist/artifacts/resolve.d.ts +9 -0
- package/dist/artifacts/resolve.d.ts.map +1 -1
- package/dist/artifacts/video/composition.d.ts +183 -0
- package/dist/artifacts/video/composition.d.ts.map +1 -0
- package/dist/artifacts/video/edit.d.ts +298 -0
- package/dist/artifacts/video/edit.d.ts.map +1 -0
- package/dist/artifacts/video/export.d.ts +142 -0
- package/dist/artifacts/video/export.d.ts.map +1 -0
- package/dist/artifacts/video/looks.d.ts +133 -0
- package/dist/artifacts/video/looks.d.ts.map +1 -0
- package/dist/artifacts/video/project.d.ts +74 -0
- package/dist/artifacts/video/project.d.ts.map +1 -0
- package/dist/artifacts/video/stills.d.ts +65 -0
- package/dist/artifacts/video/stills.d.ts.map +1 -0
- package/dist/artifacts/video/timeline.d.ts +153 -0
- package/dist/artifacts/video/timeline.d.ts.map +1 -0
- package/dist/auth/index.js +9 -8
- package/dist/auth/index.js.map +1 -1
- package/dist/authorization/index.js +5 -4
- package/dist/authorization/index.js.map +1 -1
- package/dist/blob-storage/browser.d.ts +1 -1
- package/dist/blob-storage/browser.d.ts.map +1 -1
- package/dist/blob-storage/browser.js +8 -4
- package/dist/blob-storage/browser.js.map +1 -1
- package/dist/blob-storage/constants.d.ts +8 -3
- package/dist/blob-storage/constants.d.ts.map +1 -1
- package/dist/blob-storage/download-urls.d.ts +2 -2
- package/dist/blob-storage/download-urls.d.ts.map +1 -1
- package/dist/blob-storage/index.d.ts +1 -1
- package/dist/blob-storage/index.d.ts.map +1 -1
- package/dist/blob-storage/index.js +9 -5
- package/dist/blob-storage/index.js.map +1 -1
- package/dist/blob-storage/internal.d.ts +2 -2
- package/dist/blob-storage/internal.d.ts.map +1 -1
- package/dist/blob-storage/internal.js +10 -4
- package/dist/blob-storage/internal.js.map +1 -1
- package/dist/blob-storage/media-type.d.ts +12 -3
- package/dist/blob-storage/media-type.d.ts.map +1 -1
- package/dist/bootstrap/discovery.d.ts +6 -0
- package/dist/bootstrap/discovery.d.ts.map +1 -1
- package/dist/bootstrap/index.js +63 -60
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/{chunk-az95tsh3.js → chunk-0fjryajn.js} +3 -2
- package/dist/chunk-0fjryajn.js.map +11 -0
- package/dist/{chunk-9tpmfh3n.js → chunk-0mk8qqp9.js} +3 -3
- package/dist/{chunk-9tpmfh3n.js.map → chunk-0mk8qqp9.js.map} +3 -3
- package/dist/{chunk-88xeh6zx.js → chunk-1g4me5f2.js} +182 -7
- package/dist/{chunk-88xeh6zx.js.map → chunk-1g4me5f2.js.map} +3 -3
- package/dist/{chunk-7mhbs9yy.js → chunk-1z8ccj53.js} +1 -1
- package/dist/{chunk-wkv3h3q7.js → chunk-2138b0ng.js} +115 -8
- package/dist/chunk-2138b0ng.js.map +12 -0
- package/dist/chunk-23eaayw4.js +3757 -0
- package/dist/chunk-23eaayw4.js.map +22 -0
- package/dist/{chunk-s8xxef60.js → chunk-2mxq1yd9.js} +48 -41
- package/dist/{chunk-s8xxef60.js.map → chunk-2mxq1yd9.js.map} +6 -6
- package/dist/{chunk-dmnd9ea6.js → chunk-30a0ftnm.js} +2 -2
- package/dist/{chunk-nxysqbt0.js → chunk-389ybvw9.js} +6 -2
- package/dist/chunk-389ybvw9.js.map +10 -0
- package/dist/{chunk-qbd282aa.js → chunk-39q9ybav.js} +2 -2
- package/dist/{chunk-9c9yknwt.js → chunk-3d9w8t4n.js} +111 -23
- package/dist/{chunk-9c9yknwt.js.map → chunk-3d9w8t4n.js.map} +5 -5
- package/dist/chunk-3dvcdn9w.js +8 -0
- package/dist/chunk-3dvcdn9w.js.map +10 -0
- package/dist/{chunk-bcz9dxtf.js → chunk-3x902cja.js} +3 -3
- package/dist/{chunk-c4nrycdy.js → chunk-4q4a5a96.js} +1 -1
- package/dist/{chunk-7r9mqpva.js → chunk-4tdm3fsj.js} +100 -36
- package/dist/{chunk-7r9mqpva.js.map → chunk-4tdm3fsj.js.map} +10 -10
- package/dist/{chunk-ykchk644.js → chunk-4w8qzy9w.js} +6 -6
- package/dist/{chunk-c29729me.js → chunk-4z9xtxke.js} +8 -7
- package/dist/chunk-4z9xtxke.js.map +12 -0
- package/dist/chunk-5278qwax.js +270 -0
- package/dist/chunk-5278qwax.js.map +11 -0
- package/dist/{chunk-kft7mp7z.js → chunk-5xkqasvn.js} +1 -1
- package/dist/{chunk-k1g14kk3.js → chunk-6a4hp405.js} +4 -5
- package/dist/{chunk-k1g14kk3.js.map → chunk-6a4hp405.js.map} +3 -3
- package/dist/{chunk-xavet0qs.js → chunk-6whr25gw.js} +2 -2
- package/dist/{chunk-mbwsgjn7.js → chunk-7zygtcqq.js} +14 -2
- package/dist/chunk-7zygtcqq.js.map +11 -0
- package/dist/chunk-88s9z5pf.js +3 -0
- package/dist/{chunk-de5sfbc3.js.map → chunk-88s9z5pf.js.map} +1 -1
- package/dist/{chunk-ygvay56w.js → chunk-896te58g.js} +2 -2
- package/dist/{chunk-pqj8vff9.js → chunk-8eqqqc1h.js} +3 -3
- package/dist/{chunk-425ydk65.js → chunk-8tefbhdx.js} +14 -14
- package/dist/{chunk-425ydk65.js.map → chunk-8tefbhdx.js.map} +1 -1
- package/dist/{chunk-jka26v8c.js → chunk-8x1bsp68.js} +1 -1
- package/dist/{chunk-wzcjhv54.js → chunk-93e4w7te.js} +113 -1
- package/dist/chunk-93e4w7te.js.map +11 -0
- package/dist/{chunk-ym1bqd98.js → chunk-990a5bkc.js} +424 -76
- package/dist/chunk-990a5bkc.js.map +21 -0
- package/dist/{chunk-fmgf9h5e.js → chunk-9az7kjv4.js} +6 -6
- package/dist/{chunk-eg6xqef7.js → chunk-9e5t53z0.js} +3 -3
- package/dist/{chunk-eg6xqef7.js.map → chunk-9e5t53z0.js.map} +3 -3
- package/dist/{chunk-bs1sd0e0.js → chunk-9p7kyeqz.js} +4 -4
- package/dist/chunk-a68zz4r0.js +537 -0
- package/dist/chunk-a68zz4r0.js.map +11 -0
- package/dist/{chunk-d7vyc7k6.js → chunk-a700gjc8.js} +10 -2
- package/dist/chunk-a700gjc8.js.map +10 -0
- package/dist/{chunk-gfdh9kqa.js → chunk-a9qzjaz2.js} +2 -5
- package/dist/chunk-a9qzjaz2.js.map +10 -0
- package/dist/{chunk-ats8y3d9.js → chunk-as94vcty.js} +688 -504
- package/dist/{chunk-ats8y3d9.js.map → chunk-as94vcty.js.map} +21 -21
- package/dist/{chunk-brybqw5k.js → chunk-bkxm2dzx.js} +1 -1
- package/dist/{chunk-ppxf7gw2.js → chunk-d7t9jnym.js} +3 -3
- package/dist/{chunk-tapdssb5.js → chunk-e3b1r4d2.js} +8 -7
- package/dist/{chunk-tapdssb5.js.map → chunk-e3b1r4d2.js.map} +4 -4
- package/dist/{chunk-cg7cygfj.js → chunk-fdmvaz7x.js} +1 -1
- package/dist/{chunk-191jz8a6.js → chunk-ff0qdk7z.js} +1 -1
- package/dist/{chunk-9vsc919v.js → chunk-fgxvrxx4.js} +22 -2
- package/dist/chunk-fgxvrxx4.js.map +10 -0
- package/dist/{chunk-wx7smkn2.js → chunk-fq8drkp0.js} +1 -1
- package/dist/{chunk-60662fyv.js → chunk-fqms1a8c.js} +132 -4
- package/dist/{chunk-60662fyv.js.map → chunk-fqms1a8c.js.map} +8 -6
- package/dist/{chunk-v8a1qjzp.js → chunk-hpswfrjj.js} +1 -1
- package/dist/{chunk-qttqe1ah.js → chunk-jbg905hn.js} +80 -13
- package/dist/chunk-jbg905hn.js.map +25 -0
- package/dist/{chunk-bz5bnjjt.js → chunk-jjte0h4p.js} +1 -1
- package/dist/{chunk-jt012fxq.js → chunk-jwjwvzj1.js} +797 -51
- package/dist/chunk-jwjwvzj1.js.map +38 -0
- package/dist/{chunk-f05994as.js → chunk-k3vd2vyz.js} +6 -2
- package/dist/chunk-k3vd2vyz.js.map +10 -0
- package/dist/chunk-kcqpk9w1.js.map +2 -2
- package/dist/chunk-mvz89age.js.map +2 -2
- package/dist/{chunk-xrmbhap8.js → chunk-mwg0nwkb.js} +1 -1
- package/dist/{chunk-a3faa34j.js → chunk-nfjt8k8j.js} +1 -1
- package/dist/{chunk-394zjzjs.js → chunk-nhgqz3g3.js} +3 -3
- package/dist/{chunk-bqr703h4.js → chunk-p0c5kkhn.js} +23 -6
- package/dist/{chunk-bqr703h4.js.map → chunk-p0c5kkhn.js.map} +3 -3
- package/dist/{chunk-92wrka15.js → chunk-q150fnj9.js} +1 -1
- package/dist/{chunk-w3t94hm6.js → chunk-qk3zq25v.js} +1 -1
- package/dist/{chunk-6hfbz4d0.js → chunk-r588h4ev.js} +1 -1
- package/dist/chunk-rtkqczbr.js.map +2 -2
- package/dist/{chunk-3qtk0070.js → chunk-ssqbrts1.js} +86 -9
- package/dist/chunk-ssqbrts1.js.map +14 -0
- package/dist/{chunk-5qqmndhm.js → chunk-szzhrn3e.js} +1 -1
- package/dist/{chunk-n1hbwc6y.js → chunk-t6pfch4e.js} +1 -1
- package/dist/{chunk-xtztwpkh.js → chunk-v6h4tc2v.js} +86 -5
- package/dist/chunk-v6h4tc2v.js.map +12 -0
- package/dist/{chunk-brhp9d97.js → chunk-vmqjndb3.js} +2 -2
- package/dist/chunk-vtjzwymr.js.map +2 -2
- package/dist/{chunk-t19wjmnc.js → chunk-wpba6hhd.js} +54 -20
- package/dist/{chunk-t19wjmnc.js.map → chunk-wpba6hhd.js.map} +3 -3
- package/dist/{chunk-htdzx40w.js → chunk-wrb1x1ss.js} +12 -4
- package/dist/{chunk-htdzx40w.js.map → chunk-wrb1x1ss.js.map} +3 -3
- package/dist/{chunk-5sswe5ej.js → chunk-wsv23wvr.js} +2 -2
- package/dist/{chunk-90nqenq8.js → chunk-x0hqc54n.js} +4 -4
- package/dist/{chunk-sgx82nnt.js → chunk-xg31er4p.js} +43 -4
- package/dist/chunk-xg31er4p.js.map +10 -0
- package/dist/{chunk-3neam1y5.js → chunk-y3qb965a.js} +2 -2
- package/dist/{chunk-gaj8djsw.js → chunk-y57eawng.js} +10 -5
- package/dist/{chunk-gaj8djsw.js.map → chunk-y57eawng.js.map} +3 -3
- package/dist/{chunk-8ncg20rd.js → chunk-yah25st6.js} +5 -5
- package/dist/chunk-yah25st6.js.map +10 -0
- package/dist/{chunk-grt2j5vp.js → chunk-ywvxcmqj.js} +106 -13
- package/dist/{chunk-grt2j5vp.js.map → chunk-ywvxcmqj.js.map} +8 -7
- package/dist/{chunk-xf76csps.js → chunk-zmq9xc9s.js} +70 -31
- package/dist/{chunk-xf76csps.js.map → chunk-zmq9xc9s.js.map} +4 -3
- package/dist/datasets/write.js +8 -7
- package/dist/datasets/write.js.map +1 -1
- package/dist/deploy/index.d.ts +1 -1
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/internal.js +2 -2
- package/dist/deploy/internal.js.map +2 -2
- package/dist/deploy/types.d.ts +8 -58
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/env/index.d.ts +10 -3
- package/dist/env/index.d.ts.map +1 -1
- package/dist/env/index.js.map +2 -2
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/execution/agent.js +53 -50
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/kernel-operation.d.ts +1 -0
- package/dist/execution/kernel-operation.d.ts.map +1 -1
- package/dist/execution/primitive.js +53 -50
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.js +54 -51
- package/dist/execution/request.js.map +2 -2
- package/dist/execution/types.d.ts +5 -0
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +73 -67
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/index.js +9 -8
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/maintenance/index.js +9 -8
- package/dist/maintenance/index.js.map +2 -2
- package/dist/materializer/index.js +26 -24
- package/dist/materializer/index.js.map +1 -1
- package/dist/models/audio/runtime.d.ts +3 -1
- package/dist/models/audio/runtime.d.ts.map +1 -1
- package/dist/models/audio/speech.d.ts +2 -2
- package/dist/models/audio/speech.d.ts.map +1 -1
- package/dist/models/audio/types.d.ts +23 -3
- package/dist/models/audio/types.d.ts.map +1 -1
- package/dist/models/calls.d.ts +7 -0
- package/dist/models/calls.d.ts.map +1 -1
- package/dist/models/catalog.d.ts +5 -0
- package/dist/models/catalog.d.ts.map +1 -1
- package/dist/models/definitions.d.ts +3 -2
- package/dist/models/definitions.d.ts.map +1 -1
- package/dist/models/errors.d.ts +5 -3
- package/dist/models/errors.d.ts.map +1 -1
- package/dist/models/events.d.ts +2 -0
- package/dist/models/events.d.ts.map +1 -1
- package/dist/models/execution/index.d.ts +1 -0
- package/dist/models/execution/index.d.ts.map +1 -1
- package/dist/models/execution/index.js +33 -28
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/execution/model-call-limits.d.ts.map +1 -1
- package/dist/models/execution/model-call-recorder.d.ts +8 -0
- package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
- package/dist/models/execution/session.d.ts +12 -0
- package/dist/models/execution/session.d.ts.map +1 -1
- package/dist/models/execution/usage.d.ts.map +1 -1
- package/dist/models/execution.d.ts +1 -1
- package/dist/models/execution.d.ts.map +1 -1
- package/dist/models/generation-types.d.ts +2 -0
- package/dist/models/generation-types.d.ts.map +1 -1
- package/dist/models/index.d.ts +4 -2
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +2 -2
- package/dist/models/input-file.d.ts.map +1 -1
- package/dist/models/pricing.d.ts +2 -1
- package/dist/models/pricing.d.ts.map +1 -1
- package/dist/models/rate-card.d.ts +6 -0
- package/dist/models/rate-card.d.ts.map +1 -1
- package/dist/models/tools.d.ts +5 -0
- package/dist/models/tools.d.ts.map +1 -1
- package/dist/models/video/catalog.d.ts +13 -0
- package/dist/models/video/catalog.d.ts.map +1 -0
- package/dist/models/video/check.d.ts +76 -0
- package/dist/models/video/check.d.ts.map +1 -0
- package/dist/models/video/runtime.d.ts +21 -0
- package/dist/models/video/runtime.d.ts.map +1 -0
- package/dist/models/video/types.d.ts +188 -0
- package/dist/models/video/types.d.ts.map +1 -0
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +53 -50
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/index.js +25 -23
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/sdk/object-set.d.ts.map +1 -1
- package/dist/ontology/index.js +4 -4
- package/dist/ontology/internal.js +4 -4
- package/dist/pipelines/index.js +28 -26
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/internal.js +26 -24
- package/dist/projections/internal.js.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/types.d.ts +103 -6
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/definitions.d.ts +14 -0
- package/dist/runtime/definitions.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +3 -1
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +3 -1
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +49 -43
- package/dist/runtime/internal.js.map +2 -2
- package/dist/runtime/resolve-definitions.d.ts +2 -1
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/sandboxes/errors.d.ts +19 -0
- package/dist/sandboxes/errors.d.ts.map +1 -1
- package/dist/sandboxes/exec.d.ts +2 -0
- package/dist/sandboxes/exec.d.ts.map +1 -1
- package/dist/sandboxes/index.d.ts +1 -1
- package/dist/sandboxes/index.d.ts.map +1 -1
- package/dist/sandboxes/index.js +14 -8
- package/dist/sandboxes/index.js.map +1 -1
- package/dist/sandboxes/sandbox.d.ts +15 -1
- package/dist/sandboxes/sandbox.d.ts.map +1 -1
- package/dist/security/public.d.ts +6 -4
- package/dist/security/public.d.ts.map +1 -1
- package/dist/security/public.js +5 -3
- package/dist/security/public.js.map +1 -1
- package/dist/shares/internal.js +25 -23
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/agents/in-memory.d.ts +2 -1
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +1 -1
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +5 -5
- package/dist/storage/agents/types.d.ts +27 -1
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/analytics.d.ts +1 -0
- package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
- package/dist/storage/ai-cost/groups.d.ts +2 -0
- package/dist/storage/ai-cost/groups.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +5 -5
- package/dist/storage/ai-cost/types.d.ts +2 -1
- package/dist/storage/ai-cost/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/validation.d.ts.map +1 -1
- package/dist/storage/ai-limits/enforcement.js +3 -3
- package/dist/storage/ai-limits/provider.js +2 -2
- package/dist/storage/ai-usage/in-memory.d.ts +8 -1
- package/dist/storage/ai-usage/in-memory.d.ts.map +1 -1
- package/dist/storage/ai-usage/index.d.ts +2 -2
- package/dist/storage/ai-usage/index.d.ts.map +1 -1
- package/dist/storage/ai-usage/record.d.ts +11 -1
- package/dist/storage/ai-usage/record.d.ts.map +1 -1
- package/dist/storage/ai-usage/types.d.ts +80 -1
- package/dist/storage/ai-usage/types.d.ts.map +1 -1
- package/dist/storage/ai-usage/usage.d.ts +1 -1
- package/dist/storage/ai-usage/usage.d.ts.map +1 -1
- package/dist/storage/artifacts/in-memory.d.ts +25 -2
- package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
- package/dist/storage/artifacts/index.d.ts +1 -1
- package/dist/storage/artifacts/index.d.ts.map +1 -1
- package/dist/storage/artifacts/record.d.ts +12 -1
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +198 -6
- package/dist/storage/artifacts/types.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +3 -2
- package/dist/storage/executions/provider.js.map +1 -1
- package/dist/storage/file-upload-sessions/provider.js +10 -9
- package/dist/storage/file-upload-sessions/provider.js.map +1 -1
- package/dist/storage/in-memory/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +25 -23
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +2 -2
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +34 -14
- package/dist/storage/internal.js.map +2 -2
- package/dist/storage/workflow-runs/provider.js +10 -9
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/syncs/index.js +29 -27
- package/dist/syncs/index.js.map +1 -1
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
- package/dist/testing/artifact-storage-contract.d.ts +3 -0
- package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.js +686 -75
- package/dist/testing/index.js.map +10 -10
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/testing/sandboxes-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +26 -24
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workers/index.js +5 -5
- package/dist/workers/index.js.map +1 -1
- package/dist/workflows/index.js +60 -57
- package/dist/workflows/index.js.map +1 -1
- package/package.json +3 -1
- package/src/actions/request.ts +2 -0
- package/src/actions/run/context.ts +1 -0
- package/src/actions/run/execute.ts +5 -1
- package/src/actions/run/executor.ts +4 -0
- package/src/actions/run/normalize.ts +4 -0
- package/src/actions/run/types.ts +6 -0
- package/src/actions/types/context.ts +7 -0
- package/src/agents/README.md +3 -1
- package/src/agents/context/entries.ts +63 -9
- package/src/agents/context-model.ts +9 -0
- package/src/agents/context-resolution.ts +7 -0
- package/src/agents/execution.ts +39 -0
- package/src/agents/index.ts +1 -0
- package/src/agents/model-call-retry.ts +69 -0
- package/src/agents/model-loop.ts +86 -12
- package/src/agents/model-routing.ts +104 -38
- package/src/agents/request.ts +27 -1
- package/src/agents/run-artifacts.ts +10 -5
- package/src/agents/run-plan.ts +2 -1
- package/src/agents/run-session-http.ts +1 -0
- package/src/agents/run-session-serve.ts +23 -2
- package/src/agents/run-session-wire.ts +45 -0
- package/src/agents/run-token.ts +7 -0
- package/src/agents/thread-access.ts +34 -1
- package/src/agents/tool-files.ts +23 -7
- package/src/artifacts/caller.ts +42 -0
- package/src/artifacts/comment-place.ts +51 -0
- package/src/artifacts/comment-text.ts +50 -7
- package/src/artifacts/comments.ts +132 -34
- package/src/artifacts/errors.ts +1 -0
- package/src/artifacts/execution.ts +249 -5
- package/src/artifacts/frames/assets.ts +93 -15
- package/src/artifacts/frames/entries.ts +7 -4
- package/src/artifacts/frames/generated/hyperframes-notices.txt +290 -0
- package/src/artifacts/frames/generated/hyperframes.txt +1145 -0
- package/src/artifacts/frames/generated.d.ts +5 -0
- package/src/artifacts/frames/hyperframes.ts +14 -0
- package/src/artifacts/frames/index.ts +5 -0
- package/src/artifacts/frames/kit.ts +7 -3
- package/src/artifacts/frames/protocol.ts +56 -0
- package/src/artifacts/frames/video-runtime.ts +165 -0
- package/src/artifacts/html.ts +13 -0
- package/src/artifacts/index.ts +7 -0
- package/src/artifacts/kinds.ts +9 -1
- package/src/artifacts/limits.ts +43 -0
- package/src/artifacts/live/document.ts +27 -3
- package/src/artifacts/live/index.ts +58 -2
- package/src/artifacts/live/presence.ts +17 -5
- package/src/artifacts/live/protocol.ts +4 -2
- package/src/artifacts/live/server.ts +1 -1
- package/src/artifacts/live/state.ts +3 -3
- package/src/artifacts/media/README.md +75 -0
- package/src/artifacts/media/media.ts +316 -0
- package/src/artifacts/media/transcriber.ts +84 -0
- package/src/artifacts/outline.ts +28 -0
- package/src/artifacts/publish/files.ts +19 -6
- package/src/artifacts/publish/index.ts +49 -2
- package/src/artifacts/publish/pdf.ts +3 -1
- package/src/artifacts/publish/previews.ts +22 -8
- package/src/artifacts/publish/publish.ts +4 -1
- package/src/artifacts/publish/validate/html.ts +23 -18
- package/src/artifacts/publish/validate/video.ts +309 -0
- package/src/artifacts/publish/video.ts +235 -0
- package/src/artifacts/resolve.ts +45 -0
- package/src/artifacts/video/README.md +402 -0
- package/src/artifacts/video/composition.ts +898 -0
- package/src/artifacts/video/edit.ts +3967 -0
- package/src/artifacts/video/export.ts +352 -0
- package/src/artifacts/video/looks.ts +694 -0
- package/src/artifacts/video/project.ts +198 -0
- package/src/artifacts/video/stills.ts +168 -0
- package/src/artifacts/video/timeline.ts +658 -0
- package/src/blob-storage/browser.ts +1 -1
- package/src/blob-storage/constants.ts +9 -3
- package/src/blob-storage/download-urls.ts +5 -3
- package/src/blob-storage/index.ts +1 -0
- package/src/blob-storage/internal.ts +13 -2
- package/src/blob-storage/media-type.ts +149 -8
- package/src/bootstrap/discovery.ts +61 -11
- package/src/deploy/index.ts +0 -5
- package/src/deploy/types.ts +8 -63
- package/src/deploy/validation.ts +1 -1
- package/src/env/index.ts +10 -4
- package/src/errors/catalog.ts +2 -1
- package/src/execution/authorization.ts +2 -2
- package/src/execution/kernel-operation.ts +14 -0
- package/src/execution/types.ts +2 -0
- package/src/http/api-routes.ts +117 -0
- package/src/index.ts +21 -1
- package/src/lake-storage/definition-updates.ts +3 -9
- package/src/models/audio/runtime.ts +48 -3
- package/src/models/audio/speech.ts +2 -2
- package/src/models/audio/types.ts +24 -3
- package/src/models/calls.ts +35 -18
- package/src/models/catalog.ts +9 -2
- package/src/models/definitions.ts +4 -2
- package/src/models/errors.ts +5 -3
- package/src/models/events.ts +2 -0
- package/src/models/execution/README.md +68 -2
- package/src/models/execution/index.ts +1 -0
- package/src/models/execution/model-call-limits.ts +11 -5
- package/src/models/execution/model-call-recorder.ts +14 -0
- package/src/models/execution/session.ts +52 -23
- package/src/models/execution/usage.ts +1 -0
- package/src/models/execution.ts +13 -2
- package/src/models/generation-types.ts +2 -0
- package/src/models/index.ts +20 -1
- package/src/models/input-file.ts +7 -2
- package/src/models/pricing.ts +19 -1
- package/src/models/rate-card.ts +15 -3
- package/src/models/tools.ts +5 -0
- package/src/models/video/catalog.ts +101 -0
- package/src/models/video/check.ts +441 -0
- package/src/models/video/runtime.ts +550 -0
- package/src/models/video/types.ts +194 -0
- package/src/objects/execution.ts +2 -0
- package/src/objects/sdk/object-set.ts +2 -0
- package/src/queues/index.ts +5 -0
- package/src/queues/types.ts +126 -5
- package/src/runtime/create.ts +1 -0
- package/src/runtime/definitions.ts +25 -0
- package/src/runtime/host.ts +6 -1
- package/src/runtime/index.ts +6 -1
- package/src/runtime/internal.ts +3 -1
- package/src/runtime/resolve-definitions.ts +7 -1
- package/src/runtime/sixb.ts +12 -4
- package/src/sandboxes/README.md +12 -2
- package/src/sandboxes/errors.ts +27 -0
- package/src/sandboxes/exec.ts +3 -1
- package/src/sandboxes/index.ts +3 -0
- package/src/sandboxes/sandbox.ts +15 -1
- package/src/security/public.ts +6 -4
- package/src/storage/agents/in-memory.ts +39 -0
- package/src/storage/agents/index.ts +1 -0
- package/src/storage/agents/provider.ts +8 -0
- package/src/storage/agents/types.ts +32 -1
- package/src/storage/ai-cost/analytics.ts +2 -0
- package/src/storage/ai-cost/codec.ts +1 -0
- package/src/storage/ai-cost/groups.ts +7 -0
- package/src/storage/ai-cost/types.ts +2 -0
- package/src/storage/ai-cost/validation.ts +2 -0
- package/src/storage/ai-usage/in-memory.ts +93 -0
- package/src/storage/ai-usage/index.ts +10 -0
- package/src/storage/ai-usage/record.ts +106 -0
- package/src/storage/ai-usage/types.ts +102 -1
- package/src/storage/ai-usage/usage.ts +2 -0
- package/src/storage/artifacts/in-memory.ts +108 -11
- package/src/storage/artifacts/index.ts +14 -0
- package/src/storage/artifacts/record.ts +203 -1
- package/src/storage/artifacts/types.ts +199 -6
- package/src/storage/executions/validation.ts +2 -2
- package/src/storage/in-memory/index.ts +1 -1
- package/src/storage/index.ts +22 -1
- package/src/storage/internal.ts +9 -0
- package/src/testing/agent-storage-contract.ts +135 -0
- package/src/testing/ai-cost-storage-contract.ts +1 -0
- package/src/testing/ai-usage-storage-contract.ts +145 -1
- package/src/testing/artifact-storage-contract.ts +330 -0
- package/src/testing/execution-storage-contract.ts +10 -2
- package/src/testing/lake-storage-contract.ts +27 -0
- package/src/testing/queues-contract.ts +71 -0
- package/src/testing/sandboxes-contract.ts +50 -0
- package/dist/chunk-3723kgba.js +0 -29
- package/dist/chunk-3723kgba.js.map +0 -10
- package/dist/chunk-3qtk0070.js.map +0 -14
- package/dist/chunk-8ncg20rd.js.map +0 -10
- package/dist/chunk-9vsc919v.js.map +0 -10
- package/dist/chunk-az95tsh3.js.map +0 -11
- package/dist/chunk-c29729me.js.map +0 -12
- package/dist/chunk-d7vyc7k6.js.map +0 -10
- package/dist/chunk-de5sfbc3.js +0 -3
- package/dist/chunk-f05994as.js.map +0 -10
- package/dist/chunk-gfdh9kqa.js.map +0 -11
- package/dist/chunk-jt012fxq.js.map +0 -34
- package/dist/chunk-mbwsgjn7.js.map +0 -11
- package/dist/chunk-nxysqbt0.js.map +0 -10
- package/dist/chunk-qttqe1ah.js.map +0 -24
- package/dist/chunk-sgx82nnt.js.map +0 -10
- package/dist/chunk-vs2s3p8n.js +0 -2274
- package/dist/chunk-vs2s3p8n.js.map +0 -20
- package/dist/chunk-wkv3h3q7.js.map +0 -12
- package/dist/chunk-wzcjhv54.js.map +0 -11
- package/dist/chunk-xtztwpkh.js.map +0 -12
- package/dist/chunk-ym1bqd98.js.map +0 -19
- /package/dist/{chunk-7mhbs9yy.js.map → chunk-1z8ccj53.js.map} +0 -0
- /package/dist/{chunk-dmnd9ea6.js.map → chunk-30a0ftnm.js.map} +0 -0
- /package/dist/{chunk-qbd282aa.js.map → chunk-39q9ybav.js.map} +0 -0
- /package/dist/{chunk-bcz9dxtf.js.map → chunk-3x902cja.js.map} +0 -0
- /package/dist/{chunk-c4nrycdy.js.map → chunk-4q4a5a96.js.map} +0 -0
- /package/dist/{chunk-ykchk644.js.map → chunk-4w8qzy9w.js.map} +0 -0
- /package/dist/{chunk-kft7mp7z.js.map → chunk-5xkqasvn.js.map} +0 -0
- /package/dist/{chunk-xavet0qs.js.map → chunk-6whr25gw.js.map} +0 -0
- /package/dist/{chunk-ygvay56w.js.map → chunk-896te58g.js.map} +0 -0
- /package/dist/{chunk-pqj8vff9.js.map → chunk-8eqqqc1h.js.map} +0 -0
- /package/dist/{chunk-jka26v8c.js.map → chunk-8x1bsp68.js.map} +0 -0
- /package/dist/{chunk-fmgf9h5e.js.map → chunk-9az7kjv4.js.map} +0 -0
- /package/dist/{chunk-bs1sd0e0.js.map → chunk-9p7kyeqz.js.map} +0 -0
- /package/dist/{chunk-brybqw5k.js.map → chunk-bkxm2dzx.js.map} +0 -0
- /package/dist/{chunk-ppxf7gw2.js.map → chunk-d7t9jnym.js.map} +0 -0
- /package/dist/{chunk-cg7cygfj.js.map → chunk-fdmvaz7x.js.map} +0 -0
- /package/dist/{chunk-191jz8a6.js.map → chunk-ff0qdk7z.js.map} +0 -0
- /package/dist/{chunk-wx7smkn2.js.map → chunk-fq8drkp0.js.map} +0 -0
- /package/dist/{chunk-v8a1qjzp.js.map → chunk-hpswfrjj.js.map} +0 -0
- /package/dist/{chunk-bz5bnjjt.js.map → chunk-jjte0h4p.js.map} +0 -0
- /package/dist/{chunk-xrmbhap8.js.map → chunk-mwg0nwkb.js.map} +0 -0
- /package/dist/{chunk-a3faa34j.js.map → chunk-nfjt8k8j.js.map} +0 -0
- /package/dist/{chunk-394zjzjs.js.map → chunk-nhgqz3g3.js.map} +0 -0
- /package/dist/{chunk-92wrka15.js.map → chunk-q150fnj9.js.map} +0 -0
- /package/dist/{chunk-w3t94hm6.js.map → chunk-qk3zq25v.js.map} +0 -0
- /package/dist/{chunk-6hfbz4d0.js.map → chunk-r588h4ev.js.map} +0 -0
- /package/dist/{chunk-5qqmndhm.js.map → chunk-szzhrn3e.js.map} +0 -0
- /package/dist/{chunk-n1hbwc6y.js.map → chunk-t6pfch4e.js.map} +0 -0
- /package/dist/{chunk-brhp9d97.js.map → chunk-vmqjndb3.js.map} +0 -0
- /package/dist/{chunk-5sswe5ej.js.map → chunk-wsv23wvr.js.map} +0 -0
- /package/dist/{chunk-90nqenq8.js.map → chunk-x0hqc54n.js.map} +0 -0
- /package/dist/{chunk-3neam1y5.js.map → chunk-y3qb965a.js.map} +0 -0
|
@@ -28,25 +28,53 @@ const DECISION_TIMEOUT_MS = 2_000
|
|
|
28
28
|
/** How long a provider keeps a thread's prompt cache after the last call that read it. */
|
|
29
29
|
const PROMPT_CACHE_TTL_MS = 5 * 60_000
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
31
|
+
/** How much of the previous message the decision model reads: enough to tell what work it set. */
|
|
32
|
+
const PREVIOUS_MESSAGE_CHARS = 2_000
|
|
33
|
+
|
|
34
|
+
/** What each tier is for, whatever the project: its models' descriptions say how it uses them. */
|
|
35
|
+
const TIER_WORK: Readonly<Record<LanguageModelTier, string>> = {
|
|
36
|
+
light:
|
|
37
|
+
"A lookup, a count, a filter or a list with an obvious answer. Greetings, thanks, and short " +
|
|
38
|
+
"questions that start no new work.",
|
|
39
|
+
standard:
|
|
40
|
+
"Usual work with a clear path: several queries or reads, a comparison, a short summary, a " +
|
|
41
|
+
"simple action, or a small change to a few files.",
|
|
42
|
+
heavy:
|
|
43
|
+
"Open-ended or long work: a multi-step investigation, explaining why something happened, " +
|
|
44
|
+
"weighing trade-offs, building a plan, writing a long report, or changes across many files " +
|
|
45
|
+
"that must be checked.",
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The tier question for a project: the work each tier is for, and the description of the model a
|
|
50
|
+
* routed turn runs on in that tier, which the project can write to steer the choice.
|
|
51
|
+
*/
|
|
52
|
+
function tierQuestions(language: LanguageModelCatalog) {
|
|
53
|
+
return {
|
|
54
|
+
tier: question.choice({
|
|
55
|
+
instructions:
|
|
56
|
+
"A user sent this message to an agent that works in a project with tools: it reads and " +
|
|
57
|
+
"changes the project's data, runs actions, writes documents, and in a workspace runs " +
|
|
58
|
+
"commands and edits files. Pick the model tier the answer needs. Judge the work the " +
|
|
59
|
+
"answer takes, not the length or tone of the message. When the input holds the " +
|
|
60
|
+
"previous message, with the tier it ran on, judge the <message> in its light: a short " +
|
|
61
|
+
"message that carries on that work, such as approving a plan or asking for the next " +
|
|
62
|
+
"step, takes the tier the work needs.",
|
|
63
|
+
options: {
|
|
64
|
+
light: tierOption(language, "light"),
|
|
65
|
+
standard: tierOption(language, "standard"),
|
|
66
|
+
heavy: tierOption(language, "heavy"),
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function tierOption(language: LanguageModelCatalog, tier: LanguageModelTier): string {
|
|
73
|
+
const description = language.tiers.includes(tier)
|
|
74
|
+
? language.getByTier(tier).model.definition.description?.trim()
|
|
75
|
+
: undefined
|
|
76
|
+
|
|
77
|
+
return description ? `${TIER_WORK[tier]} This tier's model: ${description}` : TIER_WORK[tier]
|
|
50
78
|
}
|
|
51
79
|
|
|
52
80
|
export interface TurnModelChoice {
|
|
@@ -58,15 +86,23 @@ export interface TurnModelChoice {
|
|
|
58
86
|
readonly tierProbabilities?: LanguageModelTierProbabilities
|
|
59
87
|
}
|
|
60
88
|
|
|
89
|
+
/** A turn whose model Sixb picks. */
|
|
90
|
+
export interface TurnToRoute {
|
|
91
|
+
/** The words of its message. */
|
|
92
|
+
readonly text: string
|
|
93
|
+
/** The thread's previous turn, absent for its first. */
|
|
94
|
+
readonly previous?: {
|
|
95
|
+
readonly run: ConversationAgentRunRecord
|
|
96
|
+
/** The words of the message that started it, which a short follow-up carries on. */
|
|
97
|
+
readonly text?: string
|
|
98
|
+
}
|
|
99
|
+
/** Where the turn runs: the previous turn's cache holds its prompt only if it ran there. */
|
|
100
|
+
readonly place: AgentTurnPlace
|
|
101
|
+
}
|
|
102
|
+
|
|
61
103
|
export interface TurnModelRouter {
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
*/
|
|
65
|
-
choose(
|
|
66
|
-
text: string,
|
|
67
|
-
previous: ConversationAgentRunRecord | undefined,
|
|
68
|
-
place: AgentTurnPlace
|
|
69
|
-
): Promise<TurnModelChoice>
|
|
104
|
+
/** The model of a turn that names none. */
|
|
105
|
+
choose(turn: TurnToRoute): Promise<TurnModelChoice>
|
|
70
106
|
}
|
|
71
107
|
|
|
72
108
|
/**
|
|
@@ -74,10 +110,12 @@ export interface TurnModelRouter {
|
|
|
74
110
|
* Checked at startup: a model that cannot would leave every turn on `standard`, warning each time.
|
|
75
111
|
*/
|
|
76
112
|
export function assertTurnModelRouting(models: ModelCatalog | undefined): void {
|
|
77
|
-
const
|
|
113
|
+
const language = models?.language
|
|
78
114
|
const decision = models?.decision?.default
|
|
79
|
-
if (tiers.length === 0 || !decision) return
|
|
80
|
-
|
|
115
|
+
if (!language || language.tiers.length === 0 || !decision) return
|
|
116
|
+
|
|
117
|
+
const { tier } = tierQuestions(language)
|
|
118
|
+
if (supportsQuestion(decision.model.definition.capabilities, tier)) return
|
|
81
119
|
|
|
82
120
|
throw new RuntimeError(
|
|
83
121
|
`[Sixb] The default decision model '${decision.provider}/${decision.modelId}' cannot pick the tier of an Agent turn: it needs 'choice' questions with ${LANGUAGE_MODEL_TIERS.length} options. Put a decision model that supports them first in 'models.decision', or configure 'models.language' as a list.`
|
|
@@ -92,25 +130,55 @@ export function createTurnModelRouter(
|
|
|
92
130
|
const language = models?.language
|
|
93
131
|
if (!language || language.tiers.length === 0 || !models?.decision) return undefined
|
|
94
132
|
|
|
133
|
+
const questions = tierQuestions(language)
|
|
134
|
+
|
|
95
135
|
return {
|
|
96
|
-
async choose(
|
|
136
|
+
async choose(turn) {
|
|
137
|
+
const last = turn.previous && previousTurn(language, turn.previous.run, turn.place)
|
|
138
|
+
|
|
97
139
|
// Files sent alone leave nothing to judge: the turn aims for standard, and the cache rule
|
|
98
140
|
// keeps a warm thread on its model.
|
|
99
|
-
const tierProbabilities = text.trim()
|
|
141
|
+
const tierProbabilities = turn.text.trim()
|
|
142
|
+
? await askTier(decision, questions, decisionInput(turn, last))
|
|
143
|
+
: undefined
|
|
100
144
|
const tier = tierProbabilities ? tierFor(tierProbabilities) : "standard"
|
|
101
145
|
|
|
102
146
|
return {
|
|
103
|
-
model: turnModel(language, tier,
|
|
147
|
+
model: turnModel(language, tier, last),
|
|
104
148
|
...(tierProbabilities ? { tierProbabilities } : {}),
|
|
105
149
|
}
|
|
106
150
|
},
|
|
107
151
|
}
|
|
108
152
|
}
|
|
109
153
|
|
|
154
|
+
/**
|
|
155
|
+
* The message, after the one before it and the tier that one ran on: "Go ahead" after a plan for
|
|
156
|
+
* a large change asks for that change, and judged alone it reads like thanks.
|
|
157
|
+
*/
|
|
158
|
+
function decisionInput(turn: TurnToRoute, last: PreviousTurn | undefined): string {
|
|
159
|
+
const before = turn.previous?.text?.trim()
|
|
160
|
+
if (!before) return turn.text
|
|
161
|
+
|
|
162
|
+
const clipped =
|
|
163
|
+
before.length > PREVIOUS_MESSAGE_CHARS ? `${before.slice(0, PREVIOUS_MESSAGE_CHARS)}…` : before
|
|
164
|
+
const tier = last ? ` tier="${last.tier}"` : ""
|
|
165
|
+
|
|
166
|
+
return [
|
|
167
|
+
`<previous_message${tier}>`,
|
|
168
|
+
clipped,
|
|
169
|
+
"</previous_message>",
|
|
170
|
+
"",
|
|
171
|
+
"<message>",
|
|
172
|
+
turn.text,
|
|
173
|
+
"</message>",
|
|
174
|
+
].join("\n")
|
|
175
|
+
}
|
|
176
|
+
|
|
110
177
|
/** The decision model's answer, or nothing when it fails or is too slow. */
|
|
111
178
|
async function askTier(
|
|
112
179
|
decision: DecisionModelsRuntime,
|
|
113
|
-
|
|
180
|
+
questions: ReturnType<typeof tierQuestions>,
|
|
181
|
+
input: string
|
|
114
182
|
): Promise<LanguageModelTierProbabilities | undefined> {
|
|
115
183
|
const timeout = new AbortController()
|
|
116
184
|
const timer = setTimeout(() => {
|
|
@@ -122,7 +190,7 @@ async function askTier(
|
|
|
122
190
|
try {
|
|
123
191
|
// The race holds the turn to its timeout even when a provider ignores the signal.
|
|
124
192
|
const { output } = await Promise.race([
|
|
125
|
-
decision.evaluate({ input
|
|
193
|
+
decision.evaluate({ input, questions, signal: timeout.signal }),
|
|
126
194
|
rejectOnAbort(timeout.signal),
|
|
127
195
|
])
|
|
128
196
|
const { light, standard, heavy } = output.tier.probabilities
|
|
@@ -155,11 +223,9 @@ function tierFor(probabilities: LanguageModelTierProbabilities): LanguageModelTi
|
|
|
155
223
|
function turnModel(
|
|
156
224
|
language: LanguageModelCatalog,
|
|
157
225
|
tier: LanguageModelTier,
|
|
158
|
-
|
|
159
|
-
place: AgentTurnPlace
|
|
226
|
+
last: PreviousTurn | undefined
|
|
160
227
|
): LanguageModelEntry {
|
|
161
228
|
const target = language.getByTier(tier)
|
|
162
|
-
const last = previous && previousTurn(language, previous, place)
|
|
163
229
|
if (!last) return target
|
|
164
230
|
|
|
165
231
|
const change = tierRank(target.tier ?? tier) - tierRank(last.tier)
|
package/src/agents/request.ts
CHANGED
|
@@ -245,6 +245,8 @@ export async function requestAgentRun(
|
|
|
245
245
|
"router" in requested
|
|
246
246
|
? await routedConversationRunSpec({
|
|
247
247
|
...requested,
|
|
248
|
+
agents,
|
|
249
|
+
projectId,
|
|
248
250
|
previous: existingThread
|
|
249
251
|
? await latestConversationRun(agents, projectId, existingThread.id)
|
|
250
252
|
: undefined,
|
|
@@ -419,6 +421,8 @@ export async function editAgentMessage(
|
|
|
419
421
|
"router" in requested
|
|
420
422
|
? await routedConversationRunSpec({
|
|
421
423
|
...requested,
|
|
424
|
+
agents,
|
|
425
|
+
projectId,
|
|
422
426
|
previous: await latestRetainedConversationRun(agents, projectId, thread.id, tail),
|
|
423
427
|
place,
|
|
424
428
|
settings,
|
|
@@ -1866,6 +1870,8 @@ function routedTurn(
|
|
|
1866
1870
|
/** The spec of a turn Sixb picks the model for, compared to the thread's previous turn. */
|
|
1867
1871
|
async function routedConversationRunSpec(
|
|
1868
1872
|
input: RoutedTurn & {
|
|
1873
|
+
readonly agents: AgentStorage
|
|
1874
|
+
readonly projectId: string
|
|
1869
1875
|
/** The turn this one continues, absent for a thread's first. */
|
|
1870
1876
|
readonly previous: ConversationAgentRunRecord | undefined
|
|
1871
1877
|
/** Where the turn runs: the previous turn's cache holds its prompt only if it ran there. */
|
|
@@ -1874,7 +1880,11 @@ async function routedConversationRunSpec(
|
|
|
1874
1880
|
readonly language: LanguageModelCatalog | undefined
|
|
1875
1881
|
}
|
|
1876
1882
|
): Promise<ConversationAgentRunSpec> {
|
|
1877
|
-
const
|
|
1883
|
+
const previous = input.previous && {
|
|
1884
|
+
run: input.previous,
|
|
1885
|
+
text: await messageWords(input.agents, input.projectId, input.previous.triggerMessageId),
|
|
1886
|
+
}
|
|
1887
|
+
const choice = await input.router.choose({ text: input.text, previous, place: input.place })
|
|
1878
1888
|
|
|
1879
1889
|
return resolveConversationRunSpec({
|
|
1880
1890
|
models: input.language,
|
|
@@ -1884,6 +1894,22 @@ async function routedConversationRunSpec(
|
|
|
1884
1894
|
})
|
|
1885
1895
|
}
|
|
1886
1896
|
|
|
1897
|
+
/** What a person wrote in a message, without the context or files sent with it. */
|
|
1898
|
+
async function messageWords(
|
|
1899
|
+
agents: AgentStorage,
|
|
1900
|
+
projectId: string,
|
|
1901
|
+
messageId: string
|
|
1902
|
+
): Promise<string | undefined> {
|
|
1903
|
+
const message = await agents.messages.getById({ projectId, id: messageId })
|
|
1904
|
+
if (!message) return undefined
|
|
1905
|
+
|
|
1906
|
+
const words = message.parts
|
|
1907
|
+
.flatMap((part) => (part.type === "text" ? [part.text] : []))
|
|
1908
|
+
.join("\n")
|
|
1909
|
+
.trim()
|
|
1910
|
+
return words || undefined
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1887
1913
|
async function latestConversationRun(
|
|
1888
1914
|
agents: AgentStorage,
|
|
1889
1915
|
projectId: string,
|
|
@@ -50,6 +50,8 @@ export interface AgentRunArtifacts {
|
|
|
50
50
|
getVersion: ArtifactsRuntime["getVersion"]
|
|
51
51
|
listVersions: ArtifactsRuntime["listVersions"]
|
|
52
52
|
query: ArtifactsRuntime["query"]
|
|
53
|
+
/** What is derived of a video or a sound a version holds, which a video's copy lists. */
|
|
54
|
+
media: ArtifactsRuntime["media"]
|
|
53
55
|
/**
|
|
54
56
|
* The artifact, when the run may write it: its requester owns it, or the conversation shares it
|
|
55
57
|
* and they take part. Another is `null`, even one they could update from another conversation:
|
|
@@ -145,6 +147,7 @@ export function agentRunArtifacts(
|
|
|
145
147
|
getVersion: async (...args) => (await sdk()).artifacts.getVersion(...args),
|
|
146
148
|
listVersions: async (...args) => (await sdk()).artifacts.listVersions(...args),
|
|
147
149
|
query: async (...args) => (await sdk()).artifacts.query(...args),
|
|
150
|
+
media: async (...args) => (await sdk()).artifacts.media(...args),
|
|
148
151
|
updatable,
|
|
149
152
|
|
|
150
153
|
async publish(input) {
|
|
@@ -218,9 +221,11 @@ export function agentRunArtifacts(
|
|
|
218
221
|
return { prepared, stored }
|
|
219
222
|
}
|
|
220
223
|
|
|
221
|
-
// What
|
|
224
|
+
// What a canvas or a video showed before, so that its viewers learn which boards or scenes
|
|
225
|
+
// the turn changes.
|
|
226
|
+
const announces = kind === "canvas" || kind === "video"
|
|
222
227
|
const before =
|
|
223
|
-
|
|
228
|
+
announces && "artifactId" in input
|
|
224
229
|
? await latestVersionOf(requireArtifacts(storage), projectId, input.artifactId)
|
|
225
230
|
: null
|
|
226
231
|
|
|
@@ -250,10 +255,10 @@ export function agentRunArtifacts(
|
|
|
250
255
|
merged: false,
|
|
251
256
|
}
|
|
252
257
|
if ("artifactId" in input) await announceArtifactUpdates(host.domainEvents, [stored.version])
|
|
253
|
-
if (
|
|
258
|
+
if (announces) await announceAgentBoards(host, turnRunId, before, stored.version)
|
|
254
259
|
|
|
255
260
|
// The render worker pictures what the boards miss, with their queries answered now, as the
|
|
256
|
-
// requester.
|
|
261
|
+
// requester, and derives what its media need.
|
|
257
262
|
await artifactPreviewRequester(reader)(stored.version)
|
|
258
263
|
|
|
259
264
|
return {
|
|
@@ -281,7 +286,7 @@ async function latestVersionOf(
|
|
|
281
286
|
}
|
|
282
287
|
|
|
283
288
|
/**
|
|
284
|
-
* Tells whoever has the canvas open which boards the turn is changing. The write is stored by
|
|
289
|
+
* Tells whoever has the canvas or the video open which boards or scenes the turn is changing. The write is stored by
|
|
285
290
|
* now: a broker that refuses only leaves its viewers without the notice.
|
|
286
291
|
*/
|
|
287
292
|
async function announceAgentBoards(
|
package/src/agents/run-plan.ts
CHANGED
|
@@ -85,7 +85,7 @@ export interface AgentRunDelegationModel extends LanguageModelRef {
|
|
|
85
85
|
readonly defaultReasoning?: AgentReasoning
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
export type SandboxModelKind = "language" | "image" | "speech" | "transcription"
|
|
88
|
+
export type SandboxModelKind = "language" | "image" | "video" | "speech" | "transcription"
|
|
89
89
|
|
|
90
90
|
/** One model the agent reaches through `sixb models`, as its prompt describes it. */
|
|
91
91
|
export interface SandboxModel {
|
|
@@ -220,6 +220,7 @@ export function listSandboxModels(models: ModelCatalog | undefined): readonly Sa
|
|
|
220
220
|
const media = (
|
|
221
221
|
[
|
|
222
222
|
["image", models?.image],
|
|
223
|
+
["video", models?.video],
|
|
223
224
|
["speech", models?.audio?.speech],
|
|
224
225
|
["transcription", models?.audio?.transcription],
|
|
225
226
|
] as const
|
|
@@ -184,6 +184,7 @@ export function createHttpAgentRunSession<TRun extends AgentRunRecord>(
|
|
|
184
184
|
getVersion: (...args) => call("artifacts.getVersion", args),
|
|
185
185
|
listVersions: (...args) => call("artifacts.listVersions", args),
|
|
186
186
|
query: (...args) => call("artifacts.query", args),
|
|
187
|
+
media: (...args) => call("artifacts.media", args),
|
|
187
188
|
updatable: (artifactId) => call("artifacts.updatable", [artifactId]),
|
|
188
189
|
publish: (publish) => call("artifacts.publish", [publish]),
|
|
189
190
|
turnWrites: () => call("artifacts.turnWrites", []),
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
AGENT_RUN_STOPPED_HEADER,
|
|
20
20
|
decodeWireValue,
|
|
21
|
+
encodeModelCallError,
|
|
21
22
|
encodeWireError,
|
|
22
23
|
encodeWireValue,
|
|
23
24
|
parseAgentRunSessionPath,
|
|
@@ -108,6 +109,8 @@ const OPERATIONS: Readonly<Record<string, Operation>> = {
|
|
|
108
109
|
),
|
|
109
110
|
"artifacts.query": (session, args) =>
|
|
110
111
|
session.artifacts.query(...(args as Parameters<AgentRunSession["artifacts"]["query"]>)),
|
|
112
|
+
"artifacts.media": (session, args) =>
|
|
113
|
+
session.artifacts.media(...(args as Parameters<AgentRunSession["artifacts"]["media"]>)),
|
|
111
114
|
"artifacts.updatable": (session, [artifactId]) =>
|
|
112
115
|
session.artifacts.updatable(artifactId as string),
|
|
113
116
|
"artifacts.publish": (session, [input]) =>
|
|
@@ -444,7 +447,18 @@ async function streamModelCall(session: AgentRunSession, request: Request): Prom
|
|
|
444
447
|
measures?: unknown
|
|
445
448
|
}
|
|
446
449
|
const model = await session.models.language(ref, { measures: measures !== false })
|
|
447
|
-
|
|
450
|
+
|
|
451
|
+
let opened: Awaited<ReturnType<typeof model.stream>>
|
|
452
|
+
try {
|
|
453
|
+
opened = await model.stream({ ...call, signal: request.signal })
|
|
454
|
+
} catch (error) {
|
|
455
|
+
// The call failed before it answered: it crosses as a call that fails while it streams does.
|
|
456
|
+
// No stream will close the session, so this does.
|
|
457
|
+
await session.close()
|
|
458
|
+
const wire = encodeModelCallError(error)
|
|
459
|
+
return json({ error: wire }, wireErrorStatus(wire))
|
|
460
|
+
}
|
|
461
|
+
|
|
448
462
|
const encoder = new TextEncoder()
|
|
449
463
|
const iterator = opened.events[Symbol.asyncIterator]()
|
|
450
464
|
const body = new ReadableStream<Uint8Array>({
|
|
@@ -456,10 +470,17 @@ async function streamModelCall(session: AgentRunSession, request: Request): Prom
|
|
|
456
470
|
await session.close()
|
|
457
471
|
return
|
|
458
472
|
}
|
|
473
|
+
|
|
474
|
+
// An error event crosses as the error it carries, which the runner throws as its model
|
|
475
|
+
// loop would in process. Letting the call go records it, as the loop's reader does.
|
|
476
|
+
if (next.value.type === "error") {
|
|
477
|
+
await iterator.return?.()
|
|
478
|
+
throw next.value.error
|
|
479
|
+
}
|
|
459
480
|
controller.enqueue(encoder.encode(`${encodeWireValue({ event: next.value })}\n`))
|
|
460
481
|
} catch (error) {
|
|
461
482
|
controller.enqueue(
|
|
462
|
-
encoder.encode(`${encodeWireValue({ error:
|
|
483
|
+
encoder.encode(`${encodeWireValue({ error: encodeModelCallError(error) })}\n`)
|
|
463
484
|
)
|
|
464
485
|
controller.close()
|
|
465
486
|
await session.close()
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ArtifactRequestError } from "../artifacts/errors"
|
|
2
2
|
import { createSixbError, isSixbError } from "../errors/internal"
|
|
3
|
+
import { ModelProviderError } from "../models/errors"
|
|
3
4
|
import { ModelUsageRecordingError } from "../models/execution/errors"
|
|
4
5
|
import { AgentStorageError } from "../storage/agents/errors"
|
|
5
6
|
import { AgentToolPublicError, AgentToolResultValidationError } from "./errors"
|
|
7
|
+
import { lostConnectionCode } from "./model-call-retry"
|
|
6
8
|
import { AgentExecutionLostError, AgentRunRefusedError } from "./run-fence"
|
|
7
9
|
import { AgentFinalizationError } from "./run-session"
|
|
8
10
|
|
|
@@ -126,15 +128,45 @@ export function encodeWireError(error: unknown): WireError {
|
|
|
126
128
|
if (error instanceof Error && error.name === "AbortError") {
|
|
127
129
|
return { kind: "AbortError", message: error.message }
|
|
128
130
|
}
|
|
131
|
+
|
|
129
132
|
// Anything else stays on the server: the runner learns only that the operation failed.
|
|
130
133
|
console.error("[Sixb] A run session operation failed.", error)
|
|
131
134
|
return { kind: "Error", message: "[Sixb] The run session operation failed on the server." }
|
|
132
135
|
}
|
|
133
136
|
|
|
137
|
+
/**
|
|
138
|
+
* A model call's failure as it crosses. An interrupted call crosses as one, so the runner's model
|
|
139
|
+
* loop makes it again as it would in process. Only the call's own failures are read this way: any
|
|
140
|
+
* other operation that loses a connection, to storage say, fails as {@link encodeWireError} says.
|
|
141
|
+
*/
|
|
142
|
+
export function encodeModelCallError(error: unknown): WireError {
|
|
143
|
+
if (error instanceof ModelProviderError && error.reason === "interrupted") {
|
|
144
|
+
return {
|
|
145
|
+
kind: "ModelProviderError",
|
|
146
|
+
message: error.message,
|
|
147
|
+
reason: error.reason,
|
|
148
|
+
...(error.code === undefined ? {} : { code: error.code }),
|
|
149
|
+
details: { providerId: error.providerId, modelId: error.modelId },
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const lostConnection = lostConnectionCode(error)
|
|
154
|
+
if (lostConnection !== undefined) {
|
|
155
|
+
return {
|
|
156
|
+
kind: "ModelConnectionLost",
|
|
157
|
+
message: "[SixbModels] The connection to the model's provider was lost.",
|
|
158
|
+
code: lostConnection,
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return encodeWireError(error)
|
|
163
|
+
}
|
|
164
|
+
|
|
134
165
|
/** The HTTP status an error answers with. */
|
|
135
166
|
export function wireErrorStatus(error: WireError): number {
|
|
136
167
|
if (error.kind === "AgentExecutionLostError") return 409
|
|
137
168
|
if (error.kind === "AbortError") return 499
|
|
169
|
+
if (error.kind === "ModelConnectionLost" || error.kind === "ModelProviderError") return 502
|
|
138
170
|
if (error.kind === "Error" || error.kind === "AgentFinalizationError") return 500
|
|
139
171
|
return 400
|
|
140
172
|
}
|
|
@@ -183,6 +215,19 @@ export function decodeWireError(error: WireError): Error {
|
|
|
183
215
|
)
|
|
184
216
|
case "AbortError":
|
|
185
217
|
return new DOMException(error.message, "AbortError")
|
|
218
|
+
case "ModelConnectionLost":
|
|
219
|
+
// As fetch throws it in process.
|
|
220
|
+
return Object.assign(new TypeError(error.message), { code: error.code })
|
|
221
|
+
case "ModelProviderError": {
|
|
222
|
+
const { providerId = "", modelId = "" } = (error.details ?? {}) as {
|
|
223
|
+
readonly providerId?: string
|
|
224
|
+
readonly modelId?: string
|
|
225
|
+
}
|
|
226
|
+
return new ModelProviderError(error.message, providerId, modelId, {
|
|
227
|
+
...(error.code === undefined ? {} : { code: error.code }),
|
|
228
|
+
reason: "interrupted",
|
|
229
|
+
})
|
|
230
|
+
}
|
|
186
231
|
default:
|
|
187
232
|
return new Error(error.message)
|
|
188
233
|
}
|
package/src/agents/run-token.ts
CHANGED
|
@@ -40,6 +40,13 @@ export const AGENT_API_ROUTES: readonly AgentApiRoute[] = SIXB_API_ROUTES.filter
|
|
|
40
40
|
effect: route.agentEffect ?? "read",
|
|
41
41
|
}))
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* The run a run-token request is from, which the sandbox CLI sends from `SIXB_RUN_ID`: one of the
|
|
45
|
+
* token's run's own children when the child works in its parent's workspace, under its parent's
|
|
46
|
+
* token. The server narrows the token's authority to that child; it never widens it.
|
|
47
|
+
*/
|
|
48
|
+
export const AGENT_RUN_HEADER = "x-sixb-run"
|
|
49
|
+
|
|
43
50
|
export function createAgentRunToken(input: AgentRunTokenInput): string {
|
|
44
51
|
return signToken(RUN_TOKEN, input)
|
|
45
52
|
}
|
|
@@ -99,6 +99,17 @@ export interface AgentThreadAccessRule {
|
|
|
99
99
|
readonly caller: Principal
|
|
100
100
|
/** The thread and how the caller takes part in it; `null` when it cannot read it. */
|
|
101
101
|
read(threadId: string): Promise<ReadableAgentThread | null>
|
|
102
|
+
/**
|
|
103
|
+
* The conversations among these threads the caller reads, each once, as `read` answers each but
|
|
104
|
+
* read together, in a few queries however many there are. A sub-agent's thread is left out.
|
|
105
|
+
*/
|
|
106
|
+
readConversations(threadIds: readonly string[]): Promise<readonly ReadableAgentThread[]>
|
|
107
|
+
/**
|
|
108
|
+
* Whose conversations the caller reads, for a list to ask its storage for those alone: a
|
|
109
|
+
* principal's, as owner or participant; `"every"` for code without a caller; `"none"` when it
|
|
110
|
+
* reads none.
|
|
111
|
+
*/
|
|
112
|
+
scope(): { readonly reader: Principal } | "every" | "none"
|
|
102
113
|
}
|
|
103
114
|
|
|
104
115
|
export function createAgentThreadAccessRule(
|
|
@@ -141,7 +152,29 @@ export function createAgentThreadAccessRule(
|
|
|
141
152
|
return thread && access ? { thread, access } : null
|
|
142
153
|
}
|
|
143
154
|
|
|
144
|
-
|
|
155
|
+
const readConversations = async (
|
|
156
|
+
threadIds: readonly string[]
|
|
157
|
+
): Promise<readonly ReadableAgentThread[]> => {
|
|
158
|
+
if (blocked || threadIds.length === 0) return []
|
|
159
|
+
|
|
160
|
+
const storage = agents ?? runtime.storage.agents
|
|
161
|
+
const stored =
|
|
162
|
+
(await storage?.threads.getByIds({ projectId: runtime.projectId, ids: threadIds })) ?? []
|
|
163
|
+
const conversations = stored.filter((thread) => thread.kind === "conversation")
|
|
164
|
+
|
|
165
|
+
const views = await agentThreadViews(runtime, conversations, storage)
|
|
166
|
+
return views.flatMap((thread) => {
|
|
167
|
+
const access = accessIn(thread)
|
|
168
|
+
return access ? [{ thread, access }] : []
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const scope = (): ReturnType<AgentThreadAccessRule["scope"]> => {
|
|
173
|
+
if (blocked || !isRuntimeAllowed(runtime, { kind: "agent.run" })) return "none"
|
|
174
|
+
return authority.type === "principal" ? { reader: caller } : "every"
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return { caller, read, readConversations, scope }
|
|
145
178
|
}
|
|
146
179
|
|
|
147
180
|
/** Refuse what only a conversation takes: a message, a fork, a participant, a mode, a sandbox. */
|
package/src/agents/tool-files.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from "node:crypto"
|
|
2
2
|
import { posix } from "node:path"
|
|
3
3
|
import { ARTIFACT_LIMITS } from "../artifacts/limits"
|
|
4
|
-
import { sniffFileMediaType } from "../blob-storage/media-type"
|
|
4
|
+
import { sniffFileMediaType, unaliasMediaType } from "../blob-storage/media-type"
|
|
5
5
|
import type { BlobBody, FileRef } from "../blob-storage/types"
|
|
6
6
|
import { isFileRef } from "../blob-storage/validation"
|
|
7
7
|
import { AgentToolPublicError } from "./errors"
|
|
@@ -185,7 +185,7 @@ function normalizeMediaType(value: string | undefined, toolName: string): string
|
|
|
185
185
|
) {
|
|
186
186
|
throw toolFileError(toolName, "mediaType must be a valid type/subtype value")
|
|
187
187
|
}
|
|
188
|
-
return normalized
|
|
188
|
+
return unaliasMediaType(normalized)
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
function validatedMediaType(
|
|
@@ -194,16 +194,32 @@ function validatedMediaType(
|
|
|
194
194
|
toolName: string
|
|
195
195
|
): string {
|
|
196
196
|
const detected = sniffFileMediaType(bytes)
|
|
197
|
-
|
|
197
|
+
const named = declared === "application/octet-stream" ? undefined : declared
|
|
198
|
+
if (detected && named && !declaresFormat(named, detected)) {
|
|
198
199
|
throw toolFileError(
|
|
199
200
|
toolName,
|
|
200
|
-
`file bytes are ${detected}, not the declared media type ${
|
|
201
|
+
`file bytes are ${detected}, not the declared media type ${named}`
|
|
201
202
|
)
|
|
202
203
|
}
|
|
203
|
-
if (
|
|
204
|
-
throw toolFileError(toolName, `file bytes do not match the declared media type ${
|
|
204
|
+
if (named && SIGNATURE_REQUIRED_MEDIA_TYPES.has(named) && detected !== named) {
|
|
205
|
+
throw toolFileError(toolName, `file bytes do not match the declared media type ${named}`)
|
|
205
206
|
}
|
|
206
|
-
|
|
207
|
+
|
|
208
|
+
// A declared type that agrees with the bytes may say more than their signature can.
|
|
209
|
+
return named ?? detected ?? "application/octet-stream"
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Whether a declared type agrees with the one the bytes' signature names. A sound or video
|
|
214
|
+
* container's signature cannot say whether it holds a picture, nor tell a type from its aliases
|
|
215
|
+
* (`audio/x-wav`), so any sound or video type agrees with another.
|
|
216
|
+
*/
|
|
217
|
+
function declaresFormat(declared: string, detected: string): boolean {
|
|
218
|
+
return declared === detected || (isTimedMedia(declared) && isTimedMedia(detected))
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function isTimedMedia(mediaType: string): boolean {
|
|
222
|
+
return mediaType.startsWith("audio/") || mediaType.startsWith("video/")
|
|
207
223
|
}
|
|
208
224
|
|
|
209
225
|
const SIGNATURE_REQUIRED_MEDIA_TYPES = new Set([
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ArtifactsRuntime } from "./execution"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The artifacts a bound SDK's caller reaches, kept on its runtime context. An Action run reaches
|
|
5
|
+
* artifacts as whoever requested it, so a request reads them here: a person's request reaches what
|
|
6
|
+
* that person reaches, never every artifact of the project.
|
|
7
|
+
*/
|
|
8
|
+
const callerArtifactsKey: unique symbol = Symbol("sixb.callerArtifacts")
|
|
9
|
+
|
|
10
|
+
interface CallerArtifactsOwner {
|
|
11
|
+
readonly [callerArtifactsKey]?: ArtifactsRuntime
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function registerCallerArtifacts(owner: object, artifacts: ArtifactsRuntime): void {
|
|
15
|
+
const registered = (owner as CallerArtifactsOwner)[callerArtifactsKey]
|
|
16
|
+
if (registered && registered !== artifacts) {
|
|
17
|
+
throw new Error("[Sixb] The caller's artifacts are already registered for this owner.")
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Object.defineProperty(owner, callerArtifactsKey, {
|
|
21
|
+
configurable: false,
|
|
22
|
+
enumerable: true,
|
|
23
|
+
value: artifacts,
|
|
24
|
+
writable: false,
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function getCallerArtifacts(owner: object): ArtifactsRuntime {
|
|
29
|
+
const artifacts = (owner as CallerArtifactsOwner)[callerArtifactsKey]
|
|
30
|
+
if (artifacts) return artifacts
|
|
31
|
+
throw new Error("[Sixb] The caller's artifacts are not registered for this runtime context.")
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Copies the caller's artifacts, when there are any, onto an internal runtime context being
|
|
36
|
+
* reconstructed: what reaches them asks with `getCallerArtifacts`, which refuses where there are
|
|
37
|
+
* none.
|
|
38
|
+
*/
|
|
39
|
+
export function shareCallerArtifacts(source: object, target: object): void {
|
|
40
|
+
const artifacts = (source as CallerArtifactsOwner)[callerArtifactsKey]
|
|
41
|
+
if (artifacts) registerCallerArtifacts(target, artifacts)
|
|
42
|
+
}
|