wontopos 2.2.43 → 2.2.44

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/README.md CHANGED
@@ -180,6 +180,10 @@ try {
180
180
  }
181
181
  ```
182
182
 
183
+ A retired model answers `410`, thrown as `GoneError`: retrying cannot succeed, so name a
184
+ live model (`listModels()` lists them, with `retires_at` on one that is scheduled to
185
+ retire). `deleteStore` still works under a retired model.
186
+
183
187
  ## A different API host
184
188
 
185
189
  Point the client somewhere other than the default endpoint - a dedicated region,
@@ -106,6 +106,11 @@ export declare class ConflictError extends WosError {
106
106
  readonly conflictsWith?: string;
107
107
  constructor(status: number, message: string, requestId?: string, init?: WosErrorInit);
108
108
  }
109
+ /** 410 — the model this call named is retired. Retrying cannot succeed: name a live
110
+ * model instead (`listModels()` lists them). `deleteStore` still works under a
111
+ * retired model. */
112
+ export declare class GoneError extends WosError {
113
+ }
109
114
  /** 429 — too many requests. Back off and retry (the client already retries these,
110
115
  * unless `Retry-After` asks for more than 30 seconds). */
111
116
  export declare class RateLimitError extends WosError {
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WME = exports.Client = exports.ServerError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.PermissionDeniedError = exports.PaymentRequiredError = exports.AuthenticationError = exports.BadRequestError = exports.APIConnectionError = exports.WosError = exports.CONTEXT_LIMIT_MAX = exports.CONTEXT_LIMIT_MIN = exports.SEARCH_LIMIT_MAX = exports.SEARCH_LIMIT_MIN = void 0;
3
+ exports.WME = exports.Client = exports.ServerError = exports.RateLimitError = exports.GoneError = exports.ConflictError = exports.NotFoundError = exports.PermissionDeniedError = exports.PaymentRequiredError = exports.AuthenticationError = exports.BadRequestError = exports.APIConnectionError = exports.WosError = exports.CONTEXT_LIMIT_MAX = exports.CONTEXT_LIMIT_MIN = exports.SEARCH_LIMIT_MAX = exports.SEARCH_LIMIT_MIN = void 0;
4
4
  exports._resetStoreIdWarnings = _resetStoreIdWarnings;
5
5
  exports._resetFilterWarnings = _resetFilterWarnings;
6
- const VERSION = "2.2.43";
6
+ const VERSION = "2.2.44";
7
7
  const RUNTIME = (() => {
8
8
  const p = globalThis?.process;
9
9
  return p?.version ? ` (node/${p.version}; ${p.platform}-${p.arch})` : "";
@@ -456,6 +456,9 @@ class ConflictError extends WosError {
456
456
  }
457
457
  }
458
458
  exports.ConflictError = ConflictError;
459
+ class GoneError extends WosError {
460
+ }
461
+ exports.GoneError = GoneError;
459
462
  class RateLimitError extends WosError {
460
463
  retryAfter;
461
464
  constructor(status, message, requestId, init) {
@@ -468,6 +471,7 @@ exports.RateLimitError = RateLimitError;
468
471
  class ServerError extends WosError {
469
472
  }
470
473
  exports.ServerError = ServerError;
474
+ const GONE_HINT = "This model is retired; listModels() lists the ones you can use.";
471
475
  const STATUS_ERRORS = {
472
476
  400: BadRequestError,
473
477
  401: AuthenticationError,
@@ -475,6 +479,7 @@ const STATUS_ERRORS = {
475
479
  403: PermissionDeniedError,
476
480
  404: NotFoundError,
477
481
  409: ConflictError,
482
+ 410: GoneError,
478
483
  413: BadRequestError,
479
484
  422: BadRequestError,
480
485
  429: RateLimitError,
@@ -1072,6 +1077,8 @@ class Client {
1072
1077
  errorFromAnswer(res, body, retryAfter, mayBeDeleted = false, unread) {
1073
1078
  const e = parseErrorText(new TextDecoder().decode(body));
1074
1079
  let msg = cleanServerText(e.message) || `HTTP ${res.status}`;
1080
+ if (res.status === 410)
1081
+ msg += ` ${GONE_HINT}`;
1075
1082
  if (unread)
1076
1083
  msg += ` (the error body could not be read: ${cleanServerText(unread, 512)})`;
1077
1084
  const requestId = e.requestId === undefined ? undefined : cleanServerText(e.requestId, 256) || undefined;
@@ -106,6 +106,11 @@ export declare class ConflictError extends WosError {
106
106
  readonly conflictsWith?: string;
107
107
  constructor(status: number, message: string, requestId?: string, init?: WosErrorInit);
108
108
  }
109
+ /** 410 — the model this call named is retired. Retrying cannot succeed: name a live
110
+ * model instead (`listModels()` lists them). `deleteStore` still works under a
111
+ * retired model. */
112
+ export declare class GoneError extends WosError {
113
+ }
109
114
  /** 429 — too many requests. Back off and retry (the client already retries these,
110
115
  * unless `Retry-After` asks for more than 30 seconds). */
111
116
  export declare class RateLimitError extends WosError {
package/dist/wontopos.js CHANGED
@@ -1,4 +1,4 @@
1
- const VERSION = "2.2.43";
1
+ const VERSION = "2.2.44";
2
2
  const RUNTIME = (() => {
3
3
  const p = globalThis?.process;
4
4
  return p?.version ? ` (node/${p.version}; ${p.platform}-${p.arch})` : "";
@@ -443,6 +443,8 @@ export class ConflictError extends WosError {
443
443
  this.conflictsWith = typeof c === "string" ? c : undefined;
444
444
  }
445
445
  }
446
+ export class GoneError extends WosError {
447
+ }
446
448
  export class RateLimitError extends WosError {
447
449
  retryAfter;
448
450
  constructor(status, message, requestId, init) {
@@ -453,6 +455,7 @@ export class RateLimitError extends WosError {
453
455
  }
454
456
  export class ServerError extends WosError {
455
457
  }
458
+ const GONE_HINT = "This model is retired; listModels() lists the ones you can use.";
456
459
  const STATUS_ERRORS = {
457
460
  400: BadRequestError,
458
461
  401: AuthenticationError,
@@ -460,6 +463,7 @@ const STATUS_ERRORS = {
460
463
  403: PermissionDeniedError,
461
464
  404: NotFoundError,
462
465
  409: ConflictError,
466
+ 410: GoneError,
463
467
  413: BadRequestError,
464
468
  422: BadRequestError,
465
469
  429: RateLimitError,
@@ -1057,6 +1061,8 @@ export class Client {
1057
1061
  errorFromAnswer(res, body, retryAfter, mayBeDeleted = false, unread) {
1058
1062
  const e = parseErrorText(new TextDecoder().decode(body));
1059
1063
  let msg = cleanServerText(e.message) || `HTTP ${res.status}`;
1064
+ if (res.status === 410)
1065
+ msg += ` ${GONE_HINT}`;
1060
1066
  if (unread)
1061
1067
  msg += ` (the error body could not be read: ${cleanServerText(unread, 512)})`;
1062
1068
  const requestId = e.requestId === undefined ? undefined : cleanServerText(e.requestId, 256) || undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wontopos",
3
- "version": "2.2.43",
3
+ "version": "2.2.44",
4
4
  "description": "Wontopos \u2014 long-term memory for AI agents. Identical recall in every language, ~100\u00d7 lower LLM bill.",
5
5
  "keywords": [
6
6
  "memory",