@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
|
@@ -40,8 +40,8 @@ export interface FileDownloadUrl {
|
|
|
40
40
|
/** What issuing and revoking need from the execution that asks. */
|
|
41
41
|
export interface FileDownloadUrlContext {
|
|
42
42
|
readonly projectId: string
|
|
43
|
-
readonly storage: Storage
|
|
44
|
-
readonly blobStorage: BlobStorage
|
|
43
|
+
readonly storage: Pick<Storage, "fileDownloadGrants">
|
|
44
|
+
readonly blobStorage: Pick<BlobStorage, "stat">
|
|
45
45
|
readonly executionId: string
|
|
46
46
|
readonly apiPublicOrigin: string | undefined
|
|
47
47
|
}
|
|
@@ -119,7 +119,9 @@ function hashToken(token: string): string {
|
|
|
119
119
|
return createHash("sha256").update(token).digest("hex")
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
function requireGrantStorage(
|
|
122
|
+
function requireGrantStorage(
|
|
123
|
+
storage: Pick<Storage, "fileDownloadGrants">
|
|
124
|
+
): FileDownloadGrantStorage {
|
|
123
125
|
if (!storage.fileDownloadGrants) {
|
|
124
126
|
throw new Error("[Sixb] Download URLs require storage.fileDownloadGrants.")
|
|
125
127
|
}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {
|
|
2
|
+
createFileDownloadUrl,
|
|
3
|
+
FILE_DOWNLOAD_ROUTE_PREFIX,
|
|
4
|
+
type FileDownloadUrlContext,
|
|
5
|
+
resolveFileDownload,
|
|
6
|
+
revokeFileDownloadUrl,
|
|
7
|
+
} from "./download-urls"
|
|
2
8
|
export {
|
|
3
9
|
jsonPointerSegment,
|
|
4
10
|
openFileRef,
|
|
5
11
|
resolveFileRefAtPath,
|
|
6
12
|
statFileRef,
|
|
7
13
|
} from "./file-content"
|
|
8
|
-
export {
|
|
14
|
+
export {
|
|
15
|
+
canonicalMediaType,
|
|
16
|
+
inferFileMediaType,
|
|
17
|
+
sniffFileMediaType,
|
|
18
|
+
UNTYPED_MEDIA_TYPE,
|
|
19
|
+
} from "./media-type"
|
|
@@ -13,7 +13,8 @@ const PARAMETER_PATTERN = new RegExp(PARAMETER, "g")
|
|
|
13
13
|
* The canonical form of a single well-formed media type, or `null` for anything else.
|
|
14
14
|
*
|
|
15
15
|
* Type, subtype, and parameter names are case-insensitive, so they are lowercased; parameter
|
|
16
|
-
* values keep their case. `"Text/Plain; Charset=UTF-8"` becomes `"text/plain;charset=UTF-8"`.
|
|
16
|
+
* values keep their case. `"Text/Plain; Charset=UTF-8"` becomes `"text/plain;charset=UTF-8"`. A
|
|
17
|
+
* common alias becomes the type browsers know: `audio/x-m4a` is `audio/mp4`.
|
|
17
18
|
*/
|
|
18
19
|
export function canonicalMediaType(value: unknown): string | null {
|
|
19
20
|
if (typeof value !== "string") return null
|
|
@@ -21,17 +22,44 @@ export function canonicalMediaType(value: unknown): string | null {
|
|
|
21
22
|
if (!match) return null
|
|
22
23
|
|
|
23
24
|
const [, type, subtype, parameters] = match
|
|
24
|
-
let canonical = `${type.toLowerCase()}/${subtype.toLowerCase()}`
|
|
25
|
+
let canonical = unaliasMediaType(`${type.toLowerCase()}/${subtype.toLowerCase()}`)
|
|
25
26
|
for (const [, name, parameterValue] of parameters.matchAll(PARAMETER_PATTERN)) {
|
|
26
27
|
canonical += `;${name.toLowerCase()}=${parameterValue}`
|
|
27
28
|
}
|
|
28
29
|
return canonical
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
/**
|
|
33
|
+
* A lowercased `type/subtype` under the name browsers know it by. Operating systems and older
|
|
34
|
+
* tools name some formats otherwise, and a browser opens a type it does not know as a download.
|
|
35
|
+
*/
|
|
36
|
+
export function unaliasMediaType(mediaType: string): string {
|
|
37
|
+
return MEDIA_TYPE_ALIASES.get(mediaType) ?? mediaType
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const MEDIA_TYPE_ALIASES: ReadonlyMap<string, string> = new Map([
|
|
41
|
+
["audio/aacp", "audio/aac"],
|
|
42
|
+
["audio/m4a", "audio/mp4"],
|
|
43
|
+
["audio/mp3", "audio/mpeg"],
|
|
44
|
+
["audio/mpeg3", "audio/mpeg"],
|
|
45
|
+
["audio/vnd.wave", "audio/wav"],
|
|
46
|
+
["audio/wave", "audio/wav"],
|
|
47
|
+
["audio/x-aac", "audio/aac"],
|
|
48
|
+
["audio/x-flac", "audio/flac"],
|
|
49
|
+
["audio/x-m4a", "audio/mp4"],
|
|
50
|
+
["audio/x-mp3", "audio/mpeg"],
|
|
51
|
+
["audio/x-mpeg", "audio/mpeg"],
|
|
52
|
+
["audio/x-mpeg-3", "audio/mpeg"],
|
|
53
|
+
["audio/x-wav", "audio/wav"],
|
|
54
|
+
["image/jpg", "image/jpeg"],
|
|
55
|
+
["video/x-m4v", "video/mp4"],
|
|
56
|
+
])
|
|
57
|
+
|
|
31
58
|
/**
|
|
32
59
|
* The media type a file's bytes declare by their leading signature, or `undefined` when they carry
|
|
33
|
-
* none this function knows. Only formats with an unambiguous signature are recognized
|
|
34
|
-
* have none and are left to the file
|
|
60
|
+
* none this function knows. Only formats with an unambiguous signature are recognized, and MP3 by
|
|
61
|
+
* a frame header whose every field is checked; text formats have none and are left to the file
|
|
62
|
+
* name.
|
|
35
63
|
*/
|
|
36
64
|
export function sniffFileMediaType(bytes: Uint8Array): string | undefined {
|
|
37
65
|
if (startsWith(bytes, [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a])) return "image/png"
|
|
@@ -39,9 +67,20 @@ export function sniffFileMediaType(bytes: Uint8Array): string | undefined {
|
|
|
39
67
|
if (asciiAt(bytes, 0, "GIF87a") || asciiAt(bytes, 0, "GIF89a")) return "image/gif"
|
|
40
68
|
if (asciiAt(bytes, 0, "RIFF") && asciiAt(bytes, 8, "WEBP")) return "image/webp"
|
|
41
69
|
if (asciiAt(bytes, 0, "%PDF-")) return "application/pdf"
|
|
42
|
-
|
|
70
|
+
|
|
71
|
+
if (asciiAt(bytes, 4, "ftyp")) return MP4_BRANDS.get(ascii(bytes, 8, 4))
|
|
72
|
+
if (startsWith(bytes, [0x1a, 0x45, 0xdf, 0xa3]))
|
|
73
|
+
return MATROSKA_DOC_TYPES.get(matroskaDocType(bytes))
|
|
74
|
+
if (asciiAt(bytes, 0, "OggS")) return oggMediaType(bytes)
|
|
75
|
+
if (asciiAt(bytes, 0, "RIFF") && asciiAt(bytes, 8, "WAVE")) return "audio/wav"
|
|
76
|
+
if (asciiAt(bytes, 0, "fLaC")) return "audio/flac"
|
|
77
|
+
if (asciiAt(bytes, 0, "ID3")) return "audio/mpeg"
|
|
78
|
+
return mpegAudioMediaType(bytes)
|
|
43
79
|
}
|
|
44
80
|
|
|
81
|
+
/** The type that says only "bytes": a file's when nothing tells more, or a client's default. */
|
|
82
|
+
export const UNTYPED_MEDIA_TYPE = "application/octet-stream"
|
|
83
|
+
|
|
45
84
|
/**
|
|
46
85
|
* The media type of a file handed over without one: its bytes' signature when they have one, else
|
|
47
86
|
* its extension, else `application/octet-stream`. Every place that classifies a sandbox or tool file
|
|
@@ -49,17 +88,23 @@ export function sniffFileMediaType(bytes: Uint8Array): string | undefined {
|
|
|
49
88
|
*/
|
|
50
89
|
export function inferFileMediaType(fileName: string, bytes?: Uint8Array): string {
|
|
51
90
|
const sniffed = bytes === undefined ? undefined : sniffFileMediaType(bytes)
|
|
52
|
-
if (sniffed) return sniffed
|
|
53
91
|
const dot = fileName.lastIndexOf(".")
|
|
54
|
-
const
|
|
55
|
-
|
|
92
|
+
const named = EXTENSION_MEDIA_TYPES[dot < 0 ? "" : fileName.slice(dot).toLowerCase()]
|
|
93
|
+
|
|
94
|
+
// An MP4 or a WebM signature names the container, and only the name can say it holds sound
|
|
95
|
+
// alone. An Ogg one names the codec: Theora is video whatever the name says.
|
|
96
|
+
const sound = sniffed === undefined ? undefined : SOUND_OR_VIDEO_CONTAINERS.get(sniffed)
|
|
97
|
+
if (sound !== undefined && sound === named) return sound
|
|
98
|
+
return sniffed ?? named ?? UNTYPED_MEDIA_TYPE
|
|
56
99
|
}
|
|
57
100
|
|
|
58
101
|
const EXTENSION_MEDIA_TYPES: Readonly<Record<string, string>> = {
|
|
102
|
+
".aac": "audio/aac",
|
|
59
103
|
".bmp": "image/bmp",
|
|
60
104
|
".css": "text/css",
|
|
61
105
|
".csv": "text/csv",
|
|
62
106
|
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
107
|
+
".flac": "audio/flac",
|
|
63
108
|
".gif": "image/gif",
|
|
64
109
|
".htm": "text/html",
|
|
65
110
|
".html": "text/html",
|
|
@@ -68,15 +113,30 @@ const EXTENSION_MEDIA_TYPES: Readonly<Record<string, string>> = {
|
|
|
68
113
|
".js": "application/javascript",
|
|
69
114
|
".json": "application/json",
|
|
70
115
|
".jsonl": "application/x-ndjson",
|
|
116
|
+
".m4a": "audio/mp4",
|
|
117
|
+
".m4v": "video/mp4",
|
|
71
118
|
".markdown": "text/markdown",
|
|
72
119
|
".md": "text/markdown",
|
|
73
120
|
".mjs": "application/javascript",
|
|
121
|
+
".mkv": "video/x-matroska",
|
|
122
|
+
".mov": "video/quicktime",
|
|
123
|
+
".mp3": "audio/mpeg",
|
|
124
|
+
".mp4": "video/mp4",
|
|
125
|
+
".oga": "audio/ogg",
|
|
126
|
+
".ogg": "audio/ogg",
|
|
127
|
+
".ogv": "video/ogg",
|
|
128
|
+
".opus": "audio/ogg",
|
|
74
129
|
".pdf": "application/pdf",
|
|
75
130
|
".png": "image/png",
|
|
76
131
|
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
132
|
+
".srt": "application/x-subrip",
|
|
77
133
|
".svg": "image/svg+xml",
|
|
78
134
|
".tsv": "text/tab-separated-values",
|
|
79
135
|
".txt": "text/plain",
|
|
136
|
+
".vtt": "text/vtt",
|
|
137
|
+
".wav": "audio/wav",
|
|
138
|
+
".weba": "audio/webm",
|
|
139
|
+
".webm": "video/webm",
|
|
80
140
|
".webp": "image/webp",
|
|
81
141
|
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
82
142
|
".xml": "application/xml",
|
|
@@ -85,6 +145,83 @@ const EXTENSION_MEDIA_TYPES: Readonly<Record<string, string>> = {
|
|
|
85
145
|
".zip": "application/zip",
|
|
86
146
|
}
|
|
87
147
|
|
|
148
|
+
// An ISO media file opens with an `ftyp` box whose major brand names its family. Only brands that
|
|
149
|
+
// say what the file is count: an AVIF or a HEIC image is in the same box format.
|
|
150
|
+
const MP4_BRANDS: ReadonlyMap<string, string> = new Map([
|
|
151
|
+
["avc1", "video/mp4"],
|
|
152
|
+
["dash", "video/mp4"],
|
|
153
|
+
["iso2", "video/mp4"],
|
|
154
|
+
["iso4", "video/mp4"],
|
|
155
|
+
["iso5", "video/mp4"],
|
|
156
|
+
["iso6", "video/mp4"],
|
|
157
|
+
["isom", "video/mp4"],
|
|
158
|
+
["mp41", "video/mp4"],
|
|
159
|
+
["mp42", "video/mp4"],
|
|
160
|
+
["M4V ", "video/mp4"],
|
|
161
|
+
["M4A ", "audio/mp4"],
|
|
162
|
+
["M4B ", "audio/mp4"],
|
|
163
|
+
["qt ", "video/quicktime"],
|
|
164
|
+
])
|
|
165
|
+
|
|
166
|
+
/** The containers whose signature cannot tell video from sound alone, and their sound type. */
|
|
167
|
+
const SOUND_OR_VIDEO_CONTAINERS: ReadonlyMap<string, string> = new Map([
|
|
168
|
+
["video/mp4", "audio/mp4"],
|
|
169
|
+
["video/webm", "audio/webm"],
|
|
170
|
+
])
|
|
171
|
+
|
|
172
|
+
const MATROSKA_DOC_TYPES: ReadonlyMap<string, string> = new Map([
|
|
173
|
+
["webm", "video/webm"],
|
|
174
|
+
["matroska", "video/x-matroska"],
|
|
175
|
+
])
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* A Matroska file's DocType, `webm` or `matroska`, from its EBML header: the element `42 82`, its
|
|
179
|
+
* size as a one-byte variable-length integer, then the name. Writers put it in the first bytes.
|
|
180
|
+
*/
|
|
181
|
+
function matroskaDocType(bytes: Uint8Array): string {
|
|
182
|
+
const head = bytes.subarray(0, 64)
|
|
183
|
+
for (let index = 4; index + 2 < head.byteLength; index += 1) {
|
|
184
|
+
if (head[index] !== 0x42 || head[index + 1] !== 0x82) continue
|
|
185
|
+
// A one-byte size has its top bit set; longer ones never hold a DocType this short.
|
|
186
|
+
const size = head[index + 2] ?? 0
|
|
187
|
+
return size & 0x80 ? ascii(head, index + 3, size & 0x7f) : ""
|
|
188
|
+
}
|
|
189
|
+
return ""
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** An Ogg stream's first packet names its codec: Theora is video, Opus, Vorbis, or FLAC sound. */
|
|
193
|
+
function oggMediaType(bytes: Uint8Array): string {
|
|
194
|
+
// The first page's 27-byte header, then its segment table, then the packet.
|
|
195
|
+
const packet = 27 + (bytes[26] ?? 0)
|
|
196
|
+
return asciiAt(bytes, packet + 1, "theora") ? "video/ogg" : "audio/ogg"
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* MP3, or AAC in ADTS, without an ID3 tag: a frame header, 11 set bits of sync, whose fields must
|
|
201
|
+
* also hold values a real frame can have, so that arbitrary bytes starting with `FF E0` do not pass.
|
|
202
|
+
*/
|
|
203
|
+
function mpegAudioMediaType(bytes: Uint8Array): string | undefined {
|
|
204
|
+
const [first = 0, second = 0, third = 0] = bytes
|
|
205
|
+
if (bytes.byteLength < 3 || first !== 0xff || (second & 0xe0) !== 0xe0) return undefined
|
|
206
|
+
|
|
207
|
+
// ADTS: a 12-bit sync, layer 0, and a sampling frequency index under 13.
|
|
208
|
+
const layer = (second >> 1) & 0b11
|
|
209
|
+
if (layer === 0) {
|
|
210
|
+
return (second & 0xf0) === 0xf0 && ((third >> 2) & 0b1111) < 13 ? "audio/aac" : undefined
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// MP3: layer III, and a version, a bitrate, and a sampling rate that are not the reserved values.
|
|
214
|
+
// Layers I and II are left to the name: `FF FE`, the byte order mark that opens UTF-16 text,
|
|
215
|
+
// reads as a layer I header.
|
|
216
|
+
const version = (second >> 3) & 0b11
|
|
217
|
+
const bitrate = third >> 4
|
|
218
|
+
const sampleRate = (third >> 2) & 0b11
|
|
219
|
+
if (layer !== 0b01 || version === 0b01 || bitrate === 0b1111 || sampleRate === 0b11) {
|
|
220
|
+
return undefined
|
|
221
|
+
}
|
|
222
|
+
return "audio/mpeg"
|
|
223
|
+
}
|
|
224
|
+
|
|
88
225
|
function startsWith(bytes: Uint8Array, signature: readonly number[]): boolean {
|
|
89
226
|
return signature.every((byte, index) => bytes[index] === byte)
|
|
90
227
|
}
|
|
@@ -96,3 +233,7 @@ function asciiAt(bytes: Uint8Array, offset: number, value: string): boolean {
|
|
|
96
233
|
}
|
|
97
234
|
return true
|
|
98
235
|
}
|
|
236
|
+
|
|
237
|
+
function ascii(bytes: Uint8Array, offset: number, length: number): string {
|
|
238
|
+
return String.fromCharCode(...bytes.subarray(offset, offset + length))
|
|
239
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { AsyncLocalStorage } from "node:async_hooks"
|
|
10
10
|
import { readdir } from "node:fs/promises"
|
|
11
|
-
import { join, relative, resolve, sep } from "node:path"
|
|
11
|
+
import { join, posix, relative, resolve, sep } from "node:path"
|
|
12
12
|
import { pathToFileURL } from "node:url"
|
|
13
13
|
import { isActionDefinition } from "../actions"
|
|
14
14
|
import { isConnectorDefinition } from "../connectors"
|
|
@@ -19,6 +19,7 @@ import type { ValueType } from "../ontology/types"
|
|
|
19
19
|
import { isPipelineDefinition } from "../pipelines"
|
|
20
20
|
import { isProjectionDefinition } from "../projections/builders"
|
|
21
21
|
import { isRuleDefinition } from "../rules"
|
|
22
|
+
import type { DefinitionFolderFamily, DefinitionFolderIndex } from "../runtime/definitions"
|
|
22
23
|
import { RuntimeError } from "../runtime/errors"
|
|
23
24
|
import { isScheduleDefinition } from "../schedules"
|
|
24
25
|
import {
|
|
@@ -44,6 +45,8 @@ export interface DiscoveredOntologyModule {
|
|
|
44
45
|
export interface DiscoveredOntology {
|
|
45
46
|
readonly sources: readonly OntologySource[]
|
|
46
47
|
readonly modules: readonly DiscoveredOntologyModule[]
|
|
48
|
+
/** Each object type's folder below `ontology/`; see {@link DefinitionFolderIndex}. */
|
|
49
|
+
readonly folders: ReadonlyMap<string, string>
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
export async function discoverOntologySources(projectRoot: string): Promise<DiscoveredOntology> {
|
|
@@ -53,6 +56,7 @@ export async function discoverOntologySources(projectRoot: string): Promise<Disc
|
|
|
53
56
|
const objectTypes: ObjectTypeWithPropertyTokens[] = []
|
|
54
57
|
const valueTypes: ValueType[] = []
|
|
55
58
|
const modules: DiscoveredOntologyModule[] = []
|
|
59
|
+
const folders = new DefinitionFolderCollector()
|
|
56
60
|
const seen = new Set<unknown>()
|
|
57
61
|
|
|
58
62
|
for (const loaded of loadedModules) {
|
|
@@ -77,10 +81,9 @@ export async function discoverOntologySources(projectRoot: string): Promise<Disc
|
|
|
77
81
|
valueTypes.push(candidate)
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
})
|
|
84
|
+
const path = toPosix(relative("ontology", loaded.path))
|
|
85
|
+
for (const id of objectTypeIds) folders.add(id, path)
|
|
86
|
+
modules.push({ path, objectTypeIds: [...new Set(objectTypeIds)] })
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
const discoveredSources: OntologySource[] = [...ontologyDocuments, ...objectTypes]
|
|
@@ -93,7 +96,7 @@ export async function discoverOntologySources(projectRoot: string): Promise<Disc
|
|
|
93
96
|
})
|
|
94
97
|
}
|
|
95
98
|
|
|
96
|
-
return { sources: discoveredSources, modules }
|
|
99
|
+
return { sources: discoveredSources, modules, folders: folders.index }
|
|
97
100
|
}
|
|
98
101
|
|
|
99
102
|
export type DiscoveryModuleKind =
|
|
@@ -217,31 +220,78 @@ export type DiscoveredProjectDefinitions = {
|
|
|
217
220
|
readonly [TKey in keyof typeof definitionDiscoveryRegistry]: readonly DefinitionFromFamily<
|
|
218
221
|
(typeof definitionDiscoveryRegistry)[TKey]
|
|
219
222
|
>[]
|
|
223
|
+
} & {
|
|
224
|
+
/** The folder each definition was found in; object types come from `discoverOntologySources`. */
|
|
225
|
+
readonly folders: Omit<DefinitionFolderIndex, "objectTypes">
|
|
220
226
|
}
|
|
221
227
|
|
|
228
|
+
/** The families whose folders the app shows; the rest are kept by id alone. */
|
|
229
|
+
const folderFamilies: ReadonlySet<string> = new Set<Exclude<DefinitionFolderFamily, "objectTypes">>(
|
|
230
|
+
["actions", "connectors", "datasets", "pipelines", "projections", "rules", "syncs", "workflows"]
|
|
231
|
+
)
|
|
232
|
+
|
|
222
233
|
export async function discoverProjectDefinitions(
|
|
223
234
|
projectRoot: string
|
|
224
235
|
): Promise<DiscoveredProjectDefinitions> {
|
|
225
236
|
const entries = await Promise.all(
|
|
226
237
|
Object.entries(definitionDiscoveryRegistry).map(async ([key, family]) => {
|
|
227
|
-
const
|
|
228
|
-
return [key,
|
|
238
|
+
const discovered = await discoverDefinitionFamily(projectRoot, family)
|
|
239
|
+
return [key, discovered] as const
|
|
229
240
|
})
|
|
230
241
|
)
|
|
231
242
|
|
|
243
|
+
const folders = Object.fromEntries(
|
|
244
|
+
entries.filter(([key]) => folderFamilies.has(key)).map(([key, { folders }]) => [key, folders])
|
|
245
|
+
)
|
|
232
246
|
// Object.fromEntries erases literal keys. Every entry above comes from the exact registry and its
|
|
233
247
|
// definitions have passed that entry's type guard, so restoring the mapped result type is safe.
|
|
234
|
-
return
|
|
248
|
+
return {
|
|
249
|
+
...Object.fromEntries(entries.map(([key, { definitions }]) => [key, definitions])),
|
|
250
|
+
folders,
|
|
251
|
+
} as DiscoveredProjectDefinitions
|
|
235
252
|
}
|
|
236
253
|
|
|
237
254
|
async function discoverDefinitionFamily(
|
|
238
255
|
projectRoot: string,
|
|
239
256
|
family: DefinitionDiscoveryFamily<unknown>
|
|
240
|
-
): Promise<readonly unknown[]> {
|
|
257
|
+
): Promise<{ definitions: readonly unknown[]; folders: ReadonlyMap<string, string> }> {
|
|
241
258
|
const loadedModules = await loadFamilyModules(projectRoot, family.kind, family.directory)
|
|
242
259
|
const exportedCandidates = new Set(loadedModules.flatMap((loaded) => loaded.exports))
|
|
260
|
+
const definitions = [...exportedCandidates].filter(family.isDefinition)
|
|
261
|
+
const isDefinition = new Set(definitions)
|
|
262
|
+
|
|
263
|
+
const directory = family.directory.join("/")
|
|
264
|
+
const folders = new DefinitionFolderCollector()
|
|
265
|
+
for (const loaded of loadedModules) {
|
|
266
|
+
const path = posix.relative(directory, toPosix(loaded.path))
|
|
267
|
+
for (const candidate of loaded.exports) {
|
|
268
|
+
if (isDefinition.has(candidate) && hasStringId(candidate)) folders.add(candidate.id, path)
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
return { definitions, folders: folders.index }
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Collects each definition's folder from the modules that export it. When several do, the deepest
|
|
277
|
+
* wins: a barrel such as `datasets/index.ts` re-exports what the files below it define.
|
|
278
|
+
*/
|
|
279
|
+
class DefinitionFolderCollector {
|
|
280
|
+
readonly index = new Map<string, string>()
|
|
281
|
+
private readonly depths = new Map<string, number>()
|
|
282
|
+
|
|
283
|
+
/** `path` is the module's POSIX path below the family's directory. */
|
|
284
|
+
add(id: string, path: string): void {
|
|
285
|
+
const folder = posix.dirname(path)
|
|
286
|
+
const depth = folder === "." ? 0 : folder.split("/").length
|
|
287
|
+
if ((this.depths.get(id) ?? -1) >= depth) return
|
|
288
|
+
this.depths.set(id, depth)
|
|
289
|
+
if (depth > 0) this.index.set(id, folder)
|
|
290
|
+
}
|
|
291
|
+
}
|
|
243
292
|
|
|
244
|
-
|
|
293
|
+
function hasStringId(value: unknown): value is { readonly id: string } {
|
|
294
|
+
return isRecord(value) && typeof value.id === "string"
|
|
245
295
|
}
|
|
246
296
|
|
|
247
297
|
/**
|
package/src/deploy/index.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
export { defineDeploy } from "./define"
|
|
2
2
|
export type {
|
|
3
|
-
DeployAccess,
|
|
4
|
-
DeployAccessKey,
|
|
5
3
|
DeployCheck,
|
|
6
4
|
DeployCheckContext,
|
|
7
|
-
DeployCi,
|
|
8
|
-
DeployCiCredential,
|
|
9
5
|
DeployCommand,
|
|
10
6
|
DeployConfig,
|
|
11
7
|
DeployContext,
|
|
@@ -29,7 +25,6 @@ export type {
|
|
|
29
25
|
DeployScript,
|
|
30
26
|
DeployServiceName,
|
|
31
27
|
DeployServicesConfig,
|
|
32
|
-
DeploySetupContext,
|
|
33
28
|
DeploySingletonServiceConfig,
|
|
34
29
|
DeploySingletonServiceName,
|
|
35
30
|
DeploySource,
|
package/src/deploy/types.ts
CHANGED
|
@@ -134,89 +134,34 @@ export interface DeployTarget {
|
|
|
134
134
|
): Promise<void>
|
|
135
135
|
/** What stands between the target and a working deploy of the release, changing nothing. */
|
|
136
136
|
check(release: DeployRelease, context: DeployCheckContext): Promise<readonly DeployCheck[]>
|
|
137
|
-
/** Prepares the target for the release, fixing what `check` reports as fixable. */
|
|
138
|
-
setup?(release: DeployRelease, context: DeploySetupContext): Promise<void>
|
|
139
137
|
/**
|
|
140
138
|
* Runs a script against the deployed project, as `sixb run` would there, with the environment the
|
|
141
139
|
* deployment's services start from and the script's output on this terminal. Resolves with its
|
|
142
140
|
* exit code; rejects only when the target cannot run it.
|
|
143
141
|
*/
|
|
144
142
|
run?(script: DeployScript, context: DeployOperationContext): Promise<number>
|
|
145
|
-
/** Who may deploy and operate the deployment, for a target reached with keys. */
|
|
146
|
-
readonly access?: DeployAccess
|
|
147
|
-
/** Credentials for a CI job that deploys, for a target reached with keys. */
|
|
148
|
-
readonly ci?: DeployCi
|
|
149
143
|
}
|
|
150
144
|
|
|
151
145
|
export interface DeployCheck {
|
|
152
146
|
readonly id: string
|
|
153
147
|
/** What was checked, such as `"SSH"` or `"api DNS"`. */
|
|
154
148
|
readonly label: string
|
|
155
|
-
/**
|
|
156
|
-
|
|
157
|
-
* a deploy; a `warning` does not.
|
|
158
|
-
*/
|
|
159
|
-
readonly status: "ok" | "fixable" | "manual" | "warning"
|
|
149
|
+
/** `fail` stops a deploy until `remedy` is done; a `warning` does not. */
|
|
150
|
+
readonly status: "ok" | "fail" | "warning"
|
|
160
151
|
readonly detail: string
|
|
161
152
|
/** What to do about it, when the status is not `ok`. */
|
|
162
153
|
readonly remedy?: string
|
|
154
|
+
/** Shell commands that fix it, for someone with administrator rights on the target to run once. */
|
|
155
|
+
readonly commands?: readonly string[]
|
|
163
156
|
}
|
|
164
157
|
|
|
165
158
|
export interface DeployCheckContext extends DeployOperationContext {
|
|
166
159
|
/** The project's directory inside its repository: `.` at the root. */
|
|
167
160
|
readonly projectPath: string
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
readonly admin?: string
|
|
173
|
-
/** A public key file to authorize for deploys, instead of the one the target would pick. */
|
|
174
|
-
readonly key?: string
|
|
175
|
-
/** Creates the token `steps.env` reads with, for a target that doesn't have one yet. */
|
|
176
|
-
readonly createEnvToken?: () => Promise<string>
|
|
177
|
-
/** A line of progress for the person running setup. */
|
|
178
|
-
write(line: string): void
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export interface DeployAccess {
|
|
182
|
-
list(context: DeployOperationContext): Promise<readonly DeployAccessKey[]>
|
|
183
|
-
/** Authorizes a public key, given as its text (`ssh-ed25519 AAAA… comment`). */
|
|
184
|
-
add(key: string, context: DeployOperationContext): Promise<DeployAccessKey>
|
|
185
|
-
/** Revokes the keys whose fingerprint or comment matches, and returns them. */
|
|
186
|
-
remove(match: string, context: DeployOperationContext): Promise<readonly DeployAccessKey[]>
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export interface DeployAccessKey {
|
|
190
|
-
readonly type: string
|
|
191
|
-
readonly fingerprint: string
|
|
192
|
-
readonly comment: string
|
|
193
|
-
/** Whether the key is limited to running commands: no forwarding, no terminal. */
|
|
194
|
-
readonly restricted: boolean
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Lets a CI job deploy. `sixb deploy ci` stores what `create` returns as the CI system's secrets and
|
|
199
|
-
* writes the workflow around it.
|
|
200
|
-
*/
|
|
201
|
-
export interface DeployCi {
|
|
202
|
-
/**
|
|
203
|
-
* Creates a credential for one CI job, such as `"github:acme/shop"`, and authorizes it on the
|
|
204
|
-
* target next to the job's earlier ones. Running it again for the same job rotates the credential.
|
|
205
|
-
*/
|
|
206
|
-
create(job: string, context: DeployOperationContext): Promise<DeployCiCredential>
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export interface DeployCiCredential {
|
|
210
|
-
/** Describes the credential, such as its key's fingerprint. */
|
|
211
|
-
readonly description: string
|
|
212
|
-
/** What the CI job needs, by environment variable name. CI stores them as secrets. */
|
|
213
|
-
readonly secrets: Readonly<Record<string, string>>
|
|
214
|
-
/** Shell lines that install the credential on the CI runner, with `secrets` in the environment. */
|
|
215
|
-
readonly install: readonly string[]
|
|
216
|
-
/** Revokes the job's earlier credentials once CI holds this one, and returns them. */
|
|
217
|
-
retireOthers(): Promise<readonly DeployAccessKey[]>
|
|
218
|
-
/** Revokes this credential, when CI could not store it. */
|
|
219
|
-
revoke(): Promise<void>
|
|
161
|
+
/** The project prints with Chromium through Playwright, so the target needs its libraries. */
|
|
162
|
+
readonly chromium: boolean
|
|
163
|
+
/** The project's env source reads on the server with a token file, not an identity of its own. */
|
|
164
|
+
readonly envToken: boolean
|
|
220
165
|
}
|
|
221
166
|
|
|
222
167
|
export interface DeployListenAddress {
|
package/src/deploy/validation.ts
CHANGED
|
@@ -68,7 +68,7 @@ function services(value: unknown): void {
|
|
|
68
68
|
|
|
69
69
|
if (isDeployHttpService(service)) {
|
|
70
70
|
knownKeys(options, ["domain", "env", "process"], path, {
|
|
71
|
-
port: "
|
|
71
|
+
port: "The target picks the ports; remove the setting.",
|
|
72
72
|
})
|
|
73
73
|
if (options.domain !== undefined) domain(options.domain, `${path}.domain`)
|
|
74
74
|
if (options.process !== undefined) {
|
package/src/env/index.ts
CHANGED
|
@@ -14,15 +14,21 @@ export type EnvVarRule = "required" | "prod" | "optional"
|
|
|
14
14
|
export interface EnvSource {
|
|
15
15
|
/** The names `env` has values for, without reading the values. */
|
|
16
16
|
names(env: EnvName): Promise<readonly string[]>
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Every value `env` has. `server` reads as a server does, never signing a person in, with
|
|
19
|
+
* `token`, the credential from its token file, when the source needs one.
|
|
20
|
+
*/
|
|
18
21
|
read(
|
|
19
22
|
env: EnvName,
|
|
20
|
-
options?: { readonly token?: string }
|
|
23
|
+
options?: { readonly server?: boolean; readonly token?: string }
|
|
21
24
|
): Promise<Readonly<Record<string, string>>>
|
|
22
25
|
/** Creates or updates these values, and leaves the rest alone. */
|
|
23
26
|
write(env: EnvName, values: Readonly<Record<string, string>>): Promise<void>
|
|
24
|
-
/**
|
|
25
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Whether a server reads with a credential in its token file. False for a source that reads
|
|
29
|
+
* with the server's own identity, such as an Azure managed identity. Defaults to true.
|
|
30
|
+
*/
|
|
31
|
+
readonly serverNeedsToken?: boolean
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
/** The source could not answer: an outage, not a refusal. A retry may succeed unchanged. */
|
package/src/errors/catalog.ts
CHANGED
|
@@ -23,7 +23,8 @@ export const SIXB_ERROR_DEFINITIONS = {
|
|
|
23
23
|
publicMessage: "Data the Action read changed before its commit.",
|
|
24
24
|
retryable: true,
|
|
25
25
|
},
|
|
26
|
-
// Not a crash: a validator
|
|
26
|
+
// Not a crash: a validator, or a handler throwing an ActionValidationError, declined the request
|
|
27
|
+
// with a message written for the caller.
|
|
27
28
|
"action.rejected": {
|
|
28
29
|
publicMessage: "The Action rejected the request.",
|
|
29
30
|
retryable: false,
|
|
@@ -20,7 +20,7 @@ import type {
|
|
|
20
20
|
CompiledSelectedObjectReadScope,
|
|
21
21
|
SelectedObjectReadScope,
|
|
22
22
|
} from "../storage/objects/types"
|
|
23
|
-
import { kernelOperationFromId, kernelOperationId } from "./kernel-operation"
|
|
23
|
+
import { isKernelOperationType, kernelOperationFromId, kernelOperationId } from "./kernel-operation"
|
|
24
24
|
import { assertScriptPath } from "./script"
|
|
25
25
|
import {
|
|
26
26
|
type AuthorizablePrincipal,
|
|
@@ -829,7 +829,7 @@ function snapshotTrustedPrimitive(primitive: TrustedPrimitiveRef): TrustedPrimit
|
|
|
829
829
|
}
|
|
830
830
|
|
|
831
831
|
function snapshotKernelOperation(operation: KernelOperation): KernelOperation {
|
|
832
|
-
if (operation.type
|
|
832
|
+
if (!isKernelOperationType(operation.type)) {
|
|
833
833
|
throw new Error(
|
|
834
834
|
`[Sixb] Unknown kernel operation '${String((operation as { type?: unknown }).type)}'.`
|
|
835
835
|
)
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import type { KernelOperation } from "./types"
|
|
2
2
|
|
|
3
|
+
const KERNEL_OPERATION_TYPES: ReadonlySet<string> = new Set<KernelOperation["type"]>([
|
|
4
|
+
"ontology.recover",
|
|
5
|
+
"ontology.indexVectors",
|
|
6
|
+
"artifacts.transcribeMedia",
|
|
7
|
+
])
|
|
8
|
+
|
|
9
|
+
export function isKernelOperationType(type: unknown): type is KernelOperation["type"] {
|
|
10
|
+
return typeof type === "string" && KERNEL_OPERATION_TYPES.has(type)
|
|
11
|
+
}
|
|
12
|
+
|
|
3
13
|
export function kernelOperationId(operation: KernelOperation): string {
|
|
4
14
|
switch (operation.type) {
|
|
5
15
|
case "ontology.recover":
|
|
6
16
|
return operation.recoveryId
|
|
7
17
|
case "ontology.indexVectors":
|
|
8
18
|
return operation.indexingId
|
|
19
|
+
case "artifacts.transcribeMedia":
|
|
20
|
+
return operation.digest
|
|
9
21
|
default:
|
|
10
22
|
return unknownOperation(operation)
|
|
11
23
|
}
|
|
@@ -17,6 +29,8 @@ export function kernelOperationFromId(type: KernelOperation["type"], id: string)
|
|
|
17
29
|
return { type, recoveryId: id }
|
|
18
30
|
case "ontology.indexVectors":
|
|
19
31
|
return { type, indexingId: id }
|
|
32
|
+
case "artifacts.transcribeMedia":
|
|
33
|
+
return { type, digest: id }
|
|
20
34
|
default:
|
|
21
35
|
return unknownOperation(type)
|
|
22
36
|
}
|
package/src/execution/types.ts
CHANGED
|
@@ -29,6 +29,8 @@ export interface SharedAccessDelegationRef {
|
|
|
29
29
|
export type KernelOperation =
|
|
30
30
|
| { readonly type: "ontology.recover"; readonly recoveryId: string }
|
|
31
31
|
| { readonly type: "ontology.indexVectors"; readonly indexingId: string }
|
|
32
|
+
/** Transcribing a video or a sound for what Sixb derives from it, by the digest of its bytes. */
|
|
33
|
+
| { readonly type: "artifacts.transcribeMedia"; readonly digest: string }
|
|
32
34
|
|
|
33
35
|
/** Workload currently executing. This is provenance and never grants authority by itself. */
|
|
34
36
|
export type ExecutionExecutor =
|