@remnic/core 1.1.27 → 1.1.29
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 +5 -5
- package/dist/active-recall.js +1 -1
- package/dist/{chunk-BJ3KMYTB.js → chunk-3TNBOMQT.js} +21 -10
- package/dist/chunk-3TNBOMQT.js.map +1 -0
- package/dist/{chunk-W7DK3CYM.js → chunk-575RMLWN.js} +2 -2
- package/dist/{chunk-S27EXIHY.js → chunk-6BFAEWQS.js} +2 -2
- package/dist/{chunk-TFORLO3O.js → chunk-6WV2HYTZ.js} +3 -3
- package/dist/{chunk-MVAOT247.js → chunk-CWWDIQZB.js} +4 -4
- package/dist/{chunk-NTUNYIF7.js → chunk-I5GLV3VE.js} +2 -2
- package/dist/{chunk-2QR3XXIC.js → chunk-MZH6EHNR.js} +3 -3
- package/dist/{chunk-2QR3XXIC.js.map → chunk-MZH6EHNR.js.map} +1 -1
- package/dist/{chunk-2DM72JF3.js → chunk-WDSIV3AK.js} +5 -5
- package/dist/{chunk-4CRG46BG.js → chunk-ZK7I7JYV.js} +2 -2
- package/dist/cli.js +8 -8
- package/dist/config.js +1 -1
- package/dist/index.js +9 -9
- package/dist/namespaces/migrate.js +4 -4
- package/dist/namespaces/search.js +3 -3
- package/dist/operator-toolkit.js +6 -6
- package/dist/orchestrator.js +4 -4
- package/dist/qmd.d.ts +3 -1
- package/dist/qmd.js +1 -1
- package/dist/resume-bundles.js +2 -2
- package/dist/schemas.d.ts +22 -22
- package/dist/search/factory.js +2 -2
- package/dist/search/index.js +2 -2
- package/dist/transfer/types.d.ts +12 -12
- package/package.json +1 -1
- package/src/config.ts +2 -2
- package/src/qmd.test.ts +65 -10
- package/src/qmd.ts +22 -9
- package/dist/chunk-BJ3KMYTB.js.map +0 -1
- /package/dist/{chunk-W7DK3CYM.js.map → chunk-575RMLWN.js.map} +0 -0
- /package/dist/{chunk-S27EXIHY.js.map → chunk-6BFAEWQS.js.map} +0 -0
- /package/dist/{chunk-TFORLO3O.js.map → chunk-6WV2HYTZ.js.map} +0 -0
- /package/dist/{chunk-MVAOT247.js.map → chunk-CWWDIQZB.js.map} +0 -0
- /package/dist/{chunk-NTUNYIF7.js.map → chunk-I5GLV3VE.js.map} +0 -0
- /package/dist/{chunk-2DM72JF3.js.map → chunk-WDSIV3AK.js.map} +0 -0
- /package/dist/{chunk-4CRG46BG.js.map → chunk-ZK7I7JYV.js.map} +0 -0
package/dist/transfer/types.d.ts
CHANGED
|
@@ -313,13 +313,13 @@ declare const CapsuleBlockSchema: z.ZodObject<{
|
|
|
313
313
|
peerProfiles: boolean;
|
|
314
314
|
}>;
|
|
315
315
|
}, "strip", z.ZodTypeAny, {
|
|
316
|
+
schemaVersion: string;
|
|
316
317
|
includes: {
|
|
317
318
|
procedural: boolean;
|
|
318
319
|
taxonomy: boolean;
|
|
319
320
|
identityAnchors: boolean;
|
|
320
321
|
peerProfiles: boolean;
|
|
321
322
|
};
|
|
322
|
-
schemaVersion: string;
|
|
323
323
|
id: string;
|
|
324
324
|
description: string;
|
|
325
325
|
version: string;
|
|
@@ -334,13 +334,13 @@ declare const CapsuleBlockSchema: z.ZodObject<{
|
|
|
334
334
|
directAnswerEnabled: boolean;
|
|
335
335
|
};
|
|
336
336
|
}, {
|
|
337
|
+
schemaVersion: string;
|
|
337
338
|
includes: {
|
|
338
339
|
procedural: boolean;
|
|
339
340
|
taxonomy: boolean;
|
|
340
341
|
identityAnchors: boolean;
|
|
341
342
|
peerProfiles: boolean;
|
|
342
343
|
};
|
|
343
|
-
schemaVersion: string;
|
|
344
344
|
id: string;
|
|
345
345
|
description: string;
|
|
346
346
|
version: string;
|
|
@@ -464,13 +464,13 @@ declare const ExportManifestV2Schema: z.ZodObject<{
|
|
|
464
464
|
peerProfiles: boolean;
|
|
465
465
|
}>;
|
|
466
466
|
}, "strip", z.ZodTypeAny, {
|
|
467
|
+
schemaVersion: string;
|
|
467
468
|
includes: {
|
|
468
469
|
procedural: boolean;
|
|
469
470
|
taxonomy: boolean;
|
|
470
471
|
identityAnchors: boolean;
|
|
471
472
|
peerProfiles: boolean;
|
|
472
473
|
};
|
|
473
|
-
schemaVersion: string;
|
|
474
474
|
id: string;
|
|
475
475
|
description: string;
|
|
476
476
|
version: string;
|
|
@@ -485,13 +485,13 @@ declare const ExportManifestV2Schema: z.ZodObject<{
|
|
|
485
485
|
directAnswerEnabled: boolean;
|
|
486
486
|
};
|
|
487
487
|
}, {
|
|
488
|
+
schemaVersion: string;
|
|
488
489
|
includes: {
|
|
489
490
|
procedural: boolean;
|
|
490
491
|
taxonomy: boolean;
|
|
491
492
|
identityAnchors: boolean;
|
|
492
493
|
peerProfiles: boolean;
|
|
493
494
|
};
|
|
494
|
-
schemaVersion: string;
|
|
495
495
|
id: string;
|
|
496
496
|
description: string;
|
|
497
497
|
version: string;
|
|
@@ -518,13 +518,13 @@ declare const ExportManifestV2Schema: z.ZodObject<{
|
|
|
518
518
|
pluginVersion: string;
|
|
519
519
|
includesTranscripts: boolean;
|
|
520
520
|
capsule: {
|
|
521
|
+
schemaVersion: string;
|
|
521
522
|
includes: {
|
|
522
523
|
procedural: boolean;
|
|
523
524
|
taxonomy: boolean;
|
|
524
525
|
identityAnchors: boolean;
|
|
525
526
|
peerProfiles: boolean;
|
|
526
527
|
};
|
|
527
|
-
schemaVersion: string;
|
|
528
528
|
id: string;
|
|
529
529
|
description: string;
|
|
530
530
|
version: string;
|
|
@@ -551,13 +551,13 @@ declare const ExportManifestV2Schema: z.ZodObject<{
|
|
|
551
551
|
pluginVersion: string;
|
|
552
552
|
includesTranscripts: boolean;
|
|
553
553
|
capsule: {
|
|
554
|
+
schemaVersion: string;
|
|
554
555
|
includes: {
|
|
555
556
|
procedural: boolean;
|
|
556
557
|
taxonomy: boolean;
|
|
557
558
|
identityAnchors: boolean;
|
|
558
559
|
peerProfiles: boolean;
|
|
559
560
|
};
|
|
560
|
-
schemaVersion: string;
|
|
561
561
|
id: string;
|
|
562
562
|
description: string;
|
|
563
563
|
version: string;
|
|
@@ -683,13 +683,13 @@ declare const ExportBundleV2Schema: z.ZodObject<{
|
|
|
683
683
|
peerProfiles: boolean;
|
|
684
684
|
}>;
|
|
685
685
|
}, "strip", z.ZodTypeAny, {
|
|
686
|
+
schemaVersion: string;
|
|
686
687
|
includes: {
|
|
687
688
|
procedural: boolean;
|
|
688
689
|
taxonomy: boolean;
|
|
689
690
|
identityAnchors: boolean;
|
|
690
691
|
peerProfiles: boolean;
|
|
691
692
|
};
|
|
692
|
-
schemaVersion: string;
|
|
693
693
|
id: string;
|
|
694
694
|
description: string;
|
|
695
695
|
version: string;
|
|
@@ -704,13 +704,13 @@ declare const ExportBundleV2Schema: z.ZodObject<{
|
|
|
704
704
|
directAnswerEnabled: boolean;
|
|
705
705
|
};
|
|
706
706
|
}, {
|
|
707
|
+
schemaVersion: string;
|
|
707
708
|
includes: {
|
|
708
709
|
procedural: boolean;
|
|
709
710
|
taxonomy: boolean;
|
|
710
711
|
identityAnchors: boolean;
|
|
711
712
|
peerProfiles: boolean;
|
|
712
713
|
};
|
|
713
|
-
schemaVersion: string;
|
|
714
714
|
id: string;
|
|
715
715
|
description: string;
|
|
716
716
|
version: string;
|
|
@@ -737,13 +737,13 @@ declare const ExportBundleV2Schema: z.ZodObject<{
|
|
|
737
737
|
pluginVersion: string;
|
|
738
738
|
includesTranscripts: boolean;
|
|
739
739
|
capsule: {
|
|
740
|
+
schemaVersion: string;
|
|
740
741
|
includes: {
|
|
741
742
|
procedural: boolean;
|
|
742
743
|
taxonomy: boolean;
|
|
743
744
|
identityAnchors: boolean;
|
|
744
745
|
peerProfiles: boolean;
|
|
745
746
|
};
|
|
746
|
-
schemaVersion: string;
|
|
747
747
|
id: string;
|
|
748
748
|
description: string;
|
|
749
749
|
version: string;
|
|
@@ -770,13 +770,13 @@ declare const ExportBundleV2Schema: z.ZodObject<{
|
|
|
770
770
|
pluginVersion: string;
|
|
771
771
|
includesTranscripts: boolean;
|
|
772
772
|
capsule: {
|
|
773
|
+
schemaVersion: string;
|
|
773
774
|
includes: {
|
|
774
775
|
procedural: boolean;
|
|
775
776
|
taxonomy: boolean;
|
|
776
777
|
identityAnchors: boolean;
|
|
777
778
|
peerProfiles: boolean;
|
|
778
779
|
};
|
|
779
|
-
schemaVersion: string;
|
|
780
780
|
id: string;
|
|
781
781
|
description: string;
|
|
782
782
|
version: string;
|
|
@@ -815,13 +815,13 @@ declare const ExportBundleV2Schema: z.ZodObject<{
|
|
|
815
815
|
pluginVersion: string;
|
|
816
816
|
includesTranscripts: boolean;
|
|
817
817
|
capsule: {
|
|
818
|
+
schemaVersion: string;
|
|
818
819
|
includes: {
|
|
819
820
|
procedural: boolean;
|
|
820
821
|
taxonomy: boolean;
|
|
821
822
|
identityAnchors: boolean;
|
|
822
823
|
peerProfiles: boolean;
|
|
823
824
|
};
|
|
824
|
-
schemaVersion: string;
|
|
825
825
|
id: string;
|
|
826
826
|
description: string;
|
|
827
827
|
version: string;
|
|
@@ -854,13 +854,13 @@ declare const ExportBundleV2Schema: z.ZodObject<{
|
|
|
854
854
|
pluginVersion: string;
|
|
855
855
|
includesTranscripts: boolean;
|
|
856
856
|
capsule: {
|
|
857
|
+
schemaVersion: string;
|
|
857
858
|
includes: {
|
|
858
859
|
procedural: boolean;
|
|
859
860
|
taxonomy: boolean;
|
|
860
861
|
identityAnchors: boolean;
|
|
861
862
|
peerProfiles: boolean;
|
|
862
863
|
};
|
|
863
|
-
schemaVersion: string;
|
|
864
864
|
id: string;
|
|
865
865
|
description: string;
|
|
866
866
|
version: string;
|
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -96,14 +96,14 @@ function parseBoundedPositiveInteger(
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
function parseQmdSupportedVersion(value: unknown): string {
|
|
99
|
-
if (value === undefined || value === null) return "2.5.
|
|
99
|
+
if (value === undefined || value === null) return "2.5.3";
|
|
100
100
|
if (typeof value !== "string") {
|
|
101
101
|
throw new Error(`qmdSupportedVersion must be a semantic version string; got ${JSON.stringify(value)}`);
|
|
102
102
|
}
|
|
103
103
|
const normalized = value.trim();
|
|
104
104
|
if (!/^\d+\.\d+\.\d+$/.test(normalized)) {
|
|
105
105
|
throw new Error(
|
|
106
|
-
`qmdSupportedVersion must be a semantic version string like "2.5.
|
|
106
|
+
`qmdSupportedVersion must be a semantic version string like "2.5.3"; got ${JSON.stringify(value)}`,
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
109
|
return normalized;
|
package/src/qmd.test.ts
CHANGED
|
@@ -13,22 +13,22 @@ import {
|
|
|
13
13
|
} from "./qmd.js";
|
|
14
14
|
|
|
15
15
|
test("parseQmdVersion extracts semantic version from qmd output", () => {
|
|
16
|
-
assert.deepEqual(parseQmdVersion("qmd 2.5.
|
|
16
|
+
assert.deepEqual(parseQmdVersion("qmd 2.5.3 (abcdef)"), [2, 5, 3]);
|
|
17
17
|
assert.deepEqual(parseQmdVersion("v2.1.0"), [2, 1, 0]);
|
|
18
18
|
assert.equal(parseQmdVersion("Unknown command: doctor"), null);
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
test("parseQmdVersionOutput prefers qmd-labelled semantic version lines", () => {
|
|
22
22
|
assert.equal(
|
|
23
|
-
parseQmdVersionOutput("bun 1.2.0\nqmd 2.5.
|
|
24
|
-
"qmd 2.5.
|
|
23
|
+
parseQmdVersionOutput("bun 1.2.0\nqmd 2.5.3 (abcdef)", ""),
|
|
24
|
+
"qmd 2.5.3 (abcdef)",
|
|
25
25
|
);
|
|
26
26
|
assert.equal(parseQmdVersionOutput("wrapper ready", "v2.1.0"), "v2.1.0");
|
|
27
27
|
assert.equal(parseQmdVersionOutput("", ""), null);
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
test("resolveQmdCapabilities gates qmd 2.5 features by installed version", () => {
|
|
31
|
-
const current = resolveQmdCapabilities("qmd 2.5.
|
|
31
|
+
const current = resolveQmdCapabilities("qmd 2.5.3 (abcdef)");
|
|
32
32
|
assert.equal(current.v2McpQueryTool, true);
|
|
33
33
|
assert.equal(current.structuredSearches, true);
|
|
34
34
|
assert.equal(current.chunkStrategy, true);
|
|
@@ -41,6 +41,7 @@ test("resolveQmdCapabilities gates qmd 2.5 features by installed version", () =>
|
|
|
41
41
|
assert.equal(current.embedParallelism, true);
|
|
42
42
|
assert.equal(current.modelEnvConsistency, true);
|
|
43
43
|
assert.equal(current.scopedEmbed, true);
|
|
44
|
+
assert.equal(current.outputFormatFlag, true);
|
|
44
45
|
|
|
45
46
|
const older = resolveQmdCapabilities("qmd 2.1.0 (abcdef)");
|
|
46
47
|
assert.equal(older.v2McpQueryTool, true);
|
|
@@ -51,6 +52,11 @@ test("resolveQmdCapabilities gates qmd 2.5 features by installed version", () =>
|
|
|
51
52
|
assert.equal(older.absoluteSnippetLines, false);
|
|
52
53
|
assert.equal(older.forceCpu, false);
|
|
53
54
|
assert.equal(older.scopedEmbed, false);
|
|
55
|
+
assert.equal(older.outputFormatFlag, false);
|
|
56
|
+
|
|
57
|
+
const v251 = resolveQmdCapabilities("qmd 2.5.1");
|
|
58
|
+
assert.equal(v251.doctor, true);
|
|
59
|
+
assert.equal(v251.outputFormatFlag, false);
|
|
54
60
|
|
|
55
61
|
const v20 = resolveQmdCapabilities("qmd 2.0.0");
|
|
56
62
|
assert.equal(v20.stableSdk, true);
|
|
@@ -62,10 +68,10 @@ test("resolveQmdCapabilities gates qmd 2.5 features by installed version", () =>
|
|
|
62
68
|
});
|
|
63
69
|
|
|
64
70
|
test("shouldAutoUpgradeQmd only upgrades below Remnic supported version", () => {
|
|
65
|
-
assert.equal(shouldAutoUpgradeQmd("qmd 2.1.0", "2.5.
|
|
66
|
-
assert.equal(shouldAutoUpgradeQmd("qmd 2.5.
|
|
67
|
-
assert.equal(shouldAutoUpgradeQmd("qmd 2.6.0", "2.5.
|
|
68
|
-
assert.equal(shouldAutoUpgradeQmd("not installed", "2.5.
|
|
71
|
+
assert.equal(shouldAutoUpgradeQmd("qmd 2.1.0", "2.5.3"), true);
|
|
72
|
+
assert.equal(shouldAutoUpgradeQmd("qmd 2.5.3", "2.5.3"), false);
|
|
73
|
+
assert.equal(shouldAutoUpgradeQmd("qmd 2.6.0", "2.5.3"), false);
|
|
74
|
+
assert.equal(shouldAutoUpgradeQmd("not installed", "2.5.3"), false);
|
|
69
75
|
});
|
|
70
76
|
|
|
71
77
|
test("getQmdCommandName preserves write command detection behind qmd 2.5 index prefix", () => {
|
|
@@ -93,7 +99,7 @@ test("QmdClient applies chunk strategy to normal and forced embed args", async (
|
|
|
93
99
|
const client = new QmdClient("test", 5, {
|
|
94
100
|
qmdChunkStrategy: "regex",
|
|
95
101
|
});
|
|
96
|
-
(client as any).qmdCapabilities = resolveQmdCapabilities("qmd 2.5.
|
|
102
|
+
(client as any).qmdCapabilities = resolveQmdCapabilities("qmd 2.5.3");
|
|
97
103
|
assert.deepEqual((client as any).buildEmbedArgs("memory"), [
|
|
98
104
|
"embed",
|
|
99
105
|
"-c",
|
|
@@ -111,6 +117,55 @@ test("QmdClient applies chunk strategy to normal and forced embed args", async (
|
|
|
111
117
|
]);
|
|
112
118
|
});
|
|
113
119
|
|
|
120
|
+
test("QmdClient uses QMD 2.5.3 --format json for query subprocess output", async () => {
|
|
121
|
+
const { QmdClient } = await import("./qmd.js");
|
|
122
|
+
const client = new QmdClient("test", 5) as any;
|
|
123
|
+
client.available = true;
|
|
124
|
+
client.qmdCapabilities = resolveQmdCapabilities("qmd 2.5.3");
|
|
125
|
+
let observedArgs: string[] = [];
|
|
126
|
+
client.runQmdCommand = async (args: string[]) => {
|
|
127
|
+
observedArgs = args;
|
|
128
|
+
return { stdout: "[]", stderr: "" };
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
await client.searchViaSubprocess("memory query", "memory", 3);
|
|
132
|
+
|
|
133
|
+
assert.deepEqual(observedArgs, [
|
|
134
|
+
"query",
|
|
135
|
+
"memory query",
|
|
136
|
+
"-c",
|
|
137
|
+
"memory",
|
|
138
|
+
"--format",
|
|
139
|
+
"json",
|
|
140
|
+
"-n",
|
|
141
|
+
"3",
|
|
142
|
+
]);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test("QmdClient keeps legacy --json for older QMD query subprocess output", async () => {
|
|
146
|
+
const { QmdClient } = await import("./qmd.js");
|
|
147
|
+
const client = new QmdClient("test", 5) as any;
|
|
148
|
+
client.available = true;
|
|
149
|
+
client.qmdCapabilities = resolveQmdCapabilities("qmd 2.5.1");
|
|
150
|
+
let observedArgs: string[] = [];
|
|
151
|
+
client.runQmdCommand = async (args: string[]) => {
|
|
152
|
+
observedArgs = args;
|
|
153
|
+
return { stdout: "[]", stderr: "" };
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
await client.searchViaSubprocess("memory query", "memory", 3);
|
|
157
|
+
|
|
158
|
+
assert.deepEqual(observedArgs, [
|
|
159
|
+
"query",
|
|
160
|
+
"memory query",
|
|
161
|
+
"-c",
|
|
162
|
+
"memory",
|
|
163
|
+
"--json",
|
|
164
|
+
"-n",
|
|
165
|
+
"3",
|
|
166
|
+
]);
|
|
167
|
+
});
|
|
168
|
+
|
|
114
169
|
test("parseQmdExplain preserves qmd 2.5 nested RRF trace fields", () => {
|
|
115
170
|
assert.deepEqual(
|
|
116
171
|
parseQmdExplain({
|
|
@@ -184,7 +239,7 @@ test("QmdClient auto-upgrade throttle key is scoped by qmd target", async () =>
|
|
|
184
239
|
|
|
185
240
|
test("parseConfig exposes qmd 2.5 integration defaults and opt-in auto upgrade", () => {
|
|
186
241
|
const defaults = parseConfig({});
|
|
187
|
-
assert.equal(defaults.qmdSupportedVersion, "2.5.
|
|
242
|
+
assert.equal(defaults.qmdSupportedVersion, "2.5.3");
|
|
188
243
|
assert.equal(defaults.qmdAutoUpgradeEnabled, false);
|
|
189
244
|
assert.equal(defaults.qmdChunkStrategy, "auto");
|
|
190
245
|
assert.equal(defaults.qmdQueryRerankEnabled, true);
|
package/src/qmd.ts
CHANGED
|
@@ -73,6 +73,7 @@ export interface QmdCapabilities {
|
|
|
73
73
|
scopedEmbed: boolean;
|
|
74
74
|
safeStatusDeviceProbe: boolean;
|
|
75
75
|
mcpIndexSelection: boolean;
|
|
76
|
+
outputFormatFlag: boolean;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
export interface QmdVersionStatus {
|
|
@@ -104,7 +105,7 @@ const QMD_PROBE_TIMEOUT_MS = 8_000;
|
|
|
104
105
|
const QMD_UPDATE_BACKOFF_MS = 15 * 60 * 1000; // 15m
|
|
105
106
|
const QMD_EMBED_BACKOFF_MS = 60 * 60 * 1000; // 60m
|
|
106
107
|
const QMD_CLI_WARN_THROTTLE_MS = 15 * 60 * 1000; // 15m
|
|
107
|
-
export const QMD_SUPPORTED_VERSION = "2.5.
|
|
108
|
+
export const QMD_SUPPORTED_VERSION = "2.5.3";
|
|
108
109
|
const QMD_PACKAGE_NAME = "@tobilu/qmd";
|
|
109
110
|
const QMD_AUTO_UPGRADE_TIMEOUT_MS = 120_000;
|
|
110
111
|
const QMD_AUTO_UPGRADE_CHECK_INTERVAL_MS = 24 * 60 * 60_000;
|
|
@@ -312,6 +313,7 @@ export function resolveQmdCapabilities(version: string | null): QmdCapabilities
|
|
|
312
313
|
scopedEmbed: atLeast([2, 5, 0]),
|
|
313
314
|
safeStatusDeviceProbe: atLeast([2, 5, 0]),
|
|
314
315
|
mcpIndexSelection: atLeast([2, 5, 0]),
|
|
316
|
+
outputFormatFlag: atLeast([2, 5, 3]),
|
|
315
317
|
};
|
|
316
318
|
}
|
|
317
319
|
|
|
@@ -1763,6 +1765,14 @@ export class QmdClient implements SearchBackend {
|
|
|
1763
1765
|
}
|
|
1764
1766
|
}
|
|
1765
1767
|
|
|
1768
|
+
private addQmdJsonOutputArgs(args: string[]): void {
|
|
1769
|
+
if (this.qmdCapabilities.outputFormatFlag) {
|
|
1770
|
+
args.push("--format", "json");
|
|
1771
|
+
} else {
|
|
1772
|
+
args.push("--json");
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1766
1776
|
private addResolvedSearchOptionsToMcpArgs(
|
|
1767
1777
|
args: Record<string, unknown>,
|
|
1768
1778
|
options?: SearchQueryOptions,
|
|
@@ -1779,7 +1789,7 @@ export class QmdClient implements SearchBackend {
|
|
|
1779
1789
|
if (options?.rerank === false) {
|
|
1780
1790
|
args.rerank = false;
|
|
1781
1791
|
}
|
|
1782
|
-
// QMD
|
|
1792
|
+
// QMD MCP query does not expose chunkStrategy even though CLI/SDK
|
|
1783
1793
|
// search and embed do. Keep chunk strategy on CLI/embed paths only.
|
|
1784
1794
|
}
|
|
1785
1795
|
|
|
@@ -2220,7 +2230,9 @@ export class QmdClient implements SearchBackend {
|
|
|
2220
2230
|
|
|
2221
2231
|
const startedAtMs = Date.now();
|
|
2222
2232
|
try {
|
|
2223
|
-
const args = ["query", query, "-c", collection
|
|
2233
|
+
const args = ["query", query, "-c", collection];
|
|
2234
|
+
this.addQmdJsonOutputArgs(args);
|
|
2235
|
+
args.push("-n", String(maxResults));
|
|
2224
2236
|
this.addResolvedSearchOptionsToArgs(args, options);
|
|
2225
2237
|
const { stdout } = await this.runQmdCommand(args, QMD_TIMEOUT_MS, signal);
|
|
2226
2238
|
const durationMs = Date.now() - startedAtMs;
|
|
@@ -2249,11 +2261,10 @@ export class QmdClient implements SearchBackend {
|
|
|
2249
2261
|
if (this.available === false) return [];
|
|
2250
2262
|
const startedAtMs = Date.now();
|
|
2251
2263
|
try {
|
|
2252
|
-
const
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
);
|
|
2264
|
+
const args = ["search", query, "-c", collection];
|
|
2265
|
+
this.addQmdJsonOutputArgs(args);
|
|
2266
|
+
args.push("-n", String(maxResults));
|
|
2267
|
+
const { stdout } = await this.runQmdCommand(args, QMD_TIMEOUT_MS, signal);
|
|
2257
2268
|
log.debug(`QMD bm25: ${Date.now() - startedAtMs}ms`);
|
|
2258
2269
|
return parseQmdSearchStdout(stdout);
|
|
2259
2270
|
} catch (err) {
|
|
@@ -2300,7 +2311,9 @@ export class QmdClient implements SearchBackend {
|
|
|
2300
2311
|
|
|
2301
2312
|
const startedAtMs = Date.now();
|
|
2302
2313
|
try {
|
|
2303
|
-
const args = ["query", query
|
|
2314
|
+
const args = ["query", query];
|
|
2315
|
+
this.addQmdJsonOutputArgs(args);
|
|
2316
|
+
args.push("-n", String(maxResults));
|
|
2304
2317
|
this.addResolvedSearchOptionsToArgs(args, options);
|
|
2305
2318
|
const { stdout } = await this.runQmdCommand(args, QMD_TIMEOUT_MS, signal);
|
|
2306
2319
|
const durationMs = Date.now() - startedAtMs;
|