@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
|
@@ -3,30 +3,32 @@ import {
|
|
|
3
3
|
createSixbError2,
|
|
4
4
|
toSixbFailure2,
|
|
5
5
|
parseSixbFailure2
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-rzkr70gr.js";
|
|
7
7
|
import {
|
|
8
8
|
parseActionRunFailure2
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-xgptywp0.js";
|
|
10
10
|
import {
|
|
11
11
|
ActionRunError2,
|
|
12
12
|
assertActionRunExecution2
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-fc5zfxy1.js";
|
|
14
|
+
import {
|
|
15
|
+
paginate,
|
|
16
|
+
InMemoryAuthStorage2,
|
|
17
|
+
principalsEqual2
|
|
18
|
+
} from "./chunk-9pfw47qx.js";
|
|
14
19
|
import {
|
|
15
20
|
ObjectReadLimitExceededError2,
|
|
16
21
|
snapshotObjectReadExecutionLimits2,
|
|
17
22
|
assertObjectReadFacetCount2,
|
|
18
23
|
assertObjectReadOutputWithinLimit2
|
|
19
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-rzcjp5m2.js";
|
|
20
25
|
import {
|
|
21
26
|
assertObjectReaderProject2
|
|
22
27
|
} from "./chunk-v4jbb3rs.js";
|
|
23
|
-
import {
|
|
24
|
-
paginate,
|
|
25
|
-
InMemoryAuthStorage2,
|
|
26
|
-
principalsEqual2
|
|
27
|
-
} from "./chunk-g00bfdq6.js";
|
|
28
28
|
import {
|
|
29
29
|
AgentStorageError2,
|
|
30
|
+
transitionAgentThreadSandbox2,
|
|
31
|
+
snapshotAgentThreadSandboxParams2,
|
|
30
32
|
assertConversationAgentRunSpec2,
|
|
31
33
|
assertAgentRunExecution2,
|
|
32
34
|
assertCreateSubagentRunInput2,
|
|
@@ -37,7 +39,7 @@ import {
|
|
|
37
39
|
assertAgentContextCheckpointAnchors2,
|
|
38
40
|
assertAgentContextCheckpointReplayState2,
|
|
39
41
|
agentContextCheckpointMatchesCreateInput2
|
|
40
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-69266efg.js";
|
|
41
43
|
import {
|
|
42
44
|
InMemoryAiUsageStorage2,
|
|
43
45
|
buildAiAccountingOverview,
|
|
@@ -46,7 +48,7 @@ import {
|
|
|
46
48
|
buildAiModelCallGroups,
|
|
47
49
|
normalizeAiModelCallCostRecord2,
|
|
48
50
|
aiModelCallCostMatchesUsage2
|
|
49
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-xnx96gfy.js";
|
|
50
52
|
import {
|
|
51
53
|
AiLimitStorageError2,
|
|
52
54
|
aiLimitCalendarMonth2,
|
|
@@ -73,38 +75,19 @@ import {
|
|
|
73
75
|
cloneValidDate2
|
|
74
76
|
} from "./chunk-jgwb25gc.js";
|
|
75
77
|
import {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
principalKey,
|
|
83
|
-
isFileUploadSessionExpired,
|
|
84
|
-
shouldDeleteFileUploadSession,
|
|
85
|
-
isTerminalFileUploadSessionExpired,
|
|
86
|
-
canRequeuePipelineRunAfterEnqueueFailure2,
|
|
87
|
-
canRequeueSyncRunAfterEnqueueFailure2,
|
|
88
|
-
createTransactionStorageProxy2,
|
|
89
|
-
throwNestedStorageTransaction2
|
|
90
|
-
} from "./chunk-8vj0rjgs.js";
|
|
78
|
+
isAbandonedFileUploadSession,
|
|
79
|
+
shouldDeleteFileUploadSession
|
|
80
|
+
} from "./chunk-h89wz928.js";
|
|
81
|
+
import {
|
|
82
|
+
DurableFileUploadSessions2
|
|
83
|
+
} from "./chunk-n33e8dz8.js";
|
|
91
84
|
import {
|
|
92
85
|
ExecutionStorageError2,
|
|
93
86
|
prepareExecutionRecord2,
|
|
94
87
|
cloneExecutionRecord
|
|
95
|
-
} from "./chunk-
|
|
96
|
-
import {
|
|
97
|
-
objectRefKey2,
|
|
98
|
-
linkRefKey2,
|
|
99
|
-
projectionEntityKey2,
|
|
100
|
-
telemetryPointKey2,
|
|
101
|
-
objectRefSortKey2,
|
|
102
|
-
linkRefSortKey2,
|
|
103
|
-
linkScopeKey,
|
|
104
|
-
linkScopeSortKey2,
|
|
105
|
-
telemetryPointSortKey2
|
|
106
|
-
} from "./chunk-c5rkjrgp.js";
|
|
88
|
+
} from "./chunk-tw03bsmb.js";
|
|
107
89
|
import {
|
|
90
|
+
sha256Canonical2,
|
|
108
91
|
createEventId2,
|
|
109
92
|
assertTimestamp2,
|
|
110
93
|
invalidCorrelation2,
|
|
@@ -123,6 +106,9 @@ import {
|
|
|
123
106
|
finishScopeAccumulator2,
|
|
124
107
|
ProviderMaterializationTransactionLifecycle2,
|
|
125
108
|
uniqueSorted2,
|
|
109
|
+
assertExpectedObjectRevision2,
|
|
110
|
+
assertExpectedLinkRevision2,
|
|
111
|
+
assertExpectedLinkScopeRevision2,
|
|
126
112
|
sourceStageRoots2,
|
|
127
113
|
sourceMaterializationIdentity2,
|
|
128
114
|
assertSourceBeginInput2,
|
|
@@ -133,7 +119,18 @@ import {
|
|
|
133
119
|
assertSourceStagedRow2,
|
|
134
120
|
isExactStagingManifest2,
|
|
135
121
|
sourceConflict2
|
|
136
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-ht4a7mjg.js";
|
|
123
|
+
import {
|
|
124
|
+
objectRefKey2,
|
|
125
|
+
linkRefKey2,
|
|
126
|
+
projectionEntityKey2,
|
|
127
|
+
telemetryPointKey2,
|
|
128
|
+
objectRefSortKey2,
|
|
129
|
+
linkRefSortKey2,
|
|
130
|
+
linkScopeKey,
|
|
131
|
+
linkScopeSortKey2,
|
|
132
|
+
telemetryPointSortKey2
|
|
133
|
+
} from "./chunk-7ytf06d3.js";
|
|
137
134
|
import {
|
|
138
135
|
createStorageOperationScope2,
|
|
139
136
|
createOperationScopedFacade2,
|
|
@@ -142,7 +139,7 @@ import {
|
|
|
142
139
|
createOntologyOperationScope2,
|
|
143
140
|
createObjectOperationScope2,
|
|
144
141
|
createWorkflowRunOperationScope2
|
|
145
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-mr60an99.js";
|
|
146
143
|
import {
|
|
147
144
|
PipelineRunError2,
|
|
148
145
|
assertPipelineRunExecution2
|
|
@@ -175,7 +172,7 @@ import {
|
|
|
175
172
|
assertProjectionMissingTarget2,
|
|
176
173
|
requireTelemetryProjectionRun2,
|
|
177
174
|
assertProjectionRunDurableExecution2
|
|
178
|
-
} from "./chunk-
|
|
175
|
+
} from "./chunk-znw0zvy4.js";
|
|
179
176
|
import {
|
|
180
177
|
SyncRunError2,
|
|
181
178
|
assertSyncRunExecution2
|
|
@@ -188,7 +185,18 @@ import {
|
|
|
188
185
|
WorkflowRunError2,
|
|
189
186
|
assertWorkflowRunExecution2,
|
|
190
187
|
assertWorkflowAgentNodeRunExecution2
|
|
191
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-darm7eeg.js";
|
|
189
|
+
import {
|
|
190
|
+
actionSubjectsEqual2,
|
|
191
|
+
actionRunPhaseRecordsEqual2,
|
|
192
|
+
canRequeueActionRunAfterEnqueueFailure2,
|
|
193
|
+
isTerminalActionRun2,
|
|
194
|
+
StorageTransactionError2,
|
|
195
|
+
canRequeuePipelineRunAfterEnqueueFailure2,
|
|
196
|
+
canRequeueSyncRunAfterEnqueueFailure2,
|
|
197
|
+
createTransactionStorageProxy2,
|
|
198
|
+
throwNestedStorageTransaction2
|
|
199
|
+
} from "./chunk-zdkcdshk.js";
|
|
192
200
|
import {
|
|
193
201
|
ShareGrantStorageError2,
|
|
194
202
|
normalizeShareGrantCreate2,
|
|
@@ -213,11 +221,11 @@ import {
|
|
|
213
221
|
} from "./chunk-2c4j899j.js";
|
|
214
222
|
import {
|
|
215
223
|
assertPinnedDatasetWatermark2
|
|
216
|
-
} from "./chunk-
|
|
224
|
+
} from "./chunk-3qpcrcj8.js";
|
|
217
225
|
import {
|
|
218
226
|
MaterializationValidationError2,
|
|
219
227
|
MaterializationConflictError2
|
|
220
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-96yw3pwd.js";
|
|
221
229
|
import {
|
|
222
230
|
AGENT_RUN_FAILURE_CODES2
|
|
223
231
|
} from "./chunk-98cw09sw.js";
|
|
@@ -517,7 +525,7 @@ function normalizeFailure(failure) {
|
|
|
517
525
|
return failure ? parseSixbFailure2(failure, AGENT_RUN_FAILURE_CODES2) : undefined;
|
|
518
526
|
}
|
|
519
527
|
function key(projectId, id) {
|
|
520
|
-
return
|
|
528
|
+
return JSON.stringify([projectId, id]);
|
|
521
529
|
}
|
|
522
530
|
function clone(value) {
|
|
523
531
|
return structuredClone(value);
|
|
@@ -544,7 +552,18 @@ class InMemoryAgentThreadStore {
|
|
|
544
552
|
constructor(state) {
|
|
545
553
|
this.state = state;
|
|
546
554
|
}
|
|
555
|
+
async transitionSandbox(input) {
|
|
556
|
+
const threadKey = key(input.projectId, input.id);
|
|
557
|
+
const thread = this.state.threads.get(threadKey) ?? null;
|
|
558
|
+
const run = input.action === "recreate" ? null : this.state.runs.get(key(input.projectId, input.runId)) ?? null;
|
|
559
|
+
const sandboxState = transitionAgentThreadSandbox2(thread, run, input);
|
|
560
|
+
if (!thread)
|
|
561
|
+
throw new AgentStorageError2("thread_not_found", "[Sixb] Thread not found.");
|
|
562
|
+
this.state.threads.set(threadKey, { ...thread, sandboxState: clone(sandboxState) });
|
|
563
|
+
return clone(sandboxState);
|
|
564
|
+
}
|
|
547
565
|
async create(input) {
|
|
566
|
+
const sandboxParams = input.sandboxParams === undefined ? undefined : snapshotAgentThreadSandboxParams2(input.sandboxParams);
|
|
548
567
|
const threadKey = key(input.projectId, input.id);
|
|
549
568
|
if (this.state.threads.has(threadKey)) {
|
|
550
569
|
throw new AgentStorageError2("duplicate_id", `[Sixb] Agent thread '${input.id}' already exists for project '${input.projectId}'.`);
|
|
@@ -554,6 +573,7 @@ class InMemoryAgentThreadStore {
|
|
|
554
573
|
id: input.id,
|
|
555
574
|
projectId: input.projectId,
|
|
556
575
|
ownerPrincipal: clone(input.ownerPrincipal),
|
|
576
|
+
...sandboxParams === undefined ? {} : { sandboxParams },
|
|
557
577
|
...input.title === undefined ? {} : { title: input.title },
|
|
558
578
|
status: input.status ?? "active",
|
|
559
579
|
activeRunId: null,
|
|
@@ -2410,18 +2430,18 @@ function applyStagedCredentials(record, staged, now, input) {
|
|
|
2410
2430
|
updatedAt: now
|
|
2411
2431
|
};
|
|
2412
2432
|
}
|
|
2413
|
-
// src/storage/file-upload-sessions/errors.ts
|
|
2414
|
-
class FileUploadSessionError2 extends Error {
|
|
2415
|
-
reason;
|
|
2416
|
-
name = "FileUploadSessionError";
|
|
2417
|
-
constructor(reason, message) {
|
|
2418
|
-
super(message);
|
|
2419
|
-
this.reason = reason;
|
|
2420
|
-
}
|
|
2421
|
-
}
|
|
2422
2433
|
// src/storage/file-upload-sessions/in-memory.ts
|
|
2423
|
-
class InMemoryFileUploadSessions2 {
|
|
2424
|
-
sessionsById
|
|
2434
|
+
class InMemoryFileUploadSessions2 extends DurableFileUploadSessions2 {
|
|
2435
|
+
sessionsById;
|
|
2436
|
+
constructor() {
|
|
2437
|
+
const sessionsById = new Map;
|
|
2438
|
+
super(new InMemoryFileUploadSessionBackend(sessionsById));
|
|
2439
|
+
this.sessionsById = sessionsById;
|
|
2440
|
+
}
|
|
2441
|
+
async create(input) {
|
|
2442
|
+
await this.cleanupExpired();
|
|
2443
|
+
return super.create(input);
|
|
2444
|
+
}
|
|
2425
2445
|
snapshot() {
|
|
2426
2446
|
return structuredClone(this.sessionsById);
|
|
2427
2447
|
}
|
|
@@ -2431,86 +2451,50 @@ class InMemoryFileUploadSessions2 {
|
|
|
2431
2451
|
this.sessionsById.set(id, structuredClone(session));
|
|
2432
2452
|
}
|
|
2433
2453
|
}
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
};
|
|
2452
|
-
this.sessionsById.set(session.id, session);
|
|
2453
|
-
return session;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
class InMemoryFileUploadSessionBackend {
|
|
2457
|
+
persistence;
|
|
2458
|
+
tail = Promise.resolve();
|
|
2459
|
+
constructor(sessionsById) {
|
|
2460
|
+
this.persistence = new InMemoryFileUploadSessionPersistence(sessionsById);
|
|
2461
|
+
}
|
|
2462
|
+
read(run) {
|
|
2463
|
+
return run(this.persistence);
|
|
2464
|
+
}
|
|
2465
|
+
transaction(run) {
|
|
2466
|
+
const result = this.tail.then(() => run(this.persistence));
|
|
2467
|
+
this.tail = result.catch(() => {
|
|
2468
|
+
return;
|
|
2469
|
+
});
|
|
2470
|
+
return result;
|
|
2454
2471
|
}
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
if (isFileUploadSessionExpired(session, nowMs)) {
|
|
2462
|
-
this.sessionsById.delete(uploadId);
|
|
2463
|
-
throw new FileUploadSessionError2("expired", "File upload session has expired.");
|
|
2464
|
-
}
|
|
2465
|
-
if (isTerminalFileUploadSessionExpired(session, nowMs)) {
|
|
2466
|
-
this.sessionsById.delete(uploadId);
|
|
2467
|
-
throw new FileUploadSessionError2("not_found", "File upload session not found.");
|
|
2468
|
-
}
|
|
2469
|
-
return session;
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
class InMemoryFileUploadSessionPersistence {
|
|
2475
|
+
sessionsById;
|
|
2476
|
+
constructor(sessionsById) {
|
|
2477
|
+
this.sessionsById = sessionsById;
|
|
2470
2478
|
}
|
|
2471
|
-
async
|
|
2472
|
-
|
|
2473
|
-
const updated = {
|
|
2474
|
-
...session,
|
|
2475
|
-
fileRef
|
|
2476
|
-
};
|
|
2477
|
-
this.sessionsById.set(uploadId, updated);
|
|
2478
|
-
return updated;
|
|
2479
|
+
async now() {
|
|
2480
|
+
return new Date;
|
|
2479
2481
|
}
|
|
2480
|
-
async
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
...session.signedParts.filter((candidate) => candidate.partNumber !== part.partNumber),
|
|
2486
|
-
part
|
|
2487
|
-
].sort((left, right) => left.partNumber - right.partNumber)
|
|
2488
|
-
};
|
|
2489
|
-
this.sessionsById.set(uploadId, updated);
|
|
2490
|
-
return updated;
|
|
2482
|
+
async insert(session) {
|
|
2483
|
+
if (this.sessionsById.has(session.id))
|
|
2484
|
+
return false;
|
|
2485
|
+
this.sessionsById.set(session.id, session);
|
|
2486
|
+
return true;
|
|
2491
2487
|
}
|
|
2492
|
-
async
|
|
2493
|
-
|
|
2494
|
-
const updated = {
|
|
2495
|
-
...session,
|
|
2496
|
-
status: "completed",
|
|
2497
|
-
fileRef,
|
|
2498
|
-
completedAt: new Date
|
|
2499
|
-
};
|
|
2500
|
-
this.sessionsById.set(uploadId, updated);
|
|
2501
|
-
return updated;
|
|
2488
|
+
async get(uploadId) {
|
|
2489
|
+
return this.sessionsById.get(uploadId) ?? null;
|
|
2502
2490
|
}
|
|
2503
|
-
async
|
|
2504
|
-
|
|
2505
|
-
const updated = {
|
|
2506
|
-
...session,
|
|
2507
|
-
status: "aborted",
|
|
2508
|
-
abortedAt: new Date
|
|
2509
|
-
};
|
|
2510
|
-
this.sessionsById.set(uploadId, updated);
|
|
2511
|
-
return updated;
|
|
2491
|
+
async update(session) {
|
|
2492
|
+
this.sessionsById.set(session.id, session);
|
|
2512
2493
|
}
|
|
2513
|
-
async
|
|
2494
|
+
async listAbandoned(input) {
|
|
2495
|
+
return [...this.sessionsById.values()].filter((session) => session.projectId === input.projectId && isAbandonedFileUploadSession(session, input.now.getTime())).sort((left, right) => left.expiresAt.getTime() - right.expiresAt.getTime()).slice(0, input.limit);
|
|
2496
|
+
}
|
|
2497
|
+
async deleteReapable(now) {
|
|
2514
2498
|
let deleted = 0;
|
|
2515
2499
|
for (const [id, session] of this.sessionsById) {
|
|
2516
2500
|
if (shouldDeleteFileUploadSession(session, now.getTime())) {
|
|
@@ -2520,16 +2504,6 @@ class InMemoryFileUploadSessions2 {
|
|
|
2520
2504
|
}
|
|
2521
2505
|
return deleted;
|
|
2522
2506
|
}
|
|
2523
|
-
requirePending(uploadId) {
|
|
2524
|
-
const session = this.sessionsById.get(uploadId);
|
|
2525
|
-
if (!session) {
|
|
2526
|
-
throw new FileUploadSessionError2("not_found", "File upload session not found.");
|
|
2527
|
-
}
|
|
2528
|
-
if (session.status !== "pending") {
|
|
2529
|
-
throw new FileUploadSessionError2(session.status === "completed" ? "already_completed" : "already_aborted", `File upload session is already ${session.status}.`);
|
|
2530
|
-
}
|
|
2531
|
-
return session;
|
|
2532
|
-
}
|
|
2533
2507
|
}
|
|
2534
2508
|
// src/storage/in-memory/index.ts
|
|
2535
2509
|
import { AsyncLocalStorage } from "async_hooks";
|
|
@@ -2585,6 +2559,25 @@ class InMemoryExecutionStorage {
|
|
|
2585
2559
|
}
|
|
2586
2560
|
}
|
|
2587
2561
|
|
|
2562
|
+
// src/objects/vectors/query.ts
|
|
2563
|
+
function hasVectorProfile2(query) {
|
|
2564
|
+
if (query.kind === "vector")
|
|
2565
|
+
return true;
|
|
2566
|
+
if (query.kind === "set")
|
|
2567
|
+
return query.inputs.some(hasVectorProfile2);
|
|
2568
|
+
return "input" in query && hasVectorProfile2(query.input);
|
|
2569
|
+
}
|
|
2570
|
+
function isVectorProfileQuery2(query) {
|
|
2571
|
+
if (query.kind === "limit" || query.kind === "project")
|
|
2572
|
+
return isVectorProfileQuery2(query.input);
|
|
2573
|
+
if (query.kind !== "vector" || !query.profile)
|
|
2574
|
+
return false;
|
|
2575
|
+
let input = query.input;
|
|
2576
|
+
while (input.kind === "filter")
|
|
2577
|
+
input = input.input;
|
|
2578
|
+
return input.kind === "start" && !input.includeSubtypes;
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2588
2581
|
// src/storage/objects/keys.ts
|
|
2589
2582
|
function objectBatchKey2(objectTypeId, primaryId) {
|
|
2590
2583
|
return JSON.stringify([objectTypeId, primaryId]);
|
|
@@ -2665,6 +2658,8 @@ function compareQueryScalarValues(left, right, scalarKind) {
|
|
|
2665
2658
|
case "date":
|
|
2666
2659
|
case "timestamp":
|
|
2667
2660
|
return compareTemporalValues(left, right);
|
|
2661
|
+
case "userRef":
|
|
2662
|
+
return Number.NaN;
|
|
2668
2663
|
}
|
|
2669
2664
|
}
|
|
2670
2665
|
function queryScalarValuesEqual(left, right, scalarKind) {
|
|
@@ -2676,10 +2671,20 @@ function queryScalarValuesEqual(left, right, scalarKind) {
|
|
|
2676
2671
|
const comparison = compareTemporalValues(left, right);
|
|
2677
2672
|
return !Number.isNaN(comparison) && comparison === 0;
|
|
2678
2673
|
}
|
|
2674
|
+
if (scalarKind === "userRef")
|
|
2675
|
+
return userRefsEqual(left, right);
|
|
2679
2676
|
if (scalarKind !== undefined)
|
|
2680
2677
|
return Object.is(left, right);
|
|
2681
2678
|
return runtimeValuesEqual(left, right);
|
|
2682
2679
|
}
|
|
2680
|
+
function userRefsEqual(left, right) {
|
|
2681
|
+
if (left === null || right === null)
|
|
2682
|
+
return left === right;
|
|
2683
|
+
return isRecord(left) && isRecord(right) && left.type === right.type && typeof left.id === "string" && left.id === right.id;
|
|
2684
|
+
}
|
|
2685
|
+
function isRecord(value) {
|
|
2686
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2687
|
+
}
|
|
2683
2688
|
function compareRuntimeValues(left, right) {
|
|
2684
2689
|
if (typeof left === "number" && typeof right === "number")
|
|
2685
2690
|
return left - right;
|
|
@@ -2725,6 +2730,54 @@ function compareStrings2(left, right) {
|
|
|
2725
2730
|
return 0;
|
|
2726
2731
|
}
|
|
2727
2732
|
|
|
2733
|
+
// src/objects/vectors/profile.ts
|
|
2734
|
+
var MAX_VECTOR_K = 1000;
|
|
2735
|
+
var VECTOR_INPUT_VERSION = 1;
|
|
2736
|
+
function vectorConfiguration(profile) {
|
|
2737
|
+
return sha256Canonical2({
|
|
2738
|
+
format: VECTOR_INPUT_VERSION,
|
|
2739
|
+
sources: [...profile.source],
|
|
2740
|
+
provider: profile.model.providerId,
|
|
2741
|
+
model: profile.model.modelId,
|
|
2742
|
+
representation: profile.model.definition.representation ?? { name: profile.model.modelId },
|
|
2743
|
+
dimensions: profile.model.definition.dimensions,
|
|
2744
|
+
metric: "cosine",
|
|
2745
|
+
precision: "float32",
|
|
2746
|
+
normalization: "l2-v1"
|
|
2747
|
+
});
|
|
2748
|
+
}
|
|
2749
|
+
function vectorSources(source, properties) {
|
|
2750
|
+
const values = Object.create(null);
|
|
2751
|
+
for (const key of source) {
|
|
2752
|
+
const value = properties[key];
|
|
2753
|
+
if (value !== undefined && value !== null && typeof value !== "string") {
|
|
2754
|
+
throw new MaterializationValidationError2(`Vector source must be text: ${key}`);
|
|
2755
|
+
}
|
|
2756
|
+
values[key] = typeof value === "string" ? value : null;
|
|
2757
|
+
}
|
|
2758
|
+
const text = JSON.stringify(source.map((key) => [key, values[key]]));
|
|
2759
|
+
return { text, sourceFingerprint: sha256Canonical2(text) };
|
|
2760
|
+
}
|
|
2761
|
+
function normalizeVector2(values, dimensions) {
|
|
2762
|
+
if (!Array.isArray(values) || values.length !== dimensions) {
|
|
2763
|
+
throw new MaterializationValidationError2(`Vector dimension mismatch; expected ${dimensions}`);
|
|
2764
|
+
}
|
|
2765
|
+
const normalized = Array.from(values, (value) => {
|
|
2766
|
+
if (typeof value !== "number" || !Number.isFinite(value) || !Number.isFinite(Math.fround(value))) {
|
|
2767
|
+
throw new MaterializationValidationError2("Vector values must be finite float32 numbers.");
|
|
2768
|
+
}
|
|
2769
|
+
return Math.fround(value);
|
|
2770
|
+
});
|
|
2771
|
+
if (!normalized.some((value) => value !== 0)) {
|
|
2772
|
+
throw new MaterializationValidationError2("Cosine search requires a nonzero vector.");
|
|
2773
|
+
}
|
|
2774
|
+
const norm = Math.hypot(...normalized);
|
|
2775
|
+
return Object.freeze(normalized.map((value) => Math.fround(value / norm)));
|
|
2776
|
+
}
|
|
2777
|
+
function vectorSearchCandidateLimit2(dimensions) {
|
|
2778
|
+
return Math.min(1e4, Math.floor(16000000 / dimensions));
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2728
2781
|
// src/storage/objects/in-memory/query.ts
|
|
2729
2782
|
var IN_MEMORY_OBJECT_QUERY_CAPABILITIES = {
|
|
2730
2783
|
queryObjects: true,
|
|
@@ -2779,7 +2832,8 @@ var IN_MEMORY_OBJECT_QUERY_CAPABILITIES = {
|
|
|
2779
2832
|
double: { equality: true, ordering: true },
|
|
2780
2833
|
decimal: { equality: true, ordering: true },
|
|
2781
2834
|
date: { equality: true, ordering: true },
|
|
2782
|
-
timestamp: { equality: true, ordering: true }
|
|
2835
|
+
timestamp: { equality: true, ordering: true },
|
|
2836
|
+
userRef: { equality: true }
|
|
2783
2837
|
},
|
|
2784
2838
|
limits: {
|
|
2785
2839
|
totalCount: true,
|
|
@@ -2812,17 +2866,23 @@ function evaluateObjectQuery(query, source) {
|
|
|
2812
2866
|
return completeEvaluation(scoredEntries);
|
|
2813
2867
|
}
|
|
2814
2868
|
case "vector": {
|
|
2869
|
+
if (typeof query.vector === "string")
|
|
2870
|
+
throw new Error("[Sixb] Vector search text must be embedded before storage execution.");
|
|
2871
|
+
const vector = query.vector;
|
|
2815
2872
|
const input = evaluateObjectQuery(query.input, source);
|
|
2816
2873
|
const scoredEntries = input.entries.flatMap((entry) => {
|
|
2817
|
-
const
|
|
2818
|
-
|
|
2874
|
+
const stored = source.getVector?.(entry.row, query.profile);
|
|
2875
|
+
if (!stored || !query.configuration || stored.configuration !== query.configuration || vectorSources(stored.source, entry.row.properties).sourceFingerprint !== stored.sourceFingerprint)
|
|
2876
|
+
return [];
|
|
2877
|
+
const score = vectorSimilarity(stored.values, vector);
|
|
2878
|
+
return score === null ? [] : [{ ...entry, score: entry.score + Math.max(-1, Math.min(1, score)) }];
|
|
2819
2879
|
});
|
|
2820
|
-
scoredEntries.sort(
|
|
2880
|
+
scoredEntries.sort((a, b) => b.score - a.score || Buffer.compare(Buffer.from(a.row.objectTypeId), Buffer.from(b.row.objectTypeId)) || Buffer.compare(Buffer.from(a.row.primaryId), Buffer.from(b.row.primaryId)));
|
|
2821
2881
|
const limit = Math.max(0, query.k);
|
|
2822
2882
|
return {
|
|
2823
2883
|
entries: scoredEntries.slice(0, limit),
|
|
2824
|
-
total: scoredEntries.length,
|
|
2825
|
-
hasMore:
|
|
2884
|
+
total: Math.min(limit, scoredEntries.length),
|
|
2885
|
+
hasMore: false
|
|
2826
2886
|
};
|
|
2827
2887
|
}
|
|
2828
2888
|
case "traverse": {
|
|
@@ -3000,15 +3060,15 @@ function matchesPredicate(row, predicate) {
|
|
|
3000
3060
|
return predicate.value ? exists : !exists;
|
|
3001
3061
|
}
|
|
3002
3062
|
case "contains":
|
|
3003
|
-
return containsValue(row.properties[predicate.propertyId], predicate.value);
|
|
3063
|
+
return containsValue(row.properties[predicate.propertyId], predicate.value, predicate.scalarKind);
|
|
3004
3064
|
}
|
|
3005
3065
|
}
|
|
3006
|
-
function containsValue(actual, expected) {
|
|
3066
|
+
function containsValue(actual, expected, itemScalarKind) {
|
|
3007
3067
|
if (typeof actual === "string" && typeof expected === "string") {
|
|
3008
3068
|
return actual.includes(expected);
|
|
3009
3069
|
}
|
|
3010
3070
|
if (Array.isArray(actual)) {
|
|
3011
|
-
return actual.some((item) => queryScalarValuesEqual(item, expected));
|
|
3071
|
+
return actual.some((item) => queryScalarValuesEqual(item, expected, itemScalarKind));
|
|
3012
3072
|
}
|
|
3013
3073
|
if (isPlainObject(actual) && typeof expected === "string") {
|
|
3014
3074
|
return Object.hasOwn(actual, expected);
|
|
@@ -3101,9 +3161,6 @@ function compareSortField(left, right, field) {
|
|
|
3101
3161
|
return 0;
|
|
3102
3162
|
return field.direction === "desc" ? -comparison : comparison;
|
|
3103
3163
|
}
|
|
3104
|
-
function compareEntriesByRelevance(left, right) {
|
|
3105
|
-
return right.score - left.score || rowIdentityKey(left.row).localeCompare(rowIdentityKey(right.row));
|
|
3106
|
-
}
|
|
3107
3164
|
function projectRow(row, properties) {
|
|
3108
3165
|
const projected = {};
|
|
3109
3166
|
for (const propertyId of properties) {
|
|
@@ -3346,9 +3403,10 @@ function resolveSelectedReadUniverse(source, plan, limits) {
|
|
|
3346
3403
|
}
|
|
3347
3404
|
links.set(key, redactLinkRow(selected.row, selected.propertyIds));
|
|
3348
3405
|
}
|
|
3349
|
-
return createReadUniverse(source
|
|
3406
|
+
return createReadUniverse(source, objects, links, objectProperties);
|
|
3350
3407
|
}
|
|
3351
|
-
function createReadUniverse(
|
|
3408
|
+
function createReadUniverse(source, objects, links, objectProperties) {
|
|
3409
|
+
const projectId = source.projectId;
|
|
3352
3410
|
const linksBySource = new Map;
|
|
3353
3411
|
for (const link of links.values()) {
|
|
3354
3412
|
const key = sourceLinkBucketKey(link.projectId, link.sourceTypeId, link.sourceId);
|
|
@@ -3362,6 +3420,13 @@ function createReadUniverse(projectId, objects, links, objectProperties) {
|
|
|
3362
3420
|
links,
|
|
3363
3421
|
linksBySource,
|
|
3364
3422
|
objectProperties,
|
|
3423
|
+
getVector: (ref, profile) => {
|
|
3424
|
+
const key = rowIdentityKeyParts(ref.objectTypeId, ref.primaryId);
|
|
3425
|
+
if (!objects.has(key))
|
|
3426
|
+
return;
|
|
3427
|
+
const value = source.getVector?.(ref, profile);
|
|
3428
|
+
return value?.source.every((id) => objectProperties.get(key)?.has(id)) ? value : undefined;
|
|
3429
|
+
},
|
|
3365
3430
|
objectsOfType: (objectTypeId) => [...objects.values()].filter((row) => row.objectTypeId === objectTypeId),
|
|
3366
3431
|
getObject: (objectTypeId, primaryId) => objects.get(rowIdentityKeyParts(objectTypeId, primaryId)),
|
|
3367
3432
|
outgoingLinks: (objectTypeId, primaryId) => linksBySource.get(sourceLinkBucketKey(projectId, objectTypeId, primaryId)) ?? [],
|
|
@@ -3425,7 +3490,10 @@ function createInMemorySelectedReader(source, params, queryCapabilities) {
|
|
|
3425
3490
|
const universe = resolveSelectedReadUniverse(source, plan, limits);
|
|
3426
3491
|
const result = evaluateObjectQuery(input.query, universe);
|
|
3427
3492
|
return visible({
|
|
3428
|
-
objects: result.entries.map((entry) =>
|
|
3493
|
+
objects: result.entries.map((entry) => ({
|
|
3494
|
+
...structuredClone(entry.row),
|
|
3495
|
+
...hasVectorProfile2(input.query) ? { score: entry.score } : {}
|
|
3496
|
+
})),
|
|
3429
3497
|
hasMore: result.hasMore,
|
|
3430
3498
|
nextPageToken: result.nextPageToken,
|
|
3431
3499
|
...input.includeTotal === false ? {} : { total: result.total }
|
|
@@ -3553,8 +3621,12 @@ function getInMemoryObjectMaterializerAdapter(storage) {
|
|
|
3553
3621
|
class InMemoryObjectStorage {
|
|
3554
3622
|
rows = new Map;
|
|
3555
3623
|
links = new Map;
|
|
3624
|
+
vectorReader;
|
|
3556
3625
|
constructor() {
|
|
3557
3626
|
materializerAdapters.set(this, {
|
|
3627
|
+
setVectorReader: (reader) => {
|
|
3628
|
+
this.vectorReader = reader;
|
|
3629
|
+
},
|
|
3558
3630
|
getExactObjectRow: (projectId, objectTypeId, primaryId) => this.getExactObjectRow(projectId, objectTypeId, primaryId),
|
|
3559
3631
|
getExactLinkRow: (projectId, ref) => this.getExactLinkRow(projectId, ref),
|
|
3560
3632
|
applyExactObject: (row, projectId) => this.applyExactObject(row, projectId),
|
|
@@ -3651,6 +3723,7 @@ class InMemoryObjectStorage {
|
|
|
3651
3723
|
readSource(projectId) {
|
|
3652
3724
|
return {
|
|
3653
3725
|
projectId,
|
|
3726
|
+
getVector: (ref, profile) => this.vectorReader?.(projectId, ref, profile),
|
|
3654
3727
|
objectsOfType: (objectTypeId) => [
|
|
3655
3728
|
...this.rows.get(objectRowKey(projectId, objectTypeId))?.values() ?? []
|
|
3656
3729
|
],
|
|
@@ -3662,7 +3735,10 @@ class InMemoryObjectStorage {
|
|
|
3662
3735
|
async queryObjects(params) {
|
|
3663
3736
|
const result = evaluateObjectQuery(params.query, this.readSource(params.projectId));
|
|
3664
3737
|
return {
|
|
3665
|
-
objects: result.entries.map((entry) =>
|
|
3738
|
+
objects: result.entries.map((entry) => ({
|
|
3739
|
+
...entry.row,
|
|
3740
|
+
...hasVectorProfile2(params.query) ? { score: entry.score } : {}
|
|
3741
|
+
})),
|
|
3666
3742
|
hasMore: result.hasMore,
|
|
3667
3743
|
nextPageToken: result.nextPageToken,
|
|
3668
3744
|
...params.includeTotal === false ? {} : { total: result.total }
|
|
@@ -3854,6 +3930,8 @@ function* allLinkRows(buckets) {
|
|
|
3854
3930
|
// src/storage/ontology/in-memory/shared-state.ts
|
|
3855
3931
|
function createInMemoryOntologyState() {
|
|
3856
3932
|
return {
|
|
3933
|
+
vectors: new Map,
|
|
3934
|
+
vectorIndexing: new Map,
|
|
3857
3935
|
commitsById: new Map,
|
|
3858
3936
|
commitIdByIdempotency: new Map,
|
|
3859
3937
|
commitIdByOrigin: new Map,
|
|
@@ -4696,9 +4774,7 @@ class InMemoryOntologyMaterializationStorage {
|
|
|
4696
4774
|
const key = linkScopeSortKey2(expected.source, expected.linkId);
|
|
4697
4775
|
const current = expectedScopeRevisions.get(key) ?? this.computeEffectiveLinkScope(input.commit.projectId, expected.source, expected.linkId);
|
|
4698
4776
|
expectedScopeRevisions.set(key, current);
|
|
4699
|
-
|
|
4700
|
-
throw new MaterializationConflictError2("effective-state", `Expected link scope changed for ${expected.source.objectTypeId}:${expected.source.primaryId}.${expected.linkId}.`);
|
|
4701
|
-
}
|
|
4777
|
+
assertExpectedLinkScopeRevision2(current.fingerprint, expected);
|
|
4702
4778
|
}
|
|
4703
4779
|
for (const expected of input.expected.points)
|
|
4704
4780
|
this.assertPoint(expected, input.commit.projectId);
|
|
@@ -5140,6 +5216,12 @@ class InMemoryOntologyMaterializationStorage {
|
|
|
5140
5216
|
this.releaseSession(session);
|
|
5141
5217
|
return { commit: structuredClone(record) };
|
|
5142
5218
|
}
|
|
5219
|
+
assertVectorSession(session, projectId, commitId) {
|
|
5220
|
+
const active = this.requireSession(session);
|
|
5221
|
+
if (active.header.commit.projectId !== projectId || commitId !== undefined && active.header.commit.id !== commitId) {
|
|
5222
|
+
throw new MaterializationValidationError2("Vector mutation does not belong to this materialization session.");
|
|
5223
|
+
}
|
|
5224
|
+
}
|
|
5143
5225
|
requireSession(session) {
|
|
5144
5226
|
const value = this.sessions.get(session.providerToken);
|
|
5145
5227
|
if (!value || !value.active || !this.getTransactionToken() || this.getTransactionToken() !== value.transactionToken) {
|
|
@@ -5279,14 +5361,7 @@ class InMemoryOntologyMaterializationStorage {
|
|
|
5279
5361
|
}
|
|
5280
5362
|
assertObjectSync(expected, projectId) {
|
|
5281
5363
|
const row = getInMemoryObjectMaterializerAdapter(this.objects).getExactObjectRow(projectId, expected.ref.objectTypeId, expected.ref.primaryId);
|
|
5282
|
-
|
|
5283
|
-
if (row)
|
|
5284
|
-
throw new MaterializationConflictError2("effective-state", `Expected object ${objectRefKey2(expected.ref)} to be absent.`);
|
|
5285
|
-
return;
|
|
5286
|
-
}
|
|
5287
|
-
if (!row || row.version !== expected.version || row.lastCommitId !== expected.lastCommitId) {
|
|
5288
|
-
throw new MaterializationConflictError2("effective-state", `Expected object ${objectRefKey2(expected.ref)} changed.`);
|
|
5289
|
-
}
|
|
5364
|
+
assertExpectedObjectRevision2(row ?? null, expected);
|
|
5290
5365
|
}
|
|
5291
5366
|
async assertLink(expected, projectId) {
|
|
5292
5367
|
this.assertLinkSync(expected, projectId);
|
|
@@ -5299,14 +5374,7 @@ class InMemoryOntologyMaterializationStorage {
|
|
|
5299
5374
|
targetTypeId: expected.ref.target.objectTypeId,
|
|
5300
5375
|
targetId: expected.ref.target.primaryId
|
|
5301
5376
|
});
|
|
5302
|
-
|
|
5303
|
-
if (row)
|
|
5304
|
-
throw new MaterializationConflictError2("effective-state", `Expected link ${linkRefKey2(expected.ref)} to be absent.`);
|
|
5305
|
-
return;
|
|
5306
|
-
}
|
|
5307
|
-
if (!row || row.lastCommitId !== expected.lastCommitId) {
|
|
5308
|
-
throw new MaterializationConflictError2("effective-state", `Expected link ${linkRefKey2(expected.ref)} changed.`);
|
|
5309
|
-
}
|
|
5377
|
+
assertExpectedLinkRevision2(row?.lastCommitId, expected);
|
|
5310
5378
|
}
|
|
5311
5379
|
assertPoint(expected, projectId) {
|
|
5312
5380
|
const point = getInMemoryTimeseriesMaterializerAdapter(this.timeseries).getExactPoint(projectId, expected.series, expected.at);
|
|
@@ -6000,9 +6068,188 @@ function registerInMemoryOntologyStorageTestingAdapter(storage, adapter) {
|
|
|
6000
6068
|
testingAdapters.set(storage, adapter);
|
|
6001
6069
|
}
|
|
6002
6070
|
|
|
6071
|
+
// src/storage/ontology/in-memory/vector-indexing.ts
|
|
6072
|
+
class InMemoryVectorIndexingStorage {
|
|
6073
|
+
state;
|
|
6074
|
+
assertSession;
|
|
6075
|
+
run;
|
|
6076
|
+
constructor(state, assertSession, run) {
|
|
6077
|
+
this.state = state;
|
|
6078
|
+
this.assertSession = assertSession;
|
|
6079
|
+
this.run = run;
|
|
6080
|
+
}
|
|
6081
|
+
async schedule(input) {
|
|
6082
|
+
this.assertSession(input.session, input.projectId);
|
|
6083
|
+
if (input.deleted.length) {
|
|
6084
|
+
const deleted = new Set(input.deleted.map((ref) => JSON.stringify([ref.objectTypeId, ref.primaryId])));
|
|
6085
|
+
for (const [key, work] of this.state) {
|
|
6086
|
+
if (work.projectId === input.projectId && deleted.has(JSON.stringify([work.ref.objectTypeId, work.ref.primaryId])))
|
|
6087
|
+
this.state.delete(key);
|
|
6088
|
+
}
|
|
6089
|
+
}
|
|
6090
|
+
for (const request of input.requests) {
|
|
6091
|
+
const key = JSON.stringify([
|
|
6092
|
+
input.projectId,
|
|
6093
|
+
request.ref.objectTypeId,
|
|
6094
|
+
request.ref.primaryId,
|
|
6095
|
+
request.profile
|
|
6096
|
+
]);
|
|
6097
|
+
this.state.set(key, structuredClone({
|
|
6098
|
+
...request,
|
|
6099
|
+
projectId: input.projectId,
|
|
6100
|
+
status: "pending",
|
|
6101
|
+
availableAt: input.availableAt,
|
|
6102
|
+
dispatchAt: input.availableAt
|
|
6103
|
+
}));
|
|
6104
|
+
}
|
|
6105
|
+
}
|
|
6106
|
+
async complete(input) {
|
|
6107
|
+
this.assertSession(input.session, input.projectId);
|
|
6108
|
+
for (const entry of input.entries) {
|
|
6109
|
+
const key = JSON.stringify([
|
|
6110
|
+
input.projectId,
|
|
6111
|
+
entry.ref.objectTypeId,
|
|
6112
|
+
entry.ref.primaryId,
|
|
6113
|
+
entry.profile
|
|
6114
|
+
]);
|
|
6115
|
+
const work = this.state.get(key);
|
|
6116
|
+
if (work?.configuration === entry.configuration && work.sourceFingerprint === entry.sourceFingerprint) {
|
|
6117
|
+
this.state.delete(key);
|
|
6118
|
+
}
|
|
6119
|
+
}
|
|
6120
|
+
}
|
|
6121
|
+
async dispatched(input) {
|
|
6122
|
+
await this.run(() => {
|
|
6123
|
+
for (const [key, work] of this.state)
|
|
6124
|
+
if (work.projectId === input.projectId && input.ids.includes(work.id))
|
|
6125
|
+
this.state.set(key, { ...work, dispatchAt: input.nextDispatchAt });
|
|
6126
|
+
});
|
|
6127
|
+
}
|
|
6128
|
+
async get(input) {
|
|
6129
|
+
return this.run(() => structuredClone([...this.state.values()].find((work) => work.projectId === input.projectId && work.id === input.id) ?? null));
|
|
6130
|
+
}
|
|
6131
|
+
async getBatch(input) {
|
|
6132
|
+
return this.run(() => structuredClone([...this.state.values()].filter((work) => work.projectId === input.projectId && work.batchId === input.batchId).sort((a, b) => a.id.localeCompare(b.id))));
|
|
6133
|
+
}
|
|
6134
|
+
async getBatchMember(input) {
|
|
6135
|
+
return this.run(() => {
|
|
6136
|
+
const work = this.state.get(JSON.stringify([
|
|
6137
|
+
input.projectId,
|
|
6138
|
+
input.ref.objectTypeId,
|
|
6139
|
+
input.ref.primaryId,
|
|
6140
|
+
input.profile
|
|
6141
|
+
]));
|
|
6142
|
+
return work?.batchId === input.batchId ? structuredClone(work) : null;
|
|
6143
|
+
});
|
|
6144
|
+
}
|
|
6145
|
+
async updateBatch(input) {
|
|
6146
|
+
return this.run(() => {
|
|
6147
|
+
const updates = new Map(input.updates.map((update) => [update.id, update]));
|
|
6148
|
+
const matches = [...this.state.entries()].filter(([, work]) => work.projectId === input.projectId && updates.get(work.id)?.expectedStatus === work.status);
|
|
6149
|
+
if (input.requireAll && matches.length !== input.updates.length)
|
|
6150
|
+
return false;
|
|
6151
|
+
for (const [key, work] of matches) {
|
|
6152
|
+
const update = updates.get(work.id);
|
|
6153
|
+
this.state.set(key, structuredClone({
|
|
6154
|
+
...work,
|
|
6155
|
+
status: update.status,
|
|
6156
|
+
availableAt: update.availableAt,
|
|
6157
|
+
values: update.values ?? work.values,
|
|
6158
|
+
error: update.error
|
|
6159
|
+
}));
|
|
6160
|
+
}
|
|
6161
|
+
return true;
|
|
6162
|
+
});
|
|
6163
|
+
}
|
|
6164
|
+
async listDue(input) {
|
|
6165
|
+
return this.run(() => [...this.state.values()].filter((work) => work.projectId === input.projectId && work.status !== "failed" && work.dispatchAt <= input.now).sort((a, b) => a.dispatchAt.localeCompare(b.dispatchAt) || a.id.localeCompare(b.id)).slice(0, input.limit).map(({ values: _values, ...work }) => structuredClone(work)));
|
|
6166
|
+
}
|
|
6167
|
+
async update(input) {
|
|
6168
|
+
return this.run(() => {
|
|
6169
|
+
for (const [key, work] of this.state) {
|
|
6170
|
+
if (work.projectId !== input.projectId || work.id !== input.id || work.status !== input.expectedStatus)
|
|
6171
|
+
continue;
|
|
6172
|
+
this.state.set(key, structuredClone({
|
|
6173
|
+
...work,
|
|
6174
|
+
status: input.status,
|
|
6175
|
+
availableAt: input.availableAt,
|
|
6176
|
+
values: input.values ?? work.values,
|
|
6177
|
+
error: input.error
|
|
6178
|
+
}));
|
|
6179
|
+
return true;
|
|
6180
|
+
}
|
|
6181
|
+
return false;
|
|
6182
|
+
});
|
|
6183
|
+
}
|
|
6184
|
+
async remove(input) {
|
|
6185
|
+
await this.run(() => {
|
|
6186
|
+
for (const [key, work] of this.state)
|
|
6187
|
+
if (work.projectId === input.projectId && work.id === input.id)
|
|
6188
|
+
this.state.delete(key);
|
|
6189
|
+
});
|
|
6190
|
+
}
|
|
6191
|
+
}
|
|
6192
|
+
|
|
6193
|
+
// src/storage/ontology/in-memory/vectors.ts
|
|
6194
|
+
function vectorObjectKey(projectId, ref) {
|
|
6195
|
+
return JSON.stringify([projectId, ref.objectTypeId, ref.primaryId]);
|
|
6196
|
+
}
|
|
6197
|
+
|
|
6198
|
+
class InMemoryOntologyVectorStorage {
|
|
6199
|
+
state;
|
|
6200
|
+
assertSession;
|
|
6201
|
+
runRootOperation;
|
|
6202
|
+
constructor(state, assertSession, runRootOperation) {
|
|
6203
|
+
this.state = state;
|
|
6204
|
+
this.assertSession = assertSession;
|
|
6205
|
+
this.runRootOperation = runRootOperation;
|
|
6206
|
+
}
|
|
6207
|
+
async list(input) {
|
|
6208
|
+
return this.listBatch({ projectId: input.projectId, refs: [input.ref] });
|
|
6209
|
+
}
|
|
6210
|
+
async listBatch(input) {
|
|
6211
|
+
return this.runRootOperation(() => [...new Set(input.refs.map((ref) => vectorObjectKey(input.projectId, ref)))].flatMap((key) => [...this.state.get(key)?.values() ?? []].map(({ values: _values, ...metadata }) => structuredClone(metadata))));
|
|
6212
|
+
}
|
|
6213
|
+
async removeBatch(input) {
|
|
6214
|
+
this.assertSession(input.session, input.projectId);
|
|
6215
|
+
for (const entry of input.entries) {
|
|
6216
|
+
await this.remove({ session: input.session, projectId: input.projectId, ...entry });
|
|
6217
|
+
}
|
|
6218
|
+
}
|
|
6219
|
+
async write(input) {
|
|
6220
|
+
this.assertSession(input.session, input.projectId, input.value.lastCommitId);
|
|
6221
|
+
const key = vectorObjectKey(input.projectId, input.value.ref);
|
|
6222
|
+
const profiles = this.state.get(key) ?? new Map;
|
|
6223
|
+
this.assertRevision(profiles.get(input.value.profile), input.expectedCommitId);
|
|
6224
|
+
profiles.set(input.value.profile, structuredClone(input.value));
|
|
6225
|
+
this.state.set(key, profiles);
|
|
6226
|
+
}
|
|
6227
|
+
async writeBatch(input) {
|
|
6228
|
+
for (const entry of input.entries) {
|
|
6229
|
+
await this.write({ session: input.session, projectId: input.projectId, ...entry });
|
|
6230
|
+
}
|
|
6231
|
+
}
|
|
6232
|
+
async remove(input) {
|
|
6233
|
+
this.assertSession(input.session, input.projectId);
|
|
6234
|
+
const key = vectorObjectKey(input.projectId, input.ref);
|
|
6235
|
+
const profiles = this.state.get(key);
|
|
6236
|
+
this.assertRevision(profiles?.get(input.profile), input.expectedCommitId);
|
|
6237
|
+
profiles?.delete(input.profile);
|
|
6238
|
+
if (profiles?.size === 0)
|
|
6239
|
+
this.state.delete(key);
|
|
6240
|
+
}
|
|
6241
|
+
assertRevision(current, expected) {
|
|
6242
|
+
if ((current?.lastCommitId ?? null) !== expected) {
|
|
6243
|
+
throw new MaterializationConflictError2("effective-state", "Vector changed since it was prepared.");
|
|
6244
|
+
}
|
|
6245
|
+
}
|
|
6246
|
+
}
|
|
6247
|
+
|
|
6003
6248
|
// src/storage/ontology/in-memory/index.ts
|
|
6004
6249
|
class InMemoryOntologyStorage {
|
|
6005
6250
|
state = createInMemoryOntologyState();
|
|
6251
|
+
vectorIndexing;
|
|
6252
|
+
vectors;
|
|
6006
6253
|
commits;
|
|
6007
6254
|
sources;
|
|
6008
6255
|
materializations;
|
|
@@ -6013,6 +6260,9 @@ class InMemoryOntologyStorage {
|
|
|
6013
6260
|
snapshot: () => this.snapshot()
|
|
6014
6261
|
};
|
|
6015
6262
|
constructor(objects, timeseries, options) {
|
|
6263
|
+
this.vectorIndexing = new InMemoryVectorIndexingStorage(this.state.vectorIndexing, (session, projectId) => this.materializations.assertVectorSession(session, projectId), options.runRootOperation);
|
|
6264
|
+
this.vectors = new InMemoryOntologyVectorStorage(this.state.vectors, (session, projectId, commitId) => this.materializations.assertVectorSession(session, projectId, commitId), options.runRootOperation);
|
|
6265
|
+
getInMemoryObjectMaterializerAdapter(objects).setVectorReader((projectId, ref, profile) => this.state.vectors.get(vectorObjectKey(projectId, ref))?.get(profile));
|
|
6016
6266
|
this.commits = new InMemoryOntologyCommitStorage(this.state, options.runRootOperation);
|
|
6017
6267
|
this.sources = new InMemoryOntologySourceStorage(this.state, options.runRootOperation, options.assertSourceMaterializationExecution);
|
|
6018
6268
|
this.outbox = new InMemoryOntologyOutboxStorage(this.state, options.runRootOperation);
|
|
@@ -8320,6 +8570,13 @@ function assertAppliedPrefix(migrations, rows) {
|
|
|
8320
8570
|
}
|
|
8321
8571
|
return [...rows].sort((a, b) => a.version - b.version);
|
|
8322
8572
|
}
|
|
8323
|
-
|
|
8573
|
+
// src/storage/ontology/vector-indexing.ts
|
|
8574
|
+
var VECTOR_INDEXING_FAILURE_CODES2 = [
|
|
8575
|
+
"vector.model_unavailable",
|
|
8576
|
+
"vector.response_invalid",
|
|
8577
|
+
"vector.outcome_unknown",
|
|
8578
|
+
"internal.unexpected"
|
|
8579
|
+
];
|
|
8580
|
+
export { InMemoryActionRunStorage2, AGENT_MESSAGE_CONTENT_VERSION2, InMemoryAgentStorage2, AiCostStorageError2, InMemoryAiCostStorage2, InMemoryAiLimitStorage2, InMemoryConnectorConnectionStorage2, InMemoryFileUploadSessions2, hasVectorProfile2, isVectorProfileQuery2, objectBatchKey2, linkBatchKey2, objectLinkCursor2, compareQueryScalarValues, queryScalarValuesEqual, MAX_VECTOR_K, vectorConfiguration, vectorSources, normalizeVector2, vectorSearchCandidateLimit2, PIPELINE_RUN_FAILURE_CODES2, InMemoryPipelineRunStorage2, InMemoryProjectionRunStorage2, InMemoryRulesStorage2, InMemoryShareGrantStorage2, InMemoryShareSessionStorage2, SYNC_RUN_FAILURE_CODES2, InMemorySyncRunStorage2, WEBHOOK_RUN_FAILURE_CODES2, canRetryWebhookRun2, InMemoryWebhookRunStorage2, WorkflowInterventionError2, InMemoryWorkflowInterventionStorage2, WORKFLOW_RUN_FAILURE_CODES2, InMemoryWorkflowRunStorage2, InMemoryWorkflowNodeRunStorage2, InMemoryWorkflowAgentNodeRunStorage2, InMemoryStorage2, isMigrationCapableStorage2, migrateStorage2, checkStorageSchema2, step2, defineMigrations2, runMigrationSet2, describeMigrationHistory2, VECTOR_INDEXING_FAILURE_CODES2 };
|
|
8324
8581
|
|
|
8325
|
-
//# debugId=
|
|
8582
|
+
//# debugId=1A5AE33B23C6729064756E2164756E21
|