@sixb/core 0.2.3 → 0.2.5
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 +28 -28
- package/dist/agents/cancel.d.ts +1 -1
- package/dist/agents/cancel.d.ts.map +1 -1
- package/dist/agents/child-question.d.ts +35 -2
- package/dist/agents/child-question.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +35 -3
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/ids.d.ts +4 -0
- package/dist/agents/ids.d.ts.map +1 -1
- package/dist/agents/index.d.ts +9 -7
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +59 -33
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-loop.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 +79 -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 +6 -1
- package/dist/agents/run-events.d.ts.map +1 -1
- package/dist/agents/run-session-children.d.ts +9 -0
- 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.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.js +1 -1
- package/dist/agents/streams/protocol.d.ts +16 -0
- package/dist/agents/streams/protocol.d.ts.map +1 -1
- package/dist/agents/tool-files.d.ts +1 -1
- package/dist/agents/tool-files.d.ts.map +1 -1
- package/dist/agents/tool-input-coercion.d.ts +20 -0
- package/dist/agents/tool-input-coercion.d.ts.map +1 -0
- 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 +65 -3
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/runtime.d.ts +32 -5
- package/dist/artifacts/frames/runtime.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +4 -2
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +35 -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 +23 -19
- 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 +26 -18
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/merge.d.ts +5 -5
- 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/auth/index.js +2 -2
- package/dist/authorization/event-visibility.d.ts.map +1 -1
- package/dist/authorization/index.js +1 -1
- package/dist/blob-storage/index.js +1 -1
- package/dist/bootstrap/index.js +38 -38
- package/dist/{chunk-tqa68kj7.js → chunk-0hkdtwqk.js} +5 -5
- package/dist/{chunk-s5n9617r.js → chunk-0mvjpgvm.js} +5 -5
- package/dist/{chunk-k66rp2hr.js → chunk-1yh6jgtz.js} +1 -1
- package/dist/{chunk-26qet7wh.js → chunk-5t9gm5tt.js} +4 -4
- 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-hkaa807g.js → chunk-68hm50qh.js} +3 -3
- package/dist/{chunk-9nsjjd44.js → chunk-8tv3qd65.js} +2 -1
- package/dist/chunk-8tv3qd65.js.map +12 -0
- package/dist/{chunk-fe6r7yhg.js → chunk-92wrka15.js} +1 -1
- package/dist/{chunk-m7b9q5dk.js → chunk-aw1z0gre.js} +4 -4
- package/dist/chunk-az95tsh3.js.map +2 -2
- package/dist/{chunk-4j0sagwv.js → chunk-b4escq4c.js} +62 -14
- package/dist/{chunk-4j0sagwv.js.map → chunk-b4escq4c.js.map} +7 -7
- package/dist/chunk-bqr703h4.js +1799 -0
- package/dist/chunk-bqr703h4.js.map +13 -0
- package/dist/{chunk-eptrvnby.js → chunk-c29729me.js} +42 -3
- package/dist/chunk-c29729me.js.map +12 -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-3014rfjz.js → chunk-ewqn51gr.js} +25 -7
- package/dist/{chunk-3014rfjz.js.map → chunk-ewqn51gr.js.map} +3 -3
- package/dist/{chunk-7z5rkf0m.js → chunk-ey1p8w68.js} +175 -5
- package/dist/chunk-ey1p8w68.js.map +13 -0
- package/dist/{chunk-z0t4p2sk.js → chunk-fpf57gca.js} +350 -61
- package/dist/chunk-fpf57gca.js.map +47 -0
- package/dist/{chunk-kv0kvknv.js → chunk-fzae1jpq.js} +7 -7
- package/dist/{chunk-b9qfh2ya.js → chunk-fzbhybya.js} +29 -2
- package/dist/chunk-fzbhybya.js.map +11 -0
- package/dist/{chunk-2by73sm2.js → chunk-gjhrz66x.js} +225 -17
- package/dist/{chunk-2by73sm2.js.map → chunk-gjhrz66x.js.map} +5 -5
- package/dist/chunk-hn2r7z41.js.map +1 -1
- package/dist/{chunk-6gtxshcc.js → chunk-k29n4176.js} +6 -6
- package/dist/{chunk-48c1z8nj.js → chunk-k3jh8gsg.js} +10 -2
- package/dist/chunk-k3jh8gsg.js.map +10 -0
- package/dist/{chunk-w9s23r24.js → chunk-m3qx2pns.js} +751 -93
- package/dist/chunk-m3qx2pns.js.map +34 -0
- package/dist/{chunk-smnt672s.js → chunk-m9ketb51.js} +20 -4
- package/dist/chunk-m9ketb51.js.map +10 -0
- package/dist/chunk-mbwsgjn7.js +40 -0
- package/dist/chunk-mbwsgjn7.js.map +11 -0
- package/dist/{chunk-sysnvjce.js → chunk-naxjka9v.js} +2 -2
- package/dist/{chunk-n4zzaf6q.js → chunk-nxysqbt0.js} +4 -2
- package/dist/chunk-nxysqbt0.js.map +10 -0
- package/dist/{chunk-vzkxqf8h.js → chunk-paxabbqd.js} +49 -5
- package/dist/chunk-paxabbqd.js.map +23 -0
- package/dist/{chunk-8tqnsx3q.js → chunk-pc7kra3k.js} +5 -3
- package/dist/{chunk-8tqnsx3q.js.map → chunk-pc7kra3k.js.map} +3 -3
- package/dist/{chunk-qafng88v.js → chunk-pqvvqc65.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-8t2ynwg0.js → chunk-q8d9p0tb.js} +24 -1
- package/dist/{chunk-8t2ynwg0.js.map → chunk-q8d9p0tb.js.map} +3 -3
- package/dist/{chunk-wa05txmk.js → chunk-qavwr628.js} +49 -5
- package/dist/chunk-qavwr628.js.map +12 -0
- package/dist/{chunk-bkmnd7zq.js → chunk-rg725hry.js} +174 -30
- package/dist/{chunk-bkmnd7zq.js.map → chunk-rg725hry.js.map} +9 -8
- package/dist/{chunk-8p7bze4c.js → chunk-s1mqyqmm.js} +3 -3
- package/dist/{chunk-p351afzm.js → chunk-s5pj68fa.js} +2 -2
- package/dist/{chunk-855w9nvw.js → chunk-vehcr9eb.js} +1 -1
- package/dist/{chunk-qds484t8.js → chunk-vs2s3p8n.js} +932 -21
- package/dist/chunk-vs2s3p8n.js.map +20 -0
- package/dist/chunk-vtjzwymr.js.map +2 -2
- package/dist/{chunk-n68vz95m.js → chunk-wqe9shx2.js} +1 -1
- package/dist/{chunk-0k3r5kb3.js → chunk-xcrnrpfh.js} +1 -1
- 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-e9w4mgdh.js → chunk-z1njfqqs.js} +589 -53
- package/dist/{chunk-e9w4mgdh.js.map → chunk-z1njfqqs.js.map} +14 -11
- package/dist/{chunk-yv8hv4wq.js → chunk-z4jqb44a.js} +3 -1
- package/dist/chunk-z4jqb44a.js.map +10 -0
- package/dist/{chunk-s7xqfxs9.js → chunk-zft9bzbc.js} +2 -1
- package/dist/{chunk-s7xqfxs9.js.map → chunk-zft9bzbc.js.map} +3 -3
- package/dist/{chunk-38yvdqzd.js → chunk-zxhym8tr.js} +1 -1
- 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/events.d.ts +17 -0
- package/dist/connectors/connections/events.d.ts.map +1 -0
- 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 +4 -0
- package/dist/connectors/connections/service.d.ts.map +1 -1
- package/dist/connectors/execution.d.ts +7 -1
- package/dist/connectors/execution.d.ts.map +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.d.ts.map +1 -1
- package/dist/connectors/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 +18 -1
- 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.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/execution/agent.js +28 -28
- package/dist/execution/authorization.d.ts +5 -0
- package/dist/execution/authorization.d.ts.map +1 -1
- package/dist/execution/primitive.js +28 -28
- package/dist/execution/request.js +29 -29
- 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 +9 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -44
- 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 +1 -1
- 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 +13 -13
- 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/execution/index.js +12 -12
- package/dist/models/language-model.d.ts +6 -0
- package/dist/models/language-model.d.ts.map +1 -1
- package/dist/models/tools.d.ts +2 -0
- package/dist/models/tools.d.ts.map +1 -1
- package/dist/objects/index.js +28 -28
- package/dist/objects/query/index.js +12 -12
- package/dist/pipelines/index.js +18 -18
- 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 +13 -13
- 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 +2 -1
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/index.js +1 -1
- package/dist/queues/types.d.ts +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 +39 -18
- package/dist/runtime/internal.js.map +4 -3
- 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/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/shares/internal.js +12 -12
- 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 +26 -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 +12 -3
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +25 -5
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +156 -1
- package/dist/storage/agents/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 +2 -1
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +34 -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 +3 -3
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +18 -14
- 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 +8 -6
- 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/workflow-runs/provider.js +3 -3
- package/dist/syncs/index.js +19 -19
- 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/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 +5524 -4555
- package/dist/testing/index.js.map +10 -9
- package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-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 +16 -49
- 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/queued-run-dispatch.d.ts.map +1 -1
- package/dist/workflows/index.js +35 -35
- package/package.json +6 -1
- package/src/agents/README.md +6 -2
- package/src/agents/approval-outcome.ts +2 -2
- package/src/agents/cancel.ts +2 -2
- package/src/agents/child-question.ts +76 -8
- package/src/agents/execution.ts +168 -30
- package/src/agents/ids.ts +9 -1
- package/src/agents/index.ts +27 -6
- package/src/agents/model-loop.ts +3 -1
- package/src/agents/queued-turn.ts +46 -0
- package/src/agents/request.ts +517 -2
- package/src/agents/run-after-finish.ts +259 -2
- package/src/agents/run-artifacts.ts +3 -93
- package/src/agents/run-events.ts +26 -1
- package/src/agents/run-session-children.ts +33 -0
- package/src/agents/run-session-http.ts +10 -2
- package/src/agents/run-session-serve.ts +3 -8
- package/src/agents/run-session.ts +142 -3
- package/src/agents/run-turn.ts +8 -0
- package/src/agents/streams/index.ts +1 -0
- package/src/agents/streams/protocol.ts +41 -1
- package/src/agents/tool-files.ts +1 -1
- package/src/agents/tool-input-coercion.ts +140 -0
- package/src/agents/turn-answered.ts +31 -0
- package/src/agents/validation.ts +13 -3
- 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 +96 -3
- package/src/artifacts/frames/runtime.ts +709 -19
- package/src/artifacts/index.ts +6 -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 +14 -12
- 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/authorization/event-visibility.ts +13 -0
- package/src/connectors/connection-handles.ts +71 -0
- package/src/connectors/connections/authorizations.ts +50 -2
- package/src/connectors/connections/events.ts +57 -0
- package/src/connectors/connections/runs.ts +5 -0
- package/src/connectors/connections/service.ts +19 -1
- package/src/connectors/execution.ts +30 -2
- package/src/connectors/index.ts +3 -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 +26 -1
- package/src/events/definitions.ts +14 -0
- package/src/events/execution.ts +9 -2
- 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/execution/authorization.ts +45 -0
- package/src/execution/durable.ts +2 -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 +26 -1
- package/src/index.ts +21 -2
- 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/language-model.ts +6 -0
- package/src/models/tools.ts +2 -0
- 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 +112 -4
- package/src/runtime/internal.ts +1 -0
- package/src/runtime/resolve-definitions.ts +4 -1
- package/src/runtime/script.ts +62 -0
- package/src/runtime/sixb.ts +3 -3
- package/src/schedules/builders.ts +4 -1
- package/src/schedules/runtime.ts +3 -0
- package/src/schedules/validation.ts +20 -2
- package/src/storage/agents/errors.ts +1 -0
- package/src/storage/agents/in-memory.ts +229 -1
- package/src/storage/agents/index.ts +16 -0
- package/src/storage/agents/provider.ts +284 -2
- package/src/storage/agents/types.ts +168 -1
- package/src/storage/artifacts/in-memory.ts +32 -1
- package/src/storage/artifacts/index.ts +2 -0
- package/src/storage/artifacts/record.ts +25 -2
- package/src/storage/artifacts/types.ts +37 -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 +18 -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 +1 -0
- package/src/testing/agent-execution.ts +45 -2
- package/src/testing/agent-inbox-storage-contract.ts +815 -0
- package/src/testing/agent-storage-contract.ts +103 -0
- package/src/testing/artifact-storage-contract.ts +72 -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/webhooks/connections.ts +9 -50
- package/src/webhooks/index.ts +0 -2
- package/src/webhooks/types.ts +2 -13
- package/src/workers/queued-run-dispatch.ts +8 -1
- 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-7z5rkf0m.js.map +0 -13
- 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-m2jerfef.js +0 -474
- package/dist/chunk-m2jerfef.js.map +0 -11
- package/dist/chunk-n4zzaf6q.js.map +0 -10
- package/dist/chunk-qds484t8.js.map +0 -18
- package/dist/chunk-smnt672s.js.map +0 -10
- package/dist/chunk-vzkxqf8h.js.map +0 -23
- package/dist/chunk-w9s23r24.js.map +0 -30
- package/dist/chunk-wa05txmk.js.map +0 -11
- package/dist/chunk-yv8hv4wq.js.map +0 -10
- package/dist/chunk-z0t4p2sk.js.map +0 -47
- /package/dist/{chunk-tqa68kj7.js.map → chunk-0hkdtwqk.js.map} +0 -0
- /package/dist/{chunk-s5n9617r.js.map → chunk-0mvjpgvm.js.map} +0 -0
- /package/dist/{chunk-k66rp2hr.js.map → chunk-1yh6jgtz.js.map} +0 -0
- /package/dist/{chunk-26qet7wh.js.map → chunk-5t9gm5tt.js.map} +0 -0
- /package/dist/{chunk-e0hnbb1m.js.map → chunk-61zptves.js.map} +0 -0
- /package/dist/{chunk-hkaa807g.js.map → chunk-68hm50qh.js.map} +0 -0
- /package/dist/{chunk-fe6r7yhg.js.map → chunk-92wrka15.js.map} +0 -0
- /package/dist/{chunk-m7b9q5dk.js.map → chunk-aw1z0gre.js.map} +0 -0
- /package/dist/{chunk-kv0kvknv.js.map → chunk-fzae1jpq.js.map} +0 -0
- /package/dist/{chunk-6gtxshcc.js.map → chunk-k29n4176.js.map} +0 -0
- /package/dist/{chunk-sysnvjce.js.map → chunk-naxjka9v.js.map} +0 -0
- /package/dist/{chunk-qafng88v.js.map → chunk-pqvvqc65.js.map} +0 -0
- /package/dist/{chunk-8p7bze4c.js.map → chunk-s1mqyqmm.js.map} +0 -0
- /package/dist/{chunk-p351afzm.js.map → chunk-s5pj68fa.js.map} +0 -0
- /package/dist/{chunk-855w9nvw.js.map → chunk-vehcr9eb.js.map} +0 -0
- /package/dist/{chunk-n68vz95m.js.map → chunk-wqe9shx2.js.map} +0 -0
- /package/dist/{chunk-0k3r5kb3.js.map → chunk-xcrnrpfh.js.map} +0 -0
- /package/dist/{chunk-38yvdqzd.js.map → chunk-zxhym8tr.js.map} +0 -0
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
isScheduleReference2,
|
|
4
4
|
isScheduleDefinition2
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-dvgc56n2.js";
|
|
6
6
|
import {
|
|
7
7
|
ConnectorError2,
|
|
8
8
|
createConnectorCodedError,
|
|
9
9
|
getConnectorExecutionSourceResolver
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-qavwr628.js";
|
|
11
11
|
import {
|
|
12
12
|
isDatasetDefinition2
|
|
13
13
|
} from "./chunk-wx7smkn2.js";
|
|
14
14
|
import {
|
|
15
15
|
SyncValidationError2
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-aw1z0gre.js";
|
|
17
17
|
import {
|
|
18
18
|
isOAuthConnectorAdapter,
|
|
19
19
|
isConnectorDefinition
|
|
@@ -404,6 +404,7 @@ class InMemoryQueues2 {
|
|
|
404
404
|
store = new InMemoryQueueStore;
|
|
405
405
|
vectorIndexing = new InMemoryQueue(this.store, "vector.indexing");
|
|
406
406
|
lake = new InMemoryQueue(this.store, "lake");
|
|
407
|
+
renders = new InMemoryQueue(this.store, "renders");
|
|
407
408
|
syncRuns = new InMemoryQueue(this.store, "sync.runs");
|
|
408
409
|
pipelines = new InMemoryQueue(this.store, "pipeline.runs");
|
|
409
410
|
projections = new InMemoryQueue(this.store, "projection.runs");
|
|
@@ -415,4 +416,4 @@ class InMemoryQueues2 {
|
|
|
415
416
|
}
|
|
416
417
|
export { QueueError2, InMemoryQueues2 };
|
|
417
418
|
|
|
418
|
-
//# debugId=
|
|
419
|
+
//# debugId=7BACC1C0F63002AE64756E2164756E21
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/queues/errors.ts", "../src/queues/in-memory.ts", "../src/queues/indexed-heap.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * Error for queue invariants and invalid queue operations.\n */\nexport class QueueError extends Error {\n readonly name = \"QueueError\"\n}\n",
|
|
6
|
+
"import { randomUUID } from \"node:crypto\"\nimport type { SixbErrorCode } from \"../errors/types\"\nimport { QueueError } from \"./errors\"\nimport { IndexedHeap } from \"./indexed-heap\"\nimport type {\n AgentQueueJob,\n AgentQueueJobFailureCode,\n ClaimedQueueJob,\n LakeQueueJob,\n NewQueueJob,\n PipelineQueueJobFailureCode,\n PipelineRunRequestedQueueJob,\n ProjectionQueueJobFailureCode,\n ProjectionRunRequestedQueueJob,\n Queue,\n QueueJob,\n QueueJobFailure,\n Queues,\n RenderQueueJob,\n SyncQueueJobFailureCode,\n SyncRunRequestedQueueJob,\n VectorIndexingQueueJob,\n WorkflowQueueJob,\n WorkflowQueueJobFailureCode,\n} from \"./types\"\n\ntype QueueRecordState = \"queued\" | \"completed\" | \"failed\"\n\ninterface QueueRecord<TQueueJob extends QueueJob = QueueJob> {\n readonly sequence: number\n readonly queueId: string\n job: TQueueJob\n availableAtMs: number\n readonly createdAtMs: number\n leaseExpiryMs: number | null\n // A leased job stays \"queued\" until a worker completes or fails it.\n state: QueueRecordState\n failure: QueueJobFailure | null\n leaseId: string | null\n claimedAt: string | null\n leaseExpiresAt: string | null\n /** The job asked for in its place while it was claimed: the id waits as it once settled. */\n replacement: TQueueJob | null\n}\n\nfunction assertNonEmpty(value: string, fieldName: string): void {\n if (value.trim().length === 0) {\n throw new QueueError(`[Sixb] Queue ${fieldName} must not be empty`)\n }\n}\n\nfunction parseTimestamp(value: string, fieldName: string): number {\n const timestamp = Date.parse(value)\n\n if (Number.isNaN(timestamp)) {\n throw new QueueError(`[Sixb] Queue ${fieldName} must be a valid timestamp`)\n }\n\n return timestamp\n}\n\nfunction assertPositiveNumber(value: number, fieldName: string): void {\n if (!Number.isFinite(value) || value <= 0) {\n throw new QueueError(`[Sixb] Queue ${fieldName} must be greater than 0`)\n }\n}\n\nfunction clearLease(record: QueueRecord): void {\n record.leaseId = null\n record.claimedAt = null\n record.leaseExpiresAt = null\n record.leaseExpiryMs = null\n}\n\n// Best-effort ordering is part of the contract; this keeps the in-memory provider deterministic.\nfunction compareQueueRecords(left: QueueRecord, right: QueueRecord): number {\n const availableDifference = left.availableAtMs - right.availableAtMs\n if (availableDifference !== 0) return availableDifference\n const createdDifference = left.createdAtMs - right.createdAtMs\n if (createdDifference !== 0) return createdDifference\n\n return left.sequence - right.sequence\n}\n\nfunction createQueueJob<TQueueJob extends QueueJob>(\n projectId: string,\n newJob: NewQueueJob<TQueueJob>\n): TQueueJob {\n const createdAt = new Date().toISOString()\n const availableAt = newJob.availableAt ?? createdAt\n parseTimestamp(availableAt, \"availableAt\")\n\n return {\n id: newJob.id ?? randomUUID(),\n projectId,\n createdAt,\n availableAt,\n attempt: 0,\n metadata: newJob.metadata ? structuredClone(newJob.metadata) : undefined,\n type: newJob.type,\n payload: structuredClone(newJob.payload),\n } as TQueueJob\n}\n\n/** Whether a worker holds the job now: it is queued under a lease that has not lapsed. */\nfunction isLeased(record: QueueRecord, now: number): boolean {\n return record.state === \"queued\" && record.leaseExpiryMs !== null && record.leaseExpiryMs > now\n}\n\nfunction leaseExpiresAtMs(record: QueueRecord): number | null {\n return record.leaseExpiryMs\n}\n\nfunction eligibleAt(record: QueueRecord): number {\n return Math.max(record.availableAtMs, record.leaseExpiryMs ?? -Infinity)\n}\n\n// Largest delay `setTimeout` accepts; a waiting claim that wakes early just waits again.\nconst MAX_TIMER_DELAY_MS = 2_147_483_647\n\ninterface QueueLane {\n // Terminal records remain here for caller-id deduplication, never in the delivery indexes.\n readonly records: Map<string, QueueRecord>\n readonly ready: IndexedHeap<QueueRecord>\n readonly waiting: IndexedHeap<QueueRecord>\n /** Wakes claims waiting on this lane. */\n readonly waiters: Set<() => void>\n}\n\nfunction toClaimedQueueJob<TQueueJob extends QueueJob>(\n record: QueueRecord<TQueueJob>\n): ClaimedQueueJob<TQueueJob> {\n if (!record.leaseId || !record.claimedAt || !record.leaseExpiresAt) {\n throw new QueueError(`[Sixb] Queue job '${record.job.id}' is not currently leased`)\n }\n\n return {\n leaseId: record.leaseId,\n claimedAt: record.claimedAt,\n leaseExpiresAt: record.leaseExpiresAt,\n job: structuredClone(record.job),\n }\n}\n\nclass InMemoryQueueStore {\n private readonly projects = new Map<string, Map<string, QueueLane>>()\n private nextSequence = 1\n\n add<TQueueJob extends QueueJob>(projectId: string, queueId: string, job: TQueueJob): void {\n const lane = this.lane(projectId, queueId)\n const record: QueueRecord = {\n sequence: this.nextSequence++,\n queueId,\n job,\n availableAtMs: parseTimestamp(job.availableAt, \"job.availableAt\"),\n createdAtMs: parseTimestamp(job.createdAt, \"job.createdAt\"),\n leaseExpiryMs: null,\n state: \"queued\",\n failure: null,\n leaseId: null,\n claimedAt: null,\n leaseExpiresAt: null,\n replacement: null,\n }\n // A record this one replaces leaves the delivery indexes with it.\n const replaced = lane.records.get(job.id)\n if (replaced) {\n lane.ready.delete(replaced)\n lane.waiting.delete(replaced)\n }\n lane.records.set(job.id, record)\n this.schedule(projectId, record, Date.now())\n }\n\n find<TQueueJob extends QueueJob>(\n projectId: string,\n queueId: string,\n jobId: string\n ): QueueRecord<TQueueJob> | null {\n return (this.projects.get(projectId)?.get(queueId)?.records.get(jobId) ??\n null) as QueueRecord<TQueueJob> | null\n }\n\n schedule(projectId: string, record: QueueRecord, now: number): void {\n const lane = this.lane(projectId, record.queueId)\n if (record.state !== \"queued\") {\n lane.ready.delete(record)\n lane.waiting.delete(record)\n } else if (eligibleAt(record) <= now) {\n lane.waiting.delete(record)\n lane.ready.set(record)\n } else {\n lane.ready.delete(record)\n lane.waiting.set(record)\n }\n // Any change can make a job claimable or move the next due time; waiters look again.\n for (const wake of lane.waiters) wake()\n }\n\n /** Resolves when the lane changes, its next delayed job or lease comes due, or `signal` aborts. */\n waitForWork(projectId: string, queueId: string, signal: AbortSignal): Promise<void> {\n const lane = this.lane(projectId, queueId)\n const next = lane.waiting.peek()\n const dueInMs = next ? eligibleAt(next) - Date.now() : MAX_TIMER_DELAY_MS\n return new Promise((resolve) => {\n // Always armed: like a blocking read on a socket, a waiting claim keeps its process alive.\n const timer = setTimeout(wake, Math.min(dueInMs, MAX_TIMER_DELAY_MS))\n function wake(): void {\n clearTimeout(timer)\n lane.waiters.delete(wake)\n signal.removeEventListener(\"abort\", wake)\n resolve()\n }\n lane.waiters.add(wake)\n signal.addEventListener(\"abort\", wake, { once: true })\n })\n }\n\n takeReady<TQueueJob extends QueueJob>(\n projectId: string,\n queueId: string,\n now: number,\n limit: number\n ): QueueRecord<TQueueJob>[] {\n const lane = this.projects.get(projectId)?.get(queueId)\n if (!lane) return []\n // Wake delayed jobs and expired leases, then order all ready jobs by the original contract.\n // A lease expiry controls eligibility, not the priority of a redelivered job.\n while (lane.waiting.peek() && eligibleAt(lane.waiting.peek()!) <= now) {\n lane.ready.set(lane.waiting.pop()!)\n }\n const selected: QueueRecord[] = []\n while (selected.length < limit) {\n const record = lane.ready.peek()\n if (!record || record.availableAtMs > now) break\n lane.ready.pop()\n // A backwards wall-clock adjustment can make a previously expired lease live again.\n if (eligibleAt(record) > now) lane.waiting.set(record)\n else selected.push(record)\n }\n return selected as QueueRecord<TQueueJob>[]\n }\n\n private lane(projectId: string, queueId: string): QueueLane {\n let queues = this.projects.get(projectId)\n if (!queues) {\n queues = new Map()\n this.projects.set(projectId, queues)\n }\n let lane = queues.get(queueId)\n if (!lane) {\n lane = {\n records: new Map(),\n ready: new IndexedHeap(compareQueueRecords),\n waiting: new IndexedHeap(\n (left, right) => eligibleAt(left) - eligibleAt(right) || left.sequence - right.sequence\n ),\n waiters: new Set(),\n }\n queues.set(queueId, lane)\n }\n return lane\n }\n}\n\nclass InMemoryQueue<TQueueJob extends QueueJob, TFailureCode extends SixbErrorCode>\n implements Queue<TQueueJob, TFailureCode>\n{\n constructor(\n private readonly store: InMemoryQueueStore,\n private readonly queueId: string\n ) {\n assertNonEmpty(queueId, \"queueId\")\n }\n\n async enqueue(params: {\n projectId: string\n jobs: readonly NewQueueJob<TQueueJob>[]\n }): Promise<readonly TQueueJob[]> {\n assertNonEmpty(params.projectId, \"projectId\")\n\n if (params.jobs.length === 0) {\n return []\n }\n\n const createdJobs = params.jobs.map((job) => {\n if (job.id !== undefined) assertNonEmpty(job.id, \"job.id\")\n const existing = job.id\n ? this.store.find<TQueueJob>(params.projectId, this.queueId, job.id)\n : null\n if (existing && !job.replace) return existing.job\n\n const created = createQueueJob(params.projectId, job)\n\n // A claimed job finishes its delivery first; the id then waits as this one.\n if (existing && isLeased(existing, Date.now())) {\n existing.replacement = created\n return created\n }\n\n this.store.add(params.projectId, this.queueId, created)\n return created\n })\n\n return createdJobs.map((job) => structuredClone(job))\n }\n\n async claim(params: {\n projectId: string\n workerId: string\n limit?: number\n leaseMs?: number\n signal?: AbortSignal\n }): Promise<readonly ClaimedQueueJob<TQueueJob>[]> {\n assertNonEmpty(params.projectId, \"projectId\")\n assertNonEmpty(params.workerId, \"workerId\")\n\n const limit = Math.trunc(params.limit ?? 1)\n if (!(limit > 0)) {\n return []\n }\n\n const leaseMs = params.leaseMs ?? 30_000\n assertPositiveNumber(leaseMs, \"leaseMs\")\n\n for (;;) {\n if (params.signal?.aborted) return []\n const now = Date.now()\n const claimedAt = new Date(now).toISOString()\n // Validate before removing candidates, and cache the same millisecond precision we return.\n const leaseExpiry = new Date(now + leaseMs)\n const leaseExpiresAt = leaseExpiry.toISOString()\n const claimable = this.store.takeReady<TQueueJob>(params.projectId, this.queueId, now, limit)\n if (claimable.length === 0 && params.signal) {\n await this.store.waitForWork(params.projectId, this.queueId, params.signal)\n continue\n }\n\n // A job replaced while its lease lapsed waits as its replacement instead.\n const replaced = claimable.filter((record) => record.replacement)\n for (const record of replaced) this.settleReplaced(params.projectId, record)\n if (replaced.length === claimable.length && replaced.length > 0) continue\n\n return claimable.flatMap((record) => {\n if (replaced.includes(record)) return []\n\n // Attempts count claims so redelivery after lease expiry or retry is visible to workers.\n record.job = {\n ...record.job,\n attempt: record.job.attempt + 1,\n }\n record.leaseId = randomUUID()\n record.claimedAt = claimedAt\n record.leaseExpiresAt = leaseExpiresAt\n record.leaseExpiryMs = leaseExpiry.getTime()\n this.store.schedule(params.projectId, record, now)\n\n return [toClaimedQueueJob(record)]\n })\n }\n }\n\n async complete(params: { projectId: string; jobId: string; leaseId: string }): Promise<void> {\n const record = this.requireActiveLease(params)\n if (this.settleReplaced(params.projectId, record)) return\n\n record.state = \"completed\"\n clearLease(record)\n this.store.schedule(params.projectId, record, Date.now())\n }\n\n async retry(params: {\n projectId: string\n jobId: string\n leaseId: string\n availableAt?: string\n }): Promise<void> {\n const record = this.requireActiveLease(params)\n if (this.settleReplaced(params.projectId, record)) return\n\n const availableAt = params.availableAt ?? new Date().toISOString()\n const availableAtMs = parseTimestamp(availableAt, \"availableAt\")\n\n record.availableAtMs = availableAtMs\n record.job = {\n ...record.job,\n availableAt,\n }\n clearLease(record)\n this.store.schedule(params.projectId, record, Date.now())\n }\n\n async fail(params: {\n projectId: string\n jobId: string\n leaseId: string\n failure: QueueJobFailure<TFailureCode>\n }): Promise<void> {\n const record = this.requireActiveLease(params)\n if (this.settleReplaced(params.projectId, record)) return\n\n record.state = \"failed\"\n record.failure = structuredClone(params.failure)\n clearLease(record)\n this.store.schedule(params.projectId, record, Date.now())\n }\n\n async renewLease(params: {\n projectId: string\n jobId: string\n leaseId: string\n leaseMs: number\n }): Promise<ClaimedQueueJob<TQueueJob> | null> {\n assertPositiveNumber(params.leaseMs, \"leaseMs\")\n\n const record = this.store.find<TQueueJob>(params.projectId, this.queueId, params.jobId)\n if (!record || record.state !== \"queued\") {\n return null\n }\n\n const now = Date.now()\n const expiresAt = leaseExpiresAtMs(record)\n if (record.leaseId !== params.leaseId || expiresAt === null) {\n return null\n }\n\n if (expiresAt <= now) {\n return null\n }\n\n const leaseExpiry = new Date(now + params.leaseMs)\n record.leaseExpiresAt = leaseExpiry.toISOString()\n record.leaseExpiryMs = leaseExpiry.getTime()\n this.store.schedule(params.projectId, record, now)\n return toClaimedQueueJob(record)\n }\n\n /** Puts the job asked for in a claimed one's place, if any: its delivery is over. */\n private settleReplaced(projectId: string, record: QueueRecord<TQueueJob>): boolean {\n if (!record.replacement) return false\n\n this.store.add(projectId, this.queueId, record.replacement)\n return true\n }\n\n private requireActiveLease(params: {\n projectId: string\n jobId: string\n leaseId: string\n }): QueueRecord<TQueueJob> {\n assertNonEmpty(params.projectId, \"projectId\")\n assertNonEmpty(params.jobId, \"jobId\")\n assertNonEmpty(params.leaseId, \"leaseId\")\n\n const record = this.store.find<TQueueJob>(params.projectId, this.queueId, params.jobId)\n\n if (!record) {\n throw new QueueError(`[Sixb] Unknown queue job '${params.jobId}'`)\n }\n\n if (record.state !== \"queued\") {\n throw new QueueError(`[Sixb] Queue job '${params.jobId}' is no longer active`)\n }\n\n if (record.leaseId !== params.leaseId || !record.leaseExpiresAt) {\n throw new QueueError(`[Sixb] Lease mismatch for queue job '${params.jobId}'`)\n }\n\n const expiresAt = leaseExpiresAtMs(record)\n if (expiresAt === null || expiresAt <= Date.now()) {\n throw new QueueError(`[Sixb] Lease for queue job '${params.jobId}' has expired`)\n }\n\n return record\n }\n}\n\nexport class InMemoryQueues implements Queues {\n readonly scope = \"process\" as const\n private readonly store = new InMemoryQueueStore()\n\n readonly vectorIndexing = new InMemoryQueue<\n VectorIndexingQueueJob,\n \"internal.unexpected\" | \"runtime.cancelled\"\n >(this.store, \"vector.indexing\")\n readonly lake = new InMemoryQueue<LakeQueueJob, \"internal.unexpected\" | \"runtime.cancelled\">(\n this.store,\n \"lake\"\n )\n readonly renders = new InMemoryQueue<RenderQueueJob, \"internal.unexpected\" | \"runtime.cancelled\">(\n this.store,\n \"renders\"\n )\n readonly syncRuns = new InMemoryQueue<SyncRunRequestedQueueJob, SyncQueueJobFailureCode>(\n this.store,\n \"sync.runs\"\n )\n readonly pipelines = new InMemoryQueue<PipelineRunRequestedQueueJob, PipelineQueueJobFailureCode>(\n this.store,\n \"pipeline.runs\"\n )\n readonly projections = new InMemoryQueue<\n ProjectionRunRequestedQueueJob,\n ProjectionQueueJobFailureCode\n >(this.store, \"projection.runs\")\n readonly workflows = new InMemoryQueue<WorkflowQueueJob, WorkflowQueueJobFailureCode>(\n this.store,\n \"workflow.runs\"\n )\n readonly agents = new InMemoryQueue<AgentQueueJob, AgentQueueJobFailureCode>(\n this.store,\n \"agent.runs\"\n )\n\n /** Nothing to reach: the store is a field of this object. */\n health(): Promise<void> {\n return Promise.resolve()\n }\n}\n",
|
|
7
|
+
"/** Internal mutable priority index. Updating or removing an entry never leaves stale copies. */\nexport class IndexedHeap<T> {\n private readonly items: T[] = []\n private readonly positions = new Map<T, number>()\n\n constructor(private readonly compare: (left: T, right: T) => number) {}\n\n peek(): T | undefined {\n return this.items[0]\n }\n\n pop(): T | undefined {\n const first = this.peek()\n if (first !== undefined) this.delete(first)\n return first\n }\n\n set(item: T): void {\n const index = this.positions.get(item)\n if (index === undefined) {\n this.positions.set(item, this.items.length)\n this.items.push(item)\n this.up(this.items.length - 1)\n } else {\n this.down(this.up(index))\n }\n }\n\n delete(item: T): void {\n const index = this.positions.get(item)\n if (index === undefined) return\n const last = this.items.pop()!\n this.positions.delete(item)\n if (index === this.items.length) return\n this.items[index] = last\n this.positions.set(last, index)\n this.down(this.up(index))\n }\n\n private up(start: number): number {\n let index = start\n while (index > 0) {\n const parent = Math.floor((index - 1) / 2)\n if (this.compare(this.items[parent]!, this.items[index]!) <= 0) break\n this.swap(parent, index)\n index = parent\n }\n return index\n }\n\n private down(start: number): void {\n let index = start\n while (index * 2 + 1 < this.items.length) {\n const left = index * 2 + 1\n const right = left + 1\n const child =\n right < this.items.length && this.compare(this.items[right]!, this.items[left]!) < 0\n ? right\n : left\n if (this.compare(this.items[index]!, this.items[child]!) <= 0) break\n this.swap(index, child)\n index = child\n }\n }\n\n private swap(left: number, right: number): void {\n const a = this.items[left]!\n const b = this.items[right]!\n this.items[left] = b\n this.items[right] = a\n this.positions.set(a, right)\n this.positions.set(b, left)\n }\n}\n"
|
|
8
|
+
],
|
|
9
|
+
"mappings": ";;AAGO,MAAM,oBAAmB,MAAM;AAAA,EAC3B,OAAO;AAClB;;ACLA;;;ACCO,MAAM,YAAe;AAAA,EAIG;AAAA,EAHZ,QAAa,CAAC;AAAA,EACd,YAAY,IAAI;AAAA,EAEjC,WAAW,CAAkB,SAAwC;AAAA,IAAxC;AAAA;AAAA,EAE7B,IAAI,GAAkB;AAAA,IACpB,OAAO,KAAK,MAAM;AAAA;AAAA,EAGpB,GAAG,GAAkB;AAAA,IACnB,MAAM,QAAQ,KAAK,KAAK;AAAA,IACxB,IAAI,UAAU;AAAA,MAAW,KAAK,OAAO,KAAK;AAAA,IAC1C,OAAO;AAAA;AAAA,EAGT,GAAG,CAAC,MAAe;AAAA,IACjB,MAAM,QAAQ,KAAK,UAAU,IAAI,IAAI;AAAA,IACrC,IAAI,UAAU,WAAW;AAAA,MACvB,KAAK,UAAU,IAAI,MAAM,KAAK,MAAM,MAAM;AAAA,MAC1C,KAAK,MAAM,KAAK,IAAI;AAAA,MACpB,KAAK,GAAG,KAAK,MAAM,SAAS,CAAC;AAAA,IAC/B,EAAE,KAAK;AAAA,MACL,KAAK,KAAK,KAAK,GAAG,KAAK,CAAC;AAAA;AAAA;AAAA,EAI5B,MAAM,CAAC,MAAe;AAAA,IACpB,MAAM,QAAQ,KAAK,UAAU,IAAI,IAAI;AAAA,IACrC,IAAI,UAAU;AAAA,MAAW;AAAA,IACzB,MAAM,OAAO,KAAK,MAAM,IAAI;AAAA,IAC5B,KAAK,UAAU,OAAO,IAAI;AAAA,IAC1B,IA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AAA,IAC9E;AAAA,IAEA,MAAM,YAAY,iBAAiB,MAAM;AAAA,IACzC,IAAI,cAAc,QAAQ,aAAa,KAAK,IAAI,GAAG;AAAA,MACjD,MAAM,IAAI,YAAW,+BAA+B,OAAO,oBAAoB;AAAA,IACjF;AAAA,IAEA,OAAO;AAAA;AAEX;AAAA;AAEO,MAAM,gBAAiC;AAAA,EACnC,QAAQ;AAAA,EACA,QAAQ,IAAI;AAAA,EAEpB,iBAAiB,IAAI,cAG5B,KAAK,OAAO,iBAAiB;AAAA,EACtB,OAAO,IAAI,cAClB,KAAK,OACL,MACF;AAAA,EACS,UAAU,IAAI,cACrB,KAAK,OACL,SACF;AAAA,EACS,WAAW,IAAI,cACtB,KAAK,OACL,WACF;AAAA,EACS,YAAY,IAAI,cACvB,KAAK,OACL,eACF;AAAA,EACS,cAAc,IAAI,cAGzB,KAAK,OAAO,iBAAiB;AAAA,EACtB,YAAY,IAAI,cACvB,KAAK,OACL,eACF;AAAA,EACS,SAAS,IAAI,cACpB,KAAK,OACL,YACF;AAAA,EAGA,MAAM,GAAkB;AAAA,IACtB,OAAO,QAAQ,QAAQ;AAAA;AAE3B;",
|
|
10
|
+
"debugId": "7BACC1C0F63002AE64756E2164756E21",
|
|
11
|
+
"names": []
|
|
12
|
+
}
|
|
@@ -5,25 +5,25 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
resolveExecutionScopeAuthorization,
|
|
7
7
|
assertAuthorized2
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-paxabbqd.js";
|
|
9
9
|
import {
|
|
10
10
|
reportRunFailure2
|
|
11
11
|
} from "./chunk-czct88ht.js";
|
|
12
12
|
import {
|
|
13
13
|
SYNC_RUN_FAILURE_CODES2
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-gjhrz66x.js";
|
|
15
15
|
import {
|
|
16
16
|
SyncRunError2
|
|
17
17
|
} from "./chunk-jmfet9r4.js";
|
|
18
18
|
import {
|
|
19
19
|
dispatchQueuedRun,
|
|
20
20
|
hasAutomaticRunProvenance
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-y8fwm3z2.js";
|
|
22
22
|
import {
|
|
23
23
|
executionRecordInputFromRuntime,
|
|
24
24
|
ensureExecutionRecord2,
|
|
25
25
|
createPrimitiveExecutionRecord
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-pc7kra3k.js";
|
|
27
27
|
|
|
28
28
|
// src/syncs/errors.ts
|
|
29
29
|
class SyncValidationError2 extends Error {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/models/language-model.ts", "../src/models/definitions.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import type { JsonObject, ReadonlyJsonObject } from \"../json\"\nimport type { LanguageModelDefinitionCatalog, ModelDefinitionCatalog } from \"./catalog\"\nimport type { LanguageModelDefinition } from \"./definitions\"\nimport type { LanguageModelStreamEvent } from \"./events\"\nimport type { ModelMessage } from \"./messages\"\nimport type { ModelCostEstimator } from \"./pricing\"\nimport type { ModelRateCard } from \"./rate-card\"\nimport type { WebSearchModel } from \"./web-search-model\"\n\nexport const MODEL_REASONING_EFFORTS = [\"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"] as const\n\nexport type ModelReasoningEffort = (typeof MODEL_REASONING_EFFORTS)[number]\n\nexport const MODEL_REASONING_LEVELS = [\n \"provider-default\",\n \"none\",\n ...MODEL_REASONING_EFFORTS,\n] as const\n\nexport type ModelReasoningLevel = (typeof MODEL_REASONING_LEVELS)[number]\n\n/** Exact provider-native reasoning budget, expressed in tokens. */\nexport interface ModelReasoningBudget extends ReadonlyJsonObject {\n readonly budgetTokens: number\n}\n\n/** Provider-neutral reasoning preference accepted by every language-model runtime. */\nexport type ModelReasoning = ModelReasoningLevel | ModelReasoningBudget\n\nexport interface ModelReasoningBudgetCapabilities {\n readonly min?: number\n readonly max?: number\n}\n\n/** Controls exposed by one concrete model offering through one provider. */\nexport interface ModelReasoningCapabilities {\n readonly canDisable?: boolean\n readonly efforts?: readonly ModelReasoningEffort[]\n readonly budgetTokens?: ModelReasoningBudgetCapabilities\n}\n\nexport interface ModelCapabilities {\n readonly inputMediaTypes?: readonly string[] | \"any\"\n /** `undefined` is unknown, `false` is unsupported, and an object describes supported controls. */\n readonly reasoning?: false | ModelReasoningCapabilities\n readonly localTools?: boolean\n readonly parallelToolCalls?: boolean\n /** `undefined` is unknown, not an assertion that schema-constrained output is unsupported. */\n readonly nativeStructuredOutput?: boolean\n readonly providerExecutedTools?: boolean\n}\n\nexport interface ModelToolSpecification {\n readonly name: string\n readonly description: string\n readonly inputSchema: JsonObject\n}\n\nexport interface ModelResponseFormat {\n readonly type: \"json\"\n readonly name: string\n readonly description?: string\n readonly schema: JsonObject\n}\n\nexport interface LanguageModelRequest {\n readonly callId: string\n readonly messages: readonly ModelMessage[]\n readonly tools: readonly ModelToolSpecification[]\n readonly reasoning?: ModelReasoning\n /** Per-call output ceiling; providers must not exceed a stricter configured model limit. */\n readonly maxOutputTokens?: number\n /**\n * How the provider caches the request's prompt, never over explicit provider configuration.\n * Absent, it caches what it expects to be read again.\n */\n readonly caching?: ModelCaching\n readonly responseFormat?: ModelResponseFormat\n readonly signal: AbortSignal\n}\n\n/**\n * `\"off\"` caches nothing and `\"auto\"` caches the request even when it is read once. An intent\n * caches what an absent choice would, and says how the prompt is read again: each provider\n * translates it, or ignores what it has no equivalent for.\n */\nexport type ModelCaching = \"auto\" | \"off\" | ModelCachingIntent\n\nexport interface ModelCachingIntent {\n /**\n * `\"long\"`: the prompt is read again after a human pause, as by a conversation's next turn, so\n * its cache should outlive the provider's default lifetime. `\"default\"` keeps that lifetime.\n */\n readonly lifetime?: \"default\" | \"long\"\n /**\n * An opaque id the requests that share a prompt prefix share, such as one conversation's, for a\n * provider that routes them to where that prefix is cached. Never personal data.\n */\n readonly key?: string\n}\n\n/**\n * How long a prompt stays cached after the last call that read it, by its intent's lifetime: the\n * hour providers keep a `\"long\"` one for, else the five minutes Anthropic keeps by default, the\n * shortest of theirs.\n */\nexport function modelCacheLifetimeMs(lifetime: ModelCachingIntent[\"lifetime\"]): number {\n return lifetime === \"long\" ? 60 * 60_000 : 5 * 60_000\n}\n\nexport interface LanguageModelStream {\n readonly events: AsyncIterable<LanguageModelStreamEvent>\n}\n\nexport interface LanguageModel {\n readonly providerId: string\n readonly modelId: string\n readonly definition: LanguageModelDefinition\n readonly costEstimator?: ModelCostEstimator\n /**\n * The prices this binding bills by, for people and agents choosing a model. Pricing itself\n * goes through costEstimator; absent when the price is unknown.\n */\n readonly rateCard?: ModelRateCard\n /**\n * Reasoning Sixb applies whenever this model runs without an explicit choice: chat turns, AI\n * workflow steps, subagents, and direct generation. Providers set it from their model options;\n * Sixb checks it against `definition.capabilities` at startup.\n */\n readonly defaultReasoning?: ModelReasoningLevel\n /**\n * Output limit the binding sets for every call, agent calls included. Unlike\n * `definition.maxOutputTokens`, the most the model itself can produce, this is the developer's\n * choice. Providers set it from their model options; Sixb checks it against that maximum at\n * startup.\n */\n readonly maxOutputTokens?: number\n /**\n * The web search its provider offers, under the same credentials. Sixb searches with it when\n * `models.webSearch` names none.\n */\n readonly webSearch?: WebSearchModel\n /**\n * The names of the tools its provider runs itself, which every request declares, such as\n * `web_search` from `providerTools`. Sixb checks at startup that none takes a name it gives the\n * Agent's own tools.\n */\n readonly providerToolNames?: readonly string[]\n /**\n * Return an executable model pinned to operational metadata, preserving model identity.\n * `offline` requires a local snapshot without catalog I/O. Workers retain this model\n * for generation and compaction; later catalog refreshes must not change its capabilities/limits.\n * Throw ModelCatalogUnavailableError for catalog transport/access failures to allow workers to\n * retry with an offline snapshot. Invalid definitions and other resolver errors remain fatal.\n */\n resolve?(options?: { readonly offline?: boolean }): Promise<LanguageModel>\n /** Validate known output constraints without inference. Success does not certify endpoint support. */\n validateResponseFormat?(format: ModelResponseFormat): void | Promise<void>\n stream(request: LanguageModelRequest): Promise<LanguageModelStream>\n}\n\n/** The common callable provider shape. Provider packages may accept additional model options. */\nexport interface ModelProvider<TCatalog extends ModelDefinitionCatalog = ModelDefinitionCatalog> {\n readonly providerId: string\n readonly catalog: TCatalog\n}\n\nexport interface LanguageModelProvider extends ModelProvider<LanguageModelDefinitionCatalog> {\n (modelId: string): LanguageModel\n}\n\nexport function isModelReasoning(value: unknown): value is ModelReasoning {\n if (typeof value === \"string\") {\n return (MODEL_REASONING_LEVELS as readonly string[]).includes(value)\n }\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return false\n if (Object.keys(value).length !== 1) return false\n const budgetTokens = (value as { readonly budgetTokens?: unknown }).budgetTokens\n return typeof budgetTokens === \"number\" && Number.isSafeInteger(budgetTokens) && budgetTokens >= 0\n}\n\n/** Explain why a request cannot be represented by known model capabilities. Unknown is allowed. */\nexport function modelReasoningSupportIssue(\n capabilities: ModelCapabilities[\"reasoning\"],\n reasoning: unknown\n): string | undefined {\n if (reasoning === undefined) return undefined\n if (!isModelReasoning(reasoning)) return \"the reasoning preference is invalid\"\n if (reasoning === \"provider-default\") return undefined\n if (capabilities === undefined) return undefined\n if (capabilities === false) return \"reasoning is not supported\"\n if (reasoning === \"none\") {\n return capabilities.canDisable === true ? undefined : \"reasoning cannot be disabled\"\n }\n if (typeof reasoning === \"string\") {\n return capabilities.efforts?.includes(reasoning) === true\n ? undefined\n : `reasoning effort '${reasoning}' is not supported`\n }\n const budget = capabilities.budgetTokens\n if (budget === undefined) return \"reasoning token budgets are not supported\"\n if (budget.min !== undefined && reasoning.budgetTokens < budget.min) {\n return `reasoning token budget must be at least ${budget.min}`\n }\n if (budget.max !== undefined && reasoning.budgetTokens > budget.max) {\n return `reasoning token budget must not exceed ${budget.max}`\n }\n return undefined\n}\n",
|
|
5
|
+
"import type { JsonObject, ReadonlyJsonObject } from \"../json\"\nimport type { LanguageModelDefinitionCatalog, ModelDefinitionCatalog } from \"./catalog\"\nimport type { LanguageModelDefinition } from \"./definitions\"\nimport type { LanguageModelStreamEvent } from \"./events\"\nimport type { ModelMessage } from \"./messages\"\nimport type { ModelCostEstimator } from \"./pricing\"\nimport type { ModelRateCard } from \"./rate-card\"\nimport type { WebSearchModel } from \"./web-search-model\"\n\nexport const MODEL_REASONING_EFFORTS = [\"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"] as const\n\nexport type ModelReasoningEffort = (typeof MODEL_REASONING_EFFORTS)[number]\n\nexport const MODEL_REASONING_LEVELS = [\n \"provider-default\",\n \"none\",\n ...MODEL_REASONING_EFFORTS,\n] as const\n\nexport type ModelReasoningLevel = (typeof MODEL_REASONING_LEVELS)[number]\n\n/** Exact provider-native reasoning budget, expressed in tokens. */\nexport interface ModelReasoningBudget extends ReadonlyJsonObject {\n readonly budgetTokens: number\n}\n\n/** Provider-neutral reasoning preference accepted by every language-model runtime. */\nexport type ModelReasoning = ModelReasoningLevel | ModelReasoningBudget\n\nexport interface ModelReasoningBudgetCapabilities {\n readonly min?: number\n readonly max?: number\n}\n\n/** Controls exposed by one concrete model offering through one provider. */\nexport interface ModelReasoningCapabilities {\n readonly canDisable?: boolean\n readonly efforts?: readonly ModelReasoningEffort[]\n readonly budgetTokens?: ModelReasoningBudgetCapabilities\n}\n\nexport interface ModelCapabilities {\n readonly inputMediaTypes?: readonly string[] | \"any\"\n /** `undefined` is unknown, `false` is unsupported, and an object describes supported controls. */\n readonly reasoning?: false | ModelReasoningCapabilities\n readonly localTools?: boolean\n readonly parallelToolCalls?: boolean\n /** `undefined` is unknown, not an assertion that schema-constrained output is unsupported. */\n readonly nativeStructuredOutput?: boolean\n readonly providerExecutedTools?: boolean\n}\n\nexport interface ModelToolSpecification {\n readonly name: string\n readonly description: string\n readonly inputSchema: JsonObject\n /**\n * Ask the provider to hold the model's arguments to `inputSchema`. A provider that cannot, for this\n * schema or within its request's limits, receives the tool unconstrained: `parseInput` still\n * validates every call.\n */\n readonly strict?: boolean\n}\n\nexport interface ModelResponseFormat {\n readonly type: \"json\"\n readonly name: string\n readonly description?: string\n readonly schema: JsonObject\n}\n\nexport interface LanguageModelRequest {\n readonly callId: string\n readonly messages: readonly ModelMessage[]\n readonly tools: readonly ModelToolSpecification[]\n readonly reasoning?: ModelReasoning\n /** Per-call output ceiling; providers must not exceed a stricter configured model limit. */\n readonly maxOutputTokens?: number\n /**\n * How the provider caches the request's prompt, never over explicit provider configuration.\n * Absent, it caches what it expects to be read again.\n */\n readonly caching?: ModelCaching\n readonly responseFormat?: ModelResponseFormat\n readonly signal: AbortSignal\n}\n\n/**\n * `\"off\"` caches nothing and `\"auto\"` caches the request even when it is read once. An intent\n * caches what an absent choice would, and says how the prompt is read again: each provider\n * translates it, or ignores what it has no equivalent for.\n */\nexport type ModelCaching = \"auto\" | \"off\" | ModelCachingIntent\n\nexport interface ModelCachingIntent {\n /**\n * `\"long\"`: the prompt is read again after a human pause, as by a conversation's next turn, so\n * its cache should outlive the provider's default lifetime. `\"default\"` keeps that lifetime.\n */\n readonly lifetime?: \"default\" | \"long\"\n /**\n * An opaque id the requests that share a prompt prefix share, such as one conversation's, for a\n * provider that routes them to where that prefix is cached. Never personal data.\n */\n readonly key?: string\n}\n\n/**\n * How long a prompt stays cached after the last call that read it, by its intent's lifetime: the\n * hour providers keep a `\"long\"` one for, else the five minutes Anthropic keeps by default, the\n * shortest of theirs.\n */\nexport function modelCacheLifetimeMs(lifetime: ModelCachingIntent[\"lifetime\"]): number {\n return lifetime === \"long\" ? 60 * 60_000 : 5 * 60_000\n}\n\nexport interface LanguageModelStream {\n readonly events: AsyncIterable<LanguageModelStreamEvent>\n}\n\nexport interface LanguageModel {\n readonly providerId: string\n readonly modelId: string\n readonly definition: LanguageModelDefinition\n readonly costEstimator?: ModelCostEstimator\n /**\n * The prices this binding bills by, for people and agents choosing a model. Pricing itself\n * goes through costEstimator; absent when the price is unknown.\n */\n readonly rateCard?: ModelRateCard\n /**\n * Reasoning Sixb applies whenever this model runs without an explicit choice: chat turns, AI\n * workflow steps, subagents, and direct generation. Providers set it from their model options;\n * Sixb checks it against `definition.capabilities` at startup.\n */\n readonly defaultReasoning?: ModelReasoningLevel\n /**\n * Output limit the binding sets for every call, agent calls included. Unlike\n * `definition.maxOutputTokens`, the most the model itself can produce, this is the developer's\n * choice. Providers set it from their model options; Sixb checks it against that maximum at\n * startup.\n */\n readonly maxOutputTokens?: number\n /**\n * The web search its provider offers, under the same credentials. Sixb searches with it when\n * `models.webSearch` names none.\n */\n readonly webSearch?: WebSearchModel\n /**\n * The names of the tools its provider runs itself, which every request declares, such as\n * `web_search` from `providerTools`. Sixb checks at startup that none takes a name it gives the\n * Agent's own tools.\n */\n readonly providerToolNames?: readonly string[]\n /**\n * Return an executable model pinned to operational metadata, preserving model identity.\n * `offline` requires a local snapshot without catalog I/O. Workers retain this model\n * for generation and compaction; later catalog refreshes must not change its capabilities/limits.\n * Throw ModelCatalogUnavailableError for catalog transport/access failures to allow workers to\n * retry with an offline snapshot. Invalid definitions and other resolver errors remain fatal.\n */\n resolve?(options?: { readonly offline?: boolean }): Promise<LanguageModel>\n /** Validate known output constraints without inference. Success does not certify endpoint support. */\n validateResponseFormat?(format: ModelResponseFormat): void | Promise<void>\n stream(request: LanguageModelRequest): Promise<LanguageModelStream>\n}\n\n/** The common callable provider shape. Provider packages may accept additional model options. */\nexport interface ModelProvider<TCatalog extends ModelDefinitionCatalog = ModelDefinitionCatalog> {\n readonly providerId: string\n readonly catalog: TCatalog\n}\n\nexport interface LanguageModelProvider extends ModelProvider<LanguageModelDefinitionCatalog> {\n (modelId: string): LanguageModel\n}\n\nexport function isModelReasoning(value: unknown): value is ModelReasoning {\n if (typeof value === \"string\") {\n return (MODEL_REASONING_LEVELS as readonly string[]).includes(value)\n }\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return false\n if (Object.keys(value).length !== 1) return false\n const budgetTokens = (value as { readonly budgetTokens?: unknown }).budgetTokens\n return typeof budgetTokens === \"number\" && Number.isSafeInteger(budgetTokens) && budgetTokens >= 0\n}\n\n/** Explain why a request cannot be represented by known model capabilities. Unknown is allowed. */\nexport function modelReasoningSupportIssue(\n capabilities: ModelCapabilities[\"reasoning\"],\n reasoning: unknown\n): string | undefined {\n if (reasoning === undefined) return undefined\n if (!isModelReasoning(reasoning)) return \"the reasoning preference is invalid\"\n if (reasoning === \"provider-default\") return undefined\n if (capabilities === undefined) return undefined\n if (capabilities === false) return \"reasoning is not supported\"\n if (reasoning === \"none\") {\n return capabilities.canDisable === true ? undefined : \"reasoning cannot be disabled\"\n }\n if (typeof reasoning === \"string\") {\n return capabilities.efforts?.includes(reasoning) === true\n ? undefined\n : `reasoning effort '${reasoning}' is not supported`\n }\n const budget = capabilities.budgetTokens\n if (budget === undefined) return \"reasoning token budgets are not supported\"\n if (budget.min !== undefined && reasoning.budgetTokens < budget.min) {\n return `reasoning token budget must be at least ${budget.min}`\n }\n if (budget.max !== undefined && reasoning.budgetTokens > budget.max) {\n return `reasoning token budget must not exceed ${budget.max}`\n }\n return undefined\n}\n",
|
|
6
6
|
"import {\n MODEL_REASONING_EFFORTS,\n type ModelCapabilities,\n type ModelReasoningBudgetCapabilities,\n type ModelReasoningCapabilities,\n} from \"./language-model\"\n\n/** @internal Every model kind, for validating stored values. */\nexport const MODEL_KINDS = [\n \"language\",\n \"image\",\n \"video\",\n \"embedding\",\n \"decision\",\n \"transcription\",\n \"speech\",\n \"reranking\",\n \"web-search\",\n] as const\n\nexport type ModelKind = (typeof MODEL_KINDS)[number]\n\n/**\n * @internal Kinds billed per audio second, search, image or character, whose providers mostly\n * report no tokens. Token limits skip them, and a missing token count from one is not a gap.\n */\nexport const TOKENLESS_MODEL_KINDS: readonly ModelKind[] = [\n \"transcription\",\n \"reranking\",\n \"web-search\",\n \"image\",\n \"speech\",\n]\n\n/** Common catalog identity shared by every present and future model runtime. */\nexport interface ModelDefinition {\n readonly kind: ModelKind\n readonly providerId: string\n readonly modelId: string\n readonly name?: string\n readonly description?: string\n /** Model author for display; does not change the provider/model routing identity. */\n readonly publisher?: { readonly id: string; readonly name: string }\n /** Hosting service label, when the model is offered through an intermediary. */\n readonly via?: string\n readonly family?: string\n readonly tags?: readonly string[]\n readonly releaseDate?: string\n}\n\n/** Serializable facts about one concrete model offering from one provider. */\nexport interface LanguageModelDefinition extends ModelDefinition {\n readonly kind: \"language\"\n readonly knowledgeCutoff?: string\n readonly contextWindow?: number\n /** Maximum input tokens, distinct from a shared input/output context window. */\n readonly maxInputTokens?: number\n readonly maxOutputTokens?: number\n readonly capabilities: ModelCapabilities\n}\n\n/** The name and description a project gives a language model, in place of the provider's. */\nexport interface LanguageModelLabel {\n /** Shown in the chat's model picker and to the Agent. */\n readonly name?: string\n /** When the model is useful, for the people choosing it and for the Agent delegating to it. */\n readonly description?: string\n}\n\n/**\n * The label a model binding sets, checked and reported with the provider's error prefix. A provider\n * spreads it over every definition it builds for the binding, its resolved ones included.\n *\n * Stricter than `defineLanguageModel`, which takes a provider's catalog text as it comes: the\n * project types a label by hand, so an empty or padded value is a mistake to report.\n */\nexport function defineLanguageModelLabel(\n label: LanguageModelLabel,\n prefix: string\n): LanguageModelLabel {\n for (const field of [\"name\", \"description\"] as const) {\n const value: unknown = label[field]\n\n if (value !== undefined && (typeof value !== \"string\" || !value || value !== value.trim())) {\n throw new TypeError(`${prefix} ${field} must be a nonempty trimmed string.`)\n }\n }\n\n return {\n ...(label.name === undefined ? {} : { name: label.name }),\n ...(label.description === undefined ? {} : { description: label.description }),\n }\n}\n\nexport function defineLanguageModel(definition: LanguageModelDefinition): LanguageModelDefinition {\n if (definition.kind !== \"language\") {\n throw new TypeError(\"[Sixb] Language model definitions must use kind 'language'.\")\n }\n assertModelId(definition.providerId, \"providerId\")\n assertModelId(definition.modelId, \"modelId\")\n assertOptionalString(definition.name, \"name\")\n assertOptionalString(definition.description, \"description\")\n assertOptionalString(definition.via, \"via\")\n if (definition.via !== undefined && !definition.via.trim())\n throw new TypeError(\"[Sixb] Model via must not be empty.\")\n const publisher = definition.publisher\n if (publisher !== undefined) {\n assertRecord(publisher, \"publisher\")\n for (const [field, value] of Object.entries({ id: publisher.id, name: publisher.name })) {\n if (typeof value !== \"string\" || !value.trim() || value !== value.trim())\n throw new TypeError(`[Sixb] Model publisher.${field} must be a nonempty trimmed string.`)\n }\n }\n assertOptionalString(definition.family, \"family\")\n assertOptionalString(definition.releaseDate, \"releaseDate\")\n assertOptionalString(definition.knowledgeCutoff, \"knowledgeCutoff\")\n const tags = freezeStrings(definition.tags, \"tags\")\n const capabilities = defineModelCapabilities(definition.capabilities)\n assertOptionalPositiveInteger(definition.contextWindow, \"contextWindow\")\n assertOptionalPositiveInteger(definition.maxInputTokens, \"maxInputTokens\")\n assertOptionalPositiveInteger(definition.maxOutputTokens, \"maxOutputTokens\")\n return Object.freeze({\n kind: \"language\",\n providerId: definition.providerId,\n modelId: definition.modelId,\n ...(definition.name === undefined ? {} : { name: definition.name }),\n ...(definition.description === undefined ? {} : { description: definition.description }),\n ...(publisher === undefined\n ? {}\n : { publisher: Object.freeze({ id: publisher.id, name: publisher.name }) }),\n ...(definition.via === undefined ? {} : { via: definition.via }),\n ...(definition.family === undefined ? {} : { family: definition.family }),\n ...(tags === undefined ? {} : { tags }),\n ...(definition.releaseDate === undefined ? {} : { releaseDate: definition.releaseDate }),\n ...(definition.knowledgeCutoff === undefined\n ? {}\n : { knowledgeCutoff: definition.knowledgeCutoff }),\n ...(definition.contextWindow === undefined ? {} : { contextWindow: definition.contextWindow }),\n ...(definition.maxInputTokens === undefined\n ? {}\n : { maxInputTokens: definition.maxInputTokens }),\n ...(definition.maxOutputTokens === undefined\n ? {}\n : { maxOutputTokens: definition.maxOutputTokens }),\n capabilities,\n })\n}\n\nfunction defineModelCapabilities(capabilities: unknown): ModelCapabilities {\n assertRecord(capabilities, \"capabilities\")\n const inputMediaTypes =\n capabilities.inputMediaTypes === \"any\"\n ? \"any\"\n : freezeStrings(capabilities.inputMediaTypes, \"capabilities.inputMediaTypes\")\n for (const [field, value] of Object.entries(capabilities)) {\n if (field === \"inputMediaTypes\" || field === \"reasoning\") continue\n if (value !== undefined && typeof value !== \"boolean\") {\n throw new TypeError(`[Sixb] Model capability '${field}' must be boolean.`)\n }\n }\n const reasoning = freezeReasoningCapabilities(capabilities.reasoning)\n const flags: {\n localTools?: boolean\n parallelToolCalls?: boolean\n nativeStructuredOutput?: boolean\n providerExecutedTools?: boolean\n } = {}\n for (const key of [\n \"localTools\",\n \"parallelToolCalls\",\n \"nativeStructuredOutput\",\n \"providerExecutedTools\",\n ] as const) {\n const value = capabilities[key]\n if (typeof value === \"boolean\") flags[key] = value\n }\n return Object.freeze({\n ...(inputMediaTypes === undefined ? {} : { inputMediaTypes }),\n ...(reasoning === undefined ? {} : { reasoning }),\n ...flags,\n })\n}\n\nfunction freezeReasoningCapabilities(reasoning: unknown): ModelCapabilities[\"reasoning\"] {\n if (reasoning === undefined || reasoning === false) return reasoning\n assertRecord(reasoning, \"reasoning\")\n if (reasoning.canDisable !== undefined && typeof reasoning.canDisable !== \"boolean\") {\n throw new TypeError(\"[Sixb] Model reasoning capability 'canDisable' must be boolean.\")\n }\n const efforts = freezeReasoningEfforts(reasoning.efforts)\n const budgetTokens = freezeReasoningBudgetCapabilities(reasoning.budgetTokens)\n return Object.freeze({\n ...(reasoning.canDisable === undefined ? {} : { canDisable: reasoning.canDisable }),\n ...(efforts === undefined ? {} : { efforts }),\n ...(budgetTokens === undefined ? {} : { budgetTokens }),\n } satisfies ModelReasoningCapabilities)\n}\n\nfunction freezeReasoningEfforts(\n efforts: unknown\n): readonly (typeof MODEL_REASONING_EFFORTS)[number][] | undefined {\n if (efforts === undefined) return undefined\n if (!Array.isArray(efforts)) {\n throw new TypeError(\"[Sixb] Model reasoning capability 'efforts' must be an array.\")\n }\n const seen = new Set<string>()\n return Object.freeze(\n efforts.map((value: unknown) => {\n const effort = MODEL_REASONING_EFFORTS.find((allowed) => allowed === value)\n if (effort === undefined) {\n throw new TypeError(`[Sixb] Model reasoning effort '${String(value)}' is invalid.`)\n }\n if (seen.has(effort)) {\n throw new TypeError(`[Sixb] Model reasoning effort '${effort}' is duplicated.`)\n }\n seen.add(effort)\n return effort\n })\n )\n}\n\nfunction freezeReasoningBudgetCapabilities(\n budget: unknown\n): ModelReasoningBudgetCapabilities | undefined {\n if (budget === undefined) return undefined\n assertRecord(budget, \"reasoning budgetTokens\")\n assertOptionalNonnegativeInteger(budget.min, \"capabilities.reasoning.budgetTokens.min\")\n assertOptionalNonnegativeInteger(budget.max, \"capabilities.reasoning.budgetTokens.max\")\n if (budget.min !== undefined && budget.max !== undefined && budget.max < budget.min) {\n throw new TypeError(\n \"[Sixb] Model reasoning token budget maximum must not be below its minimum.\"\n )\n }\n return Object.freeze({\n ...(budget.min === undefined ? {} : { min: budget.min }),\n ...(budget.max === undefined ? {} : { max: budget.max }),\n })\n}\n\nfunction assertModelId(value: string, field: string): void {\n if (!value.trim()) throw new TypeError(`[Sixb] Model ${field} must not be empty.`)\n}\n\nfunction assertOptionalPositiveInteger(value: number | undefined, field: string): void {\n if (value !== undefined && (!Number.isSafeInteger(value) || value <= 0)) {\n throw new TypeError(`[Sixb] Model ${field} must be a positive safe integer.`)\n }\n}\n\nfunction assertOptionalNonnegativeInteger(\n value: unknown,\n field: string\n): asserts value is number | undefined {\n if (\n value !== undefined &&\n (typeof value !== \"number\" || !Number.isSafeInteger(value) || value < 0)\n ) {\n throw new TypeError(`[Sixb] Model ${field} must be a nonnegative safe integer.`)\n }\n}\n\nfunction assertOptionalString(value: string | undefined, field: string): void {\n if (value !== undefined && typeof value !== \"string\") {\n throw new TypeError(`[Sixb] Model ${field} must be a string.`)\n }\n}\n\nfunction freezeStrings(value: unknown, field: string): readonly string[] | undefined {\n if (value === undefined) return undefined\n if (!Array.isArray(value) || value.some((entry) => typeof entry !== \"string\" || !entry.trim())) {\n throw new TypeError(`[Sixb] Model ${field} must contain nonempty strings.`)\n }\n return Object.freeze([...value])\n}\n\nfunction assertRecord(value: unknown, field: string): asserts value is Record<string, unknown> {\n if (value === null || typeof value !== \"object\" ||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A,EACnF,IAAI,UAAU;AAAA,IAAW;AAAA,EACzB,IAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,MAAM,KAAK,CAAC,UAAU,OAAO,UAAU,YAAY,CAAC,MAAM,KAAK,CAAC,GAAG;AAAA,IAC9F,MAAM,IAAI,UAAU,gBAAgB,sCAAsC;AAAA,EAC5E;AAAA,EACA,OAAO,OAAO,OAAO,CAAC,GAAG,KAAK,CAAC;AAAA;AAGjC,SAAS,YAAY,CAAC,OAAgB,OAAyD;AAAA,EAC7F,IAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK;AAAA,IACpE,MAAM,IAAI,UAAU,gBAAgB,0BAA0B;AAAA;",
|
|
9
9
|
"debugId": "9A04D72023BBCD7064756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -50,29 +50,29 @@ import {
|
|
|
50
50
|
vectorConfiguration,
|
|
51
51
|
vectorSources,
|
|
52
52
|
normalizeVector2
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-xcrnrpfh.js";
|
|
54
54
|
import {
|
|
55
55
|
resolveExecutionScopeAuthorization,
|
|
56
56
|
ProjectionValidationError2,
|
|
57
57
|
validateProjectionsAtStartup,
|
|
58
58
|
isProjectionDefinition2
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-paxabbqd.js";
|
|
60
60
|
import {
|
|
61
61
|
isStorageSerializationFailure2
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-ewqn51gr.js";
|
|
63
63
|
import {
|
|
64
64
|
objectBatchKey2
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-gjhrz66x.js";
|
|
66
66
|
import {
|
|
67
67
|
materializationApplyPhase2
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-61zptves.js";
|
|
69
69
|
import {
|
|
70
70
|
parseDatasetTimestamp2
|
|
71
71
|
} from "./chunk-z667z3sg.js";
|
|
72
72
|
import {
|
|
73
73
|
executionRecordInputFromRuntime,
|
|
74
74
|
ensureExecutionRecord2
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-pc7kra3k.js";
|
|
76
76
|
import {
|
|
77
77
|
assertPinnedDatasetWatermark2
|
|
78
78
|
} from "./chunk-n8q5j6y5.js";
|
|
@@ -237,7 +237,8 @@ function normalizeProjectionDefinition(projection) {
|
|
|
237
237
|
targetObjectTypeId: link.targetObjectTypeId
|
|
238
238
|
}
|
|
239
239
|
])),
|
|
240
|
-
conflictResolution: projection.conflictResolution ?? { strategy: "editsWin" }
|
|
240
|
+
conflictResolution: projection.conflictResolution ?? { strategy: "editsWin" },
|
|
241
|
+
...projection.missing ? { missing: projection.missing } : {}
|
|
241
242
|
};
|
|
242
243
|
}
|
|
243
244
|
if (projection._tag === "LinkProjectionDefinition") {
|
|
@@ -519,7 +520,8 @@ function cloneObjectProjectionDefinition(projection) {
|
|
|
519
520
|
conflictResolution: projection.conflictResolution?.strategy === "mostRecent" ? {
|
|
520
521
|
strategy: "mostRecent",
|
|
521
522
|
sourceTimestamp: projection.conflictResolution.sourceTimestamp
|
|
522
|
-
} : { strategy: "editsWin" }
|
|
523
|
+
} : { strategy: "editsWin" },
|
|
524
|
+
...projection.missing ? { missing: projection.missing } : {}
|
|
523
525
|
};
|
|
524
526
|
}
|
|
525
527
|
function cloneLinkProjectionDefinition(projection) {
|
|
@@ -1179,6 +1181,9 @@ function normalizePinnedDatasetVersion(version) {
|
|
|
1179
1181
|
createdAt: normalizeTimestamp(version.createdAt, "Dataset version createdAt")
|
|
1180
1182
|
});
|
|
1181
1183
|
}
|
|
1184
|
+
function normalizeSourceReadAt(value) {
|
|
1185
|
+
return normalizeTimestamp(value, "Projection source read time");
|
|
1186
|
+
}
|
|
1182
1187
|
function normalizeProjectionRunId(runId) {
|
|
1183
1188
|
return normalizeNonblank(runId, "Projection run id");
|
|
1184
1189
|
}
|
|
@@ -3842,7 +3847,9 @@ async function stagePlanned(context, plans, plan, planned) {
|
|
|
3842
3847
|
}
|
|
3843
3848
|
}
|
|
3844
3849
|
function planReplacementObject(context, input, state) {
|
|
3845
|
-
const
|
|
3850
|
+
const withdrawn = withdrawnCreate(input, state);
|
|
3851
|
+
const override = withdrawn ? withdrawn.value : state.override?.value ?? null;
|
|
3852
|
+
const resolved = resolveReplacementObject(context, state, override);
|
|
3846
3853
|
if (resolved)
|
|
3847
3854
|
validateEffectiveObject(context.ontology, resolved.ref, resolved.properties);
|
|
3848
3855
|
const change = diffEffectiveObject({
|
|
@@ -3864,6 +3871,9 @@ function planReplacementObject(context, input, state) {
|
|
|
3864
3871
|
if (Boolean(state.effective) !== Boolean(resolved)) {
|
|
3865
3872
|
work.push({ kind: "incident-object", recordKey: `incident:${sortKey}`, ref: state.ref });
|
|
3866
3873
|
}
|
|
3874
|
+
if (withdrawn) {
|
|
3875
|
+
work.push(planWork({ kind: "object-override-upsert", value: withdrawn }, sortKey));
|
|
3876
|
+
}
|
|
3867
3877
|
if (!change)
|
|
3868
3878
|
return work;
|
|
3869
3879
|
appendObjectChangeWork(context, work, sortKey, change);
|
|
@@ -3950,12 +3960,28 @@ function appendLinkChangeWork(work, sortKey, change) {
|
|
|
3950
3960
|
work.push(planWork(item, sortKey));
|
|
3951
3961
|
work.push(eventWork(buildLinkMaterializationEventDraft(change)));
|
|
3952
3962
|
}
|
|
3953
|
-
function
|
|
3963
|
+
function withdrawnCreate(input, state) {
|
|
3964
|
+
const { withdrawCreatesBefore } = input;
|
|
3965
|
+
const override = state.override;
|
|
3966
|
+
if (!withdrawCreatesBefore || state.candidateSource)
|
|
3967
|
+
return null;
|
|
3968
|
+
if (override?.value.kind !== "create" || override.updatedAt >= withdrawCreatesBefore)
|
|
3969
|
+
return null;
|
|
3970
|
+
return {
|
|
3971
|
+
ref: state.ref,
|
|
3972
|
+
value: { kind: "patch", set: override.value.properties, unset: [] },
|
|
3973
|
+
editedAt: storedObjectEditedAt(override),
|
|
3974
|
+
expectedLastCommitId: override.lastCommitId,
|
|
3975
|
+
lastCommitId: input.commit.id,
|
|
3976
|
+
updatedAt: input.commit.committedAt
|
|
3977
|
+
};
|
|
3978
|
+
}
|
|
3979
|
+
function resolveReplacementObject(context, state, override) {
|
|
3954
3980
|
return resolveEffectiveObject({
|
|
3955
3981
|
ref: state.ref,
|
|
3956
3982
|
primaryPropertyId: context.ontology.getPrimaryPropertyId(state.ref.objectTypeId),
|
|
3957
3983
|
source: state.candidateSource,
|
|
3958
|
-
override
|
|
3984
|
+
override,
|
|
3959
3985
|
editedAt: storedObjectEditedAt(state.override),
|
|
3960
3986
|
latestTelemetry: state.latestTelemetry
|
|
3961
3987
|
});
|
|
@@ -4056,12 +4082,14 @@ function prepareProjectionReplacement(context, raw) {
|
|
|
4056
4082
|
idempotencyKey: createProjectionIdempotencyKey2(runIdentity),
|
|
4057
4083
|
normalizedCallerIntent: { source, datasetVersion }
|
|
4058
4084
|
});
|
|
4085
|
+
const withdrawCreatesBefore = missingRemovalReadAt(resolved, raw.input.sourceReadAt);
|
|
4059
4086
|
const command = {
|
|
4060
4087
|
source,
|
|
4061
4088
|
datasetVersion,
|
|
4062
4089
|
execution,
|
|
4063
4090
|
entries: raw.input.entries,
|
|
4064
4091
|
...raw.input.base ? { base: Object.freeze({ ...raw.input.base }) } : {},
|
|
4092
|
+
...withdrawCreatesBefore ? { withdrawCreatesBefore } : {},
|
|
4065
4093
|
resolved,
|
|
4066
4094
|
projectionKind,
|
|
4067
4095
|
runIdentity,
|
|
@@ -4072,6 +4100,15 @@ function prepareProjectionReplacement(context, raw) {
|
|
|
4072
4100
|
return command;
|
|
4073
4101
|
return { ...command, signal: raw.input.signal };
|
|
4074
4102
|
}
|
|
4103
|
+
function missingRemovalReadAt(resolved, sourceReadAt) {
|
|
4104
|
+
if (sourceReadAt === undefined)
|
|
4105
|
+
return;
|
|
4106
|
+
if (resolved.definition._tag !== "ObjectProjectionDefinition")
|
|
4107
|
+
return;
|
|
4108
|
+
if (resolved.definition.missing !== "remove")
|
|
4109
|
+
return;
|
|
4110
|
+
return normalizeSourceReadAt(sourceReadAt);
|
|
4111
|
+
}
|
|
4075
4112
|
function validateProjectionDataset(resolved, datasetVersion) {
|
|
4076
4113
|
if (datasetVersion.datasetId === resolved.datasetId)
|
|
4077
4114
|
return;
|
|
@@ -4202,7 +4239,8 @@ async function commitProjectionCandidate(context, command, ready) {
|
|
|
4202
4239
|
};
|
|
4203
4240
|
const { committedAt } = await plans.open({
|
|
4204
4241
|
...plan,
|
|
4205
|
-
commit: projectionCommit(context.projectId, command, ready.identity)
|
|
4242
|
+
commit: projectionCommit(context.projectId, command, ready.identity),
|
|
4243
|
+
...createdObjectsToPlan(command)
|
|
4206
4244
|
});
|
|
4207
4245
|
const commit = projectionCommit(context.projectId, command, { ...ready.identity, committedAt });
|
|
4208
4246
|
for (let round = 1;; round += 1) {
|
|
@@ -4301,8 +4339,18 @@ function projectionCommit(projectId, command, identity) {
|
|
|
4301
4339
|
committedAt: identity.committedAt
|
|
4302
4340
|
};
|
|
4303
4341
|
}
|
|
4342
|
+
function createdObjectsToPlan(command) {
|
|
4343
|
+
const { definition } = command.resolved;
|
|
4344
|
+
if (!command.withdrawCreatesBefore || definition._tag !== "ObjectProjectionDefinition")
|
|
4345
|
+
return {};
|
|
4346
|
+
return { createdObjects: { objectTypeId: definition.objectTypeId } };
|
|
4347
|
+
}
|
|
4304
4348
|
function planInput(command, commit) {
|
|
4305
|
-
const input = {
|
|
4349
|
+
const input = {
|
|
4350
|
+
projectionKind: command.projectionKind,
|
|
4351
|
+
commit,
|
|
4352
|
+
...command.withdrawCreatesBefore ? { withdrawCreatesBefore: command.withdrawCreatesBefore } : {}
|
|
4353
|
+
};
|
|
4306
4354
|
return command.signal === undefined ? input : { ...input, signal: command.signal };
|
|
4307
4355
|
}
|
|
4308
4356
|
function projectionActivation(command, ready, commit) {
|
|
@@ -4858,4 +4906,4 @@ function createOntologyMaterializer2(input) {
|
|
|
4858
4906
|
}
|
|
4859
4907
|
export { computeOntologyRevision2, computeProjectionRevision2, computeProjectionOwnershipHash2, ProjectionRegistry2, createActionIdempotencyKey2, createRuntimeIdempotencyKey2, createProjectionIdempotencyKey2, createRuntimeTelemetryIdempotencyKey2, createProjectionTelemetryIdempotencyKey2, createCommitIdentity2, timestampCommitIdentity2, createTimedCommitIdentity2, createProjectionMaterializationId2, createLinkScopeFingerprint2, normalizeJsonProperties2, normalizeOntologyEditCommit2, normalizeProjectionExecution2, normalizeProjectionSourceEntry2, normalizeTelemetryAppend2, usableLinkSlotOverride, explainEffectiveObject, storedObjectEditedAt, resolveEffectiveLink, resolveEffectiveLinkSlotMember, linkCardinality, OntologyMaterializer2, createOntologyMaterializer2 };
|
|
4860
4908
|
|
|
4861
|
-
//# debugId=
|
|
4909
|
+
//# debugId=4D8B149FCD5FA6E664756E2164756E21
|