@librechat/agents 3.1.75 → 3.1.77-dev.1

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 (272) hide show
  1. package/dist/cjs/graphs/Graph.cjs +22 -3
  2. package/dist/cjs/graphs/Graph.cjs.map +1 -1
  3. package/dist/cjs/hitl/askUserQuestion.cjs +67 -0
  4. package/dist/cjs/hitl/askUserQuestion.cjs.map +1 -0
  5. package/dist/cjs/hooks/HookRegistry.cjs +54 -0
  6. package/dist/cjs/hooks/HookRegistry.cjs.map +1 -1
  7. package/dist/cjs/hooks/createToolPolicyHook.cjs +115 -0
  8. package/dist/cjs/hooks/createToolPolicyHook.cjs.map +1 -0
  9. package/dist/cjs/hooks/executeHooks.cjs +40 -1
  10. package/dist/cjs/hooks/executeHooks.cjs.map +1 -1
  11. package/dist/cjs/hooks/types.cjs +1 -0
  12. package/dist/cjs/hooks/types.cjs.map +1 -1
  13. package/dist/cjs/langchain/google-common.cjs +3 -0
  14. package/dist/cjs/langchain/google-common.cjs.map +1 -0
  15. package/dist/cjs/langchain/index.cjs +86 -0
  16. package/dist/cjs/langchain/index.cjs.map +1 -0
  17. package/dist/cjs/langchain/language_models/chat_models.cjs +3 -0
  18. package/dist/cjs/langchain/language_models/chat_models.cjs.map +1 -0
  19. package/dist/cjs/langchain/messages/tool.cjs +3 -0
  20. package/dist/cjs/langchain/messages/tool.cjs.map +1 -0
  21. package/dist/cjs/langchain/messages.cjs +51 -0
  22. package/dist/cjs/langchain/messages.cjs.map +1 -0
  23. package/dist/cjs/langchain/openai.cjs +3 -0
  24. package/dist/cjs/langchain/openai.cjs.map +1 -0
  25. package/dist/cjs/langchain/prompts.cjs +11 -0
  26. package/dist/cjs/langchain/prompts.cjs.map +1 -0
  27. package/dist/cjs/langchain/runnables.cjs +19 -0
  28. package/dist/cjs/langchain/runnables.cjs.map +1 -0
  29. package/dist/cjs/langchain/tools.cjs +23 -0
  30. package/dist/cjs/langchain/tools.cjs.map +1 -0
  31. package/dist/cjs/langchain/utils/env.cjs +11 -0
  32. package/dist/cjs/langchain/utils/env.cjs.map +1 -0
  33. package/dist/cjs/llm/anthropic/index.cjs +145 -52
  34. package/dist/cjs/llm/anthropic/index.cjs.map +1 -1
  35. package/dist/cjs/llm/anthropic/types.cjs.map +1 -1
  36. package/dist/cjs/llm/anthropic/utils/message_inputs.cjs +21 -14
  37. package/dist/cjs/llm/anthropic/utils/message_inputs.cjs.map +1 -1
  38. package/dist/cjs/llm/anthropic/utils/message_outputs.cjs +84 -70
  39. package/dist/cjs/llm/anthropic/utils/message_outputs.cjs.map +1 -1
  40. package/dist/cjs/llm/bedrock/index.cjs +1 -1
  41. package/dist/cjs/llm/bedrock/index.cjs.map +1 -1
  42. package/dist/cjs/llm/bedrock/utils/message_inputs.cjs +213 -3
  43. package/dist/cjs/llm/bedrock/utils/message_inputs.cjs.map +1 -1
  44. package/dist/cjs/llm/bedrock/utils/message_outputs.cjs +2 -1
  45. package/dist/cjs/llm/bedrock/utils/message_outputs.cjs.map +1 -1
  46. package/dist/cjs/llm/google/utils/common.cjs +5 -4
  47. package/dist/cjs/llm/google/utils/common.cjs.map +1 -1
  48. package/dist/cjs/llm/openai/index.cjs +519 -655
  49. package/dist/cjs/llm/openai/index.cjs.map +1 -1
  50. package/dist/cjs/llm/openai/utils/index.cjs +20 -458
  51. package/dist/cjs/llm/openai/utils/index.cjs.map +1 -1
  52. package/dist/cjs/llm/openrouter/index.cjs +57 -175
  53. package/dist/cjs/llm/openrouter/index.cjs.map +1 -1
  54. package/dist/cjs/llm/vertexai/index.cjs +5 -3
  55. package/dist/cjs/llm/vertexai/index.cjs.map +1 -1
  56. package/dist/cjs/main.cjs +112 -3
  57. package/dist/cjs/main.cjs.map +1 -1
  58. package/dist/cjs/messages/cache.cjs +2 -1
  59. package/dist/cjs/messages/cache.cjs.map +1 -1
  60. package/dist/cjs/messages/core.cjs +7 -6
  61. package/dist/cjs/messages/core.cjs.map +1 -1
  62. package/dist/cjs/messages/format.cjs +73 -15
  63. package/dist/cjs/messages/format.cjs.map +1 -1
  64. package/dist/cjs/messages/langchain.cjs +26 -0
  65. package/dist/cjs/messages/langchain.cjs.map +1 -0
  66. package/dist/cjs/messages/prune.cjs +7 -6
  67. package/dist/cjs/messages/prune.cjs.map +1 -1
  68. package/dist/cjs/run.cjs +400 -42
  69. package/dist/cjs/run.cjs.map +1 -1
  70. package/dist/cjs/tools/ToolNode.cjs +556 -56
  71. package/dist/cjs/tools/ToolNode.cjs.map +1 -1
  72. package/dist/cjs/tools/search/search.cjs +55 -66
  73. package/dist/cjs/tools/search/search.cjs.map +1 -1
  74. package/dist/cjs/tools/search/tavily-scraper.cjs +189 -0
  75. package/dist/cjs/tools/search/tavily-scraper.cjs.map +1 -0
  76. package/dist/cjs/tools/search/tavily-search.cjs +372 -0
  77. package/dist/cjs/tools/search/tavily-search.cjs.map +1 -0
  78. package/dist/cjs/tools/search/tool.cjs +26 -4
  79. package/dist/cjs/tools/search/tool.cjs.map +1 -1
  80. package/dist/cjs/tools/search/utils.cjs +10 -3
  81. package/dist/cjs/tools/search/utils.cjs.map +1 -1
  82. package/dist/esm/graphs/Graph.mjs +22 -3
  83. package/dist/esm/graphs/Graph.mjs.map +1 -1
  84. package/dist/esm/hitl/askUserQuestion.mjs +65 -0
  85. package/dist/esm/hitl/askUserQuestion.mjs.map +1 -0
  86. package/dist/esm/hooks/HookRegistry.mjs +54 -0
  87. package/dist/esm/hooks/HookRegistry.mjs.map +1 -1
  88. package/dist/esm/hooks/createToolPolicyHook.mjs +113 -0
  89. package/dist/esm/hooks/createToolPolicyHook.mjs.map +1 -0
  90. package/dist/esm/hooks/executeHooks.mjs +40 -1
  91. package/dist/esm/hooks/executeHooks.mjs.map +1 -1
  92. package/dist/esm/hooks/types.mjs +1 -0
  93. package/dist/esm/hooks/types.mjs.map +1 -1
  94. package/dist/esm/langchain/google-common.mjs +2 -0
  95. package/dist/esm/langchain/google-common.mjs.map +1 -0
  96. package/dist/esm/langchain/index.mjs +5 -0
  97. package/dist/esm/langchain/index.mjs.map +1 -0
  98. package/dist/esm/langchain/language_models/chat_models.mjs +2 -0
  99. package/dist/esm/langchain/language_models/chat_models.mjs.map +1 -0
  100. package/dist/esm/langchain/messages/tool.mjs +2 -0
  101. package/dist/esm/langchain/messages/tool.mjs.map +1 -0
  102. package/dist/esm/langchain/messages.mjs +2 -0
  103. package/dist/esm/langchain/messages.mjs.map +1 -0
  104. package/dist/esm/langchain/openai.mjs +2 -0
  105. package/dist/esm/langchain/openai.mjs.map +1 -0
  106. package/dist/esm/langchain/prompts.mjs +2 -0
  107. package/dist/esm/langchain/prompts.mjs.map +1 -0
  108. package/dist/esm/langchain/runnables.mjs +2 -0
  109. package/dist/esm/langchain/runnables.mjs.map +1 -0
  110. package/dist/esm/langchain/tools.mjs +2 -0
  111. package/dist/esm/langchain/tools.mjs.map +1 -0
  112. package/dist/esm/langchain/utils/env.mjs +2 -0
  113. package/dist/esm/langchain/utils/env.mjs.map +1 -0
  114. package/dist/esm/llm/anthropic/index.mjs +146 -54
  115. package/dist/esm/llm/anthropic/index.mjs.map +1 -1
  116. package/dist/esm/llm/anthropic/types.mjs.map +1 -1
  117. package/dist/esm/llm/anthropic/utils/message_inputs.mjs +21 -14
  118. package/dist/esm/llm/anthropic/utils/message_inputs.mjs.map +1 -1
  119. package/dist/esm/llm/anthropic/utils/message_outputs.mjs +84 -71
  120. package/dist/esm/llm/anthropic/utils/message_outputs.mjs.map +1 -1
  121. package/dist/esm/llm/bedrock/index.mjs +1 -1
  122. package/dist/esm/llm/bedrock/index.mjs.map +1 -1
  123. package/dist/esm/llm/bedrock/utils/message_inputs.mjs +214 -4
  124. package/dist/esm/llm/bedrock/utils/message_inputs.mjs.map +1 -1
  125. package/dist/esm/llm/bedrock/utils/message_outputs.mjs +2 -1
  126. package/dist/esm/llm/bedrock/utils/message_outputs.mjs.map +1 -1
  127. package/dist/esm/llm/google/utils/common.mjs +5 -4
  128. package/dist/esm/llm/google/utils/common.mjs.map +1 -1
  129. package/dist/esm/llm/openai/index.mjs +520 -656
  130. package/dist/esm/llm/openai/index.mjs.map +1 -1
  131. package/dist/esm/llm/openai/utils/index.mjs +23 -459
  132. package/dist/esm/llm/openai/utils/index.mjs.map +1 -1
  133. package/dist/esm/llm/openrouter/index.mjs +57 -175
  134. package/dist/esm/llm/openrouter/index.mjs.map +1 -1
  135. package/dist/esm/llm/vertexai/index.mjs +5 -3
  136. package/dist/esm/llm/vertexai/index.mjs.map +1 -1
  137. package/dist/esm/main.mjs +7 -0
  138. package/dist/esm/main.mjs.map +1 -1
  139. package/dist/esm/messages/cache.mjs +2 -1
  140. package/dist/esm/messages/cache.mjs.map +1 -1
  141. package/dist/esm/messages/core.mjs +7 -6
  142. package/dist/esm/messages/core.mjs.map +1 -1
  143. package/dist/esm/messages/format.mjs +73 -15
  144. package/dist/esm/messages/format.mjs.map +1 -1
  145. package/dist/esm/messages/langchain.mjs +23 -0
  146. package/dist/esm/messages/langchain.mjs.map +1 -0
  147. package/dist/esm/messages/prune.mjs +7 -6
  148. package/dist/esm/messages/prune.mjs.map +1 -1
  149. package/dist/esm/run.mjs +400 -42
  150. package/dist/esm/run.mjs.map +1 -1
  151. package/dist/esm/tools/ToolNode.mjs +557 -57
  152. package/dist/esm/tools/ToolNode.mjs.map +1 -1
  153. package/dist/esm/tools/search/search.mjs +55 -66
  154. package/dist/esm/tools/search/search.mjs.map +1 -1
  155. package/dist/esm/tools/search/tavily-scraper.mjs +186 -0
  156. package/dist/esm/tools/search/tavily-scraper.mjs.map +1 -0
  157. package/dist/esm/tools/search/tavily-search.mjs +370 -0
  158. package/dist/esm/tools/search/tavily-search.mjs.map +1 -0
  159. package/dist/esm/tools/search/tool.mjs +26 -4
  160. package/dist/esm/tools/search/tool.mjs.map +1 -1
  161. package/dist/esm/tools/search/utils.mjs +10 -3
  162. package/dist/esm/tools/search/utils.mjs.map +1 -1
  163. package/dist/types/graphs/Graph.d.ts +7 -0
  164. package/dist/types/hitl/askUserQuestion.d.ts +55 -0
  165. package/dist/types/hitl/index.d.ts +6 -0
  166. package/dist/types/hooks/HookRegistry.d.ts +58 -0
  167. package/dist/types/hooks/createToolPolicyHook.d.ts +87 -0
  168. package/dist/types/hooks/index.d.ts +4 -1
  169. package/dist/types/hooks/types.d.ts +109 -3
  170. package/dist/types/index.d.ts +10 -0
  171. package/dist/types/langchain/google-common.d.ts +1 -0
  172. package/dist/types/langchain/index.d.ts +8 -0
  173. package/dist/types/langchain/language_models/chat_models.d.ts +1 -0
  174. package/dist/types/langchain/messages/tool.d.ts +1 -0
  175. package/dist/types/langchain/messages.d.ts +2 -0
  176. package/dist/types/langchain/openai.d.ts +1 -0
  177. package/dist/types/langchain/prompts.d.ts +1 -0
  178. package/dist/types/langchain/runnables.d.ts +2 -0
  179. package/dist/types/langchain/tools.d.ts +2 -0
  180. package/dist/types/langchain/utils/env.d.ts +1 -0
  181. package/dist/types/llm/anthropic/index.d.ts +22 -9
  182. package/dist/types/llm/anthropic/types.d.ts +5 -1
  183. package/dist/types/llm/anthropic/utils/message_outputs.d.ts +13 -6
  184. package/dist/types/llm/anthropic/utils/output_parsers.d.ts +1 -1
  185. package/dist/types/llm/openai/index.d.ts +21 -24
  186. package/dist/types/llm/openrouter/index.d.ts +11 -9
  187. package/dist/types/llm/vertexai/index.d.ts +1 -0
  188. package/dist/types/messages/cache.d.ts +4 -1
  189. package/dist/types/messages/format.d.ts +4 -1
  190. package/dist/types/messages/langchain.d.ts +27 -0
  191. package/dist/types/run.d.ts +117 -1
  192. package/dist/types/tools/ToolNode.d.ts +26 -1
  193. package/dist/types/tools/search/tavily-scraper.d.ts +19 -0
  194. package/dist/types/tools/search/tavily-search.d.ts +4 -0
  195. package/dist/types/tools/search/types.d.ts +99 -5
  196. package/dist/types/tools/search/utils.d.ts +2 -2
  197. package/dist/types/types/graph.d.ts +23 -37
  198. package/dist/types/types/hitl.d.ts +272 -0
  199. package/dist/types/types/index.d.ts +1 -0
  200. package/dist/types/types/llm.d.ts +3 -3
  201. package/dist/types/types/run.d.ts +33 -0
  202. package/dist/types/types/stream.d.ts +1 -1
  203. package/dist/types/types/tools.d.ts +19 -0
  204. package/package.json +80 -17
  205. package/src/graphs/Graph.ts +33 -4
  206. package/src/graphs/__tests__/composition.smoke.test.ts +188 -0
  207. package/src/hitl/askUserQuestion.ts +72 -0
  208. package/src/hitl/index.ts +7 -0
  209. package/src/hooks/HookRegistry.ts +71 -0
  210. package/src/hooks/__tests__/createToolPolicyHook.test.ts +259 -0
  211. package/src/hooks/createToolPolicyHook.ts +184 -0
  212. package/src/hooks/executeHooks.ts +50 -1
  213. package/src/hooks/index.ts +6 -0
  214. package/src/hooks/types.ts +112 -0
  215. package/src/index.ts +22 -0
  216. package/src/langchain/google-common.ts +1 -0
  217. package/src/langchain/index.ts +8 -0
  218. package/src/langchain/language_models/chat_models.ts +1 -0
  219. package/src/langchain/messages/tool.ts +5 -0
  220. package/src/langchain/messages.ts +21 -0
  221. package/src/langchain/openai.ts +1 -0
  222. package/src/langchain/prompts.ts +1 -0
  223. package/src/langchain/runnables.ts +7 -0
  224. package/src/langchain/tools.ts +8 -0
  225. package/src/langchain/utils/env.ts +1 -0
  226. package/src/llm/anthropic/index.ts +252 -84
  227. package/src/llm/anthropic/llm.spec.ts +751 -102
  228. package/src/llm/anthropic/types.ts +9 -1
  229. package/src/llm/anthropic/utils/message_inputs.ts +37 -19
  230. package/src/llm/anthropic/utils/message_outputs.ts +119 -101
  231. package/src/llm/bedrock/index.ts +2 -2
  232. package/src/llm/bedrock/llm.spec.ts +341 -0
  233. package/src/llm/bedrock/utils/message_inputs.ts +303 -4
  234. package/src/llm/bedrock/utils/message_outputs.ts +2 -1
  235. package/src/llm/custom-chat-models.smoke.test.ts +836 -0
  236. package/src/llm/google/llm.spec.ts +339 -57
  237. package/src/llm/google/utils/common.ts +53 -48
  238. package/src/llm/openai/contentBlocks.test.ts +346 -0
  239. package/src/llm/openai/index.ts +856 -833
  240. package/src/llm/openai/utils/index.ts +107 -78
  241. package/src/llm/openai/utils/messages.test.ts +159 -0
  242. package/src/llm/openrouter/index.ts +124 -247
  243. package/src/llm/openrouter/reasoning.test.ts +8 -1
  244. package/src/llm/vertexai/index.ts +11 -5
  245. package/src/llm/vertexai/llm.spec.ts +28 -1
  246. package/src/messages/cache.test.ts +4 -3
  247. package/src/messages/cache.ts +3 -2
  248. package/src/messages/core.ts +16 -9
  249. package/src/messages/format.ts +96 -16
  250. package/src/messages/formatAgentMessages.test.ts +166 -1
  251. package/src/messages/langchain.ts +39 -0
  252. package/src/messages/prune.ts +12 -8
  253. package/src/run.ts +456 -47
  254. package/src/scripts/caching.ts +2 -3
  255. package/src/specs/summarization.test.ts +51 -58
  256. package/src/tools/ToolNode.ts +706 -63
  257. package/src/tools/__tests__/hitl.test.ts +3593 -0
  258. package/src/tools/search/search.ts +83 -73
  259. package/src/tools/search/tavily-scraper.ts +235 -0
  260. package/src/tools/search/tavily-search.ts +424 -0
  261. package/src/tools/search/tavily.test.ts +965 -0
  262. package/src/tools/search/tool.ts +36 -26
  263. package/src/tools/search/types.ts +133 -8
  264. package/src/tools/search/utils.ts +13 -5
  265. package/src/types/graph.ts +32 -87
  266. package/src/types/hitl.ts +303 -0
  267. package/src/types/index.ts +1 -0
  268. package/src/types/llm.ts +3 -3
  269. package/src/types/run.ts +33 -0
  270. package/src/types/stream.ts +1 -1
  271. package/src/types/tools.ts +19 -0
  272. package/src/utils/llmConfig.ts +1 -6
@@ -1,4 +1,4 @@
1
- import type { START, StateType, UpdateType, StateGraph, StateGraphArgs, StateDefinition, CompiledStateGraph, BinaryOperatorAggregate } from '@langchain/langgraph';
1
+ import type { START, StateGraph, StateGraphArgs } from '@langchain/langgraph';
2
2
  import type { BindToolsInput } from '@langchain/core/language_models/chat_models';
3
3
  import type { BaseMessage, AIMessageChunk, SystemMessage } from '@langchain/core/messages';
4
4
  import type { RunnableConfig, Runnable } from '@langchain/core/runnables';
@@ -51,51 +51,36 @@ export interface EventHandler {
51
51
  }
52
52
  export type GraphStateChannels<T extends BaseGraphState> = StateGraphArgs<T>['channels'];
53
53
  export type Workflow<T extends BaseGraphState = BaseGraphState, U extends Partial<T> = Partial<T>, N extends string = string> = StateGraph<T, U, N>;
54
- export type CompiledWorkflow<T extends BaseGraphState = BaseGraphState, U extends Partial<T> = Partial<T>, N extends string = string> = CompiledStateGraph<T, U, N>;
55
- export type CompiledStateWorkflow = CompiledStateGraph<StateType<{
56
- messages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
57
- }>, UpdateType<{
58
- messages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
59
- }>, string, {
60
- messages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
61
- }, {
62
- messages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
63
- }, StateDefinition>;
64
- export type CompiledMultiAgentWorkflow = CompiledStateGraph<StateType<{
65
- messages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
66
- agentMessages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
67
- }>, UpdateType<{
68
- messages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
69
- agentMessages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
70
- }>, string, {
71
- messages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
72
- agentMessages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
73
- }, {
74
- messages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
75
- agentMessages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
76
- }, StateDefinition>;
77
- export type CompiledAgentWorfklow = CompiledStateGraph<AgentSubgraphState, Partial<AgentSubgraphState>, '__start__' | `agent=${string}` | `tools=${string}` | `summarize=${string}`, {
78
- messages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
79
- summarizationRequest: BinaryOperatorAggregate<SummarizationNodeInput | undefined, SummarizationNodeInput | undefined>;
80
- }, {
81
- messages: BinaryOperatorAggregate<BaseMessage[], BaseMessage[]>;
82
- summarizationRequest: BinaryOperatorAggregate<SummarizationNodeInput | undefined, SummarizationNodeInput | undefined>;
83
- }, StateDefinition, {
84
- [x: `agent=${string}`]: Partial<BaseGraphState>;
85
- [x: `tools=${string}`]: any;
86
- [x: `summarize=${string}`]: any;
87
- }>;
54
+ type LangChainEventStreamCallbackHandlerInput = NonNullable<Parameters<Runnable['streamEvents']>[2]>;
55
+ export type EventStreamCallbackHandlerInput = LangChainEventStreamCallbackHandlerInput & {
56
+ autoClose?: boolean;
57
+ raiseError?: boolean;
58
+ ignoreCustomEvent?: boolean;
59
+ };
60
+ export type WorkflowValuesStreamConfig = RunnableConfig & {
61
+ streamMode: 'values';
62
+ };
63
+ /**
64
+ * LangGraph stream output is mode-dependent (`values`, `updates`, SSE, etc.).
65
+ * Keep the base Runnable stream output as unknown and narrow at callsites that
66
+ * choose a concrete streamMode.
67
+ */
68
+ export type CompiledWorkflow<TInput extends BaseGraphState = BaseGraphState, TOutput extends BaseGraphState = TInput> = Omit<Runnable<TInput, unknown>, 'invoke'> & {
69
+ invoke(input: TInput, config?: RunnableConfig): Promise<TOutput>;
70
+ };
71
+ export type CompiledStateWorkflow = CompiledWorkflow;
72
+ export type CompiledMultiAgentWorkflow = CompiledWorkflow<MultiAgentGraphState>;
73
+ export type CompiledAgentWorfklow = CompiledWorkflow<AgentSubgraphState, AgentSubgraphState>;
88
74
  export type SystemRunnable = Runnable<BaseMessage[], (BaseMessage | SystemMessage)[], RunnableConfig<Record<string, unknown>>> | undefined;
89
75
  /**
90
76
  * Optional compile options passed to workflow.compile().
91
77
  * These are intentionally untyped to avoid coupling to library internals.
92
78
  */
93
79
  export type CompileOptions = {
94
- checkpointer?: any;
80
+ checkpointer?: unknown;
95
81
  interruptBefore?: string[];
96
82
  interruptAfter?: string[];
97
83
  };
98
- export type EventStreamCallbackHandlerInput = Parameters<CompiledWorkflow['streamEvents']>[2] extends Omit<infer T, 'autoClose'> ? T : never;
99
84
  export type StreamChunk = (ChatGenerationChunk & {
100
85
  message: AIMessageChunk;
101
86
  }) | AIMessageChunk;
@@ -372,3 +357,4 @@ export interface ContextPruningConfig {
372
357
  placeholder?: string;
373
358
  };
374
359
  }
360
+ export {};
@@ -0,0 +1,272 @@
1
+ /**
2
+ * First-class human-in-the-loop (HITL) types for `@librechat/agents`.
3
+ * Surfaces the interrupt payload that `ToolNode` raises when a `PreToolUse`
4
+ * hook returns `decision: 'ask'` and HITL is enabled on the run, plus the
5
+ * resume-decision shape the host returns to continue or reject the tool.
6
+ *
7
+ * Mirrors the LangChain HITL middleware shape (action_requests /
8
+ * review_configs) so hosts and clients can share rendering/UI semantics
9
+ * across the langchain ecosystem.
10
+ */
11
+ /** Per-tool approval request emitted inside an interrupt payload. */
12
+ export interface ToolApprovalRequest {
13
+ /** Stable id of the tool call (matches LangGraph `ToolCall.id`). */
14
+ tool_call_id: string;
15
+ /** Tool name being invoked. */
16
+ name: string;
17
+ /**
18
+ * Arguments the tool is about to be invoked with — already resolved by
19
+ * any `{{tool<i>turn<n>}}` references and any `updatedInput` returned
20
+ * by the firing PreToolUse hook.
21
+ */
22
+ arguments: Record<string, unknown>;
23
+ /**
24
+ * Optional reason the hook supplied for asking (e.g., "destructive
25
+ * filesystem write"). Hosts can render this verbatim.
26
+ */
27
+ description?: string;
28
+ }
29
+ /** Allowed host-side decisions for a `tool_approval` interrupt. */
30
+ export type ToolApprovalDecisionType = 'approve' | 'reject' | 'edit' | 'respond';
31
+ /** Per-action review configuration paired with each action_request. */
32
+ export interface ToolApprovalReviewConfig {
33
+ /** Tool name (matches the `name` field on the corresponding action_request). */
34
+ action_name: string;
35
+ /**
36
+ * Stable id of the tool call this review_config applies to (matches
37
+ * the `tool_call_id` of the corresponding action_request). Lets a UI
38
+ * map review_configs → action_requests directly when a batch
39
+ * contains the same tool called more than once — by-position
40
+ * mapping breaks down with duplicates.
41
+ */
42
+ tool_call_id: string;
43
+ /** Decisions the host UI is allowed to surface for this action. */
44
+ allowed_decisions: ToolApprovalDecisionType[];
45
+ }
46
+ /**
47
+ * Resume value the host returns through `Run.resume(decisions)` after a
48
+ * `tool_approval` interrupt. One entry per action_request, in the same
49
+ * order. Hosts may also return a record keyed by `tool_call_id`; the SDK
50
+ * handles either shape.
51
+ *
52
+ * Variants:
53
+ * - `approve`: run the tool with its original (or hook-rewritten) args.
54
+ * - `reject`: skip the tool, emit a blocked error `ToolMessage` with
55
+ * `reason` surfaced to the model.
56
+ * - `edit`: replace the tool's args with `updatedInput` (re-resolves
57
+ * any `{{tool<i>turn<n>}}` placeholders) and run the tool.
58
+ * - `respond`: skip the tool entirely and emit `responseText` as a
59
+ * successful `ToolMessage`. Mirrors LangChain HITL middleware's
60
+ * `respond` semantic — the human supplies the result the model sees,
61
+ * bypassing tool execution. Useful when the user wants to short-circuit
62
+ * a tool call with a hand-written answer (e.g., "don't actually run
63
+ * the search, just tell the model 'no relevant results'").
64
+ *
65
+ * Note on hook semantics: `respond` does NOT fire the per-tool
66
+ * `PostToolUse` hook (no real tool execution happened, so the
67
+ * "post-tool" semantic doesn't apply). It DOES appear in the
68
+ * `PostToolBatch` entry array with `status: 'success'` and the
69
+ * user-supplied text as `toolOutput`, so batch-level audit /
70
+ * convention hooks see the full set of outcomes.
71
+ */
72
+ export type ToolApprovalDecision = {
73
+ type: 'approve';
74
+ } | {
75
+ type: 'reject';
76
+ reason?: string;
77
+ } | {
78
+ type: 'edit';
79
+ updatedInput: Record<string, unknown>;
80
+ } | {
81
+ type: 'respond';
82
+ responseText: string;
83
+ };
84
+ /** Map form of resume decisions, keyed by tool call id. */
85
+ export type ToolApprovalDecisionMap = Record<string, ToolApprovalDecision>;
86
+ /**
87
+ * Categories of human-in-the-loop interrupts the SDK can raise. Hosts
88
+ * narrow on `HumanInterruptPayload.type` to determine which payload
89
+ * shape they're handling and which resume value to send back through
90
+ * `Run.resume()`.
91
+ *
92
+ * Exported as a discrete type so downstream consumers (notably
93
+ * LibreChat's wire types in `librechat-data-provider`) can mirror
94
+ * the discriminator alongside their own host-side `PendingAction`
95
+ * record without re-declaring the union themselves. Internal SDK
96
+ * code narrows directly on the literal strings via the type guards
97
+ * below; this type alias is primarily an integration-layer contract.
98
+ */
99
+ export type HumanInterruptType = 'tool_approval' | 'ask_user_question';
100
+ /**
101
+ * Structured payload the SDK passes to `interrupt()` when one or more
102
+ * pending tool calls require host approval. All `ask`-decision tool calls
103
+ * from a single ToolNode batch are bundled into one interrupt so the host
104
+ * can render and resolve them together.
105
+ *
106
+ * Resume value: `ToolApprovalDecision[]` (in `action_requests` order) or
107
+ * `ToolApprovalDecisionMap` (keyed by `tool_call_id`).
108
+ */
109
+ export interface ToolApprovalInterruptPayload {
110
+ type: 'tool_approval';
111
+ action_requests: ToolApprovalRequest[];
112
+ review_configs: ToolApprovalReviewConfig[];
113
+ }
114
+ /**
115
+ * Pre-defined option the user can pick when answering an
116
+ * `ask_user_question` interrupt. The selected option's `value` becomes
117
+ * the resume value's `answer` field.
118
+ */
119
+ export interface AskUserQuestionOption {
120
+ /** Human-readable label rendered in the host UI. */
121
+ label: string;
122
+ /** Value returned via `AskUserQuestionResolution.answer` if picked. */
123
+ value: string;
124
+ }
125
+ /** Question request emitted inside an `ask_user_question` interrupt. */
126
+ export interface AskUserQuestionRequest {
127
+ /** The question to ask the human. */
128
+ question: string;
129
+ /** Optional context / description rendered alongside the question. */
130
+ description?: string;
131
+ /**
132
+ * Optional pre-defined response options. When present, hosts can render
133
+ * a picker; the user may still type a free-form answer when the host
134
+ * UI allows it. Omit to require a free-form answer.
135
+ */
136
+ options?: AskUserQuestionOption[];
137
+ }
138
+ /**
139
+ * Structured payload the SDK passes to `interrupt()` when an agent (or
140
+ * a custom node) needs to ask the user a clarifying question. Mirrors
141
+ * Claude Code's `AskUserQuestion` semantic. Resume value:
142
+ * `AskUserQuestionResolution`.
143
+ */
144
+ export interface AskUserQuestionInterruptPayload {
145
+ type: 'ask_user_question';
146
+ question: AskUserQuestionRequest;
147
+ }
148
+ /**
149
+ * Discriminated union of every interrupt payload the SDK raises. New
150
+ * variants can be added without breaking existing handlers as long as
151
+ * those handlers check `payload.type` before reading variant-specific
152
+ * fields. Use the `isToolApprovalInterrupt` / `isAskUserQuestionInterrupt`
153
+ * type guards for ergonomic narrowing.
154
+ */
155
+ export type HumanInterruptPayload = ToolApprovalInterruptPayload | AskUserQuestionInterruptPayload;
156
+ /** Resume value the host returns for an `ask_user_question` interrupt. */
157
+ export interface AskUserQuestionResolution {
158
+ /**
159
+ * The human's answer. Free-form text, or — when `options` were
160
+ * provided — one of the option `value`s. Hosts may also send any
161
+ * structured object their custom UI defines; see the host docs for
162
+ * what your downstream consumer expects.
163
+ */
164
+ answer: string;
165
+ }
166
+ /**
167
+ * Type guard narrowing an arbitrary value to a `ToolApprovalInterruptPayload`.
168
+ * Accepts `unknown` (not just `HumanInterruptPayload`) because hosts can
169
+ * raise custom interrupt payloads from custom nodes — `getInterrupt()`
170
+ * surfaces them as-is, and downstream code must validate the shape at
171
+ * runtime before reading variant-specific fields.
172
+ */
173
+ export declare function isToolApprovalInterrupt(payload: unknown): payload is ToolApprovalInterruptPayload;
174
+ /**
175
+ * Type guard narrowing an arbitrary value to an
176
+ * `AskUserQuestionInterruptPayload`. Same `unknown`-tolerant contract
177
+ * as `isToolApprovalInterrupt`.
178
+ */
179
+ export declare function isAskUserQuestionInterrupt(payload: unknown): payload is AskUserQuestionInterruptPayload;
180
+ /**
181
+ * Run-level configuration controlling HITL semantics. **HITL is OFF by
182
+ * default** for now — the SDK ships the interrupt machinery, but the
183
+ * default stays opt-in until host UIs (notably LibreChat) ship the
184
+ * approval-rendering affordances needed to surface interrupts to end
185
+ * users. Without that UI, an interrupt with no resolver looks like a
186
+ * hung tool-call card. Hosts opt in explicitly with
187
+ * `{ enabled: true }`. The intent is to flip this default to ON in a
188
+ * future minor once the consumer ecosystem is ready to render
189
+ * interrupts end-to-end.
190
+ *
191
+ * When enabled (`{ enabled: true }`):
192
+ *
193
+ * - `PreToolUse` hooks returning `decision: 'ask'` raise a real
194
+ * LangGraph `interrupt()` instead of being treated as a synchronous
195
+ * deny.
196
+ * - `Run.create` installs a `MemorySaver` checkpointer fallback on the
197
+ * run's compile options if the host did not provide one, since
198
+ * LangGraph requires a checkpointer to suspend and resume.
199
+ *
200
+ * When disabled (the default — omitted, or `{ enabled: false }`):
201
+ * `ask` decisions are fail-closed (blocked with an error
202
+ * `ToolMessage`) and no checkpointer is implicitly attached. This
203
+ * matches the pre-HITL behavior so existing hosts upgrading the SDK
204
+ * see no change until they're ready to wire the resume UI.
205
+ *
206
+ * ## Scope: event-driven tools only
207
+ *
208
+ * The interrupt path is wired into `ToolNode.dispatchToolEvents`, which
209
+ * runs when the agent uses event-driven tool dispatch (the path
210
+ * LibreChat and most production hosts take). Tools that execute via
211
+ * the direct path — i.e. tools listed in `directToolNames` (the
212
+ * graph-managed handoff and subagent tools) or tools on agents
213
+ * configured WITHOUT `eventDrivenMode` — bypass the hook system
214
+ * entirely. `PreToolUse` hooks do not fire for those tools and HITL
215
+ * approval does not gate them.
216
+ *
217
+ * Practical implications:
218
+ * - LibreChat-style hosts using event-driven dispatch get the full
219
+ * HITL surface across every tool the model calls.
220
+ * - Hosts using `AgentInputs.tools` directly without event-driven
221
+ * mode get policy enforcement for nothing — the hooks register
222
+ * but never fire. Either switch to event-driven mode or accept
223
+ * that direct tools are not approval-gated. This is documented
224
+ * also on `ToolNodeOptions.hookRegistry`.
225
+ * - Mixed direct + event batches (e.g. a handoff tool sharing an
226
+ * LLM turn with a regular tool) currently re-execute the direct
227
+ * half on resume, since LangGraph rolls back the entire ToolNode
228
+ * on `interrupt()` throw. Hosts whose direct tools have side
229
+ * effects (subagents that invoke models, handoffs that trigger
230
+ * downstream work) should avoid mixing those tools into the same
231
+ * batch as approval-gated event tools.
232
+ *
233
+ * ## Note on idempotency
234
+ *
235
+ * When an interrupt fires, LangGraph re-runs the interrupted node
236
+ * from the start on resume, which fires `PreToolUse` hooks again.
237
+ * Hooks that produce side effects (logging, external calls) will see
238
+ * two invocations per paused turn.
239
+ */
240
+ export interface HumanInTheLoopConfig {
241
+ /**
242
+ * Master switch. Defaults to `false` — omit the field (or pass
243
+ * `false`) to keep HITL off, or set `true` to opt in once the host
244
+ * UI is ready to render and resolve `tool_approval` interrupts.
245
+ */
246
+ enabled?: boolean;
247
+ }
248
+ /**
249
+ * Snapshot of an in-flight interrupt surfaced from `Run.processStream`
250
+ * via `run.getInterrupt()`. Hosts persist this alongside their job
251
+ * record so they can later call `Run.resume(decisions)` against a Run
252
+ * compiled with the same `thread_id` / checkpointer.
253
+ *
254
+ * The `payload` type defaults to `HumanInterruptPayload` (the SDK's
255
+ * built-in `tool_approval` / `ask_user_question` discriminated union)
256
+ * for ergonomic narrowing in the common case. Hosts that raise custom
257
+ * interrupt payloads from custom graph nodes can pass the type
258
+ * parameter (`run.getInterrupt<MyCustom>()` or
259
+ * `RunInterruptResult<MyCustom>`) — the SDK does not validate the
260
+ * runtime shape, it just transports whatever the node passed to
261
+ * `interrupt()`. Use the `isToolApprovalInterrupt` /
262
+ * `isAskUserQuestionInterrupt` guards (which accept `unknown`) when
263
+ * the source of the interrupt isn't statically known.
264
+ */
265
+ export interface RunInterruptResult<TPayload = HumanInterruptPayload> {
266
+ /** Stable id of the LangGraph interrupt (from `Interrupt.id`). */
267
+ interruptId: string;
268
+ /** `thread_id` the run was bound to — required to resume. */
269
+ threadId?: string;
270
+ /** Structured payload describing what needs human input. */
271
+ payload: TPayload;
272
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './graph';
2
+ export * from './hitl';
2
3
  export * from './llm';
3
4
  export * from './messages';
4
5
  export * from './run';
@@ -3,7 +3,7 @@ import type { BindToolsInput, BaseChatModelParams } from '@langchain/core/langua
3
3
  import type { OpenAIChatInput, ChatOpenAIFields, AzureOpenAIInput, ClientOptions as OAIClientOptions } from '@langchain/openai';
4
4
  import type { GoogleGenerativeAIChatInput } from '@langchain/google-genai';
5
5
  import type { ChatVertexAIInput } from '@langchain/google-vertexai';
6
- import type { ChatDeepSeekCallOptions } from '@langchain/deepseek';
6
+ import type { ChatDeepSeekInput } from '@langchain/deepseek';
7
7
  import type { ChatOpenRouterCallOptions } from '@/llm/openrouter';
8
8
  import type { ChatBedrockConverseInput } from '@langchain/aws';
9
9
  import type { ChatMistralAIInput } from '@langchain/mistralai';
@@ -49,7 +49,7 @@ export type AnthropicReasoning = {
49
49
  export type GoogleThinkingConfig = {
50
50
  thinkingBudget?: number;
51
51
  includeThoughts?: boolean;
52
- thinkingLevel?: string;
52
+ thinkingLevel?: 'THINKING_LEVEL_UNSPECIFIED' | 'LOW' | 'MEDIUM' | 'HIGH';
53
53
  };
54
54
  export type OpenAIClientOptions = ChatOpenAIFields;
55
55
  export type AnthropicClientOptions = Omit<AnthropicInput, 'thinking'> & {
@@ -71,7 +71,7 @@ export type GoogleClientOptions = GoogleGenerativeAIChatInput & {
71
71
  customHeaders?: RequestOptions['customHeaders'];
72
72
  thinkingConfig?: GoogleThinkingConfig;
73
73
  };
74
- export type DeepSeekClientOptions = ChatDeepSeekCallOptions;
74
+ export type DeepSeekClientOptions = Partial<ChatDeepSeekInput>;
75
75
  export type XAIClientOptions = ChatXAIInput;
76
76
  export type ClientOptions = OpenAIClientOptions | AzureClientOptions | AnthropicClientOptions | MistralAIClientOptions | VertexAIClientOptions | BedrockConverseClientOptions | GoogleClientOptions | DeepSeekClientOptions | XAIClientOptions;
77
77
  export type SharedLLMConfig = {
@@ -8,6 +8,7 @@ import type * as e from '@/common/enum';
8
8
  import type * as g from '@/types/graph';
9
9
  import type * as l from '@/types/llm';
10
10
  import type { ToolSessionMap, ToolOutputReferencesConfig } from '@/types/tools';
11
+ import type { HumanInTheLoopConfig } from '@/types/hitl';
11
12
  import type { HookRegistry } from '@/hooks';
12
13
  export type ZodObjectAny = z.ZodObject<any, any, any, any>;
13
14
  export type BaseGraphConfig = {
@@ -144,6 +145,38 @@ export type RunConfig = {
144
145
  * placeholders. Disabled by default so existing runs are unaffected.
145
146
  */
146
147
  toolOutputReferences?: ToolOutputReferencesConfig;
148
+ /**
149
+ * First-class human-in-the-loop (HITL) flow for this run.
150
+ *
151
+ * **HITL is OFF by default.** Omitting this field — or passing
152
+ * `{ enabled: false }` — keeps the pre-HITL fail-closed semantics
153
+ * where `ask` decisions collapse into a synchronous deny. Hosts opt
154
+ * in explicitly with `{ enabled: true }` once their UI can render
155
+ * and resolve `tool_approval` interrupts (otherwise the run just
156
+ * pauses with no resolver, which surfaces to end users as a hung
157
+ * tool-call card).
158
+ *
159
+ * Plan of record: the default flips back to ON in a future minor
160
+ * once the consumer ecosystem (notably LibreChat) ships HITL UI
161
+ * end-to-end. See `HumanInTheLoopConfig` JSDoc.
162
+ *
163
+ * When enabled (`{ enabled: true }`):
164
+ * - `PreToolUse` hooks returning `decision: 'ask'` raise a real
165
+ * LangGraph `interrupt()` instead of being treated as a synchronous
166
+ * deny. The graph pauses and the run exits cleanly.
167
+ * - If `graphConfig.compileOptions.checkpointer` is missing, the SDK
168
+ * installs an in-memory `MemorySaver` as a fallback so scripts and
169
+ * tests can resume without external infrastructure. Production
170
+ * hosts should always provide a durable checkpointer.
171
+ * - Hosts inspect the pending interrupt via `run.getInterrupt()` and
172
+ * continue with `Run.resume(decisions)` against a Run rebuilt with
173
+ * the same `thread_id` and checkpointer.
174
+ *
175
+ * When disabled (the default): `ask` decisions remain fail-closed
176
+ * (blocked with an error `ToolMessage`) and no checkpointer is
177
+ * implicitly attached.
178
+ */
179
+ humanInTheLoop?: HumanInTheLoopConfig;
147
180
  };
148
181
  export type ProvidedCallbacks = (BaseCallbackHandler | CallbackHandlerMethods)[] | undefined;
149
182
  export type TokenCounter = (message: BaseMessage) => number;
@@ -138,7 +138,7 @@ export interface ExtendedMessageContent {
138
138
  type?: string;
139
139
  text?: string;
140
140
  input?: string;
141
- index?: number;
141
+ index?: string | number;
142
142
  id?: string;
143
143
  name?: string;
144
144
  }
@@ -4,6 +4,7 @@ import type { ToolCall } from '@langchain/core/messages/tool';
4
4
  import type { HookRegistry } from '@/hooks';
5
5
  import type { ToolOutputReferenceRegistry } from '@/tools/toolOutputReferences';
6
6
  import type { MessageContentComplex, ToolErrorData } from './stream';
7
+ import type { HumanInTheLoopConfig } from './hitl';
7
8
  /** Replacement type for `import type { ToolCall } from '@langchain/core/messages/tool'` in order to have stringified args typed */
8
9
  export type CustomToolCall = {
9
10
  name: string;
@@ -46,6 +47,24 @@ export type ToolNodeOptions = {
46
47
  * routed through `directToolNames` bypass hook dispatch entirely.
47
48
  */
48
49
  hookRegistry?: HookRegistry;
50
+ /**
51
+ * Run-scoped HITL config. **HITL is OFF by default** — omitting this
52
+ * field (or passing `{ enabled: false }`) keeps the pre-HITL
53
+ * fail-closed behavior where a `PreToolUse` `ask` decision collapses
54
+ * into a blocked `ToolMessage`. Hosts opt in with
55
+ * `{ enabled: true }` once their UI can render and resolve a
56
+ * `tool_approval` interrupt; that engages the interrupt path where
57
+ * `ask` raises a real LangGraph `interrupt()` carrying a
58
+ * `HumanInterruptPayload` and the host resumes with
59
+ * `Run.resume(decisions)`.
60
+ *
61
+ * Mirrors `RunConfig.humanInTheLoop` (which is the canonical place
62
+ * to set this); the Graph threads it down to every ToolNode it
63
+ * compiles. Same caveat: the interrupt path is only wired into the
64
+ * event-driven dispatch (`dispatchToolEvents`), not into
65
+ * `directToolNames` execution — direct tools bypass HITL entirely.
66
+ */
67
+ humanInTheLoop?: HumanInTheLoopConfig;
49
68
  /** Max context tokens for the agent — used to compute tool result truncation limits. */
50
69
  maxContextTokens?: number;
51
70
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@librechat/agents",
3
- "version": "3.1.75",
3
+ "version": "3.1.77-dev.1",
4
4
  "main": "./dist/cjs/main.cjs",
5
5
  "module": "./dist/esm/main.mjs",
6
6
  "types": "./dist/types/index.d.ts",
@@ -9,6 +9,66 @@
9
9
  "import": "./dist/esm/main.mjs",
10
10
  "require": "./dist/cjs/main.cjs",
11
11
  "types": "./dist/types/index.d.ts"
12
+ },
13
+ "./langchain": {
14
+ "import": "./dist/esm/langchain/index.mjs",
15
+ "require": "./dist/cjs/langchain/index.cjs",
16
+ "types": "./dist/types/langchain/index.d.ts"
17
+ },
18
+ "./langchain/language_models/chat_models": {
19
+ "import": "./dist/esm/langchain/language_models/chat_models.mjs",
20
+ "require": "./dist/cjs/langchain/language_models/chat_models.cjs",
21
+ "types": "./dist/types/langchain/language_models/chat_models.d.ts"
22
+ },
23
+ "./langchain/messages": {
24
+ "import": "./dist/esm/langchain/messages.mjs",
25
+ "require": "./dist/cjs/langchain/messages.cjs",
26
+ "types": "./dist/types/langchain/messages.d.ts"
27
+ },
28
+ "./langchain/messages/tool": {
29
+ "import": "./dist/esm/langchain/messages/tool.mjs",
30
+ "require": "./dist/cjs/langchain/messages/tool.cjs",
31
+ "types": "./dist/types/langchain/messages/tool.d.ts"
32
+ },
33
+ "./langchain/google-common": {
34
+ "import": "./dist/esm/langchain/google-common.mjs",
35
+ "require": "./dist/cjs/langchain/google-common.cjs",
36
+ "types": "./dist/types/langchain/google-common.d.ts"
37
+ },
38
+ "./langchain/openai": {
39
+ "import": "./dist/esm/langchain/openai.mjs",
40
+ "require": "./dist/cjs/langchain/openai.cjs",
41
+ "types": "./dist/types/langchain/openai.d.ts"
42
+ },
43
+ "./langchain/prompts": {
44
+ "import": "./dist/esm/langchain/prompts.mjs",
45
+ "require": "./dist/cjs/langchain/prompts.cjs",
46
+ "types": "./dist/types/langchain/prompts.d.ts"
47
+ },
48
+ "./langchain/runnables": {
49
+ "import": "./dist/esm/langchain/runnables.mjs",
50
+ "require": "./dist/cjs/langchain/runnables.cjs",
51
+ "types": "./dist/types/langchain/runnables.d.ts"
52
+ },
53
+ "./langchain/tools": {
54
+ "import": "./dist/esm/langchain/tools.mjs",
55
+ "require": "./dist/cjs/langchain/tools.cjs",
56
+ "types": "./dist/types/langchain/tools.d.ts"
57
+ },
58
+ "./langchain/utils/env": {
59
+ "import": "./dist/esm/langchain/utils/env.mjs",
60
+ "require": "./dist/cjs/langchain/utils/env.cjs",
61
+ "types": "./dist/types/langchain/utils/env.d.ts"
62
+ }
63
+ },
64
+ "typesVersions": {
65
+ "*": {
66
+ "langchain": [
67
+ "dist/types/langchain/index.d.ts"
68
+ ],
69
+ "langchain/*": [
70
+ "dist/types/langchain/*"
71
+ ]
12
72
  }
13
73
  },
14
74
  "type": "module",
@@ -27,7 +87,7 @@
27
87
  ],
28
88
  "packageManager": "npm@10.5.2",
29
89
  "engines": {
30
- "node": ">=14.0.0"
90
+ "node": ">=20.0.0"
31
91
  },
32
92
  "files": [
33
93
  "dist",
@@ -111,29 +171,31 @@
111
171
  "format": "prettier --write ."
112
172
  },
113
173
  "overrides": {
114
- "@langchain/openai": "0.5.18",
174
+ "@langchain/openai": "1.4.5",
115
175
  "@anthropic-ai/sdk": "$@anthropic-ai/sdk",
116
176
  "@browserbasehq/stagehand": {
117
177
  "openai": "$openai"
118
178
  },
119
- "fast-xml-parser": "5.5.7",
179
+ "fast-xml-parser": "5.7.2",
120
180
  "ajv": "6.14.0",
121
181
  "minimatch": "3.1.4"
122
182
  },
123
183
  "dependencies": {
124
- "@anthropic-ai/sdk": "^0.73.0",
184
+ "@anthropic-ai/sdk": "^0.92.0",
125
185
  "@aws-sdk/client-bedrock-runtime": "^3.1013.0",
126
- "@langchain/anthropic": "^0.3.26",
127
- "@langchain/aws": "^0.1.15",
128
- "@langchain/core": "^0.3.80",
129
- "@langchain/deepseek": "^0.0.2",
130
- "@langchain/google-genai": "^0.2.18",
131
- "@langchain/google-vertexai": "^0.2.18",
132
- "@langchain/langgraph": "^0.4.9",
133
- "@langchain/mistralai": "^0.2.1",
134
- "@langchain/openai": "0.5.18",
135
- "@langchain/textsplitters": "^0.1.0",
136
- "@langchain/xai": "^0.0.3",
186
+ "@langchain/anthropic": "^1.3.28",
187
+ "@langchain/aws": "^1.3.5",
188
+ "@langchain/core": "1.1.44",
189
+ "@langchain/deepseek": "^1.0.25",
190
+ "@langchain/google-common": "2.1.30",
191
+ "@langchain/google-gauth": "2.1.30",
192
+ "@langchain/google-genai": "2.1.30",
193
+ "@langchain/google-vertexai": "2.1.30",
194
+ "@langchain/langgraph": "^1.2.9",
195
+ "@langchain/mistralai": "^1.0.8",
196
+ "@langchain/openai": "1.4.5",
197
+ "@langchain/textsplitters": "^1.0.1",
198
+ "@langchain/xai": "^1.3.17",
137
199
  "@langfuse/langchain": "^4.3.0",
138
200
  "@langfuse/otel": "^4.3.0",
139
201
  "@langfuse/tracing": "^4.3.0",
@@ -147,7 +209,8 @@
147
209
  "mathjs": "^15.2.0",
148
210
  "nanoid": "^3.3.7",
149
211
  "okapibm25": "^1.4.1",
150
- "openai": "5.8.2"
212
+ "openai": "^6.35.0",
213
+ "uuid": "^11.1.1"
151
214
  },
152
215
  "imports": {
153
216
  "@/*": "./src/*",