@remnic/core 9.3.603 → 9.3.605
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/access-cli.js +9 -9
- package/dist/access-schema.d.ts +34 -34
- package/dist/{chunk-JTDRJQ3K.js → chunk-6JGNHWCI.js} +2 -2
- package/dist/{chunk-M6I5Z4SR.js → chunk-6ZZP4EJF.js} +2 -2
- package/dist/{chunk-75O6YQ63.js → chunk-G6R5UD3Q.js} +10 -3
- package/dist/chunk-G6R5UD3Q.js.map +1 -0
- package/dist/{chunk-I4UNL747.js → chunk-GMAG2HS4.js} +7 -3
- package/dist/chunk-GMAG2HS4.js.map +1 -0
- package/dist/{chunk-5SQ5CQJP.js → chunk-HSVJGWYS.js} +2 -2
- package/dist/{chunk-RUYYYLDT.js → chunk-IOTENEVL.js} +3 -3
- package/dist/{chunk-M46RYSMW.js → chunk-JHMFYY7L.js} +5 -2
- package/dist/chunk-JHMFYY7L.js.map +1 -0
- package/dist/{chunk-2ESBDLT5.js → chunk-VJXSUAO7.js} +2 -2
- package/dist/{chunk-Z5AAYHUC.js → chunk-VOUOLGIP.js} +13 -2
- package/dist/chunk-VOUOLGIP.js.map +1 -0
- package/dist/{chunk-OB6353F7.js → chunk-XPSVGJYA.js} +4 -4
- package/dist/{chunk-MTGOAU7A.js → chunk-YJ6QCQNE.js} +336 -300
- package/dist/chunk-YJ6QCQNE.js.map +1 -0
- package/dist/{chunk-6PTSXBPE.js → chunk-ZDTVJXIP.js} +5 -2
- package/dist/chunk-ZDTVJXIP.js.map +1 -0
- package/dist/cli.js +8 -8
- package/dist/{first-start-migration-CKTCTCQI.js → first-start-migration-GYJWIH36.js} +2 -2
- package/dist/index.js +12 -12
- package/dist/namespaces/migrate.js +6 -6
- package/dist/namespaces/search.js +5 -5
- package/dist/operator-toolkit.js +7 -7
- package/dist/orchestrator.js +9 -9
- package/dist/retrieval-agents.js +2 -2
- package/dist/schemas.d.ts +42 -42
- package/dist/search/factory.js +4 -4
- package/dist/search/index.js +4 -4
- package/dist/search/lancedb-backend.d.ts +1 -0
- package/dist/search/lancedb-backend.js +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -0
- package/dist/search/meilisearch-backend.js +1 -1
- package/dist/search/orama-backend.d.ts +1 -0
- package/dist/search/orama-backend.js +1 -1
- package/dist/search/port.d.ts +1 -0
- package/dist/shared-context/manager.d.ts +2 -2
- package/dist/temporal-index.js +1 -1
- package/dist/tier-migration.d.ts +1 -0
- package/dist/tier-migration.js +1 -1
- package/package.json +1 -1
- package/src/orchestrator.ts +51 -8
- package/src/search/lancedb-backend.ts +5 -1
- package/src/search/meilisearch-backend.ts +7 -2
- package/src/search/orama-backend.ts +5 -1
- package/src/search/port.ts +1 -0
- package/src/temporal-index.test.ts +30 -1
- package/src/temporal-index.ts +10 -3
- package/src/tier-migration.ts +13 -2
- package/dist/chunk-6PTSXBPE.js.map +0 -1
- package/dist/chunk-75O6YQ63.js.map +0 -1
- package/dist/chunk-I4UNL747.js.map +0 -1
- package/dist/chunk-M46RYSMW.js.map +0 -1
- package/dist/chunk-MTGOAU7A.js.map +0 -1
- package/dist/chunk-Z5AAYHUC.js.map +0 -1
- /package/dist/{chunk-JTDRJQ3K.js.map → chunk-6JGNHWCI.js.map} +0 -0
- /package/dist/{chunk-M6I5Z4SR.js.map → chunk-6ZZP4EJF.js.map} +0 -0
- /package/dist/{chunk-5SQ5CQJP.js.map → chunk-HSVJGWYS.js.map} +0 -0
- /package/dist/{chunk-RUYYYLDT.js.map → chunk-IOTENEVL.js.map} +0 -0
- /package/dist/{chunk-2ESBDLT5.js.map → chunk-VJXSUAO7.js.map} +0 -0
- /package/dist/{chunk-OB6353F7.js.map → chunk-XPSVGJYA.js.map} +0 -0
- /package/dist/{first-start-migration-CKTCTCQI.js.map → first-start-migration-GYJWIH36.js.map} +0 -0
|
@@ -96,11 +96,14 @@ var LanceDbBackend = class {
|
|
|
96
96
|
await this.updateCollection(this.collection, execution);
|
|
97
97
|
}
|
|
98
98
|
async updateCollection(collection, execution) {
|
|
99
|
+
await this.updateCollectionFromDir(collection, this.memoryDir, execution);
|
|
100
|
+
}
|
|
101
|
+
async updateCollectionFromDir(collection, memoryDir, execution) {
|
|
99
102
|
if (isSearchAborted(execution)) return;
|
|
100
103
|
let table = await this.ensureTableForCollection(collection);
|
|
101
104
|
if (isSearchAborted(execution)) return;
|
|
102
105
|
if (!table) return;
|
|
103
|
-
const docs = await scanMemoryDir(
|
|
106
|
+
const docs = await scanMemoryDir(memoryDir);
|
|
104
107
|
if (isSearchAborted(execution)) return;
|
|
105
108
|
if (docs.length === 0) {
|
|
106
109
|
try {
|
|
@@ -480,4 +483,4 @@ function isMissingVectorProviderColumnError(err) {
|
|
|
480
483
|
export {
|
|
481
484
|
LanceDbBackend
|
|
482
485
|
};
|
|
483
|
-
//# sourceMappingURL=chunk-
|
|
486
|
+
//# sourceMappingURL=chunk-ZDTVJXIP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/search/lancedb-backend.ts"],"sourcesContent":["import { log } from \"../logger.js\";\nimport type { SearchBackend, SearchExecutionOptions, SearchQueryOptions, SearchResult } from \"./port.js\";\nimport type { EmbedHelper, EmbedProviderIdentity, EmbedWithProviderResult } from \"./embed-helper.js\";\nimport { scanMemoryDir } from \"./document-scanner.js\";\nimport { isSearchAborted, throwIfSearchAborted } from \"./abort.js\";\n\nexport interface LanceDbBackendOptions {\n dbPath: string;\n collection: string;\n embedHelper: EmbedHelper;\n memoryDir: string;\n embeddingDimension: number;\n}\n\n/**\n * LanceDB search backend — embedded hybrid FTS+vector with RRF reranking.\n *\n * Uses @lancedb/lancedb for native Arrow-backed storage.\n * One table per collection. Supports full-text, vector, and hybrid search.\n */\nexport class LanceDbBackend implements SearchBackend {\n private readonly dbPath: string;\n private readonly collection: string;\n private readonly embedHelper: EmbedHelper;\n private readonly memoryDir: string;\n private readonly embeddingDimension: number;\n private available = false;\n private db: any = null;\n private lanceModule: any = null;\n private readonly vectorProviderCompatibility = new WeakMap<\n object,\n { providerIdentity: EmbedProviderIdentity; compatible: boolean }\n >();\n\n constructor(opts: LanceDbBackendOptions) {\n this.dbPath = opts.dbPath;\n this.collection = opts.collection;\n this.embedHelper = opts.embedHelper;\n this.memoryDir = opts.memoryDir;\n this.embeddingDimension = opts.embeddingDimension;\n }\n\n async probe(): Promise<boolean> {\n try {\n await this.ensureDb();\n this.available = true;\n return true;\n } catch (err) {\n log.debug(`LanceDbBackend probe failed: ${err}`);\n this.available = false;\n return false;\n }\n }\n\n isAvailable(): boolean {\n return this.available;\n }\n\n debugStatus(): string {\n return `backend=lancedb available=${this.available} dbPath=${this.dbPath}`;\n }\n\n async search(\n query: string,\n _collection?: string,\n maxResults?: number,\n _options?: SearchQueryOptions,\n execution?: SearchExecutionOptions,\n ): Promise<SearchResult[]> {\n return this.hybridSearch(query, _collection, maxResults, execution);\n }\n\n async searchGlobal(query: string, maxResults?: number, execution?: SearchExecutionOptions): Promise<SearchResult[]> {\n const limit = maxResults ?? 10;\n if (!this.available) return [];\n\n try {\n throwIfSearchAborted(execution, \"LanceDbBackend global search aborted\");\n const db = await this.ensureDb();\n const tableNames = await db.tableNames();\n const allResults: SearchResult[] = [];\n\n for (const name of tableNames) {\n throwIfSearchAborted(execution, \"LanceDbBackend global search aborted\");\n try {\n const table = await db.openTable(name);\n const results = await this.searchTable(table, query, \"hybrid\", limit, execution);\n allResults.push(...results);\n } catch {\n // Skip tables that fail\n }\n }\n\n allResults.sort((a, b) => b.score - a.score);\n return allResults.slice(0, limit);\n } catch (err) {\n log.debug(`LanceDbBackend searchGlobal failed: ${err}`);\n return [];\n }\n }\n\n async bm25Search(query: string, collection?: string, maxResults?: number, execution?: SearchExecutionOptions): Promise<SearchResult[]> {\n if (isSearchAborted(execution)) return [];\n const table = await this.ensureTableForCollection(collection ?? this.collection);\n if (isSearchAborted(execution)) return [];\n if (!table) return [];\n return this.searchTable(table, query, \"fts\", maxResults ?? 10, execution);\n }\n\n async vectorSearch(query: string, collection?: string, maxResults?: number, execution?: SearchExecutionOptions): Promise<SearchResult[]> {\n if (isSearchAborted(execution)) return [];\n const table = await this.ensureTableForCollection(collection ?? this.collection);\n if (isSearchAborted(execution)) return [];\n if (!table) return [];\n return this.searchTable(table, query, \"vector\", maxResults ?? 10, execution);\n }\n\n async hybridSearch(query: string, collection?: string, maxResults?: number, execution?: SearchExecutionOptions): Promise<SearchResult[]> {\n if (isSearchAborted(execution)) return [];\n const table = await this.ensureTableForCollection(collection ?? this.collection);\n if (isSearchAborted(execution)) return [];\n if (!table) return [];\n return this.searchTable(table, query, \"hybrid\", maxResults ?? 10, execution);\n }\n\n async update(execution?: SearchExecutionOptions): Promise<void> {\n await this.updateCollection(this.collection, execution);\n }\n\n async updateCollection(collection: string, execution?: SearchExecutionOptions): Promise<void> {\n await this.updateCollectionFromDir(collection, this.memoryDir, execution);\n }\n\n async updateCollectionFromDir(collection: string, memoryDir: string, execution?: SearchExecutionOptions): Promise<void> {\n if (isSearchAborted(execution)) return;\n let table = await this.ensureTableForCollection(collection);\n if (isSearchAborted(execution)) return;\n if (!table) return;\n\n const docs = await scanMemoryDir(memoryDir);\n if (isSearchAborted(execution)) return;\n if (docs.length === 0) {\n // Clear stale data when no docs remain\n try {\n const db = await this.ensureDb();\n await db.dropTable(collection).catch(() => {});\n if (collection === this.collection) this.table = null;\n } catch {\n // Best-effort cleanup\n }\n return;\n }\n\n const embeddingProviderIdentity = this.embedHelper.getProviderIdentity();\n const existingVectors = new Map<string, {\n vector: number[];\n providerIdentity?: string;\n }>();\n const vectorProviderColumnState = await this.tableVectorProviderColumnState(table);\n if (vectorProviderColumnState === \"missing\") {\n table = await this.recreateTableForCollection(collection);\n if (isSearchAborted(execution)) return;\n if (!table) return;\n } else if (vectorProviderColumnState === \"present\") {\n try {\n const existingRows = await table.query().select([\"docid\", \"vector\", \"vectorProvider\"]).toArray();\n for (const row of existingRows ?? []) {\n if (isSearchAborted(execution)) return;\n const docid = row.docid;\n if (typeof docid !== \"string\") continue;\n const vector = row.vector;\n if (!vector || typeof vector !== \"object\") continue;\n existingVectors.set(docid, {\n vector: Array.from(vector as ArrayLike<number>),\n providerIdentity: typeof row.vectorProvider === \"string\" ? row.vectorProvider : undefined,\n });\n }\n } catch {\n log.debug(\"LanceDbBackend skipped refresh after vector preservation failed\");\n return;\n }\n } else {\n log.debug(\"LanceDbBackend skipped vector preservation after vectorProvider probe failed\");\n return;\n }\n\n const rows = docs.map((d) => {\n const existing = existingVectors.get(d.docid);\n const canPreserveVector =\n existing &&\n this.isCompatibleStoredVector(existing.vector) &&\n (!embeddingProviderIdentity ||\n existing.providerIdentity === embeddingProviderIdentity);\n return {\n docid: d.docid,\n path: d.path,\n content: d.content,\n snippet: d.snippet,\n vector: canPreserveVector\n ? existing.vector\n : new Array(this.embeddingDimension).fill(0),\n vectorProvider: canPreserveVector\n ? existing.providerIdentity ?? \"\"\n : \"\",\n };\n });\n\n try {\n if (isSearchAborted(execution)) return;\n await table.add(rows, { mode: \"overwrite\" });\n this.rememberVectorProviderCompatibility(\n table,\n embeddingProviderIdentity,\n rows.length > 0 && rows.every((row) => row.vectorProvider === embeddingProviderIdentity),\n );\n if (isSearchAborted(execution)) return;\n // Create FTS index on content column\n try {\n await table.createIndex(\"content\", { config: this.lanceIndex.fts() });\n } catch {\n // FTS index creation may fail on some platforms — degrade gracefully\n }\n if (collection === this.collection) this.table = table;\n } catch (err) {\n log.debug(`LanceDbBackend update failed: ${err}`);\n }\n }\n\n async embed(): Promise<void> {\n await this.embedCollection(this.collection);\n }\n\n async embedCollection(collection: string): Promise<void> {\n if (!this.embedHelper.isAvailable()) return;\n\n const table = await this.ensureTableForCollection(collection);\n if (!table) return;\n\n try {\n const embeddingProviderIdentity = this.embedHelper.getProviderIdentity();\n const allRows = await table.query().select([\"docid\", \"content\", \"vector\", \"vectorProvider\"]).toArray();\n const needsEmbed = allRows.filter((row: any) => {\n if (embeddingProviderIdentity && row.vectorProvider !== embeddingProviderIdentity) {\n return true;\n }\n return !this.isCompatibleStoredVector(row.vector);\n });\n\n if (needsEmbed.length === 0) {\n this.rememberVectorProviderCompatibility(table, embeddingProviderIdentity, true);\n return;\n }\n\n let rowsToEmbed = needsEmbed;\n let embedResult = await this.embedHelper.embedBatchWithProvider(\n rowsToEmbed.map((row: any) => row.content as string),\n );\n if (!embedResult) return;\n if (\n embeddingProviderIdentity &&\n embedResult.providerIdentity !== embeddingProviderIdentity\n ) {\n const effectiveProviderIdentity = embedResult.providerIdentity;\n const originalDocids = new Set(rowsToEmbed.map((row: any) => row.docid));\n const effectiveNeedsEmbed = allRows.filter((row: any) => (\n row.vectorProvider !== effectiveProviderIdentity ||\n !this.isCompatibleStoredVector(row.vector)\n ));\n const sameRows =\n effectiveNeedsEmbed.length === rowsToEmbed.length &&\n effectiveNeedsEmbed.every((row: any) => originalDocids.has(row.docid));\n if (!sameRows) {\n const effectiveTexts = effectiveNeedsEmbed.map((row: any) => row.content as string);\n const effectiveEmbedResult = await this.embedHelper.embedBatchWithProvider(effectiveTexts);\n if (effectiveEmbedResult) {\n rowsToEmbed = effectiveNeedsEmbed;\n embedResult = effectiveEmbedResult;\n }\n }\n }\n const { vectors, providerIdentity } = embedResult;\n\n let allEmbedded = true;\n for (let i = 0; i < rowsToEmbed.length; i++) {\n const vec = vectors[i];\n if (!this.isExpectedDimensionVector(vec)) {\n allEmbedded = false;\n continue;\n }\n const docid = rowsToEmbed[i].docid;\n await table.update({\n where: `docid = '${docid.replace(/'/g, \"''\")}'`,\n values: { vector: vec, vectorProvider: providerIdentity },\n });\n }\n if (allEmbedded) {\n this.rememberVectorProviderCompatibility(table, providerIdentity, true);\n } else {\n this.rememberVectorProviderCompatibility(table, providerIdentity, false);\n }\n } catch (err) {\n log.debug(`LanceDbBackend embed failed: ${err}`);\n }\n }\n\n async ensureCollection(\n _memoryDir: string,\n _execution?: SearchExecutionOptions,\n ): Promise<\"present\" | \"missing\" | \"unknown\" | \"skipped\"> {\n try {\n await this.ensureTable();\n return \"present\";\n } catch {\n return \"missing\";\n }\n }\n\n private table: any = null;\n\n private get lanceIndex(): any {\n return this.lanceModule.Index ?? this.lanceModule.default?.Index;\n }\n\n private async ensureDb(): Promise<any> {\n if (this.db) return this.db;\n if (!this.lanceModule) {\n this.lanceModule = await import(\"@lancedb/lancedb\");\n }\n const connect = this.lanceModule.connect ?? this.lanceModule.default?.connect;\n this.db = await connect(this.dbPath);\n return this.db;\n }\n\n private async ensureTableForCollection(collection: string): Promise<any> {\n // For the default collection, use the cached instance\n if (collection === this.collection) return this.ensureTable();\n\n const db = await this.ensureDb();\n const tables = await db.tableNames();\n\n if (tables.includes(collection)) {\n return await db.openTable(collection);\n }\n\n // Create empty table with schema\n const emptyRow = {\n docid: \"__placeholder__\",\n path: \"\",\n content: \"\",\n snippet: \"\",\n vector: new Array(this.embeddingDimension).fill(0),\n vectorProvider: \"\",\n };\n const newTable = await db.createTable(collection, [emptyRow]);\n try {\n await newTable.createIndex(\"content\", { config: this.lanceIndex.fts() });\n } catch {\n // FTS index creation may fail — degrade gracefully\n }\n try {\n await newTable.delete(\"docid = '__placeholder__'\");\n } catch {\n // May fail if delete isn't supported on empty-ish tables\n }\n return newTable;\n }\n\n private async recreateTableForCollection(collection: string): Promise<any> {\n const db = await this.ensureDb();\n try {\n await db.dropTable(collection).catch(() => {});\n } catch {\n // Best-effort legacy schema migration; table creation below may still recover.\n }\n if (collection === this.collection) this.table = null;\n return this.ensureTableForCollection(collection);\n }\n\n private async tableVectorProviderColumnState(table: any): Promise<\"present\" | \"missing\" | \"unknown\"> {\n try {\n await table.query().select([\"vectorProvider\"]).toArray();\n return \"present\";\n } catch (err) {\n if (isMissingVectorProviderColumnError(err)) {\n return \"missing\";\n }\n log.debug(`LanceDbBackend vectorProvider column probe failed: ${err}`);\n return \"unknown\";\n }\n }\n\n private async ensureTable(): Promise<any> {\n if (this.table) return this.table;\n\n const db = await this.ensureDb();\n const tables = await db.tableNames();\n\n if (tables.includes(this.collection)) {\n this.table = await db.openTable(this.collection);\n return this.table;\n }\n\n // Create empty table with schema\n const emptyRow = {\n docid: \"__placeholder__\",\n path: \"\",\n content: \"\",\n snippet: \"\",\n vector: new Array(this.embeddingDimension).fill(0),\n vectorProvider: \"\",\n };\n this.table = await db.createTable(this.collection, [emptyRow]);\n // Create FTS index on content column\n try {\n await this.table.createIndex(\"content\", { config: this.lanceIndex.fts() });\n } catch {\n // FTS index creation may fail — degrade gracefully\n }\n // Remove placeholder row\n try {\n await this.table.delete(\"docid = '__placeholder__'\");\n } catch {\n // May fail if delete isn't supported on empty-ish tables\n }\n return this.table;\n }\n\n private async searchTable(\n table: any,\n query: string,\n mode: \"fts\" | \"vector\" | \"hybrid\",\n limit: number,\n execution?: SearchExecutionOptions,\n ): Promise<SearchResult[]> {\n try {\n throwIfSearchAborted(execution, `LanceDbBackend ${mode} search aborted`);\n if (mode === \"fts\") {\n const results = await table.search(query, \"fts\").limit(limit).toArray();\n throwIfSearchAborted(execution, `LanceDbBackend ${mode} search aborted`);\n return this.mapRows(results);\n }\n\n if (mode === \"vector\") {\n const embedResult = await this.resolveCompatibleQueryEmbedding(table, query, execution);\n throwIfSearchAborted(execution, `LanceDbBackend ${mode} search aborted`);\n if (!embedResult) {\n // Fall back to FTS\n const results = await table.search(query, \"fts\").limit(limit).toArray();\n throwIfSearchAborted(execution, `LanceDbBackend ${mode} search aborted`);\n return this.mapRows(results);\n }\n const results = await table.search(embedResult.vector).limit(limit).toArray();\n throwIfSearchAborted(execution, `LanceDbBackend ${mode} search aborted`);\n return this.mapRows(results);\n }\n\n // hybrid — try FTS+vector with RRF reranking\n const embedResult = await this.resolveCompatibleQueryEmbedding(table, query, execution);\n throwIfSearchAborted(execution, `LanceDbBackend ${mode} search aborted`);\n if (!embedResult) {\n const results = await table.search(query, \"fts\").limit(limit).toArray();\n throwIfSearchAborted(execution, `LanceDbBackend ${mode} search aborted`);\n return this.mapRows(results);\n }\n\n try {\n const results = await table\n .search(query, \"hybrid\")\n .vector(embedResult.vector)\n .limit(limit)\n .toArray();\n throwIfSearchAborted(execution, `LanceDbBackend ${mode} search aborted`);\n return this.mapRows(results);\n } catch {\n // Hybrid may not be supported in all LanceDB versions — fall back to vector\n const results = await table.search(embedResult.vector).limit(limit).toArray();\n throwIfSearchAborted(execution, `LanceDbBackend ${mode} search aborted`);\n return this.mapRows(results);\n }\n } catch (err) {\n log.debug(`LanceDbBackend search (${mode}) failed: ${err}`);\n return [];\n }\n }\n\n private async resolveCompatibleQueryEmbedding(\n table: any,\n query: string,\n execution?: SearchExecutionOptions,\n ): Promise<EmbedWithProviderResult | null> {\n const embedResult = await this.embedHelper.embedWithProvider(query, { signal: execution?.signal });\n throwIfSearchAborted(execution, \"LanceDbBackend query embedding aborted\");\n if (!embedResult || !this.isExpectedDimensionVector(embedResult.vector)) return null;\n\n const storedProviderIdentity = await this.findCompatibleStoredVectorProvider(table, execution);\n if (!storedProviderIdentity) {\n this.rememberVectorProviderCompatibility(table, embedResult.providerIdentity, false);\n return null;\n }\n if (storedProviderIdentity === embedResult.providerIdentity) return embedResult;\n\n const fallbackEmbed = await this.embedQueryWithStoredFallbackProvider(query, storedProviderIdentity, execution);\n throwIfSearchAborted(execution, \"LanceDbBackend fallback query embedding aborted\");\n if (\n fallbackEmbed &&\n fallbackEmbed.providerIdentity === storedProviderIdentity &&\n this.isExpectedDimensionVector(fallbackEmbed.vector)\n ) {\n return fallbackEmbed;\n }\n\n this.rememberVectorProviderCompatibility(table, embedResult.providerIdentity, false);\n return null;\n }\n\n private async embedQueryWithStoredFallbackProvider(\n query: string,\n providerIdentity: EmbedProviderIdentity,\n execution?: SearchExecutionOptions,\n ): Promise<EmbedWithProviderResult | null> {\n const embedWithIdentity = (this.embedHelper as unknown as {\n embedWithFallbackProviderIdentity?: (\n text: string,\n identity: EmbedProviderIdentity,\n options?: { signal?: AbortSignal },\n ) => Promise<EmbedWithProviderResult | null>;\n }).embedWithFallbackProviderIdentity;\n if (typeof embedWithIdentity !== \"function\") return null;\n return embedWithIdentity.call(this.embedHelper, query, providerIdentity, { signal: execution?.signal });\n }\n\n private async findCompatibleStoredVectorProvider(\n table: any,\n execution?: SearchExecutionOptions,\n ): Promise<EmbedProviderIdentity | null> {\n try {\n const cached = this.vectorProviderCompatibility.get(table);\n if (cached?.compatible) return cached.providerIdentity;\n const rows = await table.query().select([\"vector\", \"vectorProvider\"]).toArray();\n let providerIdentity: EmbedProviderIdentity | null = null;\n let compatible = rows.length > 0;\n for (const row of rows ?? []) {\n throwIfSearchAborted(execution, \"LanceDbBackend vector provider check aborted\");\n if (\n typeof row.vectorProvider !== \"string\" ||\n row.vectorProvider.length === 0 ||\n !this.isCompatibleStoredVector(row.vector)\n ) {\n compatible = false;\n break;\n }\n if (providerIdentity && row.vectorProvider !== providerIdentity) {\n compatible = false;\n break;\n }\n providerIdentity = row.vectorProvider as EmbedProviderIdentity;\n }\n if (compatible && providerIdentity) {\n this.vectorProviderCompatibility.set(table, {\n providerIdentity,\n compatible: true,\n });\n return providerIdentity;\n }\n return null;\n } catch (err) {\n if (isSearchAborted(execution)) throw err;\n log.debug(`LanceDbBackend stored vector provider check failed: ${err}`);\n return null;\n }\n }\n\n private mapRows(rows: any[]): SearchResult[] {\n return (rows ?? [])\n .filter((row) => row.docid && row.docid !== \"__placeholder__\")\n .map((row) => ({\n docid: row.docid ?? \"\",\n path: row.path ?? \"\",\n snippet: row.snippet ?? row.content?.slice(0, 200) ?? \"\",\n score: row._relevance_score ?? (row._distance != null ? 1 / (1 + (row._distance ?? 0)) : 0.5),\n }));\n }\n\n private async tableHasCompatibleVectors(\n table: any,\n providerIdentity: EmbedProviderIdentity,\n execution?: SearchExecutionOptions,\n ): Promise<boolean> {\n try {\n const cached = this.vectorProviderCompatibility.get(table);\n if (cached?.providerIdentity === providerIdentity) return cached.compatible;\n const rows = await table.query().select([\"vector\", \"vectorProvider\"]).toArray();\n let compatible = rows.length > 0;\n for (const row of rows ?? []) {\n throwIfSearchAborted(execution, \"LanceDbBackend vector provider check aborted\");\n if (\n row.vectorProvider !== providerIdentity ||\n !this.isCompatibleStoredVector(row.vector)\n ) {\n compatible = false;\n break;\n }\n }\n this.vectorProviderCompatibility.set(table, { providerIdentity, compatible });\n return compatible;\n } catch (err) {\n if (isSearchAborted(execution)) throw err;\n log.debug(`LanceDbBackend vector provider check failed: ${err}`);\n return false;\n }\n }\n\n private rememberVectorProviderCompatibility(\n table: unknown,\n providerIdentity: EmbedProviderIdentity | null,\n compatible: boolean,\n ): void {\n if (!table || typeof table !== \"object\") return;\n if (!providerIdentity) {\n this.vectorProviderCompatibility.delete(table);\n return;\n }\n this.vectorProviderCompatibility.set(table, { providerIdentity, compatible });\n }\n\n private isExpectedDimensionVector(vector: number[] | null | undefined): vector is number[] {\n return Array.isArray(vector) && vector.length === this.embeddingDimension;\n }\n\n private isCompatibleStoredVector(vector: unknown): boolean {\n if (!vector || typeof vector !== \"object\") return false;\n const arr = Array.from(vector as ArrayLike<number>);\n return (\n arr.length === this.embeddingDimension &&\n arr.every((value) => Number.isFinite(value)) &&\n arr.some((value) => value !== 0)\n );\n }\n}\n\nfunction isMissingVectorProviderColumnError(err: unknown): boolean {\n const message = err instanceof Error ? err.message : String(err);\n return /\\bvectorProvider\\b/i.test(message) &&\n /\\b(column|field|schema|missing|not found|not exist|does not exist|unknown)\\b/i.test(message);\n}\n"],"mappings":";;;;;;;;;;;;AAoBO,IAAM,iBAAN,MAA8C;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACT,YAAY;AAAA,EACZ,KAAU;AAAA,EACV,cAAmB;AAAA,EACV,8BAA8B,oBAAI,QAGjD;AAAA,EAEF,YAAY,MAA6B;AACvC,SAAK,SAAS,KAAK;AACnB,SAAK,aAAa,KAAK;AACvB,SAAK,cAAc,KAAK;AACxB,SAAK,YAAY,KAAK;AACtB,SAAK,qBAAqB,KAAK;AAAA,EACjC;AAAA,EAEA,MAAM,QAA0B;AA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AAO,MAAM,QAAQ,MAAM,KAAK,OAAO,WAAW,KAAK;AAAA,EACzD;AAAA,EAEQ,yBAAyB,QAA0B;AACzD,QAAI,CAAC,UAAU,OAAO,WAAW,SAAU,QAAO;AAClD,UAAM,MAAM,MAAM,KAAK,MAA2B;AAClD,WACE,IAAI,WAAW,KAAK,sBACpB,IAAI,MAAM,CAAC,UAAU,OAAO,SAAS,KAAK,CAAC,KAC3C,IAAI,KAAK,CAAC,UAAU,UAAU,CAAC;AAAA,EAEnC;AACF;AAEA,SAAS,mCAAmC,KAAuB;AACjE,QAAM,UAAU,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAC/D,SAAO,sBAAsB,KAAK,OAAO,KACvC,gFAAgF,KAAK,OAAO;AAChG;","names":["embedResult","results"]}
|
package/dist/cli.js
CHANGED
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
runWorkProductStatusCliCommand,
|
|
90
90
|
runWorkProjectCliCommand,
|
|
91
91
|
runWorkTaskCliCommand
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-IOTENEVL.js";
|
|
93
93
|
import "./chunk-LQHDIS7L.js";
|
|
94
94
|
import "./chunk-7F7Z6MOS.js";
|
|
95
95
|
import "./chunk-4RR6ROTB.js";
|
|
@@ -121,8 +121,8 @@ import "./chunk-IK34DVAC.js";
|
|
|
121
121
|
import "./chunk-NSKYFGDL.js";
|
|
122
122
|
import "./chunk-TGQ2NTWH.js";
|
|
123
123
|
import "./chunk-CF3ZF2YU.js";
|
|
124
|
-
import "./chunk-
|
|
125
|
-
import "./chunk-
|
|
124
|
+
import "./chunk-VJXSUAO7.js";
|
|
125
|
+
import "./chunk-6JGNHWCI.js";
|
|
126
126
|
import "./chunk-AJA46VX5.js";
|
|
127
127
|
import "./chunk-HL4DB7TO.js";
|
|
128
128
|
import "./chunk-YNDLCWXS.js";
|
|
@@ -142,14 +142,14 @@ import "./chunk-ZRWB5D4H.js";
|
|
|
142
142
|
import "./chunk-A6D7A2FW.js";
|
|
143
143
|
import "./chunk-FF4KLI5W.js";
|
|
144
144
|
import "./chunk-SFQ6QNL7.js";
|
|
145
|
-
import "./chunk-
|
|
146
|
-
import "./chunk-
|
|
145
|
+
import "./chunk-6ZZP4EJF.js";
|
|
146
|
+
import "./chunk-XPSVGJYA.js";
|
|
147
147
|
import "./chunk-JNANKJLN.js";
|
|
148
148
|
import "./chunk-EWLQPEO6.js";
|
|
149
|
-
import "./chunk-
|
|
150
|
-
import "./chunk-
|
|
149
|
+
import "./chunk-ZDTVJXIP.js";
|
|
150
|
+
import "./chunk-GMAG2HS4.js";
|
|
151
151
|
import "./chunk-2I5JGH3M.js";
|
|
152
|
-
import "./chunk-
|
|
152
|
+
import "./chunk-JHMFYY7L.js";
|
|
153
153
|
import "./chunk-CINZGPSJ.js";
|
|
154
154
|
import "./chunk-Q4CAQGKQ.js";
|
|
155
155
|
import "./chunk-IK7DCC5H.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-W7L6HXUC.js";
|
|
5
5
|
import {
|
|
6
6
|
TierMigrationExecutor
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VOUOLGIP.js";
|
|
8
8
|
import {
|
|
9
9
|
decideTierTransition
|
|
10
10
|
} from "./chunk-S75M5ZRK.js";
|
|
@@ -260,4 +260,4 @@ export {
|
|
|
260
260
|
LIFECYCLE_INIT_DONE_MARKER,
|
|
261
261
|
runFirstStartMigration
|
|
262
262
|
};
|
|
263
|
-
//# sourceMappingURL=first-start-migration-
|
|
263
|
+
//# sourceMappingURL=first-start-migration-GYJWIH36.js.map
|
package/dist/index.js
CHANGED
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
listTrainingExportAdapters,
|
|
94
94
|
registerTrainingExportAdapter,
|
|
95
95
|
runBulkImportCliCommand
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-IOTENEVL.js";
|
|
97
97
|
import "./chunk-LQHDIS7L.js";
|
|
98
98
|
import "./chunk-7F7Z6MOS.js";
|
|
99
99
|
import "./chunk-4RR6ROTB.js";
|
|
@@ -145,8 +145,8 @@ import {
|
|
|
145
145
|
parseXrayBudgetFlag,
|
|
146
146
|
parseXrayCliOptions
|
|
147
147
|
} from "./chunk-CF3ZF2YU.js";
|
|
148
|
-
import "./chunk-
|
|
149
|
-
import "./chunk-
|
|
148
|
+
import "./chunk-VJXSUAO7.js";
|
|
149
|
+
import "./chunk-6JGNHWCI.js";
|
|
150
150
|
import {
|
|
151
151
|
parseStrictCliDate
|
|
152
152
|
} from "./chunk-AJA46VX5.js";
|
|
@@ -182,7 +182,7 @@ import {
|
|
|
182
182
|
saveTaxonomy,
|
|
183
183
|
validateSlug,
|
|
184
184
|
validateTaxonomy
|
|
185
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-YJ6QCQNE.js";
|
|
186
186
|
import "./chunk-5RIRL3XL.js";
|
|
187
187
|
import {
|
|
188
188
|
migrateFromEngram,
|
|
@@ -215,7 +215,7 @@ import {
|
|
|
215
215
|
} from "./chunk-VWT3F4IV.js";
|
|
216
216
|
import "./chunk-K5O2QY6T.js";
|
|
217
217
|
import "./chunk-MDYG7VI7.js";
|
|
218
|
-
import "./chunk-
|
|
218
|
+
import "./chunk-VOUOLGIP.js";
|
|
219
219
|
import {
|
|
220
220
|
computeTierValueScore,
|
|
221
221
|
decideTierTransition
|
|
@@ -227,8 +227,8 @@ import {
|
|
|
227
227
|
buildResponseGuidanceRecallSection,
|
|
228
228
|
shouldRecallResponseGuidance
|
|
229
229
|
} from "./chunk-OZKZ2TRP.js";
|
|
230
|
-
import "./chunk-
|
|
231
|
-
import "./chunk-
|
|
230
|
+
import "./chunk-HSVJGWYS.js";
|
|
231
|
+
import "./chunk-G6R5UD3Q.js";
|
|
232
232
|
import "./chunk-5IZL4DCV.js";
|
|
233
233
|
import "./chunk-X7XN6YU4.js";
|
|
234
234
|
import "./chunk-452WDNFO.js";
|
|
@@ -361,20 +361,20 @@ import "./chunk-ZRWB5D4H.js";
|
|
|
361
361
|
import "./chunk-A6D7A2FW.js";
|
|
362
362
|
import "./chunk-FF4KLI5W.js";
|
|
363
363
|
import "./chunk-SFQ6QNL7.js";
|
|
364
|
-
import "./chunk-
|
|
365
|
-
import "./chunk-
|
|
364
|
+
import "./chunk-6ZZP4EJF.js";
|
|
365
|
+
import "./chunk-XPSVGJYA.js";
|
|
366
366
|
import "./chunk-JNANKJLN.js";
|
|
367
367
|
import "./chunk-EWLQPEO6.js";
|
|
368
368
|
import {
|
|
369
369
|
LanceDbBackend
|
|
370
|
-
} from "./chunk-
|
|
370
|
+
} from "./chunk-ZDTVJXIP.js";
|
|
371
371
|
import {
|
|
372
372
|
MeilisearchBackend
|
|
373
|
-
} from "./chunk-
|
|
373
|
+
} from "./chunk-GMAG2HS4.js";
|
|
374
374
|
import "./chunk-2I5JGH3M.js";
|
|
375
375
|
import {
|
|
376
376
|
OramaBackend
|
|
377
|
-
} from "./chunk-
|
|
377
|
+
} from "./chunk-JHMFYY7L.js";
|
|
378
378
|
import "./chunk-CINZGPSJ.js";
|
|
379
379
|
import "./chunk-Q4CAQGKQ.js";
|
|
380
380
|
import {
|
|
@@ -2,15 +2,15 @@ import {
|
|
|
2
2
|
listNamespaces,
|
|
3
3
|
runNamespaceMigration,
|
|
4
4
|
verifyNamespaces
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-6JGNHWCI.js";
|
|
6
|
+
import "../chunk-6ZZP4EJF.js";
|
|
7
|
+
import "../chunk-XPSVGJYA.js";
|
|
8
8
|
import "../chunk-JNANKJLN.js";
|
|
9
9
|
import "../chunk-EWLQPEO6.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-ZDTVJXIP.js";
|
|
11
|
+
import "../chunk-GMAG2HS4.js";
|
|
12
12
|
import "../chunk-2I5JGH3M.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-JHMFYY7L.js";
|
|
14
14
|
import "../chunk-CINZGPSJ.js";
|
|
15
15
|
import "../chunk-Q4CAQGKQ.js";
|
|
16
16
|
import "../chunk-IK7DCC5H.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NamespaceSearchRouter,
|
|
3
3
|
namespaceCollectionName
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-6ZZP4EJF.js";
|
|
5
|
+
import "../chunk-XPSVGJYA.js";
|
|
6
6
|
import "../chunk-JNANKJLN.js";
|
|
7
7
|
import "../chunk-EWLQPEO6.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-ZDTVJXIP.js";
|
|
9
|
+
import "../chunk-GMAG2HS4.js";
|
|
10
10
|
import "../chunk-2I5JGH3M.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-JHMFYY7L.js";
|
|
12
12
|
import "../chunk-CINZGPSJ.js";
|
|
13
13
|
import "../chunk-Q4CAQGKQ.js";
|
|
14
14
|
import "../chunk-ZFXCQPNO.js";
|
package/dist/operator-toolkit.js
CHANGED
|
@@ -11,18 +11,18 @@ import {
|
|
|
11
11
|
summarizeMemoryWorthLegacyCounters,
|
|
12
12
|
summarizeObservationThroughput,
|
|
13
13
|
summarizeTierDistribution
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-VJXSUAO7.js";
|
|
15
|
+
import "./chunk-6JGNHWCI.js";
|
|
16
16
|
import "./chunk-LZ3VEOU5.js";
|
|
17
17
|
import "./chunk-YBPYIAA5.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-6ZZP4EJF.js";
|
|
19
|
+
import "./chunk-XPSVGJYA.js";
|
|
20
20
|
import "./chunk-JNANKJLN.js";
|
|
21
21
|
import "./chunk-EWLQPEO6.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-ZDTVJXIP.js";
|
|
23
|
+
import "./chunk-GMAG2HS4.js";
|
|
24
24
|
import "./chunk-2I5JGH3M.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-JHMFYY7L.js";
|
|
26
26
|
import "./chunk-CINZGPSJ.js";
|
|
27
27
|
import "./chunk-Q4CAQGKQ.js";
|
|
28
28
|
import "./chunk-IK7DCC5H.js";
|
package/dist/orchestrator.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
sanitizeSessionKeyForFilename,
|
|
27
27
|
shouldFilterLifecycleRecallCandidate,
|
|
28
28
|
summarizeGraphShadowComparison
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-YJ6QCQNE.js";
|
|
30
30
|
import "./chunk-5RIRL3XL.js";
|
|
31
31
|
import "./chunk-KVEVLBKC.js";
|
|
32
32
|
import "./chunk-BFBF3XEF.js";
|
|
@@ -49,14 +49,14 @@ import "./chunk-UHGBNIOS.js";
|
|
|
49
49
|
import "./chunk-VWT3F4IV.js";
|
|
50
50
|
import "./chunk-K5O2QY6T.js";
|
|
51
51
|
import "./chunk-MDYG7VI7.js";
|
|
52
|
-
import "./chunk-
|
|
52
|
+
import "./chunk-VOUOLGIP.js";
|
|
53
53
|
import "./chunk-S75M5ZRK.js";
|
|
54
54
|
import "./chunk-46GJIW5M.js";
|
|
55
55
|
import "./chunk-XJNBEDFE.js";
|
|
56
56
|
import "./chunk-DLJ4IR6M.js";
|
|
57
57
|
import "./chunk-OZKZ2TRP.js";
|
|
58
|
-
import "./chunk-
|
|
59
|
-
import "./chunk-
|
|
58
|
+
import "./chunk-HSVJGWYS.js";
|
|
59
|
+
import "./chunk-G6R5UD3Q.js";
|
|
60
60
|
import "./chunk-5IZL4DCV.js";
|
|
61
61
|
import "./chunk-X7XN6YU4.js";
|
|
62
62
|
import "./chunk-452WDNFO.js";
|
|
@@ -108,14 +108,14 @@ import "./chunk-ZRWB5D4H.js";
|
|
|
108
108
|
import "./chunk-A6D7A2FW.js";
|
|
109
109
|
import "./chunk-FF4KLI5W.js";
|
|
110
110
|
import "./chunk-SFQ6QNL7.js";
|
|
111
|
-
import "./chunk-
|
|
112
|
-
import "./chunk-
|
|
111
|
+
import "./chunk-6ZZP4EJF.js";
|
|
112
|
+
import "./chunk-XPSVGJYA.js";
|
|
113
113
|
import "./chunk-JNANKJLN.js";
|
|
114
114
|
import "./chunk-EWLQPEO6.js";
|
|
115
|
-
import "./chunk-
|
|
116
|
-
import "./chunk-
|
|
115
|
+
import "./chunk-ZDTVJXIP.js";
|
|
116
|
+
import "./chunk-GMAG2HS4.js";
|
|
117
117
|
import "./chunk-2I5JGH3M.js";
|
|
118
|
-
import "./chunk-
|
|
118
|
+
import "./chunk-JHMFYY7L.js";
|
|
119
119
|
import "./chunk-CINZGPSJ.js";
|
|
120
120
|
import "./chunk-Q4CAQGKQ.js";
|
|
121
121
|
import "./chunk-IK7DCC5H.js";
|
package/dist/retrieval-agents.js
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
runDirectAgent,
|
|
8
8
|
runTemporalAgent,
|
|
9
9
|
shouldRunAgent
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-HSVJGWYS.js";
|
|
11
|
+
import "./chunk-G6R5UD3Q.js";
|
|
12
12
|
import "./chunk-PVGDJXVK.js";
|
|
13
13
|
import "./chunk-2ODBA7MQ.js";
|
|
14
14
|
import "./chunk-PZ5AY32C.js";
|