langchain 1.0.0-alpha.8 → 1.0.0-alpha.9

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 (442) hide show
  1. package/LICENSE +6 -6
  2. package/dist/agents/ReactAgent.cjs +497 -104
  3. package/dist/agents/ReactAgent.cjs.map +1 -1
  4. package/dist/agents/ReactAgent.d.cts +140 -17
  5. package/dist/agents/ReactAgent.d.cts.map +1 -1
  6. package/dist/agents/ReactAgent.d.ts +140 -17
  7. package/dist/agents/ReactAgent.d.ts.map +1 -1
  8. package/dist/agents/ReactAgent.js +500 -107
  9. package/dist/agents/ReactAgent.js.map +1 -1
  10. package/dist/agents/annotation.cjs +32 -149
  11. package/dist/agents/annotation.cjs.map +1 -1
  12. package/dist/agents/annotation.js +34 -147
  13. package/dist/agents/annotation.js.map +1 -1
  14. package/dist/agents/constants.cjs.map +1 -1
  15. package/dist/agents/constants.d.cts +9 -0
  16. package/dist/agents/constants.d.cts.map +1 -0
  17. package/dist/agents/constants.d.ts +9 -0
  18. package/dist/agents/constants.d.ts.map +1 -0
  19. package/dist/agents/constants.js.map +1 -1
  20. package/dist/agents/errors.cjs +2 -1
  21. package/dist/agents/errors.cjs.map +1 -1
  22. package/dist/agents/errors.js +2 -1
  23. package/dist/agents/errors.js.map +1 -1
  24. package/dist/agents/index.cjs +5 -29
  25. package/dist/agents/index.cjs.map +1 -1
  26. package/dist/agents/index.d.cts +157 -128
  27. package/dist/agents/index.d.cts.map +1 -1
  28. package/dist/agents/index.d.ts +157 -128
  29. package/dist/agents/index.d.ts.map +1 -1
  30. package/dist/agents/index.js +5 -27
  31. package/dist/agents/index.js.map +1 -1
  32. package/dist/agents/{middlewareAgent/middleware → middleware}/callLimit.cjs +2 -2
  33. package/dist/agents/middleware/callLimit.cjs.map +1 -0
  34. package/dist/agents/{middlewareAgent/middleware → middleware}/callLimit.d.cts +3 -3
  35. package/dist/agents/middleware/callLimit.d.cts.map +1 -0
  36. package/dist/agents/{middlewareAgent/middleware → middleware}/callLimit.d.ts +3 -3
  37. package/dist/agents/middleware/callLimit.d.ts.map +1 -0
  38. package/dist/agents/{middlewareAgent/middleware → middleware}/callLimit.js +1 -1
  39. package/dist/agents/middleware/callLimit.js.map +1 -0
  40. package/dist/agents/{middlewareAgent/middleware → middleware}/contextEditing.cjs +5 -5
  41. package/dist/agents/middleware/contextEditing.cjs.map +1 -0
  42. package/dist/agents/{middlewareAgent/middleware → middleware}/contextEditing.d.cts +2 -2
  43. package/dist/agents/middleware/contextEditing.d.cts.map +1 -0
  44. package/dist/agents/{middlewareAgent/middleware → middleware}/contextEditing.d.ts +2 -2
  45. package/dist/agents/middleware/contextEditing.d.ts.map +1 -0
  46. package/dist/agents/{middlewareAgent/middleware → middleware}/contextEditing.js +4 -4
  47. package/dist/agents/middleware/contextEditing.js.map +1 -0
  48. package/dist/agents/{middlewareAgent/middleware → middleware}/dynamicSystemPrompt.cjs +6 -6
  49. package/dist/agents/middleware/dynamicSystemPrompt.cjs.map +1 -0
  50. package/dist/agents/{middlewareAgent/middleware → middleware}/dynamicSystemPrompt.d.cts +3 -2
  51. package/dist/agents/middleware/dynamicSystemPrompt.d.cts.map +1 -0
  52. package/dist/agents/{middlewareAgent/middleware → middleware}/dynamicSystemPrompt.d.ts +3 -2
  53. package/dist/agents/middleware/dynamicSystemPrompt.d.ts.map +1 -0
  54. package/dist/agents/{middlewareAgent/middleware → middleware}/dynamicSystemPrompt.js +6 -6
  55. package/dist/agents/middleware/dynamicSystemPrompt.js.map +1 -0
  56. package/dist/agents/middleware/hitl.cjs +404 -0
  57. package/dist/agents/middleware/hitl.cjs.map +1 -0
  58. package/dist/agents/middleware/hitl.d.cts +611 -0
  59. package/dist/agents/middleware/hitl.d.cts.map +1 -0
  60. package/dist/agents/middleware/hitl.d.ts +611 -0
  61. package/dist/agents/middleware/hitl.d.ts.map +1 -0
  62. package/dist/agents/middleware/hitl.js +403 -0
  63. package/dist/agents/middleware/hitl.js.map +1 -0
  64. package/dist/agents/middleware/index.cjs +12 -0
  65. package/dist/agents/middleware/index.js +12 -0
  66. package/dist/agents/{middlewareAgent/middleware → middleware}/llmToolSelector.cjs +7 -7
  67. package/dist/agents/middleware/llmToolSelector.cjs.map +1 -0
  68. package/dist/agents/{middlewareAgent/middleware → middleware}/llmToolSelector.d.cts +2 -2
  69. package/dist/agents/middleware/llmToolSelector.d.cts.map +1 -0
  70. package/dist/agents/{middlewareAgent/middleware → middleware}/llmToolSelector.d.ts +2 -2
  71. package/dist/agents/middleware/llmToolSelector.d.ts.map +1 -0
  72. package/dist/agents/{middlewareAgent/middleware → middleware}/llmToolSelector.js +6 -6
  73. package/dist/agents/middleware/llmToolSelector.js.map +1 -0
  74. package/dist/agents/{middlewareAgent/middleware → middleware}/modelFallback.cjs +28 -21
  75. package/dist/agents/middleware/modelFallback.cjs.map +1 -0
  76. package/dist/agents/{middlewareAgent/middleware → middleware}/modelFallback.d.cts +2 -2
  77. package/dist/agents/middleware/modelFallback.d.cts.map +1 -0
  78. package/dist/agents/{middlewareAgent/middleware → middleware}/modelFallback.d.ts +2 -2
  79. package/dist/agents/middleware/modelFallback.d.ts.map +1 -0
  80. package/dist/agents/{middlewareAgent/middleware → middleware}/modelFallback.js +28 -21
  81. package/dist/agents/middleware/modelFallback.js.map +1 -0
  82. package/dist/agents/{middlewareAgent/middleware → middleware}/piiRedaction.cjs +12 -12
  83. package/dist/agents/middleware/piiRedaction.cjs.map +1 -0
  84. package/dist/agents/{middlewareAgent/middleware → middleware}/piiRedaction.d.cts +4 -4
  85. package/dist/agents/middleware/piiRedaction.d.cts.map +1 -0
  86. package/dist/agents/{middlewareAgent/middleware → middleware}/piiRedaction.d.ts +4 -4
  87. package/dist/agents/middleware/piiRedaction.d.ts.map +1 -0
  88. package/dist/agents/{middlewareAgent/middleware → middleware}/piiRedaction.js +10 -10
  89. package/dist/agents/middleware/piiRedaction.js.map +1 -0
  90. package/dist/agents/{middlewareAgent/middleware → middleware}/promptCaching.cjs +27 -24
  91. package/dist/agents/middleware/promptCaching.cjs.map +1 -0
  92. package/dist/agents/{middlewareAgent/middleware → middleware}/promptCaching.d.cts +3 -3
  93. package/dist/agents/middleware/promptCaching.d.cts.map +1 -0
  94. package/dist/agents/{middlewareAgent/middleware → middleware}/promptCaching.d.ts +3 -3
  95. package/dist/agents/middleware/promptCaching.d.ts.map +1 -0
  96. package/dist/agents/{middlewareAgent/middleware → middleware}/promptCaching.js +26 -23
  97. package/dist/agents/middleware/promptCaching.js.map +1 -0
  98. package/dist/agents/{middlewareAgent/middleware → middleware}/summarization.cjs +7 -12
  99. package/dist/agents/middleware/summarization.cjs.map +1 -0
  100. package/dist/agents/{middlewareAgent/middleware → middleware}/summarization.d.cts +3 -3
  101. package/dist/agents/middleware/summarization.d.cts.map +1 -0
  102. package/dist/agents/{middlewareAgent/middleware → middleware}/summarization.d.ts +3 -3
  103. package/dist/agents/middleware/summarization.d.ts.map +1 -0
  104. package/dist/agents/{middlewareAgent/middleware → middleware}/summarization.js +4 -9
  105. package/dist/agents/middleware/summarization.js.map +1 -0
  106. package/dist/agents/middleware/todoListMiddleware.cjs +314 -0
  107. package/dist/agents/middleware/todoListMiddleware.cjs.map +1 -0
  108. package/dist/agents/middleware/todoListMiddleware.d.cts +75 -0
  109. package/dist/agents/middleware/todoListMiddleware.d.cts.map +1 -0
  110. package/dist/agents/middleware/todoListMiddleware.d.ts +75 -0
  111. package/dist/agents/middleware/todoListMiddleware.d.ts.map +1 -0
  112. package/dist/agents/middleware/todoListMiddleware.js +312 -0
  113. package/dist/agents/middleware/todoListMiddleware.js.map +1 -0
  114. package/dist/agents/{middlewareAgent/middleware → middleware}/toolCallLimit.cjs +2 -2
  115. package/dist/agents/middleware/toolCallLimit.cjs.map +1 -0
  116. package/dist/agents/{middlewareAgent/middleware → middleware}/toolCallLimit.d.cts +3 -3
  117. package/dist/agents/middleware/toolCallLimit.d.cts.map +1 -0
  118. package/dist/agents/{middlewareAgent/middleware → middleware}/toolCallLimit.d.ts +3 -3
  119. package/dist/agents/middleware/toolCallLimit.d.ts.map +1 -0
  120. package/dist/agents/{middlewareAgent/middleware → middleware}/toolCallLimit.js +1 -1
  121. package/dist/agents/middleware/toolCallLimit.js.map +1 -0
  122. package/dist/agents/middleware/types.d.cts +208 -0
  123. package/dist/agents/middleware/types.d.cts.map +1 -0
  124. package/dist/agents/middleware/types.d.ts +208 -0
  125. package/dist/agents/middleware/types.d.ts.map +1 -0
  126. package/dist/agents/{middlewareAgent/middleware → middleware}/utils.cjs +1 -1
  127. package/dist/agents/middleware/utils.cjs.map +1 -0
  128. package/dist/agents/{middlewareAgent/middleware → middleware}/utils.d.cts +1 -1
  129. package/dist/agents/middleware/utils.d.cts.map +1 -0
  130. package/dist/agents/{middlewareAgent/middleware → middleware}/utils.d.ts +1 -1
  131. package/dist/agents/middleware/utils.d.ts.map +1 -0
  132. package/dist/agents/{middlewareAgent/middleware → middleware}/utils.js +1 -1
  133. package/dist/agents/middleware/utils.js.map +1 -0
  134. package/dist/agents/{middlewareAgent/middleware.cjs → middleware.cjs} +11 -4
  135. package/dist/agents/middleware.cjs.map +1 -0
  136. package/dist/agents/middleware.d.cts +205 -0
  137. package/dist/agents/middleware.d.cts.map +1 -0
  138. package/dist/agents/middleware.d.ts +205 -0
  139. package/dist/agents/middleware.d.ts.map +1 -0
  140. package/dist/agents/{middlewareAgent/middleware.js → middleware.js} +11 -4
  141. package/dist/agents/middleware.js.map +1 -0
  142. package/dist/agents/nodes/AfterAgentNode.cjs +27 -0
  143. package/dist/agents/nodes/AfterAgentNode.cjs.map +1 -0
  144. package/dist/agents/nodes/AfterAgentNode.js +27 -0
  145. package/dist/agents/nodes/AfterAgentNode.js.map +1 -0
  146. package/dist/agents/{middlewareAgent/nodes/AfterModalNode.cjs → nodes/AfterModelNode.cjs} +3 -5
  147. package/dist/agents/nodes/AfterModelNode.cjs.map +1 -0
  148. package/dist/agents/{middlewareAgent/nodes/AfterModalNode.js → nodes/AfterModelNode.js} +3 -5
  149. package/dist/agents/nodes/AfterModelNode.js.map +1 -0
  150. package/dist/agents/nodes/AgentNode.cjs +202 -71
  151. package/dist/agents/nodes/AgentNode.cjs.map +1 -1
  152. package/dist/agents/nodes/AgentNode.js +204 -73
  153. package/dist/agents/nodes/AgentNode.js.map +1 -1
  154. package/dist/agents/nodes/BeforeAgentNode.cjs +27 -0
  155. package/dist/agents/nodes/BeforeAgentNode.cjs.map +1 -0
  156. package/dist/agents/nodes/BeforeAgentNode.js +27 -0
  157. package/dist/agents/nodes/BeforeAgentNode.js.map +1 -0
  158. package/dist/agents/{middlewareAgent/nodes/BeforeModalNode.cjs → nodes/BeforeModelNode.cjs} +3 -3
  159. package/dist/agents/nodes/BeforeModelNode.cjs.map +1 -0
  160. package/dist/agents/{middlewareAgent/nodes/BeforeModalNode.js → nodes/BeforeModelNode.js} +3 -3
  161. package/dist/agents/nodes/BeforeModelNode.js.map +1 -0
  162. package/dist/agents/nodes/ToolNode.cjs +157 -47
  163. package/dist/agents/nodes/ToolNode.cjs.map +1 -1
  164. package/dist/agents/nodes/ToolNode.js +158 -48
  165. package/dist/agents/nodes/ToolNode.js.map +1 -1
  166. package/dist/agents/{middlewareAgent/nodes → nodes}/middleware.cjs +35 -10
  167. package/dist/agents/nodes/middleware.cjs.map +1 -0
  168. package/dist/agents/{middlewareAgent/nodes → nodes}/middleware.js +34 -9
  169. package/dist/agents/nodes/middleware.js.map +1 -0
  170. package/dist/agents/nodes/types.d.cts +57 -0
  171. package/dist/agents/nodes/types.d.cts.map +1 -0
  172. package/dist/agents/nodes/types.d.ts +57 -0
  173. package/dist/agents/nodes/types.d.ts.map +1 -0
  174. package/dist/agents/nodes/utils.cjs +64 -0
  175. package/dist/agents/nodes/utils.cjs.map +1 -1
  176. package/dist/agents/nodes/utils.js +62 -1
  177. package/dist/agents/nodes/utils.js.map +1 -1
  178. package/dist/agents/responses.cjs +1 -1
  179. package/dist/agents/responses.cjs.map +1 -1
  180. package/dist/agents/responses.d.cts +9 -2
  181. package/dist/agents/responses.d.cts.map +1 -1
  182. package/dist/agents/responses.d.ts +8 -1
  183. package/dist/agents/responses.d.ts.map +1 -1
  184. package/dist/agents/responses.js +1 -1
  185. package/dist/agents/responses.js.map +1 -1
  186. package/dist/agents/runtime.d.cts +123 -0
  187. package/dist/agents/runtime.d.cts.map +1 -0
  188. package/dist/agents/runtime.d.ts +123 -0
  189. package/dist/agents/runtime.d.ts.map +1 -0
  190. package/dist/agents/tests/utils.cjs +13 -5
  191. package/dist/agents/tests/utils.cjs.map +1 -1
  192. package/dist/agents/tests/utils.d.cts +17 -8
  193. package/dist/agents/tests/utils.d.cts.map +1 -1
  194. package/dist/agents/tests/utils.d.ts +14 -5
  195. package/dist/agents/tests/utils.d.ts.map +1 -1
  196. package/dist/agents/tests/utils.js +13 -5
  197. package/dist/agents/tests/utils.js.map +1 -1
  198. package/dist/agents/tools.d.cts +9 -0
  199. package/dist/agents/tools.d.cts.map +1 -0
  200. package/dist/agents/tools.d.ts +9 -0
  201. package/dist/agents/tools.d.ts.map +1 -0
  202. package/dist/agents/types.d.cts +125 -126
  203. package/dist/agents/types.d.cts.map +1 -1
  204. package/dist/agents/types.d.ts +125 -126
  205. package/dist/agents/types.d.ts.map +1 -1
  206. package/dist/agents/utils.cjs +141 -38
  207. package/dist/agents/utils.cjs.map +1 -1
  208. package/dist/agents/utils.js +142 -40
  209. package/dist/agents/utils.js.map +1 -1
  210. package/dist/chat_models/universal.cjs +4 -0
  211. package/dist/chat_models/universal.cjs.map +1 -1
  212. package/dist/chat_models/universal.d.cts +6 -2
  213. package/dist/chat_models/universal.d.cts.map +1 -1
  214. package/dist/chat_models/universal.d.ts +4 -0
  215. package/dist/chat_models/universal.d.ts.map +1 -1
  216. package/dist/chat_models/universal.js +4 -0
  217. package/dist/chat_models/universal.js.map +1 -1
  218. package/dist/hub/base.cjs +4 -3
  219. package/dist/hub/base.cjs.map +1 -1
  220. package/dist/hub/base.d.cts +0 -4
  221. package/dist/hub/base.d.cts.map +1 -1
  222. package/dist/hub/base.d.ts +0 -4
  223. package/dist/hub/base.d.ts.map +1 -1
  224. package/dist/hub/base.js +4 -3
  225. package/dist/hub/base.js.map +1 -1
  226. package/dist/index.cjs +18 -38
  227. package/dist/index.cjs.map +1 -1
  228. package/dist/index.d.cts +21 -21
  229. package/dist/index.d.ts +21 -21
  230. package/dist/index.js +17 -26
  231. package/dist/index.js.map +1 -1
  232. package/dist/load/import_map.cjs +0 -2
  233. package/dist/load/import_map.cjs.map +1 -1
  234. package/dist/load/import_map.js +0 -2
  235. package/dist/load/import_map.js.map +1 -1
  236. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/client.cjs +74 -18
  237. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/client.cjs.map +1 -0
  238. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/client.js +75 -19
  239. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/client.js.map +1 -0
  240. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/env.cjs +1 -1
  241. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/env.cjs.map +1 -1
  242. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/env.js +1 -1
  243. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/env.js.map +1 -1
  244. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/constants.cjs +1 -1
  245. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/constants.cjs.map +1 -1
  246. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/constants.js +1 -1
  247. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/constants.js.map +1 -1
  248. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/translator.cjs +1 -1
  249. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/translator.cjs.map +1 -1
  250. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/translator.js +1 -1
  251. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/translator.js.map +1 -1
  252. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/index.cjs +2 -2
  253. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/index.cjs.map +1 -1
  254. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/index.js +2 -2
  255. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/index.js.map +1 -1
  256. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/run_trees.cjs +7 -5
  257. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.cjs.map +1 -0
  258. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/run_trees.js +7 -5
  259. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.js.map +1 -0
  260. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/constants.cjs +1 -1
  261. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/constants.cjs.map +1 -1
  262. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/constants.js +1 -1
  263. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/constants.js.map +1 -1
  264. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/fetch.cjs +1 -1
  265. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/fetch.cjs.map +1 -1
  266. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/fetch.js +1 -1
  267. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/fetch.js.map +1 -1
  268. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/otel.cjs +1 -1
  269. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/otel.cjs.map +1 -1
  270. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/otel.js +1 -1
  271. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/otel.js.map +1 -1
  272. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/_uuid.cjs +1 -1
  273. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/_uuid.cjs.map +1 -1
  274. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/_uuid.js +1 -1
  275. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/_uuid.js.map +1 -1
  276. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/async_caller.cjs +1 -1
  277. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/async_caller.cjs.map +1 -1
  278. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/async_caller.js +1 -1
  279. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/async_caller.js.map +1 -1
  280. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/env.cjs +19 -23
  281. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/env.cjs.map +1 -0
  282. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/env.js +19 -23
  283. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/env.js.map +1 -0
  284. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/error.cjs +16 -3
  285. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/error.cjs.map +1 -0
  286. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/error.js +16 -3
  287. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/error.js.map +1 -0
  288. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/fast-safe-stringify/index.cjs +1 -1
  289. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/fast-safe-stringify/index.cjs.map +1 -1
  290. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/fast-safe-stringify/index.js +1 -1
  291. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/fast-safe-stringify/index.js.map +1 -1
  292. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/messages.cjs +1 -1
  293. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/messages.cjs.map +1 -1
  294. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/messages.js +1 -1
  295. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/messages.js.map +1 -1
  296. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/project.cjs +1 -1
  297. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/project.cjs.map +1 -1
  298. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/project.js +1 -1
  299. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/project.js.map +1 -1
  300. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/prompts.cjs +1 -1
  301. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/prompts.cjs.map +1 -1
  302. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/prompts.js +1 -1
  303. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/prompts.js.map +1 -1
  304. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/warn.cjs +1 -1
  305. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/warn.cjs.map +1 -1
  306. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/warn.js +1 -1
  307. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/warn.js.map +1 -1
  308. package/package.json +4 -18
  309. package/dist/agents/RunnableCallable.d.cts +0 -41
  310. package/dist/agents/RunnableCallable.d.cts.map +0 -1
  311. package/dist/agents/RunnableCallable.d.ts +0 -41
  312. package/dist/agents/RunnableCallable.d.ts.map +0 -1
  313. package/dist/agents/annotation.d.cts +0 -52
  314. package/dist/agents/annotation.d.cts.map +0 -1
  315. package/dist/agents/annotation.d.ts +0 -52
  316. package/dist/agents/annotation.d.ts.map +0 -1
  317. package/dist/agents/createAgent.cjs +0 -10
  318. package/dist/agents/createAgent.cjs.map +0 -1
  319. package/dist/agents/createAgent.js +0 -10
  320. package/dist/agents/createAgent.js.map +0 -1
  321. package/dist/agents/interrupt.cjs +0 -2
  322. package/dist/agents/interrupt.d.cts +0 -81
  323. package/dist/agents/interrupt.d.cts.map +0 -1
  324. package/dist/agents/interrupt.d.ts +0 -81
  325. package/dist/agents/interrupt.d.ts.map +0 -1
  326. package/dist/agents/interrupt.js +0 -3
  327. package/dist/agents/middlewareAgent/ReactAgent.cjs +0 -579
  328. package/dist/agents/middlewareAgent/ReactAgent.cjs.map +0 -1
  329. package/dist/agents/middlewareAgent/ReactAgent.d.cts +0 -234
  330. package/dist/agents/middlewareAgent/ReactAgent.d.cts.map +0 -1
  331. package/dist/agents/middlewareAgent/ReactAgent.d.ts +0 -234
  332. package/dist/agents/middlewareAgent/ReactAgent.d.ts.map +0 -1
  333. package/dist/agents/middlewareAgent/ReactAgent.js +0 -578
  334. package/dist/agents/middlewareAgent/ReactAgent.js.map +0 -1
  335. package/dist/agents/middlewareAgent/annotation.cjs +0 -45
  336. package/dist/agents/middlewareAgent/annotation.cjs.map +0 -1
  337. package/dist/agents/middlewareAgent/annotation.js +0 -44
  338. package/dist/agents/middlewareAgent/annotation.js.map +0 -1
  339. package/dist/agents/middlewareAgent/constants.d.cts +0 -5
  340. package/dist/agents/middlewareAgent/constants.d.cts.map +0 -1
  341. package/dist/agents/middlewareAgent/constants.d.ts +0 -5
  342. package/dist/agents/middlewareAgent/constants.d.ts.map +0 -1
  343. package/dist/agents/middlewareAgent/index.cjs +0 -11
  344. package/dist/agents/middlewareAgent/index.cjs.map +0 -1
  345. package/dist/agents/middlewareAgent/index.js +0 -11
  346. package/dist/agents/middlewareAgent/index.js.map +0 -1
  347. package/dist/agents/middlewareAgent/middleware/callLimit.cjs.map +0 -1
  348. package/dist/agents/middlewareAgent/middleware/callLimit.d.cts.map +0 -1
  349. package/dist/agents/middlewareAgent/middleware/callLimit.d.ts.map +0 -1
  350. package/dist/agents/middlewareAgent/middleware/callLimit.js.map +0 -1
  351. package/dist/agents/middlewareAgent/middleware/contextEditing.cjs.map +0 -1
  352. package/dist/agents/middlewareAgent/middleware/contextEditing.d.cts.map +0 -1
  353. package/dist/agents/middlewareAgent/middleware/contextEditing.d.ts.map +0 -1
  354. package/dist/agents/middlewareAgent/middleware/contextEditing.js.map +0 -1
  355. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.cjs.map +0 -1
  356. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.cts.map +0 -1
  357. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.ts.map +0 -1
  358. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.js.map +0 -1
  359. package/dist/agents/middlewareAgent/middleware/hitl.cjs +0 -341
  360. package/dist/agents/middlewareAgent/middleware/hitl.cjs.map +0 -1
  361. package/dist/agents/middlewareAgent/middleware/hitl.d.cts +0 -524
  362. package/dist/agents/middlewareAgent/middleware/hitl.d.cts.map +0 -1
  363. package/dist/agents/middlewareAgent/middleware/hitl.d.ts +0 -524
  364. package/dist/agents/middlewareAgent/middleware/hitl.d.ts.map +0 -1
  365. package/dist/agents/middlewareAgent/middleware/hitl.js +0 -340
  366. package/dist/agents/middlewareAgent/middleware/hitl.js.map +0 -1
  367. package/dist/agents/middlewareAgent/middleware/index.cjs +0 -52
  368. package/dist/agents/middlewareAgent/middleware/index.cjs.map +0 -1
  369. package/dist/agents/middlewareAgent/middleware/index.d.cts +0 -13
  370. package/dist/agents/middlewareAgent/middleware/index.d.ts +0 -13
  371. package/dist/agents/middlewareAgent/middleware/index.js +0 -34
  372. package/dist/agents/middlewareAgent/middleware/index.js.map +0 -1
  373. package/dist/agents/middlewareAgent/middleware/llmToolSelector.cjs.map +0 -1
  374. package/dist/agents/middlewareAgent/middleware/llmToolSelector.d.cts.map +0 -1
  375. package/dist/agents/middlewareAgent/middleware/llmToolSelector.d.ts.map +0 -1
  376. package/dist/agents/middlewareAgent/middleware/llmToolSelector.js.map +0 -1
  377. package/dist/agents/middlewareAgent/middleware/modelFallback.cjs.map +0 -1
  378. package/dist/agents/middlewareAgent/middleware/modelFallback.d.cts.map +0 -1
  379. package/dist/agents/middlewareAgent/middleware/modelFallback.d.ts.map +0 -1
  380. package/dist/agents/middlewareAgent/middleware/modelFallback.js.map +0 -1
  381. package/dist/agents/middlewareAgent/middleware/piiRedaction.cjs.map +0 -1
  382. package/dist/agents/middlewareAgent/middleware/piiRedaction.d.cts.map +0 -1
  383. package/dist/agents/middlewareAgent/middleware/piiRedaction.d.ts.map +0 -1
  384. package/dist/agents/middlewareAgent/middleware/piiRedaction.js.map +0 -1
  385. package/dist/agents/middlewareAgent/middleware/promptCaching.cjs.map +0 -1
  386. package/dist/agents/middlewareAgent/middleware/promptCaching.d.cts.map +0 -1
  387. package/dist/agents/middlewareAgent/middleware/promptCaching.d.ts.map +0 -1
  388. package/dist/agents/middlewareAgent/middleware/promptCaching.js.map +0 -1
  389. package/dist/agents/middlewareAgent/middleware/summarization.cjs.map +0 -1
  390. package/dist/agents/middlewareAgent/middleware/summarization.d.cts.map +0 -1
  391. package/dist/agents/middlewareAgent/middleware/summarization.d.ts.map +0 -1
  392. package/dist/agents/middlewareAgent/middleware/summarization.js.map +0 -1
  393. package/dist/agents/middlewareAgent/middleware/toolCallLimit.cjs.map +0 -1
  394. package/dist/agents/middlewareAgent/middleware/toolCallLimit.d.cts.map +0 -1
  395. package/dist/agents/middlewareAgent/middleware/toolCallLimit.d.ts.map +0 -1
  396. package/dist/agents/middlewareAgent/middleware/toolCallLimit.js.map +0 -1
  397. package/dist/agents/middlewareAgent/middleware/utils.cjs.map +0 -1
  398. package/dist/agents/middlewareAgent/middleware/utils.d.cts.map +0 -1
  399. package/dist/agents/middlewareAgent/middleware/utils.d.ts.map +0 -1
  400. package/dist/agents/middlewareAgent/middleware/utils.js.map +0 -1
  401. package/dist/agents/middlewareAgent/middleware.cjs.map +0 -1
  402. package/dist/agents/middlewareAgent/middleware.d.cts +0 -117
  403. package/dist/agents/middlewareAgent/middleware.d.cts.map +0 -1
  404. package/dist/agents/middlewareAgent/middleware.d.ts +0 -117
  405. package/dist/agents/middlewareAgent/middleware.d.ts.map +0 -1
  406. package/dist/agents/middlewareAgent/middleware.js.map +0 -1
  407. package/dist/agents/middlewareAgent/nodes/AfterModalNode.cjs.map +0 -1
  408. package/dist/agents/middlewareAgent/nodes/AfterModalNode.js.map +0 -1
  409. package/dist/agents/middlewareAgent/nodes/AgentNode.cjs +0 -468
  410. package/dist/agents/middlewareAgent/nodes/AgentNode.cjs.map +0 -1
  411. package/dist/agents/middlewareAgent/nodes/AgentNode.js +0 -467
  412. package/dist/agents/middlewareAgent/nodes/AgentNode.js.map +0 -1
  413. package/dist/agents/middlewareAgent/nodes/BeforeModalNode.cjs.map +0 -1
  414. package/dist/agents/middlewareAgent/nodes/BeforeModalNode.js.map +0 -1
  415. package/dist/agents/middlewareAgent/nodes/middleware.cjs.map +0 -1
  416. package/dist/agents/middlewareAgent/nodes/middleware.js.map +0 -1
  417. package/dist/agents/middlewareAgent/nodes/utils.cjs +0 -66
  418. package/dist/agents/middlewareAgent/nodes/utils.cjs.map +0 -1
  419. package/dist/agents/middlewareAgent/nodes/utils.js +0 -63
  420. package/dist/agents/middlewareAgent/nodes/utils.js.map +0 -1
  421. package/dist/agents/middlewareAgent/types.d.cts +0 -472
  422. package/dist/agents/middlewareAgent/types.d.cts.map +0 -1
  423. package/dist/agents/middlewareAgent/types.d.ts +0 -472
  424. package/dist/agents/middlewareAgent/types.d.ts.map +0 -1
  425. package/dist/agents/nodes/ToolNode.d.cts +0 -97
  426. package/dist/agents/nodes/ToolNode.d.cts.map +0 -1
  427. package/dist/agents/nodes/ToolNode.d.ts +0 -97
  428. package/dist/agents/nodes/ToolNode.d.ts.map +0 -1
  429. package/dist/agents/types.cjs +0 -7
  430. package/dist/agents/types.cjs.map +0 -1
  431. package/dist/agents/types.js +0 -6
  432. package/dist/agents/types.js.map +0 -1
  433. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/client.cjs.map +0 -1
  434. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/client.js.map +0 -1
  435. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.cjs.map +0 -1
  436. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.js.map +0 -1
  437. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/env.cjs.map +0 -1
  438. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/env.js.map +0 -1
  439. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/error.cjs.map +0 -1
  440. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/error.js.map +0 -1
  441. /package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/index.cjs +0 -0
  442. /package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/index.js +0 -0
@@ -1,66 +0,0 @@
1
- const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
- const __langchain_langgraph = require_rolldown_runtime.__toESM(require("@langchain/langgraph"));
3
- const __langchain_core_utils_types = require_rolldown_runtime.__toESM(require("@langchain/core/utils/types"));
4
- const zod_v3 = require_rolldown_runtime.__toESM(require("zod/v3"));
5
-
6
- //#region src/agents/middlewareAgent/nodes/utils.ts
7
- /**
8
- * Helper function to initialize middleware state defaults.
9
- * This is used to ensure all middleware state properties are initialized.
10
- *
11
- * Private properties (starting with _) are automatically made optional since
12
- * users cannot provide them when invoking the agent.
13
- */
14
- async function initializeMiddlewareStates(middlewareList, state) {
15
- const middlewareStates = {};
16
- for (const middleware of middlewareList) if (middleware.stateSchema) {
17
- const modifiedSchema = (0, __langchain_core_utils_types.interopZodObjectMakeFieldsOptional)(middleware.stateSchema, (key) => key.startsWith("_"));
18
- const parseResult = await (0, __langchain_core_utils_types.interopSafeParseAsync)(modifiedSchema, state);
19
- if (parseResult.success) {
20
- Object.assign(middlewareStates, parseResult.data);
21
- continue;
22
- }
23
- /**
24
- * If safeParse fails, there are required public fields missing
25
- */
26
- const requiredFields = parseResult.error.issues.filter((issue) => issue.code === "invalid_type" && issue.message === "Required").map((issue) => ` - ${issue.path.join(".")}: ${issue.message}`).join("\n");
27
- throw new Error(`Middleware "${middleware.name}" has required state fields that must be initialized:\n${requiredFields}\n\nTo fix this, either:\n1. Provide default values in your middleware's state schema using .default():\n stateSchema: z.object({\n myField: z.string().default("default value")\n })\n\n2. Or make the fields optional using .optional():\n stateSchema: z.object({\n myField: z.string().optional()\n })\n\n3. Or ensure you pass these values when invoking the agent:\n agent.invoke({\n messages: [...],\n ${parseResult.error.issues[0]?.path.join(".")}: "value"\n })`);
28
- }
29
- return middlewareStates;
30
- }
31
- /**
32
- * Users can define private and public state for a middleware. Private state properties start with an underscore.
33
- * This function will return the private state properties from the state schema, making all of them optional.
34
- * @param stateSchema - The middleware state schema
35
- * @returns A new schema containing only the private properties (underscore-prefixed), all made optional
36
- */
37
- function derivePrivateState(stateSchema) {
38
- const builtInStateSchema = { messages: zod_v3.z.custom(() => []) };
39
- if (!stateSchema) return zod_v3.z.object(builtInStateSchema);
40
- const { shape } = stateSchema;
41
- const privateShape = builtInStateSchema;
42
- for (const [key, value] of Object.entries(shape)) if (key.startsWith("_")) privateShape[key] = value.optional();
43
- else privateShape[key] = value;
44
- return zod_v3.z.object(privateShape);
45
- }
46
- function parseJumpToTarget(target) {
47
- if (!target) return void 0;
48
- /**
49
- * if target is already a valid jump target, return it
50
- */
51
- if ([
52
- "model_request",
53
- "tools",
54
- __langchain_langgraph.END
55
- ].includes(target)) return target;
56
- if (target === "model") return "model_request";
57
- if (target === "tools") return "tools";
58
- if (target === "end") return __langchain_langgraph.END;
59
- throw new Error(`Invalid jump target: ${target}, must be "model", "tools" or "end".`);
60
- }
61
-
62
- //#endregion
63
- exports.derivePrivateState = derivePrivateState;
64
- exports.initializeMiddlewareStates = initializeMiddlewareStates;
65
- exports.parseJumpToTarget = parseJumpToTarget;
66
- //# sourceMappingURL=utils.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.cjs","names":["middlewareList: readonly AgentMiddleware<any, any, any>[]","state: unknown","middlewareStates: Record<string, any>","issue: ZodIssue","stateSchema?: z.ZodObject<z.ZodRawShape>","z","privateShape: Record<string, any>","target?: string","END"],"sources":["../../../../src/agents/middlewareAgent/nodes/utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { z } from \"zod/v3\";\nimport { type BaseMessage } from \"@langchain/core/messages\";\nimport {\n interopSafeParseAsync,\n interopZodObjectMakeFieldsOptional,\n} from \"@langchain/core/utils/types\";\nimport { type ZodIssue } from \"zod/v3\";\nimport { END } from \"@langchain/langgraph\";\n\nimport type { AgentMiddleware, JumpTo } from \"../types.js\";\n\n/**\n * Helper function to initialize middleware state defaults.\n * This is used to ensure all middleware state properties are initialized.\n *\n * Private properties (starting with _) are automatically made optional since\n * users cannot provide them when invoking the agent.\n */\nexport async function initializeMiddlewareStates(\n middlewareList: readonly AgentMiddleware<any, any, any>[],\n state: unknown\n): Promise<Record<string, any>> {\n const middlewareStates: Record<string, any> = {};\n\n for (const middleware of middlewareList) {\n if (middleware.stateSchema) {\n // Create a modified schema where private properties are optional\n const modifiedSchema = interopZodObjectMakeFieldsOptional(\n middleware.stateSchema,\n (key) => key.startsWith(\"_\")\n );\n\n // Use safeParse with the modified schema\n const parseResult = await interopSafeParseAsync(modifiedSchema, state);\n\n if (parseResult.success) {\n Object.assign(middlewareStates, parseResult.data);\n continue;\n }\n\n /**\n * If safeParse fails, there are required public fields missing\n */\n const requiredFields = parseResult.error.issues\n .filter(\n (issue: ZodIssue) =>\n issue.code === \"invalid_type\" && issue.message === \"Required\"\n )\n .map(\n (issue: ZodIssue) => ` - ${issue.path.join(\".\")}: ${issue.message}`\n )\n .join(\"\\n\");\n\n throw new Error(\n `Middleware \"${middleware.name}\" has required state fields that must be initialized:\\n` +\n `${requiredFields}\\n\\n` +\n `To fix this, either:\\n` +\n `1. Provide default values in your middleware's state schema using .default():\\n` +\n ` stateSchema: z.object({\\n` +\n ` myField: z.string().default(\"default value\")\\n` +\n ` })\\n\\n` +\n `2. Or make the fields optional using .optional():\\n` +\n ` stateSchema: z.object({\\n` +\n ` myField: z.string().optional()\\n` +\n ` })\\n\\n` +\n `3. Or ensure you pass these values when invoking the agent:\\n` +\n ` agent.invoke({\\n` +\n ` messages: [...],\\n` +\n ` ${parseResult.error.issues[0]?.path.join(\".\")}: \"value\"\\n` +\n ` })`\n );\n }\n }\n\n return middlewareStates;\n}\n\n/**\n * Users can define private and public state for a middleware. Private state properties start with an underscore.\n * This function will return the private state properties from the state schema, making all of them optional.\n * @param stateSchema - The middleware state schema\n * @returns A new schema containing only the private properties (underscore-prefixed), all made optional\n */\nexport function derivePrivateState(\n stateSchema?: z.ZodObject<z.ZodRawShape>\n): z.ZodObject<z.ZodRawShape> {\n const builtInStateSchema = {\n messages: z.custom<BaseMessage[]>(() => []),\n };\n\n if (!stateSchema) {\n return z.object(builtInStateSchema);\n }\n\n const { shape } = stateSchema;\n const privateShape: Record<string, any> = builtInStateSchema;\n\n // Filter properties that start with underscore and make them optional\n for (const [key, value] of Object.entries(shape)) {\n if (key.startsWith(\"_\")) {\n // Make the private property optional\n privateShape[key] = value.optional();\n } else {\n privateShape[key] = value;\n }\n }\n\n // Return a new schema with only private properties (all optional)\n return z.object(privateShape);\n}\n\n/**\n * Parse `jumpTo` target from user facing labels to a LangGraph node names\n */\nexport function parseJumpToTarget(target: string): JumpTo;\nexport function parseJumpToTarget(target?: string): JumpTo | undefined {\n if (!target) {\n return undefined;\n }\n\n /**\n * if target is already a valid jump target, return it\n */\n if ([\"model_request\", \"tools\", END].includes(target)) {\n return target as JumpTo;\n }\n\n if (target === \"model\") {\n return \"model_request\";\n }\n if (target === \"tools\") {\n return \"tools\";\n }\n if (target === \"end\") {\n return END;\n }\n\n throw new Error(\n `Invalid jump target: ${target}, must be \"model\", \"tools\" or \"end\".`\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAmBA,eAAsB,2BACpBA,gBACAC,OAC8B;CAC9B,MAAMC,mBAAwC,CAAE;AAEhD,MAAK,MAAM,cAAc,eACvB,KAAI,WAAW,aAAa;EAE1B,MAAM,sFACJ,WAAW,aACX,CAAC,QAAQ,IAAI,WAAW,IAAI,CAC7B;EAGD,MAAM,cAAc,8DAA4B,gBAAgB,MAAM;AAEtE,MAAI,YAAY,SAAS;GACvB,OAAO,OAAO,kBAAkB,YAAY,KAAK;AACjD;EACD;;;;EAKD,MAAM,iBAAiB,YAAY,MAAM,OACtC,OACC,CAACC,UACC,MAAM,SAAS,kBAAkB,MAAM,YAAY,WACtD,CACA,IACC,CAACA,UAAoB,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,IAAI,CAAC,EAAE,EAAE,MAAM,SAAS,CACrE,CACA,KAAK,KAAK;AAEb,QAAM,IAAI,MACR,CAAC,YAAY,EAAE,WAAW,KAAK,uDAAuD,EACjF,eAAe,0aAAI,EAad,YAAY,MAAM,OAAO,IAAI,KAAK,KAAK,IAAI,CAAC,gBAAW,CACxD;CAEZ;AAGH,QAAO;AACR;;;;;;;AAQD,SAAgB,mBACdC,aAC4B;CAC5B,MAAM,qBAAqB,EACzB,UAAUC,SAAE,OAAsB,MAAM,CAAE,EAAC,CAC5C;AAED,KAAI,CAAC,YACH,QAAOA,SAAE,OAAO,mBAAmB;CAGrC,MAAM,EAAE,OAAO,GAAG;CAClB,MAAMC,eAAoC;AAG1C,MAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,MAAM,CAC9C,KAAI,IAAI,WAAW,IAAI,EAErB,aAAa,OAAO,MAAM,UAAU;MAEpC,aAAa,OAAO;AAKxB,QAAOD,SAAE,OAAO,aAAa;AAC9B;AAMD,SAAgB,kBAAkBE,QAAqC;AACrE,KAAI,CAAC,OACH,QAAO;;;;AAMT,KAAI;EAAC;EAAiB;EAASC;CAAI,EAAC,SAAS,OAAO,CAClD,QAAO;AAGT,KAAI,WAAW,QACb,QAAO;AAET,KAAI,WAAW,QACb,QAAO;AAET,KAAI,WAAW,MACb,QAAOA;AAGT,OAAM,IAAI,MACR,CAAC,qBAAqB,EAAE,OAAO,oCAAoC,CAAC;AAEvE"}
@@ -1,63 +0,0 @@
1
- import { END } from "@langchain/langgraph";
2
- import { interopSafeParseAsync, interopZodObjectMakeFieldsOptional } from "@langchain/core/utils/types";
3
- import { z } from "zod/v3";
4
-
5
- //#region src/agents/middlewareAgent/nodes/utils.ts
6
- /**
7
- * Helper function to initialize middleware state defaults.
8
- * This is used to ensure all middleware state properties are initialized.
9
- *
10
- * Private properties (starting with _) are automatically made optional since
11
- * users cannot provide them when invoking the agent.
12
- */
13
- async function initializeMiddlewareStates(middlewareList, state) {
14
- const middlewareStates = {};
15
- for (const middleware of middlewareList) if (middleware.stateSchema) {
16
- const modifiedSchema = interopZodObjectMakeFieldsOptional(middleware.stateSchema, (key) => key.startsWith("_"));
17
- const parseResult = await interopSafeParseAsync(modifiedSchema, state);
18
- if (parseResult.success) {
19
- Object.assign(middlewareStates, parseResult.data);
20
- continue;
21
- }
22
- /**
23
- * If safeParse fails, there are required public fields missing
24
- */
25
- const requiredFields = parseResult.error.issues.filter((issue) => issue.code === "invalid_type" && issue.message === "Required").map((issue) => ` - ${issue.path.join(".")}: ${issue.message}`).join("\n");
26
- throw new Error(`Middleware "${middleware.name}" has required state fields that must be initialized:\n${requiredFields}\n\nTo fix this, either:\n1. Provide default values in your middleware's state schema using .default():\n stateSchema: z.object({\n myField: z.string().default("default value")\n })\n\n2. Or make the fields optional using .optional():\n stateSchema: z.object({\n myField: z.string().optional()\n })\n\n3. Or ensure you pass these values when invoking the agent:\n agent.invoke({\n messages: [...],\n ${parseResult.error.issues[0]?.path.join(".")}: "value"\n })`);
27
- }
28
- return middlewareStates;
29
- }
30
- /**
31
- * Users can define private and public state for a middleware. Private state properties start with an underscore.
32
- * This function will return the private state properties from the state schema, making all of them optional.
33
- * @param stateSchema - The middleware state schema
34
- * @returns A new schema containing only the private properties (underscore-prefixed), all made optional
35
- */
36
- function derivePrivateState(stateSchema) {
37
- const builtInStateSchema = { messages: z.custom(() => []) };
38
- if (!stateSchema) return z.object(builtInStateSchema);
39
- const { shape } = stateSchema;
40
- const privateShape = builtInStateSchema;
41
- for (const [key, value] of Object.entries(shape)) if (key.startsWith("_")) privateShape[key] = value.optional();
42
- else privateShape[key] = value;
43
- return z.object(privateShape);
44
- }
45
- function parseJumpToTarget(target) {
46
- if (!target) return void 0;
47
- /**
48
- * if target is already a valid jump target, return it
49
- */
50
- if ([
51
- "model_request",
52
- "tools",
53
- END
54
- ].includes(target)) return target;
55
- if (target === "model") return "model_request";
56
- if (target === "tools") return "tools";
57
- if (target === "end") return END;
58
- throw new Error(`Invalid jump target: ${target}, must be "model", "tools" or "end".`);
59
- }
60
-
61
- //#endregion
62
- export { derivePrivateState, initializeMiddlewareStates, parseJumpToTarget };
63
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","names":["middlewareList: readonly AgentMiddleware<any, any, any>[]","state: unknown","middlewareStates: Record<string, any>","issue: ZodIssue","stateSchema?: z.ZodObject<z.ZodRawShape>","privateShape: Record<string, any>","target?: string"],"sources":["../../../../src/agents/middlewareAgent/nodes/utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { z } from \"zod/v3\";\nimport { type BaseMessage } from \"@langchain/core/messages\";\nimport {\n interopSafeParseAsync,\n interopZodObjectMakeFieldsOptional,\n} from \"@langchain/core/utils/types\";\nimport { type ZodIssue } from \"zod/v3\";\nimport { END } from \"@langchain/langgraph\";\n\nimport type { AgentMiddleware, JumpTo } from \"../types.js\";\n\n/**\n * Helper function to initialize middleware state defaults.\n * This is used to ensure all middleware state properties are initialized.\n *\n * Private properties (starting with _) are automatically made optional since\n * users cannot provide them when invoking the agent.\n */\nexport async function initializeMiddlewareStates(\n middlewareList: readonly AgentMiddleware<any, any, any>[],\n state: unknown\n): Promise<Record<string, any>> {\n const middlewareStates: Record<string, any> = {};\n\n for (const middleware of middlewareList) {\n if (middleware.stateSchema) {\n // Create a modified schema where private properties are optional\n const modifiedSchema = interopZodObjectMakeFieldsOptional(\n middleware.stateSchema,\n (key) => key.startsWith(\"_\")\n );\n\n // Use safeParse with the modified schema\n const parseResult = await interopSafeParseAsync(modifiedSchema, state);\n\n if (parseResult.success) {\n Object.assign(middlewareStates, parseResult.data);\n continue;\n }\n\n /**\n * If safeParse fails, there are required public fields missing\n */\n const requiredFields = parseResult.error.issues\n .filter(\n (issue: ZodIssue) =>\n issue.code === \"invalid_type\" && issue.message === \"Required\"\n )\n .map(\n (issue: ZodIssue) => ` - ${issue.path.join(\".\")}: ${issue.message}`\n )\n .join(\"\\n\");\n\n throw new Error(\n `Middleware \"${middleware.name}\" has required state fields that must be initialized:\\n` +\n `${requiredFields}\\n\\n` +\n `To fix this, either:\\n` +\n `1. Provide default values in your middleware's state schema using .default():\\n` +\n ` stateSchema: z.object({\\n` +\n ` myField: z.string().default(\"default value\")\\n` +\n ` })\\n\\n` +\n `2. Or make the fields optional using .optional():\\n` +\n ` stateSchema: z.object({\\n` +\n ` myField: z.string().optional()\\n` +\n ` })\\n\\n` +\n `3. Or ensure you pass these values when invoking the agent:\\n` +\n ` agent.invoke({\\n` +\n ` messages: [...],\\n` +\n ` ${parseResult.error.issues[0]?.path.join(\".\")}: \"value\"\\n` +\n ` })`\n );\n }\n }\n\n return middlewareStates;\n}\n\n/**\n * Users can define private and public state for a middleware. Private state properties start with an underscore.\n * This function will return the private state properties from the state schema, making all of them optional.\n * @param stateSchema - The middleware state schema\n * @returns A new schema containing only the private properties (underscore-prefixed), all made optional\n */\nexport function derivePrivateState(\n stateSchema?: z.ZodObject<z.ZodRawShape>\n): z.ZodObject<z.ZodRawShape> {\n const builtInStateSchema = {\n messages: z.custom<BaseMessage[]>(() => []),\n };\n\n if (!stateSchema) {\n return z.object(builtInStateSchema);\n }\n\n const { shape } = stateSchema;\n const privateShape: Record<string, any> = builtInStateSchema;\n\n // Filter properties that start with underscore and make them optional\n for (const [key, value] of Object.entries(shape)) {\n if (key.startsWith(\"_\")) {\n // Make the private property optional\n privateShape[key] = value.optional();\n } else {\n privateShape[key] = value;\n }\n }\n\n // Return a new schema with only private properties (all optional)\n return z.object(privateShape);\n}\n\n/**\n * Parse `jumpTo` target from user facing labels to a LangGraph node names\n */\nexport function parseJumpToTarget(target: string): JumpTo;\nexport function parseJumpToTarget(target?: string): JumpTo | undefined {\n if (!target) {\n return undefined;\n }\n\n /**\n * if target is already a valid jump target, return it\n */\n if ([\"model_request\", \"tools\", END].includes(target)) {\n return target as JumpTo;\n }\n\n if (target === \"model\") {\n return \"model_request\";\n }\n if (target === \"tools\") {\n return \"tools\";\n }\n if (target === \"end\") {\n return END;\n }\n\n throw new Error(\n `Invalid jump target: ${target}, must be \"model\", \"tools\" or \"end\".`\n );\n}\n"],"mappings":";;;;;;;;;;;;AAmBA,eAAsB,2BACpBA,gBACAC,OAC8B;CAC9B,MAAMC,mBAAwC,CAAE;AAEhD,MAAK,MAAM,cAAc,eACvB,KAAI,WAAW,aAAa;EAE1B,MAAM,iBAAiB,mCACrB,WAAW,aACX,CAAC,QAAQ,IAAI,WAAW,IAAI,CAC7B;EAGD,MAAM,cAAc,MAAM,sBAAsB,gBAAgB,MAAM;AAEtE,MAAI,YAAY,SAAS;GACvB,OAAO,OAAO,kBAAkB,YAAY,KAAK;AACjD;EACD;;;;EAKD,MAAM,iBAAiB,YAAY,MAAM,OACtC,OACC,CAACC,UACC,MAAM,SAAS,kBAAkB,MAAM,YAAY,WACtD,CACA,IACC,CAACA,UAAoB,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,IAAI,CAAC,EAAE,EAAE,MAAM,SAAS,CACrE,CACA,KAAK,KAAK;AAEb,QAAM,IAAI,MACR,CAAC,YAAY,EAAE,WAAW,KAAK,uDAAuD,EACjF,eAAe,0aAAI,EAad,YAAY,MAAM,OAAO,IAAI,KAAK,KAAK,IAAI,CAAC,gBAAW,CACxD;CAEZ;AAGH,QAAO;AACR;;;;;;;AAQD,SAAgB,mBACdC,aAC4B;CAC5B,MAAM,qBAAqB,EACzB,UAAU,EAAE,OAAsB,MAAM,CAAE,EAAC,CAC5C;AAED,KAAI,CAAC,YACH,QAAO,EAAE,OAAO,mBAAmB;CAGrC,MAAM,EAAE,OAAO,GAAG;CAClB,MAAMC,eAAoC;AAG1C,MAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,MAAM,CAC9C,KAAI,IAAI,WAAW,IAAI,EAErB,aAAa,OAAO,MAAM,UAAU;MAEpC,aAAa,OAAO;AAKxB,QAAO,EAAE,OAAO,aAAa;AAC9B;AAMD,SAAgB,kBAAkBC,QAAqC;AACrE,KAAI,CAAC,OACH,QAAO;;;;AAMT,KAAI;EAAC;EAAiB;EAAS;CAAI,EAAC,SAAS,OAAO,CAClD,QAAO;AAGT,KAAI,WAAW,QACb,QAAO;AAET,KAAI,WAAW,QACb,QAAO;AAET,KAAI,WAAW,MACb,QAAO;AAGT,OAAM,IAAI,MACR,CAAC,qBAAqB,EAAE,OAAO,oCAAoC,CAAC;AAEvE"}
@@ -1,472 +0,0 @@
1
- import { JUMP_TO_TARGETS } from "./constants.cjs";
2
- import { AnyAnnotationRoot, ResponseFormatUndefined, ToAnnotationRoot } from "../annotation.cjs";
3
- import { JsonSchemaFormat, ProviderStrategy, ResponseFormat, ToolStrategy, TypedToolStrategy } from "../responses.cjs";
4
- import { ToolNode } from "../nodes/ToolNode.cjs";
5
- import { ClientTool, ServerTool } from "../types.cjs";
6
- import { LanguageModelLike } from "@langchain/core/language_models/base";
7
- import { InferInteropZodInput, InferInteropZodOutput, InteropZodDefault, InteropZodObject, InteropZodOptional, InteropZodType } from "@langchain/core/utils/types";
8
- import { BaseMessage } from "@langchain/core/messages";
9
- import { LangGraphRunnableConfig, PregelOptions, Runtime, START } from "@langchain/langgraph";
10
- import { BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
11
- import { Messages as Messages$1 } from "@langchain/langgraph/";
12
-
13
- //#region src/agents/middlewareAgent/types.d.ts
14
-
15
- /**
16
- * Represents information about an interrupt.
17
- */
18
- interface Interrupt<TValue = unknown> {
19
- /**
20
- * The ID of the interrupt.
21
- */
22
- id: string;
23
- /**
24
- * The requests for human input.
25
- */
26
- value: TValue;
27
- }
28
- interface BuiltInState {
29
- messages: BaseMessage[];
30
- __interrupt__?: Interrupt[];
31
- /**
32
- * Optional property to control routing after afterModel middleware execution.
33
- * When set by middleware, the agent will jump to the specified node instead of
34
- * following normal routing logic. The property is automatically cleared after use.
35
- *
36
- * - "model_request": Jump back to the model for another LLM call
37
- * - "tools": Jump to tool execution (requires tools to be available)
38
- */
39
- jumpTo?: JumpToTarget;
40
- }
41
- /**
42
- * Base input type for `.invoke` and `.stream` methods.
43
- */
44
- type UserInput = {
45
- messages: Messages$1;
46
- };
47
- /**
48
- * Information about a tool call that has been executed.
49
- */
50
-
51
- /**
52
- * Configuration for modifying a model call at runtime.
53
- * All fields are optional and only provided fields will override defaults.
54
- */
55
- interface ModelRequest {
56
- /**
57
- * The model to use for this step.
58
- */
59
- model: LanguageModelLike;
60
- /**
61
- * The messages to send to the model.
62
- */
63
- messages: BaseMessage[];
64
- /**
65
- * The system message for this step.
66
- */
67
- systemPrompt?: string;
68
- /**
69
- * Tool choice configuration (model-specific format).
70
- * Can be one of:
71
- * - `"auto"`: means the model can pick between generating a message or calling one or more tools.
72
- * - `"none"`: means the model will not call any tool and instead generates a message.
73
- * - `"required"`: means the model must call one or more tools.
74
- * - `{ type: "function", function: { name: string } }`: The model will use the specified function.
75
- */
76
- toolChoice?: "auto" | "none" | "required" | {
77
- type: "function";
78
- function: {
79
- name: string;
80
- };
81
- };
82
- /**
83
- * The tools to make available for this step.
84
- */
85
- tools: (ServerTool | ClientTool)[];
86
- }
87
- /**
88
- * Type helper to check if TContext is an optional Zod schema
89
- */
90
- type IsOptionalZodObject<T> = T extends InteropZodOptional<any> ? true : false;
91
- type IsDefaultZodObject<T> = T extends InteropZodDefault<any> ? true : false;
92
- type WithMaybeContext<TContext> = undefined extends TContext ? {
93
- readonly context?: TContext;
94
- } : IsOptionalZodObject<TContext> extends true ? {
95
- readonly context?: TContext;
96
- } : IsDefaultZodObject<TContext> extends true ? {
97
- readonly context?: TContext;
98
- } : {
99
- readonly context: TContext;
100
- };
101
- /**
102
- * Runtime information available to middleware (readonly).
103
- */
104
- type Runtime$1<TContext = unknown> = Partial<Omit<Runtime<TContext>, "context" | "configurable">> & WithMaybeContext<TContext> & PrivateState;
105
- /**
106
- * Result type for middleware functions.
107
- */
108
- type MiddlewareResult<TState> = TState | void;
109
- /**
110
- * Type for the agent's built-in state properties.
111
- */
112
- type AgentBuiltInState = {
113
- messages: BaseMessage[];
114
- };
115
- /**
116
- * Helper type to filter out properties that start with underscore (private properties)
117
- */
118
- type FilterPrivateProps<T> = { [K in keyof T as K extends `_${string}` ? never : K]: T[K] };
119
- /**
120
- * Helper type to infer the state schema type from a middleware
121
- * This filters out private properties (those starting with underscore)
122
- */
123
- type InferMiddlewareState<T extends AgentMiddleware<any, any, any>> = T extends AgentMiddleware<infer S, any, any> ? S extends InteropZodObject ? FilterPrivateProps<InferInteropZodOutput<S>> : {} : {};
124
- /**
125
- * Helper type to infer the input state schema type from a middleware (all properties optional)
126
- * This filters out private properties (those starting with underscore)
127
- */
128
- type InferMiddlewareInputState<T extends AgentMiddleware<any, any, any>> = T extends AgentMiddleware<infer S, any, any> ? S extends InteropZodObject ? FilterPrivateProps<InferInteropZodInput<S>> : {} : {};
129
- /**
130
- * Helper type to infer merged state from an array of middleware (just the middleware states)
131
- */
132
- type InferMiddlewareStates<T extends readonly AgentMiddleware<any, any, any>[]> = T extends readonly [] ? {} : T extends readonly [infer First, ...infer Rest] ? First extends AgentMiddleware<any, any, any> ? Rest extends readonly AgentMiddleware<any, any, any>[] ? InferMiddlewareState<First> & InferMiddlewareStates<Rest> : InferMiddlewareState<First> : {} : {};
133
- /**
134
- * Helper type to infer merged input state from an array of middleware (with optional defaults)
135
- */
136
- type InferMiddlewareInputStates<T extends readonly AgentMiddleware<any, any, any>[]> = T extends readonly [] ? {} : T extends readonly [infer First, ...infer Rest] ? First extends AgentMiddleware<any, any, any> ? Rest extends readonly AgentMiddleware<any, any, any>[] ? InferMiddlewareInputState<First> & InferMiddlewareInputStates<Rest> : InferMiddlewareInputState<First> : {} : {};
137
- /**
138
- * Helper type to infer merged state from an array of middleware (includes built-in state)
139
- */
140
-
141
- /**
142
- * Helper type to infer the input context schema type from a middleware (with optional defaults)
143
- */
144
- type InferMiddlewareContextInput<T extends AgentMiddleware<any, any, any>> = T extends AgentMiddleware<any, infer C, any> ? C extends InteropZodOptional<infer Inner> ? InferInteropZodInput<Inner> | undefined : C extends InteropZodObject ? InferInteropZodInput<C> : {} : {};
145
- /**
146
- * Helper type to infer merged context from an array of middleware
147
- */
148
-
149
- /**
150
- * Helper to merge two context types, preserving undefined unions
151
- */
152
- type MergeContextTypes<A, B> = [A] extends [undefined] ? [B] extends [undefined] ? undefined : B | undefined : [B] extends [undefined] ? A | undefined : [A] extends [B] ? A : [B] extends [A] ? B : A & B;
153
- /**
154
- * Helper type to infer merged input context from an array of middleware (with optional defaults)
155
- */
156
- type InferMiddlewareContextInputs<T extends readonly AgentMiddleware<any, any, any>[]> = T extends readonly [] ? {} : T extends readonly [infer First, ...infer Rest] ? First extends AgentMiddleware<any, any, any> ? Rest extends readonly AgentMiddleware<any, any, any>[] ? MergeContextTypes<InferMiddlewareContextInput<First>, InferMiddlewareContextInputs<Rest>> : InferMiddlewareContextInput<First> : {} : {};
157
- /**
158
- * jump targets (user facing)
159
- */
160
- type JumpToTarget = (typeof JUMP_TO_TARGETS)[number];
161
- /**
162
- * jump targets (internal)
163
- */
164
-
165
- /**
166
- * Base middleware interface.
167
- */
168
- interface AgentMiddleware<TSchema extends InteropZodObject | undefined = undefined, TContextSchema extends InteropZodObject | InteropZodDefault<InteropZodObject> | InteropZodOptional<InteropZodObject> | undefined = undefined, TFullContext = any> {
169
- stateSchema?: TSchema;
170
- contextSchema?: TContextSchema;
171
- name: string;
172
- beforeModelJumpTo?: JumpToTarget[];
173
- afterModelJumpTo?: JumpToTarget[];
174
- tools?: (ClientTool | ServerTool)[];
175
- /**
176
- * Runs before each LLM call, can modify call parameters, changes are not persistent
177
- * e.g. if you change `model`, it will only be changed for the next model call
178
- *
179
- * @param options - Current call options (can be modified by previous middleware)
180
- * @param state - Current state (read-only in this phase)
181
- * @param runtime - Runtime context and metadata
182
- * @returns Modified options or undefined to pass through
183
- */
184
- modifyModelRequest?(request: ModelRequest, state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime$1<TFullContext>): Promise<Partial<ModelRequest> | void> | Partial<ModelRequest> | void;
185
- /**
186
- * Logic to handle model invocation errors and optionally retry.
187
- *
188
- * @param error - The exception that occurred during model invocation.
189
- * @param request - The original model request that failed.
190
- * @param state - The current agent state.
191
- * @param runtime - The runtime context.
192
- * @param attempt - The current attempt number (1-indexed).
193
- * @returns Modified request to retry with, or undefined/null to propagate the error (re-raise).
194
- */
195
- retryModelRequest?(error: Error, request: ModelRequest, state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime$1<TFullContext>, attempt: number): Promise<ModelRequest | void> | ModelRequest | void;
196
- beforeModel?(state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime$1<TFullContext>): Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>>;
197
- afterModel?(state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime$1<TFullContext>): Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>>;
198
- }
199
- /**
200
- * Information about a tool call that has been executed.
201
- */
202
-
203
- type CreateAgentParams<StructuredResponseType extends Record<string, any> = Record<string, any>, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, ResponseFormatType = InteropZodType<StructuredResponseType> | InteropZodType<unknown>[] | JsonSchemaFormat | JsonSchemaFormat[] | ResponseFormat | TypedToolStrategy<StructuredResponseType> | ToolStrategy<StructuredResponseType> | ProviderStrategy<StructuredResponseType> | ResponseFormatUndefined> = {
204
- /**
205
- * Defines a model to use for the agent. You can either pass in an instance of a LangChain chat model
206
- * or a string. If a string is provided the agent initializes a ChatModel based on the provided model name and provider.
207
- * It supports various model providers and allows for runtime configuration of model parameters.
208
- *
209
- * @uses {@link initChatModel}
210
- * @example
211
- * ```ts
212
- * const agent = createAgent({
213
- * model: "anthropic:claude-3-7-sonnet-latest",
214
- * // ...
215
- * });
216
- * ```
217
- *
218
- * @example
219
- * ```ts
220
- * import { ChatOpenAI } from "@langchain/openai";
221
- * const agent = createAgent({
222
- * model: new ChatOpenAI({ model: "gpt-4o" }),
223
- * // ...
224
- * });
225
- * ```
226
- */
227
- model: string | LanguageModelLike;
228
- /**
229
- * A list of tools or a ToolNode.
230
- *
231
- * @example
232
- * ```ts
233
- * import { tool } from "langchain";
234
- *
235
- * const weatherTool = tool(() => "Sunny!", {
236
- * name: "get_weather",
237
- * description: "Get the weather for a location",
238
- * schema: z.object({
239
- * location: z.string().describe("The location to get weather for"),
240
- * }),
241
- * });
242
- *
243
- * const agent = createAgent({
244
- * tools: [weatherTool],
245
- * // ...
246
- * });
247
- * ```
248
- */
249
- tools?: ToolNode | (ServerTool | ClientTool)[];
250
- /**
251
- * An optional prompt for the LLM. This takes full graph state BEFORE the LLM is called and prepares the input to LLM.
252
- *
253
- * Can take a few different forms:
254
- *
255
- * - str: This is converted to a SystemMessage and added to the beginning of the list of messages in state["messages"].
256
- * - SystemMessage: this is added to the beginning of the list of messages in state["messages"].
257
- * - Function: This function should take in full graph state and the output is then passed to the language model.
258
- * - Runnable: This runnable should take in full graph state and the output is then passed to the language model.
259
- *
260
- * Note:
261
- * Prior to `v0.2.46`, the prompt was set using `stateModifier` / `messagesModifier` parameters.
262
- * This is now deprecated and will be removed in a future release.
263
- *
264
- * Cannot be used together with `modifyModelRequest`.
265
- */
266
- systemPrompt?: string;
267
- /**
268
- * An optional schema for the context. It allows to pass in a typed context object into the agent
269
- * invocation and allows to access it in hooks such as `prompt` and middleware.
270
- * As opposed to the agent state, defined in `stateSchema`, the context is not persisted between
271
- * agent invocations.
272
- *
273
- * @example
274
- * ```ts
275
- * const agent = createAgent({
276
- * llm: model,
277
- * tools: [getWeather],
278
- * contextSchema: z.object({
279
- * capital: z.string(),
280
- * }),
281
- * prompt: (state, config) => {
282
- * return [
283
- * new SystemMessage(`You are a helpful assistant. The capital of France is ${config.context.capital}.`),
284
- * ];
285
- * },
286
- * });
287
- *
288
- * const result = await agent.invoke({
289
- * messages: [
290
- * new SystemMessage("You are a helpful assistant."),
291
- * new HumanMessage("What is the capital of France?"),
292
- * ],
293
- * }, {
294
- * context: {
295
- * capital: "Paris",
296
- * },
297
- * });
298
- * ```
299
- */
300
- contextSchema?: ContextSchema;
301
- /** An optional checkpoint saver to persist the agent's state. */
302
- checkpointSaver?: BaseCheckpointSaver | boolean;
303
- /** An optional checkpoint saver to persist the agent's state. Alias of "checkpointSaver". */
304
- checkpointer?: BaseCheckpointSaver | boolean;
305
- /**
306
- * An optional store to persist the agent's state.
307
- * @see {@link https://docs.langchain.com/oss/javascript/langgraph/memory#memory-storage | Long-term memory}
308
- */
309
- store?: BaseStore;
310
- /**
311
- * An optional schema for the final agent output.
312
- *
313
- * If provided, output will be formatted to match the given schema and returned in the 'structuredResponse' state key.
314
- * If not provided, `structuredResponse` will not be present in the output state.
315
- *
316
- * Can be passed in as:
317
- * - Zod schema
318
- * ```ts
319
- * const agent = createAgent({
320
- * responseFormat: z.object({
321
- * capital: z.string(),
322
- * }),
323
- * // ...
324
- * });
325
- * ```
326
- * - JSON schema
327
- * ```ts
328
- * const agent = createAgent({
329
- * responseFormat: {
330
- * type: "json_schema",
331
- * schema: {
332
- * type: "object",
333
- * properties: {
334
- * capital: { type: "string" },
335
- * },
336
- * required: ["capital"],
337
- * },
338
- * },
339
- * // ...
340
- * });
341
- * ```
342
- * - Create React Agent ResponseFormat
343
- * ```ts
344
- * import { providerStrategy, toolStrategy } from "langchain";
345
- * const agent = createAgent({
346
- * responseFormat: providerStrategy(
347
- * z.object({
348
- * capital: z.string(),
349
- * })
350
- * ),
351
- * // or
352
- * responseFormat: [
353
- * toolStrategy({ ... }),
354
- * toolStrategy({ ... }),
355
- * ]
356
- * // ...
357
- * });
358
- * ```
359
- *
360
- * **Note**: The graph will make a separate call to the LLM to generate the structured response after the agent loop is finished.
361
- * 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/).
362
- */
363
- responseFormat?: ResponseFormatType;
364
- /**
365
- * Middleware instances to run during agent execution.
366
- * Each middleware can define its own state schema and hook into the agent lifecycle.
367
- */
368
- middleware?: readonly AgentMiddleware<any, any, any>[];
369
- /**
370
- * An optional name for the agent.
371
- */
372
- name?: string;
373
- /**
374
- * An optional description for the agent.
375
- * This can be used to describe the agent to the underlying supervisor LLM.
376
- */
377
- description?: string;
378
- /**
379
- * Use to specify how to expose the agent name to the underlying supervisor LLM.
380
- * - `undefined`: Relies on the LLM provider {@link AIMessage#name}. Currently, only OpenAI supports this.
381
- * - `"inline"`: Add the agent name directly into the content field of the {@link AIMessage} using XML-style tags.
382
- * Example: `"How can I help you"` -> `"<name>agent_name</name><content>How can I help you?</content>"`
383
- */
384
- includeAgentName?: "inline" | undefined;
385
- /**
386
- * An optional abort signal that indicates that the overall operation should be aborted.
387
- */
388
- signal?: AbortSignal;
389
- /**
390
- * Determines the version of the graph to create.
391
- *
392
- * Can be one of
393
- * - `"v1"`: The tool node processes a single message. All tool calls in the message are
394
- * executed in parallel within the tool node.
395
- * - `"v2"`: The tool node processes a single tool call. Tool calls are distributed across
396
- * multiple instances of the tool node using the Send API.
397
- *
398
- * @default `"v2"`
399
- */
400
- version?: "v1" | "v2";
401
- };
402
- /**
403
- * Helper type to check if a type is optional (includes undefined)
404
- */
405
- type IsOptionalType<T> = undefined extends T ? true : false;
406
- /**
407
- * Extract non-undefined part of a union that includes undefined
408
- */
409
- type ExtractNonUndefined<T> = T extends undefined ? never : T;
410
- /**
411
- * Helper type to check if all properties of a type are optional
412
- */
413
- type IsAllOptional<T> =
414
- // If T includes undefined, then it's optional (can be omitted entirely)
415
- undefined extends T ? true : IsOptionalType<T> extends true ? true : ExtractNonUndefined<T> extends Record<string, any> ? {} extends ExtractNonUndefined<T> ? true : false : IsOptionalType<T>;
416
- /**
417
- * Helper type to extract input type from context schema (with optional defaults)
418
- */
419
- type InferContextInput<ContextSchema extends AnyAnnotationRoot | InteropZodObject> = ContextSchema extends InteropZodObject ? InferInteropZodInput<ContextSchema> : ContextSchema extends AnyAnnotationRoot ? ToAnnotationRoot<ContextSchema>["State"] : {};
420
- /**
421
- * Helper to check if ContextSchema is the default (AnyAnnotationRoot)
422
- */
423
-
424
- interface RunLevelPrivateState {
425
- /**
426
- * The number of times the model has been called at the run level.
427
- * This includes multiple agent invocations.
428
- */
429
- runModelCallCount: number;
430
- }
431
- interface ThreadLevelPrivateState {
432
- /**
433
- * The number of times the model has been called at the thread level.
434
- * This includes multiple agent invocations within different environments
435
- * using the same thread.
436
- */
437
- threadLevelCallCount: number;
438
- }
439
- /**
440
- * As private state we consider all information we want to track within
441
- * the lifecycle of the agent, without exposing it to the user. These informations
442
- * are propagated to the user as _readonly_ runtime properties.
443
- */
444
- interface PrivateState extends ThreadLevelPrivateState, RunLevelPrivateState {}
445
- /**
446
- * Pregel options that are propagated to the agent
447
- */
448
- type CreateAgentPregelOptions = "configurable" | "durability" | "store" | "cache" | "signal" | "recursionLimit" | "maxConcurrency" | "timeout";
449
- /**
450
- * Decide whether provided configuration requires a context
451
- */
452
- type InvokeConfiguration<ContextSchema extends Record<string, any>> =
453
- /**
454
- * If the context schema is a default object, `context` can be optional
455
- */
456
- ContextSchema extends InteropZodDefault<any> ? Partial<Pick<PregelOptions<any, any, any>, CreateAgentPregelOptions>> & {
457
- context?: Partial<ContextSchema>;
458
- } : IsAllOptional<ContextSchema> extends true ? Partial<Pick<PregelOptions<any, any, any>, CreateAgentPregelOptions>> & {
459
- context?: Partial<ContextSchema>;
460
- } : Partial<Pick<PregelOptions<any, any, any>, CreateAgentPregelOptions>> & WithMaybeContext<ContextSchema>;
461
- type StreamConfiguration<ContextSchema extends Record<string, any>> =
462
- /**
463
- * If the context schema is a default object, `context` can be optional
464
- */
465
- ContextSchema extends InteropZodDefault<any> ? Partial<Pick<PregelOptions<any, any, any>, CreateAgentPregelOptions>> & {
466
- context?: Partial<ContextSchema>;
467
- } : IsAllOptional<ContextSchema> extends true ? Partial<Pick<PregelOptions<any, any, any>, CreateAgentPregelOptions | "streamMode">> & {
468
- context?: Partial<ContextSchema>;
469
- } : Partial<Pick<PregelOptions<any, any, any>, CreateAgentPregelOptions | "streamMode">> & WithMaybeContext<ContextSchema>;
470
- //#endregion
471
- export { AgentBuiltInState, AgentMiddleware, BuiltInState, CreateAgentParams, InferContextInput, InferMiddlewareContextInputs, InferMiddlewareInputStates, InferMiddlewareStates, InvokeConfiguration, JumpToTarget, MiddlewareResult, ModelRequest, Runtime$1 as Runtime, StreamConfiguration, UserInput };
472
- //# sourceMappingURL=types.d.cts.map