@nhtio/adk 0.1.0-master-e5947c71 → 0.1.0-master-74266e68

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 (355) hide show
  1. package/CHANGELOG.md +124 -1
  2. package/artifact_methods-BvoDGBnH.cjs +1 -0
  3. package/artifact_methods-q52ETLwI.mjs +1 -0
  4. package/batteries/artifacts/ecmascript.cjs +1 -1
  5. package/batteries/artifacts/ecmascript.mjs +1 -1
  6. package/batteries/artifacts/toon.cjs +1 -1
  7. package/batteries/artifacts/toon.mjs +1 -1
  8. package/batteries/artifacts/xml.cjs +1 -1
  9. package/batteries/artifacts/xml.mjs +1 -1
  10. package/batteries/artifacts/yaml.cjs +1 -1
  11. package/batteries/artifacts/yaml.mjs +1 -1
  12. package/batteries/artifacts.cjs +4 -4
  13. package/batteries/artifacts.mjs +4 -4
  14. package/batteries/dev-tools/forge.cjs +3 -3
  15. package/batteries/dev-tools/forge.mjs +3 -3
  16. package/batteries/dev-tools.cjs +2 -2
  17. package/batteries/dev-tools.mjs +2 -2
  18. package/batteries/encoding.cjs +7 -7
  19. package/batteries/encoding.mjs +7 -7
  20. package/batteries/generation/gemini/adapter.cjs +1 -1
  21. package/batteries/generation/gemini/adapter.mjs +1 -1
  22. package/batteries/generation/local_diffusion/adapter.cjs +1 -1
  23. package/batteries/generation/local_diffusion/adapter.mjs +1 -1
  24. package/batteries/generation/openai/adapter.cjs +1 -1
  25. package/batteries/generation/openai/adapter.mjs +1 -1
  26. package/batteries/llm/anthropic_messages/adapter.cjs +6 -6
  27. package/batteries/llm/anthropic_messages/adapter.mjs +6 -6
  28. package/batteries/llm/anthropic_messages/count_tokens.cjs +2 -2
  29. package/batteries/llm/anthropic_messages/count_tokens.mjs +1 -1
  30. package/batteries/llm/anthropic_messages/helpers.cjs +3 -3
  31. package/batteries/llm/anthropic_messages/helpers.mjs +3 -3
  32. package/batteries/llm/anthropic_messages/validation.cjs +2 -2
  33. package/batteries/llm/anthropic_messages/validation.mjs +2 -2
  34. package/batteries/llm/anthropic_messages.cjs +2 -2
  35. package/batteries/llm/anthropic_messages.mjs +2 -2
  36. package/batteries/llm/bedrock_converse/adapter.cjs +6 -6
  37. package/batteries/llm/bedrock_converse/adapter.mjs +6 -6
  38. package/batteries/llm/bedrock_converse/helpers.cjs +1 -1
  39. package/batteries/llm/bedrock_converse/helpers.mjs +1 -1
  40. package/batteries/llm/bedrock_converse/validation.cjs +2 -2
  41. package/batteries/llm/bedrock_converse/validation.mjs +2 -2
  42. package/batteries/llm/bedrock_converse.cjs +2 -2
  43. package/batteries/llm/bedrock_converse.mjs +2 -2
  44. package/batteries/llm/claude_code_cli/adapter.cjs +7 -7
  45. package/batteries/llm/claude_code_cli/adapter.mjs +7 -7
  46. package/batteries/llm/claude_code_cli/helpers.cjs +3 -3
  47. package/batteries/llm/claude_code_cli/helpers.mjs +3 -3
  48. package/batteries/llm/claude_code_cli/validation.cjs +2 -2
  49. package/batteries/llm/claude_code_cli/validation.mjs +2 -2
  50. package/batteries/llm/claude_code_cli.cjs +2 -2
  51. package/batteries/llm/claude_code_cli.mjs +2 -2
  52. package/batteries/llm/gemini_generate_content/adapter.cjs +7 -7
  53. package/batteries/llm/gemini_generate_content/adapter.mjs +7 -7
  54. package/batteries/llm/gemini_generate_content/helpers.cjs +1 -1
  55. package/batteries/llm/gemini_generate_content/helpers.mjs +1 -1
  56. package/batteries/llm/gemini_generate_content/validation.cjs +2 -2
  57. package/batteries/llm/gemini_generate_content/validation.mjs +2 -2
  58. package/batteries/llm/gemini_generate_content.cjs +2 -2
  59. package/batteries/llm/gemini_generate_content.mjs +2 -2
  60. package/batteries/llm/litert_lm/adapter.cjs +6 -6
  61. package/batteries/llm/litert_lm/adapter.mjs +6 -6
  62. package/batteries/llm/litert_lm/helpers.cjs +3 -3
  63. package/batteries/llm/litert_lm/helpers.mjs +3 -3
  64. package/batteries/llm/litert_lm/validation.cjs +2 -2
  65. package/batteries/llm/litert_lm/validation.mjs +2 -2
  66. package/batteries/llm/litert_lm.cjs +1 -1
  67. package/batteries/llm/litert_lm.mjs +1 -1
  68. package/batteries/llm/ollama/adapter.cjs +6 -6
  69. package/batteries/llm/ollama/adapter.mjs +6 -6
  70. package/batteries/llm/ollama/helpers.cjs +4 -4
  71. package/batteries/llm/ollama/helpers.mjs +4 -4
  72. package/batteries/llm/ollama/validation.cjs +2 -2
  73. package/batteries/llm/ollama/validation.mjs +2 -2
  74. package/batteries/llm/ollama.cjs +2 -2
  75. package/batteries/llm/ollama.mjs +2 -2
  76. package/batteries/llm/openai_chat_completions/adapter.cjs +6 -6
  77. package/batteries/llm/openai_chat_completions/adapter.mjs +6 -6
  78. package/batteries/llm/openai_chat_completions/helpers.cjs +4 -4
  79. package/batteries/llm/openai_chat_completions/helpers.mjs +4 -4
  80. package/batteries/llm/openai_chat_completions/validation.cjs +2 -2
  81. package/batteries/llm/openai_chat_completions/validation.mjs +2 -2
  82. package/batteries/llm/openai_chat_completions.cjs +2 -2
  83. package/batteries/llm/openai_chat_completions.mjs +2 -2
  84. package/batteries/llm/openai_responses/adapter.cjs +6 -6
  85. package/batteries/llm/openai_responses/adapter.mjs +6 -6
  86. package/batteries/llm/openai_responses/helpers.cjs +3 -3
  87. package/batteries/llm/openai_responses/helpers.mjs +3 -3
  88. package/batteries/llm/openai_responses/validation.cjs +2 -2
  89. package/batteries/llm/openai_responses/validation.mjs +2 -2
  90. package/batteries/llm/openai_responses.cjs +2 -2
  91. package/batteries/llm/openai_responses.mjs +2 -2
  92. package/batteries/llm/transformers_js/adapter.cjs +6 -6
  93. package/batteries/llm/transformers_js/adapter.mjs +6 -6
  94. package/batteries/llm/transformers_js/helpers.cjs +3 -3
  95. package/batteries/llm/transformers_js/helpers.mjs +3 -3
  96. package/batteries/llm/transformers_js/validation.cjs +2 -2
  97. package/batteries/llm/transformers_js/validation.mjs +2 -2
  98. package/batteries/llm/transformers_js.cjs +1 -1
  99. package/batteries/llm/transformers_js.mjs +1 -1
  100. package/batteries/llm/webllm_chat_completions/adapter.cjs +6 -6
  101. package/batteries/llm/webllm_chat_completions/adapter.mjs +6 -6
  102. package/batteries/llm/webllm_chat_completions/helpers.cjs +1 -1
  103. package/batteries/llm/webllm_chat_completions/helpers.mjs +1 -1
  104. package/batteries/llm/webllm_chat_completions/validation.cjs +2 -2
  105. package/batteries/llm/webllm_chat_completions/validation.mjs +2 -2
  106. package/batteries/llm/webllm_chat_completions.cjs +2 -2
  107. package/batteries/llm/webllm_chat_completions.mjs +2 -2
  108. package/batteries/llm.cjs +2 -2
  109. package/batteries/llm.mjs +2 -2
  110. package/batteries/media/contracts.cjs.map +1 -1
  111. package/batteries/media/contracts.d.ts +93 -2
  112. package/batteries/media/contracts.mjs.map +1 -1
  113. package/batteries/media/engines/execa_executor.cjs +285 -13
  114. package/batteries/media/engines/execa_executor.cjs.map +1 -1
  115. package/batteries/media/engines/execa_executor.d.ts +113 -8
  116. package/batteries/media/engines/execa_executor.mjs +285 -13
  117. package/batteries/media/engines/execa_executor.mjs.map +1 -1
  118. package/batteries/media/forge.cjs +4 -4
  119. package/batteries/media/forge.mjs +4 -4
  120. package/batteries/media/lint.cjs +1 -1
  121. package/batteries/media/lint.mjs +1 -1
  122. package/batteries/media.cjs +1 -1
  123. package/batteries/orchestration/dispatch_reasoner.cjs +4 -4
  124. package/batteries/orchestration/dispatch_reasoner.mjs +4 -4
  125. package/batteries/orchestration/executor.cjs +2 -2
  126. package/batteries/orchestration/executor.mjs +2 -2
  127. package/batteries/orchestration/forge.cjs +3 -3
  128. package/batteries/orchestration/forge.mjs +3 -3
  129. package/batteries/orchestration/validation.cjs +2 -2
  130. package/batteries/orchestration/validation.mjs +2 -2
  131. package/batteries/orchestration.cjs +3 -3
  132. package/batteries/orchestration.mjs +3 -3
  133. package/batteries/sandbox/contracts/policy_enforcer.d.ts +12 -6
  134. package/batteries/sandbox/executor.d.ts +28 -10
  135. package/batteries/sandbox/js.cjs +1 -1
  136. package/batteries/sandbox/js.mjs +1 -1
  137. package/batteries/sandbox/node/index.d.ts +1 -1
  138. package/batteries/sandbox/node/srt_enforcer.d.ts +74 -0
  139. package/batteries/sandbox/node.cjs +98 -5
  140. package/batteries/sandbox/node.cjs.map +1 -1
  141. package/batteries/sandbox/node.mjs +98 -6
  142. package/batteries/sandbox/node.mjs.map +1 -1
  143. package/batteries/sandbox/tools.cjs +1 -1
  144. package/batteries/sandbox/tools.mjs +1 -1
  145. package/batteries/sandbox.cjs +13 -13
  146. package/batteries/sandbox.cjs.map +1 -1
  147. package/batteries/sandbox.mjs +13 -13
  148. package/batteries/sandbox.mjs.map +1 -1
  149. package/batteries/skills/in_memory.cjs +1 -1
  150. package/batteries/skills.cjs +10 -10
  151. package/batteries/skills.mjs +9 -9
  152. package/batteries/tools/_shared.cjs +1 -1
  153. package/batteries/tools/_shared.mjs +1 -1
  154. package/batteries/tools/color.cjs +2 -2
  155. package/batteries/tools/color.mjs +2 -2
  156. package/batteries/tools/comparison.cjs +2 -2
  157. package/batteries/tools/comparison.mjs +2 -2
  158. package/batteries/tools/data_structure.cjs +2 -2
  159. package/batteries/tools/data_structure.mjs +2 -2
  160. package/batteries/tools/datetime_extended.cjs +3 -3
  161. package/batteries/tools/datetime_extended.mjs +3 -3
  162. package/batteries/tools/datetime_math.cjs +3 -3
  163. package/batteries/tools/datetime_math.mjs +3 -3
  164. package/batteries/tools/encoding.cjs +2 -2
  165. package/batteries/tools/encoding.mjs +2 -2
  166. package/batteries/tools/formatting.cjs +2 -2
  167. package/batteries/tools/formatting.mjs +2 -2
  168. package/batteries/tools/geo_basics.cjs +2 -2
  169. package/batteries/tools/geo_basics.mjs +2 -2
  170. package/batteries/tools/math.cjs +2 -2
  171. package/batteries/tools/math.mjs +2 -2
  172. package/batteries/tools/memory.cjs +5 -5
  173. package/batteries/tools/memory.mjs +5 -5
  174. package/batteries/tools/parsing.cjs +3 -3
  175. package/batteries/tools/parsing.mjs +3 -3
  176. package/batteries/tools/retrievables.cjs +5 -5
  177. package/batteries/tools/retrievables.mjs +5 -5
  178. package/batteries/tools/scrapper.cjs +1 -1
  179. package/batteries/tools/scrapper.mjs +1 -1
  180. package/batteries/tools/searxng.cjs +1 -1
  181. package/batteries/tools/searxng.mjs +1 -1
  182. package/batteries/tools/standing_instructions.cjs +3 -3
  183. package/batteries/tools/standing_instructions.mjs +3 -3
  184. package/batteries/tools/statistics.cjs +3 -3
  185. package/batteries/tools/statistics.mjs +3 -3
  186. package/batteries/tools/string_processing.cjs +2 -2
  187. package/batteries/tools/string_processing.mjs +2 -2
  188. package/batteries/tools/structured_data.cjs +2 -2
  189. package/batteries/tools/structured_data.mjs +2 -2
  190. package/batteries/tools/text_analysis.cjs +3 -3
  191. package/batteries/tools/text_analysis.mjs +3 -3
  192. package/batteries/tools/text_comparison.cjs +2 -2
  193. package/batteries/tools/text_comparison.mjs +2 -2
  194. package/batteries/tools/time.cjs +3 -3
  195. package/batteries/tools/time.mjs +3 -3
  196. package/batteries/tools/unit_conversion.cjs +2 -2
  197. package/batteries/tools/unit_conversion.mjs +2 -2
  198. package/batteries/tools.cjs +2 -2
  199. package/batteries/tools.mjs +2 -2
  200. package/batteries/validation.cjs +4 -4
  201. package/batteries/validation.mjs +4 -4
  202. package/batteries/vector/chroma.cjs +1 -1
  203. package/batteries/vector/chroma.mjs +1 -1
  204. package/batteries/vector/clickhouse.cjs +1 -1
  205. package/batteries/vector/clickhouse.mjs +1 -1
  206. package/batteries/vector/cloudflare.cjs +1 -1
  207. package/batteries/vector/cloudflare.mjs +1 -1
  208. package/batteries/vector/couchbase.cjs +1 -1
  209. package/batteries/vector/couchbase.mjs +1 -1
  210. package/batteries/vector/duckdb.cjs +1 -1
  211. package/batteries/vector/duckdb.mjs +1 -1
  212. package/batteries/vector/elasticsearch.cjs +1 -1
  213. package/batteries/vector/elasticsearch.mjs +1 -1
  214. package/batteries/vector/hnswlib.cjs +1 -1
  215. package/batteries/vector/hnswlib.mjs +1 -1
  216. package/batteries/vector/in_memory.cjs +1 -1
  217. package/batteries/vector/in_memory.mjs +1 -1
  218. package/batteries/vector/lancedb.cjs +1 -1
  219. package/batteries/vector/lancedb.mjs +1 -1
  220. package/batteries/vector/mariadb.cjs +1 -1
  221. package/batteries/vector/mariadb.mjs +1 -1
  222. package/batteries/vector/milvus.cjs +1 -1
  223. package/batteries/vector/milvus.mjs +1 -1
  224. package/batteries/vector/opensearch.cjs +1 -1
  225. package/batteries/vector/opensearch.mjs +1 -1
  226. package/batteries/vector/oracle23ai.cjs +1 -1
  227. package/batteries/vector/oracle23ai.mjs +1 -1
  228. package/batteries/vector/orama.cjs +1 -1
  229. package/batteries/vector/orama.mjs +1 -1
  230. package/batteries/vector/pgvector.cjs +1 -1
  231. package/batteries/vector/pgvector.mjs +1 -1
  232. package/batteries/vector/pinecone.cjs +1 -1
  233. package/batteries/vector/pinecone.mjs +1 -1
  234. package/batteries/vector/qdrant.cjs +1 -1
  235. package/batteries/vector/qdrant.mjs +1 -1
  236. package/batteries/vector/redis.cjs +1 -1
  237. package/batteries/vector/redis.mjs +1 -1
  238. package/batteries/vector/retrievable.cjs +1 -1
  239. package/batteries/vector/retrievable.mjs +1 -1
  240. package/batteries/vector/s3vectors.cjs +1 -1
  241. package/batteries/vector/s3vectors.mjs +1 -1
  242. package/batteries/vector/sqlite_vec.cjs +1 -1
  243. package/batteries/vector/sqlite_vec.mjs +1 -1
  244. package/batteries/vector/typesense.cjs +1 -1
  245. package/batteries/vector/typesense.mjs +1 -1
  246. package/batteries/vector/vespa.cjs +1 -1
  247. package/batteries/vector/vespa.mjs +1 -1
  248. package/batteries/vector/weaviate.cjs +1 -1
  249. package/batteries/vector/weaviate.mjs +1 -1
  250. package/batteries/vector.cjs +2 -2
  251. package/batteries/vector.mjs +2 -2
  252. package/batteries.cjs +9 -9
  253. package/batteries.mjs +9 -9
  254. package/{chat_common-DKw8FDol.mjs → chat_common-CeoHwSsz.mjs} +2 -2
  255. package/{chat_common-DKw8FDol.mjs.map → chat_common-CeoHwSsz.mjs.map} +1 -1
  256. package/{chat_common-vSxDBGgr.cjs → chat_common-DlIK1IAn.cjs} +2 -2
  257. package/{chat_common-vSxDBGgr.cjs.map → chat_common-DlIK1IAn.cjs.map} +1 -1
  258. package/{common-oI1niK9Z.mjs → common-B5maOoF_.mjs} +7 -7
  259. package/{common-oI1niK9Z.mjs.map → common-B5maOoF_.mjs.map} +1 -1
  260. package/{common-BcB05Isq.cjs → common-joo6vLu-.cjs} +7 -7
  261. package/{common-BcB05Isq.cjs.map → common-joo6vLu-.cjs.map} +1 -1
  262. package/common.cjs +7 -7
  263. package/common.mjs +7 -7
  264. package/{dispatch_runner-CTAI0RSs.cjs → dispatch_runner-BTaUtdtO.cjs} +5 -5
  265. package/{dispatch_runner-CTAI0RSs.cjs.map → dispatch_runner-BTaUtdtO.cjs.map} +1 -1
  266. package/{dispatch_runner-BZDXUe0G.mjs → dispatch_runner-DO7jo_gl.mjs} +5 -5
  267. package/{dispatch_runner-BZDXUe0G.mjs.map → dispatch_runner-DO7jo_gl.mjs.map} +1 -1
  268. package/dispatch_runner.cjs +1 -1
  269. package/dispatch_runner.mjs +1 -1
  270. package/{ecmascript-DOv8gVQ5.cjs → ecmascript-ChvxTCXz.cjs} +3 -3
  271. package/{ecmascript-DOv8gVQ5.cjs.map → ecmascript-ChvxTCXz.cjs.map} +1 -1
  272. package/{ecmascript-B9Z2C24U.mjs → ecmascript-bgwVyZG1.mjs} +3 -3
  273. package/{ecmascript-B9Z2C24U.mjs.map → ecmascript-bgwVyZG1.mjs.map} +1 -1
  274. package/eslint/rules.cjs +1 -1
  275. package/eslint/rules.mjs +1 -1
  276. package/eslint.cjs +2 -2
  277. package/eslint.mjs +2 -2
  278. package/exceptions.cjs +1 -1
  279. package/exceptions.mjs +1 -1
  280. package/forge.cjs +2 -2
  281. package/forge.mjs +2 -2
  282. package/guards.cjs +7 -7
  283. package/guards.mjs +7 -7
  284. package/{helpers-mbn_EsDV.mjs → helpers-C1T0DV8Q.mjs} +3 -3
  285. package/{helpers-mbn_EsDV.mjs.map → helpers-C1T0DV8Q.mjs.map} +1 -1
  286. package/{helpers-CiZnHmxC.cjs → helpers-D6ebO8Vc.cjs} +3 -3
  287. package/{helpers-CiZnHmxC.cjs.map → helpers-D6ebO8Vc.cjs.map} +1 -1
  288. package/index.cjs +10 -10
  289. package/index.mjs +10 -10
  290. package/{manifest-BPcrFRN4.cjs → manifest-DPYWN15l.cjs} +2 -2
  291. package/{manifest-BPcrFRN4.cjs.map → manifest-DPYWN15l.cjs.map} +1 -1
  292. package/mcp/adk-docs-corpus.json +2 -2
  293. package/package.json +407 -407
  294. package/{retrievable-CXTAUuuv.mjs → retrievable-CrGKx4sc.mjs} +3 -3
  295. package/{retrievable-CXTAUuuv.mjs.map → retrievable-CrGKx4sc.mjs.map} +1 -1
  296. package/{retrievable-BOuQSDHF.cjs → retrievable-DVkAglIv.cjs} +3 -3
  297. package/{retrievable-BOuQSDHF.cjs.map → retrievable-DVkAglIv.cjs.map} +1 -1
  298. package/{scrapper-lXnFGDi0.cjs → scrapper-Boc6kq2v.cjs} +4 -4
  299. package/{scrapper-lXnFGDi0.cjs.map → scrapper-Boc6kq2v.cjs.map} +1 -1
  300. package/{scrapper-BCdUm8c8.mjs → scrapper-D2Gy9Jhv.mjs} +4 -4
  301. package/{scrapper-BCdUm8c8.mjs.map → scrapper-D2Gy9Jhv.mjs.map} +1 -1
  302. package/{searxng-N7qu6dA-.cjs → searxng-DOy3eBDH.cjs} +4 -4
  303. package/{searxng-N7qu6dA-.cjs.map → searxng-DOy3eBDH.cjs.map} +1 -1
  304. package/{searxng-B-LdaVUP.mjs → searxng-cCb0lAcN.mjs} +4 -4
  305. package/{searxng-B-LdaVUP.mjs.map → searxng-cCb0lAcN.mjs.map} +1 -1
  306. package/server.json +2 -2
  307. package/skills/adk-assembly/SKILL.md +2 -2
  308. package/{spooled_artifact-Bw_7swIp.mjs → spooled_artifact-BkOe4-j-.mjs} +731 -731
  309. package/spooled_artifact-BkOe4-j-.mjs.map +1 -0
  310. package/{spooled_artifact-DZXsP4s1.cjs → spooled_artifact-BoYsldvO.cjs} +730 -730
  311. package/spooled_artifact-BoYsldvO.cjs.map +1 -0
  312. package/spooled_artifact.cjs +2 -2
  313. package/spooled_artifact.mjs +2 -2
  314. package/{spooled_markdown_artifact-vd6eNtIP.mjs → spooled_markdown_artifact-Dnl-lCGv.mjs} +3 -3
  315. package/{spooled_markdown_artifact-vd6eNtIP.mjs.map → spooled_markdown_artifact-Dnl-lCGv.mjs.map} +1 -1
  316. package/{spooled_markdown_artifact-Bo0u8cRS.cjs → spooled_markdown_artifact-DzbydBel.cjs} +3 -3
  317. package/{spooled_markdown_artifact-Bo0u8cRS.cjs.map → spooled_markdown_artifact-DzbydBel.cjs.map} +1 -1
  318. package/{thought-CxSaF6Xf.mjs → thought-BrQt6HAb.mjs} +3 -3
  319. package/{thought-CxSaF6Xf.mjs.map → thought-BrQt6HAb.mjs.map} +1 -1
  320. package/{thought-C12mqaKQ.cjs → thought-CXsVh5hS.cjs} +3 -3
  321. package/{thought-C12mqaKQ.cjs.map → thought-CXsVh5hS.cjs.map} +1 -1
  322. package/{tokenizable-BcodRtoW.cjs → tokenizable-DDIdXbJN.cjs} +29 -29
  323. package/{tokenizable-BcodRtoW.cjs.map → tokenizable-DDIdXbJN.cjs.map} +1 -1
  324. package/{tokenizable-VB4Av8GF.mjs → tokenizable-xPXj1AQX.mjs} +30 -30
  325. package/{tokenizable-VB4Av8GF.mjs.map → tokenizable-xPXj1AQX.mjs.map} +1 -1
  326. package/{tool_call-Cfaj-6zK.mjs → tool_call-8crmZsO8.mjs} +4 -4
  327. package/{tool_call-Cfaj-6zK.mjs.map → tool_call-8crmZsO8.mjs.map} +1 -1
  328. package/{tool_call-CsBOpKsg.cjs → tool_call-NvQcPf5d.cjs} +4 -4
  329. package/{tool_call-CsBOpKsg.cjs.map → tool_call-NvQcPf5d.cjs.map} +1 -1
  330. package/{tools-BjHXlDlV.cjs → tools-BHc8qB5I.cjs} +6 -6
  331. package/{tools-BjHXlDlV.cjs.map → tools-BHc8qB5I.cjs.map} +1 -1
  332. package/{tools-Vkfht7mU.mjs → tools-geIlta3C.mjs} +6 -6
  333. package/{tools-Vkfht7mU.mjs.map → tools-geIlta3C.mjs.map} +1 -1
  334. package/{toon-BSTQnHed.mjs → toon-BA9Q7NHG.mjs} +5 -5
  335. package/{toon-BSTQnHed.mjs.map → toon-BA9Q7NHG.mjs.map} +1 -1
  336. package/{toon-5c9ceKiU.cjs → toon-C8IFssRi.cjs} +5 -5
  337. package/{toon-5c9ceKiU.cjs.map → toon-C8IFssRi.cjs.map} +1 -1
  338. package/{turn_runner--tsMLLx4.cjs → turn_runner-A-vpLUvj.cjs} +5 -5
  339. package/{turn_runner--tsMLLx4.cjs.map → turn_runner-A-vpLUvj.cjs.map} +1 -1
  340. package/{turn_runner-BHHD6h77.mjs → turn_runner-BmVXcBZ2.mjs} +5 -5
  341. package/{turn_runner-BHHD6h77.mjs.map → turn_runner-BmVXcBZ2.mjs.map} +1 -1
  342. package/turn_runner.cjs +1 -1
  343. package/turn_runner.mjs +1 -1
  344. package/{xml-CYseDztH.mjs → xml-B1JIGLpU.mjs} +5 -5
  345. package/{xml-CYseDztH.mjs.map → xml-B1JIGLpU.mjs.map} +1 -1
  346. package/{xml-DTOnPN52.cjs → xml-Cu7ZvgBQ.cjs} +5 -5
  347. package/{xml-DTOnPN52.cjs.map → xml-Cu7ZvgBQ.cjs.map} +1 -1
  348. package/{yaml-BPBoiOjx.mjs → yaml-1mP4uxdf.mjs} +5 -5
  349. package/{yaml-BPBoiOjx.mjs.map → yaml-1mP4uxdf.mjs.map} +1 -1
  350. package/{yaml-CMrbNWLc.cjs → yaml-BlB29N68.cjs} +5 -5
  351. package/{yaml-CMrbNWLc.cjs.map → yaml-BlB29N68.cjs.map} +1 -1
  352. package/artifact_methods-Cg0go7Q4.mjs +0 -1
  353. package/artifact_methods-Dtf4-3C-.cjs +0 -1
  354. package/spooled_artifact-Bw_7swIp.mjs.map +0 -1
  355. package/spooled_artifact-DZXsP4s1.cjs.map +0 -1
@@ -1,14 +1,13 @@
1
1
  import { n as isInstanceOf, r as isObject, t as isError } from "../guards-BEpY7lBI.mjs";
2
- import { i as effectiveToolMethods } from "../spooled_artifact-Bw_7swIp.mjs";
2
+ import { i as effectiveToolMethods } from "../spooled_artifact-BkOe4-j-.mjs";
3
3
  import { NodeRef, ParamRef, planDigest, registerOrchestrationEncodables } from "./orchestration/encoding.mjs";
4
4
  import { branchKey, foldOps } from "./orchestration/ops.mjs";
5
5
  import { entryNodes, findCycle, handleAppliesTo, immediateDominator, incoming, isPlanEdge, isPlanNode, isValidEdgeId, isValidNodeId, nodeById, outgoing, reachableFrom, readPath, routesBetween } from "./orchestration/plan.mjs";
6
6
  import { approvePlan, computeAuthoritySet } from "./orchestration/approval.mjs";
7
7
  import { decodeOutputSchema, joinPromptParts, stripInstructionTags, validateReasonerOutput, wrapInstruction } from "./orchestration/reason.mjs";
8
8
  import { createDispatchReasoner } from "./orchestration/dispatch_reasoner.mjs";
9
- import { InMemoryPlanStore } from "./orchestration/in_memory.mjs";
10
9
  import { foldRun } from "./orchestration/runs.mjs";
11
- import "../artifact_methods-Cg0go7Q4.mjs";
10
+ import "../artifact_methods-q52ETLwI.mjs";
12
11
  import { executePlan } from "./orchestration/executor.mjs";
13
12
  import { renderPlan } from "./orchestration/render.mjs";
14
13
  import { rawDiff, rawOps, rawPlan } from "./orchestration/raw.mjs";
@@ -17,6 +16,7 @@ import { freezePlan } from "./orchestration/validation.mjs";
17
16
  import { instantiateTemplate, validateTemplate } from "./orchestration/templates.mjs";
18
17
  import { forgeOrchestrationTools } from "./orchestration/forge.mjs";
19
18
  import { a as isStructuredPredicate, c as E_ORCH_CELL_UNAVAILABLE, i as isPredicateLeaf, l as E_ORCH_ENCODER_REQUIRED, n as isAnyPredicate, o as loadOnce, r as isNotPredicate, s as parseStructuredPredicate, t as isAllPredicate } from "../predicates-CM27Z3TF.mjs";
19
+ import { InMemoryPlanStore } from "./orchestration/in_memory.mjs";
20
20
  import { createStructuredCell } from "./orchestration/cells/structured.mjs";
21
21
  import { createJexlCell } from "./orchestration/cells/jexl.mjs";
22
22
  //#region src/batteries/orchestration/index.ts
@@ -25,14 +25,20 @@ export interface SandboxPolicyEnforcer {
25
25
  correlationId: string;
26
26
  cwd: string;
27
27
  /**
28
- * An ADDITIVE per-call overlay on the child's environment, applied LAST.
28
+ * The caller's own EXPLICIT environment values, applied LAST.
29
29
  *
30
30
  * @remarks
31
- * NOT the host-inheritance control. What a child inherits from the host is the ADAPTER's decision
32
- * (the Node/SRT one denies by default and takes an allow-list at construction); this field only
33
- * adds to whatever that produced, and an adapter MUST NOT let it silently widen what the deployment
34
- * allowed. Leaving these semantics unstated is how the Node adapter came to spread the entire
35
- * `process.env` into every child while this field sat unused.
31
+ * NOT the host-inheritance control. What a child inherits from the host is the ADAPTER's
32
+ * decision, expressed as an allow-list the adapter owns (the Node/SRT one denies by default and
33
+ * takes that allow-list at construction). This field is the other half of the picture: the
34
+ * values the caller names itself. They may add names, or override inherited ones, and because
35
+ * they are applied last they also win a collision with an allow-listed name.
36
+ *
37
+ * An adapter MUST NOT let `env` — or anything else — cause host variables BEYOND its allow-list
38
+ * to reach the child. Concretely, it must not merge the rest of `process.env` back in on top,
39
+ * and it must not treat the presence of `env` as a trigger to inherit more widely. Leaving these
40
+ * semantics unstated is how the Node adapter came to spread the entire `process.env` into every
41
+ * child while this field sat unused.
36
42
  */
37
43
  env?: Record<string, string>;
38
44
  /**
@@ -1,17 +1,27 @@
1
1
  import { type SandboxEventSink } from "./observability";
2
2
  import type { BinaryExecutor, BinaryInvocation } from "../media/contracts";
3
3
  /**
4
- * A small command-wrapper seam used by {@link sandboxedExecutor}. The wrapper returns the
5
- * invocation that the inner executor should receive; it must not execute the command itself.
4
+ * A command wrapper that REWRITES an invocation into the one the inner executor should run.
5
+ *
6
+ * @remarks
7
+ * The wrapper's job is to own quoting: it returns the argv that actually gets spawned, which for a
8
+ * sandbox is the wrapper binary (bwrap, sandbox-exec, …) followed by everything that binary needs.
9
+ * That is why {@link sandboxedExecutor} does NOT quote for it — quoting is a property of the
10
+ * wrapper being used (a shell `-c` string, an argv vector, a container `exec` line), so an adapter
11
+ * that quoted first would hand every implementor the wrong representation.
12
+ *
13
+ * A `wrap` implementation must NOT execute anything: it only computes and returns the invocation.
6
14
  */
7
- /** Command wrapping contract used by the executor adapter. */
8
15
  export interface BinarySandbox {
9
- /** Wrap an invocation without executing it. */
10
- wrap(invocation: BinaryInvocation & {
11
- command: string;
12
- }): Promise<BinaryInvocation & {
13
- command: string;
14
- }>;
16
+ /**
17
+ * Return the invocation the inner executor should run instead. Its `cmd` and `args` ARE the
18
+ * wrapped argv, so the caller's original `args` are never appended.
19
+ *
20
+ * @param invocation - The command, args, working directory, environment, and limits to wrap.
21
+ * @returns The replacement invocation, carrying through whatever the caller asked for that the
22
+ * wrapper does not itself decide (`cwd`, `timeoutMs`, `signal`, the kill controls).
23
+ */
24
+ wrap(invocation: BinaryInvocation): Promise<BinaryInvocation>;
15
25
  }
16
26
  /** Configuration for the sandboxed binary executor. */
17
27
  export interface SandboxedExecutorOptions {
@@ -31,11 +41,19 @@ export interface SandboxedExecutorOptions {
31
41
  * adapter does not raise that bound (and never sets `maxBuffer: Infinity`). The streaming path is
32
42
  * {@link createRunShellCommandTool}, which uses the policy-enforcer stream contract instead.
33
43
  *
44
+ * The adapter hands the invocation to {@link BinarySandbox.wrap} verbatim and runs what comes
45
+ * back: `inner.exec(await sandbox.wrap(invocation))`. The returned `cmd`/`args` are the complete
46
+ * wrapped argv, so the original `args` are not re-appended — a wrapper that wants them in the
47
+ * wrapped command puts them there itself. Quoting is therefore the wrapper's job, not this
48
+ * adapter's.
49
+ *
34
50
  * Bypass is an audit-only opt-out. Its predicate receives `cmd` only, never argv: callers must
35
51
  * allow only binaries safe with hostile arguments and must never allow an interpreter. Non-zero
36
52
  * exits remain data and are never thrown. Removing this wrapper call restores the inner executor.
53
+ *
54
+ * @param options - The wrapper, the inner executor, and the optional audit hooks.
55
+ * @returns A `BinaryExecutor` whose non-bypassed invocations go through `options.sandbox.wrap`.
37
56
  */
38
- /** Create a BinaryExecutor that wraps invocations unless an explicitly audited bypass applies. */
39
57
  export declare const sandboxedExecutor: (options: SandboxedExecutorOptions) => BinaryExecutor;
40
58
  /** Emit a bypass through the canonical sink for consumers that do not retain the adapter. */
41
59
  export declare const reportSandboxBypass: (sink: SandboxEventSink, command: string) => void;
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_spooled_artifact = require("../../spooled_artifact-DZXsP4s1.cjs");
2
+ const require_spooled_artifact = require("../../spooled_artifact-BoYsldvO.cjs");
3
3
  const require_exceptions = require("../../exceptions-DrHnAGQz.cjs");
4
4
  const require_guards = require("../../guards-5-XmJgD2.cjs");
5
5
  require("../../forge.cjs");
@@ -1,6 +1,6 @@
1
1
  import { t as createException } from "../../exceptions-DRYLe-J4.mjs";
2
2
  import { n as isInstanceOf, t as isError } from "../../guards-BEpY7lBI.mjs";
3
- import { p as Tool } from "../../spooled_artifact-Bw_7swIp.mjs";
3
+ import { f as Tool } from "../../spooled_artifact-BkOe4-j-.mjs";
4
4
  import "../../forge.mjs";
5
5
  import "../../guards.mjs";
6
6
  import { runToolGate } from "../tools/_shared.mjs";
@@ -27,5 +27,5 @@
27
27
  * an optional peer.
28
28
  */
29
29
  export * from "./fs_node";
30
- export { srtEnforcer, mapPolicy, type SrtEnforcerOptions } from "./srt_enforcer";
30
+ export { srtEnforcer, srtBinarySandbox, mapPolicy, type SrtEnforcerOptions, type SrtBinarySandboxOptions, } from "./srt_enforcer";
31
31
  export * from "./search_ripgrep";
@@ -1,3 +1,4 @@
1
+ import type { BinarySandbox } from "../executor";
1
2
  import type { SandboxPolicy } from "../types";
2
3
  import type { SandboxPolicyEnforcer } from "../contracts/policy_enforcer";
3
4
  type SrtConfig = {
@@ -143,4 +144,77 @@ export type SrtEnforcerOptions = {
143
144
  * @returns An enforcer whose derived baseline is already captured.
144
145
  */
145
146
  export declare const srtEnforcer: (options: SrtEnforcerOptions) => Promise<SandboxPolicyEnforcer>;
147
+ /**
148
+ * Options for {@link srtBinarySandbox}.
149
+ */
150
+ export type SrtBinarySandboxOptions = {
151
+ /**
152
+ * The per-invocation policy this wrapper applies. Defaults to the enforcer's own session policy.
153
+ *
154
+ * @remarks
155
+ * This is the SAME per-call policy contract {@link SandboxPolicyEnforcer.run} takes, so it is
156
+ * admitted identically: the FILESYSTEM section is baked into this child's profile (and replaces
157
+ * the session baseline for it, exactly as `run()` does), while a NETWORK section that differs
158
+ * from the live session is refused with `E_SANDBOX_NETWORK_GRANT_UNSUPPORTED`. Omitted means the
159
+ * enforcer's established session policy, which is the only policy that can never diverge from
160
+ * the session's network state.
161
+ */
162
+ policy?: SandboxPolicy;
163
+ /**
164
+ * The DEFAULT working directory, used when the invocation carries none — the invocation's own
165
+ * `cwd` wins. Falls back to the current process directory when neither names one.
166
+ *
167
+ * @remarks
168
+ * ONE effective directory is computed from those layers and used for BOTH the SRT profile and the
169
+ * returned invocation's `cwd`, so the profile and the spawn can never disagree. That matters
170
+ * because SRT derives its git `safe.directory` injection and (on Linux) its mandatory-deny scan
171
+ * from this directory: a profile generated for one directory while the executor spawns in
172
+ * another is a sandbox that does not describe the process it is supposedly enforcing.
173
+ */
174
+ cwd?: string;
175
+ };
176
+ /**
177
+ * Expose an existing {@link SandboxPolicyEnforcer} as a {@link BinarySandbox} for the media
178
+ * pipeline — the bridge between the sandbox battery and {@link sandboxedExecutor}.
179
+ *
180
+ * @remarks
181
+ * DELIBERATELY DERIVED FROM {@link srtEnforcer}, NOT A SECOND SRT ADAPTER. It holds no state of its
182
+ * own: the wrapper closes over the enforcer's single live `SandboxManager` session, its validated
183
+ * `binShell`, its `mapPolicy` translation, its network-divergence admission gate and its host-env
184
+ * allow-list. One process-global session, one translation point, one admission policy — the two
185
+ * execution routes (`run()` for streaming tools, this for settled media invocations) share the
186
+ * internal admission+wrapping step so they cannot drift.
187
+ *
188
+ * The wrapped invocation is what the inner executor spawns: `cmd` is the wrapper binary
189
+ * (`bwrap`/`sandbox-exec`), `args` are the rest of the generated argv, and the caller's own argv is
190
+ * already inside that generated command. The adapter therefore must not re-append the original args.
191
+ *
192
+ * THE ENVIRONMENT SPLITS IN TWO, AND ONLY ONE HALF INHERITS FROM THE HOST. The host-env allow-list is
193
+ * what decides which HOST variables a child may inherit from `process.env`; it is the adapter's
194
+ * decision, taken at construction. The caller's `env` is its own EXPLICIT values, applied last, and
195
+ * may add names or override allow-listed ones. The wrap composes the two into
196
+ * `{ ...hostEnv, ...(invocation.env ?? {}) }` and sets `extendEnv: false`, so the executor hands the
197
+ * child EXACTLY those variables. This is load-bearing: execa's default `extendEnv: true` would merge
198
+ * the full `process.env` back in, which would silently hand the model every host secret whenever it
199
+ * ran `env` — the exact leak the allow-list exists to prevent. So the invariant this adapter
200
+ * enforces is the contract's: `env` may add or override, but NOTHING from the host beyond the
201
+ * allow-list reaches the child, and `env` is never a reason to inherit more from the host.
202
+ *
203
+ * REFUSES rather than degrades in the same places `run()` does: the network gate throws
204
+ * `E_SANDBOX_NETWORK_GRANT_UNSUPPORTED` before anything runs, and an unavailable platform throws
205
+ * `E_SANDBOX_UNSUPPORTED_ENV` (surfaced by `srtEnforcer`'s construction). After the enforcer is
206
+ * disposed the process-global session is gone, so a wrap still generates argv but the child is
207
+ * refused by the OS — the same honest failure mode `run()` presents. Prefer disposing the
208
+ * executor alongside the enforcer.
209
+ *
210
+ * POSIX-only, like the session it wraps: there is no `process.kill(-pid, signal)` equivalent on
211
+ * Windows, which is why `srtEnforcer` never constructs there.
212
+ *
213
+ * @param enforcer - The live enforcer whose session, shell, policy mapping and env allow-list this
214
+ * wrapper reuses. Construct it with {@link srtEnforcer} and dispose it when the executor goes away.
215
+ * @param opts - The per-invocation policy and the DEFAULT working directory (the invocation's own
216
+ * `cwd` wins); the same directory is used for the SRT profile and for the returned invocation.
217
+ * @returns A {@link BinarySandbox} whose `wrap` returns the sandboxed argv the inner executor runs.
218
+ */
219
+ export declare const srtBinarySandbox: (enforcer: SandboxPolicyEnforcer, opts?: SrtBinarySandboxOptions) => BinarySandbox;
146
220
  export { mapPolicy };
@@ -282,16 +282,43 @@ var srtEnforcer = async (options) => {
282
282
  ...derived.write.denyWithinAllow,
283
283
  ...derived.mandatoryDeny.entries
284
284
  ]);
285
+ /**
286
+ * PER-CALL ADMISSION plus the SRT argv wrap — the one path BOTH execution routes take.
287
+ *
288
+ * @remarks
289
+ * `run()` spawns the result itself; {@link srtBinarySandbox} hands it to a `BinaryExecutor`
290
+ * instead. Factoring it out is what keeps those two routes from drifting apart: the network
291
+ * admission gate, the single `mapPolicy` translation, the single shell quoting step and the
292
+ * `wrapWithSandboxArgv` call are shared, so a change to any of them lands on both.
293
+ *
294
+ * The network axis is refused rather than degraded: SRT's mux proxy is started once at
295
+ * `initialize()` and filters every request against the SESSION config, so a per-call section that
296
+ * differs from the session one — whether WIDER (a new domain) or NARROWER (a shorter allow-list,
297
+ * an added deny) — is silently ignored at enforcement time. Both directions are refused: a
298
+ * narrowing would also be a lie (the child runs under the session list, not the narrower one the
299
+ * caller asked for). The per-call FILESYSTEM axis needs no such gate — its policy is baked into
300
+ * that child's profile/argv, a real per-child grant.
301
+ *
302
+ * The comparison reads the LIVE session state (re-derived per call, never the cached `derived`):
303
+ * an adopted session can be widened by a foreign `updateConfig()`, and reading the stale snapshot
304
+ * would reject sections the session already matches.
305
+ */
306
+ const admitAndWrap = async (argv, policy, signal, workingDir, correlationId) => {
307
+ const divergence = networkDivergence(derive(), policy, reasonMap(manager.getConfig()?.network?.deniedDomainReasons));
308
+ if (divergence.length > 0) throw new require_exceptions.E_SANDBOX_NETWORK_GRANT_UNSUPPORTED([`the per-call policy's network section differs from the sandbox session's, which SRT cannot enforce for a single child (its proxy filters every request against the SESSION config, not the per-call one), so the child would run under the session policy while you believed it ran under yours. Differences: ${divergence.join("; ")}. A network policy is per SESSION under SRT: repeat the session's network section for per-call filesystem policies, or establish a new srtEnforcer + createSandbox pair with the network policy you need.`]);
309
+ const mapped = mapPolicy(policy);
310
+ const command = await require_escape.quoteShellArgs(argv);
311
+ return {
312
+ argv: (await manager.wrapWithSandboxArgv(command, binShell, mapped, signal, workingDir, { commandId: correlationId })).argv,
313
+ env: hostEnv
314
+ };
315
+ };
285
316
  return {
286
317
  isSupported: () => manager.isSupportedPlatform(),
287
318
  adopted,
288
319
  checkDependencies: async () => manager.checkDependenciesAsync(),
289
320
  run: async (op) => {
290
- const divergence = networkDivergence(derive(), op.policy, reasonMap(manager.getConfig()?.network?.deniedDomainReasons));
291
- if (divergence.length > 0) throw new require_exceptions.E_SANDBOX_NETWORK_GRANT_UNSUPPORTED([`the per-call policy's network section differs from the sandbox session's, which SRT cannot enforce for a single child (its proxy filters every request against the SESSION config, not the per-call one), so the child would run under the session policy while you believed it ran under yours. Differences: ${divergence.join("; ")}. A network policy is per SESSION under SRT: repeat the session's network section for per-call filesystem policies, or establish a new srtEnforcer + createSandbox pair with the network policy you need.`]);
292
- const mapped = mapPolicy(op.policy);
293
- const command = await require_escape.quoteShellArgs(op.argv);
294
- const wrapped = await manager.wrapWithSandboxArgv(command, binShell, mapped, op.signal, op.cwd, { commandId: op.correlationId });
321
+ const wrapped = await admitAndWrap(op.argv, op.policy, op.signal, op.cwd, op.correlationId);
295
322
  const child = (0, node_child_process.spawn)(wrapped.argv[0], wrapped.argv.slice(1), {
296
323
  cwd: op.cwd,
297
324
  env: {
@@ -346,6 +373,9 @@ var srtEnforcer = async (options) => {
346
373
  completed
347
374
  };
348
375
  },
376
+ wrapInvocation: admitAndWrap,
377
+ sessionPolicy: options.policy,
378
+ hostEnv,
349
379
  effectivePolicy: () => adopted ? derive() : derived,
350
380
  diagnosticsFor: (id) => manager.getSandboxViolationStore().getViolationsForCommand(id).map(String),
351
381
  dispose: async () => {
@@ -356,6 +386,68 @@ var srtEnforcer = async (options) => {
356
386
  }
357
387
  };
358
388
  };
389
+ /**
390
+ * Expose an existing {@link SandboxPolicyEnforcer} as a {@link BinarySandbox} for the media
391
+ * pipeline — the bridge between the sandbox battery and {@link sandboxedExecutor}.
392
+ *
393
+ * @remarks
394
+ * DELIBERATELY DERIVED FROM {@link srtEnforcer}, NOT A SECOND SRT ADAPTER. It holds no state of its
395
+ * own: the wrapper closes over the enforcer's single live `SandboxManager` session, its validated
396
+ * `binShell`, its `mapPolicy` translation, its network-divergence admission gate and its host-env
397
+ * allow-list. One process-global session, one translation point, one admission policy — the two
398
+ * execution routes (`run()` for streaming tools, this for settled media invocations) share the
399
+ * internal admission+wrapping step so they cannot drift.
400
+ *
401
+ * The wrapped invocation is what the inner executor spawns: `cmd` is the wrapper binary
402
+ * (`bwrap`/`sandbox-exec`), `args` are the rest of the generated argv, and the caller's own argv is
403
+ * already inside that generated command. The adapter therefore must not re-append the original args.
404
+ *
405
+ * THE ENVIRONMENT SPLITS IN TWO, AND ONLY ONE HALF INHERITS FROM THE HOST. The host-env allow-list is
406
+ * what decides which HOST variables a child may inherit from `process.env`; it is the adapter's
407
+ * decision, taken at construction. The caller's `env` is its own EXPLICIT values, applied last, and
408
+ * may add names or override allow-listed ones. The wrap composes the two into
409
+ * `{ ...hostEnv, ...(invocation.env ?? {}) }` and sets `extendEnv: false`, so the executor hands the
410
+ * child EXACTLY those variables. This is load-bearing: execa's default `extendEnv: true` would merge
411
+ * the full `process.env` back in, which would silently hand the model every host secret whenever it
412
+ * ran `env` — the exact leak the allow-list exists to prevent. So the invariant this adapter
413
+ * enforces is the contract's: `env` may add or override, but NOTHING from the host beyond the
414
+ * allow-list reaches the child, and `env` is never a reason to inherit more from the host.
415
+ *
416
+ * REFUSES rather than degrades in the same places `run()` does: the network gate throws
417
+ * `E_SANDBOX_NETWORK_GRANT_UNSUPPORTED` before anything runs, and an unavailable platform throws
418
+ * `E_SANDBOX_UNSUPPORTED_ENV` (surfaced by `srtEnforcer`'s construction). After the enforcer is
419
+ * disposed the process-global session is gone, so a wrap still generates argv but the child is
420
+ * refused by the OS — the same honest failure mode `run()` presents. Prefer disposing the
421
+ * executor alongside the enforcer.
422
+ *
423
+ * POSIX-only, like the session it wraps: there is no `process.kill(-pid, signal)` equivalent on
424
+ * Windows, which is why `srtEnforcer` never constructs there.
425
+ *
426
+ * @param enforcer - The live enforcer whose session, shell, policy mapping and env allow-list this
427
+ * wrapper reuses. Construct it with {@link srtEnforcer} and dispose it when the executor goes away.
428
+ * @param opts - The per-invocation policy and the DEFAULT working directory (the invocation's own
429
+ * `cwd` wins); the same directory is used for the SRT profile and for the returned invocation.
430
+ * @returns A {@link BinarySandbox} whose `wrap` returns the sandboxed argv the inner executor runs.
431
+ */
432
+ var srtBinarySandbox = (enforcer, opts = {}) => ({ async wrap(invocation) {
433
+ const carrier = enforcer;
434
+ if (typeof carrier.wrapInvocation !== "function") throw new require_exceptions.E_INVALID_SANDBOX_CONFIG(["srtBinarySandbox requires an enforcer constructed by srtEnforcer: this adapter only forwards to the enforcer's own SRT session, and the supplied enforcer exposes none"]);
435
+ const policyForCall = opts.policy ?? carrier.sessionPolicy;
436
+ if (!policyForCall) throw new require_exceptions.E_INVALID_SANDBOX_CONFIG(["srtBinarySandbox requires a policy: the supplied enforcer was adopted (it holds no ADK policy of its own), so name the session policy explicitly in the wrap options"]);
437
+ const cwd = invocation.cwd ?? opts.cwd ?? process.cwd();
438
+ const wrapped = await carrier.wrapInvocation([invocation.cmd, ...invocation.args], policyForCall, invocation.signal, cwd, void 0);
439
+ return {
440
+ ...invocation,
441
+ cmd: wrapped.argv[0],
442
+ args: wrapped.argv.slice(1),
443
+ cwd,
444
+ env: {
445
+ ...wrapped.env,
446
+ ...invocation.env ?? {}
447
+ },
448
+ extendEnv: false
449
+ };
450
+ } });
359
451
  //#endregion
360
452
  //#region src/batteries/sandbox/node/search_ripgrep.ts
361
453
  /**
@@ -633,6 +725,7 @@ exports.primeGlobMatcher = require_fs_node.primeGlobMatcher;
633
725
  exports.reproduceMandatoryDeny = require_fs_node.reproduceMandatoryDeny;
634
726
  exports.resolveMaxDepthArgv = resolveMaxDepthArgv;
635
727
  exports.resolveSearchLimit = resolveSearchLimit;
728
+ exports.srtBinarySandbox = srtBinarySandbox;
636
729
  exports.srtEnforcer = srtEnforcer;
637
730
 
638
731
  //# sourceMappingURL=node.cjs.map