@memnexus-ai/cli 1.7.220 → 1.7.222
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 +2 -2
- package/dist/commands/memories.d.ts.map +1 -1
- package/dist/commands/memories.js +190 -91
- package/dist/commands/memories.js.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/errors.d.ts +47 -0
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +172 -48
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/retry.d.ts +83 -1
- package/dist/lib/retry.d.ts.map +1 -1
- package/dist/lib/retry.js +143 -3
- package/dist/lib/retry.js.map +1 -1
- package/dist/lib/spinner.d.ts +32 -2
- package/dist/lib/spinner.d.ts.map +1 -1
- package/dist/lib/spinner.js +40 -2
- package/dist/lib/spinner.js.map +1 -1
- package/hooks/capture-hooks.test.sh +465 -0
- package/hooks/capture-precompact.sh +11 -1
- package/hooks/capture-session-end.sh +101 -7
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -69,6 +69,7 @@ const mcp_1 = require("./commands/mcp");
|
|
|
69
69
|
const hook_1 = require("./commands/hook");
|
|
70
70
|
const commit_context_1 = require("./commands/commit-context");
|
|
71
71
|
const agent_help_1 = require("./lib/agent-help");
|
|
72
|
+
const errors_1 = require("./lib/errors");
|
|
72
73
|
// Check for updates (respects config)
|
|
73
74
|
const notifier = (0, update_notifier_1.default)({
|
|
74
75
|
pkg: package_json_1.default,
|
|
@@ -126,6 +127,18 @@ program
|
|
|
126
127
|
const fmt = opts.format === 'json' ? 'json' : 'markdown';
|
|
127
128
|
console.log((0, agent_help_1.getAgentHelp)(scope || null, fmt));
|
|
128
129
|
});
|
|
130
|
+
// Central failure funnel (v4.04 error honesty). Commander action handlers are
|
|
131
|
+
// async: a rejection that escapes an action's try/catch — or a throw from a
|
|
132
|
+
// callback outside one — used to unwind past program.parse() and leave the
|
|
133
|
+
// process to exit 0 with nothing on stdout, which is byte-identical to "no
|
|
134
|
+
// results". Route both through handleError so every escape is stderr + a
|
|
135
|
+
// non-zero exit code.
|
|
136
|
+
process.on('unhandledRejection', (reason) => {
|
|
137
|
+
(0, errors_1.handleError)(reason);
|
|
138
|
+
});
|
|
139
|
+
process.on('uncaughtException', (error) => {
|
|
140
|
+
(0, errors_1.handleError)(error);
|
|
141
|
+
});
|
|
129
142
|
program.parse(process.argv);
|
|
130
143
|
// Show help if no command provided
|
|
131
144
|
if (!process.argv.slice(2).length) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AACA;;;;;;;;;;;;;;;;;GAiBG;AACH,yCAAsC;AACtC,mEAA0C;AAC1C,oEAAoF;AAEpF,qFAAqF;AACrF,MAAM,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC;AACvC,UAAU,CAAC,KAAK,GAAG,CAAC,KAAkC,EAAE,IAAkC,EAAE,EAAE;IAC5F,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;QAChC,MAAM,SAAS,GAAG,eAAM,CAAC,aAAa,EAAE,CAAC;QACzC,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC;QAChE,MAAM,UAAU,GAAG;YACjB,UAAU,sBAAW,CAAC,OAAO,EAAE;YAC/B,MAAM,OAAO,CAAC,QAAQ,EAAE;YACxB,QAAQ,OAAO,CAAC,OAAO,EAAE;YACzB,SAAS,KAAK,EAAE;SACjB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACZ,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,UAAU,CAAC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AAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;IACxC,IAAA,oBAAW,EAAC,KAAK,CAAC,CAAC;AACrB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5B,mCAAmC;AACnC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAC;AACvB,CAAC"}
|
package/dist/lib/errors.d.ts
CHANGED
|
@@ -3,5 +3,52 @@ export declare class CLIError extends Error {
|
|
|
3
3
|
details?: unknown | undefined;
|
|
4
4
|
constructor(message: string, exitCode?: number, details?: unknown | undefined);
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Exit-code vocabulary (shared with handleApiError below — do not add codes
|
|
8
|
+
* outside this map):
|
|
9
|
+
* 1 — generic failure / not found
|
|
10
|
+
* 2 — validation: bad or missing user input
|
|
11
|
+
* 3 — auth (401/403)
|
|
12
|
+
* 4 — network: could not reach the API
|
|
13
|
+
* 5 — server / infrastructure: 5xx, rate limit, unusable response body
|
|
14
|
+
*
|
|
15
|
+
* Error output is stderr-only. Fleet scripts treat non-empty stdout as "this
|
|
16
|
+
* command produced a result" and parse the first `{` on stdout as the result
|
|
17
|
+
* body, so a failure that writes to stdout is indistinguishable from a success
|
|
18
|
+
* (v4.04 error-honesty invariant).
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The request succeeded at the transport layer (2xx) but the response body is
|
|
22
|
+
* absent or unusable, so there is no data to render. This is an
|
|
23
|
+
* infrastructure-class failure, NOT an empty result: rendering it as "found 0"
|
|
24
|
+
* or "generated from 0 memories" tells the caller the store is empty when in
|
|
25
|
+
* fact the retrieval never happened.
|
|
26
|
+
*
|
|
27
|
+
* @param operation - Human-readable operation name, e.g. "Memory search"
|
|
28
|
+
* @param details - Optional debug payload (printed only under DEBUG)
|
|
29
|
+
*/
|
|
30
|
+
export declare function unusableResponseError(operation: string, details?: unknown): CLIError;
|
|
31
|
+
/**
|
|
32
|
+
* Invalid or missing user input. Exit 2, matching the API's 422 handling.
|
|
33
|
+
*/
|
|
34
|
+
export declare function validationError(message: string, details?: unknown): CLIError;
|
|
35
|
+
/**
|
|
36
|
+
* True only for a genuine "the resource does not exist" failure (HTTP 404).
|
|
37
|
+
* Anything else — 5xx, network, parse — is an error the caller must surface,
|
|
38
|
+
* not an empty result. Status lives on `status` (SDK), `statusCode`, or
|
|
39
|
+
* `response.status` (axios) depending on the client that threw.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isNotFoundError(error: unknown): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Neutralize a server-supplied string before echoing it to the terminal.
|
|
44
|
+
*
|
|
45
|
+
* The API's error text is attacker-influenceable (it can quote user content,
|
|
46
|
+
* and a hostile or misconfigured apiUrl controls it outright). Printed raw it
|
|
47
|
+
* can carry ANSI escapes that rewrite the terminal, and — because agents read
|
|
48
|
+
* CLI stderr — instructions aimed at the agent. Strip C0/C1 control characters
|
|
49
|
+
* (which is what ANSI escapes are built from), collapse newlines, and bound the
|
|
50
|
+
* length.
|
|
51
|
+
*/
|
|
52
|
+
export declare function sanitizeServerText(value: unknown, maxLength?: number): string;
|
|
6
53
|
export declare function handleError(error: unknown): never;
|
|
7
54
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/lib/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAS,SAAQ,KAAK;IAGxB,QAAQ,EAAE,MAAM;IAChB,OAAO,CAAC,EAAE,OAAO;gBAFxB,OAAO,EAAE,MAAM,EACR,QAAQ,GAAE,MAAU,EACpB,OAAO,CAAC,EAAE,OAAO,YAAA;CAK3B;AAUD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAS,SAAQ,KAAK;IAGxB,QAAQ,EAAE,MAAM;IAChB,OAAO,CAAC,EAAE,OAAO;gBAFxB,OAAO,EAAE,MAAM,EACR,QAAQ,GAAE,MAAU,EACpB,OAAO,CAAC,EAAE,OAAO,YAAA;CAK3B;AAED;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAQpF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIvD;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,SAAM,GAAG,MAAM,CAkB1E;AAUD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CA6CjD"}
|
package/dist/lib/errors.js
CHANGED
|
@@ -4,6 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CLIError = void 0;
|
|
7
|
+
exports.unusableResponseError = unusableResponseError;
|
|
8
|
+
exports.validationError = validationError;
|
|
9
|
+
exports.isNotFoundError = isNotFoundError;
|
|
10
|
+
exports.sanitizeServerText = sanitizeServerText;
|
|
7
11
|
exports.handleError = handleError;
|
|
8
12
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
13
|
class CLIError extends Error {
|
|
@@ -17,12 +21,92 @@ class CLIError extends Error {
|
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
23
|
exports.CLIError = CLIError;
|
|
24
|
+
/**
|
|
25
|
+
* Exit-code vocabulary (shared with handleApiError below — do not add codes
|
|
26
|
+
* outside this map):
|
|
27
|
+
* 1 — generic failure / not found
|
|
28
|
+
* 2 — validation: bad or missing user input
|
|
29
|
+
* 3 — auth (401/403)
|
|
30
|
+
* 4 — network: could not reach the API
|
|
31
|
+
* 5 — server / infrastructure: 5xx, rate limit, unusable response body
|
|
32
|
+
*
|
|
33
|
+
* Error output is stderr-only. Fleet scripts treat non-empty stdout as "this
|
|
34
|
+
* command produced a result" and parse the first `{` on stdout as the result
|
|
35
|
+
* body, so a failure that writes to stdout is indistinguishable from a success
|
|
36
|
+
* (v4.04 error-honesty invariant).
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* The request succeeded at the transport layer (2xx) but the response body is
|
|
40
|
+
* absent or unusable, so there is no data to render. This is an
|
|
41
|
+
* infrastructure-class failure, NOT an empty result: rendering it as "found 0"
|
|
42
|
+
* or "generated from 0 memories" tells the caller the store is empty when in
|
|
43
|
+
* fact the retrieval never happened.
|
|
44
|
+
*
|
|
45
|
+
* @param operation - Human-readable operation name, e.g. "Memory search"
|
|
46
|
+
* @param details - Optional debug payload (printed only under DEBUG)
|
|
47
|
+
*/
|
|
48
|
+
function unusableResponseError(operation, details) {
|
|
49
|
+
return new CLIError(`${operation} returned a successful status but the response body was missing or unusable. ` +
|
|
50
|
+
'No data was retrieved — this is a server-side failure, not an empty result. ' +
|
|
51
|
+
'Retry, and check API status with: mx system health', 5, details);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Invalid or missing user input. Exit 2, matching the API's 422 handling.
|
|
55
|
+
*/
|
|
56
|
+
function validationError(message, details) {
|
|
57
|
+
return new CLIError(message, 2, details);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* True only for a genuine "the resource does not exist" failure (HTTP 404).
|
|
61
|
+
* Anything else — 5xx, network, parse — is an error the caller must surface,
|
|
62
|
+
* not an empty result. Status lives on `status` (SDK), `statusCode`, or
|
|
63
|
+
* `response.status` (axios) depending on the client that threw.
|
|
64
|
+
*/
|
|
65
|
+
function isNotFoundError(error) {
|
|
66
|
+
const e = error;
|
|
67
|
+
const status = e?.status ?? e?.statusCode ?? e?.response?.status;
|
|
68
|
+
return status === 404;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Neutralize a server-supplied string before echoing it to the terminal.
|
|
72
|
+
*
|
|
73
|
+
* The API's error text is attacker-influenceable (it can quote user content,
|
|
74
|
+
* and a hostile or misconfigured apiUrl controls it outright). Printed raw it
|
|
75
|
+
* can carry ANSI escapes that rewrite the terminal, and — because agents read
|
|
76
|
+
* CLI stderr — instructions aimed at the agent. Strip C0/C1 control characters
|
|
77
|
+
* (which is what ANSI escapes are built from), collapse newlines, and bound the
|
|
78
|
+
* length.
|
|
79
|
+
*/
|
|
80
|
+
function sanitizeServerText(value, maxLength = 500) {
|
|
81
|
+
if (typeof value !== 'string')
|
|
82
|
+
return '';
|
|
83
|
+
return (value
|
|
84
|
+
// Full CSI sequences first (ESC [ ... final byte). Stripping the ESC byte
|
|
85
|
+
// alone would leave the literal "[31m" / "[0m" residue in the output.
|
|
86
|
+
// eslint-disable-next-line no-control-regex
|
|
87
|
+
.replace(/\u001B\[[0-9;?]*[ -/]*[@-~]/g, '')
|
|
88
|
+
// OSC sequences (ESC ] ... BEL or ST) — these can set the window title.
|
|
89
|
+
// eslint-disable-next-line no-control-regex
|
|
90
|
+
.replace(/\u001B\][^\u0007\u001B]*(?:\u0007|\u001B\\)?/g, '')
|
|
91
|
+
// Anything else in the C0/C1 control ranges, including a bare ESC.
|
|
92
|
+
// eslint-disable-next-line no-control-regex
|
|
93
|
+
.replace(/[\u0000-\u001F\u007F-\u009F]/g, ' ')
|
|
94
|
+
.replace(/\s+/g, ' ')
|
|
95
|
+
.trim()
|
|
96
|
+
.slice(0, maxLength));
|
|
97
|
+
}
|
|
20
98
|
function printSupportFooter() {
|
|
21
|
-
console.
|
|
99
|
+
console.error(chalk_1.default.dim('\n📬 Need help? https://discord.gg/memnexus · https://github.com/memnexus-ai/support/issues'));
|
|
22
100
|
}
|
|
23
101
|
function handleError(error) {
|
|
24
|
-
// Handle SDK errors (from generated SDK with throwOnError: true)
|
|
25
|
-
|
|
102
|
+
// Handle SDK errors (from generated SDK with throwOnError: true).
|
|
103
|
+
// The status must be a NUMBER: plenty of objects carry a string `status`
|
|
104
|
+
// (e.g. { status: 'pending' }) and classifying those as HTTP errors sent
|
|
105
|
+
// them down handleApiError's default branch with a meaningless code.
|
|
106
|
+
if (error &&
|
|
107
|
+
typeof error === 'object' &&
|
|
108
|
+
'status' in error &&
|
|
109
|
+
typeof error.status === 'number') {
|
|
26
110
|
const sdkError = error;
|
|
27
111
|
handleApiError({
|
|
28
112
|
isAxiosError: true,
|
|
@@ -74,43 +158,78 @@ function getStatusText(status) {
|
|
|
74
158
|
function handleApiError(error) {
|
|
75
159
|
if (!error.response) {
|
|
76
160
|
console.error(chalk_1.default.red('❌ Network Error: Unable to connect to API'));
|
|
77
|
-
console.
|
|
78
|
-
console.
|
|
79
|
-
console.
|
|
80
|
-
console.
|
|
81
|
-
console.
|
|
161
|
+
console.error(chalk_1.default.yellow('\n💡 Troubleshooting steps:'));
|
|
162
|
+
console.error(chalk_1.default.yellow(' 1. Check your internet connection'));
|
|
163
|
+
console.error(chalk_1.default.yellow(' 2. Verify API URL: mx config get apiUrl'));
|
|
164
|
+
console.error(chalk_1.default.yellow(' 3. Test API connectivity: curl <api-url>/health'));
|
|
165
|
+
console.error(chalk_1.default.yellow(' 4. Update API URL if needed: mx config set apiUrl <url>'));
|
|
82
166
|
printSupportFooter();
|
|
83
167
|
process.exit(4);
|
|
84
168
|
}
|
|
85
169
|
const status = error.response.status;
|
|
86
170
|
const data = error.response.data;
|
|
171
|
+
// Quota rejection — handled BEFORE the status switch because it is identified
|
|
172
|
+
// by CODE, not by status, and neither of its statuses can be a plain switch arm.
|
|
173
|
+
// The memory-create routes reject an over-cap write with 409 + QUOTA_EXCEEDED
|
|
174
|
+
// (402 is retained for billing-side rejections). 409 is overloaded: a
|
|
175
|
+
// MEMORY_NAME_CONFLICT is also a 409 and must NOT be described as a quota
|
|
176
|
+
// problem, so a 409 qualifies only when it carries the quota code; every other
|
|
177
|
+
// 409 continues to the switch and its default arm, exactly as before.
|
|
178
|
+
//
|
|
179
|
+
// Exit code stays 5 — what the default arm already returned for these statuses
|
|
180
|
+
// — so existing scripts see no exit-code change, only an accurate message.
|
|
181
|
+
if (status === 402 || (status === 409 && data?.code === 'QUOTA_EXCEEDED')) {
|
|
182
|
+
console.error(chalk_1.default.red('❌ Memory Limit Reached: your plan is at capacity'));
|
|
183
|
+
// Prefer `message` over `error` here — the opposite of the other arms. On a
|
|
184
|
+
// quota body `error` is the generic title ("Memory limit reached", already
|
|
185
|
+
// the header above) while `message` is the only field carrying the actual
|
|
186
|
+
// number ("...memory limit (50). Upgrade to Pro..."). Taking `error` first
|
|
187
|
+
// would print the header twice and drop the one detail the user needs.
|
|
188
|
+
if (data.message || data.error) {
|
|
189
|
+
console.error(chalk_1.default.yellow(`\n${sanitizeServerText(data.message || data.error)}`));
|
|
190
|
+
}
|
|
191
|
+
if (data.code) {
|
|
192
|
+
console.error(chalk_1.default.gray(`Code: ${sanitizeServerText(data.code, 64)}`));
|
|
193
|
+
}
|
|
194
|
+
console.error(chalk_1.default.yellow('\n💡 To fix this:'));
|
|
195
|
+
// The cap counts memories CREATED IN THE CURRENT CALENDAR MONTH and resets
|
|
196
|
+
// on the 1st. Deleting frees nothing under those semantics, so this must not
|
|
197
|
+
// suggest it: "delete something" is the first thing a blocked user tries, and
|
|
198
|
+
// advice that cannot work is worse than no advice. The two things that do
|
|
199
|
+
// work are waiting for the reset and upgrading.
|
|
200
|
+
console.error(chalk_1.default.yellow(' 1. Wait for the monthly reset — the limit counts memories CREATED this calendar month and resets on the 1st'));
|
|
201
|
+
console.error(chalk_1.default.yellow(' 2. Delete a memory you created THIS month to free capacity now — the count excludes deleted memories, but deleting one created in an earlier month frees nothing (it was never in this count)'));
|
|
202
|
+
console.error(chalk_1.default.yellow(' 3. Upgrade your plan for a higher limit'));
|
|
203
|
+
printSupportFooter();
|
|
204
|
+
process.exit(5);
|
|
205
|
+
}
|
|
87
206
|
// Each case calls process.exit() which never returns, so break statements are unnecessary
|
|
88
207
|
// eslint-disable-next-line no-fallthrough
|
|
89
208
|
switch (status) {
|
|
90
209
|
case 401:
|
|
91
210
|
console.error(chalk_1.default.red('❌ Authentication Error: Invalid or missing API key'));
|
|
92
|
-
console.
|
|
93
|
-
console.
|
|
94
|
-
console.
|
|
95
|
-
console.
|
|
211
|
+
console.error(chalk_1.default.yellow('\n💡 To fix this:'));
|
|
212
|
+
console.error(chalk_1.default.yellow(' 1. Check auth status: mx auth status'));
|
|
213
|
+
console.error(chalk_1.default.yellow(' 2. Login with your API key: mx auth login --api-key <your-key>'));
|
|
214
|
+
console.error(chalk_1.default.yellow(' 3. Or use interactive mode: mx auth login --interactive'));
|
|
96
215
|
printSupportFooter();
|
|
97
216
|
process.exit(3);
|
|
98
217
|
// eslint-disable-next-line no-fallthrough
|
|
99
218
|
case 403:
|
|
100
219
|
console.error(chalk_1.default.red('❌ Authorization Error: Insufficient permissions'));
|
|
101
|
-
console.
|
|
102
|
-
console.
|
|
103
|
-
console.
|
|
104
|
-
console.
|
|
220
|
+
console.error(chalk_1.default.yellow('\n💡 To fix this:'));
|
|
221
|
+
console.error(chalk_1.default.yellow(' 1. Verify your API key has the required permissions'));
|
|
222
|
+
console.error(chalk_1.default.yellow(' 2. Contact your administrator if you need additional access'));
|
|
223
|
+
console.error(chalk_1.default.yellow(' 3. Check your current auth status: mx auth status'));
|
|
105
224
|
printSupportFooter();
|
|
106
225
|
process.exit(3);
|
|
107
226
|
// eslint-disable-next-line no-fallthrough
|
|
108
227
|
case 404:
|
|
109
228
|
console.error(chalk_1.default.red('❌ Not Found: Resource does not exist'));
|
|
110
|
-
console.
|
|
111
|
-
console.
|
|
112
|
-
console.
|
|
113
|
-
console.
|
|
229
|
+
console.error(chalk_1.default.yellow('\n💡 To fix this:'));
|
|
230
|
+
console.error(chalk_1.default.yellow(' 1. Verify the resource ID is correct'));
|
|
231
|
+
console.error(chalk_1.default.yellow(' 2. List available resources to find the correct ID'));
|
|
232
|
+
console.error(chalk_1.default.yellow(' 3. Check if the resource was deleted'));
|
|
114
233
|
printSupportFooter();
|
|
115
234
|
process.exit(1);
|
|
116
235
|
// eslint-disable-next-line no-fallthrough
|
|
@@ -121,12 +240,12 @@ function handleApiError(error) {
|
|
|
121
240
|
// responses used `message`. Without this the user only saw the generic
|
|
122
241
|
// "Invalid input" line and lost the reason (v3.84 D4).
|
|
123
242
|
if (data.error || data.message) {
|
|
124
|
-
console.error(chalk_1.default.yellow(`\n${data.error || data.message}`));
|
|
243
|
+
console.error(chalk_1.default.yellow(`\n${sanitizeServerText(data.error || data.message)}`));
|
|
125
244
|
}
|
|
126
|
-
console.
|
|
127
|
-
console.
|
|
128
|
-
console.
|
|
129
|
-
console.
|
|
245
|
+
console.error(chalk_1.default.yellow('\n💡 To fix this:'));
|
|
246
|
+
console.error(chalk_1.default.yellow(' 1. Check the command syntax: mx <command> --help'));
|
|
247
|
+
console.error(chalk_1.default.yellow(' 2. Verify all required fields are provided'));
|
|
248
|
+
console.error(chalk_1.default.yellow(' 3. Use --interactive mode for guided input'));
|
|
130
249
|
printSupportFooter();
|
|
131
250
|
process.exit(2);
|
|
132
251
|
// eslint-disable-next-line no-fallthrough
|
|
@@ -138,52 +257,57 @@ function handleApiError(error) {
|
|
|
138
257
|
// (deleteRateLimit) also benefit. The API returns the reason on `error`;
|
|
139
258
|
// some responses use `message`.
|
|
140
259
|
if (data.error || data.message) {
|
|
141
|
-
console.error(chalk_1.default.yellow(`\n${data.error || data.message}`));
|
|
260
|
+
console.error(chalk_1.default.yellow(`\n${sanitizeServerText(data.error || data.message)}`));
|
|
142
261
|
}
|
|
143
262
|
if (data.code) {
|
|
144
|
-
console.error(chalk_1.default.gray(`Code: ${data.code}`));
|
|
263
|
+
console.error(chalk_1.default.gray(`Code: ${sanitizeServerText(data.code, 64)}`));
|
|
145
264
|
}
|
|
146
265
|
// Honor the server's Retry-After hint when present (seconds).
|
|
147
|
-
|
|
148
|
-
|
|
266
|
+
// `retryAfter` is typed as a number but arrives off the wire unvalidated:
|
|
267
|
+
// a string (or NaN/Infinity) would be interpolated verbatim into the
|
|
268
|
+
// line below. Print the hint only when it really is a finite number.
|
|
269
|
+
if (Number.isFinite(data.retryAfter)) {
|
|
270
|
+
console.error(chalk_1.default.yellow(`\n⏱ Retry after ${data.retryAfter}s.`));
|
|
149
271
|
}
|
|
150
|
-
console.
|
|
151
|
-
console.
|
|
152
|
-
console.
|
|
153
|
-
console.
|
|
272
|
+
console.error(chalk_1.default.yellow('\n💡 To fix this:'));
|
|
273
|
+
console.error(chalk_1.default.yellow(' 1. Wait a few moments before retrying'));
|
|
274
|
+
console.error(chalk_1.default.yellow(' 2. Reduce the frequency of your requests'));
|
|
275
|
+
console.error(chalk_1.default.yellow(' 3. Contact support if you need a higher rate limit'));
|
|
154
276
|
printSupportFooter();
|
|
155
277
|
process.exit(5);
|
|
156
278
|
// eslint-disable-next-line no-fallthrough
|
|
157
279
|
case 500:
|
|
158
280
|
console.error(chalk_1.default.red('❌ Server Error: Internal server error'));
|
|
159
|
-
console.
|
|
160
|
-
console.
|
|
161
|
-
console.
|
|
162
|
-
console.
|
|
281
|
+
console.error(chalk_1.default.yellow('\n💡 To fix this:'));
|
|
282
|
+
console.error(chalk_1.default.yellow(' 1. Try again in a few moments'));
|
|
283
|
+
console.error(chalk_1.default.yellow(' 2. Check API status: mx system health'));
|
|
284
|
+
console.error(chalk_1.default.yellow(' 3. Contact support if the issue persists'));
|
|
163
285
|
if (data.error || data.message) {
|
|
164
|
-
console.error(chalk_1.default.gray(`\nDetails: ${data.error || data.message}`));
|
|
286
|
+
console.error(chalk_1.default.gray(`\nDetails: ${sanitizeServerText(data.error || data.message)}`));
|
|
165
287
|
}
|
|
166
288
|
printSupportFooter();
|
|
167
289
|
process.exit(5);
|
|
168
290
|
// eslint-disable-next-line no-fallthrough
|
|
169
291
|
case 503:
|
|
170
292
|
console.error(chalk_1.default.red('❌ Service Unavailable: API is temporarily unavailable'));
|
|
171
|
-
console.
|
|
172
|
-
console.
|
|
173
|
-
console.
|
|
174
|
-
console.
|
|
293
|
+
console.error(chalk_1.default.yellow('\n💡 To fix this:'));
|
|
294
|
+
console.error(chalk_1.default.yellow(' 1. The service may be undergoing maintenance'));
|
|
295
|
+
console.error(chalk_1.default.yellow(' 2. Try again in a few minutes'));
|
|
296
|
+
console.error(chalk_1.default.yellow(' 3. Check API status: mx system health'));
|
|
175
297
|
printSupportFooter();
|
|
176
298
|
process.exit(5);
|
|
177
299
|
// eslint-disable-next-line no-fallthrough
|
|
178
300
|
default:
|
|
179
|
-
|
|
301
|
+
// statusText comes straight off the wire — sanitize like every other
|
|
302
|
+
// server-supplied string before it reaches the terminal.
|
|
303
|
+
console.error(chalk_1.default.red(`❌ API Error: ${status} ${sanitizeServerText(error.response.statusText, 64)}`));
|
|
180
304
|
if (data.error || data.message) {
|
|
181
|
-
console.error(chalk_1.default.yellow(`\n${data.error || data.message}`));
|
|
305
|
+
console.error(chalk_1.default.yellow(`\n${sanitizeServerText(data.error || data.message)}`));
|
|
182
306
|
}
|
|
183
|
-
console.
|
|
184
|
-
console.
|
|
185
|
-
console.
|
|
186
|
-
console.
|
|
307
|
+
console.error(chalk_1.default.yellow('\n💡 For help:'));
|
|
308
|
+
console.error(chalk_1.default.yellow(' 1. Run with DEBUG=1 for more details'));
|
|
309
|
+
console.error(chalk_1.default.yellow(' 2. Check command syntax: mx <command> --help'));
|
|
310
|
+
console.error(chalk_1.default.yellow(' 3. Contact support if the issue persists'));
|
|
187
311
|
printSupportFooter();
|
|
188
312
|
process.exit(5);
|
|
189
313
|
}
|
package/dist/lib/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":";;;;;;AAsCA,sDAQC;AAKD,0CAEC;AAQD,0CAIC;AAYD,gDAkBC;AAUD,kCA6CC;AAtJD,kDAA0B;AAE1B,MAAa,QAAS,SAAQ,KAAK;IAGxB;IACA;IAHT,YACE,OAAe,EACR,WAAmB,CAAC,EACpB,OAAiB;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,aAAQ,GAAR,QAAQ,CAAY;QACpB,YAAO,GAAP,OAAO,CAAU;QAGxB,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AATD,4BASC;AAED;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;GASG;AACH,SAAgB,qBAAqB,CAAC,SAAiB,EAAE,OAAiB;IACxE,OAAO,IAAI,QAAQ,CACjB,GAAG,SAAS,+EAA+E;QACzF,8EAA8E;QAC9E,oDAAoD,EACtD,CAAC,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,OAAe,EAAE,OAAiB;IAChE,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,KAAc;IAC5C,MAAM,CAAC,GAAG,KAAiF,CAAC;IAC5F,MAAM,MAAM,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC,EAAE,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC;IACjE,OAAO,MAAM,KAAK,GAAG,CAAC;AACxB,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,kBAAkB,CAAC,KAAc,EAAE,SAAS,GAAG,GAAG;IAChE,IAA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C,KAAK,kBAAkB,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;YACrF,CAAC;YACD,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC;YAC9C,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,MAAM,CAAC,yCAAyC,CAAC,CAAC,CAAC;YACvE,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,MAAM,CAAC,iDAAiD,CAAC,CAAC,CAAC;YAC/E,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAC,CAAC;YAC3E,kBAAkB,EAAE,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACH,CAAC"}
|
package/dist/lib/retry.d.ts
CHANGED
|
@@ -13,8 +13,90 @@ export declare function isServiceUnavailableError(error: any): boolean;
|
|
|
13
13
|
* infrastructure hiccup, and retrying rarely helps.
|
|
14
14
|
*/
|
|
15
15
|
export declare function isTransientError(error: any): boolean;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Extract the parsed JSON error body from the shapes the SDK/axios throw.
|
|
18
|
+
* Mirrors {@link httpStatus}: callers should not have to know which client
|
|
19
|
+
* produced the error.
|
|
20
|
+
*/
|
|
21
|
+
export declare function errorBody(error: any): any;
|
|
22
|
+
/**
|
|
23
|
+
* The machine-readable `code` the API puts on an error body, when present.
|
|
24
|
+
*
|
|
25
|
+
* Falls back to scanning the message ONLY when no structured body arrived at
|
|
26
|
+
* all: some SDK/gateway paths surface a bare stringified error, and a quota
|
|
27
|
+
* rejection that arrives as text is still a quota rejection.
|
|
28
|
+
*
|
|
29
|
+
* The fallback is deliberately narrow, because the message contains
|
|
30
|
+
* user-controlled text. Server error messages embed the memory NAME the caller
|
|
31
|
+
* supplied (`A memory with name '<name>' already exists`), so an unrestricted
|
|
32
|
+
* scan let the caller choose the classification: `mx memories create --name
|
|
33
|
+
* "QUOTA_EXCEEDED-notes"` against a server that predates the `code` field —
|
|
34
|
+
* exactly the rolling-deploy case this fallback exists for — turned a name
|
|
35
|
+
* conflict into a quota rejection. The upsert retry was skipped and the user was
|
|
36
|
+
* told "Memory Limit Reached" on an account with capacity.
|
|
37
|
+
*
|
|
38
|
+
* Two restrictions close that:
|
|
39
|
+
* 1. A body that IS present but carries no `code` yields undefined. An old
|
|
40
|
+
* server's name-conflict 409 has a body, so it never reaches the scan.
|
|
41
|
+
* 2. Quoted spans are stripped and the code must stand alone as its own word,
|
|
42
|
+
* so a code appearing inside caller text cannot be read as the server's
|
|
43
|
+
* own code.
|
|
44
|
+
*/
|
|
45
|
+
export declare function errorCode(error: any): string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* True when an error is a quota rejection. Never retried — capacity does not
|
|
48
|
+
* come back on its own.
|
|
49
|
+
*
|
|
50
|
+
* Status alone is NOT sufficient. `POST /api/memories` rejects an over-cap
|
|
51
|
+
* create with **409 + code QUOTA_EXCEEDED**, not 402; this predicate used to test
|
|
52
|
+
* `status === 402` only, so it never matched a real quota rejection. The visible
|
|
53
|
+
* consequence was `create --stdin-jsonl`: the early-stop that exists so a
|
|
54
|
+
* capped account does not hammer the API once capacity is gone never fired, and
|
|
55
|
+
* every remaining line was sent and rejected, each reported as a generic
|
|
56
|
+
* CREATE_FAILED rather than as quota.
|
|
57
|
+
*
|
|
58
|
+
* 402 is retained because the batch/import paths documented it and a future
|
|
59
|
+
* billing-side rejection may still use it. The 409 arm keys on the CODE, never
|
|
60
|
+
* on the bare status: 409 is overloaded — it is also MEMORY_NAME_CONFLICT, which
|
|
61
|
+
* must keep flowing to the named-upsert retry rather than being reported as
|
|
62
|
+
* quota.
|
|
63
|
+
*/
|
|
17
64
|
export declare function isQuotaError(error: any): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* 409 codes that are definitively NOT a name conflict.
|
|
67
|
+
*
|
|
68
|
+
* Enforced structurally — {@link isNameConflictError} accepts only
|
|
69
|
+
* MEMORY_NAME_CONFLICT, so every other code already fails closed. The list is
|
|
70
|
+
* kept explicit so the intent is testable and so adding a new 409 server-side
|
|
71
|
+
* has a visible place to be registered.
|
|
72
|
+
*/
|
|
73
|
+
export declare const NON_NAME_CONFLICT_409_CODES: readonly ["QUOTA_EXCEEDED", "NAMED_MEMORY_APPEND_EXHAUSTED", "NAMED_WRITE_CONCURRENCY_LIMIT"];
|
|
74
|
+
/**
|
|
75
|
+
* True when a 409 means "a named memory with this name already exists" — the
|
|
76
|
+
* only 409 that may be retried as an upsert against PUT /memories/named/:name.
|
|
77
|
+
*
|
|
78
|
+
* POSITIVE classification, with a bounded compatibility window.
|
|
79
|
+
*
|
|
80
|
+
* This used to be "409 that is not a quota rejection". That was correct for the
|
|
81
|
+
* two codes that existed, but it classified by exclusion: any 409 the CLI did
|
|
82
|
+
* not recognise became a name conflict and was retried as an upsert. The upsert
|
|
83
|
+
* sends no `expectedHeadId`, so it overwrites whatever the head is at that
|
|
84
|
+
* moment — and the 409 most likely to be misclassified is a concurrent-write
|
|
85
|
+
* rejection, precisely the case where the head being overwritten is NOT the one
|
|
86
|
+
* the caller read. A new server-side 409 would have turned a rejected write into
|
|
87
|
+
* a silent clobber of someone else's version.
|
|
88
|
+
*
|
|
89
|
+
* The rule now:
|
|
90
|
+
* - `code === 'MEMORY_NAME_CONFLICT'` → name conflict. Positive, exact.
|
|
91
|
+
* - Any OTHER code → not a name conflict. New codes fail closed; see
|
|
92
|
+
* {@link NON_NAME_CONFLICT_409_CODES}.
|
|
93
|
+
* - NO code on the body at all → fall back to the bare-409 heuristic. The
|
|
94
|
+
* name-conflict body only began carrying `code` in v4.05, and during a
|
|
95
|
+
* rolling deploy the CLI still has to upsert against an older server. This
|
|
96
|
+
* arm is the compatibility window and can be deleted once no pre-v4.05
|
|
97
|
+
* server is in service.
|
|
98
|
+
*/
|
|
99
|
+
export declare function isNameConflictError(error: any): boolean;
|
|
18
100
|
/**
|
|
19
101
|
* Extract the server's Retry-After hint in milliseconds, or null if absent.
|
|
20
102
|
* The API surfaces it as a body field (`retryAfter`, seconds) on 429s
|
package/dist/lib/retry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/lib/retry.ts"],"names":[],"mappings":"AAiBA,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAEzD;AAED,wDAAwD;AACxD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAEpD;AAED,2EAA2E;AAC3E,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAE7D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAGpD;AAED,
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/lib/retry.ts"],"names":[],"mappings":"AAiBA,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAEzD;AAED,wDAAwD;AACxD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAEpD;AAED,2EAA2E;AAC3E,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAE7D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAGpD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG,CAEzC;AA+BD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAUxD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,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