@memnexus-ai/cli 1.7.221 → 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.
@@ -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
- /** True when an error is an HTTP 402 (quota / payment required). Never retried. */
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
@@ -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,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI,CAoBzD;AAED,sEAAsE;AACtE,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;AAGD,mFAAmF;AACnF,eAAO,MAAM,+BAA+B,IAAI,CAAC;AACjD,6EAA6E;AAC7E,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,mFAAmF;AACnF,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAE9C;;;;;GAKG;AACH,wBA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M,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB,yEAAyE;IACzE,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;IACtB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,KAAK,IAAI,CAAC;CACZ;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,mBAAmB,CAAC,CAAC,EACzC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,CAAC,CAAC,CA8BZ"}
package/dist/lib/retry.js CHANGED
@@ -3,12 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SINGLE_SHOT_MAX_RETRIES = exports.SINGLE_SHOT_MAX_WAIT_MS = exports.SINGLE_SHOT_BASE_BACKOFF_MS = exports.SINGLE_SHOT_MAX_RETRIES_MAX = exports.SINGLE_SHOT_MAX_RETRIES_MIN = exports.SINGLE_SHOT_DEFAULT_MAX_RETRIES = void 0;
6
+ exports.SINGLE_SHOT_MAX_RETRIES = exports.SINGLE_SHOT_MAX_WAIT_MS = exports.SINGLE_SHOT_BASE_BACKOFF_MS = exports.SINGLE_SHOT_MAX_RETRIES_MAX = exports.SINGLE_SHOT_MAX_RETRIES_MIN = exports.SINGLE_SHOT_DEFAULT_MAX_RETRIES = exports.NON_NAME_CONFLICT_409_CODES = void 0;
7
7
  exports.httpStatus = httpStatus;
8
8
  exports.isRateLimitError = isRateLimitError;
9
9
  exports.isServiceUnavailableError = isServiceUnavailableError;
10
10
  exports.isTransientError = isTransientError;
11
+ exports.errorBody = errorBody;
12
+ exports.errorCode = errorCode;
11
13
  exports.isQuotaError = isQuotaError;
14
+ exports.isNameConflictError = isNameConflictError;
12
15
  exports.getRetryAfterMs = getRetryAfterMs;
13
16
  exports.sleep = sleep;
14
17
  exports.resolveMaxRetries = resolveMaxRetries;
@@ -52,9 +55,146 @@ function isTransientError(error) {
52
55
  const status = httpStatus(error);
53
56
  return status === 502 || status === 503 || status === 504 || status === 408;
54
57
  }
55
- /** True when an error is an HTTP 402 (quota / payment required). Never retried. */
58
+ /**
59
+ * Extract the parsed JSON error body from the shapes the SDK/axios throw.
60
+ * Mirrors {@link httpStatus}: callers should not have to know which client
61
+ * produced the error.
62
+ */
63
+ function errorBody(error) {
64
+ return error?.data ?? error?.body ?? error?.response?.data;
65
+ }
66
+ /** Codes the message fallback is allowed to recognise. */
67
+ const MESSAGE_FALLBACK_CODES = ['QUOTA_EXCEEDED', 'MEMORY_NAME_CONFLICT'];
68
+ /**
69
+ * Matches a code only where a code can legitimately appear: at the start of the
70
+ * message or after whitespace/punctuation, and NOT followed by a character that
71
+ * would make it part of a longer identifier (`-`, `_`, alphanumerics).
72
+ *
73
+ * `\b` is not enough. `\bQUOTA_EXCEEDED\b` matches inside `QUOTA_EXCEEDED-notes`
74
+ * because `-` is a word boundary, which is exactly how a user-supplied memory
75
+ * name reaches this scan.
76
+ */
77
+ const ERROR_CODE_PATTERN = new RegExp(`(?:^|[\\s:;,.(\\[])(${MESSAGE_FALLBACK_CODES.join('|')})(?![\\w-])`);
78
+ /**
79
+ * Remove single-, double-, and backtick-quoted spans. Server messages embed
80
+ * user-controlled text in quotes — the name-conflict message is
81
+ * `A memory with name '<name>' already exists` — so anything inside quotes is
82
+ * caller input, not a server code, and must not be scanned.
83
+ */
84
+ function stripQuotedSpans(message) {
85
+ return message
86
+ .replace(/'[^']*'/g, "''")
87
+ .replace(/"[^"]*"/g, '""')
88
+ .replace(/`[^`]*`/g, '``');
89
+ }
90
+ /**
91
+ * The machine-readable `code` the API puts on an error body, when present.
92
+ *
93
+ * Falls back to scanning the message ONLY when no structured body arrived at
94
+ * all: some SDK/gateway paths surface a bare stringified error, and a quota
95
+ * rejection that arrives as text is still a quota rejection.
96
+ *
97
+ * The fallback is deliberately narrow, because the message contains
98
+ * user-controlled text. Server error messages embed the memory NAME the caller
99
+ * supplied (`A memory with name '<name>' already exists`), so an unrestricted
100
+ * scan let the caller choose the classification: `mx memories create --name
101
+ * "QUOTA_EXCEEDED-notes"` against a server that predates the `code` field —
102
+ * exactly the rolling-deploy case this fallback exists for — turned a name
103
+ * conflict into a quota rejection. The upsert retry was skipped and the user was
104
+ * told "Memory Limit Reached" on an account with capacity.
105
+ *
106
+ * Two restrictions close that:
107
+ * 1. A body that IS present but carries no `code` yields undefined. An old
108
+ * server's name-conflict 409 has a body, so it never reaches the scan.
109
+ * 2. Quoted spans are stripped and the code must stand alone as its own word,
110
+ * so a code appearing inside caller text cannot be read as the server's
111
+ * own code.
112
+ */
113
+ function errorCode(error) {
114
+ const body = errorBody(error);
115
+ const code = body?.code;
116
+ if (typeof code === 'string')
117
+ return code;
118
+ // A structured body arrived and did not name a code — that is an answer, not a
119
+ // gap. Do not guess from prose.
120
+ if (body !== undefined && body !== null)
121
+ return undefined;
122
+ const message = typeof error?.message === 'string' ? error.message : '';
123
+ const match = ERROR_CODE_PATTERN.exec(stripQuotedSpans(message));
124
+ return match?.[1];
125
+ }
126
+ /**
127
+ * True when an error is a quota rejection. Never retried — capacity does not
128
+ * come back on its own.
129
+ *
130
+ * Status alone is NOT sufficient. `POST /api/memories` rejects an over-cap
131
+ * create with **409 + code QUOTA_EXCEEDED**, not 402; this predicate used to test
132
+ * `status === 402` only, so it never matched a real quota rejection. The visible
133
+ * consequence was `create --stdin-jsonl`: the early-stop that exists so a
134
+ * capped account does not hammer the API once capacity is gone never fired, and
135
+ * every remaining line was sent and rejected, each reported as a generic
136
+ * CREATE_FAILED rather than as quota.
137
+ *
138
+ * 402 is retained because the batch/import paths documented it and a future
139
+ * billing-side rejection may still use it. The 409 arm keys on the CODE, never
140
+ * on the bare status: 409 is overloaded — it is also MEMORY_NAME_CONFLICT, which
141
+ * must keep flowing to the named-upsert retry rather than being reported as
142
+ * quota.
143
+ */
56
144
  function isQuotaError(error) {
57
- return httpStatus(error) === 402;
145
+ if (httpStatus(error) === 402)
146
+ return true;
147
+ return httpStatus(error) === 409 && errorCode(error) === 'QUOTA_EXCEEDED';
148
+ }
149
+ /**
150
+ * 409 codes that are definitively NOT a name conflict.
151
+ *
152
+ * Enforced structurally — {@link isNameConflictError} accepts only
153
+ * MEMORY_NAME_CONFLICT, so every other code already fails closed. The list is
154
+ * kept explicit so the intent is testable and so adding a new 409 server-side
155
+ * has a visible place to be registered.
156
+ */
157
+ exports.NON_NAME_CONFLICT_409_CODES = [
158
+ 'QUOTA_EXCEEDED',
159
+ 'NAMED_MEMORY_APPEND_EXHAUSTED',
160
+ 'NAMED_WRITE_CONCURRENCY_LIMIT',
161
+ ];
162
+ /**
163
+ * True when a 409 means "a named memory with this name already exists" — the
164
+ * only 409 that may be retried as an upsert against PUT /memories/named/:name.
165
+ *
166
+ * POSITIVE classification, with a bounded compatibility window.
167
+ *
168
+ * This used to be "409 that is not a quota rejection". That was correct for the
169
+ * two codes that existed, but it classified by exclusion: any 409 the CLI did
170
+ * not recognise became a name conflict and was retried as an upsert. The upsert
171
+ * sends no `expectedHeadId`, so it overwrites whatever the head is at that
172
+ * moment — and the 409 most likely to be misclassified is a concurrent-write
173
+ * rejection, precisely the case where the head being overwritten is NOT the one
174
+ * the caller read. A new server-side 409 would have turned a rejected write into
175
+ * a silent clobber of someone else's version.
176
+ *
177
+ * The rule now:
178
+ * - `code === 'MEMORY_NAME_CONFLICT'` → name conflict. Positive, exact.
179
+ * - Any OTHER code → not a name conflict. New codes fail closed; see
180
+ * {@link NON_NAME_CONFLICT_409_CODES}.
181
+ * - NO code on the body at all → fall back to the bare-409 heuristic. The
182
+ * name-conflict body only began carrying `code` in v4.05, and during a
183
+ * rolling deploy the CLI still has to upsert against an older server. This
184
+ * arm is the compatibility window and can be deleted once no pre-v4.05
185
+ * server is in service.
186
+ */
187
+ function isNameConflictError(error) {
188
+ if (httpStatus(error) !== 409)
189
+ return false;
190
+ const code = errorCode(error);
191
+ if (code === 'MEMORY_NAME_CONFLICT')
192
+ return true;
193
+ if (code !== undefined)
194
+ return false;
195
+ // Legacy path: pre-v4.05 server, no code anywhere. A bare 409 from the create
196
+ // route was a name conflict on those versions.
197
+ return true;
58
198
  }
59
199
  /**
60
200
  * Extract the server's Retry-After hint in milliseconds, or null if absent.
@@ -1 +1 @@
1
- {"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/lib/retry.ts"],"names":[],"mappings":";;;;;;AAkBA,gCAEC;AAGD,4CAEC;AAGD,8DAEC;AAUD,4CAGC;AAGD,oCAEC;AAOD,0CAoBC;AAGD,sBAEC;AAuBD,8CAoBC;AAuDD,kDAiCC;AAnND,kDAA0B;AAE1B,gFAAgF;AAChF,gFAAgF;AAChF,6EAA6E;AAC7E,iFAAiF;AACjF,4EAA4E;AAC5E,+BAA+B;AAC/B,EAAE;AACF,8DAA8D;AAC9D,+EAA+E;AAC/E,6DAA6D;AAC7D,2EAA2E;AAC3E,4EAA4E;AAC5E,6EAA6E;AAC7E,+DAA+D;AAE/D,iFAAiF;AACjF,SAAgB,UAAU,CAAC,KAAU;IACnC,OAAO,KAAK,EAAE,MAAM,IAAI,KAAK,EAAE,UAAU,IAAI,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC;AACvE,CAAC;AAED,wDAAwD;AAC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C,CAAC;YACxE,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,OAAO,EAAE,OAAO,CAAC,CAAC;YACpD,OAAO,EAAE,CAAC;YACV,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YACxD,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memnexus-ai/cli",
3
- "version": "1.7.221",
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.67.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",