@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
@@ -22,7 +22,8 @@
22
22
  * checked client-side when `tokenEncoding` and `contextWindow` are configured.
23
23
  */
24
24
  export { ClaudeCodeCliAdapter, resolveDefaultWrapperPath } from "./adapter";
25
+ export { deCollideToolCallIds } from "../chat_common/index";
25
26
  export { descriptionToChatCompletionsJsonSchema, defaultDescriptionToChatCompletionsJsonSchema, renderUntrustedContent, defaultRenderUntrustedContent, renderTrustedContent, defaultRenderTrustedContent, renderStandingInstructions, defaultRenderStandingInstructions, renderMemories, defaultRenderMemories, renderRetrievableSafetyDirective, defaultRenderRetrievableSafetyDirective, renderFirstPartyRetrievables, defaultRenderFirstPartyRetrievables, renderThirdPartyPublicRetrievables, defaultRenderThirdPartyPublicRetrievables, renderThirdPartyPrivateRetrievables, defaultRenderThirdPartyPrivateRetrievables, renderRetrievables, defaultRenderRetrievables, renderRetrievableHandleBody, defaultRenderRetrievableHandleBody, renderArtifactHandleBody, defaultRenderArtifactHandleBody, renderThought, defaultRenderThought, filterThoughts, defaultFilterThoughts, toolsToChatCompletionsTools, defaultToolsToChatCompletionsTools, renderChatCompletionsSystemPrompt, defaultRenderChatCompletionsSystemPrompt, renderClaudeCodeCliTimelineMessage, defaultRenderClaudeCodeCliTimelineMessage, renderClaudeCodeCliToolCallResult, defaultRenderClaudeCodeCliToolCallResult, buildClaudeCodeCliPrompt, defaultBuildClaudeCodeCliPrompt, } from "./helpers";
26
- export type { DescriptionLike, JsonSchema, UntrustedContentAttrs, TrustedContentAttrs, StandingInstructionAttrs, MemoryAttrs, RetrievableAttrs, ThoughtAttrs, ChatCompletionsBucketLabel, ChatCompletionsBucketOrder, ChatCompletionsTool, UnsupportedMediaPolicy, ChatCompletionsRetryConfig, ChatHelpersCommon, ClaudeCodeCliHelpers, ClaudeCodeCliAdapterOptions, ExecaLike, ExecaResolver, ClaudeCodeCliExtraArg, WrapperBridgedTool, WrapperAuth, WrapperRunCommand, WrapperToolResultContentBlock, WrapperToolCallResponseCommand, WrapperShutdownCommand, WrapperCommand, WrapperReadyEvent, WrapperInitEvent, WrapperMessageDeltaEvent, WrapperThoughtDeltaEvent, WrapperToolCallRequestEvent, WrapperRetryEvent, WrapperResultEvent, WrapperErrorEvent, WrapperLogEvent, WrapperShutdownCompleteEvent, WrapperEvent, } from "./types";
27
+ export type { DescriptionLike, JsonSchema, UntrustedContentAttrs, TrustedContentAttrs, StandingInstructionAttrs, MemoryAttrs, RetrievableAttrs, ThoughtAttrs, ChatCompletionsBucketLabel, ChatCompletionsBucketOrder, ChatCompletionsTool, UnsupportedMediaPolicy, ChatCompletionsRetryConfig, ChatHelpersCommon, ToolCallIdFilterFn, ClaudeCodeCliHelpers, ClaudeCodeCliAdapterOptions, ExecaLike, ExecaResolver, ClaudeCodeCliExtraArg, WrapperBridgedTool, WrapperAuth, WrapperRunCommand, WrapperToolResultContentBlock, WrapperToolCallResponseCommand, WrapperShutdownCommand, WrapperCommand, WrapperReadyEvent, WrapperInitEvent, WrapperMessageDeltaEvent, WrapperThoughtDeltaEvent, WrapperToolCallRequestEvent, WrapperRetryEvent, WrapperResultEvent, WrapperErrorEvent, WrapperLogEvent, WrapperShutdownCompleteEvent, WrapperEvent, } from "./types";
27
28
  export { claudeCodeCliOptionsSchema, validateOptions } from "./validation";
28
- export { E_INVALID_CLAUDE_CODE_CLI_OPTIONS, E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, } from "./exceptions";
29
+ export { E_INVALID_CLAUDE_CODE_CLI_OPTIONS, E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, } from "./exceptions";
@@ -1,2 +1,2 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../../../chunk-Cek0wNdY.js");
2
+ require("../../../chunk-Cek0wNdY.cjs");
@@ -14,9 +14,10 @@
14
14
  import type { ClaudeCodeCliExtraArg } from "./wire";
15
15
  import type { SpoolStore } from "../../../common";
16
16
  import type { TokenEncodingId } from "../../../types";
17
- import type { ChatCompletionsBucketOrder, UnsupportedMediaPolicy, ChatHelpersCommon } from "../chat_common/types";
17
+ import type { ChatCompletionsBucketOrder, UnsupportedMediaPolicy, ChatHelpersCommon, ToolCallIdFilterFn } from "../chat_common/types";
18
18
  import type { Tokenizable, Memory, Message, Thought, ToolCall, Retrievable, Tool, ArtifactTool, ToolRegistry, SpooledArtifact, Media } from "../../../common";
19
19
  export type { DescriptionLike, JsonSchema, UntrustedContentAttrs, TrustedContentAttrs, StandingInstructionAttrs, MemoryAttrs, RetrievableAttrs, ThoughtAttrs, ChatCompletionsBucketLabel, ChatCompletionsBucketOrder, ChatCompletionsTool, UnsupportedMediaPolicy, ChatCompletionsRetryConfig, ChatHelpersCommon, } from "../chat_common/types";
20
+ export type { ToolCallIdFilterFn } from "../chat_common/types";
20
21
  export type { ClaudeCodeCliExtraArg, WrapperBridgedTool, WrapperAuth, WrapperRunCommand, WrapperToolResultContentBlock, WrapperToolCallResponseCommand, WrapperShutdownCommand, WrapperCommand, WrapperReadyEvent, WrapperInitEvent, WrapperMessageDeltaEvent, WrapperThoughtDeltaEvent, WrapperToolCallRequestEvent, WrapperRetryEvent, WrapperResultEvent, WrapperErrorEvent, WrapperLogEvent, WrapperShutdownCompleteEvent, WrapperEvent, } from "./wire";
21
22
  /**
22
23
  * Full translation-helper contract for the Claude Code CLI battery. Extends the wire-shape-
@@ -140,7 +141,13 @@ export type ExecaResolver = ExecaLike | (() => ExecaLike | {
140
141
  export interface ClaudeCodeCliAdapterOptions {
141
142
  /** The `execa` function or an async resolver for it. Defaults to a lazy dynamic import of the `execa` package (optional peer). */
142
143
  execa?: ExecaResolver;
143
- /** Overridable path to the built wrapper asset. Defaults to `resolveDefaultWrapperPath()`. */
144
+ /**
145
+ * Overridable path to the built wrapper asset. Defaults to `resolveDefaultWrapperPath()`,
146
+ * falling back to a package-self-reference lookup if that path does not exist on disk (e.g.
147
+ * this adapter was bundled by a consumer, relocating it outside `@nhtio/adk`'s own directory
148
+ * tree). Set this explicitly if both of those fail — surfaced as
149
+ * {@link @nhtio/adk/batteries/llm/claude_code_cli!E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND}.
150
+ */
144
151
  wrapperPath?: string;
145
152
  /** Path to the `claude` binary. Defaults to `'claude'` (resolved via `PATH`). */
146
153
  claudeBin?: string;
@@ -200,6 +207,33 @@ export interface ClaudeCodeCliAdapterOptions {
200
207
  disableNonessentialTraffic?: boolean;
201
208
  /** Unique identity label for the assistant instance. */
202
209
  selfIdentity?: string;
210
+ /**
211
+ * Ingress hook for adapting the wrapper's per-spawn `requestId` into the ADK-facing tool-call
212
+ * id.
213
+ *
214
+ * @remarks
215
+ * Unlike every other Chat-family battery (where this hook is opt-in and its absence means
216
+ * pass-through), this battery's wrapper protocol resets its `requestId` counter to `"0"` on
217
+ * EVERY spawn (see `mcp_bridge.ts`), and a fresh wrapper is spawned per dispatch ITERATION —
218
+ * so a multi-iteration turn structurally guarantees a same-id collision the moment a second
219
+ * tool-calling iteration occurs, not merely as a vendor/model quirk. Concretely, a same-id
220
+ * collision trips one of two DIFFERENT id-tracking structures depending on the shape of the
221
+ * turn: `DispatchExecutorHelpers.reportToolCall`'s own internal per-dispatch bookkeeping (an
222
+ * id -> stream-state map local to `dispatch_runner.ts`'s `#buildHelpers`, which throws `tool
223
+ * call "<id>" is already complete` on a duplicate) if the earlier call with that id already
224
+ * completed within the SAME dispatch's helpers instance; or `ctx.turnToolCalls` (the
225
+ * `Set<ToolCall>` `deCollideToolCallIds` itself inspects to pick a fresh id) if the collision is
226
+ * against a call recorded in an EARLIER iteration of the same turn. These are two distinct
227
+ * pieces of state, not one — this option's default only needs to satisfy the second, since
228
+ * {@link @nhtio/adk!deCollideToolCallIds} renames the id BEFORE it ever reaches
229
+ * `reportToolCall`, which is what prevents both. Left unset, this defaults to
230
+ * {@link @nhtio/adk!deCollideToolCallIds} — NOT identity pass-through — so the crash this option
231
+ * exists to prevent cannot happen by omission; set an explicit filter (or `(id) => id` to opt
232
+ * back into raw pass-through) only if a different id strategy is required. The wrapper's OWN
233
+ * `requestId` (used to correlate the `tool_call_response` written back over the wire) is never
234
+ * affected by this hook — only the ADK-facing `ToolCall.id`/`callId` are renamed.
235
+ */
236
+ toolCallIdFilter?: ToolCallIdFilterFn;
203
237
  /** Whether the executor acks automatically on a tool-call-free terminal answer. */
204
238
  autoAck?: boolean;
205
239
  /** Forwarded to `--forward-subagent-text` when true. Default false — subagent text is invisible by default (documented v1 limitation). */
@@ -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
- const require_common = require("../../../common-Cb1h54HM.js");
2
+ require("../../../chunk-Cek0wNdY.cjs");
3
+ const require_tokenizable = require("../../../tokenizable-DDIdXbJN.cjs");
4
+ const require_common = require("../../../common-7gCR3zQu.cjs");
5
5
  require("../../../guards.cjs");
6
6
  const require_batteries_llm_claude_code_cli_exceptions = require("./exceptions.cjs");
7
7
  let _nhtio_validation = require("@nhtio/validation");
@@ -75,6 +75,7 @@ var claudeCodeCliOptionsSchema = _nhtio_validation.validator.object({
75
75
  maxBudgetUsd: _nhtio_validation.validator.number().min(0).optional(),
76
76
  fallbackModel: _nhtio_validation.validator.array().items(_nhtio_validation.validator.string().min(1)).optional(),
77
77
  selfIdentity: _nhtio_validation.validator.string().min(1).default("assistant"),
78
+ toolCallIdFilter: _nhtio_validation.validator.function().optional(),
78
79
  autoAck: _nhtio_validation.validator.boolean().default(false),
79
80
  forwardSubagentText: _nhtio_validation.validator.boolean().default(false),
80
81
  bucketOrder: bucketOrderSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"validation.cjs","names":[],"sources":["../../../../src/batteries/llm/claude_code_cli/validation.ts"],"sourcesContent":["/**\n * Runtime validation schema and wrapper for Claude Code CLI adapter options.\n *\n * @module @nhtio/adk/batteries/llm/claude_code_cli/validation\n *\n * @remarks\n * Schema and call-site wrapper for validating `ClaudeCodeCliAdapterOptions`. Used at construction\n * time and at the start of every iteration against the merged options shape (stash > executor >\n * constructor). Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` on failure — same hard-fail policy as\n * every other ADK contract.\n *\n * Three invariants enforced here that have no equivalent in the other LLM batteries:\n * - `apiKey`/`authToken` are mutually exclusive AND at least one is required (`.xor`).\n * - `extraArgs` entries are validated against a strict six-flag allowlist, with per-flag value\n * arity, and every value string is rejected if it starts with `-` — the fix for the `--betas`\n * variadic-value injection hazard (a value string spelling another flag would otherwise reach\n * the CLI's own argv parser as a distinct token).\n * - `process.platform` is checked at validation time: this battery is POSIX-only in v1 (reliable\n * process-group control requires POSIX process groups), mirroring\n * `src/batteries/sandbox/node/srt_enforcer.ts`'s own platform-boundary precedent.\n */\n\nimport { isError } from '@nhtio/adk/guards'\nimport { validator, ValidationError } from '@nhtio/validation'\nimport { E_INVALID_CLAUDE_CODE_CLI_OPTIONS } from './exceptions'\nimport { byteStoreSchema, TokenEncoding } from '@nhtio/adk/common'\nimport type { ClaudeCodeCliAdapterOptions } from './types'\n\n// ─── Sub-schemas ──────────────────────────────────────────────────────────────\n\nconst bucketLabelSchema = validator\n .string()\n .valid('standingInstructions', 'memories', 'retrievables', 'timeline')\n\nconst bucketOrderSchema = validator\n .array()\n .items(bucketLabelSchema)\n .unique()\n .default(['standingInstructions', 'memories', 'retrievables', 'timeline'])\n\nconst tokenEncodingSchema = validator\n .alternatives(\n // Known values are suggestions from the canonical list, not a whitelist: consumers may provide\n // a custom or newer tokenizer name. The field accepts any non-empty string, explicit null, or\n // absent (undefined = \"no token counting\"). `.optional()` preserves the null/undefined\n // disposition required by adk/require-validator-any-required.\n validator\n .string()\n .min(1)\n .description(`Known encodings: ${TokenEncoding.join(', ')}`),\n validator.any().valid(null).optional()\n )\n .default(null)\n\nconst unsupportedMediaPolicySchema = validator\n .alternatives(\n validator.string().valid('throw', 'fallback-stash', 'synthetic-description'),\n validator\n .object({\n mode: validator.string().valid('fallback-stash').required(),\n stashKeys: validator.array().items(validator.string().min(1)).required(),\n })\n .unknown(false)\n )\n .default('throw')\n\nconst helperSchema = validator.function()\n\nconst helpersSchema = validator\n .object({\n descriptionToChatCompletionsJsonSchema: helperSchema.optional(),\n renderUntrustedContent: helperSchema.optional(),\n renderTrustedContent: helperSchema.optional(),\n renderStandingInstructions: helperSchema.optional(),\n renderMemories: helperSchema.optional(),\n renderRetrievables: helperSchema.optional(),\n renderRetrievableHandleBody: helperSchema.optional(),\n renderRetrievableSafetyDirective: helperSchema.optional(),\n renderFirstPartyRetrievables: helperSchema.optional(),\n renderThirdPartyPublicRetrievables: helperSchema.optional(),\n renderThirdPartyPrivateRetrievables: helperSchema.optional(),\n renderThought: helperSchema.optional(),\n filterThoughts: helperSchema.optional(),\n toolsToChatCompletionsTools: helperSchema.optional(),\n renderChatCompletionsSystemPrompt: helperSchema.optional(),\n renderClaudeCodeCliTimelineMessage: helperSchema.optional(),\n renderClaudeCodeCliToolCallResult: helperSchema.optional(),\n buildClaudeCodeCliPrompt: helperSchema.optional(),\n })\n .unknown(false)\n\n// `extraArgs`: a structured allowlist, not a flat string[]. Every value string, in every\n// position, is rejected if it starts with `-` — the fix for the --betas injection hazard.\nconst NOT_A_FLAG_RE = /^(?!-).+$/\n\nconst singleValueSchema = validator.string().min(1).pattern(NOT_A_FLAG_RE)\nconst multiValueSchema = validator\n .array()\n .items(validator.string().min(1).pattern(NOT_A_FLAG_RE))\n .min(1)\n\nconst extraArgSchema = validator\n .alternatives(\n // --betas is the only flag accepting a string[] value.\n validator\n .object({\n flag: validator.string().valid('--betas').required(),\n value: multiValueSchema.required(),\n })\n .unknown(false),\n // --prompt-suggestions is the only flag with an OPTIONAL value.\n validator\n .object({\n flag: validator.string().valid('--prompt-suggestions').required(),\n value: singleValueSchema.optional(),\n })\n .unknown(false),\n // Every remaining allowlisted flag requires a single non-empty, non-flag-shaped string value.\n validator\n .object({\n flag: validator.string().valid('--effort', '--agent', '--json-schema', '--name').required(),\n value: singleValueSchema.required(),\n })\n .unknown(false)\n )\n .required()\n\nconst extraArgsSchema = validator.array().items(extraArgSchema).optional()\n\n// ─── Top-level schema ─────────────────────────────────────────────────────────\n\n/**\n * Validator schema for `ClaudeCodeCliAdapterOptions`. Used by `validateOptions` at construction\n * time and again at the start of every iteration after options have been merged (stash > executor\n * > constructor). Rejects unknown top-level keys so typos fail loud.\n */\nexport const claudeCodeCliOptionsSchema = validator\n .object<ClaudeCodeCliAdapterOptions>({\n // ADK control\n execa: validator.function().optional(),\n wrapperPath: validator.string().optional(),\n claudeBin: validator.string().default('claude'),\n appendSystemPrompt: validator.string().optional(),\n apiKey: validator.string().optional(),\n authToken: validator.string().optional(),\n baseURL: validator.string().optional(),\n cwd: validator.string().optional(),\n addDir: validator.array().items(validator.string().min(1)).optional(),\n disallowedTools: validator.array().items(validator.string().min(1)).default([]),\n maxTurns: validator\n .number()\n .valid(1)\n .messages({\n 'any.only':\n 'maxTurns is deprecated and inert: single-turn dispatch is the fixed battery contract; ' +\n 'only maxTurns: 1 is accepted, and the option is ignored because argv always carries --max-turns 1.',\n })\n .optional(),\n contextWindow: validator.number().integer().min(1).optional(),\n tokenEncoding: tokenEncodingSchema,\n maxBudgetUsd: validator.number().min(0).optional(),\n fallbackModel: validator.array().items(validator.string().min(1)).optional(),\n selfIdentity: validator.string().min(1).default('assistant'),\n autoAck: validator.boolean().default(false),\n forwardSubagentText: validator.boolean().default(false),\n bucketOrder: bucketOrderSchema,\n thoughtSurfacing: validator\n .string()\n .valid('all-self', 'latest-self', 'all')\n .default('all-self'),\n replayCompatibility: validator.array().items(validator.string().min(1)).default([]),\n helpers: helpersSchema.optional(),\n spoolStore: byteStoreSchema.optional(),\n unsupportedMediaPolicy: unsupportedMediaPolicySchema,\n unsupportedResultMediaPolicy: unsupportedMediaPolicySchema,\n extraArgs: extraArgsSchema,\n\n // CLI-native safety caps / timeouts\n streamIdleTimeoutMs: validator.number().integer().min(0).default(60_000),\n startupTimeoutMs: validator.number().integer().min(0).default(45_000),\n disposeGraceMs: validator.number().integer().min(0).default(2_000),\n mcpToolIdleTimeoutMs: validator.number().integer().min(0).optional(),\n disableTelemetry: validator.boolean().optional(),\n disableErrorReporting: validator.boolean().optional(),\n disableNonessentialTraffic: validator.boolean().optional(),\n\n // Required\n model: validator.string().required(),\n })\n .unknown(false)\n // Exactly one of apiKey/authToken must be set.\n .xor('apiKey', 'authToken')\n // POSIX-only in v1: reliable process-group control requires POSIX process groups, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent — refuse rather\n // than silently degrade.\n .custom((value, helpers) => {\n // POSIX-only in v1: reliable process-group control requires process.kill(-pid, signal),\n // which has no Windows equivalent — refuse rather than silently degrade, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent.\n if (process.platform !== 'darwin' && process.platform !== 'linux') {\n return helpers.error('any.invalid')\n }\n return value\n })\n\nconst isValidationError = (value: unknown): value is ValidationError =>\n isError(value) && Array.isArray((value as ValidationError).details)\n\nconst formatValidationDetails = (err: ValidationError): string =>\n err.details.map((d) => d.message).join(' and ')\n\n/**\n * Validates an arbitrary input against `claudeCodeCliOptionsSchema` and returns the resolved\n * options shape. Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` (carrying the validator's error\n * report on `cause`) on failure.\n *\n * @param input - The raw options object to validate.\n * @returns The resolved options object with defaults filled in.\n */\nexport const validateOptions = (input: unknown): ClaudeCodeCliAdapterOptions => {\n const { value, error } = claudeCodeCliOptionsSchema.validate(input, {\n abortEarly: false,\n convert: false,\n })\n if (error) {\n throw new E_INVALID_CLAUDE_CODE_CLI_OPTIONS([formatValidationDetails(error)], { cause: error })\n }\n return value as ClaudeCodeCliAdapterOptions\n}\n\n// suppress unused import warning when the alias isn't referenced\nvoid isValidationError\n"],"mappings":";;;;;;;;AA8BA,IAAM,oBAAoB,kBAAA,UACvB,OAAO,EACP,MAAM,wBAAwB,YAAY,gBAAgB,UAAU;AAEvE,IAAM,oBAAoB,kBAAA,UACvB,MAAM,EACN,MAAM,iBAAiB,EACvB,OAAO,EACP,QAAQ;CAAC;CAAwB;CAAY;CAAgB;AAAU,CAAC;AAE3E,IAAM,sBAAsB,kBAAA,UACzB,aAKC,kBAAA,UACG,OAAO,EACP,IAAI,CAAC,EACL,YAAY,oBAAoB,oBAAA,cAAc,KAAK,IAAI,GAAG,GAC7D,kBAAA,UAAU,IAAI,EAAE,MAAM,IAAI,EAAE,SAAS,CACvC,EACC,QAAQ,IAAI;AAEf,IAAM,+BAA+B,kBAAA,UAClC,aACC,kBAAA,UAAU,OAAO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,OAAO,YAAY;CAI1B,IAAI,QAAQ,aAAa,YAAY,QAAQ,aAAa,SACxD,OAAO,QAAQ,MAAM,aAAa;CAEpC,OAAO;AACT,CAAC;AAKH,IAAM,2BAA2B,QAC/B,IAAI,QAAQ,KAAK,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO;;;;;;;;;AAUhD,IAAa,mBAAmB,UAAgD;CAC9E,MAAM,EAAE,OAAO,UAAU,2BAA2B,SAAS,OAAO;EAClE,YAAY;EACZ,SAAS;CACX,CAAC;CACD,IAAI,OACF,MAAM,IAAI,iDAAA,kCAAkC,CAAC,wBAAwB,KAAK,CAAC,GAAG,EAAE,OAAO,MAAM,CAAC;CAEhG,OAAO;AACT"}
1
+ {"version":3,"file":"validation.cjs","names":[],"sources":["../../../../src/batteries/llm/claude_code_cli/validation.ts"],"sourcesContent":["/**\n * Runtime validation schema and wrapper for Claude Code CLI adapter options.\n *\n * @module @nhtio/adk/batteries/llm/claude_code_cli/validation\n *\n * @remarks\n * Schema and call-site wrapper for validating `ClaudeCodeCliAdapterOptions`. Used at construction\n * time and at the start of every iteration against the merged options shape (stash > executor >\n * constructor). Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` on failure — same hard-fail policy as\n * every other ADK contract.\n *\n * Three invariants enforced here that have no equivalent in the other LLM batteries:\n * - `apiKey`/`authToken` are mutually exclusive AND at least one is required (`.xor`).\n * - `extraArgs` entries are validated against a strict six-flag allowlist, with per-flag value\n * arity, and every value string is rejected if it starts with `-` — the fix for the `--betas`\n * variadic-value injection hazard (a value string spelling another flag would otherwise reach\n * the CLI's own argv parser as a distinct token).\n * - `process.platform` is checked at validation time: this battery is POSIX-only in v1 (reliable\n * process-group control requires POSIX process groups), mirroring\n * `src/batteries/sandbox/node/srt_enforcer.ts`'s own platform-boundary precedent.\n */\n\nimport { isError } from '@nhtio/adk/guards'\nimport { validator, ValidationError } from '@nhtio/validation'\nimport { E_INVALID_CLAUDE_CODE_CLI_OPTIONS } from './exceptions'\nimport { byteStoreSchema, TokenEncoding } from '@nhtio/adk/common'\nimport type { ClaudeCodeCliAdapterOptions } from './types'\n\n// ─── Sub-schemas ──────────────────────────────────────────────────────────────\n\nconst bucketLabelSchema = validator\n .string()\n .valid('standingInstructions', 'memories', 'retrievables', 'timeline')\n\nconst bucketOrderSchema = validator\n .array()\n .items(bucketLabelSchema)\n .unique()\n .default(['standingInstructions', 'memories', 'retrievables', 'timeline'])\n\nconst tokenEncodingSchema = validator\n .alternatives(\n // Known values are suggestions from the canonical list, not a whitelist: consumers may provide\n // a custom or newer tokenizer name. The field accepts any non-empty string, explicit null, or\n // absent (undefined = \"no token counting\"). `.optional()` preserves the null/undefined\n // disposition required by adk/require-validator-any-required.\n validator\n .string()\n .min(1)\n .description(`Known encodings: ${TokenEncoding.join(', ')}`),\n validator.any().valid(null).optional()\n )\n .default(null)\n\nconst unsupportedMediaPolicySchema = validator\n .alternatives(\n validator.string().valid('throw', 'fallback-stash', 'synthetic-description'),\n validator\n .object({\n mode: validator.string().valid('fallback-stash').required(),\n stashKeys: validator.array().items(validator.string().min(1)).required(),\n })\n .unknown(false)\n )\n .default('throw')\n\nconst helperSchema = validator.function()\n\nconst helpersSchema = validator\n .object({\n descriptionToChatCompletionsJsonSchema: helperSchema.optional(),\n renderUntrustedContent: helperSchema.optional(),\n renderTrustedContent: helperSchema.optional(),\n renderStandingInstructions: helperSchema.optional(),\n renderMemories: helperSchema.optional(),\n renderRetrievables: helperSchema.optional(),\n renderRetrievableHandleBody: helperSchema.optional(),\n renderRetrievableSafetyDirective: helperSchema.optional(),\n renderFirstPartyRetrievables: helperSchema.optional(),\n renderThirdPartyPublicRetrievables: helperSchema.optional(),\n renderThirdPartyPrivateRetrievables: helperSchema.optional(),\n renderThought: helperSchema.optional(),\n filterThoughts: helperSchema.optional(),\n toolsToChatCompletionsTools: helperSchema.optional(),\n renderChatCompletionsSystemPrompt: helperSchema.optional(),\n renderClaudeCodeCliTimelineMessage: helperSchema.optional(),\n renderClaudeCodeCliToolCallResult: helperSchema.optional(),\n buildClaudeCodeCliPrompt: helperSchema.optional(),\n })\n .unknown(false)\n\n// `extraArgs`: a structured allowlist, not a flat string[]. Every value string, in every\n// position, is rejected if it starts with `-` — the fix for the --betas injection hazard.\nconst NOT_A_FLAG_RE = /^(?!-).+$/\n\nconst singleValueSchema = validator.string().min(1).pattern(NOT_A_FLAG_RE)\nconst multiValueSchema = validator\n .array()\n .items(validator.string().min(1).pattern(NOT_A_FLAG_RE))\n .min(1)\n\nconst extraArgSchema = validator\n .alternatives(\n // --betas is the only flag accepting a string[] value.\n validator\n .object({\n flag: validator.string().valid('--betas').required(),\n value: multiValueSchema.required(),\n })\n .unknown(false),\n // --prompt-suggestions is the only flag with an OPTIONAL value.\n validator\n .object({\n flag: validator.string().valid('--prompt-suggestions').required(),\n value: singleValueSchema.optional(),\n })\n .unknown(false),\n // Every remaining allowlisted flag requires a single non-empty, non-flag-shaped string value.\n validator\n .object({\n flag: validator.string().valid('--effort', '--agent', '--json-schema', '--name').required(),\n value: singleValueSchema.required(),\n })\n .unknown(false)\n )\n .required()\n\nconst extraArgsSchema = validator.array().items(extraArgSchema).optional()\n\n// ─── Top-level schema ─────────────────────────────────────────────────────────\n\n/**\n * Validator schema for `ClaudeCodeCliAdapterOptions`. Used by `validateOptions` at construction\n * time and again at the start of every iteration after options have been merged (stash > executor\n * > constructor). Rejects unknown top-level keys so typos fail loud.\n */\nexport const claudeCodeCliOptionsSchema = validator\n .object<ClaudeCodeCliAdapterOptions>({\n // ADK control\n execa: validator.function().optional(),\n wrapperPath: validator.string().optional(),\n claudeBin: validator.string().default('claude'),\n appendSystemPrompt: validator.string().optional(),\n apiKey: validator.string().optional(),\n authToken: validator.string().optional(),\n baseURL: validator.string().optional(),\n cwd: validator.string().optional(),\n addDir: validator.array().items(validator.string().min(1)).optional(),\n disallowedTools: validator.array().items(validator.string().min(1)).default([]),\n maxTurns: validator\n .number()\n .valid(1)\n .messages({\n 'any.only':\n 'maxTurns is deprecated and inert: single-turn dispatch is the fixed battery contract; ' +\n 'only maxTurns: 1 is accepted, and the option is ignored because argv always carries --max-turns 1.',\n })\n .optional(),\n contextWindow: validator.number().integer().min(1).optional(),\n tokenEncoding: tokenEncodingSchema,\n maxBudgetUsd: validator.number().min(0).optional(),\n fallbackModel: validator.array().items(validator.string().min(1)).optional(),\n selfIdentity: validator.string().min(1).default('assistant'),\n toolCallIdFilter: validator.function().optional(),\n autoAck: validator.boolean().default(false),\n forwardSubagentText: validator.boolean().default(false),\n bucketOrder: bucketOrderSchema,\n thoughtSurfacing: validator\n .string()\n .valid('all-self', 'latest-self', 'all')\n .default('all-self'),\n replayCompatibility: validator.array().items(validator.string().min(1)).default([]),\n helpers: helpersSchema.optional(),\n spoolStore: byteStoreSchema.optional(),\n unsupportedMediaPolicy: unsupportedMediaPolicySchema,\n unsupportedResultMediaPolicy: unsupportedMediaPolicySchema,\n extraArgs: extraArgsSchema,\n\n // CLI-native safety caps / timeouts\n streamIdleTimeoutMs: validator.number().integer().min(0).default(60_000),\n startupTimeoutMs: validator.number().integer().min(0).default(45_000),\n disposeGraceMs: validator.number().integer().min(0).default(2_000),\n mcpToolIdleTimeoutMs: validator.number().integer().min(0).optional(),\n disableTelemetry: validator.boolean().optional(),\n disableErrorReporting: validator.boolean().optional(),\n disableNonessentialTraffic: validator.boolean().optional(),\n\n // Required\n model: validator.string().required(),\n })\n .unknown(false)\n // Exactly one of apiKey/authToken must be set.\n .xor('apiKey', 'authToken')\n // POSIX-only in v1: reliable process-group control requires POSIX process groups, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent — refuse rather\n // than silently degrade.\n .custom((value, helpers) => {\n // POSIX-only in v1: reliable process-group control requires process.kill(-pid, signal),\n // which has no Windows equivalent — refuse rather than silently degrade, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent.\n if (process.platform !== 'darwin' && process.platform !== 'linux') {\n return helpers.error('any.invalid')\n }\n return value\n })\n\nconst isValidationError = (value: unknown): value is ValidationError =>\n isError(value) && Array.isArray((value as ValidationError).details)\n\nconst formatValidationDetails = (err: ValidationError): string =>\n err.details.map((d) => d.message).join(' and ')\n\n/**\n * Validates an arbitrary input against `claudeCodeCliOptionsSchema` and returns the resolved\n * options shape. Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` (carrying the validator's error\n * report on `cause`) on failure.\n *\n * @param input - The raw options object to validate.\n * @returns The resolved options object with defaults filled in.\n */\nexport const validateOptions = (input: unknown): ClaudeCodeCliAdapterOptions => {\n const { value, error } = claudeCodeCliOptionsSchema.validate(input, {\n abortEarly: false,\n convert: false,\n })\n if (error) {\n throw new E_INVALID_CLAUDE_CODE_CLI_OPTIONS([formatValidationDetails(error)], { cause: error })\n }\n return value as ClaudeCodeCliAdapterOptions\n}\n\n// suppress unused import warning when the alias isn't referenced\nvoid isValidationError\n"],"mappings":";;;;;;;;AA8BA,IAAM,oBAAoB,kBAAA,UACvB,OAAO,EACP,MAAM,wBAAwB,YAAY,gBAAgB,UAAU;AAEvE,IAAM,oBAAoB,kBAAA,UACvB,MAAM,EACN,MAAM,iBAAiB,EACvB,OAAO,EACP,QAAQ;CAAC;CAAwB;CAAY;CAAgB;AAAU,CAAC;AAE3E,IAAM,sBAAsB,kBAAA,UACzB,aAKC,kBAAA,UACG,OAAO,EACP,IAAI,CAAC,EACL,YAAY,oBAAoB,oBAAA,cAAc,KAAK,IAAI,GAAG,GAC7D,kBAAA,UAAU,IAAI,EAAE,MAAM,IAAI,EAAE,SAAS,CACvC,EACC,QAAQ,IAAI;AAEf,IAAM,+BAA+B,kBAAA,UAClC,aACC,kBAAA,UAAU,OAAO,EAAE,MAAM,SAAS,kBAAkB,uBAAuB,GAC3E,kBAAA,UACG,OAAO;CACN,MAAM,kBAAA,UAAU,OAAO,EAAE,MAAM,gBAAgB,EAAE,SAAS;CAC1D,WAAW,kBAAA,UAAU,MAAM,EAAE,MAAM,kBAAA,UAAU,OAAO,EAAE,IA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AQ,KAAK,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO;;;;;;;;;AAUhD,IAAa,mBAAmB,UAAgD;CAC9E,MAAM,EAAE,OAAO,UAAU,2BAA2B,SAAS,OAAO;EAClE,YAAY;EACZ,SAAS;CACX,CAAC;CACD,IAAI,OACF,MAAM,IAAI,iDAAA,kCAAkC,CAAC,wBAAwB,KAAK,CAAC,GAAG,EAAE,OAAO,MAAM,CAAC;CAEhG,OAAO;AACT"}
@@ -1,5 +1,5 @@
1
1
  import { n as TokenEncoding } from "../../../tokenizable-xPXj1AQX.mjs";
2
- import { o as byteStoreSchema } from "../../../common-AhsMepUS.mjs";
2
+ import { o as byteStoreSchema } from "../../../common-B5maOoF_.mjs";
3
3
  import "../../../guards.mjs";
4
4
  import { E_INVALID_CLAUDE_CODE_CLI_OPTIONS } from "./exceptions.mjs";
5
5
  import { validator } from "@nhtio/validation";
@@ -73,6 +73,7 @@ var claudeCodeCliOptionsSchema = validator.object({
73
73
  maxBudgetUsd: validator.number().min(0).optional(),
74
74
  fallbackModel: validator.array().items(validator.string().min(1)).optional(),
75
75
  selfIdentity: validator.string().min(1).default("assistant"),
76
+ toolCallIdFilter: validator.function().optional(),
76
77
  autoAck: validator.boolean().default(false),
77
78
  forwardSubagentText: validator.boolean().default(false),
78
79
  bucketOrder: bucketOrderSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"validation.mjs","names":[],"sources":["../../../../src/batteries/llm/claude_code_cli/validation.ts"],"sourcesContent":["/**\n * Runtime validation schema and wrapper for Claude Code CLI adapter options.\n *\n * @module @nhtio/adk/batteries/llm/claude_code_cli/validation\n *\n * @remarks\n * Schema and call-site wrapper for validating `ClaudeCodeCliAdapterOptions`. Used at construction\n * time and at the start of every iteration against the merged options shape (stash > executor >\n * constructor). Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` on failure — same hard-fail policy as\n * every other ADK contract.\n *\n * Three invariants enforced here that have no equivalent in the other LLM batteries:\n * - `apiKey`/`authToken` are mutually exclusive AND at least one is required (`.xor`).\n * - `extraArgs` entries are validated against a strict six-flag allowlist, with per-flag value\n * arity, and every value string is rejected if it starts with `-` — the fix for the `--betas`\n * variadic-value injection hazard (a value string spelling another flag would otherwise reach\n * the CLI's own argv parser as a distinct token).\n * - `process.platform` is checked at validation time: this battery is POSIX-only in v1 (reliable\n * process-group control requires POSIX process groups), mirroring\n * `src/batteries/sandbox/node/srt_enforcer.ts`'s own platform-boundary precedent.\n */\n\nimport { isError } from '@nhtio/adk/guards'\nimport { validator, ValidationError } from '@nhtio/validation'\nimport { E_INVALID_CLAUDE_CODE_CLI_OPTIONS } from './exceptions'\nimport { byteStoreSchema, TokenEncoding } from '@nhtio/adk/common'\nimport type { ClaudeCodeCliAdapterOptions } from './types'\n\n// ─── Sub-schemas ──────────────────────────────────────────────────────────────\n\nconst bucketLabelSchema = validator\n .string()\n .valid('standingInstructions', 'memories', 'retrievables', 'timeline')\n\nconst bucketOrderSchema = validator\n .array()\n .items(bucketLabelSchema)\n .unique()\n .default(['standingInstructions', 'memories', 'retrievables', 'timeline'])\n\nconst tokenEncodingSchema = validator\n .alternatives(\n // Known values are suggestions from the canonical list, not a whitelist: consumers may provide\n // a custom or newer tokenizer name. The field accepts any non-empty string, explicit null, or\n // absent (undefined = \"no token counting\"). `.optional()` preserves the null/undefined\n // disposition required by adk/require-validator-any-required.\n validator\n .string()\n .min(1)\n .description(`Known encodings: ${TokenEncoding.join(', ')}`),\n validator.any().valid(null).optional()\n )\n .default(null)\n\nconst unsupportedMediaPolicySchema = validator\n .alternatives(\n validator.string().valid('throw', 'fallback-stash', 'synthetic-description'),\n validator\n .object({\n mode: validator.string().valid('fallback-stash').required(),\n stashKeys: validator.array().items(validator.string().min(1)).required(),\n })\n .unknown(false)\n )\n .default('throw')\n\nconst helperSchema = validator.function()\n\nconst helpersSchema = validator\n .object({\n descriptionToChatCompletionsJsonSchema: helperSchema.optional(),\n renderUntrustedContent: helperSchema.optional(),\n renderTrustedContent: helperSchema.optional(),\n renderStandingInstructions: helperSchema.optional(),\n renderMemories: helperSchema.optional(),\n renderRetrievables: helperSchema.optional(),\n renderRetrievableHandleBody: helperSchema.optional(),\n renderRetrievableSafetyDirective: helperSchema.optional(),\n renderFirstPartyRetrievables: helperSchema.optional(),\n renderThirdPartyPublicRetrievables: helperSchema.optional(),\n renderThirdPartyPrivateRetrievables: helperSchema.optional(),\n renderThought: helperSchema.optional(),\n filterThoughts: helperSchema.optional(),\n toolsToChatCompletionsTools: helperSchema.optional(),\n renderChatCompletionsSystemPrompt: helperSchema.optional(),\n renderClaudeCodeCliTimelineMessage: helperSchema.optional(),\n renderClaudeCodeCliToolCallResult: helperSchema.optional(),\n buildClaudeCodeCliPrompt: helperSchema.optional(),\n })\n .unknown(false)\n\n// `extraArgs`: a structured allowlist, not a flat string[]. Every value string, in every\n// position, is rejected if it starts with `-` — the fix for the --betas injection hazard.\nconst NOT_A_FLAG_RE = /^(?!-).+$/\n\nconst singleValueSchema = validator.string().min(1).pattern(NOT_A_FLAG_RE)\nconst multiValueSchema = validator\n .array()\n .items(validator.string().min(1).pattern(NOT_A_FLAG_RE))\n .min(1)\n\nconst extraArgSchema = validator\n .alternatives(\n // --betas is the only flag accepting a string[] value.\n validator\n .object({\n flag: validator.string().valid('--betas').required(),\n value: multiValueSchema.required(),\n })\n .unknown(false),\n // --prompt-suggestions is the only flag with an OPTIONAL value.\n validator\n .object({\n flag: validator.string().valid('--prompt-suggestions').required(),\n value: singleValueSchema.optional(),\n })\n .unknown(false),\n // Every remaining allowlisted flag requires a single non-empty, non-flag-shaped string value.\n validator\n .object({\n flag: validator.string().valid('--effort', '--agent', '--json-schema', '--name').required(),\n value: singleValueSchema.required(),\n })\n .unknown(false)\n )\n .required()\n\nconst extraArgsSchema = validator.array().items(extraArgSchema).optional()\n\n// ─── Top-level schema ─────────────────────────────────────────────────────────\n\n/**\n * Validator schema for `ClaudeCodeCliAdapterOptions`. Used by `validateOptions` at construction\n * time and again at the start of every iteration after options have been merged (stash > executor\n * > constructor). Rejects unknown top-level keys so typos fail loud.\n */\nexport const claudeCodeCliOptionsSchema = validator\n .object<ClaudeCodeCliAdapterOptions>({\n // ADK control\n execa: validator.function().optional(),\n wrapperPath: validator.string().optional(),\n claudeBin: validator.string().default('claude'),\n appendSystemPrompt: validator.string().optional(),\n apiKey: validator.string().optional(),\n authToken: validator.string().optional(),\n baseURL: validator.string().optional(),\n cwd: validator.string().optional(),\n addDir: validator.array().items(validator.string().min(1)).optional(),\n disallowedTools: validator.array().items(validator.string().min(1)).default([]),\n maxTurns: validator\n .number()\n .valid(1)\n .messages({\n 'any.only':\n 'maxTurns is deprecated and inert: single-turn dispatch is the fixed battery contract; ' +\n 'only maxTurns: 1 is accepted, and the option is ignored because argv always carries --max-turns 1.',\n })\n .optional(),\n contextWindow: validator.number().integer().min(1).optional(),\n tokenEncoding: tokenEncodingSchema,\n maxBudgetUsd: validator.number().min(0).optional(),\n fallbackModel: validator.array().items(validator.string().min(1)).optional(),\n selfIdentity: validator.string().min(1).default('assistant'),\n autoAck: validator.boolean().default(false),\n forwardSubagentText: validator.boolean().default(false),\n bucketOrder: bucketOrderSchema,\n thoughtSurfacing: validator\n .string()\n .valid('all-self', 'latest-self', 'all')\n .default('all-self'),\n replayCompatibility: validator.array().items(validator.string().min(1)).default([]),\n helpers: helpersSchema.optional(),\n spoolStore: byteStoreSchema.optional(),\n unsupportedMediaPolicy: unsupportedMediaPolicySchema,\n unsupportedResultMediaPolicy: unsupportedMediaPolicySchema,\n extraArgs: extraArgsSchema,\n\n // CLI-native safety caps / timeouts\n streamIdleTimeoutMs: validator.number().integer().min(0).default(60_000),\n startupTimeoutMs: validator.number().integer().min(0).default(45_000),\n disposeGraceMs: validator.number().integer().min(0).default(2_000),\n mcpToolIdleTimeoutMs: validator.number().integer().min(0).optional(),\n disableTelemetry: validator.boolean().optional(),\n disableErrorReporting: validator.boolean().optional(),\n disableNonessentialTraffic: validator.boolean().optional(),\n\n // Required\n model: validator.string().required(),\n })\n .unknown(false)\n // Exactly one of apiKey/authToken must be set.\n .xor('apiKey', 'authToken')\n // POSIX-only in v1: reliable process-group control requires POSIX process groups, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent — refuse rather\n // than silently degrade.\n .custom((value, helpers) => {\n // POSIX-only in v1: reliable process-group control requires process.kill(-pid, signal),\n // which has no Windows equivalent — refuse rather than silently degrade, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent.\n if (process.platform !== 'darwin' && process.platform !== 'linux') {\n return helpers.error('any.invalid')\n }\n return value\n })\n\nconst isValidationError = (value: unknown): value is ValidationError =>\n isError(value) && Array.isArray((value as ValidationError).details)\n\nconst formatValidationDetails = (err: ValidationError): string =>\n err.details.map((d) => d.message).join(' and ')\n\n/**\n * Validates an arbitrary input against `claudeCodeCliOptionsSchema` and returns the resolved\n * options shape. Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` (carrying the validator's error\n * report on `cause`) on failure.\n *\n * @param input - The raw options object to validate.\n * @returns The resolved options object with defaults filled in.\n */\nexport const validateOptions = (input: unknown): ClaudeCodeCliAdapterOptions => {\n const { value, error } = claudeCodeCliOptionsSchema.validate(input, {\n abortEarly: false,\n convert: false,\n })\n if (error) {\n throw new E_INVALID_CLAUDE_CODE_CLI_OPTIONS([formatValidationDetails(error)], { cause: error })\n }\n return value as ClaudeCodeCliAdapterOptions\n}\n\n// suppress unused import warning when the alias isn't referenced\nvoid isValidationError\n"],"mappings":";;;;;;AA8BA,IAAM,oBAAoB,UACvB,OAAO,EACP,MAAM,wBAAwB,YAAY,gBAAgB,UAAU;AAEvE,IAAM,oBAAoB,UACvB,MAAM,EACN,MAAM,iBAAiB,EACvB,OAAO,EACP,QAAQ;CAAC;CAAwB;CAAY;CAAgB;AAAU,CAAC;AAE3E,IAAM,sBAAsB,UACzB,aAKC,UACG,OAAO,EACP,IAAI,CAAC,EACL,YAAY,oBAAoB,cAAc,KAAK,IAAI,GAA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,MAAM,EAAE,OAAO,UAAU,2BAA2B,SAAS,OAAO;EAClE,YAAY;EACZ,SAAS;CACX,CAAC;CACD,IAAI,OACF,MAAM,IAAI,kCAAkC,CAAC,wBAAwB,KAAK,CAAC,GAAG,EAAE,OAAO,MAAM,CAAC;CAEhG,OAAO;AACT"}
1
+ {"version":3,"file":"validation.mjs","names":[],"sources":["../../../../src/batteries/llm/claude_code_cli/validation.ts"],"sourcesContent":["/**\n * Runtime validation schema and wrapper for Claude Code CLI adapter options.\n *\n * @module @nhtio/adk/batteries/llm/claude_code_cli/validation\n *\n * @remarks\n * Schema and call-site wrapper for validating `ClaudeCodeCliAdapterOptions`. Used at construction\n * time and at the start of every iteration against the merged options shape (stash > executor >\n * constructor). Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` on failure — same hard-fail policy as\n * every other ADK contract.\n *\n * Three invariants enforced here that have no equivalent in the other LLM batteries:\n * - `apiKey`/`authToken` are mutually exclusive AND at least one is required (`.xor`).\n * - `extraArgs` entries are validated against a strict six-flag allowlist, with per-flag value\n * arity, and every value string is rejected if it starts with `-` — the fix for the `--betas`\n * variadic-value injection hazard (a value string spelling another flag would otherwise reach\n * the CLI's own argv parser as a distinct token).\n * - `process.platform` is checked at validation time: this battery is POSIX-only in v1 (reliable\n * process-group control requires POSIX process groups), mirroring\n * `src/batteries/sandbox/node/srt_enforcer.ts`'s own platform-boundary precedent.\n */\n\nimport { isError } from '@nhtio/adk/guards'\nimport { validator, ValidationError } from '@nhtio/validation'\nimport { E_INVALID_CLAUDE_CODE_CLI_OPTIONS } from './exceptions'\nimport { byteStoreSchema, TokenEncoding } from '@nhtio/adk/common'\nimport type { ClaudeCodeCliAdapterOptions } from './types'\n\n// ─── Sub-schemas ──────────────────────────────────────────────────────────────\n\nconst bucketLabelSchema = validator\n .string()\n .valid('standingInstructions', 'memories', 'retrievables', 'timeline')\n\nconst bucketOrderSchema = validator\n .array()\n .items(bucketLabelSchema)\n .unique()\n .default(['standingInstructions', 'memories', 'retrievables', 'timeline'])\n\nconst tokenEncodingSchema = validator\n .alternatives(\n // Known values are suggestions from the canonical list, not a whitelist: consumers may provide\n // a custom or newer tokenizer name. The field accepts any non-empty string, explicit null, or\n // absent (undefined = \"no token counting\"). `.optional()` preserves the null/undefined\n // disposition required by adk/require-validator-any-required.\n validator\n .string()\n .min(1)\n .description(`Known encodings: ${TokenEncoding.join(', ')}`),\n validator.any().valid(null).optional()\n )\n .default(null)\n\nconst unsupportedMediaPolicySchema = validator\n .alternatives(\n validator.string().valid('throw', 'fallback-stash', 'synthetic-description'),\n validator\n .object({\n mode: validator.string().valid('fallback-stash').required(),\n stashKeys: validator.array().items(validator.string().min(1)).required(),\n })\n .unknown(false)\n )\n .default('throw')\n\nconst helperSchema = validator.function()\n\nconst helpersSchema = validator\n .object({\n descriptionToChatCompletionsJsonSchema: helperSchema.optional(),\n renderUntrustedContent: helperSchema.optional(),\n renderTrustedContent: helperSchema.optional(),\n renderStandingInstructions: helperSchema.optional(),\n renderMemories: helperSchema.optional(),\n renderRetrievables: helperSchema.optional(),\n renderRetrievableHandleBody: helperSchema.optional(),\n renderRetrievableSafetyDirective: helperSchema.optional(),\n renderFirstPartyRetrievables: helperSchema.optional(),\n renderThirdPartyPublicRetrievables: helperSchema.optional(),\n renderThirdPartyPrivateRetrievables: helperSchema.optional(),\n renderThought: helperSchema.optional(),\n filterThoughts: helperSchema.optional(),\n toolsToChatCompletionsTools: helperSchema.optional(),\n renderChatCompletionsSystemPrompt: helperSchema.optional(),\n renderClaudeCodeCliTimelineMessage: helperSchema.optional(),\n renderClaudeCodeCliToolCallResult: helperSchema.optional(),\n buildClaudeCodeCliPrompt: helperSchema.optional(),\n })\n .unknown(false)\n\n// `extraArgs`: a structured allowlist, not a flat string[]. Every value string, in every\n// position, is rejected if it starts with `-` — the fix for the --betas injection hazard.\nconst NOT_A_FLAG_RE = /^(?!-).+$/\n\nconst singleValueSchema = validator.string().min(1).pattern(NOT_A_FLAG_RE)\nconst multiValueSchema = validator\n .array()\n .items(validator.string().min(1).pattern(NOT_A_FLAG_RE))\n .min(1)\n\nconst extraArgSchema = validator\n .alternatives(\n // --betas is the only flag accepting a string[] value.\n validator\n .object({\n flag: validator.string().valid('--betas').required(),\n value: multiValueSchema.required(),\n })\n .unknown(false),\n // --prompt-suggestions is the only flag with an OPTIONAL value.\n validator\n .object({\n flag: validator.string().valid('--prompt-suggestions').required(),\n value: singleValueSchema.optional(),\n })\n .unknown(false),\n // Every remaining allowlisted flag requires a single non-empty, non-flag-shaped string value.\n validator\n .object({\n flag: validator.string().valid('--effort', '--agent', '--json-schema', '--name').required(),\n value: singleValueSchema.required(),\n })\n .unknown(false)\n )\n .required()\n\nconst extraArgsSchema = validator.array().items(extraArgSchema).optional()\n\n// ─── Top-level schema ─────────────────────────────────────────────────────────\n\n/**\n * Validator schema for `ClaudeCodeCliAdapterOptions`. Used by `validateOptions` at construction\n * time and again at the start of every iteration after options have been merged (stash > executor\n * > constructor). Rejects unknown top-level keys so typos fail loud.\n */\nexport const claudeCodeCliOptionsSchema = validator\n .object<ClaudeCodeCliAdapterOptions>({\n // ADK control\n execa: validator.function().optional(),\n wrapperPath: validator.string().optional(),\n claudeBin: validator.string().default('claude'),\n appendSystemPrompt: validator.string().optional(),\n apiKey: validator.string().optional(),\n authToken: validator.string().optional(),\n baseURL: validator.string().optional(),\n cwd: validator.string().optional(),\n addDir: validator.array().items(validator.string().min(1)).optional(),\n disallowedTools: validator.array().items(validator.string().min(1)).default([]),\n maxTurns: validator\n .number()\n .valid(1)\n .messages({\n 'any.only':\n 'maxTurns is deprecated and inert: single-turn dispatch is the fixed battery contract; ' +\n 'only maxTurns: 1 is accepted, and the option is ignored because argv always carries --max-turns 1.',\n })\n .optional(),\n contextWindow: validator.number().integer().min(1).optional(),\n tokenEncoding: tokenEncodingSchema,\n maxBudgetUsd: validator.number().min(0).optional(),\n fallbackModel: validator.array().items(validator.string().min(1)).optional(),\n selfIdentity: validator.string().min(1).default('assistant'),\n toolCallIdFilter: validator.function().optional(),\n autoAck: validator.boolean().default(false),\n forwardSubagentText: validator.boolean().default(false),\n bucketOrder: bucketOrderSchema,\n thoughtSurfacing: validator\n .string()\n .valid('all-self', 'latest-self', 'all')\n .default('all-self'),\n replayCompatibility: validator.array().items(validator.string().min(1)).default([]),\n helpers: helpersSchema.optional(),\n spoolStore: byteStoreSchema.optional(),\n unsupportedMediaPolicy: unsupportedMediaPolicySchema,\n unsupportedResultMediaPolicy: unsupportedMediaPolicySchema,\n extraArgs: extraArgsSchema,\n\n // CLI-native safety caps / timeouts\n streamIdleTimeoutMs: validator.number().integer().min(0).default(60_000),\n startupTimeoutMs: validator.number().integer().min(0).default(45_000),\n disposeGraceMs: validator.number().integer().min(0).default(2_000),\n mcpToolIdleTimeoutMs: validator.number().integer().min(0).optional(),\n disableTelemetry: validator.boolean().optional(),\n disableErrorReporting: validator.boolean().optional(),\n disableNonessentialTraffic: validator.boolean().optional(),\n\n // Required\n model: validator.string().required(),\n })\n .unknown(false)\n // Exactly one of apiKey/authToken must be set.\n .xor('apiKey', 'authToken')\n // POSIX-only in v1: reliable process-group control requires POSIX process groups, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent — refuse rather\n // than silently degrade.\n .custom((value, helpers) => {\n // POSIX-only in v1: reliable process-group control requires process.kill(-pid, signal),\n // which has no Windows equivalent — refuse rather than silently degrade, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent.\n if (process.platform !== 'darwin' && process.platform !== 'linux') {\n return helpers.error('any.invalid')\n }\n return value\n })\n\nconst isValidationError = (value: unknown): value is ValidationError =>\n isError(value) && Array.isArray((value as ValidationError).details)\n\nconst formatValidationDetails = (err: ValidationError): string =>\n err.details.map((d) => d.message).join(' and ')\n\n/**\n * Validates an arbitrary input against `claudeCodeCliOptionsSchema` and returns the resolved\n * options shape. Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` (carrying the validator's error\n * report on `cause`) on failure.\n *\n * @param input - The raw options object to validate.\n * @returns The resolved options object with defaults filled in.\n */\nexport const validateOptions = (input: unknown): ClaudeCodeCliAdapterOptions => {\n const { value, error } = claudeCodeCliOptionsSchema.validate(input, {\n abortEarly: false,\n convert: false,\n })\n if (error) {\n throw new E_INVALID_CLAUDE_CODE_CLI_OPTIONS([formatValidationDetails(error)], { cause: error })\n }\n return value as ClaudeCodeCliAdapterOptions\n}\n\n// suppress unused import warning when the alias isn't referenced\nvoid isValidationError\n"],"mappings":";;;;;;AA8BA,IAAM,oBAAoB,UACvB,OAAO,EACP,MAAM,wBAAwB,YAAY,gBAAgB,UAAU;AAEvE,IAAM,oBAAoB,UACvB,MAAM,EACN,MAAM,iBAAiB,EACvB,OAAO,EACP,QAAQ;CAAC;CAAwB;CAAY;CAAgB;AAAU,CAAC;AAE3E,IAAM,sBAAsB,UACzB,aAKC,UACG,OAAO,EACP,IAAI,CAAC,EACL,YAAY,oBAAoB,cAAc,KAAK,IAAI,GAAG,GAC7D,UAAU,IAAI,EAAE,MAAM,IAAI,EAAE,SAAS,CACvC,EACC,QAAQ,IAAI;AAEf,IAAM,+BAA+B,UAClC,aACC,UAAU,OAAO,EAAE,MAAM,SAAS,kBAAkB,uBAAuB,GAC3E,UACG,OAAO;CACN,MAAM,UAAU,OAAO,EAAE,MAAM,gBAAgB,EAAE,SAAS;CAC1D,WAAW,UAAU,MAAM,EAAE,MAAM,UAAU,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,SAAS;AACzE,CAAC,EACA,QAAQ,KAAK,CAClB,EACC,QAAQ,OAAO;AAElB,IAAM,eAAe,UAAU,SAAS;AAExC,IAAM,gBAAgB,UACnB,OAAO;CACN,wCAAwC,aAAa,SAAS;CAC9D,wBAAwB,aAAa,SAAS;CAC9C,sBAAsB,aAAa,SAAS;CAC5C,4BAA4B,aAAa,SAAS;CAClD,gBAAgB,aAAa,SAAS;CACtC,oBAAoB,aAAa,SAAS;CAC1C,6BAA6B,aAAa,SAAS;CACnD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E,IAAI,CAAC,EAAE,QAAQ,IAAM;CACpE,gBAAgB,UAAU,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAK;CACjE,sBAAsB,UAAU,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,SAAS;CACnE,kBAAkB,UAAU,QAAQ,EAAE,SAAS;CAC/C,uBAAuB,UAAU,QAAQ,EAAE,SAAS;CACpD,4BAA4B,UAAU,QAAQ,EAAE,SAAS;CAGzD,OAAO,UAAU,OAAO,EAAE,SAAS;AACrC,CAAC,EACA,QAAQ,KAAK,EAEb,IAAI,UAAU,WAAW,EAIzB,QAAQ,OAAO,YAAY;CAI1B,IAAI,QAAQ,aAAa,YAAY,QAAQ,aAAa,SACxD,OAAO,QAAQ,MAAM,aAAa;CAEpC,OAAO;AACT,CAAC;AAKH,IAAM,2BAA2B,QAC/B,IAAI,QAAQ,KAAK,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO;;;;;;;;;AAUhD,IAAa,mBAAmB,UAAgD;CAC9E,MAAM,EAAE,OAAO,UAAU,2BAA2B,SAAS,OAAO;EAClE,YAAY;EACZ,SAAS;CACX,CAAC;CACD,IAAI,OACF,MAAM,IAAI,kCAAkC,CAAC,wBAAwB,KAAK,CAAC,GAAG,EAAE,OAAO,MAAM,CAAC;CAEhG,OAAO;AACT"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../../../chunk-Cek0wNdY.js");
2
+ require("../../../chunk-Cek0wNdY.cjs");
3
3
  //#region src/batteries/llm/claude_code_cli/wire.ts
4
4
  /** Encode a `WrapperCommand` as one NDJSON line, including its terminating newline. */
5
5
  var encodeWrapperCommand = (command) => `${JSON.stringify(command)}\n`;
@@ -1,6 +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");
2
+ require("../../chunk-Cek0wNdY.cjs");
3
+ const require_helpers = require("../../helpers-Dcp4CrOz.cjs");
4
+ const require_chat_common = require("../../chat_common-B7fvGTKv.cjs");
4
5
  const require_batteries_llm_claude_code_cli_exceptions = require("./claude_code_cli/exceptions.cjs");
5
6
  const require_batteries_llm_claude_code_cli_validation = require("./claude_code_cli/validation.cjs");
6
7
  const require_batteries_llm_claude_code_cli_helpers = require("./claude_code_cli/helpers.cjs");
@@ -16,10 +17,12 @@ exports.E_CLAUDE_CODE_CLI_STREAM_STALLED = require_batteries_llm_claude_code_cli
16
17
  exports.E_CLAUDE_CODE_CLI_TURN_FAILED = require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_TURN_FAILED;
17
18
  exports.E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY = require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY;
18
19
  exports.E_CLAUDE_CODE_CLI_WRAPPER_CRASHED = require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_WRAPPER_CRASHED;
20
+ exports.E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND = require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND;
19
21
  exports.E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR = require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR;
20
22
  exports.E_INVALID_CLAUDE_CODE_CLI_OPTIONS = require_batteries_llm_claude_code_cli_exceptions.E_INVALID_CLAUDE_CODE_CLI_OPTIONS;
21
23
  exports.buildClaudeCodeCliPrompt = require_batteries_llm_claude_code_cli_helpers.buildClaudeCodeCliPrompt;
22
24
  exports.claudeCodeCliOptionsSchema = require_batteries_llm_claude_code_cli_validation.claudeCodeCliOptionsSchema;
25
+ exports.deCollideToolCallIds = require_chat_common.deCollideToolCallIds;
23
26
  exports.defaultBuildClaudeCodeCliPrompt = require_batteries_llm_claude_code_cli_helpers.defaultBuildClaudeCodeCliPrompt;
24
27
  exports.defaultDescriptionToChatCompletionsJsonSchema = require_helpers.defaultDescriptionToChatCompletionsJsonSchema;
25
28
  exports.defaultFilterThoughts = require_helpers.defaultFilterThoughts;
@@ -1,6 +1,7 @@
1
- import { A as renderMemories, D as renderArtifactHandleBody, F as renderThirdPartyPrivateRetrievables, G as toolsToChatCompletionsTools, 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, v as defaultToolsToChatCompletionsTools, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../helpers-So6bNfJp.mjs";
2
- import { E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_INVALID_CLAUDE_CODE_CLI_OPTIONS } from "./claude_code_cli/exceptions.mjs";
1
+ import { A as renderMemories, D as renderArtifactHandleBody, F as renderThirdPartyPrivateRetrievables, G as toolsToChatCompletionsTools, 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, v as defaultToolsToChatCompletionsTools, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../helpers-C1T0DV8Q.mjs";
2
+ import { t as deCollideToolCallIds } from "../../chat_common-CeoHwSsz.mjs";
3
+ import { E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_INVALID_CLAUDE_CODE_CLI_OPTIONS } from "./claude_code_cli/exceptions.mjs";
3
4
  import { claudeCodeCliOptionsSchema, validateOptions } from "./claude_code_cli/validation.mjs";
4
5
  import { buildClaudeCodeCliPrompt, defaultBuildClaudeCodeCliPrompt, defaultRenderClaudeCodeCliTimelineMessage, defaultRenderClaudeCodeCliToolCallResult, renderClaudeCodeCliTimelineMessage, renderClaudeCodeCliToolCallResult } from "./claude_code_cli/helpers.mjs";
5
6
  import { ClaudeCodeCliAdapter, resolveDefaultWrapperPath } from "./claude_code_cli/adapter.mjs";
6
- export { ClaudeCodeCliAdapter, E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_INVALID_CLAUDE_CODE_CLI_OPTIONS, buildClaudeCodeCliPrompt, claudeCodeCliOptionsSchema, defaultBuildClaudeCodeCliPrompt, defaultDescriptionToChatCompletionsJsonSchema, defaultFilterThoughts, defaultRenderArtifactHandleBody, defaultRenderChatCompletionsSystemPrompt, defaultRenderClaudeCodeCliTimelineMessage, defaultRenderClaudeCodeCliToolCallResult, defaultRenderFirstPartyRetrievables, defaultRenderMemories, defaultRenderRetrievableHandleBody, defaultRenderRetrievableSafetyDirective, defaultRenderRetrievables, defaultRenderStandingInstructions, defaultRenderThirdPartyPrivateRetrievables, defaultRenderThirdPartyPublicRetrievables, defaultRenderThought, defaultRenderTrustedContent, defaultRenderUntrustedContent, defaultToolsToChatCompletionsTools, descriptionToChatCompletionsJsonSchema, filterThoughts, renderArtifactHandleBody, renderChatCompletionsSystemPrompt, renderClaudeCodeCliTimelineMessage, renderClaudeCodeCliToolCallResult, renderFirstPartyRetrievables, renderMemories, renderRetrievableHandleBody, renderRetrievableSafetyDirective, renderRetrievables, renderStandingInstructions, renderThirdPartyPrivateRetrievables, renderThirdPartyPublicRetrievables, renderThought, renderTrustedContent, renderUntrustedContent, resolveDefaultWrapperPath, toolsToChatCompletionsTools, validateOptions };
7
+ export { ClaudeCodeCliAdapter, E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_INVALID_CLAUDE_CODE_CLI_OPTIONS, buildClaudeCodeCliPrompt, claudeCodeCliOptionsSchema, deCollideToolCallIds, defaultBuildClaudeCodeCliPrompt, defaultDescriptionToChatCompletionsJsonSchema, defaultFilterThoughts, defaultRenderArtifactHandleBody, defaultRenderChatCompletionsSystemPrompt, defaultRenderClaudeCodeCliTimelineMessage, defaultRenderClaudeCodeCliToolCallResult, defaultRenderFirstPartyRetrievables, defaultRenderMemories, defaultRenderRetrievableHandleBody, defaultRenderRetrievableSafetyDirective, defaultRenderRetrievables, defaultRenderStandingInstructions, defaultRenderThirdPartyPrivateRetrievables, defaultRenderThirdPartyPublicRetrievables, defaultRenderThought, defaultRenderTrustedContent, defaultRenderUntrustedContent, defaultToolsToChatCompletionsTools, descriptionToChatCompletionsJsonSchema, filterThoughts, renderArtifactHandleBody, renderChatCompletionsSystemPrompt, renderClaudeCodeCliTimelineMessage, renderClaudeCodeCliToolCallResult, renderFirstPartyRetrievables, renderMemories, renderRetrievableHandleBody, renderRetrievableSafetyDirective, renderRetrievables, renderStandingInstructions, renderThirdPartyPrivateRetrievables, renderThirdPartyPublicRetrievables, renderThought, renderTrustedContent, renderUntrustedContent, resolveDefaultWrapperPath, toolsToChatCompletionsTools, validateOptions };
@@ -1,14 +1,14 @@
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
- const require_tool_parsers = require("../../../tool_parsers-csSBFWob.js");
11
- const require_helpers = require("../../../helpers-C_1dcP_X.js");
10
+ const require_tool_parsers = require("../../../tool_parsers-8_qO0a_F.cjs");
11
+ const require_helpers = require("../../../helpers-Dcp4CrOz.cjs");
12
12
  const require_batteries_llm_gemini_generate_content_exceptions = require("./exceptions.cjs");
13
13
  const require_batteries_llm_gemini_generate_content_validation = require("./validation.cjs");
14
14
  const require_batteries_llm_gemini_generate_content_helpers = require("./helpers.cjs");
@@ -1,12 +1,12 @@
1
- import { r as Tokenizable } from "../../../tokenizable-xPXj1AQX.mjs";
2
1
  import { n as isInstanceOf, r as isObject, t as isError } from "../../../guards-BEpY7lBI.mjs";
3
- import { h as canonicalStringify } from "../../../spooled_artifact-BMtuIsu6.mjs";
4
- import { n as Message, t as Thought } from "../../../thought-BEsItcp_.mjs";
5
- import { t as ToolCall } from "../../../tool_call-Cahji8ZY.mjs";
6
- import "../../../common-AhsMepUS.mjs";
2
+ import { r as Tokenizable } from "../../../tokenizable-xPXj1AQX.mjs";
3
+ import { h as canonicalStringify } from "../../../spooled_artifact-BkOe4-j-.mjs";
4
+ import { n as Message, t as Thought } from "../../../thought-BrQt6HAb.mjs";
5
+ import { t as ToolCall } from "../../../tool_call-8crmZsO8.mjs";
6
+ import "../../../common-B5maOoF_.mjs";
7
7
  import "../../../guards.mjs";
8
8
  import { O as resolveToolCallParser } from "../../../tool_parsers-DgZhgxV8.mjs";
9
- import { A as renderMemories, E as normalizeToolName, F as renderThirdPartyPrivateRetrievables, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, k as renderFirstPartyRetrievables, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../../helpers-So6bNfJp.mjs";
9
+ import { A as renderMemories, E as normalizeToolName, F as renderThirdPartyPrivateRetrievables, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, k as renderFirstPartyRetrievables, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../../helpers-C1T0DV8Q.mjs";
10
10
  import { E_GEMINI_GENERATE_CONTENT_CONTEXT_OVERFLOW, E_GEMINI_INVALID_TOOL_CALL_ARGS, E_GEMINI_MISSING_THOUGHT_SIGNATURE, E_GEMINI_REQUEST_FAILED, E_GEMINI_STREAM_ERROR, E_INVALID_GEMINI_GENERATE_CONTENT_OPTIONS } from "./exceptions.mjs";
11
11
  import { validateOptions } from "./validation.mjs";
12
12
  import { DEFAULT_GEMINI_BUCKET_ORDER, buildGeminiRequest, extractGeminiGeneration, mediaToGeminiInlineData, renderGeminiToolResult, toolsToGeminiTools } from "./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/gemini_generate_content/exceptions.ts
6
6
  /**
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../../../chunk-Cek0wNdY.js");
3
- const require_guards = require("../../../guards-05Uq3J4M.js");
2
+ require("../../../chunk-Cek0wNdY.cjs");
3
+ const require_guards = require("../../../guards-5-XmJgD2.cjs");
4
4
  require("../../../guards.cjs");
5
- const require_helpers = require("../../../helpers-C_1dcP_X.js");
5
+ const require_helpers = require("../../../helpers-Dcp4CrOz.cjs");
6
6
  //#region src/batteries/llm/gemini_generate_content/helpers.ts
7
7
  /**
8
8
  * Translation helpers for the native Gemini `generateContent` battery.
@@ -1,6 +1,6 @@
1
1
  import { r as isObject } from "../../../guards-BEpY7lBI.mjs";
2
2
  import "../../../guards.mjs";
3
- import { A as renderMemories, C as looksLikeSpooledArtifact, D as renderArtifactHandleBody, E as normalizeToolName, F as renderThirdPartyPrivateRetrievables, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, T as neutraliseDeveloperRulesTag, U as sanitizeMimeType, _ 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";
3
+ import { A as renderMemories, C as looksLikeSpooledArtifact, D as renderArtifactHandleBody, E as normalizeToolName, F as renderThirdPartyPrivateRetrievables, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, T as neutraliseDeveloperRulesTag, U as sanitizeMimeType, _ 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";
4
4
  //#region src/batteries/llm/gemini_generate_content/helpers.ts
5
5
  /**
6
6
  * Translation helpers for the native Gemini `generateContent` battery.
@@ -1,2 +1,2 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../../../chunk-Cek0wNdY.js");
2
+ require("../../../chunk-Cek0wNdY.cjs");
@@ -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_gemini_generate_content_exceptions = require("./exceptions.cjs");
6
6
  let _nhtio_validation = require("@nhtio/validation");
7
7
  //#region src/batteries/llm/gemini_generate_content/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_GEMINI_GENERATE_CONTENT_OPTIONS } from "./exceptions.mjs";
4
4
  import { validator } from "@nhtio/validation";
5
5
  //#region src/batteries/llm/gemini_generate_content/validation.ts
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../../chunk-Cek0wNdY.js");
3
- const require_helpers = require("../../helpers-C_1dcP_X.js");
2
+ require("../../chunk-Cek0wNdY.cjs");
3
+ const require_helpers = require("../../helpers-Dcp4CrOz.cjs");
4
4
  const require_batteries_llm_gemini_generate_content_exceptions = require("./gemini_generate_content/exceptions.cjs");
5
5
  const require_batteries_llm_gemini_generate_content_validation = require("./gemini_generate_content/validation.cjs");
6
6
  const require_batteries_llm_gemini_generate_content_helpers = require("./gemini_generate_content/helpers.cjs");
@@ -1,4 +1,4 @@
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";
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
2
  import { E_GEMINI_INVALID_TOOL_CALL_ARGS, E_GEMINI_MISSING_THOUGHT_SIGNATURE, E_GEMINI_REQUEST_FAILED, E_GEMINI_STREAM_ERROR, E_INVALID_GEMINI_GENERATE_CONTENT_OPTIONS } from "./gemini_generate_content/exceptions.mjs";
3
3
  import { geminiGenerateContentOptionsSchema, validateOptions } from "./gemini_generate_content/validation.mjs";
4
4
  import { DEFAULT_GEMINI_BUCKET_ORDER, buildGeminiRequest, defaultBuildGeminiRequest, defaultExtractGeminiGeneration, defaultMediaToGeminiInlineData, defaultRenderGeminiToolResult, defaultSanitizeGeminiSchema, defaultToolsToGeminiTools, extractGeminiGeneration, mediaToGeminiInlineData, renderGeminiToolResult, sanitizeGeminiSchema, toolsToGeminiTools } from "./gemini_generate_content/helpers.mjs";
@@ -37,5 +37,5 @@ export type { TransformersJsAdapterOptions, TransformersJsPipeline, Transformers
37
37
  export { ClaudeCodeCliAdapter } from "./claude_code_cli/index";
38
38
  export { claudeCodeCliOptionsSchema } from "./claude_code_cli/index";
39
39
  export { validateOptions as validateClaudeCodeCliOptions } from "./claude_code_cli/index";
40
- export { E_INVALID_CLAUDE_CODE_CLI_OPTIONS, E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, } from "./claude_code_cli/index";
40
+ export { E_INVALID_CLAUDE_CODE_CLI_OPTIONS, E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, } from "./claude_code_cli/index";
41
41
  export type { ClaudeCodeCliHelpers, ClaudeCodeCliAdapterOptions, ClaudeCodeCliExtraArg, WrapperBridgedTool, WrapperAuth, WrapperRunCommand, WrapperToolResultContentBlock, WrapperToolCallResponseCommand, WrapperShutdownCommand, WrapperCommand, WrapperReadyEvent, WrapperInitEvent, WrapperMessageDeltaEvent, WrapperThoughtDeltaEvent, WrapperToolCallRequestEvent, WrapperRetryEvent, WrapperResultEvent, WrapperErrorEvent, WrapperLogEvent, WrapperShutdownCompleteEvent, WrapperEvent, } from "./claude_code_cli/index";
@@ -1,17 +1,17 @@
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
- const require_tool_parsers = require("../../../tool_parsers-csSBFWob.js");
10
+ const require_tool_parsers = require("../../../tool_parsers-8_qO0a_F.cjs");
11
11
  const require_batteries_storage_in_memory = require("../../storage/in_memory.cjs");
12
- const require_helpers = require("../../../helpers-C_1dcP_X.js");
13
- const require_gpu_budget = require("../../../gpu_budget-BBIUyLoj.js");
14
- const require_lifecycle = require("../../../lifecycle-vYQJ2rmf.js");
12
+ const require_helpers = require("../../../helpers-Dcp4CrOz.cjs");
13
+ const require_gpu_budget = require("../../../gpu_budget-BBIUyLoj.cjs");
14
+ const require_lifecycle = require("../../../lifecycle-vYQJ2rmf.cjs");
15
15
  const require_batteries_llm_chat_common_exceptions = require("../chat_common/exceptions.cjs");
16
16
  const require_batteries_llm_litert_lm_exceptions = require("./exceptions.cjs");
17
17
  const require_batteries_llm_litert_lm_validation = require("./validation.cjs");
@@ -1,13 +1,13 @@
1
- import { r as Tokenizable } from "../../../tokenizable-xPXj1AQX.mjs";
2
1
  import { n as isInstanceOf, r as isObject, t as isError } from "../../../guards-BEpY7lBI.mjs";
3
- import { f as ArtifactTool, h as canonicalStringify, t as SpooledArtifact } from "../../../spooled_artifact-BMtuIsu6.mjs";
4
- import { n as Message, t as Thought } from "../../../thought-BEsItcp_.mjs";
5
- import { n as Media, t as ToolCall } from "../../../tool_call-Cahji8ZY.mjs";
6
- import "../../../common-AhsMepUS.mjs";
2
+ import { r as Tokenizable } from "../../../tokenizable-xPXj1AQX.mjs";
3
+ import { d as ArtifactTool, h as canonicalStringify, t as SpooledArtifact } from "../../../spooled_artifact-BkOe4-j-.mjs";
4
+ import { n as Message, t as Thought } from "../../../thought-BrQt6HAb.mjs";
5
+ import { n as Media, t as ToolCall } from "../../../tool_call-8crmZsO8.mjs";
6
+ import "../../../common-B5maOoF_.mjs";
7
7
  import "../../../guards.mjs";
8
8
  import { O as resolveToolCallParser } from "../../../tool_parsers-DgZhgxV8.mjs";
9
9
  import { InMemorySpoolStore } from "../../storage/in_memory.mjs";
10
- import { C as looksLikeSpooledArtifact, E as normalizeToolName, W as stripEnvelopeSpecialTokens, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective } from "../../../helpers-So6bNfJp.mjs";
10
+ import { C as looksLikeSpooledArtifact, E as normalizeToolName, W as stripEnvelopeSpecialTokens, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective } from "../../../helpers-C1T0DV8Q.mjs";
11
11
  import { C as resolveReasoningParser, n as isGpuOutOfMemoryError, o as resolveGenerationOptions, r as probeGpuBudget } from "../../../gpu_budget-Bi2nUUil.mjs";
12
12
  import { n as emitLifecycle } from "../../../lifecycle-C4kwYJ-N.mjs";
13
13
  import { E_LLM_GPU_OUT_OF_MEMORY } from "../chat_common/exceptions.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/litert_lm/exceptions.ts
6
6
  /**
@@ -1,13 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../../../chunk-Cek0wNdY.js");
3
- const require_spooled_artifact = require("../../../spooled_artifact-DKZd7fgs.js");
4
- const require_tool_call = require("../../../tool_call-kx4WQ0-j.js");
2
+ require("../../../chunk-Cek0wNdY.cjs");
3
+ const require_spooled_artifact = require("../../../spooled_artifact-BLgbGT8b.cjs");
4
+ const require_tool_call = require("../../../tool_call-JbjeUpRK.cjs");
5
5
  require("../../../index.cjs");
6
- const require_tool_parsers = require("../../../tool_parsers-csSBFWob.js");
7
- const require_helpers = require("../../../helpers-C_1dcP_X.js");
6
+ const require_tool_parsers = require("../../../tool_parsers-8_qO0a_F.cjs");
7
+ const require_helpers = require("../../../helpers-Dcp4CrOz.cjs");
8
8
  const require_batteries_llm_openai_chat_completions_helpers = require("../openai_chat_completions/helpers.cjs");
9
- const require_gpu_budget = require("../../../gpu_budget-BBIUyLoj.js");
10
- const require_lifecycle = require("../../../lifecycle-vYQJ2rmf.js");
9
+ const require_gpu_budget = require("../../../gpu_budget-BBIUyLoj.cjs");
10
+ const require_lifecycle = require("../../../lifecycle-vYQJ2rmf.cjs");
11
11
  const require_batteries_llm_litert_lm_exceptions = require("./exceptions.cjs");
12
12
  //#region src/batteries/llm/litert_lm/helpers.ts
13
13
  /**
@@ -1,8 +1,8 @@
1
- import { t as SpooledArtifact } from "../../../spooled_artifact-BMtuIsu6.mjs";
2
- import { n as Media } from "../../../tool_call-Cahji8ZY.mjs";
1
+ import { t as SpooledArtifact } from "../../../spooled_artifact-BkOe4-j-.mjs";
2
+ import { n as Media } from "../../../tool_call-8crmZsO8.mjs";
3
3
  import "../../../index.mjs";
4
4
  import { C as mistralToolCallParser, D as qwen3CoderToolCallParser, E as pythonicToolCallParser, O as resolveToolCallParser, S as looseKeyedToolCallParser, T as phiToolCallParser, _ as defaultResolveToolCallParser, a as defaultBarePythonicToolCallParser, b as hermesToolCallParser, c as defaultGptOssToolCallParser, d as defaultLooseKeyedToolCallParser, f as defaultMistralToolCallParser, g as defaultQwen3CoderToolCallParser, h as defaultPythonicToolCallParser, i as createAutoToolCallParser, l as defaultHermesToolCallParser, m as defaultPhiToolCallParser, n as DEFAULT_TOOL_CALL_PARSER_ORDER, o as defaultCreateAutoToolCallParser, p as defaultNoneToolCallParser, r as barePythonicToolCallParser, s as defaultGemmaToolCallParser, t as BUNDLED_TOOL_CALL_PARSERS, u as defaultLlama3JsonToolCallParser, v as gemmaToolCallParser, w as noneToolCallParser, x as llama3JsonToolCallParser, y as gptOssToolCallParser } from "../../../tool_parsers-DgZhgxV8.mjs";
5
- import { A as renderMemories, C as looksLikeSpooledArtifact, D as renderArtifactHandleBody, F as renderThirdPartyPrivateRetrievables, H as sanitizeFilenameForDescription, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, T as neutraliseDeveloperRulesTag, U as sanitizeMimeType, _ 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";
5
+ import { A as renderMemories, C as looksLikeSpooledArtifact, D as renderArtifactHandleBody, F as renderThirdPartyPrivateRetrievables, H as sanitizeFilenameForDescription, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, T as neutraliseDeveloperRulesTag, U as sanitizeMimeType, _ 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";
6
6
  import { extractReasoningFields } from "../openai_chat_completions/helpers.mjs";
7
7
  import { C as resolveReasoningParser, S as noneReasoningParser, _ as gemmaChannelReasoningParser, a as defaultResolveGenerationOptions, b as makeHarmonyAnalysisReasoningParser, c as DEFAULT_REASONING_PARSER_ORDER, d as defaultCreateAutoReasoningParser, f as defaultGemmaChannelReasoningParser, g as defaultThinkTagReasoningParser, h as defaultResolveReasoningParser, i as GENERATION_DEFAULTS, l as buildBundledReasoningParsers, m as defaultNoneReasoningParser, n as isGpuOutOfMemoryError, o as resolveGenerationOptions, p as defaultHarmonyAnalysisReasoningParser, r as probeGpuBudget, s as BUNDLED_REASONING_PARSERS, t as instrumentGpuBuffers, u as createAutoReasoningParser, v as harmonyAnalysisReasoningParser, w as thinkTagReasoningParser, x as makeThinkTagReasoningParser, y as makeGemmaChannelReasoningParser } from "../../../gpu_budget-Bi2nUUil.mjs";
8
8
  import { n as emitLifecycle, t as defaultEmitLifecycle } from "../../../lifecycle-C4kwYJ-N.mjs";