@humain/humain-code 0.8.2 → 0.8.4

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 (946) hide show
  1. package/CHANGELOG.md +152 -0
  2. package/dist/bundle/agent-monitor.js +1 -1
  3. package/dist/bundle/chunks/anthropic-messages-42CGJCSR.js +82 -0
  4. package/dist/bundle/chunks/ask-VH7GNX75.js +97 -0
  5. package/dist/bundle/chunks/azure-openai-responses-DOKKMBUN.js +15 -0
  6. package/dist/bundle/chunks/bedrock-converse-stream.js +200 -179
  7. package/dist/bundle/chunks/bowser-UX7KDMIY.js +92 -0
  8. package/dist/bundle/chunks/{chunk-46C6D7UC.js → chunk-2CYGUEQO.js} +1 -1
  9. package/dist/bundle/chunks/chunk-3RXT35Y3.js +3 -0
  10. package/dist/bundle/chunks/chunk-4BNDLR6C.js +177 -0
  11. package/dist/bundle/chunks/{chunk-MPRAQ6ZI.js → chunk-4LGBXPUD.js} +1 -1
  12. package/dist/bundle/chunks/chunk-4SL6URR3.js +90 -0
  13. package/dist/bundle/chunks/{chunk-PJXBU6CR.js → chunk-52642TYH.js} +394 -204
  14. package/dist/bundle/chunks/{chunk-LSRXA7OS.js → chunk-5C5K4EVJ.js} +3 -3
  15. package/dist/bundle/chunks/{chunk-2JNJJ6SZ.js → chunk-5KUCY54O.js} +3 -3
  16. package/dist/bundle/chunks/{chunk-4TDNOR36.js → chunk-625QJSFJ.js} +1 -1
  17. package/dist/bundle/chunks/chunk-73YX5XGR.js +2461 -0
  18. package/dist/bundle/chunks/chunk-7DIRHF4H.js +17 -0
  19. package/dist/bundle/chunks/{chunk-QJB5YI3I.js → chunk-7PAXKU7M.js} +1 -1
  20. package/dist/bundle/chunks/{chunk-R2KD2HFT.js → chunk-7YB3HRRN.js} +83 -196
  21. package/dist/bundle/chunks/{chunk-DCXHRP6C.js → chunk-A2UZYK23.js} +13 -13
  22. package/dist/bundle/chunks/chunk-A5ZMBTTM.js +12 -0
  23. package/dist/bundle/chunks/{chunk-JKX5EGOT.js → chunk-AER66CNP.js} +13 -13
  24. package/dist/bundle/chunks/chunk-ARTF7ZMQ.js +5 -0
  25. package/dist/bundle/chunks/chunk-B3FT6L6S.js +131 -0
  26. package/dist/bundle/chunks/chunk-BIC5BSNX.js +13 -0
  27. package/dist/bundle/chunks/{chunk-JSHKS7VH.js → chunk-BNZZJ4LO.js} +1 -1
  28. package/dist/bundle/chunks/{chunk-4MKATHT2.js → chunk-CG43CMFH.js} +1 -1
  29. package/dist/bundle/chunks/{chunk-EFY2QPVP.js → chunk-CIAXW64K.js} +16 -16
  30. package/dist/bundle/chunks/{chunk-VFLVWPLZ.js → chunk-CKFLQGJN.js} +20 -16
  31. package/dist/bundle/chunks/chunk-D4UCXXDP.js +115 -0
  32. package/dist/bundle/chunks/{chunk-HQMUDHC3.js → chunk-D6ZWWDW5.js} +6 -5
  33. package/dist/bundle/chunks/{chunk-U4EAJPMO.js → chunk-EVDQRT3I.js} +252 -371
  34. package/dist/bundle/chunks/{chunk-FJIISX5W.js → chunk-F74XLJPC.js} +195 -192
  35. package/dist/bundle/chunks/chunk-FDRBTGFJ.js +4 -0
  36. package/dist/bundle/chunks/{chunk-E4VUW4RI.js → chunk-FLWO3H5J.js} +12 -12
  37. package/dist/bundle/chunks/{chunk-KLSRGGOH.js → chunk-G2PFPQX7.js} +2 -2
  38. package/dist/bundle/chunks/chunk-GMPJWLZS.js +57 -0
  39. package/dist/bundle/chunks/{chunk-M5TVWJ5T.js → chunk-H35P7ROY.js} +462 -441
  40. package/dist/bundle/chunks/chunk-HCHCYBNK.js +2 -0
  41. package/dist/bundle/chunks/{chunk-7WE77IE3.js → chunk-HRNYDRL7.js} +1 -1
  42. package/dist/bundle/chunks/chunk-HWFAAGYK.js +23 -0
  43. package/dist/bundle/chunks/{chunk-G2QMON4O.js → chunk-HWXQCJDP.js} +408 -392
  44. package/dist/bundle/chunks/{chunk-PVNXN2TC.js → chunk-II5C7G67.js} +1 -1
  45. package/dist/bundle/chunks/{chunk-F2H47FRF.js → chunk-IMRZP5SC.js} +182 -137
  46. package/dist/bundle/chunks/{chunk-H2B3WLIM.js → chunk-J5YFXMTM.js} +4 -4
  47. package/dist/bundle/chunks/chunk-J64VNQ6D.js +13 -0
  48. package/dist/bundle/chunks/{chunk-65FLSKDA.js → chunk-K5EFEIFP.js} +5 -4
  49. package/dist/bundle/chunks/{chunk-KI7CHPWC.js → chunk-KJ3QRSSY.js} +46 -43
  50. package/dist/bundle/chunks/{cli-6DJO467D.js → chunk-KSEO2LRK.js} +12 -10
  51. package/dist/bundle/chunks/{chunk-HHWVVNGG.js → chunk-MA2WCMSN.js} +2 -2
  52. package/dist/bundle/chunks/{chunk-L4J7SMJB.js → chunk-MAEKQSFU.js} +1 -1
  53. package/dist/bundle/chunks/chunk-MHQNLTZR.js +8 -0
  54. package/dist/bundle/chunks/chunk-MLOUZAVZ.js +122 -0
  55. package/dist/bundle/chunks/chunk-MQYR4Q6X.js +5 -0
  56. package/dist/bundle/chunks/chunk-MXF3KYLZ.js +4 -0
  57. package/dist/bundle/chunks/{chunk-GY663MNP.js → chunk-MZRTVX7F.js} +1 -1
  58. package/dist/bundle/chunks/chunk-MZYHSWHX.js +59 -0
  59. package/dist/bundle/chunks/{chunk-6HTHDVJC.js → chunk-NPVRWPGX.js} +1 -1
  60. package/dist/bundle/chunks/{chunk-BRSLXHED.js → chunk-O44A4E4K.js} +1 -1
  61. package/dist/bundle/chunks/{chunk-T2ZGMEMV.js → chunk-OADQOW67.js} +175 -260
  62. package/dist/bundle/chunks/chunk-OTVHRZ67.js +17 -0
  63. package/dist/bundle/chunks/{chunk-J4GII2EE.js → chunk-P7SLTLSZ.js} +51 -46
  64. package/dist/bundle/chunks/{chunk-7OZNMWAJ.js → chunk-PPGSQZZF.js} +1 -1
  65. package/dist/bundle/chunks/chunk-PYX6ZCC7.js +29 -0
  66. package/dist/bundle/chunks/chunk-PZ7NYBHJ.js +8 -0
  67. package/dist/bundle/chunks/{chunk-VCMXBP5S.js → chunk-QESIDBMW.js} +1 -7
  68. package/dist/bundle/chunks/chunk-QUWVILLB.js +3 -0
  69. package/dist/bundle/chunks/chunk-QZWUXGY7.js +99 -0
  70. package/dist/bundle/chunks/{chunk-MIAXMK5F.js → chunk-QZXLTW7V.js} +8 -7
  71. package/dist/bundle/chunks/chunk-RP6MWUAP.js +4 -0
  72. package/dist/bundle/chunks/chunk-S2US54IU.js +37 -0
  73. package/dist/bundle/chunks/{chunk-H7UPU2SH.js → chunk-SOE25WIS.js} +1218 -1239
  74. package/dist/bundle/chunks/{chunk-JSZBTGI6.js → chunk-SZZ5PNP6.js} +2 -2
  75. package/dist/bundle/chunks/chunk-T5WECB2D.js +7 -0
  76. package/dist/bundle/chunks/{chunk-2NVGOSBN.js → chunk-T7F2TEIS.js} +37 -13
  77. package/dist/bundle/chunks/{chunk-ZSWU5KKA.js → chunk-UOSJTMCL.js} +7 -3
  78. package/dist/bundle/chunks/{chunk-6P6MMQUH.js → chunk-UTRUALFN.js} +3 -3
  79. package/dist/bundle/chunks/{chunk-PWFM6AQQ.js → chunk-V2HTCZRF.js} +70 -67
  80. package/dist/bundle/chunks/{chunk-JX6YIPNK.js → chunk-WCKS2DPT.js} +1 -1
  81. package/dist/bundle/chunks/chunk-XGOJCV6Z.js +2 -0
  82. package/dist/bundle/chunks/chunk-XGSJX23G.js +1151 -0
  83. package/dist/bundle/chunks/{chunk-7WETECIB.js → chunk-Z7BWHPJ2.js} +1 -1
  84. package/dist/bundle/chunks/chunk-ZFFDBTG3.js +17 -0
  85. package/dist/bundle/chunks/cli-NJLV3XDZ.js +3 -0
  86. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-JEZVYITT.js → cloudflare-workers-ai-system-one-ZAZW4M4B.js} +1 -1
  87. package/dist/bundle/chunks/{compat-ELBUCH6U.js → compat-7UJJAO4E.js} +12 -12
  88. package/dist/bundle/chunks/{curator-server-QB4GITGS.js → curator-server-MW645JI3.js} +2 -2
  89. package/dist/bundle/chunks/{dist-NERIS6SW.js → dist-7PCCEUQF.js} +2 -2
  90. package/dist/bundle/chunks/{dist-QSYDYE3Y.js → dist-I53JI67E.js} +9 -9
  91. package/dist/bundle/chunks/{dist-35STTNYA.js → dist-NI2PTSLH.js} +1 -1
  92. package/dist/bundle/chunks/{dist-CBODG4CA.js → dist-VXQT3DQY.js} +6 -6
  93. package/dist/bundle/chunks/{dist-cjs-EROMDUKS.js → dist-cjs-4JQA6W3S.js} +31 -31
  94. package/dist/bundle/chunks/doctor-KJVAYG3F.js +83 -0
  95. package/dist/bundle/chunks/{easter-egg-3d-VZC5WOYV.js → easter-egg-3d-Z24JLXD4.js} +1 -1
  96. package/dist/bundle/chunks/entry-3EL6GOWK.js +2 -0
  97. package/dist/bundle/chunks/{entry-SRYLSS5P.js → entry-4IMREZBD.js} +80 -79
  98. package/dist/bundle/chunks/{execute-6MEJJF2T.js → execute-C4BZQRPQ.js} +23 -22
  99. package/dist/bundle/chunks/{extract-L373D6O7.js → extract-XVQCIS7D.js} +5 -5
  100. package/dist/bundle/chunks/{flow-implementer-3P3BHQ7E.js → flow-implementer-GE2ARQKR.js} +5 -5
  101. package/dist/bundle/chunks/github-copilot.js +57 -56
  102. package/dist/bundle/chunks/google-generative-ai-P2P45MYP.js +22 -0
  103. package/dist/bundle/chunks/google-vertex-SHY4IS5F.js +26 -0
  104. package/dist/bundle/chunks/{host-WOLZCWQQ.js → host-YESS2VAB.js} +1 -1
  105. package/dist/bundle/chunks/{index.bundle-HONF3PUD.js → index.bundle-TZT64KLH.js} +102 -89
  106. package/dist/bundle/chunks/{inprocess-3PDJKE5F.js → inprocess-MGMVI6HN.js} +6 -6
  107. package/dist/bundle/chunks/interactive-mode-HHWOE4FD.js +5 -0
  108. package/dist/bundle/chunks/{llama-cpp-classify-KYZT532X.js → llama-cpp-classify-RSRH4KV2.js} +5 -5
  109. package/dist/bundle/chunks/mistral-conversations-YTMJKHHI.js +42 -0
  110. package/dist/bundle/chunks/{node-N7TPBUJB.js → node-FF6QQQLH.js} +1 -1
  111. package/dist/bundle/chunks/openai-codex-responses-NUCJOJSZ.js +97 -0
  112. package/dist/bundle/chunks/openai-completions-E5NRJUHA.js +91 -0
  113. package/dist/bundle/chunks/{openai-decisions-JMSDGR7K.js → openai-decisions-342J5ZYG.js} +1 -1
  114. package/dist/bundle/chunks/openai-responses-BN5Z4HFI.js +26 -0
  115. package/dist/bundle/chunks/openrouter-images-7RNG3JVF.js +12 -0
  116. package/dist/bundle/chunks/{pdfjs-FE3L72A6.js → pdfjs-LSTLRXQW.js} +1415 -1416
  117. package/dist/bundle/chunks/pi-messages-2L7FV5OK.js +22 -0
  118. package/dist/bundle/chunks/questionnaire-session-XEVAK7JS.js +123 -0
  119. package/dist/bundle/chunks/runtime-2FSZRUG5.js +2 -0
  120. package/dist/bundle/chunks/session-picker-666KJIVM.js +4 -0
  121. package/dist/bundle/chunks/startup-ui-INEVSNGK.js +3 -0
  122. package/dist/bundle/chunks/{trace-command-VM7FBWPE.js → trace-command-BCVMZ5ZD.js} +4 -4
  123. package/dist/bundle/chunks/typesafe-system-one-UJUNSZG4.js +3 -0
  124. package/dist/bundle/chunks/{undici-WVNE45GY.js → undici-7IGAYA4S.js} +1 -1
  125. package/dist/bundle/chunks/virtual-modules-UXSSFNV5.js +29 -0
  126. package/dist/bundle/cli-runtime.js +5 -5
  127. package/dist/bundle/flow/package.json +3 -3
  128. package/dist/bundle/index.js +13 -13
  129. package/dist/bundle/orchestrate/package.json +1 -1
  130. package/dist/bundle/rpc-entry.js +5 -4
  131. package/dist/cli/agent-dir-arg.d.ts +12 -0
  132. package/dist/cli/agent-dir-arg.d.ts.map +1 -0
  133. package/dist/cli/agent-dir-arg.js +15 -0
  134. package/dist/cli/agent-dir-arg.js.map +1 -0
  135. package/dist/cli/args.d.ts +9 -0
  136. package/dist/cli/args.d.ts.map +1 -1
  137. package/dist/cli/args.js +19 -5
  138. package/dist/cli/args.js.map +1 -1
  139. package/dist/cli/auth-check.d.ts +1 -1
  140. package/dist/cli/auth-check.d.ts.map +1 -1
  141. package/dist/cli/auth-check.js +4 -2
  142. package/dist/cli/auth-check.js.map +1 -1
  143. package/dist/cli/doctor-config.d.ts +14 -0
  144. package/dist/cli/doctor-config.d.ts.map +1 -0
  145. package/dist/cli/doctor-config.js +92 -0
  146. package/dist/cli/doctor-config.js.map +1 -0
  147. package/dist/cli/doctor-system.d.ts +12 -0
  148. package/dist/cli/doctor-system.d.ts.map +1 -0
  149. package/dist/cli/doctor-system.js +109 -0
  150. package/dist/cli/doctor-system.js.map +1 -0
  151. package/dist/cli/doctor.d.ts +11 -0
  152. package/dist/cli/doctor.d.ts.map +1 -0
  153. package/dist/cli/doctor.js +323 -0
  154. package/dist/cli/doctor.js.map +1 -0
  155. package/dist/cli/doctor.lazy.d.ts +3 -0
  156. package/dist/cli/doctor.lazy.d.ts.map +1 -0
  157. package/dist/cli/doctor.lazy.js +3 -0
  158. package/dist/cli/doctor.lazy.js.map +1 -0
  159. package/dist/cli/list-models.d.ts.map +1 -1
  160. package/dist/cli/list-models.js +0 -4
  161. package/dist/cli/list-models.js.map +1 -1
  162. package/dist/cli/project-trust.d.ts.map +1 -1
  163. package/dist/cli/project-trust.js +6 -6
  164. package/dist/cli/project-trust.js.map +1 -1
  165. package/dist/cli/startup-ui.d.ts +3 -2
  166. package/dist/cli/startup-ui.d.ts.map +1 -1
  167. package/dist/cli/startup-ui.js +23 -10
  168. package/dist/cli/startup-ui.js.map +1 -1
  169. package/dist/config.d.ts +5 -1
  170. package/dist/config.d.ts.map +1 -1
  171. package/dist/config.js +13 -3
  172. package/dist/config.js.map +1 -1
  173. package/dist/coordination/adapter/delivery.d.ts +27 -0
  174. package/dist/coordination/adapter/delivery.d.ts.map +1 -1
  175. package/dist/coordination/adapter/delivery.js +164 -4
  176. package/dist/coordination/adapter/delivery.js.map +1 -1
  177. package/dist/coordination/adapter/index.d.ts.map +1 -1
  178. package/dist/coordination/adapter/index.js +31 -5
  179. package/dist/coordination/adapter/index.js.map +1 -1
  180. package/dist/coordination/adapter/presence.d.ts +5 -0
  181. package/dist/coordination/adapter/presence.d.ts.map +1 -1
  182. package/dist/coordination/adapter/presence.js +25 -3
  183. package/dist/coordination/adapter/presence.js.map +1 -1
  184. package/dist/coordination/adapter/question-routing.d.ts +7 -0
  185. package/dist/coordination/adapter/question-routing.d.ts.map +1 -0
  186. package/dist/coordination/adapter/question-routing.js +40 -0
  187. package/dist/coordination/adapter/question-routing.js.map +1 -0
  188. package/dist/coordination/adapter/receipts.d.ts +7 -0
  189. package/dist/coordination/adapter/receipts.d.ts.map +1 -1
  190. package/dist/coordination/adapter/receipts.js +25 -2
  191. package/dist/coordination/adapter/receipts.js.map +1 -1
  192. package/dist/coordination/adapter/tool.d.ts +19 -3
  193. package/dist/coordination/adapter/tool.d.ts.map +1 -1
  194. package/dist/coordination/adapter/tool.js +93 -19
  195. package/dist/coordination/adapter/tool.js.map +1 -1
  196. package/dist/coordination/broker/broker.d.ts +3 -3
  197. package/dist/coordination/broker/broker.d.ts.map +1 -1
  198. package/dist/coordination/broker/broker.js +15 -7
  199. package/dist/coordination/broker/broker.js.map +1 -1
  200. package/dist/coordination/client/client.d.ts +2 -2
  201. package/dist/coordination/client/client.d.ts.map +1 -1
  202. package/dist/coordination/client/client.js +4 -0
  203. package/dist/coordination/client/client.js.map +1 -1
  204. package/dist/coordination/transport/protocol.d.ts.map +1 -1
  205. package/dist/coordination/transport/protocol.js +23 -0
  206. package/dist/coordination/transport/protocol.js.map +1 -1
  207. package/dist/coordination/transport/types.d.ts +11 -1
  208. package/dist/coordination/transport/types.d.ts.map +1 -1
  209. package/dist/coordination/transport/types.js.map +1 -1
  210. package/dist/core/acceptance-command.d.ts +6 -3
  211. package/dist/core/acceptance-command.d.ts.map +1 -1
  212. package/dist/core/acceptance-command.js +43 -12
  213. package/dist/core/acceptance-command.js.map +1 -1
  214. package/dist/core/acceptance-ledger.d.ts +2 -0
  215. package/dist/core/acceptance-ledger.d.ts.map +1 -1
  216. package/dist/core/acceptance-ledger.js +14 -3
  217. package/dist/core/acceptance-ledger.js.map +1 -1
  218. package/dist/core/agent-session-runtime.d.ts +11 -4
  219. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  220. package/dist/core/agent-session-runtime.js +13 -4
  221. package/dist/core/agent-session-runtime.js.map +1 -1
  222. package/dist/core/agent-session-services.d.ts.map +1 -1
  223. package/dist/core/agent-session-services.js +6 -0
  224. package/dist/core/agent-session-services.js.map +1 -1
  225. package/dist/core/agent-session.d.ts +19 -1
  226. package/dist/core/agent-session.d.ts.map +1 -1
  227. package/dist/core/agent-session.js +131 -36
  228. package/dist/core/agent-session.js.map +1 -1
  229. package/dist/core/auth-storage.d.ts.map +1 -1
  230. package/dist/core/auth-storage.js +7 -1
  231. package/dist/core/auth-storage.js.map +1 -1
  232. package/dist/core/bash-executor.d.ts +3 -1
  233. package/dist/core/bash-executor.d.ts.map +1 -1
  234. package/dist/core/bash-executor.js +18 -8
  235. package/dist/core/bash-executor.js.map +1 -1
  236. package/dist/core/compaction/branch-summarization.d.ts +2 -2
  237. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  238. package/dist/core/compaction/branch-summarization.js +9 -15
  239. package/dist/core/compaction/branch-summarization.js.map +1 -1
  240. package/dist/core/compaction/compaction.d.ts.map +1 -1
  241. package/dist/core/compaction/compaction.js +3 -0
  242. package/dist/core/compaction/compaction.js.map +1 -1
  243. package/dist/core/export-html/index.d.ts.map +1 -1
  244. package/dist/core/export-html/index.js +12 -10
  245. package/dist/core/export-html/index.js.map +1 -1
  246. package/dist/core/export-html/template.js +23 -1
  247. package/dist/core/extensions/runner.d.ts.map +1 -1
  248. package/dist/core/extensions/runner.js +13 -2
  249. package/dist/core/extensions/runner.js.map +1 -1
  250. package/dist/core/extensions/types.d.ts +9 -1
  251. package/dist/core/extensions/types.d.ts.map +1 -1
  252. package/dist/core/extensions/types.js.map +1 -1
  253. package/dist/core/footer-data-provider.d.ts.map +1 -1
  254. package/dist/core/footer-data-provider.js +2 -4
  255. package/dist/core/footer-data-provider.js.map +1 -1
  256. package/dist/core/http-dispatcher.d.ts +5 -2
  257. package/dist/core/http-dispatcher.d.ts.map +1 -1
  258. package/dist/core/http-dispatcher.js +6 -3
  259. package/dist/core/http-dispatcher.js.map +1 -1
  260. package/dist/core/keybindings.d.ts +20 -0
  261. package/dist/core/keybindings.d.ts.map +1 -1
  262. package/dist/core/keybindings.js +4 -1
  263. package/dist/core/keybindings.js.map +1 -1
  264. package/dist/core/mcp-servers.d.ts +29 -0
  265. package/dist/core/mcp-servers.d.ts.map +1 -1
  266. package/dist/core/mcp-servers.js +63 -17
  267. package/dist/core/mcp-servers.js.map +1 -1
  268. package/dist/core/messages.d.ts +4 -0
  269. package/dist/core/messages.d.ts.map +1 -1
  270. package/dist/core/messages.js +10 -2
  271. package/dist/core/messages.js.map +1 -1
  272. package/dist/core/model-config.d.ts +36 -0
  273. package/dist/core/model-config.d.ts.map +1 -1
  274. package/dist/core/model-resolver.js +1 -1
  275. package/dist/core/model-resolver.js.map +1 -1
  276. package/dist/core/model-runtime.d.ts.map +1 -1
  277. package/dist/core/model-runtime.js +20 -10
  278. package/dist/core/model-runtime.js.map +1 -1
  279. package/dist/core/nested-tool-calls.d.ts +6 -5
  280. package/dist/core/nested-tool-calls.d.ts.map +1 -1
  281. package/dist/core/nested-tool-calls.js +1 -3
  282. package/dist/core/nested-tool-calls.js.map +1 -1
  283. package/dist/core/oauth-account-pool.d.ts +14 -0
  284. package/dist/core/oauth-account-pool.d.ts.map +1 -1
  285. package/dist/core/oauth-account-pool.js +166 -14
  286. package/dist/core/oauth-account-pool.js.map +1 -1
  287. package/dist/core/os-secret-store.js +1 -1
  288. package/dist/core/os-secret-store.js.map +1 -1
  289. package/dist/core/package-manager.d.ts +3 -1
  290. package/dist/core/package-manager.d.ts.map +1 -1
  291. package/dist/core/package-manager.js +25 -4
  292. package/dist/core/package-manager.js.map +1 -1
  293. package/dist/core/pi-ai-schemas.d.ts +4 -0
  294. package/dist/core/pi-ai-schemas.d.ts.map +1 -1
  295. package/dist/core/project-trust.d.ts.map +1 -1
  296. package/dist/core/project-trust.js +1 -1
  297. package/dist/core/project-trust.js.map +1 -1
  298. package/dist/core/provider-composer.d.ts +1 -0
  299. package/dist/core/provider-composer.d.ts.map +1 -1
  300. package/dist/core/provider-composer.js +1 -0
  301. package/dist/core/provider-composer.js.map +1 -1
  302. package/dist/core/resolve-config-value.d.ts +4 -0
  303. package/dist/core/resolve-config-value.d.ts.map +1 -1
  304. package/dist/core/resolve-config-value.js +14 -3
  305. package/dist/core/resolve-config-value.js.map +1 -1
  306. package/dist/core/resource-loader.d.ts.map +1 -1
  307. package/dist/core/resource-loader.js +40 -2
  308. package/dist/core/resource-loader.js.map +1 -1
  309. package/dist/core/run-outcome.d.ts +1 -1
  310. package/dist/core/run-outcome.d.ts.map +1 -1
  311. package/dist/core/run-outcome.js +2 -2
  312. package/dist/core/run-outcome.js.map +1 -1
  313. package/dist/core/run-preflight.d.ts.map +1 -1
  314. package/dist/core/run-preflight.js +15 -8
  315. package/dist/core/run-preflight.js.map +1 -1
  316. package/dist/core/runtime-credentials.d.ts.map +1 -1
  317. package/dist/core/runtime-credentials.js +11 -7
  318. package/dist/core/runtime-credentials.js.map +1 -1
  319. package/dist/core/sdk.d.ts.map +1 -1
  320. package/dist/core/sdk.js +8 -4
  321. package/dist/core/sdk.js.map +1 -1
  322. package/dist/core/session-manager.d.ts +22 -1
  323. package/dist/core/session-manager.d.ts.map +1 -1
  324. package/dist/core/session-manager.js +227 -37
  325. package/dist/core/session-manager.js.map +1 -1
  326. package/dist/core/settings-defaults.d.ts +10 -1
  327. package/dist/core/settings-defaults.d.ts.map +1 -1
  328. package/dist/core/settings-defaults.js +7 -1
  329. package/dist/core/settings-defaults.js.map +1 -1
  330. package/dist/core/settings-manager.d.ts +14 -4
  331. package/dist/core/settings-manager.d.ts.map +1 -1
  332. package/dist/core/settings-manager.js +48 -15
  333. package/dist/core/settings-manager.js.map +1 -1
  334. package/dist/core/settings-schema.d.ts +20 -2
  335. package/dist/core/settings-schema.d.ts.map +1 -1
  336. package/dist/core/settings-schema.js +27 -4
  337. package/dist/core/settings-schema.js.map +1 -1
  338. package/dist/core/slash-commands.d.ts.map +1 -1
  339. package/dist/core/slash-commands.js +2 -0
  340. package/dist/core/slash-commands.js.map +1 -1
  341. package/dist/core/tools/bash-jobs.js +2 -2
  342. package/dist/core/tools/bash-jobs.js.map +1 -1
  343. package/dist/core/tools/bash.d.ts +3 -0
  344. package/dist/core/tools/bash.d.ts.map +1 -1
  345. package/dist/core/tools/bash.js +78 -46
  346. package/dist/core/tools/bash.js.map +1 -1
  347. package/dist/core/tools/edit-diff.d.ts +7 -1
  348. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  349. package/dist/core/tools/edit-diff.js +139 -75
  350. package/dist/core/tools/edit-diff.js.map +1 -1
  351. package/dist/core/tools/edit.d.ts.map +1 -1
  352. package/dist/core/tools/edit.js +4 -1
  353. package/dist/core/tools/edit.js.map +1 -1
  354. package/dist/core/tools/output-accumulator.d.ts +21 -6
  355. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  356. package/dist/core/tools/output-accumulator.js +90 -76
  357. package/dist/core/tools/output-accumulator.js.map +1 -1
  358. package/dist/core/tools/render-utils.d.ts +7 -2
  359. package/dist/core/tools/render-utils.d.ts.map +1 -1
  360. package/dist/core/tools/render-utils.js +14 -1
  361. package/dist/core/tools/render-utils.js.map +1 -1
  362. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  363. package/dist/core/tools/renderers/bash.js +9 -3
  364. package/dist/core/tools/renderers/bash.js.map +1 -1
  365. package/dist/core/tools/truncate.d.ts +1 -1
  366. package/dist/core/tools/truncate.d.ts.map +1 -1
  367. package/dist/core/tools/truncate.js +16 -7
  368. package/dist/core/tools/truncate.js.map +1 -1
  369. package/dist/core/tools/write.d.ts.map +1 -1
  370. package/dist/core/tools/write.js +2 -0
  371. package/dist/core/tools/write.js.map +1 -1
  372. package/dist/core/trust-manager.d.ts +2 -0
  373. package/dist/core/trust-manager.d.ts.map +1 -1
  374. package/dist/core/trust-manager.js +5 -4
  375. package/dist/core/trust-manager.js.map +1 -1
  376. package/dist/core/usage-totals.d.ts.map +1 -1
  377. package/dist/core/usage-totals.js +3 -0
  378. package/dist/core/usage-totals.js.map +1 -1
  379. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  380. package/dist/extensions/codemode/execute.js +64 -20
  381. package/dist/extensions/codemode/execute.js.map +1 -1
  382. package/dist/extensions/codemode/renderer.d.ts.map +1 -1
  383. package/dist/extensions/codemode/renderer.js +8 -3
  384. package/dist/extensions/codemode/renderer.js.map +1 -1
  385. package/dist/extensions/codemode/tool.d.ts +5 -0
  386. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  387. package/dist/extensions/codemode/tool.js.map +1 -1
  388. package/dist/extensions/llama/client.d.ts.map +1 -1
  389. package/dist/extensions/llama/client.js +3 -13
  390. package/dist/extensions/llama/client.js.map +1 -1
  391. package/dist/extensions/llama/ui.d.ts.map +1 -1
  392. package/dist/extensions/llama/ui.js +2 -1
  393. package/dist/extensions/llama/ui.js.map +1 -1
  394. package/dist/extensions/mcp/cli.d.ts +7 -0
  395. package/dist/extensions/mcp/cli.d.ts.map +1 -1
  396. package/dist/extensions/mcp/cli.js +35 -8
  397. package/dist/extensions/mcp/cli.js.map +1 -1
  398. package/dist/extensions/mcp/config.d.ts +33 -0
  399. package/dist/extensions/mcp/config.d.ts.map +1 -1
  400. package/dist/extensions/mcp/config.js +11 -2
  401. package/dist/extensions/mcp/config.js.map +1 -1
  402. package/dist/extensions/mcp/index.d.ts +8 -0
  403. package/dist/extensions/mcp/index.d.ts.map +1 -1
  404. package/dist/extensions/mcp/index.js +16 -0
  405. package/dist/extensions/mcp/index.js.map +1 -1
  406. package/dist/extensions/mcp/resources.d.ts +1 -1
  407. package/dist/extensions/mcp/resources.d.ts.map +1 -1
  408. package/dist/extensions/mcp/resources.js +4 -3
  409. package/dist/extensions/mcp/resources.js.map +1 -1
  410. package/dist/extensions/mcp/runtime.d.ts +1 -1
  411. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  412. package/dist/extensions/mcp/runtime.js +15 -14
  413. package/dist/extensions/mcp/runtime.js.map +1 -1
  414. package/dist/extensions/mcp/tools.d.ts +1 -24
  415. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  416. package/dist/extensions/mcp/tools.js +10 -163
  417. package/dist/extensions/mcp/tools.js.map +1 -1
  418. package/dist/humain/ask-user-question/index.d.ts +4 -0
  419. package/dist/humain/ask-user-question/index.d.ts.map +1 -0
  420. package/dist/humain/ask-user-question/index.js +18 -0
  421. package/dist/humain/ask-user-question/index.js.map +1 -0
  422. package/dist/humain/ask-user-question/vendor/ask/answer-channel.d.ts +38 -0
  423. package/dist/humain/ask-user-question/vendor/ask/answer-channel.d.ts.map +1 -0
  424. package/dist/humain/ask-user-question/vendor/ask/answer-channel.js +97 -0
  425. package/dist/humain/ask-user-question/vendor/ask/answer-channel.js.map +1 -0
  426. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.d.ts +41 -0
  427. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.d.ts.map +1 -0
  428. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.js +441 -0
  429. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.js.map +1 -0
  430. package/dist/humain/ask-user-question/vendor/ask/config.d.ts +39 -0
  431. package/dist/humain/ask-user-question/vendor/ask/config.d.ts.map +1 -0
  432. package/dist/humain/ask-user-question/vendor/ask/config.js +95 -0
  433. package/dist/humain/ask-user-question/vendor/ask/config.js.map +1 -0
  434. package/dist/humain/ask-user-question/vendor/ask/events.d.ts +132 -0
  435. package/dist/humain/ask-user-question/vendor/ask/events.d.ts.map +1 -0
  436. package/dist/humain/ask-user-question/vendor/ask/events.js +50 -0
  437. package/dist/humain/ask-user-question/vendor/ask/events.js.map +1 -0
  438. package/dist/humain/ask-user-question/vendor/ask/index.d.ts +5 -0
  439. package/dist/humain/ask-user-question/vendor/ask/index.d.ts.map +1 -0
  440. package/dist/humain/ask-user-question/vendor/ask/index.js +15 -0
  441. package/dist/humain/ask-user-question/vendor/ask/index.js.map +1 -0
  442. package/dist/humain/ask-user-question/vendor/ask/presentation.d.ts +81 -0
  443. package/dist/humain/ask-user-question/vendor/ask/presentation.d.ts.map +1 -0
  444. package/dist/humain/ask-user-question/vendor/ask/presentation.js +105 -0
  445. package/dist/humain/ask-user-question/vendor/ask/presentation.js.map +1 -0
  446. package/dist/humain/ask-user-question/vendor/ask/reconcile.d.ts +28 -0
  447. package/dist/humain/ask-user-question/vendor/ask/reconcile.d.ts.map +1 -0
  448. package/dist/humain/ask-user-question/vendor/ask/reconcile.js +45 -0
  449. package/dist/humain/ask-user-question/vendor/ask/reconcile.js.map +1 -0
  450. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.d.ts +41 -0
  451. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.d.ts.map +1 -0
  452. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.js +166 -0
  453. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.js.map +1 -0
  454. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.d.ts +46 -0
  455. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.d.ts.map +1 -0
  456. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.js +247 -0
  457. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.js.map +1 -0
  458. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.d.ts +11 -0
  459. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.d.ts.map +1 -0
  460. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.js +56 -0
  461. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.js.map +1 -0
  462. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.d.ts +6 -0
  463. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.d.ts.map +1 -0
  464. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.js +10 -0
  465. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.js.map +1 -0
  466. package/dist/humain/ask-user-question/vendor/ask/state/key-router.d.ts +57 -0
  467. package/dist/humain/ask-user-question/vendor/ask/state/key-router.d.ts.map +1 -0
  468. package/dist/humain/ask-user-question/vendor/ask/state/key-router.js +357 -0
  469. package/dist/humain/ask-user-question/vendor/ask/state/key-router.js.map +1 -0
  470. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.d.ts +112 -0
  471. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.d.ts.map +1 -0
  472. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.js +240 -0
  473. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.js.map +1 -0
  474. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.d.ts +87 -0
  475. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.d.ts.map +1 -0
  476. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.js +79 -0
  477. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.js.map +1 -0
  478. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.d.ts +22 -0
  479. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.d.ts.map +1 -0
  480. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.js +2 -0
  481. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.js.map +1 -0
  482. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.d.ts +27 -0
  483. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.d.ts.map +1 -0
  484. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.js +48 -0
  485. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.js.map +1 -0
  486. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.d.ts +13 -0
  487. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.d.ts.map +1 -0
  488. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.js +15 -0
  489. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.js.map +1 -0
  490. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.d.ts +14 -0
  491. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.d.ts.map +1 -0
  492. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.js +96 -0
  493. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.js.map +1 -0
  494. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.d.ts +58 -0
  495. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.d.ts.map +1 -0
  496. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.js +310 -0
  497. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.js.map +1 -0
  498. package/dist/humain/ask-user-question/vendor/ask/state/state.d.ts +68 -0
  499. package/dist/humain/ask-user-question/vendor/ask/state/state.d.ts.map +1 -0
  500. package/dist/humain/ask-user-question/vendor/ask/state/state.js +2 -0
  501. package/dist/humain/ask-user-question/vendor/ask/state/state.js.map +1 -0
  502. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.d.ts +24 -0
  503. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.d.ts.map +1 -0
  504. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.js +114 -0
  505. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.js.map +1 -0
  506. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.d.ts +18 -0
  507. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.d.ts.map +1 -0
  508. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.js +29 -0
  509. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.js.map +1 -0
  510. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.d.ts +41 -0
  511. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.d.ts.map +1 -0
  512. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.js +99 -0
  513. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.js.map +1 -0
  514. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.d.ts +37 -0
  515. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.d.ts.map +1 -0
  516. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.js +70 -0
  517. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.js.map +1 -0
  518. package/dist/humain/ask-user-question/vendor/ask/tool/types.d.ts +129 -0
  519. package/dist/humain/ask-user-question/vendor/ask/tool/types.d.ts.map +1 -0
  520. package/dist/humain/ask-user-question/vendor/ask/tool/types.js +76 -0
  521. package/dist/humain/ask-user-question/vendor/ask/tool/types.js.map +1 -0
  522. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.d.ts +21 -0
  523. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.d.ts.map +1 -0
  524. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.js +49 -0
  525. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.js.map +1 -0
  526. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.d.ts +23 -0
  527. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.d.ts.map +1 -0
  528. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.js +16 -0
  529. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.js.map +1 -0
  530. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.d.ts +21 -0
  531. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.d.ts.map +1 -0
  532. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.js +49 -0
  533. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.js.map +1 -0
  534. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.d.ts +43 -0
  535. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.d.ts.map +1 -0
  536. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.js +130 -0
  537. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.js.map +1 -0
  538. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.d.ts +45 -0
  539. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.d.ts.map +1 -0
  540. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.js +39 -0
  541. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.js.map +1 -0
  542. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.d.ts +36 -0
  543. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.d.ts.map +1 -0
  544. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.js +72 -0
  545. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.js.map +1 -0
  546. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.d.ts +61 -0
  547. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.d.ts.map +1 -0
  548. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.js +108 -0
  549. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.js.map +1 -0
  550. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.d.ts +39 -0
  551. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.d.ts.map +1 -0
  552. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.js +76 -0
  553. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.js.map +1 -0
  554. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.d.ts +123 -0
  555. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.d.ts.map +1 -0
  556. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.js +180 -0
  557. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.js.map +1 -0
  558. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.d.ts +108 -0
  559. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.d.ts.map +1 -0
  560. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.js +235 -0
  561. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.js.map +1 -0
  562. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.d.ts +37 -0
  563. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.d.ts.map +1 -0
  564. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.js +47 -0
  565. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.js.map +1 -0
  566. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.d.ts +31 -0
  567. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.d.ts.map +1 -0
  568. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.js +35 -0
  569. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.js.map +1 -0
  570. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.d.ts +124 -0
  571. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.d.ts.map +1 -0
  572. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.js +205 -0
  573. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.js.map +1 -0
  574. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.d.ts +83 -0
  575. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.d.ts.map +1 -0
  576. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.js +186 -0
  577. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.js.map +1 -0
  578. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.d.ts +47 -0
  579. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.d.ts.map +1 -0
  580. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.js +48 -0
  581. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.js.map +1 -0
  582. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.d.ts +58 -0
  583. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.d.ts.map +1 -0
  584. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.js +84 -0
  585. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.js.map +1 -0
  586. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.d.ts +20 -0
  587. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.d.ts.map +1 -0
  588. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.js +55 -0
  589. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.js.map +1 -0
  590. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.d.ts +23 -0
  591. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.d.ts.map +1 -0
  592. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.js +2 -0
  593. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.js.map +1 -0
  594. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.d.ts +15 -0
  595. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.d.ts.map +1 -0
  596. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.js +2 -0
  597. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.js.map +1 -0
  598. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.d.ts +98 -0
  599. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.d.ts.map +1 -0
  600. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.js +248 -0
  601. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.js.map +1 -0
  602. package/dist/humain/ask-user-question/vendor/ask/view/transcript.d.ts +23 -0
  603. package/dist/humain/ask-user-question/vendor/ask/view/transcript.d.ts.map +1 -0
  604. package/dist/humain/ask-user-question/vendor/ask/view/transcript.js +131 -0
  605. package/dist/humain/ask-user-question/vendor/ask/view/transcript.js.map +1 -0
  606. package/dist/humain/ask-user-question/vendor/config/config.d.ts +132 -0
  607. package/dist/humain/ask-user-question/vendor/config/config.d.ts.map +1 -0
  608. package/dist/humain/ask-user-question/vendor/config/config.js +286 -0
  609. package/dist/humain/ask-user-question/vendor/config/config.js.map +1 -0
  610. package/dist/humain/ask-user-question/vendor/config/index.d.ts +2 -0
  611. package/dist/humain/ask-user-question/vendor/config/index.d.ts.map +1 -0
  612. package/dist/humain/ask-user-question/vendor/config/index.js +2 -0
  613. package/dist/humain/ask-user-question/vendor/config/index.js.map +1 -0
  614. package/dist/humain/ask-user-question/vendor/i18n/i18n.d.ts +64 -0
  615. package/dist/humain/ask-user-question/vendor/i18n/i18n.d.ts.map +1 -0
  616. package/dist/humain/ask-user-question/vendor/i18n/i18n.js +185 -0
  617. package/dist/humain/ask-user-question/vendor/i18n/i18n.js.map +1 -0
  618. package/dist/humain/ask-user-question/vendor/i18n/loader.d.ts +44 -0
  619. package/dist/humain/ask-user-question/vendor/i18n/loader.d.ts.map +1 -0
  620. package/dist/humain/ask-user-question/vendor/i18n/loader.js +55 -0
  621. package/dist/humain/ask-user-question/vendor/i18n/loader.js.map +1 -0
  622. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +26 -16
  623. package/dist/humain/brand-logo.d.ts +2 -0
  624. package/dist/humain/brand-logo.d.ts.map +1 -1
  625. package/dist/humain/brand-logo.js +4 -0
  626. package/dist/humain/brand-logo.js.map +1 -1
  627. package/dist/humain/bundled-extension-names.d.ts +1 -0
  628. package/dist/humain/bundled-extension-names.d.ts.map +1 -1
  629. package/dist/humain/bundled-extension-names.js +1 -0
  630. package/dist/humain/bundled-extension-names.js.map +1 -1
  631. package/dist/humain/checklist/footer-progress.d.ts +7 -0
  632. package/dist/humain/checklist/footer-progress.d.ts.map +1 -0
  633. package/dist/humain/checklist/footer-progress.js +15 -0
  634. package/dist/humain/checklist/footer-progress.js.map +1 -0
  635. package/dist/humain/checklist/glyphs.d.ts +7 -0
  636. package/dist/humain/checklist/glyphs.d.ts.map +1 -0
  637. package/dist/humain/checklist/glyphs.js +8 -0
  638. package/dist/humain/checklist/glyphs.js.map +1 -0
  639. package/dist/humain/checklist/index.d.ts +6 -0
  640. package/dist/humain/checklist/index.d.ts.map +1 -0
  641. package/dist/humain/checklist/index.js +37 -0
  642. package/dist/humain/checklist/index.js.map +1 -0
  643. package/dist/humain/checklist/progress.d.ts +37 -0
  644. package/dist/humain/checklist/progress.d.ts.map +1 -0
  645. package/dist/humain/checklist/progress.js +234 -0
  646. package/dist/humain/checklist/progress.js.map +1 -0
  647. package/dist/humain/checklist/projector.d.ts +53 -0
  648. package/dist/humain/checklist/projector.d.ts.map +1 -0
  649. package/dist/humain/checklist/projector.js +198 -0
  650. package/dist/humain/checklist/projector.js.map +1 -0
  651. package/dist/humain/checklist/sidebar.d.ts +18 -0
  652. package/dist/humain/checklist/sidebar.d.ts.map +1 -0
  653. package/dist/humain/checklist/sidebar.js +38 -0
  654. package/dist/humain/checklist/sidebar.js.map +1 -0
  655. package/dist/humain/checklist/status-segment.d.ts +19 -0
  656. package/dist/humain/checklist/status-segment.d.ts.map +1 -0
  657. package/dist/humain/checklist/status-segment.js +59 -0
  658. package/dist/humain/checklist/status-segment.js.map +1 -0
  659. package/dist/humain/checklist/vendor/add-task-dialog.d.ts +54 -0
  660. package/dist/humain/checklist/vendor/add-task-dialog.d.ts.map +1 -0
  661. package/dist/humain/checklist/vendor/add-task-dialog.js +238 -0
  662. package/dist/humain/checklist/vendor/add-task-dialog.js.map +1 -0
  663. package/dist/humain/checklist/vendor/commands.d.ts +38 -0
  664. package/dist/humain/checklist/vendor/commands.d.ts.map +1 -0
  665. package/dist/humain/checklist/vendor/commands.js +193 -0
  666. package/dist/humain/checklist/vendor/commands.js.map +1 -0
  667. package/dist/humain/checklist/vendor/index.d.ts +3 -0
  668. package/dist/humain/checklist/vendor/index.d.ts.map +1 -0
  669. package/dist/humain/checklist/vendor/index.js +276 -0
  670. package/dist/humain/checklist/vendor/index.js.map +1 -0
  671. package/dist/humain/checklist/vendor/render.d.ts +97 -0
  672. package/dist/humain/checklist/vendor/render.d.ts.map +1 -0
  673. package/dist/humain/checklist/vendor/render.js +354 -0
  674. package/dist/humain/checklist/vendor/render.js.map +1 -0
  675. package/dist/humain/checklist/vendor/settings.d.ts +11 -0
  676. package/dist/humain/checklist/vendor/settings.d.ts.map +1 -0
  677. package/dist/humain/checklist/vendor/settings.js +8 -0
  678. package/dist/humain/checklist/vendor/settings.js.map +1 -0
  679. package/dist/humain/checklist/vendor/store.d.ts +120 -0
  680. package/dist/humain/checklist/vendor/store.d.ts.map +1 -0
  681. package/dist/humain/checklist/vendor/store.js +990 -0
  682. package/dist/humain/checklist/vendor/store.js.map +1 -0
  683. package/dist/humain/checklist/vendor/tools.d.ts +21 -0
  684. package/dist/humain/checklist/vendor/tools.d.ts.map +1 -0
  685. package/dist/humain/checklist/vendor/tools.js +162 -0
  686. package/dist/humain/checklist/vendor/tools.js.map +1 -0
  687. package/dist/humain/checklist/vendor/types.d.ts +188 -0
  688. package/dist/humain/checklist/vendor/types.d.ts.map +1 -0
  689. package/dist/humain/checklist/vendor/types.js +32 -0
  690. package/dist/humain/checklist/vendor/types.js.map +1 -0
  691. package/dist/humain/gateway/catalog.d.ts +1 -0
  692. package/dist/humain/gateway/catalog.d.ts.map +1 -1
  693. package/dist/humain/gateway/catalog.js +1 -0
  694. package/dist/humain/gateway/catalog.js.map +1 -1
  695. package/dist/humain/gateway/client.d.ts +1 -0
  696. package/dist/humain/gateway/client.d.ts.map +1 -1
  697. package/dist/humain/gateway/client.js +8 -1
  698. package/dist/humain/gateway/client.js.map +1 -1
  699. package/dist/humain/gateway/http.d.ts.map +1 -1
  700. package/dist/humain/gateway/http.js +11 -3
  701. package/dist/humain/gateway/http.js.map +1 -1
  702. package/dist/humain/gateway/images.d.ts +3 -0
  703. package/dist/humain/gateway/images.d.ts.map +1 -0
  704. package/dist/humain/gateway/images.js +73 -0
  705. package/dist/humain/gateway/images.js.map +1 -0
  706. package/dist/humain/gateway/provider.js +1 -1
  707. package/dist/humain/gateway/provider.js.map +1 -1
  708. package/dist/humain/hcode/account-store.d.ts.map +1 -1
  709. package/dist/humain/hcode/account-store.js +3 -1
  710. package/dist/humain/hcode/account-store.js.map +1 -1
  711. package/dist/humain/hcode/account.d.ts.map +1 -1
  712. package/dist/humain/hcode/account.js +23 -13
  713. package/dist/humain/hcode/account.js.map +1 -1
  714. package/dist/humain/hcode/images.d.ts.map +1 -1
  715. package/dist/humain/hcode/images.js +19 -13
  716. package/dist/humain/hcode/images.js.map +1 -1
  717. package/dist/humain/hcode/login-failure.d.ts +1 -0
  718. package/dist/humain/hcode/login-failure.d.ts.map +1 -1
  719. package/dist/humain/hcode/login-failure.js +1 -0
  720. package/dist/humain/hcode/login-failure.js.map +1 -1
  721. package/dist/humain/hcode/provider.d.ts.map +1 -1
  722. package/dist/humain/hcode/provider.js +2 -1
  723. package/dist/humain/hcode/provider.js.map +1 -1
  724. package/dist/humain/hcode/run-credential.d.ts +1 -0
  725. package/dist/humain/hcode/run-credential.d.ts.map +1 -1
  726. package/dist/humain/hcode/run-credential.js +12 -4
  727. package/dist/humain/hcode/run-credential.js.map +1 -1
  728. package/dist/humain/index.d.ts.map +1 -1
  729. package/dist/humain/index.js +4 -0
  730. package/dist/humain/index.js.map +1 -1
  731. package/dist/humain/node-provider.d.ts.map +1 -1
  732. package/dist/humain/node-provider.js +37 -8
  733. package/dist/humain/node-provider.js.map +1 -1
  734. package/dist/main.d.ts +1 -1
  735. package/dist/main.d.ts.map +1 -1
  736. package/dist/main.js +38 -26
  737. package/dist/main.js.map +1 -1
  738. package/dist/modes/interactive/chat-viewport.js +1 -1
  739. package/dist/modes/interactive/chat-viewport.js.map +1 -1
  740. package/dist/modes/interactive/components/bash-execution.d.ts +2 -1
  741. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  742. package/dist/modes/interactive/components/bash-execution.js +7 -4
  743. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  744. package/dist/modes/interactive/components/config-selector.js +1 -1
  745. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  746. package/dist/modes/interactive/components/custom-editor.d.ts +2 -0
  747. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  748. package/dist/modes/interactive/components/custom-editor.js +20 -1
  749. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  750. package/dist/modes/interactive/components/extension-editor.d.ts +1 -1
  751. package/dist/modes/interactive/components/extension-editor.js +2 -2
  752. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  753. package/dist/modes/interactive/components/footer.d.ts +7 -0
  754. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  755. package/dist/modes/interactive/components/footer.js +74 -1
  756. package/dist/modes/interactive/components/footer.js.map +1 -1
  757. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  758. package/dist/modes/interactive/components/mermaid.js +11 -4
  759. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  760. package/dist/modes/interactive/components/model-selector.d.ts +2 -0
  761. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  762. package/dist/modes/interactive/components/model-selector.js +56 -8
  763. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  764. package/dist/modes/interactive/components/oauth-selector.d.ts +13 -1
  765. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  766. package/dist/modes/interactive/components/oauth-selector.js +10 -9
  767. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  768. package/dist/modes/interactive/components/session-selector.js +3 -3
  769. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  770. package/dist/modes/interactive/components/settings-selector.d.ts +4 -3
  771. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  772. package/dist/modes/interactive/components/settings-selector.js +83 -37
  773. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  774. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  775. package/dist/modes/interactive/components/settings-submenu.js +3 -3
  776. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  777. package/dist/modes/interactive/components/status-indicator.d.ts +18 -7
  778. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  779. package/dist/modes/interactive/components/status-indicator.js +70 -24
  780. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  781. package/dist/modes/interactive/components/status-line.d.ts +16 -0
  782. package/dist/modes/interactive/components/status-line.d.ts.map +1 -0
  783. package/dist/modes/interactive/components/status-line.js +51 -0
  784. package/dist/modes/interactive/components/status-line.js.map +1 -0
  785. package/dist/modes/interactive/components/tool-execution.d.ts +5 -0
  786. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  787. package/dist/modes/interactive/components/tool-execution.js +8 -1
  788. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  789. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  790. package/dist/modes/interactive/components/visual-truncate.js +11 -3
  791. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  792. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  793. package/dist/modes/interactive/external-editor.js +13 -3
  794. package/dist/modes/interactive/external-editor.js.map +1 -1
  795. package/dist/modes/interactive/interactive-mode.d.ts +17 -1
  796. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  797. package/dist/modes/interactive/interactive-mode.js +232 -108
  798. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  799. package/dist/modes/interactive/program-status-reporter.d.ts +2 -0
  800. package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
  801. package/dist/modes/interactive/program-status-reporter.js +4 -0
  802. package/dist/modes/interactive/program-status-reporter.js.map +1 -1
  803. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  804. package/dist/modes/interactive/session-share.js +9 -1
  805. package/dist/modes/interactive/session-share.js.map +1 -1
  806. package/dist/modes/print-mode.d.ts.map +1 -1
  807. package/dist/modes/print-mode.js +34 -7
  808. package/dist/modes/print-mode.js.map +1 -1
  809. package/dist/modes/rpc/jsonl.js +6 -5
  810. package/dist/modes/rpc/jsonl.js.map +1 -1
  811. package/dist/modes/rpc/rpc-client.d.ts +2 -0
  812. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  813. package/dist/modes/rpc/rpc-client.js +9 -2
  814. package/dist/modes/rpc/rpc-client.js.map +1 -1
  815. package/dist/modes/rpc/rpc-mode.d.ts +2 -1
  816. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  817. package/dist/modes/rpc/rpc-mode.js +113 -13
  818. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  819. package/dist/modes/rpc/rpc-types.d.ts +22 -1
  820. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  821. package/dist/modes/rpc/rpc-types.js.map +1 -1
  822. package/dist/modes/uncaught-errors.d.ts +20 -0
  823. package/dist/modes/uncaught-errors.d.ts.map +1 -0
  824. package/dist/modes/uncaught-errors.js +56 -0
  825. package/dist/modes/uncaught-errors.js.map +1 -0
  826. package/dist/package-manager-cli.d.ts.map +1 -1
  827. package/dist/package-manager-cli.js +10 -1
  828. package/dist/package-manager-cli.js.map +1 -1
  829. package/dist/utils/clipboard-image.js +1 -1
  830. package/dist/utils/clipboard-image.js.map +1 -1
  831. package/dist/utils/clipboard.js +2 -2
  832. package/dist/utils/clipboard.js.map +1 -1
  833. package/dist/utils/image-process.d.ts +5 -0
  834. package/dist/utils/image-process.d.ts.map +1 -1
  835. package/dist/utils/image-process.js +22 -4
  836. package/dist/utils/image-process.js.map +1 -1
  837. package/dist/utils/output-files.d.ts +44 -7
  838. package/dist/utils/output-files.d.ts.map +1 -1
  839. package/dist/utils/output-files.js +206 -12
  840. package/dist/utils/output-files.js.map +1 -1
  841. package/dist/utils/piped-stdin.d.ts +21 -0
  842. package/dist/utils/piped-stdin.d.ts.map +1 -0
  843. package/dist/utils/piped-stdin.js +60 -0
  844. package/dist/utils/piped-stdin.js.map +1 -0
  845. package/dist/utils/shell.d.ts +5 -2
  846. package/dist/utils/shell.d.ts.map +1 -1
  847. package/dist/utils/shell.js +77 -8
  848. package/dist/utils/shell.js.map +1 -1
  849. package/dist/utils/syntax-highlight.d.ts +33 -2
  850. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  851. package/dist/utils/syntax-highlight.js +77 -10
  852. package/dist/utils/syntax-highlight.js.map +1 -1
  853. package/dist/utils/tools-manager.d.ts +1 -0
  854. package/dist/utils/tools-manager.d.ts.map +1 -1
  855. package/dist/utils/tools-manager.js +9 -8
  856. package/dist/utils/tools-manager.js.map +1 -1
  857. package/dist/utils/wsl.d.ts +8 -2
  858. package/dist/utils/wsl.d.ts.map +1 -1
  859. package/dist/utils/wsl.js +12 -3
  860. package/dist/utils/wsl.js.map +1 -1
  861. package/docs/cli.md +45 -3
  862. package/docs/codemode.md +7 -3
  863. package/docs/compaction.md +1 -1
  864. package/docs/coordination.md +16 -4
  865. package/docs/development.md +6 -0
  866. package/docs/environment-variables.md +5 -3
  867. package/docs/extensions.md +19 -5
  868. package/docs/keybindings.md +2 -0
  869. package/docs/llama-cpp.md +2 -2
  870. package/docs/message-types.md +1 -0
  871. package/docs/models-configuration.md +14 -3
  872. package/docs/models.md +29 -7
  873. package/docs/providers.md +25 -3
  874. package/docs/rpc-commands.md +25 -2
  875. package/docs/rpc.md +20 -0
  876. package/docs/run-preflight.md +2 -2
  877. package/docs/session-format.md +9 -0
  878. package/docs/settings.md +35 -5
  879. package/docs/shell-aliases.md +1 -1
  880. package/docs/slash-commands.md +3 -1
  881. package/docs/terminal-setup.md +25 -0
  882. package/docs/windows.md +2 -1
  883. package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
  884. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  885. package/examples/rpc-extension-ui.ts +8 -7
  886. package/npm-shrinkwrap.json +209 -180
  887. package/package.json +26 -20
  888. package/schemas/keybindings.schema.json +12 -0
  889. package/schemas/models.schema.json +20 -7
  890. package/schemas/settings.schema.json +43 -5
  891. package/src/coordination/UPSTREAM.md +27 -1
  892. package/src/coordination/upstream.json +3 -3
  893. package/src/humain/ask-user-question/UPSTREAM.md +31 -0
  894. package/src/humain/ask-user-question/upstream.json +258 -0
  895. package/src/humain/ask-user-question/vendor/ask/LICENSE +21 -0
  896. package/src/humain/ask-user-question/vendor/ask/locales/de.json +38 -0
  897. package/src/humain/ask-user-question/vendor/ask/locales/en.json +41 -0
  898. package/src/humain/ask-user-question/vendor/ask/locales/es.json +38 -0
  899. package/src/humain/ask-user-question/vendor/ask/locales/fr.json +38 -0
  900. package/src/humain/ask-user-question/vendor/ask/locales/pt-BR.json +38 -0
  901. package/src/humain/ask-user-question/vendor/ask/locales/pt.json +38 -0
  902. package/src/humain/ask-user-question/vendor/ask/locales/ru.json +38 -0
  903. package/src/humain/ask-user-question/vendor/ask/locales/uk.json +38 -0
  904. package/src/humain/ask-user-question/vendor/ask/locales/zh.json +40 -0
  905. package/src/humain/ask-user-question/vendor/config/LICENSE +21 -0
  906. package/src/humain/ask-user-question/vendor/i18n/LICENSE +21 -0
  907. package/src/humain/caveman/UPSTREAM.md +44 -11
  908. package/src/humain/caveman/upstream.json +3 -3
  909. package/src/humain/caveman/vendor/NOTICE +4 -0
  910. package/dist/bundle/chunks/anthropic-messages-XFCDMGD6.js +0 -77
  911. package/dist/bundle/chunks/azure-openai-responses-F4KQM3NK.js +0 -15
  912. package/dist/bundle/chunks/bowser-DXKSTXFQ.js +0 -89
  913. package/dist/bundle/chunks/chunk-3E37CJCE.js +0 -34
  914. package/dist/bundle/chunks/chunk-3HVHETMU.js +0 -18
  915. package/dist/bundle/chunks/chunk-3PJ7NPWN.js +0 -80
  916. package/dist/bundle/chunks/chunk-6JTCRCNF.js +0 -74
  917. package/dist/bundle/chunks/chunk-F77J5EQZ.js +0 -3
  918. package/dist/bundle/chunks/chunk-GPLWWO5Q.js +0 -121
  919. package/dist/bundle/chunks/chunk-GV5OVRKK.js +0 -4
  920. package/dist/bundle/chunks/chunk-JBSWWCT5.js +0 -12
  921. package/dist/bundle/chunks/chunk-JQBZUFH7.js +0 -3580
  922. package/dist/bundle/chunks/chunk-JWOPWHVH.js +0 -51
  923. package/dist/bundle/chunks/chunk-KRBELWQH.js +0 -7
  924. package/dist/bundle/chunks/chunk-PFBAIRCY.js +0 -56
  925. package/dist/bundle/chunks/chunk-Q5RKNQ2T.js +0 -73
  926. package/dist/bundle/chunks/chunk-QFDZEUFU.js +0 -12
  927. package/dist/bundle/chunks/chunk-SKCJ25SX.js +0 -24
  928. package/dist/bundle/chunks/chunk-UEW6TUSP.js +0 -36
  929. package/dist/bundle/chunks/chunk-UZOIHLNU.js +0 -23
  930. package/dist/bundle/chunks/chunk-YSWDFV2L.js +0 -11
  931. package/dist/bundle/chunks/chunk-YZMQXAJM.js +0 -8
  932. package/dist/bundle/chunks/entry-2GZ3PTWQ.js +0 -2
  933. package/dist/bundle/chunks/google-generative-ai-WIASMWS3.js +0 -22
  934. package/dist/bundle/chunks/google-vertex-WSPHRZIZ.js +0 -25
  935. package/dist/bundle/chunks/interactive-mode-SDUO5OLD.js +0 -5
  936. package/dist/bundle/chunks/mistral-conversations-7JYDDRUT.js +0 -43
  937. package/dist/bundle/chunks/openai-codex-responses-7PAML4NF.js +0 -102
  938. package/dist/bundle/chunks/openai-completions-UJDAIGTK.js +0 -87
  939. package/dist/bundle/chunks/openai-responses-2WNCE6AY.js +0 -26
  940. package/dist/bundle/chunks/openrouter-images-V3UCCO6X.js +0 -8
  941. package/dist/bundle/chunks/pi-messages-TQ7LJUNQ.js +0 -28
  942. package/dist/bundle/chunks/runtime-H7LYNKCZ.js +0 -2
  943. package/dist/bundle/chunks/session-picker-EYKCMFQR.js +0 -4
  944. package/dist/bundle/chunks/startup-ui-7ODOR34R.js +0 -3
  945. package/dist/bundle/chunks/typesafe-system-one-YP7GGN4C.js +0 -3
  946. package/dist/bundle/chunks/virtual-modules-IU5KWB2C.js +0 -28
@@ -1 +1 @@
1
- {"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../src/core/tools/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAqB,KAAK,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACN,cAAc,EACd,WAAW,EACX,oBAAoB,EAEpB,qBAAqB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EACN,cAAc,EAGd,mBAAmB,EAEnB,mBAAmB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAyB,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAyB,MAAM,eAAe,CAAC;AAExG,MAAM,4BAA4B,GAAG,GAAG,CAAC;AACzC,MAAM,cAAc,GAAG,aAAa,CAAC;AACrC,+GAA+G;AAC/G,MAAM,2BAA2B,GAAG,IAAI,GAAG,IAAI,CAAC;AAChD,MAAM,mBAAmB,GAAG,cAAc,GAAG,IAAI,CAAC;AAElD,SAAS,gB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,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;YACtF,CAAC;oBAAS,CAAC;gBACV,gBAAgB,EAAE,CAAC;YACpB,CAAC;QACF,CAAC;QACD,GAAG,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC;KACtC,CAAC;IACF,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC9C,OAAO,UAAU,CAAC;AACnB,CAAC;AAED,MAAM,cAAc,GAAoB;IACvC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,MAAM;IACjB,MAAM,EAAE,GAAG;IACX,aAAa,EAAE,gCAAgC,CAAC,OAAO;IACvD,gBAAgB,EAAE,gCAAgC,CAAC,UAAU;IAC7D,cAAc,EAAE,SAAS;CACzB,CAAC;AAEF,MAAM,UAAU,wBAAwB,CACvC,GAAW,EACX,OAAyB;IAEzB,OAAO,yBAAyB,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,OAAyB;IACpE,MAAM,UAAU,GAAG,wBAAwB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1D,MAAM,IAAI,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC3C,IAAI,KAAK;QAAE,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACnD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QACnB,aAAa,EAAE,UAAU,CAAC,aAAa;QACvC,gBAAgB,EAAE,UAAU,CAAC,gBAAgB;KAC7C,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["import { constants } from \"node:fs\";\nimport { access as fsAccess } from \"node:fs/promises\";\nimport { constants as osConstants } from \"node:os\";\nimport { type ChildProcess, spawn } from \"child_process\";\nimport { type Static, Type } from \"typebox\";\nimport { waitForChildProcess } from \"../../utils/child-process.ts\";\nimport {\n\tgetShellConfig,\n\tgetShellEnv,\n\tkillProcessTreeAsync,\n\ttype ShellConfig,\n\ttrackDetachedChildPid,\n} from \"../../utils/shell.ts\";\nimport { readOnlyAcceptanceSpawn } from \"../acceptance-command.ts\";\nimport type { ExtensionContext, ToolDefinition } from \"../extensions/types.ts\";\nimport {\n\tBashJobManager,\n\ttype BashJobOutput,\n\ttype BashJobSnapshot,\n\tbashJobOutputSchema,\n\ttype JobInputResult,\n\tMAX_JOB_INPUT_BYTES,\n} from \"./bash-jobs.ts\";\nimport { OutputAccumulator } from \"./output-accumulator.ts\";\nimport { BASH_UPDATE_THROTTLE_MS, createShellRenderers } from \"./renderers/bash.ts\";\nimport { scrubTraceEnv } from \"./subagent-env.ts\";\nimport { type TypeBoxAgentTool, wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\nimport { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, type TruncationResult } from \"./truncate.ts\";\n\nconst DEFAULT_BASH_TIMEOUT_SECONDS = 120;\nconst MAX_TIMEOUT_MS = 2_147_483_647;\n/** Output limit of `structuredContent.output`, which programmatic callers such as codemode scripts receive. */\nconst STRUCTURED_OUTPUT_MAX_BYTES = 1024 * 1024;\nconst MAX_TIMEOUT_SECONDS = MAX_TIMEOUT_MS / 1000;\n\nfunction resolveTimeoutMs(timeout: number | undefined): number | undefined {\n\tif (timeout === undefined) return undefined;\n\tif (!Number.isFinite(timeout) || timeout <= 0) {\n\t\tthrow new Error(\"Invalid timeout: must be a finite number of seconds\");\n\t}\n\n\tconst timeoutMs = timeout * 1000;\n\tif (timeoutMs > MAX_TIMEOUT_MS) {\n\t\tthrow new Error(`Invalid timeout: maximum is ${MAX_TIMEOUT_SECONDS} seconds`);\n\t}\n\treturn timeoutMs;\n}\n\nconst shellSchema = Type.Object({\n\tcommand: Type.String({ description: \"Shell command to execute\" }),\n\ttimeout: Type.Optional(Type.Number({ description: \"Timeout in seconds (optional, no default timeout)\" })),\n});\n\nconst bashSchema = Type.Object({\n\t...shellSchema.properties,\n\tbackground: Type.Optional(Type.Boolean({ description: \"Start session-owned background work and return a job ID\" })),\n\ttimeout: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: `Timeout in seconds (optional, defaults to ${DEFAULT_BASH_TIMEOUT_SECONDS} seconds)`,\n\t\t}),\n\t),\n});\n\nexport const bashToolSystemPromptContribution = {\n\tsnippet: \"Execute bash commands (ls, grep, find, etc.)\",\n\tguidelines: [\"You can inspect HUMAIN_TERMINAL_* environment variables for current model and session details.\"],\n} as const;\n\nexport type BashToolInput = Static<typeof bashSchema>;\n\n/**\n * Result for programmatic callers such as codemode scripts. A non-zero exit code is an error result for the model, but scripts still resolve to this value.\n * `output` is not limited like the model-facing output: callers decide how much of it reaches the model.\n */\nconst bashOutputSchema = Type.Object({\n\toutput: Type.String({ description: \"Combined stdout and stderr, possibly truncated\" }),\n\ttruncated: Type.Boolean(),\n\tfull_output_path: Type.Optional(Type.String({ description: \"Full output, when truncated\" })),\n\texit_code: Type.Number(),\n\twall_time_seconds: Type.Number(),\n});\n\nexport type BashToolOutput = Static<typeof bashOutputSchema> | BashJobOutput;\n\nexport interface BashToolDetails {\n\ttruncation?: TruncationResult;\n\tfullOutputPath?: string;\n}\n\n/** A background process tree could not be confirmed stopped; retain its effect ownership. */\nexport class BashProcessCleanupError extends Error {}\n\n/** Run-owned custody and time allocation, installed only for explicitly admitted adaptive work. */\nexport interface BashRunContext {\n\trunId: string;\n\townerId: string;\n\tsessionId: string;\n\tgeneration: number;\n\tphase: \"implementation\" | \"verification\";\n\t/** Absolute timestamps in the injected clock's domain. */\n\tdeadline: number;\n\treserveCutoff: number;\n\t/** SHA-256 identity only; never raw environment values. */\n\tenvironmentIdentity: string;\n\tlineage: readonly string[];\n\tnow: () => number;\n\t/** Trusted owner gate; rejects revoked lanes or stale generations. */\n\tassertCurrent: () => void;\n\t/** Wake the existing owner after terminal capture/process cleanup; never dispatch a model. */\n\tonTerminal?: (record: BashJobSnapshot) => void;\n}\n\n/** Validate run admission and return its remaining absolute-deadline allocation in seconds. */\nexport function admitBashRun(context: BashRunContext): number {\n\tcontext.assertCurrent();\n\tconst now = context.now();\n\t// Host-supplied run context is an admission boundary, not model tool input.\n\tif (\n\t\t![now, context.deadline, context.reserveCutoff].every(Number.isFinite) ||\n\t\tcontext.reserveCutoff > context.deadline ||\n\t\t!Number.isSafeInteger(context.generation) ||\n\t\tcontext.generation < 0 ||\n\t\t![context.runId, context.ownerId, context.sessionId].every((id) => typeof id === \"string\" && id.length > 0) ||\n\t\t!/^[a-f0-9]{64}$/.test(context.environmentIdentity) ||\n\t\t!Array.isArray(context.lineage) ||\n\t\t!context.lineage.every((id) => typeof id === \"string\" && id.length > 0) ||\n\t\t![\"implementation\", \"verification\"].includes(context.phase)\n\t)\n\t\tthrow new Error(\"Invalid bash run context\");\n\tif (now >= context.deadline) throw new Error(\"Run deadline exceeded\");\n\tif (context.phase === \"implementation\" && now >= context.reserveCutoff)\n\t\tthrow new Error(\"Run verification reserve reached\");\n\treturn (context.deadline - now) / 1000;\n}\n\nexport interface BashStdin {\n\twrite(input: string, eof?: boolean): Promise<JobInputResult>;\n}\n\n/** Pluggable bash transport; remote implementations opt into stdin only when actually supported. */\nexport interface BashOperations {\n\t/** Only explicitly capable transports may receive an input registration callback. */\n\tsupportsStdin?: boolean;\n\t/**\n\t * Execute a command and stream output.\n\t * @param command The command to execute\n\t * @param cwd Working directory\n\t * @param options Execution options\n\t * @returns Promise resolving to the exit code. Report signal terminations as 128 + signal number;\n\t * a null exit code is treated as a failed command.\n\t */\n\texec: (\n\t\tcommand: string,\n\t\tcwd: string,\n\t\toptions: {\n\t\t\t/** Await a returned promise before delivering more stdout or stderr. */\n\t\t\tonData: ((data: Buffer) => void) | ((data: Buffer) => Promise<void>);\n\t\t\tsignal?: AbortSignal;\n\t\t\ttimeout?: number;\n\t\t\tenv?: NodeJS.ProcessEnv;\n\t\t\t/** Background jobs terminate lingering children before releasing process custody. */\n\t\t\tterminateChildrenOnExit?: boolean;\n\t\t\t/** Absolute deadline and clock from the admitted run; absent for legacy execution. */\n\t\t\tdeadline?: number;\n\t\t\tnow?: () => number;\n\t\t\t/** Recheck run custody/admission immediately before actual process creation. */\n\t\t\tbeforeSpawn?: () => void;\n\t\t\tonStdin?: (stdin: BashStdin | undefined) => void;\n\t\t\t/** Observe the original local process object; persisted PIDs never grant custody. */\n\t\t\tonProcessStarted?: (child: ChildProcess) => void;\n\t\t},\n\t) => Promise<{ exitCode: number | null }>;\n}\n\n/** Signal that a transport could not prove owned-process termination. */\nexport class BashCleanupError extends BashProcessCleanupError {\n\tconstructor() {\n\t\tsuper(\"Owned process cleanup unconfirmed\");\n\t\tthis.name = \"BashCleanupError\";\n\t}\n}\n\n/**\n * Timeout of the local shell backend. Its message keeps the `timeout:<seconds>` form custom operations throw.\n * `shellExit` is set when the shell itself exited before the deadline, so the tool was only still waiting\n * because background processes kept writing to the inherited stdout/stderr pipes (#11613).\n */\nclass ShellTimeoutError extends Error {\n\treadonly shellExit: { exitCode: number; afterSeconds: number } | undefined;\n\n\tconstructor(timeout: number | undefined, shellExit: { exitCode: number; afterSeconds: number } | undefined) {\n\t\tsuper(`timeout:${timeout}`);\n\t\tthis.shellExit = shellExit;\n\t}\n}\n\n/** Whether the executor can rule out effects escaping the shell's process group. */\nexport type ShellProcessCustody = \"bounded\" | \"uncertain\";\n\n// This is a launch-free grammar, not a read-only command allowlist: redirects still mutate files.\n// No expansions, operators, function imports, startup scripts or injected loaders may execute code.\nconst literalShellWord = String.raw`(?:[a-zA-Z0-9_./:=,%@+\\-]+|'[^']*'|\"[^\"$\\x60\\\\]*\")`;\n// Only string printing: printf options can assign/evaluate array subscripts, and %n assigns too.\n// Reject every option spelling and every other conversion rather than interpreting Bash's formats.\nconst literalPrintfFormat = String.raw`(?!['\"]?-)(?:(?:[a-zA-Z0-9_./:=,@+\\-]|%[s%])+|'(?:[^'%]|%[s%])*'|\"(?:[^\"%$\\x60\\\\]|%[s%])*\")`;\nconst launchFreeBuiltin = new RegExp(\n\tString.raw`^[ \\t]*(?:builtin[ \\t]+)?(?:printf[ \\t]+${literalPrintfFormat}|echo|true|false|:)(?:[ \\t]+${literalShellWord})*(?:[ \\t]*>>?[ \\t]*${literalShellWord})?[ \\t]*$`,\n);\n\n/** Shared process execution used by the built-in shell tools. */\nexport function createLocalShellOperations(\n\tshellName: string,\n\tresolveShellConfig: () => ShellConfig,\n\tonProcessStarted?: (child: ChildProcess, custody: ShellProcessCustody) => void,\n): BashOperations {\n\tconst operations: BashOperations = {\n\t\tsupportsStdin: true,\n\t\texec: async (\n\t\t\tcommand,\n\t\t\tcwd,\n\t\t\t{\n\t\t\t\tonData,\n\t\t\t\tsignal,\n\t\t\t\ttimeout,\n\t\t\t\tenv,\n\t\t\t\tterminateChildrenOnExit,\n\t\t\t\tdeadline,\n\t\t\t\tnow,\n\t\t\t\tbeforeSpawn,\n\t\t\t\tonStdin,\n\t\t\t\tonProcessStarted: recordProcessStarted,\n\t\t\t},\n\t\t) => {\n\t\t\tlet timeoutMs = resolveTimeoutMs(timeout);\n\t\t\t// Windows taskkill loses descendant custody once the shell exits; refuse unsafe admission.\n\t\t\tif (terminateChildrenOnExit && process.platform === \"win32\") {\n\t\t\t\tthrow new Error(\"Local background bash jobs are unavailable on Windows\");\n\t\t\t}\n\t\t\tif (signal?.aborted) {\n\t\t\t\tthrow new Error(\"aborted\");\n\t\t\t}\n\t\t\tconst originalShell = resolveShellConfig();\n\t\t\tconst environment = scrubTraceEnv(env ?? getShellEnv());\n\t\t\tconst readOnly = readOnlyAcceptanceSpawn(command, cwd, originalShell, environment);\n\t\t\tconst shellConfig = readOnly ?? originalShell;\n\t\t\ttry {\n\t\t\t\tawait fsAccess(cwd, constants.F_OK);\n\t\t\t} catch {\n\t\t\t\tthrow new Error(`Working directory does not exist: ${cwd}\\nCannot execute ${shellName} commands.`);\n\t\t\t}\n\n\t\t\tif (signal?.aborted) throw new Error(\"aborted\");\n\t\t\tif (deadline !== undefined) {\n\t\t\t\tconst remaining = deadline - (now ?? (() => performance.now()))();\n\t\t\t\tif (remaining <= 0) throw new Error(\"Run deadline exceeded\");\n\t\t\t\ttimeoutMs = Math.min(timeoutMs ?? MAX_TIMEOUT_MS, remaining, MAX_TIMEOUT_MS);\n\t\t\t}\n\t\t\tbeforeSpawn?.();\n\t\t\tconst commandFromStdin = shellConfig.commandTransport === \"stdin\";\n\t\t\tconst child = spawn(shellConfig.shell, commandFromStdin ? shellConfig.args : [...shellConfig.args, command], {\n\t\t\t\tcwd,\n\t\t\t\tdetached: process.platform !== \"win32\",\n\t\t\t\tenv: environment,\n\t\t\t\tstdio: [\n\t\t\t\t\tcommandFromStdin || onStdin ? \"pipe\" : \"ignore\",\n\t\t\t\t\t\"pipe\",\n\t\t\t\t\t\"pipe\",\n\t\t\t\t\t...(readOnly ? [\"pipe\" as const] : []),\n\t\t\t\t],\n\t\t\t\twindowsHide: true,\n\t\t\t});\n\t\t\tconst filterInput = readOnly ? child.stdio[3] : undefined;\n\t\t\tif (readOnly && filterInput && \"end\" in filterInput) {\n\t\t\t\tfilterInput.on(\"error\", () => {});\n\t\t\t\tfilterInput.end(readOnly.filter);\n\t\t\t}\n\t\t\tif (child.pid) trackDetachedChildPid(child.pid, child);\n\t\t\tconst launchFree =\n\t\t\t\toriginalShell.shell === \"/bin/bash\" &&\n\t\t\t\toriginalShell.args.length === 1 &&\n\t\t\t\toriginalShell.args[0] === \"-c\" &&\n\t\t\t\t!Object.keys(environment).some((name) =>\n\t\t\t\t\t/^(?:BASH_ENV$|ENV$|SSH_CLIENT$|SSH2_CLIENT$|SHELLOPTS$|BASHOPTS$|PS4$|BASH_FUNC_|LD_|DYLD_|GLIBC_TUNABLES$)/.test(\n\t\t\t\t\t\tname,\n\t\t\t\t\t),\n\t\t\t\t) &&\n\t\t\t\tlaunchFreeBuiltin.test(command);\n\t\t\tonProcessStarted?.(child, readOnly || launchFree ? \"bounded\" : \"uncertain\");\n\t\t\trecordProcessStarted?.(child);\n\t\t\t// A broken pipe is a normal input/exit race, not an unhandled process error.\n\t\t\tchild.stdin?.on(\"error\", () => {});\n\t\t\tif (commandFromStdin) child.stdin?.end(command);\n\t\t\tlet writingInput = false;\n\t\t\tlet closeInput: (() => void) | undefined;\n\t\t\tonStdin?.(\n\t\t\t\tcommandFromStdin\n\t\t\t\t\t? undefined\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tasync write(input, eof = false) {\n\t\t\t\t\t\t\t\t// Direct transport callers are also an input trust boundary.\n\t\t\t\t\t\t\t\tif (typeof input !== \"string\" || typeof eof !== \"boolean\")\n\t\t\t\t\t\t\t\t\tthrow new Error(\"Invalid stdin input/eof\");\n\t\t\t\t\t\t\t\tconst bytes = Buffer.byteLength(input);\n\t\t\t\t\t\t\t\tif (bytes > MAX_JOB_INPUT_BYTES || writingInput) return { status: \"backpressure\", bytes: 0 };\n\t\t\t\t\t\t\t\tconst stdin = child.stdin;\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t!stdin ||\n\t\t\t\t\t\t\t\t\tstdin.destroyed ||\n\t\t\t\t\t\t\t\t\tstdin.writableEnded ||\n\t\t\t\t\t\t\t\t\tchild.exitCode !== null ||\n\t\t\t\t\t\t\t\t\tchild.signalCode !== null\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\treturn { status: \"closed\", bytes: 0 };\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twritingInput = true;\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\treturn await new Promise<JobInputResult>((resolve) => {\n\t\t\t\t\t\t\t\t\t\tlet settled = false;\n\t\t\t\t\t\t\t\t\t\tlet written = false;\n\t\t\t\t\t\t\t\t\t\tlet drained = true;\n\t\t\t\t\t\t\t\t\t\tlet ended = !eof;\n\t\t\t\t\t\t\t\t\t\tconst finish = (result: JobInputResult) => {\n\t\t\t\t\t\t\t\t\t\t\tif (settled) return;\n\t\t\t\t\t\t\t\t\t\t\tsettled = true;\n\t\t\t\t\t\t\t\t\t\t\tstdin.off(\"error\", closed);\n\t\t\t\t\t\t\t\t\t\t\tstdin.off(\"close\", closed);\n\t\t\t\t\t\t\t\t\t\t\tstdin.off(\"drain\", drain);\n\t\t\t\t\t\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\tconst complete = () => {\n\t\t\t\t\t\t\t\t\t\t\tif (written && drained && ended) finish({ status: \"written\", bytes });\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\tconst closed = () => finish({ status: \"closed\", bytes: 0 });\n\t\t\t\t\t\t\t\t\t\tcloseInput = closed;\n\t\t\t\t\t\t\t\t\t\tconst drain = () => {\n\t\t\t\t\t\t\t\t\t\t\tdrained = true;\n\t\t\t\t\t\t\t\t\t\t\tcomplete();\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\tstdin.once(\"error\", closed);\n\t\t\t\t\t\t\t\t\t\tstdin.once(\"close\", closed);\n\t\t\t\t\t\t\t\t\t\tconst accepted = stdin.write(input, (error) => {\n\t\t\t\t\t\t\t\t\t\t\tif (settled) return;\n\t\t\t\t\t\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\t\t\t\t\t\tclosed();\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\twritten = true;\n\t\t\t\t\t\t\t\t\t\t\tif (eof)\n\t\t\t\t\t\t\t\t\t\t\t\tstdin.end(() => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tended = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tcomplete();\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\tcomplete();\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\tdrained = accepted;\n\t\t\t\t\t\t\t\t\t\tif (!drained) stdin.once(\"drain\", drain);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\tcloseInput = undefined;\n\t\t\t\t\t\t\t\t\twritingInput = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t);\n\t\t\tconst startedAt = performance.now();\n\t\t\tlet shellExitedAfterMs: number | undefined;\n\t\t\tchild.once(\"exit\", () => {\n\t\t\t\tshellExitedAfterMs = performance.now() - startedAt;\n\t\t\t});\n\t\t\tlet timedOut = false;\n\t\t\tlet exitedBeforeDeadlineAfterMs: number | undefined;\n\t\t\tlet timeoutHandle: NodeJS.Timeout | undefined;\n\t\t\tlet drainTimer: NodeJS.Timeout | undefined;\n\t\t\tlet termination: Promise<boolean> | undefined;\n\t\t\tlet finished = false;\n\t\t\tlet quiescent = true;\n\t\t\tlet outcome: { kind: \"completed\"; exitCode: number | null } | { kind: \"error\"; error: unknown };\n\t\t\tlet outputFailure: { error: unknown } | undefined;\n\t\t\tlet pendingOutput: Promise<void> | undefined;\n\t\t\tconst drainController = new AbortController();\n\t\t\tconst drainAborted = new Promise<void>((resolve) => {\n\t\t\t\tdrainController.signal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t\t\t});\n\t\t\tconst terminateChildren = () =>\n\t\t\t\t(termination ??= child.pid ? killProcessTreeAsync(child.pid, undefined, child) : Promise.resolve(true));\n\t\t\tconst onAbort = () => {\n\t\t\t\tvoid terminateChildren().then(() => {\n\t\t\t\t\tif (!finished && !drainTimer) drainTimer = setTimeout(() => drainController.abort(), 500);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tconst failOutput = (error: unknown) => {\n\t\t\t\toutputFailure = { error };\n\t\t\t\tchild.stdout?.off(\"data\", handleData);\n\t\t\t\tchild.stderr?.off(\"data\", handleData);\n\t\t\t\tonAbort();\n\t\t\t\tchild.stdout?.resume();\n\t\t\t\tchild.stderr?.resume();\n\t\t\t};\n\t\t\tconst handleData = (data: Buffer) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst pending = onData(data);\n\t\t\t\t\tif (pending instanceof Promise) {\n\t\t\t\t\t\t// Both pipes share one sink, so neither may enqueue more until it drains.\n\t\t\t\t\t\tchild.stdout?.pause();\n\t\t\t\t\t\tchild.stderr?.pause();\n\t\t\t\t\t\tpendingOutput = pending.then(() => {\n\t\t\t\t\t\t\tchild.stdout?.resume();\n\t\t\t\t\t\t\tchild.stderr?.resume();\n\t\t\t\t\t\t}, failOutput);\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tfailOutput(error);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Background ownership ends with the shell, even if children keep pipes open.\n\t\t\tif (terminateChildrenOnExit) child.once(\"exit\", terminateChildren);\n\t\t\ttry {\n\t\t\t\t// Set timeout if provided.\n\t\t\t\tif (timeoutMs !== undefined) {\n\t\t\t\t\ttimeoutHandle = setTimeout(() => {\n\t\t\t\t\t\ttimedOut = true;\n\t\t\t\t\t\texitedBeforeDeadlineAfterMs = shellExitedAfterMs;\n\t\t\t\t\t\tonAbort();\n\t\t\t\t\t}, timeoutMs);\n\t\t\t\t}\n\t\t\t\t// Stream stdout and stderr.\n\t\t\t\tchild.stdout?.on(\"data\", handleData);\n\t\t\t\tchild.stderr?.on(\"data\", handleData);\n\t\t\t\t// Handle abort signal by killing the entire process tree.\n\t\t\t\tif (signal) {\n\t\t\t\t\tif (signal.aborted) onAbort();\n\t\t\t\t\telse signal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\t}\n\t\t\t\t// Handle shell spawn errors and wait for the process to terminate without hanging\n\t\t\t\t// on inherited stdio handles held by detached descendants.\n\t\t\t\tconst exitCode = await waitForChildProcess(child, drainController.signal);\n\t\t\t\tawait Promise.race([pendingOutput, drainAborted]);\n\t\t\t\tif (outputFailure) throw outputFailure.error;\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tthrow new Error(\"aborted\");\n\t\t\t\t}\n\t\t\t\t// A signal-killed shell has no exit code. Use the standard shell convention so\n\t\t\t\t// callers do not mistake the termination for a successful command.\n\t\t\t\tconst signalCode = child.signalCode;\n\t\t\t\tconst resolvedExitCode = exitCode ?? (signalCode ? 128 + (osConstants.signals[signalCode] ?? 0) : 1);\n\t\t\t\tif (timedOut) {\n\t\t\t\t\tthrow new ShellTimeoutError(\n\t\t\t\t\t\ttimeout,\n\t\t\t\t\t\texitedBeforeDeadlineAfterMs !== undefined\n\t\t\t\t\t\t\t? { exitCode: resolvedExitCode, afterSeconds: Math.round(exitedBeforeDeadlineAfterMs / 100) / 10 }\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (readOnly && resolvedExitCode !== 0) {\n\t\t\t\t\t// Isolation can reject ordinary test writes. Retry the authorized command without a receipt;\n\t\t\t\t\t// the ledger's original invalidation remains in force, including for earlier failed checks.\n\t\t\t\t\tawait onData(\n\t\t\t\t\t\tBuffer.from(\n\t\t\t\t\t\t\t\"\\n[Read-only verification failed; retrying with normal execution, without common-state proof]\\n\",\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\toutcome = {\n\t\t\t\t\t\tkind: \"completed\",\n\t\t\t\t\t\t...(await readOnly.retry(() =>\n\t\t\t\t\t\t\toperations.exec(command, cwd, {\n\t\t\t\t\t\t\t\tonData,\n\t\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t\t\ttimeout,\n\t\t\t\t\t\t\t\tenv,\n\t\t\t\t\t\t\t\tterminateChildrenOnExit,\n\t\t\t\t\t\t\t\tdeadline,\n\t\t\t\t\t\t\t\tnow,\n\t\t\t\t\t\t\t\tbeforeSpawn,\n\t\t\t\t\t\t\t\tonStdin,\n\t\t\t\t\t\t\t\tonProcessStarted: recordProcessStarted,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t)),\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tif (resolvedExitCode === 0) readOnly?.completed();\n\t\t\t\t\toutcome = { kind: \"completed\", exitCode: resolvedExitCode };\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\toutcome = { kind: \"error\", error };\n\t\t\t} finally {\n\t\t\t\tfinished = true;\n\t\t\t\t// Local pipe custody ends even when process termination cannot be confirmed.\n\t\t\t\tcloseInput?.();\n\t\t\t\tchild.stdin?.destroy();\n\t\t\t\tif (terminateChildrenOnExit || deadline !== undefined) {\n\t\t\t\t\tchild.off(\"exit\", terminateChildren);\n\t\t\t\t\tquiescent = await terminateChildren();\n\t\t\t\t}\n\t\t\t\tif (drainTimer) clearTimeout(drainTimer);\n\t\t\t\t// The custody monitor releases absent groups; shell return alone must not release live descendants.\n\t\t\t\tif (timeoutHandle) clearTimeout(timeoutHandle);\n\t\t\t\tif (signal) signal.removeEventListener(\"abort\", onAbort);\n\t\t\t\tchild.stdout?.off(\"data\", handleData);\n\t\t\t\tchild.stderr?.off(\"data\", handleData);\n\t\t\t}\n\t\t\tif (deadline !== undefined && !quiescent) throw new BashCleanupError();\n\t\t\tif (!quiescent) throw new BashProcessCleanupError(\"Background process cleanup could not confirm quiescence\");\n\t\t\tif (outcome.kind === \"error\") throw outcome.error;\n\t\t\treturn { exitCode: outcome.exitCode };\n\t\t},\n\t};\n\treturn operations;\n}\n\n/**\n * Create bash operations using pi's built-in local shell execution backend.\n *\n * This is useful for extensions that intercept user_bash and still want pi's\n * standard local shell behavior while wrapping or rewriting commands.\n */\nexport function createLocalBashOperations(options?: {\n\tshellPath?: string;\n\tonProcessStarted?: (child: ChildProcess, custody: ShellProcessCustody) => void;\n}): BashOperations {\n\treturn createLocalShellOperations(\"bash\", () => getShellConfig(options?.shellPath), options?.onProcessStarted);\n}\n\nexport interface BashSpawnContext {\n\tcommand: string;\n\tcwd: string;\n\tenv: NodeJS.ProcessEnv;\n}\n\nexport type BashSpawnHook = (context: BashSpawnContext) => BashSpawnContext;\n\nfunction resolveSpawnContext(\n\tcommand: string,\n\tcwd: string,\n\tspawnHook: BashSpawnHook | undefined,\n\texposeSessionEnvironment: boolean,\n\tctx: ExtensionContext | undefined,\n\tenvironment: NodeJS.ProcessEnv | undefined,\n): BashSpawnContext {\n\tconst env = scrubTraceEnv(getShellEnv(environment));\n\tfor (const name of [\n\t\t\"HUMAIN_TERMINAL_SESSION_ID\",\n\t\t\"HUMAIN_TERMINAL_SESSION_FILE\",\n\t\t\"HUMAIN_TERMINAL_PROVIDER\",\n\t\t\"HUMAIN_TERMINAL_MODEL\",\n\t\t\"HUMAIN_TERMINAL_REASONING_LEVEL\",\n\t\t\"PI_SESSION_ID\",\n\t\t\"PI_SESSION_FILE\",\n\t\t\"PI_PROVIDER\",\n\t\t\"PI_MODEL\",\n\t\t\"PI_REASONING_LEVEL\",\n\t]) {\n\t\tdelete env[name];\n\t}\n\tif (exposeSessionEnvironment && ctx) {\n\t\tconst model = ctx.model;\n\t\tconst sessionId = ctx.sessionManager.getSessionId();\n\t\tenv.HUMAIN_TERMINAL_SESSION_ID = sessionId;\n\t\tenv.PI_SESSION_ID = sessionId;\n\t\tconst sessionFile = ctx.sessionManager.getSessionFile();\n\t\tif (sessionFile) {\n\t\t\tenv.HUMAIN_TERMINAL_SESSION_FILE = sessionFile;\n\t\t\tenv.PI_SESSION_FILE = sessionFile;\n\t\t}\n\t\tif (model) {\n\t\t\tenv.HUMAIN_TERMINAL_PROVIDER = model.provider;\n\t\t\tenv.HUMAIN_TERMINAL_MODEL = model.id;\n\t\t\tenv.PI_PROVIDER = model.provider;\n\t\t\tenv.PI_MODEL = model.id;\n\t\t}\n\t\tif (ctx.thinkingLevel) {\n\t\t\tenv.HUMAIN_TERMINAL_REASONING_LEVEL = ctx.thinkingLevel;\n\t\t\tenv.PI_REASONING_LEVEL = ctx.thinkingLevel;\n\t\t}\n\t}\n\tconst baseContext: BashSpawnContext = { command, cwd, env };\n\treturn spawnHook ? spawnHook(baseContext) : baseContext;\n}\n\nexport interface BashToolOptions {\n\t/** Session owner required for model-facing background execution. */\n\tjobs?: BashJobManager;\n\t/** Opt-in run-owned admission/deadline. Absent preserves legacy execution. */\n\tgetRunContext?: () => BashRunContext | undefined;\n\t/** Explicit base environment; defaults to the host environment. */\n\tenvironment?: NodeJS.ProcessEnv;\n\t/** Register a local shell immediately after spawn. Must not throw. */\n\tonProcessStarted?: (child: ChildProcess) => void;\n\t/** Custom operations for command execution. Default: local shell */\n\toperations?: BashOperations;\n\t/** Opt-in 8 KiB head-and-tail model-facing output. Structured output is unchanged. */\n\toutputHeadTail?: boolean;\n\t/** Opt-in deterministic cleanup of model-facing bash output; structured output stays raw. */\n\toutputCleanup?: boolean;\n\t/** Command prefix prepended to every command (for example shell setup commands) */\n\tcommandPrefix?: string;\n\t/** Optional explicit shell path from settings */\n\tshellPath?: string;\n\t/** Expose current HUMAIN Code CLI session metadata and PI compatibility aliases. Default: true */\n\texposeSessionEnvironment?: boolean;\n\t/** Remaining session budget at execution time; only model-facing bash uses this cap. */\n\tgetRemainingTimeSeconds?: () => number;\n\t/** Hook to adjust command, cwd, or env before execution */\n\tspawnHook?: BashSpawnHook;\n}\n\nexport type BashRenderState = {\n\tstartedAt: number | undefined;\n\tendedAt: number | undefined;\n\tinterval: NodeJS.Timeout | undefined;\n};\n\nexport interface ShellToolConfig {\n\tname: string;\n\tlabel: string;\n\tshellName: string;\n\tprompt: string;\n\tpromptSnippet: string;\n\tpromptGuidelines?: readonly string[];\n\ttempFilePrefix: string;\n}\n\n// Bind ownership to execution identity so SDK/extension definition copies retain it.\nconst bashToolOwners = new WeakMap<ToolDefinition[\"execute\"], BashJobManager>();\n\n/** Resolve the actual shell owner before the session wraps registered tools. */\nexport function getBashToolOwner(definition: Pick<ToolDefinition, \"execute\">): BashJobManager | undefined {\n\treturn bashToolOwners.get(definition.execute);\n}\n\nexport function createShellToolDefinition(\n\tcwd: string,\n\tconfig: ShellToolConfig,\n\toptions?: BashToolOptions,\n): ToolDefinition<typeof bashSchema, BashToolDetails | undefined, BashRenderState> {\n\t// Foreground descendants need an owner even when explicit background admission is disabled.\n\tconst owner = options?.jobs ?? new BashJobManager();\n\tconst ops =\n\t\toptions?.operations ??\n\t\tcreateLocalBashOperations({\n\t\t\tshellPath: options?.shellPath,\n\t\t\tonProcessStarted: (child, custody) => {\n\t\t\t\towner.ownProcess(child, custody);\n\t\t\t\toptions?.onProcessStarted?.(child);\n\t\t\t},\n\t\t});\n\tconst commandPrefix = options?.commandPrefix;\n\tconst exposeSessionEnvironment = options?.exposeSessionEnvironment ?? true;\n\tconst spawnHook = options?.spawnHook;\n\tconst defaultTimeout = config.name === \"bash\" ? DEFAULT_BASH_TIMEOUT_SECONDS : undefined;\n\tconst outputCleanupEnv = (options?.environment ?? process.env).HUMAIN_TERMINAL_BASH_OUTPUT_CLEANUP;\n\tconst outputCleanup =\n\t\tconfig.name === \"bash\" &&\n\t\t(outputCleanupEnv === \"1\" ? true : outputCleanupEnv === \"0\" ? false : options?.outputCleanup === true);\n\tconst outputCapEnv = (options?.environment ?? process.env).HUMAIN_TERMINAL_BASH_OUTPUT_HEAD_TAIL;\n\tconst outputHeadTail =\n\t\tconfig.name === \"bash\" &&\n\t\t(outputCapEnv === \"1\" ? true : outputCapEnv === \"0\" ? false : options?.outputHeadTail === true);\n\tconst definition: ToolDefinition<typeof bashSchema, BashToolDetails | undefined, BashRenderState> = {\n\t\tname: config.name,\n\t\tlabel: config.label,\n\t\tdescription: `Execute a ${config.shellName} command in the current working directory. Returns stdout and stderr. ${outputHeadTail ? \"Output keeps up to 4 KiB each from the head and tail, at most 8 KiB and 2,000 lines combined.\" : `Output is truncated to last ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first).`} If truncated, full output is saved to a temp file. ${defaultTimeout === undefined ? \"Optionally provide a timeout in seconds.\" : `Commands time out after ${defaultTimeout} seconds by default; provide timeout in seconds for longer commands. Use background:true for servers, watchers, builds and solvers taking minutes, then jobs to inspect or wait. Background work has no default timeout; local background jobs require Linux or macOS.`}`,\n\t\tpromptSnippet: config.promptSnippet,\n\t\tpromptGuidelines: exposeSessionEnvironment && config.promptGuidelines ? [...config.promptGuidelines] : undefined,\n\t\t// TypeBox requires optional schema keys in its type even when the runtime schema omits them.\n\t\tparameters: (defaultTimeout === undefined ? shellSchema : bashSchema) as typeof bashSchema,\n\t\toutputSchema:\n\t\t\tdefaultTimeout === undefined ? bashOutputSchema : Type.Union([bashOutputSchema, bashJobOutputSchema]),\n\t\tconstrainedSampling: { type: \"json_schema\", strict: \"prefer\" },\n\t\tasync execute(\n\t\t\t_toolCallId,\n\t\t\t{ command, timeout, background }: BashToolInput,\n\t\t\tsignal?: AbortSignal,\n\t\t\tonUpdate?,\n\t\t\tctx?: ExtensionContext,\n\t\t) {\n\t\t\tconst resolvedCommand = commandPrefix ? `${commandPrefix}\\n${command}` : command;\n\t\t\tconst spawnContext = resolveSpawnContext(\n\t\t\t\tresolvedCommand,\n\t\t\t\tctx?.cwd || cwd,\n\t\t\t\tspawnHook,\n\t\t\t\texposeSessionEnvironment,\n\t\t\t\tctx,\n\t\t\t\toptions?.environment,\n\t\t\t);\n\t\t\tconst runContext = options?.getRunContext?.();\n\t\t\tif (runContext) admitBashRun(runContext);\n\t\t\tif (background) {\n\t\t\t\tif (config.name !== \"bash\" || !options?.jobs) {\n\t\t\t\t\tthrow new Error(\"Background bash requires a session job manager\");\n\t\t\t\t}\n\t\t\t\tresolveTimeoutMs(timeout);\n\t\t\t\tif (signal?.aborted) throw new Error(\"Command aborted\");\n\t\t\t\tconst job = options.jobs.start(ops, spawnContext, timeout, runContext);\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\ttext: `Background job ${job.job_id} started. Use jobs to read, wait, or kill it. Output: ${job.full_output_path}`,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\tdetails: undefined,\n\t\t\t\t\tstructuredContent: job,\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst output = new OutputAccumulator({\n\t\t\t\ttempFilePrefix: config.tempFilePrefix,\n\t\t\t\tcleanup: outputCleanup,\n\t\t\t\t...(outputHeadTail ? { maxBytes: 8 * 1024, headAndTail: true } : {}),\n\t\t\t});\n\t\t\tlet acceptingOutput = true;\n\t\t\tlet updateTimer: NodeJS.Timeout | undefined;\n\t\t\tlet updateDirty = false;\n\t\t\tlet lastUpdateAt = 0;\n\n\t\t\tconst emitOutputUpdate = () => {\n\t\t\t\tif (!onUpdate || !updateDirty) return;\n\t\t\t\tupdateDirty = false;\n\t\t\t\tlastUpdateAt = Date.now();\n\t\t\t\tconst snapshot = output.snapshot({ persistIfTruncated: true });\n\t\t\t\tonUpdate({\n\t\t\t\t\tcontent: [{ type: \"text\", text: snapshot.content || \"\" }],\n\t\t\t\t\tdetails: {\n\t\t\t\t\t\ttruncation: snapshot.truncation.truncated ? snapshot.truncation : undefined,\n\t\t\t\t\t\tfullOutputPath: snapshot.fullOutputPath,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tconst clearUpdateTimer = () => {\n\t\t\t\tif (updateTimer) {\n\t\t\t\t\tclearTimeout(updateTimer);\n\t\t\t\t\tupdateTimer = undefined;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst scheduleOutputUpdate = () => {\n\t\t\t\tif (!onUpdate) return;\n\t\t\t\tupdateDirty = true;\n\t\t\t\tconst delay = BASH_UPDATE_THROTTLE_MS - (Date.now() - lastUpdateAt);\n\t\t\t\tif (delay <= 0) {\n\t\t\t\t\tclearUpdateTimer();\n\t\t\t\t\temitOutputUpdate();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tupdateTimer ??= setTimeout(() => {\n\t\t\t\t\tupdateTimer = undefined;\n\t\t\t\t\temitOutputUpdate();\n\t\t\t\t}, delay);\n\t\t\t};\n\n\t\t\tif (onUpdate) {\n\t\t\t\tonUpdate({ content: [], details: undefined });\n\t\t\t}\n\n\t\t\tconst handleData = (data: Buffer) => {\n\t\t\t\tif (!acceptingOutput) return;\n\t\t\t\tconst pending = output.append(data);\n\t\t\t\tscheduleOutputUpdate();\n\t\t\t\treturn pending;\n\t\t\t};\n\n\t\t\tconst finishOutput = async () => {\n\t\t\t\tacceptingOutput = false;\n\t\t\t\toutput.finish();\n\t\t\t\tclearUpdateTimer();\n\t\t\t\temitOutputUpdate();\n\t\t\t\tconst snapshot = output.snapshot({ persistIfTruncated: true });\n\t\t\t\tawait output.closeTempFile();\n\t\t\t\treturn snapshot;\n\t\t\t};\n\n\t\t\tconst formatOutput = (snapshot: Awaited<ReturnType<typeof finishOutput>>, emptyText = \"(no output)\") => {\n\t\t\t\tconst truncation = snapshot.truncation;\n\t\t\t\tlet text = snapshot.content || emptyText;\n\t\t\t\tlet details: BashToolDetails | undefined = outputCleanup\n\t\t\t\t\t? { fullOutputPath: snapshot.fullOutputPath }\n\t\t\t\t\t: undefined;\n\t\t\t\tif (truncation.truncated) {\n\t\t\t\t\tdetails = { truncation, fullOutputPath: snapshot.fullOutputPath };\n\t\t\t\t\tif (outputHeadTail) return { text, details };\n\t\t\t\t\tconst startLine = truncation.totalLines - truncation.outputLines + 1;\n\t\t\t\t\tconst endLine = truncation.totalLines;\n\t\t\t\t\tif (truncation.lastLinePartial) {\n\t\t\t\t\t\tconst lastLineSize = formatSize(output.getLastLineBytes());\n\t\t\t\t\t\ttext += `\\n\\n[Showing last ${formatSize(truncation.outputBytes)} of line ${endLine} (line is ${lastLineSize}). Full output: ${snapshot.fullOutputPath}]`;\n\t\t\t\t\t} else if (truncation.truncatedBy === \"lines\") {\n\t\t\t\t\t\ttext += `\\n\\n[Showing lines ${startLine}-${endLine} of ${truncation.totalLines}. Full output: ${snapshot.fullOutputPath}]`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttext += `\\n\\n[Showing lines ${startLine}-${endLine} of ${truncation.totalLines} (${formatSize(DEFAULT_MAX_BYTES)} limit). Full output: ${snapshot.fullOutputPath}]`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn { text, details };\n\t\t\t};\n\n\t\t\tconst appendStatus = (text: string, status: string) => `${text ? `${text}\\n\\n` : \"\"}${status}`;\n\t\t\tconst startedAt = performance.now();\n\t\t\tlet timeLimitCapped = false;\n\n\t\t\ttry {\n\t\t\t\tlet exitCode: number | null;\n\t\t\t\ttry {\n\t\t\t\t\tlet effectiveTimeout = timeout === undefined ? defaultTimeout : timeout;\n\t\t\t\t\tif (!runContext && config.name === \"bash\" && options?.getRemainingTimeSeconds) {\n\t\t\t\t\t\t// Validate explicit timeouts before capping so the budget cannot hide invalid input.\n\t\t\t\t\t\tresolveTimeoutMs(effectiveTimeout);\n\t\t\t\t\t\tconst cap = Math.max(5, options.getRemainingTimeSeconds() - 20);\n\t\t\t\t\t\ttimeLimitCapped = effectiveTimeout !== undefined && cap < effectiveTimeout;\n\t\t\t\t\t\tif (timeLimitCapped) effectiveTimeout = cap;\n\t\t\t\t\t}\n\t\t\t\t\tif (runContext) {\n\t\t\t\t\t\tresolveTimeoutMs(effectiveTimeout);\n\t\t\t\t\t\teffectiveTimeout = Math.min(\n\t\t\t\t\t\t\teffectiveTimeout ?? MAX_TIMEOUT_SECONDS,\n\t\t\t\t\t\t\tadmitBashRun(runContext),\n\t\t\t\t\t\t\tMAX_TIMEOUT_SECONDS,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tconst result = await ops.exec(spawnContext.command, spawnContext.cwd, {\n\t\t\t\t\t\tonData: handleData,\n\t\t\t\t\t\tsignal,\n\t\t\t\t\t\ttimeout: effectiveTimeout,\n\t\t\t\t\t\tenv: spawnContext.env,\n\t\t\t\t\t\t...(runContext\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tdeadline: runContext.deadline,\n\t\t\t\t\t\t\t\t\tnow: runContext.now,\n\t\t\t\t\t\t\t\t\tterminateChildrenOnExit: true,\n\t\t\t\t\t\t\t\t\tbeforeSpawn: () => {\n\t\t\t\t\t\t\t\t\t\tadmitBashRun(runContext);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t});\n\t\t\t\t\texitCode = result.exitCode;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst snapshot = await finishOutput();\n\t\t\t\t\tconst { text } = formatOutput(snapshot, \"\");\n\t\t\t\t\tif (err instanceof Error && err.message === \"aborted\") {\n\t\t\t\t\t\tthrow new Error(appendStatus(text, \"Command aborted\"));\n\t\t\t\t\t}\n\t\t\t\t\tif (err instanceof Error && err.message.startsWith(\"timeout:\")) {\n\t\t\t\t\t\tconst timeoutSecs = err.message.split(\":\")[1];\n\t\t\t\t\t\tconst guidance = timeLimitCapped\n\t\t\t\t\t\t\t? \"; stopped to respect the run's time limit (20-second reserve).\"\n\t\t\t\t\t\t\t: timeout === undefined && defaultTimeout !== undefined\n\t\t\t\t\t\t\t\t? \"; pass a larger timeout for commands that need longer, and start long-running processes (servers, watchers) in the background with output redirected to a file.\"\n\t\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\t\tlet status = `Command timed out after ${timeoutSecs} seconds${guidance}`;\n\t\t\t\t\t\tif (err instanceof ShellTimeoutError && err.shellExit) {\n\t\t\t\t\t\t\tstatus += `. The shell exited with code ${err.shellExit.exitCode} after ${err.shellExit.afterSeconds} seconds, but background processes it started kept writing output until the timeout.`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new Error(appendStatus(text, status));\n\t\t\t\t\t}\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\n\t\t\t\tconst snapshot = await finishOutput();\n\t\t\t\tconst { text: outputText, details } = formatOutput(snapshot);\n\t\t\t\tif (exitCode === null) {\n\t\t\t\t\tthrow new Error(appendStatus(outputText, \"Command terminated without an exit code\"));\n\t\t\t\t}\n\t\t\t\tconst wallTimeSeconds = Math.round((performance.now() - startedAt) / 100) / 10;\n\t\t\t\tconst fullOutput = await output.readFullOutput(STRUCTURED_OUTPUT_MAX_BYTES);\n\t\t\t\tconst structuredContent: BashToolOutput = {\n\t\t\t\t\toutput: fullOutput.content,\n\t\t\t\t\ttruncated: fullOutput.truncated,\n\t\t\t\t\t...(fullOutput.truncated && snapshot.fullOutputPath\n\t\t\t\t\t\t? { full_output_path: snapshot.fullOutputPath }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\texit_code: exitCode,\n\t\t\t\t\twall_time_seconds: wallTimeSeconds,\n\t\t\t\t};\n\t\t\t\tif (exitCode !== 0) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontent: [{ type: \"text\", text: appendStatus(outputText, `Command exited with code ${exitCode}`) }],\n\t\t\t\t\t\tdetails,\n\t\t\t\t\t\tstructuredContent,\n\t\t\t\t\t\tisError: true,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn { content: [{ type: \"text\", text: outputText }], details, structuredContent };\n\t\t\t} finally {\n\t\t\t\tclearUpdateTimer();\n\t\t\t}\n\t\t},\n\t\t...createShellRenderers(config.prompt),\n\t};\n\tbashToolOwners.set(definition.execute, owner);\n\treturn definition;\n}\n\nconst bashToolConfig: ShellToolConfig = {\n\tname: \"bash\",\n\tlabel: \"bash\",\n\tshellName: \"bash\",\n\tprompt: \"$\",\n\tpromptSnippet: bashToolSystemPromptContribution.snippet,\n\tpromptGuidelines: bashToolSystemPromptContribution.guidelines,\n\ttempFilePrefix: \"pi-bash\",\n};\n\nexport function createBashToolDefinition(\n\tcwd: string,\n\toptions?: BashToolOptions,\n): ToolDefinition<typeof bashSchema, BashToolDetails | undefined, BashRenderState> {\n\treturn createShellToolDefinition(cwd, bashToolConfig, options);\n}\n\nexport function createBashTool(cwd: string, options?: BashToolOptions): TypeBoxAgentTool<typeof bashSchema> {\n\tconst definition = createBashToolDefinition(cwd, options);\n\tconst tool = wrapToolDefinition(definition);\n\tconst owner = getBashToolOwner(definition);\n\tif (owner) bashToolOwners.set(tool.execute, owner);\n\tObject.assign(tool, {\n\t\tpromptSnippet: definition.promptSnippet,\n\t\tpromptGuidelines: definition.promptGuidelines,\n\t});\n\treturn tool;\n}\n"]}
1
+ {"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../src/core/tools/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAqB,KAAK,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACN,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EAErB,qBAAqB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EACN,cAAc,EAGd,mBAAmB,EAEnB,mBAAmB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAuB,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAyB,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAyB,MAAM,eAAe,CAAC;AAExG,MAAM,4BAA4B,GAAG,GAAG,CAAC;AACzC,MAAM,cAAc,GAAG,aAAa,CAAC;AACrC,+G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Ae,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;AAChG,CAAC;AAED,MAAM,cAAc,GAAoB;IACvC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,MAAM;IACjB,MAAM,EAAE,GAAG;IACX,aAAa,EAAE,gCAAgC,CAAC,OAAO;IACvD,gBAAgB,EAAE,gCAAgC,CAAC,UAAU;IAC7D,cAAc,EAAE,SAAS;CACzB,CAAC;AAEF,MAAM,UAAU,wBAAwB,CACvC,GAAW,EACX,OAAyB;IAEzB,OAAO,yBAAyB,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,OAAyB;IACpE,MAAM,UAAU,GAAG,wBAAwB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1D,MAAM,IAAI,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC3C,IAAI,KAAK;QAAE,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACnD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QACnB,aAAa,EAAE,UAAU,CAAC,aAAa;QACvC,gBAAgB,EAAE,UAAU,CAAC,gBAAgB;KAC7C,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["import { constants } from \"node:fs\";\nimport { access as fsAccess } from \"node:fs/promises\";\nimport { constants as osConstants } from \"node:os\";\nimport { type ChildProcess, spawn } from \"child_process\";\nimport { type Static, Type } from \"typebox\";\nimport { waitForChildProcess } from \"../../utils/child-process.ts\";\nimport {\n\tgetShellConfig,\n\tgetShellEnv,\n\tkillProcessTreeAsync,\n\tSHELL_COMMAND_ENV_VAR,\n\ttype ShellConfig,\n\ttrackDetachedChildPid,\n} from \"../../utils/shell.ts\";\nimport { readOnlyAcceptanceSpawn } from \"../acceptance-command.ts\";\nimport type { ExtensionContext, ToolDefinition } from \"../extensions/types.ts\";\nimport {\n\tBashJobManager,\n\ttype BashJobOutput,\n\ttype BashJobSnapshot,\n\tbashJobOutputSchema,\n\ttype JobInputResult,\n\tMAX_JOB_INPUT_BYTES,\n} from \"./bash-jobs.ts\";\nimport { OutputAccumulator, type OutputSnapshot } from \"./output-accumulator.ts\";\nimport { BASH_UPDATE_THROTTLE_MS, createShellRenderers } from \"./renderers/bash.ts\";\nimport { scrubTraceEnv } from \"./subagent-env.ts\";\nimport { type TypeBoxAgentTool, wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\nimport { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, type TruncationResult } from \"./truncate.ts\";\n\nconst DEFAULT_BASH_TIMEOUT_SECONDS = 120;\nconst MAX_TIMEOUT_MS = 2_147_483_647;\n/** Output limit of `structuredContent.output`, which programmatic callers such as codemode scripts receive. */\nconst STRUCTURED_OUTPUT_MAX_BYTES = 1024 * 1024;\nconst MAX_TIMEOUT_SECONDS = MAX_TIMEOUT_MS / 1000;\n\nfunction resolveTimeoutMs(timeout: number | undefined): number | undefined {\n\tif (timeout === undefined) return undefined;\n\tif (!Number.isFinite(timeout) || timeout <= 0) {\n\t\tthrow new Error(\"Invalid timeout: must be a finite number of seconds\");\n\t}\n\n\tconst timeoutMs = timeout * 1000;\n\tif (timeoutMs > MAX_TIMEOUT_MS) {\n\t\tthrow new Error(`Invalid timeout: maximum is ${MAX_TIMEOUT_SECONDS} seconds`);\n\t}\n\treturn timeoutMs;\n}\n\nconst shellSchema = Type.Object({\n\tcommand: Type.String({ description: \"Shell command to execute\" }),\n\ttimeout: Type.Optional(Type.Number({ description: \"Timeout in seconds (no default)\" })),\n});\n\nconst bashSchema = Type.Object({\n\t...shellSchema.properties,\n\tbackground: Type.Optional(Type.Boolean({ description: \"Start session-owned background work and return a job ID\" })),\n\ttimeout: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: `Timeout in seconds (foreground default: ${DEFAULT_BASH_TIMEOUT_SECONDS})`,\n\t\t}),\n\t),\n});\n\nexport const bashToolSystemPromptContribution = {\n\tsnippet: \"Execute bash commands (ls, grep, find, etc.)\",\n\tguidelines: [\"You can inspect HUMAIN_TERMINAL_* environment variables for current model and session details.\"],\n} as const;\n\nexport type BashToolInput = Static<typeof bashSchema>;\n\n/**\n * Result for programmatic callers such as codemode scripts. A non-zero exit code is an error result for the model, but scripts still resolve to this value.\n * `output` is not limited like the model-facing output: callers decide how much of it reaches the model.\n */\nconst bashOutputSchema = Type.Object({\n\toutput: Type.String({ description: \"Combined stdout and stderr, possibly truncated\" }),\n\ttruncated: Type.Boolean(),\n\tfull_output_path: Type.Optional(Type.String({ description: \"Full output, when truncated\" })),\n\tfull_output_error: Type.Optional(Type.String({ description: \"Why saving full output failed\" })),\n\texit_code: Type.Number(),\n\twall_time_seconds: Type.Number(),\n});\n\nexport type BashToolOutput = Static<typeof bashOutputSchema> | BashJobOutput;\n\nexport interface BashToolDetails {\n\ttruncation?: TruncationResult;\n\tfullOutputPath?: string;\n\t/** Why the full output could not be saved to a temp file, when it could not. */\n\tfullOutputError?: string;\n}\n\n/** A background process tree could not be confirmed stopped; retain its effect ownership. */\nexport class BashProcessCleanupError extends Error {}\n\n/** Run-owned custody and time allocation, installed only for explicitly admitted adaptive work. */\nexport interface BashRunContext {\n\trunId: string;\n\townerId: string;\n\tsessionId: string;\n\tgeneration: number;\n\tphase: \"implementation\" | \"verification\";\n\t/** Absolute timestamps in the injected clock's domain. */\n\tdeadline: number;\n\treserveCutoff: number;\n\t/** SHA-256 identity only; never raw environment values. */\n\tenvironmentIdentity: string;\n\tlineage: readonly string[];\n\tnow: () => number;\n\t/** Trusted owner gate; rejects revoked lanes or stale generations. */\n\tassertCurrent: () => void;\n\t/** Wake the existing owner after terminal capture/process cleanup; never dispatch a model. */\n\tonTerminal?: (record: BashJobSnapshot) => void;\n}\n\n/** Validate run admission and return its remaining absolute-deadline allocation in seconds. */\nexport function admitBashRun(context: BashRunContext): number {\n\tcontext.assertCurrent();\n\tconst now = context.now();\n\t// Host-supplied run context is an admission boundary, not model tool input.\n\tif (\n\t\t![now, context.deadline, context.reserveCutoff].every(Number.isFinite) ||\n\t\tcontext.reserveCutoff > context.deadline ||\n\t\t!Number.isSafeInteger(context.generation) ||\n\t\tcontext.generation < 0 ||\n\t\t![context.runId, context.ownerId, context.sessionId].every((id) => typeof id === \"string\" && id.length > 0) ||\n\t\t!/^[a-f0-9]{64}$/.test(context.environmentIdentity) ||\n\t\t!Array.isArray(context.lineage) ||\n\t\t!context.lineage.every((id) => typeof id === \"string\" && id.length > 0) ||\n\t\t![\"implementation\", \"verification\"].includes(context.phase)\n\t)\n\t\tthrow new Error(\"Invalid bash run context\");\n\tif (now >= context.deadline) throw new Error(\"Run deadline exceeded\");\n\tif (context.phase === \"implementation\" && now >= context.reserveCutoff)\n\t\tthrow new Error(\"Run verification reserve reached\");\n\treturn (context.deadline - now) / 1000;\n}\n\nexport interface BashStdin {\n\twrite(input: string, eof?: boolean): Promise<JobInputResult>;\n}\n\n/** Pluggable bash transport; remote implementations opt into stdin only when actually supported. */\nexport interface BashOperations {\n\t/** Only explicitly capable transports may receive an input registration callback. */\n\tsupportsStdin?: boolean;\n\t/**\n\t * Execute a command and stream output.\n\t * @param command The command to execute\n\t * @param cwd Working directory\n\t * @param options Execution options\n\t * @returns Promise resolving to the exit code. Report signal terminations as 128 + signal number;\n\t * a null exit code is treated as a failed command.\n\t */\n\texec: (\n\t\tcommand: string,\n\t\tcwd: string,\n\t\toptions: {\n\t\t\t/** Await a returned promise before delivering more stdout or stderr. */\n\t\t\tonData: ((data: Buffer) => void) | ((data: Buffer) => Promise<void>);\n\t\t\tsignal?: AbortSignal;\n\t\t\ttimeout?: number;\n\t\t\tenv?: NodeJS.ProcessEnv;\n\t\t\t/** Background jobs terminate lingering children before releasing process custody. */\n\t\t\tterminateChildrenOnExit?: boolean;\n\t\t\t/** Absolute deadline and clock from the admitted run; absent for legacy execution. */\n\t\t\tdeadline?: number;\n\t\t\tnow?: () => number;\n\t\t\t/** Recheck run custody/admission immediately before actual process creation. */\n\t\t\tbeforeSpawn?: () => void;\n\t\t\tonStdin?: (stdin: BashStdin | undefined) => void;\n\t\t\t/** Observe the original local process object; persisted PIDs never grant custody. */\n\t\t\tonProcessStarted?: (child: ChildProcess) => void;\n\t\t},\n\t) => Promise<{ exitCode: number | null }>;\n}\n\n/** Signal that a transport could not prove owned-process termination. */\nexport class BashCleanupError extends BashProcessCleanupError {\n\tconstructor() {\n\t\tsuper(\"Owned process cleanup unconfirmed\");\n\t\tthis.name = \"BashCleanupError\";\n\t}\n}\n\n/**\n * Timeout of the local shell backend. Its message keeps the `timeout:<seconds>` form custom operations throw.\n * `shellExit` is set when the shell itself exited before the deadline, so the tool was only still waiting\n * because background processes kept writing to the inherited stdout/stderr pipes (#11613).\n */\nclass ShellTimeoutError extends Error {\n\treadonly shellExit: { exitCode: number; afterSeconds: number } | undefined;\n\n\tconstructor(timeout: number | undefined, shellExit: { exitCode: number; afterSeconds: number } | undefined) {\n\t\tsuper(`timeout:${timeout}`);\n\t\tthis.shellExit = shellExit;\n\t}\n}\n\n/** Whether the executor can rule out effects escaping the shell's process group. */\nexport type ShellProcessCustody = \"bounded\" | \"uncertain\";\n\n// This is a launch-free grammar, not a read-only command allowlist: redirects still mutate files.\n// No expansions, operators, function imports, startup scripts or injected loaders may execute code.\nconst literalShellWord = String.raw`(?:[a-zA-Z0-9_./:=,%@+\\-]+|'[^']*'|\"[^\"$\\x60\\\\]*\")`;\n// Only string printing: printf options can assign/evaluate array subscripts, and %n assigns too.\n// Reject every option spelling and every other conversion rather than interpreting Bash's formats.\nconst literalPrintfFormat = String.raw`(?!['\"]?-)(?:(?:[a-zA-Z0-9_./:=,@+\\-]|%[s%])+|'(?:[^'%]|%[s%])*'|\"(?:[^\"%$\\x60\\\\]|%[s%])*\")`;\nconst launchFreeBuiltin = new RegExp(\n\tString.raw`^[ \\t]*(?:builtin[ \\t]+)?(?:printf[ \\t]+${literalPrintfFormat}|echo|true|false|:)(?:[ \\t]+${literalShellWord})*(?:[ \\t]*>>?[ \\t]*${literalShellWord})?[ \\t]*$`,\n);\n\n/** Shared process execution used by the built-in shell tools. */\nexport function createLocalShellOperations(\n\tshellName: string,\n\tresolveShellConfig: () => ShellConfig,\n\tonProcessStarted?: (child: ChildProcess, custody: ShellProcessCustody) => void,\n): BashOperations {\n\tconst operations: BashOperations = {\n\t\tsupportsStdin: true,\n\t\texec: async (\n\t\t\tcommand,\n\t\t\tcwd,\n\t\t\t{\n\t\t\t\tonData,\n\t\t\t\tsignal,\n\t\t\t\ttimeout,\n\t\t\t\tenv,\n\t\t\t\tterminateChildrenOnExit,\n\t\t\t\tdeadline,\n\t\t\t\tnow,\n\t\t\t\tbeforeSpawn,\n\t\t\t\tonStdin,\n\t\t\t\tonProcessStarted: recordProcessStarted,\n\t\t\t},\n\t\t) => {\n\t\t\tlet timeoutMs = resolveTimeoutMs(timeout);\n\t\t\t// Windows taskkill loses descendant custody once the shell exits; refuse unsafe admission.\n\t\t\tif (terminateChildrenOnExit && process.platform === \"win32\") {\n\t\t\t\tthrow new Error(\"Local background bash jobs are unavailable on Windows\");\n\t\t\t}\n\t\t\tif (signal?.aborted) {\n\t\t\t\tthrow new Error(\"aborted\");\n\t\t\t}\n\t\t\tconst originalShell = resolveShellConfig();\n\t\t\tconst environment = scrubTraceEnv(env ?? getShellEnv());\n\t\t\tconst readOnly = readOnlyAcceptanceSpawn(command, cwd, originalShell, environment);\n\t\t\tconst shellConfig = readOnly ?? originalShell;\n\t\t\ttry {\n\t\t\t\tawait fsAccess(cwd, constants.F_OK);\n\t\t\t} catch {\n\t\t\t\tthrow new Error(`Working directory does not exist: ${cwd}\\nCannot execute ${shellName} commands.`);\n\t\t\t}\n\n\t\t\tif (signal?.aborted) throw new Error(\"aborted\");\n\t\t\tif (deadline !== undefined) {\n\t\t\t\tconst remaining = deadline - (now ?? (() => performance.now()))();\n\t\t\t\tif (remaining <= 0) throw new Error(\"Run deadline exceeded\");\n\t\t\t\ttimeoutMs = Math.min(timeoutMs ?? MAX_TIMEOUT_MS, remaining, MAX_TIMEOUT_MS);\n\t\t\t}\n\t\t\tbeforeSpawn?.();\n\t\t\tconst transport = shellConfig.commandTransport ?? \"argv\";\n\t\t\tconst commandFromStdin = transport === \"stdin\";\n\t\t\t// Windows bash builds get the command in SHELL_COMMAND_ENV_VAR: their runtime cuts a long argument\n\t\t\t// (see WINDOWS_ENV_COMMAND_RUNNER in utils/shell.ts). Set last, so an inherited value never runs.\n\t\t\tconst child = spawn(\n\t\t\t\tshellConfig.shell,\n\t\t\t\ttransport === \"argv\" ? [...shellConfig.args, command] : shellConfig.args,\n\t\t\t\t{\n\t\t\t\t\tcwd,\n\t\t\t\t\tdetached: process.platform !== \"win32\",\n\t\t\t\t\tenv: transport === \"env\" ? { ...environment, [SHELL_COMMAND_ENV_VAR]: command } : environment,\n\t\t\t\t\tstdio: [\n\t\t\t\t\t\tcommandFromStdin || onStdin ? \"pipe\" : \"ignore\",\n\t\t\t\t\t\t\"pipe\",\n\t\t\t\t\t\t\"pipe\",\n\t\t\t\t\t\t...(readOnly ? [\"pipe\" as const, \"pipe\" as const] : []),\n\t\t\t\t\t],\n\t\t\t\t\twindowsHide: true,\n\t\t\t\t},\n\t\t\t);\n\t\t\tconst filterInput = readOnly ? child.stdio[3] : undefined;\n\t\t\tif (readOnly && filterInput && \"end\" in filterInput) {\n\t\t\t\tfilterInput.on(\"error\", () => {});\n\t\t\t\tfilterInput.end(readOnly.filter);\n\t\t\t}\n\t\t\tconst statusOutput = readOnly ? child.stdio[4] : undefined;\n\t\t\tlet metadata: string | undefined = \"\";\n\t\t\tconst statusEnded = new Promise<void>((resolve) => {\n\t\t\t\tif (!statusOutput || !(\"read\" in statusOutput)) {\n\t\t\t\t\tmetadata = undefined;\n\t\t\t\t\tresolve();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Backend metadata is a bounded wire boundary, separate from command output.\n\t\t\t\tstatusOutput.on(\"data\", (data: Buffer) => {\n\t\t\t\t\tif (metadata !== undefined)\n\t\t\t\t\t\tmetadata =\n\t\t\t\t\t\t\tBuffer.byteLength(metadata) + data.length <= 16384 ? metadata + data.toString(\"utf8\") : undefined;\n\t\t\t\t});\n\t\t\t\tstatusOutput.once(\"end\", resolve);\n\t\t\t\tstatusOutput.once(\"error\", () => {\n\t\t\t\t\tmetadata = undefined;\n\t\t\t\t\tresolve();\n\t\t\t\t});\n\t\t\t\tstatusOutput.once(\"close\", () => {\n\t\t\t\t\tif (!statusOutput.readableEnded) metadata = undefined;\n\t\t\t\t\tresolve();\n\t\t\t\t});\n\t\t\t});\n\t\t\tif (child.pid) trackDetachedChildPid(child.pid, child);\n\t\t\tconst launchFree =\n\t\t\t\toriginalShell.shell === \"/bin/bash\" &&\n\t\t\t\toriginalShell.args.length === 1 &&\n\t\t\t\toriginalShell.args[0] === \"-c\" &&\n\t\t\t\t!Object.keys(environment).some((name) =>\n\t\t\t\t\t/^(?:BASH_ENV$|ENV$|SSH_CLIENT$|SSH2_CLIENT$|SHELLOPTS$|BASHOPTS$|PS4$|BASH_FUNC_|LD_|DYLD_|GLIBC_TUNABLES$)/.test(\n\t\t\t\t\t\tname,\n\t\t\t\t\t),\n\t\t\t\t) &&\n\t\t\t\tlaunchFreeBuiltin.test(command);\n\t\t\tonProcessStarted?.(child, readOnly || launchFree ? \"bounded\" : \"uncertain\");\n\t\t\trecordProcessStarted?.(child);\n\t\t\t// A broken pipe is a normal input/exit race, not an unhandled process error.\n\t\t\tchild.stdin?.on(\"error\", () => {});\n\t\t\tif (commandFromStdin) child.stdin?.end(command);\n\t\t\tlet writingInput = false;\n\t\t\tlet closeInput: (() => void) | undefined;\n\t\t\tonStdin?.(\n\t\t\t\tcommandFromStdin\n\t\t\t\t\t? undefined\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tasync write(input, eof = false) {\n\t\t\t\t\t\t\t\t// Direct transport callers are also an input trust boundary.\n\t\t\t\t\t\t\t\tif (typeof input !== \"string\" || typeof eof !== \"boolean\")\n\t\t\t\t\t\t\t\t\tthrow new Error(\"Invalid stdin input/eof\");\n\t\t\t\t\t\t\t\tconst bytes = Buffer.byteLength(input);\n\t\t\t\t\t\t\t\tif (bytes > MAX_JOB_INPUT_BYTES || writingInput) return { status: \"backpressure\", bytes: 0 };\n\t\t\t\t\t\t\t\tconst stdin = child.stdin;\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t!stdin ||\n\t\t\t\t\t\t\t\t\tstdin.destroyed ||\n\t\t\t\t\t\t\t\t\tstdin.writableEnded ||\n\t\t\t\t\t\t\t\t\tchild.exitCode !== null ||\n\t\t\t\t\t\t\t\t\tchild.signalCode !== null\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\treturn { status: \"closed\", bytes: 0 };\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twritingInput = true;\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\treturn await new Promise<JobInputResult>((resolve) => {\n\t\t\t\t\t\t\t\t\t\tlet settled = false;\n\t\t\t\t\t\t\t\t\t\tlet written = false;\n\t\t\t\t\t\t\t\t\t\tlet drained = true;\n\t\t\t\t\t\t\t\t\t\tlet ended = !eof;\n\t\t\t\t\t\t\t\t\t\tconst finish = (result: JobInputResult) => {\n\t\t\t\t\t\t\t\t\t\t\tif (settled) return;\n\t\t\t\t\t\t\t\t\t\t\tsettled = true;\n\t\t\t\t\t\t\t\t\t\t\tstdin.off(\"error\", closed);\n\t\t\t\t\t\t\t\t\t\t\tstdin.off(\"close\", closed);\n\t\t\t\t\t\t\t\t\t\t\tstdin.off(\"drain\", drain);\n\t\t\t\t\t\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\tconst complete = () => {\n\t\t\t\t\t\t\t\t\t\t\tif (written && drained && ended) finish({ status: \"written\", bytes });\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\tconst closed = () => finish({ status: \"closed\", bytes: 0 });\n\t\t\t\t\t\t\t\t\t\tcloseInput = closed;\n\t\t\t\t\t\t\t\t\t\tconst drain = () => {\n\t\t\t\t\t\t\t\t\t\t\tdrained = true;\n\t\t\t\t\t\t\t\t\t\t\tcomplete();\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\tstdin.once(\"error\", closed);\n\t\t\t\t\t\t\t\t\t\tstdin.once(\"close\", closed);\n\t\t\t\t\t\t\t\t\t\tconst accepted = stdin.write(input, (error) => {\n\t\t\t\t\t\t\t\t\t\t\tif (settled) return;\n\t\t\t\t\t\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\t\t\t\t\t\tclosed();\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\twritten = true;\n\t\t\t\t\t\t\t\t\t\t\tif (eof)\n\t\t\t\t\t\t\t\t\t\t\t\tstdin.end(() => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tended = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tcomplete();\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\tcomplete();\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\tdrained = accepted;\n\t\t\t\t\t\t\t\t\t\tif (!drained) stdin.once(\"drain\", drain);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\tcloseInput = undefined;\n\t\t\t\t\t\t\t\t\twritingInput = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t);\n\t\t\tconst startedAt = performance.now();\n\t\t\tlet shellExitedAfterMs: number | undefined;\n\t\t\tchild.once(\"exit\", () => {\n\t\t\t\tshellExitedAfterMs = performance.now() - startedAt;\n\t\t\t});\n\t\t\tlet timedOut = false;\n\t\t\tlet exitedBeforeDeadlineAfterMs: number | undefined;\n\t\t\tlet timeoutHandle: NodeJS.Timeout | undefined;\n\t\t\tlet drainTimer: NodeJS.Timeout | undefined;\n\t\t\tlet termination: Promise<boolean> | undefined;\n\t\t\tlet finished = false;\n\t\t\tlet quiescent = true;\n\t\t\tlet outcome: { kind: \"completed\"; exitCode: number | null } | { kind: \"error\"; error: unknown };\n\t\t\tlet outputFailure: { error: unknown } | undefined;\n\t\t\tlet pendingOutput: Promise<void> | undefined;\n\t\t\tconst drainController = new AbortController();\n\t\t\tconst drainAborted = new Promise<void>((resolve) => {\n\t\t\t\tdrainController.signal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t\t\t});\n\t\t\tconst terminateChildren = () =>\n\t\t\t\t(termination ??= child.pid ? killProcessTreeAsync(child.pid, undefined, child) : Promise.resolve(true));\n\t\t\tconst onAbort = () => {\n\t\t\t\tvoid terminateChildren().then(() => {\n\t\t\t\t\tif (!finished && !drainTimer) drainTimer = setTimeout(() => drainController.abort(), 500);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tconst failOutput = (error: unknown) => {\n\t\t\t\toutputFailure = { error };\n\t\t\t\tchild.stdout?.off(\"data\", handleData);\n\t\t\t\tchild.stderr?.off(\"data\", handleData);\n\t\t\t\tonAbort();\n\t\t\t\tchild.stdout?.resume();\n\t\t\t\tchild.stderr?.resume();\n\t\t\t};\n\t\t\tconst handleData = (data: Buffer) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst pending = onData(data);\n\t\t\t\t\tif (pending instanceof Promise) {\n\t\t\t\t\t\t// Both pipes share one sink, so neither may enqueue more until it drains.\n\t\t\t\t\t\tchild.stdout?.pause();\n\t\t\t\t\t\tchild.stderr?.pause();\n\t\t\t\t\t\tpendingOutput = pending.then(() => {\n\t\t\t\t\t\t\tchild.stdout?.resume();\n\t\t\t\t\t\t\tchild.stderr?.resume();\n\t\t\t\t\t\t}, failOutput);\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tfailOutput(error);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Background ownership ends with the shell, even if children keep pipes open.\n\t\t\tif (terminateChildrenOnExit) child.once(\"exit\", terminateChildren);\n\t\t\ttry {\n\t\t\t\t// Set timeout if provided.\n\t\t\t\tif (timeoutMs !== undefined) {\n\t\t\t\t\ttimeoutHandle = setTimeout(() => {\n\t\t\t\t\t\ttimedOut = true;\n\t\t\t\t\t\texitedBeforeDeadlineAfterMs = shellExitedAfterMs;\n\t\t\t\t\t\tonAbort();\n\t\t\t\t\t}, timeoutMs);\n\t\t\t\t}\n\t\t\t\t// Stream stdout and stderr.\n\t\t\t\tchild.stdout?.on(\"data\", handleData);\n\t\t\t\tchild.stderr?.on(\"data\", handleData);\n\t\t\t\t// Handle abort signal by killing the entire process tree.\n\t\t\t\tif (signal) {\n\t\t\t\t\tif (signal.aborted) onAbort();\n\t\t\t\t\telse signal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\t}\n\t\t\t\t// Handle shell spawn errors and wait for the process to terminate without hanging\n\t\t\t\t// on inherited stdio handles held by detached descendants.\n\t\t\t\tconst exitCode = await waitForChildProcess(child, drainController.signal);\n\t\t\t\tawait Promise.race([pendingOutput, drainAborted]);\n\t\t\t\tif (outputFailure) throw outputFailure.error;\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tthrow new Error(\"aborted\");\n\t\t\t\t}\n\t\t\t\t// A signal-killed shell has no exit code. Use the standard shell convention so\n\t\t\t\t// callers do not mistake the termination for a successful command.\n\t\t\t\tconst signalCode = child.signalCode;\n\t\t\t\tconst resolvedExitCode = exitCode ?? (signalCode ? 128 + (osConstants.signals[signalCode] ?? 0) : 1);\n\t\t\t\tif (timedOut) {\n\t\t\t\t\tthrow new ShellTimeoutError(\n\t\t\t\t\t\ttimeout,\n\t\t\t\t\t\texitedBeforeDeadlineAfterMs !== undefined\n\t\t\t\t\t\t\t? { exitCode: resolvedExitCode, afterSeconds: Math.round(exitedBeforeDeadlineAfterMs / 100) / 10 }\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tawait Promise.race([statusEnded, drainAborted]);\n\t\t\t\t// Metadata draining remains subject to the same timeout/cancellation as command output.\n\t\t\t\tif (signal?.aborted) throw new Error(\"aborted\");\n\t\t\t\tif (timedOut) throw new ShellTimeoutError(timeout, undefined);\n\t\t\t\t// Failure is evidence too, but only the backend's dedicated exec-confirmation channel proves it.\n\t\t\t\tif (exitCode !== null && !signalCode) readOnly?.completed(exitCode, metadata);\n\t\t\t\toutcome = { kind: \"completed\", exitCode: resolvedExitCode };\n\t\t\t} catch (error) {\n\t\t\t\toutcome = { kind: \"error\", error };\n\t\t\t} finally {\n\t\t\t\tfinished = true;\n\t\t\t\t// Local pipe custody ends even when process termination cannot be confirmed.\n\t\t\t\tcloseInput?.();\n\t\t\t\tchild.stdin?.destroy();\n\t\t\t\tstatusOutput?.destroy();\n\t\t\t\tif (terminateChildrenOnExit || deadline !== undefined) {\n\t\t\t\t\tchild.off(\"exit\", terminateChildren);\n\t\t\t\t\tquiescent = await terminateChildren();\n\t\t\t\t}\n\t\t\t\tif (drainTimer) clearTimeout(drainTimer);\n\t\t\t\t// The custody monitor releases absent groups; shell return alone must not release live descendants.\n\t\t\t\tif (timeoutHandle) clearTimeout(timeoutHandle);\n\t\t\t\tif (signal) signal.removeEventListener(\"abort\", onAbort);\n\t\t\t\tchild.stdout?.off(\"data\", handleData);\n\t\t\t\tchild.stderr?.off(\"data\", handleData);\n\t\t\t}\n\t\t\tif (deadline !== undefined && !quiescent) throw new BashCleanupError();\n\t\t\tif (!quiescent) throw new BashProcessCleanupError(\"Background process cleanup could not confirm quiescence\");\n\t\t\tif (outcome.kind === \"error\") throw outcome.error;\n\t\t\treturn { exitCode: outcome.exitCode };\n\t\t},\n\t};\n\treturn operations;\n}\n\n/**\n * Create bash operations using pi's built-in local shell execution backend.\n *\n * This is useful for extensions that intercept user_bash and still want pi's\n * standard local shell behavior while wrapping or rewriting commands.\n */\nexport function createLocalBashOperations(options?: {\n\tshellPath?: string;\n\tonProcessStarted?: (child: ChildProcess, custody: ShellProcessCustody) => void;\n}): BashOperations {\n\treturn createLocalShellOperations(\"bash\", () => getShellConfig(options?.shellPath), options?.onProcessStarted);\n}\n\nexport interface BashSpawnContext {\n\tcommand: string;\n\tcwd: string;\n\tenv: NodeJS.ProcessEnv;\n}\n\nexport type BashSpawnHook = (context: BashSpawnContext) => BashSpawnContext;\n\nfunction resolveSpawnContext(\n\tcommand: string,\n\tcwd: string,\n\tspawnHook: BashSpawnHook | undefined,\n\texposeSessionEnvironment: boolean,\n\tctx: ExtensionContext | undefined,\n\tenvironment: NodeJS.ProcessEnv | undefined,\n): BashSpawnContext {\n\tconst env = scrubTraceEnv(getShellEnv(environment));\n\tfor (const name of [\n\t\t\"HUMAIN_TERMINAL_SESSION_ID\",\n\t\t\"HUMAIN_TERMINAL_SESSION_FILE\",\n\t\t\"HUMAIN_TERMINAL_PROVIDER\",\n\t\t\"HUMAIN_TERMINAL_MODEL\",\n\t\t\"HUMAIN_TERMINAL_REASONING_LEVEL\",\n\t\t\"PI_SESSION_ID\",\n\t\t\"PI_SESSION_FILE\",\n\t\t\"PI_PROVIDER\",\n\t\t\"PI_MODEL\",\n\t\t\"PI_REASONING_LEVEL\",\n\t]) {\n\t\tdelete env[name];\n\t}\n\tif (exposeSessionEnvironment && ctx) {\n\t\tconst model = ctx.model;\n\t\tconst sessionId = ctx.sessionManager.getSessionId();\n\t\tenv.HUMAIN_TERMINAL_SESSION_ID = sessionId;\n\t\tenv.PI_SESSION_ID = sessionId;\n\t\tconst sessionFile = ctx.sessionManager.getSessionFile();\n\t\tif (sessionFile) {\n\t\t\tenv.HUMAIN_TERMINAL_SESSION_FILE = sessionFile;\n\t\t\tenv.PI_SESSION_FILE = sessionFile;\n\t\t}\n\t\tif (model) {\n\t\t\tenv.HUMAIN_TERMINAL_PROVIDER = model.provider;\n\t\t\tenv.HUMAIN_TERMINAL_MODEL = model.id;\n\t\t\tenv.PI_PROVIDER = model.provider;\n\t\t\tenv.PI_MODEL = model.id;\n\t\t}\n\t\tif (ctx.thinkingLevel) {\n\t\t\tenv.HUMAIN_TERMINAL_REASONING_LEVEL = ctx.thinkingLevel;\n\t\t\tenv.PI_REASONING_LEVEL = ctx.thinkingLevel;\n\t\t}\n\t}\n\tconst baseContext: BashSpawnContext = { command, cwd, env };\n\treturn spawnHook ? spawnHook(baseContext) : baseContext;\n}\n\nexport interface BashToolOptions {\n\t/** Session owner required for model-facing background execution. */\n\tjobs?: BashJobManager;\n\t/** Opt-in run-owned admission/deadline. Absent preserves legacy execution. */\n\tgetRunContext?: () => BashRunContext | undefined;\n\t/** Explicit base environment; defaults to the host environment. */\n\tenvironment?: NodeJS.ProcessEnv;\n\t/** Register a local shell immediately after spawn. Must not throw. */\n\tonProcessStarted?: (child: ChildProcess) => void;\n\t/** Custom operations for command execution. Default: local shell */\n\toperations?: BashOperations;\n\t/** Opt-in 8 KiB head-and-tail model-facing output. Structured output is unchanged. */\n\toutputHeadTail?: boolean;\n\t/** Opt-in deterministic cleanup of model-facing bash output; structured output stays raw. */\n\toutputCleanup?: boolean;\n\t/** Command prefix prepended to every command (for example shell setup commands) */\n\tcommandPrefix?: string;\n\t/** Optional explicit shell path from settings */\n\tshellPath?: string;\n\t/** Expose current HUMAIN Code CLI session metadata and PI compatibility aliases. Default: true */\n\texposeSessionEnvironment?: boolean;\n\t/** Remaining session budget at execution time; only model-facing bash uses this cap. */\n\tgetRemainingTimeSeconds?: () => number;\n\t/** Hook to adjust command, cwd, or env before execution */\n\tspawnHook?: BashSpawnHook;\n}\n\nexport type BashRenderState = {\n\tstartedAt: number | undefined;\n\tendedAt: number | undefined;\n\tinterval: NodeJS.Timeout | undefined;\n};\n\nexport interface ShellToolConfig {\n\tname: string;\n\tlabel: string;\n\tshellName: string;\n\tprompt: string;\n\tpromptSnippet: string;\n\tpromptGuidelines?: readonly string[];\n\ttempFilePrefix: string;\n}\n\n// Bind ownership to execution identity so SDK/extension definition copies retain it.\nconst bashToolOwners = new WeakMap<ToolDefinition[\"execute\"], BashJobManager>();\n\n/** Resolve the actual shell owner before the session wraps registered tools. */\nexport function getBashToolOwner(definition: Pick<ToolDefinition, \"execute\">): BashJobManager | undefined {\n\treturn bashToolOwners.get(definition.execute);\n}\n\nexport function createShellToolDefinition(\n\tcwd: string,\n\tconfig: ShellToolConfig,\n\toptions?: BashToolOptions,\n): ToolDefinition<typeof bashSchema, BashToolDetails | undefined, BashRenderState> {\n\t// Foreground descendants need an owner even when explicit background admission is disabled.\n\tconst owner = options?.jobs ?? new BashJobManager();\n\tconst ops =\n\t\toptions?.operations ??\n\t\tcreateLocalBashOperations({\n\t\t\tshellPath: options?.shellPath,\n\t\t\tonProcessStarted: (child, custody) => {\n\t\t\t\towner.ownProcess(child, custody);\n\t\t\t\toptions?.onProcessStarted?.(child);\n\t\t\t},\n\t\t});\n\tconst commandPrefix = options?.commandPrefix;\n\tconst exposeSessionEnvironment = options?.exposeSessionEnvironment ?? true;\n\tconst spawnHook = options?.spawnHook;\n\tconst defaultTimeout = config.name === \"bash\" ? DEFAULT_BASH_TIMEOUT_SECONDS : undefined;\n\tconst outputCleanupEnv = (options?.environment ?? process.env).HUMAIN_TERMINAL_BASH_OUTPUT_CLEANUP;\n\tconst outputCleanup =\n\t\tconfig.name === \"bash\" &&\n\t\t(outputCleanupEnv === \"1\" ? true : outputCleanupEnv === \"0\" ? false : options?.outputCleanup === true);\n\tconst outputCapEnv = (options?.environment ?? process.env).HUMAIN_TERMINAL_BASH_OUTPUT_HEAD_TAIL;\n\tconst outputHeadTail =\n\t\tconfig.name === \"bash\" &&\n\t\t(outputCapEnv === \"1\" ? true : outputCapEnv === \"0\" ? false : options?.outputHeadTail === true);\n\tconst definition: ToolDefinition<typeof bashSchema, BashToolDetails | undefined, BashRenderState> = {\n\t\tname: config.name,\n\t\tlabel: config.label,\n\t\tdescription: `Run a ${config.shellName} command in the current directory. Returns stdout and stderr, ${outputHeadTail ? \"keeping up to 4 KiB each from the head and tail (8 KiB and 2,000 lines total).\" : `limited to the last ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever limit is reached first).`} On truncation, saves full output to a temp file if possible.${defaultTimeout === undefined ? \"\" : \" Use background:true for long-running servers, watchers, builds, or solvers; inspect or wait with jobs. No default timeout for background jobs; local jobs require Linux or macOS.\"}`,\n\t\tpromptSnippet: config.promptSnippet,\n\t\tpromptGuidelines: exposeSessionEnvironment && config.promptGuidelines ? [...config.promptGuidelines] : undefined,\n\t\t// TypeBox requires optional schema keys in its type even when the runtime schema omits them.\n\t\tparameters: (defaultTimeout === undefined ? shellSchema : bashSchema) as typeof bashSchema,\n\t\toutputSchema:\n\t\t\tdefaultTimeout === undefined ? bashOutputSchema : Type.Union([bashOutputSchema, bashJobOutputSchema]),\n\t\tconstrainedSampling: { type: \"json_schema\", strict: \"prefer\" },\n\t\t// A command can change any file, so calls before it finish first and calls after it see its effects\n\t\t// (Pi-Bolt 36be68f4e, upstream #11950).\n\t\texecutionMode: \"sequential\",\n\t\tasync execute(\n\t\t\t_toolCallId,\n\t\t\t{ command, timeout, background }: BashToolInput,\n\t\t\tsignal?: AbortSignal,\n\t\t\tonUpdate?,\n\t\t\tctx?: ExtensionContext,\n\t\t) {\n\t\t\tconst resolvedCommand = commandPrefix ? `${commandPrefix}\\n${command}` : command;\n\t\t\tconst spawnContext = resolveSpawnContext(\n\t\t\t\tresolvedCommand,\n\t\t\t\tctx?.cwd || cwd,\n\t\t\t\tspawnHook,\n\t\t\t\texposeSessionEnvironment,\n\t\t\t\tctx,\n\t\t\t\toptions?.environment,\n\t\t\t);\n\t\t\tconst runContext = options?.getRunContext?.();\n\t\t\tif (runContext) admitBashRun(runContext);\n\t\t\tif (background) {\n\t\t\t\tif (config.name !== \"bash\" || !options?.jobs) {\n\t\t\t\t\tthrow new Error(\"Background bash requires a session job manager\");\n\t\t\t\t}\n\t\t\t\tresolveTimeoutMs(timeout);\n\t\t\t\tif (signal?.aborted) throw new Error(\"Command aborted\");\n\t\t\t\tconst job = options.jobs.start(ops, spawnContext, timeout, runContext);\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\ttext: `Background job ${job.job_id} started. Use jobs to read, wait, or kill it. Output: ${job.full_output_path}`,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\tdetails: undefined,\n\t\t\t\t\tstructuredContent: job,\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst output = new OutputAccumulator({\n\t\t\t\ttempFilePrefix: config.tempFilePrefix,\n\t\t\t\tcleanup: outputCleanup,\n\t\t\t\t...(outputHeadTail ? { maxBytes: 8 * 1024, headAndTail: true } : {}),\n\t\t\t});\n\t\t\tlet acceptingOutput = true;\n\t\t\tlet updateTimer: NodeJS.Timeout | undefined;\n\t\t\tlet updateDirty = false;\n\t\t\tlet lastUpdateAt = 0;\n\n\t\t\tconst emitOutputUpdate = () => {\n\t\t\t\tif (!onUpdate || !updateDirty) return;\n\t\t\t\tupdateDirty = false;\n\t\t\t\tlastUpdateAt = Date.now();\n\t\t\t\tconst snapshot = output.snapshot({ persistIfTruncated: true });\n\t\t\t\tonUpdate({\n\t\t\t\t\tcontent: [{ type: \"text\", text: snapshot.content || \"\" }],\n\t\t\t\t\tdetails: {\n\t\t\t\t\t\ttruncation: snapshot.truncation.truncated ? snapshot.truncation : undefined,\n\t\t\t\t\t\t...outputFileDetails(snapshot),\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tconst clearUpdateTimer = () => {\n\t\t\t\tif (updateTimer) {\n\t\t\t\t\tclearTimeout(updateTimer);\n\t\t\t\t\tupdateTimer = undefined;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst scheduleOutputUpdate = () => {\n\t\t\t\tif (!onUpdate) return;\n\t\t\t\tupdateDirty = true;\n\t\t\t\tconst delay = BASH_UPDATE_THROTTLE_MS - (Date.now() - lastUpdateAt);\n\t\t\t\tif (delay <= 0) {\n\t\t\t\t\tclearUpdateTimer();\n\t\t\t\t\temitOutputUpdate();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tupdateTimer ??= setTimeout(() => {\n\t\t\t\t\tupdateTimer = undefined;\n\t\t\t\t\temitOutputUpdate();\n\t\t\t\t}, delay);\n\t\t\t};\n\n\t\t\tif (onUpdate) {\n\t\t\t\tonUpdate({ content: [], details: undefined });\n\t\t\t}\n\n\t\t\tconst handleData = (data: Buffer) => {\n\t\t\t\tif (!acceptingOutput) return;\n\t\t\t\tconst pending = output.append(data);\n\t\t\t\tscheduleOutputUpdate();\n\t\t\t\treturn pending;\n\t\t\t};\n\n\t\t\tconst finishOutput = async () => {\n\t\t\t\tacceptingOutput = false;\n\t\t\t\toutput.finish();\n\t\t\t\tclearUpdateTimer();\n\t\t\t\temitOutputUpdate();\n\t\t\t\t// The file path is only final after closing: a write can still fail while the file flushes.\n\t\t\t\tawait output.closeTempFile();\n\t\t\t\treturn output.snapshot({ persistIfTruncated: true });\n\t\t\t};\n\n\t\t\tconst formatOutput = (snapshot: OutputSnapshot, emptyText = \"(no output)\") => {\n\t\t\t\tconst truncation = snapshot.truncation;\n\t\t\t\tlet text = snapshot.content || emptyText;\n\t\t\t\tlet details: BashToolDetails | undefined = outputCleanup ? outputFileDetails(snapshot) : undefined;\n\t\t\t\tif (truncation.truncated) {\n\t\t\t\t\tdetails = { truncation, ...outputFileDetails(snapshot) };\n\t\t\t\t\tif (outputHeadTail) return { text, details };\n\t\t\t\t\tconst file = snapshot.fullOutputFile;\n\t\t\t\t\tconst fullOutput =\n\t\t\t\t\t\tfile?.kind === \"failed\"\n\t\t\t\t\t\t\t? `Could not save the full output: ${file.error}`\n\t\t\t\t\t\t\t: `Full output: ${file?.path}`;\n\t\t\t\t\tconst startLine = truncation.totalLines - truncation.outputLines + 1;\n\t\t\t\t\tconst endLine = truncation.totalLines;\n\t\t\t\t\tif (truncation.lastLinePartial) {\n\t\t\t\t\t\tconst range =\n\t\t\t\t\t\t\ttruncation.outputLines === 1\n\t\t\t\t\t\t\t\t? `of line ${startLine} (line is ${formatSize(output.getLastLineBytes())})`\n\t\t\t\t\t\t\t\t: `of line ${startLine} and trailing blank lines`;\n\t\t\t\t\t\ttext += `\\n\\n[Showing last ${formatSize(truncation.outputBytes)} ${range}. ${fullOutput}]`;\n\t\t\t\t\t} else if (truncation.truncatedBy === \"lines\") {\n\t\t\t\t\t\ttext += `\\n\\n[Showing lines ${startLine}-${endLine} of ${truncation.totalLines}. ${fullOutput}]`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttext += `\\n\\n[Showing lines ${startLine}-${endLine} of ${truncation.totalLines} (${formatSize(DEFAULT_MAX_BYTES)} limit). ${fullOutput}]`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn { text, details };\n\t\t\t};\n\n\t\t\tconst appendStatus = (text: string, status: string) => `${text ? `${text}\\n\\n` : \"\"}${status}`;\n\t\t\tconst startedAt = performance.now();\n\t\t\tlet timeLimitCapped = false;\n\n\t\t\ttry {\n\t\t\t\tlet exitCode: number | null;\n\t\t\t\ttry {\n\t\t\t\t\tlet effectiveTimeout = timeout === undefined ? defaultTimeout : timeout;\n\t\t\t\t\tif (!runContext && config.name === \"bash\" && options?.getRemainingTimeSeconds) {\n\t\t\t\t\t\t// Validate explicit timeouts before capping so the budget cannot hide invalid input.\n\t\t\t\t\t\tresolveTimeoutMs(effectiveTimeout);\n\t\t\t\t\t\tconst cap = Math.max(5, options.getRemainingTimeSeconds() - 20);\n\t\t\t\t\t\ttimeLimitCapped = effectiveTimeout !== undefined && cap < effectiveTimeout;\n\t\t\t\t\t\tif (timeLimitCapped) effectiveTimeout = cap;\n\t\t\t\t\t}\n\t\t\t\t\tif (runContext) {\n\t\t\t\t\t\tresolveTimeoutMs(effectiveTimeout);\n\t\t\t\t\t\teffectiveTimeout = Math.min(\n\t\t\t\t\t\t\teffectiveTimeout ?? MAX_TIMEOUT_SECONDS,\n\t\t\t\t\t\t\tadmitBashRun(runContext),\n\t\t\t\t\t\t\tMAX_TIMEOUT_SECONDS,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tconst result = await ops.exec(spawnContext.command, spawnContext.cwd, {\n\t\t\t\t\t\tonData: handleData,\n\t\t\t\t\t\tsignal,\n\t\t\t\t\t\ttimeout: effectiveTimeout,\n\t\t\t\t\t\tenv: spawnContext.env,\n\t\t\t\t\t\t...(runContext\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tdeadline: runContext.deadline,\n\t\t\t\t\t\t\t\t\tnow: runContext.now,\n\t\t\t\t\t\t\t\t\tterminateChildrenOnExit: true,\n\t\t\t\t\t\t\t\t\tbeforeSpawn: () => {\n\t\t\t\t\t\t\t\t\t\tadmitBashRun(runContext);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t});\n\t\t\t\t\texitCode = result.exitCode;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst snapshot = await finishOutput();\n\t\t\t\t\tconst { text } = formatOutput(snapshot, \"\");\n\t\t\t\t\tif (err instanceof Error && err.message === \"aborted\") {\n\t\t\t\t\t\tthrow new Error(appendStatus(text, \"Command aborted\"));\n\t\t\t\t\t}\n\t\t\t\t\tif (err instanceof Error && err.message.startsWith(\"timeout:\")) {\n\t\t\t\t\t\tconst timeoutSecs = err.message.split(\":\")[1];\n\t\t\t\t\t\tconst guidance = timeLimitCapped\n\t\t\t\t\t\t\t? \"; stopped to respect the run's time limit (20-second reserve).\"\n\t\t\t\t\t\t\t: timeout === undefined && defaultTimeout !== undefined\n\t\t\t\t\t\t\t\t? \"; pass a larger timeout for commands that need longer, and start long-running processes (servers, watchers) in the background with output redirected to a file.\"\n\t\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\t\tlet status = `Command timed out after ${timeoutSecs} seconds${guidance}`;\n\t\t\t\t\t\tif (err instanceof ShellTimeoutError && err.shellExit) {\n\t\t\t\t\t\t\tstatus += `. The shell exited with code ${err.shellExit.exitCode} after ${err.shellExit.afterSeconds} seconds, but background processes it started kept writing output until the timeout.`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new Error(appendStatus(text, status));\n\t\t\t\t\t}\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\n\t\t\t\tconst snapshot = await finishOutput();\n\t\t\t\tconst { text: outputText, details } = formatOutput(snapshot);\n\t\t\t\tif (exitCode === null) {\n\t\t\t\t\tthrow new Error(appendStatus(outputText, \"Command terminated without an exit code\"));\n\t\t\t\t}\n\t\t\t\tconst wallTimeSeconds = Math.round((performance.now() - startedAt) / 100) / 10;\n\t\t\t\tconst fullOutput = await output.readFullOutput(STRUCTURED_OUTPUT_MAX_BYTES);\n\t\t\t\tconst structuredContent: BashToolOutput = {\n\t\t\t\t\toutput: fullOutput.content,\n\t\t\t\t\ttruncated: fullOutput.truncated,\n\t\t\t\t\t...(fullOutput.truncated && snapshot.fullOutputFile?.kind === \"saved\"\n\t\t\t\t\t\t? { full_output_path: snapshot.fullOutputFile.path }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\t...(fullOutput.truncated && snapshot.fullOutputFile?.kind === \"failed\"\n\t\t\t\t\t\t? { full_output_error: snapshot.fullOutputFile.error }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\texit_code: exitCode,\n\t\t\t\t\twall_time_seconds: wallTimeSeconds,\n\t\t\t\t};\n\t\t\t\tif (exitCode !== 0) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontent: [{ type: \"text\", text: appendStatus(outputText, `Command exited with code ${exitCode}`) }],\n\t\t\t\t\t\tdetails,\n\t\t\t\t\t\tstructuredContent,\n\t\t\t\t\t\tisError: true,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn { content: [{ type: \"text\", text: outputText }], details, structuredContent };\n\t\t\t} finally {\n\t\t\t\tclearUpdateTimer();\n\t\t\t}\n\t\t},\n\t\t...createShellRenderers(config.prompt),\n\t};\n\tbashToolOwners.set(definition.execute, owner);\n\treturn definition;\n}\n\n/** Where a snapshot's full output went: its file, or why it could not be saved. */\nfunction outputFileDetails(snapshot: OutputSnapshot): Pick<BashToolDetails, \"fullOutputPath\" | \"fullOutputError\"> {\n\tconst file = snapshot.fullOutputFile;\n\tif (file === undefined) return {};\n\treturn file.kind === \"saved\" ? { fullOutputPath: file.path } : { fullOutputError: file.error };\n}\n\nconst bashToolConfig: ShellToolConfig = {\n\tname: \"bash\",\n\tlabel: \"bash\",\n\tshellName: \"bash\",\n\tprompt: \"$\",\n\tpromptSnippet: bashToolSystemPromptContribution.snippet,\n\tpromptGuidelines: bashToolSystemPromptContribution.guidelines,\n\ttempFilePrefix: \"pi-bash\",\n};\n\nexport function createBashToolDefinition(\n\tcwd: string,\n\toptions?: BashToolOptions,\n): ToolDefinition<typeof bashSchema, BashToolDetails | undefined, BashRenderState> {\n\treturn createShellToolDefinition(cwd, bashToolConfig, options);\n}\n\nexport function createBashTool(cwd: string, options?: BashToolOptions): TypeBoxAgentTool<typeof bashSchema> {\n\tconst definition = createBashToolDefinition(cwd, options);\n\tconst tool = wrapToolDefinition(definition);\n\tconst owner = getBashToolOwner(definition);\n\tif (owner) bashToolOwners.set(tool.execute, owner);\n\tObject.assign(tool, {\n\t\tpromptSnippet: definition.promptSnippet,\n\t\tpromptGuidelines: definition.promptGuidelines,\n\t});\n\treturn tool;\n}\n"]}
@@ -19,6 +19,12 @@ export declare function restoreLineEndings(text: string, ending: "\r\n" | "\n"):
19
19
  * - Normalize special Unicode spaces to regular space
20
20
  */
21
21
  export declare function normalizeForFuzzyMatch(text: string): string;
22
+ /**
23
+ * Let go of what was remembered for an edit of `normalizedContent` (applyEditsToNormalizedContent's input) into
24
+ * `newContent`, once the edit is written: the file has changed, so nothing normalizes or diffs those contents
25
+ * again. What was remembered for other contents, such as another edit's preview, is kept until it expires.
26
+ */
27
+ export declare function releaseEditDiffCaches(normalizedContent: string, newContent: string): void;
22
28
  interface MatchedEdit {
23
29
  editIndex: number;
24
30
  matchIndex: number;
@@ -74,7 +80,7 @@ export declare function fuzzyFindText(content: string, oldText: string): FuzzyMa
74
80
  * Apply one or more exact-text replacements to LF-normalized content.
75
81
  *
76
82
  * All edits are matched against the same original content. Replacements are
77
- * then applied in reverse order so offsets remain stable. If any edit needs
83
+ * then spliced from the original in offset order. If any edit needs
78
84
  * fuzzy matching, the operation runs in fuzzy-normalized content space and then
79
85
  * overlays those line-level changes onto the original content so unchanged line
80
86
  * blocks keep their original bytes.
@@ -1 +1 @@
1
- {"version":3,"file":"edit-diff.d.ts","sourceRoot":"","sources":["../../../src/core/tools/edit-diff.ts"],"names":[],"mappings":"AACA;;GAEG;AAOH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM/D;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,eAAe,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,MAAM,CAmC5G;AAcD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAE9E;AAcD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqB3D;AA0BD,UAAU,WAAW;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACh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