@sixb/core 0.1.12 → 0.1.13
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.d.ts +2 -2
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +28 -26
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/read-facade.d.ts +14 -16
- package/dist/actions/read-facade.d.ts.map +1 -1
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run-dispatch.d.ts +2 -0
- package/dist/actions/run-dispatch.d.ts.map +1 -1
- package/dist/actions/types/context.d.ts +18 -31
- package/dist/actions/types/context.d.ts.map +1 -1
- package/dist/actions/types/params.d.ts +2 -1
- package/dist/actions/types/params.d.ts.map +1 -1
- package/dist/actions/worker.js +1 -1
- package/dist/agents/index.js +41 -39
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/streams/index.js +2 -2
- package/dist/agents/streams/internal.js +2 -2
- package/dist/assert-never.d.ts +6 -0
- package/dist/assert-never.d.ts.map +1 -0
- package/dist/auth/client-address.d.ts +3 -0
- package/dist/auth/client-address.d.ts.map +1 -0
- package/dist/auth/csrf.d.ts +5 -1
- package/dist/auth/csrf.d.ts.map +1 -1
- package/dist/auth/index.d.ts +3 -2
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +14 -8
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/runtime.d.ts +58 -41
- package/dist/auth/runtime.d.ts.map +1 -1
- package/dist/auth/session-cache.d.ts +10 -3
- package/dist/auth/session-cache.d.ts.map +1 -1
- package/dist/auth/sessions.d.ts +12 -0
- package/dist/auth/sessions.d.ts.map +1 -1
- package/dist/auth/strategy.js +1 -1
- package/dist/auth/types.d.ts +8 -15
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/authorization/index.js +3 -3
- package/dist/bootstrap/index.d.ts +1 -1
- package/dist/bootstrap/index.d.ts.map +1 -1
- package/dist/bootstrap/index.js +45 -43
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/bootstrap/ontology-type-manifest.d.ts +8 -0
- package/dist/bootstrap/ontology-type-manifest.d.ts.map +1 -1
- package/dist/{chunk-q5gz3g2j.js → chunk-0321g649.js} +2 -16
- package/dist/{chunk-q5gz3g2j.js.map → chunk-0321g649.js.map} +2 -2
- package/dist/{chunk-e1f1sqba.js → chunk-04h4t2b5.js} +3 -3
- package/dist/{chunk-y3ev53cq.js → chunk-2fv8sajb.js} +2 -2
- package/dist/{chunk-3bnt2wna.js → chunk-2hbhn1ff.js} +1 -1
- package/dist/{chunk-eyjzgav0.js → chunk-3nx8vj5a.js} +6 -4
- package/dist/chunk-3nx8vj5a.js.map +12 -0
- package/dist/{chunk-5tetw4hn.js → chunk-4tnrzqqh.js} +1 -1
- package/dist/{chunk-g50nxqs5.js → chunk-63fp9x3q.js} +63 -20
- package/dist/chunk-63fp9x3q.js.map +20 -0
- package/dist/{chunk-qm535afa.js → chunk-693f3zn8.js} +66 -24
- package/dist/chunk-693f3zn8.js.map +15 -0
- package/dist/{chunk-7zgecwy1.js → chunk-6x0pqh32.js} +12 -1
- package/dist/{chunk-7zgecwy1.js.map → chunk-6x0pqh32.js.map} +3 -3
- package/dist/{chunk-6ma8dvzc.js → chunk-898y24dd.js} +49 -42
- package/dist/chunk-898y24dd.js.map +15 -0
- package/dist/{chunk-7qnvhtcd.js → chunk-91wthfwe.js} +17 -17
- package/dist/{chunk-7qnvhtcd.js.map → chunk-91wthfwe.js.map} +5 -5
- package/dist/chunk-96yw3pwd.js.map +2 -2
- package/dist/{chunk-2cxv584m.js → chunk-9pfw47qx.js} +309 -204
- package/dist/chunk-9pfw47qx.js.map +44 -0
- package/dist/{chunk-4k53sm9e.js → chunk-a0073121.js} +59 -59
- package/dist/{chunk-4k53sm9e.js.map → chunk-a0073121.js.map} +5 -5
- package/dist/{chunk-jjwhy3rs.js → chunk-a69fkrtr.js} +5 -5
- package/dist/{chunk-y1ahv8b7.js → chunk-bdhfn0ww.js} +1 -1
- package/dist/{chunk-4ph94nhd.js → chunk-bep5rrdq.js} +2 -2
- package/dist/{chunk-kept9cdd.js → chunk-bxx3ms5t.js} +1 -1
- package/dist/{chunk-xtfryrfb.js → chunk-cbn96bve.js} +2 -2
- package/dist/{chunk-nzsy3xrp.js → chunk-cvrbhvtr.js} +69 -44
- package/dist/{chunk-nzsy3xrp.js.map → chunk-cvrbhvtr.js.map} +7 -7
- package/dist/{chunk-vsg0g7h9.js → chunk-d8yes9yx.js} +304 -45
- package/dist/chunk-d8yes9yx.js.map +20 -0
- package/dist/{chunk-tg4g4zh0.js → chunk-darm7eeg.js} +9 -9
- package/dist/{chunk-tg4g4zh0.js.map → chunk-darm7eeg.js.map} +3 -3
- package/dist/{chunk-vpxss818.js → chunk-drz59ve0.js} +9 -8
- package/dist/chunk-drz59ve0.js.map +10 -0
- package/dist/{chunk-7c2g3sz9.js → chunk-dsfw1bdr.js} +5 -5
- package/dist/{chunk-7c2g3sz9.js.map → chunk-dsfw1bdr.js.map} +1 -1
- package/dist/{chunk-p6r1ex7t.js → chunk-ffwvdgk1.js} +5 -13
- package/dist/chunk-ffwvdgk1.js.map +10 -0
- package/dist/{chunk-r5zythxp.js → chunk-gbcrz0gr.js} +7 -7
- package/dist/{chunk-ybhz3j9g.js → chunk-gc226ten.js} +104 -148
- package/dist/{chunk-ybhz3j9g.js.map → chunk-gc226ten.js.map} +7 -8
- package/dist/{chunk-3ghw2t5q.js → chunk-gmt22nxx.js} +10 -16
- package/dist/chunk-gmt22nxx.js.map +10 -0
- package/dist/chunk-h89wz928.js +42 -0
- package/dist/chunk-h89wz928.js.map +10 -0
- package/dist/{chunk-hkw8rykk.js → chunk-ht4a7mjg.js} +74 -4
- package/dist/chunk-ht4a7mjg.js.map +15 -0
- package/dist/{chunk-t7dzd1tm.js → chunk-jhyc777j.js} +2 -2
- package/dist/{chunk-xn686q2e.js → chunk-jmwy25mf.js} +75 -57
- package/dist/{chunk-xn686q2e.js.map → chunk-jmwy25mf.js.map} +3 -3
- package/dist/{chunk-f06sf7rr.js → chunk-k4kkp58d.js} +18 -5
- package/dist/chunk-k4kkp58d.js.map +11 -0
- package/dist/{chunk-2h63nrde.js → chunk-ky7zpbtt.js} +5 -7
- package/dist/{chunk-2h63nrde.js.map → chunk-ky7zpbtt.js.map} +3 -4
- package/dist/chunk-m4ehq95f.js +9 -0
- package/dist/chunk-m4ehq95f.js.map +10 -0
- package/dist/{chunk-0mza4xb2.js → chunk-m8zkvep1.js} +2 -2
- package/dist/{chunk-b768c93y.js → chunk-mf6hwpzh.js} +83 -28
- package/dist/{chunk-b768c93y.js.map → chunk-mf6hwpzh.js.map} +5 -5
- package/dist/{chunk-yxb4c62x.js → chunk-mr60an99.js} +3 -2
- package/dist/{chunk-yxb4c62x.js.map → chunk-mr60an99.js.map} +3 -3
- package/dist/chunk-n33e8dz8.js +191 -0
- package/dist/chunk-n33e8dz8.js.map +11 -0
- package/dist/chunk-rdghfsss.js.map +2 -2
- package/dist/{chunk-m7cx05vp.js → chunk-rqtdtm43.js} +126 -59
- package/dist/{chunk-m7cx05vp.js.map → chunk-rqtdtm43.js.map} +13 -12
- package/dist/{chunk-bbaa1fet.js → chunk-rzcjp5m2.js} +7 -3
- package/dist/chunk-rzcjp5m2.js.map +25 -0
- package/dist/{chunk-hzw7yv5g.js → chunk-rzkr70gr.js} +5 -1
- package/dist/{chunk-hzw7yv5g.js.map → chunk-rzkr70gr.js.map} +3 -3
- package/dist/{chunk-sfypc7mk.js → chunk-s24qbp32.js} +4 -4
- package/dist/{chunk-axndsymr.js → chunk-tw03bsmb.js} +2 -2
- package/dist/{chunk-axndsymr.js.map → chunk-tw03bsmb.js.map} +3 -3
- package/dist/{chunk-y0v18c2j.js → chunk-vef6qa14.js} +2 -2
- package/dist/{chunk-gzt6v1ja.js → chunk-vn3yh259.js} +1 -1
- package/dist/{chunk-bg2bs62d.js → chunk-w9bp61e7.js} +5 -5
- package/dist/{chunk-3h7ctayx.js → chunk-xgptywp0.js} +4 -3
- package/dist/chunk-xgptywp0.js.map +11 -0
- package/dist/{chunk-gswwr35f.js → chunk-y487ywrv.js} +4 -4
- package/dist/{chunk-bet1rb9h.js → chunk-y6vnvayj.js} +1 -1
- package/dist/{chunk-x9tmx3fc.js → chunk-ypj2wqtj.js} +3 -6
- package/dist/{chunk-x9tmx3fc.js.map → chunk-ypj2wqtj.js.map} +4 -4
- package/dist/{chunk-g2gezsg5.js → chunk-z9h698s8.js} +1 -1
- package/dist/{chunk-wjffn5m4.js → chunk-zdkcdshk.js} +3 -36
- package/dist/{chunk-wjffn5m4.js.map → chunk-zdkcdshk.js.map} +3 -4
- package/dist/{chunk-bfjv1adk.js → chunk-znw0zvy4.js} +1 -1
- package/dist/edits/types.d.ts +19 -19
- package/dist/edits/types.d.ts.map +1 -1
- package/dist/error-reporting/internal.js +3 -3
- package/dist/errors/catalog.d.ts +4 -0
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/errors/internal.js +1 -1
- package/dist/events/envelope.d.ts +0 -12
- package/dist/events/envelope.d.ts.map +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +3 -3
- package/dist/events/service.d.ts +1 -2
- package/dist/events/service.d.ts.map +1 -1
- package/dist/events/toStoredEvent.d.ts +1 -2
- package/dist/events/toStoredEvent.d.ts.map +1 -1
- package/dist/events/types/index.d.ts +2 -1
- package/dist/events/types/index.d.ts.map +1 -1
- package/dist/execution/agent.d.ts +1 -2
- package/dist/execution/agent.d.ts.map +1 -1
- package/dist/execution/agent.js +39 -37
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts.map +1 -1
- package/dist/execution/primitive.d.ts +1 -2
- package/dist/execution/primitive.d.ts.map +1 -1
- package/dist/execution/primitive.js +38 -36
- package/dist/execution/primitive.js.map +3 -3
- package/dist/execution/request.d.ts +1 -2
- package/dist/execution/request.d.ts.map +1 -1
- package/dist/execution/request.js +39 -37
- package/dist/execution/request.js.map +3 -3
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +56 -50
- package/dist/index.js.map +1 -1
- package/dist/maintenance/ontology-maintenance.d.ts +11 -1
- package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
- package/dist/materialization/errors.d.ts +3 -1
- package/dist/materialization/errors.d.ts.map +1 -1
- package/dist/materialization/events.d.ts +27 -2
- package/dist/materialization/events.d.ts.map +1 -1
- package/dist/materializer/edits/commit.d.ts.map +1 -1
- package/dist/materializer/edits/operations.d.ts +2 -1
- package/dist/materializer/edits/operations.d.ts.map +1 -1
- package/dist/materializer/edits/plan.d.ts +2 -2
- package/dist/materializer/edits/plan.d.ts.map +1 -1
- package/dist/materializer/edits/user-refs.d.ts +30 -0
- package/dist/materializer/edits/user-refs.d.ts.map +1 -0
- package/dist/materializer/effective/build-events.d.ts +2 -2
- package/dist/materializer/effective/build-events.d.ts.map +1 -1
- package/dist/materializer/execution/scope.d.ts +11 -3
- package/dist/materializer/execution/scope.d.ts.map +1 -1
- package/dist/materializer/index.js +23 -21
- package/dist/materializer/index.js.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/telemetry/plan.d.ts +2 -2
- package/dist/materializer/telemetry/plan.d.ts.map +1 -1
- package/dist/models/execution/index.js +23 -21
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/index.js +1 -1
- package/dist/objects/execution.d.ts +21 -27
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +28 -26
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/index.js +27 -25
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/ir.d.ts +8 -1
- package/dist/objects/query/ir.d.ts.map +1 -1
- package/dist/objects/query/scalar-values.d.ts.map +1 -1
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/objects/sdk/object-handle.d.ts +1 -2
- package/dist/objects/sdk/object-handle.d.ts.map +1 -1
- package/dist/objects/sdk/object-set.d.ts +2 -3
- package/dist/objects/sdk/object-set.d.ts.map +1 -1
- package/dist/objects/sdk/query-builder.d.ts +8 -10
- package/dist/objects/sdk/query-builder.d.ts.map +1 -1
- package/dist/objects/sdk/telemetry-channel.d.ts +1 -2
- package/dist/objects/sdk/telemetry-channel.d.ts.map +1 -1
- package/dist/objects/sdk/where.d.ts +2 -3
- package/dist/objects/sdk/where.d.ts.map +1 -1
- package/dist/ontology/builders.d.ts +11 -10
- package/dist/ontology/builders.d.ts.map +1 -1
- package/dist/ontology/index.d.ts +4 -2
- package/dist/ontology/index.d.ts.map +1 -1
- package/dist/ontology/index.js +6 -4
- package/dist/ontology/index.js.map +1 -1
- package/dist/ontology/inference/index.d.ts +34 -22
- package/dist/ontology/inference/index.d.ts.map +1 -1
- package/dist/ontology/internal.d.ts +1 -0
- package/dist/ontology/internal.d.ts.map +1 -1
- package/dist/ontology/internal.js +9 -7
- package/dist/ontology/internal.js.map +1 -1
- package/dist/ontology/primitives.d.ts +38 -0
- package/dist/ontology/primitives.d.ts.map +1 -0
- package/dist/ontology/query-capabilities.d.ts +38 -0
- package/dist/ontology/query-capabilities.d.ts.map +1 -0
- package/dist/ontology/refs.d.ts +23 -2
- package/dist/ontology/refs.d.ts.map +1 -1
- package/dist/ontology/registered.d.ts +16 -0
- package/dist/ontology/registered.d.ts.map +1 -0
- package/dist/ontology/registry.d.ts.map +1 -1
- package/dist/ontology/tokens.d.ts +35 -1
- package/dist/ontology/tokens.d.ts.map +1 -1
- package/dist/ontology/types.d.ts +18 -4
- package/dist/ontology/types.d.ts.map +1 -1
- package/dist/ontology/user-ref.d.ts +35 -0
- package/dist/ontology/user-ref.d.ts.map +1 -0
- package/dist/ontology/validation/definition.d.ts.map +1 -1
- package/dist/ontology/validation/index.d.ts +1 -1
- package/dist/ontology/validation/index.d.ts.map +1 -1
- package/dist/ontology/validation/normalize.d.ts.map +1 -1
- package/dist/ontology/validation/properties.d.ts +6 -1
- package/dist/ontology/validation/properties.d.ts.map +1 -1
- package/dist/ontology/validation/query.d.ts.map +1 -1
- package/dist/ontology/validation/schema.d.ts.map +1 -1
- package/dist/pipelines/index.js +26 -24
- package/dist/pipelines/index.js.map +1 -1
- package/dist/predicates/types.d.ts +53 -3
- package/dist/predicates/types.d.ts.map +1 -1
- package/dist/projections/builders.d.ts +19 -1
- package/dist/projections/builders.d.ts.map +1 -1
- package/dist/projections/internal.js +23 -21
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/validation.d.ts.map +1 -1
- package/dist/query.js +2 -2
- package/dist/queues/in-memory.d.ts +1 -1
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/runtime/create.d.ts +1 -1
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +5 -5
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/internal.js +27 -25
- package/dist/runtime/internal.js.map +1 -1
- package/dist/runtime/sixb.d.ts +5 -5
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +171 -188
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/sandboxes/index.js +5 -5
- package/dist/sandboxes/sandbox.d.ts +4 -1
- package/dist/sandboxes/sandbox.d.ts.map +1 -1
- package/dist/shared/params/types.d.ts +4 -3
- package/dist/shared/params/types.d.ts.map +1 -1
- package/dist/shared/params/user-refs.d.ts +19 -0
- package/dist/shared/params/user-refs.d.ts.map +1 -0
- package/dist/shares/compiler.d.ts.map +1 -1
- package/dist/shares/internal.js +24 -22
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/action-runs/failure.js +2 -2
- package/dist/storage/action-runs/types.d.ts +1 -1
- package/dist/storage/action-runs/types.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +1 -1
- package/dist/storage/ai-limits/enforcement.js +2 -2
- package/dist/storage/auth/in-memory/access-tokens.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/device-authorizations.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/sessions.d.ts +8 -1
- package/dist/storage/auth/in-memory/sessions.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/shared.d.ts.map +1 -1
- package/dist/storage/auth/index.d.ts +1 -1
- package/dist/storage/auth/index.d.ts.map +1 -1
- package/dist/storage/auth/types.d.ts +62 -13
- package/dist/storage/auth/types.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.js +1 -1
- package/dist/storage/executions/provider.js +1 -1
- package/dist/storage/file-upload-sessions/in-memory.d.ts +9 -18
- package/dist/storage/file-upload-sessions/in-memory.d.ts.map +1 -1
- package/dist/storage/file-upload-sessions/index.d.ts +1 -1
- package/dist/storage/file-upload-sessions/index.d.ts.map +1 -1
- package/dist/storage/file-upload-sessions/provider.d.ts +52 -0
- package/dist/storage/file-upload-sessions/provider.d.ts.map +1 -0
- package/dist/storage/file-upload-sessions/provider.js +24 -0
- package/dist/storage/file-upload-sessions/provider.js.map +9 -0
- package/dist/storage/file-upload-sessions/types.d.ts +19 -1
- package/dist/storage/file-upload-sessions/types.d.ts.map +1 -1
- package/dist/storage/file-upload-sessions/utils.d.ts +8 -2
- package/dist/storage/file-upload-sessions/utils.d.ts.map +1 -1
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +29 -25
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.js +11 -9
- package/dist/storage/internal.js.map +1 -1
- package/dist/storage/objects/in-memory/query.d.ts.map +1 -1
- package/dist/storage/ontology/commits.d.ts +6 -2
- package/dist/storage/ontology/commits.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -1
- package/dist/storage/ontology/provider-work.d.ts.map +1 -1
- package/dist/storage/ontology/provider.d.ts +14 -1
- package/dist/storage/ontology/provider.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +8 -2
- package/dist/storage/ontology/provider.js.map +1 -1
- package/dist/storage/operation-scope.d.ts.map +1 -1
- package/dist/storage/operation-scope.js +1 -1
- package/dist/storage/projection-runs/provider.js +2 -2
- package/dist/storage/types.d.ts +1 -1
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/workflow-interventions/index.d.ts +1 -1
- package/dist/storage/workflow-interventions/index.d.ts.map +1 -1
- package/dist/storage/workflow-interventions/types.d.ts +5 -8
- package/dist/storage/workflow-interventions/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +8 -8
- package/dist/syncs/index.js +27 -25
- package/dist/syncs/index.js.map +1 -1
- package/dist/testing/action-execution.d.ts +4 -0
- package/dist/testing/action-execution.d.ts.map +1 -1
- package/dist/testing/auth-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution.d.ts +1 -2
- package/dist/testing/execution.d.ts.map +1 -1
- package/dist/testing/file-upload-session-storage-contract.d.ts +12 -0
- package/dist/testing/file-upload-session-storage-contract.d.ts.map +1 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1951 -1242
- package/dist/testing/index.js.map +15 -13
- package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
- package/dist/testing/object-query-contract.d.ts.map +1 -1
- package/dist/testing/ontology-contract-fixture.d.ts +8 -0
- package/dist/testing/ontology-contract-fixture.d.ts.map +1 -1
- package/dist/testing/ontology-storage-contract.d.ts.map +1 -1
- package/dist/testing/sandboxes-contract.d.ts.map +1 -1
- package/dist/testing/workflow-intervention-storage-contract.d.ts +8 -0
- package/dist/testing/workflow-intervention-storage-contract.d.ts.map +1 -0
- package/dist/webhooks/internal.js +24 -22
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/webhooks/types.d.ts +2 -2
- package/dist/webhooks/types.d.ts.map +1 -1
- package/dist/workers/index.js +1 -1
- package/dist/workflows/index.js +42 -40
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/run-dispatch.d.ts.map +1 -1
- package/dist/workflows/types.d.ts +2 -2
- package/dist/workflows/types.d.ts.map +1 -1
- package/package.json +7 -1
- package/src/actions/index.ts +0 -3
- package/src/actions/read-facade.ts +102 -62
- package/src/actions/request.ts +13 -0
- package/src/actions/run-dispatch.ts +3 -0
- package/src/actions/types/context.ts +17 -65
- package/src/actions/types/params.ts +2 -1
- package/src/agents/authority.ts +1 -1
- package/src/assert-never.ts +7 -0
- package/src/auth/client-address.ts +12 -0
- package/src/auth/csrf.ts +14 -5
- package/src/auth/index.ts +3 -2
- package/src/auth/runtime.ts +299 -277
- package/src/auth/session-cache.ts +18 -6
- package/src/auth/sessions.ts +30 -0
- package/src/auth/types.ts +7 -17
- package/src/bootstrap/index.ts +1 -0
- package/src/bootstrap/ontology-type-manifest.ts +112 -60
- package/src/edits/types.ts +47 -63
- package/src/errors/catalog.ts +4 -0
- package/src/events/envelope.ts +0 -13
- package/src/events/index.ts +1 -1
- package/src/events/service.ts +1 -11
- package/src/events/toStoredEvent.ts +1 -3
- package/src/events/types/index.ts +1 -1
- package/src/execution/agent.ts +1 -2
- package/src/execution/authorized-object-reader.ts +5 -7
- package/src/execution/primitive.ts +1 -2
- package/src/execution/request.ts +1 -2
- package/src/index.ts +8 -7
- package/src/maintenance/ontology-maintenance.ts +77 -1
- package/src/materialization/errors.ts +2 -0
- package/src/materialization/events.ts +27 -2
- package/src/materializer/README.md +2 -0
- package/src/materializer/edits/commit.ts +21 -12
- package/src/materializer/edits/operations.ts +32 -4
- package/src/materializer/edits/plan.ts +4 -5
- package/src/materializer/edits/user-refs.ts +115 -0
- package/src/materializer/effective/build-events.ts +4 -5
- package/src/materializer/execution/scope.ts +40 -7
- package/src/materializer/projections/replace.ts +2 -0
- package/src/materializer/projections/replacement-plan.ts +4 -0
- package/src/materializer/telemetry/append.ts +4 -12
- package/src/materializer/telemetry/plan.ts +4 -5
- package/src/objects/execution.ts +33 -62
- package/src/objects/query/executor.ts +12 -3
- package/src/objects/query/ir.ts +7 -0
- package/src/objects/query/planner.ts +1 -0
- package/src/objects/query/scalar-values.ts +19 -0
- package/src/objects/query/validate.ts +55 -44
- package/src/objects/sdk/object-handle.ts +8 -8
- package/src/objects/sdk/object-set.ts +8 -15
- package/src/objects/sdk/query-builder.ts +59 -71
- package/src/objects/sdk/telemetry-channel.ts +6 -7
- package/src/objects/sdk/where.ts +6 -13
- package/src/ontology/builders.ts +15 -11
- package/src/ontology/index.ts +4 -0
- package/src/ontology/inference/index.ts +56 -36
- package/src/ontology/internal.ts +1 -0
- package/src/ontology/json-schema.ts +12 -0
- package/src/ontology/primitives.ts +91 -0
- package/src/ontology/query-capabilities.ts +136 -0
- package/src/ontology/refs.ts +33 -6
- package/src/ontology/registered.ts +22 -0
- package/src/ontology/registry.ts +6 -3
- package/src/ontology/tokens.ts +41 -2
- package/src/ontology/types.ts +19 -3
- package/src/ontology/user-ref.ts +120 -0
- package/src/ontology/validation/definition.ts +2 -13
- package/src/ontology/validation/index.ts +1 -0
- package/src/ontology/validation/normalize.ts +39 -3
- package/src/ontology/validation/properties.ts +95 -19
- package/src/ontology/validation/query.ts +11 -42
- package/src/ontology/validation/schema.ts +16 -0
- package/src/predicates/types.ts +43 -33
- package/src/projections/builders.ts +24 -3
- package/src/projections/validation.ts +15 -1
- package/src/runtime/create.ts +2 -2
- package/src/runtime/host.ts +10 -12
- package/src/runtime/index.ts +3 -2
- package/src/runtime/sixb.ts +13 -23
- package/src/runtime/types.ts +277 -479
- package/src/sandboxes/sandbox.ts +4 -1
- package/src/shared/params/types.ts +4 -3
- package/src/shared/params/user-refs.ts +48 -0
- package/src/shares/compiler.ts +6 -16
- package/src/storage/action-runs/types.ts +1 -0
- package/src/storage/auth/in-memory/access-tokens.ts +5 -2
- package/src/storage/auth/in-memory/auth-storage.ts +5 -8
- package/src/storage/auth/in-memory/device-authorizations.ts +0 -2
- package/src/storage/auth/in-memory/sessions.ts +69 -1
- package/src/storage/auth/in-memory/shared.ts +13 -7
- package/src/storage/auth/index.ts +2 -1
- package/src/storage/auth/types.ts +57 -13
- package/src/storage/executions/validation.ts +1 -1
- package/src/storage/file-upload-sessions/in-memory.ts +64 -113
- package/src/storage/file-upload-sessions/index.ts +1 -0
- package/src/storage/file-upload-sessions/provider.ts +258 -0
- package/src/storage/file-upload-sessions/types.ts +20 -1
- package/src/storage/file-upload-sessions/utils.ts +25 -9
- package/src/storage/index.ts +3 -2
- package/src/storage/objects/in-memory/query.ts +13 -3
- package/src/storage/ontology/commits.ts +6 -2
- package/src/storage/ontology/in-memory/materializations.ts +6 -34
- package/src/storage/ontology/provider-header-validation.ts +57 -0
- package/src/storage/ontology/provider-work.ts +15 -3
- package/src/storage/ontology/provider.ts +59 -1
- package/src/storage/operation-scope.ts +1 -0
- package/src/storage/types.ts +0 -1
- package/src/storage/workflow-interventions/index.ts +0 -1
- package/src/storage/workflow-interventions/types.ts +5 -9
- package/src/testing/action-execution.ts +13 -3
- package/src/testing/auth-storage-contract.ts +149 -62
- package/src/testing/execution-storage-contract.ts +1 -2
- package/src/testing/execution.ts +4 -7
- package/src/testing/file-upload-session-storage-contract.ts +335 -0
- package/src/testing/index.ts +8 -0
- package/src/testing/materializer-storage-contract.ts +86 -4
- package/src/testing/object-query-contract.ts +121 -2
- package/src/testing/ontology-contract-fixture.ts +23 -3
- package/src/testing/ontology-storage-contract.ts +58 -0
- package/src/testing/sandboxes-contract.ts +27 -0
- package/src/testing/workflow-intervention-storage-contract.ts +203 -0
- package/src/webhooks/types.ts +2 -2
- package/src/workflows/run-dispatch.ts +12 -1
- package/src/workflows/snapshot.ts +16 -7
- package/src/workflows/types.ts +2 -2
- package/dist/chunk-2cxv584m.js.map +0 -43
- package/dist/chunk-3ghw2t5q.js.map +0 -10
- package/dist/chunk-3h7ctayx.js.map +0 -11
- package/dist/chunk-6ma8dvzc.js.map +0 -15
- package/dist/chunk-bbaa1fet.js.map +0 -25
- package/dist/chunk-eyjzgav0.js.map +0 -12
- package/dist/chunk-f06sf7rr.js.map +0 -11
- package/dist/chunk-g50nxqs5.js.map +0 -18
- package/dist/chunk-hkw8rykk.js.map +0 -15
- package/dist/chunk-p6r1ex7t.js.map +0 -10
- package/dist/chunk-qm535afa.js.map +0 -15
- package/dist/chunk-vpxss818.js.map +0 -10
- package/dist/chunk-vsg0g7h9.js.map +0 -17
- /package/dist/{chunk-e1f1sqba.js.map → chunk-04h4t2b5.js.map} +0 -0
- /package/dist/{chunk-y3ev53cq.js.map → chunk-2fv8sajb.js.map} +0 -0
- /package/dist/{chunk-3bnt2wna.js.map → chunk-2hbhn1ff.js.map} +0 -0
- /package/dist/{chunk-5tetw4hn.js.map → chunk-4tnrzqqh.js.map} +0 -0
- /package/dist/{chunk-jjwhy3rs.js.map → chunk-a69fkrtr.js.map} +0 -0
- /package/dist/{chunk-y1ahv8b7.js.map → chunk-bdhfn0ww.js.map} +0 -0
- /package/dist/{chunk-4ph94nhd.js.map → chunk-bep5rrdq.js.map} +0 -0
- /package/dist/{chunk-kept9cdd.js.map → chunk-bxx3ms5t.js.map} +0 -0
- /package/dist/{chunk-xtfryrfb.js.map → chunk-cbn96bve.js.map} +0 -0
- /package/dist/{chunk-r5zythxp.js.map → chunk-gbcrz0gr.js.map} +0 -0
- /package/dist/{chunk-t7dzd1tm.js.map → chunk-jhyc777j.js.map} +0 -0
- /package/dist/{chunk-0mza4xb2.js.map → chunk-m8zkvep1.js.map} +0 -0
- /package/dist/{chunk-sfypc7mk.js.map → chunk-s24qbp32.js.map} +0 -0
- /package/dist/{chunk-y0v18c2j.js.map → chunk-vef6qa14.js.map} +0 -0
- /package/dist/{chunk-gzt6v1ja.js.map → chunk-vn3yh259.js.map} +0 -0
- /package/dist/{chunk-bg2bs62d.js.map → chunk-w9bp61e7.js.map} +0 -0
- /package/dist/{chunk-gswwr35f.js.map → chunk-y487ywrv.js.map} +0 -0
- /package/dist/{chunk-bet1rb9h.js.map → chunk-y6vnvayj.js.map} +0 -0
- /package/dist/{chunk-g2gezsg5.js.map → chunk-z9h698s8.js.map} +0 -0
- /package/dist/{chunk-bfjv1adk.js.map → chunk-znw0zvy4.js.map} +0 -0
package/src/events/service.ts
CHANGED
|
@@ -12,13 +12,7 @@ import {
|
|
|
12
12
|
resolveEventStorage,
|
|
13
13
|
} from "./definitions"
|
|
14
14
|
import { EventsError } from "./errors"
|
|
15
|
-
import type {
|
|
16
|
-
DomainEvent,
|
|
17
|
-
EventActor,
|
|
18
|
-
EventDraft,
|
|
19
|
-
StoredAuthorableEvent,
|
|
20
|
-
StoredDomainEvent,
|
|
21
|
-
} from "./types"
|
|
15
|
+
import type { DomainEvent, EventDraft, StoredAuthorableEvent, StoredDomainEvent } from "./types"
|
|
22
16
|
|
|
23
17
|
// Keep domain events as a short recent log. This is 2 days in milliseconds.
|
|
24
18
|
export const DEFAULT_EVENTS_RETENTION_MS = 2 * 24 * 60 * 60 * 1000
|
|
@@ -37,7 +31,6 @@ export interface DomainEventServiceOptions {
|
|
|
37
31
|
}
|
|
38
32
|
|
|
39
33
|
export interface EventsAppendInput {
|
|
40
|
-
readonly actor?: EventActor
|
|
41
34
|
readonly correlationId?: string
|
|
42
35
|
readonly causationId?: string
|
|
43
36
|
readonly events: readonly EventDraft[]
|
|
@@ -146,7 +139,6 @@ export class DomainEventService implements DomainEventLog, StableEventPublisher
|
|
|
146
139
|
const payloads = input.events.map((event) =>
|
|
147
140
|
toStoredEventPayload({
|
|
148
141
|
projectId: this.projectId,
|
|
149
|
-
actor: input.actor,
|
|
150
142
|
correlationId: input.correlationId,
|
|
151
143
|
causationId: input.causationId,
|
|
152
144
|
event,
|
|
@@ -306,7 +298,6 @@ type StoredEventPayload = Omit<StoredAuthorableEvent, "cursor">
|
|
|
306
298
|
|
|
307
299
|
function toStoredEventPayload(params: {
|
|
308
300
|
projectId: string
|
|
309
|
-
actor?: EventActor
|
|
310
301
|
correlationId?: string
|
|
311
302
|
causationId?: string
|
|
312
303
|
event: EventDraft
|
|
@@ -326,7 +317,6 @@ function toStoredEventPayload(params: {
|
|
|
326
317
|
setIfDefined(payload, "correlationId", params.correlationId)
|
|
327
318
|
setIfDefined(payload, "causationId", params.causationId)
|
|
328
319
|
setIfDefined(payload, "idempotencyKey", params.event.idempotencyKey)
|
|
329
|
-
setIfDefined(payload, "actor", params.actor)
|
|
330
320
|
setIfDefined(payload, "origin", params.event.origin)
|
|
331
321
|
setIfDefined(payload, "metadata", params.event.metadata)
|
|
332
322
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto"
|
|
2
2
|
import { resolveEventStorage } from "./definitions"
|
|
3
|
-
import type {
|
|
3
|
+
import type { EventDraft, StoredAuthorableEvent } from "./types/index"
|
|
4
4
|
|
|
5
5
|
export function toStoredEvent(params: {
|
|
6
6
|
projectId: string
|
|
7
|
-
actor?: EventActor
|
|
8
7
|
correlationId?: string
|
|
9
8
|
causationId?: string
|
|
10
9
|
event: EventDraft
|
|
@@ -18,7 +17,6 @@ export function toStoredEvent(params: {
|
|
|
18
17
|
correlationId: params.correlationId,
|
|
19
18
|
causationId: params.causationId,
|
|
20
19
|
idempotencyKey: params.event.idempotencyKey,
|
|
21
|
-
actor: params.actor,
|
|
22
20
|
origin: params.event.origin,
|
|
23
21
|
metadata: params.event.metadata,
|
|
24
22
|
cursor: params.cursor,
|
|
@@ -12,9 +12,9 @@ import type { SyncEvent } from "./syncs"
|
|
|
12
12
|
import type { TelemetryEvent } from "./telemetry"
|
|
13
13
|
import type { WorkflowEvent } from "./workflows"
|
|
14
14
|
|
|
15
|
+
export type { EventExecutor } from "../../materialization/events"
|
|
15
16
|
export type {
|
|
16
17
|
ActionEventOrigin,
|
|
17
|
-
EventActor,
|
|
18
18
|
EventEnvelope,
|
|
19
19
|
EventOrigin,
|
|
20
20
|
ProjectionEventOrigin,
|
package/src/execution/agent.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type AgentExecutionAuthorization, agentServiceAccountId } from "../agents/authority"
|
|
2
|
-
import type { OntologySource } from "../ontology"
|
|
3
2
|
import { isBoundSixb, type Sixb } from "../runtime/sixb"
|
|
4
3
|
import type { ExecutionRecord } from "../storage/executions"
|
|
5
4
|
import { ExecutionStorageError } from "../storage/executions"
|
|
@@ -99,7 +98,7 @@ export function bindDurableAgentExecution(
|
|
|
99
98
|
readonly runId: string
|
|
100
99
|
readonly authorization: AgentExecutionAuthorization
|
|
101
100
|
}
|
|
102
|
-
): Sixb
|
|
101
|
+
): Sixb {
|
|
103
102
|
const scope = restoreAgentExecutionScope(input)
|
|
104
103
|
const sixb = host.withScope(scope)
|
|
105
104
|
if (!isBoundSixb(sixb)) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assertNever } from "../assert-never"
|
|
1
2
|
import { assertAuthorized, isAllowed } from "../authorization"
|
|
2
3
|
import { AuthorizationError } from "../authorization/errors"
|
|
3
4
|
import type { AuthorizationContext } from "../authorization/types"
|
|
@@ -602,16 +603,13 @@ function objectStorageForAuthority(
|
|
|
602
603
|
limits: authority.objectRead.limits,
|
|
603
604
|
})
|
|
604
605
|
default:
|
|
605
|
-
return assertNever(
|
|
606
|
+
return assertNever(
|
|
607
|
+
authority,
|
|
608
|
+
`[Sixb] Unsupported object reader authority '${String((authority as { type?: unknown }).type)}'.`
|
|
609
|
+
)
|
|
606
610
|
}
|
|
607
611
|
}
|
|
608
612
|
|
|
609
|
-
function assertNever(value: never): never {
|
|
610
|
-
throw new Error(
|
|
611
|
-
`[Sixb] Unsupported object reader authority '${String((value as { type?: unknown }).type)}'.`
|
|
612
|
-
)
|
|
613
|
-
}
|
|
614
|
-
|
|
615
613
|
function ontologySelectionForAuthority(
|
|
616
614
|
authority: ResolvedExecutionAuthority,
|
|
617
615
|
ontology: OntologyRegistry
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { bindModelExecutionAttempt, type ModelExecutionAttempt } from "../models/execution/binding"
|
|
2
|
-
import type { OntologySource } from "../ontology"
|
|
3
2
|
import type { OntologyMutationRuntime } from "../runtime/ontology-mutations"
|
|
4
3
|
import { getOntologyMutationRuntime } from "../runtime/ontology-mutations"
|
|
5
4
|
import { isBoundSixb, type Sixb } from "../runtime/sixb"
|
|
@@ -14,7 +13,7 @@ export interface PrimitiveExecutionHost {
|
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
export interface BoundPrimitiveExecution {
|
|
17
|
-
readonly sixb: Sixb
|
|
16
|
+
readonly sixb: Sixb
|
|
18
17
|
/** Internal mutation port guarded by the same runtime authority as `sixb`. */
|
|
19
18
|
readonly ontologyMutations: OntologyMutationRuntime
|
|
20
19
|
}
|
package/src/execution/request.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto"
|
|
2
2
|
import type { AuthorizationContext } from "../authorization"
|
|
3
3
|
import { bindModelExecutionAttempt } from "../models/execution/binding"
|
|
4
|
-
import type { OntologySource } from "../ontology"
|
|
5
4
|
import { isBoundSixb, type Sixb } from "../runtime/sixb"
|
|
6
5
|
import {
|
|
7
6
|
objectReadScopeForAccessPlan,
|
|
@@ -97,7 +96,7 @@ export interface RequestExecutionHost {
|
|
|
97
96
|
export function bindRequestExecution(
|
|
98
97
|
host: RequestExecutionHost,
|
|
99
98
|
input: BindRequestExecutionInput
|
|
100
|
-
): Sixb
|
|
99
|
+
): Sixb {
|
|
101
100
|
const requestId = requestIdentifier(input.request)
|
|
102
101
|
const correlationId = correlationIdentifier(input.request, requestId)
|
|
103
102
|
const scope = createRequestScope(host.id, requestId, correlationId, input.authorization)
|
package/src/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ export type {
|
|
|
20
20
|
ObjectLink,
|
|
21
21
|
ObjectLinkTargetMetadata,
|
|
22
22
|
ObjectLinkTargetType,
|
|
23
|
+
ObjectPropertiesMetadata,
|
|
23
24
|
ObjectRef,
|
|
24
25
|
ObjectRefSchema,
|
|
25
26
|
ObjectSchema,
|
|
@@ -40,6 +41,8 @@ export type {
|
|
|
40
41
|
Schema,
|
|
41
42
|
SchemaOrRef,
|
|
42
43
|
SixbObjectTypeMap,
|
|
44
|
+
SixbValueTypeMap,
|
|
45
|
+
UserRef,
|
|
43
46
|
ValueType,
|
|
44
47
|
ValueTypeRefSchema,
|
|
45
48
|
} from "./ontology"
|
|
@@ -56,6 +59,7 @@ export {
|
|
|
56
59
|
prop,
|
|
57
60
|
ref,
|
|
58
61
|
stringEnum,
|
|
62
|
+
userRef,
|
|
59
63
|
valueTypeRef,
|
|
60
64
|
} from "./ontology"
|
|
61
65
|
|
|
@@ -75,9 +79,6 @@ export type {
|
|
|
75
79
|
ActionParamConfig,
|
|
76
80
|
ActionParamsConfig,
|
|
77
81
|
ActionReadFacade,
|
|
78
|
-
ActionReadObjectByIdHandle,
|
|
79
|
-
ActionReadObjectSet,
|
|
80
|
-
ActionReadObjectSetSource,
|
|
81
82
|
ActionRunPhaseInfo,
|
|
82
83
|
ActionRuntimeFacade,
|
|
83
84
|
ActionSubject,
|
|
@@ -247,8 +248,8 @@ export type {
|
|
|
247
248
|
DatasetVersionCommittedEvent,
|
|
248
249
|
DomainEvent,
|
|
249
250
|
DomainEventLog,
|
|
250
|
-
EventActor,
|
|
251
251
|
EventDraft,
|
|
252
|
+
EventExecutor,
|
|
252
253
|
EventOrigin,
|
|
253
254
|
EventPropertySelector,
|
|
254
255
|
EventScopeKeys,
|
|
@@ -412,7 +413,6 @@ export type {
|
|
|
412
413
|
MembershipCapabilities,
|
|
413
414
|
MembershipOperationCapabilities,
|
|
414
415
|
Principal,
|
|
415
|
-
SecurityContext,
|
|
416
416
|
SixbAuthConfig,
|
|
417
417
|
} from "./auth"
|
|
418
418
|
export {
|
|
@@ -951,6 +951,9 @@ export type {
|
|
|
951
951
|
ObjectQueryFacetResult,
|
|
952
952
|
ObjectQueryListOptions,
|
|
953
953
|
ObjectQueryRow,
|
|
954
|
+
ObjectReadByIdHandle,
|
|
955
|
+
ObjectReader,
|
|
956
|
+
ObjectReadSet,
|
|
954
957
|
ObjectSet,
|
|
955
958
|
ObjectSetListInput,
|
|
956
959
|
ObjectSetQueryPropertyToken,
|
|
@@ -958,8 +961,6 @@ export type {
|
|
|
958
961
|
ObjectWhereClause,
|
|
959
962
|
OntologyDocumentInput,
|
|
960
963
|
OntologySource,
|
|
961
|
-
RegisteredObjectType,
|
|
962
|
-
RegisteredValueTypes,
|
|
963
964
|
SchedulerController,
|
|
964
965
|
Sixb,
|
|
965
966
|
SixbDefinitions,
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { type BlobStorage, supportsDirectUpload } from "../blob-storage"
|
|
1
2
|
import type { OntologyOutboxDispatcher } from "../events"
|
|
2
|
-
import
|
|
3
|
+
import {
|
|
4
|
+
type FileUploadSession,
|
|
5
|
+
FileUploadSessionError,
|
|
6
|
+
type FileUploadSessionStore,
|
|
7
|
+
type Storage,
|
|
8
|
+
} from "../storage"
|
|
3
9
|
import type {
|
|
4
10
|
OntologyMaintenanceCleanupSnapshot,
|
|
5
11
|
OntologyMaintenanceHandle,
|
|
@@ -14,11 +20,17 @@ const DEFAULT_CLEANUP_LIMIT = 1_000
|
|
|
14
20
|
const DEFAULT_SHUTDOWN_TIMEOUT_MS = 30_000
|
|
15
21
|
const DEGRADED_ATTEMPT_THRESHOLD = 3
|
|
16
22
|
const DEGRADED_FAILURE_THRESHOLD = 2
|
|
23
|
+
// A request that passed the expiry gate may still be finishing blob I/O, and the API clock may
|
|
24
|
+
// run ahead of the database's; the sweep leaves sessions alone until this long past expiry.
|
|
25
|
+
const ABANDONED_UPLOAD_SWEEP_DELAY_MS = 5 * 60_000
|
|
26
|
+
const ABANDONED_UPLOAD_ABORT_GRACE_MS = 15 * 60_000
|
|
17
27
|
|
|
18
28
|
interface OntologyMaintenanceDependencies {
|
|
19
29
|
readonly projectId: string
|
|
20
30
|
readonly storage: Storage
|
|
21
31
|
readonly dispatcher: OntologyOutboxDispatcher
|
|
32
|
+
/** Aborts the provider side of abandoned staged uploads. */
|
|
33
|
+
readonly blobStorage?: BlobStorage
|
|
22
34
|
readonly options?: OntologyMaintenanceOptions
|
|
23
35
|
readonly now?: () => Date
|
|
24
36
|
readonly onError?: (error: unknown) => void
|
|
@@ -29,6 +41,7 @@ export class OntologyMaintenance {
|
|
|
29
41
|
private readonly projectId: string
|
|
30
42
|
private readonly storage: Storage
|
|
31
43
|
private readonly dispatcher: OntologyOutboxDispatcher
|
|
44
|
+
private readonly blobStorage: BlobStorage | undefined
|
|
32
45
|
private readonly intervalMs: number
|
|
33
46
|
private readonly publishedOutboxRetentionMs: number
|
|
34
47
|
private readonly terminalSourceRetentionMs: number
|
|
@@ -48,6 +61,7 @@ export class OntologyMaintenance {
|
|
|
48
61
|
this.projectId = dependencies.projectId
|
|
49
62
|
this.storage = dependencies.storage
|
|
50
63
|
this.dispatcher = dependencies.dispatcher
|
|
64
|
+
this.blobStorage = dependencies.blobStorage
|
|
51
65
|
this.intervalMs = positiveInteger(options.intervalMs ?? DEFAULT_INTERVAL_MS, "intervalMs")
|
|
52
66
|
this.publishedOutboxRetentionMs = nonnegativeInteger(
|
|
53
67
|
options.publishedOutboxRetentionMs ?? DEFAULT_RETENTION_MS,
|
|
@@ -174,6 +188,12 @@ export class OntologyMaintenance {
|
|
|
174
188
|
failures,
|
|
175
189
|
{ rowsDeleted: 0, materializationsDeleted: 0 }
|
|
176
190
|
)
|
|
191
|
+
const uploads = this.storage.fileUploadSessions
|
|
192
|
+
if (uploads) {
|
|
193
|
+
// Retire abandoned uploads first: the store never reaps one that is still pending.
|
|
194
|
+
await captureFailure(() => this.retireAbandonedUploads(uploads, started, failures), failures)
|
|
195
|
+
await captureFailure(() => uploads.cleanupExpired(started), failures, 0)
|
|
196
|
+
}
|
|
177
197
|
|
|
178
198
|
return {
|
|
179
199
|
publishedOutboxRowsDeleted,
|
|
@@ -182,6 +202,62 @@ export class OntologyMaintenance {
|
|
|
182
202
|
}
|
|
183
203
|
}
|
|
184
204
|
|
|
205
|
+
private async retireAbandonedUploads(
|
|
206
|
+
uploads: FileUploadSessionStore,
|
|
207
|
+
now: Date,
|
|
208
|
+
failures: unknown[]
|
|
209
|
+
): Promise<void> {
|
|
210
|
+
const abandoned = await uploads.listAbandoned({
|
|
211
|
+
projectId: this.projectId,
|
|
212
|
+
now: new Date(now.getTime() - ABANDONED_UPLOAD_SWEEP_DELAY_MS),
|
|
213
|
+
limit: this.cleanupLimit,
|
|
214
|
+
})
|
|
215
|
+
for (const session of abandoned) {
|
|
216
|
+
await captureFailure(() => this.retireAbandonedUpload(uploads, session, now), failures)
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Releases one abandoned upload's provider-side parts, then makes its row terminal so
|
|
222
|
+
* `cleanupExpired` can reap it. Throwing records a pass failure and moves on to the next.
|
|
223
|
+
*/
|
|
224
|
+
private async retireAbandonedUpload(
|
|
225
|
+
uploads: FileUploadSessionStore,
|
|
226
|
+
session: FileUploadSession,
|
|
227
|
+
now: Date
|
|
228
|
+
): Promise<void> {
|
|
229
|
+
const blobStorage = this.blobStorage
|
|
230
|
+
const providerUpload = session.providerUpload
|
|
231
|
+
let abortFailure: unknown
|
|
232
|
+
if (providerUpload && blobStorage && supportsDirectUpload(blobStorage)) {
|
|
233
|
+
try {
|
|
234
|
+
await blobStorage.abortUpload({
|
|
235
|
+
uploadId: session.id,
|
|
236
|
+
stagingKey: providerUpload.stagingKey,
|
|
237
|
+
...(providerUpload.providerUploadId === undefined
|
|
238
|
+
? {}
|
|
239
|
+
: { providerUploadId: providerUpload.providerUploadId }),
|
|
240
|
+
})
|
|
241
|
+
} catch (error) {
|
|
242
|
+
// Retry on later passes for a bounded time. After that the bucket lifecycle rule owns
|
|
243
|
+
// the parts: a row that can never be aborted would hold a slot in every pass's limit.
|
|
244
|
+
if (now.getTime() - session.expiresAt.getTime() < ABANDONED_UPLOAD_ABORT_GRACE_MS)
|
|
245
|
+
throw error
|
|
246
|
+
abortFailure = error
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
try {
|
|
251
|
+
await uploads.abort(session.id)
|
|
252
|
+
} catch (error) {
|
|
253
|
+
// Another API instance's pass retired it first.
|
|
254
|
+
if (!(error instanceof FileUploadSessionError && error.reason === "already_aborted")) {
|
|
255
|
+
throw error
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (abortFailure !== undefined) throw abortFailure
|
|
259
|
+
}
|
|
260
|
+
|
|
185
261
|
private async readOperationalSummaries(failures: unknown[]): Promise<{
|
|
186
262
|
readonly outbox: OntologyMaintenanceSnapshot["outbox"]
|
|
187
263
|
readonly terminalSources: OntologyMaintenanceSnapshot["terminalSources"]
|
|
@@ -1,20 +1,45 @@
|
|
|
1
|
-
import type { EventActor } from "../events/envelope"
|
|
2
1
|
import type { LinkDeletedEventPayload, LinkMutationEventPayload } from "../events/types/links"
|
|
3
2
|
import type { ObjectDeletedEventPayload, ObjectMutationEventPayload } from "../events/types/objects"
|
|
4
3
|
import type { TelemetryAppendedEventPayload } from "../events/types/telemetry"
|
|
4
|
+
import type {
|
|
5
|
+
AuthorizablePrincipal,
|
|
6
|
+
KernelOperation,
|
|
7
|
+
TrustedPrimitiveKind,
|
|
8
|
+
} from "../execution/types"
|
|
5
9
|
import type { JsonValue } from "../json"
|
|
6
10
|
import type {
|
|
7
11
|
OntologyMaterializationOrigin,
|
|
8
12
|
OntologyMaterializationPropertyChangeMap,
|
|
9
13
|
} from "./model"
|
|
10
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Workload that made an ontology change, copied from its execution.
|
|
17
|
+
*
|
|
18
|
+
* It names what ran; `requestedBy` names on whose behalf. A primitive carries its definition id so
|
|
19
|
+
* a consumer can tell which workflow, sync, or webhook wrote without reading the run. An Agent
|
|
20
|
+
* `runId` is its Agent run, or the step run of a Workflow Agent step.
|
|
21
|
+
*/
|
|
22
|
+
export type EventExecutor =
|
|
23
|
+
| { readonly type: "request"; readonly requestId: string }
|
|
24
|
+
| {
|
|
25
|
+
readonly type: "primitive"
|
|
26
|
+
readonly kind: TrustedPrimitiveKind
|
|
27
|
+
readonly id: string
|
|
28
|
+
readonly runId: string
|
|
29
|
+
}
|
|
30
|
+
| { readonly type: "agent"; readonly runId: string }
|
|
31
|
+
| { readonly type: "kernel"; readonly operation: KernelOperation }
|
|
32
|
+
|
|
11
33
|
interface OntologyMaterializationEventBase {
|
|
12
34
|
readonly id: string
|
|
13
35
|
readonly schemaVersion: 1
|
|
14
36
|
readonly projectId: string
|
|
15
37
|
readonly occurredAt: string
|
|
16
38
|
readonly correlationId: string
|
|
17
|
-
|
|
39
|
+
/** Principal on whose behalf the write ran; absent for automatic or anonymous work. */
|
|
40
|
+
readonly requestedBy?: AuthorizablePrincipal
|
|
41
|
+
/** Workload that made the write. */
|
|
42
|
+
readonly executor: EventExecutor
|
|
18
43
|
readonly origin: OntologyMaterializationOrigin
|
|
19
44
|
readonly commitId: string
|
|
20
45
|
readonly commitOrdinal: number
|
|
@@ -51,6 +51,8 @@ Materializer -> semantic planning and cross-store transaction orchestration
|
|
|
51
51
|
|
|
52
52
|
Every ontology commit references its immutable execution through `executionId`. Storage providers enforce that reference. `origin` remains the semantic idempotency and run-correlation key: it says which runtime request, Action, projection replacement, or telemetry batch the commit represents; the execution says under which durable authority it ran. Neither field duplicates the other.
|
|
53
53
|
|
|
54
|
+
A commit and each of its events also carry a copy of two execution facts, so consumers can answer "who changed this" without reading the execution: `requestedBy`, the principal on whose behalf the execution chain runs (absent for automatic, anonymous, or auth-disabled work), and `executor`, the request, primitive run, Agent run, or kernel operation that wrote. Both are derived from the bound scope in `execution/scope.ts`, which is already proven identical to the durable record, so they are a pure function of `executionId` and never caller input. Authority is deliberately not copied: it stays on the execution's `authorizationRef`. Header validation requires an Action or projection origin to name the exact primitive run in `executor`, and provider work requires every event to carry its commit's attribution.
|
|
55
|
+
|
|
54
56
|
Run records do not duplicate ontology commit ids or semantic commit history. Replacement projections need no resume checkpoint; projection telemetry stores only its next batch/row checkpoint on the run.
|
|
55
57
|
|
|
56
58
|
Logical origins are unique in the ontology ledger: one commit per Action run, one per replacement
|
|
@@ -34,6 +34,7 @@ import { compileEditExecutionUnits, type EditExecutionUnit } from "./execution-u
|
|
|
34
34
|
import { loadEditWorkingState } from "./load-state"
|
|
35
35
|
import { applyEditOperation, type EditUndoJournal, undoEditJournal } from "./operations"
|
|
36
36
|
import { stageEditPlan } from "./plan"
|
|
37
|
+
import { loadReferencedUsers, type ReferencedUsers } from "./user-refs"
|
|
37
38
|
import { authorizeVectorIndexingCommit } from "./vector-authority"
|
|
38
39
|
import { commitVectorWrites } from "./vectors"
|
|
39
40
|
import type { EditWorkingState } from "./working-state"
|
|
@@ -45,20 +46,22 @@ interface PreparedEditCommit {
|
|
|
45
46
|
readonly identity: TimedCommitIdentity
|
|
46
47
|
readonly origin: OntologyMaterializationOrigin
|
|
47
48
|
readonly execution: MaterializerExecution
|
|
49
|
+
/** Read before the transaction opens; see `user-refs.ts`. */
|
|
50
|
+
readonly users: ReferencedUsers
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
export async function commitEdits(
|
|
51
54
|
context: MaterializerContext,
|
|
52
55
|
raw: MaterializerCommand<OntologyEditCommit>
|
|
53
56
|
): Promise<EditCommitResult> {
|
|
54
|
-
const command = prepareEditCommit(context, raw)
|
|
57
|
+
const command = await prepareEditCommit(context, raw)
|
|
55
58
|
return executeEditCommit(context, command)
|
|
56
59
|
}
|
|
57
60
|
|
|
58
|
-
function prepareEditCommit(
|
|
59
|
-
context: Pick<MaterializerContext, "projectId" | "clock">,
|
|
61
|
+
async function prepareEditCommit(
|
|
62
|
+
context: Pick<MaterializerContext, "projectId" | "clock" | "ontology" | "storage">,
|
|
60
63
|
raw: MaterializerCommand<OntologyEditCommit>
|
|
61
|
-
): PreparedEditCommit {
|
|
64
|
+
): Promise<PreparedEditCommit> {
|
|
62
65
|
const input = normalizeOntologyEditCommit(raw.input)
|
|
63
66
|
const idempotencyKey = editIdempotencyKey(input)
|
|
64
67
|
const identity = createTimedCommitIdentity({
|
|
@@ -72,6 +75,7 @@ function prepareEditCommit(
|
|
|
72
75
|
identity,
|
|
73
76
|
origin: input.source,
|
|
74
77
|
execution: prepareMaterializerExecution(context.projectId, raw.scope),
|
|
78
|
+
users: await loadReferencedUsers(context, input.operations),
|
|
75
79
|
}
|
|
76
80
|
}
|
|
77
81
|
|
|
@@ -226,13 +230,14 @@ function buildEditCommit(
|
|
|
226
230
|
context: Pick<MaterializerContext, "projectId" | "projectionRegistry">,
|
|
227
231
|
command: PreparedEditCommit
|
|
228
232
|
): OntologyCommitWrite {
|
|
229
|
-
|
|
233
|
+
return {
|
|
230
234
|
projectId: context.projectId,
|
|
231
235
|
id: command.identity.commitId,
|
|
232
236
|
idempotencyKey: command.identity.idempotencyKey,
|
|
233
237
|
requestHash: command.identity.requestHash,
|
|
234
238
|
executionId: command.execution.executionId,
|
|
235
239
|
origin: command.origin,
|
|
240
|
+
...command.execution.attribution,
|
|
236
241
|
ontologyRevision: context.projectionRegistry.ontologyRevision,
|
|
237
242
|
intent: {
|
|
238
243
|
kind: "edit",
|
|
@@ -244,8 +249,6 @@ function buildEditCommit(
|
|
|
244
249
|
},
|
|
245
250
|
committedAt: command.identity.committedAt,
|
|
246
251
|
}
|
|
247
|
-
if (command.execution.actor === undefined) return commit
|
|
248
|
-
return { ...commit, actor: command.execution.actor }
|
|
249
252
|
}
|
|
250
253
|
|
|
251
254
|
function editExpectations(input: NormalizedEditCommit) {
|
|
@@ -291,7 +294,7 @@ function applyOneEditOperation(
|
|
|
291
294
|
command: PreparedEditCommit
|
|
292
295
|
): OntologyOperationOutcome {
|
|
293
296
|
try {
|
|
294
|
-
return applyEditOperation(context, state, operation, command.identity)
|
|
297
|
+
return applyEditOperation(context, state, operation, command.identity, command.users)
|
|
295
298
|
} catch (error) {
|
|
296
299
|
if (!isRecoverableEditValidation(command.input, error)) throw error
|
|
297
300
|
return { id: operation.id, ok: false, error: { code: "validation", message: error.message } }
|
|
@@ -317,7 +320,14 @@ function applyEditOperationGroup(
|
|
|
317
320
|
for (const operation of group) {
|
|
318
321
|
let outcome: OntologyOperationOutcome
|
|
319
322
|
try {
|
|
320
|
-
outcome = applyEditOperation(
|
|
323
|
+
outcome = applyEditOperation(
|
|
324
|
+
context,
|
|
325
|
+
state,
|
|
326
|
+
operation,
|
|
327
|
+
command.identity,
|
|
328
|
+
command.users,
|
|
329
|
+
journal
|
|
330
|
+
)
|
|
321
331
|
} catch (error) {
|
|
322
332
|
if (!isRecoverableEditValidation(command.input, error)) throw error
|
|
323
333
|
undoEditJournal(journal)
|
|
@@ -353,13 +363,12 @@ function isRecoverableEditValidation(
|
|
|
353
363
|
}
|
|
354
364
|
|
|
355
365
|
function editPlanContext(command: PreparedEditCommit) {
|
|
356
|
-
|
|
366
|
+
return {
|
|
357
367
|
identity: command.identity,
|
|
358
368
|
origin: command.origin,
|
|
359
369
|
correlationId: command.execution.correlationId,
|
|
370
|
+
attribution: command.execution.attribution,
|
|
360
371
|
}
|
|
361
|
-
if (command.execution.actor === undefined) return context
|
|
362
|
-
return { ...context, actor: command.execution.actor }
|
|
363
372
|
}
|
|
364
373
|
|
|
365
374
|
async function finalizeEditMaterialization(
|
|
@@ -4,6 +4,7 @@ import type { OntologyEditOperation, OntologyOperationOutcome } from "../../mate
|
|
|
4
4
|
import { linkRefKey, linkScopeKey, objectRefKey } from "../../materialization/refs"
|
|
5
5
|
import type { MaterializerContext } from "../context"
|
|
6
6
|
import { diffEffectiveObject } from "../effective/diff"
|
|
7
|
+
import type { ResolvedObjectValue } from "../effective/resolve"
|
|
7
8
|
import {
|
|
8
9
|
validateEffectiveObject,
|
|
9
10
|
validateLinkAuthorityProperties,
|
|
@@ -15,6 +16,7 @@ import {
|
|
|
15
16
|
import type { TimedCommitIdentity } from "../shared/identity"
|
|
16
17
|
import { applyLinkEdit, applyObjectEdit } from "./apply"
|
|
17
18
|
import { linkCardinality } from "./read-set"
|
|
19
|
+
import { assertIntroducedUsersActive, type ReferencedUsers } from "./user-refs"
|
|
18
20
|
import {
|
|
19
21
|
type EditWorkingState,
|
|
20
22
|
resolveLinkEdge,
|
|
@@ -53,11 +55,12 @@ export function applyEditOperation(
|
|
|
53
55
|
state: EditWorkingState,
|
|
54
56
|
operation: OntologyEditOperation,
|
|
55
57
|
identity: TimedCommitIdentity,
|
|
58
|
+
users: ReferencedUsers,
|
|
56
59
|
journal?: EditUndoJournal
|
|
57
60
|
): OntologyOperationOutcome {
|
|
58
61
|
validateOperationRef(context, operation)
|
|
59
62
|
if (isObjectOperation(operation)) {
|
|
60
|
-
return applyObjectOperation(context, state, operation, identity, journal)
|
|
63
|
+
return applyObjectOperation(context, state, operation, identity, users, journal)
|
|
61
64
|
}
|
|
62
65
|
return applyLinkOperation(
|
|
63
66
|
context,
|
|
@@ -84,6 +87,7 @@ function applyObjectOperation(
|
|
|
84
87
|
state: EditWorkingState,
|
|
85
88
|
operation: ObjectOperation,
|
|
86
89
|
identity: TimedCommitIdentity,
|
|
90
|
+
users: ReferencedUsers,
|
|
87
91
|
journal?: EditUndoJournal
|
|
88
92
|
): OntologyOperationOutcome {
|
|
89
93
|
const working = requireWorkingObject(state, operation)
|
|
@@ -99,7 +103,27 @@ function applyObjectOperation(
|
|
|
99
103
|
...normalized,
|
|
100
104
|
})
|
|
101
105
|
|
|
102
|
-
|
|
106
|
+
// Restore brings back values the object already held; only caller-written values are new.
|
|
107
|
+
const assertUsers =
|
|
108
|
+
operation.kind === "object.restore"
|
|
109
|
+
? undefined
|
|
110
|
+
: (resolved: ResolvedObjectValue) =>
|
|
111
|
+
assertIntroducedUsersActive(
|
|
112
|
+
context.ontology,
|
|
113
|
+
operation.ref.objectTypeId,
|
|
114
|
+
currentEffective?.properties,
|
|
115
|
+
resolved.properties,
|
|
116
|
+
users
|
|
117
|
+
)
|
|
118
|
+
applyObjectTransition(
|
|
119
|
+
context,
|
|
120
|
+
state,
|
|
121
|
+
working,
|
|
122
|
+
transition.next,
|
|
123
|
+
transition.editedAt,
|
|
124
|
+
journal,
|
|
125
|
+
assertUsers
|
|
126
|
+
)
|
|
103
127
|
|
|
104
128
|
return objectOperationOutcome(operation, working, transition.changed, context, identity)
|
|
105
129
|
}
|
|
@@ -149,7 +173,8 @@ function applyObjectTransition(
|
|
|
149
173
|
working: WorkingObject,
|
|
150
174
|
next: WorkingObject["override"],
|
|
151
175
|
nextEditedAt: Readonly<Record<string, string>>,
|
|
152
|
-
journal?: EditUndoJournal
|
|
176
|
+
journal?: EditUndoJournal,
|
|
177
|
+
validateResolved?: (resolved: ResolvedObjectValue) => void
|
|
153
178
|
): void {
|
|
154
179
|
const previous = working.override
|
|
155
180
|
const previousEditedAt = working.editedAt
|
|
@@ -157,7 +182,10 @@ function applyObjectTransition(
|
|
|
157
182
|
working.editedAt = { ...nextEditedAt }
|
|
158
183
|
try {
|
|
159
184
|
const resolved = resolveObject(context.ontology, working)
|
|
160
|
-
if (resolved)
|
|
185
|
+
if (resolved) {
|
|
186
|
+
validateEffectiveObject(context.ontology, resolved.ref, resolved.properties)
|
|
187
|
+
validateResolved?.(resolved)
|
|
188
|
+
}
|
|
161
189
|
validateWorkingCardinality(state.links.slots)
|
|
162
190
|
} catch (error) {
|
|
163
191
|
working.override = previous
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { EventActor } from "../../events/envelope"
|
|
2
1
|
import type {
|
|
3
2
|
EffectiveLinkChange,
|
|
4
3
|
EffectiveObjectChange,
|
|
@@ -27,6 +26,7 @@ import {
|
|
|
27
26
|
} from "../effective/build-events"
|
|
28
27
|
import { diffEffectiveLink, diffEffectiveLinkSlot, diffEffectiveObject } from "../effective/diff"
|
|
29
28
|
import { validateEffectiveObject } from "../effective/validate"
|
|
29
|
+
import type { MaterializerAttribution } from "../execution/scope"
|
|
30
30
|
import { stageWorkBounded } from "../execution/work-executor"
|
|
31
31
|
import {
|
|
32
32
|
appendEffectiveLinkWork,
|
|
@@ -59,7 +59,7 @@ interface EditPlanContext {
|
|
|
59
59
|
readonly identity: TimedCommitIdentity
|
|
60
60
|
readonly origin: OntologyMaterializationOrigin
|
|
61
61
|
readonly correlationId: string
|
|
62
|
-
readonly
|
|
62
|
+
readonly attribution: MaterializerAttribution
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
export async function stageEditPlan(
|
|
@@ -237,15 +237,14 @@ function materializationEventContext(
|
|
|
237
237
|
context: Pick<MaterializerContext, "projectId">,
|
|
238
238
|
planContext: EditPlanContext
|
|
239
239
|
) {
|
|
240
|
-
|
|
240
|
+
return {
|
|
241
241
|
projectId: context.projectId,
|
|
242
242
|
commitId: planContext.identity.commitId,
|
|
243
243
|
committedAt: planContext.identity.committedAt,
|
|
244
244
|
origin: planContext.origin,
|
|
245
245
|
correlationId: planContext.correlationId,
|
|
246
|
+
attribution: planContext.attribution,
|
|
246
247
|
}
|
|
247
|
-
if (planContext.actor === undefined) return base
|
|
248
|
-
return { ...base, actor: planContext.actor }
|
|
249
248
|
}
|
|
250
249
|
|
|
251
250
|
function sortedObjects(objects: EditWorkingState["objects"]): WorkingObject[] {
|