@namzu/cli 51.3.0 → 52.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 (423) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/bin-main.d.ts.map +1 -1
  3. package/dist/bin.js +1 -1
  4. package/dist/chunks/{acp-AMAEXYMD.js → acp-GZSHLVZX.js} +83 -75
  5. package/dist/chunks/{acp-AMAEXYMD.js.map → acp-GZSHLVZX.js.map} +1 -1
  6. package/dist/chunks/{activity-command-4IUJ2CE4.js → activity-command-DRY4O6C7.js} +12 -12
  7. package/dist/chunks/{add-FT7HDU36.js → add-RQBESQ6Z.js} +20 -20
  8. package/dist/chunks/{agent-EHNABCBA.js → agent-GLF7GLPC.js} +43 -41
  9. package/dist/chunks/agent-session-EY2MHANW.js +73 -0
  10. package/dist/chunks/apply-at-exit-MWOSCJVT.js +118 -0
  11. package/dist/chunks/apply-at-exit-MWOSCJVT.js.map +6 -0
  12. package/dist/chunks/{archive-5JVH6NLF.js → archive-XU3MKNSL.js} +13 -13
  13. package/dist/chunks/{bin-main-7SUJ2P6D.js → bin-main-IME4NTUN.js} +56 -22
  14. package/dist/chunks/bin-main-IME4NTUN.js.map +6 -0
  15. package/dist/chunks/{binding-S6NFVWG5.js → binding-OONLIEMY.js} +3 -3
  16. package/dist/chunks/{browser-5GSFFOI3.js → browser-XWMMPWJ4.js} +6 -6
  17. package/dist/chunks/{chat-HROABWUI.js → chat-4RCY7GY7.js} +18 -18
  18. package/dist/chunks/{chunk-AOMD2UUT.js → chunk-2WW5X746.js} +12 -12
  19. package/dist/chunks/{chunk-4HCSIYER.js → chunk-37ECJXU5.js} +10 -3
  20. package/dist/chunks/{chunk-4HCSIYER.js.map → chunk-37ECJXU5.js.map} +1 -1
  21. package/dist/chunks/{chunk-5BPI6U3L.js → chunk-3NFDOR4V.js} +6 -6
  22. package/dist/chunks/chunk-3PZVYS7P.js +537 -0
  23. package/dist/chunks/chunk-3PZVYS7P.js.map +6 -0
  24. package/dist/chunks/{chunk-5FZDDFXS.js → chunk-3ZHOM2L7.js} +2 -2
  25. package/dist/chunks/{chunk-YLSDJOE6.js → chunk-5475JD4J.js} +2 -2
  26. package/dist/chunks/{chunk-MPAS3ZKW.js → chunk-5L3MNVYT.js} +259 -192
  27. package/dist/chunks/chunk-5L3MNVYT.js.map +6 -0
  28. package/dist/chunks/{chunk-RLGFYOUI.js → chunk-6IMEYAUA.js} +6 -6
  29. package/dist/chunks/{chunk-DAJHQNAH.js → chunk-7OUUT33C.js} +2 -2
  30. package/dist/chunks/{chunk-ZM7SGAOM.js → chunk-7VPJL3ND.js} +2 -2
  31. package/dist/chunks/{chunk-TOGEJIC5.js → chunk-A4VNFRRT.js} +4 -4
  32. package/dist/chunks/{chunk-G4M6NKL6.js → chunk-ABFJZT7O.js} +16 -4
  33. package/dist/chunks/chunk-ABFJZT7O.js.map +6 -0
  34. package/dist/chunks/{chunk-DFM3INZ3.js → chunk-BMMQWTWB.js} +47 -43
  35. package/dist/chunks/chunk-BMMQWTWB.js.map +6 -0
  36. package/dist/chunks/{chunk-4U245XO5.js → chunk-C2LZ4PQL.js} +2 -2
  37. package/dist/chunks/{chunk-2KMRCXGA.js → chunk-C2OXXOZH.js} +9 -9
  38. package/dist/chunks/{chunk-ONCQ3NZ6.js → chunk-CD45JE7Q.js} +220 -31
  39. package/dist/chunks/chunk-CD45JE7Q.js.map +6 -0
  40. package/dist/chunks/{chunk-B5AIMVRI.js → chunk-CING2BNJ.js} +2 -43
  41. package/dist/chunks/chunk-CING2BNJ.js.map +6 -0
  42. package/dist/chunks/{chunk-SZOC2LYR.js → chunk-CNYVQMBP.js} +8 -8
  43. package/dist/chunks/{chunk-QISKJ5SO.js → chunk-CPVM2HQE.js} +2 -2
  44. package/dist/chunks/{chunk-CZHAME47.js → chunk-D4JAC2TS.js} +4 -4
  45. package/dist/chunks/{chunk-QNS2KLVT.js → chunk-DL3O5QZQ.js} +2 -2
  46. package/dist/chunks/{chunk-USJJDXQK.js → chunk-EKYINJHR.js} +3 -3
  47. package/dist/chunks/{chunk-YEMHAEO5.js → chunk-ET7QIC7S.js} +2 -2
  48. package/dist/chunks/{chunk-HSEIISLI.js → chunk-FKSBLMS6.js} +2 -2
  49. package/dist/chunks/{chunk-MLYGIG7M.js → chunk-FPX2KIKV.js} +3 -3
  50. package/dist/chunks/{chunk-FSVH5R5J.js → chunk-FYWBIH72.js} +6 -6
  51. package/dist/chunks/{chunk-IGO3W6WL.js → chunk-GCE2OOL7.js} +7 -7
  52. package/dist/chunks/{chunk-IJEESVK5.js → chunk-GD57FLJ6.js} +2 -2
  53. package/dist/chunks/{chunk-4BEZSMMK.js → chunk-GDC23ATL.js} +3 -3
  54. package/dist/chunks/{chunk-2MLY3HJM.js → chunk-GQHWZGAE.js} +4 -4
  55. package/dist/chunks/{chunk-ZC7ZL42B.js → chunk-GZ44UQZS.js} +9 -9
  56. package/dist/chunks/{chunk-M5NDHHMG.js → chunk-HI7YADBV.js} +3 -3
  57. package/dist/chunks/chunk-HMRSZOTE.js +54 -0
  58. package/dist/chunks/chunk-HMRSZOTE.js.map +6 -0
  59. package/dist/chunks/{chunk-KQYWFHRH.js → chunk-HNRKSWL3.js} +4 -4
  60. package/dist/chunks/{chunk-77D2J3GS.js → chunk-HQPVETKK.js} +5 -5
  61. package/dist/chunks/{chunk-ZR3FTR77.js → chunk-HUVJFACV.js} +4 -4
  62. package/dist/chunks/chunk-I5KVADDV.js +578 -0
  63. package/dist/chunks/chunk-I5KVADDV.js.map +6 -0
  64. package/dist/chunks/{chunk-H47LSNSP.js → chunk-IDEENHCZ.js} +2 -2
  65. package/dist/chunks/{chunk-KROVFC6L.js → chunk-IICA4Y2H.js} +2 -2
  66. package/dist/chunks/{chunk-3TINX26N.js → chunk-JJRAQRIM.js} +3 -3
  67. package/dist/chunks/{chunk-PXIVFM3R.js → chunk-JRGYUTXM.js} +3 -3
  68. package/dist/chunks/{chunk-W2IBHK6I.js → chunk-JUCOHYKO.js} +2 -2
  69. package/dist/chunks/{chunk-OP4VBHY7.js → chunk-K4FUKV2K.js} +3 -565
  70. package/dist/chunks/chunk-K4FUKV2K.js.map +6 -0
  71. package/dist/chunks/chunk-K6GW3ZS7.js +66 -0
  72. package/dist/chunks/chunk-K6GW3ZS7.js.map +6 -0
  73. package/dist/chunks/{chunk-7COFRJAP.js → chunk-KOAA7NOL.js} +2 -2
  74. package/dist/chunks/{chunk-2WRNHAVP.js → chunk-LMTAEZBP.js} +5 -5
  75. package/dist/chunks/{chunk-SSYBTI26.js → chunk-LOURGMN3.js} +4 -4
  76. package/dist/chunks/{chunk-LWNTLOML.js → chunk-LP5SU76P.js} +3 -3
  77. package/dist/chunks/{chunk-KCRZA2E3.js → chunk-LVVLXBRD.js} +2 -2
  78. package/dist/chunks/{chunk-4GIWPKXI.js → chunk-M5CYA52R.js} +4 -4
  79. package/dist/chunks/{chunk-YUOFGSIR.js → chunk-MLH6LIEQ.js} +51 -36
  80. package/dist/chunks/{chunk-YUOFGSIR.js.map → chunk-MLH6LIEQ.js.map} +1 -1
  81. package/dist/chunks/{chunk-DC67SNZK.js → chunk-NJBOI7VM.js} +7 -7
  82. package/dist/chunks/{chunk-RSJVDB4N.js → chunk-NNRR53EW.js} +87 -6
  83. package/dist/chunks/chunk-NNRR53EW.js.map +6 -0
  84. package/dist/chunks/{chunk-TL6X6MAW.js → chunk-NUY3X4CY.js} +2 -2
  85. package/dist/chunks/{chunk-FENQC4LO.js → chunk-O4J3UD4C.js} +2 -2
  86. package/dist/chunks/{chunk-4AF3VDBG.js → chunk-O7FEZN6I.js} +42 -518
  87. package/dist/chunks/chunk-O7FEZN6I.js.map +6 -0
  88. package/dist/chunks/{chunk-MNQDNDGD.js → chunk-OCRCL6ZJ.js} +15 -15
  89. package/dist/chunks/{chunk-N4B5NJTM.js → chunk-OCUUCP4P.js} +6 -6
  90. package/dist/chunks/{chunk-R66H2G5R.js → chunk-OZQHNGZ3.js} +9 -2
  91. package/dist/chunks/chunk-OZQHNGZ3.js.map +6 -0
  92. package/dist/chunks/{chunk-UZLAIMHO.js → chunk-PA7WI43E.js} +5 -5
  93. package/dist/chunks/{chunk-LAR6KRME.js → chunk-QIMXI2SN.js} +2 -2
  94. package/dist/chunks/{chunk-XC2RVHA4.js → chunk-RJSYFGYO.js} +4 -4
  95. package/dist/chunks/chunk-RL2CTUF2.js +50 -0
  96. package/dist/chunks/chunk-RL2CTUF2.js.map +6 -0
  97. package/dist/chunks/{chunk-3PDX3NC2.js → chunk-RYVQYNRB.js} +5 -5
  98. package/dist/chunks/chunk-SG4UN7SW.js +69 -0
  99. package/dist/chunks/chunk-SG4UN7SW.js.map +6 -0
  100. package/dist/chunks/{chunk-BGODFPA6.js → chunk-SOUYLINA.js} +3 -3
  101. package/dist/chunks/{chunk-IIOWVRGQ.js → chunk-SUY6QMOD.js} +140 -6
  102. package/dist/chunks/chunk-SUY6QMOD.js.map +6 -0
  103. package/dist/chunks/{chunk-BFAMP45Q.js → chunk-SW6TWRX3.js} +5 -5
  104. package/dist/chunks/{chunk-WVS354PX.js → chunk-TDERHZPK.js} +32 -75
  105. package/dist/chunks/chunk-TDERHZPK.js.map +6 -0
  106. package/dist/chunks/{chunk-5CP365QA.js → chunk-TGAVBDVI.js} +115 -13
  107. package/dist/chunks/chunk-TGAVBDVI.js.map +6 -0
  108. package/dist/chunks/{chunk-UVYM67LE.js → chunk-TGYT53PO.js} +2 -2
  109. package/dist/chunks/{chunk-LXLM4OQO.js → chunk-TRFQXPTZ.js} +2 -2
  110. package/dist/chunks/{chunk-KQEX2PNL.js → chunk-TUZKXKTI.js} +177 -84
  111. package/dist/chunks/chunk-TUZKXKTI.js.map +6 -0
  112. package/dist/chunks/chunk-U4XNJBDB.js +76 -0
  113. package/dist/chunks/chunk-U4XNJBDB.js.map +6 -0
  114. package/dist/chunks/{chunk-PBEK6MTE.js → chunk-UAMQVGGR.js} +82 -27
  115. package/dist/chunks/chunk-UAMQVGGR.js.map +6 -0
  116. package/dist/chunks/{chunk-JCXJ3QSC.js → chunk-UCISROX2.js} +3 -3
  117. package/dist/chunks/{chunk-A4KQCS3B.js → chunk-UHKIQA3I.js} +3 -3
  118. package/dist/chunks/{chunk-LKHMBU72.js → chunk-USHPWAWT.js} +2 -2
  119. package/dist/chunks/{chunk-JPQNCR67.js → chunk-UZIVRYFX.js} +2 -2
  120. package/dist/chunks/chunk-V7MBCAP3.js +107 -0
  121. package/dist/chunks/chunk-V7MBCAP3.js.map +6 -0
  122. package/dist/chunks/{chunk-UZ6GL6GO.js → chunk-VCMY2BUN.js} +2 -2
  123. package/dist/chunks/{chunk-P4SMB7ZH.js → chunk-VEMMS6US.js} +4 -4
  124. package/dist/chunks/{chunk-P2DX5J2F.js → chunk-VH75W4CX.js} +12 -12
  125. package/dist/chunks/{chunk-BGPJ7MSM.js → chunk-VJ7ZCZQ4.js} +9 -9
  126. package/dist/chunks/{chunk-BZVF3B6D.js → chunk-VL6N5AEF.js} +2 -2
  127. package/dist/chunks/{chunk-BLSCBY2C.js → chunk-VRORRHPK.js} +3 -3
  128. package/dist/chunks/{chunk-J7IH3JCJ.js → chunk-WDCBWZ6V.js} +2 -2
  129. package/dist/chunks/{chunk-SO322MOO.js → chunk-WDFOZDWA.js} +2 -2
  130. package/dist/chunks/{chunk-2FRFMWVI.js → chunk-WLVE7H7P.js} +5 -5
  131. package/dist/chunks/{chunk-GDHAOY4Y.js → chunk-WNBDXO6I.js} +3 -3
  132. package/dist/chunks/{chunk-H2SUL7EJ.js → chunk-XKUDYXPE.js} +3 -3
  133. package/dist/chunks/{chunk-V7IK6MHO.js → chunk-XO4RLPIW.js} +2 -2
  134. package/dist/chunks/{chunk-7QIJT537.js → chunk-YYSSVDZ3.js} +2 -2
  135. package/dist/chunks/{chunk-YWLMSOOM.js → chunk-Z6L2JR73.js} +18 -18
  136. package/dist/chunks/{chunk-4ACKQXK5.js → chunk-ZHVKBXFG.js} +2 -2
  137. package/dist/chunks/{chunk-2MHTEUWP.js → chunk-ZXXBQLSF.js} +3 -3
  138. package/dist/chunks/{cli-runtime-OJB72C6H.js → cli-runtime-3WQF676K.js} +25 -24
  139. package/dist/chunks/cli-runtime-3WQF676K.js.map +6 -0
  140. package/dist/chunks/{commands-5MHVFUYY.js → commands-DKOXQYR7.js} +5 -5
  141. package/dist/chunks/{cost-XLXGPE4O.js → cost-V3ZZ5PC3.js} +4 -4
  142. package/dist/chunks/{crash-report-WMCP5IA4.js → crash-report-JMOZ5QU5.js} +8 -8
  143. package/dist/chunks/{dist-K5Z6YPNW.js → dist-27XA44IS.js} +2 -2
  144. package/dist/chunks/{dist-NESMLP2I.js → dist-AIJ7UHX2.js} +14 -2
  145. package/dist/chunks/{dist-O526SRCF.js → dist-BSXJR54N.js} +2 -2
  146. package/dist/chunks/{dist-AYALCT3C.js → dist-EIWG5YKW.js} +2 -2
  147. package/dist/chunks/{dist-WQB34UXN.js → dist-G6SC7KFR.js} +2 -2
  148. package/dist/chunks/{dist-HOZJYOTI.js → dist-GZZLQHI2.js} +2 -2
  149. package/dist/chunks/{dist-ZJ6G2XMS.js → dist-MUFRASQN.js} +2 -2
  150. package/dist/chunks/{dist-NVATKUF3.js → dist-TS3C3WUE.js} +2 -2
  151. package/dist/chunks/doctor-SBCHAB7Y.js +77 -0
  152. package/dist/chunks/{drain-C3ZPDAX2.js → drain-B52VN6MW.js} +9 -9
  153. package/dist/chunks/{entry-IJAMOWTT.js → entry-P4XY3I3X.js} +6 -6
  154. package/dist/chunks/{eval-IF7P6OYF.js → eval-AR2LYGYX.js} +11 -10
  155. package/dist/chunks/eval-AR2LYGYX.js.map +6 -0
  156. package/dist/chunks/{exec-Z3HA2KFB.js → exec-5KC3ZHCI.js} +69 -66
  157. package/dist/chunks/exec-5KC3ZHCI.js.map +6 -0
  158. package/dist/chunks/{github-FQAXV2KP.js → github-MGIA7MTZ.js} +4 -4
  159. package/dist/chunks/{home-A2HSOG27.js → home-NVZ66WIV.js} +3 -3
  160. package/dist/chunks/{host-I3PPCCQ3.js → host-VWE5ZCKS.js} +12 -12
  161. package/dist/chunks/{host-queries-6JUQR5OK.js → host-queries-UHWFAWSF.js} +15 -15
  162. package/dist/chunks/{learn-T7HNXBBZ.js → learn-MAMS2KYE.js} +11 -11
  163. package/dist/chunks/{learn-builtin-TWYQP7WB.js → learn-builtin-43ORMKQ6.js} +14 -14
  164. package/dist/chunks/{lifecycle-KH3KX7HU.js → lifecycle-E6Q25NRN.js} +31 -31
  165. package/dist/chunks/{list-HQDI3H4N.js → list-A6ANPXZD.js} +14 -13
  166. package/dist/chunks/list-A6ANPXZD.js.map +6 -0
  167. package/dist/chunks/live-DOFBAOIW.js +75 -0
  168. package/dist/chunks/{login-C2QJP446.js → login-ESRSKSQT.js} +12 -13
  169. package/dist/chunks/{logs-QDXZ6HMD.js → logs-QC7HXNVC.js} +4 -4
  170. package/dist/chunks/{mcp-CFQMYILA.js → mcp-MT7GCZF4.js} +27 -27
  171. package/dist/chunks/{message-command-NVYMXCYY.js → message-command-4QGVKDZX.js} +49 -47
  172. package/dist/chunks/message-command-4QGVKDZX.js.map +6 -0
  173. package/dist/chunks/{open-USUNNL3C.js → open-WQIOCAFI.js} +8 -8
  174. package/dist/chunks/{operator-tools-B5EKAIEU.js → operator-tools-FUYYWLBF.js} +13 -13
  175. package/dist/chunks/{output-schema-4JBWQTYX.js → output-schema-DLSVAU3E.js} +3 -3
  176. package/dist/chunks/{pal-DG7MJFME.js → pal-CH6K6AOY.js} +15 -16
  177. package/dist/chunks/pal-CH6K6AOY.js.map +6 -0
  178. package/dist/chunks/{peers-U4NWN44W.js → peers-422VQ3JB.js} +6 -6
  179. package/dist/chunks/{peers-4JWFI3OJ.js → peers-ACIYPSC6.js} +14 -14
  180. package/dist/chunks/{plugin-MGHRREZ7.js → plugin-EBAMCU6V.js} +15 -15
  181. package/dist/chunks/{providers-QFMAPZK7.js → providers-K6MMZPHW.js} +13 -15
  182. package/dist/chunks/{pty-YX7E7UJ6.js → pty-C6X53LZE.js} +3 -3
  183. package/dist/chunks/resume-EDZPKE73.js +23 -0
  184. package/dist/chunks/{resume-command-I7SNRBQE.js → resume-command-3KEUH3AR.js} +5 -5
  185. package/dist/chunks/running-2TVNHNEA.js +20 -0
  186. package/dist/chunks/{schedule-K3UQBEGV.js → schedule-RXJBIGS4.js} +10 -9
  187. package/dist/chunks/schedule-RXJBIGS4.js.map +6 -0
  188. package/dist/chunks/{send-II2KFKIK.js → send-5KYKCNQT.js} +17 -17
  189. package/dist/chunks/{send-person-74VABPSV.js → send-person-HM736POR.js} +14 -14
  190. package/dist/chunks/{service-FSAD7FQU.js → service-LLMVVVCA.js} +33 -33
  191. package/dist/chunks/{skills-YVKRYB7M.js → skills-7DYMUJUD.js} +14 -14
  192. package/dist/chunks/{start-check-DNDHNVSL.js → start-check-PIE4GVSL.js} +2 -2
  193. package/dist/chunks/{startup-failure-SAPN77LY.js → startup-failure-IKD5HE4L.js} +2 -2
  194. package/dist/chunks/{state-JUVAH65X.js → state-WI33ZG7L.js} +5 -5
  195. package/dist/chunks/{store-CQOALIPR.js → store-6MGC7SW4.js} +10 -10
  196. package/dist/chunks/{store-LX7F4E5A.js → store-MW7VWRCZ.js} +3 -3
  197. package/dist/chunks/{store-RS7ZLTDT.js → store-TVYOLQXK.js} +4 -4
  198. package/dist/chunks/{store-EOOW5RU2.js → store-Y6NIDPNM.js} +6 -6
  199. package/dist/chunks/store-Y6NIDPNM.js.map +6 -0
  200. package/dist/chunks/{tui-RZZ2G3WI.js → tui-4TUZASW4.js} +106 -93
  201. package/dist/chunks/tui-4TUZASW4.js.map +6 -0
  202. package/dist/chunks/{upgrade-T47RYB3K.js → upgrade-YA5X3E2X.js} +33 -18
  203. package/dist/chunks/upgrade-YA5X3E2X.js.map +6 -0
  204. package/dist/chunks/{watch-BBF3CLMM.js → watch-AAYQFYRQ.js} +90 -85
  205. package/dist/chunks/watch-AAYQFYRQ.js.map +6 -0
  206. package/dist/chunks/{workspaces-3F2DSKWC.js → workspaces-34E5ZLP7.js} +23 -23
  207. package/dist/chunks/{worktree-HPE4E4UF.js → worktree-FYTSQWTW.js} +15 -15
  208. package/dist/cli.d.ts.map +1 -1
  209. package/dist/commands/upgrade.d.ts +5 -0
  210. package/dist/commands/upgrade.d.ts.map +1 -1
  211. package/dist/config/hook-layers.d.ts +54 -0
  212. package/dist/config/hook-layers.d.ts.map +1 -0
  213. package/dist/config/load.d.ts.map +1 -1
  214. package/dist/config/schema.d.ts +16 -0
  215. package/dist/config/schema.d.ts.map +1 -1
  216. package/dist/config/settings-descriptors.d.ts.map +1 -1
  217. package/dist/doctor/checks/hooks.d.ts +16 -0
  218. package/dist/doctor/checks/hooks.d.ts.map +1 -0
  219. package/dist/doctor/live.d.ts.map +1 -1
  220. package/dist/index.js +49 -27
  221. package/dist/integrations/auto-update/apply-at-exit.d.ts +41 -0
  222. package/dist/integrations/auto-update/apply-at-exit.d.ts.map +1 -0
  223. package/dist/integrations/auto-update/apply.d.ts +7 -12
  224. package/dist/integrations/auto-update/apply.d.ts.map +1 -1
  225. package/dist/integrations/auto-update/current-install.d.ts +8 -0
  226. package/dist/integrations/auto-update/current-install.d.ts.map +1 -0
  227. package/dist/integrations/auto-update/deferred-apply.d.ts +25 -0
  228. package/dist/integrations/auto-update/deferred-apply.d.ts.map +1 -0
  229. package/dist/integrations/auto-update/replaced-install.d.ts +32 -0
  230. package/dist/integrations/auto-update/replaced-install.d.ts.map +1 -0
  231. package/dist/integrations/auto-update/running.d.ts +43 -0
  232. package/dist/integrations/auto-update/running.d.ts.map +1 -0
  233. package/dist/integrations/auto-update/shared-state.d.ts +15 -0
  234. package/dist/integrations/auto-update/shared-state.d.ts.map +1 -0
  235. package/dist/integrations/auto-update/start.d.ts +2 -6
  236. package/dist/integrations/auto-update/start.d.ts.map +1 -1
  237. package/dist/integrations/auto-update/updater.d.ts +15 -0
  238. package/dist/integrations/auto-update/updater.d.ts.map +1 -1
  239. package/dist/integrations/plugins/hook-path-filter.d.ts +16 -0
  240. package/dist/integrations/plugins/hook-path-filter.d.ts.map +1 -0
  241. package/dist/integrations/plugins/runtime.d.ts +28 -0
  242. package/dist/integrations/plugins/runtime.d.ts.map +1 -1
  243. package/dist/integrations/trust/folder-grants.d.ts +11 -1
  244. package/dist/integrations/trust/folder-grants.d.ts.map +1 -1
  245. package/dist/permissions/path-rules.d.ts +2 -0
  246. package/dist/permissions/path-rules.d.ts.map +1 -1
  247. package/dist/termination-state.d.ts +8 -2
  248. package/dist/termination-state.d.ts.map +1 -1
  249. package/dist/termination.d.ts +5 -0
  250. package/dist/termination.d.ts.map +1 -1
  251. package/dist/tui/App.d.ts.map +1 -1
  252. package/dist/tui/TrustPrompt.d.ts.map +1 -1
  253. package/dist/tui/agent.d.ts +18 -2
  254. package/dist/tui/agent.d.ts.map +1 -1
  255. package/dist/tui/log-pane.d.ts.map +1 -1
  256. package/dist/tui/plain-failure.d.ts.map +1 -1
  257. package/dist/tui/slashCommands.d.ts +20 -1
  258. package/dist/tui/slashCommands.d.ts.map +1 -1
  259. package/dist/tui/types.d.ts +3 -0
  260. package/dist/tui/types.d.ts.map +1 -1
  261. package/dist/tui/update-notice.d.ts.map +1 -1
  262. package/package.json +3 -3
  263. package/dist/chunks/agent-session-75E7MVCD.js +0 -71
  264. package/dist/chunks/bin-main-7SUJ2P6D.js.map +0 -6
  265. package/dist/chunks/chunk-4AF3VDBG.js.map +0 -6
  266. package/dist/chunks/chunk-5CP365QA.js.map +0 -6
  267. package/dist/chunks/chunk-B5AIMVRI.js.map +0 -6
  268. package/dist/chunks/chunk-DFM3INZ3.js.map +0 -6
  269. package/dist/chunks/chunk-G4M6NKL6.js.map +0 -6
  270. package/dist/chunks/chunk-IIOWVRGQ.js.map +0 -6
  271. package/dist/chunks/chunk-KQEX2PNL.js.map +0 -6
  272. package/dist/chunks/chunk-MPAS3ZKW.js.map +0 -6
  273. package/dist/chunks/chunk-OH6TB27S.js +0 -111
  274. package/dist/chunks/chunk-OH6TB27S.js.map +0 -6
  275. package/dist/chunks/chunk-ONCQ3NZ6.js.map +0 -6
  276. package/dist/chunks/chunk-OP4VBHY7.js.map +0 -6
  277. package/dist/chunks/chunk-PBEK6MTE.js.map +0 -6
  278. package/dist/chunks/chunk-R66H2G5R.js.map +0 -6
  279. package/dist/chunks/chunk-RSJVDB4N.js.map +0 -6
  280. package/dist/chunks/chunk-WFKHAW6M.js +0 -153
  281. package/dist/chunks/chunk-WFKHAW6M.js.map +0 -6
  282. package/dist/chunks/chunk-WVS354PX.js.map +0 -6
  283. package/dist/chunks/cli-runtime-OJB72C6H.js.map +0 -6
  284. package/dist/chunks/doctor-RBLQ7HI2.js +0 -41
  285. package/dist/chunks/eval-IF7P6OYF.js.map +0 -6
  286. package/dist/chunks/exec-Z3HA2KFB.js.map +0 -6
  287. package/dist/chunks/list-HQDI3H4N.js.map +0 -6
  288. package/dist/chunks/live-3MEPPMUV.js +0 -39
  289. package/dist/chunks/message-command-NVYMXCYY.js.map +0 -6
  290. package/dist/chunks/pal-DG7MJFME.js.map +0 -6
  291. package/dist/chunks/resume-DHAMPNCN.js +0 -23
  292. package/dist/chunks/schedule-K3UQBEGV.js.map +0 -6
  293. package/dist/chunks/tui-RZZ2G3WI.js.map +0 -6
  294. package/dist/chunks/upgrade-T47RYB3K.js.map +0 -6
  295. package/dist/chunks/watch-BBF3CLMM.js.map +0 -6
  296. /package/dist/chunks/{activity-command-4IUJ2CE4.js.map → activity-command-DRY4O6C7.js.map} +0 -0
  297. /package/dist/chunks/{add-FT7HDU36.js.map → add-RQBESQ6Z.js.map} +0 -0
  298. /package/dist/chunks/{agent-EHNABCBA.js.map → agent-GLF7GLPC.js.map} +0 -0
  299. /package/dist/chunks/{agent-session-75E7MVCD.js.map → agent-session-EY2MHANW.js.map} +0 -0
  300. /package/dist/chunks/{archive-5JVH6NLF.js.map → archive-XU3MKNSL.js.map} +0 -0
  301. /package/dist/chunks/{binding-S6NFVWG5.js.map → binding-OONLIEMY.js.map} +0 -0
  302. /package/dist/chunks/{browser-5GSFFOI3.js.map → browser-XWMMPWJ4.js.map} +0 -0
  303. /package/dist/chunks/{chat-HROABWUI.js.map → chat-4RCY7GY7.js.map} +0 -0
  304. /package/dist/chunks/{chunk-AOMD2UUT.js.map → chunk-2WW5X746.js.map} +0 -0
  305. /package/dist/chunks/{chunk-5BPI6U3L.js.map → chunk-3NFDOR4V.js.map} +0 -0
  306. /package/dist/chunks/{chunk-5FZDDFXS.js.map → chunk-3ZHOM2L7.js.map} +0 -0
  307. /package/dist/chunks/{chunk-YLSDJOE6.js.map → chunk-5475JD4J.js.map} +0 -0
  308. /package/dist/chunks/{chunk-RLGFYOUI.js.map → chunk-6IMEYAUA.js.map} +0 -0
  309. /package/dist/chunks/{chunk-DAJHQNAH.js.map → chunk-7OUUT33C.js.map} +0 -0
  310. /package/dist/chunks/{chunk-ZM7SGAOM.js.map → chunk-7VPJL3ND.js.map} +0 -0
  311. /package/dist/chunks/{chunk-TOGEJIC5.js.map → chunk-A4VNFRRT.js.map} +0 -0
  312. /package/dist/chunks/{chunk-4U245XO5.js.map → chunk-C2LZ4PQL.js.map} +0 -0
  313. /package/dist/chunks/{chunk-2KMRCXGA.js.map → chunk-C2OXXOZH.js.map} +0 -0
  314. /package/dist/chunks/{chunk-SZOC2LYR.js.map → chunk-CNYVQMBP.js.map} +0 -0
  315. /package/dist/chunks/{chunk-QISKJ5SO.js.map → chunk-CPVM2HQE.js.map} +0 -0
  316. /package/dist/chunks/{chunk-CZHAME47.js.map → chunk-D4JAC2TS.js.map} +0 -0
  317. /package/dist/chunks/{chunk-QNS2KLVT.js.map → chunk-DL3O5QZQ.js.map} +0 -0
  318. /package/dist/chunks/{chunk-USJJDXQK.js.map → chunk-EKYINJHR.js.map} +0 -0
  319. /package/dist/chunks/{chunk-YEMHAEO5.js.map → chunk-ET7QIC7S.js.map} +0 -0
  320. /package/dist/chunks/{chunk-HSEIISLI.js.map → chunk-FKSBLMS6.js.map} +0 -0
  321. /package/dist/chunks/{chunk-MLYGIG7M.js.map → chunk-FPX2KIKV.js.map} +0 -0
  322. /package/dist/chunks/{chunk-FSVH5R5J.js.map → chunk-FYWBIH72.js.map} +0 -0
  323. /package/dist/chunks/{chunk-IGO3W6WL.js.map → chunk-GCE2OOL7.js.map} +0 -0
  324. /package/dist/chunks/{chunk-IJEESVK5.js.map → chunk-GD57FLJ6.js.map} +0 -0
  325. /package/dist/chunks/{chunk-4BEZSMMK.js.map → chunk-GDC23ATL.js.map} +0 -0
  326. /package/dist/chunks/{chunk-2MLY3HJM.js.map → chunk-GQHWZGAE.js.map} +0 -0
  327. /package/dist/chunks/{chunk-ZC7ZL42B.js.map → chunk-GZ44UQZS.js.map} +0 -0
  328. /package/dist/chunks/{chunk-M5NDHHMG.js.map → chunk-HI7YADBV.js.map} +0 -0
  329. /package/dist/chunks/{chunk-KQYWFHRH.js.map → chunk-HNRKSWL3.js.map} +0 -0
  330. /package/dist/chunks/{chunk-77D2J3GS.js.map → chunk-HQPVETKK.js.map} +0 -0
  331. /package/dist/chunks/{chunk-ZR3FTR77.js.map → chunk-HUVJFACV.js.map} +0 -0
  332. /package/dist/chunks/{chunk-H47LSNSP.js.map → chunk-IDEENHCZ.js.map} +0 -0
  333. /package/dist/chunks/{chunk-KROVFC6L.js.map → chunk-IICA4Y2H.js.map} +0 -0
  334. /package/dist/chunks/{chunk-3TINX26N.js.map → chunk-JJRAQRIM.js.map} +0 -0
  335. /package/dist/chunks/{chunk-PXIVFM3R.js.map → chunk-JRGYUTXM.js.map} +0 -0
  336. /package/dist/chunks/{chunk-W2IBHK6I.js.map → chunk-JUCOHYKO.js.map} +0 -0
  337. /package/dist/chunks/{chunk-7COFRJAP.js.map → chunk-KOAA7NOL.js.map} +0 -0
  338. /package/dist/chunks/{chunk-2WRNHAVP.js.map → chunk-LMTAEZBP.js.map} +0 -0
  339. /package/dist/chunks/{chunk-SSYBTI26.js.map → chunk-LOURGMN3.js.map} +0 -0
  340. /package/dist/chunks/{chunk-LWNTLOML.js.map → chunk-LP5SU76P.js.map} +0 -0
  341. /package/dist/chunks/{chunk-KCRZA2E3.js.map → chunk-LVVLXBRD.js.map} +0 -0
  342. /package/dist/chunks/{chunk-4GIWPKXI.js.map → chunk-M5CYA52R.js.map} +0 -0
  343. /package/dist/chunks/{chunk-DC67SNZK.js.map → chunk-NJBOI7VM.js.map} +0 -0
  344. /package/dist/chunks/{chunk-TL6X6MAW.js.map → chunk-NUY3X4CY.js.map} +0 -0
  345. /package/dist/chunks/{chunk-FENQC4LO.js.map → chunk-O4J3UD4C.js.map} +0 -0
  346. /package/dist/chunks/{chunk-MNQDNDGD.js.map → chunk-OCRCL6ZJ.js.map} +0 -0
  347. /package/dist/chunks/{chunk-N4B5NJTM.js.map → chunk-OCUUCP4P.js.map} +0 -0
  348. /package/dist/chunks/{chunk-UZLAIMHO.js.map → chunk-PA7WI43E.js.map} +0 -0
  349. /package/dist/chunks/{chunk-LAR6KRME.js.map → chunk-QIMXI2SN.js.map} +0 -0
  350. /package/dist/chunks/{chunk-XC2RVHA4.js.map → chunk-RJSYFGYO.js.map} +0 -0
  351. /package/dist/chunks/{chunk-3PDX3NC2.js.map → chunk-RYVQYNRB.js.map} +0 -0
  352. /package/dist/chunks/{chunk-BGODFPA6.js.map → chunk-SOUYLINA.js.map} +0 -0
  353. /package/dist/chunks/{chunk-BFAMP45Q.js.map → chunk-SW6TWRX3.js.map} +0 -0
  354. /package/dist/chunks/{chunk-UVYM67LE.js.map → chunk-TGYT53PO.js.map} +0 -0
  355. /package/dist/chunks/{chunk-LXLM4OQO.js.map → chunk-TRFQXPTZ.js.map} +0 -0
  356. /package/dist/chunks/{chunk-JCXJ3QSC.js.map → chunk-UCISROX2.js.map} +0 -0
  357. /package/dist/chunks/{chunk-A4KQCS3B.js.map → chunk-UHKIQA3I.js.map} +0 -0
  358. /package/dist/chunks/{chunk-LKHMBU72.js.map → chunk-USHPWAWT.js.map} +0 -0
  359. /package/dist/chunks/{chunk-JPQNCR67.js.map → chunk-UZIVRYFX.js.map} +0 -0
  360. /package/dist/chunks/{chunk-UZ6GL6GO.js.map → chunk-VCMY2BUN.js.map} +0 -0
  361. /package/dist/chunks/{chunk-P4SMB7ZH.js.map → chunk-VEMMS6US.js.map} +0 -0
  362. /package/dist/chunks/{chunk-P2DX5J2F.js.map → chunk-VH75W4CX.js.map} +0 -0
  363. /package/dist/chunks/{chunk-BGPJ7MSM.js.map → chunk-VJ7ZCZQ4.js.map} +0 -0
  364. /package/dist/chunks/{chunk-BZVF3B6D.js.map → chunk-VL6N5AEF.js.map} +0 -0
  365. /package/dist/chunks/{chunk-BLSCBY2C.js.map → chunk-VRORRHPK.js.map} +0 -0
  366. /package/dist/chunks/{chunk-J7IH3JCJ.js.map → chunk-WDCBWZ6V.js.map} +0 -0
  367. /package/dist/chunks/{chunk-SO322MOO.js.map → chunk-WDFOZDWA.js.map} +0 -0
  368. /package/dist/chunks/{chunk-2FRFMWVI.js.map → chunk-WLVE7H7P.js.map} +0 -0
  369. /package/dist/chunks/{chunk-GDHAOY4Y.js.map → chunk-WNBDXO6I.js.map} +0 -0
  370. /package/dist/chunks/{chunk-H2SUL7EJ.js.map → chunk-XKUDYXPE.js.map} +0 -0
  371. /package/dist/chunks/{chunk-V7IK6MHO.js.map → chunk-XO4RLPIW.js.map} +0 -0
  372. /package/dist/chunks/{chunk-7QIJT537.js.map → chunk-YYSSVDZ3.js.map} +0 -0
  373. /package/dist/chunks/{chunk-YWLMSOOM.js.map → chunk-Z6L2JR73.js.map} +0 -0
  374. /package/dist/chunks/{chunk-4ACKQXK5.js.map → chunk-ZHVKBXFG.js.map} +0 -0
  375. /package/dist/chunks/{chunk-2MHTEUWP.js.map → chunk-ZXXBQLSF.js.map} +0 -0
  376. /package/dist/chunks/{commands-5MHVFUYY.js.map → commands-DKOXQYR7.js.map} +0 -0
  377. /package/dist/chunks/{cost-XLXGPE4O.js.map → cost-V3ZZ5PC3.js.map} +0 -0
  378. /package/dist/chunks/{crash-report-WMCP5IA4.js.map → crash-report-JMOZ5QU5.js.map} +0 -0
  379. /package/dist/chunks/{dist-K5Z6YPNW.js.map → dist-27XA44IS.js.map} +0 -0
  380. /package/dist/chunks/{dist-NESMLP2I.js.map → dist-AIJ7UHX2.js.map} +0 -0
  381. /package/dist/chunks/{dist-O526SRCF.js.map → dist-BSXJR54N.js.map} +0 -0
  382. /package/dist/chunks/{dist-AYALCT3C.js.map → dist-EIWG5YKW.js.map} +0 -0
  383. /package/dist/chunks/{dist-WQB34UXN.js.map → dist-G6SC7KFR.js.map} +0 -0
  384. /package/dist/chunks/{dist-HOZJYOTI.js.map → dist-GZZLQHI2.js.map} +0 -0
  385. /package/dist/chunks/{dist-ZJ6G2XMS.js.map → dist-MUFRASQN.js.map} +0 -0
  386. /package/dist/chunks/{dist-NVATKUF3.js.map → dist-TS3C3WUE.js.map} +0 -0
  387. /package/dist/chunks/{doctor-RBLQ7HI2.js.map → doctor-SBCHAB7Y.js.map} +0 -0
  388. /package/dist/chunks/{drain-C3ZPDAX2.js.map → drain-B52VN6MW.js.map} +0 -0
  389. /package/dist/chunks/{entry-IJAMOWTT.js.map → entry-P4XY3I3X.js.map} +0 -0
  390. /package/dist/chunks/{github-FQAXV2KP.js.map → github-MGIA7MTZ.js.map} +0 -0
  391. /package/dist/chunks/{home-A2HSOG27.js.map → home-NVZ66WIV.js.map} +0 -0
  392. /package/dist/chunks/{host-I3PPCCQ3.js.map → host-VWE5ZCKS.js.map} +0 -0
  393. /package/dist/chunks/{host-queries-6JUQR5OK.js.map → host-queries-UHWFAWSF.js.map} +0 -0
  394. /package/dist/chunks/{learn-T7HNXBBZ.js.map → learn-MAMS2KYE.js.map} +0 -0
  395. /package/dist/chunks/{learn-builtin-TWYQP7WB.js.map → learn-builtin-43ORMKQ6.js.map} +0 -0
  396. /package/dist/chunks/{lifecycle-KH3KX7HU.js.map → lifecycle-E6Q25NRN.js.map} +0 -0
  397. /package/dist/chunks/{live-3MEPPMUV.js.map → live-DOFBAOIW.js.map} +0 -0
  398. /package/dist/chunks/{login-C2QJP446.js.map → login-ESRSKSQT.js.map} +0 -0
  399. /package/dist/chunks/{logs-QDXZ6HMD.js.map → logs-QC7HXNVC.js.map} +0 -0
  400. /package/dist/chunks/{mcp-CFQMYILA.js.map → mcp-MT7GCZF4.js.map} +0 -0
  401. /package/dist/chunks/{open-USUNNL3C.js.map → open-WQIOCAFI.js.map} +0 -0
  402. /package/dist/chunks/{operator-tools-B5EKAIEU.js.map → operator-tools-FUYYWLBF.js.map} +0 -0
  403. /package/dist/chunks/{output-schema-4JBWQTYX.js.map → output-schema-DLSVAU3E.js.map} +0 -0
  404. /package/dist/chunks/{peers-U4NWN44W.js.map → peers-422VQ3JB.js.map} +0 -0
  405. /package/dist/chunks/{peers-4JWFI3OJ.js.map → peers-ACIYPSC6.js.map} +0 -0
  406. /package/dist/chunks/{plugin-MGHRREZ7.js.map → plugin-EBAMCU6V.js.map} +0 -0
  407. /package/dist/chunks/{providers-QFMAPZK7.js.map → providers-K6MMZPHW.js.map} +0 -0
  408. /package/dist/chunks/{pty-YX7E7UJ6.js.map → pty-C6X53LZE.js.map} +0 -0
  409. /package/dist/chunks/{resume-DHAMPNCN.js.map → resume-EDZPKE73.js.map} +0 -0
  410. /package/dist/chunks/{resume-command-I7SNRBQE.js.map → resume-command-3KEUH3AR.js.map} +0 -0
  411. /package/dist/chunks/{send-II2KFKIK.js.map → running-2TVNHNEA.js.map} +0 -0
  412. /package/dist/chunks/{send-person-74VABPSV.js.map → send-5KYKCNQT.js.map} +0 -0
  413. /package/dist/chunks/{start-check-DNDHNVSL.js.map → send-person-HM736POR.js.map} +0 -0
  414. /package/dist/chunks/{service-FSAD7FQU.js.map → service-LLMVVVCA.js.map} +0 -0
  415. /package/dist/chunks/{skills-YVKRYB7M.js.map → skills-7DYMUJUD.js.map} +0 -0
  416. /package/dist/chunks/{store-CQOALIPR.js.map → start-check-PIE4GVSL.js.map} +0 -0
  417. /package/dist/chunks/{startup-failure-SAPN77LY.js.map → startup-failure-IKD5HE4L.js.map} +0 -0
  418. /package/dist/chunks/{state-JUVAH65X.js.map → state-WI33ZG7L.js.map} +0 -0
  419. /package/dist/chunks/{store-EOOW5RU2.js.map → store-6MGC7SW4.js.map} +0 -0
  420. /package/dist/chunks/{store-LX7F4E5A.js.map → store-MW7VWRCZ.js.map} +0 -0
  421. /package/dist/chunks/{store-RS7ZLTDT.js.map → store-TVYOLQXK.js.map} +0 -0
  422. /package/dist/chunks/{workspaces-3F2DSKWC.js.map → workspaces-34E5ZLP7.js.map} +0 -0
  423. /package/dist/chunks/{worktree-HPE4E4UF.js.map → worktree-FYTSQWTW.js.map} +0 -0
@@ -2,160 +2,24 @@ import { createRequire as __namzuCreateRequire } from 'node:module';
2
2
  const require = __namzuCreateRequire(import.meta.url);
3
3
  import {
4
4
  START_CHECK_FLAG
5
- } from "./chunk-USJJDXQK.js";
5
+ } from "./chunk-EKYINJHR.js";
6
+ import {
7
+ LOCK_STALE_MS,
8
+ acquireUpdateLock,
9
+ clearInProgress,
10
+ previousDir,
11
+ processIsRunning,
12
+ pruneOlderPrevious,
13
+ readInProgress,
14
+ scopeOf,
15
+ sharedStateHome,
16
+ updatesDir,
17
+ writeInProgress
18
+ } from "./chunk-3PZVYS7P.js";
6
19
  import {
7
20
  __name
8
21
  } from "./chunk-76FLAFCG.js";
9
22
 
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
23
  // src/integrations/updates.ts
160
24
  var NPM_TIMEOUT_MS = 2500;
161
25
  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-]+)*)?$/;
@@ -248,8 +112,8 @@ __name(fetchNamzuRelease, "fetchNamzuRelease");
248
112
 
249
113
  // src/integrations/auto-update/download.ts
250
114
  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";
115
+ import { createWriteStream, mkdirSync, renameSync, rmSync } from "node:fs";
116
+ import { dirname } from "node:path";
253
117
  import { Readable, Transform } from "node:stream";
254
118
  import { pipeline } from "node:stream/promises";
255
119
  var DownloadError = class extends Error {
@@ -293,7 +157,7 @@ async function downloadVerifiedTarball(options) {
293
157
  options.timeoutMs ?? DEFAULT_TIMEOUT_MS
294
158
  );
295
159
  try {
296
- mkdirSync2(dirname3(options.destination), { recursive: true });
160
+ mkdirSync(dirname(options.destination), { recursive: true });
297
161
  let response;
298
162
  try {
299
163
  response = await (options.fetch ?? fetch)(options.url, { signal: controller.signal });
@@ -344,232 +208,18 @@ async function downloadVerifiedTarball(options) {
344
208
  }
345
209
  __name(downloadVerifiedTarball, "downloadVerifiedTarball");
346
210
 
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
211
  // src/integrations/auto-update/apply.ts
554
212
  import { execFile } from "node:child_process";
555
- import { existsSync as existsSync3, readFileSync as readFileSync3, readdirSync as readdirSync2, rmSync as rmSync3 } from "node:fs";
213
+ import { existsSync, readFileSync, readdirSync, rmSync as rmSync2 } from "node:fs";
556
214
  import { cp, mkdir, rename, rm } from "node:fs/promises";
557
- import { isAbsolute, join as join4, relative, resolve } from "node:path";
215
+ import { isAbsolute, join, relative, resolve } from "node:path";
558
216
  function activeRoot(install) {
559
- return install.kind === "pnpm-global" ? join4(install.globalDir, "node_modules", "@namzu", "cli") : install.root;
217
+ return install.kind === "pnpm-global" ? join(install.globalDir, "node_modules", "@namzu", "cli") : install.root;
560
218
  }
561
219
  __name(activeRoot, "activeRoot");
562
- function scopeOf(install, platform = process.platform) {
563
- return installScope(install.kind === "pnpm-global" ? install.globalDir : install.prefix, platform);
564
- }
565
- __name(scopeOf, "scopeOf");
566
- function sharedStateHome(install) {
567
- return join4(install.kind === "pnpm-global" ? install.globalDir : install.prefix, ".namzu-update");
568
- }
569
- __name(sharedStateHome, "sharedStateHome");
570
220
  var PUBLIC_REGISTRY2 = "https://registry.npmjs.org";
571
221
  function tarballPath(home, scope, version) {
572
- return join4(updatesDir(home), "download", `namzu-cli-${version}-${scope}.tgz`);
222
+ return join(updatesDir(home), "download", `namzu-cli-${version}-${scope}.tgz`);
573
223
  }
574
224
  __name(tarballPath, "tarballPath");
575
225
  function npmInstallArgs(prefix, version, registry = PUBLIC_REGISTRY2, tarball) {
@@ -632,11 +282,11 @@ function pnpmRunner(deps, cwd, logFile, onSpawn) {
632
282
  }
633
283
  __name(pnpmRunner, "pnpmRunner");
634
284
  function pruneStaleDownloads(home, scope, keep) {
635
- const dir = join4(updatesDir(home), "download");
285
+ const dir = join(updatesDir(home), "download");
636
286
  try {
637
- for (const name of readdirSync2(dir)) {
638
- if (name.endsWith(`-${scope}.tgz`) && join4(dir, name) !== keep)
639
- rmSync3(join4(dir, name), { force: true });
287
+ for (const name of readdirSync(dir)) {
288
+ if (name.endsWith(`-${scope}.tgz`) && join(dir, name) !== keep)
289
+ rmSync2(join(dir, name), { force: true });
640
290
  }
641
291
  } catch {
642
292
  }
@@ -695,7 +345,7 @@ __name(describeFailure, "describeFailure");
695
345
  async function backupPackage(root, home, version, scope) {
696
346
  const target = previousDir(home, version, scope);
697
347
  await rm(target, { recursive: true, force: true });
698
- await mkdir(join4(target, ".."), { recursive: true });
348
+ await mkdir(join(target, ".."), { recursive: true });
699
349
  await cp(root, target, { recursive: true, verbatimSymlinks: true });
700
350
  return target;
701
351
  }
@@ -707,7 +357,7 @@ async function restorePackage(root, backup, pid = process.pid) {
707
357
  await rm(aside, { recursive: true, force: true });
708
358
  try {
709
359
  await cp(backup, fresh, { recursive: true, verbatimSymlinks: true });
710
- const hadRoot = existsSync3(root);
360
+ const hadRoot = existsSync(root);
711
361
  if (hadRoot) await rename(root, aside);
712
362
  try {
713
363
  await rename(fresh, root);
@@ -722,11 +372,11 @@ async function restorePackage(root, backup, pid = process.pid) {
722
372
  }
723
373
  __name(restorePackage, "restorePackage");
724
374
  async function smokeTestInstalled(root, version, depth = "session") {
725
- let entry = join4(root, "dist", "bin.js");
375
+ let entry = join(root, "dist", "bin.js");
726
376
  try {
727
- const pkg = JSON.parse(readFileSync3(join4(root, "package.json"), "utf8"));
377
+ const pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
728
378
  const bin = typeof pkg.bin === "string" ? pkg.bin : pkg.bin?.namzu;
729
- if (bin) entry = join4(root, bin);
379
+ if (bin) entry = join(root, bin);
730
380
  } catch {
731
381
  return false;
732
382
  }
@@ -791,7 +441,7 @@ function fail(code, restored, log) {
791
441
  }
792
442
  __name(fail, "fail");
793
443
  function installLogPath(home, scope, name = "install") {
794
- return join4(updatesDir(home), `${name}-${scope}.log`);
444
+ return join(updatesDir(home), `${name}-${scope}.log`);
795
445
  }
796
446
  __name(installLogPath, "installLogPath");
797
447
  async function applyLocked(deps, release, onDisk) {
@@ -804,7 +454,7 @@ async function applyLocked(deps, release, onDisk) {
804
454
  await (deps.fetchTarball ?? fetchFromRegistry(registry))(release, tarball);
805
455
  } catch (error) {
806
456
  try {
807
- rmSync3(tarball, { force: true });
457
+ rmSync2(tarball, { force: true });
808
458
  } catch {
809
459
  }
810
460
  const code = error instanceof DownloadError ? error.code : "network";
@@ -813,7 +463,7 @@ async function applyLocked(deps, release, onDisk) {
813
463
  try {
814
464
  return await installFromTarball(deps, release, onDisk, tarball, scope, logFile);
815
465
  } finally {
816
- rmSync3(tarball, { force: true });
466
+ rmSync2(tarball, { force: true });
817
467
  }
818
468
  }
819
469
  __name(applyLocked, "applyLocked");
@@ -838,6 +488,7 @@ async function installFromTarball(deps, release, onDisk, tarball, scope, logFile
838
488
  let backup;
839
489
  const pid = deps.pid ?? process.pid;
840
490
  const at = (deps.now ?? Date.now)();
491
+ if (deps.mayProceed && !deps.mayProceed()) return { status: "locked" };
841
492
  try {
842
493
  writeInProgress(shared, { pid, to: release.version, from: onDisk, at }, scope);
843
494
  if (install.kind === "npm-global") {
@@ -848,6 +499,10 @@ async function installFromTarball(deps, release, onDisk, tarball, scope, logFile
848
499
  clearInProgress(shared, scope);
849
500
  return fail("backup_failed", true);
850
501
  }
502
+ if (deps.mayProceed && !deps.mayProceed()) {
503
+ clearInProgress(shared, scope);
504
+ return { status: "locked" };
505
+ }
851
506
  const restore = /* @__PURE__ */ __name(async () => {
852
507
  try {
853
508
  if (install.kind === "npm-global") {
@@ -1001,7 +656,7 @@ async function repairInterruptedUpdate(deps) {
1001
656
  }
1002
657
  let restored = false;
1003
658
  try {
1004
- if (install.kind === "npm-global" && marker.backup && isKeptCopy(shared, marker.backup) && existsSync3(marker.backup)) {
659
+ if (install.kind === "npm-global" && marker.backup && isKeptCopy(shared, marker.backup) && existsSync(marker.backup)) {
1005
660
  await restorePackage(install.root, marker.backup, own);
1006
661
  restored = deps.installedVersion(root) === marker.from;
1007
662
  } else if (install.kind === "pnpm-global") {
@@ -1028,138 +683,11 @@ function isKeptCopy(home, backup) {
1028
683
  }
1029
684
  __name(isKeptCopy, "isKeptCopy");
1030
685
 
1031
- // src/integrations/auto-update/install-kind.ts
1032
- import { constants, accessSync, existsSync as existsSync4, realpathSync } from "node:fs";
1033
- import { dirname as dirname4, join as join5, posix as posix3, win32 as win323 } from "node:path";
1034
- function writableDir(path) {
1035
- try {
1036
- accessSync(path, constants.W_OK);
1037
- return true;
1038
- } catch {
1039
- return false;
1040
- }
1041
- }
1042
- __name(writableDir, "writableDir");
1043
- function samePath(a, b, platform) {
1044
- const paths = platform === "win32" ? win323 : posix3;
1045
- const left = paths.resolve(a);
1046
- const right = paths.resolve(b);
1047
- return platform === "win32" ? left.toLowerCase() === right.toLowerCase() : left === right;
1048
- }
1049
- __name(samePath, "samePath");
1050
- var PNPM_GLOBAL_STORE = /^(.*[\\/]pnpm[\\/]global[\\/]\d+)[\\/](?:node_modules[\\/])?\.pnpm[\\/]/i;
1051
- var PNPM_GLOBAL_LINK = /^(.*[\\/]pnpm[\\/]global[\\/]\d+)[\\/]node_modules[\\/]@namzu[\\/]cli[\\/]?$/i;
1052
- function pnpmGlobalDirFor(packageRoot) {
1053
- return PNPM_GLOBAL_STORE.exec(packageRoot)?.[1] ?? PNPM_GLOBAL_LINK.exec(packageRoot)?.[1] ?? null;
1054
- }
1055
- __name(pnpmGlobalDirFor, "pnpmGlobalDirFor");
1056
- var DESKTOP_KERNEL_ROOT = /[\\/](?:resources[\\/]cli|kernel[\\/]versions[\\/][^\\/]+)[\\/]?$/i;
1057
- function classifyInstall(input) {
1058
- const exists = input.exists ?? existsSync4;
1059
- const canWrite = input.writable ?? writableDir;
1060
- const root = input.packageRoot;
1061
- const platform = input.platform;
1062
- if (input.isElectron || DESKTOP_KERNEL_ROOT.test(root)) return { kind: "desktop", root };
1063
- if (/[\\/](_npx|dlx-[^\\/]*|\.bun[\\/]install[\\/]cache|bunx-[^\\/]*)[\\/]/i.test(root)) {
1064
- return { kind: "ephemeral", root };
1065
- }
1066
- if (exists(join5(root, "src")) || exists(join5(root, "..", "..", "pnpm-workspace.yaml")) || exists(join5(root, ".git"))) {
1067
- return { kind: "development", root };
1068
- }
1069
- const pnpmDir = pnpmGlobalDirFor(root);
1070
- if (pnpmDir) {
1071
- const writable = platform !== "win32" && canWrite(pnpmDir);
1072
- return { kind: "pnpm-global", root, globalDir: pnpmDir, writable };
1073
- }
1074
- const prefix = npmGlobalPrefixFor(root, platform);
1075
- if (prefix) {
1076
- const owned = input.namzuHome !== void 0 && samePath(prefix, input.namzuHome, platform);
1077
- if (platform === "win32" && !owned && !exists(win323.join(prefix, "namzu.cmd"))) {
1078
- return { kind: "unknown", root };
1079
- }
1080
- const writable = canWrite(dirname4(root)) && canWrite(prefix);
1081
- return { kind: "npm-global", root, prefix, owned, writable };
1082
- }
1083
- return { kind: "unknown", root };
1084
- }
1085
- __name(classifyInstall, "classifyInstall");
1086
- function realRoot(path) {
1087
- try {
1088
- return realpathSync(path);
1089
- } catch {
1090
- return path;
1091
- }
1092
- }
1093
- __name(realRoot, "realRoot");
1094
-
1095
- // src/integrations/auto-update/policy.ts
1096
- var ON_WORDS = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
1097
- var OFF_WORDS = /* @__PURE__ */ new Set(["0", "false", "no", "off"]);
1098
- function readSwitch(value) {
1099
- const word = value?.trim().toLowerCase();
1100
- if (!word) return void 0;
1101
- if (ON_WORDS.has(word)) return true;
1102
- if (OFF_WORDS.has(word)) return false;
1103
- return void 0;
1104
- }
1105
- __name(readSwitch, "readSwitch");
1106
- function runsInCi(env) {
1107
- for (const name of [
1108
- "CI",
1109
- "GITHUB_ACTIONS",
1110
- "GITLAB_CI",
1111
- "BUILDKITE",
1112
- "JENKINS_URL",
1113
- "TF_BUILD"
1114
- ]) {
1115
- const value = env[name]?.trim().toLowerCase();
1116
- if (value && !OFF_WORDS.has(value)) return true;
1117
- }
1118
- return false;
1119
- }
1120
- __name(runsInCi, "runsInCi");
1121
- function parseUpdateChannel(value) {
1122
- const word = value?.trim().toLowerCase();
1123
- return word === "latest" || word === "stable" ? word : void 0;
1124
- }
1125
- __name(parseUpdateChannel, "parseUpdateChannel");
1126
- function resolveUpdatePolicy(input) {
1127
- const { config, env } = input;
1128
- const channel = parseUpdateChannel(env.NAMZU_UPDATE_CHANNEL) ?? config?.channel ?? "latest";
1129
- const check = readSwitch(env.NAMZU_UPDATE_CHECK) ?? config?.check ?? true;
1130
- if (!check) return { check: false, install: false, channel, decidedBy: "environment" };
1131
- const fromEnv = readSwitch(env.NAMZU_AUTO_UPDATE);
1132
- if (fromEnv !== void 0) {
1133
- return { check: true, install: fromEnv, channel, decidedBy: "environment" };
1134
- }
1135
- if (config?.auto !== void 0) {
1136
- return { check: true, install: config.auto, channel, decidedBy: "config" };
1137
- }
1138
- if (runsInCi(env)) return { check: true, install: false, channel, decidedBy: "ci" };
1139
- return { check: true, install: input.interactive, channel, decidedBy: "default" };
1140
- }
1141
- __name(resolveUpdatePolicy, "resolveUpdatePolicy");
1142
-
1143
686
  export {
1144
- resolveNpmInvocation,
1145
- removeOwnPowerShellShim,
1146
- npmGlobalPrefixFor,
1147
- runNpmUpgrade,
1148
687
  compareVersions,
1149
688
  fetchNamzuRelease,
1150
689
  DownloadError,
1151
- readCheck,
1152
- writeCheck,
1153
- readLastResult,
1154
- writeLastResult,
1155
- readAttempt,
1156
- writeAttempt,
1157
- installScope,
1158
- acquireUpdateLock,
1159
- writeInProgress,
1160
- clearInProgress,
1161
- pruneOlderPrevious,
1162
- scopeOf,
690
+ activeRoot,
1163
691
  PUBLIC_REGISTRY2 as PUBLIC_REGISTRY,
1164
692
  tarballPath,
1165
693
  npmInstallArgs,
@@ -1174,10 +702,6 @@ export {
1174
702
  smokeTestInstalled,
1175
703
  applyUpdate,
1176
704
  fetchFromRegistry,
1177
- repairInterruptedUpdate,
1178
- pnpmGlobalDirFor,
1179
- classifyInstall,
1180
- realRoot,
1181
- resolveUpdatePolicy
705
+ repairInterruptedUpdate
1182
706
  };
1183
- //# sourceMappingURL=chunk-4AF3VDBG.js.map
707
+ //# sourceMappingURL=chunk-O7FEZN6I.js.map