@massa-ai/core 1.2.1
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/controllers/context-controller.d.ts +52 -0
- package/dist/controllers/context-controller.d.ts.map +1 -0
- package/dist/controllers/context-controller.js +377 -0
- package/dist/controllers/context-controller.js.map +1 -0
- package/dist/controllers/executor-controller.d.ts +42 -0
- package/dist/controllers/executor-controller.d.ts.map +1 -0
- package/dist/controllers/executor-controller.js +229 -0
- package/dist/controllers/executor-controller.js.map +1 -0
- package/dist/controllers/graph-controller.d.ts +106 -0
- package/dist/controllers/graph-controller.d.ts.map +1 -0
- package/dist/controllers/graph-controller.js +142 -0
- package/dist/controllers/graph-controller.js.map +1 -0
- package/dist/controllers/index.d.ts +17 -0
- package/dist/controllers/index.d.ts.map +1 -0
- package/dist/controllers/index.js +12 -0
- package/dist/controllers/index.js.map +1 -0
- package/dist/controllers/memory-controller.d.ts +78 -0
- package/dist/controllers/memory-controller.d.ts.map +1 -0
- package/dist/controllers/memory-controller.js +232 -0
- package/dist/controllers/memory-controller.js.map +1 -0
- package/dist/controllers/search-controller.d.ts +113 -0
- package/dist/controllers/search-controller.d.ts.map +1 -0
- package/dist/controllers/search-controller.js +314 -0
- package/dist/controllers/search-controller.js.map +1 -0
- package/dist/data/audit/operation-log-contract.d.ts +68 -0
- package/dist/data/audit/operation-log-contract.d.ts.map +1 -0
- package/dist/data/audit/operation-log-contract.js +16 -0
- package/dist/data/audit/operation-log-contract.js.map +1 -0
- package/dist/data/audit/operation-log-factory.d.ts +4 -0
- package/dist/data/audit/operation-log-factory.d.ts.map +1 -0
- package/dist/data/audit/operation-log-factory.js +8 -0
- package/dist/data/audit/operation-log-factory.js.map +1 -0
- package/dist/data/audit/operation-log-pg.d.ts +34 -0
- package/dist/data/audit/operation-log-pg.d.ts.map +1 -0
- package/dist/data/audit/operation-log-pg.js +125 -0
- package/dist/data/audit/operation-log-pg.js.map +1 -0
- package/dist/data/db-connection.d.ts +10 -0
- package/dist/data/db-connection.d.ts.map +1 -0
- package/dist/data/db-connection.js +33 -0
- package/dist/data/db-connection.js.map +1 -0
- package/dist/data/graph-generation/graph-generation-contract.d.ts +94 -0
- package/dist/data/graph-generation/graph-generation-contract.d.ts.map +1 -0
- package/dist/data/graph-generation/graph-generation-contract.js +2 -0
- package/dist/data/graph-generation/graph-generation-contract.js.map +1 -0
- package/dist/data/graph-generation/graph-generation-repository-factory.d.ts +3 -0
- package/dist/data/graph-generation/graph-generation-repository-factory.d.ts.map +1 -0
- package/dist/data/graph-generation/graph-generation-repository-factory.js +7 -0
- package/dist/data/graph-generation/graph-generation-repository-factory.js.map +1 -0
- package/dist/data/graph-generation/graph-generation-repository-pg.d.ts +12 -0
- package/dist/data/graph-generation/graph-generation-repository-pg.d.ts.map +1 -0
- package/dist/data/graph-generation/graph-generation-repository-pg.js +335 -0
- package/dist/data/graph-generation/graph-generation-repository-pg.js.map +1 -0
- package/dist/data/graph-generation/index.d.ts +4 -0
- package/dist/data/graph-generation/index.d.ts.map +1 -0
- package/dist/data/graph-generation/index.js +3 -0
- package/dist/data/graph-generation/index.js.map +1 -0
- package/dist/data/handoff/handoff-contract.d.ts +32 -0
- package/dist/data/handoff/handoff-contract.d.ts.map +1 -0
- package/dist/data/handoff/handoff-contract.js +12 -0
- package/dist/data/handoff/handoff-contract.js.map +1 -0
- package/dist/data/handoff/handoff-repository-pg.d.ts +22 -0
- package/dist/data/handoff/handoff-repository-pg.d.ts.map +1 -0
- package/dist/data/handoff/handoff-repository-pg.js +177 -0
- package/dist/data/handoff/handoff-repository-pg.js.map +1 -0
- package/dist/data/handoff/handoff-repository.d.ts +7 -0
- package/dist/data/handoff/handoff-repository.d.ts.map +1 -0
- package/dist/data/handoff/handoff-repository.js +9 -0
- package/dist/data/handoff/handoff-repository.js.map +1 -0
- package/dist/data/keyword/keyword-search-factory.d.ts +9 -0
- package/dist/data/keyword/keyword-search-factory.d.ts.map +1 -0
- package/dist/data/keyword/keyword-search-factory.js +23 -0
- package/dist/data/keyword/keyword-search-factory.js.map +1 -0
- package/dist/data/keyword/keyword-search-pg.d.ts +52 -0
- package/dist/data/keyword/keyword-search-pg.d.ts.map +1 -0
- package/dist/data/keyword/keyword-search-pg.js +423 -0
- package/dist/data/keyword/keyword-search-pg.js.map +1 -0
- package/dist/data/managed-runs/managed-run-contract.d.ts +193 -0
- package/dist/data/managed-runs/managed-run-contract.d.ts.map +1 -0
- package/dist/data/managed-runs/managed-run-contract.js +41 -0
- package/dist/data/managed-runs/managed-run-contract.js.map +1 -0
- package/dist/data/managed-runs/managed-run-repository-pg.d.ts +48 -0
- package/dist/data/managed-runs/managed-run-repository-pg.d.ts.map +1 -0
- package/dist/data/managed-runs/managed-run-repository-pg.js +316 -0
- package/dist/data/managed-runs/managed-run-repository-pg.js.map +1 -0
- package/dist/data/memory/index.d.ts +6 -0
- package/dist/data/memory/index.d.ts.map +1 -0
- package/dist/data/memory/index.js +5 -0
- package/dist/data/memory/index.js.map +1 -0
- package/dist/data/memory/memory-repository-contract.d.ts +54 -0
- package/dist/data/memory/memory-repository-contract.d.ts.map +1 -0
- package/dist/data/memory/memory-repository-contract.js +2 -0
- package/dist/data/memory/memory-repository-contract.js.map +1 -0
- package/dist/data/memory/memory-repository-factory.d.ts +4 -0
- package/dist/data/memory/memory-repository-factory.d.ts.map +1 -0
- package/dist/data/memory/memory-repository-factory.js +8 -0
- package/dist/data/memory/memory-repository-factory.js.map +1 -0
- package/dist/data/memory/memory-repository-pg.d.ts +111 -0
- package/dist/data/memory/memory-repository-pg.d.ts.map +1 -0
- package/dist/data/memory/memory-repository-pg.js +448 -0
- package/dist/data/memory/memory-repository-pg.js.map +1 -0
- package/dist/data/memory/memory-repository.d.ts +3 -0
- package/dist/data/memory/memory-repository.d.ts.map +1 -0
- package/dist/data/memory/memory-repository.js +2 -0
- package/dist/data/memory/memory-repository.js.map +1 -0
- package/dist/data/memory/observation-contract.d.ts +47 -0
- package/dist/data/memory/observation-contract.d.ts.map +1 -0
- package/dist/data/memory/observation-contract.js +13 -0
- package/dist/data/memory/observation-contract.js.map +1 -0
- package/dist/data/memory/observation-repository-pg.d.ts +64 -0
- package/dist/data/memory/observation-repository-pg.d.ts.map +1 -0
- package/dist/data/memory/observation-repository-pg.js +244 -0
- package/dist/data/memory/observation-repository-pg.js.map +1 -0
- package/dist/data/memory/observation-repository.d.ts +6 -0
- package/dist/data/memory/observation-repository.d.ts.map +1 -0
- package/dist/data/memory/observation-repository.js +8 -0
- package/dist/data/memory/observation-repository.js.map +1 -0
- package/dist/data/proposal/proposal-contract.d.ts +47 -0
- package/dist/data/proposal/proposal-contract.d.ts.map +1 -0
- package/dist/data/proposal/proposal-contract.js +32 -0
- package/dist/data/proposal/proposal-contract.js.map +1 -0
- package/dist/data/proposal/proposal-repository-pg.d.ts +20 -0
- package/dist/data/proposal/proposal-repository-pg.d.ts.map +1 -0
- package/dist/data/proposal/proposal-repository-pg.js +199 -0
- package/dist/data/proposal/proposal-repository-pg.js.map +1 -0
- package/dist/data/proposal/proposal-repository.d.ts +7 -0
- package/dist/data/proposal/proposal-repository.d.ts.map +1 -0
- package/dist/data/proposal/proposal-repository.js +9 -0
- package/dist/data/proposal/proposal-repository.js.map +1 -0
- package/dist/data/symbol/symbol-repo-generation.d.ts +61 -0
- package/dist/data/symbol/symbol-repo-generation.d.ts.map +1 -0
- package/dist/data/symbol/symbol-repo-generation.js +380 -0
- package/dist/data/symbol/symbol-repo-generation.js.map +1 -0
- package/dist/data/symbol/symbol-repo-graph.d.ts +65 -0
- package/dist/data/symbol/symbol-repo-graph.d.ts.map +1 -0
- package/dist/data/symbol/symbol-repo-graph.js +457 -0
- package/dist/data/symbol/symbol-repo-graph.js.map +1 -0
- package/dist/data/symbol/symbol-repo-identity.d.ts +21 -0
- package/dist/data/symbol/symbol-repo-identity.d.ts.map +1 -0
- package/dist/data/symbol/symbol-repo-identity.js +96 -0
- package/dist/data/symbol/symbol-repo-identity.js.map +1 -0
- package/dist/data/symbol/symbol-repo-mappers.d.ts +87 -0
- package/dist/data/symbol/symbol-repo-mappers.d.ts.map +1 -0
- package/dist/data/symbol/symbol-repo-mappers.js +91 -0
- package/dist/data/symbol/symbol-repo-mappers.js.map +1 -0
- package/dist/data/symbol/symbol-repo-queries.d.ts +54 -0
- package/dist/data/symbol/symbol-repo-queries.d.ts.map +1 -0
- package/dist/data/symbol/symbol-repo-queries.js +331 -0
- package/dist/data/symbol/symbol-repo-queries.js.map +1 -0
- package/dist/data/symbol/symbol-repo-types.d.ts +243 -0
- package/dist/data/symbol/symbol-repo-types.d.ts.map +1 -0
- package/dist/data/symbol/symbol-repo-types.js +8 -0
- package/dist/data/symbol/symbol-repo-types.js.map +1 -0
- package/dist/data/symbol/symbol-repo-workspace.d.ts +20 -0
- package/dist/data/symbol/symbol-repo-workspace.d.ts.map +1 -0
- package/dist/data/symbol/symbol-repo-workspace.js +148 -0
- package/dist/data/symbol/symbol-repo-workspace.js.map +1 -0
- package/dist/data/symbol/symbol-repository-factory.d.ts +10 -0
- package/dist/data/symbol/symbol-repository-factory.d.ts.map +1 -0
- package/dist/data/symbol/symbol-repository-factory.js +16 -0
- package/dist/data/symbol/symbol-repository-factory.js.map +1 -0
- package/dist/data/symbol/symbol-repository-pg.d.ts +84 -0
- package/dist/data/symbol/symbol-repository-pg.d.ts.map +1 -0
- package/dist/data/symbol/symbol-repository-pg.js +81 -0
- package/dist/data/symbol/symbol-repository-pg.js.map +1 -0
- package/dist/data/vector/base-vector-store.d.ts +137 -0
- package/dist/data/vector/base-vector-store.d.ts.map +1 -0
- package/dist/data/vector/base-vector-store.js +166 -0
- package/dist/data/vector/base-vector-store.js.map +1 -0
- package/dist/data/vector/hybrid-search.d.ts +64 -0
- package/dist/data/vector/hybrid-search.d.ts.map +1 -0
- package/dist/data/vector/hybrid-search.js +238 -0
- package/dist/data/vector/hybrid-search.js.map +1 -0
- package/dist/data/vector/index.d.ts +9 -0
- package/dist/data/vector/index.d.ts.map +1 -0
- package/dist/data/vector/index.js +7 -0
- package/dist/data/vector/index.js.map +1 -0
- package/dist/data/vector/postgres-vector-store.d.ts +118 -0
- package/dist/data/vector/postgres-vector-store.d.ts.map +1 -0
- package/dist/data/vector/postgres-vector-store.js +703 -0
- package/dist/data/vector/postgres-vector-store.js.map +1 -0
- package/dist/data/vector/vector-store-factory.d.ts +9 -0
- package/dist/data/vector/vector-store-factory.d.ts.map +1 -0
- package/dist/data/vector/vector-store-factory.js +46 -0
- package/dist/data/vector/vector-store-factory.js.map +1 -0
- package/dist/generated/prisma/client.d.ts +1 -0
- package/dist/generated/prisma/client.js +5 -0
- package/dist/generated/prisma/default.d.ts +1 -0
- package/dist/generated/prisma/default.js +5 -0
- package/dist/generated/prisma/edge.d.ts +1 -0
- package/dist/generated/prisma/edge.js +601 -0
- package/dist/generated/prisma/index-browser.js +627 -0
- package/dist/generated/prisma/index.d.ts +52672 -0
- package/dist/generated/prisma/index.js +601 -0
- package/dist/generated/prisma/package.json +144 -0
- package/dist/generated/prisma/query_compiler_fast_bg.js +2 -0
- package/dist/generated/prisma/query_compiler_fast_bg.wasm +0 -0
- package/dist/generated/prisma/query_compiler_fast_bg.wasm-base64.js +2 -0
- package/dist/generated/prisma/runtime/client.d.ts +3386 -0
- package/dist/generated/prisma/runtime/client.js +86 -0
- package/dist/generated/prisma/runtime/index-browser.d.ts +90 -0
- package/dist/generated/prisma/runtime/index-browser.js +6 -0
- package/dist/generated/prisma/runtime/wasm-compiler-edge.js +76 -0
- package/dist/generated/prisma/schema.prisma +746 -0
- package/dist/generated/prisma/wasm-edge-light-loader.mjs +5 -0
- package/dist/generated/prisma/wasm-worker-loader.mjs +5 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/models/CacheEntry.d.ts +66 -0
- package/dist/models/CacheEntry.d.ts.map +1 -0
- package/dist/models/CacheEntry.js +148 -0
- package/dist/models/CacheEntry.js.map +1 -0
- package/dist/models/CompressedContent.d.ts +59 -0
- package/dist/models/CompressedContent.d.ts.map +1 -0
- package/dist/models/CompressedContent.js +169 -0
- package/dist/models/CompressedContent.js.map +1 -0
- package/dist/models/Memory.d.ts +9 -0
- package/dist/models/Memory.d.ts.map +1 -0
- package/dist/models/Memory.js +10 -0
- package/dist/models/Memory.js.map +1 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +6 -0
- package/dist/models/index.js.map +1 -0
- package/dist/scripts/beir-benchmark.d.ts +3 -0
- package/dist/scripts/beir-benchmark.d.ts.map +1 -0
- package/dist/scripts/beir-benchmark.js +275 -0
- package/dist/scripts/beir-benchmark.js.map +1 -0
- package/dist/scripts/create-sicad-beir-fixture.d.ts +3 -0
- package/dist/scripts/create-sicad-beir-fixture.d.ts.map +1 -0
- package/dist/scripts/create-sicad-beir-fixture.js +200 -0
- package/dist/scripts/create-sicad-beir-fixture.js.map +1 -0
- package/dist/scripts/symbol-benchmark.d.ts +24 -0
- package/dist/scripts/symbol-benchmark.d.ts.map +1 -0
- package/dist/scripts/symbol-benchmark.js +319 -0
- package/dist/scripts/symbol-benchmark.js.map +1 -0
- package/dist/services/bootstrap/bootstrap-service.d.ts +157 -0
- package/dist/services/bootstrap/bootstrap-service.d.ts.map +1 -0
- package/dist/services/bootstrap/bootstrap-service.js +588 -0
- package/dist/services/bootstrap/bootstrap-service.js.map +1 -0
- package/dist/services/cache/embedding-cache-contract.d.ts +18 -0
- package/dist/services/cache/embedding-cache-contract.d.ts.map +1 -0
- package/dist/services/cache/embedding-cache-contract.js +2 -0
- package/dist/services/cache/embedding-cache-contract.js.map +1 -0
- package/dist/services/cache/embedding-cache-factory.d.ts +4 -0
- package/dist/services/cache/embedding-cache-factory.d.ts.map +1 -0
- package/dist/services/cache/embedding-cache-factory.js +8 -0
- package/dist/services/cache/embedding-cache-factory.js.map +1 -0
- package/dist/services/cache/embedding-cache-pg.d.ts +78 -0
- package/dist/services/cache/embedding-cache-pg.d.ts.map +1 -0
- package/dist/services/cache/embedding-cache-pg.js +220 -0
- package/dist/services/cache/embedding-cache-pg.js.map +1 -0
- package/dist/services/cache/index.d.ts +5 -0
- package/dist/services/cache/index.d.ts.map +1 -0
- package/dist/services/cache/index.js +5 -0
- package/dist/services/cache/index.js.map +1 -0
- package/dist/services/cache/l1-memory-cache.d.ts +71 -0
- package/dist/services/cache/l1-memory-cache.d.ts.map +1 -0
- package/dist/services/cache/l1-memory-cache.js +191 -0
- package/dist/services/cache/l1-memory-cache.js.map +1 -0
- package/dist/services/checkpoint/auto-checkpointer.d.ts +69 -0
- package/dist/services/checkpoint/auto-checkpointer.d.ts.map +1 -0
- package/dist/services/checkpoint/auto-checkpointer.js +143 -0
- package/dist/services/checkpoint/auto-checkpointer.js.map +1 -0
- package/dist/services/checkpoint/checkpoint-manager.d.ts +9 -0
- package/dist/services/checkpoint/checkpoint-manager.d.ts.map +1 -0
- package/dist/services/checkpoint/checkpoint-manager.js +25 -0
- package/dist/services/checkpoint/checkpoint-manager.js.map +1 -0
- package/dist/services/checkpoint/checkpoint-store-pg.d.ts +107 -0
- package/dist/services/checkpoint/checkpoint-store-pg.d.ts.map +1 -0
- package/dist/services/checkpoint/checkpoint-store-pg.js +476 -0
- package/dist/services/checkpoint/checkpoint-store-pg.js.map +1 -0
- package/dist/services/checkpoint/checkpoint-store.d.ts +100 -0
- package/dist/services/checkpoint/checkpoint-store.d.ts.map +1 -0
- package/dist/services/checkpoint/checkpoint-store.js +24 -0
- package/dist/services/checkpoint/checkpoint-store.js.map +1 -0
- package/dist/services/checkpoint/index.d.ts +9 -0
- package/dist/services/checkpoint/index.d.ts.map +1 -0
- package/dist/services/checkpoint/index.js +8 -0
- package/dist/services/checkpoint/index.js.map +1 -0
- package/dist/services/compression/code-compressor.d.ts +76 -0
- package/dist/services/compression/code-compressor.d.ts.map +1 -0
- package/dist/services/compression/code-compressor.js +395 -0
- package/dist/services/compression/code-compressor.js.map +1 -0
- package/dist/services/compression/index.d.ts +5 -0
- package/dist/services/compression/index.d.ts.map +1 -0
- package/dist/services/compression/index.js +5 -0
- package/dist/services/compression/index.js.map +1 -0
- package/dist/services/context/session-file-cache.d.ts +87 -0
- package/dist/services/context/session-file-cache.d.ts.map +1 -0
- package/dist/services/context/session-file-cache.js +213 -0
- package/dist/services/context/session-file-cache.js.map +1 -0
- package/dist/services/embeddings/cached-provider.d.ts +98 -0
- package/dist/services/embeddings/cached-provider.d.ts.map +1 -0
- package/dist/services/embeddings/cached-provider.js +162 -0
- package/dist/services/embeddings/cached-provider.js.map +1 -0
- package/dist/services/embeddings/config.d.ts +89 -0
- package/dist/services/embeddings/config.d.ts.map +1 -0
- package/dist/services/embeddings/config.js +341 -0
- package/dist/services/embeddings/config.js.map +1 -0
- package/dist/services/embeddings/embedding-service.d.ts +71 -0
- package/dist/services/embeddings/embedding-service.d.ts.map +1 -0
- package/dist/services/embeddings/embedding-service.js +147 -0
- package/dist/services/embeddings/embedding-service.js.map +1 -0
- package/dist/services/embeddings/index.d.ts +105 -0
- package/dist/services/embeddings/index.d.ts.map +1 -0
- package/dist/services/embeddings/index.js +174 -0
- package/dist/services/embeddings/index.js.map +1 -0
- package/dist/services/embeddings/provider.d.ts +164 -0
- package/dist/services/embeddings/provider.d.ts.map +1 -0
- package/dist/services/embeddings/provider.js +547 -0
- package/dist/services/embeddings/provider.js.map +1 -0
- package/dist/services/embeddings/providers/local-transformers.d.ts +80 -0
- package/dist/services/embeddings/providers/local-transformers.d.ts.map +1 -0
- package/dist/services/embeddings/providers/local-transformers.js +222 -0
- package/dist/services/embeddings/providers/local-transformers.js.map +1 -0
- package/dist/services/embeddings/rate-limiter.d.ts +55 -0
- package/dist/services/embeddings/rate-limiter.d.ts.map +1 -0
- package/dist/services/embeddings/rate-limiter.js +138 -0
- package/dist/services/embeddings/rate-limiter.js.map +1 -0
- package/dist/services/etl/graph-generation-coordinator.d.ts +26 -0
- package/dist/services/etl/graph-generation-coordinator.d.ts.map +1 -0
- package/dist/services/etl/graph-generation-coordinator.js +63 -0
- package/dist/services/etl/graph-generation-coordinator.js.map +1 -0
- package/dist/services/etl/index.d.ts +11 -0
- package/dist/services/etl/index.d.ts.map +1 -0
- package/dist/services/etl/index.js +9 -0
- package/dist/services/etl/index.js.map +1 -0
- package/dist/services/etl/pipeline.d.ts +70 -0
- package/dist/services/etl/pipeline.d.ts.map +1 -0
- package/dist/services/etl/pipeline.js +553 -0
- package/dist/services/etl/pipeline.js.map +1 -0
- package/dist/services/etl/stage-context.d.ts +153 -0
- package/dist/services/etl/stage-context.d.ts.map +1 -0
- package/dist/services/etl/stage-context.js +11 -0
- package/dist/services/etl/stage-context.js.map +1 -0
- package/dist/services/etl/stages/discover.d.ts +40 -0
- package/dist/services/etl/stages/discover.d.ts.map +1 -0
- package/dist/services/etl/stages/discover.js +213 -0
- package/dist/services/etl/stages/discover.js.map +1 -0
- package/dist/services/etl/stages/load.d.ts +39 -0
- package/dist/services/etl/stages/load.d.ts.map +1 -0
- package/dist/services/etl/stages/load.js +361 -0
- package/dist/services/etl/stages/load.js.map +1 -0
- package/dist/services/etl/stages/parse.d.ts +58 -0
- package/dist/services/etl/stages/parse.d.ts.map +1 -0
- package/dist/services/etl/stages/parse.js +536 -0
- package/dist/services/etl/stages/parse.js.map +1 -0
- package/dist/services/etl/stages/resolve.d.ts +66 -0
- package/dist/services/etl/stages/resolve.d.ts.map +1 -0
- package/dist/services/etl/stages/resolve.js +503 -0
- package/dist/services/etl/stages/resolve.js.map +1 -0
- package/dist/services/events/event-bus.d.ts +166 -0
- package/dist/services/events/event-bus.d.ts.map +1 -0
- package/dist/services/events/event-bus.js +32 -0
- package/dist/services/events/event-bus.js.map +1 -0
- package/dist/services/events/index.d.ts +6 -0
- package/dist/services/events/index.d.ts.map +1 -0
- package/dist/services/events/index.js +5 -0
- package/dist/services/events/index.js.map +1 -0
- package/dist/services/executor/executor.d.ts +103 -0
- package/dist/services/executor/executor.d.ts.map +1 -0
- package/dist/services/executor/executor.js +518 -0
- package/dist/services/executor/executor.js.map +1 -0
- package/dist/services/executor/index.d.ts +20 -0
- package/dist/services/executor/index.d.ts.map +1 -0
- package/dist/services/executor/index.js +16 -0
- package/dist/services/executor/index.js.map +1 -0
- package/dist/services/executor/intent-search.d.ts +52 -0
- package/dist/services/executor/intent-search.d.ts.map +1 -0
- package/dist/services/executor/intent-search.js +195 -0
- package/dist/services/executor/intent-search.js.map +1 -0
- package/dist/services/executor/run-pool.d.ts +53 -0
- package/dist/services/executor/run-pool.d.ts.map +1 -0
- package/dist/services/executor/run-pool.js +71 -0
- package/dist/services/executor/run-pool.js.map +1 -0
- package/dist/services/executor/runtime.d.ts +82 -0
- package/dist/services/executor/runtime.d.ts.map +1 -0
- package/dist/services/executor/runtime.js +254 -0
- package/dist/services/executor/runtime.js.map +1 -0
- package/dist/services/executor/sandbox.d.ts +67 -0
- package/dist/services/executor/sandbox.d.ts.map +1 -0
- package/dist/services/executor/sandbox.js +186 -0
- package/dist/services/executor/sandbox.js.map +1 -0
- package/dist/services/graph/graph-queries.d.ts +110 -0
- package/dist/services/graph/graph-queries.d.ts.map +1 -0
- package/dist/services/graph/graph-queries.js +336 -0
- package/dist/services/graph/graph-queries.js.map +1 -0
- package/dist/services/graph/graph-store-factory.d.ts +12 -0
- package/dist/services/graph/graph-store-factory.d.ts.map +1 -0
- package/dist/services/graph/graph-store-factory.js +30 -0
- package/dist/services/graph/graph-store-factory.js.map +1 -0
- package/dist/services/graph/graph-store-pg.d.ts +127 -0
- package/dist/services/graph/graph-store-pg.d.ts.map +1 -0
- package/dist/services/graph/graph-store-pg.js +422 -0
- package/dist/services/graph/graph-store-pg.js.map +1 -0
- package/dist/services/graph/index.d.ts +7 -0
- package/dist/services/graph/index.d.ts.map +1 -0
- package/dist/services/graph/index.js +6 -0
- package/dist/services/graph/index.js.map +1 -0
- package/dist/services/graph/memory-graph.service.d.ts +97 -0
- package/dist/services/graph/memory-graph.service.d.ts.map +1 -0
- package/dist/services/graph/memory-graph.service.js +171 -0
- package/dist/services/graph/memory-graph.service.js.map +1 -0
- package/dist/services/graph/relation-extractor.d.ts +61 -0
- package/dist/services/graph/relation-extractor.d.ts.map +1 -0
- package/dist/services/graph/relation-extractor.js +306 -0
- package/dist/services/graph/relation-extractor.js.map +1 -0
- package/dist/services/graph/types.d.ts +127 -0
- package/dist/services/graph/types.d.ts.map +1 -0
- package/dist/services/graph/types.js +8 -0
- package/dist/services/graph/types.js.map +1 -0
- package/dist/services/handoff/handoff-auto-injector.d.ts +32 -0
- package/dist/services/handoff/handoff-auto-injector.d.ts.map +1 -0
- package/dist/services/handoff/handoff-auto-injector.js +72 -0
- package/dist/services/handoff/handoff-auto-injector.js.map +1 -0
- package/dist/services/handoff/handoff-service.d.ts +83 -0
- package/dist/services/handoff/handoff-service.d.ts.map +1 -0
- package/dist/services/handoff/handoff-service.js +238 -0
- package/dist/services/handoff/handoff-service.js.map +1 -0
- package/dist/services/health/local-health-checker.d.ts +49 -0
- package/dist/services/health/local-health-checker.d.ts.map +1 -0
- package/dist/services/health/local-health-checker.js +82 -0
- package/dist/services/health/local-health-checker.js.map +1 -0
- package/dist/services/hooks/attribution-resolver.d.ts +113 -0
- package/dist/services/hooks/attribution-resolver.d.ts.map +1 -0
- package/dist/services/hooks/attribution-resolver.js +227 -0
- package/dist/services/hooks/attribution-resolver.js.map +1 -0
- package/dist/services/hooks/co-retrieval-hook.d.ts +63 -0
- package/dist/services/hooks/co-retrieval-hook.d.ts.map +1 -0
- package/dist/services/hooks/co-retrieval-hook.js +145 -0
- package/dist/services/hooks/co-retrieval-hook.js.map +1 -0
- package/dist/services/hooks/compaction-snapshot-service.d.ts +81 -0
- package/dist/services/hooks/compaction-snapshot-service.d.ts.map +1 -0
- package/dist/services/hooks/compaction-snapshot-service.js +308 -0
- package/dist/services/hooks/compaction-snapshot-service.js.map +1 -0
- package/dist/services/hooks/hook-service.d.ts +100 -0
- package/dist/services/hooks/hook-service.d.ts.map +1 -0
- package/dist/services/hooks/hook-service.js +272 -0
- package/dist/services/hooks/hook-service.js.map +1 -0
- package/dist/services/hooks/observation-extractor.d.ts +30 -0
- package/dist/services/hooks/observation-extractor.d.ts.map +1 -0
- package/dist/services/hooks/observation-extractor.js +364 -0
- package/dist/services/hooks/observation-extractor.js.map +1 -0
- package/dist/services/hooks/search-session-hook.d.ts +34 -0
- package/dist/services/hooks/search-session-hook.d.ts.map +1 -0
- package/dist/services/hooks/search-session-hook.js +121 -0
- package/dist/services/hooks/search-session-hook.js.map +1 -0
- package/dist/services/hooks/session-pin-store.d.ts +32 -0
- package/dist/services/hooks/session-pin-store.d.ts.map +1 -0
- package/dist/services/hooks/session-pin-store.js +57 -0
- package/dist/services/hooks/session-pin-store.js.map +1 -0
- package/dist/services/hooks/writer-queue.d.ts +35 -0
- package/dist/services/hooks/writer-queue.d.ts.map +1 -0
- package/dist/services/hooks/writer-queue.js +58 -0
- package/dist/services/hooks/writer-queue.js.map +1 -0
- package/dist/services/index.d.ts +108 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +100 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/jobs/auto-improve-apply.d.ts +32 -0
- package/dist/services/jobs/auto-improve-apply.d.ts.map +1 -0
- package/dist/services/jobs/auto-improve-apply.js +135 -0
- package/dist/services/jobs/auto-improve-apply.js.map +1 -0
- package/dist/services/jobs/auto-improve-config.d.ts +25 -0
- package/dist/services/jobs/auto-improve-config.d.ts.map +1 -0
- package/dist/services/jobs/auto-improve-config.js +40 -0
- package/dist/services/jobs/auto-improve-config.js.map +1 -0
- package/dist/services/jobs/auto-improve-job.d.ts +89 -0
- package/dist/services/jobs/auto-improve-job.d.ts.map +1 -0
- package/dist/services/jobs/auto-improve-job.js +93 -0
- package/dist/services/jobs/auto-improve-job.js.map +1 -0
- package/dist/services/jobs/auto-improve-llm.d.ts +25 -0
- package/dist/services/jobs/auto-improve-llm.d.ts.map +1 -0
- package/dist/services/jobs/auto-improve-llm.js +88 -0
- package/dist/services/jobs/auto-improve-llm.js.map +1 -0
- package/dist/services/jobs/auto-improve-ops.d.ts +11 -0
- package/dist/services/jobs/auto-improve-ops.d.ts.map +1 -0
- package/dist/services/jobs/auto-improve-ops.js +170 -0
- package/dist/services/jobs/auto-improve-ops.js.map +1 -0
- package/dist/services/jobs/auto-improve-patterns.d.ts +18 -0
- package/dist/services/jobs/auto-improve-patterns.d.ts.map +1 -0
- package/dist/services/jobs/auto-improve-patterns.js +160 -0
- package/dist/services/jobs/auto-improve-patterns.js.map +1 -0
- package/dist/services/jobs/index-job-store-contract.d.ts +22 -0
- package/dist/services/jobs/index-job-store-contract.d.ts.map +1 -0
- package/dist/services/jobs/index-job-store-contract.js +11 -0
- package/dist/services/jobs/index-job-store-contract.js.map +1 -0
- package/dist/services/jobs/index-job-store-pg.d.ts +77 -0
- package/dist/services/jobs/index-job-store-pg.d.ts.map +1 -0
- package/dist/services/jobs/index-job-store-pg.js +403 -0
- package/dist/services/jobs/index-job-store-pg.js.map +1 -0
- package/dist/services/jobs/index-job-store.d.ts +5 -0
- package/dist/services/jobs/index-job-store.d.ts.map +1 -0
- package/dist/services/jobs/index-job-store.js +7 -0
- package/dist/services/jobs/index-job-store.js.map +1 -0
- package/dist/services/jobs/index-job-tracker.d.ts +140 -0
- package/dist/services/jobs/index-job-tracker.d.ts.map +1 -0
- package/dist/services/jobs/index-job-tracker.js +344 -0
- package/dist/services/jobs/index-job-tracker.js.map +1 -0
- package/dist/services/jobs/index.d.ts +6 -0
- package/dist/services/jobs/index.d.ts.map +1 -0
- package/dist/services/jobs/index.js +6 -0
- package/dist/services/jobs/index.js.map +1 -0
- package/dist/services/jobs/memory-consolidation-job.d.ts +70 -0
- package/dist/services/jobs/memory-consolidation-job.d.ts.map +1 -0
- package/dist/services/jobs/memory-consolidation-job.js +312 -0
- package/dist/services/jobs/memory-consolidation-job.js.map +1 -0
- package/dist/services/jobs/observation-consolidation-job.d.ts +63 -0
- package/dist/services/jobs/observation-consolidation-job.d.ts.map +1 -0
- package/dist/services/jobs/observation-consolidation-job.js +253 -0
- package/dist/services/jobs/observation-consolidation-job.js.map +1 -0
- package/dist/services/memory/consolidator.d.ts +92 -0
- package/dist/services/memory/consolidator.d.ts.map +1 -0
- package/dist/services/memory/consolidator.js +182 -0
- package/dist/services/memory/consolidator.js.map +1 -0
- package/dist/services/memory/decay.d.ts +56 -0
- package/dist/services/memory/decay.d.ts.map +1 -0
- package/dist/services/memory/decay.js +73 -0
- package/dist/services/memory/decay.js.map +1 -0
- package/dist/services/memory/index.d.ts +12 -0
- package/dist/services/memory/index.d.ts.map +1 -0
- package/dist/services/memory/index.js +9 -0
- package/dist/services/memory/index.js.map +1 -0
- package/dist/services/memory/llm-client.d.ts +111 -0
- package/dist/services/memory/llm-client.d.ts.map +1 -0
- package/dist/services/memory/llm-client.js +450 -0
- package/dist/services/memory/llm-client.js.map +1 -0
- package/dist/services/memory/memory-clustering.d.ts +65 -0
- package/dist/services/memory/memory-clustering.d.ts.map +1 -0
- package/dist/services/memory/memory-clustering.js +298 -0
- package/dist/services/memory/memory-clustering.js.map +1 -0
- package/dist/services/memory/memory-service.d.ts +72 -0
- package/dist/services/memory/memory-service.d.ts.map +1 -0
- package/dist/services/memory/memory-service.js +178 -0
- package/dist/services/memory/memory-service.js.map +1 -0
- package/dist/services/memory/redundancy-filter.d.ts +26 -0
- package/dist/services/memory/redundancy-filter.d.ts.map +1 -0
- package/dist/services/memory/redundancy-filter.js +93 -0
- package/dist/services/memory/redundancy-filter.js.map +1 -0
- package/dist/services/memory/salience-judge.d.ts +51 -0
- package/dist/services/memory/salience-judge.d.ts.map +1 -0
- package/dist/services/memory/salience-judge.js +115 -0
- package/dist/services/memory/salience-judge.js.map +1 -0
- package/dist/services/metrics/token-metrics.d.ts +114 -0
- package/dist/services/metrics/token-metrics.d.ts.map +1 -0
- package/dist/services/metrics/token-metrics.js +272 -0
- package/dist/services/metrics/token-metrics.js.map +1 -0
- package/dist/services/monitoring/metrics.d.ts +154 -0
- package/dist/services/monitoring/metrics.d.ts.map +1 -0
- package/dist/services/monitoring/metrics.js +382 -0
- package/dist/services/monitoring/metrics.js.map +1 -0
- package/dist/services/pricing/models-dev-client.d.ts +141 -0
- package/dist/services/pricing/models-dev-client.d.ts.map +1 -0
- package/dist/services/pricing/models-dev-client.js +523 -0
- package/dist/services/pricing/models-dev-client.js.map +1 -0
- package/dist/services/project-identity/alias-resolver.d.ts +76 -0
- package/dist/services/project-identity/alias-resolver.d.ts.map +1 -0
- package/dist/services/project-identity/alias-resolver.js +129 -0
- package/dist/services/project-identity/alias-resolver.js.map +1 -0
- package/dist/services/project-identity/apply.d.ts +89 -0
- package/dist/services/project-identity/apply.d.ts.map +1 -0
- package/dist/services/project-identity/apply.js +619 -0
- package/dist/services/project-identity/apply.js.map +1 -0
- package/dist/services/project-identity/contracts.d.ts +103 -0
- package/dist/services/project-identity/contracts.d.ts.map +1 -0
- package/dist/services/project-identity/contracts.js +63 -0
- package/dist/services/project-identity/contracts.js.map +1 -0
- package/dist/services/project-identity/discovery.d.ts +39 -0
- package/dist/services/project-identity/discovery.d.ts.map +1 -0
- package/dist/services/project-identity/discovery.js +139 -0
- package/dist/services/project-identity/discovery.js.map +1 -0
- package/dist/services/project-identity/errors.d.ts +11 -0
- package/dist/services/project-identity/errors.d.ts.map +1 -0
- package/dist/services/project-identity/errors.js +40 -0
- package/dist/services/project-identity/errors.js.map +1 -0
- package/dist/services/project-identity/hash.d.ts +16 -0
- package/dist/services/project-identity/hash.d.ts.map +1 -0
- package/dist/services/project-identity/hash.js +91 -0
- package/dist/services/project-identity/hash.js.map +1 -0
- package/dist/services/project-identity/identity-guard-installer.d.ts +60 -0
- package/dist/services/project-identity/identity-guard-installer.d.ts.map +1 -0
- package/dist/services/project-identity/identity-guard-installer.js +116 -0
- package/dist/services/project-identity/identity-guard-installer.js.map +1 -0
- package/dist/services/project-identity/index.d.ts +25 -0
- package/dist/services/project-identity/index.d.ts.map +1 -0
- package/dist/services/project-identity/index.js +14 -0
- package/dist/services/project-identity/index.js.map +1 -0
- package/dist/services/project-identity/invalidator-registry.d.ts +52 -0
- package/dist/services/project-identity/invalidator-registry.d.ts.map +1 -0
- package/dist/services/project-identity/invalidator-registry.js +73 -0
- package/dist/services/project-identity/invalidator-registry.js.map +1 -0
- package/dist/services/project-identity/pg-array-codec.d.ts +24 -0
- package/dist/services/project-identity/pg-array-codec.d.ts.map +1 -0
- package/dist/services/project-identity/pg-array-codec.js +85 -0
- package/dist/services/project-identity/pg-array-codec.js.map +1 -0
- package/dist/services/project-identity/planner.d.ts +39 -0
- package/dist/services/project-identity/planner.d.ts.map +1 -0
- package/dist/services/project-identity/planner.js +206 -0
- package/dist/services/project-identity/planner.js.map +1 -0
- package/dist/services/project-identity/production-wiring.d.ts +60 -0
- package/dist/services/project-identity/production-wiring.d.ts.map +1 -0
- package/dist/services/project-identity/production-wiring.js +106 -0
- package/dist/services/project-identity/production-wiring.js.map +1 -0
- package/dist/services/project-identity/registry.d.ts +24 -0
- package/dist/services/project-identity/registry.d.ts.map +1 -0
- package/dist/services/project-identity/registry.js +72 -0
- package/dist/services/project-identity/registry.js.map +1 -0
- package/dist/services/project-identity/service.d.ts +28 -0
- package/dist/services/project-identity/service.d.ts.map +1 -0
- package/dist/services/project-identity/service.js +79 -0
- package/dist/services/project-identity/service.js.map +1 -0
- package/dist/services/query/prisma-client.d.ts +10 -0
- package/dist/services/query/prisma-client.d.ts.map +1 -0
- package/dist/services/query/prisma-client.js +37 -0
- package/dist/services/query/prisma-client.js.map +1 -0
- package/dist/services/scheduler/index.d.ts +13 -0
- package/dist/services/scheduler/index.d.ts.map +1 -0
- package/dist/services/scheduler/index.js +9 -0
- package/dist/services/scheduler/index.js.map +1 -0
- package/dist/services/scheduler/scheduler-cron.d.ts +39 -0
- package/dist/services/scheduler/scheduler-cron.d.ts.map +1 -0
- package/dist/services/scheduler/scheduler-cron.js +159 -0
- package/dist/services/scheduler/scheduler-cron.js.map +1 -0
- package/dist/services/scheduler/scheduler-defaults.d.ts +55 -0
- package/dist/services/scheduler/scheduler-defaults.d.ts.map +1 -0
- package/dist/services/scheduler/scheduler-defaults.js +188 -0
- package/dist/services/scheduler/scheduler-defaults.js.map +1 -0
- package/dist/services/scheduler/scheduler-store-factory.d.ts +13 -0
- package/dist/services/scheduler/scheduler-store-factory.d.ts.map +1 -0
- package/dist/services/scheduler/scheduler-store-factory.js +23 -0
- package/dist/services/scheduler/scheduler-store-factory.js.map +1 -0
- package/dist/services/scheduler/scheduler-store-pg.d.ts +44 -0
- package/dist/services/scheduler/scheduler-store-pg.d.ts.map +1 -0
- package/dist/services/scheduler/scheduler-store-pg.js +252 -0
- package/dist/services/scheduler/scheduler-store-pg.js.map +1 -0
- package/dist/services/scheduler/scheduler-store.d.ts +10 -0
- package/dist/services/scheduler/scheduler-store.d.ts.map +1 -0
- package/dist/services/scheduler/scheduler-store.js +2 -0
- package/dist/services/scheduler/scheduler-store.js.map +1 -0
- package/dist/services/scheduler/scheduler-types.d.ts +75 -0
- package/dist/services/scheduler/scheduler-types.d.ts.map +1 -0
- package/dist/services/scheduler/scheduler-types.js +10 -0
- package/dist/services/scheduler/scheduler-types.js.map +1 -0
- package/dist/services/scheduler/scheduler.d.ts +149 -0
- package/dist/services/scheduler/scheduler.d.ts.map +1 -0
- package/dist/services/scheduler/scheduler.js +453 -0
- package/dist/services/scheduler/scheduler.js.map +1 -0
- package/dist/services/search/analytics-factory.d.ts +9 -0
- package/dist/services/search/analytics-factory.d.ts.map +1 -0
- package/dist/services/search/analytics-factory.js +24 -0
- package/dist/services/search/analytics-factory.js.map +1 -0
- package/dist/services/search/cache-factory.d.ts +9 -0
- package/dist/services/search/cache-factory.d.ts.map +1 -0
- package/dist/services/search/cache-factory.js +22 -0
- package/dist/services/search/cache-factory.js.map +1 -0
- package/dist/services/search/capture-policy-interfaces.d.ts +59 -0
- package/dist/services/search/capture-policy-interfaces.d.ts.map +1 -0
- package/dist/services/search/capture-policy-interfaces.js +15 -0
- package/dist/services/search/capture-policy-interfaces.js.map +1 -0
- package/dist/services/search/capture-policy.d.ts +54 -0
- package/dist/services/search/capture-policy.d.ts.map +1 -0
- package/dist/services/search/capture-policy.js +185 -0
- package/dist/services/search/capture-policy.js.map +1 -0
- package/dist/services/search/chunker/chunker-code.d.ts +24 -0
- package/dist/services/search/chunker/chunker-code.d.ts.map +1 -0
- package/dist/services/search/chunker/chunker-code.js +182 -0
- package/dist/services/search/chunker/chunker-code.js.map +1 -0
- package/dist/services/search/chunker/chunker-json-yaml.d.ts +9 -0
- package/dist/services/search/chunker/chunker-json-yaml.d.ts.map +1 -0
- package/dist/services/search/chunker/chunker-json-yaml.js +124 -0
- package/dist/services/search/chunker/chunker-json-yaml.js.map +1 -0
- package/dist/services/search/chunker/chunker-markdown.d.ts +9 -0
- package/dist/services/search/chunker/chunker-markdown.d.ts.map +1 -0
- package/dist/services/search/chunker/chunker-markdown.js +70 -0
- package/dist/services/search/chunker/chunker-markdown.js.map +1 -0
- package/dist/services/search/chunker/chunker-post.d.ts +12 -0
- package/dist/services/search/chunker/chunker-post.d.ts.map +1 -0
- package/dist/services/search/chunker/chunker-post.js +139 -0
- package/dist/services/search/chunker/chunker-post.js.map +1 -0
- package/dist/services/search/chunker/chunker-types.d.ts +43 -0
- package/dist/services/search/chunker/chunker-types.d.ts.map +1 -0
- package/dist/services/search/chunker/chunker-types.js +15 -0
- package/dist/services/search/chunker/chunker-types.js.map +1 -0
- package/dist/services/search/contextual-search-rlm.d.ts +243 -0
- package/dist/services/search/contextual-search-rlm.d.ts.map +1 -0
- package/dist/services/search/contextual-search-rlm.js +260 -0
- package/dist/services/search/contextual-search-rlm.js.map +1 -0
- package/dist/services/search/file-filter-cache.d.ts +55 -0
- package/dist/services/search/file-filter-cache.d.ts.map +1 -0
- package/dist/services/search/file-filter-cache.js +159 -0
- package/dist/services/search/file-filter-cache.js.map +1 -0
- package/dist/services/search/filter-validation.d.ts +61 -0
- package/dist/services/search/filter-validation.d.ts.map +1 -0
- package/dist/services/search/filter-validation.js +111 -0
- package/dist/services/search/filter-validation.js.map +1 -0
- package/dist/services/search/ignore-patterns.d.ts +39 -0
- package/dist/services/search/ignore-patterns.d.ts.map +1 -0
- package/dist/services/search/ignore-patterns.js +125 -0
- package/dist/services/search/ignore-patterns.js.map +1 -0
- package/dist/services/search/index-manager.d.ts +81 -0
- package/dist/services/search/index-manager.d.ts.map +1 -0
- package/dist/services/search/index-manager.js +315 -0
- package/dist/services/search/index-manager.js.map +1 -0
- package/dist/services/search/lexical-search.d.ts +83 -0
- package/dist/services/search/lexical-search.d.ts.map +1 -0
- package/dist/services/search/lexical-search.js +297 -0
- package/dist/services/search/lexical-search.js.map +1 -0
- package/dist/services/search/query-understanding.d.ts +115 -0
- package/dist/services/search/query-understanding.d.ts.map +1 -0
- package/dist/services/search/query-understanding.js +281 -0
- package/dist/services/search/query-understanding.js.map +1 -0
- package/dist/services/search/reranker.d.ts +59 -0
- package/dist/services/search/reranker.d.ts.map +1 -0
- package/dist/services/search/reranker.js +156 -0
- package/dist/services/search/reranker.js.map +1 -0
- package/dist/services/search/rlm-admin.d.ts +22 -0
- package/dist/services/search/rlm-admin.d.ts.map +1 -0
- package/dist/services/search/rlm-admin.js +92 -0
- package/dist/services/search/rlm-admin.js.map +1 -0
- package/dist/services/search/rlm-fusion.d.ts +23 -0
- package/dist/services/search/rlm-fusion.d.ts.map +1 -0
- package/dist/services/search/rlm-fusion.js +180 -0
- package/dist/services/search/rlm-fusion.js.map +1 -0
- package/dist/services/search/rlm-indexing.d.ts +71 -0
- package/dist/services/search/rlm-indexing.d.ts.map +1 -0
- package/dist/services/search/rlm-indexing.js +431 -0
- package/dist/services/search/rlm-indexing.js.map +1 -0
- package/dist/services/search/rlm-search.d.ts +28 -0
- package/dist/services/search/rlm-search.d.ts.map +1 -0
- package/dist/services/search/rlm-search.js +489 -0
- package/dist/services/search/rlm-search.js.map +1 -0
- package/dist/services/search/rlm-synapse.d.ts +44 -0
- package/dist/services/search/rlm-synapse.d.ts.map +1 -0
- package/dist/services/search/rlm-synapse.js +227 -0
- package/dist/services/search/rlm-synapse.js.map +1 -0
- package/dist/services/search/search-analytics-pg.d.ts +62 -0
- package/dist/services/search/search-analytics-pg.d.ts.map +1 -0
- package/dist/services/search/search-analytics-pg.js +242 -0
- package/dist/services/search/search-analytics-pg.js.map +1 -0
- package/dist/services/search/search-analytics.d.ts +3 -0
- package/dist/services/search/search-analytics.d.ts.map +1 -0
- package/dist/services/search/search-analytics.js +3 -0
- package/dist/services/search/search-analytics.js.map +1 -0
- package/dist/services/search/search-cache-pg.d.ts +49 -0
- package/dist/services/search/search-cache-pg.d.ts.map +1 -0
- package/dist/services/search/search-cache-pg.js +315 -0
- package/dist/services/search/search-cache-pg.js.map +1 -0
- package/dist/services/search/search-diagnostics.d.ts +39 -0
- package/dist/services/search/search-diagnostics.d.ts.map +1 -0
- package/dist/services/search/search-diagnostics.js +81 -0
- package/dist/services/search/search-diagnostics.js.map +1 -0
- package/dist/services/search/search-warmup.d.ts +29 -0
- package/dist/services/search/search-warmup.d.ts.map +1 -0
- package/dist/services/search/search-warmup.js +96 -0
- package/dist/services/search/search-warmup.js.map +1 -0
- package/dist/services/search/smart-chunker.d.ts +16 -0
- package/dist/services/search/smart-chunker.d.ts.map +1 -0
- package/dist/services/search/smart-chunker.js +67 -0
- package/dist/services/search/smart-chunker.js.map +1 -0
- package/dist/services/structural/diagnostics.d.ts +6 -0
- package/dist/services/structural/diagnostics.d.ts.map +1 -0
- package/dist/services/structural/diagnostics.js +22 -0
- package/dist/services/structural/diagnostics.js.map +1 -0
- package/dist/services/structural/fqn-codec.d.ts +105 -0
- package/dist/services/structural/fqn-codec.d.ts.map +1 -0
- package/dist/services/structural/fqn-codec.js +272 -0
- package/dist/services/structural/fqn-codec.js.map +1 -0
- package/dist/services/structural/grammar-integrity.d.ts +37 -0
- package/dist/services/structural/grammar-integrity.d.ts.map +1 -0
- package/dist/services/structural/grammar-integrity.js +196 -0
- package/dist/services/structural/grammar-integrity.js.map +1 -0
- package/dist/services/structural/grammar-loaders.d.ts +69 -0
- package/dist/services/structural/grammar-loaders.d.ts.map +1 -0
- package/dist/services/structural/grammar-loaders.js +229 -0
- package/dist/services/structural/grammar-loaders.js.map +1 -0
- package/dist/services/structural/language-manifest.d.ts +59 -0
- package/dist/services/structural/language-manifest.d.ts.map +1 -0
- package/dist/services/structural/language-manifest.js +413 -0
- package/dist/services/structural/language-manifest.js.map +1 -0
- package/dist/services/structural/native-lock-identities.d.ts +77 -0
- package/dist/services/structural/native-lock-identities.d.ts.map +1 -0
- package/dist/services/structural/native-lock-identities.js +192 -0
- package/dist/services/structural/native-lock-identities.js.map +1 -0
- package/dist/services/structural/native-node-helpers.d.ts +16 -0
- package/dist/services/structural/native-node-helpers.d.ts.map +1 -0
- package/dist/services/structural/native-node-helpers.js +145 -0
- package/dist/services/structural/native-node-helpers.js.map +1 -0
- package/dist/services/structural/parser-pool.d.ts +34 -0
- package/dist/services/structural/parser-pool.d.ts.map +1 -0
- package/dist/services/structural/parser-pool.js +148 -0
- package/dist/services/structural/parser-pool.js.map +1 -0
- package/dist/services/structural/parser-readiness.d.ts +30 -0
- package/dist/services/structural/parser-readiness.d.ts.map +1 -0
- package/dist/services/structural/parser-readiness.js +190 -0
- package/dist/services/structural/parser-readiness.js.map +1 -0
- package/dist/services/structural/query-pack-captures.d.ts +32 -0
- package/dist/services/structural/query-pack-captures.d.ts.map +1 -0
- package/dist/services/structural/query-pack-captures.js +173 -0
- package/dist/services/structural/query-pack-captures.js.map +1 -0
- package/dist/services/structural/query-pack-edges.d.ts +11 -0
- package/dist/services/structural/query-pack-edges.d.ts.map +1 -0
- package/dist/services/structural/query-pack-edges.js +521 -0
- package/dist/services/structural/query-pack-edges.js.map +1 -0
- package/dist/services/structural/query-pack-registry.d.ts +24 -0
- package/dist/services/structural/query-pack-registry.d.ts.map +1 -0
- package/dist/services/structural/query-pack-registry.js +42 -0
- package/dist/services/structural/query-pack-registry.js.map +1 -0
- package/dist/services/structural/query-pack.d.ts +10 -0
- package/dist/services/structural/query-pack.d.ts.map +1 -0
- package/dist/services/structural/query-pack.js +32 -0
- package/dist/services/structural/query-pack.js.map +1 -0
- package/dist/services/structural/query-packs/data-document.d.ts +7 -0
- package/dist/services/structural/query-packs/data-document.d.ts.map +1 -0
- package/dist/services/structural/query-packs/data-document.js +23 -0
- package/dist/services/structural/query-packs/data-document.js.map +1 -0
- package/dist/services/structural/query-packs/functional.d.ts +8 -0
- package/dist/services/structural/query-packs/functional.d.ts.map +1 -0
- package/dist/services/structural/query-packs/functional.js +58 -0
- package/dist/services/structural/query-packs/functional.js.map +1 -0
- package/dist/services/structural/query-packs/managed.d.ts +9 -0
- package/dist/services/structural/query-packs/managed.d.ts.map +1 -0
- package/dist/services/structural/query-packs/managed.js +114 -0
- package/dist/services/structural/query-packs/managed.js.map +1 -0
- package/dist/services/structural/query-packs/scripting.d.ts +7 -0
- package/dist/services/structural/query-packs/scripting.d.ts.map +1 -0
- package/dist/services/structural/query-packs/scripting.js +53 -0
- package/dist/services/structural/query-packs/scripting.js.map +1 -0
- package/dist/services/structural/query-packs/systems.d.ts +8 -0
- package/dist/services/structural/query-packs/systems.d.ts.map +1 -0
- package/dist/services/structural/query-packs/systems.js +74 -0
- package/dist/services/structural/query-packs/systems.js.map +1 -0
- package/dist/services/structural/query-packs/typescript.d.ts +4 -0
- package/dist/services/structural/query-packs/typescript.d.ts.map +1 -0
- package/dist/services/structural/query-packs/typescript.js +51 -0
- package/dist/services/structural/query-packs/typescript.js.map +1 -0
- package/dist/services/structural/resolver.d.ts +86 -0
- package/dist/services/structural/resolver.d.ts.map +1 -0
- package/dist/services/structural/resolver.js +189 -0
- package/dist/services/structural/resolver.js.map +1 -0
- package/dist/services/structural/resolvers/data-document.d.ts +4 -0
- package/dist/services/structural/resolvers/data-document.d.ts.map +1 -0
- package/dist/services/structural/resolvers/data-document.js +7 -0
- package/dist/services/structural/resolvers/data-document.js.map +1 -0
- package/dist/services/structural/resolvers/functional.d.ts +3 -0
- package/dist/services/structural/resolvers/functional.d.ts.map +1 -0
- package/dist/services/structural/resolvers/functional.js +30 -0
- package/dist/services/structural/resolvers/functional.js.map +1 -0
- package/dist/services/structural/resolvers/managed.d.ts +3 -0
- package/dist/services/structural/resolvers/managed.d.ts.map +1 -0
- package/dist/services/structural/resolvers/managed.js +44 -0
- package/dist/services/structural/resolvers/managed.js.map +1 -0
- package/dist/services/structural/resolvers/scripting.d.ts +4 -0
- package/dist/services/structural/resolvers/scripting.d.ts.map +1 -0
- package/dist/services/structural/resolvers/scripting.js +10 -0
- package/dist/services/structural/resolvers/scripting.js.map +1 -0
- package/dist/services/structural/resolvers/systems.d.ts +3 -0
- package/dist/services/structural/resolvers/systems.d.ts.map +1 -0
- package/dist/services/structural/resolvers/systems.js +33 -0
- package/dist/services/structural/resolvers/systems.js.map +1 -0
- package/dist/services/structural/resolvers/typescript.d.ts +6 -0
- package/dist/services/structural/resolvers/typescript.d.ts.map +1 -0
- package/dist/services/structural/resolvers/typescript.js +370 -0
- package/dist/services/structural/resolvers/typescript.js.map +1 -0
- package/dist/services/structural/schema-version.d.ts +42 -0
- package/dist/services/structural/schema-version.d.ts.map +1 -0
- package/dist/services/structural/schema-version.js +80 -0
- package/dist/services/structural/schema-version.js.map +1 -0
- package/dist/services/structural/source-span.d.ts +26 -0
- package/dist/services/structural/source-span.d.ts.map +1 -0
- package/dist/services/structural/source-span.js +117 -0
- package/dist/services/structural/source-span.js.map +1 -0
- package/dist/services/structural/structural-runtime.d.ts +55 -0
- package/dist/services/structural/structural-runtime.d.ts.map +1 -0
- package/dist/services/structural/structural-runtime.js +377 -0
- package/dist/services/structural/structural-runtime.js.map +1 -0
- package/dist/services/structural/symbol-signature.d.ts +25 -0
- package/dist/services/structural/symbol-signature.d.ts.map +1 -0
- package/dist/services/structural/symbol-signature.js +319 -0
- package/dist/services/structural/symbol-signature.js.map +1 -0
- package/dist/services/structural/types.d.ts +138 -0
- package/dist/services/structural/types.d.ts.map +1 -0
- package/dist/services/structural/types.js +27 -0
- package/dist/services/structural/types.js.map +1 -0
- package/dist/services/symbol/active-generation.d.ts +42 -0
- package/dist/services/symbol/active-generation.d.ts.map +1 -0
- package/dist/services/symbol/active-generation.js +56 -0
- package/dist/services/symbol/active-generation.js.map +1 -0
- package/dist/services/symbol/architecture.d.ts +238 -0
- package/dist/services/symbol/architecture.d.ts.map +1 -0
- package/dist/services/symbol/architecture.js +464 -0
- package/dist/services/symbol/architecture.js.map +1 -0
- package/dist/services/symbol/centrality.d.ts +24 -0
- package/dist/services/symbol/centrality.d.ts.map +1 -0
- package/dist/services/symbol/centrality.js +70 -0
- package/dist/services/symbol/centrality.js.map +1 -0
- package/dist/services/symbol/communities.d.ts +86 -0
- package/dist/services/symbol/communities.d.ts.map +1 -0
- package/dist/services/symbol/communities.js +551 -0
- package/dist/services/symbol/communities.js.map +1 -0
- package/dist/services/symbol/cycle-detection.d.ts +61 -0
- package/dist/services/symbol/cycle-detection.d.ts.map +1 -0
- package/dist/services/symbol/cycle-detection.js +182 -0
- package/dist/services/symbol/cycle-detection.js.map +1 -0
- package/dist/services/symbol/definition-lookup.d.ts +31 -0
- package/dist/services/symbol/definition-lookup.d.ts.map +1 -0
- package/dist/services/symbol/definition-lookup.js +53 -0
- package/dist/services/symbol/definition-lookup.js.map +1 -0
- package/dist/services/symbol/git-ref-validation.d.ts +26 -0
- package/dist/services/symbol/git-ref-validation.d.ts.map +1 -0
- package/dist/services/symbol/git-ref-validation.js +34 -0
- package/dist/services/symbol/git-ref-validation.js.map +1 -0
- package/dist/services/symbol/impact-analysis.d.ts +205 -0
- package/dist/services/symbol/impact-analysis.d.ts.map +1 -0
- package/dist/services/symbol/impact-analysis.js +617 -0
- package/dist/services/symbol/impact-analysis.js.map +1 -0
- package/dist/services/symbol/index.d.ts +20 -0
- package/dist/services/symbol/index.d.ts.map +1 -0
- package/dist/services/symbol/index.js +13 -0
- package/dist/services/symbol/index.js.map +1 -0
- package/dist/services/symbol/symbol-graph.service.d.ts +272 -0
- package/dist/services/symbol/symbol-graph.service.d.ts.map +1 -0
- package/dist/services/symbol/symbol-graph.service.js +580 -0
- package/dist/services/symbol/symbol-graph.service.js.map +1 -0
- package/dist/services/symbol/trace-path.d.ts +164 -0
- package/dist/services/symbol/trace-path.d.ts.map +1 -0
- package/dist/services/symbol/trace-path.js +448 -0
- package/dist/services/symbol/trace-path.js.map +1 -0
- package/dist/services/synapse/buffer/index.d.ts +2 -0
- package/dist/services/synapse/buffer/index.d.ts.map +1 -0
- package/dist/services/synapse/buffer/index.js +2 -0
- package/dist/services/synapse/buffer/index.js.map +1 -0
- package/dist/services/synapse/buffer/working-memory-buffer.d.ts +124 -0
- package/dist/services/synapse/buffer/working-memory-buffer.d.ts.map +1 -0
- package/dist/services/synapse/buffer/working-memory-buffer.js +251 -0
- package/dist/services/synapse/buffer/working-memory-buffer.js.map +1 -0
- package/dist/services/synapse/index.d.ts +27 -0
- package/dist/services/synapse/index.d.ts.map +1 -0
- package/dist/services/synapse/index.js +35 -0
- package/dist/services/synapse/index.js.map +1 -0
- package/dist/services/synapse/inhibition/chain-inhibition.d.ts +36 -0
- package/dist/services/synapse/inhibition/chain-inhibition.d.ts.map +1 -0
- package/dist/services/synapse/inhibition/chain-inhibition.js +133 -0
- package/dist/services/synapse/inhibition/chain-inhibition.js.map +1 -0
- package/dist/services/synapse/inhibition/confidence-gate.d.ts +49 -0
- package/dist/services/synapse/inhibition/confidence-gate.d.ts.map +1 -0
- package/dist/services/synapse/inhibition/confidence-gate.js +131 -0
- package/dist/services/synapse/inhibition/confidence-gate.js.map +1 -0
- package/dist/services/synapse/inhibition/diversity-penalty.d.ts +28 -0
- package/dist/services/synapse/inhibition/diversity-penalty.d.ts.map +1 -0
- package/dist/services/synapse/inhibition/diversity-penalty.js +75 -0
- package/dist/services/synapse/inhibition/diversity-penalty.js.map +1 -0
- package/dist/services/synapse/inhibition/index.d.ts +5 -0
- package/dist/services/synapse/inhibition/index.d.ts.map +1 -0
- package/dist/services/synapse/inhibition/index.js +5 -0
- package/dist/services/synapse/inhibition/index.js.map +1 -0
- package/dist/services/synapse/inhibition/temporal-inhibition.d.ts +21 -0
- package/dist/services/synapse/inhibition/temporal-inhibition.d.ts.map +1 -0
- package/dist/services/synapse/inhibition/temporal-inhibition.js +70 -0
- package/dist/services/synapse/inhibition/temporal-inhibition.js.map +1 -0
- package/dist/services/synapse/inhibition/type-inference.d.ts +14 -0
- package/dist/services/synapse/inhibition/type-inference.d.ts.map +1 -0
- package/dist/services/synapse/inhibition/type-inference.js +36 -0
- package/dist/services/synapse/inhibition/type-inference.js.map +1 -0
- package/dist/services/synapse/metacognition/index.d.ts +2 -0
- package/dist/services/synapse/metacognition/index.d.ts.map +1 -0
- package/dist/services/synapse/metacognition/index.js +2 -0
- package/dist/services/synapse/metacognition/index.js.map +1 -0
- package/dist/services/synapse/metacognition/score-spectrum.d.ts +29 -0
- package/dist/services/synapse/metacognition/score-spectrum.d.ts.map +1 -0
- package/dist/services/synapse/metacognition/score-spectrum.js +70 -0
- package/dist/services/synapse/metacognition/score-spectrum.js.map +1 -0
- package/dist/services/synapse/plasticity/compress.d.ts +64 -0
- package/dist/services/synapse/plasticity/compress.d.ts.map +1 -0
- package/dist/services/synapse/plasticity/compress.js +82 -0
- package/dist/services/synapse/plasticity/compress.js.map +1 -0
- package/dist/services/synapse/plasticity/embedding-evolution.d.ts +42 -0
- package/dist/services/synapse/plasticity/embedding-evolution.d.ts.map +1 -0
- package/dist/services/synapse/plasticity/embedding-evolution.js +81 -0
- package/dist/services/synapse/plasticity/embedding-evolution.js.map +1 -0
- package/dist/services/synapse/plasticity/index.d.ts +4 -0
- package/dist/services/synapse/plasticity/index.d.ts.map +1 -0
- package/dist/services/synapse/plasticity/index.js +4 -0
- package/dist/services/synapse/plasticity/index.js.map +1 -0
- package/dist/services/synapse/plasticity/strengthen.d.ts +45 -0
- package/dist/services/synapse/plasticity/strengthen.d.ts.map +1 -0
- package/dist/services/synapse/plasticity/strengthen.js +69 -0
- package/dist/services/synapse/plasticity/strengthen.js.map +1 -0
- package/dist/services/synapse/prefetch/index.d.ts +2 -0
- package/dist/services/synapse/prefetch/index.d.ts.map +1 -0
- package/dist/services/synapse/prefetch/index.js +2 -0
- package/dist/services/synapse/prefetch/index.js.map +1 -0
- package/dist/services/synapse/prefetch/prefetch.d.ts +75 -0
- package/dist/services/synapse/prefetch/prefetch.d.ts.map +1 -0
- package/dist/services/synapse/prefetch/prefetch.js +111 -0
- package/dist/services/synapse/prefetch/prefetch.js.map +1 -0
- package/dist/services/synapse/scoring/agent-affinity.d.ts +16 -0
- package/dist/services/synapse/scoring/agent-affinity.d.ts.map +1 -0
- package/dist/services/synapse/scoring/agent-affinity.js +40 -0
- package/dist/services/synapse/scoring/agent-affinity.js.map +1 -0
- package/dist/services/synapse/scoring/attention-score.d.ts +80 -0
- package/dist/services/synapse/scoring/attention-score.d.ts.map +1 -0
- package/dist/services/synapse/scoring/attention-score.js +177 -0
- package/dist/services/synapse/scoring/attention-score.js.map +1 -0
- package/dist/services/synapse/scoring/index.d.ts +4 -0
- package/dist/services/synapse/scoring/index.d.ts.map +1 -0
- package/dist/services/synapse/scoring/index.js +4 -0
- package/dist/services/synapse/scoring/index.js.map +1 -0
- package/dist/services/synapse/scoring/task-alignment.d.ts +20 -0
- package/dist/services/synapse/scoring/task-alignment.d.ts.map +1 -0
- package/dist/services/synapse/scoring/task-alignment.js +65 -0
- package/dist/services/synapse/scoring/task-alignment.js.map +1 -0
- package/dist/services/synapse/session/index.d.ts +2 -0
- package/dist/services/synapse/session/index.d.ts.map +1 -0
- package/dist/services/synapse/session/index.js +2 -0
- package/dist/services/synapse/session/index.js.map +1 -0
- package/dist/services/synapse/session/session-registry.d.ts +85 -0
- package/dist/services/synapse/session/session-registry.d.ts.map +1 -0
- package/dist/services/synapse/session/session-registry.js +241 -0
- package/dist/services/synapse/session/session-registry.js.map +1 -0
- package/dist/services/synapse/session/session-store-pg.d.ts +88 -0
- package/dist/services/synapse/session/session-store-pg.d.ts.map +1 -0
- package/dist/services/synapse/session/session-store-pg.js +334 -0
- package/dist/services/synapse/session/session-store-pg.js.map +1 -0
- package/dist/services/synapse/session/session-store.d.ts +23 -0
- package/dist/services/synapse/session/session-store.d.ts.map +1 -0
- package/dist/services/synapse/session/session-store.js +15 -0
- package/dist/services/synapse/session/session-store.js.map +1 -0
- package/dist/services/synapse/synapse-manager.d.ts +41 -0
- package/dist/services/synapse/synapse-manager.d.ts.map +1 -0
- package/dist/services/synapse/synapse-manager.js +167 -0
- package/dist/services/synapse/synapse-manager.js.map +1 -0
- package/dist/services/synapse/task-envelope.d.ts +99 -0
- package/dist/services/synapse/task-envelope.d.ts.map +1 -0
- package/dist/services/synapse/task-envelope.js +192 -0
- package/dist/services/synapse/task-envelope.js.map +1 -0
- package/dist/services/synapse/types.d.ts +79 -0
- package/dist/services/synapse/types.d.ts.map +1 -0
- package/dist/services/synapse/types.js +8 -0
- package/dist/services/synapse/types.js.map +1 -0
- package/dist/services/web/fetcher.d.ts +99 -0
- package/dist/services/web/fetcher.d.ts.map +1 -0
- package/dist/services/web/fetcher.js +267 -0
- package/dist/services/web/fetcher.js.map +1 -0
- package/dist/services/web/html-to-md.d.ts +38 -0
- package/dist/services/web/html-to-md.d.ts.map +1 -0
- package/dist/services/web/html-to-md.js +98 -0
- package/dist/services/web/html-to-md.js.map +1 -0
- package/dist/services/web/index.d.ts +15 -0
- package/dist/services/web/index.d.ts.map +1 -0
- package/dist/services/web/index.js +15 -0
- package/dist/services/web/index.js.map +1 -0
- package/dist/services/web/ssrf.d.ts +142 -0
- package/dist/services/web/ssrf.d.ts.map +1 -0
- package/dist/services/web/ssrf.js +334 -0
- package/dist/services/web/ssrf.js.map +1 -0
- package/dist/services/web/web-controller.d.ts +70 -0
- package/dist/services/web/web-controller.d.ts.map +1 -0
- package/dist/services/web/web-controller.js +140 -0
- package/dist/services/web/web-controller.js.map +1 -0
- package/dist/services/workspace/index.d.ts +6 -0
- package/dist/services/workspace/index.d.ts.map +1 -0
- package/dist/services/workspace/index.js +5 -0
- package/dist/services/workspace/index.js.map +1 -0
- package/dist/services/workspace/workspace-manager.d.ts +57 -0
- package/dist/services/workspace/workspace-manager.d.ts.map +1 -0
- package/dist/services/workspace/workspace-manager.js +144 -0
- package/dist/services/workspace/workspace-manager.js.map +1 -0
- package/dist/tools/batch_execute.d.ts +64 -0
- package/dist/tools/batch_execute.d.ts.map +1 -0
- package/dist/tools/batch_execute.js +55 -0
- package/dist/tools/batch_execute.js.map +1 -0
- package/dist/tools/compact_snapshot.d.ts +56 -0
- package/dist/tools/compact_snapshot.d.ts.map +1 -0
- package/dist/tools/compact_snapshot.js +139 -0
- package/dist/tools/compact_snapshot.js.map +1 -0
- package/dist/tools/compress_context.d.ts +41 -0
- package/dist/tools/compress_context.d.ts.map +1 -0
- package/dist/tools/compress_context.js +103 -0
- package/dist/tools/compress_context.js.map +1 -0
- package/dist/tools/create_checkpoint.d.ts +120 -0
- package/dist/tools/create_checkpoint.d.ts.map +1 -0
- package/dist/tools/create_checkpoint.js +184 -0
- package/dist/tools/create_checkpoint.js.map +1 -0
- package/dist/tools/delete_memory.d.ts +39 -0
- package/dist/tools/delete_memory.d.ts.map +1 -0
- package/dist/tools/delete_memory.js +51 -0
- package/dist/tools/delete_memory.js.map +1 -0
- package/dist/tools/enum-validation.d.ts +37 -0
- package/dist/tools/enum-validation.d.ts.map +1 -0
- package/dist/tools/enum-validation.js +46 -0
- package/dist/tools/enum-validation.js.map +1 -0
- package/dist/tools/execute.d.ts +57 -0
- package/dist/tools/execute.d.ts.map +1 -0
- package/dist/tools/execute.js +64 -0
- package/dist/tools/execute.js.map +1 -0
- package/dist/tools/execute_file.d.ts +52 -0
- package/dist/tools/execute_file.d.ts.map +1 -0
- package/dist/tools/execute_file.js +61 -0
- package/dist/tools/execute_file.js.map +1 -0
- package/dist/tools/fetch_and_index.d.ts +71 -0
- package/dist/tools/fetch_and_index.d.ts.map +1 -0
- package/dist/tools/fetch_and_index.js +74 -0
- package/dist/tools/fetch_and_index.js.map +1 -0
- package/dist/tools/get_analytics.d.ts +38 -0
- package/dist/tools/get_analytics.d.ts.map +1 -0
- package/dist/tools/get_analytics.js +114 -0
- package/dist/tools/get_analytics.js.map +1 -0
- package/dist/tools/get_architecture.d.ts +59 -0
- package/dist/tools/get_architecture.d.ts.map +1 -0
- package/dist/tools/get_architecture.js +104 -0
- package/dist/tools/get_architecture.js.map +1 -0
- package/dist/tools/get_index_status.d.ts +23 -0
- package/dist/tools/get_index_status.d.ts.map +1 -0
- package/dist/tools/get_index_status.js +61 -0
- package/dist/tools/get_index_status.js.map +1 -0
- package/dist/tools/get_optimized_context.d.ts +78 -0
- package/dist/tools/get_optimized_context.d.ts.map +1 -0
- package/dist/tools/get_optimized_context.js +110 -0
- package/dist/tools/get_optimized_context.js.map +1 -0
- package/dist/tools/get_references.d.ts +53 -0
- package/dist/tools/get_references.d.ts.map +1 -0
- package/dist/tools/get_references.js +114 -0
- package/dist/tools/get_references.js.map +1 -0
- package/dist/tools/go_to_definition.d.ts +31 -0
- package/dist/tools/go_to_definition.d.ts.map +1 -0
- package/dist/tools/go_to_definition.js +75 -0
- package/dist/tools/go_to_definition.js.map +1 -0
- package/dist/tools/impact_analysis.d.ts +89 -0
- package/dist/tools/impact_analysis.d.ts.map +1 -0
- package/dist/tools/impact_analysis.js +186 -0
- package/dist/tools/impact_analysis.js.map +1 -0
- package/dist/tools/index.d.ts +34 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +38 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/index_project.d.ts +77 -0
- package/dist/tools/index_project.d.ts.map +1 -0
- package/dist/tools/index_project.js +259 -0
- package/dist/tools/index_project.js.map +1 -0
- package/dist/tools/list_checkpoints.d.ts +59 -0
- package/dist/tools/list_checkpoints.d.ts.map +1 -0
- package/dist/tools/list_checkpoints.js +110 -0
- package/dist/tools/list_checkpoints.js.map +1 -0
- package/dist/tools/list_projects.d.ts +24 -0
- package/dist/tools/list_projects.d.ts.map +1 -0
- package/dist/tools/list_projects.js +58 -0
- package/dist/tools/list_projects.js.map +1 -0
- package/dist/tools/read_file.d.ts +150 -0
- package/dist/tools/read_file.d.ts.map +1 -0
- package/dist/tools/read_file.js +580 -0
- package/dist/tools/read_file.js.map +1 -0
- package/dist/tools/restore_checkpoint.d.ts +45 -0
- package/dist/tools/restore_checkpoint.d.ts.map +1 -0
- package/dist/tools/restore_checkpoint.js +113 -0
- package/dist/tools/restore_checkpoint.js.map +1 -0
- package/dist/tools/search_code.d.ts +35 -0
- package/dist/tools/search_code.d.ts.map +1 -0
- package/dist/tools/search_code.js +61 -0
- package/dist/tools/search_code.js.map +1 -0
- package/dist/tools/search_definitions.d.ts +54 -0
- package/dist/tools/search_definitions.d.ts.map +1 -0
- package/dist/tools/search_definitions.js +123 -0
- package/dist/tools/search_definitions.js.map +1 -0
- package/dist/tools/search_memories.d.ts +82 -0
- package/dist/tools/search_memories.d.ts.map +1 -0
- package/dist/tools/search_memories.js +115 -0
- package/dist/tools/search_memories.js.map +1 -0
- package/dist/tools/search_project.d.ts +90 -0
- package/dist/tools/search_project.d.ts.map +1 -0
- package/dist/tools/search_project.js +115 -0
- package/dist/tools/search_project.js.map +1 -0
- package/dist/tools/serialize-interfaces.d.ts +103 -0
- package/dist/tools/serialize-interfaces.d.ts.map +1 -0
- package/dist/tools/serialize-interfaces.js +15 -0
- package/dist/tools/serialize-interfaces.js.map +1 -0
- package/dist/tools/serialize.d.ts +101 -0
- package/dist/tools/serialize.d.ts.map +1 -0
- package/dist/tools/serialize.js +388 -0
- package/dist/tools/serialize.js.map +1 -0
- package/dist/tools/store_memory.d.ts +78 -0
- package/dist/tools/store_memory.d.ts.map +1 -0
- package/dist/tools/store_memory.js +87 -0
- package/dist/tools/store_memory.js.map +1 -0
- package/dist/tools/trace_path.d.ts +98 -0
- package/dist/tools/trace_path.d.ts.map +1 -0
- package/dist/tools/trace_path.js +181 -0
- package/dist/tools/trace_path.js.map +1 -0
- package/dist/tools/update_memory.d.ts +61 -0
- package/dist/tools/update_memory.d.ts.map +1 -0
- package/dist/tools/update_memory.js +74 -0
- package/dist/tools/update_memory.js.map +1 -0
- package/package.json +103 -0
- package/prisma/migrations/20260309210441_init/migration.sql +127 -0
- package/prisma/migrations/20260413122356_add_workspaces_symbol_graph/migration.sql +224 -0
- package/prisma/migrations/20260413200000_add_vector_4096_bq/migration.sql +33 -0
- package/prisma/migrations/20260419193214_hnsw_ef_construction_128/migration.sql +38 -0
- package/prisma/migrations/20260419214959_add_vector_1536/migration.sql +28 -0
- package/prisma/migrations/20260705060000_add_memories_pinned_softdelete/migration.sql +10 -0
- package/prisma/migrations/20260706105826_drop_symbol_refs_target_fqn_not_null/migration.sql +2 -0
- package/prisma/migrations/20260707100000_add_index_jobs_pg/migration.sql +28 -0
- package/prisma/migrations/20260709120000_add_scheduled_jobs_pg/migration.sql +22 -0
- package/prisma/migrations/20260710120000_add_synapse_sessions_pg/migration.sql +36 -0
- package/prisma/migrations/20260710123800_add_observations_pg/migration.sql +35 -0
- package/prisma/migrations/20260710140000_add_symbol_refs_meta_and_kind_index/migration.sql +8 -0
- package/prisma/migrations/20260710160000_add_task_checkpoints_pg/migration.sql +30 -0
- package/prisma/migrations/20260713090000_add_handoffs_proposals_pg/migration.sql +42 -0
- package/prisma/migrations/20260714170000_add_graph_generations/migration.sql +286 -0
- package/prisma/migrations/20260714220000_add_index_job_graph_generation/migration.sql +5 -0
- package/prisma/migrations/20260714233000_add_index_job_parser_diagnostics/migration.sql +6 -0
- package/prisma/migrations/20260718000000_add_operation_log/migration.sql +25 -0
- package/prisma/migrations/20260719120000_add_project_identity/migration.sql +268 -0
- package/prisma/migrations/20260720120000_add_observation_attribution/migration.sql +5 -0
- package/prisma/migrations/20260720210000_repair_hook_attribution/migration.sql +256 -0
- package/prisma/migrations/20260722120000_add_managed_runs/migration.sql +66 -0
- package/prisma/migrations/20260722130000_add_scheduler_last_success/migration.sql +24 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/schema.prisma +745 -0
|
@@ -0,0 +1,703 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostgreSQL + pgvector Vector Store
|
|
3
|
+
*
|
|
4
|
+
* High-performance vector store using PostgreSQL with pgvector extension.
|
|
5
|
+
*
|
|
6
|
+
* Index strategy (per embedding dimension):
|
|
7
|
+
* ≤ 2000 dims → HNSW on vector column (vector_cosine_ops) O(log n)
|
|
8
|
+
* > 2000 dims → Two-phase binary quantization search:
|
|
9
|
+
* Phase 1: ANN on bit column (bit_hamming_ops, HNSW) → candidates
|
|
10
|
+
* Phase 2: exact cosine re-rank on vector column → top-k
|
|
11
|
+
*
|
|
12
|
+
* All write/delete/list operations use raw SQL to avoid the Prisma 7.7.0 + Bun ORM bug
|
|
13
|
+
* (isObjectEnumValue is not a function).
|
|
14
|
+
*/
|
|
15
|
+
import { BaseVectorStore } from './base-vector-store.js';
|
|
16
|
+
import { SearchSource, } from '@massa-ai/shared';
|
|
17
|
+
import { logger } from '@massa-ai/shared';
|
|
18
|
+
import { installGuardOnTable } from '../../services/project-identity/identity-guard-installer.js';
|
|
19
|
+
export class PostgresVectorStore extends BaseVectorStore {
|
|
20
|
+
pool = null;
|
|
21
|
+
config;
|
|
22
|
+
initialized = false;
|
|
23
|
+
schemaDimensions = null;
|
|
24
|
+
tableName = 'vector_documents';
|
|
25
|
+
/** True when the table has embedding_bq column + HNSW index. Set during init. */
|
|
26
|
+
bqEnabled = false;
|
|
27
|
+
constructor(config) {
|
|
28
|
+
super();
|
|
29
|
+
this.config = {
|
|
30
|
+
poolSize: 10,
|
|
31
|
+
indexType: 'hnsw',
|
|
32
|
+
// efConstruction=128 is the pgvector-recommended value for high-dim vectors (4096d qwen3).
|
|
33
|
+
indexParams: { m: 16, efConstruction: 128, lists: 100 },
|
|
34
|
+
...config,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// ── Table / dimension helpers ──────────────────────────────────────────────
|
|
38
|
+
getTableName(dimensions) {
|
|
39
|
+
return `vector_documents_${dimensions}d`;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Clamp a raw pgvector cosine-similarity (`1 - (embedding <=> query)`) into
|
|
43
|
+
* the [0,1] relevance contract exposed by SearchResult.score. pgvector
|
|
44
|
+
* returns NULL — which parseFloats to NaN — for rows whose embedding is
|
|
45
|
+
* missing or zero-norm, and cosine similarity can dip below 0 for
|
|
46
|
+
* anti-correlated vectors. Both are normalized to 0 so every search result
|
|
47
|
+
* always carries a finite, in-range score.
|
|
48
|
+
*/
|
|
49
|
+
normalizeScore(raw) {
|
|
50
|
+
const value = typeof raw === "number" ? raw : parseFloat(String(raw));
|
|
51
|
+
if (!Number.isFinite(value))
|
|
52
|
+
return 0;
|
|
53
|
+
return Math.min(1, Math.max(0, value));
|
|
54
|
+
}
|
|
55
|
+
// ── Binary quantization ────────────────────────────────────────────────────
|
|
56
|
+
/**
|
|
57
|
+
* Convert float32 embedding to a bit-string for binary quantization.
|
|
58
|
+
* Positive (≥ 0) → '1', Negative (< 0) → '0'.
|
|
59
|
+
* The result is passed to PostgreSQL as `$1::bit(N)`.
|
|
60
|
+
*/
|
|
61
|
+
floatsToBit(v) {
|
|
62
|
+
return v.map((x) => (x >= 0 ? '1' : '0')).join('');
|
|
63
|
+
}
|
|
64
|
+
// ── Initialization ─────────────────────────────────────────────────────────
|
|
65
|
+
async ensureInitialized() {
|
|
66
|
+
if (this.pool && this.initialized)
|
|
67
|
+
return this.pool;
|
|
68
|
+
const pg = await import('pg');
|
|
69
|
+
const PgPool = pg.default?.Pool ?? pg.Pool;
|
|
70
|
+
const poolConfig = {
|
|
71
|
+
connectionString: this.config.connectionString,
|
|
72
|
+
max: this.config.poolSize,
|
|
73
|
+
idleTimeoutMillis: 30000,
|
|
74
|
+
connectionTimeoutMillis: 5000,
|
|
75
|
+
};
|
|
76
|
+
const pool = new PgPool(poolConfig);
|
|
77
|
+
this.pool = pool;
|
|
78
|
+
const client = await pool.connect();
|
|
79
|
+
try {
|
|
80
|
+
await client.query('CREATE EXTENSION IF NOT EXISTS vector');
|
|
81
|
+
const providerDimensions = await this.getEmbeddingDimensions();
|
|
82
|
+
this.tableName = this.getTableName(providerDimensions);
|
|
83
|
+
this.schemaDimensions = providerDimensions;
|
|
84
|
+
// Ensure table exists (migration is the preferred path)
|
|
85
|
+
const { rows } = await client.query(`SELECT tablename FROM pg_tables WHERE tablename = $1`, [this.tableName]);
|
|
86
|
+
if (rows.length === 0) {
|
|
87
|
+
logger.warn(`Table ${this.tableName} not found. Creating fallback table.`, {
|
|
88
|
+
note: 'Run "prisma migrate deploy" to create tables via migrations',
|
|
89
|
+
});
|
|
90
|
+
await this.createFallbackTable(client, providerDimensions);
|
|
91
|
+
}
|
|
92
|
+
// UX guard: warn if chunks exist in another dim table for some projects but
|
|
93
|
+
// the current dim table is empty — indicates an embedding-model change
|
|
94
|
+
// without reindex, which makes all semantic search return 0 results.
|
|
95
|
+
await this.detectOrphanedChunks(client, providerDimensions);
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
client.release();
|
|
99
|
+
}
|
|
100
|
+
await this.createVectorIndex();
|
|
101
|
+
this.initialized = true;
|
|
102
|
+
logger.info('PostgresVectorStore initialized', {
|
|
103
|
+
poolSize: this.config.poolSize,
|
|
104
|
+
indexType: this.config.indexType,
|
|
105
|
+
dimensions: this.schemaDimensions,
|
|
106
|
+
tableName: this.tableName,
|
|
107
|
+
bqEnabled: this.bqEnabled,
|
|
108
|
+
});
|
|
109
|
+
return pool;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Detect chunks indexed under a different dimension than the current provider.
|
|
113
|
+
*
|
|
114
|
+
* When the user changes EMBEDDING_PROVIDER or the embedding model, the new
|
|
115
|
+
* provider's dims may not match existing rows (which are stored in
|
|
116
|
+
* vector_documents_<oldDim>d). Search then silently hits an empty table for
|
|
117
|
+
* affected projects. We warn so the user knows a reindex is required.
|
|
118
|
+
*/
|
|
119
|
+
async detectOrphanedChunks(client, currentDim) {
|
|
120
|
+
try {
|
|
121
|
+
const { rows: dimTables } = await client.query(`SELECT tablename FROM pg_tables
|
|
122
|
+
WHERE tablename ~ '^vector_documents_[0-9]+d$'
|
|
123
|
+
AND tablename <> $1`, [this.tableName]);
|
|
124
|
+
if (dimTables.length === 0)
|
|
125
|
+
return;
|
|
126
|
+
// Check if the CURRENT dim table has any rows
|
|
127
|
+
const { rows: currentRows } = await client.query(`SELECT COUNT(*)::int AS n FROM ${this.tableName}`);
|
|
128
|
+
const currentCount = currentRows[0]?.n ?? 0;
|
|
129
|
+
for (const { tablename } of dimTables) {
|
|
130
|
+
const { rows: projects } = await client.query(`SELECT project_id, COUNT(*)::int AS n
|
|
131
|
+
FROM ${tablename}
|
|
132
|
+
WHERE project_id NOT IN (SELECT DISTINCT project_id FROM ${this.tableName})
|
|
133
|
+
GROUP BY project_id`);
|
|
134
|
+
if (projects.length === 0)
|
|
135
|
+
continue;
|
|
136
|
+
const otherDim = tablename.match(/_([0-9]+)d$/)?.[1];
|
|
137
|
+
logger.warn(`[vector] Orphaned chunks detected: ${tablename} has data for projects not in ${this.tableName}. ` +
|
|
138
|
+
`Embedding model likely changed from ${otherDim}d → ${currentDim}d. Reindex required.`, {
|
|
139
|
+
currentTable: this.tableName,
|
|
140
|
+
currentCount,
|
|
141
|
+
orphanedTable: tablename,
|
|
142
|
+
affectedProjects: projects.map((p) => ({ projectId: p.project_id, chunks: p.n })),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
catch (err) {
|
|
147
|
+
// Detection is best-effort; don't fail initialization
|
|
148
|
+
logger.debug('[vector] Orphaned chunks detection failed', { error: err.message });
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
async createFallbackTable(client, dimensions) {
|
|
152
|
+
const hasBq = dimensions > 2000;
|
|
153
|
+
const bqCol = hasBq ? `, embedding_bq bit(${dimensions})` : '';
|
|
154
|
+
await client.query(`
|
|
155
|
+
CREATE TABLE ${this.tableName} (
|
|
156
|
+
id TEXT PRIMARY KEY,
|
|
157
|
+
project_id TEXT NOT NULL,
|
|
158
|
+
content TEXT NOT NULL,
|
|
159
|
+
metadata JSONB DEFAULT '{}',
|
|
160
|
+
embedding vector(${dimensions})${bqCol},
|
|
161
|
+
created_at TIMESTAMPTZ DEFAULT NOW(),
|
|
162
|
+
updated_at TIMESTAMPTZ DEFAULT NOW()
|
|
163
|
+
)
|
|
164
|
+
`);
|
|
165
|
+
await client.query(`
|
|
166
|
+
CREATE INDEX idx_${this.tableName}_project_id ON ${this.tableName}(project_id)
|
|
167
|
+
`);
|
|
168
|
+
// Project-identity guard on this runtime-created dimension table
|
|
169
|
+
// (design: runtime tables install guards during initialization). The
|
|
170
|
+
// installer is idempotent (DROP IF EXISTS + CREATE) and never throws.
|
|
171
|
+
const guardCode = await installGuardOnTable(client, "public", this.tableName, "project_id");
|
|
172
|
+
if (guardCode) {
|
|
173
|
+
logger.warn('[project-identity] guard install failed (sanitized)', {
|
|
174
|
+
table: this.tableName,
|
|
175
|
+
code: guardCode,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// ── Index creation ─────────────────────────────────────────────────────────
|
|
180
|
+
async createVectorIndex() {
|
|
181
|
+
if (this.schemaDimensions && this.schemaDimensions > 2000) {
|
|
182
|
+
await this.createBqIndex();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const pool = this.pool;
|
|
186
|
+
const indexName = `idx_${this.tableName}_embedding`;
|
|
187
|
+
const { rows } = await pool.query(`SELECT indexname FROM pg_indexes WHERE indexname = $1`, [indexName]);
|
|
188
|
+
if (rows.length > 0) {
|
|
189
|
+
logger.debug('HNSW index already exists', { indexName });
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
logger.info('Creating HNSW index (this may take a while for large tables)...');
|
|
193
|
+
if (this.config.indexType === 'hnsw') {
|
|
194
|
+
const m = this.config.indexParams?.m ?? 16;
|
|
195
|
+
const efConstruction = this.config.indexParams?.efConstruction ?? 128;
|
|
196
|
+
await pool.query(`
|
|
197
|
+
CREATE INDEX CONCURRENTLY IF NOT EXISTS ${indexName}
|
|
198
|
+
ON ${this.tableName}
|
|
199
|
+
USING hnsw (embedding vector_cosine_ops)
|
|
200
|
+
WITH (m = ${m}, ef_construction = ${efConstruction})
|
|
201
|
+
`);
|
|
202
|
+
logger.info('HNSW index created', { m, efConstruction });
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
const lists = this.config.indexParams?.lists ?? 100;
|
|
206
|
+
await pool.query(`
|
|
207
|
+
CREATE INDEX CONCURRENTLY IF NOT EXISTS ${indexName}
|
|
208
|
+
ON ${this.tableName}
|
|
209
|
+
USING ivfflat (embedding vector_cosine_ops)
|
|
210
|
+
WITH (lists = ${lists})
|
|
211
|
+
`);
|
|
212
|
+
logger.info('IVFFlat index created', { lists });
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Create HNSW index on the binary-quantized bit column.
|
|
217
|
+
* bit_hamming_ops supports any dimension (no pgvector limit).
|
|
218
|
+
*/
|
|
219
|
+
async createBqIndex() {
|
|
220
|
+
const pool = this.pool;
|
|
221
|
+
const bqIndexName = `idx_${this.tableName}_embedding_bq`;
|
|
222
|
+
// Check if index already exists
|
|
223
|
+
const { rows: idxRows } = await pool.query(`SELECT indexname FROM pg_indexes WHERE indexname = $1`, [bqIndexName]);
|
|
224
|
+
if (idxRows.length > 0) {
|
|
225
|
+
logger.debug('BQ HNSW index already exists', { bqIndexName });
|
|
226
|
+
this.bqEnabled = true;
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
// Verify the embedding_bq column actually exists
|
|
230
|
+
const { rows: colRows } = await pool.query(`SELECT column_name
|
|
231
|
+
FROM information_schema.columns
|
|
232
|
+
WHERE table_name = $1 AND column_name = 'embedding_bq'`, [this.tableName]);
|
|
233
|
+
if (colRows.length === 0) {
|
|
234
|
+
logger.warn('embedding_bq column not found — BQ disabled. Run prisma migrate deploy.', {
|
|
235
|
+
tableName: this.tableName,
|
|
236
|
+
});
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
logger.info('Creating HNSW index on binary-quantized column...', {
|
|
240
|
+
tableName: this.tableName,
|
|
241
|
+
dimensions: this.schemaDimensions,
|
|
242
|
+
});
|
|
243
|
+
const m = this.config.indexParams?.m ?? 16;
|
|
244
|
+
const efConstruction = this.config.indexParams?.efConstruction ?? 128;
|
|
245
|
+
await pool.query(`
|
|
246
|
+
CREATE INDEX CONCURRENTLY IF NOT EXISTS ${bqIndexName}
|
|
247
|
+
ON ${this.tableName}
|
|
248
|
+
USING hnsw (embedding_bq bit_hamming_ops)
|
|
249
|
+
WITH (m = ${m}, ef_construction = ${efConstruction})
|
|
250
|
+
`);
|
|
251
|
+
this.bqEnabled = true;
|
|
252
|
+
logger.info('BQ HNSW index created', { bqIndexName, m, efConstruction });
|
|
253
|
+
}
|
|
254
|
+
// ── Write operations (raw SQL — avoids Prisma+Bun ORM bug) ────────────────
|
|
255
|
+
async addDocument(id, content, metadata) {
|
|
256
|
+
const pool = await this.ensureInitialized();
|
|
257
|
+
const projectId = metadata?.projectId || 'default';
|
|
258
|
+
const embedding = await this.embedContent(content);
|
|
259
|
+
if (this.schemaDimensions && embedding.length !== this.schemaDimensions) {
|
|
260
|
+
throw new Error(`Embedding dimension mismatch: got ${embedding.length}, expected ${this.schemaDimensions}`);
|
|
261
|
+
}
|
|
262
|
+
const vectorString = `[${embedding.join(',')}]`;
|
|
263
|
+
if (this.bqEnabled) {
|
|
264
|
+
const bqString = this.floatsToBit(embedding);
|
|
265
|
+
await pool.query(`INSERT INTO ${this.tableName} (id, project_id, content, metadata, embedding, embedding_bq)
|
|
266
|
+
VALUES ($1, $2, $3, $4, $5::vector, $6::bit(${this.schemaDimensions}))
|
|
267
|
+
ON CONFLICT (id) DO UPDATE SET
|
|
268
|
+
content = EXCLUDED.content,
|
|
269
|
+
metadata = EXCLUDED.metadata,
|
|
270
|
+
embedding = EXCLUDED.embedding,
|
|
271
|
+
embedding_bq = EXCLUDED.embedding_bq,
|
|
272
|
+
updated_at = NOW()`, [id, projectId, content, JSON.stringify(metadata ?? {}), vectorString, bqString]);
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
await pool.query(`INSERT INTO ${this.tableName} (id, project_id, content, metadata, embedding)
|
|
276
|
+
VALUES ($1, $2, $3, $4, $5::vector)
|
|
277
|
+
ON CONFLICT (id) DO UPDATE SET
|
|
278
|
+
content = EXCLUDED.content,
|
|
279
|
+
metadata = EXCLUDED.metadata,
|
|
280
|
+
embedding = EXCLUDED.embedding,
|
|
281
|
+
updated_at = NOW()`, [id, projectId, content, JSON.stringify(metadata ?? {}), vectorString]);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Insert documents, embedding them in sub-batches to avoid overwhelming
|
|
286
|
+
* the embedding backend. Each sub-batch is its own short transaction
|
|
287
|
+
* (matches PostgresVectorStore semantics — partial progress survives an
|
|
288
|
+
* Ollama crash mid-file, instead of rolling back the whole file).
|
|
289
|
+
* Fails-open per-document when a whole sub-batch's embed call errors.
|
|
290
|
+
*/
|
|
291
|
+
async addDocuments(documents) {
|
|
292
|
+
if (documents.length === 0)
|
|
293
|
+
return;
|
|
294
|
+
const pool = await this.ensureInitialized();
|
|
295
|
+
// Match PostgresVectorStore: Ollama bge-m3 crashes on large batches (50+)
|
|
296
|
+
const EMBED_SUB_BATCH_SIZE = 8;
|
|
297
|
+
let totalInserted = 0;
|
|
298
|
+
let totalFailed = 0;
|
|
299
|
+
for (let i = 0; i < documents.length; i += EMBED_SUB_BATCH_SIZE) {
|
|
300
|
+
const subBatch = documents.slice(i, i + EMBED_SUB_BATCH_SIZE);
|
|
301
|
+
let embeddings = null;
|
|
302
|
+
try {
|
|
303
|
+
embeddings = await this.embedBatch(subBatch.map((d) => d.content));
|
|
304
|
+
}
|
|
305
|
+
catch (error) {
|
|
306
|
+
logger.warn('[postgres] Sub-batch embedding failed, falling back per-document', {
|
|
307
|
+
subBatchIndex: Math.floor(i / EMBED_SUB_BATCH_SIZE),
|
|
308
|
+
count: subBatch.length,
|
|
309
|
+
error: error.message,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
if (embeddings) {
|
|
313
|
+
try {
|
|
314
|
+
await this.insertSubBatch(pool, subBatch, embeddings);
|
|
315
|
+
totalInserted += subBatch.length;
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
catch (error) {
|
|
319
|
+
logger.warn('[postgres] Sub-batch insert failed, falling back per-document', {
|
|
320
|
+
subBatchIndex: Math.floor(i / EMBED_SUB_BATCH_SIZE),
|
|
321
|
+
count: subBatch.length,
|
|
322
|
+
error: error.message,
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
// Per-document fallback for this sub-batch
|
|
327
|
+
for (const doc of subBatch) {
|
|
328
|
+
try {
|
|
329
|
+
const embedding = await this.embedContent(doc.content);
|
|
330
|
+
await this.insertSubBatch(pool, [doc], [embedding]);
|
|
331
|
+
totalInserted++;
|
|
332
|
+
}
|
|
333
|
+
catch (singleError) {
|
|
334
|
+
totalFailed++;
|
|
335
|
+
logger.warn('[postgres] Skipping document due to embedding/insert error', {
|
|
336
|
+
id: doc.id,
|
|
337
|
+
error: singleError.message,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
logger.debug('[postgres] Batch documents added to vector store', {
|
|
343
|
+
inserted: totalInserted,
|
|
344
|
+
failed: totalFailed,
|
|
345
|
+
total: documents.length,
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
/** Insert a pre-embedded sub-batch inside a single short transaction. */
|
|
349
|
+
async insertSubBatch(pool, subBatch, embeddings) {
|
|
350
|
+
const client = await pool.connect();
|
|
351
|
+
try {
|
|
352
|
+
await client.query('BEGIN');
|
|
353
|
+
for (let i = 0; i < subBatch.length; i++) {
|
|
354
|
+
const doc = subBatch[i];
|
|
355
|
+
const embedding = embeddings[i];
|
|
356
|
+
const projectId = doc.metadata?.projectId || 'default';
|
|
357
|
+
if (this.schemaDimensions && embedding.length !== this.schemaDimensions) {
|
|
358
|
+
throw new Error(`Embedding dimension mismatch: got ${embedding.length}, expected ${this.schemaDimensions}`);
|
|
359
|
+
}
|
|
360
|
+
const vectorString = `[${embedding.join(',')}]`;
|
|
361
|
+
if (this.bqEnabled) {
|
|
362
|
+
const bqString = this.floatsToBit(embedding);
|
|
363
|
+
await client.query(`INSERT INTO ${this.tableName} (id, project_id, content, metadata, embedding, embedding_bq)
|
|
364
|
+
VALUES ($1, $2, $3, $4, $5::vector, $6::bit(${this.schemaDimensions}))
|
|
365
|
+
ON CONFLICT (id) DO UPDATE SET
|
|
366
|
+
content = EXCLUDED.content,
|
|
367
|
+
metadata = EXCLUDED.metadata,
|
|
368
|
+
embedding = EXCLUDED.embedding,
|
|
369
|
+
embedding_bq = EXCLUDED.embedding_bq,
|
|
370
|
+
updated_at = NOW()`, [doc.id, projectId, doc.content, JSON.stringify(doc.metadata ?? {}), vectorString, bqString]);
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
await client.query(`INSERT INTO ${this.tableName} (id, project_id, content, metadata, embedding)
|
|
374
|
+
VALUES ($1, $2, $3, $4, $5::vector)
|
|
375
|
+
ON CONFLICT (id) DO UPDATE SET
|
|
376
|
+
content = EXCLUDED.content,
|
|
377
|
+
metadata = EXCLUDED.metadata,
|
|
378
|
+
embedding = EXCLUDED.embedding,
|
|
379
|
+
updated_at = NOW()`, [doc.id, projectId, doc.content, JSON.stringify(doc.metadata ?? {}), vectorString]);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
await client.query('COMMIT');
|
|
383
|
+
}
|
|
384
|
+
catch (error) {
|
|
385
|
+
await client.query('ROLLBACK');
|
|
386
|
+
throw error;
|
|
387
|
+
}
|
|
388
|
+
finally {
|
|
389
|
+
client.release();
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
// ── Search ─────────────────────────────────────────────────────────────────
|
|
393
|
+
async search(query, limit = 10, projectId) {
|
|
394
|
+
const embedding = await this.embedContent(query);
|
|
395
|
+
return this.searchByEmbedding(embedding, limit, projectId);
|
|
396
|
+
}
|
|
397
|
+
async searchByEmbedding(embedding, limit = 10, projectId) {
|
|
398
|
+
const pool = await this.ensureInitialized();
|
|
399
|
+
if (this.schemaDimensions && embedding.length !== this.schemaDimensions) {
|
|
400
|
+
throw new Error(`Embedding dimension mismatch: got ${embedding.length}, expected ${this.schemaDimensions}`);
|
|
401
|
+
}
|
|
402
|
+
if (this.bqEnabled) {
|
|
403
|
+
return this.searchTwoPhase(pool, embedding, limit, projectId);
|
|
404
|
+
}
|
|
405
|
+
return this.searchDirect(pool, embedding, limit, projectId);
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Direct cosine similarity search (for dims ≤ 2000 with HNSW index).
|
|
409
|
+
*/
|
|
410
|
+
async searchDirect(pool, embedding, limit, projectId) {
|
|
411
|
+
const vectorString = `[${embedding.join(',')}]`;
|
|
412
|
+
const queryText = projectId
|
|
413
|
+
? `SELECT id, content, metadata, 1 - (embedding <=> $1::vector) as similarity
|
|
414
|
+
FROM ${this.tableName} WHERE project_id = $2
|
|
415
|
+
ORDER BY embedding <=> $1::vector LIMIT $3`
|
|
416
|
+
: `SELECT id, content, metadata, 1 - (embedding <=> $1::vector) as similarity
|
|
417
|
+
FROM ${this.tableName}
|
|
418
|
+
ORDER BY embedding <=> $1::vector LIMIT $2`;
|
|
419
|
+
const params = projectId ? [vectorString, projectId, limit] : [vectorString, limit];
|
|
420
|
+
const { rows } = await pool.query(queryText, params);
|
|
421
|
+
return rows.map((row) => ({
|
|
422
|
+
id: row.id,
|
|
423
|
+
content: row.content,
|
|
424
|
+
score: this.normalizeScore(row.similarity),
|
|
425
|
+
source: SearchSource.VECTOR,
|
|
426
|
+
metadata: row.metadata,
|
|
427
|
+
}));
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Two-phase binary-quantization search (for dims > 2000).
|
|
431
|
+
*
|
|
432
|
+
* Phase 1: ANN using Hamming distance on bit column → `candidates` rows
|
|
433
|
+
* Phase 2: exact cosine re-rank on float vector → top `limit` rows
|
|
434
|
+
*/
|
|
435
|
+
async searchTwoPhase(pool, embedding, limit, projectId) {
|
|
436
|
+
const dims = this.schemaDimensions;
|
|
437
|
+
const bqQuery = this.floatsToBit(embedding);
|
|
438
|
+
const vectorString = `[${embedding.join(',')}]`;
|
|
439
|
+
// Fetch enough candidates so re-ranking is meaningful
|
|
440
|
+
const candidates = Math.min(limit * 20, 200);
|
|
441
|
+
// Phase 1: ANN on binary column
|
|
442
|
+
const phase1Text = projectId
|
|
443
|
+
? `SELECT id FROM ${this.tableName}
|
|
444
|
+
WHERE project_id = $2 AND embedding_bq IS NOT NULL
|
|
445
|
+
ORDER BY embedding_bq <~> $1::bit(${dims})
|
|
446
|
+
LIMIT $3`
|
|
447
|
+
: `SELECT id FROM ${this.tableName}
|
|
448
|
+
WHERE embedding_bq IS NOT NULL
|
|
449
|
+
ORDER BY embedding_bq <~> $1::bit(${dims})
|
|
450
|
+
LIMIT $2`;
|
|
451
|
+
const phase1Params = projectId ? [bqQuery, projectId, candidates] : [bqQuery, candidates];
|
|
452
|
+
const { rows: candidateRows } = await pool.query(phase1Text, phase1Params);
|
|
453
|
+
if (candidateRows.length === 0)
|
|
454
|
+
return [];
|
|
455
|
+
const candidateIds = candidateRows.map((r) => r.id);
|
|
456
|
+
const placeholders = candidateIds.map((_, i) => `$${i + 2}`).join(', ');
|
|
457
|
+
// Phase 2: exact re-rank among candidates
|
|
458
|
+
const { rows } = await pool.query(`SELECT id, content, metadata,
|
|
459
|
+
1 - (embedding <=> $1::vector) AS similarity
|
|
460
|
+
FROM ${this.tableName}
|
|
461
|
+
WHERE id IN (${placeholders})
|
|
462
|
+
ORDER BY embedding <=> $1::vector
|
|
463
|
+
LIMIT ${limit}`, [vectorString, ...candidateIds]);
|
|
464
|
+
return rows.map((row) => ({
|
|
465
|
+
id: row.id,
|
|
466
|
+
content: row.content,
|
|
467
|
+
score: this.normalizeScore(row.similarity),
|
|
468
|
+
source: SearchSource.VECTOR,
|
|
469
|
+
metadata: row.metadata,
|
|
470
|
+
}));
|
|
471
|
+
}
|
|
472
|
+
// ── Delete / update ────────────────────────────────────────────────────────
|
|
473
|
+
async delete(id) {
|
|
474
|
+
const pool = await this.ensureInitialized();
|
|
475
|
+
const { rowCount } = await pool.query(`DELETE FROM ${this.tableName} WHERE id = $1`, [id]);
|
|
476
|
+
return (rowCount ?? 0) > 0;
|
|
477
|
+
}
|
|
478
|
+
async deleteByProject(projectId) {
|
|
479
|
+
const pool = await this.ensureInitialized();
|
|
480
|
+
const { rowCount } = await pool.query(`DELETE FROM ${this.tableName} WHERE project_id = $1`, [projectId]);
|
|
481
|
+
return rowCount ?? 0;
|
|
482
|
+
}
|
|
483
|
+
async update(id, content, metadata) {
|
|
484
|
+
await this.delete(id);
|
|
485
|
+
await this.addDocument(id, content, metadata);
|
|
486
|
+
}
|
|
487
|
+
// ── Stats / metadata ───────────────────────────────────────────────────────
|
|
488
|
+
async getStats(projectId) {
|
|
489
|
+
const pool = await this.ensureInitialized();
|
|
490
|
+
const queryText = projectId
|
|
491
|
+
? `SELECT COUNT(*) as count,
|
|
492
|
+
SUM(LENGTH(content) + LENGTH(metadata::text) + COALESCE(LENGTH(embedding::text), 0)) as size
|
|
493
|
+
FROM ${this.tableName} WHERE project_id = $1`
|
|
494
|
+
: `SELECT COUNT(*) as count,
|
|
495
|
+
SUM(LENGTH(content) + LENGTH(metadata::text) + COALESCE(LENGTH(embedding::text), 0)) as size
|
|
496
|
+
FROM ${this.tableName}`;
|
|
497
|
+
const params = projectId ? [projectId] : [];
|
|
498
|
+
const { rows } = await pool.query(queryText, params);
|
|
499
|
+
const bqIndexName = `idx_${this.tableName}_embedding_bq`;
|
|
500
|
+
const floatIndexName = `idx_${this.tableName}_embedding`;
|
|
501
|
+
const activeIndex = this.bqEnabled ? bqIndexName : floatIndexName;
|
|
502
|
+
const { rows: idxRows } = await pool.query(`SELECT indexname FROM pg_indexes WHERE indexname = $1`, [activeIndex]);
|
|
503
|
+
return {
|
|
504
|
+
totalDocuments: parseInt(rows[0]?.count ?? '0'),
|
|
505
|
+
totalSize: parseInt(rows[0]?.size ?? '0'),
|
|
506
|
+
embeddingDimensions: this.schemaDimensions ?? undefined,
|
|
507
|
+
indexType: this.config.indexType,
|
|
508
|
+
indexStatus: idxRows.length > 0 ? 'ready' : 'none',
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
async listProjects() {
|
|
512
|
+
const pool = await this.ensureInitialized();
|
|
513
|
+
const { rows } = await pool.query(`
|
|
514
|
+
SELECT project_id,
|
|
515
|
+
COUNT(*) AS doc_count,
|
|
516
|
+
MAX(updated_at) AS last_updated,
|
|
517
|
+
SUM(LENGTH(content)) AS total_size
|
|
518
|
+
FROM ${this.tableName}
|
|
519
|
+
WHERE id NOT LIKE '_metadata:%'
|
|
520
|
+
GROUP BY project_id
|
|
521
|
+
ORDER BY last_updated DESC
|
|
522
|
+
`);
|
|
523
|
+
return rows.map((row) => ({
|
|
524
|
+
projectId: row.project_id,
|
|
525
|
+
projectPath: null,
|
|
526
|
+
documentCount: parseInt(row.doc_count),
|
|
527
|
+
totalSize: parseInt(row.total_size ?? '0'),
|
|
528
|
+
lastIndexed: row.last_updated?.toISOString() ?? null,
|
|
529
|
+
}));
|
|
530
|
+
}
|
|
531
|
+
// ── Misc ───────────────────────────────────────────────────────────────────
|
|
532
|
+
/**
|
|
533
|
+
* Get or create a collection (for IVectorStore interface compatibility).
|
|
534
|
+
*
|
|
535
|
+
* Mirrors PostgresVectorStore.getCollection semantics: returns a handle bound
|
|
536
|
+
* to this store's pool/table that scopes read/write by `name` (the projectId).
|
|
537
|
+
* IndexManager uses this for _metadata document lookup/persistence.
|
|
538
|
+
*/
|
|
539
|
+
async getCollection(name) {
|
|
540
|
+
const pool = await this.ensureInitialized();
|
|
541
|
+
return new PostgresVectorCollection(pool, name, this.tableName, this);
|
|
542
|
+
}
|
|
543
|
+
async healthCheck() {
|
|
544
|
+
try {
|
|
545
|
+
if (!this.pool)
|
|
546
|
+
return false;
|
|
547
|
+
const { rows } = await this.pool.query('SELECT 1');
|
|
548
|
+
return rows.length > 0;
|
|
549
|
+
}
|
|
550
|
+
catch {
|
|
551
|
+
return false;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
async close() {
|
|
555
|
+
if (this.pool) {
|
|
556
|
+
await this.pool.end();
|
|
557
|
+
this.pool = null;
|
|
558
|
+
this.initialized = false;
|
|
559
|
+
logger.info('PostgresVectorStore closed');
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
// ── Package-internal accessors for PostgresVectorCollection ─────────────────
|
|
563
|
+
/** Embedding dimensions declared by the table schema, or null if unknown. */
|
|
564
|
+
getSchemaDimensions() {
|
|
565
|
+
return this.schemaDimensions;
|
|
566
|
+
}
|
|
567
|
+
/** True when the table has the embedding_bq column + index. */
|
|
568
|
+
isBqEnabled() {
|
|
569
|
+
return this.bqEnabled;
|
|
570
|
+
}
|
|
571
|
+
/** Encode a float embedding to a pgvector bit-string (binary quantization). */
|
|
572
|
+
toBitString(embedding) {
|
|
573
|
+
return this.floatsToBit(embedding);
|
|
574
|
+
}
|
|
575
|
+
/** Batch-embed texts via the shared provider (exposed for the collection). */
|
|
576
|
+
async embedBatchPublic(contents) {
|
|
577
|
+
return this.embedBatch(contents);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* PostgreSQL Vector Collection implementation.
|
|
582
|
+
*
|
|
583
|
+
* Mirrors PostgreSQLVectorCollection semantics so IndexManager (the only caller of
|
|
584
|
+
* getCollection) works identically across backends. Scopes all read/write by
|
|
585
|
+
* `name` (the projectId). `query` supports the `where.id` fast path used for
|
|
586
|
+
* _metadata document lookup; `add` embeds content on demand when no embedding
|
|
587
|
+
* is supplied.
|
|
588
|
+
*/
|
|
589
|
+
class PostgresVectorCollection {
|
|
590
|
+
pool;
|
|
591
|
+
name;
|
|
592
|
+
tableName;
|
|
593
|
+
store;
|
|
594
|
+
constructor(pool, name, tableName, store) {
|
|
595
|
+
this.pool = pool;
|
|
596
|
+
this.name = name;
|
|
597
|
+
this.tableName = tableName;
|
|
598
|
+
this.store = store;
|
|
599
|
+
}
|
|
600
|
+
async count() {
|
|
601
|
+
const { rows } = await this.pool.query(`SELECT COUNT(*)::int AS count FROM ${this.tableName} WHERE project_id = $1`, [this.name]);
|
|
602
|
+
return rows[0]?.count || 0;
|
|
603
|
+
}
|
|
604
|
+
async query(params) {
|
|
605
|
+
const nResults = params?.nResults || 10;
|
|
606
|
+
const whereId = params?.where?.id;
|
|
607
|
+
// Fast path used by IndexManager for metadata lookup
|
|
608
|
+
if (whereId) {
|
|
609
|
+
const { rows } = await this.pool.query(`SELECT id, content, metadata
|
|
610
|
+
FROM ${this.tableName}
|
|
611
|
+
WHERE project_id = $1 AND id = $2
|
|
612
|
+
LIMIT $3`, [this.name, whereId, nResults]);
|
|
613
|
+
return rows.map((row) => ({
|
|
614
|
+
id: row.id,
|
|
615
|
+
content: row.content,
|
|
616
|
+
score: 1,
|
|
617
|
+
source: SearchSource.VECTOR,
|
|
618
|
+
metadata: typeof row.metadata === 'string' ? JSON.parse(row.metadata || '{}') : (row.metadata ?? {}),
|
|
619
|
+
}));
|
|
620
|
+
}
|
|
621
|
+
// Fallback: simple project-scoped fetch
|
|
622
|
+
const { rows } = await this.pool.query(`SELECT id, content, metadata
|
|
623
|
+
FROM ${this.tableName}
|
|
624
|
+
WHERE project_id = $1
|
|
625
|
+
ORDER BY updated_at DESC
|
|
626
|
+
LIMIT $2`, [this.name, nResults]);
|
|
627
|
+
return rows.map((row) => ({
|
|
628
|
+
id: row.id,
|
|
629
|
+
content: row.content,
|
|
630
|
+
score: 1,
|
|
631
|
+
source: SearchSource.VECTOR,
|
|
632
|
+
metadata: typeof row.metadata === 'string' ? JSON.parse(row.metadata || '{}') : (row.metadata ?? {}),
|
|
633
|
+
}));
|
|
634
|
+
}
|
|
635
|
+
async add(documents) {
|
|
636
|
+
if (!documents.length)
|
|
637
|
+
return;
|
|
638
|
+
// Embed any documents that arrived without a pre-computed embedding.
|
|
639
|
+
const needsEmbedding = documents.filter((d) => !d.embedding);
|
|
640
|
+
if (needsEmbedding.length > 0) {
|
|
641
|
+
const embeddings = await this.store.embedBatchPublic(needsEmbedding.map((d) => d.content));
|
|
642
|
+
needsEmbedding.forEach((d, i) => {
|
|
643
|
+
d.embedding = embeddings[i];
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
const schemaDims = this.store.getSchemaDimensions();
|
|
647
|
+
const bqEnabled = this.store.isBqEnabled();
|
|
648
|
+
const client = await this.pool.connect();
|
|
649
|
+
try {
|
|
650
|
+
await client.query('BEGIN');
|
|
651
|
+
for (const doc of documents) {
|
|
652
|
+
const embedding = doc.embedding;
|
|
653
|
+
const projectId = doc.metadata?.projectId || this.name;
|
|
654
|
+
if (schemaDims && embedding.length !== schemaDims) {
|
|
655
|
+
throw new Error(`Embedding dimension mismatch: got ${embedding.length}, expected ${schemaDims}`);
|
|
656
|
+
}
|
|
657
|
+
const vectorString = `[${embedding.join(',')}]`;
|
|
658
|
+
if (bqEnabled) {
|
|
659
|
+
const bqString = this.store.toBitString(embedding);
|
|
660
|
+
await client.query(`INSERT INTO ${this.tableName} (id, project_id, content, metadata, embedding, embedding_bq)
|
|
661
|
+
VALUES ($1, $2, $3, $4, $5::vector, $6::bit(${schemaDims}))
|
|
662
|
+
ON CONFLICT (id) DO UPDATE SET
|
|
663
|
+
content = EXCLUDED.content,
|
|
664
|
+
metadata = EXCLUDED.metadata,
|
|
665
|
+
embedding = EXCLUDED.embedding,
|
|
666
|
+
embedding_bq = EXCLUDED.embedding_bq,
|
|
667
|
+
updated_at = NOW()`, [doc.id, projectId, doc.content, JSON.stringify(doc.metadata ?? {}), vectorString, bqString]);
|
|
668
|
+
}
|
|
669
|
+
else {
|
|
670
|
+
await client.query(`INSERT INTO ${this.tableName} (id, project_id, content, metadata, embedding)
|
|
671
|
+
VALUES ($1, $2, $3, $4, $5::vector)
|
|
672
|
+
ON CONFLICT (id) DO UPDATE SET
|
|
673
|
+
content = EXCLUDED.content,
|
|
674
|
+
metadata = EXCLUDED.metadata,
|
|
675
|
+
embedding = EXCLUDED.embedding,
|
|
676
|
+
updated_at = NOW()`, [doc.id, projectId, doc.content, JSON.stringify(doc.metadata ?? {}), vectorString]);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
await client.query('COMMIT');
|
|
680
|
+
}
|
|
681
|
+
catch (error) {
|
|
682
|
+
await client.query('ROLLBACK');
|
|
683
|
+
throw error;
|
|
684
|
+
}
|
|
685
|
+
finally {
|
|
686
|
+
client.release();
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
async delete(ids) {
|
|
690
|
+
if (!ids.length)
|
|
691
|
+
return;
|
|
692
|
+
const client = await this.pool.connect();
|
|
693
|
+
try {
|
|
694
|
+
for (const id of ids) {
|
|
695
|
+
await client.query(`DELETE FROM ${this.tableName} WHERE id = $1 AND project_id = $2`, [id, this.name]);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
finally {
|
|
699
|
+
client.release();
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
//# sourceMappingURL=postgres-vector-store.js.map
|