@sixb/core 0.2.1 → 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 +60 -54
- 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/cancel.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 +6 -4
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +95 -82
- 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-plan.d.ts +15 -1
- package/dist/agents/run-plan.d.ts.map +1 -1
- package/dist/agents/run-session-http.d.ts.map +1 -1
- package/dist/agents/run-session-serve.d.ts.map +1 -1
- package/dist/agents/run-session.d.ts +17 -2
- package/dist/agents/run-session.d.ts.map +1 -1
- package/dist/agents/skills.d.ts +3 -0
- package/dist/agents/skills.d.ts.map +1 -1
- package/dist/agents/step-limits.d.ts +6 -0
- package/dist/agents/step-limits.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 +8 -2
- package/dist/agents/streams/protocol.d.ts.map +1 -1
- package/dist/agents/tool-files.d.ts +3 -1
- package/dist/agents/tool-files.d.ts.map +1 -1
- package/dist/agents/validation.d.ts +1 -1
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/agents/web.d.ts +47 -0
- package/dist/agents/web.d.ts.map +1 -0
- 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 +67 -39
- 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/authorization/resolve.d.ts +4 -3
- package/dist/authorization/resolve.d.ts.map +1 -1
- package/dist/authorization/types.d.ts +5 -5
- package/dist/authorization/types.d.ts.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 +70 -64
- 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-3x3bebz7.js → chunk-0k3r5kb3.js} +414 -101
- package/dist/chunk-0k3r5kb3.js.map +51 -0
- package/dist/{chunk-e5wf5vz0.js → chunk-0kgrghqx.js} +13 -1
- package/dist/chunk-0kgrghqx.js.map +10 -0
- package/dist/{chunk-2pk5hjj9.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-8yzhjawq.js → chunk-26qet7wh.js} +64 -23
- package/dist/{chunk-8yzhjawq.js.map → chunk-26qet7wh.js.map} +5 -5
- package/dist/{chunk-cb21tx14.js → chunk-2by73sm2.js} +1055 -201
- 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-nghc7eq0.js → chunk-3723kgba.js} +1 -1
- 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-fg1db9xx.js → chunk-48c1z8nj.js} +10 -10
- package/dist/chunk-48c1z8nj.js.map +10 -0
- package/dist/{chunk-rjeeyssy.js → chunk-4j0sagwv.js} +134 -19
- package/dist/{chunk-rjeeyssy.js.map → chunk-4j0sagwv.js.map} +11 -10
- package/dist/{chunk-qsg8rw04.js → chunk-5qqmndhm.js} +2 -2
- package/dist/{chunk-scyq22td.js → chunk-5rqqp8cr.js} +19 -4
- package/dist/chunk-5rqqp8cr.js.map +12 -0
- package/dist/{chunk-ax10ft8d.js → chunk-6gtxshcc.js} +6 -6
- package/dist/{chunk-ax10ft8d.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-8wsjr52f.js → chunk-7qe46788.js} +1 -1
- package/dist/{chunk-edx8xcsm.js → chunk-7z5rkf0m.js} +29 -6
- package/dist/chunk-7z5rkf0m.js.map +13 -0
- package/dist/{chunk-23s66j86.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-tvbmh7tj.js → chunk-8p7bze4c.js} +14 -10
- package/dist/chunk-8p7bze4c.js.map +18 -0
- package/dist/{chunk-jftd33rc.js → chunk-8t2ynwg0.js} +105 -9
- package/dist/chunk-8t2ynwg0.js.map +11 -0
- package/dist/{chunk-qbrmpgvv.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-tvefbgvw.js → chunk-az95tsh3.js} +4 -2
- package/dist/chunk-az95tsh3.js.map +11 -0
- 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-ks87m383.js → chunk-bkmnd7zq.js} +556 -262
- 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-7hd2ez3q.js → chunk-c4nrycdy.js} +1 -1
- 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-z3evap21.js → chunk-e9w4mgdh.js} +314 -225
- package/dist/{chunk-z3evap21.js.map → chunk-e9w4mgdh.js.map} +22 -20
- 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-nqnfz3jg.js → chunk-hkaa807g.js} +18 -7
- package/dist/{chunk-nqnfz3jg.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-b7a97n8b.js → chunk-k66rp2hr.js} +7 -7
- package/dist/{chunk-b7a97n8b.js.map → chunk-k66rp2hr.js.map} +2 -2
- package/dist/chunk-kr6dx38r.js +25 -0
- package/dist/chunk-kr6dx38r.js.map +10 -0
- package/dist/{chunk-w53trr0c.js → chunk-kv0kvknv.js} +14 -14
- package/dist/{chunk-w53trr0c.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-jk97v21j.js → chunk-n4zzaf6q.js} +3 -2
- package/dist/chunk-n4zzaf6q.js.map +10 -0
- package/dist/{chunk-cgznz22f.js → chunk-n68vz95m.js} +5 -5
- package/dist/{chunk-cgznz22f.js.map → chunk-n68vz95m.js.map} +3 -3
- package/dist/{chunk-neftrg0n.js → chunk-p351afzm.js} +14 -14
- package/dist/{chunk-neftrg0n.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-jhbk10wf.js → chunk-q9nkpr8k.js} +1 -1
- 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-47e09r7z.js → chunk-qttqe1ah.js} +86 -6
- package/dist/{chunk-47e09r7z.js.map → chunk-qttqe1ah.js.map} +5 -4
- package/dist/{chunk-4zm1k3xj.js → chunk-r2psmn42.js} +1 -1
- package/dist/{chunk-31khg3g0.js → chunk-rt9deb92.js} +76 -4
- package/dist/{chunk-31khg3g0.js.map → chunk-rt9deb92.js.map} +3 -3
- package/dist/{chunk-r1cxq7vv.js → chunk-rtdrm592.js} +2 -2
- package/dist/{chunk-t5daew4g.js → chunk-s5n9617r.js} +18 -18
- package/dist/{chunk-t5daew4g.js.map → chunk-s5n9617r.js.map} +1 -1
- package/dist/{chunk-m3qe54bb.js → chunk-smnt672s.js} +1 -1
- package/dist/{chunk-21q0j5f2.js → chunk-stmxh0hv.js} +2 -2
- package/dist/{chunk-y2x2935j.js → chunk-sysnvjce.js} +5 -5
- package/dist/{chunk-y2x2935j.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-dz7a4t3a.js → chunk-vzkxqf8h.js} +26 -21
- package/dist/{chunk-dz7a4t3a.js.map → chunk-vzkxqf8h.js.map} +8 -8
- package/dist/{chunk-6b61s40c.js → chunk-w3t94hm6.js} +1 -1
- package/dist/{chunk-t9xyr7y9.js → chunk-w9s23r24.js} +1218 -101
- package/dist/chunk-w9s23r24.js.map +30 -0
- package/dist/{chunk-9rh8ncs5.js → chunk-wa05txmk.js} +20 -7
- package/dist/{chunk-9rh8ncs5.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-agn8d8ys.js → chunk-xtztwpkh.js} +1 -1
- 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-ratj7t3t.js → chunk-z0t4p2sk.js} +465 -76
- package/dist/chunk-z0t4p2sk.js.map +47 -0
- package/dist/{chunk-0g5nyx0k.js → chunk-zeykm8my.js} +2 -2
- 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 +13 -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 +61 -55
- 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 +60 -54
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.js +57 -51
- 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 +12 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +101 -93
- 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 +33 -30
- 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/catalog.d.ts +16 -0
- package/dist/models/catalog.d.ts.map +1 -1
- package/dist/models/definitions.d.ts +1 -1
- package/dist/models/definitions.d.ts.map +1 -1
- package/dist/models/execution/index.js +36 -33
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/execution/model-call-recorder.d.ts +1 -1
- package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
- package/dist/models/execution/web-search.d.ts +7 -0
- package/dist/models/execution/web-search.d.ts.map +1 -0
- package/dist/models/index.d.ts +3 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +5 -3
- package/dist/models/index.js.map +1 -1
- package/dist/models/language-model.d.ts +12 -0
- package/dist/models/language-model.d.ts.map +1 -1
- package/dist/models/web-search-model.d.ts +66 -0
- package/dist/models/web-search-model.d.ts.map +1 -0
- package/dist/objects/artifact-refs.d.ts +5 -0
- package/dist/objects/artifact-refs.d.ts.map +1 -0
- package/dist/objects/index.js +63 -58
- 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/executor.d.ts.map +1 -1
- package/dist/objects/query/index.d.ts +1 -0
- package/dist/objects/query/index.d.ts.map +1 -1
- package/dist/objects/query/index.js +35 -29
- 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/query/sort-ties.d.ts +11 -0
- package/dist/objects/query/sort-ties.d.ts.map +1 -0
- 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 +40 -37
- 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 +33 -30
- 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 +4 -1
- 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 +57 -36
- package/dist/runtime/internal.js.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts.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/index.d.ts +1 -0
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/internal.js +1 -1
- package/dist/security/registry.d.ts +2 -0
- package/dist/security/registry.d.ts.map +1 -1
- package/dist/security/view-conditions.d.ts.map +1 -1
- package/dist/security/visibility-keys.d.ts +19 -0
- package/dist/security/visibility-keys.d.ts.map +1 -0
- 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 +74 -33
- 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/agents/in-memory.d.ts +8 -2
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +1 -1
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts +8 -2
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +12 -6
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +42 -2
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +4 -4
- package/dist/storage/ai-limits/enforcement.js +4 -4
- package/dist/storage/ai-limits/provider.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 +23 -7
- package/dist/storage/connector-connections/provider.js.map +6 -6
- 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 +20 -13
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +61 -51
- 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 +83 -7
- 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/migrations/types.d.ts +6 -0
- package/dist/storage/migrations/types.d.ts.map +1 -1
- 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/index.d.ts +1 -1
- package/dist/storage/objects/index.d.ts.map +1 -1
- package/dist/storage/objects/query-preparation.d.ts +13 -0
- package/dist/storage/objects/query-preparation.d.ts.map +1 -1
- package/dist/storage/objects/read-scope.d.ts.map +1 -1
- package/dist/storage/objects/types.d.ts +70 -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 +41 -38
- 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/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-limit-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-model-call-groups-contract.d.ts.map +1 -1
- package/dist/testing/ai-usage-storage-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 +6497 -3090
- package/dist/testing/index.js.map +32 -23
- 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-conditional-read-scope-contract.d.ts.map +1 -1
- 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 +72 -40
- 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 +68 -62
- 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/README.md +2 -1
- package/src/agents/cancel.ts +7 -1
- package/src/agents/execution.ts +10 -2
- package/src/agents/fork.ts +12 -4
- package/src/agents/index.ts +16 -2
- package/src/agents/request.ts +42 -31
- package/src/agents/run-artifacts.ts +290 -46
- package/src/agents/run-plan.ts +31 -0
- package/src/agents/run-session-http.ts +19 -12
- package/src/agents/run-session-serve.ts +18 -2
- package/src/agents/run-session.ts +39 -12
- package/src/agents/skills.ts +3 -0
- package/src/agents/step-limits.ts +6 -0
- package/src/agents/streams/protocol.ts +14 -14
- package/src/agents/tool-files.ts +11 -3
- package/src/agents/validation.ts +12 -0
- package/src/agents/web.ts +218 -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/authorization/resolve.ts +9 -11
- package/src/authorization/types.ts +5 -5
- 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 +93 -7
- 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 +37 -22
- package/src/http/api-routes.ts +105 -4
- package/src/index.ts +24 -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/models/catalog.ts +52 -3
- package/src/models/definitions.ts +2 -0
- package/src/models/execution/README.md +22 -2
- package/src/models/execution/model-call-recorder.ts +1 -1
- package/src/models/execution/web-search.ts +186 -0
- package/src/models/index.ts +12 -0
- package/src/models/language-model.ts +12 -0
- package/src/models/web-search-model.ts +152 -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/executor.ts +7 -3
- package/src/objects/query/index.ts +1 -0
- package/src/objects/query/ir.ts +2 -0
- package/src/objects/query/scalar-values.ts +5 -3
- package/src/objects/query/sort-ties.ts +16 -0
- 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 +7 -2
- 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/resolve-definitions.ts +4 -0
- package/src/runtime/sixb.ts +14 -5
- package/src/scheduler/index.ts +0 -2
- package/src/security/index.ts +1 -0
- package/src/security/registry.ts +2 -0
- package/src/security/view-conditions.ts +4 -3
- package/src/security/visibility-keys.ts +144 -0
- 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/agents/in-memory.ts +29 -2
- package/src/storage/agents/index.ts +2 -0
- package/src/storage/agents/provider.ts +57 -1
- package/src/storage/agents/types.ts +45 -2
- 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 +6 -3
- package/src/storage/connector-connections/index.ts +1 -0
- package/src/storage/connector-connections/provider/connections.ts +2 -2
- 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 +69 -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/migrations/types.ts +6 -0
- package/src/storage/objects/in-memory/query.ts +6 -2
- package/src/storage/objects/in-memory/storage.ts +81 -0
- package/src/storage/objects/index.ts +2 -0
- package/src/storage/objects/query-preparation.ts +59 -1
- package/src/storage/objects/read-scope.ts +109 -2
- package/src/storage/objects/types.ts +59 -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/agent-storage-contract.ts +70 -0
- package/src/testing/ai-limit-storage-contract.ts +11 -1
- package/src/testing/ai-model-call-groups-contract.ts +2 -1
- package/src/testing/ai-usage-storage-contract.ts +15 -2
- 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 +117 -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-conditional-read-scope-contract.ts +267 -5
- package/src/testing/object-query-contract.ts +168 -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-3x3bebz7.js.map +0 -49
- 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-aqyjb86c.js +0 -587
- package/dist/chunk-aqyjb86c.js.map +0 -18
- package/dist/chunk-az47zep4.js +0 -41
- package/dist/chunk-az47zep4.js.map +0 -10
- package/dist/chunk-cb21tx14.js.map +0 -71
- 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-edx8xcsm.js.map +0 -13
- package/dist/chunk-epyfm23v.js +0 -299
- package/dist/chunk-epyfm23v.js.map +0 -11
- package/dist/chunk-fb3feg1e.js +0 -298
- package/dist/chunk-fb3feg1e.js.map +0 -12
- package/dist/chunk-fg1db9xx.js.map +0 -10
- package/dist/chunk-h05rg3bx.js +0 -314
- package/dist/chunk-h05rg3bx.js.map +0 -12
- package/dist/chunk-hz5d43gn.js.map +0 -10
- package/dist/chunk-jbw70d6t.js.map +0 -10
- package/dist/chunk-jftd33rc.js.map +0 -11
- package/dist/chunk-jk97v21j.js.map +0 -10
- package/dist/chunk-jspskey0.js.map +0 -10
- package/dist/chunk-kfee1h52.js.map +0 -13
- package/dist/chunk-ks87m383.js.map +0 -44
- 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-ratj7t3t.js.map +0 -45
- package/dist/chunk-s3we74h8.js.map +0 -12
- package/dist/chunk-scyq22td.js.map +0 -12
- package/dist/chunk-t9xyr7y9.js.map +0 -22
- package/dist/chunk-tvbmh7tj.js.map +0 -18
- package/dist/chunk-tvefbgvw.js.map +0 -11
- package/dist/chunk-w976a4me.js.map +0 -10
- 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-2pk5hjj9.js.map → chunk-186k5yz3.js.map} +0 -0
- /package/dist/{chunk-nghc7eq0.js.map → chunk-3723kgba.js.map} +0 -0
- /package/dist/{chunk-ytzcxtpt.js.map → chunk-3ba89vm7.js.map} +0 -0
- /package/dist/{chunk-qsg8rw04.js.map → chunk-5qqmndhm.js.map} +0 -0
- /package/dist/{chunk-8wsjr52f.js.map → chunk-7qe46788.js.map} +0 -0
- /package/dist/{chunk-23s66j86.js.map → chunk-855w9nvw.js.map} +0 -0
- /package/dist/{chunk-qbrmpgvv.js.map → chunk-8tqnsx3q.js.map} +0 -0
- /package/dist/{chunk-s038wa5v.js.map → chunk-b9qfh2ya.js.map} +0 -0
- /package/dist/{chunk-7hd2ez3q.js.map → chunk-c4nrycdy.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-jhbk10wf.js.map → chunk-q9nkpr8k.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-m3qe54bb.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
- /package/dist/{chunk-agn8d8ys.js.map → chunk-xtztwpkh.js.map} +0 -0
- /package/dist/{chunk-0g5nyx0k.js.map → chunk-zeykm8my.js.map} +0 -0
|
@@ -4,42 +4,32 @@ import {
|
|
|
4
4
|
} from "./chunk-wkv3h3q7.js";
|
|
5
5
|
import {
|
|
6
6
|
OntologyRegistry2
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-dhkc9b23.js";
|
|
8
|
+
import {
|
|
9
|
+
assertViewConditionsReadable,
|
|
10
|
+
SecurityRegistry,
|
|
11
|
+
AuthRuntime2
|
|
12
|
+
} from "./chunk-0k3r5kb3.js";
|
|
8
13
|
import {
|
|
9
14
|
captureSixbFailure2,
|
|
10
15
|
isSixbError2
|
|
11
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-mvz89age.js";
|
|
12
17
|
import {
|
|
13
18
|
captureExecutionScope,
|
|
14
19
|
resolveExecutionScopeAuthorization,
|
|
15
20
|
AuthorizationError2
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import {
|
|
18
|
-
assertViewConditionsReadable,
|
|
19
|
-
SecurityRegistry,
|
|
20
|
-
AuthRuntime2
|
|
21
|
-
} from "./chunk-3x3bebz7.js";
|
|
22
|
-
import {
|
|
23
|
-
ActionRegistry2,
|
|
24
|
-
createAgentApprovalExecutor,
|
|
25
|
-
registerAgentApprovalExecutor,
|
|
26
|
-
assertTurnModelRouting,
|
|
27
|
-
DEFAULT_PROJECT_LOCALE,
|
|
28
|
-
DEFAULT_PROJECT_TIME_ZONE,
|
|
29
|
-
canonicalLocale,
|
|
30
|
-
canonicalTimeZone,
|
|
31
|
-
assertNoAgentDefinitions,
|
|
32
|
-
validateWorkflowsAtStartup2,
|
|
33
|
-
validateWorkflowAgentStepGroupReferences2,
|
|
34
|
-
createBoundSixb,
|
|
35
|
-
ActionRunExecutor,
|
|
36
|
-
registerActionRunExecutor
|
|
37
|
-
} from "./chunk-z3evap21.js";
|
|
21
|
+
} from "./chunk-vzkxqf8h.js";
|
|
38
22
|
import {
|
|
39
23
|
AuthRuntimeError2,
|
|
40
24
|
isMagicLinkAuthStrategy2,
|
|
41
25
|
isOidcAuthStrategy2
|
|
42
26
|
} from "./chunk-5grk14e5.js";
|
|
27
|
+
import {
|
|
28
|
+
NO_CONTRIBUTION,
|
|
29
|
+
NO_APPLIED_MARKINGS,
|
|
30
|
+
assembleAppliedMarkings,
|
|
31
|
+
withPropertyMarkings
|
|
32
|
+
} from "./chunk-x0v3jd47.js";
|
|
43
33
|
import {
|
|
44
34
|
indexModelBindings,
|
|
45
35
|
assertRerankingModel,
|
|
@@ -47,10 +37,10 @@ import {
|
|
|
47
37
|
RerankingModelResponseError2,
|
|
48
38
|
createModelCatalog2,
|
|
49
39
|
estimateModelCall
|
|
50
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-qttqe1ah.js";
|
|
51
41
|
import {
|
|
52
42
|
FileUploadSessionError2
|
|
53
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-855w9nvw.js";
|
|
54
44
|
import {
|
|
55
45
|
ACTIVITY_VISIT_ID_PATTERN2,
|
|
56
46
|
ACTIVITY_ID_MAX_LENGTH2,
|
|
@@ -58,30 +48,40 @@ import {
|
|
|
58
48
|
ACTIVITY_MAX_PAGE_SIZE2,
|
|
59
49
|
ACTIVITY_MIN_IDLE_TIMEOUT_MS,
|
|
60
50
|
validateActivityEvents
|
|
61
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-3014rfjz.js";
|
|
62
52
|
import {
|
|
63
53
|
isMigrationCapableStorage2,
|
|
64
54
|
checkStorageSchema2
|
|
65
|
-
} from "./chunk-
|
|
66
|
-
import {
|
|
67
|
-
NO_CONTRIBUTION,
|
|
68
|
-
NO_APPLIED_MARKINGS,
|
|
69
|
-
assembleAppliedMarkings,
|
|
70
|
-
withPropertyMarkings
|
|
71
|
-
} from "./chunk-x0v3jd47.js";
|
|
55
|
+
} from "./chunk-2by73sm2.js";
|
|
72
56
|
import {
|
|
73
57
|
createAuthorizedObjectReader
|
|
74
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-26qet7wh.js";
|
|
59
|
+
import {
|
|
60
|
+
ActionRegistry2,
|
|
61
|
+
createAgentApprovalExecutor,
|
|
62
|
+
registerAgentApprovalExecutor,
|
|
63
|
+
assertTurnModelRouting,
|
|
64
|
+
DEFAULT_PROJECT_LOCALE,
|
|
65
|
+
DEFAULT_PROJECT_TIME_ZONE,
|
|
66
|
+
canonicalLocale,
|
|
67
|
+
canonicalTimeZone,
|
|
68
|
+
assertNoAgentDefinitions,
|
|
69
|
+
validateWorkflowsAtStartup2,
|
|
70
|
+
validateWorkflowAgentStepGroupReferences2,
|
|
71
|
+
createBoundSixb,
|
|
72
|
+
ActionRunExecutor,
|
|
73
|
+
registerActionRunExecutor
|
|
74
|
+
} from "./chunk-e9w4mgdh.js";
|
|
75
75
|
import {
|
|
76
76
|
attachSixbErrorReporter2,
|
|
77
77
|
shareSixbErrorReporter2
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-czct88ht.js";
|
|
79
79
|
import {
|
|
80
80
|
registerOntologyMutationRuntime2,
|
|
81
81
|
createOntologyMutationRuntime2,
|
|
82
82
|
decodeActivityConnectionsCursor,
|
|
83
83
|
ModelExecutionSession
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-6gtxshcc.js";
|
|
85
85
|
import {
|
|
86
86
|
registerConnectorConnectionCallbackProcess
|
|
87
87
|
} from "./chunk-5a4a52tq.js";
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
isConnectorStorageError,
|
|
97
97
|
storageBoundaryError,
|
|
98
98
|
recoverConnectorFailure
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-wa05txmk.js";
|
|
100
100
|
import {
|
|
101
101
|
assertDatasetDefinition2,
|
|
102
102
|
isDatasetPick2
|
|
@@ -104,24 +104,24 @@ import {
|
|
|
104
104
|
import {
|
|
105
105
|
ProjectionRegistry2,
|
|
106
106
|
createOntologyMaterializer2
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-4j0sagwv.js";
|
|
108
108
|
import {
|
|
109
109
|
LoggingService2
|
|
110
110
|
} from "./chunk-1vg43g9q.js";
|
|
111
111
|
import {
|
|
112
112
|
OntologyOutboxDispatcher2,
|
|
113
113
|
createDomainEventService2
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-f6ahf5gf.js";
|
|
115
115
|
import {
|
|
116
|
+
nextCronOccurrence2,
|
|
116
117
|
validateSchedulesAtStartup2
|
|
117
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-t24yktqr.js";
|
|
118
119
|
import {
|
|
120
|
+
resolveAgentWebOptions,
|
|
121
|
+
assertNoProviderWebTools,
|
|
119
122
|
toolsFromProjectConfig,
|
|
120
123
|
assertMaxSteps
|
|
121
|
-
} from "./chunk-
|
|
122
|
-
import {
|
|
123
|
-
SchedulerRuntime2
|
|
124
|
-
} from "./chunk-yw9pyg66.js";
|
|
124
|
+
} from "./chunk-z0t4p2sk.js";
|
|
125
125
|
import {
|
|
126
126
|
discoverOntologyFiles,
|
|
127
127
|
discoverAgentSkills,
|
|
@@ -130,16 +130,23 @@ import {
|
|
|
130
130
|
validateSharesAtStartup,
|
|
131
131
|
discoverOntologySources,
|
|
132
132
|
discoverProjectDefinitions2
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-kv0kvknv.js";
|
|
134
134
|
import {
|
|
135
|
+
createDatasetIngestRuntime,
|
|
136
|
+
registerDatasetIngestRuntime,
|
|
137
|
+
lakeRetentionPass,
|
|
138
|
+
operationalStatus,
|
|
139
|
+
LakeRetention,
|
|
140
|
+
registerLakeRetentionRuntime,
|
|
141
|
+
getLakeRetentionRuntime2,
|
|
135
142
|
bindEmbeddingModels,
|
|
136
143
|
createVectorIndexingRuntime,
|
|
137
144
|
registerVectorIndexingRuntime,
|
|
138
145
|
getApiPublicOrigin
|
|
139
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-tqa68kj7.js";
|
|
140
147
|
import {
|
|
141
148
|
registerProjectionRegistry2
|
|
142
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-sysnvjce.js";
|
|
143
150
|
import {
|
|
144
151
|
registeredSteps,
|
|
145
152
|
runStepLineages,
|
|
@@ -153,24 +160,30 @@ import {
|
|
|
153
160
|
registerAppliedMarkings,
|
|
154
161
|
createDatasetVersionMarkings,
|
|
155
162
|
registerDatasetVersionMarkings
|
|
156
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-3ba89vm7.js";
|
|
164
|
+
import {
|
|
165
|
+
rejectOnAbort
|
|
166
|
+
} from "./chunk-mwcqz3e3.js";
|
|
167
|
+
import {
|
|
168
|
+
everyMs,
|
|
169
|
+
MaintenanceLoop
|
|
170
|
+
} from "./chunk-j0wgh8gv.js";
|
|
157
171
|
import {
|
|
158
172
|
SyncValidationError2
|
|
159
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-m7b9q5dk.js";
|
|
160
174
|
import {
|
|
161
175
|
SandboxError2,
|
|
162
176
|
createSandboxDefinition,
|
|
163
177
|
sandboxCredentialIssue2
|
|
164
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-rtdrm592.js";
|
|
165
179
|
import {
|
|
166
180
|
ensureExecutionRecord2
|
|
167
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-8tqnsx3q.js";
|
|
168
182
|
import {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
} from "./chunk-5kyvrtjh.js";
|
|
183
|
+
PendingTasks,
|
|
184
|
+
reportEventDeliveryFailure3,
|
|
185
|
+
reportMaintenancePassFailure3
|
|
186
|
+
} from "./chunk-d9xbwh3h.js";
|
|
174
187
|
import {
|
|
175
188
|
ConnectorConnectionStorageError2,
|
|
176
189
|
CONNECTOR_CONNECTION_RUN_FAILURE_CODES2
|
|
@@ -178,6 +191,11 @@ import {
|
|
|
178
191
|
import {
|
|
179
192
|
RuntimeError2
|
|
180
193
|
} from "./chunk-m4ehq95f.js";
|
|
194
|
+
import {
|
|
195
|
+
sameConnectorConnectionOwner,
|
|
196
|
+
connectorConnectionOwners,
|
|
197
|
+
isOAuthConnectorDefinition2
|
|
198
|
+
} from "./chunk-pvpq483h.js";
|
|
181
199
|
import {
|
|
182
200
|
SecurityValidationError2
|
|
183
201
|
} from "./chunk-jcfw4h7m.js";
|
|
@@ -640,6 +658,35 @@ function assertNonblank(value, field) {
|
|
|
640
658
|
// src/connectors/connections/service.ts
|
|
641
659
|
import { randomUUID as randomUUID6 } from "crypto";
|
|
642
660
|
|
|
661
|
+
// src/connectors/connections/access.ts
|
|
662
|
+
function assertConnectorConnectionCommandAccess(definition, command) {
|
|
663
|
+
if (command.canManage || connectorConnectionOwners(definition).includes("user"))
|
|
664
|
+
return;
|
|
665
|
+
throw manageRequired(definition);
|
|
666
|
+
}
|
|
667
|
+
function assertConnectorConnectionSelectorAccess(definition, command, actor, selector) {
|
|
668
|
+
if (!connectorConnectionOwners(definition).includes(selector.owner.type)) {
|
|
669
|
+
throw createConnectorCodedError("connector.configuration_invalid", selector.owner.type === "user" ? `[Sixb] Connector '${definition.id}' does not allow personal connections. Add owners: ["user"] to its definition.` : `[Sixb] Connector '${definition.id}' allows personal connections only.`);
|
|
670
|
+
}
|
|
671
|
+
if (selector.owner.type === "project") {
|
|
672
|
+
if (!command.canManage)
|
|
673
|
+
throw manageRequired(definition);
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
if (actor.principal.type !== "user" || actor.principal.id !== selector.owner.id) {
|
|
677
|
+
throw new AuthorizationError2(`connection:connector:${definition.id}`, "[Sixb] A personal connection can only be made by its owner.");
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
function canSeeConnectorConnection(command, actor, connection) {
|
|
681
|
+
return command.canManage || isOwnConnection(actor, connection);
|
|
682
|
+
}
|
|
683
|
+
function isOwnConnection(actor, connection) {
|
|
684
|
+
return connection.owner.type === "user" && actor.principal.type === "user" && connection.owner.id === actor.principal.id;
|
|
685
|
+
}
|
|
686
|
+
function manageRequired(definition) {
|
|
687
|
+
return new AuthorizationError2(`manage:connector:${definition.id}`, `[Sixb] Managing connector '${definition.id}' connections requires can.manage(${definition.id}).`);
|
|
688
|
+
}
|
|
689
|
+
|
|
643
690
|
// src/connectors/connections/authorizations.ts
|
|
644
691
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
645
692
|
|
|
@@ -1750,11 +1797,19 @@ import { createHash as createHash2, randomBytes as randomBytes2, randomUUID as r
|
|
|
1750
1797
|
|
|
1751
1798
|
// src/connectors/connections/views.ts
|
|
1752
1799
|
function assertConnectorConnectionSelector(selector) {
|
|
1753
|
-
if (selector.owner
|
|
1754
|
-
throw createConnectorCodedError("connector.configuration_invalid",
|
|
1800
|
+
if (!isConnectorConnectionOwner(selector.owner)) {
|
|
1801
|
+
throw createConnectorCodedError("connector.configuration_invalid", 'Connector connection owner must be { type: "project" } or { type: "user", id }.');
|
|
1755
1802
|
}
|
|
1756
1803
|
nonblank(selector.slot, "connection slot");
|
|
1757
1804
|
}
|
|
1805
|
+
function isConnectorConnectionOwner(value) {
|
|
1806
|
+
if (typeof value !== "object" || value === null)
|
|
1807
|
+
return false;
|
|
1808
|
+
const { type, id } = value;
|
|
1809
|
+
if (type === "project")
|
|
1810
|
+
return id === undefined;
|
|
1811
|
+
return type === "user" && typeof id === "string" && id.trim() !== "";
|
|
1812
|
+
}
|
|
1758
1813
|
function connectorConnectionView(connection, status) {
|
|
1759
1814
|
return {
|
|
1760
1815
|
id: connection.id,
|
|
@@ -2103,7 +2158,11 @@ class ConnectorConnectionRunService {
|
|
|
2103
2158
|
return { runId: finished.id, connectorId: finished.connectorId, returnTo };
|
|
2104
2159
|
}
|
|
2105
2160
|
let authorizationId = run.authorizationId;
|
|
2161
|
+
let finished;
|
|
2106
2162
|
try {
|
|
2163
|
+
if (await this.isSuspended(principal)) {
|
|
2164
|
+
throw createConnectorCodedError("connector.authorization_invalid", "A suspended member can't connect an account.");
|
|
2165
|
+
}
|
|
2107
2166
|
const definition = this.resolveDefinition(attempt.connectorId);
|
|
2108
2167
|
const authorization = await this.requests.completeAuthorizationAttempt({
|
|
2109
2168
|
definition,
|
|
@@ -2126,12 +2185,15 @@ class ConnectorConnectionRunService {
|
|
|
2126
2185
|
}
|
|
2127
2186
|
}
|
|
2128
2187
|
});
|
|
2129
|
-
|
|
2130
|
-
return { runId: finished.id, connectorId: finished.connectorId, returnTo };
|
|
2188
|
+
finished = await this.finalizeCompletedRun(run, authorization);
|
|
2131
2189
|
} catch (error) {
|
|
2132
2190
|
const failed = await this.failRun(run, error, authorizationId);
|
|
2133
2191
|
return { runId: failed.id, connectorId: failed.connectorId, returnTo };
|
|
2134
2192
|
}
|
|
2193
|
+
if (authorizationId !== undefined) {
|
|
2194
|
+
await this.revokeIfSuspended(attempt.connectorId, authorizationId, principal);
|
|
2195
|
+
}
|
|
2196
|
+
return { runId: finished.id, connectorId: finished.connectorId, returnTo };
|
|
2135
2197
|
}
|
|
2136
2198
|
async listPending(command, connectorId) {
|
|
2137
2199
|
const actor = requireConnectorConnectionCommandActor(command.execution, this.projectId);
|
|
@@ -2183,19 +2245,22 @@ class ConnectorConnectionRunService {
|
|
|
2183
2245
|
if (!account) {
|
|
2184
2246
|
throw createConnectorCodedError("connector.not_found", `Account '${input.accountId}' is not exposed by this connector connection run.`);
|
|
2185
2247
|
}
|
|
2248
|
+
return this.view(await this.connectRunAccount(run, account, input.replace === true));
|
|
2249
|
+
}
|
|
2250
|
+
async connectRunAccount(run, account, replace) {
|
|
2186
2251
|
let selected;
|
|
2187
2252
|
try {
|
|
2188
2253
|
selected = await this.connectionStorage.putConnectionFromRun({
|
|
2189
2254
|
id: `ccn_${randomUUID5()}`,
|
|
2190
2255
|
projectId: this.projectId,
|
|
2191
|
-
connectorId:
|
|
2256
|
+
connectorId: run.connectorId,
|
|
2192
2257
|
runId: run.id,
|
|
2193
2258
|
account,
|
|
2194
|
-
replace
|
|
2259
|
+
replace
|
|
2195
2260
|
});
|
|
2196
2261
|
} catch (error) {
|
|
2197
2262
|
if (isConnectorStorageError(error, "run_invalid")) {
|
|
2198
|
-
const latest = await this.readRun(
|
|
2263
|
+
const latest = await this.readRun(run.connectorId, run.id);
|
|
2199
2264
|
if (latest)
|
|
2200
2265
|
await this.continueRunCleanup(latest);
|
|
2201
2266
|
throw createConnectorCodedError("connector.operation_conflict", "Connector connection run is no longer waiting for account selection.", { cause: error });
|
|
@@ -2208,13 +2273,42 @@ class ConnectorConnectionRunService {
|
|
|
2208
2273
|
}
|
|
2209
2274
|
throw storageBoundaryError(error, "Connector account selection could not be persisted.");
|
|
2210
2275
|
}
|
|
2211
|
-
const cleanupCompleted = selected.revocationPendingAuthorizationId ? await this.continuePendingRevocation(
|
|
2276
|
+
const cleanupCompleted = selected.revocationPendingAuthorizationId ? await this.continuePendingRevocation(run.connectorId, selected.revocationPendingAuthorizationId) : true;
|
|
2212
2277
|
if (cleanupCompleted) {
|
|
2213
2278
|
this.cancelRunMaintenance(run.id);
|
|
2214
2279
|
} else {
|
|
2215
2280
|
this.scheduleRunMaintenance(selected.run, CLEANUP_RETRY_DELAY_MS);
|
|
2216
2281
|
}
|
|
2217
|
-
return
|
|
2282
|
+
return selected.run;
|
|
2283
|
+
}
|
|
2284
|
+
async connectOnlyAccount(run, account) {
|
|
2285
|
+
try {
|
|
2286
|
+
await this.connectRunAccount(run, account, false);
|
|
2287
|
+
} catch (error) {
|
|
2288
|
+
if (isSixbError2(error) && error.code === "connector.replacement_required")
|
|
2289
|
+
return;
|
|
2290
|
+
console.warn("[Sixb] Connecting the only connector account failed; the user can still select it.", error);
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
async isSuspended(principal) {
|
|
2294
|
+
const users = this.storage.auth?.users;
|
|
2295
|
+
if (principal.type !== "user" || !users)
|
|
2296
|
+
return false;
|
|
2297
|
+
const user = await withConnectorStorageBoundary("The member who started the connector connection could not be read.", () => users.getById({ projectId: this.projectId, id: principal.id }));
|
|
2298
|
+
return user?.status === "suspended";
|
|
2299
|
+
}
|
|
2300
|
+
async revokeIfSuspended(connectorId, authorizationId, principal) {
|
|
2301
|
+
try {
|
|
2302
|
+
if (!await this.isSuspended(principal))
|
|
2303
|
+
return;
|
|
2304
|
+
await this.authorizations.revokeAuthorization({
|
|
2305
|
+
definition: this.resolveDefinition(connectorId),
|
|
2306
|
+
authorizationId,
|
|
2307
|
+
principal
|
|
2308
|
+
});
|
|
2309
|
+
} catch (error) {
|
|
2310
|
+
console.error(`[Sixb] Could not revoke connector grant '${authorizationId}' of a member suspended while connecting. Disconnect it from the connections page to delete its tokens.`, error);
|
|
2311
|
+
}
|
|
2218
2312
|
}
|
|
2219
2313
|
async claimCallback(state, callbackBinding, redirectUri) {
|
|
2220
2314
|
let claimed;
|
|
@@ -2251,6 +2345,9 @@ class ConnectorConnectionRunService {
|
|
|
2251
2345
|
}
|
|
2252
2346
|
async finalizeCompletedRun(run, authorization) {
|
|
2253
2347
|
if (run.kind === "connect") {
|
|
2348
|
+
if (authorization.accounts.length === 0) {
|
|
2349
|
+
throw createConnectorCodedError("connector.not_found", "This authorization does not give access to any account. Sign in with one that has access.");
|
|
2350
|
+
}
|
|
2254
2351
|
if (!authorization.selectionExpiresAt) {
|
|
2255
2352
|
throw createConnectorCodedError("internal.unexpected", "Connector authorization is missing its account-selection deadline.");
|
|
2256
2353
|
}
|
|
@@ -2265,6 +2362,9 @@ class ConnectorConnectionRunService {
|
|
|
2265
2362
|
}));
|
|
2266
2363
|
if (waiting) {
|
|
2267
2364
|
this.scheduleRunMaintenance(waiting, this.selectionTtlMs + 1);
|
|
2365
|
+
const [account, ...others] = authorization.accounts;
|
|
2366
|
+
if (account && others.length === 0)
|
|
2367
|
+
await this.connectOnlyAccount(waiting, account);
|
|
2268
2368
|
return waiting;
|
|
2269
2369
|
}
|
|
2270
2370
|
} else {
|
|
@@ -2471,6 +2571,7 @@ class ConnectorConnectionService {
|
|
|
2471
2571
|
definitionsById;
|
|
2472
2572
|
abortController = new AbortController;
|
|
2473
2573
|
connectionStorage;
|
|
2574
|
+
users;
|
|
2474
2575
|
providerOperationTimeoutMs;
|
|
2475
2576
|
authorizations;
|
|
2476
2577
|
requests;
|
|
@@ -2481,6 +2582,7 @@ class ConnectorConnectionService {
|
|
|
2481
2582
|
this.definitionsById = new Map(definitions.map((definition) => [definition.id, definition]));
|
|
2482
2583
|
const storage = requireConnectionStorage(options.storage);
|
|
2483
2584
|
this.connectionStorage = storage.connectorConnections;
|
|
2585
|
+
this.users = storage.root.auth?.users;
|
|
2484
2586
|
const credentialProtector = credentialProtectorFor(storage.connectorConnections, options);
|
|
2485
2587
|
const resolveDefinition = (connectorId) => this.requireOAuthDefinition(connectorId);
|
|
2486
2588
|
const hostSignal = () => this.abortController.signal;
|
|
@@ -2533,9 +2635,13 @@ class ConnectorConnectionService {
|
|
|
2533
2635
|
...selector
|
|
2534
2636
|
}));
|
|
2535
2637
|
if (!connection) {
|
|
2536
|
-
throw createConnectorCodedError("connector.not_found", `Connector '${definition.id}' has no connection for project slot '${selector.slot}'.`);
|
|
2638
|
+
throw createConnectorCodedError("connector.not_found", selector.owner.type === "user" ? `Connector '${definition.id}' has no connection for user '${selector.owner.id}' in slot '${selector.slot}'.` : `Connector '${definition.id}' has no connection for project slot '${selector.slot}'.`);
|
|
2639
|
+
}
|
|
2640
|
+
const [readable] = await this.withoutSuspendedOwners([connection]);
|
|
2641
|
+
if (!readable) {
|
|
2642
|
+
throw createConnectorCodedError("connector.not_found", `Connector '${definition.id}' does not open the connections of a suspended member.`);
|
|
2537
2643
|
}
|
|
2538
|
-
return this.connectExecutionConnection(definition,
|
|
2644
|
+
return this.connectExecutionConnection(definition, readable);
|
|
2539
2645
|
}
|
|
2540
2646
|
async listExecutionConnections(definition) {
|
|
2541
2647
|
this.assertOAuthRegistered(definition);
|
|
@@ -2543,7 +2649,39 @@ class ConnectorConnectionService {
|
|
|
2543
2649
|
projectId: this.projectId,
|
|
2544
2650
|
connectorId: definition.id
|
|
2545
2651
|
}));
|
|
2546
|
-
|
|
2652
|
+
const connected = connections.filter((connection) => connection.status === "connected");
|
|
2653
|
+
const readable = await this.withoutSuspendedOwners(connected);
|
|
2654
|
+
return [...readable].sort((left, right) => left.id.localeCompare(right.id));
|
|
2655
|
+
}
|
|
2656
|
+
async revokeUserConnections(userId) {
|
|
2657
|
+
const principal = { type: "user", id: nonblank(userId, "user id") };
|
|
2658
|
+
const failures = [];
|
|
2659
|
+
for (const definition of this.definitionsById.values()) {
|
|
2660
|
+
if (!isOAuthConnectorDefinition2(definition))
|
|
2661
|
+
continue;
|
|
2662
|
+
if (!connectorConnectionOwners(definition).includes("user"))
|
|
2663
|
+
continue;
|
|
2664
|
+
const connections = await withConnectorStorageBoundary("Connector connections could not be listed.", () => this.connectionStorage.listConnections({
|
|
2665
|
+
projectId: this.projectId,
|
|
2666
|
+
connectorId: definition.id
|
|
2667
|
+
}));
|
|
2668
|
+
const authorizationIds = new Set(connections.filter(({ owner }) => owner.type === "user" && owner.id === principal.id).map((connection) => connection.authorizationId));
|
|
2669
|
+
for (const authorizationId of authorizationIds) {
|
|
2670
|
+
try {
|
|
2671
|
+
await this.authorizations.revokeAuthorization({ definition, authorizationId, principal });
|
|
2672
|
+
} catch (error) {
|
|
2673
|
+
failures.push(error);
|
|
2674
|
+
}
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
if (failures.length > 0) {
|
|
2678
|
+
throw new AggregateError(failures, `[Sixb] ${failures.length} connector grants of user '${principal.id}' could not be revoked.`);
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
async assertExecutionConnectionUsable(definition, connection) {
|
|
2682
|
+
this.assertOAuthRegistered(definition);
|
|
2683
|
+
const authorization = await this.authorizations.requireStableActiveAuthorization(definition, connection.authorizationId);
|
|
2684
|
+
await this.authorizations.createTokenSource(definition, authorization.id, connection.account).get();
|
|
2547
2685
|
}
|
|
2548
2686
|
async connectExecutionConnection(definition, connection, signal = this.abortController.signal) {
|
|
2549
2687
|
this.assertOAuthRegistered(definition);
|
|
@@ -2575,14 +2713,13 @@ class ConnectorConnectionService {
|
|
|
2575
2713
|
}
|
|
2576
2714
|
}
|
|
2577
2715
|
async listConnections(command, connectorId) {
|
|
2578
|
-
const definition = this.
|
|
2579
|
-
requireConnectorConnectionCommandActor(command.execution, this.projectId);
|
|
2716
|
+
const { definition, actor } = this.commandAccess(command, connectorId);
|
|
2580
2717
|
let connections;
|
|
2581
2718
|
try {
|
|
2582
|
-
connections = await this.connectionStorage.listConnections({
|
|
2719
|
+
connections = (await this.connectionStorage.listConnections({
|
|
2583
2720
|
projectId: this.projectId,
|
|
2584
2721
|
connectorId: definition.id
|
|
2585
|
-
});
|
|
2722
|
+
})).filter((connection) => canSeeConnectorConnection(command, actor, connection));
|
|
2586
2723
|
} catch (error) {
|
|
2587
2724
|
throw storageBoundaryError(error, "Connector connections could not be listed.");
|
|
2588
2725
|
}
|
|
@@ -2599,12 +2736,11 @@ class ConnectorConnectionService {
|
|
|
2599
2736
|
})));
|
|
2600
2737
|
}
|
|
2601
2738
|
startConnectionRun(command, connectorId, input) {
|
|
2739
|
+
this.selectorAccess(command, connectorId, input);
|
|
2602
2740
|
return this.runs.start(command, connectorId, input);
|
|
2603
2741
|
}
|
|
2604
2742
|
async addConnection(command, connectorId, input) {
|
|
2605
|
-
const definition = this.
|
|
2606
|
-
const actor = requireConnectorConnectionCommandActor(command.execution, this.projectId);
|
|
2607
|
-
assertConnectorConnectionSelector(input);
|
|
2743
|
+
const { definition, actor } = this.selectorAccess(command, connectorId, input);
|
|
2608
2744
|
const source = await withConnectorStorageBoundary("Source connector connection could not be read.", () => this.connectionStorage.getConnectionById({
|
|
2609
2745
|
projectId: this.projectId,
|
|
2610
2746
|
connectorId: definition.id,
|
|
@@ -2618,6 +2754,7 @@ class ConnectorConnectionService {
|
|
|
2618
2754
|
}
|
|
2619
2755
|
const authorization = await this.authorizations.requireStableActiveAuthorization(definition, source.authorizationId);
|
|
2620
2756
|
assertConnectorAuthorizationActor(authorization, actor.principal);
|
|
2757
|
+
await this.assertAuthorizationOwner(definition, authorization.id, input.owner);
|
|
2621
2758
|
return this.runs.startSelection(command, definition.id, {
|
|
2622
2759
|
owner: input.owner,
|
|
2623
2760
|
slot: input.slot,
|
|
@@ -2625,27 +2762,21 @@ class ConnectorConnectionService {
|
|
|
2625
2762
|
});
|
|
2626
2763
|
}
|
|
2627
2764
|
listPendingConnectionRuns(command, connectorId) {
|
|
2628
|
-
this.
|
|
2765
|
+
this.commandAccess(command, connectorId);
|
|
2629
2766
|
return this.runs.listPending(command, connectorId);
|
|
2630
2767
|
}
|
|
2631
2768
|
getConnectionRun(command, connectorId, runId) {
|
|
2632
|
-
this.
|
|
2769
|
+
this.commandAccess(command, connectorId);
|
|
2633
2770
|
return this.runs.get(command, connectorId, runId);
|
|
2634
2771
|
}
|
|
2635
2772
|
selectConnectionRunAccount(command, connectorId, input) {
|
|
2773
|
+
this.commandAccess(command, connectorId);
|
|
2636
2774
|
return this.runs.selectAccount(command, connectorId, input);
|
|
2637
2775
|
}
|
|
2638
2776
|
async startReauthorization(command, connectorId, connectionId, input) {
|
|
2639
|
-
const definition = this.
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
projectId: this.projectId,
|
|
2643
|
-
connectorId: definition.id,
|
|
2644
|
-
connectionId: nonblank(connectionId, "connection id")
|
|
2645
|
-
}));
|
|
2646
|
-
if (!connection) {
|
|
2647
|
-
throw createConnectorCodedError("connector.not_found", "Connector connection was not found.");
|
|
2648
|
-
}
|
|
2777
|
+
const { definition, actor } = this.commandAccess(command, connectorId);
|
|
2778
|
+
const connection = await this.requireVisibleConnection(command, actor, definition, connectionId);
|
|
2779
|
+
assertConnectorConnectionSelectorAccess(definition, command, actor, connection);
|
|
2649
2780
|
if (connection.status !== "connected") {
|
|
2650
2781
|
throw createConnectorCodedError("connector.authorization_required", "Disconnected connector connections cannot be reauthorized; start a new connection.");
|
|
2651
2782
|
}
|
|
@@ -2658,8 +2789,8 @@ class ConnectorConnectionService {
|
|
|
2658
2789
|
});
|
|
2659
2790
|
}
|
|
2660
2791
|
async revokeConnection(command, connectorId, connectionId) {
|
|
2661
|
-
const definition = this.
|
|
2662
|
-
|
|
2792
|
+
const { definition, actor } = this.commandAccess(command, connectorId);
|
|
2793
|
+
await this.requireVisibleConnection(command, actor, definition, connectionId);
|
|
2663
2794
|
const authorization = await withConnectorStorageBoundary("Connector authorization could not be resolved from its connection.", () => this.connectionStorage.getAuthorizationByConnectionId({
|
|
2664
2795
|
projectId: this.projectId,
|
|
2665
2796
|
connectorId: definition.id,
|
|
@@ -2674,20 +2805,21 @@ class ConnectorConnectionService {
|
|
|
2674
2805
|
return this.runs.complete(input);
|
|
2675
2806
|
}
|
|
2676
2807
|
startAuthorization(command, connectorId, input) {
|
|
2808
|
+
this.selectorAccess(command, connectorId, input);
|
|
2677
2809
|
return this.requests.startAuthorization(command, connectorId, input);
|
|
2678
2810
|
}
|
|
2679
2811
|
completeAuthorization(command, connectorId, input) {
|
|
2812
|
+
this.commandAccess(command, connectorId);
|
|
2680
2813
|
return this.requests.completeAuthorization(command, connectorId, input);
|
|
2681
2814
|
}
|
|
2682
2815
|
async selectAccount(command, connectorId, input) {
|
|
2683
|
-
const definition = this.
|
|
2684
|
-
const actor = requireConnectorConnectionCommandActor(command.execution, this.projectId);
|
|
2685
|
-
assertConnectorConnectionSelector(input);
|
|
2816
|
+
const { definition, actor } = this.selectorAccess(command, connectorId, input);
|
|
2686
2817
|
const authorization = await this.authorizations.requireAuthorization(definition.id, input.authorizationId);
|
|
2687
2818
|
if (authorization.status !== "pending_selection" && authorization.status !== "active") {
|
|
2688
2819
|
throw connectorAuthorizationStatusError(authorization.status);
|
|
2689
2820
|
}
|
|
2690
2821
|
assertConnectorAuthorizationActor(authorization, actor.principal);
|
|
2822
|
+
await this.assertAuthorizationOwner(definition, authorization.id, input.owner);
|
|
2691
2823
|
const account = authorization.accounts.find((candidate) => candidate.id === input.accountId);
|
|
2692
2824
|
if (!account) {
|
|
2693
2825
|
throw createConnectorCodedError("connector.not_found", `Account '${input.accountId}' is not exposed by this connector authorization.`);
|
|
@@ -2719,10 +2851,26 @@ class ConnectorConnectionService {
|
|
|
2719
2851
|
}
|
|
2720
2852
|
return connectorConnectionView(result.connection, result.authorization.status);
|
|
2721
2853
|
}
|
|
2854
|
+
async assertAuthorizationOwner(definition, authorizationId, owner) {
|
|
2855
|
+
const connections = await withConnectorStorageBoundary("Connector connections could not be read from their authorization.", () => this.connectionStorage.listConnectionsByAuthorization({
|
|
2856
|
+
projectId: this.projectId,
|
|
2857
|
+
connectorId: definition.id,
|
|
2858
|
+
authorizationId
|
|
2859
|
+
}));
|
|
2860
|
+
if (connections.some((connection) => !sameConnectorConnectionOwner(connection.owner, owner))) {
|
|
2861
|
+
throw createConnectorCodedError("connector.operation_conflict", "This account is connected for another owner; connect it again for this one.");
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2722
2864
|
async disconnect(command, connectorId, connectionId) {
|
|
2723
|
-
const definition = this.
|
|
2724
|
-
requireConnectorConnectionCommandActor(command.execution, this.projectId);
|
|
2865
|
+
const { definition, actor } = this.commandAccess(command, connectorId);
|
|
2725
2866
|
const normalizedConnectionId = nonblank(connectionId, "connection id");
|
|
2867
|
+
const connection = await withConnectorStorageBoundary("Connector connection could not be read.", () => this.connectionStorage.getConnectionById({
|
|
2868
|
+
projectId: this.projectId,
|
|
2869
|
+
connectorId: definition.id,
|
|
2870
|
+
connectionId: normalizedConnectionId
|
|
2871
|
+
}));
|
|
2872
|
+
if (!connection || !canSeeConnectorConnection(command, actor, connection))
|
|
2873
|
+
return null;
|
|
2726
2874
|
try {
|
|
2727
2875
|
const disconnected = await this.connectionStorage.disconnectConnection({
|
|
2728
2876
|
projectId: this.projectId,
|
|
@@ -2743,8 +2891,7 @@ class ConnectorConnectionService {
|
|
|
2743
2891
|
}
|
|
2744
2892
|
}
|
|
2745
2893
|
async revokeAuthorization(command, connectorId, authorizationId) {
|
|
2746
|
-
const definition = this.
|
|
2747
|
-
const actor = requireConnectorConnectionCommandActor(command.execution, this.projectId);
|
|
2894
|
+
const { definition, actor } = this.commandAccess(command, connectorId);
|
|
2748
2895
|
const revoked = await this.authorizations.revokeAuthorization({
|
|
2749
2896
|
definition,
|
|
2750
2897
|
authorizationId: nonblank(authorizationId, "authorization id", "connector.authorization_invalid"),
|
|
@@ -2765,6 +2912,39 @@ class ConnectorConnectionService {
|
|
|
2765
2912
|
throw createConnectorCodedError("connector.configuration_invalid", `Connector '${definition.id}' is not the registered definition instance.`);
|
|
2766
2913
|
}
|
|
2767
2914
|
}
|
|
2915
|
+
commandAccess(command, connectorId) {
|
|
2916
|
+
const definition = this.requireOAuthDefinition(connectorId);
|
|
2917
|
+
const actor = requireConnectorConnectionCommandActor(command.execution, this.projectId);
|
|
2918
|
+
assertConnectorConnectionCommandAccess(definition, command);
|
|
2919
|
+
return { definition, actor };
|
|
2920
|
+
}
|
|
2921
|
+
selectorAccess(command, connectorId, selector) {
|
|
2922
|
+
const access = this.commandAccess(command, connectorId);
|
|
2923
|
+
assertConnectorConnectionSelector(selector);
|
|
2924
|
+
assertConnectorConnectionSelectorAccess(access.definition, command, access.actor, selector);
|
|
2925
|
+
return access;
|
|
2926
|
+
}
|
|
2927
|
+
async withoutSuspendedOwners(connections) {
|
|
2928
|
+
const ownerIds = [
|
|
2929
|
+
...new Set(connections.flatMap(({ owner }) => owner.type === "user" ? [owner.id] : []))
|
|
2930
|
+
];
|
|
2931
|
+
if (ownerIds.length === 0 || !this.users)
|
|
2932
|
+
return connections;
|
|
2933
|
+
const users = await this.users.getByIds({ projectId: this.projectId, ids: ownerIds });
|
|
2934
|
+
const active = new Set(users.filter((user) => user.status === "active").map((user) => user.id));
|
|
2935
|
+
return connections.filter(({ owner }) => owner.type === "project" || active.has(owner.id));
|
|
2936
|
+
}
|
|
2937
|
+
async requireVisibleConnection(command, actor, definition, connectionId) {
|
|
2938
|
+
const connection = await withConnectorStorageBoundary("Connector connection could not be read.", () => this.connectionStorage.getConnectionById({
|
|
2939
|
+
projectId: this.projectId,
|
|
2940
|
+
connectorId: definition.id,
|
|
2941
|
+
connectionId: nonblank(connectionId, "connection id")
|
|
2942
|
+
}));
|
|
2943
|
+
if (!connection || !canSeeConnectorConnection(command, actor, connection)) {
|
|
2944
|
+
throw createConnectorCodedError("connector.not_found", "Connector connection was not found.");
|
|
2945
|
+
}
|
|
2946
|
+
return connection;
|
|
2947
|
+
}
|
|
2768
2948
|
requireOAuthDefinition(connectorId) {
|
|
2769
2949
|
const definition = this.definitionsById.get(nonblank(connectorId, "connector id"));
|
|
2770
2950
|
if (!definition) {
|
|
@@ -2859,6 +3039,12 @@ class ConnectorService {
|
|
|
2859
3039
|
listExecutionConnections(definition) {
|
|
2860
3040
|
return this.requireConnections().listExecutionConnections(definition);
|
|
2861
3041
|
}
|
|
3042
|
+
async revokeUserConnections(userId) {
|
|
3043
|
+
await this.connections?.revokeUserConnections(userId);
|
|
3044
|
+
}
|
|
3045
|
+
assertExecutionConnectionUsable(definition, connection) {
|
|
3046
|
+
return this.requireConnections().assertExecutionConnectionUsable(definition, connection);
|
|
3047
|
+
}
|
|
2862
3048
|
connectExecutionConnection(definition, connection, signal) {
|
|
2863
3049
|
return this.requireConnections().connectExecutionConnection(definition, connection, signal);
|
|
2864
3050
|
}
|
|
@@ -2901,13 +3087,31 @@ class ConnectorService {
|
|
|
2901
3087
|
}
|
|
2902
3088
|
}
|
|
2903
3089
|
|
|
3090
|
+
// src/maintenance/heartbeat.ts
|
|
3091
|
+
function storageHeartbeat(projectId, owner, storage) {
|
|
3092
|
+
const heartbeats = storage.maintenanceHeartbeats;
|
|
3093
|
+
if (!heartbeats)
|
|
3094
|
+
return;
|
|
3095
|
+
return { write: (beat) => heartbeats.record({ ...beat, projectId, owner }) };
|
|
3096
|
+
}
|
|
3097
|
+
|
|
3098
|
+
// src/maintenance/passes/ontology-pass.ts
|
|
3099
|
+
var PASS_BUDGET_MS = 5 * 60000;
|
|
3100
|
+
function ontologyPass(maintenance) {
|
|
3101
|
+
return everyMs({
|
|
3102
|
+
id: "ontology",
|
|
3103
|
+
intervalMs: maintenance.intervalMs,
|
|
3104
|
+
budgetMs: PASS_BUDGET_MS,
|
|
3105
|
+
run: (signal) => maintenance.runPass(signal)
|
|
3106
|
+
});
|
|
3107
|
+
}
|
|
3108
|
+
|
|
2904
3109
|
// src/maintenance/ontology-maintenance.ts
|
|
2905
3110
|
var DEFAULT_INTERVAL_MS = 60000;
|
|
2906
3111
|
var DEFAULT_RETENTION_MS = 24 * 60 * 60000;
|
|
2907
3112
|
var DEFAULT_CLEANUP_LIMIT = 1000;
|
|
2908
3113
|
var DEFAULT_SHUTDOWN_TIMEOUT_MS = 30000;
|
|
2909
|
-
var
|
|
2910
|
-
var DEGRADED_FAILURE_THRESHOLD = 2;
|
|
3114
|
+
var PENDING_LIMIT_INTERVALS = 2;
|
|
2911
3115
|
var ABANDONED_UPLOAD_SWEEP_DELAY_MS = 5 * 60000;
|
|
2912
3116
|
var ABANDONED_UPLOAD_ABORT_GRACE_MS = 15 * 60000;
|
|
2913
3117
|
var ABANDONED_SOURCE_PURGE_BATCH = 50000;
|
|
@@ -2923,14 +3127,10 @@ class OntologyMaintenance {
|
|
|
2923
3127
|
publishedOutboxRetentionMs;
|
|
2924
3128
|
terminalSourceRetentionMs;
|
|
2925
3129
|
cleanupLimit;
|
|
2926
|
-
shutdownTimeoutMs;
|
|
2927
3130
|
now;
|
|
2928
|
-
onError;
|
|
2929
3131
|
owners = new Set;
|
|
2930
|
-
|
|
2931
|
-
pass = null;
|
|
3132
|
+
loop;
|
|
2932
3133
|
stopping = null;
|
|
2933
|
-
snapshot;
|
|
2934
3134
|
constructor(dependencies) {
|
|
2935
3135
|
assertNonblank2(dependencies.projectId, "projectId");
|
|
2936
3136
|
const options = dependencies.options ?? {};
|
|
@@ -2943,10 +3143,14 @@ class OntologyMaintenance {
|
|
|
2943
3143
|
this.publishedOutboxRetentionMs = nonnegativeInteger(options.publishedOutboxRetentionMs ?? DEFAULT_RETENTION_MS, "publishedOutboxRetentionMs");
|
|
2944
3144
|
this.terminalSourceRetentionMs = nonnegativeInteger(options.terminalSourceRetentionMs ?? DEFAULT_RETENTION_MS, "terminalSourceRetentionMs");
|
|
2945
3145
|
this.cleanupLimit = positiveInteger(options.cleanupLimit ?? DEFAULT_CLEANUP_LIMIT, "cleanupLimit");
|
|
2946
|
-
this.shutdownTimeoutMs = nonnegativeInteger(options.shutdownTimeoutMs ?? DEFAULT_SHUTDOWN_TIMEOUT_MS, "shutdownTimeoutMs");
|
|
2947
3146
|
this.now = dependencies.now ?? (() => new Date);
|
|
2948
|
-
this.
|
|
2949
|
-
|
|
3147
|
+
this.loop = new MaintenanceLoop({
|
|
3148
|
+
passes: [ontologyPass(this)],
|
|
3149
|
+
heartbeat: storageHeartbeat(this.projectId, "embedded", this.storage),
|
|
3150
|
+
onError: dependencies.onError ?? ((error) => console.error("[Sixb] Ontology maintenance error:", error)),
|
|
3151
|
+
now: this.now,
|
|
3152
|
+
shutdownTimeoutMs: nonnegativeInteger(options.shutdownTimeoutMs ?? DEFAULT_SHUTDOWN_TIMEOUT_MS, "shutdownTimeoutMs")
|
|
3153
|
+
});
|
|
2950
3154
|
}
|
|
2951
3155
|
async start() {
|
|
2952
3156
|
if (this.stopping)
|
|
@@ -2955,7 +3159,7 @@ class OntologyMaintenance {
|
|
|
2955
3159
|
const startsHosting = this.owners.size === 0;
|
|
2956
3160
|
this.owners.add(owner);
|
|
2957
3161
|
if (startsHosting)
|
|
2958
|
-
this.
|
|
3162
|
+
this.loop.start();
|
|
2959
3163
|
let released = false;
|
|
2960
3164
|
return {
|
|
2961
3165
|
stop: async () => {
|
|
@@ -2969,62 +3173,51 @@ class OntologyMaintenance {
|
|
|
2969
3173
|
};
|
|
2970
3174
|
}
|
|
2971
3175
|
runNow() {
|
|
2972
|
-
|
|
2973
|
-
return this.stopping;
|
|
2974
|
-
this.pass ??= this.runPass().finally(() => {
|
|
2975
|
-
this.pass = null;
|
|
2976
|
-
});
|
|
2977
|
-
return this.pass;
|
|
3176
|
+
return this.loop.runNow();
|
|
2978
3177
|
}
|
|
2979
3178
|
async stop() {
|
|
2980
3179
|
this.owners.clear();
|
|
2981
3180
|
await this.stopLoop();
|
|
2982
3181
|
}
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
startHostedPass() {
|
|
2997
|
-
this.runNow().catch((error) => this.reportError(error)).finally(() => this.scheduleNextPass());
|
|
2998
|
-
}
|
|
2999
|
-
async runPass() {
|
|
3000
|
-
const started = this.now();
|
|
3001
|
-
this.snapshot = { ...this.snapshot, running: true, lastStartedAt: started.toISOString() };
|
|
3182
|
+
async getOperationalStatus() {
|
|
3183
|
+
const [outbox, heartbeats] = await Promise.all([
|
|
3184
|
+
this.storage.ontology.outbox.summarize({ projectId: this.projectId }),
|
|
3185
|
+
this.storage.maintenanceHeartbeats?.list({ projectId: this.projectId }) ?? []
|
|
3186
|
+
]);
|
|
3187
|
+
return operationalStatus({
|
|
3188
|
+
heartbeats,
|
|
3189
|
+
outbox,
|
|
3190
|
+
pendingLimitMs: this.intervalMs * PENDING_LIMIT_INTERVALS,
|
|
3191
|
+
now: this.now()
|
|
3192
|
+
});
|
|
3193
|
+
}
|
|
3194
|
+
async runPass(signal) {
|
|
3002
3195
|
const failures = [];
|
|
3003
3196
|
await captureFailure(() => this.dispatcher.drain(), failures);
|
|
3004
3197
|
const vectorIndexing = this.vectorIndexing;
|
|
3005
3198
|
if (vectorIndexing)
|
|
3006
3199
|
await captureFailure(() => vectorIndexing.drain(), failures);
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3200
|
+
await this.cleanupExpiredRows(this.now(), failures, signal);
|
|
3201
|
+
if (failures.length > 0)
|
|
3202
|
+
throw new AggregateError(failures, "Maintenance pass failed.");
|
|
3010
3203
|
}
|
|
3011
|
-
async cleanupExpiredRows(started, failures) {
|
|
3012
|
-
|
|
3204
|
+
async cleanupExpiredRows(started, failures, signal) {
|
|
3205
|
+
await captureFailure(() => this.storage.ontology.outbox.purgePublished({
|
|
3013
3206
|
projectId: this.projectId,
|
|
3014
3207
|
publishedBefore: new Date(started.getTime() - this.publishedOutboxRetentionMs).toISOString(),
|
|
3015
3208
|
limit: this.cleanupLimit
|
|
3016
|
-
}), failures
|
|
3017
|
-
|
|
3018
|
-
|
|
3209
|
+
}), failures);
|
|
3210
|
+
await captureFailure(() => this.purgeSpentPlans(started, signal), failures);
|
|
3211
|
+
await captureFailure(() => this.storage.ontology.sources.cleanupTerminal({
|
|
3019
3212
|
projectId: this.projectId,
|
|
3020
3213
|
terminalBefore: new Date(started.getTime() - this.terminalSourceRetentionMs).toISOString(),
|
|
3021
3214
|
limit: this.cleanupLimit
|
|
3022
|
-
}), failures
|
|
3023
|
-
|
|
3215
|
+
}), failures);
|
|
3216
|
+
await captureFailure(() => this.purgeAbandonedSources(started, signal), failures);
|
|
3024
3217
|
const uploads = this.storage.fileUploadSessions;
|
|
3025
3218
|
if (uploads) {
|
|
3026
3219
|
await captureFailure(() => this.retireAbandonedUploads(uploads, started, failures), failures);
|
|
3027
|
-
await captureFailure(() => uploads.cleanupExpired(started), failures
|
|
3220
|
+
await captureFailure(() => uploads.cleanupExpired(started), failures);
|
|
3028
3221
|
}
|
|
3029
3222
|
const downloads = this.storage.fileDownloadGrants;
|
|
3030
3223
|
if (downloads) {
|
|
@@ -3032,7 +3225,7 @@ class OntologyMaintenance {
|
|
|
3032
3225
|
projectId: this.projectId,
|
|
3033
3226
|
expiredBefore: new Date(started.getTime() - EXPIRED_FILE_DOWNLOAD_RETENTION_MS),
|
|
3034
3227
|
limit: this.cleanupLimit
|
|
3035
|
-
}), failures
|
|
3228
|
+
}), failures);
|
|
3036
3229
|
}
|
|
3037
3230
|
const artifacts = this.storage.artifacts;
|
|
3038
3231
|
if (artifacts) {
|
|
@@ -3040,43 +3233,34 @@ class OntologyMaintenance {
|
|
|
3040
3233
|
projectId: this.projectId,
|
|
3041
3234
|
expiredBefore: started,
|
|
3042
3235
|
limit: this.cleanupLimit
|
|
3043
|
-
}), failures
|
|
3236
|
+
}), failures);
|
|
3044
3237
|
}
|
|
3045
|
-
return {
|
|
3046
|
-
publishedOutboxRowsDeleted,
|
|
3047
|
-
terminalSourceRowsDeleted: terminalSources.rowsDeleted + abandonedSources.rowsDeleted + spentPlanRows,
|
|
3048
|
-
terminalSourceMaterializationsDeleted: terminalSources.materializationsDeleted + abandonedSources.materializationsDeleted
|
|
3049
|
-
};
|
|
3050
3238
|
}
|
|
3051
|
-
async purgeAbandonedSources(started) {
|
|
3052
|
-
let rowsDeleted = 0;
|
|
3053
|
-
let materializationsDeleted = 0;
|
|
3239
|
+
async purgeAbandonedSources(started, signal) {
|
|
3054
3240
|
while (true) {
|
|
3055
3241
|
const purged = await this.storage.ontology.sources.purgeAbandoned({
|
|
3056
3242
|
projectId: this.projectId,
|
|
3057
3243
|
limit: ABANDONED_SOURCE_PURGE_BATCH
|
|
3058
3244
|
});
|
|
3059
|
-
rowsDeleted += purged.rowsDeleted;
|
|
3060
|
-
materializationsDeleted += purged.materializationsDeleted;
|
|
3061
3245
|
const exhausted = purged.rowsDeleted + purged.materializationsDeleted < ABANDONED_SOURCE_PURGE_BATCH;
|
|
3062
|
-
if (exhausted || this.
|
|
3063
|
-
return
|
|
3064
|
-
}
|
|
3246
|
+
if (exhausted || this.passedInterval(started) || signal.aborted)
|
|
3247
|
+
return;
|
|
3065
3248
|
}
|
|
3066
3249
|
}
|
|
3067
|
-
async purgeSpentPlans(started) {
|
|
3068
|
-
let rowsDeleted = 0;
|
|
3250
|
+
async purgeSpentPlans(started, signal) {
|
|
3069
3251
|
while (true) {
|
|
3070
3252
|
const purged = await this.storage.ontology.replacementPlans.purge({
|
|
3071
3253
|
projectId: this.projectId,
|
|
3072
3254
|
limit: ABANDONED_SOURCE_PURGE_BATCH
|
|
3073
3255
|
});
|
|
3074
|
-
|
|
3075
|
-
if (
|
|
3076
|
-
return
|
|
3077
|
-
}
|
|
3256
|
+
const exhausted = purged < ABANDONED_SOURCE_PURGE_BATCH;
|
|
3257
|
+
if (exhausted || this.passedInterval(started) || signal.aborted)
|
|
3258
|
+
return;
|
|
3078
3259
|
}
|
|
3079
3260
|
}
|
|
3261
|
+
passedInterval(started) {
|
|
3262
|
+
return this.now().getTime() - started.getTime() >= this.intervalMs;
|
|
3263
|
+
}
|
|
3080
3264
|
async retireAbandonedUploads(uploads, now, failures) {
|
|
3081
3265
|
const abandoned = await uploads.listAbandoned({
|
|
3082
3266
|
projectId: this.projectId,
|
|
@@ -3114,71 +3298,14 @@ class OntologyMaintenance {
|
|
|
3114
3298
|
if (abortFailure !== undefined)
|
|
3115
3299
|
throw abortFailure;
|
|
3116
3300
|
}
|
|
3117
|
-
completePass(input) {
|
|
3118
|
-
const completed = this.now();
|
|
3119
|
-
const failure = input.failures.length > 0 ? new AggregateError(input.failures, "Maintenance pass failed.") : null;
|
|
3120
|
-
this.snapshot = {
|
|
3121
|
-
running: false,
|
|
3122
|
-
intervalMs: this.intervalMs,
|
|
3123
|
-
lastStartedAt: input.started.toISOString(),
|
|
3124
|
-
lastCompletedAt: completed.toISOString(),
|
|
3125
|
-
lastDurationMs: Math.max(0, completed.getTime() - input.started.getTime()),
|
|
3126
|
-
consecutiveFailures: failure ? this.snapshot.consecutiveFailures + 1 : 0,
|
|
3127
|
-
lastError: failure ? errorMessage2(failure) : null,
|
|
3128
|
-
outbox: input.outbox,
|
|
3129
|
-
cleanup: input.cleanup
|
|
3130
|
-
};
|
|
3131
|
-
if (failure)
|
|
3132
|
-
this.reportError(failure);
|
|
3133
|
-
}
|
|
3134
|
-
scheduleNextPass() {
|
|
3135
|
-
if (this.owners.size === 0 || this.timer !== null)
|
|
3136
|
-
return;
|
|
3137
|
-
this.timer = setTimeout(() => {
|
|
3138
|
-
this.timer = null;
|
|
3139
|
-
if (this.owners.size === 0)
|
|
3140
|
-
return;
|
|
3141
|
-
this.runNow().catch((error) => this.reportError(error)).finally(() => this.scheduleNextPass());
|
|
3142
|
-
}, this.intervalMs);
|
|
3143
|
-
this.timer.unref?.();
|
|
3144
|
-
}
|
|
3145
3301
|
stopLoop() {
|
|
3146
3302
|
if (this.stopping)
|
|
3147
3303
|
return this.stopping;
|
|
3148
|
-
|
|
3149
|
-
clearTimeout(this.timer);
|
|
3150
|
-
this.timer = null;
|
|
3151
|
-
}
|
|
3152
|
-
const activePass = this.pass ?? Promise.resolve();
|
|
3153
|
-
const stopping = settlesWithin(activePass, this.shutdownTimeoutMs).then(async (settled) => {
|
|
3154
|
-
if (!settled) {
|
|
3155
|
-
this.reportError(new Error(`[Sixb] Ontology maintenance is still stopping after ${this.shutdownTimeoutMs}ms; waiting for active storage operations.`));
|
|
3156
|
-
}
|
|
3157
|
-
await activePass;
|
|
3158
|
-
});
|
|
3159
|
-
this.stopping = stopping.finally(() => {
|
|
3304
|
+
this.stopping = this.loop.stop().finally(() => {
|
|
3160
3305
|
this.stopping = null;
|
|
3161
3306
|
});
|
|
3162
3307
|
return this.stopping;
|
|
3163
3308
|
}
|
|
3164
|
-
reportError(error) {
|
|
3165
|
-
try {
|
|
3166
|
-
this.onError(error);
|
|
3167
|
-
} catch {}
|
|
3168
|
-
}
|
|
3169
|
-
}
|
|
3170
|
-
function emptySnapshot(intervalMs) {
|
|
3171
|
-
return {
|
|
3172
|
-
running: false,
|
|
3173
|
-
intervalMs,
|
|
3174
|
-
lastStartedAt: null,
|
|
3175
|
-
lastCompletedAt: null,
|
|
3176
|
-
lastDurationMs: null,
|
|
3177
|
-
consecutiveFailures: 0,
|
|
3178
|
-
lastError: null,
|
|
3179
|
-
outbox: null,
|
|
3180
|
-
cleanup: null
|
|
3181
|
-
};
|
|
3182
3309
|
}
|
|
3183
3310
|
function positiveInteger(value, name) {
|
|
3184
3311
|
if (!Number.isSafeInteger(value) || value <= 0) {
|
|
@@ -3197,41 +3324,136 @@ function assertNonblank2(value, name) {
|
|
|
3197
3324
|
throw new Error(`[Sixb] Ontology maintenance ${name} must not be blank.`);
|
|
3198
3325
|
}
|
|
3199
3326
|
}
|
|
3200
|
-
function
|
|
3201
|
-
if (error instanceof AggregateError) {
|
|
3202
|
-
return [...error.errors].map(errorMessage2).join(" | ").slice(0, 2000);
|
|
3203
|
-
}
|
|
3204
|
-
const message = error instanceof Error ? `${error.name}: ${error.message}` : String(error);
|
|
3205
|
-
return message.slice(0, 2000);
|
|
3206
|
-
}
|
|
3207
|
-
function latestTimestamp(left, right) {
|
|
3208
|
-
if (left === null)
|
|
3209
|
-
return right;
|
|
3210
|
-
if (right === null)
|
|
3211
|
-
return left;
|
|
3212
|
-
return Date.parse(left) >= Date.parse(right) ? left : right;
|
|
3213
|
-
}
|
|
3214
|
-
async function settlesWithin(promise, timeoutMs) {
|
|
3215
|
-
let timer;
|
|
3216
|
-
const timedOut = new Promise((resolve) => {
|
|
3217
|
-
timer = setTimeout(() => resolve(false), timeoutMs);
|
|
3218
|
-
});
|
|
3219
|
-
const result = await Promise.race([
|
|
3220
|
-
promise.then(() => true, () => true),
|
|
3221
|
-
timedOut
|
|
3222
|
-
]);
|
|
3223
|
-
if (timer !== undefined)
|
|
3224
|
-
clearTimeout(timer);
|
|
3225
|
-
return result;
|
|
3226
|
-
}
|
|
3227
|
-
async function captureFailure(run, failures, fallback) {
|
|
3327
|
+
async function captureFailure(run, failures) {
|
|
3228
3328
|
try {
|
|
3229
|
-
|
|
3329
|
+
await run();
|
|
3230
3330
|
} catch (error) {
|
|
3231
3331
|
failures.push(error);
|
|
3232
|
-
return fallback;
|
|
3233
3332
|
}
|
|
3234
3333
|
}
|
|
3334
|
+
|
|
3335
|
+
// src/maintenance/passes/cron-pass.ts
|
|
3336
|
+
var APPEND_BUDGET_MS = 5000;
|
|
3337
|
+
var RETRY_DELAY_MS = 1e4;
|
|
3338
|
+
function cronPass(input) {
|
|
3339
|
+
const occurrences = new CronOccurrences({
|
|
3340
|
+
schedules: input.schedules.filter(isCronSchedule),
|
|
3341
|
+
events: input.events,
|
|
3342
|
+
timeZone: input.timeZone === "UTC" ? undefined : input.timeZone,
|
|
3343
|
+
now: input.now ?? (() => new Date)
|
|
3344
|
+
});
|
|
3345
|
+
return {
|
|
3346
|
+
id: "cron",
|
|
3347
|
+
budgetMs: APPEND_BUDGET_MS,
|
|
3348
|
+
nextRunAt: (now) => occurrences.nextDueAt(now),
|
|
3349
|
+
run: (signal) => occurrences.fireDue(signal),
|
|
3350
|
+
onLoopStopped: () => occurrences.stop()
|
|
3351
|
+
};
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3354
|
+
class CronOccurrences {
|
|
3355
|
+
options;
|
|
3356
|
+
occurrences = null;
|
|
3357
|
+
pendingAppends = new PendingTasks;
|
|
3358
|
+
constructor(options) {
|
|
3359
|
+
this.options = options;
|
|
3360
|
+
}
|
|
3361
|
+
nextDueAt(now) {
|
|
3362
|
+
this.occurrences ??= this.firstOccurrences(now);
|
|
3363
|
+
const times = [...this.occurrences.values()].map((next) => dueAt(next).getTime());
|
|
3364
|
+
return times.length > 0 ? new Date(Math.min(...times)) : null;
|
|
3365
|
+
}
|
|
3366
|
+
async fireDue(signal) {
|
|
3367
|
+
const now = this.options.now();
|
|
3368
|
+
const results = await Promise.allSettled(this.options.schedules.map((schedule) => this.fireSchedule(schedule, now, signal)));
|
|
3369
|
+
const failures = results.flatMap((result) => result.status === "rejected" ? [result.reason] : []);
|
|
3370
|
+
if (failures.length > 0) {
|
|
3371
|
+
throw new AggregateError(failures, "[Sixb] The broker refused a cron occurrence.");
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
async stop() {
|
|
3375
|
+
this.occurrences = null;
|
|
3376
|
+
if (await this.pendingAppends.drain(APPEND_BUDGET_MS))
|
|
3377
|
+
return;
|
|
3378
|
+
console.error(`[Sixb] Timed out after ${APPEND_BUDGET_MS}ms waiting for ${this.pendingAppends.size} schedule append(s) to settle.`);
|
|
3379
|
+
}
|
|
3380
|
+
firstOccurrences(now) {
|
|
3381
|
+
const occurrences = new Map;
|
|
3382
|
+
for (const schedule of this.options.schedules) {
|
|
3383
|
+
const at = this.occurrenceAfter(schedule, now);
|
|
3384
|
+
if (at)
|
|
3385
|
+
occurrences.set(schedule.id, { at, retryAt: null });
|
|
3386
|
+
}
|
|
3387
|
+
return occurrences;
|
|
3388
|
+
}
|
|
3389
|
+
async fireSchedule(schedule, now, signal) {
|
|
3390
|
+
let next = this.occurrences?.get(schedule.id);
|
|
3391
|
+
while (next && dueAt(next) <= now) {
|
|
3392
|
+
try {
|
|
3393
|
+
await this.appendOccurrence(schedule, next.at, now, signal);
|
|
3394
|
+
} catch (error) {
|
|
3395
|
+
next.retryAt = new Date(this.options.now().getTime() + RETRY_DELAY_MS);
|
|
3396
|
+
throw error;
|
|
3397
|
+
}
|
|
3398
|
+
next = this.advance(schedule, next, now);
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
async appendOccurrence(schedule, occurrenceAt, now, signal) {
|
|
3402
|
+
const occurrenceAtIso = occurrenceAt.toISOString();
|
|
3403
|
+
const occurrenceKey = `${schedule.id}:${occurrenceAtIso}`;
|
|
3404
|
+
const append = this.options.events.append({
|
|
3405
|
+
events: [
|
|
3406
|
+
{
|
|
3407
|
+
type: "schedule.triggered",
|
|
3408
|
+
idempotencyKey: occurrenceKey,
|
|
3409
|
+
payload: {
|
|
3410
|
+
scheduleId: schedule.id,
|
|
3411
|
+
occurrenceAt: occurrenceAtIso,
|
|
3412
|
+
triggeredAt: now.toISOString(),
|
|
3413
|
+
occurrenceKey
|
|
3414
|
+
}
|
|
3415
|
+
}
|
|
3416
|
+
]
|
|
3417
|
+
});
|
|
3418
|
+
this.pendingAppends.track(append);
|
|
3419
|
+
await Promise.race([append, rejectOnAbort(signal)]);
|
|
3420
|
+
}
|
|
3421
|
+
advance(schedule, done, now) {
|
|
3422
|
+
const at = this.occurrenceAfter(schedule, done.retryAt ? now : done.at);
|
|
3423
|
+
const next = at ? { at, retryAt: null } : undefined;
|
|
3424
|
+
if (next)
|
|
3425
|
+
this.occurrences?.set(schedule.id, next);
|
|
3426
|
+
else
|
|
3427
|
+
this.occurrences?.delete(schedule.id);
|
|
3428
|
+
return next;
|
|
3429
|
+
}
|
|
3430
|
+
occurrenceAfter(schedule, after) {
|
|
3431
|
+
try {
|
|
3432
|
+
return nextCronOccurrence2(schedule.trigger.expression, after, schedule.trigger.timezone ?? this.options.timeZone);
|
|
3433
|
+
} catch (error) {
|
|
3434
|
+
console.error(`[Sixb] Scheduler failed to compute next occurrence for '${schedule.id}':`, error);
|
|
3435
|
+
return;
|
|
3436
|
+
}
|
|
3437
|
+
}
|
|
3438
|
+
}
|
|
3439
|
+
function dueAt(next) {
|
|
3440
|
+
return next.retryAt ?? next.at;
|
|
3441
|
+
}
|
|
3442
|
+
function isCronSchedule(schedule) {
|
|
3443
|
+
return schedule.trigger.type === "cron";
|
|
3444
|
+
}
|
|
3445
|
+
|
|
3446
|
+
// src/maintenance/passes/directory-pass.ts
|
|
3447
|
+
var PASS_BUDGET_MS2 = 10 * 60000;
|
|
3448
|
+
function directoryPass(auth) {
|
|
3449
|
+
return everyMs({
|
|
3450
|
+
id: "directory",
|
|
3451
|
+
intervalMs: auth.intervalMs,
|
|
3452
|
+
budgetMs: PASS_BUDGET_MS2,
|
|
3453
|
+
run: (signal) => auth.checkDirectory(signal)
|
|
3454
|
+
});
|
|
3455
|
+
}
|
|
3456
|
+
|
|
3235
3457
|
// src/models/execution/reranking.ts
|
|
3236
3458
|
import { randomUUID as randomUUID7 } from "crypto";
|
|
3237
3459
|
function bindRerankingModels(catalog, session) {
|
|
@@ -3942,6 +4164,9 @@ function resolveDefinitions(options) {
|
|
|
3942
4164
|
const subagentMaxSteps = options.agent?.subagentMaxSteps;
|
|
3943
4165
|
assertMaxSteps(maxSteps, "agent.maxSteps");
|
|
3944
4166
|
assertMaxSteps(subagentMaxSteps, "agent.subagentMaxSteps");
|
|
4167
|
+
const web = resolveAgentWebOptions(options.agent?.web);
|
|
4168
|
+
if (web !== false)
|
|
4169
|
+
assertNoProviderWebTools(models);
|
|
3945
4170
|
const ontologyDocs = createOntologyDocsCatalog({
|
|
3946
4171
|
objectTypes: ontology.listObjectTypes(),
|
|
3947
4172
|
...options.agent?.ontologyDocs === undefined ? {} : { docs: options.agent.ontologyDocs }
|
|
@@ -4041,7 +4266,8 @@ function resolveDefinitions(options) {
|
|
|
4041
4266
|
...options.agent?.instructions === undefined ? {} : { instructions: options.agent.instructions },
|
|
4042
4267
|
ontologyDocs,
|
|
4043
4268
|
...maxSteps === undefined ? {} : { maxSteps },
|
|
4044
|
-
...subagentMaxSteps === undefined ? {} : { subagentMaxSteps }
|
|
4269
|
+
...subagentMaxSteps === undefined ? {} : { subagentMaxSteps },
|
|
4270
|
+
...web === undefined ? {} : { web }
|
|
4045
4271
|
}),
|
|
4046
4272
|
connectors: createDefinitionCatalog(connectorsById),
|
|
4047
4273
|
datasets: createDefinitionCatalog(datasetsById),
|
|
@@ -4196,10 +4422,12 @@ class SixbHost2 {
|
|
|
4196
4422
|
vectorIndexing;
|
|
4197
4423
|
eventService;
|
|
4198
4424
|
ontologyMaintenance;
|
|
4425
|
+
onMaintenanceFailure;
|
|
4199
4426
|
storageReadiness;
|
|
4200
4427
|
connectorService;
|
|
4201
4428
|
materializer;
|
|
4202
4429
|
datasetVersionMarkings;
|
|
4430
|
+
datasetIngest;
|
|
4203
4431
|
appliedMarkings;
|
|
4204
4432
|
sandboxDefinition;
|
|
4205
4433
|
definitions;
|
|
@@ -4213,7 +4441,7 @@ class SixbHost2 {
|
|
|
4213
4441
|
queues;
|
|
4214
4442
|
sandboxes;
|
|
4215
4443
|
projectRoot;
|
|
4216
|
-
|
|
4444
|
+
cron;
|
|
4217
4445
|
auth;
|
|
4218
4446
|
constructor(options) {
|
|
4219
4447
|
const errorReporter = attachSixbErrorReporter2(this, options.onError);
|
|
@@ -4273,7 +4501,8 @@ class SixbHost2 {
|
|
|
4273
4501
|
storage: this.storage,
|
|
4274
4502
|
security: definitions.security,
|
|
4275
4503
|
config: options.auth,
|
|
4276
|
-
events: this.eventService
|
|
4504
|
+
events: this.eventService,
|
|
4505
|
+
onUserSuspended: (userId) => this.connectorService.revokeUserConnections(userId)
|
|
4277
4506
|
});
|
|
4278
4507
|
validateAuthStrategySecurityReferences(this.auth.getStrategy(), definitions.security);
|
|
4279
4508
|
const connectors = definitions.connectors.list();
|
|
@@ -4307,13 +4536,15 @@ class SixbHost2 {
|
|
|
4307
4536
|
if (vectorIndexing && definitions.ontology.listObjectTypes().some((type) => Object.keys(type.search?.vectors ?? {}).length > 0)) {
|
|
4308
4537
|
this.vectorIndexing = new VectorIndexingDispatcher(this.projectId, vectorIndexing, this.queues.vectorIndexing);
|
|
4309
4538
|
}
|
|
4539
|
+
this.onMaintenanceFailure = (error, failure) => reportMaintenancePassFailure3(errorReporter, error, { projectId: this.projectId, ...failure });
|
|
4310
4540
|
this.ontologyMaintenance = new OntologyMaintenance({
|
|
4311
4541
|
projectId: this.projectId,
|
|
4312
4542
|
storage: this.storage,
|
|
4313
4543
|
dispatcher: this.committedFacts,
|
|
4314
4544
|
vectorIndexing: this.vectorIndexing,
|
|
4315
4545
|
blobStorage: this.blobStorage,
|
|
4316
|
-
options: options.ontologyMaintenance
|
|
4546
|
+
options: options.ontologyMaintenance,
|
|
4547
|
+
onError: this.onMaintenanceFailure
|
|
4317
4548
|
});
|
|
4318
4549
|
this.hostContext = {
|
|
4319
4550
|
embeddingModels: definitions.models?.embedding,
|
|
@@ -4335,7 +4566,27 @@ class SixbHost2 {
|
|
|
4335
4566
|
registerAgentApprovalExecutor(this, approvals);
|
|
4336
4567
|
registerAgentApprovalExecutor(this.hostContext, approvals);
|
|
4337
4568
|
registerVectorIndexingRuntime(this, createVectorIndexingRuntime(this.hostContext, this.materializer));
|
|
4338
|
-
|
|
4569
|
+
const lakeRetention = new LakeRetention({
|
|
4570
|
+
projectId: this.projectId,
|
|
4571
|
+
options: options.lakeMaintenance,
|
|
4572
|
+
lakeStorage: this.lakeStorage,
|
|
4573
|
+
storage: this.storage,
|
|
4574
|
+
sources: this.storage.ontology.sources,
|
|
4575
|
+
datasetCount: definitions.datasets.list().length
|
|
4576
|
+
});
|
|
4577
|
+
registerLakeRetentionRuntime(this, lakeRetention);
|
|
4578
|
+
this.datasetIngest = createDatasetIngestRuntime({
|
|
4579
|
+
projectId: this.projectId,
|
|
4580
|
+
inbox: this.storage.datasetIngest,
|
|
4581
|
+
lakeStorage: this.lakeStorage,
|
|
4582
|
+
blobStorage: this.blobStorage,
|
|
4583
|
+
events: this.eventService,
|
|
4584
|
+
queue: this.queues.lake,
|
|
4585
|
+
datasets: definitions.datasets,
|
|
4586
|
+
reporter: this
|
|
4587
|
+
});
|
|
4588
|
+
registerDatasetIngestRuntime(this, this.datasetIngest);
|
|
4589
|
+
this.cron = cronPass({
|
|
4339
4590
|
schedules: definitions.schedules.list(),
|
|
4340
4591
|
events: this.eventService,
|
|
4341
4592
|
timeZone: this.timeZone
|
|
@@ -4387,13 +4638,51 @@ class SixbHost2 {
|
|
|
4387
4638
|
getWebhookById(connectorId, webhookId) {
|
|
4388
4639
|
return this.webhookRegistry.getById(connectorId, webhookId);
|
|
4389
4640
|
}
|
|
4641
|
+
startMaintenance(passes) {
|
|
4642
|
+
const loop = new MaintenanceLoop({
|
|
4643
|
+
passes: [
|
|
4644
|
+
ontologyPass(this.ontologyMaintenance),
|
|
4645
|
+
this.cron,
|
|
4646
|
+
...this.lakeRetentionPasses(),
|
|
4647
|
+
...this.directoryPasses(),
|
|
4648
|
+
...passes
|
|
4649
|
+
],
|
|
4650
|
+
heartbeat: storageHeartbeat(this.projectId, "orchestrator", this.storage),
|
|
4651
|
+
onError: this.onMaintenanceFailure
|
|
4652
|
+
});
|
|
4653
|
+
loop.start();
|
|
4654
|
+
return { stop: () => loop.stop() };
|
|
4655
|
+
}
|
|
4656
|
+
directoryPasses() {
|
|
4657
|
+
const intervalMs = this.auth.directoryIntervalMs;
|
|
4658
|
+
if (intervalMs === undefined)
|
|
4659
|
+
return [];
|
|
4660
|
+
return [
|
|
4661
|
+
directoryPass({ intervalMs, checkDirectory: (signal) => this.auth.checkDirectory(signal) })
|
|
4662
|
+
];
|
|
4663
|
+
}
|
|
4664
|
+
lakeRetentionPasses() {
|
|
4665
|
+
const retention = getLakeRetentionRuntime2(this);
|
|
4666
|
+
if (!retention.automatic)
|
|
4667
|
+
return [];
|
|
4668
|
+
return [
|
|
4669
|
+
lakeRetentionPass({
|
|
4670
|
+
projectId: this.projectId,
|
|
4671
|
+
cleanupEveryMs: retention.settings.cleanupEveryMs,
|
|
4672
|
+
queue: this.queues.lake,
|
|
4673
|
+
status: () => retention.status()
|
|
4674
|
+
})
|
|
4675
|
+
];
|
|
4676
|
+
}
|
|
4390
4677
|
startOntologyMaintenance() {
|
|
4391
|
-
this.storageReadiness.startSchemaValidation();
|
|
4392
4678
|
return this.ontologyMaintenance.start();
|
|
4393
4679
|
}
|
|
4394
4680
|
getOntologyOperationalStatus() {
|
|
4395
4681
|
return this.ontologyMaintenance.getOperationalStatus();
|
|
4396
4682
|
}
|
|
4683
|
+
prepareReadiness() {
|
|
4684
|
+
this.storageReadiness.startSchemaValidation();
|
|
4685
|
+
}
|
|
4397
4686
|
async checkReadiness() {
|
|
4398
4687
|
return this.storageReadiness.check();
|
|
4399
4688
|
}
|
|
@@ -4419,14 +4708,17 @@ class SixbHost2 {
|
|
|
4419
4708
|
definition: this.sandboxDefinition,
|
|
4420
4709
|
supportsPersistence: typeof this.sandboxes?.resume === "function"
|
|
4421
4710
|
},
|
|
4711
|
+
rendersBoardPreviews: this.sandboxes !== undefined,
|
|
4422
4712
|
logging: this.logging,
|
|
4423
4713
|
activity: this.activity,
|
|
4424
4714
|
connectorService: this.connectorService,
|
|
4715
|
+
members: this.auth,
|
|
4425
4716
|
...this.connectorService.connectionProcess === undefined ? {} : { connectorConnections: this.connectorService.connectionProcess },
|
|
4426
4717
|
blobStorage: this.blobStorage,
|
|
4427
4718
|
apiPublicOrigin: () => getApiPublicOrigin(this),
|
|
4428
4719
|
lakeStorage: this.lakeStorage,
|
|
4429
|
-
datasetVersionMarkings: this.datasetVersionMarkings
|
|
4720
|
+
datasetVersionMarkings: this.datasetVersionMarkings,
|
|
4721
|
+
datasetIngest: this.datasetIngest
|
|
4430
4722
|
};
|
|
4431
4723
|
}
|
|
4432
4724
|
}
|
|
@@ -4494,7 +4786,7 @@ async function createSixb2(options) {
|
|
|
4494
4786
|
const skills = await discoverAgentSkills(projectRoot);
|
|
4495
4787
|
const instructions = await discoverProjectInstructions(projectRoot);
|
|
4496
4788
|
const ontologyFiles = await discoverOntologyFiles(projectRoot);
|
|
4497
|
-
const { maxSteps, subagentMaxSteps } = options.agent ?? {};
|
|
4789
|
+
const { maxSteps, subagentMaxSteps, web } = options.agent ?? {};
|
|
4498
4790
|
return new SixbHost2({
|
|
4499
4791
|
id: options.id,
|
|
4500
4792
|
locale: options.locale,
|
|
@@ -4503,6 +4795,7 @@ async function createSixb2(options) {
|
|
|
4503
4795
|
broker: options.broker,
|
|
4504
4796
|
storage: options.storage,
|
|
4505
4797
|
lakeStorage: options.lakeStorage,
|
|
4798
|
+
lakeMaintenance: options.lakeMaintenance,
|
|
4506
4799
|
blobStorage: options.blobStorage,
|
|
4507
4800
|
queues: options.queues,
|
|
4508
4801
|
sandboxes: options.sandboxes,
|
|
@@ -4531,6 +4824,7 @@ async function createSixb2(options) {
|
|
|
4531
4824
|
agent: {
|
|
4532
4825
|
...maxSteps === undefined ? {} : { maxSteps },
|
|
4533
4826
|
...subagentMaxSteps === undefined ? {} : { subagentMaxSteps },
|
|
4827
|
+
...web === undefined ? {} : { web },
|
|
4534
4828
|
skills,
|
|
4535
4829
|
...instructions === undefined ? {} : { instructions },
|
|
4536
4830
|
ontologyDocs: { modules: discoveredOntology.modules, ...ontologyFiles }
|
|
@@ -4541,4 +4835,4 @@ async function createSixb2(options) {
|
|
|
4541
4835
|
}
|
|
4542
4836
|
export { WebhookValidationError2, defineWebhook2, webhookConnector2, UnverifiedWebhookError2, resolveWebhookVerification2, warnUnverifiedWebhook2, SixbHost2, createSixb2 };
|
|
4543
4837
|
|
|
4544
|
-
//# debugId=
|
|
4838
|
+
//# debugId=CE9F45EF82AB83EC64756E2164756E21
|