langchain 1.0.0-alpha.7 → 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 (1705) 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/RunnableCallable.cjs +10 -0
  11. package/dist/agents/RunnableCallable.cjs.map +1 -1
  12. package/dist/agents/RunnableCallable.js +10 -0
  13. package/dist/agents/RunnableCallable.js.map +1 -1
  14. package/dist/agents/annotation.cjs +32 -135
  15. package/dist/agents/annotation.cjs.map +1 -1
  16. package/dist/agents/annotation.js +34 -136
  17. package/dist/agents/annotation.js.map +1 -1
  18. package/dist/agents/constants.cjs.map +1 -1
  19. package/dist/agents/constants.d.cts +9 -0
  20. package/dist/agents/constants.d.cts.map +1 -0
  21. package/dist/agents/constants.d.ts +9 -0
  22. package/dist/agents/constants.d.ts.map +1 -0
  23. package/dist/agents/constants.js.map +1 -1
  24. package/dist/agents/errors.cjs +2 -1
  25. package/dist/agents/errors.cjs.map +1 -1
  26. package/dist/agents/errors.d.cts +9 -2
  27. package/dist/agents/errors.d.cts.map +1 -1
  28. package/dist/agents/errors.d.ts +9 -2
  29. package/dist/agents/errors.d.ts.map +1 -1
  30. package/dist/agents/errors.js +2 -1
  31. package/dist/agents/errors.js.map +1 -1
  32. package/dist/agents/index.cjs +6 -27
  33. package/dist/agents/index.cjs.map +1 -1
  34. package/dist/agents/index.d.cts +159 -129
  35. package/dist/agents/index.d.cts.map +1 -1
  36. package/dist/agents/index.d.ts +159 -129
  37. package/dist/agents/index.d.ts.map +1 -1
  38. package/dist/agents/index.js +6 -25
  39. package/dist/agents/index.js.map +1 -1
  40. package/dist/agents/middleware/callLimit.cjs +128 -0
  41. package/dist/agents/middleware/callLimit.cjs.map +1 -0
  42. package/dist/agents/middleware/callLimit.d.cts +119 -0
  43. package/dist/agents/middleware/callLimit.d.cts.map +1 -0
  44. package/dist/agents/middleware/callLimit.d.ts +119 -0
  45. package/dist/agents/middleware/callLimit.d.ts.map +1 -0
  46. package/dist/agents/middleware/callLimit.js +127 -0
  47. package/dist/agents/middleware/callLimit.js.map +1 -0
  48. package/dist/agents/middleware/contextEditing.cjs +278 -0
  49. package/dist/agents/middleware/contextEditing.cjs.map +1 -0
  50. package/dist/agents/middleware/contextEditing.d.cts +239 -0
  51. package/dist/agents/middleware/contextEditing.d.cts.map +1 -0
  52. package/dist/agents/middleware/contextEditing.d.ts +239 -0
  53. package/dist/agents/middleware/contextEditing.d.ts.map +1 -0
  54. package/dist/agents/middleware/contextEditing.js +276 -0
  55. package/dist/agents/middleware/contextEditing.js.map +1 -0
  56. package/dist/agents/middleware/dynamicSystemPrompt.cjs +58 -0
  57. package/dist/agents/middleware/dynamicSystemPrompt.cjs.map +1 -0
  58. package/dist/agents/middleware/dynamicSystemPrompt.d.cts +47 -0
  59. package/dist/agents/middleware/dynamicSystemPrompt.d.cts.map +1 -0
  60. package/dist/agents/middleware/dynamicSystemPrompt.d.ts +47 -0
  61. package/dist/agents/middleware/dynamicSystemPrompt.d.ts.map +1 -0
  62. package/dist/agents/middleware/dynamicSystemPrompt.js +58 -0
  63. package/dist/agents/middleware/dynamicSystemPrompt.js.map +1 -0
  64. package/dist/agents/middleware/hitl.cjs +404 -0
  65. package/dist/agents/middleware/hitl.cjs.map +1 -0
  66. package/dist/agents/middleware/hitl.d.cts +611 -0
  67. package/dist/agents/middleware/hitl.d.cts.map +1 -0
  68. package/dist/agents/middleware/hitl.d.ts +611 -0
  69. package/dist/agents/middleware/hitl.d.ts.map +1 -0
  70. package/dist/agents/middleware/hitl.js +403 -0
  71. package/dist/agents/middleware/hitl.js.map +1 -0
  72. package/dist/agents/middleware/index.cjs +12 -0
  73. package/dist/agents/middleware/index.js +12 -0
  74. package/dist/agents/middleware/llmToolSelector.cjs +193 -0
  75. package/dist/agents/middleware/llmToolSelector.cjs.map +1 -0
  76. package/dist/agents/middleware/llmToolSelector.d.cts +83 -0
  77. package/dist/agents/middleware/llmToolSelector.d.cts.map +1 -0
  78. package/dist/agents/middleware/llmToolSelector.d.ts +83 -0
  79. package/dist/agents/middleware/llmToolSelector.d.ts.map +1 -0
  80. package/dist/agents/middleware/llmToolSelector.js +192 -0
  81. package/dist/agents/middleware/llmToolSelector.js.map +1 -0
  82. package/dist/agents/middleware/modelFallback.cjs +74 -0
  83. package/dist/agents/middleware/modelFallback.cjs.map +1 -0
  84. package/dist/agents/middleware/modelFallback.d.cts +45 -0
  85. package/dist/agents/middleware/modelFallback.d.cts.map +1 -0
  86. package/dist/agents/middleware/modelFallback.d.ts +45 -0
  87. package/dist/agents/middleware/modelFallback.d.ts.map +1 -0
  88. package/dist/agents/middleware/modelFallback.js +74 -0
  89. package/dist/agents/middleware/modelFallback.js.map +1 -0
  90. package/dist/agents/middleware/piiRedaction.cjs +333 -0
  91. package/dist/agents/middleware/piiRedaction.cjs.map +1 -0
  92. package/dist/agents/middleware/piiRedaction.d.cts +155 -0
  93. package/dist/agents/middleware/piiRedaction.d.cts.map +1 -0
  94. package/dist/agents/middleware/piiRedaction.d.ts +155 -0
  95. package/dist/agents/middleware/piiRedaction.d.ts.map +1 -0
  96. package/dist/agents/middleware/piiRedaction.js +332 -0
  97. package/dist/agents/middleware/piiRedaction.js.map +1 -0
  98. package/dist/agents/middleware/promptCaching.cjs +213 -0
  99. package/dist/agents/middleware/promptCaching.cjs.map +1 -0
  100. package/dist/agents/middleware/promptCaching.d.cts +197 -0
  101. package/dist/agents/middleware/promptCaching.d.cts.map +1 -0
  102. package/dist/agents/middleware/promptCaching.d.ts +197 -0
  103. package/dist/agents/middleware/promptCaching.d.ts.map +1 -0
  104. package/dist/agents/middleware/promptCaching.js +212 -0
  105. package/dist/agents/middleware/promptCaching.js.map +1 -0
  106. package/dist/agents/middleware/summarization.cjs +249 -0
  107. package/dist/agents/middleware/summarization.cjs.map +1 -0
  108. package/dist/agents/middleware/summarization.d.cts +84 -0
  109. package/dist/agents/middleware/summarization.d.cts.map +1 -0
  110. package/dist/agents/middleware/summarization.d.ts +84 -0
  111. package/dist/agents/middleware/summarization.d.ts.map +1 -0
  112. package/dist/agents/middleware/summarization.js +248 -0
  113. package/dist/agents/middleware/summarization.js.map +1 -0
  114. package/dist/agents/middleware/todoListMiddleware.cjs +314 -0
  115. package/dist/agents/middleware/todoListMiddleware.cjs.map +1 -0
  116. package/dist/agents/middleware/todoListMiddleware.d.cts +75 -0
  117. package/dist/agents/middleware/todoListMiddleware.d.cts.map +1 -0
  118. package/dist/agents/middleware/todoListMiddleware.d.ts +75 -0
  119. package/dist/agents/middleware/todoListMiddleware.d.ts.map +1 -0
  120. package/dist/agents/middleware/todoListMiddleware.js +312 -0
  121. package/dist/agents/middleware/todoListMiddleware.js.map +1 -0
  122. package/dist/agents/middleware/toolCallLimit.cjs +242 -0
  123. package/dist/agents/middleware/toolCallLimit.cjs.map +1 -0
  124. package/dist/agents/middleware/toolCallLimit.d.cts +158 -0
  125. package/dist/agents/middleware/toolCallLimit.d.cts.map +1 -0
  126. package/dist/agents/middleware/toolCallLimit.d.ts +158 -0
  127. package/dist/agents/middleware/toolCallLimit.d.ts.map +1 -0
  128. package/dist/agents/middleware/toolCallLimit.js +240 -0
  129. package/dist/agents/middleware/toolCallLimit.js.map +1 -0
  130. package/dist/agents/middleware/types.d.cts +208 -0
  131. package/dist/agents/middleware/types.d.cts.map +1 -0
  132. package/dist/agents/middleware/types.d.ts +208 -0
  133. package/dist/agents/middleware/types.d.ts.map +1 -0
  134. package/dist/agents/middleware/utils.cjs +26 -0
  135. package/dist/agents/middleware/utils.cjs.map +1 -0
  136. package/dist/agents/middleware/utils.d.cts +13 -0
  137. package/dist/agents/middleware/utils.d.cts.map +1 -0
  138. package/dist/agents/middleware/utils.d.ts +13 -0
  139. package/dist/agents/middleware/utils.d.ts.map +1 -0
  140. package/dist/agents/middleware/utils.js +25 -0
  141. package/dist/agents/middleware/utils.js.map +1 -0
  142. package/dist/agents/middleware.cjs +58 -0
  143. package/dist/agents/middleware.cjs.map +1 -0
  144. package/dist/agents/middleware.d.cts +205 -0
  145. package/dist/agents/middleware.d.cts.map +1 -0
  146. package/dist/agents/middleware.d.ts +205 -0
  147. package/dist/agents/middleware.d.ts.map +1 -0
  148. package/dist/agents/middleware.js +57 -0
  149. package/dist/agents/middleware.js.map +1 -0
  150. package/dist/agents/nodes/AfterAgentNode.cjs +27 -0
  151. package/dist/agents/nodes/AfterAgentNode.cjs.map +1 -0
  152. package/dist/agents/nodes/AfterAgentNode.js +27 -0
  153. package/dist/agents/nodes/AfterAgentNode.js.map +1 -0
  154. package/dist/agents/nodes/AfterModelNode.cjs +27 -0
  155. package/dist/agents/nodes/AfterModelNode.cjs.map +1 -0
  156. package/dist/agents/nodes/AfterModelNode.js +27 -0
  157. package/dist/agents/nodes/AfterModelNode.js.map +1 -0
  158. package/dist/agents/nodes/AgentNode.cjs +202 -71
  159. package/dist/agents/nodes/AgentNode.cjs.map +1 -1
  160. package/dist/agents/nodes/AgentNode.js +204 -73
  161. package/dist/agents/nodes/AgentNode.js.map +1 -1
  162. package/dist/agents/nodes/BeforeAgentNode.cjs +27 -0
  163. package/dist/agents/nodes/BeforeAgentNode.cjs.map +1 -0
  164. package/dist/agents/nodes/BeforeAgentNode.js +27 -0
  165. package/dist/agents/nodes/BeforeAgentNode.js.map +1 -0
  166. package/dist/agents/nodes/BeforeModelNode.cjs +27 -0
  167. package/dist/agents/nodes/BeforeModelNode.cjs.map +1 -0
  168. package/dist/agents/nodes/BeforeModelNode.js +27 -0
  169. package/dist/agents/nodes/BeforeModelNode.js.map +1 -0
  170. package/dist/agents/nodes/ToolNode.cjs +157 -47
  171. package/dist/agents/nodes/ToolNode.cjs.map +1 -1
  172. package/dist/agents/nodes/ToolNode.js +158 -48
  173. package/dist/agents/nodes/ToolNode.js.map +1 -1
  174. package/dist/agents/nodes/middleware.cjs +124 -0
  175. package/dist/agents/nodes/middleware.cjs.map +1 -0
  176. package/dist/agents/nodes/middleware.js +123 -0
  177. package/dist/agents/nodes/middleware.js.map +1 -0
  178. package/dist/agents/nodes/types.d.cts +57 -0
  179. package/dist/agents/nodes/types.d.cts.map +1 -0
  180. package/dist/agents/nodes/types.d.ts +57 -0
  181. package/dist/agents/nodes/types.d.ts.map +1 -0
  182. package/dist/agents/nodes/utils.cjs +64 -0
  183. package/dist/agents/nodes/utils.cjs.map +1 -1
  184. package/dist/agents/nodes/utils.js +62 -1
  185. package/dist/agents/nodes/utils.js.map +1 -1
  186. package/dist/agents/responses.cjs +1 -1
  187. package/dist/agents/responses.cjs.map +1 -1
  188. package/dist/agents/responses.d.cts +9 -2
  189. package/dist/agents/responses.d.cts.map +1 -1
  190. package/dist/agents/responses.d.ts +8 -1
  191. package/dist/agents/responses.d.ts.map +1 -1
  192. package/dist/agents/responses.js +1 -1
  193. package/dist/agents/responses.js.map +1 -1
  194. package/dist/agents/runtime.d.cts +123 -0
  195. package/dist/agents/runtime.d.cts.map +1 -0
  196. package/dist/agents/runtime.d.ts +123 -0
  197. package/dist/agents/runtime.d.ts.map +1 -0
  198. package/dist/agents/tests/utils.cjs +85 -0
  199. package/dist/agents/tests/utils.cjs.map +1 -0
  200. package/dist/agents/tests/utils.d.cts +62 -0
  201. package/dist/agents/tests/utils.d.cts.map +1 -0
  202. package/dist/agents/tests/utils.d.ts +62 -0
  203. package/dist/agents/tests/utils.d.ts.map +1 -0
  204. package/dist/agents/tests/utils.js +84 -0
  205. package/dist/agents/tests/utils.js.map +1 -0
  206. package/dist/agents/tools.d.cts +9 -0
  207. package/dist/agents/tools.d.cts.map +1 -0
  208. package/dist/agents/tools.d.ts +9 -0
  209. package/dist/agents/tools.d.ts.map +1 -0
  210. package/dist/agents/types.d.cts +139 -106
  211. package/dist/agents/types.d.cts.map +1 -1
  212. package/dist/agents/types.d.ts +139 -106
  213. package/dist/agents/types.d.ts.map +1 -1
  214. package/dist/agents/utils.cjs +141 -38
  215. package/dist/agents/utils.cjs.map +1 -1
  216. package/dist/agents/utils.js +142 -40
  217. package/dist/agents/utils.js.map +1 -1
  218. package/dist/chat_models/universal.cjs +11 -0
  219. package/dist/chat_models/universal.cjs.map +1 -1
  220. package/dist/chat_models/universal.d.cts +12 -3
  221. package/dist/chat_models/universal.d.cts.map +1 -1
  222. package/dist/chat_models/universal.d.ts +11 -2
  223. package/dist/chat_models/universal.d.ts.map +1 -1
  224. package/dist/chat_models/universal.js +11 -0
  225. package/dist/chat_models/universal.js.map +1 -1
  226. package/dist/hub/base.cjs +8 -4
  227. package/dist/hub/base.cjs.map +1 -1
  228. package/dist/hub/base.d.cts +0 -4
  229. package/dist/hub/base.d.cts.map +1 -1
  230. package/dist/hub/base.d.ts +0 -4
  231. package/dist/hub/base.d.ts.map +1 -1
  232. package/dist/hub/base.js +8 -4
  233. package/dist/hub/base.js.map +1 -1
  234. package/dist/index.cjs +53 -15
  235. package/dist/index.cjs.map +1 -1
  236. package/dist/index.d.cts +23 -14
  237. package/dist/index.d.ts +23 -14
  238. package/dist/index.js +35 -12
  239. package/dist/index.js.map +1 -1
  240. package/dist/load/import_constants.cjs +0 -19
  241. package/dist/load/import_constants.cjs.map +1 -1
  242. package/dist/load/import_constants.js +0 -19
  243. package/dist/load/import_constants.js.map +1 -1
  244. package/dist/load/import_map.cjs +2 -115
  245. package/dist/load/import_map.cjs.map +1 -1
  246. package/dist/load/import_map.js +3 -116
  247. package/dist/load/import_map.js.map +1 -1
  248. package/dist/load/serializable.d.cts +1 -10
  249. package/dist/load/serializable.d.ts +1 -10
  250. 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 +3096 -0
  251. 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
  252. 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 +3095 -0
  253. 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
  254. 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/env.cjs +12 -0
  255. 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/env.cjs.map +1 -0
  256. 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/env.js +12 -0
  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/env.js.map +1 -0
  258. 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/experimental/otel/constants.cjs +71 -0
  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/experimental/otel/constants.cjs.map +1 -0
  260. 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/experimental/otel/constants.js +38 -0
  261. 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/experimental/otel/constants.js.map +1 -0
  262. 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/experimental/otel/translator.cjs +221 -0
  263. 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/experimental/otel/translator.cjs.map +1 -0
  264. 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/experimental/otel/translator.js +221 -0
  265. 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/experimental/otel/translator.js.map +1 -0
  266. 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/index.cjs +11 -0
  267. 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/index.cjs.map +1 -0
  268. 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/index.js +11 -0
  269. 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/index.js.map +1 -0
  270. 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 +703 -0
  271. 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
  272. 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 +702 -0
  273. 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
  274. 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/singletons/constants.cjs +7 -0
  275. 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/singletons/constants.cjs.map +1 -0
  276. 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/singletons/constants.js +6 -0
  277. 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/singletons/constants.js.map +1 -0
  278. 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/singletons/fetch.cjs +29 -0
  279. 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/singletons/fetch.cjs.map +1 -0
  280. 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/singletons/fetch.js +28 -0
  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/singletons/fetch.js.map +1 -0
  282. 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/singletons/otel.cjs +115 -0
  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/singletons/otel.cjs.map +1 -0
  284. 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/singletons/otel.js +113 -0
  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/singletons/otel.js.map +1 -0
  286. 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/_uuid.cjs +14 -0
  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/_uuid.cjs.map +1 -0
  288. 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/_uuid.js +13 -0
  289. 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/_uuid.js.map +1 -0
  290. 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/async_caller.cjs +95 -0
  291. 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/async_caller.cjs.map +1 -0
  292. 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/async_caller.js +95 -0
  293. 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/async_caller.js.map +1 -0
  294. 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 +136 -0
  295. 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
  296. 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 +131 -0
  297. 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
  298. 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 +102 -0
  299. 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
  300. 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 +99 -0
  301. 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
  302. 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/fast-safe-stringify/index.cjs +140 -0
  303. 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/fast-safe-stringify/index.cjs.map +1 -0
  304. 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/fast-safe-stringify/index.js +140 -0
  305. 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/fast-safe-stringify/index.js.map +1 -0
  306. 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/messages.cjs +18 -0
  307. 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/messages.cjs.map +1 -0
  308. 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/messages.js +16 -0
  309. 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/messages.js.map +1 -0
  310. 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/project.cjs +10 -0
  311. 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/project.cjs.map +1 -0
  312. 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/project.js +10 -0
  313. 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/project.js.map +1 -0
  314. 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/prompts.cjs +30 -0
  315. 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/prompts.cjs.map +1 -0
  316. 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/prompts.js +30 -0
  317. 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/prompts.js.map +1 -0
  318. 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/warn.cjs +13 -0
  319. 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/warn.cjs.map +1 -0
  320. 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/warn.js +12 -0
  321. 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/warn.js.map +1 -0
  322. package/dist/node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.cjs +83 -0
  323. package/dist/node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.cjs.map +1 -0
  324. package/dist/node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.js +79 -0
  325. package/dist/node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.js.map +1 -0
  326. package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.cjs +16 -0
  327. package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.cjs.map +1 -0
  328. package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js +13 -0
  329. package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js.map +1 -0
  330. package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.cjs +77 -0
  331. package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.cjs.map +1 -0
  332. package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js +74 -0
  333. package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js.map +1 -0
  334. package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.cjs +115 -0
  335. package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.cjs.map +1 -0
  336. package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js +112 -0
  337. package/dist/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js.map +1 -0
  338. package/dist/storage/encoder_backed.cjs +1 -1
  339. package/dist/storage/encoder_backed.d.cts +1 -1
  340. package/dist/storage/encoder_backed.d.ts +1 -1
  341. package/dist/storage/encoder_backed.js +1 -1
  342. package/dist/storage/file_system.cjs +1 -1
  343. package/dist/storage/file_system.js +1 -1
  344. package/package.json +31 -658
  345. package/dist/agents/RunnableCallable.d.cts +0 -36
  346. package/dist/agents/RunnableCallable.d.cts.map +0 -1
  347. package/dist/agents/RunnableCallable.d.ts +0 -36
  348. package/dist/agents/RunnableCallable.d.ts.map +0 -1
  349. package/dist/agents/annotation.d.cts +0 -47
  350. package/dist/agents/annotation.d.cts.map +0 -1
  351. package/dist/agents/annotation.d.ts +0 -47
  352. package/dist/agents/annotation.d.ts.map +0 -1
  353. package/dist/agents/createAgent.cjs +0 -10
  354. package/dist/agents/createAgent.cjs.map +0 -1
  355. package/dist/agents/createAgent.js +0 -10
  356. package/dist/agents/createAgent.js.map +0 -1
  357. package/dist/agents/interrupt.cjs +0 -2
  358. package/dist/agents/interrupt.d.cts +0 -92
  359. package/dist/agents/interrupt.d.cts.map +0 -1
  360. package/dist/agents/interrupt.d.ts +0 -95
  361. package/dist/agents/interrupt.d.ts.map +0 -1
  362. package/dist/agents/interrupt.js +0 -1
  363. package/dist/agents/middlewareAgent/ReactAgent.cjs +0 -462
  364. package/dist/agents/middlewareAgent/ReactAgent.cjs.map +0 -1
  365. package/dist/agents/middlewareAgent/ReactAgent.d.cts +0 -154
  366. package/dist/agents/middlewareAgent/ReactAgent.d.cts.map +0 -1
  367. package/dist/agents/middlewareAgent/ReactAgent.d.ts +0 -154
  368. package/dist/agents/middlewareAgent/ReactAgent.d.ts.map +0 -1
  369. package/dist/agents/middlewareAgent/ReactAgent.js +0 -461
  370. package/dist/agents/middlewareAgent/ReactAgent.js.map +0 -1
  371. package/dist/agents/middlewareAgent/annotation.cjs +0 -45
  372. package/dist/agents/middlewareAgent/annotation.cjs.map +0 -1
  373. package/dist/agents/middlewareAgent/annotation.js +0 -44
  374. package/dist/agents/middlewareAgent/annotation.js.map +0 -1
  375. package/dist/agents/middlewareAgent/constants.d.cts +0 -5
  376. package/dist/agents/middlewareAgent/constants.d.cts.map +0 -1
  377. package/dist/agents/middlewareAgent/constants.d.ts +0 -5
  378. package/dist/agents/middlewareAgent/constants.d.ts.map +0 -1
  379. package/dist/agents/middlewareAgent/index.cjs +0 -11
  380. package/dist/agents/middlewareAgent/index.cjs.map +0 -1
  381. package/dist/agents/middlewareAgent/index.js +0 -11
  382. package/dist/agents/middlewareAgent/index.js.map +0 -1
  383. package/dist/agents/middlewareAgent/middleware/bigTool.cjs +0 -162
  384. package/dist/agents/middlewareAgent/middleware/bigTool.cjs.map +0 -1
  385. package/dist/agents/middlewareAgent/middleware/bigTool.d.cts +0 -113
  386. package/dist/agents/middlewareAgent/middleware/bigTool.d.cts.map +0 -1
  387. package/dist/agents/middlewareAgent/middleware/bigTool.d.ts +0 -113
  388. package/dist/agents/middlewareAgent/middleware/bigTool.d.ts.map +0 -1
  389. package/dist/agents/middlewareAgent/middleware/bigTool.js +0 -161
  390. package/dist/agents/middlewareAgent/middleware/bigTool.js.map +0 -1
  391. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.cjs +0 -58
  392. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.cjs.map +0 -1
  393. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.cts +0 -46
  394. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.cts.map +0 -1
  395. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.ts +0 -46
  396. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.ts.map +0 -1
  397. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.js +0 -58
  398. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.js.map +0 -1
  399. package/dist/agents/middlewareAgent/middleware/hitl.cjs +0 -311
  400. package/dist/agents/middlewareAgent/middleware/hitl.cjs.map +0 -1
  401. package/dist/agents/middlewareAgent/middleware/hitl.d.cts +0 -419
  402. package/dist/agents/middlewareAgent/middleware/hitl.d.cts.map +0 -1
  403. package/dist/agents/middlewareAgent/middleware/hitl.d.ts +0 -419
  404. package/dist/agents/middlewareAgent/middleware/hitl.d.ts.map +0 -1
  405. package/dist/agents/middlewareAgent/middleware/hitl.js +0 -310
  406. package/dist/agents/middlewareAgent/middleware/hitl.js.map +0 -1
  407. package/dist/agents/middlewareAgent/middleware/index.cjs +0 -32
  408. package/dist/agents/middlewareAgent/middleware/index.cjs.map +0 -1
  409. package/dist/agents/middlewareAgent/middleware/index.d.cts +0 -6
  410. package/dist/agents/middlewareAgent/middleware/index.d.ts +0 -6
  411. package/dist/agents/middlewareAgent/middleware/index.js +0 -21
  412. package/dist/agents/middlewareAgent/middleware/index.js.map +0 -1
  413. package/dist/agents/middlewareAgent/middleware/promptCaching.cjs +0 -198
  414. package/dist/agents/middlewareAgent/middleware/promptCaching.cjs.map +0 -1
  415. package/dist/agents/middlewareAgent/middleware/promptCaching.d.cts +0 -197
  416. package/dist/agents/middlewareAgent/middleware/promptCaching.d.cts.map +0 -1
  417. package/dist/agents/middlewareAgent/middleware/promptCaching.d.ts +0 -197
  418. package/dist/agents/middlewareAgent/middleware/promptCaching.d.ts.map +0 -1
  419. package/dist/agents/middlewareAgent/middleware/promptCaching.js +0 -197
  420. package/dist/agents/middlewareAgent/middleware/promptCaching.js.map +0 -1
  421. package/dist/agents/middlewareAgent/middleware/summarization.cjs +0 -274
  422. package/dist/agents/middlewareAgent/middleware/summarization.cjs.map +0 -1
  423. package/dist/agents/middlewareAgent/middleware/summarization.d.cts +0 -91
  424. package/dist/agents/middlewareAgent/middleware/summarization.d.cts.map +0 -1
  425. package/dist/agents/middlewareAgent/middleware/summarization.d.ts +0 -91
  426. package/dist/agents/middlewareAgent/middleware/summarization.d.ts.map +0 -1
  427. package/dist/agents/middlewareAgent/middleware/summarization.js +0 -272
  428. package/dist/agents/middlewareAgent/middleware/summarization.js.map +0 -1
  429. package/dist/agents/middlewareAgent/middleware.cjs +0 -50
  430. package/dist/agents/middlewareAgent/middleware.cjs.map +0 -1
  431. package/dist/agents/middlewareAgent/middleware.d.cts +0 -106
  432. package/dist/agents/middlewareAgent/middleware.d.cts.map +0 -1
  433. package/dist/agents/middlewareAgent/middleware.d.ts +0 -106
  434. package/dist/agents/middlewareAgent/middleware.d.ts.map +0 -1
  435. package/dist/agents/middlewareAgent/middleware.js +0 -49
  436. package/dist/agents/middlewareAgent/middleware.js.map +0 -1
  437. package/dist/agents/middlewareAgent/nodes/AfterModalNode.cjs +0 -29
  438. package/dist/agents/middlewareAgent/nodes/AfterModalNode.cjs.map +0 -1
  439. package/dist/agents/middlewareAgent/nodes/AfterModalNode.js +0 -29
  440. package/dist/agents/middlewareAgent/nodes/AfterModalNode.js.map +0 -1
  441. package/dist/agents/middlewareAgent/nodes/AgentNode.cjs +0 -374
  442. package/dist/agents/middlewareAgent/nodes/AgentNode.cjs.map +0 -1
  443. package/dist/agents/middlewareAgent/nodes/AgentNode.js +0 -373
  444. package/dist/agents/middlewareAgent/nodes/AgentNode.js.map +0 -1
  445. package/dist/agents/middlewareAgent/nodes/BeforeModalNode.cjs +0 -27
  446. package/dist/agents/middlewareAgent/nodes/BeforeModalNode.cjs.map +0 -1
  447. package/dist/agents/middlewareAgent/nodes/BeforeModalNode.js +0 -27
  448. package/dist/agents/middlewareAgent/nodes/BeforeModalNode.js.map +0 -1
  449. package/dist/agents/middlewareAgent/nodes/middleware.cjs +0 -98
  450. package/dist/agents/middlewareAgent/nodes/middleware.cjs.map +0 -1
  451. package/dist/agents/middlewareAgent/nodes/middleware.js +0 -97
  452. package/dist/agents/middlewareAgent/nodes/middleware.js.map +0 -1
  453. package/dist/agents/middlewareAgent/nodes/utils.cjs +0 -88
  454. package/dist/agents/middlewareAgent/nodes/utils.cjs.map +0 -1
  455. package/dist/agents/middlewareAgent/nodes/utils.js +0 -84
  456. package/dist/agents/middlewareAgent/nodes/utils.js.map +0 -1
  457. package/dist/agents/middlewareAgent/types.d.cts +0 -467
  458. package/dist/agents/middlewareAgent/types.d.cts.map +0 -1
  459. package/dist/agents/middlewareAgent/types.d.ts +0 -467
  460. package/dist/agents/middlewareAgent/types.d.ts.map +0 -1
  461. package/dist/agents/nodes/ToolNode.d.cts +0 -97
  462. package/dist/agents/nodes/ToolNode.d.cts.map +0 -1
  463. package/dist/agents/nodes/ToolNode.d.ts +0 -97
  464. package/dist/agents/nodes/ToolNode.d.ts.map +0 -1
  465. package/dist/chains/analyze_documents_chain.cjs +0 -83
  466. package/dist/chains/analyze_documents_chain.cjs.map +0 -1
  467. package/dist/chains/analyze_documents_chain.d.cts +0 -58
  468. package/dist/chains/analyze_documents_chain.d.cts.map +0 -1
  469. package/dist/chains/analyze_documents_chain.d.ts +0 -58
  470. package/dist/chains/analyze_documents_chain.d.ts.map +0 -1
  471. package/dist/chains/analyze_documents_chain.js +0 -82
  472. package/dist/chains/analyze_documents_chain.js.map +0 -1
  473. package/dist/chains/api/api_chain.cjs +0 -100
  474. package/dist/chains/api/api_chain.cjs.map +0 -1
  475. package/dist/chains/api/api_chain.d.cts +0 -63
  476. package/dist/chains/api/api_chain.d.cts.map +0 -1
  477. package/dist/chains/api/api_chain.d.ts +0 -63
  478. package/dist/chains/api/api_chain.d.ts.map +0 -1
  479. package/dist/chains/api/api_chain.js +0 -100
  480. package/dist/chains/api/api_chain.js.map +0 -1
  481. package/dist/chains/api/prompts.cjs +0 -38
  482. package/dist/chains/api/prompts.cjs.map +0 -1
  483. package/dist/chains/api/prompts.js +0 -36
  484. package/dist/chains/api/prompts.js.map +0 -1
  485. package/dist/chains/base.cjs +0 -180
  486. package/dist/chains/base.cjs.map +0 -1
  487. package/dist/chains/base.d.cts +0 -88
  488. package/dist/chains/base.d.cts.map +0 -1
  489. package/dist/chains/base.d.ts +0 -88
  490. package/dist/chains/base.d.ts.map +0 -1
  491. package/dist/chains/base.js +0 -179
  492. package/dist/chains/base.js.map +0 -1
  493. package/dist/chains/chat_vector_db_chain.cjs +0 -130
  494. package/dist/chains/chat_vector_db_chain.cjs.map +0 -1
  495. package/dist/chains/chat_vector_db_chain.d.cts +0 -62
  496. package/dist/chains/chat_vector_db_chain.d.cts.map +0 -1
  497. package/dist/chains/chat_vector_db_chain.d.ts +0 -62
  498. package/dist/chains/chat_vector_db_chain.d.ts.map +0 -1
  499. package/dist/chains/chat_vector_db_chain.js +0 -129
  500. package/dist/chains/chat_vector_db_chain.js.map +0 -1
  501. package/dist/chains/combine_docs_chain.cjs +0 -275
  502. package/dist/chains/combine_docs_chain.cjs.map +0 -1
  503. package/dist/chains/combine_docs_chain.d.cts +0 -126
  504. package/dist/chains/combine_docs_chain.d.cts.map +0 -1
  505. package/dist/chains/combine_docs_chain.d.ts +0 -126
  506. package/dist/chains/combine_docs_chain.d.ts.map +0 -1
  507. package/dist/chains/combine_docs_chain.js +0 -272
  508. package/dist/chains/combine_docs_chain.js.map +0 -1
  509. package/dist/chains/combine_documents/base.cjs +0 -22
  510. package/dist/chains/combine_documents/base.cjs.map +0 -1
  511. package/dist/chains/combine_documents/base.js +0 -18
  512. package/dist/chains/combine_documents/base.js.map +0 -1
  513. package/dist/chains/combine_documents/index.cjs +0 -16
  514. package/dist/chains/combine_documents/index.cjs.map +0 -1
  515. package/dist/chains/combine_documents/index.d.cts +0 -2
  516. package/dist/chains/combine_documents/index.d.ts +0 -2
  517. package/dist/chains/combine_documents/index.js +0 -10
  518. package/dist/chains/combine_documents/index.js.map +0 -1
  519. package/dist/chains/combine_documents/reduce.cjs +0 -73
  520. package/dist/chains/combine_documents/reduce.cjs.map +0 -1
  521. package/dist/chains/combine_documents/reduce.d.cts +0 -36
  522. package/dist/chains/combine_documents/reduce.d.cts.map +0 -1
  523. package/dist/chains/combine_documents/reduce.d.ts +0 -36
  524. package/dist/chains/combine_documents/reduce.d.ts.map +0 -1
  525. package/dist/chains/combine_documents/reduce.js +0 -66
  526. package/dist/chains/combine_documents/reduce.js.map +0 -1
  527. package/dist/chains/combine_documents/stuff.cjs +0 -41
  528. package/dist/chains/combine_documents/stuff.cjs.map +0 -1
  529. package/dist/chains/combine_documents/stuff.d.cts +0 -40
  530. package/dist/chains/combine_documents/stuff.d.cts.map +0 -1
  531. package/dist/chains/combine_documents/stuff.d.ts +0 -40
  532. package/dist/chains/combine_documents/stuff.d.ts.map +0 -1
  533. package/dist/chains/combine_documents/stuff.js +0 -40
  534. package/dist/chains/combine_documents/stuff.js.map +0 -1
  535. package/dist/chains/constitutional_ai/constitutional_chain.cjs +0 -131
  536. package/dist/chains/constitutional_ai/constitutional_chain.cjs.map +0 -1
  537. package/dist/chains/constitutional_ai/constitutional_chain.d.cts +0 -79
  538. package/dist/chains/constitutional_ai/constitutional_chain.d.cts.map +0 -1
  539. package/dist/chains/constitutional_ai/constitutional_chain.d.ts +0 -79
  540. package/dist/chains/constitutional_ai/constitutional_chain.d.ts.map +0 -1
  541. package/dist/chains/constitutional_ai/constitutional_chain.js +0 -131
  542. package/dist/chains/constitutional_ai/constitutional_chain.js.map +0 -1
  543. package/dist/chains/constitutional_ai/constitutional_principle.cjs +0 -322
  544. package/dist/chains/constitutional_ai/constitutional_principle.cjs.map +0 -1
  545. package/dist/chains/constitutional_ai/constitutional_principle.d.cts +0 -50
  546. package/dist/chains/constitutional_ai/constitutional_principle.d.cts.map +0 -1
  547. package/dist/chains/constitutional_ai/constitutional_principle.d.ts +0 -50
  548. package/dist/chains/constitutional_ai/constitutional_principle.d.ts.map +0 -1
  549. package/dist/chains/constitutional_ai/constitutional_principle.js +0 -320
  550. package/dist/chains/constitutional_ai/constitutional_principle.js.map +0 -1
  551. package/dist/chains/constitutional_ai/constitutional_prompts.cjs +0 -96
  552. package/dist/chains/constitutional_ai/constitutional_prompts.cjs.map +0 -1
  553. package/dist/chains/constitutional_ai/constitutional_prompts.js +0 -94
  554. package/dist/chains/constitutional_ai/constitutional_prompts.js.map +0 -1
  555. package/dist/chains/conversation.cjs +0 -50
  556. package/dist/chains/conversation.cjs.map +0 -1
  557. package/dist/chains/conversation.d.cts +0 -34
  558. package/dist/chains/conversation.d.cts.map +0 -1
  559. package/dist/chains/conversation.d.ts +0 -34
  560. package/dist/chains/conversation.d.ts.map +0 -1
  561. package/dist/chains/conversation.js +0 -48
  562. package/dist/chains/conversation.js.map +0 -1
  563. package/dist/chains/conversational_retrieval_chain.cjs +0 -218
  564. package/dist/chains/conversational_retrieval_chain.cjs.map +0 -1
  565. package/dist/chains/conversational_retrieval_chain.d.cts +0 -152
  566. package/dist/chains/conversational_retrieval_chain.d.cts.map +0 -1
  567. package/dist/chains/conversational_retrieval_chain.d.ts +0 -152
  568. package/dist/chains/conversational_retrieval_chain.d.ts.map +0 -1
  569. package/dist/chains/conversational_retrieval_chain.js +0 -217
  570. package/dist/chains/conversational_retrieval_chain.js.map +0 -1
  571. package/dist/chains/graph_qa/cypher.cjs +0 -133
  572. package/dist/chains/graph_qa/cypher.cjs.map +0 -1
  573. package/dist/chains/graph_qa/cypher.d.cts +0 -76
  574. package/dist/chains/graph_qa/cypher.d.cts.map +0 -1
  575. package/dist/chains/graph_qa/cypher.d.ts +0 -76
  576. package/dist/chains/graph_qa/cypher.d.ts.map +0 -1
  577. package/dist/chains/graph_qa/cypher.js +0 -126
  578. package/dist/chains/graph_qa/cypher.js.map +0 -1
  579. package/dist/chains/graph_qa/prompts.cjs +0 -46
  580. package/dist/chains/graph_qa/prompts.cjs.map +0 -1
  581. package/dist/chains/graph_qa/prompts.js +0 -44
  582. package/dist/chains/graph_qa/prompts.js.map +0 -1
  583. package/dist/chains/history_aware_retriever.cjs +0 -55
  584. package/dist/chains/history_aware_retriever.cjs.map +0 -1
  585. package/dist/chains/history_aware_retriever.d.cts +0 -64
  586. package/dist/chains/history_aware_retriever.d.cts.map +0 -1
  587. package/dist/chains/history_aware_retriever.d.ts +0 -64
  588. package/dist/chains/history_aware_retriever.d.ts.map +0 -1
  589. package/dist/chains/history_aware_retriever.js +0 -49
  590. package/dist/chains/history_aware_retriever.js.map +0 -1
  591. package/dist/chains/index.cjs +0 -106
  592. package/dist/chains/index.cjs.map +0 -1
  593. package/dist/chains/index.d.cts +0 -25
  594. package/dist/chains/index.d.ts +0 -25
  595. package/dist/chains/index.js +0 -67
  596. package/dist/chains/index.js.map +0 -1
  597. package/dist/chains/llm_chain.cjs +0 -155
  598. package/dist/chains/llm_chain.cjs.map +0 -1
  599. package/dist/chains/llm_chain.d.cts +0 -97
  600. package/dist/chains/llm_chain.d.cts.map +0 -1
  601. package/dist/chains/llm_chain.d.ts +0 -97
  602. package/dist/chains/llm_chain.d.ts.map +0 -1
  603. package/dist/chains/llm_chain.js +0 -154
  604. package/dist/chains/llm_chain.js.map +0 -1
  605. package/dist/chains/load.cjs +0 -48
  606. package/dist/chains/load.cjs.map +0 -1
  607. package/dist/chains/load.d.cts +0 -30
  608. package/dist/chains/load.d.cts.map +0 -1
  609. package/dist/chains/load.d.ts +0 -30
  610. package/dist/chains/load.d.ts.map +0 -1
  611. package/dist/chains/load.js +0 -42
  612. package/dist/chains/load.js.map +0 -1
  613. package/dist/chains/openai_functions/base.cjs +0 -139
  614. package/dist/chains/openai_functions/base.cjs.map +0 -1
  615. package/dist/chains/openai_functions/base.d.cts +0 -172
  616. package/dist/chains/openai_functions/base.d.cts.map +0 -1
  617. package/dist/chains/openai_functions/base.d.ts +0 -172
  618. package/dist/chains/openai_functions/base.d.ts.map +0 -1
  619. package/dist/chains/openai_functions/base.js +0 -137
  620. package/dist/chains/openai_functions/base.js.map +0 -1
  621. package/dist/chains/openai_functions/extraction.cjs +0 -71
  622. package/dist/chains/openai_functions/extraction.cjs.map +0 -1
  623. package/dist/chains/openai_functions/extraction.d.cts +0 -29
  624. package/dist/chains/openai_functions/extraction.d.cts.map +0 -1
  625. package/dist/chains/openai_functions/extraction.d.ts +0 -29
  626. package/dist/chains/openai_functions/extraction.d.ts.map +0 -1
  627. package/dist/chains/openai_functions/extraction.js +0 -69
  628. package/dist/chains/openai_functions/extraction.js.map +0 -1
  629. package/dist/chains/openai_functions/index.cjs +0 -33
  630. package/dist/chains/openai_functions/index.cjs.map +0 -1
  631. package/dist/chains/openai_functions/index.d.cts +0 -5
  632. package/dist/chains/openai_functions/index.d.ts +0 -5
  633. package/dist/chains/openai_functions/index.js +0 -21
  634. package/dist/chains/openai_functions/index.js.map +0 -1
  635. package/dist/chains/openai_functions/openapi.cjs +0 -287
  636. package/dist/chains/openai_functions/openapi.cjs.map +0 -1
  637. package/dist/chains/openai_functions/openapi.d.cts +0 -61
  638. package/dist/chains/openai_functions/openapi.d.cts.map +0 -1
  639. package/dist/chains/openai_functions/openapi.d.ts +0 -61
  640. package/dist/chains/openai_functions/openapi.d.ts.map +0 -1
  641. package/dist/chains/openai_functions/openapi.js +0 -285
  642. package/dist/chains/openai_functions/openapi.js.map +0 -1
  643. package/dist/chains/openai_functions/tagging.cjs +0 -72
  644. package/dist/chains/openai_functions/tagging.cjs.map +0 -1
  645. package/dist/chains/openai_functions/tagging.d.cts +0 -47
  646. package/dist/chains/openai_functions/tagging.d.cts.map +0 -1
  647. package/dist/chains/openai_functions/tagging.d.ts +0 -47
  648. package/dist/chains/openai_functions/tagging.d.ts.map +0 -1
  649. package/dist/chains/openai_functions/tagging.js +0 -70
  650. package/dist/chains/openai_functions/tagging.js.map +0 -1
  651. package/dist/chains/query_constructor/index.cjs +0 -145
  652. package/dist/chains/query_constructor/index.cjs.map +0 -1
  653. package/dist/chains/query_constructor/index.d.cts +0 -82
  654. package/dist/chains/query_constructor/index.d.cts.map +0 -1
  655. package/dist/chains/query_constructor/index.d.ts +0 -82
  656. package/dist/chains/query_constructor/index.d.ts.map +0 -1
  657. package/dist/chains/query_constructor/index.js +0 -130
  658. package/dist/chains/query_constructor/index.js.map +0 -1
  659. package/dist/chains/query_constructor/ir.cjs +0 -22
  660. package/dist/chains/query_constructor/ir.cjs.map +0 -1
  661. package/dist/chains/query_constructor/ir.d.cts +0 -1
  662. package/dist/chains/query_constructor/ir.d.ts +0 -1
  663. package/dist/chains/query_constructor/ir.js +0 -12
  664. package/dist/chains/query_constructor/ir.js.map +0 -1
  665. package/dist/chains/query_constructor/parser.cjs +0 -80
  666. package/dist/chains/query_constructor/parser.cjs.map +0 -1
  667. package/dist/chains/query_constructor/parser.d.cts +0 -43
  668. package/dist/chains/query_constructor/parser.d.cts.map +0 -1
  669. package/dist/chains/query_constructor/parser.d.ts +0 -43
  670. package/dist/chains/query_constructor/parser.d.ts.map +0 -1
  671. package/dist/chains/query_constructor/parser.js +0 -79
  672. package/dist/chains/query_constructor/parser.js.map +0 -1
  673. package/dist/chains/query_constructor/prompt.cjs +0 -137
  674. package/dist/chains/query_constructor/prompt.cjs.map +0 -1
  675. package/dist/chains/query_constructor/prompt.d.cts +0 -22
  676. package/dist/chains/query_constructor/prompt.d.cts.map +0 -1
  677. package/dist/chains/query_constructor/prompt.d.ts +0 -22
  678. package/dist/chains/query_constructor/prompt.d.ts.map +0 -1
  679. package/dist/chains/query_constructor/prompt.js +0 -132
  680. package/dist/chains/query_constructor/prompt.js.map +0 -1
  681. package/dist/chains/question_answering/load.cjs +0 -99
  682. package/dist/chains/question_answering/load.cjs.map +0 -1
  683. package/dist/chains/question_answering/load.d.cts +0 -72
  684. package/dist/chains/question_answering/load.d.cts.map +0 -1
  685. package/dist/chains/question_answering/load.d.ts +0 -72
  686. package/dist/chains/question_answering/load.d.ts.map +0 -1
  687. package/dist/chains/question_answering/load.js +0 -96
  688. package/dist/chains/question_answering/load.js.map +0 -1
  689. package/dist/chains/question_answering/map_reduce_prompts.cjs +0 -61
  690. package/dist/chains/question_answering/map_reduce_prompts.cjs.map +0 -1
  691. package/dist/chains/question_answering/map_reduce_prompts.js +0 -59
  692. package/dist/chains/question_answering/map_reduce_prompts.js.map +0 -1
  693. package/dist/chains/question_answering/refine_prompts.cjs +0 -60
  694. package/dist/chains/question_answering/refine_prompts.cjs.map +0 -1
  695. package/dist/chains/question_answering/refine_prompts.js +0 -58
  696. package/dist/chains/question_answering/refine_prompts.js.map +0 -1
  697. package/dist/chains/question_answering/stuff_prompts.cjs +0 -20
  698. package/dist/chains/question_answering/stuff_prompts.cjs.map +0 -1
  699. package/dist/chains/question_answering/stuff_prompts.js +0 -19
  700. package/dist/chains/question_answering/stuff_prompts.js.map +0 -1
  701. package/dist/chains/retrieval.cjs +0 -55
  702. package/dist/chains/retrieval.cjs.map +0 -1
  703. package/dist/chains/retrieval.d.cts +0 -77
  704. package/dist/chains/retrieval.d.cts.map +0 -1
  705. package/dist/chains/retrieval.d.ts +0 -77
  706. package/dist/chains/retrieval.d.ts.map +0 -1
  707. package/dist/chains/retrieval.js +0 -49
  708. package/dist/chains/retrieval.js.map +0 -1
  709. package/dist/chains/retrieval_qa.cjs +0 -106
  710. package/dist/chains/retrieval_qa.cjs.map +0 -1
  711. package/dist/chains/retrieval_qa.d.cts +0 -81
  712. package/dist/chains/retrieval_qa.d.cts.map +0 -1
  713. package/dist/chains/retrieval_qa.d.ts +0 -81
  714. package/dist/chains/retrieval_qa.d.ts.map +0 -1
  715. package/dist/chains/retrieval_qa.js +0 -106
  716. package/dist/chains/retrieval_qa.js.map +0 -1
  717. package/dist/chains/router/llm_router.cjs +0 -50
  718. package/dist/chains/router/llm_router.cjs.map +0 -1
  719. package/dist/chains/router/llm_router.d.cts +0 -54
  720. package/dist/chains/router/llm_router.d.cts.map +0 -1
  721. package/dist/chains/router/llm_router.d.ts +0 -54
  722. package/dist/chains/router/llm_router.d.ts.map +0 -1
  723. package/dist/chains/router/llm_router.js +0 -50
  724. package/dist/chains/router/llm_router.js.map +0 -1
  725. package/dist/chains/router/multi_prompt.cjs +0 -116
  726. package/dist/chains/router/multi_prompt.cjs.map +0 -1
  727. package/dist/chains/router/multi_prompt.d.cts +0 -76
  728. package/dist/chains/router/multi_prompt.d.cts.map +0 -1
  729. package/dist/chains/router/multi_prompt.d.ts +0 -76
  730. package/dist/chains/router/multi_prompt.d.ts.map +0 -1
  731. package/dist/chains/router/multi_prompt.js +0 -115
  732. package/dist/chains/router/multi_prompt.js.map +0 -1
  733. package/dist/chains/router/multi_prompt_prompt.cjs +0 -22
  734. package/dist/chains/router/multi_prompt_prompt.cjs.map +0 -1
  735. package/dist/chains/router/multi_prompt_prompt.js +0 -21
  736. package/dist/chains/router/multi_prompt_prompt.js.map +0 -1
  737. package/dist/chains/router/multi_retrieval_prompt.cjs +0 -22
  738. package/dist/chains/router/multi_retrieval_prompt.cjs.map +0 -1
  739. package/dist/chains/router/multi_retrieval_prompt.js +0 -21
  740. package/dist/chains/router/multi_retrieval_prompt.js.map +0 -1
  741. package/dist/chains/router/multi_retrieval_qa.cjs +0 -137
  742. package/dist/chains/router/multi_retrieval_qa.cjs.map +0 -1
  743. package/dist/chains/router/multi_retrieval_qa.d.cts +0 -100
  744. package/dist/chains/router/multi_retrieval_qa.d.cts.map +0 -1
  745. package/dist/chains/router/multi_retrieval_qa.d.ts +0 -100
  746. package/dist/chains/router/multi_retrieval_qa.d.ts.map +0 -1
  747. package/dist/chains/router/multi_retrieval_qa.js +0 -136
  748. package/dist/chains/router/multi_retrieval_qa.js.map +0 -1
  749. package/dist/chains/router/multi_route.cjs +0 -69
  750. package/dist/chains/router/multi_route.cjs.map +0 -1
  751. package/dist/chains/router/multi_route.d.cts +0 -69
  752. package/dist/chains/router/multi_route.d.cts.map +0 -1
  753. package/dist/chains/router/multi_route.d.ts +0 -69
  754. package/dist/chains/router/multi_route.d.ts.map +0 -1
  755. package/dist/chains/router/multi_route.js +0 -68
  756. package/dist/chains/router/multi_route.js.map +0 -1
  757. package/dist/chains/router/utils.cjs +0 -18
  758. package/dist/chains/router/utils.cjs.map +0 -1
  759. package/dist/chains/router/utils.js +0 -17
  760. package/dist/chains/router/utils.js.map +0 -1
  761. package/dist/chains/sequential_chain.cjs +0 -255
  762. package/dist/chains/sequential_chain.cjs.map +0 -1
  763. package/dist/chains/sequential_chain.d.cts +0 -158
  764. package/dist/chains/sequential_chain.d.cts.map +0 -1
  765. package/dist/chains/sequential_chain.d.ts +0 -158
  766. package/dist/chains/sequential_chain.d.ts.map +0 -1
  767. package/dist/chains/sequential_chain.js +0 -254
  768. package/dist/chains/sequential_chain.js.map +0 -1
  769. package/dist/chains/serde.d.cts +0 -156
  770. package/dist/chains/serde.d.cts.map +0 -1
  771. package/dist/chains/serde.d.ts +0 -156
  772. package/dist/chains/serde.d.ts.map +0 -1
  773. package/dist/chains/sql_db/index.cjs +0 -35
  774. package/dist/chains/sql_db/index.cjs.map +0 -1
  775. package/dist/chains/sql_db/index.d.cts +0 -3
  776. package/dist/chains/sql_db/index.d.ts +0 -3
  777. package/dist/chains/sql_db/index.js +0 -21
  778. package/dist/chains/sql_db/index.js.map +0 -1
  779. package/dist/chains/sql_db/sql_db_chain.cjs +0 -196
  780. package/dist/chains/sql_db/sql_db_chain.cjs.map +0 -1
  781. package/dist/chains/sql_db/sql_db_chain.d.cts +0 -124
  782. package/dist/chains/sql_db/sql_db_chain.d.cts.map +0 -1
  783. package/dist/chains/sql_db/sql_db_chain.d.ts +0 -124
  784. package/dist/chains/sql_db/sql_db_chain.d.ts.map +0 -1
  785. package/dist/chains/sql_db/sql_db_chain.js +0 -194
  786. package/dist/chains/sql_db/sql_db_chain.js.map +0 -1
  787. package/dist/chains/sql_db/sql_db_prompt.cjs +0 -194
  788. package/dist/chains/sql_db/sql_db_prompt.cjs.map +0 -1
  789. package/dist/chains/sql_db/sql_db_prompt.d.cts +0 -44
  790. package/dist/chains/sql_db/sql_db_prompt.d.cts.map +0 -1
  791. package/dist/chains/sql_db/sql_db_prompt.d.ts +0 -44
  792. package/dist/chains/sql_db/sql_db_prompt.d.ts.map +0 -1
  793. package/dist/chains/sql_db/sql_db_prompt.js +0 -186
  794. package/dist/chains/sql_db/sql_db_prompt.js.map +0 -1
  795. package/dist/chains/summarization/load.cjs +0 -74
  796. package/dist/chains/summarization/load.cjs.map +0 -1
  797. package/dist/chains/summarization/load.d.cts +0 -33
  798. package/dist/chains/summarization/load.d.cts.map +0 -1
  799. package/dist/chains/summarization/load.d.ts +0 -33
  800. package/dist/chains/summarization/load.d.ts.map +0 -1
  801. package/dist/chains/summarization/load.js +0 -74
  802. package/dist/chains/summarization/load.js.map +0 -1
  803. package/dist/chains/summarization/refine_prompts.cjs +0 -24
  804. package/dist/chains/summarization/refine_prompts.cjs.map +0 -1
  805. package/dist/chains/summarization/refine_prompts.js +0 -23
  806. package/dist/chains/summarization/refine_prompts.js.map +0 -1
  807. package/dist/chains/summarization/stuff_prompts.cjs +0 -19
  808. package/dist/chains/summarization/stuff_prompts.cjs.map +0 -1
  809. package/dist/chains/summarization/stuff_prompts.js +0 -18
  810. package/dist/chains/summarization/stuff_prompts.js.map +0 -1
  811. package/dist/chains/transform.cjs +0 -43
  812. package/dist/chains/transform.cjs.map +0 -1
  813. package/dist/chains/transform.d.cts +0 -44
  814. package/dist/chains/transform.d.cts.map +0 -1
  815. package/dist/chains/transform.d.ts +0 -44
  816. package/dist/chains/transform.d.ts.map +0 -1
  817. package/dist/chains/transform.js +0 -43
  818. package/dist/chains/transform.js.map +0 -1
  819. package/dist/chains/vector_db_qa.cjs +0 -95
  820. package/dist/chains/vector_db_qa.cjs.map +0 -1
  821. package/dist/chains/vector_db_qa.d.cts +0 -66
  822. package/dist/chains/vector_db_qa.d.cts.map +0 -1
  823. package/dist/chains/vector_db_qa.d.ts +0 -66
  824. package/dist/chains/vector_db_qa.d.ts.map +0 -1
  825. package/dist/chains/vector_db_qa.js +0 -95
  826. package/dist/chains/vector_db_qa.js.map +0 -1
  827. package/dist/document.cjs +0 -21
  828. package/dist/document.cjs.map +0 -1
  829. package/dist/document.d.cts +0 -2
  830. package/dist/document.d.ts +0 -2
  831. package/dist/document.js +0 -10
  832. package/dist/document.js.map +0 -1
  833. package/dist/document_loaders/base.cjs +0 -22
  834. package/dist/document_loaders/base.cjs.map +0 -1
  835. package/dist/document_loaders/base.d.cts +0 -1
  836. package/dist/document_loaders/base.d.ts +0 -1
  837. package/dist/document_loaders/base.js +0 -12
  838. package/dist/document_loaders/base.js.map +0 -1
  839. package/dist/document_loaders/fs/buffer.cjs +0 -69
  840. package/dist/document_loaders/fs/buffer.cjs.map +0 -1
  841. package/dist/document_loaders/fs/buffer.d.cts +0 -46
  842. package/dist/document_loaders/fs/buffer.d.cts.map +0 -1
  843. package/dist/document_loaders/fs/buffer.d.ts +0 -46
  844. package/dist/document_loaders/fs/buffer.d.ts.map +0 -1
  845. package/dist/document_loaders/fs/buffer.js +0 -63
  846. package/dist/document_loaders/fs/buffer.js.map +0 -1
  847. package/dist/document_loaders/fs/directory.cjs +0 -116
  848. package/dist/document_loaders/fs/directory.cjs.map +0 -1
  849. package/dist/document_loaders/fs/directory.d.cts +0 -76
  850. package/dist/document_loaders/fs/directory.d.cts.map +0 -1
  851. package/dist/document_loaders/fs/directory.d.ts +0 -76
  852. package/dist/document_loaders/fs/directory.d.ts.map +0 -1
  853. package/dist/document_loaders/fs/directory.js +0 -109
  854. package/dist/document_loaders/fs/directory.js.map +0 -1
  855. package/dist/document_loaders/fs/json.cjs +0 -128
  856. package/dist/document_loaders/fs/json.cjs.map +0 -1
  857. package/dist/document_loaders/fs/json.d.cts +0 -65
  858. package/dist/document_loaders/fs/json.d.cts.map +0 -1
  859. package/dist/document_loaders/fs/json.d.ts +0 -65
  860. package/dist/document_loaders/fs/json.d.ts.map +0 -1
  861. package/dist/document_loaders/fs/json.js +0 -121
  862. package/dist/document_loaders/fs/json.js.map +0 -1
  863. package/dist/document_loaders/fs/multi_file.cjs +0 -82
  864. package/dist/document_loaders/fs/multi_file.cjs.map +0 -1
  865. package/dist/document_loaders/fs/multi_file.d.cts +0 -43
  866. package/dist/document_loaders/fs/multi_file.d.cts.map +0 -1
  867. package/dist/document_loaders/fs/multi_file.d.ts +0 -43
  868. package/dist/document_loaders/fs/multi_file.d.ts.map +0 -1
  869. package/dist/document_loaders/fs/multi_file.js +0 -76
  870. package/dist/document_loaders/fs/multi_file.js.map +0 -1
  871. package/dist/document_loaders/fs/text.cjs +0 -101
  872. package/dist/document_loaders/fs/text.cjs.map +0 -1
  873. package/dist/document_loaders/fs/text.d.cts +0 -57
  874. package/dist/document_loaders/fs/text.d.cts.map +0 -1
  875. package/dist/document_loaders/fs/text.d.ts +0 -57
  876. package/dist/document_loaders/fs/text.d.ts.map +0 -1
  877. package/dist/document_loaders/fs/text.js +0 -95
  878. package/dist/document_loaders/fs/text.js.map +0 -1
  879. package/dist/evaluation/agents/index.cjs +0 -1
  880. package/dist/evaluation/agents/index.js +0 -1
  881. package/dist/evaluation/agents/prompt.cjs +0 -132
  882. package/dist/evaluation/agents/prompt.cjs.map +0 -1
  883. package/dist/evaluation/agents/prompt.js +0 -130
  884. package/dist/evaluation/agents/prompt.js.map +0 -1
  885. package/dist/evaluation/agents/trajectory.cjs +0 -132
  886. package/dist/evaluation/agents/trajectory.cjs.map +0 -1
  887. package/dist/evaluation/agents/trajectory.d.cts +0 -61
  888. package/dist/evaluation/agents/trajectory.d.cts.map +0 -1
  889. package/dist/evaluation/agents/trajectory.d.ts +0 -61
  890. package/dist/evaluation/agents/trajectory.d.ts.map +0 -1
  891. package/dist/evaluation/agents/trajectory.js +0 -130
  892. package/dist/evaluation/agents/trajectory.js.map +0 -1
  893. package/dist/evaluation/base.cjs +0 -169
  894. package/dist/evaluation/base.cjs.map +0 -1
  895. package/dist/evaluation/base.d.cts +0 -240
  896. package/dist/evaluation/base.d.cts.map +0 -1
  897. package/dist/evaluation/base.d.ts +0 -240
  898. package/dist/evaluation/base.d.ts.map +0 -1
  899. package/dist/evaluation/base.js +0 -164
  900. package/dist/evaluation/base.js.map +0 -1
  901. package/dist/evaluation/comparison/index.cjs +0 -1
  902. package/dist/evaluation/comparison/index.js +0 -1
  903. package/dist/evaluation/comparison/pairwise.cjs +0 -178
  904. package/dist/evaluation/comparison/pairwise.cjs.map +0 -1
  905. package/dist/evaluation/comparison/pairwise.d.cts +0 -56
  906. package/dist/evaluation/comparison/pairwise.d.cts.map +0 -1
  907. package/dist/evaluation/comparison/pairwise.d.ts +0 -56
  908. package/dist/evaluation/comparison/pairwise.d.ts.map +0 -1
  909. package/dist/evaluation/comparison/pairwise.js +0 -175
  910. package/dist/evaluation/comparison/pairwise.js.map +0 -1
  911. package/dist/evaluation/comparison/prompt.cjs +0 -77
  912. package/dist/evaluation/comparison/prompt.cjs.map +0 -1
  913. package/dist/evaluation/comparison/prompt.js +0 -75
  914. package/dist/evaluation/comparison/prompt.js.map +0 -1
  915. package/dist/evaluation/criteria/criteria.cjs +0 -164
  916. package/dist/evaluation/criteria/criteria.cjs.map +0 -1
  917. package/dist/evaluation/criteria/criteria.d.cts +0 -85
  918. package/dist/evaluation/criteria/criteria.d.cts.map +0 -1
  919. package/dist/evaluation/criteria/criteria.d.ts +0 -85
  920. package/dist/evaluation/criteria/criteria.d.ts.map +0 -1
  921. package/dist/evaluation/criteria/criteria.js +0 -161
  922. package/dist/evaluation/criteria/criteria.js.map +0 -1
  923. package/dist/evaluation/criteria/index.cjs +0 -1
  924. package/dist/evaluation/criteria/index.js +0 -1
  925. package/dist/evaluation/criteria/prompt.cjs +0 -50
  926. package/dist/evaluation/criteria/prompt.cjs.map +0 -1
  927. package/dist/evaluation/criteria/prompt.js +0 -48
  928. package/dist/evaluation/criteria/prompt.js.map +0 -1
  929. package/dist/evaluation/embedding_distance/base.cjs +0 -108
  930. package/dist/evaluation/embedding_distance/base.cjs.map +0 -1
  931. package/dist/evaluation/embedding_distance/base.d.cts +0 -82
  932. package/dist/evaluation/embedding_distance/base.d.cts.map +0 -1
  933. package/dist/evaluation/embedding_distance/base.d.ts +0 -82
  934. package/dist/evaluation/embedding_distance/base.d.ts.map +0 -1
  935. package/dist/evaluation/embedding_distance/base.js +0 -105
  936. package/dist/evaluation/embedding_distance/base.js.map +0 -1
  937. package/dist/evaluation/embedding_distance/index.cjs +0 -1
  938. package/dist/evaluation/embedding_distance/index.js +0 -1
  939. package/dist/evaluation/index.cjs +0 -54
  940. package/dist/evaluation/index.cjs.map +0 -1
  941. package/dist/evaluation/index.d.cts +0 -8
  942. package/dist/evaluation/index.d.ts +0 -8
  943. package/dist/evaluation/index.js +0 -35
  944. package/dist/evaluation/index.js.map +0 -1
  945. package/dist/evaluation/loader.cjs +0 -57
  946. package/dist/evaluation/loader.cjs.map +0 -1
  947. package/dist/evaluation/loader.d.cts +0 -38
  948. package/dist/evaluation/loader.d.cts.map +0 -1
  949. package/dist/evaluation/loader.d.ts +0 -38
  950. package/dist/evaluation/loader.d.ts.map +0 -1
  951. package/dist/evaluation/loader.js +0 -56
  952. package/dist/evaluation/loader.js.map +0 -1
  953. package/dist/evaluation/qa/eval_chain.cjs +0 -41
  954. package/dist/evaluation/qa/eval_chain.cjs.map +0 -1
  955. package/dist/evaluation/qa/eval_chain.d.cts +0 -22
  956. package/dist/evaluation/qa/eval_chain.d.cts.map +0 -1
  957. package/dist/evaluation/qa/eval_chain.d.ts +0 -22
  958. package/dist/evaluation/qa/eval_chain.d.ts.map +0 -1
  959. package/dist/evaluation/qa/eval_chain.js +0 -41
  960. package/dist/evaluation/qa/eval_chain.js.map +0 -1
  961. package/dist/evaluation/qa/index.cjs +0 -1
  962. package/dist/evaluation/qa/index.js +0 -1
  963. package/dist/evaluation/qa/prompt.cjs +0 -31
  964. package/dist/evaluation/qa/prompt.cjs.map +0 -1
  965. package/dist/evaluation/qa/prompt.js +0 -30
  966. package/dist/evaluation/qa/prompt.js.map +0 -1
  967. package/dist/evaluation/types.d.cts +0 -40
  968. package/dist/evaluation/types.d.cts.map +0 -1
  969. package/dist/evaluation/types.d.ts +0 -40
  970. package/dist/evaluation/types.d.ts.map +0 -1
  971. package/dist/langchain-core/dist/load/map_keys.d.cts +0 -10
  972. package/dist/langchain-core/dist/load/map_keys.d.cts.map +0 -1
  973. package/dist/langchain-core/dist/load/serializable.d.cts +0 -82
  974. package/dist/langchain-core/dist/load/serializable.d.cts.map +0 -1
  975. package/dist/langchain-core/dist/messages/base.d.cts +0 -125
  976. package/dist/langchain-core/dist/messages/base.d.cts.map +0 -1
  977. package/dist/langchain-core/dist/messages/content/base.d.cts +0 -22
  978. package/dist/langchain-core/dist/messages/content/base.d.cts.map +0 -1
  979. package/dist/langchain-core/dist/messages/content/data.d.cts +0 -96
  980. package/dist/langchain-core/dist/messages/content/data.d.cts.map +0 -1
  981. package/dist/langchain-core/dist/messages/content/index.d.cts +0 -121
  982. package/dist/langchain-core/dist/messages/content/index.d.cts.map +0 -1
  983. package/dist/langchain-core/dist/messages/content/multimodal.d.cts +0 -110
  984. package/dist/langchain-core/dist/messages/content/multimodal.d.cts.map +0 -1
  985. package/dist/langchain-core/dist/messages/content/tools.d.cts +0 -214
  986. package/dist/langchain-core/dist/messages/content/tools.d.cts.map +0 -1
  987. package/dist/langchain-core/dist/messages/message.d.cts +0 -598
  988. package/dist/langchain-core/dist/messages/message.d.cts.map +0 -1
  989. package/dist/langchain-core/dist/messages/metadata.d.cts +0 -97
  990. package/dist/langchain-core/dist/messages/metadata.d.cts.map +0 -1
  991. package/dist/langchain-core/dist/messages/utils.d.cts +0 -75
  992. package/dist/langchain-core/dist/messages/utils.d.cts.map +0 -1
  993. package/dist/langchain-core/dist/prompt_values.d.cts +0 -13
  994. package/dist/langchain-core/dist/prompt_values.d.cts.map +0 -1
  995. package/dist/langchain-core/dist/utils/types/index.d.cts +0 -8
  996. package/dist/langchain-core/dist/utils/types/index.d.cts.map +0 -1
  997. package/dist/libs/langchain-core/dist/load/map_keys.d.ts +0 -10
  998. package/dist/libs/langchain-core/dist/load/map_keys.d.ts.map +0 -1
  999. package/dist/libs/langchain-core/dist/load/serializable.d.ts +0 -82
  1000. package/dist/libs/langchain-core/dist/load/serializable.d.ts.map +0 -1
  1001. package/dist/libs/langchain-core/dist/messages/base.d.ts +0 -125
  1002. package/dist/libs/langchain-core/dist/messages/base.d.ts.map +0 -1
  1003. package/dist/libs/langchain-core/dist/messages/content/base.d.ts +0 -22
  1004. package/dist/libs/langchain-core/dist/messages/content/base.d.ts.map +0 -1
  1005. package/dist/libs/langchain-core/dist/messages/content/data.d.ts +0 -96
  1006. package/dist/libs/langchain-core/dist/messages/content/data.d.ts.map +0 -1
  1007. package/dist/libs/langchain-core/dist/messages/content/index.d.ts +0 -121
  1008. package/dist/libs/langchain-core/dist/messages/content/index.d.ts.map +0 -1
  1009. package/dist/libs/langchain-core/dist/messages/content/multimodal.d.ts +0 -110
  1010. package/dist/libs/langchain-core/dist/messages/content/multimodal.d.ts.map +0 -1
  1011. package/dist/libs/langchain-core/dist/messages/content/tools.d.ts +0 -214
  1012. package/dist/libs/langchain-core/dist/messages/content/tools.d.ts.map +0 -1
  1013. package/dist/libs/langchain-core/dist/messages/message.d.ts +0 -598
  1014. package/dist/libs/langchain-core/dist/messages/message.d.ts.map +0 -1
  1015. package/dist/libs/langchain-core/dist/messages/metadata.d.ts +0 -97
  1016. package/dist/libs/langchain-core/dist/messages/metadata.d.ts.map +0 -1
  1017. package/dist/libs/langchain-core/dist/messages/utils.d.ts +0 -75
  1018. package/dist/libs/langchain-core/dist/messages/utils.d.ts.map +0 -1
  1019. package/dist/libs/langchain-core/dist/prompt_values.d.ts +0 -13
  1020. package/dist/libs/langchain-core/dist/prompt_values.d.ts.map +0 -1
  1021. package/dist/libs/langchain-core/dist/utils/types/index.d.ts +0 -10
  1022. package/dist/libs/langchain-core/dist/utils/types/index.d.ts.map +0 -1
  1023. package/dist/libs/langchain-core/dist/utils/types/zod.d.ts +0 -1
  1024. package/dist/load/map_keys.d.cts +0 -8
  1025. package/dist/load/map_keys.d.cts.map +0 -1
  1026. package/dist/load/map_keys.d.ts +0 -8
  1027. package/dist/load/map_keys.d.ts.map +0 -1
  1028. package/dist/load/serializable.d.cts.map +0 -1
  1029. package/dist/load/serializable.d.ts.map +0 -1
  1030. package/dist/memory/buffer_memory.cjs +0 -80
  1031. package/dist/memory/buffer_memory.cjs.map +0 -1
  1032. package/dist/memory/buffer_memory.d.cts +0 -67
  1033. package/dist/memory/buffer_memory.d.cts.map +0 -1
  1034. package/dist/memory/buffer_memory.d.ts +0 -67
  1035. package/dist/memory/buffer_memory.d.ts.map +0 -1
  1036. package/dist/memory/buffer_memory.js +0 -79
  1037. package/dist/memory/buffer_memory.js.map +0 -1
  1038. package/dist/memory/buffer_token_memory.cjs +0 -80
  1039. package/dist/memory/buffer_token_memory.cjs.map +0 -1
  1040. package/dist/memory/buffer_token_memory.d.cts +0 -67
  1041. package/dist/memory/buffer_token_memory.d.cts.map +0 -1
  1042. package/dist/memory/buffer_token_memory.d.ts +0 -67
  1043. package/dist/memory/buffer_token_memory.d.ts.map +0 -1
  1044. package/dist/memory/buffer_token_memory.js +0 -79
  1045. package/dist/memory/buffer_token_memory.js.map +0 -1
  1046. package/dist/memory/buffer_window_memory.cjs +0 -77
  1047. package/dist/memory/buffer_window_memory.cjs.map +0 -1
  1048. package/dist/memory/buffer_window_memory.d.cts +0 -64
  1049. package/dist/memory/buffer_window_memory.d.cts.map +0 -1
  1050. package/dist/memory/buffer_window_memory.d.ts +0 -64
  1051. package/dist/memory/buffer_window_memory.d.ts.map +0 -1
  1052. package/dist/memory/buffer_window_memory.js +0 -76
  1053. package/dist/memory/buffer_window_memory.js.map +0 -1
  1054. package/dist/memory/chat_memory.cjs +0 -53
  1055. package/dist/memory/chat_memory.cjs.map +0 -1
  1056. package/dist/memory/chat_memory.d.cts +0 -42
  1057. package/dist/memory/chat_memory.d.cts.map +0 -1
  1058. package/dist/memory/chat_memory.d.ts +0 -42
  1059. package/dist/memory/chat_memory.d.ts.map +0 -1
  1060. package/dist/memory/chat_memory.js +0 -47
  1061. package/dist/memory/chat_memory.js.map +0 -1
  1062. package/dist/memory/combined_memory.cjs +0 -88
  1063. package/dist/memory/combined_memory.cjs.map +0 -1
  1064. package/dist/memory/combined_memory.d.cts +0 -60
  1065. package/dist/memory/combined_memory.d.cts.map +0 -1
  1066. package/dist/memory/combined_memory.d.ts +0 -60
  1067. package/dist/memory/combined_memory.d.ts.map +0 -1
  1068. package/dist/memory/combined_memory.js +0 -88
  1069. package/dist/memory/combined_memory.js.map +0 -1
  1070. package/dist/memory/entity_memory.cjs +0 -144
  1071. package/dist/memory/entity_memory.cjs.map +0 -1
  1072. package/dist/memory/entity_memory.d.cts +0 -99
  1073. package/dist/memory/entity_memory.d.cts.map +0 -1
  1074. package/dist/memory/entity_memory.d.ts +0 -99
  1075. package/dist/memory/entity_memory.d.ts.map +0 -1
  1076. package/dist/memory/entity_memory.js +0 -143
  1077. package/dist/memory/entity_memory.js.map +0 -1
  1078. package/dist/memory/index.cjs +0 -85
  1079. package/dist/memory/index.cjs.map +0 -1
  1080. package/dist/memory/index.d.cts +0 -14
  1081. package/dist/memory/index.d.ts +0 -14
  1082. package/dist/memory/index.js +0 -39
  1083. package/dist/memory/index.js.map +0 -1
  1084. package/dist/memory/prompt.cjs +0 -124
  1085. package/dist/memory/prompt.cjs.map +0 -1
  1086. package/dist/memory/prompt.d.cts +0 -12
  1087. package/dist/memory/prompt.d.cts.map +0 -1
  1088. package/dist/memory/prompt.d.ts +0 -12
  1089. package/dist/memory/prompt.d.ts.map +0 -1
  1090. package/dist/memory/prompt.js +0 -120
  1091. package/dist/memory/prompt.js.map +0 -1
  1092. package/dist/memory/stores/entity/base.cjs +0 -13
  1093. package/dist/memory/stores/entity/base.cjs.map +0 -1
  1094. package/dist/memory/stores/entity/base.d.cts +0 -18
  1095. package/dist/memory/stores/entity/base.d.cts.map +0 -1
  1096. package/dist/memory/stores/entity/base.d.ts +0 -18
  1097. package/dist/memory/stores/entity/base.d.ts.map +0 -1
  1098. package/dist/memory/stores/entity/base.js +0 -12
  1099. package/dist/memory/stores/entity/base.js.map +0 -1
  1100. package/dist/memory/stores/entity/in_memory.cjs +0 -64
  1101. package/dist/memory/stores/entity/in_memory.cjs.map +0 -1
  1102. package/dist/memory/stores/entity/in_memory.js +0 -64
  1103. package/dist/memory/stores/entity/in_memory.js.map +0 -1
  1104. package/dist/memory/summary.cjs +0 -127
  1105. package/dist/memory/summary.cjs.map +0 -1
  1106. package/dist/memory/summary.d.cts +0 -101
  1107. package/dist/memory/summary.d.cts.map +0 -1
  1108. package/dist/memory/summary.d.ts +0 -101
  1109. package/dist/memory/summary.d.ts.map +0 -1
  1110. package/dist/memory/summary.js +0 -125
  1111. package/dist/memory/summary.js.map +0 -1
  1112. package/dist/memory/summary_buffer.cjs +0 -117
  1113. package/dist/memory/summary_buffer.cjs.map +0 -1
  1114. package/dist/memory/summary_buffer.d.cts +0 -90
  1115. package/dist/memory/summary_buffer.d.cts.map +0 -1
  1116. package/dist/memory/summary_buffer.d.ts +0 -90
  1117. package/dist/memory/summary_buffer.d.ts.map +0 -1
  1118. package/dist/memory/summary_buffer.js +0 -116
  1119. package/dist/memory/summary_buffer.js.map +0 -1
  1120. package/dist/memory/vector_store.cjs +0 -87
  1121. package/dist/memory/vector_store.cjs.map +0 -1
  1122. package/dist/memory/vector_store.d.cts +0 -81
  1123. package/dist/memory/vector_store.d.cts.map +0 -1
  1124. package/dist/memory/vector_store.d.ts +0 -81
  1125. package/dist/memory/vector_store.d.ts.map +0 -1
  1126. package/dist/memory/vector_store.js +0 -86
  1127. package/dist/memory/vector_store.js.map +0 -1
  1128. 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 +0 -3040
  1129. 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
  1130. 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 +0 -3039
  1131. 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
  1132. 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/env.cjs +0 -12
  1133. 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/env.cjs.map +0 -1
  1134. 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/env.js +0 -12
  1135. 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/env.js.map +0 -1
  1136. 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/experimental/otel/constants.cjs +0 -71
  1137. 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/experimental/otel/constants.cjs.map +0 -1
  1138. 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/experimental/otel/constants.js +0 -38
  1139. 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/experimental/otel/constants.js.map +0 -1
  1140. 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/experimental/otel/translator.cjs +0 -221
  1141. 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/experimental/otel/translator.cjs.map +0 -1
  1142. 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/experimental/otel/translator.js +0 -221
  1143. 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/experimental/otel/translator.js.map +0 -1
  1144. 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/index.cjs +0 -11
  1145. 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/index.cjs.map +0 -1
  1146. 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/index.js +0 -11
  1147. 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/index.js.map +0 -1
  1148. 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 +0 -701
  1149. 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
  1150. 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 +0 -700
  1151. 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
  1152. 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/singletons/constants.cjs +0 -7
  1153. 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/singletons/constants.cjs.map +0 -1
  1154. 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/singletons/constants.js +0 -6
  1155. 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/singletons/constants.js.map +0 -1
  1156. 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/singletons/fetch.cjs +0 -29
  1157. 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/singletons/fetch.cjs.map +0 -1
  1158. 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/singletons/fetch.js +0 -28
  1159. 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/singletons/fetch.js.map +0 -1
  1160. 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/singletons/otel.cjs +0 -115
  1161. 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/singletons/otel.cjs.map +0 -1
  1162. 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/singletons/otel.js +0 -113
  1163. 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/singletons/otel.js.map +0 -1
  1164. 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/_uuid.cjs +0 -14
  1165. 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/_uuid.cjs.map +0 -1
  1166. 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/_uuid.js +0 -13
  1167. 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/_uuid.js.map +0 -1
  1168. 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/async_caller.cjs +0 -94
  1169. 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/async_caller.cjs.map +0 -1
  1170. 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/async_caller.js +0 -94
  1171. 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/async_caller.js.map +0 -1
  1172. 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 +0 -140
  1173. 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
  1174. 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 +0 -135
  1175. 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
  1176. 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 +0 -89
  1177. 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
  1178. 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 +0 -86
  1179. 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
  1180. 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/fast-safe-stringify/index.cjs +0 -140
  1181. 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/fast-safe-stringify/index.cjs.map +0 -1
  1182. 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/fast-safe-stringify/index.js +0 -140
  1183. 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/fast-safe-stringify/index.js.map +0 -1
  1184. 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/messages.cjs +0 -18
  1185. 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/messages.cjs.map +0 -1
  1186. 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/messages.js +0 -16
  1187. 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/messages.js.map +0 -1
  1188. 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/project.cjs +0 -10
  1189. 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/project.cjs.map +0 -1
  1190. 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/project.js +0 -10
  1191. 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/project.js.map +0 -1
  1192. 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/prompts.cjs +0 -30
  1193. 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/prompts.cjs.map +0 -1
  1194. 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/prompts.js +0 -30
  1195. 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/prompts.js.map +0 -1
  1196. 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/warn.cjs +0 -13
  1197. 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/warn.cjs.map +0 -1
  1198. 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/warn.js +0 -12
  1199. 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/warn.js.map +0 -1
  1200. package/dist/output_parsers/combining.cjs +0 -61
  1201. package/dist/output_parsers/combining.cjs.map +0 -1
  1202. package/dist/output_parsers/combining.d.cts +0 -46
  1203. package/dist/output_parsers/combining.d.cts.map +0 -1
  1204. package/dist/output_parsers/combining.d.ts +0 -46
  1205. package/dist/output_parsers/combining.d.ts.map +0 -1
  1206. package/dist/output_parsers/combining.js +0 -60
  1207. package/dist/output_parsers/combining.js.map +0 -1
  1208. package/dist/output_parsers/datetime.cjs +0 -46
  1209. package/dist/output_parsers/datetime.cjs.map +0 -1
  1210. package/dist/output_parsers/datetime.d.cts +0 -33
  1211. package/dist/output_parsers/datetime.d.cts.map +0 -1
  1212. package/dist/output_parsers/datetime.d.ts +0 -33
  1213. package/dist/output_parsers/datetime.d.ts.map +0 -1
  1214. package/dist/output_parsers/datetime.js +0 -45
  1215. package/dist/output_parsers/datetime.js.map +0 -1
  1216. package/dist/output_parsers/expression.cjs +0 -86
  1217. package/dist/output_parsers/expression.cjs.map +0 -1
  1218. package/dist/output_parsers/expression.d.cts +0 -53
  1219. package/dist/output_parsers/expression.d.cts.map +0 -1
  1220. package/dist/output_parsers/expression.d.ts +0 -53
  1221. package/dist/output_parsers/expression.d.ts.map +0 -1
  1222. package/dist/output_parsers/expression.js +0 -79
  1223. package/dist/output_parsers/expression.js.map +0 -1
  1224. package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.cjs +0 -38
  1225. package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.cjs.map +0 -1
  1226. package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.js +0 -38
  1227. package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.js.map +0 -1
  1228. package/dist/output_parsers/expression_type_handlers/base.cjs +0 -130
  1229. package/dist/output_parsers/expression_type_handlers/base.cjs.map +0 -1
  1230. package/dist/output_parsers/expression_type_handlers/base.d.cts +0 -108
  1231. package/dist/output_parsers/expression_type_handlers/base.d.cts.map +0 -1
  1232. package/dist/output_parsers/expression_type_handlers/base.d.ts +0 -108
  1233. package/dist/output_parsers/expression_type_handlers/base.d.ts.map +0 -1
  1234. package/dist/output_parsers/expression_type_handlers/base.js +0 -129
  1235. package/dist/output_parsers/expression_type_handlers/base.js.map +0 -1
  1236. package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.cjs +0 -38
  1237. package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.cjs.map +0 -1
  1238. package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.js +0 -38
  1239. package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.js.map +0 -1
  1240. package/dist/output_parsers/expression_type_handlers/call_expression_handler.cjs +0 -64
  1241. package/dist/output_parsers/expression_type_handlers/call_expression_handler.cjs.map +0 -1
  1242. package/dist/output_parsers/expression_type_handlers/call_expression_handler.js +0 -64
  1243. package/dist/output_parsers/expression_type_handlers/call_expression_handler.js.map +0 -1
  1244. package/dist/output_parsers/expression_type_handlers/factory.cjs +0 -68
  1245. package/dist/output_parsers/expression_type_handlers/factory.cjs.map +0 -1
  1246. package/dist/output_parsers/expression_type_handlers/factory.d.cts +0 -35
  1247. package/dist/output_parsers/expression_type_handlers/factory.d.cts.map +0 -1
  1248. package/dist/output_parsers/expression_type_handlers/factory.d.ts +0 -35
  1249. package/dist/output_parsers/expression_type_handlers/factory.d.ts.map +0 -1
  1250. package/dist/output_parsers/expression_type_handlers/factory.js +0 -68
  1251. package/dist/output_parsers/expression_type_handlers/factory.js.map +0 -1
  1252. package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.cjs +0 -299
  1253. package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.cjs.map +0 -1
  1254. package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.js +0 -298
  1255. package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.js.map +0 -1
  1256. package/dist/output_parsers/expression_type_handlers/identifier_handler.cjs +0 -40
  1257. package/dist/output_parsers/expression_type_handlers/identifier_handler.cjs.map +0 -1
  1258. package/dist/output_parsers/expression_type_handlers/identifier_handler.js +0 -40
  1259. package/dist/output_parsers/expression_type_handlers/identifier_handler.js.map +0 -1
  1260. package/dist/output_parsers/expression_type_handlers/member_expression_handler.cjs +0 -48
  1261. package/dist/output_parsers/expression_type_handlers/member_expression_handler.cjs.map +0 -1
  1262. package/dist/output_parsers/expression_type_handlers/member_expression_handler.js +0 -48
  1263. package/dist/output_parsers/expression_type_handlers/member_expression_handler.js.map +0 -1
  1264. package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.cjs +0 -36
  1265. package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.cjs.map +0 -1
  1266. package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.js +0 -36
  1267. package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.js.map +0 -1
  1268. package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.cjs +0 -40
  1269. package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.cjs.map +0 -1
  1270. package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.js +0 -40
  1271. package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.js.map +0 -1
  1272. package/dist/output_parsers/expression_type_handlers/property_assignment_handler.cjs +0 -45
  1273. package/dist/output_parsers/expression_type_handlers/property_assignment_handler.cjs.map +0 -1
  1274. package/dist/output_parsers/expression_type_handlers/property_assignment_handler.js +0 -45
  1275. package/dist/output_parsers/expression_type_handlers/property_assignment_handler.js.map +0 -1
  1276. package/dist/output_parsers/expression_type_handlers/string_literal_handler.cjs +0 -37
  1277. package/dist/output_parsers/expression_type_handlers/string_literal_handler.cjs.map +0 -1
  1278. package/dist/output_parsers/expression_type_handlers/string_literal_handler.js +0 -37
  1279. package/dist/output_parsers/expression_type_handlers/string_literal_handler.js.map +0 -1
  1280. package/dist/output_parsers/expression_type_handlers/types.d.cts +0 -95
  1281. package/dist/output_parsers/expression_type_handlers/types.d.cts.map +0 -1
  1282. package/dist/output_parsers/expression_type_handlers/types.d.ts +0 -95
  1283. package/dist/output_parsers/expression_type_handlers/types.d.ts.map +0 -1
  1284. package/dist/output_parsers/fix.cjs +0 -92
  1285. package/dist/output_parsers/fix.cjs.map +0 -1
  1286. package/dist/output_parsers/fix.d.cts +0 -60
  1287. package/dist/output_parsers/fix.d.cts.map +0 -1
  1288. package/dist/output_parsers/fix.d.ts +0 -60
  1289. package/dist/output_parsers/fix.d.ts.map +0 -1
  1290. package/dist/output_parsers/fix.js +0 -91
  1291. package/dist/output_parsers/fix.js.map +0 -1
  1292. package/dist/output_parsers/http_response.cjs +0 -53
  1293. package/dist/output_parsers/http_response.cjs.map +0 -1
  1294. package/dist/output_parsers/http_response.d.cts +0 -33
  1295. package/dist/output_parsers/http_response.d.cts.map +0 -1
  1296. package/dist/output_parsers/http_response.d.ts +0 -33
  1297. package/dist/output_parsers/http_response.d.ts.map +0 -1
  1298. package/dist/output_parsers/http_response.js +0 -52
  1299. package/dist/output_parsers/http_response.js.map +0 -1
  1300. package/dist/output_parsers/index.cjs +0 -74
  1301. package/dist/output_parsers/index.cjs.map +0 -1
  1302. package/dist/output_parsers/index.d.cts +0 -11
  1303. package/dist/output_parsers/index.d.ts +0 -11
  1304. package/dist/output_parsers/index.js +0 -37
  1305. package/dist/output_parsers/index.js.map +0 -1
  1306. package/dist/output_parsers/noop.cjs +0 -43
  1307. package/dist/output_parsers/noop.cjs.map +0 -1
  1308. package/dist/output_parsers/noop.js +0 -42
  1309. package/dist/output_parsers/noop.js.map +0 -1
  1310. package/dist/output_parsers/openai_functions.cjs +0 -145
  1311. package/dist/output_parsers/openai_functions.cjs.map +0 -1
  1312. package/dist/output_parsers/openai_functions.d.cts +0 -85
  1313. package/dist/output_parsers/openai_functions.d.cts.map +0 -1
  1314. package/dist/output_parsers/openai_functions.d.ts +0 -85
  1315. package/dist/output_parsers/openai_functions.d.ts.map +0 -1
  1316. package/dist/output_parsers/openai_functions.js +0 -142
  1317. package/dist/output_parsers/openai_functions.js.map +0 -1
  1318. package/dist/output_parsers/openai_tools.cjs +0 -89
  1319. package/dist/output_parsers/openai_tools.cjs.map +0 -1
  1320. package/dist/output_parsers/openai_tools.d.cts +0 -69
  1321. package/dist/output_parsers/openai_tools.d.cts.map +0 -1
  1322. package/dist/output_parsers/openai_tools.d.ts +0 -69
  1323. package/dist/output_parsers/openai_tools.d.ts.map +0 -1
  1324. package/dist/output_parsers/openai_tools.js +0 -87
  1325. package/dist/output_parsers/openai_tools.js.map +0 -1
  1326. package/dist/output_parsers/prompts.cjs +0 -25
  1327. package/dist/output_parsers/prompts.cjs.map +0 -1
  1328. package/dist/output_parsers/prompts.js +0 -24
  1329. package/dist/output_parsers/prompts.js.map +0 -1
  1330. package/dist/output_parsers/regex.cjs +0 -74
  1331. package/dist/output_parsers/regex.cjs.map +0 -1
  1332. package/dist/output_parsers/regex.d.cts +0 -49
  1333. package/dist/output_parsers/regex.d.cts.map +0 -1
  1334. package/dist/output_parsers/regex.d.ts +0 -49
  1335. package/dist/output_parsers/regex.d.ts.map +0 -1
  1336. package/dist/output_parsers/regex.js +0 -73
  1337. package/dist/output_parsers/regex.js.map +0 -1
  1338. package/dist/output_parsers/router.cjs +0 -40
  1339. package/dist/output_parsers/router.cjs.map +0 -1
  1340. package/dist/output_parsers/router.d.cts +0 -36
  1341. package/dist/output_parsers/router.d.cts.map +0 -1
  1342. package/dist/output_parsers/router.d.ts +0 -36
  1343. package/dist/output_parsers/router.d.ts.map +0 -1
  1344. package/dist/output_parsers/router.js +0 -39
  1345. package/dist/output_parsers/router.js.map +0 -1
  1346. package/dist/output_parsers/structured.cjs +0 -164
  1347. package/dist/output_parsers/structured.cjs.map +0 -1
  1348. package/dist/output_parsers/structured.d.cts +0 -97
  1349. package/dist/output_parsers/structured.d.cts.map +0 -1
  1350. package/dist/output_parsers/structured.d.ts +0 -97
  1351. package/dist/output_parsers/structured.d.ts.map +0 -1
  1352. package/dist/output_parsers/structured.js +0 -161
  1353. package/dist/output_parsers/structured.js.map +0 -1
  1354. package/dist/retrievers/contextual_compression.cjs +0 -53
  1355. package/dist/retrievers/contextual_compression.cjs.map +0 -1
  1356. package/dist/retrievers/contextual_compression.d.cts +0 -42
  1357. package/dist/retrievers/contextual_compression.d.cts.map +0 -1
  1358. package/dist/retrievers/contextual_compression.d.ts +0 -42
  1359. package/dist/retrievers/contextual_compression.d.ts.map +0 -1
  1360. package/dist/retrievers/contextual_compression.js +0 -47
  1361. package/dist/retrievers/contextual_compression.js.map +0 -1
  1362. package/dist/retrievers/document_compressors/chain_extract.cjs +0 -103
  1363. package/dist/retrievers/document_compressors/chain_extract.cjs.map +0 -1
  1364. package/dist/retrievers/document_compressors/chain_extract.d.cts +0 -47
  1365. package/dist/retrievers/document_compressors/chain_extract.d.cts.map +0 -1
  1366. package/dist/retrievers/document_compressors/chain_extract.d.ts +0 -47
  1367. package/dist/retrievers/document_compressors/chain_extract.d.ts.map +0 -1
  1368. package/dist/retrievers/document_compressors/chain_extract.js +0 -97
  1369. package/dist/retrievers/document_compressors/chain_extract.js.map +0 -1
  1370. package/dist/retrievers/document_compressors/chain_extract_prompt.cjs +0 -16
  1371. package/dist/retrievers/document_compressors/chain_extract_prompt.cjs.map +0 -1
  1372. package/dist/retrievers/document_compressors/chain_extract_prompt.js +0 -15
  1373. package/dist/retrievers/document_compressors/chain_extract_prompt.js.map +0 -1
  1374. package/dist/retrievers/document_compressors/embeddings_filter.cjs +0 -74
  1375. package/dist/retrievers/document_compressors/embeddings_filter.cjs.map +0 -1
  1376. package/dist/retrievers/document_compressors/embeddings_filter.d.cts +0 -58
  1377. package/dist/retrievers/document_compressors/embeddings_filter.d.cts.map +0 -1
  1378. package/dist/retrievers/document_compressors/embeddings_filter.d.ts +0 -58
  1379. package/dist/retrievers/document_compressors/embeddings_filter.d.ts.map +0 -1
  1380. package/dist/retrievers/document_compressors/embeddings_filter.js +0 -68
  1381. package/dist/retrievers/document_compressors/embeddings_filter.js.map +0 -1
  1382. package/dist/retrievers/document_compressors/index.cjs +0 -69
  1383. package/dist/retrievers/document_compressors/index.cjs.map +0 -1
  1384. package/dist/retrievers/document_compressors/index.d.cts +0 -61
  1385. package/dist/retrievers/document_compressors/index.d.cts.map +0 -1
  1386. package/dist/retrievers/document_compressors/index.d.ts +0 -61
  1387. package/dist/retrievers/document_compressors/index.d.ts.map +0 -1
  1388. package/dist/retrievers/document_compressors/index.js +0 -62
  1389. package/dist/retrievers/document_compressors/index.js.map +0 -1
  1390. package/dist/retrievers/ensemble.cjs +0 -76
  1391. package/dist/retrievers/ensemble.cjs.map +0 -1
  1392. package/dist/retrievers/ensemble.d.cts +0 -39
  1393. package/dist/retrievers/ensemble.d.cts.map +0 -1
  1394. package/dist/retrievers/ensemble.d.ts +0 -39
  1395. package/dist/retrievers/ensemble.d.ts.map +0 -1
  1396. package/dist/retrievers/ensemble.js +0 -70
  1397. package/dist/retrievers/ensemble.js.map +0 -1
  1398. package/dist/retrievers/hyde.cjs +0 -128
  1399. package/dist/retrievers/hyde.cjs.map +0 -1
  1400. package/dist/retrievers/hyde.d.cts +0 -61
  1401. package/dist/retrievers/hyde.d.cts.map +0 -1
  1402. package/dist/retrievers/hyde.d.ts +0 -61
  1403. package/dist/retrievers/hyde.d.ts.map +0 -1
  1404. package/dist/retrievers/hyde.js +0 -121
  1405. package/dist/retrievers/hyde.js.map +0 -1
  1406. package/dist/retrievers/matryoshka_retriever.cjs +0 -116
  1407. package/dist/retrievers/matryoshka_retriever.cjs.map +0 -1
  1408. package/dist/retrievers/matryoshka_retriever.d.cts +0 -99
  1409. package/dist/retrievers/matryoshka_retriever.d.cts.map +0 -1
  1410. package/dist/retrievers/matryoshka_retriever.d.ts +0 -99
  1411. package/dist/retrievers/matryoshka_retriever.d.ts.map +0 -1
  1412. package/dist/retrievers/matryoshka_retriever.js +0 -110
  1413. package/dist/retrievers/matryoshka_retriever.js.map +0 -1
  1414. package/dist/retrievers/multi_query.cjs +0 -150
  1415. package/dist/retrievers/multi_query.cjs.map +0 -1
  1416. package/dist/retrievers/multi_query.d.cts +0 -59
  1417. package/dist/retrievers/multi_query.d.cts.map +0 -1
  1418. package/dist/retrievers/multi_query.d.ts +0 -59
  1419. package/dist/retrievers/multi_query.d.ts.map +0 -1
  1420. package/dist/retrievers/multi_query.js +0 -144
  1421. package/dist/retrievers/multi_query.js.map +0 -1
  1422. package/dist/retrievers/multi_vector.cjs +0 -67
  1423. package/dist/retrievers/multi_vector.cjs.map +0 -1
  1424. package/dist/retrievers/multi_vector.d.cts +0 -51
  1425. package/dist/retrievers/multi_vector.d.cts.map +0 -1
  1426. package/dist/retrievers/multi_vector.d.ts +0 -51
  1427. package/dist/retrievers/multi_vector.d.ts.map +0 -1
  1428. package/dist/retrievers/multi_vector.js +0 -61
  1429. package/dist/retrievers/multi_vector.js.map +0 -1
  1430. package/dist/retrievers/parent_document.cjs +0 -137
  1431. package/dist/retrievers/parent_document.cjs.map +0 -1
  1432. package/dist/retrievers/parent_document.d.cts +0 -92
  1433. package/dist/retrievers/parent_document.d.cts.map +0 -1
  1434. package/dist/retrievers/parent_document.d.ts +0 -92
  1435. package/dist/retrievers/parent_document.d.ts.map +0 -1
  1436. package/dist/retrievers/parent_document.js +0 -131
  1437. package/dist/retrievers/parent_document.js.map +0 -1
  1438. package/dist/retrievers/score_threshold.cjs +0 -43
  1439. package/dist/retrievers/score_threshold.cjs.map +0 -1
  1440. package/dist/retrievers/score_threshold.d.cts +0 -20
  1441. package/dist/retrievers/score_threshold.d.cts.map +0 -1
  1442. package/dist/retrievers/score_threshold.d.ts +0 -20
  1443. package/dist/retrievers/score_threshold.d.ts.map +0 -1
  1444. package/dist/retrievers/score_threshold.js +0 -37
  1445. package/dist/retrievers/score_threshold.js.map +0 -1
  1446. package/dist/retrievers/self_query/functional.cjs +0 -21
  1447. package/dist/retrievers/self_query/functional.cjs.map +0 -1
  1448. package/dist/retrievers/self_query/functional.d.cts +0 -2
  1449. package/dist/retrievers/self_query/functional.d.ts +0 -2
  1450. package/dist/retrievers/self_query/functional.js +0 -10
  1451. package/dist/retrievers/self_query/functional.js.map +0 -1
  1452. package/dist/retrievers/self_query/index.cjs +0 -130
  1453. package/dist/retrievers/self_query/index.cjs.map +0 -1
  1454. package/dist/retrievers/self_query/index.d.cts +0 -79
  1455. package/dist/retrievers/self_query/index.d.cts.map +0 -1
  1456. package/dist/retrievers/self_query/index.d.ts +0 -79
  1457. package/dist/retrievers/self_query/index.d.ts.map +0 -1
  1458. package/dist/retrievers/self_query/index.js +0 -106
  1459. package/dist/retrievers/self_query/index.js.map +0 -1
  1460. package/dist/retrievers/time_weighted.cjs +0 -236
  1461. package/dist/retrievers/time_weighted.cjs.map +0 -1
  1462. package/dist/retrievers/time_weighted.d.cts +0 -142
  1463. package/dist/retrievers/time_weighted.d.cts.map +0 -1
  1464. package/dist/retrievers/time_weighted.d.ts +0 -142
  1465. package/dist/retrievers/time_weighted.d.ts.map +0 -1
  1466. package/dist/retrievers/time_weighted.js +0 -228
  1467. package/dist/retrievers/time_weighted.js.map +0 -1
  1468. package/dist/sql_db.cjs +0 -119
  1469. package/dist/sql_db.cjs.map +0 -1
  1470. package/dist/sql_db.d.cts +0 -60
  1471. package/dist/sql_db.d.cts.map +0 -1
  1472. package/dist/sql_db.d.ts +0 -60
  1473. package/dist/sql_db.d.ts.map +0 -1
  1474. package/dist/sql_db.js +0 -113
  1475. package/dist/sql_db.js.map +0 -1
  1476. package/dist/stores/doc/base.cjs +0 -20
  1477. package/dist/stores/doc/base.cjs.map +0 -1
  1478. package/dist/stores/doc/base.d.cts +0 -15
  1479. package/dist/stores/doc/base.d.cts.map +0 -1
  1480. package/dist/stores/doc/base.d.ts +0 -15
  1481. package/dist/stores/doc/base.d.ts.map +0 -1
  1482. package/dist/stores/doc/base.js +0 -14
  1483. package/dist/stores/doc/base.js.map +0 -1
  1484. package/dist/stores/doc/in_memory.cjs +0 -94
  1485. package/dist/stores/doc/in_memory.cjs.map +0 -1
  1486. package/dist/stores/doc/in_memory.d.cts +0 -53
  1487. package/dist/stores/doc/in_memory.d.cts.map +0 -1
  1488. package/dist/stores/doc/in_memory.d.ts +0 -53
  1489. package/dist/stores/doc/in_memory.d.ts.map +0 -1
  1490. package/dist/stores/doc/in_memory.js +0 -87
  1491. package/dist/stores/doc/in_memory.js.map +0 -1
  1492. package/dist/stores/file/base.cjs +0 -13
  1493. package/dist/stores/file/base.cjs.map +0 -1
  1494. package/dist/stores/file/base.d.cts +0 -15
  1495. package/dist/stores/file/base.d.cts.map +0 -1
  1496. package/dist/stores/file/base.d.ts +0 -15
  1497. package/dist/stores/file/base.d.ts.map +0 -1
  1498. package/dist/stores/file/base.js +0 -12
  1499. package/dist/stores/file/base.js.map +0 -1
  1500. package/dist/stores/file/in_memory.cjs +0 -53
  1501. package/dist/stores/file/in_memory.cjs.map +0 -1
  1502. package/dist/stores/file/in_memory.d.cts +0 -33
  1503. package/dist/stores/file/in_memory.d.cts.map +0 -1
  1504. package/dist/stores/file/in_memory.d.ts +0 -33
  1505. package/dist/stores/file/in_memory.d.ts.map +0 -1
  1506. package/dist/stores/file/in_memory.js +0 -47
  1507. package/dist/stores/file/in_memory.js.map +0 -1
  1508. package/dist/stores/file/node.cjs +0 -52
  1509. package/dist/stores/file/node.cjs.map +0 -1
  1510. package/dist/stores/file/node.d.cts +0 -29
  1511. package/dist/stores/file/node.d.cts.map +0 -1
  1512. package/dist/stores/file/node.d.ts +0 -29
  1513. package/dist/stores/file/node.d.ts.map +0 -1
  1514. package/dist/stores/file/node.js +0 -46
  1515. package/dist/stores/file/node.js.map +0 -1
  1516. package/dist/stores/message/in_memory.cjs +0 -21
  1517. package/dist/stores/message/in_memory.cjs.map +0 -1
  1518. package/dist/stores/message/in_memory.d.cts +0 -2
  1519. package/dist/stores/message/in_memory.d.ts +0 -2
  1520. package/dist/stores/message/in_memory.js +0 -10
  1521. package/dist/stores/message/in_memory.js.map +0 -1
  1522. package/dist/text_splitter.cjs +0 -22
  1523. package/dist/text_splitter.cjs.map +0 -1
  1524. package/dist/text_splitter.d.cts +0 -1
  1525. package/dist/text_splitter.d.ts +0 -1
  1526. package/dist/text_splitter.js +0 -12
  1527. package/dist/text_splitter.js.map +0 -1
  1528. package/dist/tools/chain.cjs +0 -36
  1529. package/dist/tools/chain.cjs.map +0 -1
  1530. package/dist/tools/chain.d.cts +0 -32
  1531. package/dist/tools/chain.d.cts.map +0 -1
  1532. package/dist/tools/chain.d.ts +0 -32
  1533. package/dist/tools/chain.d.ts.map +0 -1
  1534. package/dist/tools/chain.js +0 -30
  1535. package/dist/tools/chain.js.map +0 -1
  1536. package/dist/tools/fs.cjs +0 -56
  1537. package/dist/tools/fs.cjs.map +0 -1
  1538. package/dist/tools/fs.d.cts +0 -92
  1539. package/dist/tools/fs.d.cts.map +0 -1
  1540. package/dist/tools/fs.d.ts +0 -92
  1541. package/dist/tools/fs.d.ts.map +0 -1
  1542. package/dist/tools/fs.js +0 -54
  1543. package/dist/tools/fs.js.map +0 -1
  1544. package/dist/tools/index.cjs +0 -68
  1545. package/dist/tools/index.cjs.map +0 -1
  1546. package/dist/tools/index.d.cts +0 -8
  1547. package/dist/tools/index.d.ts +0 -8
  1548. package/dist/tools/index.js +0 -30
  1549. package/dist/tools/index.js.map +0 -1
  1550. package/dist/tools/json.cjs +0 -107
  1551. package/dist/tools/json.cjs.map +0 -1
  1552. package/dist/tools/json.d.cts +0 -65
  1553. package/dist/tools/json.d.cts.map +0 -1
  1554. package/dist/tools/json.d.ts +0 -65
  1555. package/dist/tools/json.d.ts.map +0 -1
  1556. package/dist/tools/json.js +0 -104
  1557. package/dist/tools/json.js.map +0 -1
  1558. package/dist/tools/render.cjs +0 -55
  1559. package/dist/tools/render.cjs.map +0 -1
  1560. package/dist/tools/render.d.cts +0 -32
  1561. package/dist/tools/render.d.cts.map +0 -1
  1562. package/dist/tools/render.d.ts +0 -32
  1563. package/dist/tools/render.d.ts.map +0 -1
  1564. package/dist/tools/render.js +0 -48
  1565. package/dist/tools/render.js.map +0 -1
  1566. package/dist/tools/requests.cjs +0 -73
  1567. package/dist/tools/requests.cjs.map +0 -1
  1568. package/dist/tools/requests.d.cts +0 -56
  1569. package/dist/tools/requests.d.cts.map +0 -1
  1570. package/dist/tools/requests.d.ts +0 -56
  1571. package/dist/tools/requests.d.ts.map +0 -1
  1572. package/dist/tools/requests.js +0 -71
  1573. package/dist/tools/requests.js.map +0 -1
  1574. package/dist/tools/retriever.cjs +0 -30
  1575. package/dist/tools/retriever.cjs.map +0 -1
  1576. package/dist/tools/retriever.d.cts +0 -19
  1577. package/dist/tools/retriever.d.cts.map +0 -1
  1578. package/dist/tools/retriever.d.ts +0 -19
  1579. package/dist/tools/retriever.d.ts.map +0 -1
  1580. package/dist/tools/retriever.js +0 -24
  1581. package/dist/tools/retriever.js.map +0 -1
  1582. package/dist/tools/sql.cjs +0 -165
  1583. package/dist/tools/sql.cjs.map +0 -1
  1584. package/dist/tools/sql.d.cts +0 -86
  1585. package/dist/tools/sql.d.cts.map +0 -1
  1586. package/dist/tools/sql.d.ts +0 -86
  1587. package/dist/tools/sql.d.ts.map +0 -1
  1588. package/dist/tools/sql.js +0 -156
  1589. package/dist/tools/sql.js.map +0 -1
  1590. package/dist/tools/vectorstore.cjs +0 -45
  1591. package/dist/tools/vectorstore.cjs.map +0 -1
  1592. package/dist/tools/vectorstore.d.cts +0 -40
  1593. package/dist/tools/vectorstore.d.cts.map +0 -1
  1594. package/dist/tools/vectorstore.d.ts +0 -40
  1595. package/dist/tools/vectorstore.d.ts.map +0 -1
  1596. package/dist/tools/vectorstore.js +0 -44
  1597. package/dist/tools/vectorstore.js.map +0 -1
  1598. package/dist/tools/webbrowser.cjs +0 -176
  1599. package/dist/tools/webbrowser.cjs.map +0 -1
  1600. package/dist/tools/webbrowser.d.cts +0 -69
  1601. package/dist/tools/webbrowser.d.cts.map +0 -1
  1602. package/dist/tools/webbrowser.d.ts +0 -69
  1603. package/dist/tools/webbrowser.d.ts.map +0 -1
  1604. package/dist/tools/webbrowser.js +0 -168
  1605. package/dist/tools/webbrowser.js.map +0 -1
  1606. package/dist/types/expression-parser.d.cts +0 -91
  1607. package/dist/types/expression-parser.d.cts.map +0 -1
  1608. package/dist/types/expression-parser.d.ts +0 -91
  1609. package/dist/types/expression-parser.d.ts.map +0 -1
  1610. package/dist/types/type-utils.d.cts +0 -7
  1611. package/dist/types/type-utils.d.cts.map +0 -1
  1612. package/dist/types/type-utils.d.ts +0 -7
  1613. package/dist/types/type-utils.d.ts.map +0 -1
  1614. package/dist/util/document.cjs +0 -23
  1615. package/dist/util/document.cjs.map +0 -1
  1616. package/dist/util/document.d.cts +0 -15
  1617. package/dist/util/document.d.cts.map +0 -1
  1618. package/dist/util/document.d.ts +0 -15
  1619. package/dist/util/document.d.ts.map +0 -1
  1620. package/dist/util/document.js +0 -17
  1621. package/dist/util/document.js.map +0 -1
  1622. package/dist/util/entrypoint_deprecation.cjs +0 -1
  1623. package/dist/util/entrypoint_deprecation.js +0 -1
  1624. package/dist/util/env.cjs +0 -2
  1625. package/dist/util/env.js +0 -1
  1626. package/dist/util/extname.cjs +0 -7
  1627. package/dist/util/extname.cjs.map +0 -1
  1628. package/dist/util/extname.js +0 -6
  1629. package/dist/util/extname.js.map +0 -1
  1630. package/dist/util/hub.cjs +0 -39
  1631. package/dist/util/hub.cjs.map +0 -1
  1632. package/dist/util/hub.js +0 -38
  1633. package/dist/util/hub.js.map +0 -1
  1634. package/dist/util/load.cjs +0 -15
  1635. package/dist/util/load.cjs.map +0 -1
  1636. package/dist/util/load.d.cts +0 -6
  1637. package/dist/util/load.d.cts.map +0 -1
  1638. package/dist/util/load.d.ts +0 -6
  1639. package/dist/util/load.d.ts.map +0 -1
  1640. package/dist/util/load.js +0 -14
  1641. package/dist/util/load.js.map +0 -1
  1642. package/dist/util/math.cjs +0 -22
  1643. package/dist/util/math.cjs.map +0 -1
  1644. package/dist/util/math.d.cts +0 -1
  1645. package/dist/util/math.d.ts +0 -1
  1646. package/dist/util/math.js +0 -12
  1647. package/dist/util/math.js.map +0 -1
  1648. package/dist/util/ml-distance/distances.cjs +0 -35
  1649. package/dist/util/ml-distance/distances.cjs.map +0 -1
  1650. package/dist/util/ml-distance/distances.js +0 -33
  1651. package/dist/util/ml-distance/distances.js.map +0 -1
  1652. package/dist/util/ml-distance/similarities.cjs +0 -23
  1653. package/dist/util/ml-distance/similarities.cjs.map +0 -1
  1654. package/dist/util/ml-distance/similarities.d.cts +0 -11
  1655. package/dist/util/ml-distance/similarities.d.cts.map +0 -1
  1656. package/dist/util/ml-distance/similarities.d.ts +0 -11
  1657. package/dist/util/ml-distance/similarities.d.ts.map +0 -1
  1658. package/dist/util/ml-distance/similarities.js +0 -22
  1659. package/dist/util/ml-distance/similarities.js.map +0 -1
  1660. package/dist/util/ml-distance-euclidean/euclidean.cjs +0 -14
  1661. package/dist/util/ml-distance-euclidean/euclidean.cjs.map +0 -1
  1662. package/dist/util/ml-distance-euclidean/euclidean.js +0 -13
  1663. package/dist/util/ml-distance-euclidean/euclidean.js.map +0 -1
  1664. package/dist/util/openapi.cjs +0 -149
  1665. package/dist/util/openapi.cjs.map +0 -1
  1666. package/dist/util/openapi.d.cts +0 -83
  1667. package/dist/util/openapi.d.cts.map +0 -1
  1668. package/dist/util/openapi.d.ts +0 -83
  1669. package/dist/util/openapi.d.ts.map +0 -1
  1670. package/dist/util/openapi.js +0 -148
  1671. package/dist/util/openapi.js.map +0 -1
  1672. package/dist/util/parse.cjs +0 -22
  1673. package/dist/util/parse.cjs.map +0 -1
  1674. package/dist/util/parse.js +0 -21
  1675. package/dist/util/parse.js.map +0 -1
  1676. package/dist/util/set.cjs +0 -35
  1677. package/dist/util/set.cjs.map +0 -1
  1678. package/dist/util/set.js +0 -32
  1679. package/dist/util/set.js.map +0 -1
  1680. package/dist/util/sql_utils.cjs +0 -178
  1681. package/dist/util/sql_utils.cjs.map +0 -1
  1682. package/dist/util/sql_utils.d.cts +0 -31
  1683. package/dist/util/sql_utils.d.cts.map +0 -1
  1684. package/dist/util/sql_utils.d.ts +0 -31
  1685. package/dist/util/sql_utils.d.ts.map +0 -1
  1686. package/dist/util/sql_utils.js +0 -173
  1687. package/dist/util/sql_utils.js.map +0 -1
  1688. package/dist/util/time.cjs +0 -25
  1689. package/dist/util/time.cjs.map +0 -1
  1690. package/dist/util/time.d.cts +0 -10
  1691. package/dist/util/time.d.cts.map +0 -1
  1692. package/dist/util/time.d.ts +0 -10
  1693. package/dist/util/time.d.ts.map +0 -1
  1694. package/dist/util/time.js +0 -19
  1695. package/dist/util/time.js.map +0 -1
  1696. package/dist/vectorstores/memory.cjs +0 -265
  1697. package/dist/vectorstores/memory.cjs.map +0 -1
  1698. package/dist/vectorstores/memory.d.cts +0 -216
  1699. package/dist/vectorstores/memory.d.cts.map +0 -1
  1700. package/dist/vectorstores/memory.d.ts +0 -216
  1701. package/dist/vectorstores/memory.d.ts.map +0 -1
  1702. package/dist/vectorstores/memory.js +0 -259
  1703. package/dist/vectorstores/memory.js.map +0 -1
  1704. /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
  1705. /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
@@ -0,0 +1,205 @@
1
+ import { JumpToTarget } from "./constants.cjs";
2
+ import { ClientTool, ServerTool } from "./tools.cjs";
3
+ import { AgentBuiltInState, Runtime } from "./runtime.cjs";
4
+ import { ModelRequest } from "./nodes/types.cjs";
5
+ import { AgentMiddleware, MiddlewareResult, ToolCallHandler, ToolCallRequest } from "./middleware/types.cjs";
6
+ import { AIMessage, ToolMessage } from "@langchain/core/messages";
7
+ import { InferInteropZodInput, InferInteropZodOutput, InteropZodDefault, InteropZodObject, InteropZodOptional } from "@langchain/core/utils/types";
8
+ import { Command } from "@langchain/langgraph";
9
+
10
+ //#region src/agents/middleware.d.ts
11
+
12
+ /**
13
+ * Creates a middleware instance with automatic schema inference.
14
+ *
15
+ * @param config - Middleware configuration
16
+ * @param config.name - The name of the middleware
17
+ * @param config.stateSchema - The schema of the middleware state
18
+ * @param config.contextSchema - The schema of the middleware context
19
+ * @param config.wrapModelCall - The function to wrap model invocation
20
+ * @param config.wrapToolCall - The function to wrap tool invocation
21
+ * @param config.beforeModel - The function to run before the model call
22
+ * @param config.afterModel - The function to run after the model call
23
+ * @param config.beforeAgent - The function to run before the agent execution starts
24
+ * @param config.afterAgent - The function to run after the agent execution completes
25
+ * @returns A middleware instance
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const authMiddleware = createMiddleware({
30
+ * name: "AuthMiddleware",
31
+ * stateSchema: z.object({
32
+ * isAuthenticated: z.boolean().default(false),
33
+ * }),
34
+ * contextSchema: z.object({
35
+ * userId: z.string(),
36
+ * }),
37
+ * beforeModel: async (state, runtime, controls) => {
38
+ * if (!state.isAuthenticated) {
39
+ * return controls.terminate(new Error("Not authenticated"));
40
+ * }
41
+ * },
42
+ * });
43
+ * ```
44
+ */
45
+ declare function createMiddleware<TSchema extends InteropZodObject | undefined = undefined, TContextSchema extends InteropZodObject | InteropZodOptional<InteropZodObject> | InteropZodDefault<InteropZodObject> | undefined = undefined>(config: {
46
+ /**
47
+ * The name of the middleware
48
+ */
49
+ name: string;
50
+ /**
51
+ * The schema of the middleware state. Middleware state is persisted between multiple invocations. It can be either:
52
+ * - A Zod object
53
+ * - A Zod optional object
54
+ * - A Zod default object
55
+ * - Undefined
56
+ */
57
+ stateSchema?: TSchema;
58
+ /**
59
+ * The schema of the middleware context. Middleware context is read-only and not persisted between multiple invocations. It can be either:
60
+ * - A Zod object
61
+ * - A Zod optional object
62
+ * - A Zod default object
63
+ * - Undefined
64
+ */
65
+ contextSchema?: TContextSchema;
66
+ /**
67
+ * Explitictly defines which targets are allowed to be jumped to from the `beforeAgent` hook.
68
+ */
69
+ beforeAgentJumpTo?: JumpToTarget[];
70
+ /**
71
+ * Explitictly defines which targets are allowed to be jumped to from the `beforeModel` hook.
72
+ */
73
+ beforeModelJumpTo?: JumpToTarget[];
74
+ /**
75
+ * Explitictly defines which targets are allowed to be jumped to from the `afterModel` hook.
76
+ */
77
+ afterModelJumpTo?: JumpToTarget[];
78
+ /**
79
+ * Explitictly defines which targets are allowed to be jumped to from the `afterAgent` hook.
80
+ */
81
+ afterAgentJumpTo?: JumpToTarget[];
82
+ /**
83
+ * Additional tools registered by the middleware.
84
+ */
85
+ tools?: (ClientTool | ServerTool)[];
86
+ /**
87
+ * Wraps tool execution with custom logic. This allows you to:
88
+ * - Modify tool call parameters before execution
89
+ * - Handle errors and retry with different parameters
90
+ * - Post-process tool results
91
+ * - Implement caching, logging, authentication, or other cross-cutting concerns
92
+ * - Return Command objects for advanced control flow
93
+ *
94
+ * The handler receives a ToolCallRequest containing the tool call, state, and runtime,
95
+ * along with a handler function to execute the actual tool.
96
+ *
97
+ * @param request - The tool call request containing toolCall, state, and runtime.
98
+ * @param handler - The function that executes the tool. Call this with a ToolCall to get the result.
99
+ * @returns The tool result as a ToolMessage or a Command for advanced control flow.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * wrapToolCall: async (request, handler) => {
104
+ * console.log(`Calling tool: ${request.tool.name}`);
105
+ * console.log(`Tool description: ${request.tool.description}`);
106
+ *
107
+ * try {
108
+ * // Execute the tool
109
+ * const result = await handler(request.toolCall);
110
+ * console.log(`Tool ${request.tool.name} succeeded`);
111
+ * return result;
112
+ * } catch (error) {
113
+ * console.error(`Tool ${request.tool.name} failed:`, error);
114
+ * // Could return a custom error message or retry
115
+ * throw error;
116
+ * }
117
+ * }
118
+ * ```
119
+ *
120
+ * @example Authentication
121
+ * ```ts
122
+ * wrapToolCall: async (request, handler) => {
123
+ * // Check if user is authorized for this tool
124
+ * if (!request.runtime.context.isAuthorized(request.tool.name)) {
125
+ * return new ToolMessage({
126
+ * content: "Unauthorized to call this tool",
127
+ * tool_call_id: request.toolCall.id,
128
+ * });
129
+ * }
130
+ * return handler(request.toolCall);
131
+ * }
132
+ * ```
133
+ */
134
+ wrapToolCall?: (request: ToolCallRequest<(TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>, handler: ToolCallHandler) => Promise<ToolMessage | Command> | ToolMessage | Command;
135
+ /**
136
+ * Wraps the model invocation with custom logic. This allows you to:
137
+ * - Modify the request before calling the model
138
+ * - Handle errors and retry with different parameters
139
+ * - Post-process the response
140
+ * - Implement custom caching, logging, or other cross-cutting concerns
141
+ *
142
+ * The request parameter contains: model, messages, systemPrompt, tools, state, and runtime.
143
+ *
144
+ * @param request - The model request containing all the parameters needed.
145
+ * @param handler - The function that invokes the model. Call this with a ModelRequest to get the response.
146
+ * @returns The response from the model (or a modified version).
147
+ *
148
+ * @example
149
+ * ```ts
150
+ * wrapModelCall: async (request, handler) => {
151
+ * // Modify request before calling
152
+ * const modifiedRequest = { ...request, systemPrompt: "You are helpful" };
153
+ *
154
+ * try {
155
+ * // Call the model
156
+ * return await handler(modifiedRequest);
157
+ * } catch (error) {
158
+ * // Handle errors and retry with fallback
159
+ * const fallbackRequest = { ...request, model: fallbackModel };
160
+ * return await handler(fallbackRequest);
161
+ * }
162
+ * }
163
+ * ```
164
+ */
165
+ wrapModelCall?: (request: ModelRequest<(TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>, handler: (request: ModelRequest<(TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<AIMessage> | AIMessage) => Promise<AIMessage> | AIMessage;
166
+ /**
167
+ * The function to run before the agent execution starts. This function is called once at the start of the agent invocation.
168
+ * It allows to modify the state of the agent before any model calls or tool executions.
169
+ *
170
+ * @param state - The middleware state
171
+ * @param runtime - The middleware runtime
172
+ * @returns The modified middleware state or undefined to pass through
173
+ */
174
+ beforeAgent?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;
175
+ /**
176
+ * The function to run before the model call. This function is called before the model is invoked and before the `wrapModelCall` hook.
177
+ * It allows to modify the state of the agent.
178
+ *
179
+ * @param state - The middleware state
180
+ * @param runtime - The middleware runtime
181
+ * @returns The modified middleware state or undefined to pass through
182
+ */
183
+ beforeModel?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;
184
+ /**
185
+ * The function to run after the model call. This function is called after the model is invoked and before any tools are called.
186
+ * It allows to modify the state of the agent after the model is invoked, e.g. to update tool call parameters.
187
+ *
188
+ * @param state - The middleware state
189
+ * @param runtime - The middleware runtime
190
+ * @returns The modified middleware state or undefined to pass through
191
+ */
192
+ afterModel?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;
193
+ /**
194
+ * The function to run after the agent execution completes. This function is called once at the end of the agent invocation.
195
+ * It allows to modify the final state of the agent after all model calls and tool executions are complete.
196
+ *
197
+ * @param state - The middleware state
198
+ * @param runtime - The middleware runtime
199
+ * @returns The modified middleware state or undefined to pass through
200
+ */
201
+ afterAgent?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;
202
+ }): AgentMiddleware<TSchema, TContextSchema, any>;
203
+ //#endregion
204
+ export { createMiddleware };
205
+ //# sourceMappingURL=middleware.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware.d.cts","names":["InteropZodObject","InteropZodDefault","InteropZodOptional","InferInteropZodInput","InferInteropZodOutput","AIMessage","ToolMessage","Command","JumpToTarget","ClientTool","ServerTool","Runtime","AgentBuiltInState","AgentMiddleware","MiddlewareResult","ToolCallRequest","ToolCallHandler","ModelRequest","createMiddleware","TSchema","TContextSchema","Partial","Promise"],"sources":["../../src/agents/middleware.d.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { InteropZodObject, InteropZodDefault, InteropZodOptional, InferInteropZodInput, InferInteropZodOutput } from \"@langchain/core/utils/types\";\nimport type { AIMessage, ToolMessage } from \"@langchain/core/messages\";\nimport type { Command } from \"@langchain/langgraph\";\nimport type { JumpToTarget } from \"./constants.js\";\nimport type { ClientTool, ServerTool } from \"./tools.js\";\nimport type { Runtime, AgentBuiltInState } from \"./runtime.js\";\nimport type { AgentMiddleware, MiddlewareResult, ToolCallRequest, ToolCallHandler } from \"./middleware/types.js\";\nimport type { ModelRequest } from \"./nodes/types.js\";\n/**\n * Creates a middleware instance with automatic schema inference.\n *\n * @param config - Middleware configuration\n * @param config.name - The name of the middleware\n * @param config.stateSchema - The schema of the middleware state\n * @param config.contextSchema - The schema of the middleware context\n * @param config.wrapModelCall - The function to wrap model invocation\n * @param config.wrapToolCall - The function to wrap tool invocation\n * @param config.beforeModel - The function to run before the model call\n * @param config.afterModel - The function to run after the model call\n * @param config.beforeAgent - The function to run before the agent execution starts\n * @param config.afterAgent - The function to run after the agent execution completes\n * @returns A middleware instance\n *\n * @example\n * ```ts\n * const authMiddleware = createMiddleware({\n * name: \"AuthMiddleware\",\n * stateSchema: z.object({\n * isAuthenticated: z.boolean().default(false),\n * }),\n * contextSchema: z.object({\n * userId: z.string(),\n * }),\n * beforeModel: async (state, runtime, controls) => {\n * if (!state.isAuthenticated) {\n * return controls.terminate(new Error(\"Not authenticated\"));\n * }\n * },\n * });\n * ```\n */\nexport declare function createMiddleware<TSchema extends InteropZodObject | undefined = undefined, TContextSchema extends InteropZodObject | InteropZodOptional<InteropZodObject> | InteropZodDefault<InteropZodObject> | undefined = undefined>(config: {\n /**\n * The name of the middleware\n */\n name: string;\n /**\n * The schema of the middleware state. Middleware state is persisted between multiple invocations. It can be either:\n * - A Zod object\n * - A Zod optional object\n * - A Zod default object\n * - Undefined\n */\n stateSchema?: TSchema;\n /**\n * The schema of the middleware context. Middleware context is read-only and not persisted between multiple invocations. It can be either:\n * - A Zod object\n * - A Zod optional object\n * - A Zod default object\n * - Undefined\n */\n contextSchema?: TContextSchema;\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `beforeAgent` hook.\n */\n beforeAgentJumpTo?: JumpToTarget[];\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `beforeModel` hook.\n */\n beforeModelJumpTo?: JumpToTarget[];\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `afterModel` hook.\n */\n afterModelJumpTo?: JumpToTarget[];\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `afterAgent` hook.\n */\n afterAgentJumpTo?: JumpToTarget[];\n /**\n * Additional tools registered by the middleware.\n */\n tools?: (ClientTool | ServerTool)[];\n /**\n * Wraps tool execution with custom logic. This allows you to:\n * - Modify tool call parameters before execution\n * - Handle errors and retry with different parameters\n * - Post-process tool results\n * - Implement caching, logging, authentication, or other cross-cutting concerns\n * - Return Command objects for advanced control flow\n *\n * The handler receives a ToolCallRequest containing the tool call, state, and runtime,\n * along with a handler function to execute the actual tool.\n *\n * @param request - The tool call request containing toolCall, state, and runtime.\n * @param handler - The function that executes the tool. Call this with a ToolCall to get the result.\n * @returns The tool result as a ToolMessage or a Command for advanced control flow.\n *\n * @example\n * ```ts\n * wrapToolCall: async (request, handler) => {\n * console.log(`Calling tool: ${request.tool.name}`);\n * console.log(`Tool description: ${request.tool.description}`);\n *\n * try {\n * // Execute the tool\n * const result = await handler(request.toolCall);\n * console.log(`Tool ${request.tool.name} succeeded`);\n * return result;\n * } catch (error) {\n * console.error(`Tool ${request.tool.name} failed:`, error);\n * // Could return a custom error message or retry\n * throw error;\n * }\n * }\n * ```\n *\n * @example Authentication\n * ```ts\n * wrapToolCall: async (request, handler) => {\n * // Check if user is authorized for this tool\n * if (!request.runtime.context.isAuthorized(request.tool.name)) {\n * return new ToolMessage({\n * content: \"Unauthorized to call this tool\",\n * tool_call_id: request.toolCall.id,\n * });\n * }\n * return handler(request.toolCall);\n * }\n * ```\n */\n wrapToolCall?: (request: ToolCallRequest<(TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>, handler: ToolCallHandler) => Promise<ToolMessage | Command> | ToolMessage | Command;\n /**\n * Wraps the model invocation with custom logic. This allows you to:\n * - Modify the request before calling the model\n * - Handle errors and retry with different parameters\n * - Post-process the response\n * - Implement custom caching, logging, or other cross-cutting concerns\n *\n * The request parameter contains: model, messages, systemPrompt, tools, state, and runtime.\n *\n * @param request - The model request containing all the parameters needed.\n * @param handler - The function that invokes the model. Call this with a ModelRequest to get the response.\n * @returns The response from the model (or a modified version).\n *\n * @example\n * ```ts\n * wrapModelCall: async (request, handler) => {\n * // Modify request before calling\n * const modifiedRequest = { ...request, systemPrompt: \"You are helpful\" };\n *\n * try {\n * // Call the model\n * return await handler(modifiedRequest);\n * } catch (error) {\n * // Handle errors and retry with fallback\n * const fallbackRequest = { ...request, model: fallbackModel };\n * return await handler(fallbackRequest);\n * }\n * }\n * ```\n */\n wrapModelCall?: (request: ModelRequest<(TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>, handler: (request: ModelRequest<(TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<AIMessage> | AIMessage) => Promise<AIMessage> | AIMessage;\n /**\n * The function to run before the agent execution starts. This function is called once at the start of the agent invocation.\n * It allows to modify the state of the agent before any model calls or tool executions.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n beforeAgent?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;\n /**\n * The function to run before the model call. This function is called before the model is invoked and before the `wrapModelCall` hook.\n * It allows to modify the state of the agent.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n beforeModel?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;\n /**\n * The function to run after the model call. This function is called after the model is invoked and before any tools are called.\n * It allows to modify the state of the agent after the model is invoked, e.g. to update tool call parameters.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n afterModel?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;\n /**\n * The function to run after the agent execution completes. This function is called once at the end of the agent invocation.\n * It allows to modify the final state of the agent after all model calls and tool executions are complete.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n afterAgent?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;\n}): AgentMiddleware<TSchema, TContextSchema, any>;\n"],"mappings":"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"}
@@ -0,0 +1,205 @@
1
+ import { JumpToTarget } from "./constants.js";
2
+ import { ClientTool, ServerTool } from "./tools.js";
3
+ import { AgentBuiltInState, Runtime } from "./runtime.js";
4
+ import { ModelRequest } from "./nodes/types.js";
5
+ import { AgentMiddleware, MiddlewareResult, ToolCallHandler, ToolCallRequest } from "./middleware/types.js";
6
+ import { AIMessage, ToolMessage } from "@langchain/core/messages";
7
+ import { Command } from "@langchain/langgraph";
8
+ import { InferInteropZodInput, InferInteropZodOutput, InteropZodDefault, InteropZodObject, InteropZodOptional } from "@langchain/core/utils/types";
9
+
10
+ //#region src/agents/middleware.d.ts
11
+
12
+ /**
13
+ * Creates a middleware instance with automatic schema inference.
14
+ *
15
+ * @param config - Middleware configuration
16
+ * @param config.name - The name of the middleware
17
+ * @param config.stateSchema - The schema of the middleware state
18
+ * @param config.contextSchema - The schema of the middleware context
19
+ * @param config.wrapModelCall - The function to wrap model invocation
20
+ * @param config.wrapToolCall - The function to wrap tool invocation
21
+ * @param config.beforeModel - The function to run before the model call
22
+ * @param config.afterModel - The function to run after the model call
23
+ * @param config.beforeAgent - The function to run before the agent execution starts
24
+ * @param config.afterAgent - The function to run after the agent execution completes
25
+ * @returns A middleware instance
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const authMiddleware = createMiddleware({
30
+ * name: "AuthMiddleware",
31
+ * stateSchema: z.object({
32
+ * isAuthenticated: z.boolean().default(false),
33
+ * }),
34
+ * contextSchema: z.object({
35
+ * userId: z.string(),
36
+ * }),
37
+ * beforeModel: async (state, runtime, controls) => {
38
+ * if (!state.isAuthenticated) {
39
+ * return controls.terminate(new Error("Not authenticated"));
40
+ * }
41
+ * },
42
+ * });
43
+ * ```
44
+ */
45
+ declare function createMiddleware<TSchema extends InteropZodObject | undefined = undefined, TContextSchema extends InteropZodObject | InteropZodOptional<InteropZodObject> | InteropZodDefault<InteropZodObject> | undefined = undefined>(config: {
46
+ /**
47
+ * The name of the middleware
48
+ */
49
+ name: string;
50
+ /**
51
+ * The schema of the middleware state. Middleware state is persisted between multiple invocations. It can be either:
52
+ * - A Zod object
53
+ * - A Zod optional object
54
+ * - A Zod default object
55
+ * - Undefined
56
+ */
57
+ stateSchema?: TSchema;
58
+ /**
59
+ * The schema of the middleware context. Middleware context is read-only and not persisted between multiple invocations. It can be either:
60
+ * - A Zod object
61
+ * - A Zod optional object
62
+ * - A Zod default object
63
+ * - Undefined
64
+ */
65
+ contextSchema?: TContextSchema;
66
+ /**
67
+ * Explitictly defines which targets are allowed to be jumped to from the `beforeAgent` hook.
68
+ */
69
+ beforeAgentJumpTo?: JumpToTarget[];
70
+ /**
71
+ * Explitictly defines which targets are allowed to be jumped to from the `beforeModel` hook.
72
+ */
73
+ beforeModelJumpTo?: JumpToTarget[];
74
+ /**
75
+ * Explitictly defines which targets are allowed to be jumped to from the `afterModel` hook.
76
+ */
77
+ afterModelJumpTo?: JumpToTarget[];
78
+ /**
79
+ * Explitictly defines which targets are allowed to be jumped to from the `afterAgent` hook.
80
+ */
81
+ afterAgentJumpTo?: JumpToTarget[];
82
+ /**
83
+ * Additional tools registered by the middleware.
84
+ */
85
+ tools?: (ClientTool | ServerTool)[];
86
+ /**
87
+ * Wraps tool execution with custom logic. This allows you to:
88
+ * - Modify tool call parameters before execution
89
+ * - Handle errors and retry with different parameters
90
+ * - Post-process tool results
91
+ * - Implement caching, logging, authentication, or other cross-cutting concerns
92
+ * - Return Command objects for advanced control flow
93
+ *
94
+ * The handler receives a ToolCallRequest containing the tool call, state, and runtime,
95
+ * along with a handler function to execute the actual tool.
96
+ *
97
+ * @param request - The tool call request containing toolCall, state, and runtime.
98
+ * @param handler - The function that executes the tool. Call this with a ToolCall to get the result.
99
+ * @returns The tool result as a ToolMessage or a Command for advanced control flow.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * wrapToolCall: async (request, handler) => {
104
+ * console.log(`Calling tool: ${request.tool.name}`);
105
+ * console.log(`Tool description: ${request.tool.description}`);
106
+ *
107
+ * try {
108
+ * // Execute the tool
109
+ * const result = await handler(request.toolCall);
110
+ * console.log(`Tool ${request.tool.name} succeeded`);
111
+ * return result;
112
+ * } catch (error) {
113
+ * console.error(`Tool ${request.tool.name} failed:`, error);
114
+ * // Could return a custom error message or retry
115
+ * throw error;
116
+ * }
117
+ * }
118
+ * ```
119
+ *
120
+ * @example Authentication
121
+ * ```ts
122
+ * wrapToolCall: async (request, handler) => {
123
+ * // Check if user is authorized for this tool
124
+ * if (!request.runtime.context.isAuthorized(request.tool.name)) {
125
+ * return new ToolMessage({
126
+ * content: "Unauthorized to call this tool",
127
+ * tool_call_id: request.toolCall.id,
128
+ * });
129
+ * }
130
+ * return handler(request.toolCall);
131
+ * }
132
+ * ```
133
+ */
134
+ wrapToolCall?: (request: ToolCallRequest<(TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>, handler: ToolCallHandler) => Promise<ToolMessage | Command> | ToolMessage | Command;
135
+ /**
136
+ * Wraps the model invocation with custom logic. This allows you to:
137
+ * - Modify the request before calling the model
138
+ * - Handle errors and retry with different parameters
139
+ * - Post-process the response
140
+ * - Implement custom caching, logging, or other cross-cutting concerns
141
+ *
142
+ * The request parameter contains: model, messages, systemPrompt, tools, state, and runtime.
143
+ *
144
+ * @param request - The model request containing all the parameters needed.
145
+ * @param handler - The function that invokes the model. Call this with a ModelRequest to get the response.
146
+ * @returns The response from the model (or a modified version).
147
+ *
148
+ * @example
149
+ * ```ts
150
+ * wrapModelCall: async (request, handler) => {
151
+ * // Modify request before calling
152
+ * const modifiedRequest = { ...request, systemPrompt: "You are helpful" };
153
+ *
154
+ * try {
155
+ * // Call the model
156
+ * return await handler(modifiedRequest);
157
+ * } catch (error) {
158
+ * // Handle errors and retry with fallback
159
+ * const fallbackRequest = { ...request, model: fallbackModel };
160
+ * return await handler(fallbackRequest);
161
+ * }
162
+ * }
163
+ * ```
164
+ */
165
+ wrapModelCall?: (request: ModelRequest<(TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>, handler: (request: ModelRequest<(TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<AIMessage> | AIMessage) => Promise<AIMessage> | AIMessage;
166
+ /**
167
+ * The function to run before the agent execution starts. This function is called once at the start of the agent invocation.
168
+ * It allows to modify the state of the agent before any model calls or tool executions.
169
+ *
170
+ * @param state - The middleware state
171
+ * @param runtime - The middleware runtime
172
+ * @returns The modified middleware state or undefined to pass through
173
+ */
174
+ beforeAgent?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;
175
+ /**
176
+ * The function to run before the model call. This function is called before the model is invoked and before the `wrapModelCall` hook.
177
+ * It allows to modify the state of the agent.
178
+ *
179
+ * @param state - The middleware state
180
+ * @param runtime - The middleware runtime
181
+ * @returns The modified middleware state or undefined to pass through
182
+ */
183
+ beforeModel?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;
184
+ /**
185
+ * The function to run after the model call. This function is called after the model is invoked and before any tools are called.
186
+ * It allows to modify the state of the agent after the model is invoked, e.g. to update tool call parameters.
187
+ *
188
+ * @param state - The middleware state
189
+ * @param runtime - The middleware runtime
190
+ * @returns The modified middleware state or undefined to pass through
191
+ */
192
+ afterModel?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;
193
+ /**
194
+ * The function to run after the agent execution completes. This function is called once at the end of the agent invocation.
195
+ * It allows to modify the final state of the agent after all model calls and tool executions are complete.
196
+ *
197
+ * @param state - The middleware state
198
+ * @param runtime - The middleware runtime
199
+ * @returns The modified middleware state or undefined to pass through
200
+ */
201
+ afterAgent?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;
202
+ }): AgentMiddleware<TSchema, TContextSchema, any>;
203
+ //#endregion
204
+ export { createMiddleware };
205
+ //# sourceMappingURL=middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware.d.ts","names":["InteropZodObject","InteropZodDefault","InteropZodOptional","InferInteropZodInput","InferInteropZodOutput","AIMessage","ToolMessage","Command","JumpToTarget","ClientTool","ServerTool","Runtime","AgentBuiltInState","AgentMiddleware","MiddlewareResult","ToolCallRequest","ToolCallHandler","ModelRequest","createMiddleware","TSchema","TContextSchema","Partial","Promise"],"sources":["../../src/agents/middleware.d.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { InteropZodObject, InteropZodDefault, InteropZodOptional, InferInteropZodInput, InferInteropZodOutput } from \"@langchain/core/utils/types\";\nimport type { AIMessage, ToolMessage } from \"@langchain/core/messages\";\nimport type { Command } from \"@langchain/langgraph\";\nimport type { JumpToTarget } from \"./constants.js\";\nimport type { ClientTool, ServerTool } from \"./tools.js\";\nimport type { Runtime, AgentBuiltInState } from \"./runtime.js\";\nimport type { AgentMiddleware, MiddlewareResult, ToolCallRequest, ToolCallHandler } from \"./middleware/types.js\";\nimport type { ModelRequest } from \"./nodes/types.js\";\n/**\n * Creates a middleware instance with automatic schema inference.\n *\n * @param config - Middleware configuration\n * @param config.name - The name of the middleware\n * @param config.stateSchema - The schema of the middleware state\n * @param config.contextSchema - The schema of the middleware context\n * @param config.wrapModelCall - The function to wrap model invocation\n * @param config.wrapToolCall - The function to wrap tool invocation\n * @param config.beforeModel - The function to run before the model call\n * @param config.afterModel - The function to run after the model call\n * @param config.beforeAgent - The function to run before the agent execution starts\n * @param config.afterAgent - The function to run after the agent execution completes\n * @returns A middleware instance\n *\n * @example\n * ```ts\n * const authMiddleware = createMiddleware({\n * name: \"AuthMiddleware\",\n * stateSchema: z.object({\n * isAuthenticated: z.boolean().default(false),\n * }),\n * contextSchema: z.object({\n * userId: z.string(),\n * }),\n * beforeModel: async (state, runtime, controls) => {\n * if (!state.isAuthenticated) {\n * return controls.terminate(new Error(\"Not authenticated\"));\n * }\n * },\n * });\n * ```\n */\nexport declare function createMiddleware<TSchema extends InteropZodObject | undefined = undefined, TContextSchema extends InteropZodObject | InteropZodOptional<InteropZodObject> | InteropZodDefault<InteropZodObject> | undefined = undefined>(config: {\n /**\n * The name of the middleware\n */\n name: string;\n /**\n * The schema of the middleware state. Middleware state is persisted between multiple invocations. It can be either:\n * - A Zod object\n * - A Zod optional object\n * - A Zod default object\n * - Undefined\n */\n stateSchema?: TSchema;\n /**\n * The schema of the middleware context. Middleware context is read-only and not persisted between multiple invocations. It can be either:\n * - A Zod object\n * - A Zod optional object\n * - A Zod default object\n * - Undefined\n */\n contextSchema?: TContextSchema;\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `beforeAgent` hook.\n */\n beforeAgentJumpTo?: JumpToTarget[];\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `beforeModel` hook.\n */\n beforeModelJumpTo?: JumpToTarget[];\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `afterModel` hook.\n */\n afterModelJumpTo?: JumpToTarget[];\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `afterAgent` hook.\n */\n afterAgentJumpTo?: JumpToTarget[];\n /**\n * Additional tools registered by the middleware.\n */\n tools?: (ClientTool | ServerTool)[];\n /**\n * Wraps tool execution with custom logic. This allows you to:\n * - Modify tool call parameters before execution\n * - Handle errors and retry with different parameters\n * - Post-process tool results\n * - Implement caching, logging, authentication, or other cross-cutting concerns\n * - Return Command objects for advanced control flow\n *\n * The handler receives a ToolCallRequest containing the tool call, state, and runtime,\n * along with a handler function to execute the actual tool.\n *\n * @param request - The tool call request containing toolCall, state, and runtime.\n * @param handler - The function that executes the tool. Call this with a ToolCall to get the result.\n * @returns The tool result as a ToolMessage or a Command for advanced control flow.\n *\n * @example\n * ```ts\n * wrapToolCall: async (request, handler) => {\n * console.log(`Calling tool: ${request.tool.name}`);\n * console.log(`Tool description: ${request.tool.description}`);\n *\n * try {\n * // Execute the tool\n * const result = await handler(request.toolCall);\n * console.log(`Tool ${request.tool.name} succeeded`);\n * return result;\n * } catch (error) {\n * console.error(`Tool ${request.tool.name} failed:`, error);\n * // Could return a custom error message or retry\n * throw error;\n * }\n * }\n * ```\n *\n * @example Authentication\n * ```ts\n * wrapToolCall: async (request, handler) => {\n * // Check if user is authorized for this tool\n * if (!request.runtime.context.isAuthorized(request.tool.name)) {\n * return new ToolMessage({\n * content: \"Unauthorized to call this tool\",\n * tool_call_id: request.toolCall.id,\n * });\n * }\n * return handler(request.toolCall);\n * }\n * ```\n */\n wrapToolCall?: (request: ToolCallRequest<(TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>, handler: ToolCallHandler) => Promise<ToolMessage | Command> | ToolMessage | Command;\n /**\n * Wraps the model invocation with custom logic. This allows you to:\n * - Modify the request before calling the model\n * - Handle errors and retry with different parameters\n * - Post-process the response\n * - Implement custom caching, logging, or other cross-cutting concerns\n *\n * The request parameter contains: model, messages, systemPrompt, tools, state, and runtime.\n *\n * @param request - The model request containing all the parameters needed.\n * @param handler - The function that invokes the model. Call this with a ModelRequest to get the response.\n * @returns The response from the model (or a modified version).\n *\n * @example\n * ```ts\n * wrapModelCall: async (request, handler) => {\n * // Modify request before calling\n * const modifiedRequest = { ...request, systemPrompt: \"You are helpful\" };\n *\n * try {\n * // Call the model\n * return await handler(modifiedRequest);\n * } catch (error) {\n * // Handle errors and retry with fallback\n * const fallbackRequest = { ...request, model: fallbackModel };\n * return await handler(fallbackRequest);\n * }\n * }\n * ```\n */\n wrapModelCall?: (request: ModelRequest<(TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>, handler: (request: ModelRequest<(TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<AIMessage> | AIMessage) => Promise<AIMessage> | AIMessage;\n /**\n * The function to run before the agent execution starts. This function is called once at the start of the agent invocation.\n * It allows to modify the state of the agent before any model calls or tool executions.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n beforeAgent?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;\n /**\n * The function to run before the model call. This function is called before the model is invoked and before the `wrapModelCall` hook.\n * It allows to modify the state of the agent.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n beforeModel?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;\n /**\n * The function to run after the model call. This function is called after the model is invoked and before any tools are called.\n * It allows to modify the state of the agent after the model is invoked, e.g. to update tool call parameters.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n afterModel?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;\n /**\n * The function to run after the agent execution completes. This function is called once at the end of the agent invocation.\n * It allows to modify the final state of the agent after all model calls and tool executions are complete.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n afterAgent?: (state: (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) & AgentBuiltInState, runtime: Runtime<TContextSchema extends InteropZodObject ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodDefault<any> ? InferInteropZodOutput<TContextSchema> : TContextSchema extends InteropZodOptional<any> ? Partial<InferInteropZodOutput<TContextSchema>> : never>) => Promise<MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>> | MiddlewareResult<Partial<TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}>>;\n}): AgentMiddleware<TSchema, TContextSchema, any>;\n"],"mappings":"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"}
@@ -0,0 +1,57 @@
1
+ //#region src/agents/middleware.ts
2
+ /**
3
+ * Creates a middleware instance with automatic schema inference.
4
+ *
5
+ * @param config - Middleware configuration
6
+ * @param config.name - The name of the middleware
7
+ * @param config.stateSchema - The schema of the middleware state
8
+ * @param config.contextSchema - The schema of the middleware context
9
+ * @param config.wrapModelCall - The function to wrap model invocation
10
+ * @param config.wrapToolCall - The function to wrap tool invocation
11
+ * @param config.beforeModel - The function to run before the model call
12
+ * @param config.afterModel - The function to run after the model call
13
+ * @param config.beforeAgent - The function to run before the agent execution starts
14
+ * @param config.afterAgent - The function to run after the agent execution completes
15
+ * @returns A middleware instance
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const authMiddleware = createMiddleware({
20
+ * name: "AuthMiddleware",
21
+ * stateSchema: z.object({
22
+ * isAuthenticated: z.boolean().default(false),
23
+ * }),
24
+ * contextSchema: z.object({
25
+ * userId: z.string(),
26
+ * }),
27
+ * beforeModel: async (state, runtime, controls) => {
28
+ * if (!state.isAuthenticated) {
29
+ * return controls.terminate(new Error("Not authenticated"));
30
+ * }
31
+ * },
32
+ * });
33
+ * ```
34
+ */
35
+ function createMiddleware(config) {
36
+ const middleware = {
37
+ name: config.name,
38
+ stateSchema: config.stateSchema,
39
+ contextSchema: config.contextSchema,
40
+ beforeAgentJumpTo: config.beforeAgentJumpTo,
41
+ beforeModelJumpTo: config.beforeModelJumpTo,
42
+ afterModelJumpTo: config.afterModelJumpTo,
43
+ afterAgentJumpTo: config.afterAgentJumpTo,
44
+ tools: config.tools ?? []
45
+ };
46
+ if (config.wrapToolCall) middleware.wrapToolCall = async (request, handler) => Promise.resolve(config.wrapToolCall(request, handler));
47
+ if (config.wrapModelCall) middleware.wrapModelCall = async (request, handler) => Promise.resolve(config.wrapModelCall(request, handler));
48
+ if (config.beforeAgent) middleware.beforeAgent = async (state, runtime) => Promise.resolve(config.beforeAgent(state, runtime));
49
+ if (config.beforeModel) middleware.beforeModel = async (state, runtime) => Promise.resolve(config.beforeModel(state, runtime));
50
+ if (config.afterModel) middleware.afterModel = async (state, runtime) => Promise.resolve(config.afterModel(state, runtime));
51
+ if (config.afterAgent) middleware.afterAgent = async (state, runtime) => Promise.resolve(config.afterAgent(state, runtime));
52
+ return middleware;
53
+ }
54
+
55
+ //#endregion
56
+ export { createMiddleware };
57
+ //# sourceMappingURL=middleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware.js","names":["config: {\n /**\n * The name of the middleware\n */\n name: string;\n /**\n * The schema of the middleware state. Middleware state is persisted between multiple invocations. It can be either:\n * - A Zod object\n * - A Zod optional object\n * - A Zod default object\n * - Undefined\n */\n stateSchema?: TSchema;\n /**\n * The schema of the middleware context. Middleware context is read-only and not persisted between multiple invocations. It can be either:\n * - A Zod object\n * - A Zod optional object\n * - A Zod default object\n * - Undefined\n */\n contextSchema?: TContextSchema;\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `beforeAgent` hook.\n */\n beforeAgentJumpTo?: JumpToTarget[];\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `beforeModel` hook.\n */\n beforeModelJumpTo?: JumpToTarget[];\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `afterModel` hook.\n */\n afterModelJumpTo?: JumpToTarget[];\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `afterAgent` hook.\n */\n afterAgentJumpTo?: JumpToTarget[];\n /**\n * Additional tools registered by the middleware.\n */\n tools?: (ClientTool | ServerTool)[];\n /**\n * Wraps tool execution with custom logic. This allows you to:\n * - Modify tool call parameters before execution\n * - Handle errors and retry with different parameters\n * - Post-process tool results\n * - Implement caching, logging, authentication, or other cross-cutting concerns\n * - Return Command objects for advanced control flow\n *\n * The handler receives a ToolCallRequest containing the tool call, state, and runtime,\n * along with a handler function to execute the actual tool.\n *\n * @param request - The tool call request containing toolCall, state, and runtime.\n * @param handler - The function that executes the tool. Call this with a ToolCall to get the result.\n * @returns The tool result as a ToolMessage or a Command for advanced control flow.\n *\n * @example\n * ```ts\n * wrapToolCall: async (request, handler) => {\n * console.log(`Calling tool: ${request.tool.name}`);\n * console.log(`Tool description: ${request.tool.description}`);\n *\n * try {\n * // Execute the tool\n * const result = await handler(request.toolCall);\n * console.log(`Tool ${request.tool.name} succeeded`);\n * return result;\n * } catch (error) {\n * console.error(`Tool ${request.tool.name} failed:`, error);\n * // Could return a custom error message or retry\n * throw error;\n * }\n * }\n * ```\n *\n * @example Authentication\n * ```ts\n * wrapToolCall: async (request, handler) => {\n * // Check if user is authorized for this tool\n * if (!request.runtime.context.isAuthorized(request.tool.name)) {\n * return new ToolMessage({\n * content: \"Unauthorized to call this tool\",\n * tool_call_id: request.toolCall.id,\n * });\n * }\n * return handler(request.toolCall);\n * }\n * ```\n */\n wrapToolCall?: (\n request: ToolCallRequest<\n (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) &\n AgentBuiltInState,\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >,\n handler: ToolCallHandler\n ) => Promise<ToolMessage | Command> | ToolMessage | Command;\n /**\n * Wraps the model invocation with custom logic. This allows you to:\n * - Modify the request before calling the model\n * - Handle errors and retry with different parameters\n * - Post-process the response\n * - Implement custom caching, logging, or other cross-cutting concerns\n *\n * The request parameter contains: model, messages, systemPrompt, tools, state, and runtime.\n *\n * @param request - The model request containing all the parameters needed.\n * @param handler - The function that invokes the model. Call this with a ModelRequest to get the response.\n * @returns The response from the model (or a modified version).\n *\n * @example\n * ```ts\n * wrapModelCall: async (request, handler) => {\n * // Modify request before calling\n * const modifiedRequest = { ...request, systemPrompt: \"You are helpful\" };\n *\n * try {\n * // Call the model\n * return await handler(modifiedRequest);\n * } catch (error) {\n * // Handle errors and retry with fallback\n * const fallbackRequest = { ...request, model: fallbackModel };\n * return await handler(fallbackRequest);\n * }\n * }\n * ```\n */\n wrapModelCall?: (\n request: ModelRequest<\n (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) &\n AgentBuiltInState,\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >,\n handler: (\n request: ModelRequest<\n (TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}) &\n AgentBuiltInState,\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n ) => Promise<AIMessage> | AIMessage\n ) => Promise<AIMessage> | AIMessage;\n /**\n * The function to run before the agent execution starts. This function is called once at the start of the agent invocation.\n * It allows to modify the state of the agent before any model calls or tool executions.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n beforeAgent?: (\n state: (TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}) &\n AgentBuiltInState,\n runtime: Runtime<\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n ) =>\n | Promise<\n MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}\n >\n >\n >\n | MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}\n >\n >;\n /**\n * The function to run before the model call. This function is called before the model is invoked and before the `wrapModelCall` hook.\n * It allows to modify the state of the agent.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n beforeModel?: (\n state: (TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}) &\n AgentBuiltInState,\n runtime: Runtime<\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n ) =>\n | Promise<\n MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}\n >\n >\n >\n | MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}\n >\n >;\n /**\n * The function to run after the model call. This function is called after the model is invoked and before any tools are called.\n * It allows to modify the state of the agent after the model is invoked, e.g. to update tool call parameters.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n afterModel?: (\n state: (TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}) &\n AgentBuiltInState,\n runtime: Runtime<\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n ) =>\n | Promise<\n MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}\n >\n >\n >\n | MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}\n >\n >;\n /**\n * The function to run after the agent execution completes. This function is called once at the end of the agent invocation.\n * It allows to modify the final state of the agent after all model calls and tool executions are complete.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n afterAgent?: (\n state: (TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}) &\n AgentBuiltInState,\n runtime: Runtime<\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n ) =>\n | Promise<\n MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}\n >\n >\n >\n | MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}\n >\n >;\n}","middleware: AgentMiddleware<TSchema, TContextSchema, any>"],"sources":["../../src/agents/middleware.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type {\n InteropZodObject,\n InteropZodDefault,\n InteropZodOptional,\n InferInteropZodInput,\n InferInteropZodOutput,\n} from \"@langchain/core/utils/types\";\nimport type { AIMessage, ToolMessage } from \"@langchain/core/messages\";\nimport type { Command } from \"@langchain/langgraph\";\n\nimport type { JumpToTarget } from \"./constants.js\";\nimport type { ClientTool, ServerTool } from \"./tools.js\";\nimport type { Runtime, AgentBuiltInState } from \"./runtime.js\";\nimport type {\n AgentMiddleware,\n MiddlewareResult,\n ToolCallRequest,\n ToolCallHandler,\n} from \"./middleware/types.js\";\nimport type { ModelRequest } from \"./nodes/types.js\";\n/**\n * Creates a middleware instance with automatic schema inference.\n *\n * @param config - Middleware configuration\n * @param config.name - The name of the middleware\n * @param config.stateSchema - The schema of the middleware state\n * @param config.contextSchema - The schema of the middleware context\n * @param config.wrapModelCall - The function to wrap model invocation\n * @param config.wrapToolCall - The function to wrap tool invocation\n * @param config.beforeModel - The function to run before the model call\n * @param config.afterModel - The function to run after the model call\n * @param config.beforeAgent - The function to run before the agent execution starts\n * @param config.afterAgent - The function to run after the agent execution completes\n * @returns A middleware instance\n *\n * @example\n * ```ts\n * const authMiddleware = createMiddleware({\n * name: \"AuthMiddleware\",\n * stateSchema: z.object({\n * isAuthenticated: z.boolean().default(false),\n * }),\n * contextSchema: z.object({\n * userId: z.string(),\n * }),\n * beforeModel: async (state, runtime, controls) => {\n * if (!state.isAuthenticated) {\n * return controls.terminate(new Error(\"Not authenticated\"));\n * }\n * },\n * });\n * ```\n */\nexport function createMiddleware<\n TSchema extends InteropZodObject | undefined = undefined,\n TContextSchema extends\n | InteropZodObject\n | InteropZodOptional<InteropZodObject>\n | InteropZodDefault<InteropZodObject>\n | undefined = undefined\n>(config: {\n /**\n * The name of the middleware\n */\n name: string;\n /**\n * The schema of the middleware state. Middleware state is persisted between multiple invocations. It can be either:\n * - A Zod object\n * - A Zod optional object\n * - A Zod default object\n * - Undefined\n */\n stateSchema?: TSchema;\n /**\n * The schema of the middleware context. Middleware context is read-only and not persisted between multiple invocations. It can be either:\n * - A Zod object\n * - A Zod optional object\n * - A Zod default object\n * - Undefined\n */\n contextSchema?: TContextSchema;\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `beforeAgent` hook.\n */\n beforeAgentJumpTo?: JumpToTarget[];\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `beforeModel` hook.\n */\n beforeModelJumpTo?: JumpToTarget[];\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `afterModel` hook.\n */\n afterModelJumpTo?: JumpToTarget[];\n /**\n * Explitictly defines which targets are allowed to be jumped to from the `afterAgent` hook.\n */\n afterAgentJumpTo?: JumpToTarget[];\n /**\n * Additional tools registered by the middleware.\n */\n tools?: (ClientTool | ServerTool)[];\n /**\n * Wraps tool execution with custom logic. This allows you to:\n * - Modify tool call parameters before execution\n * - Handle errors and retry with different parameters\n * - Post-process tool results\n * - Implement caching, logging, authentication, or other cross-cutting concerns\n * - Return Command objects for advanced control flow\n *\n * The handler receives a ToolCallRequest containing the tool call, state, and runtime,\n * along with a handler function to execute the actual tool.\n *\n * @param request - The tool call request containing toolCall, state, and runtime.\n * @param handler - The function that executes the tool. Call this with a ToolCall to get the result.\n * @returns The tool result as a ToolMessage or a Command for advanced control flow.\n *\n * @example\n * ```ts\n * wrapToolCall: async (request, handler) => {\n * console.log(`Calling tool: ${request.tool.name}`);\n * console.log(`Tool description: ${request.tool.description}`);\n *\n * try {\n * // Execute the tool\n * const result = await handler(request.toolCall);\n * console.log(`Tool ${request.tool.name} succeeded`);\n * return result;\n * } catch (error) {\n * console.error(`Tool ${request.tool.name} failed:`, error);\n * // Could return a custom error message or retry\n * throw error;\n * }\n * }\n * ```\n *\n * @example Authentication\n * ```ts\n * wrapToolCall: async (request, handler) => {\n * // Check if user is authorized for this tool\n * if (!request.runtime.context.isAuthorized(request.tool.name)) {\n * return new ToolMessage({\n * content: \"Unauthorized to call this tool\",\n * tool_call_id: request.toolCall.id,\n * });\n * }\n * return handler(request.toolCall);\n * }\n * ```\n */\n wrapToolCall?: (\n request: ToolCallRequest<\n (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) &\n AgentBuiltInState,\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >,\n handler: ToolCallHandler\n ) => Promise<ToolMessage | Command> | ToolMessage | Command;\n /**\n * Wraps the model invocation with custom logic. This allows you to:\n * - Modify the request before calling the model\n * - Handle errors and retry with different parameters\n * - Post-process the response\n * - Implement custom caching, logging, or other cross-cutting concerns\n *\n * The request parameter contains: model, messages, systemPrompt, tools, state, and runtime.\n *\n * @param request - The model request containing all the parameters needed.\n * @param handler - The function that invokes the model. Call this with a ModelRequest to get the response.\n * @returns The response from the model (or a modified version).\n *\n * @example\n * ```ts\n * wrapModelCall: async (request, handler) => {\n * // Modify request before calling\n * const modifiedRequest = { ...request, systemPrompt: \"You are helpful\" };\n *\n * try {\n * // Call the model\n * return await handler(modifiedRequest);\n * } catch (error) {\n * // Handle errors and retry with fallback\n * const fallbackRequest = { ...request, model: fallbackModel };\n * return await handler(fallbackRequest);\n * }\n * }\n * ```\n */\n wrapModelCall?: (\n request: ModelRequest<\n (TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}) &\n AgentBuiltInState,\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >,\n handler: (\n request: ModelRequest<\n (TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}) &\n AgentBuiltInState,\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n ) => Promise<AIMessage> | AIMessage\n ) => Promise<AIMessage> | AIMessage;\n /**\n * The function to run before the agent execution starts. This function is called once at the start of the agent invocation.\n * It allows to modify the state of the agent before any model calls or tool executions.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n beforeAgent?: (\n state: (TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}) &\n AgentBuiltInState,\n runtime: Runtime<\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n ) =>\n | Promise<\n MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}\n >\n >\n >\n | MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}\n >\n >;\n /**\n * The function to run before the model call. This function is called before the model is invoked and before the `wrapModelCall` hook.\n * It allows to modify the state of the agent.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n beforeModel?: (\n state: (TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}) &\n AgentBuiltInState,\n runtime: Runtime<\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n ) =>\n | Promise<\n MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}\n >\n >\n >\n | MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}\n >\n >;\n /**\n * The function to run after the model call. This function is called after the model is invoked and before any tools are called.\n * It allows to modify the state of the agent after the model is invoked, e.g. to update tool call parameters.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n afterModel?: (\n state: (TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}) &\n AgentBuiltInState,\n runtime: Runtime<\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n ) =>\n | Promise<\n MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}\n >\n >\n >\n | MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}\n >\n >;\n /**\n * The function to run after the agent execution completes. This function is called once at the end of the agent invocation.\n * It allows to modify the final state of the agent after all model calls and tool executions are complete.\n *\n * @param state - The middleware state\n * @param runtime - The middleware runtime\n * @returns The modified middleware state or undefined to pass through\n */\n afterAgent?: (\n state: (TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}) &\n AgentBuiltInState,\n runtime: Runtime<\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n ) =>\n | Promise<\n MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject\n ? InferInteropZodInput<TSchema>\n : {}\n >\n >\n >\n | MiddlewareResult<\n Partial<\n TSchema extends InteropZodObject ? InferInteropZodInput<TSchema> : {}\n >\n >;\n}): AgentMiddleware<TSchema, TContextSchema, any> {\n const middleware: AgentMiddleware<TSchema, TContextSchema, any> = {\n name: config.name,\n stateSchema: config.stateSchema,\n contextSchema: config.contextSchema,\n beforeAgentJumpTo: config.beforeAgentJumpTo,\n beforeModelJumpTo: config.beforeModelJumpTo,\n afterModelJumpTo: config.afterModelJumpTo,\n afterAgentJumpTo: config.afterAgentJumpTo,\n tools: config.tools ?? [],\n };\n\n if (config.wrapToolCall) {\n middleware.wrapToolCall = async (request, handler) =>\n Promise.resolve(config.wrapToolCall!(request, handler));\n }\n\n if (config.wrapModelCall) {\n middleware.wrapModelCall = async (request, handler) =>\n Promise.resolve(config.wrapModelCall!(request, handler));\n }\n\n if (config.beforeAgent) {\n middleware.beforeAgent = async (state, runtime) =>\n Promise.resolve(\n config.beforeAgent!(\n state,\n runtime as Runtime<\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n )\n );\n }\n\n if (config.beforeModel) {\n middleware.beforeModel = async (state, runtime) =>\n Promise.resolve(\n config.beforeModel!(\n state,\n runtime as Runtime<\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n )\n );\n }\n\n if (config.afterModel) {\n middleware.afterModel = async (state, runtime) =>\n Promise.resolve(\n config.afterModel!(\n state,\n runtime as Runtime<\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n )\n );\n }\n\n if (config.afterAgent) {\n middleware.afterAgent = async (state, runtime) =>\n Promise.resolve(\n config.afterAgent!(\n state,\n runtime as Runtime<\n TContextSchema extends InteropZodObject\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodDefault<any>\n ? InferInteropZodOutput<TContextSchema>\n : TContextSchema extends InteropZodOptional<any>\n ? Partial<InferInteropZodOutput<TContextSchema>>\n : never\n >\n )\n );\n }\n\n return middleware;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,SAAgB,iBAOdA,QAqTgD;CAChD,MAAMC,aAA4D;EAChE,MAAM,OAAO;EACb,aAAa,OAAO;EACpB,eAAe,OAAO;EACtB,mBAAmB,OAAO;EAC1B,mBAAmB,OAAO;EAC1B,kBAAkB,OAAO;EACzB,kBAAkB,OAAO;EACzB,OAAO,OAAO,SAAS,CAAE;CAC1B;AAED,KAAI,OAAO,cACT,WAAW,eAAe,OAAO,SAAS,YACxC,QAAQ,QAAQ,OAAO,aAAc,SAAS,QAAQ,CAAC;AAG3D,KAAI,OAAO,eACT,WAAW,gBAAgB,OAAO,SAAS,YACzC,QAAQ,QAAQ,OAAO,cAAe,SAAS,QAAQ,CAAC;AAG5D,KAAI,OAAO,aACT,WAAW,cAAc,OAAO,OAAO,YACrC,QAAQ,QACN,OAAO,YACL,OACA,QASD,CACF;AAGL,KAAI,OAAO,aACT,WAAW,cAAc,OAAO,OAAO,YACrC,QAAQ,QACN,OAAO,YACL,OACA,QASD,CACF;AAGL,KAAI,OAAO,YACT,WAAW,aAAa,OAAO,OAAO,YACpC,QAAQ,QACN,OAAO,WACL,OACA,QASD,CACF;AAGL,KAAI,OAAO,YACT,WAAW,aAAa,OAAO,OAAO,YACpC,QAAQ,QACN,OAAO,WACL,OACA,QASD,CACF;AAGL,QAAO;AACR"}