@sixb/core 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/index.js +52 -49
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run/context.d.ts.map +1 -1
- package/dist/actions/run/execute.d.ts +3 -0
- package/dist/actions/run/execute.d.ts.map +1 -1
- package/dist/actions/run/executor.d.ts +3 -0
- package/dist/actions/run/executor.d.ts.map +1 -1
- package/dist/actions/run/normalize.d.ts.map +1 -1
- package/dist/actions/run/types.d.ts +6 -0
- package/dist/actions/run/types.d.ts.map +1 -1
- package/dist/actions/types/context.d.ts +7 -0
- package/dist/actions/types/context.d.ts.map +1 -1
- package/dist/agents/context/entries.d.ts +17 -0
- package/dist/agents/context/entries.d.ts.map +1 -1
- package/dist/agents/context/index.js +3 -2
- package/dist/agents/context/index.js.map +1 -1
- package/dist/agents/context-model.d.ts.map +1 -1
- package/dist/agents/context-resolution.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +7 -0
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/index.js +57 -54
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-call-retry.d.ts +28 -0
- package/dist/agents/model-call-retry.d.ts.map +1 -0
- package/dist/agents/model-loop.d.ts +4 -2
- package/dist/agents/model-loop.d.ts.map +1 -1
- package/dist/agents/run-artifacts.d.ts +2 -0
- package/dist/agents/run-artifacts.d.ts.map +1 -1
- package/dist/agents/run-plan.d.ts +1 -1
- package/dist/agents/run-plan.d.ts.map +1 -1
- package/dist/agents/run-session-http.d.ts.map +1 -1
- package/dist/agents/run-session-serve.d.ts.map +1 -1
- package/dist/agents/run-session-wire.d.ts +6 -0
- package/dist/agents/run-session-wire.d.ts.map +1 -1
- package/dist/agents/thread-access.d.ts +13 -0
- package/dist/agents/thread-access.d.ts.map +1 -1
- package/dist/agents/tool-files.d.ts.map +1 -1
- package/dist/artifacts/caller.d.ts +10 -0
- package/dist/artifacts/caller.d.ts.map +1 -0
- package/dist/artifacts/comment-place.d.ts +26 -0
- package/dist/artifacts/comment-place.d.ts.map +1 -0
- package/dist/artifacts/comment-text.d.ts +12 -4
- package/dist/artifacts/comment-text.d.ts.map +1 -1
- package/dist/artifacts/comments.d.ts +8 -2
- package/dist/artifacts/comments.d.ts.map +1 -1
- package/dist/artifacts/errors.d.ts +1 -1
- package/dist/artifacts/errors.d.ts.map +1 -1
- package/dist/artifacts/execution.d.ts +73 -5
- package/dist/artifacts/execution.d.ts.map +1 -1
- package/dist/artifacts/frames/assets.d.ts +27 -7
- package/dist/artifacts/frames/assets.d.ts.map +1 -1
- package/dist/artifacts/frames/entries.d.ts +5 -4
- package/dist/artifacts/frames/entries.d.ts.map +1 -1
- package/dist/artifacts/frames/hyperframes.d.ts +12 -0
- package/dist/artifacts/frames/hyperframes.d.ts.map +1 -0
- package/dist/artifacts/frames/index.d.ts +3 -1
- package/dist/artifacts/frames/index.d.ts.map +1 -1
- package/dist/artifacts/frames/index.js +20 -6
- package/dist/artifacts/frames/index.js.map +3 -3
- package/dist/artifacts/frames/kit.d.ts.map +1 -1
- package/dist/artifacts/frames/protocol.d.ts +33 -0
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/video-runtime.d.ts +21 -0
- package/dist/artifacts/frames/video-runtime.d.ts.map +1 -0
- package/dist/artifacts/html.d.ts +23 -0
- package/dist/artifacts/html.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +5 -3
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +71 -10
- package/dist/artifacts/index.js.map +4 -4
- package/dist/artifacts/kinds.d.ts +1 -1
- package/dist/artifacts/kinds.d.ts.map +1 -1
- package/dist/artifacts/limits.d.ts +37 -0
- package/dist/artifacts/limits.d.ts.map +1 -1
- package/dist/artifacts/live/document.d.ts.map +1 -1
- package/dist/artifacts/live/index.d.ts +6 -2
- package/dist/artifacts/live/index.d.ts.map +1 -1
- package/dist/artifacts/live/index.js +3432 -13
- package/dist/artifacts/live/index.js.map +6 -3
- package/dist/artifacts/live/presence.d.ts +7 -5
- package/dist/artifacts/live/presence.d.ts.map +1 -1
- package/dist/artifacts/live/protocol.d.ts +4 -2
- package/dist/artifacts/live/protocol.d.ts.map +1 -1
- package/dist/artifacts/live/server.d.ts +1 -1
- package/dist/artifacts/live/server.d.ts.map +1 -1
- package/dist/artifacts/live/server.js +36 -31
- package/dist/artifacts/live/server.js.map +1 -1
- package/dist/artifacts/live/state.d.ts +2 -2
- package/dist/artifacts/media/media.d.ts +96 -0
- package/dist/artifacts/media/media.d.ts.map +1 -0
- package/dist/artifacts/media/transcriber.d.ts +29 -0
- package/dist/artifacts/media/transcriber.d.ts.map +1 -0
- package/dist/artifacts/outline.d.ts +26 -1
- package/dist/artifacts/outline.d.ts.map +1 -1
- package/dist/artifacts/publish/files.d.ts +5 -2
- package/dist/artifacts/publish/files.d.ts.map +1 -1
- package/dist/artifacts/publish/index.d.ts +11 -2
- package/dist/artifacts/publish/index.d.ts.map +1 -1
- package/dist/artifacts/publish/index.js +110 -33
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/pdf.d.ts.map +1 -1
- package/dist/artifacts/publish/previews.d.ts +7 -2
- package/dist/artifacts/publish/previews.d.ts.map +1 -1
- package/dist/artifacts/publish/publish.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/html.d.ts +5 -4
- package/dist/artifacts/publish/validate/html.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/video.d.ts +36 -0
- package/dist/artifacts/publish/validate/video.d.ts.map +1 -0
- package/dist/artifacts/publish/video.d.ts +79 -0
- package/dist/artifacts/publish/video.d.ts.map +1 -0
- package/dist/artifacts/resolve.d.ts +9 -0
- package/dist/artifacts/resolve.d.ts.map +1 -1
- package/dist/artifacts/video/composition.d.ts +183 -0
- package/dist/artifacts/video/composition.d.ts.map +1 -0
- package/dist/artifacts/video/edit.d.ts +298 -0
- package/dist/artifacts/video/edit.d.ts.map +1 -0
- package/dist/artifacts/video/export.d.ts +142 -0
- package/dist/artifacts/video/export.d.ts.map +1 -0
- package/dist/artifacts/video/looks.d.ts +133 -0
- package/dist/artifacts/video/looks.d.ts.map +1 -0
- package/dist/artifacts/video/project.d.ts +74 -0
- package/dist/artifacts/video/project.d.ts.map +1 -0
- package/dist/artifacts/video/stills.d.ts +65 -0
- package/dist/artifacts/video/stills.d.ts.map +1 -0
- package/dist/artifacts/video/timeline.d.ts +153 -0
- package/dist/artifacts/video/timeline.d.ts.map +1 -0
- package/dist/auth/index.js +9 -8
- package/dist/auth/index.js.map +1 -1
- package/dist/authorization/index.js +5 -4
- package/dist/authorization/index.js.map +1 -1
- package/dist/blob-storage/browser.d.ts +1 -1
- package/dist/blob-storage/browser.d.ts.map +1 -1
- package/dist/blob-storage/browser.js +8 -4
- package/dist/blob-storage/browser.js.map +1 -1
- package/dist/blob-storage/constants.d.ts +8 -3
- package/dist/blob-storage/constants.d.ts.map +1 -1
- package/dist/blob-storage/download-urls.d.ts +2 -2
- package/dist/blob-storage/download-urls.d.ts.map +1 -1
- package/dist/blob-storage/index.d.ts +1 -1
- package/dist/blob-storage/index.d.ts.map +1 -1
- package/dist/blob-storage/index.js +9 -5
- package/dist/blob-storage/index.js.map +1 -1
- package/dist/blob-storage/internal.d.ts +2 -2
- package/dist/blob-storage/internal.d.ts.map +1 -1
- package/dist/blob-storage/internal.js +10 -4
- package/dist/blob-storage/internal.js.map +1 -1
- package/dist/blob-storage/media-type.d.ts +12 -3
- package/dist/blob-storage/media-type.d.ts.map +1 -1
- package/dist/bootstrap/index.js +61 -58
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/{chunk-az95tsh3.js → chunk-0fjryajn.js} +3 -2
- package/dist/chunk-0fjryajn.js.map +11 -0
- package/dist/{chunk-9tpmfh3n.js → chunk-0mk8qqp9.js} +3 -3
- package/dist/{chunk-9tpmfh3n.js.map → chunk-0mk8qqp9.js.map} +3 -3
- package/dist/{chunk-88xeh6zx.js → chunk-1g4me5f2.js} +182 -7
- package/dist/{chunk-88xeh6zx.js.map → chunk-1g4me5f2.js.map} +3 -3
- package/dist/{chunk-7mhbs9yy.js → chunk-1z8ccj53.js} +1 -1
- package/dist/{chunk-wkv3h3q7.js → chunk-2138b0ng.js} +115 -8
- package/dist/chunk-2138b0ng.js.map +12 -0
- package/dist/chunk-23eaayw4.js +3757 -0
- package/dist/chunk-23eaayw4.js.map +22 -0
- package/dist/{chunk-m1cwncee.js → chunk-2mxq1yd9.js} +45 -40
- package/dist/{chunk-m1cwncee.js.map → chunk-2mxq1yd9.js.map} +3 -3
- package/dist/{chunk-dmnd9ea6.js → chunk-30a0ftnm.js} +2 -2
- package/dist/chunk-389ybvw9.js.map +2 -2
- package/dist/{chunk-qbd282aa.js → chunk-39q9ybav.js} +2 -2
- package/dist/{chunk-06kpaqg4.js → chunk-3d9w8t4n.js} +110 -22
- package/dist/{chunk-06kpaqg4.js.map → chunk-3d9w8t4n.js.map} +5 -5
- package/dist/chunk-3dvcdn9w.js +8 -0
- package/dist/chunk-3dvcdn9w.js.map +10 -0
- package/dist/{chunk-fdk0ks9p.js → chunk-3x902cja.js} +3 -3
- package/dist/{chunk-c4nrycdy.js → chunk-4q4a5a96.js} +1 -1
- package/dist/{chunk-9cyq87qa.js → chunk-4tdm3fsj.js} +95 -32
- package/dist/{chunk-9cyq87qa.js.map → chunk-4tdm3fsj.js.map} +9 -9
- package/dist/{chunk-cpy282b8.js → chunk-4w8qzy9w.js} +6 -6
- package/dist/{chunk-c29729me.js → chunk-4z9xtxke.js} +8 -7
- package/dist/chunk-4z9xtxke.js.map +12 -0
- package/dist/chunk-5278qwax.js +270 -0
- package/dist/chunk-5278qwax.js.map +11 -0
- package/dist/{chunk-k1g14kk3.js → chunk-6a4hp405.js} +4 -5
- package/dist/{chunk-k1g14kk3.js.map → chunk-6a4hp405.js.map} +3 -3
- package/dist/{chunk-xavet0qs.js → chunk-6whr25gw.js} +2 -2
- package/dist/{chunk-mbwsgjn7.js → chunk-7zygtcqq.js} +14 -2
- package/dist/chunk-7zygtcqq.js.map +11 -0
- package/dist/chunk-88s9z5pf.js +3 -0
- package/dist/{chunk-de5sfbc3.js.map → chunk-88s9z5pf.js.map} +1 -1
- package/dist/{chunk-ygvay56w.js → chunk-896te58g.js} +2 -2
- package/dist/{chunk-pfdq1ga6.js → chunk-8eqqqc1h.js} +3 -3
- package/dist/{chunk-yyj009tv.js → chunk-8tefbhdx.js} +14 -14
- package/dist/{chunk-yyj009tv.js.map → chunk-8tefbhdx.js.map} +1 -1
- package/dist/{chunk-jka26v8c.js → chunk-8x1bsp68.js} +1 -1
- package/dist/{chunk-wzcjhv54.js → chunk-93e4w7te.js} +113 -1
- package/dist/chunk-93e4w7te.js.map +11 -0
- package/dist/{chunk-phs5fbff.js → chunk-990a5bkc.js} +424 -76
- package/dist/chunk-990a5bkc.js.map +21 -0
- package/dist/{chunk-6md802cc.js → chunk-9az7kjv4.js} +6 -6
- package/dist/{chunk-95ps0k5q.js → chunk-9e5t53z0.js} +1 -1
- package/dist/{chunk-js9e6487.js → chunk-9p7kyeqz.js} +4 -4
- package/dist/chunk-a68zz4r0.js +537 -0
- package/dist/chunk-a68zz4r0.js.map +11 -0
- package/dist/{chunk-d7vyc7k6.js → chunk-a700gjc8.js} +10 -2
- package/dist/chunk-a700gjc8.js.map +10 -0
- package/dist/{chunk-gfdh9kqa.js → chunk-a9qzjaz2.js} +2 -5
- package/dist/chunk-a9qzjaz2.js.map +10 -0
- package/dist/{chunk-8qmp9fpa.js → chunk-as94vcty.js} +619 -482
- package/dist/{chunk-8qmp9fpa.js.map → chunk-as94vcty.js.map} +19 -19
- package/dist/{chunk-brybqw5k.js → chunk-bkxm2dzx.js} +1 -1
- package/dist/{chunk-ppxf7gw2.js → chunk-d7t9jnym.js} +3 -3
- package/dist/{chunk-tapdssb5.js → chunk-e3b1r4d2.js} +8 -7
- package/dist/{chunk-tapdssb5.js.map → chunk-e3b1r4d2.js.map} +4 -4
- package/dist/{chunk-cg7cygfj.js → chunk-fdmvaz7x.js} +1 -1
- package/dist/{chunk-191jz8a6.js → chunk-ff0qdk7z.js} +1 -1
- package/dist/{chunk-9vsc919v.js → chunk-fgxvrxx4.js} +22 -2
- package/dist/chunk-fgxvrxx4.js.map +10 -0
- package/dist/{chunk-wx7smkn2.js → chunk-fq8drkp0.js} +1 -1
- package/dist/{chunk-60662fyv.js → chunk-fqms1a8c.js} +132 -4
- package/dist/{chunk-60662fyv.js.map → chunk-fqms1a8c.js.map} +8 -6
- package/dist/{chunk-v8a1qjzp.js → chunk-hpswfrjj.js} +1 -1
- package/dist/{chunk-qttqe1ah.js → chunk-jbg905hn.js} +80 -13
- package/dist/chunk-jbg905hn.js.map +25 -0
- package/dist/{chunk-bz5bnjjt.js → chunk-jjte0h4p.js} +1 -1
- package/dist/{chunk-hvq8xs66.js → chunk-jwjwvzj1.js} +797 -51
- package/dist/chunk-jwjwvzj1.js.map +38 -0
- package/dist/{chunk-k29rdc3h.js → chunk-k3vd2vyz.js} +6 -2
- package/dist/chunk-k3vd2vyz.js.map +10 -0
- package/dist/chunk-kcqpk9w1.js.map +2 -2
- package/dist/chunk-mvz89age.js.map +2 -2
- package/dist/{chunk-xrmbhap8.js → chunk-mwg0nwkb.js} +1 -1
- package/dist/{chunk-a3faa34j.js → chunk-nfjt8k8j.js} +1 -1
- package/dist/{chunk-394zjzjs.js → chunk-nhgqz3g3.js} +3 -3
- package/dist/{chunk-bqr703h4.js → chunk-p0c5kkhn.js} +23 -6
- package/dist/{chunk-bqr703h4.js.map → chunk-p0c5kkhn.js.map} +3 -3
- package/dist/{chunk-92wrka15.js → chunk-q150fnj9.js} +1 -1
- package/dist/{chunk-w3t94hm6.js → chunk-qk3zq25v.js} +1 -1
- package/dist/chunk-rtkqczbr.js.map +2 -2
- package/dist/{chunk-3qtk0070.js → chunk-ssqbrts1.js} +86 -9
- package/dist/chunk-ssqbrts1.js.map +14 -0
- package/dist/{chunk-5qqmndhm.js → chunk-szzhrn3e.js} +1 -1
- package/dist/{chunk-n1hbwc6y.js → chunk-t6pfch4e.js} +1 -1
- package/dist/{chunk-xtztwpkh.js → chunk-v6h4tc2v.js} +86 -5
- package/dist/chunk-v6h4tc2v.js.map +12 -0
- package/dist/{chunk-brhp9d97.js → chunk-vmqjndb3.js} +2 -2
- package/dist/chunk-vtjzwymr.js.map +2 -2
- package/dist/{chunk-fycac8e9.js → chunk-wpba6hhd.js} +10 -10
- package/dist/{chunk-fycac8e9.js.map → chunk-wpba6hhd.js.map} +1 -1
- package/dist/{chunk-t58sktr5.js → chunk-wrb1x1ss.js} +2 -2
- package/dist/{chunk-5sswe5ej.js → chunk-wsv23wvr.js} +2 -2
- package/dist/{chunk-04r2fdsd.js → chunk-x0hqc54n.js} +4 -4
- package/dist/{chunk-sgx82nnt.js → chunk-xg31er4p.js} +43 -4
- package/dist/chunk-xg31er4p.js.map +10 -0
- package/dist/{chunk-3neam1y5.js → chunk-y3qb965a.js} +2 -2
- package/dist/{chunk-5pz3htbe.js → chunk-y57eawng.js} +3 -3
- package/dist/{chunk-8ncg20rd.js → chunk-yah25st6.js} +5 -5
- package/dist/chunk-yah25st6.js.map +10 -0
- package/dist/{chunk-mrs7jy17.js → chunk-ywvxcmqj.js} +106 -13
- package/dist/{chunk-mrs7jy17.js.map → chunk-ywvxcmqj.js.map} +8 -7
- package/dist/{chunk-44hrfmbk.js → chunk-zmq9xc9s.js} +70 -31
- package/dist/{chunk-44hrfmbk.js.map → chunk-zmq9xc9s.js.map} +4 -3
- package/dist/datasets/write.js +8 -7
- package/dist/datasets/write.js.map +1 -1
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/execution/agent.js +52 -49
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/kernel-operation.d.ts +1 -0
- package/dist/execution/kernel-operation.d.ts.map +1 -1
- package/dist/execution/primitive.js +52 -49
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.js +53 -50
- package/dist/execution/request.js.map +2 -2
- package/dist/execution/types.d.ts +5 -0
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +69 -65
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/index.js +9 -8
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/maintenance/index.js +9 -8
- package/dist/maintenance/index.js.map +2 -2
- package/dist/materializer/index.js +26 -24
- package/dist/materializer/index.js.map +1 -1
- package/dist/models/audio/runtime.d.ts +3 -1
- package/dist/models/audio/runtime.d.ts.map +1 -1
- package/dist/models/audio/speech.d.ts +2 -2
- package/dist/models/audio/speech.d.ts.map +1 -1
- package/dist/models/audio/types.d.ts +23 -3
- package/dist/models/audio/types.d.ts.map +1 -1
- package/dist/models/calls.d.ts +7 -0
- package/dist/models/calls.d.ts.map +1 -1
- package/dist/models/catalog.d.ts +5 -0
- package/dist/models/catalog.d.ts.map +1 -1
- package/dist/models/definitions.d.ts +3 -2
- package/dist/models/definitions.d.ts.map +1 -1
- package/dist/models/errors.d.ts +5 -3
- package/dist/models/errors.d.ts.map +1 -1
- package/dist/models/events.d.ts +2 -0
- package/dist/models/events.d.ts.map +1 -1
- package/dist/models/execution/index.d.ts +1 -0
- package/dist/models/execution/index.d.ts.map +1 -1
- package/dist/models/execution/index.js +33 -28
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/execution/model-call-limits.d.ts.map +1 -1
- package/dist/models/execution/model-call-recorder.d.ts +8 -0
- package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
- package/dist/models/execution/session.d.ts +12 -0
- package/dist/models/execution/session.d.ts.map +1 -1
- package/dist/models/execution/usage.d.ts.map +1 -1
- package/dist/models/execution.d.ts +1 -1
- package/dist/models/execution.d.ts.map +1 -1
- package/dist/models/generation-types.d.ts +2 -0
- package/dist/models/generation-types.d.ts.map +1 -1
- package/dist/models/index.d.ts +4 -2
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +2 -2
- package/dist/models/input-file.d.ts.map +1 -1
- package/dist/models/pricing.d.ts +2 -1
- package/dist/models/pricing.d.ts.map +1 -1
- package/dist/models/rate-card.d.ts +6 -0
- package/dist/models/rate-card.d.ts.map +1 -1
- package/dist/models/tools.d.ts +5 -0
- package/dist/models/tools.d.ts.map +1 -1
- package/dist/models/video/catalog.d.ts +13 -0
- package/dist/models/video/catalog.d.ts.map +1 -0
- package/dist/models/video/check.d.ts +76 -0
- package/dist/models/video/check.d.ts.map +1 -0
- package/dist/models/video/runtime.d.ts +21 -0
- package/dist/models/video/runtime.d.ts.map +1 -0
- package/dist/models/video/types.d.ts +188 -0
- package/dist/models/video/types.d.ts.map +1 -0
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +52 -49
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/index.js +25 -23
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/sdk/object-set.d.ts.map +1 -1
- package/dist/ontology/index.js +4 -4
- package/dist/ontology/internal.js +4 -4
- package/dist/pipelines/index.js +28 -26
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/internal.js +26 -24
- package/dist/projections/internal.js.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/types.d.ts +103 -6
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +3 -1
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +49 -43
- package/dist/runtime/internal.js.map +2 -2
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/sandboxes/index.js +6 -6
- package/dist/security/public.d.ts +6 -4
- package/dist/security/public.d.ts.map +1 -1
- package/dist/security/public.js +5 -3
- package/dist/security/public.js.map +1 -1
- package/dist/shares/internal.js +25 -23
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/agents/in-memory.d.ts +2 -1
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +1 -1
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +4 -4
- package/dist/storage/agents/types.d.ts +13 -0
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/analytics.d.ts +1 -0
- package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
- package/dist/storage/ai-cost/groups.d.ts +2 -0
- package/dist/storage/ai-cost/groups.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +5 -5
- package/dist/storage/ai-cost/types.d.ts +2 -1
- package/dist/storage/ai-cost/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/validation.d.ts.map +1 -1
- package/dist/storage/ai-limits/enforcement.js +3 -3
- package/dist/storage/ai-limits/provider.js +2 -2
- package/dist/storage/ai-usage/in-memory.d.ts +8 -1
- package/dist/storage/ai-usage/in-memory.d.ts.map +1 -1
- package/dist/storage/ai-usage/index.d.ts +2 -2
- package/dist/storage/ai-usage/index.d.ts.map +1 -1
- package/dist/storage/ai-usage/record.d.ts +11 -1
- package/dist/storage/ai-usage/record.d.ts.map +1 -1
- package/dist/storage/ai-usage/types.d.ts +80 -1
- package/dist/storage/ai-usage/types.d.ts.map +1 -1
- package/dist/storage/ai-usage/usage.d.ts +1 -1
- package/dist/storage/ai-usage/usage.d.ts.map +1 -1
- package/dist/storage/artifacts/in-memory.d.ts +25 -2
- package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
- package/dist/storage/artifacts/index.d.ts +1 -1
- package/dist/storage/artifacts/index.d.ts.map +1 -1
- package/dist/storage/artifacts/record.d.ts +12 -1
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +198 -6
- package/dist/storage/artifacts/types.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +3 -2
- package/dist/storage/executions/provider.js.map +1 -1
- package/dist/storage/file-upload-sessions/provider.js +10 -9
- package/dist/storage/file-upload-sessions/provider.js.map +1 -1
- package/dist/storage/in-memory/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +24 -22
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +2 -2
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +34 -14
- package/dist/storage/internal.js.map +2 -2
- package/dist/storage/workflow-runs/provider.js +10 -9
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/syncs/index.js +29 -27
- package/dist/syncs/index.js.map +1 -1
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
- package/dist/testing/artifact-storage-contract.d.ts +3 -0
- package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.js +619 -72
- package/dist/testing/index.js.map +9 -9
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +26 -24
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workers/index.js +5 -5
- package/dist/workers/index.js.map +1 -1
- package/dist/workflows/index.js +58 -55
- package/dist/workflows/index.js.map +1 -1
- package/package.json +3 -1
- package/src/actions/request.ts +2 -0
- package/src/actions/run/context.ts +1 -0
- package/src/actions/run/execute.ts +5 -1
- package/src/actions/run/executor.ts +4 -0
- package/src/actions/run/normalize.ts +4 -0
- package/src/actions/run/types.ts +6 -0
- package/src/actions/types/context.ts +7 -0
- package/src/agents/README.md +3 -1
- package/src/agents/context/entries.ts +63 -9
- package/src/agents/context-model.ts +9 -0
- package/src/agents/context-resolution.ts +7 -0
- package/src/agents/execution.ts +39 -0
- package/src/agents/model-call-retry.ts +69 -0
- package/src/agents/model-loop.ts +86 -12
- package/src/agents/run-artifacts.ts +10 -5
- package/src/agents/run-plan.ts +2 -1
- package/src/agents/run-session-http.ts +1 -0
- package/src/agents/run-session-serve.ts +23 -2
- package/src/agents/run-session-wire.ts +45 -0
- package/src/agents/thread-access.ts +34 -1
- package/src/agents/tool-files.ts +23 -7
- package/src/artifacts/caller.ts +42 -0
- package/src/artifacts/comment-place.ts +51 -0
- package/src/artifacts/comment-text.ts +50 -7
- package/src/artifacts/comments.ts +132 -34
- package/src/artifacts/errors.ts +1 -0
- package/src/artifacts/execution.ts +249 -5
- package/src/artifacts/frames/assets.ts +93 -15
- package/src/artifacts/frames/entries.ts +7 -4
- package/src/artifacts/frames/generated/hyperframes-notices.txt +290 -0
- package/src/artifacts/frames/generated/hyperframes.txt +1145 -0
- package/src/artifacts/frames/generated.d.ts +5 -0
- package/src/artifacts/frames/hyperframes.ts +14 -0
- package/src/artifacts/frames/index.ts +5 -0
- package/src/artifacts/frames/kit.ts +7 -3
- package/src/artifacts/frames/protocol.ts +56 -0
- package/src/artifacts/frames/video-runtime.ts +165 -0
- package/src/artifacts/html.ts +13 -0
- package/src/artifacts/index.ts +7 -0
- package/src/artifacts/kinds.ts +9 -1
- package/src/artifacts/limits.ts +43 -0
- package/src/artifacts/live/document.ts +27 -3
- package/src/artifacts/live/index.ts +58 -2
- package/src/artifacts/live/presence.ts +17 -5
- package/src/artifacts/live/protocol.ts +4 -2
- package/src/artifacts/live/server.ts +1 -1
- package/src/artifacts/live/state.ts +3 -3
- package/src/artifacts/media/README.md +75 -0
- package/src/artifacts/media/media.ts +316 -0
- package/src/artifacts/media/transcriber.ts +84 -0
- package/src/artifacts/outline.ts +28 -0
- package/src/artifacts/publish/files.ts +19 -6
- package/src/artifacts/publish/index.ts +49 -2
- package/src/artifacts/publish/pdf.ts +3 -1
- package/src/artifacts/publish/previews.ts +22 -8
- package/src/artifacts/publish/publish.ts +4 -1
- package/src/artifacts/publish/validate/html.ts +23 -18
- package/src/artifacts/publish/validate/video.ts +309 -0
- package/src/artifacts/publish/video.ts +235 -0
- package/src/artifacts/resolve.ts +45 -0
- package/src/artifacts/video/README.md +402 -0
- package/src/artifacts/video/composition.ts +898 -0
- package/src/artifacts/video/edit.ts +3967 -0
- package/src/artifacts/video/export.ts +352 -0
- package/src/artifacts/video/looks.ts +694 -0
- package/src/artifacts/video/project.ts +198 -0
- package/src/artifacts/video/stills.ts +168 -0
- package/src/artifacts/video/timeline.ts +658 -0
- package/src/blob-storage/browser.ts +1 -1
- package/src/blob-storage/constants.ts +9 -3
- package/src/blob-storage/download-urls.ts +5 -3
- package/src/blob-storage/index.ts +1 -0
- package/src/blob-storage/internal.ts +13 -2
- package/src/blob-storage/media-type.ts +149 -8
- package/src/errors/catalog.ts +2 -1
- package/src/execution/authorization.ts +2 -2
- package/src/execution/kernel-operation.ts +14 -0
- package/src/execution/types.ts +2 -0
- package/src/http/api-routes.ts +117 -0
- package/src/index.ts +18 -1
- package/src/lake-storage/definition-updates.ts +3 -9
- package/src/models/audio/runtime.ts +48 -3
- package/src/models/audio/speech.ts +2 -2
- package/src/models/audio/types.ts +24 -3
- package/src/models/calls.ts +35 -18
- package/src/models/catalog.ts +9 -2
- package/src/models/definitions.ts +4 -2
- package/src/models/errors.ts +5 -3
- package/src/models/events.ts +2 -0
- package/src/models/execution/README.md +68 -2
- package/src/models/execution/index.ts +1 -0
- package/src/models/execution/model-call-limits.ts +11 -5
- package/src/models/execution/model-call-recorder.ts +14 -0
- package/src/models/execution/session.ts +52 -23
- package/src/models/execution/usage.ts +1 -0
- package/src/models/execution.ts +13 -2
- package/src/models/generation-types.ts +2 -0
- package/src/models/index.ts +20 -1
- package/src/models/input-file.ts +7 -2
- package/src/models/pricing.ts +19 -1
- package/src/models/rate-card.ts +15 -3
- package/src/models/tools.ts +5 -0
- package/src/models/video/catalog.ts +101 -0
- package/src/models/video/check.ts +441 -0
- package/src/models/video/runtime.ts +550 -0
- package/src/models/video/types.ts +194 -0
- package/src/objects/execution.ts +2 -0
- package/src/objects/sdk/object-set.ts +2 -0
- package/src/queues/index.ts +5 -0
- package/src/queues/types.ts +126 -5
- package/src/runtime/host.ts +3 -0
- package/src/runtime/internal.ts +3 -1
- package/src/runtime/sixb.ts +12 -4
- package/src/sandboxes/README.md +3 -2
- package/src/security/public.ts +6 -4
- package/src/storage/agents/in-memory.ts +39 -0
- package/src/storage/agents/index.ts +1 -0
- package/src/storage/agents/types.ts +14 -0
- package/src/storage/ai-cost/analytics.ts +2 -0
- package/src/storage/ai-cost/codec.ts +1 -0
- package/src/storage/ai-cost/groups.ts +7 -0
- package/src/storage/ai-cost/types.ts +2 -0
- package/src/storage/ai-cost/validation.ts +2 -0
- package/src/storage/ai-usage/in-memory.ts +93 -0
- package/src/storage/ai-usage/index.ts +10 -0
- package/src/storage/ai-usage/record.ts +106 -0
- package/src/storage/ai-usage/types.ts +102 -1
- package/src/storage/ai-usage/usage.ts +2 -0
- package/src/storage/artifacts/in-memory.ts +108 -11
- package/src/storage/artifacts/index.ts +14 -0
- package/src/storage/artifacts/record.ts +203 -1
- package/src/storage/artifacts/types.ts +199 -6
- package/src/storage/executions/validation.ts +2 -2
- package/src/storage/in-memory/index.ts +1 -1
- package/src/storage/index.ts +22 -1
- package/src/storage/internal.ts +9 -0
- package/src/testing/agent-storage-contract.ts +108 -0
- package/src/testing/ai-cost-storage-contract.ts +1 -0
- package/src/testing/ai-usage-storage-contract.ts +145 -1
- package/src/testing/artifact-storage-contract.ts +320 -0
- package/src/testing/execution-storage-contract.ts +10 -2
- package/src/testing/lake-storage-contract.ts +27 -0
- package/src/testing/queues-contract.ts +71 -0
- package/dist/chunk-3723kgba.js +0 -29
- package/dist/chunk-3723kgba.js.map +0 -10
- package/dist/chunk-3qtk0070.js.map +0 -14
- package/dist/chunk-8ncg20rd.js.map +0 -10
- package/dist/chunk-9vsc919v.js.map +0 -10
- package/dist/chunk-az95tsh3.js.map +0 -11
- package/dist/chunk-c29729me.js.map +0 -12
- package/dist/chunk-d7vyc7k6.js.map +0 -10
- package/dist/chunk-de5sfbc3.js +0 -3
- package/dist/chunk-gfdh9kqa.js.map +0 -11
- package/dist/chunk-hvq8xs66.js.map +0 -34
- package/dist/chunk-k29rdc3h.js.map +0 -10
- package/dist/chunk-mbwsgjn7.js.map +0 -11
- package/dist/chunk-phs5fbff.js.map +0 -19
- package/dist/chunk-qttqe1ah.js.map +0 -24
- package/dist/chunk-sgx82nnt.js.map +0 -10
- package/dist/chunk-vs2s3p8n.js +0 -2274
- package/dist/chunk-vs2s3p8n.js.map +0 -20
- package/dist/chunk-wkv3h3q7.js.map +0 -12
- package/dist/chunk-wzcjhv54.js.map +0 -11
- package/dist/chunk-xtztwpkh.js.map +0 -12
- /package/dist/{chunk-7mhbs9yy.js.map → chunk-1z8ccj53.js.map} +0 -0
- /package/dist/{chunk-dmnd9ea6.js.map → chunk-30a0ftnm.js.map} +0 -0
- /package/dist/{chunk-qbd282aa.js.map → chunk-39q9ybav.js.map} +0 -0
- /package/dist/{chunk-fdk0ks9p.js.map → chunk-3x902cja.js.map} +0 -0
- /package/dist/{chunk-c4nrycdy.js.map → chunk-4q4a5a96.js.map} +0 -0
- /package/dist/{chunk-cpy282b8.js.map → chunk-4w8qzy9w.js.map} +0 -0
- /package/dist/{chunk-xavet0qs.js.map → chunk-6whr25gw.js.map} +0 -0
- /package/dist/{chunk-ygvay56w.js.map → chunk-896te58g.js.map} +0 -0
- /package/dist/{chunk-pfdq1ga6.js.map → chunk-8eqqqc1h.js.map} +0 -0
- /package/dist/{chunk-jka26v8c.js.map → chunk-8x1bsp68.js.map} +0 -0
- /package/dist/{chunk-6md802cc.js.map → chunk-9az7kjv4.js.map} +0 -0
- /package/dist/{chunk-95ps0k5q.js.map → chunk-9e5t53z0.js.map} +0 -0
- /package/dist/{chunk-js9e6487.js.map → chunk-9p7kyeqz.js.map} +0 -0
- /package/dist/{chunk-brybqw5k.js.map → chunk-bkxm2dzx.js.map} +0 -0
- /package/dist/{chunk-ppxf7gw2.js.map → chunk-d7t9jnym.js.map} +0 -0
- /package/dist/{chunk-cg7cygfj.js.map → chunk-fdmvaz7x.js.map} +0 -0
- /package/dist/{chunk-191jz8a6.js.map → chunk-ff0qdk7z.js.map} +0 -0
- /package/dist/{chunk-wx7smkn2.js.map → chunk-fq8drkp0.js.map} +0 -0
- /package/dist/{chunk-v8a1qjzp.js.map → chunk-hpswfrjj.js.map} +0 -0
- /package/dist/{chunk-bz5bnjjt.js.map → chunk-jjte0h4p.js.map} +0 -0
- /package/dist/{chunk-xrmbhap8.js.map → chunk-mwg0nwkb.js.map} +0 -0
- /package/dist/{chunk-a3faa34j.js.map → chunk-nfjt8k8j.js.map} +0 -0
- /package/dist/{chunk-394zjzjs.js.map → chunk-nhgqz3g3.js.map} +0 -0
- /package/dist/{chunk-92wrka15.js.map → chunk-q150fnj9.js.map} +0 -0
- /package/dist/{chunk-w3t94hm6.js.map → chunk-qk3zq25v.js.map} +0 -0
- /package/dist/{chunk-5qqmndhm.js.map → chunk-szzhrn3e.js.map} +0 -0
- /package/dist/{chunk-n1hbwc6y.js.map → chunk-t6pfch4e.js.map} +0 -0
- /package/dist/{chunk-brhp9d97.js.map → chunk-vmqjndb3.js.map} +0 -0
- /package/dist/{chunk-t58sktr5.js.map → chunk-wrb1x1ss.js.map} +0 -0
- /package/dist/{chunk-5sswe5ej.js.map → chunk-wsv23wvr.js.map} +0 -0
- /package/dist/{chunk-04r2fdsd.js.map → chunk-x0hqc54n.js.map} +0 -0
- /package/dist/{chunk-3neam1y5.js.map → chunk-y3qb965a.js.map} +0 -0
- /package/dist/{chunk-5pz3htbe.js.map → chunk-y57eawng.js.map} +0 -0
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { createHash } from "node:crypto"
|
|
2
|
+
import type { FileRef } from "../../blob-storage/types"
|
|
3
|
+
import type { Queue, RenderQueueJob } from "../../queues"
|
|
4
|
+
import type {
|
|
5
|
+
ArtifactStorage,
|
|
6
|
+
ArtifactVersionRecord,
|
|
7
|
+
ArtifactVideoRenderLack,
|
|
8
|
+
ArtifactVideoRenderRecord,
|
|
9
|
+
} from "../../storage/artifacts/types"
|
|
10
|
+
import { parseArtifactAddress } from "../address"
|
|
11
|
+
import { HYPERFRAMES_VERSION } from "../frames/hyperframes"
|
|
12
|
+
import type { VideoOutline } from "../outline"
|
|
13
|
+
import { scenesOnScreen, videoFrameCount, videoSegmentFrames } from "./project"
|
|
14
|
+
|
|
15
|
+
// A video version exports to one MP4 made of segments kept apart from it, each under a key that
|
|
16
|
+
// hashes what it is made of: each scene's frames, from its start until the next scene starts,
|
|
17
|
+
// rendered alone, and the whole video's sound, mixed once. A version that changes one scene
|
|
18
|
+
// renders that scene's segment again and reuses every other, and the MP4 joins them without
|
|
19
|
+
// encoding them again. See README.md beside this file.
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* What renders a video: the agent image's HyperFrames, the release the app plays. Every key names
|
|
23
|
+
* it, so a sandbox that runs another refuses to render, rather than keep what it rendered under a
|
|
24
|
+
* key it does not match.
|
|
25
|
+
*/
|
|
26
|
+
export const VIDEO_ENGINE = `hyperframes@${HYPERFRAMES_VERSION}`
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* How every segment is encoded, so segments join without being encoded again: H.264 at one
|
|
30
|
+
* quality, a keyframe on its first frame and every two seconds after, captured by two browsers at
|
|
31
|
+
* once, which keeps a segment rendered again the same. Changing them renders every segment anew.
|
|
32
|
+
* CRF 20 makes a 1080×1920 video about 11 Mb/s, what social networks take in; CRF 18 made it 19,
|
|
33
|
+
* twice the file for no difference a viewer sees (SSIM 0.986 against 0.989).
|
|
34
|
+
*/
|
|
35
|
+
export const VIDEO_SEGMENT_SETTINGS = { crf: 20, keyframeSeconds: 2, workers: 2 } as const
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* How the render worker assembles an export: each attempt within `timeoutMs`, which holds fetching
|
|
39
|
+
* its segments, joining them, and keeping the MP4, up to `attempts`, `backoffMs` apart. While
|
|
40
|
+
* segments render, it looks again every `recheckMs`, and gives up `waitMs` after it was asked.
|
|
41
|
+
*/
|
|
42
|
+
export const VIDEO_EXPORT_JOB = {
|
|
43
|
+
timeoutMs: 20 * 60_000,
|
|
44
|
+
attempts: 3,
|
|
45
|
+
backoffMs: 15_000,
|
|
46
|
+
recheckMs: 5_000,
|
|
47
|
+
waitMs: 12 * 60 * 60_000,
|
|
48
|
+
} as const
|
|
49
|
+
|
|
50
|
+
/** How many times the render worker tries a segment, and how long it waits between. */
|
|
51
|
+
export const VIDEO_SEGMENT_JOB = { attempts: 2, backoffMs: 30_000 } as const
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* How long one segment may take. Rendering a heavy 1080p scene takes up to twelve times its length
|
|
55
|
+
* in a small sandbox (2 vCPU): its frames get twenty seconds each second, in proportion to their
|
|
56
|
+
* pixels, and five minutes to start. The sound is mixed in a few seconds of each minute.
|
|
57
|
+
*/
|
|
58
|
+
export function videoSegmentTimeoutMs(
|
|
59
|
+
segment: VideoSegment,
|
|
60
|
+
video: Pick<VideoOutline, "fps" | "width" | "height" | "durationMs">
|
|
61
|
+
): number {
|
|
62
|
+
if (segment.kind === "sound") return 5 * 60_000 + video.durationMs
|
|
63
|
+
const seconds = (segment.endFrame - segment.startFrame) / video.fps
|
|
64
|
+
const pixels = Math.max(1, (video.width * video.height) / (1920 * 1080))
|
|
65
|
+
return 5 * 60_000 + Math.ceil(seconds * pixels * 20_000)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** What an `artifact:` address a video plays resolved to, as whoever asked reads it: none when not. */
|
|
69
|
+
export interface VideoMediaFile {
|
|
70
|
+
readonly address: string
|
|
71
|
+
readonly file?: FileRef
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A segment of a video's export: the frames of a scene, from the frame it starts on up to the one
|
|
76
|
+
* the next scene starts on, rendered alone and silent; or the whole video's sound.
|
|
77
|
+
*/
|
|
78
|
+
export type VideoSegment =
|
|
79
|
+
| {
|
|
80
|
+
readonly kind: "scene"
|
|
81
|
+
readonly scene: string
|
|
82
|
+
/** The scene's name, as the player shows it, which is in no key. */
|
|
83
|
+
readonly label?: string
|
|
84
|
+
readonly startFrame: number
|
|
85
|
+
readonly endFrame: number
|
|
86
|
+
}
|
|
87
|
+
| { readonly kind: "sound" }
|
|
88
|
+
|
|
89
|
+
/** What a video's export is made of: its segments, in the order they play, the sound last. */
|
|
90
|
+
export interface VideoExportPlan {
|
|
91
|
+
readonly key: string
|
|
92
|
+
/** How many frames the MP4 has. */
|
|
93
|
+
readonly frames: number
|
|
94
|
+
readonly segments: readonly (VideoSegment & { readonly key: string })[]
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** A video version, as an export reads it. */
|
|
98
|
+
export type VideoExportSource = Pick<ArtifactVersionRecord, "files" | "references"> & {
|
|
99
|
+
readonly outline: VideoOutline
|
|
100
|
+
readonly media: readonly VideoMediaFile[]
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const EXPORT_FORMAT = "sixb-video-export/1"
|
|
104
|
+
const SEGMENT_FORMAT = "sixb-video-segment/1"
|
|
105
|
+
const SOUND_FORMAT = "sixb-video-sound/1"
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* What a video's export is made of, from its outline alone, so whoever asks finds what is kept
|
|
109
|
+
* without reading a file. The first segment starts at frame 0, each next one on the frame its
|
|
110
|
+
* scene starts on; a scene that starts with another renders within the other's segment.
|
|
111
|
+
*
|
|
112
|
+
* A segment's key holds its scene's render key, where it starts and how many frames it has from
|
|
113
|
+
* there, the engine and the settings, and what the `artifact:` addresses played by the root and
|
|
114
|
+
* the scenes on screen during it resolve to. The sound's holds every file and what every address resolves to. The
|
|
115
|
+
* export's holds its segments' keys.
|
|
116
|
+
*/
|
|
117
|
+
export function videoExportPlan(source: VideoExportSource): VideoExportPlan {
|
|
118
|
+
const { outline } = source
|
|
119
|
+
const { fps } = outline
|
|
120
|
+
const frames = videoFrameCount(outline.durationMs, fps)
|
|
121
|
+
|
|
122
|
+
const cuts = videoSegmentFrames(outline)
|
|
123
|
+
const scenes = outline.scenes.flatMap((scene) => {
|
|
124
|
+
// Scenes that start on one frame render in the segment of the first.
|
|
125
|
+
const cut = cuts.get(scene.id)
|
|
126
|
+
if (cut?.scene !== scene.id) return []
|
|
127
|
+
const { startFrame, endFrame } = cut
|
|
128
|
+
|
|
129
|
+
// The scene's render key holds the scenes on screen during its segment, and so does this.
|
|
130
|
+
const beside = scenesOnScreen(outline, cut)
|
|
131
|
+
const key = hash([
|
|
132
|
+
SEGMENT_FORMAT,
|
|
133
|
+
VIDEO_ENGINE,
|
|
134
|
+
VIDEO_SEGMENT_SETTINGS,
|
|
135
|
+
scene.renderKey,
|
|
136
|
+
Math.round(((startFrame * 1000) / fps - scene.startMs) * 1000) / 1000,
|
|
137
|
+
endFrame - startFrame,
|
|
138
|
+
resolved(source, ["", ...beside.map((each) => each.id)]),
|
|
139
|
+
])
|
|
140
|
+
const label = scene.label ? { label: scene.label } : {}
|
|
141
|
+
return [{ kind: "scene" as const, scene: scene.id, ...label, startFrame, endFrame, key }]
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
const sound = {
|
|
145
|
+
kind: "sound" as const,
|
|
146
|
+
key: hash([
|
|
147
|
+
SOUND_FORMAT,
|
|
148
|
+
VIDEO_ENGINE,
|
|
149
|
+
fps,
|
|
150
|
+
frames,
|
|
151
|
+
sorted(source.files.map((entry) => [entry.path, entry.file.digest] as const)),
|
|
152
|
+
resolved(source),
|
|
153
|
+
]),
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const segments = [...scenes, sound]
|
|
157
|
+
return { key: hash([EXPORT_FORMAT, segments.map((each) => each.key)]), frames, segments }
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** Where the render worker assembles an export: one job per export, by its key. */
|
|
161
|
+
export function videoExportJobId(key: string): string {
|
|
162
|
+
return `art_vexp_${key}`
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Where a retry asks anew for an export's segments: apart from the export's own job, which a
|
|
167
|
+
* segment that finishes takes the place of with the payload it was asked with.
|
|
168
|
+
*/
|
|
169
|
+
function videoExportRetryJobId(key: string): string {
|
|
170
|
+
return `art_vexp_retry_${key}`
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** Where it renders a segment: one job per segment, by its key. */
|
|
174
|
+
export function videoSegmentJobId(key: string): string {
|
|
175
|
+
return `art_vseg_${key}`
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** How far an export that is not kept yet has come. */
|
|
179
|
+
export interface VideoExportProgress {
|
|
180
|
+
/** Its segments rendered, of all of them. */
|
|
181
|
+
readonly ready: number
|
|
182
|
+
readonly total: number
|
|
183
|
+
/** Every segment is rendered, and the MP4 is being joined from them. */
|
|
184
|
+
readonly assembling: boolean
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Where an export stands, from what is kept under its keys: the MP4, why it could not be made, or
|
|
189
|
+
* how far it has come. A segment that failed fails the export: why is the segment's.
|
|
190
|
+
*/
|
|
191
|
+
export function videoExportStatus(
|
|
192
|
+
plan: VideoExportPlan,
|
|
193
|
+
kept: readonly ArtifactVideoRenderRecord[]
|
|
194
|
+
):
|
|
195
|
+
| { readonly status: "ready"; readonly file: FileRef }
|
|
196
|
+
| {
|
|
197
|
+
readonly status: "failed"
|
|
198
|
+
readonly reason: string
|
|
199
|
+
/** What the project lacks, when the video is not why. */
|
|
200
|
+
readonly lacks?: ArtifactVideoRenderLack
|
|
201
|
+
}
|
|
202
|
+
| { readonly status: "rendering"; readonly progress: VideoExportProgress } {
|
|
203
|
+
const byKey = new Map(kept.map((record) => [record.key, record]))
|
|
204
|
+
|
|
205
|
+
const done = byKey.get(plan.key)
|
|
206
|
+
if (done && "failure" in done) return failed(done)
|
|
207
|
+
if (done) return { status: "ready", file: done.file }
|
|
208
|
+
|
|
209
|
+
for (const segment of plan.segments) {
|
|
210
|
+
const record = byKey.get(segment.key)
|
|
211
|
+
if (record && "failure" in record) return failed(record)
|
|
212
|
+
}
|
|
213
|
+
return { status: "rendering", progress: videoExportProgress(plan, kept) }
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** Why a render kept failed, and what the project lacks when it says. */
|
|
217
|
+
function failed(record: Extract<ArtifactVideoRenderRecord, { failure: string }>) {
|
|
218
|
+
const lacks = record.lacks ? { lacks: record.lacks } : {}
|
|
219
|
+
return { status: "failed" as const, reason: record.failure, ...lacks }
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** How many of an export's segments are rendered: those that failed are not. */
|
|
223
|
+
export function videoExportProgress(
|
|
224
|
+
plan: VideoExportPlan,
|
|
225
|
+
kept: readonly ArtifactVideoRenderRecord[]
|
|
226
|
+
): VideoExportProgress {
|
|
227
|
+
const rendered = new Set(kept.flatMap((record) => ("failure" in record ? [] : [record.key])))
|
|
228
|
+
const ready = plan.segments.filter((segment) => rendered.has(segment.key)).length
|
|
229
|
+
const total = plan.segments.length
|
|
230
|
+
return { ready, total, assembling: ready === total }
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** Every key an export reads: its own, then its segments'. */
|
|
234
|
+
export function videoExportKeys(plan: VideoExportPlan): string[] {
|
|
235
|
+
return [plan.key, ...plan.segments.map((segment) => segment.key)]
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Asks the render worker to assemble a video version's export, carrying what the version holds
|
|
240
|
+
* now, and keeps that it was asked for, which reading it without asking then says. Asking again
|
|
241
|
+
* while it is asked for asks nothing more; `retry` forgets why the export or its
|
|
242
|
+
* segments could not be made, and asks again for each, in a job of its own: one in the export's
|
|
243
|
+
* place could be taken by a segment that finishes meanwhile, which asks for nothing.
|
|
244
|
+
*/
|
|
245
|
+
export async function requestVideoExport(
|
|
246
|
+
context: {
|
|
247
|
+
readonly storage: Pick<ArtifactStorage, "clearVideoRenderFailures" | "putVideoExportAsk">
|
|
248
|
+
readonly queue: Pick<Queue<RenderQueueJob>, "enqueue">
|
|
249
|
+
},
|
|
250
|
+
version: Pick<ArtifactVersionRecord, "projectId" | "artifactId" | "version">,
|
|
251
|
+
source: VideoExportSource,
|
|
252
|
+
options: { readonly plan: VideoExportPlan; readonly retry?: boolean }
|
|
253
|
+
): Promise<void> {
|
|
254
|
+
const { plan } = options
|
|
255
|
+
if (options.retry) {
|
|
256
|
+
await context.storage.clearVideoRenderFailures({
|
|
257
|
+
projectId: version.projectId,
|
|
258
|
+
keys: videoExportKeys(plan),
|
|
259
|
+
})
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
await context.queue.enqueue({
|
|
263
|
+
projectId: version.projectId,
|
|
264
|
+
jobs: [
|
|
265
|
+
{
|
|
266
|
+
// One job per export: one asked for answers asking again. A retry, in its own, replaces
|
|
267
|
+
// the retry before it.
|
|
268
|
+
...(options.retry
|
|
269
|
+
? { id: videoExportRetryJobId(plan.key), replace: true }
|
|
270
|
+
: { id: videoExportJobId(plan.key) }),
|
|
271
|
+
type: "artifact.video.export.requested",
|
|
272
|
+
payload: {
|
|
273
|
+
artifactId: version.artifactId,
|
|
274
|
+
version: version.version,
|
|
275
|
+
key: plan.key,
|
|
276
|
+
outline: source.outline,
|
|
277
|
+
files: source.files,
|
|
278
|
+
references: source.references,
|
|
279
|
+
media: source.media,
|
|
280
|
+
askedAt: new Date().toISOString(),
|
|
281
|
+
...(options.retry ? { retry: true } : {}),
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
// Kept once its job is: an ask that never reached the queue leaves the export idle, to ask
|
|
288
|
+
// again. One whose job is lost later is asked again by whoever watches it render.
|
|
289
|
+
await context.storage.putVideoExportAsk({
|
|
290
|
+
projectId: version.projectId,
|
|
291
|
+
key: plan.key,
|
|
292
|
+
askedAt: new Date(),
|
|
293
|
+
})
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* What each `artifact:` file a version plays resolves to, as `read` reads it: the version its
|
|
298
|
+
* address pins, or the latest. One `read` cannot find, or that holds no such file, resolves to
|
|
299
|
+
* none.
|
|
300
|
+
*/
|
|
301
|
+
export async function resolveVideoMedia(
|
|
302
|
+
version: Pick<ArtifactVersionRecord, "references">,
|
|
303
|
+
read: (
|
|
304
|
+
artifactId: string,
|
|
305
|
+
version: number | "latest"
|
|
306
|
+
) => Promise<Pick<ArtifactVersionRecord, "files"> | null>
|
|
307
|
+
): Promise<VideoMediaFile[]> {
|
|
308
|
+
const addresses = [
|
|
309
|
+
...new Set(
|
|
310
|
+
version.references.filter((each) => each.as === "embed").map((each) => each.address)
|
|
311
|
+
),
|
|
312
|
+
]
|
|
313
|
+
|
|
314
|
+
const media: VideoMediaFile[] = []
|
|
315
|
+
for (const address of addresses) {
|
|
316
|
+
const parsed = parseArtifactAddress(address)
|
|
317
|
+
if (!parsed?.path) continue
|
|
318
|
+
|
|
319
|
+
const target = await read(parsed.artifactId, parsed.version ?? "latest").catch(() => null)
|
|
320
|
+
const file = target?.files.find((each) => each.path === parsed.path)?.file
|
|
321
|
+
media.push(file ? { address, file } : { address })
|
|
322
|
+
}
|
|
323
|
+
return media
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* The files of `source` the addresses played at `at` resolve to, `""` naming the root, as
|
|
328
|
+
* `[address, digest]` pairs; all of them without `at`.
|
|
329
|
+
*/
|
|
330
|
+
function resolved(
|
|
331
|
+
source: Pick<VideoExportSource, "references" | "media">,
|
|
332
|
+
at?: readonly string[]
|
|
333
|
+
): (readonly [string, string | null])[] {
|
|
334
|
+
const played = new Set(
|
|
335
|
+
source.references
|
|
336
|
+
.filter((reference) => at === undefined || at.includes(reference.at))
|
|
337
|
+
.map((reference) => reference.address)
|
|
338
|
+
)
|
|
339
|
+
return sorted(
|
|
340
|
+
source.media
|
|
341
|
+
.filter((each) => played.has(each.address))
|
|
342
|
+
.map((each) => [each.address, each.file?.digest ?? null] as const)
|
|
343
|
+
)
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function sorted<T extends readonly [string, unknown]>(pairs: readonly T[]): T[] {
|
|
347
|
+
return [...pairs].sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
function hash(value: unknown): string {
|
|
351
|
+
return createHash("sha256").update(JSON.stringify(value)).digest("hex")
|
|
352
|
+
}
|