@memnexus-ai/cli 1.7.222 → 1.7.224

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.
@@ -0,0 +1,364 @@
1
+ "use strict";
2
+ /**
3
+ * Renderable retrieval results — retrieval health that cannot be dropped.
4
+ *
5
+ * WHY THIS MODULE EXISTS
6
+ *
7
+ * A transient retrieval failure that produces a confident-looking empty (or
8
+ * short) answer is worse than a sustained outage. An outage is obvious and the
9
+ * caller retries. A quiet partial failure is not: the agent reads "no results",
10
+ * records "no prior art found" as a fact, and moves on. Nobody re-runs the
11
+ * query, so the wrong conclusion outlives the failure that caused it.
12
+ *
13
+ * The CLI already had a degraded-retrieval warning. It had never fired once:
14
+ * it read `meta.degraded`, while the digest wire carries `metadata.degraded`
15
+ * (GH #5124). Its test constructed the fictional shape the buggy code expected,
16
+ * so the suite stayed green over a feature that had never worked. The root
17
+ * cause was not one typo — it was that every render path took the raw response
18
+ * as `any` and each one was free to forget the health check.
19
+ *
20
+ * THE DESIGN
21
+ *
22
+ * Health is carried structurally, not by convention:
23
+ *
24
+ * - `RenderableSearchResult`, `RenderableDigestResult` and
25
+ * `RenderableContextBriefing` have PRIVATE constructors. The
26
+ * `from*Response` factories are the only way to build one.
27
+ * - Those factories are the ONE place the wire-field mapping lives —
28
+ * `meta.degraded` (search, build-context) vs `metadata.degraded` (digest),
29
+ * the naming inconsistency that caused #5124.
30
+ * - Every renderable exposes `health: DegradationState`, where `degraded` is a
31
+ * required boolean and `failures` is always an array (empty when healthy).
32
+ * There is no `undefined` to forget to check.
33
+ * - Raw wire types are NOT exported from this module. A render path cannot
34
+ * take the raw response instead, and a new output format cannot be written
35
+ * without accepting a value that carries health.
36
+ *
37
+ * OUTPUT CONVENTIONS
38
+ *
39
+ * - The warning line goes to STDERR in every format. stderr is the one channel
40
+ * that survives `| jq`, `--id-only` piping and `--format json`, where stdout
41
+ * must stay machine-parseable.
42
+ * - Object-shaped JSON/YAML payloads additionally carry a `health` object on
43
+ * stdout, and only when degraded — matching the server convention that a
44
+ * healthy response gains no new fields (search.schema.ts).
45
+ *
46
+ * This module deliberately has no imports: colouring is the caller's job, and a
47
+ * dependency-free module keeps the type-level enforcement test cheap to run.
48
+ */
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.RenderableContextBriefing = exports.RenderableDigestResult = exports.RenderableSearchResult = exports.DEGRADED_HEADLINE_SUFFIX = exports.DEGRADED_MARKER = void 0;
51
+ exports.degradationWarningLine = degradationWarningLine;
52
+ exports.degradationSummaryLine = degradationSummaryLine;
53
+ exports.degradationHeadlineSuffix = degradationHeadlineSuffix;
54
+ /** Shared marker text. Every surface uses this string so it is greppable. */
55
+ exports.DEGRADED_MARKER = '⚠ Degraded retrieval';
56
+ /** Suffix appended to a command's headline when the response is degraded. */
57
+ exports.DEGRADED_HEADLINE_SUFFIX = ' — INCOMPLETE (degraded retrieval)';
58
+ const HEALTHY = Object.freeze({
59
+ degraded: false,
60
+ failures: Object.freeze([]),
61
+ });
62
+ /**
63
+ * Branch names are server-supplied and land on stderr, which agents read.
64
+ * Constrain them to an identifier shape and cap the count rather than echoing
65
+ * arbitrary text: an unbounded string here is an injection channel into agent
66
+ * context (and can carry ANSI escapes from a hostile apiUrl).
67
+ */
68
+ const BRANCH_NAME_PATTERN = /^[A-Za-z0-9_-]{1,32}$/;
69
+ const MAX_BRANCH_NAMES = 8;
70
+ function toStatus(raw) {
71
+ return raw === 'timeout' || raw === 'error' ? raw : 'unknown';
72
+ }
73
+ /**
74
+ * Read a wire `branchFailures` array. Accepts both shapes the API emits today:
75
+ * plain strings, and `{ name, status }` objects (search adds `reason`, digest
76
+ * adds `error`; neither is rendered).
77
+ */
78
+ function readBranchFailures(raw) {
79
+ if (!Array.isArray(raw))
80
+ return HEALTHY.failures;
81
+ const out = [];
82
+ for (const entry of raw) {
83
+ const name = typeof entry === 'string' ? entry : (entry?.name ?? entry?.branch);
84
+ if (typeof name !== 'string' || !BRANCH_NAME_PATTERN.test(name))
85
+ continue;
86
+ out.push({ name, status: toStatus(entry?.status) });
87
+ if (out.length >= MAX_BRANCH_NAMES)
88
+ break;
89
+ }
90
+ return Object.freeze(out);
91
+ }
92
+ /**
93
+ * Map a container that carries the PR-3 partial-failure contract
94
+ * (`degraded` + `branchFailures`) into a DegradationState.
95
+ *
96
+ * This is the single place that reads those field names. Callers pass
97
+ * `body.meta` (search, build-context) or `body.metadata` (digest) — the
98
+ * difference the #5124 bug lived in.
99
+ */
100
+ function readDegradation(container) {
101
+ const c = container;
102
+ if (!c || typeof c !== 'object' || c.degraded !== true)
103
+ return HEALTHY;
104
+ return Object.freeze({ degraded: true, failures: readBranchFailures(c.branchFailures) });
105
+ }
106
+ /**
107
+ * build-context reports failure per SECTION rather than per search branch
108
+ * (`meta.timedOutSections` / `meta.failedSections`, memories.routes.ts). Map
109
+ * both lists onto the same BranchFailure vocabulary so one marker renderer
110
+ * serves every surface.
111
+ */
112
+ function readSectionDegradation(container) {
113
+ const c = container;
114
+ if (!c || typeof c !== 'object' || c.degraded !== true)
115
+ return HEALTHY;
116
+ const failures = [];
117
+ const collect = (raw, status) => {
118
+ if (!Array.isArray(raw))
119
+ return;
120
+ for (const name of raw) {
121
+ if (typeof name !== 'string' || !BRANCH_NAME_PATTERN.test(name))
122
+ continue;
123
+ if (failures.length >= MAX_BRANCH_NAMES)
124
+ return;
125
+ failures.push({ name, status });
126
+ }
127
+ };
128
+ collect(c.timedOutSections, 'timeout');
129
+ collect(c.failedSections, 'error');
130
+ return Object.freeze({ degraded: true, failures: Object.freeze(failures) });
131
+ }
132
+ /** Serialisable form of health, embedded in object-shaped JSON/YAML payloads. */
133
+ function healthPayload(health) {
134
+ return {
135
+ degraded: health.degraded,
136
+ failures: health.failures.map((f) => ({ name: f.name, status: f.status })),
137
+ };
138
+ }
139
+ /**
140
+ * Replace a wire container's raw `branchFailures` with the sanitised set.
141
+ *
142
+ * Sanitising only the `health` fold is not enough: `--format json` and
143
+ * `--format yaml` also emit the response body, so the ORIGINAL server-supplied
144
+ * `meta.branchFailures` / `metadata.branchFailures` would still reach stdout
145
+ * unfiltered — the same injection channel the identifier-shape filter exists to
146
+ * close, on the one format agents parse rather than read. JSON.stringify and
147
+ * js-yaml both escape C0 control bytes (checked: js-yaml v4 renders ESC as
148
+ * `\e` inside a double-quoted scalar, so no raw escape sequence reaches a
149
+ * terminal), but neither touches plain-text instructions, and plain text is
150
+ * what an agent acts on.
151
+ *
152
+ * Replacement rather than deletion: the failed branch names survive, in their
153
+ * filtered form. The digest shape's free-text `error` message does not — it is
154
+ * unbounded server-authored prose on a channel an agent parses, and the
155
+ * closed-vocabulary `status` already says how the branch failed.
156
+ */
157
+ function withSanitizedFailures(container, health) {
158
+ const c = container;
159
+ if (!c || typeof c !== 'object')
160
+ return c;
161
+ if (!('branchFailures' in c))
162
+ return c;
163
+ return { ...c, branchFailures: healthPayload(health).failures };
164
+ }
165
+ /**
166
+ * build-context reports failures as two lists of section names rather than a
167
+ * `branchFailures` array, so it needs the same treatment in its own shape.
168
+ */
169
+ function withSanitizedSections(container, health) {
170
+ const c = container;
171
+ if (!c || typeof c !== 'object')
172
+ return c;
173
+ const names = (status) => health.failures.filter((f) => f.status === status).map((f) => f.name);
174
+ return {
175
+ ...c,
176
+ ...('timedOutSections' in c ? { timedOutSections: names('timeout') } : {}),
177
+ ...('failedSections' in c ? { failedSections: names('error') } : {}),
178
+ };
179
+ }
180
+ /**
181
+ * The stderr warning line for a response, or null when the response is healthy.
182
+ * Plain text — the caller applies colour.
183
+ */
184
+ function degradationWarningLine(health) {
185
+ if (!health.degraded)
186
+ return null;
187
+ const names = health.failures.map((f) => f.name);
188
+ const detail = names.length
189
+ ? `failed branches: ${names.join(', ')}`
190
+ : 'one or more retrieval branches failed';
191
+ return (`${exports.DEGRADED_MARKER} — ${detail}. These results are incomplete; re-run before ` +
192
+ 'treating them as a full answer.');
193
+ }
194
+ /**
195
+ * A one-line marker for human stdout renderers (table footer, timeline header,
196
+ * grouped header). Null when healthy.
197
+ */
198
+ function degradationSummaryLine(health) {
199
+ if (!health.degraded)
200
+ return null;
201
+ const names = health.failures.map((f) => f.name);
202
+ const detail = names.length ? ` (${names.join(', ')})` : '';
203
+ return `${exports.DEGRADED_MARKER}${detail} — results below are INCOMPLETE.`;
204
+ }
205
+ /** Headline suffix for spinners; empty string when healthy. */
206
+ function degradationHeadlineSuffix(health) {
207
+ return health.degraded ? exports.DEGRADED_HEADLINE_SUFFIX : '';
208
+ }
209
+ function normaliseResults(raw) {
210
+ if (!Array.isArray(raw))
211
+ return Object.freeze([]);
212
+ return Object.freeze(raw.map((r) => r && r.memory ? r : { memory: r, score: r?.score, matchedVia: r?.matchedVia }));
213
+ }
214
+ /**
215
+ * A search response that has been through the health mapping.
216
+ *
217
+ * Construction is via `fromApiResponse` / `fromListResponse` only — the private
218
+ * constructor is what makes the health check impossible to bypass.
219
+ */
220
+ class RenderableSearchResult {
221
+ results;
222
+ total;
223
+ searchMethod;
224
+ temporalMetadata;
225
+ health;
226
+ body;
227
+ constructor(
228
+ /** Normalised `{ memory, score, matchedVia }` hits. */
229
+ results,
230
+ /** `meta.total` when the server sent one, else the result count. */
231
+ total,
232
+ /** `meta.searchMethod`, when present. */
233
+ searchMethod,
234
+ /** `meta.temporalMetadata`, when present. */
235
+ temporalMetadata,
236
+ /** Retrieval health. Always populated. */
237
+ health, body) {
238
+ this.results = results;
239
+ this.total = total;
240
+ this.searchMethod = searchMethod;
241
+ this.temporalMetadata = temporalMetadata;
242
+ this.health = health;
243
+ this.body = body;
244
+ }
245
+ /**
246
+ * Map a `/api/memories/search` body. Health lives at `meta.degraded` +
247
+ * `meta.branchFailures` (search.schema.ts SearchMeta).
248
+ *
249
+ * Callers validate the body is usable first (a 2xx without a `data` array is
250
+ * an unusable response, not an empty result set — see
251
+ * `unusableResponseError` in the search command). This factory is tolerant so
252
+ * that mapping never throws inside a render path.
253
+ */
254
+ static fromApiResponse(body) {
255
+ const b = (body ?? {});
256
+ const results = normaliseResults(b.data);
257
+ const meta = b.meta;
258
+ return new RenderableSearchResult(results, typeof meta?.total === 'number' ? meta.total : results.length, typeof meta?.searchMethod === 'string' ? meta.searchMethod : undefined, meta?.temporalMetadata, readDegradation(meta), b);
259
+ }
260
+ /**
261
+ * Map a `/api/memories` list body (recap's no-query path). The list endpoint
262
+ * runs no search branches and carries no health signal, so the result is
263
+ * healthy by construction — recorded here rather than left implicit.
264
+ */
265
+ static fromListResponse(body) {
266
+ const b = (body ?? {});
267
+ const results = Object.freeze((Array.isArray(b.data) ? b.data : []).map((m) => ({ memory: m })));
268
+ return new RenderableSearchResult(results, results.length, undefined, undefined, HEALTHY, b);
269
+ }
270
+ /**
271
+ * The JSON/YAML payload: the response body with results normalised, plus a
272
+ * `health` object when — and only when — the response is degraded.
273
+ */
274
+ toSerializable() {
275
+ // The `meta` overwrite keeps its original key position (object spread
276
+ // overwrites in place) while swapping the raw branchFailures for the
277
+ // filtered set.
278
+ return {
279
+ ...this.body,
280
+ ...(this.body.meta !== undefined
281
+ ? { meta: withSanitizedFailures(this.body.meta, this.health) }
282
+ : {}),
283
+ data: this.results,
284
+ ...(this.health.degraded ? { health: healthPayload(this.health) } : {}),
285
+ };
286
+ }
287
+ }
288
+ exports.RenderableSearchResult = RenderableSearchResult;
289
+ /**
290
+ * A digest / status-report response that has been through the health mapping.
291
+ *
292
+ * The digest wire puts health on `metadata`, not `meta` — the single-character
293
+ * difference that made the CLI's degraded warning dead code (#5124). That
294
+ * mapping is written once, here.
295
+ */
296
+ class RenderableDigestResult {
297
+ digest;
298
+ metadata;
299
+ sources;
300
+ keyFacts;
301
+ entities;
302
+ effectiveStateBreakdown;
303
+ health;
304
+ body;
305
+ constructor(digest,
306
+ /** DigestMetadata as sent; also carries the relevance-fallback caveats. */
307
+ metadata, sources, keyFacts, entities, effectiveStateBreakdown, health, body) {
308
+ this.digest = digest;
309
+ this.metadata = metadata;
310
+ this.sources = sources;
311
+ this.keyFacts = keyFacts;
312
+ this.entities = entities;
313
+ this.effectiveStateBreakdown = effectiveStateBreakdown;
314
+ this.health = health;
315
+ this.body = body;
316
+ }
317
+ /** Map a `/api/memories/digest` body. Callers validate `data.metadata` first. */
318
+ static fromApiResponse(body) {
319
+ const b = (body ?? {});
320
+ const metadata = (b.metadata ?? {});
321
+ return new RenderableDigestResult(typeof b.digest === 'string' ? b.digest : '', metadata, Array.isArray(b.sources) ? b.sources : [], Array.isArray(b.keyFacts) ? b.keyFacts : undefined, Array.isArray(b.entities) ? b.entities : undefined, b.effectiveStateBreakdown, readDegradation(metadata), b);
322
+ }
323
+ toSerializable() {
324
+ return {
325
+ ...this.body,
326
+ ...(this.body.metadata !== undefined
327
+ ? { metadata: withSanitizedFailures(this.body.metadata, this.health) }
328
+ : {}),
329
+ ...(this.health.degraded ? { health: healthPayload(this.health) } : {}),
330
+ };
331
+ }
332
+ }
333
+ exports.RenderableDigestResult = RenderableDigestResult;
334
+ /**
335
+ * A build-context briefing that has been through the health mapping.
336
+ *
337
+ * The API already sends `meta.degraded` here (with `timedOutSections` /
338
+ * `failedSections`); the CLI dropped it silently before this type existed.
339
+ */
340
+ class RenderableContextBriefing {
341
+ data;
342
+ health;
343
+ constructor(
344
+ /** The briefing body: activeWork, relevantFacts, gotchas, … */
345
+ data, health) {
346
+ this.data = data;
347
+ this.health = health;
348
+ }
349
+ static fromApiResponse(body) {
350
+ const b = (body ?? {});
351
+ return new RenderableContextBriefing(b, readSectionDegradation(b.meta));
352
+ }
353
+ toSerializable() {
354
+ return {
355
+ ...this.data,
356
+ ...(this.data.meta !== undefined
357
+ ? { meta: withSanitizedSections(this.data.meta, this.health) }
358
+ : {}),
359
+ ...(this.health.degraded ? { health: healthPayload(this.health) } : {}),
360
+ };
361
+ }
362
+ }
363
+ exports.RenderableContextBriefing = RenderableContextBriefing;
364
+ //# sourceMappingURL=renderable-retrieval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderable-retrieval.js","sourceRoot":"","sources":["../../src/lib/renderable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AAI;YACZ,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS;gBAC9B,CAAC,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE;gBAC9D,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxE,CAAC;IACJ,CAAC;CACF;AArBD,8DAqBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAmB,aAAa,EAAY,MAAM,YAAY,CAAC;AAG3E,wCAAwC;AACxC,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAS7C;AAuGD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAqDhF"}
1
+ {"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAmB,aAAa,EAAY,MAAM,YAAY,CAAC;AAG3E,wCAAwC;AACxC,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAS7C;AAuGD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAqEhF"}
@@ -129,27 +129,43 @@ async function detectAgents(projectDir) {
129
129
  if (!inProject && !inGlobal)
130
130
  continue;
131
131
  const detectedAt = inProject && inGlobal ? 'both' : inProject ? 'project' : 'global';
132
- // Check existing config
132
+ // Check existing config — an agent counts as configured if EITHER scope holds
133
+ // the memnexus entry. The project check used to overwrite the global result
134
+ // outright, which reported "not configured" for a working global install as
135
+ // soon as the project had its own config file listing other servers (for
136
+ // Claude Code a project `.mcp.json` is additive, not a replacement). That
137
+ // false negative told the user to run `mx mcp install`, which would write
138
+ // into a repository they may have only cloned. Reachable from `mx mcp list`
139
+ // for the first time now that it passes a project dir (#4919).
133
140
  let existingConfigPath;
134
141
  let alreadyConfigured = false;
135
- // Check global config first
136
142
  const globalPath = agent.mcp.globalConfigPath[platform];
137
- if (globalPath) {
138
- const resolved = resolvePath(globalPath);
139
- const check = await checkExistingConfig(resolved, agent);
140
- if (check.exists) {
141
- existingConfigPath = resolved;
142
- alreadyConfigured = check.hasMemnexus;
143
- }
143
+ const globalResolved = globalPath ? resolvePath(globalPath) : undefined;
144
+ const globalCheck = globalResolved
145
+ ? await checkExistingConfig(globalResolved, agent)
146
+ : { exists: false, hasMemnexus: false };
147
+ const projectResolved = projectDir && agent.mcp.projectConfigPath
148
+ ? node_path_1.default.join(projectDir, agent.mcp.projectConfigPath)
149
+ : undefined;
150
+ const projectCheck = projectResolved
151
+ ? await checkExistingConfig(projectResolved, agent)
152
+ : { exists: false, hasMemnexus: false };
153
+ alreadyConfigured = globalCheck.hasMemnexus || projectCheck.hasMemnexus;
154
+ // Point at the file that actually holds the entry, preferring project when
155
+ // both do. Falling back to whichever config file merely exists keeps the
156
+ // previous behaviour for the not-configured case, where the path is a hint
157
+ // about where setup would write.
158
+ if (projectCheck.hasMemnexus) {
159
+ existingConfigPath = projectResolved;
144
160
  }
145
- // Check project config if project dir provided
146
- if (projectDir && agent.mcp.projectConfigPath) {
147
- const projectPath = node_path_1.default.join(projectDir, agent.mcp.projectConfigPath);
148
- const check = await checkExistingConfig(projectPath, agent);
149
- if (check.exists) {
150
- existingConfigPath = projectPath;
151
- alreadyConfigured = check.hasMemnexus;
152
- }
161
+ else if (globalCheck.hasMemnexus) {
162
+ existingConfigPath = globalResolved;
163
+ }
164
+ else if (projectCheck.exists) {
165
+ existingConfigPath = projectResolved;
166
+ }
167
+ else if (globalCheck.exists) {
168
+ existingConfigPath = globalResolved;
153
169
  }
154
170
  results.push({
155
171
  agent,
@@ -1 +1 @@
1
- {"version":3,"file":"detector.js","sourceRoot":"","sources":["../../../src/lib/setup/detector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAWH,kCASC;AA2GD,oCAqDC;AAlLD,qCAAqC;AACrC,+CAA4C;AAC5C,2DAAkD;AAClD,0DAA6B;AAC7B,sDAAyB;AAEzB,+CAAgD;AAEhD,wCAAwC;AACxC,SAAgB,WAAW,CAAC,CAAS;IACnC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,mBAAI,CAAC,IAAI,CAAC,iBAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,mBAAI,CAAC,IAAI,CAAC,iBAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QACrF,OAAO,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,8CAA8C;AAC9C,SAAS,cAAc,CAAC,IAAY;IAClC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,iBAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1D,IAAA,iCAAY,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;YACxB,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,IAAI;SAClB,CA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,GAAG,eAAe,CAAC;QACvC,CAAC;aAAM,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;YAC9B,kBAAkB,GAAG,cAAc,CAAC;QACtC,CAAC;QAED,OAAO,CAAC,IAAI,CAAC;YACX,KAAK;YACL,UAAU;YACV,kBAAkB;YAClB,iBAAiB;SAClB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export { detectAgents, resolvePath } from './detector.js';
2
2
  export { writeAgentConfig, removeAgentConfig, resolveConfigPath } from './config-writer.js';
3
- export { verifyAgent, verifyAll } from './verifier.js';
3
+ export { verifyAgent, verifyAll, displayPath } from './verifier.js';
4
4
  export { writeSteeringFile, removeSteeringSection, getSteeringVersion, resolveSteeringPath, } from './rules-writer.js';
5
5
  export { composeRules, parseSteeringVersion } from './rules-templates.js';
6
6
  export { getAgent, getAgentIds, getSortedAgents, AGENTS } from './registry.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,cAAc,EACd,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,mBAAmB,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,cAAc,EACd,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,mBAAmB,YAAY,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeHooks = exports.installHooks = exports.parseSkillVersion = exports.SKILLS = exports.resolveSkillPath = exports.resolveSkillsDir = exports.listSkills = exports.removeAllSkills = exports.writeAllSkills = exports.AGENTS = exports.getSortedAgents = exports.getAgentIds = exports.getAgent = exports.parseSteeringVersion = exports.composeRules = exports.resolveSteeringPath = exports.getSteeringVersion = exports.removeSteeringSection = exports.writeSteeringFile = exports.verifyAll = exports.verifyAgent = exports.resolveConfigPath = exports.removeAgentConfig = exports.writeAgentConfig = exports.resolvePath = exports.detectAgents = void 0;
3
+ exports.removeHooks = exports.installHooks = exports.parseSkillVersion = exports.SKILLS = exports.resolveSkillPath = exports.resolveSkillsDir = exports.listSkills = exports.removeAllSkills = exports.writeAllSkills = exports.AGENTS = exports.getSortedAgents = exports.getAgentIds = exports.getAgent = exports.parseSteeringVersion = exports.composeRules = exports.resolveSteeringPath = exports.getSteeringVersion = exports.removeSteeringSection = exports.writeSteeringFile = exports.displayPath = exports.verifyAll = exports.verifyAgent = exports.resolveConfigPath = exports.removeAgentConfig = exports.writeAgentConfig = exports.resolvePath = exports.detectAgents = void 0;
4
4
  var detector_js_1 = require("./detector.js");
5
5
  Object.defineProperty(exports, "detectAgents", { enumerable: true, get: function () { return detector_js_1.detectAgents; } });
6
6
  Object.defineProperty(exports, "resolvePath", { enumerable: true, get: function () { return detector_js_1.resolvePath; } });
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "resolveConfigPath", { enumerable: true, get: fun
11
11
  var verifier_js_1 = require("./verifier.js");
12
12
  Object.defineProperty(exports, "verifyAgent", { enumerable: true, get: function () { return verifier_js_1.verifyAgent; } });
13
13
  Object.defineProperty(exports, "verifyAll", { enumerable: true, get: function () { return verifier_js_1.verifyAll; } });
14
+ Object.defineProperty(exports, "displayPath", { enumerable: true, get: function () { return verifier_js_1.displayPath; } });
14
15
  var rules_writer_js_1 = require("./rules-writer.js");
15
16
  Object.defineProperty(exports, "writeSteeringFile", { enumerable: true, get: function () { return rules_writer_js_1.writeSteeringFile; } });
16
17
  Object.defineProperty(exports, "removeSteeringSection", { enumerable: true, get: function () { return rules_writer_js_1.removeSteeringSection; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/setup/index.ts"],"names":[],"mappings":";;;AAAA,6CAA0D;AAAjD,2GAAA,YAAY,OAAA;AAAE,0GAAA,WAAW,OAAA;AAClC,uDAA4F;AAAnF,oHAAA,gBAAgB,OAAA;AAAE,qHAAA,iBAAiB,OAAA;AAAE,qHAAA,iBAAiB,OAAA;AAC/D,6CAAuD;AAA9C,0GAAA,WAAW,OAAA;AAAE,wGAAA,SAAS,OAAA;AAC/B,qDAK2B;AAJzB,oHAAA,iBAAiB,OAAA;AACjB,wHAAA,qBAAqB,OAAA;AACrB,qHAAA,kBAAkB,OAAA;AAClB,sHAAA,mBAAmB,OAAA;AAErB,2DAA0E;AAAjE,kHAAA,YAAY,OAAA;AAAE,0HAAA,oBAAoB,OAAA;AAC3C,6CAA+E;AAAtE,uGAAA,QAAQ,OAAA;AAAE,0GAAA,WAAW,OAAA;AAAE,8GAAA,eAAe,OAAA;AAAE,qGAAA,MAAM,OAAA;AACvD,uDAM4B;AAL1B,kHAAA,cAAc,OAAA;AACd,mHAAA,eAAe,OAAA;AACf,8GAAA,UAAU,OAAA;AACV,oHAAA,gBAAgB,OAAA;AAChB,oHAAA,gBAAgB,OAAA;AAElB,6DAAkE;AAAzD,6GAAA,MAAM,OAAA;AAAE,wHAAA,iBAAiB,OAAA;AAClC,qDAA8D;AAArD,+GAAA,YAAY,OAAA;AAAE,8GAAA,WAAW,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/setup/index.ts"],"names":[],"mappings":";;;AAAA,6CAA0D;AAAjD,2GAAA,YAAY,OAAA;AAAE,0GAAA,WAAW,OAAA;AAClC,uDAA4F;AAAnF,oHAAA,gBAAgB,OAAA;AAAE,qHAAA,iBAAiB,OAAA;AAAE,qHAAA,iBAAiB,OAAA;AAC/D,6CAAoE;AAA3D,0GAAA,WAAW,OAAA;AAAE,wGAAA,SAAS,OAAA;AAAE,0GAAA,WAAW,OAAA;AAC5C,qDAK2B;AAJzB,oHAAA,iBAAiB,OAAA;AACjB,wHAAA,qBAAqB,OAAA;AACrB,qHAAA,kBAAkB,OAAA;AAClB,sHAAA,mBAAmB,OAAA;AAErB,2DAA0E;AAAjE,kHAAA,YAAY,OAAA;AAAE,0HAAA,oBAAoB,OAAA;AAC3C,6CAA+E;AAAtE,uGAAA,QAAQ,OAAA;AAAE,0GAAA,WAAW,OAAA;AAAE,8GAAA,eAAe,OAAA;AAAE,qGAAA,MAAM,OAAA;AACvD,uDAM4B;AAL1B,kHAAA,cAAc,OAAA;AACd,mHAAA,eAAe,OAAA;AACf,8GAAA,UAAU,OAAA;AACV,oHAAA,gBAAgB,OAAA;AAChB,oHAAA,gBAAgB,OAAA;AAElB,6DAAkE;AAAzD,6GAAA,MAAM,OAAA;AAAE,wHAAA,iBAAiB,OAAA;AAClC,qDAA8D;AAArD,+GAAA,YAAY,OAAA;AAAE,8GAAA,WAAW,OAAA"}
@@ -21,6 +21,14 @@ export declare function composeRules(agentId: string, version: string, contentFo
21
21
  /**
22
22
  * Parse the version string from an existing steering file's markers.
23
23
  * Returns null if no markers found or version can't be parsed.
24
+ *
25
+ * The charset is version-shaped and length-bounded on purpose. The previous
26
+ * `[^\s|]+` excluded whitespace and `|` but admitted ESC, BEL and every other C0
27
+ * control byte, unbounded — and since verification now reads the PROJECT steering
28
+ * file, that content can come from a repository the user cloned but did not write.
29
+ * The captured string is rendered by `mx mcp doctor`, so it was a path from
30
+ * untrusted file content to terminal control sequences (KI-SEC-007 class).
31
+ * Bounding here is defence in depth; the render sites sanitize as well.
24
32
  */
25
33
  export declare function parseSteeringVersion(content: string): string | null;
26
34
  //# sourceMappingURL=rules-templates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rules-templates.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/rules-templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,QAAA,MAAM,YAAY,wFACgE,CAAC;AACnF,QAAA,MAAM,UAAU,gCAAgC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AAoJpC;;;;;;GAMG;AACH,wBAAgB,oCAAoC,IAAI,MAAM,CA2C7D;AAID;;GAEG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,oBAAoB,GACjC,MAAM,CAkBR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGnE"}
1
+ {"version":3,"file":"rules-templates.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/rules-templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,QAAA,MAAM,YAAY,wFACgE,CAAC;AACnF,QAAA,MAAM,UAAU,gCAAgC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AAoJpC;;;;;;GAMG;AACH,wBAAgB,oCAAoC,IAAI,MAAM,CA2C7D;AAID;;GAEG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,oBAAoB,GACjC,MAAM,CAkBR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGnE"}
@@ -221,9 +221,17 @@ function composeRules(agentId, version, contentFocus) {
221
221
  /**
222
222
  * Parse the version string from an existing steering file's markers.
223
223
  * Returns null if no markers found or version can't be parsed.
224
+ *
225
+ * The charset is version-shaped and length-bounded on purpose. The previous
226
+ * `[^\s|]+` excluded whitespace and `|` but admitted ESC, BEL and every other C0
227
+ * control byte, unbounded — and since verification now reads the PROJECT steering
228
+ * file, that content can come from a repository the user cloned but did not write.
229
+ * The captured string is rendered by `mx mcp doctor`, so it was a path from
230
+ * untrusted file content to terminal control sequences (KI-SEC-007 class).
231
+ * Bounding here is defence in depth; the render sites sanitize as well.
224
232
  */
225
233
  function parseSteeringVersion(content) {
226
- const match = content.match(/<!-- version: ([^\s|]+)/);
234
+ const match = content.match(/<!-- version: ([0-9A-Za-z.+-]{1,32})(?=[\s|])/);
227
235
  return match ? match[1] : null;
228
236
  }
229
237
  //# sourceMappingURL=rules-templates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rules-templates.js","sourceRoot":"","sources":["../../../src/lib/setup/rules-templates.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmKH,oFA2CC;AAOD,oCAsBC;AAMD,oDAGC;AAhPD,MAAM,YAAY,GAChB,gFAAgF,CAAC;AAG1E,oCAAY;AAFrB,MAAM,UAAU,GAAG,6BAA6B,CAAC;AAE1B,gCAAU;AAEjC,oEAAoE;AAEpE,SAAS,eAAe;IACtB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+EAuDsE,CAAC;AAChF,CAAC;AAED,oEAAoE;AAEpE,SAAS,aAAa;IACpB,OAAO;;;;;;;;;;;;;2CAakC,CAAC;AAC5C,CAAC;AAED,oEAAoE;AAEpE,MAAM,WAAW,GAA2B;IAC1C,aAAa,EAAE;;;;;;;;;;;;4FAY2E;IAE1F,MAAM,EAAE;;;;;;mEAMyD;IAEjE,OAAO,EAAE;;;;;;mEAMwD;IAEjE,KAAK,EAAE;;;;;;mDAM0C;IAEjD,QAAQ,EAAE;;;;;;mEAMuD;IAEjE,gBAAgB,EAAE;;;;;;;;kEAQ8C;CACjE,CAAC;AAEF,gEAAgE;AAChE,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAC7E,+EAA+E;AAE/E;;;;;;GAMG;AACH,SAAgB,oCAAoC;IAClD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC;AACjC,CAAC"}
@@ -2,12 +2,29 @@
2
2
  * Setup verification — health checks for configured agents.
3
3
  */
4
4
  import type { AgentDefinition, VerifyResult } from './types.js';
5
+ /**
6
+ * Render a path for display without leaking the user's home directory or
7
+ * username. `mx mcp doctor --json` gets pasted into issue reports and into agent
8
+ * context, and global paths are already shown `~`-relative, so an absolute
9
+ * project path would be the only place identifying the machine.
10
+ */
11
+ export declare function displayPath(absolute: string, projectDir?: string): string;
5
12
  /**
6
13
  * Verify a single agent's setup.
14
+ *
15
+ * @param projectDir When set, project-scoped config and steering files are checked
16
+ * IN ADDITION TO the global ones. `mx setup` defaults to project scope inside a
17
+ * git project (setup.ts:203-207), so a global-only check reported working
18
+ * project installs as broken (#4919). Either location passing is a pass.
7
19
  */
8
- export declare function verifyAgent(agent: AgentDefinition): Promise<VerifyResult>;
20
+ export declare function verifyAgent(agent: AgentDefinition, projectDir?: string): Promise<VerifyResult>;
9
21
  /**
10
22
  * Verify all configured agents.
23
+ *
24
+ * @param projectDir When set (callers pass the detected git project root), agents
25
+ * configured at project scope are verified too. Without it this only ever saw
26
+ * global installs, so the onboarding flow's project-scoped install was reported
27
+ * as missing (#4919).
11
28
  */
12
- export declare function verifyAll(): Promise<VerifyResult[]>;
29
+ export declare function verifyAll(projectDir?: string): Promise<VerifyResult[]>;
13
30
  //# sourceMappingURL=verifier.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/verifier.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAyB,YAAY,EAAE,MAAM,YAAY,CAAC;AASvF;;GAEG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,CA2I/E;AAED;;GAEG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAoBzD"}
1
+ {"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/verifier.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAyB,YAAY,EAAE,MAAM,YAAY,CAAC;AA8BvF;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAUzE;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,eAAe,EACtB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,YAAY,CAAC,CAwLvB;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAuB5E"}