@librechat/agents 4.2.11 → 4.2.13

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 (348) hide show
  1. package/dist/cjs/graphs/Graph.cjs +15 -3
  2. package/dist/cjs/graphs/Graph.cjs.map +1 -1
  3. package/dist/cjs/langfuse.cjs +63 -35
  4. package/dist/cjs/langfuse.cjs.map +1 -1
  5. package/dist/cjs/langfuseConfig.cjs +6 -0
  6. package/dist/cjs/langfuseConfig.cjs.map +1 -1
  7. package/dist/cjs/langfuseToolOutputTracing.cjs +1 -1
  8. package/dist/cjs/langfuseToolOutputTracing.cjs.map +1 -1
  9. package/dist/cjs/langfuseTraceShaping.cjs +18 -8
  10. package/dist/cjs/langfuseTraceShaping.cjs.map +1 -1
  11. package/dist/cjs/llm/anthropic/index.cjs +4 -3
  12. package/dist/cjs/llm/anthropic/index.cjs.map +1 -1
  13. package/dist/cjs/llm/anthropic/utils/container.cjs +37 -0
  14. package/dist/cjs/llm/anthropic/utils/container.cjs.map +1 -0
  15. package/dist/cjs/llm/anthropic/utils/message_inputs.cjs +25 -23
  16. package/dist/cjs/llm/anthropic/utils/message_inputs.cjs.map +1 -1
  17. package/dist/cjs/llm/anthropic/utils/message_outputs.cjs +15 -21
  18. package/dist/cjs/llm/anthropic/utils/message_outputs.cjs.map +1 -1
  19. package/dist/cjs/llm/anthropic/utils/stream_events.cjs +16 -14
  20. package/dist/cjs/llm/anthropic/utils/stream_events.cjs.map +1 -1
  21. package/dist/cjs/llm/bedrock/index.cjs +1 -1
  22. package/dist/cjs/llm/bedrock/index.cjs.map +1 -1
  23. package/dist/cjs/llm/bedrock/toolCache.cjs +1 -1
  24. package/dist/cjs/llm/bedrock/utils/message_inputs.cjs +19 -13
  25. package/dist/cjs/llm/bedrock/utils/message_inputs.cjs.map +1 -1
  26. package/dist/cjs/llm/google/utils/common.cjs +59 -13
  27. package/dist/cjs/llm/google/utils/common.cjs.map +1 -1
  28. package/dist/cjs/llm/init.cjs +12 -2
  29. package/dist/cjs/llm/init.cjs.map +1 -1
  30. package/dist/cjs/llm/openai/index.cjs +15 -2
  31. package/dist/cjs/llm/openai/index.cjs.map +1 -1
  32. package/dist/cjs/llm/openai/responseToolArguments.cjs +62 -0
  33. package/dist/cjs/llm/openai/responseToolArguments.cjs.map +1 -0
  34. package/dist/cjs/llm/openrouter/index.cjs +11 -2
  35. package/dist/cjs/llm/openrouter/index.cjs.map +1 -1
  36. package/dist/cjs/llm/openrouter/toolCache.cjs +1 -1
  37. package/dist/cjs/llm/prepareProviderRequest.cjs +35 -7
  38. package/dist/cjs/llm/prepareProviderRequest.cjs.map +1 -1
  39. package/dist/cjs/main.cjs +9 -3
  40. package/dist/cjs/messages/alternation.cjs +1 -1
  41. package/dist/cjs/messages/anthropicServerTools.cjs +20 -0
  42. package/dist/cjs/messages/anthropicServerTools.cjs.map +1 -0
  43. package/dist/cjs/messages/budget.cjs +1 -1
  44. package/dist/cjs/messages/cache.cjs +14 -1
  45. package/dist/cjs/messages/cache.cjs.map +1 -1
  46. package/dist/cjs/messages/core.cjs +4 -3
  47. package/dist/cjs/messages/core.cjs.map +1 -1
  48. package/dist/cjs/messages/format.cjs +3 -3
  49. package/dist/cjs/messages/index.cjs +1 -1
  50. package/dist/cjs/messages/prune.cjs +1 -1
  51. package/dist/cjs/messages/recency.cjs +1 -1
  52. package/dist/cjs/messages/toolResultTypes.cjs +21 -45
  53. package/dist/cjs/messages/toolResultTypes.cjs.map +1 -1
  54. package/dist/cjs/protection/providerText.cjs +4 -0
  55. package/dist/cjs/protection/providerText.cjs.map +1 -1
  56. package/dist/cjs/protection/toolResult.cjs +119 -0
  57. package/dist/cjs/protection/toolResult.cjs.map +1 -0
  58. package/dist/cjs/run.cjs +31 -13
  59. package/dist/cjs/run.cjs.map +1 -1
  60. package/dist/cjs/runtime/admission.cjs +1 -1
  61. package/dist/cjs/runtime/client.cjs +3 -0
  62. package/dist/cjs/runtime/client.cjs.map +1 -1
  63. package/dist/cjs/stream.cjs +2 -1
  64. package/dist/cjs/stream.cjs.map +1 -1
  65. package/dist/cjs/summarization/node.cjs +9 -4
  66. package/dist/cjs/summarization/node.cjs.map +1 -1
  67. package/dist/cjs/tools/ProgrammaticToolCalling.cjs +1 -1
  68. package/dist/cjs/tools/ToolNode.cjs +47 -14
  69. package/dist/cjs/tools/ToolNode.cjs.map +1 -1
  70. package/dist/cjs/tools/local/CompileCheckTool.cjs +1 -1
  71. package/dist/cjs/tools/local/LocalCodingTools.cjs +1 -1
  72. package/dist/cjs/tools/search/content.cjs +163 -42
  73. package/dist/cjs/tools/search/content.cjs.map +1 -1
  74. package/dist/cjs/tools/subagent/SubagentExecutor.cjs +8 -0
  75. package/dist/cjs/tools/subagent/SubagentExecutor.cjs.map +1 -1
  76. package/dist/cjs/utils/events.cjs +2 -2
  77. package/dist/cjs/utils/events.cjs.map +1 -1
  78. package/dist/cjs/utils/tokens.cjs +7 -2
  79. package/dist/cjs/utils/tokens.cjs.map +1 -1
  80. package/dist/esm/graphs/Graph.mjs +15 -3
  81. package/dist/esm/graphs/Graph.mjs.map +1 -1
  82. package/dist/esm/langfuse.mjs +63 -35
  83. package/dist/esm/langfuse.mjs.map +1 -1
  84. package/dist/esm/langfuseConfig.mjs +6 -1
  85. package/dist/esm/langfuseConfig.mjs.map +1 -1
  86. package/dist/esm/langfuseToolOutputTracing.mjs +2 -2
  87. package/dist/esm/langfuseToolOutputTracing.mjs.map +1 -1
  88. package/dist/esm/langfuseTraceShaping.mjs +18 -9
  89. package/dist/esm/langfuseTraceShaping.mjs.map +1 -1
  90. package/dist/esm/llm/anthropic/index.mjs +4 -3
  91. package/dist/esm/llm/anthropic/index.mjs.map +1 -1
  92. package/dist/esm/llm/anthropic/utils/container.mjs +37 -0
  93. package/dist/esm/llm/anthropic/utils/container.mjs.map +1 -0
  94. package/dist/esm/llm/anthropic/utils/message_inputs.mjs +25 -23
  95. package/dist/esm/llm/anthropic/utils/message_inputs.mjs.map +1 -1
  96. package/dist/esm/llm/anthropic/utils/message_outputs.mjs +15 -21
  97. package/dist/esm/llm/anthropic/utils/message_outputs.mjs.map +1 -1
  98. package/dist/esm/llm/anthropic/utils/stream_events.mjs +16 -14
  99. package/dist/esm/llm/anthropic/utils/stream_events.mjs.map +1 -1
  100. package/dist/esm/llm/bedrock/index.mjs +2 -2
  101. package/dist/esm/llm/bedrock/index.mjs.map +1 -1
  102. package/dist/esm/llm/bedrock/toolCache.mjs +1 -1
  103. package/dist/esm/llm/bedrock/utils/message_inputs.mjs +19 -14
  104. package/dist/esm/llm/bedrock/utils/message_inputs.mjs.map +1 -1
  105. package/dist/esm/llm/google/utils/common.mjs +59 -13
  106. package/dist/esm/llm/google/utils/common.mjs.map +1 -1
  107. package/dist/esm/llm/init.mjs +12 -2
  108. package/dist/esm/llm/init.mjs.map +1 -1
  109. package/dist/esm/llm/openai/index.mjs +16 -3
  110. package/dist/esm/llm/openai/index.mjs.map +1 -1
  111. package/dist/esm/llm/openai/responseToolArguments.mjs +62 -0
  112. package/dist/esm/llm/openai/responseToolArguments.mjs.map +1 -0
  113. package/dist/esm/llm/openrouter/index.mjs +11 -2
  114. package/dist/esm/llm/openrouter/index.mjs.map +1 -1
  115. package/dist/esm/llm/openrouter/toolCache.mjs +1 -1
  116. package/dist/esm/llm/prepareProviderRequest.mjs +35 -7
  117. package/dist/esm/llm/prepareProviderRequest.mjs.map +1 -1
  118. package/dist/esm/main.mjs +5 -4
  119. package/dist/esm/messages/alternation.mjs +1 -1
  120. package/dist/esm/messages/anthropicServerTools.mjs +18 -0
  121. package/dist/esm/messages/anthropicServerTools.mjs.map +1 -0
  122. package/dist/esm/messages/budget.mjs +1 -1
  123. package/dist/esm/messages/cache.mjs +12 -2
  124. package/dist/esm/messages/cache.mjs.map +1 -1
  125. package/dist/esm/messages/core.mjs +4 -3
  126. package/dist/esm/messages/core.mjs.map +1 -1
  127. package/dist/esm/messages/format.mjs +3 -3
  128. package/dist/esm/messages/index.mjs +1 -1
  129. package/dist/esm/messages/prune.mjs +1 -1
  130. package/dist/esm/messages/recency.mjs +1 -1
  131. package/dist/esm/messages/toolResultTypes.mjs +21 -45
  132. package/dist/esm/messages/toolResultTypes.mjs.map +1 -1
  133. package/dist/esm/protection/providerText.mjs +4 -1
  134. package/dist/esm/protection/providerText.mjs.map +1 -1
  135. package/dist/esm/protection/toolResult.mjs +114 -0
  136. package/dist/esm/protection/toolResult.mjs.map +1 -0
  137. package/dist/esm/run.mjs +32 -14
  138. package/dist/esm/run.mjs.map +1 -1
  139. package/dist/esm/runtime/admission.mjs +1 -1
  140. package/dist/esm/runtime/client.mjs +3 -0
  141. package/dist/esm/runtime/client.mjs.map +1 -1
  142. package/dist/esm/stream.mjs +2 -1
  143. package/dist/esm/stream.mjs.map +1 -1
  144. package/dist/esm/summarization/node.mjs +9 -4
  145. package/dist/esm/summarization/node.mjs.map +1 -1
  146. package/dist/esm/tools/ProgrammaticToolCalling.mjs +1 -1
  147. package/dist/esm/tools/ToolNode.mjs +47 -14
  148. package/dist/esm/tools/ToolNode.mjs.map +1 -1
  149. package/dist/esm/tools/local/CompileCheckTool.mjs +1 -1
  150. package/dist/esm/tools/local/LocalCodingTools.mjs +1 -1
  151. package/dist/esm/tools/search/content.mjs +163 -42
  152. package/dist/esm/tools/search/content.mjs.map +1 -1
  153. package/dist/esm/tools/subagent/SubagentExecutor.mjs +8 -0
  154. package/dist/esm/tools/subagent/SubagentExecutor.mjs.map +1 -1
  155. package/dist/esm/utils/events.mjs +2 -2
  156. package/dist/esm/utils/events.mjs.map +1 -1
  157. package/dist/esm/utils/tokens.mjs +7 -2
  158. package/dist/esm/utils/tokens.mjs.map +1 -1
  159. package/dist/types/common/index.d.ts +2 -2
  160. package/dist/types/decisions/breaker.d.ts +2 -2
  161. package/dist/types/decisions/core.d.ts +13 -13
  162. package/dist/types/decisions/dialect.d.ts +1 -1
  163. package/dist/types/decisions/http.d.ts +2 -2
  164. package/dist/types/decisions/index.d.ts +5 -5
  165. package/dist/types/decisions/node.d.ts +2 -2
  166. package/dist/types/decisions/presets.d.ts +2 -2
  167. package/dist/types/decisions/probe.d.ts +1 -1
  168. package/dist/types/decisions/questions.d.ts +1 -1
  169. package/dist/types/decisions/structuredChat.d.ts +2 -2
  170. package/dist/types/decisions/transport.d.ts +1 -1
  171. package/dist/types/eventActor/EventActorExecutor.d.ts +1 -1
  172. package/dist/types/eventActor/index.d.ts +2 -2
  173. package/dist/types/graphs/Graph.d.ts +6 -2
  174. package/dist/types/graphs/MultiAgentGraph.d.ts +1 -1
  175. package/dist/types/graphs/applyGraphRuntimeConfig.d.ts +1 -1
  176. package/dist/types/graphs/graphFactory.d.ts +1 -1
  177. package/dist/types/graphs/index.d.ts +5 -5
  178. package/dist/types/harness/fileBindings.d.ts +2 -2
  179. package/dist/types/harness/fileService.d.ts +2 -2
  180. package/dist/types/harness/fileStream.d.ts +1 -1
  181. package/dist/types/harness/index.d.ts +15 -15
  182. package/dist/types/harness/model.d.ts +1 -1
  183. package/dist/types/harness/modelService.d.ts +2 -2
  184. package/dist/types/harness/modelStreamCallbacks.d.ts +1 -1
  185. package/dist/types/harness/providerText.d.ts +1 -1
  186. package/dist/types/hitl/index.d.ts +3 -3
  187. package/dist/types/hooks/HookRegistry.d.ts +1 -1
  188. package/dist/types/hooks/createToolPolicyHook.d.ts +1 -1
  189. package/dist/types/hooks/createWorkspacePolicyHook.d.ts +1 -1
  190. package/dist/types/hooks/executeHooks.d.ts +2 -2
  191. package/dist/types/hooks/index.d.ts +11 -11
  192. package/dist/types/index.d.ts +62 -60
  193. package/dist/types/langchain/index.d.ts +8 -8
  194. package/dist/types/langfuse.d.ts +7 -4
  195. package/dist/types/langfuseConfig.d.ts +5 -0
  196. package/dist/types/langfuseTraceShaping.d.ts +5 -0
  197. package/dist/types/llm/anthropic/utils/container.d.ts +4 -0
  198. package/dist/types/llm/anthropic/utils/message_inputs.d.ts +1 -1
  199. package/dist/types/llm/anthropic/utils/message_outputs.d.ts +1 -1
  200. package/dist/types/llm/anthropic/utils/stream_events.d.ts +1 -1
  201. package/dist/types/llm/bedrock/index.d.ts +2 -3
  202. package/dist/types/llm/bedrock/utils/harmony.d.ts +1 -1
  203. package/dist/types/llm/bedrock/utils/index.d.ts +2 -2
  204. package/dist/types/llm/bedrock/utils/message_inputs.d.ts +3 -12
  205. package/dist/types/llm/bedrock/utils/message_outputs.d.ts +1 -1
  206. package/dist/types/llm/google/index.d.ts +2 -2
  207. package/dist/types/llm/google/utils/common.d.ts +1 -1
  208. package/dist/types/llm/google/utils/tools.d.ts +1 -1
  209. package/dist/types/llm/openai/index.d.ts +2 -1
  210. package/dist/types/llm/openai/responseToolArguments.d.ts +7 -0
  211. package/dist/types/llm/openrouter/index.d.ts +1 -0
  212. package/dist/types/llm/prepareProviderRequest.d.ts +4 -1
  213. package/dist/types/llm/providerRegistry.d.ts +1 -1
  214. package/dist/types/llm/providers.d.ts +1 -1
  215. package/dist/types/messages/anthropicServerTools.d.ts +13 -0
  216. package/dist/types/messages/cache.d.ts +13 -0
  217. package/dist/types/messages/contextPruning.d.ts +1 -1
  218. package/dist/types/messages/core.d.ts +4 -4
  219. package/dist/types/messages/format.d.ts +1 -1
  220. package/dist/types/messages/index.d.ts +21 -21
  221. package/dist/types/messages/prune.d.ts +1 -1
  222. package/dist/types/openai/index.d.ts +2 -2
  223. package/dist/types/openai/toolProjection.d.ts +1 -1
  224. package/dist/types/prompts/index.d.ts +2 -2
  225. package/dist/types/protection/providerText.d.ts +3 -1
  226. package/dist/types/protection/toolResult.d.ts +69 -0
  227. package/dist/types/provider-registration.d.ts +1 -1
  228. package/dist/types/rerank/bm25.d.ts +1 -1
  229. package/dist/types/rerank/core.d.ts +17 -17
  230. package/dist/types/rerank/crossEncoder.d.ts +3 -3
  231. package/dist/types/rerank/fallback.d.ts +1 -1
  232. package/dist/types/rerank/index.d.ts +2 -2
  233. package/dist/types/rerank/outcome.d.ts +2 -2
  234. package/dist/types/rerank/pin.d.ts +2 -2
  235. package/dist/types/rerank/search.d.ts +1 -1
  236. package/dist/types/rerank/systemone.d.ts +4 -4
  237. package/dist/types/rerank/types.d.ts +1 -1
  238. package/dist/types/run.d.ts +2 -0
  239. package/dist/types/runtime/admission.d.ts +1 -1
  240. package/dist/types/runtime/checkpoint.d.ts +1 -1
  241. package/dist/types/runtime/client.d.ts +2 -2
  242. package/dist/types/runtime/files.d.ts +4 -4
  243. package/dist/types/runtime/hostTools.d.ts +2 -2
  244. package/dist/types/runtime/index.d.ts +12 -12
  245. package/dist/types/runtime/model.d.ts +5 -5
  246. package/dist/types/runtime/policy.d.ts +3 -3
  247. package/dist/types/runtime/recovery/client.d.ts +3 -3
  248. package/dist/types/runtime/recovery/log.d.ts +2 -2
  249. package/dist/types/runtime/recovery/redis.d.ts +1 -1
  250. package/dist/types/runtime/recovery/server.d.ts +3 -3
  251. package/dist/types/runtime/resume.d.ts +1 -1
  252. package/dist/types/runtime/server.d.ts +3 -3
  253. package/dist/types/runtime/snapshot.d.ts +1 -1
  254. package/dist/types/runtime/types.d.ts +2 -2
  255. package/dist/types/session/AgentSession.d.ts +2 -2
  256. package/dist/types/session/JsonlSessionStore.d.ts +1 -1
  257. package/dist/types/session/deriveMessages.d.ts +1 -1
  258. package/dist/types/session/handlers.d.ts +1 -1
  259. package/dist/types/session/index.d.ts +7 -7
  260. package/dist/types/session/messageSerialization.d.ts +1 -1
  261. package/dist/types/session/sessionProjection.d.ts +3 -3
  262. package/dist/types/summarization/index.d.ts +2 -2
  263. package/dist/types/summarization/node.d.ts +2 -0
  264. package/dist/types/tools/BashProgrammaticToolCalling.d.ts +1 -1
  265. package/dist/types/tools/GitHubCompare.d.ts +6 -6
  266. package/dist/types/tools/ProgrammaticToolCalling.d.ts +1 -1
  267. package/dist/types/tools/ReadFile.d.ts +6 -6
  268. package/dist/types/tools/SkillTool.d.ts +6 -6
  269. package/dist/types/tools/ToolNode.d.ts +5 -1
  270. package/dist/types/tools/cloudflare/index.d.ts +4 -4
  271. package/dist/types/tools/local/FileCheckpointer.d.ts +1 -1
  272. package/dist/types/tools/local/LocalExecutionEngine.d.ts +1 -1
  273. package/dist/types/tools/local/attachments.d.ts +1 -1
  274. package/dist/types/tools/local/index.d.ts +12 -12
  275. package/dist/types/tools/search/anthropic.d.ts +1 -1
  276. package/dist/types/tools/search/content.d.ts +38 -1
  277. package/dist/types/tools/search/crw-scraper.d.ts +1 -1
  278. package/dist/types/tools/search/crw-search.d.ts +1 -1
  279. package/dist/types/tools/search/firecrawl.d.ts +1 -1
  280. package/dist/types/tools/search/format.d.ts +1 -1
  281. package/dist/types/tools/search/highlights.d.ts +1 -1
  282. package/dist/types/tools/search/index.d.ts +3 -3
  283. package/dist/types/tools/search/keenable-scraper.d.ts +1 -1
  284. package/dist/types/tools/search/keenable-search.d.ts +1 -1
  285. package/dist/types/tools/search/metrics.d.ts +1 -1
  286. package/dist/types/tools/search/rerankers.d.ts +1 -1
  287. package/dist/types/tools/search/schema.d.ts +6 -6
  288. package/dist/types/tools/search/search.d.ts +1 -1
  289. package/dist/types/tools/search/serper-scraper.d.ts +1 -1
  290. package/dist/types/tools/search/tavily-scraper.d.ts +1 -1
  291. package/dist/types/tools/search/tavily-search.d.ts +1 -1
  292. package/dist/types/tools/search/tool.d.ts +3 -3
  293. package/dist/types/tools/search/types.d.ts +2 -2
  294. package/dist/types/tools/search/utils.d.ts +3 -3
  295. package/dist/types/tools/subagent/SubagentExecutionRegistry.d.ts +1 -1
  296. package/dist/types/tools/subagent/SubagentExecutor.d.ts +9 -3
  297. package/dist/types/tools/subagent/diagnostics.d.ts +1 -1
  298. package/dist/types/tools/subagent/index.d.ts +7 -7
  299. package/dist/types/types/attachments.d.ts +25 -0
  300. package/dist/types/types/graph.d.ts +15 -0
  301. package/dist/types/types/index.d.ts +14 -13
  302. package/dist/types/types/llm.d.ts +2 -2
  303. package/dist/types/types/run.d.ts +7 -2
  304. package/dist/types/types/subagentTasks.d.ts +2 -2
  305. package/dist/types/types/tools.d.ts +6 -3
  306. package/dist/types/utils/events.d.ts +2 -1
  307. package/dist/types/utils/index.d.ts +10 -10
  308. package/dist/types/utils/tokens.d.ts +1 -0
  309. package/package.json +14 -12
  310. package/src/graphs/Graph.ts +32 -1
  311. package/src/index.ts +8 -0
  312. package/src/langfuse.ts +129 -41
  313. package/src/langfuseConfig.ts +14 -0
  314. package/src/langfuseToolOutputTracing.ts +5 -4
  315. package/src/langfuseTraceShaping.ts +49 -12
  316. package/src/llm/anthropic/index.ts +11 -3
  317. package/src/llm/anthropic/utils/container.ts +63 -0
  318. package/src/llm/anthropic/utils/message_inputs.ts +57 -51
  319. package/src/llm/anthropic/utils/message_outputs.ts +12 -39
  320. package/src/llm/anthropic/utils/stream_events.ts +17 -12
  321. package/src/llm/bedrock/index.ts +7 -5
  322. package/src/llm/bedrock/utils/message_inputs.ts +28 -35
  323. package/src/llm/google/utils/common.ts +88 -36
  324. package/src/llm/init.ts +35 -3
  325. package/src/llm/openai/index.ts +17 -2
  326. package/src/llm/openai/responseToolArguments.ts +104 -0
  327. package/src/llm/openrouter/index.ts +13 -0
  328. package/src/llm/prepareProviderRequest.ts +75 -13
  329. package/src/messages/anthropicServerTools.ts +24 -0
  330. package/src/messages/cache.ts +25 -5
  331. package/src/messages/core.ts +12 -11
  332. package/src/messages/toolResultTypes.ts +80 -88
  333. package/src/protection/providerText.ts +127 -40
  334. package/src/protection/toolResult.ts +272 -0
  335. package/src/run.ts +112 -47
  336. package/src/runtime/client.ts +7 -0
  337. package/src/stream.ts +7 -1
  338. package/src/summarization/node.ts +17 -4
  339. package/src/tools/ToolNode.ts +114 -18
  340. package/src/tools/search/content.ts +282 -62
  341. package/src/tools/subagent/SubagentExecutor.ts +12 -0
  342. package/src/types/attachments.ts +31 -0
  343. package/src/types/graph.ts +12 -0
  344. package/src/types/index.ts +1 -0
  345. package/src/types/run.ts +8 -1
  346. package/src/types/tools.ts +3 -0
  347. package/src/utils/events.ts +9 -2
  348. package/src/utils/tokens.ts +28 -2
@@ -1,4 +1,4 @@
1
- import type { BaseMessage } from '@langchain/core/messages';
1
+ import type { BaseMessage, MessageContentComplex } from '@langchain/core/messages';
2
2
  import type { RunnableConfig } from '@langchain/core/runnables';
3
3
  import type { ToolOutputReferenceRegistry } from '../tools/toolOutputReferences.js';
4
4
  import type { ToolHistoryPreparation } from '../messages/toolHistoryProjection.js';
@@ -27,7 +27,9 @@ export interface PreparedProviderRequest {
27
27
  export interface ProviderRequestContext {
28
28
  getOrCreateToolOutputRegistry?(): ToolOutputReferenceRegistry | undefined;
29
29
  isRunProducedMessage?(message: BaseMessage): boolean;
30
+ resolveAttachment?: t.AttachmentResolver;
30
31
  }
32
+ type ResolveReference = (reference: t.AttachmentReference) => MessageContentComplex | null | undefined;
31
33
  export interface PrepareProviderRequestParams {
32
34
  model: t.ChatModel;
33
35
  messages: BaseMessage[];
@@ -46,6 +48,7 @@ interface ProjectMessagesForProviderParams {
46
48
  maxToolResultChars?: number;
47
49
  callOptions?: unknown;
48
50
  toolHistory?: ToolHistoryPreparation;
51
+ resolve?: ResolveReference;
49
52
  }
50
53
  /** Produces the provider-facing representation before adapter serialization. */
51
54
  export declare function projectMessagesForProvider(params: ProjectMessagesForProviderParams): BaseMessage[];
@@ -1,5 +1,5 @@
1
1
  import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
2
- import type { ProviderFamily, ProviderRegistrationOptions } from '../provider-registration';
2
+ import type { ProviderFamily, ProviderRegistrationOptions } from '../provider-registration.js';
3
3
  import type { ProviderModelConstructor, ProviderName } from '../types/index.js';
4
4
  type ProviderModelClass = new (config: never) => BaseChatModel;
5
5
  /** Registers one host provider until the returned disposer is called. */
@@ -1,4 +1,4 @@
1
1
  import type { ProviderModelConstructor, ProviderName } from '../types/index.js';
2
2
  export declare const getChatModelClass: <P extends ProviderName>(provider: P) => ProviderModelConstructor<P>;
3
3
  export { getProviderFamily, providerRequiresStrictAlternation, providerUsesManualToolStream, registerProvider, } from './providerRegistry.js';
4
- export type { ProviderFamily, ProviderRegistrationOptions, } from '../provider-registration';
4
+ export type { ProviderFamily, ProviderRegistrationOptions, } from '../provider-registration.js';
@@ -0,0 +1,13 @@
1
+ export declare const ANTHROPIC_SERVER_TOOL_NAMES_BY_RESULT_TYPE: {
2
+ readonly advisor_tool_result: readonly ["advisor"];
3
+ readonly bash_code_execution_tool_result: readonly ["bash_code_execution"];
4
+ readonly code_execution_tool_result: readonly ["code_execution"];
5
+ readonly text_editor_code_execution_tool_result: readonly ["text_editor_code_execution"];
6
+ readonly tool_search_tool_result: readonly ["tool_search_tool_regex", "tool_search_tool_bm25"];
7
+ readonly web_fetch_tool_result: readonly ["web_fetch"];
8
+ readonly web_search_tool_result: readonly ["web_search"];
9
+ };
10
+ type AnthropicServerToolResultType = keyof typeof ANTHROPIC_SERVER_TOOL_NAMES_BY_RESULT_TYPE;
11
+ export declare const ANTHROPIC_SERVER_TOOL_RESULT_TYPES: AnthropicServerToolResultType[];
12
+ export declare function isAnthropicServerToolResultType(type: string | undefined): type is AnthropicServerToolResultType;
13
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { BaseMessage, MessageContentComplex } from '@langchain/core/messages';
2
+ import type Anthropic from '@anthropic-ai/sdk';
2
3
  import type { AnthropicMessage } from '../types/messages.js';
3
4
  type MessageWithContent = {
4
5
  content?: string | MessageContentComplex[];
@@ -91,6 +92,18 @@ export declare function cloneMessage<T extends MessageWithContent>(message: T, c
91
92
  * @returns - A new array of message objects with cache control added.
92
93
  */
93
94
  export declare function addCacheControl<T extends AnthropicMessage | BaseMessage>(messages: T[], ttl?: PromptCacheTtl): T[];
95
+ /**
96
+ * A block can anchor the tail cache breakpoint when it is a real content block
97
+ * that the Anthropic API accepts `cache_control` on and that survives provider
98
+ * conversion. Reasoning and dropped-delta blocks are excluded, and empty text
99
+ * blocks are not cacheable, so all are skipped.
100
+ */
101
+ export declare function isTailCacheableBlock(block: MessageContentComplex): boolean;
102
+ type CacheControl = NonNullable<Anthropic.TextBlockParam['cache_control']>;
103
+ /** The Anthropic cache breakpoint a block carries, if any. */
104
+ export declare function getCacheControl(block: MessageContentComplex): CacheControl | undefined;
105
+ /** `block` carrying `marker`, unless it already has a breakpoint of its own. */
106
+ export declare function withCacheControl<T extends MessageContentComplex>(block: T, marker: CacheControl): T;
94
107
  /**
95
108
  * Anthropic API: single tail cache breakpoint (default strategy).
96
109
  *
@@ -13,7 +13,7 @@
13
13
  * they fit; oversized inline payloads are replaced with bounded placeholders.
14
14
  */
15
15
  import { type BaseMessage } from '@langchain/core/messages';
16
- import type { ContextPruningSettings } from './contextPruningSettings';
16
+ import type { ContextPruningSettings } from './contextPruningSettings.js';
17
17
  import type { ContextPruningConfig } from '../types/graph.js';
18
18
  import type { TokenCounter } from '../types/run.js';
19
19
  export interface ContextPruningResult {
@@ -1,6 +1,6 @@
1
1
  import { AIMessage, BaseMessage, ToolMessage, HumanMessage, AIMessageChunk } from '@langchain/core/messages';
2
+ import type { ToolHistoryPreparation } from './toolHistoryProjection.js';
2
3
  import type * as t from '../types/index.js';
3
- import type { ToolHistoryPreparation } from './toolHistoryProjection';
4
4
  export declare function getConverseOverrideMessage({ userMessage, lastMessageX, lastMessageY, }: {
5
5
  userMessage: string[];
6
6
  lastMessageX: AIMessageChunk | null;
@@ -20,15 +20,15 @@ export declare function getConverseOverrideMessage({ userMessage, lastMessageX,
20
20
  * Exact matching prevents unrelated custom block types that happen to share a
21
21
  * prefix from being silently classified as hidden reasoning.
22
22
  */
23
- export { isReasoningContentBlock } from './reasoningTypes';
23
+ export { isReasoningContentBlock } from './reasoningTypes.js';
24
24
  export declare function modifyDeltaProperties(provider: t.ProviderName, obj?: AIMessageChunk): AIMessageChunk | undefined;
25
25
  export declare function formatAnthropicMessage(message: AIMessageChunk): AIMessage;
26
26
  export declare function convertMessagesToContent(messages: BaseMessage[]): t.MessageContentComplex[];
27
27
  type ResponsesReplayProjection = 'fallback' | 'native';
28
- export { OPENAI_RESPONSES_REPLAY_POSITIONS_KEY } from './toolHistoryProjection';
28
+ export { OPENAI_RESPONSES_REPLAY_POSITIONS_KEY } from './toolHistoryProjection.js';
29
29
  /** Reasoning item currently streaming, so a terminal ciphertext seals against its own id. */
30
30
  export declare const OPENAI_RESPONSES_ACTIVE_REASONING_ID_KEY = "__openai_responses_active_reasoning_id__";
31
- export type { ResponsesReplayPosition } from './toolHistoryProjection';
31
+ export type { ResponsesReplayPosition } from './toolHistoryProjection.js';
32
32
  /** Drops incomplete streamed text blocks before provider-facing tool shaping. */
33
33
  export declare function dropIncompleteToolStreamContent(content: AIMessage['content']): AIMessage['content'];
34
34
  /** Applies sealed-Responses safety and drops incomplete streamed text input. */
@@ -2,7 +2,7 @@ import { AIMessage, ToolMessage, BaseMessage, HumanMessage, SystemMessage } from
2
2
  import type { MessageContentImageUrl } from '@langchain/core/messages';
3
3
  import type { RunnableConfig } from '@langchain/core/runnables';
4
4
  import type { MessageContentComplex, TPayload, ProviderName, CompactionSemanticIndex, CompactionSemanticIndexSnapshot } from '../types/index.js';
5
- import type { ToolHistoryPreparation } from './toolHistoryProjection';
5
+ import type { ToolHistoryPreparation } from './toolHistoryProjection.js';
6
6
  import { Providers } from '../common/index.js';
7
7
  interface MediaMessageParams {
8
8
  message: {
@@ -1,21 +1,21 @@
1
- export * from './core';
2
- export * from './ids';
3
- export * from './prune';
4
- export { syncBudgetDerivedFields } from './budget';
5
- export * from './format';
6
- export * from './cache';
7
- export * from './anthropicToolCache';
8
- export * from './content';
9
- export * from './tools';
10
- export * from './injected';
11
- export * from './alternation';
12
- export * from './handoffCue';
13
- export * from './contextPruning';
14
- export * from './contextPruningSettings';
15
- export * from './reducer';
16
- export * from './recency';
17
- export * from './assistantPhase';
18
- export * from './provenance';
19
- export * from './projectionInvariant';
20
- export * from './fading';
21
- export { toStoredMessage } from './stored';
1
+ export * from './core.js';
2
+ export * from './ids.js';
3
+ export * from './prune.js';
4
+ export { syncBudgetDerivedFields } from './budget.js';
5
+ export * from './format.js';
6
+ export * from './cache.js';
7
+ export * from './anthropicToolCache.js';
8
+ export * from './content.js';
9
+ export * from './tools.js';
10
+ export * from './injected.js';
11
+ export * from './alternation.js';
12
+ export * from './handoffCue.js';
13
+ export * from './contextPruning.js';
14
+ export * from './contextPruningSettings.js';
15
+ export * from './reducer.js';
16
+ export * from './recency.js';
17
+ export * from './assistantPhase.js';
18
+ export * from './provenance.js';
19
+ export * from './projectionInvariant.js';
20
+ export * from './fading.js';
21
+ export { toStoredMessage } from './stored.js';
@@ -1,6 +1,6 @@
1
1
  import { BaseMessage, UsageMetadata } from '@langchain/core/messages';
2
2
  import type { ContextPruningConfig, FadingTier } from '../types/graph.js';
3
- import type { FadingCaps } from './fading';
3
+ import type { FadingCaps } from './fading.js';
4
4
  import type { TokenCounter } from '../types/run.js';
5
5
  import type { ProviderName } from '../types/index.js';
6
6
  import { ContentTypes } from '../common/index.js';
@@ -73,5 +73,5 @@ export declare function createChatCompletionUsageChunk(context: OpenAIResponseCo
73
73
  export declare function writeOpenAISSE(writer: OpenAICompatibleWriter, data: OpenAIChatCompletionChunk | '[DONE]'): Promise<void>;
74
74
  export declare function createOpenAIHandlers(config: OpenAIHandlerConfig): Record<string, t.EventHandler>;
75
75
  export declare function sendOpenAIFinalChunk(config: OpenAIHandlerConfig, finishReason?: OpenAIChatCompletionChunkChoice['finish_reason']): Promise<void>;
76
- export { createOpenAIToolCallStream } from './toolProjection';
77
- export type { OpenAIToolCallStream, OpenAIToolCallStreamConfig, } from './toolProjection';
76
+ export { createOpenAIToolCallStream } from './toolProjection.js';
77
+ export type { OpenAIToolCallStream, OpenAIToolCallStreamConfig, } from './toolProjection.js';
@@ -1,4 +1,4 @@
1
- import type { OpenAIChatCompletionChunkChoice, OpenAIToolCall, OpenAIStreamTracker } from './index';
1
+ import type { OpenAIChatCompletionChunkChoice, OpenAIToolCall, OpenAIStreamTracker } from './index.js';
2
2
  import type { EventHandler } from '../types/index.js';
3
3
  interface OpenAIToolCallStreamOptions {
4
4
  /** Synchronous framing only. Async transport/backpressure is a separate boundary. */
@@ -1,2 +1,2 @@
1
- export * from './collab';
2
- export * from './taskmanager';
1
+ export * from './collab.js';
2
+ export * from './taskmanager.js';
@@ -1,4 +1,4 @@
1
- import type { ProviderTextAdmission } from './providerTextAdmission';
1
+ import type { ProviderTextAdmission } from './providerTextAdmission.js';
2
2
  export declare const PROVIDER_TEXT_PROTECTION_VERSION = 1;
3
3
  export type ProviderTextProtectionErrorCode = 'blocked' | 'unavailable' | 'timeout' | 'overflow' | 'cancelled' | 'unsupported' | 'incompatible';
4
4
  export type ProviderTextProtectionResult = {
@@ -89,3 +89,5 @@ export declare class ProviderTextAttempt {
89
89
  release(): Promise<string>;
90
90
  finish(): void;
91
91
  }
92
+ /** Returns the canonical text of a host inspection result, or throws its failure code. */
93
+ export declare function readProviderTextResult(result: ProviderTextProtectionResult): string;
@@ -0,0 +1,69 @@
1
+ import { ToolMessage } from '@langchain/core/messages';
2
+ import type { ProviderTextProtection, ProviderTextProtectionResult, ProviderTextProtectionErrorCode } from './providerText.js';
3
+ import type { ToolExecuteResult } from '../types/tools.js';
4
+ import { ProviderTextProtectionError } from './providerText.js';
5
+ export declare const TOOL_RESULT_PROTECTION_VERSION = 1;
6
+ export type ToolResultProtectionResult = ProviderTextProtectionResult;
7
+ /**
8
+ * Host inspection of the text returned by selected tools. Default off.
9
+ *
10
+ * The SDK calls `inspect` on a selected tool's text before anything else reads
11
+ * it: hooks, completion events, the output reference registry, checkpoints and
12
+ * the model all receive the inspected text. A failed inspection ends the run
13
+ * with a {@link ToolResultProtectionError}.
14
+ *
15
+ * Trust boundary: the tool's text is untrusted data; code running in the host
16
+ * process is trusted. Tools, hooks, event handlers, callbacks and checkpoint
17
+ * savers are not defended against, text they author is not inspected, and
18
+ * history the host supplies is the host's to have inspected. Tracing observes
19
+ * a selected tool's raw result; redact those tools with the tracing
20
+ * configuration.
21
+ *
22
+ * Selected tools must return plain text. A structured result, an artifact or a
23
+ * `Command` fails as `unsupported`. Selected tools are not offered to
24
+ * programmatic tool calling, are not started eagerly, and cannot be client
25
+ * delegated. Unselected tools are untouched.
26
+ */
27
+ export interface ToolResultProtection {
28
+ readonly version: 1;
29
+ readonly toolNames: readonly string[];
30
+ readonly timeoutMs: number;
31
+ readonly maxAttemptBytes: number;
32
+ /** Shared across all inspections using this policy, including child graphs. */
33
+ readonly maxBufferedBytes: number;
34
+ readonly classify: (content: string) => 'prose' | 'unsupported';
35
+ readonly inspect: (input: {
36
+ readonly version: 1;
37
+ readonly content: string;
38
+ readonly toolName: string;
39
+ readonly toolCallId: string;
40
+ readonly target: {
41
+ readonly source: 'tool_argument';
42
+ readonly field: 'output';
43
+ readonly provenance: 'tool';
44
+ readonly outcome: ToolResultOutcome;
45
+ };
46
+ readonly signal: AbortSignal;
47
+ }) => ToolResultProtectionResult | Promise<ToolResultProtectionResult>;
48
+ }
49
+ export declare class ToolResultProtectionError extends ProviderTextProtectionError {
50
+ constructor(code: ProviderTextProtectionErrorCode);
51
+ }
52
+ export type ToolResultOutcome = 'success' | 'error';
53
+ export interface ToolResultCall {
54
+ readonly name: string;
55
+ readonly id: string;
56
+ }
57
+ /** A validated policy. One per policy object, so every graph of a run shares its byte budget. */
58
+ export interface ToolResultGate {
59
+ readonly policy: ToolResultProtection;
60
+ readonly toolNames: ReadonlySet<string>;
61
+ readonly budget: ProviderTextProtection;
62
+ }
63
+ export declare function createToolResultGate(policy: ToolResultProtection): ToolResultGate;
64
+ /** Returns the inspected text, or throws; the raw text and inspector errors never leave. */
65
+ export declare function inspectToolText(gate: ToolResultGate, call: ToolResultCall, content: string, outcome: ToolResultOutcome, signal?: AbortSignal): Promise<string>;
66
+ /** Inspects what a selected in-process tool returned. */
67
+ export declare function inspectToolOutput(gate: ToolResultGate, call: ToolResultCall, output: unknown, signal?: AbortSignal): Promise<ToolMessage | string>;
68
+ /** Inspects what the host returned for a selected tool call. */
69
+ export declare function inspectToolExecuteResult(gate: ToolResultGate, call: ToolResultCall, result: ToolExecuteResult, signal?: AbortSignal): Promise<ToolExecuteResult>;
@@ -12,4 +12,4 @@ export interface ProviderRegistrationOptions<TOptions extends object, TModel ext
12
12
  manualToolStream?: boolean;
13
13
  strictAlternation?: boolean;
14
14
  }
15
- export { registerProvider } from './llm/providers';
15
+ export { registerProvider } from './llm/providers.js';
@@ -1,4 +1,4 @@
1
- import type { OutcomeReranker } from './types';
1
+ import type { OutcomeReranker } from './types.js';
2
2
  /**
3
3
  * Codegraph's measured BM25 tokenizer for code and its prose: camelCase,
4
4
  * snake_case, kebab-case, dotted names, and paths split into words, which
@@ -5,20 +5,20 @@
5
5
  * import. The web-search adapter stays on the root entry because it extends
6
6
  * the search tool's reranker.
7
7
  */
8
- export type * from './types';
9
- export { createSystemOneReranker } from './systemone';
10
- export type { SystemOnePin, SystemOneMode, SystemOneReranker, SystemOneRerankerOptions, } from './systemone';
11
- export { createCrossEncoderReranker } from './crossEncoder';
12
- export type { CrossEncoderRerankerOptions } from './crossEncoder';
13
- export { createBm25Reranker, corpusStats, tokenizeCode } from './bm25';
14
- export type { Bm25RerankerOptions, CorpusStats, Tokenize } from './bm25';
15
- export { noneReranker, withFallback, STEP_GRACE_MS } from './fallback';
16
- export type { FallbackStep, FallbackOptions, FallbackReranker, } from './fallback';
17
- export { probePin, PIN_SENTINEL_MODEL } from './pin';
18
- export type { PinProbe, PinProbeOptions } from './pin';
19
- export { createSemaphore } from './semaphore';
20
- export type { RerankSemaphore } from './semaphore';
21
- export { createScoreCache } from './cache';
22
- export type { RerankCacheKey, RerankScoreCache, MemoryScoreCache, ScoreCacheOptions, } from './cache';
23
- export { rerankCost, rankedEntries, estimatedUsage, identityOutcome, emptyRerankUsage, toOutcomeReranker, isRerankPermutation, ESTIMATED_TOKENS_PER_DOCUMENT, } from './outcome';
24
- export type { RerankCost, RerankPrice, RerankPrices } from './outcome';
8
+ export type * from './types.js';
9
+ export { createSystemOneReranker } from './systemone.js';
10
+ export type { SystemOnePin, SystemOneMode, SystemOneReranker, SystemOneRerankerOptions, } from './systemone.js';
11
+ export { createCrossEncoderReranker } from './crossEncoder.js';
12
+ export type { CrossEncoderRerankerOptions } from './crossEncoder.js';
13
+ export { createBm25Reranker, corpusStats, tokenizeCode } from './bm25.js';
14
+ export type { Bm25RerankerOptions, CorpusStats, Tokenize } from './bm25.js';
15
+ export { noneReranker, withFallback, STEP_GRACE_MS } from './fallback.js';
16
+ export type { FallbackStep, FallbackOptions, FallbackReranker, } from './fallback.js';
17
+ export { probePin, PIN_SENTINEL_MODEL } from './pin.js';
18
+ export type { PinProbe, PinProbeOptions } from './pin.js';
19
+ export { createSemaphore } from './semaphore.js';
20
+ export type { RerankSemaphore } from './semaphore.js';
21
+ export { createScoreCache } from './cache.js';
22
+ export type { RerankCacheKey, RerankScoreCache, MemoryScoreCache, ScoreCacheOptions, } from './cache.js';
23
+ export { rerankCost, rankedEntries, estimatedUsage, identityOutcome, emptyRerankUsage, toOutcomeReranker, isRerankPermutation, ESTIMATED_TOKENS_PER_DOCUMENT, } from './outcome.js';
24
+ export type { RerankCost, RerankPrice, RerankPrices } from './outcome.js';
@@ -1,6 +1,6 @@
1
- import type { OutcomeReranker } from './types';
2
- import type { DecisionCredential } from '../decisions/types';
3
- import type { DecisionFetch } from '../decisions/transport';
1
+ import type { OutcomeReranker } from './types.js';
2
+ import type { DecisionCredential } from '../decisions/types.js';
3
+ import type { DecisionFetch } from '../decisions/transport.js';
4
4
  export interface CrossEncoderRerankerOptions {
5
5
  /**
6
6
  * Full URL of a Cohere-shaped rerank endpoint: Cohere's `/v2/rerank`,
@@ -1,4 +1,4 @@
1
- import type { RerankOutcome, OutcomeReranker } from './types';
1
+ import type { RerankOutcome, OutcomeReranker } from './types.js';
2
2
  /**
3
3
  * Identity order, never a request: the last step of a chain, or the whole
4
4
  * chain when nothing is configured. Its one attempt is `skipped` with
@@ -1,2 +1,2 @@
1
- export * from './core';
2
- export { createWebSearchReranker } from './search';
1
+ export * from './core.js';
2
+ export { createWebSearchReranker } from './search.js';
@@ -1,5 +1,5 @@
1
- import type { Reranker, RerankKind, RerankEntry, RerankUsage, RerankReason, RerankOutcome, OutcomeReranker } from './types';
2
- import { DecisionError } from '../decisions/types';
1
+ import type { Reranker, RerankKind, RerankEntry, RerankUsage, RerankReason, RerankOutcome, OutcomeReranker } from './types.js';
2
+ import { DecisionError } from '../decisions/types.js';
3
3
  /** Longest deadline a step may have; matches `withDecisionDeadline`. */
4
4
  export declare const MAX_RERANK_DEADLINE_MS = 3600000;
5
5
  /**
@@ -1,5 +1,5 @@
1
- import type { DecisionModel } from '../decisions/types';
2
- import type { RerankReason } from './types';
1
+ import type { DecisionModel } from '../decisions/types.js';
2
+ import type { RerankReason } from './types.js';
3
3
  /** A model id no host serves: a host that answers it echoes whatever it is asked, so its echo proves nothing. */
4
4
  export declare const PIN_SENTINEL_MODEL = "jev-0.0.0-pin-sentinel";
5
5
  export interface PinProbeOptions {
@@ -1,5 +1,5 @@
1
1
  import type { Logger, SearchReranker } from '../tools/search/types.js';
2
- import type { Reranker } from './types';
2
+ import type { Reranker } from './types.js';
3
3
  /** Adapts index-based rankings to web-search highlights and its existing metrics/fallback policy. */
4
4
  export declare function createWebSearchReranker(reranker: Reranker, options?: {
5
5
  timeoutMs?: number;
@@ -1,7 +1,7 @@
1
- import type { Reranker, OutcomeReranker } from './types';
2
- import type { DecisionText, DecisionState, DecisionModel } from '../decisions/types';
3
- import type { RerankScoreCache } from './cache';
4
- import type { RerankSemaphore } from './semaphore';
1
+ import type { Reranker, OutcomeReranker } from './types.js';
2
+ import type { DecisionText, DecisionState, DecisionModel } from '../decisions/types.js';
3
+ import type { RerankScoreCache } from './cache.js';
4
+ import type { RerankSemaphore } from './semaphore.js';
5
5
  /**
6
6
  * `document` (the default) asks one score question per candidate, one request
7
7
  * each. `batch` asks every candidate in one request; its scores follow input
@@ -1,4 +1,4 @@
1
- import type { DecisionUsage } from '../decisions/types';
1
+ import type { DecisionUsage } from '../decisions/types.js';
2
2
  export interface RerankRequest {
3
3
  query: string;
4
4
  documents: readonly string[];
@@ -22,6 +22,8 @@ export declare class Run<_T extends t.BaseGraphState> {
22
22
  private preemption?;
23
23
  private maxStopContinuations;
24
24
  private providerTextProtection?;
25
+ private toolResultProtection?;
26
+ private resolveAttachment?;
25
27
  private streamLimits?;
26
28
  private subagentTasks?;
27
29
  private subagentContext?;
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import type { Callbacks } from '@langchain/core/callbacks/manager';
3
3
  import type { BaseCallbackHandler } from '@langchain/core/callbacks/base';
4
- import type { SdkRpc } from './peer';
4
+ import type { SdkRpc } from './peer.js';
5
5
  import { HostChatModel } from '../index.js';
6
6
  export interface RemoteModelAttempt {
7
7
  nodeId: string;
@@ -1,4 +1,4 @@
1
- import type { SdkRpc } from './peer';
1
+ import type { SdkRpc } from './peer.js';
2
2
  import { BaseCheckpointSaver } from '../index.js';
3
3
  type Saver = BaseCheckpointSaver;
4
4
  /** The host retains its durable saver; the worker never receives database credentials. */
@@ -1,6 +1,6 @@
1
1
  import type { RunConfig } from '../index.js';
2
- import type { RemoteSdkHostServices, RemoteSdkOptions, RemoteSdkResumeState } from './types';
3
- import type { SdkAgentIdentity } from './identity';
2
+ import type { RemoteSdkHostServices, RemoteSdkOptions, RemoteSdkResumeState } from './types.js';
3
+ import type { SdkAgentIdentity } from './identity.js';
4
4
  import { Run } from '../index.js';
5
5
  /** Construct a real local Run whose execution is delegated to one operator-trusted runtime. */
6
6
  export declare function createRemoteSdkRun({ config, identity, remote, resumeState, hostServices, }: {
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import type { HostFileDescriptor, HostFileBindings } from '../index.js';
3
- import type { RemoteSdkHostServices, RemoteSdkLimits, RemoteSdkStart } from './types';
4
- import type { SdkAgentIdentity } from './identity';
5
- import type { SdkRpc } from './peer';
3
+ import type { RemoteSdkHostServices, RemoteSdkLimits, RemoteSdkStart } from './types.js';
4
+ import type { SdkAgentIdentity } from './identity.js';
5
+ import type { SdkRpc } from './peer.js';
6
6
  export declare const fileChannelSchema: z.ZodObject<{
7
7
  version: z.ZodLiteral<1>;
8
8
  publicKey: z.ZodString;
@@ -33,8 +33,8 @@ declare const resultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
33
33
  version: z.ZodLiteral<1>;
34
34
  ok: z.ZodLiteral<false>;
35
35
  code: z.ZodEnum<{
36
- unavailable: "unavailable";
37
36
  timeout: "timeout";
37
+ unavailable: "unavailable";
38
38
  overflow: "overflow";
39
39
  cancelled: "cancelled";
40
40
  incompatible: "incompatible";
@@ -1,6 +1,6 @@
1
1
  import type { EventHandler, HostToolDescriptor, HostToolService, ToolExecuteResult } from '../index.js';
2
- import type { SdkAgentIdentity } from './identity';
3
- import type { SdkRpc } from './peer';
2
+ import type { SdkAgentIdentity } from './identity.js';
3
+ import type { SdkRpc } from './peer.js';
4
4
  /** Local credentials/configuration are supplied by the authenticated host, never by the worker. */
5
5
  export declare function createHostToolService(options: {
6
6
  identity: Readonly<SdkAgentIdentity>;
@@ -1,12 +1,12 @@
1
- export { createRemoteSdkServer } from './server';
2
- export { createRemoteSdkRun } from './client';
3
- export { createRedisRuntimeJournal } from './recovery/redis';
4
- export type { RemoteSdkServerOptions } from './server';
5
- export type { SdkAgentIdentity } from './identity';
6
- export type { RemoteSdkFactoryInput, RemoteSdkHostServices, RemoteSdkOptions, RemoteSdkResumeState, RemoteSdkLimits, RemoteSdkModelProfile, } from './types';
7
- export type { HostModelLifecycle, RemoteModelAttempt } from './admission';
8
- export type { RuntimeJournalRedis, RuntimeJournalLimits, } from './recovery/redis';
9
- export type { RuntimeJournal, RuntimeJournalSession, RuntimeJournalLease, RuntimeJournalResult, RuntimeJournalState, RuntimeJournalFailure, } from './recovery/journal';
10
- export type { RuntimeRecoveryOptions } from './recovery/server';
11
- export type { RemoteSdkRecoveryOptions } from './types';
12
- export { normalizeResumeRunStepIndices, hydrateResumeRunSteps, createContentIndexOffsetHandlers, } from './resume';
1
+ export { createRemoteSdkServer } from './server.js';
2
+ export { createRemoteSdkRun } from './client.js';
3
+ export { createRedisRuntimeJournal } from './recovery/redis.js';
4
+ export type { RemoteSdkServerOptions } from './server.js';
5
+ export type { SdkAgentIdentity } from './identity.js';
6
+ export type { RemoteSdkFactoryInput, RemoteSdkHostServices, RemoteSdkOptions, RemoteSdkResumeState, RemoteSdkLimits, RemoteSdkModelProfile, } from './types.js';
7
+ export type { HostModelLifecycle, RemoteModelAttempt } from './admission.js';
8
+ export type { RuntimeJournalRedis, RuntimeJournalLimits, } from './recovery/redis.js';
9
+ export type { RuntimeJournal, RuntimeJournalSession, RuntimeJournalLease, RuntimeJournalResult, RuntimeJournalState, RuntimeJournalFailure, } from './recovery/journal.js';
10
+ export type { RuntimeRecoveryOptions } from './recovery/server.js';
11
+ export type { RemoteSdkRecoveryOptions } from './types.js';
12
+ export { normalizeResumeRunStepIndices, hydrateResumeRunSteps, createContentIndexOffsetHandlers, } from './resume.js';
@@ -1,9 +1,9 @@
1
- import type { RemoteSdkFactoryInput, RemoteSdkHostServices, RemoteSdkLimits, RemoteSdkStart } from './types';
1
+ import type { RemoteSdkFactoryInput, RemoteSdkHostServices, RemoteSdkLimits, RemoteSdkStart } from './types.js';
2
2
  import type { HostModelErrorCode } from '../index.js';
3
- import type { HostModelLifecycle, WorkerModelLifecycle } from './admission';
4
- import type { SdkAgentIdentity } from './identity';
5
- import type { SdkRpc } from './peer';
6
- import { createPolicySender } from './sealed';
3
+ import type { HostModelLifecycle, WorkerModelLifecycle } from './admission.js';
4
+ import type { SdkAgentIdentity } from './identity.js';
5
+ import type { SdkRpc } from './peer.js';
6
+ import { createPolicySender } from './sealed.js';
7
7
  type ModelFailure = {
8
8
  version: 1;
9
9
  ok: false;
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import type { HostProviderTextDescriptor, ProviderTextProtectionErrorCode, ProviderTextProtection } from '../index.js';
3
- import type { RemoteSdkHostServices, RemoteSdkStart, RemoteSdkLimits } from './types';
4
- import type { SdkAgentIdentity } from './identity';
5
- import type { SdkRpc } from './peer';
3
+ import type { RemoteSdkHostServices, RemoteSdkStart, RemoteSdkLimits } from './types.js';
4
+ import type { SdkAgentIdentity } from './identity.js';
5
+ import type { SdkRpc } from './peer.js';
6
6
  export declare const policyDescriptorSchema: z.ZodObject<{
7
7
  version: z.ZodLiteral<1>;
8
8
  publicKey: z.ZodString;
@@ -1,6 +1,6 @@
1
- import type { RemoteSdkLimits, RemoteSdkRecoveryOptions } from '../types';
2
- import type { RecoveryClaim } from './server';
3
- import { RecoverySocket } from './socket';
1
+ import type { RemoteSdkLimits, RemoteSdkRecoveryOptions } from '../types.js';
2
+ import type { RecoveryClaim } from './server.js';
3
+ import { RecoverySocket } from './socket.js';
4
4
  export declare function connectRecoveringSdkSocket(options: {
5
5
  url: string;
6
6
  token: (claim: RecoveryClaim) => string;
@@ -1,5 +1,5 @@
1
- import type { RuntimeJournal, RuntimeJournalLease, RuntimeJournalSession, RuntimeJournalResult } from './journal';
2
- import type { RecoveryLog } from './socket';
1
+ import type { RuntimeJournal, RuntimeJournalLease, RuntimeJournalSession, RuntimeJournalResult } from './journal.js';
2
+ import type { RecoveryLog } from './socket.js';
3
3
  export declare function journalValue<T>(result: RuntimeJournalResult<T>): T;
4
4
  export declare function createJournalRecoveryLog(options: {
5
5
  journal: RuntimeJournal;
@@ -1,4 +1,4 @@
1
- import type { RuntimeJournal } from './journal';
1
+ import type { RuntimeJournal } from './journal.js';
2
2
  /** Operator-supplied client; no app singleton or credentials cross the runtime boundary. */
3
3
  export interface RuntimeJournalRedis {
4
4
  evalsha?(sha: string, numberOfKeys: number, ...args: Array<string | number>): Promise<unknown>;
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import type { WebSocket } from 'ws';
3
- import type { RuntimeJournal, RuntimeJournalState } from './journal';
4
- import type { SdkAgentIdentity } from '../identity';
5
- import { RecoverySocket } from './socket';
3
+ import type { RuntimeJournal, RuntimeJournalState } from './journal.js';
4
+ import type { SdkAgentIdentity } from '../identity.js';
5
+ import { RecoverySocket } from './socket.js';
6
6
  export interface RecoveryClaim {
7
7
  ownerId?: string;
8
8
  sessionId: string;
@@ -1,5 +1,5 @@
1
1
  import type { EventHandler, MessageContentComplex, RunStep } from '../index.js';
2
- import type { RemoteSdkSnapshot } from './types';
2
+ import type { RemoteSdkSnapshot } from './types.js';
3
3
  type ResumableRunStep = {
4
4
  id: string;
5
5
  index: number;
@@ -1,7 +1,7 @@
1
1
  import type { Server } from 'node:http';
2
- import type { RemoteSdkFactoryInput, RemoteSdkLimits, SdkRun } from './types';
3
- import type { RuntimeRecoveryOptions } from './recovery/server';
4
- import type { SdkAgentIdentity } from './identity';
2
+ import type { RemoteSdkFactoryInput, RemoteSdkLimits, SdkRun } from './types.js';
3
+ import type { RuntimeRecoveryOptions } from './recovery/server.js';
4
+ import type { SdkAgentIdentity } from './identity.js';
5
5
  export interface RemoteSdkServerOptions extends Partial<RemoteSdkLimits> {
6
6
  recovery?: RuntimeRecoveryOptions;
7
7
  runtimeId: string;
@@ -1,4 +1,4 @@
1
- import type { RemoteSdkSnapshot, RemoteSdkLimits } from './types';
1
+ import type { RemoteSdkSnapshot, RemoteSdkLimits } from './types.js';
2
2
  /** One bounded transfer per execution; chunks precede the terminal receipt in the ordered durable stream. */
3
3
  export declare function createSnapshotReceiver(maxBytes: number): {
4
4
  accept(data: unknown): null;