@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
|
@@ -0,0 +1,1322 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
createSixbError2,
|
|
4
|
+
captureSixbFailure2,
|
|
5
|
+
isSixbError2
|
|
6
|
+
} from "./chunk-mvz89age.js";
|
|
7
|
+
import {
|
|
8
|
+
reportVectorIndexingFailure,
|
|
9
|
+
reportDatasetIngestFlushFailure2,
|
|
10
|
+
reportDatasetIngestRejection2
|
|
11
|
+
} from "./chunk-czct88ht.js";
|
|
12
|
+
import {
|
|
13
|
+
DatasetValidationError2
|
|
14
|
+
} from "./chunk-wx7smkn2.js";
|
|
15
|
+
import {
|
|
16
|
+
DatasetIngestLeaseLostError2
|
|
17
|
+
} from "./chunk-pk539cwv.js";
|
|
18
|
+
import {
|
|
19
|
+
findProducedVersion2,
|
|
20
|
+
writeDataset2
|
|
21
|
+
} from "./chunk-ppxf7gw2.js";
|
|
22
|
+
import {
|
|
23
|
+
datasetDefinitionHash,
|
|
24
|
+
tryEnqueueIngestFlush
|
|
25
|
+
} from "./chunk-191jz8a6.js";
|
|
26
|
+
import {
|
|
27
|
+
createKernelRuntimeAuthorization
|
|
28
|
+
} from "./chunk-vzkxqf8h.js";
|
|
29
|
+
import {
|
|
30
|
+
INDEXING_EMBEDDING_TIMEOUT_MS,
|
|
31
|
+
vectorConfiguration,
|
|
32
|
+
vectorSources,
|
|
33
|
+
normalizeVector2
|
|
34
|
+
} from "./chunk-0k3r5kb3.js";
|
|
35
|
+
import {
|
|
36
|
+
estimateModelCall
|
|
37
|
+
} from "./chunk-qttqe1ah.js";
|
|
38
|
+
import {
|
|
39
|
+
VECTOR_INDEXING_FAILURE_CODES2
|
|
40
|
+
} from "./chunk-2by73sm2.js";
|
|
41
|
+
import {
|
|
42
|
+
waitUnlessAborted2
|
|
43
|
+
} from "./chunk-mwcqz3e3.js";
|
|
44
|
+
import {
|
|
45
|
+
datasetSequenceChange2,
|
|
46
|
+
DatasetSequenceConflictError2
|
|
47
|
+
} from "./chunk-dmnd9ea6.js";
|
|
48
|
+
import {
|
|
49
|
+
ModelExecutionSession
|
|
50
|
+
} from "./chunk-6gtxshcc.js";
|
|
51
|
+
import {
|
|
52
|
+
executionRecordInputFromRuntime,
|
|
53
|
+
ensureExecutionRecord2
|
|
54
|
+
} from "./chunk-8tqnsx3q.js";
|
|
55
|
+
import {
|
|
56
|
+
lakeRetentionJobId
|
|
57
|
+
} from "./chunk-n2ay51px.js";
|
|
58
|
+
import {
|
|
59
|
+
getDatasetPrimaryKeyColumns2
|
|
60
|
+
} from "./chunk-w3t94hm6.js";
|
|
61
|
+
import {
|
|
62
|
+
LakeConcurrencyError2,
|
|
63
|
+
LakeValueRefusedError2
|
|
64
|
+
} from "./chunk-hgj98cbb.js";
|
|
65
|
+
import {
|
|
66
|
+
RuntimeError2
|
|
67
|
+
} from "./chunk-m4ehq95f.js";
|
|
68
|
+
import {
|
|
69
|
+
MaterializationConflictError2
|
|
70
|
+
} from "./chunk-y7dbmaqh.js";
|
|
71
|
+
import {
|
|
72
|
+
assertEmbeddingModel,
|
|
73
|
+
sameEmbeddingModel,
|
|
74
|
+
EmbeddingModelResponseError2
|
|
75
|
+
} from "./chunk-rtkqczbr.js";
|
|
76
|
+
|
|
77
|
+
// src/datasets/ingest-flush.ts
|
|
78
|
+
import { randomUUID } from "crypto";
|
|
79
|
+
|
|
80
|
+
// src/datasets/ingest-flush-batch.ts
|
|
81
|
+
var CONCURRENCY_ATTEMPTS = 3;
|
|
82
|
+
|
|
83
|
+
class IngestBatchWriter {
|
|
84
|
+
input;
|
|
85
|
+
constructor(input) {
|
|
86
|
+
this.input = input;
|
|
87
|
+
}
|
|
88
|
+
async commit(batch, resumed) {
|
|
89
|
+
let deliveries = batch.deliveries;
|
|
90
|
+
if (resumed) {
|
|
91
|
+
const version = await this.findCommitted(batch);
|
|
92
|
+
if (version)
|
|
93
|
+
return { version, producer: version.producer ?? { kind: "ingest" }, deliveries };
|
|
94
|
+
}
|
|
95
|
+
for (let attempt = 1;; attempt += 1) {
|
|
96
|
+
const oldest = deliveries[0];
|
|
97
|
+
if (!oldest)
|
|
98
|
+
return { version: null, producer: { kind: "ingest" }, deliveries };
|
|
99
|
+
const producer = {
|
|
100
|
+
kind: "ingest",
|
|
101
|
+
id: oldest.executionId,
|
|
102
|
+
runId: batch.flushId
|
|
103
|
+
};
|
|
104
|
+
try {
|
|
105
|
+
return { version: await this.write(batch, producer), producer, deliveries };
|
|
106
|
+
} catch (error) {
|
|
107
|
+
const refused = await this.refusedChange(batch, error);
|
|
108
|
+
if (refused) {
|
|
109
|
+
await this.reject(batch, refused);
|
|
110
|
+
deliveries = deliveries.filter((delivery) => delivery.id !== refused.value.delivery.id);
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (!(error instanceof LakeConcurrencyError2) || attempt >= CONCURRENCY_ATTEMPTS) {
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
const version = await this.findCommitted(batch);
|
|
117
|
+
if (version)
|
|
118
|
+
return { version, producer, deliveries };
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async write(batch, producer) {
|
|
123
|
+
const { dataset, signal, lakeStorage, blobStorage } = this.input;
|
|
124
|
+
await this.input.assertOwned();
|
|
125
|
+
const result = await writeDataset2({
|
|
126
|
+
lakeStorage,
|
|
127
|
+
blobStorage,
|
|
128
|
+
dataset,
|
|
129
|
+
mode: "merge",
|
|
130
|
+
signal,
|
|
131
|
+
producer,
|
|
132
|
+
sourceLabel: `[Sixb] Dataset '${dataset.id}' ingested change`,
|
|
133
|
+
readValues: async () => this.values(batch.flushId),
|
|
134
|
+
mapValidationError: (error, value) => error instanceof DatasetValidationError2 ? new RefusedChange(value, error) : error
|
|
135
|
+
});
|
|
136
|
+
return result.outcome === "created" ? result.version : null;
|
|
137
|
+
}
|
|
138
|
+
async* values(flushId) {
|
|
139
|
+
const { inbox, lease } = this.input;
|
|
140
|
+
for await (const { delivery, changes } of inbox.readChanges({ lease, flushId })) {
|
|
141
|
+
for (const [changeIndex, change] of changes.entries()) {
|
|
142
|
+
yield { value: change, delivery, changeIndex };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
findCommitted(batch) {
|
|
147
|
+
const { lakeStorage, dataset } = this.input;
|
|
148
|
+
return findProducedVersion2({
|
|
149
|
+
lakeStorage,
|
|
150
|
+
datasetId: dataset.id,
|
|
151
|
+
producer: { kind: "ingest", runId: batch.flushId },
|
|
152
|
+
since: batch.startedAt
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
async refusedChange(batch, error) {
|
|
156
|
+
if (error instanceof RefusedChange)
|
|
157
|
+
return error;
|
|
158
|
+
if (error instanceof DatasetSequenceConflictError2)
|
|
159
|
+
return this.findConflicting(batch, error);
|
|
160
|
+
if (error instanceof LakeValueRefusedError2)
|
|
161
|
+
return this.changeAt(batch, error);
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
async changeAt(batch, refusal) {
|
|
165
|
+
let position = 0;
|
|
166
|
+
for await (const value of this.values(batch.flushId)) {
|
|
167
|
+
if (position === refusal.changeIndex)
|
|
168
|
+
return new RefusedChange(value, refusal);
|
|
169
|
+
position += 1;
|
|
170
|
+
}
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
async findConflicting(batch, conflict) {
|
|
174
|
+
for await (const value of this.values(batch.flushId)) {
|
|
175
|
+
const { key, sequence, content } = datasetSequenceChange2(this.input.dataset, value.value);
|
|
176
|
+
if (key === conflict.key && sequence === conflict.sequence && content === conflict.content) {
|
|
177
|
+
return new RefusedChange(value, conflict);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
async reject(batch, refused) {
|
|
183
|
+
const { dataset, inbox, lease, projectId, reporter } = this.input;
|
|
184
|
+
const { delivery, changeIndex, value } = refused.value;
|
|
185
|
+
if (delivery.definitionHash !== datasetDefinitionHash(dataset)) {
|
|
186
|
+
throw new Error(`[Sixb] Delivery '${delivery.id}' of dataset '${dataset.id}' was stored under another definition of the dataset; it waits until this worker runs the same code as the API.`, { cause: refused.cause });
|
|
187
|
+
}
|
|
188
|
+
await inbox.reject({
|
|
189
|
+
lease,
|
|
190
|
+
flushId: batch.flushId,
|
|
191
|
+
deliveryId: delivery.id,
|
|
192
|
+
reason: refused.message
|
|
193
|
+
});
|
|
194
|
+
const sequence = dataset.sequenceBy === undefined ? undefined : sequenceOf(dataset, value);
|
|
195
|
+
reportDatasetIngestRejection2(reporter, refused.cause, {
|
|
196
|
+
projectId,
|
|
197
|
+
datasetId: dataset.id,
|
|
198
|
+
deliveryId: delivery.id,
|
|
199
|
+
executionId: delivery.executionId,
|
|
200
|
+
changes: delivery.changeCount,
|
|
201
|
+
changeIndex,
|
|
202
|
+
key: keyOf(dataset, value),
|
|
203
|
+
...sequence === undefined ? {} : { sequence },
|
|
204
|
+
failure: captureSixbFailure2(refused.cause, {
|
|
205
|
+
allowedCodes: ["dataset.change_refused"],
|
|
206
|
+
defaultCode: "dataset.change_refused"
|
|
207
|
+
})
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
async announce(committed) {
|
|
211
|
+
const { dataset, events } = this.input;
|
|
212
|
+
const { version, producer, deliveries } = committed;
|
|
213
|
+
if (!version)
|
|
214
|
+
return;
|
|
215
|
+
await events.append({
|
|
216
|
+
events: [
|
|
217
|
+
{
|
|
218
|
+
type: "dataset.version.committed",
|
|
219
|
+
payload: {
|
|
220
|
+
datasetId: dataset.id,
|
|
221
|
+
versionId: version.versionId,
|
|
222
|
+
createdAt: version.createdAt.toISOString(),
|
|
223
|
+
producer,
|
|
224
|
+
rowsChanged: version.rowsChanged,
|
|
225
|
+
lineageChanged: version.lineageChanged
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
...deliveries[0] ? { correlationId: deliveries[0].correlationId } : {}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
class RefusedChange extends Error {
|
|
235
|
+
value;
|
|
236
|
+
cause;
|
|
237
|
+
constructor(value, cause) {
|
|
238
|
+
super(cause instanceof Error ? cause.message : String(cause), { cause });
|
|
239
|
+
this.value = value;
|
|
240
|
+
this.cause = cause;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
function keyOf(dataset, change) {
|
|
244
|
+
const source = change.kind === "upsert" ? change.row : change.key;
|
|
245
|
+
return Object.fromEntries((getDatasetPrimaryKeyColumns2(dataset) ?? []).map((column) => [column, String(source[column])]));
|
|
246
|
+
}
|
|
247
|
+
function sequenceOf(dataset, change) {
|
|
248
|
+
try {
|
|
249
|
+
return datasetSequenceChange2(dataset, change).sequence;
|
|
250
|
+
} catch {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// src/datasets/ingest-flush.ts
|
|
256
|
+
var LEASE_MS = 60000;
|
|
257
|
+
var RENEW_EVERY_MS = 15000;
|
|
258
|
+
var OWNED_MARGIN_MS = 1e4;
|
|
259
|
+
var BUDGET_MS = 30000;
|
|
260
|
+
var DATASET_INGEST_MAX_CHANGES = 1e4;
|
|
261
|
+
var REPORT_AT_FAILURE_STREAK = 5;
|
|
262
|
+
|
|
263
|
+
class DatasetIngestFlushError2 extends Error {
|
|
264
|
+
failureStreak;
|
|
265
|
+
name = "DatasetIngestFlushError";
|
|
266
|
+
constructor(message, failureStreak, options) {
|
|
267
|
+
super(message, options);
|
|
268
|
+
this.failureStreak = failureStreak;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
function createDatasetIngestRuntime(dependencies) {
|
|
272
|
+
const enabled = dependencies.inbox !== undefined && dependencies.datasets.list().some((dataset) => getDatasetPrimaryKeyColumns2(dataset) !== null);
|
|
273
|
+
const flush = (datasetId, signal) => new DatasetIngestFlush(dependencies, datasetId, signal, runtime.writesInline).run();
|
|
274
|
+
const runtime = {
|
|
275
|
+
enabled,
|
|
276
|
+
writesInline: false,
|
|
277
|
+
flush,
|
|
278
|
+
async flushAll(datasetId, signal) {
|
|
279
|
+
let outcome = await flush(datasetId, signal);
|
|
280
|
+
while (outcome.kind === "handed-over") {
|
|
281
|
+
outcome = await flush(datasetId, signal);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
return runtime;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
class DatasetIngestFlush {
|
|
289
|
+
dependencies;
|
|
290
|
+
datasetId;
|
|
291
|
+
inline;
|
|
292
|
+
inbox;
|
|
293
|
+
owner = `flush-owner_${randomUUID()}`;
|
|
294
|
+
lost = new AbortController;
|
|
295
|
+
signal;
|
|
296
|
+
ownedUntil = 0;
|
|
297
|
+
handedOver = false;
|
|
298
|
+
constructor(dependencies, datasetId, signal, inline) {
|
|
299
|
+
this.dependencies = dependencies;
|
|
300
|
+
this.datasetId = datasetId;
|
|
301
|
+
this.inline = inline;
|
|
302
|
+
if (!dependencies.inbox) {
|
|
303
|
+
throw new Error("[Sixb] Flushing ingested changes requires storage with a dataset ingest inbox.");
|
|
304
|
+
}
|
|
305
|
+
this.inbox = dependencies.inbox;
|
|
306
|
+
this.signal = AbortSignal.any([signal, this.lost.signal]);
|
|
307
|
+
}
|
|
308
|
+
async run() {
|
|
309
|
+
const askedAt = Date.now();
|
|
310
|
+
const acquired = await this.inbox.acquire({
|
|
311
|
+
projectId: this.dependencies.projectId,
|
|
312
|
+
datasetId: this.datasetId,
|
|
313
|
+
owner: this.owner,
|
|
314
|
+
leaseMs: LEASE_MS
|
|
315
|
+
});
|
|
316
|
+
if (!acquired.acquired)
|
|
317
|
+
return { kind: "busy", until: acquired.busyUntil };
|
|
318
|
+
const { lease } = acquired;
|
|
319
|
+
this.owned(askedAt);
|
|
320
|
+
const renewal = setInterval(() => this.renew(lease), RENEW_EVERY_MS);
|
|
321
|
+
try {
|
|
322
|
+
return await this.flushBatches(lease);
|
|
323
|
+
} catch (error) {
|
|
324
|
+
throw await this.failed(lease, error);
|
|
325
|
+
} finally {
|
|
326
|
+
clearInterval(renewal);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
async flushBatches(lease) {
|
|
330
|
+
const writer = this.batchWriter(lease);
|
|
331
|
+
const startedAt = Date.now();
|
|
332
|
+
let versions = 0;
|
|
333
|
+
let deliveries = 0;
|
|
334
|
+
this.signal.throwIfAborted();
|
|
335
|
+
let next = lease.inFlight ? { batch: lease.inFlight, resumed: true } : await this.takeNextBatch(lease, startedAt);
|
|
336
|
+
while (next !== null) {
|
|
337
|
+
const { batch, resumed } = next;
|
|
338
|
+
const committed = await writer.commit(batch, resumed);
|
|
339
|
+
if (committed.version) {
|
|
340
|
+
versions += 1;
|
|
341
|
+
await writer.announce(committed);
|
|
342
|
+
}
|
|
343
|
+
await this.inbox.complete({ lease, flushId: batch.flushId });
|
|
344
|
+
deliveries += committed.deliveries.length;
|
|
345
|
+
next = await this.takeNextBatch(lease, startedAt);
|
|
346
|
+
}
|
|
347
|
+
return { kind: this.handedOver ? "handed-over" : "flushed", versions, deliveries };
|
|
348
|
+
}
|
|
349
|
+
batchWriter(lease) {
|
|
350
|
+
const { projectId, lakeStorage, blobStorage, events, reporter, datasets } = this.dependencies;
|
|
351
|
+
const dataset = datasets.getById(this.datasetId);
|
|
352
|
+
if (!dataset) {
|
|
353
|
+
throw new Error(`[Sixb] Dataset '${this.datasetId}' is not registered; its ingested changes wait in the inbox until it is.`);
|
|
354
|
+
}
|
|
355
|
+
return new IngestBatchWriter({
|
|
356
|
+
projectId,
|
|
357
|
+
inbox: this.inbox,
|
|
358
|
+
lakeStorage,
|
|
359
|
+
blobStorage,
|
|
360
|
+
events,
|
|
361
|
+
reporter,
|
|
362
|
+
dataset,
|
|
363
|
+
lease,
|
|
364
|
+
signal: this.signal,
|
|
365
|
+
assertOwned: () => this.assertOwned(lease)
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
async takeNextBatch(lease, startedAt) {
|
|
369
|
+
this.signal.throwIfAborted();
|
|
370
|
+
if (Date.now() - startedAt >= BUDGET_MS) {
|
|
371
|
+
await this.requestAgain(lease);
|
|
372
|
+
return null;
|
|
373
|
+
}
|
|
374
|
+
const batch = await this.inbox.takeBatch({
|
|
375
|
+
lease,
|
|
376
|
+
flushId: `flush_${randomUUID()}`,
|
|
377
|
+
maxChanges: DATASET_INGEST_MAX_CHANGES
|
|
378
|
+
});
|
|
379
|
+
return batch && { batch, resumed: false };
|
|
380
|
+
}
|
|
381
|
+
async requestAgain(lease) {
|
|
382
|
+
const { request } = await this.inbox.handOver({ lease });
|
|
383
|
+
this.handedOver = true;
|
|
384
|
+
if (this.inline)
|
|
385
|
+
return;
|
|
386
|
+
await tryEnqueueIngestFlush(this.dependencies.queue, this.dependencies.projectId, { datasetId: this.datasetId, request }, { source: "ingest-flush" });
|
|
387
|
+
}
|
|
388
|
+
async assertOwned(lease) {
|
|
389
|
+
if (Date.now() < this.ownedUntil)
|
|
390
|
+
return;
|
|
391
|
+
const askedAt = Date.now();
|
|
392
|
+
const renewed = await this.inbox.renew({ lease, leaseMs: LEASE_MS });
|
|
393
|
+
if (renewed) {
|
|
394
|
+
this.owned(askedAt);
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
throw new DatasetIngestLeaseLostError2(`[Sixb] Dataset '${this.datasetId}' ingest lease was taken over by another flush.`);
|
|
398
|
+
}
|
|
399
|
+
owned(askedAt) {
|
|
400
|
+
this.ownedUntil = askedAt + LEASE_MS - OWNED_MARGIN_MS;
|
|
401
|
+
}
|
|
402
|
+
renew(lease) {
|
|
403
|
+
const askedAt = Date.now();
|
|
404
|
+
this.inbox.renew({ lease, leaseMs: LEASE_MS }).then((renewed) => {
|
|
405
|
+
if (renewed) {
|
|
406
|
+
this.owned(askedAt);
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
this.lost.abort(new DatasetIngestLeaseLostError2(`[Sixb] Dataset '${this.datasetId}' ingest lease was taken over by another flush.`));
|
|
410
|
+
}, (error) => {
|
|
411
|
+
console.warn(`[Sixb] Could not renew the ingest lease of dataset '${this.datasetId}'.`, error);
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
async failed(lease, error) {
|
|
415
|
+
if (this.lost.signal.aborted)
|
|
416
|
+
return this.lost.signal.reason;
|
|
417
|
+
if (error instanceof DatasetIngestLeaseLostError2)
|
|
418
|
+
return error;
|
|
419
|
+
if (this.signal.aborted) {
|
|
420
|
+
await this.inbox.release({ lease }).catch(() => {});
|
|
421
|
+
return error;
|
|
422
|
+
}
|
|
423
|
+
const { failureStreak } = await this.inbox.fail({ lease });
|
|
424
|
+
if (failureStreak === REPORT_AT_FAILURE_STREAK) {
|
|
425
|
+
const [summary] = await this.inbox.summarize({ projectId: this.dependencies.projectId, datasetIds: [this.datasetId] }).catch(() => []);
|
|
426
|
+
reportDatasetIngestFlushFailure2(this.dependencies.reporter, error, {
|
|
427
|
+
projectId: this.dependencies.projectId,
|
|
428
|
+
datasetId: this.datasetId,
|
|
429
|
+
failure: captureSixbFailure2(error, {
|
|
430
|
+
allowedCodes: ["internal.unexpected", "runtime.cancelled"],
|
|
431
|
+
defaultCode: "internal.unexpected"
|
|
432
|
+
}),
|
|
433
|
+
failureStreak,
|
|
434
|
+
pendingDeliveries: summary?.pendingDeliveries ?? 0,
|
|
435
|
+
oldestReceivedAt: summary?.oldestReceivedAt?.toISOString() ?? null,
|
|
436
|
+
subject: `failed:${lease.inFlight?.flushId ?? "take"}:${lease.owner}`
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
return new DatasetIngestFlushError2(`[Sixb] Flushing the ingested changes of dataset '${this.datasetId}' failed (${failureStreak} in a row).`, failureStreak, { cause: error });
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
var runtimes = new WeakMap;
|
|
443
|
+
function registerDatasetIngestRuntime(host, runtime) {
|
|
444
|
+
runtimes.set(host, runtime);
|
|
445
|
+
}
|
|
446
|
+
function findDatasetIngestRuntime2(host) {
|
|
447
|
+
return runtimes.get(host);
|
|
448
|
+
}
|
|
449
|
+
function getDatasetIngestRuntime2(host) {
|
|
450
|
+
const runtime = runtimes.get(host);
|
|
451
|
+
if (!runtime) {
|
|
452
|
+
throw new Error("[Sixb] Dataset ingestion requires a configured Sixb host.");
|
|
453
|
+
}
|
|
454
|
+
return runtime;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// src/shared/duration.ts
|
|
458
|
+
var UNIT_MS = {
|
|
459
|
+
m: 60000,
|
|
460
|
+
h: 60 * 60000,
|
|
461
|
+
d: 24 * 60 * 60000,
|
|
462
|
+
w: 7 * 24 * 60 * 60000,
|
|
463
|
+
y: 365 * 24 * 60 * 60000
|
|
464
|
+
};
|
|
465
|
+
function parseDuration2(value) {
|
|
466
|
+
const match = value.trim().match(/^(\d+)(m|h|d|w|y)$/);
|
|
467
|
+
if (!match)
|
|
468
|
+
return null;
|
|
469
|
+
return Number(match[1]) * UNIT_MS[match[2]];
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// src/maintenance/passes/lake-retention-pass.ts
|
|
473
|
+
var LAKE_RETENTION_PASS_ID = "lake-retention";
|
|
474
|
+
var REQUEST_BUDGET_MS = 30000;
|
|
475
|
+
var REQUEST_RETRY_MS = 60000;
|
|
476
|
+
function lakeRetentionPass(input) {
|
|
477
|
+
const { projectId, cleanupEveryMs, queue, status } = input;
|
|
478
|
+
let requested = null;
|
|
479
|
+
const intervalOf = (time) => Math.floor(time.getTime() / cleanupEveryMs) * cleanupEveryMs;
|
|
480
|
+
return {
|
|
481
|
+
id: LAKE_RETENTION_PASS_ID,
|
|
482
|
+
budgetMs: REQUEST_BUDGET_MS,
|
|
483
|
+
nextRunAt(now, lastFinishedAt) {
|
|
484
|
+
if (requested === intervalOf(now))
|
|
485
|
+
return new Date(requested + cleanupEveryMs);
|
|
486
|
+
if (lastFinishedAt === null)
|
|
487
|
+
return now;
|
|
488
|
+
return new Date(lastFinishedAt.getTime() + REQUEST_RETRY_MS);
|
|
489
|
+
},
|
|
490
|
+
async run() {
|
|
491
|
+
const interval = intervalOf(new Date);
|
|
492
|
+
const intervalStart = new Date(interval).toISOString();
|
|
493
|
+
await queue.enqueue({
|
|
494
|
+
projectId,
|
|
495
|
+
jobs: [
|
|
496
|
+
{
|
|
497
|
+
id: lakeRetentionJobId(intervalStart),
|
|
498
|
+
type: "lake.retention.requested",
|
|
499
|
+
payload: { intervalStart }
|
|
500
|
+
}
|
|
501
|
+
]
|
|
502
|
+
});
|
|
503
|
+
requested = interval;
|
|
504
|
+
if ((await status()).state === "no-worker") {
|
|
505
|
+
console.warn("[Sixb] Lake cleanup is requested but no lake worker has run it: run `sixb worker lake`, or add `lake` to the worker group.");
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// src/maintenance/status.ts
|
|
512
|
+
var STALE_AFTER_BEATS = 2;
|
|
513
|
+
var DEGRADED_ATTEMPT_THRESHOLD = 3;
|
|
514
|
+
var DEGRADED_FAILURE_THRESHOLD = 2;
|
|
515
|
+
function operationalStatus(input) {
|
|
516
|
+
const { heartbeats, outbox } = input;
|
|
517
|
+
const heartbeat = heartbeatOf(heartbeats, "orchestrator") ?? heartbeatOf(heartbeats, "embedded");
|
|
518
|
+
const stale = heartbeat !== undefined && isStale(heartbeat, input.now);
|
|
519
|
+
return {
|
|
520
|
+
status: statusOf(input, heartbeat, stale),
|
|
521
|
+
maintenance: {
|
|
522
|
+
owner: heartbeat?.owner ?? null,
|
|
523
|
+
beatAt: heartbeat?.beatAt.toISOString() ?? null,
|
|
524
|
+
stale,
|
|
525
|
+
passes: (heartbeat?.passes ?? []).map((pass) => ({
|
|
526
|
+
...pass,
|
|
527
|
+
lastSucceededAt: pass.lastSucceededAt?.toISOString() ?? null
|
|
528
|
+
})),
|
|
529
|
+
outbox
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
function heartbeatOf(heartbeats, owner) {
|
|
534
|
+
return heartbeats.find((heartbeat) => heartbeat.owner === owner);
|
|
535
|
+
}
|
|
536
|
+
function statusOf(input, heartbeat, stale) {
|
|
537
|
+
if (stale || isFailing(heartbeat) || isOutboxStuck(input))
|
|
538
|
+
return "degraded";
|
|
539
|
+
return heartbeat === undefined ? "unknown" : "ok";
|
|
540
|
+
}
|
|
541
|
+
function isStale(heartbeat, now) {
|
|
542
|
+
return now.getTime() - heartbeat.beatAt.getTime() > heartbeat.everyMs * STALE_AFTER_BEATS;
|
|
543
|
+
}
|
|
544
|
+
function isFailing(heartbeat) {
|
|
545
|
+
return (heartbeat?.passes ?? []).some((pass) => pass.consecutiveFailures >= DEGRADED_FAILURE_THRESHOLD);
|
|
546
|
+
}
|
|
547
|
+
function isOutboxStuck({ outbox, pendingLimitMs, now }) {
|
|
548
|
+
if (outbox.maxAttempts >= DEGRADED_ATTEMPT_THRESHOLD)
|
|
549
|
+
return true;
|
|
550
|
+
if (outbox.oldestPendingAt === null)
|
|
551
|
+
return false;
|
|
552
|
+
return now.getTime() - Date.parse(outbox.oldestPendingAt) > pendingLimitMs;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// src/maintenance/lake-retention-status.ts
|
|
556
|
+
function lakeRetentionStatus(input) {
|
|
557
|
+
return {
|
|
558
|
+
state: stateOf(input),
|
|
559
|
+
lastRequestedAt: passOf(input.heartbeat)?.lastSucceededAt?.toISOString() ?? null,
|
|
560
|
+
lastRunAt: input.lastRun?.startedAt.toISOString() ?? null
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
function stateOf(input) {
|
|
564
|
+
const { settings, heartbeat, lastRun, now } = input;
|
|
565
|
+
if (!settings.enabled)
|
|
566
|
+
return "off";
|
|
567
|
+
if (!input.automatic)
|
|
568
|
+
return "idle";
|
|
569
|
+
const pass = passOf(heartbeat);
|
|
570
|
+
if (heartbeat === null || pass === null || isStale(heartbeat, now))
|
|
571
|
+
return "not-requested";
|
|
572
|
+
if (pass.consecutiveFailures > 0)
|
|
573
|
+
return "failing";
|
|
574
|
+
if (pass.lastSucceededAt === null)
|
|
575
|
+
return "not-requested";
|
|
576
|
+
if (lastRun === null)
|
|
577
|
+
return "no-worker";
|
|
578
|
+
if (isBehind(pass.lastSucceededAt, lastRun, settings.cleanupEveryMs))
|
|
579
|
+
return "no-worker";
|
|
580
|
+
if (lastRun.finishedAt === null)
|
|
581
|
+
return "cleaning";
|
|
582
|
+
return lastRun.failed ? "failing" : "ok";
|
|
583
|
+
}
|
|
584
|
+
function passOf(heartbeat) {
|
|
585
|
+
return heartbeat?.passes.find((pass) => pass.id === LAKE_RETENTION_PASS_ID) ?? null;
|
|
586
|
+
}
|
|
587
|
+
function isBehind(lastRequestedAt, lastRun, cleanupEveryMs) {
|
|
588
|
+
return lastRequestedAt.getTime() - lastRun.startedAt.getTime() > cleanupEveryMs;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
// src/maintenance/lake-retention.ts
|
|
592
|
+
var DEFAULT_RETENTION = "7d";
|
|
593
|
+
var DEFAULT_CLEANUP_EVERY = "1h";
|
|
594
|
+
var MIN_RETENTION_MS = 60 * 60000;
|
|
595
|
+
var PASS_PAUSE_MS = 1000;
|
|
596
|
+
var MAX_RUN_BUDGET_MS = 10 * 60000;
|
|
597
|
+
var WRITER_CLOCK_SKEW_MS = 60000;
|
|
598
|
+
var OPEN_RUNS_LOOKED_AT = 500;
|
|
599
|
+
function resolveLakeMaintenanceSettings(options) {
|
|
600
|
+
const enabled = options?.enabled ?? true;
|
|
601
|
+
if (typeof enabled !== "boolean") {
|
|
602
|
+
throw new RuntimeError2("[Sixb] lakeMaintenance.enabled must be true or false.");
|
|
603
|
+
}
|
|
604
|
+
const keepVersionsFor = options?.keepVersionsFor ?? DEFAULT_RETENTION;
|
|
605
|
+
const keepVersionsForMs = retentionOption("keepVersionsFor", keepVersionsFor);
|
|
606
|
+
const deleteFilesAfter = options?.deleteFilesAfter ?? DEFAULT_RETENTION;
|
|
607
|
+
const deleteFilesAfterMs = retentionOption("deleteFilesAfter", deleteFilesAfter);
|
|
608
|
+
const cleanupEvery = options?.cleanupEvery ?? DEFAULT_CLEANUP_EVERY;
|
|
609
|
+
const cleanupEveryMs = durationOption("cleanupEvery", cleanupEvery);
|
|
610
|
+
return {
|
|
611
|
+
enabled,
|
|
612
|
+
keepVersionsFor,
|
|
613
|
+
keepVersionsForMs,
|
|
614
|
+
deleteFilesAfter,
|
|
615
|
+
deleteFilesAfterMs,
|
|
616
|
+
cleanupEvery,
|
|
617
|
+
cleanupEveryMs
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
class LakeRetention {
|
|
622
|
+
input;
|
|
623
|
+
settings;
|
|
624
|
+
maintenance;
|
|
625
|
+
automatic;
|
|
626
|
+
constructor(input) {
|
|
627
|
+
this.input = input;
|
|
628
|
+
this.settings = resolveLakeMaintenanceSettings(input.options);
|
|
629
|
+
this.maintenance = input.lakeStorage.maintenance ?? null;
|
|
630
|
+
if (input.options?.enabled === true && this.maintenance === null) {
|
|
631
|
+
throw new RuntimeError2("[Sixb] lakeMaintenance.enabled is true, but the lake storage provider has no maintenance. " + "Remove the option, or use a provider that supports it, such as DuckLake.");
|
|
632
|
+
}
|
|
633
|
+
this.automatic = this.settings.enabled && this.maintenance !== null && input.datasetCount > 0;
|
|
634
|
+
}
|
|
635
|
+
async apply(options) {
|
|
636
|
+
if (this.maintenance === null) {
|
|
637
|
+
throw new RuntimeError2("[Sixb] The lake storage provider has no maintenance.");
|
|
638
|
+
}
|
|
639
|
+
return runRetentionPasses({
|
|
640
|
+
maintenance: this.maintenance,
|
|
641
|
+
protect: () => this.protect(),
|
|
642
|
+
keepVersionsForMs: () => this.keepVersionsForMs(options.keepVersionsForMs),
|
|
643
|
+
options
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
async runRequested(intervalStart, signal) {
|
|
647
|
+
const { settings } = this;
|
|
648
|
+
const intervalOver = Date.now() - Date.parse(intervalStart) >= settings.cleanupEveryMs;
|
|
649
|
+
if (!this.automatic || intervalOver)
|
|
650
|
+
return null;
|
|
651
|
+
const startedAt = new Date;
|
|
652
|
+
await this.recordRun({ startedAt, finishedAt: null, failed: false });
|
|
653
|
+
const finish = (failed) => this.recordRun({ startedAt, finishedAt: new Date, failed });
|
|
654
|
+
try {
|
|
655
|
+
const report = await this.apply({
|
|
656
|
+
keepVersionsForMs: settings.keepVersionsForMs,
|
|
657
|
+
deleteFilesAfterMs: settings.deleteFilesAfterMs,
|
|
658
|
+
budgetMs: Math.min(settings.cleanupEveryMs / 2, MAX_RUN_BUDGET_MS),
|
|
659
|
+
signal
|
|
660
|
+
});
|
|
661
|
+
await finish(false);
|
|
662
|
+
return report;
|
|
663
|
+
} catch (error) {
|
|
664
|
+
await finish(!signal.aborted);
|
|
665
|
+
throw error;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
async status() {
|
|
669
|
+
const { projectId, storage } = this.input;
|
|
670
|
+
const [heartbeats, lastRun] = await Promise.all([
|
|
671
|
+
storage.maintenanceHeartbeats?.list({ projectId }) ?? [],
|
|
672
|
+
storage.lakeRetentionRuns?.getLast({ projectId }) ?? null
|
|
673
|
+
]);
|
|
674
|
+
const heartbeat = heartbeats.find(({ owner }) => owner === "orchestrator") ?? null;
|
|
675
|
+
return lakeRetentionStatus({
|
|
676
|
+
settings: this.settings,
|
|
677
|
+
automatic: this.automatic,
|
|
678
|
+
heartbeat,
|
|
679
|
+
lastRun,
|
|
680
|
+
now: new Date
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
async protect() {
|
|
684
|
+
const applied = await this.input.sources.listActive({ projectId: this.input.projectId });
|
|
685
|
+
return applied.map(({ datasetVersion }) => ({
|
|
686
|
+
datasetId: datasetVersion.datasetId,
|
|
687
|
+
versionId: datasetVersion.versionId
|
|
688
|
+
}));
|
|
689
|
+
}
|
|
690
|
+
async keepVersionsForMs(configuredMs) {
|
|
691
|
+
const earliest = await oldestUnrecordedCommit(this.input.projectId, this.input.storage);
|
|
692
|
+
if (earliest === null)
|
|
693
|
+
return configuredMs;
|
|
694
|
+
return Math.max(configuredMs, Date.now() - earliest.getTime() + WRITER_CLOCK_SKEW_MS);
|
|
695
|
+
}
|
|
696
|
+
async recordRun(run) {
|
|
697
|
+
const { projectId, storage } = this.input;
|
|
698
|
+
await storage.lakeRetentionRuns?.record({ ...run, projectId }).catch((failure) => {
|
|
699
|
+
console.error("[Sixb] Could not record a lake retention run:", failure);
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
var runtimes2 = new WeakMap;
|
|
704
|
+
function registerLakeRetentionRuntime(host, runtime) {
|
|
705
|
+
runtimes2.set(host, runtime);
|
|
706
|
+
}
|
|
707
|
+
function getLakeRetentionRuntime2(host) {
|
|
708
|
+
const runtime = runtimes2.get(host);
|
|
709
|
+
if (!runtime) {
|
|
710
|
+
throw new Error("[Sixb] Lake retention requires a configured Sixb host.");
|
|
711
|
+
}
|
|
712
|
+
return runtime;
|
|
713
|
+
}
|
|
714
|
+
async function oldestUnrecordedCommit(projectId, storage) {
|
|
715
|
+
const open = { projectId, statuses: ["running"], order: "asc" };
|
|
716
|
+
const [syncs, pipelines, inbox] = await Promise.all([
|
|
717
|
+
storage.syncRuns?.list({ ...open, limit: OPEN_RUNS_LOOKED_AT }),
|
|
718
|
+
storage.pipelineRuns?.list({ ...open, limit: OPEN_RUNS_LOOKED_AT }),
|
|
719
|
+
storage.datasetIngest?.summarize({ projectId })
|
|
720
|
+
]);
|
|
721
|
+
const times = [
|
|
722
|
+
...(syncs?.runs ?? []).map((run) => run.commitPreparedAt),
|
|
723
|
+
...(pipelines?.runs ?? []).map((run) => run.startedAt),
|
|
724
|
+
...(inbox ?? []).map((summary) => summary.flushStartedAt)
|
|
725
|
+
].flatMap((time) => time ? [time.getTime()] : []);
|
|
726
|
+
return times.length > 0 ? new Date(Math.min(...times)) : null;
|
|
727
|
+
}
|
|
728
|
+
async function runRetentionPasses(input) {
|
|
729
|
+
const { maintenance, protect, keepVersionsForMs, options } = input;
|
|
730
|
+
const startedAt = Date.now();
|
|
731
|
+
let total;
|
|
732
|
+
for (;; ) {
|
|
733
|
+
options.signal?.throwIfAborted();
|
|
734
|
+
const report = await maintenance.applyRetention({
|
|
735
|
+
keepVersionsForMs: await keepVersionsForMs(),
|
|
736
|
+
deleteFilesAfterMs: options.deleteFilesAfterMs,
|
|
737
|
+
dryRun: options.dryRun ?? false,
|
|
738
|
+
protect: await protect(),
|
|
739
|
+
signal: options.signal
|
|
740
|
+
});
|
|
741
|
+
total = total === undefined ? report : addReports(total, report);
|
|
742
|
+
if (!report.hasMore || options.dryRun) {
|
|
743
|
+
return total;
|
|
744
|
+
}
|
|
745
|
+
const budgetSpent = options.budgetMs !== undefined && Date.now() - startedAt >= options.budgetMs;
|
|
746
|
+
if (budgetSpent) {
|
|
747
|
+
return total;
|
|
748
|
+
}
|
|
749
|
+
await waitUnlessAborted2(PASS_PAUSE_MS, options.signal);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
function addReports(total, pass) {
|
|
753
|
+
return {
|
|
754
|
+
...pass,
|
|
755
|
+
expiredVersions: total.expiredVersions + pass.expiredVersions,
|
|
756
|
+
keptVersions: pass.keptVersions,
|
|
757
|
+
deletedFiles: total.deletedFiles + pass.deletedFiles,
|
|
758
|
+
orphanedFiles: total.orphanedFiles + pass.orphanedFiles
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
function retentionOption(field, value) {
|
|
762
|
+
const durationMs = durationOption(field, value);
|
|
763
|
+
if (durationMs < MIN_RETENTION_MS) {
|
|
764
|
+
throw new RuntimeError2(`[Sixb] lakeMaintenance.${field} must be at least 1h; received "${value}".`);
|
|
765
|
+
}
|
|
766
|
+
return durationMs;
|
|
767
|
+
}
|
|
768
|
+
function durationOption(field, value) {
|
|
769
|
+
const durationMs = typeof value === "string" ? parseDuration2(value) : null;
|
|
770
|
+
if (durationMs === null || durationMs <= 0) {
|
|
771
|
+
throw new RuntimeError2(`[Sixb] lakeMaintenance.${field} must be a duration such as 30m, 12h or 7d; received ${JSON.stringify(value)}.`);
|
|
772
|
+
}
|
|
773
|
+
return durationMs;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
// src/models/execution/embedding.ts
|
|
777
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
778
|
+
function bindEmbeddingModels(catalog, session) {
|
|
779
|
+
if (!catalog)
|
|
780
|
+
return;
|
|
781
|
+
const entries = Object.freeze(catalog.list().map((entry) => Object.freeze({
|
|
782
|
+
...entry,
|
|
783
|
+
model: Object.freeze({
|
|
784
|
+
providerId: entry.model.providerId,
|
|
785
|
+
modelId: entry.model.modelId,
|
|
786
|
+
definition: entry.model.definition,
|
|
787
|
+
batching: entry.model.batching && Object.freeze({ ...entry.model.batching }),
|
|
788
|
+
embed: (input) => executeEmbedding(session, entry.model, input)
|
|
789
|
+
})
|
|
790
|
+
})));
|
|
791
|
+
const byRef = new Map(entries.map((entry) => [JSON.stringify([entry.provider, entry.modelId]), entry]));
|
|
792
|
+
return Object.freeze({
|
|
793
|
+
list: () => entries,
|
|
794
|
+
getByRef: (ref) => byRef.get(JSON.stringify([ref.provider, ref.modelId])) ?? null
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
async function executeEmbedding(session, binding, input) {
|
|
798
|
+
if (!Array.isArray(input.texts) || input.texts.some((text) => typeof text !== "string" || !text.trim())) {
|
|
799
|
+
throw new TypeError("[SixbModels] Embedding inputs must be nonempty strings.");
|
|
800
|
+
}
|
|
801
|
+
const texts = [...input.texts];
|
|
802
|
+
const purpose = input.purpose;
|
|
803
|
+
if (purpose !== undefined && purpose !== "document" && purpose !== "query") {
|
|
804
|
+
throw new TypeError("[SixbModels] Embedding purpose must be 'document' or 'query'.");
|
|
805
|
+
}
|
|
806
|
+
const signal = session.signal(input.signal);
|
|
807
|
+
signal.throwIfAborted();
|
|
808
|
+
if (!texts.length)
|
|
809
|
+
return { vectors: [] };
|
|
810
|
+
const accounting = await session.accounting();
|
|
811
|
+
accounting.assertHealthy();
|
|
812
|
+
const model = await binding.resolve?.() ?? binding;
|
|
813
|
+
assertEmbeddingModel(model);
|
|
814
|
+
if (!sameEmbeddingModel(model, binding)) {
|
|
815
|
+
throw new TypeError("[SixbModels] Resolved embedding model identity does not match the selected model.");
|
|
816
|
+
}
|
|
817
|
+
signal.throwIfAborted();
|
|
818
|
+
const callId = `call_${randomUUID2()}`;
|
|
819
|
+
const tokens = texts.reduce((sum, text) => sum + Math.ceil(new TextEncoder().encode(text).byteLength / 4), 0);
|
|
820
|
+
await session.admitEmbeddingCall(() => accounting.admitCall({
|
|
821
|
+
callId,
|
|
822
|
+
providerId: model.providerId,
|
|
823
|
+
modelId: model.modelId,
|
|
824
|
+
costEstimator: model.costEstimator,
|
|
825
|
+
inputTokens: { status: "estimated", tokens, method: "utf8BytesDividedByFour" },
|
|
826
|
+
outputTokenAllowance: 0,
|
|
827
|
+
estimatedTotalTokens: tokens
|
|
828
|
+
}));
|
|
829
|
+
let result;
|
|
830
|
+
try {
|
|
831
|
+
signal.throwIfAborted();
|
|
832
|
+
result = await model.embed({ texts, purpose, signal });
|
|
833
|
+
} catch (error) {
|
|
834
|
+
if (error instanceof EmbeddingModelResponseError2) {
|
|
835
|
+
await recordEmbedding(accounting, model, callId, error.metadata);
|
|
836
|
+
} else {
|
|
837
|
+
await recordEmbedding(accounting, model, callId, {});
|
|
838
|
+
}
|
|
839
|
+
throw error;
|
|
840
|
+
}
|
|
841
|
+
await recordEmbedding(accounting, model, callId, result ?? {});
|
|
842
|
+
signal.throwIfAborted();
|
|
843
|
+
return result;
|
|
844
|
+
}
|
|
845
|
+
async function recordEmbedding(accounting, model, callId, metadata) {
|
|
846
|
+
const usage = { ...metadata.usage, outputTokens: 0 };
|
|
847
|
+
const estimate = estimateModelCall(model, {
|
|
848
|
+
usage,
|
|
849
|
+
route: metadata.route,
|
|
850
|
+
responseModelId: metadata.responseModelId
|
|
851
|
+
});
|
|
852
|
+
await accounting.onModelCallEnd({
|
|
853
|
+
callId,
|
|
854
|
+
modelKind: "embedding",
|
|
855
|
+
providerId: model.providerId,
|
|
856
|
+
modelId: model.modelId,
|
|
857
|
+
responseId: metadata.providerIds?.responseId ?? callId,
|
|
858
|
+
responseModelId: metadata.responseModelId,
|
|
859
|
+
providerIds: metadata.providerIds,
|
|
860
|
+
usage,
|
|
861
|
+
cost: metadata.reportedCost ? { status: "reported", ...metadata.reportedCost } : estimate,
|
|
862
|
+
...metadata.reportedCost ? { estimate } : {},
|
|
863
|
+
route: metadata.route
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
// src/objects/vectors/indexing-shared.ts
|
|
868
|
+
import { randomUUID as randomUUID3 } from "crypto";
|
|
869
|
+
async function prepare(runtime, work) {
|
|
870
|
+
const profile = runtime.ontology.getObjectTypeById(work.ref.objectTypeId)?.search?.vectors?.[work.profile];
|
|
871
|
+
if (!profile || vectorConfiguration(profile) !== work.configuration)
|
|
872
|
+
return null;
|
|
873
|
+
const row = await runtime.storage.objects.getByPrimaryId({
|
|
874
|
+
projectId: runtime.projectId,
|
|
875
|
+
...work.ref
|
|
876
|
+
});
|
|
877
|
+
if (!row)
|
|
878
|
+
return null;
|
|
879
|
+
const sources = vectorSources(profile.source, row.properties);
|
|
880
|
+
if (sources.sourceFingerprint !== work.sourceFingerprint)
|
|
881
|
+
return null;
|
|
882
|
+
const storedVectors = await runtime.storage.ontology.vectors.list({
|
|
883
|
+
projectId: runtime.projectId,
|
|
884
|
+
ref: work.ref
|
|
885
|
+
});
|
|
886
|
+
const currentVector = storedVectors.find((entry) => entry.profile === work.profile);
|
|
887
|
+
const alreadyIndexed = currentVector?.configuration === work.configuration && currentVector.sourceFingerprint === work.sourceFingerprint;
|
|
888
|
+
if (alreadyIndexed)
|
|
889
|
+
return null;
|
|
890
|
+
return {
|
|
891
|
+
projectId: runtime.projectId,
|
|
892
|
+
ref: work.ref,
|
|
893
|
+
profile: work.profile,
|
|
894
|
+
configuration: work.configuration,
|
|
895
|
+
...sources,
|
|
896
|
+
expectedObject: {
|
|
897
|
+
ref: work.ref,
|
|
898
|
+
exists: true,
|
|
899
|
+
version: row.version,
|
|
900
|
+
lastCommitId: row.lastCommitId
|
|
901
|
+
},
|
|
902
|
+
expectedVectorCommitId: currentVector?.lastCommitId ?? null
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
async function storeVector(runtime, materializer, work, scope, signal) {
|
|
906
|
+
const indexing = runtime.storage.ontology.vectorIndexing;
|
|
907
|
+
const identity = { projectId: runtime.projectId, id: work.id };
|
|
908
|
+
for (let attempt = 0;attempt < 3; attempt++) {
|
|
909
|
+
signal.throwIfAborted();
|
|
910
|
+
const prepared = await prepare(runtime, work);
|
|
911
|
+
if (!prepared) {
|
|
912
|
+
await indexing.remove(identity);
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
try {
|
|
916
|
+
await commitPreparedVectors(materializer, scope, [{ input: prepared, values: work.values }]);
|
|
917
|
+
await indexing.remove(identity);
|
|
918
|
+
return;
|
|
919
|
+
} catch (error) {
|
|
920
|
+
if (!(error instanceof MaterializationConflictError2))
|
|
921
|
+
throw error;
|
|
922
|
+
const currentWork = await indexing.get(identity);
|
|
923
|
+
if (!currentWork)
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
throw new VectorIndexingDeferred2(new Date(Date.now() + 1000).toISOString());
|
|
928
|
+
}
|
|
929
|
+
async function commitPreparedVectors(materializer, scope, writes) {
|
|
930
|
+
await materializer.edits.commit({
|
|
931
|
+
scope,
|
|
932
|
+
input: {
|
|
933
|
+
mode: "atomic",
|
|
934
|
+
source: { kind: "runtime", requestId: randomUUID3() },
|
|
935
|
+
operations: [],
|
|
936
|
+
vectorWrites: writes,
|
|
937
|
+
expectedObjects: writes.map((write) => write.input.expectedObject),
|
|
938
|
+
expectedLinks: [],
|
|
939
|
+
expectedLinkScopes: []
|
|
940
|
+
}
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
async function indexingScope(runtime, work, indexingId = work.id) {
|
|
944
|
+
const operation = { type: "ontology.indexVectors", indexingId };
|
|
945
|
+
const execution = {
|
|
946
|
+
id: `exec_vector_${indexingId}`,
|
|
947
|
+
projectId: runtime.projectId,
|
|
948
|
+
executor: { type: "kernel", operation },
|
|
949
|
+
source: { type: "ontologyCommit", commitId: work.sourceCommitId },
|
|
950
|
+
correlationId: `vector_${indexingId}`
|
|
951
|
+
};
|
|
952
|
+
const authorization = createKernelRuntimeAuthorization({ execution, operation });
|
|
953
|
+
await ensureExecutionRecord2(runtime.storage.executions, {
|
|
954
|
+
...executionRecordInputFromRuntime({ execution, runtimeAuthorization: authorization }),
|
|
955
|
+
requesterGroupIds: []
|
|
956
|
+
});
|
|
957
|
+
return { execution, authorization };
|
|
958
|
+
}
|
|
959
|
+
async function fail(runtime, indexing, work, error) {
|
|
960
|
+
const failure = captureSixbFailure2(error, {
|
|
961
|
+
allowedCodes: VECTOR_INDEXING_FAILURE_CODES2,
|
|
962
|
+
defaultCode: "internal.unexpected"
|
|
963
|
+
});
|
|
964
|
+
const recorded = await indexing.update({
|
|
965
|
+
projectId: runtime.projectId,
|
|
966
|
+
id: work.id,
|
|
967
|
+
expectedStatus: work.status,
|
|
968
|
+
status: "failed",
|
|
969
|
+
availableAt: new Date().toISOString(),
|
|
970
|
+
error: failure
|
|
971
|
+
});
|
|
972
|
+
if (!recorded)
|
|
973
|
+
return;
|
|
974
|
+
reportVectorIndexingFailure(runtime, error, {
|
|
975
|
+
projectId: runtime.projectId,
|
|
976
|
+
indexingId: work.id,
|
|
977
|
+
failure,
|
|
978
|
+
...work.ref,
|
|
979
|
+
profile: work.profile
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
function retryAt(details) {
|
|
983
|
+
const resetAt = details && typeof details === "object" && "resetAt" in details ? details.resetAt : undefined;
|
|
984
|
+
const resetTimestamp = typeof resetAt === "string" ? Date.parse(resetAt) : Number.NaN;
|
|
985
|
+
const minimumRetryTimestamp = Date.now() + 60000;
|
|
986
|
+
const budgetResetTimestamp = Number.isFinite(resetTimestamp) ? resetTimestamp : 0;
|
|
987
|
+
const retryTimestamp = Math.max(minimumRetryTimestamp, budgetResetTimestamp);
|
|
988
|
+
return new Date(retryTimestamp).toISOString();
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
class VectorIndexingDeferred2 extends Error {
|
|
992
|
+
availableAt;
|
|
993
|
+
constructor(availableAt) {
|
|
994
|
+
super("[Sixb] Vector indexing is deferred.");
|
|
995
|
+
this.availableAt = availableAt;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
// src/objects/vectors/indexing-generate.ts
|
|
1000
|
+
async function generateVectors(runtime, entries, scope, attempt, signal) {
|
|
1001
|
+
const first = entries[0];
|
|
1002
|
+
const profile = runtime.ontology.resolveObjectType(first.work.ref.objectTypeId).search.vectors[first.work.profile];
|
|
1003
|
+
const generation = { runtime, entries, signal, phase: "pending" };
|
|
1004
|
+
const session = new ModelExecutionSession({ ...runtime, runtimeAuthorization: scope.authorization }, scope.execution);
|
|
1005
|
+
session.bind({
|
|
1006
|
+
attempt,
|
|
1007
|
+
signal,
|
|
1008
|
+
embeddingAdmission: (admit) => admitGeneration(generation, admit)
|
|
1009
|
+
});
|
|
1010
|
+
try {
|
|
1011
|
+
const model = bindEmbeddingModels(runtime.embeddingModels, session)?.getByRef({
|
|
1012
|
+
provider: profile.model.providerId,
|
|
1013
|
+
modelId: profile.model.modelId
|
|
1014
|
+
})?.model;
|
|
1015
|
+
if (!model || !sameEmbeddingModel(model, profile.model)) {
|
|
1016
|
+
throw createSixbError2("vector.model_unavailable", "[Sixb] Vector indexing requires the profile's configured embedding model.");
|
|
1017
|
+
}
|
|
1018
|
+
const result = await model.embed({
|
|
1019
|
+
texts: entries.map((entry) => entry.input.text),
|
|
1020
|
+
purpose: "document",
|
|
1021
|
+
signal: AbortSignal.any([signal, AbortSignal.timeout(INDEXING_EMBEDDING_TIMEOUT_MS)])
|
|
1022
|
+
});
|
|
1023
|
+
const values = normalizeEmbeddingResult(result, entries.length, profile.model.definition.dimensions);
|
|
1024
|
+
await runtime.storage.ontology.vectorIndexing.updateBatch({
|
|
1025
|
+
projectId: runtime.projectId,
|
|
1026
|
+
updates: entries.map(({ work }, index) => ({
|
|
1027
|
+
id: work.id,
|
|
1028
|
+
expectedStatus: "running",
|
|
1029
|
+
status: "ready",
|
|
1030
|
+
values: values[index],
|
|
1031
|
+
availableAt: new Date().toISOString()
|
|
1032
|
+
}))
|
|
1033
|
+
});
|
|
1034
|
+
} catch (error) {
|
|
1035
|
+
await handleGenerationFailure(generation, error);
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
async function admitGeneration(generation, admit) {
|
|
1039
|
+
generation.signal.throwIfAborted();
|
|
1040
|
+
generation.phase = "claiming";
|
|
1041
|
+
const claimed = await transitionWork(generation, "pending", "running", { requireAll: true });
|
|
1042
|
+
generation.phase = claimed ? "running" : "pending";
|
|
1043
|
+
if (!claimed) {
|
|
1044
|
+
if (generation.entries.length === 1) {
|
|
1045
|
+
throw new Error("[Sixb] Vector indexing request was superseded.");
|
|
1046
|
+
}
|
|
1047
|
+
throw new VectorIndexingDeferred2(new Date().toISOString());
|
|
1048
|
+
}
|
|
1049
|
+
try {
|
|
1050
|
+
await admit();
|
|
1051
|
+
} catch (error) {
|
|
1052
|
+
await transitionWork(generation, "running", "pending");
|
|
1053
|
+
generation.phase = "pending";
|
|
1054
|
+
throw error;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
function normalizeEmbeddingResult(result, count, dimensions) {
|
|
1058
|
+
try {
|
|
1059
|
+
if (!Array.isArray(result?.vectors) || result.vectors.length !== count) {
|
|
1060
|
+
throw new Error("Unexpected vector count");
|
|
1061
|
+
}
|
|
1062
|
+
return result.vectors.map((vector) => normalizeVector2(vector, dimensions));
|
|
1063
|
+
} catch (cause) {
|
|
1064
|
+
throw createSixbError2("vector.response_invalid", "[Sixb] Invalid embedding batch response.", {
|
|
1065
|
+
cause
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
async function handleGenerationFailure(generation, error) {
|
|
1070
|
+
if (generation.phase === "claiming" || error instanceof VectorIndexingDeferred2) {
|
|
1071
|
+
throw error;
|
|
1072
|
+
}
|
|
1073
|
+
if (generation.phase === "pending") {
|
|
1074
|
+
if (isSixbError2(error) && (error.code === "ai.usage_limit_exceeded" || error.code === "ai.usage_limit_unavailable")) {
|
|
1075
|
+
const availableAt = retryAt(error.details);
|
|
1076
|
+
await transitionWork(generation, "pending", "pending", { availableAt });
|
|
1077
|
+
throw new VectorIndexingDeferred2(availableAt);
|
|
1078
|
+
}
|
|
1079
|
+
if (generation.signal.aborted)
|
|
1080
|
+
throw error;
|
|
1081
|
+
}
|
|
1082
|
+
const failure = error instanceof EmbeddingModelResponseError2 ? createSixbError2("vector.response_invalid", "[Sixb] Invalid embedding batch response.", {
|
|
1083
|
+
cause: error
|
|
1084
|
+
}) : error;
|
|
1085
|
+
const { runtime, entries } = generation;
|
|
1086
|
+
const indexing = runtime.storage.ontology.vectorIndexing;
|
|
1087
|
+
for (const { work } of entries) {
|
|
1088
|
+
await fail(runtime, indexing, { ...work, status: generation.phase }, failure);
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
function transitionWork(generation, expectedStatus, status, options = {}) {
|
|
1092
|
+
const { runtime, entries } = generation;
|
|
1093
|
+
const availableAt = options.availableAt ?? new Date().toISOString();
|
|
1094
|
+
return runtime.storage.ontology.vectorIndexing.updateBatch({
|
|
1095
|
+
projectId: runtime.projectId,
|
|
1096
|
+
requireAll: options.requireAll ?? false,
|
|
1097
|
+
updates: entries.map(({ work }) => ({ id: work.id, expectedStatus, status, availableAt }))
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
// src/objects/vectors/indexing-single.ts
|
|
1102
|
+
async function processVector(runtime, materializer, id, attempt, signal) {
|
|
1103
|
+
const indexing = runtime.storage.ontology.vectorIndexing;
|
|
1104
|
+
if (!indexing)
|
|
1105
|
+
throw new Error("[Sixb] Storage does not support automatic vector indexing.");
|
|
1106
|
+
const projectId = runtime.projectId;
|
|
1107
|
+
const work = await indexing.get({ projectId, id });
|
|
1108
|
+
if (!work || work.status === "failed")
|
|
1109
|
+
return;
|
|
1110
|
+
if (work.status === "running") {
|
|
1111
|
+
await fail(runtime, indexing, work, createSixbError2("vector.outcome_unknown", "[Sixb] Interrupted embedding call has an unknown outcome; inference was not repeated."));
|
|
1112
|
+
return;
|
|
1113
|
+
}
|
|
1114
|
+
if (Date.parse(work.availableAt) > Date.now())
|
|
1115
|
+
throw new VectorIndexingDeferred2(work.availableAt);
|
|
1116
|
+
const prepared = await prepare(runtime, work);
|
|
1117
|
+
if (!prepared) {
|
|
1118
|
+
await indexing.remove({ projectId, id });
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
const scope = await indexingScope(runtime, work, work.batchId ?? work.id);
|
|
1122
|
+
if (work.status === "ready") {
|
|
1123
|
+
await storeVector(runtime, materializer, work, scope, signal);
|
|
1124
|
+
return;
|
|
1125
|
+
}
|
|
1126
|
+
await generateVectors(runtime, [{ work, input: prepared }], scope, attempt, signal);
|
|
1127
|
+
const ready = await indexing.get({ projectId, id });
|
|
1128
|
+
if (ready?.status === "ready")
|
|
1129
|
+
await storeVector(runtime, materializer, ready, scope, signal);
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
// src/objects/vectors/indexing-store-batch.ts
|
|
1133
|
+
async function storeVectorBatch(runtime, materializer, batchId, scope, signal) {
|
|
1134
|
+
const indexing = runtime.storage.ontology.vectorIndexing;
|
|
1135
|
+
const identity = { projectId: runtime.projectId, batchId };
|
|
1136
|
+
for (let attempt = 0;attempt < 3; attempt++) {
|
|
1137
|
+
const ready = (await indexing.getBatch(identity)).filter((work) => work.status === "ready");
|
|
1138
|
+
const writes = [];
|
|
1139
|
+
for (const work of ready) {
|
|
1140
|
+
signal.throwIfAborted();
|
|
1141
|
+
const input = await prepare(runtime, work);
|
|
1142
|
+
if (input) {
|
|
1143
|
+
writes.push({ input, values: work.values });
|
|
1144
|
+
} else {
|
|
1145
|
+
await indexing.remove({ projectId: runtime.projectId, id: work.id });
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
if (!writes.length)
|
|
1149
|
+
return;
|
|
1150
|
+
try {
|
|
1151
|
+
signal.throwIfAborted();
|
|
1152
|
+
await commitPreparedVectors(materializer, scope, writes);
|
|
1153
|
+
return;
|
|
1154
|
+
} catch (error) {
|
|
1155
|
+
if (!(error instanceof MaterializationConflictError2))
|
|
1156
|
+
throw error;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
let deferred = false;
|
|
1160
|
+
for (const work of await indexing.getBatch(identity)) {
|
|
1161
|
+
if (work.status !== "ready")
|
|
1162
|
+
continue;
|
|
1163
|
+
try {
|
|
1164
|
+
await storeVector(runtime, materializer, work, scope, signal);
|
|
1165
|
+
} catch (error) {
|
|
1166
|
+
if (!(error instanceof VectorIndexingDeferred2))
|
|
1167
|
+
throw error;
|
|
1168
|
+
deferred = true;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
if (deferred)
|
|
1172
|
+
throw new VectorIndexingDeferred2(new Date(Date.now() + 1000).toISOString());
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
// src/objects/vectors/indexing-batch.ts
|
|
1176
|
+
async function processVectorBatch(runtime, materializer, batchId, batch, attempt, signal) {
|
|
1177
|
+
if (batch.some((work) => work.status !== "pending")) {
|
|
1178
|
+
await resumeBatch(runtime, materializer, batchId, batch, attempt, signal);
|
|
1179
|
+
return;
|
|
1180
|
+
}
|
|
1181
|
+
const entries = await prepareBatch(runtime, batch, signal);
|
|
1182
|
+
const first = entries[0];
|
|
1183
|
+
if (!first)
|
|
1184
|
+
return;
|
|
1185
|
+
const limits = getBatchLimits(runtime, first.work);
|
|
1186
|
+
if (!limits) {
|
|
1187
|
+
for (const { work } of entries) {
|
|
1188
|
+
await processVector(runtime, materializer, work.id, attempt, signal);
|
|
1189
|
+
}
|
|
1190
|
+
return;
|
|
1191
|
+
}
|
|
1192
|
+
assertCompatibleEntries(entries, first.work);
|
|
1193
|
+
const scope = await indexingScope(runtime, first.work, batchId);
|
|
1194
|
+
for (const group of partition(entries, limits)) {
|
|
1195
|
+
if (group.length === 1) {
|
|
1196
|
+
await processVector(runtime, materializer, group[0].work.id, attempt, signal);
|
|
1197
|
+
} else {
|
|
1198
|
+
await generateVectors(runtime, group, scope, attempt, signal);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
await storeVectorBatch(runtime, materializer, batchId, scope, signal);
|
|
1202
|
+
}
|
|
1203
|
+
async function resumeBatch(runtime, materializer, batchId, batch, attempt, signal) {
|
|
1204
|
+
const ready = batch.find((work) => work.status === "ready");
|
|
1205
|
+
if (ready) {
|
|
1206
|
+
const scope = await indexingScope(runtime, ready, batchId);
|
|
1207
|
+
await storeVectorBatch(runtime, materializer, batchId, scope, signal);
|
|
1208
|
+
}
|
|
1209
|
+
for (const work of batch) {
|
|
1210
|
+
if (work.status !== "ready") {
|
|
1211
|
+
await processVector(runtime, materializer, work.id, attempt, signal);
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
async function prepareBatch(runtime, batch, signal) {
|
|
1216
|
+
const availableAt = batch.reduce((latest, work) => work.availableAt > latest ? work.availableAt : latest, "");
|
|
1217
|
+
if (Date.parse(availableAt) > Date.now()) {
|
|
1218
|
+
throw new VectorIndexingDeferred2(availableAt);
|
|
1219
|
+
}
|
|
1220
|
+
const entries = [];
|
|
1221
|
+
const indexing = runtime.storage.ontology.vectorIndexing;
|
|
1222
|
+
for (const work of batch) {
|
|
1223
|
+
signal.throwIfAborted();
|
|
1224
|
+
const input = await prepare(runtime, work);
|
|
1225
|
+
if (input) {
|
|
1226
|
+
entries.push({ work, input });
|
|
1227
|
+
} else {
|
|
1228
|
+
await indexing.remove({ projectId: runtime.projectId, id: work.id });
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
return entries;
|
|
1232
|
+
}
|
|
1233
|
+
function getBatchLimits(runtime, work) {
|
|
1234
|
+
const profile = runtime.ontology.resolveObjectType(work.ref.objectTypeId).search.vectors[work.profile];
|
|
1235
|
+
return runtime.embeddingModels?.getByRef({
|
|
1236
|
+
provider: profile.model.providerId,
|
|
1237
|
+
modelId: profile.model.modelId
|
|
1238
|
+
})?.model.batching;
|
|
1239
|
+
}
|
|
1240
|
+
function assertCompatibleEntries(entries, reference) {
|
|
1241
|
+
const incompatible = entries.some(({ work }) => work.sourceCommitId !== reference.sourceCommitId || work.ref.objectTypeId !== reference.ref.objectTypeId || work.profile !== reference.profile || work.configuration !== reference.configuration);
|
|
1242
|
+
if (incompatible) {
|
|
1243
|
+
throw new Error("[Sixb] Incompatible vector batch membership.");
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
function* partition(entries, limits) {
|
|
1247
|
+
let group = [];
|
|
1248
|
+
let bytes = 0;
|
|
1249
|
+
for (const entry of entries) {
|
|
1250
|
+
const size = Buffer.byteLength(entry.input.text);
|
|
1251
|
+
const exceedsGroupLimit = group.length >= limits.maxInputs || bytes + size > limits.maxTotalInputBytes || size > limits.maxInputBytes;
|
|
1252
|
+
if (group.length > 0 && exceedsGroupLimit) {
|
|
1253
|
+
yield group;
|
|
1254
|
+
group = [];
|
|
1255
|
+
bytes = 0;
|
|
1256
|
+
}
|
|
1257
|
+
if (size > limits.maxInputBytes || size > limits.maxTotalInputBytes) {
|
|
1258
|
+
yield [entry];
|
|
1259
|
+
continue;
|
|
1260
|
+
}
|
|
1261
|
+
group.push(entry);
|
|
1262
|
+
bytes += size;
|
|
1263
|
+
}
|
|
1264
|
+
if (group.length > 0)
|
|
1265
|
+
yield group;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
// src/objects/vectors/indexing.ts
|
|
1269
|
+
function createVectorIndexingRuntime(runtime, materializer) {
|
|
1270
|
+
return {
|
|
1271
|
+
async process(id, attempt, signal) {
|
|
1272
|
+
const indexing = runtime.storage.ontology.vectorIndexing;
|
|
1273
|
+
if (!indexing)
|
|
1274
|
+
throw new Error("[Sixb] Storage does not support automatic vector indexing.");
|
|
1275
|
+
const batch = await indexing.getBatch({ projectId: runtime.projectId, batchId: id });
|
|
1276
|
+
if (batch.length)
|
|
1277
|
+
await processVectorBatch(runtime, materializer, id, batch, attempt, signal);
|
|
1278
|
+
else
|
|
1279
|
+
await processVector(runtime, materializer, id, attempt, signal);
|
|
1280
|
+
}
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
// src/objects/vectors/indexing-runtime.ts
|
|
1285
|
+
var runtimes3 = new WeakMap;
|
|
1286
|
+
function registerVectorIndexingRuntime(host, runtime) {
|
|
1287
|
+
runtimes3.set(host, runtime);
|
|
1288
|
+
}
|
|
1289
|
+
function getVectorIndexingRuntime2(host) {
|
|
1290
|
+
const runtime = runtimes3.get(host);
|
|
1291
|
+
if (!runtime)
|
|
1292
|
+
throw new Error("[Sixb] Vector indexing requires a configured Sixb host.");
|
|
1293
|
+
return runtime;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
// src/runtime/public-origin.ts
|
|
1297
|
+
var apiPublicOrigins = new WeakMap;
|
|
1298
|
+
function setApiPublicOrigin2(host, origin) {
|
|
1299
|
+
apiPublicOrigins.set(host, normalizeOrigin(origin));
|
|
1300
|
+
}
|
|
1301
|
+
function getApiPublicOrigin(host) {
|
|
1302
|
+
return apiPublicOrigins.get(host);
|
|
1303
|
+
}
|
|
1304
|
+
function normalizeOrigin(value) {
|
|
1305
|
+
let url;
|
|
1306
|
+
try {
|
|
1307
|
+
url = new URL(value);
|
|
1308
|
+
} catch {
|
|
1309
|
+
throw new Error(`[Sixb] Invalid API public origin: '${value}'.`);
|
|
1310
|
+
}
|
|
1311
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
1312
|
+
throw new Error("[Sixb] The API public origin must use http or https.");
|
|
1313
|
+
}
|
|
1314
|
+
if (url.pathname !== "/" || url.search || url.hash) {
|
|
1315
|
+
throw new Error("[Sixb] The API public origin must be an origin, not a full URL.");
|
|
1316
|
+
}
|
|
1317
|
+
return url.origin;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
export { DatasetIngestFlushError2, createDatasetIngestRuntime, registerDatasetIngestRuntime, findDatasetIngestRuntime2, getDatasetIngestRuntime2, parseDuration2, lakeRetentionPass, operationalStatus, LakeRetention, registerLakeRetentionRuntime, getLakeRetentionRuntime2, bindEmbeddingModels, VectorIndexingDeferred2, createVectorIndexingRuntime, registerVectorIndexingRuntime, getVectorIndexingRuntime2, setApiPublicOrigin2, getApiPublicOrigin };
|
|
1321
|
+
|
|
1322
|
+
//# debugId=C466E0CAFD5A90BB64756E2164756E21
|