@remnic/core 9.3.647 → 9.3.649
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 +10 -10
- package/dist/access-http.js +10 -10
- package/dist/access-mcp.js +9 -9
- package/dist/access-service.js +8 -8
- package/dist/{chunk-L7W5YW6Y.js → chunk-5ETA6OAS.js} +2 -2
- package/dist/{chunk-DCGT4FPP.js → chunk-76QTEJ2Q.js} +2 -2
- package/dist/{chunk-XUGQQPGO.js → chunk-AGRPGAKR.js} +12 -1
- package/dist/chunk-AGRPGAKR.js.map +1 -0
- package/dist/{chunk-RAELB5NX.js → chunk-CNRZ6WJU.js} +3 -3
- package/dist/{chunk-3MAONBX3.js → chunk-FOVPSMGI.js} +2 -2
- package/dist/{chunk-3D6L7CEP.js → chunk-FQYFMIKG.js} +14 -17
- package/dist/chunk-FQYFMIKG.js.map +1 -0
- package/dist/{chunk-ZPPFKVSD.js → chunk-FUXV6HSO.js} +2 -2
- package/dist/{chunk-MUKXANAM.js → chunk-I4COC5XW.js} +49 -6
- package/dist/{chunk-MUKXANAM.js.map → chunk-I4COC5XW.js.map} +1 -1
- package/dist/{chunk-APWJRJFW.js → chunk-NMIOW7XG.js} +86 -8
- package/dist/chunk-NMIOW7XG.js.map +1 -0
- package/dist/{chunk-FAV25DUZ.js → chunk-QT4THOLT.js} +1 -1
- package/dist/{chunk-FAV25DUZ.js.map → chunk-QT4THOLT.js.map} +1 -1
- package/dist/{chunk-FAYDM5WD.js → chunk-RRRCNIPK.js} +2 -2
- package/dist/{chunk-6BNFVP7Y.js → chunk-RZOBQ23O.js} +2 -2
- package/dist/{chunk-RG3LBSGH.js → chunk-TQUWNX7C.js} +2 -2
- package/dist/{chunk-U55D5UD5.js → chunk-WPCCNSWO.js} +5 -5
- package/dist/{chunk-TA4LQ5SR.js → chunk-XUGVP7ZU.js} +5 -5
- package/dist/{chunk-DC66QVL2.js → chunk-ZT6R3WR3.js} +2 -2
- package/dist/cli.js +15 -15
- package/dist/index.js +16 -16
- package/dist/namespaces/migrate.js +8 -8
- package/dist/namespaces/search.d.ts +1 -0
- package/dist/namespaces/search.js +7 -7
- package/dist/operator-toolkit.js +9 -9
- package/dist/orchestrator.js +9 -9
- package/dist/qmd.d.ts +1 -0
- package/dist/qmd.js +2 -2
- package/dist/resume-bundles.js +2 -2
- package/dist/schemas.d.ts +22 -22
- package/dist/search/factory.js +6 -6
- package/dist/search/index.js +6 -6
- 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 +6 -0
- package/dist/search/port.js +1 -1
- package/dist/transcript.d.ts +18 -1
- package/dist/transcript.js +5 -3
- package/dist/transfer/types.d.ts +12 -12
- package/package.json +1 -1
- package/src/cli.ts +10 -12
- package/src/namespaces/search.test.ts +218 -18
- package/src/namespaces/search.ts +122 -7
- package/src/qmd-client.test.ts +74 -1
- package/src/qmd.ts +52 -6
- package/src/search/port.ts +9 -0
- package/src/transcript-day-range.test.ts +101 -0
- package/src/transcript.ts +26 -0
- package/dist/chunk-3D6L7CEP.js.map +0 -1
- package/dist/chunk-APWJRJFW.js.map +0 -1
- package/dist/chunk-XUGQQPGO.js.map +0 -1
- /package/dist/{chunk-L7W5YW6Y.js.map → chunk-5ETA6OAS.js.map} +0 -0
- /package/dist/{chunk-DCGT4FPP.js.map → chunk-76QTEJ2Q.js.map} +0 -0
- /package/dist/{chunk-RAELB5NX.js.map → chunk-CNRZ6WJU.js.map} +0 -0
- /package/dist/{chunk-3MAONBX3.js.map → chunk-FOVPSMGI.js.map} +0 -0
- /package/dist/{chunk-ZPPFKVSD.js.map → chunk-FUXV6HSO.js.map} +0 -0
- /package/dist/{chunk-FAYDM5WD.js.map → chunk-RRRCNIPK.js.map} +0 -0
- /package/dist/{chunk-6BNFVP7Y.js.map → chunk-RZOBQ23O.js.map} +0 -0
- /package/dist/{chunk-RG3LBSGH.js.map → chunk-TQUWNX7C.js.map} +0 -0
- /package/dist/{chunk-U55D5UD5.js.map → chunk-WPCCNSWO.js.map} +0 -0
- /package/dist/{chunk-TA4LQ5SR.js.map → chunk-XUGVP7ZU.js.map} +0 -0
- /package/dist/{chunk-DC66QVL2.js.map → chunk-ZT6R3WR3.js.map} +0 -0
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSearchBackend
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WPCCNSWO.js";
|
|
4
4
|
import {
|
|
5
5
|
namespaceIdentityToken,
|
|
6
6
|
normalizeNamespaceIdentity
|
|
7
7
|
} from "./chunk-ZFXCQPNO.js";
|
|
8
8
|
|
|
9
9
|
// src/namespaces/search.ts
|
|
10
|
+
import path from "path";
|
|
11
|
+
var NESTED_NAMESPACE_FILTER_OVERFETCH_FACTOR = 4;
|
|
12
|
+
var NESTED_NAMESPACE_FILTER_OVERFETCH_MIN = 50;
|
|
10
13
|
function namespaceCollectionName(baseCollection, namespace, options) {
|
|
11
14
|
const trimmed = normalizeNamespaceIdentity(namespace);
|
|
12
15
|
const defaultNamespace = normalizeNamespaceIdentity(options?.defaultNamespace ?? "") || "default";
|
|
@@ -42,27 +45,44 @@ var NamespaceSearchRouter = class {
|
|
|
42
45
|
if (!record.available || record.collectionState === "missing") {
|
|
43
46
|
return { namespace, results: [] };
|
|
44
47
|
}
|
|
48
|
+
const backendLimit = backendSearchLimit(record, maxResults);
|
|
45
49
|
let results;
|
|
46
50
|
switch (method) {
|
|
47
51
|
case "hybrid":
|
|
48
|
-
results = await record.backend.hybridSearch(
|
|
52
|
+
results = await record.backend.hybridSearch(
|
|
53
|
+
query,
|
|
54
|
+
record.collection,
|
|
55
|
+
backendLimit,
|
|
56
|
+
options.execution
|
|
57
|
+
);
|
|
49
58
|
break;
|
|
50
59
|
case "bm25":
|
|
51
|
-
results = await record.backend.bm25Search(
|
|
60
|
+
results = await record.backend.bm25Search(
|
|
61
|
+
query,
|
|
62
|
+
record.collection,
|
|
63
|
+
backendLimit,
|
|
64
|
+
options.execution
|
|
65
|
+
);
|
|
52
66
|
break;
|
|
53
67
|
case "vector":
|
|
54
|
-
results = await record.backend.vectorSearch(
|
|
68
|
+
results = await record.backend.vectorSearch(
|
|
69
|
+
query,
|
|
70
|
+
record.collection,
|
|
71
|
+
backendLimit,
|
|
72
|
+
options.execution
|
|
73
|
+
);
|
|
55
74
|
break;
|
|
56
75
|
default:
|
|
57
76
|
results = await record.backend.search(
|
|
58
77
|
query,
|
|
59
78
|
record.collection,
|
|
60
|
-
|
|
79
|
+
backendLimit,
|
|
61
80
|
options.searchOptions,
|
|
62
81
|
options.execution
|
|
63
82
|
);
|
|
64
83
|
break;
|
|
65
84
|
}
|
|
85
|
+
results = filterNamespaceSubtreeResults(record, results);
|
|
66
86
|
return { namespace, results };
|
|
67
87
|
})
|
|
68
88
|
);
|
|
@@ -129,6 +149,7 @@ var NamespaceSearchRouter = class {
|
|
|
129
149
|
const pending = (async () => {
|
|
130
150
|
const storage = await this.storageRouter.storageFor(key);
|
|
131
151
|
const useLegacyDefaultCollection = key === this.config.defaultNamespace && storage.dir === this.config.memoryDir;
|
|
152
|
+
const filtersNestedNamespaces = this.config.namespacesEnabled === true && useLegacyDefaultCollection;
|
|
132
153
|
const rootHostEmbeddingScope = this.config.hostEmbeddingProviderScope ?? this.config.memoryDir;
|
|
133
154
|
const scopedConfig = {
|
|
134
155
|
...this.config,
|
|
@@ -141,19 +162,76 @@ var NamespaceSearchRouter = class {
|
|
|
141
162
|
};
|
|
142
163
|
const backend = this.createBackend(scopedConfig);
|
|
143
164
|
const available = await backend.probe().catch(() => false);
|
|
144
|
-
const collectionState = available ? await
|
|
165
|
+
const collectionState = available ? await this.collectionStateForBackend(backend, storage.dir, scopedConfig.qmdCollection, {
|
|
166
|
+
skipAutoCreate: filtersNestedNamespaces,
|
|
167
|
+
execution
|
|
168
|
+
}) : "unknown";
|
|
145
169
|
return {
|
|
146
170
|
backend,
|
|
147
171
|
collection: scopedConfig.qmdCollection,
|
|
148
172
|
memoryDir: storage.dir,
|
|
149
173
|
available,
|
|
150
|
-
collectionState
|
|
174
|
+
collectionState,
|
|
175
|
+
filtersNestedNamespaces
|
|
151
176
|
};
|
|
152
177
|
})();
|
|
153
178
|
this.cache.set(key, pending);
|
|
154
179
|
return await pending;
|
|
155
180
|
}
|
|
181
|
+
async collectionStateForBackend(backend, memoryDir, collection, options) {
|
|
182
|
+
if (options.skipAutoCreate) {
|
|
183
|
+
if (!backend.checkCollection) return "unknown";
|
|
184
|
+
const collectionState = await backend.checkCollection(collection, options.execution).catch(() => "unknown");
|
|
185
|
+
return collectionState === "missing" ? "unknown" : collectionState;
|
|
186
|
+
}
|
|
187
|
+
return await backend.ensureCollection(memoryDir, collection, options.execution).catch(() => "unknown");
|
|
188
|
+
}
|
|
156
189
|
};
|
|
190
|
+
function filterNamespaceSubtreeResults(record, results) {
|
|
191
|
+
if (!record.filtersNestedNamespaces) return results;
|
|
192
|
+
return results.filter(
|
|
193
|
+
(result) => !pathIsInsideNamespaceSubtree(record.memoryDir, record.collection, result.path)
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
function backendSearchLimit(record, maxResults) {
|
|
197
|
+
if (!record.filtersNestedNamespaces) return maxResults;
|
|
198
|
+
return Math.max(
|
|
199
|
+
maxResults,
|
|
200
|
+
maxResults * NESTED_NAMESPACE_FILTER_OVERFETCH_FACTOR,
|
|
201
|
+
NESTED_NAMESPACE_FILTER_OVERFETCH_MIN
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
function pathIsInsideNamespaceSubtree(memoryDir, collection, resultPath) {
|
|
205
|
+
if (!resultPath) return false;
|
|
206
|
+
const normalizedResultPath = normalizeQmdResultPath(resultPath, collection);
|
|
207
|
+
const memoryRoot = path.resolve(memoryDir);
|
|
208
|
+
const namespacesRoot = path.join(memoryRoot, "namespaces");
|
|
209
|
+
const candidate = path.isAbsolute(normalizedResultPath) ? path.normalize(normalizedResultPath) : path.resolve(memoryRoot, normalizedResultPath);
|
|
210
|
+
const relative = path.relative(namespacesRoot, candidate);
|
|
211
|
+
return relative === "" || !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
212
|
+
}
|
|
213
|
+
function normalizeQmdResultPath(resultPath, collection) {
|
|
214
|
+
let value = resultPath.trim();
|
|
215
|
+
if (value.startsWith("qmd://")) {
|
|
216
|
+
try {
|
|
217
|
+
const parsed = new URL(value);
|
|
218
|
+
if (parsed.protocol === "qmd:" && parsed.hostname === collection) {
|
|
219
|
+
value = decodeURIComponent(parsed.pathname.replace(/^\/+/, ""));
|
|
220
|
+
}
|
|
221
|
+
} catch {
|
|
222
|
+
const remainder = value.slice("qmd://".length);
|
|
223
|
+
const slashIndex = remainder.indexOf("/");
|
|
224
|
+
if (slashIndex !== -1) {
|
|
225
|
+
value = remainder.slice(slashIndex + 1);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
const collectionPrefix = `${collection}/`;
|
|
230
|
+
if (value.startsWith(collectionPrefix)) {
|
|
231
|
+
value = value.slice(collectionPrefix.length);
|
|
232
|
+
}
|
|
233
|
+
return value;
|
|
234
|
+
}
|
|
157
235
|
function mergeNamespaceSearchResults(lists, maxResults) {
|
|
158
236
|
const merged = /* @__PURE__ */ new Map();
|
|
159
237
|
for (const { namespace, results } of lists) {
|
|
@@ -179,4 +257,4 @@ export {
|
|
|
179
257
|
namespaceCollectionName,
|
|
180
258
|
NamespaceSearchRouter
|
|
181
259
|
};
|
|
182
|
-
//# sourceMappingURL=chunk-
|
|
260
|
+
//# sourceMappingURL=chunk-NMIOW7XG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/namespaces/search.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { PluginConfig, QmdSearchResult } from \"../types.js\";\nimport type {\n SearchBackend,\n SearchExecutionOptions,\n SearchQueryOptions,\n} from \"../search/port.js\";\nimport { createSearchBackend } from \"../search/factory.js\";\nimport { namespaceIdentityToken, normalizeNamespaceIdentity } from \"./identity.js\";\n\nconst NESTED_NAMESPACE_FILTER_OVERFETCH_FACTOR = 4;\nconst NESTED_NAMESPACE_FILTER_OVERFETCH_MIN = 50;\n\nexport function namespaceCollectionName(\n baseCollection: string,\n namespace: string,\n options?: {\n defaultNamespace?: string;\n useLegacyDefaultCollection?: boolean;\n },\n): string {\n const trimmed = normalizeNamespaceIdentity(namespace);\n const defaultNamespace = normalizeNamespaceIdentity(options?.defaultNamespace ?? \"\") || \"default\";\n if (\n options?.useLegacyDefaultCollection === true &&\n trimmed === defaultNamespace\n ) {\n return baseCollection;\n }\n\n return `${baseCollection}--${namespaceIdentityToken(trimmed || defaultNamespace)}`;\n}\n\ntype StorageRouterLike = {\n storageFor(namespace: string): Promise<{ dir: string }>;\n};\n\ntype NamespaceBackendRecord = {\n backend: SearchBackend;\n collection: string;\n memoryDir: string;\n available: boolean;\n collectionState: CollectionState;\n filtersNestedNamespaces: boolean;\n};\n\ntype CollectionState = \"present\" | \"missing\" | \"unknown\" | \"skipped\";\n\ntype NamespaceScopedSearchConfig = PluginConfig & {\n hostEmbeddingProviderScope?: string;\n};\n\nexport class NamespaceSearchRouter {\n private readonly cache = new Map<string, Promise<NamespaceBackendRecord>>();\n\n constructor(\n private readonly config: PluginConfig,\n private readonly storageRouter: StorageRouterLike,\n private readonly createBackend: (config: PluginConfig) => SearchBackend = createSearchBackend,\n ) {}\n\n async collectionForNamespace(namespace: string): Promise<string> {\n return (await this.backendRecordFor(namespace)).collection;\n }\n\n async searchAcrossNamespaces(options: {\n query: string;\n namespaces: string[];\n maxResults?: number;\n mode?: \"search\" | \"hybrid\" | \"bm25\" | \"vector\";\n searchOptions?: SearchQueryOptions;\n execution?: SearchExecutionOptions;\n }): Promise<QmdSearchResult[]> {\n const query = options.query.trim();\n if (!query) return [];\n const maxResults = Math.max(0, Math.floor(options.maxResults ?? this.config.qmdMaxResults));\n if (maxResults === 0) return [];\n\n const method = options.mode ?? \"search\";\n const namespaces = Array.from(new Set(options.namespaces.map((value) => value.trim()).filter(Boolean)));\n if (namespaces.length === 0) return [];\n\n const resultsByNamespace = await Promise.all(\n namespaces.map(async (namespace) => {\n const record = await this.backendRecordFor(namespace);\n if (!record.available || record.collectionState === \"missing\") {\n return { namespace, results: [] as QmdSearchResult[] };\n }\n const backendLimit = backendSearchLimit(record, maxResults);\n let results: QmdSearchResult[];\n switch (method) {\n case \"hybrid\":\n results = await record.backend.hybridSearch(\n query,\n record.collection,\n backendLimit,\n options.execution,\n );\n break;\n case \"bm25\":\n results = await record.backend.bm25Search(\n query,\n record.collection,\n backendLimit,\n options.execution,\n );\n break;\n case \"vector\":\n results = await record.backend.vectorSearch(\n query,\n record.collection,\n backendLimit,\n options.execution,\n );\n break;\n default:\n results = await record.backend.search(\n query,\n record.collection,\n backendLimit,\n options.searchOptions,\n options.execution,\n );\n break;\n }\n results = filterNamespaceSubtreeResults(record, results);\n return { namespace, results };\n }),\n );\n\n return mergeNamespaceSearchResults(resultsByNamespace, maxResults);\n }\n\n /**\n * Update all namespace backends.\n * Returns the number of backends for which an update was attempted\n * (i.e., available and collection present). Callers can treat 0 as a\n * signal that no backend was eligible — useful for success-verification in\n * startup-sync when namespacesEnabled is true.\n */\n async updateNamespaces(\n namespaces: string[],\n execution?: SearchExecutionOptions,\n ): Promise<number> {\n const unique = Array.from(new Set(namespaces.map((value) => value.trim()).filter(Boolean)));\n const eligible = (await Promise.all(\n unique.map(async (namespace) => {\n const record = await this.backendRecordFor(namespace);\n return record.available && record.collectionState !== \"missing\"\n ? record\n : null;\n }),\n )).filter((record): record is NamespaceBackendRecord => record !== null);\n\n const globalRecord = eligible.find((record) => record.backend.updatesAllCollections?.() === true);\n const scopedRecords = globalRecord\n ? eligible.filter((record) => record.backend.updatesAllCollections?.() !== true)\n : eligible;\n\n await Promise.all([\n globalRecord ? globalRecord.backend.update(execution) : Promise.resolve(),\n ...scopedRecords.map((record) => record.backend.update(execution)),\n ]);\n\n return (globalRecord ? 1 : 0) + scopedRecords.length;\n }\n\n async embedNamespaces(namespaces: string[]): Promise<void> {\n const unique = Array.from(new Set(namespaces.map((value) => value.trim()).filter(Boolean)));\n await Promise.all(\n unique.map(async (namespace) => {\n const record = await this.backendRecordFor(namespace);\n if (!record.available || record.collectionState === \"missing\") return;\n await record.backend.embed();\n }),\n );\n }\n\n async ensureNamespaceCollection(\n namespace: string,\n execution?: SearchExecutionOptions,\n ): Promise<\"present\" | \"missing\" | \"unknown\" | \"skipped\"> {\n const record = await this.backendRecordFor(namespace, execution);\n return record.collectionState;\n }\n\n /** Clear cached backend records so the next access re-probes availability. */\n clearCache(): void {\n this.cache.clear();\n }\n\n /** Release any per-namespace backend handles held by cached records. */\n async dispose(): Promise<void> {\n const pendingRecords = Array.from(this.cache.values());\n this.cache.clear();\n const settled = await Promise.allSettled(pendingRecords);\n await Promise.allSettled(\n settled.flatMap((entry) => {\n if (entry.status !== \"fulfilled\") return [];\n const dispose = (entry.value.backend as { dispose?: () => void | Promise<void> }).dispose;\n return dispose ? [dispose.call(entry.value.backend)] : [];\n }),\n );\n }\n\n private async backendRecordFor(\n namespace: string,\n execution?: SearchExecutionOptions,\n ): Promise<NamespaceBackendRecord> {\n const key = namespace.trim() || this.config.defaultNamespace;\n const existing = this.cache.get(key);\n if (existing) return await existing;\n\n const pending = (async (): Promise<NamespaceBackendRecord> => {\n const storage = await this.storageRouter.storageFor(key);\n const useLegacyDefaultCollection =\n key === this.config.defaultNamespace && storage.dir === this.config.memoryDir;\n const filtersNestedNamespaces =\n this.config.namespacesEnabled === true && useLegacyDefaultCollection;\n const rootHostEmbeddingScope =\n (this.config as NamespaceScopedSearchConfig).hostEmbeddingProviderScope ??\n this.config.memoryDir;\n const scopedConfig: NamespaceScopedSearchConfig = {\n ...this.config,\n memoryDir: storage.dir,\n hostEmbeddingProviderScope: rootHostEmbeddingScope,\n qmdCollection: namespaceCollectionName(this.config.qmdCollection, key, {\n defaultNamespace: this.config.defaultNamespace,\n useLegacyDefaultCollection,\n }),\n };\n\n const backend = this.createBackend(scopedConfig);\n const available = await backend.probe().catch(() => false);\n const collectionState = available\n ? await this.collectionStateForBackend(backend, storage.dir, scopedConfig.qmdCollection, {\n skipAutoCreate: filtersNestedNamespaces,\n execution,\n })\n : \"unknown\";\n return {\n backend,\n collection: scopedConfig.qmdCollection,\n memoryDir: storage.dir,\n available,\n collectionState,\n filtersNestedNamespaces,\n };\n })();\n\n this.cache.set(key, pending);\n return await pending;\n }\n\n private async collectionStateForBackend(\n backend: SearchBackend,\n memoryDir: string,\n collection: string,\n options: {\n skipAutoCreate: boolean;\n execution?: SearchExecutionOptions;\n },\n ): Promise<CollectionState> {\n if (options.skipAutoCreate) {\n if (!backend.checkCollection) return \"unknown\";\n const collectionState = await backend\n .checkCollection(collection, options.execution)\n .catch(() => \"unknown\" as const);\n return collectionState === \"missing\" ? \"unknown\" : collectionState;\n }\n return await backend.ensureCollection(memoryDir, collection, options.execution).catch(() => \"unknown\" as const);\n }\n}\n\nfunction filterNamespaceSubtreeResults(\n record: NamespaceBackendRecord,\n results: QmdSearchResult[],\n): QmdSearchResult[] {\n if (!record.filtersNestedNamespaces) return results;\n return results.filter((result) =>\n !pathIsInsideNamespaceSubtree(record.memoryDir, record.collection, result.path)\n );\n}\n\nfunction backendSearchLimit(\n record: NamespaceBackendRecord,\n maxResults: number,\n): number {\n if (!record.filtersNestedNamespaces) return maxResults;\n return Math.max(\n maxResults,\n maxResults * NESTED_NAMESPACE_FILTER_OVERFETCH_FACTOR,\n NESTED_NAMESPACE_FILTER_OVERFETCH_MIN,\n );\n}\n\nfunction pathIsInsideNamespaceSubtree(\n memoryDir: string,\n collection: string,\n resultPath: string | undefined,\n): boolean {\n if (!resultPath) return false;\n const normalizedResultPath = normalizeQmdResultPath(resultPath, collection);\n const memoryRoot = path.resolve(memoryDir);\n const namespacesRoot = path.join(memoryRoot, \"namespaces\");\n const candidate = path.isAbsolute(normalizedResultPath)\n ? path.normalize(normalizedResultPath)\n : path.resolve(memoryRoot, normalizedResultPath);\n const relative = path.relative(namespacesRoot, candidate);\n return relative === \"\" || (!relative.startsWith(\"..\") && !path.isAbsolute(relative));\n}\n\nfunction normalizeQmdResultPath(resultPath: string, collection: string): string {\n let value = resultPath.trim();\n if (value.startsWith(\"qmd://\")) {\n try {\n const parsed = new URL(value);\n if (parsed.protocol === \"qmd:\" && parsed.hostname === collection) {\n value = decodeURIComponent(parsed.pathname.replace(/^\\/+/, \"\"));\n }\n } catch {\n const remainder = value.slice(\"qmd://\".length);\n const slashIndex = remainder.indexOf(\"/\");\n if (slashIndex !== -1) {\n value = remainder.slice(slashIndex + 1);\n }\n }\n }\n\n const collectionPrefix = `${collection}/`;\n if (value.startsWith(collectionPrefix)) {\n value = value.slice(collectionPrefix.length);\n }\n return value;\n}\n\nfunction mergeNamespaceSearchResults(\n lists: Array<{ namespace: string; results: QmdSearchResult[] }>,\n maxResults: number,\n): QmdSearchResult[] {\n const merged = new Map<string, QmdSearchResult>();\n\n for (const { namespace, results } of lists) {\n for (const result of results) {\n const key = `${namespace}\\0${result.path || result.docid}`;\n const existing = merged.get(key);\n if (!existing) {\n merged.set(key, result);\n continue;\n }\n if (result.score > existing.score) {\n merged.set(key, {\n ...result,\n snippet: existing.snippet || result.snippet || \"\",\n });\n }\n }\n }\n\n return [...merged.values()]\n .sort((a, b) => b.score - a.score)\n .slice(0, maxResults);\n}\n"],"mappings":";;;;;;;;;AAAA,OAAO,UAAU;AAUjB,IAAM,2CAA2C;AACjD,IAAM,wCAAwC;AAEvC,SAAS,wBACd,gBACA,WACA,SAIQ;AACR,QAAM,UAAU,2BAA2B,SAAS;AACpD,QAAM,mBAAmB,2BAA2B,SAAS,oBAAoB,EAAE,KAAK;AACxF,MACE,SAAS,+BAA+B,QACxC,YAAY,kBACZ;AACA,WAAO;AAAA,EACT;AAEA,SAAO,GAAG,cAAc,KAAK,uBAAuB,WAAW,gBAAgB,CAAC;AAClF;AAqB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ACT;AAEA,SAAS,4BACP,OACA,YACmB;AACnB,QAAM,SAAS,oBAAI,IAA6B;AAEhD,aAAW,EAAE,WAAW,QAAQ,KAAK,OAAO;AAC1C,eAAW,UAAU,SAAS;AAC5B,YAAM,MAAM,GAAG,SAAS,KAAK,OAAO,QAAQ,OAAO,KAAK;AACxD,YAAM,WAAW,OAAO,IAAI,GAAG;AAC/B,UAAI,CAAC,UAAU;AACb,eAAO,IAAI,KAAK,MAAM;AACtB;AAAA,MACF;AACA,UAAI,OAAO,QAAQ,SAAS,OAAO;AACjC,eAAO,IAAI,KAAK;AAAA,UACd,GAAG;AAAA,UACH,SAAS,SAAS,WAAW,OAAO,WAAW;AAAA,QACjD,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAEA,SAAO,CAAC,GAAG,OAAO,OAAO,CAAC,EACvB,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK,EAChC,MAAM,GAAG,UAAU;AACxB;","names":[]}
|
|
@@ -1 +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\nexport interface SearchExecutionOptions {\n signal?: AbortSignal;\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 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 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 embedCollection(collection: string): Promise<void>;\n\n // ── Collection management ──\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":";AAkBO,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":[]}
|
|
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\nexport interface SearchExecutionOptions {\n signal?: AbortSignal;\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 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 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 embedCollection(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":";AAkBO,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":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-D6WVJIS3.js";
|
|
4
4
|
import {
|
|
5
5
|
namespaceCollectionName
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NMIOW7XG.js";
|
|
7
7
|
import {
|
|
8
8
|
namespaceIdentityFromToken,
|
|
9
9
|
namespaceIdentityToken
|
|
@@ -204,4 +204,4 @@ export {
|
|
|
204
204
|
verifyNamespaces,
|
|
205
205
|
runNamespaceMigration
|
|
206
206
|
};
|
|
207
|
-
//# sourceMappingURL=chunk-
|
|
207
|
+
//# sourceMappingURL=chunk-RRRCNIPK.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-ZRWB5D4H.js";
|
|
5
5
|
import {
|
|
6
6
|
TranscriptManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AGRPGAKR.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveCommitmentLedgerDir,
|
|
10
10
|
validateCommitmentLedgerEntry
|
|
@@ -268,4 +268,4 @@ export {
|
|
|
268
268
|
recordResumeBundle,
|
|
269
269
|
getResumeBundleStatus
|
|
270
270
|
};
|
|
271
|
-
//# sourceMappingURL=chunk-
|
|
271
|
+
//# sourceMappingURL=chunk-RZOBQ23O.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-CINZGPSJ.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveEnsureCollectionArgs
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QT4THOLT.js";
|
|
11
11
|
import {
|
|
12
12
|
log
|
|
13
13
|
} from "./chunk-2ODBA7MQ.js";
|
|
@@ -245,4 +245,4 @@ function isMeilisearchIndexNotFoundError(err) {
|
|
|
245
245
|
export {
|
|
246
246
|
MeilisearchBackend
|
|
247
247
|
};
|
|
248
|
-
//# sourceMappingURL=chunk-
|
|
248
|
+
//# sourceMappingURL=chunk-TQUWNX7C.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-CYEPCZN5.js";
|
|
4
4
|
import {
|
|
5
5
|
OramaBackend
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-76QTEJ2Q.js";
|
|
7
7
|
import {
|
|
8
8
|
RemoteSearchBackend
|
|
9
9
|
} from "./chunk-JOASJWQR.js";
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
} from "./chunk-RN7MUWON.js";
|
|
13
13
|
import {
|
|
14
14
|
LanceDbBackend
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FOVPSMGI.js";
|
|
16
16
|
import {
|
|
17
17
|
MeilisearchBackend
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TQUWNX7C.js";
|
|
19
19
|
import {
|
|
20
20
|
createConversationIndexBackend
|
|
21
21
|
} from "./chunk-7OGJQP7T.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "./chunk-E6ZDCOHM.js";
|
|
25
25
|
import {
|
|
26
26
|
QmdClient
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-I4COC5XW.js";
|
|
28
28
|
import {
|
|
29
29
|
log
|
|
30
30
|
} from "./chunk-2ODBA7MQ.js";
|
|
@@ -170,4 +170,4 @@ export {
|
|
|
170
170
|
createConversationSearchBackend,
|
|
171
171
|
createConversationIndexRuntime
|
|
172
172
|
};
|
|
173
|
-
//# sourceMappingURL=chunk-
|
|
173
|
+
//# sourceMappingURL=chunk-WPCCNSWO.js.map
|
|
@@ -231,7 +231,7 @@ import {
|
|
|
231
231
|
} from "./chunk-ZRWB5D4H.js";
|
|
232
232
|
import {
|
|
233
233
|
TranscriptManager
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-AGRPGAKR.js";
|
|
235
235
|
import {
|
|
236
236
|
NamespaceStorageRouter
|
|
237
237
|
} from "./chunk-D6WVJIS3.js";
|
|
@@ -317,11 +317,11 @@ import {
|
|
|
317
317
|
} from "./chunk-BEMWL2FZ.js";
|
|
318
318
|
import {
|
|
319
319
|
NamespaceSearchRouter
|
|
320
|
-
} from "./chunk-
|
|
320
|
+
} from "./chunk-NMIOW7XG.js";
|
|
321
321
|
import {
|
|
322
322
|
createConversationIndexRuntime,
|
|
323
323
|
createSearchBackend
|
|
324
|
-
} from "./chunk-
|
|
324
|
+
} from "./chunk-WPCCNSWO.js";
|
|
325
325
|
import {
|
|
326
326
|
NoopSearchBackend
|
|
327
327
|
} from "./chunk-CYEPCZN5.js";
|
|
@@ -333,7 +333,7 @@ import {
|
|
|
333
333
|
} from "./chunk-OIF36KGD.js";
|
|
334
334
|
import {
|
|
335
335
|
parseQmdExplain
|
|
336
|
-
} from "./chunk-
|
|
336
|
+
} from "./chunk-I4COC5XW.js";
|
|
337
337
|
import {
|
|
338
338
|
objectiveStateStoreOverrideForNamespace,
|
|
339
339
|
searchObjectiveStateSnapshots
|
|
@@ -14302,4 +14302,4 @@ export {
|
|
|
14302
14302
|
resolvePersistedMemoryRelativePath,
|
|
14303
14303
|
Orchestrator
|
|
14304
14304
|
};
|
|
14305
|
-
//# sourceMappingURL=chunk-
|
|
14305
|
+
//# sourceMappingURL=chunk-XUGVP7ZU.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listNamespaces
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RRRCNIPK.js";
|
|
4
4
|
import {
|
|
5
5
|
runConsolidationProvenanceCheck
|
|
6
6
|
} from "./chunk-AL4RAJL5.js";
|
|
@@ -1336,4 +1336,4 @@ export {
|
|
|
1336
1336
|
runBenchmarkRecall,
|
|
1337
1337
|
runOperatorRepair
|
|
1338
1338
|
};
|
|
1339
|
-
//# sourceMappingURL=chunk-
|
|
1339
|
+
//# sourceMappingURL=chunk-ZT6R3WR3.js.map
|
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-FQYFMIKG.js";
|
|
93
93
|
import "./chunk-MC4FJXPA.js";
|
|
94
94
|
import "./chunk-LQHDIS7L.js";
|
|
95
95
|
import "./chunk-7F7Z6MOS.js";
|
|
@@ -119,11 +119,11 @@ import "./chunk-OUELRE5E.js";
|
|
|
119
119
|
import "./chunk-GQL52GQ5.js";
|
|
120
120
|
import "./chunk-EVWIEEKZ.js";
|
|
121
121
|
import "./chunk-OTC2KOZ2.js";
|
|
122
|
-
import "./chunk-
|
|
122
|
+
import "./chunk-RZOBQ23O.js";
|
|
123
123
|
import "./chunk-WLGE6KEO.js";
|
|
124
124
|
import "./chunk-TGQ2NTWH.js";
|
|
125
|
-
import "./chunk-
|
|
126
|
-
import "./chunk-
|
|
125
|
+
import "./chunk-ZT6R3WR3.js";
|
|
126
|
+
import "./chunk-RRRCNIPK.js";
|
|
127
127
|
import "./chunk-3T74IZB3.js";
|
|
128
128
|
import "./chunk-HL4DB7TO.js";
|
|
129
129
|
import "./chunk-YNDLCWXS.js";
|
|
@@ -140,7 +140,7 @@ import "./chunk-UMKPSD35.js";
|
|
|
140
140
|
import "./chunk-W4RVMTHR.js";
|
|
141
141
|
import "./chunk-4BISW7RX.js";
|
|
142
142
|
import "./chunk-ZRWB5D4H.js";
|
|
143
|
-
import "./chunk-
|
|
143
|
+
import "./chunk-AGRPGAKR.js";
|
|
144
144
|
import "./chunk-S4DDLTPX.js";
|
|
145
145
|
import "./chunk-SFQ6QNL7.js";
|
|
146
146
|
import "./chunk-D6WVJIS3.js";
|
|
@@ -166,7 +166,7 @@ import "./chunk-Z5LAYHGJ.js";
|
|
|
166
166
|
import "./chunk-LBJBNWS2.js";
|
|
167
167
|
import "./chunk-HQ6NIBL6.js";
|
|
168
168
|
import "./chunk-OADWQ5CR.js";
|
|
169
|
-
import "./chunk-
|
|
169
|
+
import "./chunk-CNRZ6WJU.js";
|
|
170
170
|
import "./chunk-SEDEKFYQ.js";
|
|
171
171
|
import "./chunk-RKNJBZ55.js";
|
|
172
172
|
import "./chunk-J64TK33U.js";
|
|
@@ -175,10 +175,10 @@ import "./chunk-42NQ7AVG.js";
|
|
|
175
175
|
import "./chunk-TMSXWOBZ.js";
|
|
176
176
|
import "./chunk-7RXCMVFQ.js";
|
|
177
177
|
import "./chunk-7WV3F5DQ.js";
|
|
178
|
-
import "./chunk-
|
|
178
|
+
import "./chunk-FUXV6HSO.js";
|
|
179
179
|
import "./chunk-T4WDJPEZ.js";
|
|
180
180
|
import "./chunk-D24OXEPB.js";
|
|
181
|
-
import "./chunk-
|
|
181
|
+
import "./chunk-5ETA6OAS.js";
|
|
182
182
|
import "./chunk-GDASG7NC.js";
|
|
183
183
|
import "./chunk-GDB4J2H3.js";
|
|
184
184
|
import "./chunk-NT5TINK5.js";
|
|
@@ -192,14 +192,14 @@ import "./chunk-5RIRL3XL.js";
|
|
|
192
192
|
import "./chunk-JGSKJHF7.js";
|
|
193
193
|
import "./chunk-FF4KLI5W.js";
|
|
194
194
|
import "./chunk-BEMWL2FZ.js";
|
|
195
|
-
import "./chunk-
|
|
196
|
-
import "./chunk-
|
|
195
|
+
import "./chunk-NMIOW7XG.js";
|
|
196
|
+
import "./chunk-WPCCNSWO.js";
|
|
197
197
|
import "./chunk-CYEPCZN5.js";
|
|
198
|
-
import "./chunk-
|
|
198
|
+
import "./chunk-76QTEJ2Q.js";
|
|
199
199
|
import "./chunk-JOASJWQR.js";
|
|
200
200
|
import "./chunk-RN7MUWON.js";
|
|
201
|
-
import "./chunk-
|
|
202
|
-
import "./chunk-
|
|
201
|
+
import "./chunk-FOVPSMGI.js";
|
|
202
|
+
import "./chunk-TQUWNX7C.js";
|
|
203
203
|
import "./chunk-Q4CAQGKQ.js";
|
|
204
204
|
import "./chunk-CINZGPSJ.js";
|
|
205
205
|
import "./chunk-ZFXCQPNO.js";
|
|
@@ -207,8 +207,8 @@ import "./chunk-7OGJQP7T.js";
|
|
|
207
207
|
import "./chunk-E6ZDCOHM.js";
|
|
208
208
|
import "./chunk-OIF36KGD.js";
|
|
209
209
|
import "./chunk-7DTASS5T.js";
|
|
210
|
-
import "./chunk-
|
|
211
|
-
import "./chunk-
|
|
210
|
+
import "./chunk-I4COC5XW.js";
|
|
211
|
+
import "./chunk-QT4THOLT.js";
|
|
212
212
|
import "./chunk-BMFZLLNI.js";
|
|
213
213
|
import "./chunk-CI7RKSRE.js";
|
|
214
214
|
import "./chunk-6HMYUWXR.js";
|
package/dist/index.js
CHANGED
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
registerTrainingExportAdapter,
|
|
95
95
|
runBulkImportCliCommand,
|
|
96
96
|
runWearablesCliCommand
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-FQYFMIKG.js";
|
|
98
98
|
import "./chunk-MC4FJXPA.js";
|
|
99
99
|
import "./chunk-LQHDIS7L.js";
|
|
100
100
|
import "./chunk-7F7Z6MOS.js";
|
|
@@ -137,7 +137,7 @@ import {
|
|
|
137
137
|
import "./chunk-GQL52GQ5.js";
|
|
138
138
|
import "./chunk-EVWIEEKZ.js";
|
|
139
139
|
import "./chunk-OTC2KOZ2.js";
|
|
140
|
-
import "./chunk-
|
|
140
|
+
import "./chunk-RZOBQ23O.js";
|
|
141
141
|
import {
|
|
142
142
|
parseXrayBudgetFlag,
|
|
143
143
|
parseXrayCliOptions
|
|
@@ -147,8 +147,8 @@ import {
|
|
|
147
147
|
isAgentAccessSecretRef,
|
|
148
148
|
resolveAgentAccessAuthToken
|
|
149
149
|
} from "./chunk-TGQ2NTWH.js";
|
|
150
|
-
import "./chunk-
|
|
151
|
-
import "./chunk-
|
|
150
|
+
import "./chunk-ZT6R3WR3.js";
|
|
151
|
+
import "./chunk-RRRCNIPK.js";
|
|
152
152
|
import {
|
|
153
153
|
parseStrictCliDate
|
|
154
154
|
} from "./chunk-3T74IZB3.js";
|
|
@@ -191,7 +191,7 @@ import {
|
|
|
191
191
|
saveTaxonomy,
|
|
192
192
|
validateSlug,
|
|
193
193
|
validateTaxonomy
|
|
194
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-XUGVP7ZU.js";
|
|
195
195
|
import {
|
|
196
196
|
WEARABLE_SOURCE_PREFIX,
|
|
197
197
|
buildExtractionTurns,
|
|
@@ -389,7 +389,7 @@ import "./chunk-UMKPSD35.js";
|
|
|
389
389
|
import "./chunk-W4RVMTHR.js";
|
|
390
390
|
import "./chunk-4BISW7RX.js";
|
|
391
391
|
import "./chunk-ZRWB5D4H.js";
|
|
392
|
-
import "./chunk-
|
|
392
|
+
import "./chunk-AGRPGAKR.js";
|
|
393
393
|
import {
|
|
394
394
|
SESSION_CHANNEL_TYPE,
|
|
395
395
|
legacyParserReadbackDir,
|
|
@@ -495,7 +495,7 @@ import "./chunk-HQ6NIBL6.js";
|
|
|
495
495
|
import "./chunk-OADWQ5CR.js";
|
|
496
496
|
import {
|
|
497
497
|
EngramAccessHttpServer
|
|
498
|
-
} from "./chunk-
|
|
498
|
+
} from "./chunk-CNRZ6WJU.js";
|
|
499
499
|
import "./chunk-SEDEKFYQ.js";
|
|
500
500
|
import "./chunk-RKNJBZ55.js";
|
|
501
501
|
import "./chunk-J64TK33U.js";
|
|
@@ -509,7 +509,7 @@ import {
|
|
|
509
509
|
} from "./chunk-7WV3F5DQ.js";
|
|
510
510
|
import {
|
|
511
511
|
EngramMcpServer
|
|
512
|
-
} from "./chunk-
|
|
512
|
+
} from "./chunk-FUXV6HSO.js";
|
|
513
513
|
import {
|
|
514
514
|
REMNIC_CHATGPT_MEMORY_INSPECTOR_CANONICAL_TOOL,
|
|
515
515
|
REMNIC_CHATGPT_MEMORY_INSPECTOR_MIME_TYPE,
|
|
@@ -530,7 +530,7 @@ import {
|
|
|
530
530
|
EngramAccessService,
|
|
531
531
|
computeProcedureStats,
|
|
532
532
|
formatProcedureStatsText
|
|
533
|
-
} from "./chunk-
|
|
533
|
+
} from "./chunk-5ETA6OAS.js";
|
|
534
534
|
import "./chunk-GDASG7NC.js";
|
|
535
535
|
import "./chunk-GDB4J2H3.js";
|
|
536
536
|
import {
|
|
@@ -565,20 +565,20 @@ import {
|
|
|
565
565
|
storagePathHash
|
|
566
566
|
} from "./chunk-FF4KLI5W.js";
|
|
567
567
|
import "./chunk-BEMWL2FZ.js";
|
|
568
|
-
import "./chunk-
|
|
569
|
-
import "./chunk-
|
|
568
|
+
import "./chunk-NMIOW7XG.js";
|
|
569
|
+
import "./chunk-WPCCNSWO.js";
|
|
570
570
|
import "./chunk-CYEPCZN5.js";
|
|
571
571
|
import {
|
|
572
572
|
OramaBackend
|
|
573
|
-
} from "./chunk-
|
|
573
|
+
} from "./chunk-76QTEJ2Q.js";
|
|
574
574
|
import "./chunk-JOASJWQR.js";
|
|
575
575
|
import "./chunk-RN7MUWON.js";
|
|
576
576
|
import {
|
|
577
577
|
LanceDbBackend
|
|
578
|
-
} from "./chunk-
|
|
578
|
+
} from "./chunk-FOVPSMGI.js";
|
|
579
579
|
import {
|
|
580
580
|
MeilisearchBackend
|
|
581
|
-
} from "./chunk-
|
|
581
|
+
} from "./chunk-TQUWNX7C.js";
|
|
582
582
|
import "./chunk-Q4CAQGKQ.js";
|
|
583
583
|
import "./chunk-CINZGPSJ.js";
|
|
584
584
|
import "./chunk-ZFXCQPNO.js";
|
|
@@ -588,8 +588,8 @@ import "./chunk-OIF36KGD.js";
|
|
|
588
588
|
import "./chunk-7DTASS5T.js";
|
|
589
589
|
import {
|
|
590
590
|
QmdClient
|
|
591
|
-
} from "./chunk-
|
|
592
|
-
import "./chunk-
|
|
591
|
+
} from "./chunk-I4COC5XW.js";
|
|
592
|
+
import "./chunk-QT4THOLT.js";
|
|
593
593
|
import "./chunk-BMFZLLNI.js";
|
|
594
594
|
import {
|
|
595
595
|
isLcmMessagePartKind,
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
listNamespaces,
|
|
3
3
|
runNamespaceMigration,
|
|
4
4
|
verifyNamespaces
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-RRRCNIPK.js";
|
|
6
6
|
import "../chunk-D6WVJIS3.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-NMIOW7XG.js";
|
|
8
|
+
import "../chunk-WPCCNSWO.js";
|
|
9
9
|
import "../chunk-CYEPCZN5.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-76QTEJ2Q.js";
|
|
11
11
|
import "../chunk-JOASJWQR.js";
|
|
12
12
|
import "../chunk-RN7MUWON.js";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-FOVPSMGI.js";
|
|
14
|
+
import "../chunk-TQUWNX7C.js";
|
|
15
15
|
import "../chunk-Q4CAQGKQ.js";
|
|
16
16
|
import "../chunk-CINZGPSJ.js";
|
|
17
17
|
import "../chunk-ZFXCQPNO.js";
|
|
@@ -19,8 +19,8 @@ import "../chunk-7OGJQP7T.js";
|
|
|
19
19
|
import "../chunk-E6ZDCOHM.js";
|
|
20
20
|
import "../chunk-OIF36KGD.js";
|
|
21
21
|
import "../chunk-7DTASS5T.js";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-I4COC5XW.js";
|
|
23
|
+
import "../chunk-QT4THOLT.js";
|
|
24
24
|
import "../chunk-O75CRYGF.js";
|
|
25
25
|
import "../chunk-3ONXXHQO.js";
|
|
26
26
|
import "../chunk-A4BTPHIN.js";
|
|
@@ -42,6 +42,7 @@ declare class NamespaceSearchRouter {
|
|
|
42
42
|
/** Release any per-namespace backend handles held by cached records. */
|
|
43
43
|
dispose(): Promise<void>;
|
|
44
44
|
private backendRecordFor;
|
|
45
|
+
private collectionStateForBackend;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
export { NamespaceSearchRouter, namespaceCollectionName };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NamespaceSearchRouter,
|
|
3
3
|
namespaceCollectionName
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-NMIOW7XG.js";
|
|
5
|
+
import "../chunk-WPCCNSWO.js";
|
|
6
6
|
import "../chunk-CYEPCZN5.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-76QTEJ2Q.js";
|
|
8
8
|
import "../chunk-JOASJWQR.js";
|
|
9
9
|
import "../chunk-RN7MUWON.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-FOVPSMGI.js";
|
|
11
|
+
import "../chunk-TQUWNX7C.js";
|
|
12
12
|
import "../chunk-Q4CAQGKQ.js";
|
|
13
13
|
import "../chunk-CINZGPSJ.js";
|
|
14
14
|
import "../chunk-ZFXCQPNO.js";
|
|
@@ -16,8 +16,8 @@ import "../chunk-7OGJQP7T.js";
|
|
|
16
16
|
import "../chunk-E6ZDCOHM.js";
|
|
17
17
|
import "../chunk-OIF36KGD.js";
|
|
18
18
|
import "../chunk-7DTASS5T.js";
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-I4COC5XW.js";
|
|
20
|
+
import "../chunk-QT4THOLT.js";
|
|
21
21
|
import "../chunk-O75CRYGF.js";
|
|
22
22
|
import "../chunk-3ONXXHQO.js";
|
|
23
23
|
import "../chunk-CPPS65WS.js";
|