@sixb/core 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/index.js +25 -25
- package/dist/actions/types/context.d.ts +2 -2
- package/dist/actions/types/context.d.ts.map +1 -1
- package/dist/actions/worker.js +1 -1
- package/dist/agents/index.js +41 -40
- package/dist/agents/index.js.map +1 -1
- package/dist/auth/index.js +5 -5
- package/dist/authorization/index.js +2 -2
- package/dist/blob-storage/download-urls.d.ts +41 -0
- package/dist/blob-storage/download-urls.d.ts.map +1 -0
- package/dist/blob-storage/execution.d.ts +9 -1
- package/dist/blob-storage/execution.d.ts.map +1 -1
- package/dist/blob-storage/index.js +5 -3
- package/dist/blob-storage/index.js.map +1 -1
- package/dist/blob-storage/internal.d.ts +2 -0
- package/dist/blob-storage/internal.d.ts.map +1 -0
- package/dist/blob-storage/internal.js +11 -0
- package/dist/blob-storage/internal.js.map +9 -0
- package/dist/bootstrap/index.js +45 -44
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/{chunk-8x74221e.js → chunk-10styjgk.js} +18 -13
- package/dist/{chunk-8x74221e.js.map → chunk-10styjgk.js.map} +3 -3
- package/dist/{chunk-hgqpcmyr.js → chunk-1hqwggsn.js} +47 -19
- package/dist/chunk-1hqwggsn.js.map +12 -0
- package/dist/{chunk-zb47r1c8.js → chunk-23xs4qp9.js} +2 -2
- package/dist/{chunk-gmdvns8f.js → chunk-2am3db31.js} +2 -2
- package/dist/{chunk-fj1dvp37.js → chunk-2vhg6ysa.js} +1 -1
- package/dist/{chunk-dp7yk20b.js → chunk-33saed7g.js} +1 -1
- package/dist/{chunk-mdnw7nj8.js → chunk-3rrezgyc.js} +33 -8
- package/dist/chunk-3rrezgyc.js.map +15 -0
- package/dist/{chunk-jgwb25gc.js → chunk-4as3wt1c.js} +13 -5
- package/dist/chunk-4as3wt1c.js.map +12 -0
- package/dist/chunk-4ra628t7.js +88 -0
- package/dist/chunk-4ra628t7.js.map +10 -0
- package/dist/{chunk-chdg6eqq.js → chunk-52c5zb0z.js} +2 -2
- package/dist/{chunk-69kt9q43.js → chunk-5be2ath4.js} +1 -1
- package/dist/{chunk-qnd7ehe5.js → chunk-5thzcb8g.js} +2 -2
- package/dist/{chunk-6z1q7j19.js → chunk-5yd8cchh.js} +1126 -780
- package/dist/chunk-5yd8cchh.js.map +66 -0
- package/dist/{chunk-3q7z9hd4.js → chunk-6wbm6ymz.js} +234 -40
- package/dist/{chunk-3q7z9hd4.js.map → chunk-6wbm6ymz.js.map} +8 -6
- package/dist/{chunk-kvysp909.js → chunk-7ecp4v7a.js} +26 -19
- package/dist/chunk-7ecp4v7a.js.map +17 -0
- package/dist/{chunk-f85hpqnm.js → chunk-99nd4rc1.js} +3 -3
- package/dist/{chunk-f85hpqnm.js.map → chunk-99nd4rc1.js.map} +3 -3
- package/dist/{chunk-dsv8kdgk.js → chunk-9g6jz9kk.js} +5 -5
- package/dist/{chunk-39tqv9hz.js → chunk-9se093qz.js} +5 -6
- package/dist/{chunk-39tqv9hz.js.map → chunk-9se093qz.js.map} +3 -4
- package/dist/{chunk-7g2gjvah.js → chunk-a7er86jd.js} +1 -1
- package/dist/{chunk-zdkcdshk.js → chunk-aq39q04r.js} +41 -3
- package/dist/{chunk-zdkcdshk.js.map → chunk-aq39q04r.js.map} +4 -3
- package/dist/chunk-b9affek3.js +261 -0
- package/dist/chunk-b9affek3.js.map +12 -0
- package/dist/{chunk-b9y8hcm2.js → chunk-c2rga5cx.js} +1 -1
- package/dist/{chunk-f72rbvsb.js → chunk-cnb5kv05.js} +2 -2
- package/dist/chunk-d62kjtbg.js.map +2 -2
- package/dist/{chunk-vjqt7q3a.js → chunk-dam456ve.js} +233 -34
- package/dist/{chunk-vjqt7q3a.js.map → chunk-dam456ve.js.map} +7 -5
- package/dist/{chunk-sbcm1b92.js → chunk-e67ynxcr.js} +3 -3
- package/dist/{chunk-xnx96gfy.js → chunk-ere85b8y.js} +17 -8
- package/dist/chunk-ere85b8y.js.map +15 -0
- package/dist/{chunk-k4kkp58d.js → chunk-ewqa58h9.js} +12 -2
- package/dist/chunk-ewqa58h9.js.map +11 -0
- package/dist/{chunk-cq44v1a6.js → chunk-f1xh7a32.js} +3 -3
- package/dist/{chunk-h4138ww2.js → chunk-fggq3d9k.js} +450 -799
- package/dist/chunk-fggq3d9k.js.map +49 -0
- package/dist/{chunk-kttr5ftm.js → chunk-gf7yht60.js} +3 -3
- package/dist/chunk-h8teetr0.js +9 -0
- package/dist/chunk-h8teetr0.js.map +10 -0
- package/dist/chunk-hn2r7z41.js.map +1 -1
- package/dist/{chunk-nj0020ay.js → chunk-jjrn5v0p.js} +1 -1
- package/dist/{chunk-nvymebc1.js → chunk-jnfxmr3f.js} +1 -1
- package/dist/{chunk-nkbev3tr.js → chunk-k4g51s47.js} +3 -3
- package/dist/{chunk-a0073121.js → chunk-kpx7jrmn.js} +3 -1
- package/dist/chunk-kpx7jrmn.js.map +12 -0
- package/dist/{chunk-h044jb97.js → chunk-pja9jfz6.js} +172 -10
- package/dist/chunk-pja9jfz6.js.map +19 -0
- package/dist/chunk-pqajwytd.js.map +1 -1
- package/dist/{chunk-mr60an99.js → chunk-qczk96d9.js} +22 -2
- package/dist/{chunk-mr60an99.js.map → chunk-qczk96d9.js.map} +3 -3
- package/dist/{chunk-s3csryxe.js → chunk-rj69qcrd.js} +8 -2
- package/dist/chunk-rj69qcrd.js.map +11 -0
- package/dist/{chunk-swxzncrv.js → chunk-rpxz486p.js} +32 -5
- package/dist/{chunk-swxzncrv.js.map → chunk-rpxz486p.js.map} +4 -4
- package/dist/{chunk-tkdbge6v.js → chunk-rx7h5fdx.js} +1 -1
- package/dist/{chunk-tnvafr7g.js → chunk-s7ftxrdr.js} +105 -7
- package/dist/chunk-s7ftxrdr.js.map +22 -0
- package/dist/{chunk-h866d223.js → chunk-sk0hcjsz.js} +1 -1
- package/dist/{chunk-2xvgy3x5.js → chunk-svabwqdq.js} +2 -2
- package/dist/{chunk-667x4drs.js → chunk-t9shqx3w.js} +2 -2
- package/dist/{chunk-40qb8wpe.js → chunk-tjjgy3z4.js} +26 -23
- package/dist/{chunk-40qb8wpe.js.map → chunk-tjjgy3z4.js.map} +3 -3
- package/dist/{chunk-gkxsenvp.js → chunk-vp3z1ckh.js} +31 -7
- package/dist/{chunk-gkxsenvp.js.map → chunk-vp3z1ckh.js.map} +5 -4
- package/dist/{chunk-cxj8y8t0.js → chunk-vre348sb.js} +2 -2
- package/dist/{chunk-vsvrv7n8.js → chunk-w9yycd3t.js} +1 -1
- package/dist/{chunk-g4rbm4a6.js → chunk-wt4szfec.js} +379 -331
- package/dist/chunk-wt4szfec.js.map +14 -0
- package/dist/{chunk-a7ne02hk.js → chunk-xcy5ddha.js} +6 -6
- package/dist/{chunk-zvmr2hqk.js → chunk-xyvy73tj.js} +4 -3
- package/dist/{chunk-zvmr2hqk.js.map → chunk-xyvy73tj.js.map} +3 -3
- package/dist/datasets/write.js +1 -1
- package/dist/execution/agent.js +38 -37
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts +3 -1
- package/dist/execution/authorized-object-reader.d.ts.map +1 -1
- package/dist/execution/primitive.js +36 -35
- package/dist/execution/primitive.js.map +2 -2
- package/dist/execution/request.js +37 -36
- package/dist/execution/request.js.map +2 -2
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -59
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/in-memory.d.ts +5 -1
- package/dist/lake-storage/in-memory.d.ts.map +1 -1
- package/dist/lake-storage/index.d.ts +1 -1
- package/dist/lake-storage/index.d.ts.map +1 -1
- package/dist/lake-storage/index.js +2 -2
- package/dist/lake-storage/types.d.ts +26 -0
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/maintenance/ontology-maintenance.d.ts +5 -1
- package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
- package/dist/maintenance/types.d.ts +1 -4
- package/dist/maintenance/types.d.ts.map +1 -1
- package/dist/materialization/event-envelopes.d.ts +20 -0
- package/dist/materialization/event-envelopes.d.ts.map +1 -0
- package/dist/materialization/events.d.ts +29 -3
- package/dist/materialization/events.d.ts.map +1 -1
- package/dist/materialization/index.d.ts +4 -1
- package/dist/materialization/index.d.ts.map +1 -1
- package/dist/materialization/index.js +9 -3
- package/dist/materialization/index.js.map +1 -1
- package/dist/materializer/edits/plan.d.ts +2 -10
- package/dist/materializer/edits/plan.d.ts.map +1 -1
- package/dist/materializer/effective/build-events.d.ts +5 -21
- package/dist/materializer/effective/build-events.d.ts.map +1 -1
- package/dist/materializer/effective/vector-indexing.d.ts +2 -3
- package/dist/materializer/effective/vector-indexing.d.ts.map +1 -1
- package/dist/materializer/effective/vectors.d.ts +2 -3
- package/dist/materializer/effective/vectors.d.ts.map +1 -1
- package/dist/materializer/execution/scope.d.ts +1 -11
- package/dist/materializer/execution/scope.d.ts.map +1 -1
- package/dist/materializer/execution/work-executor.d.ts +5 -7
- package/dist/materializer/execution/work-executor.d.ts.map +1 -1
- package/dist/materializer/execution/work-records.d.ts +1 -3
- package/dist/materializer/execution/work-records.d.ts.map +1 -1
- package/dist/materializer/index.js +31 -32
- package/dist/materializer/index.js.map +1 -1
- package/dist/materializer/projections/replace.d.ts.map +1 -1
- package/dist/materializer/projections/replacement-plan.d.ts +8 -11
- package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
- package/dist/materializer/shared/batching.d.ts +5 -0
- package/dist/materializer/shared/batching.d.ts.map +1 -1
- package/dist/materializer/telemetry/plan.d.ts +2 -8
- package/dist/materializer/telemetry/plan.d.ts.map +1 -1
- package/dist/models/audio/catalog.d.ts +20 -0
- package/dist/models/audio/catalog.d.ts.map +1 -0
- package/dist/models/audio/errors.d.ts +8 -0
- package/dist/models/audio/errors.d.ts.map +1 -0
- package/dist/models/audio/file.d.ts +9 -0
- package/dist/models/audio/file.d.ts.map +1 -0
- package/dist/models/audio/runtime.d.ts +8 -0
- package/dist/models/audio/runtime.d.ts.map +1 -0
- package/dist/models/audio/types.d.ts +60 -0
- package/dist/models/audio/types.d.ts.map +1 -0
- package/dist/models/catalog.d.ts +23 -1
- package/dist/models/catalog.d.ts.map +1 -1
- package/dist/models/definitions.d.ts +1 -1
- package/dist/models/definitions.d.ts.map +1 -1
- package/dist/models/events.d.ts +3 -0
- package/dist/models/events.d.ts.map +1 -1
- package/dist/models/execution/index.js +22 -22
- package/dist/models/execution/model-call-admission.d.ts +6 -1
- package/dist/models/execution/model-call-admission.d.ts.map +1 -1
- package/dist/models/execution/model-call-limits.d.ts.map +1 -1
- package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
- package/dist/models/execution/reranking.d.ts +4 -0
- package/dist/models/execution/reranking.d.ts.map +1 -0
- package/dist/models/execution/usage.d.ts.map +1 -1
- package/dist/models/execution.d.ts +2 -1
- 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 +7 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +6 -2
- package/dist/models/index.js.map +1 -1
- package/dist/models/pricing.d.ts +2 -2
- package/dist/models/pricing.d.ts.map +1 -1
- package/dist/models/reranking-model.d.ts +49 -0
- package/dist/models/reranking-model.d.ts.map +1 -0
- package/dist/objects/index.js +25 -25
- package/dist/objects/query/executor.d.ts +2 -1
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/index.d.ts +1 -1
- package/dist/objects/query/index.d.ts.map +1 -1
- package/dist/objects/query/index.js +22 -22
- package/dist/objects/query/ir.d.ts +8 -1
- package/dist/objects/query/ir.d.ts.map +1 -1
- package/dist/objects/query/normalize.d.ts.map +1 -1
- package/dist/objects/query/planner.d.ts +1 -1
- package/dist/objects/query/planner.d.ts.map +1 -1
- package/dist/objects/query/primary-id.d.ts +7 -0
- package/dist/objects/query/primary-id.d.ts.map +1 -0
- package/dist/objects/query/reranking-executor.d.ts +13 -0
- package/dist/objects/query/reranking-executor.d.ts.map +1 -0
- package/dist/objects/query/reranking-limits.d.ts +3 -0
- package/dist/objects/query/reranking-limits.d.ts.map +1 -0
- package/dist/objects/query/reranking-query.d.ts +4 -0
- package/dist/objects/query/reranking-query.d.ts.map +1 -0
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/objects/sdk/query-builder.d.ts +8 -0
- package/dist/objects/sdk/query-builder.d.ts.map +1 -1
- package/dist/objects/sdk/query-executor.d.ts +2 -2
- 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/indexing-dispatch.d.ts +21 -0
- package/dist/objects/vectors/indexing-dispatch.d.ts.map +1 -0
- package/dist/objects/vectors/query.d.ts.map +1 -1
- package/dist/ontology/builders.d.ts.map +1 -1
- package/dist/ontology/index.d.ts +1 -1
- package/dist/ontology/index.d.ts.map +1 -1
- package/dist/ontology/index.js +3 -3
- package/dist/ontology/internal.js +2 -2
- package/dist/ontology/query-capabilities.d.ts +1 -0
- package/dist/ontology/query-capabilities.d.ts.map +1 -1
- package/dist/ontology/types.d.ts +20 -0
- package/dist/ontology/types.d.ts.map +1 -1
- package/dist/ontology/validation/query.d.ts.map +1 -1
- package/dist/pipelines/index.js +23 -23
- package/dist/projections/internal.js +22 -22
- package/dist/query.d.ts +4 -2
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +2 -2
- package/dist/queues/in-memory.d.ts +3 -0
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/queues/index.js +1 -1
- package/dist/queues/types.d.ts +4 -0
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +1 -0
- 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 +1 -0
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +28 -26
- package/dist/runtime/internal.js.map +1 -1
- package/dist/runtime/public-origin.d.ts +10 -0
- package/dist/runtime/public-origin.d.ts.map +1 -0
- package/dist/runtime/sixb.d.ts +1 -0
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +12 -2
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/sandboxes/index.js +5 -5
- package/dist/shares/internal.js +19 -19
- package/dist/storage/agents/provider.js +2 -2
- 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/provider.js +3 -3
- package/dist/storage/ai-cost/types.d.ts +1 -1
- package/dist/storage/ai-cost/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/validation.d.ts.map +1 -1
- package/dist/storage/ai-limits/enforcement.js +2 -2
- package/dist/storage/ai-limits/in-memory.d.ts.map +1 -1
- package/dist/storage/ai-limits/provider.d.ts +7 -2
- package/dist/storage/ai-limits/provider.d.ts.map +1 -1
- package/dist/storage/ai-limits/provider.js +4 -2
- package/dist/storage/ai-limits/provider.js.map +1 -1
- package/dist/storage/ai-limits/types.d.ts +3 -0
- package/dist/storage/ai-limits/types.d.ts.map +1 -1
- package/dist/storage/ai-usage/record.d.ts.map +1 -1
- package/dist/storage/ai-usage/types.d.ts +8 -4
- package/dist/storage/ai-usage/types.d.ts.map +1 -1
- package/dist/storage/ai-usage/usage.d.ts.map +1 -1
- package/dist/storage/file-download-grants/in-memory.d.ts +11 -0
- package/dist/storage/file-download-grants/in-memory.d.ts.map +1 -0
- package/dist/storage/file-download-grants/index.d.ts +3 -0
- package/dist/storage/file-download-grants/index.d.ts.map +1 -0
- package/dist/storage/file-download-grants/record.d.ts +11 -0
- package/dist/storage/file-download-grants/record.d.ts.map +1 -0
- package/dist/storage/file-download-grants/types.d.ts +44 -0
- package/dist/storage/file-download-grants/types.d.ts.map +1 -0
- package/dist/storage/file-upload-sessions/provider.js +6 -6
- package/dist/storage/in-memory/index.d.ts +4 -0
- package/dist/storage/in-memory/index.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 +30 -30
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +1 -0
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +8 -4
- package/dist/storage/internal.js.map +1 -1
- package/dist/storage/migrations/index.d.ts +1 -1
- package/dist/storage/migrations/index.d.ts.map +1 -1
- package/dist/storage/migrations/migrate-storage.d.ts +3 -3
- package/dist/storage/migrations/migrate-storage.d.ts.map +1 -1
- package/dist/storage/migrations/types.d.ts +7 -0
- package/dist/storage/migrations/types.d.ts.map +1 -1
- package/dist/storage/objects/in-memory/query.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.map +1 -1
- package/dist/storage/objects/query-preparation.d.ts +39 -0
- package/dist/storage/objects/query-preparation.d.ts.map +1 -0
- 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 -6
- package/dist/storage/ontology/commits.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/index.d.ts +4 -2
- package/dist/storage/ontology/in-memory/index.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/materializations-state.d.ts +0 -2
- package/dist/storage/ontology/in-memory/materializations-state.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/materializations-work.d.ts +1 -3
- package/dist/storage/ontology/in-memory/materializations-work.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/materializations.d.ts +23 -57
- package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/outbox.d.ts +3 -2
- package/dist/storage/ontology/in-memory/outbox.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/replacement-plans.d.ts +104 -0
- package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -0
- package/dist/storage/ontology/in-memory/shared-state.d.ts +17 -2
- package/dist/storage/ontology/in-memory/shared-state.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/source-roots.d.ts +3 -1
- package/dist/storage/ontology/in-memory/source-roots.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/sources.d.ts +1 -2
- package/dist/storage/ontology/in-memory/sources.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/state-reader.d.ts +25 -0
- package/dist/storage/ontology/in-memory/state-reader.d.ts.map +1 -0
- package/dist/storage/ontology/index.d.ts +6 -3
- package/dist/storage/ontology/index.d.ts.map +1 -1
- package/dist/storage/ontology/materializations.d.ts +40 -59
- package/dist/storage/ontology/materializations.d.ts.map +1 -1
- package/dist/storage/ontology/outbox.d.ts +4 -6
- package/dist/storage/ontology/outbox.d.ts.map +1 -1
- package/dist/storage/ontology/provider-work.d.ts +114 -3
- package/dist/storage/ontology/provider-work.d.ts.map +1 -1
- package/dist/storage/ontology/provider.d.ts +14 -39
- package/dist/storage/ontology/provider.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +26 -12
- package/dist/storage/ontology/provider.js.map +1 -1
- package/dist/storage/ontology/replacement-plans.d.ts +103 -0
- package/dist/storage/ontology/replacement-plans.d.ts.map +1 -0
- package/dist/storage/ontology/sources.d.ts +0 -8
- package/dist/storage/ontology/sources.d.ts.map +1 -1
- package/dist/storage/operation-scope.d.ts.map +1 -1
- package/dist/storage/operation-scope.js +1 -1
- package/dist/storage/projection-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/projection-runs/types.d.ts +2 -0
- package/dist/storage/projection-runs/types.d.ts.map +1 -1
- package/dist/storage/types.d.ts +2 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +6 -6
- package/dist/syncs/index.js +24 -24
- package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-limit-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
- package/dist/testing/file-download-grant-storage-contract.d.ts +9 -0
- package/dist/testing/file-download-grant-storage-contract.d.ts.map +1 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +2549 -1490
- package/dist/testing/index.js.map +14 -13
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/materializer-storage-contract.d.ts +14 -0
- package/dist/testing/materializer-storage-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 +5 -1
- 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/projection-run-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +20 -20
- package/dist/workers/index.js +15 -17
- package/dist/workers/index.js.map +3 -3
- package/dist/workers/queue-worker.d.ts +3 -2
- package/dist/workers/queue-worker.d.ts.map +1 -1
- package/dist/workflows/index.js +42 -41
- package/dist/workflows/index.js.map +1 -1
- package/package.json +7 -1
- package/src/actions/types/context.ts +5 -2
- package/src/blob-storage/download-urls.ts +138 -0
- package/src/blob-storage/execution.ts +32 -1
- package/src/blob-storage/internal.ts +1 -0
- package/src/execution/authorized-object-reader.ts +8 -1
- package/src/index.ts +25 -0
- package/src/lake-storage/in-memory.ts +38 -9
- package/src/lake-storage/index.ts +2 -0
- package/src/lake-storage/types.ts +30 -0
- package/src/maintenance/ontology-maintenance.ts +50 -23
- package/src/maintenance/types.ts +1 -4
- package/src/materialization/event-envelopes.ts +168 -0
- package/src/materialization/events.ts +40 -4
- package/src/materialization/index.ts +9 -1
- package/src/materializer/README.md +55 -10
- package/src/materializer/edits/commit.ts +3 -19
- package/src/materializer/edits/plan.ts +20 -71
- package/src/materializer/effective/build-events.ts +42 -136
- package/src/materializer/effective/vector-indexing.ts +2 -3
- package/src/materializer/effective/vectors.ts +2 -3
- package/src/materializer/execution/scope.ts +1 -38
- package/src/materializer/execution/work-executor.ts +21 -115
- package/src/materializer/execution/work-records.ts +0 -15
- package/src/materializer/projections/replace.ts +106 -63
- package/src/materializer/projections/replacement-plan.ts +73 -218
- package/src/materializer/shared/batching.ts +7 -0
- package/src/materializer/telemetry/append.ts +2 -14
- package/src/materializer/telemetry/plan.ts +6 -43
- package/src/models/audio/catalog.ts +90 -0
- package/src/models/audio/errors.ts +19 -0
- package/src/models/audio/file.ts +78 -0
- package/src/models/audio/runtime.ts +182 -0
- package/src/models/audio/types.ts +69 -0
- package/src/models/catalog.ts +52 -5
- package/src/models/definitions.ts +8 -1
- package/src/models/events.ts +3 -0
- package/src/models/execution/README.md +20 -1
- package/src/models/execution/model-call-admission.ts +6 -1
- package/src/models/execution/model-call-limits.ts +21 -11
- package/src/models/execution/model-call-recorder.ts +1 -0
- package/src/models/execution/model-call-recovery.ts +1 -0
- package/src/models/execution/reranking.ts +137 -0
- package/src/models/execution/usage.ts +1 -0
- package/src/models/execution.ts +5 -1
- package/src/models/generation-types.ts +2 -0
- package/src/models/index.ts +32 -0
- package/src/models/pricing.ts +2 -1
- package/src/models/reranking-model.ts +114 -0
- package/src/objects/query/executor.ts +42 -2
- package/src/objects/query/explain.ts +8 -0
- package/src/objects/query/index.ts +1 -0
- package/src/objects/query/ir.ts +10 -0
- package/src/objects/query/normalize.ts +2 -0
- package/src/objects/query/planner.ts +12 -1
- package/src/objects/query/primary-id.ts +56 -0
- package/src/objects/query/reranking-executor.ts +91 -0
- package/src/objects/query/reranking-limits.ts +3 -0
- package/src/objects/query/reranking-query.ts +8 -0
- package/src/objects/query/validate.ts +33 -1
- package/src/objects/sdk/query-builder.ts +15 -2
- package/src/objects/sdk/query-executor.ts +2 -2
- package/src/objects/sdk/runtime-query-executor.ts +7 -4
- package/src/objects/vectors/README.md +6 -2
- package/src/objects/vectors/indexing-dispatch.ts +83 -0
- package/src/objects/vectors/query.ts +3 -0
- package/src/ontology/builders.ts +1 -0
- package/src/ontology/index.ts +2 -0
- package/src/ontology/query-capabilities.ts +1 -1
- package/src/ontology/types.ts +21 -0
- package/src/ontology/validation/query.ts +57 -0
- package/src/query.ts +4 -0
- package/src/queues/in-memory.ts +54 -19
- package/src/queues/types.ts +4 -0
- package/src/runtime/host.ts +28 -1
- package/src/runtime/index.ts +1 -0
- package/src/runtime/internal.ts +1 -0
- package/src/runtime/public-origin.ts +33 -0
- package/src/runtime/sixb.ts +13 -2
- package/src/runtime/types.ts +12 -2
- package/src/storage/ai-cost/analytics.ts +2 -0
- package/src/storage/ai-cost/codec.ts +2 -1
- package/src/storage/ai-cost/types.ts +1 -0
- package/src/storage/ai-cost/validation.ts +21 -8
- package/src/storage/ai-limits/in-memory.ts +10 -2
- package/src/storage/ai-limits/provider.ts +29 -2
- package/src/storage/ai-limits/types.ts +3 -0
- package/src/storage/ai-usage/record.ts +9 -0
- package/src/storage/ai-usage/types.ts +8 -4
- package/src/storage/ai-usage/usage.ts +2 -0
- package/src/storage/file-download-grants/in-memory.ts +73 -0
- package/src/storage/file-download-grants/index.ts +8 -0
- package/src/storage/file-download-grants/record.ts +47 -0
- package/src/storage/file-download-grants/types.ts +48 -0
- package/src/storage/in-memory/index.ts +13 -2
- package/src/storage/index.ts +31 -13
- package/src/storage/internal.ts +1 -0
- package/src/storage/migrations/index.ts +1 -0
- package/src/storage/migrations/migrate-storage.ts +36 -12
- package/src/storage/migrations/types.ts +8 -0
- package/src/storage/objects/in-memory/query.ts +2 -0
- package/src/storage/objects/in-memory/selected-reader.ts +1 -0
- package/src/storage/objects/in-memory/storage.ts +1 -0
- package/src/storage/objects/query-preparation.ts +77 -0
- package/src/storage/objects/types.ts +2 -0
- package/src/storage/ontology/commits.ts +1 -6
- package/src/storage/ontology/in-memory/index.ts +28 -9
- package/src/storage/ontology/in-memory/materializations-finalization.ts +35 -68
- package/src/storage/ontology/in-memory/materializations-state.ts +0 -22
- package/src/storage/ontology/in-memory/materializations-work.ts +0 -45
- package/src/storage/ontology/in-memory/materializations.ts +172 -653
- package/src/storage/ontology/in-memory/outbox.ts +37 -29
- package/src/storage/ontology/in-memory/replacement-plans.ts +697 -0
- package/src/storage/ontology/in-memory/shared-state.ts +24 -2
- package/src/storage/ontology/in-memory/source-roots.ts +7 -2
- package/src/storage/ontology/in-memory/sources.ts +7 -33
- package/src/storage/ontology/in-memory/state-reader.ts +245 -0
- package/src/storage/ontology/index.ts +19 -13
- package/src/storage/ontology/materializations.ts +45 -74
- package/src/storage/ontology/outbox.ts +4 -7
- package/src/storage/ontology/provider-header-validation.ts +0 -57
- package/src/storage/ontology/provider-work.ts +381 -90
- package/src/storage/ontology/provider.ts +74 -171
- package/src/storage/ontology/replacement-plans.ts +117 -0
- package/src/storage/ontology/sources.ts +0 -12
- package/src/storage/operation-scope.ts +33 -1
- package/src/storage/projection-runs/in-memory.ts +7 -1
- package/src/storage/projection-runs/types.ts +2 -0
- package/src/storage/types.ts +2 -0
- package/src/testing/ai-cost-storage-contract.ts +1 -0
- package/src/testing/ai-limit-storage-contract.ts +62 -0
- package/src/testing/ai-usage-storage-contract.ts +31 -0
- package/src/testing/file-download-grant-storage-contract.ts +139 -0
- package/src/testing/index.ts +4 -0
- package/src/testing/lake-storage-contract.ts +87 -1
- package/src/testing/materializer-storage-contract.ts +1008 -1
- package/src/testing/object-read-scope-contract.ts +1 -0
- package/src/testing/ontology-contract-fixture.ts +11 -87
- package/src/testing/ontology-storage-contract.ts +70 -39
- package/src/testing/projection-run-storage-contract.ts +14 -0
- package/src/testing/queues-contract.ts +59 -0
- package/src/workers/queue-worker.ts +19 -16
- package/dist/chunk-6z1q7j19.js.map +0 -62
- package/dist/chunk-7ytf06d3.js +0 -113
- package/dist/chunk-7ytf06d3.js.map +0 -10
- package/dist/chunk-a0073121.js.map +0 -12
- package/dist/chunk-g4rbm4a6.js.map +0 -15
- package/dist/chunk-h044jb97.js.map +0 -15
- package/dist/chunk-h4138ww2.js.map +0 -50
- package/dist/chunk-hgqpcmyr.js.map +0 -12
- package/dist/chunk-jgwb25gc.js.map +0 -12
- package/dist/chunk-k4kkp58d.js.map +0 -11
- package/dist/chunk-kvysp909.js.map +0 -17
- package/dist/chunk-mdnw7nj8.js.map +0 -15
- package/dist/chunk-s3csryxe.js.map +0 -11
- package/dist/chunk-tnvafr7g.js.map +0 -19
- package/dist/chunk-xnx96gfy.js.map +0 -15
- package/dist/materializer/execution/plan-stream.d.ts +0 -8
- package/dist/materializer/execution/plan-stream.d.ts.map +0 -1
- package/src/materializer/execution/plan-stream.ts +0 -121
- /package/dist/{chunk-zb47r1c8.js.map → chunk-23xs4qp9.js.map} +0 -0
- /package/dist/{chunk-gmdvns8f.js.map → chunk-2am3db31.js.map} +0 -0
- /package/dist/{chunk-fj1dvp37.js.map → chunk-2vhg6ysa.js.map} +0 -0
- /package/dist/{chunk-dp7yk20b.js.map → chunk-33saed7g.js.map} +0 -0
- /package/dist/{chunk-chdg6eqq.js.map → chunk-52c5zb0z.js.map} +0 -0
- /package/dist/{chunk-69kt9q43.js.map → chunk-5be2ath4.js.map} +0 -0
- /package/dist/{chunk-qnd7ehe5.js.map → chunk-5thzcb8g.js.map} +0 -0
- /package/dist/{chunk-dsv8kdgk.js.map → chunk-9g6jz9kk.js.map} +0 -0
- /package/dist/{chunk-7g2gjvah.js.map → chunk-a7er86jd.js.map} +0 -0
- /package/dist/{chunk-b9y8hcm2.js.map → chunk-c2rga5cx.js.map} +0 -0
- /package/dist/{chunk-f72rbvsb.js.map → chunk-cnb5kv05.js.map} +0 -0
- /package/dist/{chunk-sbcm1b92.js.map → chunk-e67ynxcr.js.map} +0 -0
- /package/dist/{chunk-cq44v1a6.js.map → chunk-f1xh7a32.js.map} +0 -0
- /package/dist/{chunk-kttr5ftm.js.map → chunk-gf7yht60.js.map} +0 -0
- /package/dist/{chunk-nj0020ay.js.map → chunk-jjrn5v0p.js.map} +0 -0
- /package/dist/{chunk-nvymebc1.js.map → chunk-jnfxmr3f.js.map} +0 -0
- /package/dist/{chunk-nkbev3tr.js.map → chunk-k4g51s47.js.map} +0 -0
- /package/dist/{chunk-tkdbge6v.js.map → chunk-rx7h5fdx.js.map} +0 -0
- /package/dist/{chunk-h866d223.js.map → chunk-sk0hcjsz.js.map} +0 -0
- /package/dist/{chunk-2xvgy3x5.js.map → chunk-svabwqdq.js.map} +0 -0
- /package/dist/{chunk-667x4drs.js.map → chunk-t9shqx3w.js.map} +0 -0
- /package/dist/{chunk-cxj8y8t0.js.map → chunk-vre348sb.js.map} +0 -0
- /package/dist/{chunk-vsvrv7n8.js.map → chunk-w9yycd3t.js.map} +0 -0
- /package/dist/{chunk-a7ne02hk.js.map → chunk-xcy5ddha.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AuthorizationContext, assertAuthorized } from "../../authorization"
|
|
2
2
|
import type { RuntimeAuthorization } from "../../execution/types"
|
|
3
|
-
import type { EmbeddingModelCatalog } from "../../models/catalog"
|
|
3
|
+
import type { EmbeddingModelCatalog, RerankingModelCatalog } from "../../models/catalog"
|
|
4
4
|
import type { OntologyRegistry } from "../../ontology"
|
|
5
5
|
import type {
|
|
6
6
|
CountObjectsResult,
|
|
@@ -34,6 +34,9 @@ import type {
|
|
|
34
34
|
} from "./ir"
|
|
35
35
|
import { normalizeObjectQuery } from "./normalize"
|
|
36
36
|
import { type ObjectQueryPlan, type ObjectQueryPlanningOptions, planObjectQuery } from "./planner"
|
|
37
|
+
import { usePrimaryIdLookups } from "./primary-id"
|
|
38
|
+
import { rerankObjectCandidates } from "./reranking-executor"
|
|
39
|
+
import { findQueryReranking } from "./reranking-query"
|
|
37
40
|
import { compareQueryScalarValues, queryScalarValuesEqual } from "./scalar-values"
|
|
38
41
|
import {
|
|
39
42
|
type ObjectQueryValidationIssue,
|
|
@@ -54,6 +57,7 @@ export interface QueryExecutorOptions
|
|
|
54
57
|
> {
|
|
55
58
|
ontology: OntologyRegistry
|
|
56
59
|
embeddingModels?: EmbeddingModelCatalog
|
|
60
|
+
rerankingModels?: RerankingModelCatalog
|
|
57
61
|
storage: ObjectReadStorage
|
|
58
62
|
maxLimit?: number
|
|
59
63
|
maxPageSize?: number
|
|
@@ -178,6 +182,37 @@ export async function executeObjectQuery(
|
|
|
178
182
|
throw new ObjectQueryPlanningError(plan.issues)
|
|
179
183
|
}
|
|
180
184
|
|
|
185
|
+
if (plan.mode === "pipeline") {
|
|
186
|
+
const reranking = findQueryReranking(validated.query)
|
|
187
|
+
if (!reranking || reranking.input.kind !== "vector") {
|
|
188
|
+
throw new ObjectQueryExecutionError(
|
|
189
|
+
"invalid_rerank_input",
|
|
190
|
+
"Reranking requires vector candidates."
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
// Resolve the allowlisted server binding before paying for query embedding.
|
|
194
|
+
const model = options.rerankingModels?.getByRef(reranking.model)?.model
|
|
195
|
+
if (!model) {
|
|
196
|
+
throw new ObjectQueryExecutionError(
|
|
197
|
+
"reranking_model_unavailable",
|
|
198
|
+
`Reranking model '${reranking.model.provider}/${reranking.model.modelId}' is not configured in models.reranking.`
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
const candidates = await executeObjectQuery(
|
|
202
|
+
{ ...input, query: reranking.input, includeTotal: false },
|
|
203
|
+
options
|
|
204
|
+
)
|
|
205
|
+
const result = await rerankObjectCandidates({
|
|
206
|
+
query: validated.query,
|
|
207
|
+
vector: reranking.input,
|
|
208
|
+
candidates: candidates.objects,
|
|
209
|
+
model,
|
|
210
|
+
signal: input.signal,
|
|
211
|
+
includeTotal: input.includeTotal,
|
|
212
|
+
})
|
|
213
|
+
return { ...result, plan }
|
|
214
|
+
}
|
|
215
|
+
|
|
181
216
|
if (plan.mode === "pushdown") {
|
|
182
217
|
if (!options.storage.queryObjects) {
|
|
183
218
|
throw new ObjectQueryPlanningError(plan.providerIssues)
|
|
@@ -386,6 +421,7 @@ export async function facetObjects(
|
|
|
386
421
|
const maxRows = options.maxFallbackRows ?? DEFAULT_MAX_FALLBACK_ROWS
|
|
387
422
|
const evaluation = await evaluateFallbackQuery(input.projectId, aggregateQuery, options, maxRows)
|
|
388
423
|
return {
|
|
424
|
+
total: evaluation.entries.length,
|
|
389
425
|
facets: buildFacetResults(
|
|
390
426
|
evaluation.entries.map((entry) => entry.row),
|
|
391
427
|
facets
|
|
@@ -432,7 +468,7 @@ function expandPushdownQuery(
|
|
|
432
468
|
// disagree) cleanly stays on the fallback.
|
|
433
469
|
const ctx: ExpansionResolutionContext = { ontology, maxExpansionFanout }
|
|
434
470
|
const annotated = resolveExpansions(query, ctx)
|
|
435
|
-
const expanded = expandIncludeSubtypes(annotated, ontology)
|
|
471
|
+
const expanded = usePrimaryIdLookups(expandIncludeSubtypes(annotated, ontology), ontology)
|
|
436
472
|
if (expanded === annotated) return annotated
|
|
437
473
|
|
|
438
474
|
const plan = planObjectQuery(expanded, { ...planning, capabilities, allowFallback: false })
|
|
@@ -465,6 +501,7 @@ function resolveExpansions(query: ObjectQuery, ctx: ExpansionResolutionContext):
|
|
|
465
501
|
case "filter":
|
|
466
502
|
case "text":
|
|
467
503
|
case "vector":
|
|
504
|
+
case "rerank":
|
|
468
505
|
case "traverse":
|
|
469
506
|
case "sort":
|
|
470
507
|
case "limit":
|
|
@@ -581,6 +618,7 @@ function expandIncludeSubtypes(query: ObjectQuery, ontology: OntologyRegistry):
|
|
|
581
618
|
case "filter":
|
|
582
619
|
case "text":
|
|
583
620
|
case "vector":
|
|
621
|
+
case "rerank":
|
|
584
622
|
case "traverse":
|
|
585
623
|
case "sort":
|
|
586
624
|
case "limit":
|
|
@@ -688,6 +726,7 @@ async function evaluateFallbackQuery(
|
|
|
688
726
|
}
|
|
689
727
|
case "text":
|
|
690
728
|
case "vector":
|
|
729
|
+
case "rerank":
|
|
691
730
|
case "traverse":
|
|
692
731
|
case "set":
|
|
693
732
|
throw new ObjectQueryExecutionError(
|
|
@@ -1186,6 +1225,7 @@ function stripOuterRowShape(query: ObjectQuery): ObjectQuery {
|
|
|
1186
1225
|
case "page":
|
|
1187
1226
|
case "project":
|
|
1188
1227
|
case "sort":
|
|
1228
|
+
case "rerank":
|
|
1189
1229
|
// `expand` is output-shaping: it attaches links but does not change which
|
|
1190
1230
|
// objects match, so aggregates (count/exists/facets) ignore it.
|
|
1191
1231
|
case "expand":
|
|
@@ -145,6 +145,14 @@ function buildExplainNode(query: ObjectQuery, path: string): ObjectQueryExplainN
|
|
|
145
145
|
},
|
|
146
146
|
children: [buildExplainNode(query.input, `${path}.input`)],
|
|
147
147
|
}
|
|
148
|
+
case "rerank":
|
|
149
|
+
return {
|
|
150
|
+
path,
|
|
151
|
+
kind: query.kind,
|
|
152
|
+
summary: `rerank ${query.model.provider}/${query.model.modelId}`,
|
|
153
|
+
details: { model: query.model },
|
|
154
|
+
children: [buildExplainNode(query.input, `${path}.input`)],
|
|
155
|
+
}
|
|
148
156
|
case "set":
|
|
149
157
|
return {
|
|
150
158
|
path,
|
package/src/objects/query/ir.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* storage backend. Providers can push down the subset they support, while the
|
|
6
6
|
* core planner decides whether a bounded fallback is acceptable.
|
|
7
7
|
*/
|
|
8
|
+
|
|
9
|
+
import type { ModelRef } from "../../models/catalog"
|
|
8
10
|
import type { ObjectRef } from "../../ontology/refs"
|
|
9
11
|
|
|
10
12
|
export type ObjectQueryDirection = "outgoing" | "incoming"
|
|
@@ -29,6 +31,7 @@ export type ObjectQuery =
|
|
|
29
31
|
| ObjectQueryFilter
|
|
30
32
|
| ObjectQueryText
|
|
31
33
|
| ObjectQueryVector
|
|
34
|
+
| ObjectQueryRerank
|
|
32
35
|
| ObjectQueryTraverse
|
|
33
36
|
| ObjectQuerySet
|
|
34
37
|
| ObjectQuerySort
|
|
@@ -102,6 +105,13 @@ export interface ObjectQueryTraverse {
|
|
|
102
105
|
sourceObjectTypeId?: string
|
|
103
106
|
}
|
|
104
107
|
|
|
108
|
+
/** Explicit server-side reordering of a bounded vector candidate set. */
|
|
109
|
+
export interface ObjectQueryRerank {
|
|
110
|
+
kind: "rerank"
|
|
111
|
+
input: ObjectQuery
|
|
112
|
+
model: ModelRef
|
|
113
|
+
}
|
|
114
|
+
|
|
105
115
|
export interface ObjectQuerySet {
|
|
106
116
|
kind: "set"
|
|
107
117
|
op: ObjectQuerySetOperation
|
|
@@ -46,6 +46,8 @@ function normalizeNode(query: ObjectQuery): ObjectQuery {
|
|
|
46
46
|
}
|
|
47
47
|
case "traverse":
|
|
48
48
|
return { ...query, input: normalizeObjectQuery(query.input) }
|
|
49
|
+
case "rerank":
|
|
50
|
+
return { ...query, model: { ...query.model }, input: normalizeObjectQuery(query.input) }
|
|
49
51
|
case "set":
|
|
50
52
|
return normalizeSet(query)
|
|
51
53
|
case "sort":
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ObjectQueryCapabilities, ObjectQueryScalarOperation } from "../../storage"
|
|
2
2
|
import type { ObjectQueryPlanningIssue } from "./errors"
|
|
3
3
|
import type { ObjectExpansion, ObjectQuery, ObjectQueryPredicate, ObjectQuerySortField } from "./ir"
|
|
4
|
+
import { findQueryReranking } from "./reranking-query"
|
|
4
5
|
|
|
5
|
-
export type ObjectQueryPlanMode = "pushdown" | "fallback" | "rejected"
|
|
6
|
+
export type ObjectQueryPlanMode = "pushdown" | "fallback" | "pipeline" | "rejected"
|
|
6
7
|
export type ObjectQueryProviderOperation =
|
|
7
8
|
| "queryObjects"
|
|
8
9
|
| "countObjects"
|
|
@@ -54,6 +55,15 @@ export function planObjectQuery(
|
|
|
54
55
|
options: ObjectQueryPlanningOptions
|
|
55
56
|
): ObjectQueryPlan {
|
|
56
57
|
const operation = options.operation ?? "queryObjects"
|
|
58
|
+
const reranking = findQueryReranking(query)
|
|
59
|
+
if (reranking) {
|
|
60
|
+
const candidatePlan = planObjectQuery(reranking.input, options)
|
|
61
|
+
return {
|
|
62
|
+
...candidatePlan,
|
|
63
|
+
query,
|
|
64
|
+
mode: candidatePlan.mode === "rejected" ? "rejected" : "pipeline",
|
|
65
|
+
}
|
|
66
|
+
}
|
|
57
67
|
// Providers get first refusal. Fallback is considered only after the provider
|
|
58
68
|
// declares that pushdown is unavailable or incomplete for this query.
|
|
59
69
|
const providerIssues = collectProviderIssues(query, options.capabilities, {
|
|
@@ -204,6 +214,7 @@ function collectNodeProviderIssues(
|
|
|
204
214
|
return
|
|
205
215
|
case "text":
|
|
206
216
|
case "vector":
|
|
217
|
+
case "rerank":
|
|
207
218
|
case "project":
|
|
208
219
|
collectNodeProviderIssues(query.input, `${path}.input`, capabilities, issues)
|
|
209
220
|
return
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { OntologyDefinitionCatalog } from "../../ontology/registry"
|
|
2
|
+
import type { ObjectQuery, ObjectQueryPredicate } from "./ir"
|
|
3
|
+
|
|
4
|
+
/** Exact identity predicates can start from primary-key lookups. Keep the original filter:
|
|
5
|
+
* the optimization must not remove other conditions or expose a projected-out property.
|
|
6
|
+
* Only a direct start is rewritten; filters after bounds/projections keep their semantics. */
|
|
7
|
+
export function usePrimaryIdLookups(
|
|
8
|
+
query: ObjectQuery,
|
|
9
|
+
ontology: OntologyDefinitionCatalog
|
|
10
|
+
): ObjectQuery {
|
|
11
|
+
if (query.kind === "set")
|
|
12
|
+
return { ...query, inputs: query.inputs.map((input) => usePrimaryIdLookups(input, ontology)) }
|
|
13
|
+
if (!("input" in query)) return query
|
|
14
|
+
const input = usePrimaryIdLookups(query.input, ontology)
|
|
15
|
+
if (query.kind === "filter" && input.kind === "start" && !input.includeSubtypes) {
|
|
16
|
+
const propertyId = ontology.getPrimaryPropertyId(input.objectTypeId)
|
|
17
|
+
const ids = primaryIds(query.predicate, propertyId)
|
|
18
|
+
if (ids?.length && ids.length <= 1000)
|
|
19
|
+
return {
|
|
20
|
+
...query,
|
|
21
|
+
input: {
|
|
22
|
+
kind: "refs",
|
|
23
|
+
refs: [...new Set(ids)]
|
|
24
|
+
.sort()
|
|
25
|
+
.map((primaryId) => ({ objectTypeId: input.objectTypeId, primaryId })),
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return input === query.input ? query : { ...query, input }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function primaryIds(
|
|
33
|
+
predicate: ObjectQueryPredicate,
|
|
34
|
+
propertyId: string
|
|
35
|
+
): readonly string[] | undefined {
|
|
36
|
+
if (predicate.op === "and") {
|
|
37
|
+
for (const item of predicate.items) {
|
|
38
|
+
const ids = primaryIds(item, propertyId)
|
|
39
|
+
if (ids) return ids
|
|
40
|
+
}
|
|
41
|
+
return undefined
|
|
42
|
+
}
|
|
43
|
+
if (
|
|
44
|
+
predicate.op === "eq" &&
|
|
45
|
+
predicate.propertyId === propertyId &&
|
|
46
|
+
typeof predicate.value === "string"
|
|
47
|
+
)
|
|
48
|
+
return [predicate.value]
|
|
49
|
+
if (
|
|
50
|
+
predicate.op === "in" &&
|
|
51
|
+
predicate.propertyId === propertyId &&
|
|
52
|
+
predicate.values.every((value) => typeof value === "string")
|
|
53
|
+
)
|
|
54
|
+
return predicate.values as readonly string[]
|
|
55
|
+
return undefined
|
|
56
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { RerankingModel } from "../../models/reranking-model"
|
|
2
|
+
import { validateRerankingResults } from "../../models/reranking-model"
|
|
3
|
+
import type { ObjectRow, QueryObjectsResult } from "../../storage"
|
|
4
|
+
import { vectorSources } from "../vectors/profile"
|
|
5
|
+
import { ObjectQueryExecutionError } from "./errors"
|
|
6
|
+
import type { ObjectQuery, ObjectQueryVector } from "./ir"
|
|
7
|
+
import { MAX_RERANK_INPUT_BYTES } from "./reranking-limits"
|
|
8
|
+
|
|
9
|
+
/** Receives only rows from the authorized reader; never rereads unmasked storage. */
|
|
10
|
+
export async function rerankObjectCandidates(input: {
|
|
11
|
+
readonly query: ObjectQuery
|
|
12
|
+
readonly vector: ObjectQueryVector
|
|
13
|
+
readonly candidates: readonly ObjectRow[]
|
|
14
|
+
readonly model: RerankingModel
|
|
15
|
+
readonly signal?: AbortSignal
|
|
16
|
+
readonly includeTotal?: boolean
|
|
17
|
+
}): Promise<QueryObjectsResult> {
|
|
18
|
+
const { vector, candidates, model, signal } = input
|
|
19
|
+
if (typeof vector.vector !== "string" || !vector.source) {
|
|
20
|
+
throw new ObjectQueryExecutionError(
|
|
21
|
+
"invalid_rerank_input",
|
|
22
|
+
"Reranking requires a validated text vector query."
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
signal?.throwIfAborted()
|
|
26
|
+
if (candidates.length > vector.k) {
|
|
27
|
+
throw new ObjectQueryExecutionError(
|
|
28
|
+
"rerank_candidate_limit_exceeded",
|
|
29
|
+
"Storage exceeded the admitted vector candidate bound."
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
const source = vector.source
|
|
33
|
+
const documents = candidates.map((row) => vectorSources(source, row.properties).text)
|
|
34
|
+
const encoder = new TextEncoder()
|
|
35
|
+
const bytes =
|
|
36
|
+
encoder.encode(vector.vector).byteLength +
|
|
37
|
+
documents.reduce((sum, text) => sum + encoder.encode(text).byteLength, 0)
|
|
38
|
+
if (bytes > MAX_RERANK_INPUT_BYTES) {
|
|
39
|
+
throw new ObjectQueryExecutionError(
|
|
40
|
+
"rerank_input_limit_exceeded",
|
|
41
|
+
"Reranking input exceeds 1 MiB. Use fewer candidates or shorter profile sources."
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const results =
|
|
46
|
+
documents.length === 0
|
|
47
|
+
? []
|
|
48
|
+
: (await model.rerank({ query: vector.vector, documents, signal })).results
|
|
49
|
+
signal?.throwIfAborted()
|
|
50
|
+
const ranking = validateRerankingResults(results, candidates.length)
|
|
51
|
+
const rows = ranking.map(({ index, score }) => ({ ...candidates[index]!, score }))
|
|
52
|
+
const shaped = shapeRerankedRows(input.query, rows)
|
|
53
|
+
return {
|
|
54
|
+
objects: shaped.rows,
|
|
55
|
+
hasMore: shaped.hasMore,
|
|
56
|
+
...(input.includeTotal === false ? {} : { total: shaped.total }),
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function shapeRerankedRows(
|
|
61
|
+
query: ObjectQuery,
|
|
62
|
+
rows: readonly ObjectRow[]
|
|
63
|
+
): { rows: readonly ObjectRow[]; total: number; hasMore: boolean } {
|
|
64
|
+
if (query.kind === "rerank") return { rows, total: rows.length, hasMore: false }
|
|
65
|
+
if (query.kind === "limit") {
|
|
66
|
+
const input = shapeRerankedRows(query.input, rows)
|
|
67
|
+
return {
|
|
68
|
+
rows: input.rows.slice(0, query.limit),
|
|
69
|
+
total: input.total,
|
|
70
|
+
hasMore: input.hasMore || query.limit < input.rows.length,
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (query.kind === "project") {
|
|
74
|
+
const input = shapeRerankedRows(query.input, rows)
|
|
75
|
+
if (!query.properties) return input
|
|
76
|
+
const properties = new Set(query.properties)
|
|
77
|
+
return {
|
|
78
|
+
...input,
|
|
79
|
+
rows: input.rows.map((row) => ({
|
|
80
|
+
...row,
|
|
81
|
+
properties: Object.fromEntries(
|
|
82
|
+
Object.entries(row.properties).filter(([key]) => properties.has(key))
|
|
83
|
+
),
|
|
84
|
+
})),
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
throw new ObjectQueryExecutionError(
|
|
88
|
+
"invalid_rerank_composition",
|
|
89
|
+
"Only limit and project may follow reranking."
|
|
90
|
+
)
|
|
91
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ObjectQuery, ObjectQueryRerank } from "./ir"
|
|
2
|
+
|
|
3
|
+
/** Validation permits output shaping only after the explicit reranking stage. */
|
|
4
|
+
export function findQueryReranking(query: ObjectQuery): ObjectQueryRerank | undefined {
|
|
5
|
+
if (query.kind === "rerank") return query
|
|
6
|
+
if (query.kind === "limit" || query.kind === "project") return findQueryReranking(query.input)
|
|
7
|
+
return undefined
|
|
8
|
+
}
|
|
@@ -31,6 +31,7 @@ import type {
|
|
|
31
31
|
QueryScalarKind,
|
|
32
32
|
} from "./ir"
|
|
33
33
|
import { normalizeObjectQuery } from "./normalize"
|
|
34
|
+
import { MAX_RERANK_CANDIDATES } from "./reranking-limits"
|
|
34
35
|
|
|
35
36
|
export interface ObjectQueryValidationIssue {
|
|
36
37
|
path: string
|
|
@@ -223,7 +224,7 @@ function validateVectorComposition(query: ObjectQuery, ctx: QueryValidationConte
|
|
|
223
224
|
path: "$",
|
|
224
225
|
code: "vector.composition",
|
|
225
226
|
message:
|
|
226
|
-
"Vector profiles support one top-k over one concrete type, with filters, traversals or sets before ranking
|
|
227
|
+
"Vector profiles support one top-k over one concrete type, with filters, traversals or sets before ranking, optional reranking, then limit/project.",
|
|
227
228
|
})
|
|
228
229
|
}
|
|
229
230
|
|
|
@@ -373,6 +374,37 @@ function dispatchQueryNode(
|
|
|
373
374
|
),
|
|
374
375
|
}
|
|
375
376
|
}
|
|
377
|
+
case "rerank": {
|
|
378
|
+
const input = validateQueryNode(query.input, `${path}.input`, ctx)
|
|
379
|
+
if (
|
|
380
|
+
input.query.kind !== "vector" ||
|
|
381
|
+
typeof input.query.vector !== "string" ||
|
|
382
|
+
input.query.k > MAX_RERANK_CANDIDATES
|
|
383
|
+
) {
|
|
384
|
+
addIssue(
|
|
385
|
+
ctx,
|
|
386
|
+
path,
|
|
387
|
+
"invalid_rerank_input",
|
|
388
|
+
`Reranking requires a text vector query with k at most ${MAX_RERANK_CANDIDATES}, before limit or project.`
|
|
389
|
+
)
|
|
390
|
+
}
|
|
391
|
+
if (
|
|
392
|
+
typeof query.model?.provider !== "string" ||
|
|
393
|
+
!query.model.provider.trim() ||
|
|
394
|
+
query.model.provider.trim() !== query.model.provider ||
|
|
395
|
+
typeof query.model.modelId !== "string" ||
|
|
396
|
+
!query.model.modelId.trim() ||
|
|
397
|
+
query.model.modelId.trim() !== query.model.modelId
|
|
398
|
+
) {
|
|
399
|
+
addIssue(
|
|
400
|
+
ctx,
|
|
401
|
+
path,
|
|
402
|
+
"invalid_rerank_model",
|
|
403
|
+
"Reranking requires an explicit provider and model ID."
|
|
404
|
+
)
|
|
405
|
+
}
|
|
406
|
+
return { ...input, query: { ...query, model: { ...query.model }, input: input.query } }
|
|
407
|
+
}
|
|
376
408
|
case "set":
|
|
377
409
|
return validateSet(query.inputs, query.op, path, ctx)
|
|
378
410
|
case "sort": {
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* `ObjectQueryExecutor` — the server runtime executor or the HTTP client
|
|
7
7
|
* executor — so the same builder serves both sides.
|
|
8
8
|
*/
|
|
9
|
+
|
|
10
|
+
import type { RerankingModelRef } from "../../models/reranking-model"
|
|
9
11
|
import { OntologyValidationError } from "../../ontology/errors"
|
|
10
12
|
import type { LinkToken, ObjectTypeWithPropertyTokens, PropertyToken } from "../../ontology/tokens"
|
|
11
13
|
import { RuntimeError } from "../../runtime/errors"
|
|
@@ -16,7 +18,7 @@ import type {
|
|
|
16
18
|
ObjectExpandOptions,
|
|
17
19
|
ObjectQueryBuilder,
|
|
18
20
|
ObjectQueryFacetInput,
|
|
19
|
-
|
|
21
|
+
ObjectQueryFacetsResult,
|
|
20
22
|
ObjectQueryListOptions,
|
|
21
23
|
ObjectWhereBuilder,
|
|
22
24
|
ObjectWhereClause,
|
|
@@ -118,6 +120,17 @@ class ObjectQueryBuilderImpl<TObjectType extends ObjectTypeWithPropertyTokens> {
|
|
|
118
120
|
})
|
|
119
121
|
}
|
|
120
122
|
|
|
123
|
+
rerank(options: { model: RerankingModelRef }): ObjectQueryBuilder<TObjectType> {
|
|
124
|
+
if (options.model?.definition?.kind !== "reranking") {
|
|
125
|
+
throw new TypeError("[Sixb] rerank() requires an explicit reranking model.")
|
|
126
|
+
}
|
|
127
|
+
return this.withQuery({
|
|
128
|
+
kind: "rerank",
|
|
129
|
+
input: this.ir,
|
|
130
|
+
model: { provider: options.model.providerId, modelId: options.model.modelId },
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
|
|
121
134
|
traverse(
|
|
122
135
|
link: LinkToken<TObjectType["id"], string, string>,
|
|
123
136
|
options?: { direction?: "outgoing" }
|
|
@@ -269,7 +282,7 @@ class ObjectQueryBuilderImpl<TObjectType extends ObjectTypeWithPropertyTokens> {
|
|
|
269
282
|
|
|
270
283
|
async facets(
|
|
271
284
|
input: readonly ObjectQueryFacetInput<TObjectType>[]
|
|
272
|
-
): Promise<
|
|
285
|
+
): Promise<ObjectQueryFacetsResult> {
|
|
273
286
|
return this.params.executor.facets(
|
|
274
287
|
this.ir,
|
|
275
288
|
input.map((facet) => ({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* runtime implements this against storage, and `@sixb/client` implements it
|
|
6
6
|
* against the HTTP query routes, so both share one builder.
|
|
7
7
|
*/
|
|
8
|
-
import type {
|
|
8
|
+
import type { ObjectQueryFacetsResult } from "../../runtime/types"
|
|
9
9
|
import type { ObjectQueryExplanation } from "../query/explain"
|
|
10
10
|
import type { ObjectQuery } from "../query/ir"
|
|
11
11
|
import type { ValidatedObjectQuery } from "../query/validate"
|
|
@@ -55,7 +55,7 @@ export interface ObjectQueryExecutor {
|
|
|
55
55
|
facets(
|
|
56
56
|
query: ObjectQuery,
|
|
57
57
|
facets: readonly ObjectQueryExecutorFacetRequest[]
|
|
58
|
-
): Promise<
|
|
58
|
+
): Promise<ObjectQueryFacetsResult>
|
|
59
59
|
/** Validation requires ontology access and is unavailable on remote executors. */
|
|
60
60
|
validate?(query: ObjectQuery): ValidatedObjectQuery
|
|
61
61
|
/** Explanation requires ontology access and is unavailable on remote executors. */
|
|
@@ -46,10 +46,13 @@ export function createRuntimeQueryExecutor(params: {
|
|
|
46
46
|
|
|
47
47
|
async facets(query: ObjectQuery, facets: readonly ObjectQueryExecutorFacetRequest[]) {
|
|
48
48
|
const result = await objectReader.facet({ query, facets })
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
return {
|
|
50
|
+
total: result.total,
|
|
51
|
+
facets: result.facets.map((facet) => ({
|
|
52
|
+
propertyId: facet.propertyId,
|
|
53
|
+
buckets: [...facet.buckets],
|
|
54
|
+
})),
|
|
55
|
+
}
|
|
53
56
|
},
|
|
54
57
|
|
|
55
58
|
validate(query: ObjectQuery) {
|
|
@@ -12,7 +12,8 @@ eligible set after link and property authorization; it never filters a global to
|
|
|
12
12
|
|
|
13
13
|
```text
|
|
14
14
|
Effective object change → invalidate stale vector + persist latest intent (one transaction)
|
|
15
|
-
|
|
15
|
+
Commit wake-up (or API maintenance pass) → durable queue
|
|
16
|
+
ProjectionWorker → project AI admission → provider → save result → fenced commit
|
|
16
17
|
```
|
|
17
18
|
|
|
18
19
|
`materializer/effective/vector-indexing.ts` compares effective source fingerprints after projection
|
|
@@ -22,7 +23,10 @@ There is no historical scan or configuration-only backfill.
|
|
|
22
23
|
|
|
23
24
|
The queue owns delivery leases. Ontology storage owns intent keyed by project/object/profile, plus
|
|
24
25
|
its generation id and `pending → running → ready` state. Dispatch has a separate due time so long
|
|
25
|
-
queues cannot starve later entries.
|
|
26
|
+
queues cannot starve later entries. `indexing-dispatch.ts` enqueues due intent after every commit
|
|
27
|
+
in the committing process and pushes its due time 30 seconds out; the API's maintenance pass
|
|
28
|
+
drains the same path, so intent a crash left undispatched waits at most one pass. Enqueueing the
|
|
29
|
+
same generation twice is safe.
|
|
26
30
|
|
|
27
31
|
`indexing.ts` exposes only a core-owned processing capability. Kernel authority cannot bind the
|
|
28
32
|
public domain SDK. `ontology.indexVectors` authorizes only the persisted results of its work item or durable group.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { Queues } from "../../queues"
|
|
2
|
+
import type { OntologyVectorIndexingStorage } from "../../storage/ontology/vector-indexing"
|
|
3
|
+
|
|
4
|
+
const PAGE_SIZE = 100
|
|
5
|
+
/** A dispatched request becomes due again only if its job has not completed it by then. */
|
|
6
|
+
const REDISPATCH_DELAY_MS = 30_000
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Hands durable indexing intent to the vector queue. Each commit wakes it in the committing
|
|
10
|
+
* process; ontology maintenance drains it as the repair path for a wake-up that never finished.
|
|
11
|
+
*/
|
|
12
|
+
export class VectorIndexingDispatcher {
|
|
13
|
+
private running: Promise<void> | null = null
|
|
14
|
+
private next: Promise<void> | null = null
|
|
15
|
+
private stopped = false
|
|
16
|
+
|
|
17
|
+
constructor(
|
|
18
|
+
private readonly projectId: string,
|
|
19
|
+
private readonly indexing: OntologyVectorIndexingStorage,
|
|
20
|
+
private readonly queue: Queues["vectorIndexing"]
|
|
21
|
+
) {}
|
|
22
|
+
|
|
23
|
+
notify(): void {
|
|
24
|
+
this.drain().catch((error) =>
|
|
25
|
+
console.error("[Sixb] Could not dispatch vector indexing; maintenance will retry:", error)
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Callers share one pass plus at most one follow-up, which sees every earlier commit. */
|
|
30
|
+
drain(): Promise<void> {
|
|
31
|
+
this.next ??= settled(this.running).then(() => {
|
|
32
|
+
this.next = null
|
|
33
|
+
if (this.stopped) return
|
|
34
|
+
this.running = this.pass().finally(() => {
|
|
35
|
+
this.running = null
|
|
36
|
+
})
|
|
37
|
+
return this.running
|
|
38
|
+
})
|
|
39
|
+
return this.next
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async stop(): Promise<void> {
|
|
43
|
+
this.stopped = true
|
|
44
|
+
await settled(this.next)
|
|
45
|
+
await settled(this.running)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private async pass(): Promise<void> {
|
|
49
|
+
for (;;) {
|
|
50
|
+
const now = new Date()
|
|
51
|
+
const work = await this.indexing.listDue({
|
|
52
|
+
projectId: this.projectId,
|
|
53
|
+
now: now.toISOString(),
|
|
54
|
+
limit: PAGE_SIZE,
|
|
55
|
+
})
|
|
56
|
+
if (work.length) {
|
|
57
|
+
const jobs = [...new Map(work.map((item) => [item.batchId ?? item.id, item])).entries()]
|
|
58
|
+
await this.queue.enqueue({
|
|
59
|
+
projectId: this.projectId,
|
|
60
|
+
jobs: jobs.map(([id, item]) => ({
|
|
61
|
+
id,
|
|
62
|
+
type: "vector.index.requested",
|
|
63
|
+
payload: { indexingId: id },
|
|
64
|
+
availableAt: item.availableAt,
|
|
65
|
+
})),
|
|
66
|
+
})
|
|
67
|
+
await this.indexing.dispatched({
|
|
68
|
+
projectId: this.projectId,
|
|
69
|
+
ids: work.map((item) => item.id),
|
|
70
|
+
nextDispatchAt: new Date(now.getTime() + REDISPATCH_DELAY_MS).toISOString(),
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
if (work.length < PAGE_SIZE || this.stopped) return
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function settled(promise: Promise<void> | null): Promise<void> {
|
|
79
|
+
return (promise ?? Promise.resolve()).then(
|
|
80
|
+
() => undefined,
|
|
81
|
+
() => undefined
|
|
82
|
+
)
|
|
83
|
+
}
|
|
@@ -9,6 +9,9 @@ export function hasVectorProfile(query: ObjectQuery): boolean {
|
|
|
9
9
|
/** Rank one eligible object set; validation resolves its type and admits every traversed edge. */
|
|
10
10
|
export function isVectorProfileQuery(query: ObjectQuery): boolean {
|
|
11
11
|
if (query.kind === "limit" || query.kind === "project") return isVectorProfileQuery(query.input)
|
|
12
|
+
if (query.kind === "rerank") {
|
|
13
|
+
return query.input.kind === "vector" && isVectorProfileQuery(query.input)
|
|
14
|
+
}
|
|
12
15
|
if (query.kind !== "vector" || !query.profile) return false
|
|
13
16
|
return isVectorCandidateQuery(query.input)
|
|
14
17
|
}
|
package/src/ontology/builders.ts
CHANGED
package/src/ontology/index.ts
CHANGED