@sixb/core 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/index.js +53 -50
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run/context.d.ts.map +1 -1
- package/dist/actions/run/execute.d.ts +3 -0
- package/dist/actions/run/execute.d.ts.map +1 -1
- package/dist/actions/run/executor.d.ts +3 -0
- package/dist/actions/run/executor.d.ts.map +1 -1
- package/dist/actions/run/normalize.d.ts.map +1 -1
- package/dist/actions/run/types.d.ts +6 -0
- package/dist/actions/run/types.d.ts.map +1 -1
- package/dist/actions/types/context.d.ts +7 -0
- package/dist/actions/types/context.d.ts.map +1 -1
- package/dist/agents/context/entries.d.ts +17 -0
- package/dist/agents/context/entries.d.ts.map +1 -1
- package/dist/agents/context/index.js +3 -2
- package/dist/agents/context/index.js.map +1 -1
- package/dist/agents/context-model.d.ts.map +1 -1
- package/dist/agents/context-resolution.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +7 -0
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +62 -57
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-call-retry.d.ts +28 -0
- package/dist/agents/model-call-retry.d.ts.map +1 -0
- package/dist/agents/model-loop.d.ts +4 -2
- package/dist/agents/model-loop.d.ts.map +1 -1
- package/dist/agents/model-routing.d.ts +15 -4
- package/dist/agents/model-routing.d.ts.map +1 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/run-artifacts.d.ts +2 -0
- package/dist/agents/run-artifacts.d.ts.map +1 -1
- package/dist/agents/run-plan.d.ts +1 -1
- package/dist/agents/run-plan.d.ts.map +1 -1
- package/dist/agents/run-session-http.d.ts.map +1 -1
- package/dist/agents/run-session-serve.d.ts.map +1 -1
- package/dist/agents/run-session-wire.d.ts +6 -0
- package/dist/agents/run-session-wire.d.ts.map +1 -1
- package/dist/agents/run-token.d.ts +6 -0
- package/dist/agents/run-token.d.ts.map +1 -1
- package/dist/agents/streams/index.js +1 -1
- package/dist/agents/streams/internal.js +2 -2
- package/dist/agents/thread-access.d.ts +13 -0
- package/dist/agents/thread-access.d.ts.map +1 -1
- package/dist/agents/tool-files.d.ts.map +1 -1
- package/dist/artifacts/caller.d.ts +10 -0
- package/dist/artifacts/caller.d.ts.map +1 -0
- package/dist/artifacts/comment-place.d.ts +26 -0
- package/dist/artifacts/comment-place.d.ts.map +1 -0
- package/dist/artifacts/comment-text.d.ts +12 -4
- package/dist/artifacts/comment-text.d.ts.map +1 -1
- package/dist/artifacts/comments.d.ts +8 -2
- package/dist/artifacts/comments.d.ts.map +1 -1
- package/dist/artifacts/errors.d.ts +1 -1
- package/dist/artifacts/errors.d.ts.map +1 -1
- package/dist/artifacts/execution.d.ts +73 -5
- package/dist/artifacts/execution.d.ts.map +1 -1
- package/dist/artifacts/frames/assets.d.ts +27 -7
- package/dist/artifacts/frames/assets.d.ts.map +1 -1
- package/dist/artifacts/frames/entries.d.ts +5 -4
- package/dist/artifacts/frames/entries.d.ts.map +1 -1
- package/dist/artifacts/frames/hyperframes.d.ts +12 -0
- package/dist/artifacts/frames/hyperframes.d.ts.map +1 -0
- package/dist/artifacts/frames/index.d.ts +3 -1
- package/dist/artifacts/frames/index.d.ts.map +1 -1
- package/dist/artifacts/frames/index.js +20 -6
- package/dist/artifacts/frames/index.js.map +3 -3
- package/dist/artifacts/frames/kit.d.ts.map +1 -1
- package/dist/artifacts/frames/protocol.d.ts +33 -0
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/video-runtime.d.ts +21 -0
- package/dist/artifacts/frames/video-runtime.d.ts.map +1 -0
- package/dist/artifacts/html.d.ts +23 -0
- package/dist/artifacts/html.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +5 -3
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +71 -10
- package/dist/artifacts/index.js.map +4 -4
- package/dist/artifacts/kinds.d.ts +1 -1
- package/dist/artifacts/kinds.d.ts.map +1 -1
- package/dist/artifacts/limits.d.ts +37 -0
- package/dist/artifacts/limits.d.ts.map +1 -1
- package/dist/artifacts/live/document.d.ts.map +1 -1
- package/dist/artifacts/live/index.d.ts +6 -2
- package/dist/artifacts/live/index.d.ts.map +1 -1
- package/dist/artifacts/live/index.js +3432 -13
- package/dist/artifacts/live/index.js.map +6 -3
- package/dist/artifacts/live/presence.d.ts +7 -5
- package/dist/artifacts/live/presence.d.ts.map +1 -1
- package/dist/artifacts/live/protocol.d.ts +4 -2
- package/dist/artifacts/live/protocol.d.ts.map +1 -1
- package/dist/artifacts/live/server.d.ts +1 -1
- package/dist/artifacts/live/server.d.ts.map +1 -1
- package/dist/artifacts/live/server.js +36 -31
- package/dist/artifacts/live/server.js.map +1 -1
- package/dist/artifacts/live/state.d.ts +2 -2
- package/dist/artifacts/media/media.d.ts +96 -0
- package/dist/artifacts/media/media.d.ts.map +1 -0
- package/dist/artifacts/media/transcriber.d.ts +29 -0
- package/dist/artifacts/media/transcriber.d.ts.map +1 -0
- package/dist/artifacts/outline.d.ts +26 -1
- package/dist/artifacts/outline.d.ts.map +1 -1
- package/dist/artifacts/publish/files.d.ts +5 -2
- package/dist/artifacts/publish/files.d.ts.map +1 -1
- package/dist/artifacts/publish/index.d.ts +11 -2
- package/dist/artifacts/publish/index.d.ts.map +1 -1
- package/dist/artifacts/publish/index.js +110 -33
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/pdf.d.ts.map +1 -1
- package/dist/artifacts/publish/previews.d.ts +7 -2
- package/dist/artifacts/publish/previews.d.ts.map +1 -1
- package/dist/artifacts/publish/publish.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/html.d.ts +5 -4
- package/dist/artifacts/publish/validate/html.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/video.d.ts +36 -0
- package/dist/artifacts/publish/validate/video.d.ts.map +1 -0
- package/dist/artifacts/publish/video.d.ts +79 -0
- package/dist/artifacts/publish/video.d.ts.map +1 -0
- package/dist/artifacts/resolve.d.ts +9 -0
- package/dist/artifacts/resolve.d.ts.map +1 -1
- package/dist/artifacts/video/composition.d.ts +183 -0
- package/dist/artifacts/video/composition.d.ts.map +1 -0
- package/dist/artifacts/video/edit.d.ts +298 -0
- package/dist/artifacts/video/edit.d.ts.map +1 -0
- package/dist/artifacts/video/export.d.ts +142 -0
- package/dist/artifacts/video/export.d.ts.map +1 -0
- package/dist/artifacts/video/looks.d.ts +133 -0
- package/dist/artifacts/video/looks.d.ts.map +1 -0
- package/dist/artifacts/video/project.d.ts +74 -0
- package/dist/artifacts/video/project.d.ts.map +1 -0
- package/dist/artifacts/video/stills.d.ts +65 -0
- package/dist/artifacts/video/stills.d.ts.map +1 -0
- package/dist/artifacts/video/timeline.d.ts +153 -0
- package/dist/artifacts/video/timeline.d.ts.map +1 -0
- package/dist/auth/index.js +9 -8
- package/dist/auth/index.js.map +1 -1
- package/dist/authorization/index.js +5 -4
- package/dist/authorization/index.js.map +1 -1
- package/dist/blob-storage/browser.d.ts +1 -1
- package/dist/blob-storage/browser.d.ts.map +1 -1
- package/dist/blob-storage/browser.js +8 -4
- package/dist/blob-storage/browser.js.map +1 -1
- package/dist/blob-storage/constants.d.ts +8 -3
- package/dist/blob-storage/constants.d.ts.map +1 -1
- package/dist/blob-storage/download-urls.d.ts +2 -2
- package/dist/blob-storage/download-urls.d.ts.map +1 -1
- package/dist/blob-storage/index.d.ts +1 -1
- package/dist/blob-storage/index.d.ts.map +1 -1
- package/dist/blob-storage/index.js +9 -5
- package/dist/blob-storage/index.js.map +1 -1
- package/dist/blob-storage/internal.d.ts +2 -2
- package/dist/blob-storage/internal.d.ts.map +1 -1
- package/dist/blob-storage/internal.js +10 -4
- package/dist/blob-storage/internal.js.map +1 -1
- package/dist/blob-storage/media-type.d.ts +12 -3
- package/dist/blob-storage/media-type.d.ts.map +1 -1
- package/dist/bootstrap/discovery.d.ts +6 -0
- package/dist/bootstrap/discovery.d.ts.map +1 -1
- package/dist/bootstrap/index.js +63 -60
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/{chunk-az95tsh3.js → chunk-0fjryajn.js} +3 -2
- package/dist/chunk-0fjryajn.js.map +11 -0
- package/dist/{chunk-9tpmfh3n.js → chunk-0mk8qqp9.js} +3 -3
- package/dist/{chunk-9tpmfh3n.js.map → chunk-0mk8qqp9.js.map} +3 -3
- package/dist/{chunk-88xeh6zx.js → chunk-1g4me5f2.js} +182 -7
- package/dist/{chunk-88xeh6zx.js.map → chunk-1g4me5f2.js.map} +3 -3
- package/dist/{chunk-7mhbs9yy.js → chunk-1z8ccj53.js} +1 -1
- package/dist/{chunk-wkv3h3q7.js → chunk-2138b0ng.js} +115 -8
- package/dist/chunk-2138b0ng.js.map +12 -0
- package/dist/chunk-23eaayw4.js +3757 -0
- package/dist/chunk-23eaayw4.js.map +22 -0
- package/dist/{chunk-s8xxef60.js → chunk-2mxq1yd9.js} +48 -41
- package/dist/{chunk-s8xxef60.js.map → chunk-2mxq1yd9.js.map} +6 -6
- package/dist/{chunk-dmnd9ea6.js → chunk-30a0ftnm.js} +2 -2
- package/dist/{chunk-nxysqbt0.js → chunk-389ybvw9.js} +6 -2
- package/dist/chunk-389ybvw9.js.map +10 -0
- package/dist/{chunk-qbd282aa.js → chunk-39q9ybav.js} +2 -2
- package/dist/{chunk-9c9yknwt.js → chunk-3d9w8t4n.js} +111 -23
- package/dist/{chunk-9c9yknwt.js.map → chunk-3d9w8t4n.js.map} +5 -5
- package/dist/chunk-3dvcdn9w.js +8 -0
- package/dist/chunk-3dvcdn9w.js.map +10 -0
- package/dist/{chunk-bcz9dxtf.js → chunk-3x902cja.js} +3 -3
- package/dist/{chunk-c4nrycdy.js → chunk-4q4a5a96.js} +1 -1
- package/dist/{chunk-7r9mqpva.js → chunk-4tdm3fsj.js} +100 -36
- package/dist/{chunk-7r9mqpva.js.map → chunk-4tdm3fsj.js.map} +10 -10
- package/dist/{chunk-ykchk644.js → chunk-4w8qzy9w.js} +6 -6
- package/dist/{chunk-c29729me.js → chunk-4z9xtxke.js} +8 -7
- package/dist/chunk-4z9xtxke.js.map +12 -0
- package/dist/chunk-5278qwax.js +270 -0
- package/dist/chunk-5278qwax.js.map +11 -0
- package/dist/{chunk-kft7mp7z.js → chunk-5xkqasvn.js} +1 -1
- package/dist/{chunk-k1g14kk3.js → chunk-6a4hp405.js} +4 -5
- package/dist/{chunk-k1g14kk3.js.map → chunk-6a4hp405.js.map} +3 -3
- package/dist/{chunk-xavet0qs.js → chunk-6whr25gw.js} +2 -2
- package/dist/{chunk-mbwsgjn7.js → chunk-7zygtcqq.js} +14 -2
- package/dist/chunk-7zygtcqq.js.map +11 -0
- package/dist/chunk-88s9z5pf.js +3 -0
- package/dist/{chunk-de5sfbc3.js.map → chunk-88s9z5pf.js.map} +1 -1
- package/dist/{chunk-ygvay56w.js → chunk-896te58g.js} +2 -2
- package/dist/{chunk-pqj8vff9.js → chunk-8eqqqc1h.js} +3 -3
- package/dist/{chunk-425ydk65.js → chunk-8tefbhdx.js} +14 -14
- package/dist/{chunk-425ydk65.js.map → chunk-8tefbhdx.js.map} +1 -1
- package/dist/{chunk-jka26v8c.js → chunk-8x1bsp68.js} +1 -1
- package/dist/{chunk-wzcjhv54.js → chunk-93e4w7te.js} +113 -1
- package/dist/chunk-93e4w7te.js.map +11 -0
- package/dist/{chunk-ym1bqd98.js → chunk-990a5bkc.js} +424 -76
- package/dist/chunk-990a5bkc.js.map +21 -0
- package/dist/{chunk-fmgf9h5e.js → chunk-9az7kjv4.js} +6 -6
- package/dist/{chunk-eg6xqef7.js → chunk-9e5t53z0.js} +3 -3
- package/dist/{chunk-eg6xqef7.js.map → chunk-9e5t53z0.js.map} +3 -3
- package/dist/{chunk-bs1sd0e0.js → chunk-9p7kyeqz.js} +4 -4
- package/dist/chunk-a68zz4r0.js +537 -0
- package/dist/chunk-a68zz4r0.js.map +11 -0
- package/dist/{chunk-d7vyc7k6.js → chunk-a700gjc8.js} +10 -2
- package/dist/chunk-a700gjc8.js.map +10 -0
- package/dist/{chunk-gfdh9kqa.js → chunk-a9qzjaz2.js} +2 -5
- package/dist/chunk-a9qzjaz2.js.map +10 -0
- package/dist/{chunk-ats8y3d9.js → chunk-as94vcty.js} +688 -504
- package/dist/{chunk-ats8y3d9.js.map → chunk-as94vcty.js.map} +21 -21
- package/dist/{chunk-brybqw5k.js → chunk-bkxm2dzx.js} +1 -1
- package/dist/{chunk-ppxf7gw2.js → chunk-d7t9jnym.js} +3 -3
- package/dist/{chunk-tapdssb5.js → chunk-e3b1r4d2.js} +8 -7
- package/dist/{chunk-tapdssb5.js.map → chunk-e3b1r4d2.js.map} +4 -4
- package/dist/{chunk-cg7cygfj.js → chunk-fdmvaz7x.js} +1 -1
- package/dist/{chunk-191jz8a6.js → chunk-ff0qdk7z.js} +1 -1
- package/dist/{chunk-9vsc919v.js → chunk-fgxvrxx4.js} +22 -2
- package/dist/chunk-fgxvrxx4.js.map +10 -0
- package/dist/{chunk-wx7smkn2.js → chunk-fq8drkp0.js} +1 -1
- package/dist/{chunk-60662fyv.js → chunk-fqms1a8c.js} +132 -4
- package/dist/{chunk-60662fyv.js.map → chunk-fqms1a8c.js.map} +8 -6
- package/dist/{chunk-v8a1qjzp.js → chunk-hpswfrjj.js} +1 -1
- package/dist/{chunk-qttqe1ah.js → chunk-jbg905hn.js} +80 -13
- package/dist/chunk-jbg905hn.js.map +25 -0
- package/dist/{chunk-bz5bnjjt.js → chunk-jjte0h4p.js} +1 -1
- package/dist/{chunk-jt012fxq.js → chunk-jwjwvzj1.js} +797 -51
- package/dist/chunk-jwjwvzj1.js.map +38 -0
- package/dist/{chunk-f05994as.js → chunk-k3vd2vyz.js} +6 -2
- package/dist/chunk-k3vd2vyz.js.map +10 -0
- package/dist/chunk-kcqpk9w1.js.map +2 -2
- package/dist/chunk-mvz89age.js.map +2 -2
- package/dist/{chunk-xrmbhap8.js → chunk-mwg0nwkb.js} +1 -1
- package/dist/{chunk-a3faa34j.js → chunk-nfjt8k8j.js} +1 -1
- package/dist/{chunk-394zjzjs.js → chunk-nhgqz3g3.js} +3 -3
- package/dist/{chunk-bqr703h4.js → chunk-p0c5kkhn.js} +23 -6
- package/dist/{chunk-bqr703h4.js.map → chunk-p0c5kkhn.js.map} +3 -3
- package/dist/{chunk-92wrka15.js → chunk-q150fnj9.js} +1 -1
- package/dist/{chunk-w3t94hm6.js → chunk-qk3zq25v.js} +1 -1
- package/dist/{chunk-6hfbz4d0.js → chunk-r588h4ev.js} +1 -1
- package/dist/chunk-rtkqczbr.js.map +2 -2
- package/dist/{chunk-3qtk0070.js → chunk-ssqbrts1.js} +86 -9
- package/dist/chunk-ssqbrts1.js.map +14 -0
- package/dist/{chunk-5qqmndhm.js → chunk-szzhrn3e.js} +1 -1
- package/dist/{chunk-n1hbwc6y.js → chunk-t6pfch4e.js} +1 -1
- package/dist/{chunk-xtztwpkh.js → chunk-v6h4tc2v.js} +86 -5
- package/dist/chunk-v6h4tc2v.js.map +12 -0
- package/dist/{chunk-brhp9d97.js → chunk-vmqjndb3.js} +2 -2
- package/dist/chunk-vtjzwymr.js.map +2 -2
- package/dist/{chunk-t19wjmnc.js → chunk-wpba6hhd.js} +54 -20
- package/dist/{chunk-t19wjmnc.js.map → chunk-wpba6hhd.js.map} +3 -3
- package/dist/{chunk-htdzx40w.js → chunk-wrb1x1ss.js} +12 -4
- package/dist/{chunk-htdzx40w.js.map → chunk-wrb1x1ss.js.map} +3 -3
- package/dist/{chunk-5sswe5ej.js → chunk-wsv23wvr.js} +2 -2
- package/dist/{chunk-90nqenq8.js → chunk-x0hqc54n.js} +4 -4
- package/dist/{chunk-sgx82nnt.js → chunk-xg31er4p.js} +43 -4
- package/dist/chunk-xg31er4p.js.map +10 -0
- package/dist/{chunk-3neam1y5.js → chunk-y3qb965a.js} +2 -2
- package/dist/{chunk-gaj8djsw.js → chunk-y57eawng.js} +10 -5
- package/dist/{chunk-gaj8djsw.js.map → chunk-y57eawng.js.map} +3 -3
- package/dist/{chunk-8ncg20rd.js → chunk-yah25st6.js} +5 -5
- package/dist/chunk-yah25st6.js.map +10 -0
- package/dist/{chunk-grt2j5vp.js → chunk-ywvxcmqj.js} +106 -13
- package/dist/{chunk-grt2j5vp.js.map → chunk-ywvxcmqj.js.map} +8 -7
- package/dist/{chunk-xf76csps.js → chunk-zmq9xc9s.js} +70 -31
- package/dist/{chunk-xf76csps.js.map → chunk-zmq9xc9s.js.map} +4 -3
- package/dist/datasets/write.js +8 -7
- package/dist/datasets/write.js.map +1 -1
- package/dist/deploy/index.d.ts +1 -1
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/internal.js +2 -2
- package/dist/deploy/internal.js.map +2 -2
- package/dist/deploy/types.d.ts +8 -58
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/env/index.d.ts +10 -3
- package/dist/env/index.d.ts.map +1 -1
- package/dist/env/index.js.map +2 -2
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/execution/agent.js +53 -50
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/kernel-operation.d.ts +1 -0
- package/dist/execution/kernel-operation.d.ts.map +1 -1
- package/dist/execution/primitive.js +53 -50
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.js +54 -51
- package/dist/execution/request.js.map +2 -2
- package/dist/execution/types.d.ts +5 -0
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +73 -67
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/index.js +9 -8
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/maintenance/index.js +9 -8
- package/dist/maintenance/index.js.map +2 -2
- package/dist/materializer/index.js +26 -24
- package/dist/materializer/index.js.map +1 -1
- package/dist/models/audio/runtime.d.ts +3 -1
- package/dist/models/audio/runtime.d.ts.map +1 -1
- package/dist/models/audio/speech.d.ts +2 -2
- package/dist/models/audio/speech.d.ts.map +1 -1
- package/dist/models/audio/types.d.ts +23 -3
- package/dist/models/audio/types.d.ts.map +1 -1
- package/dist/models/calls.d.ts +7 -0
- package/dist/models/calls.d.ts.map +1 -1
- package/dist/models/catalog.d.ts +5 -0
- package/dist/models/catalog.d.ts.map +1 -1
- package/dist/models/definitions.d.ts +3 -2
- package/dist/models/definitions.d.ts.map +1 -1
- package/dist/models/errors.d.ts +5 -3
- package/dist/models/errors.d.ts.map +1 -1
- package/dist/models/events.d.ts +2 -0
- package/dist/models/events.d.ts.map +1 -1
- package/dist/models/execution/index.d.ts +1 -0
- package/dist/models/execution/index.d.ts.map +1 -1
- package/dist/models/execution/index.js +33 -28
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/execution/model-call-limits.d.ts.map +1 -1
- package/dist/models/execution/model-call-recorder.d.ts +8 -0
- package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
- package/dist/models/execution/session.d.ts +12 -0
- package/dist/models/execution/session.d.ts.map +1 -1
- package/dist/models/execution/usage.d.ts.map +1 -1
- package/dist/models/execution.d.ts +1 -1
- package/dist/models/execution.d.ts.map +1 -1
- package/dist/models/generation-types.d.ts +2 -0
- package/dist/models/generation-types.d.ts.map +1 -1
- package/dist/models/index.d.ts +4 -2
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +2 -2
- package/dist/models/input-file.d.ts.map +1 -1
- package/dist/models/pricing.d.ts +2 -1
- package/dist/models/pricing.d.ts.map +1 -1
- package/dist/models/rate-card.d.ts +6 -0
- package/dist/models/rate-card.d.ts.map +1 -1
- package/dist/models/tools.d.ts +5 -0
- package/dist/models/tools.d.ts.map +1 -1
- package/dist/models/video/catalog.d.ts +13 -0
- package/dist/models/video/catalog.d.ts.map +1 -0
- package/dist/models/video/check.d.ts +76 -0
- package/dist/models/video/check.d.ts.map +1 -0
- package/dist/models/video/runtime.d.ts +21 -0
- package/dist/models/video/runtime.d.ts.map +1 -0
- package/dist/models/video/types.d.ts +188 -0
- package/dist/models/video/types.d.ts.map +1 -0
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +53 -50
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/index.js +25 -23
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/sdk/object-set.d.ts.map +1 -1
- package/dist/ontology/index.js +4 -4
- package/dist/ontology/internal.js +4 -4
- package/dist/pipelines/index.js +28 -26
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/internal.js +26 -24
- package/dist/projections/internal.js.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/types.d.ts +103 -6
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/definitions.d.ts +14 -0
- package/dist/runtime/definitions.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +3 -1
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +3 -1
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +49 -43
- package/dist/runtime/internal.js.map +2 -2
- package/dist/runtime/resolve-definitions.d.ts +2 -1
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/sandboxes/errors.d.ts +19 -0
- package/dist/sandboxes/errors.d.ts.map +1 -1
- package/dist/sandboxes/exec.d.ts +2 -0
- package/dist/sandboxes/exec.d.ts.map +1 -1
- package/dist/sandboxes/index.d.ts +1 -1
- package/dist/sandboxes/index.d.ts.map +1 -1
- package/dist/sandboxes/index.js +14 -8
- package/dist/sandboxes/index.js.map +1 -1
- package/dist/sandboxes/sandbox.d.ts +15 -1
- package/dist/sandboxes/sandbox.d.ts.map +1 -1
- package/dist/security/public.d.ts +6 -4
- package/dist/security/public.d.ts.map +1 -1
- package/dist/security/public.js +5 -3
- package/dist/security/public.js.map +1 -1
- package/dist/shares/internal.js +25 -23
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/agents/in-memory.d.ts +2 -1
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +1 -1
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +5 -5
- package/dist/storage/agents/types.d.ts +27 -1
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/analytics.d.ts +1 -0
- package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
- package/dist/storage/ai-cost/groups.d.ts +2 -0
- package/dist/storage/ai-cost/groups.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +5 -5
- package/dist/storage/ai-cost/types.d.ts +2 -1
- package/dist/storage/ai-cost/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/validation.d.ts.map +1 -1
- package/dist/storage/ai-limits/enforcement.js +3 -3
- package/dist/storage/ai-limits/provider.js +2 -2
- package/dist/storage/ai-usage/in-memory.d.ts +8 -1
- package/dist/storage/ai-usage/in-memory.d.ts.map +1 -1
- package/dist/storage/ai-usage/index.d.ts +2 -2
- package/dist/storage/ai-usage/index.d.ts.map +1 -1
- package/dist/storage/ai-usage/record.d.ts +11 -1
- package/dist/storage/ai-usage/record.d.ts.map +1 -1
- package/dist/storage/ai-usage/types.d.ts +80 -1
- package/dist/storage/ai-usage/types.d.ts.map +1 -1
- package/dist/storage/ai-usage/usage.d.ts +1 -1
- package/dist/storage/ai-usage/usage.d.ts.map +1 -1
- package/dist/storage/artifacts/in-memory.d.ts +25 -2
- package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
- package/dist/storage/artifacts/index.d.ts +1 -1
- package/dist/storage/artifacts/index.d.ts.map +1 -1
- package/dist/storage/artifacts/record.d.ts +12 -1
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +198 -6
- package/dist/storage/artifacts/types.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +3 -2
- package/dist/storage/executions/provider.js.map +1 -1
- package/dist/storage/file-upload-sessions/provider.js +10 -9
- package/dist/storage/file-upload-sessions/provider.js.map +1 -1
- package/dist/storage/in-memory/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +25 -23
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +2 -2
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +34 -14
- package/dist/storage/internal.js.map +2 -2
- package/dist/storage/workflow-runs/provider.js +10 -9
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/syncs/index.js +29 -27
- package/dist/syncs/index.js.map +1 -1
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
- package/dist/testing/artifact-storage-contract.d.ts +3 -0
- package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.js +686 -75
- package/dist/testing/index.js.map +10 -10
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/testing/sandboxes-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +26 -24
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workers/index.js +5 -5
- package/dist/workers/index.js.map +1 -1
- package/dist/workflows/index.js +60 -57
- package/dist/workflows/index.js.map +1 -1
- package/package.json +3 -1
- package/src/actions/request.ts +2 -0
- package/src/actions/run/context.ts +1 -0
- package/src/actions/run/execute.ts +5 -1
- package/src/actions/run/executor.ts +4 -0
- package/src/actions/run/normalize.ts +4 -0
- package/src/actions/run/types.ts +6 -0
- package/src/actions/types/context.ts +7 -0
- package/src/agents/README.md +3 -1
- package/src/agents/context/entries.ts +63 -9
- package/src/agents/context-model.ts +9 -0
- package/src/agents/context-resolution.ts +7 -0
- package/src/agents/execution.ts +39 -0
- package/src/agents/index.ts +1 -0
- package/src/agents/model-call-retry.ts +69 -0
- package/src/agents/model-loop.ts +86 -12
- package/src/agents/model-routing.ts +104 -38
- package/src/agents/request.ts +27 -1
- package/src/agents/run-artifacts.ts +10 -5
- package/src/agents/run-plan.ts +2 -1
- package/src/agents/run-session-http.ts +1 -0
- package/src/agents/run-session-serve.ts +23 -2
- package/src/agents/run-session-wire.ts +45 -0
- package/src/agents/run-token.ts +7 -0
- package/src/agents/thread-access.ts +34 -1
- package/src/agents/tool-files.ts +23 -7
- package/src/artifacts/caller.ts +42 -0
- package/src/artifacts/comment-place.ts +51 -0
- package/src/artifacts/comment-text.ts +50 -7
- package/src/artifacts/comments.ts +132 -34
- package/src/artifacts/errors.ts +1 -0
- package/src/artifacts/execution.ts +249 -5
- package/src/artifacts/frames/assets.ts +93 -15
- package/src/artifacts/frames/entries.ts +7 -4
- package/src/artifacts/frames/generated/hyperframes-notices.txt +290 -0
- package/src/artifacts/frames/generated/hyperframes.txt +1145 -0
- package/src/artifacts/frames/generated.d.ts +5 -0
- package/src/artifacts/frames/hyperframes.ts +14 -0
- package/src/artifacts/frames/index.ts +5 -0
- package/src/artifacts/frames/kit.ts +7 -3
- package/src/artifacts/frames/protocol.ts +56 -0
- package/src/artifacts/frames/video-runtime.ts +165 -0
- package/src/artifacts/html.ts +13 -0
- package/src/artifacts/index.ts +7 -0
- package/src/artifacts/kinds.ts +9 -1
- package/src/artifacts/limits.ts +43 -0
- package/src/artifacts/live/document.ts +27 -3
- package/src/artifacts/live/index.ts +58 -2
- package/src/artifacts/live/presence.ts +17 -5
- package/src/artifacts/live/protocol.ts +4 -2
- package/src/artifacts/live/server.ts +1 -1
- package/src/artifacts/live/state.ts +3 -3
- package/src/artifacts/media/README.md +75 -0
- package/src/artifacts/media/media.ts +316 -0
- package/src/artifacts/media/transcriber.ts +84 -0
- package/src/artifacts/outline.ts +28 -0
- package/src/artifacts/publish/files.ts +19 -6
- package/src/artifacts/publish/index.ts +49 -2
- package/src/artifacts/publish/pdf.ts +3 -1
- package/src/artifacts/publish/previews.ts +22 -8
- package/src/artifacts/publish/publish.ts +4 -1
- package/src/artifacts/publish/validate/html.ts +23 -18
- package/src/artifacts/publish/validate/video.ts +309 -0
- package/src/artifacts/publish/video.ts +235 -0
- package/src/artifacts/resolve.ts +45 -0
- package/src/artifacts/video/README.md +402 -0
- package/src/artifacts/video/composition.ts +898 -0
- package/src/artifacts/video/edit.ts +3967 -0
- package/src/artifacts/video/export.ts +352 -0
- package/src/artifacts/video/looks.ts +694 -0
- package/src/artifacts/video/project.ts +198 -0
- package/src/artifacts/video/stills.ts +168 -0
- package/src/artifacts/video/timeline.ts +658 -0
- package/src/blob-storage/browser.ts +1 -1
- package/src/blob-storage/constants.ts +9 -3
- package/src/blob-storage/download-urls.ts +5 -3
- package/src/blob-storage/index.ts +1 -0
- package/src/blob-storage/internal.ts +13 -2
- package/src/blob-storage/media-type.ts +149 -8
- package/src/bootstrap/discovery.ts +61 -11
- package/src/deploy/index.ts +0 -5
- package/src/deploy/types.ts +8 -63
- package/src/deploy/validation.ts +1 -1
- package/src/env/index.ts +10 -4
- package/src/errors/catalog.ts +2 -1
- package/src/execution/authorization.ts +2 -2
- package/src/execution/kernel-operation.ts +14 -0
- package/src/execution/types.ts +2 -0
- package/src/http/api-routes.ts +117 -0
- package/src/index.ts +21 -1
- package/src/lake-storage/definition-updates.ts +3 -9
- package/src/models/audio/runtime.ts +48 -3
- package/src/models/audio/speech.ts +2 -2
- package/src/models/audio/types.ts +24 -3
- package/src/models/calls.ts +35 -18
- package/src/models/catalog.ts +9 -2
- package/src/models/definitions.ts +4 -2
- package/src/models/errors.ts +5 -3
- package/src/models/events.ts +2 -0
- package/src/models/execution/README.md +68 -2
- package/src/models/execution/index.ts +1 -0
- package/src/models/execution/model-call-limits.ts +11 -5
- package/src/models/execution/model-call-recorder.ts +14 -0
- package/src/models/execution/session.ts +52 -23
- package/src/models/execution/usage.ts +1 -0
- package/src/models/execution.ts +13 -2
- package/src/models/generation-types.ts +2 -0
- package/src/models/index.ts +20 -1
- package/src/models/input-file.ts +7 -2
- package/src/models/pricing.ts +19 -1
- package/src/models/rate-card.ts +15 -3
- package/src/models/tools.ts +5 -0
- package/src/models/video/catalog.ts +101 -0
- package/src/models/video/check.ts +441 -0
- package/src/models/video/runtime.ts +550 -0
- package/src/models/video/types.ts +194 -0
- package/src/objects/execution.ts +2 -0
- package/src/objects/sdk/object-set.ts +2 -0
- package/src/queues/index.ts +5 -0
- package/src/queues/types.ts +126 -5
- package/src/runtime/create.ts +1 -0
- package/src/runtime/definitions.ts +25 -0
- package/src/runtime/host.ts +6 -1
- package/src/runtime/index.ts +6 -1
- package/src/runtime/internal.ts +3 -1
- package/src/runtime/resolve-definitions.ts +7 -1
- package/src/runtime/sixb.ts +12 -4
- package/src/sandboxes/README.md +12 -2
- package/src/sandboxes/errors.ts +27 -0
- package/src/sandboxes/exec.ts +3 -1
- package/src/sandboxes/index.ts +3 -0
- package/src/sandboxes/sandbox.ts +15 -1
- package/src/security/public.ts +6 -4
- package/src/storage/agents/in-memory.ts +39 -0
- package/src/storage/agents/index.ts +1 -0
- package/src/storage/agents/provider.ts +8 -0
- package/src/storage/agents/types.ts +32 -1
- package/src/storage/ai-cost/analytics.ts +2 -0
- package/src/storage/ai-cost/codec.ts +1 -0
- package/src/storage/ai-cost/groups.ts +7 -0
- package/src/storage/ai-cost/types.ts +2 -0
- package/src/storage/ai-cost/validation.ts +2 -0
- package/src/storage/ai-usage/in-memory.ts +93 -0
- package/src/storage/ai-usage/index.ts +10 -0
- package/src/storage/ai-usage/record.ts +106 -0
- package/src/storage/ai-usage/types.ts +102 -1
- package/src/storage/ai-usage/usage.ts +2 -0
- package/src/storage/artifacts/in-memory.ts +108 -11
- package/src/storage/artifacts/index.ts +14 -0
- package/src/storage/artifacts/record.ts +203 -1
- package/src/storage/artifacts/types.ts +199 -6
- package/src/storage/executions/validation.ts +2 -2
- package/src/storage/in-memory/index.ts +1 -1
- package/src/storage/index.ts +22 -1
- package/src/storage/internal.ts +9 -0
- package/src/testing/agent-storage-contract.ts +135 -0
- package/src/testing/ai-cost-storage-contract.ts +1 -0
- package/src/testing/ai-usage-storage-contract.ts +145 -1
- package/src/testing/artifact-storage-contract.ts +330 -0
- package/src/testing/execution-storage-contract.ts +10 -2
- package/src/testing/lake-storage-contract.ts +27 -0
- package/src/testing/queues-contract.ts +71 -0
- package/src/testing/sandboxes-contract.ts +50 -0
- package/dist/chunk-3723kgba.js +0 -29
- package/dist/chunk-3723kgba.js.map +0 -10
- package/dist/chunk-3qtk0070.js.map +0 -14
- package/dist/chunk-8ncg20rd.js.map +0 -10
- package/dist/chunk-9vsc919v.js.map +0 -10
- package/dist/chunk-az95tsh3.js.map +0 -11
- package/dist/chunk-c29729me.js.map +0 -12
- package/dist/chunk-d7vyc7k6.js.map +0 -10
- package/dist/chunk-de5sfbc3.js +0 -3
- package/dist/chunk-f05994as.js.map +0 -10
- package/dist/chunk-gfdh9kqa.js.map +0 -11
- package/dist/chunk-jt012fxq.js.map +0 -34
- package/dist/chunk-mbwsgjn7.js.map +0 -11
- package/dist/chunk-nxysqbt0.js.map +0 -10
- package/dist/chunk-qttqe1ah.js.map +0 -24
- package/dist/chunk-sgx82nnt.js.map +0 -10
- package/dist/chunk-vs2s3p8n.js +0 -2274
- package/dist/chunk-vs2s3p8n.js.map +0 -20
- package/dist/chunk-wkv3h3q7.js.map +0 -12
- package/dist/chunk-wzcjhv54.js.map +0 -11
- package/dist/chunk-xtztwpkh.js.map +0 -12
- package/dist/chunk-ym1bqd98.js.map +0 -19
- /package/dist/{chunk-7mhbs9yy.js.map → chunk-1z8ccj53.js.map} +0 -0
- /package/dist/{chunk-dmnd9ea6.js.map → chunk-30a0ftnm.js.map} +0 -0
- /package/dist/{chunk-qbd282aa.js.map → chunk-39q9ybav.js.map} +0 -0
- /package/dist/{chunk-bcz9dxtf.js.map → chunk-3x902cja.js.map} +0 -0
- /package/dist/{chunk-c4nrycdy.js.map → chunk-4q4a5a96.js.map} +0 -0
- /package/dist/{chunk-ykchk644.js.map → chunk-4w8qzy9w.js.map} +0 -0
- /package/dist/{chunk-kft7mp7z.js.map → chunk-5xkqasvn.js.map} +0 -0
- /package/dist/{chunk-xavet0qs.js.map → chunk-6whr25gw.js.map} +0 -0
- /package/dist/{chunk-ygvay56w.js.map → chunk-896te58g.js.map} +0 -0
- /package/dist/{chunk-pqj8vff9.js.map → chunk-8eqqqc1h.js.map} +0 -0
- /package/dist/{chunk-jka26v8c.js.map → chunk-8x1bsp68.js.map} +0 -0
- /package/dist/{chunk-fmgf9h5e.js.map → chunk-9az7kjv4.js.map} +0 -0
- /package/dist/{chunk-bs1sd0e0.js.map → chunk-9p7kyeqz.js.map} +0 -0
- /package/dist/{chunk-brybqw5k.js.map → chunk-bkxm2dzx.js.map} +0 -0
- /package/dist/{chunk-ppxf7gw2.js.map → chunk-d7t9jnym.js.map} +0 -0
- /package/dist/{chunk-cg7cygfj.js.map → chunk-fdmvaz7x.js.map} +0 -0
- /package/dist/{chunk-191jz8a6.js.map → chunk-ff0qdk7z.js.map} +0 -0
- /package/dist/{chunk-wx7smkn2.js.map → chunk-fq8drkp0.js.map} +0 -0
- /package/dist/{chunk-v8a1qjzp.js.map → chunk-hpswfrjj.js.map} +0 -0
- /package/dist/{chunk-bz5bnjjt.js.map → chunk-jjte0h4p.js.map} +0 -0
- /package/dist/{chunk-xrmbhap8.js.map → chunk-mwg0nwkb.js.map} +0 -0
- /package/dist/{chunk-a3faa34j.js.map → chunk-nfjt8k8j.js.map} +0 -0
- /package/dist/{chunk-394zjzjs.js.map → chunk-nhgqz3g3.js.map} +0 -0
- /package/dist/{chunk-92wrka15.js.map → chunk-q150fnj9.js.map} +0 -0
- /package/dist/{chunk-w3t94hm6.js.map → chunk-qk3zq25v.js.map} +0 -0
- /package/dist/{chunk-6hfbz4d0.js.map → chunk-r588h4ev.js.map} +0 -0
- /package/dist/{chunk-5qqmndhm.js.map → chunk-szzhrn3e.js.map} +0 -0
- /package/dist/{chunk-n1hbwc6y.js.map → chunk-t6pfch4e.js.map} +0 -0
- /package/dist/{chunk-brhp9d97.js.map → chunk-vmqjndb3.js.map} +0 -0
- /package/dist/{chunk-5sswe5ej.js.map → chunk-wsv23wvr.js.map} +0 -0
- /package/dist/{chunk-90nqenq8.js.map → chunk-x0hqc54n.js.map} +0 -0
- /package/dist/{chunk-3neam1y5.js.map → chunk-y3qb965a.js.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
isValidFileRef
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2138b0ng.js";
|
|
5
5
|
import {
|
|
6
6
|
isModelReasoning2,
|
|
7
7
|
MODEL_KINDS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-0fjryajn.js";
|
|
9
9
|
import {
|
|
10
10
|
normalizeRequesterGroupIds
|
|
11
11
|
} from "./chunk-9tc8dxmn.js";
|
|
@@ -40,7 +40,8 @@ var AI_USAGE_FIELDS = [
|
|
|
40
40
|
"imageOutputTokens",
|
|
41
41
|
"audioOutputTokens",
|
|
42
42
|
"outputImages",
|
|
43
|
-
"inputCharacters"
|
|
43
|
+
"inputCharacters",
|
|
44
|
+
"outputVideoMs"
|
|
44
45
|
];
|
|
45
46
|
var USAGE_FIELDS = AI_USAGE_FIELDS;
|
|
46
47
|
function normalizeAiModelCallUsage2(input) {
|
|
@@ -63,6 +64,7 @@ function normalizeAiModelCallUsage2(input) {
|
|
|
63
64
|
...input.audioOutputTokens === undefined ? {} : { audioOutputTokens: input.audioOutputTokens },
|
|
64
65
|
...input.outputImages === undefined ? {} : { outputImages: input.outputImages },
|
|
65
66
|
...input.inputCharacters === undefined ? {} : { inputCharacters: input.inputCharacters },
|
|
67
|
+
...input.outputVideoMs === undefined ? {} : { outputVideoMs: input.outputVideoMs },
|
|
66
68
|
reportingStatus
|
|
67
69
|
};
|
|
68
70
|
}
|
|
@@ -172,6 +174,85 @@ function cloneRequestedReasoning(reasoning) {
|
|
|
172
174
|
}
|
|
173
175
|
return typeof reasoning === "string" ? reasoning : { budgetTokens: reasoning.budgetTokens };
|
|
174
176
|
}
|
|
177
|
+
function normalizeAiModelCallOperation2(input) {
|
|
178
|
+
assertNonBlank(input.projectId, "projectId");
|
|
179
|
+
assertNonBlank(input.callId, "callId");
|
|
180
|
+
assertAiUsageExecutionId2(input.executionId);
|
|
181
|
+
assertPositiveSafeInteger(input.attempt, "attempt");
|
|
182
|
+
if (!MODEL_KINDS.includes(input.modelKind)) {
|
|
183
|
+
throw new TypeError("[Sixb] AI model kind is invalid.");
|
|
184
|
+
}
|
|
185
|
+
assertNonBlank(input.providerId, "providerId");
|
|
186
|
+
assertNonBlank(input.modelId, "modelId");
|
|
187
|
+
assertOperationRequest(input.request);
|
|
188
|
+
if (typeof input.reserved !== "boolean") {
|
|
189
|
+
throw new TypeError("[Sixb] AI model-call operation reserved must be a boolean.");
|
|
190
|
+
}
|
|
191
|
+
return {
|
|
192
|
+
projectId: input.projectId,
|
|
193
|
+
callId: input.callId,
|
|
194
|
+
executionId: input.executionId,
|
|
195
|
+
attempt: input.attempt,
|
|
196
|
+
modelKind: input.modelKind,
|
|
197
|
+
providerId: input.providerId,
|
|
198
|
+
modelId: input.modelId,
|
|
199
|
+
request: structuredClone(input.request),
|
|
200
|
+
reserved: input.reserved,
|
|
201
|
+
status: "pending",
|
|
202
|
+
createdAt: cloneValidDate(input.createdAt ?? new Date, "createdAt")
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function normalizeAiModelCallStart2(input) {
|
|
206
|
+
assertNonBlank(input.projectId, "projectId");
|
|
207
|
+
assertNonBlank(input.callId, "callId");
|
|
208
|
+
if (input.operation === null || input.operation === undefined) {
|
|
209
|
+
throw new TypeError("[Sixb] AI model-call operation handle is required.");
|
|
210
|
+
}
|
|
211
|
+
assertJsonValue2(input.operation, "AI model-call operation");
|
|
212
|
+
assertOperationRequest(input.request);
|
|
213
|
+
return {
|
|
214
|
+
projectId: input.projectId,
|
|
215
|
+
callId: input.callId,
|
|
216
|
+
operation: structuredClone(input.operation),
|
|
217
|
+
request: structuredClone(input.request)
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function normalizeAiModelCallOperationResult2(input) {
|
|
221
|
+
assertNonBlank(input.projectId, "projectId");
|
|
222
|
+
assertNonBlank(input.callId, "callId");
|
|
223
|
+
assertOperationResult(input.result);
|
|
224
|
+
return { projectId: input.projectId, callId: input.callId, result: structuredClone(input.result) };
|
|
225
|
+
}
|
|
226
|
+
function assertOperationResult(result) {
|
|
227
|
+
if (!isPlainRecord(result)) {
|
|
228
|
+
throw new TypeError("[Sixb] AI model-call operation result must be a JSON object.");
|
|
229
|
+
}
|
|
230
|
+
assertJsonValue2(result, "AI model-call operation result");
|
|
231
|
+
}
|
|
232
|
+
function assertOperationRequest(request) {
|
|
233
|
+
if (!isPlainRecord(request)) {
|
|
234
|
+
throw new TypeError("[Sixb] AI model-call operation request must be a JSON object.");
|
|
235
|
+
}
|
|
236
|
+
assertJsonValue2(request, "AI model-call operation request");
|
|
237
|
+
}
|
|
238
|
+
function normalizeAiModelCallSettlement2(input) {
|
|
239
|
+
assertNonBlank(input.projectId, "projectId");
|
|
240
|
+
assertNonBlank(input.callId, "callId");
|
|
241
|
+
if (input.status !== "completed" && input.status !== "failed") {
|
|
242
|
+
throw new TypeError("[Sixb] AI model-call operation status must be 'completed' or 'failed'.");
|
|
243
|
+
}
|
|
244
|
+
if (input.error !== undefined)
|
|
245
|
+
assertNonBlank(input.error, "operation error");
|
|
246
|
+
assertOperationResult(input.result);
|
|
247
|
+
return {
|
|
248
|
+
projectId: input.projectId,
|
|
249
|
+
callId: input.callId,
|
|
250
|
+
status: input.status,
|
|
251
|
+
...input.error === undefined ? {} : { error: input.error },
|
|
252
|
+
result: structuredClone(input.result),
|
|
253
|
+
settledAt: cloneValidDate(input.settledAt ?? new Date, "settledAt")
|
|
254
|
+
};
|
|
255
|
+
}
|
|
175
256
|
function assertAiUsageExecutionId2(executionId) {
|
|
176
257
|
assertNonBlank(executionId, "executionId");
|
|
177
258
|
}
|
|
@@ -201,6 +282,6 @@ function cloneValidDate(value, field) {
|
|
|
201
282
|
return new Date(value);
|
|
202
283
|
}
|
|
203
284
|
|
|
204
|
-
export { AiUsageStorageError2, AI_USAGE_FIELDS, normalizeAiModelCallUsage2, aggregateAiModelCallUsage2, normalizeAiModelCallRecord2, normalizeAiModelCallFilesRecord2, assertSameCallExecution2, assertAiUsageExecutionId2 };
|
|
285
|
+
export { AiUsageStorageError2, AI_USAGE_FIELDS, normalizeAiModelCallUsage2, aggregateAiModelCallUsage2, normalizeAiModelCallRecord2, normalizeAiModelCallFilesRecord2, assertSameCallExecution2, normalizeAiModelCallOperation2, normalizeAiModelCallStart2, normalizeAiModelCallOperationResult2, normalizeAiModelCallSettlement2, assertAiUsageExecutionId2 };
|
|
205
286
|
|
|
206
|
-
//# debugId=
|
|
287
|
+
//# debugId=1D89B2A9608AFE1664756E2164756E21
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/storage/ai-usage/errors.ts", "../src/storage/ai-usage/usage.ts", "../src/storage/ai-usage/record.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"export type AiUsageStorageErrorCode = \"duplicate_id\" | \"missing_execution\"\n\n/** Storage failure specific to the AI model-call usage ledger. */\nexport class AiUsageStorageError extends Error {\n readonly name = \"AiUsageStorageError\"\n\n constructor(\n readonly code: AiUsageStorageErrorCode,\n message: string\n ) {\n super(message)\n }\n}\n",
|
|
6
|
+
"import type { AiModelCallUsage, AiModelCallUsageInput } from \"./types\"\n\n/** Every count a model call can report. */\nexport const AI_USAGE_FIELDS = [\n \"inputTokens\",\n \"outputTokens\",\n \"uncachedInputTokens\",\n \"cacheReadInputTokens\",\n \"cacheWriteInputTokens\",\n \"textOutputTokens\",\n \"reasoningOutputTokens\",\n \"audioDurationMs\",\n \"imageOutputTokens\",\n \"audioOutputTokens\",\n \"outputImages\",\n \"inputCharacters\",\n \"outputVideoMs\",\n] as const\nconst USAGE_FIELDS = AI_USAGE_FIELDS\n\ntype AiUsageField = (typeof USAGE_FIELDS)[number]\n\n/** Validate provider-neutral counts and derive total/reporting fields without inventing zeroes. */\nexport function normalizeAiModelCallUsage(input: AiModelCallUsageInput): AiModelCallUsage {\n for (const field of USAGE_FIELDS) {\n assertUsageCount(input[field], field)\n }\n\n const totalTokens =\n input.inputTokens === undefined || input.outputTokens === undefined\n ? undefined\n : addUsageCounts(input.inputTokens, input.outputTokens, \"totalTokens\")\n const reportingStatus =\n input.inputTokens !== undefined && input.outputTokens !== undefined\n ? \"complete\"\n : USAGE_FIELDS.some((field) => input[field] !== undefined)\n ? \"partial\"\n : \"unavailable\"\n\n return {\n ...(input.audioDurationMs === undefined ? {} : { audioDurationMs: input.audioDurationMs }),\n ...(input.inputTokens === undefined ? {} : { inputTokens: input.inputTokens }),\n ...(input.outputTokens === undefined ? {} : { outputTokens: input.outputTokens }),\n ...(totalTokens === undefined ? {} : { totalTokens }),\n ...(input.uncachedInputTokens === undefined\n ? {}\n : { uncachedInputTokens: input.uncachedInputTokens }),\n ...(input.cacheReadInputTokens === undefined\n ? {}\n : { cacheReadInputTokens: input.cacheReadInputTokens }),\n ...(input.cacheWriteInputTokens === undefined\n ? {}\n : { cacheWriteInputTokens: input.cacheWriteInputTokens }),\n ...(input.textOutputTokens === undefined ? {} : { textOutputTokens: input.textOutputTokens }),\n ...(input.reasoningOutputTokens === undefined\n ? {}\n : { reasoningOutputTokens: input.reasoningOutputTokens }),\n ...(input.imageOutputTokens === undefined\n ? {}\n : { imageOutputTokens: input.imageOutputTokens }),\n ...(input.audioOutputTokens === undefined\n ? {}\n : { audioOutputTokens: input.audioOutputTokens }),\n ...(input.outputImages === undefined ? {} : { outputImages: input.outputImages }),\n ...(input.inputCharacters === undefined ? {} : { inputCharacters: input.inputCharacters }),\n ...(input.outputVideoMs === undefined ? {} : { outputVideoMs: input.outputVideoMs }),\n reportingStatus,\n }\n}\n\n/**\n * Aggregate model-call usage without treating a missing count as zero.\n *\n * A field is present only when every call reported it. This prevents a partial provider response\n * from becoming an apparently complete execution total. Zero remains a reported value.\n */\nexport function aggregateAiModelCallUsage(\n usages: Iterable<AiModelCallUsageInput>\n): AiModelCallUsage {\n const normalized = Array.from(usages, normalizeAiModelCallUsage)\n const fields = Object.fromEntries(\n USAGE_FIELDS.map((field) => [field, sumUsageField(normalized, field)])\n ) as Record<AiUsageField, number | undefined>\n const aggregate = normalizeAiModelCallUsage(fields)\n\n if (\n aggregate.reportingStatus === \"unavailable\" &&\n normalized.some((usage) => usage.reportingStatus !== \"unavailable\")\n ) {\n return { ...aggregate, reportingStatus: \"partial\" }\n }\n return aggregate\n}\n\nfunction sumUsageField(\n usages: readonly AiModelCallUsage[],\n field: AiUsageField\n): number | undefined {\n if (usages.length === 0) return undefined\n\n let total = 0\n for (const usage of usages) {\n const value = usage[field]\n if (value === undefined) return undefined\n total = addUsageCounts(total, value, `aggregate ${field}`)\n }\n return total\n}\n\nfunction assertUsageCount(value: number | undefined, field: AiUsageField): void {\n if (value !== undefined && (!Number.isSafeInteger(value) || value < 0)) {\n throw new TypeError(`[Sixb] AI model-call usage ${field} must be a non-negative safe integer.`)\n }\n}\n\nfunction addUsageCounts(left: number, right: number, field: string): number {\n const result = left + right\n if (!Number.isSafeInteger(result)) {\n throw new TypeError(`[Sixb] AI model-call usage ${field} exceeds the safe integer range.`)\n }\n return result\n}\n",
|
|
7
|
+
"import { normalizeRequesterGroupIds } from \"../../auth/attribution\"\nimport { isValidFileRef } from \"../../blob-storage/validation\"\nimport { assertJsonValue, isPlainRecord } from \"../../json\"\nimport { MODEL_KINDS } from \"../../models/definitions\"\nimport { normalizeModelProviderIds } from \"../../models/events\"\nimport { isModelReasoning } from \"../../models/language-model\"\nimport { AiUsageStorageError } from \"./errors\"\nimport type {\n AiModelCallFilesRecord,\n AiModelCallOperationRecord,\n AiModelCallUsageRecord,\n CreateAiModelCallOperationInput,\n RecordAiModelCallFilesInput,\n RecordAiModelCallInput,\n RecordAiModelCallOperationResultInput,\n SettleAiModelCallOperationInput,\n StartAiModelCallOperationInput,\n} from \"./types\"\nimport { normalizeAiModelCallUsage } from \"./usage\"\n\n/** Validate and defensively snapshot one provider-neutral model-call ledger input. */\nexport function normalizeAiModelCallRecord(input: RecordAiModelCallInput): AiModelCallUsageRecord {\n assertNonBlank(input.id, \"id\")\n assertNonBlank(input.projectId, \"projectId\")\n assertAiUsageExecutionId(input.executionId)\n assertPositiveSafeInteger(input.attempt, \"attempt\")\n assertNonBlank(input.callId, \"callId\")\n assertNonBlank(input.providerId, \"providerId\")\n assertNonBlank(input.requestedModelId, \"requestedModelId\")\n if (input.responseModelId !== undefined) {\n assertNonBlank(input.responseModelId, \"responseModelId\")\n }\n assertNonBlank(input.responseId, \"responseId\")\n\n if (input.modelKind !== undefined && !MODEL_KINDS.includes(input.modelKind)) {\n throw new TypeError(\"[Sixb] AI model kind is invalid.\")\n }\n const occurredAt = cloneValidDate(input.occurredAt, \"occurredAt\")\n const recordedAt = cloneValidDate(input.recordedAt ?? new Date(), \"recordedAt\")\n const requesterGroupIds = normalizeRequesterGroupIds(input.requesterGroupIds)\n const requestedReasoning = cloneRequestedReasoning(input.requestedReasoning)\n const rawUsage = cloneRawUsage(input.rawUsage)\n\n return {\n id: input.id,\n projectId: input.projectId,\n executionId: input.executionId,\n attempt: input.attempt,\n callId: input.callId,\n requesterGroupIds,\n providerId: input.providerId,\n ...(input.providerIds === undefined\n ? {}\n : { providerIds: normalizeModelProviderIds(input.providerIds) }),\n requestedModelId: input.requestedModelId,\n ...(input.modelKind === undefined ? {} : { modelKind: input.modelKind }),\n ...(requestedReasoning === undefined ? {} : { requestedReasoning }),\n ...(input.responseModelId === undefined ? {} : { responseModelId: input.responseModelId }),\n responseId: input.responseId,\n usage: normalizeAiModelCallUsage(input.usage),\n ...(rawUsage === undefined ? {} : { rawUsage }),\n occurredAt,\n recordedAt,\n }\n}\n\n/** Validate and defensively snapshot the files one model call produced. */\nexport function normalizeAiModelCallFilesRecord(\n input: RecordAiModelCallFilesInput\n): AiModelCallFilesRecord {\n assertNonBlank(input.projectId, \"projectId\")\n assertAiUsageExecutionId(input.executionId)\n assertNonBlank(input.callId, \"callId\")\n if (!Array.isArray(input.files) || input.files.length === 0) {\n throw new TypeError(\"[Sixb] AI model-call files must be a nonempty array.\")\n }\n if (!input.files.every(isValidFileRef)) {\n throw new TypeError(\"[Sixb] AI model-call files must be valid FileRefs.\")\n }\n return {\n projectId: input.projectId,\n executionId: input.executionId,\n callId: input.callId,\n files: structuredClone(input.files),\n recordedAt: cloneValidDate(input.recordedAt ?? new Date(), \"recordedAt\"),\n }\n}\n\n/** A call's files belong to the execution that first recorded them. */\nexport function assertSameCallExecution(\n existing: AiModelCallFilesRecord,\n input: Pick<AiModelCallFilesRecord, \"executionId\" | \"callId\">\n): AiModelCallFilesRecord {\n if (existing.executionId === input.executionId) return existing\n throw new AiUsageStorageError(\n \"duplicate_id\",\n `[Sixb] AI model call '${input.callId}' already has files from another execution.`\n )\n}\n\nfunction cloneRequestedReasoning(\n reasoning: RecordAiModelCallInput[\"requestedReasoning\"]\n): RecordAiModelCallInput[\"requestedReasoning\"] {\n if (reasoning === undefined) return undefined\n if (!isModelReasoning(reasoning)) {\n throw new TypeError(\"[Sixb] AI usage requestedReasoning is invalid.\")\n }\n return typeof reasoning === \"string\" ? reasoning : { budgetTokens: reasoning.budgetTokens }\n}\n\n/** Validate and defensively snapshot a call about to start, before the provider has it. */\nexport function normalizeAiModelCallOperation(\n input: CreateAiModelCallOperationInput\n): AiModelCallOperationRecord {\n assertNonBlank(input.projectId, \"projectId\")\n assertNonBlank(input.callId, \"callId\")\n assertAiUsageExecutionId(input.executionId)\n assertPositiveSafeInteger(input.attempt, \"attempt\")\n if (!MODEL_KINDS.includes(input.modelKind)) {\n throw new TypeError(\"[Sixb] AI model kind is invalid.\")\n }\n assertNonBlank(input.providerId, \"providerId\")\n assertNonBlank(input.modelId, \"modelId\")\n\n assertOperationRequest(input.request)\n if (typeof input.reserved !== \"boolean\") {\n throw new TypeError(\"[Sixb] AI model-call operation reserved must be a boolean.\")\n }\n\n return {\n projectId: input.projectId,\n callId: input.callId,\n executionId: input.executionId,\n attempt: input.attempt,\n modelKind: input.modelKind,\n providerId: input.providerId,\n modelId: input.modelId,\n request: structuredClone(input.request),\n reserved: input.reserved,\n status: \"pending\",\n createdAt: cloneValidDate(input.createdAt ?? new Date(), \"createdAt\"),\n }\n}\n\n/** Validate the handle of a call the provider accepted. */\nexport function normalizeAiModelCallStart(\n input: StartAiModelCallOperationInput\n): StartAiModelCallOperationInput {\n assertNonBlank(input.projectId, \"projectId\")\n assertNonBlank(input.callId, \"callId\")\n if (input.operation === null || input.operation === undefined) {\n throw new TypeError(\"[Sixb] AI model-call operation handle is required.\")\n }\n assertJsonValue(input.operation, \"AI model-call operation\")\n assertOperationRequest(input.request)\n\n return {\n projectId: input.projectId,\n callId: input.callId,\n operation: structuredClone(input.operation),\n request: structuredClone(input.request),\n }\n}\n\n/** Validate what a pending call reported once it is in the ledger. */\nexport function normalizeAiModelCallOperationResult(\n input: RecordAiModelCallOperationResultInput\n): RecordAiModelCallOperationResultInput {\n assertNonBlank(input.projectId, \"projectId\")\n assertNonBlank(input.callId, \"callId\")\n assertOperationResult(input.result)\n\n return { projectId: input.projectId, callId: input.callId, result: structuredClone(input.result) }\n}\n\nfunction assertOperationResult(result: unknown): void {\n if (!isPlainRecord(result)) {\n throw new TypeError(\"[Sixb] AI model-call operation result must be a JSON object.\")\n }\n assertJsonValue(result, \"AI model-call operation result\")\n}\n\nfunction assertOperationRequest(request: unknown): void {\n if (!isPlainRecord(request)) {\n throw new TypeError(\"[Sixb] AI model-call operation request must be a JSON object.\")\n }\n assertJsonValue(request, \"AI model-call operation request\")\n}\n\n/** Validate how a running call ended. */\nexport function normalizeAiModelCallSettlement(\n input: SettleAiModelCallOperationInput\n): Required<Omit<SettleAiModelCallOperationInput, \"error\">> & { readonly error?: string } {\n assertNonBlank(input.projectId, \"projectId\")\n assertNonBlank(input.callId, \"callId\")\n if (input.status !== \"completed\" && input.status !== \"failed\") {\n throw new TypeError(\"[Sixb] AI model-call operation status must be 'completed' or 'failed'.\")\n }\n if (input.error !== undefined) assertNonBlank(input.error, \"operation error\")\n assertOperationResult(input.result)\n\n return {\n projectId: input.projectId,\n callId: input.callId,\n status: input.status,\n ...(input.error === undefined ? {} : { error: input.error }),\n result: structuredClone(input.result),\n settledAt: cloneValidDate(input.settledAt ?? new Date(), \"settledAt\"),\n }\n}\n\n/** Validate a durable execution reference at storage and query boundaries. */\nexport function assertAiUsageExecutionId(executionId: string): void {\n assertNonBlank(executionId, \"executionId\")\n}\n\nfunction cloneRawUsage(rawUsage: RecordAiModelCallInput[\"rawUsage\"]) {\n if (rawUsage === undefined) return undefined\n if (!isPlainRecord(rawUsage)) {\n throw new TypeError(\"[Sixb] AI usage rawUsage must be a JSON object.\")\n }\n assertJsonValue(rawUsage, \"AI usage rawUsage\")\n return structuredClone(rawUsage)\n}\n\nfunction assertNonBlank(value: string, field: string): void {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new TypeError(`[Sixb] AI usage ${field} must be nonblank.`)\n }\n}\n\nfunction assertPositiveSafeInteger(value: number, field: string): void {\n if (!Number.isSafeInteger(value) || value <= 0) {\n throw new TypeError(`[Sixb] AI usage ${field} must be a positive safe integer.`)\n }\n}\n\nfunction cloneValidDate(value: Date, field: string): Date {\n if (!(value instanceof Date) || !Number.isFinite(value.getTime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A;",
|
|
10
|
+
"debugId": "1D89B2A9608AFE1664756E2164756E21",
|
|
11
|
+
"names": []
|
|
12
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ProjectionValidationError2
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-e3b1r4d2.js";
|
|
5
5
|
import {
|
|
6
6
|
sha256Canonical2
|
|
7
7
|
} from "./chunk-zrvhsq7f.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-5rqqp8cr.js";
|
|
13
13
|
import {
|
|
14
14
|
createPrimitiveExecutionRecord
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-6whr25gw.js";
|
|
16
16
|
import {
|
|
17
17
|
findPrimitiveRunExecution
|
|
18
18
|
} from "./chunk-ey1nk510.js";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/artifacts/live/protocol.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"// The `/ws/artifacts` socket: JSON messages, each about one artifact the connection joined, with\n// Yjs's own messages inside in base64. `sync` carries y-protocols' sync messages (step 1, step 2,\n// update), `awareness` its awareness updates. A client joins, sends sync step 1, applies what it\n// is sent, and sends its document's updates and its awareness as they happen.\n//\n// Every copy of an artifact's document, a client's or a server's, continues the history storage\n// keeps, so a client that reconnects, to any server, syncs what it changed while away.\n\n/** Where an artifact is edited live. */\nexport const ARTIFACT_LIVE_ROUTE = \"/ws/artifacts\"\n\n/** What a connection may do with an artifact it joined: edit it, or watch others edit it. */\nexport type ArtifactLiveAccess = \"edit\" | \"watch\"\n\n/** The most bytes one `sync` message carries: a larger one is sent in parts, as {@link liveSync} splits it. */\nexport const LIVE_SYNC_PART_BYTES = 32 * 1024\n\nexport type ArtifactLiveClientMessage =\n | { readonly type: \"join\"; readonly artifactId: string }\n | { readonly type: \"leave\"; readonly artifactId: string }\n | {\n readonly type: \"sync\"\n readonly artifactId: string\n readonly data: string\n /** The message goes on in the next `sync`, whose bytes follow these. */\n readonly more?: true\n }\n | { readonly type: \"awareness\"; readonly artifactId: string; readonly data: string }\n\n/**\n * What the server's copy of the document has written back into the open version: `saved` at\n * `revision`, `unsaved` changes waiting, `saving`, or `failed` with why, until the next attempt.\n */\nexport type ArtifactLiveSaveState = \"saved\" | \"unsaved\" | \"saving\" | \"failed\"\n\n/** Why a connection no longer holds an artifact. */\nexport type ArtifactLiveLeftReason = \"not_found\" | \"not_shared\" | \"not_live\" | \"left\"\n\nexport type ArtifactLiveServerMessage =\n | { readonly type: \"connected\"; readonly channel: \"artifacts\" }\n | {\n readonly type: \"joined\"\n readonly artifactId: string\n readonly access: ArtifactLiveAccess\n readonly revision: number\n /** Who the connection is in the awareness states the server shares. */\n readonly user: ArtifactLiveUser\n }\n | { readonly type: \"sync\"; readonly artifactId: string; readonly data: string }\n | { readonly type: \"awareness\"; readonly artifactId: string; readonly data: string }\n | {\n readonly type: \"status\"\n readonly artifactId: string\n readonly state: ArtifactLiveSaveState\n readonly revision: number\n /**\n * What is written back, as a Yjs snapshot in base64: its state vector and its delete set. A\n * client forgets the changes it kept once this covers them, insertions and deletions, and\n * keeps those it does not, as one sent while this was being written.\n */\n readonly snapshot: string\n readonly error?: string\n /**\n * Publishing refused what the document holds: nothing tries it again until someone changes\n * it.\n */\n readonly refused?: true\n }\n /** The connection may now only watch: the person lost the right to change the artifact. */\n | { readonly type: \"access\"; readonly artifactId: string; readonly access: ArtifactLiveAccess }\n | { readonly type: \"left\"; readonly artifactId: string; readonly reason: ArtifactLiveLeftReason }\n | { readonly type: \"error\"; readonly artifactId?: string; readonly message: string }\n\n/**\n * Who a connection is, as the server says in each awareness state it shares as `user`: whatever\n * a client sets there itself is replaced.\n */\nexport interface ArtifactLiveUser {\n readonly id: string\n /** Their profile's name, or the one a guest gave; empty for someone who gave none. */\n readonly name: string\n /** A color for the person's cursor and selection, the same wherever they connect. */\n readonly color: string\n /** A shared link's visitor, without an account: the name is only what they typed. */\n readonly guest?: true\n}\n\n/** The awareness field that names who an awareness state is. */\nexport const USER_AWARENESS_FIELD = \"user\"\n\n/**\n * The awareness field the server sets for the Agent while a turn changes boards of
|
|
5
|
+
"// The `/ws/artifacts` socket: JSON messages, each about one artifact the connection joined, with\n// Yjs's own messages inside in base64. `sync` carries y-protocols' sync messages (step 1, step 2,\n// update), `awareness` its awareness updates. A client joins, sends sync step 1, applies what it\n// is sent, and sends its document's updates and its awareness as they happen.\n//\n// Every copy of an artifact's document, a client's or a server's, continues the history storage\n// keeps, so a client that reconnects, to any server, syncs what it changed while away.\n\n/** Where an artifact is edited live. */\nexport const ARTIFACT_LIVE_ROUTE = \"/ws/artifacts\"\n\n/** What a connection may do with an artifact it joined: edit it, or watch others edit it. */\nexport type ArtifactLiveAccess = \"edit\" | \"watch\"\n\n/** The most bytes one `sync` message carries: a larger one is sent in parts, as {@link liveSync} splits it. */\nexport const LIVE_SYNC_PART_BYTES = 32 * 1024\n\nexport type ArtifactLiveClientMessage =\n | { readonly type: \"join\"; readonly artifactId: string }\n | { readonly type: \"leave\"; readonly artifactId: string }\n | {\n readonly type: \"sync\"\n readonly artifactId: string\n readonly data: string\n /** The message goes on in the next `sync`, whose bytes follow these. */\n readonly more?: true\n }\n | { readonly type: \"awareness\"; readonly artifactId: string; readonly data: string }\n\n/**\n * What the server's copy of the document has written back into the open version: `saved` at\n * `revision`, `unsaved` changes waiting, `saving`, or `failed` with why, until the next attempt.\n */\nexport type ArtifactLiveSaveState = \"saved\" | \"unsaved\" | \"saving\" | \"failed\"\n\n/** Why a connection no longer holds an artifact. */\nexport type ArtifactLiveLeftReason = \"not_found\" | \"not_shared\" | \"not_live\" | \"left\"\n\nexport type ArtifactLiveServerMessage =\n | { readonly type: \"connected\"; readonly channel: \"artifacts\" }\n | {\n readonly type: \"joined\"\n readonly artifactId: string\n readonly access: ArtifactLiveAccess\n readonly revision: number\n /** Who the connection is in the awareness states the server shares. */\n readonly user: ArtifactLiveUser\n }\n | { readonly type: \"sync\"; readonly artifactId: string; readonly data: string }\n | { readonly type: \"awareness\"; readonly artifactId: string; readonly data: string }\n | {\n readonly type: \"status\"\n readonly artifactId: string\n readonly state: ArtifactLiveSaveState\n readonly revision: number\n /**\n * What is written back, as a Yjs snapshot in base64: its state vector and its delete set. A\n * client forgets the changes it kept once this covers them, insertions and deletions, and\n * keeps those it does not, as one sent while this was being written.\n */\n readonly snapshot: string\n readonly error?: string\n /**\n * Publishing refused what the document holds: nothing tries it again until someone changes\n * it.\n */\n readonly refused?: true\n }\n /** The connection may now only watch: the person lost the right to change the artifact. */\n | { readonly type: \"access\"; readonly artifactId: string; readonly access: ArtifactLiveAccess }\n | { readonly type: \"left\"; readonly artifactId: string; readonly reason: ArtifactLiveLeftReason }\n | { readonly type: \"error\"; readonly artifactId?: string; readonly message: string }\n\n/**\n * Who a connection is, as the server says in each awareness state it shares as `user`: whatever\n * a client sets there itself is replaced.\n */\nexport interface ArtifactLiveUser {\n readonly id: string\n /** Their profile's name, or the one a guest gave; empty for someone who gave none. */\n readonly name: string\n /** A color for the person's cursor and selection, the same wherever they connect. */\n readonly color: string\n /** A shared link's visitor, without an account: the name is only what they typed. */\n readonly guest?: true\n}\n\n/** The awareness field that names who an awareness state is. */\nexport const USER_AWARENESS_FIELD = \"user\"\n\n/**\n * The awareness field the server sets for the Agent while a turn changes boards of a canvas, or\n * scenes of a video: each turn at work, with the boards or scenes it changed. A client's own state\n * never holds it.\n */\nexport const AGENT_AWARENESS_FIELD = \"sixbAgent\"\n\nexport interface ArtifactAgentPresence {\n readonly runId: string\n /** The boards it changed, by id; for a video, its scenes. */\n readonly boards: readonly string[]\n}\n\n/**\n * A y-protocols sync message as the `sync` messages that carry it: one, or parts for one larger\n * than a socket message may be.\n */\nexport function liveSync(artifactId: string, bytes: Uint8Array): ArtifactLiveClientMessage[] {\n const messages: ArtifactLiveClientMessage[] = []\n for (let start = 0; start === 0 || start < bytes.length; start += LIVE_SYNC_PART_BYTES) {\n const end = start + LIVE_SYNC_PART_BYTES\n const data = encodeLiveData(bytes.subarray(start, end))\n messages.push(\n end < bytes.length\n ? { type: \"sync\", artifactId, data, more: true }\n : { type: \"sync\", artifactId, data }\n )\n }\n return messages\n}\n\n/** Bytes as the socket carries them. */\nexport function encodeLiveData(bytes: Uint8Array): string {\n let binary = \"\"\n for (let index = 0; index < bytes.length; index += 0x8000) {\n binary += String.fromCharCode(...bytes.subarray(index, index + 0x8000))\n }\n return btoa(binary)\n}\n\n/** The bytes the socket carried; null for text that is not base64. */\nexport function decodeLiveData(data: string): Uint8Array | null {\n try {\n const binary = atob(data)\n const bytes = new Uint8Array(binary.length)\n for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index)\n return bytes\n } catch {\n return null\n }\n}\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": ";;AASO,IAAM,uBAAsB;AAM5B,IAAM,wBAAuB,KAAK;AAyElC,IAAM,wBAAuB;
|
|
7
|
+
"mappings": ";;AASO,IAAM,uBAAsB;AAM5B,IAAM,wBAAuB,KAAK;AAyElC,IAAM,wBAAuB;AAO7B,IAAM,yBAAwB;AAY9B,SAAS,SAAQ,CAAC,YAAoB,OAAgD;AAAA,EAC3F,MAAM,WAAwC,CAAC;AAAA,EAC/C,SAAS,QAAQ,EAAG,UAAU,KAAK,QAAQ,MAAM,QAAQ,SAAS,uBAAsB;AAAA,IACtF,MAAM,MAAM,QAAQ;AAAA,IACpB,MAAM,OAAO,gBAAe,MAAM,SAAS,OAAO,GAAG,CAAC;AAAA,IACtD,SAAS,KACP,MAAM,MAAM,SACR,EAAE,MAAM,QAAQ,YAAY,MAAM,MAAM,KAAK,IAC7C,EAAE,MAAM,QAAQ,YAAY,KAAK,CACvC;AAAA,EACF;AAAA,EACA,OAAO;AAAA;AAIF,SAAS,eAAc,CAAC,OAA2B;AAAA,EACxD,IAAI,SAAS;AAAA,EACb,SAAS,QAAQ,EAAG,QAAQ,MAAM,QAAQ,SAAS,OAAQ;AAAA,IACzD,UAAU,OAAO,aAAa,GAAG,MAAM,SAAS,OAAO,QAAQ,KAAM,CAAC;AAAA,EACxE;AAAA,EACA,OAAO,KAAK,MAAM;AAAA;AAIb,SAAS,eAAc,CAAC,MAAiC;AAAA,EAC9D,IAAI;AAAA,IACF,MAAM,SAAS,KAAK,IAAI;AAAA,IACxB,MAAM,QAAQ,IAAI,WAAW,OAAO,MAAM;AAAA,IAC1C,SAAS,QAAQ,EAAG,QAAQ,OAAO,QAAQ,SAAS;AAAA,MAAG,MAAM,SAAS,OAAO,WAAW,KAAK;AAAA,IAC7F,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA;AAAA;",
|
|
8
8
|
"debugId": "5D33068BC06B91C264756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
isWorkflowDefinition2
|
|
4
|
+
} from "./chunk-as94vcty.js";
|
|
2
5
|
import {
|
|
3
6
|
isActionDefinition2,
|
|
4
7
|
ShareDefinitionError2,
|
|
5
8
|
isShareDefinition,
|
|
6
9
|
snapshotShareDefinition
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-nhgqz3g3.js";
|
|
8
11
|
import {
|
|
9
12
|
isProjectionDefinition2
|
|
10
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-e3b1r4d2.js";
|
|
11
14
|
import {
|
|
12
15
|
isMarkingDefinition,
|
|
13
16
|
isGroupDefinition,
|
|
14
17
|
isMembershipPolicyDefinition,
|
|
15
18
|
isRoleDefinition
|
|
16
19
|
} from "./chunk-frsz8wxd.js";
|
|
17
|
-
import {
|
|
18
|
-
isWorkflowDefinition2
|
|
19
|
-
} from "./chunk-ats8y3d9.js";
|
|
20
20
|
import {
|
|
21
21
|
isDatasetDefinition2
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-fq8drkp0.js";
|
|
23
23
|
import {
|
|
24
24
|
isPipelineDefinition2
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-q150fnj9.js";
|
|
26
26
|
import {
|
|
27
27
|
assertPredicateShape,
|
|
28
28
|
createPropertyPredicateBuilder,
|
|
@@ -34,10 +34,10 @@ import {
|
|
|
34
34
|
} from "./chunk-dvgc56n2.js";
|
|
35
35
|
import {
|
|
36
36
|
isSyncDefinition2
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-3x902cja.js";
|
|
38
38
|
import {
|
|
39
39
|
compileShareAccessPlan
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-39q9ybav.js";
|
|
41
41
|
import {
|
|
42
42
|
RuntimeError2
|
|
43
43
|
} from "./chunk-m4ehq95f.js";
|
|
@@ -305,7 +305,7 @@ function instructionsError(message) {
|
|
|
305
305
|
// src/bootstrap/discovery.ts
|
|
306
306
|
import { AsyncLocalStorage } from "async_hooks";
|
|
307
307
|
import { readdir as readdir2 } from "fs/promises";
|
|
308
|
-
import { join as join2, relative as relative2, resolve, sep as sep2 } from "path";
|
|
308
|
+
import { join as join2, posix, relative as relative2, resolve, sep as sep2 } from "path";
|
|
309
309
|
import { pathToFileURL } from "url";
|
|
310
310
|
|
|
311
311
|
// src/rules/errors.ts
|
|
@@ -486,6 +486,7 @@ async function discoverOntologySources(projectRoot) {
|
|
|
486
486
|
const objectTypes = [];
|
|
487
487
|
const valueTypes = [];
|
|
488
488
|
const modules = [];
|
|
489
|
+
const folders = new DefinitionFolderCollector;
|
|
489
490
|
const seen = new Set;
|
|
490
491
|
for (const loaded of loadedModules) {
|
|
491
492
|
const objectTypeIds = [];
|
|
@@ -508,10 +509,10 @@ async function discoverOntologySources(projectRoot) {
|
|
|
508
509
|
valueTypes.push(candidate);
|
|
509
510
|
}
|
|
510
511
|
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
});
|
|
512
|
+
const path = toPosix(relative2("ontology", loaded.path));
|
|
513
|
+
for (const id of objectTypeIds)
|
|
514
|
+
folders.add(id, path);
|
|
515
|
+
modules.push({ path, objectTypeIds: [...new Set(objectTypeIds)] });
|
|
515
516
|
}
|
|
516
517
|
const discoveredSources = [...ontologyDocuments, ...objectTypes];
|
|
517
518
|
if (valueTypes.length > 0) {
|
|
@@ -522,7 +523,7 @@ async function discoverOntologySources(projectRoot) {
|
|
|
522
523
|
valueTypes
|
|
523
524
|
});
|
|
524
525
|
}
|
|
525
|
-
return { sources: discoveredSources, modules };
|
|
526
|
+
return { sources: discoveredSources, modules, folders: folders.index };
|
|
526
527
|
}
|
|
527
528
|
var bundledProject = new AsyncLocalStorage;
|
|
528
529
|
function withProjectModules2(projectRoot, modules, run) {
|
|
@@ -587,17 +588,50 @@ async function listProjectModules2(projectRoot) {
|
|
|
587
588
|
];
|
|
588
589
|
return (await Promise.all(families.map(({ kind, directory }) => listFamilyModules(projectRoot, kind, directory)))).flat();
|
|
589
590
|
}
|
|
591
|
+
var folderFamilies = new Set(["actions", "connectors", "datasets", "pipelines", "projections", "rules", "syncs", "workflows"]);
|
|
590
592
|
async function discoverProjectDefinitions2(projectRoot) {
|
|
591
593
|
const entries = await Promise.all(Object.entries(definitionDiscoveryRegistry).map(async ([key, family]) => {
|
|
592
|
-
const
|
|
593
|
-
return [key,
|
|
594
|
+
const discovered = await discoverDefinitionFamily(projectRoot, family);
|
|
595
|
+
return [key, discovered];
|
|
594
596
|
}));
|
|
595
|
-
|
|
597
|
+
const folders = Object.fromEntries(entries.filter(([key]) => folderFamilies.has(key)).map(([key, { folders }]) => [key, folders]));
|
|
598
|
+
return {
|
|
599
|
+
...Object.fromEntries(entries.map(([key, { definitions }]) => [key, definitions])),
|
|
600
|
+
folders
|
|
601
|
+
};
|
|
596
602
|
}
|
|
597
603
|
async function discoverDefinitionFamily(projectRoot, family) {
|
|
598
604
|
const loadedModules = await loadFamilyModules(projectRoot, family.kind, family.directory);
|
|
599
605
|
const exportedCandidates = new Set(loadedModules.flatMap((loaded) => loaded.exports));
|
|
600
|
-
|
|
606
|
+
const definitions = [...exportedCandidates].filter(family.isDefinition);
|
|
607
|
+
const isDefinition = new Set(definitions);
|
|
608
|
+
const directory = family.directory.join("/");
|
|
609
|
+
const folders = new DefinitionFolderCollector;
|
|
610
|
+
for (const loaded of loadedModules) {
|
|
611
|
+
const path = posix.relative(directory, toPosix(loaded.path));
|
|
612
|
+
for (const candidate of loaded.exports) {
|
|
613
|
+
if (isDefinition.has(candidate) && hasStringId(candidate))
|
|
614
|
+
folders.add(candidate.id, path);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
return { definitions, folders: folders.index };
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
class DefinitionFolderCollector {
|
|
621
|
+
index = new Map;
|
|
622
|
+
depths = new Map;
|
|
623
|
+
add(id, path) {
|
|
624
|
+
const folder = posix.dirname(path);
|
|
625
|
+
const depth = folder === "." ? 0 : folder.split("/").length;
|
|
626
|
+
if ((this.depths.get(id) ?? -1) >= depth)
|
|
627
|
+
return;
|
|
628
|
+
this.depths.set(id, depth);
|
|
629
|
+
if (depth > 0)
|
|
630
|
+
this.index.set(id, folder);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
function hasStringId(value) {
|
|
634
|
+
return isRecord3(value) && typeof value.id === "string";
|
|
601
635
|
}
|
|
602
636
|
function listOntologyModuleFiles(projectRoot) {
|
|
603
637
|
return listModuleFiles(join2(projectRoot, "ontology"), isOntologyScriptsDirectory);
|
|
@@ -730,4 +764,4 @@ function isValueType(value) {
|
|
|
730
764
|
|
|
731
765
|
export { isAgentContextPath2, discoverOntologyFiles, discoverAgentSkills, discoverProjectInstructions, RuleValidationError2, isRuleDefinition2, validateRulesAtStartup, defineRule2, validateSharesAtStartup, discoverOntologySources, withProjectModules2, listProjectModules2, discoverProjectDefinitions2, listOntologyModuleFiles };
|
|
732
766
|
|
|
733
|
-
//# debugId=
|
|
767
|
+
//# debugId=3BF1E9A014ADF01B64756E2164756E21
|