@langchain/langgraph 1.1.3 → 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 (179) 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.map +1 -1
  53. package/dist/graph/message.d.ts +2 -2
  54. package/dist/graph/message.d.ts.map +1 -1
  55. package/dist/graph/messages_annotation.d.cts +5 -6
  56. package/dist/graph/messages_annotation.d.cts.map +1 -1
  57. package/dist/graph/messages_annotation.d.ts +1 -1
  58. package/dist/graph/messages_annotation.d.ts.map +1 -1
  59. package/dist/graph/messages_reducer.d.cts +0 -1
  60. package/dist/graph/messages_reducer.d.cts.map +1 -1
  61. package/dist/graph/messages_reducer.d.ts +0 -1
  62. package/dist/graph/messages_reducer.d.ts.map +1 -1
  63. package/dist/graph/state.cjs +59 -0
  64. package/dist/graph/state.cjs.map +1 -1
  65. package/dist/graph/state.d.cts +59 -0
  66. package/dist/graph/state.d.cts.map +1 -1
  67. package/dist/graph/state.d.ts +59 -0
  68. package/dist/graph/state.d.ts.map +1 -1
  69. package/dist/graph/state.js +59 -0
  70. package/dist/graph/state.js.map +1 -1
  71. package/dist/graph/types.d.cts +2 -18
  72. package/dist/graph/types.d.cts.map +1 -1
  73. package/dist/graph/types.d.ts +2 -18
  74. package/dist/graph/types.d.ts.map +1 -1
  75. package/dist/graph/zod/index.d.cts +1 -0
  76. package/dist/graph/zod/index.d.ts +1 -0
  77. package/dist/graph/zod/meta.d.cts.map +1 -1
  78. package/dist/graph/zod/meta.d.ts.map +1 -1
  79. package/dist/graph/zod/plugin.d.cts +30 -0
  80. package/dist/graph/zod/plugin.d.cts.map +1 -0
  81. package/dist/graph/zod/plugin.d.ts +30 -0
  82. package/dist/graph/zod/plugin.d.ts.map +1 -0
  83. package/dist/graph/zod/schema.d.cts +0 -1
  84. package/dist/graph/zod/schema.d.cts.map +1 -1
  85. package/dist/graph/zod/schema.d.ts +0 -1
  86. package/dist/graph/zod/schema.d.ts.map +1 -1
  87. package/dist/graph/zod/zod-registry.d.cts +0 -1
  88. package/dist/graph/zod/zod-registry.d.cts.map +1 -1
  89. package/dist/graph/zod/zod-registry.d.ts +0 -1
  90. package/dist/graph/zod/zod-registry.d.ts.map +1 -1
  91. package/dist/interrupt.d.cts.map +1 -1
  92. package/dist/interrupt.d.ts.map +1 -1
  93. package/dist/prebuilt/agentName.d.cts +0 -17
  94. package/dist/prebuilt/agentName.d.cts.map +1 -1
  95. package/dist/prebuilt/agentName.d.ts +0 -17
  96. package/dist/prebuilt/agentName.d.ts.map +1 -1
  97. package/dist/prebuilt/agent_executor.d.cts +5 -5
  98. package/dist/prebuilt/agent_executor.d.cts.map +1 -1
  99. package/dist/prebuilt/agent_executor.d.ts +6 -5
  100. package/dist/prebuilt/agent_executor.d.ts.map +1 -1
  101. package/dist/prebuilt/chat_agent_executor.d.cts.map +1 -1
  102. package/dist/prebuilt/chat_agent_executor.d.ts.map +1 -1
  103. package/dist/prebuilt/interrupt.d.cts.map +1 -1
  104. package/dist/prebuilt/interrupt.d.ts.map +1 -1
  105. package/dist/prebuilt/react_agent_executor.d.cts +8 -14
  106. package/dist/prebuilt/react_agent_executor.d.cts.map +1 -1
  107. package/dist/prebuilt/react_agent_executor.d.ts +10 -14
  108. package/dist/prebuilt/react_agent_executor.d.ts.map +1 -1
  109. package/dist/prebuilt/tool_executor.d.cts.map +1 -1
  110. package/dist/prebuilt/tool_executor.d.ts.map +1 -1
  111. package/dist/prebuilt/tool_node.d.cts.map +1 -1
  112. package/dist/prebuilt/tool_node.d.ts.map +1 -1
  113. package/dist/pregel/algo.d.cts +0 -1
  114. package/dist/pregel/algo.d.cts.map +1 -1
  115. package/dist/pregel/algo.d.ts +5 -1
  116. package/dist/pregel/algo.d.ts.map +1 -1
  117. package/dist/pregel/index.d.cts.map +1 -1
  118. package/dist/pregel/index.d.ts.map +1 -1
  119. package/dist/pregel/read.d.cts +0 -1
  120. package/dist/pregel/read.d.cts.map +1 -1
  121. package/dist/pregel/read.d.ts +1 -1
  122. package/dist/pregel/read.d.ts.map +1 -1
  123. package/dist/pregel/remote.cjs +1 -1
  124. package/dist/pregel/remote.cjs.map +1 -1
  125. package/dist/pregel/remote.d.cts.map +1 -1
  126. package/dist/pregel/remote.d.ts +2 -0
  127. package/dist/pregel/remote.d.ts.map +1 -1
  128. package/dist/pregel/remote.js +2 -2
  129. package/dist/pregel/remote.js.map +1 -1
  130. package/dist/pregel/runnable_types.d.cts.map +1 -1
  131. package/dist/pregel/runnable_types.d.ts.map +1 -1
  132. package/dist/pregel/stream.d.ts +2 -0
  133. package/dist/pregel/types.d.cts +0 -7
  134. package/dist/pregel/types.d.cts.map +1 -1
  135. package/dist/pregel/types.d.ts +0 -7
  136. package/dist/pregel/types.d.ts.map +1 -1
  137. package/dist/pregel/utils/config.d.cts +0 -1
  138. package/dist/pregel/utils/config.d.cts.map +1 -1
  139. package/dist/pregel/utils/config.d.ts +0 -1
  140. package/dist/pregel/utils/config.d.ts.map +1 -1
  141. package/dist/pregel/utils/index.d.cts +3 -7
  142. package/dist/pregel/utils/index.d.cts.map +1 -1
  143. package/dist/pregel/utils/index.d.ts +3 -7
  144. package/dist/pregel/utils/index.d.ts.map +1 -1
  145. package/dist/pregel/write.d.cts +0 -1
  146. package/dist/pregel/write.d.cts.map +1 -1
  147. package/dist/pregel/write.d.ts +0 -1
  148. package/dist/pregel/write.d.ts.map +1 -1
  149. package/dist/state/adapter.d.cts +0 -1
  150. package/dist/state/adapter.d.cts.map +1 -1
  151. package/dist/state/adapter.d.ts +0 -1
  152. package/dist/state/adapter.d.ts.map +1 -1
  153. package/dist/state/index.d.ts +7 -0
  154. package/dist/state/prebuilt/index.d.ts +1 -0
  155. package/dist/state/prebuilt/messages.d.cts +2 -2
  156. package/dist/state/prebuilt/messages.d.cts.map +1 -1
  157. package/dist/state/prebuilt/messages.d.ts +2 -2
  158. package/dist/state/prebuilt/messages.d.ts.map +1 -1
  159. package/dist/state/schema.d.cts.map +1 -1
  160. package/dist/state/schema.d.ts +1 -0
  161. package/dist/state/schema.d.ts.map +1 -1
  162. package/dist/state/types.d.cts +0 -20
  163. package/dist/state/types.d.cts.map +1 -1
  164. package/dist/state/types.d.ts +0 -20
  165. package/dist/state/types.d.ts.map +1 -1
  166. package/dist/state/values/reduced.d.cts +0 -1
  167. package/dist/state/values/reduced.d.cts.map +1 -1
  168. package/dist/state/values/reduced.d.ts +0 -1
  169. package/dist/state/values/reduced.d.ts.map +1 -1
  170. package/dist/state/values/untracked.d.cts +0 -1
  171. package/dist/state/values/untracked.d.cts.map +1 -1
  172. package/dist/state/values/untracked.d.ts +0 -1
  173. package/dist/state/values/untracked.d.ts.map +1 -1
  174. package/dist/utils.d.cts.map +1 -1
  175. package/dist/utils.d.ts.map +1 -1
  176. package/dist/web.d.ts +3 -0
  177. package/dist/writer.d.cts.map +1 -1
  178. package/dist/writer.d.ts.map +1 -1
  179. package/package.json +4 -4
@@ -3,7 +3,7 @@ import { StateDefinition } from "../graph/annotation.cjs";
3
3
  import { CompiledStateGraph } from "../graph/state.cjs";
4
4
  import { ToolExecutor } from "./tool_executor.cjs";
5
5
  import { Runnable } from "@langchain/core/runnables";
6
- import * as _langchain_core_messages2 from "@langchain/core/messages";
6
+ import * as _langchain_core_messages0 from "@langchain/core/messages";
7
7
  import { BaseMessage } from "@langchain/core/messages";
8
8
  import { AgentAction, AgentFinish } from "@langchain/core/agents";
9
9
  import { Tool } from "@langchain/core/tools";
@@ -31,22 +31,22 @@ declare function createAgentExecutor({
31
31
  agentOutcome?: AgentAction | AgentFinish | undefined;
32
32
  steps: Step[];
33
33
  input: string;
34
- chatHistory?: BaseMessage<_langchain_core_messages2.MessageStructure<_langchain_core_messages2.MessageToolSet>, _langchain_core_messages2.MessageType>[] | undefined;
34
+ chatHistory?: BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined;
35
35
  }, {
36
36
  agentOutcome?: AgentAction | AgentFinish | undefined;
37
37
  steps?: Step[] | undefined;
38
38
  input?: string | undefined;
39
- chatHistory?: BaseMessage<_langchain_core_messages2.MessageStructure<_langchain_core_messages2.MessageToolSet>, _langchain_core_messages2.MessageType>[] | undefined;
39
+ chatHistory?: BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined;
40
40
  }, "__start__" | "action" | "agent", {
41
41
  agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
42
42
  steps: BaseChannel<Step[], Step[], unknown>;
43
43
  input: BaseChannel<string, string, unknown>;
44
- chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages2.MessageStructure<_langchain_core_messages2.MessageToolSet>, _langchain_core_messages2.MessageType>[] | undefined, BaseMessage<_langchain_core_messages2.MessageStructure<_langchain_core_messages2.MessageToolSet>, _langchain_core_messages2.MessageType>[] | undefined, unknown> | undefined;
44
+ chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, unknown> | undefined;
45
45
  }, {
46
46
  agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
47
47
  steps: BaseChannel<Step[], Step[], unknown>;
48
48
  input: BaseChannel<string, string, unknown>;
49
- chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages2.MessageStructure<_langchain_core_messages2.MessageToolSet>, _langchain_core_messages2.MessageType>[] | undefined, BaseMessage<_langchain_core_messages2.MessageStructure<_langchain_core_messages2.MessageToolSet>, _langchain_core_messages2.MessageType>[] | undefined, unknown> | undefined;
49
+ chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, unknown> | undefined;
50
50
  }, StateDefinition, {
51
51
  action: Partial<AgentExecutorState>;
52
52
  agent: {
@@ -1 +1 @@
1
- {"version":3,"file":"agent_executor.d.cts","names":["___web_js0","AgentAction","AgentFinish","BaseMessage","Runnable","Tool","ToolExecutor","BaseChannel","Step","AgentExecutorState","Array","createAgentExecutor","agentRunnable","tools","_langchain_core_messages2","MessageToolSet","MessageStructure","MessageType","StateDefinition","Partial","CompiledStateGraph"],"sources":["../../src/prebuilt/agent_executor.d.ts"],"sourcesContent":["import { AgentAction, AgentFinish } from \"@langchain/core/agents\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { Tool } from \"@langchain/core/tools\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport type { BaseChannel } from \"../channels/base.js\";\ninterface Step {\n action: AgentAction | AgentFinish;\n observation: unknown;\n}\n/** @ignore */\nexport interface AgentExecutorState {\n agentOutcome?: AgentAction | AgentFinish;\n steps: Array<Step>;\n input: string;\n chatHistory?: BaseMessage[];\n}\n/** @ignore */\nexport declare function createAgentExecutor({ agentRunnable, tools }: {\n agentRunnable: Runnable;\n tools: Array<Tool> | ToolExecutor;\n}): import(\"../web.js\").CompiledStateGraph<{\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps: Step[];\n input: string;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, {\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps?: Step[] | undefined;\n input?: string | undefined;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, \"__start__\" | \"action\" | \"agent\", {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, import(\"../web.js\").StateDefinition, {\n action: Partial<AgentExecutorState>;\n agent: {\n agentOutcome: any;\n };\n}, unknown, unknown>;\nexport {};\n"],"mappings":";;;;;;;;;;;UAMUQ,IAAAA;UACEP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BAZiGM,CAAAA;OAAcD,EAAAA;IAAlDA,YAAAA,EAAAA,GAAAA;;UAElDb,EAAAA,OAAAA,CAAAA"}
1
+ {"version":3,"file":"agent_executor.d.cts","names":[],"sources":["../../src/prebuilt/agent_executor.ts"],"mappings":";;;;;;;;;;;UASU,IAAA;EACR,MAAA,EAAQ,WAAA,GAAc,WAAA;EACtB,WAAA;AAAA;;UAIe,kBAAA;EACf,YAAA,GAAe,WAAA,GAAc,WAAA;EAC7B,KAAA,EAAO,KAAA,CAAM,IAAA;EACb,KAAA;EACA,WAAA,GAAc,WAAA;AAAA;;iBAIA,mBAAA,CAAA;EACd,aAAA;EACA;AAAA;EAEA,aAAA,EAAe,QAAA;EACf,KAAA,EAAO,KAAA,CAAM,IAAA,IAAQ,YAAA;AAAA"}
@@ -1,9 +1,10 @@
1
1
  import { BaseChannel } from "../channels/base.js";
2
2
  import { StateDefinition } from "../graph/annotation.js";
3
3
  import { CompiledStateGraph } from "../graph/state.js";
4
+ import "../web.js";
4
5
  import { ToolExecutor } from "./tool_executor.js";
5
6
  import { Runnable } from "@langchain/core/runnables";
6
- import * as _langchain_core_messages17 from "@langchain/core/messages";
7
+ import * as _langchain_core_messages0 from "@langchain/core/messages";
7
8
  import { BaseMessage } from "@langchain/core/messages";
8
9
  import { AgentAction, AgentFinish } from "@langchain/core/agents";
9
10
  import { Tool } from "@langchain/core/tools";
@@ -31,22 +32,22 @@ declare function createAgentExecutor({
31
32
  agentOutcome?: AgentAction | AgentFinish | undefined;
32
33
  steps: Step[];
33
34
  input: string;
34
- chatHistory?: BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined;
35
+ chatHistory?: BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined;
35
36
  }, {
36
37
  agentOutcome?: AgentAction | AgentFinish | undefined;
37
38
  steps?: Step[] | undefined;
38
39
  input?: string | undefined;
39
- chatHistory?: BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined;
40
+ chatHistory?: BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined;
40
41
  }, "__start__" | "action" | "agent", {
41
42
  agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
42
43
  steps: BaseChannel<Step[], Step[], unknown>;
43
44
  input: BaseChannel<string, string, unknown>;
44
- chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined, BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined, unknown> | undefined;
45
+ chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, unknown> | undefined;
45
46
  }, {
46
47
  agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
47
48
  steps: BaseChannel<Step[], Step[], unknown>;
48
49
  input: BaseChannel<string, string, unknown>;
49
- chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined, BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined, unknown> | undefined;
50
+ chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, unknown> | undefined;
50
51
  }, StateDefinition, {
51
52
  action: Partial<AgentExecutorState>;
52
53
  agent: {
@@ -1 +1 @@
1
- {"version":3,"file":"agent_executor.d.ts","names":["___web_js0","AgentAction","AgentFinish","BaseMessage","Runnable","Tool","ToolExecutor","BaseChannel","Step","AgentExecutorState","Array","createAgentExecutor","agentRunnable","tools","_langchain_core_messages17","MessageToolSet","MessageStructure","MessageType","StateDefinition","Partial","CompiledStateGraph"],"sources":["../../src/prebuilt/agent_executor.d.ts"],"sourcesContent":["import { AgentAction, AgentFinish } from \"@langchain/core/agents\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { Tool } from \"@langchain/core/tools\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport type { BaseChannel } from \"../channels/base.js\";\ninterface Step {\n action: AgentAction | AgentFinish;\n observation: unknown;\n}\n/** @ignore */\nexport interface AgentExecutorState {\n agentOutcome?: AgentAction | AgentFinish;\n steps: Array<Step>;\n input: string;\n chatHistory?: BaseMessage[];\n}\n/** @ignore */\nexport declare function createAgentExecutor({ agentRunnable, tools }: {\n agentRunnable: Runnable;\n tools: Array<Tool> | ToolExecutor;\n}): import(\"../web.js\").CompiledStateGraph<{\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps: Step[];\n input: string;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, {\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps?: Step[] | undefined;\n input?: string | undefined;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, \"__start__\" | \"action\" | \"agent\", {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, import(\"../web.js\").StateDefinition, {\n action: Partial<AgentExecutorState>;\n agent: {\n agentOutcome: any;\n };\n}, unknown, unknown>;\nexport {};\n"],"mappings":";;;;;;;;;;;UAMUQ,IAAAA;UACEP,cAAcC;;;;AADhBM,UAKOC,kBAAAA,CALH;EAAA,YAAA,CAAA,EAMKR,WANL,GAMmBC,WANnB;OACFD,EAMDS,KANCT,CAMKO,IANLP,CAAAA;OAAcC,EAAAA,MAAAA;EAAW,WAAA,CAAA,EAQnBC,WARmB,EAAA;AAIrC;;AACmBF,iBAMKU,mBAAAA,CANLV;EAAAA,aAAAA;EAAAA;CAAAA,EAAAA;eAAcC,EAOdE,QAPcF;OAChBM,EAONE,KAPMF,CAOAH,IAPAG,CAAAA,GAOQF,YAPRE;IA6BER,kBA7BRU,CAAAA;cAEOP,CAAAA,EAOCF,WAPDE,GAOeD,WAPfC,GAAAA,SAAAA;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aAAA,EAAe,QAAA;EACf,KAAA,EAAO,KAAA,CAAM,IAAA,IAAQ,YAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"chat_agent_executor.d.cts","names":["StructuredToolInterface","BaseMessage","RunnableToolLike","ToolExecutor","CompiledStateGraph","START","FunctionCallingExecutorState","Array","createFunctionCallingExecutor","model","tools","Model","Partial"],"sources":["../../src/prebuilt/chat_agent_executor.d.ts"],"sourcesContent":["import { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { RunnableToolLike } from \"@langchain/core/runnables\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport { CompiledStateGraph } from \"../graph/state.js\";\nimport { START } from \"../constants.js\";\n/** @deprecated Use {@link createReactAgent} instead with tool calling. */\nexport type FunctionCallingExecutorState = {\n messages: Array<BaseMessage>;\n};\n/** @deprecated Use {@link createReactAgent} instead with tool calling. */\nexport declare function createFunctionCallingExecutor<Model extends object>({ model, tools }: {\n model: Model;\n tools: Array<StructuredToolInterface | RunnableToolLike> | ToolExecutor;\n}): CompiledStateGraph<FunctionCallingExecutorState, Partial<FunctionCallingExecutorState>, typeof START | \"agent\" | \"action\">;\n"],"mappings":";;;;;;;;;KAOYM,4BAAAA;EAAAA,QAAAA,EACEC,KADFD,CACQL,WADRK,CAAAA;CAA4B;;AAC1BC,iBAGUC,6BAHVD,CAAAA,cAAAA,MAAAA,CAAAA,CAAAA;EAAAA,KAAAA;EAAAA;CAAAA,EAAAA;EAAK,KAAA,EAIRI,KAJQ;EAGKH,KAAAA,EAEbD,KAFaC,CAEPR,uBAFoC,GAEVE,gBAFU,CAAA,GAEUC,YAFV;CAAA,CAAA,EAGjDC,kBAHiD,CAG9BE,4BAH8B,EAGAM,OAHA,CAGQN,4BAHR,CAAA,EAAA,OAG8CD,KAH9C,GAAA,OAAA,GAAA,QAAA,CAAA"}
1
+ {"version":3,"file":"chat_agent_executor.d.cts","names":[],"sources":["../../src/prebuilt/chat_agent_executor.ts"],"mappings":";;;;;;;;;KAkBY,4BAAA;EAAiC,QAAA,EAAU,KAAA,CAAM,WAAA;AAAA;;iBAG7C,6BAAA,sBAAA,CAAA;EACd,KAAA;EACA;AAAA;EAEA,KAAA,EAAO,KAAA;EACP,KAAA,EAAO,KAAA,CAAM,uBAAA,GAA0B,gBAAA,IAAoB,YAAA;AAAA,IACzD,kBAAA,CACF,4BAAA,EACA,OAAA,CAAQ,4BAAA,UACD,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"chat_agent_executor.d.ts","names":["StructuredToolInterface","BaseMessage","RunnableToolLike","ToolExecutor","CompiledStateGraph","START","FunctionCallingExecutorState","Array","createFunctionCallingExecutor","model","tools","Model","Partial"],"sources":["../../src/prebuilt/chat_agent_executor.d.ts"],"sourcesContent":["import { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { RunnableToolLike } from \"@langchain/core/runnables\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport { CompiledStateGraph } from \"../graph/state.js\";\nimport { START } from \"../constants.js\";\n/** @deprecated Use {@link createReactAgent} instead with tool calling. */\nexport type FunctionCallingExecutorState = {\n messages: Array<BaseMessage>;\n};\n/** @deprecated Use {@link createReactAgent} instead with tool calling. */\nexport declare function createFunctionCallingExecutor<Model extends object>({ model, tools }: {\n model: Model;\n tools: Array<StructuredToolInterface | RunnableToolLike> | ToolExecutor;\n}): CompiledStateGraph<FunctionCallingExecutorState, Partial<FunctionCallingExecutorState>, typeof START | \"agent\" | \"action\">;\n"],"mappings":";;;;;;;;;KAOYM,4BAAAA;EAAAA,QAAAA,EACEC,KADFD,CACQL,WADRK,CAAAA;CAA4B;;AAC1BC,iBAGUC,6BAHVD,CAAAA,cAAAA,MAAAA,CAAAA,CAAAA;EAAAA,KAAAA;EAAAA;CAAAA,EAAAA;EAAK,KAAA,EAIRI,KAJQ;EAGKH,KAAAA,EAEbD,KAFaC,CAEPR,uBAFoC,GAEVE,gBAFU,CAAA,GAEUC,YAFV;CAAA,CAAA,EAGjDC,kBAHiD,CAG9BE,4BAH8B,EAGAM,OAHA,CAGQN,4BAHR,CAAA,EAAA,OAG8CD,KAH9C,GAAA,OAAA,GAAA,QAAA,CAAA"}
1
+ {"version":3,"file":"chat_agent_executor.d.ts","names":[],"sources":["../../src/prebuilt/chat_agent_executor.ts"],"mappings":";;;;;;;;;KAkBY,4BAAA;EAAiC,QAAA,EAAU,KAAA,CAAM,WAAA;AAAA;;iBAG7C,6BAAA,sBAAA,CAAA;EACd,KAAA;EACA;AAAA;EAEA,KAAA,EAAO,KAAA;EACP,KAAA,EAAO,KAAA,CAAM,uBAAA,GAA0B,gBAAA,IAAoB,YAAA;AAAA,IACzD,kBAAA,CACF,4BAAA,EACA,OAAA,CAAQ,4BAAA,UACD,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"interrupt.d.cts","names":["HumanInterruptConfig","ActionRequest","Record","HumanInterrupt","HumanResponse"],"sources":["../../src/prebuilt/interrupt.d.ts"],"sourcesContent":["/**\n * Configuration interface that defines what actions are allowed for a human interrupt.\n * This controls the available interaction options when the graph is paused for human input.\n *\n * @property {boolean} allow_ignore - Whether the human can choose to ignore/skip the current step\n * @property {boolean} allow_respond - Whether the human can provide a text response/feedback\n * @property {boolean} allow_edit - Whether the human can edit the provided content/state\n * @property {boolean} allow_accept - Whether the human can accept/approve the current state\n */\nexport interface HumanInterruptConfig {\n allow_ignore: boolean;\n allow_respond: boolean;\n allow_edit: boolean;\n allow_accept: boolean;\n}\n/**\n * Represents a request for human action within the graph execution.\n * Contains the action type and any associated arguments needed for the action.\n *\n * @property {string} action - The type or name of action being requested (e.g., \"Approve XYZ action\")\n * @property {Record<string, any>} args - Key-value pairs of arguments needed for the action\n */\nexport interface ActionRequest {\n action: string;\n args: Record<string, any>;\n}\n/**\n * Represents an interrupt triggered by the graph that requires human intervention.\n * This is passed to the `interrupt` function when execution is paused for human input.\n *\n * @property {ActionRequest} action_request - The specific action being requested from the human\n * @property {HumanInterruptConfig} config - Configuration defining what actions are allowed\n * @property {string} [description] - Optional detailed description of what input is needed\n */\nexport interface HumanInterrupt {\n action_request: ActionRequest;\n config: HumanInterruptConfig;\n description?: string;\n}\n/**\n * The response provided by a human to an interrupt, which is returned when graph execution resumes.\n *\n * @property {(\"accept\"|\"ignore\"|\"response\"|\"edit\")} type - The type of response:\n * - \"accept\": Approves the current state without changes\n * - \"ignore\": Skips/ignores the current step\n * - \"response\": Provides text feedback or instructions\n * - \"edit\": Modifies the current state/content\n * @property {null|string|ActionRequest} args - The response payload:\n * - null: For ignore/accept actions\n * - string: For text responses\n * - ActionRequest: For edit actions with updated content\n */\nexport type HumanResponse = {\n type: \"accept\" | \"ignore\" | \"response\" | \"edit\";\n args: null | string | ActionRequest;\n};\n"],"mappings":";;AASA;AAaA;AAYA;;;;;AAkBA;UA3CiBA,oBAAAA;;;;;;;;;;;;;UAaAC,aAAAA;;QAEPC;;;;;;;;;;UAUOC,cAAAA;kBACGF;UACRD;;;;;;;;;;;;;;;;KAgBAI,aAAAA;;wBAEcH"}
1
+ {"version":3,"file":"interrupt.d.cts","names":[],"sources":["../../src/prebuilt/interrupt.ts"],"mappings":";;AASA;;;;;;;;UAAiB,oBAAA;EACf,YAAA;EACA,aAAA;EACA,UAAA;EACA,YAAA;AAAA;;;;;;AAwBF;;UAdiB,aAAA;EACf,MAAA;EAEA,IAAA,EAAM,MAAA;AAAA;;;;;;AA8BR;;;UAnBiB,cAAA;EACf,cAAA,EAAgB,aAAA;EAChB,MAAA,EAAQ,oBAAA;EACR,WAAA;AAAA;;;;;;;;;;;;;;KAgBU,aAAA;EACV,IAAA;EACA,IAAA,kBAAsB,aAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"interrupt.d.ts","names":["HumanInterruptConfig","ActionRequest","Record","HumanInterrupt","HumanResponse"],"sources":["../../src/prebuilt/interrupt.d.ts"],"sourcesContent":["/**\n * Configuration interface that defines what actions are allowed for a human interrupt.\n * This controls the available interaction options when the graph is paused for human input.\n *\n * @property {boolean} allow_ignore - Whether the human can choose to ignore/skip the current step\n * @property {boolean} allow_respond - Whether the human can provide a text response/feedback\n * @property {boolean} allow_edit - Whether the human can edit the provided content/state\n * @property {boolean} allow_accept - Whether the human can accept/approve the current state\n */\nexport interface HumanInterruptConfig {\n allow_ignore: boolean;\n allow_respond: boolean;\n allow_edit: boolean;\n allow_accept: boolean;\n}\n/**\n * Represents a request for human action within the graph execution.\n * Contains the action type and any associated arguments needed for the action.\n *\n * @property {string} action - The type or name of action being requested (e.g., \"Approve XYZ action\")\n * @property {Record<string, any>} args - Key-value pairs of arguments needed for the action\n */\nexport interface ActionRequest {\n action: string;\n args: Record<string, any>;\n}\n/**\n * Represents an interrupt triggered by the graph that requires human intervention.\n * This is passed to the `interrupt` function when execution is paused for human input.\n *\n * @property {ActionRequest} action_request - The specific action being requested from the human\n * @property {HumanInterruptConfig} config - Configuration defining what actions are allowed\n * @property {string} [description] - Optional detailed description of what input is needed\n */\nexport interface HumanInterrupt {\n action_request: ActionRequest;\n config: HumanInterruptConfig;\n description?: string;\n}\n/**\n * The response provided by a human to an interrupt, which is returned when graph execution resumes.\n *\n * @property {(\"accept\"|\"ignore\"|\"response\"|\"edit\")} type - The type of response:\n * - \"accept\": Approves the current state without changes\n * - \"ignore\": Skips/ignores the current step\n * - \"response\": Provides text feedback or instructions\n * - \"edit\": Modifies the current state/content\n * @property {null|string|ActionRequest} args - The response payload:\n * - null: For ignore/accept actions\n * - string: For text responses\n * - ActionRequest: For edit actions with updated content\n */\nexport type HumanResponse = {\n type: \"accept\" | \"ignore\" | \"response\" | \"edit\";\n args: null | string | ActionRequest;\n};\n"],"mappings":";;AASA;AAaA;AAYA;;;;;AAkBA;UA3CiBA,oBAAAA;;;;;;;;;;;;;UAaAC,aAAAA;;QAEPC;;;;;;;;;;UAUOC,cAAAA;kBACGF;UACRD;;;;;;;;;;;;;;;;KAgBAI,aAAAA;;wBAEcH"}
1
+ {"version":3,"file":"interrupt.d.ts","names":[],"sources":["../../src/prebuilt/interrupt.ts"],"mappings":";;AASA;;;;;;;;UAAiB,oBAAA;EACf,YAAA;EACA,aAAA;EACA,UAAA;EACA,YAAA;AAAA;;;;;;AAwBF;;UAdiB,aAAA;EACf,MAAA;EAEA,IAAA,EAAM,MAAA;AAAA;;;;;;AA8BR;;;UAnBiB,cAAA;EACf,cAAA,EAAgB,aAAA;EAChB,MAAA,EAAQ,oBAAA;EACR,WAAA;AAAA;;;;;;;;;;;;;;KAgBU,aAAA;EACV,IAAA;EACA,IAAA,kBAAsB,aAAA;AAAA"}
@@ -11,7 +11,7 @@ import { ToolNode } from "./tool_node.cjs";
11
11
  import { All, BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
12
12
  import { InteropZodObject, InteropZodType } from "@langchain/core/utils/types";
13
13
  import { Runnable, RunnableBinding, RunnableLike, RunnableToolLike } from "@langchain/core/runnables";
14
- import * as _langchain_core_messages20 from "@langchain/core/messages";
14
+ import * as _langchain_core_messages0 from "@langchain/core/messages";
15
15
  import { BaseMessage, BaseMessageLike, SystemMessage } from "@langchain/core/messages";
16
16
  import { DynamicTool, StructuredToolInterface } from "@langchain/core/tools";
17
17
  import { LanguageModelLike } from "@langchain/core/language_models/base";
@@ -40,7 +40,7 @@ type StateModifier = Prompt;
40
40
  /** @deprecated Use Prompt instead. */
41
41
  type MessageModifier = SystemMessage | string | ((messages: BaseMessage[]) => BaseMessage[]) | ((messages: BaseMessage[]) => Promise<BaseMessage[]>) | Runnable;
42
42
  declare const createReactAgentAnnotation: <T extends Record<string, any> = Record<string, any>>() => AnnotationRoot<{
43
- messages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages20.MessageStructure<_langchain_core_messages20.MessageToolSet>, _langchain_core_messages20.MessageType>[], Messages>;
43
+ messages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[], Messages>;
44
44
  structuredResponse: {
45
45
  (): LastValue<T>;
46
46
  (annotation: SingleReducer<T, T>): BinaryOperatorAggregate<T, T>;
@@ -48,7 +48,7 @@ declare const createReactAgentAnnotation: <T extends Record<string, any> = Recor
48
48
  };
49
49
  }>;
50
50
  declare const PreHookAnnotation: AnnotationRoot<{
51
- llmInputMessages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages20.MessageStructure<_langchain_core_messages20.MessageToolSet>, _langchain_core_messages20.MessageType>[], Messages>;
51
+ llmInputMessages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[], Messages>;
52
52
  }>;
53
53
  type PreHookAnnotation = typeof PreHookAnnotation;
54
54
  type AnyAnnotationRoot = AnnotationRoot<any>;
@@ -58,9 +58,7 @@ type ToAnnotationRoot<A extends AnyAnnotationRoot | InteropZodObject> = A extend
58
58
  * Update your import to `import { CreateAgentParams } from "langchain";`
59
59
  */
60
60
  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. */
61
+ /** 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
62
  tools: ToolNode | (ServerTool | ClientTool)[];
65
63
  /**
66
64
  * @deprecated Use prompt instead.
@@ -92,14 +90,10 @@ type CreateReactAgentParams<A extends AnyAnnotationRoot | InteropZodObject = Any
92
90
  /**
93
91
  * An optional schema for the context.
94
92
  */
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. */
93
+ contextSchema?: C; /** An optional checkpoint saver to persist the agent's state. */
94
+ checkpointSaver?: BaseCheckpointSaver | boolean; /** An optional checkpoint saver to persist the agent's state. Alias of "checkpointSaver". */
95
+ checkpointer?: BaseCheckpointSaver | boolean; /** An optional list of node names to interrupt before running. */
96
+ interruptBefore?: N[] | All; /** An optional list of node names to interrupt after running. */
103
97
  interruptAfter?: N[] | All;
104
98
  store?: BaseStore;
105
99
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"react_agent_executor.d.cts","names":["_langchain_core_messages20","_langchain_core_language_models_chat_models0","___web_js1","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 createReactAgent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AA,CAAiB,CAAA,aAAc,iBAAA,WAC/B,gBAAA,CAAiB,CAAA,cAAe,iBAAA,YAChC,uBAAA;;;;;EAOF,aAAA,GAAgB,YAAA,CACd,gBAAA,CAAiB,CAAA,YACjB,gBAAA,CAAiB,CAAA,aACjB,uBAAA;;;;;;;;;;;;EAcF,OAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA7KG;;;;;;;;;;;;;;;;;iBA6NW,gBAAA,WACJ,iBAAA,GAAoB,gBAAA,UAA0B,kBAAA,mCAEvB,MAAA,gBAAsB,MAAA,yBAC7C,iBAAA,GAAoB,gBAAA,GAAmB,iBAAA,CAAA,CAEjD,MAAA,EAAQ,sBAAA,CAAuB,CAAA,EAAG,wBAAA,EAA0B,CAAA,IAC3D,kBAAA,CACD,gBAAA,CAAiB,CAAA,YACjB,gBAAA,CAAiB,CAAA,yBAGV,kBAAA,CAAmB,IAAA,GAAO,gBAAA,CAAiB,CAAA,WAClD,UAAA,QACS,0BAAA,CAA2B,wBAAA,aAElC,gBAAA,CAAiB,CAAA"}
@@ -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,GAAAA,CAAAA,CAAAA,KAAAA,EAAAA,OAQI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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"}