@sixb/core 0.1.10 → 0.1.12
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.js +29 -28
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/types/params.d.ts +10 -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 +48 -42
- 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/auth/index.js +8 -6
- package/dist/auth/index.js.map +1 -1
- package/dist/authorization/index.js +5 -4
- package/dist/authorization/index.js.map +1 -1
- package/dist/blob-storage/types.d.ts +4 -1
- package/dist/blob-storage/types.d.ts.map +1 -1
- package/dist/bootstrap/index.js +50 -46
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/{chunk-17kfctj6.js → chunk-0mza4xb2.js} +2 -2
- package/dist/chunk-2c4j899j.js.map +1 -1
- package/dist/{chunk-g00bfdq6.js → chunk-2cxv584m.js} +12 -56
- package/dist/{chunk-g00bfdq6.js.map → chunk-2cxv584m.js.map} +3 -3
- package/dist/{chunk-e0d1rzef.js → chunk-2h63nrde.js} +380 -97
- package/dist/chunk-2h63nrde.js.map +20 -0
- package/dist/{chunk-rtk71jzp.js → chunk-3bnt2wna.js} +2 -2
- package/dist/{chunk-awbhdqyc.js → chunk-3ghw2t5q.js} +1 -1
- package/dist/{chunk-b19g04jk.js → chunk-3h7ctayx.js} +1 -1
- package/dist/{chunk-wjasrj67.js → chunk-3qpcrcj8.js} +1 -1
- package/dist/{chunk-5hz0fnca.js → chunk-4k53sm9e.js} +6 -2
- package/dist/chunk-4k53sm9e.js.map +12 -0
- package/dist/chunk-4ph94nhd.js +81 -0
- package/dist/chunk-4ph94nhd.js.map +10 -0
- package/dist/chunk-58geavnf.js +29 -0
- package/dist/chunk-58geavnf.js.map +10 -0
- package/dist/{chunk-0y39rgsb.js → chunk-5tetw4hn.js} +1 -1
- package/dist/{chunk-7bs40fe1.js → chunk-69266efg.js} +83 -2
- package/dist/chunk-69266efg.js.map +12 -0
- package/dist/{chunk-g7knyczr.js → chunk-6ma8dvzc.js} +121 -53
- package/dist/chunk-6ma8dvzc.js.map +15 -0
- package/dist/{chunk-skz0hst3.js → chunk-7c2g3sz9.js} +6 -86
- package/dist/{chunk-skz0hst3.js.map → chunk-7c2g3sz9.js.map} +3 -3
- package/dist/{chunk-976rxdpx.js → chunk-7qnvhtcd.js} +93 -17
- package/dist/{chunk-976rxdpx.js.map → chunk-7qnvhtcd.js.map} +7 -6
- package/dist/{chunk-c5rkjrgp.js → chunk-7ytf06d3.js} +1 -1
- package/dist/{chunk-mrp7k0pw.js → chunk-91kcnbf0.js} +9 -14
- package/dist/chunk-91kcnbf0.js.map +10 -0
- 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-93csa55g.js → chunk-axndsymr.js} +10 -4
- package/dist/chunk-axndsymr.js.map +11 -0
- package/dist/{chunk-r7fj830t.js → chunk-b768c93y.js} +100 -29
- package/dist/chunk-b768c93y.js.map +36 -0
- package/dist/{chunk-dz5h08xv.js → chunk-bbaa1fet.js} +24 -9
- package/dist/{chunk-dz5h08xv.js.map → chunk-bbaa1fet.js.map} +4 -4
- package/dist/{chunk-7apz6hg4.js → chunk-bet1rb9h.js} +8 -4
- package/dist/chunk-bet1rb9h.js.map +10 -0
- package/dist/{chunk-358caqf5.js → chunk-bfjv1adk.js} +2 -2
- package/dist/{chunk-b0ec55a1.js → chunk-bg2bs62d.js} +5 -5
- package/dist/{chunk-860dwwy0.js → chunk-cd234ba4.js} +22 -12
- package/dist/chunk-cd234ba4.js.map +14 -0
- package/dist/chunk-d62kjtbg.js.map +1 -1
- package/dist/chunk-dmn70ztd.js.map +2 -2
- package/dist/{chunk-28ja2cjs.js → chunk-e1f1sqba.js} +39 -53
- package/dist/{chunk-28ja2cjs.js.map → chunk-e1f1sqba.js.map} +5 -6
- package/dist/{chunk-ap0g1g74.js → chunk-eyjzgav0.js} +39 -4
- package/dist/chunk-eyjzgav0.js.map +12 -0
- package/dist/{chunk-rb1xx120.js → chunk-f06sf7rr.js} +9 -5
- package/dist/chunk-f06sf7rr.js.map +11 -0
- package/dist/{chunk-g6cke204.js → chunk-f85hpqnm.js} +1 -1
- package/dist/{chunk-vsj3mdfj.js → chunk-fc5zfxy1.js} +1 -1
- package/dist/{chunk-38zv5rkr.js → chunk-g2gezsg5.js} +1 -1
- package/dist/{chunk-38zv5rkr.js.map → chunk-g2gezsg5.js.map} +2 -2
- package/dist/{chunk-nmbxcaqx.js → chunk-g50nxqs5.js} +53 -66
- package/dist/chunk-g50nxqs5.js.map +18 -0
- package/dist/{chunk-1824gssz.js → chunk-gswwr35f.js} +4 -4
- package/dist/{chunk-92vk7gta.js → chunk-gzt6v1ja.js} +1 -1
- package/dist/{chunk-aa6z4a19.js → chunk-hgqpcmyr.js} +2 -1
- package/dist/chunk-hgqpcmyr.js.map +12 -0
- package/dist/{chunk-gqh45d2n.js → chunk-hkw8rykk.js} +2 -2
- package/dist/{chunk-f4w3yp4f.js → chunk-hzw7yv5g.js} +104 -21
- package/dist/chunk-hzw7yv5g.js.map +13 -0
- package/dist/{chunk-5c7ga8zz.js → chunk-jjwhy3rs.js} +5 -5
- package/dist/chunk-kept9cdd.js +29 -0
- package/dist/chunk-kept9cdd.js.map +10 -0
- package/dist/{chunk-ftv470j8.js → chunk-m7cx05vp.js} +247 -16
- package/dist/{chunk-ftv470j8.js.map → chunk-m7cx05vp.js.map} +14 -10
- package/dist/{chunk-qyeptdyv.js → chunk-mdnw7nj8.js} +10 -6
- package/dist/chunk-mdnw7nj8.js.map +15 -0
- package/dist/{chunk-5p1v802y.js → chunk-nzsy3xrp.js} +253 -86
- package/dist/chunk-nzsy3xrp.js.map +46 -0
- package/dist/chunk-p1683c0v.js +104 -0
- package/dist/chunk-p1683c0v.js.map +11 -0
- package/dist/chunk-p6r1ex7t.js +93 -0
- package/dist/chunk-p6r1ex7t.js.map +10 -0
- package/dist/{chunk-p5vcsw9c.js → chunk-qm535afa.js} +10 -10
- package/dist/{chunk-p5vcsw9c.js.map → chunk-qm535afa.js.map} +4 -4
- package/dist/chunk-r5zythxp.js +552 -0
- package/dist/chunk-r5zythxp.js.map +17 -0
- package/dist/{chunk-9qsh3p5y.js → chunk-rb143ggb.js} +1 -1
- package/dist/{chunk-653vwrzr.js → chunk-rdghfsss.js} +1 -1
- package/dist/{chunk-t1f4f1ve.js → chunk-sfypc7mk.js} +18 -13
- package/dist/{chunk-t1f4f1ve.js.map → chunk-sfypc7mk.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-bn138h9w.js → chunk-t7dzd1tm.js} +3 -3
- package/dist/{chunk-pr2h4bv4.js → chunk-tg4g4zh0.js} +3 -3
- package/dist/chunk-vpxss818.js +56 -0
- package/dist/chunk-vpxss818.js.map +10 -0
- package/dist/{chunk-ms2tmn1k.js → chunk-vsg0g7h9.js} +53 -57
- package/dist/chunk-vsg0g7h9.js.map +17 -0
- package/dist/{chunk-8vj0rjgs.js → chunk-wjffn5m4.js} +1 -1
- package/dist/{chunk-nt99sxd6.js → chunk-x9tmx3fc.js} +18 -24
- package/dist/chunk-x9tmx3fc.js.map +14 -0
- package/dist/{chunk-agbbygvh.js → chunk-xn686q2e.js} +8 -8
- 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-v2vcg0w6.js → chunk-xtfryrfb.js} +2 -2
- package/dist/chunk-y0v18c2j.js +363 -0
- package/dist/chunk-y0v18c2j.js.map +14 -0
- package/dist/{chunk-72w2pxk7.js → chunk-y1ahv8b7.js} +11 -3
- package/dist/{chunk-72w2pxk7.js.map → chunk-y1ahv8b7.js.map} +3 -3
- package/dist/chunk-y3ev53cq.js +84 -0
- package/dist/chunk-y3ev53cq.js.map +10 -0
- package/dist/{chunk-p6a4npdx.js → chunk-ybhz3j9g.js} +362 -60
- package/dist/chunk-ybhz3j9g.js.map +63 -0
- package/dist/{chunk-z30bv4ga.js → chunk-yxb4c62x.js} +3 -2
- package/dist/{chunk-z30bv4ga.js.map → chunk-yxb4c62x.js.map} +3 -3
- package/dist/chunk-z3y5kg1x.js +14 -0
- package/dist/chunk-z3y5kg1x.js.map +10 -0
- package/dist/connectors/connections/command-context.d.ts +2 -0
- package/dist/connectors/connections/command-context.d.ts.map +1 -1
- package/dist/connectors/connections/contracts.d.ts +1 -1
- package/dist/connectors/connections/contracts.d.ts.map +1 -1
- package/dist/connectors/connections/execution.d.ts +1 -0
- package/dist/connectors/connections/execution.d.ts.map +1 -1
- package/dist/connectors/connections/runs.d.ts +1 -0
- package/dist/connectors/connections/runs.d.ts.map +1 -1
- package/dist/connectors/connections/service.d.ts +2 -0
- package/dist/connectors/connections/service.d.ts.map +1 -1
- 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/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 +12 -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/index.js +5 -4
- package/dist/events/index.js.map +1 -1
- package/dist/events/outbox-dispatcher.d.ts +2 -2
- package/dist/events/outbox-dispatcher.d.ts.map +1 -1
- package/dist/execution/agent.js +44 -41
- 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.js +44 -41
- package/dist/execution/primitive.js.map +2 -2
- package/dist/execution/request.js +45 -42
- package/dist/execution/request.js.map +2 -2
- package/dist/execution/types.d.ts +6 -0
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/index.d.ts +15 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -59
- 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/lake-storage/types.d.ts +2 -0
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
- package/dist/maintenance/types.d.ts +1 -1
- package/dist/maintenance/types.d.ts.map +1 -1
- package/dist/materialization/errors.d.ts +1 -1
- package/dist/materialization/errors.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/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/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/work-executor.d.ts +2 -1
- package/dist/materializer/execution/work-executor.d.ts.map +1 -1
- package/dist/materializer/index.js +26 -25
- package/dist/materializer/index.js.map +1 -1
- package/dist/materializer/shared/normalize.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 +8 -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 +29 -26
- 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 +1 -0
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +29 -28
- 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 +34 -24
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/ir.d.ts +6 -2
- package/dist/objects/query/ir.d.ts.map +1 -1
- package/dist/objects/query/normalize.d.ts.map +1 -1
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/objects/sdk/object-handle.d.ts +5 -0
- package/dist/objects/sdk/object-handle.d.ts.map +1 -1
- package/dist/objects/sdk/object-set.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/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/index.d.ts +2 -1
- package/dist/ontology/index.d.ts.map +1 -1
- package/dist/ontology/index.js +5 -5
- package/dist/ontology/index.js.map +1 -1
- package/dist/ontology/internal.js +5 -4
- package/dist/ontology/internal.js.map +1 -1
- package/dist/ontology/registry.d.ts.map +1 -1
- package/dist/ontology/types.d.ts +8 -9
- package/dist/ontology/types.d.ts.map +1 -1
- package/dist/ontology/validation/definition.d.ts +3 -0
- package/dist/ontology/validation/definition.d.ts.map +1 -0
- 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 +28 -27
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/internal.js +24 -23
- package/dist/projections/internal.js.map +1 -1
- package/dist/query.js +2 -2
- package/dist/queues/in-memory.d.ts +2 -1
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/index.js +1 -1
- package/dist/queues/types.d.ts +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 +9 -6
- package/dist/runtime/host.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 +47 -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 +9 -4
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +15 -3
- 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 +35 -3
- 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 +47 -0
- package/dist/shared/params/types.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/internal.js +23 -22
- 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/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/connector-connections/in-memory.d.ts +1 -0
- package/dist/storage/connector-connections/in-memory.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider/connections.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider/runs.d.ts +1 -0
- package/dist/storage/connector-connections/provider/runs.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider/shared.d.ts +1 -0
- package/dist/storage/connector-connections/provider/shared.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.d.ts +1 -0
- package/dist/storage/connector-connections/provider.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.js +12 -17
- package/dist/storage/connector-connections/provider.js.map +6 -6
- package/dist/storage/connector-connections/types.d.ts +3 -1
- package/dist/storage/connector-connections/types.d.ts.map +1 -1
- package/dist/storage/executions/provider.d.ts +3 -3
- package/dist/storage/executions/provider.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +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/index.d.ts +5 -3
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +25 -22
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.js +2 -2
- 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 +1 -0
- 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/outbox.d.ts +1 -0
- package/dist/storage/ontology/outbox.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +2 -2
- 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 +1 -1
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +9 -7
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/syncs/index.js +29 -28
- package/dist/syncs/index.js.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/index.js +488 -81
- package/dist/testing/index.js.map +10 -10
- package/dist/testing/lake-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-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +24 -23
- package/dist/webhooks/internal.js.map +2 -2
- 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 +47 -43
- package/dist/workflows/index.js.map +1 -1
- package/package.json +1 -1
- package/src/actions/builders/params.ts +1 -48
- package/src/actions/types/params.ts +14 -74
- package/src/actions/validation.ts +7 -84
- 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/model-loop.ts +7 -0
- package/src/agents/request.ts +11 -0
- package/src/agents/sandbox.ts +44 -0
- package/src/agents/validation.ts +2 -108
- package/src/blob-storage/types.ts +4 -1
- package/src/connectors/connections/command-context.ts +21 -4
- package/src/connectors/connections/contracts.ts +4 -1
- package/src/connectors/connections/execution.ts +3 -0
- package/src/connectors/connections/runs.ts +38 -1
- package/src/connectors/connections/service.ts +6 -0
- package/src/datasets/validation.ts +40 -11
- package/src/datasets/write.ts +8 -11
- 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 +12 -0
- package/src/errors/failure-message.ts +15 -0
- package/src/errors/internal.ts +57 -25
- package/src/events/outbox-dispatcher.ts +20 -26
- package/src/execution/authorization.ts +12 -5
- package/src/execution/authorized-object-reader.ts +37 -2
- package/src/execution/kernel-operation.ts +27 -0
- package/src/execution/scopes.ts +2 -0
- package/src/execution/types.ts +4 -4
- package/src/index.ts +60 -1
- package/src/lake-storage/in-memory.ts +7 -3
- package/src/lake-storage/types.ts +2 -0
- package/src/maintenance/ontology-maintenance.ts +6 -2
- package/src/maintenance/types.ts +1 -1
- package/src/materialization/errors.ts +2 -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 +15 -1
- package/src/materializer/context.ts +10 -0
- package/src/materializer/edits/commit.ts +8 -1
- package/src/materializer/edits/vector-authority.ts +108 -0
- package/src/materializer/edits/vectors.ts +100 -0
- 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/work-executor.ts +11 -3
- package/src/materializer/projections/replace.ts +1 -1
- package/src/materializer/shared/normalize.ts +11 -0
- package/src/materializer/telemetry/append.ts +1 -1
- 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 +20 -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 +7 -4
- package/src/objects/authorized-ontology-view.ts +12 -8
- package/src/objects/execution.ts +2 -0
- package/src/objects/query/executor.ts +13 -4
- package/src/objects/query/explain.ts +7 -2
- package/src/objects/query/index.ts +2 -0
- package/src/objects/query/ir.ts +6 -2
- package/src/objects/query/normalize.ts +5 -1
- package/src/objects/query/validate.ts +74 -73
- package/src/objects/sdk/object-handle.ts +3 -0
- package/src/objects/sdk/object-set.ts +1 -0
- package/src/objects/sdk/query-builder.ts +9 -3
- package/src/objects/sdk/query-executor.ts +2 -1
- package/src/objects/sdk/runtime-query-executor.ts +6 -2
- 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/index.ts +2 -0
- package/src/ontology/registry.ts +8 -0
- package/src/ontology/types.ts +9 -9
- package/src/ontology/validation/definition.ts +104 -0
- package/src/ontology/validation/properties.ts +14 -4
- package/src/ontology/validation/query.ts +34 -51
- package/src/ontology/validation/schema.ts +85 -23
- package/src/ontology/vector-profiles.ts +35 -0
- 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 +42 -6
- package/src/runtime/internal.ts +3 -0
- package/src/runtime/resolve-definitions.ts +19 -1
- package/src/runtime/sixb.ts +27 -9
- package/src/runtime/types.ts +16 -4
- 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 +38 -3
- package/src/shared/params/builders.ts +50 -0
- package/src/shared/params/types.ts +84 -0
- package/src/shared/params/validation.ts +114 -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/connector-connections/in-memory.ts +16 -18
- package/src/storage/connector-connections/provider/connections.ts +1 -15
- package/src/storage/connector-connections/provider/runs.ts +6 -0
- package/src/storage/connector-connections/provider/shared.ts +2 -3
- package/src/storage/connector-connections/provider.ts +6 -0
- package/src/storage/connector-connections/types.ts +5 -1
- package/src/storage/executions/provider.ts +24 -12
- package/src/storage/executions/types.ts +1 -0
- package/src/storage/executions/validation.ts +7 -3
- package/src/storage/index.ts +15 -1
- package/src/storage/objects/in-memory/query.ts +25 -11
- 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 +1 -0
- package/src/storage/ontology/in-memory/index.ts +20 -0
- package/src/storage/ontology/in-memory/materializations.ts +13 -0
- package/src/storage/ontology/in-memory/shared-state.ts +19 -3
- 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/outbox.ts +1 -0
- package/src/storage/ontology/vector-indexing.ts +98 -0
- package/src/storage/ontology/vectors.ts +48 -0
- package/src/storage/operation-scope.ts +1 -0
- package/src/storage/types.ts +3 -0
- package/src/testing/agent-storage-contract.ts +246 -0
- package/src/testing/ai-cost-storage-contract.ts +134 -0
- package/src/testing/connector-connection-storage-contract.ts +11 -11
- package/src/testing/lake-storage-contract.ts +29 -0
- package/src/testing/object-query-contract.ts +41 -25
- package/src/testing/object-read-scope-contract.ts +1 -5
- package/src/testing/ontology-storage-contract.ts +8 -3
- package/src/testing/queues-contract.ts +31 -0
- package/src/workflows/failure.ts +10 -4
- package/src/workflows/validation.ts +2 -2
- package/dist/chunk-5hz0fnca.js.map +0 -12
- package/dist/chunk-5p1v802y.js.map +0 -44
- 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-aa6z4a19.js.map +0 -12
- package/dist/chunk-ap0g1g74.js.map +0 -11
- package/dist/chunk-e0d1rzef.js.map +0 -15
- package/dist/chunk-f0rwz2vh.js.map +0 -11
- package/dist/chunk-f4w3yp4f.js.map +0 -12
- package/dist/chunk-g7knyczr.js.map +0 -14
- package/dist/chunk-mrp7k0pw.js.map +0 -10
- package/dist/chunk-ms2tmn1k.js.map +0 -17
- package/dist/chunk-nmbxcaqx.js.map +0 -19
- package/dist/chunk-nt99sxd6.js.map +0 -14
- package/dist/chunk-p6a4npdx.js.map +0 -58
- package/dist/chunk-qyeptdyv.js.map +0 -15
- package/dist/chunk-r7fj830t.js.map +0 -36
- package/dist/chunk-rb1xx120.js.map +0 -11
- package/dist/chunk-yv79ncbv.js.map +0 -10
- package/dist/chunk-z3y411fq.js +0 -99
- package/dist/chunk-z3y411fq.js.map +0 -11
- /package/dist/{chunk-17kfctj6.js.map → chunk-0mza4xb2.js.map} +0 -0
- /package/dist/{chunk-rtk71jzp.js.map → chunk-3bnt2wna.js.map} +0 -0
- /package/dist/{chunk-awbhdqyc.js.map → chunk-3ghw2t5q.js.map} +0 -0
- /package/dist/{chunk-b19g04jk.js.map → chunk-3h7ctayx.js.map} +0 -0
- /package/dist/{chunk-wjasrj67.js.map → chunk-3qpcrcj8.js.map} +0 -0
- /package/dist/{chunk-0y39rgsb.js.map → chunk-5tetw4hn.js.map} +0 -0
- /package/dist/{chunk-c5rkjrgp.js.map → chunk-7ytf06d3.js.map} +0 -0
- /package/dist/{chunk-358caqf5.js.map → chunk-bfjv1adk.js.map} +0 -0
- /package/dist/{chunk-b0ec55a1.js.map → chunk-bg2bs62d.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-1824gssz.js.map → chunk-gswwr35f.js.map} +0 -0
- /package/dist/{chunk-92vk7gta.js.map → chunk-gzt6v1ja.js.map} +0 -0
- /package/dist/{chunk-gqh45d2n.js.map → chunk-hkw8rykk.js.map} +0 -0
- /package/dist/{chunk-5c7ga8zz.js.map → chunk-jjwhy3rs.js.map} +0 -0
- /package/dist/{chunk-9qsh3p5y.js.map → chunk-rb143ggb.js.map} +0 -0
- /package/dist/{chunk-653vwrzr.js.map → chunk-rdghfsss.js.map} +0 -0
- /package/dist/{chunk-bn138h9w.js.map → chunk-t7dzd1tm.js.map} +0 -0
- /package/dist/{chunk-pr2h4bv4.js.map → chunk-tg4g4zh0.js.map} +0 -0
- /package/dist/{chunk-8vj0rjgs.js.map → chunk-wjffn5m4.js.map} +0 -0
- /package/dist/{chunk-agbbygvh.js.map → chunk-xn686q2e.js.map} +0 -0
- /package/dist/{chunk-v2vcg0w6.js.map → chunk-xtfryrfb.js.map} +0 -0
|
@@ -3,6 +3,9 @@ import {
|
|
|
3
3
|
snapshotRequesterGroupIds,
|
|
4
4
|
normalizeRequesterGroupIds
|
|
5
5
|
} from "./chunk-9tc8dxmn.js";
|
|
6
|
+
import {
|
|
7
|
+
kernelOperationId
|
|
8
|
+
} from "./chunk-58geavnf.js";
|
|
6
9
|
|
|
7
10
|
// src/storage/executions/errors.ts
|
|
8
11
|
class ExecutionStorageError2 extends Error {
|
|
@@ -98,6 +101,9 @@ function assertExecutor(executor) {
|
|
|
98
101
|
}
|
|
99
102
|
function assertSource(source) {
|
|
100
103
|
switch (source.type) {
|
|
104
|
+
case "ontologyCommit":
|
|
105
|
+
assertNonBlank(source.commitId, "Execution source commit id");
|
|
106
|
+
return;
|
|
101
107
|
case "http":
|
|
102
108
|
assertNonBlank(source.requestId, "Execution source request id");
|
|
103
109
|
return;
|
|
@@ -296,10 +302,10 @@ function assertPrincipal(principal, label) {
|
|
|
296
302
|
assertNonBlank(principal.id, `${label} id`);
|
|
297
303
|
}
|
|
298
304
|
function assertKernelOperation(operation, label) {
|
|
299
|
-
if (operation.type !== "ontology.recover") {
|
|
305
|
+
if (operation.type !== "ontology.recover" && operation.type !== "ontology.indexVectors") {
|
|
300
306
|
invalid(`${label} has unsupported type '${String(operation.type)}'.`);
|
|
301
307
|
}
|
|
302
|
-
assertNonBlank(operation
|
|
308
|
+
assertNonBlank(kernelOperationId(operation), `${label} operation id`);
|
|
303
309
|
}
|
|
304
310
|
function assertTrustedPrimitiveKind(value, label) {
|
|
305
311
|
if (!TRUSTED_PRIMITIVE_KINDS.has(value)) {
|
|
@@ -320,7 +326,7 @@ function principalsEqual(left, right) {
|
|
|
320
326
|
return left?.type === right?.type && left?.id === right?.id;
|
|
321
327
|
}
|
|
322
328
|
function kernelOperationsEqual(left, right) {
|
|
323
|
-
return left.type === right.type && left
|
|
329
|
+
return left.type === right.type && kernelOperationId(left) === kernelOperationId(right);
|
|
324
330
|
}
|
|
325
331
|
function invalid(message) {
|
|
326
332
|
throw new ExecutionStorageError2("invalid_input", `[Sixb] ${message}`);
|
|
@@ -337,4 +343,4 @@ var TRUSTED_PRIMITIVE_KINDS = new Set([
|
|
|
337
343
|
|
|
338
344
|
export { ExecutionStorageError2, prepareExecutionRecord2, normalizeExecutionRecord2, validateExecutionRecordReferences2, cloneExecutionRecord };
|
|
339
345
|
|
|
340
|
-
//# debugId=
|
|
346
|
+
//# debugId=44233475F9DA4CC764756E2164756E21
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/storage/executions/errors.ts", "../src/storage/executions/validation.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"export type ExecutionStorageErrorCode =\n | \"duplicate_execution\"\n | \"invalid_credential\"\n | \"invalid_input\"\n | \"invalid_parent_execution\"\n | \"missing_credential\"\n | \"missing_parent_execution\"\n | \"missing_principal\"\n\n/** Stable error raised when an execution record would violate ledger invariants. */\nexport class ExecutionStorageError extends Error {\n readonly name = \"ExecutionStorageError\"\n\n constructor(\n readonly code: ExecutionStorageErrorCode,\n message: string,\n options: ErrorOptions = {}\n ) {\n super(message, options)\n }\n}\n",
|
|
6
|
+
"import { isDeepStrictEqual } from \"node:util\"\nimport { normalizeRequesterGroupIds, snapshotRequesterGroupIds } from \"../../auth/attribution\"\nimport { kernelOperationId } from \"../../execution/kernel-operation\"\nimport type {\n AuthorizablePrincipal,\n AuthorizationRef,\n KernelOperation,\n} from \"../../execution/types\"\nimport type { AuthStorage } from \"../auth\"\nimport { ExecutionStorageError } from \"./errors\"\nimport type {\n CreateExecutionInput,\n DurableExecutionExecutor,\n DurableExecutionSource,\n ExecutionRecord,\n} from \"./types\"\n\nexport interface ExecutionValidationLookup {\n readonly auth: AuthStorage\n getExecution(params: {\n readonly projectId: string\n readonly id: string\n }): Promise<ExecutionRecord | null>\n getShareSession(params: {\n readonly projectId: string\n readonly id: string\n }): Promise<{ readonly grantId: string } | null>\n}\n\n/** Capture accounting attribution at the same storage boundary that admits the execution. */\nexport async function prepareExecutionRecord(\n input: CreateExecutionInput,\n lookup: ExecutionValidationLookup\n): Promise<ExecutionRecord> {\n let groups = input.requesterGroupIds\n if (groups === undefined && input.source.type === \"execution\") {\n const parent = await lookup.getExecution({\n projectId: input.projectId,\n id: input.source.executionId,\n })\n groups = parent?.requesterGroupIds\n } else if (groups === undefined && input.requestedBy) {\n groups = await snapshotRequesterGroupIds({\n auth: lookup.auth,\n projectId: input.projectId,\n principal: input.requestedBy,\n })\n }\n const record = normalizeExecutionRecord({ ...input, requesterGroupIds: groups ?? [] })\n await validateExecutionRecordReferences(record, lookup)\n return record\n}\n\nexport function normalizeExecutionRecord(\n input: CreateExecutionInput,\n createdAt: Date = new Date()\n): ExecutionRecord {\n const record: ExecutionRecord = {\n id: input.id,\n projectId: input.projectId,\n requesterGroupIds: normalizeRequesterGroupIds(input.requesterGroupIds ?? []),\n ...(input.requestedBy === undefined ? {} : { requestedBy: structuredClone(input.requestedBy) }),\n executor: structuredClone(input.executor),\n source: structuredClone(input.source),\n correlationId: input.correlationId,\n authorizationRef: structuredClone(input.authorizationRef),\n createdAt: new Date(createdAt),\n }\n\n assertRecordShape(record)\n assertExecutorAuthority(record)\n return record\n}\n\nexport async function validateExecutionRecordReferences(\n record: ExecutionRecord,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n await validatePrincipal(record.requestedBy, record.projectId, \"Requested-by principal\", lookup)\n\n if (record.authorizationRef.type === \"principal\") {\n await validatePrincipal(\n record.authorizationRef.principal,\n record.projectId,\n \"Authority principal\",\n lookup\n )\n await validateCredential(record, lookup)\n }\n if (record.authorizationRef.type === \"delegated\") {\n await validateDelegation(record, lookup)\n }\n\n await validateParent(record, lookup)\n}\n\nexport function cloneExecutionRecord(record: ExecutionRecord): ExecutionRecord {\n return structuredClone(record)\n}\n\nfunction assertRecordShape(record: ExecutionRecord): void {\n assertNonBlank(record.id, \"Execution id\")\n assertNonBlank(record.projectId, \"Execution project id\")\n assertNonBlank(record.correlationId, \"Execution correlation id\")\n assertValidDate(record.createdAt, \"Execution createdAt\")\n\n if (record.requestedBy) {\n assertPrincipal(record.requestedBy, \"Requested-by principal\")\n }\n\n assertExecutor(record.executor)\n assertSource(record.source)\n assertAuthorizationRef(record.authorizationRef)\n}\n\nfunction assertExecutor(executor: DurableExecutionExecutor): void {\n switch (executor.type) {\n case \"request\":\n assertNonBlank(executor.requestId, \"Executor request id\")\n return\n case \"primitive\":\n assertTrustedPrimitiveKind(executor.kind, \"Executor primitive kind\")\n assertNonBlank(executor.runId, \"Executor primitive run id\")\n return\n case \"agent\":\n assertNonBlank(executor.runId, \"Executor agent run id\")\n return\n case \"kernel\":\n assertKernelOperation(executor.operation, \"Executor kernel operation\")\n return\n default:\n invalid(`Unknown execution executor type '${String((executor as { type?: unknown }).type)}'.`)\n }\n}\n\nfunction assertSource(source: DurableExecutionSource): void {\n switch (source.type) {\n case \"ontologyCommit\":\n assertNonBlank(source.commitId, \"Execution source commit id\")\n return\n case \"http\":\n assertNonBlank(source.requestId, \"Execution source request id\")\n return\n case \"webhook\":\n assertNonBlank(source.deliveryId, \"Execution source delivery id\")\n return\n case \"schedule\":\n case \"event\":\n assertNonBlank(source.eventId, \"Execution source event id\")\n return\n case \"datasetVersion\":\n assertNonBlank(source.datasetId, \"Execution source dataset id\")\n assertNonBlank(source.versionId, \"Execution source dataset version id\")\n return\n case \"execution\":\n assertNonBlank(source.executionId, \"Execution source execution id\")\n return\n default:\n invalid(\n `Execution source type '${String((source as { type?: unknown }).type)}' is not durable.`\n )\n }\n}\n\nfunction assertAuthorizationRef(ref: AuthorizationRef): void {\n switch (ref.type) {\n case \"principal\":\n assertPrincipal(ref.principal, \"Authority principal\")\n if (ref.credential) {\n if (ref.credential.type !== \"session\" && ref.credential.type !== \"accessToken\") {\n invalid(\n `Unknown authority credential type '${String(\n (ref.credential as { type?: unknown }).type\n )}'.`\n )\n }\n assertNonBlank(ref.credential.id, \"Authority credential id\")\n }\n return\n case \"trustedPrimitive\":\n assertTrustedPrimitiveKind(ref.primitive.kind, \"Authority primitive kind\")\n assertNonBlank(ref.primitive.id, \"Authority primitive id\")\n assertNonBlank(ref.primitive.runId, \"Authority primitive run id\")\n return\n case \"delegated\":\n if (ref.delegation.kind !== \"share\") {\n invalid(\n `Unknown authority delegation kind '${String(\n (ref.delegation as { kind?: unknown }).kind\n )}'.`\n )\n }\n assertNonBlank(ref.delegation.grantId, \"Authority delegation grant id\")\n assertNonBlank(ref.delegation.sessionId, \"Authority delegation session id\")\n return\n case \"kernel\":\n assertKernelOperation(ref.operation, \"Authority kernel operation\")\n return\n case \"disabled\":\n return\n default:\n invalid(`Unknown authorization reference type '${String((ref as { type?: unknown }).type)}'.`)\n }\n}\n\nfunction assertExecutorAuthority(record: ExecutionRecord): void {\n const { executor, authorizationRef, requestedBy, source } = record\n\n switch (executor.type) {\n case \"request\": {\n if (source.type !== \"http\" || source.requestId !== executor.requestId) {\n invalid(\"Request executions require a matching HTTP source request id.\")\n }\n if (authorizationRef.type === \"principal\") {\n if (!principalsEqual(requestedBy, authorizationRef.principal)) {\n invalid(\"Request authority must match its requested-by principal.\")\n }\n return\n }\n if (authorizationRef.type === \"disabled\") {\n if (requestedBy !== undefined) {\n invalid(\"Auth-disabled request executions cannot have a requested-by principal.\")\n }\n return\n }\n if (authorizationRef.type === \"delegated\") {\n if (requestedBy !== undefined) {\n invalid(\"Delegated request executions cannot have a requested-by principal.\")\n }\n return\n }\n invalid(\"Request executions require principal, delegated, or explicitly disabled authority.\")\n break\n }\n case \"primitive\": {\n if (authorizationRef.type !== \"trustedPrimitive\") {\n invalid(\"Primitive executions require trusted primitive authority.\")\n }\n if (\n authorizationRef.primitive.kind !== executor.kind ||\n authorizationRef.primitive.runId !== executor.runId\n ) {\n invalid(\"Trusted primitive authority must match the executor kind and run id.\")\n }\n return\n }\n case \"agent\": {\n if (source.type !== \"execution\") {\n invalid(\"Agent executions require a parent execution source.\")\n }\n if (\n authorizationRef.type === \"principal\" &&\n authorizationRef.principal.type === \"serviceAccount\" &&\n authorizationRef.credential === undefined\n ) {\n return\n }\n if (\n authorizationRef.type === \"principal\" &&\n authorizationRef.principal.type === \"user\" &&\n authorizationRef.credential !== undefined\n ) {\n return\n }\n if (authorizationRef.type === \"disabled\") return\n invalid(\n \"Agent executions require managed service-account, credentialed user, or explicitly disabled authority.\"\n )\n break\n }\n case \"kernel\": {\n if (\n authorizationRef.type !== \"kernel\" ||\n !kernelOperationsEqual(authorizationRef.operation, executor.operation)\n ) {\n invalid(\"Kernel authority must match the executor operation.\")\n }\n if (requestedBy !== undefined) {\n invalid(\"Kernel executions cannot have a requested-by principal.\")\n }\n return\n }\n }\n}\n\nasync function validatePrincipal(\n principal: AuthorizablePrincipal | undefined,\n projectId: string,\n label: string,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n if (!principal) return\n\n const record =\n principal.type === \"user\"\n ? await lookup.auth.users.getById({ projectId, id: principal.id })\n : await lookup.auth.serviceAccounts.getById({ projectId, id: principal.id })\n if (!record) {\n throw new ExecutionStorageError(\n \"missing_principal\",\n `[Sixb] ${label} '${principal.id}' does not exist in project '${projectId}'.`\n )\n }\n}\n\nasync function validateCredential(\n record: ExecutionRecord,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n if (record.authorizationRef.type !== \"principal\" || !record.authorizationRef.credential) return\n\n const { principal, credential } = record.authorizationRef\n if (credential.type === \"session\") {\n const session = await lookup.auth.sessions.getById({\n projectId: record.projectId,\n id: credential.id,\n })\n if (!session) {\n throw new ExecutionStorageError(\n \"missing_credential\",\n `[Sixb] Authority session '${credential.id}' does not exist in project '${record.projectId}'.`\n )\n }\n if (principal.type !== \"user\" || session.userId !== principal.id) {\n throw new ExecutionStorageError(\n \"invalid_credential\",\n `[Sixb] Authority session '${credential.id}' does not belong to principal '${principal.id}'.`\n )\n }\n return\n }\n\n const token = await lookup.auth.accessTokens.getById({\n projectId: record.projectId,\n id: credential.id,\n })\n if (!token) {\n throw new ExecutionStorageError(\n \"missing_credential\",\n `[Sixb] Authority access token '${credential.id}' does not exist in project '${record.projectId}'.`\n )\n }\n if (token.subjectType !== principal.type || token.subjectId !== principal.id) {\n throw new ExecutionStorageError(\n \"invalid_credential\",\n `[Sixb] Authority access token '${credential.id}' does not belong to principal '${principal.id}'.`\n )\n }\n}\n\nasync function validateDelegation(\n record: ExecutionRecord,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n if (record.authorizationRef.type !== \"delegated\") return\n const { grantId, sessionId } = record.authorizationRef.delegation\n const session = await lookup.getShareSession({ projectId: record.projectId, id: sessionId })\n if (!session) {\n throw new ExecutionStorageError(\n \"missing_credential\",\n `[Sixb] Authority shared session '${sessionId}' does not exist in project '${record.projectId}'.`\n )\n }\n if (session.grantId !== grantId) {\n throw new ExecutionStorageError(\n \"invalid_credential\",\n `[Sixb] Authority shared session '${sessionId}' does not belong to grant '${grantId}'.`\n )\n }\n}\n\nasync function validateParent(\n record: ExecutionRecord,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n if (record.source.type !== \"execution\") return\n const parentExecutionId = record.source.executionId\n\n const parent = await lookup.getExecution({\n projectId: record.projectId,\n id: parentExecutionId,\n })\n if (!parent) {\n throw new ExecutionStorageError(\n \"missing_parent_execution\",\n `[Sixb] Parent execution '${parentExecutionId}' does not exist in project '${record.projectId}'.`\n )\n }\n if (parent.correlationId !== record.correlationId) {\n throw new ExecutionStorageError(\n \"invalid_parent_execution\",\n `[Sixb] Child execution '${record.id}' must preserve its parent correlation id.`\n )\n }\n if (!principalsEqual(parent.requestedBy, record.requestedBy)) {\n throw new ExecutionStorageError(\n \"invalid_parent_execution\",\n `[Sixb] Child execution '${record.id}' must preserve its parent requested-by principal.`\n )\n }\n if (!isDeepStrictEqual(parent.requesterGroupIds, record.requesterGroupIds)) {\n throw new ExecutionStorageError(\n \"invalid_parent_execution\",\n `[Sixb] Child execution '${record.id}' must preserve its parent requester-group snapshot.`\n )\n }\n if (\n record.executor.type === \"agent\" &&\n isInheritedAgentAuthority(record.authorizationRef) &&\n !isDeepStrictEqual(parent.authorizationRef, record.authorizationRef)\n ) {\n throw new ExecutionStorageError(\n \"invalid_parent_execution\",\n `[Sixb] Child Agent execution '${record.id}' must inherit its parent's authorization reference.`\n )\n }\n}\n\nfunction isInheritedAgentAuthority(ref: AuthorizationRef): boolean {\n return (\n ref.type === \"disabled\" ||\n (ref.type === \"principal\" && ref.principal.type === \"user\" && ref.credential !== undefined)\n )\n}\n\nfunction assertPrincipal(principal: AuthorizablePrincipal, label: string): void {\n if (principal.type !== \"user\" && principal.type !== \"serviceAccount\") {\n invalid(`${label} has unsupported type '${String((principal as { type?: unknown }).type)}'.`)\n }\n assertNonBlank(principal.id, `${label} id`)\n}\n\nfunction assertKernelOperation(operation: KernelOperation, label: string): void {\n if (operation.type !== \"ontology.recover\" && operation.type !== \"ontology.indexVectors\") {\n invalid(`${label} has unsupported type '${String((operation as { type?: unknown }).type)}'.`)\n }\n assertNonBlank(kernelOperationId(operation), `${label} operation id`)\n}\n\nfunction assertTrustedPrimitiveKind(value: string, label: string): void {\n if (!TRUSTED_PRIMITIVE_KINDS.has(value)) {\n invalid(`${label} '${value}' is not supported.`)\n }\n}\n\nfunction assertNonBlank(value: string, label: string): void {\n if (typeof value !== \"string\" || !value.trim()) {\n invalid(`${label} must be a non-empty string.`)\n }\n}\n\nfunction assertValidDate(value: Date, label: string): void {\n if (!(value instanceof Date) || !Number.isFinite(value.getTime())) {\n invalid(`${label} must be a valid date.`)\n }\n}\n\nfunction principalsEqual(\n left: AuthorizablePrincipal | undefined,\n right: AuthorizablePrincipal | undefined\n): boolean {\n return left?.type === right?.type && left?.id === right?.id\n}\n\nfunction kernelOperationsEqual(left: KernelOperation, right: KernelOperation): boolean {\n return left.type === right.type && kernelOperationId(left) === kernelOperationId(right)\n}\n\nfunction invalid(message: string): never {\n throw new ExecutionStorageError(\"invalid_input\", `[Sixb] ${message}`)\n}\n\nconst TRUSTED_PRIMITIVE_KINDS = new Set([\n \"action\",\n \"pipeline\",\n \"projection\",\n \"rule\",\n \"sync\",\n \"webhook\",\n \"workflow\",\n])\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": ";;;;;;;;;;AAUO,MAAM,+BAA8B,MAAM;AAAA,EAIpC;AAAA,EAHF,OAAO;AAAA,EAEhB,WAAW,CACA,MACT,SACA,UAAwB,CAAC,GACzB;AAAA,IACA,MAAM,SAAS,OAAO;AAAA,IAJb;AAAA;AAMb;;;ACpBA;AA8BA,eAAsB,uBAAsB,CAC1C,OACA,QAC0B;AAAA,EAC1B,IAAI,SAAS,MAAM;AAAA,EACnB,IAAI,WAAW,aAAa,MAAM,OAAO,SAAS,aAAa;AAAA,IAC7D,MAAM,SAAS,MAAM,OAAO,aAAa;AAAA,MACvC,WAAW,MAAM;AAAA,MACjB,IAAI,MAAM,OAAO;AAAA,IACnB,CAAC;AAAA,IACD,SAAS,QAAQ;AAAA,EACnB,EAAO,SAAI,WAAW,aA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AAAA,IAC9C,QAAQ,GAAG,mCAAmC;AAAA,EAChD;AAAA;AAGF,SAAS,eAAe,CAAC,OAAa,OAAqB;AAAA,EACzD,IAAI,EAAE,iBAAiB,SAAS,CAAC,OAAO,SAAS,MAAM,QAAQ,CAAC,GAAG;AAAA,IACjE,QAAQ,GAAG,6BAA6B;AAAA,EAC1C;AAAA;AAGF,SAAS,eAAe,CACtB,MACA,OACS;AAAA,EACT,OAAO,MAAM,SAAS,OAAO,QAAQ,MAAM,OAAO,OAAO;AAAA;AAG3D,SAAS,qBAAqB,CAAC,MAAuB,OAAiC;AAAA,EACrF,OAAO,KAAK,SAAS,MAAM,QAAQ,kBAAkB,IAAI,MAAM,kBAAkB,KAAK;AAAA;AAGxF,SAAS,OAAO,CAAC,SAAwB;AAAA,EACvC,MAAM,IAAI,uBAAsB,iBAAiB,UAAU,SAAS;AAAA;AAGtE,IAAM,0BAA0B,IAAI,IAAI;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;",
|
|
9
|
+
"debugId": "44233475F9DA4CC764756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
OntologyRegistry2
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-eyjzgav0.js";
|
|
5
5
|
import {
|
|
6
6
|
ProjectionRegistry2,
|
|
7
7
|
createOntologyMaterializer2
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-m7cx05vp.js";
|
|
9
9
|
import {
|
|
10
10
|
captureSixbFailure2,
|
|
11
11
|
isSixbError2
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-hzw7yv5g.js";
|
|
13
13
|
import {
|
|
14
14
|
captureExecutionScope,
|
|
15
15
|
resolveExecutionScopeAuthorization,
|
|
16
16
|
AuthorizationError2
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-bbaa1fet.js";
|
|
18
18
|
import {
|
|
19
19
|
SecurityRegistry,
|
|
20
20
|
AuthRuntime2
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-2cxv584m.js";
|
|
22
22
|
import {
|
|
23
23
|
AuthRuntimeError2,
|
|
24
24
|
isMagicLinkAuthStrategy2,
|
|
@@ -27,31 +27,34 @@ import {
|
|
|
27
27
|
import {
|
|
28
28
|
RuntimeError2,
|
|
29
29
|
createModelCatalog2
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-2h63nrde.js";
|
|
31
31
|
import {
|
|
32
32
|
isMigrationCapableStorage2,
|
|
33
33
|
checkStorageSchema2
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-ybhz3j9g.js";
|
|
35
35
|
import {
|
|
36
36
|
createAuthorizedObjectReader
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-g50nxqs5.js";
|
|
38
38
|
import {
|
|
39
39
|
attachSixbErrorReporter2,
|
|
40
40
|
shareSixbErrorReporter2
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-bet1rb9h.js";
|
|
42
42
|
import {
|
|
43
43
|
ActionRegistry2
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-qm535afa.js";
|
|
45
45
|
import {
|
|
46
46
|
assertDatasetDefinition2
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-cd234ba4.js";
|
|
48
48
|
import {
|
|
49
49
|
OntologyOutboxDispatcher2,
|
|
50
50
|
createDomainEventService2
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-x9tmx3fc.js";
|
|
52
52
|
import {
|
|
53
53
|
validateSchedulesAtStartup2
|
|
54
54
|
} from "./chunk-e1c18xjx.js";
|
|
55
|
+
import {
|
|
56
|
+
createSandboxDefinition
|
|
57
|
+
} from "./chunk-y0v18c2j.js";
|
|
55
58
|
import {
|
|
56
59
|
ConnectorError2,
|
|
57
60
|
ConnectorNotFoundError2,
|
|
@@ -63,16 +66,16 @@ import {
|
|
|
63
66
|
isConnectorStorageError,
|
|
64
67
|
storageBoundaryError,
|
|
65
68
|
recoverConnectorFailure
|
|
66
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-xtfryrfb.js";
|
|
67
70
|
import {
|
|
68
71
|
toolsFromProjectConfig
|
|
69
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-7c2g3sz9.js";
|
|
70
73
|
import {
|
|
71
74
|
assertNoAgentDefinitions,
|
|
72
75
|
validateWorkflowsAtStartup2,
|
|
73
76
|
validateWorkflowAgentStepGroupReferences2,
|
|
74
77
|
createBoundSixb
|
|
75
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-nzsy3xrp.js";
|
|
76
79
|
import {
|
|
77
80
|
registerConnectorConnectionCallbackProcess
|
|
78
81
|
} from "./chunk-5a4a52tq.js";
|
|
@@ -88,29 +91,40 @@ import {
|
|
|
88
91
|
validateSharesAtStartup,
|
|
89
92
|
discoverOntologySources2,
|
|
90
93
|
discoverProjectDefinitions2
|
|
91
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-xn686q2e.js";
|
|
92
95
|
import {
|
|
93
96
|
LoggingService2
|
|
94
97
|
} from "./chunk-3qms4nax.js";
|
|
98
|
+
import {
|
|
99
|
+
bindEmbeddingModels,
|
|
100
|
+
createVectorIndexingRuntime,
|
|
101
|
+
registerVectorIndexingRuntime
|
|
102
|
+
} from "./chunk-r5zythxp.js";
|
|
95
103
|
import {
|
|
96
104
|
registerProjectionRegistry2
|
|
97
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-gswwr35f.js";
|
|
98
106
|
import {
|
|
99
107
|
SyncValidationError2
|
|
100
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-jjwhy3rs.js";
|
|
109
|
+
import {
|
|
110
|
+
ModelExecutionSession
|
|
111
|
+
} from "./chunk-4ph94nhd.js";
|
|
101
112
|
import {
|
|
102
113
|
isOAuthConnectorDefinition2
|
|
103
114
|
} from "./chunk-9x8dybsb.js";
|
|
104
115
|
import {
|
|
105
116
|
ensureExecutionRecord2
|
|
106
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-0mza4xb2.js";
|
|
107
118
|
import {
|
|
108
119
|
ConnectorConnectionStorageError2,
|
|
109
120
|
CONNECTOR_CONNECTION_RUN_FAILURE_CODES2
|
|
110
121
|
} from "./chunk-2c4j899j.js";
|
|
111
122
|
import {
|
|
112
123
|
reportEventDeliveryFailure3
|
|
113
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-y1ahv8b7.js";
|
|
125
|
+
import {
|
|
126
|
+
sameEmbeddingModel
|
|
127
|
+
} from "./chunk-p1683c0v.js";
|
|
114
128
|
import {
|
|
115
129
|
isJsonObject2
|
|
116
130
|
} from "./chunk-wy0qdqfm.js";
|
|
@@ -1486,11 +1500,19 @@ function assertConnectorAuthorizationAttemptInitiator(execution, current) {
|
|
|
1486
1500
|
}
|
|
1487
1501
|
}
|
|
1488
1502
|
function assertConnectorConnectionRunInitiator(execution, current, connectorId) {
|
|
1489
|
-
|
|
1490
|
-
if (!initiating || !sameConnectorConnectionCommandActor(initiating, current)) {
|
|
1503
|
+
if (!isConnectorConnectionRunInitiator(execution, current)) {
|
|
1491
1504
|
throw new AuthorizationError2(`connection-run:connector:${connectorId}`, "[Sixb] This connector connection run can only be accessed by its initiating actor.");
|
|
1492
1505
|
}
|
|
1493
1506
|
}
|
|
1507
|
+
function isConnectorConnectionRunInitiator(execution, current) {
|
|
1508
|
+
const initiating = execution ? connectorConnectionActorFromExecution(execution, execution.projectId) : null;
|
|
1509
|
+
if (!initiating)
|
|
1510
|
+
return false;
|
|
1511
|
+
if (initiating.principal.type === "user" && current.principal.type === "user" && initiating.credential.type === "session" && current.credential.type === "session") {
|
|
1512
|
+
return initiating.principal.id === current.principal.id;
|
|
1513
|
+
}
|
|
1514
|
+
return sameConnectorConnectionCommandActor(initiating, current);
|
|
1515
|
+
}
|
|
1494
1516
|
function connectorConnectionActorFromExecution(execution, projectId) {
|
|
1495
1517
|
const authorization = execution.authorizationRef;
|
|
1496
1518
|
if (execution.projectId !== projectId || execution.executor.type !== "request" || execution.source.type !== "http" || execution.executor.requestId !== execution.source.requestId || authorization.type !== "principal" || authorization.credential === undefined || execution.requestedBy?.type !== authorization.principal.type || execution.requestedBy.id !== authorization.principal.id) {
|
|
@@ -1893,6 +1915,23 @@ class ConnectorConnectionRunService {
|
|
|
1893
1915
|
return { runId: failed.id, connectorId: failed.connectorId, returnTo };
|
|
1894
1916
|
}
|
|
1895
1917
|
}
|
|
1918
|
+
async listPending(command, connectorId) {
|
|
1919
|
+
const actor = requireConnectorConnectionCommandActor(command.execution, this.projectId);
|
|
1920
|
+
const candidates = await withConnectorStorageBoundary("Pending connector connection runs could not be read.", () => this.connectionStorage.listPendingConnectionRuns({ projectId: this.projectId, connectorId }));
|
|
1921
|
+
const runs = [];
|
|
1922
|
+
for (const candidate of candidates) {
|
|
1923
|
+
const initiating = await withConnectorStorageBoundary("Connector connection run initiating execution could not be read.", () => this.storage.executions.getById({
|
|
1924
|
+
projectId: this.projectId,
|
|
1925
|
+
id: candidate.initiatedByExecutionId
|
|
1926
|
+
}));
|
|
1927
|
+
if (!isConnectorConnectionRunInitiator(initiating, actor))
|
|
1928
|
+
continue;
|
|
1929
|
+
const run = await this.get(command, connectorId, candidate.id);
|
|
1930
|
+
if (run && (run.status === "running" || run.status === "waiting" && run.waitingFor === "account_selection"))
|
|
1931
|
+
runs.push(run);
|
|
1932
|
+
}
|
|
1933
|
+
return runs.sort((left, right) => right.createdAt.getTime() - left.createdAt.getTime() || left.id.localeCompare(right.id));
|
|
1934
|
+
}
|
|
1896
1935
|
async get(command, connectorId, runId) {
|
|
1897
1936
|
const id = nonblank(runId, "connection run id");
|
|
1898
1937
|
const run = await this.readRun(connectorId, id);
|
|
@@ -2115,8 +2154,7 @@ class ConnectorConnectionRunService {
|
|
|
2115
2154
|
...base,
|
|
2116
2155
|
status: "waiting",
|
|
2117
2156
|
waitingFor: "account_selection",
|
|
2118
|
-
accounts: authorization.accounts
|
|
2119
|
-
expiresAt: run.expiresAt
|
|
2157
|
+
accounts: authorization.accounts
|
|
2120
2158
|
};
|
|
2121
2159
|
}
|
|
2122
2160
|
if (run.status === "succeeded") {
|
|
@@ -2160,6 +2198,8 @@ class ConnectorConnectionRunService {
|
|
|
2160
2198
|
}
|
|
2161
2199
|
scheduleRunMaintenance(run, delayMs = run.status === "waiting" || run.status === "running" ? Math.max(1000, run.expiresAt.getTime() - this.now().getTime()) : CLEANUP_RETRY_DELAY_MS) {
|
|
2162
2200
|
this.cancelRunMaintenance(run.id);
|
|
2201
|
+
if (run.status === "waiting" && run.waitingFor === "account_selection")
|
|
2202
|
+
return;
|
|
2163
2203
|
const timer = setTimeout(() => void this.maintainRun(run.connectorId, run.id), Math.min(delayMs, MAX_TIMER_DELAY_MS));
|
|
2164
2204
|
timer.unref?.();
|
|
2165
2205
|
this.maintenanceTimers.set(run.id, timer);
|
|
@@ -2366,6 +2406,10 @@ class ConnectorConnectionService {
|
|
|
2366
2406
|
authorizationId: authorization.id
|
|
2367
2407
|
});
|
|
2368
2408
|
}
|
|
2409
|
+
listPendingConnectionRuns(command, connectorId) {
|
|
2410
|
+
this.requireOAuthDefinition(connectorId);
|
|
2411
|
+
return this.runs.listPending(command, connectorId);
|
|
2412
|
+
}
|
|
2369
2413
|
getConnectionRun(command, connectorId, runId) {
|
|
2370
2414
|
this.requireOAuthDefinition(connectorId);
|
|
2371
2415
|
return this.runs.get(command, connectorId, runId);
|
|
@@ -2699,6 +2743,8 @@ class OntologyMaintenance {
|
|
|
2699
2743
|
};
|
|
2700
2744
|
}
|
|
2701
2745
|
runNow() {
|
|
2746
|
+
if (this.stopping)
|
|
2747
|
+
return this.stopping;
|
|
2702
2748
|
this.pass ??= this.runPass().finally(() => {
|
|
2703
2749
|
this.pass = null;
|
|
2704
2750
|
});
|
|
@@ -2792,10 +2838,11 @@ class OntologyMaintenance {
|
|
|
2792
2838
|
this.timer = null;
|
|
2793
2839
|
}
|
|
2794
2840
|
const activePass = this.pass ?? Promise.resolve();
|
|
2795
|
-
const stopping = settlesWithin(activePass, this.shutdownTimeoutMs).then((settled) => {
|
|
2841
|
+
const stopping = settlesWithin(activePass, this.shutdownTimeoutMs).then(async (settled) => {
|
|
2796
2842
|
if (!settled) {
|
|
2797
|
-
this.reportError(new Error(`[Sixb] Ontology maintenance
|
|
2843
|
+
this.reportError(new Error(`[Sixb] Ontology maintenance is still stopping after ${this.shutdownTimeoutMs}ms; waiting for active storage operations.`));
|
|
2798
2844
|
}
|
|
2845
|
+
await activePass;
|
|
2799
2846
|
});
|
|
2800
2847
|
this.stopping = stopping.finally(() => {
|
|
2801
2848
|
this.stopping = null;
|
|
@@ -2948,6 +2995,17 @@ function resolveDefinitions(options) {
|
|
|
2948
2995
|
actions: actionRegistry
|
|
2949
2996
|
});
|
|
2950
2997
|
const models = options.models === undefined ? undefined : createModelCatalog2(options.models);
|
|
2998
|
+
for (const type of ontology.listObjectTypes()) {
|
|
2999
|
+
for (const [name, profile] of Object.entries(type.search?.vectors ?? {})) {
|
|
3000
|
+
const registered = models?.embedding.getByRef({
|
|
3001
|
+
provider: profile.model.providerId,
|
|
3002
|
+
modelId: profile.model.modelId
|
|
3003
|
+
});
|
|
3004
|
+
if (!registered || !sameEmbeddingModel(registered.model, profile.model)) {
|
|
3005
|
+
throw new Error("[Sixb] Vector profile " + type.id + "." + name + " requires its model in models.embedding with matching identity and dimensions.");
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
2951
3009
|
const tools = createAgentToolCatalog(options.tools);
|
|
2952
3010
|
const connectorsById = indexUniqueDefinitions("connector", options.connectors ?? []);
|
|
2953
3011
|
const datasetsById = new Map;
|
|
@@ -3009,7 +3067,7 @@ function resolveDefinitions(options) {
|
|
|
3009
3067
|
workflowIds: new Set(workflowsById.keys()),
|
|
3010
3068
|
syncIds: new Set(syncsById.keys()),
|
|
3011
3069
|
pipelineIds: new Set(pipelinesById.keys()),
|
|
3012
|
-
agentAvailable: models !== undefined,
|
|
3070
|
+
agentAvailable: models?.language !== undefined,
|
|
3013
3071
|
connectorIds: new Set(connectorsById.keys()),
|
|
3014
3072
|
shareIds: new Set(sharesById.keys()),
|
|
3015
3073
|
getSubTypes: (objectTypeId) => ontology.listSubTypes(objectTypeId)
|
|
@@ -3155,6 +3213,7 @@ class SixbHost2 {
|
|
|
3155
3213
|
storageReadiness;
|
|
3156
3214
|
connectorService;
|
|
3157
3215
|
materializer;
|
|
3216
|
+
sandboxDefinition;
|
|
3158
3217
|
definitions;
|
|
3159
3218
|
broker;
|
|
3160
3219
|
events;
|
|
@@ -3192,6 +3251,7 @@ class SixbHost2 {
|
|
|
3192
3251
|
this.projectRoot = resolve(options.projectRoot ?? process.cwd());
|
|
3193
3252
|
const definitions = resolveDefinitions(options);
|
|
3194
3253
|
this.definitions = definitions;
|
|
3254
|
+
this.sandboxDefinition = options.sandboxes?.configuration === undefined ? undefined : createSandboxDefinition(options.sandboxes.configuration, definitions.ontology);
|
|
3195
3255
|
registerProjectionRegistry2(this, definitions.projections);
|
|
3196
3256
|
this.auth = new AuthRuntime2({
|
|
3197
3257
|
projectId: this.projectId,
|
|
@@ -3234,6 +3294,7 @@ class SixbHost2 {
|
|
|
3234
3294
|
options: options.ontologyMaintenance
|
|
3235
3295
|
});
|
|
3236
3296
|
this.hostContext = {
|
|
3297
|
+
embeddingModels: definitions.models?.embedding,
|
|
3237
3298
|
projectId: this.projectId,
|
|
3238
3299
|
broker: this.broker,
|
|
3239
3300
|
ontology: definitions.ontology,
|
|
@@ -3244,6 +3305,7 @@ class SixbHost2 {
|
|
|
3244
3305
|
};
|
|
3245
3306
|
registerProjectionRegistry2(this.hostContext, definitions.projections);
|
|
3246
3307
|
shareSixbErrorReporter2(this, this.hostContext);
|
|
3308
|
+
registerVectorIndexingRuntime(this, createVectorIndexingRuntime(this.hostContext, this.materializer));
|
|
3247
3309
|
this.scheduler = new SchedulerRuntime2({
|
|
3248
3310
|
schedules: definitions.schedules.list(),
|
|
3249
3311
|
events: this.eventService
|
|
@@ -3255,13 +3317,18 @@ class SixbHost2 {
|
|
|
3255
3317
|
if (authorization.type === "unrestricted" && authorization.ref.type === "kernel") {
|
|
3256
3318
|
throw new Error("[Sixb] Kernel authority cannot be bound to the domain SDK.");
|
|
3257
3319
|
}
|
|
3320
|
+
const modelExecution = new ModelExecutionSession({ ...this.hostContext, runtimeAuthorization: capturedScope.authorization }, capturedScope.execution);
|
|
3321
|
+
const embeddingModels = bindEmbeddingModels(this.hostContext.embeddingModels, modelExecution);
|
|
3258
3322
|
const objectReader = createAuthorizedObjectReader({
|
|
3259
3323
|
scope: capturedScope,
|
|
3260
3324
|
ontology: this.hostContext.ontology,
|
|
3261
|
-
objectStorage: this.storage.objects
|
|
3325
|
+
objectStorage: this.storage.objects,
|
|
3326
|
+
embeddingModels
|
|
3262
3327
|
});
|
|
3263
3328
|
const runtime = {
|
|
3264
3329
|
...this.hostContext,
|
|
3330
|
+
embeddingModels,
|
|
3331
|
+
modelExecution,
|
|
3265
3332
|
runtimeAuthorization: capturedScope.authorization,
|
|
3266
3333
|
objectReader,
|
|
3267
3334
|
...authorization.type === "principal" ? { authorization: authorization.context } : {}
|
|
@@ -3308,6 +3375,10 @@ class SixbHost2 {
|
|
|
3308
3375
|
sixbDependencies() {
|
|
3309
3376
|
return {
|
|
3310
3377
|
definitions: this.definitions,
|
|
3378
|
+
sandbox: this.sandboxDefinition && {
|
|
3379
|
+
definition: this.sandboxDefinition,
|
|
3380
|
+
supportsPersistence: typeof this.sandboxes?.resume === "function"
|
|
3381
|
+
},
|
|
3311
3382
|
logging: this.logging,
|
|
3312
3383
|
connectorService: this.connectorService,
|
|
3313
3384
|
...this.connectorService.connectionProcess === undefined ? {} : { connectorConnections: this.connectorService.connectionProcess },
|
|
@@ -3383,4 +3454,4 @@ async function createSixb2(options) {
|
|
|
3383
3454
|
}
|
|
3384
3455
|
export { WebhookValidationError2, defineWebhook2, webhookConnector2, UnverifiedWebhookError2, resolveWebhookVerification2, warnUnverifiedWebhook2, SixbHost2, createSixb2 };
|
|
3385
3456
|
|
|
3386
|
-
//# debugId=
|
|
3457
|
+
//# debugId=FF7923F084E37FAE64756E2164756E21
|