@sixb/core 0.1.11 → 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/builders/params.d.ts +1 -22
- package/dist/actions/builders/params.d.ts.map +1 -1
- package/dist/actions/index.d.ts +2 -2
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +33 -30
- 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 +11 -44
- package/dist/actions/types/params.d.ts.map +1 -1
- package/dist/actions/validation.d.ts.map +1 -1
- package/dist/actions/worker.js +3 -2
- package/dist/actions/worker.js.map +2 -2
- package/dist/agents/errors.d.ts +1 -1
- package/dist/agents/errors.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +15 -9
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/ids.d.ts +2 -0
- package/dist/agents/ids.d.ts.map +1 -1
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +52 -44
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/sandbox.d.ts +5 -0
- package/dist/agents/sandbox.d.ts.map +1 -0
- package/dist/agents/streams/index.js +4 -3
- package/dist/agents/streams/index.js.map +1 -1
- package/dist/agents/streams/internal.js +4 -3
- package/dist/agents/streams/internal.js.map +1 -1
- package/dist/agents/validation.d.ts.map +1 -1
- 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 +15 -7
- 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 +5 -4
- package/dist/authorization/index.js.map +1 -1
- package/dist/bootstrap/index.d.ts +1 -1
- package/dist/bootstrap/index.d.ts.map +1 -1
- package/dist/bootstrap/index.js +54 -48
- 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-d63nnr5b.js → chunk-04h4t2b5.js} +39 -53
- package/dist/{chunk-d63nnr5b.js.map → chunk-04h4t2b5.js.map} +5 -6
- package/dist/chunk-2fv8sajb.js +84 -0
- package/dist/chunk-2fv8sajb.js.map +10 -0
- package/dist/{chunk-1yefycb1.js → chunk-2hbhn1ff.js} +2 -2
- package/dist/{chunk-ap0g1g74.js → chunk-3nx8vj5a.js} +43 -6
- package/dist/chunk-3nx8vj5a.js.map +12 -0
- package/dist/{chunk-wjasrj67.js → chunk-3qpcrcj8.js} +1 -1
- package/dist/{chunk-0y39rgsb.js → chunk-4tnrzqqh.js} +1 -1
- package/dist/chunk-58geavnf.js +29 -0
- package/dist/chunk-58geavnf.js.map +10 -0
- package/dist/{chunk-01kj2pbh.js → chunk-63fp9x3q.js} +97 -67
- package/dist/chunk-63fp9x3q.js.map +20 -0
- package/dist/{chunk-7bs40fe1.js → chunk-69266efg.js} +83 -2
- package/dist/chunk-69266efg.js.map +12 -0
- package/dist/{chunk-sepyxgpc.js → chunk-693f3zn8.js} +70 -28
- 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-c5rkjrgp.js → chunk-7ytf06d3.js} +1 -1
- package/dist/{chunk-a0e6x5hd.js → chunk-898y24dd.js} +165 -90
- package/dist/chunk-898y24dd.js.map +15 -0
- package/dist/{chunk-mrp7k0pw.js → chunk-91kcnbf0.js} +9 -14
- package/dist/chunk-91kcnbf0.js.map +10 -0
- package/dist/{chunk-z0s4axeh.js → chunk-91wthfwe.js} +97 -21
- package/dist/{chunk-z0s4axeh.js.map → chunk-91wthfwe.js.map} +8 -7
- package/dist/{chunk-yv79ncbv.js → chunk-96yw3pwd.js} +3 -3
- package/dist/chunk-96yw3pwd.js.map +10 -0
- package/dist/chunk-98cw09sw.js.map +2 -2
- package/dist/{chunk-g00bfdq6.js → chunk-9pfw47qx.js} +318 -257
- package/dist/chunk-9pfw47qx.js.map +44 -0
- package/dist/{chunk-5hz0fnca.js → chunk-a0073121.js} +64 -60
- package/dist/chunk-a0073121.js.map +12 -0
- package/dist/{chunk-cfvakeax.js → chunk-a69fkrtr.js} +5 -5
- package/dist/{chunk-72w2pxk7.js → chunk-bdhfn0ww.js} +11 -3
- package/dist/{chunk-72w2pxk7.js.map → chunk-bdhfn0ww.js.map} +3 -3
- package/dist/chunk-bep5rrdq.js +81 -0
- package/dist/chunk-bep5rrdq.js.map +10 -0
- package/dist/chunk-bxx3ms5t.js +29 -0
- package/dist/chunk-bxx3ms5t.js.map +10 -0
- package/dist/{chunk-v2vcg0w6.js → chunk-cbn96bve.js} +2 -2
- package/dist/{chunk-860dwwy0.js → chunk-cd234ba4.js} +22 -12
- package/dist/chunk-cd234ba4.js.map +14 -0
- package/dist/{chunk-gq8vhakp.js → chunk-cvrbhvtr.js} +292 -104
- package/dist/chunk-cvrbhvtr.js.map +46 -0
- package/dist/{chunk-ms2tmn1k.js → chunk-d8yes9yx.js} +355 -100
- package/dist/chunk-d8yes9yx.js.map +20 -0
- package/dist/{chunk-pr2h4bv4.js → chunk-darm7eeg.js} +9 -9
- package/dist/{chunk-pr2h4bv4.js.map → chunk-darm7eeg.js.map} +3 -3
- package/dist/chunk-dmn70ztd.js.map +2 -2
- package/dist/chunk-drz59ve0.js +57 -0
- package/dist/chunk-drz59ve0.js.map +10 -0
- package/dist/{chunk-skz0hst3.js → chunk-dsfw1bdr.js} +6 -86
- package/dist/{chunk-skz0hst3.js.map → chunk-dsfw1bdr.js.map} +3 -3
- package/dist/{chunk-g6cke204.js → chunk-f85hpqnm.js} +1 -1
- package/dist/{chunk-vsj3mdfj.js → chunk-fc5zfxy1.js} +1 -1
- package/dist/chunk-ffwvdgk1.js +85 -0
- package/dist/chunk-ffwvdgk1.js.map +10 -0
- package/dist/chunk-gbcrz0gr.js +552 -0
- package/dist/chunk-gbcrz0gr.js.map +17 -0
- package/dist/{chunk-gqm76kse.js → chunk-gc226ten.js} +434 -177
- package/dist/chunk-gc226ten.js.map +62 -0
- package/dist/{chunk-awbhdqyc.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-aa6z4a19.js → chunk-hgqpcmyr.js} +2 -1
- package/dist/chunk-hgqpcmyr.js.map +12 -0
- package/dist/{chunk-gqh45d2n.js → chunk-ht4a7mjg.js} +76 -6
- package/dist/chunk-ht4a7mjg.js.map +15 -0
- package/dist/{chunk-x9m9x2eq.js → chunk-jhyc777j.js} +3 -3
- package/dist/{chunk-fh8kgex1.js → chunk-jmwy25mf.js} +76 -58
- package/dist/{chunk-fh8kgex1.js.map → chunk-jmwy25mf.js.map} +3 -3
- package/dist/{chunk-rb1xx120.js → chunk-k4kkp58d.js} +25 -8
- package/dist/chunk-k4kkp58d.js.map +11 -0
- package/dist/{chunk-jsy70480.js → chunk-ky7zpbtt.js} +366 -98
- package/dist/chunk-ky7zpbtt.js.map +19 -0
- package/dist/chunk-m4ehq95f.js +9 -0
- package/dist/chunk-m4ehq95f.js.map +10 -0
- package/dist/{chunk-17kfctj6.js → chunk-m8zkvep1.js} +2 -2
- package/dist/{chunk-z0271qkp.js → chunk-mdnw7nj8.js} +8 -6
- package/dist/chunk-mdnw7nj8.js.map +15 -0
- package/dist/{chunk-4zhmdsx6.js → chunk-mf6hwpzh.js} +121 -28
- package/dist/{chunk-4zhmdsx6.js.map → chunk-mf6hwpzh.js.map} +6 -6
- package/dist/{chunk-z30bv4ga.js → chunk-mr60an99.js} +5 -3
- package/dist/{chunk-z30bv4ga.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-p1683c0v.js +104 -0
- package/dist/chunk-p1683c0v.js.map +11 -0
- package/dist/{chunk-9qsh3p5y.js → chunk-rb143ggb.js} +1 -1
- package/dist/{chunk-653vwrzr.js → chunk-rdghfsss.js} +1 -1
- package/dist/chunk-rdghfsss.js.map +10 -0
- package/dist/{chunk-ftv470j8.js → chunk-rqtdtm43.js} +365 -67
- package/dist/chunk-rqtdtm43.js.map +50 -0
- package/dist/{chunk-dz5h08xv.js → chunk-rzcjp5m2.js} +28 -9
- package/dist/chunk-rzcjp5m2.js.map +25 -0
- package/dist/{chunk-f4w3yp4f.js → chunk-rzkr70gr.js} +108 -21
- package/dist/chunk-rzkr70gr.js.map +13 -0
- package/dist/{chunk-3ckk0xfj.js → chunk-s24qbp32.js} +18 -13
- package/dist/{chunk-3ckk0xfj.js.map → chunk-s24qbp32.js.map} +3 -3
- package/dist/{chunk-f0rwz2vh.js → chunk-t6f3tdnr.js} +2 -54
- package/dist/chunk-t6f3tdnr.js.map +10 -0
- package/dist/{chunk-93csa55g.js → chunk-tw03bsmb.js} +11 -5
- package/dist/chunk-tw03bsmb.js.map +11 -0
- package/dist/chunk-vef6qa14.js +363 -0
- package/dist/chunk-vef6qa14.js.map +14 -0
- package/dist/{chunk-92vk7gta.js → chunk-vn3yh259.js} +1 -1
- package/dist/{chunk-g91qxjj0.js → chunk-w9bp61e7.js} +5 -5
- package/dist/{chunk-b19g04jk.js → chunk-xgptywp0.js} +4 -3
- package/dist/chunk-xgptywp0.js.map +11 -0
- package/dist/{chunk-g53f0e4j.js → chunk-xnx96gfy.js} +45 -17
- package/dist/{chunk-g53f0e4j.js.map → chunk-xnx96gfy.js.map} +3 -3
- package/dist/{chunk-1824gssz.js → chunk-y487ywrv.js} +4 -4
- package/dist/{chunk-7apz6hg4.js → chunk-y6vnvayj.js} +8 -4
- package/dist/chunk-y6vnvayj.js.map +10 -0
- package/dist/{chunk-wf88w4kp.js → chunk-ypj2wqtj.js} +3 -6
- package/dist/{chunk-wf88w4kp.js.map → chunk-ypj2wqtj.js.map} +4 -4
- package/dist/chunk-z3y5kg1x.js +14 -0
- package/dist/chunk-z3y5kg1x.js.map +10 -0
- package/dist/{chunk-38zv5rkr.js → chunk-z9h698s8.js} +1 -1
- package/dist/{chunk-38zv5rkr.js.map → chunk-z9h698s8.js.map} +2 -2
- package/dist/{chunk-8vj0rjgs.js → chunk-zdkcdshk.js} +3 -36
- package/dist/{chunk-8vj0rjgs.js.map → chunk-zdkcdshk.js.map} +3 -4
- package/dist/{chunk-358caqf5.js → chunk-znw0zvy4.js} +2 -2
- package/dist/datasets/validation.d.ts +4 -0
- package/dist/datasets/validation.d.ts.map +1 -1
- package/dist/datasets/write.d.ts.map +1 -1
- package/dist/datasets/write.js +5 -4
- package/dist/datasets/write.js.map +1 -1
- package/dist/edits/types.d.ts +19 -19
- package/dist/edits/types.d.ts.map +1 -1
- package/dist/error-reporting/capability.d.ts +3 -2
- package/dist/error-reporting/capability.d.ts.map +1 -1
- package/dist/error-reporting/internal.js +5 -4
- package/dist/error-reporting/internal.js.map +1 -1
- package/dist/error-reporting/reports.d.ts +10 -0
- package/dist/error-reporting/reports.d.ts.map +1 -1
- package/dist/error-reporting/types.d.ts +10 -2
- package/dist/error-reporting/types.d.ts.map +1 -1
- package/dist/errors/catalog.d.ts +16 -0
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/errors/failure-message.d.ts +8 -0
- package/dist/errors/failure-message.d.ts.map +1 -0
- package/dist/errors/internal.d.ts.map +1 -1
- package/dist/errors/internal.js +3 -2
- package/dist/errors/internal.js.map +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 +5 -4
- package/dist/events/index.js.map +1 -1
- 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 +48 -43
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorization.d.ts.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts +3 -0
- package/dist/execution/authorized-object-reader.d.ts.map +1 -1
- package/dist/execution/kernel-operation.d.ts +4 -0
- package/dist/execution/kernel-operation.d.ts.map +1 -0
- package/dist/execution/primitive.d.ts +1 -2
- package/dist/execution/primitive.d.ts.map +1 -1
- package/dist/execution/primitive.js +47 -42
- 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 +48 -43
- package/dist/execution/request.js.map +3 -3
- package/dist/execution/types.d.ts +6 -0
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/index.d.ts +20 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +77 -62
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/in-memory.d.ts.map +1 -1
- package/dist/lake-storage/index.js +5 -4
- package/dist/lake-storage/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 +4 -2
- 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/materialization/index.d.ts +1 -0
- package/dist/materialization/index.d.ts.map +1 -1
- package/dist/materialization/index.js +3 -3
- package/dist/materialization/model.d.ts +2 -0
- package/dist/materialization/model.d.ts.map +1 -1
- package/dist/materialization/vectors.d.ts +19 -0
- package/dist/materialization/vectors.d.ts.map +1 -0
- package/dist/materializer/context.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/edits/vector-authority.d.ts +6 -0
- package/dist/materializer/edits/vector-authority.d.ts.map +1 -0
- package/dist/materializer/edits/vectors.d.ts +6 -0
- package/dist/materializer/edits/vectors.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/effective/validate.d.ts.map +1 -1
- package/dist/materializer/effective/vector-indexing.d.ts +7 -0
- package/dist/materializer/effective/vector-indexing.d.ts.map +1 -0
- package/dist/materializer/effective/vectors.d.ts +6 -0
- package/dist/materializer/effective/vectors.d.ts.map +1 -0
- package/dist/materializer/execution/scope.d.ts +11 -3
- package/dist/materializer/execution/scope.d.ts.map +1 -1
- package/dist/materializer/execution/work-executor.d.ts +2 -1
- package/dist/materializer/execution/work-executor.d.ts.map +1 -1
- package/dist/materializer/index.js +30 -27
- 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/shared/normalize.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/catalog-index.d.ts +15 -0
- package/dist/models/catalog-index.d.ts.map +1 -0
- package/dist/models/catalog.d.ts +27 -6
- package/dist/models/catalog.d.ts.map +1 -1
- package/dist/models/decision/catalog.d.ts +12 -0
- package/dist/models/decision/catalog.d.ts.map +1 -0
- package/dist/models/decision/errors.d.ts +7 -0
- package/dist/models/decision/errors.d.ts.map +1 -0
- package/dist/models/decision/output.d.ts +50 -0
- package/dist/models/decision/output.d.ts.map +1 -0
- package/dist/models/decision/questions.d.ts +14 -0
- package/dist/models/decision/questions.d.ts.map +1 -0
- package/dist/models/decision/runtime.d.ts +7 -0
- package/dist/models/decision/runtime.d.ts.map +1 -0
- package/dist/models/decision/types.d.ts +92 -0
- package/dist/models/decision/types.d.ts.map +1 -0
- package/dist/models/decision/validation.d.ts +7 -0
- package/dist/models/decision/validation.d.ts.map +1 -0
- package/dist/models/definitions.d.ts +1 -1
- package/dist/models/definitions.d.ts.map +1 -1
- package/dist/models/embedding-model.d.ts +60 -0
- package/dist/models/embedding-model.d.ts.map +1 -0
- package/dist/models/execution/binding.d.ts +2 -0
- package/dist/models/execution/binding.d.ts.map +1 -1
- package/dist/models/execution/embedding.d.ts +5 -0
- package/dist/models/execution/embedding.d.ts.map +1 -0
- package/dist/models/execution/index.js +32 -27
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/execution/model-call-recorder.d.ts +5 -1
- package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
- package/dist/models/execution/session.d.ts +21 -0
- package/dist/models/execution/session.d.ts.map +1 -0
- package/dist/models/execution.d.ts.map +1 -1
- package/dist/models/generation-types.d.ts +2 -0
- package/dist/models/generation-types.d.ts.map +1 -1
- package/dist/models/index.d.ts +9 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +17 -7
- package/dist/models/index.js.map +1 -1
- package/dist/models/pricing.d.ts +3 -2
- package/dist/models/pricing.d.ts.map +1 -1
- package/dist/objects/authorized-ontology-view.d.ts.map +1 -1
- package/dist/objects/execution.d.ts +21 -26
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +33 -30
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/executor.d.ts +3 -0
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/index.d.ts +2 -0
- package/dist/objects/query/index.d.ts.map +1 -1
- package/dist/objects/query/index.js +42 -30
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/ir.d.ts +14 -3
- package/dist/objects/query/ir.d.ts.map +1 -1
- package/dist/objects/query/normalize.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 +6 -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/query-executor.d.ts +2 -0
- package/dist/objects/sdk/query-executor.d.ts.map +1 -1
- package/dist/objects/sdk/runtime-query-executor.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/objects/vectors/handle.d.ts +4 -0
- package/dist/objects/vectors/handle.d.ts.map +1 -0
- package/dist/objects/vectors/indexing-batch.d.ts +6 -0
- package/dist/objects/vectors/indexing-batch.d.ts.map +1 -0
- package/dist/objects/vectors/indexing-generate.d.ts +11 -0
- package/dist/objects/vectors/indexing-generate.d.ts.map +1 -0
- package/dist/objects/vectors/indexing-runtime.d.ts +7 -0
- package/dist/objects/vectors/indexing-runtime.d.ts.map +1 -0
- package/dist/objects/vectors/indexing-shared.d.ts +17 -0
- package/dist/objects/vectors/indexing-shared.d.ts.map +1 -0
- package/dist/objects/vectors/indexing-single.d.ts +4 -0
- package/dist/objects/vectors/indexing-single.d.ts.map +1 -0
- package/dist/objects/vectors/indexing-store-batch.d.ts +6 -0
- package/dist/objects/vectors/indexing-store-batch.d.ts.map +1 -0
- package/dist/objects/vectors/indexing.d.ts +7 -0
- package/dist/objects/vectors/indexing.d.ts.map +1 -0
- package/dist/objects/vectors/profile.d.ts +13 -0
- package/dist/objects/vectors/profile.d.ts.map +1 -0
- package/dist/objects/vectors/query.d.ts +5 -0
- package/dist/objects/vectors/query.d.ts.map +1 -0
- package/dist/objects/vectors/resolve-query.d.ts +6 -0
- package/dist/objects/vectors/resolve-query.d.ts.map +1 -0
- package/dist/objects/vectors/types.d.ts +11 -0
- package/dist/objects/vectors/types.d.ts.map +1 -0
- package/dist/ontology/builders.d.ts +11 -10
- package/dist/ontology/builders.d.ts.map +1 -1
- package/dist/ontology/index.d.ts +5 -2
- package/dist/ontology/index.d.ts.map +1 -1
- package/dist/ontology/index.js +7 -5
- 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 +10 -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 +26 -13
- 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 +3 -0
- package/dist/ontology/validation/definition.d.ts.map +1 -0
- 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 +1 -1
- package/dist/ontology/validation/schema.d.ts.map +1 -1
- package/dist/ontology/vector-profiles.d.ts +4 -0
- package/dist/ontology/vector-profiles.d.ts.map +1 -0
- package/dist/pipelines/index.js +32 -29
- 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 +28 -25
- 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 +3 -2
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/index.js +1 -1
- package/dist/queues/types.d.ts +5 -0
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/create.d.ts +4 -3
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +10 -7
- 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.d.ts +3 -0
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +49 -1
- package/dist/runtime/internal.js.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/sixb.d.ts +11 -6
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +182 -187
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/sandboxes/auth.d.ts +16 -0
- package/dist/sandboxes/auth.d.ts.map +1 -0
- package/dist/sandboxes/config.d.ts +5 -0
- package/dist/sandboxes/config.d.ts.map +1 -0
- package/dist/sandboxes/configuration.d.ts +41 -0
- package/dist/sandboxes/configuration.d.ts.map +1 -0
- package/dist/sandboxes/environment.d.ts +13 -0
- package/dist/sandboxes/environment.d.ts.map +1 -0
- package/dist/sandboxes/errors.d.ts +1 -1
- package/dist/sandboxes/errors.d.ts.map +1 -1
- package/dist/sandboxes/index.d.ts +6 -1
- package/dist/sandboxes/index.d.ts.map +1 -1
- package/dist/sandboxes/index.js +16 -3
- package/dist/sandboxes/index.js.map +1 -1
- package/dist/sandboxes/sandbox.d.ts +39 -4
- package/dist/sandboxes/sandbox.d.ts.map +1 -1
- package/dist/shared/params/builders.d.ts +25 -0
- package/dist/shared/params/builders.d.ts.map +1 -0
- package/dist/shared/params/types.d.ts +48 -0
- package/dist/shared/params/types.d.ts.map +1 -0
- package/dist/shared/params/user-refs.d.ts +19 -0
- package/dist/shared/params/user-refs.d.ts.map +1 -0
- package/dist/shared/params/validation.d.ts +15 -0
- package/dist/shared/params/validation.d.ts.map +1 -0
- package/dist/shares/compiler.d.ts.map +1 -1
- package/dist/shares/internal.js +29 -26
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/action-runs/failure.js +4 -3
- package/dist/storage/action-runs/failure.js.map +1 -1
- package/dist/storage/action-runs/provider.js +1 -1
- 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/in-memory.d.ts +2 -1
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +1 -1
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts +5 -1
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +8 -4
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +49 -0
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/analytics.d.ts +1 -0
- package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
- package/dist/storage/ai-cost/index.d.ts +1 -1
- package/dist/storage/ai-cost/index.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +2 -2
- package/dist/storage/ai-cost/types.d.ts +14 -2
- package/dist/storage/ai-cost/types.d.ts.map +1 -1
- package/dist/storage/ai-limits/enforcement.js +4 -3
- package/dist/storage/ai-limits/enforcement.js.map +1 -1
- 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 +3 -2
- package/dist/storage/connector-connections/provider.js.map +2 -2
- 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 +13 -11
- package/dist/storage/executions/provider.js.map +3 -3
- package/dist/storage/executions/types.d.ts +3 -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/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 +8 -6
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +37 -30
- 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/objects/in-memory/read-source.d.ts +5 -0
- package/dist/storage/objects/in-memory/read-source.d.ts.map +1 -1
- package/dist/storage/objects/in-memory/selected-reader.d.ts.map +1 -1
- package/dist/storage/objects/in-memory/storage.d.ts +7 -0
- package/dist/storage/objects/in-memory/storage.d.ts.map +1 -1
- package/dist/storage/objects/types.d.ts +2 -0
- package/dist/storage/objects/types.d.ts.map +1 -1
- package/dist/storage/ontology/commits.d.ts +7 -2
- package/dist/storage/ontology/commits.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/index.d.ts +4 -0
- package/dist/storage/ontology/in-memory/index.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/materializations.d.ts +2 -0
- package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/shared-state.d.ts +7 -0
- package/dist/storage/ontology/in-memory/shared-state.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/vector-indexing.d.ts +44 -0
- package/dist/storage/ontology/in-memory/vector-indexing.d.ts.map +1 -0
- package/dist/storage/ontology/in-memory/vectors.d.ts +31 -0
- package/dist/storage/ontology/in-memory/vectors.d.ts.map +1 -0
- package/dist/storage/ontology/index.d.ts +6 -0
- package/dist/storage/ontology/index.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 +9 -3
- package/dist/storage/ontology/provider.js.map +1 -1
- package/dist/storage/ontology/vector-indexing.d.ts +94 -0
- package/dist/storage/ontology/vector-indexing.d.ts.map +1 -0
- package/dist/storage/ontology/vectors.d.ts +56 -0
- package/dist/storage/ontology/vectors.d.ts.map +1 -0
- 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 +4 -3
- package/dist/storage/projection-runs/provider.js.map +1 -1
- package/dist/storage/types.d.ts +2 -2
- 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 +10 -8
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/syncs/index.js +33 -30
- 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/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-cost-storage-contract.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 +2351 -1263
- package/dist/testing/index.js.map +19 -17
- 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/object-read-scope-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/queues-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 +29 -26
- 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 +3 -2
- package/dist/workers/index.js.map +2 -2
- package/dist/workflows/failure.d.ts.map +1 -1
- package/dist/workflows/index.js +51 -45
- 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/builders/params.ts +1 -48
- 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 +16 -75
- package/src/actions/validation.ts +7 -84
- package/src/agents/authority.ts +1 -1
- package/src/agents/errors.ts +3 -0
- package/src/agents/execution.ts +67 -15
- package/src/agents/ids.ts +8 -0
- package/src/agents/index.ts +1 -0
- package/src/agents/request.ts +11 -0
- package/src/agents/sandbox.ts +44 -0
- package/src/agents/validation.ts +2 -108
- 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/datasets/validation.ts +40 -11
- package/src/datasets/write.ts +8 -11
- package/src/edits/types.ts +47 -63
- package/src/error-reporting/capability.ts +11 -0
- package/src/error-reporting/reports.ts +23 -0
- package/src/error-reporting/types.ts +12 -1
- package/src/errors/catalog.ts +16 -0
- package/src/errors/failure-message.ts +15 -0
- package/src/errors/internal.ts +57 -25
- 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/authorization.ts +12 -5
- package/src/execution/authorized-object-reader.ts +42 -9
- package/src/execution/kernel-operation.ts +27 -0
- package/src/execution/primitive.ts +1 -2
- package/src/execution/request.ts +1 -2
- package/src/execution/scopes.ts +2 -0
- package/src/execution/types.ts +4 -4
- package/src/index.ts +68 -8
- package/src/lake-storage/in-memory.ts +5 -3
- package/src/maintenance/ontology-maintenance.ts +77 -1
- package/src/materialization/errors.ts +4 -2
- package/src/materialization/events.ts +27 -2
- package/src/materialization/index.ts +1 -0
- package/src/materialization/model.ts +2 -0
- package/src/materialization/vectors.ts +18 -0
- package/src/materializer/README.md +16 -0
- package/src/materializer/context.ts +10 -0
- package/src/materializer/edits/commit.ts +29 -13
- 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/edits/vector-authority.ts +108 -0
- package/src/materializer/edits/vectors.ts +100 -0
- package/src/materializer/effective/build-events.ts +4 -5
- package/src/materializer/effective/validate.ts +10 -3
- package/src/materializer/effective/vector-indexing.ts +84 -0
- package/src/materializer/effective/vectors.ts +47 -0
- package/src/materializer/execution/scope.ts +40 -7
- package/src/materializer/execution/work-executor.ts +11 -3
- package/src/materializer/projections/replace.ts +3 -1
- package/src/materializer/projections/replacement-plan.ts +4 -0
- package/src/materializer/shared/normalize.ts +11 -0
- package/src/materializer/telemetry/append.ts +5 -13
- package/src/materializer/telemetry/plan.ts +4 -5
- package/src/models/catalog-index.ts +38 -0
- package/src/models/catalog.ts +66 -38
- package/src/models/decision/catalog.ts +32 -0
- package/src/models/decision/errors.ts +18 -0
- package/src/models/decision/output.ts +101 -0
- package/src/models/decision/questions.ts +29 -0
- package/src/models/decision/runtime.ts +188 -0
- package/src/models/decision/types.ts +109 -0
- package/src/models/decision/validation.ts +335 -0
- package/src/models/definitions.ts +1 -1
- package/src/models/embedding-model.ts +129 -0
- package/src/models/execution/README.md +63 -0
- package/src/models/execution/binding.ts +2 -0
- package/src/models/execution/embedding.ts +133 -0
- package/src/models/execution/model-call-recorder.ts +42 -30
- package/src/models/execution/session.ts +81 -0
- package/src/models/execution.ts +10 -52
- package/src/models/generation-types.ts +2 -0
- package/src/models/index.ts +37 -0
- package/src/models/pricing.ts +1 -2
- package/src/objects/authorized-ontology-view.ts +12 -8
- package/src/objects/execution.ts +34 -61
- package/src/objects/query/executor.ts +25 -7
- package/src/objects/query/explain.ts +7 -2
- package/src/objects/query/index.ts +2 -0
- package/src/objects/query/ir.ts +13 -2
- package/src/objects/query/normalize.ts +5 -1
- package/src/objects/query/planner.ts +1 -0
- package/src/objects/query/scalar-values.ts +19 -0
- package/src/objects/query/validate.ts +129 -117
- package/src/objects/sdk/object-handle.ts +11 -8
- package/src/objects/sdk/object-set.ts +9 -15
- package/src/objects/sdk/query-builder.ts +66 -72
- package/src/objects/sdk/query-executor.ts +2 -1
- package/src/objects/sdk/runtime-query-executor.ts +6 -2
- package/src/objects/sdk/telemetry-channel.ts +6 -7
- package/src/objects/sdk/where.ts +6 -13
- package/src/objects/vectors/README.md +59 -0
- package/src/objects/vectors/handle.ts +91 -0
- package/src/objects/vectors/indexing-batch.ts +163 -0
- package/src/objects/vectors/indexing-generate.ts +184 -0
- package/src/objects/vectors/indexing-runtime.ts +17 -0
- package/src/objects/vectors/indexing-shared.ts +188 -0
- package/src/objects/vectors/indexing-single.ts +51 -0
- package/src/objects/vectors/indexing-store-batch.ts +62 -0
- package/src/objects/vectors/indexing.ts +23 -0
- package/src/objects/vectors/profile.ts +64 -0
- package/src/objects/vectors/query.ts +16 -0
- package/src/objects/vectors/resolve-query.ts +89 -0
- package/src/objects/vectors/types.ts +10 -0
- package/src/ontology/builders.ts +15 -11
- package/src/ontology/index.ts +6 -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 +14 -3
- package/src/ontology/tokens.ts +41 -2
- package/src/ontology/types.ts +28 -12
- package/src/ontology/user-ref.ts +120 -0
- package/src/ontology/validation/definition.ts +93 -0
- package/src/ontology/validation/index.ts +1 -0
- package/src/ontology/validation/normalize.ts +39 -3
- package/src/ontology/validation/properties.ts +109 -23
- package/src/ontology/validation/query.ts +44 -92
- package/src/ontology/validation/schema.ts +101 -23
- package/src/ontology/vector-profiles.ts +35 -0
- package/src/predicates/types.ts +43 -33
- package/src/projections/builders.ts +24 -3
- package/src/projections/validation.ts +15 -1
- package/src/queues/in-memory.ts +5 -0
- package/src/queues/index.ts +1 -0
- package/src/queues/types.ts +10 -0
- package/src/runtime/create.ts +7 -6
- package/src/runtime/host.ts +44 -10
- package/src/runtime/index.ts +3 -2
- package/src/runtime/internal.ts +3 -0
- package/src/runtime/resolve-definitions.ts +19 -1
- package/src/runtime/sixb.ts +25 -17
- package/src/runtime/types.ts +288 -478
- package/src/sandboxes/README.md +41 -0
- package/src/sandboxes/auth.ts +17 -0
- package/src/sandboxes/config.ts +37 -0
- package/src/sandboxes/configuration.ts +268 -0
- package/src/sandboxes/environment.ts +107 -0
- package/src/sandboxes/errors.ts +1 -1
- package/src/sandboxes/index.ts +15 -0
- package/src/sandboxes/sandbox.ts +42 -4
- package/src/shared/params/builders.ts +50 -0
- package/src/shared/params/types.ts +85 -0
- package/src/shared/params/user-refs.ts +48 -0
- package/src/shared/params/validation.ts +114 -0
- package/src/shares/compiler.ts +6 -16
- package/src/storage/action-runs/types.ts +1 -0
- package/src/storage/agents/in-memory.ts +25 -1
- package/src/storage/agents/index.ts +3 -0
- package/src/storage/agents/provider.ts +105 -0
- package/src/storage/agents/types.ts +54 -0
- package/src/storage/ai-cost/analytics.ts +59 -21
- package/src/storage/ai-cost/index.ts +1 -0
- package/src/storage/ai-cost/types.ts +19 -2
- 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/provider.ts +24 -12
- package/src/storage/executions/types.ts +1 -0
- package/src/storage/executions/validation.ts +8 -4
- 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 +18 -3
- package/src/storage/objects/in-memory/query.ts +38 -14
- package/src/storage/objects/in-memory/read-scope.ts +9 -2
- package/src/storage/objects/in-memory/read-source.ts +5 -0
- package/src/storage/objects/in-memory/selected-reader.ts +5 -1
- package/src/storage/objects/in-memory/storage.ts +19 -1
- package/src/storage/objects/types.ts +2 -0
- package/src/storage/ontology/commits.ts +7 -2
- package/src/storage/ontology/in-memory/index.ts +20 -0
- package/src/storage/ontology/in-memory/materializations.ts +19 -34
- package/src/storage/ontology/in-memory/shared-state.ts +9 -0
- package/src/storage/ontology/in-memory/vector-indexing.ts +179 -0
- package/src/storage/ontology/in-memory/vectors.ts +73 -0
- package/src/storage/ontology/index.ts +14 -0
- 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/ontology/vector-indexing.ts +98 -0
- package/src/storage/ontology/vectors.ts +48 -0
- package/src/storage/operation-scope.ts +2 -0
- package/src/storage/types.ts +3 -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/agent-storage-contract.ts +246 -0
- package/src/testing/ai-cost-storage-contract.ts +134 -0
- 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 +162 -27
- package/src/testing/object-read-scope-contract.ts +1 -5
- package/src/testing/ontology-contract-fixture.ts +23 -3
- package/src/testing/ontology-storage-contract.ts +58 -0
- package/src/testing/queues-contract.ts +31 -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/failure.ts +10 -4
- package/src/workflows/run-dispatch.ts +12 -1
- package/src/workflows/snapshot.ts +16 -7
- package/src/workflows/types.ts +2 -2
- package/src/workflows/validation.ts +2 -2
- package/dist/chunk-01kj2pbh.js.map +0 -19
- package/dist/chunk-5hz0fnca.js.map +0 -12
- package/dist/chunk-653vwrzr.js.map +0 -10
- package/dist/chunk-7apz6hg4.js.map +0 -10
- package/dist/chunk-7bs40fe1.js.map +0 -12
- package/dist/chunk-860dwwy0.js.map +0 -14
- package/dist/chunk-93csa55g.js.map +0 -11
- package/dist/chunk-a0e6x5hd.js.map +0 -14
- package/dist/chunk-aa6z4a19.js.map +0 -12
- package/dist/chunk-ap0g1g74.js.map +0 -11
- package/dist/chunk-awbhdqyc.js.map +0 -10
- package/dist/chunk-b19g04jk.js.map +0 -11
- package/dist/chunk-dz5h08xv.js.map +0 -25
- package/dist/chunk-f0rwz2vh.js.map +0 -11
- package/dist/chunk-f4w3yp4f.js.map +0 -12
- package/dist/chunk-ftv470j8.js.map +0 -45
- package/dist/chunk-g00bfdq6.js.map +0 -43
- package/dist/chunk-gq8vhakp.js.map +0 -44
- package/dist/chunk-gqh45d2n.js.map +0 -15
- package/dist/chunk-gqm76kse.js.map +0 -58
- package/dist/chunk-jsy70480.js.map +0 -15
- package/dist/chunk-mrp7k0pw.js.map +0 -10
- package/dist/chunk-ms2tmn1k.js.map +0 -17
- package/dist/chunk-rb1xx120.js.map +0 -11
- package/dist/chunk-sepyxgpc.js.map +0 -15
- package/dist/chunk-yv79ncbv.js.map +0 -10
- package/dist/chunk-z0271qkp.js.map +0 -15
- package/dist/chunk-z3y411fq.js +0 -99
- package/dist/chunk-z3y411fq.js.map +0 -11
- /package/dist/{chunk-1yefycb1.js.map → chunk-2hbhn1ff.js.map} +0 -0
- /package/dist/{chunk-wjasrj67.js.map → chunk-3qpcrcj8.js.map} +0 -0
- /package/dist/{chunk-0y39rgsb.js.map → chunk-4tnrzqqh.js.map} +0 -0
- /package/dist/{chunk-c5rkjrgp.js.map → chunk-7ytf06d3.js.map} +0 -0
- /package/dist/{chunk-cfvakeax.js.map → chunk-a69fkrtr.js.map} +0 -0
- /package/dist/{chunk-v2vcg0w6.js.map → chunk-cbn96bve.js.map} +0 -0
- /package/dist/{chunk-g6cke204.js.map → chunk-f85hpqnm.js.map} +0 -0
- /package/dist/{chunk-vsj3mdfj.js.map → chunk-fc5zfxy1.js.map} +0 -0
- /package/dist/{chunk-x9m9x2eq.js.map → chunk-jhyc777j.js.map} +0 -0
- /package/dist/{chunk-17kfctj6.js.map → chunk-m8zkvep1.js.map} +0 -0
- /package/dist/{chunk-9qsh3p5y.js.map → chunk-rb143ggb.js.map} +0 -0
- /package/dist/{chunk-92vk7gta.js.map → chunk-vn3yh259.js.map} +0 -0
- /package/dist/{chunk-g91qxjj0.js.map → chunk-w9bp61e7.js.map} +0 -0
- /package/dist/{chunk-1824gssz.js.map → chunk-y487ywrv.js.map} +0 -0
- /package/dist/{chunk-358caqf5.js.map → chunk-znw0zvy4.js.map} +0 -0
|
@@ -16,8 +16,13 @@ import {
|
|
|
16
16
|
telemetryPointSortKey2,
|
|
17
17
|
compareObjectRefs2,
|
|
18
18
|
compareLinkRefs2
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7ytf06d3.js";
|
|
20
20
|
import {
|
|
21
|
+
withFailureMessage
|
|
22
|
+
} from "./chunk-z3y5kg1x.js";
|
|
23
|
+
import {
|
|
24
|
+
collectUserRefIds,
|
|
25
|
+
userReferenceProblem,
|
|
21
26
|
normalizeObjectProperties2,
|
|
22
27
|
normalizeSchemaValue2,
|
|
23
28
|
assertKnownProperties2,
|
|
@@ -26,7 +31,7 @@ import {
|
|
|
26
31
|
normalizeLinkProperties2,
|
|
27
32
|
validateLinkProperties2,
|
|
28
33
|
validateTelemetryUnit2
|
|
29
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-d8yes9yx.js";
|
|
30
35
|
import {
|
|
31
36
|
materializationEventKindOrdinal2,
|
|
32
37
|
sha256Canonical2,
|
|
@@ -34,32 +39,38 @@ import {
|
|
|
34
39
|
createCommitId2,
|
|
35
40
|
createEventId2,
|
|
36
41
|
materializationApplyPhase
|
|
37
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-ht4a7mjg.js";
|
|
38
43
|
import {
|
|
39
44
|
ProjectionValidationError2,
|
|
40
45
|
validateProjectionsAtStartup,
|
|
41
46
|
isProjectionDefinition2,
|
|
42
47
|
resolveExecutionScopeAuthorization
|
|
43
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-rzcjp5m2.js";
|
|
44
49
|
import {
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
objectBatchKey2,
|
|
51
|
+
vectorConfiguration,
|
|
52
|
+
vectorSources,
|
|
53
|
+
normalizeVector2
|
|
54
|
+
} from "./chunk-gc226ten.js";
|
|
47
55
|
import {
|
|
48
56
|
parseDatasetTimestamp2
|
|
49
57
|
} from "./chunk-z667z3sg.js";
|
|
50
58
|
import {
|
|
51
59
|
executionRecordInputFromRuntime,
|
|
52
60
|
ensureExecutionRecord2
|
|
53
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-m8zkvep1.js";
|
|
62
|
+
import {
|
|
63
|
+
isStorageSerializationFailure2
|
|
64
|
+
} from "./chunk-zdkcdshk.js";
|
|
54
65
|
import {
|
|
55
66
|
assertPinnedDatasetWatermark2
|
|
56
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-3qpcrcj8.js";
|
|
57
68
|
import {
|
|
58
69
|
MaterializationValidationError2,
|
|
59
70
|
MaterializationObjectNotFoundError2,
|
|
60
71
|
MaterializationCancellationError2,
|
|
61
72
|
MaterializationConflictError2
|
|
62
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-96yw3pwd.js";
|
|
63
74
|
import {
|
|
64
75
|
assertJsonValue2,
|
|
65
76
|
cloneJsonValue2,
|
|
@@ -589,6 +600,9 @@ function createMaterializerContext(input) {
|
|
|
589
600
|
if (computeOntologyRevision2(input.ontology) !== input.projections.ontologyRevision) {
|
|
590
601
|
throw new MaterializationValidationError2("Materializer Ontology does not match the Ontology pinned by its projection registry.");
|
|
591
602
|
}
|
|
603
|
+
if ((!input.storage.ontology.vectors || !input.storage.ontology.vectorIndexing) && input.ontology.listObjectTypes().some((type) => Object.keys(type.search?.vectors ?? {}).length > 0)) {
|
|
604
|
+
throw new MaterializationValidationError2("Storage does not support transactional vector profiles and automatic indexing.");
|
|
605
|
+
}
|
|
592
606
|
const dependencies = input.dependencies ?? {};
|
|
593
607
|
const maxSerializationRetries = dependencies.maxSerializationRetries ?? 2;
|
|
594
608
|
if (!Number.isSafeInteger(maxSerializationRetries) || maxSerializationRetries < 0) {
|
|
@@ -645,19 +659,36 @@ async function withSerializationRetry(context, run) {
|
|
|
645
659
|
|
|
646
660
|
// src/materializer/execution/scope.ts
|
|
647
661
|
function prepareMaterializerExecution(projectId, scope) {
|
|
648
|
-
|
|
649
|
-
|
|
662
|
+
resolveExecutionScopeAuthorization(projectId, scope);
|
|
663
|
+
return {
|
|
650
664
|
scope,
|
|
651
665
|
record: executionRecordInputFromRuntime({
|
|
652
666
|
execution: scope.execution,
|
|
653
667
|
runtimeAuthorization: scope.authorization
|
|
654
668
|
}),
|
|
655
669
|
executionId: scope.execution.id,
|
|
656
|
-
correlationId: scope.execution.correlationId
|
|
670
|
+
correlationId: scope.execution.correlationId,
|
|
671
|
+
attribution: executionAttribution(scope)
|
|
657
672
|
};
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
673
|
+
}
|
|
674
|
+
function executionAttribution(scope) {
|
|
675
|
+
const { requestedBy, executor } = scope.execution;
|
|
676
|
+
const attributed = { executor: eventExecutor(executor) };
|
|
677
|
+
if (requestedBy === undefined)
|
|
678
|
+
return attributed;
|
|
679
|
+
return { ...attributed, requestedBy: { type: requestedBy.type, id: requestedBy.id } };
|
|
680
|
+
}
|
|
681
|
+
function eventExecutor(executor) {
|
|
682
|
+
switch (executor.type) {
|
|
683
|
+
case "request":
|
|
684
|
+
return { type: "request", requestId: executor.requestId };
|
|
685
|
+
case "primitive":
|
|
686
|
+
return { type: "primitive", kind: executor.kind, id: executor.id, runId: executor.runId };
|
|
687
|
+
case "agent":
|
|
688
|
+
return { type: "agent", runId: executor.runId };
|
|
689
|
+
case "kernel":
|
|
690
|
+
return { type: "kernel", operation: structuredClone(executor.operation) };
|
|
691
|
+
}
|
|
661
692
|
}
|
|
662
693
|
function ensureMaterializerExecution(executions, execution) {
|
|
663
694
|
return ensureExecutionRecord2(executions, execution.record);
|
|
@@ -787,17 +818,15 @@ function buildTelemetryEventDraft(context, point) {
|
|
|
787
818
|
};
|
|
788
819
|
}
|
|
789
820
|
function eventDraftBase(context) {
|
|
790
|
-
|
|
821
|
+
return {
|
|
791
822
|
schemaVersion: 1,
|
|
792
823
|
projectId: context.projectId,
|
|
793
824
|
occurredAt: context.committedAt,
|
|
794
825
|
correlationId: context.correlationId,
|
|
795
826
|
origin: context.origin,
|
|
827
|
+
...context.attribution,
|
|
796
828
|
commitId: context.commitId
|
|
797
829
|
};
|
|
798
|
-
if (context.actor === undefined)
|
|
799
|
-
return base;
|
|
800
|
-
return { ...base, actor: context.actor };
|
|
801
830
|
}
|
|
802
831
|
function orderedDraft(sortKey, draft) {
|
|
803
832
|
return {
|
|
@@ -814,6 +843,100 @@ function sequenceMaterializationEvent(projectId, commitId, commitOrdinal, draft)
|
|
|
814
843
|
return { ...draft, ...sequence };
|
|
815
844
|
}
|
|
816
845
|
|
|
846
|
+
// src/materializer/effective/vector-indexing.ts
|
|
847
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
848
|
+
async function scheduleVectorChanges(context, storage, items, session, projection = false) {
|
|
849
|
+
const indexing = storage.ontology.vectorIndexing;
|
|
850
|
+
if (!indexing)
|
|
851
|
+
return;
|
|
852
|
+
const upserts = items.filter((item) => item.kind === "object-upsert").filter((item) => Object.keys(context.ontology.resolveObjectType(item.value.row.ref.objectTypeId).search?.vectors ?? {}).length > 0);
|
|
853
|
+
const previous = await storage.objects.getByPrimaryIdBatch({
|
|
854
|
+
projectId: context.projectId,
|
|
855
|
+
items: upserts.map((item) => item.value.row.ref)
|
|
856
|
+
});
|
|
857
|
+
const requests = [];
|
|
858
|
+
const deleted = [];
|
|
859
|
+
const groups = new Map;
|
|
860
|
+
for (const item of items) {
|
|
861
|
+
if (item.kind === "object-delete") {
|
|
862
|
+
deleted.push(item.value.ref);
|
|
863
|
+
continue;
|
|
864
|
+
}
|
|
865
|
+
if (item.kind !== "object-upsert")
|
|
866
|
+
continue;
|
|
867
|
+
const row = item.value.row;
|
|
868
|
+
const profiles = context.ontology.resolveObjectType(row.ref.objectTypeId).search?.vectors ?? {};
|
|
869
|
+
const before = previous.get(objectBatchKey2(row.ref.objectTypeId, row.ref.primaryId));
|
|
870
|
+
for (const [profile, definition] of Object.entries(profiles)) {
|
|
871
|
+
const { sourceFingerprint, text } = vectorSources(definition.source, row.properties);
|
|
872
|
+
if (before && vectorSources(definition.source, before.properties).sourceFingerprint === sourceFingerprint)
|
|
873
|
+
continue;
|
|
874
|
+
const configuration = vectorConfiguration(definition);
|
|
875
|
+
const bytes = Buffer.byteLength(text);
|
|
876
|
+
const key = JSON.stringify([row.ref.objectTypeId, profile, configuration, row.lastCommitId]);
|
|
877
|
+
let group = projection ? groups.get(key) : undefined;
|
|
878
|
+
if (projection && (!group || group.count === 32 || group.bytes + bytes > 32768)) {
|
|
879
|
+
group = { id: randomUUID2(), count: 0, bytes: 0 };
|
|
880
|
+
groups.set(key, group);
|
|
881
|
+
}
|
|
882
|
+
if (group) {
|
|
883
|
+
group.count++;
|
|
884
|
+
group.bytes += bytes;
|
|
885
|
+
}
|
|
886
|
+
requests.push({
|
|
887
|
+
...group ? { batchId: group.id } : {},
|
|
888
|
+
id: randomUUID2(),
|
|
889
|
+
ref: row.ref,
|
|
890
|
+
profile,
|
|
891
|
+
sourceFingerprint,
|
|
892
|
+
configuration,
|
|
893
|
+
sourceCommitId: row.lastCommitId
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
if (requests.length || deleted.length)
|
|
898
|
+
await indexing.schedule({
|
|
899
|
+
projectId: context.projectId,
|
|
900
|
+
session,
|
|
901
|
+
requests,
|
|
902
|
+
deleted,
|
|
903
|
+
availableAt: context.clock().toISOString()
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
// src/materializer/effective/vectors.ts
|
|
908
|
+
async function invalidateVectorChanges(projectId, vectors, items, session) {
|
|
909
|
+
if (!vectors)
|
|
910
|
+
return;
|
|
911
|
+
const changes = new Map(items.flatMap((item) => {
|
|
912
|
+
if (item.kind !== "object-upsert" && item.kind !== "object-delete")
|
|
913
|
+
return [];
|
|
914
|
+
const ref = item.kind === "object-upsert" ? item.value.row.ref : item.value.ref;
|
|
915
|
+
return [[objectRefKey2(ref), { ref, item }]];
|
|
916
|
+
}));
|
|
917
|
+
if (!changes.size)
|
|
918
|
+
return;
|
|
919
|
+
const stored = await vectors.listBatch({
|
|
920
|
+
projectId,
|
|
921
|
+
refs: [...changes.values()].map(({ ref }) => ref)
|
|
922
|
+
});
|
|
923
|
+
const removals = [];
|
|
924
|
+
for (const entry of stored) {
|
|
925
|
+
const change = changes.get(objectRefKey2(entry.ref));
|
|
926
|
+
if (!change)
|
|
927
|
+
continue;
|
|
928
|
+
const { item } = change;
|
|
929
|
+
if (item.kind === "object-upsert" && entry.source.every((id) => {
|
|
930
|
+
const value = item.value.row.properties[id];
|
|
931
|
+
return value === undefined || value === null || typeof value === "string";
|
|
932
|
+
}) && vectorSources(entry.source, item.value.row.properties).sourceFingerprint === entry.sourceFingerprint)
|
|
933
|
+
continue;
|
|
934
|
+
removals.push({ ref: entry.ref, profile: entry.profile, expectedCommitId: entry.lastCommitId });
|
|
935
|
+
}
|
|
936
|
+
if (removals.length)
|
|
937
|
+
await vectors.removeBatch({ session, projectId, entries: removals });
|
|
938
|
+
}
|
|
939
|
+
|
|
817
940
|
// src/materializer/shared/abort.ts
|
|
818
941
|
function throwIfAborted(signal) {
|
|
819
942
|
if (signal?.aborted) {
|
|
@@ -1084,12 +1207,16 @@ async function stageWorkBounded(context, storage, session, records) {
|
|
|
1084
1207
|
await storage.stageWork({ session, records: chunk });
|
|
1085
1208
|
}
|
|
1086
1209
|
}
|
|
1087
|
-
async function drainStagedWork(context,
|
|
1210
|
+
async function drainStagedWork(context, transactionStorage, session, signal, projection = false) {
|
|
1211
|
+
const ontologyStorage = transactionStorage.ontology;
|
|
1212
|
+
const storage = ontologyStorage.materializations;
|
|
1088
1213
|
let phase = null;
|
|
1089
1214
|
let pending = [];
|
|
1090
1215
|
const flush = async () => {
|
|
1091
1216
|
if (pending.length === 0)
|
|
1092
1217
|
return;
|
|
1218
|
+
await scheduleVectorChanges(context, transactionStorage, pending, session, projection);
|
|
1219
|
+
await invalidateVectorChanges(context.projectId, ontologyStorage.vectors, pending, session);
|
|
1093
1220
|
await applyItems(context, storage, session, pending, signal);
|
|
1094
1221
|
pending = [];
|
|
1095
1222
|
};
|
|
@@ -1351,6 +1478,8 @@ function normalizeOntologyEditCommit2(input) {
|
|
|
1351
1478
|
return normalized;
|
|
1352
1479
|
});
|
|
1353
1480
|
if (input.mode === "continue") {
|
|
1481
|
+
if ("vectorWrites" in input)
|
|
1482
|
+
throw new MaterializationValidationError2("Vector writes require an atomic commit.");
|
|
1354
1483
|
return Object.freeze({
|
|
1355
1484
|
mode: "continue",
|
|
1356
1485
|
source: Object.freeze({
|
|
@@ -1369,11 +1498,17 @@ function normalizeOntologyEditCommit2(input) {
|
|
|
1369
1498
|
kind: "runtime",
|
|
1370
1499
|
requestId: normalizeNonblank(input.source.requestId, "Runtime request id")
|
|
1371
1500
|
});
|
|
1501
|
+
if (input.vectorWrites?.length && (operations.length || input.source.kind !== "runtime")) {
|
|
1502
|
+
throw new MaterializationValidationError2("Vector writes require a dedicated atomic runtime commit.");
|
|
1503
|
+
}
|
|
1504
|
+
if (input.vectorWrites !== undefined)
|
|
1505
|
+
assertJsonValue2(input.vectorWrites, "Vector writes");
|
|
1372
1506
|
const expectedObjects = input.expectedObjects.map(normalizeExpectedObject);
|
|
1373
1507
|
const expectedLinks = input.expectedLinks.map(normalizeExpectedLink);
|
|
1374
1508
|
const expectedLinkScopes = input.expectedLinkScopes.map(normalizeExpectedLinkScope);
|
|
1375
1509
|
return Object.freeze({
|
|
1376
1510
|
mode: "atomic",
|
|
1511
|
+
...input.vectorWrites === undefined ? {} : { vectorWrites: structuredClone(input.vectorWrites) },
|
|
1377
1512
|
source,
|
|
1378
1513
|
operations: Object.freeze(operations),
|
|
1379
1514
|
expectedObjects: deduplicateExpectations(expectedObjects, (value) => objectRefKey2(value.ref), "Expected objects"),
|
|
@@ -2165,7 +2300,7 @@ function validateEffectiveObject(ontology, ref, properties) {
|
|
|
2165
2300
|
assertKnownProperties2(objectType, properties);
|
|
2166
2301
|
for (const property of objectType.properties) {
|
|
2167
2302
|
if (property.mode !== "telemetry" && property.required && properties[property.id] === undefined) {
|
|
2168
|
-
throw new Error(`[Sixb] Missing required property '${property.id}' for object type '${objectType.id}'`);
|
|
2303
|
+
throw withFailureMessage(new Error(`[Sixb] Missing required property '${property.id}' for object type '${objectType.id}'`), `Missing required property '${objectType.id}.${property.id}'.`);
|
|
2169
2304
|
}
|
|
2170
2305
|
}
|
|
2171
2306
|
validateObjectProperties2(objectType, properties, ontology.getValueTypesById());
|
|
@@ -2208,7 +2343,7 @@ function materializationValidation(run) {
|
|
|
2208
2343
|
} catch (error) {
|
|
2209
2344
|
if (error instanceof MaterializationValidationError2)
|
|
2210
2345
|
throw error;
|
|
2211
|
-
throw new MaterializationValidationError2(error instanceof Error ? error.message : String(error));
|
|
2346
|
+
throw new MaterializationValidationError2(error instanceof Error ? error.message : String(error), { cause: error });
|
|
2212
2347
|
}
|
|
2213
2348
|
}
|
|
2214
2349
|
|
|
@@ -2404,16 +2539,71 @@ function sameAuthority(left, right) {
|
|
|
2404
2539
|
return stableJsonStringify2(left) === stableJsonStringify2(right);
|
|
2405
2540
|
}
|
|
2406
2541
|
|
|
2542
|
+
// src/materializer/edits/user-refs.ts
|
|
2543
|
+
var NO_REFERENCED_USERS = { kind: "loaded", statuses: new Map };
|
|
2544
|
+
async function loadReferencedUsers(context, operations) {
|
|
2545
|
+
const ids = new Set;
|
|
2546
|
+
for (const operation of operations) {
|
|
2547
|
+
switch (operation.kind) {
|
|
2548
|
+
case "object.create":
|
|
2549
|
+
case "object.upsert":
|
|
2550
|
+
collectObjectUserRefIds(context.ontology, operation.ref.objectTypeId, operation.properties, ids);
|
|
2551
|
+
break;
|
|
2552
|
+
case "object.patch":
|
|
2553
|
+
collectObjectUserRefIds(context.ontology, operation.ref.objectTypeId, operation.set, ids);
|
|
2554
|
+
break;
|
|
2555
|
+
default:
|
|
2556
|
+
break;
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
if (ids.size === 0)
|
|
2560
|
+
return NO_REFERENCED_USERS;
|
|
2561
|
+
const users = context.storage.auth?.users;
|
|
2562
|
+
if (!users)
|
|
2563
|
+
return { kind: "unavailable" };
|
|
2564
|
+
const entries = await Promise.all([...ids].map(async (id) => {
|
|
2565
|
+
const user = await users.getById({ projectId: context.projectId, id });
|
|
2566
|
+
return [id, user?.status ?? null];
|
|
2567
|
+
}));
|
|
2568
|
+
return { kind: "loaded", statuses: new Map(entries) };
|
|
2569
|
+
}
|
|
2570
|
+
function assertIntroducedUsersActive(ontology, objectTypeId, before, after, users) {
|
|
2571
|
+
const objectType = ontology.resolveObjectType(objectTypeId);
|
|
2572
|
+
const valueTypesById = ontology.getValueTypesById();
|
|
2573
|
+
for (const property of objectType.properties) {
|
|
2574
|
+
const introduced = collectUserRefIds(property.schema, after[property.id], valueTypesById, new Set);
|
|
2575
|
+
if (introduced.size === 0)
|
|
2576
|
+
continue;
|
|
2577
|
+
const held = collectUserRefIds(property.schema, before?.[property.id], valueTypesById, new Set);
|
|
2578
|
+
for (const id of introduced) {
|
|
2579
|
+
if (held.has(id))
|
|
2580
|
+
continue;
|
|
2581
|
+
const problem = userReferenceProblem(`Property '${objectTypeId}.${property.id}'`, id, users.kind === "unavailable" ? "unverifiable" : users.statuses.get(id) ?? null);
|
|
2582
|
+
if (problem)
|
|
2583
|
+
throw new MaterializationValidationError2(problem);
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
function collectObjectUserRefIds(ontology, objectTypeId, properties, into) {
|
|
2588
|
+
const objectType = ontology.getObjectTypeById(objectTypeId);
|
|
2589
|
+
if (!objectType)
|
|
2590
|
+
return;
|
|
2591
|
+
const valueTypesById = ontology.getValueTypesById();
|
|
2592
|
+
for (const property of objectType.properties) {
|
|
2593
|
+
collectUserRefIds(property.schema, properties[property.id], valueTypesById, into);
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2407
2597
|
// src/materializer/edits/operations.ts
|
|
2408
2598
|
function undoEditJournal(journal) {
|
|
2409
2599
|
for (let index = journal.length - 1;index >= 0; index -= 1) {
|
|
2410
2600
|
journal[index]?.restore();
|
|
2411
2601
|
}
|
|
2412
2602
|
}
|
|
2413
|
-
function applyEditOperation(context, state, operation, identity, journal) {
|
|
2603
|
+
function applyEditOperation(context, state, operation, identity, users, journal) {
|
|
2414
2604
|
validateOperationRef(context, operation);
|
|
2415
2605
|
if (isObjectOperation2(operation)) {
|
|
2416
|
-
return applyObjectOperation(context, state, operation, identity, journal);
|
|
2606
|
+
return applyObjectOperation(context, state, operation, identity, users, journal);
|
|
2417
2607
|
}
|
|
2418
2608
|
return applyLinkOperation(context, state, operation, linkCardinality(context.ontology, operation.ref), journal);
|
|
2419
2609
|
}
|
|
@@ -2424,7 +2614,7 @@ function validateOperationRef(context, operation) {
|
|
|
2424
2614
|
}
|
|
2425
2615
|
validateLinkRef(context.ontology, operation.ref);
|
|
2426
2616
|
}
|
|
2427
|
-
function applyObjectOperation(context, state, operation, identity, journal) {
|
|
2617
|
+
function applyObjectOperation(context, state, operation, identity, users, journal) {
|
|
2428
2618
|
const working = requireWorkingObject(state, operation);
|
|
2429
2619
|
const normalized = validateObjectOperation(context, operation);
|
|
2430
2620
|
const currentEffective = resolveObject(context.ontology, working);
|
|
@@ -2437,7 +2627,8 @@ function applyObjectOperation(context, state, operation, identity, journal) {
|
|
|
2437
2627
|
effectiveExists: currentEffective !== null,
|
|
2438
2628
|
...normalized
|
|
2439
2629
|
});
|
|
2440
|
-
|
|
2630
|
+
const assertUsers = operation.kind === "object.restore" ? undefined : (resolved) => assertIntroducedUsersActive(context.ontology, operation.ref.objectTypeId, currentEffective?.properties, resolved.properties, users);
|
|
2631
|
+
applyObjectTransition(context, state, working, transition.next, transition.editedAt, journal, assertUsers);
|
|
2441
2632
|
return objectOperationOutcome(operation, working, transition.changed, context, identity);
|
|
2442
2633
|
}
|
|
2443
2634
|
function requireWorkingObject(state, operation) {
|
|
@@ -2464,15 +2655,17 @@ function validateObjectOperation(context, operation) {
|
|
|
2464
2655
|
return {};
|
|
2465
2656
|
}
|
|
2466
2657
|
}
|
|
2467
|
-
function applyObjectTransition(context, state, working, next, nextEditedAt, journal) {
|
|
2658
|
+
function applyObjectTransition(context, state, working, next, nextEditedAt, journal, validateResolved) {
|
|
2468
2659
|
const previous = working.override;
|
|
2469
2660
|
const previousEditedAt = working.editedAt;
|
|
2470
2661
|
working.override = next;
|
|
2471
2662
|
working.editedAt = { ...nextEditedAt };
|
|
2472
2663
|
try {
|
|
2473
2664
|
const resolved = resolveObject(context.ontology, working);
|
|
2474
|
-
if (resolved)
|
|
2665
|
+
if (resolved) {
|
|
2475
2666
|
validateEffectiveObject(context.ontology, resolved.ref, resolved.properties);
|
|
2667
|
+
validateResolved?.(resolved);
|
|
2668
|
+
}
|
|
2476
2669
|
validateWorkingCardinality(state.links.slots);
|
|
2477
2670
|
} catch (error) {
|
|
2478
2671
|
working.override = previous;
|
|
@@ -2723,16 +2916,14 @@ function buildLinkEvent(context, planContext, change) {
|
|
|
2723
2916
|
return buildLinkMaterializationEventDraft({ ...eventContext, change });
|
|
2724
2917
|
}
|
|
2725
2918
|
function materializationEventContext(context, planContext) {
|
|
2726
|
-
|
|
2919
|
+
return {
|
|
2727
2920
|
projectId: context.projectId,
|
|
2728
2921
|
commitId: planContext.identity.commitId,
|
|
2729
2922
|
committedAt: planContext.identity.committedAt,
|
|
2730
2923
|
origin: planContext.origin,
|
|
2731
|
-
correlationId: planContext.correlationId
|
|
2924
|
+
correlationId: planContext.correlationId,
|
|
2925
|
+
attribution: planContext.attribution
|
|
2732
2926
|
};
|
|
2733
|
-
if (planContext.actor === undefined)
|
|
2734
|
-
return base;
|
|
2735
|
-
return { ...base, actor: planContext.actor };
|
|
2736
2927
|
}
|
|
2737
2928
|
function sortedObjects(objects) {
|
|
2738
2929
|
return [...objects.values()].sort((left, right) => compareObjectRefs2(left.ref, right.ref));
|
|
@@ -2744,12 +2935,121 @@ function sortedLinkSlots(slots) {
|
|
|
2744
2935
|
return [...slots.values()].sort((left, right) => linkScopeKey(left.ref.source, left.ref.linkId).localeCompare(linkScopeKey(right.ref.source, right.ref.linkId)));
|
|
2745
2936
|
}
|
|
2746
2937
|
|
|
2938
|
+
// src/materializer/edits/vector-authority.ts
|
|
2939
|
+
async function authorizeVectorIndexingCommit(storage, projectId, input, execution) {
|
|
2940
|
+
const executor = execution.scope.execution.executor;
|
|
2941
|
+
if (executor.type !== "kernel" || executor.operation.type !== "ontology.indexVectors")
|
|
2942
|
+
return false;
|
|
2943
|
+
if (input.mode !== "atomic" || input.source.kind !== "runtime" || input.operations.length || !input.vectorWrites?.length || input.expectedLinks.length || input.expectedLinkScopes.length) {
|
|
2944
|
+
throw new MaterializationValidationError2("Vector indexing authority only permits its persisted vector writes.");
|
|
2945
|
+
}
|
|
2946
|
+
const writes = input.vectorWrites;
|
|
2947
|
+
const refs = new Set(writes.map((write) => objectRefKey2(write.input.ref)));
|
|
2948
|
+
if (input.expectedObjects.length !== refs.size || input.expectedObjects.some((expected) => !refs.has(objectRefKey2(expected.ref)))) {
|
|
2949
|
+
throw new MaterializationValidationError2("Vector indexing must fence exactly its written objects.");
|
|
2950
|
+
}
|
|
2951
|
+
const indexing = storage.ontology.vectorIndexing;
|
|
2952
|
+
const indexingId = executor.operation.indexingId;
|
|
2953
|
+
const single = await indexing?.get({ projectId, id: indexingId });
|
|
2954
|
+
if (single && writes.length !== 1) {
|
|
2955
|
+
throw new MaterializationValidationError2("Individual indexing authority only permits one vector write.");
|
|
2956
|
+
}
|
|
2957
|
+
let members;
|
|
2958
|
+
if (single) {
|
|
2959
|
+
members = [single];
|
|
2960
|
+
} else if (writes.length === 1) {
|
|
2961
|
+
const member = await indexing?.getBatchMember({
|
|
2962
|
+
projectId,
|
|
2963
|
+
batchId: indexingId,
|
|
2964
|
+
ref: writes[0].input.ref,
|
|
2965
|
+
profile: writes[0].input.profile
|
|
2966
|
+
});
|
|
2967
|
+
members = member ? [member] : [];
|
|
2968
|
+
} else {
|
|
2969
|
+
members = await indexing?.getBatch({ projectId, batchId: indexingId }) ?? [];
|
|
2970
|
+
}
|
|
2971
|
+
const byProfile = new Map(members.map((work) => [JSON.stringify([objectRefKey2(work.ref), work.profile]), work]));
|
|
2972
|
+
const source = execution.scope.execution.source;
|
|
2973
|
+
for (const write of writes) {
|
|
2974
|
+
const work = byProfile.get(JSON.stringify([objectRefKey2(write.input.ref), write.input.profile]));
|
|
2975
|
+
if (!work || work.status !== "ready") {
|
|
2976
|
+
throw new MaterializationConflictError2("effective-state", "Vector indexing work is no longer ready.");
|
|
2977
|
+
}
|
|
2978
|
+
if (source.type !== "ontologyCommit" || source.commitId !== work.sourceCommitId || !matchesStoredResult(write, work)) {
|
|
2979
|
+
throw new MaterializationValidationError2("Vector indexing authority only permits its current prepared representation.");
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
return true;
|
|
2983
|
+
}
|
|
2984
|
+
function matchesStoredResult(write, work) {
|
|
2985
|
+
const prepared = write.input;
|
|
2986
|
+
return prepared.ref.objectTypeId === work.ref.objectTypeId && prepared.ref.primaryId === work.ref.primaryId && prepared.profile === work.profile && prepared.configuration === work.configuration && prepared.sourceFingerprint === work.sourceFingerprint && work.values !== undefined && work.values.length === write.values.length && work.values.every((value, index) => value === write.values[index]);
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2989
|
+
// src/materializer/edits/vectors.ts
|
|
2990
|
+
async function commitVectorWrites(context, storage, input, commitId, session) {
|
|
2991
|
+
if (input.mode !== "atomic" || !input.vectorWrites?.length)
|
|
2992
|
+
return;
|
|
2993
|
+
const vectors = storage.ontology.vectors;
|
|
2994
|
+
if (!vectors)
|
|
2995
|
+
throw new MaterializationValidationError2("Storage does not support vector profiles.");
|
|
2996
|
+
const rows = await storage.objects.getByPrimaryIdBatch({
|
|
2997
|
+
projectId: context.projectId,
|
|
2998
|
+
items: input.vectorWrites.map((write) => write.input.ref)
|
|
2999
|
+
});
|
|
3000
|
+
const expectations = new Map(input.expectedObjects.map((expected) => [objectRefKey2(expected.ref), expected]));
|
|
3001
|
+
const entries = [];
|
|
3002
|
+
const seen = new Set;
|
|
3003
|
+
for (const write of input.vectorWrites) {
|
|
3004
|
+
const prepared = write.input;
|
|
3005
|
+
const key = JSON.stringify([objectRefKey2(prepared.ref), prepared.profile]);
|
|
3006
|
+
if (seen.has(key))
|
|
3007
|
+
throw new MaterializationValidationError2(`Duplicate vector write: ${key}`);
|
|
3008
|
+
seen.add(key);
|
|
3009
|
+
const profileDefinition = context.ontology.resolveObjectType(prepared.ref.objectTypeId).search?.vectors?.[prepared.profile];
|
|
3010
|
+
if (prepared.projectId !== context.projectId || !profileDefinition || vectorConfiguration(profileDefinition) !== prepared.configuration) {
|
|
3011
|
+
throw new MaterializationConflictError2("effective-state", "Vector profile configuration changed; index it again.");
|
|
3012
|
+
}
|
|
3013
|
+
const expected = expectations.get(objectRefKey2(prepared.ref));
|
|
3014
|
+
if (!expected?.exists || !prepared.expectedObject?.exists || objectRefKey2(prepared.expectedObject.ref) !== objectRefKey2(prepared.ref) || expected.version !== prepared.expectedObject.version || expected.lastCommitId !== prepared.expectedObject.lastCommitId) {
|
|
3015
|
+
throw new MaterializationValidationError2("Vector writes must fence their prepared object revision.");
|
|
3016
|
+
}
|
|
3017
|
+
const row = rows.get(objectBatchKey2(prepared.ref.objectTypeId, prepared.ref.primaryId));
|
|
3018
|
+
if (!row || row.version !== expected.version || row.lastCommitId !== expected.lastCommitId || vectorSources(profileDefinition.source, row.properties).sourceFingerprint !== prepared.sourceFingerprint) {
|
|
3019
|
+
throw new MaterializationConflictError2("effective-state", "Vector sources changed; index the profile again.");
|
|
3020
|
+
}
|
|
3021
|
+
entries.push({
|
|
3022
|
+
expectedCommitId: prepared.expectedVectorCommitId,
|
|
3023
|
+
value: {
|
|
3024
|
+
ref: prepared.ref,
|
|
3025
|
+
profile: prepared.profile,
|
|
3026
|
+
configuration: prepared.configuration,
|
|
3027
|
+
source: profileDefinition.source,
|
|
3028
|
+
sourceFingerprint: prepared.sourceFingerprint,
|
|
3029
|
+
values: normalizeVector2(write.values, profileDefinition.model.definition.dimensions),
|
|
3030
|
+
lastCommitId: commitId
|
|
3031
|
+
}
|
|
3032
|
+
});
|
|
3033
|
+
}
|
|
3034
|
+
await vectors.writeBatch({ session, projectId: context.projectId, entries });
|
|
3035
|
+
await storage.ontology.vectorIndexing?.complete({
|
|
3036
|
+
session,
|
|
3037
|
+
projectId: context.projectId,
|
|
3038
|
+
entries: input.vectorWrites.map(({ input: prepared }) => ({
|
|
3039
|
+
ref: prepared.ref,
|
|
3040
|
+
profile: prepared.profile,
|
|
3041
|
+
configuration: prepared.configuration,
|
|
3042
|
+
sourceFingerprint: prepared.sourceFingerprint
|
|
3043
|
+
}))
|
|
3044
|
+
});
|
|
3045
|
+
}
|
|
3046
|
+
|
|
2747
3047
|
// src/materializer/edits/commit.ts
|
|
2748
3048
|
async function commitEdits(context, raw) {
|
|
2749
|
-
const command = prepareEditCommit(context, raw);
|
|
3049
|
+
const command = await prepareEditCommit(context, raw);
|
|
2750
3050
|
return executeEditCommit(context, command);
|
|
2751
3051
|
}
|
|
2752
|
-
function prepareEditCommit(context, raw) {
|
|
3052
|
+
async function prepareEditCommit(context, raw) {
|
|
2753
3053
|
const input = normalizeOntologyEditCommit2(raw.input);
|
|
2754
3054
|
const idempotencyKey = editIdempotencyKey(input);
|
|
2755
3055
|
const identity = createTimedCommitIdentity2({
|
|
@@ -2762,7 +3062,8 @@ function prepareEditCommit(context, raw) {
|
|
|
2762
3062
|
input,
|
|
2763
3063
|
identity,
|
|
2764
3064
|
origin: input.source,
|
|
2765
|
-
execution: prepareMaterializerExecution(context.projectId, raw.scope)
|
|
3065
|
+
execution: prepareMaterializerExecution(context.projectId, raw.scope),
|
|
3066
|
+
users: await loadReferencedUsers(context, input.operations)
|
|
2766
3067
|
};
|
|
2767
3068
|
}
|
|
2768
3069
|
function editIdempotencyKey(input) {
|
|
@@ -2785,6 +3086,8 @@ async function lockActionRunForMaterialization(storage, projectId, input, execut
|
|
|
2785
3086
|
assertMaterializerRunExecution(execution, run.executionId, `Action run '${run.id}'`);
|
|
2786
3087
|
}
|
|
2787
3088
|
async function validateMutationExecution(storage, projectId, input, execution) {
|
|
3089
|
+
if (await authorizeVectorIndexingCommit(storage, projectId, input, execution))
|
|
3090
|
+
return;
|
|
2788
3091
|
if (input.source.kind !== "action") {
|
|
2789
3092
|
assertRuntimeMutationExecution(execution);
|
|
2790
3093
|
return;
|
|
@@ -2822,7 +3125,8 @@ async function executeEditTransaction(context, storage, command) {
|
|
|
2822
3125
|
const workingState = await loadEditWorkingState(context, storage.ontology.materializations, session, command.input.operations);
|
|
2823
3126
|
const outcomes = applyEditOperations(context, workingState, command);
|
|
2824
3127
|
const changes = await stageEditPlan(context, storage.ontology.materializations, session, workingState, editPlanContext(command));
|
|
2825
|
-
await drainStagedWork(context, storage
|
|
3128
|
+
await drainStagedWork(context, storage, session);
|
|
3129
|
+
await commitVectorWrites(context, storage, command.input, command.identity.commitId, session);
|
|
2826
3130
|
const eventCount = await drainStagedEvents(context, storage.ontology.materializations, session, command.identity);
|
|
2827
3131
|
const result = {
|
|
2828
3132
|
kind: "edit",
|
|
@@ -2847,24 +3151,23 @@ async function beginEditMaterialization(context, storage, command) {
|
|
|
2847
3151
|
});
|
|
2848
3152
|
}
|
|
2849
3153
|
function buildEditCommit(context, command) {
|
|
2850
|
-
|
|
3154
|
+
return {
|
|
2851
3155
|
projectId: context.projectId,
|
|
2852
3156
|
id: command.identity.commitId,
|
|
2853
3157
|
idempotencyKey: command.identity.idempotencyKey,
|
|
2854
3158
|
requestHash: command.identity.requestHash,
|
|
2855
3159
|
executionId: command.execution.executionId,
|
|
2856
3160
|
origin: command.origin,
|
|
3161
|
+
...command.execution.attribution,
|
|
2857
3162
|
ontologyRevision: context.projectionRegistry.ontologyRevision,
|
|
2858
3163
|
intent: {
|
|
2859
3164
|
kind: "edit",
|
|
2860
3165
|
mode: command.input.mode,
|
|
2861
|
-
operationCount: command.input.operations.length
|
|
3166
|
+
operationCount: command.input.operations.length,
|
|
3167
|
+
...command.input.mode === "atomic" && command.input.vectorWrites?.length ? { vectorWriteCount: command.input.vectorWrites.length } : {}
|
|
2862
3168
|
},
|
|
2863
3169
|
committedAt: command.identity.committedAt
|
|
2864
3170
|
};
|
|
2865
|
-
if (command.execution.actor === undefined)
|
|
2866
|
-
return commit;
|
|
2867
|
-
return { ...commit, actor: command.execution.actor };
|
|
2868
3171
|
}
|
|
2869
3172
|
function editExpectations(input) {
|
|
2870
3173
|
if (input.mode === "atomic") {
|
|
@@ -2892,7 +3195,7 @@ function applyEditExecutionUnit(context, state, command, unit) {
|
|
|
2892
3195
|
}
|
|
2893
3196
|
function applyOneEditOperation(context, state, operation, command) {
|
|
2894
3197
|
try {
|
|
2895
|
-
return applyEditOperation(context, state, operation, command.identity);
|
|
3198
|
+
return applyEditOperation(context, state, operation, command.identity, command.users);
|
|
2896
3199
|
} catch (error) {
|
|
2897
3200
|
if (!isRecoverableEditValidation(command.input, error))
|
|
2898
3201
|
throw error;
|
|
@@ -2905,7 +3208,7 @@ function applyEditOperationGroup(context, state, command, group) {
|
|
|
2905
3208
|
for (const operation of group) {
|
|
2906
3209
|
let outcome;
|
|
2907
3210
|
try {
|
|
2908
|
-
outcome = applyEditOperation(context, state, operation, command.identity, journal);
|
|
3211
|
+
outcome = applyEditOperation(context, state, operation, command.identity, command.users, journal);
|
|
2909
3212
|
} catch (error) {
|
|
2910
3213
|
if (!isRecoverableEditValidation(command.input, error))
|
|
2911
3214
|
throw error;
|
|
@@ -2933,14 +3236,12 @@ function isRecoverableEditValidation(input, error) {
|
|
|
2933
3236
|
return error instanceof MaterializationValidationError2;
|
|
2934
3237
|
}
|
|
2935
3238
|
function editPlanContext(command) {
|
|
2936
|
-
|
|
3239
|
+
return {
|
|
2937
3240
|
identity: command.identity,
|
|
2938
3241
|
origin: command.origin,
|
|
2939
|
-
correlationId: command.execution.correlationId
|
|
3242
|
+
correlationId: command.execution.correlationId,
|
|
3243
|
+
attribution: command.execution.attribution
|
|
2940
3244
|
};
|
|
2941
|
-
if (command.execution.actor === undefined)
|
|
2942
|
-
return context;
|
|
2943
|
-
return { ...context, actor: command.execution.actor };
|
|
2944
3245
|
}
|
|
2945
3246
|
async function finalizeEditMaterialization(storage, session, result) {
|
|
2946
3247
|
const applied = await storage.ontology.materializations.finalize({
|
|
@@ -3289,6 +3590,7 @@ function appendObjectChangeWork(work, sortKey, context, input, change) {
|
|
|
3289
3590
|
committedAt: input.identity.committedAt,
|
|
3290
3591
|
origin: input.origin,
|
|
3291
3592
|
correlationId: input.correlationId,
|
|
3593
|
+
attribution: input.attribution,
|
|
3292
3594
|
change
|
|
3293
3595
|
})));
|
|
3294
3596
|
}
|
|
@@ -3429,6 +3731,7 @@ function appendLinkChangeWork(work, sortKey, context, input, change) {
|
|
|
3429
3731
|
committedAt: input.identity.committedAt,
|
|
3430
3732
|
origin: input.origin,
|
|
3431
3733
|
correlationId: input.correlationId,
|
|
3734
|
+
attribution: input.attribution,
|
|
3432
3735
|
change
|
|
3433
3736
|
})));
|
|
3434
3737
|
}
|
|
@@ -3707,7 +4010,7 @@ async function executeProjectionTransaction(context, storage, command, ready) {
|
|
|
3707
4010
|
}
|
|
3708
4011
|
});
|
|
3709
4012
|
const counts = await planReadyProjection(context, storage.ontology.materializations, session, command, ready, origin);
|
|
3710
|
-
await drainStagedWork(context, storage
|
|
4013
|
+
await drainStagedWork(context, storage, session, command.signal, true);
|
|
3711
4014
|
const eventCount = await drainStagedEvents(context, storage.ontology.materializations, session, ready.identity, command.signal);
|
|
3712
4015
|
const result = {
|
|
3713
4016
|
kind: "projection",
|
|
@@ -3747,6 +4050,7 @@ function projectionCommit(projectId, command, identity, origin) {
|
|
|
3747
4050
|
requestHash: identity.requestHash,
|
|
3748
4051
|
executionId: command.scopeExecution.executionId,
|
|
3749
4052
|
origin,
|
|
4053
|
+
...command.scopeExecution.attribution,
|
|
3750
4054
|
ontologyRevision: command.runIdentity.ontologyRevision,
|
|
3751
4055
|
projectionRevision: command.runIdentity.projectionRevision,
|
|
3752
4056
|
ownershipHash: command.runIdentity.ownershipHash,
|
|
@@ -3761,7 +4065,8 @@ async function planReadyProjection(context, storage, session, command, ready, or
|
|
|
3761
4065
|
projectionKind: command.projectionKind,
|
|
3762
4066
|
identity: ready.identity,
|
|
3763
4067
|
origin,
|
|
3764
|
-
correlationId: command.scopeExecution.correlationId
|
|
4068
|
+
correlationId: command.scopeExecution.correlationId,
|
|
4069
|
+
attribution: command.scopeExecution.attribution
|
|
3765
4070
|
};
|
|
3766
4071
|
if (command.signal === undefined) {
|
|
3767
4072
|
return planProjectionReplacement(context, storage, session, input);
|
|
@@ -3996,16 +4301,14 @@ async function stageTelemetryObjectPlan(context, storage, session, planContext,
|
|
|
3996
4301
|
await stageWorkBounded(context, storage, session, work);
|
|
3997
4302
|
}
|
|
3998
4303
|
function telemetryEventContext(context, planContext) {
|
|
3999
|
-
|
|
4304
|
+
return {
|
|
4000
4305
|
projectId: context.projectId,
|
|
4001
4306
|
commitId: planContext.identity.commitId,
|
|
4002
4307
|
committedAt: planContext.identity.committedAt,
|
|
4003
4308
|
origin: planContext.origin,
|
|
4004
|
-
correlationId: planContext.event.correlationId
|
|
4309
|
+
correlationId: planContext.event.correlationId,
|
|
4310
|
+
attribution: planContext.event.attribution
|
|
4005
4311
|
};
|
|
4006
|
-
if (planContext.event.actor === undefined)
|
|
4007
|
-
return eventContext;
|
|
4008
|
-
return { ...eventContext, actor: planContext.event.actor };
|
|
4009
4312
|
}
|
|
4010
4313
|
function emptyTelemetryCounts() {
|
|
4011
4314
|
return {
|
|
@@ -4204,9 +4507,9 @@ async function executeTelemetryTransaction(context, storage, command) {
|
|
|
4204
4507
|
const session = await beginTelemetryMaterialization(context, storage, command, origin);
|
|
4205
4508
|
const counts = await planTelemetryAppend(context, storage.ontology.materializations, session, command.input, command.identity, origin, {
|
|
4206
4509
|
correlationId: command.execution.correlationId,
|
|
4207
|
-
|
|
4510
|
+
attribution: command.execution.attribution
|
|
4208
4511
|
});
|
|
4209
|
-
await drainStagedWork(context, storage
|
|
4512
|
+
await drainStagedWork(context, storage, session);
|
|
4210
4513
|
const eventCount = await drainStagedEvents(context, storage.ontology.materializations, session, command.identity);
|
|
4211
4514
|
const result = {
|
|
4212
4515
|
kind: "telemetry",
|
|
@@ -4254,24 +4557,19 @@ function telemetryCommit(projectId, command, origin) {
|
|
|
4254
4557
|
requestHash: command.identity.requestHash,
|
|
4255
4558
|
executionId: command.execution.executionId,
|
|
4256
4559
|
origin,
|
|
4560
|
+
...command.execution.attribution,
|
|
4257
4561
|
ontologyRevision: command.ontologyRevision,
|
|
4258
4562
|
intent: telemetryCommitIntent(command),
|
|
4259
4563
|
committedAt: command.identity.committedAt
|
|
4260
4564
|
};
|
|
4261
|
-
const withActor = telemetryCommitActor(base, command);
|
|
4262
4565
|
if (command.kind === "runtime")
|
|
4263
|
-
return
|
|
4566
|
+
return base;
|
|
4264
4567
|
return {
|
|
4265
|
-
...
|
|
4568
|
+
...base,
|
|
4266
4569
|
projectionRevision: command.resolvedProjection.projectionRevision,
|
|
4267
4570
|
ownershipHash: command.resolvedProjection.ownershipHash
|
|
4268
4571
|
};
|
|
4269
4572
|
}
|
|
4270
|
-
function telemetryCommitActor(commit, command) {
|
|
4271
|
-
if (command.execution.actor === undefined)
|
|
4272
|
-
return commit;
|
|
4273
|
-
return { ...commit, actor: command.execution.actor };
|
|
4274
|
-
}
|
|
4275
4573
|
function telemetryCommitIntent(command) {
|
|
4276
4574
|
if (command.kind === "runtime") {
|
|
4277
4575
|
return {
|
|
@@ -4366,4 +4664,4 @@ function createOntologyMaterializer2(input) {
|
|
|
4366
4664
|
}
|
|
4367
4665
|
export { computeOntologyRevision2, computeProjectionRevision2, computeProjectionOwnershipHash2, ProjectionRegistry2, createActionIdempotencyKey2, createRuntimeIdempotencyKey2, createProjectionIdempotencyKey2, createRuntimeTelemetryIdempotencyKey2, createProjectionTelemetryIdempotencyKey2, createCommitIdentity2, timestampCommitIdentity2, createTimedCommitIdentity2, createProjectionMaterializationId2, createLinkScopeFingerprint2, normalizeJsonProperties2, normalizeOntologyEditCommit2, normalizeProjectionExecution2, normalizeProjectionSourceEntry2, normalizeTelemetryAppend2, OntologyMaterializer2, createOntologyMaterializer2 };
|
|
4368
4666
|
|
|
4369
|
-
//# debugId=
|
|
4667
|
+
//# debugId=61B9FC5452B219F064756E2164756E21
|