@langchain/langgraph-sdk 1.9.24 → 1.9.25

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.
Files changed (41) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +2 -0
  2. package/dist/_virtual/_rolldown/runtime.js +24 -0
  3. package/dist/node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index.cjs +244 -0
  4. package/dist/node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index.cjs.map +1 -0
  5. package/dist/node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index.js +240 -0
  6. package/dist/node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index.js.map +1 -0
  7. package/dist/node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index2.cjs +13 -0
  8. package/dist/node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index2.cjs.map +1 -0
  9. package/dist/node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index2.js +8 -0
  10. package/dist/node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index2.js.map +1 -0
  11. package/dist/node_modules/.pnpm/is-network-error@1.3.1/node_modules/is-network-error/index.cjs +25 -0
  12. package/dist/node_modules/.pnpm/is-network-error@1.3.1/node_modules/is-network-error/index.cjs.map +1 -0
  13. package/dist/node_modules/.pnpm/is-network-error@1.3.1/node_modules/is-network-error/index.js +25 -0
  14. package/dist/node_modules/.pnpm/is-network-error@1.3.1/node_modules/is-network-error/index.js.map +1 -0
  15. package/dist/node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/index.cjs +596 -0
  16. package/dist/node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/index.cjs.map +1 -0
  17. package/dist/node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/index.js +596 -0
  18. package/dist/node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/index.js.map +1 -0
  19. package/dist/node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/lower-bound.cjs +18 -0
  20. package/dist/node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/lower-bound.cjs.map +1 -0
  21. package/dist/node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/lower-bound.js +18 -0
  22. package/dist/node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/lower-bound.js.map +1 -0
  23. package/dist/node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/priority-queue.cjs +41 -0
  24. package/dist/node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/priority-queue.cjs.map +1 -0
  25. package/dist/node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/priority-queue.js +41 -0
  26. package/dist/node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/priority-queue.js.map +1 -0
  27. package/dist/node_modules/.pnpm/p-retry@7.1.1/node_modules/p-retry/index.cjs +141 -0
  28. package/dist/node_modules/.pnpm/p-retry@7.1.1/node_modules/p-retry/index.cjs.map +1 -0
  29. package/dist/node_modules/.pnpm/p-retry@7.1.1/node_modules/p-retry/index.js +141 -0
  30. package/dist/node_modules/.pnpm/p-retry@7.1.1/node_modules/p-retry/index.js.map +1 -0
  31. package/dist/node_modules/.pnpm/p-timeout@7.0.1/node_modules/p-timeout/index.cjs +63 -0
  32. package/dist/node_modules/.pnpm/p-timeout@7.0.1/node_modules/p-timeout/index.cjs.map +1 -0
  33. package/dist/node_modules/.pnpm/p-timeout@7.0.1/node_modules/p-timeout/index.js +62 -0
  34. package/dist/node_modules/.pnpm/p-timeout@7.0.1/node_modules/p-timeout/index.js.map +1 -0
  35. package/dist/utils/async_caller.cjs +14 -8
  36. package/dist/utils/async_caller.cjs.map +1 -1
  37. package/dist/utils/async_caller.d.cts.map +1 -1
  38. package/dist/utils/async_caller.d.ts.map +1 -1
  39. package/dist/utils/async_caller.js +13 -4
  40. package/dist/utils/async_caller.js.map +1 -1
  41. package/package.json +3 -2
@@ -0,0 +1,62 @@
1
+ //#region ../../node_modules/.pnpm/p-timeout@7.0.1/node_modules/p-timeout/index.js
2
+ var TimeoutError = class TimeoutError extends Error {
3
+ name = "TimeoutError";
4
+ constructor(message, options) {
5
+ super(message, options);
6
+ Error.captureStackTrace?.(this, TimeoutError);
7
+ }
8
+ };
9
+ const getAbortedReason = (signal) => signal.reason ?? new DOMException("This operation was aborted.", "AbortError");
10
+ function pTimeout(promise, options) {
11
+ const { milliseconds, fallback, message, customTimers = {
12
+ setTimeout,
13
+ clearTimeout
14
+ }, signal } = options;
15
+ let timer;
16
+ let abortHandler;
17
+ const cancelablePromise = new Promise((resolve, reject) => {
18
+ if (typeof milliseconds !== "number" || Math.sign(milliseconds) !== 1) throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
19
+ if (signal?.aborted) {
20
+ reject(getAbortedReason(signal));
21
+ return;
22
+ }
23
+ if (signal) {
24
+ abortHandler = () => {
25
+ reject(getAbortedReason(signal));
26
+ };
27
+ signal.addEventListener("abort", abortHandler, { once: true });
28
+ }
29
+ promise.then(resolve, reject);
30
+ if (milliseconds === Number.POSITIVE_INFINITY) return;
31
+ const timeoutError = new TimeoutError();
32
+ timer = customTimers.setTimeout.call(void 0, () => {
33
+ if (fallback) {
34
+ try {
35
+ resolve(fallback());
36
+ } catch (error) {
37
+ reject(error);
38
+ }
39
+ return;
40
+ }
41
+ if (typeof promise.cancel === "function") promise.cancel();
42
+ if (message === false) resolve();
43
+ else if (message instanceof Error) reject(message);
44
+ else {
45
+ timeoutError.message = message ?? `Promise timed out after ${milliseconds} milliseconds`;
46
+ reject(timeoutError);
47
+ }
48
+ }, milliseconds);
49
+ }).finally(() => {
50
+ cancelablePromise.clear();
51
+ if (abortHandler && signal) signal.removeEventListener("abort", abortHandler);
52
+ });
53
+ cancelablePromise.clear = () => {
54
+ customTimers.clearTimeout.call(void 0, timer);
55
+ timer = void 0;
56
+ };
57
+ return cancelablePromise;
58
+ }
59
+ //#endregion
60
+ export { TimeoutError, pTimeout as default };
61
+
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../node_modules/.pnpm/p-timeout@7.0.1/node_modules/p-timeout/index.js"],"sourcesContent":["export class TimeoutError extends Error {\n\tname = 'TimeoutError';\n\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tError.captureStackTrace?.(this, TimeoutError);\n\t}\n}\n\nconst getAbortedReason = signal => signal.reason ?? new DOMException('This operation was aborted.', 'AbortError');\n\nexport default function pTimeout(promise, options) {\n\tconst {\n\t\tmilliseconds,\n\t\tfallback,\n\t\tmessage,\n\t\tcustomTimers = {setTimeout, clearTimeout},\n\t\tsignal,\n\t} = options;\n\n\tlet timer;\n\tlet abortHandler;\n\n\tconst wrappedPromise = new Promise((resolve, reject) => {\n\t\tif (typeof milliseconds !== 'number' || Math.sign(milliseconds) !== 1) {\n\t\t\tthrow new TypeError(`Expected \\`milliseconds\\` to be a positive number, got \\`${milliseconds}\\``);\n\t\t}\n\n\t\tif (signal?.aborted) {\n\t\t\treject(getAbortedReason(signal));\n\t\t\treturn;\n\t\t}\n\n\t\tif (signal) {\n\t\t\tabortHandler = () => {\n\t\t\t\treject(getAbortedReason(signal));\n\t\t\t};\n\n\t\t\tsignal.addEventListener('abort', abortHandler, {once: true});\n\t\t}\n\n\t\t// Use .then() instead of async IIFE to preserve stack traces\n\t\t// eslint-disable-next-line promise/prefer-await-to-then, promise/prefer-catch\n\t\tpromise.then(resolve, reject);\n\n\t\tif (milliseconds === Number.POSITIVE_INFINITY) {\n\t\t\treturn;\n\t\t}\n\n\t\t// We create the error outside of `setTimeout` to preserve the stack trace.\n\t\tconst timeoutError = new TimeoutError();\n\n\t\t// `.call(undefined, ...)` is needed for custom timers to avoid context issues\n\t\ttimer = customTimers.setTimeout.call(undefined, () => {\n\t\t\tif (fallback) {\n\t\t\t\ttry {\n\t\t\t\t\tresolve(fallback());\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (typeof promise.cancel === 'function') {\n\t\t\t\tpromise.cancel();\n\t\t\t}\n\n\t\t\tif (message === false) {\n\t\t\t\tresolve();\n\t\t\t} else if (message instanceof Error) {\n\t\t\t\treject(message);\n\t\t\t} else {\n\t\t\t\ttimeoutError.message = message ?? `Promise timed out after ${milliseconds} milliseconds`;\n\t\t\t\treject(timeoutError);\n\t\t\t}\n\t\t}, milliseconds);\n\t});\n\n\t// eslint-disable-next-line promise/prefer-await-to-then\n\tconst cancelablePromise = wrappedPromise.finally(() => {\n\t\tcancelablePromise.clear();\n\t\tif (abortHandler && signal) {\n\t\t\tsignal.removeEventListener('abort', abortHandler);\n\t\t}\n\t});\n\n\tcancelablePromise.clear = () => {\n\t\t// `.call(undefined, ...)` is needed for custom timers to avoid context issues\n\t\tcustomTimers.clearTimeout.call(undefined, timer);\n\t\ttimer = undefined;\n\t};\n\n\treturn cancelablePromise;\n}\n"],"x_google_ignoreList":[0],"mappings":";AAAA,IAAa,eAAb,MAAa,qBAAqB,MAAM;CACvC,OAAO;CAEP,YAAY,SAAS,SAAS;AAC7B,QAAM,SAAS,QAAQ;AACvB,QAAM,oBAAoB,MAAM,aAAa;;;AAI/C,MAAM,oBAAmB,WAAU,OAAO,UAAU,IAAI,aAAa,+BAA+B,aAAa;AAEjH,SAAwB,SAAS,SAAS,SAAS;CAClD,MAAM,EACL,cACA,UACA,SACA,eAAe;EAAC;EAAY;EAAa,EACzC,WACG;CAEJ,IAAI;CACJ,IAAI;CA2DJ,MAAM,oBAzDiB,IAAI,SAAS,SAAS,WAAW;AACvD,MAAI,OAAO,iBAAiB,YAAY,KAAK,KAAK,aAAa,KAAK,EACnE,OAAM,IAAI,UAAU,4DAA4D,aAAa,IAAI;AAGlG,MAAI,QAAQ,SAAS;AACpB,UAAO,iBAAiB,OAAO,CAAC;AAChC;;AAGD,MAAI,QAAQ;AACX,wBAAqB;AACpB,WAAO,iBAAiB,OAAO,CAAC;;AAGjC,UAAO,iBAAiB,SAAS,cAAc,EAAC,MAAM,MAAK,CAAC;;AAK7D,UAAQ,KAAK,SAAS,OAAO;AAE7B,MAAI,iBAAiB,OAAO,kBAC3B;EAID,MAAM,eAAe,IAAI,cAAc;AAGvC,UAAQ,aAAa,WAAW,KAAK,KAAA,SAAiB;AACrD,OAAI,UAAU;AACb,QAAI;AACH,aAAQ,UAAU,CAAC;aACX,OAAO;AACf,YAAO,MAAM;;AAGd;;AAGD,OAAI,OAAO,QAAQ,WAAW,WAC7B,SAAQ,QAAQ;AAGjB,OAAI,YAAY,MACf,UAAS;YACC,mBAAmB,MAC7B,QAAO,QAAQ;QACT;AACN,iBAAa,UAAU,WAAW,2BAA2B,aAAa;AAC1E,WAAO,aAAa;;KAEnB,aAAa;GACf,CAGuC,cAAc;AACtD,oBAAkB,OAAO;AACzB,MAAI,gBAAgB,OACnB,QAAO,oBAAoB,SAAS,aAAa;GAEjD;AAEF,mBAAkB,cAAc;AAE/B,eAAa,aAAa,KAAK,KAAA,GAAW,MAAM;AAChD,UAAQ,KAAA;;AAGT,QAAO"}
@@ -1,10 +1,16 @@
1
- const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
1
+ const require_index = require("../node_modules/.pnpm/p-retry@7.1.1/node_modules/p-retry/index.cjs");
2
+ const require_index$1 = require("../node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/index.cjs");
2
3
  const require_fetch = require("../singletons/fetch.cjs");
3
- let p_retry = require("p-retry");
4
- p_retry = require_runtime.__toESM(p_retry);
5
- let p_queue = require("p-queue");
6
- p_queue = require_runtime.__toESM(p_queue);
7
4
  //#region src/utils/async_caller.ts
5
+ /**
6
+ * `p-retry` is a pure-ESM module that we bundle into the build output (so the
7
+ * CJS artifact doesn't `require()` an ESM module). Depending on how a
8
+ * downstream transpiler/bundler (e.g. `tsx`/esbuild) resolves the default
9
+ * export of the bundled chunk, the import can come through either as the
10
+ * function itself or as a namespace-like `{ default: fn }`. Normalize to the
11
+ * callable, mirroring the `"default" in` interop guard used for `p-queue`.
12
+ */
13
+ const pRetry = typeof require_index.default === "function" ? require_index.default : require_index.default.default;
8
14
  const STATUS_NO_RETRY = [
9
15
  400,
10
16
  401,
@@ -69,14 +75,14 @@ var AsyncCaller = class {
69
75
  constructor(params) {
70
76
  this.maxConcurrency = params.maxConcurrency ?? Infinity;
71
77
  this.maxRetries = params.maxRetries ?? 4;
72
- if ("default" in p_queue.default) this.queue = new p_queue.default.default({ concurrency: this.maxConcurrency });
73
- else this.queue = new p_queue.default({ concurrency: this.maxConcurrency });
78
+ if ("default" in require_index$1.default) this.queue = new require_index$1.default.default({ concurrency: this.maxConcurrency });
79
+ else this.queue = new require_index$1.default({ concurrency: this.maxConcurrency });
74
80
  this.onFailedResponseHook = params?.onFailedResponseHook;
75
81
  this.customFetch = params.fetch;
76
82
  }
77
83
  call(callable, ...args) {
78
84
  const { onFailedResponseHook } = this;
79
- return this.queue.add(() => (0, p_retry.default)(() => callable(...args).catch(async (error) => {
85
+ return this.queue.add(() => pRetry(() => callable(...args).catch(async (error) => {
80
86
  if (error instanceof Error) throw error;
81
87
  else if (isResponse(error)) throw await HTTPError.fromResponse(error, { includeResponse: !!onFailedResponseHook });
82
88
  else throw new Error(error);
@@ -1 +1 @@
1
- {"version":3,"file":"async_caller.cjs","names":["PQueueMod","_getFetchImplementation"],"sources":["../../src/utils/async_caller.ts"],"sourcesContent":["import pRetry from \"p-retry\";\nimport PQueueMod from \"p-queue\";\nimport { _getFetchImplementation } from \"../singletons/fetch.js\";\n\nconst STATUS_NO_RETRY = [\n 400, // Bad Request\n 401, // Unauthorized\n 402, // Payment required\n 403, // Forbidden\n 404, // Not Found\n 405, // Method Not Allowed\n 406, // Not Acceptable\n 407, // Proxy Authentication Required\n 408, // Request Timeout\n 409, // Conflict\n 422, // Unprocessable Entity\n];\n\ntype ResponseCallback = (response?: Response) => Promise<boolean>;\n\nexport interface AsyncCallerParams {\n /**\n * The maximum number of concurrent calls that can be made.\n * Defaults to `Infinity`, which means no limit.\n */\n maxConcurrency?: number;\n /**\n * The maximum number of retries that can be made for a single call,\n * with an exponential backoff between each attempt. Defaults to 6.\n */\n maxRetries?: number;\n\n onFailedResponseHook?: ResponseCallback;\n\n /**\n * Specify a custom fetch implementation.\n *\n * By default we expect the `fetch` is available in the global scope.\n */\n fetch?: typeof fetch | ((...args: any[]) => any); // eslint-disable-line @typescript-eslint/no-explicit-any\n}\n\nexport interface AsyncCallerCallOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Do not rely on globalThis.Response, rather just\n * do duck typing\n */\nfunction isResponse(x: unknown): x is Response {\n if (x == null || typeof x !== \"object\") return false;\n return \"status\" in x && \"statusText\" in x && \"text\" in x;\n}\n\n/**\n * Utility error to properly handle failed requests\n */\nclass HTTPError extends Error {\n status: number;\n\n text: string;\n\n response?: Response;\n\n constructor(status: number, message: string, response?: Response) {\n super(`HTTP ${status}: ${message}`);\n this.status = status;\n this.text = message;\n this.response = response;\n }\n\n static async fromResponse(\n response: Response,\n options?: { includeResponse?: boolean }\n ): Promise<HTTPError> {\n try {\n return new HTTPError(\n response.status,\n await response.text(),\n options?.includeResponse ? response : undefined\n );\n } catch {\n return new HTTPError(\n response.status,\n response.statusText,\n options?.includeResponse ? response : undefined\n );\n }\n }\n}\n\n/**\n * A class that can be used to make async calls with concurrency and retry logic.\n *\n * This is useful for making calls to any kind of \"expensive\" external resource,\n * be it because it's rate-limited, subject to network issues, etc.\n *\n * Concurrent calls are limited by the `maxConcurrency` parameter, which defaults\n * to `Infinity`. This means that by default, all calls will be made in parallel.\n *\n * Retries are limited by the `maxRetries` parameter, which defaults to 5. This\n * means that by default, each call will be retried up to 5 times, with an\n * exponential backoff between each attempt.\n */\nexport class AsyncCaller {\n protected maxConcurrency: AsyncCallerParams[\"maxConcurrency\"];\n\n protected maxRetries: AsyncCallerParams[\"maxRetries\"];\n\n private queue: (typeof import(\"p-queue\"))[\"default\"][\"prototype\"];\n\n private onFailedResponseHook?: ResponseCallback;\n\n private customFetch?: typeof fetch;\n\n constructor(params: AsyncCallerParams) {\n this.maxConcurrency = params.maxConcurrency ?? Infinity;\n this.maxRetries = params.maxRetries ?? 4;\n\n if (\"default\" in PQueueMod) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.queue = new (PQueueMod.default as any)({\n concurrency: this.maxConcurrency,\n });\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.queue = new (PQueueMod as any)({ concurrency: this.maxConcurrency });\n }\n this.onFailedResponseHook = params?.onFailedResponseHook;\n this.customFetch = params.fetch;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n call<A extends any[], T extends (...args: A) => Promise<any>>(\n callable: T,\n ...args: Parameters<T>\n ): Promise<Awaited<ReturnType<T>>> {\n const { onFailedResponseHook } = this;\n return this.queue.add(\n () =>\n pRetry(\n () =>\n callable(...(args as Parameters<T>)).catch(async (error) => {\n // eslint-disable-next-line no-instanceof/no-instanceof\n if (error instanceof Error) {\n throw error;\n } else if (isResponse(error)) {\n throw await HTTPError.fromResponse(error, {\n includeResponse: !!onFailedResponseHook,\n });\n } else {\n throw new Error(error);\n }\n }),\n {\n async onFailedAttempt({ error, retriesLeft }) {\n const errorMessage = error.message ?? \"\";\n if (\n errorMessage.startsWith(\"Cancel\") ||\n errorMessage.startsWith(\"TimeoutError\") ||\n errorMessage.startsWith(\"AbortError\")\n ) {\n throw error;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((error as any)?.code === \"ECONNABORTED\") {\n throw error;\n }\n\n // Check for connection refused errors (server not running)\n if (\n errorMessage.includes(\"ECONNREFUSED\") ||\n errorMessage.includes(\"fetch failed\") ||\n errorMessage.includes(\"Failed to fetch\") ||\n errorMessage.includes(\"NetworkError\")\n ) {\n if (retriesLeft > 0) return;\n const connectionError = new Error(\n `Unable to connect to LangGraph server. Please ensure the server is running and accessible. Original error: ${errorMessage}`\n );\n connectionError.name = \"ConnectionError\";\n throw connectionError;\n }\n\n // eslint-disable-next-line no-instanceof/no-instanceof\n if (error instanceof HTTPError) {\n if (STATUS_NO_RETRY.includes(error.status)) {\n throw error;\n }\n if (onFailedResponseHook && error.response) {\n await onFailedResponseHook(error.response);\n }\n }\n },\n // If needed we can change some of the defaults here,\n // but they're quite sensible.\n retries: this.maxRetries,\n randomize: true,\n }\n ),\n { throwOnTimeout: true }\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n callWithOptions<A extends any[], T extends (...args: A) => Promise<any>>(\n options: AsyncCallerCallOptions,\n callable: T,\n ...args: Parameters<T>\n ): Promise<Awaited<ReturnType<T>>> {\n // Note this doesn't cancel the underlying request,\n // when available prefer to use the signal option of the underlying call\n if (options.signal) {\n return Promise.race([\n this.call<A, T>(callable, ...args),\n new Promise<never>((_, reject) => {\n options.signal?.addEventListener(\"abort\", () => {\n reject(new Error(\"AbortError\"));\n });\n }),\n ]);\n }\n return this.call<A, T>(callable, ...args);\n }\n\n fetch(...args: Parameters<typeof fetch>): ReturnType<typeof fetch> {\n const fetchFn =\n this.customFetch ?? (_getFetchImplementation() as typeof fetch);\n return this.call(() =>\n fetchFn(...args).then((res) => (res.ok ? res : Promise.reject(res)))\n );\n }\n}\n"],"mappings":";;;;;;;AAIA,MAAM,kBAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;AAkCD,SAAS,WAAW,GAA2B;AAC7C,KAAI,KAAK,QAAQ,OAAO,MAAM,SAAU,QAAO;AAC/C,QAAO,YAAY,KAAK,gBAAgB,KAAK,UAAU;;;;;AAMzD,IAAM,YAAN,MAAM,kBAAkB,MAAM;CAC5B;CAEA;CAEA;CAEA,YAAY,QAAgB,SAAiB,UAAqB;AAChE,QAAM,QAAQ,OAAO,IAAI,UAAU;AACnC,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SAAS,kBAAkB,IACxC,aAAa,SAAS,eAAe,EACrC;AACA,SAAI,cAAc,EAAG;KACrB,MAAM,kCAAkB,IAAI,MAC1B,8GAA8G,eAC/G;AACD,qBAAgB,OAAO;AACvB,WAAM;;AAIR,QAAI,iBAAiB,WAAW;AAC9B,SAAI,gBAAgB,SAAS,MAAM,OAAO,CACxC,OAAM;AAER,SAAI,wBAAwB,MAAM,SAChC,OAAM,qBAAqB,MAAM,SAAS;;;GAMhD,SAAS,KAAK;GACd,WAAW;GACZ,CACF,EACH,EAAE,gBAAgB,MAAM,CACzB;;CAIH,gBACE,SACA,UACA,GAAG,MAC8B;AAGjC,MAAI,QAAQ,OACV,QAAO,QAAQ,KAAK,CAClB,KAAK,KAAW,UAAU,GAAG,KAAK,EAClC,IAAI,SAAgB,GAAG,WAAW;AAChC,WAAQ,QAAQ,iBAAiB,eAAe;AAC9C,2BAAO,IAAI,MAAM,aAAa,CAAC;KAC/B;IACF,CACH,CAAC;AAEJ,SAAO,KAAK,KAAW,UAAU,GAAG,KAAK;;CAG3C,MAAM,GAAG,MAA0D;EACjE,MAAM,UACJ,KAAK,eAAgBC,cAAAA,yBAAyB;AAChD,SAAO,KAAK,WACV,QAAQ,GAAG,KAAK,CAAC,MAAM,QAAS,IAAI,KAAK,MAAM,QAAQ,OAAO,IAAI,CAAE,CACrE"}
1
+ {"version":3,"file":"async_caller.cjs","names":["pRetryImport","PQueueMod","_getFetchImplementation"],"sources":["../../src/utils/async_caller.ts"],"sourcesContent":["import pRetryImport from \"p-retry\";\nimport PQueueMod from \"p-queue\";\nimport { _getFetchImplementation } from \"../singletons/fetch.js\";\n\n/**\n * `p-retry` is a pure-ESM module that we bundle into the build output (so the\n * CJS artifact doesn't `require()` an ESM module). Depending on how a\n * downstream transpiler/bundler (e.g. `tsx`/esbuild) resolves the default\n * export of the bundled chunk, the import can come through either as the\n * function itself or as a namespace-like `{ default: fn }`. Normalize to the\n * callable, mirroring the `\"default\" in` interop guard used for `p-queue`.\n */\nconst pRetry = (\n typeof pRetryImport === \"function\"\n ? pRetryImport\n : (pRetryImport as { default: typeof pRetryImport }).default\n) as typeof pRetryImport;\n\nconst STATUS_NO_RETRY = [\n 400, // Bad Request\n 401, // Unauthorized\n 402, // Payment required\n 403, // Forbidden\n 404, // Not Found\n 405, // Method Not Allowed\n 406, // Not Acceptable\n 407, // Proxy Authentication Required\n 408, // Request Timeout\n 409, // Conflict\n 422, // Unprocessable Entity\n];\n\ntype ResponseCallback = (response?: Response) => Promise<boolean>;\n\nexport interface AsyncCallerParams {\n /**\n * The maximum number of concurrent calls that can be made.\n * Defaults to `Infinity`, which means no limit.\n */\n maxConcurrency?: number;\n /**\n * The maximum number of retries that can be made for a single call,\n * with an exponential backoff between each attempt. Defaults to 6.\n */\n maxRetries?: number;\n\n onFailedResponseHook?: ResponseCallback;\n\n /**\n * Specify a custom fetch implementation.\n *\n * By default we expect the `fetch` is available in the global scope.\n */\n fetch?: typeof fetch | ((...args: any[]) => any); // eslint-disable-line @typescript-eslint/no-explicit-any\n}\n\nexport interface AsyncCallerCallOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Do not rely on globalThis.Response, rather just\n * do duck typing\n */\nfunction isResponse(x: unknown): x is Response {\n if (x == null || typeof x !== \"object\") return false;\n return \"status\" in x && \"statusText\" in x && \"text\" in x;\n}\n\n/**\n * Utility error to properly handle failed requests\n */\nclass HTTPError extends Error {\n status: number;\n\n text: string;\n\n response?: Response;\n\n constructor(status: number, message: string, response?: Response) {\n super(`HTTP ${status}: ${message}`);\n this.status = status;\n this.text = message;\n this.response = response;\n }\n\n static async fromResponse(\n response: Response,\n options?: { includeResponse?: boolean }\n ): Promise<HTTPError> {\n try {\n return new HTTPError(\n response.status,\n await response.text(),\n options?.includeResponse ? response : undefined\n );\n } catch {\n return new HTTPError(\n response.status,\n response.statusText,\n options?.includeResponse ? response : undefined\n );\n }\n }\n}\n\n/**\n * A class that can be used to make async calls with concurrency and retry logic.\n *\n * This is useful for making calls to any kind of \"expensive\" external resource,\n * be it because it's rate-limited, subject to network issues, etc.\n *\n * Concurrent calls are limited by the `maxConcurrency` parameter, which defaults\n * to `Infinity`. This means that by default, all calls will be made in parallel.\n *\n * Retries are limited by the `maxRetries` parameter, which defaults to 5. This\n * means that by default, each call will be retried up to 5 times, with an\n * exponential backoff between each attempt.\n */\nexport class AsyncCaller {\n protected maxConcurrency: AsyncCallerParams[\"maxConcurrency\"];\n\n protected maxRetries: AsyncCallerParams[\"maxRetries\"];\n\n private queue: (typeof import(\"p-queue\"))[\"default\"][\"prototype\"];\n\n private onFailedResponseHook?: ResponseCallback;\n\n private customFetch?: typeof fetch;\n\n constructor(params: AsyncCallerParams) {\n this.maxConcurrency = params.maxConcurrency ?? Infinity;\n this.maxRetries = params.maxRetries ?? 4;\n\n if (\"default\" in PQueueMod) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.queue = new (PQueueMod.default as any)({\n concurrency: this.maxConcurrency,\n });\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.queue = new (PQueueMod as any)({ concurrency: this.maxConcurrency });\n }\n this.onFailedResponseHook = params?.onFailedResponseHook;\n this.customFetch = params.fetch;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n call<A extends any[], T extends (...args: A) => Promise<any>>(\n callable: T,\n ...args: Parameters<T>\n ): Promise<Awaited<ReturnType<T>>> {\n const { onFailedResponseHook } = this;\n return this.queue.add(\n () =>\n pRetry(\n () =>\n callable(...(args as Parameters<T>)).catch(async (error) => {\n // eslint-disable-next-line no-instanceof/no-instanceof\n if (error instanceof Error) {\n throw error;\n } else if (isResponse(error)) {\n throw await HTTPError.fromResponse(error, {\n includeResponse: !!onFailedResponseHook,\n });\n } else {\n throw new Error(error);\n }\n }),\n {\n async onFailedAttempt({ error, retriesLeft }) {\n const errorMessage = error.message ?? \"\";\n if (\n errorMessage.startsWith(\"Cancel\") ||\n errorMessage.startsWith(\"TimeoutError\") ||\n errorMessage.startsWith(\"AbortError\")\n ) {\n throw error;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((error as any)?.code === \"ECONNABORTED\") {\n throw error;\n }\n\n // Check for connection refused errors (server not running)\n if (\n errorMessage.includes(\"ECONNREFUSED\") ||\n errorMessage.includes(\"fetch failed\") ||\n errorMessage.includes(\"Failed to fetch\") ||\n errorMessage.includes(\"NetworkError\")\n ) {\n if (retriesLeft > 0) return;\n const connectionError = new Error(\n `Unable to connect to LangGraph server. Please ensure the server is running and accessible. Original error: ${errorMessage}`\n );\n connectionError.name = \"ConnectionError\";\n throw connectionError;\n }\n\n // eslint-disable-next-line no-instanceof/no-instanceof\n if (error instanceof HTTPError) {\n if (STATUS_NO_RETRY.includes(error.status)) {\n throw error;\n }\n if (onFailedResponseHook && error.response) {\n await onFailedResponseHook(error.response);\n }\n }\n },\n // If needed we can change some of the defaults here,\n // but they're quite sensible.\n retries: this.maxRetries,\n randomize: true,\n }\n ),\n { throwOnTimeout: true }\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n callWithOptions<A extends any[], T extends (...args: A) => Promise<any>>(\n options: AsyncCallerCallOptions,\n callable: T,\n ...args: Parameters<T>\n ): Promise<Awaited<ReturnType<T>>> {\n // Note this doesn't cancel the underlying request,\n // when available prefer to use the signal option of the underlying call\n if (options.signal) {\n return Promise.race([\n this.call<A, T>(callable, ...args),\n new Promise<never>((_, reject) => {\n options.signal?.addEventListener(\"abort\", () => {\n reject(new Error(\"AbortError\"));\n });\n }),\n ]);\n }\n return this.call<A, T>(callable, ...args);\n }\n\n fetch(...args: Parameters<typeof fetch>): ReturnType<typeof fetch> {\n const fetchFn =\n this.customFetch ?? (_getFetchImplementation() as typeof fetch);\n return this.call(() =>\n fetchFn(...args).then((res) => (res.ok ? res : Promise.reject(res)))\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAYA,MAAM,SACJ,OAAOA,cAAAA,YAAiB,aACpBA,cAAAA,UACCA,cAAAA,QAAkD;A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AAA,EAAM,UAAA,CAAW,CAAA,IACnB,OAAA,CAAQ,OAAA,CAAQ,UAAA,CAAW,CAAA;EAgB9B,KAAA,CAAA,GAAS,IAAA,EAAM,UAAA,QAAkB,KAAA,IAAS,UAAA,QAAkB,KAAA;AAAA"}
@@ -1,7 +1,16 @@
1
+ import pRetry$1 from "../node_modules/.pnpm/p-retry@7.1.1/node_modules/p-retry/index.js";
2
+ import PQueue from "../node_modules/.pnpm/p-queue@9.1.0/node_modules/p-queue/dist/index.js";
1
3
  import { _getFetchImplementation } from "../singletons/fetch.js";
2
- import pRetry from "p-retry";
3
- import PQueueMod from "p-queue";
4
4
  //#region src/utils/async_caller.ts
5
+ /**
6
+ * `p-retry` is a pure-ESM module that we bundle into the build output (so the
7
+ * CJS artifact doesn't `require()` an ESM module). Depending on how a
8
+ * downstream transpiler/bundler (e.g. `tsx`/esbuild) resolves the default
9
+ * export of the bundled chunk, the import can come through either as the
10
+ * function itself or as a namespace-like `{ default: fn }`. Normalize to the
11
+ * callable, mirroring the `"default" in` interop guard used for `p-queue`.
12
+ */
13
+ const pRetry = typeof pRetry$1 === "function" ? pRetry$1 : pRetry$1.default;
5
14
  const STATUS_NO_RETRY = [
6
15
  400,
7
16
  401,
@@ -66,8 +75,8 @@ var AsyncCaller = class {
66
75
  constructor(params) {
67
76
  this.maxConcurrency = params.maxConcurrency ?? Infinity;
68
77
  this.maxRetries = params.maxRetries ?? 4;
69
- if ("default" in PQueueMod) this.queue = new PQueueMod.default({ concurrency: this.maxConcurrency });
70
- else this.queue = new PQueueMod({ concurrency: this.maxConcurrency });
78
+ if ("default" in PQueue) this.queue = new PQueue.default({ concurrency: this.maxConcurrency });
79
+ else this.queue = new PQueue({ concurrency: this.maxConcurrency });
71
80
  this.onFailedResponseHook = params?.onFailedResponseHook;
72
81
  this.customFetch = params.fetch;
73
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"async_caller.js","names":[],"sources":["../../src/utils/async_caller.ts"],"sourcesContent":["import pRetry from \"p-retry\";\nimport PQueueMod from \"p-queue\";\nimport { _getFetchImplementation } from \"../singletons/fetch.js\";\n\nconst STATUS_NO_RETRY = [\n 400, // Bad Request\n 401, // Unauthorized\n 402, // Payment required\n 403, // Forbidden\n 404, // Not Found\n 405, // Method Not Allowed\n 406, // Not Acceptable\n 407, // Proxy Authentication Required\n 408, // Request Timeout\n 409, // Conflict\n 422, // Unprocessable Entity\n];\n\ntype ResponseCallback = (response?: Response) => Promise<boolean>;\n\nexport interface AsyncCallerParams {\n /**\n * The maximum number of concurrent calls that can be made.\n * Defaults to `Infinity`, which means no limit.\n */\n maxConcurrency?: number;\n /**\n * The maximum number of retries that can be made for a single call,\n * with an exponential backoff between each attempt. Defaults to 6.\n */\n maxRetries?: number;\n\n onFailedResponseHook?: ResponseCallback;\n\n /**\n * Specify a custom fetch implementation.\n *\n * By default we expect the `fetch` is available in the global scope.\n */\n fetch?: typeof fetch | ((...args: any[]) => any); // eslint-disable-line @typescript-eslint/no-explicit-any\n}\n\nexport interface AsyncCallerCallOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Do not rely on globalThis.Response, rather just\n * do duck typing\n */\nfunction isResponse(x: unknown): x is Response {\n if (x == null || typeof x !== \"object\") return false;\n return \"status\" in x && \"statusText\" in x && \"text\" in x;\n}\n\n/**\n * Utility error to properly handle failed requests\n */\nclass HTTPError extends Error {\n status: number;\n\n text: string;\n\n response?: Response;\n\n constructor(status: number, message: string, response?: Response) {\n super(`HTTP ${status}: ${message}`);\n this.status = status;\n this.text = message;\n this.response = response;\n }\n\n static async fromResponse(\n response: Response,\n options?: { includeResponse?: boolean }\n ): Promise<HTTPError> {\n try {\n return new HTTPError(\n response.status,\n await response.text(),\n options?.includeResponse ? response : undefined\n );\n } catch {\n return new HTTPError(\n response.status,\n response.statusText,\n options?.includeResponse ? response : undefined\n );\n }\n }\n}\n\n/**\n * A class that can be used to make async calls with concurrency and retry logic.\n *\n * This is useful for making calls to any kind of \"expensive\" external resource,\n * be it because it's rate-limited, subject to network issues, etc.\n *\n * Concurrent calls are limited by the `maxConcurrency` parameter, which defaults\n * to `Infinity`. This means that by default, all calls will be made in parallel.\n *\n * Retries are limited by the `maxRetries` parameter, which defaults to 5. This\n * means that by default, each call will be retried up to 5 times, with an\n * exponential backoff between each attempt.\n */\nexport class AsyncCaller {\n protected maxConcurrency: AsyncCallerParams[\"maxConcurrency\"];\n\n protected maxRetries: AsyncCallerParams[\"maxRetries\"];\n\n private queue: (typeof import(\"p-queue\"))[\"default\"][\"prototype\"];\n\n private onFailedResponseHook?: ResponseCallback;\n\n private customFetch?: typeof fetch;\n\n constructor(params: AsyncCallerParams) {\n this.maxConcurrency = params.maxConcurrency ?? Infinity;\n this.maxRetries = params.maxRetries ?? 4;\n\n if (\"default\" in PQueueMod) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.queue = new (PQueueMod.default as any)({\n concurrency: this.maxConcurrency,\n });\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.queue = new (PQueueMod as any)({ concurrency: this.maxConcurrency });\n }\n this.onFailedResponseHook = params?.onFailedResponseHook;\n this.customFetch = params.fetch;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n call<A extends any[], T extends (...args: A) => Promise<any>>(\n callable: T,\n ...args: Parameters<T>\n ): Promise<Awaited<ReturnType<T>>> {\n const { onFailedResponseHook } = this;\n return this.queue.add(\n () =>\n pRetry(\n () =>\n callable(...(args as Parameters<T>)).catch(async (error) => {\n // eslint-disable-next-line no-instanceof/no-instanceof\n if (error instanceof Error) {\n throw error;\n } else if (isResponse(error)) {\n throw await HTTPError.fromResponse(error, {\n includeResponse: !!onFailedResponseHook,\n });\n } else {\n throw new Error(error);\n }\n }),\n {\n async onFailedAttempt({ error, retriesLeft }) {\n const errorMessage = error.message ?? \"\";\n if (\n errorMessage.startsWith(\"Cancel\") ||\n errorMessage.startsWith(\"TimeoutError\") ||\n errorMessage.startsWith(\"AbortError\")\n ) {\n throw error;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((error as any)?.code === \"ECONNABORTED\") {\n throw error;\n }\n\n // Check for connection refused errors (server not running)\n if (\n errorMessage.includes(\"ECONNREFUSED\") ||\n errorMessage.includes(\"fetch failed\") ||\n errorMessage.includes(\"Failed to fetch\") ||\n errorMessage.includes(\"NetworkError\")\n ) {\n if (retriesLeft > 0) return;\n const connectionError = new Error(\n `Unable to connect to LangGraph server. Please ensure the server is running and accessible. Original error: ${errorMessage}`\n );\n connectionError.name = \"ConnectionError\";\n throw connectionError;\n }\n\n // eslint-disable-next-line no-instanceof/no-instanceof\n if (error instanceof HTTPError) {\n if (STATUS_NO_RETRY.includes(error.status)) {\n throw error;\n }\n if (onFailedResponseHook && error.response) {\n await onFailedResponseHook(error.response);\n }\n }\n },\n // If needed we can change some of the defaults here,\n // but they're quite sensible.\n retries: this.maxRetries,\n randomize: true,\n }\n ),\n { throwOnTimeout: true }\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n callWithOptions<A extends any[], T extends (...args: A) => Promise<any>>(\n options: AsyncCallerCallOptions,\n callable: T,\n ...args: Parameters<T>\n ): Promise<Awaited<ReturnType<T>>> {\n // Note this doesn't cancel the underlying request,\n // when available prefer to use the signal option of the underlying call\n if (options.signal) {\n return Promise.race([\n this.call<A, T>(callable, ...args),\n new Promise<never>((_, reject) => {\n options.signal?.addEventListener(\"abort\", () => {\n reject(new Error(\"AbortError\"));\n });\n }),\n ]);\n }\n return this.call<A, T>(callable, ...args);\n }\n\n fetch(...args: Parameters<typeof fetch>): ReturnType<typeof fetch> {\n const fetchFn =\n this.customFetch ?? (_getFetchImplementation() as typeof fetch);\n return this.call(() =>\n fetchFn(...args).then((res) => (res.ok ? res : Promise.reject(res)))\n );\n }\n}\n"],"mappings":";;;;AAIA,MAAM,kBAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;AAkCD,SAAS,WAAW,GAA2B;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M,WAAW;AACtC,QACE,aAAa,WAAW,SAAS,IACjC,aAAa,WAAW,eAAe,IACvC,aAAa,WAAW,aAAa,CAErC,OAAM;AAGR,QAAK,OAAe,SAAS,eAC3B,OAAM;AAIR,QACE,aAAa,SAAS,eAAe,IACrC,aAAa,SAAS,eAAe,IACrC,aAAa,SAAS,kBAAkB,IACxC,aAAa,SAAS,eAAe,EACrC;AACA,SAAI,cAAc,EAAG;KACrB,MAAM,kCAAkB,IAAI,MAC1B,8GAA8G,eAC/G;AACD,qBAAgB,OAAO;AACvB,WAAM;;AAIR,QAAI,iBAAiB,WAAW;AAC9B,SAAI,gBAAgB,SAAS,MAAM,OAAO,CACxC,OAAM;AAER,SAAI,wBAAwB,MAAM,SAChC,OAAM,qBAAqB,MAAM,SAAS;;;GAMhD,SAAS,KAAK;GACd,WAAW;GACZ,CACF,EACH,EAAE,gBAAgB,MAAM,CACzB;;CAIH,gBACE,SACA,UACA,GAAG,MAC8B;AAGjC,MAAI,QAAQ,OACV,QAAO,QAAQ,KAAK,CAClB,KAAK,KAAW,UAAU,GAAG,KAAK,EAClC,IAAI,SAAgB,GAAG,WAAW;AAChC,WAAQ,QAAQ,iBAAiB,eAAe;AAC9C,2BAAO,IAAI,MAAM,aAAa,CAAC;KAC/B;IACF,CACH,CAAC;AAEJ,SAAO,KAAK,KAAW,UAAU,GAAG,KAAK;;CAG3C,MAAM,GAAG,MAA0D;EACjE,MAAM,UACJ,KAAK,eAAgB,yBAAyB;AAChD,SAAO,KAAK,WACV,QAAQ,GAAG,KAAK,CAAC,MAAM,QAAS,IAAI,KAAK,MAAM,QAAQ,OAAO,IAAI,CAAE,CACrE"}
1
+ {"version":3,"file":"async_caller.js","names":["pRetryImport","PQueueMod"],"sources":["../../src/utils/async_caller.ts"],"sourcesContent":["import pRetryImport from \"p-retry\";\nimport PQueueMod from \"p-queue\";\nimport { _getFetchImplementation } from \"../singletons/fetch.js\";\n\n/**\n * `p-retry` is a pure-ESM module that we bundle into the build output (so the\n * CJS artifact doesn't `require()` an ESM module). Depending on how a\n * downstream transpiler/bundler (e.g. `tsx`/esbuild) resolves the default\n * export of the bundled chunk, the import can come through either as the\n * function itself or as a namespace-like `{ default: fn }`. Normalize to the\n * callable, mirroring the `\"default\" in` interop guard used for `p-queue`.\n */\nconst pRetry = (\n typeof pRetryImport === \"function\"\n ? pRetryImport\n : (pRetryImport as { default: typeof pRetryImport }).default\n) as typeof pRetryImport;\n\nconst STATUS_NO_RETRY = [\n 400, // Bad Request\n 401, // Unauthorized\n 402, // Payment required\n 403, // Forbidden\n 404, // Not Found\n 405, // Method Not Allowed\n 406, // Not Acceptable\n 407, // Proxy Authentication Required\n 408, // Request Timeout\n 409, // Conflict\n 422, // Unprocessable Entity\n];\n\ntype ResponseCallback = (response?: Response) => Promise<boolean>;\n\nexport interface AsyncCallerParams {\n /**\n * The maximum number of concurrent calls that can be made.\n * Defaults to `Infinity`, which means no limit.\n */\n maxConcurrency?: number;\n /**\n * The maximum number of retries that can be made for a single call,\n * with an exponential backoff between each attempt. Defaults to 6.\n */\n maxRetries?: number;\n\n onFailedResponseHook?: ResponseCallback;\n\n /**\n * Specify a custom fetch implementation.\n *\n * By default we expect the `fetch` is available in the global scope.\n */\n fetch?: typeof fetch | ((...args: any[]) => any); // eslint-disable-line @typescript-eslint/no-explicit-any\n}\n\nexport interface AsyncCallerCallOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Do not rely on globalThis.Response, rather just\n * do duck typing\n */\nfunction isResponse(x: unknown): x is Response {\n if (x == null || typeof x !== \"object\") return false;\n return \"status\" in x && \"statusText\" in x && \"text\" in x;\n}\n\n/**\n * Utility error to properly handle failed requests\n */\nclass HTTPError extends Error {\n status: number;\n\n text: string;\n\n response?: Response;\n\n constructor(status: number, message: string, response?: Response) {\n super(`HTTP ${status}: ${message}`);\n this.status = status;\n this.text = message;\n this.response = response;\n }\n\n static async fromResponse(\n response: Response,\n options?: { includeResponse?: boolean }\n ): Promise<HTTPError> {\n try {\n return new HTTPError(\n response.status,\n await response.text(),\n options?.includeResponse ? response : undefined\n );\n } catch {\n return new HTTPError(\n response.status,\n response.statusText,\n options?.includeResponse ? response : undefined\n );\n }\n }\n}\n\n/**\n * A class that can be used to make async calls with concurrency and retry logic.\n *\n * This is useful for making calls to any kind of \"expensive\" external resource,\n * be it because it's rate-limited, subject to network issues, etc.\n *\n * Concurrent calls are limited by the `maxConcurrency` parameter, which defaults\n * to `Infinity`. This means that by default, all calls will be made in parallel.\n *\n * Retries are limited by the `maxRetries` parameter, which defaults to 5. This\n * means that by default, each call will be retried up to 5 times, with an\n * exponential backoff between each attempt.\n */\nexport class AsyncCaller {\n protected maxConcurrency: AsyncCallerParams[\"maxConcurrency\"];\n\n protected maxRetries: AsyncCallerParams[\"maxRetries\"];\n\n private queue: (typeof import(\"p-queue\"))[\"default\"][\"prototype\"];\n\n private onFailedResponseHook?: ResponseCallback;\n\n private customFetch?: typeof fetch;\n\n constructor(params: AsyncCallerParams) {\n this.maxConcurrency = params.maxConcurrency ?? Infinity;\n this.maxRetries = params.maxRetries ?? 4;\n\n if (\"default\" in PQueueMod) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.queue = new (PQueueMod.default as any)({\n concurrency: this.maxConcurrency,\n });\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.queue = new (PQueueMod as any)({ concurrency: this.maxConcurrency });\n }\n this.onFailedResponseHook = params?.onFailedResponseHook;\n this.customFetch = params.fetch;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n call<A extends any[], T extends (...args: A) => Promise<any>>(\n callable: T,\n ...args: Parameters<T>\n ): Promise<Awaited<ReturnType<T>>> {\n const { onFailedResponseHook } = this;\n return this.queue.add(\n () =>\n pRetry(\n () =>\n callable(...(args as Parameters<T>)).catch(async (error) => {\n // eslint-disable-next-line no-instanceof/no-instanceof\n if (error instanceof Error) {\n throw error;\n } else if (isResponse(error)) {\n throw await HTTPError.fromResponse(error, {\n includeResponse: !!onFailedResponseHook,\n });\n } else {\n throw new Error(error);\n }\n }),\n {\n async onFailedAttempt({ error, retriesLeft }) {\n const errorMessage = error.message ?? \"\";\n if (\n errorMessage.startsWith(\"Cancel\") ||\n errorMessage.startsWith(\"TimeoutError\") ||\n errorMessage.startsWith(\"AbortError\")\n ) {\n throw error;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((error as any)?.code === \"ECONNABORTED\") {\n throw error;\n }\n\n // Check for connection refused errors (server not running)\n if (\n errorMessage.includes(\"ECONNREFUSED\") ||\n errorMessage.includes(\"fetch failed\") ||\n errorMessage.includes(\"Failed to fetch\") ||\n errorMessage.includes(\"NetworkError\")\n ) {\n if (retriesLeft > 0) return;\n const connectionError = new Error(\n `Unable to connect to LangGraph server. Please ensure the server is running and accessible. Original error: ${errorMessage}`\n );\n connectionError.name = \"ConnectionError\";\n throw connectionError;\n }\n\n // eslint-disable-next-line no-instanceof/no-instanceof\n if (error instanceof HTTPError) {\n if (STATUS_NO_RETRY.includes(error.status)) {\n throw error;\n }\n if (onFailedResponseHook && error.response) {\n await onFailedResponseHook(error.response);\n }\n }\n },\n // If needed we can change some of the defaults here,\n // but they're quite sensible.\n retries: this.maxRetries,\n randomize: true,\n }\n ),\n { throwOnTimeout: true }\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n callWithOptions<A extends any[], T extends (...args: A) => Promise<any>>(\n options: AsyncCallerCallOptions,\n callable: T,\n ...args: Parameters<T>\n ): Promise<Awaited<ReturnType<T>>> {\n // Note this doesn't cancel the underlying request,\n // when available prefer to use the signal option of the underlying call\n if (options.signal) {\n return Promise.race([\n this.call<A, T>(callable, ...args),\n new Promise<never>((_, reject) => {\n options.signal?.addEventListener(\"abort\", () => {\n reject(new Error(\"AbortError\"));\n });\n }),\n ]);\n }\n return this.call<A, T>(callable, ...args);\n }\n\n fetch(...args: Parameters<typeof fetch>): ReturnType<typeof fetch> {\n const fetchFn =\n this.customFetch ?? (_getFetchImplementation() as typeof fetch);\n return this.call(() =>\n fetchFn(...args).then((res) => (res.ok ? res : Promise.reject(res)))\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAYA,MAAM,SACJ,OAAOA,aAAiB,aACpBA,WACCA,SAAkD;AAGzD,MAAM,kBAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;AAkCD,SAAS,WAAW,GAA2B;AAC7C,KAAI,KAAK,QAAQ,OAAO,MAAM,SAAU,QAAO;AAC/C,QAAO,YAAY,KAAK,gBAAgB,KAAK,UAAU;;;;;AAMzD,IAAM,YAAN,MAAM,kBAAkB,MAAM;CAC5B;CAEA;CAEA;CAEA,YAAY,QAAgB,SAAiB,UAAqB;AAChE,QAAM,QAAQ,OAAO,IAAI,UAAU;AACnC,OAAK,SAAS;AACd,OAAK,OAAO;AACZ,OAAK,WAAW;;CAGlB,aAAa,aACX,UACA,SACoB;AACpB,MAAI;AACF,UAAO,IAAI,UACT,SAAS,QACT,MAAM,SAAS,MAAM,EACrB,SAAS,kBAAkB,WAAW,KAAA,EACvC;UACK;AACN,UAAO,IAAI,UACT,SAAS,QACT,SAAS,YACT,SAAS,kBAAkB,WAAW,KAAA,EACvC;;;;;;;;;;;;;;;;;AAkBP,IAAa,cAAb,MAAyB;CACvB;CAEA;CAEA;CAEA;CAEA;CAEA,YAAY,QAA2B;AACrC,OAAK,iBAAiB,OAAO,kBAAkB;AAC/C,OAAK,aAAa,OAAO,cAAc;AAEvC,MAAI,aAAaC,OAEf,MAAK,QAAQ,IAAKA,OAAU,QAAgB,EAC1C,aAAa,KAAK,gBACnB,CAAC;MAGF,MAAK,QAAQ,IAAKA,OAAkB,EAAE,aAAa,KAAK,gBAAgB,CAAC;AAE3E,OAAK,uBAAuB,QAAQ;AACpC,OAAK,cAAc,OAAO;;CAI5B,KACE,UACA,GAAG,MAC8B;EACjC,MAAM,EAAE,yBAAyB;AACjC,SAAO,KAAK,MAAM,UAEd,aAEI,SAA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MAAM,QAAS,IAAI,KAAK,MAAM,QAAQ,OAAO,IAAI,CAAE,CACrE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph-sdk",
3
- "version": "1.9.24",
3
+ "version": "1.9.25",
4
4
  "description": "Client library for interacting with the LangGraph API",
5
5
  "type": "module",
6
6
  "repository": {
@@ -32,7 +32,8 @@
32
32
  "vitest": "^4.1.0",
33
33
  "vue": "^3.5.35",
34
34
  "ws": "^8.21.0",
35
- "zod": "^4.3.5"
35
+ "zod": "^4.3.5",
36
+ "@langchain/build": "1.0.0"
36
37
  },
37
38
  "peerDependencies": {
38
39
  "@langchain/core": "^1.1.48",