@sixb/core 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/index.js +53 -50
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run/context.d.ts.map +1 -1
- package/dist/actions/run/execute.d.ts +3 -0
- package/dist/actions/run/execute.d.ts.map +1 -1
- package/dist/actions/run/executor.d.ts +3 -0
- package/dist/actions/run/executor.d.ts.map +1 -1
- package/dist/actions/run/normalize.d.ts.map +1 -1
- package/dist/actions/run/types.d.ts +6 -0
- package/dist/actions/run/types.d.ts.map +1 -1
- package/dist/actions/types/context.d.ts +7 -0
- package/dist/actions/types/context.d.ts.map +1 -1
- package/dist/agents/context/entries.d.ts +17 -0
- package/dist/agents/context/entries.d.ts.map +1 -1
- package/dist/agents/context/index.js +3 -2
- package/dist/agents/context/index.js.map +1 -1
- package/dist/agents/context-model.d.ts.map +1 -1
- package/dist/agents/context-resolution.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +7 -0
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +62 -57
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-call-retry.d.ts +28 -0
- package/dist/agents/model-call-retry.d.ts.map +1 -0
- package/dist/agents/model-loop.d.ts +4 -2
- package/dist/agents/model-loop.d.ts.map +1 -1
- package/dist/agents/model-routing.d.ts +15 -4
- package/dist/agents/model-routing.d.ts.map +1 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/run-artifacts.d.ts +2 -0
- package/dist/agents/run-artifacts.d.ts.map +1 -1
- package/dist/agents/run-plan.d.ts +1 -1
- package/dist/agents/run-plan.d.ts.map +1 -1
- package/dist/agents/run-session-http.d.ts.map +1 -1
- package/dist/agents/run-session-serve.d.ts.map +1 -1
- package/dist/agents/run-session-wire.d.ts +6 -0
- package/dist/agents/run-session-wire.d.ts.map +1 -1
- package/dist/agents/run-token.d.ts +6 -0
- package/dist/agents/run-token.d.ts.map +1 -1
- package/dist/agents/streams/index.js +1 -1
- package/dist/agents/streams/internal.js +2 -2
- package/dist/agents/thread-access.d.ts +13 -0
- package/dist/agents/thread-access.d.ts.map +1 -1
- package/dist/agents/tool-files.d.ts.map +1 -1
- package/dist/artifacts/caller.d.ts +10 -0
- package/dist/artifacts/caller.d.ts.map +1 -0
- package/dist/artifacts/comment-place.d.ts +26 -0
- package/dist/artifacts/comment-place.d.ts.map +1 -0
- package/dist/artifacts/comment-text.d.ts +12 -4
- package/dist/artifacts/comment-text.d.ts.map +1 -1
- package/dist/artifacts/comments.d.ts +8 -2
- package/dist/artifacts/comments.d.ts.map +1 -1
- package/dist/artifacts/errors.d.ts +1 -1
- package/dist/artifacts/errors.d.ts.map +1 -1
- package/dist/artifacts/execution.d.ts +73 -5
- package/dist/artifacts/execution.d.ts.map +1 -1
- package/dist/artifacts/frames/assets.d.ts +27 -7
- package/dist/artifacts/frames/assets.d.ts.map +1 -1
- package/dist/artifacts/frames/entries.d.ts +5 -4
- package/dist/artifacts/frames/entries.d.ts.map +1 -1
- package/dist/artifacts/frames/hyperframes.d.ts +12 -0
- package/dist/artifacts/frames/hyperframes.d.ts.map +1 -0
- package/dist/artifacts/frames/index.d.ts +3 -1
- package/dist/artifacts/frames/index.d.ts.map +1 -1
- package/dist/artifacts/frames/index.js +20 -6
- package/dist/artifacts/frames/index.js.map +3 -3
- package/dist/artifacts/frames/kit.d.ts.map +1 -1
- package/dist/artifacts/frames/protocol.d.ts +33 -0
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/video-runtime.d.ts +21 -0
- package/dist/artifacts/frames/video-runtime.d.ts.map +1 -0
- package/dist/artifacts/html.d.ts +23 -0
- package/dist/artifacts/html.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +5 -3
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +71 -10
- package/dist/artifacts/index.js.map +4 -4
- package/dist/artifacts/kinds.d.ts +1 -1
- package/dist/artifacts/kinds.d.ts.map +1 -1
- package/dist/artifacts/limits.d.ts +37 -0
- package/dist/artifacts/limits.d.ts.map +1 -1
- package/dist/artifacts/live/document.d.ts.map +1 -1
- package/dist/artifacts/live/index.d.ts +6 -2
- package/dist/artifacts/live/index.d.ts.map +1 -1
- package/dist/artifacts/live/index.js +3432 -13
- package/dist/artifacts/live/index.js.map +6 -3
- package/dist/artifacts/live/presence.d.ts +7 -5
- package/dist/artifacts/live/presence.d.ts.map +1 -1
- package/dist/artifacts/live/protocol.d.ts +4 -2
- package/dist/artifacts/live/protocol.d.ts.map +1 -1
- package/dist/artifacts/live/server.d.ts +1 -1
- package/dist/artifacts/live/server.d.ts.map +1 -1
- package/dist/artifacts/live/server.js +36 -31
- package/dist/artifacts/live/server.js.map +1 -1
- package/dist/artifacts/live/state.d.ts +2 -2
- package/dist/artifacts/media/media.d.ts +96 -0
- package/dist/artifacts/media/media.d.ts.map +1 -0
- package/dist/artifacts/media/transcriber.d.ts +29 -0
- package/dist/artifacts/media/transcriber.d.ts.map +1 -0
- package/dist/artifacts/outline.d.ts +26 -1
- package/dist/artifacts/outline.d.ts.map +1 -1
- package/dist/artifacts/publish/files.d.ts +5 -2
- package/dist/artifacts/publish/files.d.ts.map +1 -1
- package/dist/artifacts/publish/index.d.ts +11 -2
- package/dist/artifacts/publish/index.d.ts.map +1 -1
- package/dist/artifacts/publish/index.js +110 -33
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/pdf.d.ts.map +1 -1
- package/dist/artifacts/publish/previews.d.ts +7 -2
- package/dist/artifacts/publish/previews.d.ts.map +1 -1
- package/dist/artifacts/publish/publish.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/html.d.ts +5 -4
- package/dist/artifacts/publish/validate/html.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/video.d.ts +36 -0
- package/dist/artifacts/publish/validate/video.d.ts.map +1 -0
- package/dist/artifacts/publish/video.d.ts +79 -0
- package/dist/artifacts/publish/video.d.ts.map +1 -0
- package/dist/artifacts/resolve.d.ts +9 -0
- package/dist/artifacts/resolve.d.ts.map +1 -1
- package/dist/artifacts/video/composition.d.ts +183 -0
- package/dist/artifacts/video/composition.d.ts.map +1 -0
- package/dist/artifacts/video/edit.d.ts +298 -0
- package/dist/artifacts/video/edit.d.ts.map +1 -0
- package/dist/artifacts/video/export.d.ts +142 -0
- package/dist/artifacts/video/export.d.ts.map +1 -0
- package/dist/artifacts/video/looks.d.ts +133 -0
- package/dist/artifacts/video/looks.d.ts.map +1 -0
- package/dist/artifacts/video/project.d.ts +74 -0
- package/dist/artifacts/video/project.d.ts.map +1 -0
- package/dist/artifacts/video/stills.d.ts +65 -0
- package/dist/artifacts/video/stills.d.ts.map +1 -0
- package/dist/artifacts/video/timeline.d.ts +153 -0
- package/dist/artifacts/video/timeline.d.ts.map +1 -0
- package/dist/auth/index.js +9 -8
- package/dist/auth/index.js.map +1 -1
- package/dist/authorization/index.js +5 -4
- package/dist/authorization/index.js.map +1 -1
- package/dist/blob-storage/browser.d.ts +1 -1
- package/dist/blob-storage/browser.d.ts.map +1 -1
- package/dist/blob-storage/browser.js +8 -4
- package/dist/blob-storage/browser.js.map +1 -1
- package/dist/blob-storage/constants.d.ts +8 -3
- package/dist/blob-storage/constants.d.ts.map +1 -1
- package/dist/blob-storage/download-urls.d.ts +2 -2
- package/dist/blob-storage/download-urls.d.ts.map +1 -1
- package/dist/blob-storage/index.d.ts +1 -1
- package/dist/blob-storage/index.d.ts.map +1 -1
- package/dist/blob-storage/index.js +9 -5
- package/dist/blob-storage/index.js.map +1 -1
- package/dist/blob-storage/internal.d.ts +2 -2
- package/dist/blob-storage/internal.d.ts.map +1 -1
- package/dist/blob-storage/internal.js +10 -4
- package/dist/blob-storage/internal.js.map +1 -1
- package/dist/blob-storage/media-type.d.ts +12 -3
- package/dist/blob-storage/media-type.d.ts.map +1 -1
- package/dist/bootstrap/discovery.d.ts +6 -0
- package/dist/bootstrap/discovery.d.ts.map +1 -1
- package/dist/bootstrap/index.js +63 -60
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/{chunk-az95tsh3.js → chunk-0fjryajn.js} +3 -2
- package/dist/chunk-0fjryajn.js.map +11 -0
- package/dist/{chunk-9tpmfh3n.js → chunk-0mk8qqp9.js} +3 -3
- package/dist/{chunk-9tpmfh3n.js.map → chunk-0mk8qqp9.js.map} +3 -3
- package/dist/{chunk-88xeh6zx.js → chunk-1g4me5f2.js} +182 -7
- package/dist/{chunk-88xeh6zx.js.map → chunk-1g4me5f2.js.map} +3 -3
- package/dist/{chunk-7mhbs9yy.js → chunk-1z8ccj53.js} +1 -1
- package/dist/{chunk-wkv3h3q7.js → chunk-2138b0ng.js} +115 -8
- package/dist/chunk-2138b0ng.js.map +12 -0
- package/dist/chunk-23eaayw4.js +3757 -0
- package/dist/chunk-23eaayw4.js.map +22 -0
- package/dist/{chunk-s8xxef60.js → chunk-2mxq1yd9.js} +48 -41
- package/dist/{chunk-s8xxef60.js.map → chunk-2mxq1yd9.js.map} +6 -6
- package/dist/{chunk-dmnd9ea6.js → chunk-30a0ftnm.js} +2 -2
- package/dist/{chunk-nxysqbt0.js → chunk-389ybvw9.js} +6 -2
- package/dist/chunk-389ybvw9.js.map +10 -0
- package/dist/{chunk-qbd282aa.js → chunk-39q9ybav.js} +2 -2
- package/dist/{chunk-9c9yknwt.js → chunk-3d9w8t4n.js} +111 -23
- package/dist/{chunk-9c9yknwt.js.map → chunk-3d9w8t4n.js.map} +5 -5
- package/dist/chunk-3dvcdn9w.js +8 -0
- package/dist/chunk-3dvcdn9w.js.map +10 -0
- package/dist/{chunk-bcz9dxtf.js → chunk-3x902cja.js} +3 -3
- package/dist/{chunk-c4nrycdy.js → chunk-4q4a5a96.js} +1 -1
- package/dist/{chunk-7r9mqpva.js → chunk-4tdm3fsj.js} +100 -36
- package/dist/{chunk-7r9mqpva.js.map → chunk-4tdm3fsj.js.map} +10 -10
- package/dist/{chunk-ykchk644.js → chunk-4w8qzy9w.js} +6 -6
- package/dist/{chunk-c29729me.js → chunk-4z9xtxke.js} +8 -7
- package/dist/chunk-4z9xtxke.js.map +12 -0
- package/dist/chunk-5278qwax.js +270 -0
- package/dist/chunk-5278qwax.js.map +11 -0
- package/dist/{chunk-kft7mp7z.js → chunk-5xkqasvn.js} +1 -1
- package/dist/{chunk-k1g14kk3.js → chunk-6a4hp405.js} +4 -5
- package/dist/{chunk-k1g14kk3.js.map → chunk-6a4hp405.js.map} +3 -3
- package/dist/{chunk-xavet0qs.js → chunk-6whr25gw.js} +2 -2
- package/dist/{chunk-mbwsgjn7.js → chunk-7zygtcqq.js} +14 -2
- package/dist/chunk-7zygtcqq.js.map +11 -0
- package/dist/chunk-88s9z5pf.js +3 -0
- package/dist/{chunk-de5sfbc3.js.map → chunk-88s9z5pf.js.map} +1 -1
- package/dist/{chunk-ygvay56w.js → chunk-896te58g.js} +2 -2
- package/dist/{chunk-pqj8vff9.js → chunk-8eqqqc1h.js} +3 -3
- package/dist/{chunk-425ydk65.js → chunk-8tefbhdx.js} +14 -14
- package/dist/{chunk-425ydk65.js.map → chunk-8tefbhdx.js.map} +1 -1
- package/dist/{chunk-jka26v8c.js → chunk-8x1bsp68.js} +1 -1
- package/dist/{chunk-wzcjhv54.js → chunk-93e4w7te.js} +113 -1
- package/dist/chunk-93e4w7te.js.map +11 -0
- package/dist/{chunk-ym1bqd98.js → chunk-990a5bkc.js} +424 -76
- package/dist/chunk-990a5bkc.js.map +21 -0
- package/dist/{chunk-fmgf9h5e.js → chunk-9az7kjv4.js} +6 -6
- package/dist/{chunk-eg6xqef7.js → chunk-9e5t53z0.js} +3 -3
- package/dist/{chunk-eg6xqef7.js.map → chunk-9e5t53z0.js.map} +3 -3
- package/dist/{chunk-bs1sd0e0.js → chunk-9p7kyeqz.js} +4 -4
- package/dist/chunk-a68zz4r0.js +537 -0
- package/dist/chunk-a68zz4r0.js.map +11 -0
- package/dist/{chunk-d7vyc7k6.js → chunk-a700gjc8.js} +10 -2
- package/dist/chunk-a700gjc8.js.map +10 -0
- package/dist/{chunk-gfdh9kqa.js → chunk-a9qzjaz2.js} +2 -5
- package/dist/chunk-a9qzjaz2.js.map +10 -0
- package/dist/{chunk-ats8y3d9.js → chunk-as94vcty.js} +688 -504
- package/dist/{chunk-ats8y3d9.js.map → chunk-as94vcty.js.map} +21 -21
- package/dist/{chunk-brybqw5k.js → chunk-bkxm2dzx.js} +1 -1
- package/dist/{chunk-ppxf7gw2.js → chunk-d7t9jnym.js} +3 -3
- package/dist/{chunk-tapdssb5.js → chunk-e3b1r4d2.js} +8 -7
- package/dist/{chunk-tapdssb5.js.map → chunk-e3b1r4d2.js.map} +4 -4
- package/dist/{chunk-cg7cygfj.js → chunk-fdmvaz7x.js} +1 -1
- package/dist/{chunk-191jz8a6.js → chunk-ff0qdk7z.js} +1 -1
- package/dist/{chunk-9vsc919v.js → chunk-fgxvrxx4.js} +22 -2
- package/dist/chunk-fgxvrxx4.js.map +10 -0
- package/dist/{chunk-wx7smkn2.js → chunk-fq8drkp0.js} +1 -1
- package/dist/{chunk-60662fyv.js → chunk-fqms1a8c.js} +132 -4
- package/dist/{chunk-60662fyv.js.map → chunk-fqms1a8c.js.map} +8 -6
- package/dist/{chunk-v8a1qjzp.js → chunk-hpswfrjj.js} +1 -1
- package/dist/{chunk-qttqe1ah.js → chunk-jbg905hn.js} +80 -13
- package/dist/chunk-jbg905hn.js.map +25 -0
- package/dist/{chunk-bz5bnjjt.js → chunk-jjte0h4p.js} +1 -1
- package/dist/{chunk-jt012fxq.js → chunk-jwjwvzj1.js} +797 -51
- package/dist/chunk-jwjwvzj1.js.map +38 -0
- package/dist/{chunk-f05994as.js → chunk-k3vd2vyz.js} +6 -2
- package/dist/chunk-k3vd2vyz.js.map +10 -0
- package/dist/chunk-kcqpk9w1.js.map +2 -2
- package/dist/chunk-mvz89age.js.map +2 -2
- package/dist/{chunk-xrmbhap8.js → chunk-mwg0nwkb.js} +1 -1
- package/dist/{chunk-a3faa34j.js → chunk-nfjt8k8j.js} +1 -1
- package/dist/{chunk-394zjzjs.js → chunk-nhgqz3g3.js} +3 -3
- package/dist/{chunk-bqr703h4.js → chunk-p0c5kkhn.js} +23 -6
- package/dist/{chunk-bqr703h4.js.map → chunk-p0c5kkhn.js.map} +3 -3
- package/dist/{chunk-92wrka15.js → chunk-q150fnj9.js} +1 -1
- package/dist/{chunk-w3t94hm6.js → chunk-qk3zq25v.js} +1 -1
- package/dist/{chunk-6hfbz4d0.js → chunk-r588h4ev.js} +1 -1
- package/dist/chunk-rtkqczbr.js.map +2 -2
- package/dist/{chunk-3qtk0070.js → chunk-ssqbrts1.js} +86 -9
- package/dist/chunk-ssqbrts1.js.map +14 -0
- package/dist/{chunk-5qqmndhm.js → chunk-szzhrn3e.js} +1 -1
- package/dist/{chunk-n1hbwc6y.js → chunk-t6pfch4e.js} +1 -1
- package/dist/{chunk-xtztwpkh.js → chunk-v6h4tc2v.js} +86 -5
- package/dist/chunk-v6h4tc2v.js.map +12 -0
- package/dist/{chunk-brhp9d97.js → chunk-vmqjndb3.js} +2 -2
- package/dist/chunk-vtjzwymr.js.map +2 -2
- package/dist/{chunk-t19wjmnc.js → chunk-wpba6hhd.js} +54 -20
- package/dist/{chunk-t19wjmnc.js.map → chunk-wpba6hhd.js.map} +3 -3
- package/dist/{chunk-htdzx40w.js → chunk-wrb1x1ss.js} +12 -4
- package/dist/{chunk-htdzx40w.js.map → chunk-wrb1x1ss.js.map} +3 -3
- package/dist/{chunk-5sswe5ej.js → chunk-wsv23wvr.js} +2 -2
- package/dist/{chunk-90nqenq8.js → chunk-x0hqc54n.js} +4 -4
- package/dist/{chunk-sgx82nnt.js → chunk-xg31er4p.js} +43 -4
- package/dist/chunk-xg31er4p.js.map +10 -0
- package/dist/{chunk-3neam1y5.js → chunk-y3qb965a.js} +2 -2
- package/dist/{chunk-gaj8djsw.js → chunk-y57eawng.js} +10 -5
- package/dist/{chunk-gaj8djsw.js.map → chunk-y57eawng.js.map} +3 -3
- package/dist/{chunk-8ncg20rd.js → chunk-yah25st6.js} +5 -5
- package/dist/chunk-yah25st6.js.map +10 -0
- package/dist/{chunk-grt2j5vp.js → chunk-ywvxcmqj.js} +106 -13
- package/dist/{chunk-grt2j5vp.js.map → chunk-ywvxcmqj.js.map} +8 -7
- package/dist/{chunk-xf76csps.js → chunk-zmq9xc9s.js} +70 -31
- package/dist/{chunk-xf76csps.js.map → chunk-zmq9xc9s.js.map} +4 -3
- package/dist/datasets/write.js +8 -7
- package/dist/datasets/write.js.map +1 -1
- package/dist/deploy/index.d.ts +1 -1
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/internal.js +2 -2
- package/dist/deploy/internal.js.map +2 -2
- package/dist/deploy/types.d.ts +8 -58
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/env/index.d.ts +10 -3
- package/dist/env/index.d.ts.map +1 -1
- package/dist/env/index.js.map +2 -2
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/execution/agent.js +53 -50
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/kernel-operation.d.ts +1 -0
- package/dist/execution/kernel-operation.d.ts.map +1 -1
- package/dist/execution/primitive.js +53 -50
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.js +54 -51
- package/dist/execution/request.js.map +2 -2
- package/dist/execution/types.d.ts +5 -0
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +73 -67
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/index.js +9 -8
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/maintenance/index.js +9 -8
- package/dist/maintenance/index.js.map +2 -2
- package/dist/materializer/index.js +26 -24
- package/dist/materializer/index.js.map +1 -1
- package/dist/models/audio/runtime.d.ts +3 -1
- package/dist/models/audio/runtime.d.ts.map +1 -1
- package/dist/models/audio/speech.d.ts +2 -2
- package/dist/models/audio/speech.d.ts.map +1 -1
- package/dist/models/audio/types.d.ts +23 -3
- package/dist/models/audio/types.d.ts.map +1 -1
- package/dist/models/calls.d.ts +7 -0
- package/dist/models/calls.d.ts.map +1 -1
- package/dist/models/catalog.d.ts +5 -0
- package/dist/models/catalog.d.ts.map +1 -1
- package/dist/models/definitions.d.ts +3 -2
- package/dist/models/definitions.d.ts.map +1 -1
- package/dist/models/errors.d.ts +5 -3
- package/dist/models/errors.d.ts.map +1 -1
- package/dist/models/events.d.ts +2 -0
- package/dist/models/events.d.ts.map +1 -1
- package/dist/models/execution/index.d.ts +1 -0
- package/dist/models/execution/index.d.ts.map +1 -1
- package/dist/models/execution/index.js +33 -28
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/execution/model-call-limits.d.ts.map +1 -1
- package/dist/models/execution/model-call-recorder.d.ts +8 -0
- package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
- package/dist/models/execution/session.d.ts +12 -0
- package/dist/models/execution/session.d.ts.map +1 -1
- package/dist/models/execution/usage.d.ts.map +1 -1
- package/dist/models/execution.d.ts +1 -1
- package/dist/models/execution.d.ts.map +1 -1
- package/dist/models/generation-types.d.ts +2 -0
- package/dist/models/generation-types.d.ts.map +1 -1
- package/dist/models/index.d.ts +4 -2
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +2 -2
- package/dist/models/input-file.d.ts.map +1 -1
- package/dist/models/pricing.d.ts +2 -1
- package/dist/models/pricing.d.ts.map +1 -1
- package/dist/models/rate-card.d.ts +6 -0
- package/dist/models/rate-card.d.ts.map +1 -1
- package/dist/models/tools.d.ts +5 -0
- package/dist/models/tools.d.ts.map +1 -1
- package/dist/models/video/catalog.d.ts +13 -0
- package/dist/models/video/catalog.d.ts.map +1 -0
- package/dist/models/video/check.d.ts +76 -0
- package/dist/models/video/check.d.ts.map +1 -0
- package/dist/models/video/runtime.d.ts +21 -0
- package/dist/models/video/runtime.d.ts.map +1 -0
- package/dist/models/video/types.d.ts +188 -0
- package/dist/models/video/types.d.ts.map +1 -0
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +53 -50
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/index.js +25 -23
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/sdk/object-set.d.ts.map +1 -1
- package/dist/ontology/index.js +4 -4
- package/dist/ontology/internal.js +4 -4
- package/dist/pipelines/index.js +28 -26
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/internal.js +26 -24
- package/dist/projections/internal.js.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/types.d.ts +103 -6
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/definitions.d.ts +14 -0
- package/dist/runtime/definitions.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +3 -1
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +3 -1
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +49 -43
- package/dist/runtime/internal.js.map +2 -2
- package/dist/runtime/resolve-definitions.d.ts +2 -1
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/sandboxes/errors.d.ts +19 -0
- package/dist/sandboxes/errors.d.ts.map +1 -1
- package/dist/sandboxes/exec.d.ts +2 -0
- package/dist/sandboxes/exec.d.ts.map +1 -1
- package/dist/sandboxes/index.d.ts +1 -1
- package/dist/sandboxes/index.d.ts.map +1 -1
- package/dist/sandboxes/index.js +14 -8
- package/dist/sandboxes/index.js.map +1 -1
- package/dist/sandboxes/sandbox.d.ts +15 -1
- package/dist/sandboxes/sandbox.d.ts.map +1 -1
- package/dist/security/public.d.ts +6 -4
- package/dist/security/public.d.ts.map +1 -1
- package/dist/security/public.js +5 -3
- package/dist/security/public.js.map +1 -1
- package/dist/shares/internal.js +25 -23
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/agents/in-memory.d.ts +2 -1
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +1 -1
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +5 -5
- package/dist/storage/agents/types.d.ts +27 -1
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/analytics.d.ts +1 -0
- package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
- package/dist/storage/ai-cost/groups.d.ts +2 -0
- package/dist/storage/ai-cost/groups.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +5 -5
- package/dist/storage/ai-cost/types.d.ts +2 -1
- package/dist/storage/ai-cost/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/validation.d.ts.map +1 -1
- package/dist/storage/ai-limits/enforcement.js +3 -3
- package/dist/storage/ai-limits/provider.js +2 -2
- package/dist/storage/ai-usage/in-memory.d.ts +8 -1
- package/dist/storage/ai-usage/in-memory.d.ts.map +1 -1
- package/dist/storage/ai-usage/index.d.ts +2 -2
- package/dist/storage/ai-usage/index.d.ts.map +1 -1
- package/dist/storage/ai-usage/record.d.ts +11 -1
- package/dist/storage/ai-usage/record.d.ts.map +1 -1
- package/dist/storage/ai-usage/types.d.ts +80 -1
- package/dist/storage/ai-usage/types.d.ts.map +1 -1
- package/dist/storage/ai-usage/usage.d.ts +1 -1
- package/dist/storage/ai-usage/usage.d.ts.map +1 -1
- package/dist/storage/artifacts/in-memory.d.ts +25 -2
- package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
- package/dist/storage/artifacts/index.d.ts +1 -1
- package/dist/storage/artifacts/index.d.ts.map +1 -1
- package/dist/storage/artifacts/record.d.ts +12 -1
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +198 -6
- package/dist/storage/artifacts/types.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +3 -2
- package/dist/storage/executions/provider.js.map +1 -1
- package/dist/storage/file-upload-sessions/provider.js +10 -9
- package/dist/storage/file-upload-sessions/provider.js.map +1 -1
- package/dist/storage/in-memory/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +25 -23
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +2 -2
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +34 -14
- package/dist/storage/internal.js.map +2 -2
- package/dist/storage/workflow-runs/provider.js +10 -9
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/syncs/index.js +29 -27
- package/dist/syncs/index.js.map +1 -1
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
- package/dist/testing/artifact-storage-contract.d.ts +3 -0
- package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.js +686 -75
- package/dist/testing/index.js.map +10 -10
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/testing/sandboxes-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +26 -24
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workers/index.js +5 -5
- package/dist/workers/index.js.map +1 -1
- package/dist/workflows/index.js +60 -57
- package/dist/workflows/index.js.map +1 -1
- package/package.json +3 -1
- package/src/actions/request.ts +2 -0
- package/src/actions/run/context.ts +1 -0
- package/src/actions/run/execute.ts +5 -1
- package/src/actions/run/executor.ts +4 -0
- package/src/actions/run/normalize.ts +4 -0
- package/src/actions/run/types.ts +6 -0
- package/src/actions/types/context.ts +7 -0
- package/src/agents/README.md +3 -1
- package/src/agents/context/entries.ts +63 -9
- package/src/agents/context-model.ts +9 -0
- package/src/agents/context-resolution.ts +7 -0
- package/src/agents/execution.ts +39 -0
- package/src/agents/index.ts +1 -0
- package/src/agents/model-call-retry.ts +69 -0
- package/src/agents/model-loop.ts +86 -12
- package/src/agents/model-routing.ts +104 -38
- package/src/agents/request.ts +27 -1
- package/src/agents/run-artifacts.ts +10 -5
- package/src/agents/run-plan.ts +2 -1
- package/src/agents/run-session-http.ts +1 -0
- package/src/agents/run-session-serve.ts +23 -2
- package/src/agents/run-session-wire.ts +45 -0
- package/src/agents/run-token.ts +7 -0
- package/src/agents/thread-access.ts +34 -1
- package/src/agents/tool-files.ts +23 -7
- package/src/artifacts/caller.ts +42 -0
- package/src/artifacts/comment-place.ts +51 -0
- package/src/artifacts/comment-text.ts +50 -7
- package/src/artifacts/comments.ts +132 -34
- package/src/artifacts/errors.ts +1 -0
- package/src/artifacts/execution.ts +249 -5
- package/src/artifacts/frames/assets.ts +93 -15
- package/src/artifacts/frames/entries.ts +7 -4
- package/src/artifacts/frames/generated/hyperframes-notices.txt +290 -0
- package/src/artifacts/frames/generated/hyperframes.txt +1145 -0
- package/src/artifacts/frames/generated.d.ts +5 -0
- package/src/artifacts/frames/hyperframes.ts +14 -0
- package/src/artifacts/frames/index.ts +5 -0
- package/src/artifacts/frames/kit.ts +7 -3
- package/src/artifacts/frames/protocol.ts +56 -0
- package/src/artifacts/frames/video-runtime.ts +165 -0
- package/src/artifacts/html.ts +13 -0
- package/src/artifacts/index.ts +7 -0
- package/src/artifacts/kinds.ts +9 -1
- package/src/artifacts/limits.ts +43 -0
- package/src/artifacts/live/document.ts +27 -3
- package/src/artifacts/live/index.ts +58 -2
- package/src/artifacts/live/presence.ts +17 -5
- package/src/artifacts/live/protocol.ts +4 -2
- package/src/artifacts/live/server.ts +1 -1
- package/src/artifacts/live/state.ts +3 -3
- package/src/artifacts/media/README.md +75 -0
- package/src/artifacts/media/media.ts +316 -0
- package/src/artifacts/media/transcriber.ts +84 -0
- package/src/artifacts/outline.ts +28 -0
- package/src/artifacts/publish/files.ts +19 -6
- package/src/artifacts/publish/index.ts +49 -2
- package/src/artifacts/publish/pdf.ts +3 -1
- package/src/artifacts/publish/previews.ts +22 -8
- package/src/artifacts/publish/publish.ts +4 -1
- package/src/artifacts/publish/validate/html.ts +23 -18
- package/src/artifacts/publish/validate/video.ts +309 -0
- package/src/artifacts/publish/video.ts +235 -0
- package/src/artifacts/resolve.ts +45 -0
- package/src/artifacts/video/README.md +402 -0
- package/src/artifacts/video/composition.ts +898 -0
- package/src/artifacts/video/edit.ts +3967 -0
- package/src/artifacts/video/export.ts +352 -0
- package/src/artifacts/video/looks.ts +694 -0
- package/src/artifacts/video/project.ts +198 -0
- package/src/artifacts/video/stills.ts +168 -0
- package/src/artifacts/video/timeline.ts +658 -0
- package/src/blob-storage/browser.ts +1 -1
- package/src/blob-storage/constants.ts +9 -3
- package/src/blob-storage/download-urls.ts +5 -3
- package/src/blob-storage/index.ts +1 -0
- package/src/blob-storage/internal.ts +13 -2
- package/src/blob-storage/media-type.ts +149 -8
- package/src/bootstrap/discovery.ts +61 -11
- package/src/deploy/index.ts +0 -5
- package/src/deploy/types.ts +8 -63
- package/src/deploy/validation.ts +1 -1
- package/src/env/index.ts +10 -4
- package/src/errors/catalog.ts +2 -1
- package/src/execution/authorization.ts +2 -2
- package/src/execution/kernel-operation.ts +14 -0
- package/src/execution/types.ts +2 -0
- package/src/http/api-routes.ts +117 -0
- package/src/index.ts +21 -1
- package/src/lake-storage/definition-updates.ts +3 -9
- package/src/models/audio/runtime.ts +48 -3
- package/src/models/audio/speech.ts +2 -2
- package/src/models/audio/types.ts +24 -3
- package/src/models/calls.ts +35 -18
- package/src/models/catalog.ts +9 -2
- package/src/models/definitions.ts +4 -2
- package/src/models/errors.ts +5 -3
- package/src/models/events.ts +2 -0
- package/src/models/execution/README.md +68 -2
- package/src/models/execution/index.ts +1 -0
- package/src/models/execution/model-call-limits.ts +11 -5
- package/src/models/execution/model-call-recorder.ts +14 -0
- package/src/models/execution/session.ts +52 -23
- package/src/models/execution/usage.ts +1 -0
- package/src/models/execution.ts +13 -2
- package/src/models/generation-types.ts +2 -0
- package/src/models/index.ts +20 -1
- package/src/models/input-file.ts +7 -2
- package/src/models/pricing.ts +19 -1
- package/src/models/rate-card.ts +15 -3
- package/src/models/tools.ts +5 -0
- package/src/models/video/catalog.ts +101 -0
- package/src/models/video/check.ts +441 -0
- package/src/models/video/runtime.ts +550 -0
- package/src/models/video/types.ts +194 -0
- package/src/objects/execution.ts +2 -0
- package/src/objects/sdk/object-set.ts +2 -0
- package/src/queues/index.ts +5 -0
- package/src/queues/types.ts +126 -5
- package/src/runtime/create.ts +1 -0
- package/src/runtime/definitions.ts +25 -0
- package/src/runtime/host.ts +6 -1
- package/src/runtime/index.ts +6 -1
- package/src/runtime/internal.ts +3 -1
- package/src/runtime/resolve-definitions.ts +7 -1
- package/src/runtime/sixb.ts +12 -4
- package/src/sandboxes/README.md +12 -2
- package/src/sandboxes/errors.ts +27 -0
- package/src/sandboxes/exec.ts +3 -1
- package/src/sandboxes/index.ts +3 -0
- package/src/sandboxes/sandbox.ts +15 -1
- package/src/security/public.ts +6 -4
- package/src/storage/agents/in-memory.ts +39 -0
- package/src/storage/agents/index.ts +1 -0
- package/src/storage/agents/provider.ts +8 -0
- package/src/storage/agents/types.ts +32 -1
- package/src/storage/ai-cost/analytics.ts +2 -0
- package/src/storage/ai-cost/codec.ts +1 -0
- package/src/storage/ai-cost/groups.ts +7 -0
- package/src/storage/ai-cost/types.ts +2 -0
- package/src/storage/ai-cost/validation.ts +2 -0
- package/src/storage/ai-usage/in-memory.ts +93 -0
- package/src/storage/ai-usage/index.ts +10 -0
- package/src/storage/ai-usage/record.ts +106 -0
- package/src/storage/ai-usage/types.ts +102 -1
- package/src/storage/ai-usage/usage.ts +2 -0
- package/src/storage/artifacts/in-memory.ts +108 -11
- package/src/storage/artifacts/index.ts +14 -0
- package/src/storage/artifacts/record.ts +203 -1
- package/src/storage/artifacts/types.ts +199 -6
- package/src/storage/executions/validation.ts +2 -2
- package/src/storage/in-memory/index.ts +1 -1
- package/src/storage/index.ts +22 -1
- package/src/storage/internal.ts +9 -0
- package/src/testing/agent-storage-contract.ts +135 -0
- package/src/testing/ai-cost-storage-contract.ts +1 -0
- package/src/testing/ai-usage-storage-contract.ts +145 -1
- package/src/testing/artifact-storage-contract.ts +330 -0
- package/src/testing/execution-storage-contract.ts +10 -2
- package/src/testing/lake-storage-contract.ts +27 -0
- package/src/testing/queues-contract.ts +71 -0
- package/src/testing/sandboxes-contract.ts +50 -0
- package/dist/chunk-3723kgba.js +0 -29
- package/dist/chunk-3723kgba.js.map +0 -10
- package/dist/chunk-3qtk0070.js.map +0 -14
- package/dist/chunk-8ncg20rd.js.map +0 -10
- package/dist/chunk-9vsc919v.js.map +0 -10
- package/dist/chunk-az95tsh3.js.map +0 -11
- package/dist/chunk-c29729me.js.map +0 -12
- package/dist/chunk-d7vyc7k6.js.map +0 -10
- package/dist/chunk-de5sfbc3.js +0 -3
- package/dist/chunk-f05994as.js.map +0 -10
- package/dist/chunk-gfdh9kqa.js.map +0 -11
- package/dist/chunk-jt012fxq.js.map +0 -34
- package/dist/chunk-mbwsgjn7.js.map +0 -11
- package/dist/chunk-nxysqbt0.js.map +0 -10
- package/dist/chunk-qttqe1ah.js.map +0 -24
- package/dist/chunk-sgx82nnt.js.map +0 -10
- package/dist/chunk-vs2s3p8n.js +0 -2274
- package/dist/chunk-vs2s3p8n.js.map +0 -20
- package/dist/chunk-wkv3h3q7.js.map +0 -12
- package/dist/chunk-wzcjhv54.js.map +0 -11
- package/dist/chunk-xtztwpkh.js.map +0 -12
- package/dist/chunk-ym1bqd98.js.map +0 -19
- /package/dist/{chunk-7mhbs9yy.js.map → chunk-1z8ccj53.js.map} +0 -0
- /package/dist/{chunk-dmnd9ea6.js.map → chunk-30a0ftnm.js.map} +0 -0
- /package/dist/{chunk-qbd282aa.js.map → chunk-39q9ybav.js.map} +0 -0
- /package/dist/{chunk-bcz9dxtf.js.map → chunk-3x902cja.js.map} +0 -0
- /package/dist/{chunk-c4nrycdy.js.map → chunk-4q4a5a96.js.map} +0 -0
- /package/dist/{chunk-ykchk644.js.map → chunk-4w8qzy9w.js.map} +0 -0
- /package/dist/{chunk-kft7mp7z.js.map → chunk-5xkqasvn.js.map} +0 -0
- /package/dist/{chunk-xavet0qs.js.map → chunk-6whr25gw.js.map} +0 -0
- /package/dist/{chunk-ygvay56w.js.map → chunk-896te58g.js.map} +0 -0
- /package/dist/{chunk-pqj8vff9.js.map → chunk-8eqqqc1h.js.map} +0 -0
- /package/dist/{chunk-jka26v8c.js.map → chunk-8x1bsp68.js.map} +0 -0
- /package/dist/{chunk-fmgf9h5e.js.map → chunk-9az7kjv4.js.map} +0 -0
- /package/dist/{chunk-bs1sd0e0.js.map → chunk-9p7kyeqz.js.map} +0 -0
- /package/dist/{chunk-brybqw5k.js.map → chunk-bkxm2dzx.js.map} +0 -0
- /package/dist/{chunk-ppxf7gw2.js.map → chunk-d7t9jnym.js.map} +0 -0
- /package/dist/{chunk-cg7cygfj.js.map → chunk-fdmvaz7x.js.map} +0 -0
- /package/dist/{chunk-191jz8a6.js.map → chunk-ff0qdk7z.js.map} +0 -0
- /package/dist/{chunk-wx7smkn2.js.map → chunk-fq8drkp0.js.map} +0 -0
- /package/dist/{chunk-v8a1qjzp.js.map → chunk-hpswfrjj.js.map} +0 -0
- /package/dist/{chunk-bz5bnjjt.js.map → chunk-jjte0h4p.js.map} +0 -0
- /package/dist/{chunk-xrmbhap8.js.map → chunk-mwg0nwkb.js.map} +0 -0
- /package/dist/{chunk-a3faa34j.js.map → chunk-nfjt8k8j.js.map} +0 -0
- /package/dist/{chunk-394zjzjs.js.map → chunk-nhgqz3g3.js.map} +0 -0
- /package/dist/{chunk-92wrka15.js.map → chunk-q150fnj9.js.map} +0 -0
- /package/dist/{chunk-w3t94hm6.js.map → chunk-qk3zq25v.js.map} +0 -0
- /package/dist/{chunk-6hfbz4d0.js.map → chunk-r588h4ev.js.map} +0 -0
- /package/dist/{chunk-5qqmndhm.js.map → chunk-szzhrn3e.js.map} +0 -0
- /package/dist/{chunk-n1hbwc6y.js.map → chunk-t6pfch4e.js.map} +0 -0
- /package/dist/{chunk-brhp9d97.js.map → chunk-vmqjndb3.js.map} +0 -0
- /package/dist/{chunk-5sswe5ej.js.map → chunk-wsv23wvr.js.map} +0 -0
- /package/dist/{chunk-90nqenq8.js.map → chunk-x0hqc54n.js.map} +0 -0
- /package/dist/{chunk-3neam1y5.js.map → chunk-y3qb965a.js.map} +0 -0
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
validateObjectQueryWithAdmission,
|
|
5
5
|
SYSTEM_PRINCIPAL2,
|
|
6
6
|
principalsEqual2
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-nhgqz3g3.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveRuntimeAuthorizationForProject,
|
|
10
10
|
AuthorizationError2,
|
|
11
11
|
isRuntimeAllowed2
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-e3b1r4d2.js";
|
|
13
13
|
import {
|
|
14
14
|
createArtifactId,
|
|
15
15
|
createArtifactCommentId
|
|
@@ -17,64 +17,82 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
inferFileMediaType2,
|
|
19
19
|
isValidFileRef
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-2138b0ng.js";
|
|
21
21
|
import {
|
|
22
22
|
collectArtifactRefIds
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-1z8ccj53.js";
|
|
24
24
|
import {
|
|
25
25
|
ArtifactStorageError,
|
|
26
26
|
turnUndoable2
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-1g4me5f2.js";
|
|
28
28
|
import {
|
|
29
29
|
ARTIFACT_LIMITS2,
|
|
30
30
|
ARTIFACT_STATE_LIMITS2,
|
|
31
31
|
ARTIFACT_HOLDERS_LIMIT2,
|
|
32
32
|
ARTIFACT_COMMENT_LIMITS2
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-fgxvrxx4.js";
|
|
34
34
|
import {
|
|
35
35
|
computeBlobDigest2
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-mwg0nwkb.js";
|
|
37
37
|
import {
|
|
38
38
|
objectBatchKey2
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-3d9w8t4n.js";
|
|
40
40
|
import {
|
|
41
41
|
objectReadersIn,
|
|
42
42
|
getAuthorizedOntologyView,
|
|
43
43
|
getQueryDiscovery,
|
|
44
44
|
readerClearance
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-9az7kjv4.js";
|
|
46
46
|
import {
|
|
47
47
|
ArtifactRequestError2,
|
|
48
48
|
documentData,
|
|
49
49
|
documentMarks,
|
|
50
50
|
fillDocumentHtml,
|
|
51
51
|
frozenDocumentHtml2,
|
|
52
|
+
isMediaFile2,
|
|
53
|
+
unmadeMediaParts2,
|
|
54
|
+
requestArtifactMedia,
|
|
55
|
+
refreshArtifactMedia,
|
|
56
|
+
retryArtifactMedia,
|
|
52
57
|
checkArtifactFiles,
|
|
53
58
|
readArtifactText,
|
|
59
|
+
titleFileName2,
|
|
54
60
|
invalidArtifact,
|
|
55
|
-
decodeHtmlEntities,
|
|
56
61
|
HTML_ENTRY2,
|
|
57
62
|
refuseFrameAssetPaths,
|
|
58
63
|
readHtmlReferences,
|
|
64
|
+
HYPERFRAMES_VERSION2,
|
|
59
65
|
FRAME_DEFAULT_THEMES2,
|
|
60
66
|
FRAME_CDN_ALLOWLIST2,
|
|
61
67
|
FRAME_ASSETS2,
|
|
62
68
|
serializeArtifactQueryResult2
|
|
63
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-23eaayw4.js";
|
|
64
70
|
import {
|
|
65
71
|
isArtifactAddress2,
|
|
66
72
|
parseArtifactAddress2,
|
|
67
73
|
CANVAS_FILE2,
|
|
68
74
|
parseCanvas2
|
|
69
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-jjte0h4p.js";
|
|
76
|
+
import {
|
|
77
|
+
decodeHtmlEntities,
|
|
78
|
+
VIDEO_ENTRY2,
|
|
79
|
+
missingScene,
|
|
80
|
+
parseVideoRoot,
|
|
81
|
+
parseVideoScene,
|
|
82
|
+
composeVideo,
|
|
83
|
+
videoFilePath,
|
|
84
|
+
cssMoves,
|
|
85
|
+
videoPageMedia
|
|
86
|
+
} from "./chunk-a68zz4r0.js";
|
|
70
87
|
import {
|
|
71
|
-
|
|
88
|
+
isLiveTextPath2,
|
|
72
89
|
createArtifactDocument,
|
|
73
90
|
documentFiles2,
|
|
74
91
|
mergeIntoDocument2,
|
|
75
92
|
holdPage
|
|
76
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-p0c5kkhn.js";
|
|
77
94
|
import {
|
|
95
|
+
videoSceneAt2,
|
|
78
96
|
BOARD_PREVIEW_JOB2,
|
|
79
97
|
BOARD_PREVIEW_WAIT_MS2,
|
|
80
98
|
canvasArrowLine2,
|
|
@@ -103,8 +121,12 @@ import {
|
|
|
103
121
|
liveSheetColumns2,
|
|
104
122
|
sheetColumnsProblem,
|
|
105
123
|
sheetFormulasProblem,
|
|
106
|
-
sheetChartsProblem
|
|
107
|
-
|
|
124
|
+
sheetChartsProblem,
|
|
125
|
+
videoSegmentFrames,
|
|
126
|
+
videoSegmentMiddleMs,
|
|
127
|
+
scenesOnScreen,
|
|
128
|
+
videoFrameCount2
|
|
129
|
+
} from "./chunk-fqms1a8c.js";
|
|
108
130
|
import {
|
|
109
131
|
ObjectQueryValidationError2,
|
|
110
132
|
ObjectQueryPlanningError2,
|
|
@@ -148,7 +170,24 @@ function createAgentThreadAccessRule(runtime, authority, agents) {
|
|
|
148
170
|
const access = readThrough ? accessIn(readThrough) : null;
|
|
149
171
|
return thread && access ? { thread, access } : null;
|
|
150
172
|
};
|
|
151
|
-
|
|
173
|
+
const readConversations = async (threadIds) => {
|
|
174
|
+
if (blocked || threadIds.length === 0)
|
|
175
|
+
return [];
|
|
176
|
+
const storage = agents ?? runtime.storage.agents;
|
|
177
|
+
const stored = await storage?.threads.getByIds({ projectId: runtime.projectId, ids: threadIds }) ?? [];
|
|
178
|
+
const conversations = stored.filter((thread) => thread.kind === "conversation");
|
|
179
|
+
const views = await agentThreadViews(runtime, conversations, storage);
|
|
180
|
+
return views.flatMap((thread) => {
|
|
181
|
+
const access = accessIn(thread);
|
|
182
|
+
return access ? [{ thread, access }] : [];
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
const scope = () => {
|
|
186
|
+
if (blocked || !isRuntimeAllowed2(runtime, { kind: "agent.run" }))
|
|
187
|
+
return "none";
|
|
188
|
+
return authority.type === "principal" ? { reader: caller } : "every";
|
|
189
|
+
};
|
|
190
|
+
return { caller, read, readConversations, scope };
|
|
152
191
|
}
|
|
153
192
|
function assertConversationThread2(thread) {
|
|
154
193
|
if (thread.kind === "conversation")
|
|
@@ -388,37 +427,85 @@ async function checkAnchor(storage, artifact, anchor) {
|
|
|
388
427
|
if (!Number.isSafeInteger(revision) || revision < 1 || revision > artifact.revision) {
|
|
389
428
|
throw invalid(`A comment is about a revision of the artifact, 1 to ${artifact.revision}.`);
|
|
390
429
|
}
|
|
391
|
-
|
|
430
|
+
const { label: named, ...place } = await checkPlace(storage, artifact, anchor);
|
|
431
|
+
const label = (named ?? anchor.label)?.replace(/\s+/g, " ").trim().slice(0, ARTIFACT_COMMENT_LIMITS2.maxLabelLength);
|
|
432
|
+
return { ...place, ...label ? { label } : {}, revision };
|
|
433
|
+
}
|
|
434
|
+
async function checkPlace(storage, artifact, anchor) {
|
|
435
|
+
const { board, element, at, scene, point } = anchor;
|
|
436
|
+
const placed = [board, element, at, scene, point].some((value) => value !== undefined);
|
|
437
|
+
if (!placed)
|
|
438
|
+
return {};
|
|
439
|
+
if (point !== undefined && ![point.x, point.y].every((value) => Number.isFinite(value) && value >= 0 && value <= 1)) {
|
|
440
|
+
throw invalid("A comment's point is on what it is about: x and y from 0 to 1.");
|
|
441
|
+
}
|
|
442
|
+
const latest = async () => (await storage.getVersion({
|
|
443
|
+
projectId: artifact.projectId,
|
|
444
|
+
artifactId: artifact.id,
|
|
445
|
+
version: artifact.latestVersion
|
|
446
|
+
}))?.outline;
|
|
447
|
+
switch (artifact.kind) {
|
|
448
|
+
case "canvas":
|
|
449
|
+
return checkBoardPlace(anchor, latest);
|
|
450
|
+
case "video":
|
|
451
|
+
return checkScenePlace(anchor, latest);
|
|
452
|
+
default:
|
|
453
|
+
throw invalid(`A comment on a ${artifact.kind} is about the whole artifact: it names no board, scene, or instant.`);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
async function checkBoardPlace(anchor, latest) {
|
|
457
|
+
const { board, element, point } = anchor;
|
|
458
|
+
if (anchor.at !== undefined || anchor.scene !== undefined) {
|
|
459
|
+
throw invalid("A comment on a canvas is about a board, not an instant or a scene.");
|
|
460
|
+
}
|
|
461
|
+
if (element !== undefined && board === undefined) {
|
|
392
462
|
throw invalid("A comment on an element names the board it is on.");
|
|
393
463
|
}
|
|
394
|
-
if (
|
|
395
|
-
throw invalid(`'${
|
|
464
|
+
if (element !== undefined && (element.length > MAX_ELEMENT_ADDRESS_LENGTH || !ELEMENT_ADDRESS.test(element))) {
|
|
465
|
+
throw invalid(`'${element}' is no element's address, as a board's elements have.`);
|
|
396
466
|
}
|
|
397
|
-
if (
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
const outline = latest?.outline;
|
|
404
|
-
const shows = outline?.kind === "canvas" && outline.items.some((item) => item.type === "board" && item.id === anchor.board);
|
|
467
|
+
if (point !== undefined && board === undefined) {
|
|
468
|
+
throw invalid("A comment's point is on the board it names.");
|
|
469
|
+
}
|
|
470
|
+
if (board !== undefined) {
|
|
471
|
+
const outline = await latest();
|
|
472
|
+
const shows = outline?.kind === "canvas" && outline.items.some((item) => item.type === "board" && item.id === board);
|
|
405
473
|
if (!shows)
|
|
406
|
-
throw invalid(`The artifact shows no board '${
|
|
474
|
+
throw invalid(`The artifact shows no board '${board}'.`);
|
|
407
475
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
476
|
+
return {
|
|
477
|
+
...board === undefined ? {} : { board },
|
|
478
|
+
...element === undefined ? {} : { element },
|
|
479
|
+
...point === undefined ? {} : { point: { x: point.x, y: point.y } }
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
async function checkScenePlace(anchor, latest) {
|
|
483
|
+
const { at, scene, point } = anchor;
|
|
484
|
+
if (anchor.board !== undefined || anchor.element !== undefined) {
|
|
485
|
+
throw invalid("A comment on a video is about an instant or a scene, not a board.");
|
|
411
486
|
}
|
|
412
|
-
if (point !== undefined &&
|
|
413
|
-
throw invalid("A comment's point is on
|
|
487
|
+
if (point !== undefined && at === undefined) {
|
|
488
|
+
throw invalid("A comment's point is on the frame at its instant: give it `at` too.");
|
|
414
489
|
}
|
|
415
|
-
const
|
|
490
|
+
const outline = await latest();
|
|
491
|
+
if (outline?.kind !== "video")
|
|
492
|
+
throw invalid("The artifact has no video to comment on.");
|
|
493
|
+
if (at !== undefined && !(Number.isSafeInteger(at) && at >= 0 && at <= outline.durationMs)) {
|
|
494
|
+
throw invalid(`A comment's instant is in the video: \`at\` is 0 to ${outline.durationMs} milliseconds.`);
|
|
495
|
+
}
|
|
496
|
+
const named = scene === undefined ? undefined : outline.scenes.find((each) => each.id === scene);
|
|
497
|
+
if (scene !== undefined && !named)
|
|
498
|
+
throw invalid(`The video has no scene '${scene}'.`);
|
|
499
|
+
if (named && at !== undefined && (at < named.startMs || at > named.startMs + named.durationMs)) {
|
|
500
|
+
throw invalid(`Scene '${named.id}' plays from ${named.startMs} to ${named.startMs + named.durationMs} milliseconds: a comment's \`at\` is in the scene it names, or names none.`);
|
|
501
|
+
}
|
|
502
|
+
const playing = named ?? (at === undefined ? undefined : videoSceneAt2(outline, at));
|
|
503
|
+
const instant = at === undefined ? {} : playing ? { offset: at - playing.startMs } : { at };
|
|
416
504
|
return {
|
|
417
|
-
...
|
|
418
|
-
...
|
|
419
|
-
...
|
|
420
|
-
...point === undefined ? {} : { point: { x: point.x, y: point.y } }
|
|
421
|
-
revision
|
|
505
|
+
...playing ? { scene: playing.id } : {},
|
|
506
|
+
...playing?.label === undefined ? {} : { label: playing.label },
|
|
507
|
+
...instant,
|
|
508
|
+
...point === undefined ? {} : { point: { x: point.x, y: point.y } }
|
|
422
509
|
};
|
|
423
510
|
}
|
|
424
511
|
function commentRequestError(error) {
|
|
@@ -509,7 +596,7 @@ import { posix } from "path";
|
|
|
509
596
|
var strictUtf8 = new TextDecoder("utf-8", { fatal: true });
|
|
510
597
|
async function readLiveFiles2(blobStorage, files) {
|
|
511
598
|
const read = await Promise.all(files.map(async ({ path, file }) => {
|
|
512
|
-
if (!
|
|
599
|
+
if (!isLiveTextPath2(path) || file.sizeBytes > ARTIFACT_LIMITS2.maxFileBytes) {
|
|
513
600
|
return [path, { file }];
|
|
514
601
|
}
|
|
515
602
|
const bytes = new Uint8Array(await new Response(await blobStorage.open(file.blobId)).arrayBuffer());
|
|
@@ -550,7 +637,7 @@ function sameArtifactFiles2(left, right) {
|
|
|
550
637
|
|
|
551
638
|
// src/artifacts/live/state.ts
|
|
552
639
|
function keepsDocument2(kind) {
|
|
553
|
-
return kind === "canvas" || kind === "document";
|
|
640
|
+
return kind === "canvas" || kind === "document" || kind === "video";
|
|
554
641
|
}
|
|
555
642
|
async function loadArtifactDocument2(blobStorage, artifact, files) {
|
|
556
643
|
const doc = new Y.Doc;
|
|
@@ -827,7 +914,7 @@ function boardRenderKey(input) {
|
|
|
827
914
|
const reader = boardsReadLiveData2({ files }) ? [author.type, author.id] : null;
|
|
828
915
|
return createHash2("sha256").update(JSON.stringify([
|
|
829
916
|
RENDER_KEY_FORMAT,
|
|
830
|
-
frameKitDigest(),
|
|
917
|
+
frameKitDigest("page"),
|
|
831
918
|
board.file,
|
|
832
919
|
board.w,
|
|
833
920
|
board.h,
|
|
@@ -1007,10 +1094,15 @@ async function storeQueryAnswers(input, version) {
|
|
|
1007
1094
|
mediaType: "application/json"
|
|
1008
1095
|
});
|
|
1009
1096
|
}
|
|
1010
|
-
var
|
|
1011
|
-
function frameKitDigest() {
|
|
1012
|
-
|
|
1013
|
-
|
|
1097
|
+
var kitDigests = new Map;
|
|
1098
|
+
function frameKitDigest(layout) {
|
|
1099
|
+
let digest = kitDigests.get(layout);
|
|
1100
|
+
if (digest === undefined) {
|
|
1101
|
+
const assets = Object.fromEntries(Object.entries(FRAME_ASSETS2).filter(([, asset]) => asset.layout === undefined || asset.layout === layout));
|
|
1102
|
+
digest = createHash2("sha256").update(JSON.stringify([assets, FRAME_DEFAULT_THEMES2])).digest("hex");
|
|
1103
|
+
kitDigests.set(layout, digest);
|
|
1104
|
+
}
|
|
1105
|
+
return digest;
|
|
1014
1106
|
}
|
|
1015
1107
|
|
|
1016
1108
|
// src/artifacts/publish/validate/document-html.ts
|
|
@@ -1334,7 +1426,7 @@ function documentPdfKey2(version, document) {
|
|
|
1334
1426
|
entry.path,
|
|
1335
1427
|
document && entry.path === DOCUMENT_HTML_ENTRY ? document.digest : entry.file.digest
|
|
1336
1428
|
]).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
|
|
1337
|
-
return createHash3("sha256").update(JSON.stringify([RENDER_KEY_FORMAT2, frameKitDigest(), version.artifactId, files])).digest("hex");
|
|
1429
|
+
return createHash3("sha256").update(JSON.stringify([RENDER_KEY_FORMAT2, frameKitDigest("document"), version.artifactId, files])).digest("hex");
|
|
1338
1430
|
}
|
|
1339
1431
|
async function requestDocumentPdf(context, version, options = {}) {
|
|
1340
1432
|
const renderKey = documentPdfKey2(version, options.document);
|
|
@@ -2432,6 +2524,301 @@ async function validateSlides(blobStorage, files) {
|
|
|
2432
2524
|
};
|
|
2433
2525
|
}
|
|
2434
2526
|
|
|
2527
|
+
// src/artifacts/publish/video.ts
|
|
2528
|
+
import { createHash as createHash4 } from "crypto";
|
|
2529
|
+
var RENDER_KEY_FORMAT3 = "sixb-video-scene/1";
|
|
2530
|
+
var HOST_TIMES = ["data-start", "data-duration", "data-label"];
|
|
2531
|
+
var HOST_PLACE = "<!-- scene -->";
|
|
2532
|
+
var HYPERFRAMES_STATE = ".hyperframes/";
|
|
2533
|
+
function sceneRenderKeys(input) {
|
|
2534
|
+
const { index, composition, files, rootLoads, rootTimeline, loads } = input;
|
|
2535
|
+
const { scenes } = composition;
|
|
2536
|
+
const { attributes } = composition.root;
|
|
2537
|
+
const root = cut(index, [
|
|
2538
|
+
...scenes.map((scene) => ({ ...scene.host.element, with: HOST_PLACE })),
|
|
2539
|
+
...[
|
|
2540
|
+
...["data-duration", "data-poster"].flatMap((name) => attributes[name] ?? []),
|
|
2541
|
+
...composition.sounds
|
|
2542
|
+
].map((span) => ({ ...withSpaceBefore(index, span), with: "" }))
|
|
2543
|
+
]);
|
|
2544
|
+
const hostOf = (scene) => {
|
|
2545
|
+
const { element, attributes } = scene.host;
|
|
2546
|
+
const times = HOST_TIMES.flatMap((name) => {
|
|
2547
|
+
const at = attributes[name];
|
|
2548
|
+
return at ? [{ start: at.start - element.start, end: at.end - element.start, with: "" }] : [];
|
|
2549
|
+
});
|
|
2550
|
+
return cut(index.slice(element.start, element.end), times);
|
|
2551
|
+
};
|
|
2552
|
+
const segments = videoSegmentFrames(composition);
|
|
2553
|
+
return new Map(scenes.map((scene) => {
|
|
2554
|
+
const segment = segments.get(scene.id);
|
|
2555
|
+
const beside = (segment ? scenesOnScreen(composition, segment) : [scene]).sort((a, b) => a.host.element.start - b.host.element.start);
|
|
2556
|
+
const loaded = videoSceneFiles2({
|
|
2557
|
+
files,
|
|
2558
|
+
composition,
|
|
2559
|
+
rootLoads,
|
|
2560
|
+
loads,
|
|
2561
|
+
scenes: beside.map((each) => each.id)
|
|
2562
|
+
}).filter(({ path }) => path !== VIDEO_ENTRY2).map((entry) => [entry.path, entry.file.digest]).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
|
|
2563
|
+
const key = [
|
|
2564
|
+
RENDER_KEY_FORMAT3,
|
|
2565
|
+
frameKitDigest("video"),
|
|
2566
|
+
scene.id,
|
|
2567
|
+
sha256(root),
|
|
2568
|
+
beside.map((each) => [hostOf(each), each.startMs - scene.startMs, each.durationMs]),
|
|
2569
|
+
rootTimeline ? scene.startMs : null,
|
|
2570
|
+
loaded
|
|
2571
|
+
];
|
|
2572
|
+
return [scene.id, sha256(JSON.stringify(key))];
|
|
2573
|
+
}));
|
|
2574
|
+
}
|
|
2575
|
+
function videoSceneFiles2(input) {
|
|
2576
|
+
const { files, composition, rootLoads, loads } = input;
|
|
2577
|
+
const sceneFiles = new Set(composition.scenes.map((scene) => scene.src));
|
|
2578
|
+
const own = new Set([...rootLoads, ...input.scenes.flatMap((id) => [...loads.get(id) ?? []])]);
|
|
2579
|
+
return files.filter(({ path, file }) => {
|
|
2580
|
+
const type = file.mediaType ?? "";
|
|
2581
|
+
if (path === VIDEO_ENTRY2)
|
|
2582
|
+
return true;
|
|
2583
|
+
if (type.startsWith("audio/") && !input.sounds)
|
|
2584
|
+
return false;
|
|
2585
|
+
if (own.has(path))
|
|
2586
|
+
return true;
|
|
2587
|
+
if (path.startsWith(HYPERFRAMES_STATE))
|
|
2588
|
+
return false;
|
|
2589
|
+
return !sceneFiles.has(path) && !/^(video|audio)\//.test(type);
|
|
2590
|
+
});
|
|
2591
|
+
}
|
|
2592
|
+
function withSpaceBefore(text, span) {
|
|
2593
|
+
let start = span.start;
|
|
2594
|
+
while (start > 0 && /\s/.test(text[start - 1] ?? ""))
|
|
2595
|
+
start--;
|
|
2596
|
+
return { start, end: span.end };
|
|
2597
|
+
}
|
|
2598
|
+
function videoSoundProject2(input) {
|
|
2599
|
+
const paths = new Set(input.files.map((entry) => entry.path));
|
|
2600
|
+
const exists = (path) => paths.has(path);
|
|
2601
|
+
const heard = new Set;
|
|
2602
|
+
const pages = new Map;
|
|
2603
|
+
for (const [path, html] of input.pages) {
|
|
2604
|
+
const media = videoPageMedia(path, html);
|
|
2605
|
+
for (const { value, muted } of media) {
|
|
2606
|
+
if (muted)
|
|
2607
|
+
continue;
|
|
2608
|
+
const written = value.trim();
|
|
2609
|
+
const played = isArtifactAddress2(written) ? written : videoFilePath(path, written, exists);
|
|
2610
|
+
if (played)
|
|
2611
|
+
heard.add(played);
|
|
2612
|
+
}
|
|
2613
|
+
const cuts = media.filter((each) => each.muted).map((each) => ({ ...each.at, with: "" }));
|
|
2614
|
+
if (cuts.length > 0)
|
|
2615
|
+
pages.set(path, cut(html, cuts));
|
|
2616
|
+
}
|
|
2617
|
+
const isVideo = (file) => (file.mediaType ?? "").startsWith("video/");
|
|
2618
|
+
return {
|
|
2619
|
+
files: input.files.filter(({ path, file }) => !isVideo(file) || heard.has(path)),
|
|
2620
|
+
pages,
|
|
2621
|
+
media: input.media.filter(({ address, file }) => !file || !isVideo(file) || heard.has(address))
|
|
2622
|
+
};
|
|
2623
|
+
}
|
|
2624
|
+
function cut(text, spans) {
|
|
2625
|
+
let out = "";
|
|
2626
|
+
let kept = 0;
|
|
2627
|
+
for (const span of [...spans].sort((a, b) => a.start - b.start)) {
|
|
2628
|
+
out += text.slice(kept, span.start) + span.with;
|
|
2629
|
+
kept = span.end;
|
|
2630
|
+
}
|
|
2631
|
+
return out + text.slice(kept);
|
|
2632
|
+
}
|
|
2633
|
+
function sha256(text) {
|
|
2634
|
+
return createHash4("sha256").update(text).digest("hex");
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2637
|
+
// src/artifacts/publish/validate/video.ts
|
|
2638
|
+
async function validateVideo(blobStorage, files) {
|
|
2639
|
+
const { outline, references } = await readVideoVersion2(blobStorage, files);
|
|
2640
|
+
return { entry: VIDEO_ENTRY2, outline, references };
|
|
2641
|
+
}
|
|
2642
|
+
async function readVideoVersion2(blobStorage, files) {
|
|
2643
|
+
const byPath = new Map(files.map((file) => [file.path, file]));
|
|
2644
|
+
const index = byPath.get(VIDEO_ENTRY2);
|
|
2645
|
+
if (!index) {
|
|
2646
|
+
throw invalidArtifact(`A video needs '${VIDEO_ENTRY2}', its root composition, with a <template> file for each scene and the media they play beside it.`);
|
|
2647
|
+
}
|
|
2648
|
+
refuseFrameAssetPaths(files, "the video");
|
|
2649
|
+
refuseTooManyRecordings(files);
|
|
2650
|
+
refuseLargePages(files);
|
|
2651
|
+
const read = (file) => readArtifactText(blobStorage, file, ARTIFACT_LIMITS2.maxSceneBytes);
|
|
2652
|
+
const indexText = await read(index);
|
|
2653
|
+
const root = parseVideoRoot(indexText);
|
|
2654
|
+
if ("error" in root)
|
|
2655
|
+
throw invalidArtifact(root.error);
|
|
2656
|
+
const scenes = new Map;
|
|
2657
|
+
for (const { id, src } of root.root.scenes) {
|
|
2658
|
+
const file = byPath.get(src);
|
|
2659
|
+
if (!file)
|
|
2660
|
+
throw invalidArtifact(missingScene(id, src));
|
|
2661
|
+
const scene = parseVideoScene(await read(file), src);
|
|
2662
|
+
if ("error" in scene)
|
|
2663
|
+
throw invalidArtifact(scene.error);
|
|
2664
|
+
scenes.set(src, scene.scene);
|
|
2665
|
+
}
|
|
2666
|
+
const composed = composeVideo(root.root, scenes);
|
|
2667
|
+
if ("error" in composed)
|
|
2668
|
+
throw invalidArtifact(composed.error);
|
|
2669
|
+
const { composition } = composed;
|
|
2670
|
+
const references = [];
|
|
2671
|
+
const exists = (path) => byPath.has(path);
|
|
2672
|
+
const nestedFiles = new Map;
|
|
2673
|
+
const parsed = async (file) => {
|
|
2674
|
+
const known = scenes.get(file.path) ?? nestedFiles.get(file.path);
|
|
2675
|
+
if (known)
|
|
2676
|
+
return known;
|
|
2677
|
+
const scene = parseVideoScene(await read(file), file.path);
|
|
2678
|
+
if ("error" in scene)
|
|
2679
|
+
throw invalidArtifact(scene.error);
|
|
2680
|
+
nestedFiles.set(file.path, scene.scene);
|
|
2681
|
+
return scene.scene;
|
|
2682
|
+
};
|
|
2683
|
+
const load = async (path, file, at, nesting, loaded) => {
|
|
2684
|
+
const known = loaded.get(path);
|
|
2685
|
+
if (known)
|
|
2686
|
+
return known;
|
|
2687
|
+
const paths = new Set([
|
|
2688
|
+
path,
|
|
2689
|
+
...played({ file: path, at, media: file.media, exists, references })
|
|
2690
|
+
]);
|
|
2691
|
+
for (const { element, value } of file.compositions) {
|
|
2692
|
+
const nested = videoFilePath(VIDEO_ENTRY2, value, exists);
|
|
2693
|
+
const nestedEntry = nested === undefined ? undefined : byPath.get(nested);
|
|
2694
|
+
const tag = `<${element} data-composition-src="${value.trim()}">`;
|
|
2695
|
+
if (nested === undefined || !nestedEntry) {
|
|
2696
|
+
throw invalidArtifact(`${path}: ${tag} nests a composition that is not one of the video's files: name it by its path from the video's root, such as compositions/lower-third.html.`);
|
|
2697
|
+
}
|
|
2698
|
+
if (nested === path || nesting.includes(nested)) {
|
|
2699
|
+
throw invalidArtifact(`${path}: ${tag} nests '${nested}', which nests ${path} in turn: a composition never holds itself.`);
|
|
2700
|
+
}
|
|
2701
|
+
const nestedFile = await parsed(nestedEntry);
|
|
2702
|
+
for (const each of await load(nested, nestedFile, at, [...nesting, path], loaded)) {
|
|
2703
|
+
paths.add(each);
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
loaded.set(path, paths);
|
|
2707
|
+
return paths;
|
|
2708
|
+
};
|
|
2709
|
+
const rootLoads = played({
|
|
2710
|
+
file: VIDEO_ENTRY2,
|
|
2711
|
+
at: "",
|
|
2712
|
+
media: composition.media,
|
|
2713
|
+
exists,
|
|
2714
|
+
references
|
|
2715
|
+
});
|
|
2716
|
+
const loads = new Map;
|
|
2717
|
+
for (const scene of composition.scenes) {
|
|
2718
|
+
const file = scenes.get(scene.src);
|
|
2719
|
+
if (file)
|
|
2720
|
+
loads.set(scene.id, await load(scene.src, file, scene.id, [], new Map));
|
|
2721
|
+
}
|
|
2722
|
+
const rootTimeline = composition.rootTimeline || await linksMove(composition, byPath, read, exists);
|
|
2723
|
+
const keys = sceneRenderKeys({
|
|
2724
|
+
index: indexText,
|
|
2725
|
+
composition,
|
|
2726
|
+
files,
|
|
2727
|
+
rootLoads,
|
|
2728
|
+
rootTimeline,
|
|
2729
|
+
loads
|
|
2730
|
+
});
|
|
2731
|
+
return {
|
|
2732
|
+
index: indexText,
|
|
2733
|
+
composition,
|
|
2734
|
+
rootLoads,
|
|
2735
|
+
loads,
|
|
2736
|
+
rootTimeline,
|
|
2737
|
+
outline: {
|
|
2738
|
+
kind: "video",
|
|
2739
|
+
width: composition.width,
|
|
2740
|
+
height: composition.height,
|
|
2741
|
+
fps: composition.fps,
|
|
2742
|
+
durationMs: composition.durationMs,
|
|
2743
|
+
...composition.posterMs === undefined ? {} : { posterMs: composition.posterMs },
|
|
2744
|
+
scenes: composition.scenes.map((scene) => ({
|
|
2745
|
+
id: scene.id,
|
|
2746
|
+
...scene.label ? { label: scene.label } : {},
|
|
2747
|
+
startMs: scene.startMs,
|
|
2748
|
+
durationMs: scene.durationMs,
|
|
2749
|
+
renderKey: keys.get(scene.id) ?? ""
|
|
2750
|
+
}))
|
|
2751
|
+
},
|
|
2752
|
+
references
|
|
2753
|
+
};
|
|
2754
|
+
}
|
|
2755
|
+
var FONT_HOSTS = [
|
|
2756
|
+
"https://fonts.googleapis.com",
|
|
2757
|
+
"https://fonts.gstatic.com"
|
|
2758
|
+
];
|
|
2759
|
+
async function linksMove(composition, byPath, read, exists) {
|
|
2760
|
+
const fileOf = (value) => {
|
|
2761
|
+
const path = videoFilePath(VIDEO_ENTRY2, value, exists);
|
|
2762
|
+
return path === undefined ? undefined : byPath.get(path);
|
|
2763
|
+
};
|
|
2764
|
+
const readable = (file) => file.file.sizeBytes <= ARTIFACT_LIMITS2.maxSceneBytes;
|
|
2765
|
+
for (const { value } of composition.links.stylesheets) {
|
|
2766
|
+
const file = fileOf(value);
|
|
2767
|
+
if (!file) {
|
|
2768
|
+
if (!FONT_HOSTS.some((origin) => value.trim().startsWith(`${origin}/`)))
|
|
2769
|
+
return true;
|
|
2770
|
+
continue;
|
|
2771
|
+
}
|
|
2772
|
+
if (!readable(file) || cssMoves(await read(file)))
|
|
2773
|
+
return true;
|
|
2774
|
+
}
|
|
2775
|
+
for (const { value } of composition.links.scripts) {
|
|
2776
|
+
const file = fileOf(value);
|
|
2777
|
+
if (file && (!readable(file) || /__timelines/.test(await read(file))))
|
|
2778
|
+
return true;
|
|
2779
|
+
}
|
|
2780
|
+
return false;
|
|
2781
|
+
}
|
|
2782
|
+
function played(input) {
|
|
2783
|
+
const { file, at, media, exists, references } = input;
|
|
2784
|
+
const paths = new Set;
|
|
2785
|
+
for (const { element, attribute, value } of media) {
|
|
2786
|
+
const written = value.trim();
|
|
2787
|
+
const tag = `<${element} ${attribute}="${written}">`;
|
|
2788
|
+
if (isArtifactAddress2(written)) {
|
|
2789
|
+
if (!parseArtifactAddress2(written)?.path) {
|
|
2790
|
+
throw invalidArtifact(`${file}: ${tag} names no file of that artifact: name one, such as artifact:art_k3m9q2x7tp/media/intro.mp4.`);
|
|
2791
|
+
}
|
|
2792
|
+
references.push({ address: written, as: "embed", at });
|
|
2793
|
+
continue;
|
|
2794
|
+
}
|
|
2795
|
+
if (/^(data|blob):/i.test(written))
|
|
2796
|
+
continue;
|
|
2797
|
+
const path = videoFilePath(file, written, exists);
|
|
2798
|
+
if (path === undefined) {
|
|
2799
|
+
throw invalidArtifact(`${file}: ${tag} plays a file from outside the video, which neither the player nor an export can load: add it to the video, such as media/<name>, and name it by that path.`);
|
|
2800
|
+
}
|
|
2801
|
+
if (!exists(path)) {
|
|
2802
|
+
throw invalidArtifact(`${file}: ${tag} plays '${path}', which is not one of the video's files.`);
|
|
2803
|
+
}
|
|
2804
|
+
paths.add(path);
|
|
2805
|
+
}
|
|
2806
|
+
return paths;
|
|
2807
|
+
}
|
|
2808
|
+
function refuseLargePages(files) {
|
|
2809
|
+
const limit = ARTIFACT_LIMITS2.maxSceneBytes;
|
|
2810
|
+
const large = files.find(({ path, file }) => /\.html?$/i.test(path) && file.sizeBytes > limit);
|
|
2811
|
+
if (large) {
|
|
2812
|
+
throw invalidArtifact(`'${large.path}' is ${large.file.sizeBytes} bytes: each of a video's HTML files holds at most ${limit}.`);
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2815
|
+
function refuseTooManyRecordings(files) {
|
|
2816
|
+
const recordings = files.filter(({ file }) => /^(video|audio)\//.test(file.mediaType ?? ""));
|
|
2817
|
+
if (recordings.length > ARTIFACT_LIMITS2.maxVideoMediaFiles) {
|
|
2818
|
+
throw invalidArtifact(`A video holds at most ${ARTIFACT_LIMITS2.maxVideoMediaFiles} video and sound files; this one has ${recordings.length}. Leave out the ones it no longer plays.`);
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
|
|
2435
2822
|
// src/artifacts/publish/publish.ts
|
|
2436
2823
|
var CREATE_ATTEMPTS = 3;
|
|
2437
2824
|
var LIVE_BOARD_PREVIEWS = {
|
|
@@ -2445,7 +2832,7 @@ async function publishArtifact2(context, input, access) {
|
|
|
2445
2832
|
}
|
|
2446
2833
|
async function prepareArtifactVersion2(context, input) {
|
|
2447
2834
|
const title = checkTitle(input.title);
|
|
2448
|
-
await checkArtifactFiles(context.blobStorage, input.files);
|
|
2835
|
+
await checkArtifactFiles(context.blobStorage, input.kind, input.files);
|
|
2449
2836
|
const theme = input.kind === "file" ? undefined : await readTheme(context.blobStorage, input.files);
|
|
2450
2837
|
const document = input.kind === "document" ? await validateDocument(context.blobStorage, input.files) : null;
|
|
2451
2838
|
const queries = await checkArtifactQueries(context.blobStorage, input.kind, input.files, input.checkQuery, document?.outline.holder ? { holder: document.outline.holder.objectTypeId } : {});
|
|
@@ -2534,6 +2921,8 @@ async function validateKind(blobStorage, kind, files, queries) {
|
|
|
2534
2921
|
return validatePage(blobStorage, files);
|
|
2535
2922
|
case "canvas":
|
|
2536
2923
|
return validateCanvas(blobStorage, files);
|
|
2924
|
+
case "video":
|
|
2925
|
+
return validateVideo(blobStorage, files);
|
|
2537
2926
|
default:
|
|
2538
2927
|
throw invalidArtifact(`'${kind}' is not a kind of artifact.`);
|
|
2539
2928
|
}
|
|
@@ -2610,6 +2999,250 @@ async function createArtifact(context, prepared) {
|
|
|
2610
2999
|
}
|
|
2611
3000
|
}
|
|
2612
3001
|
|
|
3002
|
+
// src/artifacts/video/export.ts
|
|
3003
|
+
import { createHash as createHash5 } from "crypto";
|
|
3004
|
+
var VIDEO_ENGINE2 = `hyperframes@${HYPERFRAMES_VERSION2}`;
|
|
3005
|
+
var VIDEO_SEGMENT_SETTINGS2 = { crf: 20, keyframeSeconds: 2, workers: 2 };
|
|
3006
|
+
var VIDEO_EXPORT_JOB2 = {
|
|
3007
|
+
timeoutMs: 20 * 60000,
|
|
3008
|
+
attempts: 3,
|
|
3009
|
+
backoffMs: 15000,
|
|
3010
|
+
recheckMs: 5000,
|
|
3011
|
+
waitMs: 12 * 60 * 60000
|
|
3012
|
+
};
|
|
3013
|
+
var VIDEO_SEGMENT_JOB2 = { attempts: 2, backoffMs: 30000 };
|
|
3014
|
+
function videoSegmentTimeoutMs2(segment, video) {
|
|
3015
|
+
if (segment.kind === "sound")
|
|
3016
|
+
return 5 * 60000 + video.durationMs;
|
|
3017
|
+
const seconds = (segment.endFrame - segment.startFrame) / video.fps;
|
|
3018
|
+
const pixels = Math.max(1, video.width * video.height / (1920 * 1080));
|
|
3019
|
+
return 5 * 60000 + Math.ceil(seconds * pixels * 20000);
|
|
3020
|
+
}
|
|
3021
|
+
var EXPORT_FORMAT = "sixb-video-export/1";
|
|
3022
|
+
var SEGMENT_FORMAT = "sixb-video-segment/1";
|
|
3023
|
+
var SOUND_FORMAT = "sixb-video-sound/1";
|
|
3024
|
+
function videoExportPlan2(source) {
|
|
3025
|
+
const { outline } = source;
|
|
3026
|
+
const { fps } = outline;
|
|
3027
|
+
const frames = videoFrameCount2(outline.durationMs, fps);
|
|
3028
|
+
const cuts = videoSegmentFrames(outline);
|
|
3029
|
+
const scenes = outline.scenes.flatMap((scene) => {
|
|
3030
|
+
const cut = cuts.get(scene.id);
|
|
3031
|
+
if (cut?.scene !== scene.id)
|
|
3032
|
+
return [];
|
|
3033
|
+
const { startFrame, endFrame } = cut;
|
|
3034
|
+
const beside = scenesOnScreen(outline, cut);
|
|
3035
|
+
const key = hash([
|
|
3036
|
+
SEGMENT_FORMAT,
|
|
3037
|
+
VIDEO_ENGINE2,
|
|
3038
|
+
VIDEO_SEGMENT_SETTINGS2,
|
|
3039
|
+
scene.renderKey,
|
|
3040
|
+
Math.round((startFrame * 1000 / fps - scene.startMs) * 1000) / 1000,
|
|
3041
|
+
endFrame - startFrame,
|
|
3042
|
+
resolved(source, ["", ...beside.map((each) => each.id)])
|
|
3043
|
+
]);
|
|
3044
|
+
const label = scene.label ? { label: scene.label } : {};
|
|
3045
|
+
return [{ kind: "scene", scene: scene.id, ...label, startFrame, endFrame, key }];
|
|
3046
|
+
});
|
|
3047
|
+
const sound = {
|
|
3048
|
+
kind: "sound",
|
|
3049
|
+
key: hash([
|
|
3050
|
+
SOUND_FORMAT,
|
|
3051
|
+
VIDEO_ENGINE2,
|
|
3052
|
+
fps,
|
|
3053
|
+
frames,
|
|
3054
|
+
sorted(source.files.map((entry) => [entry.path, entry.file.digest])),
|
|
3055
|
+
resolved(source)
|
|
3056
|
+
])
|
|
3057
|
+
};
|
|
3058
|
+
const segments = [...scenes, sound];
|
|
3059
|
+
return { key: hash([EXPORT_FORMAT, segments.map((each) => each.key)]), frames, segments };
|
|
3060
|
+
}
|
|
3061
|
+
function videoExportJobId2(key) {
|
|
3062
|
+
return `art_vexp_${key}`;
|
|
3063
|
+
}
|
|
3064
|
+
function videoExportRetryJobId(key) {
|
|
3065
|
+
return `art_vexp_retry_${key}`;
|
|
3066
|
+
}
|
|
3067
|
+
function videoSegmentJobId2(key) {
|
|
3068
|
+
return `art_vseg_${key}`;
|
|
3069
|
+
}
|
|
3070
|
+
function videoExportStatus2(plan, kept) {
|
|
3071
|
+
const byKey = new Map(kept.map((record) => [record.key, record]));
|
|
3072
|
+
const done = byKey.get(plan.key);
|
|
3073
|
+
if (done && "failure" in done)
|
|
3074
|
+
return failed(done);
|
|
3075
|
+
if (done)
|
|
3076
|
+
return { status: "ready", file: done.file };
|
|
3077
|
+
for (const segment of plan.segments) {
|
|
3078
|
+
const record = byKey.get(segment.key);
|
|
3079
|
+
if (record && "failure" in record)
|
|
3080
|
+
return failed(record);
|
|
3081
|
+
}
|
|
3082
|
+
return { status: "rendering", progress: videoExportProgress(plan, kept) };
|
|
3083
|
+
}
|
|
3084
|
+
function failed(record) {
|
|
3085
|
+
const lacks = record.lacks ? { lacks: record.lacks } : {};
|
|
3086
|
+
return { status: "failed", reason: record.failure, ...lacks };
|
|
3087
|
+
}
|
|
3088
|
+
function videoExportProgress(plan, kept) {
|
|
3089
|
+
const rendered = new Set(kept.flatMap((record) => ("failure" in record) ? [] : [record.key]));
|
|
3090
|
+
const ready = plan.segments.filter((segment) => rendered.has(segment.key)).length;
|
|
3091
|
+
const total = plan.segments.length;
|
|
3092
|
+
return { ready, total, assembling: ready === total };
|
|
3093
|
+
}
|
|
3094
|
+
function videoExportKeys2(plan) {
|
|
3095
|
+
return [plan.key, ...plan.segments.map((segment) => segment.key)];
|
|
3096
|
+
}
|
|
3097
|
+
async function requestVideoExport(context, version, source, options) {
|
|
3098
|
+
const { plan } = options;
|
|
3099
|
+
if (options.retry) {
|
|
3100
|
+
await context.storage.clearVideoRenderFailures({
|
|
3101
|
+
projectId: version.projectId,
|
|
3102
|
+
keys: videoExportKeys2(plan)
|
|
3103
|
+
});
|
|
3104
|
+
}
|
|
3105
|
+
await context.queue.enqueue({
|
|
3106
|
+
projectId: version.projectId,
|
|
3107
|
+
jobs: [
|
|
3108
|
+
{
|
|
3109
|
+
...options.retry ? { id: videoExportRetryJobId(plan.key), replace: true } : { id: videoExportJobId2(plan.key) },
|
|
3110
|
+
type: "artifact.video.export.requested",
|
|
3111
|
+
payload: {
|
|
3112
|
+
artifactId: version.artifactId,
|
|
3113
|
+
version: version.version,
|
|
3114
|
+
key: plan.key,
|
|
3115
|
+
outline: source.outline,
|
|
3116
|
+
files: source.files,
|
|
3117
|
+
references: source.references,
|
|
3118
|
+
media: source.media,
|
|
3119
|
+
askedAt: new Date().toISOString(),
|
|
3120
|
+
...options.retry ? { retry: true } : {}
|
|
3121
|
+
}
|
|
3122
|
+
}
|
|
3123
|
+
]
|
|
3124
|
+
});
|
|
3125
|
+
await context.storage.putVideoExportAsk({
|
|
3126
|
+
projectId: version.projectId,
|
|
3127
|
+
key: plan.key,
|
|
3128
|
+
askedAt: new Date
|
|
3129
|
+
});
|
|
3130
|
+
}
|
|
3131
|
+
async function resolveVideoMedia2(version, read) {
|
|
3132
|
+
const addresses = [
|
|
3133
|
+
...new Set(version.references.filter((each) => each.as === "embed").map((each) => each.address))
|
|
3134
|
+
];
|
|
3135
|
+
const media = [];
|
|
3136
|
+
for (const address of addresses) {
|
|
3137
|
+
const parsed = parseArtifactAddress2(address);
|
|
3138
|
+
if (!parsed?.path)
|
|
3139
|
+
continue;
|
|
3140
|
+
const target = await read(parsed.artifactId, parsed.version ?? "latest").catch(() => null);
|
|
3141
|
+
const file = target?.files.find((each) => each.path === parsed.path)?.file;
|
|
3142
|
+
media.push(file ? { address, file } : { address });
|
|
3143
|
+
}
|
|
3144
|
+
return media;
|
|
3145
|
+
}
|
|
3146
|
+
function resolved(source, at) {
|
|
3147
|
+
const played = new Set(source.references.filter((reference) => at === undefined || at.includes(reference.at)).map((reference) => reference.address));
|
|
3148
|
+
return sorted(source.media.filter((each) => played.has(each.address)).map((each) => [each.address, each.file?.digest ?? null]));
|
|
3149
|
+
}
|
|
3150
|
+
function sorted(pairs) {
|
|
3151
|
+
return [...pairs].sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
|
|
3152
|
+
}
|
|
3153
|
+
function hash(value) {
|
|
3154
|
+
return createHash5("sha256").update(JSON.stringify(value)).digest("hex");
|
|
3155
|
+
}
|
|
3156
|
+
|
|
3157
|
+
// src/artifacts/video/stills.ts
|
|
3158
|
+
import { createHash as createHash6 } from "crypto";
|
|
3159
|
+
var VIDEO_STILLS_JOB2 = {
|
|
3160
|
+
timeoutMs: 10 * 60000,
|
|
3161
|
+
attempts: 3,
|
|
3162
|
+
backoffMs: 30000,
|
|
3163
|
+
settleMs: 15000
|
|
3164
|
+
};
|
|
3165
|
+
var VIDEO_STILL_WIDTH2 = 1280;
|
|
3166
|
+
var STILL_FORMAT = "sixb-video-still/1";
|
|
3167
|
+
var POSTER_FORMAT = "sixb-video-poster/1";
|
|
3168
|
+
function videoSceneStills2(outline) {
|
|
3169
|
+
const segments = videoSegmentFrames(outline);
|
|
3170
|
+
return outline.scenes.flatMap((scene) => {
|
|
3171
|
+
const segment = segments.get(scene.id);
|
|
3172
|
+
if (!segment)
|
|
3173
|
+
return [];
|
|
3174
|
+
const atMs = videoSegmentMiddleMs(segment, outline.fps);
|
|
3175
|
+
const key = hash2([STILL_FORMAT, VIDEO_ENGINE2, scene.renderKey, atMs - scene.startMs]);
|
|
3176
|
+
return [{ key, atMs, scene: scene.id }];
|
|
3177
|
+
});
|
|
3178
|
+
}
|
|
3179
|
+
function videoStills2(outline) {
|
|
3180
|
+
const scenes = videoSceneStills2(outline);
|
|
3181
|
+
const poster = posterStill(outline);
|
|
3182
|
+
return poster ? [...scenes, poster] : scenes;
|
|
3183
|
+
}
|
|
3184
|
+
function videoPoster2(outline) {
|
|
3185
|
+
const [first] = videoStills2(outline);
|
|
3186
|
+
return posterStill(outline) ?? first;
|
|
3187
|
+
}
|
|
3188
|
+
function posterStill(outline) {
|
|
3189
|
+
const { posterMs } = outline;
|
|
3190
|
+
if (posterMs === undefined)
|
|
3191
|
+
return;
|
|
3192
|
+
const scene = [...outline.scenes].reverse().find((each) => each.startMs <= posterMs) ?? outline.scenes[0];
|
|
3193
|
+
if (!scene)
|
|
3194
|
+
return;
|
|
3195
|
+
return {
|
|
3196
|
+
key: hash2([POSTER_FORMAT, VIDEO_ENGINE2, scene.renderKey, posterMs - scene.startMs]),
|
|
3197
|
+
atMs: posterMs,
|
|
3198
|
+
scene: scene.id
|
|
3199
|
+
};
|
|
3200
|
+
}
|
|
3201
|
+
async function missingVideoStills2(storage, version) {
|
|
3202
|
+
if (version.outline.kind !== "video")
|
|
3203
|
+
return [];
|
|
3204
|
+
const stills = videoStills2(version.outline);
|
|
3205
|
+
const kept = await storage.listVideoRenders({
|
|
3206
|
+
projectId: version.projectId,
|
|
3207
|
+
keys: stills.map((still) => still.key)
|
|
3208
|
+
});
|
|
3209
|
+
const done = new Set(kept.flatMap((record) => ("failure" in record) ? [] : [record.key]));
|
|
3210
|
+
return stills.filter((still) => !done.has(still.key));
|
|
3211
|
+
}
|
|
3212
|
+
function videoStillsJobId(artifactId) {
|
|
3213
|
+
return `art_vstills_${artifactId}`;
|
|
3214
|
+
}
|
|
3215
|
+
async function requestVideoStills(input, version) {
|
|
3216
|
+
if (version.outline.kind !== "video")
|
|
3217
|
+
return;
|
|
3218
|
+
try {
|
|
3219
|
+
if ((await missingVideoStills2(input.storage, version)).length === 0)
|
|
3220
|
+
return;
|
|
3221
|
+
await input.queue.enqueue({
|
|
3222
|
+
projectId: version.projectId,
|
|
3223
|
+
jobs: [
|
|
3224
|
+
{
|
|
3225
|
+
id: videoStillsJobId(version.artifactId),
|
|
3226
|
+
replace: true,
|
|
3227
|
+
type: "artifact.video.stills.requested",
|
|
3228
|
+
payload: {
|
|
3229
|
+
artifactId: version.artifactId,
|
|
3230
|
+
version: version.version,
|
|
3231
|
+
updatedAt: version.updatedAt.toISOString(),
|
|
3232
|
+
media: await resolveVideoMedia2(version, input.read)
|
|
3233
|
+
},
|
|
3234
|
+
availableAt: new Date(Date.now() + VIDEO_STILLS_JOB2.settleMs).toISOString()
|
|
3235
|
+
}
|
|
3236
|
+
]
|
|
3237
|
+
});
|
|
3238
|
+
} catch (error) {
|
|
3239
|
+
console.error(`[Sixb] Could not ask for the stills of version ${version.version} of '${version.artifactId}'; its scenes show without pictures.`, error);
|
|
3240
|
+
}
|
|
3241
|
+
}
|
|
3242
|
+
function hash2(value) {
|
|
3243
|
+
return createHash6("sha256").update(JSON.stringify(value)).digest("hex");
|
|
3244
|
+
}
|
|
3245
|
+
|
|
2613
3246
|
// src/artifacts/execution.ts
|
|
2614
3247
|
var publishers = new WeakMap;
|
|
2615
3248
|
function publisherOf(artifacts) {
|
|
@@ -2791,10 +3424,25 @@ function createArtifactsRuntime(runtime, blobStorage, options = {}) {
|
|
|
2791
3424
|
}
|
|
2792
3425
|
return { objectTypeId: holder.objectTypeId, primaryId };
|
|
2793
3426
|
};
|
|
3427
|
+
const mediaContext = (storage) => ({
|
|
3428
|
+
storage,
|
|
3429
|
+
queue: runtime.queues.renders,
|
|
3430
|
+
transcribes: options.transcribesMedia === true
|
|
3431
|
+
});
|
|
2794
3432
|
const requestPreviews = async (version, requestOptions) => {
|
|
2795
3433
|
const storage = runtime.storage.artifacts;
|
|
2796
3434
|
if (!options.rendersInSandboxes || !storage)
|
|
2797
3435
|
return;
|
|
3436
|
+
const borrowed = await borrowedRecordings(version);
|
|
3437
|
+
await requestArtifactMedia(mediaContext(storage), {
|
|
3438
|
+
...version,
|
|
3439
|
+
files: [...version.files, ...borrowed]
|
|
3440
|
+
});
|
|
3441
|
+
await requestVideoStills({
|
|
3442
|
+
storage,
|
|
3443
|
+
queue: runtime.queues.renders,
|
|
3444
|
+
read: (id, number) => artifacts.getVersion(id, number)
|
|
3445
|
+
}, version);
|
|
2798
3446
|
await requestBoardPreviews({
|
|
2799
3447
|
storage,
|
|
2800
3448
|
queue: runtime.queues.renders,
|
|
@@ -2802,6 +3450,25 @@ function createArtifactsRuntime(runtime, blobStorage, options = {}) {
|
|
|
2802
3450
|
query: (name) => artifacts.query(version.artifactId, name, { version: version.version })
|
|
2803
3451
|
}, version, requestOptions);
|
|
2804
3452
|
};
|
|
3453
|
+
const borrowedRecordings = async (version) => {
|
|
3454
|
+
if (version.outline.kind !== "video")
|
|
3455
|
+
return [];
|
|
3456
|
+
const recordings = [];
|
|
3457
|
+
try {
|
|
3458
|
+
for (const reference of version.references) {
|
|
3459
|
+
const address = parseArtifactAddress2(reference.address);
|
|
3460
|
+
if (reference.as !== "embed" || !address?.path)
|
|
3461
|
+
continue;
|
|
3462
|
+
const lender = await readVersion(address.artifactId, reference.resolvedVersion);
|
|
3463
|
+
const file = lender?.version.files.find((candidate) => candidate.path === address.path);
|
|
3464
|
+
if (file && isMediaFile2(file))
|
|
3465
|
+
recordings.push(file);
|
|
3466
|
+
}
|
|
3467
|
+
} catch (error) {
|
|
3468
|
+
console.error(`[Sixb] Could not read the recordings version ${version.version} of '${version.artifactId}' plays from other artifacts; they play as they are.`, error);
|
|
3469
|
+
}
|
|
3470
|
+
return recordings;
|
|
3471
|
+
};
|
|
2805
3472
|
const reach = async (artifactId) => {
|
|
2806
3473
|
const artifact = await requireStorage().get({ projectId: runtime.projectId, id: artifactId });
|
|
2807
3474
|
return artifact ? { artifact, access: await rule().accessTo(artifact) } : null;
|
|
@@ -3089,6 +3756,85 @@ function createArtifactsRuntime(runtime, blobStorage, options = {}) {
|
|
|
3089
3756
|
});
|
|
3090
3757
|
return { status: "printing", ...keyed };
|
|
3091
3758
|
},
|
|
3759
|
+
async media(artifactId, mediaOptions) {
|
|
3760
|
+
const read = await readVersion(artifactId, mediaOptions.version ?? "latest");
|
|
3761
|
+
if (!read)
|
|
3762
|
+
return null;
|
|
3763
|
+
const { version } = read;
|
|
3764
|
+
const file = version.files.find((candidate) => candidate.path === mediaOptions.path);
|
|
3765
|
+
if (!file || !isMediaFile2(file)) {
|
|
3766
|
+
throw invalidArtifact(`Version ${version.version} of '${artifactId}' holds no video or sound at '${mediaOptions.path}'.`);
|
|
3767
|
+
}
|
|
3768
|
+
const storage = requireStorage();
|
|
3769
|
+
const media = { version: version.version, path: file.path, file: file.file };
|
|
3770
|
+
const [kept] = await storage.listMedia({
|
|
3771
|
+
projectId: runtime.projectId,
|
|
3772
|
+
digests: [file.file.digest]
|
|
3773
|
+
});
|
|
3774
|
+
if (!options.rendersInSandboxes) {
|
|
3775
|
+
const reason = "This project has no sandboxes to derive it in.";
|
|
3776
|
+
const lacking = { status: "unavailable", reason, lacks: "sandboxes" };
|
|
3777
|
+
return { ...media, parts: kept?.parts ?? unmadeMediaParts2(() => lacking) };
|
|
3778
|
+
}
|
|
3779
|
+
const context = mediaContext(storage);
|
|
3780
|
+
if (kept && mediaOptions.retry) {
|
|
3781
|
+
return { ...media, parts: await retryArtifactMedia(context, kept, file.file) };
|
|
3782
|
+
}
|
|
3783
|
+
if (kept && mediaOptions.derive === false)
|
|
3784
|
+
return { ...media, parts: kept.parts };
|
|
3785
|
+
if (kept)
|
|
3786
|
+
return { ...media, parts: await refreshArtifactMedia(context, kept, file.file) };
|
|
3787
|
+
if (mediaOptions.derive !== false)
|
|
3788
|
+
await requestArtifactMedia(context, version);
|
|
3789
|
+
return { ...media, parts: unmadeMediaParts2(() => ({ status: "pending" })) };
|
|
3790
|
+
},
|
|
3791
|
+
async video(artifactId, videoOptions = {}) {
|
|
3792
|
+
const read = await readVersion(artifactId, videoOptions.version ?? "latest");
|
|
3793
|
+
if (!read)
|
|
3794
|
+
return null;
|
|
3795
|
+
const { version } = read;
|
|
3796
|
+
const { outline } = version;
|
|
3797
|
+
if (outline.kind !== "video") {
|
|
3798
|
+
throw invalidArtifact(`Version ${version.version} of '${artifactId}' is not a video, which alone renders to MP4.`);
|
|
3799
|
+
}
|
|
3800
|
+
const media = await resolveVideoMedia2(version, (id, number) => artifacts.getVersion(id, number));
|
|
3801
|
+
const source = { outline, files: version.files, references: version.references, media };
|
|
3802
|
+
const plan = videoExportPlan2(source);
|
|
3803
|
+
const storage = requireStorage();
|
|
3804
|
+
const kept = await storage.listVideoRenders({
|
|
3805
|
+
projectId: runtime.projectId,
|
|
3806
|
+
keys: videoExportKeys2(plan)
|
|
3807
|
+
});
|
|
3808
|
+
const status = videoExportStatus2(plan, kept);
|
|
3809
|
+
const progress = () => videoExportProgress(plan, kept);
|
|
3810
|
+
if (status.status === "ready") {
|
|
3811
|
+
const fileName = `${titleFileName2(version.title, "Video")}.mp4`;
|
|
3812
|
+
return {
|
|
3813
|
+
status: "ready",
|
|
3814
|
+
file: { ...status.file, fileName },
|
|
3815
|
+
durationMs: outline.durationMs,
|
|
3816
|
+
sizeBytes: status.file.sizeBytes
|
|
3817
|
+
};
|
|
3818
|
+
}
|
|
3819
|
+
if (status.status === "failed" && !videoOptions.retry)
|
|
3820
|
+
return status;
|
|
3821
|
+
if (videoOptions.render === false) {
|
|
3822
|
+
const asked = await storage.getVideoExportAsk({
|
|
3823
|
+
projectId: runtime.projectId,
|
|
3824
|
+
key: plan.key
|
|
3825
|
+
});
|
|
3826
|
+
return asked ? { status: "rendering", progress: progress() } : { status: "idle" };
|
|
3827
|
+
}
|
|
3828
|
+
if (!options.rendersInSandboxes) {
|
|
3829
|
+
throw new ArtifactRequestError2("video_unavailable", "[Sixb] A video renders to MP4 in sandboxes, and this project has no sandbox provider.");
|
|
3830
|
+
}
|
|
3831
|
+
const retry = status.status === "failed";
|
|
3832
|
+
await requestVideoExport({ storage, queue: runtime.queues.renders }, version, source, {
|
|
3833
|
+
plan,
|
|
3834
|
+
retry
|
|
3835
|
+
});
|
|
3836
|
+
return { status: "rendering", progress: progress() };
|
|
3837
|
+
},
|
|
3092
3838
|
async query(artifactId, name, options = {}) {
|
|
3093
3839
|
const read = await readVersion(artifactId, options.version ?? "latest");
|
|
3094
3840
|
if (!read)
|
|
@@ -3204,6 +3950,6 @@ function notFound3(artifactId) {
|
|
|
3204
3950
|
return new ArtifactRequestError2("artifact_not_found", `[Sixb] Artifact '${artifactId}' was not found.`);
|
|
3205
3951
|
}
|
|
3206
3952
|
|
|
3207
|
-
export { agentRunEndedShort, createAgentThreadAccessRule, assertConversationThread2, conversationThreadId2, agentThreadViews, announceArtifactUpdates, readLiveFiles2, storeLiveFiles2, sameArtifactFiles2, keepsDocument2, loadArtifactDocument2, readDocumentState2, firstArtifactDocument, withMergedWrite, undoneTurnDocuments, answerArtifactQueries2, parseArtifactQueryAnswers2, BOARD_PREVIEW_MEDIA_TYPES2, MAX_BOARD_PREVIEW_BYTES2, boardRenderKey, boardPreviewsOfCopy, boardsReadLiveData2, boardPreviews2, boardPreview2, missingBoardPreviews2, boardPreviewStatuses2, storeBoardPreviews2, MAX_DOCUMENT_PDF_BYTES2, documentPdfKey2, publishArtifact2, prepareArtifactVersion2, storeArtifactVersion2, artifactVersionWarnings2, artifactAccessRule2, artifactTransactionRules, artifactQueryChecker2, artifactPreviewRequester, writeLiveArtifact2, createRuntimeArtifactAccessRule, transactionArtifactAccessRules, updatableArtifactIds, createArtifactsRuntime };
|
|
3953
|
+
export { agentRunEndedShort, createAgentThreadAccessRule, assertConversationThread2, conversationThreadId2, agentThreadViews, announceArtifactUpdates, readLiveFiles2, storeLiveFiles2, sameArtifactFiles2, keepsDocument2, loadArtifactDocument2, readDocumentState2, firstArtifactDocument, withMergedWrite, undoneTurnDocuments, answerArtifactQueries2, parseArtifactQueryAnswers2, BOARD_PREVIEW_MEDIA_TYPES2, MAX_BOARD_PREVIEW_BYTES2, boardRenderKey, boardPreviewsOfCopy, boardsReadLiveData2, boardPreviews2, boardPreview2, missingBoardPreviews2, boardPreviewStatuses2, storeBoardPreviews2, MAX_DOCUMENT_PDF_BYTES2, documentPdfKey2, videoSceneFiles2, videoSoundProject2, readVideoVersion2, publishArtifact2, prepareArtifactVersion2, storeArtifactVersion2, artifactVersionWarnings2, VIDEO_ENGINE2, VIDEO_SEGMENT_SETTINGS2, VIDEO_EXPORT_JOB2, VIDEO_SEGMENT_JOB2, videoSegmentTimeoutMs2, videoExportPlan2, videoExportJobId2, videoSegmentJobId2, videoExportStatus2, videoExportKeys2, resolveVideoMedia2, VIDEO_STILLS_JOB2, VIDEO_STILL_WIDTH2, videoSceneStills2, videoStills2, videoPoster2, missingVideoStills2, artifactAccessRule2, artifactTransactionRules, artifactQueryChecker2, artifactPreviewRequester, writeLiveArtifact2, createRuntimeArtifactAccessRule, transactionArtifactAccessRules, updatableArtifactIds, createArtifactsRuntime };
|
|
3208
3954
|
|
|
3209
|
-
//# debugId=
|
|
3955
|
+
//# debugId=AE409D6B61EF8AD264756E2164756E21
|