@sixb/core 0.2.2 → 0.2.3
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 +55 -49
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run/executor.d.ts +0 -2
- package/dist/actions/run/executor.d.ts.map +1 -1
- package/dist/actions/types/context.d.ts +5 -1
- package/dist/actions/types/context.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +2 -1
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/fork.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 +82 -75
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/request.d.ts +7 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/run-artifacts.d.ts +73 -10
- package/dist/agents/run-artifacts.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.d.ts +3 -0
- package/dist/agents/run-session.d.ts.map +1 -1
- package/dist/agents/streams/index.js +2 -2
- package/dist/agents/streams/internal.js +2 -2
- package/dist/agents/streams/protocol.d.ts.map +1 -1
- package/dist/agents/validation.d.ts +1 -1
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/artifacts/access.d.ts +37 -17
- package/dist/artifacts/access.d.ts.map +1 -1
- package/dist/artifacts/canvas-display.d.ts +65 -0
- package/dist/artifacts/canvas-display.d.ts.map +1 -0
- package/dist/artifacts/canvas.d.ts +6 -1
- package/dist/artifacts/canvas.d.ts.map +1 -1
- package/dist/artifacts/comment-text.d.ts +19 -0
- package/dist/artifacts/comment-text.d.ts.map +1 -0
- package/dist/artifacts/comments.d.ts +52 -0
- package/dist/artifacts/comments.d.ts.map +1 -0
- package/dist/artifacts/errors.d.ts +3 -3
- package/dist/artifacts/errors.d.ts.map +1 -1
- package/dist/artifacts/events.d.ts +14 -0
- package/dist/artifacts/events.d.ts.map +1 -0
- package/dist/artifacts/execution.d.ts +129 -22
- package/dist/artifacts/execution.d.ts.map +1 -1
- package/dist/artifacts/frames/assets.d.ts +12 -1
- package/dist/artifacts/frames/assets.d.ts.map +1 -1
- package/dist/artifacts/frames/grants.d.ts +8 -5
- package/dist/artifacts/frames/grants.d.ts.map +1 -1
- package/dist/artifacts/frames/index.d.ts +1 -1
- package/dist/artifacts/frames/index.d.ts.map +1 -1
- package/dist/artifacts/frames/index.js +32 -964
- package/dist/artifacts/frames/index.js.map +4 -8
- package/dist/artifacts/frames/kit.d.ts.map +1 -1
- package/dist/artifacts/frames/protocol.d.ts +78 -0
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/runtime.d.ts +17 -7
- package/dist/artifacts/frames/runtime.d.ts.map +1 -1
- package/dist/artifacts/holders.d.ts +23 -0
- package/dist/artifacts/holders.d.ts.map +1 -0
- package/dist/artifacts/ids.d.ts +2 -0
- package/dist/artifacts/ids.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +6 -4
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +108 -13
- package/dist/artifacts/index.js.map +5 -4
- package/dist/artifacts/limits.d.ts +24 -3
- package/dist/artifacts/limits.d.ts.map +1 -1
- package/dist/artifacts/live/board.d.ts +103 -0
- package/dist/artifacts/live/board.d.ts.map +1 -0
- package/dist/artifacts/live/diff.d.ts +43 -0
- package/dist/artifacts/live/diff.d.ts.map +1 -0
- package/dist/artifacts/live/document.d.ts +55 -0
- package/dist/artifacts/live/document.d.ts.map +1 -0
- package/dist/artifacts/live/files.d.ts +16 -0
- package/dist/artifacts/live/files.d.ts.map +1 -0
- package/dist/artifacts/live/index.d.ts +9 -0
- package/dist/artifacts/live/index.d.ts.map +1 -0
- package/dist/artifacts/live/index.js +593 -0
- package/dist/artifacts/live/index.js.map +10 -0
- package/dist/artifacts/live/presence.d.ts +55 -0
- package/dist/artifacts/live/presence.d.ts.map +1 -0
- package/dist/artifacts/live/protocol.d.ts +109 -0
- package/dist/artifacts/live/protocol.d.ts.map +1 -0
- package/dist/artifacts/live/protocol.js +21 -0
- package/dist/artifacts/live/protocol.js.map +9 -0
- package/dist/artifacts/live/server.d.ts +10 -0
- package/dist/artifacts/live/server.d.ts.map +1 -0
- package/dist/artifacts/live/server.js +86 -0
- package/dist/artifacts/live/server.js.map +9 -0
- package/dist/artifacts/live/state.d.ts +26 -0
- package/dist/artifacts/live/state.d.ts.map +1 -0
- package/dist/artifacts/outline.d.ts +11 -0
- package/dist/artifacts/outline.d.ts.map +1 -1
- package/dist/artifacts/publish/index.d.ts +8 -1
- package/dist/artifacts/publish/index.d.ts.map +1 -1
- package/dist/artifacts/publish/index.js +61 -33
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/merge.d.ts +75 -0
- package/dist/artifacts/publish/merge.d.ts.map +1 -0
- package/dist/artifacts/publish/previews.d.ts +153 -0
- package/dist/artifacts/publish/previews.d.ts.map +1 -0
- package/dist/artifacts/publish/publish.d.ts +29 -8
- package/dist/artifacts/publish/publish.d.ts.map +1 -1
- package/dist/artifacts/publish/query-answers.d.ts +20 -0
- package/dist/artifacts/publish/query-answers.d.ts.map +1 -0
- package/dist/artifacts/publish/references.d.ts +4 -3
- package/dist/artifacts/publish/references.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/canvas.d.ts.map +1 -1
- package/dist/artifacts/theme.d.ts +5 -1
- package/dist/artifacts/theme.d.ts.map +1 -1
- package/dist/auth/directory.d.ts +33 -0
- package/dist/auth/directory.d.ts.map +1 -0
- package/dist/auth/index.js +13 -12
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/member-events.d.ts +5 -1
- package/dist/auth/member-events.d.ts.map +1 -1
- package/dist/auth/runtime.d.ts +22 -1
- package/dist/auth/runtime.d.ts.map +1 -1
- package/dist/auth/strategy.d.ts +2 -2
- package/dist/auth/strategy.d.ts.map +1 -1
- package/dist/auth/types.d.ts +42 -1
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/authorization/decision.d.ts +6 -5
- package/dist/authorization/decision.d.ts.map +1 -1
- package/dist/authorization/event-visibility.d.ts.map +1 -1
- package/dist/authorization/index.js +7 -6
- package/dist/authorization/index.js.map +1 -1
- package/dist/blob-storage/index.js +4 -4
- package/dist/blob-storage/index.js.map +1 -1
- package/dist/bootstrap/index.js +62 -56
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/broker/in-memory.d.ts.map +1 -1
- package/dist/broker/index.js +1 -1
- package/dist/broker/types.d.ts +4 -0
- package/dist/broker/types.d.ts.map +1 -1
- package/dist/{chunk-s7j8ewqv.js → chunk-0k3r5kb3.js} +257 -43
- package/dist/{chunk-s7j8ewqv.js.map → chunk-0k3r5kb3.js.map} +14 -13
- package/dist/{chunk-e5wf5vz0.js → chunk-0kgrghqx.js} +13 -1
- package/dist/chunk-0kgrghqx.js.map +10 -0
- package/dist/{chunk-80gym75n.js → chunk-186k5yz3.js} +1 -1
- package/dist/chunk-191jz8a6.js +61 -0
- package/dist/chunk-191jz8a6.js.map +10 -0
- package/dist/{chunk-mmagke4x.js → chunk-22d3qg4x.js} +2 -2
- package/dist/{chunk-mmagke4x.js.map → chunk-22d3qg4x.js.map} +3 -3
- package/dist/{chunk-m2vh8gh0.js → chunk-26qet7wh.js} +62 -15
- package/dist/{chunk-m2vh8gh0.js.map → chunk-26qet7wh.js.map} +5 -5
- package/dist/{chunk-eqgr6nsa.js → chunk-2by73sm2.js} +982 -184
- package/dist/chunk-2by73sm2.js.map +75 -0
- package/dist/chunk-2c4j899j.js.map +2 -2
- package/dist/{chunk-e6xgz4h4.js → chunk-3014rfjz.js} +197 -18
- package/dist/chunk-3014rfjz.js.map +21 -0
- package/dist/chunk-38yvdqzd.js +70 -0
- package/dist/chunk-38yvdqzd.js.map +10 -0
- package/dist/{chunk-ytzcxtpt.js → chunk-3ba89vm7.js} +1 -1
- package/dist/chunk-3hzhcfsv.js +139 -0
- package/dist/chunk-3hzhcfsv.js.map +10 -0
- package/dist/chunk-3sgvd10b.js +69 -0
- package/dist/chunk-3sgvd10b.js.map +10 -0
- package/dist/{chunk-djs3hw9p.js → chunk-3zagkr6w.js} +73 -6
- package/dist/chunk-3zagkr6w.js.map +21 -0
- package/dist/{chunk-wkq3kvzd.js → chunk-48c1z8nj.js} +6 -6
- package/dist/chunk-48c1z8nj.js.map +10 -0
- package/dist/{chunk-3sqqhpr7.js → chunk-4j0sagwv.js} +134 -19
- package/dist/{chunk-3sqqhpr7.js.map → chunk-4j0sagwv.js.map} +11 -10
- package/dist/{chunk-d04g36fw.js → chunk-5qqmndhm.js} +1 -1
- package/dist/{chunk-scyq22td.js → chunk-5rqqp8cr.js} +19 -4
- package/dist/chunk-5rqqp8cr.js.map +12 -0
- package/dist/{chunk-f1h34y3r.js → chunk-6gtxshcc.js} +6 -6
- package/dist/{chunk-f1h34y3r.js.map → chunk-6gtxshcc.js.map} +1 -1
- package/dist/{chunk-jspskey0.js → chunk-7j4yydm2.js} +67 -45
- package/dist/chunk-7j4yydm2.js.map +11 -0
- package/dist/{chunk-5wtnmpze.js → chunk-7qe46788.js} +1 -1
- package/dist/{chunk-31kcqmhf.js → chunk-855w9nvw.js} +1 -1
- package/dist/{chunk-e7v3trpz.js → chunk-8a8k38tz.js} +4 -3
- package/dist/chunk-8a8k38tz.js.map +10 -0
- package/dist/{chunk-2ajw5rz0.js → chunk-8p7bze4c.js} +3 -3
- package/dist/{chunk-jftd33rc.js → chunk-8t2ynwg0.js} +105 -9
- package/dist/chunk-8t2ynwg0.js.map +11 -0
- package/dist/{chunk-9whfmsfk.js → chunk-8tqnsx3q.js} +1 -1
- package/dist/{chunk-s3we74h8.js → chunk-9nsjjd44.js} +38 -5
- package/dist/chunk-9nsjjd44.js.map +12 -0
- package/dist/{chunk-hz5d43gn.js → chunk-9vsc919v.js} +14 -6
- package/dist/chunk-9vsc919v.js.map +10 -0
- package/dist/{chunk-waqk73p1.js → chunk-a6fjkcne.js} +185 -341
- package/dist/{chunk-waqk73p1.js.map → chunk-a6fjkcne.js.map} +6 -7
- package/dist/{chunk-s038wa5v.js → chunk-b9qfh2ya.js} +1 -1
- package/dist/{chunk-5taem5aw.js → chunk-bc3y6gff.js} +13 -4
- package/dist/chunk-bc3y6gff.js.map +10 -0
- package/dist/{chunk-w1btn96n.js → chunk-bkmnd7zq.js} +523 -254
- package/dist/chunk-bkmnd7zq.js.map +49 -0
- package/dist/chunk-bz5bnjjt.js +358 -0
- package/dist/chunk-bz5bnjjt.js.map +12 -0
- package/dist/{chunk-w976a4me.js → chunk-czct88ht.js} +28 -4
- package/dist/chunk-czct88ht.js.map +10 -0
- package/dist/{chunk-5kyvrtjh.js → chunk-d9xbwh3h.js} +131 -32
- package/dist/chunk-d9xbwh3h.js.map +13 -0
- package/dist/{chunk-kfee1h52.js → chunk-dfveegqq.js} +28 -8
- package/dist/chunk-dfveegqq.js.map +13 -0
- package/dist/{chunk-2g0r46hy.js → chunk-dhkc9b23.js} +15 -2
- package/dist/chunk-dhkc9b23.js.map +12 -0
- package/dist/chunk-dmnd9ea6.js +106 -0
- package/dist/chunk-dmnd9ea6.js.map +10 -0
- package/dist/{chunk-nz7815t3.js → chunk-e0hnbb1m.js} +27 -2
- package/dist/chunk-e0hnbb1m.js.map +14 -0
- package/dist/chunk-e91fmg6t.js +288 -0
- package/dist/chunk-e91fmg6t.js.map +11 -0
- package/dist/{chunk-a5v4gjdx.js → chunk-e9w4mgdh.js} +308 -220
- package/dist/{chunk-a5v4gjdx.js.map → chunk-e9w4mgdh.js.map} +21 -19
- package/dist/{chunk-w122ymx4.js → chunk-f6ahf5gf.js} +15 -4
- package/dist/{chunk-w122ymx4.js.map → chunk-f6ahf5gf.js.map} +3 -3
- package/dist/{chunk-jjmggm9a.js → chunk-fe6r7yhg.js} +1 -1
- package/dist/{chunk-165c9wm6.js → chunk-g2ph4873.js} +1 -1
- package/dist/chunk-hgj98cbb.js +22 -0
- package/dist/chunk-hgj98cbb.js.map +10 -0
- package/dist/{chunk-mbc5hvnj.js → chunk-hkaa807g.js} +18 -7
- package/dist/{chunk-mbc5hvnj.js.map → chunk-hkaa807g.js.map} +3 -3
- package/dist/chunk-hn2r7z41.js.map +3 -3
- package/dist/chunk-j0wgh8gv.js +250 -0
- package/dist/chunk-j0wgh8gv.js.map +10 -0
- package/dist/{chunk-z8fx5cgb.js → chunk-j2zm215x.js} +37 -3
- package/dist/chunk-j2zm215x.js.map +12 -0
- package/dist/{chunk-j1ny5fwh.js → chunk-k1g14kk3.js} +11 -83
- package/dist/{chunk-j1ny5fwh.js.map → chunk-k1g14kk3.js.map} +4 -5
- package/dist/{chunk-ga63a3dz.js → chunk-k66rp2hr.js} +3 -3
- package/dist/chunk-kr6dx38r.js +25 -0
- package/dist/chunk-kr6dx38r.js.map +10 -0
- package/dist/{chunk-a7aa0nzj.js → chunk-kv0kvknv.js} +14 -14
- package/dist/{chunk-a7aa0nzj.js.map → chunk-kv0kvknv.js.map} +1 -1
- package/dist/chunk-m2jerfef.js +474 -0
- package/dist/chunk-m2jerfef.js.map +11 -0
- package/dist/chunk-m7b9q5dk.js +234 -0
- package/dist/chunk-m7b9q5dk.js.map +12 -0
- package/dist/{chunk-escedwyt.js → chunk-mvz89age.js} +6 -1
- package/dist/{chunk-escedwyt.js.map → chunk-mvz89age.js.map} +3 -3
- package/dist/chunk-mwcqz3e3.js +30 -0
- package/dist/chunk-mwcqz3e3.js.map +10 -0
- package/dist/chunk-n2ay51px.js +21 -0
- package/dist/chunk-n2ay51px.js.map +10 -0
- package/dist/{chunk-gkv8r794.js → chunk-n68vz95m.js} +5 -5
- package/dist/{chunk-gkv8r794.js.map → chunk-n68vz95m.js.map} +3 -3
- package/dist/{chunk-0j3crh1w.js → chunk-p351afzm.js} +14 -14
- package/dist/{chunk-0j3crh1w.js.map → chunk-p351afzm.js.map} +4 -4
- package/dist/chunk-pk539cwv.js +370 -0
- package/dist/chunk-pk539cwv.js.map +11 -0
- package/dist/{chunk-jbw70d6t.js → chunk-ppxf7gw2.js} +52 -10
- package/dist/chunk-ppxf7gw2.js.map +11 -0
- package/dist/{chunk-9x8dybsb.js → chunk-pvpq483h.js} +10 -2
- package/dist/chunk-pvpq483h.js.map +10 -0
- package/dist/chunk-qafng88v.js +225 -0
- package/dist/chunk-qafng88v.js.map +11 -0
- package/dist/chunk-qds484t8.js +1363 -0
- package/dist/chunk-qds484t8.js.map +18 -0
- package/dist/{chunk-4zm1k3xj.js → chunk-r2psmn42.js} +1 -1
- package/dist/{chunk-kkjfve0t.js → chunk-rt9deb92.js} +4 -3
- package/dist/{chunk-kkjfve0t.js.map → chunk-rt9deb92.js.map} +3 -3
- package/dist/{chunk-r1cxq7vv.js → chunk-rtdrm592.js} +2 -2
- package/dist/{chunk-c7cfe31p.js → chunk-s5n9617r.js} +15 -15
- package/dist/{chunk-c7cfe31p.js.map → chunk-s5n9617r.js.map} +1 -1
- package/dist/{chunk-4bm0caep.js → chunk-smnt672s.js} +1 -1
- package/dist/{chunk-21q0j5f2.js → chunk-stmxh0hv.js} +2 -2
- package/dist/{chunk-nh26e7c5.js → chunk-sysnvjce.js} +5 -5
- package/dist/{chunk-nh26e7c5.js.map → chunk-sysnvjce.js.map} +3 -3
- package/dist/{chunk-57g0215c.js → chunk-t24yktqr.js} +296 -7
- package/dist/{chunk-57g0215c.js.map → chunk-t24yktqr.js.map} +6 -3
- package/dist/{chunk-ff5xkv0p.js → chunk-tfzvjdms.js} +1 -1
- package/dist/chunk-tqa68kj7.js +1322 -0
- package/dist/chunk-tqa68kj7.js.map +25 -0
- package/dist/chunk-vtjzwymr.js +37 -0
- package/dist/chunk-vtjzwymr.js.map +10 -0
- package/dist/{chunk-twfreyxr.js → chunk-vzkxqf8h.js} +23 -13
- package/dist/{chunk-twfreyxr.js.map → chunk-vzkxqf8h.js.map} +6 -6
- package/dist/{chunk-6b61s40c.js → chunk-w3t94hm6.js} +1 -1
- package/dist/{chunk-j8thxj7w.js → chunk-w9s23r24.js} +1218 -101
- package/dist/chunk-w9s23r24.js.map +30 -0
- package/dist/{chunk-fwsvshr5.js → chunk-wa05txmk.js} +20 -7
- package/dist/{chunk-fwsvshr5.js.map → chunk-wa05txmk.js.map} +3 -3
- package/dist/chunk-whbwf3np.js +12 -0
- package/dist/chunk-whbwf3np.js.map +10 -0
- package/dist/{chunk-t5608tkq.js → chunk-yv8hv4wq.js} +3 -1
- package/dist/{chunk-t5608tkq.js.map → chunk-yv8hv4wq.js.map} +3 -3
- package/dist/{chunk-dsv783c3.js → chunk-z0t4p2sk.js} +169 -53
- package/dist/{chunk-dsv783c3.js.map → chunk-z0t4p2sk.js.map} +7 -7
- package/dist/connectors/builders.d.ts +2 -2
- package/dist/connectors/builders.d.ts.map +1 -1
- package/dist/connectors/connections/access.d.ts +11 -0
- package/dist/connectors/connections/access.d.ts.map +1 -0
- package/dist/connectors/connections/contracts.d.ts +6 -1
- package/dist/connectors/connections/contracts.d.ts.map +1 -1
- package/dist/connectors/connections/internal.js +1 -1
- package/dist/connectors/connections/runs.d.ts +6 -0
- package/dist/connectors/connections/runs.d.ts.map +1 -1
- package/dist/connectors/connections/service.d.ts +25 -0
- package/dist/connectors/connections/service.d.ts.map +1 -1
- package/dist/connectors/connections/views.d.ts +1 -1
- package/dist/connectors/connections/views.d.ts.map +1 -1
- package/dist/connectors/execution.d.ts.map +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.d.ts.map +1 -1
- package/dist/connectors/service.d.ts +3 -0
- package/dist/connectors/service.d.ts.map +1 -1
- package/dist/connectors/types.d.ts +21 -2
- package/dist/connectors/types.d.ts.map +1 -1
- package/dist/datasets/execution.d.ts +12 -6
- package/dist/datasets/execution.d.ts.map +1 -1
- package/dist/datasets/ingest-flush-batch.d.ts +59 -0
- package/dist/datasets/ingest-flush-batch.d.ts.map +1 -0
- package/dist/datasets/ingest-flush-job.d.ts +33 -0
- package/dist/datasets/ingest-flush-job.d.ts.map +1 -0
- package/dist/datasets/ingest-flush.d.ts +66 -0
- package/dist/datasets/ingest-flush.d.ts.map +1 -0
- package/dist/datasets/produced-version.d.ts +21 -0
- package/dist/datasets/produced-version.d.ts.map +1 -0
- package/dist/datasets/write.d.ts +22 -1
- package/dist/datasets/write.d.ts.map +1 -1
- package/dist/datasets/write.js +8 -4
- package/dist/datasets/write.js.map +1 -1
- package/dist/deploy/internal.js +5 -4
- package/dist/deploy/internal.js.map +4 -4
- package/dist/deploy/types.d.ts +2 -3
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/error-reporting/capability.d.ts +8 -2
- package/dist/error-reporting/capability.d.ts.map +1 -1
- package/dist/error-reporting/internal.d.ts +1 -1
- package/dist/error-reporting/internal.d.ts.map +1 -1
- package/dist/error-reporting/internal.js +17 -5
- package/dist/error-reporting/internal.js.map +1 -1
- package/dist/error-reporting/reporter.d.ts.map +1 -1
- package/dist/error-reporting/reports.d.ts +55 -0
- package/dist/error-reporting/reports.d.ts.map +1 -1
- package/dist/error-reporting/types.d.ts +82 -1
- package/dist/error-reporting/types.d.ts.map +1 -1
- package/dist/errors/catalog.d.ts +5 -0
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/errors/internal.js +1 -1
- package/dist/events/definitions.d.ts +4 -0
- package/dist/events/definitions.d.ts.map +1 -1
- package/dist/events/execution.d.ts +1 -0
- package/dist/events/execution.d.ts.map +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +5 -5
- package/dist/events/scope.d.ts.map +1 -1
- package/dist/events/scope.js +1 -1
- package/dist/events/selectors/index.js +2 -2
- package/dist/events/types/artifacts.d.ts +38 -0
- package/dist/events/types/artifacts.d.ts.map +1 -0
- package/dist/events/types/index.d.ts +3 -1
- package/dist/events/types/index.d.ts.map +1 -1
- package/dist/events/types/users.d.ts +5 -2
- package/dist/events/types/users.d.ts.map +1 -1
- package/dist/execution/agent.js +57 -51
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts +10 -0
- package/dist/execution/authorized-object-reader.d.ts.map +1 -1
- package/dist/execution/object-reader-clearance.d.ts +6 -0
- package/dist/execution/object-reader-clearance.d.ts.map +1 -1
- package/dist/execution/object-reader-security.d.ts +9 -2
- package/dist/execution/object-reader-security.d.ts.map +1 -1
- package/dist/execution/primitive.js +55 -49
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.js +49 -43
- package/dist/execution/request.js.map +2 -2
- package/dist/http/api-routes.d.ts +1 -1
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +95 -87
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/errors.d.ts +15 -0
- package/dist/lake-storage/errors.d.ts.map +1 -1
- package/dist/lake-storage/index.d.ts +3 -2
- package/dist/lake-storage/index.d.ts.map +1 -1
- package/dist/lake-storage/index.js +16 -10
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/lake-storage/maintenance.d.ts +88 -0
- package/dist/lake-storage/maintenance.d.ts.map +1 -0
- package/dist/lake-storage/merge.d.ts +3 -1
- package/dist/lake-storage/merge.d.ts.map +1 -1
- package/dist/lake-storage/source-ordering.d.ts +23 -0
- package/dist/lake-storage/source-ordering.d.ts.map +1 -1
- package/dist/lake-storage/types.d.ts +10 -0
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/maintenance/heartbeat.d.ts +5 -0
- package/dist/maintenance/heartbeat.d.ts.map +1 -0
- package/dist/maintenance/index.d.ts +4 -2
- package/dist/maintenance/index.d.ts.map +1 -1
- package/dist/maintenance/index.js +515 -0
- package/dist/maintenance/index.js.map +16 -0
- package/dist/maintenance/lake-retention-status.d.ts +36 -0
- package/dist/maintenance/lake-retention-status.d.ts.map +1 -0
- package/dist/maintenance/lake-retention.d.ts +84 -0
- package/dist/maintenance/lake-retention.d.ts.map +1 -0
- package/dist/maintenance/loop.d.ts +95 -0
- package/dist/maintenance/loop.d.ts.map +1 -0
- package/dist/maintenance/ontology-maintenance.d.ts +17 -16
- package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
- package/dist/maintenance/passes/cron-pass.d.ts +21 -0
- package/dist/maintenance/passes/cron-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/directory-pass.d.ts +12 -0
- package/dist/maintenance/passes/directory-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/ingest-pass.d.ts +26 -0
- package/dist/maintenance/passes/ingest-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/lake-change-feed.d.ts +38 -0
- package/dist/maintenance/passes/lake-change-feed.d.ts.map +1 -0
- package/dist/maintenance/passes/lake-retention-pass.d.ts +20 -0
- package/dist/maintenance/passes/lake-retention-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/ontology-pass.d.ts +8 -0
- package/dist/maintenance/passes/ontology-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/projections-pass.d.ts +26 -0
- package/dist/maintenance/passes/projections-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/recovery-pass.d.ts +6 -0
- package/dist/maintenance/passes/recovery-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/recovery-passes.d.ts +24 -0
- package/dist/maintenance/passes/recovery-passes.d.ts.map +1 -0
- package/dist/maintenance/passes/runs-pass.d.ts +6 -0
- package/dist/maintenance/passes/runs-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/triggers-pass.d.ts +41 -0
- package/dist/maintenance/passes/triggers-pass.d.ts.map +1 -0
- package/dist/maintenance/status.d.ts +19 -0
- package/dist/maintenance/status.d.ts.map +1 -0
- package/dist/maintenance/types.d.ts +25 -24
- package/dist/maintenance/types.d.ts.map +1 -1
- package/dist/materialization/model.d.ts +11 -2
- package/dist/materialization/model.d.ts.map +1 -1
- package/dist/materializer/edits/artifact-refs.d.ts +33 -0
- package/dist/materializer/edits/artifact-refs.d.ts.map +1 -0
- package/dist/materializer/edits/commit.d.ts.map +1 -1
- package/dist/materializer/edits/operations.d.ts +7 -1
- package/dist/materializer/edits/operations.d.ts.map +1 -1
- package/dist/materializer/edits/plan.d.ts.map +1 -1
- package/dist/materializer/execution/work-records.d.ts +6 -0
- package/dist/materializer/execution/work-records.d.ts.map +1 -1
- package/dist/materializer/index.js +30 -27
- package/dist/materializer/index.js.map +1 -1
- package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
- package/dist/materializer/shared/normalize.d.ts.map +1 -1
- package/dist/materializer/telemetry/plan.d.ts.map +1 -1
- package/dist/models/execution/index.js +29 -26
- package/dist/models/execution/index.js.map +1 -1
- package/dist/objects/artifact-refs.d.ts +5 -0
- package/dist/objects/artifact-refs.d.ts.map +1 -0
- package/dist/objects/index.js +58 -53
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/materializer-adapter.d.ts +4 -3
- package/dist/objects/materializer-adapter.d.ts.map +1 -1
- package/dist/objects/object/upsert-batch.d.ts.map +1 -1
- package/dist/objects/object/upsert.d.ts.map +1 -1
- package/dist/objects/query/index.js +28 -25
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/ir.d.ts +3 -1
- package/dist/objects/query/ir.d.ts.map +1 -1
- package/dist/objects/query/scalar-values.d.ts.map +1 -1
- package/dist/objects/runtime-batch.d.ts +2 -0
- package/dist/objects/runtime-batch.d.ts.map +1 -1
- package/dist/ontology/artifact-ref.d.ts +36 -0
- package/dist/ontology/artifact-ref.d.ts.map +1 -0
- package/dist/ontology/docs-markdown.d.ts.map +1 -1
- package/dist/ontology/index.d.ts +3 -1
- package/dist/ontology/index.d.ts.map +1 -1
- package/dist/ontology/index.js +8 -5
- package/dist/ontology/index.js.map +1 -1
- package/dist/ontology/inference/index.d.ts +2 -0
- package/dist/ontology/inference/index.d.ts.map +1 -1
- package/dist/ontology/internal.js +7 -6
- package/dist/ontology/internal.js.map +1 -1
- package/dist/ontology/json-schema.d.ts.map +1 -1
- package/dist/ontology/primitives.d.ts.map +1 -1
- package/dist/ontology/reference-values.d.ts +10 -0
- package/dist/ontology/reference-values.d.ts.map +1 -0
- package/dist/ontology/refs.d.ts +6 -1
- package/dist/ontology/refs.d.ts.map +1 -1
- package/dist/ontology/registry.d.ts +9 -1
- package/dist/ontology/registry.d.ts.map +1 -1
- package/dist/ontology/types.d.ts +2 -1
- package/dist/ontology/types.d.ts.map +1 -1
- package/dist/ontology/user-ref.d.ts +16 -0
- package/dist/ontology/user-ref.d.ts.map +1 -1
- package/dist/ontology/validation/normalize.d.ts.map +1 -1
- package/dist/ontology/validation/properties.d.ts.map +1 -1
- package/dist/ontology/validation/schema.d.ts.map +1 -1
- package/dist/pending-tasks.d.ts +17 -0
- package/dist/pending-tasks.d.ts.map +1 -0
- package/dist/pipelines/index.js +36 -33
- package/dist/pipelines/index.js.map +1 -1
- package/dist/pipelines/run-dispatch.d.ts +6 -0
- package/dist/pipelines/run-dispatch.d.ts.map +1 -1
- package/dist/predicates/types.d.ts +4 -0
- package/dist/predicates/types.d.ts.map +1 -1
- package/dist/projections/builders.d.ts +13 -11
- package/dist/projections/builders.d.ts.map +1 -1
- package/dist/projections/internal.js +29 -26
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/types.d.ts +1 -1
- package/dist/projections/types.d.ts.map +1 -1
- package/dist/projections/validation.d.ts +2 -2
- package/dist/projections/validation.d.ts.map +1 -1
- package/dist/queues/in-memory.d.ts +6 -1
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/index.js +1 -1
- package/dist/queues/types.d.ts +55 -2
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/create.d.ts +3 -0
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +22 -5
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +0 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +6 -0
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +51 -30
- package/dist/runtime/internal.js.map +1 -1
- package/dist/runtime/sixb.d.ts +6 -1
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/sandboxes/index.js +8 -7
- package/dist/sandboxes/index.js.map +1 -1
- package/dist/scheduler/index.d.ts +0 -2
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +3 -6
- package/dist/scheduler/index.js.map +1 -1
- package/dist/schedules/index.js +9 -11
- package/dist/schedules/index.js.map +1 -1
- package/dist/security/internal.js +1 -1
- package/dist/shared/backoff.d.ts +12 -0
- package/dist/shared/backoff.d.ts.map +1 -0
- package/dist/shared/duration.d.ts +3 -0
- package/dist/shared/duration.d.ts.map +1 -0
- package/dist/shared/params/artifact-refs.d.ts +19 -0
- package/dist/shared/params/artifact-refs.d.ts.map +1 -0
- package/dist/shares/guest-name.d.ts +8 -0
- package/dist/shares/guest-name.d.ts.map +1 -0
- package/dist/shares/internal.d.ts +1 -0
- package/dist/shares/internal.d.ts.map +1 -1
- package/dist/shares/internal.js +68 -27
- package/dist/shares/internal.js.map +3 -3
- package/dist/shares/session-protocol.d.ts +13 -0
- package/dist/shares/session-protocol.d.ts.map +1 -1
- package/dist/storage/action-runs/failure.js +2 -2
- package/dist/storage/ai-limits/enforcement.js +2 -2
- package/dist/storage/artifacts/errors.d.ts +9 -4
- package/dist/storage/artifacts/errors.d.ts.map +1 -1
- package/dist/storage/artifacts/in-memory.d.ts +27 -4
- 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 +39 -2
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +328 -39
- package/dist/storage/artifacts/types.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/auth-storage.d.ts +2 -1
- package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/identities.d.ts +4 -0
- package/dist/storage/auth/in-memory/identities.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/shared.d.ts +3 -1
- package/dist/storage/auth/in-memory/shared.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/users.d.ts.map +1 -1
- package/dist/storage/auth/index.d.ts +1 -1
- package/dist/storage/auth/index.d.ts.map +1 -1
- package/dist/storage/auth/types.d.ts +39 -0
- package/dist/storage/auth/types.d.ts.map +1 -1
- package/dist/storage/connector-connections/in-memory.d.ts +1 -1
- package/dist/storage/connector-connections/in-memory.d.ts.map +1 -1
- package/dist/storage/connector-connections/index.d.ts +1 -1
- package/dist/storage/connector-connections/index.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider/runs.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider/shared.d.ts +12 -2
- package/dist/storage/connector-connections/provider/shared.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.d.ts +1 -0
- package/dist/storage/connector-connections/provider.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.js +21 -5
- package/dist/storage/connector-connections/provider.js.map +5 -5
- package/dist/storage/connector-connections/types.d.ts +1 -1
- package/dist/storage/connector-connections/types.d.ts.map +1 -1
- package/dist/storage/dataset-ingest/codec.d.ts +6 -0
- package/dist/storage/dataset-ingest/codec.d.ts.map +1 -0
- package/dist/storage/dataset-ingest/in-memory.d.ts +28 -0
- package/dist/storage/dataset-ingest/in-memory.d.ts.map +1 -0
- package/dist/storage/dataset-ingest/index.d.ts +4 -0
- package/dist/storage/dataset-ingest/index.d.ts.map +1 -0
- package/dist/storage/dataset-ingest/provider.d.ts +157 -0
- package/dist/storage/dataset-ingest/provider.d.ts.map +1 -0
- package/dist/storage/dataset-ingest/provider.js +17 -0
- package/dist/storage/dataset-ingest/provider.js.map +9 -0
- package/dist/storage/dataset-ingest/types.d.ts +188 -0
- package/dist/storage/dataset-ingest/types.d.ts.map +1 -0
- package/dist/storage/file-upload-sessions/provider.js +12 -11
- package/dist/storage/file-upload-sessions/provider.js.map +1 -1
- package/dist/storage/in-memory/index.d.ts +12 -0
- package/dist/storage/in-memory/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +18 -11
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +55 -45
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +4 -1
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +81 -5
- package/dist/storage/internal.js.map +4 -3
- package/dist/storage/lake-retention-runs/in-memory.d.ts +11 -0
- package/dist/storage/lake-retention-runs/in-memory.d.ts.map +1 -0
- package/dist/storage/lake-retention-runs/index.d.ts +3 -0
- package/dist/storage/lake-retention-runs/index.d.ts.map +1 -0
- package/dist/storage/lake-retention-runs/types.d.ts +21 -0
- package/dist/storage/lake-retention-runs/types.d.ts.map +1 -0
- package/dist/storage/maintenance-heartbeats/in-memory.d.ts +11 -0
- package/dist/storage/maintenance-heartbeats/in-memory.d.ts.map +1 -0
- package/dist/storage/maintenance-heartbeats/index.d.ts +3 -0
- package/dist/storage/maintenance-heartbeats/index.d.ts.map +1 -0
- package/dist/storage/maintenance-heartbeats/record.d.ts +11 -0
- package/dist/storage/maintenance-heartbeats/record.d.ts.map +1 -0
- package/dist/storage/maintenance-heartbeats/types.d.ts +30 -0
- package/dist/storage/maintenance-heartbeats/types.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/query.d.ts.map +1 -1
- package/dist/storage/objects/in-memory/storage.d.ts +15 -1
- package/dist/storage/objects/in-memory/storage.d.ts.map +1 -1
- package/dist/storage/objects/read-scope.d.ts.map +1 -1
- package/dist/storage/objects/types.d.ts +18 -1
- package/dist/storage/objects/types.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
- package/dist/storage/ontology/index.d.ts +1 -1
- package/dist/storage/ontology/index.d.ts.map +1 -1
- package/dist/storage/ontology/materializations.d.ts +20 -0
- package/dist/storage/ontology/materializations.d.ts.map +1 -1
- package/dist/storage/ontology/provider-work.d.ts +7 -1
- package/dist/storage/ontology/provider-work.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +1 -1
- package/dist/storage/pipeline-runs/in-memory.d.ts +8 -2
- package/dist/storage/pipeline-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/pipeline-runs/index.d.ts +1 -1
- package/dist/storage/pipeline-runs/index.d.ts.map +1 -1
- package/dist/storage/pipeline-runs/provider.js +1 -1
- package/dist/storage/pipeline-runs/transitions.d.ts +2 -2
- package/dist/storage/pipeline-runs/transitions.d.ts.map +1 -1
- package/dist/storage/pipeline-runs/types.d.ts +26 -6
- package/dist/storage/pipeline-runs/types.d.ts.map +1 -1
- package/dist/storage/projection-runs/errors.d.ts +6 -0
- package/dist/storage/projection-runs/errors.d.ts.map +1 -1
- package/dist/storage/projection-runs/in-memory.d.ts +5 -1
- package/dist/storage/projection-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/projection-runs/index.d.ts +2 -2
- package/dist/storage/projection-runs/index.d.ts.map +1 -1
- package/dist/storage/projection-runs/lifecycle.d.ts +1 -0
- package/dist/storage/projection-runs/lifecycle.d.ts.map +1 -1
- package/dist/storage/projection-runs/provider.js +2 -2
- package/dist/storage/projection-runs/types.d.ts +16 -0
- package/dist/storage/projection-runs/types.d.ts.map +1 -1
- package/dist/storage/run-claim.d.ts +132 -0
- package/dist/storage/run-claim.d.ts.map +1 -0
- package/dist/storage/share-grants/provider.js +3 -3
- package/dist/storage/share-sessions/in-memory.d.ts +2 -1
- package/dist/storage/share-sessions/in-memory.d.ts.map +1 -1
- package/dist/storage/share-sessions/index.d.ts +1 -1
- package/dist/storage/share-sessions/index.d.ts.map +1 -1
- package/dist/storage/share-sessions/provider.d.ts +1 -1
- package/dist/storage/share-sessions/provider.d.ts.map +1 -1
- package/dist/storage/share-sessions/provider.js +4 -2
- package/dist/storage/share-sessions/provider.js.map +1 -1
- package/dist/storage/share-sessions/record.d.ts +2 -1
- package/dist/storage/share-sessions/record.d.ts.map +1 -1
- package/dist/storage/share-sessions/types.d.ts +17 -1
- package/dist/storage/share-sessions/types.d.ts.map +1 -1
- package/dist/storage/sync-runs/in-memory.d.ts +10 -2
- package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/sync-runs/index.d.ts +1 -1
- package/dist/storage/sync-runs/index.d.ts.map +1 -1
- package/dist/storage/sync-runs/transitions.d.ts +2 -2
- package/dist/storage/sync-runs/transitions.d.ts.map +1 -1
- package/dist/storage/sync-runs/types.d.ts +29 -3
- package/dist/storage/sync-runs/types.d.ts.map +1 -1
- package/dist/storage/types.d.ts +12 -6
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/webhook-runs/in-memory.d.ts +2 -1
- package/dist/storage/webhook-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/webhook-runs/index.d.ts +2 -2
- package/dist/storage/webhook-runs/index.d.ts.map +1 -1
- package/dist/storage/webhook-runs/types.d.ts +33 -2
- package/dist/storage/webhook-runs/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/in-memory.d.ts +6 -3
- package/dist/storage/workflow-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/workflow-runs/index.d.ts +1 -1
- package/dist/storage/workflow-runs/index.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +12 -11
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/storage/workflow-runs/types.d.ts +11 -28
- package/dist/storage/workflow-runs/types.d.ts.map +1 -1
- package/dist/syncs/index.js +37 -34
- package/dist/syncs/index.js.map +1 -1
- package/dist/syncs/run-dispatch.d.ts +2 -0
- package/dist/syncs/run-dispatch.d.ts.map +1 -1
- package/dist/testing/ai-model-call-groups-contract.d.ts.map +1 -1
- package/dist/testing/artifact-holders-contract.d.ts +15 -0
- package/dist/testing/artifact-holders-contract.d.ts.map +1 -0
- package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
- package/dist/testing/auth-storage-contract.d.ts.map +1 -1
- package/dist/testing/broker-contract.d.ts.map +1 -1
- package/dist/testing/connector-connection-storage-contract.d.ts +1 -1
- package/dist/testing/connector-connection-storage-contract.d.ts.map +1 -1
- package/dist/testing/dataset-ingest-storage-contract.d.ts +11 -0
- package/dist/testing/dataset-ingest-storage-contract.d.ts.map +1 -0
- package/dist/testing/dataset-sequence-contract.d.ts +1 -1
- package/dist/testing/dataset-sequence-contract.d.ts.map +1 -1
- package/dist/testing/execution.d.ts.map +1 -1
- package/dist/testing/index.d.ts +8 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +6244 -3191
- package/dist/testing/index.js.map +28 -19
- package/dist/testing/lake-retention-run-storage-contract.d.ts +9 -0
- package/dist/testing/lake-retention-run-storage-contract.d.ts.map +1 -0
- package/dist/testing/maintenance-heartbeat-storage-contract.d.ts +9 -0
- package/dist/testing/maintenance-heartbeat-storage-contract.d.ts.map +1 -0
- package/dist/testing/object-query-contract.d.ts.map +1 -1
- package/dist/testing/pipeline-execution.d.ts.map +1 -1
- package/dist/testing/pipeline-run-read-contract.d.ts +13 -0
- package/dist/testing/pipeline-run-read-contract.d.ts.map +1 -0
- package/dist/testing/projection-run-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/testing/run-claim-storage-contract.d.ts +12 -0
- package/dist/testing/run-claim-storage-contract.d.ts.map +1 -0
- package/dist/testing/run-claim.d.ts +30 -0
- package/dist/testing/run-claim.d.ts.map +1 -0
- package/dist/testing/run-recovery-contract.d.ts +49 -0
- package/dist/testing/run-recovery-contract.d.ts.map +1 -0
- package/dist/testing/share-session-storage-contract.d.ts.map +1 -1
- package/dist/testing/stored-artifacts.d.ts +10 -0
- package/dist/testing/stored-artifacts.d.ts.map +1 -0
- package/dist/testing/sync-execution.d.ts.map +1 -1
- package/dist/testing/webhook-execution.d.ts +1 -1
- package/dist/testing/webhook-execution.d.ts.map +1 -1
- package/dist/testing/webhook-run-storage-contract.d.ts.map +1 -1
- package/dist/users/execution.d.ts +18 -1
- package/dist/users/execution.d.ts.map +1 -1
- package/dist/users/index.d.ts +1 -1
- package/dist/users/index.d.ts.map +1 -1
- package/dist/webhooks/delivery-lease.d.ts +13 -0
- package/dist/webhooks/delivery-lease.d.ts.map +1 -0
- package/dist/webhooks/internal.d.ts +2 -0
- package/dist/webhooks/internal.d.ts.map +1 -1
- package/dist/webhooks/internal.js +67 -35
- package/dist/webhooks/internal.js.map +5 -4
- package/dist/webhooks/run-admission.d.ts.map +1 -1
- package/dist/workers/index.d.ts +5 -1
- package/dist/workers/index.d.ts.map +1 -1
- package/dist/workers/index.js +193 -58
- package/dist/workers/index.js.map +8 -7
- package/dist/workers/job-ids.d.ts +17 -0
- package/dist/workers/job-ids.d.ts.map +1 -0
- package/dist/workers/lost-projection-runs.d.ts +26 -0
- package/dist/workers/lost-projection-runs.d.ts.map +1 -0
- package/dist/workers/lost-runs.d.ts +51 -0
- package/dist/workers/lost-runs.d.ts.map +1 -0
- package/dist/workers/queue-delivery.d.ts.map +1 -1
- package/dist/workers/queue-worker.d.ts +1 -2
- package/dist/workers/queue-worker.d.ts.map +1 -1
- package/dist/workers/queued-run-dispatch.d.ts +90 -0
- package/dist/workers/queued-run-dispatch.d.ts.map +1 -0
- package/dist/workers/run-lease.d.ts +25 -0
- package/dist/workers/run-lease.d.ts.map +1 -0
- package/dist/workers/run-worker.d.ts +95 -0
- package/dist/workers/run-worker.d.ts.map +1 -0
- package/dist/workflows/index.js +63 -57
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/request.d.ts.map +1 -1
- package/dist/workflows/run-dispatch.d.ts +6 -1
- package/dist/workflows/run-dispatch.d.ts.map +1 -1
- package/package.json +41 -3
- package/src/actions/request.ts +24 -7
- package/src/actions/run/executor.ts +9 -42
- package/src/actions/types/context.ts +8 -3
- package/src/agents/execution.ts +10 -2
- package/src/agents/fork.ts +12 -4
- package/src/agents/index.ts +7 -1
- package/src/agents/request.ts +42 -31
- package/src/agents/run-artifacts.ts +290 -46
- package/src/agents/run-session-http.ts +4 -0
- package/src/agents/run-session-serve.ts +10 -0
- package/src/agents/run-session.ts +8 -1
- package/src/agents/streams/protocol.ts +5 -10
- package/src/agents/validation.ts +3 -0
- package/src/artifacts/access.ts +71 -28
- package/src/artifacts/canvas-display.ts +160 -0
- package/src/artifacts/canvas.ts +26 -1
- package/src/artifacts/comment-text.ts +32 -0
- package/src/artifacts/comments.ts +275 -0
- package/src/artifacts/errors.ts +6 -1
- package/src/artifacts/events.ts +58 -0
- package/src/artifacts/execution.ts +496 -53
- package/src/artifacts/frames/assets.ts +20 -1
- package/src/artifacts/frames/grants.ts +31 -10
- package/src/artifacts/frames/index.ts +2 -0
- package/src/artifacts/frames/kit.ts +8 -5
- package/src/artifacts/frames/protocol.ts +149 -0
- package/src/artifacts/frames/runtime.ts +317 -29
- package/src/artifacts/holders.ts +120 -0
- package/src/artifacts/ids.ts +8 -0
- package/src/artifacts/index.ts +28 -2
- package/src/artifacts/limits.ts +28 -4
- package/src/artifacts/live/board.ts +759 -0
- package/src/artifacts/live/diff.ts +297 -0
- package/src/artifacts/live/document.ts +354 -0
- package/src/artifacts/live/files.ts +82 -0
- package/src/artifacts/live/index.ts +50 -0
- package/src/artifacts/live/presence.ts +144 -0
- package/src/artifacts/live/protocol.ts +134 -0
- package/src/artifacts/live/server.ts +16 -0
- package/src/artifacts/live/state.ts +115 -0
- package/src/artifacts/outline.ts +12 -0
- package/src/artifacts/publish/index.ts +26 -1
- package/src/artifacts/publish/merge.ts +271 -0
- package/src/artifacts/publish/previews.ts +485 -0
- package/src/artifacts/publish/publish.ts +92 -39
- package/src/artifacts/publish/query-answers.ts +85 -0
- package/src/artifacts/publish/references.ts +10 -4
- package/src/artifacts/publish/validate/canvas.ts +133 -1
- package/src/artifacts/theme.ts +9 -1
- package/src/auth/directory.ts +166 -0
- package/src/auth/member-events.ts +10 -3
- package/src/auth/runtime.ts +108 -8
- package/src/auth/strategy.ts +3 -1
- package/src/auth/types.ts +44 -0
- package/src/authorization/decision.ts +6 -5
- package/src/authorization/event-visibility.ts +4 -0
- package/src/broker/in-memory.ts +33 -6
- package/src/broker/types.ts +4 -0
- package/src/connectors/builders.ts +34 -2
- package/src/connectors/connections/access.ts +83 -0
- package/src/connectors/connections/contracts.ts +6 -1
- package/src/connectors/connections/execution.ts +2 -2
- package/src/connectors/connections/runs.ts +51 -2
- package/src/connectors/connections/service.ts +208 -41
- package/src/connectors/connections/views.ts +11 -4
- package/src/connectors/execution.ts +27 -3
- package/src/connectors/index.ts +2 -0
- package/src/connectors/service.ts +12 -0
- package/src/connectors/types.ts +37 -2
- package/src/datasets/execution.ts +74 -37
- package/src/datasets/ingest-flush-batch.ts +289 -0
- package/src/datasets/ingest-flush-job.ts +112 -0
- package/src/datasets/ingest-flush.ts +377 -0
- package/src/datasets/produced-version.ts +55 -0
- package/src/datasets/write.ts +65 -11
- package/src/deploy/services.ts +1 -1
- package/src/deploy/types.ts +2 -3
- package/src/deploy/validation.ts +1 -0
- package/src/error-reporting/capability.ts +66 -0
- package/src/error-reporting/internal.ts +12 -0
- package/src/error-reporting/reporter.ts +11 -35
- package/src/error-reporting/reports.ts +167 -0
- package/src/error-reporting/types.ts +99 -0
- package/src/errors/catalog.ts +6 -0
- package/src/events/definitions.ts +14 -0
- package/src/events/execution.ts +77 -28
- package/src/events/index.ts +3 -0
- package/src/events/scope.ts +2 -0
- package/src/events/types/artifacts.ts +40 -0
- package/src/events/types/index.ts +3 -0
- package/src/events/types/users.ts +5 -2
- package/src/execution/authorized-object-reader.ts +34 -0
- package/src/execution/object-reader-clearance.ts +31 -0
- package/src/execution/object-reader-security.ts +33 -13
- package/src/http/api-routes.ts +105 -4
- package/src/index.ts +22 -4
- package/src/lake-storage/errors.ts +21 -0
- package/src/lake-storage/index.ts +9 -1
- package/src/lake-storage/maintenance.ts +93 -0
- package/src/lake-storage/merge.ts +3 -1
- package/src/lake-storage/source-ordering.ts +28 -2
- package/src/lake-storage/types.ts +14 -0
- package/src/maintenance/heartbeat.ts +14 -0
- package/src/maintenance/index.ts +5 -3
- package/src/maintenance/lake-retention-status.ts +81 -0
- package/src/maintenance/lake-retention.ts +347 -0
- package/src/maintenance/loop.ts +365 -0
- package/src/maintenance/ontology-maintenance.ts +76 -229
- package/src/maintenance/passes/cron-pass.ts +217 -0
- package/src/maintenance/passes/directory-pass.ts +22 -0
- package/src/maintenance/passes/ingest-pass.ts +94 -0
- package/src/maintenance/passes/lake-change-feed.ts +112 -0
- package/src/maintenance/passes/lake-retention-pass.ts +71 -0
- package/src/maintenance/passes/ontology-pass.ts +19 -0
- package/src/maintenance/passes/projections-pass.ts +238 -0
- package/src/maintenance/passes/recovery-pass.ts +17 -0
- package/src/maintenance/passes/recovery-passes.ts +39 -0
- package/src/maintenance/passes/runs-pass.ts +12 -0
- package/src/maintenance/passes/triggers-pass.ts +332 -0
- package/src/maintenance/status.ts +75 -0
- package/src/maintenance/types.ts +27 -25
- package/src/materialization/model.ts +33 -21
- package/src/materializer/README.md +13 -2
- package/src/materializer/edits/artifact-refs.ts +140 -0
- package/src/materializer/edits/commit.ts +20 -7
- package/src/materializer/edits/operations.ts +23 -7
- package/src/materializer/edits/plan.ts +2 -0
- package/src/materializer/execution/work-records.ts +61 -0
- package/src/materializer/projections/replacement-plan.ts +2 -0
- package/src/materializer/shared/normalize.ts +14 -0
- package/src/materializer/telemetry/plan.ts +2 -0
- package/src/objects/artifact-refs.ts +34 -0
- package/src/objects/materializer-adapter.ts +8 -3
- package/src/objects/object/upsert-batch.ts +7 -0
- package/src/objects/object/upsert.ts +11 -2
- package/src/objects/query/ir.ts +2 -0
- package/src/objects/query/scalar-values.ts +5 -3
- package/src/objects/runtime-batch.ts +8 -1
- package/src/objects/vectors/README.md +4 -4
- package/src/ontology/artifact-ref.ts +83 -0
- package/src/ontology/docs-markdown.ts +17 -0
- package/src/ontology/index.ts +3 -1
- package/src/ontology/inference/index.ts +2 -0
- package/src/ontology/json-schema.ts +13 -0
- package/src/ontology/primitives.ts +14 -0
- package/src/ontology/reference-values.ts +62 -0
- package/src/ontology/refs.ts +7 -1
- package/src/ontology/registry.ts +26 -1
- package/src/ontology/types.ts +2 -0
- package/src/ontology/user-ref.ts +35 -45
- package/src/ontology/validation/normalize.ts +13 -0
- package/src/ontology/validation/properties.ts +9 -0
- package/src/ontology/validation/schema.ts +12 -0
- package/src/pending-tasks.ts +51 -0
- package/src/pipelines/run-dispatch.ts +120 -238
- package/src/predicates/types.ts +2 -1
- package/src/projections/builders.ts +28 -13
- package/src/projections/run-dispatch.ts +1 -1
- package/src/projections/types.ts +1 -1
- package/src/projections/validation.ts +22 -8
- package/src/queues/in-memory.ts +50 -3
- package/src/queues/index.ts +4 -0
- package/src/queues/types.ts +68 -1
- package/src/runtime/create.ts +4 -0
- package/src/runtime/host.ts +118 -13
- package/src/runtime/index.ts +0 -1
- package/src/runtime/internal.ts +13 -0
- package/src/runtime/ontology-mutations.ts +1 -1
- package/src/runtime/sixb.ts +14 -5
- package/src/scheduler/index.ts +0 -2
- package/src/shared/backoff.ts +34 -0
- package/src/shared/duration.ts +15 -0
- package/src/shared/params/artifact-refs.ts +42 -0
- package/src/shares/compiler.ts +1 -1
- package/src/shares/guest-name.ts +20 -0
- package/src/shares/internal.ts +1 -0
- package/src/shares/session-protocol.ts +63 -0
- package/src/storage/artifacts/errors.ts +10 -2
- package/src/storage/artifacts/in-memory.ts +579 -96
- package/src/storage/artifacts/index.ts +22 -1
- package/src/storage/artifacts/record.ts +255 -11
- package/src/storage/artifacts/types.ts +343 -40
- package/src/storage/auth/in-memory/auth-storage.ts +42 -5
- package/src/storage/auth/in-memory/identities.ts +16 -0
- package/src/storage/auth/in-memory/shared.ts +15 -0
- package/src/storage/auth/in-memory/users.ts +17 -16
- package/src/storage/auth/index.ts +3 -0
- package/src/storage/auth/types.ts +38 -0
- package/src/storage/connector-connections/in-memory.ts +4 -1
- package/src/storage/connector-connections/index.ts +1 -0
- package/src/storage/connector-connections/provider/runs.ts +3 -0
- package/src/storage/connector-connections/provider/shared.ts +30 -0
- package/src/storage/connector-connections/provider.ts +4 -0
- package/src/storage/connector-connections/types.ts +1 -0
- package/src/storage/dataset-ingest/codec.ts +90 -0
- package/src/storage/dataset-ingest/in-memory.ts +277 -0
- package/src/storage/dataset-ingest/index.ts +16 -0
- package/src/storage/dataset-ingest/provider.ts +592 -0
- package/src/storage/dataset-ingest/types.ts +191 -0
- package/src/storage/in-memory/index.ts +33 -0
- package/src/storage/index.ts +65 -5
- package/src/storage/internal.ts +20 -0
- package/src/storage/lake-retention-runs/in-memory.ts +22 -0
- package/src/storage/lake-retention-runs/index.ts +2 -0
- package/src/storage/lake-retention-runs/types.ts +19 -0
- package/src/storage/maintenance-heartbeats/in-memory.ts +24 -0
- package/src/storage/maintenance-heartbeats/index.ts +7 -0
- package/src/storage/maintenance-heartbeats/record.ts +50 -0
- package/src/storage/maintenance-heartbeats/types.ts +30 -0
- package/src/storage/objects/in-memory/query.ts +1 -0
- package/src/storage/objects/in-memory/storage.ts +81 -0
- package/src/storage/objects/read-scope.ts +1 -0
- package/src/storage/objects/types.ts +16 -1
- package/src/storage/ontology/in-memory/materializations.ts +8 -0
- package/src/storage/ontology/in-memory/replacement-plans.ts +4 -1
- package/src/storage/ontology/index.ts +2 -0
- package/src/storage/ontology/materializations.ts +18 -0
- package/src/storage/ontology/provider-work.ts +39 -0
- package/src/storage/pipeline-runs/in-memory.ts +97 -24
- package/src/storage/pipeline-runs/index.ts +0 -1
- package/src/storage/pipeline-runs/provider.ts +1 -1
- package/src/storage/pipeline-runs/transitions.ts +7 -4
- package/src/storage/pipeline-runs/types.ts +33 -7
- package/src/storage/projection-runs/errors.ts +10 -0
- package/src/storage/projection-runs/in-memory.ts +56 -1
- package/src/storage/projection-runs/index.ts +2 -1
- package/src/storage/projection-runs/lifecycle.ts +9 -1
- package/src/storage/projection-runs/types.ts +20 -1
- package/src/storage/run-claim.ts +224 -0
- package/src/storage/share-sessions/in-memory.ts +21 -0
- package/src/storage/share-sessions/index.ts +1 -0
- package/src/storage/share-sessions/provider.ts +1 -0
- package/src/storage/share-sessions/record.ts +28 -0
- package/src/storage/share-sessions/types.ts +19 -1
- package/src/storage/sync-runs/in-memory.ts +109 -29
- package/src/storage/sync-runs/index.ts +1 -1
- package/src/storage/sync-runs/transitions.ts +7 -4
- package/src/storage/sync-runs/types.ts +36 -3
- package/src/storage/types.ts +15 -5
- package/src/storage/webhook-runs/in-memory.ts +26 -2
- package/src/storage/webhook-runs/index.ts +3 -1
- package/src/storage/webhook-runs/types.ts +44 -3
- package/src/storage/workflow-runs/in-memory.ts +50 -36
- package/src/storage/workflow-runs/index.ts +0 -2
- package/src/storage/workflow-runs/types.ts +18 -30
- package/src/syncs/run-dispatch.ts +118 -239
- package/src/testing/ai-model-call-groups-contract.ts +2 -1
- package/src/testing/artifact-holders-contract.ts +392 -0
- package/src/testing/artifact-storage-contract.ts +1205 -151
- package/src/testing/auth-storage-contract.ts +228 -1
- package/src/testing/broker-contract.ts +56 -0
- package/src/testing/connector-connection-storage-contract.ts +94 -5
- package/src/testing/dataset-ingest-storage-contract.ts +480 -0
- package/src/testing/dataset-sequence-contract.ts +97 -12
- package/src/testing/execution.ts +23 -0
- package/src/testing/index.ts +31 -0
- package/src/testing/lake-retention-run-storage-contract.ts +75 -0
- package/src/testing/maintenance-heartbeat-storage-contract.ts +99 -0
- package/src/testing/object-query-contract.ts +93 -0
- package/src/testing/pipeline-execution.ts +3 -1
- package/src/testing/pipeline-run-read-contract.ts +123 -0
- package/src/testing/projection-run-storage-contract.ts +113 -0
- package/src/testing/queues-contract.ts +112 -0
- package/src/testing/run-claim-storage-contract.ts +736 -0
- package/src/testing/run-claim.ts +69 -0
- package/src/testing/run-recovery-contract.ts +176 -0
- package/src/testing/share-session-storage-contract.ts +43 -0
- package/src/testing/stored-artifacts.ts +43 -0
- package/src/testing/sync-execution.ts +3 -1
- package/src/testing/webhook-execution.ts +7 -2
- package/src/testing/webhook-run-storage-contract.ts +102 -5
- package/src/users/execution.ts +50 -2
- package/src/users/index.ts +1 -0
- package/src/webhooks/delivery-lease.ts +40 -0
- package/src/webhooks/internal.ts +2 -0
- package/src/webhooks/run-admission.ts +22 -9
- package/src/workers/README.md +169 -0
- package/src/workers/index.ts +9 -1
- package/src/workers/job-ids.ts +31 -0
- package/src/workers/lost-projection-runs.ts +114 -0
- package/src/workers/lost-runs.ts +397 -0
- package/src/workers/queue-delivery.ts +2 -14
- package/src/workers/queue-worker.ts +9 -17
- package/src/workers/queued-run-dispatch.ts +308 -0
- package/src/workers/run-lease.ts +46 -0
- package/src/workers/run-worker.ts +312 -0
- package/src/workers/worker.ts +4 -17
- package/src/workflows/request.ts +2 -0
- package/src/workflows/run-dispatch.ts +22 -4
- package/src/workflows/snapshot.ts +1 -0
- package/dist/chunk-2g0r46hy.js.map +0 -12
- package/dist/chunk-3fqxbn31.js +0 -107
- package/dist/chunk-3fqxbn31.js.map +0 -11
- package/dist/chunk-4s753g3k.js +0 -314
- package/dist/chunk-4s753g3k.js.map +0 -12
- package/dist/chunk-5kyvrtjh.js.map +0 -12
- package/dist/chunk-5taem5aw.js.map +0 -10
- package/dist/chunk-65abf64x.js +0 -13
- package/dist/chunk-65abf64x.js.map +0 -10
- package/dist/chunk-9x8dybsb.js.map +0 -10
- package/dist/chunk-az47zep4.js +0 -41
- package/dist/chunk-az47zep4.js.map +0 -10
- package/dist/chunk-c706qvyc.js +0 -299
- package/dist/chunk-c706qvyc.js.map +0 -11
- package/dist/chunk-djs3hw9p.js.map +0 -20
- package/dist/chunk-e5wf5vz0.js.map +0 -10
- package/dist/chunk-e6xgz4h4.js.map +0 -21
- package/dist/chunk-e7v3trpz.js.map +0 -10
- package/dist/chunk-eqgr6nsa.js.map +0 -72
- package/dist/chunk-fb3feg1e.js +0 -298
- package/dist/chunk-fb3feg1e.js.map +0 -12
- package/dist/chunk-hz5d43gn.js.map +0 -10
- package/dist/chunk-j8thxj7w.js.map +0 -22
- package/dist/chunk-jbw70d6t.js.map +0 -10
- package/dist/chunk-jftd33rc.js.map +0 -11
- package/dist/chunk-jspskey0.js.map +0 -10
- package/dist/chunk-kfee1h52.js.map +0 -13
- package/dist/chunk-kwfhd1g0.js +0 -144
- package/dist/chunk-kwfhd1g0.js.map +0 -13
- package/dist/chunk-nz7815t3.js.map +0 -14
- package/dist/chunk-s3we74h8.js.map +0 -12
- package/dist/chunk-scyq22td.js.map +0 -12
- package/dist/chunk-w1btn96n.js.map +0 -44
- package/dist/chunk-w976a4me.js.map +0 -10
- package/dist/chunk-wkq3kvzd.js.map +0 -10
- package/dist/chunk-wrjx1fqz.js +0 -587
- package/dist/chunk-wrjx1fqz.js.map +0 -18
- package/dist/chunk-yw9pyg66.js +0 -143
- package/dist/chunk-yw9pyg66.js.map +0 -11
- package/dist/chunk-z8fx5cgb.js.map +0 -11
- package/dist/scheduler/runtime.d.ts +0 -40
- package/dist/scheduler/runtime.d.ts.map +0 -1
- package/dist/workers/unstarted-run.d.ts +0 -10
- package/dist/workers/unstarted-run.d.ts.map +0 -1
- package/src/scheduler/runtime.ts +0 -214
- package/src/workers/unstarted-run.ts +0 -18
- /package/dist/{chunk-80gym75n.js.map → chunk-186k5yz3.js.map} +0 -0
- /package/dist/{chunk-ytzcxtpt.js.map → chunk-3ba89vm7.js.map} +0 -0
- /package/dist/{chunk-d04g36fw.js.map → chunk-5qqmndhm.js.map} +0 -0
- /package/dist/{chunk-5wtnmpze.js.map → chunk-7qe46788.js.map} +0 -0
- /package/dist/{chunk-31kcqmhf.js.map → chunk-855w9nvw.js.map} +0 -0
- /package/dist/{chunk-2ajw5rz0.js.map → chunk-8p7bze4c.js.map} +0 -0
- /package/dist/{chunk-9whfmsfk.js.map → chunk-8tqnsx3q.js.map} +0 -0
- /package/dist/{chunk-s038wa5v.js.map → chunk-b9qfh2ya.js.map} +0 -0
- /package/dist/{chunk-jjmggm9a.js.map → chunk-fe6r7yhg.js.map} +0 -0
- /package/dist/{chunk-165c9wm6.js.map → chunk-g2ph4873.js.map} +0 -0
- /package/dist/{chunk-ga63a3dz.js.map → chunk-k66rp2hr.js.map} +0 -0
- /package/dist/{chunk-4zm1k3xj.js.map → chunk-r2psmn42.js.map} +0 -0
- /package/dist/{chunk-r1cxq7vv.js.map → chunk-rtdrm592.js.map} +0 -0
- /package/dist/{chunk-4bm0caep.js.map → chunk-smnt672s.js.map} +0 -0
- /package/dist/{chunk-21q0j5f2.js.map → chunk-stmxh0hv.js.map} +0 -0
- /package/dist/{chunk-ff5xkv0p.js.map → chunk-tfzvjdms.js.map} +0 -0
- /package/dist/{chunk-6b61s40c.js.map → chunk-w3t94hm6.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
createSixbError2,
|
|
7
7
|
toSixbFailure2,
|
|
8
8
|
parseSixbFailure2
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-mvz89age.js";
|
|
10
10
|
import {
|
|
11
11
|
vectorSources,
|
|
12
12
|
hasVectorProfile2,
|
|
@@ -16,16 +16,16 @@ import {
|
|
|
16
16
|
paginate,
|
|
17
17
|
InMemoryAuthStorage2,
|
|
18
18
|
principalsEqual2
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-0k3r5kb3.js";
|
|
20
20
|
import {
|
|
21
21
|
ObjectReadLimitExceededError2,
|
|
22
22
|
snapshotObjectReadExecutionLimits2,
|
|
23
23
|
assertObjectReadFacetCount2,
|
|
24
24
|
assertObjectReadOutputWithinLimit2
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-vzkxqf8h.js";
|
|
26
26
|
import {
|
|
27
27
|
assertObjectReaderProject2
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-rt9deb92.js";
|
|
29
29
|
import {
|
|
30
30
|
UNIQUE_VALUE_KEY_VERSION,
|
|
31
31
|
uniquePropertiesOf,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
queryScalarKindForSchema,
|
|
34
34
|
resolvePropertyQueryCapabilities2,
|
|
35
35
|
resolveQuerySchema
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-3zagkr6w.js";
|
|
37
37
|
import {
|
|
38
38
|
createEventId2
|
|
39
39
|
} from "./chunk-zrvhsq7f.js";
|
|
@@ -124,13 +124,17 @@ import {
|
|
|
124
124
|
assertNonBlank2,
|
|
125
125
|
cloneValidDate2
|
|
126
126
|
} from "./chunk-c4nrycdy.js";
|
|
127
|
+
import {
|
|
128
|
+
DurableDatasetIngestStorage2,
|
|
129
|
+
initialDatasetIngestState2
|
|
130
|
+
} from "./chunk-pk539cwv.js";
|
|
127
131
|
import {
|
|
128
132
|
isAbandonedFileUploadSession,
|
|
129
133
|
shouldDeleteFileUploadSession
|
|
130
134
|
} from "./chunk-h89wz928.js";
|
|
131
135
|
import {
|
|
132
136
|
DurableFileUploadSessions2
|
|
133
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-855w9nvw.js";
|
|
134
138
|
import {
|
|
135
139
|
actionSubjectsEqual,
|
|
136
140
|
normalizeRecordActionRunInput2,
|
|
@@ -142,6 +146,8 @@ import {
|
|
|
142
146
|
planActivityAppend2,
|
|
143
147
|
activityCalendarDays2,
|
|
144
148
|
activityDay,
|
|
149
|
+
turnUndoable2,
|
|
150
|
+
othersCommented2,
|
|
145
151
|
artifactStateBytes2,
|
|
146
152
|
checkArtifactStateWrite2,
|
|
147
153
|
artifactStorageErrors2,
|
|
@@ -152,7 +158,11 @@ import {
|
|
|
152
158
|
canFinishSyncRun2,
|
|
153
159
|
createTransactionStorageProxy2,
|
|
154
160
|
throwNestedStorageTransaction2
|
|
155
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-3014rfjz.js";
|
|
162
|
+
import {
|
|
163
|
+
ARTIFACT_RESTORE_POINTS2,
|
|
164
|
+
ARTIFACT_COMMENT_LIMITS2
|
|
165
|
+
} from "./chunk-9vsc919v.js";
|
|
156
166
|
import {
|
|
157
167
|
ExecutionStorageError2,
|
|
158
168
|
prepareExecutionRecord2,
|
|
@@ -213,7 +223,7 @@ import {
|
|
|
213
223
|
assertSourceStagedRow2,
|
|
214
224
|
isExactStagingManifest2,
|
|
215
225
|
sourceConflict2
|
|
216
|
-
} from "./chunk-
|
|
226
|
+
} from "./chunk-e0hnbb1m.js";
|
|
217
227
|
import {
|
|
218
228
|
createStorageOperationScope2,
|
|
219
229
|
createOperationScopedFacade2,
|
|
@@ -223,10 +233,17 @@ import {
|
|
|
223
233
|
createObjectOperationScope2,
|
|
224
234
|
createWorkflowRunOperationScope2
|
|
225
235
|
} from "./chunk-s7xqfxs9.js";
|
|
236
|
+
import {
|
|
237
|
+
planRunClaim2,
|
|
238
|
+
selectLostRuns,
|
|
239
|
+
laterLease2,
|
|
240
|
+
holdsRun2,
|
|
241
|
+
mayFinishRun2
|
|
242
|
+
} from "./chunk-3sgvd10b.js";
|
|
226
243
|
import {
|
|
227
244
|
PipelineRunError2,
|
|
228
245
|
assertPipelineRunExecution2
|
|
229
|
-
} from "./chunk-
|
|
246
|
+
} from "./chunk-22d3qg4x.js";
|
|
230
247
|
import {
|
|
231
248
|
projectionRunObjectTypesVisible2
|
|
232
249
|
} from "./chunk-hn2r7z41.js";
|
|
@@ -257,7 +274,7 @@ import {
|
|
|
257
274
|
assertProjectionMissingTarget2,
|
|
258
275
|
requireTelemetryProjectionRun2,
|
|
259
276
|
assertProjectionRunDurableExecution2
|
|
260
|
-
} from "./chunk-
|
|
277
|
+
} from "./chunk-5rqqp8cr.js";
|
|
261
278
|
import {
|
|
262
279
|
SyncRunError2,
|
|
263
280
|
assertSyncRunExecution2
|
|
@@ -270,7 +287,7 @@ import {
|
|
|
270
287
|
WorkflowRunError2,
|
|
271
288
|
assertWorkflowRunExecution2,
|
|
272
289
|
assertWorkflowAgentNodeRunExecution2
|
|
273
|
-
} from "./chunk-
|
|
290
|
+
} from "./chunk-p351afzm.js";
|
|
274
291
|
import {
|
|
275
292
|
ShareGrantStorageError2,
|
|
276
293
|
normalizeShareGrantCreate2,
|
|
@@ -279,26 +296,30 @@ import {
|
|
|
279
296
|
normalizeListShareGrantsInput2,
|
|
280
297
|
normalizeRevokeShareGrantInput2,
|
|
281
298
|
cloneShareGrantRecord2
|
|
282
|
-
} from "./chunk-
|
|
299
|
+
} from "./chunk-186k5yz3.js";
|
|
283
300
|
import {
|
|
284
301
|
ShareSessionStorageError2,
|
|
285
302
|
normalizeShareSessionCreate2,
|
|
286
303
|
parseShareSessionRecord2,
|
|
287
304
|
normalizeGetShareSessionByIdInput2,
|
|
288
305
|
normalizeRenewShareSessionIfValidInput2,
|
|
306
|
+
normalizeSetShareSessionGuestNameInput2,
|
|
289
307
|
normalizeRevokeShareSessionInput2,
|
|
290
308
|
cloneShareSessionRecord2
|
|
291
|
-
} from "./chunk-
|
|
292
|
-
import {
|
|
293
|
-
ActionRunError2
|
|
294
|
-
} from "./chunk-3gbefjg5.js";
|
|
309
|
+
} from "./chunk-j2zm215x.js";
|
|
295
310
|
import {
|
|
296
311
|
ConnectorConnectionStorageError2,
|
|
297
312
|
CONNECTOR_CONNECTION_RUN_FAILURE_CODES2
|
|
298
313
|
} from "./chunk-2c4j899j.js";
|
|
314
|
+
import {
|
|
315
|
+
ActionRunError2
|
|
316
|
+
} from "./chunk-3gbefjg5.js";
|
|
299
317
|
import {
|
|
300
318
|
assertPinnedDatasetWatermark2
|
|
301
319
|
} from "./chunk-n8q5j6y5.js";
|
|
320
|
+
import {
|
|
321
|
+
sameConnectorConnectionOwner
|
|
322
|
+
} from "./chunk-pvpq483h.js";
|
|
302
323
|
import {
|
|
303
324
|
MaterializationValidationError2,
|
|
304
325
|
UniqueValueViolationError2,
|
|
@@ -2096,7 +2117,7 @@ class InMemoryConnectorConnectionStorage2 {
|
|
|
2096
2117
|
if (input.connectionRunId !== undefined) {
|
|
2097
2118
|
const run = this.connectionRuns.get(input.connectionRunId);
|
|
2098
2119
|
const existingAttempt = this.findAuthorizationAttemptByConnectionRunId(input.connectionRunId);
|
|
2099
|
-
if (!run || existingAttempt || run.projectId !== input.projectId || run.connectorId !== input.connectorId || run.status !== "waiting" || run.waitingFor !== "provider_authorization" || run.slot !== input.slot || run.initiatedByExecutionId !== input.initiatedByExecutionId) {
|
|
2120
|
+
if (!run || existingAttempt || run.projectId !== input.projectId || run.connectorId !== input.connectorId || run.status !== "waiting" || run.waitingFor !== "provider_authorization" || !sameConnectorConnectionOwner(run.owner, input.owner) || run.slot !== input.slot || run.initiatedByExecutionId !== input.initiatedByExecutionId) {
|
|
2100
2121
|
throw new ConnectorConnectionStorageError2("attempt_conflict", "[Sixb] Connector authorization attempt does not match its connection run.");
|
|
2101
2122
|
}
|
|
2102
2123
|
}
|
|
@@ -2193,7 +2214,7 @@ class InMemoryConnectorConnectionStorage2 {
|
|
|
2193
2214
|
return null;
|
|
2194
2215
|
}
|
|
2195
2216
|
const run = this.connectionRuns.get(attempt.connectionRunId);
|
|
2196
|
-
if (!run || run.projectId !== input.projectId || run.connectorId !== attempt.connectorId || run.status !== "waiting" || run.waitingFor !== "provider_authorization" || run.slot !== attempt.slot || run.initiatedByExecutionId !== attempt.initiatedByExecutionId) {
|
|
2217
|
+
if (!run || run.projectId !== input.projectId || run.connectorId !== attempt.connectorId || run.status !== "waiting" || run.waitingFor !== "provider_authorization" || !sameConnectorConnectionOwner(run.owner, attempt.owner) || run.slot !== attempt.slot || run.initiatedByExecutionId !== attempt.initiatedByExecutionId) {
|
|
2197
2218
|
return null;
|
|
2198
2219
|
}
|
|
2199
2220
|
const now = this.now();
|
|
@@ -2762,7 +2783,7 @@ class InMemoryConnectorConnectionStorage2 {
|
|
|
2762
2783
|
}
|
|
2763
2784
|
findConnectionRecord(input) {
|
|
2764
2785
|
for (const connection of this.connections.values()) {
|
|
2765
|
-
if (connection.projectId === input.projectId && connection.connectorId === input.connectorId && connection.owner
|
|
2786
|
+
if (connection.projectId === input.projectId && connection.connectorId === input.connectorId && sameConnectorConnectionOwner(connection.owner, input.owner) && connection.slot === input.slot) {
|
|
2766
2787
|
return connection;
|
|
2767
2788
|
}
|
|
2768
2789
|
}
|
|
@@ -2899,6 +2920,165 @@ function applyStagedCredentials(record, staged, now, input) {
|
|
|
2899
2920
|
updatedAt: now
|
|
2900
2921
|
};
|
|
2901
2922
|
}
|
|
2923
|
+
// src/storage/dataset-ingest/in-memory.ts
|
|
2924
|
+
class InMemoryDatasetIngestStorage2 extends DurableDatasetIngestStorage2 {
|
|
2925
|
+
data;
|
|
2926
|
+
constructor() {
|
|
2927
|
+
const data = { nextId: 1n, deliveries: new Map, states: new Map };
|
|
2928
|
+
super(new InMemoryDatasetIngestBackend(data));
|
|
2929
|
+
this.data = data;
|
|
2930
|
+
}
|
|
2931
|
+
snapshot() {
|
|
2932
|
+
return structuredClone(this.data);
|
|
2933
|
+
}
|
|
2934
|
+
restore(snapshot) {
|
|
2935
|
+
const copy = structuredClone(snapshot);
|
|
2936
|
+
this.data.nextId = copy.nextId;
|
|
2937
|
+
replaceEntries(this.data.deliveries, copy.deliveries);
|
|
2938
|
+
replaceEntries(this.data.states, copy.states);
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2942
|
+
class InMemoryDatasetIngestBackend {
|
|
2943
|
+
persistence;
|
|
2944
|
+
tail = Promise.resolve();
|
|
2945
|
+
constructor(data) {
|
|
2946
|
+
this.persistence = new InMemoryDatasetIngestPersistence(data);
|
|
2947
|
+
}
|
|
2948
|
+
read(run) {
|
|
2949
|
+
return run(this.persistence);
|
|
2950
|
+
}
|
|
2951
|
+
transaction(run) {
|
|
2952
|
+
const result = this.tail.then(() => run(this.persistence));
|
|
2953
|
+
this.tail = result.catch(() => {
|
|
2954
|
+
return;
|
|
2955
|
+
});
|
|
2956
|
+
return result;
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
class InMemoryDatasetIngestPersistence {
|
|
2961
|
+
data;
|
|
2962
|
+
constructor(data) {
|
|
2963
|
+
this.data = data;
|
|
2964
|
+
}
|
|
2965
|
+
async now() {
|
|
2966
|
+
return new Date;
|
|
2967
|
+
}
|
|
2968
|
+
async lockState(projectId, datasetId) {
|
|
2969
|
+
return this.data.states.get(stateKey(projectId, datasetId)) ?? initialDatasetIngestState2(datasetId);
|
|
2970
|
+
}
|
|
2971
|
+
async writeState(projectId, state) {
|
|
2972
|
+
this.data.states.set(stateKey(projectId, state.datasetId), state);
|
|
2973
|
+
}
|
|
2974
|
+
async insertDelivery(projectId, record) {
|
|
2975
|
+
const id = this.data.nextId;
|
|
2976
|
+
this.data.nextId += 1n;
|
|
2977
|
+
this.data.deliveries.set(id, { ...record, projectId, id, flushId: null });
|
|
2978
|
+
return id.toString();
|
|
2979
|
+
}
|
|
2980
|
+
async listUntaken(projectId, datasetId, limit) {
|
|
2981
|
+
return this.deliveriesOf(projectId, datasetId).filter((delivery) => delivery.flushId === null && !delivery.rejection).slice(0, limit).map(toDelivery);
|
|
2982
|
+
}
|
|
2983
|
+
async take(projectId, datasetId, deliveryIds, flushId) {
|
|
2984
|
+
for (const id of deliveryIds) {
|
|
2985
|
+
const delivery = this.data.deliveries.get(BigInt(id));
|
|
2986
|
+
if (delivery?.projectId === projectId && delivery.datasetId === datasetId) {
|
|
2987
|
+
this.data.deliveries.set(delivery.id, { ...delivery, flushId });
|
|
2988
|
+
}
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
async listFlush(projectId, datasetId, flushId) {
|
|
2992
|
+
return this.flushOf(projectId, datasetId, flushId).map(toDelivery);
|
|
2993
|
+
}
|
|
2994
|
+
async readFlush(projectId, datasetId, flushId, page) {
|
|
2995
|
+
const afterId = page.afterId === null ? 0n : BigInt(page.afterId);
|
|
2996
|
+
return this.flushOf(projectId, datasetId, flushId).filter((delivery) => delivery.id > afterId).slice(0, page.limit).map((delivery) => ({ delivery: toDelivery(delivery), changes: delivery.changes }));
|
|
2997
|
+
}
|
|
2998
|
+
async deleteFlush(projectId, datasetId, flushId) {
|
|
2999
|
+
for (const delivery of this.flushOf(projectId, datasetId, flushId)) {
|
|
3000
|
+
this.data.deliveries.delete(delivery.id);
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3003
|
+
async rejectDelivery(projectId, datasetId, flushId, deliveryId, rejection) {
|
|
3004
|
+
for (const delivery of this.flushOf(projectId, datasetId, flushId)) {
|
|
3005
|
+
if (delivery.id.toString() === deliveryId) {
|
|
3006
|
+
this.data.deliveries.set(delivery.id, { ...delivery, flushId: null, rejection });
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
3010
|
+
async listRejected(projectId, datasetId, limit) {
|
|
3011
|
+
const records = [];
|
|
3012
|
+
for (const stored of this.data.deliveries.values()) {
|
|
3013
|
+
if (stored.projectId !== projectId || !stored.rejection)
|
|
3014
|
+
continue;
|
|
3015
|
+
if (datasetId !== undefined && stored.datasetId !== datasetId)
|
|
3016
|
+
continue;
|
|
3017
|
+
records.push({ delivery: toDelivery(stored), ...stored.rejection, changes: stored.changes });
|
|
3018
|
+
}
|
|
3019
|
+
return records.sort((left, right) => right.rejectedAt.getTime() - left.rejectedAt.getTime()).slice(0, limit);
|
|
3020
|
+
}
|
|
3021
|
+
async deleteRejected(projectId, before) {
|
|
3022
|
+
for (const delivery of [...this.data.deliveries.values()]) {
|
|
3023
|
+
if (delivery.projectId === projectId && delivery.rejection && delivery.rejection.rejectedAt < before) {
|
|
3024
|
+
this.data.deliveries.delete(delivery.id);
|
|
3025
|
+
}
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
async listStates(projectId, datasetIds) {
|
|
3029
|
+
const wanted = datasetIds === undefined ? null : new Set(datasetIds);
|
|
3030
|
+
return [...this.data.states.entries()].filter(([key]) => key.startsWith(`${projectId}\x00`)).map(([, state]) => state).filter((state) => wanted === null || wanted.has(state.datasetId));
|
|
3031
|
+
}
|
|
3032
|
+
async countPending(projectId, datasetIds) {
|
|
3033
|
+
const wanted = datasetIds === undefined ? null : new Set(datasetIds);
|
|
3034
|
+
const counts = new Map;
|
|
3035
|
+
for (const delivery of this.data.deliveries.values()) {
|
|
3036
|
+
if (delivery.projectId !== projectId)
|
|
3037
|
+
continue;
|
|
3038
|
+
if (wanted !== null && !wanted.has(delivery.datasetId))
|
|
3039
|
+
continue;
|
|
3040
|
+
const current = counts.get(delivery.datasetId) ?? {
|
|
3041
|
+
datasetId: delivery.datasetId,
|
|
3042
|
+
pendingDeliveries: 0,
|
|
3043
|
+
pendingChanges: 0,
|
|
3044
|
+
oldestReceivedAt: null,
|
|
3045
|
+
rejectedDeliveries: 0
|
|
3046
|
+
};
|
|
3047
|
+
counts.set(delivery.datasetId, delivery.rejection ? { ...current, rejectedDeliveries: current.rejectedDeliveries + 1 } : {
|
|
3048
|
+
...current,
|
|
3049
|
+
pendingDeliveries: current.pendingDeliveries + 1,
|
|
3050
|
+
pendingChanges: current.pendingChanges + delivery.changeCount,
|
|
3051
|
+
oldestReceivedAt: current.oldestReceivedAt && current.oldestReceivedAt <= delivery.receivedAt ? current.oldestReceivedAt : delivery.receivedAt
|
|
3052
|
+
});
|
|
3053
|
+
}
|
|
3054
|
+
return [...counts.values()];
|
|
3055
|
+
}
|
|
3056
|
+
deliveriesOf(projectId, datasetId) {
|
|
3057
|
+
return [...this.data.deliveries.values()].filter((delivery) => delivery.projectId === projectId && delivery.datasetId === datasetId).sort((left, right) => left.id < right.id ? -1 : 1);
|
|
3058
|
+
}
|
|
3059
|
+
flushOf(projectId, datasetId, flushId) {
|
|
3060
|
+
return this.deliveriesOf(projectId, datasetId).filter((delivery) => delivery.flushId === flushId);
|
|
3061
|
+
}
|
|
3062
|
+
}
|
|
3063
|
+
function toDelivery(stored) {
|
|
3064
|
+
return {
|
|
3065
|
+
id: stored.id.toString(),
|
|
3066
|
+
datasetId: stored.datasetId,
|
|
3067
|
+
executionId: stored.executionId,
|
|
3068
|
+
correlationId: stored.correlationId,
|
|
3069
|
+
receivedAt: stored.receivedAt,
|
|
3070
|
+
changeCount: stored.changeCount,
|
|
3071
|
+
definitionHash: stored.definitionHash
|
|
3072
|
+
};
|
|
3073
|
+
}
|
|
3074
|
+
function stateKey(projectId, datasetId) {
|
|
3075
|
+
return `${projectId}\x00${datasetId}`;
|
|
3076
|
+
}
|
|
3077
|
+
function replaceEntries(target, source) {
|
|
3078
|
+
target.clear();
|
|
3079
|
+
for (const [key, value] of source)
|
|
3080
|
+
target.set(key, value);
|
|
3081
|
+
}
|
|
2902
3082
|
// src/storage/file-upload-sessions/in-memory.ts
|
|
2903
3083
|
class InMemoryFileUploadSessions2 extends DurableFileUploadSessions2 {
|
|
2904
3084
|
sessionsById;
|
|
@@ -3202,11 +3382,18 @@ class InMemoryArtifactStorage {
|
|
|
3202
3382
|
artifacts = new Map;
|
|
3203
3383
|
frameGrants = new Map;
|
|
3204
3384
|
state = new Map;
|
|
3385
|
+
boardPreviews = new Map;
|
|
3205
3386
|
async create(input) {
|
|
3206
3387
|
const key = artifactKey(input.projectId, input.id);
|
|
3207
3388
|
if (this.artifacts.has(key))
|
|
3208
3389
|
throw artifactStorageErrors2.exists(input.id);
|
|
3209
|
-
const
|
|
3390
|
+
const content = input.version;
|
|
3391
|
+
const version = versionRecord(input.projectId, input.id, {
|
|
3392
|
+
version: 1,
|
|
3393
|
+
revision: 1,
|
|
3394
|
+
content,
|
|
3395
|
+
createdAt: content.updatedAt
|
|
3396
|
+
});
|
|
3210
3397
|
const record = {
|
|
3211
3398
|
projectId: input.projectId,
|
|
3212
3399
|
id: input.id,
|
|
@@ -3214,16 +3401,22 @@ class InMemoryArtifactStorage {
|
|
|
3214
3401
|
title: version.title,
|
|
3215
3402
|
owner: { ...input.owner },
|
|
3216
3403
|
latestVersion: 1,
|
|
3217
|
-
|
|
3218
|
-
|
|
3404
|
+
revision: 1,
|
|
3405
|
+
createdAt: new Date(content.updatedAt),
|
|
3406
|
+
updatedAt: new Date(content.updatedAt),
|
|
3407
|
+
...input.document ? { document: { file: structuredClone(input.document), revision: 1 } } : {}
|
|
3219
3408
|
};
|
|
3220
|
-
|
|
3409
|
+
const stored = turnWrote(sharedIn({
|
|
3221
3410
|
record,
|
|
3222
3411
|
versions: [version],
|
|
3223
3412
|
nextVersion: 2,
|
|
3224
|
-
threads:
|
|
3225
|
-
|
|
3226
|
-
|
|
3413
|
+
threads: new Map,
|
|
3414
|
+
restorePoints: [],
|
|
3415
|
+
turnWrites: new Map,
|
|
3416
|
+
comments: []
|
|
3417
|
+
}, content, input.turnRunId), input.turnRunId, { created: true });
|
|
3418
|
+
this.artifacts.set(key, stored);
|
|
3419
|
+
return published(stored);
|
|
3227
3420
|
}
|
|
3228
3421
|
async publish(input) {
|
|
3229
3422
|
const key = artifactKey(input.projectId, input.artifactId);
|
|
@@ -3233,27 +3426,121 @@ class InMemoryArtifactStorage {
|
|
|
3233
3426
|
if (stored.record.kind !== input.kind) {
|
|
3234
3427
|
throw artifactStorageErrors2.kindMismatch(input.artifactId, stored.record.kind, input.kind);
|
|
3235
3428
|
}
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3429
|
+
assertBase(stored, input.baseRevision);
|
|
3430
|
+
const { turnRunId } = input;
|
|
3431
|
+
const firstOfTurn = turnRunId !== undefined && !stored.turnWrites.has(turnRunId);
|
|
3432
|
+
const kept = firstOfTurn ? withRestorePoint(stored, {
|
|
3433
|
+
reason: "turn",
|
|
3434
|
+
turnRunId,
|
|
3435
|
+
createdAt: input.version.updatedAt
|
|
3436
|
+
}) : stored;
|
|
3437
|
+
const next = turnWrote(sharedIn(written(kept, input.version, input.document), input.version, turnRunId), turnRunId, { created: false });
|
|
3438
|
+
this.artifacts.set(key, next);
|
|
3439
|
+
return published(next);
|
|
3440
|
+
}
|
|
3441
|
+
async freeze(input) {
|
|
3442
|
+
const key = artifactKey(input.projectId, input.artifactId);
|
|
3443
|
+
const stored = this.artifacts.get(key);
|
|
3444
|
+
if (!stored)
|
|
3445
|
+
throw artifactStorageErrors2.notFound(input.artifactId);
|
|
3446
|
+
const latest = latestOf(stored);
|
|
3447
|
+
if (latest.frozenAt)
|
|
3448
|
+
return published(stored);
|
|
3449
|
+
assertBase(stored, input.baseRevision);
|
|
3450
|
+
const revision = stored.record.revision + 1;
|
|
3451
|
+
const frozen = {
|
|
3452
|
+
...latest,
|
|
3453
|
+
revision,
|
|
3454
|
+
frozenAt: new Date(input.frozenAt),
|
|
3455
|
+
frozenBy: structuredClone(input.frozenBy)
|
|
3456
|
+
};
|
|
3457
|
+
const { document } = stored.record;
|
|
3458
|
+
const next = {
|
|
3459
|
+
...stored,
|
|
3460
|
+
record: {
|
|
3461
|
+
...stored.record,
|
|
3462
|
+
revision,
|
|
3463
|
+
updatedAt: new Date(input.frozenAt),
|
|
3464
|
+
...document?.revision === stored.record.revision ? { document: { ...document, revision } } : {}
|
|
3465
|
+
},
|
|
3466
|
+
versions: [...stored.versions.slice(0, -1), frozen]
|
|
3467
|
+
};
|
|
3468
|
+
this.artifacts.set(key, next);
|
|
3469
|
+
return published(next);
|
|
3470
|
+
}
|
|
3471
|
+
async listRestorePoints(input) {
|
|
3472
|
+
const stored = this.artifacts.get(artifactKey(input.projectId, input.id));
|
|
3473
|
+
return structuredClone([...stored?.restorePoints ?? []]);
|
|
3474
|
+
}
|
|
3475
|
+
async getRestorePoint(input) {
|
|
3476
|
+
const stored = this.artifacts.get(artifactKey(input.projectId, input.artifactId));
|
|
3477
|
+
const point = stored?.restorePoints.find((each) => each.revision === input.revision);
|
|
3478
|
+
return point ? structuredClone(point) : null;
|
|
3479
|
+
}
|
|
3480
|
+
async restoreTo(input) {
|
|
3481
|
+
const key = artifactKey(input.projectId, input.artifactId);
|
|
3482
|
+
const stored = this.artifacts.get(key);
|
|
3483
|
+
if (!stored)
|
|
3484
|
+
throw artifactStorageErrors2.notFound(input.artifactId);
|
|
3485
|
+
const point = stored.restorePoints.find((each) => each.revision === input.revision);
|
|
3486
|
+
if (!point)
|
|
3487
|
+
throw artifactStorageErrors2.restorePointNotFound(input.artifactId, input.revision);
|
|
3488
|
+
assertBase(stored, input.baseRevision);
|
|
3489
|
+
const kept = withRestorePoint(stored, { reason: "restore", createdAt: input.restoredAt });
|
|
3490
|
+
const next = written(kept, {
|
|
3491
|
+
title: point.title,
|
|
3492
|
+
entry: point.entry,
|
|
3493
|
+
files: point.files,
|
|
3494
|
+
outline: point.outline,
|
|
3495
|
+
references: point.references,
|
|
3496
|
+
author: input.author,
|
|
3497
|
+
updatedAt: input.restoredAt
|
|
3498
|
+
}, input.document);
|
|
3499
|
+
this.artifacts.set(key, next);
|
|
3500
|
+
return published(next);
|
|
3501
|
+
}
|
|
3502
|
+
async listTurnWrites(input) {
|
|
3503
|
+
const writes = [];
|
|
3504
|
+
for (const stored of this.artifacts.values()) {
|
|
3505
|
+
if (stored.record.projectId !== input.projectId)
|
|
3506
|
+
continue;
|
|
3507
|
+
const write = stored.turnWrites.get(input.turnRunId);
|
|
3508
|
+
if (write)
|
|
3509
|
+
writes.push(structuredClone(write));
|
|
3510
|
+
}
|
|
3511
|
+
return writes.sort((left, right) => left.artifactId < right.artifactId ? -1 : 1);
|
|
3512
|
+
}
|
|
3513
|
+
async undoTurnWrites(input) {
|
|
3514
|
+
const { turnRunId } = input;
|
|
3515
|
+
const restored = [];
|
|
3516
|
+
const deleted = [];
|
|
3517
|
+
for (const [key, stored] of this.artifacts) {
|
|
3518
|
+
if (stored.record.projectId !== input.projectId)
|
|
3519
|
+
continue;
|
|
3520
|
+
const write = stored.turnWrites.get(turnRunId);
|
|
3521
|
+
if (!write)
|
|
3522
|
+
continue;
|
|
3523
|
+
const revision = stored.record.revision;
|
|
3524
|
+
if (write.created && turnUndoable2({ write, revision }) && !othersCommented2(stored.comments, input)) {
|
|
3525
|
+
this.deleteArtifact(key);
|
|
3526
|
+
deleted.push(stored.record.id);
|
|
3527
|
+
continue;
|
|
3528
|
+
}
|
|
3529
|
+
const point = stored.restorePoints.find((each) => each.turnRunId === turnRunId);
|
|
3530
|
+
const target = point && stored.versions.find((each) => each.version === point.version);
|
|
3531
|
+
const untouched = !write.created && turnUndoable2({
|
|
3532
|
+
write,
|
|
3533
|
+
revision,
|
|
3534
|
+
...point ? { point } : {},
|
|
3535
|
+
...target ? { target: { frozen: target.frozenAt !== undefined } } : {}
|
|
3241
3536
|
});
|
|
3537
|
+
const undone = untouched && point ? undo(stored, point, input.documents?.[stored.record.id]) : null;
|
|
3538
|
+
const next = forgetTurn(undone ?? stored, turnRunId, { undone: undone !== null });
|
|
3539
|
+
this.artifacts.set(key, next);
|
|
3540
|
+
if (undone)
|
|
3541
|
+
restored.push(published(next));
|
|
3242
3542
|
}
|
|
3243
|
-
|
|
3244
|
-
const record = {
|
|
3245
|
-
...stored.record,
|
|
3246
|
-
title: version.title,
|
|
3247
|
-
latestVersion: version.version,
|
|
3248
|
-
updatedAt: new Date(version.createdAt)
|
|
3249
|
-
};
|
|
3250
|
-
this.artifacts.set(key, {
|
|
3251
|
-
record,
|
|
3252
|
-
versions: [...stored.versions, version],
|
|
3253
|
-
nextVersion: stored.nextVersion + 1,
|
|
3254
|
-
threads: sharedIn(stored.threads, version)
|
|
3255
|
-
});
|
|
3256
|
-
return published(record, version);
|
|
3543
|
+
return { restored, deleted };
|
|
3257
3544
|
}
|
|
3258
3545
|
async get(input) {
|
|
3259
3546
|
const stored = this.artifacts.get(artifactKey(input.projectId, input.id));
|
|
@@ -3287,13 +3574,20 @@ class InMemoryArtifactStorage {
|
|
|
3287
3574
|
if (this.artifacts.has(key))
|
|
3288
3575
|
throw artifactStorageErrors2.exists(input.id);
|
|
3289
3576
|
const record = { ...source.record, id: input.id, owner: { ...input.owner } };
|
|
3290
|
-
const versions = source.versions.map(({ origin: _origin, ...version }) =>
|
|
3577
|
+
const versions = source.versions.map(({ origin: _origin, ...version }) => {
|
|
3578
|
+
const copied = structuredClone({ ...version, artifactId: input.id });
|
|
3579
|
+
const outline = input.outlineOf?.(copied);
|
|
3580
|
+
return outline ? { ...copied, outline: structuredClone(outline) } : copied;
|
|
3581
|
+
});
|
|
3291
3582
|
const sharedAt = new Date(input.copiedAt ?? new Date);
|
|
3292
3583
|
this.artifacts.set(key, {
|
|
3293
3584
|
record,
|
|
3294
3585
|
versions,
|
|
3295
3586
|
nextVersion: source.nextVersion,
|
|
3296
|
-
threads: new Map([[input.threadId, { sharedAt, copied: true }]])
|
|
3587
|
+
threads: new Map([[input.threadId, { sharedAt, copied: true }]]),
|
|
3588
|
+
restorePoints: [],
|
|
3589
|
+
turnWrites: new Map,
|
|
3590
|
+
comments: []
|
|
3297
3591
|
});
|
|
3298
3592
|
return structuredClone(record);
|
|
3299
3593
|
}
|
|
@@ -3303,8 +3597,8 @@ class InMemoryArtifactStorage {
|
|
|
3303
3597
|
for (const stored of this.artifacts.values()) {
|
|
3304
3598
|
if (stored.record.projectId !== input.projectId)
|
|
3305
3599
|
continue;
|
|
3306
|
-
const latest =
|
|
3307
|
-
if (latest
|
|
3600
|
+
const latest = latestOf(stored);
|
|
3601
|
+
if (latest.references.some((reference) => refersTo(reference.address, prefix))) {
|
|
3308
3602
|
referencing.push(structuredClone(latest));
|
|
3309
3603
|
}
|
|
3310
3604
|
}
|
|
@@ -3333,14 +3627,14 @@ class InMemoryArtifactStorage {
|
|
|
3333
3627
|
return deleted;
|
|
3334
3628
|
}
|
|
3335
3629
|
async getState(input) {
|
|
3336
|
-
const entry = this.state.get(
|
|
3630
|
+
const entry = this.state.get(stateKey2(input))?.get(input.key);
|
|
3337
3631
|
return entry ? structuredClone(entry) : null;
|
|
3338
3632
|
}
|
|
3339
3633
|
async setState(input) {
|
|
3340
3634
|
if (!this.artifacts.has(artifactKey(input.projectId, input.artifactId))) {
|
|
3341
3635
|
throw artifactStorageErrors2.notFound(input.artifactId);
|
|
3342
3636
|
}
|
|
3343
|
-
const kept = this.state.get(
|
|
3637
|
+
const kept = this.state.get(stateKey2(input)) ?? new Map;
|
|
3344
3638
|
const others = [...kept.values()].filter((entry) => entry.key !== input.key);
|
|
3345
3639
|
const sizeBytes = artifactStateBytes2(input.value);
|
|
3346
3640
|
checkArtifactStateWrite2({
|
|
@@ -3357,61 +3651,120 @@ class InMemoryArtifactStorage {
|
|
|
3357
3651
|
sizeBytes,
|
|
3358
3652
|
updatedAt: new Date(input.updatedAt)
|
|
3359
3653
|
});
|
|
3360
|
-
this.state.set(
|
|
3654
|
+
this.state.set(stateKey2(input), kept);
|
|
3361
3655
|
}
|
|
3362
3656
|
async deleteState(input) {
|
|
3363
|
-
return this.state.get(
|
|
3657
|
+
return this.state.get(stateKey2(input))?.delete(input.key) ?? false;
|
|
3364
3658
|
}
|
|
3365
3659
|
async listState(input) {
|
|
3366
|
-
const kept = [...this.state.get(
|
|
3660
|
+
const kept = [...this.state.get(stateKey2(input))?.values() ?? []];
|
|
3367
3661
|
return structuredClone(kept.sort((left, right) => left.key < right.key ? -1 : 1));
|
|
3368
3662
|
}
|
|
3369
3663
|
async clearState(input) {
|
|
3370
|
-
const count = this.state.get(
|
|
3371
|
-
this.state.delete(
|
|
3664
|
+
const count = this.state.get(stateKey2(input))?.size ?? 0;
|
|
3665
|
+
this.state.delete(stateKey2(input));
|
|
3372
3666
|
return count;
|
|
3373
3667
|
}
|
|
3374
|
-
async
|
|
3375
|
-
|
|
3668
|
+
async listBoardPreviews(input) {
|
|
3669
|
+
const keys = new Set(input.renderKeys);
|
|
3670
|
+
const kept = [...this.boardPreviews.values()].filter((preview) => preview.projectId === input.projectId && keys.has(preview.renderKey));
|
|
3671
|
+
const order = (preview) => `${preview.renderKey}\x00${preview.theme}\x00${preview.size}`;
|
|
3672
|
+
return structuredClone(kept.sort((left, right) => order(left) < order(right) ? -1 : 1));
|
|
3376
3673
|
}
|
|
3377
|
-
async
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
if (
|
|
3381
|
-
continue;
|
|
3382
|
-
const remaining = stored.versions.filter((version) => version.origin?.runId !== input.runId);
|
|
3383
|
-
if (remaining.length === stored.versions.length)
|
|
3384
|
-
continue;
|
|
3385
|
-
deleted += stored.versions.length - remaining.length;
|
|
3386
|
-
const latest = remaining.at(-1);
|
|
3387
|
-
if (!latest) {
|
|
3388
|
-
this.deleteArtifact(key);
|
|
3674
|
+
async putBoardPreviews(input) {
|
|
3675
|
+
for (const preview of input.previews) {
|
|
3676
|
+
const key = `${input.projectId}\x00${preview.renderKey}\x00${preview.theme}\x00${preview.size}`;
|
|
3677
|
+
if (this.boardPreviews.has(key))
|
|
3389
3678
|
continue;
|
|
3679
|
+
this.boardPreviews.set(key, structuredClone({ projectId: input.projectId, ...preview }));
|
|
3680
|
+
}
|
|
3681
|
+
}
|
|
3682
|
+
async createComment(input) {
|
|
3683
|
+
const key = artifactKey(input.projectId, input.artifactId);
|
|
3684
|
+
const stored = this.artifacts.get(key);
|
|
3685
|
+
if (!stored)
|
|
3686
|
+
throw artifactStorageErrors2.notFound(input.artifactId);
|
|
3687
|
+
if (input.parentId !== undefined) {
|
|
3688
|
+
const parent = stored.comments.find((each) => each.id === input.parentId);
|
|
3689
|
+
if (!parent || parent.parentId !== undefined) {
|
|
3690
|
+
throw artifactStorageErrors2.commentNotFound(input.artifactId, input.parentId);
|
|
3390
3691
|
}
|
|
3391
|
-
const threadId = stored.versions.find((version) => version.origin?.runId === input.runId)?.origin?.threadId;
|
|
3392
|
-
const threads = new Map(stored.threads);
|
|
3393
|
-
if (threadId && !threads.get(threadId)?.copied && !remaining.some((version) => version.origin?.threadId === threadId)) {
|
|
3394
|
-
threads.delete(threadId);
|
|
3395
|
-
}
|
|
3396
|
-
this.artifacts.set(key, {
|
|
3397
|
-
...stored,
|
|
3398
|
-
record: {
|
|
3399
|
-
...stored.record,
|
|
3400
|
-
title: latest.title,
|
|
3401
|
-
latestVersion: latest.version,
|
|
3402
|
-
updatedAt: new Date(latest.createdAt)
|
|
3403
|
-
},
|
|
3404
|
-
versions: remaining,
|
|
3405
|
-
threads
|
|
3406
|
-
});
|
|
3407
3692
|
}
|
|
3408
|
-
|
|
3693
|
+
if (stored.comments.length >= ARTIFACT_COMMENT_LIMITS2.maxComments) {
|
|
3694
|
+
throw artifactStorageErrors2.commentsFull(input.artifactId);
|
|
3695
|
+
}
|
|
3696
|
+
const guests = stored.comments.filter((each) => each.author.type === "guest").length;
|
|
3697
|
+
if (input.author.type === "guest" && guests >= ARTIFACT_COMMENT_LIMITS2.maxGuestComments) {
|
|
3698
|
+
throw artifactStorageErrors2.guestCommentsFull(input.artifactId);
|
|
3699
|
+
}
|
|
3700
|
+
const comment = structuredClone({
|
|
3701
|
+
projectId: input.projectId,
|
|
3702
|
+
artifactId: input.artifactId,
|
|
3703
|
+
id: input.id,
|
|
3704
|
+
...input.parentId === undefined ? {} : { parentId: input.parentId },
|
|
3705
|
+
anchor: {
|
|
3706
|
+
...input.anchor.board === undefined ? {} : { board: input.anchor.board },
|
|
3707
|
+
...input.anchor.element === undefined ? {} : { element: input.anchor.element },
|
|
3708
|
+
...input.anchor.label === undefined ? {} : { label: input.anchor.label },
|
|
3709
|
+
...input.anchor.point === undefined ? {} : { point: { x: input.anchor.point.x, y: input.anchor.point.y } },
|
|
3710
|
+
revision: input.anchor.revision
|
|
3711
|
+
},
|
|
3712
|
+
body: input.body,
|
|
3713
|
+
author: input.author.type === "guest" ? { type: "guest", id: input.author.id, name: input.author.name } : { type: input.author.type, id: input.author.id },
|
|
3714
|
+
...input.origin ? { origin: { threadId: input.origin.threadId, runId: input.origin.runId } } : {},
|
|
3715
|
+
createdAt: input.createdAt
|
|
3716
|
+
});
|
|
3717
|
+
this.artifacts.set(key, { ...stored, comments: [...stored.comments, comment] });
|
|
3718
|
+
return structuredClone(comment);
|
|
3719
|
+
}
|
|
3720
|
+
async getComment(input) {
|
|
3721
|
+
const stored = this.artifacts.get(artifactKey(input.projectId, input.artifactId));
|
|
3722
|
+
const comment = stored?.comments.find((each) => each.id === input.id);
|
|
3723
|
+
return comment ? structuredClone(comment) : null;
|
|
3724
|
+
}
|
|
3725
|
+
async listComments(input) {
|
|
3726
|
+
const stored = this.artifacts.get(artifactKey(input.projectId, input.id));
|
|
3727
|
+
const ordered = [...stored?.comments ?? []].sort((left, right) => left.createdAt.getTime() - right.createdAt.getTime());
|
|
3728
|
+
return structuredClone(ordered);
|
|
3729
|
+
}
|
|
3730
|
+
async resolveComment(input) {
|
|
3731
|
+
const key = artifactKey(input.projectId, input.artifactId);
|
|
3732
|
+
const stored = this.artifacts.get(key);
|
|
3733
|
+
const comment = stored?.comments.find((each) => each.id === input.id);
|
|
3734
|
+
if (!stored || !comment)
|
|
3735
|
+
return null;
|
|
3736
|
+
const { resolvedAt: _at, resolvedBy: _by, ...open } = comment;
|
|
3737
|
+
const next = input.resolved ? {
|
|
3738
|
+
...open,
|
|
3739
|
+
resolvedAt: new Date(input.resolved.at),
|
|
3740
|
+
resolvedBy: structuredClone(input.resolved.by)
|
|
3741
|
+
} : open;
|
|
3742
|
+
this.artifacts.set(key, {
|
|
3743
|
+
...stored,
|
|
3744
|
+
comments: stored.comments.map((each) => each.id === input.id ? next : each)
|
|
3745
|
+
});
|
|
3746
|
+
return structuredClone(next);
|
|
3747
|
+
}
|
|
3748
|
+
async deleteComment(input) {
|
|
3749
|
+
const key = artifactKey(input.projectId, input.artifactId);
|
|
3750
|
+
const stored = this.artifacts.get(key);
|
|
3751
|
+
if (!stored?.comments.some((each) => each.id === input.id))
|
|
3752
|
+
return false;
|
|
3753
|
+
this.artifacts.set(key, {
|
|
3754
|
+
...stored,
|
|
3755
|
+
comments: stored.comments.filter((each) => each.id !== input.id && each.parentId !== input.id)
|
|
3756
|
+
});
|
|
3757
|
+
return true;
|
|
3758
|
+
}
|
|
3759
|
+
async delete(input) {
|
|
3760
|
+
return this.deleteArtifact(artifactKey(input.projectId, input.id));
|
|
3409
3761
|
}
|
|
3410
3762
|
snapshot() {
|
|
3411
3763
|
return structuredClone({
|
|
3412
3764
|
artifacts: this.artifacts,
|
|
3413
3765
|
frameGrants: this.frameGrants,
|
|
3414
|
-
state: this.state
|
|
3766
|
+
state: this.state,
|
|
3767
|
+
boardPreviews: this.boardPreviews
|
|
3415
3768
|
});
|
|
3416
3769
|
}
|
|
3417
3770
|
restore(snapshot) {
|
|
@@ -3419,6 +3772,7 @@ class InMemoryArtifactStorage {
|
|
|
3419
3772
|
this.artifacts = new Map(restored.artifacts);
|
|
3420
3773
|
this.frameGrants = new Map(restored.frameGrants);
|
|
3421
3774
|
this.state = new Map([...restored.state].map(([key, kept]) => [key, new Map(kept)]));
|
|
3775
|
+
this.boardPreviews = new Map(restored.boardPreviews);
|
|
3422
3776
|
}
|
|
3423
3777
|
deleteArtifact(key) {
|
|
3424
3778
|
for (const [grantKey, grant] of this.frameGrants) {
|
|
@@ -3432,22 +3786,170 @@ class InMemoryArtifactStorage {
|
|
|
3432
3786
|
return this.artifacts.delete(key);
|
|
3433
3787
|
}
|
|
3434
3788
|
}
|
|
3435
|
-
function
|
|
3436
|
-
|
|
3789
|
+
function latestOf(stored) {
|
|
3790
|
+
const latest = stored.versions.at(-1);
|
|
3791
|
+
if (!latest)
|
|
3792
|
+
throw new Error(`[Sixb] Artifact '${stored.record.id}' has no version.`);
|
|
3793
|
+
return latest;
|
|
3794
|
+
}
|
|
3795
|
+
function assertBase(stored, baseRevision) {
|
|
3796
|
+
if (baseRevision === undefined || baseRevision === stored.record.revision)
|
|
3797
|
+
return;
|
|
3798
|
+
const latest = latestOf(stored);
|
|
3799
|
+
throw artifactStorageErrors2.moved(stored.record.id, baseRevision, {
|
|
3800
|
+
version: latest.version,
|
|
3801
|
+
revision: latest.revision,
|
|
3802
|
+
author: structuredClone(latest.author),
|
|
3803
|
+
...latest.frozenBy ? { frozenBy: structuredClone(latest.frozenBy) } : {}
|
|
3804
|
+
});
|
|
3805
|
+
}
|
|
3806
|
+
function versionRecord(projectId, artifactId, input) {
|
|
3807
|
+
const { content } = input;
|
|
3808
|
+
return structuredClone({
|
|
3809
|
+
projectId,
|
|
3810
|
+
artifactId,
|
|
3811
|
+
version: input.version,
|
|
3812
|
+
revision: input.revision,
|
|
3813
|
+
title: content.title,
|
|
3814
|
+
entry: content.entry,
|
|
3815
|
+
files: content.files,
|
|
3816
|
+
outline: content.outline,
|
|
3817
|
+
references: content.references,
|
|
3818
|
+
author: content.author,
|
|
3819
|
+
...content.origin ? { origin: content.origin } : {},
|
|
3820
|
+
createdAt: input.createdAt,
|
|
3821
|
+
updatedAt: content.updatedAt
|
|
3822
|
+
});
|
|
3823
|
+
}
|
|
3824
|
+
function written(stored, content, document) {
|
|
3825
|
+
const { record } = stored;
|
|
3826
|
+
const latest = latestOf(stored);
|
|
3827
|
+
const revision = record.revision + 1;
|
|
3828
|
+
const opens = latest.frozenAt !== undefined;
|
|
3829
|
+
const version = versionRecord(record.projectId, record.id, {
|
|
3830
|
+
version: opens ? stored.nextVersion : latest.version,
|
|
3831
|
+
revision,
|
|
3832
|
+
content,
|
|
3833
|
+
createdAt: opens ? content.updatedAt : latest.createdAt
|
|
3834
|
+
});
|
|
3835
|
+
return {
|
|
3836
|
+
...stored,
|
|
3837
|
+
record: {
|
|
3838
|
+
...record,
|
|
3839
|
+
title: version.title,
|
|
3840
|
+
latestVersion: version.version,
|
|
3841
|
+
revision,
|
|
3842
|
+
updatedAt: new Date(content.updatedAt),
|
|
3843
|
+
...document ? { document: { file: structuredClone(document), revision } } : {}
|
|
3844
|
+
},
|
|
3845
|
+
versions: opens ? [...stored.versions, version] : [...stored.versions.slice(0, -1), version],
|
|
3846
|
+
nextVersion: opens ? stored.nextVersion + 1 : stored.nextVersion
|
|
3847
|
+
};
|
|
3848
|
+
}
|
|
3849
|
+
function withRestorePoint(stored, input) {
|
|
3850
|
+
const {
|
|
3851
|
+
projectId,
|
|
3852
|
+
artifactId,
|
|
3853
|
+
version,
|
|
3854
|
+
revision,
|
|
3855
|
+
frozenAt,
|
|
3856
|
+
frozenBy: _frozenBy,
|
|
3857
|
+
createdAt: _,
|
|
3858
|
+
...content
|
|
3859
|
+
} = latestOf(stored);
|
|
3860
|
+
const point = structuredClone({
|
|
3861
|
+
projectId,
|
|
3862
|
+
artifactId,
|
|
3863
|
+
revision,
|
|
3864
|
+
version,
|
|
3865
|
+
frozen: frozenAt !== undefined,
|
|
3866
|
+
...content,
|
|
3867
|
+
reason: input.reason,
|
|
3868
|
+
...input.turnRunId === undefined ? {} : { turnRunId: input.turnRunId },
|
|
3869
|
+
createdAt: input.createdAt
|
|
3870
|
+
});
|
|
3871
|
+
return {
|
|
3872
|
+
...stored,
|
|
3873
|
+
restorePoints: [point, ...stored.restorePoints].slice(0, ARTIFACT_RESTORE_POINTS2)
|
|
3874
|
+
};
|
|
3437
3875
|
}
|
|
3438
|
-
function
|
|
3439
|
-
const
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3876
|
+
function undo(stored, point, document) {
|
|
3877
|
+
const versions = stored.versions.filter((version) => version.version <= point.version);
|
|
3878
|
+
const target = versions.at(-1);
|
|
3879
|
+
if (target?.version !== point.version)
|
|
3880
|
+
return null;
|
|
3881
|
+
const revision = stored.record.revision + 1;
|
|
3882
|
+
const version = point.frozen ? { ...target, revision } : versionRecord(target.projectId, target.artifactId, {
|
|
3883
|
+
version: target.version,
|
|
3884
|
+
revision,
|
|
3885
|
+
content: {
|
|
3886
|
+
title: point.title,
|
|
3887
|
+
entry: point.entry,
|
|
3888
|
+
files: point.files,
|
|
3889
|
+
outline: point.outline,
|
|
3890
|
+
references: point.references,
|
|
3891
|
+
author: point.author,
|
|
3892
|
+
...point.origin ? { origin: point.origin } : {},
|
|
3893
|
+
updatedAt: point.updatedAt
|
|
3894
|
+
},
|
|
3895
|
+
createdAt: target.createdAt
|
|
3896
|
+
});
|
|
3897
|
+
const { record } = stored;
|
|
3898
|
+
return {
|
|
3899
|
+
...stored,
|
|
3900
|
+
record: {
|
|
3901
|
+
...record,
|
|
3902
|
+
title: version.title,
|
|
3903
|
+
latestVersion: version.version,
|
|
3904
|
+
revision,
|
|
3905
|
+
updatedAt: new Date(Math.max(point.updatedAt.getTime(), target.frozenAt?.getTime() ?? 0)),
|
|
3906
|
+
...document ? { document: { file: structuredClone(document), revision } } : {}
|
|
3907
|
+
},
|
|
3908
|
+
versions: [...versions.slice(0, -1), version]
|
|
3909
|
+
};
|
|
3443
3910
|
}
|
|
3444
|
-
function
|
|
3445
|
-
|
|
3911
|
+
function forgetTurn(stored, turnRunId, { undone }) {
|
|
3912
|
+
const turnWrites = new Map(stored.turnWrites);
|
|
3913
|
+
turnWrites.delete(turnRunId);
|
|
3914
|
+
return {
|
|
3915
|
+
...stored,
|
|
3916
|
+
restorePoints: undone ? stored.restorePoints.filter((point) => point.turnRunId !== turnRunId) : stored.restorePoints,
|
|
3917
|
+
turnWrites,
|
|
3918
|
+
threads: undone ? new Map([...stored.threads].filter(([, link]) => link.copied || link.linkedByRunId !== turnRunId)) : stored.threads
|
|
3919
|
+
};
|
|
3920
|
+
}
|
|
3921
|
+
function sharedIn(stored, content, turnRunId) {
|
|
3922
|
+
const threadId = content.origin?.threadId;
|
|
3923
|
+
if (!threadId || stored.threads.has(threadId))
|
|
3924
|
+
return stored;
|
|
3925
|
+
const link = {
|
|
3926
|
+
sharedAt: new Date(content.updatedAt),
|
|
3927
|
+
copied: false,
|
|
3928
|
+
...turnRunId === undefined ? {} : { linkedByRunId: turnRunId }
|
|
3929
|
+
};
|
|
3930
|
+
return { ...stored, threads: new Map(stored.threads).set(threadId, link) };
|
|
3931
|
+
}
|
|
3932
|
+
function turnWrote(stored, turnRunId, { created }) {
|
|
3933
|
+
if (turnRunId === undefined)
|
|
3934
|
+
return stored;
|
|
3935
|
+
const earlier = stored.turnWrites.get(turnRunId);
|
|
3936
|
+
const write = {
|
|
3937
|
+
artifactId: stored.record.id,
|
|
3938
|
+
created: earlier?.created ?? created,
|
|
3939
|
+
revision: stored.record.revision,
|
|
3940
|
+
writes: (earlier?.writes ?? 0) + 1
|
|
3941
|
+
};
|
|
3942
|
+
const others = [...stored.turnWrites].filter(([turn]) => turn !== turnRunId);
|
|
3943
|
+
const kept = [[turnRunId, write], ...others].sort(([, left], [, right]) => right.revision - left.revision).slice(0, ARTIFACT_RESTORE_POINTS2);
|
|
3944
|
+
return { ...stored, turnWrites: new Map(kept) };
|
|
3945
|
+
}
|
|
3946
|
+
function published(stored) {
|
|
3947
|
+
return structuredClone({ artifact: stored.record, version: latestOf(stored) });
|
|
3446
3948
|
}
|
|
3447
3949
|
function artifactKey(projectId, id) {
|
|
3448
3950
|
return `${projectId}\x00${id}`;
|
|
3449
3951
|
}
|
|
3450
|
-
function
|
|
3952
|
+
function stateKey2(scope) {
|
|
3451
3953
|
return `${artifactKey(scope.projectId, scope.artifactId)}\x00${scope.principal.type}\x00${scope.principal.id}`;
|
|
3452
3954
|
}
|
|
3453
3955
|
function refersTo(address, prefix) {
|
|
@@ -3588,6 +4090,40 @@ class InMemoryFileDownloadGrantStorage {
|
|
|
3588
4090
|
function rowKey(projectId, id) {
|
|
3589
4091
|
return `${projectId}\x00${id}`;
|
|
3590
4092
|
}
|
|
4093
|
+
// src/storage/lake-retention-runs/in-memory.ts
|
|
4094
|
+
class InMemoryLakeRetentionRunStorage {
|
|
4095
|
+
rows = new Map;
|
|
4096
|
+
async record(run) {
|
|
4097
|
+
this.rows.set(run.projectId, structuredClone(run));
|
|
4098
|
+
}
|
|
4099
|
+
async getLast(input) {
|
|
4100
|
+
const row = this.rows.get(input.projectId);
|
|
4101
|
+
return row ? structuredClone(row) : null;
|
|
4102
|
+
}
|
|
4103
|
+
snapshot() {
|
|
4104
|
+
return structuredClone(this.rows);
|
|
4105
|
+
}
|
|
4106
|
+
restore(snapshot) {
|
|
4107
|
+
this.rows = structuredClone(new Map(snapshot));
|
|
4108
|
+
}
|
|
4109
|
+
}
|
|
4110
|
+
// src/storage/maintenance-heartbeats/in-memory.ts
|
|
4111
|
+
class InMemoryMaintenanceHeartbeatStorage {
|
|
4112
|
+
rows = new Map;
|
|
4113
|
+
async record(heartbeat) {
|
|
4114
|
+
this.rows.set(`${heartbeat.projectId}\x00${heartbeat.owner}`, structuredClone(heartbeat));
|
|
4115
|
+
}
|
|
4116
|
+
async list(input) {
|
|
4117
|
+
const rows = [...this.rows.values()].filter((row) => row.projectId === input.projectId);
|
|
4118
|
+
return structuredClone(rows);
|
|
4119
|
+
}
|
|
4120
|
+
snapshot() {
|
|
4121
|
+
return structuredClone(this.rows);
|
|
4122
|
+
}
|
|
4123
|
+
restore(snapshot) {
|
|
4124
|
+
this.rows = structuredClone(new Map(snapshot));
|
|
4125
|
+
}
|
|
4126
|
+
}
|
|
3591
4127
|
// src/storage/objects/keys.ts
|
|
3592
4128
|
function objectBatchKey2(objectTypeId, primaryId) {
|
|
3593
4129
|
return JSON.stringify([objectTypeId, primaryId]);
|
|
@@ -3633,6 +4169,7 @@ function compareQueryScalarValues(left, right, scalarKind) {
|
|
|
3633
4169
|
case "timestamp":
|
|
3634
4170
|
return compareTemporalValues(left, right);
|
|
3635
4171
|
case "userRef":
|
|
4172
|
+
case "artifactRef":
|
|
3636
4173
|
return Number.NaN;
|
|
3637
4174
|
}
|
|
3638
4175
|
}
|
|
@@ -3645,13 +4182,13 @@ function queryScalarValuesEqual(left, right, scalarKind) {
|
|
|
3645
4182
|
const comparison = compareTemporalValues(left, right);
|
|
3646
4183
|
return !Number.isNaN(comparison) && comparison === 0;
|
|
3647
4184
|
}
|
|
3648
|
-
if (scalarKind === "userRef")
|
|
3649
|
-
return
|
|
4185
|
+
if (scalarKind === "userRef" || scalarKind === "artifactRef")
|
|
4186
|
+
return refsEqual(left, right);
|
|
3650
4187
|
if (scalarKind !== undefined)
|
|
3651
4188
|
return Object.is(left, right);
|
|
3652
4189
|
return runtimeValuesEqual(left, right);
|
|
3653
4190
|
}
|
|
3654
|
-
function
|
|
4191
|
+
function refsEqual(left, right) {
|
|
3655
4192
|
if (left === null || right === null)
|
|
3656
4193
|
return left === right;
|
|
3657
4194
|
return isRecord(left) && isRecord(right) && left.type === right.type && typeof left.id === "string" && left.id === right.id;
|
|
@@ -3862,7 +4399,8 @@ var IN_MEMORY_OBJECT_QUERY_CAPABILITIES = {
|
|
|
3862
4399
|
decimal: { equality: true, ordering: true },
|
|
3863
4400
|
date: { equality: true, ordering: true },
|
|
3864
4401
|
timestamp: { equality: true, ordering: true },
|
|
3865
|
-
userRef: { equality: true }
|
|
4402
|
+
userRef: { equality: true },
|
|
4403
|
+
artifactRef: { equality: true }
|
|
3866
4404
|
},
|
|
3867
4405
|
limits: {
|
|
3868
4406
|
totalCount: true,
|
|
@@ -4660,6 +5198,7 @@ class InMemoryObjectStorage {
|
|
|
4660
5198
|
links = new Map;
|
|
4661
5199
|
uniqueValues = new Map;
|
|
4662
5200
|
uniqueProperties = new Map;
|
|
5201
|
+
artifactHolders = new Map;
|
|
4663
5202
|
vectorReader;
|
|
4664
5203
|
constructor() {
|
|
4665
5204
|
materializerAdapters.set(this, {
|
|
@@ -4710,6 +5249,20 @@ class InMemoryObjectStorage {
|
|
|
4710
5249
|
},
|
|
4711
5250
|
markUniquePropertyPrepared: (input) => {
|
|
4712
5251
|
this.uniqueProperties.set(uniquePropertyKey(input.projectId, input.objectTypeId, input.propertyId), { ...input });
|
|
5252
|
+
},
|
|
5253
|
+
deleteArtifactHolder: (projectId, value) => {
|
|
5254
|
+
const key = artifactHoldersKey(projectId, value.artifactId);
|
|
5255
|
+
const holders = this.artifactHolders.get(key);
|
|
5256
|
+
holders?.delete(artifactHolderKey(value));
|
|
5257
|
+
if (holders?.size === 0)
|
|
5258
|
+
this.artifactHolders.delete(key);
|
|
5259
|
+
},
|
|
5260
|
+
insertArtifactHolder: (projectId, value) => {
|
|
5261
|
+
const key = artifactHoldersKey(projectId, value.artifactId);
|
|
5262
|
+
const holders = this.artifactHolders.get(key) ?? new Map;
|
|
5263
|
+
this.artifactHolders.set(key, holders);
|
|
5264
|
+
const { objectTypeId, primaryId, propertyId } = value;
|
|
5265
|
+
holders.set(artifactHolderKey(value), { objectTypeId, primaryId, propertyId });
|
|
4713
5266
|
}
|
|
4714
5267
|
});
|
|
4715
5268
|
}
|
|
@@ -4718,7 +5271,8 @@ class InMemoryObjectStorage {
|
|
|
4718
5271
|
rows: cloneObjectBuckets(this.rows),
|
|
4719
5272
|
links: cloneLinkBuckets(this.links),
|
|
4720
5273
|
uniqueValues: cloneUniqueValues(this.uniqueValues),
|
|
4721
|
-
uniqueProperties: new Map(this.uniqueProperties)
|
|
5274
|
+
uniqueProperties: new Map(this.uniqueProperties),
|
|
5275
|
+
artifactHolders: cloneArtifactHolders(this.artifactHolders)
|
|
4722
5276
|
};
|
|
4723
5277
|
}
|
|
4724
5278
|
restore(snapshot) {
|
|
@@ -4738,6 +5292,10 @@ class InMemoryObjectStorage {
|
|
|
4738
5292
|
for (const [key, prepared] of snapshot.uniqueProperties) {
|
|
4739
5293
|
this.uniqueProperties.set(key, prepared);
|
|
4740
5294
|
}
|
|
5295
|
+
this.artifactHolders.clear();
|
|
5296
|
+
for (const [key, holders] of cloneArtifactHolders(snapshot.artifactHolders)) {
|
|
5297
|
+
this.artifactHolders.set(key, holders);
|
|
5298
|
+
}
|
|
4741
5299
|
}
|
|
4742
5300
|
uniqueHolder(projectId, value) {
|
|
4743
5301
|
return this.uniqueValues.get(uniquePropertyKey(projectId, value.objectTypeId, value.propertyId))?.get(value.valueKey);
|
|
@@ -4968,6 +5526,19 @@ class InMemoryObjectStorage {
|
|
|
4968
5526
|
...hasMore && last ? { nextPrimaryId: last.primaryId } : {}
|
|
4969
5527
|
};
|
|
4970
5528
|
}
|
|
5529
|
+
async listArtifactHolders(params) {
|
|
5530
|
+
assertArtifactHolderPageLimit(params.limit);
|
|
5531
|
+
const { after } = params;
|
|
5532
|
+
const holders = [
|
|
5533
|
+
...this.artifactHolders.get(artifactHoldersKey(params.projectId, params.artifactId))?.values() ?? []
|
|
5534
|
+
].filter((holder) => !after || compareArtifactHolders(holder, after) > 0).sort(compareArtifactHolders).slice(0, params.limit + 1);
|
|
5535
|
+
const page = holders.slice(0, params.limit).map((holder) => ({ ...holder }));
|
|
5536
|
+
const last = page.at(-1);
|
|
5537
|
+
return {
|
|
5538
|
+
holders: page,
|
|
5539
|
+
...holders.length > params.limit && last ? { next: { ...last } } : {}
|
|
5540
|
+
};
|
|
5541
|
+
}
|
|
4971
5542
|
async list(params) {
|
|
4972
5543
|
let allRows = [];
|
|
4973
5544
|
if (params.objectTypeId) {
|
|
@@ -5046,6 +5617,23 @@ function cloneObjectBuckets(rows) {
|
|
|
5046
5617
|
function uniquePropertyKey(projectId, objectTypeId, propertyId) {
|
|
5047
5618
|
return JSON.stringify([projectId, objectTypeId, propertyId]);
|
|
5048
5619
|
}
|
|
5620
|
+
function artifactHoldersKey(projectId, artifactId) {
|
|
5621
|
+
return JSON.stringify([projectId, artifactId]);
|
|
5622
|
+
}
|
|
5623
|
+
function artifactHolderKey(holder) {
|
|
5624
|
+
return JSON.stringify([holder.objectTypeId, holder.primaryId, holder.propertyId]);
|
|
5625
|
+
}
|
|
5626
|
+
function compareArtifactHolders(left, right) {
|
|
5627
|
+
return compareStrings3(left.objectTypeId, right.objectTypeId) || compareStrings3(left.primaryId, right.primaryId) || compareStrings3(left.propertyId, right.propertyId);
|
|
5628
|
+
}
|
|
5629
|
+
function assertArtifactHolderPageLimit(limit) {
|
|
5630
|
+
if (!Number.isSafeInteger(limit) || limit <= 0) {
|
|
5631
|
+
throw new Error("Artifact holder page limit must be a positive safe integer.");
|
|
5632
|
+
}
|
|
5633
|
+
}
|
|
5634
|
+
function cloneArtifactHolders(holders) {
|
|
5635
|
+
return new Map([...holders].map(([key, rows]) => [key, new Map(rows)]));
|
|
5636
|
+
}
|
|
5049
5637
|
function cloneUniqueValues(values) {
|
|
5050
5638
|
return new Map([...values].map(([key, holders]) => [key, new Map(holders)]));
|
|
5051
5639
|
}
|
|
@@ -5840,6 +6428,8 @@ function touchPlanItem(touches, item) {
|
|
|
5840
6428
|
return;
|
|
5841
6429
|
case "unique-value-release":
|
|
5842
6430
|
case "unique-value-claim":
|
|
6431
|
+
case "artifact-holder-delete":
|
|
6432
|
+
case "artifact-holder-insert":
|
|
5843
6433
|
return;
|
|
5844
6434
|
}
|
|
5845
6435
|
}
|
|
@@ -6668,6 +7258,14 @@ class InMemoryOntologyMaterializationStorage {
|
|
|
6668
7258
|
write("unique.claim", () => {
|
|
6669
7259
|
getInMemoryObjectMaterializerAdapter(this.objects).claimUniqueValue(projectId, item);
|
|
6670
7260
|
});
|
|
7261
|
+
for (const item of chunk.artifactHolders.deletes)
|
|
7262
|
+
write("artifact-holder.delete", () => {
|
|
7263
|
+
getInMemoryObjectMaterializerAdapter(this.objects).deleteArtifactHolder(projectId, item);
|
|
7264
|
+
});
|
|
7265
|
+
for (const item of chunk.artifactHolders.inserts)
|
|
7266
|
+
write("artifact-holder.insert", () => {
|
|
7267
|
+
getInMemoryObjectMaterializerAdapter(this.objects).insertArtifactHolder(projectId, item);
|
|
7268
|
+
});
|
|
6671
7269
|
for (const item of chunk.timeseries.pointUpserts)
|
|
6672
7270
|
write("timeseries.point.upsert", () => {
|
|
6673
7271
|
this.assertPoint(item.expected, projectId);
|
|
@@ -7925,6 +8523,8 @@ class InMemoryPipelineRunStorage2 {
|
|
|
7925
8523
|
const next = {
|
|
7926
8524
|
...existing,
|
|
7927
8525
|
status: "queued",
|
|
8526
|
+
attempt: 0,
|
|
8527
|
+
execution: undefined,
|
|
7928
8528
|
queuedAt,
|
|
7929
8529
|
startedAt: undefined,
|
|
7930
8530
|
finishedAt: undefined,
|
|
@@ -7940,37 +8540,65 @@ class InMemoryPipelineRunStorage2 {
|
|
|
7940
8540
|
executionId: input.executionId,
|
|
7941
8541
|
pipelineId: input.pipelineId,
|
|
7942
8542
|
status: "queued",
|
|
8543
|
+
attempt: 0,
|
|
7943
8544
|
queuedAt
|
|
7944
8545
|
};
|
|
7945
8546
|
this.runs.set(key, cloneRecord(record));
|
|
7946
8547
|
return cloneRecord(record);
|
|
7947
8548
|
}
|
|
7948
|
-
async
|
|
7949
|
-
const
|
|
7950
|
-
const
|
|
7951
|
-
if (!
|
|
7952
|
-
|
|
7953
|
-
}
|
|
7954
|
-
|
|
7955
|
-
throw new PipelineRunError2(`[Sixb] Pipeline run '${input.id}' cannot start from status '${existing.status}'.`);
|
|
7956
|
-
}
|
|
7957
|
-
const next = {
|
|
8549
|
+
async startOrReclaim(input) {
|
|
8550
|
+
const existing = this.requireExistingPipelineRun(input.projectId, input.id);
|
|
8551
|
+
const plan = planRunClaim2(cloneRecord(existing), input);
|
|
8552
|
+
if (!plan.take)
|
|
8553
|
+
return plan.claim;
|
|
8554
|
+
const { outcome, startedAt, attempt, execution } = plan;
|
|
8555
|
+
const run = this.writeRun({
|
|
7958
8556
|
...existing,
|
|
7959
8557
|
status: "running",
|
|
7960
|
-
startedAt
|
|
8558
|
+
startedAt,
|
|
8559
|
+
attempt,
|
|
8560
|
+
execution,
|
|
7961
8561
|
error: undefined
|
|
7962
|
-
};
|
|
7963
|
-
|
|
7964
|
-
|
|
8562
|
+
});
|
|
8563
|
+
return { outcome, run };
|
|
8564
|
+
}
|
|
8565
|
+
async confirmExecutionOwnership(input) {
|
|
8566
|
+
const existing = this.requireHeldPipelineRun(input.projectId, input.id, input.executionToken);
|
|
8567
|
+
return this.writeRun({
|
|
8568
|
+
...existing,
|
|
8569
|
+
execution: {
|
|
8570
|
+
token: input.executionToken,
|
|
8571
|
+
queueLeaseExpiresAt: laterLease2(existing.execution?.queueLeaseExpiresAt, input.queueLeaseExpiresAt)
|
|
8572
|
+
}
|
|
8573
|
+
});
|
|
8574
|
+
}
|
|
8575
|
+
async listLost(input) {
|
|
8576
|
+
return selectLostRuns(this.runs.values(), input).map((run) => cloneRecord(run));
|
|
8577
|
+
}
|
|
8578
|
+
async releaseExecution(input) {
|
|
8579
|
+
const existing = this.runs.get(storageKey(input.projectId, input.id));
|
|
8580
|
+
if (existing?.status !== "running" || existing.execution?.token !== input.executionToken)
|
|
8581
|
+
return;
|
|
8582
|
+
this.writeRun({
|
|
8583
|
+
...existing,
|
|
8584
|
+
execution: {
|
|
8585
|
+
token: input.executionToken,
|
|
8586
|
+
queueLeaseExpiresAt: new Date(input.releasedAt ?? new Date)
|
|
8587
|
+
},
|
|
8588
|
+
attempt: input.spentAttempt ? existing.attempt : existing.attempt - 1
|
|
8589
|
+
});
|
|
7965
8590
|
}
|
|
7966
8591
|
async finish(input) {
|
|
7967
8592
|
const existing = this.requireExistingPipelineRun(input.projectId, input.id);
|
|
7968
8593
|
if (!canFinishPipelineRun2(existing.status, input)) {
|
|
7969
8594
|
throw new PipelineRunError2(`[Sixb] Pipeline run '${input.id}' cannot finish from status '${existing.status}'.`);
|
|
7970
8595
|
}
|
|
8596
|
+
if (!mayFinishRun2(existing, input))
|
|
8597
|
+
throw staleExecution(input.id);
|
|
7971
8598
|
const base = {
|
|
7972
8599
|
...existing,
|
|
7973
8600
|
status: input.status,
|
|
8601
|
+
execution: undefined,
|
|
7974
8602
|
finishedAt: new Date(input.finishedAt ?? new Date)
|
|
7975
8603
|
};
|
|
7976
8604
|
const next = input.status === "succeeded" ? {
|
|
@@ -7982,16 +8610,18 @@ class InMemoryPipelineRunStorage2 {
|
|
|
7982
8610
|
output: undefined,
|
|
7983
8611
|
error: normalizeError(input.error)
|
|
7984
8612
|
};
|
|
7985
|
-
this.
|
|
7986
|
-
return cloneRecord(next);
|
|
8613
|
+
return this.writeRun(next);
|
|
7987
8614
|
}
|
|
7988
8615
|
async startStep(input) {
|
|
7989
8616
|
const pipelineRun = this.requireRunningPipelineRun(input.projectId, input.pipelineRunId);
|
|
8617
|
+
if (!holdsRun2(pipelineRun, input.executionToken))
|
|
8618
|
+
throw staleExecution(input.pipelineRunId);
|
|
7990
8619
|
if (pipelineRun.pipelineId !== input.pipelineId) {
|
|
7991
8620
|
throw new PipelineRunError2(`[Sixb] Pipeline step run '${input.id}' pipeline '${input.pipelineId}' does not match pipeline run '${input.pipelineRunId}' pipeline '${pipelineRun.pipelineId}'.`);
|
|
7992
8621
|
}
|
|
7993
8622
|
const key = storageKey(input.projectId, input.id);
|
|
7994
|
-
|
|
8623
|
+
const earlier = this.steps.get(key);
|
|
8624
|
+
if (earlier && earlier.status !== "running") {
|
|
7995
8625
|
throw new PipelineRunError2(`[Sixb] Pipeline step run '${input.id}' already exists for project '${input.projectId}'.`);
|
|
7996
8626
|
}
|
|
7997
8627
|
const record = {
|
|
@@ -8003,7 +8633,7 @@ class InMemoryPipelineRunStorage2 {
|
|
|
8003
8633
|
datasetId: input.datasetId,
|
|
8004
8634
|
mode: input.mode,
|
|
8005
8635
|
status: "running",
|
|
8006
|
-
startedAt: new Date(input.startedAt ?? new Date),
|
|
8636
|
+
startedAt: earlier?.startedAt ?? new Date(input.startedAt ?? new Date),
|
|
8007
8637
|
inputs: cloneRecord(input.inputs)
|
|
8008
8638
|
};
|
|
8009
8639
|
this.steps.set(key, cloneRecord(record));
|
|
@@ -8012,6 +8642,10 @@ class InMemoryPipelineRunStorage2 {
|
|
|
8012
8642
|
async finishStep(input) {
|
|
8013
8643
|
assertNonNegativeInteger(input.rowsWritten, "rowsWritten");
|
|
8014
8644
|
const existing = this.requireRunningStepRun(input.projectId, input.id);
|
|
8645
|
+
const pipelineRun = this.requireExistingPipelineRun(input.projectId, existing.pipelineRunId);
|
|
8646
|
+
if (!holdsRun2(pipelineRun, input.executionToken)) {
|
|
8647
|
+
throw staleExecution(existing.pipelineRunId);
|
|
8648
|
+
}
|
|
8015
8649
|
if (input.status === "succeeded" && input.output.datasetId !== existing.datasetId) {
|
|
8016
8650
|
throw new PipelineRunError2(`[Sixb] Pipeline step run '${input.id}' output dataset '${input.output.datasetId}' does not match '${existing.datasetId}'.`);
|
|
8017
8651
|
}
|
|
@@ -8061,7 +8695,7 @@ class InMemoryPipelineRunStorage2 {
|
|
|
8061
8695
|
};
|
|
8062
8696
|
}
|
|
8063
8697
|
async listLatestByPipelineIds(input) {
|
|
8064
|
-
const runs = latestStartedAtByOwnerId([...this.runs.values()].filter((record) => record.projectId === input.projectId), input.pipelineIds, (record) => record.pipelineId);
|
|
8698
|
+
const runs = latestStartedAtByOwnerId([...this.runs.values()].filter((record) => record.projectId === input.projectId && record.status !== input.excludedStatus), input.pipelineIds, (record) => record.pipelineId);
|
|
8065
8699
|
return {
|
|
8066
8700
|
runs: runs.map(cloneRecord)
|
|
8067
8701
|
};
|
|
@@ -8076,7 +8710,7 @@ class InMemoryPipelineRunStorage2 {
|
|
|
8076
8710
|
}
|
|
8077
8711
|
const order = input.order ?? "desc";
|
|
8078
8712
|
const statuses = toStatusSet(input.statuses);
|
|
8079
|
-
const filtered = [...this.steps.values()].filter((record) => record.projectId === input.projectId).filter((record) => input.pipelineRunId ? record.pipelineRunId === input.pipelineRunId : true).filter((record) => input.pipelineId ? record.pipelineId === input.pipelineId : true).filter((record) => input.stepId ? record.stepId === input.stepId : true).filter((record) => input.datasetId ? record.datasetId === input.datasetId : true).filter((record) => matchesRunListDateFilters(record, {
|
|
8713
|
+
const filtered = [...this.steps.values()].filter((record) => record.projectId === input.projectId).filter((record) => input.pipelineRunId ? record.pipelineRunId === input.pipelineRunId : true).filter((record) => input.pipelineRunIds?.includes(record.pipelineRunId) ?? true).filter((record) => input.pipelineId ? record.pipelineId === input.pipelineId : true).filter((record) => input.stepId ? record.stepId === input.stepId : true).filter((record) => input.datasetId ? record.datasetId === input.datasetId : true).filter((record) => matchesRunListDateFilters(record, {
|
|
8080
8714
|
statuses,
|
|
8081
8715
|
startedAfter: input.startedAfter,
|
|
8082
8716
|
startedBefore: input.startedBefore
|
|
@@ -8095,6 +8729,17 @@ class InMemoryPipelineRunStorage2 {
|
|
|
8095
8729
|
}
|
|
8096
8730
|
return record;
|
|
8097
8731
|
}
|
|
8732
|
+
requireHeldPipelineRun(projectId, id, token) {
|
|
8733
|
+
const existing = this.requireExistingPipelineRun(projectId, id);
|
|
8734
|
+
if (existing.status !== "running" || existing.execution?.token !== token) {
|
|
8735
|
+
throw staleExecution(id);
|
|
8736
|
+
}
|
|
8737
|
+
return existing;
|
|
8738
|
+
}
|
|
8739
|
+
writeRun(run) {
|
|
8740
|
+
this.runs.set(storageKey(run.projectId, run.id), cloneRecord(run));
|
|
8741
|
+
return cloneRecord(run);
|
|
8742
|
+
}
|
|
8098
8743
|
requireRunningPipelineRun(projectId, id) {
|
|
8099
8744
|
const record = this.requireExistingPipelineRun(projectId, id);
|
|
8100
8745
|
if (record.status !== "running") {
|
|
@@ -8113,6 +8758,9 @@ class InMemoryPipelineRunStorage2 {
|
|
|
8113
8758
|
return record;
|
|
8114
8759
|
}
|
|
8115
8760
|
}
|
|
8761
|
+
function staleExecution(id) {
|
|
8762
|
+
return new PipelineRunError2(`[Sixb] Execution token is no longer current on pipeline run '${id}'.`);
|
|
8763
|
+
}
|
|
8116
8764
|
// src/storage/projection-runs/in-memory.ts
|
|
8117
8765
|
import { randomUUID } from "crypto";
|
|
8118
8766
|
var runDirectly3 = async (run) => run();
|
|
@@ -8180,7 +8828,8 @@ class InMemoryProjectionRunStorage2 {
|
|
|
8180
8828
|
...existing,
|
|
8181
8829
|
status: "running",
|
|
8182
8830
|
attempt,
|
|
8183
|
-
executionToken: randomUUID(),
|
|
8831
|
+
executionToken: input.execution?.token ?? randomUUID(),
|
|
8832
|
+
queueLeaseExpiresAt: input.execution?.queueLeaseExpiresAt,
|
|
8184
8833
|
startedAt: existing.startedAt ?? new Date(input.startedAt ?? new Date),
|
|
8185
8834
|
finishedAt: undefined
|
|
8186
8835
|
};
|
|
@@ -8188,6 +8837,36 @@ class InMemoryProjectionRunStorage2 {
|
|
|
8188
8837
|
return createProjectionRunClaim2(record);
|
|
8189
8838
|
});
|
|
8190
8839
|
}
|
|
8840
|
+
async confirmExecutionOwnership(input) {
|
|
8841
|
+
return this.runRootOperation(() => {
|
|
8842
|
+
const key = projectionRunKey(input.projectId, input.id);
|
|
8843
|
+
const existing = this.rows.get(key);
|
|
8844
|
+
if (!existing)
|
|
8845
|
+
throw projectionRunNotFound2(input.projectId, input.id);
|
|
8846
|
+
if (existing.status !== "running" || existing.executionToken !== input.executionToken) {
|
|
8847
|
+
throw staleProjectionRunExecution2(input.id);
|
|
8848
|
+
}
|
|
8849
|
+
const record = {
|
|
8850
|
+
...existing,
|
|
8851
|
+
queueLeaseExpiresAt: laterLease2(existing.queueLeaseExpiresAt, input.queueLeaseExpiresAt)
|
|
8852
|
+
};
|
|
8853
|
+
this.rows.set(key, structuredClone(record));
|
|
8854
|
+
return publicProjectionRunRecord2(record);
|
|
8855
|
+
});
|
|
8856
|
+
}
|
|
8857
|
+
async listLapsed(input) {
|
|
8858
|
+
return this.runRootOperation(() => [...this.rows.values()].filter((run) => run.projectId === input.projectId && run.status === "running" && run.queueLeaseExpiresAt !== undefined && run.queueLeaseExpiresAt.getTime() <= input.lapsedBy.getTime()).sort((left, right) => (left.queueLeaseExpiresAt?.getTime() ?? 0) - (right.queueLeaseExpiresAt?.getTime() ?? 0)).slice(0, input.limit).map((run) => structuredClone(run)));
|
|
8859
|
+
}
|
|
8860
|
+
async releaseExecution(input) {
|
|
8861
|
+
return this.runRootOperation(() => {
|
|
8862
|
+
const key = projectionRunKey(input.projectId, input.id);
|
|
8863
|
+
const existing = this.rows.get(key);
|
|
8864
|
+
if (existing?.status !== "running" || existing.executionToken !== input.executionToken)
|
|
8865
|
+
return;
|
|
8866
|
+
const queueLeaseExpiresAt = new Date(input.releasedAt ?? new Date);
|
|
8867
|
+
this.rows.set(key, structuredClone({ ...existing, queueLeaseExpiresAt }));
|
|
8868
|
+
});
|
|
8869
|
+
}
|
|
8191
8870
|
async failEnqueue(input) {
|
|
8192
8871
|
return this.runRootOperation(() => {
|
|
8193
8872
|
const key = projectionRunKey(input.projectId, input.id);
|
|
@@ -8345,7 +9024,7 @@ class InMemoryProjectionRunStorage2 {
|
|
|
8345
9024
|
}
|
|
8346
9025
|
}
|
|
8347
9026
|
// src/storage/rules/in-memory.ts
|
|
8348
|
-
function
|
|
9027
|
+
function stateKey3(params) {
|
|
8349
9028
|
return JSON.stringify([
|
|
8350
9029
|
params.projectId,
|
|
8351
9030
|
params.ruleId,
|
|
@@ -8391,12 +9070,12 @@ class InMemoryRulesStorage2 {
|
|
|
8391
9070
|
}
|
|
8392
9071
|
}
|
|
8393
9072
|
async getActive(params) {
|
|
8394
|
-
const record = this.active.get(
|
|
9073
|
+
const record = this.active.get(stateKey3(params));
|
|
8395
9074
|
return record ? cloneRuleStateRecord(record) : null;
|
|
8396
9075
|
}
|
|
8397
9076
|
async getActiveBatch(params) {
|
|
8398
9077
|
return params.items.flatMap((item) => {
|
|
8399
|
-
const record = this.active.get(
|
|
9078
|
+
const record = this.active.get(stateKey3({ projectId: params.projectId, ...item }));
|
|
8400
9079
|
return record ? [cloneRuleStateRecord(record)] : [];
|
|
8401
9080
|
});
|
|
8402
9081
|
}
|
|
@@ -8439,10 +9118,10 @@ class InMemoryRulesStorage2 {
|
|
|
8439
9118
|
subject: structuredClone(event.payload.subject),
|
|
8440
9119
|
triggeredAt: event.payload.triggeredAt
|
|
8441
9120
|
};
|
|
8442
|
-
this.active.set(
|
|
9121
|
+
this.active.set(stateKey3(record), cloneRuleStateRecord(record));
|
|
8443
9122
|
}
|
|
8444
9123
|
async applyResolved(event) {
|
|
8445
|
-
this.active.delete(
|
|
9124
|
+
this.active.delete(stateKey3({
|
|
8446
9125
|
projectId: event.projectId,
|
|
8447
9126
|
ruleId: event.payload.ruleId,
|
|
8448
9127
|
subject: event.payload.subject
|
|
@@ -8564,6 +9243,17 @@ class InMemoryShareSessionStorage2 {
|
|
|
8564
9243
|
this.rows.set(key, updated);
|
|
8565
9244
|
return cloneShareSessionRecord2(updated);
|
|
8566
9245
|
}
|
|
9246
|
+
async setGuestName(input) {
|
|
9247
|
+
const normalized = normalizeSetShareSessionGuestNameInput2(input);
|
|
9248
|
+
const key = rowKey3(normalized.projectId, normalized.id);
|
|
9249
|
+
const current = this.rows.get(key);
|
|
9250
|
+
if (!current || current.grantId !== normalized.grantId || current.revokedAt !== undefined || current.expiresAt.getTime() <= normalized.now.getTime() || current.absoluteExpiresAt.getTime() <= normalized.now.getTime()) {
|
|
9251
|
+
return null;
|
|
9252
|
+
}
|
|
9253
|
+
const updated = { ...current, guestName: normalized.name };
|
|
9254
|
+
this.rows.set(key, updated);
|
|
9255
|
+
return cloneShareSessionRecord2(updated);
|
|
9256
|
+
}
|
|
8567
9257
|
async revoke(input) {
|
|
8568
9258
|
const normalized = normalizeRevokeShareSessionInput2(input);
|
|
8569
9259
|
const key = rowKey3(normalized.projectId, normalized.id);
|
|
@@ -8645,6 +9335,9 @@ class InMemorySyncRunStorage2 {
|
|
|
8645
9335
|
const next = {
|
|
8646
9336
|
...existing,
|
|
8647
9337
|
status: "queued",
|
|
9338
|
+
attempt: 0,
|
|
9339
|
+
execution: undefined,
|
|
9340
|
+
commitPreparedAt: undefined,
|
|
8648
9341
|
queuedAt,
|
|
8649
9342
|
startedAt: undefined,
|
|
8650
9343
|
finishedAt: undefined,
|
|
@@ -8664,6 +9357,7 @@ class InMemorySyncRunStorage2 {
|
|
|
8664
9357
|
datasetId: input.datasetId,
|
|
8665
9358
|
mode: input.mode,
|
|
8666
9359
|
status: "queued",
|
|
9360
|
+
attempt: 0,
|
|
8667
9361
|
queuedAt,
|
|
8668
9362
|
expectedLatestVersionId: input.expectedLatestVersionId,
|
|
8669
9363
|
commitMessage: input.commitMessage
|
|
@@ -8671,33 +9365,65 @@ class InMemorySyncRunStorage2 {
|
|
|
8671
9365
|
this.rows.set(key, structuredClone(record));
|
|
8672
9366
|
return cloneSyncRunRecord(record);
|
|
8673
9367
|
}
|
|
8674
|
-
async
|
|
8675
|
-
const
|
|
8676
|
-
const
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
}
|
|
8683
|
-
const next = {
|
|
9368
|
+
async startOrReclaim(input) {
|
|
9369
|
+
const existing = this.requireRun(input.projectId, input.id);
|
|
9370
|
+
const sibling = [...this.rows.values()].find((run) => run.projectId === input.projectId && run.syncId === existing.syncId && run.id !== existing.id && run.status === "running");
|
|
9371
|
+
const plan = planRunClaim2(cloneSyncRunRecord(existing), input, sibling);
|
|
9372
|
+
if (!plan.take)
|
|
9373
|
+
return plan.claim;
|
|
9374
|
+
const { outcome, startedAt, attempt, execution } = plan;
|
|
9375
|
+
const run = this.write({
|
|
8684
9376
|
...existing,
|
|
8685
9377
|
status: "running",
|
|
8686
|
-
startedAt
|
|
9378
|
+
startedAt,
|
|
9379
|
+
attempt,
|
|
9380
|
+
execution,
|
|
8687
9381
|
error: undefined
|
|
8688
|
-
};
|
|
8689
|
-
|
|
8690
|
-
|
|
9382
|
+
});
|
|
9383
|
+
return { outcome, run };
|
|
9384
|
+
}
|
|
9385
|
+
async confirmExecutionOwnership(input) {
|
|
9386
|
+
const existing = this.requireHeldRun(input.projectId, input.id, input.executionToken);
|
|
9387
|
+
return this.write({
|
|
9388
|
+
...existing,
|
|
9389
|
+
execution: {
|
|
9390
|
+
token: input.executionToken,
|
|
9391
|
+
queueLeaseExpiresAt: laterLease2(existing.execution?.queueLeaseExpiresAt, input.queueLeaseExpiresAt)
|
|
9392
|
+
}
|
|
9393
|
+
});
|
|
9394
|
+
}
|
|
9395
|
+
async listLost(input) {
|
|
9396
|
+
return selectLostRuns(this.rows.values(), input).map((run) => structuredClone(run));
|
|
9397
|
+
}
|
|
9398
|
+
async releaseExecution(input) {
|
|
9399
|
+
const existing = this.rows.get(syncRunKey(input.projectId, input.id));
|
|
9400
|
+
if (existing?.status !== "running" || existing.execution?.token !== input.executionToken)
|
|
9401
|
+
return;
|
|
9402
|
+
this.write({
|
|
9403
|
+
...existing,
|
|
9404
|
+
execution: {
|
|
9405
|
+
token: input.executionToken,
|
|
9406
|
+
queueLeaseExpiresAt: new Date(input.releasedAt ?? new Date)
|
|
9407
|
+
},
|
|
9408
|
+
attempt: input.spentAttempt ? existing.attempt : existing.attempt - 1
|
|
9409
|
+
});
|
|
9410
|
+
}
|
|
9411
|
+
async prepareCommit(input) {
|
|
9412
|
+
const existing = this.requireHeldRun(input.projectId, input.id, input.executionToken);
|
|
9413
|
+
return this.write({
|
|
9414
|
+
...existing,
|
|
9415
|
+
rowsRead: input.rowsRead,
|
|
9416
|
+
checkpoint: normalizeCheckpoint(input.checkpoint),
|
|
9417
|
+
commitPreparedAt: new Date(input.preparedAt ?? new Date)
|
|
9418
|
+
});
|
|
8691
9419
|
}
|
|
8692
9420
|
async finish(input) {
|
|
8693
|
-
const
|
|
8694
|
-
const existing = this.rows.get(key);
|
|
8695
|
-
if (!existing) {
|
|
8696
|
-
throw new SyncRunError2(`[Sixb] Sync run '${input.id}' not found for project '${input.projectId}'.`);
|
|
8697
|
-
}
|
|
9421
|
+
const existing = this.requireRun(input.projectId, input.id);
|
|
8698
9422
|
if (!canFinishSyncRun2(existing.status, input)) {
|
|
8699
9423
|
throw new SyncRunError2(`[Sixb] Sync run '${input.id}' cannot finish from status '${existing.status}'.`);
|
|
8700
9424
|
}
|
|
9425
|
+
if (!mayFinishRun2(existing, input))
|
|
9426
|
+
throw staleExecution2(input.id);
|
|
8701
9427
|
if (input.status === "succeeded") {
|
|
8702
9428
|
if (input.output && input.output.datasetId !== existing.datasetId) {
|
|
8703
9429
|
throw new SyncRunError2(`[Sixb] Sync run '${input.id}' output dataset '${input.output.datasetId}' does not match '${existing.datasetId}'.`);
|
|
@@ -8709,6 +9435,7 @@ class InMemorySyncRunStorage2 {
|
|
|
8709
9435
|
const base = {
|
|
8710
9436
|
...existing,
|
|
8711
9437
|
status: input.status,
|
|
9438
|
+
execution: undefined,
|
|
8712
9439
|
finishedAt: new Date(input.finishedAt ?? new Date)
|
|
8713
9440
|
};
|
|
8714
9441
|
const next = input.status === "succeeded" ? {
|
|
@@ -8724,8 +9451,7 @@ class InMemorySyncRunStorage2 {
|
|
|
8724
9451
|
error: normalizeError2(input.error),
|
|
8725
9452
|
checkpoint: undefined
|
|
8726
9453
|
};
|
|
8727
|
-
this.
|
|
8728
|
-
return cloneSyncRunRecord(next);
|
|
9454
|
+
return this.write(next);
|
|
8729
9455
|
}
|
|
8730
9456
|
async getById(params) {
|
|
8731
9457
|
const record = this.rows.get(syncRunKey(params.projectId, params.id));
|
|
@@ -8760,6 +9486,27 @@ class InMemorySyncRunStorage2 {
|
|
|
8760
9486
|
runs: runs.map(cloneSyncRunRecord)
|
|
8761
9487
|
};
|
|
8762
9488
|
}
|
|
9489
|
+
requireRun(projectId, id) {
|
|
9490
|
+
const existing = this.rows.get(syncRunKey(projectId, id));
|
|
9491
|
+
if (!existing) {
|
|
9492
|
+
throw new SyncRunError2(`[Sixb] Sync run '${id}' not found for project '${projectId}'.`);
|
|
9493
|
+
}
|
|
9494
|
+
return existing;
|
|
9495
|
+
}
|
|
9496
|
+
requireHeldRun(projectId, id, token) {
|
|
9497
|
+
const existing = this.requireRun(projectId, id);
|
|
9498
|
+
if (existing.status !== "running" || existing.execution?.token !== token) {
|
|
9499
|
+
throw staleExecution2(id);
|
|
9500
|
+
}
|
|
9501
|
+
return existing;
|
|
9502
|
+
}
|
|
9503
|
+
write(run) {
|
|
9504
|
+
this.rows.set(syncRunKey(run.projectId, run.id), structuredClone(run));
|
|
9505
|
+
return cloneSyncRunRecord(run);
|
|
9506
|
+
}
|
|
9507
|
+
}
|
|
9508
|
+
function staleExecution2(id) {
|
|
9509
|
+
return new SyncRunError2(`[Sixb] Execution token is no longer current on sync run '${id}'.`);
|
|
8763
9510
|
}
|
|
8764
9511
|
// src/storage/webhook-runs/types.ts
|
|
8765
9512
|
var WEBHOOK_RUN_FAILURE_CODES2 = [
|
|
@@ -8767,8 +9514,14 @@ var WEBHOOK_RUN_FAILURE_CODES2 = [
|
|
|
8767
9514
|
"webhook.delivery_failed",
|
|
8768
9515
|
"webhook.delivery_rejected"
|
|
8769
9516
|
];
|
|
8770
|
-
|
|
8771
|
-
|
|
9517
|
+
var WEBHOOK_RUN_LEASE_MS2 = 60000;
|
|
9518
|
+
function canRetryWebhookRun2(run, now = new Date) {
|
|
9519
|
+
if (run.status === "failed")
|
|
9520
|
+
return run.error?.retryable === true;
|
|
9521
|
+
if (run.status !== "running")
|
|
9522
|
+
return false;
|
|
9523
|
+
const leaseExpiresAt = run.execution?.leaseExpiresAt.getTime() ?? run.startedAt.getTime() + WEBHOOK_RUN_LEASE_MS2;
|
|
9524
|
+
return leaseExpiresAt <= now.getTime();
|
|
8772
9525
|
}
|
|
8773
9526
|
|
|
8774
9527
|
// src/storage/webhook-runs/in-memory.ts
|
|
@@ -8806,6 +9559,7 @@ class InMemoryWebhookRunStorage2 {
|
|
|
8806
9559
|
connectorId: input.connectorId,
|
|
8807
9560
|
webhookId: input.webhookId,
|
|
8808
9561
|
status: "running",
|
|
9562
|
+
execution: input.execution,
|
|
8809
9563
|
method: input.method,
|
|
8810
9564
|
route: input.route,
|
|
8811
9565
|
startedAt: new Date(input.startedAt ?? new Date),
|
|
@@ -8818,13 +9572,15 @@ class InMemoryWebhookRunStorage2 {
|
|
|
8818
9572
|
}
|
|
8819
9573
|
async restart(input) {
|
|
8820
9574
|
const existing = this.requireWebhookRun(input.projectId, input.id);
|
|
8821
|
-
|
|
9575
|
+
const startedAt = new Date(input.startedAt ?? new Date);
|
|
9576
|
+
if (!canRetryWebhookRun2(existing, startedAt)) {
|
|
8822
9577
|
throw new WebhookRunError2(`[Sixb] Webhook run '${input.id}' cannot restart from status '${existing.status}'.`, "invalid_transition");
|
|
8823
9578
|
}
|
|
8824
9579
|
const next = {
|
|
8825
9580
|
...existing,
|
|
8826
9581
|
status: "running",
|
|
8827
|
-
|
|
9582
|
+
execution: input.execution,
|
|
9583
|
+
startedAt,
|
|
8828
9584
|
finishedAt: undefined,
|
|
8829
9585
|
responseStatus: undefined,
|
|
8830
9586
|
error: undefined
|
|
@@ -8832,11 +9588,25 @@ class InMemoryWebhookRunStorage2 {
|
|
|
8832
9588
|
this.runs.set(storageKey(input.projectId, input.id), cloneRecord(next));
|
|
8833
9589
|
return cloneRecord(next);
|
|
8834
9590
|
}
|
|
9591
|
+
async renewLease(input) {
|
|
9592
|
+
const key = storageKey(input.projectId, input.id);
|
|
9593
|
+
const existing = this.runs.get(key);
|
|
9594
|
+
if (existing?.status !== "running" || existing.execution?.token !== input.executionToken) {
|
|
9595
|
+
return false;
|
|
9596
|
+
}
|
|
9597
|
+
const execution = { token: input.executionToken, leaseExpiresAt: input.leaseExpiresAt };
|
|
9598
|
+
this.runs.set(key, cloneRecord({ ...existing, execution }));
|
|
9599
|
+
return true;
|
|
9600
|
+
}
|
|
8835
9601
|
async finish(input) {
|
|
8836
9602
|
const existing = this.requireRunningWebhookRun(input.projectId, input.id);
|
|
9603
|
+
if (existing.execution?.token !== input.executionToken) {
|
|
9604
|
+
throw new WebhookRunError2(`[Sixb] Execution token is no longer current on webhook run '${input.id}'.`, "invalid_transition");
|
|
9605
|
+
}
|
|
8837
9606
|
const next = {
|
|
8838
9607
|
...existing,
|
|
8839
9608
|
status: input.status,
|
|
9609
|
+
execution: undefined,
|
|
8840
9610
|
finishedAt: new Date(input.finishedAt ?? new Date),
|
|
8841
9611
|
responseStatus: input.responseStatus,
|
|
8842
9612
|
error: input.status === "failed" ? parseSixbFailure2(input.error, WEBHOOK_RUN_FAILURE_CODES2) : undefined
|
|
@@ -9102,27 +9872,45 @@ class InMemoryWorkflowRunStorage2 {
|
|
|
9102
9872
|
this.runs.set(key, cloneRecord(record));
|
|
9103
9873
|
return cloneRecord(record);
|
|
9104
9874
|
}
|
|
9105
|
-
async
|
|
9106
|
-
const
|
|
9107
|
-
const
|
|
9108
|
-
if (!
|
|
9109
|
-
|
|
9110
|
-
}
|
|
9111
|
-
const
|
|
9875
|
+
async startOrReclaim(input) {
|
|
9876
|
+
const existing = this.requireExistingWorkflowRun(input.projectId, input.id);
|
|
9877
|
+
const plan = planRunClaim2(cloneRecord(existing), input);
|
|
9878
|
+
if (!plan.take)
|
|
9879
|
+
return plan.claim;
|
|
9880
|
+
const { outcome, startedAt, attempt, execution } = plan;
|
|
9881
|
+
const run = {
|
|
9112
9882
|
...existing,
|
|
9113
9883
|
status: "running",
|
|
9114
|
-
startedAt
|
|
9884
|
+
startedAt,
|
|
9115
9885
|
finishedAt: undefined,
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9886
|
+
attempt,
|
|
9887
|
+
execution: cloneRecord(execution),
|
|
9888
|
+
error: undefined
|
|
9119
9889
|
};
|
|
9120
|
-
this.runs.set(
|
|
9121
|
-
return cloneRecord(
|
|
9890
|
+
this.runs.set(storageKey(input.projectId, input.id), cloneRecord(run));
|
|
9891
|
+
return { outcome, run: cloneRecord(run) };
|
|
9892
|
+
}
|
|
9893
|
+
async listLost(input) {
|
|
9894
|
+
return selectLostRuns(this.runs.values(), input).map((run) => cloneRecord(run));
|
|
9895
|
+
}
|
|
9896
|
+
async releaseExecution(input) {
|
|
9897
|
+
const existing = this.runs.get(storageKey(input.projectId, input.id));
|
|
9898
|
+
if (existing?.status !== "running" || existing.execution?.token !== input.executionToken)
|
|
9899
|
+
return;
|
|
9900
|
+
const next = {
|
|
9901
|
+
...existing,
|
|
9902
|
+
execution: {
|
|
9903
|
+
token: input.executionToken,
|
|
9904
|
+
queueLeaseExpiresAt: new Date(input.releasedAt ?? new Date)
|
|
9905
|
+
},
|
|
9906
|
+
attempt: input.spentAttempt ? existing.attempt : existing.attempt - 1
|
|
9907
|
+
};
|
|
9908
|
+
this.runs.set(storageKey(input.projectId, input.id), cloneRecord(next));
|
|
9122
9909
|
}
|
|
9123
9910
|
async finish(input) {
|
|
9124
9911
|
const existing = this.requireFinishableWorkflowRun(input);
|
|
9125
|
-
|
|
9912
|
+
if (!mayFinishRun2(existing, input))
|
|
9913
|
+
throw this.staleExecution(existing.id);
|
|
9126
9914
|
const base = {
|
|
9127
9915
|
...existing,
|
|
9128
9916
|
status: input.status,
|
|
@@ -9161,22 +9949,12 @@ class InMemoryWorkflowRunStorage2 {
|
|
|
9161
9949
|
status: "running",
|
|
9162
9950
|
finishedAt: undefined,
|
|
9163
9951
|
error: undefined,
|
|
9164
|
-
attempt:
|
|
9952
|
+
attempt: 1,
|
|
9165
9953
|
execution: input.execution ? cloneRecord(input.execution) : undefined
|
|
9166
9954
|
};
|
|
9167
9955
|
this.runs.set(storageKey(input.projectId, input.id), cloneRecord(next));
|
|
9168
9956
|
return cloneRecord(next);
|
|
9169
9957
|
}
|
|
9170
|
-
async reclaim(input) {
|
|
9171
|
-
const existing = this.requireRunningWorkflowRun(input.projectId, input.id);
|
|
9172
|
-
const next = {
|
|
9173
|
-
...existing,
|
|
9174
|
-
attempt: existing.attempt + 1,
|
|
9175
|
-
execution: cloneRecord(input.execution)
|
|
9176
|
-
};
|
|
9177
|
-
this.runs.set(storageKey(input.projectId, input.id), cloneRecord(next));
|
|
9178
|
-
return cloneRecord(next);
|
|
9179
|
-
}
|
|
9180
9958
|
async confirmExecutionOwnership(input) {
|
|
9181
9959
|
const existing = this.requireRunningWorkflowRun(input.projectId, input.id);
|
|
9182
9960
|
this.assertRecordExecutionOwnership(existing, input.executionToken);
|
|
@@ -9275,9 +10053,11 @@ class InMemoryWorkflowRunStorage2 {
|
|
|
9275
10053
|
this.assertRecordExecutionOwnership(this.requireExistingWorkflowRun(projectId, id), token);
|
|
9276
10054
|
}
|
|
9277
10055
|
assertRecordExecutionOwnership(record, token) {
|
|
9278
|
-
if (record
|
|
9279
|
-
throw
|
|
9280
|
-
|
|
10056
|
+
if (!holdsRun2(record, token))
|
|
10057
|
+
throw this.staleExecution(record.id);
|
|
10058
|
+
}
|
|
10059
|
+
staleExecution(id) {
|
|
10060
|
+
return new WorkflowRunError2(`[Sixb] Execution token is no longer current on workflow run '${id}'.`);
|
|
9281
10061
|
}
|
|
9282
10062
|
}
|
|
9283
10063
|
|
|
@@ -9626,7 +10406,10 @@ class InMemoryStorage2 {
|
|
|
9626
10406
|
webhookRunStorage = new InMemoryWebhookRunStorage2(this.executionStorage);
|
|
9627
10407
|
rulesStorage = new InMemoryRulesStorage2;
|
|
9628
10408
|
fileUploadSessionStorage = new InMemoryFileUploadSessions2;
|
|
10409
|
+
datasetIngestStorage = new InMemoryDatasetIngestStorage2;
|
|
9629
10410
|
fileDownloadGrantStorage = new InMemoryFileDownloadGrantStorage;
|
|
10411
|
+
maintenanceHeartbeatStorage = new InMemoryMaintenanceHeartbeatStorage;
|
|
10412
|
+
lakeRetentionRunStorage = new InMemoryLakeRetentionRunStorage;
|
|
9630
10413
|
connectorConnectionStorage;
|
|
9631
10414
|
activityStorage = new InMemoryActivityStorage;
|
|
9632
10415
|
auth;
|
|
@@ -9647,7 +10430,10 @@ class InMemoryStorage2 {
|
|
|
9647
10430
|
shareGrants;
|
|
9648
10431
|
shareSessions;
|
|
9649
10432
|
fileUploadSessions;
|
|
10433
|
+
datasetIngest;
|
|
9650
10434
|
fileDownloadGrants;
|
|
10435
|
+
maintenanceHeartbeats;
|
|
10436
|
+
lakeRetentionRuns;
|
|
9651
10437
|
connectorConnections;
|
|
9652
10438
|
activity;
|
|
9653
10439
|
constructor(options = {}) {
|
|
@@ -9673,7 +10459,10 @@ class InMemoryStorage2 {
|
|
|
9673
10459
|
this.shareGrants = createOperationScopedFacade2(this.shareGrantStorage, scope);
|
|
9674
10460
|
this.shareSessions = createOperationScopedFacade2(this.shareSessionStorage, scope);
|
|
9675
10461
|
this.fileUploadSessions = createOperationScopedFacade2(this.fileUploadSessionStorage, scope);
|
|
10462
|
+
this.datasetIngest = createOperationScopedFacade2(this.datasetIngestStorage, scope);
|
|
9676
10463
|
this.fileDownloadGrants = createOperationScopedFacade2(this.fileDownloadGrantStorage, scope);
|
|
10464
|
+
this.maintenanceHeartbeats = createOperationScopedFacade2(this.maintenanceHeartbeatStorage, scope);
|
|
10465
|
+
this.lakeRetentionRuns = createOperationScopedFacade2(this.lakeRetentionRunStorage, scope);
|
|
9677
10466
|
this.connectorConnections = createOperationScopedFacade2(this.connectorConnectionStorage, scope);
|
|
9678
10467
|
this.activity = createOperationScopedFacade2(this.activityStorage, scope);
|
|
9679
10468
|
this.ontologyStorage = new InMemoryOntologyStorage(this.objectStorage, this.timeseriesStorage, {
|
|
@@ -9836,7 +10625,10 @@ class InMemoryStorage2 {
|
|
|
9836
10625
|
shareGrants: this.shareGrantStorage,
|
|
9837
10626
|
shareSessions: this.shareSessionStorage,
|
|
9838
10627
|
fileUploadSessions: this.fileUploadSessionStorage,
|
|
10628
|
+
datasetIngest: this.datasetIngestStorage,
|
|
9839
10629
|
fileDownloadGrants: this.fileDownloadGrantStorage,
|
|
10630
|
+
maintenanceHeartbeats: this.maintenanceHeartbeatStorage,
|
|
10631
|
+
lakeRetentionRuns: this.lakeRetentionRunStorage,
|
|
9840
10632
|
connectorConnections: this.connectorConnectionStorage,
|
|
9841
10633
|
activity: this.activityStorage,
|
|
9842
10634
|
ping: async () => {
|
|
@@ -9870,7 +10662,10 @@ class InMemoryStorage2 {
|
|
|
9870
10662
|
shareGrants: this.shareGrantStorage.snapshot(),
|
|
9871
10663
|
shareSessions: this.shareSessionStorage.snapshot(),
|
|
9872
10664
|
fileUploadSessions: this.fileUploadSessionStorage.snapshot(),
|
|
10665
|
+
datasetIngest: this.datasetIngestStorage.snapshot(),
|
|
9873
10666
|
fileDownloadGrants: this.fileDownloadGrantStorage.snapshot(),
|
|
10667
|
+
maintenanceHeartbeats: this.maintenanceHeartbeatStorage.snapshot(),
|
|
10668
|
+
lakeRetentionRuns: this.lakeRetentionRunStorage.snapshot(),
|
|
9874
10669
|
connectorConnections: this.connectorConnectionStorage.snapshot(),
|
|
9875
10670
|
activity: this.activityStorage.snapshot()
|
|
9876
10671
|
};
|
|
@@ -9897,7 +10692,10 @@ class InMemoryStorage2 {
|
|
|
9897
10692
|
this.shareGrantStorage.restore(snapshot.shareGrants);
|
|
9898
10693
|
this.shareSessionStorage.restore(snapshot.shareSessions);
|
|
9899
10694
|
this.fileUploadSessionStorage.restore(snapshot.fileUploadSessions);
|
|
10695
|
+
this.datasetIngestStorage.restore(snapshot.datasetIngest);
|
|
9900
10696
|
this.fileDownloadGrantStorage.restore(snapshot.fileDownloadGrants);
|
|
10697
|
+
this.maintenanceHeartbeatStorage.restore(snapshot.maintenanceHeartbeats);
|
|
10698
|
+
this.lakeRetentionRunStorage.restore(snapshot.lakeRetentionRuns);
|
|
9901
10699
|
this.connectorConnectionStorage.restore(snapshot.connectorConnections);
|
|
9902
10700
|
this.activityStorage.restore(snapshot.activity);
|
|
9903
10701
|
}
|
|
@@ -10282,6 +11080,6 @@ var VECTOR_INDEXING_FAILURE_CODES2 = [
|
|
|
10282
11080
|
"vector.outcome_unknown",
|
|
10283
11081
|
"internal.unexpected"
|
|
10284
11082
|
];
|
|
10285
|
-
export { InMemoryActionRunStorage2, AGENT_MESSAGE_CONTENT_VERSION2, InMemoryAgentStorage2, AiCostStorageError2, InMemoryAiCostStorage2, InMemoryAiLimitStorage2, InMemoryConnectorConnectionStorage2, InMemoryFileUploadSessions2, objectBatchKey2, linkBatchKey2, objectLinkCursor2, compareQueryScalarValues, matchesPredicate, sortTieDirection2, PIPELINE_RUN_FAILURE_CODES2, InMemoryPipelineRunStorage2, InMemoryProjectionRunStorage2, InMemoryRulesStorage2, InMemoryShareGrantStorage2, InMemoryShareSessionStorage2, SYNC_RUN_FAILURE_CODES2, InMemorySyncRunStorage2, WEBHOOK_RUN_FAILURE_CODES2, canRetryWebhookRun2, InMemoryWebhookRunStorage2, WorkflowInterventionError2, InMemoryWorkflowInterventionStorage2, WORKFLOW_RUN_FAILURE_CODES2, InMemoryWorkflowRunStorage2, InMemoryWorkflowNodeRunStorage2, InMemoryWorkflowAgentNodeRunStorage2, InMemoryStorage2, prepareObjectQueries2, isMigrationCapableStorage2, migrateStorage2, checkStorageSchema2, step2, defineMigrations2, runMigrationSet2, describeMigrationHistory2, VECTOR_INDEXING_FAILURE_CODES2 };
|
|
11083
|
+
export { InMemoryActionRunStorage2, AGENT_MESSAGE_CONTENT_VERSION2, InMemoryAgentStorage2, AiCostStorageError2, InMemoryAiCostStorage2, InMemoryAiLimitStorage2, InMemoryConnectorConnectionStorage2, InMemoryDatasetIngestStorage2, InMemoryFileUploadSessions2, objectBatchKey2, linkBatchKey2, objectLinkCursor2, compareQueryScalarValues, matchesPredicate, sortTieDirection2, PIPELINE_RUN_FAILURE_CODES2, InMemoryPipelineRunStorage2, InMemoryProjectionRunStorage2, InMemoryRulesStorage2, InMemoryShareGrantStorage2, InMemoryShareSessionStorage2, SYNC_RUN_FAILURE_CODES2, InMemorySyncRunStorage2, WEBHOOK_RUN_FAILURE_CODES2, WEBHOOK_RUN_LEASE_MS2, canRetryWebhookRun2, InMemoryWebhookRunStorage2, WorkflowInterventionError2, InMemoryWorkflowInterventionStorage2, WORKFLOW_RUN_FAILURE_CODES2, InMemoryWorkflowRunStorage2, InMemoryWorkflowNodeRunStorage2, InMemoryWorkflowAgentNodeRunStorage2, InMemoryStorage2, prepareObjectQueries2, isMigrationCapableStorage2, migrateStorage2, checkStorageSchema2, step2, defineMigrations2, runMigrationSet2, describeMigrationHistory2, VECTOR_INDEXING_FAILURE_CODES2 };
|
|
10286
11084
|
|
|
10287
|
-
//# debugId=
|
|
11085
|
+
//# debugId=26430E748C66628B64756E2164756E21
|