@langchain/langgraph 1.2.7 → 1.2.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"retry.js","names":[],"sources":["../../src/pregel/retry.ts"],"sourcesContent":["import { Command, CONFIG_KEY_RESUMING } from \"../constants.js\";\nimport { isGraphBubbleUp, isParentCommand } from \"../errors.js\";\nimport { PregelExecutableTask } from \"./types.js\";\nimport { getParentCheckpointNamespace } from \"./utils/config.js\";\nimport { patchConfigurable, type RetryPolicy } from \"./utils/index.js\";\n\nexport const DEFAULT_INITIAL_INTERVAL = 500;\nexport const DEFAULT_BACKOFF_FACTOR = 2;\nexport const DEFAULT_MAX_INTERVAL = 128000;\nexport const DEFAULT_MAX_RETRIES = 3;\n\nconst DEFAULT_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 409, // Conflict\n];\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst DEFAULT_RETRY_ON_HANDLER = (error: any) => {\n if (\n error.message.startsWith(\"Cancel\") ||\n error.message.startsWith(\"AbortError\") ||\n error.name === \"AbortError\"\n ) {\n return false;\n }\n\n // Thrown when interrupt is called without a checkpointer\n if (error.name === \"GraphValueError\") {\n return false;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((error as any)?.code === \"ECONNABORTED\") {\n return false;\n }\n\n const status =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (error as any)?.response?.status ?? (error as any)?.status;\n if (status && DEFAULT_STATUS_NO_RETRY.includes(+status)) {\n return false;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((error as any)?.error?.code === \"insufficient_quota\") {\n return false;\n }\n return true;\n};\n\nexport type SettledPregelTask = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n task: PregelExecutableTask<any, any>;\n error: Error;\n signalAborted?: boolean;\n};\n\nexport async function _runWithRetry<\n N extends PropertyKey,\n C extends PropertyKey,\n>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pregelTask: PregelExecutableTask<N, C>,\n retryPolicy?: RetryPolicy,\n configurable?: Record<string, unknown>,\n signal?: AbortSignal\n): Promise<{\n task: PregelExecutableTask<N, C>;\n result: unknown;\n error: Error | undefined;\n signalAborted?: boolean;\n}> {\n const resolvedRetryPolicy = pregelTask.retry_policy ?? retryPolicy;\n let interval =\n resolvedRetryPolicy !== undefined\n ? (resolvedRetryPolicy.initialInterval ?? DEFAULT_INITIAL_INTERVAL)\n : 0;\n let attempts = 0;\n let error;\n let result;\n\n let { config } = pregelTask;\n if (configurable) config = patchConfigurable(config, configurable);\n config = { ...config, signal };\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (signal?.aborted) {\n // no need to throw here - we'll throw from the runner, instead.\n // there's just no point in retrying if the user has requested an abort.\n break;\n }\n // Clear any writes from previous attempts\n pregelTask.writes.splice(0, pregelTask.writes.length);\n error = undefined;\n try {\n result = await pregelTask.proc.invoke(pregelTask.input, config);\n break;\n } catch (e: unknown) {\n error = e;\n (error as { pregelTaskId: string }).pregelTaskId = pregelTask.id;\n if (isParentCommand(error)) {\n const ns: string = config?.configurable?.checkpoint_ns;\n const cmd = error.command;\n if (cmd.graph === ns) {\n // this command is for the current graph, handle it\n for (const writer of pregelTask.writers) {\n await writer.invoke(cmd, config);\n }\n error = undefined;\n break;\n } else if (cmd.graph === Command.PARENT) {\n // this command is for the parent graph, assign it to the parent\n const parentNs = getParentCheckpointNamespace(ns);\n error.command = new Command({\n ...error.command,\n graph: parentNs,\n });\n }\n }\n if (isGraphBubbleUp(error)) {\n break;\n }\n if (resolvedRetryPolicy === undefined) {\n break;\n }\n attempts += 1;\n // check if we should give up\n if (\n attempts >= (resolvedRetryPolicy.maxAttempts ?? DEFAULT_MAX_RETRIES)\n ) {\n break;\n }\n const retryOn = resolvedRetryPolicy.retryOn ?? DEFAULT_RETRY_ON_HANDLER;\n if (!retryOn(error)) {\n break;\n }\n interval = Math.min(\n resolvedRetryPolicy.maxInterval ?? DEFAULT_MAX_INTERVAL,\n interval * (resolvedRetryPolicy.backoffFactor ?? DEFAULT_BACKOFF_FACTOR)\n );\n const intervalWithJitter = resolvedRetryPolicy.jitter\n ? Math.floor(interval + Math.random() * 1000)\n : interval;\n // sleep before retrying\n // eslint-disable-next-line no-promise-executor-return\n await new Promise((resolve) => setTimeout(resolve, intervalWithJitter));\n // log the retry\n const errorName =\n (error as Error).name ??\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ((error as Error).constructor as any).unminifiable_name ??\n (error as Error).constructor.name;\n if (resolvedRetryPolicy?.logWarning ?? true) {\n console.log(\n `Retrying task \"${String(pregelTask.name)}\" after ${interval.toFixed(\n 2\n )}ms (attempt ${attempts}) after ${errorName}: ${error}`\n );\n }\n\n // signal subgraphs to resume (if available)\n config = patchConfigurable(config, { [CONFIG_KEY_RESUMING]: true });\n }\n }\n return {\n task: pregelTask,\n result,\n error: error as Error | undefined,\n signalAborted: signal?.aborted,\n };\n}\n"],"mappings":";;;;AAWA,MAAM,0BAA0B;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAGD,MAAM,4BAA4B,UAAe;AAC/C,KACE,MAAM,QAAQ,WAAW,SAAS,IAClC,MAAM,QAAQ,WAAW,aAAa,IACtC,MAAM,SAAS,aAEf,QAAO;AAIT,KAAI,MAAM,SAAS,kBACjB,QAAO;AAIT,KAAK,OAAe,SAAS,eAC3B,QAAO;CAGT,MAAM,SAEH,OAAe,UAAU,UAAW,OAAe;AACtD,KAAI,UAAU,wBAAwB,SAAS,CAAC,OAAO,CACrD,QAAO;AAGT,KAAK,OAAe,OAAO,SAAS,qBAClC,QAAO;AAET,QAAO;;AAUT,eAAsB,cAKpB,YACA,aACA,cACA,QAMC;CACD,MAAM,sB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YAAoB,qBACrC,MAAgB,YAAY;AAC/B,OAAI,qBAAqB,cAAc,KACrC,SAAQ,IACN,kBAAkB,OAAO,WAAW,KAAK,CAAC,UAAU,SAAS,QAC3D,EACD,CAAC,cAAc,SAAS,UAAU,UAAU,IAAI,QAClD;AAIH,YAAS,kBAAkB,QAAQ,GAAG,sBAAsB,MAAM,CAAC;;;AAGvE,QAAO;EACL,MAAM;EACN;EACO;EACP,eAAe,QAAQ;EACxB"}
1
+ {"version":3,"file":"retry.js","names":[],"sources":["../../src/pregel/retry.ts"],"sourcesContent":["import { Command, CONFIG_KEY_RESUMING } from \"../constants.js\";\nimport { isGraphBubbleUp, isParentCommand } from \"../errors.js\";\nimport type { LangGraphRunnableConfig } from \"./runnable_types.js\";\nimport { PregelExecutableTask } from \"./types.js\";\nimport { getParentCheckpointNamespace } from \"./utils/config.js\";\nimport { patchConfigurable, type RetryPolicy } from \"./utils/index.js\";\n\nexport const DEFAULT_INITIAL_INTERVAL = 500;\nexport const DEFAULT_BACKOFF_FACTOR = 2;\nexport const DEFAULT_MAX_INTERVAL = 128000;\nexport const DEFAULT_MAX_RETRIES = 3;\n\nconst DEFAULT_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 409, // Conflict\n];\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst DEFAULT_RETRY_ON_HANDLER = (error: any) => {\n if (\n error.message.startsWith(\"Cancel\") ||\n error.message.startsWith(\"AbortError\") ||\n error.name === \"AbortError\"\n ) {\n return false;\n }\n\n // Thrown when interrupt is called without a checkpointer\n if (error.name === \"GraphValueError\") {\n return false;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((error as any)?.code === \"ECONNABORTED\") {\n return false;\n }\n\n const status =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (error as any)?.response?.status ?? (error as any)?.status;\n if (status && DEFAULT_STATUS_NO_RETRY.includes(+status)) {\n return false;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((error as any)?.error?.code === \"insufficient_quota\") {\n return false;\n }\n return true;\n};\n\nexport type SettledPregelTask = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n task: PregelExecutableTask<any, any>;\n error: Error;\n signalAborted?: boolean;\n};\n\nexport async function _runWithRetry<\n N extends PropertyKey,\n C extends PropertyKey,\n>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pregelTask: PregelExecutableTask<N, C>,\n retryPolicy?: RetryPolicy,\n configurable?: Record<string, unknown>,\n signal?: AbortSignal\n): Promise<{\n task: PregelExecutableTask<N, C>;\n result: unknown;\n error: Error | undefined;\n signalAborted?: boolean;\n}> {\n const resolvedRetryPolicy = pregelTask.retry_policy ?? retryPolicy;\n let interval =\n resolvedRetryPolicy !== undefined\n ? (resolvedRetryPolicy.initialInterval ?? DEFAULT_INITIAL_INTERVAL)\n : 0;\n let attempts = 0;\n let error;\n let result;\n\n let config: LangGraphRunnableConfig = pregelTask.config ?? {};\n if (configurable) {\n config = patchConfigurable(config, configurable);\n }\n config = { ...config, signal };\n\n const firstAttemptTime = Date.now();\n if (config.executionInfo != null) {\n config.executionInfo = {\n ...config.executionInfo,\n nodeFirstAttemptTime: firstAttemptTime,\n };\n }\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (signal?.aborted) {\n // no need to throw here - we'll throw from the runner, instead.\n // there's just no point in retrying if the user has requested an abort.\n break;\n }\n // Clear any writes from previous attempts\n pregelTask.writes.splice(0, pregelTask.writes.length);\n error = undefined;\n try {\n result = await pregelTask.proc.invoke(pregelTask.input, config);\n break;\n } catch (e: unknown) {\n error = e;\n (error as { pregelTaskId: string }).pregelTaskId = pregelTask.id;\n if (isParentCommand(error)) {\n const ns: string = config?.configurable?.checkpoint_ns;\n const cmd = error.command;\n if (cmd.graph === ns) {\n // this command is for the current graph, handle it\n for (const writer of pregelTask.writers) {\n await writer.invoke(cmd, config);\n }\n error = undefined;\n break;\n } else if (cmd.graph === Command.PARENT) {\n // this command is for the parent graph, assign it to the parent\n const parentNs = getParentCheckpointNamespace(ns);\n error.command = new Command({\n ...error.command,\n graph: parentNs,\n });\n }\n }\n if (isGraphBubbleUp(error)) {\n break;\n }\n if (resolvedRetryPolicy === undefined) {\n break;\n }\n attempts += 1;\n // check if we should give up\n if (\n attempts >= (resolvedRetryPolicy.maxAttempts ?? DEFAULT_MAX_RETRIES)\n ) {\n break;\n }\n const retryOn = resolvedRetryPolicy.retryOn ?? DEFAULT_RETRY_ON_HANDLER;\n if (!retryOn(error)) {\n break;\n }\n interval = Math.min(\n resolvedRetryPolicy.maxInterval ?? DEFAULT_MAX_INTERVAL,\n interval * (resolvedRetryPolicy.backoffFactor ?? DEFAULT_BACKOFF_FACTOR)\n );\n const intervalWithJitter = resolvedRetryPolicy.jitter\n ? Math.floor(interval + Math.random() * 1000)\n : interval;\n // sleep before retrying\n // eslint-disable-next-line no-promise-executor-return\n await new Promise((resolve) => setTimeout(resolve, intervalWithJitter));\n // log the retry\n const errorName =\n (error as Error).name ??\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ((error as Error).constructor as any).unminifiable_name ??\n (error as Error).constructor.name;\n if (resolvedRetryPolicy?.logWarning ?? true) {\n console.log(\n `Retrying task \"${String(pregelTask.name)}\" after ${interval.toFixed(\n 2\n )}ms (attempt ${attempts}) after ${errorName}: ${error}`\n );\n }\n\n // signal subgraphs to resume (if available)\n config = patchConfigurable(config, { [CONFIG_KEY_RESUMING]: true });\n\n if (config.executionInfo != null) {\n config.executionInfo = {\n ...config.executionInfo,\n nodeAttempt: attempts + 1,\n nodeFirstAttemptTime: firstAttemptTime,\n };\n }\n }\n }\n return {\n task: pregelTask,\n result,\n error: error as Error | undefined,\n signalAborted: signal?.aborted,\n };\n}\n"],"mappings":";;;;AAYA,MAAM,0BAA0B;CAC9B;CACA;CACA;CAC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AAA;AACR;eACS,IAAI,UAAU,QAAQ,QAAQ;KAEvC,MAAM,WAAW,6BAA6B,GAAG;AACjD,WAAM,UAAU,IAAI,QAAQ;MAC1B,GAAG,MAAM;MACT,OAAO;MACR,CAAC;;;AAGN,OAAI,gBAAgB,MAAM,CACxB;AAEF,OAAI,wBAAwB,KAAA,EAC1B;AAEF,eAAY;AAEZ,OACE,aAAa,oBAAoB,eAAA,GAEjC;AAGF,OAAI,EADY,oBAAoB,WAAW,0BAClC,MAAM,CACjB;AAEF,cAAW,KAAK,IACd,oBAAoB,eAAA,OACpB,YAAY,oBAAoB,iBAAA,GACjC;GACD,MAAM,qBAAqB,oBAAoB,SAC3C,KAAK,MAAM,WAAW,KAAK,QAAQ,GAAG,IAAK,GAC3C;AAGJ,SAAM,IAAI,SAAS,YAAY,WAAW,SAAS,mBAAmB,CAAC;GAEvE,MAAM,YACH,MAAgB,QAEf,MAAgB,YAAoB,qBACrC,MAAgB,YAAY;AAC/B,OAAI,qBAAqB,cAAc,KACrC,SAAQ,IACN,kBAAkB,OAAO,WAAW,KAAK,CAAC,UAAU,SAAS,QAC3D,EACD,CAAC,cAAc,SAAS,UAAU,UAAU,IAAI,QAClD;AAIH,YAAS,kBAAkB,QAAQ,GAAG,sBAAsB,MAAM,CAAC;AAEnE,OAAI,OAAO,iBAAiB,KAC1B,QAAO,gBAAgB;IACrB,GAAG,OAAO;IACV,aAAa,WAAW;IACxB,sBAAsB;IACvB;;;AAIP,QAAO;EACL,MAAM;EACN;EACO;EACP,eAAe,QAAQ;EACxB"}
@@ -6,6 +6,32 @@ type RunnableFunc$1<RunInput, RunOutput, CallOptions extends RunnableConfig = Ru
6
6
  type RunnableMapLike<RunInput, RunOutput> = { [K in keyof RunOutput]: RunnableLike$1<RunInput, RunOutput[K]> };
7
7
  type RunnableLike$1<RunInput, RunOutput, CallOptions extends RunnableConfig = RunnableConfig> = RunnableInterface<RunInput, RunOutput, CallOptions> | RunnableFunc$1<RunInput, RunOutput, CallOptions> | RunnableMapLike<RunInput, RunOutput>;
8
8
  type IsEqual<T, U> = [T] extends [U] ? ([U] extends [T] ? true : false) : false;
9
+ /** Read-only execution info/metadata for the execution of current thread/run/node. */
10
+ interface ExecutionInfo {
11
+ /** The checkpoint ID for the current execution. */
12
+ readonly checkpointId: string;
13
+ /** The checkpoint namespace for the current execution. */
14
+ readonly checkpointNs: string;
15
+ /** The task ID for the current execution. */
16
+ readonly taskId: string;
17
+ /** The thread ID for the current execution. Undefined when running without a checkpointer. */
18
+ readonly threadId?: string;
19
+ /** The run ID for the current execution. Undefined when `runId` is not provided in the config. */
20
+ readonly runId?: string;
21
+ /** Current node execution attempt number (1-indexed). */
22
+ readonly nodeAttempt: number;
23
+ /** Unix timestamp (ms) for when the first attempt started. */
24
+ readonly nodeFirstAttemptTime?: number;
25
+ }
26
+ /** Metadata injected by LangGraph Server. Undefined when running open-source LangGraph without LangSmith deployments. */
27
+ interface ServerInfo {
28
+ /** The assistant ID for the current execution. */
29
+ readonly assistantId: string;
30
+ /** The graph ID for the current execution. */
31
+ readonly graphId: string;
32
+ /** The authenticated user, if any. */
33
+ readonly user?: Record<string, any>;
34
+ }
9
35
  interface Runtime<ContextType = Record<string, unknown>, InterruptType = unknown, WriterType = unknown> {
10
36
  configurable?: ContextType;
11
37
  /** User provided context */
@@ -36,8 +62,12 @@ interface Runtime<ContextType = Record<string, unknown>, InterruptType = unknown
36
62
  interrupt: IsEqual<InterruptType, unknown> extends true ? (value: unknown) => unknown : InterruptType;
37
63
  /** Abort signal to cancel the run. */
38
64
  signal: AbortSignal;
65
+ /** Read-only execution information/metadata for the current node run. Undefined before task preparation. */
66
+ executionInfo?: ExecutionInfo;
67
+ /** Metadata injected by LangGraph Server. Undefined when running open-source LangGraph without LangSmith deployments. */
68
+ serverInfo?: ServerInfo;
39
69
  }
40
70
  interface LangGraphRunnableConfig<ContextType extends Record<string, any> = Record<string, any>> extends RunnableConfig<ContextType>, Partial<Runtime<ContextType, unknown, unknown>> {}
41
71
  //#endregion
42
- export { LangGraphRunnableConfig, RunnableLike$1 as RunnableLike, Runtime };
72
+ export { ExecutionInfo, LangGraphRunnableConfig, RunnableLike$1 as RunnableLike, Runtime, ServerInfo };
43
73
  //# sourceMappingURL=runnable_types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runnable_types.d.cts","names":[],"sources":["../../src/pregel/runnable_types.ts"],"mappings":";;;;KAGK,cAAA,0CAGiB,cAAA,GAAiB,cAAA,KAErC,KAAA,EAAO,QAAA,EAEP,OAAA,EAAS,WAAA,KACN,SAAA,GAAY,OAAA,CAAQ,SAAA;AAAA,KAEpB,eAAA,sCACS,SAAA,GAAY,cAAA,CAAa,QAAA,EAAU,SAAA,CAAU,CAAA;AAAA,KAG/C,cAAA,0CAGU,cAAA,GAAiB,cAAA,IAEnC,iBAAA,CAAkB,QAAA,EAAU,SAAA,EAAW,WAAA,IACvC,cAAA,CAAa,QAAA,EAAU,SAAA,EAAW,WAAA,IAClC,eAAA,CAAgB,QAAA,EAAU,SAAA;AAAA,KAEzB,OAAA,UAAiB,CAAA,WAAY,CAAA,MAAO,CAAA,WAAY,CAAA;AAAA,UAEpC,OAAA,eACD,MAAA;EAId,YAAA,GAAe,WAAA;EAvBN;EA0BT,OAAA,GAAU,WAAA;EAzBa;EA4BvB,KAAA,GAAQ,SAAA;EA5Bc;EA+BtB,MAAA,EAAQ,OAAA,CAAQ,UAAA,2BACX,KAAA,qBACD,UAAA;EAxCJ;;;;;;;;;;;;;;AAOgC;;;;;EAsDhC,SAAA,EAAW,OAAA,CAAQ,aAAA,2BACd,KAAA,wBACD,aAAA;EArDqD;EAwDzD,MAAA,EAAQ,WAAA;AAAA;AAAA,UAGO,uBAAA,qBAEK,MAAA,gBAAsB,MAAA,uBAIxC,cAAA,CAAe,WAAA,GACf,OAAA,CAAQ,OAAA,CAAQ,WAAA"}
1
+ {"version":3,"file":"runnable_types.d.cts","names":[],"sources":["../../src/pregel/runnable_types.ts"],"mappings":";;;;KAG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A,CAAe,WAAA,GACf,OAAA,CAAQ,OAAA,CAAQ,WAAA"}
@@ -6,6 +6,32 @@ type RunnableFunc$1<RunInput, RunOutput, CallOptions extends RunnableConfig = Ru
6
6
  type RunnableMapLike<RunInput, RunOutput> = { [K in keyof RunOutput]: RunnableLike$1<RunInput, RunOutput[K]> };
7
7
  type RunnableLike$1<RunInput, RunOutput, CallOptions extends RunnableConfig = RunnableConfig> = RunnableInterface<RunInput, RunOutput, CallOptions> | RunnableFunc$1<RunInput, RunOutput, CallOptions> | RunnableMapLike<RunInput, RunOutput>;
8
8
  type IsEqual<T, U> = [T] extends [U] ? ([U] extends [T] ? true : false) : false;
9
+ /** Read-only execution info/metadata for the execution of current thread/run/node. */
10
+ interface ExecutionInfo {
11
+ /** The checkpoint ID for the current execution. */
12
+ readonly checkpointId: string;
13
+ /** The checkpoint namespace for the current execution. */
14
+ readonly checkpointNs: string;
15
+ /** The task ID for the current execution. */
16
+ readonly taskId: string;
17
+ /** The thread ID for the current execution. Undefined when running without a checkpointer. */
18
+ readonly threadId?: string;
19
+ /** The run ID for the current execution. Undefined when `runId` is not provided in the config. */
20
+ readonly runId?: string;
21
+ /** Current node execution attempt number (1-indexed). */
22
+ readonly nodeAttempt: number;
23
+ /** Unix timestamp (ms) for when the first attempt started. */
24
+ readonly nodeFirstAttemptTime?: number;
25
+ }
26
+ /** Metadata injected by LangGraph Server. Undefined when running open-source LangGraph without LangSmith deployments. */
27
+ interface ServerInfo {
28
+ /** The assistant ID for the current execution. */
29
+ readonly assistantId: string;
30
+ /** The graph ID for the current execution. */
31
+ readonly graphId: string;
32
+ /** The authenticated user, if any. */
33
+ readonly user?: Record<string, any>;
34
+ }
9
35
  interface Runtime<ContextType = Record<string, unknown>, InterruptType = unknown, WriterType = unknown> {
10
36
  configurable?: ContextType;
11
37
  /** User provided context */
@@ -36,8 +62,12 @@ interface Runtime<ContextType = Record<string, unknown>, InterruptType = unknown
36
62
  interrupt: IsEqual<InterruptType, unknown> extends true ? (value: unknown) => unknown : InterruptType;
37
63
  /** Abort signal to cancel the run. */
38
64
  signal: AbortSignal;
65
+ /** Read-only execution information/metadata for the current node run. Undefined before task preparation. */
66
+ executionInfo?: ExecutionInfo;
67
+ /** Metadata injected by LangGraph Server. Undefined when running open-source LangGraph without LangSmith deployments. */
68
+ serverInfo?: ServerInfo;
39
69
  }
40
70
  interface LangGraphRunnableConfig<ContextType extends Record<string, any> = Record<string, any>> extends RunnableConfig<ContextType>, Partial<Runtime<ContextType, unknown, unknown>> {}
41
71
  //#endregion
42
- export { LangGraphRunnableConfig, RunnableLike$1 as RunnableLike, Runtime };
72
+ export { ExecutionInfo, LangGraphRunnableConfig, RunnableLike$1 as RunnableLike, Runtime, ServerInfo };
43
73
  //# sourceMappingURL=runnable_types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runnable_types.d.ts","names":[],"sources":["../../src/pregel/runnable_types.ts"],"mappings":";;;;KAGK,cAAA,0CAGiB,cAAA,GAAiB,cAAA,KAErC,KAAA,EAAO,QAAA,EAEP,OAAA,EAAS,WAAA,KACN,SAAA,GAAY,OAAA,CAAQ,SAAA;AAAA,KAEpB,eAAA,sCACS,SAAA,GAAY,cAAA,CAAa,QAAA,EAAU,SAAA,CAAU,CAAA;AAAA,KAG/C,cAAA,0CAGU,cAAA,GAAiB,cAAA,IAEnC,iBAAA,CAAkB,QAAA,EAAU,SAAA,EAAW,WAAA,IACvC,cAAA,CAAa,QAAA,EAAU,SAAA,EAAW,WAAA,IAClC,eAAA,CAAgB,QAAA,EAAU,SAAA;AAAA,KAEzB,OAAA,UAAiB,CAAA,WAAY,CAAA,MAAO,CAAA,WAAY,CAAA;AAAA,UAEpC,OAAA,eACD,MAAA;EAId,YAAA,GAAe,WAAA;EAvBN;EA0BT,OAAA,GAAU,WAAA;EAzBa;EA4BvB,KAAA,GAAQ,SAAA;EA5Bc;EA+BtB,MAAA,EAAQ,OAAA,CAAQ,UAAA,2BACX,KAAA,qBACD,UAAA;EAxCJ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B,MAAA,EAAQ,OAAA,CAAQ,UAAA,2BACX,KAAA,qBACD,UAAA;EA3DH;;;;;;;;AAGH;;;;;;;;;;;EA6EE,SAAA,EAAW,OAAA,CAAQ,aAAA,2BACd,KAAA,wBACD,aAAA;EAzEF;EA4EF,MAAA,EAAQ,WAAA;EA3EoB;EA8E5B,aAAA,GAAgB,aAAA;EA9EC;EAiFjB,UAAA,GAAa,UAAA;AAAA;AAAA,UAGE,uBAAA,qBAEK,MAAA,gBAAsB,MAAA,uBAIxC,cAAA,CAAe,WAAA,GACf,OAAA,CAAQ,OAAA,CAAQ,WAAA"}
@@ -26,7 +26,9 @@ const CONFIG_KEYS = [
26
26
  "interruptAfter",
27
27
  "checkpointDuring",
28
28
  "durability",
29
- "signal"
29
+ "signal",
30
+ "executionInfo",
31
+ "serverInfo"
30
32
  ];
31
33
  const DEFAULT_RECURSION_LIMIT = 25;
32
34
  function ensureLangGraphConfig(...configs) {
@@ -1 +1 @@
1
- {"version":3,"file":"config.cjs","names":["AsyncLocalStorageProviderSingleton","CONFIG_KEY_SCRATCHPAD"],"sources":["../../../src/pregel/utils/config.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { AsyncLocalStorageProviderSingleton } from \"@langchain/core/singletons\";\nimport { BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { LangGraphRunnableConfig } from \"../runnable_types.js\";\nimport {\n CHECKPOINT_NAMESPACE_END,\n CHECKPOINT_NAMESPACE_SEPARATOR,\n CONFIG_KEY_SCRATCHPAD,\n} from \"../../constants.js\";\n\nconst COPIABLE_KEYS = [\"tags\", \"metadata\", \"callbacks\", \"configurable\"];\n\nconst CONFIG_KEYS = [\n \"tags\",\n \"metadata\",\n \"callbacks\",\n \"runName\",\n \"maxConcurrency\",\n \"recursionLimit\",\n \"configurable\",\n \"runId\",\n \"outputKeys\",\n \"streamMode\",\n \"store\",\n \"writer\",\n \"interrupt\",\n \"context\",\n \"interruptBefore\",\n \"interruptAfter\",\n \"checkpointDuring\",\n \"durability\",\n \"signal\",\n];\n\nconst DEFAULT_RECURSION_LIMIT = 25;\n\nexport function ensureLangGraphConfig(\n ...configs: (LangGraphRunnableConfig | undefined)[]\n): RunnableConfig {\n const empty: LangGraphRunnableConfig = {\n tags: [],\n metadata: {},\n callbacks: undefined,\n recursionLimit: DEFAULT_RECURSION_LIMIT,\n configurable: {},\n };\n\n const implicitConfig: RunnableConfig =\n AsyncLocalStorageProviderSingleton.getRunnableConfig();\n if (implicitConfig !== undefined) {\n for (const [k, v] of Object.entries(implicitConfig)) {\n if (v !== undefined) {\n if (COPIABLE_KEYS.includes(k)) {\n let copiedValue;\n if (Array.isArray(v)) {\n copiedValue = [...v];\n } else if (typeof v === \"object\") {\n if (\n k === \"callbacks\" &&\n \"copy\" in v &&\n typeof v.copy === \"function\"\n ) {\n copiedValue = v.copy();\n } else {\n copiedValue = { ...v };\n }\n } else {\n copiedValue = v;\n }\n empty[k as keyof RunnableConfig] = copiedValue;\n } else {\n empty[k as keyof RunnableConfig] = v;\n }\n }\n }\n }\n\n for (const config of configs) {\n if (config === undefined) {\n continue;\n }\n\n for (const [k, v] of Object.entries(config)) {\n if (v !== undefined && CONFIG_KEYS.includes(k)) {\n empty[k as keyof LangGraphRunnableConfig] = v;\n }\n }\n }\n\n for (const [key, value] of Object.entries(empty.configurable!)) {\n empty.metadata = empty.metadata ?? {};\n if (\n !key.startsWith(\"__\") &&\n (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\") &&\n !(key in empty.metadata!)\n ) {\n empty.metadata[key] = value;\n }\n }\n\n return empty;\n}\n\n/**\n * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized\n *\n * @returns a reference to the {@link BaseStore} that was set when the graph was initialized\n */\nexport function getStore(\n config?: LangGraphRunnableConfig\n): BaseStore | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getStore` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.store;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined.\n *\n * @returns a reference to the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined\n */\nexport function getWriter(\n config?: LangGraphRunnableConfig\n): ((chunk: unknown) => void) | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getWriter` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.writer || runConfig?.configurable?.writer;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.\n *\n * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a\n * web environment, access the LangGraphRunnableConfig from the node function directly.\n *\n * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized\n */\nexport function getConfig(): LangGraphRunnableConfig {\n return AsyncLocalStorageProviderSingleton.getRunnableConfig();\n}\n\n/**\n * A helper utility function that returns the input for the currently executing task\n *\n * @returns the input for the currently executing task\n */\nexport function getCurrentTaskInput<T = unknown>(\n config?: LangGraphRunnableConfig\n): T {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getCurrentTaskInput` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n if (\n runConfig.configurable?.[CONFIG_KEY_SCRATCHPAD]?.currentTaskInput ===\n undefined\n ) {\n throw new Error(\"BUG: internal scratchpad not initialized.\");\n }\n\n return runConfig!.configurable![CONFIG_KEY_SCRATCHPAD]!.currentTaskInput as T;\n}\n\nexport function recastCheckpointNamespace(namespace: string): string {\n return namespace\n .split(CHECKPOINT_NAMESPACE_SEPARATOR)\n .filter((part) => !part.match(/^\\d+$/))\n .map((part) => part.split(CHECKPOINT_NAMESPACE_END)[0])\n .join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n\nexport function getParentCheckpointNamespace(namespace: string): string {\n const parts = namespace.split(CHECKPOINT_NAMESPACE_SEPARATOR);\n while (parts.length > 1 && parts[parts.length - 1].match(/^\\d+$/)) {\n parts.pop();\n }\n return parts.slice(0, -1).join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n"],"mappings":";;;AAUA,MAAM,gBAAgB;CAAC;CAAQ;CAAY;CAAa;CAAe;AAEvE,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,0BAA0B;AAEhC,SAAgB,sBACd,GAAG,SACa;CAChB,MAAM,QAAiC;EACrC,MAAM,EAAE;EACR,UAAU,EAAE;EACZ,WAAW,KAAA;EACX,gBAAgB;EAChB,cAAc,EAAE;EACjB;CAED,MAAM,iBACJA,2BAAAA,mCAAmC,mBAAmB;AACxD,KAAI,mBAAmB,KAAA;OAChB,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,eAAe,CACjD,KAAI,MAAM,KAAA,EACR,KAAI,cAAc,SAAS,EAAE,EAAE;GAC7B,IAAI;AACJ,OAAI,MAAM,QAAQ,EAAE,CAClB,eAAc,CAAC,GAAG,EAAE;YACX,OAAO,MAAM,SACtB,KACE,MAAM,eACN,UAAU,KACV,OAAO,EAAE,SAAS,WAElB,eAAc,EAAE,MAAM;OAEtB,eAAc,EAAE,GAAG,GAAG;OAGxB,eAAc;AAEhB,SAAM,K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,SAAgB,0BAA0B,WAA2B;AACnE,QAAO,UACJ,MAAA,IAAqC,CACrC,QAAQ,SAAS,CAAC,KAAK,MAAM,QAAQ,CAAC,CACtC,KAAK,SAAS,KAAK,MAAA,IAA+B,CAAC,GAAG,CACtD,KAAA,IAAoC;;AAGzC,SAAgB,6BAA6B,WAA2B;CACtE,MAAM,QAAQ,UAAU,MAAA,IAAqC;AAC7D,QAAO,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ,CAC/D,OAAM,KAAK;AAEb,QAAO,MAAM,MAAM,GAAG,GAAG,CAAC,KAAA,IAAoC"}
1
+ {"version":3,"file":"config.cjs","names":["AsyncLocalStorageProviderSingleton","CONFIG_KEY_SCRATCHPAD"],"sources":["../../../src/pregel/utils/config.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { AsyncLocalStorageProviderSingleton } from \"@langchain/core/singletons\";\nimport { BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { LangGraphRunnableConfig } from \"../runnable_types.js\";\nimport {\n CHECKPOINT_NAMESPACE_END,\n CHECKPOINT_NAMESPACE_SEPARATOR,\n CONFIG_KEY_SCRATCHPAD,\n} from \"../../constants.js\";\n\nconst COPIABLE_KEYS = [\"tags\", \"metadata\", \"callbacks\", \"configurable\"];\n\nconst CONFIG_KEYS = [\n \"tags\",\n \"metadata\",\n \"callbacks\",\n \"runName\",\n \"maxConcurrency\",\n \"recursionLimit\",\n \"configurable\",\n \"runId\",\n \"outputKeys\",\n \"streamMode\",\n \"store\",\n \"writer\",\n \"interrupt\",\n \"context\",\n \"interruptBefore\",\n \"interruptAfter\",\n \"checkpointDuring\",\n \"durability\",\n \"signal\",\n \"executionInfo\",\n \"serverInfo\",\n];\n\nconst DEFAULT_RECURSION_LIMIT = 25;\n\nexport function ensureLangGraphConfig(\n ...configs: (LangGraphRunnableConfig | undefined)[]\n): RunnableConfig {\n const empty: LangGraphRunnableConfig = {\n tags: [],\n metadata: {},\n callbacks: undefined,\n recursionLimit: DEFAULT_RECURSION_LIMIT,\n configurable: {},\n };\n\n const implicitConfig: RunnableConfig =\n AsyncLocalStorageProviderSingleton.getRunnableConfig();\n if (implicitConfig !== undefined) {\n for (const [k, v] of Object.entries(implicitConfig)) {\n if (v !== undefined) {\n if (COPIABLE_KEYS.includes(k)) {\n let copiedValue;\n if (Array.isArray(v)) {\n copiedValue = [...v];\n } else if (typeof v === \"object\") {\n if (\n k === \"callbacks\" &&\n \"copy\" in v &&\n typeof v.copy === \"function\"\n ) {\n copiedValue = v.copy();\n } else {\n copiedValue = { ...v };\n }\n } else {\n copiedValue = v;\n }\n empty[k as keyof RunnableConfig] = copiedValue;\n } else {\n empty[k as keyof RunnableConfig] = v;\n }\n }\n }\n }\n\n for (const config of configs) {\n if (config === undefined) {\n continue;\n }\n\n for (const [k, v] of Object.entries(config)) {\n if (v !== undefined && CONFIG_KEYS.includes(k)) {\n empty[k as keyof LangGraphRunnableConfig] = v;\n }\n }\n }\n\n for (const [key, value] of Object.entries(empty.configurable!)) {\n empty.metadata = empty.metadata ?? {};\n if (\n !key.startsWith(\"__\") &&\n (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\") &&\n !(key in empty.metadata!)\n ) {\n empty.metadata[key] = value;\n }\n }\n\n return empty;\n}\n\n/**\n * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized\n *\n * @returns a reference to the {@link BaseStore} that was set when the graph was initialized\n */\nexport function getStore(\n config?: LangGraphRunnableConfig\n): BaseStore | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getStore` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.store;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined.\n *\n * @returns a reference to the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined\n */\nexport function getWriter(\n config?: LangGraphRunnableConfig\n): ((chunk: unknown) => void) | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getWriter` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.writer || runConfig?.configurable?.writer;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.\n *\n * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a\n * web environment, access the LangGraphRunnableConfig from the node function directly.\n *\n * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized\n */\nexport function getConfig(): LangGraphRunnableConfig {\n return AsyncLocalStorageProviderSingleton.getRunnableConfig();\n}\n\n/**\n * A helper utility function that returns the input for the currently executing task\n *\n * @returns the input for the currently executing task\n */\nexport function getCurrentTaskInput<T = unknown>(\n config?: LangGraphRunnableConfig\n): T {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getCurrentTaskInput` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n if (\n runConfig.configurable?.[CONFIG_KEY_SCRATCHPAD]?.currentTaskInput ===\n undefined\n ) {\n throw new Error(\"BUG: internal scratchpad not initialized.\");\n }\n\n return runConfig!.configurable![CONFIG_KEY_SCRATCHPAD]!.currentTaskInput as T;\n}\n\nexport function recastCheckpointNamespace(namespace: string): string {\n return namespace\n .split(CHECKPOINT_NAMESPACE_SEPARATOR)\n .filter((part) => !part.match(/^\\d+$/))\n .map((part) => part.split(CHECKPOINT_NAMESPACE_END)[0])\n .join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n\nexport function getParentCheckpointNamespace(namespace: string): string {\n const parts = namespace.split(CHECKPOINT_NAMESPACE_SEPARATOR);\n while (parts.length > 1 && parts[parts.length - 1].match(/^\\d+$/)) {\n parts.pop();\n }\n return parts.slice(0, -1).join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n"],"mappings":";;;AAUA,MAAM,gBAAgB;CAAC;CAAQ;CAAY;CAAa;CAAe;AAEvE,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,0BAA0B;AAEhC,SAAgB,sBACd,GAAG,SACa;CAChB,MAAM,QAAiC;EACrC,MAAM,EAAE;EACR,UAAU,EAAE;EACZ,WAAW,KAAA;EACX,gBAAgB;EAChB,cAAc,EAAE;EACjB;CAED,MAAM,iBACJA,2BAAAA,mCAAmC,mBAAmB;AACxD,KAAI,mBAAmB,KAAA;OAChB,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,eAAe,CACjD,KAAI,MAAM,KAAA,EACR,KAAI,cAAc,SAAS,EAAE,EAAE;GAC7B,IAAI;AACJ,OAAI,MAAM,QAAQ,EAAE,CAClB,eAAc,CAAC,GAAG,EAAE;YACX,OAAO,MAAM,SACtB,KACE,MAAM,eACN,UAAU,KACV,OAAO,EAAE,SAAS,WAElB,eAAc,EAAE,MAAM;OAEtB,eAAc,EAAE,GAAG,GAAG;OAGxB,eAAc;AAEhB,SAAM,KAA6B;QAEnC,OAAM,KAA6B;;AAM3C,MAAK,MAAM,UAAU,SAAS;AAC5B,MAAI,WAAW,KAAA,EACb;AAGF,OAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,OAAO,CACzC,KAAI,MAAM,KAAA,KA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oC;;AAGzC,SAAgB,6BAA6B,WAA2B;CACtE,MAAM,QAAQ,UAAU,MAAA,IAAqC;AAC7D,QAAO,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ,CAC/D,OAAM,KAAK;AAEb,QAAO,MAAM,MAAM,GAAG,GAAG,CAAC,KAAA,IAAoC"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.cts","names":[],"sources":["../../../src/pregel/utils/config.ts"],"mappings":";;;;;;AA8GA;;;;iBAAgB,QAAA,CACd,MAAA,GAAS,uBAAA,GACR,SAAA;;;;;AAqBH;iBAAgB,SAAA,CACd,MAAA,GAAS,uBAAA,KACN,KAAA;;;;;;;;AAwBL;iBAAgB,SAAA,CAAA,GAAa,uBAAA;;;;AAS7B;;iBAAgB,mBAAA,aAAA,CACd,MAAA,GAAS,uBAAA,GACR,CAAA"}
1
+ {"version":3,"file":"config.d.cts","names":[],"sources":["../../../src/pregel/utils/config.ts"],"mappings":";;;;;;AAgHA;;;;iBAAgB,QAAA,CACd,MAAA,GAAS,uBAAA,GACR,SAAA;;;;;AAqBH;iBAAgB,SAAA,CACd,MAAA,GAAS,uBAAA,KACN,KAAA;;;;;;;;AAwBL;iBAAgB,SAAA,CAAA,GAAa,uBAAA;;;;AAS7B;;iBAAgB,mBAAA,aAAA,CACd,MAAA,GAAS,uBAAA,GACR,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","names":[],"sources":["../../../src/pregel/utils/config.ts"],"mappings":";;;;;;AA8GA;;;;iBAAgB,QAAA,CACd,MAAA,GAAS,uBAAA,GACR,SAAA;;;;;AAqBH;iBAAgB,SAAA,CACd,MAAA,GAAS,uBAAA,KACN,KAAA;;;;;;;;AAwBL;iBAAgB,SAAA,CAAA,GAAa,uBAAA;;;;AAS7B;;iBAAgB,mBAAA,aAAA,CACd,MAAA,GAAS,uBAAA,GACR,CAAA"}
1
+ {"version":3,"file":"config.d.ts","names":[],"sources":["../../../src/pregel/utils/config.ts"],"mappings":";;;;;;AAgHA;;;;iBAAgB,QAAA,CACd,MAAA,GAAS,uBAAA,GACR,SAAA;;;;;AAqBH;iBAAgB,SAAA,CACd,MAAA,GAAS,uBAAA,KACN,KAAA;;;;;;;;AAwBL;iBAAgB,SAAA,CAAA,GAAa,uBAAA;;;;AAS7B;;iBAAgB,mBAAA,aAAA,CACd,MAAA,GAAS,uBAAA,GACR,CAAA"}
@@ -26,7 +26,9 @@ const CONFIG_KEYS = [
26
26
  "interruptAfter",
27
27
  "checkpointDuring",
28
28
  "durability",
29
- "signal"
29
+ "signal",
30
+ "executionInfo",
31
+ "serverInfo"
30
32
  ];
31
33
  const DEFAULT_RECURSION_LIMIT = 25;
32
34
  function ensureLangGraphConfig(...configs) {
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","names":[],"sources":["../../../src/pregel/utils/config.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { AsyncLocalStorageProviderSingleton } from \"@langchain/core/singletons\";\nimport { BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { LangGraphRunnableConfig } from \"../runnable_types.js\";\nimport {\n CHECKPOINT_NAMESPACE_END,\n CHECKPOINT_NAMESPACE_SEPARATOR,\n CONFIG_KEY_SCRATCHPAD,\n} from \"../../constants.js\";\n\nconst COPIABLE_KEYS = [\"tags\", \"metadata\", \"callbacks\", \"configurable\"];\n\nconst CONFIG_KEYS = [\n \"tags\",\n \"metadata\",\n \"callbacks\",\n \"runName\",\n \"maxConcurrency\",\n \"recursionLimit\",\n \"configurable\",\n \"runId\",\n \"outputKeys\",\n \"streamMode\",\n \"store\",\n \"writer\",\n \"interrupt\",\n \"context\",\n \"interruptBefore\",\n \"interruptAfter\",\n \"checkpointDuring\",\n \"durability\",\n \"signal\",\n];\n\nconst DEFAULT_RECURSION_LIMIT = 25;\n\nexport function ensureLangGraphConfig(\n ...configs: (LangGraphRunnableConfig | undefined)[]\n): RunnableConfig {\n const empty: LangGraphRunnableConfig = {\n tags: [],\n metadata: {},\n callbacks: undefined,\n recursionLimit: DEFAULT_RECURSION_LIMIT,\n configurable: {},\n };\n\n const implicitConfig: RunnableConfig =\n AsyncLocalStorageProviderSingleton.getRunnableConfig();\n if (implicitConfig !== undefined) {\n for (const [k, v] of Object.entries(implicitConfig)) {\n if (v !== undefined) {\n if (COPIABLE_KEYS.includes(k)) {\n let copiedValue;\n if (Array.isArray(v)) {\n copiedValue = [...v];\n } else if (typeof v === \"object\") {\n if (\n k === \"callbacks\" &&\n \"copy\" in v &&\n typeof v.copy === \"function\"\n ) {\n copiedValue = v.copy();\n } else {\n copiedValue = { ...v };\n }\n } else {\n copiedValue = v;\n }\n empty[k as keyof RunnableConfig] = copiedValue;\n } else {\n empty[k as keyof RunnableConfig] = v;\n }\n }\n }\n }\n\n for (const config of configs) {\n if (config === undefined) {\n continue;\n }\n\n for (const [k, v] of Object.entries(config)) {\n if (v !== undefined && CONFIG_KEYS.includes(k)) {\n empty[k as keyof LangGraphRunnableConfig] = v;\n }\n }\n }\n\n for (const [key, value] of Object.entries(empty.configurable!)) {\n empty.metadata = empty.metadata ?? {};\n if (\n !key.startsWith(\"__\") &&\n (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\") &&\n !(key in empty.metadata!)\n ) {\n empty.metadata[key] = value;\n }\n }\n\n return empty;\n}\n\n/**\n * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized\n *\n * @returns a reference to the {@link BaseStore} that was set when the graph was initialized\n */\nexport function getStore(\n config?: LangGraphRunnableConfig\n): BaseStore | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getStore` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.store;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined.\n *\n * @returns a reference to the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined\n */\nexport function getWriter(\n config?: LangGraphRunnableConfig\n): ((chunk: unknown) => void) | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getWriter` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.writer || runConfig?.configurable?.writer;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.\n *\n * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a\n * web environment, access the LangGraphRunnableConfig from the node function directly.\n *\n * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized\n */\nexport function getConfig(): LangGraphRunnableConfig {\n return AsyncLocalStorageProviderSingleton.getRunnableConfig();\n}\n\n/**\n * A helper utility function that returns the input for the currently executing task\n *\n * @returns the input for the currently executing task\n */\nexport function getCurrentTaskInput<T = unknown>(\n config?: LangGraphRunnableConfig\n): T {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getCurrentTaskInput` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n if (\n runConfig.configurable?.[CONFIG_KEY_SCRATCHPAD]?.currentTaskInput ===\n undefined\n ) {\n throw new Error(\"BUG: internal scratchpad not initialized.\");\n }\n\n return runConfig!.configurable![CONFIG_KEY_SCRATCHPAD]!.currentTaskInput as T;\n}\n\nexport function recastCheckpointNamespace(namespace: string): string {\n return namespace\n .split(CHECKPOINT_NAMESPACE_SEPARATOR)\n .filter((part) => !part.match(/^\\d+$/))\n .map((part) => part.split(CHECKPOINT_NAMESPACE_END)[0])\n .join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n\nexport function getParentCheckpointNamespace(namespace: string): string {\n const parts = namespace.split(CHECKPOINT_NAMESPACE_SEPARATOR);\n while (parts.length > 1 && parts[parts.length - 1].match(/^\\d+$/)) {\n parts.pop();\n }\n return parts.slice(0, -1).join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n"],"mappings":";;;AAUA,MAAM,gBAAgB;CAAC;CAAQ;CAAY;CAAa;CAAe;AAEvE,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,0BAA0B;AAEhC,SAAgB,sBACd,GAAG,SACa;CAChB,MAAM,QAAiC;EACrC,MAAM,EAAE;EACR,UAAU,EAAE;EACZ,WAAW,KAAA;EACX,gBAAgB;EAChB,cAAc,EAAE;EACjB;CAED,MAAM,iBACJ,mCAAmC,mBAAmB;AACxD,KAAI,mBAAmB,KAAA;OAChB,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,eAAe,CACjD,KAAI,MAAM,KAAA,EACR,KAAI,cAAc,SAAS,EAAE,EAAE;GAC7B,IAAI;AACJ,OAAI,MAAM,QAAQ,EAAE,CAClB,eAAc,CAAC,GAAG,EAAE;YACX,OAAO,MAAM,SACtB,KACE,MAAM,eACN,UAAU,KACV,OAAO,EAAE,SAAS,WAElB,eAAc,EAAE,MAAM;OAEtB,eAAc,EAAE,GAAG,GAAG;OAGxB,eAAc;AAEhB,SAAM,KAA6B;QAEnC,OAAM,KAA6B;;AAM3C,MAAK,MAAM,UAAU,SAAS;AAC5B,MAAI,WAAW,KAAA,EACb;AAGF,OAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,OAAO,CACzC,KAAI,MAAM,KAAA,K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QAAQ,UAAU,MAAA,IAAqC;AAC7D,QAAO,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ,CAC/D,OAAM,KAAK;AAEb,QAAO,MAAM,MAAM,GAAG,GAAG,CAAC,KAAA,IAAoC"}
1
+ {"version":3,"file":"config.js","names":[],"sources":["../../../src/pregel/utils/config.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { AsyncLocalStorageProviderSingleton } from \"@langchain/core/singletons\";\nimport { BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { LangGraphRunnableConfig } from \"../runnable_types.js\";\nimport {\n CHECKPOINT_NAMESPACE_END,\n CHECKPOINT_NAMESPACE_SEPARATOR,\n CONFIG_KEY_SCRATCHPAD,\n} from \"../../constants.js\";\n\nconst COPIABLE_KEYS = [\"tags\", \"metadata\", \"callbacks\", \"configurable\"];\n\nconst CONFIG_KEYS = [\n \"tags\",\n \"metadata\",\n \"callbacks\",\n \"runName\",\n \"maxConcurrency\",\n \"recursionLimit\",\n \"configurable\",\n \"runId\",\n \"outputKeys\",\n \"streamMode\",\n \"store\",\n \"writer\",\n \"interrupt\",\n \"context\",\n \"interruptBefore\",\n \"interruptAfter\",\n \"checkpointDuring\",\n \"durability\",\n \"signal\",\n \"executionInfo\",\n \"serverInfo\",\n];\n\nconst DEFAULT_RECURSION_LIMIT = 25;\n\nexport function ensureLangGraphConfig(\n ...configs: (LangGraphRunnableConfig | undefined)[]\n): RunnableConfig {\n const empty: LangGraphRunnableConfig = {\n tags: [],\n metadata: {},\n callbacks: undefined,\n recursionLimit: DEFAULT_RECURSION_LIMIT,\n configurable: {},\n };\n\n const implicitConfig: RunnableConfig =\n AsyncLocalStorageProviderSingleton.getRunnableConfig();\n if (implicitConfig !== undefined) {\n for (const [k, v] of Object.entries(implicitConfig)) {\n if (v !== undefined) {\n if (COPIABLE_KEYS.includes(k)) {\n let copiedValue;\n if (Array.isArray(v)) {\n copiedValue = [...v];\n } else if (typeof v === \"object\") {\n if (\n k === \"callbacks\" &&\n \"copy\" in v &&\n typeof v.copy === \"function\"\n ) {\n copiedValue = v.copy();\n } else {\n copiedValue = { ...v };\n }\n } else {\n copiedValue = v;\n }\n empty[k as keyof RunnableConfig] = copiedValue;\n } else {\n empty[k as keyof RunnableConfig] = v;\n }\n }\n }\n }\n\n for (const config of configs) {\n if (config === undefined) {\n continue;\n }\n\n for (const [k, v] of Object.entries(config)) {\n if (v !== undefined && CONFIG_KEYS.includes(k)) {\n empty[k as keyof LangGraphRunnableConfig] = v;\n }\n }\n }\n\n for (const [key, value] of Object.entries(empty.configurable!)) {\n empty.metadata = empty.metadata ?? {};\n if (\n !key.startsWith(\"__\") &&\n (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\") &&\n !(key in empty.metadata!)\n ) {\n empty.metadata[key] = value;\n }\n }\n\n return empty;\n}\n\n/**\n * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized\n *\n * @returns a reference to the {@link BaseStore} that was set when the graph was initialized\n */\nexport function getStore(\n config?: LangGraphRunnableConfig\n): BaseStore | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getStore` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.store;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined.\n *\n * @returns a reference to the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined\n */\nexport function getWriter(\n config?: LangGraphRunnableConfig\n): ((chunk: unknown) => void) | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getWriter` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.writer || runConfig?.configurable?.writer;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.\n *\n * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a\n * web environment, access the LangGraphRunnableConfig from the node function directly.\n *\n * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized\n */\nexport function getConfig(): LangGraphRunnableConfig {\n return AsyncLocalStorageProviderSingleton.getRunnableConfig();\n}\n\n/**\n * A helper utility function that returns the input for the currently executing task\n *\n * @returns the input for the currently executing task\n */\nexport function getCurrentTaskInput<T = unknown>(\n config?: LangGraphRunnableConfig\n): T {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getCurrentTaskInput` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n if (\n runConfig.configurable?.[CONFIG_KEY_SCRATCHPAD]?.currentTaskInput ===\n undefined\n ) {\n throw new Error(\"BUG: internal scratchpad not initialized.\");\n }\n\n return runConfig!.configurable![CONFIG_KEY_SCRATCHPAD]!.currentTaskInput as T;\n}\n\nexport function recastCheckpointNamespace(namespace: string): string {\n return namespace\n .split(CHECKPOINT_NAMESPACE_SEPARATOR)\n .filter((part) => !part.match(/^\\d+$/))\n .map((part) => part.split(CHECKPOINT_NAMESPACE_END)[0])\n .join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n\nexport function getParentCheckpointNamespace(namespace: string): string {\n const parts = namespace.split(CHECKPOINT_NAMESPACE_SEPARATOR);\n while (parts.length > 1 && parts[parts.length - 1].match(/^\\d+$/)) {\n parts.pop();\n }\n return parts.slice(0,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SAAS,OAAO;;AAI1B,QAAO;;;;;;;AAQT,SAAgB,SACd,QACuB;CACvB,MAAM,YACJ,UAAU,mCAAmC,mBAAmB;AAElE,KAAI,cAAc,KAAA,EAChB,OAAM,IAAI,MACR,CACE,2HACA,uGACD,CAAC,KAAK,KAAK,CACb;AAGH,QAAO,WAAW;;;;;;;AAQpB,SAAgB,UACd,QACwC;CACxC,MAAM,YACJ,UAAU,mCAAmC,mBAAmB;AAElE,KAAI,cAAc,KAAA,EAChB,OAAM,IAAI,MACR,CACE,2HACA,wGACD,CAAC,KAAK,KAAK,CACb;AAGH,QAAO,WAAW,UAAU,WAAW,cAAc;;;;;;;;;;AAWvD,SAAgB,YAAqC;AACnD,QAAO,mCAAmC,mBAAmB;;;;;;;AAQ/D,SAAgB,oBACd,QACG;CACH,MAAM,YACJ,UAAU,mCAAmC,mBAAmB;AAElE,KAAI,cAAc,KAAA,EAChB,OAAM,IAAI,MACR,CACE,2HACA,kHACD,CAAC,KAAK,KAAK,CACb;AAGH,KACE,UAAU,eAAA,wBAAuC,qBACjD,KAAA,EAEA,OAAM,IAAI,MAAM,4CAA4C;AAG9D,QAAO,UAAW,aAAc,uBAAwB;;AAG1D,SAAgB,0BAA0B,WAA2B;AACnE,QAAO,UACJ,MAAA,IAAqC,CACrC,QAAQ,SAAS,CAAC,KAAK,MAAM,QAAQ,CAAC,CACtC,KAAK,SAAS,KAAK,MAAA,IAA+B,CAAC,GAAG,CACtD,KAAA,IAAoC;;AAGzC,SAAgB,6BAA6B,WAA2B;CACtE,MAAM,QAAQ,UAAU,MAAA,IAAqC;AAC7D,QAAO,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ,CAC/D,OAAM,KAAK;AAEb,QAAO,MAAM,MAAM,GAAG,GAAG,CAAC,KAAA,IAAoC"}
package/dist/web.d.cts CHANGED
@@ -8,7 +8,7 @@ import { EphemeralValue } from "./channels/ephemeral_value.cjs";
8
8
  import { NamedBarrierValue } from "./channels/named_barrier_value.cjs";
9
9
  import { Topic } from "./channels/topic.cjs";
10
10
  import { UntrackedValueChannel } from "./channels/untracked_value.cjs";
11
- import { LangGraphRunnableConfig, Runtime } from "./pregel/runnable_types.cjs";
11
+ import { ExecutionInfo, LangGraphRunnableConfig, Runtime, ServerInfo } from "./pregel/runnable_types.cjs";
12
12
  import { Annotation, AnnotationRoot, NodeType, SingleReducer, StateDefinition, StateType, UpdateType } from "./graph/annotation.cjs";
13
13
  import { RetryPolicy } from "./pregel/utils/index.cjs";
14
14
  import { PregelNode } from "./pregel/read.cjs";
@@ -32,4 +32,4 @@ import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter
32
32
  import { MessagesValue } from "./state/prebuilt/messages.cjs";
33
33
  import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.cjs";
34
34
  import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "@langchain/langgraph-checkpoint";
35
- export { Annotation, type AnnotationRoot, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, type InferInterruptInputType, type InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, type InferWriterType, type Interrupt, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type NamespaceMatchType, NodeInterrupt, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, type Runtime, START, type SearchOperation, Send, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphArgs, type StateGraphInit, StateGraphInputError, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, type StateSnapshot, type StateType, type StreamMode, type StreamOutputMap, type TaskOptions, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
35
+ export { Annotation, type AnnotationRoot, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, type ExecutionInfo, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, type InferInterruptInputType, type InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, type InferWriterType, type Interrupt, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type NamespaceMatchType, NodeInterrupt, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, type Runtime, START, type SearchOperation, Send, type ServerInfo, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphArgs, type StateGraphInit, StateGraphInputError, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, type StateSnapshot, type StateType, type StreamMode, type StreamOutputMap, type TaskOptions, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
package/dist/web.d.ts CHANGED
@@ -8,7 +8,7 @@ import { EphemeralValue } from "./channels/ephemeral_value.js";
8
8
  import { NamedBarrierValue } from "./channels/named_barrier_value.js";
9
9
  import { Topic } from "./channels/topic.js";
10
10
  import { UntrackedValueChannel } from "./channels/untracked_value.js";
11
- import { LangGraphRunnableConfig, Runtime } from "./pregel/runnable_types.js";
11
+ import { ExecutionInfo, LangGraphRunnableConfig, Runtime, ServerInfo } from "./pregel/runnable_types.js";
12
12
  import { Annotation, AnnotationRoot, NodeType, SingleReducer, StateDefinition, StateType, UpdateType } from "./graph/annotation.js";
13
13
  import { RetryPolicy } from "./pregel/utils/index.js";
14
14
  import { PregelNode } from "./pregel/read.js";
@@ -32,4 +32,4 @@ import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter
32
32
  import { MessagesValue } from "./state/prebuilt/messages.js";
33
33
  import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.js";
34
34
  import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "@langchain/langgraph-checkpoint";
35
- export { Annotation, type AnnotationRoot, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, type InferInterruptInputType, type InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, type InferWriterType, type Interrupt, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type NamespaceMatchType, NodeInterrupt, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, type Runtime, START, type SearchOperation, Send, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphArgs, type StateGraphInit, StateGraphInputError, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, type StateSnapshot, type StateType, type StreamMode, type StreamOutputMap, type TaskOptions, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
35
+ export { Annotation, type AnnotationRoot, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, type ExecutionInfo, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, type InferInterruptInputType, type InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, type InferWriterType, type Interrupt, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type NamespaceMatchType, NodeInterrupt, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, type Runtime, START, type SearchOperation, Send, type ServerInfo, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphArgs, type StateGraphInit, StateGraphInputError, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, type StateSnapshot, type StateType, type StreamMode, type StreamOutputMap, type TaskOptions, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "LangGraph",
5
5
  "type": "module",
6
6
  "engines": {
@@ -19,7 +19,7 @@
19
19
  "@standard-schema/spec": "1.1.0",
20
20
  "uuid": "^10.0.0",
21
21
  "@langchain/langgraph-checkpoint": "^1.0.1",
22
- "@langchain/langgraph-sdk": "~1.8.5"
22
+ "@langchain/langgraph-sdk": "~1.8.8"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@langchain/core": "^1.1.16",