rag-lite-ts 2.1.1 → 2.3.0
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/README.md +88 -5
- package/dist/{cli → cjs/cli}/indexer.js +73 -15
- package/dist/cjs/cli/ui-server.d.ts +5 -0
- package/dist/cjs/cli/ui-server.js +152 -0
- package/dist/{cli.js → cjs/cli.js} +25 -6
- package/dist/{core → cjs/core}/binary-index-format.js +6 -3
- package/dist/{core → cjs/core}/db.d.ts +56 -0
- package/dist/{core → cjs/core}/db.js +105 -0
- package/dist/{core → cjs/core}/ingestion.js +3 -0
- package/dist/cjs/core/knowledge-base-manager.d.ts +109 -0
- package/dist/cjs/core/knowledge-base-manager.js +256 -0
- package/dist/{core → cjs/core}/model-validator.js +1 -1
- package/dist/{core → cjs/core}/search-pipeline.js +1 -1
- package/dist/{core → cjs/core}/search.js +1 -1
- package/dist/cjs/core/vector-index-messages.d.ts +52 -0
- package/dist/cjs/core/vector-index-messages.js +5 -0
- package/dist/cjs/core/vector-index-worker.d.ts +6 -0
- package/dist/cjs/core/vector-index-worker.js +304 -0
- package/dist/cjs/core/vector-index.d.ts +107 -0
- package/dist/cjs/core/vector-index.js +344 -0
- package/dist/{factories → cjs/factories}/ingestion-factory.js +3 -7
- package/dist/{factories → cjs/factories}/search-factory.js +11 -0
- package/dist/{index-manager.d.ts → cjs/index-manager.d.ts} +23 -3
- package/dist/{index-manager.js → cjs/index-manager.js} +84 -15
- package/dist/{index.d.ts → cjs/index.d.ts} +2 -1
- package/dist/{index.js → cjs/index.js} +3 -1
- package/dist/esm/api-errors.d.ts +90 -0
- package/dist/esm/api-errors.js +320 -0
- package/dist/esm/cli/indexer.d.ts +11 -0
- package/dist/esm/cli/indexer.js +529 -0
- package/dist/esm/cli/search.d.ts +7 -0
- package/dist/esm/cli/search.js +332 -0
- package/dist/esm/cli/ui-server.d.ts +5 -0
- package/dist/esm/cli/ui-server.js +152 -0
- package/dist/esm/cli.d.ts +3 -0
- package/dist/esm/cli.js +548 -0
- package/dist/esm/config.d.ts +51 -0
- package/dist/esm/config.js +79 -0
- package/dist/esm/core/abstract-embedder.d.ts +125 -0
- package/dist/esm/core/abstract-embedder.js +264 -0
- package/dist/esm/core/actionable-error-messages.d.ts +60 -0
- package/dist/esm/core/actionable-error-messages.js +397 -0
- package/dist/esm/core/adapters.d.ts +93 -0
- package/dist/esm/core/adapters.js +139 -0
- package/dist/esm/core/batch-processing-optimizer.d.ts +155 -0
- package/dist/esm/core/batch-processing-optimizer.js +536 -0
- package/dist/esm/core/binary-index-format.d.ts +78 -0
- package/dist/esm/core/binary-index-format.js +294 -0
- package/dist/esm/core/chunker.d.ts +119 -0
- package/dist/esm/core/chunker.js +73 -0
- package/dist/esm/core/cli-database-utils.d.ts +53 -0
- package/dist/esm/core/cli-database-utils.js +239 -0
- package/dist/esm/core/config.d.ts +102 -0
- package/dist/esm/core/config.js +247 -0
- package/dist/esm/core/content-errors.d.ts +111 -0
- package/dist/esm/core/content-errors.js +362 -0
- package/dist/esm/core/content-manager.d.ts +335 -0
- package/dist/esm/core/content-manager.js +1476 -0
- package/dist/esm/core/content-performance-optimizer.d.ts +150 -0
- package/dist/esm/core/content-performance-optimizer.js +516 -0
- package/dist/esm/core/content-resolver.d.ts +104 -0
- package/dist/esm/core/content-resolver.js +285 -0
- package/dist/esm/core/cross-modal-search.d.ts +164 -0
- package/dist/esm/core/cross-modal-search.js +342 -0
- package/dist/esm/core/database-connection-manager.d.ts +109 -0
- package/dist/esm/core/database-connection-manager.js +310 -0
- package/dist/esm/core/db.d.ts +269 -0
- package/dist/esm/core/db.js +1000 -0
- package/dist/esm/core/embedder-factory.d.ts +154 -0
- package/dist/esm/core/embedder-factory.js +311 -0
- package/dist/esm/core/error-handler.d.ts +112 -0
- package/dist/esm/core/error-handler.js +239 -0
- package/dist/esm/core/index.d.ts +59 -0
- package/dist/esm/core/index.js +69 -0
- package/dist/esm/core/ingestion.d.ts +202 -0
- package/dist/esm/core/ingestion.js +904 -0
- package/dist/esm/core/interfaces.d.ts +408 -0
- package/dist/esm/core/interfaces.js +106 -0
- package/dist/esm/core/knowledge-base-manager.d.ts +109 -0
- package/dist/esm/core/knowledge-base-manager.js +256 -0
- package/dist/esm/core/lazy-dependency-loader.d.ts +147 -0
- package/dist/esm/core/lazy-dependency-loader.js +435 -0
- package/dist/esm/core/mode-detection-service.d.ts +150 -0
- package/dist/esm/core/mode-detection-service.js +565 -0
- package/dist/esm/core/mode-model-validator.d.ts +92 -0
- package/dist/esm/core/mode-model-validator.js +203 -0
- package/dist/esm/core/model-registry.d.ts +116 -0
- package/dist/esm/core/model-registry.js +411 -0
- package/dist/esm/core/model-validator.d.ts +217 -0
- package/dist/esm/core/model-validator.js +782 -0
- package/dist/esm/core/path-manager.d.ts +47 -0
- package/dist/esm/core/path-manager.js +71 -0
- package/dist/esm/core/raglite-paths.d.ts +121 -0
- package/dist/esm/core/raglite-paths.js +145 -0
- package/dist/esm/core/reranking-config.d.ts +42 -0
- package/dist/esm/core/reranking-config.js +147 -0
- package/dist/esm/core/reranking-factory.d.ts +92 -0
- package/dist/esm/core/reranking-factory.js +410 -0
- package/dist/esm/core/reranking-strategies.d.ts +310 -0
- package/dist/esm/core/reranking-strategies.js +650 -0
- package/dist/esm/core/resource-cleanup.d.ts +163 -0
- package/dist/esm/core/resource-cleanup.js +371 -0
- package/dist/esm/core/resource-manager.d.ts +212 -0
- package/dist/esm/core/resource-manager.js +564 -0
- package/dist/esm/core/search-pipeline.d.ts +111 -0
- package/dist/esm/core/search-pipeline.js +287 -0
- package/dist/esm/core/search.d.ts +141 -0
- package/dist/esm/core/search.js +320 -0
- package/dist/esm/core/streaming-operations.d.ts +145 -0
- package/dist/esm/core/streaming-operations.js +409 -0
- package/dist/esm/core/types.d.ts +66 -0
- package/dist/esm/core/types.js +6 -0
- package/dist/esm/core/universal-embedder.d.ts +177 -0
- package/dist/esm/core/universal-embedder.js +139 -0
- package/dist/esm/core/validation-messages.d.ts +99 -0
- package/dist/esm/core/validation-messages.js +334 -0
- package/dist/esm/core/vector-index-messages.d.ts +52 -0
- package/dist/esm/core/vector-index-messages.js +5 -0
- package/dist/esm/core/vector-index-worker.d.ts +6 -0
- package/dist/esm/core/vector-index-worker.js +304 -0
- package/dist/esm/core/vector-index.d.ts +107 -0
- package/dist/esm/core/vector-index.js +344 -0
- package/dist/esm/dom-polyfills.d.ts +6 -0
- package/dist/esm/dom-polyfills.js +37 -0
- package/dist/esm/factories/index.d.ts +27 -0
- package/dist/esm/factories/index.js +29 -0
- package/dist/esm/factories/ingestion-factory.d.ts +200 -0
- package/dist/esm/factories/ingestion-factory.js +473 -0
- package/dist/esm/factories/search-factory.d.ts +154 -0
- package/dist/esm/factories/search-factory.js +355 -0
- package/dist/esm/file-processor.d.ts +147 -0
- package/dist/esm/file-processor.js +963 -0
- package/dist/esm/index-manager.d.ts +136 -0
- package/dist/esm/index-manager.js +667 -0
- package/dist/esm/index.d.ts +76 -0
- package/dist/esm/index.js +112 -0
- package/dist/esm/indexer.d.ts +7 -0
- package/dist/esm/indexer.js +54 -0
- package/dist/esm/ingestion.d.ts +63 -0
- package/dist/esm/ingestion.js +124 -0
- package/dist/esm/mcp-server.d.ts +46 -0
- package/dist/esm/mcp-server.js +1820 -0
- package/dist/esm/multimodal/clip-embedder.d.ts +327 -0
- package/dist/esm/multimodal/clip-embedder.js +996 -0
- package/dist/esm/multimodal/index.d.ts +6 -0
- package/dist/esm/multimodal/index.js +6 -0
- package/dist/esm/preprocess.d.ts +19 -0
- package/dist/esm/preprocess.js +203 -0
- package/dist/esm/preprocessors/index.d.ts +17 -0
- package/dist/esm/preprocessors/index.js +38 -0
- package/dist/esm/preprocessors/mdx.d.ts +25 -0
- package/dist/esm/preprocessors/mdx.js +101 -0
- package/dist/esm/preprocessors/mermaid.d.ts +68 -0
- package/dist/esm/preprocessors/mermaid.js +329 -0
- package/dist/esm/preprocessors/registry.d.ts +56 -0
- package/dist/esm/preprocessors/registry.js +179 -0
- package/dist/esm/run-error-recovery-tests.d.ts +7 -0
- package/dist/esm/run-error-recovery-tests.js +101 -0
- package/dist/esm/search-standalone.d.ts +7 -0
- package/dist/esm/search-standalone.js +117 -0
- package/dist/esm/search.d.ts +99 -0
- package/dist/esm/search.js +177 -0
- package/dist/esm/test-utils.d.ts +18 -0
- package/dist/esm/test-utils.js +27 -0
- package/dist/esm/text/chunker.d.ts +33 -0
- package/dist/esm/text/chunker.js +279 -0
- package/dist/esm/text/embedder.d.ts +111 -0
- package/dist/esm/text/embedder.js +386 -0
- package/dist/esm/text/index.d.ts +8 -0
- package/dist/esm/text/index.js +9 -0
- package/dist/esm/text/preprocessors/index.d.ts +17 -0
- package/dist/esm/text/preprocessors/index.js +38 -0
- package/dist/esm/text/preprocessors/mdx.d.ts +25 -0
- package/dist/esm/text/preprocessors/mdx.js +101 -0
- package/dist/esm/text/preprocessors/mermaid.d.ts +68 -0
- package/dist/esm/text/preprocessors/mermaid.js +330 -0
- package/dist/esm/text/preprocessors/registry.d.ts +56 -0
- package/dist/esm/text/preprocessors/registry.js +180 -0
- package/dist/esm/text/reranker.d.ts +49 -0
- package/dist/esm/text/reranker.js +274 -0
- package/dist/esm/text/sentence-transformer-embedder.d.ts +96 -0
- package/dist/esm/text/sentence-transformer-embedder.js +340 -0
- package/dist/esm/text/tokenizer.d.ts +22 -0
- package/dist/esm/text/tokenizer.js +64 -0
- package/dist/esm/types.d.ts +83 -0
- package/dist/esm/types.js +3 -0
- package/dist/esm/utils/vector-math.d.ts +31 -0
- package/dist/esm/utils/vector-math.js +70 -0
- package/package.json +39 -14
- package/dist/core/vector-index.d.ts +0 -72
- package/dist/core/vector-index.js +0 -331
- /package/dist/{api-errors.d.ts → cjs/api-errors.d.ts} +0 -0
- /package/dist/{api-errors.js → cjs/api-errors.js} +0 -0
- /package/dist/{cli → cjs/cli}/indexer.d.ts +0 -0
- /package/dist/{cli → cjs/cli}/search.d.ts +0 -0
- /package/dist/{cli → cjs/cli}/search.js +0 -0
- /package/dist/{cli.d.ts → cjs/cli.d.ts} +0 -0
- /package/dist/{config.d.ts → cjs/config.d.ts} +0 -0
- /package/dist/{config.js → cjs/config.js} +0 -0
- /package/dist/{core → cjs/core}/abstract-embedder.d.ts +0 -0
- /package/dist/{core → cjs/core}/abstract-embedder.js +0 -0
- /package/dist/{core → cjs/core}/actionable-error-messages.d.ts +0 -0
- /package/dist/{core → cjs/core}/actionable-error-messages.js +0 -0
- /package/dist/{core → cjs/core}/adapters.d.ts +0 -0
- /package/dist/{core → cjs/core}/adapters.js +0 -0
- /package/dist/{core → cjs/core}/batch-processing-optimizer.d.ts +0 -0
- /package/dist/{core → cjs/core}/batch-processing-optimizer.js +0 -0
- /package/dist/{core → cjs/core}/binary-index-format.d.ts +0 -0
- /package/dist/{core → cjs/core}/chunker.d.ts +0 -0
- /package/dist/{core → cjs/core}/chunker.js +0 -0
- /package/dist/{core → cjs/core}/cli-database-utils.d.ts +0 -0
- /package/dist/{core → cjs/core}/cli-database-utils.js +0 -0
- /package/dist/{core → cjs/core}/config.d.ts +0 -0
- /package/dist/{core → cjs/core}/config.js +0 -0
- /package/dist/{core → cjs/core}/content-errors.d.ts +0 -0
- /package/dist/{core → cjs/core}/content-errors.js +0 -0
- /package/dist/{core → cjs/core}/content-manager.d.ts +0 -0
- /package/dist/{core → cjs/core}/content-manager.js +0 -0
- /package/dist/{core → cjs/core}/content-performance-optimizer.d.ts +0 -0
- /package/dist/{core → cjs/core}/content-performance-optimizer.js +0 -0
- /package/dist/{core → cjs/core}/content-resolver.d.ts +0 -0
- /package/dist/{core → cjs/core}/content-resolver.js +0 -0
- /package/dist/{core → cjs/core}/cross-modal-search.d.ts +0 -0
- /package/dist/{core → cjs/core}/cross-modal-search.js +0 -0
- /package/dist/{core → cjs/core}/database-connection-manager.d.ts +0 -0
- /package/dist/{core → cjs/core}/database-connection-manager.js +0 -0
- /package/dist/{core → cjs/core}/embedder-factory.d.ts +0 -0
- /package/dist/{core → cjs/core}/embedder-factory.js +0 -0
- /package/dist/{core → cjs/core}/error-handler.d.ts +0 -0
- /package/dist/{core → cjs/core}/error-handler.js +0 -0
- /package/dist/{core → cjs/core}/index.d.ts +0 -0
- /package/dist/{core → cjs/core}/index.js +0 -0
- /package/dist/{core → cjs/core}/ingestion.d.ts +0 -0
- /package/dist/{core → cjs/core}/interfaces.d.ts +0 -0
- /package/dist/{core → cjs/core}/interfaces.js +0 -0
- /package/dist/{core → cjs/core}/lazy-dependency-loader.d.ts +0 -0
- /package/dist/{core → cjs/core}/lazy-dependency-loader.js +0 -0
- /package/dist/{core → cjs/core}/mode-detection-service.d.ts +0 -0
- /package/dist/{core → cjs/core}/mode-detection-service.js +0 -0
- /package/dist/{core → cjs/core}/mode-model-validator.d.ts +0 -0
- /package/dist/{core → cjs/core}/mode-model-validator.js +0 -0
- /package/dist/{core → cjs/core}/model-registry.d.ts +0 -0
- /package/dist/{core → cjs/core}/model-registry.js +0 -0
- /package/dist/{core → cjs/core}/model-validator.d.ts +0 -0
- /package/dist/{core → cjs/core}/path-manager.d.ts +0 -0
- /package/dist/{core → cjs/core}/path-manager.js +0 -0
- /package/dist/{core → cjs/core}/raglite-paths.d.ts +0 -0
- /package/dist/{core → cjs/core}/raglite-paths.js +0 -0
- /package/dist/{core → cjs/core}/reranking-config.d.ts +0 -0
- /package/dist/{core → cjs/core}/reranking-config.js +0 -0
- /package/dist/{core → cjs/core}/reranking-factory.d.ts +0 -0
- /package/dist/{core → cjs/core}/reranking-factory.js +0 -0
- /package/dist/{core → cjs/core}/reranking-strategies.d.ts +0 -0
- /package/dist/{core → cjs/core}/reranking-strategies.js +0 -0
- /package/dist/{core → cjs/core}/resource-cleanup.d.ts +0 -0
- /package/dist/{core → cjs/core}/resource-cleanup.js +0 -0
- /package/dist/{core → cjs/core}/resource-manager.d.ts +0 -0
- /package/dist/{core → cjs/core}/resource-manager.js +0 -0
- /package/dist/{core → cjs/core}/search-pipeline.d.ts +0 -0
- /package/dist/{core → cjs/core}/search.d.ts +0 -0
- /package/dist/{core → cjs/core}/streaming-operations.d.ts +0 -0
- /package/dist/{core → cjs/core}/streaming-operations.js +0 -0
- /package/dist/{core → cjs/core}/types.d.ts +0 -0
- /package/dist/{core → cjs/core}/types.js +0 -0
- /package/dist/{core → cjs/core}/universal-embedder.d.ts +0 -0
- /package/dist/{core → cjs/core}/universal-embedder.js +0 -0
- /package/dist/{core → cjs/core}/validation-messages.d.ts +0 -0
- /package/dist/{core → cjs/core}/validation-messages.js +0 -0
- /package/dist/{dom-polyfills.d.ts → cjs/dom-polyfills.d.ts} +0 -0
- /package/dist/{dom-polyfills.js → cjs/dom-polyfills.js} +0 -0
- /package/dist/{factories → cjs/factories}/index.d.ts +0 -0
- /package/dist/{factories → cjs/factories}/index.js +0 -0
- /package/dist/{factories → cjs/factories}/ingestion-factory.d.ts +0 -0
- /package/dist/{factories → cjs/factories}/search-factory.d.ts +0 -0
- /package/dist/{file-processor.d.ts → cjs/file-processor.d.ts} +0 -0
- /package/dist/{file-processor.js → cjs/file-processor.js} +0 -0
- /package/dist/{indexer.d.ts → cjs/indexer.d.ts} +0 -0
- /package/dist/{indexer.js → cjs/indexer.js} +0 -0
- /package/dist/{ingestion.d.ts → cjs/ingestion.d.ts} +0 -0
- /package/dist/{ingestion.js → cjs/ingestion.js} +0 -0
- /package/dist/{mcp-server.d.ts → cjs/mcp-server.d.ts} +0 -0
- /package/dist/{mcp-server.js → cjs/mcp-server.js} +0 -0
- /package/dist/{multimodal → cjs/multimodal}/clip-embedder.d.ts +0 -0
- /package/dist/{multimodal → cjs/multimodal}/clip-embedder.js +0 -0
- /package/dist/{multimodal → cjs/multimodal}/index.d.ts +0 -0
- /package/dist/{multimodal → cjs/multimodal}/index.js +0 -0
- /package/dist/{preprocess.d.ts → cjs/preprocess.d.ts} +0 -0
- /package/dist/{preprocess.js → cjs/preprocess.js} +0 -0
- /package/dist/{preprocessors → cjs/preprocessors}/index.d.ts +0 -0
- /package/dist/{preprocessors → cjs/preprocessors}/index.js +0 -0
- /package/dist/{preprocessors → cjs/preprocessors}/mdx.d.ts +0 -0
- /package/dist/{preprocessors → cjs/preprocessors}/mdx.js +0 -0
- /package/dist/{preprocessors → cjs/preprocessors}/mermaid.d.ts +0 -0
- /package/dist/{preprocessors → cjs/preprocessors}/mermaid.js +0 -0
- /package/dist/{preprocessors → cjs/preprocessors}/registry.d.ts +0 -0
- /package/dist/{preprocessors → cjs/preprocessors}/registry.js +0 -0
- /package/dist/{run-error-recovery-tests.d.ts → cjs/run-error-recovery-tests.d.ts} +0 -0
- /package/dist/{run-error-recovery-tests.js → cjs/run-error-recovery-tests.js} +0 -0
- /package/dist/{search-standalone.d.ts → cjs/search-standalone.d.ts} +0 -0
- /package/dist/{search-standalone.js → cjs/search-standalone.js} +0 -0
- /package/dist/{search.d.ts → cjs/search.d.ts} +0 -0
- /package/dist/{search.js → cjs/search.js} +0 -0
- /package/dist/{test-utils.d.ts → cjs/test-utils.d.ts} +0 -0
- /package/dist/{test-utils.js → cjs/test-utils.js} +0 -0
- /package/dist/{text → cjs/text}/chunker.d.ts +0 -0
- /package/dist/{text → cjs/text}/chunker.js +0 -0
- /package/dist/{text → cjs/text}/embedder.d.ts +0 -0
- /package/dist/{text → cjs/text}/embedder.js +0 -0
- /package/dist/{text → cjs/text}/index.d.ts +0 -0
- /package/dist/{text → cjs/text}/index.js +0 -0
- /package/dist/{text → cjs/text}/preprocessors/index.d.ts +0 -0
- /package/dist/{text → cjs/text}/preprocessors/index.js +0 -0
- /package/dist/{text → cjs/text}/preprocessors/mdx.d.ts +0 -0
- /package/dist/{text → cjs/text}/preprocessors/mdx.js +0 -0
- /package/dist/{text → cjs/text}/preprocessors/mermaid.d.ts +0 -0
- /package/dist/{text → cjs/text}/preprocessors/mermaid.js +0 -0
- /package/dist/{text → cjs/text}/preprocessors/registry.d.ts +0 -0
- /package/dist/{text → cjs/text}/preprocessors/registry.js +0 -0
- /package/dist/{text → cjs/text}/reranker.d.ts +0 -0
- /package/dist/{text → cjs/text}/reranker.js +0 -0
- /package/dist/{text → cjs/text}/sentence-transformer-embedder.d.ts +0 -0
- /package/dist/{text → cjs/text}/sentence-transformer-embedder.js +0 -0
- /package/dist/{text → cjs/text}/tokenizer.d.ts +0 -0
- /package/dist/{text → cjs/text}/tokenizer.js +0 -0
- /package/dist/{types.d.ts → cjs/types.d.ts} +0 -0
- /package/dist/{types.js → cjs/types.js} +0 -0
- /package/dist/{utils → cjs/utils}/vector-math.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/vector-math.js +0 -0
package/package.json
CHANGED
|
@@ -1,35 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rag-lite-ts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Local-first TypeScript retrieval engine with Chameleon Multimodal Architecture for semantic search over text and image content",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
6
|
+
"main": "./dist/cjs/index.js",
|
|
7
|
+
"types": "./dist/cjs/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"raglite": "./dist/cli.js",
|
|
10
|
-
"raglite-mcp": "./dist/mcp-server.js"
|
|
9
|
+
"raglite": "./dist/esm/cli.js",
|
|
10
|
+
"raglite-mcp": "./dist/esm/mcp-server.js"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"types": "./dist/esm/index.d.ts",
|
|
15
|
+
"import": {
|
|
16
|
+
"types": "./dist/esm/index.d.ts",
|
|
17
|
+
"default": "./dist/esm/index.js"
|
|
18
|
+
},
|
|
19
|
+
"require": {
|
|
20
|
+
"types": "./dist/cjs/index.d.ts",
|
|
21
|
+
"default": "./dist/cjs/index.js"
|
|
22
|
+
}
|
|
16
23
|
},
|
|
17
24
|
"./mcp": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
25
|
+
"types": "./dist/esm/mcp-server.d.ts",
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./dist/esm/mcp-server.d.ts",
|
|
28
|
+
"default": "./dist/esm/mcp-server.js"
|
|
29
|
+
},
|
|
30
|
+
"require": {
|
|
31
|
+
"types": "./dist/cjs/mcp-server.d.ts",
|
|
32
|
+
"default": "./dist/cjs/mcp-server.js"
|
|
33
|
+
}
|
|
20
34
|
}
|
|
21
35
|
},
|
|
22
36
|
"files": [
|
|
23
|
-
"dist/**/*.js",
|
|
24
|
-
"dist/**/*.
|
|
37
|
+
"dist/esm/**/*.js",
|
|
38
|
+
"dist/cjs/**/*.js",
|
|
39
|
+
"dist/esm/**/*.d.ts",
|
|
40
|
+
"dist/cjs/**/*.d.ts",
|
|
25
41
|
"!dist/**/*.map",
|
|
42
|
+
"ui/backend/dist/**",
|
|
43
|
+
"ui/frontend/dist/**",
|
|
44
|
+
"!ui/**/src/**",
|
|
45
|
+
"!ui/**/node_modules/**",
|
|
26
46
|
"README.md",
|
|
27
47
|
"LICENSE"
|
|
28
48
|
],
|
|
29
49
|
"scripts": {
|
|
30
|
-
"build": "
|
|
50
|
+
"build": "npm run build:esm && npm run build:cjs",
|
|
51
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
|
52
|
+
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
31
53
|
"build:test": "tsc --project tsconfig.test.json",
|
|
32
|
-
"
|
|
54
|
+
"build:ui:backend": "cd ui/backend && npm run build",
|
|
55
|
+
"build:ui:frontend": "cd ui/frontend && npm run build",
|
|
56
|
+
"build:ui": "npm run build:ui:backend && npm run build:ui:frontend",
|
|
57
|
+
"clean": "rimraf dist ui/backend/dist ui/frontend/dist",
|
|
33
58
|
"dev": "tsc --watch",
|
|
34
59
|
"test": "npm run build:test && node --expose-gc --test --test-concurrency=1 dist/__tests__/core dist/__tests__/text dist/__tests__/preprocessors dist/__tests__/cli dist/__tests__/factories",
|
|
35
60
|
"test:verbose": "npm run build:test && node --expose-gc --test --test-concurrency=1 --test-reporter=tap dist/__tests__/core dist/__tests__/text dist/__tests__/preprocessors dist/__tests__/cli dist/__tests__/factories",
|
|
@@ -45,7 +70,7 @@
|
|
|
45
70
|
"test:integration:verbose": "npm run build && npm run build:test && node --expose-gc --test --test-concurrency=1 --test-reporter=tap dist/__tests__/integration",
|
|
46
71
|
"test:all": "npm run build:test && node --expose-gc --test --test-concurrency=1 dist/__tests__",
|
|
47
72
|
"test:all:verbose": "npm run build:test && node --expose-gc --test --test-concurrency=1 --test-reporter=tap dist/__tests__",
|
|
48
|
-
"prepublishOnly": "npm run clean && npm run build"
|
|
73
|
+
"prepublishOnly": "npm run clean && npm run build && npm run build:ui"
|
|
49
74
|
},
|
|
50
75
|
"keywords": [
|
|
51
76
|
"rag",
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CORE MODULE — Shared between text-only (rag-lite-ts) and future multimodal (rag-lite-mm)
|
|
3
|
-
* Model-agnostic. No transformer or modality-specific logic.
|
|
4
|
-
*/
|
|
5
|
-
export interface VectorIndexOptions {
|
|
6
|
-
dimensions: number;
|
|
7
|
-
maxElements: number;
|
|
8
|
-
efConstruction?: number;
|
|
9
|
-
M?: number;
|
|
10
|
-
seed?: number;
|
|
11
|
-
}
|
|
12
|
-
export interface SearchResult {
|
|
13
|
-
neighbors: number[];
|
|
14
|
-
distances: number[];
|
|
15
|
-
}
|
|
16
|
-
export declare class VectorIndex {
|
|
17
|
-
private index;
|
|
18
|
-
private hnswlib;
|
|
19
|
-
private indexPath;
|
|
20
|
-
private options;
|
|
21
|
-
private currentSize;
|
|
22
|
-
private vectorStorage;
|
|
23
|
-
constructor(indexPath: string, options: VectorIndexOptions);
|
|
24
|
-
/**
|
|
25
|
-
* Initialize the HNSW index with cosine similarity using hnswlib-wasm
|
|
26
|
-
*/
|
|
27
|
-
initialize(): Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* Load existing index from file using hnswlib-wasm
|
|
30
|
-
*/
|
|
31
|
-
loadIndex(): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Save index to binary format
|
|
34
|
-
*/
|
|
35
|
-
saveIndex(): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Add a single vector to the HNSW index
|
|
38
|
-
*/
|
|
39
|
-
addVector(embeddingId: number, vector: Float32Array): void;
|
|
40
|
-
/**
|
|
41
|
-
* Add multiple vectors to the index in batch
|
|
42
|
-
*/
|
|
43
|
-
addVectors(vectors: Array<{
|
|
44
|
-
id: number;
|
|
45
|
-
vector: Float32Array;
|
|
46
|
-
}>): void;
|
|
47
|
-
/**
|
|
48
|
-
* Search for k nearest neighbors using hnswlib-wasm
|
|
49
|
-
*/
|
|
50
|
-
search(queryVector: Float32Array, k?: number): SearchResult;
|
|
51
|
-
/**
|
|
52
|
-
* Get current number of vectors in the index
|
|
53
|
-
*/
|
|
54
|
-
getCurrentCount(): number;
|
|
55
|
-
/**
|
|
56
|
-
* Check if index exists on disk
|
|
57
|
-
*/
|
|
58
|
-
indexExists(): boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Set search parameters for query time
|
|
61
|
-
*/
|
|
62
|
-
setEf(ef: number): void;
|
|
63
|
-
/**
|
|
64
|
-
* Resize index to accommodate more vectors
|
|
65
|
-
*/
|
|
66
|
-
resizeIndex(newMaxElements: number): void;
|
|
67
|
-
/**
|
|
68
|
-
* Get index options (for external access to configuration)
|
|
69
|
-
*/
|
|
70
|
-
getOptions(): VectorIndexOptions;
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=vector-index.d.ts.map
|
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CORE MODULE — Shared between text-only (rag-lite-ts) and future multimodal (rag-lite-mm)
|
|
3
|
-
* Model-agnostic. No transformer or modality-specific logic.
|
|
4
|
-
*/
|
|
5
|
-
import { existsSync } from 'fs';
|
|
6
|
-
import { JSDOM } from 'jsdom';
|
|
7
|
-
import { ErrorCategory, ErrorSeverity, safeExecute } from './error-handler.js';
|
|
8
|
-
import { createMissingFileError, createDimensionMismatchError } from './actionable-error-messages.js';
|
|
9
|
-
import { BinaryIndexFormat } from './binary-index-format.js';
|
|
10
|
-
// Set up browser-like environment for hnswlib-wasm
|
|
11
|
-
if (typeof window === 'undefined') {
|
|
12
|
-
const dom = new JSDOM('<!DOCTYPE html><html><body></body></html>', {
|
|
13
|
-
url: 'http://localhost',
|
|
14
|
-
pretendToBeVisual: true,
|
|
15
|
-
resources: 'usable'
|
|
16
|
-
});
|
|
17
|
-
// Type assertion to avoid TypeScript issues with global polyfills
|
|
18
|
-
global.window = dom.window;
|
|
19
|
-
global.document = dom.window.document;
|
|
20
|
-
global.XMLHttpRequest = dom.window.XMLHttpRequest;
|
|
21
|
-
// Disable IndexedDB to prevent hnswlib-wasm from trying to use it
|
|
22
|
-
global.indexedDB = undefined;
|
|
23
|
-
// Override indexedDB on the window object to return undefined
|
|
24
|
-
Object.defineProperty(dom.window, 'indexedDB', {
|
|
25
|
-
value: undefined,
|
|
26
|
-
writable: false,
|
|
27
|
-
configurable: true
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
export class VectorIndex {
|
|
31
|
-
index = null;
|
|
32
|
-
hnswlib = null;
|
|
33
|
-
indexPath;
|
|
34
|
-
options;
|
|
35
|
-
currentSize = 0;
|
|
36
|
-
vectorStorage = new Map(); // For persistence
|
|
37
|
-
constructor(indexPath, options) {
|
|
38
|
-
this.indexPath = indexPath;
|
|
39
|
-
this.options = {
|
|
40
|
-
efConstruction: 200,
|
|
41
|
-
M: 16,
|
|
42
|
-
seed: 100,
|
|
43
|
-
...options
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Initialize the HNSW index with cosine similarity using hnswlib-wasm
|
|
48
|
-
*/
|
|
49
|
-
async initialize() {
|
|
50
|
-
await safeExecute(async () => {
|
|
51
|
-
// Load the hnswlib module
|
|
52
|
-
if (!this.hnswlib) {
|
|
53
|
-
// Temporarily suppress stderr output during hnswlib loading to avoid IndexedDB warnings
|
|
54
|
-
const originalStderrWrite = process.stderr.write;
|
|
55
|
-
const originalConsoleError = console.error;
|
|
56
|
-
process.stderr.write = function (chunk, encoding, callback) {
|
|
57
|
-
const message = chunk.toString();
|
|
58
|
-
// Suppress specific IndexedDB/IDBFS related errors and WebAssembly errors
|
|
59
|
-
if (message.includes('IDBFS') || message.includes('indexedDB not supported') ||
|
|
60
|
-
message.includes('EmscriptenFileSystemManager') || message.includes('Aborted') ||
|
|
61
|
-
message.includes('jsFS Error') || message.includes('syncing FS') ||
|
|
62
|
-
message.includes('RuntimeError: unreachable') || message.includes('___trap') ||
|
|
63
|
-
message.includes('abort') || message.includes('assert') ||
|
|
64
|
-
message.includes('hnswlib-wasm/dist/hnswlib')) {
|
|
65
|
-
if (callback)
|
|
66
|
-
callback();
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
return originalStderrWrite.call(this, chunk, encoding, callback);
|
|
70
|
-
};
|
|
71
|
-
console.error = (...args) => {
|
|
72
|
-
const message = args.join(' ');
|
|
73
|
-
if (message.includes('IDBFS') || message.includes('indexedDB not supported') ||
|
|
74
|
-
message.includes('EmscriptenFileSystemManager') || message.includes('Aborted') ||
|
|
75
|
-
message.includes('jsFS Error') || message.includes('syncing FS') ||
|
|
76
|
-
message.includes('RuntimeError: unreachable') || message.includes('___trap') ||
|
|
77
|
-
message.includes('abort') || message.includes('assert') ||
|
|
78
|
-
message.includes('hnswlib-wasm/dist/hnswlib')) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
originalConsoleError.apply(console, args);
|
|
82
|
-
};
|
|
83
|
-
try {
|
|
84
|
-
const { loadHnswlib } = await import('hnswlib-wasm/dist/hnswlib.js');
|
|
85
|
-
this.hnswlib = await loadHnswlib();
|
|
86
|
-
}
|
|
87
|
-
finally {
|
|
88
|
-
// Restore original output streams
|
|
89
|
-
process.stderr.write = originalStderrWrite;
|
|
90
|
-
console.error = originalConsoleError;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
// Create new HNSW index (third parameter is autoSaveFilename, but we'll handle persistence manually)
|
|
94
|
-
this.index = new this.hnswlib.HierarchicalNSW('cosine', this.options.dimensions, '');
|
|
95
|
-
this.index.initIndex(this.options.maxElements, this.options.M || 16, this.options.efConstruction || 200, this.options.seed || 100);
|
|
96
|
-
this.currentSize = 0;
|
|
97
|
-
console.log(`Initialized HNSW index with ${this.options.dimensions} dimensions using hnswlib-wasm`);
|
|
98
|
-
}, 'Vector Index Initialization', {
|
|
99
|
-
category: ErrorCategory.INDEX,
|
|
100
|
-
severity: ErrorSeverity.FATAL
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Load existing index from file using hnswlib-wasm
|
|
105
|
-
*/
|
|
106
|
-
async loadIndex() {
|
|
107
|
-
if (!existsSync(this.indexPath)) {
|
|
108
|
-
throw createMissingFileError(this.indexPath, 'index', {
|
|
109
|
-
operationContext: 'VectorIndex.loadIndex'
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
try {
|
|
113
|
-
// Load the hnswlib module
|
|
114
|
-
if (!this.hnswlib) {
|
|
115
|
-
// Temporarily suppress stderr output during hnswlib loading to avoid IndexedDB warnings
|
|
116
|
-
const originalStderrWrite = process.stderr.write;
|
|
117
|
-
const originalConsoleError = console.error;
|
|
118
|
-
process.stderr.write = function (chunk, encoding, callback) {
|
|
119
|
-
const message = chunk.toString();
|
|
120
|
-
// Suppress specific IndexedDB/IDBFS related errors and WebAssembly errors
|
|
121
|
-
if (message.includes('IDBFS') || message.includes('indexedDB not supported') ||
|
|
122
|
-
message.includes('EmscriptenFileSystemManager') || message.includes('Aborted') ||
|
|
123
|
-
message.includes('jsFS Error') || message.includes('syncing FS') ||
|
|
124
|
-
message.includes('RuntimeError: unreachable') || message.includes('___trap') ||
|
|
125
|
-
message.includes('abort') || message.includes('assert') ||
|
|
126
|
-
message.includes('hnswlib-wasm/dist/hnswlib')) {
|
|
127
|
-
if (callback)
|
|
128
|
-
callback();
|
|
129
|
-
return true;
|
|
130
|
-
}
|
|
131
|
-
return originalStderrWrite.call(this, chunk, encoding, callback);
|
|
132
|
-
};
|
|
133
|
-
console.error = (...args) => {
|
|
134
|
-
const message = args.join(' ');
|
|
135
|
-
if (message.includes('IDBFS') || message.includes('indexedDB not supported') ||
|
|
136
|
-
message.includes('EmscriptenFileSystemManager') || message.includes('Aborted') ||
|
|
137
|
-
message.includes('jsFS Error') || message.includes('syncing FS') ||
|
|
138
|
-
message.includes('RuntimeError: unreachable') || message.includes('___trap') ||
|
|
139
|
-
message.includes('abort') || message.includes('assert') ||
|
|
140
|
-
message.includes('hnswlib-wasm/dist/hnswlib')) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
originalConsoleError.apply(console, args);
|
|
144
|
-
};
|
|
145
|
-
try {
|
|
146
|
-
const { loadHnswlib } = await import('hnswlib-wasm/dist/hnswlib.js');
|
|
147
|
-
this.hnswlib = await loadHnswlib();
|
|
148
|
-
}
|
|
149
|
-
finally {
|
|
150
|
-
// Restore original output streams
|
|
151
|
-
process.stderr.write = originalStderrWrite;
|
|
152
|
-
console.error = originalConsoleError;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
// Create new HNSW index (third parameter is autoSaveFilename, but we'll handle persistence manually)
|
|
156
|
-
this.index = new this.hnswlib.HierarchicalNSW('cosine', this.options.dimensions, '');
|
|
157
|
-
// Load from binary format
|
|
158
|
-
const data = await BinaryIndexFormat.load(this.indexPath);
|
|
159
|
-
// Validate dimensions
|
|
160
|
-
if (data.dimensions !== this.options.dimensions) {
|
|
161
|
-
console.log(`⚠️ Dimension mismatch detected:`);
|
|
162
|
-
console.log(` Stored dimensions: ${data.dimensions}`);
|
|
163
|
-
console.log(` Expected dimensions: ${this.options.dimensions}`);
|
|
164
|
-
console.log(` Number of vectors: ${data.vectors.length}`);
|
|
165
|
-
if (data.vectors.length > 0) {
|
|
166
|
-
console.log(` Actual vector length: ${data.vectors[0].vector.length}`);
|
|
167
|
-
}
|
|
168
|
-
throw createDimensionMismatchError(this.options.dimensions, data.dimensions, 'vector index loading', { operationContext: 'VectorIndex.loadIndex' });
|
|
169
|
-
}
|
|
170
|
-
// Update options from stored data
|
|
171
|
-
this.options.maxElements = data.maxElements;
|
|
172
|
-
this.options.M = data.M;
|
|
173
|
-
this.options.efConstruction = data.efConstruction;
|
|
174
|
-
this.options.seed = data.seed;
|
|
175
|
-
// Initialize HNSW index
|
|
176
|
-
this.index.initIndex(this.options.maxElements, this.options.M, this.options.efConstruction, this.options.seed);
|
|
177
|
-
// Clear and repopulate vector storage
|
|
178
|
-
this.vectorStorage.clear();
|
|
179
|
-
// Add all stored vectors to HNSW index
|
|
180
|
-
for (const item of data.vectors) {
|
|
181
|
-
this.index.addPoint(item.vector, item.id, false);
|
|
182
|
-
this.vectorStorage.set(item.id, item.vector);
|
|
183
|
-
}
|
|
184
|
-
this.currentSize = data.currentSize;
|
|
185
|
-
console.log(`✓ Loaded HNSW index with ${this.currentSize} vectors from ${this.indexPath}`);
|
|
186
|
-
}
|
|
187
|
-
catch (error) {
|
|
188
|
-
throw new Error(`Failed to load index from ${this.indexPath}: ${error}`);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Save index to binary format
|
|
193
|
-
*/
|
|
194
|
-
async saveIndex() {
|
|
195
|
-
if (!this.index) {
|
|
196
|
-
throw new Error('Index not initialized');
|
|
197
|
-
}
|
|
198
|
-
try {
|
|
199
|
-
// Collect all vectors from storage
|
|
200
|
-
const vectors = Array.from(this.vectorStorage.entries()).map(([id, vector]) => ({
|
|
201
|
-
id,
|
|
202
|
-
vector
|
|
203
|
-
}));
|
|
204
|
-
// Save to binary format
|
|
205
|
-
await BinaryIndexFormat.save(this.indexPath, {
|
|
206
|
-
dimensions: this.options.dimensions,
|
|
207
|
-
maxElements: this.options.maxElements,
|
|
208
|
-
M: this.options.M || 16,
|
|
209
|
-
efConstruction: this.options.efConstruction || 200,
|
|
210
|
-
seed: this.options.seed || 100,
|
|
211
|
-
currentSize: this.currentSize,
|
|
212
|
-
vectors
|
|
213
|
-
});
|
|
214
|
-
console.log(`✓ Saved HNSW index with ${this.currentSize} vectors to ${this.indexPath}`);
|
|
215
|
-
}
|
|
216
|
-
catch (error) {
|
|
217
|
-
throw new Error(`Failed to save index to ${this.indexPath}: ${error}`);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Add a single vector to the HNSW index
|
|
222
|
-
*/
|
|
223
|
-
addVector(embeddingId, vector) {
|
|
224
|
-
if (!this.index) {
|
|
225
|
-
throw new Error('Index not initialized');
|
|
226
|
-
}
|
|
227
|
-
if (vector.length !== this.options.dimensions) {
|
|
228
|
-
throw createDimensionMismatchError(this.options.dimensions, vector.length, 'vector addition', { operationContext: 'VectorIndex.addVector' });
|
|
229
|
-
}
|
|
230
|
-
try {
|
|
231
|
-
this.index.addPoint(vector, embeddingId, false);
|
|
232
|
-
// Store vector for persistence
|
|
233
|
-
this.vectorStorage.set(embeddingId, new Float32Array(vector));
|
|
234
|
-
this.currentSize++;
|
|
235
|
-
}
|
|
236
|
-
catch (error) {
|
|
237
|
-
throw new Error(`Failed to add vector ${embeddingId}: ${error}`);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Add multiple vectors to the index in batch
|
|
242
|
-
*/
|
|
243
|
-
addVectors(vectors) {
|
|
244
|
-
for (const { id, vector } of vectors) {
|
|
245
|
-
this.addVector(id, vector);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Search for k nearest neighbors using hnswlib-wasm
|
|
250
|
-
*/
|
|
251
|
-
search(queryVector, k = 5) {
|
|
252
|
-
if (!this.index) {
|
|
253
|
-
throw new Error('Index not initialized');
|
|
254
|
-
}
|
|
255
|
-
if (queryVector.length !== this.options.dimensions) {
|
|
256
|
-
throw createDimensionMismatchError(this.options.dimensions, queryVector.length, 'vector search', { operationContext: 'VectorIndex.search' });
|
|
257
|
-
}
|
|
258
|
-
if (this.currentSize === 0) {
|
|
259
|
-
return { neighbors: [], distances: [] };
|
|
260
|
-
}
|
|
261
|
-
try {
|
|
262
|
-
const result = this.index.searchKnn(queryVector, Math.min(k, this.currentSize), undefined);
|
|
263
|
-
return {
|
|
264
|
-
neighbors: result.neighbors,
|
|
265
|
-
distances: result.distances
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
catch (error) {
|
|
269
|
-
throw new Error(`Search failed: ${error}`);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Get current number of vectors in the index
|
|
274
|
-
*/
|
|
275
|
-
getCurrentCount() {
|
|
276
|
-
return this.currentSize;
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Check if index exists on disk
|
|
280
|
-
*/
|
|
281
|
-
indexExists() {
|
|
282
|
-
return existsSync(this.indexPath);
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Set search parameters for query time
|
|
286
|
-
*/
|
|
287
|
-
setEf(ef) {
|
|
288
|
-
if (!this.index) {
|
|
289
|
-
throw new Error('Index not initialized');
|
|
290
|
-
}
|
|
291
|
-
try {
|
|
292
|
-
// hnswlib-wasm might not have setEf method, check if it exists
|
|
293
|
-
if (typeof this.index.setEfSearch === 'function') {
|
|
294
|
-
this.index.setEfSearch(ef);
|
|
295
|
-
console.log(`Set efSearch to ${ef}`);
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
console.log(`setEfSearch not available in hnswlib-wasm`);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
catch (error) {
|
|
302
|
-
console.log(`Failed to set ef: ${error}`);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Resize index to accommodate more vectors
|
|
307
|
-
*/
|
|
308
|
-
resizeIndex(newMaxElements) {
|
|
309
|
-
if (!this.index) {
|
|
310
|
-
throw new Error('Index not initialized');
|
|
311
|
-
}
|
|
312
|
-
if (newMaxElements <= this.options.maxElements) {
|
|
313
|
-
throw new Error(`New max elements (${newMaxElements}) must be greater than current (${this.options.maxElements})`);
|
|
314
|
-
}
|
|
315
|
-
try {
|
|
316
|
-
this.index.resizeIndex(newMaxElements);
|
|
317
|
-
this.options.maxElements = newMaxElements;
|
|
318
|
-
console.log(`Resized index to accommodate ${newMaxElements} vectors`);
|
|
319
|
-
}
|
|
320
|
-
catch (error) {
|
|
321
|
-
throw new Error(`Failed to resize index: ${error}`);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Get index options (for external access to configuration)
|
|
326
|
-
*/
|
|
327
|
-
getOptions() {
|
|
328
|
-
return { ...this.options };
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
//# sourceMappingURL=vector-index.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|