@remnic/core 9.3.765 → 9.3.766
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-admin-ops-surface.d.ts +1 -1
- package/dist/access-admin-ops-surface.js +9 -9
- package/dist/access-boundary.d.ts +1 -1
- package/dist/access-boundary.js +10 -10
- package/dist/access-cli.js +18 -18
- package/dist/access-http.d.ts +13 -2
- package/dist/access-http.js +14 -14
- package/dist/access-identity-continuity-surface.js +9 -9
- package/dist/access-lcm-surface.d.ts +1 -1
- package/dist/access-lcm-surface.js +9 -9
- package/dist/access-mcp.d.ts +1 -1
- package/dist/access-mcp.js +13 -13
- package/dist/access-observe-write-surface.d.ts +1 -1
- package/dist/access-observe-write-surface.js +9 -9
- package/dist/access-operations-batch.js +11 -11
- package/dist/access-operations.d.ts +5 -5
- package/dist/access-operations.js +12 -12
- package/dist/access-recall-surface.d.ts +1 -1
- package/dist/access-recall-surface.js +9 -9
- package/dist/access-schema.d.ts +68 -68
- package/dist/{access-service-CAoJ4qN8.d.ts → access-service-CdW6B2qQ.d.ts} +3 -5
- package/dist/access-service.d.ts +1 -1
- package/dist/access-service.js +9 -9
- package/dist/access-surface-catalog.d.ts +1 -1
- package/dist/{chunk-NKP6II6G.js → chunk-4HYFKIGH.js} +6 -6
- package/dist/{chunk-CGLRKKMF.js → chunk-4JG55YV3.js} +3 -3
- package/dist/{chunk-BRYPUVJU.js → chunk-CKNAVW34.js} +2 -2
- package/dist/{chunk-WRFKZEO6.js → chunk-DMKMQTBH.js} +10 -2
- package/dist/chunk-DMKMQTBH.js.map +1 -0
- package/dist/{chunk-RJCQPRLB.js → chunk-GLERZDM7.js} +3 -3
- package/dist/{chunk-SKT66QI5.js → chunk-HBOPSFQQ.js} +6 -6
- package/dist/{chunk-TOF25WKK.js → chunk-IGVKWKR2.js} +2 -2
- package/dist/{chunk-422OELQ3.js → chunk-J3UJJZKI.js} +44 -7
- package/dist/chunk-J3UJJZKI.js.map +1 -0
- package/dist/{chunk-5CEJH5ZN.js → chunk-K2I3AWBR.js} +10 -2
- package/dist/chunk-K2I3AWBR.js.map +1 -0
- package/dist/{chunk-5JF4DIKZ.js → chunk-MSGPLITO.js} +2 -2
- package/dist/{chunk-K43PI6DQ.js → chunk-MYNRJGOY.js} +2 -2
- package/dist/{chunk-UQEE4H6Z.js → chunk-OAREUC7N.js} +13 -7
- package/dist/chunk-OAREUC7N.js.map +1 -0
- package/dist/{chunk-TUXRWLIQ.js → chunk-PA5ALD3S.js} +6 -6
- package/dist/{chunk-P6ZZ4GX4.js → chunk-TVLN5EZZ.js} +3 -3
- package/dist/{chunk-KXG7HHIQ.js → chunk-U5GFYMV7.js} +2 -2
- package/dist/{chunk-YNQ6DFSV.js → chunk-WU46YPY6.js} +8 -1
- package/dist/chunk-WU46YPY6.js.map +1 -0
- package/dist/{chunk-LQ6JI4VH.js → chunk-XG4NBBRW.js} +10 -2
- package/dist/chunk-XG4NBBRW.js.map +1 -0
- package/dist/{chunk-SANZHXY2.js → chunk-ZZMRXJFY.js} +29 -3
- package/dist/chunk-ZZMRXJFY.js.map +1 -0
- package/dist/{cli-WRmxvfc_.d.ts → cli-Dfnc66gs.d.ts} +1 -1
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +17 -17
- package/dist/index.d.ts +2 -2
- package/dist/index.js +18 -18
- package/dist/mcp-memory-inspector-app.d.ts +1 -1
- package/dist/namespaces/migrate.js +9 -9
- package/dist/namespaces/search.js +8 -8
- package/dist/operator-toolkit.js +10 -10
- package/dist/orchestrator.js +18 -18
- package/dist/qmd.js +2 -2
- package/dist/schemas.d.ts +84 -84
- package/dist/search/factory.js +7 -7
- package/dist/search/index.js +7 -7
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +4 -3
- package/dist/search/port.js +3 -1
- package/dist/search/remote-backend.js +2 -1
- package/dist/shared-context/manager.d.ts +8 -8
- package/dist/transfer/types.d.ts +66 -66
- package/package.json +2 -2
- package/src/access-http-cancellation.test.ts +240 -0
- package/src/access-http.ts +54 -2
- package/src/access-recall-surface.ts +1 -0
- package/src/access-service.ts +10 -10
- package/src/search/lancedb-backend.ts +8 -0
- package/src/search/meilisearch-backend.ts +8 -0
- package/src/search/orama-backend.ts +8 -0
- package/src/search/port.ts +15 -2
- package/src/search/remote-backend.ts +32 -3
- package/dist/chunk-422OELQ3.js.map +0 -1
- package/dist/chunk-5CEJH5ZN.js.map +0 -1
- package/dist/chunk-LQ6JI4VH.js.map +0 -1
- package/dist/chunk-SANZHXY2.js.map +0 -1
- package/dist/chunk-UQEE4H6Z.js.map +0 -1
- package/dist/chunk-WRFKZEO6.js.map +0 -1
- package/dist/chunk-YNQ6DFSV.js.map +0 -1
- /package/dist/{chunk-NKP6II6G.js.map → chunk-4HYFKIGH.js.map} +0 -0
- /package/dist/{chunk-CGLRKKMF.js.map → chunk-4JG55YV3.js.map} +0 -0
- /package/dist/{chunk-BRYPUVJU.js.map → chunk-CKNAVW34.js.map} +0 -0
- /package/dist/{chunk-RJCQPRLB.js.map → chunk-GLERZDM7.js.map} +0 -0
- /package/dist/{chunk-SKT66QI5.js.map → chunk-HBOPSFQQ.js.map} +0 -0
- /package/dist/{chunk-TOF25WKK.js.map → chunk-IGVKWKR2.js.map} +0 -0
- /package/dist/{chunk-5JF4DIKZ.js.map → chunk-MSGPLITO.js.map} +0 -0
- /package/dist/{chunk-K43PI6DQ.js.map → chunk-MYNRJGOY.js.map} +0 -0
- /package/dist/{chunk-TUXRWLIQ.js.map → chunk-PA5ALD3S.js.map} +0 -0
- /package/dist/{chunk-P6ZZ4GX4.js.map → chunk-TVLN5EZZ.js.map} +0 -0
- /package/dist/{chunk-KXG7HHIQ.js.map → chunk-U5GFYMV7.js.map} +0 -0
|
@@ -228,7 +228,7 @@ import {
|
|
|
228
228
|
import {
|
|
229
229
|
runNamespaceMaintenanceFanout,
|
|
230
230
|
summarizeNamespaceMaintenanceHealth
|
|
231
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-IGVKWKR2.js";
|
|
232
232
|
import {
|
|
233
233
|
NamespaceCatalog,
|
|
234
234
|
planNamespaceMaintenance
|
|
@@ -316,7 +316,7 @@ import {
|
|
|
316
316
|
createCorrectionService,
|
|
317
317
|
detectPassiveCorrections,
|
|
318
318
|
qmdCollectionPathParts
|
|
319
|
-
} from "./chunk-
|
|
319
|
+
} from "./chunk-OAREUC7N.js";
|
|
320
320
|
import {
|
|
321
321
|
importCapsule
|
|
322
322
|
} from "./chunk-M5QKGHCR.js";
|
|
@@ -343,11 +343,11 @@ import {
|
|
|
343
343
|
} from "./chunk-BAVVI5GP.js";
|
|
344
344
|
import {
|
|
345
345
|
NamespaceSearchRouter
|
|
346
|
-
} from "./chunk-
|
|
346
|
+
} from "./chunk-CKNAVW34.js";
|
|
347
347
|
import {
|
|
348
348
|
createConversationIndexRuntime,
|
|
349
349
|
createSearchBackend
|
|
350
|
-
} from "./chunk-
|
|
350
|
+
} from "./chunk-4HYFKIGH.js";
|
|
351
351
|
import {
|
|
352
352
|
NoopSearchBackend
|
|
353
353
|
} from "./chunk-CYEPCZN5.js";
|
|
@@ -361,7 +361,7 @@ import {
|
|
|
361
361
|
} from "./chunk-KCQA46NR.js";
|
|
362
362
|
import {
|
|
363
363
|
parseQmdExplain
|
|
364
|
-
} from "./chunk-
|
|
364
|
+
} from "./chunk-MYNRJGOY.js";
|
|
365
365
|
import {
|
|
366
366
|
objectiveStateStoreOverrideForNamespace,
|
|
367
367
|
searchObjectiveStateSnapshots
|
|
@@ -22693,4 +22693,4 @@ export {
|
|
|
22693
22693
|
blendGraphExpandedRecallScore,
|
|
22694
22694
|
Orchestrator
|
|
22695
22695
|
};
|
|
22696
|
-
//# sourceMappingURL=chunk-
|
|
22696
|
+
//# sourceMappingURL=chunk-PA5ALD3S.js.map
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
} from "./chunk-2MR3MFQB.js";
|
|
13
13
|
import {
|
|
14
14
|
getOperation
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MSGPLITO.js";
|
|
16
16
|
import {
|
|
17
17
|
EngramAccessInputError
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-OAREUC7N.js";
|
|
19
19
|
import {
|
|
20
20
|
readEnvVar
|
|
21
21
|
} from "./chunk-JUC24CTX.js";
|
|
@@ -3619,4 +3619,4 @@ export {
|
|
|
3619
3619
|
processChatMessage,
|
|
3620
3620
|
EngramMcpServer
|
|
3621
3621
|
};
|
|
3622
|
-
//# sourceMappingURL=chunk-
|
|
3622
|
+
//# sourceMappingURL=chunk-TVLN5EZZ.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-OX272PBW.js";
|
|
4
4
|
import {
|
|
5
5
|
namespaceCollectionName
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CKNAVW34.js";
|
|
7
7
|
import {
|
|
8
8
|
namespaceIdentityFromToken,
|
|
9
9
|
namespaceIdentityToken
|
|
@@ -207,4 +207,4 @@ export {
|
|
|
207
207
|
verifyNamespaces,
|
|
208
208
|
runNamespaceMigration
|
|
209
209
|
};
|
|
210
|
-
//# sourceMappingURL=chunk-
|
|
210
|
+
//# sourceMappingURL=chunk-U5GFYMV7.js.map
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
// src/search/port.ts
|
|
2
|
+
function reportSearchDegradation(execution, degradation) {
|
|
3
|
+
try {
|
|
4
|
+
execution?.onDegradation?.(degradation);
|
|
5
|
+
} catch {
|
|
6
|
+
}
|
|
7
|
+
}
|
|
2
8
|
function resolveEnsureCollectionArgs(collectionOrExecution, execution) {
|
|
3
9
|
if (typeof collectionOrExecution === "string") {
|
|
4
10
|
return { collection: collectionOrExecution, execution };
|
|
@@ -7,6 +13,7 @@ function resolveEnsureCollectionArgs(collectionOrExecution, execution) {
|
|
|
7
13
|
}
|
|
8
14
|
|
|
9
15
|
export {
|
|
16
|
+
reportSearchDegradation,
|
|
10
17
|
resolveEnsureCollectionArgs
|
|
11
18
|
};
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-WU46YPY6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/search/port.ts"],"sourcesContent":["import type { QmdSearchResult } from \"../types.js\";\n\n/** Alias so consumers don't need to reference \"Qmd\" in a backend-agnostic context. */\nexport type SearchResult = QmdSearchResult;\n\nexport interface SearchQueryOptions {\n intent?: string;\n explain?: boolean;\n candidateLimit?: number;\n rerank?: boolean;\n chunkStrategy?: \"auto\" | \"regex\";\n structuredSearches?: Array<{ type: \"lex\" | \"vec\" | \"hyde\"; query: string }>;\n}\n\n/**\n * A search that returned empty (or partial) results because the backend was\n * unavailable, still loading, or timed out — cases that are otherwise\n * indistinguishable from a genuine \"no matches\" (issue #1536, CLAUDE.md\n * rule 34).\n */\nexport interface SearchDegradation {\n backend: \"qmd\" | \"remote\" | \"meilisearch\" | \"orama\" | \"lancedb\";\n code:\n | \"backend_unavailable\"\n | \"backend_error\"\n | \"daemon_timeout\"\n | \"daemon_loading\"\n | \"subprocess_error\"\n | \"deadline_exceeded\"\n | \"remote_error\";\n detail?: string;\n}\n\nexport interface SearchExecutionOptions {\n signal?: AbortSignal;\n /**\n * Observer invoked when the backend degrades during this call (#1536).\n * Callers that need to distinguish empty-because-degraded from\n * empty-because-no-matches (recall x-ray, fallback decisions) pass a\n * collector here. Observer failures are swallowed by the notifier —\n * observability must never break search.\n */\n onDegradation?: (degradation: SearchDegradation) => void;\n}\n\nexport function reportSearchDegradation(\n execution: SearchExecutionOptions | undefined,\n degradation: SearchDegradation,\n): void {\n try {\n execution?.onDegradation?.(degradation);\n } catch {\n // Observability must never break search.\n }\n}\n\nexport function resolveEnsureCollectionArgs(\n collectionOrExecution?: string | SearchExecutionOptions,\n execution?: SearchExecutionOptions,\n): { collection?: string; execution?: SearchExecutionOptions } {\n if (typeof collectionOrExecution === \"string\") {\n return { collection: collectionOrExecution, execution };\n }\n return { collection: undefined, execution: collectionOrExecution ?? execution };\n}\n\n/**\n * Abstract search backend interface.\n *\n * Implementations:\n * - QmdClient (default, local hybrid BM25+vector+reranking)\n * - OramaBackend (embedded, pure JS, hybrid FTS+vector)\n * - LanceDbBackend (embedded, native Arrow bindings, RRF reranking)\n * - MeilisearchBackend (server-based SDK, hybrid search)\n * - RemoteSearchBackend (HTTP REST adapter)\n * - NoopSearchBackend (graceful degradation)\n *\n * See docs/writing-a-search-backend.md for the implementation guide.\n */\nexport interface SearchBackend {\n // ── Lifecycle ──\n probe(): Promise<boolean>;\n /**\n * Optional non-mutating availability probe for health/readiness checks.\n * Implementations must avoid auto-upgrades, collection creation, daemon\n * startup, or any other runtime-modifying side effects.\n */\n checkAvailability?(execution?: SearchExecutionOptions): Promise<boolean>;\n isAvailable(): boolean;\n debugStatus(): string;\n\n // ── Search ──\n search(\n query: string,\n collection?: string,\n maxResults?: number,\n options?: SearchQueryOptions,\n execution?: SearchExecutionOptions,\n ): Promise<SearchResult[]>;\n searchGlobal(query: string, maxResults?: number, execution?: SearchExecutionOptions): Promise<SearchResult[]>;\n bm25Search(\n query: string,\n collection?: string,\n maxResults?: number,\n execution?: SearchExecutionOptions,\n ): Promise<SearchResult[]>;\n vectorSearch(\n query: string,\n collection?: string,\n maxResults?: number,\n execution?: SearchExecutionOptions,\n ): Promise<SearchResult[]>;\n hybridSearch(\n query: string,\n collection?: string,\n maxResults?: number,\n execution?: SearchExecutionOptions,\n ): Promise<SearchResult[]>;\n\n // ── Maintenance ──\n update(execution?: SearchExecutionOptions): Promise<void>;\n /**\n * Optional strict refresh used by callers that must know whether the backend\n * was actually refreshed before writing success markers. Ordinary update\n * calls remain fail-open for migration/maintenance resilience.\n */\n updateStrict?(execution?: SearchExecutionOptions): Promise<void>;\n updateCollection(collection: string, execution?: SearchExecutionOptions): Promise<void>;\n updateCollectionFromDir?(collection: string, memoryDir: string, execution?: SearchExecutionOptions): Promise<void>;\n /**\n * True when update() refreshes every indexed collection, not just this\n * backend's configured collection. Namespace routers use this to avoid\n * repeating the same expensive global update once per namespace.\n */\n updatesAllCollections?(): boolean;\n /**\n * Optional strict refresh used by callers that must know whether a collection\n * was actually refreshed before writing success markers. Ordinary update\n * calls remain fail-open for migration/maintenance resilience.\n */\n updateCollectionStrict?(collection: string, execution?: SearchExecutionOptions): Promise<void>;\n embed(): Promise<void>;\n /**\n * Optional strict embed used by callers that must know vectors were actually\n * refreshed before writing success markers.\n */\n embedStrict?(): Promise<void>;\n embedCollection(collection: string): Promise<void>;\n /**\n * Optional strict collection embed used by callers that must know vectors were\n * actually refreshed before writing success markers.\n */\n embedCollectionStrict?(collection: string): Promise<void>;\n\n // ── Collection management ──\n /**\n * Optional non-mutating collection probe. Backends that can distinguish a\n * missing collection from a transient probe failure should implement this so\n * callers can avoid auto-creating collections in unsafe layouts.\n */\n checkCollection?(\n collectionOrExecution?: string | SearchExecutionOptions,\n execution?: SearchExecutionOptions,\n ): Promise<\"present\" | \"missing\" | \"unknown\" | \"skipped\">;\n ensureCollection(\n memoryDir: string,\n execution?: SearchExecutionOptions,\n ): Promise<\"present\" | \"missing\" | \"unknown\" | \"skipped\">;\n ensureCollection(\n memoryDir: string,\n collection?: string,\n execution?: SearchExecutionOptions,\n ): Promise<\"present\" | \"missing\" | \"unknown\" | \"skipped\">;\n}\n"],"mappings":";AA6CO,SAAS,wBACd,WACA,aACM;AACN,MAAI;AACF,eAAW,gBAAgB,WAAW;AAAA,EACxC,QAAQ;AAAA,EAER;AACF;AAEO,SAAS,4BACd,uBACA,WAC6D;AAC7D,MAAI,OAAO,0BAA0B,UAAU;AAC7C,WAAO,EAAE,YAAY,uBAAuB,UAAU;AAAA,EACxD;AACA,SAAO,EAAE,YAAY,QAAW,WAAW,yBAAyB,UAAU;AAChF;","names":[]}
|
|
@@ -6,8 +6,9 @@ import {
|
|
|
6
6
|
throwIfSearchAborted
|
|
7
7
|
} from "./chunk-CINZGPSJ.js";
|
|
8
8
|
import {
|
|
9
|
+
reportSearchDegradation,
|
|
9
10
|
resolveEnsureCollectionArgs
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WU46YPY6.js";
|
|
11
12
|
import {
|
|
12
13
|
log
|
|
13
14
|
} from "./chunk-NU3CSQ4H.js";
|
|
@@ -457,6 +458,13 @@ var OramaBackend = class {
|
|
|
457
458
|
}));
|
|
458
459
|
} catch (err) {
|
|
459
460
|
log.debug(`OramaBackend search (${mode}) failed: ${err}`);
|
|
461
|
+
if (!isSearchAborted(execution)) {
|
|
462
|
+
reportSearchDegradation(execution, {
|
|
463
|
+
backend: "orama",
|
|
464
|
+
code: "backend_error",
|
|
465
|
+
detail: err instanceof Error ? err.name : typeof err
|
|
466
|
+
});
|
|
467
|
+
}
|
|
460
468
|
return [];
|
|
461
469
|
}
|
|
462
470
|
}
|
|
@@ -605,4 +613,4 @@ export {
|
|
|
605
613
|
resolveOramaCollectionDbFilePath,
|
|
606
614
|
OramaBackend
|
|
607
615
|
};
|
|
608
|
-
//# sourceMappingURL=chunk-
|
|
616
|
+
//# sourceMappingURL=chunk-XG4NBBRW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/search/orama-backend.ts"],"sourcesContent":["import path from \"node:path\";\nimport { mkdir, readdir, readFile, rename, rm, writeFile } from \"node:fs/promises\";\nimport { log } from \"../logger.js\";\nimport {\n reportSearchDegradation,\n resolveEnsureCollectionArgs,\n type SearchBackend,\n type SearchExecutionOptions,\n type SearchQueryOptions,\n type SearchResult,\n} 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 OramaBackendOptions {\n dbPath: string;\n collection: string;\n embedHelper: EmbedHelper;\n memoryDir: string;\n embeddingDimension: number;\n}\n\nconst ORAMA_COLLECTION_FILENAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;\n\nfunction pathIsInside(parent: string, child: string): boolean {\n const relative = path.relative(parent, child);\n return relative === \"\" || (!relative.startsWith(\"..\") && !path.isAbsolute(relative));\n}\n\nexport function resolveOramaCollectionDbFilePath(dbPath: string, collection: string): string {\n if (!ORAMA_COLLECTION_FILENAME_PATTERN.test(collection)) {\n throw new Error(\n `Invalid Orama collection name ${JSON.stringify(collection)}. ` +\n \"Collection names must match [A-Za-z0-9][A-Za-z0-9._-]*.\",\n );\n }\n const resolvedDbPath = path.resolve(dbPath);\n const filePath = path.resolve(resolvedDbPath, `${collection}.msp`);\n if (!pathIsInside(resolvedDbPath, filePath)) {\n throw new Error(\n `Invalid Orama collection path for ${JSON.stringify(collection)}: resolved outside dbPath.`,\n );\n }\n return filePath;\n}\n\n/**\n * Orama search backend — embedded hybrid FTS+vector, pure JS.\n *\n * Uses @orama/orama for full-text search with optional vector support.\n * Persists data to JSON files via @orama/plugin-data-persistence.\n */\nexport class OramaBackend 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 oramaModule: any = null;\n private persistModule: any = null;\n private readonly vectorProviderCompatibility = new WeakMap<\n object,\n { providerIdentity: EmbedProviderIdentity; compatible: boolean }\n >();\n\n constructor(opts: OramaBackendOptions) {\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.ensureModules();\n await this.ensureDb();\n this.available = true;\n return true;\n } catch (err) {\n log.debug(`OramaBackend 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=orama 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 try {\n throwIfSearchAborted(execution, \"OramaBackend global search aborted\");\n const files = await this.listDbFiles();\n const allResults: SearchResult[] = [];\n for (const file of files) {\n throwIfSearchAborted(execution, \"OramaBackend global search aborted\");\n const db = await this.loadDbFromFile(file);\n if (!db) continue;\n const results = await this.searchDb(db, query, \"hybrid\", limit, execution);\n allResults.push(...results);\n }\n allResults.sort((a, b) => b.score - a.score);\n return allResults.slice(0, limit);\n } catch (err) {\n log.debug(`OramaBackend 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 db = await this.ensureDbForCollection(collection ?? this.collection);\n if (isSearchAborted(execution)) return [];\n if (!db) return [];\n return this.searchDb(db, query, \"fulltext\", 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 db = await this.ensureDbForCollection(collection ?? this.collection);\n if (isSearchAborted(execution)) return [];\n if (!db) return [];\n return this.searchDb(db, 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 db = await this.ensureDbForCollection(collection ?? this.collection);\n if (isSearchAborted(execution)) return [];\n if (!db) return [];\n return this.searchDb(db, 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 const db = await this.ensureDbForCollection(collection);\n if (isSearchAborted(execution)) return;\n if (!db) return;\n const { search: oramaSearch, insert, remove, count, getByID } = this.oramaModule;\n\n const docs = await scanMemoryDir(memoryDir);\n if (isSearchAborted(execution)) return;\n const docMap = new Map(docs.map((d) => [d.docid, d]));\n const { update: oramaUpdate } = this.oramaModule;\n\n const embeddingProviderIdentity = this.embedHelper.getProviderIdentity();\n let allRowsCompatible = !!embeddingProviderIdentity && docs.length > 0;\n // Get existing docs to diff — map user doc ID → { internalId, vector }\n const existingDocs = new Map<string, {\n internalId: string;\n vector?: number[];\n vectorProvider?: string;\n }>();\n const existingCount = await count(db);\n if (existingCount > 0) {\n const allHits = await oramaSearch(db, {\n term: \"\",\n limit: existingCount + 100,\n });\n for (const hit of allHits.hits) {\n if (isSearchAborted(execution)) return;\n const storedDocument =\n typeof getByID === \"function\"\n ? await getByID(db, hit.id)\n : hit.document;\n const document = storedDocument ?? hit.document ?? {};\n if (!docMap.has(document.id)) {\n await remove(db, hit.id);\n } else {\n existingDocs.set(document.id, {\n internalId: hit.id,\n vector: this.normalizeStoredVector(document.vector) ?? undefined,\n vectorProvider:\n typeof document.vectorProvider === \"string\"\n ? document.vectorProvider\n : undefined,\n });\n }\n }\n }\n\n // Insert new docs, update existing ones (preserving vectors since update is remove+insert)\n for (const doc of docs) {\n if (isSearchAborted(execution)) return;\n const existing = existingDocs.get(doc.docid);\n if (existing) {\n const payload: Record<string, unknown> = {\n id: doc.docid,\n path: doc.path,\n content: doc.content,\n snippet: doc.snippet,\n };\n const preservesCompatibleProvider =\n !!embeddingProviderIdentity &&\n existing.vectorProvider === embeddingProviderIdentity;\n if (preservesCompatibleProvider) {\n if (this.isCompatibleStoredVector(existing.vector)) {\n payload.vector = existing.vector;\n payload.vectorProvider = existing.vectorProvider ?? \"\";\n } else {\n payload.vector = this.zeroVector();\n payload.vectorProvider = \"\";\n allRowsCompatible = false;\n }\n } else if (!embeddingProviderIdentity && this.isCompatibleStoredVector(existing.vector)) {\n payload.vector = existing.vector;\n payload.vectorProvider = existing.vectorProvider ?? \"\";\n allRowsCompatible = false;\n } else {\n payload.vector = this.zeroVector();\n payload.vectorProvider = \"\";\n allRowsCompatible = false;\n }\n try {\n await oramaUpdate(db, existing.internalId, payload);\n } catch {\n allRowsCompatible = false;\n // Update failed — skip and continue with remaining docs\n }\n } else {\n allRowsCompatible = false;\n try {\n await insert(db, {\n id: doc.docid,\n path: doc.path,\n content: doc.content,\n snippet: doc.snippet,\n vector: this.zeroVector(),\n vectorProvider: \"\",\n });\n } catch {\n allRowsCompatible = false;\n // Duplicate id edge case — skip\n }\n }\n }\n\n if (isSearchAborted(execution)) return;\n await this.persistDbForCollection(db, collection);\n this.rememberVectorProviderCompatibility(\n db,\n embeddingProviderIdentity,\n allRowsCompatible,\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 db = await this.ensureDbForCollection(collection);\n if (!db) return;\n const { search: oramaSearch, update: oramaUpdate, count } = this.oramaModule;\n\n const existingCount = await count(db);\n if (existingCount === 0) return;\n\n const embeddingProviderIdentity = this.embedHelper.getProviderIdentity();\n // Find docs without vectors or with vectors from a different provider.\n const allHits = await oramaSearch(db, { term: \"\", limit: existingCount + 100 });\n const needsEmbed = allHits.hits.filter((h: any) => {\n const vector = this.normalizeStoredVector(h.document?.vector);\n return (\n (embeddingProviderIdentity &&\n h.document?.vectorProvider !== embeddingProviderIdentity) ||\n !this.isCompatibleStoredVector(vector)\n );\n });\n\n if (needsEmbed.length === 0) {\n this.rememberVectorProviderCompatibility(db, embeddingProviderIdentity, true);\n return;\n }\n\n let rowsToEmbed = needsEmbed;\n let embedResult = await this.embedHelper.embedBatchWithProvider(\n rowsToEmbed.map((h: any) => h.document.content as string),\n );\n if (!embedResult) return;\n if (\n embeddingProviderIdentity &&\n embedResult.providerIdentity !== embeddingProviderIdentity\n ) {\n const effectiveProviderIdentity = embedResult.providerIdentity;\n const originalIds = new Set(rowsToEmbed.map((h: any) => h.id));\n const effectiveNeedsEmbed = allHits.hits.filter((h: any) => {\n const vector = this.normalizeStoredVector(h.document?.vector);\n return (\n h.document?.vectorProvider !== effectiveProviderIdentity ||\n !this.isCompatibleStoredVector(vector)\n );\n });\n const sameRows =\n effectiveNeedsEmbed.length === rowsToEmbed.length &&\n effectiveNeedsEmbed.every((h: any) => originalIds.has(h.id));\n if (!sameRows) {\n const effectiveTexts = effectiveNeedsEmbed.map((h: any) => h.document.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 // Orama update is remove+insert — must include all fields to avoid data loss\n const doc = rowsToEmbed[i].document;\n await oramaUpdate(db, rowsToEmbed[i].id, {\n id: doc.id,\n path: doc.path,\n content: doc.content,\n snippet: doc.snippet,\n vector: vec,\n vectorProvider: providerIdentity,\n });\n }\n\n await this.persistDbForCollection(db, collection);\n if (allEmbedded) {\n this.rememberVectorProviderCompatibility(db, providerIdentity, true);\n } else {\n this.rememberVectorProviderCompatibility(db, providerIdentity, false);\n }\n }\n\n async ensureCollection(\n _memoryDir: string,\n collectionOrExecution?: string | SearchExecutionOptions,\n execution?: SearchExecutionOptions,\n ): Promise<\"present\" | \"missing\" | \"unknown\" | \"skipped\"> {\n const { collection, execution: effectiveExecution } = resolveEnsureCollectionArgs(\n collectionOrExecution,\n execution,\n );\n if (isSearchAborted(effectiveExecution)) return \"skipped\";\n try {\n await this.ensureModules();\n await this.ensureDbForCollection(collection ?? this.collection);\n return \"present\";\n } catch {\n return \"missing\";\n }\n }\n\n private async ensureModules(): Promise<void> {\n if (this.oramaModule && this.persistModule) return;\n this.oramaModule = await import(\"@orama/orama\");\n this.persistModule = await import(\"@orama/plugin-data-persistence\");\n }\n\n private async ensureDb(): Promise<any> {\n if (this.db) return this.db;\n await this.ensureModules();\n\n await mkdir(this.dbPath, { recursive: true });\n const filePath = this.dbFilePath(this.collection);\n\n let raw: string;\n try {\n raw = await readFile(filePath, \"utf-8\");\n } catch {\n // No existing DB — create fresh\n this.db = await this.createDb();\n return this.db;\n }\n\n this.db = await this.migrateLegacyVectorProviderSchema(\n await this.persistModule.restore(\"json\", raw),\n this.collection,\n );\n return this.db;\n }\n\n private async ensureDbForCollection(collection: string): Promise<any> {\n // For the default collection, use the cached instance\n if (collection === this.collection) return this.ensureDb();\n\n await this.ensureModules();\n await mkdir(this.dbPath, { recursive: true });\n const filePath = this.dbFilePath(collection);\n\n let raw: string;\n try {\n raw = await readFile(filePath, \"utf-8\");\n } catch {\n // No existing DB — create fresh\n return await this.createDb();\n }\n\n return await this.migrateLegacyVectorProviderSchema(\n await this.persistModule.restore(\"json\", raw),\n collection,\n );\n }\n\n private async createDb(): Promise<any> {\n const { create } = this.oramaModule;\n const schema: Record<string, string> = {\n id: \"string\",\n path: \"string\",\n content: \"string\",\n snippet: \"string\",\n vectorProvider: \"string\",\n vector: `vector[${this.embeddingDimension}]`,\n };\n return await create({ schema });\n }\n\n private async migrateLegacyVectorProviderSchema(db: any, collection: string): Promise<any> {\n const { search: oramaSearch, count, insert } = this.oramaModule;\n const existingCount = await count(db);\n if (existingCount === 0) {\n const migrated = await this.createDb();\n await this.persistDbForCollection(migrated, collection);\n return migrated;\n }\n\n const allHits = await oramaSearch(db, { term: \"\", limit: existingCount + 100 });\n const hits = allHits.hits ?? [];\n const needsMigration = hits.some((hit: any) =>\n typeof hit.document?.vectorProvider !== \"string\"\n );\n if (!needsMigration) return db;\n\n const migrated = await this.createDb();\n for (const hit of hits) {\n const doc = this.getStoredDocument(db, hit);\n const vector = this.getStoredVector(db, hit, doc);\n const payload: Record<string, unknown> = {\n id: typeof doc.id === \"string\" && doc.id.length > 0 ? doc.id : String(hit.id),\n path: typeof doc.path === \"string\" ? doc.path : \"\",\n content: typeof doc.content === \"string\" ? doc.content : \"\",\n snippet:\n typeof doc.snippet === \"string\"\n ? doc.snippet\n : typeof doc.content === \"string\"\n ? doc.content.slice(0, 200)\n : \"\",\n vectorProvider:\n typeof doc.vectorProvider === \"string\" ? doc.vectorProvider : \"\",\n };\n if (vector) {\n payload.vector = vector;\n } else {\n payload.vector = this.zeroVector();\n }\n await insert(migrated, payload);\n }\n await this.persistDbForCollection(migrated, collection);\n return migrated;\n }\n\n private async persistDbForCollection(db: any, collection: string): Promise<void> {\n const data = await this.persistModule.persist(db, \"json\");\n const filePath = this.dbFilePath(collection);\n await mkdir(path.dirname(filePath), { recursive: true });\n const tempPath = path.join(\n path.dirname(filePath),\n `.${path.basename(filePath)}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}.tmp`,\n );\n try {\n await writeFile(tempPath, data, \"utf-8\");\n await rename(tempPath, filePath);\n } catch (err) {\n await rm(tempPath, { force: true }).catch(() => undefined);\n throw err;\n }\n }\n\n private dbFilePath(collection: string): string {\n return resolveOramaCollectionDbFilePath(this.dbPath, collection);\n }\n\n private async listDbFiles(): Promise<string[]> {\n try {\n const entries = await readdir(this.dbPath);\n return entries\n .filter((e) => e.endsWith(\".msp\"))\n .map((e) => path.join(this.dbPath, e));\n } catch {\n return [];\n }\n }\n\n private async loadDbFromFile(filePath: string): Promise<any> {\n try {\n await this.ensureModules();\n const raw = await readFile(filePath, \"utf-8\");\n const collection = path.basename(filePath, \".msp\");\n return await this.migrateLegacyVectorProviderSchema(\n await this.persistModule.restore(\"json\", raw),\n collection,\n );\n } catch (err) {\n log.debug(`OramaBackend failed to load ${filePath}: ${err}`);\n return null;\n }\n }\n\n private async searchDb(\n db: any,\n query: string,\n mode: \"fulltext\" | \"vector\" | \"hybrid\",\n limit: number,\n execution?: SearchExecutionOptions,\n ): Promise<SearchResult[]> {\n const { search: oramaSearch } = this.oramaModule;\n\n try {\n throwIfSearchAborted(execution, `OramaBackend ${mode} search aborted`);\n let searchParams: any;\n\n if (mode === \"fulltext\") {\n searchParams = { term: query, limit };\n } else if (mode === \"vector\") {\n const embedResult = await this.resolveCompatibleQueryEmbedding(db, query, execution);\n throwIfSearchAborted(execution, `OramaBackend ${mode} search aborted`);\n if (!embedResult) {\n // Fall back to fulltext if no embeddings available\n searchParams = { term: query, limit };\n } else {\n searchParams = { mode: \"vector\", vector: { value: embedResult.vector, property: \"vector\" }, limit };\n }\n } else {\n // hybrid\n const embedResult = await this.resolveCompatibleQueryEmbedding(db, query, execution);\n throwIfSearchAborted(execution, `OramaBackend ${mode} search aborted`);\n if (!embedResult) {\n searchParams = { term: query, limit };\n } else {\n searchParams = { mode: \"hybrid\", term: query, vector: { value: embedResult.vector, property: \"vector\" }, limit };\n }\n }\n\n throwIfSearchAborted(execution, `OramaBackend ${mode} search aborted`);\n const result = await oramaSearch(db, searchParams);\n throwIfSearchAborted(execution, `OramaBackend ${mode} search aborted`);\n return (result.hits ?? []).map((hit: any) => ({\n docid: hit.document?.id ?? \"\",\n path: hit.document?.path ?? \"\",\n snippet: hit.document?.snippet ?? hit.document?.content?.slice(0, 200) ?? \"\",\n score: hit.score ?? 0,\n }));\n } catch (err) {\n log.debug(`OramaBackend search (${mode}) failed: ${err}`);\n if (!isSearchAborted(execution)) {\n reportSearchDegradation(execution, {\n backend: \"orama\",\n code: \"backend_error\",\n detail: err instanceof Error ? err.name : typeof err,\n });\n }\n return [];\n }\n }\n\n private async resolveCompatibleQueryEmbedding(\n db: 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, \"OramaBackend query embedding aborted\");\n if (!embedResult || !this.isExpectedDimensionVector(embedResult.vector)) return null;\n\n const storedProviderIdentity = await this.findCompatibleStoredVectorProvider(db, execution);\n if (!storedProviderIdentity) {\n this.rememberVectorProviderCompatibility(db, 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, \"OramaBackend 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(db, 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 db: any,\n execution?: SearchExecutionOptions,\n ): Promise<EmbedProviderIdentity | null> {\n const { search: oramaSearch, count } = this.oramaModule;\n try {\n const cached = this.vectorProviderCompatibility.get(db);\n if (cached?.compatible) return cached.providerIdentity;\n const existingCount = await count(db);\n if (existingCount === 0) return null;\n const allHits = await oramaSearch(db, {\n term: \"\",\n limit: existingCount + 100,\n properties: [\"vectorProvider\"],\n });\n let providerIdentity: EmbedProviderIdentity | null = null;\n let compatible = (allHits.hits ?? []).length > 0;\n for (const hit of allHits.hits ?? []) {\n throwIfSearchAborted(execution, \"OramaBackend vector provider check aborted\");\n const doc = this.getStoredDocument(db, hit);\n if (\n typeof doc.vectorProvider !== \"string\" ||\n doc.vectorProvider.length === 0 ||\n !this.isCompatibleStoredVector(this.getStoredVector(db, hit, doc))\n ) {\n compatible = false;\n break;\n }\n if (providerIdentity && doc.vectorProvider !== providerIdentity) {\n compatible = false;\n break;\n }\n providerIdentity = doc.vectorProvider as EmbedProviderIdentity;\n }\n if (compatible && providerIdentity) {\n this.vectorProviderCompatibility.set(db, {\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(`OramaBackend stored vector provider check failed: ${err}`);\n return null;\n }\n }\n\n private async dbHasCompatibleVectors(\n db: any,\n providerIdentity: EmbedProviderIdentity,\n execution?: SearchExecutionOptions,\n ): Promise<boolean> {\n const { search: oramaSearch, count } = this.oramaModule;\n try {\n const cached = this.vectorProviderCompatibility.get(db);\n if (cached?.providerIdentity === providerIdentity) return cached.compatible;\n const existingCount = await count(db);\n if (existingCount === 0) return false;\n const allHits = await oramaSearch(db, {\n term: \"\",\n limit: existingCount + 100,\n properties: [\"vectorProvider\"],\n });\n let compatible = (allHits.hits ?? []).length > 0;\n for (const hit of allHits.hits ?? []) {\n throwIfSearchAborted(execution, \"OramaBackend vector provider check aborted\");\n const doc = this.getStoredDocument(db, hit);\n if (\n doc.vectorProvider !== providerIdentity ||\n !this.isCompatibleStoredVector(this.getStoredVector(db, hit, doc))\n ) {\n compatible = false;\n break;\n }\n }\n this.vectorProviderCompatibility.set(db, { providerIdentity, compatible });\n return compatible;\n } catch (err) {\n if (isSearchAborted(execution)) throw err;\n log.debug(`OramaBackend vector provider check failed: ${err}`);\n return false;\n }\n }\n\n private rememberVectorProviderCompatibility(\n db: unknown,\n providerIdentity: EmbedProviderIdentity | null,\n compatible: boolean,\n ): void {\n if (!db || typeof db !== \"object\") return;\n if (!providerIdentity) {\n this.vectorProviderCompatibility.delete(db);\n return;\n }\n this.vectorProviderCompatibility.set(db, { providerIdentity, compatible });\n }\n\n private getStoredDocument(db: any, hit: any): Record<string, unknown> {\n const internalId = this.getInternalDocumentId(db, hit);\n const internalDoc =\n internalId !== undefined && internalId !== null\n ? db?.data?.docs?.docs?.[String(internalId)]\n : undefined;\n if (internalDoc && typeof internalDoc === \"object\") {\n return internalDoc as Record<string, unknown>;\n }\n return hit?.document && typeof hit.document === \"object\"\n ? hit.document as Record<string, unknown>\n : {};\n }\n\n private getStoredVector(db: any, hit: any, doc: Record<string, unknown>): number[] | null {\n const documentVector = this.normalizeStoredVector(doc.vector);\n if (documentVector) return documentVector;\n const internalId = this.getInternalDocumentId(db, hit);\n if (internalId === undefined || internalId === null) return null;\n const vectorEntry = db?.data?.index?.vectorIndexes?.vector?.node?.vectors?.get?.(internalId);\n const vector = Array.isArray(vectorEntry) ? vectorEntry[1] : vectorEntry;\n return this.normalizeStoredVector(vector);\n }\n\n private getInternalDocumentId(db: any, hit: any): unknown {\n const publicId =\n typeof hit?.id === \"string\"\n ? hit.id\n : typeof hit?.document?.id === \"string\"\n ? hit.document.id\n : undefined;\n return publicId && typeof db?.internalDocumentIDStore?.idToInternalId?.get === \"function\"\n ? db.internalDocumentIDStore.idToInternalId.get(publicId)\n : undefined;\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): vector is number[] {\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 private zeroVector(): number[] {\n return Array.from({ length: this.embeddingDimension }, () => 0);\n }\n\n private normalizeStoredVector(vector: unknown): number[] | null {\n const values =\n Array.isArray(vector)\n ? vector\n : ArrayBuffer.isView(vector) && !(vector instanceof DataView)\n ? Array.from(vector as unknown as ArrayLike<unknown>)\n : null;\n if (!values || values.length !== this.embeddingDimension) return null;\n const normalized = values.map((value) => Number(value));\n return normalized.every((value) => Number.isFinite(value)) ? normalized : null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAO,UAAU;AACjB,SAAS,OAAO,SAAS,UAAU,QAAQ,IAAI,iBAAiB;AAsBhE,IAAM,oCAAoC;AAE1C,SAAS,aAAa,QAAgB,OAAwB;AAC5D,QAAM,WAAW,KAAK,SAAS,QAAQ,KAAK;AAC5C,SAAO,aAAa,MAAO,CAAC,SAAS,WAAW,IAAI,KAAK,CAAC,KAAK,WAAW,QAAQ;AACpF;AAEO,SAAS,iCAAiC,QAAgB,YAA4B;AAC3F,MAAI,CAAC,kCAAkC,KAAK,UAAU,GAAG;AACvD,UAAM,IAAI;AAAA,MACR,iCAAiC,KAAK,UAAU,UAAU,CAAC;AAAA,IAE7D;AAAA,EACF;AACA,QAAM,iBAAiB,KAAK,QAAQ,MAAM;AAC1C,QAAM,WAAW,KAAK,QAAQ,gBAAgB,GAAG,UAAU,MAAM;AACjE,MAAI,CAAC,aAAa,gBAAgB,QAAQ,GAAG;AAC3C,UAAM,IAAI;AAAA,MACR,qCAAqC,KAAK,UAAU,UAAU,CAAC;AAAA,IACjE;AAAA,EACF;AACA,SAAO;AACT;AAQO,IAAM,eAAN,MAA4C;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACT,YAAY;AAAA,EACZ,KAAU;AAAA,EACV,cAAmB;AAAA,EACnB,gBAAqB;AAAA,EACZ,8BAA8B,oBAAI,QAGjD;AAAA,EAEF,YAAY,MAA2B;AACrC,SAAK,SAAS,KAAK;AACnB,SAAK,aAAa,KAAK;AACvB,SAAK,cAAc,KAAK;AACxB,SAAK,YAAY,KAAK;AACtB,SA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ChE;AAAA,EAEQ,sBAAsB,QAAkC;AAC9D,UAAM,SACJ,MAAM,QAAQ,MAAM,IAChB,SACA,YAAY,OAAO,MAAM,KAAK,EAAE,kBAAkB,YAChD,MAAM,KAAK,MAAuC,IAClD;AACR,QAAI,CAAC,UAAU,OAAO,WAAW,KAAK,mBAAoB,QAAO;AACjE,UAAM,aAAa,OAAO,IAAI,CAAC,UAAU,OAAO,KAAK,CAAC;AACtD,WAAO,WAAW,MAAM,CAAC,UAAU,OAAO,SAAS,KAAK,CAAC,IAAI,aAAa;AAAA,EAC5E;AACF;","names":["migrated"]}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
reportSearchDegradation
|
|
3
|
+
} from "./chunk-WU46YPY6.js";
|
|
1
4
|
import {
|
|
2
5
|
log
|
|
3
6
|
} from "./chunk-NU3CSQ4H.js";
|
|
@@ -70,7 +73,13 @@ var RemoteSearchBackend = class {
|
|
|
70
73
|
return h;
|
|
71
74
|
}
|
|
72
75
|
async post(endpoint, body, execution) {
|
|
73
|
-
if (!this.available)
|
|
76
|
+
if (!this.available) {
|
|
77
|
+
reportSearchDegradation(execution, {
|
|
78
|
+
backend: "remote",
|
|
79
|
+
code: "backend_unavailable"
|
|
80
|
+
});
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
74
83
|
try {
|
|
75
84
|
const res = await fetch(`${this.baseUrl}${endpoint}`, {
|
|
76
85
|
method: "POST",
|
|
@@ -80,13 +89,30 @@ var RemoteSearchBackend = class {
|
|
|
80
89
|
});
|
|
81
90
|
if (!res.ok) {
|
|
82
91
|
log.debug(`RemoteSearchBackend ${endpoint} returned ${res.status}`);
|
|
92
|
+
reportSearchDegradation(execution, {
|
|
93
|
+
backend: "remote",
|
|
94
|
+
code: "remote_error",
|
|
95
|
+
detail: `HTTP ${res.status}`
|
|
96
|
+
});
|
|
83
97
|
return [];
|
|
84
98
|
}
|
|
85
99
|
const data = await res.json();
|
|
86
|
-
if (!Array.isArray(data))
|
|
100
|
+
if (!Array.isArray(data)) {
|
|
101
|
+
reportSearchDegradation(execution, {
|
|
102
|
+
backend: "remote",
|
|
103
|
+
code: "remote_error",
|
|
104
|
+
detail: "invalid response body"
|
|
105
|
+
});
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
87
108
|
return data;
|
|
88
109
|
} catch (err) {
|
|
89
110
|
log.debug(`RemoteSearchBackend ${endpoint} failed: ${err}`);
|
|
111
|
+
reportSearchDegradation(execution, {
|
|
112
|
+
backend: "remote",
|
|
113
|
+
code: "remote_error",
|
|
114
|
+
detail: err instanceof Error ? err.name : typeof err
|
|
115
|
+
});
|
|
90
116
|
return [];
|
|
91
117
|
}
|
|
92
118
|
}
|
|
@@ -95,4 +121,4 @@ var RemoteSearchBackend = class {
|
|
|
95
121
|
export {
|
|
96
122
|
RemoteSearchBackend
|
|
97
123
|
};
|
|
98
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-ZZMRXJFY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/search/remote-backend.ts"],"sourcesContent":["import { log } from \"../logger.js\";\nimport {\n reportSearchDegradation,\n type SearchBackend,\n type SearchExecutionOptions,\n type SearchQueryOptions,\n type SearchResult,\n} from \"./port.js\";\n\nexport interface RemoteSearchBackendOptions {\n baseUrl: string;\n apiKey?: string;\n timeoutMs?: number;\n}\n\n/**\n * HTTP REST search backend adapter.\n *\n * Delegates search to a remote service. Maintenance methods are no-ops\n * (remote backends manage their own indexing).\n */\nexport class RemoteSearchBackend implements SearchBackend {\n private readonly baseUrl: string;\n private readonly apiKey?: string;\n private readonly timeoutMs: number;\n private available = false;\n\n constructor(opts: RemoteSearchBackendOptions) {\n let url = opts.baseUrl;\n while (url.endsWith(\"/\")) url = url.slice(0, -1);\n this.baseUrl = url;\n this.apiKey = opts.apiKey;\n this.timeoutMs = opts.timeoutMs ?? 30_000;\n }\n\n async probe(): Promise<boolean> {\n try {\n const res = await fetch(`${this.baseUrl}/health`, {\n method: \"GET\",\n headers: this.headers(),\n signal: AbortSignal.timeout(this.timeoutMs),\n });\n this.available = res.ok;\n return this.available;\n } catch (err) {\n log.debug(`RemoteSearchBackend 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=remote available=${this.available} baseUrl=${this.baseUrl}`;\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.post(\"/search/deep\", { query, collection, maxResults }, execution);\n }\n\n async searchGlobal(query: string, maxResults?: number, execution?: SearchExecutionOptions): Promise<SearchResult[]> {\n return this.post(\"/search/deep\", { query, maxResults }, execution);\n }\n\n async bm25Search(query: string, collection?: string, maxResults?: number, execution?: SearchExecutionOptions): Promise<SearchResult[]> {\n return this.post(\"/search/bm25\", { query, collection, maxResults }, execution);\n }\n\n async vectorSearch(query: string, collection?: string, maxResults?: number, execution?: SearchExecutionOptions): Promise<SearchResult[]> {\n return this.post(\"/search/vector\", { query, collection, maxResults }, execution);\n }\n\n async hybridSearch(query: string, collection?: string, maxResults?: number, execution?: SearchExecutionOptions): Promise<SearchResult[]> {\n return this.post(\"/search/hybrid\", { query, collection, maxResults }, execution);\n }\n\n async update(_execution?: SearchExecutionOptions): Promise<void> {}\n async updateCollection(_collection: string, _execution?: SearchExecutionOptions): Promise<void> {}\n async embed(): Promise<void> {}\n async embedCollection(_collection: string): Promise<void> {}\n\n async ensureCollection(\n _memoryDir: string,\n _collectionOrExecution?: string | SearchExecutionOptions,\n _execution?: SearchExecutionOptions,\n ): Promise<\"skipped\"> {\n return \"skipped\";\n }\n\n private headers(): Record<string, string> {\n const h: Record<string, string> = { \"Content-Type\": \"application/json\" };\n if (this.apiKey) {\n h[\"Authorization\"] = `Bearer ${this.apiKey}`;\n }\n return h;\n }\n\n private async post(\n endpoint: string,\n body: Record<string, unknown>,\n execution?: SearchExecutionOptions,\n ): Promise<SearchResult[]> {\n if (!this.available) {\n reportSearchDegradation(execution, {\n backend: \"remote\",\n code: \"backend_unavailable\",\n });\n return [];\n }\n try {\n const res = await fetch(`${this.baseUrl}${endpoint}`, {\n method: \"POST\",\n headers: this.headers(),\n body: JSON.stringify(body),\n signal: execution?.signal\n ? AbortSignal.any([execution.signal, AbortSignal.timeout(this.timeoutMs)])\n : AbortSignal.timeout(this.timeoutMs),\n });\n if (!res.ok) {\n log.debug(`RemoteSearchBackend ${endpoint} returned ${res.status}`);\n reportSearchDegradation(execution, {\n backend: \"remote\",\n code: \"remote_error\",\n detail: `HTTP ${res.status}`,\n });\n return [];\n }\n const data = await res.json();\n if (!Array.isArray(data)) {\n reportSearchDegradation(execution, {\n backend: \"remote\",\n code: \"remote_error\",\n detail: \"invalid response body\",\n });\n return [];\n }\n return data as SearchResult[];\n } catch (err) {\n log.debug(`RemoteSearchBackend ${endpoint} failed: ${err}`);\n reportSearchDegradation(execution, {\n backend: \"remote\",\n code: \"remote_error\",\n detail: err instanceof Error ? err.name : typeof err,\n });\n return [];\n }\n }\n}\n"],"mappings":";;;;;;;;AAqBO,IAAM,sBAAN,MAAmD;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACT,YAAY;AAAA,EAEpB,YAAY,MAAkC;AAC5C,QAAI,MAAM,KAAK;AACf,WAAO,IAAI,SAAS,GAAG,EAAG,OAAM,IAAI,MAAM,GAAG,EAAE;AAC/C,SAAK,UAAU;AACf,SAAK,SAAS,KAAK;AACnB,SAAK,YAAY,KAAK,aAAa;AAAA,EACrC;AAAA,EAEA,MAAM,QAA0B;AAC9B,QAAI;AACF,YAAM,MAAM,MAAM,MAAM,GAAG,KAAK,OAAO,WAAW;AAAA,QAChD,QAAQ;AAAA,QACR,SAAS,KAAK,QAAQ;AAAA,QACtB,QAAQ,YAAY,QAAQ,KAAK,SAAS;AAAA,MAC5C,CAAC;AACD,WAAK,YAAY,IAAI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AA,EACF;AACF;","names":[]}
|
|
@@ -16,7 +16,7 @@ import { WorkProjectStatus, WorkTaskStatus, WorkTaskPriority } from './work/type
|
|
|
16
16
|
import { RoutePatternType } from './routing/engine.js';
|
|
17
17
|
import { TailscaleSyncOptions } from './network/tailscale.js';
|
|
18
18
|
import { DashboardStatus } from './dashboard-runtime.js';
|
|
19
|
-
import { F as EngramAccessService } from './access-service-
|
|
19
|
+
import { F as EngramAccessService } from './access-service-CdW6B2qQ.js';
|
|
20
20
|
import { ResolveSecretRefFn } from './resolve-auth-token.js';
|
|
21
21
|
import { CompatRunner, CompatReport } from './compat/types.js';
|
|
22
22
|
import { EvalBaselineDeltaReport, EvalBaselineSnapshot, EvalCiGateReport, EvalBenchmarkPackSummary, EvalHarnessStatus, EvalStoredBaselineCiGateReport } from './evals.js';
|
package/dist/cli.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import './work/types.js';
|
|
|
16
16
|
import './routing/engine.js';
|
|
17
17
|
import './network/tailscale.js';
|
|
18
18
|
import './dashboard-runtime.js';
|
|
19
|
-
import './access-service-
|
|
19
|
+
import './access-service-CdW6B2qQ.js';
|
|
20
20
|
import './resolve-auth-token.js';
|
|
21
21
|
import './compat/types.js';
|
|
22
22
|
import './evals.js';
|
|
@@ -38,7 +38,7 @@ import './trust-zones.js';
|
|
|
38
38
|
import './session-integrity.js';
|
|
39
39
|
import './recall-state.js';
|
|
40
40
|
import './policy-runtime.js';
|
|
41
|
-
export { A as AccessHttpServeCliCommandOptions, a as ArchiveObservationsCliCommandOptions, B as BulkImportCliCommandOptions, C as CliApi, b as CliCommand, c as CliProgram, d as CompatCliCommandOptions, e as ConnectorsRunCliOutputOptions, f as ConversationIndexHealthCliOrchestrator, D as DashboardStartCliCommandOptions, g as DedupeCandidate, E as ExactDedupePlan, G as GraphHealthCliCommandOptions, M as MemoryActionAuditCliCommandOptions, h as MemoryActionAuditCliNamespaceSummary, i as MemoryActionAuditCliReport, j as MemoryGovernanceCliCommandOptions, k as MemoryGovernanceReportCliCommandOptions, l as MemoryGovernanceRestoreCliCommandOptions, m as MemoryReviewDispositionCliCommandOptions, n as MemoryTimelineCliCommandOptions, o as MigrateCliOrchestrator, q as MigrateCliReport, s as MigrateObservationsCliCommandOptions, P as PolicyDiffCliReport, t as PolicyDiffEntry, u as PolicyRollbackCliReport, v as PolicyStatusCliReport, w as PolicyTuningCliOrchestrator, R as RebuildMemoryLifecycleLedgerCliCommandOptions, x as RebuildMemoryProjectionCliCommandOptions, y as RebuildObservationsCliCommandOptions, z as RepairMemoryProjectionCliCommandOptions, F as ReplayCliCommandOptions, H as ReplayCliOrchestrator, I as RouteCliCommandOptions, S as SessionIntegrityCliCommandOptions, J as SessionRepairCliCommandOptions, T as TailscaleStatusCliCommandOptions, K as TailscaleSyncCliCommandOptions, L as TierMigrationCliOrchestrator, N as TrainingExportCliCommandOptions, V as VerifyMemoryProjectionCliCommandOptions, W as WebDavServeCliCommandOptions, O as WorkProjectCliCommandOptions, Q as WorkTaskCliCommandOptions, U as emitConnectorsRunCliResult, X as filterNormalMemorySearchResults, Y as hasDestructivePurgeFailures, Z as isNormalRetrievalVisibleMemory, _ as listMemoryMarkdownFilePaths, $ as parseDurationToMs, a0 as parseStrictCliDate, a1 as planAggressiveDuplicateDeletions, a2 as planExactDuplicateDeletions, a3 as registerCli, a4 as resolveAccessPrincipalOverride, a5 as resolveMemoryDirForNamespace, a6 as runAbstractionNodeStatusCliCommand, a7 as runAccessHttpServeCliCommand, a8 as runAccessHttpStatusCliCommand, a9 as runAccessHttpStopCliCommand, aa as runAccessMcpServeCliCommand, ab as runArchiveObservationsCliCommand, ac as runBenchmarkBaselineReportCliCommand, ad as runBenchmarkBaselineSnapshotCliCommand, ae as runBenchmarkCiGateCliCommand, af as runBenchmarkImportCliCommand, ag as runBenchmarkStatusCliCommand, ah as runBenchmarkStoredBaselineCiGateCliCommand, ai as runBenchmarkValidateCliCommand, r as runBulkImportCliCommand, aj as runCausalTrajectoryStatusCliCommand, ak as runCommitmentLifecycleCliCommand, al as runCommitmentRecordCliCommand, am as runCommitmentSetStateCliCommand, an as runCommitmentStatusCliCommand, ao as runCompatCliCommand, ap as runCompoundingPromoteCliCommand, aq as runConversationIndexHealthCliCommand, ar as runConversationIndexInspectCliCommand, as as runConversationIndexRebuildCliCommand, at as runCueAnchorStatusCliCommand, au as runDashboardStartCliCommand, av as runDashboardStatusCliCommand, aw as runDashboardStopCliCommand, ax as runGraphHealthCliCommand, ay as runHarmonicSearchCliCommand, az as runMemoryActionAuditCliCommand, aA as runMemoryGovernanceCliCommand, aB as runMemoryGovernanceReportCliCommand, aC as runMemoryGovernanceRestoreCliCommand, aD as runMemoryReviewDispositionCliCommand, aE as runMemoryTimelineCliCommand, aF as runMigrateNormalizeFrontmatterCliCommand, aG as runMigrateObservationsCliCommand, aH as runMigrateRechunkCliCommand, aI as runMigrateReextractCliCommand, aJ as runMigrateRescoreImportanceCliCommand, aK as runObjectiveStateStatusCliCommand, aL as runPolicyDiffCliCommand, aM as runPolicyRollbackCliCommand, aN as runPolicyStatusCliCommand, aO as runRebuildMemoryLifecycleLedgerCliCommand, aP as runRebuildMemoryProjectionCliCommand, aQ as runRebuildObservationsCliCommand, aR as runRepairMemoryProjectionCliCommand, aS as runReplayCliCommand, aT as runResumeBundleBuildCliCommand, aU as runResumeBundleRecordCliCommand, aV as runResumeBundleStatusCliCommand, aW as runRouteCliCommand, aX as runSemanticRulePromoteCliCommand, aY as runSemanticRuleVerifyCliCommand, aZ as runSessionCheckCliCommand, a_ as runSessionRepairCliCommand, a$ as runTailscaleStatusCliCommand, b0 as runTailscaleSyncCliCommand, b1 as runTierMigrateCliCommand, b2 as runTierStatusCliCommand, b3 as runTrainingExportCliCommand, b4 as runTrustZoneDemoSeedCliCommand, b5 as runTrustZonePromoteCliCommand, b6 as runTrustZoneStatusCliCommand, b7 as runUtilityLearningCliCommand, b8 as runUtilityLearningStatusCliCommand, b9 as runUtilityTelemetryRecordCliCommand, ba as runUtilityTelemetryStatusCliCommand, bb as runVerifiedRecallSearchCliCommand, bc as runVerifyMemoryProjectionCliCommand, bd as runWebDavServeCliCommand, be as runWebDavStopCliCommand, bf as runWorkProductRecallSearchCliCommand, bg as runWorkProductRecordCliCommand, bh as runWorkProductStatusCliCommand, bi as runWorkProjectCliCommand, bj as runWorkTaskCliCommand } from './cli-
|
|
41
|
+
export { A as AccessHttpServeCliCommandOptions, a as ArchiveObservationsCliCommandOptions, B as BulkImportCliCommandOptions, C as CliApi, b as CliCommand, c as CliProgram, d as CompatCliCommandOptions, e as ConnectorsRunCliOutputOptions, f as ConversationIndexHealthCliOrchestrator, D as DashboardStartCliCommandOptions, g as DedupeCandidate, E as ExactDedupePlan, G as GraphHealthCliCommandOptions, M as MemoryActionAuditCliCommandOptions, h as MemoryActionAuditCliNamespaceSummary, i as MemoryActionAuditCliReport, j as MemoryGovernanceCliCommandOptions, k as MemoryGovernanceReportCliCommandOptions, l as MemoryGovernanceRestoreCliCommandOptions, m as MemoryReviewDispositionCliCommandOptions, n as MemoryTimelineCliCommandOptions, o as MigrateCliOrchestrator, q as MigrateCliReport, s as MigrateObservationsCliCommandOptions, P as PolicyDiffCliReport, t as PolicyDiffEntry, u as PolicyRollbackCliReport, v as PolicyStatusCliReport, w as PolicyTuningCliOrchestrator, R as RebuildMemoryLifecycleLedgerCliCommandOptions, x as RebuildMemoryProjectionCliCommandOptions, y as RebuildObservationsCliCommandOptions, z as RepairMemoryProjectionCliCommandOptions, F as ReplayCliCommandOptions, H as ReplayCliOrchestrator, I as RouteCliCommandOptions, S as SessionIntegrityCliCommandOptions, J as SessionRepairCliCommandOptions, T as TailscaleStatusCliCommandOptions, K as TailscaleSyncCliCommandOptions, L as TierMigrationCliOrchestrator, N as TrainingExportCliCommandOptions, V as VerifyMemoryProjectionCliCommandOptions, W as WebDavServeCliCommandOptions, O as WorkProjectCliCommandOptions, Q as WorkTaskCliCommandOptions, U as emitConnectorsRunCliResult, X as filterNormalMemorySearchResults, Y as hasDestructivePurgeFailures, Z as isNormalRetrievalVisibleMemory, _ as listMemoryMarkdownFilePaths, $ as parseDurationToMs, a0 as parseStrictCliDate, a1 as planAggressiveDuplicateDeletions, a2 as planExactDuplicateDeletions, a3 as registerCli, a4 as resolveAccessPrincipalOverride, a5 as resolveMemoryDirForNamespace, a6 as runAbstractionNodeStatusCliCommand, a7 as runAccessHttpServeCliCommand, a8 as runAccessHttpStatusCliCommand, a9 as runAccessHttpStopCliCommand, aa as runAccessMcpServeCliCommand, ab as runArchiveObservationsCliCommand, ac as runBenchmarkBaselineReportCliCommand, ad as runBenchmarkBaselineSnapshotCliCommand, ae as runBenchmarkCiGateCliCommand, af as runBenchmarkImportCliCommand, ag as runBenchmarkStatusCliCommand, ah as runBenchmarkStoredBaselineCiGateCliCommand, ai as runBenchmarkValidateCliCommand, r as runBulkImportCliCommand, aj as runCausalTrajectoryStatusCliCommand, ak as runCommitmentLifecycleCliCommand, al as runCommitmentRecordCliCommand, am as runCommitmentSetStateCliCommand, an as runCommitmentStatusCliCommand, ao as runCompatCliCommand, ap as runCompoundingPromoteCliCommand, aq as runConversationIndexHealthCliCommand, ar as runConversationIndexInspectCliCommand, as as runConversationIndexRebuildCliCommand, at as runCueAnchorStatusCliCommand, au as runDashboardStartCliCommand, av as runDashboardStatusCliCommand, aw as runDashboardStopCliCommand, ax as runGraphHealthCliCommand, ay as runHarmonicSearchCliCommand, az as runMemoryActionAuditCliCommand, aA as runMemoryGovernanceCliCommand, aB as runMemoryGovernanceReportCliCommand, aC as runMemoryGovernanceRestoreCliCommand, aD as runMemoryReviewDispositionCliCommand, aE as runMemoryTimelineCliCommand, aF as runMigrateNormalizeFrontmatterCliCommand, aG as runMigrateObservationsCliCommand, aH as runMigrateRechunkCliCommand, aI as runMigrateReextractCliCommand, aJ as runMigrateRescoreImportanceCliCommand, aK as runObjectiveStateStatusCliCommand, aL as runPolicyDiffCliCommand, aM as runPolicyRollbackCliCommand, aN as runPolicyStatusCliCommand, aO as runRebuildMemoryLifecycleLedgerCliCommand, aP as runRebuildMemoryProjectionCliCommand, aQ as runRebuildObservationsCliCommand, aR as runRepairMemoryProjectionCliCommand, aS as runReplayCliCommand, aT as runResumeBundleBuildCliCommand, aU as runResumeBundleRecordCliCommand, aV as runResumeBundleStatusCliCommand, aW as runRouteCliCommand, aX as runSemanticRulePromoteCliCommand, aY as runSemanticRuleVerifyCliCommand, aZ as runSessionCheckCliCommand, a_ as runSessionRepairCliCommand, a$ as runTailscaleStatusCliCommand, b0 as runTailscaleSyncCliCommand, b1 as runTierMigrateCliCommand, b2 as runTierStatusCliCommand, b3 as runTrainingExportCliCommand, b4 as runTrustZoneDemoSeedCliCommand, b5 as runTrustZonePromoteCliCommand, b6 as runTrustZoneStatusCliCommand, b7 as runUtilityLearningCliCommand, b8 as runUtilityLearningStatusCliCommand, b9 as runUtilityTelemetryRecordCliCommand, ba as runUtilityTelemetryStatusCliCommand, bb as runVerifiedRecallSearchCliCommand, bc as runVerifyMemoryProjectionCliCommand, bd as runWebDavServeCliCommand, be as runWebDavStopCliCommand, bf as runWorkProductRecallSearchCliCommand, bg as runWorkProductRecordCliCommand, bh as runWorkProductStatusCliCommand, bi as runWorkProjectCliCommand, bj as runWorkTaskCliCommand } from './cli-Dfnc66gs.js';
|
|
42
42
|
import './connectors-cli-2iaQ5tX2.js';
|
|
43
43
|
import './storage.js';
|
|
44
44
|
import './page-versioning.js';
|
package/dist/cli.js
CHANGED
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
runWorkProductStatusCliCommand,
|
|
91
91
|
runWorkProjectCliCommand,
|
|
92
92
|
runWorkTaskCliCommand
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-HBOPSFQQ.js";
|
|
94
94
|
import "./chunk-MC4FJXPA.js";
|
|
95
95
|
import "./chunk-LQHDIS7L.js";
|
|
96
96
|
import "./chunk-7F7Z6MOS.js";
|
|
@@ -133,9 +133,9 @@ import "./chunk-GY3SKOS4.js";
|
|
|
133
133
|
import "./chunk-SFQ6QNL7.js";
|
|
134
134
|
import "./chunk-DANV2HTH.js";
|
|
135
135
|
import "./chunk-33JBK2XP.js";
|
|
136
|
-
import "./chunk-
|
|
136
|
+
import "./chunk-IGVKWKR2.js";
|
|
137
137
|
import "./chunk-NFWTMM2M.js";
|
|
138
|
-
import "./chunk-
|
|
138
|
+
import "./chunk-U5GFYMV7.js";
|
|
139
139
|
import "./chunk-OX272PBW.js";
|
|
140
140
|
import "./chunk-KFY3SGN7.js";
|
|
141
141
|
import "./chunk-3T74IZB3.js";
|
|
@@ -168,7 +168,7 @@ import "./chunk-OO42R444.js";
|
|
|
168
168
|
import "./chunk-K6MV3TRQ.js";
|
|
169
169
|
import "./chunk-LBJBNWS2.js";
|
|
170
170
|
import "./chunk-OADWQ5CR.js";
|
|
171
|
-
import "./chunk-
|
|
171
|
+
import "./chunk-J3UJJZKI.js";
|
|
172
172
|
import "./chunk-7WV3F5DQ.js";
|
|
173
173
|
import "./chunk-SEDEKFYQ.js";
|
|
174
174
|
import "./chunk-JBPKEARU.js";
|
|
@@ -177,10 +177,10 @@ import "./chunk-J64TK33U.js";
|
|
|
177
177
|
import "./chunk-RSUYKGGZ.js";
|
|
178
178
|
import "./chunk-42NQ7AVG.js";
|
|
179
179
|
import "./chunk-7RXCMVFQ.js";
|
|
180
|
-
import "./chunk-
|
|
180
|
+
import "./chunk-TVLN5EZZ.js";
|
|
181
181
|
import "./chunk-D24OXEPB.js";
|
|
182
|
-
import "./chunk-
|
|
183
|
-
import "./chunk-
|
|
182
|
+
import "./chunk-4JG55YV3.js";
|
|
183
|
+
import "./chunk-GLERZDM7.js";
|
|
184
184
|
import "./chunk-ZQNCHPTZ.js";
|
|
185
185
|
import "./chunk-YF6FMLBT.js";
|
|
186
186
|
import "./chunk-EEKDRAWX.js";
|
|
@@ -188,8 +188,8 @@ import "./chunk-DJECGBBM.js";
|
|
|
188
188
|
import "./chunk-35NN3ZFA.js";
|
|
189
189
|
import "./chunk-T4WDJPEZ.js";
|
|
190
190
|
import "./chunk-2MR3MFQB.js";
|
|
191
|
-
import "./chunk-
|
|
192
|
-
import "./chunk-
|
|
191
|
+
import "./chunk-MSGPLITO.js";
|
|
192
|
+
import "./chunk-OAREUC7N.js";
|
|
193
193
|
import "./chunk-GDASG7NC.js";
|
|
194
194
|
import "./chunk-GDB4J2H3.js";
|
|
195
195
|
import "./chunk-M5QKGHCR.js";
|
|
@@ -206,14 +206,14 @@ import "./chunk-2KK5WNQB.js";
|
|
|
206
206
|
import "./chunk-SOBJ6NEY.js";
|
|
207
207
|
import "./chunk-6MMONPHM.js";
|
|
208
208
|
import "./chunk-BAVVI5GP.js";
|
|
209
|
-
import "./chunk-
|
|
210
|
-
import "./chunk-
|
|
211
|
-
import "./chunk-
|
|
209
|
+
import "./chunk-CKNAVW34.js";
|
|
210
|
+
import "./chunk-4HYFKIGH.js";
|
|
211
|
+
import "./chunk-DMKMQTBH.js";
|
|
212
212
|
import "./chunk-CYEPCZN5.js";
|
|
213
|
-
import "./chunk-
|
|
214
|
-
import "./chunk-
|
|
213
|
+
import "./chunk-XG4NBBRW.js";
|
|
214
|
+
import "./chunk-ZZMRXJFY.js";
|
|
215
215
|
import "./chunk-HM6UJPPO.js";
|
|
216
|
-
import "./chunk-
|
|
216
|
+
import "./chunk-K2I3AWBR.js";
|
|
217
217
|
import "./chunk-AER6MT24.js";
|
|
218
218
|
import "./chunk-CINZGPSJ.js";
|
|
219
219
|
import "./chunk-EGGE52UU.js";
|
|
@@ -222,8 +222,8 @@ import "./chunk-DCWIQFNA.js";
|
|
|
222
222
|
import "./chunk-XBZQRZ6G.js";
|
|
223
223
|
import "./chunk-KCQA46NR.js";
|
|
224
224
|
import "./chunk-SJHM6I4J.js";
|
|
225
|
-
import "./chunk-
|
|
226
|
-
import "./chunk-
|
|
225
|
+
import "./chunk-MYNRJGOY.js";
|
|
226
|
+
import "./chunk-WU46YPY6.js";
|
|
227
227
|
import "./chunk-EIR5VLIH.js";
|
|
228
228
|
import "./chunk-ICP53SKG.js";
|
|
229
229
|
import "./chunk-AQEJKOKI.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ import { aA as CodingContext, aT as CodingModeConfig, P as PluginConfig, aU as C
|
|
|
25
25
|
export { Z as AgentAccessAuthToken, m as BriefingActiveThread, aX as BriefingConfig, k as BriefingFocus, j as BriefingFollowup, aY as BriefingOpenCommitment, o as BriefingRecentEntity, n as BriefingResult, i as BriefingSections, aZ as BriefingWindow, X as BufferSurpriseEvent, l as CalendarEvent, C as CalendarSource, a_ as CodexCompatConfig, aS as ConsolidationObservation, ab as ContinuityImprovementLoop, a$ as DEFAULT_RECALL_DISCLOSURE, E as EntityFile, a7 as EntityStructuredSection, b0 as ExtractedFact, G as GatewayConfig, ah as MemoryActionEligibilityContext, b1 as MemoryActionEligibilitySource, a1 as MemoryActionType, M as MemoryFile, q as MemoryFrontmatter, b2 as MemoryObservation, b3 as MemoryScope, b4 as RECALL_DISCLOSURE_LEVELS, R as RecallDisclosure, Y as SecretRef, b5 as WearableAuthCheck, b6 as WearableFetchOptions, b7 as WearableFetchPage, aI as WearableMemoryMode, aH as WearableNativeMemory, b8 as WearableNativeMemoryPage, aM as WearableSourceStatus, aL as WearableSyncSummary, b9 as WearableTranscriptSegment, ba as isRecallDisclosure } from './types-D1iBqhJA.js';
|
|
26
26
|
export { JudgeBatchResult, JudgeCandidate, JudgeVerdict, JudgeVerdictKind, clearVerdictCache, createVerdictCache, getVerdictKind, isDurableVerdict, isValidCachedVerdict, judgeFactDurability, normalizeCachedVerdict, verdictCacheSize } from './extraction-judge.js';
|
|
27
27
|
export { hasBroadGraphIntent, inferIntentFromText, intentCompatibilityScore, isTaskInitiationIntent, planRecallMode } from './intent.js';
|
|
28
|
-
export { G as EngramAccessInputError, F as EngramAccessService, P as ProcedureStatsConfigSnapshot, H as ProcedureStatsRecent, I as ProcedureStatsReport, J as ProcedureStatusCounts, K as computeProcedureStats, L as formatProcedureStatsText } from './access-service-
|
|
28
|
+
export { G as EngramAccessInputError, F as EngramAccessService, P as ProcedureStatsConfigSnapshot, H as ProcedureStatsRecent, I as ProcedureStatsReport, J as ProcedureStatusCounts, K as computeProcedureStats, L as formatProcedureStatsText } from './access-service-CdW6B2qQ.js';
|
|
29
29
|
export { FILTER_LABELS as DIRECT_ANSWER_FILTER_LABELS, DirectAnswerCandidate, DirectAnswerConfig, DirectAnswerInput, DirectAnswerReason, DirectAnswerResult, isDirectAnswerEligible } from './direct-answer.js';
|
|
30
30
|
export { MemoryTier, TierRoutingPolicy, TierTransitionDecision, computeTierValueScore, decideTierTransition } from './tier-routing.js';
|
|
31
31
|
export { ApplyReasoningTraceBoostOptions, BoostableResult, DEFAULT_REASONING_TRACE_BOOST, applyReasoningTraceBoost, isReasoningTracePath, looksLikeProblemSolvingQuery } from './reasoning-trace-recall.js';
|
|
@@ -80,7 +80,7 @@ export { EnrichmentAuditEntry, EnrichmentCandidate, EnrichmentCostTier, Enrichme
|
|
|
80
80
|
export { d as BulkImportError, B as BulkImportOptions, b as BulkImportResult, a as BulkImportSource, e as BulkImportSourceAdapter, f as ImportSourceRole, I as ImportTurn, g as ImportTurnValidationIssue, i as isImportRole, p as parseIsoTimestamp, v as validateImportTurn } from './types-gb_SNtjR.js';
|
|
81
81
|
export { clearBulkImportSources, getBulkImportSource, listBulkImportSources, registerBulkImportSource } from './bulk-import/index.js';
|
|
82
82
|
export { a as ProcessBatchContext, P as ProcessBatchFn, b as ProcessBatchResult, f as formatBatchTranscript, r as resolveBulkImportContext, c as runBulkImportPipeline, v as validateBatchSize } from './pipeline-DmqtvION.js';
|
|
83
|
-
export { B as BulkImportCliCommandOptions, p as parseStrictCliDate, r as runBulkImportCliCommand } from './cli-
|
|
83
|
+
export { B as BulkImportCliCommandOptions, p as parseStrictCliDate, r as runBulkImportCliCommand } from './cli-Dfnc66gs.js';
|
|
84
84
|
export { DEFAULT_IMPORT_BATCH_SIZE, ImportProgress, ImportedMemory, ImporterAdapter, ImporterParseOptions, ImporterTransformOptions, ImporterWriteResult, ImporterWriteTarget, RunImportOptions, RunImporterResult, defaultWriteMemoriesToOrchestrator, importedMemoryToTurn, runImporter, validateImportBatchSize, validateImportRateLimit } from './importers/index.js';
|
|
85
85
|
export { FallbackLlmClient, FallbackLlmOptions, FallbackLlmResponse, FallbackLlmRuntimeContext } from './fallback-llm.js';
|
|
86
86
|
export { ComputeMemoryWorthInput, MemoryWorthResult, computeMemoryWorth } from './memory-worth.js';
|
package/dist/index.js
CHANGED
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
validateTaxonomy,
|
|
94
94
|
watchForChanges,
|
|
95
95
|
writeManifest
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-PA5ALD3S.js";
|
|
97
97
|
import {
|
|
98
98
|
WEARABLE_SOURCE_PREFIX,
|
|
99
99
|
buildExtractionTurns,
|
|
@@ -344,7 +344,7 @@ import {
|
|
|
344
344
|
registerTrainingExportAdapter,
|
|
345
345
|
runBulkImportCliCommand,
|
|
346
346
|
runWearablesCliCommand
|
|
347
|
-
} from "./chunk-
|
|
347
|
+
} from "./chunk-HBOPSFQQ.js";
|
|
348
348
|
import "./chunk-MC4FJXPA.js";
|
|
349
349
|
import "./chunk-LQHDIS7L.js";
|
|
350
350
|
import "./chunk-7F7Z6MOS.js";
|
|
@@ -407,11 +407,11 @@ import {
|
|
|
407
407
|
parseXrayCliOptions
|
|
408
408
|
} from "./chunk-DANV2HTH.js";
|
|
409
409
|
import "./chunk-33JBK2XP.js";
|
|
410
|
-
import "./chunk-
|
|
410
|
+
import "./chunk-IGVKWKR2.js";
|
|
411
411
|
import {
|
|
412
412
|
NamespaceCatalog
|
|
413
413
|
} from "./chunk-NFWTMM2M.js";
|
|
414
|
-
import "./chunk-
|
|
414
|
+
import "./chunk-U5GFYMV7.js";
|
|
415
415
|
import "./chunk-OX272PBW.js";
|
|
416
416
|
import "./chunk-KFY3SGN7.js";
|
|
417
417
|
import {
|
|
@@ -545,7 +545,7 @@ import "./chunk-H3FZVNRN.js";
|
|
|
545
545
|
import "./chunk-OADWQ5CR.js";
|
|
546
546
|
import {
|
|
547
547
|
EngramAccessHttpServer
|
|
548
|
-
} from "./chunk-
|
|
548
|
+
} from "./chunk-J3UJJZKI.js";
|
|
549
549
|
import {
|
|
550
550
|
WearablesInputError,
|
|
551
551
|
describeErrorForOperator
|
|
@@ -559,15 +559,15 @@ import "./chunk-42NQ7AVG.js";
|
|
|
559
559
|
import "./chunk-7RXCMVFQ.js";
|
|
560
560
|
import {
|
|
561
561
|
EngramMcpServer
|
|
562
|
-
} from "./chunk-
|
|
562
|
+
} from "./chunk-TVLN5EZZ.js";
|
|
563
563
|
import {
|
|
564
564
|
buildCitationGuidance,
|
|
565
565
|
formatOaiMemCitation,
|
|
566
566
|
parseOaiMemCitation,
|
|
567
567
|
sanitizeNoteForCitation
|
|
568
568
|
} from "./chunk-D24OXEPB.js";
|
|
569
|
-
import "./chunk-
|
|
570
|
-
import "./chunk-
|
|
569
|
+
import "./chunk-4JG55YV3.js";
|
|
570
|
+
import "./chunk-GLERZDM7.js";
|
|
571
571
|
import "./chunk-ZQNCHPTZ.js";
|
|
572
572
|
import "./chunk-YF6FMLBT.js";
|
|
573
573
|
import {
|
|
@@ -605,13 +605,13 @@ import {
|
|
|
605
605
|
suggestionSubmitRequestSchema,
|
|
606
606
|
validateRequest
|
|
607
607
|
} from "./chunk-2MR3MFQB.js";
|
|
608
|
-
import "./chunk-
|
|
608
|
+
import "./chunk-MSGPLITO.js";
|
|
609
609
|
import {
|
|
610
610
|
EngramAccessInputError,
|
|
611
611
|
EngramAccessService,
|
|
612
612
|
computeProcedureStats,
|
|
613
613
|
formatProcedureStatsText
|
|
614
|
-
} from "./chunk-
|
|
614
|
+
} from "./chunk-OAREUC7N.js";
|
|
615
615
|
import "./chunk-GDASG7NC.js";
|
|
616
616
|
import "./chunk-GDB4J2H3.js";
|
|
617
617
|
import "./chunk-M5QKGHCR.js";
|
|
@@ -655,20 +655,20 @@ import {
|
|
|
655
655
|
resolveGitContext,
|
|
656
656
|
stableHash
|
|
657
657
|
} from "./chunk-BAVVI5GP.js";
|
|
658
|
-
import "./chunk-
|
|
659
|
-
import "./chunk-
|
|
658
|
+
import "./chunk-CKNAVW34.js";
|
|
659
|
+
import "./chunk-4HYFKIGH.js";
|
|
660
660
|
import {
|
|
661
661
|
MeilisearchBackend
|
|
662
|
-
} from "./chunk-
|
|
662
|
+
} from "./chunk-DMKMQTBH.js";
|
|
663
663
|
import "./chunk-CYEPCZN5.js";
|
|
664
664
|
import {
|
|
665
665
|
OramaBackend
|
|
666
|
-
} from "./chunk-
|
|
667
|
-
import "./chunk-
|
|
666
|
+
} from "./chunk-XG4NBBRW.js";
|
|
667
|
+
import "./chunk-ZZMRXJFY.js";
|
|
668
668
|
import "./chunk-HM6UJPPO.js";
|
|
669
669
|
import {
|
|
670
670
|
LanceDbBackend
|
|
671
|
-
} from "./chunk-
|
|
671
|
+
} from "./chunk-K2I3AWBR.js";
|
|
672
672
|
import "./chunk-AER6MT24.js";
|
|
673
673
|
import "./chunk-CINZGPSJ.js";
|
|
674
674
|
import "./chunk-EGGE52UU.js";
|
|
@@ -679,8 +679,8 @@ import "./chunk-KCQA46NR.js";
|
|
|
679
679
|
import "./chunk-SJHM6I4J.js";
|
|
680
680
|
import {
|
|
681
681
|
QmdClient
|
|
682
|
-
} from "./chunk-
|
|
683
|
-
import "./chunk-
|
|
682
|
+
} from "./chunk-MYNRJGOY.js";
|
|
683
|
+
import "./chunk-WU46YPY6.js";
|
|
684
684
|
import {
|
|
685
685
|
memoryWorthOutcomeEligibleCategories,
|
|
686
686
|
recordMemoryOutcome
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { x as EngramAccessRecallResponse } from './access-service-
|
|
1
|
+
import { x as EngramAccessRecallResponse } from './access-service-CdW6B2qQ.js';
|
|
2
2
|
import { ActionConfidenceRequest } from './access-schema.js';
|
|
3
3
|
import { RecallXraySnapshot } from './recall-xray.js';
|
|
4
4
|
import { ActionConfidenceResult } from './action-confidence.js';
|