@namzu/cli 60.2.0 → 61.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (511) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/chunks/{acp-JK2QIS46.js → acp-Q3IA5XHU.js} +294 -133
  4. package/dist/chunks/acp-Q3IA5XHU.js.map +6 -0
  5. package/dist/chunks/{activity-command-GVJPMWET.js → activity-command-PXOMQCVV.js} +14 -14
  6. package/dist/chunks/{add-CGO3YK5H.js → add-HIIKDZDN.js} +21 -21
  7. package/dist/chunks/{agent-SAQFBDBT.js → agent-5OM6GGWO.js} +55 -53
  8. package/dist/chunks/agent-session-MNEGO6RD.js +95 -0
  9. package/dist/chunks/{apply-at-exit-A5NGU6JC.js → apply-at-exit-2TUEV3TN.js} +7 -7
  10. package/dist/chunks/{archive-PCWIBYNU.js → archive-ESYECN4Y.js} +12 -12
  11. package/dist/chunks/{auth-G2JID2R3.js → auth-WA6ZXNXM.js} +12 -12
  12. package/dist/chunks/{bin-main-AKFYLWY5.js → bin-main-Y5FDOG2X.js} +8 -8
  13. package/dist/chunks/{binding-MQADHVXY.js → binding-7ZF533IJ.js} +3 -3
  14. package/dist/chunks/{browser-DGWRWK5R.js → browser-HFAVORW3.js} +7 -7
  15. package/dist/chunks/{chat-SAQKZTEU.js → chat-BVA2BLKE.js} +17 -17
  16. package/dist/chunks/{chunk-ZYEO2QIZ.js → chunk-2SXME4FG.js} +2 -2
  17. package/dist/chunks/{chunk-GIHUEVUN.js → chunk-2ZA7XJ63.js} +3 -3
  18. package/dist/chunks/{chunk-LCVOU7TV.js → chunk-3CEL5P45.js} +2 -2
  19. package/dist/chunks/{chunk-BMLBUAIK.js → chunk-3DCQNM64.js} +7 -7
  20. package/dist/chunks/{chunk-JWBXEQJV.js → chunk-3KCGBW3F.js} +3 -3
  21. package/dist/chunks/{chunk-ERH6Q62K.js → chunk-3RDKZZQE.js} +2 -2
  22. package/dist/chunks/{chunk-F74JCZW3.js → chunk-5KRUNLE7.js} +2 -2
  23. package/dist/chunks/{chunk-FXXJJILJ.js → chunk-5M44QX4G.js} +3 -3
  24. package/dist/chunks/{chunk-NQVJ7ZSD.js → chunk-5VKCUXB2.js} +8 -6
  25. package/dist/chunks/chunk-5VKCUXB2.js.map +6 -0
  26. package/dist/chunks/{chunk-MTKPKUW2.js → chunk-65ROGOIM.js} +9 -9
  27. package/dist/chunks/{chunk-VPAQNK6O.js → chunk-65ZRPJA5.js} +3 -3
  28. package/dist/chunks/{chunk-LDGA7WT2.js → chunk-6FGEPFFB.js} +2 -2
  29. package/dist/chunks/{chunk-KFXJRJLP.js → chunk-6PEEUJSR.js} +10 -8
  30. package/dist/chunks/chunk-6PEEUJSR.js.map +6 -0
  31. package/dist/chunks/{chunk-QLY2PN2E.js → chunk-6UWOG6FY.js} +4 -4
  32. package/dist/chunks/{chunk-GQ5QUCUD.js → chunk-6ZZQSHLH.js} +6 -6
  33. package/dist/chunks/{chunk-GQ5QUCUD.js.map → chunk-6ZZQSHLH.js.map} +1 -1
  34. package/dist/chunks/{chunk-A36POSIG.js → chunk-752F23K2.js} +8 -8
  35. package/dist/chunks/{chunk-SRDNEVL6.js → chunk-7BRCXPI3.js} +3 -3
  36. package/dist/chunks/{chunk-JHMJUX7I.js → chunk-7TPWEPUT.js} +3 -3
  37. package/dist/chunks/{chunk-QCT22NQ6.js → chunk-A42WH5C5.js} +2 -2
  38. package/dist/chunks/{chunk-C42E6LPS.js → chunk-AAGA2PWL.js} +17 -6
  39. package/dist/chunks/chunk-AAGA2PWL.js.map +6 -0
  40. package/dist/chunks/{chunk-G47HP3R2.js → chunk-AHV6BJED.js} +2 -2
  41. package/dist/chunks/{chunk-C66BWJKK.js → chunk-AYD4H6VV.js} +2 -2
  42. package/dist/chunks/{chunk-X2255VMX.js → chunk-B7DL5QPS.js} +6 -6
  43. package/dist/chunks/{chunk-3RJHEGKI.js → chunk-BXUNIVZB.js} +13 -6
  44. package/dist/chunks/chunk-BXUNIVZB.js.map +6 -0
  45. package/dist/chunks/{chunk-SCYEHF4C.js → chunk-C3KDKOUV.js} +6 -6
  46. package/dist/chunks/{chunk-KB6FL2IM.js → chunk-CJBRIESJ.js} +3 -3
  47. package/dist/chunks/{chunk-UXKYAXRF.js → chunk-COOEFXWT.js} +2 -2
  48. package/dist/chunks/{chunk-XE4R3UOX.js → chunk-CQ2EGIRN.js} +301 -713
  49. package/dist/chunks/chunk-CQ2EGIRN.js.map +6 -0
  50. package/dist/chunks/{chunk-CDNFVELA.js → chunk-DAZEYCY5.js} +2 -2
  51. package/dist/chunks/{chunk-54Q6LC6C.js → chunk-DL5KZGQK.js} +5 -5
  52. package/dist/chunks/{chunk-TDIEPLAK.js → chunk-DRYK66N3.js} +57 -21
  53. package/dist/chunks/chunk-DRYK66N3.js.map +6 -0
  54. package/dist/chunks/{chunk-46BSYJIZ.js → chunk-EDAEDZ37.js} +3 -3
  55. package/dist/chunks/{chunk-RQRL3UNA.js → chunk-EDLBZSB2.js} +854 -103
  56. package/dist/chunks/chunk-EDLBZSB2.js.map +6 -0
  57. package/dist/chunks/{chunk-BB7YPIH2.js → chunk-EEBDKNNP.js} +4 -4
  58. package/dist/chunks/{chunk-IPDVQ5I4.js → chunk-EOLSGOXC.js} +6 -6
  59. package/dist/chunks/{chunk-XF3ROBXQ.js → chunk-EYFAHVYO.js} +2 -2
  60. package/dist/chunks/{chunk-XKUHSUVJ.js → chunk-EZYMBETQ.js} +2 -2
  61. package/dist/chunks/{chunk-KZBSSQ3E.js → chunk-F5AHQ4RX.js} +2 -2
  62. package/dist/chunks/{chunk-LMVGH3ZY.js → chunk-F5SG7JPB.js} +2 -2
  63. package/dist/chunks/{chunk-EBPWTODI.js → chunk-FHKPEPTE.js} +4 -4
  64. package/dist/chunks/{chunk-XT6WXQSV.js → chunk-FHP4D55L.js} +2 -2
  65. package/dist/chunks/{chunk-5M6OCPY3.js → chunk-FIEADS4A.js} +2 -2
  66. package/dist/chunks/{chunk-GYATIZCJ.js → chunk-G5NS6ASX.js} +3 -3
  67. package/dist/chunks/{chunk-UCFJ6RKM.js → chunk-GS7ST2VG.js} +19 -19
  68. package/dist/chunks/{chunk-BUK2ZGHB.js → chunk-GSNTXEOD.js} +4 -4
  69. package/dist/chunks/{chunk-NALMGTSI.js → chunk-HGBVFYQT.js} +4 -4
  70. package/dist/chunks/{chunk-WMNTACZG.js → chunk-HIJXZ6FI.js} +12 -12
  71. package/dist/chunks/{chunk-HN4K4ZKQ.js → chunk-HLYITQWD.js} +10 -10
  72. package/dist/chunks/{chunk-SXPP2XK7.js → chunk-HN2NZD4E.js} +3 -88
  73. package/dist/chunks/chunk-HN2NZD4E.js.map +6 -0
  74. package/dist/chunks/{chunk-RXW4B7VV.js → chunk-HX3ENA3I.js} +2 -2
  75. package/dist/chunks/{chunk-TXU7ILNZ.js → chunk-IWVJDG4L.js} +3 -3
  76. package/dist/chunks/{chunk-4XIVE2HG.js → chunk-J2ITWYQQ.js} +6 -6
  77. package/dist/chunks/{chunk-I4ECQ33I.js → chunk-JR3LFDKN.js} +2 -2
  78. package/dist/chunks/{chunk-IJUWE5CT.js → chunk-JRZSUEK4.js} +102 -79
  79. package/dist/chunks/chunk-JRZSUEK4.js.map +6 -0
  80. package/dist/chunks/{chunk-YO22LLF5.js → chunk-K4PFUUP7.js} +47 -40
  81. package/dist/chunks/chunk-K4PFUUP7.js.map +6 -0
  82. package/dist/chunks/{chunk-3WHACNCY.js → chunk-KDOBJGF2.js} +3 -3
  83. package/dist/chunks/{chunk-EBBT2I5S.js → chunk-KDPGC66S.js} +30 -6
  84. package/dist/chunks/chunk-KDPGC66S.js.map +6 -0
  85. package/dist/chunks/{chunk-ODFGH22V.js → chunk-KKHZG7B2.js} +2 -2
  86. package/dist/chunks/{chunk-UH2G4WTL.js → chunk-KTSPKGEC.js} +4 -4
  87. package/dist/chunks/{chunk-BG5HMTM3.js → chunk-KXBZ7P2A.js} +2 -2
  88. package/dist/chunks/{chunk-6FVLFGX5.js → chunk-KZ5XYWKO.js} +3 -3
  89. package/dist/chunks/{chunk-TJD6WTO4.js → chunk-LKWENSPO.js} +7 -60
  90. package/dist/chunks/chunk-LKWENSPO.js.map +6 -0
  91. package/dist/chunks/{chunk-KWXG6YJL.js → chunk-LLVZON4J.js} +4 -4
  92. package/dist/chunks/{chunk-T4UJA6WY.js → chunk-LNMFADLE.js} +3 -3
  93. package/dist/chunks/{chunk-CXNXWLCM.js → chunk-ME7MQ4P2.js} +2 -2
  94. package/dist/chunks/{chunk-K7576YJQ.js → chunk-MESE2QPT.js} +27 -30
  95. package/dist/chunks/chunk-MESE2QPT.js.map +6 -0
  96. package/dist/chunks/{chunk-VYAUOPZQ.js → chunk-MHESN2FM.js} +3 -3
  97. package/dist/chunks/{chunk-GL3QWKJ4.js → chunk-MKCZB324.js} +2 -2
  98. package/dist/chunks/{chunk-W65KKIU3.js → chunk-NE55T7GN.js} +4 -4
  99. package/dist/chunks/{chunk-3AX344VL.js → chunk-NI2YKSPW.js} +6 -6
  100. package/dist/chunks/{chunk-GJNN3LTG.js → chunk-NQVSTOUH.js} +4 -4
  101. package/dist/chunks/chunk-NSU3TAZZ.js +74 -0
  102. package/dist/chunks/chunk-NSU3TAZZ.js.map +6 -0
  103. package/dist/chunks/{chunk-EBG7PTNK.js → chunk-NVRUHQKC.js} +7 -7
  104. package/dist/chunks/{chunk-SS2CAVVR.js → chunk-O3AEUU3Q.js} +3 -3
  105. package/dist/chunks/{chunk-TA6OUZAJ.js → chunk-OG7MBIKO.js} +5 -5
  106. package/dist/chunks/{chunk-3FWYKOMZ.js → chunk-OGMRGX5M.js} +3 -3
  107. package/dist/chunks/{chunk-OU7LZVZF.js → chunk-PFQQ6YFF.js} +2 -2
  108. package/dist/chunks/{chunk-ZB3BRA2D.js → chunk-PHEL63BK.js} +2 -2
  109. package/dist/chunks/{chunk-4LXNFBRV.js → chunk-PJORD4FZ.js} +9 -9
  110. package/dist/chunks/{chunk-23A7QA2Y.js → chunk-PSUJIMQV.js} +3 -3
  111. package/dist/chunks/{chunk-6V5ZMKMY.js → chunk-PWSMXR6B.js} +9 -9
  112. package/dist/chunks/{chunk-U43ZRILP.js → chunk-PYFAJB35.js} +2 -2
  113. package/dist/chunks/{chunk-B2V73MAH.js → chunk-PYFGTXFQ.js} +5 -5
  114. package/dist/chunks/{chunk-OTPZK6XR.js → chunk-Q5H7EHCH.js} +8 -8
  115. package/dist/chunks/{chunk-WWFL25RW.js → chunk-QH4DQR57.js} +5 -5
  116. package/dist/chunks/{chunk-ANVIW3V7.js → chunk-QR5VVGWU.js} +3 -3
  117. package/dist/chunks/{chunk-JRJABLPG.js → chunk-QR7GTBV3.js} +3 -3
  118. package/dist/chunks/{chunk-Q5YCOVL3.js → chunk-R5BEMFDZ.js} +11 -11
  119. package/dist/chunks/{chunk-FJVYPXGA.js → chunk-RQOE2MRO.js} +2 -2
  120. package/dist/chunks/chunk-RYOZ4HYY.js +1221 -0
  121. package/dist/chunks/chunk-RYOZ4HYY.js.map +6 -0
  122. package/dist/chunks/{chunk-23SFPA2E.js → chunk-RZBIRLZ6.js} +6 -6
  123. package/dist/chunks/{chunk-GGBVZ22F.js → chunk-SLLKDPGZ.js} +3 -3
  124. package/dist/chunks/{chunk-IJEHCF3G.js → chunk-SXI6NW2H.js} +3 -3
  125. package/dist/chunks/{chunk-56PNP5QD.js → chunk-SYJRI5A4.js} +2 -2
  126. package/dist/chunks/{chunk-RDHX3I7Y.js → chunk-T26HDLQS.js} +2 -2
  127. package/dist/chunks/{chunk-NE2HCOZN.js → chunk-TBQQRYS2.js} +5 -5
  128. package/dist/chunks/{chunk-S7CLXBGN.js → chunk-TFREQNR5.js} +20 -12
  129. package/dist/chunks/chunk-TFREQNR5.js.map +6 -0
  130. package/dist/chunks/{chunk-CFDEOI4Y.js → chunk-TQZSXYON.js} +8 -8
  131. package/dist/chunks/{chunk-CJKBFBGI.js → chunk-TSN7J4ZH.js} +2 -2
  132. package/dist/chunks/{chunk-KDUUHCOJ.js → chunk-TT3GLF32.js} +14 -14
  133. package/dist/chunks/{chunk-ZSDIY5RN.js → chunk-TWTZKA46.js} +3 -3
  134. package/dist/chunks/{chunk-SE6W3XFJ.js → chunk-U3OY3T54.js} +34 -16
  135. package/dist/chunks/chunk-U3OY3T54.js.map +6 -0
  136. package/dist/chunks/{chunk-2QGE3SXX.js → chunk-U6DACADN.js} +3 -3
  137. package/dist/chunks/chunk-UBDKPN27.js +150 -0
  138. package/dist/chunks/chunk-UBDKPN27.js.map +6 -0
  139. package/dist/chunks/{chunk-CIN34YEV.js → chunk-UDSY3L6M.js} +3 -3
  140. package/dist/chunks/{chunk-GW3EISER.js → chunk-UOU7PGPZ.js} +2 -2
  141. package/dist/chunks/{chunk-RWSQ6LZO.js → chunk-UY5KPN7B.js} +2 -2
  142. package/dist/chunks/{chunk-6NWMHYW7.js → chunk-V3DMBRE3.js} +2 -2
  143. package/dist/chunks/{chunk-4FIIZXH6.js → chunk-V5K2AOLI.js} +3 -3
  144. package/dist/chunks/{chunk-45N7FGEP.js → chunk-VAJPCN3B.js} +2 -2
  145. package/dist/chunks/{chunk-ALWXYYUB.js → chunk-VIURZHCB.js} +6 -6
  146. package/dist/chunks/{chunk-QWYMJ7QV.js → chunk-VOR32IWQ.js} +4 -4
  147. package/dist/chunks/{chunk-MQAWESBI.js → chunk-W3BDNKTN.js} +4 -4
  148. package/dist/chunks/{chunk-FNRI6CNN.js → chunk-W5GDQFZS.js} +2 -2
  149. package/dist/chunks/{chunk-5IWDLKJL.js → chunk-XWGWQBF7.js} +2 -2
  150. package/dist/chunks/{chunk-YTG2R4XP.js → chunk-Y2HHHKBF.js} +117 -59
  151. package/dist/chunks/chunk-Y2HHHKBF.js.map +6 -0
  152. package/dist/chunks/{chunk-LO5ZQDJW.js → chunk-Y5NGMUDN.js} +2 -2
  153. package/dist/chunks/{chunk-KPSTAZOR.js → chunk-YCODODZO.js} +4 -4
  154. package/dist/chunks/{chunk-BD3FWBRC.js → chunk-YENBRA7T.js} +3 -3
  155. package/dist/chunks/{chunk-CMKZPD4A.js → chunk-YHUAVEOM.js} +2 -2
  156. package/dist/chunks/{chunk-YSXRCN6G.js → chunk-YPNF7YFU.js} +4 -4
  157. package/dist/chunks/{chunk-NSFURVG2.js → chunk-ZCDOMHZU.js} +13 -13
  158. package/dist/chunks/{chunk-FVHWIEVN.js → chunk-ZPOMLH5G.js} +4 -4
  159. package/dist/chunks/{cli-runtime-7CFYKDUH.js → cli-runtime-5IXM6W6M.js} +22 -22
  160. package/dist/chunks/{commands-TSJJ5SKS.js → commands-LOMIOXZ3.js} +6 -6
  161. package/dist/chunks/{config-YMXKEBKC.js → config-UBOJ3N77.js} +12 -12
  162. package/dist/chunks/{cost-Q5I6EXEZ.js → cost-LM34ZHBI.js} +5 -5
  163. package/dist/chunks/{crash-report-OIZCGQMC.js → crash-report-PTHJP6ZC.js} +6 -6
  164. package/dist/chunks/{dist-6NIUYHIK.js → dist-3P6YD6AW.js} +2 -2
  165. package/dist/chunks/{dist-L7OVELHG.js → dist-3W2E4ZVU.js} +16 -2
  166. package/dist/chunks/{dist-UMWBCGJD.js → dist-C7M5OJAH.js} +2 -2
  167. package/dist/chunks/{dist-T5SHTF3J.js → dist-HJYAXRBL.js} +2 -2
  168. package/dist/chunks/{dist-YKLFD4WW.js → dist-LZAIP6RQ.js} +2 -2
  169. package/dist/chunks/{dist-X3YPJ7CH.js → dist-TEFBDQUK.js} +2 -2
  170. package/dist/chunks/{dist-7QSB4QEK.js → dist-Y4YXKFL6.js} +3 -3
  171. package/dist/chunks/{dist-KDSJMMMS.js → dist-ZVUIWK64.js} +2 -2
  172. package/dist/chunks/{doctor-Q6HR67LY.js → doctor-LL6FW4DE.js} +40 -40
  173. package/dist/chunks/{drain-UIWWUYXW.js → drain-AX2SKGAZ.js} +31 -31
  174. package/dist/chunks/drain-AX2SKGAZ.js.map +6 -0
  175. package/dist/chunks/{entry-5U3HTLJ2.js → entry-QT6CMKBN.js} +6 -6
  176. package/dist/chunks/{eval-C4BPRFQT.js → eval-HKAAPPGO.js} +9 -9
  177. package/dist/chunks/{exec-L6FBAXSL.js → exec-DY3B5KGJ.js} +98 -52
  178. package/dist/chunks/exec-DY3B5KGJ.js.map +6 -0
  179. package/dist/chunks/{extension-Z2MHFW3Q.js → extension-55PWXBQY.js} +6 -6
  180. package/dist/chunks/{home-2YQOPOQK.js → home-7KXFLNBX.js} +3 -3
  181. package/dist/chunks/{homes-IOIYROYY.js → homes-WYHCCBK6.js} +5 -5
  182. package/dist/chunks/{hooks-YHLYWVNC.js → hooks-UZ46HYL4.js} +22 -22
  183. package/dist/chunks/{hooks-report-MAUKS7OA.js → hooks-report-RD53ZGON.js} +18 -18
  184. package/dist/chunks/{host-ZW6GWNIA.js → host-NUIEARM2.js} +11 -10
  185. package/dist/chunks/host-queries-OB7OWZI6.js +37 -0
  186. package/dist/chunks/{installed-list-Q5TS47GB.js → installed-list-T3G757YK.js} +4 -4
  187. package/dist/chunks/{learn-RTSHWOHI.js → learn-MTQXTX6E.js} +17 -17
  188. package/dist/chunks/{learn-builtin-FST7GS5S.js → learn-builtin-3SXUVV7J.js} +20 -20
  189. package/dist/chunks/{lifecycle-LKVKPUZM.js → lifecycle-MFXCFSJP.js} +33 -30
  190. package/dist/chunks/{list-73OJ67EN.js → list-M6Y24N5J.js} +18 -18
  191. package/dist/chunks/{live-FWCJIRMD.js → live-UNUQSBVZ.js} +39 -39
  192. package/dist/chunks/{load-KZ6SYV45.js → load-GA4OIEG4.js} +9 -9
  193. package/dist/chunks/{logs-MZVKGL3W.js → logs-LUPWFBWF.js} +4 -4
  194. package/dist/chunks/{mcp-HAY7K2KN.js → mcp-4GD5Y5W7.js} +98 -36
  195. package/dist/chunks/mcp-4GD5Y5W7.js.map +6 -0
  196. package/dist/chunks/{mcp-serve-ZCIH7YJF.js → mcp-serve-RQKZQNPI.js} +17 -17
  197. package/dist/chunks/{message-command-NN54YNRE.js → message-command-L5HAX56P.js} +59 -59
  198. package/dist/chunks/{open-HAIE5EE5.js → open-D6QESFR2.js} +7 -7
  199. package/dist/chunks/{operator-tools-5AV7EL4N.js → operator-tools-CFYHXAZS.js} +15 -15
  200. package/dist/chunks/{output-schema-JAY7Y55N.js → output-schema-WV5RUG66.js} +3 -3
  201. package/dist/chunks/{pal-YBUSIJZN.js → pal-JVR6ZLEI.js} +15 -15
  202. package/dist/chunks/{peers-22YMO74N.js → peers-EK24T2HF.js} +8 -7
  203. package/dist/chunks/{peers-YJLUS5TS.js → peers-NCDTNFJV.js} +20 -19
  204. package/dist/chunks/peers-NCDTNFJV.js.map +6 -0
  205. package/dist/chunks/{plugin-R7LE2MMO.js → plugin-RR4O7D6C.js} +108 -52
  206. package/dist/chunks/plugin-RR4O7D6C.js.map +6 -0
  207. package/dist/chunks/{providers-ENQAHWCZ.js → providers-2CLIPXQ2.js} +10 -10
  208. package/dist/chunks/{providers-VHIHS2BM.js → providers-RTRULUUS.js} +17 -17
  209. package/dist/chunks/{pty-TBASOLRE.js → pty-OHLKFJFA.js} +3 -3
  210. package/dist/chunks/resume-5OWRUFUL.js +25 -0
  211. package/dist/chunks/{resume-command-TBENHCC7.js → resume-command-HIIEMJAT.js} +4 -4
  212. package/dist/chunks/{running-3BBUV4WS.js → running-3BAWMUK4.js} +4 -4
  213. package/dist/chunks/{schedule-CJFF2HQB.js → schedule-OW54ANKO.js} +12 -12
  214. package/dist/chunks/{send-DP64UPWK.js → send-5NIU4WFY.js} +20 -19
  215. package/dist/chunks/send-person-RYBIVAML.js +33 -0
  216. package/dist/chunks/{service-M7WIHDX2.js → service-MGZ4LEVY.js} +33 -30
  217. package/dist/chunks/service-MGZ4LEVY.js.map +6 -0
  218. package/dist/chunks/{setting-cli-3UJ5BDX5.js → setting-cli-CHPHJSAM.js} +12 -12
  219. package/dist/chunks/{skills-LB4UCHH4.js → skills-6DNVYWKR.js} +26 -26
  220. package/dist/chunks/{start-check-TSHXEFFO.js → start-check-MHUGGAYJ.js} +2 -2
  221. package/dist/chunks/{startup-failure-HVFTACQS.js → startup-failure-R2AIVZYU.js} +2 -2
  222. package/dist/chunks/{state-KARPDITG.js → state-2WEGEDJ5.js} +19 -19
  223. package/dist/chunks/{store-AX2M43UO.js → store-MCRRV4BB.js} +3 -3
  224. package/dist/chunks/{store-JGMG724W.js → store-RITSVC5A.js} +4 -4
  225. package/dist/chunks/{store-4WF32HQH.js → store-UFRLA47W.js} +8 -8
  226. package/dist/chunks/{store-HSOMNN6C.js → store-WH3C3EPV.js} +12 -12
  227. package/dist/chunks/{tui-56AJ2YCR.js → tui-5QS4AAMU.js} +98 -96
  228. package/dist/chunks/tui-5QS4AAMU.js.map +6 -0
  229. package/dist/chunks/{update-53YPVRE2.js → update-3VXQAKVL.js} +8 -8
  230. package/dist/chunks/{watch-FBDWIRVJ.js → watch-PMFTONTW.js} +102 -100
  231. package/dist/chunks/watch-PMFTONTW.js.map +6 -0
  232. package/dist/chunks/{workspaces-GSWBAVOT.js → workspaces-N7A3JNL4.js} +16 -15
  233. package/dist/chunks/workspaces-N7A3JNL4.js.map +6 -0
  234. package/dist/chunks/{worktree-PGG3362T.js → worktree-6L5FLMVI.js} +24 -24
  235. package/dist/cli.d.ts.map +1 -1
  236. package/dist/commands/acp.d.ts +8 -1
  237. package/dist/commands/acp.d.ts.map +1 -1
  238. package/dist/commands/desktop-host-plugins.d.ts +28 -1
  239. package/dist/commands/desktop-host-plugins.d.ts.map +1 -1
  240. package/dist/commands/desktop-host.d.ts +20 -1
  241. package/dist/commands/desktop-host.d.ts.map +1 -1
  242. package/dist/commands/drain.d.ts.map +1 -1
  243. package/dist/commands/exec-browser.d.ts +19 -0
  244. package/dist/commands/exec-browser.d.ts.map +1 -0
  245. package/dist/commands/exec-flags.d.ts +11 -2
  246. package/dist/commands/exec-flags.d.ts.map +1 -1
  247. package/dist/commands/exec-json.d.ts.map +1 -1
  248. package/dist/commands/exec.d.ts.map +1 -1
  249. package/dist/commands/mcp.d.ts +16 -1
  250. package/dist/commands/mcp.d.ts.map +1 -1
  251. package/dist/commands/plugin-install.d.ts +6 -0
  252. package/dist/commands/plugin-install.d.ts.map +1 -1
  253. package/dist/commands/plugin-records.d.ts +3 -0
  254. package/dist/commands/plugin-records.d.ts.map +1 -1
  255. package/dist/commands/plugin.d.ts.map +1 -1
  256. package/dist/config/load.d.ts.map +1 -1
  257. package/dist/config/schema.d.ts +23 -3
  258. package/dist/config/schema.d.ts.map +1 -1
  259. package/dist/config/session-options.d.ts +116 -0
  260. package/dist/config/session-options.d.ts.map +1 -1
  261. package/dist/config/settings-descriptors.d.ts.map +1 -1
  262. package/dist/index.js +40 -40
  263. package/dist/integrations/archive/zip.d.ts +8 -1
  264. package/dist/integrations/archive/zip.d.ts.map +1 -1
  265. package/dist/integrations/mcp/plugin-remote.d.ts +4 -0
  266. package/dist/integrations/mcp/plugin-remote.d.ts.map +1 -1
  267. package/dist/integrations/peers/process-ancestry.d.ts +10 -0
  268. package/dist/integrations/peers/process-ancestry.d.ts.map +1 -1
  269. package/dist/integrations/plugins/fetch/archive.d.ts.map +1 -1
  270. package/dist/integrations/plugins/fetch/git.d.ts +13 -3
  271. package/dist/integrations/plugins/fetch/git.d.ts.map +1 -1
  272. package/dist/integrations/plugins/fetch/policy.d.ts +40 -0
  273. package/dist/integrations/plugins/fetch/policy.d.ts.map +1 -0
  274. package/dist/integrations/plugins/fetch/source.d.ts +8 -10
  275. package/dist/integrations/plugins/fetch/source.d.ts.map +1 -1
  276. package/dist/integrations/plugins/fetch/url.d.ts +16 -4
  277. package/dist/integrations/plugins/fetch/url.d.ts.map +1 -1
  278. package/dist/integrations/plugins/files.d.ts.map +1 -1
  279. package/dist/integrations/plugins/install-manifest.d.ts +11 -0
  280. package/dist/integrations/plugins/install-manifest.d.ts.map +1 -1
  281. package/dist/integrations/plugins/install-plan.d.ts.map +1 -1
  282. package/dist/integrations/plugins/install-preview.d.ts +1 -2
  283. package/dist/integrations/plugins/install-preview.d.ts.map +1 -1
  284. package/dist/integrations/plugins/install.d.ts.map +1 -1
  285. package/dist/integrations/plugins/installed-source.d.ts +25 -0
  286. package/dist/integrations/plugins/installed-source.d.ts.map +1 -1
  287. package/dist/integrations/plugins/inventory.d.ts.map +1 -1
  288. package/dist/integrations/plugins/remote-marketplace.d.ts +16 -2
  289. package/dist/integrations/plugins/remote-marketplace.d.ts.map +1 -1
  290. package/dist/integrations/plugins/runtime.d.ts.map +1 -1
  291. package/dist/integrations/plugins/surface.d.ts +3 -1
  292. package/dist/integrations/plugins/surface.d.ts.map +1 -1
  293. package/dist/integrations/plugins/update-compare.d.ts +3 -3
  294. package/dist/integrations/plugins/update-compare.d.ts.map +1 -1
  295. package/dist/integrations/plugins/validate.d.ts.map +1 -1
  296. package/dist/permissions/send-floor.d.ts +7 -0
  297. package/dist/permissions/send-floor.d.ts.map +1 -1
  298. package/dist/schedule/fire/fire.d.ts.map +1 -1
  299. package/dist/schedule/policy.d.ts.map +1 -1
  300. package/dist/skills/skill-shell.d.ts +9 -5
  301. package/dist/skills/skill-shell.d.ts.map +1 -1
  302. package/dist/tui/App.d.ts.map +1 -1
  303. package/dist/tui/agent.d.ts +25 -4
  304. package/dist/tui/agent.d.ts.map +1 -1
  305. package/dist/tui/computer-use-screen-approval.d.ts +11 -1
  306. package/dist/tui/computer-use-screen-approval.d.ts.map +1 -1
  307. package/package.json +6 -6
  308. package/dist/chunks/acp-JK2QIS46.js.map +0 -6
  309. package/dist/chunks/agent-session-U7N25MKG.js +0 -95
  310. package/dist/chunks/chunk-3RJHEGKI.js.map +0 -6
  311. package/dist/chunks/chunk-C42E6LPS.js.map +0 -6
  312. package/dist/chunks/chunk-EBBT2I5S.js.map +0 -6
  313. package/dist/chunks/chunk-IJUWE5CT.js.map +0 -6
  314. package/dist/chunks/chunk-K7576YJQ.js.map +0 -6
  315. package/dist/chunks/chunk-KFXJRJLP.js.map +0 -6
  316. package/dist/chunks/chunk-NQVJ7ZSD.js.map +0 -6
  317. package/dist/chunks/chunk-QFJMWRMW.js +0 -472
  318. package/dist/chunks/chunk-QFJMWRMW.js.map +0 -6
  319. package/dist/chunks/chunk-RQRL3UNA.js.map +0 -6
  320. package/dist/chunks/chunk-S7CLXBGN.js.map +0 -6
  321. package/dist/chunks/chunk-SE6W3XFJ.js.map +0 -6
  322. package/dist/chunks/chunk-SXPP2XK7.js.map +0 -6
  323. package/dist/chunks/chunk-TDIEPLAK.js.map +0 -6
  324. package/dist/chunks/chunk-TJD6WTO4.js.map +0 -6
  325. package/dist/chunks/chunk-XE4R3UOX.js.map +0 -6
  326. package/dist/chunks/chunk-YO22LLF5.js.map +0 -6
  327. package/dist/chunks/chunk-YTG2R4XP.js.map +0 -6
  328. package/dist/chunks/drain-UIWWUYXW.js.map +0 -6
  329. package/dist/chunks/exec-L6FBAXSL.js.map +0 -6
  330. package/dist/chunks/host-queries-YRK46ZNS.js +0 -37
  331. package/dist/chunks/mcp-HAY7K2KN.js.map +0 -6
  332. package/dist/chunks/peers-YJLUS5TS.js.map +0 -6
  333. package/dist/chunks/plugin-R7LE2MMO.js.map +0 -6
  334. package/dist/chunks/resume-OM6RDPW5.js +0 -25
  335. package/dist/chunks/send-person-C676B4SJ.js +0 -32
  336. package/dist/chunks/service-M7WIHDX2.js.map +0 -6
  337. package/dist/chunks/tui-56AJ2YCR.js.map +0 -6
  338. package/dist/chunks/watch-FBDWIRVJ.js.map +0 -6
  339. package/dist/chunks/workspaces-GSWBAVOT.js.map +0 -6
  340. /package/dist/chunks/{activity-command-GVJPMWET.js.map → activity-command-PXOMQCVV.js.map} +0 -0
  341. /package/dist/chunks/{add-CGO3YK5H.js.map → add-HIIKDZDN.js.map} +0 -0
  342. /package/dist/chunks/{agent-SAQFBDBT.js.map → agent-5OM6GGWO.js.map} +0 -0
  343. /package/dist/chunks/{agent-session-U7N25MKG.js.map → agent-session-MNEGO6RD.js.map} +0 -0
  344. /package/dist/chunks/{apply-at-exit-A5NGU6JC.js.map → apply-at-exit-2TUEV3TN.js.map} +0 -0
  345. /package/dist/chunks/{archive-PCWIBYNU.js.map → archive-ESYECN4Y.js.map} +0 -0
  346. /package/dist/chunks/{auth-G2JID2R3.js.map → auth-WA6ZXNXM.js.map} +0 -0
  347. /package/dist/chunks/{bin-main-AKFYLWY5.js.map → bin-main-Y5FDOG2X.js.map} +0 -0
  348. /package/dist/chunks/{binding-MQADHVXY.js.map → binding-7ZF533IJ.js.map} +0 -0
  349. /package/dist/chunks/{browser-DGWRWK5R.js.map → browser-HFAVORW3.js.map} +0 -0
  350. /package/dist/chunks/{chat-SAQKZTEU.js.map → chat-BVA2BLKE.js.map} +0 -0
  351. /package/dist/chunks/{chunk-ZYEO2QIZ.js.map → chunk-2SXME4FG.js.map} +0 -0
  352. /package/dist/chunks/{chunk-GIHUEVUN.js.map → chunk-2ZA7XJ63.js.map} +0 -0
  353. /package/dist/chunks/{chunk-LCVOU7TV.js.map → chunk-3CEL5P45.js.map} +0 -0
  354. /package/dist/chunks/{chunk-BMLBUAIK.js.map → chunk-3DCQNM64.js.map} +0 -0
  355. /package/dist/chunks/{chunk-JWBXEQJV.js.map → chunk-3KCGBW3F.js.map} +0 -0
  356. /package/dist/chunks/{chunk-ERH6Q62K.js.map → chunk-3RDKZZQE.js.map} +0 -0
  357. /package/dist/chunks/{chunk-F74JCZW3.js.map → chunk-5KRUNLE7.js.map} +0 -0
  358. /package/dist/chunks/{chunk-FXXJJILJ.js.map → chunk-5M44QX4G.js.map} +0 -0
  359. /package/dist/chunks/{chunk-MTKPKUW2.js.map → chunk-65ROGOIM.js.map} +0 -0
  360. /package/dist/chunks/{chunk-VPAQNK6O.js.map → chunk-65ZRPJA5.js.map} +0 -0
  361. /package/dist/chunks/{chunk-LDGA7WT2.js.map → chunk-6FGEPFFB.js.map} +0 -0
  362. /package/dist/chunks/{chunk-QLY2PN2E.js.map → chunk-6UWOG6FY.js.map} +0 -0
  363. /package/dist/chunks/{chunk-A36POSIG.js.map → chunk-752F23K2.js.map} +0 -0
  364. /package/dist/chunks/{chunk-SRDNEVL6.js.map → chunk-7BRCXPI3.js.map} +0 -0
  365. /package/dist/chunks/{chunk-JHMJUX7I.js.map → chunk-7TPWEPUT.js.map} +0 -0
  366. /package/dist/chunks/{chunk-QCT22NQ6.js.map → chunk-A42WH5C5.js.map} +0 -0
  367. /package/dist/chunks/{chunk-G47HP3R2.js.map → chunk-AHV6BJED.js.map} +0 -0
  368. /package/dist/chunks/{chunk-C66BWJKK.js.map → chunk-AYD4H6VV.js.map} +0 -0
  369. /package/dist/chunks/{chunk-X2255VMX.js.map → chunk-B7DL5QPS.js.map} +0 -0
  370. /package/dist/chunks/{chunk-SCYEHF4C.js.map → chunk-C3KDKOUV.js.map} +0 -0
  371. /package/dist/chunks/{chunk-KB6FL2IM.js.map → chunk-CJBRIESJ.js.map} +0 -0
  372. /package/dist/chunks/{chunk-UXKYAXRF.js.map → chunk-COOEFXWT.js.map} +0 -0
  373. /package/dist/chunks/{chunk-CDNFVELA.js.map → chunk-DAZEYCY5.js.map} +0 -0
  374. /package/dist/chunks/{chunk-54Q6LC6C.js.map → chunk-DL5KZGQK.js.map} +0 -0
  375. /package/dist/chunks/{chunk-46BSYJIZ.js.map → chunk-EDAEDZ37.js.map} +0 -0
  376. /package/dist/chunks/{chunk-BB7YPIH2.js.map → chunk-EEBDKNNP.js.map} +0 -0
  377. /package/dist/chunks/{chunk-IPDVQ5I4.js.map → chunk-EOLSGOXC.js.map} +0 -0
  378. /package/dist/chunks/{chunk-XF3ROBXQ.js.map → chunk-EYFAHVYO.js.map} +0 -0
  379. /package/dist/chunks/{chunk-XKUHSUVJ.js.map → chunk-EZYMBETQ.js.map} +0 -0
  380. /package/dist/chunks/{chunk-KZBSSQ3E.js.map → chunk-F5AHQ4RX.js.map} +0 -0
  381. /package/dist/chunks/{chunk-LMVGH3ZY.js.map → chunk-F5SG7JPB.js.map} +0 -0
  382. /package/dist/chunks/{chunk-EBPWTODI.js.map → chunk-FHKPEPTE.js.map} +0 -0
  383. /package/dist/chunks/{chunk-XT6WXQSV.js.map → chunk-FHP4D55L.js.map} +0 -0
  384. /package/dist/chunks/{chunk-5M6OCPY3.js.map → chunk-FIEADS4A.js.map} +0 -0
  385. /package/dist/chunks/{chunk-GYATIZCJ.js.map → chunk-G5NS6ASX.js.map} +0 -0
  386. /package/dist/chunks/{chunk-UCFJ6RKM.js.map → chunk-GS7ST2VG.js.map} +0 -0
  387. /package/dist/chunks/{chunk-BUK2ZGHB.js.map → chunk-GSNTXEOD.js.map} +0 -0
  388. /package/dist/chunks/{chunk-NALMGTSI.js.map → chunk-HGBVFYQT.js.map} +0 -0
  389. /package/dist/chunks/{chunk-WMNTACZG.js.map → chunk-HIJXZ6FI.js.map} +0 -0
  390. /package/dist/chunks/{chunk-HN4K4ZKQ.js.map → chunk-HLYITQWD.js.map} +0 -0
  391. /package/dist/chunks/{chunk-RXW4B7VV.js.map → chunk-HX3ENA3I.js.map} +0 -0
  392. /package/dist/chunks/{chunk-TXU7ILNZ.js.map → chunk-IWVJDG4L.js.map} +0 -0
  393. /package/dist/chunks/{chunk-4XIVE2HG.js.map → chunk-J2ITWYQQ.js.map} +0 -0
  394. /package/dist/chunks/{chunk-I4ECQ33I.js.map → chunk-JR3LFDKN.js.map} +0 -0
  395. /package/dist/chunks/{chunk-3WHACNCY.js.map → chunk-KDOBJGF2.js.map} +0 -0
  396. /package/dist/chunks/{chunk-ODFGH22V.js.map → chunk-KKHZG7B2.js.map} +0 -0
  397. /package/dist/chunks/{chunk-UH2G4WTL.js.map → chunk-KTSPKGEC.js.map} +0 -0
  398. /package/dist/chunks/{chunk-BG5HMTM3.js.map → chunk-KXBZ7P2A.js.map} +0 -0
  399. /package/dist/chunks/{chunk-6FVLFGX5.js.map → chunk-KZ5XYWKO.js.map} +0 -0
  400. /package/dist/chunks/{chunk-KWXG6YJL.js.map → chunk-LLVZON4J.js.map} +0 -0
  401. /package/dist/chunks/{chunk-T4UJA6WY.js.map → chunk-LNMFADLE.js.map} +0 -0
  402. /package/dist/chunks/{chunk-CXNXWLCM.js.map → chunk-ME7MQ4P2.js.map} +0 -0
  403. /package/dist/chunks/{chunk-VYAUOPZQ.js.map → chunk-MHESN2FM.js.map} +0 -0
  404. /package/dist/chunks/{chunk-GL3QWKJ4.js.map → chunk-MKCZB324.js.map} +0 -0
  405. /package/dist/chunks/{chunk-W65KKIU3.js.map → chunk-NE55T7GN.js.map} +0 -0
  406. /package/dist/chunks/{chunk-3AX344VL.js.map → chunk-NI2YKSPW.js.map} +0 -0
  407. /package/dist/chunks/{chunk-GJNN3LTG.js.map → chunk-NQVSTOUH.js.map} +0 -0
  408. /package/dist/chunks/{chunk-EBG7PTNK.js.map → chunk-NVRUHQKC.js.map} +0 -0
  409. /package/dist/chunks/{chunk-SS2CAVVR.js.map → chunk-O3AEUU3Q.js.map} +0 -0
  410. /package/dist/chunks/{chunk-TA6OUZAJ.js.map → chunk-OG7MBIKO.js.map} +0 -0
  411. /package/dist/chunks/{chunk-3FWYKOMZ.js.map → chunk-OGMRGX5M.js.map} +0 -0
  412. /package/dist/chunks/{chunk-OU7LZVZF.js.map → chunk-PFQQ6YFF.js.map} +0 -0
  413. /package/dist/chunks/{chunk-ZB3BRA2D.js.map → chunk-PHEL63BK.js.map} +0 -0
  414. /package/dist/chunks/{chunk-4LXNFBRV.js.map → chunk-PJORD4FZ.js.map} +0 -0
  415. /package/dist/chunks/{chunk-23A7QA2Y.js.map → chunk-PSUJIMQV.js.map} +0 -0
  416. /package/dist/chunks/{chunk-6V5ZMKMY.js.map → chunk-PWSMXR6B.js.map} +0 -0
  417. /package/dist/chunks/{chunk-U43ZRILP.js.map → chunk-PYFAJB35.js.map} +0 -0
  418. /package/dist/chunks/{chunk-B2V73MAH.js.map → chunk-PYFGTXFQ.js.map} +0 -0
  419. /package/dist/chunks/{chunk-OTPZK6XR.js.map → chunk-Q5H7EHCH.js.map} +0 -0
  420. /package/dist/chunks/{chunk-WWFL25RW.js.map → chunk-QH4DQR57.js.map} +0 -0
  421. /package/dist/chunks/{chunk-ANVIW3V7.js.map → chunk-QR5VVGWU.js.map} +0 -0
  422. /package/dist/chunks/{chunk-JRJABLPG.js.map → chunk-QR7GTBV3.js.map} +0 -0
  423. /package/dist/chunks/{chunk-Q5YCOVL3.js.map → chunk-R5BEMFDZ.js.map} +0 -0
  424. /package/dist/chunks/{chunk-FJVYPXGA.js.map → chunk-RQOE2MRO.js.map} +0 -0
  425. /package/dist/chunks/{chunk-23SFPA2E.js.map → chunk-RZBIRLZ6.js.map} +0 -0
  426. /package/dist/chunks/{chunk-GGBVZ22F.js.map → chunk-SLLKDPGZ.js.map} +0 -0
  427. /package/dist/chunks/{chunk-IJEHCF3G.js.map → chunk-SXI6NW2H.js.map} +0 -0
  428. /package/dist/chunks/{chunk-56PNP5QD.js.map → chunk-SYJRI5A4.js.map} +0 -0
  429. /package/dist/chunks/{chunk-RDHX3I7Y.js.map → chunk-T26HDLQS.js.map} +0 -0
  430. /package/dist/chunks/{chunk-NE2HCOZN.js.map → chunk-TBQQRYS2.js.map} +0 -0
  431. /package/dist/chunks/{chunk-CFDEOI4Y.js.map → chunk-TQZSXYON.js.map} +0 -0
  432. /package/dist/chunks/{chunk-CJKBFBGI.js.map → chunk-TSN7J4ZH.js.map} +0 -0
  433. /package/dist/chunks/{chunk-KDUUHCOJ.js.map → chunk-TT3GLF32.js.map} +0 -0
  434. /package/dist/chunks/{chunk-ZSDIY5RN.js.map → chunk-TWTZKA46.js.map} +0 -0
  435. /package/dist/chunks/{chunk-2QGE3SXX.js.map → chunk-U6DACADN.js.map} +0 -0
  436. /package/dist/chunks/{chunk-CIN34YEV.js.map → chunk-UDSY3L6M.js.map} +0 -0
  437. /package/dist/chunks/{chunk-GW3EISER.js.map → chunk-UOU7PGPZ.js.map} +0 -0
  438. /package/dist/chunks/{chunk-RWSQ6LZO.js.map → chunk-UY5KPN7B.js.map} +0 -0
  439. /package/dist/chunks/{chunk-6NWMHYW7.js.map → chunk-V3DMBRE3.js.map} +0 -0
  440. /package/dist/chunks/{chunk-4FIIZXH6.js.map → chunk-V5K2AOLI.js.map} +0 -0
  441. /package/dist/chunks/{chunk-45N7FGEP.js.map → chunk-VAJPCN3B.js.map} +0 -0
  442. /package/dist/chunks/{chunk-ALWXYYUB.js.map → chunk-VIURZHCB.js.map} +0 -0
  443. /package/dist/chunks/{chunk-QWYMJ7QV.js.map → chunk-VOR32IWQ.js.map} +0 -0
  444. /package/dist/chunks/{chunk-MQAWESBI.js.map → chunk-W3BDNKTN.js.map} +0 -0
  445. /package/dist/chunks/{chunk-FNRI6CNN.js.map → chunk-W5GDQFZS.js.map} +0 -0
  446. /package/dist/chunks/{chunk-5IWDLKJL.js.map → chunk-XWGWQBF7.js.map} +0 -0
  447. /package/dist/chunks/{chunk-LO5ZQDJW.js.map → chunk-Y5NGMUDN.js.map} +0 -0
  448. /package/dist/chunks/{chunk-KPSTAZOR.js.map → chunk-YCODODZO.js.map} +0 -0
  449. /package/dist/chunks/{chunk-BD3FWBRC.js.map → chunk-YENBRA7T.js.map} +0 -0
  450. /package/dist/chunks/{chunk-CMKZPD4A.js.map → chunk-YHUAVEOM.js.map} +0 -0
  451. /package/dist/chunks/{chunk-YSXRCN6G.js.map → chunk-YPNF7YFU.js.map} +0 -0
  452. /package/dist/chunks/{chunk-NSFURVG2.js.map → chunk-ZCDOMHZU.js.map} +0 -0
  453. /package/dist/chunks/{chunk-FVHWIEVN.js.map → chunk-ZPOMLH5G.js.map} +0 -0
  454. /package/dist/chunks/{cli-runtime-7CFYKDUH.js.map → cli-runtime-5IXM6W6M.js.map} +0 -0
  455. /package/dist/chunks/{commands-TSJJ5SKS.js.map → commands-LOMIOXZ3.js.map} +0 -0
  456. /package/dist/chunks/{config-YMXKEBKC.js.map → config-UBOJ3N77.js.map} +0 -0
  457. /package/dist/chunks/{cost-Q5I6EXEZ.js.map → cost-LM34ZHBI.js.map} +0 -0
  458. /package/dist/chunks/{crash-report-OIZCGQMC.js.map → crash-report-PTHJP6ZC.js.map} +0 -0
  459. /package/dist/chunks/{dist-6NIUYHIK.js.map → dist-3P6YD6AW.js.map} +0 -0
  460. /package/dist/chunks/{dist-7QSB4QEK.js.map → dist-3W2E4ZVU.js.map} +0 -0
  461. /package/dist/chunks/{dist-UMWBCGJD.js.map → dist-C7M5OJAH.js.map} +0 -0
  462. /package/dist/chunks/{dist-T5SHTF3J.js.map → dist-HJYAXRBL.js.map} +0 -0
  463. /package/dist/chunks/{dist-YKLFD4WW.js.map → dist-LZAIP6RQ.js.map} +0 -0
  464. /package/dist/chunks/{dist-X3YPJ7CH.js.map → dist-TEFBDQUK.js.map} +0 -0
  465. /package/dist/chunks/{dist-L7OVELHG.js.map → dist-Y4YXKFL6.js.map} +0 -0
  466. /package/dist/chunks/{dist-KDSJMMMS.js.map → dist-ZVUIWK64.js.map} +0 -0
  467. /package/dist/chunks/{doctor-Q6HR67LY.js.map → doctor-LL6FW4DE.js.map} +0 -0
  468. /package/dist/chunks/{entry-5U3HTLJ2.js.map → entry-QT6CMKBN.js.map} +0 -0
  469. /package/dist/chunks/{eval-C4BPRFQT.js.map → eval-HKAAPPGO.js.map} +0 -0
  470. /package/dist/chunks/{extension-Z2MHFW3Q.js.map → extension-55PWXBQY.js.map} +0 -0
  471. /package/dist/chunks/{home-2YQOPOQK.js.map → home-7KXFLNBX.js.map} +0 -0
  472. /package/dist/chunks/{homes-IOIYROYY.js.map → homes-WYHCCBK6.js.map} +0 -0
  473. /package/dist/chunks/{hooks-YHLYWVNC.js.map → hooks-UZ46HYL4.js.map} +0 -0
  474. /package/dist/chunks/{hooks-report-MAUKS7OA.js.map → hooks-report-RD53ZGON.js.map} +0 -0
  475. /package/dist/chunks/{host-ZW6GWNIA.js.map → host-NUIEARM2.js.map} +0 -0
  476. /package/dist/chunks/{host-queries-YRK46ZNS.js.map → host-queries-OB7OWZI6.js.map} +0 -0
  477. /package/dist/chunks/{installed-list-Q5TS47GB.js.map → installed-list-T3G757YK.js.map} +0 -0
  478. /package/dist/chunks/{learn-RTSHWOHI.js.map → learn-MTQXTX6E.js.map} +0 -0
  479. /package/dist/chunks/{learn-builtin-FST7GS5S.js.map → learn-builtin-3SXUVV7J.js.map} +0 -0
  480. /package/dist/chunks/{lifecycle-LKVKPUZM.js.map → lifecycle-MFXCFSJP.js.map} +0 -0
  481. /package/dist/chunks/{list-73OJ67EN.js.map → list-M6Y24N5J.js.map} +0 -0
  482. /package/dist/chunks/{live-FWCJIRMD.js.map → live-UNUQSBVZ.js.map} +0 -0
  483. /package/dist/chunks/{load-KZ6SYV45.js.map → load-GA4OIEG4.js.map} +0 -0
  484. /package/dist/chunks/{logs-MZVKGL3W.js.map → logs-LUPWFBWF.js.map} +0 -0
  485. /package/dist/chunks/{mcp-serve-ZCIH7YJF.js.map → mcp-serve-RQKZQNPI.js.map} +0 -0
  486. /package/dist/chunks/{message-command-NN54YNRE.js.map → message-command-L5HAX56P.js.map} +0 -0
  487. /package/dist/chunks/{open-HAIE5EE5.js.map → open-D6QESFR2.js.map} +0 -0
  488. /package/dist/chunks/{operator-tools-5AV7EL4N.js.map → operator-tools-CFYHXAZS.js.map} +0 -0
  489. /package/dist/chunks/{output-schema-JAY7Y55N.js.map → output-schema-WV5RUG66.js.map} +0 -0
  490. /package/dist/chunks/{pal-YBUSIJZN.js.map → pal-JVR6ZLEI.js.map} +0 -0
  491. /package/dist/chunks/{peers-22YMO74N.js.map → peers-EK24T2HF.js.map} +0 -0
  492. /package/dist/chunks/{providers-ENQAHWCZ.js.map → providers-2CLIPXQ2.js.map} +0 -0
  493. /package/dist/chunks/{providers-VHIHS2BM.js.map → providers-RTRULUUS.js.map} +0 -0
  494. /package/dist/chunks/{pty-TBASOLRE.js.map → pty-OHLKFJFA.js.map} +0 -0
  495. /package/dist/chunks/{resume-OM6RDPW5.js.map → resume-5OWRUFUL.js.map} +0 -0
  496. /package/dist/chunks/{resume-command-TBENHCC7.js.map → resume-command-HIIEMJAT.js.map} +0 -0
  497. /package/dist/chunks/{running-3BBUV4WS.js.map → running-3BAWMUK4.js.map} +0 -0
  498. /package/dist/chunks/{schedule-CJFF2HQB.js.map → schedule-OW54ANKO.js.map} +0 -0
  499. /package/dist/chunks/{send-DP64UPWK.js.map → send-5NIU4WFY.js.map} +0 -0
  500. /package/dist/chunks/{send-person-C676B4SJ.js.map → send-person-RYBIVAML.js.map} +0 -0
  501. /package/dist/chunks/{setting-cli-3UJ5BDX5.js.map → setting-cli-CHPHJSAM.js.map} +0 -0
  502. /package/dist/chunks/{skills-LB4UCHH4.js.map → skills-6DNVYWKR.js.map} +0 -0
  503. /package/dist/chunks/{start-check-TSHXEFFO.js.map → start-check-MHUGGAYJ.js.map} +0 -0
  504. /package/dist/chunks/{startup-failure-HVFTACQS.js.map → startup-failure-R2AIVZYU.js.map} +0 -0
  505. /package/dist/chunks/{state-KARPDITG.js.map → state-2WEGEDJ5.js.map} +0 -0
  506. /package/dist/chunks/{store-4WF32HQH.js.map → store-MCRRV4BB.js.map} +0 -0
  507. /package/dist/chunks/{store-AX2M43UO.js.map → store-RITSVC5A.js.map} +0 -0
  508. /package/dist/chunks/{store-HSOMNN6C.js.map → store-UFRLA47W.js.map} +0 -0
  509. /package/dist/chunks/{store-JGMG724W.js.map → store-WH3C3EPV.js.map} +0 -0
  510. /package/dist/chunks/{update-53YPVRE2.js.map → update-3VXQAKVL.js.map} +0 -0
  511. /package/dist/chunks/{worktree-PGG3362T.js.map → worktree-6L5FLMVI.js.map} +0 -0
@@ -325,7 +325,7 @@ var require_brace_expansion = __commonJS({
325
325
  });
326
326
 
327
327
  // ../sdk/dist/version.js
328
- var VERSION = "69.4.0";
328
+ var VERSION = "70.0.0";
329
329
 
330
330
  // ../sdk/dist/runtime/harness-session/index.js
331
331
  import { posix, win32 } from "node:path";
@@ -24550,6 +24550,67 @@ function isPrivateAddress(address2) {
24550
24550
  return false;
24551
24551
  }
24552
24552
  __name(isPrivateAddress, "isPrivateAddress");
24553
+ async function privateAddressProblem(hostname4, options = {}) {
24554
+ const name3 = hostname4.toLowerCase().replace(/^\[|\]$/g, "");
24555
+ let addresses;
24556
+ if (isIP(name3) !== 0) {
24557
+ addresses = [name3];
24558
+ } else {
24559
+ const resolve46 = options.resolve ?? (async (value) => (await lookup(value, { all: true })).map((r) => r.address));
24560
+ try {
24561
+ addresses = await resolve46(name3, options.signal);
24562
+ } catch (error62) {
24563
+ if (options.proxied === true && !options.signal?.aborted)
24564
+ return void 0;
24565
+ return `${name3} could not be resolved (${error62 instanceof Error ? error62.message : String(error62)}), so nothing here can say where it points`;
24566
+ }
24567
+ if (addresses.length === 0)
24568
+ return `${name3} resolves to no addresses`;
24569
+ }
24570
+ for (const address2 of addresses) {
24571
+ if (isPrivateAddress(address2))
24572
+ return `${name3} resolves to ${address2}, inside this host's own network`;
24573
+ }
24574
+ return void 0;
24575
+ }
24576
+ __name(privateAddressProblem, "privateAddressProblem");
24577
+ function usableProxy(value) {
24578
+ const text12 = (value ?? "").trim();
24579
+ if (text12 === "")
24580
+ return false;
24581
+ try {
24582
+ const url2 = new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(text12) ? text12 : `http://${text12}`);
24583
+ return (url2.protocol === "http:" || url2.protocol === "https:") && url2.hostname !== "";
24584
+ } catch {
24585
+ return false;
24586
+ }
24587
+ }
24588
+ __name(usableProxy, "usableProxy");
24589
+ function bypassesProxy(env, host) {
24590
+ const bare = host.toLowerCase().replace(/^\[|\]$/g, "").replace(/\.+$/, "");
24591
+ const lists = [env.NO_PROXY, env.no_proxy].filter((v) => typeof v === "string");
24592
+ for (const list3 of lists) {
24593
+ for (const raw of list3.split(",")) {
24594
+ const entry = raw.trim().toLowerCase().replace(/:\d+$/, "");
24595
+ if (entry === "")
24596
+ continue;
24597
+ if (entry === "*")
24598
+ return true;
24599
+ const name3 = entry.replace(/^\*?\./, "");
24600
+ if (bare === name3 || bare.endsWith(`.${name3}`))
24601
+ return true;
24602
+ }
24603
+ }
24604
+ return false;
24605
+ }
24606
+ __name(bypassesProxy, "bypassesProxy");
24607
+ function proxyConfigured(env = process.env, host) {
24608
+ const set5 = [env.HTTPS_PROXY, env.https_proxy, env.HTTP_PROXY, env.http_proxy].some(usableProxy);
24609
+ if (!set5)
24610
+ return false;
24611
+ return host === void 0 || !bypassesProxy(env, host);
24612
+ }
24613
+ __name(proxyConfigured, "proxyConfigured");
24553
24614
  function expandHextets(canonical5) {
24554
24615
  const [head3 = "", tail] = canonical5.split("::");
24555
24616
  const front = head3 === "" ? [] : head3.split(":");
@@ -27975,9 +28036,9 @@ function validateAgainstSchema(value, schema) {
27975
28036
  __name(validateAgainstSchema, "validateAgainstSchema");
27976
28037
  function parseJsonText(text12) {
27977
28038
  const trimmed = text12.trim();
27978
- const fenced = /^```(?:json)?\s*\n([\s\S]*?)\n```$/.exec(trimmed);
28039
+ const fenced2 = /^```(?:json)?\s*\n([\s\S]*?)\n```$/.exec(trimmed);
27979
28040
  try {
27980
- return { ok: true, value: JSON.parse(fenced ? fenced[1] : trimmed) };
28041
+ return { ok: true, value: JSON.parse(fenced2 ? fenced2[1] : trimmed) };
27981
28042
  } catch {
27982
28043
  return { ok: false };
27983
28044
  }
@@ -39462,6 +39523,29 @@ var Context = class {
39462
39523
  opaque(reason) {
39463
39524
  this.reasons.add(reason);
39464
39525
  }
39526
+ /**
39527
+ * A name declared `-i` or `-n` evaluates what is later assigned to it as
39528
+ * arithmetic, and an assigned value that holds a subscript runs the
39529
+ * command inside it. The lexer keeps no variables, so when one line does
39530
+ * both, in either order, it is opaque.
39531
+ */
39532
+ integerDeclared = false;
39533
+ bracketSeen = false;
39534
+ declaredArithmetic() {
39535
+ this.integerDeclared = true;
39536
+ if (this.bracketSeen)
39537
+ this.opaque("arithmetic");
39538
+ }
39539
+ /**
39540
+ * A value that may hold a subscript was stored: a literal one, an
39541
+ * expanding one, or one a `read`, `mapfile`, `printf -v`, `getopts` or
39542
+ * loop variable stores. The lexer cannot see what they hold.
39543
+ */
39544
+ bracketAssigned() {
39545
+ this.bracketSeen = true;
39546
+ if (this.integerDeclared)
39547
+ this.opaque("arithmetic");
39548
+ }
39465
39549
  dialects = /* @__PURE__ */ new Map();
39466
39550
  /** The dialect a string is read in. A string read two ways gets the stricter. */
39467
39551
  setDialect(src, dialect) {
@@ -39567,6 +39651,16 @@ var RESERVED = /* @__PURE__ */ new Set([
39567
39651
  ]);
39568
39652
  var COMPOUND_AFTER = /^(?:\(|(?:\{|if|while|until|for|select|case|\[\[)(?=[\s;&|()<>]|$))/;
39569
39653
  var ASSIGNMENT_BUILTINS = /* @__PURE__ */ new Set(["declare", "typeset", "local", "export", "readonly"]);
39654
+ var PLAIN_ARITHMETIC = /^(?:[A-Za-z_][A-Za-z0-9_]*=)?[0-9\s+\-*/%()<>=!&|^~?:,]*$/;
39655
+ function subscriptOrExpands(word2) {
39656
+ return word2.value.includes("[") || word2.expands;
39657
+ }
39658
+ __name(subscriptOrExpands, "subscriptOrExpands");
39659
+ function subscriptWithExpansion(word2) {
39660
+ return word2.value.includes("[") && (word2.expands || /[$`]/.test(word2.value));
39661
+ }
39662
+ __name(subscriptWithExpansion, "subscriptWithExpansion");
39663
+ var PLAIN_INTEGER_ARGUMENT = /^[A-Za-z_][A-Za-z0-9_]*(?:=[0-9\s+\-*/%()<>=!&|^~?:,]*)?$/;
39570
39664
  var WORD_BREAK = /* @__PURE__ */ new Set([" ", " ", "\n", ";", "&", "|", "(", ")", "<", ">"]);
39571
39665
  var NAME_START = /[A-Za-z_]/;
39572
39666
  var NAME_CHAR = /[A-Za-z0-9_]/;
@@ -39967,6 +40061,7 @@ var Parser = class _Parser {
39967
40061
  if (name3.kind !== "word")
39968
40062
  throw this.unexpected(name3);
39969
40063
  this.context.compoundWords.push(name3.word);
40064
+ this.context.bracketAssigned();
39970
40065
  this.newlines();
39971
40066
  token = this.peek();
39972
40067
  if (token.kind === "word" && !token.word.quoted && token.word.value === "in") {
@@ -40279,6 +40374,7 @@ var Parser = class _Parser {
40279
40374
  this.context.opaque("parser setting");
40280
40375
  }
40281
40376
  }
40377
+ this.inspectArithmeticBuiltin(command);
40282
40378
  const head3 = command.words[command.assignments];
40283
40379
  if (head3 === void 0 || head3.expands)
40284
40380
  return;
@@ -40312,6 +40408,223 @@ var Parser = class _Parser {
40312
40408
  }
40313
40409
  this.nestedShell(nested.shell, nested.payload);
40314
40410
  }
40411
+ /**
40412
+ * `unset` evaluates a subscript in a name operand, `unset 'a[$(cmd)]'`,
40413
+ * and runs `cmd`. `--` and the options `-v`, `-n` and `-f` (also
40414
+ * clustered, `-fv`) are read; the last of `-f` and `-v` decides, and with
40415
+ * `-f` the operands are function names, which evaluate nothing. Any other
40416
+ * word that holds a `[` or expands, a fused `-v'a[$(cmd)]'` included, is
40417
+ * opaque.
40418
+ */
40419
+ inspectUnset(args) {
40420
+ let functions = false;
40421
+ let options = true;
40422
+ for (const word2 of args) {
40423
+ if (options && !word2.expands && word2.value === "--") {
40424
+ options = false;
40425
+ continue;
40426
+ }
40427
+ if (options && !word2.expands && /^-[fvn]+$/.test(word2.value)) {
40428
+ const last = word2.value.replace(/[^fv]/g, "").slice(-1);
40429
+ if (last === "f")
40430
+ functions = true;
40431
+ else if (last === "v")
40432
+ functions = false;
40433
+ continue;
40434
+ }
40435
+ if (functions && !word2.expands)
40436
+ continue;
40437
+ if (subscriptOrExpands(word2)) {
40438
+ this.context.opaque("arithmetic");
40439
+ return;
40440
+ }
40441
+ }
40442
+ }
40443
+ /**
40444
+ * Bash evaluates a name that carries a subscript, `a[$(cmd)]`, as
40445
+ * arithmetic and runs `cmd`, quoted or not. Where that happens: each
40446
+ * `let` argument; `declare -i` (also `typeset`, `local`, clustered flags
40447
+ * such as `-ia`) for each `NAME=value`; the name given to `declare`,
40448
+ * `typeset` or `local` with any flags, to `printf -v` and to `read`; the
40449
+ * operand of `-v` or `-R` in `test` and `[`; and a later plain assignment
40450
+ * to a name declared `-i` or `-n` in the same line. A word that is not
40451
+ * plainly safe is opaque: the line asks instead of showing a command with
40452
+ * no inner one.
40453
+ */
40454
+ inspectArithmeticBuiltin(command) {
40455
+ for (let i2 = 0; i2 < command.assignments; i2 += 1)
40456
+ this.noteBracketAssignment(command.words[i2]);
40457
+ let at2 = command.assignments;
40458
+ for (; ; ) {
40459
+ const word2 = command.words[at2];
40460
+ if (word2 === void 0)
40461
+ return;
40462
+ if (word2.expands) {
40463
+ if (command.words.slice(at2 + 1).some(subscriptWithExpansion))
40464
+ this.context.opaque("arithmetic");
40465
+ return;
40466
+ }
40467
+ if ((word2.value === "builtin" || word2.value === "command") && command.words[at2 + 1]) {
40468
+ let next2 = at2 + 1;
40469
+ for (; ; ) {
40470
+ const option = command.words[next2];
40471
+ if (option === void 0 || option.expands || !option.value.startsWith("-"))
40472
+ break;
40473
+ if (option.value === "--") {
40474
+ next2 += 1;
40475
+ break;
40476
+ }
40477
+ if (option.value === "-p") {
40478
+ next2 += 1;
40479
+ continue;
40480
+ }
40481
+ if (word2.value === "command" && (option.value === "-v" || option.value === "-V"))
40482
+ return;
40483
+ this.context.opaque("arithmetic");
40484
+ return;
40485
+ }
40486
+ const target = command.words[next2];
40487
+ if (target === void 0 || target.expands)
40488
+ return;
40489
+ at2 = next2;
40490
+ continue;
40491
+ }
40492
+ break;
40493
+ }
40494
+ const name3 = command.words[at2].value;
40495
+ const args = command.words.slice(at2 + 1);
40496
+ if (name3 === "eval") {
40497
+ if (args.some(subscriptWithExpansion))
40498
+ this.context.opaque("arithmetic");
40499
+ return;
40500
+ }
40501
+ if (name3 === "let") {
40502
+ if (args.some((word2) => !PLAIN_ARITHMETIC.test(word2.value)))
40503
+ this.context.opaque("arithmetic");
40504
+ return;
40505
+ }
40506
+ if (name3 === "printf") {
40507
+ for (let i2 = 0; i2 < args.length; i2 += 1) {
40508
+ const value = args[i2].value;
40509
+ if (value === "--")
40510
+ break;
40511
+ if (!value.startsWith("-"))
40512
+ break;
40513
+ if (value === "-v") {
40514
+ this.context.bracketAssigned();
40515
+ const target = args[i2 + 1];
40516
+ if (target !== void 0 && subscriptOrExpands(target))
40517
+ this.context.opaque("arithmetic");
40518
+ i2 += 1;
40519
+ continue;
40520
+ }
40521
+ if (value.startsWith("-v")) {
40522
+ this.context.bracketAssigned();
40523
+ if (subscriptOrExpands(args[i2]))
40524
+ this.context.opaque("arithmetic");
40525
+ }
40526
+ }
40527
+ return;
40528
+ }
40529
+ if (name3 === "read") {
40530
+ this.context.bracketAssigned();
40531
+ this.inspectRead(args);
40532
+ return;
40533
+ }
40534
+ if (name3 === "unset") {
40535
+ this.inspectUnset(args);
40536
+ return;
40537
+ }
40538
+ if (name3 === "mapfile" || name3 === "readarray" || name3 === "getopts") {
40539
+ this.context.bracketAssigned();
40540
+ if (args.some((word2) => subscriptOrExpands(word2)))
40541
+ this.context.opaque("arithmetic");
40542
+ return;
40543
+ }
40544
+ if (name3 === "test" || name3 === "[") {
40545
+ for (let i2 = 0; i2 < args.length - 1; i2 += 1) {
40546
+ const value = args[i2].value;
40547
+ if ((value === "-v" || value === "-R") && subscriptOrExpands(args[i2 + 1]))
40548
+ this.context.opaque("arithmetic");
40549
+ }
40550
+ return;
40551
+ }
40552
+ if (name3 !== "declare" && name3 !== "typeset" && name3 !== "local")
40553
+ return;
40554
+ let integer7 = false;
40555
+ let nameref = false;
40556
+ let flags = true;
40557
+ for (const word2 of args) {
40558
+ if (flags && word2.value === "--")
40559
+ flags = false;
40560
+ else if (flags && /^-[A-Za-z]*i/.test(word2.value))
40561
+ integer7 = true;
40562
+ else if (flags && word2.expands && !word2.value.includes("="))
40563
+ integer7 = true;
40564
+ if (flags && /^-[A-Za-z]*n/.test(word2.value))
40565
+ nameref = true;
40566
+ }
40567
+ if (integer7 || nameref)
40568
+ this.context.declaredArithmetic();
40569
+ flags = true;
40570
+ for (const word2 of args) {
40571
+ if (flags && word2.value === "--") {
40572
+ flags = false;
40573
+ continue;
40574
+ }
40575
+ if (flags && word2.value.startsWith("-") && !word2.expands)
40576
+ continue;
40577
+ const equals = word2.value.indexOf("=");
40578
+ const nameFor = equals < 0 ? word2.value : word2.value.slice(0, equals);
40579
+ if (nameFor.includes("[") || word2.expands && /[$`]/.test(nameFor))
40580
+ this.context.opaque("arithmetic");
40581
+ else if (nameref && word2.value.slice(equals + 1).includes("[") && equals >= 0)
40582
+ this.context.opaque("arithmetic");
40583
+ else if (integer7 && !PLAIN_INTEGER_ARGUMENT.test(word2.value))
40584
+ this.context.opaque("arithmetic");
40585
+ else
40586
+ this.noteBracketAssignment(word2);
40587
+ }
40588
+ }
40589
+ /** The names `read` stores into, minus the arguments of its options. */
40590
+ inspectRead(args) {
40591
+ let options = true;
40592
+ for (let i2 = 0; i2 < args.length; i2 += 1) {
40593
+ const value = args[i2].value;
40594
+ if (options && value === "--") {
40595
+ options = false;
40596
+ continue;
40597
+ }
40598
+ if (options && value.startsWith("-") && value.length > 1) {
40599
+ for (let k = 1; k < value.length; k += 1) {
40600
+ const letter = value[k];
40601
+ if ("dinNptu".includes(letter) || letter === "a") {
40602
+ const rest = value.slice(k + 1);
40603
+ const operand = rest.length > 0 ? rest : args[i2 + 1]?.value ?? "";
40604
+ if (rest.length === 0)
40605
+ i2 += 1;
40606
+ if (letter === "a" && operand.includes("["))
40607
+ this.context.opaque("arithmetic");
40608
+ break;
40609
+ }
40610
+ }
40611
+ continue;
40612
+ }
40613
+ if (subscriptOrExpands(args[i2]))
40614
+ this.context.opaque("arithmetic");
40615
+ }
40616
+ }
40617
+ /** A plain `NAME=value` whose value holds a subscript: dangerous once NAME is `-i` or `-n`. */
40618
+ noteBracketAssignment(word2) {
40619
+ if (word2 === void 0)
40620
+ return;
40621
+ const equals = word2.value.indexOf("=");
40622
+ if (equals <= 0)
40623
+ return;
40624
+ const value = word2.value.slice(equals + 1);
40625
+ if (value.includes("[") || word2.expands && /[$`]/.test(value))
40626
+ this.context.bracketAssigned();
40627
+ }
40315
40628
  /** Read the payload of `bash -c payload` as a command line of its own. */
40316
40629
  nestedShell(shell, payload) {
40317
40630
  if (this.depth + 1 >= MAX_SHELL_DEPTH) {
@@ -53505,7 +53818,11 @@ __name(recordModelDuration, "recordModelDuration");
53505
53818
  var PLAN_MODE_REFUSAL = "Refused: plan mode is read-only. Explore with the reading tools, then present the plan as your reply \u2014 what you would change, in which files, and in what order. The user will switch out of plan mode to have it carried out.";
53506
53819
  var STRICT_MODE_REFUSAL = "Refused: this turn only permits tools an explicit rule allows, and no rule covers this call. Asking again will not change it \u2014 either the operator adds a rule, or this has to be done another way.";
53507
53820
  var PLAN_MODE_REFUSAL_WITH_PLAN_FILE = "Refused: plan mode is read-only. Explore with the reading tools (read, glob, grep, and shell commands that only read; run git on its own, not after cd), write the plan to the plan file, then call exit_plan_mode so the user can approve it. Change nothing else before then.";
53821
+ var CLASSIFY_NESTED_REFUSAL = "auto mode reviews only the commands you run yourself, so it does not run this one from inside a skill; run it as a direct call so it can be reviewed";
53508
53822
  function nestedCallModeRefusal(mode, call2) {
53823
+ if (mode === "classify" && !call2.readOnly && !(call2.allowedByRule && call2.ruleTooWide !== true)) {
53824
+ return CLASSIFY_NESTED_REFUSAL;
53825
+ }
53509
53826
  if (mode === "plan" && !call2.readOnly) {
53510
53827
  return "plan mode only runs commands that read, and this one can change something";
53511
53828
  }
@@ -68408,7 +68725,13 @@ var PROTECTED_DIRECTORIES = [
68408
68725
  ".yarn",
68409
68726
  ".mvn"
68410
68727
  ];
68411
- var PROTECTED_NESTED_DIRECTORIES = [[".config", "git"]];
68728
+ var PROTECTED_NESTED_DIRECTORIES = [
68729
+ [".config", "git"],
68730
+ // A skill, agent or command folder is read back as instructions, and a
68731
+ // skill's hooks run commands. `.agents/skills` is one of the folders Namzu
68732
+ // loads skills from, at every level from the checkout root down.
68733
+ [".agents", "skills"]
68734
+ ];
68412
68735
  var PROTECTED_FILE_NAMES = [
68413
68736
  ".gitconfig",
68414
68737
  ".gitmodules",
@@ -68449,14 +68772,19 @@ var PROTECTED_FILE_NAMES = [
68449
68772
  "gradle-wrapper.properties",
68450
68773
  "maven-wrapper.properties",
68451
68774
  ".devcontainer.json",
68452
- "pyrightconfig.json"
68775
+ "pyrightconfig.json",
68776
+ // A skill file declares hooks (shell commands run later, outside the bash
68777
+ // prompt) and the tools it pre-approves, wherever the folder it sits in is.
68778
+ "SKILL.md"
68453
68779
  ];
68780
+ var PROTECTED_ROOT_DIRECTORIES = ["skills"];
68454
68781
  var PROJECT_DIRECTORY_AUTHORED_FOLDERS = [
68455
68782
  "skills",
68456
68783
  "agents",
68457
68784
  "commands"
68458
68785
  ];
68459
68786
  var PROJECT_DIRECTORY = ".namzu";
68787
+ var SKILL_FILE = "skill.md";
68460
68788
  function fold2(name3) {
68461
68789
  return name3.toLowerCase().replace(/ı/g, "i").replace(/ſ/g, "s");
68462
68790
  }
@@ -68464,15 +68792,19 @@ __name(fold2, "fold");
68464
68792
  var AUTHORED = new Set(PROJECT_DIRECTORY_AUTHORED_FOLDERS.map(fold2));
68465
68793
  var DIRECTORIES = new Set(PROTECTED_DIRECTORIES.map(fold2));
68466
68794
  var FILE_NAMES = new Set(PROTECTED_FILE_NAMES.map(fold2));
68795
+ var ROOT_DIRECTORIES = new Set(PROTECTED_ROOT_DIRECTORIES.map(fold2));
68467
68796
  var NESTED = PROTECTED_NESTED_DIRECTORIES.map((sequence) => sequence.map(fold2));
68468
- function isProtectedPath(path2) {
68797
+ function isProtectedPath(path2, options = {}) {
68469
68798
  const segments = path2.split(/[\\/]+/).map(fold2);
68799
+ const first = segments[0];
68800
+ if (first !== void 0 && ROOT_DIRECTORIES.has(first) && segments.length > 1)
68801
+ return true;
68470
68802
  let excused = false;
68471
68803
  for (let index = 0; index < segments.length; index += 1) {
68472
68804
  const segment2 = segments[index];
68473
68805
  if (!DIRECTORIES.has(segment2))
68474
68806
  continue;
68475
- if (segment2 === PROJECT_DIRECTORY && !excused) {
68807
+ if (segment2 === PROJECT_DIRECTORY && !excused && options.remoteSession === true) {
68476
68808
  const next2 = segments[index + 1];
68477
68809
  if (next2 !== void 0 && AUTHORED.has(next2)) {
68478
68810
  excused = true;
@@ -68488,7 +68820,9 @@ function isProtectedPath(path2) {
68488
68820
  }
68489
68821
  }
68490
68822
  const last = segments[segments.length - 1];
68491
- return last !== void 0 && last !== "" && FILE_NAMES.has(last);
68823
+ if (last === void 0 || last === "" || !FILE_NAMES.has(last))
68824
+ return false;
68825
+ return !(excused && last === SKILL_FILE);
68492
68826
  }
68493
68827
  __name(isProtectedPath, "isProtectedPath");
68494
68828
 
@@ -69058,6 +69392,21 @@ var CLASSIFIER_DELEGATION_TOOLS = /* @__PURE__ */ new Set([
69058
69392
  "create_task",
69059
69393
  "continue_task"
69060
69394
  ]);
69395
+ function allowedCallTooWide(call2) {
69396
+ if (CLASSIFIER_DELEGATION_TOOLS.has(call2.name.toLowerCase()))
69397
+ return true;
69398
+ const argument = call2.tool?.commandArgument;
69399
+ if (call2.tool === void 0 || argument === void 0)
69400
+ return false;
69401
+ if ((call2.allowScope ?? allowRuleScope(call2.allowRule ?? null)) === "tool")
69402
+ return true;
69403
+ const line = call2.input?.[argument];
69404
+ if (typeof line !== "string")
69405
+ return true;
69406
+ const reading = readShellLine(line, call2.tool.commandDialect?.({ sandboxed: false }) ?? "sh");
69407
+ return !reading.complete || reading.invocations.some(launchesCode);
69408
+ }
69409
+ __name(allowedCallTooWide, "allowedCallTooWide");
69061
69410
  var ACCEPT_EDITS_SHELL_COMMANDS = /* @__PURE__ */ new Set([
69062
69411
  "mkdir",
69063
69412
  "touch",
@@ -69067,7 +69416,7 @@ var ACCEPT_EDITS_SHELL_COMMANDS = /* @__PURE__ */ new Set([
69067
69416
  "cp",
69068
69417
  "sed"
69069
69418
  ]);
69070
- var SCREEN_CONSENT_UNATTENDED_REFUSAL = "Refused: this call would send what is on the user's screen to the model provider, which a person agrees to once per session, and nobody can be asked in this session. Nothing in this batch ran. Tell the user computer use needs their consent in an interactive session.";
69419
+ var SCREEN_CONSENT_UNATTENDED_REFUSAL = "Refused: this call would send what is on the user's screen to the model provider, which a person agrees to once per session, and nobody can be asked in this session. Nothing in this batch ran. Do not try again in this run, and do not reach the screen another way. Tell the user computer use needs their consent in an interactive session, or a rule that allows this call by name.";
69071
69420
  var SCREEN_CONSENT_DECLINED_FEEDBACK = "The user declined to share their screen in this session. Nothing in this batch ran. Do not take screenshots or read windows again; ask the user how they want to proceed.";
69072
69421
  function directoryToAllow(path2) {
69073
69422
  const last = path2.split(/[\\/]/).pop() ?? "";
@@ -69320,21 +69669,12 @@ function createReviewHandler(options = {}) {
69320
69669
  return [found, baseline].every((reading2) => reading2.outsidePaths.length === 0 && reading2.protectedPaths.length === 0 && reading2.dangerousRemoval === void 0);
69321
69670
  }, "shellFileCommandsInRoots");
69322
69671
  const acceptEditsAllows = /* @__PURE__ */ __name(async (tc, sessionId5) => !tc.authorization?.explicitReview && tc.escalation === void 0 && !tc.isDestructive && tc.requiresApproval !== true && (ACCEPT_EDITS_TOOLS.has(tc.name) || exempt(tc.name, tc.input) || await shellFileCommandsInRoots(tc, sessionId5)), "acceptEditsAllows");
69323
- const allowRuleTooWide = /* @__PURE__ */ __name((tc) => {
69324
- if (CLASSIFIER_DELEGATION_TOOLS.has(tc.name.toLowerCase()))
69325
- return true;
69326
- const tool = toolOf(tc.name);
69327
- const argument = tool?.commandArgument;
69328
- if (tool === void 0 || argument === void 0)
69329
- return false;
69330
- if (tc.authorization?.allowScope === "tool")
69331
- return true;
69332
- const line = tc.input?.[argument];
69333
- if (typeof line !== "string")
69334
- return true;
69335
- const reading = readShellLine(line, tool.commandDialect?.({ sandboxed: false }) ?? "sh");
69336
- return !reading.complete || reading.invocations.some(launchesCode);
69337
- }, "allowRuleTooWide");
69672
+ const allowRuleTooWide = /* @__PURE__ */ __name((tc) => allowedCallTooWide({
69673
+ name: tc.name,
69674
+ tool: toolOf(tc.name),
69675
+ input: tc.input,
69676
+ allowScope: tc.authorization?.allowScope
69677
+ }), "allowRuleTooWide");
69338
69678
  const neverSent = /* @__PURE__ */ __name(async (tc, sessionId5) => {
69339
69679
  if (tc.authorization?.decision === "allow" && !allowRuleTooWide(tc))
69340
69680
  return true;
@@ -69367,7 +69707,9 @@ function createReviewHandler(options = {}) {
69367
69707
  }), "ask");
69368
69708
  const consent = options.screenConsent;
69369
69709
  const sessionKey = String(request.sessionId ?? "");
69370
- if (consent && mode !== "auto" && !consent.sessions.has(sessionKey) && request.toolCalls.some((tc) => tc.authorization?.decision !== "allow" && tc.authorization?.decision !== "deny" && capturesScreen2(tc.name, tc.input))) {
69710
+ if (consent && // `auto` answers for a person who is there; with nobody to ask it cannot
69711
+ // answer for them, so the first look is refused in every mode.
69712
+ (mode !== "auto" || !prompt) && !consent.sessions.has(sessionKey) && request.toolCalls.some((tc) => tc.authorization?.decision !== "allow" && tc.authorization?.decision !== "deny" && capturesScreen2(tc.name, tc.input))) {
69371
69713
  if (mode === "strict")
69372
69714
  return { action: "reject_tools", feedback: STRICT_MODE_REFUSAL };
69373
69715
  if (!prompt)
@@ -77821,14 +78163,32 @@ var ToolExecutor = class {
77821
78163
  }
77822
78164
  this.admitScratchpad(preparedCall);
77823
78165
  const nestedEscalation = await this.escalationOrUnfinished(preparedCall);
77824
- const reviewMode = this.config.reviewMode?.();
77825
- const modeRefusal = reviewMode === void 0 ? void 0 : nestedCallModeRefusal(reviewMode, {
77826
- readOnly: isTrustedReadOnly(nestedTool, preparedInput, this.toolSource(name3)),
77827
- allowedByRule: gateResult?.decision === "allow" && gateResult.matchedRule !== null
77828
- });
78166
+ const askMode = /* @__PURE__ */ __name(() => {
78167
+ const mode = this.config.reviewMode?.();
78168
+ return mode === void 0 ? void 0 : nestedCallModeRefusal(mode, {
78169
+ readOnly: isTrustedReadOnly(nestedTool, preparedInput, this.toolSource(name3)),
78170
+ allowedByRule: gateResult?.decision === "allow" && gateResult.matchedRule !== null,
78171
+ ruleTooWide: gateResult?.decision === "allow" && allowedCallTooWide({
78172
+ name: name3,
78173
+ tool: nestedTool,
78174
+ input: preparedInput,
78175
+ allowRule: gateResult.matchedRule
78176
+ })
78177
+ });
78178
+ }, "askMode");
78179
+ const modeRefusal = askMode();
78180
+ const handedOff2 = options?.handOff === true && modeRefusal === CLASSIFY_NESTED_REFUSAL && gateResult?.decision !== "deny";
77829
78181
  const runGranted = modeRefusal === void 0 && gateResult?.decision === "review" && gateResult.matchedRule === null && options?.allow?.({ name: name3, input: preparedInput }) === true;
77830
78182
  if (nestedEscalation || needsApproval || modeRefusal !== void 0 || gateResult && gateResult.decision !== "allow" && !runGranted) {
77831
- const reason = modeRefusal !== void 0 ? `Blocked: ${modeRefusal}.` : nestedEscalation ? "Blocked: this nested call reaches a protected path, removal floor, outside-root boundary or another safety escalation. Call it directly so it can be reviewed." : needsApproval ? `Blocked: "${name3}" requires the person's approval for every call, and an approval cannot be requested from inside another tool. Call it directly.` : gateResult?.decision === "deny" ? `Blocked by the authorization gate: ${gateResult.reason}` : `Blocked by the authorization gate: this nested call requires an explicit allow rule because an operator review cannot be opened from inside another tool. ${gateResult?.reason}`;
78183
+ if (handedOff2 && options?.beforeRun) {
78184
+ const refusal4 = await options.beforeRun({ name: name3, input: preparedInput, toolUseId: nestedId });
78185
+ signal.throwIfAborted();
78186
+ if (refusal4 !== void 0) {
78187
+ await progress.close();
78188
+ return { success: false, output: "", error: refusal4 };
78189
+ }
78190
+ }
78191
+ const reason = modeRefusal !== void 0 && !(modeRefusal === CLASSIFY_NESTED_REFUSAL && gateResult?.decision === "deny") ? `Blocked: ${modeRefusal}.` : nestedEscalation ? "Blocked: this nested call reaches a protected path, removal floor, outside-root boundary or another safety escalation. Call it directly so it can be reviewed." : needsApproval ? `Blocked: "${name3}" requires the person's approval for every call, and an approval cannot be requested from inside another tool. Call it directly.` : gateResult?.decision === "deny" ? `Blocked by the authorization gate: ${gateResult.reason}` : gateResult?.matchedRule === null ? `Blocked by the authorization gate: this nested call requires an explicit allow rule because an operator review cannot be opened from inside another tool. ${gateResult.reason}` : `Blocked by the authorization gate: a rule or safety check asked for this call, an operator review cannot be opened from inside another tool, and no allow rule lifts that: call it directly so a person can review it. ${gateResult?.reason}`;
77832
78192
  const output2 = deniedToolOutput(name3, reason);
77833
78193
  if (!this.config.recordAudit) {
77834
78194
  throw new Error(`Nested tool "${name3}" was refused, but no durable audit recorder is configured.`);
@@ -77858,7 +78218,12 @@ var ToolExecutor = class {
77858
78218
  outputLength: output2.length,
77859
78219
  ...via ? { via } : {}
77860
78220
  });
77861
- return { success: false, output: "", error: reason };
78221
+ return {
78222
+ success: false,
78223
+ output: "",
78224
+ error: reason,
78225
+ ...handedOff2 ? { data: { handedOff: true } } : {}
78226
+ };
77862
78227
  }
77863
78228
  const { toolBatchId: directBatch, approvedPaths: parentPaths, sandboxEscapeApproved: parentEscape, ...contextWithoutDirectBatch } = context2;
77864
78229
  void directBatch;
@@ -77927,6 +78292,30 @@ var ToolExecutor = class {
77927
78292
  });
77928
78293
  return { success: false, output: "", error: message };
77929
78294
  }
78295
+ const lateRefusal = askMode();
78296
+ if (lateRefusal !== void 0) {
78297
+ const message = `Blocked: ${lateRefusal}.`;
78298
+ if (this.config.recordAudit) {
78299
+ await this.config.recordAudit({
78300
+ what: { action: "tool_call", tool: name3 },
78301
+ outcome: "refused",
78302
+ reason: message
78303
+ });
78304
+ }
78305
+ await progress.close();
78306
+ await this.emitEvent({
78307
+ type: "tool_completed",
78308
+ turnId: this.config.turnId,
78309
+ toolUseId: nestedId,
78310
+ toolName: name3,
78311
+ result: deniedToolOutput(name3, message),
78312
+ isError: true,
78313
+ durationMs: Date.now() - startedAt,
78314
+ outputLength: message.length,
78315
+ ...via ? { via } : {}
78316
+ });
78317
+ return { success: false, output: "", error: message };
78318
+ }
77930
78319
  let result;
77931
78320
  try {
77932
78321
  result = await this.runOnce(name3, preparedInput, childContext, preparedCall.kind === "ready" ? preparedCall.prepared : void 0);
@@ -99838,7 +100227,7 @@ function findInlineShell(text12) {
99838
100227
  running += line.length + 1;
99839
100228
  }
99840
100229
  const endOf = /* @__PURE__ */ __name((i3) => starts[i3] + lines2[i3].length, "endOf");
99841
- const fenced = [];
100230
+ const fenced2 = [];
99842
100231
  let i2 = 0;
99843
100232
  while (i2 < lines2.length) {
99844
100233
  const line = lines2[i2];
@@ -99859,7 +100248,7 @@ function findInlineShell(text12) {
99859
100248
  const start = starts[i2];
99860
100249
  const end = endOf(close);
99861
100250
  markers.push({ kind: "fence", start, end, command, raw: source.slice(start, end) });
99862
- fenced.push({ from: start, to: end });
100251
+ fenced2.push({ from: start, to: end });
99863
100252
  }
99864
100253
  i2 = close + 1;
99865
100254
  continue;
@@ -99879,7 +100268,7 @@ function findInlineShell(text12) {
99879
100268
  }
99880
100269
  }
99881
100270
  const last = close === -1 ? lines2.length - 1 : close;
99882
- fenced.push({ from: starts[i2], to: endOf(last) });
100271
+ fenced2.push({ from: starts[i2], to: endOf(last) });
99883
100272
  i2 = last + 1;
99884
100273
  continue;
99885
100274
  }
@@ -99887,7 +100276,7 @@ function findInlineShell(text12) {
99887
100276
  i2 += 1;
99888
100277
  }
99889
100278
  let at2 = 0;
99890
- for (const gap of fenced) {
100279
+ for (const gap of fenced2) {
99891
100280
  if (gap.from > at2)
99892
100281
  for (const m of inlineMarkers(source, at2, gap.from))
99893
100282
  markers.push(m);
@@ -100050,6 +100439,8 @@ function shellContextAt(prefix) {
100050
100439
  wordStart = false;
100051
100440
  continue;
100052
100441
  }
100442
+ if (i2 === prefix.length - 1)
100443
+ return "unsafe";
100053
100444
  }
100054
100445
  if (c === "`") {
100055
100446
  const end = skipTo(i2 + 1, "`");
@@ -100164,7 +100555,7 @@ function quoteForCommand(value, prefix, dialect) {
100164
100555
  }
100165
100556
  const context2 = shellContextAt(prefix);
100166
100557
  if (context2 === "unsafe" || value.includes("`")) {
100167
- throw new InlineShellError(context2 === "unsafe" ? "A value given to this skill or command would land inside a here-document or a ${...} or arithmetic expansion of a shell command, where it cannot be quoted, so it was not loaded." : "A value given to this skill or command contains a backtick, which cannot be put inside a shell command, so it was not loaded.", "injection");
100558
+ throw new InlineShellError(context2 === "unsafe" ? "A value given to this skill or command would land inside a here-document, a ${...} or arithmetic expansion, or right after a bare $ of a shell command, where it cannot be quoted, so it was not loaded." : "A value given to this skill or command contains a backtick, which cannot be put inside a shell command, so it was not loaded.", "injection");
100168
100559
  }
100169
100560
  if (context2 === "single")
100170
100561
  return value.replaceAll("'", "'\\''");
@@ -100213,6 +100604,7 @@ function substituteEscaped(template, values, options = {}) {
100213
100604
  return marker.kind === "inline" ? marker.start + 2 : neutral.indexOf("\n", marker.start) + 1;
100214
100605
  }, "commandAt");
100215
100606
  let out = "";
100607
+ const landed = [];
100216
100608
  for (const piece of pieces) {
100217
100609
  if (typeof piece === "string") {
100218
100610
  out += piece;
@@ -100220,9 +100612,22 @@ function substituteEscaped(template, values, options = {}) {
100220
100612
  }
100221
100613
  const value = values[piece.token];
100222
100614
  const from = commandAt(piece.at);
100223
- out += from === void 0 ? escapeBetween(value, piece.before, piece.after) : quoteForCommand(value, neutral.slice(from, piece.at), options.dialect ?? hostCommandShell().dialect);
100224
- }
100225
- if (findInlineShell(out).length > markers.length) {
100615
+ const put = from === void 0 ? escapeBetween(value, piece.before, piece.after) : quoteForCommand(value, neutral.slice(from, piece.at), options.dialect ?? hostCommandShell().dialect);
100616
+ landed.push({ at: piece.at, outAt: out.length, length: put.length });
100617
+ out += put;
100618
+ }
100619
+ const inOutput = /* @__PURE__ */ __name((at2) => {
100620
+ let shift = 0;
100621
+ for (const place of landed) {
100622
+ if (place.at >= at2)
100623
+ break;
100624
+ shift += place.length - 1;
100625
+ }
100626
+ return at2 + shift;
100627
+ }, "inOutput");
100628
+ const expected = markers.map((m) => `${m.kind}\0${out.slice(inOutput(m.start), inOutput(m.end))}`);
100629
+ const found = findInlineShell(out).map((m) => `${m.kind}\0${m.raw}`);
100630
+ if (expected.length !== found.length || expected.some((raw, index) => raw !== found[index])) {
100226
100631
  throw new InlineShellError("A value given to this skill or command contains text that would start a shell command, so it was not loaded.", "injection");
100227
100632
  }
100228
100633
  return out;
@@ -100283,6 +100688,7 @@ async function expandInlineShell(text12, options) {
100283
100688
  }
100284
100689
  }
100285
100690
  const replacements = [];
100691
+ const handedOff2 = [];
100286
100692
  let total2 = 0;
100287
100693
  for (const marker of markers) {
100288
100694
  options.signal?.throwIfAborted();
@@ -100296,6 +100702,11 @@ async function expandInlineShell(text12, options) {
100296
100702
  if (outcome.kind === "denied") {
100297
100703
  throw new InlineShellError(`Shell command permission check failed for pattern "${pattern}": ${outcome.reason}`, "permission");
100298
100704
  }
100705
+ if (outcome.kind === "handoff") {
100706
+ handedOff2.push(marker.command);
100707
+ replacements.push(handedOff2.length - 1);
100708
+ continue;
100709
+ }
100299
100710
  if (outcome.kind === "hook") {
100300
100711
  const verdict2 = outcome.verdict;
100301
100712
  if (verdict2.kind === "stop") {
@@ -100323,9 +100734,48 @@ async function expandInlineShell(text12, options) {
100323
100734
  replacements.push(shaped);
100324
100735
  }
100325
100736
  let n = 0;
100326
- return replaceMarkers(source, markers, () => replacements[n++]);
100737
+ if (handedOff2.length === 0) {
100738
+ return replaceMarkers(source, markers, () => replacements[n++]);
100739
+ }
100740
+ const { header: header2, spot } = handOffNotes(handedOff2);
100741
+ const body = replaceMarkers(source, markers, () => {
100742
+ const r = replacements[n++];
100743
+ return typeof r === "number" ? spot(r) : r;
100744
+ });
100745
+ return header2 === "" ? body : `${header2}
100746
+
100747
+ ${body}`;
100327
100748
  }
100328
100749
  __name(expandInlineShell, "expandInlineShell");
100750
+ function fenced(command) {
100751
+ const longest = Math.max(0, ...(command.match(/`+/g) ?? []).map((run2) => run2.length));
100752
+ const fence = "`".repeat(Math.max(3, longest + 1));
100753
+ return `${fence}
100754
+ ${command}
100755
+ ${fence}`;
100756
+ }
100757
+ __name(fenced, "fenced");
100758
+ function handOffNotes(commands) {
100759
+ const plain = /* @__PURE__ */ __name((command) => !/[`\n]/.test(command), "plain");
100760
+ if (commands.length === 1) {
100761
+ const command = commands[0];
100762
+ const lead = "[run this first, exactly as written, with the bash tool and use its output:";
100763
+ const note = plain(command) ? `${lead} \`${command}\`]` : `${lead}]
100764
+ ${fenced(command)}`;
100765
+ return { header: "", spot: /* @__PURE__ */ __name(() => note, "spot") };
100766
+ }
100767
+ const head3 = `[Run these ${commands.length} commands first, exactly as written, with the bash tool, and use their output where each is named below. Run them one per call.]`;
100768
+ const list3 = commands.map((command, i2) => plain(command) ? `${i2 + 1}. \`${command}\`` : `${i2 + 1}.
100769
+ ${fenced(command)}`);
100770
+ return {
100771
+ header: [head3, ...list3].join("\n"),
100772
+ spot: /* @__PURE__ */ __name((i2) => {
100773
+ const command = commands[i2];
100774
+ return plain(command) ? `[output of command ${i2 + 1}, \`${command}\`]` : `[output of command ${i2 + 1}]`;
100775
+ }, "spot")
100776
+ };
100777
+ }
100778
+ __name(handOffNotes, "handOffNotes");
100329
100779
  function replaceMarkers(source, markers, replacement) {
100330
100780
  let out = "";
100331
100781
  let at2 = 0;
@@ -100477,6 +100927,7 @@ function createToolSkillShellHost(options) {
100477
100927
  try {
100478
100928
  result = await dispatch(toolName, { command }, {
100479
100929
  ...options.allow ? { allow: options.allow } : {},
100930
+ ...options.handOff ? { handOff: true } : {},
100480
100931
  beforeRun: /* @__PURE__ */ __name(async () => {
100481
100932
  const verdict2 = await beforeRun();
100482
100933
  if (verdict2.kind === "run")
@@ -100493,11 +100944,17 @@ function createToolSkillShellHost(options) {
100493
100944
  }
100494
100945
  if (hook !== void 0)
100495
100946
  return { kind: "hook", verdict: hook };
100947
+ if (!result.success && handedOff(result))
100948
+ return { kind: "handoff" };
100496
100949
  return outcomeOf(result);
100497
100950
  }
100498
100951
  };
100499
100952
  }
100500
100953
  __name(createToolSkillShellHost, "createToolSkillShellHost");
100954
+ function handedOff(result) {
100955
+ return result.data !== null && typeof result.data === "object" && result.data.handedOff === true;
100956
+ }
100957
+ __name(handedOff, "handedOff");
100501
100958
  function outcomeOf(result) {
100502
100959
  const data2 = result.data !== null && typeof result.data === "object" ? result.data : void 0;
100503
100960
  const exitCode = typeof data2?.exitCode === "number" ? data2.exitCode : void 0;
@@ -106837,6 +107294,24 @@ function resolvePattern(pattern) {
106837
107294
  __name(resolvePattern, "resolvePattern");
106838
107295
 
106839
107296
  // ../sdk/dist/plugin/hook-module/consent.js
107297
+ function hookModuleRecovery(pluginName) {
107298
+ return `Update or fix the plugin, then start a new session, or turn it off with \`namzu plugin disable ${pluginName}\`.`;
107299
+ }
107300
+ __name(hookModuleRecovery, "hookModuleRecovery");
107301
+ function endedSentence(text12) {
107302
+ const trimmed = text12.trimEnd();
107303
+ return /[.!?]$/.test(trimmed) ? trimmed : `${trimmed}.`;
107304
+ }
107305
+ __name(endedSentence, "endedSentence");
107306
+ function withHookModuleRecovery(text12, pluginName) {
107307
+ const recovery = hookModuleRecovery(pluginName);
107308
+ return text12.includes(recovery) ? text12 : `${endedSentence(text12)} ${recovery}`;
107309
+ }
107310
+ __name(withHookModuleRecovery, "withHookModuleRecovery");
107311
+ function hookFailureRecovery(pluginName) {
107312
+ return `Fix the hook, or turn the plugin off with \`namzu plugin disable ${pluginName}\`.`;
107313
+ }
107314
+ __name(hookFailureRecovery, "hookFailureRecovery");
106840
107315
  function summarizeHookModule(scan) {
106841
107316
  const events = /* @__PURE__ */ new Set();
106842
107317
  const notUsed = [];
@@ -106869,9 +107344,17 @@ function summarizeHookModule(scan) {
106869
107344
  };
106870
107345
  }
106871
107346
  __name(summarizeHookModule, "summarizeHookModule");
107347
+ var GATING_EVENTS = /* @__PURE__ */ new Set([
107348
+ "PreToolUse",
107349
+ "PermissionRequest",
107350
+ "PreSkillShellCommand"
107351
+ ]);
106872
107352
  function hookModuleConsentLines(summary2) {
106873
107353
  const lines2 = [];
106874
107354
  lines2.push(summary2.events.length > 0 ? `hooks ${summary2.events.join(", ")}` : "hooks no event that Namzu runs");
107355
+ if (summary2.events.some((event) => GATING_EVENTS.has(event))) {
107356
+ lines2.push("can approve, deny or change tool calls without asking you");
107357
+ }
106875
107358
  if (summary2.runsCommands)
106876
107359
  lines2.push("runs commands");
106877
107360
  if (summary2.readsFiles)
@@ -112634,7 +113117,7 @@ function walk(node2, enter, parents = []) {
112634
113117
  }
112635
113118
  __name(walk, "walk");
112636
113119
  function isFunctionNode(node2) {
112637
- return node2 !== void 0 && (node2.type === "FunctionDeclaration" || node2.type === "FunctionExpression" || node2.type === "ArrowFunctionExpression");
113120
+ return node2 != null && (node2.type === "FunctionDeclaration" || node2.type === "FunctionExpression" || node2.type === "ArrowFunctionExpression");
112638
113121
  }
112639
113122
  __name(isFunctionNode, "isFunctionNode");
112640
113123
  function stringValue(node2) {
@@ -113667,7 +114150,7 @@ function noteHookModule(root, out) {
113667
114150
  code: "hooks-module-scan-refused",
113668
114151
  field: "hooks",
113669
114152
  path: refusal4.file,
113670
- message: `${refusal4.file}:${refusal4.line}: ${refusal4.message}. The module does not run; its plain hook entries still load.`
114153
+ message: `${refusal4.file}:${refusal4.line}: ${refusal4.message}. The module does not run, and a tool call is refused until it is fixed or the plugin is turned off; its plain hook entries still load.`
113671
114154
  });
113672
114155
  }
113673
114156
  if (scan.refusals.length > 0)
@@ -113697,7 +114180,7 @@ function noteHookModule(root, out) {
113697
114180
  code: "hooks-module-used",
113698
114181
  field: "hooks",
113699
114182
  path: located.entry,
113700
- message: `${located.entry} runs in an isolated worker (events: ${summary2.events.join(", ") || "none"}).`
114183
+ message: `${located.entry} runs in a worker with your permissions (events: ${summary2.events.join(", ") || "none"}).`
113701
114184
  });
113702
114185
  }
113703
114186
  __name(noteHookModule, "noteHookModule");
@@ -114891,6 +115374,14 @@ var MAX_STORE_BYTES = 1024 * 1024;
114891
115374
  var DEFAULT_PROCESS_TIMEOUT_MS = 3e4;
114892
115375
  var MAX_PROCESS_TIMEOUT_MS = 10 * 6e4;
114893
115376
  var HTTP_TIMEOUT_MS = 3e4;
115377
+ var MAX_HTTP_REDIRECTS = 5;
115378
+ var CROSS_ORIGIN_HEADERS = /* @__PURE__ */ new Set([
115379
+ "accept",
115380
+ "accept-language",
115381
+ "content-type",
115382
+ "user-agent"
115383
+ ]);
115384
+ var METADATA_HEADER = /metadata/i;
114894
115385
  var STORE_FILE = "hook-module-store.json";
114895
115386
  var CHILD_ENVIRONMENT = [
114896
115387
  "PATH",
@@ -115203,25 +115694,52 @@ function createCapabilityBridge(options) {
115203
115694
  } catch {
115204
115695
  throw new Error(`${url2} is not a URL`);
115205
115696
  }
115206
- if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
115207
- throw new Error(`${parsed.protocol} is not http or https`);
115208
- }
115209
115697
  const spec = isRecord6(init) ? init : {};
115210
115698
  const headers = {};
115211
115699
  if (isRecord6(spec.headers)) {
115212
115700
  for (const [key6, value] of Object.entries(spec.headers)) {
115213
- if (typeof value === "string")
115701
+ if (typeof value === "string" && !METADATA_HEADER.test(key6) && key6.toLowerCase() !== "host")
115214
115702
  headers[key6] = value;
115215
115703
  }
115216
115704
  }
115217
115705
  if (spec.body !== void 0 && typeof spec.body !== "string")
115218
115706
  throw new Error("body is text");
115219
- const response = await fetchImpl(parsed, {
115220
- method: typeof spec.method === "string" ? spec.method : "GET",
115221
- headers,
115222
- ...typeof spec.body === "string" ? { body: spec.body } : {},
115223
- signal: AbortSignal.timeout(HTTP_TIMEOUT_MS)
115224
- });
115707
+ let method = typeof spec.method === "string" ? spec.method : "GET";
115708
+ let body = typeof spec.body === "string" ? spec.body : void 0;
115709
+ const deadline = AbortSignal.timeout(HTTP_TIMEOUT_MS);
115710
+ let response;
115711
+ for (let hop = 0; ; hop++) {
115712
+ await assertReachable(parsed, deadline);
115713
+ response = await fetchImpl(parsed, {
115714
+ method,
115715
+ headers,
115716
+ ...body !== void 0 ? { body } : {},
115717
+ redirect: "manual",
115718
+ signal: deadline
115719
+ });
115720
+ const location = response.headers.get("location");
115721
+ if (response.status < 300 || response.status >= 400 || location === null)
115722
+ break;
115723
+ await response.body?.cancel().catch(() => void 0);
115724
+ if (hop >= MAX_HTTP_REDIRECTS)
115725
+ throw new Error(`${parsed.hostname} redirected too many times`);
115726
+ let next2;
115727
+ try {
115728
+ next2 = new URL(location, parsed);
115729
+ } catch {
115730
+ throw new Error(`${parsed.hostname} redirected to something that is not an address`);
115731
+ }
115732
+ if (next2.origin !== parsed.origin) {
115733
+ for (const key6 of Object.keys(headers))
115734
+ if (!CROSS_ORIGIN_HEADERS.has(key6.toLowerCase()))
115735
+ delete headers[key6];
115736
+ }
115737
+ if (response.status === 303 || (response.status === 301 || response.status === 302) && method === "POST") {
115738
+ method = "GET";
115739
+ body = void 0;
115740
+ }
115741
+ parsed = next2;
115742
+ }
115225
115743
  const bytes2 = Buffer.from(await response.arrayBuffer());
115226
115744
  const answered = {};
115227
115745
  response.headers.forEach((value, key6) => {
@@ -115234,6 +115752,25 @@ function createCapabilityBridge(options) {
115234
115752
  text: bytes2.subarray(0, MAX_CAPABILITY_BYTES).toString("utf8")
115235
115753
  };
115236
115754
  }, "httpFetch");
115755
+ const assertReachable = /* @__PURE__ */ __name(async (target, signal) => {
115756
+ if (target.protocol !== "https:" && target.protocol !== "http:") {
115757
+ throw new Error(`${target.protocol} is not http or https`);
115758
+ }
115759
+ const loopback = target.hostname === "127.0.0.1" || target.hostname === "[::1]";
115760
+ if (target.protocol === "http:" && !(options.allowLoopbackHttp === true && loopback)) {
115761
+ throw new Error(`${target.hostname}: only https addresses are fetched`);
115762
+ }
115763
+ if (options.allowLoopbackHttp === true && loopback)
115764
+ return;
115765
+ const problem = await privateAddressProblem(target.hostname, {
115766
+ ...options.resolve !== void 0 ? { resolve: options.resolve } : {},
115767
+ proxied: options.proxied ?? proxyConfigured(process.env, target.hostname),
115768
+ signal
115769
+ });
115770
+ if (problem !== void 0)
115771
+ throw new Error(`${target.hostname} was not fetched: ${problem}`);
115772
+ }, "assertReachable");
115773
+ const allowedCalls = options.allowedCalls === void 0 ? void 0 : new Set(options.allowedCalls);
115237
115774
  return {
115238
115775
  endProcesses() {
115239
115776
  for (const child of children) {
@@ -115245,6 +115782,9 @@ function createCapabilityBridge(options) {
115245
115782
  children.clear();
115246
115783
  },
115247
115784
  async call(noun, method, args) {
115785
+ if (allowedCalls !== void 0 && !allowedCalls.has(`$.${noun}.${method}`)) {
115786
+ throw new Error(`$.${noun}.${method} is not among the calls this module declares`);
115787
+ }
115248
115788
  switch (`${noun}.${method}`) {
115249
115789
  case "fs.read":
115250
115790
  return fs.read(args);
@@ -115291,9 +115831,75 @@ __name(createCapabilityBridge, "createCapabilityBridge");
115291
115831
 
115292
115832
  // ../sdk/dist/plugin/hook-module/worker-source.js
115293
115833
  var BOOTSTRAP_SOURCE = String.raw`
115294
- (function (send, evaluate) {
115834
+ (function (hostSend, hostEvaluate) {
115295
115835
  'use strict'
115296
115836
  const MAX_LOG = 4000
115837
+ const freeze = Object.freeze
115838
+ const setPrototypeOf = Object.setPrototypeOf
115839
+ const getPrototypeOf = Object.getPrototypeOf
115840
+ const objectPrototype = Object.prototype
115841
+
115842
+ // What reaches module code from outside this realm is a frozen object with no prototype, never the object
115843
+ // itself: an error made in the worker's realm has that realm's Function behind its constructor, and a stack
115844
+ // that names its frames.
115845
+ const seal = (name, message) => {
115846
+ const line = name + ': ' + message
115847
+ const toStr = () => line
115848
+ setPrototypeOf(toStr, null)
115849
+ freeze(toStr)
115850
+ return freeze({ __proto__: null, name, message, stack: line, toString: toStr })
115851
+ }
115852
+ const SENTINEL = seal('Error', 'a call to the host failed (details unavailable)')
115853
+
115854
+ // True only for an object whose prototype chain reaches this realm's Object.prototype within 64 hops: a
115855
+ // foreign, null-terminated, throwing or over-long chain is not this realm's.
115856
+ const ownRealm = (value) => {
115857
+ let proto = value
115858
+ for (let i = 0; i < 64; i++) {
115859
+ proto = getPrototypeOf(proto)
115860
+ if (proto === objectPrototype) return true
115861
+ if (proto === null) return false
115862
+ }
115863
+ return false
115864
+ }
115865
+ const launder = (error) => {
115866
+ if (error === null || (typeof error !== 'object' && typeof error !== 'function')) return error
115867
+ try {
115868
+ if (ownRealm(error)) return error
115869
+ } catch (inner) {
115870
+ // Not readable: sealed below.
115871
+ }
115872
+ let name = 'Error'
115873
+ let message = ''
115874
+ try {
115875
+ if (typeof error.name === 'string') name = error.name
115876
+ } catch (inner) {
115877
+ // Keep the default.
115878
+ }
115879
+ try {
115880
+ if (typeof error.message === 'string') message = error.message
115881
+ } catch (inner) {
115882
+ // Keep the default.
115883
+ }
115884
+ return seal(name, message)
115885
+ }
115886
+ // Every function the worker hands in is called through this: what it throws is laundered, and nothing is
115887
+ // called or allocated between a failed launder and the throw.
115888
+ const guarded = (hostFn) => (...args) => {
115889
+ try {
115890
+ return hostFn(...args)
115891
+ } catch (error) {
115892
+ let reason = SENTINEL
115893
+ try {
115894
+ reason = launder(error)
115895
+ } catch (inner) {
115896
+ // The sentinel stands.
115897
+ }
115898
+ throw reason
115899
+ }
115900
+ }
115901
+ const send = guarded(hostSend)
115902
+ const evaluate = guarded(hostEvaluate)
115297
115903
 
115298
115904
  const post = (message) => {
115299
115905
  try {
@@ -115344,7 +115950,7 @@ function call(noun, method, args) {
115344
115950
  pendingCalls.set(id, { resolve, reject })
115345
115951
  if (!post({ t: 'call', cid: id, noun, method, args })) {
115346
115952
  pendingCalls.delete(id)
115347
- reject(new Error('the arguments of $.' + noun + '.' + method + ' are not plain data'))
115953
+ reject(seal('TypeError', 'the arguments of $.' + noun + '.' + method + ' are not plain data'))
115348
115954
  }
115349
115955
  })
115350
115956
  }
@@ -115479,7 +116085,14 @@ function loadProgram(program) {
115479
116085
  cache.set(rel, exports)
115480
116086
  const source = program.files[rel]
115481
116087
  if (typeof source !== 'string') throw new Error('no such file in the module: ' + rel)
115482
- const compiled = evaluate(rel, source)
116088
+ // The worker's evaluate is outside this realm: whatever it throws (a RangeError from a stack that ran
116089
+ // out is made in its realm) is turned into a message here, so no object of that realm is caught by a module.
116090
+ let compiled
116091
+ try {
116092
+ compiled = evaluate(rel, source)
116093
+ } catch (error) {
116094
+ compiled = 'the module could not be compiled'
116095
+ }
115483
116096
  if (typeof compiled === 'string') throw new Error(compiled)
115484
116097
  compiled(exports, load)
115485
116098
  return exports
@@ -115646,7 +116259,7 @@ function receive(json) {
115646
116259
  if (pending === undefined) return
115647
116260
  pendingCalls.delete(message.cid)
115648
116261
  if (message.ok) pending.resolve(message.value)
115649
- else pending.reject(new Error(message.message))
116262
+ else pending.reject(seal('Error', typeof message.message === 'string' ? message.message : 'the call failed'))
115650
116263
  return
115651
116264
  }
115652
116265
  }
@@ -115655,12 +116268,116 @@ function receive(json) {
115655
116268
  return receive
115656
116269
  })
115657
116270
  `;
115658
- var HOOK_WORKER_SOURCE = `const BOOTSTRAP = ${JSON.stringify("(" + BOOTSTRAP_SOURCE.trim() + ")")}
116271
+ var PREPARE_SOURCE = String.raw`(function () {
116272
+ 'use strict'
116273
+ Object.defineProperty(Error, 'prepareStackTrace', {
116274
+ value: function () { return '' },
116275
+ writable: false,
116276
+ configurable: false,
116277
+ })
116278
+ // A stack that overflows is made by the engine, not by prepareStackTrace: with no frames kept it has none to read.
116279
+ Object.defineProperty(Error, 'stackTraceLimit', { value: 0, writable: false, configurable: false })
116280
+ for (const name of ['ShadowRealm', 'WebAssembly', 'FinalizationRegistry', 'WeakRef', 'Atomics',
116281
+ 'SharedArrayBuffer', 'queueMicrotask', '$vm', 'gc', 'edenGC', 'fullGC', 'print', 'readFile', 'Loader']) {
116282
+ delete globalThis[name]
116283
+ }
116284
+ })()`;
116285
+ var FREEZE_SOURCE = String.raw`(function () {
116286
+ 'use strict'
116287
+ // A frozen prototype makes the data properties on it read-only, so "this.name = x" in an Error subclass
116288
+ // would throw: those become accessors whose setter defines the property on the receiver instead.
116289
+ function enableOverride(proto, key) {
116290
+ const d = Object.getOwnPropertyDescriptor(proto, key)
116291
+ if (!d || 'get' in d) return
116292
+ const v = d.value
116293
+ Object.defineProperty(proto, key, {
116294
+ get() { return v },
116295
+ set(nv) {
116296
+ if (this === proto) return
116297
+ Object.defineProperty(this, key, { value: nv, writable: true, enumerable: true, configurable: true })
116298
+ },
116299
+ enumerable: d.enumerable,
116300
+ configurable: true,
116301
+ })
116302
+ }
116303
+ const errorCtors = [Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError,
116304
+ globalThis.AggregateError, globalThis.SuppressedError].filter(Boolean)
116305
+ for (const [proto, keys] of [
116306
+ [Object.prototype, Object.getOwnPropertyNames(Object.prototype)],
116307
+ [Function.prototype, ['toString', 'constructor', 'name', 'length']],
116308
+ [Array.prototype, ['toString', 'constructor']],
116309
+ [Date.prototype, ['toString', 'toLocaleString', 'valueOf', 'constructor']],
116310
+ ...errorCtors.map((C) => [C.prototype, ['name', 'message', 'toString', 'constructor']]),
116311
+ ]) for (const key of keys) enableOverride(proto, key)
116312
+ const freezeBoth = (C) => {
116313
+ Object.freeze(C)
116314
+ if (C.prototype) Object.freeze(C.prototype)
116315
+ }
116316
+ for (const C of [Promise, Object, Array, Function, globalThis.Iterator, Map, Set, WeakMap, WeakSet,
116317
+ String, Number, Boolean, Symbol, BigInt, Date, RegExp, ArrayBuffer, DataView, ...errorCtors,
116318
+ globalThis.DisposableStack, globalThis.AsyncDisposableStack, globalThis.Intl].filter(Boolean)) freezeBoth(C)
116319
+ for (const C of [Object.getPrototypeOf(Int8Array), Int8Array, Uint8Array, Uint8ClampedArray, Int16Array,
116320
+ Uint16Array, Int32Array, Uint32Array, globalThis.Float16Array, Float32Array, Float64Array,
116321
+ BigInt64Array, BigUint64Array].filter(Boolean)) freezeBoth(C)
116322
+ // The constructors of async, generator and async generator functions are reached only from an instance.
116323
+ for (const f of [async () => {}, function* () {}, async function* () {}]) {
116324
+ Object.freeze(f.constructor)
116325
+ Object.freeze(f.constructor.prototype)
116326
+ }
116327
+ for (const namespace of [JSON, Math, Reflect, Proxy]) Object.freeze(namespace)
116328
+ if (typeof Intl !== 'undefined') {
116329
+ for (const key of Object.getOwnPropertyNames(Intl)) {
116330
+ const C = Intl[key]
116331
+ if (typeof C === 'function') freezeBoth(C)
116332
+ }
116333
+ }
116334
+ const iterators = [
116335
+ [][Symbol.iterator](), ''[Symbol.iterator](), new Map()[Symbol.iterator](), new Set()[Symbol.iterator](),
116336
+ 'a'.matchAll(/a/g), (function* () {})(), (async function* () {})(),
116337
+ ]
116338
+ if (typeof Iterator !== 'undefined' && Iterator.from) {
116339
+ iterators.push([].values().map((x) => x), Iterator.from({ next: () => ({ done: true }) }))
116340
+ }
116341
+ try {
116342
+ if (typeof Intl !== 'undefined' && Intl.Segmenter) {
116343
+ const segments = new Intl.Segmenter().segment('a')
116344
+ iterators.push(segments, segments[Symbol.iterator]())
116345
+ }
116346
+ } catch (error) {
116347
+ // No segmenter here: nothing to freeze.
116348
+ }
116349
+ for (const it of iterators) {
116350
+ for (let p = Object.getPrototypeOf(it); p; p = Object.getPrototypeOf(p)) Object.freeze(p)
116351
+ }
116352
+ Object.defineProperty(globalThis, 'then', { value: undefined, writable: false, configurable: false })
116353
+ for (const key of Reflect.ownKeys(globalThis)) {
116354
+ const d = Object.getOwnPropertyDescriptor(globalThis, key)
116355
+ if (d && d.configurable && 'value' in d) {
116356
+ Object.defineProperty(globalThis, key, { value: d.value, writable: false, configurable: false, enumerable: d.enumerable })
116357
+ }
116358
+ }
116359
+ })()`;
116360
+ var HOOK_WORKER_SOURCE = (
116361
+ // 'use strict' is the first statement: a directive after any other statement is only an expression, so
116362
+ // it must come before the BOOTSTRAP constant for the worker's own realm to be strict.
116363
+ `'use strict'
116364
+ const BOOTSTRAP = ${JSON.stringify("(" + BOOTSTRAP_SOURCE.trim() + ")")}
116365
+ const PREPARE_SOURCE = ${JSON.stringify(PREPARE_SOURCE)}
116366
+ const FREEZE_SOURCE = ${JSON.stringify(FREEZE_SOURCE)}
115659
116367
  ` + String.raw`
115660
- 'use strict'
115661
116368
  const { parentPort } = require('node:worker_threads')
115662
116369
  const vm = require('node:vm')
115663
116370
 
116371
+ // The worker's own realm gives a script nothing to read its stack with: a stack that overflows or throws
116372
+ // is made of call sites, and a call site reaches the function that was running.
116373
+ for (const key of ['prepareStackTrace', 'stackTraceLimit']) {
116374
+ Object.defineProperty(Error, key, {
116375
+ value: key === 'stackTraceLimit' ? 0 : undefined,
116376
+ writable: false,
116377
+ configurable: false,
116378
+ })
116379
+ }
116380
+
115664
116381
  // Whatever of the worker's own realm might still be reached must not be able to make code: its
115665
116382
  // function constructors throw.
115666
116383
  {
@@ -115708,34 +116425,25 @@ const evaluate = (rel, source) => {
115708
116425
  }
115709
116426
  }
115710
116427
 
116428
+ function prepareContext() {
116429
+ // 'use strict' first, then the one Error the module has loses captureStackTrace.
116430
+ vm.runInContext("'use strict'; delete Error.captureStackTrace", context)
116431
+ vm.runInContext(PREPARE_SOURCE, context, { filename: 'plugin:prepare' })
116432
+ }
116433
+
115711
116434
  function freezeIntrinsics() {
115712
- vm.runInContext(
115713
- '(function () {' +
115714
- 'const keep = new Set(["Object", "Error"]);' +
115715
- 'for (const name of ["Object", "Array", "Function", "String", "Number", "Boolean", "Symbol", "Promise", "RegExp", "Date", "Map", "Set", "WeakMap", "WeakSet", "Error", "TypeError", "RangeError", "SyntaxError", "BigInt", "ArrayBuffer", "Uint8Array"]) {' +
115716
- 'const ctor = globalThis[name];' +
115717
- 'if (!ctor) continue;' +
115718
- 'if (ctor.prototype && !keep.has(name)) Object.freeze(ctor.prototype);' +
115719
- 'Object.freeze(ctor);' +
115720
- '}' +
115721
- 'for (const name of ["JSON", "Math", "Reflect"]) { if (globalThis[name]) Object.freeze(globalThis[name]); }' +
115722
- 'for (const key of Reflect.ownKeys(globalThis)) {' +
115723
- 'const d = Object.getOwnPropertyDescriptor(globalThis, key);' +
115724
- 'if (d && d.configurable && "value" in d) Object.defineProperty(globalThis, key, { value: d.value, writable: false, configurable: false, enumerable: d.enumerable });' +
115725
- '}' +
115726
- '})()',
115727
- context,
115728
- )
116435
+ vm.runInContext(FREEZE_SOURCE, context, { filename: 'plugin:freeze' })
115729
116436
  }
115730
116437
 
115731
116438
  let receive
115732
116439
 
115733
116440
  function start() {
115734
- // No prototype on the sandbox, so nothing of the worker's realm is found through the global.
116441
+ // No prototype on the context's global, so nothing of the worker's realm is found through the global.
115735
116442
  context = vm.createContext(Object.create(null), {
115736
116443
  name: 'plugin',
115737
116444
  codeGeneration: { strings: false, wasm: false },
115738
116445
  })
116446
+ prepareContext()
115739
116447
  receive = vm.runInContext(BOOTSTRAP, context, { filename: 'plugin:bootstrap' })(send, evaluate)
115740
116448
  freezeIntrinsics()
115741
116449
  }
@@ -115756,7 +116464,8 @@ process.on('unhandledRejection', (reason) =>
115756
116464
  process.on('uncaughtException', (error) =>
115757
116465
  post({ t: 'log', level: 'error', text: 'an uncaught error: ' + messageOf(error) }),
115758
116466
  )
115759
- `;
116467
+ `
116468
+ );
115760
116469
 
115761
116470
  // ../sdk/dist/plugin/hook-module/host.js
115762
116471
  var HOOK_MODULE_BUDGET_MS = 1e4;
@@ -115922,12 +116631,53 @@ async function startHookModule(options) {
115922
116631
  log.warn("Hooks module not loaded", { ...attrs, "namzu.hook_module.reason": why });
115923
116632
  options.onUnload?.(why);
115924
116633
  }, "unload");
115925
- const unloaded = /* @__PURE__ */ __name((why) => {
116634
+ let disposed = false;
116635
+ const recovery = hookModuleRecovery(plugin.name);
116636
+ const withRecovery = /* @__PURE__ */ __name((text12) => withHookModuleRecovery(text12, plugin.name), "withRecovery");
116637
+ const commandLabel = `module ${label5}`;
116638
+ const failurePolicy = /* @__PURE__ */ __name((event, why) => {
116639
+ log.warn("Hooks module hook failed", {
116640
+ ...attrs,
116641
+ "namzu.hook.event": event,
116642
+ "namzu.hook_module.reason": why
116643
+ });
116644
+ const closed = why.includes(recovery) ? why : `${endedSentence(why)} ${hookFailureRecovery(plugin.name)}`;
116645
+ const line = `${commandLabel}: ${closed}`;
116646
+ if (event === "pre_tool_use")
116647
+ return { action: "error", message: line };
116648
+ if (event === "pre_skill_shell_command")
116649
+ return { action: "skip", reason: line };
116650
+ return { action: "continue", notice: line };
116651
+ }, "failurePolicy");
116652
+ const guards = /* @__PURE__ */ new Set([
116653
+ "pre_tool_use",
116654
+ "pre_skill_shell_command",
116655
+ "permission_request"
116656
+ ]);
116657
+ const unloaded = /* @__PURE__ */ __name((why, refusedGuards) => {
115926
116658
  unload(why);
115927
- return { scan, status, message: why, hooks: [], dispose: /* @__PURE__ */ __name(async () => void 0, "dispose") };
116659
+ const hooks2 = [];
116660
+ for (const event of MODULE_HOOK_EVENTS) {
116661
+ if (!refusedGuards?.has(event))
116662
+ continue;
116663
+ hooks2.push({
116664
+ event,
116665
+ handler: /* @__PURE__ */ __name(async () => disposed ? { action: "continue" } : failurePolicy(event, why), "handler")
116666
+ });
116667
+ }
116668
+ return {
116669
+ scan,
116670
+ status,
116671
+ message: why,
116672
+ hooks: hooks2,
116673
+ dispose: /* @__PURE__ */ __name(async () => {
116674
+ disposed = true;
116675
+ }, "dispose")
116676
+ };
115928
116677
  }, "unloaded");
115929
116678
  if (scan.refusals.length > 0 || scan.program === void 0) {
115930
- return unloaded(`hooks module ${label5} not loaded: ${refusalLine(scan)}`);
116679
+ const seen = guards;
116680
+ return unloaded(withRecovery(`hooks module ${label5} not loaded: ${refusalLine(scan)}`), seen);
115931
116681
  }
115932
116682
  const program = scan.program;
115933
116683
  const runnable = /* @__PURE__ */ new Set();
@@ -115942,6 +116692,8 @@ async function startHookModule(options) {
115942
116692
  ...plugin.dataDir !== void 0 ? { dataDir: plugin.dataDir } : {},
115943
116693
  projectDir: options.projectDir,
115944
116694
  envNames: scan.envNames,
116695
+ // What the module's own scan declared is all its calls reach, whatever the worker sends.
116696
+ allowedCalls: scan.calls.filter((call2) => call2.supported).map((call2) => call2.call),
115945
116697
  ...options.environment !== void 0 ? { environment: options.environment } : {},
115946
116698
  ...options.fetch !== void 0 ? { fetch: options.fetch } : {},
115947
116699
  log,
@@ -116135,7 +116887,7 @@ async function startHookModule(options) {
116135
116887
  try {
116136
116888
  await start();
116137
116889
  } catch (error62) {
116138
- const why = `hooks module ${label5} failed to load: ${toErrorMessage(error62)}`;
116890
+ const why = withRecovery(`hooks module ${label5} failed to load: ${toErrorMessage(error62)}`);
116139
116891
  unload(why);
116140
116892
  return { kind: "failed", message: why };
116141
116893
  }
@@ -116177,20 +116929,6 @@ async function startHookModule(options) {
116177
116929
  worker.post({ t: "dispatch", id: id3, name: name3, e, regs: registrations });
116178
116930
  });
116179
116931
  }, "dispatch");
116180
- const commandLabel = `module ${label5}`;
116181
- const failurePolicy = /* @__PURE__ */ __name((event, why) => {
116182
- log.warn("Hooks module hook failed", {
116183
- ...attrs,
116184
- "namzu.hook.event": event,
116185
- "namzu.hook_module.reason": why
116186
- });
116187
- const line = `${commandLabel}: ${why}`;
116188
- if (event === "pre_tool_use")
116189
- return { action: "error", message: line };
116190
- if (event === "pre_skill_shell_command")
116191
- return { action: "skip", reason: line };
116192
- return { action: "continue", notice: line };
116193
- }, "failurePolicy");
116194
116932
  const hooks = [];
116195
116933
  for (const event of MODULE_HOOK_EVENTS) {
116196
116934
  if (!runnable.has(event))
@@ -116199,17 +116937,20 @@ async function startHookModule(options) {
116199
116937
  hooks.push({
116200
116938
  event,
116201
116939
  handler: /* @__PURE__ */ __name(async (context2) => {
116202
- if (status === "unloaded")
116203
- return { action: "continue" };
116940
+ if (status === "unloaded") {
116941
+ if (disposed || !guards.has(event))
116942
+ return { action: "continue" };
116943
+ return failurePolicy(event, message ?? `hooks module ${label5} is not loaded`);
116944
+ }
116204
116945
  const input2 = shellHookInputFor(event, context2, options.shell, { toolNames: "written" });
116205
116946
  const payload = JSON.parse(shellHookPayload(input2));
116206
116947
  const e = event === "pre_tool_use" ? toolEnvelope(payload) : payload;
116207
116948
  try {
116208
116949
  await start();
116209
116950
  } catch (error62) {
116210
- const why = `hooks module ${label5} failed to load: ${toErrorMessage(error62)}`;
116951
+ const why = withRecovery(`hooks module ${label5} failed to load: ${toErrorMessage(error62)}`);
116211
116952
  unload(why);
116212
- return { action: "continue", notice: why };
116953
+ return guards.has(event) ? failurePolicy(event, why) : { action: "continue", notice: why };
116213
116954
  }
116214
116955
  const registrations = [];
116215
116956
  for (const [index, events] of registrationEvents.entries()) {
@@ -116244,6 +116985,7 @@ async function startHookModule(options) {
116244
116985
  },
116245
116986
  hooks,
116246
116987
  dispose: /* @__PURE__ */ __name(async () => {
116988
+ disposed = true;
116247
116989
  status = "unloaded";
116248
116990
  await endWorker("the hooks worker was stopped");
116249
116991
  }, "dispose")
@@ -157838,7 +158580,9 @@ function createSkillTool(options = {}) {
157838
158580
  const result = await expandInlineShell(text12, {
157839
158581
  host: createToolSkillShellHost({
157840
158582
  context: input2.context,
157841
- ...allow ? { allow } : {}
158583
+ ...allow ? { allow } : {},
158584
+ // Only a model loaded this, so only a model can run a command in its own call.
158585
+ ...input2.invokedBy === "model" ? { handOff: true } : {}
157842
158586
  }),
157843
158587
  commandName: input2.name,
157844
158588
  ...block !== void 0 ? { block } : {},
@@ -165441,6 +166185,8 @@ export {
165441
166185
  createMonitorStream,
165442
166186
  WebFetchRefusedError,
165443
166187
  isPrivateAddress,
166188
+ privateAddressProblem,
166189
+ proxyConfigured,
165444
166190
  GuardedFetchProvider,
165445
166191
  assertSandboxStatus,
165446
166192
  SANDBOX_ENVIRONMENTS,
@@ -166005,6 +166751,7 @@ export {
166005
166751
  PLAN_MODE_REFUSAL,
166006
166752
  STRICT_MODE_REFUSAL,
166007
166753
  PLAN_MODE_REFUSAL_WITH_PLAN_FILE,
166754
+ CLASSIFY_NESTED_REFUSAL,
166008
166755
  nestedCallModeRefusal,
166009
166756
  ToolsetConflictError,
166010
166757
  combineToolsets,
@@ -166123,6 +166870,7 @@ export {
166123
166870
  isWithin,
166124
166871
  resolveWithinReal,
166125
166872
  effectiveBashWorkingDirectory,
166873
+ pinBashWorkingDirectory,
166126
166874
  backgroundTasksDisabled,
166127
166875
  execHostShell,
166128
166876
  SANDBOX_ESCAPE_NOT_APPROVED,
@@ -166145,6 +166893,7 @@ export {
166145
166893
  UNFINISHED_CHECK_UNATTENDED_REFUSAL,
166146
166894
  CLASSIFIER_TRANSCRIPT_TOO_LONG_FEEDBACK,
166147
166895
  CLASSIFIER_SAFE_TOOLS,
166896
+ allowedCallTooWide,
166148
166897
  ACCEPT_EDITS_SHELL_COMMANDS,
166149
166898
  SCREEN_CONSENT_UNATTENDED_REFUSAL,
166150
166899
  SCREEN_CONSENT_DECLINED_FEEDBACK,
@@ -166422,6 +167171,8 @@ export {
166422
167171
  ScopedConnectorRegistry,
166423
167172
  AgentRegistry,
166424
167173
  PluginRegistry,
167174
+ hookModuleRecovery,
167175
+ withHookModuleRecovery,
166425
167176
  summarizeHookModule,
166426
167177
  hookModuleConsentLines,
166427
167178
  hookModuleConsentEntry,
@@ -167031,4 +167782,4 @@ export {
167031
167782
  WakeBudget,
167032
167783
  wakeBudgetFromEnv
167033
167784
  };
167034
- //# sourceMappingURL=chunk-RQRL3UNA.js.map
167785
+ //# sourceMappingURL=chunk-EDLBZSB2.js.map