@namzu/cli 41.2.2 → 43.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (507) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/dist/bin-main.d.ts.map +1 -1
  3. package/dist/bin.js +1 -1
  4. package/dist/chunks/{acp-5RFAFTQU.js → acp-GKYFK7VQ.js} +48 -48
  5. package/dist/chunks/{activity-command-XLF5EAM5.js → activity-command-TOTM3MOY.js} +14 -15
  6. package/dist/chunks/activity-command-TOTM3MOY.js.map +6 -0
  7. package/dist/chunks/{add-Z6Y5DOCM.js → add-4GRA6X5I.js} +25 -25
  8. package/dist/chunks/{agent-U4NFC4DT.js → agent-KEI53I7S.js} +34 -35
  9. package/dist/chunks/agent-session-4IF5H4YO.js +58 -0
  10. package/dist/chunks/{archive-P47MRHE2.js → archive-OOQMVBUH.js} +11 -11
  11. package/dist/chunks/{bin-main-B3QOTIEH.js → bin-main-L67SJQV2.js} +13 -6
  12. package/dist/chunks/{bin-main-B3QOTIEH.js.map → bin-main-L67SJQV2.js.map} +1 -1
  13. package/dist/chunks/{browser-QN24UC7K.js → browser-GDIYUWKT.js} +6 -6
  14. package/dist/chunks/{chat-HRORSJPH.js → chat-FUQOCA7Q.js} +16 -16
  15. package/dist/chunks/chunk-27R3OTVS.js +14 -0
  16. package/dist/chunks/chunk-27R3OTVS.js.map +6 -0
  17. package/dist/chunks/{chunk-CLADMV2E.js → chunk-2C5QF5ZM.js} +2 -2
  18. package/dist/chunks/{chunk-LFI6O7WL.js → chunk-2OVZNENW.js} +43 -2
  19. package/dist/chunks/chunk-2OVZNENW.js.map +6 -0
  20. package/dist/chunks/{chunk-WJ7XYOSE.js → chunk-2R44UHEU.js} +2 -2
  21. package/dist/chunks/{chunk-5XJC5G7N.js → chunk-2S4VEEVB.js} +8 -8
  22. package/dist/chunks/chunk-3F3V2PB7.js +56 -0
  23. package/dist/chunks/chunk-3F3V2PB7.js.map +6 -0
  24. package/dist/chunks/{chunk-JEULHVUH.js → chunk-3SQVE73V.js} +1097 -346
  25. package/dist/chunks/chunk-3SQVE73V.js.map +6 -0
  26. package/dist/chunks/{chunk-4SP6H34B.js → chunk-4V2V2FMP.js} +2 -2
  27. package/dist/chunks/{chunk-CIIMESY2.js → chunk-54TFQUPM.js} +4 -4
  28. package/dist/chunks/{chunk-7B5YTYHY.js → chunk-5QCBUBKO.js} +4 -4
  29. package/dist/chunks/{chunk-CM2I2L4G.js → chunk-6G3XZZRF.js} +2 -2
  30. package/dist/chunks/{chunk-DHV3KMEC.js → chunk-6WK7YVAX.js} +116 -40
  31. package/dist/chunks/chunk-6WK7YVAX.js.map +6 -0
  32. package/dist/chunks/{chunk-UEXQA2UW.js → chunk-752S5IP3.js} +65 -5
  33. package/dist/chunks/chunk-752S5IP3.js.map +6 -0
  34. package/dist/chunks/{chunk-SEVUBJMR.js → chunk-7WQS7BP2.js} +5 -5
  35. package/dist/chunks/{chunk-SEVUBJMR.js.map → chunk-7WQS7BP2.js.map} +1 -1
  36. package/dist/chunks/{chunk-CT23IU3D.js → chunk-AEZ7YTIJ.js} +3 -3
  37. package/dist/chunks/{chunk-2QXVOSJM.js → chunk-B4I264HC.js} +6 -6
  38. package/dist/chunks/{chunk-PKBHQFT6.js → chunk-BBERAGUX.js} +4 -4
  39. package/dist/chunks/{chunk-NTPBXJMK.js → chunk-BHW43OKH.js} +66 -6
  40. package/dist/chunks/chunk-BHW43OKH.js.map +6 -0
  41. package/dist/chunks/{chunk-ZDEFWEEI.js → chunk-BNYTG2ZC.js} +605 -49
  42. package/dist/chunks/chunk-BNYTG2ZC.js.map +6 -0
  43. package/dist/chunks/{chunk-2HDIUUMX.js → chunk-CD5X75DB.js} +2 -2
  44. package/dist/chunks/{chunk-BHR2CNBZ.js → chunk-DABNNT6R.js} +223 -247
  45. package/dist/chunks/chunk-DABNNT6R.js.map +6 -0
  46. package/dist/chunks/{chunk-LVDRURI4.js → chunk-DXTK4EMM.js} +2 -2
  47. package/dist/chunks/{chunk-2UYBHC3L.js → chunk-EADX2OKC.js} +37 -6
  48. package/dist/chunks/chunk-EADX2OKC.js.map +6 -0
  49. package/dist/chunks/{chunk-72CFHDKQ.js → chunk-EDP5FDN4.js} +14 -14
  50. package/dist/chunks/{chunk-2UPDDG7V.js → chunk-EM5AM5BR.js} +3 -3
  51. package/dist/chunks/{chunk-ZMZR4UTZ.js → chunk-FFXSL2SL.js} +2 -2
  52. package/dist/chunks/chunk-G5RAECIB.js +144 -0
  53. package/dist/chunks/chunk-G5RAECIB.js.map +6 -0
  54. package/dist/chunks/{chunk-4WWLRVYU.js → chunk-GNG6HJIV.js} +1879 -736
  55. package/dist/chunks/chunk-GNG6HJIV.js.map +6 -0
  56. package/dist/chunks/{chunk-4SBUXWX3.js → chunk-GURZ2GEB.js} +12 -47
  57. package/dist/chunks/chunk-GURZ2GEB.js.map +6 -0
  58. package/dist/chunks/{chunk-YYX7O3T2.js → chunk-HAAL3DME.js} +3 -3
  59. package/dist/chunks/{chunk-A6J2VJL5.js → chunk-I7FY5SK5.js} +53 -6
  60. package/dist/chunks/chunk-I7FY5SK5.js.map +6 -0
  61. package/dist/chunks/{chunk-OFNGIO53.js → chunk-IJUCXVG5.js} +2 -2
  62. package/dist/chunks/{chunk-ZQRO6GGZ.js → chunk-IY7XWRXE.js} +89 -20
  63. package/dist/chunks/chunk-IY7XWRXE.js.map +6 -0
  64. package/dist/chunks/chunk-JHDNGNQT.js +95 -0
  65. package/dist/chunks/chunk-JHDNGNQT.js.map +6 -0
  66. package/dist/chunks/{chunk-H6B6AROX.js → chunk-JQIBPPOL.js} +69 -46
  67. package/dist/chunks/chunk-JQIBPPOL.js.map +6 -0
  68. package/dist/chunks/{chunk-EUBCYTOK.js → chunk-KONYGNG6.js} +152 -3
  69. package/dist/chunks/chunk-KONYGNG6.js.map +6 -0
  70. package/dist/chunks/{chunk-L2GZVP5H.js → chunk-LAQTQNQE.js} +10 -15
  71. package/dist/chunks/chunk-LAQTQNQE.js.map +6 -0
  72. package/dist/chunks/{chunk-ZGBKTT7X.js → chunk-LCVRXUEV.js} +2 -2
  73. package/dist/chunks/{chunk-QZYTSINZ.js → chunk-LWPTVYRU.js} +4 -4
  74. package/dist/chunks/{chunk-3OP32UHN.js → chunk-M3RKXXZE.js} +3 -3
  75. package/dist/chunks/{chunk-E7FQPIJB.js → chunk-MJRLJDNK.js} +26 -2
  76. package/dist/chunks/chunk-MJRLJDNK.js.map +6 -0
  77. package/dist/chunks/{chunk-J67SASGK.js → chunk-N4DS6G4I.js} +18 -18
  78. package/dist/chunks/{chunk-CEIYJWZ2.js → chunk-NJ6P3WPZ.js} +2 -2
  79. package/dist/chunks/{chunk-CAPC66Q6.js → chunk-NOG4Z42R.js} +4 -4
  80. package/dist/chunks/{chunk-2VQ475KY.js → chunk-NWW46AII.js} +2 -2
  81. package/dist/chunks/chunk-NXM3BLL4.js +59 -0
  82. package/dist/chunks/chunk-NXM3BLL4.js.map +6 -0
  83. package/dist/chunks/{chunk-C2IABASE.js → chunk-ODOM3I7B.js} +672 -29
  84. package/dist/chunks/chunk-ODOM3I7B.js.map +6 -0
  85. package/dist/chunks/{chunk-TU46IHIV.js → chunk-OIOA7BRC.js} +5 -5
  86. package/dist/chunks/{chunk-JKXCLMMZ.js → chunk-OK4UNUNI.js} +2 -2
  87. package/dist/chunks/{chunk-Y5QV6NZK.js → chunk-OUGL6FI2.js} +2 -2
  88. package/dist/chunks/{chunk-RM4XZZL3.js → chunk-P73IFAYM.js} +15 -15
  89. package/dist/chunks/chunk-PCUMISO3.js +92 -0
  90. package/dist/chunks/chunk-PCUMISO3.js.map +6 -0
  91. package/dist/chunks/{chunk-UM4ECTUS.js → chunk-PXSTTFI7.js} +13 -13
  92. package/dist/chunks/chunk-RHT52Z5X.js +1189 -0
  93. package/dist/chunks/chunk-RHT52Z5X.js.map +6 -0
  94. package/dist/chunks/chunk-SIG7WHBU.js +78 -0
  95. package/dist/chunks/chunk-SIG7WHBU.js.map +6 -0
  96. package/dist/chunks/{chunk-WBTXYSAB.js → chunk-SM377CLQ.js} +2 -2
  97. package/dist/chunks/{chunk-34L6FTQV.js → chunk-TAAAO6PM.js} +2 -2
  98. package/dist/chunks/{chunk-BNMFWLWH.js → chunk-TIBFEO2R.js} +5 -5
  99. package/dist/chunks/{chunk-VALR7WUL.js → chunk-TYMIKXOD.js} +2 -2
  100. package/dist/chunks/{chunk-I55BEPVH.js → chunk-TZQT5JL3.js} +4 -4
  101. package/dist/chunks/{chunk-WN7YMX22.js → chunk-UB5YVQJM.js} +4 -4
  102. package/dist/chunks/{chunk-25XPE4N6.js → chunk-UPXD4LJ5.js} +3 -3
  103. package/dist/chunks/{chunk-RKSYVIQX.js → chunk-V5YIGRUD.js} +6 -6
  104. package/dist/chunks/{chunk-37DRD4QM.js → chunk-VNFXDLKD.js} +3 -3
  105. package/dist/chunks/{chunk-Z7DJAGBK.js → chunk-VNK6EA2D.js} +2 -2
  106. package/dist/chunks/{chunk-QNFMVN4D.js → chunk-VRUEY647.js} +2 -2
  107. package/dist/chunks/{chunk-WKGECHMV.js → chunk-VTU23NBS.js} +7 -7
  108. package/dist/chunks/{chunk-3RC4ATZI.js → chunk-VWNLO4OM.js} +12 -6
  109. package/dist/chunks/chunk-VWNLO4OM.js.map +6 -0
  110. package/dist/chunks/{chunk-DQKQKNDY.js → chunk-W6Z7RNVL.js} +9 -9
  111. package/dist/chunks/chunk-W6ZZLT64.js +363 -0
  112. package/dist/chunks/chunk-W6ZZLT64.js.map +6 -0
  113. package/dist/chunks/{chunk-ANUGFVZI.js → chunk-WQDMDSPW.js} +4 -4
  114. package/dist/chunks/{chunk-VCKNYZYH.js → chunk-XGOM2KHV.js} +6 -6
  115. package/dist/chunks/{chunk-G34P5PIK.js → chunk-XV3FGIHS.js} +212 -86
  116. package/dist/chunks/chunk-XV3FGIHS.js.map +6 -0
  117. package/dist/chunks/chunk-XZPLOQBA.js +256 -0
  118. package/dist/chunks/chunk-XZPLOQBA.js.map +6 -0
  119. package/dist/chunks/{chunk-U2AVT6OB.js → chunk-Z3VSDOCX.js} +3 -3
  120. package/dist/chunks/{cli-runtime-7GSPWSYW.js → cli-runtime-Y6RGQSMF.js} +23 -20
  121. package/dist/chunks/cli-runtime-Y6RGQSMF.js.map +6 -0
  122. package/dist/chunks/{commands-LU5AOF65.js → commands-4ZTQFX2X.js} +5 -5
  123. package/dist/chunks/{crash-report-YDSO3QZP.js → crash-report-Y6U6CH73.js} +9 -7
  124. package/dist/chunks/{dist-47WGWXP5.js → dist-3YHUITAK.js} +18 -4
  125. package/dist/chunks/{dist-47WGWXP5.js.map → dist-3YHUITAK.js.map} +1 -1
  126. package/dist/chunks/{dist-FI4O2BO3.js → dist-GTK2JZSU.js} +22 -2
  127. package/dist/chunks/dist-GTK2JZSU.js.map +6 -0
  128. package/dist/chunks/{dist-7PFXZB32.js → dist-J36EH26G.js} +12 -2
  129. package/dist/chunks/{dist-7PFXZB32.js.map → dist-J36EH26G.js.map} +1 -1
  130. package/dist/chunks/{dist-JWX7FPMB.js → dist-OKRQSUWC.js} +8 -3
  131. package/dist/chunks/dist-OKRQSUWC.js.map +6 -0
  132. package/dist/chunks/{dist-7JBTU4ZA.js → dist-TKVIIUPJ.js} +12 -2
  133. package/dist/chunks/dist-TKVIIUPJ.js.map +6 -0
  134. package/dist/chunks/{dist-SLWBMTWO.js → dist-XP72U44M.js} +7 -2
  135. package/dist/chunks/{dist-SLWBMTWO.js.map → dist-XP72U44M.js.map} +1 -1
  136. package/dist/chunks/{dist-BJMHCL2F.js → dist-ZNMZHP7A.js} +8 -4
  137. package/dist/chunks/{dist-BJMHCL2F.js.map → dist-ZNMZHP7A.js.map} +1 -1
  138. package/dist/chunks/{doctor-ZK3CTBDR.js → doctor-WKZ7BGFC.js} +15 -9
  139. package/dist/chunks/{drain-CVQW35OB.js → drain-VOM6IT3C.js} +11 -10
  140. package/dist/chunks/drain-VOM6IT3C.js.map +6 -0
  141. package/dist/chunks/{eval-PBRDQ7GI.js → eval-7MDLH5UR.js} +2 -2
  142. package/dist/chunks/{exec-ZVOPAVQC.js → exec-YBTNNBSS.js} +159 -62
  143. package/dist/chunks/exec-YBTNNBSS.js.map +6 -0
  144. package/dist/chunks/{home-QPIQIIAR.js → home-UID64VNR.js} +3 -3
  145. package/dist/chunks/{host-queries-UUG7LHPF.js → host-queries-A3XQQHI4.js} +23 -17
  146. package/dist/chunks/host-queries-A3XQQHI4.js.map +6 -0
  147. package/dist/chunks/install-LVQAT4QP.js +15 -0
  148. package/dist/chunks/{learn-AILV7XYA.js → learn-N2FNKNCW.js} +15 -14
  149. package/dist/chunks/learn-N2FNKNCW.js.map +6 -0
  150. package/dist/chunks/{learn-builtin-I2RMG7OE.js → learn-builtin-3SQNWE77.js} +18 -17
  151. package/dist/chunks/learn-builtin-3SQNWE77.js.map +6 -0
  152. package/dist/chunks/{lifecycle-ZZ5HDP6F.js → lifecycle-TIEMDICJ.js} +29 -30
  153. package/dist/chunks/{list-TMHSX32S.js → list-HGGKMHPQ.js} +23 -23
  154. package/dist/chunks/live-JHNWMJIE.js +34 -0
  155. package/dist/chunks/{login-VUIOQEA2.js → login-CLFAZ2WB.js} +8 -8
  156. package/dist/chunks/{logs-QQTFNNSW.js → logs-A5HZQ3XA.js} +4 -4
  157. package/dist/chunks/{mcp-6H3YELN6.js → mcp-V27XPHVU.js} +81 -23
  158. package/dist/chunks/mcp-V27XPHVU.js.map +6 -0
  159. package/dist/chunks/{message-command-IQTT76ZY.js → message-command-HBTDJ6WS.js} +40 -41
  160. package/dist/chunks/message-command-HBTDJ6WS.js.map +6 -0
  161. package/dist/chunks/{operator-tools-ISZGHK3F.js → operator-tools-7YJWXVYR.js} +14 -14
  162. package/dist/chunks/{output-schema-63NLKBRY.js → output-schema-NEJ27MH6.js} +3 -3
  163. package/dist/chunks/{pal-RAIDDDNH.js → pal-LX2FA7N2.js} +12 -13
  164. package/dist/chunks/pal-LX2FA7N2.js.map +6 -0
  165. package/dist/chunks/plain-report-IOYN4O6N.js +154 -0
  166. package/dist/chunks/plain-report-IOYN4O6N.js.map +6 -0
  167. package/dist/chunks/{providers-N2UXL3XT.js → providers-XRDUL4OO.js} +6 -6
  168. package/dist/chunks/{resident-CWT62J2M.js → resident-T6QB5MX7.js} +35 -32
  169. package/dist/chunks/resident-T6QB5MX7.js.map +6 -0
  170. package/dist/chunks/resume-YPKHTYLO.js +23 -0
  171. package/dist/chunks/{resume-command-DNNLB5SK.js → resume-command-VSFQAVVN.js} +4 -4
  172. package/dist/chunks/{schedule-6N33GN2Z.js → schedule-GCBVV54F.js} +8 -8
  173. package/dist/chunks/{service-77ZFLYDC.js → service-UQPEAJKT.js} +35 -36
  174. package/dist/chunks/service-UQPEAJKT.js.map +6 -0
  175. package/dist/chunks/session-step-OKCO6S7R.js +33 -0
  176. package/dist/chunks/{skills-SAIXOU7Z.js → skills-LCTXKJCR.js} +9 -8
  177. package/dist/chunks/skills-LCTXKJCR.js.map +6 -0
  178. package/dist/chunks/start-check-NAACA6IE.js +12 -0
  179. package/dist/chunks/{state-J4NZZP7B.js → state-GNWJY3F2.js} +3 -3
  180. package/dist/chunks/{store-QLG76DQG.js → store-44ZZJVF3.js} +6 -6
  181. package/dist/chunks/store-44ZZJVF3.js.map +6 -0
  182. package/dist/chunks/{store-YRVVPTUX.js → store-7ZXMZ6ES.js} +15 -11
  183. package/dist/chunks/store-7ZXMZ6ES.js.map +6 -0
  184. package/dist/chunks/{store-2JQLHCG4.js → store-KGH5U7KF.js} +4 -4
  185. package/dist/chunks/store-KGH5U7KF.js.map +6 -0
  186. package/dist/chunks/{tui-77L5I5EV.js → tui-TNCMJCJJ.js} +1107 -310
  187. package/dist/chunks/tui-TNCMJCJJ.js.map +6 -0
  188. package/dist/chunks/undici-LWANNIOV.js +26906 -0
  189. package/dist/chunks/undici-LWANNIOV.js.map +6 -0
  190. package/dist/chunks/upgrade-DU4I5ACF.js +456 -0
  191. package/dist/chunks/upgrade-DU4I5ACF.js.map +6 -0
  192. package/dist/chunks/{worktree-5ETUFJAC.js → worktree-XGJCKZQJ.js} +13 -13
  193. package/dist/cli-runtime.d.ts +1 -0
  194. package/dist/cli-runtime.d.ts.map +1 -1
  195. package/dist/cli.d.ts.map +1 -1
  196. package/dist/commands/append-system.d.ts +19 -0
  197. package/dist/commands/append-system.d.ts.map +1 -0
  198. package/dist/commands/desktop-host.d.ts +6 -0
  199. package/dist/commands/desktop-host.d.ts.map +1 -1
  200. package/dist/commands/doctor.d.ts.map +1 -1
  201. package/dist/commands/exec-flags.d.ts +33 -0
  202. package/dist/commands/exec-flags.d.ts.map +1 -1
  203. package/dist/commands/exec-json.d.ts +6 -0
  204. package/dist/commands/exec-json.d.ts.map +1 -1
  205. package/dist/commands/exec.d.ts +4 -2
  206. package/dist/commands/exec.d.ts.map +1 -1
  207. package/dist/commands/host-queries.d.ts.map +1 -1
  208. package/dist/commands/mcp.d.ts.map +1 -1
  209. package/dist/commands/resident-flags.d.ts.map +1 -1
  210. package/dist/commands/run-flags.d.ts +32 -0
  211. package/dist/commands/run-flags.d.ts.map +1 -0
  212. package/dist/commands/upgrade.d.ts +23 -25
  213. package/dist/commands/upgrade.d.ts.map +1 -1
  214. package/dist/config/load.d.ts +20 -1
  215. package/dist/config/load.d.ts.map +1 -1
  216. package/dist/config/schema.d.ts +43 -1
  217. package/dist/config/schema.d.ts.map +1 -1
  218. package/dist/config/turn-guards.d.ts +3 -0
  219. package/dist/config/turn-guards.d.ts.map +1 -1
  220. package/dist/context/instruction-glob.d.ts +5 -0
  221. package/dist/context/instruction-glob.d.ts.map +1 -0
  222. package/dist/context/instruction-scope.d.ts +78 -0
  223. package/dist/context/instruction-scope.d.ts.map +1 -0
  224. package/dist/context/project-tracker.d.ts +10 -1
  225. package/dist/context/project-tracker.d.ts.map +1 -1
  226. package/dist/context/project.d.ts +46 -2
  227. package/dist/context/project.d.ts.map +1 -1
  228. package/dist/context/runtime-message.d.ts +8 -1
  229. package/dist/context/runtime-message.d.ts.map +1 -1
  230. package/dist/doctor/checks/cache-lifetime.d.ts +19 -0
  231. package/dist/doctor/checks/cache-lifetime.d.ts.map +1 -0
  232. package/dist/doctor/checks/index.d.ts +3 -1
  233. package/dist/doctor/checks/index.d.ts.map +1 -1
  234. package/dist/doctor/checks/network.d.ts +15 -0
  235. package/dist/doctor/checks/network.d.ts.map +1 -0
  236. package/dist/doctor/checks/updates.d.ts +6 -0
  237. package/dist/doctor/checks/updates.d.ts.map +1 -0
  238. package/dist/doctor/live.d.ts +15 -0
  239. package/dist/doctor/live.d.ts.map +1 -0
  240. package/dist/doctor/plain-report.d.ts +19 -0
  241. package/dist/doctor/plain-report.d.ts.map +1 -0
  242. package/dist/index.js +38 -32
  243. package/dist/integrations/auto-update/apply.d.ts +193 -0
  244. package/dist/integrations/auto-update/apply.d.ts.map +1 -0
  245. package/dist/integrations/auto-update/download.d.ts +35 -0
  246. package/dist/integrations/auto-update/download.d.ts.map +1 -0
  247. package/dist/integrations/auto-update/install-kind.d.ts +55 -0
  248. package/dist/integrations/auto-update/install-kind.d.ts.map +1 -0
  249. package/dist/integrations/auto-update/installed-version.d.ts +3 -0
  250. package/dist/integrations/auto-update/installed-version.d.ts.map +1 -0
  251. package/dist/integrations/auto-update/policy.d.ts +28 -0
  252. package/dist/integrations/auto-update/policy.d.ts.map +1 -0
  253. package/dist/integrations/auto-update/start-check.d.ts +21 -0
  254. package/dist/integrations/auto-update/start-check.d.ts.map +1 -0
  255. package/dist/integrations/auto-update/start.d.ts +25 -0
  256. package/dist/integrations/auto-update/start.d.ts.map +1 -0
  257. package/dist/integrations/auto-update/state.d.ts +109 -0
  258. package/dist/integrations/auto-update/state.d.ts.map +1 -0
  259. package/dist/integrations/auto-update/status.d.ts +37 -0
  260. package/dist/integrations/auto-update/status.d.ts.map +1 -0
  261. package/dist/integrations/auto-update/updater.d.ts +79 -0
  262. package/dist/integrations/auto-update/updater.d.ts.map +1 -0
  263. package/dist/integrations/mcp/project-approval.d.ts +41 -0
  264. package/dist/integrations/mcp/project-approval.d.ts.map +1 -0
  265. package/dist/integrations/mcp/servers.d.ts +37 -2
  266. package/dist/integrations/mcp/servers.d.ts.map +1 -1
  267. package/dist/integrations/mcp/shared-file.d.ts +36 -0
  268. package/dist/integrations/mcp/shared-file.d.ts.map +1 -0
  269. package/dist/integrations/npm-global.d.ts +40 -0
  270. package/dist/integrations/npm-global.d.ts.map +1 -0
  271. package/dist/integrations/plugins/hook-host.d.ts +18 -0
  272. package/dist/integrations/plugins/hook-host.d.ts.map +1 -0
  273. package/dist/integrations/plugins/runtime.d.ts +4 -2
  274. package/dist/integrations/plugins/runtime.d.ts.map +1 -1
  275. package/dist/integrations/providers/fallback-flag.d.ts +29 -0
  276. package/dist/integrations/providers/fallback-flag.d.ts.map +1 -0
  277. package/dist/integrations/providers/prompt-cache-ttl.d.ts +3 -0
  278. package/dist/integrations/providers/prompt-cache-ttl.d.ts.map +1 -1
  279. package/dist/integrations/resident/runner-worker.js +32 -25
  280. package/dist/integrations/resident/runner-worker.js.map +1 -1
  281. package/dist/integrations/sessions/conversation-search.d.ts +1 -1
  282. package/dist/integrations/sessions/conversation-search.d.ts.map +1 -1
  283. package/dist/integrations/sessions/store.d.ts +23 -0
  284. package/dist/integrations/sessions/store.d.ts.map +1 -1
  285. package/dist/integrations/small-model/side-model.d.ts +13 -0
  286. package/dist/integrations/small-model/side-model.d.ts.map +1 -1
  287. package/dist/integrations/subagents/activity.d.ts.map +1 -1
  288. package/dist/integrations/subagents/failure-words.d.ts +2 -0
  289. package/dist/integrations/subagents/failure-words.d.ts.map +1 -0
  290. package/dist/integrations/subagents/fork.d.ts +29 -0
  291. package/dist/integrations/subagents/fork.d.ts.map +1 -0
  292. package/dist/integrations/subagents/runtime.d.ts +8 -2
  293. package/dist/integrations/subagents/runtime.d.ts.map +1 -1
  294. package/dist/integrations/trust/folder-grants.d.ts +12 -1
  295. package/dist/integrations/trust/folder-grants.d.ts.map +1 -1
  296. package/dist/integrations/updates.d.ts +15 -1
  297. package/dist/integrations/updates.d.ts.map +1 -1
  298. package/dist/network/install.d.ts +38 -0
  299. package/dist/network/install.d.ts.map +1 -0
  300. package/dist/network/settings.d.ts +50 -0
  301. package/dist/network/settings.d.ts.map +1 -0
  302. package/dist/pals/agent-session.d.ts.map +1 -1
  303. package/dist/permissions/mode.d.ts +3 -1
  304. package/dist/permissions/mode.d.ts.map +1 -1
  305. package/dist/permissions/read-only-gate.d.ts +28 -0
  306. package/dist/permissions/read-only-gate.d.ts.map +1 -0
  307. package/dist/permissions/sandbox-shell.d.ts +37 -0
  308. package/dist/permissions/sandbox-shell.d.ts.map +1 -0
  309. package/dist/permissions/tool-flags.d.ts +36 -0
  310. package/dist/permissions/tool-flags.d.ts.map +1 -0
  311. package/dist/plan/approval.d.ts +1 -0
  312. package/dist/plan/approval.d.ts.map +1 -1
  313. package/dist/plan/enter-plan-mode-tool.d.ts +28 -0
  314. package/dist/plan/enter-plan-mode-tool.d.ts.map +1 -0
  315. package/dist/plan/plan-file.d.ts +8 -0
  316. package/dist/plan/plan-file.d.ts.map +1 -1
  317. package/dist/reminders/task-nudge.d.ts +9 -1
  318. package/dist/reminders/task-nudge.d.ts.map +1 -1
  319. package/dist/skills/store.d.ts +6 -0
  320. package/dist/skills/store.d.ts.map +1 -1
  321. package/dist/tui/App.d.ts +3 -1
  322. package/dist/tui/App.d.ts.map +1 -1
  323. package/dist/tui/Checklist.d.ts +2 -0
  324. package/dist/tui/Checklist.d.ts.map +1 -1
  325. package/dist/tui/Composer.d.ts +20 -4
  326. package/dist/tui/Composer.d.ts.map +1 -1
  327. package/dist/tui/ContextGridRow.d.ts.map +1 -1
  328. package/dist/tui/LiveActivity.d.ts +2 -0
  329. package/dist/tui/LiveActivity.d.ts.map +1 -1
  330. package/dist/tui/ResumePicker.d.ts +10 -1
  331. package/dist/tui/ResumePicker.d.ts.map +1 -1
  332. package/dist/tui/StatusBar.d.ts +7 -1
  333. package/dist/tui/StatusBar.d.ts.map +1 -1
  334. package/dist/tui/TrustPrompt.d.ts +2 -0
  335. package/dist/tui/TrustPrompt.d.ts.map +1 -1
  336. package/dist/tui/agent.d.ts +46 -1
  337. package/dist/tui/agent.d.ts.map +1 -1
  338. package/dist/tui/capability-notice.d.ts +11 -1
  339. package/dist/tui/capability-notice.d.ts.map +1 -1
  340. package/dist/tui/composer-undo.d.ts +31 -0
  341. package/dist/tui/composer-undo.d.ts.map +1 -0
  342. package/dist/tui/context-grid.d.ts +7 -0
  343. package/dist/tui/context-grid.d.ts.map +1 -1
  344. package/dist/tui/context-usage.d.ts +4 -0
  345. package/dist/tui/context-usage.d.ts.map +1 -1
  346. package/dist/tui/conversation-in-use.d.ts +18 -0
  347. package/dist/tui/conversation-in-use.d.ts.map +1 -0
  348. package/dist/tui/external-editor.d.ts +5 -1
  349. package/dist/tui/external-editor.d.ts.map +1 -1
  350. package/dist/tui/foreground-handoff.d.ts +15 -0
  351. package/dist/tui/foreground-handoff.d.ts.map +1 -0
  352. package/dist/tui/keymap.d.ts +152 -0
  353. package/dist/tui/keymap.d.ts.map +1 -0
  354. package/dist/tui/launch-settings.d.ts +6 -3
  355. package/dist/tui/launch-settings.d.ts.map +1 -1
  356. package/dist/tui/pause-auto-resume.d.ts +33 -0
  357. package/dist/tui/pause-auto-resume.d.ts.map +1 -0
  358. package/dist/tui/permission-review.d.ts.map +1 -1
  359. package/dist/tui/plain-interruption.d.ts +8 -0
  360. package/dist/tui/plain-interruption.d.ts.map +1 -1
  361. package/dist/tui/restored-rows.d.ts +4 -0
  362. package/dist/tui/restored-rows.d.ts.map +1 -1
  363. package/dist/tui/resume-picker-state.d.ts +40 -0
  364. package/dist/tui/resume-picker-state.d.ts.map +1 -0
  365. package/dist/tui/self-mending-pause-row.d.ts +17 -0
  366. package/dist/tui/self-mending-pause-row.d.ts.map +1 -0
  367. package/dist/tui/slashCommands.d.ts +14 -1
  368. package/dist/tui/slashCommands.d.ts.map +1 -1
  369. package/dist/tui/system-rows.d.ts +3 -0
  370. package/dist/tui/system-rows.d.ts.map +1 -1
  371. package/dist/tui/tidy-tool-output.d.ts +2 -0
  372. package/dist/tui/tidy-tool-output.d.ts.map +1 -1
  373. package/dist/tui/tool-server-rows.d.ts +23 -0
  374. package/dist/tui/tool-server-rows.d.ts.map +1 -0
  375. package/dist/tui/turn-interruption.d.ts +2 -0
  376. package/dist/tui/turn-interruption.d.ts.map +1 -1
  377. package/dist/tui/types.d.ts +10 -1
  378. package/dist/tui/types.d.ts.map +1 -1
  379. package/dist/tui/update-notice.d.ts +13 -0
  380. package/dist/tui/update-notice.d.ts.map +1 -1
  381. package/dist/tui/working-label.d.ts +9 -0
  382. package/dist/tui/working-label.d.ts.map +1 -0
  383. package/dist/tui/zen-free-refusal.d.ts +12 -0
  384. package/dist/tui/zen-free-refusal.d.ts.map +1 -1
  385. package/dist/user-commands/store.d.ts +30 -1
  386. package/dist/user-commands/store.d.ts.map +1 -1
  387. package/package.json +11 -10
  388. package/dist/chunks/activity-command-XLF5EAM5.js.map +0 -6
  389. package/dist/chunks/agent-session-LHOJDS75.js +0 -59
  390. package/dist/chunks/chunk-2UYBHC3L.js.map +0 -6
  391. package/dist/chunks/chunk-3RC4ATZI.js.map +0 -6
  392. package/dist/chunks/chunk-4SBUXWX3.js.map +0 -6
  393. package/dist/chunks/chunk-4WWLRVYU.js.map +0 -6
  394. package/dist/chunks/chunk-A6J2VJL5.js.map +0 -6
  395. package/dist/chunks/chunk-BHR2CNBZ.js.map +0 -6
  396. package/dist/chunks/chunk-C2IABASE.js.map +0 -6
  397. package/dist/chunks/chunk-D2M5K6UY.js +0 -440
  398. package/dist/chunks/chunk-D2M5K6UY.js.map +0 -6
  399. package/dist/chunks/chunk-DHV3KMEC.js.map +0 -6
  400. package/dist/chunks/chunk-E7FQPIJB.js.map +0 -6
  401. package/dist/chunks/chunk-EUBCYTOK.js.map +0 -6
  402. package/dist/chunks/chunk-G34P5PIK.js.map +0 -6
  403. package/dist/chunks/chunk-H6B6AROX.js.map +0 -6
  404. package/dist/chunks/chunk-JEULHVUH.js.map +0 -6
  405. package/dist/chunks/chunk-L2GZVP5H.js.map +0 -6
  406. package/dist/chunks/chunk-LFI6O7WL.js.map +0 -6
  407. package/dist/chunks/chunk-NTPBXJMK.js.map +0 -6
  408. package/dist/chunks/chunk-O2B3B2TM.js +0 -138
  409. package/dist/chunks/chunk-O2B3B2TM.js.map +0 -6
  410. package/dist/chunks/chunk-UEXQA2UW.js.map +0 -6
  411. package/dist/chunks/chunk-XSCT3DLE.js +0 -161
  412. package/dist/chunks/chunk-XSCT3DLE.js.map +0 -6
  413. package/dist/chunks/chunk-ZDEFWEEI.js.map +0 -6
  414. package/dist/chunks/chunk-ZQRO6GGZ.js.map +0 -6
  415. package/dist/chunks/cli-runtime-7GSPWSYW.js.map +0 -6
  416. package/dist/chunks/dist-7JBTU4ZA.js.map +0 -6
  417. package/dist/chunks/dist-FI4O2BO3.js.map +0 -6
  418. package/dist/chunks/dist-JWX7FPMB.js.map +0 -6
  419. package/dist/chunks/drain-CVQW35OB.js.map +0 -6
  420. package/dist/chunks/exec-ZVOPAVQC.js.map +0 -6
  421. package/dist/chunks/host-queries-UUG7LHPF.js.map +0 -6
  422. package/dist/chunks/learn-AILV7XYA.js.map +0 -6
  423. package/dist/chunks/learn-builtin-I2RMG7OE.js.map +0 -6
  424. package/dist/chunks/mcp-6H3YELN6.js.map +0 -6
  425. package/dist/chunks/message-command-IQTT76ZY.js.map +0 -6
  426. package/dist/chunks/pal-RAIDDDNH.js.map +0 -6
  427. package/dist/chunks/resident-CWT62J2M.js.map +0 -6
  428. package/dist/chunks/resume-PKATLA4S.js +0 -23
  429. package/dist/chunks/service-77ZFLYDC.js.map +0 -6
  430. package/dist/chunks/session-step-I5DFTYDV.js +0 -30
  431. package/dist/chunks/skills-SAIXOU7Z.js.map +0 -6
  432. package/dist/chunks/tui-77L5I5EV.js.map +0 -6
  433. package/dist/chunks/upgrade-ZTG65H5Q.js +0 -315
  434. package/dist/chunks/upgrade-ZTG65H5Q.js.map +0 -6
  435. /package/dist/chunks/{acp-5RFAFTQU.js.map → acp-GKYFK7VQ.js.map} +0 -0
  436. /package/dist/chunks/{add-Z6Y5DOCM.js.map → add-4GRA6X5I.js.map} +0 -0
  437. /package/dist/chunks/{agent-U4NFC4DT.js.map → agent-KEI53I7S.js.map} +0 -0
  438. /package/dist/chunks/{agent-session-LHOJDS75.js.map → agent-session-4IF5H4YO.js.map} +0 -0
  439. /package/dist/chunks/{archive-P47MRHE2.js.map → archive-OOQMVBUH.js.map} +0 -0
  440. /package/dist/chunks/{browser-QN24UC7K.js.map → browser-GDIYUWKT.js.map} +0 -0
  441. /package/dist/chunks/{chat-HRORSJPH.js.map → chat-FUQOCA7Q.js.map} +0 -0
  442. /package/dist/chunks/{chunk-CLADMV2E.js.map → chunk-2C5QF5ZM.js.map} +0 -0
  443. /package/dist/chunks/{chunk-WJ7XYOSE.js.map → chunk-2R44UHEU.js.map} +0 -0
  444. /package/dist/chunks/{chunk-5XJC5G7N.js.map → chunk-2S4VEEVB.js.map} +0 -0
  445. /package/dist/chunks/{chunk-4SP6H34B.js.map → chunk-4V2V2FMP.js.map} +0 -0
  446. /package/dist/chunks/{chunk-CIIMESY2.js.map → chunk-54TFQUPM.js.map} +0 -0
  447. /package/dist/chunks/{chunk-7B5YTYHY.js.map → chunk-5QCBUBKO.js.map} +0 -0
  448. /package/dist/chunks/{chunk-CM2I2L4G.js.map → chunk-6G3XZZRF.js.map} +0 -0
  449. /package/dist/chunks/{chunk-CT23IU3D.js.map → chunk-AEZ7YTIJ.js.map} +0 -0
  450. /package/dist/chunks/{chunk-2QXVOSJM.js.map → chunk-B4I264HC.js.map} +0 -0
  451. /package/dist/chunks/{chunk-PKBHQFT6.js.map → chunk-BBERAGUX.js.map} +0 -0
  452. /package/dist/chunks/{chunk-2HDIUUMX.js.map → chunk-CD5X75DB.js.map} +0 -0
  453. /package/dist/chunks/{chunk-LVDRURI4.js.map → chunk-DXTK4EMM.js.map} +0 -0
  454. /package/dist/chunks/{chunk-72CFHDKQ.js.map → chunk-EDP5FDN4.js.map} +0 -0
  455. /package/dist/chunks/{chunk-2UPDDG7V.js.map → chunk-EM5AM5BR.js.map} +0 -0
  456. /package/dist/chunks/{chunk-ZMZR4UTZ.js.map → chunk-FFXSL2SL.js.map} +0 -0
  457. /package/dist/chunks/{chunk-YYX7O3T2.js.map → chunk-HAAL3DME.js.map} +0 -0
  458. /package/dist/chunks/{chunk-OFNGIO53.js.map → chunk-IJUCXVG5.js.map} +0 -0
  459. /package/dist/chunks/{chunk-ZGBKTT7X.js.map → chunk-LCVRXUEV.js.map} +0 -0
  460. /package/dist/chunks/{chunk-QZYTSINZ.js.map → chunk-LWPTVYRU.js.map} +0 -0
  461. /package/dist/chunks/{chunk-3OP32UHN.js.map → chunk-M3RKXXZE.js.map} +0 -0
  462. /package/dist/chunks/{chunk-J67SASGK.js.map → chunk-N4DS6G4I.js.map} +0 -0
  463. /package/dist/chunks/{chunk-CEIYJWZ2.js.map → chunk-NJ6P3WPZ.js.map} +0 -0
  464. /package/dist/chunks/{chunk-CAPC66Q6.js.map → chunk-NOG4Z42R.js.map} +0 -0
  465. /package/dist/chunks/{chunk-2VQ475KY.js.map → chunk-NWW46AII.js.map} +0 -0
  466. /package/dist/chunks/{chunk-TU46IHIV.js.map → chunk-OIOA7BRC.js.map} +0 -0
  467. /package/dist/chunks/{chunk-JKXCLMMZ.js.map → chunk-OK4UNUNI.js.map} +0 -0
  468. /package/dist/chunks/{chunk-Y5QV6NZK.js.map → chunk-OUGL6FI2.js.map} +0 -0
  469. /package/dist/chunks/{chunk-RM4XZZL3.js.map → chunk-P73IFAYM.js.map} +0 -0
  470. /package/dist/chunks/{chunk-UM4ECTUS.js.map → chunk-PXSTTFI7.js.map} +0 -0
  471. /package/dist/chunks/{chunk-WBTXYSAB.js.map → chunk-SM377CLQ.js.map} +0 -0
  472. /package/dist/chunks/{chunk-34L6FTQV.js.map → chunk-TAAAO6PM.js.map} +0 -0
  473. /package/dist/chunks/{chunk-BNMFWLWH.js.map → chunk-TIBFEO2R.js.map} +0 -0
  474. /package/dist/chunks/{chunk-VALR7WUL.js.map → chunk-TYMIKXOD.js.map} +0 -0
  475. /package/dist/chunks/{chunk-I55BEPVH.js.map → chunk-TZQT5JL3.js.map} +0 -0
  476. /package/dist/chunks/{chunk-WN7YMX22.js.map → chunk-UB5YVQJM.js.map} +0 -0
  477. /package/dist/chunks/{chunk-25XPE4N6.js.map → chunk-UPXD4LJ5.js.map} +0 -0
  478. /package/dist/chunks/{chunk-RKSYVIQX.js.map → chunk-V5YIGRUD.js.map} +0 -0
  479. /package/dist/chunks/{chunk-37DRD4QM.js.map → chunk-VNFXDLKD.js.map} +0 -0
  480. /package/dist/chunks/{chunk-Z7DJAGBK.js.map → chunk-VNK6EA2D.js.map} +0 -0
  481. /package/dist/chunks/{chunk-QNFMVN4D.js.map → chunk-VRUEY647.js.map} +0 -0
  482. /package/dist/chunks/{chunk-WKGECHMV.js.map → chunk-VTU23NBS.js.map} +0 -0
  483. /package/dist/chunks/{chunk-DQKQKNDY.js.map → chunk-W6Z7RNVL.js.map} +0 -0
  484. /package/dist/chunks/{chunk-ANUGFVZI.js.map → chunk-WQDMDSPW.js.map} +0 -0
  485. /package/dist/chunks/{chunk-VCKNYZYH.js.map → chunk-XGOM2KHV.js.map} +0 -0
  486. /package/dist/chunks/{chunk-U2AVT6OB.js.map → chunk-Z3VSDOCX.js.map} +0 -0
  487. /package/dist/chunks/{commands-LU5AOF65.js.map → commands-4ZTQFX2X.js.map} +0 -0
  488. /package/dist/chunks/{crash-report-YDSO3QZP.js.map → crash-report-Y6U6CH73.js.map} +0 -0
  489. /package/dist/chunks/{doctor-ZK3CTBDR.js.map → doctor-WKZ7BGFC.js.map} +0 -0
  490. /package/dist/chunks/{eval-PBRDQ7GI.js.map → eval-7MDLH5UR.js.map} +0 -0
  491. /package/dist/chunks/{home-QPIQIIAR.js.map → home-UID64VNR.js.map} +0 -0
  492. /package/dist/chunks/{lifecycle-ZZ5HDP6F.js.map → install-LVQAT4QP.js.map} +0 -0
  493. /package/dist/chunks/{login-VUIOQEA2.js.map → lifecycle-TIEMDICJ.js.map} +0 -0
  494. /package/dist/chunks/{list-TMHSX32S.js.map → list-HGGKMHPQ.js.map} +0 -0
  495. /package/dist/chunks/{output-schema-63NLKBRY.js.map → live-JHNWMJIE.js.map} +0 -0
  496. /package/dist/chunks/{providers-N2UXL3XT.js.map → login-CLFAZ2WB.js.map} +0 -0
  497. /package/dist/chunks/{logs-QQTFNNSW.js.map → logs-A5HZQ3XA.js.map} +0 -0
  498. /package/dist/chunks/{operator-tools-ISZGHK3F.js.map → operator-tools-7YJWXVYR.js.map} +0 -0
  499. /package/dist/chunks/{resume-PKATLA4S.js.map → output-schema-NEJ27MH6.js.map} +0 -0
  500. /package/dist/chunks/{resume-command-DNNLB5SK.js.map → providers-XRDUL4OO.js.map} +0 -0
  501. /package/dist/chunks/{session-step-I5DFTYDV.js.map → resume-YPKHTYLO.js.map} +0 -0
  502. /package/dist/chunks/{store-2JQLHCG4.js.map → resume-command-VSFQAVVN.js.map} +0 -0
  503. /package/dist/chunks/{schedule-6N33GN2Z.js.map → schedule-GCBVV54F.js.map} +0 -0
  504. /package/dist/chunks/{store-QLG76DQG.js.map → session-step-OKCO6S7R.js.map} +0 -0
  505. /package/dist/chunks/{store-YRVVPTUX.js.map → start-check-NAACA6IE.js.map} +0 -0
  506. /package/dist/chunks/{state-J4NZZP7B.js.map → state-GNWJY3F2.js.map} +0 -0
  507. /package/dist/chunks/{worktree-5ETUFJAC.js.map → worktree-XGJCKZQJ.js.map} +0 -0
@@ -0,0 +1,1189 @@
1
+ import { createRequire as __namzuCreateRequire } from 'node:module';
2
+ const require = __namzuCreateRequire(import.meta.url);
3
+ import {
4
+ START_CHECK_FLAG
5
+ } from "./chunk-NXM3BLL4.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-76FLAFCG.js";
9
+
10
+ // src/integrations/npm-global.ts
11
+ import { spawn } from "node:child_process";
12
+ import {
13
+ closeSync,
14
+ existsSync,
15
+ mkdirSync,
16
+ openSync,
17
+ readFileSync,
18
+ readSync,
19
+ statSync as statSync2,
20
+ unlinkSync
21
+ } from "node:fs";
22
+ import { dirname as dirname2, join as join2, posix, win32 } from "node:path";
23
+
24
+ // src/integrations/npm-invocation.ts
25
+ import { statSync } from "node:fs";
26
+ import { dirname, join } from "node:path";
27
+ function resolveNpmInvocation(executable, args, platform = process.platform, nodeExecutable = process.execPath) {
28
+ if (platform !== "win32" || executable !== "npm" && executable !== "npm.cmd") {
29
+ return { executable, args };
30
+ }
31
+ const npmCli = join(dirname(nodeExecutable), "node_modules", "npm", "bin", "npm-cli.js");
32
+ try {
33
+ if (statSync(npmCli).isFile()) {
34
+ return { executable: nodeExecutable, args: [npmCli, ...args] };
35
+ }
36
+ } catch {
37
+ }
38
+ throw new Error(
39
+ `npm\u2019s JavaScript entry point is unavailable at ${npmCli}. Namzu uses the npm bundled with its Node runtime on Windows. Repair that Node installation or run npm manually; custom PATH wrappers are not used.`
40
+ );
41
+ }
42
+ __name(resolveNpmInvocation, "resolveNpmInvocation");
43
+
44
+ // src/integrations/npm-global.ts
45
+ function removeOwnPowerShellShim(prefix) {
46
+ try {
47
+ const shim = join2(prefix, "namzu.ps1");
48
+ if (!existsSync(shim) || !existsSync(join2(prefix, "namzu.cmd"))) return false;
49
+ if (!/@namzu[\\/]cli/.test(readFileSync(shim, "utf8"))) return false;
50
+ unlinkSync(shim);
51
+ return true;
52
+ } catch {
53
+ return false;
54
+ }
55
+ }
56
+ __name(removeOwnPowerShellShim, "removeOwnPowerShellShim");
57
+ function npmGlobalPrefixFor(packageRoot, platform) {
58
+ const paths = platform === "win32" ? win32 : posix;
59
+ const root = paths.resolve(packageRoot);
60
+ const expectedTail = platform === "win32" ? paths.join("node_modules", "@namzu", "cli") : paths.join("lib", "node_modules", "@namzu", "cli");
61
+ const comparableRoot = platform === "win32" ? root.toLowerCase() : root;
62
+ const comparableTail = platform === "win32" ? expectedTail.toLowerCase() : expectedTail;
63
+ const suffix = `${paths.sep}${comparableTail}`;
64
+ if (!comparableRoot.endsWith(suffix)) return null;
65
+ const prefix = root.slice(0, root.length - suffix.length);
66
+ return prefix.length > 0 ? prefix : paths.parse(root).root;
67
+ }
68
+ __name(npmGlobalPrefixFor, "npmGlobalPrefixFor");
69
+ var LOG_TAIL_BYTES = 16384;
70
+ function readTail(path) {
71
+ let fd;
72
+ try {
73
+ fd = openSync(path, "r");
74
+ const size = statSync2(path).size;
75
+ const length = Math.min(size, LOG_TAIL_BYTES);
76
+ const buffer = Buffer.alloc(length);
77
+ readSync(fd, buffer, 0, length, size - length);
78
+ return buffer.toString("utf8");
79
+ } catch {
80
+ return "";
81
+ } finally {
82
+ if (fd !== void 0) closeSync(fd);
83
+ }
84
+ }
85
+ __name(readTail, "readTail");
86
+ function killTree(pid) {
87
+ try {
88
+ if (process.platform === "win32") {
89
+ spawn("taskkill", ["/PID", String(pid), "/T", "/F"], {
90
+ stdio: "ignore",
91
+ windowsHide: true
92
+ }).once("error", () => void 0);
93
+ } else {
94
+ process.kill(-pid, "SIGKILL");
95
+ }
96
+ } catch {
97
+ }
98
+ }
99
+ __name(killTree, "killTree");
100
+ function runNpmUpgrade(request) {
101
+ return new Promise((resolveRun, reject) => {
102
+ const invocation = resolveNpmInvocation(request.executable, request.args);
103
+ let logFd;
104
+ if (request.background && request.logFile) {
105
+ mkdirSync(dirname2(request.logFile), { recursive: true });
106
+ logFd = openSync(request.logFile, "w");
107
+ }
108
+ const closeLog = /* @__PURE__ */ __name(() => {
109
+ if (logFd !== void 0) closeSync(logFd);
110
+ logFd = void 0;
111
+ }, "closeLog");
112
+ let child;
113
+ try {
114
+ child = spawn(invocation.executable, [...invocation.args], {
115
+ cwd: request.prefix,
116
+ env: process.env,
117
+ stdio: request.background ? logFd !== void 0 ? ["ignore", logFd, logFd] : ["ignore", "ignore", "ignore"] : request.onOutput ? ["inherit", "pipe", "pipe"] : "inherit",
118
+ // A detached run is timed here (the built-in timeout only reaches the child itself).
119
+ ...request.timeoutMs !== void 0 && !request.background ? { timeout: request.timeoutMs } : {},
120
+ shell: false,
121
+ windowsHide: true,
122
+ // Its own process group: closing the terminal or pressing Ctrl+C must not
123
+ // stop the package manager half way through replacing the package.
124
+ ...request.background ? { detached: true } : {}
125
+ });
126
+ } catch (error) {
127
+ closeLog();
128
+ reject(error);
129
+ return;
130
+ }
131
+ closeLog();
132
+ if (child.pid !== void 0) request.onSpawn?.(child.pid);
133
+ if (request.onOutput && !request.background) {
134
+ child.stdout?.setEncoding("utf8").on("data", request.onOutput);
135
+ child.stderr?.setEncoding("utf8").on("data", request.onOutput);
136
+ }
137
+ let timer;
138
+ if (request.background && request.timeoutMs !== void 0 && child.pid !== void 0) {
139
+ const pid = child.pid;
140
+ timer = setTimeout(() => killTree(pid), request.timeoutMs);
141
+ timer.unref();
142
+ }
143
+ child.once("error", (error) => {
144
+ if (timer) clearTimeout(timer);
145
+ reject(error);
146
+ });
147
+ child.once("close", (code) => {
148
+ if (timer) clearTimeout(timer);
149
+ if (request.background && request.logFile && request.onOutput) {
150
+ const tail = readTail(request.logFile);
151
+ if (tail) request.onOutput(tail);
152
+ }
153
+ resolveRun(code ?? 1);
154
+ });
155
+ });
156
+ }
157
+ __name(runNpmUpgrade, "runNpmUpgrade");
158
+
159
+ // src/integrations/updates.ts
160
+ var NPM_TIMEOUT_MS = 2500;
161
+ var SEMVER_PATTERN = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
162
+ async function withSignal(operation, signal) {
163
+ signal.throwIfAborted();
164
+ let rejectAbort;
165
+ const aborted = new Promise((_resolve, reject) => {
166
+ rejectAbort = reject;
167
+ });
168
+ const onAbort = /* @__PURE__ */ __name(() => rejectAbort?.(signal.reason), "onAbort");
169
+ signal.addEventListener("abort", onAbort, { once: true });
170
+ try {
171
+ return await Promise.race([operation, aborted]);
172
+ } finally {
173
+ signal.removeEventListener("abort", onAbort);
174
+ }
175
+ }
176
+ __name(withSignal, "withSignal");
177
+ function parseVersion(value) {
178
+ const match = SEMVER_PATTERN.exec(value);
179
+ if (!match) return null;
180
+ return {
181
+ core: [Number(match[1]), Number(match[2]), Number(match[3])],
182
+ prerelease: match[4]?.split(".") ?? null
183
+ };
184
+ }
185
+ __name(parseVersion, "parseVersion");
186
+ function compareVersions(a, b) {
187
+ const pa = parseVersion(a);
188
+ const pb = parseVersion(b);
189
+ if (!pa || !pb) throw new Error(`Cannot compare invalid semantic versions: ${a}, ${b}`);
190
+ for (let i = 0; i < pa.core.length; i++) {
191
+ const d = (pa.core[i] ?? 0) - (pb.core[i] ?? 0);
192
+ if (d !== 0) return d;
193
+ }
194
+ if (pa.prerelease === null || pb.prerelease === null) {
195
+ if (pa.prerelease === pb.prerelease) return 0;
196
+ return pa.prerelease === null ? 1 : -1;
197
+ }
198
+ for (let i = 0; i < Math.max(pa.prerelease.length, pb.prerelease.length); i++) {
199
+ const left = pa.prerelease[i];
200
+ const right = pb.prerelease[i];
201
+ if (left === right) continue;
202
+ if (left === void 0) return -1;
203
+ if (right === void 0) return 1;
204
+ const leftNumeric = /^\d+$/.test(left);
205
+ const rightNumeric = /^\d+$/.test(right);
206
+ if (leftNumeric && rightNumeric) return Number(left) - Number(right);
207
+ if (leftNumeric !== rightNumeric) return leftNumeric ? -1 : 1;
208
+ return left < right ? -1 : 1;
209
+ }
210
+ return 0;
211
+ }
212
+ __name(compareVersions, "compareVersions");
213
+ var PUBLIC_REGISTRY = "https://registry.npmjs.org";
214
+ async function fetchNamzuRelease(options = {}) {
215
+ const controller = new AbortController();
216
+ const timeoutMs = options.timeoutMs ?? NPM_TIMEOUT_MS;
217
+ const timeout = Object.assign(
218
+ new Error(`npm registry update check timed out after ${timeoutMs}ms`),
219
+ { name: "TimeoutError" }
220
+ );
221
+ const timer = setTimeout(() => controller.abort(timeout), timeoutMs);
222
+ try {
223
+ const base = (options.registry ?? PUBLIC_REGISTRY).replace(/\/+$/, "");
224
+ const res = await withSignal(
225
+ (options.fetch ?? fetch)(`${base}/@namzu/cli/${options.channel ?? "latest"}`, {
226
+ signal: controller.signal,
227
+ headers: { accept: "application/json" }
228
+ }),
229
+ controller.signal
230
+ );
231
+ if (!res.ok) throw new Error(`npm registry returned HTTP ${res.status}`);
232
+ const data = await withSignal(res.json(), controller.signal);
233
+ if (typeof data.version !== "string" || parseVersion(data.version) === null) {
234
+ throw new Error("npm registry returned an invalid @namzu/cli version");
235
+ }
236
+ const integrity = typeof data.dist?.integrity === "string" && /^sha512-[A-Za-z0-9+/]+=*$/.test(data.dist.integrity) ? data.dist.integrity : void 0;
237
+ const tarball = typeof data.dist?.tarball === "string" ? data.dist.tarball : void 0;
238
+ return {
239
+ version: data.version.replace(/^v/, ""),
240
+ ...integrity ? { integrity } : {},
241
+ ...tarball ? { tarball } : {}
242
+ };
243
+ } finally {
244
+ clearTimeout(timer);
245
+ }
246
+ }
247
+ __name(fetchNamzuRelease, "fetchNamzuRelease");
248
+
249
+ // src/integrations/auto-update/download.ts
250
+ import { createHash, timingSafeEqual } from "node:crypto";
251
+ import { createWriteStream, mkdirSync as mkdirSync2, renameSync, rmSync } from "node:fs";
252
+ import { dirname as dirname3 } from "node:path";
253
+ import { Readable, Transform } from "node:stream";
254
+ import { pipeline } from "node:stream/promises";
255
+ var DownloadError = class extends Error {
256
+ constructor(code, message) {
257
+ super(message);
258
+ this.code = code;
259
+ this.name = "DownloadError";
260
+ }
261
+ code;
262
+ static {
263
+ __name(this, "DownloadError");
264
+ }
265
+ };
266
+ var DEFAULT_TIMEOUT_MS = 5 * 6e4;
267
+ var DEFAULT_MAX_BYTES = 200 * 1024 * 1024;
268
+ function parseSha512(integrity) {
269
+ const match = /^sha512-([A-Za-z0-9+/]+=*)$/.exec(integrity);
270
+ if (!match?.[1]) return null;
271
+ const bytes = Buffer.from(match[1], "base64");
272
+ return bytes.length === 64 ? bytes : null;
273
+ }
274
+ __name(parseSha512, "parseSha512");
275
+ function sameOrigin(a, b) {
276
+ try {
277
+ return new URL(a).origin === new URL(b).origin;
278
+ } catch {
279
+ return false;
280
+ }
281
+ }
282
+ __name(sameOrigin, "sameOrigin");
283
+ async function downloadVerifiedTarball(options) {
284
+ const expected = parseSha512(options.integrity);
285
+ if (!expected) throw new DownloadError("unverifiable", "the registry gave no usable checksum");
286
+ if (!sameOrigin(options.url, options.registry)) {
287
+ throw new DownloadError("unverifiable", "the download address is not on the registry");
288
+ }
289
+ const part = `${options.destination}.part`;
290
+ const controller = new AbortController();
291
+ const timer = setTimeout(
292
+ () => controller.abort(new Error("download timed out")),
293
+ options.timeoutMs ?? DEFAULT_TIMEOUT_MS
294
+ );
295
+ try {
296
+ mkdirSync2(dirname3(options.destination), { recursive: true });
297
+ let response;
298
+ try {
299
+ response = await (options.fetch ?? fetch)(options.url, { signal: controller.signal });
300
+ } catch (error) {
301
+ throw new DownloadError("network", error instanceof Error ? error.message : String(error));
302
+ }
303
+ if (!response.ok || !response.body) {
304
+ throw new DownloadError("network", `the registry answered ${response.status}`);
305
+ }
306
+ const hash = createHash("sha512");
307
+ const limit = options.maxBytes ?? DEFAULT_MAX_BYTES;
308
+ let seen = 0;
309
+ const measure = new Transform({
310
+ transform(chunk, _encoding, done) {
311
+ seen += chunk.length;
312
+ if (seen > limit) {
313
+ done(new DownloadError("network", "the download is larger than expected"));
314
+ return;
315
+ }
316
+ hash.update(chunk);
317
+ done(null, chunk);
318
+ }
319
+ });
320
+ try {
321
+ await pipeline(
322
+ Readable.fromWeb(response.body),
323
+ measure,
324
+ createWriteStream(part),
325
+ { signal: controller.signal }
326
+ );
327
+ } catch (error) {
328
+ if (error instanceof DownloadError) throw error;
329
+ const code = error.code;
330
+ throw new DownloadError(
331
+ code === "ENOSPC" ? "disk_full" : "network",
332
+ error instanceof Error ? error.message : String(error)
333
+ );
334
+ }
335
+ const actual = hash.digest();
336
+ if (actual.length !== expected.length || !timingSafeEqual(actual, expected)) {
337
+ throw new DownloadError("integrity", "the download does not match the registry checksum");
338
+ }
339
+ renameSync(part, options.destination);
340
+ } finally {
341
+ clearTimeout(timer);
342
+ rmSync(part, { force: true });
343
+ }
344
+ }
345
+ __name(downloadVerifiedTarball, "downloadVerifiedTarball");
346
+
347
+ // src/integrations/auto-update/state.ts
348
+ import { createHash as createHash2, randomBytes } from "node:crypto";
349
+ import {
350
+ closeSync as closeSync2,
351
+ existsSync as existsSync2,
352
+ linkSync,
353
+ mkdirSync as mkdirSync3,
354
+ openSync as openSync2,
355
+ readFileSync as readFileSync2,
356
+ readdirSync,
357
+ renameSync as renameSync2,
358
+ rmSync as rmSync2,
359
+ statSync as statSync3,
360
+ writeFileSync
361
+ } from "node:fs";
362
+ import { join as join3, posix as posix2, win32 as win322 } from "node:path";
363
+ function updatesDir(home) {
364
+ return join3(home, "updates");
365
+ }
366
+ __name(updatesDir, "updatesDir");
367
+ function writeJsonAtomic(path, value, pid) {
368
+ mkdirSync3(join3(path, ".."), { recursive: true });
369
+ const temp = `${path}.${pid}.tmp`;
370
+ writeFileSync(temp, `${JSON.stringify(value)}
371
+ `);
372
+ renameSync2(temp, path);
373
+ }
374
+ __name(writeJsonAtomic, "writeJsonAtomic");
375
+ function readJson(path) {
376
+ try {
377
+ return JSON.parse(readFileSync2(path, "utf8"));
378
+ } catch {
379
+ return void 0;
380
+ }
381
+ }
382
+ __name(readJson, "readJson");
383
+ function readCheck(home) {
384
+ const value = readJson(join3(updatesDir(home), "check.json"));
385
+ if (!value || typeof value.at !== "number" || typeof value.channel !== "string" || typeof value.version !== "string") {
386
+ return void 0;
387
+ }
388
+ return value;
389
+ }
390
+ __name(readCheck, "readCheck");
391
+ function writeCheck(home, record, pid = process.pid) {
392
+ try {
393
+ writeJsonAtomic(join3(updatesDir(home), "check.json"), record, pid);
394
+ } catch {
395
+ }
396
+ }
397
+ __name(writeCheck, "writeCheck");
398
+ function readLastResult(home, scope) {
399
+ const value = readJson(join3(updatesDir(home), `last-result-${scope}.json`));
400
+ if (!value || typeof value.at !== "string" || typeof value.outcome !== "string") return void 0;
401
+ return value;
402
+ }
403
+ __name(readLastResult, "readLastResult");
404
+ function writeLastResult(home, scope, result, pid = process.pid) {
405
+ try {
406
+ writeJsonAtomic(join3(updatesDir(home), `last-result-${scope}.json`), result, pid);
407
+ } catch {
408
+ }
409
+ }
410
+ __name(writeLastResult, "writeLastResult");
411
+ function readAttempt(home, scope) {
412
+ const value = readJson(join3(updatesDir(home), `attempt-${scope}.json`));
413
+ if (!value || typeof value.version !== "string" || typeof value.code !== "string" || typeof value.at !== "number" || typeof value.shown !== "boolean") {
414
+ return void 0;
415
+ }
416
+ return value;
417
+ }
418
+ __name(readAttempt, "readAttempt");
419
+ function writeAttempt(home, scope, record, pid = process.pid) {
420
+ try {
421
+ writeJsonAtomic(join3(updatesDir(home), `attempt-${scope}.json`), record, pid);
422
+ } catch {
423
+ }
424
+ }
425
+ __name(writeAttempt, "writeAttempt");
426
+ function installScope(location, platform = process.platform) {
427
+ const resolved = (platform === "win32" ? win322 : posix2).resolve(location);
428
+ const comparable = platform === "win32" ? resolved.toLowerCase() : resolved;
429
+ return createHash2("sha256").update(comparable).digest("hex").slice(0, 12);
430
+ }
431
+ __name(installScope, "installScope");
432
+ var LOCK_STALE_MS = 15 * 6e4;
433
+ function processIsAlive(pid) {
434
+ try {
435
+ process.kill(pid, 0);
436
+ return true;
437
+ } catch (error) {
438
+ return error.code === "EPERM";
439
+ }
440
+ }
441
+ __name(processIsAlive, "processIsAlive");
442
+ function lockDir(home, scope) {
443
+ return join3(updatesDir(home), "locks", scope ?? "shared");
444
+ }
445
+ __name(lockDir, "lockDir");
446
+ function generations(dir) {
447
+ try {
448
+ return readdirSync(dir).filter((name) => /^\d+$/.test(name)).map(Number).sort((a, b) => a - b);
449
+ } catch {
450
+ return [];
451
+ }
452
+ }
453
+ __name(generations, "generations");
454
+ function createExclusive(path, body) {
455
+ const temp = `${path}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`;
456
+ writeFileSync(temp, body);
457
+ try {
458
+ linkSync(temp, path);
459
+ } catch (error) {
460
+ const code = error.code;
461
+ if (code === "EEXIST") throw error;
462
+ const fd = openSync2(path, "wx");
463
+ try {
464
+ writeFileSync(fd, body);
465
+ } finally {
466
+ closeSync2(fd);
467
+ }
468
+ } finally {
469
+ rmSync2(temp, { force: true });
470
+ }
471
+ }
472
+ __name(createExclusive, "createExclusive");
473
+ function acquireUpdateLock(options) {
474
+ const pid = options.pid ?? process.pid;
475
+ const now = options.now ?? Date.now;
476
+ const isAlive = options.isAlive ?? processIsAlive;
477
+ const staleMs = options.staleMs ?? LOCK_STALE_MS;
478
+ const dir = lockDir(options.home, options.scope);
479
+ mkdirSync3(dir, { recursive: true });
480
+ for (let attempt = 0; attempt < 8; attempt += 1) {
481
+ const all = generations(dir);
482
+ const top = all.length > 0 ? all[all.length - 1] : 0;
483
+ if (top > 0) {
484
+ const held = readJson(join3(dir, String(top)));
485
+ const live = held !== void 0 && held.released !== true && typeof held.pid === "number" && typeof held.at === "number" && isAlive(held.pid) && now() - held.at <= staleMs;
486
+ if (live) return null;
487
+ }
488
+ const next = top + 1;
489
+ const nonce = randomBytes(8).toString("hex");
490
+ const path = join3(dir, String(next));
491
+ try {
492
+ createExclusive(path, JSON.stringify({ pid, at: now(), nonce }));
493
+ } catch (error) {
494
+ if (error.code === "EEXIST") continue;
495
+ throw error;
496
+ }
497
+ for (const old of all) rmSync2(join3(dir, String(old)), { force: true });
498
+ return {
499
+ release() {
500
+ const held = readJson(path);
501
+ if (held?.nonce !== nonce) return;
502
+ try {
503
+ writeJsonAtomic(path, { pid, at: now(), nonce, released: true }, pid);
504
+ } catch {
505
+ }
506
+ }
507
+ };
508
+ }
509
+ return null;
510
+ }
511
+ __name(acquireUpdateLock, "acquireUpdateLock");
512
+ function markerPath(home, scope) {
513
+ return join3(updatesDir(home), scope ? `in-progress-${scope}.json` : "in-progress.json");
514
+ }
515
+ __name(markerPath, "markerPath");
516
+ function writeInProgress(home, marker, scope) {
517
+ writeJsonAtomic(markerPath(home, scope), marker, marker.pid);
518
+ }
519
+ __name(writeInProgress, "writeInProgress");
520
+ var VERSION_SHAPE = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.+-]+)?$/;
521
+ function readInProgress(home, scope) {
522
+ const value = readJson(markerPath(home, scope));
523
+ if (!value || typeof value.pid !== "number" || typeof value.to !== "string" || typeof value.from !== "string" || typeof value.at !== "number" || !VERSION_SHAPE.test(value.from) || !VERSION_SHAPE.test(value.to)) {
524
+ return void 0;
525
+ }
526
+ return value;
527
+ }
528
+ __name(readInProgress, "readInProgress");
529
+ function clearInProgress(home, scope) {
530
+ rmSync2(markerPath(home, scope), { force: true });
531
+ }
532
+ __name(clearInProgress, "clearInProgress");
533
+ function processIsRunning(pid) {
534
+ return processIsAlive(pid);
535
+ }
536
+ __name(processIsRunning, "processIsRunning");
537
+ function previousDir(home, version, scope) {
538
+ return scope ? join3(updatesDir(home), "previous", scope, version) : join3(updatesDir(home), "previous", version);
539
+ }
540
+ __name(previousDir, "previousDir");
541
+ function pruneOlderPrevious(home, keep = 2, scope) {
542
+ const root = scope ? join3(updatesDir(home), "previous", scope) : join3(updatesDir(home), "previous");
543
+ try {
544
+ if (!existsSync2(root)) return;
545
+ const entries = readdirSync(root).map((name) => ({ name, mtime: statSync3(join3(root, name)).mtimeMs })).sort((a, b) => b.mtime - a.mtime);
546
+ for (const entry of entries.slice(keep))
547
+ rmSync2(join3(root, entry.name), { recursive: true, force: true });
548
+ } catch {
549
+ }
550
+ }
551
+ __name(pruneOlderPrevious, "pruneOlderPrevious");
552
+
553
+ // src/integrations/auto-update/apply.ts
554
+ import { execFile } from "node:child_process";
555
+ import {
556
+ cpSync,
557
+ existsSync as existsSync3,
558
+ mkdirSync as mkdirSync4,
559
+ readFileSync as readFileSync3,
560
+ readdirSync as readdirSync2,
561
+ renameSync as renameSync3,
562
+ rmSync as rmSync3
563
+ } from "node:fs";
564
+ import { isAbsolute, join as join4, relative, resolve } from "node:path";
565
+ function activeRoot(install) {
566
+ return install.kind === "pnpm-global" ? join4(install.globalDir, "node_modules", "@namzu", "cli") : install.root;
567
+ }
568
+ __name(activeRoot, "activeRoot");
569
+ function scopeOf(install, platform = process.platform) {
570
+ return installScope(install.kind === "pnpm-global" ? install.globalDir : install.prefix, platform);
571
+ }
572
+ __name(scopeOf, "scopeOf");
573
+ function sharedStateHome(install) {
574
+ return join4(install.kind === "pnpm-global" ? install.globalDir : install.prefix, ".namzu-update");
575
+ }
576
+ __name(sharedStateHome, "sharedStateHome");
577
+ var PUBLIC_REGISTRY2 = "https://registry.npmjs.org";
578
+ function tarballPath(home, scope, version) {
579
+ return join4(updatesDir(home), "download", `namzu-cli-${version}-${scope}.tgz`);
580
+ }
581
+ __name(tarballPath, "tarballPath");
582
+ function npmInstallArgs(prefix, version, registry = PUBLIC_REGISTRY2, tarball) {
583
+ return [
584
+ "install",
585
+ "--global",
586
+ "--prefix",
587
+ prefix,
588
+ "--no-fund",
589
+ "--no-audit",
590
+ "--registry",
591
+ registry,
592
+ ...tarball ? [`--@namzu:registry=${registry}`] : [],
593
+ tarball ?? `@namzu/cli@${version}`
594
+ ];
595
+ }
596
+ __name(npmInstallArgs, "npmInstallArgs");
597
+ function pnpmInstallArgs(version, registry = PUBLIC_REGISTRY2, tarball, mode = "online") {
598
+ return [
599
+ "add",
600
+ "--global",
601
+ ...mode === "online" ? [] : [`--${mode}`],
602
+ "--registry",
603
+ registry,
604
+ // The scope is pinned for every form, so a scoped registry in the person's or a
605
+ // project's .npmrc cannot decide where the package is resolved from.
606
+ `--@namzu:registry=${registry}`,
607
+ tarball ?? `@namzu/cli@${version}`
608
+ ];
609
+ }
610
+ __name(pnpmInstallArgs, "pnpmInstallArgs");
611
+ async function settlePnpmByName(run, version, registry) {
612
+ try {
613
+ return await run(pnpmInstallArgs(version, registry, void 0, "offline")) === 0;
614
+ } catch {
615
+ return false;
616
+ }
617
+ }
618
+ __name(settlePnpmByName, "settlePnpmByName");
619
+ async function reinstallPnpm(run, version, registry) {
620
+ for (const mode of ["offline", "online"]) {
621
+ try {
622
+ if (await run(pnpmInstallArgs(version, registry, void 0, mode)) === 0) return true;
623
+ } catch {
624
+ }
625
+ }
626
+ return false;
627
+ }
628
+ __name(reinstallPnpm, "reinstallPnpm");
629
+ function pnpmRunner(deps, cwd, logFile, onSpawn) {
630
+ return (args) => deps.runInstaller({
631
+ executable: "pnpm",
632
+ args,
633
+ cwd,
634
+ onOutput: /* @__PURE__ */ __name(() => void 0, "onOutput"),
635
+ logFile,
636
+ timeoutMs: deps.installTimeoutMs ?? 3e5,
637
+ ...onSpawn ? { onSpawn } : {}
638
+ });
639
+ }
640
+ __name(pnpmRunner, "pnpmRunner");
641
+ function pruneStaleDownloads(home, scope, keep) {
642
+ const dir = join4(updatesDir(home), "download");
643
+ try {
644
+ for (const name of readdirSync2(dir)) {
645
+ if (name.endsWith(`-${scope}.tgz`) && join4(dir, name) !== keep)
646
+ rmSync3(join4(dir, name), { force: true });
647
+ }
648
+ } catch {
649
+ }
650
+ }
651
+ __name(pruneStaleDownloads, "pruneStaleDownloads");
652
+ function manualUpdateCommand(install, version, platform) {
653
+ if (install.kind === "npm-global") {
654
+ const base = `npm install --global --prefix ${quoteIfNeeded(install.prefix)} @namzu/cli@${version}`;
655
+ return install.writable ? "namzu upgrade" : platform === "win32" ? base : `sudo ${base}`;
656
+ }
657
+ if (install.kind === "pnpm-global") return `pnpm add --global @namzu/cli@${version}`;
658
+ return null;
659
+ }
660
+ __name(manualUpdateCommand, "manualUpdateCommand");
661
+ function quoteIfNeeded(value) {
662
+ return /[\s"'$`\\]/.test(value) && !/^[A-Za-z]:\\/.test(value) ? `'${value.replace(/'/g, `'\\''`)}'` : /\s/.test(value) ? `"${value}"` : value;
663
+ }
664
+ __name(quoteIfNeeded, "quoteIfNeeded");
665
+ function classifyInstallerFailure(output, platform = process.platform) {
666
+ if (/EINTEGRITY|integrity checksum failed|sha512-.*(?:mismatch|expected)/i.test(output))
667
+ return "integrity";
668
+ if (/EBUSY|ETXTBSY|resource busy|text file busy/i.test(output)) return "in_use";
669
+ if (platform === "win32" && /EPERM/.test(output)) return "in_use";
670
+ if (/EACCES|EPERM|permission denied|operation not permitted/i.test(output)) return "no_permission";
671
+ if (/ENOSPC|no space left/i.test(output)) return "disk_full";
672
+ if (/ENOTFOUND|ECONNRESET|ECONNREFUSED|ETIMEDOUT|EAI_AGAIN|ENETUNREACH|ENETDOWN|EHOSTUNREACH|ERR_SOCKET_TIMEOUT|fetch failed/i.test(
673
+ output
674
+ ))
675
+ return "network";
676
+ return "install_failed";
677
+ }
678
+ __name(classifyInstallerFailure, "classifyInstallerFailure");
679
+ function describeFailure(code) {
680
+ switch (code) {
681
+ case "no_permission":
682
+ return "Namzu may not write to the folder it is installed in.";
683
+ case "in_use":
684
+ return "A file of the installed copy is in use by another program.";
685
+ case "unverifiable":
686
+ return "The registry did not give a checksum for the new version, so it was not installed.";
687
+ case "integrity":
688
+ return "The download did not match its checksum, so it was not installed.";
689
+ case "network":
690
+ return "The download was interrupted.";
691
+ case "disk_full":
692
+ return "There is not enough free disk space.";
693
+ case "backup_failed":
694
+ return "A copy of the current version could not be kept, so nothing was changed.";
695
+ case "verify_failed":
696
+ return "The new version did not start, so the previous one was put back.";
697
+ default:
698
+ return "The installer did not finish.";
699
+ }
700
+ }
701
+ __name(describeFailure, "describeFailure");
702
+ function backupPackage(root, home, version, scope) {
703
+ const target = previousDir(home, version, scope);
704
+ rmSync3(target, { recursive: true, force: true });
705
+ mkdirSync4(join4(target, ".."), { recursive: true });
706
+ cpSync(root, target, { recursive: true, verbatimSymlinks: true });
707
+ return target;
708
+ }
709
+ __name(backupPackage, "backupPackage");
710
+ function restorePackage(root, backup, pid = process.pid) {
711
+ const fresh = `${root}.restore-${pid}`;
712
+ const aside = `${root}.replaced-${pid}`;
713
+ rmSync3(fresh, { recursive: true, force: true });
714
+ rmSync3(aside, { recursive: true, force: true });
715
+ try {
716
+ cpSync(backup, fresh, { recursive: true, verbatimSymlinks: true });
717
+ const hadRoot = existsSync3(root);
718
+ if (hadRoot) renameSync3(root, aside);
719
+ try {
720
+ renameSync3(fresh, root);
721
+ } catch (error) {
722
+ if (hadRoot) renameSync3(aside, root);
723
+ throw error;
724
+ }
725
+ } finally {
726
+ rmSync3(fresh, { recursive: true, force: true });
727
+ rmSync3(aside, { recursive: true, force: true });
728
+ }
729
+ }
730
+ __name(restorePackage, "restorePackage");
731
+ async function smokeTestInstalled(root, version, depth = "session") {
732
+ let entry = join4(root, "dist", "bin.js");
733
+ try {
734
+ const pkg = JSON.parse(readFileSync3(join4(root, "package.json"), "utf8"));
735
+ const bin = typeof pkg.bin === "string" ? pkg.bin : pkg.bin?.namzu;
736
+ if (bin) entry = join4(root, bin);
737
+ } catch {
738
+ return false;
739
+ }
740
+ const run = /* @__PURE__ */ __name((arg) => new Promise((resolve2) => {
741
+ execFile(
742
+ process.execPath,
743
+ [entry, arg],
744
+ {
745
+ timeout: 45e3,
746
+ windowsHide: true,
747
+ env: { ...process.env, NAMZU_AUTO_UPDATE: "0", NAMZU_UPDATE_CHECK: "0" }
748
+ },
749
+ (error, stdout) => resolve2(error ? null : stdout.trim())
750
+ );
751
+ }), "run");
752
+ if (await run("--version") !== version) return false;
753
+ return depth === "version" || await run(START_CHECK_FLAG) === "ok";
754
+ }
755
+ __name(smokeTestInstalled, "smokeTestInstalled");
756
+ async function applyUpdate(deps, release) {
757
+ const { install } = deps;
758
+ if (!release.integrity) {
759
+ return fail("unverifiable", true);
760
+ }
761
+ let onDisk;
762
+ try {
763
+ onDisk = deps.installedVersion(activeRoot(install));
764
+ } catch {
765
+ return fail("install_failed", true);
766
+ }
767
+ if (compareVersions(onDisk, release.version) >= 0) return { status: "already", to: onDisk };
768
+ if (!install.writable) return fail("no_permission", true);
769
+ let lock;
770
+ try {
771
+ lock = acquireUpdateLock({
772
+ home: sharedStateHome(install),
773
+ scope: scopeOf(install, deps.platform),
774
+ ...deps.pid !== void 0 ? { pid: deps.pid } : {},
775
+ ...deps.now ? { now: deps.now } : {},
776
+ ...deps.isAlive ? { isAlive: deps.isAlive } : {}
777
+ });
778
+ } catch {
779
+ return fail("backup_failed", true);
780
+ }
781
+ if (!lock) return { status: "locked" };
782
+ try {
783
+ return await applyLocked(deps, release, onDisk);
784
+ } finally {
785
+ lock.release();
786
+ }
787
+ }
788
+ __name(applyUpdate, "applyUpdate");
789
+ function fail(code, restored, log) {
790
+ const lost = restored ? "" : " The previous version could not be put back; reinstall Namzu if it does not start.";
791
+ return {
792
+ status: "failed",
793
+ code,
794
+ detail: `${describeFailure(code)}${lost}`,
795
+ restored,
796
+ ...log ? { log } : {}
797
+ };
798
+ }
799
+ __name(fail, "fail");
800
+ function installLogPath(home, scope, name = "install") {
801
+ return join4(updatesDir(home), `${name}-${scope}.log`);
802
+ }
803
+ __name(installLogPath, "installLogPath");
804
+ async function applyLocked(deps, release, onDisk) {
805
+ const registry = deps.registry ?? PUBLIC_REGISTRY2;
806
+ const scope = scopeOf(deps.install, deps.platform);
807
+ const logFile = installLogPath(deps.home, scope);
808
+ const tarball = tarballPath(deps.home, scope, release.version);
809
+ pruneStaleDownloads(deps.home, scope, tarball);
810
+ try {
811
+ await (deps.fetchTarball ?? fetchFromRegistry(registry))(release, tarball);
812
+ } catch (error) {
813
+ try {
814
+ rmSync3(tarball, { force: true });
815
+ } catch {
816
+ }
817
+ const code = error instanceof DownloadError ? error.code : "network";
818
+ return fail(code, true);
819
+ }
820
+ try {
821
+ return await installFromTarball(deps, release, onDisk, tarball, scope, logFile);
822
+ } finally {
823
+ rmSync3(tarball, { force: true });
824
+ }
825
+ }
826
+ __name(applyLocked, "applyLocked");
827
+ function fetchFromRegistry(registry) {
828
+ return async (release, file) => {
829
+ if (!release.integrity || !release.tarball) {
830
+ throw new DownloadError("unverifiable", "the registry gave no checksum or address");
831
+ }
832
+ await downloadVerifiedTarball({
833
+ url: release.tarball,
834
+ integrity: release.integrity,
835
+ registry,
836
+ destination: file
837
+ });
838
+ };
839
+ }
840
+ __name(fetchFromRegistry, "fetchFromRegistry");
841
+ async function installFromTarball(deps, release, onDisk, tarball, scope, logFile) {
842
+ const { install } = deps;
843
+ const shared = sharedStateHome(install);
844
+ const registry = deps.registry ?? PUBLIC_REGISTRY2;
845
+ let backup;
846
+ const pid = deps.pid ?? process.pid;
847
+ const at = (deps.now ?? Date.now)();
848
+ try {
849
+ writeInProgress(shared, { pid, to: release.version, from: onDisk, at }, scope);
850
+ if (install.kind === "npm-global") {
851
+ backup = backupPackage(install.root, shared, onDisk, scope);
852
+ writeInProgress(shared, { pid, to: release.version, from: onDisk, backup, at }, scope);
853
+ }
854
+ } catch {
855
+ clearInProgress(shared, scope);
856
+ return fail("backup_failed", true);
857
+ }
858
+ const restore = /* @__PURE__ */ __name(async () => {
859
+ try {
860
+ if (install.kind === "npm-global") {
861
+ if (!backup) return false;
862
+ restorePackage(install.root, backup, deps.pid);
863
+ return true;
864
+ }
865
+ const smoke2 = deps.smokeTest ?? smokeTestInstalled;
866
+ return await reinstallPnpm(
867
+ pnpmRunner(deps, install.globalDir, installLogPath(deps.home, scope, "restore")),
868
+ onDisk,
869
+ registry
870
+ ) && deps.installedVersion(activeRoot(install)) === onDisk && await smoke2(activeRoot(install), onDisk, "version");
871
+ } catch {
872
+ return false;
873
+ }
874
+ }, "restore");
875
+ const noteInstaller = /* @__PURE__ */ __name((installerPid) => {
876
+ try {
877
+ writeInProgress(
878
+ shared,
879
+ {
880
+ pid,
881
+ to: release.version,
882
+ from: onDisk,
883
+ ...backup ? { backup } : {},
884
+ installerPid,
885
+ at
886
+ },
887
+ scope
888
+ );
889
+ } catch {
890
+ }
891
+ }, "noteInstaller");
892
+ let output = "";
893
+ let code;
894
+ try {
895
+ code = await deps.runInstaller(
896
+ install.kind === "npm-global" ? {
897
+ executable: deps.platform === "win32" ? "npm.cmd" : "npm",
898
+ args: npmInstallArgs(install.prefix, release.version, registry, tarball),
899
+ cwd: install.prefix,
900
+ onOutput: /* @__PURE__ */ __name((text) => {
901
+ output = (output + text).slice(-16384);
902
+ }, "onOutput"),
903
+ timeoutMs: deps.installTimeoutMs ?? 3e5,
904
+ logFile,
905
+ onSpawn: noteInstaller
906
+ } : {
907
+ executable: "pnpm",
908
+ args: pnpmInstallArgs(release.version, registry, tarball),
909
+ cwd: install.globalDir,
910
+ onOutput: /* @__PURE__ */ __name((text) => {
911
+ output = (output + text).slice(-16384);
912
+ }, "onOutput"),
913
+ timeoutMs: deps.installTimeoutMs ?? 3e5,
914
+ logFile,
915
+ onSpawn: noteInstaller
916
+ }
917
+ );
918
+ } catch {
919
+ code = 1;
920
+ output = "spawn failed";
921
+ }
922
+ if (code !== 0) {
923
+ const kind = classifyInstallerFailure(output, deps.platform);
924
+ const restored = await restoreIfChanged(deps, onDisk, restore);
925
+ if (restored) clearInProgress(shared, scope);
926
+ return fail(kind, restored, logFile);
927
+ }
928
+ if (install.kind === "pnpm-global") {
929
+ await settlePnpmByName(
930
+ pnpmRunner(deps, install.globalDir, logFile, noteInstaller),
931
+ release.version,
932
+ registry
933
+ );
934
+ }
935
+ let installed;
936
+ try {
937
+ installed = deps.installedVersion(activeRoot(install));
938
+ } catch {
939
+ installed = "";
940
+ }
941
+ const smoke = deps.smokeTest ?? smokeTestInstalled;
942
+ const healthy = installed === release.version && await smoke(activeRoot(install), release.version, "session");
943
+ if (!healthy) {
944
+ const restored = await restore();
945
+ if (restored) clearInProgress(shared, scope);
946
+ return fail("verify_failed", restored, logFile);
947
+ }
948
+ clearInProgress(shared, scope);
949
+ if (deps.platform === "win32" && install.kind === "npm-global") {
950
+ try {
951
+ deps.removePowerShellShim?.(install.prefix);
952
+ } catch {
953
+ }
954
+ }
955
+ pruneOlderPrevious(sharedStateHome(install), 2, scope);
956
+ return { status: "installed", from: onDisk, to: release.version };
957
+ }
958
+ __name(installFromTarball, "installFromTarball");
959
+ async function restoreIfChanged(deps, onDisk, restore) {
960
+ try {
961
+ if (deps.installedVersion(activeRoot(deps.install)) === onDisk) {
962
+ const smoke = deps.smokeTest ?? smokeTestInstalled;
963
+ if (await smoke(activeRoot(deps.install), onDisk, "version")) return true;
964
+ }
965
+ } catch {
966
+ }
967
+ return restore();
968
+ }
969
+ __name(restoreIfChanged, "restoreIfChanged");
970
+ async function repairInterruptedUpdate(deps) {
971
+ const scope = scopeOf(deps.install, deps.platform);
972
+ const marker = readInProgress(sharedStateHome(deps.install), scope);
973
+ if (!marker) return { status: "none" };
974
+ const own = deps.pid ?? process.pid;
975
+ const fresh = (deps.now ?? Date.now)() - marker.at <= LOCK_STALE_MS;
976
+ if (fresh && marker.pid !== own && processIsRunning(marker.pid)) return { status: "busy" };
977
+ if (fresh && marker.installerPid !== void 0 && processIsRunning(marker.installerPid))
978
+ return { status: "busy" };
979
+ let lock;
980
+ try {
981
+ lock = acquireUpdateLock({
982
+ home: sharedStateHome(deps.install),
983
+ scope,
984
+ pid: own,
985
+ ...deps.now ? { now: deps.now } : {},
986
+ ...deps.isAlive ? { isAlive: deps.isAlive } : {}
987
+ });
988
+ } catch {
989
+ return { status: "busy" };
990
+ }
991
+ if (!lock) return { status: "busy" };
992
+ try {
993
+ const { install } = deps;
994
+ const shared = sharedStateHome(install);
995
+ const root = activeRoot(install);
996
+ const smoke = deps.smokeTest ?? smokeTestInstalled;
997
+ const ids = { from: marker.from, to: marker.to };
998
+ let healthy = false;
999
+ try {
1000
+ const now = deps.installedVersion(root);
1001
+ healthy = (now === marker.to || now === marker.from) && await smoke(root, now, now === marker.to ? "session" : "version");
1002
+ } catch {
1003
+ healthy = false;
1004
+ }
1005
+ if (healthy) {
1006
+ clearInProgress(shared, scope);
1007
+ return deps.installedVersion(root) === marker.to ? { status: "completed", ...ids } : { status: "unchanged", ...ids };
1008
+ }
1009
+ let restored = false;
1010
+ try {
1011
+ if (install.kind === "npm-global" && marker.backup && isKeptCopy(shared, marker.backup) && existsSync3(marker.backup)) {
1012
+ restorePackage(install.root, marker.backup, own);
1013
+ restored = deps.installedVersion(root) === marker.from;
1014
+ } else if (install.kind === "pnpm-global") {
1015
+ restored = await reinstallPnpm(
1016
+ pnpmRunner(deps, install.globalDir, installLogPath(deps.home, scope, "restore")),
1017
+ marker.from,
1018
+ deps.registry ?? PUBLIC_REGISTRY2
1019
+ ) && deps.installedVersion(root) === marker.from && await smoke(root, marker.from, "version");
1020
+ }
1021
+ } catch {
1022
+ restored = false;
1023
+ }
1024
+ if (restored) clearInProgress(shared, scope);
1025
+ return { status: restored ? "restored" : "unrepaired", ...ids };
1026
+ } finally {
1027
+ lock.release();
1028
+ }
1029
+ }
1030
+ __name(repairInterruptedUpdate, "repairInterruptedUpdate");
1031
+ function isKeptCopy(home, backup) {
1032
+ const base = resolve(previousDir(home, "x"), "..");
1033
+ const rel = relative(base, resolve(backup));
1034
+ return rel !== "" && !rel.startsWith("..") && !isAbsolute(rel);
1035
+ }
1036
+ __name(isKeptCopy, "isKeptCopy");
1037
+
1038
+ // src/integrations/auto-update/install-kind.ts
1039
+ import { constants, accessSync, existsSync as existsSync4, realpathSync } from "node:fs";
1040
+ import { dirname as dirname4, join as join5, posix as posix3, win32 as win323 } from "node:path";
1041
+ function writableDir(path) {
1042
+ try {
1043
+ accessSync(path, constants.W_OK);
1044
+ return true;
1045
+ } catch {
1046
+ return false;
1047
+ }
1048
+ }
1049
+ __name(writableDir, "writableDir");
1050
+ function samePath(a, b, platform) {
1051
+ const paths = platform === "win32" ? win323 : posix3;
1052
+ const left = paths.resolve(a);
1053
+ const right = paths.resolve(b);
1054
+ return platform === "win32" ? left.toLowerCase() === right.toLowerCase() : left === right;
1055
+ }
1056
+ __name(samePath, "samePath");
1057
+ var PNPM_GLOBAL_STORE = /^(.*[\\/]pnpm[\\/]global[\\/]\d+)[\\/](?:node_modules[\\/])?\.pnpm[\\/]/i;
1058
+ var PNPM_GLOBAL_LINK = /^(.*[\\/]pnpm[\\/]global[\\/]\d+)[\\/]node_modules[\\/]@namzu[\\/]cli[\\/]?$/i;
1059
+ function pnpmGlobalDirFor(packageRoot) {
1060
+ return PNPM_GLOBAL_STORE.exec(packageRoot)?.[1] ?? PNPM_GLOBAL_LINK.exec(packageRoot)?.[1] ?? null;
1061
+ }
1062
+ __name(pnpmGlobalDirFor, "pnpmGlobalDirFor");
1063
+ function classifyInstall(input) {
1064
+ const exists = input.exists ?? existsSync4;
1065
+ const canWrite = input.writable ?? writableDir;
1066
+ const root = input.packageRoot;
1067
+ const platform = input.platform;
1068
+ if (input.isElectron || /[\\/]resources[\\/]cli$/i.test(root)) return { kind: "desktop", root };
1069
+ if (/[\\/](_npx|dlx-[^\\/]*|\.bun[\\/]install[\\/]cache|bunx-[^\\/]*)[\\/]/i.test(root)) {
1070
+ return { kind: "ephemeral", root };
1071
+ }
1072
+ if (exists(join5(root, "src")) || exists(join5(root, "..", "..", "pnpm-workspace.yaml")) || exists(join5(root, ".git"))) {
1073
+ return { kind: "development", root };
1074
+ }
1075
+ const pnpmDir = pnpmGlobalDirFor(root);
1076
+ if (pnpmDir) {
1077
+ const writable = platform !== "win32" && canWrite(pnpmDir);
1078
+ return { kind: "pnpm-global", root, globalDir: pnpmDir, writable };
1079
+ }
1080
+ const prefix = npmGlobalPrefixFor(root, platform);
1081
+ if (prefix) {
1082
+ const owned = input.namzuHome !== void 0 && samePath(prefix, input.namzuHome, platform);
1083
+ if (platform === "win32" && !owned && !exists(win323.join(prefix, "namzu.cmd"))) {
1084
+ return { kind: "unknown", root };
1085
+ }
1086
+ const writable = canWrite(dirname4(root)) && canWrite(prefix);
1087
+ return { kind: "npm-global", root, prefix, owned, writable };
1088
+ }
1089
+ return { kind: "unknown", root };
1090
+ }
1091
+ __name(classifyInstall, "classifyInstall");
1092
+ function realRoot(path) {
1093
+ try {
1094
+ return realpathSync(path);
1095
+ } catch {
1096
+ return path;
1097
+ }
1098
+ }
1099
+ __name(realRoot, "realRoot");
1100
+
1101
+ // src/integrations/auto-update/policy.ts
1102
+ var ON_WORDS = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
1103
+ var OFF_WORDS = /* @__PURE__ */ new Set(["0", "false", "no", "off"]);
1104
+ function readSwitch(value) {
1105
+ const word = value?.trim().toLowerCase();
1106
+ if (!word) return void 0;
1107
+ if (ON_WORDS.has(word)) return true;
1108
+ if (OFF_WORDS.has(word)) return false;
1109
+ return void 0;
1110
+ }
1111
+ __name(readSwitch, "readSwitch");
1112
+ function runsInCi(env) {
1113
+ for (const name of [
1114
+ "CI",
1115
+ "GITHUB_ACTIONS",
1116
+ "GITLAB_CI",
1117
+ "BUILDKITE",
1118
+ "JENKINS_URL",
1119
+ "TF_BUILD"
1120
+ ]) {
1121
+ const value = env[name]?.trim().toLowerCase();
1122
+ if (value && !OFF_WORDS.has(value)) return true;
1123
+ }
1124
+ return false;
1125
+ }
1126
+ __name(runsInCi, "runsInCi");
1127
+ function parseUpdateChannel(value) {
1128
+ const word = value?.trim().toLowerCase();
1129
+ return word === "latest" || word === "stable" ? word : void 0;
1130
+ }
1131
+ __name(parseUpdateChannel, "parseUpdateChannel");
1132
+ function resolveUpdatePolicy(input) {
1133
+ const { config, env } = input;
1134
+ const channel = parseUpdateChannel(env.NAMZU_UPDATE_CHANNEL) ?? config?.channel ?? "latest";
1135
+ const check = readSwitch(env.NAMZU_UPDATE_CHECK) ?? config?.check ?? true;
1136
+ if (!check) return { check: false, install: false, channel, decidedBy: "environment" };
1137
+ const fromEnv = readSwitch(env.NAMZU_AUTO_UPDATE);
1138
+ if (fromEnv !== void 0) {
1139
+ return { check: true, install: fromEnv, channel, decidedBy: "environment" };
1140
+ }
1141
+ if (config?.auto !== void 0) {
1142
+ return { check: true, install: config.auto, channel, decidedBy: "config" };
1143
+ }
1144
+ if (runsInCi(env)) return { check: true, install: false, channel, decidedBy: "ci" };
1145
+ return { check: true, install: input.interactive, channel, decidedBy: "default" };
1146
+ }
1147
+ __name(resolveUpdatePolicy, "resolveUpdatePolicy");
1148
+
1149
+ export {
1150
+ resolveNpmInvocation,
1151
+ removeOwnPowerShellShim,
1152
+ npmGlobalPrefixFor,
1153
+ runNpmUpgrade,
1154
+ compareVersions,
1155
+ fetchNamzuRelease,
1156
+ DownloadError,
1157
+ readCheck,
1158
+ writeCheck,
1159
+ readLastResult,
1160
+ writeLastResult,
1161
+ readAttempt,
1162
+ writeAttempt,
1163
+ installScope,
1164
+ acquireUpdateLock,
1165
+ writeInProgress,
1166
+ clearInProgress,
1167
+ pruneOlderPrevious,
1168
+ scopeOf,
1169
+ PUBLIC_REGISTRY2 as PUBLIC_REGISTRY,
1170
+ tarballPath,
1171
+ npmInstallArgs,
1172
+ pnpmInstallArgs,
1173
+ settlePnpmByName,
1174
+ reinstallPnpm,
1175
+ pruneStaleDownloads,
1176
+ manualUpdateCommand,
1177
+ describeFailure,
1178
+ backupPackage,
1179
+ restorePackage,
1180
+ smokeTestInstalled,
1181
+ applyUpdate,
1182
+ fetchFromRegistry,
1183
+ repairInterruptedUpdate,
1184
+ pnpmGlobalDirFor,
1185
+ classifyInstall,
1186
+ realRoot,
1187
+ resolveUpdatePolicy
1188
+ };
1189
+ //# sourceMappingURL=chunk-RHT52Z5X.js.map