@nhtio/adk 1.20260913.0 → 1.20260924.0

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 (604) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/adk-mcp.cjs +2 -2
  3. package/{arg_specs-iYmIM3wI.js → arg_specs-iYmIM3wI.cjs} +1 -1
  4. package/arg_specs-iYmIM3wI.cjs.map +1 -0
  5. package/artifact_methods-7KatxCSd.cjs +1 -0
  6. package/artifact_methods-q52ETLwI.mjs +1 -0
  7. package/batteries/artifacts/ecmascript.cjs +2 -2
  8. package/batteries/artifacts/ecmascript.mjs +1 -1
  9. package/batteries/artifacts/toon.cjs +2 -2
  10. package/batteries/artifacts/toon.mjs +1 -1
  11. package/batteries/artifacts/xml.cjs +2 -2
  12. package/batteries/artifacts/xml.mjs +1 -1
  13. package/batteries/artifacts/yaml.cjs +2 -2
  14. package/batteries/artifacts/yaml.mjs +1 -1
  15. package/batteries/artifacts.cjs +5 -5
  16. package/batteries/artifacts.mjs +4 -4
  17. package/batteries/context/compact/contracts.cjs +1 -1
  18. package/batteries/context/compact/summarizer.cjs +1 -1
  19. package/batteries/context/compact.cjs +1 -1
  20. package/batteries/context/exceptions.cjs +2 -2
  21. package/batteries/context/thrift/contracts.cjs +1 -1
  22. package/batteries/context/thrift/relevance.cjs +1 -1
  23. package/batteries/context/thrift/subtractive_pass.cjs +1 -1
  24. package/batteries/context/thrift.cjs +1 -1
  25. package/batteries/context.cjs +1 -1
  26. package/batteries/dev-tools/conformance.cjs +2 -2
  27. package/batteries/dev-tools/forge.cjs +5 -5
  28. package/batteries/dev-tools/forge.mjs +3 -3
  29. package/batteries/dev-tools.cjs +10 -10
  30. package/batteries/dev-tools.mjs +3 -3
  31. package/batteries/embeddings/ollama/adapter.cjs +2 -2
  32. package/batteries/embeddings/ollama/exceptions.cjs +2 -2
  33. package/batteries/embeddings/ollama/types.cjs +1 -1
  34. package/batteries/embeddings/ollama/validation.cjs +1 -1
  35. package/batteries/embeddings/ollama.cjs +1 -1
  36. package/batteries/embeddings/openai/adapter.cjs +2 -2
  37. package/batteries/embeddings/openai/exceptions.cjs +2 -2
  38. package/batteries/embeddings/openai/helpers.cjs +1 -1
  39. package/batteries/embeddings/openai/types.cjs +1 -1
  40. package/batteries/embeddings/openai/validation.cjs +1 -1
  41. package/batteries/embeddings/openai.cjs +1 -1
  42. package/batteries/embeddings/transformers_js/adapter.cjs +3 -3
  43. package/batteries/embeddings/transformers_js/exceptions.cjs +2 -2
  44. package/batteries/embeddings/transformers_js/pooling.cjs +1 -1
  45. package/batteries/embeddings/transformers_js/types.cjs +1 -1
  46. package/batteries/embeddings/transformers_js/validation.cjs +2 -2
  47. package/batteries/embeddings/transformers_js.cjs +1 -1
  48. package/batteries/embeddings/webllm/adapter.cjs +2 -2
  49. package/batteries/embeddings/webllm/exceptions.cjs +2 -2
  50. package/batteries/embeddings/webllm/types.cjs +1 -1
  51. package/batteries/embeddings/webllm/validation.cjs +1 -1
  52. package/batteries/embeddings/webllm.cjs +1 -1
  53. package/batteries/embeddings.cjs +1 -1
  54. package/batteries/encoding.cjs +8 -8
  55. package/batteries/encoding.mjs +6 -6
  56. package/batteries/generation/_shared.cjs +2 -2
  57. package/batteries/generation/gemini/adapter.cjs +3 -3
  58. package/batteries/generation/gemini/adapter.mjs +1 -1
  59. package/batteries/generation/gemini/exceptions.cjs +2 -2
  60. package/batteries/generation/gemini/types.cjs +1 -1
  61. package/batteries/generation/gemini/validation.cjs +1 -1
  62. package/batteries/generation/gemini.cjs +1 -1
  63. package/batteries/generation/local_diffusion/adapter.cjs +4 -4
  64. package/batteries/generation/local_diffusion/adapter.mjs +1 -1
  65. package/batteries/generation/local_diffusion/exceptions.cjs +2 -2
  66. package/batteries/generation/local_diffusion/protocol.cjs +2 -2
  67. package/batteries/generation/local_diffusion/types.cjs +1 -1
  68. package/batteries/generation/local_diffusion/validation.cjs +1 -1
  69. package/batteries/generation/local_diffusion.cjs +1 -1
  70. package/batteries/generation/openai/adapter.cjs +3 -3
  71. package/batteries/generation/openai/adapter.mjs +1 -1
  72. package/batteries/generation/openai/exceptions.cjs +2 -2
  73. package/batteries/generation/openai/types.cjs +1 -1
  74. package/batteries/generation/openai/validation.cjs +1 -1
  75. package/batteries/generation/openai.cjs +1 -1
  76. package/batteries/generation/transformers_js/adapter.cjs +3 -3
  77. package/batteries/generation/transformers_js/exceptions.cjs +2 -2
  78. package/batteries/generation/transformers_js/helpers.cjs +1 -1
  79. package/batteries/generation/transformers_js/types.cjs +1 -1
  80. package/batteries/generation/transformers_js/validation.cjs +2 -2
  81. package/batteries/generation/transformers_js.cjs +1 -1
  82. package/batteries/generation.cjs +1 -1
  83. package/batteries/isolation/child_process.cjs +3 -3
  84. package/batteries/isolation.cjs +2 -2
  85. package/batteries/llm/anthropic_messages/adapter.cjs +10 -10
  86. package/batteries/llm/anthropic_messages/adapter.mjs +6 -6
  87. package/batteries/llm/anthropic_messages/count_tokens.cjs +4 -4
  88. package/batteries/llm/anthropic_messages/count_tokens.mjs +1 -1
  89. package/batteries/llm/anthropic_messages/error_translation.cjs +2 -2
  90. package/batteries/llm/anthropic_messages/exceptions.cjs +2 -2
  91. package/batteries/llm/anthropic_messages/helpers.cjs +4 -4
  92. package/batteries/llm/anthropic_messages/helpers.mjs +3 -3
  93. package/batteries/llm/anthropic_messages/types.cjs +1 -1
  94. package/batteries/llm/anthropic_messages/validation.cjs +3 -3
  95. package/batteries/llm/anthropic_messages/validation.mjs +1 -1
  96. package/batteries/llm/anthropic_messages.cjs +4 -4
  97. package/batteries/llm/anthropic_messages.mjs +2 -2
  98. package/batteries/llm/bedrock_converse/adapter.cjs +9 -9
  99. package/batteries/llm/bedrock_converse/adapter.mjs +6 -6
  100. package/batteries/llm/bedrock_converse/exceptions.cjs +2 -2
  101. package/batteries/llm/bedrock_converse/helpers.cjs +3 -3
  102. package/batteries/llm/bedrock_converse/helpers.mjs +1 -1
  103. package/batteries/llm/bedrock_converse/types.cjs +1 -1
  104. package/batteries/llm/bedrock_converse/validation.cjs +3 -3
  105. package/batteries/llm/bedrock_converse/validation.mjs +1 -1
  106. package/batteries/llm/bedrock_converse.cjs +3 -3
  107. package/batteries/llm/bedrock_converse.mjs +2 -2
  108. package/batteries/llm/chat_common/exceptions.cjs +2 -2
  109. package/batteries/llm/claude_code_cli/adapter.cjs +290 -31
  110. package/batteries/llm/claude_code_cli/adapter.cjs.map +1 -1
  111. package/batteries/llm/claude_code_cli/adapter.d.ts +125 -0
  112. package/batteries/llm/claude_code_cli/adapter.mjs +288 -31
  113. package/batteries/llm/claude_code_cli/adapter.mjs.map +1 -1
  114. package/batteries/llm/claude_code_cli/exceptions.cjs +13 -2
  115. package/batteries/llm/claude_code_cli/exceptions.cjs.map +1 -1
  116. package/batteries/llm/claude_code_cli/exceptions.d.ts +12 -0
  117. package/batteries/llm/claude_code_cli/exceptions.mjs +11 -1
  118. package/batteries/llm/claude_code_cli/exceptions.mjs.map +1 -1
  119. package/batteries/llm/claude_code_cli/helpers.cjs +4 -4
  120. package/batteries/llm/claude_code_cli/helpers.mjs +3 -3
  121. package/batteries/llm/claude_code_cli/index.d.ts +3 -2
  122. package/batteries/llm/claude_code_cli/types.cjs +1 -1
  123. package/batteries/llm/claude_code_cli/types.d.ts +36 -2
  124. package/batteries/llm/claude_code_cli/validation.cjs +4 -3
  125. package/batteries/llm/claude_code_cli/validation.cjs.map +1 -1
  126. package/batteries/llm/claude_code_cli/validation.mjs +2 -1
  127. package/batteries/llm/claude_code_cli/validation.mjs.map +1 -1
  128. package/batteries/llm/claude_code_cli/wire.cjs +1 -1
  129. package/batteries/llm/claude_code_cli.cjs +5 -2
  130. package/batteries/llm/claude_code_cli.mjs +4 -3
  131. package/batteries/llm/gemini_generate_content/adapter.cjs +9 -9
  132. package/batteries/llm/gemini_generate_content/adapter.mjs +6 -6
  133. package/batteries/llm/gemini_generate_content/exceptions.cjs +2 -2
  134. package/batteries/llm/gemini_generate_content/helpers.cjs +3 -3
  135. package/batteries/llm/gemini_generate_content/helpers.mjs +1 -1
  136. package/batteries/llm/gemini_generate_content/types.cjs +1 -1
  137. package/batteries/llm/gemini_generate_content/validation.cjs +3 -3
  138. package/batteries/llm/gemini_generate_content/validation.mjs +1 -1
  139. package/batteries/llm/gemini_generate_content.cjs +2 -2
  140. package/batteries/llm/gemini_generate_content.mjs +1 -1
  141. package/batteries/llm/index.d.ts +1 -1
  142. package/batteries/llm/litert_lm/adapter.cjs +11 -11
  143. package/batteries/llm/litert_lm/adapter.mjs +6 -6
  144. package/batteries/llm/litert_lm/exceptions.cjs +2 -2
  145. package/batteries/llm/litert_lm/helpers.cjs +7 -7
  146. package/batteries/llm/litert_lm/helpers.mjs +3 -3
  147. package/batteries/llm/litert_lm/types.cjs +1 -1
  148. package/batteries/llm/litert_lm/validation.cjs +4 -4
  149. package/batteries/llm/litert_lm/validation.mjs +2 -2
  150. package/batteries/llm/litert_lm.cjs +5 -5
  151. package/batteries/llm/litert_lm.mjs +1 -1
  152. package/batteries/llm/ollama/adapter.cjs +9 -9
  153. package/batteries/llm/ollama/adapter.mjs +6 -6
  154. package/batteries/llm/ollama/exceptions.cjs +2 -2
  155. package/batteries/llm/ollama/helpers.cjs +5 -5
  156. package/batteries/llm/ollama/helpers.mjs +4 -4
  157. package/batteries/llm/ollama/types.cjs +1 -1
  158. package/batteries/llm/ollama/validation.cjs +3 -3
  159. package/batteries/llm/ollama/validation.mjs +1 -1
  160. package/batteries/llm/ollama.cjs +3 -3
  161. package/batteries/llm/ollama.mjs +2 -2
  162. package/batteries/llm/openai_chat_completions/adapter.cjs +9 -9
  163. package/batteries/llm/openai_chat_completions/adapter.mjs +6 -6
  164. package/batteries/llm/openai_chat_completions/exceptions.cjs +2 -2
  165. package/batteries/llm/openai_chat_completions/helpers.cjs +5 -5
  166. package/batteries/llm/openai_chat_completions/helpers.mjs +4 -4
  167. package/batteries/llm/openai_chat_completions/types.cjs +1 -1
  168. package/batteries/llm/openai_chat_completions/validation.cjs +3 -3
  169. package/batteries/llm/openai_chat_completions/validation.mjs +1 -1
  170. package/batteries/llm/openai_chat_completions.cjs +3 -3
  171. package/batteries/llm/openai_chat_completions.mjs +2 -2
  172. package/batteries/llm/openai_responses/adapter.cjs +9 -9
  173. package/batteries/llm/openai_responses/adapter.mjs +6 -6
  174. package/batteries/llm/openai_responses/exceptions.cjs +2 -2
  175. package/batteries/llm/openai_responses/helpers.cjs +4 -4
  176. package/batteries/llm/openai_responses/helpers.mjs +3 -3
  177. package/batteries/llm/openai_responses/types.cjs +1 -1
  178. package/batteries/llm/openai_responses/validation.cjs +3 -3
  179. package/batteries/llm/openai_responses/validation.mjs +1 -1
  180. package/batteries/llm/openai_responses.cjs +3 -3
  181. package/batteries/llm/openai_responses.mjs +2 -2
  182. package/batteries/llm/transformers_js/adapter.cjs +11 -11
  183. package/batteries/llm/transformers_js/adapter.mjs +6 -6
  184. package/batteries/llm/transformers_js/exceptions.cjs +2 -2
  185. package/batteries/llm/transformers_js/helpers.cjs +8 -8
  186. package/batteries/llm/transformers_js/helpers.mjs +3 -3
  187. package/batteries/llm/transformers_js/model_source.cjs +2 -2
  188. package/batteries/llm/transformers_js/types.cjs +1 -1
  189. package/batteries/llm/transformers_js/validation.cjs +4 -4
  190. package/batteries/llm/transformers_js/validation.mjs +2 -2
  191. package/batteries/llm/transformers_js.cjs +5 -5
  192. package/batteries/llm/transformers_js.mjs +1 -1
  193. package/batteries/llm/webllm_chat_completions/adapter.cjs +10 -10
  194. package/batteries/llm/webllm_chat_completions/adapter.mjs +6 -6
  195. package/batteries/llm/webllm_chat_completions/exceptions.cjs +2 -2
  196. package/batteries/llm/webllm_chat_completions/helpers.cjs +2 -2
  197. package/batteries/llm/webllm_chat_completions/helpers.mjs +1 -1
  198. package/batteries/llm/webllm_chat_completions/validation.cjs +3 -3
  199. package/batteries/llm/webllm_chat_completions/validation.mjs +1 -1
  200. package/batteries/llm/webllm_chat_completions.cjs +3 -3
  201. package/batteries/llm/webllm_chat_completions.mjs +2 -2
  202. package/batteries/llm.cjs +4 -3
  203. package/batteries/llm.mjs +4 -4
  204. package/batteries/media/contracts.cjs +2 -2
  205. package/batteries/media/engines/audio_decode.cjs +3 -3
  206. package/batteries/media/engines/data.cjs +4 -4
  207. package/batteries/media/engines/exceljs.cjs +4 -4
  208. package/batteries/media/engines/execa_executor.cjs +3 -3
  209. package/batteries/media/engines/fs_workspace.cjs +3 -3
  210. package/batteries/media/engines/jimp.cjs +3 -3
  211. package/batteries/media/engines/sharp.cjs +3 -3
  212. package/batteries/media/engines/sheetjs.cjs +6 -6
  213. package/batteries/media/engines/sheetjs.cjs.map +1 -1
  214. package/batteries/media/engines/soffice.cjs +2 -2
  215. package/batteries/media/engines/tesseract_js.cjs +3 -3
  216. package/batteries/media/engines/transformers_asr.cjs +3 -3
  217. package/batteries/media/forge.cjs +8 -8
  218. package/batteries/media/forge.mjs +4 -4
  219. package/batteries/media/lint.cjs +2 -2
  220. package/batteries/media/lint.mjs +1 -1
  221. package/batteries/media.cjs +6 -6
  222. package/batteries/orchestration/approval.cjs +2 -2
  223. package/batteries/orchestration/cells/jexl.cjs +3 -3
  224. package/batteries/orchestration/cells/lua.cjs +3 -3
  225. package/batteries/orchestration/cells/structured.cjs +3 -3
  226. package/batteries/orchestration/conformance.cjs +2 -2
  227. package/batteries/orchestration/dispatch_reasoner.cjs +6 -6
  228. package/batteries/orchestration/dispatch_reasoner.mjs +4 -4
  229. package/batteries/orchestration/encoding.cjs +2 -2
  230. package/batteries/orchestration/executor.cjs +4 -4
  231. package/batteries/orchestration/executor.mjs +2 -2
  232. package/batteries/orchestration/forge.cjs +6 -6
  233. package/batteries/orchestration/forge.mjs +4 -4
  234. package/batteries/orchestration/in_memory.cjs +1 -1
  235. package/batteries/orchestration/ops.cjs +1 -1
  236. package/batteries/orchestration/outline.cjs +2 -2
  237. package/batteries/orchestration/plan.cjs +1 -1
  238. package/batteries/orchestration/raw.cjs +2 -2
  239. package/batteries/orchestration/reason.cjs +1 -1
  240. package/batteries/orchestration/render.cjs +2 -2
  241. package/batteries/orchestration/runs.cjs +1 -1
  242. package/batteries/orchestration/templates.cjs +2 -2
  243. package/batteries/orchestration/types.cjs +1 -1
  244. package/batteries/orchestration/validation.cjs +5 -5
  245. package/batteries/orchestration/validation.mjs +2 -2
  246. package/batteries/orchestration.cjs +6 -6
  247. package/batteries/orchestration.mjs +4 -4
  248. package/batteries/sandbox/js.cjs +7 -7
  249. package/batteries/sandbox/js.mjs +2 -2
  250. package/batteries/sandbox/node.cjs +4 -4
  251. package/batteries/sandbox/tools.cjs +2 -2
  252. package/batteries/sandbox/tools.mjs +1 -1
  253. package/batteries/sandbox.cjs +11 -11
  254. package/batteries/sandbox.mjs +4 -4
  255. package/batteries/skills/conformance.cjs +1 -1
  256. package/batteries/skills/in_memory.cjs +2 -2
  257. package/batteries/skills.cjs +15 -15
  258. package/batteries/skills.mjs +10 -10
  259. package/batteries/specialists/_shared.cjs +2 -2
  260. package/batteries/specialists/caption/transformers_js/adapter.cjs +3 -3
  261. package/batteries/specialists/caption/transformers_js/exceptions.cjs +2 -2
  262. package/batteries/specialists/caption/transformers_js/types.cjs +1 -1
  263. package/batteries/specialists/caption/transformers_js/validation.cjs +2 -2
  264. package/batteries/specialists/caption/transformers_js.cjs +1 -1
  265. package/batteries/specialists/caption.cjs +1 -1
  266. package/batteries/specialists/ocr/tesseract_js/adapter.cjs +3 -3
  267. package/batteries/specialists/ocr/tesseract_js/exceptions.cjs +2 -2
  268. package/batteries/specialists/ocr/tesseract_js/types.cjs +1 -1
  269. package/batteries/specialists/ocr/tesseract_js/validation.cjs +2 -2
  270. package/batteries/specialists/ocr/tesseract_js.cjs +1 -1
  271. package/batteries/specialists/ocr.cjs +1 -1
  272. package/batteries/specialists/stt/transformers_js.cjs +2 -2
  273. package/batteries/specialists/stt.cjs +2 -2
  274. package/batteries/specialists.cjs +2 -2
  275. package/batteries/storage/flydrive.cjs +2 -2
  276. package/batteries/storage/in_memory.cjs +2 -2
  277. package/batteries/storage/opfs.cjs +2 -2
  278. package/batteries/storage.cjs +1 -1
  279. package/batteries/tools/_shared.cjs +3 -3
  280. package/batteries/tools/_shared.mjs +1 -1
  281. package/batteries/tools/color.cjs +3 -3
  282. package/batteries/tools/color.mjs +2 -2
  283. package/batteries/tools/comparison.cjs +4 -4
  284. package/batteries/tools/comparison.mjs +2 -2
  285. package/batteries/tools/data_structure.cjs +4 -4
  286. package/batteries/tools/data_structure.mjs +2 -2
  287. package/batteries/tools/datetime_extended.cjs +4 -4
  288. package/batteries/tools/datetime_extended.mjs +3 -3
  289. package/batteries/tools/datetime_math.cjs +4 -4
  290. package/batteries/tools/datetime_math.mjs +3 -3
  291. package/batteries/tools/encoding.cjs +4 -4
  292. package/batteries/tools/encoding.mjs +2 -2
  293. package/batteries/tools/formatting.cjs +4 -4
  294. package/batteries/tools/formatting.mjs +2 -2
  295. package/batteries/tools/geo_basics.cjs +3 -3
  296. package/batteries/tools/geo_basics.mjs +2 -2
  297. package/batteries/tools/math.cjs +4 -4
  298. package/batteries/tools/math.mjs +2 -2
  299. package/batteries/tools/memory.cjs +7 -7
  300. package/batteries/tools/memory.mjs +5 -5
  301. package/batteries/tools/parsing.cjs +5 -5
  302. package/batteries/tools/parsing.mjs +3 -3
  303. package/batteries/tools/retrievables.cjs +7 -7
  304. package/batteries/tools/retrievables.mjs +5 -5
  305. package/batteries/tools/scrapper.cjs +2 -2
  306. package/batteries/tools/scrapper.mjs +1 -1
  307. package/batteries/tools/searxng.cjs +2 -2
  308. package/batteries/tools/searxng.mjs +1 -1
  309. package/batteries/tools/standing_instructions.cjs +5 -5
  310. package/batteries/tools/standing_instructions.mjs +3 -3
  311. package/batteries/tools/statistics.cjs +5 -5
  312. package/batteries/tools/statistics.mjs +3 -3
  313. package/batteries/tools/string_processing.cjs +4 -4
  314. package/batteries/tools/string_processing.mjs +2 -2
  315. package/batteries/tools/structured_data.cjs +4 -4
  316. package/batteries/tools/structured_data.mjs +2 -2
  317. package/batteries/tools/text_analysis.cjs +4 -4
  318. package/batteries/tools/text_analysis.mjs +3 -3
  319. package/batteries/tools/text_comparison.cjs +3 -3
  320. package/batteries/tools/text_comparison.mjs +2 -2
  321. package/batteries/tools/time.cjs +4 -4
  322. package/batteries/tools/time.mjs +3 -3
  323. package/batteries/tools/unit_conversion.cjs +3 -3
  324. package/batteries/tools/unit_conversion.mjs +2 -2
  325. package/batteries/tools/web_retrieval.cjs +2 -2
  326. package/batteries/tools.cjs +3 -3
  327. package/batteries/tools.mjs +2 -2
  328. package/batteries/tts/_shared.cjs +1 -1
  329. package/batteries/tts/native/adapter.cjs +2 -2
  330. package/batteries/tts/native/exceptions.cjs +2 -2
  331. package/batteries/tts/native/helpers.cjs +1 -1
  332. package/batteries/tts/native/types.cjs +1 -1
  333. package/batteries/tts/native/validation.cjs +2 -2
  334. package/batteries/tts/native.cjs +1 -1
  335. package/batteries/tts/transformers_js/adapter.cjs +3 -3
  336. package/batteries/tts/transformers_js/exceptions.cjs +2 -2
  337. package/batteries/tts/transformers_js/types.cjs +1 -1
  338. package/batteries/tts/transformers_js/validation.cjs +2 -2
  339. package/batteries/tts/transformers_js.cjs +1 -1
  340. package/batteries/tts.cjs +1 -1
  341. package/batteries/validation/exceptions.cjs +2 -2
  342. package/batteries/validation/types.cjs +1 -1
  343. package/batteries/validation/validation.cjs +1 -1
  344. package/batteries/validation.cjs +7 -7
  345. package/batteries/validation.mjs +5 -5
  346. package/batteries/vector/arangodb.cjs +2 -2
  347. package/batteries/vector/builder.cjs +1 -1
  348. package/batteries/vector/chroma.cjs +1 -1
  349. package/batteries/vector/clickhouse.cjs +2 -2
  350. package/batteries/vector/cloudflare.cjs +2 -2
  351. package/batteries/vector/conformance.cjs +1 -1
  352. package/batteries/vector/contract.cjs +1 -1
  353. package/batteries/vector/couchbase.cjs +2 -2
  354. package/batteries/vector/duckdb.cjs +2 -2
  355. package/batteries/vector/elasticsearch.cjs +2 -2
  356. package/batteries/vector/exceptions.cjs +2 -2
  357. package/batteries/vector/factory.cjs +1 -1
  358. package/batteries/vector/filters.cjs +2 -2
  359. package/batteries/vector/helpers.cjs +1 -1
  360. package/batteries/vector/hnswlib.cjs +2 -2
  361. package/batteries/vector/in_memory.cjs +1 -1
  362. package/batteries/vector/lancedb.cjs +2 -2
  363. package/batteries/vector/mariadb.cjs +2 -2
  364. package/batteries/vector/meilisearch.cjs +2 -2
  365. package/batteries/vector/migrate.cjs +2 -2
  366. package/batteries/vector/milvus.cjs +1 -1
  367. package/batteries/vector/mongodb.cjs +2 -2
  368. package/batteries/vector/neo4j.cjs +2 -2
  369. package/batteries/vector/opensearch.cjs +2 -2
  370. package/batteries/vector/oracle23ai.cjs +2 -2
  371. package/batteries/vector/orama.cjs +1 -1
  372. package/batteries/vector/pgvector.cjs +1 -1
  373. package/batteries/vector/pinecone.cjs +2 -2
  374. package/batteries/vector/plan.cjs +1 -1
  375. package/batteries/vector/qdrant.cjs +1 -1
  376. package/batteries/vector/redis.cjs +2 -2
  377. package/batteries/vector/retrievable.cjs +2 -2
  378. package/batteries/vector/retrievable.mjs +1 -1
  379. package/batteries/vector/s3vectors.cjs +2 -2
  380. package/batteries/vector/schema.cjs +1 -1
  381. package/batteries/vector/solr.cjs +2 -2
  382. package/batteries/vector/sqlite_vec.cjs +1 -1
  383. package/batteries/vector/surrealdb.cjs +2 -2
  384. package/batteries/vector/types.cjs +1 -1
  385. package/batteries/vector/typesense.cjs +2 -2
  386. package/batteries/vector/validation.cjs +1 -1
  387. package/batteries/vector/vector_store_constructor.cjs +1 -1
  388. package/batteries/vector/vespa.cjs +2 -2
  389. package/batteries/vector/weaviate.cjs +2 -2
  390. package/batteries/vector.cjs +1 -1
  391. package/batteries.cjs +8 -7
  392. package/batteries.mjs +6 -6
  393. package/{chat_common-D7SuSLCM.js → chat_common-B7fvGTKv.cjs} +5 -5
  394. package/chat_common-B7fvGTKv.cjs.map +1 -0
  395. package/{chat_common-CJskWIdB.mjs → chat_common-CeoHwSsz.mjs} +2 -2
  396. package/{chat_common-CJskWIdB.mjs.map → chat_common-CeoHwSsz.mjs.map} +1 -1
  397. package/claude-code-cli-wrapper.cjs +2 -2
  398. package/{common-Cb1h54HM.js → common-7gCR3zQu.cjs} +9 -9
  399. package/common-7gCR3zQu.cjs.map +1 -0
  400. package/{common-AhsMepUS.mjs → common-B5maOoF_.mjs} +7 -7
  401. package/{common-AhsMepUS.mjs.map → common-B5maOoF_.mjs.map} +1 -1
  402. package/{common-BuVhq_3h.js → common-BuVhq_3h.cjs} +1 -1
  403. package/common-BuVhq_3h.cjs.map +1 -0
  404. package/common.cjs +8 -8
  405. package/common.mjs +6 -6
  406. package/{conformance-T1qEg8Sv.js → conformance-T1qEg8Sv.cjs} +1 -1
  407. package/conformance-T1qEg8Sv.cjs.map +1 -0
  408. package/{dispatch_runner-CUOD_SAg.mjs → dispatch_runner-DO7jo_gl.mjs} +5 -5
  409. package/{dispatch_runner-CUOD_SAg.mjs.map → dispatch_runner-DO7jo_gl.mjs.map} +1 -1
  410. package/{dispatch_runner-BOfUNRv3.js → dispatch_runner-FlriTyoq.cjs} +7 -7
  411. package/dispatch_runner-FlriTyoq.cjs.map +1 -0
  412. package/dispatch_runner.cjs +2 -2
  413. package/dispatch_runner.mjs +1 -1
  414. package/{ecmascript-C13G-sie.js → ecmascript-BydSB03Y.cjs} +5 -5
  415. package/ecmascript-BydSB03Y.cjs.map +1 -0
  416. package/{ecmascript-qssVTISd.mjs → ecmascript-bgwVyZG1.mjs} +3 -3
  417. package/{ecmascript-qssVTISd.mjs.map → ecmascript-bgwVyZG1.mjs.map} +1 -1
  418. package/{error_translation-BCa4wxUL.js → error_translation-D8Ea1_th.cjs} +2 -2
  419. package/error_translation-D8Ea1_th.cjs.map +1 -0
  420. package/{escape-COeB923i.js → escape-C12OWStb.cjs} +3 -3
  421. package/escape-C12OWStb.cjs.map +1 -0
  422. package/eslint/rules/artifact_tool_forbids_artifact_constructor.cjs +2 -2
  423. package/eslint/rules/no_model_in_tool_handler.cjs +2 -2
  424. package/eslint/rules/require_string_empty_disposition.cjs +2 -2
  425. package/eslint/rules/require_validator_any_required.cjs +2 -2
  426. package/eslint/rules/thought_payload_requires_replay_tag.cjs +2 -2
  427. package/eslint/rules/token_encoding_requires_context_window.cjs +2 -2
  428. package/eslint/rules.cjs +2 -2
  429. package/eslint/rules.mjs +1 -1
  430. package/eslint.cjs +3 -3
  431. package/eslint.mjs +2 -2
  432. package/{exceptions-Dlw1Jr6E.js → exceptions-Bc1s_ld5.cjs} +2 -2
  433. package/exceptions-Bc1s_ld5.cjs.map +1 -0
  434. package/{exceptions-BY1RQNVP.js → exceptions-BwGzlXoz.cjs} +2 -2
  435. package/exceptions-BwGzlXoz.cjs.map +1 -0
  436. package/{exceptions-DrHnAGQz.js → exceptions-DrHnAGQz.cjs} +1 -1
  437. package/exceptions-DrHnAGQz.cjs.map +1 -0
  438. package/exceptions.cjs +3 -3
  439. package/factories.cjs +2 -2
  440. package/forge.cjs +3 -3
  441. package/forge.mjs +2 -2
  442. package/{formats-DZVuqZUN.js → formats-DZVuqZUN.cjs} +1 -1
  443. package/formats-DZVuqZUN.cjs.map +1 -0
  444. package/{fs_node-WwUEiuo6.js → fs_node-XvgZtNJV.cjs} +2 -2
  445. package/fs_node-XvgZtNJV.cjs.map +1 -0
  446. package/{function_serializer-ChL2I8Kq.js → function_serializer-D1Kyicai.cjs} +3 -3
  447. package/function_serializer-D1Kyicai.cjs.map +1 -0
  448. package/{gpu_budget-BBIUyLoj.js → gpu_budget-BBIUyLoj.cjs} +1 -1
  449. package/gpu_budget-BBIUyLoj.cjs.map +1 -0
  450. package/{guards-05Uq3J4M.js → guards-5-XmJgD2.cjs} +2 -2
  451. package/guards-5-XmJgD2.cjs.map +1 -0
  452. package/guards.cjs +10 -10
  453. package/guards.mjs +7 -7
  454. package/{helpers-So6bNfJp.mjs → helpers-C1T0DV8Q.mjs} +3 -3
  455. package/{helpers-So6bNfJp.mjs.map → helpers-C1T0DV8Q.mjs.map} +1 -1
  456. package/{helpers-C_1dcP_X.js → helpers-Dcp4CrOz.cjs} +4 -4
  457. package/helpers-Dcp4CrOz.cjs.map +1 -0
  458. package/index.cjs +14 -14
  459. package/index.mjs +11 -11
  460. package/{isolation-7Jrcucgc.js → isolation-B01xCIoV.cjs} +5 -5
  461. package/isolation-B01xCIoV.cjs.map +1 -0
  462. package/lib/classes/identity.d.ts +6 -3
  463. package/lib/helpers/bignum.cjs +1 -1
  464. package/lib/utils/audio.cjs +1 -1
  465. package/lib/utils/retry.cjs +1 -1
  466. package/{lifecycle-vYQJ2rmf.js → lifecycle-vYQJ2rmf.cjs} +1 -1
  467. package/lifecycle-vYQJ2rmf.cjs.map +1 -0
  468. package/{manifest-iMAmSDay.js → manifest-IP1IOJcg.cjs} +4 -4
  469. package/manifest-IP1IOJcg.cjs.map +1 -0
  470. package/mcp/adk-docs-corpus.json +2 -2
  471. package/package.json +478 -478
  472. package/{patch-BXX9Q0FM.js → patch-BXX9Q0FM.cjs} +1 -1
  473. package/patch-BXX9Q0FM.cjs.map +1 -0
  474. package/{predicates-f3wvKYT8.js → predicates-Bzaa7gNI.cjs} +3 -3
  475. package/predicates-Bzaa7gNI.cjs.map +1 -0
  476. package/{retrievable-CksTfjbY.js → retrievable-BBwiACtw.cjs} +5 -5
  477. package/retrievable-BBwiACtw.cjs.map +1 -0
  478. package/{retrievable-HjKe5mOD.mjs → retrievable-CrGKx4sc.mjs} +3 -3
  479. package/{retrievable-HjKe5mOD.mjs.map → retrievable-CrGKx4sc.mjs.map} +1 -1
  480. package/{sandbox-utils-DLCceTeU.js → sandbox-utils-D12AZhWE.cjs} +2 -2
  481. package/sandbox-utils-D12AZhWE.cjs.map +1 -0
  482. package/{scrapper-CkooTUAD.js → scrapper-BibKj8qE.cjs} +6 -6
  483. package/scrapper-BibKj8qE.cjs.map +1 -0
  484. package/{scrapper-_dWwuDJg.mjs → scrapper-_JzgbLG5.mjs} +4 -4
  485. package/{scrapper-_dWwuDJg.mjs.map → scrapper-_JzgbLG5.mjs.map} +1 -1
  486. package/{searxng-DXzj0o8E.js → searxng-C6xrLW-v.cjs} +6 -6
  487. package/searxng-C6xrLW-v.cjs.map +1 -0
  488. package/{searxng-PnrXrrLE.mjs → searxng-D-nA2gEI.mjs} +4 -4
  489. package/{searxng-PnrXrrLE.mjs.map → searxng-D-nA2gEI.mjs.map} +1 -1
  490. package/{server-CnUZcn6e.js → server-CkVjzQaC.cjs} +2 -2
  491. package/server-CkVjzQaC.cjs.map +1 -0
  492. package/server.json +2 -2
  493. package/{shell-quote-CIuPmePF.js → shell-quote-BUxBTn3M.cjs} +2 -2
  494. package/shell-quote-BUxBTn3M.cjs.map +1 -0
  495. package/shims.cjs +2 -2
  496. package/skills/adk-assembly/SKILL.md +2 -2
  497. package/{spooled_artifact-DKZd7fgs.js → spooled_artifact-BLgbGT8b.cjs} +733 -733
  498. package/spooled_artifact-BLgbGT8b.cjs.map +1 -0
  499. package/{spooled_artifact-BMtuIsu6.mjs → spooled_artifact-BkOe4-j-.mjs} +731 -731
  500. package/spooled_artifact-BkOe4-j-.mjs.map +1 -0
  501. package/spooled_artifact.cjs +3 -3
  502. package/spooled_artifact.mjs +2 -2
  503. package/{spooled_markdown_artifact-BrMoR7ck.js → spooled_markdown_artifact-8zdejfcJ.cjs} +5 -5
  504. package/spooled_markdown_artifact-8zdejfcJ.cjs.map +1 -0
  505. package/{spooled_markdown_artifact-g4CPr86y.mjs → spooled_markdown_artifact-Dnl-lCGv.mjs} +3 -3
  506. package/{spooled_markdown_artifact-g4CPr86y.mjs.map → spooled_markdown_artifact-Dnl-lCGv.mjs.map} +1 -1
  507. package/{thought-BEsItcp_.mjs → thought-BrQt6HAb.mjs} +47 -6
  508. package/thought-BrQt6HAb.mjs.map +1 -0
  509. package/{thought-DTgeATDv.js → thought-COeZTQ-B.cjs} +49 -8
  510. package/thought-COeZTQ-B.cjs.map +1 -0
  511. package/{tokenizable-KwA7jyGQ.js → tokenizable-DDIdXbJN.cjs} +3 -3
  512. package/tokenizable-DDIdXbJN.cjs.map +1 -0
  513. package/{tool_call-Cahji8ZY.mjs → tool_call-8crmZsO8.mjs} +4 -4
  514. package/{tool_call-Cahji8ZY.mjs.map → tool_call-8crmZsO8.mjs.map} +1 -1
  515. package/{tool_call-kx4WQ0-j.js → tool_call-JbjeUpRK.cjs} +6 -6
  516. package/tool_call-JbjeUpRK.cjs.map +1 -0
  517. package/{tool_parsers-csSBFWob.js → tool_parsers-8_qO0a_F.cjs} +2 -2
  518. package/tool_parsers-8_qO0a_F.cjs.map +1 -0
  519. package/{tools-BepwIVtl.mjs → tools-BC4NJqZD.mjs} +6 -6
  520. package/{tools-BepwIVtl.mjs.map → tools-BC4NJqZD.mjs.map} +1 -1
  521. package/{tools-zV-_O2MB.js → tools-D4mdzi0a.cjs} +9 -9
  522. package/tools-D4mdzi0a.cjs.map +1 -0
  523. package/{toon-F-e_k2jV.mjs → toon-BA9Q7NHG.mjs} +5 -5
  524. package/{toon-F-e_k2jV.mjs.map → toon-BA9Q7NHG.mjs.map} +1 -1
  525. package/{toon-gA82H1sN.js → toon-b-0pFKZ8.cjs} +7 -7
  526. package/toon-b-0pFKZ8.cjs.map +1 -0
  527. package/{transformers_js-C050gRfd.js → transformers_js-7OzeS_Tp.cjs} +4 -4
  528. package/transformers_js-7OzeS_Tp.cjs.map +1 -0
  529. package/{turn_runner-BdeNNvo0.mjs → turn_runner-BmVXcBZ2.mjs} +5 -5
  530. package/{turn_runner-BdeNNvo0.mjs.map → turn_runner-BmVXcBZ2.mjs.map} +1 -1
  531. package/{turn_runner-CF5LExb8.js → turn_runner-DX-3s3ih.cjs} +7 -7
  532. package/turn_runner-DX-3s3ih.cjs.map +1 -0
  533. package/turn_runner.cjs +2 -2
  534. package/turn_runner.mjs +1 -1
  535. package/{type_guards-BAhiOypL-C2eOOyxU.js → type_guards-BAhiOypL-C2eOOyxU.cjs} +1 -1
  536. package/{type_guards-BAhiOypL-C2eOOyxU.js.map → type_guards-BAhiOypL-C2eOOyxU.cjs.map} +1 -1
  537. package/{type_guards-DuKwiYgg.js → type_guards-BWTKysPt.cjs} +2 -2
  538. package/{types-DrSosVaM.js → types-DWOiL208.cjs} +4 -4
  539. package/types-DWOiL208.cjs.map +1 -0
  540. package/types.cjs +1 -1
  541. package/{validate-CkQI-48O.js → validate-tUm9MY8y.cjs} +3 -3
  542. package/validate-tUm9MY8y.cjs.map +1 -0
  543. package/{xlsx-B0sTpEC2.js → xlsx-Dtql4S-9.cjs} +2 -2
  544. package/xlsx-Dtql4S-9.cjs.map +1 -0
  545. package/{xlsx.zahl-ZIcUQVv8.js → xlsx.zahl-C9pM7cyt.cjs} +2 -2
  546. package/xlsx.zahl-C9pM7cyt.cjs.map +1 -0
  547. package/{xml-CT28gSkh.mjs → xml-B1JIGLpU.mjs} +5 -5
  548. package/{xml-CT28gSkh.mjs.map → xml-B1JIGLpU.mjs.map} +1 -1
  549. package/{xml-DVjBQkhb.js → xml-fvwTsoRv.cjs} +7 -7
  550. package/xml-fvwTsoRv.cjs.map +1 -0
  551. package/{yaml-DiHPF0nY.mjs → yaml-1mP4uxdf.mjs} +5 -5
  552. package/{yaml-DiHPF0nY.mjs.map → yaml-1mP4uxdf.mjs.map} +1 -1
  553. package/{yaml-Dt82CpYv.js → yaml-DPUTumla.cjs} +7 -7
  554. package/yaml-DPUTumla.cjs.map +1 -0
  555. package/arg_specs-iYmIM3wI.js.map +0 -1
  556. package/artifact_methods-CIQgBCKp.mjs +0 -1
  557. package/artifact_methods-Cjypa7oU.js +0 -1
  558. package/chat_common-D7SuSLCM.js.map +0 -1
  559. package/common-BuVhq_3h.js.map +0 -1
  560. package/common-Cb1h54HM.js.map +0 -1
  561. package/conformance-T1qEg8Sv.js.map +0 -1
  562. package/dispatch_runner-BOfUNRv3.js.map +0 -1
  563. package/ecmascript-C13G-sie.js.map +0 -1
  564. package/error_translation-BCa4wxUL.js.map +0 -1
  565. package/escape-COeB923i.js.map +0 -1
  566. package/exceptions-BY1RQNVP.js.map +0 -1
  567. package/exceptions-Dlw1Jr6E.js.map +0 -1
  568. package/exceptions-DrHnAGQz.js.map +0 -1
  569. package/formats-DZVuqZUN.js.map +0 -1
  570. package/fs_node-WwUEiuo6.js.map +0 -1
  571. package/function_serializer-ChL2I8Kq.js.map +0 -1
  572. package/gpu_budget-BBIUyLoj.js.map +0 -1
  573. package/guards-05Uq3J4M.js.map +0 -1
  574. package/helpers-C_1dcP_X.js.map +0 -1
  575. package/isolation-7Jrcucgc.js.map +0 -1
  576. package/lifecycle-vYQJ2rmf.js.map +0 -1
  577. package/manifest-iMAmSDay.js.map +0 -1
  578. package/patch-BXX9Q0FM.js.map +0 -1
  579. package/predicates-f3wvKYT8.js.map +0 -1
  580. package/retrievable-CksTfjbY.js.map +0 -1
  581. package/sandbox-utils-DLCceTeU.js.map +0 -1
  582. package/scrapper-CkooTUAD.js.map +0 -1
  583. package/searxng-DXzj0o8E.js.map +0 -1
  584. package/server-CnUZcn6e.js.map +0 -1
  585. package/shell-quote-CIuPmePF.js.map +0 -1
  586. package/spooled_artifact-BMtuIsu6.mjs.map +0 -1
  587. package/spooled_artifact-DKZd7fgs.js.map +0 -1
  588. package/spooled_markdown_artifact-BrMoR7ck.js.map +0 -1
  589. package/thought-BEsItcp_.mjs.map +0 -1
  590. package/thought-DTgeATDv.js.map +0 -1
  591. package/tokenizable-KwA7jyGQ.js.map +0 -1
  592. package/tool_call-kx4WQ0-j.js.map +0 -1
  593. package/tool_parsers-csSBFWob.js.map +0 -1
  594. package/tools-zV-_O2MB.js.map +0 -1
  595. package/toon-gA82H1sN.js.map +0 -1
  596. package/transformers_js-C050gRfd.js.map +0 -1
  597. package/turn_runner-CF5LExb8.js.map +0 -1
  598. package/types-DrSosVaM.js.map +0 -1
  599. package/validate-CkQI-48O.js.map +0 -1
  600. package/xlsx-B0sTpEC2.js.map +0 -1
  601. package/xlsx.zahl-ZIcUQVv8.js.map +0 -1
  602. package/xml-DVjBQkhb.js.map +0 -1
  603. package/yaml-Dt82CpYv.js.map +0 -1
  604. /package/{chunk-Cek0wNdY.js → chunk-Cek0wNdY.cjs} +0 -0
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../../../chunk-Cek0wNdY.js");
3
- const require_tokenizable = require("../../../tokenizable-KwA7jyGQ.js");
4
- require("../../../common-Cb1h54HM.js");
2
+ require("../../../chunk-Cek0wNdY.cjs");
3
+ const require_tokenizable = require("../../../tokenizable-DDIdXbJN.cjs");
4
+ require("../../../common-7gCR3zQu.cjs");
5
5
  const require_batteries_llm_bedrock_converse_exceptions = require("./exceptions.cjs");
6
6
  let _nhtio_validation = require("@nhtio/validation");
7
7
  //#region src/batteries/llm/bedrock_converse/validation.ts
@@ -1,5 +1,5 @@
1
1
  import { n as TokenEncoding } from "../../../tokenizable-xPXj1AQX.mjs";
2
- import "../../../common-AhsMepUS.mjs";
2
+ import "../../../common-B5maOoF_.mjs";
3
3
  import { E_INVALID_BEDROCK_CONVERSE_OPTIONS } from "./exceptions.mjs";
4
4
  import { validator } from "@nhtio/validation";
5
5
  //#region src/batteries/llm/bedrock_converse/validation.ts
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../../chunk-Cek0wNdY.js");
3
- const require_helpers = require("../../helpers-C_1dcP_X.js");
4
- const require_chat_common = require("../../chat_common-D7SuSLCM.js");
2
+ require("../../chunk-Cek0wNdY.cjs");
3
+ const require_helpers = require("../../helpers-Dcp4CrOz.cjs");
4
+ const require_chat_common = require("../../chat_common-B7fvGTKv.cjs");
5
5
  const require_batteries_llm_bedrock_converse_exceptions = require("./bedrock_converse/exceptions.cjs");
6
6
  const require_batteries_llm_bedrock_converse_validation = require("./bedrock_converse/validation.cjs");
7
7
  const require_batteries_llm_bedrock_converse_helpers = require("./bedrock_converse/helpers.cjs");
@@ -1,5 +1,5 @@
1
- import { A as renderMemories, D as renderArtifactHandleBody, F as renderThirdPartyPrivateRetrievables, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, j as renderRetrievableHandleBody, k as renderFirstPartyRetrievables, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../helpers-So6bNfJp.mjs";
2
- import { t as deCollideToolCallIds } from "../../chat_common-CJskWIdB.mjs";
1
+ import { A as renderMemories, D as renderArtifactHandleBody, F as renderThirdPartyPrivateRetrievables, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, j as renderRetrievableHandleBody, k as renderFirstPartyRetrievables, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../helpers-C1T0DV8Q.mjs";
2
+ import { t as deCollideToolCallIds } from "../../chat_common-CeoHwSsz.mjs";
3
3
  import { E_CONVERSE_ALTERNATION_VIOLATION, E_CONVERSE_INVALID_TOOL_INPUT, E_CONVERSE_MISSING_TOOL_CONFIG, E_CONVERSE_REQUEST_FAILED, E_CONVERSE_STREAM_ERROR, E_INVALID_BEDROCK_CONVERSE_OPTIONS } from "./bedrock_converse/exceptions.mjs";
4
4
  import { bedrockConverseOptionsSchema, validateOptions } from "./bedrock_converse/validation.mjs";
5
5
  import { DEFAULT_CONVERSE_BUCKET_ORDER, buildConverseRequest, defaultBuildConverseRequest, defaultEnforceConverseAlternation, defaultExtractConverseGeneration, defaultMediaToConverseImage, defaultRenderConverseToolResult, defaultSanitizeConverseSchema, defaultSanitizeToolUseId, defaultToolsToConverseTools, enforceConverseAlternation, extractConverseGeneration, mediaToConverseImage, renderConverseToolResult, sanitizeConverseSchema, sanitizeToolUseId, toolsToConverseTools } from "./bedrock_converse/helpers.mjs";
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../../../chunk-Cek0wNdY.js");
3
- const require_exceptions = require("../../../exceptions-DrHnAGQz.js");
2
+ require("../../../chunk-Cek0wNdY.cjs");
3
+ const require_exceptions = require("../../../exceptions-DrHnAGQz.cjs");
4
4
  require("../../../factories.cjs");
5
5
  //#region src/batteries/llm/chat_common/exceptions.ts
6
6
  /**
@@ -1,14 +1,15 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../../../chunk-Cek0wNdY.js");
3
- const require_tokenizable = require("../../../tokenizable-KwA7jyGQ.js");
4
- const require_guards = require("../../../guards-05Uq3J4M.js");
5
- const require_spooled_artifact = require("../../../spooled_artifact-DKZd7fgs.js");
6
- const require_thought = require("../../../thought-DTgeATDv.js");
7
- const require_tool_call = require("../../../tool_call-kx4WQ0-j.js");
8
- require("../../../common-Cb1h54HM.js");
2
+ require("../../../chunk-Cek0wNdY.cjs");
3
+ const require_guards = require("../../../guards-5-XmJgD2.cjs");
4
+ const require_tokenizable = require("../../../tokenizable-DDIdXbJN.cjs");
5
+ const require_spooled_artifact = require("../../../spooled_artifact-BLgbGT8b.cjs");
6
+ const require_thought = require("../../../thought-COeZTQ-B.cjs");
7
+ const require_tool_call = require("../../../tool_call-JbjeUpRK.cjs");
8
+ require("../../../common-7gCR3zQu.cjs");
9
9
  require("../../../guards.cjs");
10
10
  const require_batteries_storage_in_memory = require("../../storage/in_memory.cjs");
11
- const require_helpers = require("../../../helpers-C_1dcP_X.js");
11
+ const require_helpers = require("../../../helpers-Dcp4CrOz.cjs");
12
+ const require_chat_common = require("../../../chat_common-B7fvGTKv.cjs");
12
13
  const require_batteries_llm_claude_code_cli_exceptions = require("./exceptions.cjs");
13
14
  const require_batteries_llm_claude_code_cli_validation = require("./validation.cjs");
14
15
  const require_batteries_llm_claude_code_cli_wire = require("./wire.cjs");
@@ -45,6 +46,157 @@ var resolveDefaultWrapperPath = () => {
45
46
  if (typeof require === "function" && typeof require.resolve === "function") return require.resolve("../../../claude-code-cli-wrapper.cjs");
46
47
  return decodeURIComponent(new URL("../../../claude-code-cli-wrapper.mjs", "" + {}.url).pathname);
47
48
  };
49
+ /**
50
+ * Existence-check a candidate wrapper path, lazily acquiring `node:fs`'s `existsSync` — never
51
+ * imported at module scope for the same reason `resolveDefaultWrapperPath` avoids `node:url`
52
+ * above: this file is transitively pulled into the browser test project via `src/batteries`'s
53
+ * barrel, and a module-scope Node-builtin import would throw at import time there. Any failure to
54
+ * even acquire `node:fs` (e.g. a hostile/exotic runtime) is treated as "does not exist" rather
55
+ * than propagating, since this is only ever used to pick between fallback candidates.
56
+ */
57
+ var existsOnDisk = async (path) => {
58
+ try {
59
+ const fs = await import("node:fs");
60
+ return typeof fs.existsSync === "function" && fs.existsSync(path);
61
+ } catch {
62
+ return false;
63
+ }
64
+ };
65
+ /**
66
+ * Resolve the wrapper asset's sibling path relative to THIS PACKAGE's own already-published main
67
+ * entry, rather than relative to the (possibly relocated-by-bundling) adapter module. Node's
68
+ * package self-reference feature — a package resolving its own name as a bare specifier — is
69
+ * depth-independent within `@nhtio/adk`'s own tree, so this survives the adapter code being moved
70
+ * around WITHIN the package by a bundler. It only breaks once the calling code has been physically
71
+ * bundled OUTSIDE `@nhtio/adk`'s own directory tree (e.g. into a consumer's Electron main-process
72
+ * bundle) — at that point self-reference falls back to ordinary node_modules bare-specifier
73
+ * resolution, which succeeds exactly when `@nhtio/adk` is still installed as a resolvable
74
+ * dependency from the bundled code's new location. That is the same "normal case" the published
75
+ * `wrapperPath` override already exists for, so this fallback is a strict improvement with no new
76
+ * failure mode: when it can't resolve, behavior degrades to the pre-existing "throw a clear error"
77
+ * path below rather than a worse outcome.
78
+ *
79
+ * Deliberately resolves this package's `exports['.']` main entry (already published, no `exports`
80
+ * map change needed) and derives the wrapper's path as a sibling of that entry's directory — every
81
+ * `vite.config.mts` `build.lib.entry` key (including the un-tagged wrapper) emits to a flat
82
+ * `dist/` directory, so `dirname(mainEntry) === dirname(wrapperAsset)`.
83
+ *
84
+ * Two independent ways to reach a `require`-like resolver are tried, in this order, because a
85
+ * bundled consumer may land in either shape and each leaves the OTHER unusable:
86
+ *
87
+ * 1. A real ambient `require` — present when THIS MODULE has itself been bundled into a CJS
88
+ * output (e.g. `esbuild --platform=node --format=cjs`, which is common for an Electron
89
+ * main-process bundle, the issue's reported scenario). Reused verbatim is the exact same
90
+ * discriminator `resolveDefaultWrapperPath` above already documents:
91
+ * `typeof require === 'function' && typeof require.resolve === 'function'` — because a bundled
92
+ * ESM output can ALSO leave a truthy `require` behind as a dynamic-require shim/Proxy (rolldown
93
+ * and esbuild both do this) whose `.resolve` is not itself a function, and calling it would
94
+ * throw rather than genuinely resolving anything. In a genuine CJS bundle this ambient
95
+ * `require.resolve('@nhtio/adk')` works directly with no `createRequire` bridge needed.
96
+ * 2. `createRequire(import.meta.url)` — the ESM path, used only when step 1 didn't yield a usable
97
+ * resolver. Verified empirically that esbuild's `--format=cjs` output rewrites every
98
+ * `import.meta` reference in bundled source to a plain `var import_meta = {}`, so
99
+ * `import.meta.url` is `undefined` there — `createRequire(undefined)` throws
100
+ * `ERR_INVALID_ARG_VALUE` outright, so this branch is skipped by checking
101
+ * `typeof import.meta.url === 'string'` first rather than letting that throw surface as an
102
+ * opaque, unrelated-looking error. `createRequire` (rather than `import.meta.resolve`) is used
103
+ * here because — unlike `import.meta.resolve` — its `.resolve` performs a real filesystem
104
+ * existence check (verified directly: `import.meta.resolve` happily returns a URL for a target
105
+ * file that does not exist, since it only resolves the `exports` map syntactically;
106
+ * `require.resolve`, including through `createRequire`, throws `MODULE_NOT_FOUND` for a missing
107
+ * target), so a resolved path here is already known to exist and only the derived wrapper
108
+ * sibling still needs its own explicit check below.
109
+ *
110
+ * `tried` always accounts for BOTH routes once step 1 has not already produced a `mainEntry`: step
111
+ * 2 either resolves, records its own failure, or — when `import.meta.url` isn't even a string —
112
+ * records an explicit "skipped: import.meta.url unavailable" entry, so the thrown error's "Tried:"
113
+ * list never silently omits a route just because it was never attempted.
114
+ *
115
+ * A `process.cwd()`-anchored resolution attempt is deliberately NOT included as a further
116
+ * fallback: resolution should stay anchored to the bundle's own module identity, not to a mutable,
117
+ * launch-directory-dependent value that has no necessary relationship to where the bundle — or
118
+ * `@nhtio/adk` — actually live. Failing clearly and pointing at `wrapperPath` is a better outcome
119
+ * than a resolution that silently varies with the process's current working directory.
120
+ */
121
+ var resolveWrapperPathViaSelfReference = async (wrapperBasename, seams = {}) => {
122
+ const tried = [];
123
+ let mainEntry;
124
+ if (seams.ambientRequireResolve !== void 0 || typeof require === "function" && typeof require.resolve === "function") try {
125
+ mainEntry = (seams.ambientRequireResolve ?? require.resolve)("@nhtio/adk");
126
+ } catch (err) {
127
+ tried.push(`self-reference via ambient require('@nhtio/adk') failed: ${require_guards.isError(err) ? err.message : String(err)}`);
128
+ }
129
+ if (mainEntry === void 0) {
130
+ const importMetaUrl = "importMetaUrl" in seams ? seams.importMetaUrl : {}.url;
131
+ if (typeof importMetaUrl === "string") try {
132
+ const { createRequire } = await import("node:module");
133
+ mainEntry = createRequire(importMetaUrl).resolve("@nhtio/adk");
134
+ } catch (err) {
135
+ tried.push(`self-reference via createRequire(import.meta.url).resolve('@nhtio/adk') failed: ${require_guards.isError(err) ? err.message : String(err)}`);
136
+ }
137
+ else tried.push("self-reference via createRequire(import.meta.url) skipped: import.meta.url unavailable in this module context");
138
+ }
139
+ if (mainEntry === void 0) return { tried };
140
+ const lastSlash = mainEntry.lastIndexOf("/");
141
+ if (lastSlash < 0) {
142
+ tried.push(`self-reference resolved '@nhtio/adk' to an unexpected path with no directory separator: ${mainEntry}`);
143
+ return { tried };
144
+ }
145
+ const candidate = `${mainEntry.slice(0, lastSlash + 1)}${wrapperBasename}`;
146
+ tried.push(candidate);
147
+ return await existsOnDisk(candidate) ? {
148
+ path: candidate,
149
+ tried
150
+ } : { tried };
151
+ };
152
+ /**
153
+ * Internal, non-public resolver used by the executor call site (never `resolveDefaultWrapperPath`
154
+ * itself, which stays synchronous and unchanged for backwards compatibility with any caller that
155
+ * already imports it directly). Tries the existing relative-to-module resolution FIRST — zero
156
+ * behavior change for the common unbundled case — and only falls back to the self-reference
157
+ * lookup when that candidate does not exist on disk (bundling relocated the adapter). Throws
158
+ * {@link E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND} naming every path tried — the relative candidate (or
159
+ * its resolution error) AND every self-reference candidate/reason from
160
+ * {@link resolveWrapperPathViaSelfReference} — when neither resolves, rather than letting a bundled
161
+ * consumer hit an opaque `MODULE_NOT_FOUND`/ENOENT deep inside `execa`, or a truncated error that
162
+ * hides what the self-reference fallback actually attempted.
163
+ *
164
+ * @remarks
165
+ * Electron/asar note: an app packaged into an `asar` archive can still `readFileSync`/`existsSync`
166
+ * transparently-unpacked paths through Electron's patched `fs`, so this existence-check strategy
167
+ * keeps working there without special-casing — but a wrapper asset that ships unpacked (outside
168
+ * `asar`) is still the consumer's responsibility to arrange, same as any other spawned-executable
169
+ * asset; `wrapperPath` remains the escape hatch when that layout doesn't line up.
170
+ *
171
+ * @remarks
172
+ * Coverage note — deployment shapes: this resolver (both branches) only ever finds the wrapper
173
+ * asset when `@nhtio/adk` itself (with `dist/claude-code-cli-wrapper.{cjs,mjs}` inside it) remains
174
+ * an ordinarily-resolvable dependency from wherever the bundle ends up running — the bundle never
175
+ * carries the wrapper asset itself. A bundle relocated outside its original project (so
176
+ * `node_modules/@nhtio/adk` is no longer reachable), or an Electron app that prunes/asar-packs
177
+ * `@nhtio/adk` out of its final package, is NOT covered by either branch and needs the explicit
178
+ * `wrapperPath` option — which is exactly what the thrown error's message directs the caller to.
179
+ */
180
+ var resolveWrapperPathWithFallback = async (seams = {}) => {
181
+ const resolveRelative = seams.resolveRelative ?? resolveDefaultWrapperPath;
182
+ const resolveSelfRef = seams.resolveSelfRef ?? resolveWrapperPathViaSelfReference;
183
+ const checkExists = seams.checkExists ?? existsOnDisk;
184
+ const tried = [];
185
+ let relative;
186
+ try {
187
+ relative = resolveRelative();
188
+ } catch (err) {
189
+ tried.push(require_guards.isError(err) ? err.message : String(err));
190
+ }
191
+ if (relative !== void 0) {
192
+ tried.push(relative);
193
+ if (await checkExists(relative)) return relative;
194
+ }
195
+ const selfRef = await resolveSelfRef(relative !== void 0 && relative.endsWith(".cjs") ? "claude-code-cli-wrapper.cjs" : "claude-code-cli-wrapper.mjs");
196
+ tried.push(...selfRef.tried);
197
+ if (selfRef.path !== void 0) return selfRef.path;
198
+ throw new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND([tried.join(", ") || "(no candidates)"]);
199
+ };
48
200
  var resolveExeca = async (supplied) => {
49
201
  let value = supplied ?? (() => import("execa"));
50
202
  if (typeof value === "function" && !("exec" in value)) try {
@@ -109,6 +261,36 @@ var resolveHelpers = (overrides) => {
109
261
  var estimateTokensOf = async (value, encoding) => Promise.resolve(value.estimateTokens(encoding));
110
262
  var nowIso = () => (/* @__PURE__ */ new Date()).toISOString();
111
263
  /**
264
+ * Normalise a thrown/rejected value into a real `Error` suitable as an exception `.cause`. Mirrors
265
+ * `dispatch_runner.ts`'s internal (non-exported) `toErrorCause` convention: a genuine `Error` (per
266
+ * the cross-realm-safe {@link isError} guard) passes through unchanged; anything else — a string,
267
+ * a plain object, a cross-realm error whose `instanceof Error` is false — is wrapped in a real
268
+ * `Error` whose message is the value's best string form, with the original preserved on `.cause`.
269
+ *
270
+ * Never throws. It runs inside the adapter's last-line-of-defence catch handlers (the `onEvent`
271
+ * rejection handler, the stdout `'data'` listener, the background-shutdown rejection handler), so a
272
+ * throw here would recreate the exact unhandled-rejection / uncaught-exception class it exists to
273
+ * prevent. A hostile thrown value can defeat BOTH `JSON.stringify` and `String` (a `Proxy` with a
274
+ * throwing trap, or an object whose `toJSON` and `toString` both throw) and can even make the
275
+ * `isError` guard itself throw, so each step is guarded and the last resort is a fixed string.
276
+ */
277
+ var toErrorCause = (value) => {
278
+ try {
279
+ if (require_guards.isError(value)) return value;
280
+ } catch {}
281
+ let text;
282
+ try {
283
+ text = typeof value === "string" ? value : value === void 0 ? "undefined" : JSON.stringify(value) ?? String(value);
284
+ } catch {
285
+ try {
286
+ text = String(value);
287
+ } catch {
288
+ text = "[unserialisable thrown value]";
289
+ }
290
+ }
291
+ return new Error(`non-Error thrown while handling a wrapper event: ${text}`, { cause: value });
292
+ };
293
+ /**
112
294
  * Integrity checksum over `tool`/`args` — matches every other LLM battery's convention
113
295
  * (`sha256(canonicalStringify({tool, args}))`, see `ollama/adapter.ts`'s `computeChecksum`), NOT
114
296
  * the per-call `requestId`. Identical repeat calls must share this checksum: it feeds
@@ -264,7 +446,13 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
264
446
  ctx.nack(require_guards.isError(err) ? err : new Error(String(err)));
265
447
  return;
266
448
  }
267
- const wrapperPath = merged.wrapperPath ?? resolveDefaultWrapperPath();
449
+ let wrapperPath;
450
+ try {
451
+ wrapperPath = merged.wrapperPath ?? await resolveWrapperPathWithFallback();
452
+ } catch (err) {
453
+ ctx.nack(require_guards.isError(err) ? err : new Error(String(err)));
454
+ return;
455
+ }
268
456
  const claudeBin = merged.claudeBin ?? "claude";
269
457
  const renderedToolCallResults = /* @__PURE__ */ new Map();
270
458
  for (const tc of ctx.turnToolCalls) {
@@ -401,6 +589,7 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
401
589
  let currentMessageId;
402
590
  let currentMessageBuffer = "";
403
591
  let sealedMessage = false;
592
+ let inFlightToolCalls = 0;
404
593
  const clearStartupTimer = () => {
405
594
  if (startupTimer) clearTimeout(startupTimer);
406
595
  startupTimer = void 0;
@@ -424,14 +613,26 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
424
613
  Promise.resolve(child).finally(() => {
425
614
  clearTimeout(timer);
426
615
  resolve();
427
- });
616
+ }).catch(() => {});
428
617
  });
429
618
  try {
430
619
  child.kill("SIGTERM");
431
620
  } catch {}
432
621
  };
622
+ const shutdownInBackground = () => {
623
+ gracefulShutdown().catch((err) => {
624
+ const cause = toErrorCause(err);
625
+ try {
626
+ helpers.log.debug({
627
+ kind: "graceful-shutdown-rejected",
628
+ message: `Best-effort wrapper shutdown failed; ignoring (the turn has already settled or is settling independently): ${cause.message}`,
629
+ payload: { cause: cause.message }
630
+ });
631
+ } catch {}
632
+ });
633
+ };
433
634
  const abortListener = () => {
434
- gracefulShutdown();
635
+ shutdownInBackground();
435
636
  };
436
637
  ctx.abortSignal.addEventListener("abort", abortListener, { once: true });
437
638
  const detachAbortListener = () => ctx.abortSignal.removeEventListener("abort", abortListener);
@@ -441,22 +642,50 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
441
642
  clearStartupTimer();
442
643
  clearIdleTimer();
443
644
  detachAbortListener();
444
- fn();
645
+ let threw = false;
646
+ try {
647
+ fn();
648
+ } catch (err) {
649
+ threw = true;
650
+ try {
651
+ const cause = toErrorCause(err);
652
+ try {
653
+ helpers.log.error({
654
+ kind: "settlement-handler-threw",
655
+ message: `A dispatch settlement handler threw while finalising the turn; nacking (if not already signalled) instead of leaving the executor hung: ${cause.message}`,
656
+ payload: { cause: cause.message }
657
+ });
658
+ } catch {}
659
+ if (!ctx.isSignalled) try {
660
+ ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_STREAM_ERROR([cause.message], { cause }));
661
+ } catch {}
662
+ } catch {}
663
+ } finally {
664
+ if (threw) {
665
+ try {
666
+ shutdownInBackground();
667
+ } catch {}
668
+ try {
669
+ resolveIteration?.();
670
+ } catch {}
671
+ }
672
+ }
445
673
  };
446
674
  startupTimer = setTimeout(() => {
447
675
  settleOnce(() => {
448
676
  resolveIteration?.();
449
- gracefulShutdown();
677
+ shutdownInBackground();
450
678
  ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT([startupTimeoutMs]));
451
679
  });
452
680
  }, startupTimeoutMs);
453
681
  const armIdleTimer = () => {
454
682
  if (!sawReady || !sawInit) return;
683
+ if (inFlightToolCalls > 0) return;
455
684
  clearIdleTimer();
456
685
  idleTimer = setTimeout(() => {
457
686
  settleOnce(() => {
458
687
  resolveIteration?.();
459
- gracefulShutdown();
688
+ shutdownInBackground();
460
689
  ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_STREAM_STALLED([streamIdleTimeoutMs]));
461
690
  });
462
691
  }, streamIdleTimeoutMs);
@@ -490,7 +719,8 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
490
719
  return;
491
720
  }
492
721
  const args = require_guards.isObject(rawArgs) ? rawArgs : {};
493
- helpers.reportToolCall(requestId, {
722
+ const callId = (merged.toolCallIdFilter ?? require_chat_common.deCollideToolCallIds)(requestId, ctx);
723
+ helpers.reportToolCall(callId, {
494
724
  tool: tool.name,
495
725
  args
496
726
  });
@@ -506,24 +736,24 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
506
736
  else if (Array.isArray(raw) && raw.length > 0 && raw.every((m) => require_tool_call.Media.isMedia(m))) results = raw;
507
737
  else if (require_helpers.looksLikeSpooledArtifact(raw)) results = raw;
508
738
  else if (typeof raw === "string" || require_guards.isInstanceOf(raw, "Uint8Array", Uint8Array)) {
509
- const reader = await spoolStore.write(requestId, raw);
739
+ const reader = await spoolStore.write(callId, raw);
510
740
  results = new ((tool.artifactConstructor?.()) ?? require_spooled_artifact.SpooledArtifact)(reader);
511
741
  } else {
512
- const reader = await spoolStore.write(requestId, String(raw));
742
+ const reader = await spoolStore.write(callId, String(raw));
513
743
  results = new ((tool.artifactConstructor?.()) ?? require_spooled_artifact.SpooledArtifact)(reader);
514
744
  }
515
745
  } catch (err) {
516
746
  toolHadError = true;
517
747
  results = new require_tokenizable.Tokenizable(require_guards.isError(err) ? err.message : String(err));
518
748
  }
519
- helpers.reportToolCall(requestId, {
749
+ helpers.reportToolCall(callId, {
520
750
  results,
521
751
  isError: toolHadError,
522
752
  isComplete: true
523
753
  });
524
754
  const completedAt = nowIso();
525
755
  await ctx.storeToolCall(new require_tool_call.ToolCall({
526
- id: requestId,
756
+ id: callId,
527
757
  tool: tool.name,
528
758
  args,
529
759
  checksum: computeChecksum(tool.name, args),
@@ -540,7 +770,7 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
540
770
  try {
541
771
  rendered = await renderOutboundResult({
542
772
  raw: results,
543
- callId: requestId,
773
+ callId,
544
774
  inline: isArtifactTool,
545
775
  spoolStore,
546
776
  unsupportedResultMediaPolicy: merged.unsupportedResultMediaPolicy ?? merged.unsupportedMediaPolicy ?? "throw"
@@ -595,7 +825,6 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
595
825
  bridgedTools,
596
826
  extraArgs: merged.extraArgs
597
827
  });
598
- armIdleTimer();
599
828
  return;
600
829
  }
601
830
  if (event.type === "init") {
@@ -606,11 +835,15 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
606
835
  message: "Claude Code CLI initialized.",
607
836
  payload: event
608
837
  });
609
- if (event.mcpServerErrors && event.mcpServerErrors.length > 0) settleOnce(() => {
610
- finish();
611
- gracefulShutdown();
612
- ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED([event.mcpServerErrors.join(", ")]));
613
- });
838
+ if (event.mcpServerErrors && event.mcpServerErrors.length > 0) {
839
+ settleOnce(() => {
840
+ finish();
841
+ shutdownInBackground();
842
+ ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED([event.mcpServerErrors.join(", ")]));
843
+ });
844
+ return;
845
+ }
846
+ armIdleTimer();
614
847
  return;
615
848
  }
616
849
  if (event.type === "retry") {
@@ -626,14 +859,23 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
626
859
  currentMessageBuffer += event.delta;
627
860
  helpers.reportMessage(event.id, event.delta, { isComplete: event.isComplete });
628
861
  if (event.isComplete) await sealCurrentMessage();
862
+ armIdleTimer();
629
863
  return;
630
864
  }
631
865
  if (event.type === "thought_delta") {
632
866
  helpers.reportThought(event.id, event.delta, { isComplete: event.isComplete });
867
+ armIdleTimer();
633
868
  return;
634
869
  }
635
870
  if (event.type === "tool_call_request") {
636
- await handleToolCallRequest(event.requestId, event.tool, event.args);
871
+ inFlightToolCalls += 1;
872
+ clearIdleTimer();
873
+ try {
874
+ await handleToolCallRequest(event.requestId, event.tool, event.args);
875
+ } finally {
876
+ inFlightToolCalls = Math.max(0, inFlightToolCalls - 1);
877
+ }
878
+ armIdleTimer();
637
879
  return;
638
880
  }
639
881
  if (event.type === "result") {
@@ -663,7 +905,7 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
663
905
  if (event.type === "error") {
664
906
  settleOnce(() => {
665
907
  finish();
666
- gracefulShutdown();
908
+ shutdownInBackground();
667
909
  ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_WRAPPER_CRASHED([event.message]));
668
910
  });
669
911
  return;
@@ -689,12 +931,27 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
689
931
  });
690
932
  return;
691
933
  }
692
- onEvent(event);
934
+ onEvent(event).catch((err) => {
935
+ const cause = toErrorCause(err);
936
+ settleOnce(() => {
937
+ resolveIteration?.();
938
+ shutdownInBackground();
939
+ ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_STREAM_ERROR([cause.message], { cause }));
940
+ });
941
+ });
693
942
  return event;
694
943
  });
695
944
  child.stdout?.on("data", (chunk) => {
696
- eventReader.push(chunk);
697
- armIdleTimer();
945
+ try {
946
+ eventReader.push(chunk);
947
+ } catch (err) {
948
+ const cause = toErrorCause(err);
949
+ settleOnce(() => {
950
+ resolveIteration?.();
951
+ shutdownInBackground();
952
+ ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_STREAM_ERROR([cause.message], { cause }));
953
+ });
954
+ }
698
955
  });
699
956
  child.stdout?.on("end", () => {
700
957
  if (sawTerminalEvent) return;
@@ -729,6 +986,8 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
729
986
  };
730
987
  //#endregion
731
988
  exports.ClaudeCodeCliAdapter = ClaudeCodeCliAdapter;
989
+ exports.__resolveWrapperPathViaSelfReference = resolveWrapperPathViaSelfReference;
990
+ exports.__resolveWrapperPathWithFallback = resolveWrapperPathWithFallback;
732
991
  exports.resolveDefaultWrapperPath = resolveDefaultWrapperPath;
733
992
 
734
993
  //# sourceMappingURL=adapter.cjs.map