@sixb/core 0.2.4 → 0.2.6
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 +41 -40
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/validation.d.ts.map +1 -1
- package/dist/agents/errors.d.ts +1 -1
- package/dist/agents/errors.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +50 -3
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/ids.d.ts +2 -0
- package/dist/agents/ids.d.ts.map +1 -1
- package/dist/agents/index.d.ts +7 -5
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +74 -50
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-routing.d.ts +5 -2
- package/dist/agents/model-routing.d.ts.map +1 -1
- package/dist/agents/queued-turn.d.ts +16 -0
- package/dist/agents/queued-turn.d.ts.map +1 -0
- package/dist/agents/request.d.ts +120 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/run-after-finish.d.ts +10 -0
- package/dist/agents/run-after-finish.d.ts.map +1 -1
- package/dist/agents/run-artifacts.d.ts +0 -38
- package/dist/agents/run-artifacts.d.ts.map +1 -1
- package/dist/agents/run-events.d.ts +10 -1
- package/dist/agents/run-events.d.ts.map +1 -1
- package/dist/agents/run-session-children.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 +14 -1
- package/dist/agents/run-session.d.ts.map +1 -1
- package/dist/agents/run-turn.d.ts +9 -1
- package/dist/agents/run-turn.d.ts.map +1 -1
- package/dist/agents/streams/index.d.ts +1 -1
- package/dist/agents/streams/index.d.ts.map +1 -1
- package/dist/agents/streams/index.js +1 -1
- package/dist/agents/streams/internal.d.ts +2 -1
- package/dist/agents/streams/internal.d.ts.map +1 -1
- package/dist/agents/streams/internal.js +22 -2
- package/dist/agents/streams/internal.js.map +1 -1
- package/dist/agents/streams/protocol.d.ts +53 -0
- package/dist/agents/streams/protocol.d.ts.map +1 -1
- package/dist/agents/streams/steps.d.ts +24 -0
- package/dist/agents/streams/steps.d.ts.map +1 -0
- package/dist/agents/thread-access.d.ts +44 -2
- package/dist/agents/thread-access.d.ts.map +1 -1
- package/dist/agents/turn-answered.d.ts +7 -0
- package/dist/agents/turn-answered.d.ts.map +1 -0
- package/dist/agents/validation.d.ts +1 -1
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/artifacts/canvas-display.d.ts +3 -5
- package/dist/artifacts/canvas-display.d.ts.map +1 -1
- package/dist/artifacts/comments.d.ts +14 -3
- package/dist/artifacts/comments.d.ts.map +1 -1
- package/dist/artifacts/document-fill.d.ts +18 -0
- package/dist/artifacts/document-fill.d.ts.map +1 -0
- package/dist/artifacts/errors.d.ts +1 -1
- package/dist/artifacts/errors.d.ts.map +1 -1
- package/dist/artifacts/events.d.ts +3 -2
- package/dist/artifacts/events.d.ts.map +1 -1
- package/dist/artifacts/execution.d.ts +40 -4
- package/dist/artifacts/execution.d.ts.map +1 -1
- package/dist/artifacts/frames/assets.d.ts +8 -1
- package/dist/artifacts/frames/assets.d.ts.map +1 -1
- package/dist/artifacts/frames/document-data.d.ts +98 -0
- package/dist/artifacts/frames/document-data.d.ts.map +1 -0
- package/dist/artifacts/frames/entries.d.ts +12 -7
- package/dist/artifacts/frames/entries.d.ts.map +1 -1
- package/dist/artifacts/frames/index.d.ts +2 -1
- package/dist/artifacts/frames/index.d.ts.map +1 -1
- package/dist/artifacts/frames/index.js +22 -13
- package/dist/artifacts/frames/index.js.map +4 -4
- package/dist/artifacts/frames/kit.d.ts +15 -0
- package/dist/artifacts/frames/kit.d.ts.map +1 -1
- package/dist/artifacts/frames/protocol.d.ts +12 -1
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/runtime.d.ts +24 -4
- package/dist/artifacts/frames/runtime.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +3 -1
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +9 -3
- package/dist/artifacts/index.js.map +3 -3
- package/dist/artifacts/live/blocks.d.ts +62 -0
- package/dist/artifacts/live/blocks.d.ts.map +1 -0
- package/dist/artifacts/live/board.d.ts +6 -0
- package/dist/artifacts/live/board.d.ts.map +1 -1
- package/dist/artifacts/live/document.d.ts +12 -0
- package/dist/artifacts/live/document.d.ts.map +1 -1
- package/dist/artifacts/live/index.d.ts +2 -0
- package/dist/artifacts/live/index.d.ts.map +1 -1
- package/dist/artifacts/live/index.js +148 -44
- package/dist/artifacts/live/index.js.map +3 -3
- package/dist/artifacts/live/page.d.ts +49 -0
- package/dist/artifacts/live/page.d.ts.map +1 -0
- package/dist/artifacts/live/protocol.d.ts +5 -0
- package/dist/artifacts/live/protocol.d.ts.map +1 -1
- package/dist/artifacts/live/server.d.ts +2 -2
- package/dist/artifacts/live/server.d.ts.map +1 -1
- package/dist/artifacts/live/server.js +29 -24
- package/dist/artifacts/live/server.js.map +1 -1
- package/dist/artifacts/live/state.d.ts +4 -1
- package/dist/artifacts/live/state.d.ts.map +1 -1
- package/dist/artifacts/outline.d.ts +16 -0
- package/dist/artifacts/outline.d.ts.map +1 -1
- package/dist/artifacts/paper.d.ts +22 -0
- package/dist/artifacts/paper.d.ts.map +1 -0
- package/dist/artifacts/pdf-job.d.ts +9 -0
- package/dist/artifacts/pdf-job.d.ts.map +1 -0
- package/dist/artifacts/publish/fields.d.ts +25 -0
- package/dist/artifacts/publish/fields.d.ts.map +1 -0
- package/dist/artifacts/publish/index.d.ts +2 -1
- package/dist/artifacts/publish/index.d.ts.map +1 -1
- package/dist/artifacts/publish/index.js +32 -23
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/merge.d.ts +7 -6
- package/dist/artifacts/publish/merge.d.ts.map +1 -1
- package/dist/artifacts/publish/pdf.d.ts +28 -0
- package/dist/artifacts/publish/pdf.d.ts.map +1 -0
- package/dist/artifacts/publish/previews.d.ts +12 -20
- package/dist/artifacts/publish/previews.d.ts.map +1 -1
- package/dist/artifacts/publish/publish.d.ts.map +1 -1
- package/dist/artifacts/publish/queries.d.ts +6 -1
- package/dist/artifacts/publish/queries.d.ts.map +1 -1
- package/dist/artifacts/publish/query-answers.d.ts +5 -2
- package/dist/artifacts/publish/query-answers.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/document-html.d.ts +24 -0
- package/dist/artifacts/publish/validate/document-html.d.ts.map +1 -0
- package/dist/artifacts/publish/validate/document.d.ts +5 -3
- package/dist/artifacts/publish/validate/document.d.ts.map +1 -1
- package/dist/artifacts/queries.d.ts +16 -2
- package/dist/artifacts/queries.d.ts.map +1 -1
- package/dist/artifacts/run-query.d.ts.map +1 -1
- package/dist/auth/index.js +6 -6
- package/dist/authorization/event-visibility.d.ts.map +1 -1
- package/dist/authorization/index.js +2 -2
- package/dist/blob-storage/index.js +1 -1
- package/dist/bootstrap/index.js +50 -48
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/calendar.d.ts +55 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +19 -0
- package/dist/calendar.js.map +9 -0
- package/dist/{chunk-5a4a52tq.js → chunk-0pmpwn3g.js} +18 -2
- package/dist/chunk-0pmpwn3g.js.map +10 -0
- package/dist/{chunk-0k3r5kb3.js → chunk-394zjzjs.js} +20 -10
- package/dist/{chunk-0k3r5kb3.js.map → chunk-394zjzjs.js.map} +5 -5
- package/dist/{chunk-stmxh0hv.js → chunk-3neam1y5.js} +2 -2
- package/dist/{chunk-zeykm8my.js → chunk-3qtk0070.js} +16 -42
- package/dist/chunk-3qtk0070.js.map +14 -0
- package/dist/{chunk-p8pgnq8d.js → chunk-425ydk65.js} +5 -5
- package/dist/{chunk-p351afzm.js → chunk-5sswe5ej.js} +2 -2
- package/dist/{chunk-a6fjkcne.js → chunk-60662fyv.js} +54 -28
- package/dist/{chunk-a6fjkcne.js.map → chunk-60662fyv.js.map} +7 -6
- package/dist/{chunk-e0hnbb1m.js → chunk-61zptves.js} +1 -1
- package/dist/chunk-6hfbz4d0.js +98 -0
- package/dist/chunk-6hfbz4d0.js.map +10 -0
- package/dist/{chunk-3zagkr6w.js → chunk-7mhbs9yy.js} +4 -4
- package/dist/{chunk-3zagkr6w.js.map → chunk-7mhbs9yy.js.map} +1 -1
- package/dist/{chunk-gxwy4c3s.js → chunk-7r9mqpva.js} +570 -104
- package/dist/chunk-7r9mqpva.js.map +47 -0
- package/dist/{chunk-3014rfjz.js → chunk-88xeh6zx.js} +28 -8
- package/dist/{chunk-3014rfjz.js.map → chunk-88xeh6zx.js.map} +4 -4
- package/dist/{chunk-9nsjjd44.js → chunk-8tv3qd65.js} +2 -1
- package/dist/chunk-8tv3qd65.js.map +12 -0
- package/dist/chunk-90nqenq8.js +386 -0
- package/dist/chunk-90nqenq8.js.map +14 -0
- package/dist/{chunk-fe6r7yhg.js → chunk-92wrka15.js} +1 -1
- package/dist/{chunk-w1wq7gfr.js → chunk-9c9yknwt.js} +464 -29
- package/dist/{chunk-w1wq7gfr.js.map → chunk-9c9yknwt.js.map} +7 -7
- package/dist/{chunk-q9nkpr8k.js → chunk-9tpmfh3n.js} +1 -1
- package/dist/chunk-9wr3yajk.js.map +2 -2
- package/dist/{chunk-rtm1jq00.js → chunk-ats8y3d9.js} +1202 -246
- package/dist/{chunk-rtm1jq00.js.map → chunk-ats8y3d9.js.map} +16 -14
- package/dist/{chunk-td26wjr5.js → chunk-bcz9dxtf.js} +17 -47
- package/dist/chunk-bcz9dxtf.js.map +12 -0
- package/dist/chunk-bqr703h4.js +1799 -0
- package/dist/chunk-bqr703h4.js.map +13 -0
- package/dist/{chunk-sysnvjce.js → chunk-brhp9d97.js} +2 -2
- package/dist/{chunk-8a8k38tz.js → chunk-brybqw5k.js} +1 -1
- package/dist/{chunk-rsxb14an.js → chunk-bs1sd0e0.js} +12 -8
- package/dist/chunk-bs1sd0e0.js.map +18 -0
- package/dist/{chunk-eptrvnby.js → chunk-c29729me.js} +42 -3
- package/dist/chunk-c29729me.js.map +12 -0
- package/dist/{chunk-855w9nvw.js → chunk-cg7cygfj.js} +1 -1
- package/dist/chunk-dq3t5sr3.js +114 -0
- package/dist/chunk-dq3t5sr3.js.map +11 -0
- package/dist/{chunk-t24yktqr.js → chunk-dvgc56n2.js} +20 -4
- package/dist/{chunk-t24yktqr.js.map → chunk-dvgc56n2.js.map} +5 -5
- package/dist/{chunk-r2psmn42.js → chunk-eg6xqef7.js} +1 -1
- package/dist/{chunk-7kpqntgw.js → chunk-f05994as.js} +1 -1
- package/dist/{chunk-msyevpp3.js → chunk-fmgf9h5e.js} +38 -14
- package/dist/chunk-fmgf9h5e.js.map +22 -0
- package/dist/{chunk-b9qfh2ya.js → chunk-fzbhybya.js} +29 -2
- package/dist/chunk-fzbhybya.js.map +11 -0
- package/dist/{chunk-t0s7b3d1.js → chunk-gaj8djsw.js} +251 -6
- package/dist/chunk-gaj8djsw.js.map +13 -0
- package/dist/{chunk-2bn6813a.js → chunk-grt2j5vp.js} +2 -2
- package/dist/{chunk-s7xqfxs9.js → chunk-hkbks1xm.js} +3 -1
- package/dist/{chunk-s7xqfxs9.js.map → chunk-hkbks1xm.js.map} +3 -3
- package/dist/chunk-hn2r7z41.js.map +1 -1
- package/dist/{chunk-rtdrm592.js → chunk-htdzx40w.js} +2 -2
- package/dist/{chunk-bc3y6gff.js → chunk-jka26v8c.js} +1 -1
- package/dist/{chunk-yy914zfr.js → chunk-jt012fxq.js} +772 -98
- package/dist/chunk-jt012fxq.js.map +34 -0
- package/dist/{chunk-48c1z8nj.js → chunk-kft7mp7z.js} +28 -3
- package/dist/chunk-kft7mp7z.js.map +10 -0
- package/dist/chunk-mbwsgjn7.js +40 -0
- package/dist/chunk-mbwsgjn7.js.map +11 -0
- package/dist/{chunk-wa05txmk.js → chunk-n1hbwc6y.js} +51 -8
- package/dist/chunk-n1hbwc6y.js.map +12 -0
- package/dist/{chunk-n4zzaf6q.js → chunk-nxysqbt0.js} +4 -2
- package/dist/chunk-nxysqbt0.js.map +10 -0
- package/dist/{chunk-6ef4esq4.js → chunk-pqj8vff9.js} +4 -4
- package/dist/chunk-pvpq483h.js.map +2 -2
- package/dist/{chunk-mzx71snp.js → chunk-q7g9cqwt.js} +7 -2
- package/dist/{chunk-mzx71snp.js.map → chunk-q7g9cqwt.js.map} +3 -3
- package/dist/{chunk-n68vz95m.js → chunk-qbd282aa.js} +2 -2
- package/dist/{chunk-e91fmg6t.js → chunk-qsa7nw6f.js} +2 -1
- package/dist/{chunk-e91fmg6t.js.map → chunk-qsa7nw6f.js.map} +3 -3
- package/dist/{chunk-rsrc7vtw.js → chunk-s8xxef60.js} +240 -46
- package/dist/chunk-s8xxef60.js.map +50 -0
- package/dist/{chunk-r9rtavg9.js → chunk-t19wjmnc.js} +7 -7
- package/dist/{chunk-vzkxqf8h.js → chunk-tapdssb5.js} +50 -6
- package/dist/chunk-tapdssb5.js.map +23 -0
- package/dist/{chunk-dhkc9b23.js → chunk-v8a1qjzp.js} +1 -1
- package/dist/{chunk-hvbvq7p4.js → chunk-vs2s3p8n.js} +731 -10
- package/dist/chunk-vs2s3p8n.js.map +20 -0
- package/dist/chunk-vtjzwymr.js.map +2 -2
- package/dist/{chunk-8t2ynwg0.js → chunk-wzcjhv54.js} +31 -1
- package/dist/{chunk-8t2ynwg0.js.map → chunk-wzcjhv54.js.map} +3 -3
- package/dist/{chunk-8tqnsx3q.js → chunk-xavet0qs.js} +5 -3
- package/dist/{chunk-8tqnsx3q.js.map → chunk-xavet0qs.js.map} +3 -3
- package/dist/{chunk-8bns0y68.js → chunk-xf76csps.js} +5 -5
- package/dist/{chunk-cwdzcv37.js → chunk-xrmbhap8.js} +2 -2
- package/dist/{chunk-cwdzcv37.js.map → chunk-xrmbhap8.js.map} +2 -2
- package/dist/{chunk-f6ahf5gf.js → chunk-xxfj0rr2.js} +20 -5
- package/dist/chunk-xxfj0rr2.js.map +13 -0
- package/dist/{chunk-3hzhcfsv.js → chunk-y8fwm3z2.js} +2 -2
- package/dist/{chunk-3hzhcfsv.js.map → chunk-y8fwm3z2.js.map} +3 -3
- package/dist/{chunk-smnt672s.js → chunk-ygvay56w.js} +20 -4
- package/dist/chunk-ygvay56w.js.map +10 -0
- package/dist/{chunk-evj5jxz3.js → chunk-ykchk644.js} +63 -15
- package/dist/{chunk-evj5jxz3.js.map → chunk-ykchk644.js.map} +7 -7
- package/dist/{chunk-vepea5c3.js → chunk-ym1bqd98.js} +6 -6
- package/dist/{chunk-yv8hv4wq.js → chunk-z4jqb44a.js} +3 -1
- package/dist/chunk-z4jqb44a.js.map +10 -0
- package/dist/connectors/connection-handles.d.ts +9 -0
- package/dist/connectors/connection-handles.d.ts.map +1 -0
- package/dist/connectors/connections/authorizations.d.ts +9 -0
- package/dist/connectors/connections/authorizations.d.ts.map +1 -1
- package/dist/connectors/connections/capability.d.ts +11 -0
- package/dist/connectors/connections/capability.d.ts.map +1 -1
- package/dist/connectors/connections/events.d.ts +17 -0
- package/dist/connectors/connections/events.d.ts.map +1 -0
- package/dist/connectors/connections/internal.d.ts +2 -1
- package/dist/connectors/connections/internal.d.ts.map +1 -1
- package/dist/connectors/connections/internal.js +8 -4
- package/dist/connectors/connections/internal.js.map +1 -1
- package/dist/connectors/connections/runs.d.ts +3 -0
- package/dist/connectors/connections/runs.d.ts.map +1 -1
- package/dist/connectors/connections/service.d.ts +13 -1
- package/dist/connectors/connections/service.d.ts.map +1 -1
- package/dist/connectors/execution.d.ts +14 -2
- 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 +5 -1
- package/dist/connectors/service.d.ts.map +1 -1
- package/dist/connectors/types.d.ts +22 -1
- package/dist/connectors/types.d.ts.map +1 -1
- package/dist/datasets/write.js +1 -1
- package/dist/deploy/index.d.ts +1 -1
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/internal.js +3 -2
- package/dist/deploy/internal.js.map +3 -3
- package/dist/deploy/services.d.ts.map +1 -1
- package/dist/deploy/types.d.ts +22 -2
- package/dist/deploy/types.d.ts.map +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 +8 -1
- package/dist/events/execution.d.ts.map +1 -1
- package/dist/events/index.d.ts +2 -2
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +3 -3
- package/dist/events/outbox-dispatcher.d.ts +7 -0
- package/dist/events/outbox-dispatcher.d.ts.map +1 -1
- package/dist/events/scope.d.ts +1 -0
- package/dist/events/scope.d.ts.map +1 -1
- package/dist/events/scope.js +1 -1
- package/dist/events/selectors/builder.d.ts +9 -1
- package/dist/events/selectors/builder.d.ts.map +1 -1
- package/dist/events/selectors/index.d.ts +2 -2
- package/dist/events/selectors/index.d.ts.map +1 -1
- package/dist/events/selectors/index.js +2 -2
- package/dist/events/selectors/predicate.d.ts.map +1 -1
- package/dist/events/selectors/types.d.ts +18 -3
- package/dist/events/selectors/types.d.ts.map +1 -1
- package/dist/events/types/artifacts.d.ts +7 -1
- package/dist/events/types/artifacts.d.ts.map +1 -1
- package/dist/events/types/connectors.d.ts +32 -0
- package/dist/events/types/connectors.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/syncs.d.ts +4 -0
- package/dist/events/types/syncs.d.ts.map +1 -1
- package/dist/execution/agent.js +43 -42
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorization.d.ts +5 -0
- package/dist/execution/authorization.d.ts.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts +4 -0
- package/dist/execution/authorized-object-reader.d.ts.map +1 -1
- package/dist/execution/object-reader-ontology.d.ts +3 -0
- package/dist/execution/object-reader-ontology.d.ts.map +1 -1
- package/dist/execution/primitive.js +41 -40
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.d.ts +1 -1
- package/dist/execution/request.d.ts.map +1 -1
- package/dist/execution/request.js +39 -38
- package/dist/execution/request.js.map +3 -3
- package/dist/execution/scopes.d.ts +8 -0
- package/dist/execution/scopes.d.ts.map +1 -1
- package/dist/execution/script.d.ts +7 -0
- package/dist/execution/script.d.ts.map +1 -0
- package/dist/execution/types.d.ts +16 -1
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +13 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -70
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/index.js +1 -1
- package/dist/lineage/executors.d.ts +1 -1
- package/dist/lineage/executors.d.ts.map +1 -1
- package/dist/maintenance/index.js +2 -2
- package/dist/materialization/event-envelopes.d.ts +3 -3
- package/dist/materialization/event-envelopes.d.ts.map +1 -1
- package/dist/materialization/events.d.ts +6 -0
- package/dist/materialization/events.d.ts.map +1 -1
- package/dist/materialization/index.js +1 -1
- package/dist/materialization/model.d.ts +6 -0
- package/dist/materialization/model.d.ts.map +1 -1
- package/dist/materializer/index.js +24 -23
- package/dist/materializer/index.js.map +1 -1
- package/dist/materializer/projections/replace.d.ts.map +1 -1
- package/dist/materializer/projections/replacement-plan.d.ts +2 -0
- package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
- package/dist/materializer/shared/normalize.d.ts +1 -0
- package/dist/materializer/shared/normalize.d.ts.map +1 -1
- package/dist/models/audio/runtime.d.ts.map +1 -1
- package/dist/models/audio/types.d.ts +19 -0
- package/dist/models/audio/types.d.ts.map +1 -1
- package/dist/models/execution/index.js +22 -21
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/objects/index.js +41 -40
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/executor.d.ts +3 -1
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/explain.d.ts +3 -1
- package/dist/objects/query/explain.d.ts.map +1 -1
- package/dist/objects/query/index.d.ts +1 -1
- package/dist/objects/query/index.d.ts.map +1 -1
- package/dist/objects/query/index.js +21 -20
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/link-query-clearance.d.ts +3 -0
- package/dist/objects/query/link-query-clearance.d.ts.map +1 -1
- package/dist/objects/query/links.d.ts +1 -1
- package/dist/objects/query/links.d.ts.map +1 -1
- package/dist/objects/query/validate.d.ts +17 -0
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/objects/sdk/runtime-query-executor.d.ts +1 -1
- package/dist/objects/sdk/runtime-query-executor.d.ts.map +1 -1
- package/dist/ontology/index.js +3 -3
- package/dist/ontology/internal.js +3 -3
- package/dist/pipelines/index.js +27 -26
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/builders.d.ts +7 -1
- package/dist/projections/builders.d.ts.map +1 -1
- package/dist/projections/index.d.ts +1 -1
- package/dist/projections/index.d.ts.map +1 -1
- package/dist/projections/internal.js +22 -21
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/types.d.ts +10 -0
- package/dist/projections/types.d.ts.map +1 -1
- package/dist/projections/validation.d.ts.map +1 -1
- package/dist/queues/in-memory.d.ts +3 -2
- 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 +40 -13
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +13 -0
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +1 -0
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +47 -25
- package/dist/runtime/internal.js.map +4 -3
- package/dist/runtime/locale.d.ts +0 -2
- package/dist/runtime/locale.d.ts.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts +1 -1
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/script.d.ts +39 -0
- package/dist/runtime/script.d.ts.map +1 -0
- package/dist/runtime/sixb.d.ts +2 -2
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/sandboxes/auth.d.ts +26 -4
- package/dist/sandboxes/auth.d.ts.map +1 -1
- package/dist/sandboxes/index.d.ts +3 -1
- package/dist/sandboxes/index.d.ts.map +1 -1
- package/dist/sandboxes/index.js +5 -5
- package/dist/schedules/builders.d.ts.map +1 -1
- package/dist/schedules/index.js +3 -3
- package/dist/schedules/runtime.d.ts.map +1 -1
- package/dist/schedules/validation.d.ts +2 -0
- package/dist/schedules/validation.d.ts.map +1 -1
- package/dist/security/view-conditions.d.ts.map +1 -1
- package/dist/shares/internal.js +19 -18
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/agents/errors.d.ts +1 -1
- package/dist/storage/agents/errors.d.ts.map +1 -1
- package/dist/storage/agents/in-memory.d.ts +43 -1
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +2 -2
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts +54 -11
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +41 -5
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +291 -3
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/analytics.d.ts +3 -2
- package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +4 -3
- package/dist/storage/ai-cost/provider.js.map +1 -1
- package/dist/storage/ai-cost/types.d.ts +5 -1
- package/dist/storage/ai-cost/types.d.ts.map +1 -1
- package/dist/storage/artifacts/in-memory.d.ts +7 -1
- 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 +5 -2
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +41 -0
- package/dist/storage/artifacts/types.d.ts.map +1 -1
- package/dist/storage/executions/provider.d.ts +3 -3
- package/dist/storage/executions/provider.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +1 -1
- package/dist/storage/executions/types.d.ts +6 -0
- package/dist/storage/executions/types.d.ts.map +1 -1
- package/dist/storage/executions/validation.d.ts.map +1 -1
- package/dist/storage/file-upload-sessions/provider.js +7 -7
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +30 -25
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +1 -1
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +12 -10
- package/dist/storage/internal.js.map +2 -2
- package/dist/storage/ontology/in-memory/replacement-plans.d.ts +2 -0
- package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +1 -1
- package/dist/storage/ontology/replacement-plans.d.ts +8 -0
- package/dist/storage/ontology/replacement-plans.d.ts.map +1 -1
- package/dist/storage/operation-scope.d.ts.map +1 -1
- package/dist/storage/operation-scope.js +1 -1
- package/dist/storage/sync-runs/idempotency.d.ts.map +1 -1
- package/dist/storage/sync-runs/in-memory.d.ts +2 -1
- 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/types.d.ts +27 -2
- package/dist/storage/sync-runs/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +7 -7
- package/dist/syncs/accounts.d.ts +36 -0
- package/dist/syncs/accounts.d.ts.map +1 -0
- package/dist/syncs/builders.d.ts.map +1 -1
- package/dist/syncs/connections.d.ts +36 -0
- package/dist/syncs/connections.d.ts.map +1 -0
- package/dist/syncs/execution.d.ts +14 -4
- package/dist/syncs/execution.d.ts.map +1 -1
- package/dist/syncs/index.d.ts +2 -1
- package/dist/syncs/index.d.ts.map +1 -1
- package/dist/syncs/index.js +28 -27
- package/dist/syncs/index.js.map +1 -1
- package/dist/syncs/request.d.ts +16 -2
- package/dist/syncs/request.d.ts.map +1 -1
- package/dist/syncs/run-dispatch.d.ts +14 -2
- package/dist/syncs/run-dispatch.d.ts.map +1 -1
- package/dist/testing/agent-approval-storage-contract.d.ts.map +1 -1
- package/dist/testing/agent-execution.d.ts +3 -0
- package/dist/testing/agent-execution.d.ts.map +1 -1
- package/dist/testing/agent-inbox-storage-contract.d.ts +15 -0
- package/dist/testing/agent-inbox-storage-contract.d.ts.map +1 -0
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
- package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +6589 -4627
- package/dist/testing/index.js.map +13 -12
- package/dist/testing/materializer-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.map +1 -1
- package/dist/webhooks/connections.d.ts +3 -4
- package/dist/webhooks/connections.d.ts.map +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.d.ts.map +1 -1
- package/dist/webhooks/internal.js +22 -54
- package/dist/webhooks/internal.js.map +3 -3
- package/dist/webhooks/types.d.ts +2 -11
- package/dist/webhooks/types.d.ts.map +1 -1
- package/dist/workers/index.js +66 -13
- package/dist/workers/index.js.map +4 -4
- package/dist/workers/queue-worker.d.ts +5 -0
- package/dist/workers/queue-worker.d.ts.map +1 -1
- package/dist/workers/queued-run-dispatch.d.ts.map +1 -1
- package/dist/workers/worker.d.ts +8 -0
- package/dist/workers/worker.d.ts.map +1 -1
- package/dist/workflows/index.js +50 -48
- package/dist/workflows/index.js.map +1 -1
- package/package.json +12 -1
- package/src/actions/validation.ts +3 -1
- package/src/agents/README.md +6 -2
- package/src/agents/children.ts +6 -0
- package/src/agents/errors.ts +3 -0
- package/src/agents/execution.ts +331 -43
- package/src/agents/ids.ts +5 -0
- package/src/agents/index.ts +22 -4
- package/src/agents/model-routing.ts +25 -9
- package/src/agents/queued-turn.ts +46 -0
- package/src/agents/request.ts +1444 -210
- package/src/agents/run-after-finish.ts +259 -2
- package/src/agents/run-artifacts.ts +3 -93
- package/src/agents/run-events.ts +256 -34
- package/src/agents/run-session-children.ts +13 -2
- package/src/agents/run-session-http.ts +9 -2
- package/src/agents/run-session-serve.ts +2 -8
- package/src/agents/run-session.ts +142 -3
- package/src/agents/run-turn.ts +148 -23
- package/src/agents/streams/index.ts +3 -0
- package/src/agents/streams/internal.ts +12 -0
- package/src/agents/streams/protocol.ts +109 -1
- package/src/agents/streams/steps.ts +131 -0
- package/src/agents/thread-access.ts +57 -2
- package/src/agents/turn-answered.ts +31 -0
- package/src/agents/validation.ts +2 -0
- package/src/artifacts/canvas-display.ts +4 -6
- package/src/artifacts/comments.ts +70 -17
- package/src/artifacts/document-fill.ts +103 -0
- package/src/artifacts/errors.ts +2 -0
- package/src/artifacts/events.ts +4 -1
- package/src/artifacts/execution.ts +265 -31
- package/src/artifacts/frames/assets.ts +42 -7
- package/src/artifacts/frames/document-data.ts +353 -0
- package/src/artifacts/frames/entries.ts +22 -16
- package/src/artifacts/frames/grants.ts +2 -2
- package/src/artifacts/frames/index.ts +3 -0
- package/src/artifacts/frames/kit.ts +102 -0
- package/src/artifacts/frames/protocol.ts +12 -1
- package/src/artifacts/frames/runtime.ts +413 -6
- package/src/artifacts/index.ts +3 -0
- package/src/artifacts/live/blocks.ts +889 -0
- package/src/artifacts/live/board.ts +195 -42
- package/src/artifacts/live/document.ts +170 -5
- package/src/artifacts/live/index.ts +7 -0
- package/src/artifacts/live/page.ts +807 -0
- package/src/artifacts/live/protocol.ts +5 -0
- package/src/artifacts/live/server.ts +2 -2
- package/src/artifacts/live/state.ts +9 -4
- package/src/artifacts/outline.ts +17 -0
- package/src/artifacts/paper.ts +173 -0
- package/src/artifacts/pdf-job.ts +11 -0
- package/src/artifacts/publish/fields.ts +177 -0
- package/src/artifacts/publish/index.ts +6 -1
- package/src/artifacts/publish/merge.ts +28 -15
- package/src/artifacts/publish/pdf.ts +82 -0
- package/src/artifacts/publish/previews.ts +24 -34
- package/src/artifacts/publish/publish.ts +26 -3
- package/src/artifacts/publish/queries.ts +20 -4
- package/src/artifacts/publish/query-answers.ts +14 -3
- package/src/artifacts/publish/validate/document-html.ts +245 -0
- package/src/artifacts/publish/validate/document.ts +34 -3
- package/src/artifacts/queries.ts +59 -13
- package/src/artifacts/run-query.ts +5 -2
- package/src/authorization/event-visibility.ts +13 -0
- package/src/calendar.ts +195 -0
- package/src/connectors/connection-handles.ts +71 -0
- package/src/connectors/connections/authorizations.ts +50 -2
- package/src/connectors/connections/capability.ts +40 -0
- package/src/connectors/connections/events.ts +57 -0
- package/src/connectors/connections/internal.ts +3 -0
- package/src/connectors/connections/runs.ts +5 -0
- package/src/connectors/connections/service.ts +93 -6
- package/src/connectors/execution.ts +35 -8
- package/src/connectors/index.ts +3 -0
- package/src/connectors/service.ts +23 -0
- package/src/connectors/types.ts +29 -1
- package/src/deploy/index.ts +1 -0
- package/src/deploy/services.ts +1 -0
- package/src/deploy/types.ts +30 -2
- package/src/events/definitions.ts +14 -0
- package/src/events/execution.ts +51 -4
- package/src/events/index.ts +8 -0
- package/src/events/outbox-dispatcher.ts +12 -2
- package/src/events/scope.ts +3 -0
- package/src/events/selectors/builder.ts +49 -0
- package/src/events/selectors/index.ts +5 -0
- package/src/events/selectors/predicate.ts +2 -0
- package/src/events/selectors/types.ts +30 -1
- package/src/events/types/artifacts.ts +7 -1
- package/src/events/types/connectors.ts +36 -0
- package/src/events/types/index.ts +7 -0
- package/src/events/types/syncs.ts +4 -0
- package/src/execution/authorization.ts +45 -0
- package/src/execution/authorized-object-reader.ts +33 -5
- package/src/execution/durable.ts +2 -0
- package/src/execution/object-reader-ontology.ts +6 -0
- package/src/execution/request.ts +1 -0
- package/src/execution/scopes.ts +24 -0
- package/src/execution/script.ts +27 -0
- package/src/execution/types.ts +7 -1
- package/src/http/api-routes.ts +33 -0
- package/src/index.ts +39 -4
- package/src/lineage/executors.ts +3 -1
- package/src/materialization/event-envelopes.ts +10 -5
- package/src/materialization/events.ts +2 -0
- package/src/materialization/model.ts +6 -0
- package/src/materializer/README.md +10 -0
- package/src/materializer/projections/replace.ts +42 -1
- package/src/materializer/projections/replacement-plan.ts +44 -4
- package/src/materializer/shared/normalize.ts +4 -0
- package/src/models/audio/runtime.ts +57 -14
- package/src/models/audio/types.ts +20 -0
- package/src/models/index.ts +1 -0
- package/src/objects/query/executor.ts +4 -0
- package/src/objects/query/explain.ts +5 -0
- package/src/objects/query/index.ts +1 -0
- package/src/objects/query/link-query-clearance.ts +4 -1
- package/src/objects/query/links.ts +5 -1
- package/src/objects/query/validate.ts +33 -1
- package/src/objects/sdk/runtime-query-executor.ts +7 -3
- package/src/projections/builders.ts +20 -0
- package/src/projections/index.ts +1 -0
- package/src/projections/registry.ts +1 -0
- package/src/projections/revision.ts +2 -0
- package/src/projections/types.ts +11 -0
- package/src/projections/validation.ts +6 -0
- package/src/queues/in-memory.ts +5 -0
- package/src/queues/index.ts +3 -1
- package/src/queues/types.ts +45 -14
- package/src/runtime/host.ts +125 -11
- package/src/runtime/internal.ts +1 -0
- package/src/runtime/locale.ts +0 -10
- package/src/runtime/resolve-definitions.ts +4 -1
- package/src/runtime/script.ts +62 -0
- package/src/runtime/sixb.ts +15 -5
- package/src/sandboxes/README.md +3 -1
- package/src/sandboxes/auth.ts +32 -4
- package/src/sandboxes/index.ts +15 -1
- package/src/schedules/builders.ts +4 -1
- package/src/schedules/runtime.ts +3 -0
- package/src/schedules/validation.ts +20 -2
- package/src/security/view-conditions.ts +2 -1
- package/src/storage/agents/errors.ts +1 -0
- package/src/storage/agents/in-memory.ts +500 -7
- package/src/storage/agents/index.ts +26 -0
- package/src/storage/agents/provider.ts +454 -15
- package/src/storage/agents/types.ts +315 -3
- package/src/storage/ai-cost/analytics.ts +22 -43
- package/src/storage/ai-cost/types.ts +5 -1
- package/src/storage/artifacts/in-memory.ts +52 -6
- package/src/storage/artifacts/index.ts +2 -0
- package/src/storage/artifacts/record.ts +33 -4
- package/src/storage/artifacts/types.ts +44 -0
- package/src/storage/executions/provider.ts +22 -2
- package/src/storage/executions/types.ts +2 -0
- package/src/storage/executions/validation.ts +27 -0
- package/src/storage/index.ts +29 -0
- package/src/storage/internal.ts +1 -0
- package/src/storage/ontology/in-memory/replacement-plans.ts +22 -0
- package/src/storage/ontology/replacement-plans.ts +6 -0
- package/src/storage/operation-scope.ts +2 -0
- package/src/storage/sync-runs/idempotency.ts +1 -0
- package/src/storage/sync-runs/in-memory.ts +43 -1
- package/src/storage/sync-runs/index.ts +1 -0
- package/src/storage/sync-runs/types.ts +30 -1
- package/src/syncs/accounts.ts +85 -0
- package/src/syncs/builders.ts +18 -1
- package/src/syncs/connections.ts +123 -0
- package/src/syncs/execution.ts +64 -22
- package/src/syncs/index.ts +3 -0
- package/src/syncs/request.ts +81 -23
- package/src/syncs/run-dispatch.ts +69 -7
- package/src/testing/agent-approval-storage-contract.ts +123 -0
- package/src/testing/agent-execution.ts +45 -2
- package/src/testing/agent-inbox-storage-contract.ts +874 -0
- package/src/testing/agent-storage-contract.ts +965 -103
- package/src/testing/ai-cost-storage-contract.ts +80 -0
- package/src/testing/artifact-storage-contract.ts +201 -4
- package/src/testing/execution-storage-contract.ts +31 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/materializer-storage-contract.ts +139 -1
- package/src/testing/queues-contract.ts +22 -0
- package/src/testing/run-claim-storage-contract.ts +116 -0
- package/src/webhooks/connections.ts +9 -50
- package/src/webhooks/index.ts +0 -2
- package/src/webhooks/types.ts +2 -13
- package/src/workers/README.md +4 -1
- package/src/workers/lost-runs.ts +1 -0
- package/src/workers/queue-worker.ts +16 -5
- package/src/workers/queued-run-dispatch.ts +8 -1
- package/src/workers/worker.ts +67 -7
- package/dist/chunk-3z1vxzcm.js +0 -234
- package/dist/chunk-3z1vxzcm.js.map +0 -12
- package/dist/chunk-48c1z8nj.js.map +0 -10
- package/dist/chunk-58geavnf.js +0 -29
- package/dist/chunk-58geavnf.js.map +0 -10
- package/dist/chunk-5a4a52tq.js.map +0 -10
- package/dist/chunk-9nsjjd44.js.map +0 -12
- package/dist/chunk-b9qfh2ya.js.map +0 -11
- package/dist/chunk-eptrvnby.js.map +0 -12
- package/dist/chunk-f6ahf5gf.js.map +0 -13
- package/dist/chunk-gxwy4c3s.js.map +0 -47
- package/dist/chunk-hvbvq7p4.js.map +0 -18
- package/dist/chunk-m2jerfef.js +0 -474
- package/dist/chunk-m2jerfef.js.map +0 -11
- package/dist/chunk-msyevpp3.js.map +0 -22
- package/dist/chunk-n4zzaf6q.js.map +0 -10
- package/dist/chunk-rsrc7vtw.js.map +0 -49
- package/dist/chunk-rsxb14an.js.map +0 -18
- package/dist/chunk-smnt672s.js.map +0 -10
- package/dist/chunk-t0s7b3d1.js.map +0 -13
- package/dist/chunk-td26wjr5.js.map +0 -13
- package/dist/chunk-vzkxqf8h.js.map +0 -23
- package/dist/chunk-wa05txmk.js.map +0 -11
- package/dist/chunk-yv8hv4wq.js.map +0 -10
- package/dist/chunk-yy914zfr.js.map +0 -30
- package/dist/chunk-zeykm8my.js.map +0 -14
- /package/dist/{chunk-stmxh0hv.js.map → chunk-3neam1y5.js.map} +0 -0
- /package/dist/{chunk-p8pgnq8d.js.map → chunk-425ydk65.js.map} +0 -0
- /package/dist/{chunk-p351afzm.js.map → chunk-5sswe5ej.js.map} +0 -0
- /package/dist/{chunk-e0hnbb1m.js.map → chunk-61zptves.js.map} +0 -0
- /package/dist/{chunk-fe6r7yhg.js.map → chunk-92wrka15.js.map} +0 -0
- /package/dist/{chunk-q9nkpr8k.js.map → chunk-9tpmfh3n.js.map} +0 -0
- /package/dist/{chunk-sysnvjce.js.map → chunk-brhp9d97.js.map} +0 -0
- /package/dist/{chunk-8a8k38tz.js.map → chunk-brybqw5k.js.map} +0 -0
- /package/dist/{chunk-855w9nvw.js.map → chunk-cg7cygfj.js.map} +0 -0
- /package/dist/{chunk-r2psmn42.js.map → chunk-eg6xqef7.js.map} +0 -0
- /package/dist/{chunk-7kpqntgw.js.map → chunk-f05994as.js.map} +0 -0
- /package/dist/{chunk-2bn6813a.js.map → chunk-grt2j5vp.js.map} +0 -0
- /package/dist/{chunk-rtdrm592.js.map → chunk-htdzx40w.js.map} +0 -0
- /package/dist/{chunk-bc3y6gff.js.map → chunk-jka26v8c.js.map} +0 -0
- /package/dist/{chunk-6ef4esq4.js.map → chunk-pqj8vff9.js.map} +0 -0
- /package/dist/{chunk-n68vz95m.js.map → chunk-qbd282aa.js.map} +0 -0
- /package/dist/{chunk-r9rtavg9.js.map → chunk-t19wjmnc.js.map} +0 -0
- /package/dist/{chunk-dhkc9b23.js.map → chunk-v8a1qjzp.js.map} +0 -0
- /package/dist/{chunk-8bns0y68.js.map → chunk-xf76csps.js.map} +0 -0
- /package/dist/{chunk-vepea5c3.js.map → chunk-ym1bqd98.js.map} +0 -0
|
@@ -5,20 +5,20 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
resolveExecutionScopeAuthorization,
|
|
7
7
|
assertAuthorized2
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-tapdssb5.js";
|
|
9
9
|
import {
|
|
10
10
|
reportRunFailure2
|
|
11
11
|
} from "./chunk-czct88ht.js";
|
|
12
12
|
import {
|
|
13
13
|
PIPELINE_RUN_FAILURE_CODES2
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-9c9yknwt.js";
|
|
15
15
|
import {
|
|
16
16
|
PipelineRunError2
|
|
17
17
|
} from "./chunk-22d3qg4x.js";
|
|
18
18
|
import {
|
|
19
19
|
dispatchQueuedRun,
|
|
20
20
|
hasAutomaticRunProvenance
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-y8fwm3z2.js";
|
|
22
22
|
import {
|
|
23
23
|
PipelineError2
|
|
24
24
|
} from "./chunk-hke9aeen.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
executionRecordInputFromRuntime,
|
|
27
27
|
ensureExecutionRecord2,
|
|
28
28
|
createPrimitiveExecutionRecord
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-xavet0qs.js";
|
|
30
30
|
|
|
31
31
|
// src/pipelines/run-dispatch.ts
|
|
32
32
|
class PipelineRunDispatcher2 {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/connectors/types.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import type { ReadonlyJsonObject } from \"../json\"\nimport type { WebhookDefinition } from \"../webhooks/types\"\n\n/**\n * Runtime context passed to connector adapters when Sixb establishes a connection.\n *\n * Connectors can use this to scope logs, build cache keys, or attach cancellation\n * to long-running startup work.\n */\nexport interface ConnectorContext {\n readonly projectId: string\n readonly connectorId: string\n readonly signal: AbortSignal\n}\n\n/**\n * Minimal contract for a Sixb connector adapter.\n *\n * Adapters are responsible for creating and optionally tearing down a client for an\n * external system. They should return the client shape that feels natural for that system.\n */\nexport interface ConnectorAdapter<TType extends string = string, TClient = unknown> {\n readonly type: TType\n readonly authentication?: never\n readonly webhooks?: readonly WebhookDefinition<unknown, TClient>[]\n connect(context: ConnectorContext): Promise<TClient> | TClient\n disconnect?(client: TClient): Promise<void> | void\n}\n\n/** One OAuth token set normalized by an OAuth connector adapter. */\nexport interface ConnectorOAuthCredentials {\n readonly accessToken: string\n readonly refreshToken?: string\n readonly tokenType?: string\n readonly scopes?: readonly string[]\n readonly expiresAt?: Date\n /**\n * Provider-owned grant context, encrypted with the tokens and never exposed in connection views.\n * Available to account discovery, account tokens, refresh, and revoke. Refresh preserves it when\n * omitted; returning an object replaces it (use {} to clear it). Code exchange starts fresh on\n * reauthorization.\n */\n readonly authorizationContext?: ReadonlyJsonObject\n}\n\n/** Public, non-secret account information returned for framework-owned selection UI. */\nexport interface ConnectorAccountCandidate {\n readonly id: string\n readonly label: string\n readonly description?: string\n readonly avatarUrl?: string\n}\n\n/** A connection the project shares. Managing it requires `can.manage(connector)`. */\nexport interface ProjectConnectorConnectionOwner {\n readonly type: \"project\"\n}\n\n/**\n * A connection one person made with their own account. Only they manage it. Syncs and webhooks\n * read it, and `sixb.connector()` opens it in a run they requested or one no one requested.\n */\nexport interface UserConnectorConnectionOwner {\n readonly type: \"user\"\n readonly id: string\n}\n\nexport type ConnectorConnectionOwner =\n | ProjectConnectorConnectionOwner\n | UserConnectorConnectionOwner\n\nexport function sameConnectorConnectionOwner(\n left: ConnectorConnectionOwner,\n right: ConnectorConnectionOwner\n): boolean {\n if (left.type === \"project\" || right.type === \"project\") return left.type === right.type\n return left.id === right.id\n}\n\n/** Stable application-defined lookup key for one connector connection. */\nexport interface ConnectorConnectionSelector {\n readonly owner: ConnectorConnectionOwner\n readonly slot: string\n}\n\n/** Stable, non-secret metadata shared by connector connection consumers. */\nexport interface ConnectorConnectionMetadata extends ConnectorConnectionSelector {\n readonly id: string\n readonly connectorId: string\n readonly account: ConnectorAccountCandidate\n}\n\n/** Credential protection required when an OAuth connector uses durable connection storage. */\nexport interface ConnectorConnectionOptions {\n /** Canonical base64url encoding of exactly 32 random bytes, shared by storage replicas. */\n readonly encryptionKey: string\n}\n\nexport interface OAuthConnectorAuthorizationContext extends ConnectorContext {\n readonly redirectUri: string\n}\n\nexport interface OAuthConnectorAuthorizationUrlInput {\n readonly state: string\n /** Present only when the adapter enables PKCE (S256 by default). */\n readonly codeChallenge?: string\n readonly codeChallengeMethod?: \"S256\"\n}\n\nexport interface OAuthConnectorCodeExchangeInput {\n readonly code: string\n /** Present only when this authorization attempt used PKCE. */\n readonly codeVerifier?: string\n /** Allowlisted callback values. Untrusted until the adapter validates them with the provider. */\n readonly callbackParameters?: Readonly<Record<string, string>>\n}\n\nexport interface ConnectorConnectionClientContext extends ConnectorContext {\n readonly connectionId: string\n readonly account: ConnectorAccountCandidate\n readonly tokenSource: ConnectorTokenSource\n}\n\n/** One delivered token, bound to the credential revision that produced it. */\nexport interface ConnectorAccessToken {\n readonly accessToken: string\n readonly tokenType?: string\n /** Report this exact token as rejected so Sixb can refresh only its credential revision. */\n invalidate(): void\n}\n\n/** Live credential source owned by Sixb. Adapters must resolve a token for each request. */\nexport interface ConnectorTokenSource {\n get(): Promise<ConnectorAccessToken>\n}\n\n/**\n * OAuth-backed connector adapter. Sixb owns persistence, OAuth state, refresh coordination and UI;\n * the adapter owns provider protocol details and typed client creation.\n */\nexport interface ConnectorOAuth2Authentication {\n readonly type: \"oauth2\"\n /** Defaults to S256. Disable only for providers whose flow does not support PKCE. */\n readonly pkce?: \"S256\" | \"disabled\"\n /** Additional callback parameter names accepted by exchangeCode; framework OAuth fields are reserved. */\n readonly callbackParameters?: readonly string[]\n authorizationUrl(\n context: OAuthConnectorAuthorizationContext,\n input: OAuthConnectorAuthorizationUrlInput\n ): Promise<string | URL> | string | URL\n exchangeCode(\n context: OAuthConnectorAuthorizationContext,\n input: OAuthConnectorCodeExchangeInput\n ): Promise<ConnectorOAuthCredentials> | ConnectorOAuthCredentials\n refresh(\n context: ConnectorContext,\n credentials: ConnectorOAuthCredentials\n ): Promise<ConnectorOAuthCredentials> | ConnectorOAuthCredentials\n /**\n * Derives the token delivered to one connection, for providers that issue a token per account\n * from one grant (Meta Page tokens, for example). Defaults to the grant's own access token.\n * Runs on every token delivery, so keep it local: read the credentials, do not call the provider.\n */\n accountAccessToken?(\n credentials: ConnectorOAuthCredentials,\n account: ConnectorAccountCandidate\n ): Pick<ConnectorAccessToken, \"accessToken\" | \"tokenType\">\n /**\n * Revokes the grant idempotently. An already revoked or invalid grant must resolve successfully\n * so Sixb can converge after losing an earlier provider response.\n */\n revoke?(context: ConnectorContext, credentials: ConnectorOAuthCredentials): Promise<void> | void\n}\n\nexport interface OAuthConnectorAdapter<TType extends string = string, TClient = unknown> {\n readonly type: TType\n readonly authentication: ConnectorOAuth2Authentication\n readonly webhooks?: readonly WebhookDefinition<unknown, TClient>[]\n discoverAccounts(\n context: ConnectorContext,\n credentials: ConnectorOAuthCredentials\n ): Promise<readonly ConnectorAccountCandidate[]> | readonly ConnectorAccountCandidate[]\n connect(context: ConnectorConnectionClientContext): Promise<TClient> | TClient\n}\n\nexport type AnyConnectorAdapter = ConnectorAdapter | OAuthConnectorAdapter\n\n/**\n * Inert connector definition registered with Sixb.\n *\n * Definitions are safe to export from `connectors/` modules. The runtime turns them into\n * live clients when `sixb.connector(...)` is called.\n */\nexport interface ConnectorDefinition<\n TId extends string = string,\n TAdapter extends AnyConnectorAdapter = AnyConnectorAdapter,\n> {\n readonly kind: \"connector\"\n readonly id: TId\n readonly adapter: TAdapter\n /** Who may own an OAuth connector's connections. Omitted, only the project. */\n readonly owners?: readonly ConnectorConnectionOwner[\"type\"][]\n}\n\nexport interface ConnectorDefinitionOptions {\n /**\n * Who may own this OAuth connector's connections: `\"project\"` (the default) for accounts the\n * project shares, `\"user\"` for each person's own account. Syncs read both.\n */\n readonly owners?: readonly ConnectorConnectionOwner[\"type\"][]\n}\n\nexport type StaticConnectorDefinition = ConnectorDefinition<string, ConnectorAdapter>\n\nexport function connectorConnectionOwners(\n definition: ConnectorDefinition\n): readonly ConnectorConnectionOwner[\"type\"][] {\n return definition.owners ?? [\"project\"]\n}\n\n/** Infer the connected client type returned by a connector adapter. */\nexport type ConnectorClient<TAdapter extends AnyConnectorAdapter> = Awaited<\n ReturnType<TAdapter[\"connect\"]>\n>\n\nexport function isOAuthConnectorAdapter(\n value: AnyConnectorAdapter\n): value is OAuthConnectorAdapter {\n return \"authentication\" in value && value.authentication?.type === \"oauth2\"\n}\n\nexport function isOAuthConnectorDefinition(\n value: ConnectorDefinition\n): value is ConnectorDefinition<string, OAuthConnectorAdapter> {\n return isOAuthConnectorAdapter(value.adapter)\n}\n\nexport function isStaticConnectorDefinition(\n value: ConnectorDefinition\n): value is StaticConnectorDefinition {\n return !isOAuthConnectorDefinition(value)\n}\n\nexport function isConnectorDefinition(value: unknown): value is ConnectorDefinition {\n if (!isRecord(value)) {\n return false\n }\n\n const adapter = value.adapter\n if (\n value.kind === \"connector\" &&\n typeof value.id === \"string\" &&\n isRecord(adapter) &&\n typeof adapter.type === \"string\" &&\n typeof adapter.connect === \"function\"\n ) {\n if (adapter.authentication === undefined) return true\n const authentication = adapter.authentication\n if (!isRecord(authentication) || authentication.type !== \"oauth2\") return false\n return (\n typeof authentication.authorizationUrl === \"function\" &&\n typeof authentication.exchangeCode === \"function\" &&\n typeof authentication.refresh === \"function\" &&\n typeof adapter.discoverAccounts === \"function\"\n )\n }\n\n return false\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n}\n"
|
|
5
|
+
"import type { ReadonlyJsonObject } from \"../json\"\nimport type { WebhookDefinition } from \"../webhooks/types\"\n\n/**\n * Runtime context passed to connector adapters when Sixb establishes a connection.\n *\n * Connectors can use this to scope logs, build cache keys, or attach cancellation\n * to long-running startup work.\n */\nexport interface ConnectorContext {\n readonly projectId: string\n readonly connectorId: string\n readonly signal: AbortSignal\n}\n\n/**\n * Minimal contract for a Sixb connector adapter.\n *\n * Adapters are responsible for creating and optionally tearing down a client for an\n * external system. They should return the client shape that feels natural for that system.\n */\nexport interface ConnectorAdapter<TType extends string = string, TClient = unknown> {\n readonly type: TType\n readonly authentication?: never\n readonly webhooks?: readonly WebhookDefinition<unknown, TClient>[]\n connect(context: ConnectorContext): Promise<TClient> | TClient\n disconnect?(client: TClient): Promise<void> | void\n}\n\n/** One OAuth token set normalized by an OAuth connector adapter. */\nexport interface ConnectorOAuthCredentials {\n readonly accessToken: string\n readonly refreshToken?: string\n readonly tokenType?: string\n readonly scopes?: readonly string[]\n readonly expiresAt?: Date\n /**\n * Provider-owned grant context, encrypted with the tokens and never exposed in connection views.\n * Available to account discovery, account tokens, refresh, and revoke. Refresh preserves it when\n * omitted; returning an object replaces it (use {} to clear it). Code exchange starts fresh on\n * reauthorization.\n */\n readonly authorizationContext?: ReadonlyJsonObject\n}\n\n/** Public, non-secret account information returned for framework-owned selection UI. */\nexport interface ConnectorAccountCandidate {\n readonly id: string\n readonly label: string\n readonly description?: string\n readonly avatarUrl?: string\n}\n\n/** A connection the project shares. Managing it requires `can.manage(connector)`. */\nexport interface ProjectConnectorConnectionOwner {\n readonly type: \"project\"\n}\n\n/**\n * A connection one person made with their own account. Only they manage it. Syncs and webhooks\n * read it, and `sixb.connector()` opens it in a run they requested or one no one requested.\n */\nexport interface UserConnectorConnectionOwner {\n readonly type: \"user\"\n readonly id: string\n}\n\nexport type ConnectorConnectionOwner =\n | ProjectConnectorConnectionOwner\n | UserConnectorConnectionOwner\n\nexport function sameConnectorConnectionOwner(\n left: ConnectorConnectionOwner,\n right: ConnectorConnectionOwner\n): boolean {\n if (left.type === \"project\" || right.type === \"project\") return left.type === right.type\n return left.id === right.id\n}\n\n/** Stable application-defined lookup key for one connector connection. */\nexport interface ConnectorConnectionSelector {\n readonly owner: ConnectorConnectionOwner\n readonly slot: string\n}\n\n/** Stable, non-secret metadata shared by connector connection consumers. */\nexport interface ConnectorConnectionMetadata extends ConnectorConnectionSelector {\n readonly id: string\n readonly connectorId: string\n readonly account: ConnectorAccountCandidate\n}\n\n/** One connection a run may use, and the client that acts with its account. */\nexport interface ConnectorConnectionHandle<TClient = unknown> {\n readonly connection: ConnectorConnectionMetadata\n /** First call rechecks the connection and creates its client; later calls reuse that client. */\n client(): Promise<TClient>\n}\n\n/** The connections of one OAuth connector that the current run may use. */\nexport interface ConnectorConnections<TClient = unknown> {\n /** Every connection the run may use, ordered by id. */\n list(): Promise<readonly ConnectorConnectionHandle<TClient>[]>\n /** Those whose account has this id; an unknown account returns an empty array. */\n forAccount(accountId: string): Promise<readonly ConnectorConnectionHandle<TClient>[]>\n}\n\n/** Credential protection required when an OAuth connector uses durable connection storage. */\nexport interface ConnectorConnectionOptions {\n /** Canonical base64url encoding of exactly 32 random bytes, shared by storage replicas. */\n readonly encryptionKey: string\n}\n\nexport interface OAuthConnectorAuthorizationContext extends ConnectorContext {\n readonly redirectUri: string\n}\n\nexport interface OAuthConnectorAuthorizationUrlInput {\n readonly state: string\n /** Present only when the adapter enables PKCE (S256 by default). */\n readonly codeChallenge?: string\n readonly codeChallengeMethod?: \"S256\"\n}\n\nexport interface OAuthConnectorCodeExchangeInput {\n readonly code: string\n /** Present only when this authorization attempt used PKCE. */\n readonly codeVerifier?: string\n /** Allowlisted callback values. Untrusted until the adapter validates them with the provider. */\n readonly callbackParameters?: Readonly<Record<string, string>>\n}\n\nexport interface ConnectorConnectionClientContext extends ConnectorContext {\n readonly connectionId: string\n readonly account: ConnectorAccountCandidate\n readonly tokenSource: ConnectorTokenSource\n}\n\n/** One delivered token, bound to the credential revision that produced it. */\nexport interface ConnectorAccessToken {\n readonly accessToken: string\n readonly tokenType?: string\n /** Report this exact token as rejected so Sixb can refresh only its credential revision. */\n invalidate(): void\n}\n\n/** Live credential source owned by Sixb. Adapters must resolve a token for each request. */\nexport interface ConnectorTokenSource {\n get(): Promise<ConnectorAccessToken>\n}\n\n/**\n * OAuth-backed connector adapter. Sixb owns persistence, OAuth state, refresh coordination and UI;\n * the adapter owns provider protocol details and typed client creation.\n */\nexport interface ConnectorOAuth2Authentication {\n readonly type: \"oauth2\"\n /** Defaults to S256. Disable only for providers whose flow does not support PKCE. */\n readonly pkce?: \"S256\" | \"disabled\"\n /** Additional callback parameter names accepted by exchangeCode; framework OAuth fields are reserved. */\n readonly callbackParameters?: readonly string[]\n authorizationUrl(\n context: OAuthConnectorAuthorizationContext,\n input: OAuthConnectorAuthorizationUrlInput\n ): Promise<string | URL> | string | URL\n exchangeCode(\n context: OAuthConnectorAuthorizationContext,\n input: OAuthConnectorCodeExchangeInput\n ): Promise<ConnectorOAuthCredentials> | ConnectorOAuthCredentials\n refresh(\n context: ConnectorContext,\n credentials: ConnectorOAuthCredentials\n ): Promise<ConnectorOAuthCredentials> | ConnectorOAuthCredentials\n /**\n * Derives the token delivered to one connection, for providers that issue a token per account\n * from one grant (Meta Page tokens, for example). Defaults to the grant's own access token.\n * Runs on every token delivery, so keep it local: read the credentials, do not call the provider.\n */\n accountAccessToken?(\n credentials: ConnectorOAuthCredentials,\n account: ConnectorAccountCandidate\n ): Pick<ConnectorAccessToken, \"accessToken\" | \"tokenType\">\n /**\n * Revokes the grant idempotently. An already revoked or invalid grant must resolve successfully\n * so Sixb can converge after losing an earlier provider response.\n */\n revoke?(\n context: ConnectorContext,\n credentials: ConnectorOAuthCredentials,\n revocation?: ConnectorOAuthRevocation\n ): Promise<void> | void\n}\n\n/** What the connector still reaches once one grant is revoked. */\nexport interface ConnectorOAuthRevocation {\n /**\n * Accounts still connected through another grant, such as the same account in a second slot.\n * Provider state those accounts share with the revoked grant is still in use.\n */\n readonly connectedAccountIds: readonly string[]\n}\n\nexport interface OAuthConnectorAdapter<TType extends string = string, TClient = unknown> {\n readonly type: TType\n readonly authentication: ConnectorOAuth2Authentication\n readonly webhooks?: readonly WebhookDefinition<unknown, TClient>[]\n discoverAccounts(\n context: ConnectorContext,\n credentials: ConnectorOAuthCredentials\n ): Promise<readonly ConnectorAccountCandidate[]> | readonly ConnectorAccountCandidate[]\n connect(context: ConnectorConnectionClientContext): Promise<TClient> | TClient\n}\n\nexport type AnyConnectorAdapter = ConnectorAdapter | OAuthConnectorAdapter\n\n/**\n * Inert connector definition registered with Sixb.\n *\n * Definitions are safe to export from `connectors/` modules. The runtime turns them into\n * live clients when `sixb.connector(...)` is called.\n */\nexport interface ConnectorDefinition<\n TId extends string = string,\n TAdapter extends AnyConnectorAdapter = AnyConnectorAdapter,\n> {\n readonly kind: \"connector\"\n readonly id: TId\n readonly adapter: TAdapter\n /** Who may own an OAuth connector's connections. Omitted, only the project. */\n readonly owners?: readonly ConnectorConnectionOwner[\"type\"][]\n}\n\nexport interface ConnectorDefinitionOptions {\n /**\n * Who may own this OAuth connector's connections: `\"project\"` (the default) for accounts the\n * project shares, `\"user\"` for each person's own account. Syncs read both.\n */\n readonly owners?: readonly ConnectorConnectionOwner[\"type\"][]\n}\n\nexport type StaticConnectorDefinition = ConnectorDefinition<string, ConnectorAdapter>\n\nexport function connectorConnectionOwners(\n definition: ConnectorDefinition\n): readonly ConnectorConnectionOwner[\"type\"][] {\n return definition.owners ?? [\"project\"]\n}\n\n/** Infer the connected client type returned by a connector adapter. */\nexport type ConnectorClient<TAdapter extends AnyConnectorAdapter> = Awaited<\n ReturnType<TAdapter[\"connect\"]>\n>\n\nexport function isOAuthConnectorAdapter(\n value: AnyConnectorAdapter\n): value is OAuthConnectorAdapter {\n return \"authentication\" in value && value.authentication?.type === \"oauth2\"\n}\n\nexport function isOAuthConnectorDefinition(\n value: ConnectorDefinition\n): value is ConnectorDefinition<string, OAuthConnectorAdapter> {\n return isOAuthConnectorAdapter(value.adapter)\n}\n\nexport function isStaticConnectorDefinition(\n value: ConnectorDefinition\n): value is StaticConnectorDefinition {\n return !isOAuthConnectorDefinition(value)\n}\n\nexport function isConnectorDefinition(value: unknown): value is ConnectorDefinition {\n if (!isRecord(value)) {\n return false\n }\n\n const adapter = value.adapter\n if (\n value.kind === \"connector\" &&\n typeof value.id === \"string\" &&\n isRecord(adapter) &&\n typeof adapter.type === \"string\" &&\n typeof adapter.connect === \"function\"\n ) {\n if (adapter.authentication === undefined) return true\n const authentication = adapter.authentication\n if (!isRecord(authentication) || authentication.type !== \"oauth2\") return false\n return (\n typeof authentication.authorizationUrl === \"function\" &&\n typeof authentication.exchangeCode === \"function\" &&\n typeof authentication.refresh === \"function\" &&\n typeof adapter.discoverAccounts === \"function\"\n )\n }\n\n return false\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n}\n"
|
|
6
6
|
],
|
|
7
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qBAAqB;AAAA,EAExC;AAAA,EAEA,OAAO;AAAA;AAGT,SAAS,QAAQ,CAAC,OAAkD;AAAA,EAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAAA;",
|
|
8
8
|
"debugId": "F8081C8022D50E8F64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -96,7 +96,7 @@ function eventAttribution2(execution) {
|
|
|
96
96
|
return { ...attribution, requestedBy: { type, id } };
|
|
97
97
|
}
|
|
98
98
|
function eventExecutor(execution) {
|
|
99
|
-
const { executor, authorizationRef } = execution;
|
|
99
|
+
const { executor, authorizationRef, source } = execution;
|
|
100
100
|
switch (executor.type) {
|
|
101
101
|
case "request":
|
|
102
102
|
return { type: "request", requestId: executor.requestId };
|
|
@@ -104,6 +104,11 @@ function eventExecutor(execution) {
|
|
|
104
104
|
return { type: "agent", runId: executor.runId };
|
|
105
105
|
case "kernel":
|
|
106
106
|
return { type: "kernel", operation: structuredClone(executor.operation) };
|
|
107
|
+
case "script":
|
|
108
|
+
if (source.type !== "script") {
|
|
109
|
+
throw new Error(`[Sixb] Script execution '${execution.id}' has no script source.`);
|
|
110
|
+
}
|
|
111
|
+
return { type: "script", runId: executor.runId, path: source.path };
|
|
107
112
|
case "primitive":
|
|
108
113
|
if (authorizationRef.type !== "trustedPrimitive" || authorizationRef.primitive.kind !== executor.kind || authorizationRef.primitive.runId !== executor.runId) {
|
|
109
114
|
throw new Error(`[Sixb] Execution '${execution.id}' runs a primitive without that primitive's authority.`);
|
|
@@ -126,4 +131,4 @@ function createdPropertyChanges(properties) {
|
|
|
126
131
|
|
|
127
132
|
export { objectPartitionKey, materializationEvent2, eventAttribution2 };
|
|
128
133
|
|
|
129
|
-
//# debugId=
|
|
134
|
+
//# debugId=E164938E4C8D924464756E2164756E21
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/materialization/event-envelopes.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { compareStrings, type JsonValue } from \"../json\"\nimport type { ExecutionRecord } from \"../storage/executions/types\"\nimport type {\n EventExecutor,\n OntologyMaterializationEvent,\n OntologyMaterializationEventAttribution,\n OntologyMaterializationEventCommit,\n OntologyMaterializationEventDraft,\n} from \"./events\"\nimport type { OntologyMaterializationPropertyChangeMap } from \"./model\"\n\n/** The partition key of an object's events, which the log can be read by. */\nexport function objectPartitionKey(object: {\n readonly objectTypeId: string\n readonly primaryId: string\n}): string {\n return `${object.objectTypeId}:${object.primaryId}`\n}\n\n/** Where an event sits in its commit: its id and its ordinal. */\nexport interface OntologyMaterializationEventSequence {\n readonly id: string\n readonly commitOrdinal: number\n}\n\n/**\n * The event consumers receive, rebuilt from the draft storage keeps, the commit it belongs to and\n * the execution that commit ran under. It is the exact event core would have built in one piece,\n * so storing drafts changes nothing a consumer can observe.\n */\nexport function materializationEvent(\n draft: OntologyMaterializationEventDraft,\n sequence: OntologyMaterializationEventSequence,\n commit: OntologyMaterializationEventCommit,\n attribution: OntologyMaterializationEventAttribution\n): OntologyMaterializationEvent {\n const context = {\n id: sequence.id,\n schemaVersion: 1 as const,\n projectId: commit.projectId,\n occurredAt: commit.committedAt,\n correlationId: attribution.correlationId,\n origin: structuredClone(commit.origin),\n ...(attribution.requestedBy === undefined\n ? {}\n : { requestedBy: { ...attribution.requestedBy } }),\n executor: structuredClone(attribution.executor),\n commitId: commit.id,\n commitOrdinal: sequence.commitOrdinal,\n }\n switch (draft.type) {\n case \"object.created\":\n return {\n ...context,\n type: draft.type,\n topic: \"objects\",\n partitionKey: objectPartitionKey(draft.payload),\n payload: {\n ...draft.payload,\n propertyChanges: createdPropertyChanges(draft.payload.properties),\n },\n }\n case \"object.updated\":\n return {\n ...context,\n type: draft.type,\n topic: \"objects\",\n partitionKey: objectPartitionKey(draft.payload),\n payload: draft.payload,\n }\n case \"object.deleted\":\n return {\n ...context,\n type: draft.type,\n topic: \"objects\",\n partitionKey: objectPartitionKey(draft.payload),\n payload: draft.payload,\n }\n case \"link.created\":\n return {\n ...context,\n type: draft.type,\n topic: \"links\",\n partitionKey: `${draft.payload.sourceTypeId}:${draft.payload.sourceId}:${draft.payload.linkId}`,\n payload: {\n ...draft.payload,\n propertyChanges: createdPropertyChanges(draft.payload.properties ?? {}),\n },\n }\n case \"link.updated\":\n return {\n ...context,\n type: draft.type,\n topic: \"links\",\n partitionKey: `${draft.payload.sourceTypeId}:${draft.payload.sourceId}:${draft.payload.linkId}`,\n payload: draft.payload,\n }\n case \"link.deleted\":\n return {\n ...context,\n type: draft.type,\n topic: \"links\",\n partitionKey: `${draft.payload.sourceTypeId}:${draft.payload.sourceId}:${draft.payload.linkId}`,\n payload: draft.payload,\n }\n case \"telemetry.appended\":\n return {\n ...context,\n type: draft.type,\n topic: \"telemetry\",\n partitionKey: `${draft.payload.objectTypeId}:${draft.payload.objectId}:${draft.payload.propertyId}`,\n payload: draft.payload,\n }\n }\n}\n\n/**\n * What the events of a commit say about who asked for it and what wrote it, read from the\n * execution it ran under. A primitive's id lives in the execution's authority, the only
|
|
5
|
+
"import { compareStrings, type JsonValue } from \"../json\"\nimport type { ExecutionRecord } from \"../storage/executions/types\"\nimport type {\n EventExecutor,\n OntologyMaterializationEvent,\n OntologyMaterializationEventAttribution,\n OntologyMaterializationEventCommit,\n OntologyMaterializationEventDraft,\n} from \"./events\"\nimport type { OntologyMaterializationPropertyChangeMap } from \"./model\"\n\n/** The partition key of an object's events, which the log can be read by. */\nexport function objectPartitionKey(object: {\n readonly objectTypeId: string\n readonly primaryId: string\n}): string {\n return `${object.objectTypeId}:${object.primaryId}`\n}\n\n/** Where an event sits in its commit: its id and its ordinal. */\nexport interface OntologyMaterializationEventSequence {\n readonly id: string\n readonly commitOrdinal: number\n}\n\n/**\n * The event consumers receive, rebuilt from the draft storage keeps, the commit it belongs to and\n * the execution that commit ran under. It is the exact event core would have built in one piece,\n * so storing drafts changes nothing a consumer can observe.\n */\nexport function materializationEvent(\n draft: OntologyMaterializationEventDraft,\n sequence: OntologyMaterializationEventSequence,\n commit: OntologyMaterializationEventCommit,\n attribution: OntologyMaterializationEventAttribution\n): OntologyMaterializationEvent {\n const context = {\n id: sequence.id,\n schemaVersion: 1 as const,\n projectId: commit.projectId,\n occurredAt: commit.committedAt,\n correlationId: attribution.correlationId,\n origin: structuredClone(commit.origin),\n ...(attribution.requestedBy === undefined\n ? {}\n : { requestedBy: { ...attribution.requestedBy } }),\n executor: structuredClone(attribution.executor),\n commitId: commit.id,\n commitOrdinal: sequence.commitOrdinal,\n }\n switch (draft.type) {\n case \"object.created\":\n return {\n ...context,\n type: draft.type,\n topic: \"objects\",\n partitionKey: objectPartitionKey(draft.payload),\n payload: {\n ...draft.payload,\n propertyChanges: createdPropertyChanges(draft.payload.properties),\n },\n }\n case \"object.updated\":\n return {\n ...context,\n type: draft.type,\n topic: \"objects\",\n partitionKey: objectPartitionKey(draft.payload),\n payload: draft.payload,\n }\n case \"object.deleted\":\n return {\n ...context,\n type: draft.type,\n topic: \"objects\",\n partitionKey: objectPartitionKey(draft.payload),\n payload: draft.payload,\n }\n case \"link.created\":\n return {\n ...context,\n type: draft.type,\n topic: \"links\",\n partitionKey: `${draft.payload.sourceTypeId}:${draft.payload.sourceId}:${draft.payload.linkId}`,\n payload: {\n ...draft.payload,\n propertyChanges: createdPropertyChanges(draft.payload.properties ?? {}),\n },\n }\n case \"link.updated\":\n return {\n ...context,\n type: draft.type,\n topic: \"links\",\n partitionKey: `${draft.payload.sourceTypeId}:${draft.payload.sourceId}:${draft.payload.linkId}`,\n payload: draft.payload,\n }\n case \"link.deleted\":\n return {\n ...context,\n type: draft.type,\n topic: \"links\",\n partitionKey: `${draft.payload.sourceTypeId}:${draft.payload.sourceId}:${draft.payload.linkId}`,\n payload: draft.payload,\n }\n case \"telemetry.appended\":\n return {\n ...context,\n type: draft.type,\n topic: \"telemetry\",\n partitionKey: `${draft.payload.objectTypeId}:${draft.payload.objectId}:${draft.payload.propertyId}`,\n payload: draft.payload,\n }\n }\n}\n\n/**\n * What the events of a commit say about who asked for it and what wrote it, read from the\n * execution it ran under. A primitive's id lives in the execution's authority and a script's path\n * in its source, the only places the durable record keeps them.\n */\nexport function eventAttribution(\n execution: Pick<\n ExecutionRecord,\n \"id\" | \"correlationId\" | \"requestedBy\" | \"executor\" | \"authorizationRef\" | \"source\"\n >\n): OntologyMaterializationEventAttribution {\n const attribution = {\n correlationId: execution.correlationId,\n executor: eventExecutor(execution),\n }\n if (execution.requestedBy === undefined) return attribution\n const { type, id } = execution.requestedBy\n return { ...attribution, requestedBy: { type, id } }\n}\n\nfunction eventExecutor(\n execution: Pick<ExecutionRecord, \"id\" | \"executor\" | \"authorizationRef\" | \"source\">\n): EventExecutor {\n const { executor, authorizationRef, source } = execution\n switch (executor.type) {\n case \"request\":\n return { type: \"request\", requestId: executor.requestId }\n case \"agent\":\n return { type: \"agent\", runId: executor.runId }\n case \"kernel\":\n return { type: \"kernel\", operation: structuredClone(executor.operation) }\n case \"script\":\n if (source.type !== \"script\") {\n throw new Error(`[Sixb] Script execution '${execution.id}' has no script source.`)\n }\n return { type: \"script\", runId: executor.runId, path: source.path }\n case \"primitive\":\n if (\n authorizationRef.type !== \"trustedPrimitive\" ||\n authorizationRef.primitive.kind !== executor.kind ||\n authorizationRef.primitive.runId !== executor.runId\n ) {\n throw new Error(\n `[Sixb] Execution '${execution.id}' runs a primitive without that primitive's authority.`\n )\n }\n return {\n type: \"primitive\",\n kind: executor.kind,\n id: authorizationRef.primitive.id,\n runId: executor.runId,\n }\n }\n}\n\n/** A creation changes every property it sets, from nothing to its value, in key order. */\nfunction createdPropertyChanges(\n properties: Readonly<Record<string, JsonValue>>\n): OntologyMaterializationPropertyChangeMap {\n const changes: Record<string, { readonly operation: \"created\"; readonly after: JsonValue }> = {}\n for (const id of Object.keys(properties).sort(compareStrings)) {\n changes[id] = { operation: \"created\", after: properties[id] as JsonValue }\n }\n return changes\n}\n"
|
|
6
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A,IAC1E,KAAK;AAAA,MACH,IAAI,OAAO,SAAS,UAAU;AAAA,QAC5B,MAAM,IAAI,MAAM,4BAA4B,UAAU,2BAA2B;AAAA,MACnF;AAAA,MACA,OAAO,EAAE,MAAM,UAAU,OAAO,SAAS,OAAO,MAAM,OAAO,KAAK;AAAA,IACpE,KAAK;AAAA,MACH,IACE,iBAAiB,SAAS,sBAC1B,iBAAiB,UAAU,SAAS,SAAS,QAC7C,iBAAiB,UAAU,UAAU,SAAS,OAC9C;AAAA,QACA,MAAM,IAAI,MACR,qBAAqB,UAAU,0DACjC;AAAA,MACF;AAAA,MACA,OAAO;AAAA,QACL,MAAM;AAAA,QACN,MAAM,SAAS;AAAA,QACf,IAAI,iBAAiB,UAAU;AAAA,QAC/B,OAAO,SAAS;AAAA,MAClB;AAAA;AAAA;AAKN,SAAS,sBAAsB,CAC7B,YAC0C;AAAA,EAC1C,MAAM,UAAwF,CAAC;AAAA,EAC/F,WAAW,MAAM,OAAO,KAAK,UAAU,EAAE,KAAK,cAAc,GAAG;AAAA,IAC7D,QAAQ,MAAM,EAAE,WAAW,WAAW,OAAO,WAAW,IAAiB;AAAA,EAC3E;AAAA,EACA,OAAO;AAAA;",
|
|
8
|
+
"debugId": "E164938E4C8D924464756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
isPrimitiveSchema,
|
|
4
4
|
primitiveTraits
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7mhbs9yy.js";
|
|
6
6
|
import {
|
|
7
7
|
ShareDefinitionError2,
|
|
8
8
|
snapshotShareDefinition
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-394zjzjs.js";
|
|
10
10
|
import {
|
|
11
11
|
snapshotShareAccessPlan
|
|
12
12
|
} from "./chunk-186k5yz3.js";
|
|
@@ -191,6 +191,7 @@ function syncLane({ projectId, storage, queues }) {
|
|
|
191
191
|
payload: {
|
|
192
192
|
syncId: run.syncId,
|
|
193
193
|
runId: run.id,
|
|
194
|
+
...run.connectionId === undefined ? {} : { connectionId: run.connectionId },
|
|
194
195
|
status: "cancelled",
|
|
195
196
|
datasetId: run.datasetId,
|
|
196
197
|
error: failure
|
|
@@ -285,4 +286,4 @@ async function readCorrelationId(input, run) {
|
|
|
285
286
|
|
|
286
287
|
export { republishLostRuns2, countLostRuns2 };
|
|
287
288
|
|
|
288
|
-
//# debugId=
|
|
289
|
+
//# debugId=55917A6258ABEC4264756E2164756E21
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"sources": ["../src/workers/lost-projection-runs.ts", "../src/workers/lost-runs.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { ProjectionRunDispatchPort } from \"../projections/run-dispatch\"\nimport type { ProjectionDispatchDescriptor } from \"../projections/types\"\nimport type { ListProjectionRunsInput, ProjectionRunRecord, Storage } from \"../storage\"\n\nconst PAGE_SIZE = 100\n\n/** What decides whether a projection's queued run still applies, and republishes it if so. */\nexport interface ProjectionRunRecovery {\n readonly descriptors: readonly ProjectionDispatchDescriptor[]\n readonly dispatcher: ProjectionRunDispatchPort\n}\n\ninterface LostProjectionRunsInput {\n readonly projectId: string\n readonly projectionRuns: NonNullable<Storage[\"projectionRuns\"]>\n /** Younger runs may still be in their first publication. */\n readonly queuedBefore: Date\n readonly recovery: ProjectionRunRecovery\n readonly signal?: AbortSignal\n}\n\n/**\n * Dispatches again the runs `queued` past their first publication, and those that failed with a\n * retryable enqueue error: the dispatcher republishes the same run and job, so whoever asks, it\n * is one. A run admitted under another definition revision belongs to an earlier deployment, and\n * the current revision is admitted from the lake instead. So a projection, unlike the other\n * primitives, needs the revision check its dispatcher carries to bring a queued run back.\n */\nexport async function republishQueuedProjectionRuns(\n input: LostProjectionRunsInput\n): Promise<number> {\n const { dispatcher, descriptors } = input.recovery\n const runs = await listQueuedRuns(input)\n const failures: Error[] = []\n let republished = 0\n\n for (const run of runs) {\n input.signal?.throwIfAborted()\n\n const descriptor = descriptors.find(\n (candidate) => candidate.projectionId === run.identity.projectionId\n )\n if (!descriptor || !admittedUnder(run, descriptor)) continue\n\n try {\n await dispatcher.dispatch({\n projectionId: descriptor.projectionId,\n datasetVersion: structuredClone(run.identity.datasetVersion),\n metadata: { dispatchSource: \"run-recovery\" },\n })\n republished += 1\n } catch (error) {\n failures.push(\n new Error(\n `[Sixb] Could not republish a projection run (projectionId=${descriptor.projectionId}, runId=${run.id}).`,\n { cause: error }\n )\n )\n }\n }\n\n if (failures.length > 0) {\n throw new AggregateError(failures, \"[Sixb] Could not republish every projection run.\")\n }\n\n return republished\n}\n\nasync function listQueuedRuns(\n input: LostProjectionRunsInput\n): Promise<readonly ProjectionRunRecord[]> {\n const [queued, enqueueFailed] = await Promise.all([\n listRuns(input, { statuses: [\"queued\"], startedBefore: input.queuedBefore }),\n listRuns(input, { statuses: [\"failed\"], errorCodes: [\"queue.enqueue_failed\"] }),\n ])\n\n return [...queued, ...enqueueFailed.filter((run) => run.error?.retryable)]\n}\n\nasync function listRuns(\n { projectId, projectionRuns }: LostProjectionRunsInput,\n filter: Omit<ListProjectionRunsInput, \"projectId\" | \"limit\" | \"offset\" | \"order\">\n): Promise<readonly ProjectionRunRecord[]> {\n const runs: ProjectionRunRecord[] = []\n\n for (let offset = 0; ; offset += PAGE_SIZE) {\n const page = await projectionRuns.list({\n ...filter,\n projectId,\n order: \"asc\",\n limit: PAGE_SIZE,\n offset,\n })\n\n runs.push(...page.runs)\n if (!page.hasMore) return runs\n }\n}\n\nfunction admittedUnder(\n run: ProjectionRunRecord,\n descriptor: ProjectionDispatchDescriptor\n): boolean {\n const { identity } = run\n\n return (\n identity.datasetVersion.datasetId === descriptor.datasetId &&\n identity.projectionKind === descriptor.projectionKind &&\n identity.protocol === descriptor.protocol &&\n identity.ontologyRevision === descriptor.ontologyRevision &&\n identity.projectionRevision === descriptor.projectionRevision &&\n identity.ownershipHash === descriptor.ownershipHash\n )\n}\n",
|
|
6
|
-
"import { captureSixbFailure, withFailureMessage } from \"../errors/internal\"\nimport type { SixbFailure } from \"../errors/types\"\nimport type { DomainEventLog, EventsAppendInput } from \"../events/service\"\nimport type { Queues } from \"../queues\"\nimport type { ListLostRunsInput, Storage } from \"../storage\"\nimport {\n type ClaimableRun,\n isOrphanedRun,\n isStaleRun,\n ORPHANED_RUN_AFTER_MS,\n} from \"../storage/run-claim\"\nimport { recoverJobId } from \"./job-ids\"\nimport { type ProjectionRunRecovery, republishQueuedProjectionRuns } from \"./lost-projection-runs\"\n\n/**\n * A job may still be on its way for this long: a queued run may be in its first publication, and a\n * run handed back has its job back in the queue.\n */\nconst JOB_ON_ITS_WAY_MS = 30_000\nconst DEFAULT_LIMIT = 100\n\n/** Most runs of each primitive `countLostRuns` says it found. */\nconst COUNT_LIMIT = 1_000\n\nconst SOURCE = \"SixbRunRecovery\"\nconst LOST_WORKER = \"Its worker was lost, and it was too old or too unclear to resume.\"\n\nexport interface RepublishLostRunsInput {\n readonly projectId: string\n readonly storage: Pick<\n Storage,\n \"executions\" | \"syncRuns\" | \"pipelineRuns\" | \"workflowRuns\" | \"projectionRuns\"\n >\n readonly queues: Pick<Queues, \"syncRuns\" | \"pipelines\" | \"workflows\" | \"projections\">\n readonly events: Pick<DomainEventLog, \"emit\">\n readonly now: Date\n /** Most runs of each primitive one call looks at, longest lost first. */\n readonly limit?: number\n /** Brings back queued projection runs. Without it, only lapsed ones get a job. */\n readonly projections?: ProjectionRunRecovery\n /** Stops a backlog of queued projection runs, which no limit caps, between two of them. */\n readonly signal?: AbortSignal\n}\n\ninterface RepublishLostRunsResult {\n /** Jobs published for runs that had none. */\n readonly republished: number\n /** Runs given up on, which end `cancelled`. */\n readonly settled: number\n}\n\n/** What the next `runs` pass would do with one primitive's lost runs. */\nexport interface LostRunCount {\n readonly primitive: \"sync\" | \"pipeline\" | \"workflow\"\n /** They get a job, and run: a workflow's side effects with them. */\n readonly goOn: number\n /** They end `cancelled`. */\n readonly end: number\n}\n\ninterface LostRunCandidate extends ClaimableRun {\n readonly executionId: string\n readonly queuedAt?: Date\n}\n\ntype LostRunFailure = SixbFailure<\"runtime.cancelled\">\n\n/** What differs between the primitives this pass looks after. */\ninterface RunLane<TRun extends LostRunCandidate> {\n readonly primitive: LostRunCount[\"primitive\"]\n listLost(input: Omit<ListLostRunsInput, \"projectId\">): Promise<readonly TRun[]>\n enqueue(jobs: readonly RecoveryJob[]): Promise<unknown>\n /** End what the run left running, its steps or its nodes. */\n cancelChildren?(run: TRun, failure: LostRunFailure): Promise<void>\n cancel(run: TRun, failure: LostRunFailure): Promise<EventsAppendInput[\"events\"][number]>\n}\n\ninterface RecoveryJob {\n readonly id: string\n readonly runId: string\n}\n\n/**\n * What keeps a run from staying unfinished for good, for syncs, pipelines and workflows:\n *\n * - A queued run whose job never made it, or was lost with the queue, gets a job.\n * - A running run whose lease lapsed, which covers one handed back, gets a job.\n * - A running run with no lease, from a version that held none, is given time to end on its old\n * worker, then ends `cancelled`. A cancelled run does not count as having read its inputs, so\n * the triggers that were waiting on it fire again.\n * - A run lost for a week ends `cancelled` too, whatever it was: nothing it was asked for should\n * happen by surprise that late, least of all a workflow's side effects.\n *\n * A delivery that finds the run held or finished does nothing, so this can be wrong about a job\n * being lost without doing harm. Projections have no older version to settle, and retry without a\n * cap, so a lost one only ever gets a job (see `republishQueuedProjectionRuns`).\n */\nexport async function republishLostRuns(\n input: RepublishLostRunsInput\n): Promise<RepublishLostRunsResult> {\n const lanes = [\n recoverLane(input, syncLane(input)),\n recoverLane(input, pipelineLane(input)),\n recoverLane(input, workflowLane(input)),\n recoverProjections(input),\n ]\n\n // A lane that fails must not hold the others, and still has to reach the caller.\n const settled = await Promise.allSettled(lanes)\n\n const failed = settled.find((result) => result.status === \"rejected\")\n if (failed?.status === \"rejected\") throw failed.reason\n\n return settled.reduce<RepublishLostRunsResult>(\n (total, result) =>\n result.status === \"fulfilled\"\n ? {\n republished: total.republished + result.value.republished,\n settled: total.settled + result.value.settled,\n }\n : total,\n { republished: 0, settled: 0 }\n )\n}\n\n/** What the next pass would do, for someone about to start one. Nothing moves. */\nexport async function countLostRuns(\n input: Omit<RepublishLostRunsInput, \"limit\">\n): Promise<readonly LostRunCount[]> {\n const counts = await Promise.all([\n countLane(input, syncLane(input)),\n countLane(input, pipelineLane(input)),\n countLane(input, workflowLane(input)),\n ])\n\n return counts.filter((count) => count !== null)\n}\n\nasync function countLane<TRun extends LostRunCandidate>(\n input: Pick<RepublishLostRunsInput, \"now\">,\n lane: RunLane<TRun> | undefined\n): Promise<LostRunCount | null> {\n if (!lane) return null\n\n const lost = await listLostRuns(input, lane, COUNT_LIMIT)\n const end = lost.filter((run) => isBeyondRecovery(run, input.now)).length\n\n return { primitive: lane.primitive, goOn: lost.length - end, end }\n}\n\nfunction listLostRuns<TRun extends LostRunCandidate>(\n { now }: Pick<RepublishLostRunsInput, \"now\">,\n lane: RunLane<TRun>,\n limit: number\n): Promise<readonly TRun[]> {\n const jobOnItsWay = new Date(now.getTime() - JOB_ON_ITS_WAY_MS)\n\n return lane.listLost({\n queuedBefore: jobOnItsWay,\n lapsedBy: jobOnItsWay,\n orphanedBefore: new Date(now.getTime() - ORPHANED_RUN_AFTER_MS),\n limit,\n })\n}\n\nfunction isBeyondRecovery(run: LostRunCandidate, now: Date): boolean {\n return isOrphanedRun(run, now) || isStaleRun(run, now)\n}\n\nasync function recoverLane<TRun extends LostRunCandidate>(\n input: RepublishLostRunsInput,\n lane: RunLane<TRun> | undefined\n): Promise<RepublishLostRunsResult> {\n if (!lane) return { republished: 0, settled: 0 }\n\n const { now } = input\n const lost = await listLostRuns(input, lane, input.limit ?? DEFAULT_LIMIT)\n\n const beyondRecovery = lost.filter((run) => isBeyondRecovery(run, now))\n const failures: unknown[] = []\n\n // One run that cannot be ended must not keep the next pass from the others.\n for (const run of beyondRecovery) {\n await settleRun(input, lane, run).catch((error) => failures.push(error))\n }\n\n const jobs = lost.filter((run) => !isBeyondRecovery(run, now)).map(recoveryJob)\n\n if (jobs.length > 0) await lane.enqueue(jobs)\n if (failures.length > 0) {\n throw new AggregateError(failures, \"[Sixb] Could not end every run beyond recovery.\")\n }\n\n return { republished: jobs.length, settled: beyondRecovery.length - failures.length }\n}\n\nasync function settleRun<TRun extends LostRunCandidate>(\n input: RepublishLostRunsInput,\n lane: RunLane<TRun>,\n run: TRun\n): Promise<void> {\n const failure = lostWorkerFailure(input, run)\n\n await lane.cancelChildren?.(run, failure)\n const finished = await lane.cancel(run, failure)\n\n await input.events.emit(\n { events: [finished], correlationId: await readCorrelationId(input, run) },\n { source: SOURCE }\n )\n}\n\nasync function recoverProjections(input: RepublishLostRunsInput): Promise<RepublishLostRunsResult> {\n const { projectId, storage, queues, projections } = input\n const { projectionRuns } = storage\n if (!projectionRuns) return { republished: 0, settled: 0 }\n\n const jobOnItsWay = new Date(input.now.getTime() - JOB_ON_ITS_WAY_MS)\n\n const lapsed = await projectionRuns.listLapsed({\n projectId,\n lapsedBy: jobOnItsWay,\n limit: input.limit ?? DEFAULT_LIMIT,\n })\n\n const jobs = lapsed.map(recoveryJob)\n\n if (jobs.length > 0) {\n await queues.projections.enqueue({\n projectId,\n jobs: queueJobs(\"projection.run.requested\", jobs),\n })\n }\n\n const queued = projections\n ? await republishQueuedProjectionRuns({\n projectId,\n projectionRuns,\n queuedBefore: jobOnItsWay,\n recovery: projections,\n signal: input.signal,\n })\n : 0\n\n return { republished: jobs.length + queued, settled: 0 }\n}\n\n/**\n * A queued run's id is stable, so a job still waiting in the queue absorbs this one. A running run's\n * own job may be settled, so it gets one of its own.\n */\nfunction recoveryJob(run: LostRunCandidate): RecoveryJob {\n const id = run.status === \"queued\" ? run.id : recoverJobId(run.id, run.attempt)\n\n return { id, runId: run.id }\n}\n\nfunction queueJobs<TType extends string>(type: TType, jobs: readonly RecoveryJob[]) {\n return jobs.map(({ id, runId }) => ({ id, type, payload: { runId } }))\n}\n\ntype LaneInput = Pick<RepublishLostRunsInput, \"projectId\" | \"storage\" | \"queues\" | \"now\">\n\nfunction syncLane({ projectId, storage, queues }: LaneInput) {\n const runs = storage.syncRuns\n if (!runs) return undefined\n\n return {\n primitive: \"sync\",\n listLost: (filter) => runs.listLost({ ...filter, projectId }),\n\n enqueue: (jobs) =>\n queues.syncRuns.enqueue({ projectId, jobs: queueJobs(\"sync.run.requested\", jobs) }),\n\n async cancel(run, failure) {\n await runs.finish({ projectId, id: run.id, status: \"cancelled\", error: failure })\n\n return {\n type: \"sync.run.finished\",\n payload: {\n syncId: run.syncId,\n runId: run.id,\n status: \"cancelled\",\n datasetId: run.datasetId,\n error: failure,\n },\n }\n },\n } satisfies RunLane<NonNullable<Awaited<ReturnType<typeof runs.getById>>>>\n}\n\nfunction pipelineLane({ projectId, storage, queues }: LaneInput) {\n const runs = storage.pipelineRuns\n if (!runs) return undefined\n\n return {\n primitive: \"pipeline\",\n listLost: (filter) => runs.listLost({ ...filter, projectId }),\n\n enqueue: (jobs) =>\n queues.pipelines.enqueue({ projectId, jobs: queueJobs(\"pipeline.run.requested\", jobs) }),\n\n async cancelChildren(run, failure) {\n const { steps } = await runs.listSteps({\n projectId,\n pipelineRunId: run.id,\n statuses: [\"running\"],\n })\n\n for (const step of steps) {\n await runs.finishStep({ projectId, id: step.id, status: \"cancelled\", error: failure })\n }\n },\n\n async cancel(run, failure) {\n await runs.finish({ projectId, id: run.id, status: \"cancelled\", error: failure })\n\n return {\n type: \"pipeline.run.finished\",\n payload: {\n pipelineId: run.pipelineId,\n runId: run.id,\n status: \"cancelled\",\n error: failure,\n },\n }\n },\n } satisfies RunLane<NonNullable<Awaited<ReturnType<typeof runs.getById>>>>\n}\n\nfunction workflowLane({ projectId, storage, queues, now }: LaneInput) {\n const runs = storage.workflowRuns\n if (!runs) return undefined\n\n return {\n primitive: \"workflow\",\n listLost: (filter) => runs.listLost({ ...filter, projectId }),\n\n enqueue: (jobs) =>\n queues.workflows.enqueue({ projectId, jobs: queueJobs(\"workflow.run.requested\", jobs) }),\n\n async cancelChildren(run, failure) {\n const { nodes } = await runs.nodes.list({\n projectId,\n workflowRunId: run.id,\n statuses: [\"running\"],\n })\n\n for (const node of nodes) {\n await runs.nodes.finish({ projectId, id: node.id, status: \"cancelled\", error: failure })\n }\n },\n\n async cancel(run, failure) {\n const finished = await runs.finish({\n projectId,\n id: run.id,\n status: \"cancelled\",\n error: failure,\n })\n\n return {\n type: \"workflow.run.finished\",\n payload: {\n workflowId: run.workflowId,\n runId: run.id,\n status: \"cancelled\",\n finishedAt: (finished.finishedAt ?? now).toISOString(),\n error: failure,\n },\n }\n },\n } satisfies RunLane<NonNullable<Awaited<ReturnType<typeof runs.getById>>>>\n}\n\nfunction lostWorkerFailure(input: RepublishLostRunsInput, run: LostRunCandidate): LostRunFailure {\n const lost = withFailureMessage(new Error(`[Sixb] Run '${run.id}' lost its worker.`), LOST_WORKER)\n\n return captureSixbFailure(lost, {\n allowedCodes: [\"runtime.cancelled\"],\n defaultCode: \"runtime.cancelled\",\n details: { runId: run.id },\n at: input.now,\n })\n}\n\n/** Its execution ties its events together. A run may have lost even that: its id then does. */\nasync function readCorrelationId(\n input: RepublishLostRunsInput,\n run: LostRunCandidate\n): Promise<string> {\n const execution = await input.storage.executions\n .getById({ projectId: input.projectId, id: run.executionId })\n .catch(() => null)\n\n return execution?.correlationId ?? run.id\n}\n"
|
|
6
|
+
"import { captureSixbFailure, withFailureMessage } from \"../errors/internal\"\nimport type { SixbFailure } from \"../errors/types\"\nimport type { DomainEventLog, EventsAppendInput } from \"../events/service\"\nimport type { Queues } from \"../queues\"\nimport type { ListLostRunsInput, Storage } from \"../storage\"\nimport {\n type ClaimableRun,\n isOrphanedRun,\n isStaleRun,\n ORPHANED_RUN_AFTER_MS,\n} from \"../storage/run-claim\"\nimport { recoverJobId } from \"./job-ids\"\nimport { type ProjectionRunRecovery, republishQueuedProjectionRuns } from \"./lost-projection-runs\"\n\n/**\n * A job may still be on its way for this long: a queued run may be in its first publication, and a\n * run handed back has its job back in the queue.\n */\nconst JOB_ON_ITS_WAY_MS = 30_000\nconst DEFAULT_LIMIT = 100\n\n/** Most runs of each primitive `countLostRuns` says it found. */\nconst COUNT_LIMIT = 1_000\n\nconst SOURCE = \"SixbRunRecovery\"\nconst LOST_WORKER = \"Its worker was lost, and it was too old or too unclear to resume.\"\n\nexport interface RepublishLostRunsInput {\n readonly projectId: string\n readonly storage: Pick<\n Storage,\n \"executions\" | \"syncRuns\" | \"pipelineRuns\" | \"workflowRuns\" | \"projectionRuns\"\n >\n readonly queues: Pick<Queues, \"syncRuns\" | \"pipelines\" | \"workflows\" | \"projections\">\n readonly events: Pick<DomainEventLog, \"emit\">\n readonly now: Date\n /** Most runs of each primitive one call looks at, longest lost first. */\n readonly limit?: number\n /** Brings back queued projection runs. Without it, only lapsed ones get a job. */\n readonly projections?: ProjectionRunRecovery\n /** Stops a backlog of queued projection runs, which no limit caps, between two of them. */\n readonly signal?: AbortSignal\n}\n\ninterface RepublishLostRunsResult {\n /** Jobs published for runs that had none. */\n readonly republished: number\n /** Runs given up on, which end `cancelled`. */\n readonly settled: number\n}\n\n/** What the next `runs` pass would do with one primitive's lost runs. */\nexport interface LostRunCount {\n readonly primitive: \"sync\" | \"pipeline\" | \"workflow\"\n /** They get a job, and run: a workflow's side effects with them. */\n readonly goOn: number\n /** They end `cancelled`. */\n readonly end: number\n}\n\ninterface LostRunCandidate extends ClaimableRun {\n readonly executionId: string\n readonly queuedAt?: Date\n}\n\ntype LostRunFailure = SixbFailure<\"runtime.cancelled\">\n\n/** What differs between the primitives this pass looks after. */\ninterface RunLane<TRun extends LostRunCandidate> {\n readonly primitive: LostRunCount[\"primitive\"]\n listLost(input: Omit<ListLostRunsInput, \"projectId\">): Promise<readonly TRun[]>\n enqueue(jobs: readonly RecoveryJob[]): Promise<unknown>\n /** End what the run left running, its steps or its nodes. */\n cancelChildren?(run: TRun, failure: LostRunFailure): Promise<void>\n cancel(run: TRun, failure: LostRunFailure): Promise<EventsAppendInput[\"events\"][number]>\n}\n\ninterface RecoveryJob {\n readonly id: string\n readonly runId: string\n}\n\n/**\n * What keeps a run from staying unfinished for good, for syncs, pipelines and workflows:\n *\n * - A queued run whose job never made it, or was lost with the queue, gets a job.\n * - A running run whose lease lapsed, which covers one handed back, gets a job.\n * - A running run with no lease, from a version that held none, is given time to end on its old\n * worker, then ends `cancelled`. A cancelled run does not count as having read its inputs, so\n * the triggers that were waiting on it fire again.\n * - A run lost for a week ends `cancelled` too, whatever it was: nothing it was asked for should\n * happen by surprise that late, least of all a workflow's side effects.\n *\n * A delivery that finds the run held or finished does nothing, so this can be wrong about a job\n * being lost without doing harm. Projections have no older version to settle, and retry without a\n * cap, so a lost one only ever gets a job (see `republishQueuedProjectionRuns`).\n */\nexport async function republishLostRuns(\n input: RepublishLostRunsInput\n): Promise<RepublishLostRunsResult> {\n const lanes = [\n recoverLane(input, syncLane(input)),\n recoverLane(input, pipelineLane(input)),\n recoverLane(input, workflowLane(input)),\n recoverProjections(input),\n ]\n\n // A lane that fails must not hold the others, and still has to reach the caller.\n const settled = await Promise.allSettled(lanes)\n\n const failed = settled.find((result) => result.status === \"rejected\")\n if (failed?.status === \"rejected\") throw failed.reason\n\n return settled.reduce<RepublishLostRunsResult>(\n (total, result) =>\n result.status === \"fulfilled\"\n ? {\n republished: total.republished + result.value.republished,\n settled: total.settled + result.value.settled,\n }\n : total,\n { republished: 0, settled: 0 }\n )\n}\n\n/** What the next pass would do, for someone about to start one. Nothing moves. */\nexport async function countLostRuns(\n input: Omit<RepublishLostRunsInput, \"limit\">\n): Promise<readonly LostRunCount[]> {\n const counts = await Promise.all([\n countLane(input, syncLane(input)),\n countLane(input, pipelineLane(input)),\n countLane(input, workflowLane(input)),\n ])\n\n return counts.filter((count) => count !== null)\n}\n\nasync function countLane<TRun extends LostRunCandidate>(\n input: Pick<RepublishLostRunsInput, \"now\">,\n lane: RunLane<TRun> | undefined\n): Promise<LostRunCount | null> {\n if (!lane) return null\n\n const lost = await listLostRuns(input, lane, COUNT_LIMIT)\n const end = lost.filter((run) => isBeyondRecovery(run, input.now)).length\n\n return { primitive: lane.primitive, goOn: lost.length - end, end }\n}\n\nfunction listLostRuns<TRun extends LostRunCandidate>(\n { now }: Pick<RepublishLostRunsInput, \"now\">,\n lane: RunLane<TRun>,\n limit: number\n): Promise<readonly TRun[]> {\n const jobOnItsWay = new Date(now.getTime() - JOB_ON_ITS_WAY_MS)\n\n return lane.listLost({\n queuedBefore: jobOnItsWay,\n lapsedBy: jobOnItsWay,\n orphanedBefore: new Date(now.getTime() - ORPHANED_RUN_AFTER_MS),\n limit,\n })\n}\n\nfunction isBeyondRecovery(run: LostRunCandidate, now: Date): boolean {\n return isOrphanedRun(run, now) || isStaleRun(run, now)\n}\n\nasync function recoverLane<TRun extends LostRunCandidate>(\n input: RepublishLostRunsInput,\n lane: RunLane<TRun> | undefined\n): Promise<RepublishLostRunsResult> {\n if (!lane) return { republished: 0, settled: 0 }\n\n const { now } = input\n const lost = await listLostRuns(input, lane, input.limit ?? DEFAULT_LIMIT)\n\n const beyondRecovery = lost.filter((run) => isBeyondRecovery(run, now))\n const failures: unknown[] = []\n\n // One run that cannot be ended must not keep the next pass from the others.\n for (const run of beyondRecovery) {\n await settleRun(input, lane, run).catch((error) => failures.push(error))\n }\n\n const jobs = lost.filter((run) => !isBeyondRecovery(run, now)).map(recoveryJob)\n\n if (jobs.length > 0) await lane.enqueue(jobs)\n if (failures.length > 0) {\n throw new AggregateError(failures, \"[Sixb] Could not end every run beyond recovery.\")\n }\n\n return { republished: jobs.length, settled: beyondRecovery.length - failures.length }\n}\n\nasync function settleRun<TRun extends LostRunCandidate>(\n input: RepublishLostRunsInput,\n lane: RunLane<TRun>,\n run: TRun\n): Promise<void> {\n const failure = lostWorkerFailure(input, run)\n\n await lane.cancelChildren?.(run, failure)\n const finished = await lane.cancel(run, failure)\n\n await input.events.emit(\n { events: [finished], correlationId: await readCorrelationId(input, run) },\n { source: SOURCE }\n )\n}\n\nasync function recoverProjections(input: RepublishLostRunsInput): Promise<RepublishLostRunsResult> {\n const { projectId, storage, queues, projections } = input\n const { projectionRuns } = storage\n if (!projectionRuns) return { republished: 0, settled: 0 }\n\n const jobOnItsWay = new Date(input.now.getTime() - JOB_ON_ITS_WAY_MS)\n\n const lapsed = await projectionRuns.listLapsed({\n projectId,\n lapsedBy: jobOnItsWay,\n limit: input.limit ?? DEFAULT_LIMIT,\n })\n\n const jobs = lapsed.map(recoveryJob)\n\n if (jobs.length > 0) {\n await queues.projections.enqueue({\n projectId,\n jobs: queueJobs(\"projection.run.requested\", jobs),\n })\n }\n\n const queued = projections\n ? await republishQueuedProjectionRuns({\n projectId,\n projectionRuns,\n queuedBefore: jobOnItsWay,\n recovery: projections,\n signal: input.signal,\n })\n : 0\n\n return { republished: jobs.length + queued, settled: 0 }\n}\n\n/**\n * A queued run's id is stable, so a job still waiting in the queue absorbs this one. A running run's\n * own job may be settled, so it gets one of its own.\n */\nfunction recoveryJob(run: LostRunCandidate): RecoveryJob {\n const id = run.status === \"queued\" ? run.id : recoverJobId(run.id, run.attempt)\n\n return { id, runId: run.id }\n}\n\nfunction queueJobs<TType extends string>(type: TType, jobs: readonly RecoveryJob[]) {\n return jobs.map(({ id, runId }) => ({ id, type, payload: { runId } }))\n}\n\ntype LaneInput = Pick<RepublishLostRunsInput, \"projectId\" | \"storage\" | \"queues\" | \"now\">\n\nfunction syncLane({ projectId, storage, queues }: LaneInput) {\n const runs = storage.syncRuns\n if (!runs) return undefined\n\n return {\n primitive: \"sync\",\n listLost: (filter) => runs.listLost({ ...filter, projectId }),\n\n enqueue: (jobs) =>\n queues.syncRuns.enqueue({ projectId, jobs: queueJobs(\"sync.run.requested\", jobs) }),\n\n async cancel(run, failure) {\n await runs.finish({ projectId, id: run.id, status: \"cancelled\", error: failure })\n\n return {\n type: \"sync.run.finished\",\n payload: {\n syncId: run.syncId,\n runId: run.id,\n ...(run.connectionId === undefined ? {} : { connectionId: run.connectionId }),\n status: \"cancelled\",\n datasetId: run.datasetId,\n error: failure,\n },\n }\n },\n } satisfies RunLane<NonNullable<Awaited<ReturnType<typeof runs.getById>>>>\n}\n\nfunction pipelineLane({ projectId, storage, queues }: LaneInput) {\n const runs = storage.pipelineRuns\n if (!runs) return undefined\n\n return {\n primitive: \"pipeline\",\n listLost: (filter) => runs.listLost({ ...filter, projectId }),\n\n enqueue: (jobs) =>\n queues.pipelines.enqueue({ projectId, jobs: queueJobs(\"pipeline.run.requested\", jobs) }),\n\n async cancelChildren(run, failure) {\n const { steps } = await runs.listSteps({\n projectId,\n pipelineRunId: run.id,\n statuses: [\"running\"],\n })\n\n for (const step of steps) {\n await runs.finishStep({ projectId, id: step.id, status: \"cancelled\", error: failure })\n }\n },\n\n async cancel(run, failure) {\n await runs.finish({ projectId, id: run.id, status: \"cancelled\", error: failure })\n\n return {\n type: \"pipeline.run.finished\",\n payload: {\n pipelineId: run.pipelineId,\n runId: run.id,\n status: \"cancelled\",\n error: failure,\n },\n }\n },\n } satisfies RunLane<NonNullable<Awaited<ReturnType<typeof runs.getById>>>>\n}\n\nfunction workflowLane({ projectId, storage, queues, now }: LaneInput) {\n const runs = storage.workflowRuns\n if (!runs) return undefined\n\n return {\n primitive: \"workflow\",\n listLost: (filter) => runs.listLost({ ...filter, projectId }),\n\n enqueue: (jobs) =>\n queues.workflows.enqueue({ projectId, jobs: queueJobs(\"workflow.run.requested\", jobs) }),\n\n async cancelChildren(run, failure) {\n const { nodes } = await runs.nodes.list({\n projectId,\n workflowRunId: run.id,\n statuses: [\"running\"],\n })\n\n for (const node of nodes) {\n await runs.nodes.finish({ projectId, id: node.id, status: \"cancelled\", error: failure })\n }\n },\n\n async cancel(run, failure) {\n const finished = await runs.finish({\n projectId,\n id: run.id,\n status: \"cancelled\",\n error: failure,\n })\n\n return {\n type: \"workflow.run.finished\",\n payload: {\n workflowId: run.workflowId,\n runId: run.id,\n status: \"cancelled\",\n finishedAt: (finished.finishedAt ?? now).toISOString(),\n error: failure,\n },\n }\n },\n } satisfies RunLane<NonNullable<Awaited<ReturnType<typeof runs.getById>>>>\n}\n\nfunction lostWorkerFailure(input: RepublishLostRunsInput, run: LostRunCandidate): LostRunFailure {\n const lost = withFailureMessage(new Error(`[Sixb] Run '${run.id}' lost its worker.`), LOST_WORKER)\n\n return captureSixbFailure(lost, {\n allowedCodes: [\"runtime.cancelled\"],\n defaultCode: \"runtime.cancelled\",\n details: { runId: run.id },\n at: input.now,\n })\n}\n\n/** Its execution ties its events together. A run may have lost even that: its id then does. */\nasync function readCorrelationId(\n input: RepublishLostRunsInput,\n run: LostRunCandidate\n): Promise<string> {\n const execution = await input.storage.executions\n .getById({ projectId: input.projectId, id: run.executionId })\n .catch(() => null)\n\n return execution?.correlationId ?? run.id\n}\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAIA,IAAM,YAAY;AAwBX,eAAe,6BAA6B,CACjD,OACiB;AAAA,EACjB,QAAQ,YAAY,gBAAgB,MAAM;AAAA,EAC1C,MAAM,OAAO,MAAM,eAAe,KAAK;AAAA,EACvC,MAAM,WAAoB,CAAC;AAAA,EAC3B,IAAI,cAAc;AAAA,EAElB,WAAW,OAAO,MAAM;AAAA,IACtB,MAAM,QAAQ,eAAe;AAAA,IAE7B,MAAM,aAAa,YAAY,KAC7B,CAAC,cAAc,UAAU,iBAAiB,IAAI,SAAS,YACzD;AAAA,IACA,IAAI,CAAC,cAAc,CAAC,cAAc,KAAK,UAAU;AAAA,MAAG;AAAA,IAEpD,IAAI;AAAA,MACF,MAAM,WAAW,SAAS;AAAA,QACxB,cAAc,WAAW;AAAA,QACzB,gBAAgB,gBAAgB,IAAI,SAAS,cAAc;AAAA,QAC3D,UAAU,EAAE,gBAAgB,eAAe;AAAA,MAC7C,CAAC;AAAA,MACD,eAAe;AAAA,MACf,OAAO,OAAO;AAAA,MACd,SAAS,KACP,IAAI,MACF,6DAA6D,WAAW,uBAAuB,IAAI,QACnG,EAAE,OAAO,MAAM,CACjB,CACF;AAAA;AAAA,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