@maximem/synap-js-sdk 0.5.20 → 0.5.21

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/index.d.cts CHANGED
@@ -1892,7 +1892,7 @@ declare class SynapClient {
1892
1892
  * build when the two disagree, which is the only thing that makes a manual
1893
1893
  * publish safe.
1894
1894
  */
1895
- declare const SDK_VERSION = "0.5.20";
1895
+ declare const SDK_VERSION = "0.5.21";
1896
1896
 
1897
1897
  /**
1898
1898
  * `response_shape: "ranked"`: one list in the order the server ranked it.
package/dist/index.d.ts CHANGED
@@ -1892,7 +1892,7 @@ declare class SynapClient {
1892
1892
  * build when the two disagree, which is the only thing that makes a manual
1893
1893
  * publish safe.
1894
1894
  */
1895
- declare const SDK_VERSION = "0.5.20";
1895
+ declare const SDK_VERSION = "0.5.21";
1896
1896
 
1897
1897
  /**
1898
1898
  * `response_shape: "ranked"`: one list in the order the server ranked it.
package/dist/index.js CHANGED
@@ -106,6 +106,9 @@ function shouldRetry(input) {
106
106
  if (!isSynapError(error) || !error.transient) {
107
107
  return { retry: false, delaySeconds: 0, reason: "not_transient" };
108
108
  }
109
+ if (error instanceof RateLimitError && error.reason) {
110
+ return { retry: false, delaySeconds: 0, reason: "credit_stop" };
111
+ }
109
112
  const idempotent = input.idempotent ?? IDEMPOTENT_METHODS.has(method.toUpperCase());
110
113
  if (outcomeUnknown && !idempotent) {
111
114
  return {
@@ -1099,7 +1102,9 @@ var FORGET_DESCRIPTION_MIN = 3;
1099
1102
  var FORGET_DESCRIPTION_MAX = 500;
1100
1103
  function buildForgetBody(options) {
1101
1104
  const description = options.description;
1102
- if (typeof description !== "string" || description.length < FORGET_DESCRIPTION_MIN || description.length > FORGET_DESCRIPTION_MAX) {
1105
+ if (typeof description !== "string" || // Code points, as Python's len() and the server count; `.length` counts
1106
+ // UTF-16 units, so 251 emoji (502 units) were refused here only.
1107
+ [...description].length < FORGET_DESCRIPTION_MIN || [...description].length > FORGET_DESCRIPTION_MAX) {
1103
1108
  throw new InvalidInputError(
1104
1109
  `description must be between ${FORGET_DESCRIPTION_MIN} and ${FORGET_DESCRIPTION_MAX} characters`
1105
1110
  );
@@ -2044,7 +2049,7 @@ function createInstanceNamespace(credentials, cache, onTurn, agentModel = () =>
2044
2049
  }
2045
2050
 
2046
2051
  // src/version.ts
2047
- var SDK_VERSION = "0.5.20";
2052
+ var SDK_VERSION = "0.5.21";
2048
2053
 
2049
2054
  // src/registry.ts
2050
2055
  var instances = /* @__PURE__ */ new Map();