@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,198 @@
|
|
|
1
|
+
import type { VideoComposition, VideoScene, VideoSourceSpan } from "./composition"
|
|
2
|
+
|
|
3
|
+
// A segment of a video's export renders from a project of its own: the version's `index.html`
|
|
4
|
+
// keeping only the scenes on screen during the segment, each started at a number of seconds and
|
|
5
|
+
// moved as early as the segment allows, and the root lasting until the segment ends. HyperFrames
|
|
6
|
+
// then renders those frames alone, from frame 0 when it can, which is its fast path. Browser-safe:
|
|
7
|
+
// text in, text out. See README.md beside this file.
|
|
8
|
+
|
|
9
|
+
/** How HyperFrames renders one segment of a video's export. */
|
|
10
|
+
export interface VideoSegmentRender {
|
|
11
|
+
/** The scenes it keeps: those on screen with the segment's scene, in `index.html`'s order. */
|
|
12
|
+
readonly scenes: readonly string[]
|
|
13
|
+
/** The whole frames everything is moved earlier by. */
|
|
14
|
+
readonly shiftFrames: number
|
|
15
|
+
/** The frames it renders, once moved: from `from`, up to `to`, which the root then lasts. */
|
|
16
|
+
readonly from: number
|
|
17
|
+
readonly to: number
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** A video's length, rate and scenes, as its segments are cut from them. */
|
|
21
|
+
export interface VideoTimeline<TScene extends VideoTimedScene = VideoTimedScene> {
|
|
22
|
+
readonly fps: number
|
|
23
|
+
readonly durationMs: number
|
|
24
|
+
/** In the order they start. */
|
|
25
|
+
readonly scenes: readonly TScene[]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type VideoTimedScene = Pick<VideoScene, "id" | "startMs" | "durationMs">
|
|
29
|
+
|
|
30
|
+
/** The frames of a scene's segment, which `scene` renders: from `startFrame` up to `endFrame`. */
|
|
31
|
+
export interface VideoSegmentFrames {
|
|
32
|
+
readonly scene: string
|
|
33
|
+
readonly startFrame: number
|
|
34
|
+
readonly endFrame: number
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Each scene's segment, by its id: from the frame it starts on, the first from frame 0, up to the
|
|
39
|
+
* one the next scene starts on, or the video's last. Scenes that start on one frame share the
|
|
40
|
+
* segment of the first, which renders it; a scene that starts past the end has none.
|
|
41
|
+
*/
|
|
42
|
+
export function videoSegmentFrames(video: VideoTimeline): ReadonlyMap<string, VideoSegmentFrames> {
|
|
43
|
+
const { fps, scenes } = video
|
|
44
|
+
const frames = videoFrameCount(video.durationMs, fps)
|
|
45
|
+
const starts = scenes.map((scene, index) =>
|
|
46
|
+
index === 0 ? 0 : Math.min(frameAtOrBefore(scene.startMs, fps), frames)
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
const segments = new Map<string, VideoSegmentFrames>()
|
|
50
|
+
for (const [index, scene] of scenes.entries()) {
|
|
51
|
+
const startFrame = starts[index] ?? 0
|
|
52
|
+
const first = scenes[starts.indexOf(startFrame)] ?? scene
|
|
53
|
+
const endFrame = starts.find((start, later) => later > index && start > startFrame) ?? frames
|
|
54
|
+
if (endFrame > startFrame) segments.set(scene.id, { scene: first.id, startFrame, endFrame })
|
|
55
|
+
}
|
|
56
|
+
return segments
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The instant a segment's still shows: its middle, on the millisecond at or before it. A scene's
|
|
61
|
+
* segment ends where the next scene starts, so its middle shows the scene alone, come in.
|
|
62
|
+
*/
|
|
63
|
+
export function videoSegmentMiddleMs(segment: VideoSegmentFrames, fps: number): number {
|
|
64
|
+
const middle = (segment.startFrame + segment.endFrame) / 2
|
|
65
|
+
return Math.floor((middle * 1000) / fps)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The instant a video shows before it plays, which its card's poster pictures: the one its root's
|
|
70
|
+
* `data-poster` names, else its first scene's still, the middle of its segment.
|
|
71
|
+
*/
|
|
72
|
+
export function videoPosterMs(video: VideoTimeline & { readonly posterMs?: number }): number {
|
|
73
|
+
if (video.posterMs !== undefined) return video.posterMs
|
|
74
|
+
|
|
75
|
+
const first = video.scenes[0]
|
|
76
|
+
const segment = first ? videoSegmentFrames(video).get(first.id) : undefined
|
|
77
|
+
return segment ? videoSegmentMiddleMs(segment, video.fps) : 0
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The scenes on screen during the frames from `startFrame` up to `endFrame`, for a moment at
|
|
82
|
+
* least, in the order they start: what a segment shows, and so what its key holds.
|
|
83
|
+
*/
|
|
84
|
+
export function scenesOnScreen<TScene extends VideoTimedScene>(
|
|
85
|
+
video: VideoTimeline<TScene>,
|
|
86
|
+
frames: Pick<VideoSegmentFrames, "startFrame" | "endFrame">
|
|
87
|
+
): TScene[] {
|
|
88
|
+
const from = (frames.startFrame * 1000) / video.fps
|
|
89
|
+
const to = (frames.endFrame * 1000) / video.fps
|
|
90
|
+
return video.scenes.filter(
|
|
91
|
+
(scene) => scene.startMs < to && from < scene.startMs + scene.durationMs
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* How the segment of `scene` from `startFrame` up to `endFrame` renders. The project keeps the
|
|
97
|
+
* scenes on screen during it alone. It is moved earlier by as many whole frames as no kept scene
|
|
98
|
+
* starts before, so a scene keeps its place between frames, up to the segment's start: then
|
|
99
|
+
* HyperFrames renders it from frame 0. A scene still on screen from before the segment, as one
|
|
100
|
+
* fades into the next, or a root that moves on its own, keeps it from there: HyperFrames then
|
|
101
|
+
* renders a range of the project, from `from`, in short chunks one after the other, about twice
|
|
102
|
+
* slower.
|
|
103
|
+
*/
|
|
104
|
+
export function videoSegmentRender(
|
|
105
|
+
composition: Pick<VideoComposition, "fps" | "durationMs" | "scenes">,
|
|
106
|
+
segment: VideoSegmentFrames,
|
|
107
|
+
rootMoves: boolean
|
|
108
|
+
): VideoSegmentRender {
|
|
109
|
+
const { fps } = composition
|
|
110
|
+
if (!composition.scenes.some((each) => each.id === segment.scene)) {
|
|
111
|
+
throw new Error(`[Sixb] The video has no scene '${segment.scene}' to render.`)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const kept = scenesOnScreen(composition, segment)
|
|
115
|
+
const earliest = Math.min(...kept.map((each) => frameAtOrBefore(each.startMs, fps)))
|
|
116
|
+
const shiftFrames = rootMoves ? 0 : Math.min(segment.startFrame, earliest)
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
scenes: kept.sort((a, b) => a.host.element.start - b.host.element.start).map((each) => each.id),
|
|
120
|
+
shiftFrames,
|
|
121
|
+
from: segment.startFrame - shiftFrames,
|
|
122
|
+
to: segment.endFrame - shiftFrames,
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* `index.html` as `render` keeps it: only its scenes' hosts, each starting at a number of seconds,
|
|
128
|
+
* `shiftFrames` earlier, and the root lasting `to` frames. What else the root holds stays as
|
|
129
|
+
* written, its soundtrack too, which HyperFrames mixes and the segment drops.
|
|
130
|
+
*/
|
|
131
|
+
export function videoSegmentIndex(
|
|
132
|
+
index: string,
|
|
133
|
+
composition: Pick<VideoComposition, "fps" | "scenes" | "root">,
|
|
134
|
+
render: Pick<VideoSegmentRender, "scenes" | "shiftFrames" | "to">
|
|
135
|
+
): string {
|
|
136
|
+
const { fps, root } = composition
|
|
137
|
+
const kept = new Set(render.scenes)
|
|
138
|
+
const shiftSeconds = render.shiftFrames / fps
|
|
139
|
+
|
|
140
|
+
const edits: Edit[] = composition.scenes.flatMap((scene): Edit[] => {
|
|
141
|
+
if (!kept.has(scene.id)) return [{ ...scene.host.element, with: "" }]
|
|
142
|
+
|
|
143
|
+
const start = scene.host.attributes["data-start"] as VideoSourceSpan
|
|
144
|
+
const seconds = seconds6(scene.startMs / 1000 - shiftSeconds)
|
|
145
|
+
return [{ ...start, with: `data-start="${seconds}"` }]
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
const length = `data-duration="${seconds6(render.to / fps)}"`
|
|
149
|
+
const duration = root.attributes["data-duration"]
|
|
150
|
+
// A start tag ends in `>`: the length goes right before it.
|
|
151
|
+
const before = root.tag.end - 1
|
|
152
|
+
edits.push(
|
|
153
|
+
duration ? { ...duration, with: length } : { start: before, end: before, with: ` ${length}` }
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
return applyEdits(index, edits)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** The frame a moment falls on, or the last one before it. */
|
|
160
|
+
export function frameAtOrBefore(ms: number, fps: number): number {
|
|
161
|
+
return Math.floor((ms * fps) / 1000 + 1e-6)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* How many frames HyperFrames renders of `ms`: the nearest whole frame when it is within a
|
|
166
|
+
* thousandth of one, the next one otherwise, as its `durationToFrameCount` counts.
|
|
167
|
+
*/
|
|
168
|
+
export function videoFrameCount(ms: number, fps: number): number {
|
|
169
|
+
const exact = (ms * fps) / 1000
|
|
170
|
+
const nearest = Math.round(exact)
|
|
171
|
+
return Math.abs(exact - nearest) <= 1e-3 ? nearest : Math.ceil(exact)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** Whether two scenes are on screen at once, for a moment at least. */
|
|
175
|
+
export function playTogether(
|
|
176
|
+
a: Pick<VideoScene, "startMs" | "durationMs">,
|
|
177
|
+
b: Pick<VideoScene, "startMs" | "durationMs">
|
|
178
|
+
): boolean {
|
|
179
|
+
return a.startMs < b.startMs + b.durationMs && b.startMs < a.startMs + a.durationMs
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** Seconds as HyperFrames reads them: at most six decimals, never negative, never `1e-7`. */
|
|
183
|
+
function seconds6(seconds: number): string {
|
|
184
|
+
return String(Math.max(0, Number(seconds.toFixed(6))))
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
type Edit = VideoSourceSpan & { readonly with: string }
|
|
188
|
+
|
|
189
|
+
/** The text with each span replaced by its `with`; the spans do not overlap. */
|
|
190
|
+
function applyEdits(text: string, edits: readonly Edit[]): string {
|
|
191
|
+
let out = ""
|
|
192
|
+
let kept = 0
|
|
193
|
+
for (const edit of [...edits].sort((a, b) => a.start - b.start || a.end - b.end)) {
|
|
194
|
+
out += text.slice(kept, edit.start) + edit.with
|
|
195
|
+
kept = edit.end
|
|
196
|
+
}
|
|
197
|
+
return out + text.slice(kept)
|
|
198
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { createHash } from "node:crypto"
|
|
2
|
+
import type { Queue, RenderQueueJob } from "../../queues"
|
|
3
|
+
import type { ArtifactStorage, ArtifactVersionRecord } from "../../storage/artifacts/types"
|
|
4
|
+
import type { VideoOutline } from "../outline"
|
|
5
|
+
import { resolveVideoMedia, VIDEO_ENGINE } from "./export"
|
|
6
|
+
import { videoSegmentFrames, videoSegmentMiddleMs } from "./project"
|
|
7
|
+
|
|
8
|
+
// Each scene of a video gets a still: a picture of the middle of its segment, which the player
|
|
9
|
+
// shows for its chapter. It is kept under the scene's render key, so a version that keeps a scene
|
|
10
|
+
// as it was keeps its still. The video's poster is the still at the instant its root's
|
|
11
|
+
// `data-poster` names, or the first scene's: the instant the player opens on, `videoPosterMs`.
|
|
12
|
+
// Like a canvas's previews, stills are asked for when a version is published, once the video
|
|
13
|
+
// rests.
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* How the render worker snapshots a version's stills: each attempt within `timeoutMs`, up to
|
|
17
|
+
* `attempts`, `backoffMs` apart, `settleMs` after the last write that asked.
|
|
18
|
+
*/
|
|
19
|
+
export const VIDEO_STILLS_JOB = {
|
|
20
|
+
timeoutMs: 10 * 60_000,
|
|
21
|
+
attempts: 3,
|
|
22
|
+
backoffMs: 30_000,
|
|
23
|
+
settleMs: 15_000,
|
|
24
|
+
} as const
|
|
25
|
+
|
|
26
|
+
/** A still's width at most, in pixels: a card's poster, sharp on a screen of twice its density. */
|
|
27
|
+
export const VIDEO_STILL_WIDTH = 1280
|
|
28
|
+
|
|
29
|
+
const STILL_FORMAT = "sixb-video-still/1"
|
|
30
|
+
const POSTER_FORMAT = "sixb-video-poster/1"
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A picture of a video at one instant, kept under its key: the middle of a scene's segment, or the
|
|
34
|
+
* instant its root's `data-poster` names. `scene` is the scene whose segment holds the instant,
|
|
35
|
+
* which every scene on screen then overlaps, so the project that snapshots it keeps those.
|
|
36
|
+
*/
|
|
37
|
+
export interface VideoStill {
|
|
38
|
+
readonly key: string
|
|
39
|
+
readonly atMs: number
|
|
40
|
+
readonly scene: string
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Each scene's still: the middle of its segment, what its chapter plays until the next scene
|
|
45
|
+
* starts, kept under what the scene's segment shows and where in it the instant falls. What an
|
|
46
|
+
* `artifact:` address it plays resolves to is not in its key: a still shows it as the version's
|
|
47
|
+
* publisher read it, and a later change to that artifact keeps the still until the scene changes.
|
|
48
|
+
*/
|
|
49
|
+
export function videoSceneStills(outline: VideoOutline): VideoStill[] {
|
|
50
|
+
const segments = videoSegmentFrames(outline)
|
|
51
|
+
return outline.scenes.flatMap((scene) => {
|
|
52
|
+
const segment = segments.get(scene.id)
|
|
53
|
+
if (!segment) return []
|
|
54
|
+
|
|
55
|
+
const atMs = videoSegmentMiddleMs(segment, outline.fps)
|
|
56
|
+
const key = hash([STILL_FORMAT, VIDEO_ENGINE, scene.renderKey, atMs - scene.startMs])
|
|
57
|
+
return [{ key, atMs, scene: scene.id }]
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* A video's stills: each scene's, then, when its root names one, its poster's instant, kept under
|
|
63
|
+
* what the scene that holds that instant shows and where in it the instant falls.
|
|
64
|
+
*/
|
|
65
|
+
export function videoStills(outline: VideoOutline): VideoStill[] {
|
|
66
|
+
const scenes = videoSceneStills(outline)
|
|
67
|
+
const poster = posterStill(outline)
|
|
68
|
+
return poster ? [...scenes, poster] : scenes
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The still a card shows, of the instant the player opens on, `videoPosterMs`: the one its root's
|
|
73
|
+
* `data-poster` names, else the first scene's.
|
|
74
|
+
*/
|
|
75
|
+
export function videoPoster(outline: VideoOutline): VideoStill | undefined {
|
|
76
|
+
const [first] = videoStills(outline)
|
|
77
|
+
return posterStill(outline) ?? first
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function posterStill(outline: VideoOutline): VideoStill | undefined {
|
|
81
|
+
const { posterMs } = outline
|
|
82
|
+
if (posterMs === undefined) return undefined
|
|
83
|
+
|
|
84
|
+
// The last scene to start by then, or the first: the one whose segment holds the instant.
|
|
85
|
+
const scene =
|
|
86
|
+
[...outline.scenes].reverse().find((each) => each.startMs <= posterMs) ?? outline.scenes[0]
|
|
87
|
+
if (!scene) return undefined
|
|
88
|
+
return {
|
|
89
|
+
key: hash([POSTER_FORMAT, VIDEO_ENGINE, scene.renderKey, posterMs - scene.startMs]),
|
|
90
|
+
atMs: posterMs,
|
|
91
|
+
scene: scene.id,
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The stills of a video version not kept yet. One that could not be made is asked for again, once
|
|
97
|
+
* the video is published again: a still is cheap, and a failure may have been the sandbox's.
|
|
98
|
+
*/
|
|
99
|
+
export async function missingVideoStills(
|
|
100
|
+
storage: Pick<ArtifactStorage, "listVideoRenders">,
|
|
101
|
+
version: Pick<ArtifactVersionRecord, "projectId" | "outline">
|
|
102
|
+
): Promise<VideoStill[]> {
|
|
103
|
+
if (version.outline.kind !== "video") return []
|
|
104
|
+
|
|
105
|
+
const stills = videoStills(version.outline)
|
|
106
|
+
const kept = await storage.listVideoRenders({
|
|
107
|
+
projectId: version.projectId,
|
|
108
|
+
keys: stills.map((still) => still.key),
|
|
109
|
+
})
|
|
110
|
+
const done = new Set(kept.flatMap((record) => ("failure" in record ? [] : [record.key])))
|
|
111
|
+
return stills.filter((still) => !done.has(still.key))
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** One job per artifact, which each write that asks replaces. */
|
|
115
|
+
export function videoStillsJobId(artifactId: string): string {
|
|
116
|
+
return `art_vstills_${artifactId}`
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Asks the render worker for the stills a stored video version misses, once the video rests,
|
|
121
|
+
* `VIDEO_STILLS_JOB.settleMs` from now, in the artifact's one job: it takes the place of any asked
|
|
122
|
+
* for an earlier write. The `artifact:` files it plays resolve as `read`, its publisher, reads
|
|
123
|
+
* them. Nothing is asked when nothing is missing.
|
|
124
|
+
*
|
|
125
|
+
* The version exists by now and its stills are derived from it, so a request that fails is
|
|
126
|
+
* reported, not thrown: the publish succeeded, and the player shows its scenes without pictures.
|
|
127
|
+
*/
|
|
128
|
+
export async function requestVideoStills(
|
|
129
|
+
input: {
|
|
130
|
+
readonly storage: Pick<ArtifactStorage, "listVideoRenders">
|
|
131
|
+
readonly queue: Pick<Queue<RenderQueueJob>, "enqueue">
|
|
132
|
+
readonly read: Parameters<typeof resolveVideoMedia>[1]
|
|
133
|
+
},
|
|
134
|
+
version: ArtifactVersionRecord
|
|
135
|
+
): Promise<void> {
|
|
136
|
+
if (version.outline.kind !== "video") return
|
|
137
|
+
|
|
138
|
+
try {
|
|
139
|
+
if ((await missingVideoStills(input.storage, version)).length === 0) return
|
|
140
|
+
|
|
141
|
+
await input.queue.enqueue({
|
|
142
|
+
projectId: version.projectId,
|
|
143
|
+
jobs: [
|
|
144
|
+
{
|
|
145
|
+
id: videoStillsJobId(version.artifactId),
|
|
146
|
+
replace: true,
|
|
147
|
+
type: "artifact.video.stills.requested",
|
|
148
|
+
payload: {
|
|
149
|
+
artifactId: version.artifactId,
|
|
150
|
+
version: version.version,
|
|
151
|
+
updatedAt: version.updatedAt.toISOString(),
|
|
152
|
+
media: await resolveVideoMedia(version, input.read),
|
|
153
|
+
},
|
|
154
|
+
availableAt: new Date(Date.now() + VIDEO_STILLS_JOB.settleMs).toISOString(),
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
})
|
|
158
|
+
} catch (error) {
|
|
159
|
+
console.error(
|
|
160
|
+
`[Sixb] Could not ask for the stills of version ${version.version} of '${version.artifactId}'; its scenes show without pictures.`,
|
|
161
|
+
error
|
|
162
|
+
)
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function hash(value: unknown): string {
|
|
167
|
+
return createHash("sha256").update(JSON.stringify(value)).digest("hex")
|
|
168
|
+
}
|