@namzu/cli 59.0.0 → 60.1.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 (595) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +1 -1
  3. package/dist/bin.js +1 -1
  4. package/dist/chunks/{acp-AQUZCZSO.js → acp-6R4I2A3Q.js} +2063 -248
  5. package/dist/chunks/acp-6R4I2A3Q.js.map +6 -0
  6. package/dist/chunks/{activity-command-Y3A6GIFW.js → activity-command-JU4HLIQJ.js} +14 -14
  7. package/dist/chunks/{add-DWFKSOYI.js → add-S6JYKDI4.js} +24 -24
  8. package/dist/chunks/{agent-Z6PJYBAO.js → agent-E343AQV7.js} +53 -50
  9. package/dist/chunks/agent-session-D6JIOCON.js +95 -0
  10. package/dist/chunks/{apply-at-exit-SHGR2BAB.js → apply-at-exit-MEOJMGNT.js} +7 -7
  11. package/dist/chunks/{archive-KYXU4AZZ.js → archive-ZPWC7GZU.js} +13 -13
  12. package/dist/chunks/{auth-R3RCZZ7U.js → auth-6NX4TMIG.js} +12 -12
  13. package/dist/chunks/{bin-main-DUZFYUCJ.js → bin-main-P3KAQDKC.js} +8 -8
  14. package/dist/chunks/{binding-5UJYMFMU.js → binding-6QZVGFQ5.js} +3 -3
  15. package/dist/chunks/{browser-7CFZ6BZS.js → browser-KK2U5524.js} +7 -7
  16. package/dist/chunks/{chat-BELD32ZP.js → chat-VEXJRSZN.js} +17 -17
  17. package/dist/chunks/{chunk-OSC47PCX.js → chunk-2DCOB33W.js} +13 -7
  18. package/dist/chunks/{chunk-OSC47PCX.js.map → chunk-2DCOB33W.js.map} +1 -1
  19. package/dist/chunks/{chunk-MDBUSIPW.js → chunk-2KVQVPJ7.js} +5 -5
  20. package/dist/chunks/chunk-32OIBGYI.js +188 -0
  21. package/dist/chunks/chunk-32OIBGYI.js.map +6 -0
  22. package/dist/chunks/{chunk-MRZHTIE7.js → chunk-42JIZXVL.js} +4 -4
  23. package/dist/chunks/{chunk-ESIICAI3.js → chunk-4473VICE.js} +3 -3
  24. package/dist/chunks/{chunk-DGYMR4WJ.js → chunk-44YG6EI4.js} +4 -4
  25. package/dist/chunks/{chunk-ZQGCZYAE.js → chunk-452SL2Y4.js} +2 -2
  26. package/dist/chunks/{chunk-VE4XIWDW.js → chunk-4BNCVR3U.js} +2 -2
  27. package/dist/chunks/{chunk-2EVP6BX4.js → chunk-4CJ3HPOT.js} +2 -2
  28. package/dist/chunks/{chunk-4BAXYUZQ.js → chunk-4DSUVT37.js} +13 -10
  29. package/dist/chunks/chunk-4DSUVT37.js.map +6 -0
  30. package/dist/chunks/{chunk-TORIEDBN.js → chunk-4ENL4VUO.js} +4 -4
  31. package/dist/chunks/{chunk-IJ6Z6FNY.js → chunk-4KVYTHY7.js} +3 -3
  32. package/dist/chunks/{chunk-YNWPC3HO.js → chunk-4Y242BU4.js} +5 -5
  33. package/dist/chunks/{chunk-OA7QKUCM.js → chunk-5F4DSPZC.js} +10 -10
  34. package/dist/chunks/{chunk-DRWJTADQ.js → chunk-5IGEQN7L.js} +4 -4
  35. package/dist/chunks/{chunk-W752G3FM.js → chunk-5ZLKTFU2.js} +3 -3
  36. package/dist/chunks/{chunk-KETRBV2E.js → chunk-66QIFMEO.js} +2 -2
  37. package/dist/chunks/{chunk-4TIUY3Q6.js → chunk-6HYK4DDB.js} +36 -14
  38. package/dist/chunks/{chunk-4TIUY3Q6.js.map → chunk-6HYK4DDB.js.map} +1 -1
  39. package/dist/chunks/{chunk-AEXGGJUW.js → chunk-6TUHWKXP.js} +15 -6
  40. package/dist/chunks/chunk-6TUHWKXP.js.map +6 -0
  41. package/dist/chunks/{chunk-CEZW3NVM.js → chunk-6W3UGXGG.js} +4 -4
  42. package/dist/chunks/{chunk-S7FE35WQ.js → chunk-75YLZNZW.js} +3 -3
  43. package/dist/chunks/{chunk-P4TCLMD6.js → chunk-AC5P6W3G.js} +2 -2
  44. package/dist/chunks/chunk-AMYP2WPW.js +1055 -0
  45. package/dist/chunks/chunk-AMYP2WPW.js.map +6 -0
  46. package/dist/chunks/{chunk-GUK47JTV.js → chunk-AYMB4AOZ.js} +4 -4
  47. package/dist/chunks/{chunk-23D5IXMW.js → chunk-B4AOCHH6.js} +3 -3
  48. package/dist/chunks/{chunk-FEOS7UZ2.js → chunk-BA7KUG6V.js} +2 -2
  49. package/dist/chunks/{chunk-D35UCVTK.js → chunk-BHQHTM3Z.js} +5 -5
  50. package/dist/chunks/chunk-BJT37HR4.js +3644 -0
  51. package/dist/chunks/chunk-BJT37HR4.js.map +6 -0
  52. package/dist/chunks/{chunk-KPOOM7QT.js → chunk-BNLIRJ3M.js} +4 -4
  53. package/dist/chunks/{chunk-MDVYEFTI.js → chunk-BURGRQWO.js} +2 -2
  54. package/dist/chunks/{chunk-DKSFQRUM.js → chunk-BWD2TUI4.js} +5 -5
  55. package/dist/chunks/{chunk-HGTOAMV6.js → chunk-BZR5PIFF.js} +2098 -812
  56. package/dist/chunks/chunk-BZR5PIFF.js.map +6 -0
  57. package/dist/chunks/{chunk-7Y4RR47U.js → chunk-C7E7YCRD.js} +5 -5
  58. package/dist/chunks/{chunk-44MFZJ24.js → chunk-CXW7I2S3.js} +2 -2
  59. package/dist/chunks/{chunk-3ETXWTV4.js → chunk-D2R47LDH.js} +121 -8
  60. package/dist/chunks/chunk-D2R47LDH.js.map +6 -0
  61. package/dist/chunks/chunk-D4TXOX34.js +342 -0
  62. package/dist/chunks/chunk-D4TXOX34.js.map +6 -0
  63. package/dist/chunks/{chunk-73HWWJYC.js → chunk-D6PB3Z7Q.js} +2 -2
  64. package/dist/chunks/{chunk-QTHG6UPU.js → chunk-DEAG4G5J.js} +2 -2
  65. package/dist/chunks/{chunk-WGC5DJEW.js → chunk-DRSQTKDN.js} +3 -3
  66. package/dist/chunks/chunk-EBBT2I5S.js +153 -0
  67. package/dist/chunks/chunk-EBBT2I5S.js.map +6 -0
  68. package/dist/chunks/{chunk-FK5C7SHM.js → chunk-EWPGU4HH.js} +10 -441
  69. package/dist/chunks/chunk-EWPGU4HH.js.map +6 -0
  70. package/dist/chunks/{chunk-WXYRLTRY.js → chunk-EXJJLYZK.js} +3 -3
  71. package/dist/chunks/{chunk-PFVYYH6O.js → chunk-F5W4TNCR.js} +2 -2
  72. package/dist/chunks/{chunk-Q6PZODSV.js → chunk-F7KOBJVW.js} +4 -4
  73. package/dist/chunks/{chunk-VSNV3U2B.js → chunk-FK4MAZV2.js} +5 -5
  74. package/dist/chunks/{chunk-ATCVFWXD.js → chunk-FMD4REZQ.js} +41 -41
  75. package/dist/chunks/{chunk-ATCVFWXD.js.map → chunk-FMD4REZQ.js.map} +1 -1
  76. package/dist/chunks/{chunk-G5LPTLLY.js → chunk-FPC3K4TT.js} +3 -3
  77. package/dist/chunks/{chunk-XLXPPVUT.js → chunk-FVIKYFYD.js} +2 -2
  78. package/dist/chunks/{chunk-PQT7624W.js → chunk-GPTYDM26.js} +8 -8
  79. package/dist/chunks/{chunk-TP7DRQXE.js → chunk-GT22EDUB.js} +6 -6
  80. package/dist/chunks/{chunk-GEVWZWLM.js → chunk-GTUTBTOV.js} +3 -3
  81. package/dist/chunks/{chunk-GQ6WXY3M.js → chunk-H6NTNPWD.js} +4 -4
  82. package/dist/chunks/{chunk-TYNAB5GR.js → chunk-HCQGZPVT.js} +2 -2
  83. package/dist/chunks/{chunk-LB4HC5U7.js → chunk-HG2PPCAE.js} +3 -3
  84. package/dist/chunks/{chunk-ABKURT35.js → chunk-HKRUNZVI.js} +3 -3
  85. package/dist/chunks/{chunk-JPM3JXZB.js → chunk-HM7L5PM2.js} +3 -3
  86. package/dist/chunks/{chunk-UFGLSUGU.js → chunk-I4RC6KQQ.js} +19 -19
  87. package/dist/chunks/{chunk-HW2QBNAA.js → chunk-IL4Y3JGT.js} +13 -13
  88. package/dist/chunks/{chunk-D3SCA6NT.js → chunk-IMMUS7IW.js} +278 -7
  89. package/dist/chunks/chunk-IMMUS7IW.js.map +6 -0
  90. package/dist/chunks/{chunk-D6XZ4ZAV.js → chunk-IQ44C7Y3.js} +33 -9
  91. package/dist/chunks/chunk-IQ44C7Y3.js.map +6 -0
  92. package/dist/chunks/{chunk-24EZWZDZ.js → chunk-J4PL65DJ.js} +6 -6
  93. package/dist/chunks/chunk-JANK2R3L.js +402 -0
  94. package/dist/chunks/chunk-JANK2R3L.js.map +6 -0
  95. package/dist/chunks/{chunk-E65IWYTT.js → chunk-JECLB23L.js} +6 -6
  96. package/dist/chunks/{chunk-3RLKUXXG.js → chunk-JJ72TLOA.js} +15 -15
  97. package/dist/chunks/{chunk-CG5CGXNF.js → chunk-JRBFL6WT.js} +2 -2
  98. package/dist/chunks/{chunk-KBLYZ7L7.js → chunk-K2EKXCLZ.js} +3 -3
  99. package/dist/chunks/{chunk-567CSU37.js → chunk-K7YZJV2X.js} +248 -24
  100. package/dist/chunks/chunk-K7YZJV2X.js.map +6 -0
  101. package/dist/chunks/chunk-KF6IKSF2.js +472 -0
  102. package/dist/chunks/chunk-KF6IKSF2.js.map +6 -0
  103. package/dist/chunks/{chunk-OQWLQUO7.js → chunk-KSRN5Y2O.js} +196 -59
  104. package/dist/chunks/chunk-KSRN5Y2O.js.map +6 -0
  105. package/dist/chunks/{chunk-WW3AU2YN.js → chunk-ME4LETA3.js} +2 -2
  106. package/dist/chunks/{chunk-J5E4DV6R.js → chunk-MF3SFDBW.js} +3 -3
  107. package/dist/chunks/{chunk-WSDZIJNK.js → chunk-MK42KB72.js} +4 -4
  108. package/dist/chunks/{chunk-RZKIZTPA.js → chunk-MUSGZEFY.js} +2 -2
  109. package/dist/chunks/{chunk-MF5KTVGJ.js → chunk-N5CCXOYK.js} +7 -7
  110. package/dist/chunks/{chunk-KVNL7XA6.js → chunk-NBJ5PRAY.js} +3 -3
  111. package/dist/chunks/{chunk-E4RVHFV6.js → chunk-NKHEBASJ.js} +2 -2
  112. package/dist/chunks/{chunk-SS6IJAPA.js → chunk-NVWD5XDT.js} +2 -2
  113. package/dist/chunks/{chunk-7LDUPEXP.js → chunk-O45DCUNX.js} +2 -2
  114. package/dist/chunks/{chunk-KHGY6QJR.js → chunk-O4EILTV6.js} +145 -20
  115. package/dist/chunks/chunk-O4EILTV6.js.map +6 -0
  116. package/dist/chunks/{chunk-G76POTWW.js → chunk-PAUMCJPX.js} +3 -3
  117. package/dist/chunks/{chunk-MF57EX7H.js → chunk-PE4MWWUW.js} +3 -3
  118. package/dist/chunks/{chunk-4RW7GDJ4.js → chunk-PLCWCIL4.js} +2 -2
  119. package/dist/chunks/{chunk-XVOPQCPD.js → chunk-PRJO4XM3.js} +2 -2
  120. package/dist/chunks/{chunk-CQFWLYTK.js → chunk-PRRX5LNR.js} +2 -2
  121. package/dist/chunks/{chunk-3PH6F6Z3.js → chunk-PS5SVAUJ.js} +2 -2
  122. package/dist/chunks/chunk-PZLPACNY.js +407 -0
  123. package/dist/chunks/chunk-PZLPACNY.js.map +6 -0
  124. package/dist/chunks/{chunk-P725GKKG.js → chunk-PZWSRAE7.js} +6 -6
  125. package/dist/chunks/{chunk-6IOZY2AB.js → chunk-QBLHOG2F.js} +36 -14
  126. package/dist/chunks/chunk-QBLHOG2F.js.map +6 -0
  127. package/dist/chunks/{chunk-CNSKJ3DZ.js → chunk-QCV3HH4P.js} +2 -2
  128. package/dist/chunks/{chunk-7J23SPSX.js → chunk-QGBR42TV.js} +8 -7
  129. package/dist/chunks/{chunk-6CSJRIUZ.js → chunk-QNJXULU7.js} +2 -2
  130. package/dist/chunks/{chunk-5JVKE4LB.js → chunk-QQ4S6MNH.js} +13638 -4103
  131. package/dist/chunks/chunk-QQ4S6MNH.js.map +6 -0
  132. package/dist/chunks/{chunk-DJKWBSVM.js → chunk-R2KAESOM.js} +2 -2
  133. package/dist/chunks/{chunk-AIQKSTVJ.js → chunk-R6M6EIAH.js} +4 -4
  134. package/dist/chunks/{chunk-VJHENTNB.js → chunk-RKKU2RE4.js} +2 -2
  135. package/dist/chunks/{chunk-JZTTOZRG.js → chunk-RMOTHWPV.js} +2 -2
  136. package/dist/chunks/{chunk-EA6YICQ7.js → chunk-RQAY7REG.js} +3 -3
  137. package/dist/chunks/{chunk-LWJJDERP.js → chunk-SLTJNYOU.js} +2 -2
  138. package/dist/chunks/{chunk-UL6MZ5OM.js → chunk-SXONHO4H.js} +9 -9
  139. package/dist/chunks/{chunk-W4S4ZBXX.js → chunk-T7ILM666.js} +11 -11
  140. package/dist/chunks/{chunk-E6FMAE5Q.js → chunk-TBGKPWCL.js} +9 -9
  141. package/dist/chunks/{chunk-ACO3LTRT.js → chunk-TBJ6XU3T.js} +3 -3
  142. package/dist/chunks/{chunk-5HMJ3DYR.js → chunk-TMPP2DEY.js} +4 -4
  143. package/dist/chunks/{chunk-6YXHH5JW.js → chunk-TSOZBRM6.js} +2 -2
  144. package/dist/chunks/{chunk-SSPHAILP.js → chunk-TTFPWGIU.js} +2 -2
  145. package/dist/chunks/{chunk-TRRKG642.js → chunk-TTKMQW6B.js} +3 -3
  146. package/dist/chunks/{chunk-2VP2Q657.js → chunk-UCML5ZXB.js} +3 -3
  147. package/dist/chunks/{chunk-OH7EYW3T.js → chunk-VG7245VJ.js} +6 -6
  148. package/dist/chunks/{chunk-QZTTIL3A.js → chunk-VQZPXK4X.js} +3 -3
  149. package/dist/chunks/{chunk-O2PZDA5H.js → chunk-VWUTJ4EU.js} +3 -3
  150. package/dist/chunks/{chunk-VL6Z2OMG.js → chunk-WDKAL7EW.js} +2 -2
  151. package/dist/chunks/{chunk-2KC52MDS.js → chunk-WJ6QRVL6.js} +2 -2
  152. package/dist/chunks/{chunk-XJALHM5Z.js → chunk-WOTA5FO5.js} +3 -3
  153. package/dist/chunks/{chunk-4TJ7AGQO.js → chunk-WPGVZMSU.js} +2 -2
  154. package/dist/chunks/{chunk-IRAG3YXW.js → chunk-WYA4QWWE.js} +181 -7
  155. package/dist/chunks/chunk-WYA4QWWE.js.map +6 -0
  156. package/dist/chunks/{chunk-DJTCZSSY.js → chunk-XDUA6PBP.js} +2 -2
  157. package/dist/chunks/{chunk-PKFXIWVX.js → chunk-XE6XT6R6.js} +4 -4
  158. package/dist/chunks/{chunk-JUDJGDYX.js → chunk-XNQY26AE.js} +31 -131
  159. package/dist/chunks/chunk-XNQY26AE.js.map +6 -0
  160. package/dist/chunks/{chunk-FRGOWO6N.js → chunk-YR3TWNIV.js} +13 -12
  161. package/dist/chunks/chunk-YR3TWNIV.js.map +6 -0
  162. package/dist/chunks/{chunk-LXJW3ZYI.js → chunk-YWRRS7SO.js} +2 -2
  163. package/dist/chunks/{chunk-OOJP5BEK.js → chunk-Z5OG4HXI.js} +51 -25
  164. package/dist/chunks/chunk-Z5OG4HXI.js.map +6 -0
  165. package/dist/chunks/{chunk-JRWUIW4J.js → chunk-ZHEEG3NS.js} +2 -2
  166. package/dist/chunks/{cli-runtime-P6LCHPBA.js → cli-runtime-ZJKKIW4H.js} +22 -22
  167. package/dist/chunks/{commands-BNHIQVYO.js → commands-TQH5DD22.js} +6 -6
  168. package/dist/chunks/{computer-6P3GAOV2.js → computer-WOU5WIIR.js} +2 -2
  169. package/dist/chunks/{config-ZMXMX2WY.js → config-APYUJ5UW.js} +13 -13
  170. package/dist/chunks/{cost-BJKADKEZ.js → cost-5YV27U7F.js} +5 -5
  171. package/dist/chunks/{crash-report-OJHGVRD7.js → crash-report-QVXU2YVL.js} +6 -6
  172. package/dist/chunks/{dist-PMSBTFU5.js → dist-2FSOLP72.js} +2 -2
  173. package/dist/chunks/{dist-43XWK3LF.js → dist-AOT4CEP5.js} +2 -2
  174. package/dist/chunks/{dist-4ZPDHZOX.js → dist-H7CAJ3ZW.js} +48 -2
  175. package/dist/chunks/{dist-NCBDELMI.js → dist-IZGKRIWL.js} +2 -2
  176. package/dist/chunks/{dist-BGJEX527.js → dist-J4UXFVYR.js} +2 -2
  177. package/dist/chunks/{dist-FMFNU4M3.js → dist-JHKRSGW6.js} +2 -2
  178. package/dist/chunks/{dist-4LEGETQA.js → dist-PZYMYR7N.js} +3 -3
  179. package/dist/chunks/{dist-ADQAO5C3.js → dist-Z2HW2SJR.js} +2 -2
  180. package/dist/chunks/{doctor-AIYB27QY.js → doctor-CM6UPXG5.js} +40 -38
  181. package/dist/chunks/{drain-PYKX4QNR.js → drain-X6RURKKC.js} +17 -17
  182. package/dist/chunks/{entry-HM5E7KCD.js → entry-QQDPY6ZL.js} +6 -6
  183. package/dist/chunks/{eval-H4NKZYVV.js → eval-GZA22B4I.js} +9 -9
  184. package/dist/chunks/{exec-2PRVZNUX.js → exec-3NE75Z6E.js} +46 -45
  185. package/dist/chunks/exec-3NE75Z6E.js.map +6 -0
  186. package/dist/chunks/{extension-4233XOZW.js → extension-N5IQNKVZ.js} +6 -5
  187. package/dist/chunks/{github-IF3JVVJF.js → github-AUOENJUY.js} +2 -2
  188. package/dist/chunks/{home-AZY7APF6.js → home-I4FIB6FV.js} +3 -3
  189. package/dist/chunks/{homes-WL6LAAY5.js → homes-WTMMXQ6G.js} +5 -5
  190. package/dist/chunks/{hooks-AK5S4YUS.js → hooks-R42OTZDT.js} +22 -21
  191. package/dist/chunks/hooks-R42OTZDT.js.map +6 -0
  192. package/dist/chunks/{hooks-report-NJLGBWN3.js → hooks-report-K6VOPVBR.js} +18 -17
  193. package/dist/chunks/{host-SX3QC5FN.js → host-65UFBZJV.js} +10 -10
  194. package/dist/chunks/host-queries-L4PYE2BW.js +37 -0
  195. package/dist/chunks/{installed-list-44QXUJFE.js → installed-list-7QIWVKLQ.js} +4 -4
  196. package/dist/chunks/{learn-LW4DLSGZ.js → learn-NZXLKYV4.js} +17 -17
  197. package/dist/chunks/{learn-builtin-4RV2XDH4.js → learn-builtin-RC4XXVBS.js} +20 -20
  198. package/dist/chunks/{lifecycle-AJCHTSAF.js → lifecycle-NLCZ6OPA.js} +30 -30
  199. package/dist/chunks/{list-DT7AJVPX.js → list-2U67CAWS.js} +18 -18
  200. package/dist/chunks/{live-Z6HZFXPW.js → live-CWJ2NWUQ.js} +39 -37
  201. package/dist/chunks/{load-454TJBPW.js → load-H52QQBVE.js} +13 -9
  202. package/dist/chunks/{logs-GRUSUSL7.js → logs-ZIW3QFU4.js} +4 -4
  203. package/dist/chunks/{mcp-AFLRDYNN.js → mcp-FNSMEMCM.js} +145 -35
  204. package/dist/chunks/mcp-FNSMEMCM.js.map +6 -0
  205. package/dist/chunks/{mcp-serve-NNWP4IES.js → mcp-serve-ZC2OKIPP.js} +17 -17
  206. package/dist/chunks/{message-command-ZR2JQBBU.js → message-command-IHZWL5GI.js} +59 -56
  207. package/dist/chunks/message-command-IHZWL5GI.js.map +6 -0
  208. package/dist/chunks/{open-Z3BELFL7.js → open-AHDQMVXI.js} +7 -7
  209. package/dist/chunks/{operator-tools-PN3SPQ3C.js → operator-tools-P5R4TF6N.js} +15 -15
  210. package/dist/chunks/{output-schema-DSR56W6A.js → output-schema-Q5RWHNKE.js} +3 -3
  211. package/dist/chunks/{pal-ZOH5ILEV.js → pal-T42HU4AK.js} +15 -15
  212. package/dist/chunks/{peers-LXNB4QSL.js → peers-5RYEA7IA.js} +7 -7
  213. package/dist/chunks/{peers-WINODTEB.js → peers-7ZG3DEBO.js} +19 -19
  214. package/dist/chunks/plugin-DGEINYG5.js +2958 -0
  215. package/dist/chunks/plugin-DGEINYG5.js.map +6 -0
  216. package/dist/chunks/{providers-UOTUEQOJ.js → providers-BXXIM7EW.js} +18 -18
  217. package/dist/chunks/{providers-AVECY67I.js → providers-I24HYZXG.js} +10 -10
  218. package/dist/chunks/{pty-GW2YC23H.js → pty-WVKM6ATI.js} +3 -3
  219. package/dist/chunks/resume-F7JEDBHI.js +25 -0
  220. package/dist/chunks/{resume-command-FXT3KGLC.js → resume-command-4I47WN7T.js} +4 -4
  221. package/dist/chunks/{running-3NLAODZ7.js → running-VID6BVT2.js} +4 -4
  222. package/dist/chunks/{schedule-TTQUT45H.js → schedule-75IZH76Z.js} +12 -12
  223. package/dist/chunks/{send-FRNTRW2M.js → send-QRYY2NCG.js} +19 -19
  224. package/dist/chunks/send-person-VADQNJBN.js +32 -0
  225. package/dist/chunks/{service-TCKPUGL5.js → service-B6BNESZB.js} +30 -30
  226. package/dist/chunks/{setting-cli-HGYOIGC6.js → setting-cli-O4YWOIU5.js} +12 -12
  227. package/dist/chunks/skills-PEMVX5C3.js +604 -0
  228. package/dist/chunks/skills-PEMVX5C3.js.map +6 -0
  229. package/dist/chunks/{start-check-C5VJXVPY.js → start-check-EKRXJ5VE.js} +2 -2
  230. package/dist/chunks/{startup-failure-YQSEQRNQ.js → startup-failure-2UJKPNMR.js} +2 -2
  231. package/dist/chunks/{state-2DBTSDEP.js → state-X3MKUFYM.js} +20 -20
  232. package/dist/chunks/{store-CZGKLVTT.js → store-4OXWHFS5.js} +12 -12
  233. package/dist/chunks/{store-RJZCW2MI.js → store-MK5IYBE5.js} +8 -8
  234. package/dist/chunks/{store-JJKCDY7Y.js → store-QFNY4BV4.js} +10 -4
  235. package/dist/chunks/{store-S4BT3ESJ.js → store-VRKKFOYW.js} +3 -3
  236. package/dist/chunks/{tui-Q7ED7VFI.js → tui-MI72TUST.js} +96 -92
  237. package/dist/chunks/tui-MI72TUST.js.map +6 -0
  238. package/dist/chunks/{update-G7D3YCH5.js → update-ELZEXYIX.js} +8 -8
  239. package/dist/chunks/{watch-EON3IWRY.js → watch-HPINGMZZ.js} +100 -96
  240. package/dist/chunks/watch-HPINGMZZ.js.map +6 -0
  241. package/dist/chunks/{workspaces-O6S2OTDL.js → workspaces-3LB4SPPS.js} +15 -15
  242. package/dist/chunks/{worktree-A2DNXLOT.js → worktree-5CWUUWNO.js} +26 -22
  243. package/dist/chunks/worktree-5CWUUWNO.js.map +6 -0
  244. package/dist/commands/acp.d.ts +4 -2
  245. package/dist/commands/acp.d.ts.map +1 -1
  246. package/dist/commands/actions/mcp.d.ts.map +1 -1
  247. package/dist/commands/actions/small.d.ts.map +1 -1
  248. package/dist/commands/desktop-host-plugins.d.ts +321 -0
  249. package/dist/commands/desktop-host-plugins.d.ts.map +1 -0
  250. package/dist/commands/desktop-host-skills.d.ts +103 -0
  251. package/dist/commands/desktop-host-skills.d.ts.map +1 -0
  252. package/dist/commands/desktop-host.d.ts +230 -18
  253. package/dist/commands/desktop-host.d.ts.map +1 -1
  254. package/dist/commands/manifest.d.ts.map +1 -1
  255. package/dist/commands/mcp.d.ts.map +1 -1
  256. package/dist/commands/plugin-install.d.ts +28 -0
  257. package/dist/commands/plugin-install.d.ts.map +1 -0
  258. package/dist/commands/plugin-records.d.ts +48 -0
  259. package/dist/commands/plugin-records.d.ts.map +1 -0
  260. package/dist/commands/plugin.d.ts.map +1 -1
  261. package/dist/commands/skills-manage.d.ts +32 -0
  262. package/dist/commands/skills-manage.d.ts.map +1 -0
  263. package/dist/commands/skills.d.ts.map +1 -1
  264. package/dist/config/hooks-report.d.ts.map +1 -1
  265. package/dist/config/load.d.ts +9 -0
  266. package/dist/config/load.d.ts.map +1 -1
  267. package/dist/config/schema.d.ts +19 -0
  268. package/dist/config/schema.d.ts.map +1 -1
  269. package/dist/config/settings-descriptors.d.ts.map +1 -1
  270. package/dist/index.js +40 -38
  271. package/dist/integrations/archive/zip.d.ts +36 -0
  272. package/dist/integrations/archive/zip.d.ts.map +1 -0
  273. package/dist/integrations/extensions/package.d.ts +7 -16
  274. package/dist/integrations/extensions/package.d.ts.map +1 -1
  275. package/dist/integrations/mcp/all-servers.d.ts +30 -0
  276. package/dist/integrations/mcp/all-servers.d.ts.map +1 -0
  277. package/dist/integrations/mcp/plugin-remote.d.ts +141 -0
  278. package/dist/integrations/mcp/plugin-remote.d.ts.map +1 -0
  279. package/dist/integrations/mcp/project-approval.d.ts +29 -1
  280. package/dist/integrations/mcp/project-approval.d.ts.map +1 -1
  281. package/dist/integrations/mcp/server-listing.d.ts +7 -3
  282. package/dist/integrations/mcp/server-listing.d.ts.map +1 -1
  283. package/dist/integrations/mcp/servers.d.ts +6 -0
  284. package/dist/integrations/mcp/servers.d.ts.map +1 -1
  285. package/dist/integrations/mcp/user-config.d.ts +10 -0
  286. package/dist/integrations/mcp/user-config.d.ts.map +1 -1
  287. package/dist/integrations/plugins/enabled-records.d.ts +78 -0
  288. package/dist/integrations/plugins/enabled-records.d.ts.map +1 -0
  289. package/dist/integrations/plugins/fetch/archive.d.ts +15 -0
  290. package/dist/integrations/plugins/fetch/archive.d.ts.map +1 -0
  291. package/dist/integrations/plugins/fetch/git.d.ts +145 -0
  292. package/dist/integrations/plugins/fetch/git.d.ts.map +1 -0
  293. package/dist/integrations/plugins/fetch/index.d.ts +33 -0
  294. package/dist/integrations/plugins/fetch/index.d.ts.map +1 -0
  295. package/dist/integrations/plugins/fetch/source.d.ts +107 -0
  296. package/dist/integrations/plugins/fetch/source.d.ts.map +1 -0
  297. package/dist/integrations/plugins/fetch/url.d.ts +34 -0
  298. package/dist/integrations/plugins/fetch/url.d.ts.map +1 -0
  299. package/dist/integrations/plugins/files.d.ts +15 -3
  300. package/dist/integrations/plugins/files.d.ts.map +1 -1
  301. package/dist/integrations/plugins/hook-entries.d.ts +2 -0
  302. package/dist/integrations/plugins/hook-entries.d.ts.map +1 -1
  303. package/dist/integrations/plugins/install-manifest.d.ts +70 -0
  304. package/dist/integrations/plugins/install-manifest.d.ts.map +1 -0
  305. package/dist/integrations/plugins/install-plan.d.ts +119 -0
  306. package/dist/integrations/plugins/install-plan.d.ts.map +1 -0
  307. package/dist/integrations/plugins/install-preview.d.ts +24 -0
  308. package/dist/integrations/plugins/install-preview.d.ts.map +1 -0
  309. package/dist/integrations/plugins/install.d.ts +118 -0
  310. package/dist/integrations/plugins/install.d.ts.map +1 -0
  311. package/dist/integrations/plugins/installed-source.d.ts +80 -0
  312. package/dist/integrations/plugins/installed-source.d.ts.map +1 -0
  313. package/dist/integrations/plugins/inventory.d.ts +2 -1
  314. package/dist/integrations/plugins/inventory.d.ts.map +1 -1
  315. package/dist/integrations/plugins/json-state.d.ts +52 -0
  316. package/dist/integrations/plugins/json-state.d.ts.map +1 -0
  317. package/dist/integrations/plugins/manifest-details.d.ts +23 -0
  318. package/dist/integrations/plugins/manifest-details.d.ts.map +1 -0
  319. package/dist/integrations/plugins/marketplace.d.ts +111 -0
  320. package/dist/integrations/plugins/marketplace.d.ts.map +1 -0
  321. package/dist/integrations/plugins/records.d.ts +127 -0
  322. package/dist/integrations/plugins/records.d.ts.map +1 -0
  323. package/dist/integrations/plugins/remote-marketplace.d.ts +100 -0
  324. package/dist/integrations/plugins/remote-marketplace.d.ts.map +1 -0
  325. package/dist/integrations/plugins/runtime.d.ts +28 -0
  326. package/dist/integrations/plugins/runtime.d.ts.map +1 -1
  327. package/dist/integrations/plugins/surface.d.ts +126 -0
  328. package/dist/integrations/plugins/surface.d.ts.map +1 -0
  329. package/dist/integrations/plugins/update-compare.d.ts +18 -0
  330. package/dist/integrations/plugins/update-compare.d.ts.map +1 -0
  331. package/dist/integrations/plugins/validate.d.ts +50 -1
  332. package/dist/integrations/plugins/validate.d.ts.map +1 -1
  333. package/dist/integrations/subagents/definitions.d.ts +4 -0
  334. package/dist/integrations/subagents/definitions.d.ts.map +1 -1
  335. package/dist/integrations/trust/folder-grants.d.ts +21 -1
  336. package/dist/integrations/trust/folder-grants.d.ts.map +1 -1
  337. package/dist/reminders/skills.d.ts.map +1 -1
  338. package/dist/rounds/types.d.ts +5 -0
  339. package/dist/rounds/types.d.ts.map +1 -1
  340. package/dist/skills/add.d.ts +104 -0
  341. package/dist/skills/add.d.ts.map +1 -0
  342. package/dist/skills/audit.d.ts +7 -1
  343. package/dist/skills/audit.d.ts.map +1 -1
  344. package/dist/skills/catalog.d.ts +14 -1
  345. package/dist/skills/catalog.d.ts.map +1 -1
  346. package/dist/skills/create.d.ts +19 -0
  347. package/dist/skills/create.d.ts.map +1 -0
  348. package/dist/skills/desktop-catalog.d.ts +64 -0
  349. package/dist/skills/desktop-catalog.d.ts.map +1 -0
  350. package/dist/skills/install.d.ts +73 -0
  351. package/dist/skills/install.d.ts.map +1 -0
  352. package/dist/skills/installed-list.d.ts +1 -1
  353. package/dist/skills/installed-list.d.ts.map +1 -1
  354. package/dist/skills/overrides.d.ts +56 -0
  355. package/dist/skills/overrides.d.ts.map +1 -0
  356. package/dist/skills/remove.d.ts +38 -0
  357. package/dist/skills/remove.d.ts.map +1 -0
  358. package/dist/skills/save.d.ts +4 -48
  359. package/dist/skills/save.d.ts.map +1 -1
  360. package/dist/skills/store.d.ts +20 -3
  361. package/dist/skills/store.d.ts.map +1 -1
  362. package/dist/skills/usage.d.ts +54 -0
  363. package/dist/skills/usage.d.ts.map +1 -0
  364. package/dist/skills/validate.d.ts +57 -0
  365. package/dist/skills/validate.d.ts.map +1 -0
  366. package/dist/tui/App.d.ts +10 -15
  367. package/dist/tui/App.d.ts.map +1 -1
  368. package/dist/tui/Composer.d.ts +6 -10
  369. package/dist/tui/Composer.d.ts.map +1 -1
  370. package/dist/tui/PendingInputPanel.d.ts +4 -4
  371. package/dist/tui/PendingInputPanel.d.ts.map +1 -1
  372. package/dist/tui/PluginScreen.d.ts +17 -0
  373. package/dist/tui/PluginScreen.d.ts.map +1 -0
  374. package/dist/tui/SaveSkillOverlay.d.ts +8 -0
  375. package/dist/tui/SaveSkillOverlay.d.ts.map +1 -1
  376. package/dist/tui/SkillsManager.d.ts +9 -0
  377. package/dist/tui/SkillsManager.d.ts.map +1 -0
  378. package/dist/tui/TrustPrompt.d.ts.map +1 -1
  379. package/dist/tui/agent.d.ts +17 -0
  380. package/dist/tui/agent.d.ts.map +1 -1
  381. package/dist/tui/plugin-screen.d.ts +243 -0
  382. package/dist/tui/plugin-screen.d.ts.map +1 -0
  383. package/dist/tui/plugin-view.d.ts +4 -0
  384. package/dist/tui/plugin-view.d.ts.map +1 -1
  385. package/dist/tui/skills/suggest-setting.d.ts +3 -3
  386. package/dist/tui/skills-manager.d.ts +145 -0
  387. package/dist/tui/skills-manager.d.ts.map +1 -0
  388. package/dist/tui/slashCommands.d.ts +1 -1
  389. package/dist/tui/slashCommands.d.ts.map +1 -1
  390. package/dist/user-commands/store.d.ts +12 -0
  391. package/dist/user-commands/store.d.ts.map +1 -1
  392. package/package.json +3 -3
  393. package/skills/skill-creator/SKILL.md +2 -2
  394. package/dist/chunks/acp-AQUZCZSO.js.map +0 -6
  395. package/dist/chunks/agent-session-WXWW7E5M.js +0 -92
  396. package/dist/chunks/chunk-3ETXWTV4.js.map +0 -6
  397. package/dist/chunks/chunk-4BAXYUZQ.js.map +0 -6
  398. package/dist/chunks/chunk-567CSU37.js.map +0 -6
  399. package/dist/chunks/chunk-5JVKE4LB.js.map +0 -6
  400. package/dist/chunks/chunk-6IOZY2AB.js.map +0 -6
  401. package/dist/chunks/chunk-AEXGGJUW.js.map +0 -6
  402. package/dist/chunks/chunk-D3SCA6NT.js.map +0 -6
  403. package/dist/chunks/chunk-D6XZ4ZAV.js.map +0 -6
  404. package/dist/chunks/chunk-FK5C7SHM.js.map +0 -6
  405. package/dist/chunks/chunk-FMQCPAKR.js +0 -116
  406. package/dist/chunks/chunk-FMQCPAKR.js.map +0 -6
  407. package/dist/chunks/chunk-FRGOWO6N.js.map +0 -6
  408. package/dist/chunks/chunk-HGTOAMV6.js.map +0 -6
  409. package/dist/chunks/chunk-IRAG3YXW.js.map +0 -6
  410. package/dist/chunks/chunk-JUDJGDYX.js.map +0 -6
  411. package/dist/chunks/chunk-KHGY6QJR.js.map +0 -6
  412. package/dist/chunks/chunk-OOJP5BEK.js.map +0 -6
  413. package/dist/chunks/chunk-OQWLQUO7.js.map +0 -6
  414. package/dist/chunks/chunk-RHJOIAFS.js +0 -201
  415. package/dist/chunks/chunk-RHJOIAFS.js.map +0 -6
  416. package/dist/chunks/exec-2PRVZNUX.js.map +0 -6
  417. package/dist/chunks/hooks-AK5S4YUS.js.map +0 -6
  418. package/dist/chunks/host-queries-HBW7AW44.js +0 -37
  419. package/dist/chunks/mcp-AFLRDYNN.js.map +0 -6
  420. package/dist/chunks/message-command-ZR2JQBBU.js.map +0 -6
  421. package/dist/chunks/plugin-MLHZ42NZ.js +0 -1132
  422. package/dist/chunks/plugin-MLHZ42NZ.js.map +0 -6
  423. package/dist/chunks/resume-AYWSKWEX.js +0 -25
  424. package/dist/chunks/send-person-57F5RJA7.js +0 -32
  425. package/dist/chunks/skills-ICVGYWBH.js +0 -350
  426. package/dist/chunks/skills-ICVGYWBH.js.map +0 -6
  427. package/dist/chunks/tui-Q7ED7VFI.js.map +0 -6
  428. package/dist/chunks/watch-EON3IWRY.js.map +0 -6
  429. package/dist/chunks/worktree-A2DNXLOT.js.map +0 -6
  430. /package/dist/chunks/{activity-command-Y3A6GIFW.js.map → activity-command-JU4HLIQJ.js.map} +0 -0
  431. /package/dist/chunks/{add-DWFKSOYI.js.map → add-S6JYKDI4.js.map} +0 -0
  432. /package/dist/chunks/{agent-Z6PJYBAO.js.map → agent-E343AQV7.js.map} +0 -0
  433. /package/dist/chunks/{agent-session-WXWW7E5M.js.map → agent-session-D6JIOCON.js.map} +0 -0
  434. /package/dist/chunks/{apply-at-exit-SHGR2BAB.js.map → apply-at-exit-MEOJMGNT.js.map} +0 -0
  435. /package/dist/chunks/{archive-KYXU4AZZ.js.map → archive-ZPWC7GZU.js.map} +0 -0
  436. /package/dist/chunks/{auth-R3RCZZ7U.js.map → auth-6NX4TMIG.js.map} +0 -0
  437. /package/dist/chunks/{bin-main-DUZFYUCJ.js.map → bin-main-P3KAQDKC.js.map} +0 -0
  438. /package/dist/chunks/{binding-5UJYMFMU.js.map → binding-6QZVGFQ5.js.map} +0 -0
  439. /package/dist/chunks/{browser-7CFZ6BZS.js.map → browser-KK2U5524.js.map} +0 -0
  440. /package/dist/chunks/{chat-BELD32ZP.js.map → chat-VEXJRSZN.js.map} +0 -0
  441. /package/dist/chunks/{chunk-MDBUSIPW.js.map → chunk-2KVQVPJ7.js.map} +0 -0
  442. /package/dist/chunks/{chunk-MRZHTIE7.js.map → chunk-42JIZXVL.js.map} +0 -0
  443. /package/dist/chunks/{chunk-ESIICAI3.js.map → chunk-4473VICE.js.map} +0 -0
  444. /package/dist/chunks/{chunk-DGYMR4WJ.js.map → chunk-44YG6EI4.js.map} +0 -0
  445. /package/dist/chunks/{chunk-ZQGCZYAE.js.map → chunk-452SL2Y4.js.map} +0 -0
  446. /package/dist/chunks/{chunk-VE4XIWDW.js.map → chunk-4BNCVR3U.js.map} +0 -0
  447. /package/dist/chunks/{chunk-2EVP6BX4.js.map → chunk-4CJ3HPOT.js.map} +0 -0
  448. /package/dist/chunks/{chunk-TORIEDBN.js.map → chunk-4ENL4VUO.js.map} +0 -0
  449. /package/dist/chunks/{chunk-IJ6Z6FNY.js.map → chunk-4KVYTHY7.js.map} +0 -0
  450. /package/dist/chunks/{chunk-YNWPC3HO.js.map → chunk-4Y242BU4.js.map} +0 -0
  451. /package/dist/chunks/{chunk-OA7QKUCM.js.map → chunk-5F4DSPZC.js.map} +0 -0
  452. /package/dist/chunks/{chunk-DRWJTADQ.js.map → chunk-5IGEQN7L.js.map} +0 -0
  453. /package/dist/chunks/{chunk-W752G3FM.js.map → chunk-5ZLKTFU2.js.map} +0 -0
  454. /package/dist/chunks/{chunk-KETRBV2E.js.map → chunk-66QIFMEO.js.map} +0 -0
  455. /package/dist/chunks/{chunk-CEZW3NVM.js.map → chunk-6W3UGXGG.js.map} +0 -0
  456. /package/dist/chunks/{chunk-S7FE35WQ.js.map → chunk-75YLZNZW.js.map} +0 -0
  457. /package/dist/chunks/{chunk-P4TCLMD6.js.map → chunk-AC5P6W3G.js.map} +0 -0
  458. /package/dist/chunks/{chunk-GUK47JTV.js.map → chunk-AYMB4AOZ.js.map} +0 -0
  459. /package/dist/chunks/{chunk-23D5IXMW.js.map → chunk-B4AOCHH6.js.map} +0 -0
  460. /package/dist/chunks/{chunk-FEOS7UZ2.js.map → chunk-BA7KUG6V.js.map} +0 -0
  461. /package/dist/chunks/{chunk-D35UCVTK.js.map → chunk-BHQHTM3Z.js.map} +0 -0
  462. /package/dist/chunks/{chunk-KPOOM7QT.js.map → chunk-BNLIRJ3M.js.map} +0 -0
  463. /package/dist/chunks/{chunk-MDVYEFTI.js.map → chunk-BURGRQWO.js.map} +0 -0
  464. /package/dist/chunks/{chunk-DKSFQRUM.js.map → chunk-BWD2TUI4.js.map} +0 -0
  465. /package/dist/chunks/{chunk-7Y4RR47U.js.map → chunk-C7E7YCRD.js.map} +0 -0
  466. /package/dist/chunks/{chunk-44MFZJ24.js.map → chunk-CXW7I2S3.js.map} +0 -0
  467. /package/dist/chunks/{chunk-73HWWJYC.js.map → chunk-D6PB3Z7Q.js.map} +0 -0
  468. /package/dist/chunks/{chunk-QTHG6UPU.js.map → chunk-DEAG4G5J.js.map} +0 -0
  469. /package/dist/chunks/{chunk-WGC5DJEW.js.map → chunk-DRSQTKDN.js.map} +0 -0
  470. /package/dist/chunks/{chunk-WXYRLTRY.js.map → chunk-EXJJLYZK.js.map} +0 -0
  471. /package/dist/chunks/{chunk-PFVYYH6O.js.map → chunk-F5W4TNCR.js.map} +0 -0
  472. /package/dist/chunks/{chunk-Q6PZODSV.js.map → chunk-F7KOBJVW.js.map} +0 -0
  473. /package/dist/chunks/{chunk-VSNV3U2B.js.map → chunk-FK4MAZV2.js.map} +0 -0
  474. /package/dist/chunks/{chunk-G5LPTLLY.js.map → chunk-FPC3K4TT.js.map} +0 -0
  475. /package/dist/chunks/{chunk-XLXPPVUT.js.map → chunk-FVIKYFYD.js.map} +0 -0
  476. /package/dist/chunks/{chunk-PQT7624W.js.map → chunk-GPTYDM26.js.map} +0 -0
  477. /package/dist/chunks/{chunk-TP7DRQXE.js.map → chunk-GT22EDUB.js.map} +0 -0
  478. /package/dist/chunks/{chunk-GEVWZWLM.js.map → chunk-GTUTBTOV.js.map} +0 -0
  479. /package/dist/chunks/{chunk-GQ6WXY3M.js.map → chunk-H6NTNPWD.js.map} +0 -0
  480. /package/dist/chunks/{chunk-TYNAB5GR.js.map → chunk-HCQGZPVT.js.map} +0 -0
  481. /package/dist/chunks/{chunk-LB4HC5U7.js.map → chunk-HG2PPCAE.js.map} +0 -0
  482. /package/dist/chunks/{chunk-ABKURT35.js.map → chunk-HKRUNZVI.js.map} +0 -0
  483. /package/dist/chunks/{chunk-JPM3JXZB.js.map → chunk-HM7L5PM2.js.map} +0 -0
  484. /package/dist/chunks/{chunk-UFGLSUGU.js.map → chunk-I4RC6KQQ.js.map} +0 -0
  485. /package/dist/chunks/{chunk-HW2QBNAA.js.map → chunk-IL4Y3JGT.js.map} +0 -0
  486. /package/dist/chunks/{chunk-24EZWZDZ.js.map → chunk-J4PL65DJ.js.map} +0 -0
  487. /package/dist/chunks/{chunk-E65IWYTT.js.map → chunk-JECLB23L.js.map} +0 -0
  488. /package/dist/chunks/{chunk-3RLKUXXG.js.map → chunk-JJ72TLOA.js.map} +0 -0
  489. /package/dist/chunks/{chunk-CG5CGXNF.js.map → chunk-JRBFL6WT.js.map} +0 -0
  490. /package/dist/chunks/{chunk-KBLYZ7L7.js.map → chunk-K2EKXCLZ.js.map} +0 -0
  491. /package/dist/chunks/{chunk-WW3AU2YN.js.map → chunk-ME4LETA3.js.map} +0 -0
  492. /package/dist/chunks/{chunk-J5E4DV6R.js.map → chunk-MF3SFDBW.js.map} +0 -0
  493. /package/dist/chunks/{chunk-WSDZIJNK.js.map → chunk-MK42KB72.js.map} +0 -0
  494. /package/dist/chunks/{chunk-RZKIZTPA.js.map → chunk-MUSGZEFY.js.map} +0 -0
  495. /package/dist/chunks/{chunk-MF5KTVGJ.js.map → chunk-N5CCXOYK.js.map} +0 -0
  496. /package/dist/chunks/{chunk-KVNL7XA6.js.map → chunk-NBJ5PRAY.js.map} +0 -0
  497. /package/dist/chunks/{chunk-E4RVHFV6.js.map → chunk-NKHEBASJ.js.map} +0 -0
  498. /package/dist/chunks/{chunk-SS6IJAPA.js.map → chunk-NVWD5XDT.js.map} +0 -0
  499. /package/dist/chunks/{chunk-7LDUPEXP.js.map → chunk-O45DCUNX.js.map} +0 -0
  500. /package/dist/chunks/{chunk-G76POTWW.js.map → chunk-PAUMCJPX.js.map} +0 -0
  501. /package/dist/chunks/{chunk-MF57EX7H.js.map → chunk-PE4MWWUW.js.map} +0 -0
  502. /package/dist/chunks/{chunk-4RW7GDJ4.js.map → chunk-PLCWCIL4.js.map} +0 -0
  503. /package/dist/chunks/{chunk-XVOPQCPD.js.map → chunk-PRJO4XM3.js.map} +0 -0
  504. /package/dist/chunks/{chunk-CQFWLYTK.js.map → chunk-PRRX5LNR.js.map} +0 -0
  505. /package/dist/chunks/{chunk-3PH6F6Z3.js.map → chunk-PS5SVAUJ.js.map} +0 -0
  506. /package/dist/chunks/{chunk-P725GKKG.js.map → chunk-PZWSRAE7.js.map} +0 -0
  507. /package/dist/chunks/{chunk-CNSKJ3DZ.js.map → chunk-QCV3HH4P.js.map} +0 -0
  508. /package/dist/chunks/{chunk-7J23SPSX.js.map → chunk-QGBR42TV.js.map} +0 -0
  509. /package/dist/chunks/{chunk-6CSJRIUZ.js.map → chunk-QNJXULU7.js.map} +0 -0
  510. /package/dist/chunks/{chunk-DJKWBSVM.js.map → chunk-R2KAESOM.js.map} +0 -0
  511. /package/dist/chunks/{chunk-AIQKSTVJ.js.map → chunk-R6M6EIAH.js.map} +0 -0
  512. /package/dist/chunks/{chunk-VJHENTNB.js.map → chunk-RKKU2RE4.js.map} +0 -0
  513. /package/dist/chunks/{chunk-JZTTOZRG.js.map → chunk-RMOTHWPV.js.map} +0 -0
  514. /package/dist/chunks/{chunk-EA6YICQ7.js.map → chunk-RQAY7REG.js.map} +0 -0
  515. /package/dist/chunks/{chunk-LWJJDERP.js.map → chunk-SLTJNYOU.js.map} +0 -0
  516. /package/dist/chunks/{chunk-UL6MZ5OM.js.map → chunk-SXONHO4H.js.map} +0 -0
  517. /package/dist/chunks/{chunk-W4S4ZBXX.js.map → chunk-T7ILM666.js.map} +0 -0
  518. /package/dist/chunks/{chunk-E6FMAE5Q.js.map → chunk-TBGKPWCL.js.map} +0 -0
  519. /package/dist/chunks/{chunk-ACO3LTRT.js.map → chunk-TBJ6XU3T.js.map} +0 -0
  520. /package/dist/chunks/{chunk-5HMJ3DYR.js.map → chunk-TMPP2DEY.js.map} +0 -0
  521. /package/dist/chunks/{chunk-6YXHH5JW.js.map → chunk-TSOZBRM6.js.map} +0 -0
  522. /package/dist/chunks/{chunk-SSPHAILP.js.map → chunk-TTFPWGIU.js.map} +0 -0
  523. /package/dist/chunks/{chunk-TRRKG642.js.map → chunk-TTKMQW6B.js.map} +0 -0
  524. /package/dist/chunks/{chunk-2VP2Q657.js.map → chunk-UCML5ZXB.js.map} +0 -0
  525. /package/dist/chunks/{chunk-OH7EYW3T.js.map → chunk-VG7245VJ.js.map} +0 -0
  526. /package/dist/chunks/{chunk-QZTTIL3A.js.map → chunk-VQZPXK4X.js.map} +0 -0
  527. /package/dist/chunks/{chunk-O2PZDA5H.js.map → chunk-VWUTJ4EU.js.map} +0 -0
  528. /package/dist/chunks/{chunk-VL6Z2OMG.js.map → chunk-WDKAL7EW.js.map} +0 -0
  529. /package/dist/chunks/{chunk-2KC52MDS.js.map → chunk-WJ6QRVL6.js.map} +0 -0
  530. /package/dist/chunks/{chunk-XJALHM5Z.js.map → chunk-WOTA5FO5.js.map} +0 -0
  531. /package/dist/chunks/{chunk-4TJ7AGQO.js.map → chunk-WPGVZMSU.js.map} +0 -0
  532. /package/dist/chunks/{chunk-DJTCZSSY.js.map → chunk-XDUA6PBP.js.map} +0 -0
  533. /package/dist/chunks/{chunk-PKFXIWVX.js.map → chunk-XE6XT6R6.js.map} +0 -0
  534. /package/dist/chunks/{chunk-LXJW3ZYI.js.map → chunk-YWRRS7SO.js.map} +0 -0
  535. /package/dist/chunks/{chunk-JRWUIW4J.js.map → chunk-ZHEEG3NS.js.map} +0 -0
  536. /package/dist/chunks/{cli-runtime-P6LCHPBA.js.map → cli-runtime-ZJKKIW4H.js.map} +0 -0
  537. /package/dist/chunks/{commands-BNHIQVYO.js.map → commands-TQH5DD22.js.map} +0 -0
  538. /package/dist/chunks/{computer-6P3GAOV2.js.map → computer-WOU5WIIR.js.map} +0 -0
  539. /package/dist/chunks/{config-ZMXMX2WY.js.map → config-APYUJ5UW.js.map} +0 -0
  540. /package/dist/chunks/{cost-BJKADKEZ.js.map → cost-5YV27U7F.js.map} +0 -0
  541. /package/dist/chunks/{crash-report-OJHGVRD7.js.map → crash-report-QVXU2YVL.js.map} +0 -0
  542. /package/dist/chunks/{dist-PMSBTFU5.js.map → dist-2FSOLP72.js.map} +0 -0
  543. /package/dist/chunks/{dist-43XWK3LF.js.map → dist-AOT4CEP5.js.map} +0 -0
  544. /package/dist/chunks/{dist-4LEGETQA.js.map → dist-H7CAJ3ZW.js.map} +0 -0
  545. /package/dist/chunks/{dist-NCBDELMI.js.map → dist-IZGKRIWL.js.map} +0 -0
  546. /package/dist/chunks/{dist-BGJEX527.js.map → dist-J4UXFVYR.js.map} +0 -0
  547. /package/dist/chunks/{dist-FMFNU4M3.js.map → dist-JHKRSGW6.js.map} +0 -0
  548. /package/dist/chunks/{dist-4ZPDHZOX.js.map → dist-PZYMYR7N.js.map} +0 -0
  549. /package/dist/chunks/{dist-ADQAO5C3.js.map → dist-Z2HW2SJR.js.map} +0 -0
  550. /package/dist/chunks/{doctor-AIYB27QY.js.map → doctor-CM6UPXG5.js.map} +0 -0
  551. /package/dist/chunks/{drain-PYKX4QNR.js.map → drain-X6RURKKC.js.map} +0 -0
  552. /package/dist/chunks/{entry-HM5E7KCD.js.map → entry-QQDPY6ZL.js.map} +0 -0
  553. /package/dist/chunks/{eval-H4NKZYVV.js.map → eval-GZA22B4I.js.map} +0 -0
  554. /package/dist/chunks/{extension-4233XOZW.js.map → extension-N5IQNKVZ.js.map} +0 -0
  555. /package/dist/chunks/{github-IF3JVVJF.js.map → github-AUOENJUY.js.map} +0 -0
  556. /package/dist/chunks/{home-AZY7APF6.js.map → home-I4FIB6FV.js.map} +0 -0
  557. /package/dist/chunks/{homes-WL6LAAY5.js.map → homes-WTMMXQ6G.js.map} +0 -0
  558. /package/dist/chunks/{hooks-report-NJLGBWN3.js.map → hooks-report-K6VOPVBR.js.map} +0 -0
  559. /package/dist/chunks/{host-SX3QC5FN.js.map → host-65UFBZJV.js.map} +0 -0
  560. /package/dist/chunks/{host-queries-HBW7AW44.js.map → host-queries-L4PYE2BW.js.map} +0 -0
  561. /package/dist/chunks/{installed-list-44QXUJFE.js.map → installed-list-7QIWVKLQ.js.map} +0 -0
  562. /package/dist/chunks/{learn-LW4DLSGZ.js.map → learn-NZXLKYV4.js.map} +0 -0
  563. /package/dist/chunks/{learn-builtin-4RV2XDH4.js.map → learn-builtin-RC4XXVBS.js.map} +0 -0
  564. /package/dist/chunks/{lifecycle-AJCHTSAF.js.map → lifecycle-NLCZ6OPA.js.map} +0 -0
  565. /package/dist/chunks/{list-DT7AJVPX.js.map → list-2U67CAWS.js.map} +0 -0
  566. /package/dist/chunks/{live-Z6HZFXPW.js.map → live-CWJ2NWUQ.js.map} +0 -0
  567. /package/dist/chunks/{load-454TJBPW.js.map → load-H52QQBVE.js.map} +0 -0
  568. /package/dist/chunks/{logs-GRUSUSL7.js.map → logs-ZIW3QFU4.js.map} +0 -0
  569. /package/dist/chunks/{mcp-serve-NNWP4IES.js.map → mcp-serve-ZC2OKIPP.js.map} +0 -0
  570. /package/dist/chunks/{open-Z3BELFL7.js.map → open-AHDQMVXI.js.map} +0 -0
  571. /package/dist/chunks/{operator-tools-PN3SPQ3C.js.map → operator-tools-P5R4TF6N.js.map} +0 -0
  572. /package/dist/chunks/{output-schema-DSR56W6A.js.map → output-schema-Q5RWHNKE.js.map} +0 -0
  573. /package/dist/chunks/{pal-ZOH5ILEV.js.map → pal-T42HU4AK.js.map} +0 -0
  574. /package/dist/chunks/{peers-LXNB4QSL.js.map → peers-5RYEA7IA.js.map} +0 -0
  575. /package/dist/chunks/{peers-WINODTEB.js.map → peers-7ZG3DEBO.js.map} +0 -0
  576. /package/dist/chunks/{providers-UOTUEQOJ.js.map → providers-BXXIM7EW.js.map} +0 -0
  577. /package/dist/chunks/{providers-AVECY67I.js.map → providers-I24HYZXG.js.map} +0 -0
  578. /package/dist/chunks/{pty-GW2YC23H.js.map → pty-WVKM6ATI.js.map} +0 -0
  579. /package/dist/chunks/{resume-AYWSKWEX.js.map → resume-F7JEDBHI.js.map} +0 -0
  580. /package/dist/chunks/{resume-command-FXT3KGLC.js.map → resume-command-4I47WN7T.js.map} +0 -0
  581. /package/dist/chunks/{running-3NLAODZ7.js.map → running-VID6BVT2.js.map} +0 -0
  582. /package/dist/chunks/{schedule-TTQUT45H.js.map → schedule-75IZH76Z.js.map} +0 -0
  583. /package/dist/chunks/{send-FRNTRW2M.js.map → send-QRYY2NCG.js.map} +0 -0
  584. /package/dist/chunks/{send-person-57F5RJA7.js.map → send-person-VADQNJBN.js.map} +0 -0
  585. /package/dist/chunks/{service-TCKPUGL5.js.map → service-B6BNESZB.js.map} +0 -0
  586. /package/dist/chunks/{setting-cli-HGYOIGC6.js.map → setting-cli-O4YWOIU5.js.map} +0 -0
  587. /package/dist/chunks/{start-check-C5VJXVPY.js.map → start-check-EKRXJ5VE.js.map} +0 -0
  588. /package/dist/chunks/{startup-failure-YQSEQRNQ.js.map → startup-failure-2UJKPNMR.js.map} +0 -0
  589. /package/dist/chunks/{state-2DBTSDEP.js.map → state-X3MKUFYM.js.map} +0 -0
  590. /package/dist/chunks/{store-CZGKLVTT.js.map → store-4OXWHFS5.js.map} +0 -0
  591. /package/dist/chunks/{store-JJKCDY7Y.js.map → store-MK5IYBE5.js.map} +0 -0
  592. /package/dist/chunks/{store-RJZCW2MI.js.map → store-QFNY4BV4.js.map} +0 -0
  593. /package/dist/chunks/{store-S4BT3ESJ.js.map → store-VRKKFOYW.js.map} +0 -0
  594. /package/dist/chunks/{update-G7D3YCH5.js.map → update-ELZEXYIX.js.map} +0 -0
  595. /package/dist/chunks/{workspaces-O6S2OTDL.js.map → workspaces-3LB4SPPS.js.map} +0 -0
@@ -2,19 +2,71 @@ import { createRequire as __namzuCreateRequire } from 'node:module';
2
2
  const require = __namzuCreateRequire(import.meta.url);
3
3
  import {
4
4
  dispatchCliPalMessages
5
- } from "./chunk-E6FMAE5Q.js";
5
+ } from "./chunk-TBGKPWCL.js";
6
6
  import {
7
+ SKILL_ADD_MAX_INPUTS,
8
+ SKILL_FILE_MAX_BYTES,
9
+ SkillInputError,
10
+ createSkill,
11
+ digestFiles,
12
+ installPrepared,
13
+ readSkillInput,
14
+ removeSkill,
15
+ skillsFolderFor
16
+ } from "./chunk-AMYP2WPW.js";
17
+ import {
18
+ approveListedAnyMcpServers,
7
19
  checkUserMcpServerSave,
20
+ listAllMcpServers,
8
21
  listEntryForUserMcpServer,
22
+ pluginConfigFor,
9
23
  readUserMcpServerForms,
10
- readUserMcpServers,
11
24
  removeUserMcpServer,
12
- saveUserMcpServer,
13
- summarizeUserMcpServer
14
- } from "./chunk-IRAG3YXW.js";
25
+ saveUserMcpServer
26
+ } from "./chunk-WYA4QWWE.js";
27
+ import {
28
+ DOWNLOAD_BLOCKED,
29
+ FetchError,
30
+ InstallConflict,
31
+ LOCAL_UPLOADS_MARKETPLACE,
32
+ MARKETPLACE_BLOCKED,
33
+ MARKETPLACE_NOTICE,
34
+ MAX_CATALOG_PLUGINS,
35
+ PlanRefusal,
36
+ SimulatedCrash,
37
+ anotherPlace,
38
+ commitInstall,
39
+ commitUpdate,
40
+ compareUpdate,
41
+ countNotInstallable,
42
+ describeAddition,
43
+ describeSource,
44
+ discardStaging,
45
+ downloadBlocked,
46
+ fetchMarketplace,
47
+ fetchNotes,
48
+ hashExecutableFiles,
49
+ isBlockedSource,
50
+ marketplaceNameProblem,
51
+ newStaging,
52
+ parseMarketplaceAddress,
53
+ placeMarketplace,
54
+ planInstall,
55
+ readCatalog,
56
+ readFetchedCatalog,
57
+ readPluginManifestDetails,
58
+ realPathOf,
59
+ refreshRemoteMarketplace,
60
+ removeInstall,
61
+ renderInstallPreview,
62
+ resolveEntrySource,
63
+ sameSource,
64
+ sameVersionChanged,
65
+ stateFailure
66
+ } from "./chunk-BJT37HR4.js";
15
67
  import {
16
68
  decideHeadlessTrust
17
- } from "./chunk-JRWUIW4J.js";
69
+ } from "./chunk-ZHEEG3NS.js";
18
70
  import {
19
71
  conversationMarkdown,
20
72
  createExtensionsRpc,
@@ -26,11 +78,12 @@ import {
26
78
  previousSentAt,
27
79
  runCommand,
28
80
  sharedExtensionHost,
81
+ skillStateOf,
29
82
  startDesktopExtensions,
30
83
  stopDesktopExtensions,
31
84
  withKeyNote
32
- } from "./chunk-3ETXWTV4.js";
33
- import "./chunk-YNWPC3HO.js";
85
+ } from "./chunk-D2R47LDH.js";
86
+ import "./chunk-4Y242BU4.js";
34
87
  import "./chunk-6ITTTCLD.js";
35
88
  import {
36
89
  advertisedPromptModes,
@@ -40,17 +93,17 @@ import {
40
93
  outcomeLine,
41
94
  sessionOptionsFromConfig,
42
95
  turnOptionsFromConfig
43
- } from "./chunk-MRZHTIE7.js";
96
+ } from "./chunk-42JIZXVL.js";
44
97
  import {
45
98
  launchRefusal
46
- } from "./chunk-QTHG6UPU.js";
99
+ } from "./chunk-DEAG4G5J.js";
47
100
  import {
48
101
  HeadlessScreen
49
102
  } from "./chunk-GWGIAZLZ.js";
50
103
  import "./chunk-6HTC5TQ3.js";
51
104
  import {
52
105
  palSessionEnvironment
53
- } from "./chunk-W4S4ZBXX.js";
106
+ } from "./chunk-T7ILM666.js";
54
107
  import {
55
108
  FileCheckpointStore,
56
109
  IdleCompactor,
@@ -66,37 +119,52 @@ import {
66
119
  looksSecret,
67
120
  probeAgentSession,
68
121
  readMemoryBody,
122
+ readSkillUsage,
69
123
  screenQuestionApp,
70
124
  searchHitExcerpt,
71
125
  sessionLogCheckpointView,
72
126
  updateManagedMemory,
73
127
  validateComposerSendSettings,
74
128
  verifyCredential
75
- } from "./chunk-OQWLQUO7.js";
76
- import "./chunk-567CSU37.js";
77
- import "./chunk-DGYMR4WJ.js";
78
- import "./chunk-JZTTOZRG.js";
79
- import "./chunk-D3SCA6NT.js";
80
- import "./chunk-4RW7GDJ4.js";
81
- import "./chunk-FMQCPAKR.js";
82
- import "./chunk-6IOZY2AB.js";
129
+ } from "./chunk-KSRN5Y2O.js";
130
+ import "./chunk-K7YZJV2X.js";
131
+ import "./chunk-44YG6EI4.js";
132
+ import "./chunk-RMOTHWPV.js";
133
+ import "./chunk-IMMUS7IW.js";
134
+ import "./chunk-PLCWCIL4.js";
135
+ import "./chunk-32OIBGYI.js";
136
+ import "./chunk-QBLHOG2F.js";
137
+ import {
138
+ currentEnabledAnswer,
139
+ loadInstalledManifest,
140
+ planInstalledPlugins,
141
+ readInstallManifest,
142
+ readLayers,
143
+ readRecordLayer,
144
+ recordLayerPath,
145
+ removeExtraKnownMarketplace,
146
+ setEnabledPlugin,
147
+ setExtraKnownMarketplace,
148
+ surfaceDigest
149
+ } from "./chunk-KF6IKSF2.js";
83
150
  import {
84
151
  resolveProgressNudge
85
- } from "./chunk-LB4HC5U7.js";
86
- import "./chunk-W752G3FM.js";
87
- import "./chunk-D35UCVTK.js";
152
+ } from "./chunk-HG2PPCAE.js";
153
+ import "./chunk-5ZLKTFU2.js";
154
+ import "./chunk-BHQHTM3Z.js";
88
155
  import {
89
156
  findProject
90
- } from "./chunk-SSPHAILP.js";
91
- import "./chunk-LXJW3ZYI.js";
92
- import "./chunk-VL6Z2OMG.js";
157
+ } from "./chunk-TTFPWGIU.js";
158
+ import "./chunk-YWRRS7SO.js";
159
+ import "./chunk-WDKAL7EW.js";
93
160
  import "./chunk-YOWYTBJS.js";
94
- import "./chunk-JUDJGDYX.js";
161
+ import "./chunk-XNQY26AE.js";
162
+ import "./chunk-EBBT2I5S.js";
95
163
  import "./chunk-NUGPLXVK.js";
96
- import "./chunk-KPOOM7QT.js";
164
+ import "./chunk-BNLIRJ3M.js";
97
165
  import "./chunk-SD25ASC7.js";
98
- import "./chunk-DKSFQRUM.js";
99
- import "./chunk-GEVWZWLM.js";
166
+ import "./chunk-BWD2TUI4.js";
167
+ import "./chunk-GTUTBTOV.js";
100
168
  import {
101
169
  cliPalComputerStatus,
102
170
  cliPalScreen,
@@ -109,19 +177,19 @@ import {
109
177
  startCliPalComputer,
110
178
  stopCliPalComputer,
111
179
  takeOverCliPalComputer
112
- } from "./chunk-S7FE35WQ.js";
180
+ } from "./chunk-75YLZNZW.js";
113
181
  import "./chunk-ZWA2JRJV.js";
114
182
  import {
115
183
  cliPalActivitySubscriptionPolicy,
116
184
  cliPalActivitySubscriptionStore,
117
185
  cliPalCommunicationPolicy,
118
186
  cliPalCommunicationStore
119
- } from "./chunk-24EZWZDZ.js";
187
+ } from "./chunk-J4PL65DJ.js";
120
188
  import {
121
189
  claimPalConversation,
122
190
  listPalConversations,
123
191
  palConversationBinding
124
- } from "./chunk-TORIEDBN.js";
192
+ } from "./chunk-4ENL4VUO.js";
125
193
  import {
126
194
  archiveConversation,
127
195
  closeSessions,
@@ -143,13 +211,13 @@ import {
143
211
  storedAssistantPhase,
144
212
  titlesOf,
145
213
  unarchiveConversation
146
- } from "./chunk-OH7EYW3T.js";
214
+ } from "./chunk-VG7245VJ.js";
147
215
  import {
148
216
  INSTRUCTIONS_FILENAME,
149
217
  MAX_BYTES_TO_READ,
150
218
  MAX_CHARS_PER_FILE,
151
219
  cliProjectRoot
152
- } from "./chunk-XJALHM5Z.js";
220
+ } from "./chunk-WOTA5FO5.js";
153
221
  import {
154
222
  cliPalStore,
155
223
  createPal,
@@ -159,17 +227,17 @@ import {
159
227
  listPals,
160
228
  palAtWorkspace,
161
229
  updatePal
162
- } from "./chunk-5HMJ3DYR.js";
163
- import "./chunk-TYNAB5GR.js";
230
+ } from "./chunk-TMPP2DEY.js";
231
+ import "./chunk-HCQGZPVT.js";
164
232
  import "./chunk-7TDOAGVX.js";
165
233
  import {
166
234
  buildCostReport
167
- } from "./chunk-23D5IXMW.js";
168
- import "./chunk-P4TCLMD6.js";
235
+ } from "./chunk-B4AOCHH6.js";
236
+ import "./chunk-AC5P6W3G.js";
169
237
  import "./chunk-LYUY2FK2.js";
170
238
  import {
171
239
  accountForProvider
172
- } from "./chunk-CQFWLYTK.js";
240
+ } from "./chunk-PRRX5LNR.js";
173
241
  import {
174
242
  flushCompileCacheWhenIdle
175
243
  } from "./chunk-SOIP273Z.js";
@@ -182,27 +250,33 @@ import {
182
250
  } from "./chunk-JEW7RLYH.js";
183
251
  import {
184
252
  warnBroadAllowRules
185
- } from "./chunk-KVNL7XA6.js";
253
+ } from "./chunk-NBJ5PRAY.js";
186
254
  import "./chunk-EDOJTQQU.js";
187
- import "./chunk-MF57EX7H.js";
255
+ import "./chunk-PE4MWWUW.js";
188
256
  import {
257
+ displayPath
258
+ } from "./chunk-EWPGU4HH.js";
259
+ import {
260
+ SKILL_BODY_MAX_BYTES,
261
+ SKILL_DESCRIPTION_MAX_CHARS,
262
+ SKILL_NAME_MAX_CHARS,
189
263
  buildSaveSkillTool,
190
264
  describeCollision,
191
- displayPath,
192
- newSkillPrompt
193
- } from "./chunk-FK5C7SHM.js";
265
+ newSkillPrompt,
266
+ planSkillTargets
267
+ } from "./chunk-PZLPACNY.js";
194
268
  import "./chunk-ZKCOQZ3U.js";
195
269
  import "./chunk-BBTPD3DU.js";
196
270
  import "./chunk-5OYJXSMZ.js";
197
- import "./chunk-QZTTIL3A.js";
271
+ import "./chunk-VQZPXK4X.js";
198
272
  import "./chunk-GNBMKISG.js";
199
273
  import {
200
274
  handoffContinuationNote
201
- } from "./chunk-3PH6F6Z3.js";
202
- import "./chunk-7J23SPSX.js";
275
+ } from "./chunk-PS5SVAUJ.js";
276
+ import "./chunk-QGBR42TV.js";
203
277
  import {
204
278
  isPermissionMode
205
- } from "./chunk-ZQGCZYAE.js";
279
+ } from "./chunk-452SL2Y4.js";
206
280
  import "./chunk-P65AXQPL.js";
207
281
  import {
208
282
  TERMINAL_MARKER,
@@ -214,18 +288,31 @@ import {
214
288
  loadHostPty,
215
289
  processesCarrying,
216
290
  quietConptyHelper
217
- } from "./chunk-2EVP6BX4.js";
291
+ } from "./chunk-4CJ3HPOT.js";
218
292
  import {
219
293
  CLI_VERSION
220
294
  } from "./chunk-HE7WUOX2.js";
221
295
  import "./chunk-OH6TB27S.js";
222
- import "./chunk-4BAXYUZQ.js";
223
- import "./chunk-WSDZIJNK.js";
296
+ import "./chunk-4DSUVT37.js";
297
+ import "./chunk-MK42KB72.js";
224
298
  import {
225
299
  PluginSettingsStore
226
- } from "./chunk-AEXGGJUW.js";
227
- import "./chunk-ACO3LTRT.js";
228
- import "./chunk-HW2QBNAA.js";
300
+ } from "./chunk-6TUHWKXP.js";
301
+ import {
302
+ readSkillHooks
303
+ } from "./chunk-TBJ6XU3T.js";
304
+ import {
305
+ installedPluginsPath,
306
+ isPluginId,
307
+ putKnownMarketplace,
308
+ readInstalledPlugins,
309
+ readKnownMarketplaces,
310
+ realPathOrResolved,
311
+ removeKnownMarketplace,
312
+ samePath,
313
+ splitPluginId
314
+ } from "./chunk-D4TXOX34.js";
315
+ import "./chunk-IL4Y3JGT.js";
229
316
  import {
230
317
  automaticKind,
231
318
  canSelectModel,
@@ -235,20 +322,24 @@ import {
235
322
  removeProviderKey,
236
323
  saveProviderKey,
237
324
  typedKeyProvider
238
- } from "./chunk-KBLYZ7L7.js";
325
+ } from "./chunk-K2EKXCLZ.js";
239
326
  import {
240
327
  isOfferableModel
241
328
  } from "./chunk-4QIWRKJO.js";
242
329
  import "./chunk-KTPFUCRU.js";
243
330
  import "./chunk-LPPFJYL6.js";
244
- import "./chunk-4TIUY3Q6.js";
245
- import "./chunk-4TJ7AGQO.js";
331
+ import {
332
+ discoverSkillRoster,
333
+ parseSkillMarkdown,
334
+ skillTierLabel
335
+ } from "./chunk-6HYK4DDB.js";
336
+ import "./chunk-WPGVZMSU.js";
246
337
  import {
247
338
  isTrusted,
248
339
  isTrustedAtStateRoot,
249
340
  trustDir,
250
341
  untrustDir
251
- } from "./chunk-O2PZDA5H.js";
342
+ } from "./chunk-VWUTJ4EU.js";
252
343
  import "./chunk-24V2WEKR.js";
253
344
  import {
254
345
  systemClock
@@ -256,27 +347,25 @@ import {
256
347
  import "./chunk-I4GTRFPK.js";
257
348
  import {
258
349
  checkSetting,
350
+ planSettingChange,
259
351
  readSettings,
260
352
  writeSetting
261
- } from "./chunk-OSC47PCX.js";
353
+ } from "./chunk-2DCOB33W.js";
262
354
  import {
263
355
  userConfigPath
264
- } from "./chunk-CEZW3NVM.js";
265
- import "./chunk-XLXPPVUT.js";
356
+ } from "./chunk-6W3UGXGG.js";
357
+ import "./chunk-FVIKYFYD.js";
266
358
  import {
267
- approveShownMcpServers,
268
359
  compileBrowserSites,
269
- fingerprintMcpServer,
270
360
  loadBootstrapConfigWithProvenance,
271
361
  loadConfig,
272
- pendingProjectMcpServers,
273
362
  withBrowserSiteRules
274
- } from "./chunk-KHGY6QJR.js";
363
+ } from "./chunk-O4EILTV6.js";
275
364
  import {
276
365
  compilePermissionLayers,
277
366
  permissionLayersOf,
278
367
  warnLegacyMcpPermissionNames
279
- } from "./chunk-ABKURT35.js";
368
+ } from "./chunk-HKRUNZVI.js";
280
369
  import "./chunk-5WORROIE.js";
281
370
  import "./chunk-WMEZTDLT.js";
282
371
  import "./chunk-LCGXWCVU.js";
@@ -286,19 +375,21 @@ import "./chunk-GMUWAUKQ.js";
286
375
  import "./chunk-PJ6IEIKJ.js";
287
376
  import {
288
377
  cliLogger
289
- } from "./chunk-XVOPQCPD.js";
378
+ } from "./chunk-PRJO4XM3.js";
290
379
  import "./chunk-G6YSAHKC.js";
291
380
  import {
292
381
  canonicalProjectPath
293
382
  } from "./chunk-JORONMD3.js";
294
383
  import {
295
384
  StateFileUnreadableError
296
- } from "./chunk-PFVYYH6O.js";
297
- import "./chunk-GUK47JTV.js";
385
+ } from "./chunk-F5W4TNCR.js";
386
+ import "./chunk-AYMB4AOZ.js";
298
387
  import "./chunk-WRPEQ3KP.js";
299
- import "./chunk-44MFZJ24.js";
388
+ import "./chunk-CXW7I2S3.js";
300
389
  import "./chunk-A6RHRNY2.js";
301
- import "./chunk-CG5CGXNF.js";
390
+ import {
391
+ namzuHomePath
392
+ } from "./chunk-JRBFL6WT.js";
302
393
  import "./chunk-U5UV2YRE.js";
303
394
  import "./chunk-PHW6PWIJ.js";
304
395
  import {
@@ -346,7 +437,7 @@ import {
346
437
  selectAssistantText,
347
438
  turnHolder,
348
439
  withSessionChildMarker
349
- } from "./chunk-5JVKE4LB.js";
440
+ } from "./chunk-QQ4S6MNH.js";
350
441
  import {
351
442
  __name
352
443
  } from "./chunk-76FLAFCG.js";
@@ -475,10 +566,10 @@ async function localSpendEstimate(provider, now = Date.now) {
475
566
  __name(localSpendEstimate, "localSpendEstimate");
476
567
 
477
568
  // src/commands/acp.ts
478
- import { randomUUID as randomUUID7 } from "node:crypto";
569
+ import { randomUUID as randomUUID9 } from "node:crypto";
479
570
  import { readFileSync as readFileSync3 } from "node:fs";
480
571
  import { readFile as readFile3 } from "node:fs/promises";
481
- import { dirname as dirname3, join as join8, relative as relative2 } from "node:path";
572
+ import { dirname as dirname4, join as join9, relative as relative3 } from "node:path";
482
573
  import { fileURLToPath } from "node:url";
483
574
 
484
575
  // src/integrations/plugins/inventory.ts
@@ -494,8 +585,13 @@ async function readPluginInventory({
494
585
  }) {
495
586
  if (runtime) {
496
587
  const loaded = runtime.list();
588
+ const shown = loaded.slice(0, MAX_PLUGINS);
589
+ const details = await Promise.all(
590
+ shown.map((plugin) => readPluginManifestDetails(plugin.rootDir))
591
+ );
497
592
  return {
498
- plugins: loaded.slice(0, MAX_PLUGINS).map((plugin) => ({
593
+ plugins: shown.map((plugin, index) => ({
594
+ ...details[index],
499
595
  name: text(plugin.name),
500
596
  version: text(plugin.version),
501
597
  description: text(plugin.description),
@@ -557,6 +653,7 @@ async function readPluginInventory({
557
653
  startupError = "This plugin\u2019s saved startup settings could not be read.";
558
654
  }
559
655
  plugins.push({
656
+ ...await readPluginManifestDetails(rootDir),
560
657
  name: text(manifest.name),
561
658
  version: text(manifest.version),
562
659
  description: text(manifest.description),
@@ -1644,11 +1741,11 @@ function createAcpPaneLink(connection) {
1644
1741
  setControl(state) {
1645
1742
  this.holder = state;
1646
1743
  }
1647
- fail(reason) {
1744
+ fail(reason2) {
1648
1745
  if (this.done) return;
1649
1746
  this.done = true;
1650
1747
  channels.delete(this);
1651
- for (const listener of [...this.closes]) listener(reason);
1748
+ for (const listener of [...this.closes]) listener(reason2);
1652
1749
  }
1653
1750
  }
1654
1751
  const forSession = /* @__PURE__ */ __name((params) => {
@@ -1669,9 +1766,9 @@ function createAcpPaneLink(connection) {
1669
1766
  return null;
1670
1767
  }
1671
1768
  },
1672
- close: /* @__PURE__ */ __name((reason) => {
1769
+ close: /* @__PURE__ */ __name((reason2) => {
1673
1770
  if (closed !== void 0) return;
1674
- closed = reason ?? "The connection to the app closed.";
1771
+ closed = reason2 ?? "The connection to the app closed.";
1675
1772
  for (const channel of [...channels]) channel.fail(closed);
1676
1773
  }, "close")
1677
1774
  };
@@ -1790,10 +1887,10 @@ function createQuestionRelay(notify) {
1790
1887
  }, "say");
1791
1888
  return {
1792
1889
  forTurn(sessionId, turnSignal) {
1793
- return (question, signal) => new Promise((resolve6) => {
1794
- if (turnSignal.aborted) return resolve6({ kind: "abort" });
1795
- if (signal?.aborted) return resolve6({ kind: "skip" });
1796
- if (cardQuestion(question)) return resolve6({ kind: "skip" });
1890
+ return (question, signal) => new Promise((resolve7) => {
1891
+ if (turnSignal.aborted) return resolve7({ kind: "abort" });
1892
+ if (signal?.aborted) return resolve7({ kind: "skip" });
1893
+ if (cardQuestion(question)) return resolve7({ kind: "skip" });
1797
1894
  const requestId = randomUUID3();
1798
1895
  let done = false;
1799
1896
  const finish = /* @__PURE__ */ __name((answer, tell) => {
@@ -1803,7 +1900,7 @@ function createQuestionRelay(notify) {
1803
1900
  turnSignal.removeEventListener("abort", onTurn);
1804
1901
  signal?.removeEventListener("abort", onCaller);
1805
1902
  if (tell) say(QUESTION_CLOSED_NOTIFICATION, { sessionId, requestId });
1806
- resolve6(answer);
1903
+ resolve7(answer);
1807
1904
  }, "finish");
1808
1905
  const onTurn = /* @__PURE__ */ __name(() => finish({ kind: "abort" }, true), "onTurn");
1809
1906
  const onCaller = /* @__PURE__ */ __name(() => finish({ kind: "skip" }, true), "onCaller");
@@ -1818,8 +1915,8 @@ function createQuestionRelay(notify) {
1818
1915
  });
1819
1916
  },
1820
1917
  skillSaveConfirm(sessionId, cwd) {
1821
- return (request, signal) => new Promise((resolve6) => {
1822
- if (signal?.aborted) return resolve6("cancel");
1918
+ return (request, signal) => new Promise((resolve7) => {
1919
+ if (signal?.aborted) return resolve7("cancel");
1823
1920
  const requestId = randomUUID3();
1824
1921
  let done = false;
1825
1922
  const finish = /* @__PURE__ */ __name((answer, tell) => {
@@ -1828,7 +1925,7 @@ function createQuestionRelay(notify) {
1828
1925
  open2.delete(requestId);
1829
1926
  signal?.removeEventListener("abort", onAbort);
1830
1927
  if (tell) say(QUESTION_CLOSED_NOTIFICATION, { sessionId, requestId });
1831
- resolve6(answer);
1928
+ resolve7(answer);
1832
1929
  }, "finish");
1833
1930
  const onAbort = /* @__PURE__ */ __name(() => finish("cancel", true), "onAbort");
1834
1931
  open2.set(requestId, {
@@ -1845,10 +1942,10 @@ function createQuestionRelay(notify) {
1845
1942
  {
1846
1943
  id: SKILL_SAVE_QUESTION_ID,
1847
1944
  header: "Save skill",
1848
- question: `Save the skill "${request.draft.name}"?`,
1945
+ question: `Save skill "${request.draft.name}"?`,
1849
1946
  options: [
1850
- { id: SKILL_SAVE_OPTIONS[0], label: "Save to my skills" },
1851
- { id: SKILL_SAVE_OPTIONS[1], label: "Save to this project" },
1947
+ { id: SKILL_SAVE_OPTIONS[0], label: "Save skill" },
1948
+ { id: SKILL_SAVE_OPTIONS[1], label: "Save to project" },
1852
1949
  { id: SKILL_SAVE_OPTIONS[2], label: "Cancel" }
1853
1950
  ],
1854
1951
  multiSelect: false,
@@ -2135,8 +2232,8 @@ var ClaudeTurnProjection = class {
2135
2232
  const message = this.currentMessage;
2136
2233
  if (!message || message.completed) return;
2137
2234
  if (event.type === "message_delta") {
2138
- const reason = messageReason(claudeRecord(event.delta)?.stop_reason);
2139
- if (reason) message.stopReason = reason;
2235
+ const reason2 = messageReason(claudeRecord(event.delta)?.stop_reason);
2236
+ if (reason2) message.stopReason = reason2;
2140
2237
  return;
2141
2238
  }
2142
2239
  if (event.type === "message_stop") {
@@ -2266,10 +2363,10 @@ var ClaudeTurnProjection = class {
2266
2363
  if (type === "thinking") this.reasoning(message, blockIndex, block);
2267
2364
  }
2268
2365
  this.text(message);
2269
- const reason = messageReason(raw.stop_reason);
2270
- if (reason) message.stopReason = reason;
2271
- if (!message.streamed && !snapshotId && reason)
2272
- this.complete(message, this.text(message), reason);
2366
+ const reason2 = messageReason(raw.stop_reason);
2367
+ if (reason2) message.stopReason = reason2;
2368
+ if (!message.streamed && !snapshotId && reason2)
2369
+ this.complete(message, this.text(message), reason2);
2273
2370
  }
2274
2371
  results(frame) {
2275
2372
  const content = claudeRecord(frame.message)?.content;
@@ -2426,24 +2523,24 @@ function startHarnessProcess(command, options) {
2426
2523
  let closing = false;
2427
2524
  let closeOperation;
2428
2525
  let complete;
2429
- const closed = new Promise((resolve6) => {
2430
- complete = resolve6;
2526
+ const closed = new Promise((resolve7) => {
2527
+ complete = resolve7;
2431
2528
  });
2432
2529
  let stopped;
2433
- const processClosed = new Promise((resolve6) => {
2434
- stopped = resolve6;
2530
+ const processClosed = new Promise((resolve7) => {
2531
+ stopped = resolve7;
2435
2532
  });
2436
2533
  const forceStop = /* @__PURE__ */ __name(async () => {
2437
2534
  if (ended) return;
2438
2535
  if (!child.pid) throw new Error("Harness process has no owned PID to stop.");
2439
2536
  if (process.platform === "win32") {
2440
2537
  if (exited) throw new Error("Harness descendants could not be confirmed stopped.");
2441
- await new Promise((resolve6, reject) => {
2538
+ await new Promise((resolve7, reject) => {
2442
2539
  execFile(
2443
2540
  join2(process.env.SystemRoot ?? "C:\\Windows", "System32", "taskkill.exe"),
2444
2541
  ["/PID", String(child.pid), "/T", "/F"],
2445
2542
  { windowsHide: true, timeout: 3e3, killSignal: "SIGKILL" },
2446
- (error) => error ? reject(new Error("Owned harness tree stop failed.", { cause: error })) : resolve6()
2543
+ (error) => error ? reject(new Error("Owned harness tree stop failed.", { cause: error })) : resolve7()
2447
2544
  );
2448
2545
  });
2449
2546
  } else {
@@ -2460,8 +2557,8 @@ function startHarnessProcess(command, options) {
2460
2557
  closeOperation = (async () => {
2461
2558
  child.stdin.end();
2462
2559
  let grace;
2463
- const graceExpired = new Promise((resolve6) => {
2464
- grace = resolve6;
2560
+ const graceExpired = new Promise((resolve7) => {
2561
+ grace = resolve7;
2465
2562
  });
2466
2563
  const timer = setTimeout(grace, CLOSE_GRACE_MS);
2467
2564
  try {
@@ -2498,11 +2595,11 @@ function startHarnessProcess(command, options) {
2498
2595
  failure ??= error;
2499
2596
  void close().catch(() => void 0);
2500
2597
  }, "fail");
2501
- const frame = /* @__PURE__ */ __name((line) => {
2502
- if (failure || !line.trim()) return;
2598
+ const frame = /* @__PURE__ */ __name((line3) => {
2599
+ if (failure || !line3.trim()) return;
2503
2600
  let value;
2504
2601
  try {
2505
- value = JSON.parse(line);
2602
+ value = JSON.parse(line3);
2506
2603
  } catch {
2507
2604
  fail(new Error("Harness emitted an invalid JSON frame."));
2508
2605
  return;
@@ -2517,13 +2614,13 @@ function startHarnessProcess(command, options) {
2517
2614
  buffer += text5;
2518
2615
  let newline = buffer.indexOf("\n");
2519
2616
  while (newline !== -1) {
2520
- const line = buffer.slice(0, newline);
2617
+ const line3 = buffer.slice(0, newline);
2521
2618
  buffer = buffer.slice(newline + 1);
2522
- if (Buffer.byteLength(line) > MAX_FRAME_BYTES) {
2619
+ if (Buffer.byteLength(line3) > MAX_FRAME_BYTES) {
2523
2620
  fail(new Error("Harness frame exceeds the supported transport size."));
2524
2621
  return;
2525
2622
  }
2526
- frame(line);
2623
+ frame(line3);
2527
2624
  newline = buffer.indexOf("\n");
2528
2625
  }
2529
2626
  receivedBytes = Buffer.byteLength(buffer);
@@ -2563,12 +2660,12 @@ function startHarnessProcess(command, options) {
2563
2660
  close,
2564
2661
  async write(value) {
2565
2662
  if (closing || ended) throw new Error("Harness transport is closed.");
2566
- const line = `${JSON.stringify(value)}
2663
+ const line3 = `${JSON.stringify(value)}
2567
2664
  `;
2568
- if (Buffer.byteLength(line) > MAX_FRAME_BYTES)
2665
+ if (Buffer.byteLength(line3) > MAX_FRAME_BYTES)
2569
2666
  return Promise.reject(new Error("Harness request exceeds the supported transport size."));
2570
- return new Promise((resolve6, reject) => {
2571
- child.stdin.write(line, "utf8", (error) => error ? reject(error) : resolve6());
2667
+ return new Promise((resolve7, reject) => {
2668
+ child.stdin.write(line3, "utf8", (error) => error ? reject(error) : resolve7());
2572
2669
  });
2573
2670
  }
2574
2671
  };
@@ -2652,7 +2749,7 @@ var ClaudeWire = class {
2652
2749
  if (this.stopped || this.closeOperation)
2653
2750
  return Promise.reject(new Error("The native engine connection is closed."));
2654
2751
  const id2 = randomUUID4();
2655
- return new Promise((resolve6, reject) => {
2752
+ return new Promise((resolve7, reject) => {
2656
2753
  const abort = /* @__PURE__ */ __name(() => {
2657
2754
  this.pending.delete(id2);
2658
2755
  cleanup();
@@ -2667,7 +2764,7 @@ var ClaudeWire = class {
2667
2764
  clearTimeout(timer);
2668
2765
  signal?.removeEventListener("abort", abort);
2669
2766
  }, "cleanup");
2670
- this.pending.set(id2, { resolve: resolve6, reject, cleanup });
2767
+ this.pending.set(id2, { resolve: resolve7, reject, cleanup });
2671
2768
  signal?.addEventListener("abort", abort, { once: true });
2672
2769
  if (signal?.aborted) {
2673
2770
  abort();
@@ -4019,7 +4116,7 @@ var CodexConnection = class {
4019
4116
  this.active = activeTurn;
4020
4117
  const status = codexRecord(thread.status);
4021
4118
  const missingReviews = Array.isArray(status?.activeFlags) && status.activeFlags.some(
4022
- (flag) => flag === "waitingOnApproval" || flag === "waitingOnUserInput"
4119
+ (flag2) => flag2 === "waitingOnApproval" || flag2 === "waitingOnUserInput"
4023
4120
  ) && this.reviews.size === 0;
4024
4121
  const complete = !missingReviews && ["idle", "active"].includes(String(status?.type)) && (status?.type !== "active" || activeTurn !== void 0);
4025
4122
  if (complete) this.uncertain = false;
@@ -5018,8 +5115,8 @@ function questionsOverPermission(sessionId, ask, turnSignal) {
5018
5115
  () => turnSignal.aborted ? { kind: "abort" } : { kind: "skip" }
5019
5116
  );
5020
5117
  if (!signal) return asked;
5021
- const stopped = new Promise((resolve6) => {
5022
- const done = /* @__PURE__ */ __name(() => resolve6({ kind: "skip" }), "done");
5118
+ const stopped = new Promise((resolve7) => {
5119
+ const done = /* @__PURE__ */ __name(() => resolve7({ kind: "skip" }), "done");
5023
5120
  if (signal.aborted) done();
5024
5121
  else signal.addEventListener("abort", done, { once: true });
5025
5122
  });
@@ -5424,72 +5521,6 @@ __name(buildContextReport, "buildContextReport");
5424
5521
  // src/commands/desktop-host.ts
5425
5522
  import { lstat as lstat2 } from "node:fs/promises";
5426
5523
 
5427
- // src/integrations/mcp/server-listing.ts
5428
- var ONE_LINE = /[\r\n\t]+/g;
5429
- var clip = /* @__PURE__ */ __name((value, max) => value.replace(ONE_LINE, " ").trim().slice(0, max), "clip");
5430
- function detailOf(name, spec) {
5431
- const summary = summarizeUserMcpServer({ name, spec });
5432
- const text5 = summary.transport === "http" ? summary.endpoint : summary.command;
5433
- return text5 ? clip(text5, 200) : void 0;
5434
- }
5435
- __name(detailOf, "detailOf");
5436
- function listMcpServers(options) {
5437
- const { cwd, live } = options;
5438
- let effective;
5439
- let declared;
5440
- let pending;
5441
- let userNames;
5442
- try {
5443
- effective = loadConfig({ cwd }).mcpServers ?? {};
5444
- const split = pendingProjectMcpServers({ cwd });
5445
- declared = split.declared;
5446
- pending = split.pending;
5447
- userNames = new Set(readUserMcpServers().map((entry) => entry.name));
5448
- } catch (error) {
5449
- return {
5450
- servers: [],
5451
- error: clip(error instanceof Error ? error.message : "The settings could not be read.", 300)
5452
- };
5453
- }
5454
- const failures = /* @__PURE__ */ new Map();
5455
- for (const item of live.failed) {
5456
- const now = effective[item.name];
5457
- if (item.config !== void 0 && item.config !== JSON.stringify(now ?? null)) continue;
5458
- failures.set(item.name, item.reason);
5459
- }
5460
- const connected = new Set(live.connected);
5461
- const rows = [];
5462
- const origin = /* @__PURE__ */ __name((name) => Object.hasOwn(declared, name) && !userNames.has(name) ? "project-file" : userNames.has(name) ? "your-config" : "this-project", "origin");
5463
- for (const [name, spec] of Object.entries(effective)) {
5464
- const detail = detailOf(name, spec);
5465
- const failure = failures.get(name);
5466
- rows.push({
5467
- name,
5468
- origin: origin(name),
5469
- state: failure !== void 0 ? "failed" : connected.has(name) ? "connected" : "idle",
5470
- ...failure !== void 0 ? { reason: clip(failure, 300) } : {},
5471
- ...detail ? { detail } : {}
5472
- });
5473
- }
5474
- for (const name of pending) {
5475
- if (rows.some((row2) => row2.name === name)) continue;
5476
- const detail = detailOf(name, declared[name]);
5477
- rows.push({
5478
- name,
5479
- origin: "project-file",
5480
- state: "waiting",
5481
- fingerprint: fingerprintMcpServer(declared[name]),
5482
- ...detail ? { detail } : {}
5483
- });
5484
- }
5485
- return { servers: rows };
5486
- }
5487
- __name(listMcpServers, "listMcpServers");
5488
- function approveListedMcpServers(cwd, shown) {
5489
- return approveShownMcpServers(resolveNamzuHome(), cwd, shown);
5490
- }
5491
- __name(approveListedMcpServers, "approveListedMcpServers");
5492
-
5493
5524
  // src/integrations/sessions/archive-inactive.ts
5494
5525
  var DAY_MS = 24 * 60 * 60 * 1e3;
5495
5526
  var AFTER_MS = {
@@ -5614,10 +5645,10 @@ function exact2(params, fields) {
5614
5645
  throw new RequestError("Unexpected Pal communication fields.");
5615
5646
  }
5616
5647
  __name(exact2, "exact");
5617
- function id(params, field) {
5618
- const value = params[field];
5648
+ function id(params, field3) {
5649
+ const value = params[field3];
5619
5650
  if (typeof value !== "string" || !isEntityId(value, "session"))
5620
- throw new RequestError(`Invalid ${field}.`);
5651
+ throw new RequestError(`Invalid ${field3}.`);
5621
5652
  return value;
5622
5653
  }
5623
5654
  __name(id, "id");
@@ -5628,9 +5659,9 @@ function revision(params) {
5628
5659
  return value;
5629
5660
  }
5630
5661
  __name(revision, "revision");
5631
- function boolean(params, field) {
5632
- const value = params[field];
5633
- if (typeof value !== "boolean") throw new RequestError(`Explicit ${field} is required.`);
5662
+ function boolean(params, field3) {
5663
+ const value = params[field3];
5664
+ if (typeof value !== "boolean") throw new RequestError(`Explicit ${field3} is required.`);
5634
5665
  return value;
5635
5666
  }
5636
5667
  __name(boolean, "boolean");
@@ -5980,9 +6011,192 @@ function palPublicAssistantText(message) {
5980
6011
  }
5981
6012
  __name(palPublicAssistantText, "palPublicAssistantText");
5982
6013
 
6014
+ // src/skills/desktop-catalog.ts
6015
+ import {
6016
+ closeSync,
6017
+ lstatSync as lstatSync2,
6018
+ openSync,
6019
+ readSync,
6020
+ readdirSync,
6021
+ realpathSync as realpathSync3,
6022
+ statSync as statSync2
6023
+ } from "node:fs";
6024
+ import { dirname as dirname3, isAbsolute as isAbsolute6, join as join6, relative as relative2, sep as sep2 } from "node:path";
6025
+ var DESCRIPTION_MAX = 1024;
6026
+ var MAX_SKILL_FILES = 200;
6027
+ var MAX_FILE_BYTES = 256 * 1024;
6028
+ var WEEK_MS = 7 * 24 * 60 * 60 * 1e3;
6029
+ var REMOVABLE = /* @__PURE__ */ new Set(["user", "project"]);
6030
+ function insideReal(rootReal, target2) {
6031
+ const rel = relative2(rootReal, target2);
6032
+ return rel === "" || rel !== ".." && !rel.startsWith(`..${sep2}`) && !isAbsolute6(rel);
6033
+ }
6034
+ __name(insideReal, "insideReal");
6035
+ function listSkillFolderFiles(folder, limit = MAX_SKILL_FILES) {
6036
+ let rootReal;
6037
+ try {
6038
+ rootReal = realpathSync3(folder);
6039
+ } catch {
6040
+ return [];
6041
+ }
6042
+ const out = [];
6043
+ const walk = /* @__PURE__ */ __name((dir, prefix) => {
6044
+ let names;
6045
+ try {
6046
+ names = readdirSync(dir).sort();
6047
+ } catch {
6048
+ return;
6049
+ }
6050
+ for (const name of names) {
6051
+ if (out.length >= limit) return;
6052
+ const full = join6(dir, name);
6053
+ let info;
6054
+ try {
6055
+ info = lstatSync2(full);
6056
+ } catch {
6057
+ continue;
6058
+ }
6059
+ const rel = prefix === "" ? name : `${prefix}/${name}`;
6060
+ if (info.isSymbolicLink()) {
6061
+ try {
6062
+ const real = realpathSync3(full);
6063
+ if (!insideReal(rootReal, real)) continue;
6064
+ const target2 = statSync2(real);
6065
+ if (target2.isFile()) out.push({ path: rel, size: target2.size });
6066
+ } catch {
6067
+ }
6068
+ continue;
6069
+ }
6070
+ if (info.isDirectory()) {
6071
+ if (!name.startsWith(".")) walk(full, rel);
6072
+ } else if (info.isFile()) {
6073
+ out.push({ path: rel, size: info.size });
6074
+ }
6075
+ }
6076
+ }, "walk");
6077
+ walk(folder, "");
6078
+ return out.slice(0, limit);
6079
+ }
6080
+ __name(listSkillFolderFiles, "listSkillFolderFiles");
6081
+ function collect(options) {
6082
+ const now = options.now ?? Date.now();
6083
+ const roster = discoverSkillRoster({
6084
+ cwd: options.cwd,
6085
+ ...options.config ? { config: options.config } : {},
6086
+ ...options.home ? { home: options.home } : {},
6087
+ ...options.systemDir ? { systemDir: options.systemDir } : {}
6088
+ });
6089
+ const usage = readSkillUsage(void 0, now);
6090
+ const useOf = /* @__PURE__ */ __name((name) => {
6091
+ const use = usage.skills[name];
6092
+ if (!use) return {};
6093
+ return {
6094
+ uses: use.count,
6095
+ uses7d: use.loads.filter((load2) => now - load2.at < WEEK_MS).length,
6096
+ lastUsedAt: new Date(use.lastUsedAt).toISOString()
6097
+ };
6098
+ }, "useOf");
6099
+ const collected = [];
6100
+ for (const skill of roster.skills) {
6101
+ if (!options.includeProject && skill.source === "project") continue;
6102
+ const folder = dirname3(skill.path);
6103
+ let updatedAt;
6104
+ try {
6105
+ updatedAt = statSync2(skill.path).mtime.toISOString();
6106
+ } catch {
6107
+ }
6108
+ collected.push({
6109
+ folder,
6110
+ entry: {
6111
+ name: skill.name,
6112
+ description: skill.description.slice(0, DESCRIPTION_MAX),
6113
+ tier: skill.tier,
6114
+ place: skillTierLabel(skill.tier),
6115
+ state: skillStateOf(skill),
6116
+ ...updatedAt ? { updatedAt } : {},
6117
+ fileCount: listSkillFolderFiles(folder).length,
6118
+ ...useOf(skill.name),
6119
+ removable: REMOVABLE.has(skill.tier)
6120
+ }
6121
+ });
6122
+ }
6123
+ for (const plugin of options.plugins ?? []) {
6124
+ for (const skill of plugin.skills ?? []) {
6125
+ collected.push({
6126
+ entry: {
6127
+ name: skill.name,
6128
+ description: skill.description.slice(0, DESCRIPTION_MAX),
6129
+ tier: "plugin",
6130
+ place: "plugin",
6131
+ plugin: plugin.name,
6132
+ state: plugin.startupEnabled === false ? "off" : "on",
6133
+ ...plugin.updatedAt ? { updatedAt: plugin.updatedAt } : {},
6134
+ fileCount: 0,
6135
+ ...useOf(skill.name),
6136
+ removable: false
6137
+ }
6138
+ });
6139
+ }
6140
+ }
6141
+ return collected;
6142
+ }
6143
+ __name(collect, "collect");
6144
+ function buildSkillCatalog(options) {
6145
+ return collect(options).map((item) => item.entry);
6146
+ }
6147
+ __name(buildSkillCatalog, "buildSkillCatalog");
6148
+ function folderOf(name, options) {
6149
+ const found = collect(options).find((item) => item.entry.name === name);
6150
+ if (!found) throw new Error("No skill by that name.");
6151
+ if (!found.folder) throw new Error("This skill has no folder of its own to read.");
6152
+ return found.folder;
6153
+ }
6154
+ __name(folderOf, "folderOf");
6155
+ function skillFiles(name, options) {
6156
+ return listSkillFolderFiles(folderOf(name, options));
6157
+ }
6158
+ __name(skillFiles, "skillFiles");
6159
+ function relativeParts(path) {
6160
+ if (typeof path !== "string" || path.length === 0 || path.length > 512 || path.includes("\0") || isAbsolute6(path) || /^([a-zA-Z]:|[\\/])/.test(path))
6161
+ throw new Error("The path is a file inside the skill folder.");
6162
+ const parts = path.split(/[\\/]/).filter((part) => part !== "" && part !== ".");
6163
+ if (parts.length === 0 || parts.some((part) => part === ".."))
6164
+ throw new Error("The path is a file inside the skill folder.");
6165
+ if (parts.slice(0, -1).some((part) => part.startsWith(".")))
6166
+ throw new Error("The path is a file inside the skill folder.");
6167
+ return parts;
6168
+ }
6169
+ __name(relativeParts, "relativeParts");
6170
+ function readSkillFile(name, path, options) {
6171
+ const parts = relativeParts(path);
6172
+ const folder = folderOf(name, options);
6173
+ const rootReal = realpathSync3(folder);
6174
+ let real;
6175
+ try {
6176
+ real = realpathSync3(join6(rootReal, ...parts));
6177
+ } catch {
6178
+ throw new Error("That file is not in the skill folder.");
6179
+ }
6180
+ if (!insideReal(rootReal, real) || real === rootReal)
6181
+ throw new Error("The path is a file inside the skill folder.");
6182
+ const info = statSync2(real);
6183
+ if (!info.isFile()) throw new Error("That is not a file.");
6184
+ const fd = openSync(real, "r");
6185
+ try {
6186
+ const buffer = Buffer.alloc(Math.min(info.size, MAX_FILE_BYTES));
6187
+ const read = readSync(fd, buffer, 0, buffer.length, 0);
6188
+ const bytes = buffer.subarray(0, read);
6189
+ if (bytes.includes(0)) throw new Error("This file is not text, so it is not shown.");
6190
+ return { text: bytes.toString("utf8"), truncated: info.size > MAX_FILE_BYTES };
6191
+ } finally {
6192
+ closeSync(fd);
6193
+ }
6194
+ }
6195
+ __name(readSkillFile, "readSkillFile");
6196
+
5983
6197
  // src/commands/desktop-host-changes.ts
5984
6198
  import { lstat, open, realpath as realpath3, stat as stat4 } from "node:fs/promises";
5985
- import { join as join6, relative as relativePath, sep as sep2 } from "node:path";
6199
+ import { join as join7, relative as relativePath, sep as sep3 } from "node:path";
5986
6200
 
5987
6201
  // src/commands/desktop-host-header.ts
5988
6202
  import { execFile as execFile3 } from "node:child_process";
@@ -5997,7 +6211,7 @@ var gitArgs = /* @__PURE__ */ __name((args) => [
5997
6211
  "--no-optional-locks",
5998
6212
  ...args
5999
6213
  ], "gitArgs");
6000
- var runGit = /* @__PURE__ */ __name((args, cwd) => new Promise((resolve6, reject) => {
6214
+ var runGit = /* @__PURE__ */ __name((args, cwd) => new Promise((resolve7, reject) => {
6001
6215
  execFile3(
6002
6216
  "git",
6003
6217
  gitArgs(args),
@@ -6008,10 +6222,10 @@ var runGit = /* @__PURE__ */ __name((args, cwd) => new Promise((resolve6, reject
6008
6222
  env: { ...process.env, GIT_OPTIONAL_LOCKS: "0" },
6009
6223
  windowsHide: true
6010
6224
  },
6011
- (error, stdout) => error ? reject(error) : resolve6(stdout)
6225
+ (error, stdout) => error ? reject(error) : resolve7(stdout)
6012
6226
  );
6013
6227
  }), "runGit");
6014
- var runGitBytes = /* @__PURE__ */ __name((args, cwd, limits) => new Promise((resolve6, reject) => {
6228
+ var runGitBytes = /* @__PURE__ */ __name((args, cwd, limits) => new Promise((resolve7, reject) => {
6015
6229
  execFile3(
6016
6230
  "git",
6017
6231
  gitArgs(args),
@@ -6024,9 +6238,9 @@ var runGitBytes = /* @__PURE__ */ __name((args, cwd, limits) => new Promise((res
6024
6238
  windowsHide: true
6025
6239
  },
6026
6240
  (error, stdout) => {
6027
- if (!error) return resolve6({ data: stdout, truncated: false });
6241
+ if (!error) return resolve7({ data: stdout, truncated: false });
6028
6242
  if (error.code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER")
6029
- return resolve6({ data: stdout, truncated: true });
6243
+ return resolve7({ data: stdout, truncated: true });
6030
6244
  reject(error);
6031
6245
  }
6032
6246
  );
@@ -6082,7 +6296,7 @@ var CONTROL = /[\u0000-\u001f\u007f]/;
6082
6296
  var caseFold = /* @__PURE__ */ __name((value) => process.platform === "win32" ? value.toLowerCase() : value, "caseFold");
6083
6297
  function contains(root, target2) {
6084
6298
  if (target2 === root) return true;
6085
- const prefix = root.endsWith(sep2) ? root : root + sep2;
6299
+ const prefix = root.endsWith(sep3) ? root : root + sep3;
6086
6300
  return caseFold(target2).startsWith(caseFold(prefix));
6087
6301
  }
6088
6302
  __name(contains, "contains");
@@ -6104,14 +6318,14 @@ async function confineChangePath(root, path) {
6104
6318
  const realRoot = await realpath3(root);
6105
6319
  let real;
6106
6320
  try {
6107
- real = await realpath3(join6(realRoot, ...segments));
6321
+ real = await realpath3(join7(realRoot, ...segments));
6108
6322
  } catch (error) {
6109
6323
  const code = error.code;
6110
6324
  if (code === "ENOENT" || code === "ENOTDIR") return { segments, absolute: null };
6111
6325
  throw new Error("That path is not available.");
6112
6326
  }
6113
6327
  if (!contains(realRoot, real)) throw outside();
6114
- if (relativePath(realRoot, real).split(sep2).some((segment) => segment.toLowerCase() === ".git"))
6328
+ if (relativePath(realRoot, real).split(sep3).some((segment) => segment.toLowerCase() === ".git"))
6115
6329
  throw outside();
6116
6330
  return { segments, absolute: real };
6117
6331
  }
@@ -6263,7 +6477,7 @@ function createProjectChanges(options = {}) {
6263
6477
  try {
6264
6478
  const confined = await confineChangePath(cwd, path);
6265
6479
  if (!confined.absolute) return plain;
6266
- if (!(await lstat(join6(cwd, ...confined.segments))).isFile()) return plain;
6480
+ if (!(await lstat(join7(cwd, ...confined.segments))).isFile()) return plain;
6267
6481
  const { bytes, tooLarge } = await readCapped(confined.absolute, DIFF_TEXT_MAX_BYTES);
6268
6482
  if (tooLarge) return plain;
6269
6483
  const decoded = decodeText(bytes);
@@ -6336,7 +6550,7 @@ function createProjectChanges(options = {}) {
6336
6550
  __name(headText, "headText");
6337
6551
  async function diff(cwd, path) {
6338
6552
  const confined = await confineChangePath(cwd, path);
6339
- const relative3 = confined.segments.join("/");
6553
+ const relative4 = confined.segments.join("/");
6340
6554
  let after = null;
6341
6555
  if (confined.absolute) {
6342
6556
  if (!(await stat4(confined.absolute)).isFile()) throw new Error("That path is not a file.");
@@ -6344,9 +6558,9 @@ function createProjectChanges(options = {}) {
6344
6558
  if (read.tooLarge) return { before: null, after: null, binary: false, truncated: true };
6345
6559
  after = read.bytes;
6346
6560
  }
6347
- let head = await headText(cwd, relative3);
6561
+ let head = await headText(cwd, relative4);
6348
6562
  if (head.bytes === null && !head.tooLarge && after !== null) {
6349
- const old = await renamedFrom(cwd, relative3);
6563
+ const old = await renamedFrom(cwd, relative4);
6350
6564
  if (old) head = await headText(cwd, old);
6351
6565
  }
6352
6566
  if (head.tooLarge) return { before: null, after: null, binary: false, truncated: true };
@@ -6371,7 +6585,7 @@ __name(createProjectChanges, "createProjectChanges");
6371
6585
  import { createHash as createHash3 } from "node:crypto";
6372
6586
  import {
6373
6587
  existsSync,
6374
- lstatSync as lstatSync2,
6588
+ lstatSync as lstatSync3,
6375
6589
  mkdirSync,
6376
6590
  readFileSync,
6377
6591
  renameSync,
@@ -6379,21 +6593,21 @@ import {
6379
6593
  writeFileSync
6380
6594
  } from "node:fs";
6381
6595
  import { realpath as realpath4 } from "node:fs/promises";
6382
- import { join as join7, resolve as resolve5 } from "node:path";
6596
+ import { join as join8, resolve as resolve5 } from "node:path";
6383
6597
  var MEMORY_TEXT_MAX = 8e3;
6384
6598
  var MEMORY_TITLE_MAX = 120;
6385
6599
  var MEMORY_SUMMARY_MAX = 240;
6386
6600
  var EXCERPT_MAX = 400;
6387
6601
  var revisionOf = /* @__PURE__ */ __name((text5) => createHash3("sha256").update(text5).digest("hex"), "revisionOf");
6388
6602
  function instructionsPath() {
6389
- return join7(resolveNamzuHome(), INSTRUCTIONS_FILENAME);
6603
+ return join8(resolveNamzuHome(), INSTRUCTIONS_FILENAME);
6390
6604
  }
6391
6605
  __name(instructionsPath, "instructionsPath");
6392
6606
  function readStandingInstructions() {
6393
6607
  const file = instructionsPath();
6394
6608
  let stat6;
6395
6609
  try {
6396
- stat6 = lstatSync2(file);
6610
+ stat6 = lstatSync3(file);
6397
6611
  } catch {
6398
6612
  return { text: "", limit: MAX_CHARS_PER_FILE, revision: revisionOf("") };
6399
6613
  }
@@ -6410,7 +6624,7 @@ function writeStandingInstructions(text5, revision2) {
6410
6624
  if (text5.length > MAX_CHARS_PER_FILE)
6411
6625
  throw new Error(`Standing instructions can hold ${MAX_CHARS_PER_FILE} characters.`);
6412
6626
  const file = instructionsPath();
6413
- if (lstatSafe(file) && !lstatSync2(file).isFile())
6627
+ if (lstatSafe(file) && !lstatSync3(file).isFile())
6414
6628
  throw new Error("This file is a link or a folder; edit it by hand.");
6415
6629
  if (revision2 !== void 0) {
6416
6630
  const now = readStandingInstructions();
@@ -6434,7 +6648,7 @@ function writeStandingInstructions(text5, revision2) {
6434
6648
  __name(writeStandingInstructions, "writeStandingInstructions");
6435
6649
  function lstatSafe(file) {
6436
6650
  try {
6437
- lstatSync2(file);
6651
+ lstatSync3(file);
6438
6652
  return true;
6439
6653
  } catch {
6440
6654
  return false;
@@ -6451,20 +6665,20 @@ async function openStore(cwd) {
6451
6665
  const root = resolveNamzuHome();
6452
6666
  const project = await findProject(root, cliProjectRoot(await realpath4(resolve5(cwd))));
6453
6667
  if (!project) return void 0;
6454
- const directory = join7(
6668
+ const directory = join8(
6455
6669
  new SessionPaths({ home: root, slug: project.slug }).projectDir(),
6456
6670
  "memory"
6457
6671
  );
6458
6672
  if (!existsSync(directory)) return void 0;
6459
- const entry = lstatSync2(directory);
6673
+ const entry = lstatSync3(directory);
6460
6674
  if (entry.isSymbolicLink() || !entry.isDirectory())
6461
6675
  throw new Error("Saved memory is not in a folder Namzu can use.");
6462
6676
  return new MarkdownMemoryStore({ directory });
6463
6677
  }
6464
6678
  __name(openStore, "openStore");
6465
6679
  var flat = /* @__PURE__ */ __name((text5, max) => {
6466
- const line = text5.replace(/\s+/g, " ").trim();
6467
- return line.length > max ? `${line.slice(0, max - 1)}\u2026` : line;
6680
+ const line3 = text5.replace(/\s+/g, " ").trim();
6681
+ return line3.length > max ? `${line3.slice(0, max - 1)}\u2026` : line3;
6468
6682
  }, "flat");
6469
6683
  function target(params) {
6470
6684
  const { id: id2, revision: revision2 } = params;
@@ -6569,6 +6783,1150 @@ function createMemoryHost(cwd, pal) {
6569
6783
  }
6570
6784
  __name(createMemoryHost, "createMemoryHost");
6571
6785
 
6786
+ // src/commands/desktop-host-plugins.ts
6787
+ import { randomUUID as randomUUID7 } from "node:crypto";
6788
+ import { existsSync as existsSync2, lstatSync as lstatSync4 } from "node:fs";
6789
+ import { isAbsolute as isAbsolute7, resolve as resolve6 } from "node:path";
6790
+ var PLUGIN_STAGE_TTL_MS = 10 * 60 * 1e3;
6791
+ var PLUGIN_STAGE_MAX = 4;
6792
+ var PLUGIN_PLAN_MAX = 4;
6793
+ var PLUGIN_PATH_MAX_CHARS = 4096;
6794
+ var OP_PROGRESS_NOTIFICATION = "namzu/ops/progress";
6795
+ var PLUGIN_PAL_MESSAGE = "Host plugins are not inherited by Pals.";
6796
+ var PLUGIN_TRUST_MESSAGE = "Trust this folder first.";
6797
+ var PLUGIN_CHANGED_MESSAGE = "What it does changed. Read it again.";
6798
+ var PLUGIN_GONE_MESSAGE = "This was shown a while ago. Choose the plugin again.";
6799
+ var PLUGIN_CANCELLED_MESSAGE = "Cancelled.";
6800
+ var PLUGIN_LOADS_NEXT_NOTE = "It loads in new conversations.";
6801
+ var PLUGIN_PLACE_MESSAGE = "Read it again for this place before installing.";
6802
+ var LINE_MAX = 300;
6803
+ var RUN_MAX = 2e3;
6804
+ var LIST_MAX = 100;
6805
+ var FINDINGS_MAX = 50;
6806
+ var OP_ID = /^[A-Za-z0-9_-]{8,64}$/;
6807
+ var SCOPES = ["user", "project", "local"];
6808
+ function exactKeys(params, allowed, required, what) {
6809
+ if (!params || typeof params !== "object" || Array.isArray(params))
6810
+ throw new Error(`Invalid ${what} request.`);
6811
+ const record2 = params;
6812
+ if (Object.keys(record2).some((key) => !allowed.includes(key)))
6813
+ throw new Error(`Invalid ${what} request.`);
6814
+ for (const key of required)
6815
+ if (record2[key] === void 0) throw new Error(`Invalid ${what} request.`);
6816
+ return record2;
6817
+ }
6818
+ __name(exactKeys, "exactKeys");
6819
+ function field(record2, key, max) {
6820
+ const value = record2[key];
6821
+ if (typeof value !== "string" || value.trim() === "" || value.length > max || value.includes("\0"))
6822
+ throw new Error(`Invalid ${key}.`);
6823
+ return value;
6824
+ }
6825
+ __name(field, "field");
6826
+ function scopeOf(record2, key = "scope") {
6827
+ const value = record2[key];
6828
+ if (!SCOPES.includes(value)) throw new Error(`Invalid ${key}.`);
6829
+ return value;
6830
+ }
6831
+ __name(scopeOf, "scopeOf");
6832
+ function flag(record2, key) {
6833
+ const value = record2[key];
6834
+ if (value === void 0) return void 0;
6835
+ if (typeof value !== "boolean") throw new Error(`Invalid ${key}.`);
6836
+ return value;
6837
+ }
6838
+ __name(flag, "flag");
6839
+ function pluginId(record2, key = "id") {
6840
+ const id2 = field(record2, key, 200);
6841
+ if (!isPluginId(id2)) throw new Error(`Invalid ${key}.`);
6842
+ return id2;
6843
+ }
6844
+ __name(pluginId, "pluginId");
6845
+ var line = /* @__PURE__ */ __name((text5) => text5.length > LINE_MAX ? `${text5.slice(0, LINE_MAX - 1)}\u2026` : text5, "line");
6846
+ function reason(error) {
6847
+ if (error instanceof SimulatedCrash) throw error;
6848
+ if (error instanceof PlanRefusal || error instanceof InstallConflict || error instanceof FetchError)
6849
+ return error.message;
6850
+ return stateFailure(error).message;
6851
+ }
6852
+ __name(reason, "reason");
6853
+ function rethrow(error) {
6854
+ if (error instanceof Error && error.message === PLUGIN_CANCELLED_MESSAGE) throw error;
6855
+ throw new Error(line(reason(error)));
6856
+ }
6857
+ __name(rethrow, "rethrow");
6858
+ function recomputeDigest(plan) {
6859
+ try {
6860
+ const hashed = hashExecutableFiles(plan.root);
6861
+ return surfaceDigest(plan.surface, hashed.files, hashed.executable);
6862
+ } catch {
6863
+ return void 0;
6864
+ }
6865
+ }
6866
+ __name(recomputeDigest, "recomputeDigest");
6867
+ function assertViewable(surface) {
6868
+ const runnable = [];
6869
+ for (const h of surface.hooks) runnable.push(h.event, h.matcher ?? "", h.run, h.from ?? "");
6870
+ for (const h of surface.fileHooks) runnable.push(h.name, h.event, h.run);
6871
+ for (const m of surface.mcpLocal)
6872
+ runnable.push(m.name, m.command, ...m.args, ...Object.keys(m.env));
6873
+ for (const m of surface.mcpRemote) runnable.push(m.name, m.origin, ...m.sendsEnv, ...m.headers);
6874
+ for (const m of surface.modules) runnable.push(m.path, ...m.declares ?? [], m.refused ?? "");
6875
+ for (const r of surface.allowedTools) runnable.push(r.name, ...r.tools);
6876
+ const lists = [
6877
+ surface.hooks,
6878
+ surface.fileHooks,
6879
+ surface.mcpLocal,
6880
+ surface.mcpRemote,
6881
+ surface.modules,
6882
+ surface.allowedTools
6883
+ ];
6884
+ const tooMany = lists.some((l) => l.length > LIST_MAX);
6885
+ const tooLong = runnable.some((v) => v.length > RUN_MAX);
6886
+ if (tooMany || tooLong)
6887
+ throw new PlanRefusal(
6888
+ 64,
6889
+ "This plugin runs more than can be shown in full here, so it was not read. Install it from the command line, which lists everything."
6890
+ );
6891
+ }
6892
+ __name(assertViewable, "assertViewable");
6893
+ function surfaceView(surface) {
6894
+ assertViewable(surface);
6895
+ const text5 = /* @__PURE__ */ __name((value) => value, "text");
6896
+ const names = /* @__PURE__ */ __name((values) => values.map(text5), "names");
6897
+ return {
6898
+ hooks: surface.hooks.map((hook) => ({
6899
+ event: text5(hook.event),
6900
+ ...hook.matcher !== void 0 ? { matcher: text5(hook.matcher) } : {},
6901
+ type: hook.type,
6902
+ run: text5(hook.run),
6903
+ ...hook.from !== void 0 ? { from: text5(hook.from) } : {}
6904
+ })),
6905
+ fileHooks: surface.fileHooks.map((hook) => ({
6906
+ kind: hook.kind,
6907
+ name: text5(hook.name),
6908
+ event: text5(hook.event),
6909
+ type: hook.type,
6910
+ run: text5(hook.run)
6911
+ })),
6912
+ mcpLocal: surface.mcpLocal.map((server) => ({
6913
+ name: text5(server.name),
6914
+ command: text5(server.command),
6915
+ args: names(server.args),
6916
+ envNames: names(Object.keys(server.env)),
6917
+ ...server.needsSetup ? { needsSetup: true } : {}
6918
+ })),
6919
+ mcpRemote: surface.mcpRemote.map((server) => ({
6920
+ name: text5(server.name),
6921
+ origin: text5(server.origin),
6922
+ transport: server.transport,
6923
+ sendsEnv: names(server.sendsEnv),
6924
+ headers: names(server.headers),
6925
+ ...server.needsSetup ? { needsSetup: true } : {}
6926
+ })),
6927
+ modules: surface.modules.map((module) => ({
6928
+ path: text5(module.path),
6929
+ ...module.declares !== void 0 ? { declares: names(module.declares) } : {},
6930
+ ...module.isolated !== void 0 ? { isolated: module.isolated } : {},
6931
+ ...module.refused !== void 0 ? { refused: text5(module.refused) } : {}
6932
+ })),
6933
+ allowedTools: surface.allowedTools.map((row2) => ({
6934
+ kind: row2.kind,
6935
+ name: text5(row2.name),
6936
+ tools: names(row2.tools)
6937
+ })),
6938
+ scripts: surface.scripts.slice(0, LIST_MAX).map((script) => ({
6939
+ path: text5(script.path),
6940
+ bytes: script.bytes,
6941
+ exec: script.exec
6942
+ })),
6943
+ scriptsTotal: surface.scripts.length,
6944
+ unpinnedDownload: surface.unpinnedDownload
6945
+ };
6946
+ }
6947
+ __name(surfaceView, "surfaceView");
6948
+ function findingsView(plan) {
6949
+ return plan.findings.filter((finding) => finding.level !== "used").slice(0, FINDINGS_MAX).map((finding) => ({
6950
+ level: finding.level,
6951
+ code: finding.code,
6952
+ ...finding.field !== void 0 ? { field: line(finding.field) } : {},
6953
+ message: line(finding.message)
6954
+ }));
6955
+ }
6956
+ __name(findingsView, "findingsView");
6957
+ function scopeSentence(scope) {
6958
+ return scope === "user" ? "scope: user (every folder on this computer)" : scope === "project" ? "scope: project (this folder, shared in .namzu/settings.json)" : "scope: local (this folder, only on this computer)";
6959
+ }
6960
+ __name(scopeSentence, "scopeSentence");
6961
+ function createDesktopPluginActions(deps) {
6962
+ const now = deps.now ?? (() => Date.now());
6963
+ const home = namzuHomePath(deps.home);
6964
+ const stages = /* @__PURE__ */ new Map();
6965
+ const plans = /* @__PURE__ */ new Map();
6966
+ const ops = /* @__PURE__ */ new Map();
6967
+ const knownUpdates = /* @__PURE__ */ new Map();
6968
+ const trusted = /* @__PURE__ */ __name(() => deps.isTrusted(deps.cwd), "trusted");
6969
+ const guard = /* @__PURE__ */ __name((scope) => {
6970
+ if (deps.pal()) throw new Error(PLUGIN_PAL_MESSAGE);
6971
+ if (scope !== void 0 && scope !== "user" && !trusted()) throw new Error(PLUGIN_TRUST_MESSAGE);
6972
+ }, "guard");
6973
+ const effectiveCwd = /* @__PURE__ */ __name(() => realPathOrResolved(trusted() ? deps.cwd : home), "effectiveCwd");
6974
+ const projectCwd = /* @__PURE__ */ __name(() => realPathOrResolved(deps.cwd), "projectCwd");
6975
+ const release = /* @__PURE__ */ __name((plan) => {
6976
+ const used = [...stages.values()].some((held) => held.plan === plan) || [...plans.values()].some((held) => held.plan === plan);
6977
+ if (!used) discardStaging(plan.stagingDir);
6978
+ }, "release");
6979
+ const prune = /* @__PURE__ */ __name(() => {
6980
+ const at = now();
6981
+ for (const [id2, held] of stages) {
6982
+ if (held.expiresAt > at) continue;
6983
+ stages.delete(id2);
6984
+ release(held.plan);
6985
+ }
6986
+ for (const [id2, held] of plans) {
6987
+ if (held.expiresAt > at) continue;
6988
+ plans.delete(id2);
6989
+ release(held.plan);
6990
+ }
6991
+ }, "prune");
6992
+ const evictOldest = /* @__PURE__ */ __name((map, max) => {
6993
+ while (map.size >= max) {
6994
+ const oldest = map.keys().next().value;
6995
+ if (oldest === void 0) return;
6996
+ const held = map.get(oldest);
6997
+ map.delete(oldest);
6998
+ if (held) release(held.plan);
6999
+ }
7000
+ }, "evictOldest");
7001
+ const op = /* @__PURE__ */ __name((raw, first = "checking") => {
7002
+ const opId = raw === void 0 ? void 0 : typeof raw === "string" ? raw : "";
7003
+ if (opId !== void 0 && !OP_ID.test(opId)) throw new Error("Invalid opId.");
7004
+ if (opId !== void 0 && ops.has(opId)) throw new Error("That step is already running.");
7005
+ const controller = new AbortController();
7006
+ if (opId !== void 0) ops.set(opId, controller);
7007
+ const context = {
7008
+ signal: controller.signal,
7009
+ progress: /* @__PURE__ */ __name((phase) => {
7010
+ if (opId !== void 0) deps.notify?.(OP_PROGRESS_NOTIFICATION, { opId, phase });
7011
+ }, "progress"),
7012
+ check: /* @__PURE__ */ __name(() => {
7013
+ if (controller.signal.aborted) throw new Error(PLUGIN_CANCELLED_MESSAGE);
7014
+ }, "check"),
7015
+ end: /* @__PURE__ */ __name(() => {
7016
+ if (opId !== void 0) ops.delete(opId);
7017
+ }, "end")
7018
+ };
7019
+ context.progress(first);
7020
+ return context;
7021
+ }, "op");
7022
+ const knownRead = /* @__PURE__ */ __name(() => {
7023
+ const known = readKnownMarketplaces(home);
7024
+ if (known.state === "unreadable")
7025
+ throw new Error(
7026
+ `The marketplace list could not be read, so nothing was changed (${known.reason}).`
7027
+ );
7028
+ return known;
7029
+ }, "knownRead");
7030
+ const installedRead = /* @__PURE__ */ __name(() => {
7031
+ const read = readInstalledPlugins(home);
7032
+ if (read.state === "unreadable")
7033
+ throw new Error(
7034
+ `The install record could not be read, so nothing was changed: ${installedPluginsPath(home)} (${read.reason}).`
7035
+ );
7036
+ return read;
7037
+ }, "installedRead");
7038
+ const catalogOf = /* @__PURE__ */ __name((known) => readCatalog(known.installLocation, known.source.source === "file" ? "file" : "directory"), "catalogOf");
7039
+ const blocked = /* @__PURE__ */ __name(() => deps.blockedMarketplaces?.() ?? [], "blocked");
7040
+ const fetchOf = /* @__PURE__ */ __name((context) => ({
7041
+ ...deps.fetch ?? {},
7042
+ ...context ? { signal: context.signal } : {}
7043
+ }), "fetchOf");
7044
+ const allowFile = deps.fetch?.allowFileProtocol === true;
7045
+ const sourceForId = /* @__PURE__ */ __name(async (id2) => {
7046
+ const { name, marketplace } = splitPluginId(id2);
7047
+ if (marketplace === LOCAL_UPLOADS_MARKETPLACE) {
7048
+ const recorded = readInstallManifest(home, id2);
7049
+ const from = recorded.state === "ok" ? recorded.manifest.installedFrom?.source : void 0;
7050
+ if (typeof from !== "string" || !existsSync2(from))
7051
+ throw new Error(
7052
+ `${id2} was installed from ${typeof from === "string" ? from : "a file or folder"}, which is not there now. Choose the file or folder again.`
7053
+ );
7054
+ return { kind: "path", path: from };
7055
+ }
7056
+ const market = knownRead().marketplaces.get(marketplace);
7057
+ if (market === void 0)
7058
+ throw new Error(`Marketplace "${marketplace}" is not added. Add it first.`);
7059
+ const read = catalogOf(market);
7060
+ if (!read.ok) throw new Error(read.reason);
7061
+ const entry = read.catalog.entries.find((candidate) => candidate.name === name);
7062
+ if (entry === void 0)
7063
+ throw new Error(`Plugin "${name}" is not in marketplace "${marketplace}".`);
7064
+ const resolved = await resolveEntrySource(entry, read.catalog, {
7065
+ hosted: market.source.source === "url",
7066
+ ...allowFile ? { allowFileProtocol: true } : {}
7067
+ });
7068
+ if (resolved.kind === "unsupported") throw new Error(resolved.reason);
7069
+ if (resolved.kind === "invalid")
7070
+ throw new Error(
7071
+ resolved.reason.startsWith(`${entry.name}: `) ? resolved.reason : `${entry.name}: ${resolved.reason}`
7072
+ );
7073
+ if (resolved.kind === "remote") {
7074
+ if (downloadBlocked(market, resolved.remote, blocked())) throw new Error(DOWNLOAD_BLOCKED);
7075
+ return { kind: "remote-catalog", marketplace, entry, remote: resolved.remote };
7076
+ }
7077
+ const commit = market.source.source === "github" || market.source.source === "git" ? market.commit : void 0;
7078
+ return {
7079
+ kind: "catalog",
7080
+ marketplace,
7081
+ entry,
7082
+ dir: resolved.dir,
7083
+ ...commit !== void 0 ? { commit } : {}
7084
+ };
7085
+ }, "sourceForId");
7086
+ const refreshOwnMarketplace = /* @__PURE__ */ __name(async (id2, context) => {
7087
+ const { marketplace } = splitPluginId(id2);
7088
+ if (marketplace === LOCAL_UPLOADS_MARKETPLACE) return;
7089
+ const market = knownRead().marketplaces.get(marketplace);
7090
+ if (market === void 0) return;
7091
+ if (market.source.source === "directory" || market.source.source === "file") return;
7092
+ context.check();
7093
+ context.progress("downloading");
7094
+ const row2 = await refreshRemoteMarketplace(market, {
7095
+ home,
7096
+ now: new Date(now()),
7097
+ blockedMarketplaces: blocked(),
7098
+ fetch: fetchOf(context)
7099
+ });
7100
+ if (row2.outcome === "failed")
7101
+ throw new Error(`Could not read marketplace "${marketplace}" again: ${row2.message}`);
7102
+ }, "refreshOwnMarketplace");
7103
+ const planOf = /* @__PURE__ */ __name(async (source, context) => {
7104
+ context.check();
7105
+ context.progress(source.kind === "remote-catalog" ? "downloading" : "reading");
7106
+ let plan;
7107
+ try {
7108
+ plan = await planInstall(source, {
7109
+ home,
7110
+ cwd: effectiveCwd(),
7111
+ fetch: fetchOf(context)
7112
+ });
7113
+ } catch (error) {
7114
+ rethrow(error);
7115
+ }
7116
+ if (context.signal.aborted) {
7117
+ discardStaging(plan.stagingDir);
7118
+ throw new Error(PLUGIN_CANCELLED_MESSAGE);
7119
+ }
7120
+ return plan;
7121
+ }, "planOf");
7122
+ const recordsOf = /* @__PURE__ */ __name((id2, scope) => (installedRead().plugins.get(id2) ?? []).find(
7123
+ (record2) => record2.scope === scope && (scope === "user" || record2.projectPath !== void 0 && samePath(record2.projectPath, projectCwd()))
7124
+ ), "recordsOf");
7125
+ const addRemote = /* @__PURE__ */ __name(async (source, scope, context) => {
7126
+ const display = describeSource(source);
7127
+ if (isBlockedSource(source, blocked())) throw new Error(MARKETPLACE_BLOCKED);
7128
+ const known = knownRead();
7129
+ const staging = newStaging(home);
7130
+ try {
7131
+ context.check();
7132
+ context.progress("downloading");
7133
+ const fetched = await fetchMarketplace(source, staging, fetchOf(context));
7134
+ context.check();
7135
+ context.progress("reading");
7136
+ const read = readFetchedCatalog(fetched.dir, display);
7137
+ if (!read.ok) throw new Error(read.message);
7138
+ const { catalog } = read;
7139
+ const problem = marketplaceNameProblem(catalog.name);
7140
+ if (problem !== void 0) throw new Error(problem);
7141
+ const where = { home, cwd: effectiveCwd() };
7142
+ const notInstallable = await countNotInstallable(catalog, source.source === "url", allowFile);
7143
+ const notes = [
7144
+ ...fetchNotes(fetched),
7145
+ ...notInstallable > 0 ? [`${notInstallable} of its plugins cannot be installed here.`] : []
7146
+ ];
7147
+ const summary = /* @__PURE__ */ __name((outcome) => ({
7148
+ name: catalog.name,
7149
+ plugins: catalog.entries.length,
7150
+ outcome,
7151
+ warnings: [...catalog.warnings, ...notes].slice(0, FINDINGS_MAX).map(line)
7152
+ }), "summary");
7153
+ const existing = known.marketplaces.get(catalog.name);
7154
+ if (existing !== void 0) {
7155
+ if (!sameSource(existing.source, source))
7156
+ throw new Error(anotherPlace(catalog.name, existing.source, source, "Remove it first."));
7157
+ const layerPath = recordLayerPath(scope, where);
7158
+ const layer = readRecordLayer(layerPath);
7159
+ if (layer.state !== "unreadable" && !layer.marketplaces.has(catalog.name)) {
7160
+ setExtraKnownMarketplace(layerPath, home, catalog.name, source);
7161
+ return summary("declared");
7162
+ }
7163
+ return summary("already-added");
7164
+ }
7165
+ context.check();
7166
+ placeMarketplace(catalog, source, fetched, {
7167
+ home,
7168
+ cwd: effectiveCwd(),
7169
+ scope,
7170
+ now: new Date(now()),
7171
+ by: "desktop",
7172
+ layerPath: recordLayerPath(scope, where)
7173
+ });
7174
+ return summary("added");
7175
+ } finally {
7176
+ discardStaging(staging);
7177
+ }
7178
+ }, "addRemote");
7179
+ const methods = {
7180
+ /** What an address would be, from its text alone: no network, no disk beyond the path. */
7181
+ "namzu/marketplaces/preview": /* @__PURE__ */ __name((params) => {
7182
+ guard();
7183
+ const record2 = exactKeys(params, ["source"], ["source"], "marketplace preview");
7184
+ const source = field(record2, "source", PLUGIN_PATH_MAX_CHARS);
7185
+ const address = parseMarketplaceAddress(source, deps.cwd);
7186
+ if (address.kind === "refused") return { error: line(address.message) };
7187
+ if (address.kind === "remote")
7188
+ return {
7189
+ source: line(address.text),
7190
+ kind: address.form,
7191
+ remote: true,
7192
+ description: line(describeAddition(address.source)),
7193
+ notice: MARKETPLACE_NOTICE,
7194
+ ...isBlockedSource(address.source, blocked()) ? { blocked: MARKETPLACE_BLOCKED } : {}
7195
+ };
7196
+ return {
7197
+ source: line(address.path),
7198
+ kind: "path",
7199
+ remote: false,
7200
+ notice: MARKETPLACE_NOTICE
7201
+ };
7202
+ }, "namzu/marketplaces/preview"),
7203
+ "namzu/marketplaces/add": /* @__PURE__ */ __name(async (params) => {
7204
+ guard();
7205
+ const record2 = exactKeys(
7206
+ params,
7207
+ ["source", "scope", "accepted", "opId"],
7208
+ ["source", "scope", "accepted"],
7209
+ "marketplace add"
7210
+ );
7211
+ const source = field(record2, "source", PLUGIN_PATH_MAX_CHARS);
7212
+ const scope = scopeOf(record2);
7213
+ if (record2.accepted !== "marketplace-v1") throw new Error("Read the notice first.");
7214
+ guard(scope);
7215
+ const context = op(record2.opId);
7216
+ try {
7217
+ const address = parseMarketplaceAddress(source, deps.cwd);
7218
+ if (address.kind === "refused") throw new Error(address.message);
7219
+ if (address.kind === "remote") return await addRemote(address.source, scope, context);
7220
+ const real = realPathOf(address.path);
7221
+ if (real === void 0) throw new Error(`${line(address.path)} was not found.`);
7222
+ if (/^\\\\/.test(real))
7223
+ throw new Error(
7224
+ "A network share is not accepted. Copy the marketplace to this computer first."
7225
+ );
7226
+ let kind;
7227
+ try {
7228
+ const stat6 = lstatSync4(real);
7229
+ if (stat6.isDirectory()) kind = "directory";
7230
+ else if (stat6.isFile() && real.toLowerCase().endsWith(".json")) kind = "file";
7231
+ else
7232
+ throw new Error("Not a marketplace address. A marketplace is a folder or a .json file.");
7233
+ } catch (error) {
7234
+ if (error instanceof Error && error.message.startsWith("Not a marketplace")) throw error;
7235
+ throw new Error(`${line(real)} was not found.`);
7236
+ }
7237
+ context.check();
7238
+ context.progress("reading");
7239
+ const read = readCatalog(real, kind);
7240
+ if (!read.ok) throw new Error(read.reason);
7241
+ const { catalog } = read;
7242
+ const problem = marketplaceNameProblem(catalog.name);
7243
+ if (problem !== void 0) throw new Error(problem);
7244
+ context.check();
7245
+ const known = knownRead();
7246
+ const where = { home, cwd: effectiveCwd() };
7247
+ const sourceRecord = { source: kind, path: real };
7248
+ const existing = known.marketplaces.get(catalog.name);
7249
+ const summary = /* @__PURE__ */ __name((outcome) => ({
7250
+ name: catalog.name,
7251
+ plugins: catalog.entries.length,
7252
+ outcome,
7253
+ warnings: catalog.warnings.slice(0, FINDINGS_MAX).map(line)
7254
+ }), "summary");
7255
+ if (existing !== void 0) {
7256
+ if (existing.source.source === kind && samePath(String(existing.source.path ?? ""), real)) {
7257
+ const layerPath = recordLayerPath(scope, where);
7258
+ const layer = readRecordLayer(layerPath);
7259
+ if (layer.state !== "unreadable" && !layer.marketplaces.has(catalog.name)) {
7260
+ setExtraKnownMarketplace(layerPath, home, catalog.name, sourceRecord);
7261
+ return summary("declared");
7262
+ }
7263
+ return summary("already-added");
7264
+ }
7265
+ throw new Error(
7266
+ `A marketplace named "${catalog.name}" is already added from another place (${line(String(existing.source.path ?? existing.source.source))}). Remove it first.`
7267
+ );
7268
+ }
7269
+ const at = new Date(now()).toISOString();
7270
+ putKnownMarketplace(home, catalog.name, {
7271
+ source: sourceRecord,
7272
+ installLocation: real,
7273
+ lastUpdated: at,
7274
+ autoUpdate: false,
7275
+ consent: { at, by: "desktop", notice: "marketplace-v1" }
7276
+ });
7277
+ setExtraKnownMarketplace(recordLayerPath(scope, where), home, catalog.name, sourceRecord);
7278
+ return summary("added");
7279
+ } catch (error) {
7280
+ rethrow(error);
7281
+ } finally {
7282
+ context.end();
7283
+ }
7284
+ }, "namzu/marketplaces/add"),
7285
+ "namzu/marketplaces/list": /* @__PURE__ */ __name((params) => {
7286
+ guard();
7287
+ exactKeys(params ?? {}, [], [], "marketplace list");
7288
+ const known = knownRead();
7289
+ const installed = readInstalledPlugins(home);
7290
+ const counts = /* @__PURE__ */ new Map();
7291
+ if (installed.state !== "unreadable")
7292
+ for (const id2 of installed.plugins.keys()) {
7293
+ const { marketplace } = splitPluginId(id2);
7294
+ counts.set(marketplace, (counts.get(marketplace) ?? 0) + 1);
7295
+ }
7296
+ const marketplaces = [...known.marketplaces.values()].sort((a, b) => a.name.localeCompare(b.name)).slice(0, LIST_MAX).map((market) => {
7297
+ const read = catalogOf(market);
7298
+ return {
7299
+ name: market.name,
7300
+ source: line(describeSource(market.source)),
7301
+ kind: market.source.source,
7302
+ lastUpdated: market.lastUpdated ?? null,
7303
+ autoUpdate: market.autoUpdate ?? false,
7304
+ plugins: read.ok ? read.catalog.entries.length : null,
7305
+ installed: counts.get(market.name) ?? 0,
7306
+ ...read.ok ? {} : { problem: line(read.reason) }
7307
+ };
7308
+ });
7309
+ const layers = readLayers(home, effectiveCwd(), trusted());
7310
+ const declaredByProject = [];
7311
+ for (const layer of ["project", "local"]) {
7312
+ const read = layers[layer];
7313
+ if (read === void 0 || read.state === "unreadable") continue;
7314
+ for (const market of read.marketplaces.values())
7315
+ if (!known.marketplaces.has(market.name))
7316
+ declaredByProject.push({ name: line(market.name), declaredBy: layer });
7317
+ }
7318
+ return {
7319
+ marketplaces,
7320
+ declaredByProject: declaredByProject.slice(0, LIST_MAX),
7321
+ problems: known.invalid.slice(0, FINDINGS_MAX).map((p) => line(`${p.id}: ${p.reason}`))
7322
+ };
7323
+ }, "namzu/marketplaces/list"),
7324
+ "namzu/marketplaces/remove": /* @__PURE__ */ __name((params) => {
7325
+ guard();
7326
+ const record2 = exactKeys(
7327
+ params,
7328
+ ["name", "confirm"],
7329
+ ["name", "confirm"],
7330
+ "marketplace remove"
7331
+ );
7332
+ const name = field(record2, "name", 64);
7333
+ if (record2.confirm !== true) throw new Error("Confirm the removal first.");
7334
+ if (name === LOCAL_UPLOADS_MARKETPLACE)
7335
+ throw new Error(
7336
+ `${LOCAL_UPLOADS_MARKETPLACE} is not a marketplace; remove its plugins one by one.`
7337
+ );
7338
+ const known = knownRead();
7339
+ if (!known.marketplaces.has(name)) throw new Error(`Marketplace "${name}" is not added.`);
7340
+ const installed = installedRead();
7341
+ const layers = ["user"];
7342
+ if (trusted()) layers.push("project", "local");
7343
+ try {
7344
+ const removedPlugins = [];
7345
+ const here = resolve6(effectiveCwd());
7346
+ const inOtherFolders = [];
7347
+ const isMine = /* @__PURE__ */ __name((record3) => record3.scope === "user" || trusted() && record3.projectPath !== void 0 && resolve6(record3.projectPath) === here, "isMine");
7348
+ for (const [id2, records] of installed.plugins)
7349
+ if (splitPluginId(id2).marketplace === name) {
7350
+ for (const record3 of records)
7351
+ if (!isMine(record3)) inOtherFolders.push(`${id2} (${record3.scope})`);
7352
+ }
7353
+ if (inOtherFolders.length > 0)
7354
+ throw new PlanRefusal(
7355
+ 64,
7356
+ line(
7357
+ `${inOtherFolders.length === 1 ? "A plugin" : "Plugins"} from it ${inOtherFolders.length === 1 ? "is" : "are"} installed in another folder (${inOtherFolders.slice(0, 5).join(", ")}). Remove ${inOtherFolders.length === 1 ? "it" : "them"} there first.`
7358
+ )
7359
+ );
7360
+ for (const [id2, records] of installed.plugins) {
7361
+ if (splitPluginId(id2).marketplace !== name) continue;
7362
+ for (const record3 of records) {
7363
+ const result = removeInstall(
7364
+ id2,
7365
+ {
7366
+ scope: record3.scope,
7367
+ ...record3.projectPath !== void 0 ? { projectPath: record3.projectPath } : {}
7368
+ },
7369
+ { home, now: new Date(now()), deleteData: false }
7370
+ );
7371
+ if (result.removedRecord) removedPlugins.push(`${id2} (${record3.scope})`);
7372
+ }
7373
+ knownUpdates.delete(id2);
7374
+ }
7375
+ removeKnownMarketplace(home, name);
7376
+ for (const layer of layers) {
7377
+ const path = recordLayerPath(layer, { home, cwd: effectiveCwd() });
7378
+ const read = readRecordLayer(path);
7379
+ if (read.state !== "unreadable" && read.marketplaces.has(name))
7380
+ removeExtraKnownMarketplace(path, home, name);
7381
+ }
7382
+ return {
7383
+ outcome: "removed",
7384
+ name,
7385
+ removedPlugins: removedPlugins.map(line)
7386
+ };
7387
+ } catch (error) {
7388
+ rethrow(error);
7389
+ }
7390
+ }, "namzu/marketplaces/remove"),
7391
+ /** Reads each marketplace again from where it is; a local one is a read of its folder. */
7392
+ "namzu/marketplaces/update": /* @__PURE__ */ __name(async (params) => {
7393
+ guard();
7394
+ const record2 = exactKeys(params, ["name", "opId"], [], "marketplace update");
7395
+ const only = record2.name === void 0 ? void 0 : field(record2, "name", 64);
7396
+ const context = op(record2.opId);
7397
+ try {
7398
+ const known = knownRead();
7399
+ if (only !== void 0 && !known.marketplaces.has(only))
7400
+ throw new Error(`Marketplace "${only}" is not added.`);
7401
+ const results = [];
7402
+ for (const market of [...known.marketplaces.values()].filter((m) => only === void 0 || m.name === only).sort((a, b) => a.name.localeCompare(b.name)).slice(0, LIST_MAX)) {
7403
+ context.check();
7404
+ const remote = market.source.source !== "directory" && market.source.source !== "file";
7405
+ if (remote) {
7406
+ context.progress("downloading");
7407
+ const row2 = await refreshRemoteMarketplace(market, {
7408
+ home,
7409
+ now: new Date(now()),
7410
+ blockedMarketplaces: blocked(),
7411
+ fetch: fetchOf(context)
7412
+ });
7413
+ if (row2.outcome === "failed") {
7414
+ results.push({ name: market.name, outcome: "failed", error: line(row2.message) });
7415
+ continue;
7416
+ }
7417
+ for (const item of row2.newer) knownUpdates.set(item.id, item.available);
7418
+ const reread = readKnownMarketplaces(home);
7419
+ const fresh = reread.state === "unreadable" ? void 0 : reread.marketplaces.get(market.name);
7420
+ const catalog = catalogOf(fresh ?? market);
7421
+ results.push({
7422
+ name: market.name,
7423
+ outcome: row2.outcome,
7424
+ ...catalog.ok ? { plugins: catalog.catalog.entries.length } : {},
7425
+ message: line(row2.message)
7426
+ });
7427
+ continue;
7428
+ }
7429
+ const read = catalogOf(market);
7430
+ if (!read.ok) {
7431
+ results.push({ name: market.name, outcome: "failed", error: line(read.reason) });
7432
+ continue;
7433
+ }
7434
+ putKnownMarketplace(home, market.name, {
7435
+ source: market.source,
7436
+ installLocation: market.installLocation,
7437
+ lastUpdated: new Date(now()).toISOString()
7438
+ });
7439
+ results.push({
7440
+ name: market.name,
7441
+ outcome: "updated",
7442
+ plugins: read.catalog.entries.length
7443
+ });
7444
+ }
7445
+ return { results };
7446
+ } catch (error) {
7447
+ rethrow(error);
7448
+ } finally {
7449
+ context.end();
7450
+ }
7451
+ }, "namzu/marketplaces/update"),
7452
+ /** The plugins one marketplace offers, and which of them can be installed here. */
7453
+ "namzu/marketplaces/available": /* @__PURE__ */ __name(async (params) => {
7454
+ guard();
7455
+ const record2 = exactKeys(params, ["marketplace"], ["marketplace"], "marketplace available");
7456
+ const name = field(record2, "marketplace", 64);
7457
+ const market = knownRead().marketplaces.get(name);
7458
+ if (market === void 0) throw new Error(`Marketplace "${name}" is not added.`);
7459
+ const read = catalogOf(market);
7460
+ if (!read.ok) throw new Error(line(read.reason));
7461
+ const catalog = read.catalog;
7462
+ const installed = readInstalledPlugins(home);
7463
+ const plugins = [];
7464
+ for (const entry of catalog.entries.slice(0, MAX_CATALOG_PLUGINS)) {
7465
+ const id2 = `${entry.name}@${name}`;
7466
+ const resolved = await resolveEntrySource(entry, catalog, {
7467
+ hosted: market.source.source === "url",
7468
+ ...allowFile ? { allowFileProtocol: true } : {}
7469
+ });
7470
+ const scopes = installed.state === "unreadable" ? [] : [...new Set((installed.plugins.get(id2) ?? []).map((r) => r.scope))];
7471
+ plugins.push({
7472
+ name: line(entry.name),
7473
+ id: id2,
7474
+ ...entry.description !== void 0 ? { description: line(entry.description) } : {},
7475
+ ...entry.version !== void 0 ? { version: line(entry.version) } : {},
7476
+ ...entry.author !== void 0 ? { author: line(entry.author) } : {},
7477
+ installable: resolved.kind === "local" || resolved.kind === "remote",
7478
+ ...resolved.kind === "local" || resolved.kind === "remote" ? {} : { reason: line(resolved.reason) },
7479
+ installedAt: scopes
7480
+ });
7481
+ }
7482
+ return {
7483
+ marketplace: name,
7484
+ plugins,
7485
+ warnings: catalog.warnings.slice(0, FINDINGS_MAX).map(line)
7486
+ };
7487
+ }, "namzu/marketplaces/available"),
7488
+ /** Reads a plugin from a marketplace or a stage and says what it would do. Installs nothing. */
7489
+ "namzu/plugins/plan": /* @__PURE__ */ __name(async (params) => {
7490
+ guard();
7491
+ const record2 = exactKeys(params, ["id", "stageId", "scope", "opId"], ["scope"], "plugin plan");
7492
+ if (record2.id === void 0 === (record2.stageId === void 0))
7493
+ throw new Error("Invalid plugin plan request.");
7494
+ const scope = scopeOf(record2);
7495
+ guard(scope);
7496
+ prune();
7497
+ const context = op(record2.opId);
7498
+ try {
7499
+ let plan;
7500
+ let stageId;
7501
+ if (record2.stageId !== void 0) {
7502
+ stageId = field(record2, "stageId", 100);
7503
+ const stage = stages.get(stageId);
7504
+ if (!stage) throw new Error(PLUGIN_GONE_MESSAGE);
7505
+ plan = stage.plan;
7506
+ } else {
7507
+ plan = await planOf(await sourceForId(pluginId(record2)), context);
7508
+ }
7509
+ evictOldest(plans, PLUGIN_PLAN_MAX);
7510
+ const planId = randomUUID7();
7511
+ const expiresAt = now() + PLUGIN_STAGE_TTL_MS;
7512
+ plans.set(planId, { plan, scope, expiresAt, ...stageId ? { stageId } : {} });
7513
+ const have = recordsOf(plan.id, scope);
7514
+ return {
7515
+ planId,
7516
+ digest: plan.digest,
7517
+ id: plan.id,
7518
+ name: line(plan.name),
7519
+ version: line(plan.version),
7520
+ layout: plan.layout,
7521
+ scope,
7522
+ components: {
7523
+ skills: plan.inventory.skills.slice(0, LIST_MAX).map(line),
7524
+ commands: plan.inventory.commands.slice(0, LIST_MAX).map(line),
7525
+ agents: plan.inventory.agents.slice(0, LIST_MAX).map(line)
7526
+ },
7527
+ surface: surfaceView(plan.surface),
7528
+ findings: findingsView(plan),
7529
+ warnings: plan.warnings.slice(0, FINDINGS_MAX).map(line),
7530
+ preview: renderInstallPreview(plan, { scopeLine: scopeSentence(scope) }).slice(0, 2e4),
7531
+ ...have !== void 0 ? { installed: { version: have.version ?? null } } : {},
7532
+ loadingOn: deps.loadingOn(),
7533
+ expiresAt: new Date(expiresAt).toISOString()
7534
+ };
7535
+ } catch (error) {
7536
+ rethrow(error);
7537
+ } finally {
7538
+ context.end();
7539
+ }
7540
+ }, "namzu/plugins/plan"),
7541
+ /** Reads a chosen archive or folder aside, so what is shown is the copy that would run. */
7542
+ "namzu/plugins/stage": /* @__PURE__ */ __name(async (params) => {
7543
+ guard();
7544
+ const record2 = exactKeys(params, ["path", "opId"], ["path"], "plugin stage");
7545
+ const path = field(record2, "path", PLUGIN_PATH_MAX_CHARS);
7546
+ if (!isAbsolute7(path)) throw new Error("That path cannot be used.");
7547
+ prune();
7548
+ const context = op(record2.opId);
7549
+ try {
7550
+ let stat6;
7551
+ try {
7552
+ stat6 = lstatSync4(path);
7553
+ } catch {
7554
+ throw new Error("That file or folder could not be read.");
7555
+ }
7556
+ if (stat6.isSymbolicLink())
7557
+ throw new Error("That is a link. Plugins are added as plain files and folders only.");
7558
+ if (!stat6.isFile() && !stat6.isDirectory())
7559
+ throw new Error("That is not a file or a folder.");
7560
+ const plan = await planOf({ kind: "path", path: resolve6(path) }, context);
7561
+ evictOldest(stages, PLUGIN_STAGE_MAX);
7562
+ const stageId = randomUUID7();
7563
+ const expiresAt = now() + PLUGIN_STAGE_TTL_MS;
7564
+ stages.set(stageId, { plan, expiresAt });
7565
+ return {
7566
+ stageId,
7567
+ name: line(plan.name),
7568
+ version: line(plan.version),
7569
+ expiresAt: new Date(expiresAt).toISOString()
7570
+ };
7571
+ } catch (error) {
7572
+ rethrow(error);
7573
+ } finally {
7574
+ context.end();
7575
+ }
7576
+ }, "namzu/plugins/stage"),
7577
+ /** Installs what `plan` showed, once, only with the digest the person saw. */
7578
+ "namzu/plugins/install": /* @__PURE__ */ __name(async (params) => {
7579
+ guard();
7580
+ const record2 = exactKeys(
7581
+ params,
7582
+ ["planId", "digest", "scope", "consent", "enableLoading", "opId"],
7583
+ ["planId", "digest", "scope", "consent"],
7584
+ "plugin install"
7585
+ );
7586
+ const planId = field(record2, "planId", 100);
7587
+ const digest = field(record2, "digest", 64).toLowerCase();
7588
+ const scope = scopeOf(record2);
7589
+ if (record2.consent !== true) throw new Error("Say yes to what it does first.");
7590
+ const enableLoading = flag(record2, "enableLoading") === true;
7591
+ guard(scope);
7592
+ prune();
7593
+ const entry = plans.get(planId);
7594
+ if (!entry) throw new Error(PLUGIN_GONE_MESSAGE);
7595
+ if (entry.scope !== scope) throw new Error(PLUGIN_PLACE_MESSAGE);
7596
+ if (digest !== entry.plan.digest) throw new Error(PLUGIN_CHANGED_MESSAGE);
7597
+ const context = op(record2.opId);
7598
+ try {
7599
+ context.check();
7600
+ if (recomputeDigest(entry.plan) !== entry.plan.digest) {
7601
+ plans.delete(planId);
7602
+ release(entry.plan);
7603
+ throw new Error(PLUGIN_CHANGED_MESSAGE);
7604
+ }
7605
+ plans.delete(planId);
7606
+ if (entry.stageId) stages.delete(entry.stageId);
7607
+ let outcome;
7608
+ try {
7609
+ outcome = commitInstall(entry.plan, {
7610
+ home,
7611
+ now: new Date(now()),
7612
+ scope,
7613
+ cwd: projectCwd(),
7614
+ consent: { by: "desktop", nonInteractive: false }
7615
+ });
7616
+ } finally {
7617
+ for (const [id3, held] of plans) if (held.plan === entry.plan) plans.delete(id3);
7618
+ for (const [id3, held] of stages) if (held.plan === entry.plan) stages.delete(id3);
7619
+ discardStaging(entry.plan.stagingDir);
7620
+ }
7621
+ let loading = deps.loadingOn() ? "on" : "off";
7622
+ const notes = [];
7623
+ if (loading === "off" && enableLoading) {
7624
+ try {
7625
+ notes.push(deps.enableLoading());
7626
+ loading = "on";
7627
+ } catch (error) {
7628
+ notes.push(
7629
+ `Plugin loading could not be turned on (${error instanceof Error ? error.message : String(error)}).`
7630
+ );
7631
+ }
7632
+ }
7633
+ if (loading === "off")
7634
+ notes.push("Plugin loading is off, so it will not run until it is turned on.");
7635
+ knownUpdates.delete(entry.plan.id);
7636
+ const id2 = entry.plan.id;
7637
+ return {
7638
+ id: id2,
7639
+ outcome: outcome.outcome,
7640
+ loading,
7641
+ message: outcome.outcome === "already-installed" ? `${id2} ${entry.plan.version} is already installed (scope: ${scope}); nothing changed.` : `Installed ${id2} ${entry.plan.version} (scope: ${scope}). ${PLUGIN_LOADS_NEXT_NOTE}`,
7642
+ ...notes.length > 0 ? { notes: notes.map(line) } : {}
7643
+ };
7644
+ } catch (error) {
7645
+ rethrow(error);
7646
+ } finally {
7647
+ context.end();
7648
+ }
7649
+ }, "namzu/plugins/install"),
7650
+ /** Writes the saved yes or no for an installed plugin; the per-conversation switch is separate. */
7651
+ "namzu/plugins/enable": /* @__PURE__ */ __name((params) => {
7652
+ guard();
7653
+ const record2 = exactKeys(
7654
+ params,
7655
+ ["id", "scope", "enabled"],
7656
+ ["id", "scope", "enabled"],
7657
+ "plugin enable"
7658
+ );
7659
+ const id2 = pluginId(record2);
7660
+ const scope = scopeOf(record2);
7661
+ if (typeof record2.enabled !== "boolean") throw new Error("Invalid enabled.");
7662
+ guard(scope);
7663
+ const records = installedRead().plugins.get(id2) ?? [];
7664
+ if (!records.some(
7665
+ (r) => r.scope === "user" || r.projectPath !== void 0 && samePath(r.projectPath, projectCwd())
7666
+ ))
7667
+ throw new Error(`${id2} is not installed for this folder or for you.`);
7668
+ const path = recordLayerPath(scope, { home, cwd: effectiveCwd() });
7669
+ const own = readRecordLayer(path);
7670
+ if (own.state === "unreadable")
7671
+ throw new Error(
7672
+ `The plugin records in ${path} could not be read (${own.reason}), so nothing was changed.`
7673
+ );
7674
+ let changed = false;
7675
+ try {
7676
+ if (own.enabledPlugins.get(id2) !== record2.enabled) {
7677
+ setEnabledPlugin(path, home, id2, record2.enabled);
7678
+ changed = true;
7679
+ }
7680
+ } catch (error) {
7681
+ rethrow(error);
7682
+ }
7683
+ const answer = currentEnabledAnswer(
7684
+ { home, cwd: effectiveCwd(), projectTrusted: trusted() },
7685
+ id2
7686
+ );
7687
+ return {
7688
+ outcome: changed ? record2.enabled ? "enabled" : "disabled" : "unchanged",
7689
+ id: id2,
7690
+ scope,
7691
+ effective: { enabled: answer.on, ...answer.by ? { by: answer.by } : {} },
7692
+ loading: deps.loadingOn() ? "on" : "off",
7693
+ note: PLUGIN_LOADS_NEXT_NOTE
7694
+ };
7695
+ }, "namzu/plugins/enable"),
7696
+ /** Re-reads the source of that plugin's own marketplace (the folder is replaced and its update record refreshed) and says whether a newer version is there. */
7697
+ "namzu/plugins/update_check": /* @__PURE__ */ __name(async (params) => {
7698
+ guard();
7699
+ const record2 = exactKeys(params, ["id", "opId"], ["id"], "plugin update check");
7700
+ const id2 = pluginId(record2);
7701
+ const context = op(record2.opId);
7702
+ let plan;
7703
+ try {
7704
+ const current = (installedRead().plugins.get(id2) ?? [])[0];
7705
+ if (current === void 0) throw new Error(`${id2} is not installed.`);
7706
+ const recorded = readInstallManifest(home, id2);
7707
+ if (recorded.state !== "ok")
7708
+ throw new Error(`${id2} has no readable install manifest. Install it again.`);
7709
+ await refreshOwnMarketplace(id2, context);
7710
+ plan = await planOf(await sourceForId(id2), context);
7711
+ if (plan.name !== splitPluginId(id2).name)
7712
+ throw new Error(`The source now holds "${plan.name}", not ${splitPluginId(id2).name}.`);
7713
+ if (current.version === plan.version && recorded.manifest.surfaceSha256 !== plan.digest)
7714
+ throw new Error(sameVersionChanged(id2, plan.version));
7715
+ const comparison = compareUpdate(recorded.manifest, plan);
7716
+ const upToDate = current.version === plan.version && recorded.manifest.surfaceSha256 === plan.digest;
7717
+ if (upToDate) knownUpdates.delete(id2);
7718
+ else knownUpdates.set(id2, plan.version);
7719
+ return {
7720
+ id: id2,
7721
+ current: current.version ?? null,
7722
+ latest: line(plan.version),
7723
+ upToDate,
7724
+ changesExecutable: !comparison.unchangedSurface
7725
+ };
7726
+ } catch (error) {
7727
+ rethrow(error);
7728
+ } finally {
7729
+ if (plan) discardStaging(plan.stagingDir);
7730
+ context.end();
7731
+ }
7732
+ }, "namzu/plugins/update_check"),
7733
+ /**
7734
+ * Brings an installed plugin to what its source holds now. When what runs changed, nothing is
7735
+ * written until the call comes back with the digest of what was shown (`acceptDigest`).
7736
+ */
7737
+ "namzu/plugins/update": /* @__PURE__ */ __name(async (params) => {
7738
+ guard();
7739
+ const record2 = exactKeys(params, ["id", "acceptDigest", "opId"], ["id"], "plugin update");
7740
+ const id2 = pluginId(record2);
7741
+ const accepted = record2.acceptDigest === void 0 ? void 0 : field(record2, "acceptDigest", 64).toLowerCase();
7742
+ const context = op(record2.opId);
7743
+ let plan;
7744
+ try {
7745
+ const current = (installedRead().plugins.get(id2) ?? [])[0];
7746
+ if (current === void 0) throw new Error(`${id2} is not installed.`);
7747
+ if (current.scope !== "user" && !trusted()) throw new Error(PLUGIN_TRUST_MESSAGE);
7748
+ const recorded = readInstallManifest(home, id2);
7749
+ if (recorded.state !== "ok")
7750
+ throw new Error(`${id2} has no readable install manifest. Install it again.`);
7751
+ plan = await planOf(await sourceForId(id2), context);
7752
+ if (plan.name !== splitPluginId(id2).name)
7753
+ throw new Error(`The source now holds "${plan.name}", not ${splitPluginId(id2).name}.`);
7754
+ if (current.version === plan.version && recorded.manifest.surfaceSha256 === plan.digest) {
7755
+ knownUpdates.delete(id2);
7756
+ return {
7757
+ outcome: "up-to-date",
7758
+ id: id2,
7759
+ from: current.version ?? null,
7760
+ to: line(plan.version),
7761
+ message: `${id2} is up to date (${plan.version}).`
7762
+ };
7763
+ }
7764
+ if (current.version === plan.version) throw new Error(sameVersionChanged(id2, plan.version));
7765
+ const { changes, unchangedSurface } = compareUpdate(recorded.manifest, plan);
7766
+ if (!unchangedSurface && accepted !== plan.digest) {
7767
+ return {
7768
+ outcome: "needs-consent",
7769
+ id: id2,
7770
+ from: current.version ?? null,
7771
+ to: line(plan.version),
7772
+ digest: plan.digest,
7773
+ changes: changes.slice(0, FINDINGS_MAX).map(line),
7774
+ surface: surfaceView(plan.surface),
7775
+ preview: renderInstallPreview(plan, {
7776
+ scopeLine: "",
7777
+ headline: `Update ${id2} from ${current.version ?? "?"} to ${plan.version}?`,
7778
+ changes: [
7779
+ ...current.version !== plan.version ? [`Version ${current.version ?? "?"} to ${plan.version}`] : [],
7780
+ ...changes.length > 0 ? changes : ["Files that configure or run the plugin changed."]
7781
+ ]
7782
+ }).slice(0, 2e4)
7783
+ };
7784
+ }
7785
+ context.check();
7786
+ const result = commitUpdate(plan, {
7787
+ home,
7788
+ now: new Date(now()),
7789
+ consent: { by: "desktop", nonInteractive: false }
7790
+ });
7791
+ knownUpdates.delete(id2);
7792
+ return {
7793
+ outcome: result.outcome,
7794
+ id: id2,
7795
+ from: result.from ?? null,
7796
+ to: line(result.to),
7797
+ message: result.outcome === "up-to-date" ? `${id2} is up to date (${plan.version}).` : `Updated ${id2} from ${result.from ?? "?"} to ${result.to}. ${PLUGIN_LOADS_NEXT_NOTE}`
7798
+ };
7799
+ } catch (error) {
7800
+ rethrow(error);
7801
+ } finally {
7802
+ if (plan) discardStaging(plan.stagingDir);
7803
+ context.end();
7804
+ }
7805
+ }, "namzu/plugins/update"),
7806
+ "namzu/plugins/uninstall": /* @__PURE__ */ __name((params) => {
7807
+ guard();
7808
+ const record2 = exactKeys(
7809
+ params,
7810
+ ["id", "scope", "deleteData", "confirm"],
7811
+ ["id", "scope", "confirm"],
7812
+ "plugin uninstall"
7813
+ );
7814
+ const id2 = pluginId(record2);
7815
+ const scope = scopeOf(record2);
7816
+ if (record2.confirm !== true) throw new Error("Confirm the removal first.");
7817
+ const deleteData = flag(record2, "deleteData") === true;
7818
+ guard(scope);
7819
+ const chosen = recordsOf(id2, scope);
7820
+ if (chosen === void 0) throw new Error(`${id2} is not installed at scope ${scope} here.`);
7821
+ try {
7822
+ const result = removeInstall(
7823
+ id2,
7824
+ {
7825
+ scope,
7826
+ ...chosen.projectPath !== void 0 ? { projectPath: chosen.projectPath } : {}
7827
+ },
7828
+ { home, now: new Date(now()), deleteData }
7829
+ );
7830
+ if (!result.removedRecord) throw new Error(`${id2} is not installed at scope ${scope}.`);
7831
+ if (result.remaining === 0) knownUpdates.delete(id2);
7832
+ return {
7833
+ outcome: "uninstalled",
7834
+ id: id2,
7835
+ scope,
7836
+ dataKept: result.dataKept,
7837
+ dataDeleted: result.dataDeleted,
7838
+ remaining: result.remaining
7839
+ };
7840
+ } catch (error) {
7841
+ rethrow(error);
7842
+ }
7843
+ }, "namzu/plugins/uninstall"),
7844
+ "namzu/ops/cancel": /* @__PURE__ */ __name((params) => {
7845
+ const record2 = exactKeys(params, ["opId"], ["opId"], "cancel");
7846
+ const opId = field(record2, "opId", 64);
7847
+ if (!OP_ID.test(opId)) throw new Error("Invalid opId.");
7848
+ const controller = ops.get(opId);
7849
+ if (!controller) return { cancelled: false };
7850
+ controller.abort();
7851
+ return { cancelled: true };
7852
+ }, "namzu/ops/cancel")
7853
+ };
7854
+ const enrichList = /* @__PURE__ */ __name((view) => {
7855
+ const read = readInstalledPlugins(home);
7856
+ if (read.state === "unreadable") return view;
7857
+ const byName = /* @__PURE__ */ new Map();
7858
+ for (const [id2, records] of read.plugins) byName.set(splitPluginId(id2).name, { id: id2, records });
7859
+ return {
7860
+ ...view,
7861
+ plugins: view.plugins.map((plugin) => {
7862
+ const found = byName.get(plugin.name);
7863
+ if (!found) return plugin;
7864
+ const first = found.records[0];
7865
+ const counts = {};
7866
+ for (const finding of first?.findings ?? [])
7867
+ counts[finding.level] = (counts[finding.level] ?? 0) + 1;
7868
+ return {
7869
+ ...plugin,
7870
+ id: found.id,
7871
+ marketplace: splitPluginId(found.id).marketplace,
7872
+ ...first?.layout ? { layout: first.layout } : {},
7873
+ installed: [...new Set(found.records.map((r) => r.scope))],
7874
+ findings: counts,
7875
+ ...knownUpdates.has(found.id) ? { updateKnown: true } : {}
7876
+ };
7877
+ })
7878
+ };
7879
+ }, "enrichList");
7880
+ const withInstalled = /* @__PURE__ */ __name(async (given) => {
7881
+ let view = given;
7882
+ if (view.notice === "Plugins are off for this project." && deps.loadingOn()) {
7883
+ const { notice: _stale, ...rest } = view;
7884
+ view = rest;
7885
+ }
7886
+ const plan = planInstalledPlugins({
7887
+ home,
7888
+ cwd: effectiveCwd(),
7889
+ projectTrusted: trusted(),
7890
+ allowedScopes: ["user", "project"]
7891
+ });
7892
+ const listed = new Set(view.plugins.map((plugin) => plugin.name));
7893
+ const missing = plan.candidates.filter((candidate) => !listed.has(candidate.name));
7894
+ if (missing.length === 0) return view;
7895
+ const where = {
7896
+ home,
7897
+ cwd: effectiveCwd(),
7898
+ installedNames: new Set(plan.candidates.map((candidate) => candidate.name))
7899
+ };
7900
+ const rows = [];
7901
+ for (const candidate of missing.slice(0, 100)) {
7902
+ try {
7903
+ const manifest = await loadInstalledManifest(candidate, where);
7904
+ rows.push({
7905
+ ...await readPluginManifestDetails(candidate.installPath, manifest),
7906
+ name: line(manifest.name),
7907
+ version: line(manifest.version ?? candidate.record.version ?? ""),
7908
+ description: line(manifest.description ?? ""),
7909
+ scope: candidate.scope,
7910
+ status: view.live === true && !candidate.answer.on ? "disabled" : "installed",
7911
+ startupEnabled: candidate.answer.on
7912
+ });
7913
+ } catch {
7914
+ rows.push({
7915
+ name: line(candidate.name),
7916
+ version: line(candidate.record.version ?? ""),
7917
+ description: "",
7918
+ scope: candidate.scope,
7919
+ status: "error",
7920
+ startupError: "This plugin\u2019s manifest could not be read or validated."
7921
+ });
7922
+ }
7923
+ }
7924
+ return { ...view, plugins: [...view.plugins, ...rows] };
7925
+ }, "withInstalled");
7926
+ return { methods, enrichList, withInstalled, stages, plans, ops, prune };
7927
+ }
7928
+ __name(createDesktopPluginActions, "createDesktopPluginActions");
7929
+
6572
7930
  // src/commands/desktop-host-pr.ts
6573
7931
  async function projectPr(cwd, run = runCommand) {
6574
7932
  const found = await lookupPr(run, cwd);
@@ -6577,18 +7935,368 @@ async function projectPr(cwd, run = runCommand) {
6577
7935
  }
6578
7936
  __name(projectPr, "projectPr");
6579
7937
 
7938
+ // src/commands/desktop-host-skills.ts
7939
+ import { createHash as createHash4, randomUUID as randomUUID8 } from "node:crypto";
7940
+ import { lstatSync as lstatSync5 } from "node:fs";
7941
+ import { isAbsolute as isAbsolute8 } from "node:path";
7942
+ var SKILL_STAGE_TTL_MS = 10 * 60 * 1e3;
7943
+ var SKILL_STAGE_MAX = 4;
7944
+ var SKILL_STAGE_BYTES_MAX = 64 * 1024 * 1024;
7945
+ var SKILL_STAGES_BYTES_MAX = 128 * 1024 * 1024;
7946
+ var SKILL_PATH_MAX_CHARS = 4096;
7947
+ var FINDINGS_MAX2 = 20;
7948
+ var LINE_MAX2 = 300;
7949
+ var STAGE_CHANGED_MESSAGE = "What it does changed. Read it again.";
7950
+ var STAGE_GONE_MESSAGE = "This was shown a while ago. Choose the file again.";
7951
+ var SKILL_PAL_MESSAGE = "Pals do not change the host skills.";
7952
+ var SKILL_TRUST_MESSAGE = "Trust this folder first.";
7953
+ var LOADS_NEXT_NOTE = "It loads in new conversations.";
7954
+ var line2 = /* @__PURE__ */ __name((text5) => text5.length > LINE_MAX2 ? `${text5.slice(0, LINE_MAX2 - 1)}\u2026` : text5, "line");
7955
+ function exactKeys2(params, allowed, required, what) {
7956
+ if (!params || typeof params !== "object" || Array.isArray(params))
7957
+ throw new Error(`Invalid ${what} request.`);
7958
+ const record2 = params;
7959
+ if (Object.keys(record2).some((key) => !allowed.includes(key)))
7960
+ throw new Error(`Invalid ${what} request.`);
7961
+ for (const key of required)
7962
+ if (record2[key] === void 0) throw new Error(`Invalid ${what} request.`);
7963
+ return record2;
7964
+ }
7965
+ __name(exactKeys2, "exactKeys");
7966
+ function field2(record2, key, max) {
7967
+ const value = record2[key];
7968
+ if (typeof value !== "string" || value.trim() === "" || value.length > max || value.includes("\0"))
7969
+ throw new Error(`Invalid ${key}.`);
7970
+ return value;
7971
+ }
7972
+ __name(field2, "field");
7973
+ function scopeOf2(record2, key = "scope") {
7974
+ const value = record2[key];
7975
+ if (value !== "user" && value !== "project") throw new Error(`Invalid ${key}.`);
7976
+ return value;
7977
+ }
7978
+ __name(scopeOf2, "scopeOf");
7979
+ function nameList(value, key) {
7980
+ if (value === void 0) return [];
7981
+ if (!Array.isArray(value) || value.length > SKILL_ADD_MAX_INPUTS || value.some((v) => typeof v !== "string" || v === "" || v.length > SKILL_NAME_MAX_CHARS))
7982
+ throw new Error(`Invalid ${key}.`);
7983
+ return [...new Set(value)];
7984
+ }
7985
+ __name(nameList, "nameList");
7986
+ var errorText = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "errorText");
7987
+ function stageDigest(items) {
7988
+ const hash = createHash4("sha256");
7989
+ for (const item of items) hash.update(`${item.digest}
7990
+ `);
7991
+ return hash.digest("hex");
7992
+ }
7993
+ __name(stageDigest, "stageDigest");
7994
+ function itemDigest(prepared) {
7995
+ return createHash4("sha256").update(`${prepared.name}\0${digestFiles(prepared.files)}\0${prepared.consent.join("\n")}`).digest("hex");
7996
+ }
7997
+ __name(itemDigest, "itemDigest");
7998
+ function hookNotes(prepared) {
7999
+ try {
8000
+ const parsed = parseSkillMarkdown(prepared.markdown, "SKILL.md");
8001
+ if (parsed.hooksSource === void 0) return [];
8002
+ return readSkillHooks(parsed.hooksSource, `skill ${prepared.name}`).problems.map(
8003
+ (p) => `Hooks ${p.severity === "problem" ? "not loaded" : "note"}: ${p.event} ${p.message}`
8004
+ );
8005
+ } catch {
8006
+ return [];
8007
+ }
8008
+ }
8009
+ __name(hookNotes, "hookNotes");
8010
+ function createDesktopSkillActions(deps) {
8011
+ const now = deps.now ?? (() => Date.now());
8012
+ const stages = /* @__PURE__ */ new Map();
8013
+ const guard = /* @__PURE__ */ __name((scope) => {
8014
+ if (deps.pal()) throw new Error(SKILL_PAL_MESSAGE);
8015
+ if (scope === "project" && !deps.isTrusted(deps.cwd)) throw new Error(SKILL_TRUST_MESSAGE);
8016
+ }, "guard");
8017
+ const effectiveCwd = /* @__PURE__ */ __name(() => deps.isTrusted(deps.cwd) ? deps.cwd : namzuHomePath(deps.home), "effectiveCwd");
8018
+ const home = deps.home !== void 0 ? { home: deps.home } : {};
8019
+ const prune = /* @__PURE__ */ __name(() => {
8020
+ const at = now();
8021
+ for (const [id2, stage] of stages) if (stage.expiresAt <= at) stages.delete(id2);
8022
+ }, "prune");
8023
+ const exists = /* @__PURE__ */ __name((scope, name) => {
8024
+ try {
8025
+ lstatSync5(`${skillsFolderFor(scope, { cwd: effectiveCwd(), ...home }).dir}/${name}`);
8026
+ return true;
8027
+ } catch {
8028
+ return false;
8029
+ }
8030
+ }, "exists");
8031
+ const projectOpen = /* @__PURE__ */ __name(() => deps.isTrusted(deps.cwd), "projectOpen");
8032
+ const stageOne = /* @__PURE__ */ __name((path) => {
8033
+ const fileName = path.split(/[\\/]/).filter(Boolean).pop() ?? path;
8034
+ const base = {
8035
+ fileName: line2(fileName),
8036
+ findings: [],
8037
+ grants: [],
8038
+ scripts: []
8039
+ };
8040
+ const fail = /* @__PURE__ */ __name((kind2, error) => ({
8041
+ item: { ...base, kind: kind2, error: line2(error) },
8042
+ staged: {
8043
+ digest: createHash4("sha256").update(`error\0${path}\0${error}`).digest("hex")
8044
+ }
8045
+ }), "fail");
8046
+ if (!isAbsolute8(path) || path.includes("\0") || path.length > SKILL_PATH_MAX_CHARS)
8047
+ return fail("file", "That path cannot be used.");
8048
+ let kind;
8049
+ try {
8050
+ const stat6 = lstatSync5(path);
8051
+ if (stat6.isSymbolicLink())
8052
+ return fail(
8053
+ "file",
8054
+ `${fileName} is a link. Skills are added as plain files and folders only.`
8055
+ );
8056
+ if (stat6.isDirectory()) kind = "folder";
8057
+ else if (stat6.isFile()) {
8058
+ kind = "file";
8059
+ if (stat6.size > SKILL_FILE_MAX_BYTES)
8060
+ return fail(kind, "Skill file is too large. Maximum size is 30 MB.");
8061
+ } else return fail("file", `${fileName} is not a file or a folder.`);
8062
+ } catch {
8063
+ return fail("file", `${fileName} could not be read.`);
8064
+ }
8065
+ let prepared;
8066
+ try {
8067
+ prepared = readSkillInput(path);
8068
+ } catch (error) {
8069
+ return fail(kind, error instanceof SkillInputError ? error.message : errorText(error));
8070
+ }
8071
+ const scripts = [...prepared.files.entries()].filter(([rel, file]) => rel.startsWith("scripts/") || file.executable).map(([rel]) => rel).sort();
8072
+ const collides = [];
8073
+ const targets = planSkillTargets(prepared.name, {
8074
+ cwd: effectiveCwd(),
8075
+ ...home
8076
+ });
8077
+ if (targets.user.collisions.some((c) => c.overwrite)) collides.push("user");
8078
+ if (projectOpen() && targets.project.collisions.some((c) => c.overwrite))
8079
+ collides.push("project");
8080
+ let bytes = 0;
8081
+ for (const file of prepared.files.values()) bytes += file.bytes.length;
8082
+ return {
8083
+ item: {
8084
+ fileName: line2(fileName),
8085
+ kind,
8086
+ name: prepared.name,
8087
+ description: prepared.description.slice(0, SKILL_DESCRIPTION_MAX_CHARS),
8088
+ files: prepared.files.size,
8089
+ bytes,
8090
+ findings: [...prepared.findings, ...hookNotes(prepared)].slice(0, FINDINGS_MAX2).map(line2),
8091
+ grants: prepared.consent.filter((c) => !c.startsWith("Ships scripts:")).slice(0, FINDINGS_MAX2).map(line2),
8092
+ scripts: scripts.slice(0, 50),
8093
+ ...collides.length > 0 ? { collides } : {}
8094
+ },
8095
+ staged: { prepared, digest: itemDigest(prepared) }
8096
+ };
8097
+ }, "stageOne");
8098
+ const methods = {
8099
+ /** Reads the chosen files and folders, checks them, says what each would do. Writes nothing. */
8100
+ "namzu/skills/stage": /* @__PURE__ */ __name(async (params) => {
8101
+ guard();
8102
+ const record2 = exactKeys2(params, ["paths"], ["paths"], "skill stage");
8103
+ const paths = record2.paths;
8104
+ if (!Array.isArray(paths) || paths.length < 1 || paths.length > SKILL_ADD_MAX_INPUTS || paths.some((p) => typeof p !== "string"))
8105
+ throw new Error("Choose between 1 and 20 skills.");
8106
+ prune();
8107
+ const unique = [...new Set(paths)];
8108
+ let held = 0;
8109
+ const results = unique.map((path) => {
8110
+ const result = stageOne(path);
8111
+ const size2 = result.item.bytes ?? 0;
8112
+ if (held + size2 <= (deps.stageBytesMax ?? SKILL_STAGE_BYTES_MAX)) {
8113
+ held += size2;
8114
+ return result;
8115
+ }
8116
+ const fileName = result.item.fileName;
8117
+ return {
8118
+ item: {
8119
+ fileName,
8120
+ kind: result.item.kind,
8121
+ findings: [],
8122
+ grants: [],
8123
+ scripts: [],
8124
+ error: "Too much to add at once. Add the rest in a second step."
8125
+ },
8126
+ staged: {
8127
+ digest: createHash4("sha256").update(`over\0${path}`).digest("hex")
8128
+ }
8129
+ };
8130
+ });
8131
+ const heldBytes = /* @__PURE__ */ __name(() => {
8132
+ let sum = 0;
8133
+ for (const stage of stages.values()) sum += stage.bytes;
8134
+ return sum;
8135
+ }, "heldBytes");
8136
+ while (stages.size > 0 && (stages.size >= SKILL_STAGE_MAX || heldBytes() + held > (deps.stagesBytesMax ?? SKILL_STAGES_BYTES_MAX))) {
8137
+ const oldest = stages.keys().next().value;
8138
+ if (oldest === void 0) break;
8139
+ stages.delete(oldest);
8140
+ }
8141
+ const stageId = randomUUID8();
8142
+ const items = results.map((r) => r.staged);
8143
+ const expiresAt = now() + SKILL_STAGE_TTL_MS;
8144
+ stages.set(stageId, {
8145
+ items,
8146
+ expiresAt,
8147
+ digest: stageDigest(items),
8148
+ bytes: held
8149
+ });
8150
+ return {
8151
+ stageId,
8152
+ items: results.map((r) => r.item),
8153
+ expiresAt: new Date(expiresAt).toISOString()
8154
+ };
8155
+ }, "namzu/skills/stage"),
8156
+ /** Writes the staged items the person said yes to. Items are independent. */
8157
+ "namzu/skills/install": /* @__PURE__ */ __name(async (params) => {
8158
+ guard();
8159
+ const record2 = exactKeys2(
8160
+ params,
8161
+ ["stageId", "scope", "replace", "accept"],
8162
+ ["stageId", "scope"],
8163
+ "skill install"
8164
+ );
8165
+ const stageId = field2(record2, "stageId", 100);
8166
+ const scope = scopeOf2(record2);
8167
+ const replace = nameList(record2.replace, "replace");
8168
+ const accept = nameList(record2.accept, "accept");
8169
+ guard(scope);
8170
+ prune();
8171
+ const stage = stages.get(stageId);
8172
+ if (!stage) throw new Error(STAGE_GONE_MESSAGE);
8173
+ const names = new Set(stage.items.flatMap((i) => i.prepared ? [i.prepared.name] : []));
8174
+ if ([...replace, ...accept].some((name) => !names.has(name)))
8175
+ throw new Error(STAGE_CHANGED_MESSAGE);
8176
+ if (stageDigest(stage.items) !== stage.digest) throw new Error(STAGE_CHANGED_MESSAGE);
8177
+ for (const item of stage.items)
8178
+ if (item.prepared && itemDigest(item.prepared) !== item.digest)
8179
+ throw new Error(STAGE_CHANGED_MESSAGE);
8180
+ stages.delete(stageId);
8181
+ const results = [];
8182
+ for (const item of stage.items) {
8183
+ const prepared = item.prepared;
8184
+ if (!prepared) continue;
8185
+ const name = prepared.name;
8186
+ if (exists(scope, name) && !replace.includes(name)) {
8187
+ results.push({
8188
+ name,
8189
+ outcome: "failed",
8190
+ error: `A skill named "${name}" is already there. Choose to replace it.`
8191
+ });
8192
+ continue;
8193
+ }
8194
+ const outcome = await installPrepared(prepared, prepared.fileName, {
8195
+ scope,
8196
+ cwd: effectiveCwd(),
8197
+ displayCwd: deps.cwd,
8198
+ ...home,
8199
+ yes: accept.includes(name),
8200
+ replace: replace.includes(name),
8201
+ ...deps.now ? { now: /* @__PURE__ */ __name(() => new Date(deps.now?.() ?? Date.now()), "now") } : {}
8202
+ });
8203
+ if (outcome.status === "added" || outcome.status === "replaced") {
8204
+ results.push({
8205
+ name,
8206
+ outcome: outcome.status,
8207
+ ...outcome.path ? { path: outcome.path } : {}
8208
+ });
8209
+ } else {
8210
+ results.push({
8211
+ name,
8212
+ outcome: "failed",
8213
+ error: line2(
8214
+ outcome.status === "needs-consent" ? "Accept what it can run first." : outcome.message
8215
+ )
8216
+ });
8217
+ }
8218
+ }
8219
+ return { results, note: LOADS_NEXT_NOTE };
8220
+ }, "namzu/skills/install"),
8221
+ /** Makes a skill from the form: the same checks and writer as a file. */
8222
+ "namzu/skills/create": /* @__PURE__ */ __name(async (params) => {
8223
+ guard();
8224
+ const record2 = exactKeys2(
8225
+ params,
8226
+ ["name", "description", "instructions", "scope", "replace"],
8227
+ ["name", "description", "instructions", "scope"],
8228
+ "skill create"
8229
+ );
8230
+ const name = field2(record2, "name", SKILL_NAME_MAX_CHARS);
8231
+ const description = field2(record2, "description", SKILL_DESCRIPTION_MAX_CHARS);
8232
+ const instructions = field2(record2, "instructions", SKILL_BODY_MAX_BYTES + 1024);
8233
+ const scope = scopeOf2(record2);
8234
+ if (record2.replace !== void 0 && typeof record2.replace !== "boolean")
8235
+ throw new Error("Invalid replace.");
8236
+ guard(scope);
8237
+ if (exists(scope, name) && record2.replace !== true)
8238
+ return {
8239
+ outcome: "exists",
8240
+ error: `A skill named "${name}" is already there. Choose to replace it.`
8241
+ };
8242
+ const outcome = await createSkill(
8243
+ { name, description, instructions },
8244
+ {
8245
+ scope,
8246
+ cwd: effectiveCwd(),
8247
+ displayCwd: deps.cwd,
8248
+ ...home,
8249
+ yes: true,
8250
+ replace: true,
8251
+ ...deps.now ? { now: /* @__PURE__ */ __name(() => new Date(deps.now?.() ?? Date.now()), "now") } : {}
8252
+ }
8253
+ );
8254
+ if (outcome.status === "added" || outcome.status === "replaced")
8255
+ return {
8256
+ outcome: "created",
8257
+ ...outcome.path ? { path: outcome.path } : {},
8258
+ note: LOADS_NEXT_NOTE
8259
+ };
8260
+ return { outcome: "failed", error: line2(outcome.message) };
8261
+ }, "namzu/skills/create"),
8262
+ /** Moves a skill the person added into the backups folder; never deletes it. */
8263
+ "namzu/skills/remove": /* @__PURE__ */ __name(async (params) => {
8264
+ guard();
8265
+ const record2 = exactKeys2(params, ["name", "tier"], ["name", "tier"], "skill remove");
8266
+ const name = field2(record2, "name", 200);
8267
+ const tier = scopeOf2(record2, "tier");
8268
+ guard(tier);
8269
+ const outcome = await removeSkill(name, {
8270
+ scope: tier,
8271
+ cwd: effectiveCwd(),
8272
+ displayCwd: deps.cwd,
8273
+ ...home,
8274
+ yes: true,
8275
+ ...deps.now ? { now: /* @__PURE__ */ __name(() => new Date(deps.now?.() ?? Date.now()), "now") } : {}
8276
+ });
8277
+ return {
8278
+ outcome: outcome.status,
8279
+ ...outcome.backup ? { backup: outcome.backup } : {},
8280
+ ...outcome.status === "removed" ? {} : { error: line2(outcome.message) }
8281
+ };
8282
+ }, "namzu/skills/remove")
8283
+ };
8284
+ return { methods, stages };
8285
+ }
8286
+ __name(createDesktopSkillActions, "createDesktopSkillActions");
8287
+
6580
8288
  // src/commands/desktop-outcome-feed.ts
6581
8289
  var OUTCOME_NOTIFICATION = "namzu/session/outcome";
6582
8290
  function outcomeNotification(sessionId, event) {
6583
8291
  if (event.type !== "turn_completed" && event.type !== "turn_failed") return void 0;
6584
8292
  const outcome = event.settlement.outcome;
6585
8293
  if (!outcome) return void 0;
6586
- const line = outcomeLine(outcome);
8294
+ const line3 = outcomeLine(outcome);
6587
8295
  return {
6588
8296
  sessionId,
6589
8297
  turnId: event.turnId,
6590
8298
  verdict: outcome.verdict,
6591
- ...line ? { line } : {},
8299
+ ...line3 ? { line: line3 } : {},
6592
8300
  changed: outcome.changes.total,
6593
8301
  outcome
6594
8302
  };
@@ -6606,10 +8314,10 @@ __name(announceOutcome, "announceOutcome");
6606
8314
  function savedTurnOutcome(body) {
6607
8315
  const outcome = parseTurnOutcome(body);
6608
8316
  if (!outcome) return void 0;
6609
- const line = outcomeLine(outcome);
8317
+ const line3 = outcomeLine(outcome);
6610
8318
  return {
6611
8319
  verdict: outcome.verdict,
6612
- ...line ? { line } : {},
8320
+ ...line3 ? { line: line3 } : {},
6613
8321
  changed: outcome.changes.total
6614
8322
  };
6615
8323
  }
@@ -7195,9 +8903,55 @@ __name(historyWork, "historyWork");
7195
8903
  function createDesktopHostExtensions(runtime, directory, publishedSessionCwd, retrySession, projectGit = createProjectGit(), projectChanges = createProjectChanges(), palInboxStart, limits, commit = createProjectCommit({
7196
8904
  isTrusted,
7197
8905
  suggest: /* @__PURE__ */ __name((request, signal, sessionId) => sessionId ? runtime.suggestCommitMessage?.(sessionId, request, signal) ?? Promise.resolve(void 0) : Promise.resolve(void 0), "suggest")
7198
- })) {
8906
+ }), notify) {
7199
8907
  const cwd = canonicalProjectPath(directory);
7200
8908
  const pal = /* @__PURE__ */ __name(() => palAtWorkspace(cwd), "pal");
8909
+ const pluginActions = createDesktopPluginActions({
8910
+ cwd,
8911
+ pal: /* @__PURE__ */ __name(() => Boolean(pal()), "pal"),
8912
+ isTrusted,
8913
+ ...notify ? { notify } : {},
8914
+ // A settings file that cannot be read stops the step: a block list nobody could read is not "empty".
8915
+ blockedMarketplaces: /* @__PURE__ */ __name(() => loadConfig({ cwd }).plugins?.blockedMarketplaces ?? [], "blockedMarketplaces"),
8916
+ loadingOn: /* @__PURE__ */ __name(() => {
8917
+ try {
8918
+ return loadConfig({ cwd }).plugins?.enabled === true;
8919
+ } catch {
8920
+ return false;
8921
+ }
8922
+ }, "loadingOn"),
8923
+ enableLoading: /* @__PURE__ */ __name(() => {
8924
+ const plan = planSettingChange("plugins.enabled", "true");
8925
+ if (!plan.ok) throw new Error(plan.error);
8926
+ return plan.apply().replace(/^Plugins is now/, "Plugin loading is now");
8927
+ }, "enableLoading")
8928
+ });
8929
+ const skillActions = createDesktopSkillActions({
8930
+ cwd,
8931
+ pal: /* @__PURE__ */ __name(() => Boolean(pal()), "pal"),
8932
+ isTrusted
8933
+ });
8934
+ const catalogOptions = /* @__PURE__ */ __name(async () => {
8935
+ const trusted = isTrusted(cwd);
8936
+ let config;
8937
+ let plugins;
8938
+ if (trusted) {
8939
+ try {
8940
+ config = loadConfig({ cwd }).skills;
8941
+ } catch {
8942
+ }
8943
+ try {
8944
+ plugins = (await runtime.plugins(cwd)).plugins;
8945
+ } catch {
8946
+ }
8947
+ }
8948
+ return {
8949
+ cwd,
8950
+ includeProject: trusted,
8951
+ ...config ? { config } : {},
8952
+ ...plugins ? { plugins } : {}
8953
+ };
8954
+ }, "catalogOptions");
7201
8955
  const withState = /* @__PURE__ */ __name(async (run) => {
7202
8956
  if (!isTrusted(cwd)) throw new Error("Trust this folder before opening its conversations.");
7203
8957
  const state = await openSessions(cwd);
@@ -7826,9 +9580,10 @@ function createDesktopHostExtensions(runtime, directory, publishedSessionCwd, re
7826
9580
  if (!params || typeof params !== "object" || Array.isArray(params) || Object.keys(params).length > 0)
7827
9581
  throw new Error("Invalid tool servers request.");
7828
9582
  if (!isTrusted(cwd) || pal()) return { servers: [] };
7829
- return listMcpServers({
9583
+ return listAllMcpServers({
7830
9584
  cwd,
7831
- live: runtime.mcpStatus?.(cwd) ?? { connected: [], failed: [] }
9585
+ live: runtime.mcpStatus?.(cwd) ?? { connected: [], failed: [] },
9586
+ plugins: pluginConfigFor(cwd)
7832
9587
  });
7833
9588
  }, "namzu/mcp/servers"),
7834
9589
  /** Which browser the engine would drive here, for the Connected browsers table; launches nothing. */
@@ -7847,13 +9602,42 @@ function createDesktopHostExtensions(runtime, directory, publishedSessionCwd, re
7847
9602
  ...headless ? { headless } : {}
7848
9603
  });
7849
9604
  }, "namzu/browser/status"),
9605
+ /** Stage, install, create and remove skills for the Customize page. */
9606
+ ...skillActions.methods,
9607
+ /** Marketplaces and plugins for the Customize page: read, show, install, update, remove. */
9608
+ ...pluginActions.methods,
7850
9609
  /** The skills this folder's engine finds, names and tiers only; reads files, runs nothing. */
7851
9610
  "namzu/skills/list": /* @__PURE__ */ __name(async (params = {}) => {
7852
9611
  if (!params || typeof params !== "object" || Array.isArray(params) || Object.keys(params).length > 0)
7853
9612
  throw new Error("Invalid skills request.");
7854
- const { listInstalledSkills } = await import("./installed-list-44QXUJFE.js");
9613
+ const { listInstalledSkills } = await import("./installed-list-7QIWVKLQ.js");
7855
9614
  return { skills: listInstalledSkills({ cwd, includeProject: isTrusted(cwd) && !pal() }) };
7856
9615
  }, "namzu/skills/list"),
9616
+ /** Every skill with what the Customize page shows of it: state, place, time, use. Reads files, runs nothing. */
9617
+ "namzu/skills/catalog": /* @__PURE__ */ __name(async (params = {}) => {
9618
+ if (!params || typeof params !== "object" || Array.isArray(params) || Object.keys(params).length > 0)
9619
+ throw new Error("Invalid skills request.");
9620
+ if (pal()) throw new Error("Pals do not read the host skills.");
9621
+ return { skills: buildSkillCatalog(await catalogOptions()) };
9622
+ }, "namzu/skills/catalog"),
9623
+ /** The files in one skill's folder: relative paths and sizes, at most 200. */
9624
+ "namzu/skills/files": /* @__PURE__ */ __name(async (params) => {
9625
+ if (!params || typeof params !== "object" || Object.keys(params).some((key) => key !== "name"))
9626
+ throw new Error("Invalid skill files request.");
9627
+ if (pal()) throw new Error("Pals do not read the host skills.");
9628
+ return { files: skillFiles(text4(params, "name", 200), await catalogOptions()) };
9629
+ }, "namzu/skills/files"),
9630
+ /** One text file of a skill's folder, up to 256 KiB. */
9631
+ "namzu/skills/read_file": /* @__PURE__ */ __name(async (params) => {
9632
+ if (!params || typeof params !== "object" || Object.keys(params).some((key) => key !== "name" && key !== "path"))
9633
+ throw new Error("Invalid skill file request.");
9634
+ if (pal()) throw new Error("Pals do not read the host skills.");
9635
+ return readSkillFile(
9636
+ text4(params, "name", 200),
9637
+ text4(params, "path", 512),
9638
+ await catalogOptions()
9639
+ );
9640
+ }, "namzu/skills/read_file"),
7857
9641
  /** The tool servers in the user's own config file, as the Settings form edits them. */
7858
9642
  "namzu/mcp/user-servers": /* @__PURE__ */ __name(async (params = {}) => {
7859
9643
  if (!params || typeof params !== "object" || Array.isArray(params) || Object.keys(params).some((key) => key !== "name") || params.name !== void 0 && (typeof params.name !== "string" || params.name.length === 0 || params.name.length > 64))
@@ -7865,7 +9649,7 @@ function createDesktopHostExtensions(runtime, directory, publishedSessionCwd, re
7865
9649
  "namzu/mcp/save-user-server": /* @__PURE__ */ __name(async (params) => {
7866
9650
  if (pal()) throw new Error("Pals do not change the host settings.");
7867
9651
  if (!params || typeof params !== "object" || Object.keys(params).some(
7868
- (key) => !["mode", "name", "command", "args", "url", "dryRun"].includes(key)
9652
+ (key) => !["mode", "name", "command", "args", "url", "headers", "dryRun"].includes(key)
7869
9653
  ))
7870
9654
  throw new Error("Saving a tool server names only the server and what it runs or reaches.");
7871
9655
  if (params.mode !== "add" && params.mode !== "edit")
@@ -7875,10 +9659,14 @@ function createDesktopHostExtensions(runtime, directory, publishedSessionCwd, re
7875
9659
  throw new Error("The arguments are a list of words.");
7876
9660
  if (params.dryRun !== void 0 && typeof params.dryRun !== "boolean")
7877
9661
  throw new Error("dryRun is true or false.");
9662
+ const headers = params.headers;
9663
+ if (headers !== void 0 && (typeof headers !== "object" || headers === null || Array.isArray(headers) || Object.keys(headers).length > 20 || Object.values(headers).some((value) => typeof value !== "string" || value.length > 200)))
9664
+ throw new Error("Headers are names with a value written as an environment reference.");
7878
9665
  const input = {
7879
9666
  ...typeof params.command === "string" ? { command: params.command } : {},
7880
9667
  ...args ? { args } : {},
7881
- ...typeof params.url === "string" ? { url: params.url } : {}
9668
+ ...typeof params.url === "string" ? { url: params.url } : {},
9669
+ ...headers ? { headers } : {}
7882
9670
  };
7883
9671
  const name = text4(params, "name", 64);
7884
9672
  if (params.dryRun === true) checkUserMcpServerSave(params.mode, name, input);
@@ -7901,7 +9689,7 @@ function createDesktopHostExtensions(runtime, directory, publishedSessionCwd, re
7901
9689
  "namzu/hooks/list": /* @__PURE__ */ __name(async (params = {}) => {
7902
9690
  if (!params || typeof params !== "object" || Array.isArray(params) || Object.keys(params).length > 0)
7903
9691
  throw new Error("Invalid hooks request.");
7904
- const { describeFolderHooks } = await import("./hooks-report-NJLGBWN3.js");
9692
+ const { describeFolderHooks } = await import("./hooks-report-K6VOPVBR.js");
7905
9693
  return describeFolderHooks({ cwd, trusted: isTrusted(cwd) });
7906
9694
  }, "namzu/hooks/list"),
7907
9695
  /** Approves servers `.mcp.json` declared, as they were listed, the way `namzu mcp approve` does. */
@@ -7916,7 +9704,13 @@ function createDesktopHostExtensions(runtime, directory, publishedSessionCwd, re
7916
9704
  const row2 = item && typeof item === "object" ? item : {};
7917
9705
  return { name: text4(row2, "name", 64), fingerprint: text4(row2, "fingerprint", 128) };
7918
9706
  });
7919
- return { approved: approveListedMcpServers(cwd, checked) };
9707
+ const approved = await approveListedAnyMcpServers({
9708
+ cwd,
9709
+ plugins: pluginConfigFor(cwd),
9710
+ shown: checked
9711
+ });
9712
+ runtime.syncPluginServers?.(cwd);
9713
+ return { approved };
7920
9714
  }, "namzu/mcp/approve"),
7921
9715
  "namzu/project/pr": /* @__PURE__ */ __name(async (params = {}) => {
7922
9716
  if (!params || typeof params !== "object" || Array.isArray(params) || Object.keys(params).length > 0)
@@ -7996,7 +9790,9 @@ function createDesktopHostExtensions(runtime, directory, publishedSessionCwd, re
7996
9790
  canChange: false,
7997
9791
  notice: "Host plugins are not inherited by Pals."
7998
9792
  };
7999
- return runtime.plugins(cwd, id2);
9793
+ return pluginActions.enrichList(
9794
+ await pluginActions.withInstalled(await runtime.plugins(cwd, id2))
9795
+ );
8000
9796
  }, "namzu/plugins/list"),
8001
9797
  "namzu/plugins/set_enabled": /* @__PURE__ */ __name(async (params) => {
8002
9798
  if (!isTrusted(cwd)) throw new Error("Trust this folder first.");
@@ -8459,8 +10255,8 @@ function engineFailure(code, message) {
8459
10255
  __name(engineFailure, "engineFailure");
8460
10256
  function readPackageVersion() {
8461
10257
  try {
8462
- const here = dirname3(fileURLToPath(new URL("../", import.meta.url).href + "commands/acp.js"));
8463
- const pkg = JSON.parse(readFileSync3(join8(here, "..", "..", "package.json"), "utf8"));
10258
+ const here = dirname4(fileURLToPath(new URL("../", import.meta.url).href + "commands/acp.js"));
10259
+ const pkg = JSON.parse(readFileSync3(join9(here, "..", "..", "package.json"), "utf8"));
8464
10260
  return typeof pkg.version === "string" ? pkg.version : "0.0.0";
8465
10261
  } catch {
8466
10262
  return "0.0.0";
@@ -8483,7 +10279,7 @@ function defaultPrefs(detected) {
8483
10279
  __name(defaultPrefs, "defaultPrefs");
8484
10280
  function waitForOperation(operation, signal) {
8485
10281
  if (signal.aborted) return Promise.reject(signal.reason);
8486
- return new Promise((resolve6, reject) => {
10282
+ return new Promise((resolve7, reject) => {
8487
10283
  let active = true;
8488
10284
  const finish = /* @__PURE__ */ __name(() => {
8489
10285
  if (!active) return false;
@@ -8497,7 +10293,7 @@ function waitForOperation(operation, signal) {
8497
10293
  signal.addEventListener("abort", onAbort, { once: true });
8498
10294
  operation.then(
8499
10295
  (value) => {
8500
- if (finish()) resolve6(value);
10296
+ if (finish()) resolve7(value);
8501
10297
  },
8502
10298
  (error) => {
8503
10299
  if (finish()) reject(error);
@@ -8585,7 +10381,7 @@ var LivePromptInbox = class {
8585
10381
  static {
8586
10382
  __name(this, "LivePromptInbox");
8587
10383
  }
8588
- scopeId = randomUUID7();
10384
+ scopeId = randomUUID9();
8589
10385
  entries = /* @__PURE__ */ new Map();
8590
10386
  waiters = /* @__PURE__ */ new Set();
8591
10387
  chars = 0;
@@ -8645,7 +10441,7 @@ var LivePromptInbox = class {
8645
10441
  if (!this.available) return Promise.reject(new Error("The live prompt has closed."));
8646
10442
  if ([...this.entries.values()].some((entry) => entry.status === "pending"))
8647
10443
  return Promise.resolve();
8648
- return new Promise((resolve6, reject) => {
10444
+ return new Promise((resolve7, reject) => {
8649
10445
  const cleanup = /* @__PURE__ */ __name(() => {
8650
10446
  this.waiters.delete(waiter);
8651
10447
  signal.removeEventListener("abort", abort);
@@ -8653,7 +10449,7 @@ var LivePromptInbox = class {
8653
10449
  const waiter = {
8654
10450
  wake: /* @__PURE__ */ __name(() => {
8655
10451
  cleanup();
8656
- resolve6();
10452
+ resolve7();
8657
10453
  }, "wake"),
8658
10454
  close: /* @__PURE__ */ __name(() => {
8659
10455
  cleanup();
@@ -9011,9 +10807,9 @@ function createCliAcpRuntime(bootstrapCtx, deps = DEFAULT_RUNTIME_DEPS, runtimeO
9011
10807
  if (candidate.mcpFailed.length > 0) {
9012
10808
  mcpFailures.set(
9013
10809
  mcpKey(cwd),
9014
- candidate.mcpFailed.map(({ name, reason }) => ({
10810
+ candidate.mcpFailed.map(({ name, reason: reason2 }) => ({
9015
10811
  name,
9016
- reason,
10812
+ reason: reason2,
9017
10813
  config: JSON.stringify(projectCtx.config.mcpServers?.[name] ?? null)
9018
10814
  }))
9019
10815
  );
@@ -9483,7 +11279,7 @@ function createCliAcpRuntime(bootstrapCtx, deps = DEFAULT_RUNTIME_DEPS, runtimeO
9483
11279
  };
9484
11280
  if (outcome.changed.length > 0) {
9485
11281
  await record2?.session.markFilesChanged?.(outcome.changed);
9486
- const shown = outcome.changed.slice(0, 20).map((path) => relative2(current.cwd, path) || path);
11282
+ const shown = outcome.changed.slice(0, 20).map((path) => relative3(current.cwd, path) || path);
9487
11283
  const more = outcome.changed.length - shown.length;
9488
11284
  undoNotes.set(sessionId, [
9489
11285
  ...undoNotes.get(sessionId) ?? [],
@@ -9599,7 +11395,7 @@ function createCliAcpRuntime(bootstrapCtx, deps = DEFAULT_RUNTIME_DEPS, runtimeO
9599
11395
  await settleTurnOfGoneHost(
9600
11396
  state,
9601
11397
  target2.sessionId,
9602
- record2?.session.abandonTurn ? async (turnId, reason) => record2.session.abandonTurn?.(asTurnId(turnId), reason, { withdrawMessages: false }) : void 0
11398
+ record2?.session.abandonTurn ? async (turnId, reason2) => record2.session.abandonTurn?.(asTurnId(turnId), reason2, { withdrawMessages: false }) : void 0
9603
11399
  );
9604
11400
  const status = await (deps.readRetryStatus ?? readProviderRetryStatus)(
9605
11401
  state,
@@ -9665,12 +11461,12 @@ function createCliAcpRuntime(bootstrapCtx, deps = DEFAULT_RUNTIME_DEPS, runtimeO
9665
11461
  );
9666
11462
  if (facts?.pendingDecisions(pausedTurn).size)
9667
11463
  throw new Error("This turn is waiting for a decision; answer it first.");
9668
- const reason = handoff ? "The person stopped the turn a tool paused for them." : "The person continued without the reply that stopped on a provider error.";
11464
+ const reason2 = handoff ? "The person stopped the turn a tool paused for them." : "The person continued without the reply that stopped on a provider error.";
9669
11465
  const withdrawMessages = options?.withdrawMessages !== false;
9670
11466
  if (record2.session.abandonTurn) {
9671
- await record2.session.abandonTurn(asTurnId(pausedTurn), reason, { withdrawMessages });
11467
+ await record2.session.abandonTurn(asTurnId(pausedTurn), reason2, { withdrawMessages });
9672
11468
  } else {
9673
- await abandonTurn(target2.sessionId, asTurnId(pausedTurn), reason, {
11469
+ await abandonTurn(target2.sessionId, asTurnId(pausedTurn), reason2, {
9674
11470
  log: DiskSessionLog.at(record2.conversations.paths, { sessionId: target2.sessionId }),
9675
11471
  index: record2.conversations.index,
9676
11472
  ...withdrawMessages ? { withdrawMessages: true } : {}
@@ -9751,13 +11547,29 @@ function createCliAcpRuntime(bootstrapCtx, deps = DEFAULT_RUNTIME_DEPS, runtimeO
9751
11547
  mcpStatus: /* @__PURE__ */ __name((requestedCwd) => {
9752
11548
  const connected = /* @__PURE__ */ new Set();
9753
11549
  const key = mcpKey(requestedCwd);
11550
+ const pluginFailed = /* @__PURE__ */ new Map();
9754
11551
  for (const record2 of records.values()) {
9755
11552
  if (mcpKey(record2.cwd) !== key) continue;
9756
11553
  for (const server of record2.session.mcpStatus?.().connected ?? [])
9757
11554
  connected.add(server.name);
11555
+ const remote = record2.session.pluginRemoteStatus?.();
11556
+ for (const name of remote?.connected ?? []) connected.add(name);
11557
+ for (const item of remote?.failed ?? []) pluginFailed.set(item.name, item.reason);
9758
11558
  }
9759
- return { connected: [...connected], failed: mcpFailures.get(key) ?? [] };
11559
+ return {
11560
+ connected: [...connected],
11561
+ failed: [
11562
+ ...mcpFailures.get(key) ?? [],
11563
+ ...[...pluginFailed].map(([name, reason2]) => ({ name, reason: reason2 }))
11564
+ ]
11565
+ };
9760
11566
  }, "mcpStatus"),
11567
+ syncPluginServers: /* @__PURE__ */ __name((requestedCwd) => {
11568
+ const key = mcpKey(requestedCwd);
11569
+ for (const record2 of records.values()) {
11570
+ if (mcpKey(record2.cwd) === key) record2.session.syncPluginServers?.();
11571
+ }
11572
+ }, "syncPluginServers"),
9761
11573
  setPluginEnabled: /* @__PURE__ */ __name(async (sessionId, name, enabled, cwd) => {
9762
11574
  if (!isEntityId(sessionId, "session") || typeof name !== "string" || !name.trim() || name.length > 400 || typeof enabled !== "boolean")
9763
11575
  throw new Error("Invalid plugin choice.");
@@ -10089,7 +11901,7 @@ function handoffWindow(browser) {
10089
11901
  return browser.headless ? "none" : "visible";
10090
11902
  }
10091
11903
  __name(handoffWindow, "handoffWindow");
10092
- function desktopServerExtensions(runtime, cwd, server, palInboxStart, terminals, limits, extensions, browserPane) {
11904
+ function desktopServerExtensions(runtime, cwd, server, palInboxStart, terminals, limits, extensions, browserPane, notify) {
10093
11905
  return {
10094
11906
  ...createDesktopHostExtensions(
10095
11907
  runtime,
@@ -10099,7 +11911,9 @@ function desktopServerExtensions(runtime, cwd, server, palInboxStart, terminals,
10099
11911
  void 0,
10100
11912
  void 0,
10101
11913
  palInboxStart,
10102
- limits
11914
+ limits,
11915
+ void 0,
11916
+ notify
10103
11917
  ),
10104
11918
  ...terminals?.extensions,
10105
11919
  // What the app says about the agent's tab in its Browser pane. Always listed, so the app
@@ -10205,7 +12019,8 @@ async function runAcpCommand(ctx, desktop = false) {
10205
12019
  terminals,
10206
12020
  limitsFeed,
10207
12021
  void 0,
10208
- paneLink
12022
+ paneLink,
12023
+ announce
10209
12024
  )
10210
12025
  } : {}
10211
12026
  });
@@ -10218,11 +12033,11 @@ async function runAcpCommand(ctx, desktop = false) {
10218
12033
  cliLogger().info("ACP protocol server started");
10219
12034
  flushCompileCacheWhenIdle();
10220
12035
  try {
10221
- await new Promise((resolve6) => {
12036
+ await new Promise((resolve7) => {
10222
12037
  const finish = /* @__PURE__ */ __name(() => {
10223
12038
  process.stdin.off("end", finish);
10224
12039
  process.stdin.off("close", finish);
10225
- resolve6();
12040
+ resolve7();
10226
12041
  }, "finish");
10227
12042
  process.stdin.once("end", finish);
10228
12043
  process.stdin.once("close", finish);
@@ -10273,4 +12088,4 @@ export {
10273
12088
  resolveAcpSession,
10274
12089
  runAcpCommand
10275
12090
  };
10276
- //# sourceMappingURL=acp-AQUZCZSO.js.map
12091
+ //# sourceMappingURL=acp-6R4I2A3Q.js.map