@memnexus-ai/cli 1.7.222 → 1.7.223
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/commands/memories.d.ts.map +1 -1
- package/dist/commands/memories.js +171 -77
- package/dist/commands/memories.js.map +1 -1
- package/dist/lib/renderable-retrieval.d.ts +164 -0
- package/dist/lib/renderable-retrieval.d.ts.map +1 -0
- package/dist/lib/renderable-retrieval.js +364 -0
- package/dist/lib/renderable-retrieval.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renderable retrieval results — retrieval health that cannot be dropped.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS MODULE EXISTS
|
|
5
|
+
*
|
|
6
|
+
* A transient retrieval failure that produces a confident-looking empty (or
|
|
7
|
+
* short) answer is worse than a sustained outage. An outage is obvious and the
|
|
8
|
+
* caller retries. A quiet partial failure is not: the agent reads "no results",
|
|
9
|
+
* records "no prior art found" as a fact, and moves on. Nobody re-runs the
|
|
10
|
+
* query, so the wrong conclusion outlives the failure that caused it.
|
|
11
|
+
*
|
|
12
|
+
* The CLI already had a degraded-retrieval warning. It had never fired once:
|
|
13
|
+
* it read `meta.degraded`, while the digest wire carries `metadata.degraded`
|
|
14
|
+
* (GH #5124). Its test constructed the fictional shape the buggy code expected,
|
|
15
|
+
* so the suite stayed green over a feature that had never worked. The root
|
|
16
|
+
* cause was not one typo — it was that every render path took the raw response
|
|
17
|
+
* as `any` and each one was free to forget the health check.
|
|
18
|
+
*
|
|
19
|
+
* THE DESIGN
|
|
20
|
+
*
|
|
21
|
+
* Health is carried structurally, not by convention:
|
|
22
|
+
*
|
|
23
|
+
* - `RenderableSearchResult`, `RenderableDigestResult` and
|
|
24
|
+
* `RenderableContextBriefing` have PRIVATE constructors. The
|
|
25
|
+
* `from*Response` factories are the only way to build one.
|
|
26
|
+
* - Those factories are the ONE place the wire-field mapping lives —
|
|
27
|
+
* `meta.degraded` (search, build-context) vs `metadata.degraded` (digest),
|
|
28
|
+
* the naming inconsistency that caused #5124.
|
|
29
|
+
* - Every renderable exposes `health: DegradationState`, where `degraded` is a
|
|
30
|
+
* required boolean and `failures` is always an array (empty when healthy).
|
|
31
|
+
* There is no `undefined` to forget to check.
|
|
32
|
+
* - Raw wire types are NOT exported from this module. A render path cannot
|
|
33
|
+
* take the raw response instead, and a new output format cannot be written
|
|
34
|
+
* without accepting a value that carries health.
|
|
35
|
+
*
|
|
36
|
+
* OUTPUT CONVENTIONS
|
|
37
|
+
*
|
|
38
|
+
* - The warning line goes to STDERR in every format. stderr is the one channel
|
|
39
|
+
* that survives `| jq`, `--id-only` piping and `--format json`, where stdout
|
|
40
|
+
* must stay machine-parseable.
|
|
41
|
+
* - Object-shaped JSON/YAML payloads additionally carry a `health` object on
|
|
42
|
+
* stdout, and only when degraded — matching the server convention that a
|
|
43
|
+
* healthy response gains no new fields (search.schema.ts).
|
|
44
|
+
*
|
|
45
|
+
* This module deliberately has no imports: colouring is the caller's job, and a
|
|
46
|
+
* dependency-free module keeps the type-level enforcement test cheap to run.
|
|
47
|
+
*/
|
|
48
|
+
/** How a branch failed. `unknown` covers wire values we do not recognise. */
|
|
49
|
+
export type BranchFailureStatus = 'timeout' | 'error' | 'unknown';
|
|
50
|
+
/** One retrieval branch that did not complete. */
|
|
51
|
+
export interface BranchFailure {
|
|
52
|
+
readonly name: string;
|
|
53
|
+
readonly status: BranchFailureStatus;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Retrieval health for one response.
|
|
57
|
+
*
|
|
58
|
+
* `degraded` is never optional and `failures` is never undefined: a renderer
|
|
59
|
+
* cannot accidentally read a missing field as "healthy".
|
|
60
|
+
*/
|
|
61
|
+
export interface DegradationState {
|
|
62
|
+
readonly degraded: boolean;
|
|
63
|
+
readonly failures: readonly BranchFailure[];
|
|
64
|
+
}
|
|
65
|
+
/** A normalised search hit: `{ memory, score, matchedVia }`. */
|
|
66
|
+
export interface SearchResultItem {
|
|
67
|
+
readonly memory: Record<string, any>;
|
|
68
|
+
readonly score?: number;
|
|
69
|
+
readonly matchedVia?: string[];
|
|
70
|
+
}
|
|
71
|
+
/** Shared marker text. Every surface uses this string so it is greppable. */
|
|
72
|
+
export declare const DEGRADED_MARKER = "\u26A0 Degraded retrieval";
|
|
73
|
+
/** Suffix appended to a command's headline when the response is degraded. */
|
|
74
|
+
export declare const DEGRADED_HEADLINE_SUFFIX = " \u2014 INCOMPLETE (degraded retrieval)";
|
|
75
|
+
/**
|
|
76
|
+
* The stderr warning line for a response, or null when the response is healthy.
|
|
77
|
+
* Plain text — the caller applies colour.
|
|
78
|
+
*/
|
|
79
|
+
export declare function degradationWarningLine(health: DegradationState): string | null;
|
|
80
|
+
/**
|
|
81
|
+
* A one-line marker for human stdout renderers (table footer, timeline header,
|
|
82
|
+
* grouped header). Null when healthy.
|
|
83
|
+
*/
|
|
84
|
+
export declare function degradationSummaryLine(health: DegradationState): string | null;
|
|
85
|
+
/** Headline suffix for spinners; empty string when healthy. */
|
|
86
|
+
export declare function degradationHeadlineSuffix(health: DegradationState): string;
|
|
87
|
+
/**
|
|
88
|
+
* A search response that has been through the health mapping.
|
|
89
|
+
*
|
|
90
|
+
* Construction is via `fromApiResponse` / `fromListResponse` only — the private
|
|
91
|
+
* constructor is what makes the health check impossible to bypass.
|
|
92
|
+
*/
|
|
93
|
+
export declare class RenderableSearchResult {
|
|
94
|
+
/** Normalised `{ memory, score, matchedVia }` hits. */
|
|
95
|
+
readonly results: readonly SearchResultItem[];
|
|
96
|
+
/** `meta.total` when the server sent one, else the result count. */
|
|
97
|
+
readonly total: number;
|
|
98
|
+
/** `meta.searchMethod`, when present. */
|
|
99
|
+
readonly searchMethod: string | undefined;
|
|
100
|
+
/** `meta.temporalMetadata`, when present. */
|
|
101
|
+
readonly temporalMetadata: any;
|
|
102
|
+
/** Retrieval health. Always populated. */
|
|
103
|
+
readonly health: DegradationState;
|
|
104
|
+
private readonly body;
|
|
105
|
+
private constructor();
|
|
106
|
+
/**
|
|
107
|
+
* Map a `/api/memories/search` body. Health lives at `meta.degraded` +
|
|
108
|
+
* `meta.branchFailures` (search.schema.ts SearchMeta).
|
|
109
|
+
*
|
|
110
|
+
* Callers validate the body is usable first (a 2xx without a `data` array is
|
|
111
|
+
* an unusable response, not an empty result set — see
|
|
112
|
+
* `unusableResponseError` in the search command). This factory is tolerant so
|
|
113
|
+
* that mapping never throws inside a render path.
|
|
114
|
+
*/
|
|
115
|
+
static fromApiResponse(body: unknown): RenderableSearchResult;
|
|
116
|
+
/**
|
|
117
|
+
* Map a `/api/memories` list body (recap's no-query path). The list endpoint
|
|
118
|
+
* runs no search branches and carries no health signal, so the result is
|
|
119
|
+
* healthy by construction — recorded here rather than left implicit.
|
|
120
|
+
*/
|
|
121
|
+
static fromListResponse(body: unknown): RenderableSearchResult;
|
|
122
|
+
/**
|
|
123
|
+
* The JSON/YAML payload: the response body with results normalised, plus a
|
|
124
|
+
* `health` object when — and only when — the response is degraded.
|
|
125
|
+
*/
|
|
126
|
+
toSerializable(): Record<string, unknown>;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* A digest / status-report response that has been through the health mapping.
|
|
130
|
+
*
|
|
131
|
+
* The digest wire puts health on `metadata`, not `meta` — the single-character
|
|
132
|
+
* difference that made the CLI's degraded warning dead code (#5124). That
|
|
133
|
+
* mapping is written once, here.
|
|
134
|
+
*/
|
|
135
|
+
export declare class RenderableDigestResult {
|
|
136
|
+
readonly digest: string;
|
|
137
|
+
/** DigestMetadata as sent; also carries the relevance-fallback caveats. */
|
|
138
|
+
readonly metadata: Record<string, any>;
|
|
139
|
+
readonly sources: any[];
|
|
140
|
+
readonly keyFacts: any[] | undefined;
|
|
141
|
+
readonly entities: any[] | undefined;
|
|
142
|
+
readonly effectiveStateBreakdown: any;
|
|
143
|
+
readonly health: DegradationState;
|
|
144
|
+
private readonly body;
|
|
145
|
+
private constructor();
|
|
146
|
+
/** Map a `/api/memories/digest` body. Callers validate `data.metadata` first. */
|
|
147
|
+
static fromApiResponse(body: unknown): RenderableDigestResult;
|
|
148
|
+
toSerializable(): Record<string, unknown>;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* A build-context briefing that has been through the health mapping.
|
|
152
|
+
*
|
|
153
|
+
* The API already sends `meta.degraded` here (with `timedOutSections` /
|
|
154
|
+
* `failedSections`); the CLI dropped it silently before this type existed.
|
|
155
|
+
*/
|
|
156
|
+
export declare class RenderableContextBriefing {
|
|
157
|
+
/** The briefing body: activeWork, relevantFacts, gotchas, … */
|
|
158
|
+
readonly data: Record<string, any>;
|
|
159
|
+
readonly health: DegradationState;
|
|
160
|
+
private constructor();
|
|
161
|
+
static fromApiResponse(body: unknown): RenderableContextBriefing;
|
|
162
|
+
toSerializable(): Record<string, unknown>;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=renderable-retrieval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderable-retrieval.d.ts","sourceRoot":"","sources":["../../src/lib/renderable-retrieval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,6EAA6E;AAC7E,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAElE,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;CACtC;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;CAC7C;AAED,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM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IAC3E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACvB,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,SAAS;IACpC,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,SAAS;IACpC,QAAQ,CAAC,uBAAuB,EAAE,GAAG;IACrC,QAAQ,CAAC,MAAM,EAAE,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,IAAI;IATvB,OAAO;IAYP,iFAAiF;IACjF,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,sBAAsB;IAe7D,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAS1C;AAED;;;;;GAKG;AACH,qBAAa,yBAAyB;IAElC,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,gBAAgB;IAHnC,OAAO;IAMP,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,yBAAyB;IAKhE,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAS1C"}
|
|
@@ -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-retrieval.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;;;AA0KH,wDAUC;AAMD,wDAKC;AAGD,8DAEC;AAvKD,6EAA6E;AAChE,QAAA,eAAe,GAAG,sBAAsB,CAAC;AAEtD,6EAA6E;AAChE,QAAA,wBAAwB,GAAG,oCAAoC,CAAC;AAE7E,MAAM,OAAO,GAAqB,MAAM,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,EAA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AC;SACxE,CAAC;IACJ,CAAC;CACF;AArBD,8DAqBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memnexus-ai/cli",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.223",
|
|
4
4
|
"description": "Command-line interface for MemNexus Core API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"node": ">=18.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@memnexus-ai/typescript-sdk": "^1.
|
|
37
|
+
"@memnexus-ai/typescript-sdk": "^1.73.2",
|
|
38
38
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
39
39
|
"axios": "^1.13.6",
|
|
40
40
|
"chalk": "^5.3.0",
|