@langchain/langgraph 1.1.4 → 1.1.5

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 (170) hide show
  1. package/dist/channels/any_value.d.cts +0 -1
  2. package/dist/channels/any_value.d.cts.map +1 -1
  3. package/dist/channels/any_value.d.ts +0 -1
  4. package/dist/channels/any_value.d.ts.map +1 -1
  5. package/dist/channels/base.d.cts.map +1 -1
  6. package/dist/channels/base.d.ts.map +1 -1
  7. package/dist/channels/binop.d.cts.map +1 -1
  8. package/dist/channels/binop.d.ts.map +1 -1
  9. package/dist/channels/dynamic_barrier_value.d.cts +0 -10
  10. package/dist/channels/dynamic_barrier_value.d.cts.map +1 -1
  11. package/dist/channels/dynamic_barrier_value.d.ts +0 -10
  12. package/dist/channels/dynamic_barrier_value.d.ts.map +1 -1
  13. package/dist/channels/ephemeral_value.d.cts +0 -1
  14. package/dist/channels/ephemeral_value.d.cts.map +1 -1
  15. package/dist/channels/ephemeral_value.d.ts +0 -1
  16. package/dist/channels/ephemeral_value.d.ts.map +1 -1
  17. package/dist/channels/last_value.d.cts +0 -1
  18. package/dist/channels/last_value.d.cts.map +1 -1
  19. package/dist/channels/last_value.d.ts +0 -1
  20. package/dist/channels/last_value.d.ts.map +1 -1
  21. package/dist/channels/named_barrier_value.d.cts +0 -1
  22. package/dist/channels/named_barrier_value.d.cts.map +1 -1
  23. package/dist/channels/named_barrier_value.d.ts +0 -1
  24. package/dist/channels/named_barrier_value.d.ts.map +1 -1
  25. package/dist/channels/topic.d.cts +0 -1
  26. package/dist/channels/topic.d.cts.map +1 -1
  27. package/dist/channels/topic.d.ts +0 -1
  28. package/dist/channels/topic.d.ts.map +1 -1
  29. package/dist/channels/untracked_value.d.cts +0 -1
  30. package/dist/channels/untracked_value.d.cts.map +1 -1
  31. package/dist/channels/untracked_value.d.ts +0 -1
  32. package/dist/channels/untracked_value.d.ts.map +1 -1
  33. package/dist/constants.d.cts +0 -15
  34. package/dist/constants.d.cts.map +1 -1
  35. package/dist/constants.d.ts +0 -15
  36. package/dist/constants.d.ts.map +1 -1
  37. package/dist/errors.d.cts.map +1 -1
  38. package/dist/errors.d.ts.map +1 -1
  39. package/dist/func/index.d.cts +0 -1
  40. package/dist/func/index.d.cts.map +1 -1
  41. package/dist/func/index.d.ts +0 -1
  42. package/dist/func/index.d.ts.map +1 -1
  43. package/dist/func/types.d.cts +0 -11
  44. package/dist/func/types.d.cts.map +1 -1
  45. package/dist/func/types.d.ts +0 -11
  46. package/dist/func/types.d.ts.map +1 -1
  47. package/dist/graph/annotation.d.cts.map +1 -1
  48. package/dist/graph/annotation.d.ts.map +1 -1
  49. package/dist/graph/graph.d.cts.map +1 -1
  50. package/dist/graph/graph.d.ts.map +1 -1
  51. package/dist/graph/index.d.ts +7 -0
  52. package/dist/graph/message.d.cts +2 -2
  53. package/dist/graph/message.d.cts.map +1 -1
  54. package/dist/graph/message.d.ts +2 -2
  55. package/dist/graph/message.d.ts.map +1 -1
  56. package/dist/graph/messages_annotation.d.cts +0 -1
  57. package/dist/graph/messages_annotation.d.cts.map +1 -1
  58. package/dist/graph/messages_annotation.d.ts +1 -1
  59. package/dist/graph/messages_annotation.d.ts.map +1 -1
  60. package/dist/graph/messages_reducer.d.cts +0 -1
  61. package/dist/graph/messages_reducer.d.cts.map +1 -1
  62. package/dist/graph/messages_reducer.d.ts +0 -1
  63. package/dist/graph/messages_reducer.d.ts.map +1 -1
  64. package/dist/graph/state.d.cts.map +1 -1
  65. package/dist/graph/state.d.ts.map +1 -1
  66. package/dist/graph/types.d.cts +2 -18
  67. package/dist/graph/types.d.cts.map +1 -1
  68. package/dist/graph/types.d.ts +2 -18
  69. package/dist/graph/types.d.ts.map +1 -1
  70. package/dist/graph/zod/index.d.cts +1 -0
  71. package/dist/graph/zod/index.d.ts +1 -0
  72. package/dist/graph/zod/meta.d.cts.map +1 -1
  73. package/dist/graph/zod/meta.d.ts.map +1 -1
  74. package/dist/graph/zod/plugin.d.cts +30 -0
  75. package/dist/graph/zod/plugin.d.cts.map +1 -0
  76. package/dist/graph/zod/plugin.d.ts +30 -0
  77. package/dist/graph/zod/plugin.d.ts.map +1 -0
  78. package/dist/graph/zod/schema.d.cts +0 -1
  79. package/dist/graph/zod/schema.d.cts.map +1 -1
  80. package/dist/graph/zod/schema.d.ts +0 -1
  81. package/dist/graph/zod/schema.d.ts.map +1 -1
  82. package/dist/graph/zod/zod-registry.d.cts +0 -1
  83. package/dist/graph/zod/zod-registry.d.cts.map +1 -1
  84. package/dist/graph/zod/zod-registry.d.ts +0 -1
  85. package/dist/graph/zod/zod-registry.d.ts.map +1 -1
  86. package/dist/interrupt.d.cts.map +1 -1
  87. package/dist/interrupt.d.ts.map +1 -1
  88. package/dist/prebuilt/agentName.d.cts +0 -17
  89. package/dist/prebuilt/agentName.d.cts.map +1 -1
  90. package/dist/prebuilt/agentName.d.ts +0 -17
  91. package/dist/prebuilt/agentName.d.ts.map +1 -1
  92. package/dist/prebuilt/agent_executor.d.cts +5 -5
  93. package/dist/prebuilt/agent_executor.d.cts.map +1 -1
  94. package/dist/prebuilt/agent_executor.d.ts +6 -5
  95. package/dist/prebuilt/agent_executor.d.ts.map +1 -1
  96. package/dist/prebuilt/chat_agent_executor.d.cts.map +1 -1
  97. package/dist/prebuilt/chat_agent_executor.d.ts.map +1 -1
  98. package/dist/prebuilt/interrupt.d.cts.map +1 -1
  99. package/dist/prebuilt/interrupt.d.ts.map +1 -1
  100. package/dist/prebuilt/react_agent_executor.d.cts +8 -14
  101. package/dist/prebuilt/react_agent_executor.d.cts.map +1 -1
  102. package/dist/prebuilt/react_agent_executor.d.ts +10 -14
  103. package/dist/prebuilt/react_agent_executor.d.ts.map +1 -1
  104. package/dist/prebuilt/tool_executor.d.cts.map +1 -1
  105. package/dist/prebuilt/tool_executor.d.ts.map +1 -1
  106. package/dist/prebuilt/tool_node.d.cts.map +1 -1
  107. package/dist/prebuilt/tool_node.d.ts.map +1 -1
  108. package/dist/pregel/algo.d.cts +0 -1
  109. package/dist/pregel/algo.d.cts.map +1 -1
  110. package/dist/pregel/algo.d.ts +5 -1
  111. package/dist/pregel/algo.d.ts.map +1 -1
  112. package/dist/pregel/index.d.cts.map +1 -1
  113. package/dist/pregel/index.d.ts.map +1 -1
  114. package/dist/pregel/read.d.cts +0 -1
  115. package/dist/pregel/read.d.cts.map +1 -1
  116. package/dist/pregel/read.d.ts +1 -1
  117. package/dist/pregel/read.d.ts.map +1 -1
  118. package/dist/pregel/remote.d.cts.map +1 -1
  119. package/dist/pregel/remote.d.ts +2 -0
  120. package/dist/pregel/remote.d.ts.map +1 -1
  121. package/dist/pregel/runnable_types.d.cts.map +1 -1
  122. package/dist/pregel/runnable_types.d.ts.map +1 -1
  123. package/dist/pregel/stream.d.ts +2 -0
  124. package/dist/pregel/types.d.cts +0 -7
  125. package/dist/pregel/types.d.cts.map +1 -1
  126. package/dist/pregel/types.d.ts +0 -7
  127. package/dist/pregel/types.d.ts.map +1 -1
  128. package/dist/pregel/utils/config.d.cts +0 -1
  129. package/dist/pregel/utils/config.d.cts.map +1 -1
  130. package/dist/pregel/utils/config.d.ts +0 -1
  131. package/dist/pregel/utils/config.d.ts.map +1 -1
  132. package/dist/pregel/utils/index.d.cts +3 -7
  133. package/dist/pregel/utils/index.d.cts.map +1 -1
  134. package/dist/pregel/utils/index.d.ts +3 -7
  135. package/dist/pregel/utils/index.d.ts.map +1 -1
  136. package/dist/pregel/write.d.cts +0 -1
  137. package/dist/pregel/write.d.cts.map +1 -1
  138. package/dist/pregel/write.d.ts +0 -1
  139. package/dist/pregel/write.d.ts.map +1 -1
  140. package/dist/state/adapter.d.cts +0 -1
  141. package/dist/state/adapter.d.cts.map +1 -1
  142. package/dist/state/adapter.d.ts +0 -1
  143. package/dist/state/adapter.d.ts.map +1 -1
  144. package/dist/state/index.d.ts +7 -0
  145. package/dist/state/prebuilt/index.d.ts +1 -0
  146. package/dist/state/prebuilt/messages.d.cts +2 -2
  147. package/dist/state/prebuilt/messages.d.cts.map +1 -1
  148. package/dist/state/prebuilt/messages.d.ts +2 -2
  149. package/dist/state/prebuilt/messages.d.ts.map +1 -1
  150. package/dist/state/schema.d.cts.map +1 -1
  151. package/dist/state/schema.d.ts +1 -0
  152. package/dist/state/schema.d.ts.map +1 -1
  153. package/dist/state/types.d.cts +0 -20
  154. package/dist/state/types.d.cts.map +1 -1
  155. package/dist/state/types.d.ts +0 -20
  156. package/dist/state/types.d.ts.map +1 -1
  157. package/dist/state/values/reduced.d.cts +0 -1
  158. package/dist/state/values/reduced.d.cts.map +1 -1
  159. package/dist/state/values/reduced.d.ts +0 -1
  160. package/dist/state/values/reduced.d.ts.map +1 -1
  161. package/dist/state/values/untracked.d.cts +0 -1
  162. package/dist/state/values/untracked.d.cts.map +1 -1
  163. package/dist/state/values/untracked.d.ts +0 -1
  164. package/dist/state/values/untracked.d.ts.map +1 -1
  165. package/dist/utils.d.cts.map +1 -1
  166. package/dist/utils.d.ts.map +1 -1
  167. package/dist/web.d.ts +3 -0
  168. package/dist/writer.d.cts.map +1 -1
  169. package/dist/writer.d.ts.map +1 -1
  170. package/package.json +2 -2
@@ -6,11 +6,13 @@ import { AnnotationRoot, SingleReducer, StateDefinition } from "../graph/annotat
6
6
  import { START } from "../constants.js";
7
7
  import { CompiledStateGraph } from "../graph/state.js";
8
8
  import { Messages } from "../graph/messages_reducer.js";
9
+ import "../graph/index.js";
9
10
  import { MessagesAnnotation } from "../graph/messages_annotation.js";
11
+ import "../web.js";
10
12
  import { ToolNode } from "./tool_node.js";
11
13
  import { All, BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
12
14
  import { Runnable, RunnableBinding, RunnableLike, RunnableSequence, RunnableToolLike } from "@langchain/core/runnables";
13
- import * as _langchain_core_messages35 from "@langchain/core/messages";
15
+ import * as _langchain_core_messages0 from "@langchain/core/messages";
14
16
  import { BaseMessage, BaseMessageLike, SystemMessage } from "@langchain/core/messages";
15
17
  import { InteropZodObject, InteropZodType } from "@langchain/core/utils/types";
16
18
  import { DynamicTool, StructuredToolInterface } from "@langchain/core/tools";
@@ -40,7 +42,7 @@ type StateModifier = Prompt;
40
42
  /** @deprecated Use Prompt instead. */
41
43
  type MessageModifier = SystemMessage | string | ((messages: BaseMessage[]) => BaseMessage[]) | ((messages: BaseMessage[]) => Promise<BaseMessage[]>) | Runnable;
42
44
  declare const createReactAgentAnnotation: <T extends Record<string, any> = Record<string, any>>() => AnnotationRoot<{
43
- messages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages35.MessageStructure<_langchain_core_messages35.MessageToolSet>, _langchain_core_messages35.MessageType>[], Messages>;
45
+ messages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[], Messages>;
44
46
  structuredResponse: {
45
47
  (): LastValue<T>;
46
48
  (annotation: SingleReducer<T, T>): BinaryOperatorAggregate<T, T>;
@@ -48,7 +50,7 @@ declare const createReactAgentAnnotation: <T extends Record<string, any> = Recor
48
50
  };
49
51
  }>;
50
52
  declare const PreHookAnnotation: AnnotationRoot<{
51
- llmInputMessages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages35.MessageStructure<_langchain_core_messages35.MessageToolSet>, _langchain_core_messages35.MessageType>[], Messages>;
53
+ llmInputMessages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[], Messages>;
52
54
  }>;
53
55
  type PreHookAnnotation = typeof PreHookAnnotation;
54
56
  type AnyAnnotationRoot = AnnotationRoot<any>;
@@ -58,9 +60,7 @@ type ToAnnotationRoot<A extends AnyAnnotationRoot | InteropZodObject> = A extend
58
60
  * Update your import to `import { CreateAgentParams } from "langchain";`
59
61
  */
60
62
  type CreateReactAgentParams<A extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, StructuredResponseType extends Record<string, any> = Record<string, any>, C extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot> = {
61
- /** The chat model that can utilize OpenAI-style tool calling. */
62
- llm: LanguageModelLike | ((state: ToAnnotationRoot<A>["State"] & PreHookAnnotation["State"], runtime: Runtime<ToAnnotationRoot<C>["State"]>) => Promise<LanguageModelLike> | LanguageModelLike);
63
- /** A list of tools or a ToolNode. */
63
+ /** The chat model that can utilize OpenAI-style tool calling. */llm: LanguageModelLike | ((state: ToAnnotationRoot<A>["State"] & PreHookAnnotation["State"], runtime: Runtime<ToAnnotationRoot<C>["State"]>) => Promise<LanguageModelLike> | LanguageModelLike); /** A list of tools or a ToolNode. */
64
64
  tools: ToolNode | (ServerTool | ClientTool)[];
65
65
  /**
66
66
  * @deprecated Use prompt instead.
@@ -92,14 +92,10 @@ type CreateReactAgentParams<A extends AnyAnnotationRoot | InteropZodObject = Any
92
92
  /**
93
93
  * An optional schema for the context.
94
94
  */
95
- contextSchema?: C;
96
- /** An optional checkpoint saver to persist the agent's state. */
97
- checkpointSaver?: BaseCheckpointSaver | boolean;
98
- /** An optional checkpoint saver to persist the agent's state. Alias of "checkpointSaver". */
99
- checkpointer?: BaseCheckpointSaver | boolean;
100
- /** An optional list of node names to interrupt before running. */
101
- interruptBefore?: N[] | All;
102
- /** An optional list of node names to interrupt after running. */
95
+ contextSchema?: C; /** An optional checkpoint saver to persist the agent's state. */
96
+ checkpointSaver?: BaseCheckpointSaver | boolean; /** An optional checkpoint saver to persist the agent's state. Alias of "checkpointSaver". */
97
+ checkpointer?: BaseCheckpointSaver | boolean; /** An optional list of node names to interrupt before running. */
98
+ interruptBefore?: N[] | All; /** An optional list of node names to interrupt after running. */
103
99
  interruptAfter?: N[] | All;
104
100
  store?: BaseStore;
105
101
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"react_agent_executor.d.ts","names":["_langchain_core_messages35","_langchain_core_language_models_chat_models0","___web_js2","BaseChatModel","LanguageModelLike","BaseMessage","BaseMessageLike","SystemMessage","Runnable","RunnableToolLike","RunnableSequence","RunnableBinding","RunnableLike","DynamicTool","StructuredToolInterface","InteropZodObject","InteropZodType","All","BaseCheckpointSaver","BaseStore","CompiledStateGraph","AnnotationRoot","MessagesAnnotation","ToolNode","LangGraphRunnableConfig","Runtime","Messages","START","InteropZodToStateDefinition","AgentState","Record","StructuredResponseType","N","StructuredResponseSchemaOptions","ServerTool","ClientTool","ConfigurableModelInterface","Promise","_shouldBindTools","_bindTools","_langchain_core_language_models_base0","BaseLanguageModelInput","MessageToolSet","MessageStructure","AIMessageChunk","BaseChatModelCallOptions","_getModel","Prompt","State","StateModifier","MessageModifier","createReactAgentAnnotation","MessageType","BinaryOperatorAggregate","T","LastValue","SingleReducer","StateDefinition","S","PreHookAnnotation","AnyAnnotationRoot","ToAnnotationRoot","A","CreateReactAgentParams","C","createReactAgent","StructuredResponseFormat","spec","ReturnType"],"sources":["../../src/prebuilt/react_agent_executor.d.ts"],"sourcesContent":["import { BaseChatModel } from \"@langchain/core/language_models/chat_models\";\nimport { LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport { BaseMessage, BaseMessageLike, SystemMessage } from \"@langchain/core/messages\";\nimport { Runnable, RunnableToolLike, RunnableSequence, RunnableBinding, type RunnableLike } from \"@langchain/core/runnables\";\nimport { DynamicTool, StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { InteropZodObject, InteropZodType } from \"@langchain/core/utils/types\";\nimport { All, BaseCheckpointSaver, BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { type CompiledStateGraph, AnnotationRoot } from \"../graph/index.js\";\nimport { MessagesAnnotation } from \"../graph/messages_annotation.js\";\nimport { ToolNode } from \"./tool_node.js\";\nimport { LangGraphRunnableConfig, Runtime } from \"../pregel/runnable_types.js\";\nimport { Messages } from \"../graph/messages_reducer.js\";\nimport { START } from \"../constants.js\";\nimport type { InteropZodToStateDefinition } from \"../graph/zod/meta.js\";\n/**\n * @deprecated `AgentState` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { AgentState } from \"langchain\";`\n */\nexport interface AgentState<StructuredResponseType extends Record<string, any> = Record<string, any>> {\n messages: BaseMessage[];\n structuredResponse: StructuredResponseType;\n}\nexport type N = typeof START | \"agent\" | \"tools\";\ntype StructuredResponseSchemaOptions<StructuredResponseType> = {\n schema: InteropZodType<StructuredResponseType> | Record<string, any>;\n prompt?: string;\n strict?: boolean;\n [key: string]: unknown;\n};\ntype ServerTool = Record<string, unknown>;\ntype ClientTool = StructuredToolInterface | DynamicTool | RunnableToolLike;\ninterface ConfigurableModelInterface {\n _queuedMethodOperations: Record<string, any>;\n _model: () => Promise<BaseChatModel>;\n}\nexport declare function _shouldBindTools(llm: LanguageModelLike, tools: (ClientTool | ServerTool)[]): Promise<boolean>;\nexport declare function _bindTools(llm: LanguageModelLike, toolClasses: (ClientTool | ServerTool)[]): Promise<Runnable<import(\"@langchain/core/language_models/base\").BaseLanguageModelInput, import(\"@langchain/core/messages\").AIMessageChunk<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>>, import(\"@langchain/core/language_models/chat_models\").BaseChatModelCallOptions> | RunnableBinding<any, any, any> | RunnableSequence<any, any>>;\nexport declare function _getModel(llm: LanguageModelLike | ConfigurableModelInterface): Promise<LanguageModelLike>;\nexport type Prompt = SystemMessage | string | ((state: typeof MessagesAnnotation.State, config: LangGraphRunnableConfig) => BaseMessageLike[]) | ((state: typeof MessagesAnnotation.State, config: LangGraphRunnableConfig) => Promise<BaseMessageLike[]>) | Runnable;\n/** @deprecated Use Prompt instead. */\nexport type StateModifier = Prompt;\n/** @deprecated Use Prompt instead. */\nexport type MessageModifier = SystemMessage | string | ((messages: BaseMessage[]) => BaseMessage[]) | ((messages: BaseMessage[]) => Promise<BaseMessage[]>) | Runnable;\nexport declare const createReactAgentAnnotation: <T extends Record<string, any> = Record<string, any>>() => AnnotationRoot<{\n messages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n structuredResponse: {\n (): import(\"../web.js\").LastValue<T>;\n (annotation: import(\"../web.js\").SingleReducer<T, T>): import(\"../web.js\").BinaryOperatorAggregate<T, T>;\n Root: <S extends import(\"../web.js\").StateDefinition>(sd: S) => AnnotationRoot<S>;\n };\n}>;\ndeclare const PreHookAnnotation: AnnotationRoot<{\n llmInputMessages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n}>;\ntype PreHookAnnotation = typeof PreHookAnnotation;\ntype AnyAnnotationRoot = AnnotationRoot<any>;\ntype ToAnnotationRoot<A extends AnyAnnotationRoot | InteropZodObject> = A extends AnyAnnotationRoot ? A : A extends InteropZodObject ? AnnotationRoot<InteropZodToStateDefinition<A>> : never;\n/**\n * @deprecated `CreateReactAgentParams` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { CreateAgentParams } from \"langchain\";`\n */\nexport type CreateReactAgentParams<A extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, StructuredResponseType extends Record<string, any> = Record<string, any>, C extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot> = {\n /** The chat model that can utilize OpenAI-style tool calling. */\n llm: LanguageModelLike | ((state: ToAnnotationRoot<A>[\"State\"] & PreHookAnnotation[\"State\"], runtime: Runtime<ToAnnotationRoot<C>[\"State\"]>) => Promise<LanguageModelLike> | LanguageModelLike);\n /** A list of tools or a ToolNode. */\n tools: ToolNode | (ServerTool | ClientTool)[];\n /**\n * @deprecated Use prompt instead.\n */\n messageModifier?: MessageModifier;\n /**\n * @deprecated Use prompt instead.\n */\n stateModifier?: StateModifier;\n /**\n * An optional prompt for the LLM. This takes full graph state BEFORE the LLM is called and prepares the input to LLM.\n *\n * Can take a few different forms:\n *\n * - str: This is converted to a SystemMessage and added to the beginning of the list of messages in state[\"messages\"].\n * - SystemMessage: this is added to the beginning of the list of messages in state[\"messages\"].\n * - Function: This function should take in full graph state and the output is then passed to the language model.\n * - Runnable: This runnable should take in full graph state and the output is then passed to the language model.\n *\n * Note:\n * Prior to `v0.2.46`, the prompt was set using `stateModifier` / `messagesModifier` parameters.\n * This is now deprecated and will be removed in a future release.\n */\n prompt?: Prompt;\n /**\n * Additional state schema for the agent.\n */\n stateSchema?: A;\n /**\n * An optional schema for the context.\n */\n contextSchema?: C;\n /** An optional checkpoint saver to persist the agent's state. */\n checkpointSaver?: BaseCheckpointSaver | boolean;\n /** An optional checkpoint saver to persist the agent's state. Alias of \"checkpointSaver\". */\n checkpointer?: BaseCheckpointSaver | boolean;\n /** An optional list of node names to interrupt before running. */\n interruptBefore?: N[] | All;\n /** An optional list of node names to interrupt after running. */\n interruptAfter?: N[] | All;\n store?: BaseStore;\n /**\n * An optional schema for the final agent output.\n *\n * If provided, output will be formatted to match the given schema and returned in the 'structuredResponse' state key.\n * If not provided, `structuredResponse` will not be present in the output state.\n *\n * Can be passed in as:\n * - Zod schema\n * - JSON schema\n * - { prompt, schema }, where schema is one of the above.\n * The prompt will be used together with the model that is being used to generate the structured response.\n *\n * @remarks\n * **Important**: `responseFormat` requires the model to support `.withStructuredOutput()`.\n *\n * **Note**: The graph will make a separate call to the LLM to generate the structured response after the agent loop is finished.\n * This is not the only strategy to get structured responses, see more options in [this guide](https://langchain-ai.github.io/langgraph/how-tos/react-agent-structured-output/).\n */\n responseFormat?: InteropZodType<StructuredResponseType> | StructuredResponseSchemaOptions<StructuredResponseType> | Record<string, any>;\n /**\n * An optional name for the agent.\n */\n name?: string;\n /**\n * An optional description for the agent.\n * This can be used to describe the agent to the underlying supervisor LLM.\n */\n description?: string | undefined;\n /**\n * Use to specify how to expose the agent name to the underlying supervisor LLM.\n \n - undefined: Relies on the LLM provider {@link AIMessage#name}. Currently, only OpenAI supports this.\n - `\"inline\"`: Add the agent name directly into the content field of the {@link AIMessage} using XML-style tags.\n Example: `\"How can I help you\"` -> `\"<name>agent_name</name><content>How can I help you?</content>\"`\n */\n includeAgentName?: \"inline\" | undefined;\n /**\n * An optional node to add before the `agent` node (i.e., the node that calls the LLM).\n * Useful for managing long message histories (e.g., message trimming, summarization, etc.).\n */\n preModelHook?: RunnableLike<ToAnnotationRoot<A>[\"State\"] & PreHookAnnotation[\"State\"], ToAnnotationRoot<A>[\"Update\"] & PreHookAnnotation[\"Update\"], LangGraphRunnableConfig>;\n /**\n * An optional node to add after the `agent` node (i.e., the node that calls the LLM).\n * Useful for implementing human-in-the-loop, guardrails, validation, or other post-processing.\n */\n postModelHook?: RunnableLike<ToAnnotationRoot<A>[\"State\"], ToAnnotationRoot<A>[\"Update\"], LangGraphRunnableConfig>;\n /**\n * Determines the version of the graph to create.\n *\n * Can be one of\n * - `\"v1\"`: The tool node processes a single message. All tool calls in the message are\n * executed in parallel within the tool node.\n * - `\"v2\"`: The tool node processes a single tool call. Tool calls are distributed across\n * multiple instances of the tool node using the Send API.\n *\n * @default `\"v1\"`\n */\n version?: \"v1\" | \"v2\";\n};\n/**\n * @deprecated `createReactAgent` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { createAgent } from \"langchain\";`\n *\n * Creates a StateGraph agent that relies on a chat model utilizing tool calling.\n *\n * @example\n * ```ts\n * import { ChatOpenAI } from \"@langchain/openai\";\n * import { tool } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n * import { createReactAgent } from \"@langchain/langgraph/prebuilt\";\n *\n * const model = new ChatOpenAI({\n * model: \"gpt-4o\",\n * });\n *\n * const getWeather = tool((input) => {\n * if ([\"sf\", \"san francisco\"].includes(input.location.toLowerCase())) {\n * return \"It's 60 degrees and foggy.\";\n * } else {\n * return \"It's 90 degrees and sunny.\";\n * }\n * }, {\n * name: \"get_weather\",\n * description: \"Call to get the current weather.\",\n * schema: z.object({\n * location: z.string().describe(\"Location to get the weather for.\"),\n * })\n * })\n *\n * const agent = createReactAgent({ llm: model, tools: [getWeather] });\n *\n * const inputs = {\n * messages: [{ role: \"user\", content: \"what is the weather in SF?\" }],\n * };\n *\n * const stream = await agent.stream(inputs, { streamMode: \"values\" });\n *\n * for await (const { messages } of stream) {\n * console.log(messages);\n * }\n * // Returns the messages in the state at each step of execution\n * ```\n */\nexport declare function createReactAgent<A extends AnyAnnotationRoot | InteropZodObject = typeof MessagesAnnotation, StructuredResponseFormat extends Record<string, any> = Record<string, any>, C extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot>(params: CreateReactAgentParams<A, StructuredResponseFormat, C>): CompiledStateGraph<ToAnnotationRoot<A>[\"State\"], ToAnnotationRoot<A>[\"Update\"], any, typeof MessagesAnnotation.spec & ToAnnotationRoot<A>[\"spec\"], ReturnType<typeof createReactAgentAnnotation<StructuredResponseFormat>>[\"spec\"] & ToAnnotationRoot<A>[\"spec\"]>;\nexport {};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAkBiB6B,0CAA0CC,sBAAsBA;EAAhED,QAAAA,EACHxB,WADa,EAAA;EAAA,kBAAA,EAEH0B,sBAFG;;AAAsDD,KAIrEE,CAAAA,GAJqEF,OAI1DH,KAJ0DG,GAAAA,OAAAA,GAAAA,OAAAA;KAK5EG,+BAJS5B,CAAAA,sBAAAA,CAAAA,GAAAA;QACU0B,EAIZf,cAJYe,CAIGA,sBAJHA,CAAAA,GAI6BD,MAJ7BC,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;EAAsB,MAAA,CAAA,EAAA,MAAA;EAElCC,MAAC,CAAA,EAAA,OAAUL;EAClBM,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;CAA+B;KAM/BC,UAAAA,GAAaJ,MALSC,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;KAMtBI,UAAAA,GAAarB,uBANNE,GAMgCH,WANhCG,GAM8CP,gBAN9CO;AAM8CP,KAQ9CsC,MAAAA,GAASxC,aARqCE,GAAAA,MAAAA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Config","RunnableToolLike","StructuredToolInterface","ToolExecutorArgs","Array","ToolInvocationInterface","ToolExecutorInputType","ToolExecutorOutputType","ToolExecutor","Record","Promise"],"sources":["../../src/prebuilt/tool_executor.d.ts"],"sourcesContent":["import { RunnableBinding, RunnableConfig, RunnableToolLike } from \"@langchain/core/runnables\";\nimport { StructuredToolInterface } from \"@langchain/core/tools\";\n/** @deprecated Use {@link ToolNode} instead. */\nexport interface ToolExecutorArgs {\n tools: Array<StructuredToolInterface | RunnableToolLike>;\n /**\n * @default {INVALID_TOOL_MSG_TEMPLATE}\n */\n invalidToolMsgTemplate?: string;\n}\n/**\n * Interface for invoking a tool\n */\nexport interface ToolInvocationInterface {\n tool: string;\n toolInput: string;\n}\ntype ToolExecutorInputType = any;\ntype ToolExecutorOutputType = any;\n/** @deprecated Use {@link ToolNode} instead. */\nexport declare class ToolExecutor extends RunnableBinding<ToolExecutorInputType, ToolExecutorOutputType> {\n lc_graph_name: string;\n tools: Array<StructuredToolInterface | RunnableToolLike>;\n toolMap: Record<string, StructuredToolInterface | RunnableToolLike>;\n invalidToolMsgTemplate: string;\n constructor(fields: ToolExecutorArgs);\n /**\n * Execute a tool invocation\n *\n * @param {ToolInvocationInterface} toolInvocation The tool to invoke and the input to pass to it.\n * @param {RunnableConfig | undefined} config Optional configuration to pass to the tool when invoked.\n * @returns Either the result of the tool invocation (`string` or `ToolMessage`, set by the `ToolOutput` generic) or a string error message.\n */\n _execute(toolInvocation: ToolInvocationInterface, config?: RunnableConfig): Promise<ToolExecutorOutputType>;\n}\nexport {};\n"],"mappings":";;;;;UAGiBI,gBAAAA;EAAAA,KAAAA,EACNC,KADMD,CACAD,uBADgB,GACUD,gBADV,CAAA;EAAA;;;wBACtBG,CAAAA,EAAAA,MAAAA;;AASX;AAGC;AACyB;AAGLI,UAPJH,uBAAAA,CAOgB;EAAA,IAAA,EAAA,MAAA;WAAyBC,EAAAA,MAAAA;;KAHrDA,qBAAAA,GAKYJ,GAAAA;KAJZK,sBAAAA,GAIsCN,GAAAA;;AACfC,cAHPM,YAAAA,SAAqBT,eAGdG,CAH8BI,qBAG9BJ,EAHqDK,sBAGrDL,CAAAA,CAAAA;eAA0BD,EAAAA,MAAAA;OAAzCQ,EADFL,KACEK,CADIP,uBACJO,GAD8BR,gBAC9BQ,CAAAA;SAEWN,EAFXM,MAEWN,CAAAA,MAAAA,EAFID,uBAEJC,GAF8BF,gBAE9BE,CAAAA;wBAQKE,EAAAA,MAAAA;aAAkCL,CAAAA,MAAAA,EARvCG,gBAQuCH;;;;;;;;2BAAlCK,kCAAkCL,iBAAiBU,QAAQH"}
1
+ {"version":3,"file":"tool_executor.d.cts","names":[],"sources":["../../src/prebuilt/tool_executor.ts"],"mappings":";;;;;UAWiB,gBAAA;EACf,KAAA,EAAO,KAAA,CAAM,uBAAA,GAA0B,gBAAA;EADR;;;EAK/B,sBAAA;AAAA;;;;UAMe,uBAAA;EACf,IAAA;EACA,SAAA;AAAA;AAAA,KAIG,qBAAA;AAAA,KAGA,sBAAA;AATL;AAAA,cAYa,YAAA,SAAqB,eAAA,CAChC,qBAAA,EACA,sBAAA;EAEA,aAAA;EAEA,KAAA,EAAO,KAAA,CAAM,uBAAA,GAA0B,gBAAA;EAEvC,OAAA,EAAS,MAAA,SAAe,uBAAA,GAA0B,gBAAA;EAElD,sBAAA;EAEA,WAAA,CAAY,MAAA,EAAQ,gBAAA;;;;AAlBI;;;;EA8ClB,QAAA,CACJ,cAAA,EAAgB,uBAAA,EAChB,MAAA,GAAS,cAAA,GACR,OAAA,CAAQ,sBAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"tool_executor.d.ts","names":["RunnableBinding","RunnableConfig","RunnableToolLike","StructuredToolInterface","ToolExecutorArgs","Array","ToolInvocationInterface","ToolExecutorInputType","ToolExecutorOutputType","ToolExecutor","Record","Promise"],"sources":["../../src/prebuilt/tool_executor.d.ts"],"sourcesContent":["import { RunnableBinding, RunnableConfig, RunnableToolLike } from \"@langchain/core/runnables\";\nimport { StructuredToolInterface } from \"@langchain/core/tools\";\n/** @deprecated Use {@link ToolNode} instead. */\nexport interface ToolExecutorArgs {\n tools: Array<StructuredToolInterface | RunnableToolLike>;\n /**\n * @default {INVALID_TOOL_MSG_TEMPLATE}\n */\n invalidToolMsgTemplate?: string;\n}\n/**\n * Interface for invoking a tool\n */\nexport interface ToolInvocationInterface {\n tool: string;\n toolInput: string;\n}\ntype ToolExecutorInputType = any;\ntype ToolExecutorOutputType = any;\n/** @deprecated Use {@link ToolNode} instead. */\nexport declare class ToolExecutor extends RunnableBinding<ToolExecutorInputType, ToolExecutorOutputType> {\n lc_graph_name: string;\n tools: Array<StructuredToolInterface | RunnableToolLike>;\n toolMap: Record<string, StructuredToolInterface | RunnableToolLike>;\n invalidToolMsgTemplate: string;\n constructor(fields: ToolExecutorArgs);\n /**\n * Execute a tool invocation\n *\n * @param {ToolInvocationInterface} toolInvocation The tool to invoke and the input to pass to it.\n * @param {RunnableConfig | undefined} config Optional configuration to pass to the tool when invoked.\n * @returns Either the result of the tool invocation (`string` or `ToolMessage`, set by the `ToolOutput` generic) or a string error message.\n */\n _execute(toolInvocation: ToolInvocationInterface, config?: RunnableConfig): Promise<ToolExecutorOutputType>;\n}\nexport {};\n"],"mappings":";;;;;UAGiBI,gBAAAA;EAAAA,KAAAA,EACNC,KADMD,CACAD,uBADgB,GACUD,gBADV,CAAA;EAAA;;;wBACtBG,CAAAA,EAAAA,MAAAA;;AASX;AAGC;AACyB;AAGLI,UAPJH,uBAAAA,CAOgB;EAAA,IAAA,EAAA,MAAA;WAAyBC,EAAAA,MAAAA;;KAHrDA,qBAAAA,GAKYJ,GAAAA;KAJZK,sBAAAA,GAIsCN,GAAAA;;AACfC,cAHPM,YAAAA,SAAqBT,eAGdG,CAH8BI,qBAG9BJ,EAHqDK,sBAGrDL,CAAAA,CAAAA;eAA0BD,EAAAA,MAAAA;OAAzCQ,EADFL,KACEK,CADIP,uBACJO,GAD8BR,gBAC9BQ,CAAAA;SAEWN,EAFXM,MAEWN,CAAAA,MAAAA,EAFID,uBAEJC,GAF8BF,gBAE9BE,CAAAA;wBAQKE,EAAAA,MAAAA;aAAkCL,CAAAA,MAAAA,EARvCG,gBAQuCH;;;;;;;;2BAAlCK,kCAAkCL,iBAAiBU,QAAQH"}
1
+ {"version":3,"file":"tool_executor.d.ts","names":[],"sources":["../../src/prebuilt/tool_executor.ts"],"mappings":";;;;;UAWiB,gBAAA;EACf,KAAA,EAAO,KAAA,CAAM,uBAAA,GAA0B,gBAAA;EADR;;;EAK/B,sBAAA;AAAA;;;;UAMe,uBAAA;EACf,IAAA;EACA,SAAA;AAAA;AAAA,KAIG,qBAAA;AAAA,KAGA,sBAAA;AATL;AAAA,cAYa,YAAA,SAAqB,eAAA,CAChC,qBAAA,EACA,sBAAA;EAEA,aAAA;EAEA,KAAA,EAAO,KAAA,CAAM,uBAAA,GAA0B,gBAAA;EAEvC,OAAA,EAAS,MAAA,SAAe,uBAAA,GAA0B,gBAAA;EAElD,sBAAA;EAEA,WAAA,CAAY,MAAA,EAAQ,gBAAA;;;;AAlBI;;;;EA8ClB,QAAA,CACJ,cAAA,EAAgB,uBAAA,EAChB,MAAA,GAAS,cAAA,GACR,OAAA,CAAQ,sBAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"tool_node.d.cts","names":["BaseMessage","ToolMessage","RunnableConfig","RunnableToolLike","DynamicTool","StructuredToolInterface","ToolCall","RunnableCallable","MessagesAnnotation","END","Command","ToolNodeOptions","ToolNode","T","Promise","toolsCondition","State"],"sources":["../../src/prebuilt/tool_node.d.ts"],"sourcesContent":["import { BaseMessage, ToolMessage } from \"@langchain/core/messages\";\nimport { RunnableConfig, RunnableToolLike } from \"@langchain/core/runnables\";\nimport { DynamicTool, StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { ToolCall } from \"@langchain/core/messages/tool\";\nimport { RunnableCallable } from \"../utils.js\";\nimport { MessagesAnnotation } from \"../graph/messages_annotation.js\";\nimport { END, Command } from \"../constants.js\";\nexport type ToolNodeOptions = {\n name?: string;\n tags?: string[];\n handleToolErrors?: boolean;\n};\n/**\n * A node that runs the tools requested in the last AIMessage. It can be used\n * either in StateGraph with a \"messages\" key or in MessageGraph. If multiple\n * tool calls are requested, they will be run in parallel. The output will be\n * a list of ToolMessages, one for each tool call.\n *\n * @example\n * ```ts\n * import { ToolNode } from \"@langchain/langgraph/prebuilt\";\n * import { tool } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n * import { AIMessage } from \"@langchain/core/messages\";\n *\n * const getWeather = tool((input) => {\n * if ([\"sf\", \"san francisco\"].includes(input.location.toLowerCase())) {\n * return \"It's 60 degrees and foggy.\";\n * } else {\n * return \"It's 90 degrees and sunny.\";\n * }\n * }, {\n * name: \"get_weather\",\n * description: \"Call to get the current weather.\",\n * schema: z.object({\n * location: z.string().describe(\"Location to get the weather for.\"),\n * }),\n * });\n *\n * const tools = [getWeather];\n * const toolNode = new ToolNode(tools);\n *\n * const messageWithSingleToolCall = new AIMessage({\n * content: \"\",\n * tool_calls: [\n * {\n * name: \"get_weather\",\n * args: { location: \"sf\" },\n * id: \"tool_call_id\",\n * type: \"tool_call\",\n * }\n * ]\n * })\n *\n * await toolNode.invoke({ messages: [messageWithSingleToolCall] });\n * // Returns tool invocation responses as:\n * // { messages: ToolMessage[] }\n * ```\n *\n * @example\n * ```ts\n * import {\n * StateGraph,\n * MessagesAnnotation,\n * } from \"@langchain/langgraph\";\n * import { ToolNode } from \"@langchain/langgraph/prebuilt\";\n * import { tool } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n * import { ChatAnthropic } from \"@langchain/anthropic\";\n *\n * const getWeather = tool((input) => {\n * if ([\"sf\", \"san francisco\"].includes(input.location.toLowerCase())) {\n * return \"It's 60 degrees and foggy.\";\n * } else {\n * return \"It's 90 degrees and sunny.\";\n * }\n * }, {\n * name: \"get_weather\",\n * description: \"Call to get the current weather.\",\n * schema: z.object({\n * location: z.string().describe(\"Location to get the weather for.\"),\n * }),\n * });\n *\n * const tools = [getWeather];\n * const modelWithTools = new ChatAnthropic({\n * model: \"claude-3-haiku-20240307\",\n * temperature: 0\n * }).bindTools(tools);\n *\n * const toolNodeForGraph = new ToolNode(tools)\n *\n * const shouldContinue = (state: typeof MessagesAnnotation.State) => {\n * const { messages } = state;\n * const lastMessage = messages[messages.length - 1];\n * if (\"tool_calls\" in lastMessage && Array.isArray(lastMessage.tool_calls) && lastMessage.tool_calls?.length) {\n * return \"tools\";\n * }\n * return \"__end__\";\n * }\n *\n * const callModel = async (state: typeof MessagesAnnotation.State) => {\n * const { messages } = state;\n * const response = await modelWithTools.invoke(messages);\n * return { messages: response };\n * }\n *\n * const graph = new StateGraph(MessagesAnnotation)\n * .addNode(\"agent\", callModel)\n * .addNode(\"tools\", toolNodeForGraph)\n * .addEdge(\"__start__\", \"agent\")\n * .addConditionalEdges(\"agent\", shouldContinue)\n * .addEdge(\"tools\", \"agent\")\n * .compile();\n *\n * const inputs = {\n * messages: [{ role: \"user\", content: \"what is the weather in SF?\" }],\n * };\n *\n * const stream = await graph.stream(inputs, {\n * streamMode: \"values\",\n * });\n *\n * for await (const { messages } of stream) {\n * console.log(messages);\n * }\n * // Returns the messages in the state at each step of execution\n * ```\n */\nexport declare class ToolNode<T = any> extends RunnableCallable<T, T> {\n tools: (StructuredToolInterface | DynamicTool | RunnableToolLike)[];\n handleToolErrors: boolean;\n trace: boolean;\n constructor(tools: (StructuredToolInterface | DynamicTool | RunnableToolLike)[], options?: ToolNodeOptions);\n protected runTool(call: ToolCall, config: RunnableConfig): Promise<ToolMessage | Command>;\n protected run(input: unknown, config: RunnableConfig): Promise<T>;\n}\n/**\n * A conditional edge function that determines whether to route to a tools node or end the graph.\n *\n * This function is designed to be used as a conditional edge in a LangGraph state graph to implement\n * the common pattern of checking if an AI message contains tool calls that need to be executed.\n *\n * @param state - The current state of the graph, which can be either:\n * - An array of `BaseMessage` objects, where the last message is checked for tool calls\n * - A state object conforming to `MessagesAnnotation.State`, which contains a `messages` array\n *\n * @returns A string indicating the next node to route to:\n * - `\"tools\"` - If the last message contains tool calls that need to be executed\n * - `END` - If there are no tool calls, indicating the graph should terminate\n *\n * @example\n * ```typescript\n * import { StateGraph, MessagesAnnotation, END, START } from \"@langchain/langgraph\";\n * import { ToolNode, toolsCondition } from \"@langchain/langgraph/prebuilt\";\n *\n * const graph = new StateGraph(MessagesAnnotation)\n * .addNode(\"agent\", agentNode)\n * .addNode(\"tools\", new ToolNode([searchTool, calculatorTool]))\n * .addEdge(START, \"agent\")\n * .addConditionalEdges(\"agent\", toolsCondition, [\"tools\", END])\n * .addEdge(\"tools\", \"agent\")\n * .compile();\n * ```\n *\n * @remarks\n * The function checks the last message in the state for the presence of `tool_calls`.\n * If the message is an `AIMessage` with one or more tool calls, it returns `\"tools\"`,\n * indicating that the graph should route to a tools node (typically a `ToolNode`) to\n * execute those tool calls. Otherwise, it returns `END` to terminate the graph execution.\n *\n * This is a common pattern in agentic workflows where an AI model decides whether to\n * use tools or provide a final response.\n */\nexport declare function toolsCondition(state: BaseMessage[] | typeof MessagesAnnotation.State): \"tools\" | typeof END;\n"],"mappings":";;;;;;;;;KAOYW,eAAAA;;EAAAA,IAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EA0HSC,gBAAQ,CAAA,EAAA,OAAA;CAAA;;;;;;;;;;;;;;;;;;;;AA6C7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA7CqBA,0BAA0BL,iBAAiBM,GAAGA;UACvDR,0BAA0BD,cAAcD;;;sBAG5BE,0BAA0BD,cAAcD,+BAA+BQ;0BACnEL,kBAAkBJ,iBAAiBY,QAAQb,cAAcS;wCAC3CR,iBAAiBY,QAAQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuC3CE,cAAAA,QAAsBf,uBAAuBQ,kBAAAA,CAAmBQ,yBAAyBP"}
1
+ {"version":3,"file":"tool_node.d.cts","names":[],"sources":["../../src/prebuilt/tool_node.ts"],"mappings":";;;;;;;;;KAeY,eAAA;EACV,IAAA;EACA,IAAA;EACA,gBAAA;AAAA;;;;;;;AAuIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4LA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA5La,QAAA,kBAA0B,gBAAA,CAAiB,CAAA,EAAG,CAAA;EACzD,KAAA,GAAQ,uBAAA,GAA0B,WAAA,GAAc,gBAAA;EAEhD,gBAAA;EAEA,KAAA;EAEA,WAAA,CACE,KAAA,GAAQ,uBAAA,GAA0B,WAAA,GAAc,gBAAA,KAChD,OAAA,GAAU,eAAA;EAAA,UAQI,OAAA,CACd,IAAA,EAAM,QAAA,EACN,MAAA,EAAQ,cAAA,GACP,OAAA,CAAQ,WAAA,GAAc,OAAA;EAAA,UA0CT,GAAA,CAAI,KAAA,WAAgB,MAAA,EAAQ,cAAA,GAAiB,OAAA,CAAQ,CAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8HvD,cAAA,CACd,KAAA,EAAO,WAAA,YAAuB,kBAAA,CAAmB,KAAA,oBAC/B,GAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"tool_node.d.ts","names":["BaseMessage","ToolMessage","RunnableConfig","RunnableToolLike","DynamicTool","StructuredToolInterface","ToolCall","RunnableCallable","MessagesAnnotation","END","Command","ToolNodeOptions","ToolNode","T","Promise","toolsCondition","State"],"sources":["../../src/prebuilt/tool_node.d.ts"],"sourcesContent":["import { BaseMessage, ToolMessage } from \"@langchain/core/messages\";\nimport { RunnableConfig, RunnableToolLike } from \"@langchain/core/runnables\";\nimport { DynamicTool, StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { ToolCall } from \"@langchain/core/messages/tool\";\nimport { RunnableCallable } from \"../utils.js\";\nimport { MessagesAnnotation } from \"../graph/messages_annotation.js\";\nimport { END, Command } from \"../constants.js\";\nexport type ToolNodeOptions = {\n name?: string;\n tags?: string[];\n handleToolErrors?: boolean;\n};\n/**\n * A node that runs the tools requested in the last AIMessage. It can be used\n * either in StateGraph with a \"messages\" key or in MessageGraph. If multiple\n * tool calls are requested, they will be run in parallel. The output will be\n * a list of ToolMessages, one for each tool call.\n *\n * @example\n * ```ts\n * import { ToolNode } from \"@langchain/langgraph/prebuilt\";\n * import { tool } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n * import { AIMessage } from \"@langchain/core/messages\";\n *\n * const getWeather = tool((input) => {\n * if ([\"sf\", \"san francisco\"].includes(input.location.toLowerCase())) {\n * return \"It's 60 degrees and foggy.\";\n * } else {\n * return \"It's 90 degrees and sunny.\";\n * }\n * }, {\n * name: \"get_weather\",\n * description: \"Call to get the current weather.\",\n * schema: z.object({\n * location: z.string().describe(\"Location to get the weather for.\"),\n * }),\n * });\n *\n * const tools = [getWeather];\n * const toolNode = new ToolNode(tools);\n *\n * const messageWithSingleToolCall = new AIMessage({\n * content: \"\",\n * tool_calls: [\n * {\n * name: \"get_weather\",\n * args: { location: \"sf\" },\n * id: \"tool_call_id\",\n * type: \"tool_call\",\n * }\n * ]\n * })\n *\n * await toolNode.invoke({ messages: [messageWithSingleToolCall] });\n * // Returns tool invocation responses as:\n * // { messages: ToolMessage[] }\n * ```\n *\n * @example\n * ```ts\n * import {\n * StateGraph,\n * MessagesAnnotation,\n * } from \"@langchain/langgraph\";\n * import { ToolNode } from \"@langchain/langgraph/prebuilt\";\n * import { tool } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n * import { ChatAnthropic } from \"@langchain/anthropic\";\n *\n * const getWeather = tool((input) => {\n * if ([\"sf\", \"san francisco\"].includes(input.location.toLowerCase())) {\n * return \"It's 60 degrees and foggy.\";\n * } else {\n * return \"It's 90 degrees and sunny.\";\n * }\n * }, {\n * name: \"get_weather\",\n * description: \"Call to get the current weather.\",\n * schema: z.object({\n * location: z.string().describe(\"Location to get the weather for.\"),\n * }),\n * });\n *\n * const tools = [getWeather];\n * const modelWithTools = new ChatAnthropic({\n * model: \"claude-3-haiku-20240307\",\n * temperature: 0\n * }).bindTools(tools);\n *\n * const toolNodeForGraph = new ToolNode(tools)\n *\n * const shouldContinue = (state: typeof MessagesAnnotation.State) => {\n * const { messages } = state;\n * const lastMessage = messages[messages.length - 1];\n * if (\"tool_calls\" in lastMessage && Array.isArray(lastMessage.tool_calls) && lastMessage.tool_calls?.length) {\n * return \"tools\";\n * }\n * return \"__end__\";\n * }\n *\n * const callModel = async (state: typeof MessagesAnnotation.State) => {\n * const { messages } = state;\n * const response = await modelWithTools.invoke(messages);\n * return { messages: response };\n * }\n *\n * const graph = new StateGraph(MessagesAnnotation)\n * .addNode(\"agent\", callModel)\n * .addNode(\"tools\", toolNodeForGraph)\n * .addEdge(\"__start__\", \"agent\")\n * .addConditionalEdges(\"agent\", shouldContinue)\n * .addEdge(\"tools\", \"agent\")\n * .compile();\n *\n * const inputs = {\n * messages: [{ role: \"user\", content: \"what is the weather in SF?\" }],\n * };\n *\n * const stream = await graph.stream(inputs, {\n * streamMode: \"values\",\n * });\n *\n * for await (const { messages } of stream) {\n * console.log(messages);\n * }\n * // Returns the messages in the state at each step of execution\n * ```\n */\nexport declare class ToolNode<T = any> extends RunnableCallable<T, T> {\n tools: (StructuredToolInterface | DynamicTool | RunnableToolLike)[];\n handleToolErrors: boolean;\n trace: boolean;\n constructor(tools: (StructuredToolInterface | DynamicTool | RunnableToolLike)[], options?: ToolNodeOptions);\n protected runTool(call: ToolCall, config: RunnableConfig): Promise<ToolMessage | Command>;\n protected run(input: unknown, config: RunnableConfig): Promise<T>;\n}\n/**\n * A conditional edge function that determines whether to route to a tools node or end the graph.\n *\n * This function is designed to be used as a conditional edge in a LangGraph state graph to implement\n * the common pattern of checking if an AI message contains tool calls that need to be executed.\n *\n * @param state - The current state of the graph, which can be either:\n * - An array of `BaseMessage` objects, where the last message is checked for tool calls\n * - A state object conforming to `MessagesAnnotation.State`, which contains a `messages` array\n *\n * @returns A string indicating the next node to route to:\n * - `\"tools\"` - If the last message contains tool calls that need to be executed\n * - `END` - If there are no tool calls, indicating the graph should terminate\n *\n * @example\n * ```typescript\n * import { StateGraph, MessagesAnnotation, END, START } from \"@langchain/langgraph\";\n * import { ToolNode, toolsCondition } from \"@langchain/langgraph/prebuilt\";\n *\n * const graph = new StateGraph(MessagesAnnotation)\n * .addNode(\"agent\", agentNode)\n * .addNode(\"tools\", new ToolNode([searchTool, calculatorTool]))\n * .addEdge(START, \"agent\")\n * .addConditionalEdges(\"agent\", toolsCondition, [\"tools\", END])\n * .addEdge(\"tools\", \"agent\")\n * .compile();\n * ```\n *\n * @remarks\n * The function checks the last message in the state for the presence of `tool_calls`.\n * If the message is an `AIMessage` with one or more tool calls, it returns `\"tools\"`,\n * indicating that the graph should route to a tools node (typically a `ToolNode`) to\n * execute those tool calls. Otherwise, it returns `END` to terminate the graph execution.\n *\n * This is a common pattern in agentic workflows where an AI model decides whether to\n * use tools or provide a final response.\n */\nexport declare function toolsCondition(state: BaseMessage[] | typeof MessagesAnnotation.State): \"tools\" | typeof END;\n"],"mappings":";;;;;;;;;KAOYW,eAAAA;;EAAAA,IAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EA0HSC,gBAAQ,CAAA,EAAA,OAAA;CAAA;;;;;;;;;;;;;;;;;;;;AA6C7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA7CqBA,0BAA0BL,iBAAiBM,GAAGA;UACvDR,0BAA0BD,cAAcD;;;sBAG5BE,0BAA0BD,cAAcD,+BAA+BQ;0BACnEL,kBAAkBJ,iBAAiBY,QAAQb,cAAcS;wCAC3CR,iBAAiBY,QAAQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuC3CE,cAAAA,QAAsBf,uBAAuBQ,kBAAAA,CAAmBQ,yBAAyBP"}
1
+ {"version":3,"file":"tool_node.d.ts","names":[],"sources":["../../src/prebuilt/tool_node.ts"],"mappings":";;;;;;;;;KAeY,eAAA;EACV,IAAA;EACA,IAAA;EACA,gBAAA;AAAA;;;;;;;AAuIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4LA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA5La,QAAA,kBAA0B,gBAAA,CAAiB,CAAA,EAAG,CAAA;EACzD,KAAA,GAAQ,uBAAA,GAA0B,WAAA,GAAc,gBAAA;EAEhD,gBAAA;EAEA,KAAA;EAEA,WAAA,CACE,KAAA,GAAQ,uBAAA,GAA0B,WAAA,GAAc,gBAAA,KAChD,OAAA,GAAU,eAAA;EAAA,UAQI,OAAA,CACd,IAAA,EAAM,QAAA,EACN,MAAA,EAAQ,cAAA,GACP,OAAA,CAAQ,WAAA,GAAc,OAAA;EAAA,UA0CT,GAAA,CAAI,KAAA,WAAgB,MAAA,EAAQ,cAAA,GAAiB,OAAA,CAAQ,CAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8HvD,cAAA,CACd,KAAA,EAAO,WAAA,YAAuB,kBAAA,CAAmB,KAAA,oBAC/B,GAAA"}
@@ -3,7 +3,6 @@ import { RunnableConfig } from "@langchain/core/runnables";
3
3
  import { CallbackManagerForChainRun } from "@langchain/core/callbacks/manager";
4
4
 
5
5
  //#region src/pregel/algo.d.ts
6
-
7
6
  /**
8
7
  * Construct a type with a set of properties K of type T
9
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"algo.d.cts","names":["RunnableConfig","CallbackManagerForChainRun","All","BaseCheckpointSaver","Checkpoint","ReadonlyCheckpoint","PendingWrite","BaseStore","CheckpointPendingWrite","BaseChannel","PregelNode","Send","PregelExecutableTask","PregelTaskDescription","SimpleTaskPath","TaskPath","IterableReadableWritableStream","StrRecord","K","T","WritesProtocol","C","increment","shouldInterrupt","PropertyKey","N","_localRead","Record","Cc","Array","_localWrite","_applyWrites","Set","NextTaskExtraFields","NextTaskExtraFieldsWithStore","NextTaskExtraFieldsWithoutStore","_prepareNextTasks","Nn","_prepareSingleTask","sanitizeUntrackedValuesInSend"],"sources":["../../src/pregel/algo.d.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { CallbackManagerForChainRun } from \"@langchain/core/callbacks/manager\";\nimport { All, BaseCheckpointSaver, Checkpoint, ReadonlyCheckpoint, type PendingWrite, BaseStore, CheckpointPendingWrite } from \"@langchain/langgraph-checkpoint\";\nimport { BaseChannel } from \"../channels/base.js\";\nimport { PregelNode } from \"./read.js\";\nimport { Send } from \"../constants.js\";\nimport { PregelExecutableTask, PregelTaskDescription, SimpleTaskPath, TaskPath } from \"./types.js\";\nimport { IterableReadableWritableStream } from \"./stream.js\";\n/**\n * Construct a type with a set of properties K of type T\n */\nexport type StrRecord<K extends string, T> = {\n [P in K]: T;\n};\nexport type WritesProtocol<C = string> = {\n name: string;\n writes: PendingWrite<C>[];\n triggers: string[];\n path?: TaskPath;\n};\nexport declare const increment: (current?: number | undefined) => number;\nexport declare function shouldInterrupt<N extends PropertyKey, C extends PropertyKey>(checkpoint: Checkpoint, interruptNodes: All | N[], tasks: PregelExecutableTask<N, C>[]): boolean;\nexport declare function _localRead<Cc extends Record<string, BaseChannel>>(checkpoint: ReadonlyCheckpoint, channels: Cc, task: WritesProtocol<keyof Cc>, select: Array<keyof Cc> | keyof Cc, fresh?: boolean): Record<string, unknown> | unknown;\nexport declare function _localWrite(commit: (writes: [string, any][]) => any, processes: Record<string, PregelNode>, writes: [string, any][]): void;\nexport declare function _applyWrites<Cc extends Record<string, BaseChannel>>(checkpoint: Checkpoint, channels: Cc, tasks: WritesProtocol<keyof Cc>[], getNextVersion: ((version: any) => any) | undefined, triggerToNodes: Record<string, string[]> | undefined): Set<string>;\nexport type NextTaskExtraFields = {\n step: number;\n isResuming?: boolean;\n checkpointer?: BaseCheckpointSaver;\n manager?: CallbackManagerForChainRun;\n store?: BaseStore;\n stream?: IterableReadableWritableStream;\n triggerToNodes?: Record<string, string[]>;\n updatedChannels?: Set<string>;\n};\nexport type NextTaskExtraFieldsWithStore = NextTaskExtraFields & {\n store?: BaseStore;\n};\nexport type NextTaskExtraFieldsWithoutStore = NextTaskExtraFields & {\n store?: never;\n};\nexport declare function _prepareNextTasks<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel>>(checkpoint: ReadonlyCheckpoint, pendingWrites: [string, string, unknown][] | undefined, processes: Nn, channels: Cc, config: RunnableConfig, forExecution: false, extra: NextTaskExtraFieldsWithoutStore): Record<string, PregelTaskDescription>;\nexport declare function _prepareNextTasks<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel>>(checkpoint: ReadonlyCheckpoint, pendingWrites: [string, string, unknown][] | undefined, processes: Nn, channels: Cc, config: RunnableConfig, forExecution: true, extra: NextTaskExtraFieldsWithStore): Record<string, PregelExecutableTask<keyof Nn, keyof Cc>>;\nexport declare function _prepareSingleTask<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel>>(taskPath: SimpleTaskPath, checkpoint: ReadonlyCheckpoint, pendingWrites: CheckpointPendingWrite[] | undefined, processes: Nn, channels: Cc, config: RunnableConfig, forExecution: false, extra: NextTaskExtraFields): PregelTaskDescription | undefined;\nexport declare function _prepareSingleTask<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel>>(taskPath: TaskPath, checkpoint: ReadonlyCheckpoint, pendingWrites: CheckpointPendingWrite[] | undefined, processes: Nn, channels: Cc, config: RunnableConfig, forExecution: true, extra: NextTaskExtraFields): PregelExecutableTask<keyof Nn, keyof Cc> | undefined;\nexport declare function _prepareSingleTask<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel>>(taskPath: TaskPath, checkpoint: ReadonlyCheckpoint, pendingWrites: CheckpointPendingWrite[] | undefined, processes: Nn, channels: Cc, config: RunnableConfig, forExecution: boolean, extra: NextTaskExtraFieldsWithStore): PregelTaskDescription | PregelExecutableTask<keyof Nn, keyof Cc> | undefined;\n/**\n * Remove any values belonging to UntrackedValue channels from a Send packet\n * before checkpointing.\n *\n * Send is often called with state to be passed to the destination node,\n * which may contain UntrackedValues at the top level.\n *\n * @internal\n */\nexport declare function sanitizeUntrackedValuesInSend(packet: Send, channels: StrRecord<string, BaseChannel>): Send;\n"],"mappings":";;;;;;;;;KAWYiB,yCACFC,IAAIC"}
1
+ {"version":3,"file":"algo.d.cts","names":[],"sources":["../../src/pregel/algo.ts"],"mappings":";;;;;;;;KA+EY,SAAA,gCACJ,CAAA,GAAI,CAAA"}
@@ -1,9 +1,13 @@
1
+ import "../channels/base.js";
2
+ import "./read.js";
3
+ import "../constants.js";
4
+ import "./types.js";
5
+ import "./stream.js";
1
6
  import { All, BaseCheckpointSaver, BaseStore, Checkpoint, PendingWrite, ReadonlyCheckpoint } from "@langchain/langgraph-checkpoint";
2
7
  import { RunnableConfig } from "@langchain/core/runnables";
3
8
  import { CallbackManagerForChainRun } from "@langchain/core/callbacks/manager";
4
9
 
5
10
  //#region src/pregel/algo.d.ts
6
-
7
11
  /**
8
12
  * Construct a type with a set of properties K of type T
9
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"algo.d.ts","names":["RunnableConfig","CallbackManagerForChainRun","All","BaseCheckpointSaver","Checkpoint","ReadonlyCheckpoint","PendingWrite","BaseStore","CheckpointPendingWrite","BaseChannel","PregelNode","Send","PregelExecutableTask","PregelTaskDescription","SimpleTaskPath","TaskPath","IterableReadableWritableStream","StrRecord","K","T","WritesProtocol","C","increment","shouldInterrupt","PropertyKey","N","_localRead","Record","Cc","Array","_localWrite","_applyWrites","Set","NextTaskExtraFields","NextTaskExtraFieldsWithStore","NextTaskExtraFieldsWithoutStore","_prepareNextTasks","Nn","_prepareSingleTask","sanitizeUntrackedValuesInSend"],"sources":["../../src/pregel/algo.d.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { CallbackManagerForChainRun } from \"@langchain/core/callbacks/manager\";\nimport { All, BaseCheckpointSaver, Checkpoint, ReadonlyCheckpoint, type PendingWrite, BaseStore, CheckpointPendingWrite } from \"@langchain/langgraph-checkpoint\";\nimport { BaseChannel } from \"../channels/base.js\";\nimport { PregelNode } from \"./read.js\";\nimport { Send } from \"../constants.js\";\nimport { PregelExecutableTask, PregelTaskDescription, SimpleTaskPath, TaskPath } from \"./types.js\";\nimport { IterableReadableWritableStream } from \"./stream.js\";\n/**\n * Construct a type with a set of properties K of type T\n */\nexport type StrRecord<K extends string, T> = {\n [P in K]: T;\n};\nexport type WritesProtocol<C = string> = {\n name: string;\n writes: PendingWrite<C>[];\n triggers: string[];\n path?: TaskPath;\n};\nexport declare const increment: (current?: number | undefined) => number;\nexport declare function shouldInterrupt<N extends PropertyKey, C extends PropertyKey>(checkpoint: Checkpoint, interruptNodes: All | N[], tasks: PregelExecutableTask<N, C>[]): boolean;\nexport declare function _localRead<Cc extends Record<string, BaseChannel>>(checkpoint: ReadonlyCheckpoint, channels: Cc, task: WritesProtocol<keyof Cc>, select: Array<keyof Cc> | keyof Cc, fresh?: boolean): Record<string, unknown> | unknown;\nexport declare function _localWrite(commit: (writes: [string, any][]) => any, processes: Record<string, PregelNode>, writes: [string, any][]): void;\nexport declare function _applyWrites<Cc extends Record<string, BaseChannel>>(checkpoint: Checkpoint, channels: Cc, tasks: WritesProtocol<keyof Cc>[], getNextVersion: ((version: any) => any) | undefined, triggerToNodes: Record<string, string[]> | undefined): Set<string>;\nexport type NextTaskExtraFields = {\n step: number;\n isResuming?: boolean;\n checkpointer?: BaseCheckpointSaver;\n manager?: CallbackManagerForChainRun;\n store?: BaseStore;\n stream?: IterableReadableWritableStream;\n triggerToNodes?: Record<string, string[]>;\n updatedChannels?: Set<string>;\n};\nexport type NextTaskExtraFieldsWithStore = NextTaskExtraFields & {\n store?: BaseStore;\n};\nexport type NextTaskExtraFieldsWithoutStore = NextTaskExtraFields & {\n store?: never;\n};\nexport declare function _prepareNextTasks<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel>>(checkpoint: ReadonlyCheckpoint, pendingWrites: [string, string, unknown][] | undefined, processes: Nn, channels: Cc, config: RunnableConfig, forExecution: false, extra: NextTaskExtraFieldsWithoutStore): Record<string, PregelTaskDescription>;\nexport declare function _prepareNextTasks<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel>>(checkpoint: ReadonlyCheckpoint, pendingWrites: [string, string, unknown][] | undefined, processes: Nn, channels: Cc, config: RunnableConfig, forExecution: true, extra: NextTaskExtraFieldsWithStore): Record<string, PregelExecutableTask<keyof Nn, keyof Cc>>;\nexport declare function _prepareSingleTask<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel>>(taskPath: SimpleTaskPath, checkpoint: ReadonlyCheckpoint, pendingWrites: CheckpointPendingWrite[] | undefined, processes: Nn, channels: Cc, config: RunnableConfig, forExecution: false, extra: NextTaskExtraFields): PregelTaskDescription | undefined;\nexport declare function _prepareSingleTask<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel>>(taskPath: TaskPath, checkpoint: ReadonlyCheckpoint, pendingWrites: CheckpointPendingWrite[] | undefined, processes: Nn, channels: Cc, config: RunnableConfig, forExecution: true, extra: NextTaskExtraFields): PregelExecutableTask<keyof Nn, keyof Cc> | undefined;\nexport declare function _prepareSingleTask<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel>>(taskPath: TaskPath, checkpoint: ReadonlyCheckpoint, pendingWrites: CheckpointPendingWrite[] | undefined, processes: Nn, channels: Cc, config: RunnableConfig, forExecution: boolean, extra: NextTaskExtraFieldsWithStore): PregelTaskDescription | PregelExecutableTask<keyof Nn, keyof Cc> | undefined;\n/**\n * Remove any values belonging to UntrackedValue channels from a Send packet\n * before checkpointing.\n *\n * Send is often called with state to be passed to the destination node,\n * which may contain UntrackedValues at the top level.\n *\n * @internal\n */\nexport declare function sanitizeUntrackedValuesInSend(packet: Send, channels: StrRecord<string, BaseChannel>): Send;\n"],"mappings":";;;;;;;;;KAWYiB,yCACFC,IAAIC"}
1
+ {"version":3,"file":"algo.d.ts","names":[],"sources":["../../src/pregel/algo.ts"],"mappings":";;;;;;;;;;;;AA+EA;KAAY,SAAA,gCACJ,CAAA,GAAI,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["Runnable","RunnableConfig","RunnableFunc","StreamEvent","IterableReadableStream","All","BaseCache","BaseCheckpointSaver","BaseStore","CheckpointListOptions","CheckpointTuple","BaseChannel","Command","CommandInstance","StrRecord","PregelNode","LangGraphRunnableConfig","Durability","GetStateOptions","MultipleChannelSubscriptionOptions","PregelInputType","PregelInterface","PregelOptions","PregelOutputType","PregelParams","SingleChannelSubscriptionOptions","StateSnapshot","StreamMode","StreamOutputMap","RetryPolicy","ChannelWrite","WriteValue","StreamEventsOptions","Parameters","Channel","Record","PartialRunnable","RunInput","RunOutput","CallOptions","Partial","Promise","Pregel","InputType","OutputType","CommandType","Nodes","Channels","ContextType","Array","Omit","_langchain_core_runnables_graph0","Graph","Generator","AsyncGenerator","config","saved","subgraphCheckpointer","applyPendingWrites","AsyncIterableIterator","TStreamMode","TSubgraphs","TEncoding","StreamUpdatesType","StreamValuesType","NodeReturnType","StreamCustom","Uint8Array"],"sources":["../../src/pregel/index.d.ts"],"sourcesContent":["import { Runnable, RunnableConfig, RunnableFunc } from \"@langchain/core/runnables\";\nimport type { StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport { All, BaseCache, BaseCheckpointSaver, BaseStore, CheckpointListOptions, CheckpointTuple } from \"@langchain/langgraph-checkpoint\";\nimport { BaseChannel } from \"../channels/base.js\";\nimport { Command, type CommandInstance } from \"../constants.js\";\nimport { StrRecord } from \"./algo.js\";\nimport { PregelNode } from \"./read.js\";\nimport { LangGraphRunnableConfig } from \"./runnable_types.js\";\nimport type { Durability, GetStateOptions, MultipleChannelSubscriptionOptions, PregelInputType, PregelInterface, PregelOptions, PregelOutputType, PregelParams, SingleChannelSubscriptionOptions, StateSnapshot, StreamMode, StreamOutputMap } from \"./types.js\";\nimport { RetryPolicy } from \"./utils/index.js\";\nimport { ChannelWrite } from \"./write.js\";\ntype WriteValue = Runnable | RunnableFunc<unknown, unknown> | unknown;\ntype StreamEventsOptions = Parameters<Runnable[\"streamEvents\"]>[2];\n/**\n * Utility class for working with channels in the Pregel system.\n * Provides static methods for subscribing to channels and writing to them.\n *\n * Channels are the communication pathways between nodes in a Pregel graph.\n * They enable message passing and state updates between different parts of the graph.\n */\nexport declare class Channel {\n /**\n * Creates a PregelNode that subscribes to a single channel.\n * This is used to define how nodes receive input from channels.\n *\n * @example\n * ```typescript\n * // Subscribe to a single channel\n * const node = Channel.subscribeTo(\"messages\");\n *\n * // Subscribe to multiple channels\n * const node = Channel.subscribeTo([\"messages\", \"state\"]);\n *\n * // Subscribe with a custom key\n * const node = Channel.subscribeTo(\"messages\", { key: \"chat\" });\n * ```\n *\n * @param channel Single channel name to subscribe to\n * @param options Subscription options\n * @returns A PregelNode configured to receive from the specified channels\n * @throws {Error} If a key is specified when subscribing to multiple channels\n */\n static subscribeTo(channel: string, options?: SingleChannelSubscriptionOptions): PregelNode;\n /**\n * Creates a PregelNode that subscribes to multiple channels.\n * This is used to define how nodes receive input from channels.\n *\n * @example\n * ```typescript\n * // Subscribe to a single channel\n * const node = Channel.subscribeTo(\"messages\");\n *\n * // Subscribe to multiple channels\n * const node = Channel.subscribeTo([\"messages\", \"state\"]);\n *\n * // Subscribe with a custom key\n * const node = Channel.subscribeTo(\"messages\", { key: \"chat\" });\n * ```\n *\n * @param channels Single channel name to subscribe to\n * @param options Subscription options\n * @returns A PregelNode configured to receive from the specified channels\n * @throws {Error} If a key is specified when subscribing to multiple channels\n */\n static subscribeTo(channels: string[], options?: MultipleChannelSubscriptionOptions): PregelNode;\n /**\n * Creates a ChannelWrite that specifies how to write values to channels.\n * This is used to define how nodes send output to channels.\n *\n * @example\n * ```typescript\n * // Write to multiple channels\n * const write = Channel.writeTo([\"output\", \"state\"]);\n *\n * // Write with specific values\n * const write = Channel.writeTo([\"output\"], {\n * state: \"completed\",\n * result: calculateResult()\n * });\n *\n * // Write with a transformation function\n * const write = Channel.writeTo([\"output\"], {\n * result: (x) => processResult(x)\n * });\n * ```\n *\n * @param channels - Array of channel names to write to\n * @param writes - Optional map of channel names to values or transformations\n * @returns A ChannelWrite object that can be used to write to the specified channels\n */\n static writeTo(channels: string[], writes?: Record<string, WriteValue>): ChannelWrite;\n}\nexport type { PregelInputType, PregelOptions, PregelOutputType };\ndeclare class PartialRunnable<RunInput, RunOutput, CallOptions extends RunnableConfig> extends Runnable<RunInput, RunOutput, CallOptions> {\n lc_namespace: string[];\n invoke(_input: RunInput, _options?: Partial<CallOptions>): Promise<any>;\n withConfig(_config: CallOptions): typeof this;\n stream(input: RunInput, options?: Partial<CallOptions>): Promise<IterableReadableStream<any>>;\n}\n/**\n * The Pregel class is the core runtime engine of LangGraph, implementing a message-passing graph computation model\n * inspired by [Google's Pregel system](https://research.google/pubs/pregel-a-system-for-large-scale-graph-processing/).\n * It provides the foundation for building reliable, controllable agent workflows that can evolve state over time.\n *\n * Key features:\n * - Message passing between nodes in discrete \"supersteps\"\n * - Built-in persistence layer through checkpointers\n * - First-class streaming support for values, updates, and events\n * - Human-in-the-loop capabilities via interrupts\n * - Support for parallel node execution within supersteps\n *\n * The Pregel class is not intended to be instantiated directly by consumers. Instead, use the following higher-level APIs:\n * - {@link StateGraph}: The main graph class for building agent workflows\n * - Compiling a {@link StateGraph} will return a {@link CompiledGraph} instance, which extends `Pregel`\n * - Functional API: A declarative approach using tasks and entrypoints\n * - A `Pregel` instance is returned by the {@link entrypoint} function\n *\n * @example\n * ```typescript\n * // Using StateGraph API\n * const graph = new StateGraph(annotation)\n * .addNode(\"nodeA\", myNodeFunction)\n * .addEdge(\"nodeA\", \"nodeB\")\n * .compile();\n *\n * // The compiled graph is a Pregel instance\n * const result = await graph.invoke(input);\n * ```\n *\n * @example\n * ```typescript\n * // Using Functional API\n * import { task, entrypoint } from \"@langchain/langgraph\";\n * import { MemorySaver } from \"@langchain/langgraph-checkpoint\";\n *\n * // Define tasks that can be composed\n * const addOne = task(\"add\", async (x: number) => x + 1);\n *\n * // Create a workflow using the entrypoint function\n * const workflow = entrypoint({\n * name: \"workflow\",\n * checkpointer: new MemorySaver()\n * }, async (numbers: number[]) => {\n * // Tasks can be run in parallel\n * const results = await Promise.all(numbers.map(n => addOne(n)));\n * return results;\n * });\n *\n * // The workflow is a Pregel instance\n * const result = await workflow.invoke([1, 2, 3]); // Returns [2, 3, 4]\n * ```\n *\n * @typeParam Nodes - Mapping of node names to their {@link PregelNode} implementations\n * @typeParam Channels - Mapping of channel names to their {@link BaseChannel} or {@link ManagedValueSpec} implementations\n * @typeParam ContextType - Type of context that can be passed to the graph\n * @typeParam InputType - Type of input values accepted by the graph\n * @typeParam OutputType - Type of output values produced by the graph\n */\nexport declare class Pregel<Nodes extends StrRecord<string, PregelNode>, Channels extends StrRecord<string, BaseChannel>, ContextType extends Record<string, any> = StrRecord<string, any>, InputType = PregelInputType, OutputType = PregelOutputType, StreamUpdatesType = InputType, StreamValuesType = OutputType, NodeReturnType = unknown, CommandType = CommandInstance, StreamCustom = any> extends PartialRunnable<InputType | CommandType | null, OutputType, PregelOptions<Nodes, Channels, ContextType>> implements PregelInterface<Nodes, Channels, ContextType> {\n /**\n * Name of the class when serialized\n * @internal\n */\n static lc_name(): string;\n /** @internal Used for type inference */\n \"~InputType\": InputType;\n /** @internal Used for type inference */\n \"~OutputType\": OutputType;\n /** @internal LangChain namespace for serialization necessary because Pregel extends Runnable */\n lc_namespace: string[];\n /** @internal Flag indicating this is a Pregel instance - necessary for serialization */\n lg_is_pregel: boolean;\n /** The nodes in the graph, mapping node names to their PregelNode instances */\n nodes: Nodes;\n /** The channels in the graph, mapping channel names to their BaseChannel or ManagedValueSpec instances */\n channels: Channels;\n /**\n * The input channels for the graph. These channels receive the initial input when the graph is invoked.\n * Can be a single channel key or an array of channel keys.\n */\n inputChannels: keyof Channels | Array<keyof Channels>;\n /**\n * The output channels for the graph. These channels contain the final output when the graph completes.\n * Can be a single channel key or an array of channel keys.\n */\n outputChannels: keyof Channels | Array<keyof Channels>;\n /** Whether to automatically validate the graph structure when it is compiled. Defaults to true. */\n autoValidate: boolean;\n /**\n * The streaming modes enabled for this graph. Defaults to [\"values\"].\n * Supported modes:\n * - \"values\": Streams the full state after each step\n * - \"updates\": Streams state updates after each step\n * - \"messages\": Streams messages from within nodes\n * - \"custom\": Streams custom events from within nodes\n * - \"debug\": Streams events related to the execution of the graph - useful for tracing & debugging graph execution\n */\n streamMode: StreamMode[];\n /**\n * Optional channels to stream. If not specified, all channels will be streamed.\n * Can be a single channel key or an array of channel keys.\n */\n streamChannels?: keyof Channels | Array<keyof Channels>;\n /**\n * Optional array of node names or \"all\" to interrupt after executing these nodes.\n * Used for implementing human-in-the-loop workflows.\n */\n interruptAfter?: Array<keyof Nodes> | All;\n /**\n * Optional array of node names or \"all\" to interrupt before executing these nodes.\n * Used for implementing human-in-the-loop workflows.\n */\n interruptBefore?: Array<keyof Nodes> | All;\n /** Optional timeout in milliseconds for the execution of each superstep */\n stepTimeout?: number;\n /** Whether to enable debug logging. Defaults to false. */\n debug: boolean;\n /**\n * Optional checkpointer for persisting graph state.\n * When provided, saves a checkpoint of the graph state at every superstep.\n * When false or undefined, checkpointing is disabled, and the graph will not be able to save or restore state.\n */\n checkpointer?: BaseCheckpointSaver | boolean;\n /** Optional retry policy for handling failures in node execution */\n retryPolicy?: RetryPolicy;\n /** The default configuration for graph execution, can be overridden on a per-invocation basis */\n config?: LangGraphRunnableConfig;\n /**\n * Optional long-term memory store for the graph, allows for persistence & retrieval of data across threads\n */\n store?: BaseStore;\n /**\n * Optional cache for the graph, useful for caching tasks.\n */\n cache?: BaseCache;\n /**\n * Optional interrupt helper function.\n * @internal\n */\n private userInterrupt?;\n /**\n * The trigger to node mapping for the graph run.\n * @internal\n */\n private triggerToNodes;\n /**\n * Constructor for Pregel - meant for internal use only.\n *\n * @internal\n */\n constructor(fields: PregelParams<Nodes, Channels>);\n /**\n * Creates a new instance of the Pregel graph with updated configuration.\n * This method follows the immutable pattern - instead of modifying the current instance,\n * it returns a new instance with the merged configuration.\n *\n * @example\n * ```typescript\n * // Create a new instance with debug enabled\n * const debugGraph = graph.withConfig({ debug: true });\n *\n * // Create a new instance with a specific thread ID\n * const threadGraph = graph.withConfig({\n * configurable: { thread_id: \"123\" }\n * });\n * ```\n *\n * @param config - The configuration to merge with the current configuration\n * @returns A new Pregel instance with the merged configuration\n */\n withConfig(config: Omit<LangGraphRunnableConfig, \"store\" | \"writer\" | \"interrupt\">): typeof this;\n /**\n * Validates the graph structure to ensure it is well-formed.\n * Checks for:\n * - No orphaned nodes\n * - Valid input/output channel configurations\n * - Valid interrupt configurations\n *\n * @returns this - The Pregel instance for method chaining\n * @throws {GraphValidationError} If the graph structure is invalid\n */\n validate(): this;\n /**\n * Gets a list of all channels that should be streamed.\n * If streamChannels is specified, returns those channels.\n * Otherwise, returns all channels in the graph.\n *\n * @returns Array of channel keys to stream\n */\n get streamChannelsList(): Array<keyof Channels>;\n /**\n * Gets the channels to stream in their original format.\n * If streamChannels is specified, returns it as-is (either single key or array).\n * Otherwise, returns all channels in the graph as an array.\n *\n * @returns Channel keys to stream, either as a single key or array\n */\n get streamChannelsAsIs(): keyof Channels | Array<keyof Channels>;\n /**\n * Gets a drawable representation of the graph structure.\n * This is an async version of getGraph() and is the preferred method to use.\n *\n * @param config - Configuration for generating the graph visualization\n * @returns A representation of the graph that can be visualized\n */\n getGraphAsync(config: RunnableConfig): Promise<import(\"@langchain/core/runnables/graph\").Graph>;\n /**\n * Gets all subgraphs within this graph.\n * A subgraph is a Pregel instance that is nested within a node of this graph.\n *\n * @deprecated Use getSubgraphsAsync instead. The async method will become the default in the next minor release.\n * @param namespace - Optional namespace to filter subgraphs\n * @param recurse - Whether to recursively get subgraphs of subgraphs\n * @returns Generator yielding tuples of [name, subgraph]\n */\n getSubgraphs(namespace?: string, recurse?: boolean): Generator<[string, Pregel<any, any>]>;\n /**\n * Gets all subgraphs within this graph asynchronously.\n * A subgraph is a Pregel instance that is nested within a node of this graph.\n *\n * @param namespace - Optional namespace to filter subgraphs\n * @param recurse - Whether to recursively get subgraphs of subgraphs\n * @returns AsyncGenerator yielding tuples of [name, subgraph]\n */\n getSubgraphsAsync(namespace?: string, recurse?: boolean): AsyncGenerator<[string, Pregel<any, any>]>;\n /**\n * Prepares a state snapshot from saved checkpoint data.\n * This is an internal method used by getState and getStateHistory.\n *\n * @param config - Configuration for preparing the snapshot\n * @param saved - Optional saved checkpoint data\n * @param subgraphCheckpointer - Optional checkpointer for subgraphs\n * @param applyPendingWrites - Whether to apply pending writes to tasks and then to channels\n * @returns A snapshot of the graph state\n * @internal\n */\n protected _prepareStateSnapshot({ config, saved, subgraphCheckpointer, applyPendingWrites }: {\n config: RunnableConfig;\n saved?: CheckpointTuple;\n subgraphCheckpointer?: BaseCheckpointSaver;\n applyPendingWrites?: boolean;\n }): Promise<StateSnapshot>;\n /**\n * Gets the current state of the graph.\n * Requires a checkpointer to be configured.\n *\n * @param config - Configuration for retrieving the state\n * @param options - Additional options\n * @returns A snapshot of the current graph state\n * @throws {GraphValueError} If no checkpointer is configured\n */\n getState(config: RunnableConfig, options?: GetStateOptions): Promise<StateSnapshot>;\n /**\n * Gets the history of graph states.\n * Requires a checkpointer to be configured.\n * Useful for:\n * - Debugging execution history\n * - Implementing time travel\n * - Analyzing graph behavior\n *\n * @param config - Configuration for retrieving the history\n * @param options - Options for filtering the history\n * @returns An async iterator of state snapshots\n * @throws {Error} If no checkpointer is configured\n */\n getStateHistory(config: RunnableConfig, options?: CheckpointListOptions): AsyncIterableIterator<StateSnapshot>;\n /**\n * Apply updates to the graph state in bulk.\n * Requires a checkpointer to be configured.\n *\n * This method is useful for recreating a thread\n * from a list of updates, especially if a checkpoint\n * is created as a result of multiple tasks.\n *\n * @internal The API might change in the future.\n *\n * @param startConfig - Configuration for the update\n * @param updates - The list of updates to apply to graph state\n * @returns Updated configuration\n * @throws {GraphValueError} If no checkpointer is configured\n * @throws {InvalidUpdateError} If the update cannot be attributed to a node or an update can be only applied in sequence.\n */\n bulkUpdateState(startConfig: LangGraphRunnableConfig, supersteps: Array<{\n updates: Array<{\n values?: Record<string, unknown> | unknown;\n asNode?: keyof Nodes | string;\n }>;\n }>): Promise<RunnableConfig>;\n /**\n * Updates the state of the graph with new values.\n * Requires a checkpointer to be configured.\n *\n * This method can be used for:\n * - Implementing human-in-the-loop workflows\n * - Modifying graph state during breakpoints\n * - Integrating external inputs into the graph\n *\n * @param inputConfig - Configuration for the update\n * @param values - The values to update the state with\n * @param asNode - Optional node name to attribute the update to\n * @returns Updated configuration\n * @throws {GraphValueError} If no checkpointer is configured\n * @throws {InvalidUpdateError} If the update cannot be attributed to a node\n */\n updateState(inputConfig: LangGraphRunnableConfig, values: Record<string, unknown> | unknown, asNode?: keyof Nodes | string): Promise<RunnableConfig>;\n /**\n * Gets the default values for various graph configuration options.\n * This is an internal method used to process and normalize configuration options.\n *\n * @param config - The input configuration options\n * @returns A tuple containing normalized values for:\n * - debug mode\n * - stream modes\n * - input keys\n * - output keys\n * - remaining config\n * - interrupt before nodes\n * - interrupt after nodes\n * - checkpointer\n * - store\n * - whether stream mode is single\n * - node cache\n * - whether checkpoint during is enabled\n * @internal\n */\n _defaults(config: PregelOptions<Nodes, Channels>): [\n boolean,\n StreamMode[],\n string | string[],\n string | string[],\n LangGraphRunnableConfig,\n All | string[],\n All | string[],\n BaseCheckpointSaver | undefined,\n BaseStore | undefined,\n boolean,\n BaseCache | undefined,\n Durability\n ];\n /**\n * Streams the execution of the graph, emitting state updates as they occur.\n * This is the primary method for observing graph execution in real-time.\n *\n * Stream modes:\n * - \"values\": Emits complete state after each step\n * - \"updates\": Emits only state changes after each step\n * - \"debug\": Emits detailed debug information\n * - \"messages\": Emits messages from within nodes\n * - \"custom\": Emits custom events from within nodes\n * - \"checkpoints\": Emits checkpoints from within nodes\n * - \"tasks\": Emits tasks from within nodes\n *\n * @param input - The input to start graph execution with\n * @param options - Configuration options for streaming\n * @returns An async iterable stream of graph state updates\n */\n stream<TStreamMode extends StreamMode | StreamMode[] | undefined, TSubgraphs extends boolean, TEncoding extends \"text/event-stream\" | undefined>(input: InputType | CommandType | null, options?: Partial<PregelOptions<Nodes, Channels, ContextType, TStreamMode, TSubgraphs, TEncoding>>): Promise<IterableReadableStream<StreamOutputMap<TStreamMode, TSubgraphs, StreamUpdatesType, StreamValuesType, keyof Nodes, NodeReturnType, StreamCustom, TEncoding>>>;\n /**\n * @inheritdoc\n */\n streamEvents(input: InputType | CommandType | null, options: Partial<PregelOptions<Nodes, Channels, ContextType>> & {\n version: \"v1\" | \"v2\";\n }, streamOptions?: StreamEventsOptions): IterableReadableStream<StreamEvent>;\n streamEvents(input: InputType | CommandType | null, options: Partial<PregelOptions<Nodes, Channels, ContextType>> & {\n version: \"v1\" | \"v2\";\n encoding: \"text/event-stream\";\n }, streamOptions?: StreamEventsOptions): IterableReadableStream<Uint8Array>;\n /**\n * Validates the input for the graph.\n * @param input - The input to validate\n * @returns The validated input\n * @internal\n */\n protected _validateInput(input: PregelInputType): Promise<any>;\n /**\n * Validates the context options for the graph.\n * @param context - The context options to validate\n * @returns The validated context options\n * @internal\n */\n protected _validateContext(context: Partial<LangGraphRunnableConfig[\"context\"]>): Promise<LangGraphRunnableConfig[\"context\"]>;\n /**\n * Internal iterator used by stream() to generate state updates.\n * This method handles the core logic of graph execution and streaming.\n *\n * @param input - The input to start graph execution with\n * @param options - Configuration options for streaming\n * @returns AsyncGenerator yielding state updates\n * @internal\n */\n _streamIterator(input: PregelInputType | Command, options?: Partial<PregelOptions<Nodes, Channels>>): AsyncGenerator<PregelOutputType>;\n /**\n * Run the graph with a single input and config.\n * @param input The input to the graph.\n * @param options The configuration to use for the run.\n */\n invoke(input: InputType | CommandType | null, options?: Partial<Omit<PregelOptions<Nodes, Channels, ContextType>, \"encoding\">>): Promise<OutputType>;\n private _runLoop;\n clearCache(): Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;;KAYK+B,UAAAA,GAAa/B,WAAWE;KACxB8B,mBAAAA,GAAsBC,WAAWjC;;AAFI;;;;;AACD;AACjB,cAQHkC,OAAAA,CARG;;;;AAQxB;;;;;;;;;;AAwEiE;;;;;;;;SAGzBM,WAAAA,CAAAA,OAAAA,EAAAA,MAAAA,EAAAA,OAAAA,CAAAA,EArDUf,gCAqDVe,CAAAA,EArD6CzB,UAqD7CyB;;;;;;;;;;AA+DxC;;;;;;;;;;;;SAA8V3B,WAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,EAAAA,OAAAA,CAAAA,EA9FzSM,kCA8FySN,CAAAA,EA9FpQE,UA8FoQF;;;;;;;;;;;;;;;;;;;;;;;;;;SAiDzUoC,OAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,EAAAA,MAAAA,CAAAA,EArH2Bd,MAqH3Bc,CAAAA,MAAAA,EArH0ClB,UAqH1CkB,CAAAA,CAAAA,EArHwDnB,YAqHxDmB;;cAlHPb,eAuHQa,CAAAA,QAAAA,EAAAA,SAAAA,EAAAA,oBAvHiDhD,cAuHjDgD,CAAAA,SAvHyEjD,QAuHzEiD,CAvHkFZ,QAuHlFY,EAvH4FX,SAuH5FW,EAvHuGV,WAuHvGU,CAAAA,CAAAA;cAAqB5C,EAAAA,MAAAA,EAAAA;QAUxBE,CAAAA,MAAAA,EA/HA8B,QA+HA9B,EAAAA,QAAAA,CAAAA,EA/HqBiC,OA+HrBjC,CA/H6BgC,WA+H7Bh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AAA,CACE,WAAA,EACA,UAAA,EACA,iBAAA,EACA,gBAAA,QACM,KAAA,EACN,cAAA,EACA,YAAA,EACA,SAAA;EA/IJ;;;EA6KO,YAAA,CACP,KAAA,EAAO,SAAA,GAAY,WAAA,SACnB,OAAA,EAAS,OAAA,CAAQ,aAAA,CAAc,KAAA,EAAO,QAAA,EAAU,WAAA;IAC9C,OAAA;EAAA,GAEF,aAAA,GAAgB,mBAAA,GACf,sBAAA,CAAuB,WAAA;EAEjB,YAAA,CACP,KAAA,EAAO,SAAA,GAAY,WAAA,SACnB,OAAA,EAAS,OAAA,CAAQ,aAAA,CAAc,KAAA,EAAO,QAAA,EAAU,WAAA;IAC9C,OAAA;IACA,QAAA;EAAA,GAEF,aAAA,GAAgB,mBAAA,GACf,sBAAA,CAAuB,UAAA;EAlExB;;;;;;EAAA,UAqGc,cAAA,CAAe,KAAA,EAAO,eAAA,GAAe,OAAA;EA9F/C;;;;;;EAAA,UAwGU,gBAAA,CACd,OAAA,EAAS,OAAA,CAAQ,uBAAA,eAChB,OAAA,CAAQ,uBAAA;EAlGL;;;;;;;;;EA+GU,eAAA,CACd,KAAA,EAAO,eAAA,GAAkB,OAAA,EACzB,OAAA,GAAU,OAAA,CAAQ,aAAA,CAAc,KAAA,EAAO,QAAA,KACtC,cAAA,CAAe,gBAAA;EA7EhB;;;;;EAkTa,MAAA,CACb,KAAA,EAAO,SAAA,GAAY,WAAA,SACnB,OAAA,GAAU,OAAA,CACR,IAAA,CAAK,aAAA,CAAc,KAAA,EAAO,QAAA,EAAU,WAAA,kBAErC,OAAA,CAAQ,UAAA;EAAA,QAwCG,QAAA;EAmER,UAAA,CAAA,GAAc,OAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["Runnable","RunnableConfig","RunnableFunc","StreamEvent","IterableReadableStream","All","BaseCache","BaseCheckpointSaver","BaseStore","CheckpointListOptions","CheckpointTuple","BaseChannel","Command","CommandInstance","StrRecord","PregelNode","LangGraphRunnableConfig","Durability","GetStateOptions","MultipleChannelSubscriptionOptions","PregelInputType","PregelInterface","PregelOptions","PregelOutputType","PregelParams","SingleChannelSubscriptionOptions","StateSnapshot","StreamMode","StreamOutputMap","RetryPolicy","ChannelWrite","WriteValue","StreamEventsOptions","Parameters","Channel","Record","PartialRunnable","RunInput","RunOutput","CallOptions","Partial","Promise","Pregel","InputType","OutputType","CommandType","Nodes","Channels","ContextType","Array","Omit","_langchain_core_runnables_graph0","Graph","Generator","AsyncGenerator","config","saved","subgraphCheckpointer","applyPendingWrites","AsyncIterableIterator","TStreamMode","TSubgraphs","TEncoding","StreamUpdatesType","StreamValuesType","NodeReturnType","StreamCustom","Uint8Array"],"sources":["../../src/pregel/index.d.ts"],"sourcesContent":["import { Runnable, RunnableConfig, RunnableFunc } from \"@langchain/core/runnables\";\nimport type { StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport { All, BaseCache, BaseCheckpointSaver, BaseStore, CheckpointListOptions, CheckpointTuple } from \"@langchain/langgraph-checkpoint\";\nimport { BaseChannel } from \"../channels/base.js\";\nimport { Command, type CommandInstance } from \"../constants.js\";\nimport { StrRecord } from \"./algo.js\";\nimport { PregelNode } from \"./read.js\";\nimport { LangGraphRunnableConfig } from \"./runnable_types.js\";\nimport type { Durability, GetStateOptions, MultipleChannelSubscriptionOptions, PregelInputType, PregelInterface, PregelOptions, PregelOutputType, PregelParams, SingleChannelSubscriptionOptions, StateSnapshot, StreamMode, StreamOutputMap } from \"./types.js\";\nimport { RetryPolicy } from \"./utils/index.js\";\nimport { ChannelWrite } from \"./write.js\";\ntype WriteValue = Runnable | RunnableFunc<unknown, unknown> | unknown;\ntype StreamEventsOptions = Parameters<Runnable[\"streamEvents\"]>[2];\n/**\n * Utility class for working with channels in the Pregel system.\n * Provides static methods for subscribing to channels and writing to them.\n *\n * Channels are the communication pathways between nodes in a Pregel graph.\n * They enable message passing and state updates between different parts of the graph.\n */\nexport declare class Channel {\n /**\n * Creates a PregelNode that subscribes to a single channel.\n * This is used to define how nodes receive input from channels.\n *\n * @example\n * ```typescript\n * // Subscribe to a single channel\n * const node = Channel.subscribeTo(\"messages\");\n *\n * // Subscribe to multiple channels\n * const node = Channel.subscribeTo([\"messages\", \"state\"]);\n *\n * // Subscribe with a custom key\n * const node = Channel.subscribeTo(\"messages\", { key: \"chat\" });\n * ```\n *\n * @param channel Single channel name to subscribe to\n * @param options Subscription options\n * @returns A PregelNode configured to receive from the specified channels\n * @throws {Error} If a key is specified when subscribing to multiple channels\n */\n static subscribeTo(channel: string, options?: SingleChannelSubscriptionOptions): PregelNode;\n /**\n * Creates a PregelNode that subscribes to multiple channels.\n * This is used to define how nodes receive input from channels.\n *\n * @example\n * ```typescript\n * // Subscribe to a single channel\n * const node = Channel.subscribeTo(\"messages\");\n *\n * // Subscribe to multiple channels\n * const node = Channel.subscribeTo([\"messages\", \"state\"]);\n *\n * // Subscribe with a custom key\n * const node = Channel.subscribeTo(\"messages\", { key: \"chat\" });\n * ```\n *\n * @param channels Single channel name to subscribe to\n * @param options Subscription options\n * @returns A PregelNode configured to receive from the specified channels\n * @throws {Error} If a key is specified when subscribing to multiple channels\n */\n static subscribeTo(channels: string[], options?: MultipleChannelSubscriptionOptions): PregelNode;\n /**\n * Creates a ChannelWrite that specifies how to write values to channels.\n * This is used to define how nodes send output to channels.\n *\n * @example\n * ```typescript\n * // Write to multiple channels\n * const write = Channel.writeTo([\"output\", \"state\"]);\n *\n * // Write with specific values\n * const write = Channel.writeTo([\"output\"], {\n * state: \"completed\",\n * result: calculateResult()\n * });\n *\n * // Write with a transformation function\n * const write = Channel.writeTo([\"output\"], {\n * result: (x) => processResult(x)\n * });\n * ```\n *\n * @param channels - Array of channel names to write to\n * @param writes - Optional map of channel names to values or transformations\n * @returns A ChannelWrite object that can be used to write to the specified channels\n */\n static writeTo(channels: string[], writes?: Record<string, WriteValue>): ChannelWrite;\n}\nexport type { PregelInputType, PregelOptions, PregelOutputType };\ndeclare class PartialRunnable<RunInput, RunOutput, CallOptions extends RunnableConfig> extends Runnable<RunInput, RunOutput, CallOptions> {\n lc_namespace: string[];\n invoke(_input: RunInput, _options?: Partial<CallOptions>): Promise<any>;\n withConfig(_config: CallOptions): typeof this;\n stream(input: RunInput, options?: Partial<CallOptions>): Promise<IterableReadableStream<any>>;\n}\n/**\n * The Pregel class is the core runtime engine of LangGraph, implementing a message-passing graph computation model\n * inspired by [Google's Pregel system](https://research.google/pubs/pregel-a-system-for-large-scale-graph-processing/).\n * It provides the foundation for building reliable, controllable agent workflows that can evolve state over time.\n *\n * Key features:\n * - Message passing between nodes in discrete \"supersteps\"\n * - Built-in persistence layer through checkpointers\n * - First-class streaming support for values, updates, and events\n * - Human-in-the-loop capabilities via interrupts\n * - Support for parallel node execution within supersteps\n *\n * The Pregel class is not intended to be instantiated directly by consumers. Instead, use the following higher-level APIs:\n * - {@link StateGraph}: The main graph class for building agent workflows\n * - Compiling a {@link StateGraph} will return a {@link CompiledGraph} instance, which extends `Pregel`\n * - Functional API: A declarative approach using tasks and entrypoints\n * - A `Pregel` instance is returned by the {@link entrypoint} function\n *\n * @example\n * ```typescript\n * // Using StateGraph API\n * const graph = new StateGraph(annotation)\n * .addNode(\"nodeA\", myNodeFunction)\n * .addEdge(\"nodeA\", \"nodeB\")\n * .compile();\n *\n * // The compiled graph is a Pregel instance\n * const result = await graph.invoke(input);\n * ```\n *\n * @example\n * ```typescript\n * // Using Functional API\n * import { task, entrypoint } from \"@langchain/langgraph\";\n * import { MemorySaver } from \"@langchain/langgraph-checkpoint\";\n *\n * // Define tasks that can be composed\n * const addOne = task(\"add\", async (x: number) => x + 1);\n *\n * // Create a workflow using the entrypoint function\n * const workflow = entrypoint({\n * name: \"workflow\",\n * checkpointer: new MemorySaver()\n * }, async (numbers: number[]) => {\n * // Tasks can be run in parallel\n * const results = await Promise.all(numbers.map(n => addOne(n)));\n * return results;\n * });\n *\n * // The workflow is a Pregel instance\n * const result = await workflow.invoke([1, 2, 3]); // Returns [2, 3, 4]\n * ```\n *\n * @typeParam Nodes - Mapping of node names to their {@link PregelNode} implementations\n * @typeParam Channels - Mapping of channel names to their {@link BaseChannel} or {@link ManagedValueSpec} implementations\n * @typeParam ContextType - Type of context that can be passed to the graph\n * @typeParam InputType - Type of input values accepted by the graph\n * @typeParam OutputType - Type of output values produced by the graph\n */\nexport declare class Pregel<Nodes extends StrRecord<string, PregelNode>, Channels extends StrRecord<string, BaseChannel>, ContextType extends Record<string, any> = StrRecord<string, any>, InputType = PregelInputType, OutputType = PregelOutputType, StreamUpdatesType = InputType, StreamValuesType = OutputType, NodeReturnType = unknown, CommandType = CommandInstance, StreamCustom = any> extends PartialRunnable<InputType | CommandType | null, OutputType, PregelOptions<Nodes, Channels, ContextType>> implements PregelInterface<Nodes, Channels, ContextType> {\n /**\n * Name of the class when serialized\n * @internal\n */\n static lc_name(): string;\n /** @internal Used for type inference */\n \"~InputType\": InputType;\n /** @internal Used for type inference */\n \"~OutputType\": OutputType;\n /** @internal LangChain namespace for serialization necessary because Pregel extends Runnable */\n lc_namespace: string[];\n /** @internal Flag indicating this is a Pregel instance - necessary for serialization */\n lg_is_pregel: boolean;\n /** The nodes in the graph, mapping node names to their PregelNode instances */\n nodes: Nodes;\n /** The channels in the graph, mapping channel names to their BaseChannel or ManagedValueSpec instances */\n channels: Channels;\n /**\n * The input channels for the graph. These channels receive the initial input when the graph is invoked.\n * Can be a single channel key or an array of channel keys.\n */\n inputChannels: keyof Channels | Array<keyof Channels>;\n /**\n * The output channels for the graph. These channels contain the final output when the graph completes.\n * Can be a single channel key or an array of channel keys.\n */\n outputChannels: keyof Channels | Array<keyof Channels>;\n /** Whether to automatically validate the graph structure when it is compiled. Defaults to true. */\n autoValidate: boolean;\n /**\n * The streaming modes enabled for this graph. Defaults to [\"values\"].\n * Supported modes:\n * - \"values\": Streams the full state after each step\n * - \"updates\": Streams state updates after each step\n * - \"messages\": Streams messages from within nodes\n * - \"custom\": Streams custom events from within nodes\n * - \"debug\": Streams events related to the execution of the graph - useful for tracing & debugging graph execution\n */\n streamMode: StreamMode[];\n /**\n * Optional channels to stream. If not specified, all channels will be streamed.\n * Can be a single channel key or an array of channel keys.\n */\n streamChannels?: keyof Channels | Array<keyof Channels>;\n /**\n * Optional array of node names or \"all\" to interrupt after executing these nodes.\n * Used for implementing human-in-the-loop workflows.\n */\n interruptAfter?: Array<keyof Nodes> | All;\n /**\n * Optional array of node names or \"all\" to interrupt before executing these nodes.\n * Used for implementing human-in-the-loop workflows.\n */\n interruptBefore?: Array<keyof Nodes> | All;\n /** Optional timeout in milliseconds for the execution of each superstep */\n stepTimeout?: number;\n /** Whether to enable debug logging. Defaults to false. */\n debug: boolean;\n /**\n * Optional checkpointer for persisting graph state.\n * When provided, saves a checkpoint of the graph state at every superstep.\n * When false or undefined, checkpointing is disabled, and the graph will not be able to save or restore state.\n */\n checkpointer?: BaseCheckpointSaver | boolean;\n /** Optional retry policy for handling failures in node execution */\n retryPolicy?: RetryPolicy;\n /** The default configuration for graph execution, can be overridden on a per-invocation basis */\n config?: LangGraphRunnableConfig;\n /**\n * Optional long-term memory store for the graph, allows for persistence & retrieval of data across threads\n */\n store?: BaseStore;\n /**\n * Optional cache for the graph, useful for caching tasks.\n */\n cache?: BaseCache;\n /**\n * Optional interrupt helper function.\n * @internal\n */\n private userInterrupt?;\n /**\n * The trigger to node mapping for the graph run.\n * @internal\n */\n private triggerToNodes;\n /**\n * Constructor for Pregel - meant for internal use only.\n *\n * @internal\n */\n constructor(fields: PregelParams<Nodes, Channels>);\n /**\n * Creates a new instance of the Pregel graph with updated configuration.\n * This method follows the immutable pattern - instead of modifying the current instance,\n * it returns a new instance with the merged configuration.\n *\n * @example\n * ```typescript\n * // Create a new instance with debug enabled\n * const debugGraph = graph.withConfig({ debug: true });\n *\n * // Create a new instance with a specific thread ID\n * const threadGraph = graph.withConfig({\n * configurable: { thread_id: \"123\" }\n * });\n * ```\n *\n * @param config - The configuration to merge with the current configuration\n * @returns A new Pregel instance with the merged configuration\n */\n withConfig(config: Omit<LangGraphRunnableConfig, \"store\" | \"writer\" | \"interrupt\">): typeof this;\n /**\n * Validates the graph structure to ensure it is well-formed.\n * Checks for:\n * - No orphaned nodes\n * - Valid input/output channel configurations\n * - Valid interrupt configurations\n *\n * @returns this - The Pregel instance for method chaining\n * @throws {GraphValidationError} If the graph structure is invalid\n */\n validate(): this;\n /**\n * Gets a list of all channels that should be streamed.\n * If streamChannels is specified, returns those channels.\n * Otherwise, returns all channels in the graph.\n *\n * @returns Array of channel keys to stream\n */\n get streamChannelsList(): Array<keyof Channels>;\n /**\n * Gets the channels to stream in their original format.\n * If streamChannels is specified, returns it as-is (either single key or array).\n * Otherwise, returns all channels in the graph as an array.\n *\n * @returns Channel keys to stream, either as a single key or array\n */\n get streamChannelsAsIs(): keyof Channels | Array<keyof Channels>;\n /**\n * Gets a drawable representation of the graph structure.\n * This is an async version of getGraph() and is the preferred method to use.\n *\n * @param config - Configuration for generating the graph visualization\n * @returns A representation of the graph that can be visualized\n */\n getGraphAsync(config: RunnableConfig): Promise<import(\"@langchain/core/runnables/graph\").Graph>;\n /**\n * Gets all subgraphs within this graph.\n * A subgraph is a Pregel instance that is nested within a node of this graph.\n *\n * @deprecated Use getSubgraphsAsync instead. The async method will become the default in the next minor release.\n * @param namespace - Optional namespace to filter subgraphs\n * @param recurse - Whether to recursively get subgraphs of subgraphs\n * @returns Generator yielding tuples of [name, subgraph]\n */\n getSubgraphs(namespace?: string, recurse?: boolean): Generator<[string, Pregel<any, any>]>;\n /**\n * Gets all subgraphs within this graph asynchronously.\n * A subgraph is a Pregel instance that is nested within a node of this graph.\n *\n * @param namespace - Optional namespace to filter subgraphs\n * @param recurse - Whether to recursively get subgraphs of subgraphs\n * @returns AsyncGenerator yielding tuples of [name, subgraph]\n */\n getSubgraphsAsync(namespace?: string, recurse?: boolean): AsyncGenerator<[string, Pregel<any, any>]>;\n /**\n * Prepares a state snapshot from saved checkpoint data.\n * This is an internal method used by getState and getStateHistory.\n *\n * @param config - Configuration for preparing the snapshot\n * @param saved - Optional saved checkpoint data\n * @param subgraphCheckpointer - Optional checkpointer for subgraphs\n * @param applyPendingWrites - Whether to apply pending writes to tasks and then to channels\n * @returns A snapshot of the graph state\n * @internal\n */\n protected _prepareStateSnapshot({ config, saved, subgraphCheckpointer, applyPendingWrites }: {\n config: RunnableConfig;\n saved?: CheckpointTuple;\n subgraphCheckpointer?: BaseCheckpointSaver;\n applyPendingWrites?: boolean;\n }): Promise<StateSnapshot>;\n /**\n * Gets the current state of the graph.\n * Requires a checkpointer to be configured.\n *\n * @param config - Configuration for retrieving the state\n * @param options - Additional options\n * @returns A snapshot of the current graph state\n * @throws {GraphValueError} If no checkpointer is configured\n */\n getState(config: RunnableConfig, options?: GetStateOptions): Promise<StateSnapshot>;\n /**\n * Gets the history of graph states.\n * Requires a checkpointer to be configured.\n * Useful for:\n * - Debugging execution history\n * - Implementing time travel\n * - Analyzing graph behavior\n *\n * @param config - Configuration for retrieving the history\n * @param options - Options for filtering the history\n * @returns An async iterator of state snapshots\n * @throws {Error} If no checkpointer is configured\n */\n getStateHistory(config: RunnableConfig, options?: CheckpointListOptions): AsyncIterableIterator<StateSnapshot>;\n /**\n * Apply updates to the graph state in bulk.\n * Requires a checkpointer to be configured.\n *\n * This method is useful for recreating a thread\n * from a list of updates, especially if a checkpoint\n * is created as a result of multiple tasks.\n *\n * @internal The API might change in the future.\n *\n * @param startConfig - Configuration for the update\n * @param updates - The list of updates to apply to graph state\n * @returns Updated configuration\n * @throws {GraphValueError} If no checkpointer is configured\n * @throws {InvalidUpdateError} If the update cannot be attributed to a node or an update can be only applied in sequence.\n */\n bulkUpdateState(startConfig: LangGraphRunnableConfig, supersteps: Array<{\n updates: Array<{\n values?: Record<string, unknown> | unknown;\n asNode?: keyof Nodes | string;\n }>;\n }>): Promise<RunnableConfig>;\n /**\n * Updates the state of the graph with new values.\n * Requires a checkpointer to be configured.\n *\n * This method can be used for:\n * - Implementing human-in-the-loop workflows\n * - Modifying graph state during breakpoints\n * - Integrating external inputs into the graph\n *\n * @param inputConfig - Configuration for the update\n * @param values - The values to update the state with\n * @param asNode - Optional node name to attribute the update to\n * @returns Updated configuration\n * @throws {GraphValueError} If no checkpointer is configured\n * @throws {InvalidUpdateError} If the update cannot be attributed to a node\n */\n updateState(inputConfig: LangGraphRunnableConfig, values: Record<string, unknown> | unknown, asNode?: keyof Nodes | string): Promise<RunnableConfig>;\n /**\n * Gets the default values for various graph configuration options.\n * This is an internal method used to process and normalize configuration options.\n *\n * @param config - The input configuration options\n * @returns A tuple containing normalized values for:\n * - debug mode\n * - stream modes\n * - input keys\n * - output keys\n * - remaining config\n * - interrupt before nodes\n * - interrupt after nodes\n * - checkpointer\n * - store\n * - whether stream mode is single\n * - node cache\n * - whether checkpoint during is enabled\n * @internal\n */\n _defaults(config: PregelOptions<Nodes, Channels>): [\n boolean,\n StreamMode[],\n string | string[],\n string | string[],\n LangGraphRunnableConfig,\n All | string[],\n All | string[],\n BaseCheckpointSaver | undefined,\n BaseStore | undefined,\n boolean,\n BaseCache | undefined,\n Durability\n ];\n /**\n * Streams the execution of the graph, emitting state updates as they occur.\n * This is the primary method for observing graph execution in real-time.\n *\n * Stream modes:\n * - \"values\": Emits complete state after each step\n * - \"updates\": Emits only state changes after each step\n * - \"debug\": Emits detailed debug information\n * - \"messages\": Emits messages from within nodes\n * - \"custom\": Emits custom events from within nodes\n * - \"checkpoints\": Emits checkpoints from within nodes\n * - \"tasks\": Emits tasks from within nodes\n *\n * @param input - The input to start graph execution with\n * @param options - Configuration options for streaming\n * @returns An async iterable stream of graph state updates\n */\n stream<TStreamMode extends StreamMode | StreamMode[] | undefined, TSubgraphs extends boolean, TEncoding extends \"text/event-stream\" | undefined>(input: InputType | CommandType | null, options?: Partial<PregelOptions<Nodes, Channels, ContextType, TStreamMode, TSubgraphs, TEncoding>>): Promise<IterableReadableStream<StreamOutputMap<TStreamMode, TSubgraphs, StreamUpdatesType, StreamValuesType, keyof Nodes, NodeReturnType, StreamCustom, TEncoding>>>;\n /**\n * @inheritdoc\n */\n streamEvents(input: InputType | CommandType | null, options: Partial<PregelOptions<Nodes, Channels, ContextType>> & {\n version: \"v1\" | \"v2\";\n }, streamOptions?: StreamEventsOptions): IterableReadableStream<StreamEvent>;\n streamEvents(input: InputType | CommandType | null, options: Partial<PregelOptions<Nodes, Channels, ContextType>> & {\n version: \"v1\" | \"v2\";\n encoding: \"text/event-stream\";\n }, streamOptions?: StreamEventsOptions): IterableReadableStream<Uint8Array>;\n /**\n * Validates the input for the graph.\n * @param input - The input to validate\n * @returns The validated input\n * @internal\n */\n protected _validateInput(input: PregelInputType): Promise<any>;\n /**\n * Validates the context options for the graph.\n * @param context - The context options to validate\n * @returns The validated context options\n * @internal\n */\n protected _validateContext(context: Partial<LangGraphRunnableConfig[\"context\"]>): Promise<LangGraphRunnableConfig[\"context\"]>;\n /**\n * Internal iterator used by stream() to generate state updates.\n * This method handles the core logic of graph execution and streaming.\n *\n * @param input - The input to start graph execution with\n * @param options - Configuration options for streaming\n * @returns AsyncGenerator yielding state updates\n * @internal\n */\n _streamIterator(input: PregelInputType | Command, options?: Partial<PregelOptions<Nodes, Channels>>): AsyncGenerator<PregelOutputType>;\n /**\n * Run the graph with a single input and config.\n * @param input The input to the graph.\n * @param options The configuration to use for the run.\n */\n invoke(input: InputType | CommandType | null, options?: Partial<Omit<PregelOptions<Nodes, Channels, ContextType>, \"encoding\">>): Promise<OutputType>;\n private _runLoop;\n clearCache(): Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;;KAYK+B,UAAAA,GAAa/B,WAAWE;KACxB8B,mBAAAA,GAAsBC,WAAWjC;;AAFI;;;;;AACD;AACjB,cAQHkC,OAAAA,CARG;;;;AAQxB;;;;;;;;;;AAwEiE;;;;;;;;SAGzBM,WAAAA,CAAAA,OAAAA,EAAAA,MAAAA,EAAAA,OAAAA,CAAAA,EArDUf,gCAqDVe,CAAAA,EArD6Cz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A,GAAe,OAAA;EA9F/C;;;;;;EAAA,UAwGU,gBAAA,CACd,OAAA,EAAS,OAAA,CAAQ,uBAAA,eAChB,OAAA,CAAQ,uBAAA;EAlGL;;;;;;;;;EA+GU,eAAA,CACd,KAAA,EAAO,eAAA,GAAkB,OAAA,EACzB,OAAA,GAAU,OAAA,CAAQ,aAAA,CAAc,KAAA,EAAO,QAAA,KACtC,cAAA,CAAe,gBAAA;EA7EhB;;;;;EAkTa,MAAA,CACb,KAAA,EAAO,SAAA,GAAY,WAAA,SACnB,OAAA,GAAU,OAAA,CACR,IAAA,CAAK,aAAA,CAAc,KAAA,EAAO,QAAA,EAAU,WAAA,kBAErC,OAAA,CAAQ,UAAA;EAAA,QAwCG,QAAA;EAmER,UAAA,CAAA,GAAc,OAAA;AAAA"}
@@ -2,7 +2,6 @@ import { CachePolicy, RetryPolicy } from "./utils/index.cjs";
2
2
  import { Runnable, RunnableBinding, RunnableBindingArgs, RunnableConfig, RunnableLike } from "@langchain/core/runnables";
3
3
 
4
4
  //#region src/pregel/read.d.ts
5
-
6
5
  interface PregelNodeArgs<RunInput, RunOutput> extends Partial<RunnableBindingArgs<RunInput, RunOutput>> {
7
6
  channels: Record<string, string> | string[];
8
7
  triggers: Array<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"read.d.cts","names":["Runnable","RunnableBinding","RunnableBindingArgs","RunnableConfig","RunnableLike","RunnableCallable","CachePolicy","RetryPolicy","ChannelRead","Array","T","PregelNodeArgs","RunInput","RunOutput","Record","Partial","PregelNodeInputType","PregelNodeOutputType","PregelNode","NewRunOutput","Error","Exclude"],"sources":["../../src/pregel/read.d.ts"],"sourcesContent":["import { Runnable, RunnableBinding, RunnableBindingArgs, RunnableConfig, type RunnableLike } from \"@langchain/core/runnables\";\nimport { RunnableCallable } from \"../utils.js\";\nimport type { CachePolicy, RetryPolicy } from \"./utils/index.js\";\nexport declare class ChannelRead<RunInput = any> extends RunnableCallable {\n lc_graph_name: string;\n channel: string | Array<string>;\n fresh: boolean;\n mapper?: (args: any) => any;\n constructor(channel: string | Array<string>, mapper?: (args: any) => any, fresh?: boolean);\n static doRead<T = unknown>(config: RunnableConfig, channel: string | Array<string>, fresh: boolean, mapper?: (args: unknown) => unknown): T;\n}\ninterface PregelNodeArgs<RunInput, RunOutput> extends Partial<RunnableBindingArgs<RunInput, RunOutput>> {\n channels: Record<string, string> | string[];\n triggers: Array<string>;\n mapper?: (args: any) => any;\n writers?: Runnable<RunOutput, unknown>[];\n tags?: string[];\n bound?: Runnable<RunInput, RunOutput>;\n kwargs?: Record<string, any>;\n config?: RunnableConfig;\n metadata?: Record<string, unknown>;\n retryPolicy?: RetryPolicy;\n cachePolicy?: CachePolicy;\n subgraphs?: Runnable[];\n ends?: string[];\n}\nexport type PregelNodeInputType = any;\nexport type PregelNodeOutputType = any;\nexport declare class PregelNode<RunInput = PregelNodeInputType, RunOutput = PregelNodeOutputType> extends RunnableBinding<RunInput, RunOutput, RunnableConfig> {\n lc_graph_name: string;\n channels: Record<string, string> | string[];\n triggers: string[];\n mapper?: (args: any) => any;\n writers: Runnable[];\n bound: Runnable<RunInput, RunOutput>;\n kwargs: Record<string, any>;\n metadata: Record<string, unknown>;\n tags: string[];\n retryPolicy?: RetryPolicy;\n cachePolicy?: CachePolicy;\n subgraphs?: Runnable[];\n ends?: string[];\n constructor(fields: PregelNodeArgs<RunInput, RunOutput>);\n getWriters(): Array<Runnable>;\n getNode(): Runnable<RunInput, RunOutput> | undefined;\n join(channels: Array<string>): PregelNode<RunInput, RunOutput>;\n pipe<NewRunOutput>(coerceable: RunnableLike): PregelNode<RunInput, Exclude<NewRunOutput, Error>>;\n}\nexport {};\n"],"mappings":";;;;;UAWUW,cAIaE,CAAAA,QAAAA,EAAAA,SAAAA,CAAAA,SAJ+BE,OAI/BF,CAJuCX,mBAIvCW,CAJ2DD,QAI3DC,EAJqEA,SAIrEA,CAAAA,CAAAA,CAAAA;UAATb,EAHAc,MAGAd,CAAAA,MAAAA,EAAAA,M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BAAA,cACC,oBAAA,UACJ,eAAA,CAAgB,QAAA,EAAU,SAAA,EAAW,cAAA;EAC7C,aAAA;EAEA,QAAA,EAAU,MAAA;EAEV,QAAA;EAGA,MAAA,IAAU,IAAA;EAEV,OAAA,EAAS,QAAA;EAET,KAAA,EAAO,QAAA,CAAS,QAAA,EAAU,SAAA;EAG1B,MAAA,EAAQ,MAAA;EAER,QAAA,EAAU,MAAA;EAEV,IAAA;EAEA,WAAA,GAAc,WAAA;EAEd,WAAA,GAAc,WAAA;EAEd,SAAA,GAAY,QAAA;EAEZ,IAAA;EAEA,WAAA,CAAY,MAAA,EAAQ,cAAA,CAAe,QAAA,EAAU,SAAA;EA6C7C,UAAA,CAAA,GAAc,KAAA,CAAM,QAAA;EAsBpB,OAAA,CAAA,GAAW,QAAA,CAAS,QAAA,EAAU,SAAA;EAyB9B,IAAA,CAAK,QAAA,EAAU,KAAA,WAAgB,UAAA,CAAW,QAAA,EAAU,SAAA;EAwBpD,IAAA,cAAA,CACE,UAAA,EAAY,YAAA,GACX,UAAA,CAAW,QAAA,EAAU,OAAA,CAAQ,YAAA,EAAc,KAAA;AAAA"}
@@ -1,8 +1,8 @@
1
+ import "../utils.js";
1
2
  import { CachePolicy, RetryPolicy } from "./utils/index.js";
2
3
  import { Runnable, RunnableBinding, RunnableBindingArgs, RunnableConfig, RunnableLike } from "@langchain/core/runnables";
3
4
 
4
5
  //#region src/pregel/read.d.ts
5
-
6
6
  interface PregelNodeArgs<RunInput, RunOutput> extends Partial<RunnableBindingArgs<RunInput, RunOutput>> {
7
7
  channels: Record<string, string> | string[];
8
8
  triggers: Array<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"read.d.ts","names":["Runnable","RunnableBinding","RunnableBindingArgs","RunnableConfig","RunnableLike","RunnableCallable","CachePolicy","RetryPolicy","ChannelRead","Array","T","PregelNodeArgs","RunInput","RunOutput","Record","Partial","PregelNodeInputType","PregelNodeOutputType","PregelNode","NewRunOutput","Error","Exclude"],"sources":["../../src/pregel/read.d.ts"],"sourcesContent":["import { Runnable, RunnableBinding, RunnableBindingArgs, RunnableConfig, type RunnableLike } from \"@langchain/core/runnables\";\nimport { RunnableCallable } from \"../utils.js\";\nimport type { CachePolicy, RetryPolicy } from \"./utils/index.js\";\nexport declare class ChannelRead<RunInput = any> extends RunnableCallable {\n lc_graph_name: string;\n channel: string | Array<string>;\n fresh: boolean;\n mapper?: (args: any) => any;\n constructor(channel: string | Array<string>, mapper?: (args: any) => any, fresh?: boolean);\n static doRead<T = unknown>(config: RunnableConfig, channel: string | Array<string>, fresh: boolean, mapper?: (args: unknown) => unknown): T;\n}\ninterface PregelNodeArgs<RunInput, RunOutput> extends Partial<RunnableBindingArgs<RunInput, RunOutput>> {\n channels: Record<string, string> | string[];\n triggers: Array<string>;\n mapper?: (args: any) => any;\n writers?: Runnable<RunOutput, unknown>[];\n tags?: string[];\n bound?: Runnable<RunInput, RunOutput>;\n kwargs?: Record<string, any>;\n config?: RunnableConfig;\n metadata?: Record<string, unknown>;\n retryPolicy?: RetryPolicy;\n cachePolicy?: CachePolicy;\n subgraphs?: Runnable[];\n ends?: string[];\n}\nexport type PregelNodeInputType = any;\nexport type PregelNodeOutputType = any;\nexport declare class PregelNode<RunInput = PregelNodeInputType, RunOutput = PregelNodeOutputType> extends RunnableBinding<RunInput, RunOutput, RunnableConfig> {\n lc_graph_name: string;\n channels: Record<string, string> | string[];\n triggers: string[];\n mapper?: (args: any) => any;\n writers: Runnable[];\n bound: Runnable<RunInput, RunOutput>;\n kwargs: Record<string, any>;\n metadata: Record<string, unknown>;\n tags: string[];\n retryPolicy?: RetryPolicy;\n cachePolicy?: CachePolicy;\n subgraphs?: Runnable[];\n ends?: string[];\n constructor(fields: PregelNodeArgs<RunInput, RunOutput>);\n getWriters(): Array<Runnable>;\n getNode(): Runnable<RunInput, RunOutput> | undefined;\n join(channels: Array<string>): PregelNode<RunInput, RunOutput>;\n pipe<NewRunOutput>(coerceable: RunnableLike): PregelNode<RunInput, Ex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A,EAAU,SAAA;EAE3B,MAAA,GAAS,MAAA;EACT,MAAA,GAAS,cAAA;EACT,QAAA,GAAW,MAAA;EACX,WAAA,GAAc,WAAA;EACd,WAAA,GAAc,WAAA;EACd,SAAA,GAAY,QAAA;EACZ,IAAA;AAAA;AAAA,KAIU,mBAAA;AAAA,KAGA,oBAAA;AAAA,cAEC,UAAA,YACA,mBAAA,cACC,oBAAA,UACJ,eAAA,CAAgB,QAAA,EAAU,SAAA,EAAW,cAAA;EAC7C,aAAA;EAEA,QAAA,EAAU,MAAA;EAEV,QAAA;EAGA,MAAA,IAAU,IAAA;EAEV,OAAA,EAAS,QAAA;EAET,KAAA,EAAO,QAAA,CAAS,QAAA,EAAU,SAAA;EAG1B,MAAA,EAAQ,MAAA;EAER,QAAA,EAAU,MAAA;EAEV,IAAA;EAEA,WAAA,GAAc,WAAA;EAEd,WAAA,GAAc,WAAA;EAEd,SAAA,GAAY,QAAA;EAEZ,IAAA;EAEA,WAAA,CAAY,MAAA,EAAQ,cAAA,CAAe,QAAA,EAAU,SAAA;EA6C7C,UAAA,CAAA,GAAc,KAAA,CAAM,QAAA;EAsBpB,OAAA,CAAA,GAAW,QAAA,CAAS,QAAA,EAAU,SAAA;EAyB9B,IAAA,CAAK,QAAA,EAAU,KAAA,WAAgB,UAAA,CAAW,QAAA,EAAU,SAAA;EAwBpD,IAAA,cAAA,CACE,UAAA,EAAY,YAAA,GACX,UAAA,CAAW,QAAA,EAAU,OAAA,CAAQ,YAAA,EAAc,KAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"remote.d.cts","names":["Client","Checkpoint","ThreadState","Graph","DrawableGraph","Node","DrawableNode","Runnable","RunnableConfig","All","CheckpointListOptions","StreamEvent","IterableReadableStream","BaseChannel","LangGraphRunnableConfig","StrRecord","PregelInputType","PregelOptions","PregelOutputType","PregelNode","PregelParams","PregelInterface","StateSnapshot","RemoteGraphParams","Omit","Record","RemoteGraph","Nn","Cc","ContextType","Array","Partial","Promise","AsyncGenerator","AsyncIterableIterator","Generator"],"sources":["../../src/pregel/remote.d.ts"],"sourcesContent":["import { Client, type Checkpoint, type ThreadState } from \"@langchain/langgraph-sdk\";\nimport { Graph as DrawableGraph, Node as DrawableNode } from \"@langchain/core/runnables/graph\";\nimport { Runnable, RunnableConfig } from \"@langchain/core/runnables\";\nimport { All, CheckpointListOptions } from \"@langchain/langgraph-checkpoint\";\nimport { StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport { BaseChannel, LangGraphRunnableConfig } from \"../web.js\";\nimport { StrRecord } from \"./algo.js\";\nimport { PregelInputType, PregelOptions, PregelOutputType } from \"./index.js\";\nimport { PregelNode } from \"./read.js\";\nimport { PregelParams, PregelInterface, StateSnapshot } from \"./types.js\";\nexport type RemoteGraphParams = Omit<PregelParams<StrRecord<string, PregelNode>, StrRecord<string, BaseChannel>>, \"channels\" | \"nodes\" | \"inputChannels\" | \"outputChannels\"> & {\n graphId: string;\n client?: Client;\n url?: string;\n apiKey?: string;\n headers?: Record<string, string>;\n streamResumable?: boolean;\n};\n/**\n * The `RemoteGraph` class is a client implementation for calling remote\n * APIs that implement the LangGraph Server API specification.\n *\n * For example, the `RemoteGraph` class can be used to call APIs from deployments\n * on LangSmith Deployment.\n *\n * `RemoteGraph` behaves the same way as a `StateGraph` and can be used directly as\n * a node in another `StateGraph`.\n *\n * @example\n * ```ts\n * import { RemoteGraph } from \"@langchain/langgraph/remote\";\n *\n * // Can also pass a LangGraph SDK client instance directly\n * const remoteGraph = new RemoteGraph({\n * graphId: process.env.LANGGRAPH_REMOTE_GRAPH_ID!,\n * apiKey: process.env.LANGGRAPH_REMOTE_GRAPH_API_KEY,\n * url: process.env.LANGGRAPH_REMOTE_GRAPH_API_URL,\n * });\n *\n * const input = {\n * messages: [\n * {\n * role: \"human\",\n * content: \"Hello world!\",\n * },\n * ],\n * };\n *\n * const config = {\n * configurable: { thread_id: \"threadId1\" },\n * };\n *\n * await remoteGraph.invoke(input, config);\n * ```\n */\nexport declare class RemoteGraph<Nn extends StrRecord<string, PregelNode> = StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel> = StrRecord<string, BaseChannel>, ContextType extends Record<string, any> = StrRecord<string, any>> extends Runnable<PregelInputType, PregelOutputType, PregelOptions<Nn, Cc, ContextType>> implements PregelInterface<Nn, Cc, ContextType> {\n static lc_name(): string;\n lc_namespace: string[];\n lg_is_pregel: boolean;\n config?: RunnableConfig;\n graphId: string;\n protected client: Client;\n protected interruptBefore?: Array<keyof Nn> | All;\n protected interruptAfter?: Array<keyof Nn> | All;\n protected streamResumable?: boolean;\n constructor(params: RemoteGraphParams);\n withConfig(config: RunnableConfig): typeof this;\n protected _sanitizeConfig(config: RunnableConfig): {\n tags: string[];\n metadata: Record<string, unknown>;\n configurable: {\n [k: string]: any;\n };\n recursion_limit: number | undefined;\n };\n protected _getConfig(checkpoint: Record<string, unknown>): RunnableConfig;\n protected _getCheckpoint(config?: RunnableConfig): Checkpoint | undefined;\n protected _createStateSnapshot(state: ThreadState): StateSnapshot;\n invoke(input: PregelInputType, options?: Partial<PregelOptions<Nn, Cc, ContextType>>): Promise<PregelOutputType>;\n streamEvents(input: PregelInputType, options: Partial<PregelOptions<Nn, Cc, ContextType>> & {\n version: \"v1\" | \"v2\";\n }): IterableReadableStream<StreamEvent>;\n streamEvents(input: PregelInputType, options: Partial<PregelOptions<Nn, Cc, ContextType>> & {\n version: \"v1\" | \"v2\";\n encoding: never;\n }): IterableReadableStream<never>;\n _streamIterator(input: PregelInputType, options?: Partial<PregelOptions<Nn, Cc, ContextType>>): AsyncGenerator<PregelOutputType>;\n updateState(inputConfig: LangGraphRunnableConfig, values: Record<string, unknown>, asNode?: string): Promise<RunnableConfig>;\n getStateHistory(config: RunnableConfig, options?: CheckpointListOptions): AsyncIterableIterator<StateSnapshot>;\n protected _getDrawableNodes(nodes: Array<{\n id: string | number;\n name?: string;\n data?: Record<string, any> | string;\n metadata?: unknown;\n }>): Record<string, DrawableNode>;\n getState(config: RunnableConfig, options?: {\n subgraphs?: boolean;\n }): Promise<StateSnapshot>;\n /** @deprecated Use getGraphAsync instead. The async method will become the default in the next minor release. */\n getGraph(_?: RunnableConfig & {\n xray?: boolean | number;\n }): DrawableGraph;\n /**\n * Returns a drawable representation of the computation graph.\n */\n getGraphAsync(config?: RunnableConfig & {\n xray?: boolean | number;\n }): Promise<DrawableGraph>;\n /** @deprecated Use getSubgraphsAsync instead. The async method will become the default in the next minor release. */\n getSubgraphs(): Generator<[string, PregelInterface<Nn, Cc, ContextType>]>;\n getSubgraphsAsync(namespace?: string, recurse?: boolean): AsyncGenerator<[string, PregelInterface<Nn, Cc, ContextType>]>;\n}\n"],"mappings":";;;;;;;;;;;;;KAWYuB,iBAAAA,GAAoBC,KAAKJ,aAAaL,kBAAkBI,aAAaJ,kBAAkBF;;EAAvFU,MAAAA,CAAAA,EAECvB,MAFDuB;EAAiB,GAAA,CAAA,EAAA,MAAA;QAAuCJ,CAAAA,EAAAA,MAAAA;SAAlBJ,CAAAA,EAKpCU,MALoCV,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;iBAAiDF,CAAAA,EAAAA,OAAAA;;;;;;;AA6CnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAckBY,cAdGC,WAcHD,CAAAA,WAd0BV,SAc1BU,CAAAA,MAAAA,EAd4CN,UAc5CM,CAAAA,GAd0DV,SAc1DU,CAAAA,MAAAA,EAd4EN,UAc5EM,CAAAA,EAAAA,WAdoGV,SAcpGU,CAAAA,MAAAA,EAdsHZ,WActHY,CAAAA,GAdqIV,SAcrIU,CAAAA,MAAAA,EAduJZ,WAcvJY,CAAAA,EAAAA,oBAdyLA,MAczLA,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAd+MV,SAc/MU,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,SAd+OlB,QAc/OkB,CAdwPT,eAcxPS,EAdyQP,gBAczQO,E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AAI,EAAA,EAAI,WAAA;IACrC,OAAA;EAAA,IAED,sBAAA,CAAuB,WAAA;EAEjB,YAAA,CACP,KAAA,EAAO,eAAA,EACP,OAAA,EAAS,OAAA,CAAQ,aAAA,CAAc,EAAA,EAAI,EAAA,EAAI,WAAA;IACrC,OAAA;IACA,QAAA;EAAA,IAED,sBAAA;EAYa,eAAA,CACd,KAAA,EAAO,eAAA,EACP,OAAA,GAAU,OAAA,CAAQ,aAAA,CAAc,EAAA,EAAI,EAAA,EAAI,WAAA,KACvC,cAAA,CAAe,gBAAA;EAmHZ,WAAA,CACJ,WAAA,EAAa,uBAAA,EACb,MAAA,EAAQ,MAAA,mBACR,MAAA,YACC,OAAA,CAAQ,cAAA;EAWJ,eAAA,CACL,MAAA,EAAQ,cAAA,EACR,OAAA,GAAU,qBAAA,GACT,qBAAA,CAAsB,aAAA;EAAA,UAkBf,iBAAA,CACR,KAAA,EAAO,KAAA;IACL,EAAA;IACA,IAAA;IAEA,IAAA,GAAO,MAAA;IACP,QAAA;EAAA,KAED,MAAA,SAAe,IAAA;EAgBZ,QAAA,CACJ,MAAA,EAAQ,cAAA,EACR,OAAA;IAAY,SAAA;EAAA,IACX,OAAA,CAAQ,aAAA;EArMsB;EAiNxB,QAAA,CACP,CAAA,GAAI,cAAA;IAAmB,IAAA;EAAA,IACtB,KAAA;EAnNQ;;;EA4NL,aAAA,CAAc,MAAA,GAAS,cAAA;IAAmB,IAAA;EAAA,IAAyB,OAAA,CAAA,KAAA;EA1MrD;EAqNpB,YAAA,CAAA,GAAgB,SAAA,UAAmB,eAAA,CAAgB,EAAA,EAAI,EAAA,EAAI,WAAA;EAMpD,iBAAA,CACL,SAAA,WACA,OAAA,aACC,cAAA,UAAwB,eAAA,CAAgB,EAAA,EAAI,EAAA,EAAI,WAAA;AAAA"}
@@ -3,6 +3,8 @@ import { LangGraphRunnableConfig } from "./runnable_types.js";
3
3
  import { PregelNode } from "./read.js";
4
4
  import { PregelInputType, PregelInterface, PregelOptions, PregelOutputType, PregelParams, StateSnapshot } from "./types.js";
5
5
  import { StrRecord } from "./algo.js";
6
+ import "./index.js";
7
+ import "../web.js";
6
8
  import { All, CheckpointListOptions } from "@langchain/langgraph-checkpoint";
7
9
  import { Runnable, RunnableConfig } from "@langchain/core/runnables";
8
10
  import { Graph, Node } from "@langchain/core/runnables/graph";