@unieai/code 0.0.10 → 0.0.12

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 (486) hide show
  1. package/README.en.md +6 -59
  2. package/README.md +5 -59
  3. package/dist/chunks/App-s5ex5j86.js +2 -0
  4. package/dist/chunks/ApproveApiKey-b4z6h2gn.js +2 -0
  5. package/dist/chunks/{assistant-yvtpv5sv.js → AssistantSessionChooser-g1vsya6h.js} +1 -1
  6. package/dist/chunks/BypassPermissionsModeDialog-jbg97eja.js +2 -0
  7. package/dist/chunks/ClaudeInChromeOnboarding-qa0pvwfw.js +2 -0
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog-gqmed78y.js +2 -0
  9. package/dist/chunks/ConsoleOAuthFlow-yh72vs8j.js +2 -0
  10. package/dist/chunks/{DiffDialog-v8smgzpd.js → DiffDialog-t6vvtbb2.js} +1 -1
  11. package/dist/chunks/Doctor-k08ggw2j.js +2 -0
  12. package/dist/chunks/Grove-tkkskg8n.js +2 -0
  13. package/dist/chunks/ITermBackend-73waaahf.js +2 -0
  14. package/dist/chunks/{InProcessTransport-57c2w5v4.js → InProcessTransport-qwjgb17j.js} +1 -1
  15. package/dist/chunks/InvalidConfigDialog-zmqw3fj1.js +2 -0
  16. package/dist/chunks/InvalidSettingsDialog-tnd5hymg.js +2 -0
  17. package/dist/chunks/Onboarding-p0tq6pgz.js +2 -0
  18. package/dist/chunks/REPL-hjjz80kq.js +2 -0
  19. package/dist/chunks/ResumeConversation-krn9hqb1.js +2 -0
  20. package/dist/chunks/{SnapshotUpdateDialog-5yvfnp0q.js → SnapshotUpdateDialog-raq029pd.js} +1 -1
  21. package/dist/chunks/TeleportProgress-vyy2k3bv.js +2 -0
  22. package/dist/chunks/TeleportRepoMismatchDialog-ff0h2cnq.js +2 -0
  23. package/dist/chunks/TeleportResumeWrapper-esjykret.js +2 -0
  24. package/dist/chunks/{TmuxBackend-j665sv6f.js → TmuxBackend-14kmnkcb.js} +1 -1
  25. package/dist/chunks/ToolSearchTool-w4t61c7d.js +2 -0
  26. package/dist/chunks/TrustDialog-7fvaze2x.js +2 -0
  27. package/dist/chunks/TungstenTool-rv96z549.js +2 -0
  28. package/dist/chunks/add-dir-kqw72mky.js +2 -0
  29. package/dist/chunks/agents-3exybgtb.js +4 -0
  30. package/dist/chunks/{agents-e7x38q37.js → agents-z66twpqr.js} +1 -1
  31. package/dist/chunks/ant-claude-for-chrome-mcp-712xg07f.js +2 -0
  32. package/dist/chunks/api-z8svc3xt.js +2 -0
  33. package/dist/chunks/asciicast-vzd7qjbb.js +2 -0
  34. package/dist/chunks/{AssistantSessionChooser-0r5zamt1.js → assistant-ftzr3mjp.js} +1 -1
  35. package/dist/chunks/auth-gbyfq0g2.js +2 -0
  36. package/dist/chunks/auth-wk077awh.js +2 -0
  37. package/dist/chunks/backgroundHousekeeping-m8gthtkh.js +2 -0
  38. package/dist/chunks/branch-1d0b8590.js +5 -0
  39. package/dist/chunks/{bridgePointer-9q6wh2ct.js → bridgePointer-vhd47np6.js} +1 -1
  40. package/dist/chunks/btw-s3r5jhyd.js +2 -0
  41. package/dist/chunks/buddy-xzm5npk8.js +2 -0
  42. package/dist/chunks/{cachedMicrocompact-thnhx1zt.js → cachedMicrocompact-6j3zxr4g.js} +1 -1
  43. package/dist/chunks/caches-fbggdeq7.js +2 -0
  44. package/dist/chunks/chrome-mdyx0s5j.js +2 -0
  45. package/dist/chunks/{chromeNativeHost-nnjkj164.js → chromeNativeHost-8wc6wcr6.js} +1 -1
  46. package/dist/chunks/{claudeDesktop-nsangyk5.js → claudeDesktop-p5bfxmvz.js} +1 -1
  47. package/dist/chunks/{cleanup-mv462dsh.js → cleanup-q46nbce1.js} +1 -1
  48. package/dist/chunks/clear-fwad6zxy.js +2 -0
  49. package/dist/chunks/{cli-sbp2221d.js → cli-0dc8sd37.js} +2 -2
  50. package/dist/chunks/{cli-3xhqacdd.js → cli-0qt9btbe.js} +2 -2
  51. package/dist/chunks/{cli-4j5yyvek.js → cli-0w4wc1z0.js} +2 -2
  52. package/dist/chunks/{cli-r6hm1q63.js → cli-15sqp3mq.js} +2 -2
  53. package/dist/chunks/{cli-45ftgn85.js → cli-15w3eaed.js} +1 -1
  54. package/dist/chunks/{cli-b7wx1479.js → cli-19ncan36.js} +1 -1
  55. package/dist/chunks/{cli-hx28w3cq.js → cli-1jp3rm7n.js} +1 -1
  56. package/dist/chunks/{cli-90b87f45.js → cli-1n8he7s8.js} +2 -2
  57. package/dist/chunks/{cli-bthzmdgv.js → cli-1ny2386w.js} +2 -2
  58. package/dist/chunks/{cli-vq899n8p.js → cli-27mzrnr8.js} +1 -1
  59. package/dist/chunks/{cli-gnjff7md.js → cli-2rw44zfx.js} +2 -2
  60. package/dist/chunks/{cli-7gpep1x5.js → cli-2rwjx3w0.js} +1 -1
  61. package/dist/chunks/{cli-jqppy97b.js → cli-2wd8eaac.js} +2 -2
  62. package/dist/chunks/{cli-3hwpymrd.js → cli-350pymj4.js} +2 -2
  63. package/dist/chunks/{cli-w754xmyv.js → cli-3ac555qw.js} +2 -2
  64. package/dist/chunks/{cli-8kyjh67j.js → cli-3gwqrmcd.js} +1 -1
  65. package/dist/chunks/{cli-msr9n6da.js → cli-3m8n808e.js} +2 -2
  66. package/dist/chunks/{cli-ptv3h2tx.js → cli-42kma5r3.js} +1 -1
  67. package/dist/chunks/{cli-r9p0g894.js → cli-49m97nbg.js} +2 -2
  68. package/dist/chunks/{cli-bkxwwj81.js → cli-4a4bb1kf.js} +1 -1
  69. package/dist/chunks/{cli-3bxtq5dc.js → cli-4ewb3q42.js} +2 -2
  70. package/dist/chunks/{cli-v3mf1g0z.js → cli-4mvvtchx.js} +2 -2
  71. package/dist/chunks/{cli-r2p5bkx5.js → cli-4nejhkd0.js} +2 -2
  72. package/dist/chunks/{cli-dx46fn1w.js → cli-51720d82.js} +2 -2
  73. package/dist/chunks/cli-55jdp9ky.js +3 -0
  74. package/dist/chunks/{cli-6vwdnz9p.js → cli-55ntywtj.js} +1 -1
  75. package/dist/chunks/{cli-pz8vxqw0.js → cli-57yrpnaq.js} +2 -2
  76. package/dist/chunks/{cli-59ysj9y4.js → cli-5dt9yjha.js} +2 -2
  77. package/dist/chunks/{cli-e37w9dxm.js → cli-5f0w3fy6.js} +1 -1
  78. package/dist/chunks/{cli-z9jm4xjn.js → cli-5vsnhp97.js} +2 -2
  79. package/dist/chunks/{cli-x758qvv7.js → cli-61x73ksv.js} +1 -1
  80. package/dist/chunks/{cli-ye3qk73s.js → cli-66jj9zj3.js} +1 -1
  81. package/dist/chunks/{cli-zac1afnb.js → cli-6bxfdgv1.js} +1 -1
  82. package/dist/chunks/{cli-md1h6sbv.js → cli-6pdpyz1a.js} +1 -1
  83. package/dist/chunks/{cli-mejr8b5m.js → cli-6yprtw88.js} +2 -2
  84. package/dist/chunks/{cli-qs0v3mf6.js → cli-73jf8hyz.js} +2 -2
  85. package/dist/chunks/{cli-948we41z.js → cli-749tdaqc.js} +2 -2
  86. package/dist/chunks/{cli-vxxkrd5y.js → cli-764c4bsm.js} +2 -2
  87. package/dist/chunks/cli-78apjp3t.js +3 -0
  88. package/dist/chunks/{cli-k0jpcxwa.js → cli-7c99j0pt.js} +2 -2
  89. package/dist/chunks/{cli-by5b2216.js → cli-89x414pj.js} +2 -2
  90. package/dist/chunks/{cli-fqb71hy3.js → cli-8dmy2s42.js} +1 -1
  91. package/dist/chunks/cli-8hxz2qs6.js +3 -0
  92. package/dist/chunks/cli-8mk2zg4a.js +4 -0
  93. package/dist/chunks/{cli-29gcax34.js → cli-8qd16mt4.js} +2 -2
  94. package/dist/chunks/cli-95wg48h9.js +3 -0
  95. package/dist/chunks/{cli-wz9r5s81.js → cli-99mqr54v.js} +2 -2
  96. package/dist/chunks/{cli-8qk46mt3.js → cli-9aq7vxaq.js} +1 -1
  97. package/dist/chunks/{cli-zcpjf07m.js → cli-9z9r2set.js} +2 -2
  98. package/dist/chunks/{cli-2wvsym16.js → cli-a52ra30v.js} +1 -1
  99. package/dist/chunks/{cli-s6qk3rbv.js → cli-akcxtvv9.js} +2 -2
  100. package/dist/chunks/{cli-h3kcprht.js → cli-bmk0rb5v.js} +2 -2
  101. package/dist/chunks/{cli-pmzht94n.js → cli-br6zjh6x.js} +2 -2
  102. package/dist/chunks/{cli-z8hqtyjg.js → cli-c22wpdk4.js} +1 -1
  103. package/dist/chunks/{cli-zbt28krs.js → cli-c60c9qvm.js} +1 -1
  104. package/dist/chunks/{cli-3357rxva.js → cli-cqkne34j.js} +2 -2
  105. package/dist/chunks/{cli-0s65jzgr.js → cli-cwbxhdt1.js} +1 -1
  106. package/dist/chunks/{cli-xsap3gxj.js → cli-d0hzw78c.js} +1 -1
  107. package/dist/chunks/{cli-0b4dmvvw.js → cli-d53fhs6v.js} +2 -2
  108. package/dist/chunks/{cli-extf4h54.js → cli-dbdqrqmt.js} +1 -1
  109. package/dist/chunks/{cli-yf3sh3aw.js → cli-de1hwp88.js} +1 -1
  110. package/dist/chunks/cli-edkqs0ge.js +3 -0
  111. package/dist/chunks/{cli-dsnjsvqs.js → cli-er7z496e.js} +2 -2
  112. package/dist/chunks/{cli-atpfeg28.js → cli-eyw3czmn.js} +2 -2
  113. package/dist/chunks/{cli-tyxvdf66.js → cli-ezs5sney.js} +2 -2
  114. package/dist/chunks/{cli-tn47e131.js → cli-f63fdj4w.js} +2 -2
  115. package/dist/chunks/cli-fakdskp6.js +3 -0
  116. package/dist/chunks/{cli-nj726gac.js → cli-fdya77ch.js} +3 -3
  117. package/dist/chunks/{cli-b1dptek2.js → cli-fghyxar5.js} +2 -2
  118. package/dist/chunks/{cli-g1spmn9n.js → cli-fm14mg07.js} +1 -1
  119. package/dist/chunks/{cli-cr1hvkmz.js → cli-fs7yttfp.js} +2 -2
  120. package/dist/chunks/{cli-rcvta3zk.js → cli-fwrj8ybs.js} +2 -2
  121. package/dist/chunks/{cli-v77avvvk.js → cli-g4n9das2.js} +1 -1
  122. package/dist/chunks/{cli-cbdrqqf2.js → cli-g5wq5ptg.js} +2 -2
  123. package/dist/chunks/{cli-yrk194b9.js → cli-gq5fve62.js} +1 -1
  124. package/dist/chunks/{cli-nykt265k.js → cli-grxvgq2n.js} +1 -1
  125. package/dist/chunks/{cli-ffjjv4j8.js → cli-gtm212j6.js} +2 -2
  126. package/dist/chunks/{cli-skq9ktf8.js → cli-gxgdnjfn.js} +1 -1
  127. package/dist/chunks/{cli-x5z5m6y7.js → cli-h120wpk2.js} +1 -1
  128. package/dist/chunks/{cli-58t6a5n6.js → cli-h4a90xbh.js} +1 -1
  129. package/dist/chunks/cli-h4dspaac.js +3 -0
  130. package/dist/chunks/{cli-a98b285v.js → cli-hke6r0q8.js} +2 -2
  131. package/dist/chunks/{cli-jxwm52wg.js → cli-hzr2zraz.js} +1 -1
  132. package/dist/chunks/{cli-x4a9geyz.js → cli-j08dmxw5.js} +1 -1
  133. package/dist/chunks/{cli-jvs98a70.js → cli-ja540nr7.js} +1 -1
  134. package/dist/chunks/{cli-dr1ph0pp.js → cli-jegyadmb.js} +2 -2
  135. package/dist/chunks/{cli-xjx11p6m.js → cli-jgn9jprh.js} +2 -2
  136. package/dist/chunks/{cli-n3m134cf.js → cli-jj93qmmc.js} +2 -2
  137. package/dist/chunks/{cli-kje3t5yg.js → cli-jkj867t1.js} +3 -3
  138. package/dist/chunks/{cli-6he3kpeb.js → cli-k2nh5cby.js} +2 -2
  139. package/dist/chunks/{cli-3je4vtx7.js → cli-k4v08k8t.js} +2 -2
  140. package/dist/chunks/{cli-c2pn6csk.js → cli-khs3sj9k.js} +1 -1
  141. package/dist/chunks/{cli-shz2e0q5.js → cli-kq16afrr.js} +2 -2
  142. package/dist/chunks/{cli-2zh6c5xz.js → cli-kqv5b8zh.js} +1 -1
  143. package/dist/chunks/{cli-k8fd74g6.js → cli-m0z3rmf0.js} +2 -2
  144. package/dist/chunks/{cli-a72n4ej7.js → cli-m12smc5e.js} +1 -1
  145. package/dist/chunks/{cli-15zbq52w.js → cli-m8fq163z.js} +1 -1
  146. package/dist/chunks/{cli-1215h20m.js → cli-mb1qrqw1.js} +2 -2
  147. package/dist/chunks/{cli-50wh7ttg.js → cli-mbp8f3f3.js} +2 -2
  148. package/dist/chunks/{cli-5pb6kdxn.js → cli-me4e2p3e.js} +595 -595
  149. package/dist/chunks/{cli-vz1j9n38.js → cli-mj03488e.js} +2 -2
  150. package/dist/chunks/{cli-6dcra6rs.js → cli-ms5j6fff.js} +2 -2
  151. package/dist/chunks/{cli-0v6qg4zv.js → cli-msgx4pnp.js} +2 -2
  152. package/dist/chunks/cli-msmzt4c3.js +130 -0
  153. package/dist/chunks/{cli-h5yfk29j.js → cli-msw0vv86.js} +2 -2
  154. package/dist/chunks/{cli-ewts4g0p.js → cli-mzcsnm06.js} +2 -2
  155. package/dist/chunks/{cli-wr4k6ngg.js → cli-n5s5fnyj.js} +2 -2
  156. package/dist/chunks/{cli-ygq3fy9g.js → cli-ns0aaggm.js} +1 -1
  157. package/dist/chunks/{cli-1a2nss2m.js → cli-nvnj7r73.js} +1 -1
  158. package/dist/chunks/{cli-hpzy0mat.js → cli-p0vh69b9.js} +2 -2
  159. package/dist/chunks/{cli-zf7yzkn6.js → cli-p2cqnrnp.js} +2 -2
  160. package/dist/chunks/{cli-px7jhzgq.js → cli-pbc8sk2d.js} +2 -2
  161. package/dist/chunks/{cli-29078yxj.js → cli-pgg33dhw.js} +2 -2
  162. package/dist/chunks/cli-przq3zk6.js +3 -0
  163. package/dist/chunks/{cli-q9fn82b1.js → cli-q0156x0d.js} +2 -2
  164. package/dist/chunks/{cli-zdy5bccv.js → cli-q46epwyh.js} +1 -1
  165. package/dist/chunks/{cli-v8w48y51.js → cli-qaxvg7gv.js} +1 -1
  166. package/dist/chunks/{cli-ytj910yt.js → cli-qm684n63.js} +1 -1
  167. package/dist/chunks/{cli-2qec7gn4.js → cli-r3etpht1.js} +1 -1
  168. package/dist/chunks/{cli-amy2yafd.js → cli-r83ttew2.js} +2 -2
  169. package/dist/chunks/{cli-22zbzzap.js → cli-r9db9mqv.js} +1 -1
  170. package/dist/chunks/{cli-3q7meftn.js → cli-rjerv816.js} +2 -2
  171. package/dist/chunks/{cli-mx6xk0dw.js → cli-rvad3yhg.js} +2 -2
  172. package/dist/chunks/{cli-wfqsfwa2.js → cli-rxb5q8zw.js} +2 -2
  173. package/dist/chunks/{cli-7cn4gwqc.js → cli-s160fqyz.js} +2 -2
  174. package/dist/chunks/{cli-v2hg35qk.js → cli-s6vr7213.js} +2 -2
  175. package/dist/chunks/{cli-49dqgzsg.js → cli-s9fhtgmz.js} +2 -2
  176. package/dist/chunks/{cli-tezq577c.js → cli-scaqq0v9.js} +2 -2
  177. package/dist/chunks/{cli-15tr7ade.js → cli-sh9w2tbd.js} +1 -1
  178. package/dist/chunks/{cli-zd2e6bq1.js → cli-sycqd3xe.js} +4 -4
  179. package/dist/chunks/{cli-d06qr5p3.js → cli-t4j047cx.js} +2 -2
  180. package/dist/chunks/{cli-s5epnnj5.js → cli-t9jht3kb.js} +2 -2
  181. package/dist/chunks/{cli-bd1ryrzd.js → cli-tckzkegq.js} +1 -1
  182. package/dist/chunks/{cli-p2gt60aj.js → cli-tfv2qcgf.js} +1 -1
  183. package/dist/chunks/{cli-1qszxdan.js → cli-tq5z9qv3.js} +2 -2
  184. package/dist/chunks/{cli-wthnf2t5.js → cli-tt9a4124.js} +1 -1
  185. package/dist/chunks/{cli-8v5ajztt.js → cli-tyqh91zq.js} +1 -1
  186. package/dist/chunks/cli-v943fd6a.js +3 -0
  187. package/dist/chunks/{cli-wn4ywgbv.js → cli-v9f860t5.js} +2 -2
  188. package/dist/chunks/{cli-qc7zfabw.js → cli-vkvmhjha.js} +2 -2
  189. package/dist/chunks/{cli-6b6e5zj9.js → cli-vkzp66cm.js} +2 -2
  190. package/dist/chunks/{cli-6qhwqfwp.js → cli-vwg0v35a.js} +2 -2
  191. package/dist/chunks/{cli-x514vyva.js → cli-w1d8n9g3.js} +1 -1
  192. package/dist/chunks/cli-w52yvzkn.js +3 -0
  193. package/dist/chunks/{cli-et2cj5dc.js → cli-wbe1p8n2.js} +2 -2
  194. package/dist/chunks/{cli-5mdbbvnv.js → cli-wm8qb6j3.js} +1 -1
  195. package/dist/chunks/{cli-1tq57kq0.js → cli-wn2srq2e.js} +1 -1
  196. package/dist/chunks/{cli-088ac95n.js → cli-wt2bfbn0.js} +2 -2
  197. package/dist/chunks/{cli-jmypsed1.js → cli-x70v8rsj.js} +2 -2
  198. package/dist/chunks/{cli-5wh173wa.js → cli-x8xgga1a.js} +3 -3
  199. package/dist/chunks/{cli-2vc9kv40.js → cli-xfsqvp8r.js} +2 -2
  200. package/dist/chunks/{cli-6xmbrh42.js → cli-xmgm2573.js} +2 -2
  201. package/dist/chunks/{cli-d58ptbve.js → cli-xpa1neza.js} +2 -2
  202. package/dist/chunks/{cli-6bxmycm6.js → cli-yqbvprz7.js} +1 -1
  203. package/dist/chunks/{cli-bz32070f.js → cli-yrwenjxs.js} +1 -1
  204. package/dist/chunks/{cli-3p0mfsqg.js → cli-z5e72gsd.js} +1 -1
  205. package/dist/chunks/{cli-z2jpyr57.js → cli-zev50xap.js} +1 -1
  206. package/dist/chunks/{cli-mjz85907.js → cli-zjbzak9n.js} +1 -1
  207. package/dist/chunks/{cli-h2dynmt7.js → cli-zjfya500.js} +1 -1
  208. package/dist/chunks/{cli-60mdvk6q.js → cli-zp8s7q5w.js} +1 -1
  209. package/dist/chunks/{cli-znz72ctn.js → cli-zpcncwrv.js} +1 -1
  210. package/dist/chunks/{cli-ew59cmn3.js → cli-zxdnz6vp.js} +1 -1
  211. package/dist/chunks/client-dkpgx025.js +2 -0
  212. package/dist/chunks/color-zrm6r755.js +2 -0
  213. package/dist/chunks/commitAttribution-3y6pessz.js +2 -0
  214. package/dist/chunks/common-0bee37at.js +2 -0
  215. package/dist/chunks/compact-zmvj1pk0.js +4 -0
  216. package/dist/chunks/config-gj0gbg5g.js +2 -0
  217. package/dist/chunks/config-hbq35b68.js +2 -0
  218. package/dist/chunks/context-h1qc69rg.js +2 -0
  219. package/dist/chunks/context-noninteractive-7wbe6qvd.js +2 -0
  220. package/dist/chunks/conversation-fwnfp0p5.js +2 -0
  221. package/dist/chunks/{copy-bpypgpy8.js → copy-76r9v46d.js} +1 -1
  222. package/dist/chunks/cost-56r5xxqy.js +5 -0
  223. package/dist/chunks/createSession-m5y8fjy4.js +2 -0
  224. package/dist/chunks/desktop-z3jqgnw7.js +2 -0
  225. package/dist/chunks/detectRepository-w6wawmmg.js +2 -0
  226. package/dist/chunks/detection-1yb2c7hh.js +2 -0
  227. package/dist/chunks/{devtools-mt3vnaw3.js → devtools-10ba48t9.js} +1 -1
  228. package/dist/chunks/{diff-bcdc10jv.js → diff-05xxjeqc.js} +1 -1
  229. package/dist/chunks/doctor-hgwjdraj.js +2 -0
  230. package/dist/chunks/earlyInput-navj6cdn.js +2 -0
  231. package/dist/chunks/effort-a190c878.js +9 -0
  232. package/dist/chunks/executor-s42mdmqs.js +2 -0
  233. package/dist/chunks/exit-kyrjy6hb.js +2 -0
  234. package/dist/chunks/export-ct4sty4d.js +3 -0
  235. package/dist/chunks/extra-usage-noninteractive-byts9mme.js +2 -0
  236. package/dist/chunks/extra-usage-xh1mkrca.js +2 -0
  237. package/dist/chunks/fast-g4aa49jf.js +2 -0
  238. package/dist/chunks/feedback-m5r66qd5.js +2 -0
  239. package/dist/chunks/{files-fx3xz1bj.js → files-qrrrkjke.js} +1 -1
  240. package/dist/chunks/firstPartyEventLogger-mthxtmgc.js +2 -0
  241. package/dist/chunks/gates-yhakv4vb.js +2 -0
  242. package/dist/chunks/git-c39vd9dm.js +2 -0
  243. package/dist/chunks/goal-24dr7fwz.js +2 -0
  244. package/dist/chunks/growthbook-f7ag30hy.js +2 -0
  245. package/dist/chunks/heapdump-16gnh3zm.js +7 -0
  246. package/dist/chunks/help-rgcakcxe.js +2 -0
  247. package/dist/chunks/hooks-8dh43zmv.js +2 -0
  248. package/dist/chunks/{hooks-7kspbr6v.js → hooks-c7fqwas5.js} +1 -1
  249. package/dist/chunks/{ide-5bsqkr23.js → ide-q83qr9cn.js} +1 -1
  250. package/dist/chunks/index-v875zpde.js +2 -0
  251. package/dist/chunks/initReplBridge-zfwxgpsm.js +2 -0
  252. package/dist/chunks/ink-vkxsn90v.js +2 -0
  253. package/dist/chunks/{insights-z9edzgf1.js → insights-4fwap4e5.js} +1 -1
  254. package/dist/chunks/install-7nxzmgp5.js +2 -0
  255. package/dist/chunks/{install-github-app-918fh4r2.js → install-github-app-djzea7r4.js} +1 -1
  256. package/dist/chunks/install-slack-app-3rde0k08.js +2 -0
  257. package/dist/chunks/{instrumentation-b8ysw74t.js → instrumentation-223qqr23.js} +1 -1
  258. package/dist/chunks/keybindings-6t5f69wx.js +3 -0
  259. package/dist/chunks/loadAgentsDir-f8shfnw3.js +2 -0
  260. package/dist/chunks/loadPluginHooks-mdwjrjtp.js +2 -0
  261. package/dist/chunks/login-34j3xdr9.js +2 -0
  262. package/dist/chunks/logout-yew8mymc.js +2 -0
  263. package/dist/chunks/{main-sqrzjvg9.js → main-0b8hyp8h.js} +79 -79
  264. package/dist/chunks/mcp-9enw5a8j.js +2 -0
  265. package/dist/chunks/mcp-fn4yrf5y.js +3 -0
  266. package/dist/chunks/{mcp-dqh1vtvf.js → mcp-yymqpmv6.js} +3 -3
  267. package/dist/chunks/mcpServer-60jg9v58.js +2 -0
  268. package/dist/chunks/mcpServer-85gt8ypc.js +2 -0
  269. package/dist/chunks/memory-kam5z1cw.js +4 -0
  270. package/dist/chunks/{mobile-9m41g9bp.js → mobile-7zsgawnb.js} +1 -1
  271. package/dist/chunks/model-03987182.js +2 -0
  272. package/dist/chunks/model-wbxx5kcd.js +3 -0
  273. package/dist/chunks/{oauth-98khjrd8.js → oauth-y0p2y1w5.js} +1 -1
  274. package/dist/chunks/{output-style-1h6b2zf8.js → output-style-x148mzhn.js} +1 -1
  275. package/dist/chunks/parser-4y4b0e6b.js +2 -0
  276. package/dist/chunks/passes-jrmjk5zk.js +2 -0
  277. package/dist/chunks/permissions-karmgb0m.js +4 -0
  278. package/dist/chunks/plan-w0beh9bh.js +2 -0
  279. package/dist/chunks/plugin-6nwptn3s.js +2 -0
  280. package/dist/chunks/pluginStartupCheck-0nzv1ae9.js +2 -0
  281. package/dist/chunks/{plugins-pe89pa7p.js → plugins-vvf897b4.js} +2 -2
  282. package/dist/chunks/{preauthorizedConfig-g0aq6f03.js → preauthorizedConfig-p02f23jb.js} +1 -1
  283. package/dist/chunks/{print-cjjnhg9d.js → print-krwpbp2j.js} +4 -4
  284. package/dist/chunks/privacy-settings-m0mfykh0.js +2 -0
  285. package/dist/chunks/process-26nny2p0.js +2 -0
  286. package/dist/chunks/processBashCommand-8fqgv2ec.js +2 -0
  287. package/dist/chunks/{processSlashCommand-6d8rnm8v.js → processSlashCommand-q32wy80b.js} +1 -1
  288. package/dist/chunks/prompt-gw1e1gef.js +2 -0
  289. package/dist/chunks/prompt-xgw2hxrc.js +2 -0
  290. package/dist/chunks/provider-prompt-s26vatcw.js +2 -0
  291. package/dist/chunks/rate-limit-options-rd4rjfv5.js +2 -0
  292. package/dist/chunks/registry-fp7x9ekd.js +2 -0
  293. package/dist/chunks/release-notes-76y1r2s1.js +6 -0
  294. package/dist/chunks/reload-plugins-z0fepkva.js +3 -0
  295. package/dist/chunks/remote-env-nn9ngr99.js +2 -0
  296. package/dist/chunks/remoteBridgeCore-cg7qd8m4.js +2 -0
  297. package/dist/chunks/rename-fdjzyjar.js +2 -0
  298. package/dist/chunks/resume-4rvj8jbz.js +3 -0
  299. package/dist/chunks/{rewind-cpv2pwfx.js → rewind-r4g5njsg.js} +1 -1
  300. package/dist/chunks/sandbox-adapter-craea9vm.js +2 -0
  301. package/dist/chunks/sandbox-toggle-620bkz9q.js +2 -0
  302. package/dist/chunks/session-5vm1vwv1.js +3 -0
  303. package/dist/chunks/sessionFileAccessHooks-5jbvwabj.js +2 -0
  304. package/dist/chunks/sessionStorage-ffkhmn5q.js +2 -0
  305. package/dist/chunks/settings-s2bcajs6.js +2 -0
  306. package/dist/chunks/setup-fwcttwbm.js +2 -0
  307. package/dist/chunks/setup-pf09nfsj.js +7 -0
  308. package/dist/chunks/{setup-mecsw2ye.js → setup-vegs56f5.js} +1 -1
  309. package/dist/chunks/sinks-wd4ccgbf.js +2 -0
  310. package/dist/chunks/skills-evga8f7n.js +2 -0
  311. package/dist/chunks/startupProfiler-x5zbs2j7.js +2 -0
  312. package/dist/chunks/state-qpmfrvsv.js +2 -0
  313. package/dist/chunks/{stats-3v0r4e1v.js → stats-mgqf6r7c.js} +1 -1
  314. package/dist/chunks/status-78yks3jw.js +2 -0
  315. package/dist/chunks/stickers-bdp8w2gr.js +2 -0
  316. package/dist/chunks/subprocessEnv-s797f06r.js +2 -0
  317. package/dist/chunks/{systemPromptSections-htbs443y.js → systemPromptSections-07y2z2wn.js} +1 -1
  318. package/dist/chunks/tag-gd73kstd.js +12 -0
  319. package/dist/chunks/tasks-63qaca0z.js +2 -0
  320. package/dist/chunks/{teamHelpers-dddedf19.js → teamHelpers-8ykc4bxa.js} +1 -1
  321. package/dist/chunks/teammateModeSnapshot-ae9r29dy.js +2 -0
  322. package/dist/chunks/teleport-es58k4xz.js +2 -0
  323. package/dist/chunks/terminalSetup-gyh5z5e2.js +2 -0
  324. package/dist/chunks/theme-qrhbaht6.js +2 -0
  325. package/dist/chunks/thinkback-5bs7ezv5.js +2 -0
  326. package/dist/chunks/thinkback-play-1dy160y5.js +2 -0
  327. package/dist/chunks/toolSearch-6cv284b7.js +2 -0
  328. package/dist/chunks/trustedDevice-77ketbgg.js +2 -0
  329. package/dist/chunks/{ultrareviewCommand-jtmh2xb1.js → ultrareviewCommand-j23bjbf8.js} +1 -1
  330. package/dist/chunks/{update-mkzzbt54.js → update-w8wdxh3m.js} +1 -1
  331. package/dist/chunks/upgrade-nft7c1yk.js +2 -0
  332. package/dist/chunks/{upstreamproxy-hbbvxzb5.js → upstreamproxy-x405ef9p.js} +1 -1
  333. package/dist/chunks/usage-s5qgc615.js +2 -0
  334. package/dist/chunks/util-1geb93kp.js +2 -0
  335. package/dist/chunks/utils-6sb44pg8.js +2 -0
  336. package/dist/chunks/vim-kq91w44a.js +2 -0
  337. package/dist/chunks/worktree-0af6b1mt.js +2 -0
  338. package/dist/chunks/worktreeModeEnabled-ea6wb7aj.js +2 -0
  339. package/dist/cli.js +1 -1
  340. package/package.json +4 -1
  341. package/preload.ts +24 -2
  342. package/dist/chunks/App-skattzvx.js +0 -2
  343. package/dist/chunks/ApproveApiKey-1zk1g80v.js +0 -2
  344. package/dist/chunks/BypassPermissionsModeDialog-4bd5a65d.js +0 -2
  345. package/dist/chunks/ClaudeInChromeOnboarding-jrj410t2.js +0 -2
  346. package/dist/chunks/ClaudeMdExternalIncludesDialog-2bn5pwwr.js +0 -2
  347. package/dist/chunks/ConsoleOAuthFlow-8hn6958t.js +0 -2
  348. package/dist/chunks/Doctor-w0eqwfzb.js +0 -2
  349. package/dist/chunks/Grove-ygg0z9mr.js +0 -2
  350. package/dist/chunks/ITermBackend-ht0ds6se.js +0 -2
  351. package/dist/chunks/InvalidConfigDialog-h2jkde64.js +0 -2
  352. package/dist/chunks/InvalidSettingsDialog-3p7ehs0t.js +0 -2
  353. package/dist/chunks/Onboarding-np5yfyy1.js +0 -2
  354. package/dist/chunks/REPL-8811fta4.js +0 -2
  355. package/dist/chunks/ResumeConversation-d03pbgnw.js +0 -2
  356. package/dist/chunks/TeleportProgress-ghjbbh9h.js +0 -2
  357. package/dist/chunks/TeleportRepoMismatchDialog-hhcyekar.js +0 -2
  358. package/dist/chunks/TeleportResumeWrapper-66e7dnk5.js +0 -2
  359. package/dist/chunks/ToolSearchTool-dgwhh0gd.js +0 -2
  360. package/dist/chunks/TrustDialog-w9tj4t8r.js +0 -2
  361. package/dist/chunks/TungstenTool-7k2gt6pa.js +0 -2
  362. package/dist/chunks/add-dir-pg1rb88e.js +0 -2
  363. package/dist/chunks/agents-mcbqv3h3.js +0 -4
  364. package/dist/chunks/ant-claude-for-chrome-mcp-c765s2bt.js +0 -2
  365. package/dist/chunks/api-qvdz0vdp.js +0 -2
  366. package/dist/chunks/asciicast-ygqjzj6w.js +0 -2
  367. package/dist/chunks/auth-gkfrn4ga.js +0 -2
  368. package/dist/chunks/auth-y1hqesm6.js +0 -2
  369. package/dist/chunks/backgroundHousekeeping-wk8ne1wg.js +0 -2
  370. package/dist/chunks/branch-yre4hh7s.js +0 -5
  371. package/dist/chunks/btw-091q02sh.js +0 -2
  372. package/dist/chunks/buddy-5xd2vjhm.js +0 -2
  373. package/dist/chunks/caches-g4cc992y.js +0 -2
  374. package/dist/chunks/chrome-rd8crze6.js +0 -2
  375. package/dist/chunks/clear-25jzke5j.js +0 -2
  376. package/dist/chunks/cli-6hvqmebc.js +0 -3
  377. package/dist/chunks/cli-9hskw92e.js +0 -130
  378. package/dist/chunks/cli-avcnnw0n.js +0 -3
  379. package/dist/chunks/cli-e9pafjv1.js +0 -4
  380. package/dist/chunks/cli-gyp5wyzg.js +0 -3
  381. package/dist/chunks/cli-jbbxj53h.js +0 -3
  382. package/dist/chunks/cli-pbp5hza0.js +0 -3
  383. package/dist/chunks/cli-tzaj50bd.js +0 -3
  384. package/dist/chunks/cli-xzsc9n84.js +0 -3
  385. package/dist/chunks/cli-yv1znypb.js +0 -3
  386. package/dist/chunks/client-037bm52v.js +0 -2
  387. package/dist/chunks/color-ceqfke15.js +0 -2
  388. package/dist/chunks/commitAttribution-3ewwca68.js +0 -2
  389. package/dist/chunks/common-jn8w5r1w.js +0 -2
  390. package/dist/chunks/compact-631qpkbp.js +0 -4
  391. package/dist/chunks/config-6em7qq45.js +0 -2
  392. package/dist/chunks/config-h2e5ra49.js +0 -2
  393. package/dist/chunks/context-31c3znwn.js +0 -2
  394. package/dist/chunks/context-noninteractive-q418vz0p.js +0 -2
  395. package/dist/chunks/conversation-yz22h1cb.js +0 -2
  396. package/dist/chunks/cost-8rr9expn.js +0 -5
  397. package/dist/chunks/createSession-jratqxvc.js +0 -2
  398. package/dist/chunks/desktop-zq22ksq3.js +0 -2
  399. package/dist/chunks/detectRepository-djxyq37h.js +0 -2
  400. package/dist/chunks/detection-b18r43da.js +0 -2
  401. package/dist/chunks/doctor-cs43t62h.js +0 -2
  402. package/dist/chunks/earlyInput-361tx72y.js +0 -2
  403. package/dist/chunks/effort-qw83nert.js +0 -9
  404. package/dist/chunks/executor-rvxyyheh.js +0 -2
  405. package/dist/chunks/exit-kynz824m.js +0 -2
  406. package/dist/chunks/export-95j3srp6.js +0 -3
  407. package/dist/chunks/extra-usage-hxyp53v5.js +0 -2
  408. package/dist/chunks/extra-usage-noninteractive-53w28t1j.js +0 -2
  409. package/dist/chunks/fast-ec1hxnv7.js +0 -2
  410. package/dist/chunks/feedback-qtsk3t9f.js +0 -2
  411. package/dist/chunks/firstPartyEventLogger-4yfx731e.js +0 -2
  412. package/dist/chunks/gates-85t459a0.js +0 -2
  413. package/dist/chunks/git-e0mvprv8.js +0 -2
  414. package/dist/chunks/goal-ywc7exvv.js +0 -2
  415. package/dist/chunks/growthbook-ykj8089v.js +0 -2
  416. package/dist/chunks/heapdump-w6a13cfe.js +0 -7
  417. package/dist/chunks/help-enq1htxe.js +0 -2
  418. package/dist/chunks/hooks-wxm384wn.js +0 -2
  419. package/dist/chunks/initReplBridge-acrf7hyb.js +0 -2
  420. package/dist/chunks/ink-9vrw9yhe.js +0 -2
  421. package/dist/chunks/install-c8gv4wfg.js +0 -2
  422. package/dist/chunks/install-slack-app-1aqgxsb6.js +0 -2
  423. package/dist/chunks/keybindings-v92d2xht.js +0 -3
  424. package/dist/chunks/loadAgentsDir-k53rdwbr.js +0 -2
  425. package/dist/chunks/loadPluginHooks-rmzgs29p.js +0 -2
  426. package/dist/chunks/login-j9bz1g34.js +0 -2
  427. package/dist/chunks/logout-58wm6hsc.js +0 -2
  428. package/dist/chunks/mcp-z3j236hk.js +0 -3
  429. package/dist/chunks/mcp-zryxxcaz.js +0 -2
  430. package/dist/chunks/mcpServer-b2m7ewct.js +0 -2
  431. package/dist/chunks/mcpServer-xpq096r4.js +0 -2
  432. package/dist/chunks/memory-5tvqvktk.js +0 -4
  433. package/dist/chunks/model-cta1svwb.js +0 -3
  434. package/dist/chunks/model-d96jkka7.js +0 -2
  435. package/dist/chunks/parser-jpf6bfmz.js +0 -2
  436. package/dist/chunks/passes-reh6ja9j.js +0 -2
  437. package/dist/chunks/permissions-xgydmrq2.js +0 -4
  438. package/dist/chunks/plan-z4k8zj56.js +0 -2
  439. package/dist/chunks/plugin-0tztmcsg.js +0 -2
  440. package/dist/chunks/pluginStartupCheck-vxmkvt40.js +0 -2
  441. package/dist/chunks/privacy-settings-zbrc40a1.js +0 -2
  442. package/dist/chunks/process-msr26xa0.js +0 -2
  443. package/dist/chunks/processBashCommand-hnhy8brr.js +0 -2
  444. package/dist/chunks/prompt-cfaneybz.js +0 -2
  445. package/dist/chunks/prompt-wg6hfj0k.js +0 -2
  446. package/dist/chunks/provider-prompt-c8wew66t.js +0 -2
  447. package/dist/chunks/rate-limit-options-fyjqpxp3.js +0 -2
  448. package/dist/chunks/registry-ht9aazng.js +0 -2
  449. package/dist/chunks/release-notes-5v16zb9c.js +0 -6
  450. package/dist/chunks/reload-plugins-apyma8vs.js +0 -3
  451. package/dist/chunks/remote-env-p6ym55w6.js +0 -2
  452. package/dist/chunks/remoteBridgeCore-0v9x8112.js +0 -2
  453. package/dist/chunks/rename-j9rc9dwj.js +0 -2
  454. package/dist/chunks/resume-tbr3mkch.js +0 -3
  455. package/dist/chunks/sandbox-adapter-qh943bs4.js +0 -2
  456. package/dist/chunks/sandbox-toggle-1f70ejwk.js +0 -2
  457. package/dist/chunks/session-42zhjgd2.js +0 -3
  458. package/dist/chunks/sessionFileAccessHooks-1nh915er.js +0 -2
  459. package/dist/chunks/sessionStorage-j5m0nf55.js +0 -2
  460. package/dist/chunks/settings-c709knqg.js +0 -2
  461. package/dist/chunks/setup-0n2p20yw.js +0 -7
  462. package/dist/chunks/setup-2hqyyxff.js +0 -2
  463. package/dist/chunks/sinks-q6etaenz.js +0 -2
  464. package/dist/chunks/skills-xads3027.js +0 -2
  465. package/dist/chunks/startupProfiler-4wmjq0yd.js +0 -2
  466. package/dist/chunks/state-edaz98bj.js +0 -2
  467. package/dist/chunks/status-9rtty0ee.js +0 -2
  468. package/dist/chunks/stickers-m73qwecp.js +0 -2
  469. package/dist/chunks/subprocessEnv-rass28aq.js +0 -2
  470. package/dist/chunks/tag-vj93fgp6.js +0 -12
  471. package/dist/chunks/tasks-avbqta2s.js +0 -2
  472. package/dist/chunks/teammateModeSnapshot-32yfa4hf.js +0 -2
  473. package/dist/chunks/teleport-jw6w0rn4.js +0 -2
  474. package/dist/chunks/terminalSetup-ppt6v9xf.js +0 -2
  475. package/dist/chunks/theme-2csrfbca.js +0 -2
  476. package/dist/chunks/thinkback-2ahfejyt.js +0 -2
  477. package/dist/chunks/thinkback-play-kffa7rdp.js +0 -2
  478. package/dist/chunks/toolSearch-ptrcr8ec.js +0 -2
  479. package/dist/chunks/trustedDevice-xvtp79f1.js +0 -2
  480. package/dist/chunks/upgrade-c4argpvv.js +0 -2
  481. package/dist/chunks/usage-w30yajzy.js +0 -2
  482. package/dist/chunks/util-zkawe0w0.js +0 -2
  483. package/dist/chunks/utils-v86tf27x.js +0 -2
  484. package/dist/chunks/vim-3stm1kbg.js +0 -2
  485. package/dist/chunks/worktree-pbeayfjp.js +0 -2
  486. package/dist/chunks/worktreeModeEnabled-ysks760x.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{EQ as w,FQ as Sv,KQ as E,LQ as Gv,iR as Dv}from"./cli-5wh173wa.js";import{$T as Bv,K3 as U,N3 as S,S3 as L,T3 as N,VT as n,e4 as k}from"./cli-9hskw92e.js";import{i4 as Xv,l4 as Yv,m4 as bv}from"./cli-h5yfk29j.js";import{L5 as Qv,P5 as Fv}from"./cli-1215h20m.js";import{C7 as B,E7 as C}from"./cli-hpzy0mat.js";import{B8 as p,w8 as W}from"./cli-3bxtq5dc.js";import{I8 as u,J8 as wv}from"./cli-mx6xk0dw.js";import{m9 as Y,o9 as yv}from"./cli-n3m134cf.js";import{$9 as Jv,X9 as j,Z9 as vv,a_ as Kv,d_ as Mv,h_ as r,l_ as Zv,r_ as y,u_ as Uv}from"./cli-a98b285v.js";import{bda as b}from"./cli-x514vyva.js";import Rv from"lodash-es/memoize.js";import{join as Wv}from"path";function Hv(){let v=r().existsSync(Wv(u(),"CLAUDE.md")),G=n(u());return[{key:"workspace",text:"Ask Claude to create a new app or clone a repository",isComplete:!1,isCompletable:!0,isEnabled:G},{key:"claudemd",text:"Run /init to create an AGENTS.md (or CLAUDE.md) file with instructions for UnieAI Code",isComplete:v,isCompletable:!0,isEnabled:!G}]}function a(){return Hv().filter(({isCompletable:v,isEnabled:G})=>v&&G).every(({isComplete:v})=>v)}function o(){if(L().hasCompletedProjectOnboarding)return;if(a())N((v)=>({...v,hasCompletedProjectOnboarding:!0}))}function rv(){N((v)=>({...v,projectOnboardingSeenCount:v.projectOnboardingSeenCount+1}))}var sv;var l=b(()=>{k();wv();Bv();Zv();sv=Rv(()=>{let v=L();if(v.hasCompletedProjectOnboarding||v.projectOnboardingSeenCount>=4||process.env.IS_DEMO)return!1;return!a()})});import{stat as h}from"fs/promises";import{homedir as zv}from"os";import{join as Vv}from"path";function _v(v){U((G)=>({...G,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:v}))}function I(){U((v)=>({...v,appleTerminalSetupInProgress:!1}))}function Iv(){let v=S();return{inProgress:v.appleTerminalSetupInProgress??!1,backupPath:v.appleTerminalBackupPath||null}}function x(){return Vv(zv(),"Library","Preferences","com.apple.Terminal.plist")}async function i(){let v=x(),G=`${v}.bak`;try{let{code:$}=await B("defaults",["export","com.apple.Terminal",v]);if($!==0)return null;try{await h(v)}catch{return null}return await B("defaults",["export","com.apple.Terminal",G]),_v(G),G}catch($){return W($),null}}async function t(){let{inProgress:v,backupPath:G}=Iv();if(!v)return{status:"no_backup"};if(!G)return I(),{status:"no_backup"};try{await h(G)}catch{return I(),{status:"no_backup"}}try{let{code:$}=await B("defaults",["import","com.apple.Terminal",G]);if($!==0)return{status:"failed",backupPath:G};return await B("killall",["cfprefsd"]),I(),{status:"restored"}}catch($){return W(Error(`Failed to restore Terminal.app settings with: ${$}`)),I(),{status:"failed",backupPath:G}}}var e=b(()=>{k();C();p()});import $G from"chalk";import{homedir as xv}from"os";import{dirname as JG,join as V}from"path";function Av(){let v=process.env.SHELL||"",G=xv(),$=V(G,".claude");if(v.endsWith("/zsh")||v.endsWith("/zsh.exe")){let J=V($,"completion.zsh");return{name:"zsh",rcFile:V(G,".zshrc"),cacheFile:J,completionLine:`[[ -f "${J}" ]] && source "${J}"`,shellFlag:"zsh"}}if(v.endsWith("/bash")||v.endsWith("/bash.exe")){let J=V($,"completion.bash");return{name:"bash",rcFile:V(G,".bashrc"),cacheFile:J,completionLine:`[ -f "${J}" ] && source "${J}"`,shellFlag:"bash"}}if(v.endsWith("/fish")||v.endsWith("/fish.exe")){let J=process.env.XDG_CONFIG_HOME||V(G,".config"),q=V($,"completion.fish");return{name:"fish",rcFile:V(J,"fish","config.fish"),cacheFile:q,completionLine:`[ -f "${q}" ] && source "${q}"`,shellFlag:"fish"}}return null}async function BG(){let v=Av();if(!v)return;y(`update: Regenerating ${v.name} completion cache`);let G=process.argv[1]||"claude";if((await B(G,["completion",v.shellFlag,"--output",v.cacheFile])).code!==0){y(`update: Failed to regenerate ${v.name} completion cache`);return}y(`update: Regenerated ${v.name} completion cache at ${v.cacheFile}`)}var $v=b(()=>{Sv();Gv();Uv();vv();C();p()});import Z from"chalk";import{randomBytes as f}from"crypto";import{copyFile as c,mkdir as g,readFile as d,writeFile as m}from"fs/promises";import{homedir as s,platform as D}from"os";import{dirname as Ov,join as z}from"path";import{pathToFileURL as jv}from"url";function uv(){let v=process.env.VSCODE_GIT_ASKPASS_MAIN??"",G=process.env.PATH??"";return v.includes(".vscode-server")||v.includes(".cursor-server")||v.includes(".windsurf-server")||G.includes(".vscode-server")||G.includes(".cursor-server")||G.includes(".windsurf-server")}function kG(){if(!Y.terminal||!(Y.terminal in O))return null;return O[Y.terminal]??null}function R(v){if(!E())return v;return`\x1B]8;;${jv(v).href}\x07${v}\x1B]8;;\x07`}function Lv(){return D()==="darwin"&&Y.terminal==="Apple_Terminal"||Y.terminal==="vscode"||Y.terminal==="cursor"||Y.terminal==="windsurf"||Y.terminal==="alacritty"||Y.terminal==="zed"}async function Nv(v){let G="";switch(Y.terminal){case"Apple_Terminal":G=await kv(v);break;case"vscode":G=await P("VSCode",v);break;case"cursor":G=await P("Cursor",v);break;case"windsurf":G=await P("Windsurf",v);break;case"alacritty":G=await pv(v);break;case"zed":G=await Cv(v);break;case null:break}return U(($)=>{if(["vscode","cursor","windsurf","alacritty","zed"].includes(Y.terminal??"")){if($.shiftEnterKeyBindingInstalled===!0)return $;return{...$,shiftEnterKeyBindingInstalled:!0}}else if(Y.terminal==="Apple_Terminal"){if($.optionAsMetaKeyInstalled===!0)return $;return{...$,optionAsMetaKeyInstalled:!0}}return $}),o(),G}function pG(){return S().shiftEnterKeyBindingInstalled===!0}function CG(){return S().hasUsedBackslashReturn===!0}function EG(){if(!S().hasUsedBackslashReturn)U((G)=>({...G,hasUsedBackslashReturn:!0}))}async function PG(v,G,$){if(Y.terminal&&Y.terminal in O){let q=`Shift+Enter is natively supported in ${O[Y.terminal]}.
2
+ import{BQ as w,CQ as Sv,HQ as E,IQ as Gv,fR as Dv}from"./cli-x8xgga1a.js";import{C3 as L,D3 as N,Q3 as k,YT as n,cU as Bv,u3 as U,x3 as S}from"./cli-msmzt4c3.js";import{U3 as Xv,X3 as Yv,Y3 as bv}from"./cli-msw0vv86.js";import{c5 as Qv,g5 as Fv}from"./cli-mb1qrqw1.js";import{G7 as B,I7 as C}from"./cli-p0vh69b9.js";import{L7 as u,M7 as wv}from"./cli-rvad3yhg.js";import{E8 as W,J8 as p}from"./cli-4ewb3q42.js";import{q9 as Y,s9 as yv}from"./cli-jj93qmmc.js";import{$9 as j,b_ as vv,d_ as Jv,e_ as Kv,h_ as Mv,l_ as r,p_ as Zv,v_ as y,y_ as Uv}from"./cli-hke6r0q8.js";import{fda as b}from"./cli-w1d8n9g3.js";import Rv from"lodash-es/memoize.js";import{join as Wv}from"path";function Hv(){let v=r().existsSync(Wv(u(),"CLAUDE.md")),G=n(u());return[{key:"workspace",text:"Ask Claude to create a new app or clone a repository",isComplete:!1,isCompletable:!0,isEnabled:G},{key:"claudemd",text:"Run /init to create an AGENTS.md (or CLAUDE.md) file with instructions for UnieAI Code",isComplete:v,isCompletable:!0,isEnabled:!G}]}function a(){return Hv().filter(({isCompletable:v,isEnabled:G})=>v&&G).every(({isComplete:v})=>v)}function o(){if(L().hasCompletedProjectOnboarding)return;if(a())N((v)=>({...v,hasCompletedProjectOnboarding:!0}))}function rv(){N((v)=>({...v,projectOnboardingSeenCount:v.projectOnboardingSeenCount+1}))}var sv;var l=b(()=>{k();wv();Bv();Zv();sv=Rv(()=>{let v=L();if(v.hasCompletedProjectOnboarding||v.projectOnboardingSeenCount>=4||process.env.IS_DEMO)return!1;return!a()})});import{stat as h}from"fs/promises";import{homedir as zv}from"os";import{join as Vv}from"path";function _v(v){U((G)=>({...G,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:v}))}function I(){U((v)=>({...v,appleTerminalSetupInProgress:!1}))}function Iv(){let v=S();return{inProgress:v.appleTerminalSetupInProgress??!1,backupPath:v.appleTerminalBackupPath||null}}function x(){return Vv(zv(),"Library","Preferences","com.apple.Terminal.plist")}async function i(){let v=x(),G=`${v}.bak`;try{let{code:$}=await B("defaults",["export","com.apple.Terminal",v]);if($!==0)return null;try{await h(v)}catch{return null}return await B("defaults",["export","com.apple.Terminal",G]),_v(G),G}catch($){return W($),null}}async function t(){let{inProgress:v,backupPath:G}=Iv();if(!v)return{status:"no_backup"};if(!G)return I(),{status:"no_backup"};try{await h(G)}catch{return I(),{status:"no_backup"}}try{let{code:$}=await B("defaults",["import","com.apple.Terminal",G]);if($!==0)return{status:"failed",backupPath:G};return await B("killall",["cfprefsd"]),I(),{status:"restored"}}catch($){return W(Error(`Failed to restore Terminal.app settings with: ${$}`)),I(),{status:"failed",backupPath:G}}}var e=b(()=>{k();C();p()});import $G from"chalk";import{homedir as xv}from"os";import{dirname as JG,join as V}from"path";function Av(){let v=process.env.SHELL||"",G=xv(),$=V(G,".claude");if(v.endsWith("/zsh")||v.endsWith("/zsh.exe")){let J=V($,"completion.zsh");return{name:"zsh",rcFile:V(G,".zshrc"),cacheFile:J,completionLine:`[[ -f "${J}" ]] && source "${J}"`,shellFlag:"zsh"}}if(v.endsWith("/bash")||v.endsWith("/bash.exe")){let J=V($,"completion.bash");return{name:"bash",rcFile:V(G,".bashrc"),cacheFile:J,completionLine:`[ -f "${J}" ] && source "${J}"`,shellFlag:"bash"}}if(v.endsWith("/fish")||v.endsWith("/fish.exe")){let J=process.env.XDG_CONFIG_HOME||V(G,".config"),q=V($,"completion.fish");return{name:"fish",rcFile:V(J,"fish","config.fish"),cacheFile:q,completionLine:`[ -f "${q}" ] && source "${q}"`,shellFlag:"fish"}}return null}async function BG(){let v=Av();if(!v)return;y(`update: Regenerating ${v.name} completion cache`);let G=process.argv[1]||"claude";if((await B(G,["completion",v.shellFlag,"--output",v.cacheFile])).code!==0){y(`update: Failed to regenerate ${v.name} completion cache`);return}y(`update: Regenerated ${v.name} completion cache at ${v.cacheFile}`)}var $v=b(()=>{Sv();Gv();Uv();vv();C();p()});import Z from"chalk";import{randomBytes as f}from"crypto";import{copyFile as c,mkdir as g,readFile as d,writeFile as m}from"fs/promises";import{homedir as s,platform as D}from"os";import{dirname as Ov,join as z}from"path";import{pathToFileURL as jv}from"url";function uv(){let v=process.env.VSCODE_GIT_ASKPASS_MAIN??"",G=process.env.PATH??"";return v.includes(".vscode-server")||v.includes(".cursor-server")||v.includes(".windsurf-server")||G.includes(".vscode-server")||G.includes(".cursor-server")||G.includes(".windsurf-server")}function kG(){if(!Y.terminal||!(Y.terminal in O))return null;return O[Y.terminal]??null}function R(v){if(!E())return v;return`\x1B]8;;${jv(v).href}\x07${v}\x1B]8;;\x07`}function Lv(){return D()==="darwin"&&Y.terminal==="Apple_Terminal"||Y.terminal==="vscode"||Y.terminal==="cursor"||Y.terminal==="windsurf"||Y.terminal==="alacritty"||Y.terminal==="zed"}async function Nv(v){let G="";switch(Y.terminal){case"Apple_Terminal":G=await kv(v);break;case"vscode":G=await P("VSCode",v);break;case"cursor":G=await P("Cursor",v);break;case"windsurf":G=await P("Windsurf",v);break;case"alacritty":G=await pv(v);break;case"zed":G=await Cv(v);break;case null:break}return U(($)=>{if(["vscode","cursor","windsurf","alacritty","zed"].includes(Y.terminal??"")){if($.shiftEnterKeyBindingInstalled===!0)return $;return{...$,shiftEnterKeyBindingInstalled:!0}}else if(Y.terminal==="Apple_Terminal"){if($.optionAsMetaKeyInstalled===!0)return $;return{...$,optionAsMetaKeyInstalled:!0}}return $}),o(),G}function pG(){return S().shiftEnterKeyBindingInstalled===!0}function CG(){return S().hasUsedBackslashReturn===!0}function EG(){if(!S().hasUsedBackslashReturn)U((G)=>({...G,hasUsedBackslashReturn:!0}))}async function PG(v,G,$){if(Y.terminal&&Y.terminal in O){let q=`Shift+Enter is natively supported in ${O[Y.terminal]}.
3
3
 
4
4
  No configuration needed. Just use Shift+Enter to add newlines.`;return v(q),null}if(!Lv()){let q=Y.terminal||"your current terminal",K=Qv(),X="";if(K==="macos")X=` \u2022 macOS: Apple Terminal
5
5
  `;else if(K==="windows")X=` \u2022 Windows: Windows Terminal
@@ -32,4 +32,4 @@ chars = "\\u001B\\r"
32
32
  `,await m(q,Q,{encoding:"utf-8"}),`${w("success",v)("Installed Alacritty Shift+Enter key binding")}${T}${w("success",v)("You may need to restart Alacritty for changes to take effect")}${T}${Z.dim(`See ${R(q)}`)}${T}`}catch(Q){throw W(Q),Error("Failed to install Alacritty Shift+Enter key binding")}}async function Cv(v){let G=z(s(),".config","zed"),$=z(G,"keymap.json");try{await g(G,{recursive:!0});let J="[]",q=!1;try{J=await d($,{encoding:"utf-8"}),q=!0}catch(X){if(!j(X))throw X}if(q){if(J.includes("shift-enter"))return`${w("warning",v)("Found existing Zed Shift+Enter key binding. Remove it to continue.")}${T}${Z.dim(`See ${R($)}`)}${T}`;let X=f(4).toString("hex"),Q=`${$}.${X}.bak`;try{await c($,Q)}catch{return`${w("warning",v)("Error backing up existing Zed keymap. Bailing out.")}${T}${Z.dim(`See ${R($)}`)}${T}${Z.dim(`Backup path: ${R(Q)}`)}${T}`}}let K;try{if(K=Kv(J),!Array.isArray(K))K=[]}catch{K=[]}return K.push({context:"Terminal",bindings:{"shift-enter":["terminal::SendText","\x1B\r"]}}),await m($,Jv(K,null,2)+`
33
33
  `,{encoding:"utf-8"}),`${w("success",v)("Installed Zed Shift+Enter key binding")}${T}${Z.dim(`See ${R($)}`)}${T}`}catch(J){throw W(J),Error("Failed to install Zed Shift+Enter key binding")}}var T=`
34
34
  `,O;var Ev=b(()=>{Gv();Dv();l();e();$v();k();yv();vv();C();bv();p();Fv();Mv();O={ghostty:"Ghostty",kitty:"Kitty","iTerm.app":"iTerm2",WezTerm:"WezTerm",WarpTerminal:"Warp"}});
35
- export{Hv as fO,o as gO,sv as hO,rv as iO,l as jO,t as kO,e as lO,BG as mO,$v as nO,kG as oO,Lv as pO,Nv as qO,pG as rO,CG as sO,EG as tO,PG as uO,Ev as vO};
35
+ export{Hv as cO,o as dO,sv as eO,rv as fO,l as gO,t as hO,e as iO,BG as jO,$v as kO,kG as lO,Lv as mO,Nv as nO,pG as oO,CG as pO,EG as qO,PG as rO,Ev as sO};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{bda as H}from"./cli-x514vyva.js";function F(){if(!A)A=new Intl.Segmenter(void 0,{granularity:"grapheme"});return A}function K(b){if(!b)return"";return F().segment(b)[Symbol.iterator]().next().value?.segment??""}function M(b){if(!b)return"";let j="";for(let{segment:q}of F().segment(b))j=q;return j}function N(){if(!B)B=new Intl.Segmenter(void 0,{granularity:"word"});return B}function O(b,j){let q=`${b}:${j}`,z=E.get(q);if(!z)z=new Intl.RelativeTimeFormat("en",{style:b,numeric:j}),E.set(q,z);return z}function P(){if(!D)D=Intl.DateTimeFormat().resolvedOptions().timeZone;return D}var A=null,B=null,E,D=null;var J=H(()=>{E=new Map});
3
- export{F as w6,K as x6,M as y6,N as z6,O as A6,P as B6,J as C6};
2
+ import{fda as H}from"./cli-w1d8n9g3.js";function F(){if(!A)A=new Intl.Segmenter(void 0,{granularity:"grapheme"});return A}function K(b){if(!b)return"";return F().segment(b)[Symbol.iterator]().next().value?.segment??""}function M(b){if(!b)return"";let j="";for(let{segment:q}of F().segment(b))j=q;return j}function N(){if(!B)B=new Intl.Segmenter(void 0,{granularity:"word"});return B}function O(b,j){let q=`${b}:${j}`,z=E.get(q);if(!z)z=new Intl.RelativeTimeFormat("en",{style:b,numeric:j}),E.set(q,z);return z}function P(){if(!D)D=Intl.DateTimeFormat().resolvedOptions().timeZone;return D}var A=null,B=null,E,D=null;var J=H(()=>{E=new Map});
3
+ export{F as A6,K as B6,M as C6,N as D6,O as E6,P as F6,J as G6};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{h_ as R,l_ as O,r_ as Y,u_ as M}from"./cli-a98b285v.js";import{D_ as N,E_ as D,O_ as v}from"./cli-1qszxdan.js";import{bda as H,cda as X}from"./cli-x514vyva.js";import P from"lodash-es/memoize.js";function c(){W.cache.clear?.(),Y("Cleared CA certificates cache")}var W;var I=H(()=>{M();v();O();W=P(()=>{let G=N("--use-system-ca")||N("--use-openssl-ca"),J=process.env.NODE_EXTRA_CA_CERTS;if(Y(`CA certs: useSystemCA=${G}, extraCertsPath=${J}`),!G&&!J)return;let K=X("tls"),Q=[];if(G){let V=K.getCACertificates,Z=V?.("system");if(Z&&Z.length>0)Q.push(...Z),Y(`CA certs: Loaded ${Q.length} system CA certificates (--use-system-ca)`);else if(!V&&!J){Y("CA certs: --use-system-ca set but system CA API unavailable, deferring to runtime");return}else Q.push(...K.rootCertificates),Y(`CA certs: Loaded ${Q.length} bundled root certificates as base (--use-system-ca fallback)`)}else Q.push(...K.rootCertificates),Y(`CA certs: Loaded ${Q.length} bundled root certificates as base`);if(J)try{let V=R().readFileSync(J,{encoding:"utf8"});Q.push(V),Y(`CA certs: Appended extra certificates from NODE_EXTRA_CA_CERTS (${J})`)}catch(V){Y(`CA certs: Failed to read NODE_EXTRA_CA_CERTS file (${J}): ${V}`,{level:"error"})}return Q.length>0?Q:void 0})});import{Agent as d}from"https";import S from"lodash-es/memoize.js";function r(){let G=q(),J=W();if(!G&&!J)return;return{...G,...J&&{ca:J}}}function _(){let G=q(),J=W();if(!G&&!J)return{};let K={...G,...J&&{ca:J}};if(typeof Bun<"u")return{tls:K};return Y("TLS: Created undici agent with custom certificates"),{dispatcher:new(X("undici")).Agent({connect:{cert:K.cert,key:K.key,passphrase:K.passphrase,...K.ca&&{ca:K.ca}},pipelining:1})}}function o(){q.cache.clear?.(),z.cache.clear?.(),Y("Cleared mTLS configuration cache")}function e(){if(!q())return;if(process.env.NODE_EXTRA_CA_CERTS)Y("NODE_EXTRA_CA_CERTS detected - Node.js will automatically append to built-in CAs")}var q,z;var U=H(()=>{I();M();O();q=S(()=>{let G={};if(process.env.CLAUDE_CODE_CLIENT_CERT)try{G.cert=R().readFileSync(process.env.CLAUDE_CODE_CLIENT_CERT,{encoding:"utf8"}),Y("mTLS: Loaded client certificate from CLAUDE_CODE_CLIENT_CERT")}catch(J){Y(`mTLS: Failed to load client certificate: ${J}`,{level:"error"})}if(process.env.CLAUDE_CODE_CLIENT_KEY)try{G.key=R().readFileSync(process.env.CLAUDE_CODE_CLIENT_KEY,{encoding:"utf8"}),Y("mTLS: Loaded client key from CLAUDE_CODE_CLIENT_KEY")}catch(J){Y(`mTLS: Failed to load client key: ${J}`,{level:"error"})}if(process.env.CLAUDE_CODE_CLIENT_KEY_PASSPHRASE)G.passphrase=process.env.CLAUDE_CODE_CLIENT_KEY_PASSPHRASE,Y("mTLS: Using client key passphrase");if(Object.keys(G).length===0)return;return G}),z=S(()=>{let G=q(),J=W();if(!G&&!J)return;let K={...G,...J&&{ca:J},keepAlive:!0};return Y("mTLS: Creating HTTPS agent with custom certificates"),new d(K)})});import w from"axios";import{HttpsProxyAgent as h}from"https-proxy-agent";import A from"lodash-es/memoize.js";function $G(){F=!0}function u(G){switch(G.family){case 0:case 4:case 6:return G.family;case"IPv6":return 6;case"IPv4":case void 0:return 4;default:throw Error(`Unsupported address family: ${G.family}`)}}function B(G=process.env){return G.https_proxy||G.HTTPS_PROXY||G.http_proxy||G.HTTP_PROXY}function m(G=process.env){return G.no_proxy||G.NO_PROXY}function E(G,J=m()){if(!J)return!1;if(J==="*")return!0;try{let K=new URL(G),Q=K.hostname.toLowerCase(),V=K.port||(K.protocol==="https:"?"443":"80"),Z=`${Q}:${V}`;return J.split(/[,\s]+/).filter(Boolean).some(($)=>{if($=$.toLowerCase().trim(),$.includes(":"))return Z===$;if($.startsWith(".")){let b=$;return Q===$.substring(1)||Q.endsWith(b)}return Q===$})}catch{return!1}}function j(G,J={}){let K=q(),Q=W(),V={...K&&{cert:K.cert,key:K.key,passphrase:K.passphrase},...Q&&{ca:Q}};if(D(process.env.CLAUDE_CODE_PROXY_RESOLVES_HOSTS))V.lookup=(Z,T,$)=>{$(null,Z,u(T))};return new h(G,{...V,...J})}function WG(G={}){let J=B(),K=z(),Q=w.create({proxy:!1});if(!J){if(K)Q.defaults.httpsAgent=K;return Q}let V=j(J,G);return Q.interceptors.request.use((Z)=>{if(Z.url&&E(Z.url))Z.httpsAgent=K,Z.httpAgent=K;else Z.httpsAgent=V,Z.httpAgent=V;return Z}),Q}function qG(G){let J=B();if(!J)return;if(E(G))return;return j(J)}function wG(G){let J=B();if(!J)return;if(E(G))return;return J}function XG(G){let J=F?{keepalive:!1}:{};if(G?.forAnthropicAPI){let Q=process.env.ANTHROPIC_UNIX_SOCKET;if(Q&&typeof Bun<"u")return{...J,unix:Q}}let K=G?.proxyUrl!==void 0?G.proxyUrl||void 0:B();if(K){if(typeof Bun<"u")return{...J,proxy:K,..._()};return{...J,dispatcher:L(K)}}return{...J,..._()}}function BG(){let G=B(),J=z();if(k!==void 0)w.interceptors.request.eject(k),k=void 0;if(w.defaults.proxy=void 0,w.defaults.httpAgent=void 0,w.defaults.httpsAgent=void 0,G){w.defaults.proxy=!1;let K=j(G);k=w.interceptors.request.use((Q)=>{if(Q.url&&E(Q.url))if(J)Q.httpsAgent=J,Q.httpAgent=J;else delete Q.httpsAgent,delete Q.httpAgent;else Q.httpsAgent=K,Q.httpAgent=K;return Q}),X("undici").setGlobalDispatcher(L(G))}else if(J){w.defaults.httpsAgent=J;let K=_();if(K.dispatcher)X("undici").setGlobalDispatcher(K.dispatcher)}}async function RG(){let G=B();if(!G)return{};let[{NodeHttpHandler:J},{defaultProvider:K}]=await Promise.all([import("@smithy/node-http-handler"),import("@aws-sdk/credential-provider-node")]),Q=j(G),V=new J({httpAgent:Q,httpsAgent:Q});return{requestHandler:V,credentials:K({clientConfig:{requestHandler:V}})}}function zG(){L.cache.clear?.(),Y("Cleared proxy agent cache")}var F=!1,L,k;var y=H(()=>{I();M();v();U();L=A((G)=>{let J=X("undici"),K=q(),Q=W(),V={httpProxy:G,httpsProxy:G,noProxy:process.env.NO_PROXY||process.env.no_proxy};if(K||Q){let Z={...K&&{cert:K.cert,key:K.key,passphrase:K.passphrase},...Q&&{ca:Q}};V.connect=Z,V.requestTls=Z}return new J.EnvHttpProxyAgent(V)})});
3
- export{W as p5,c as q5,I as r5,q as s5,r as t5,o as u5,e as v5,U as w5,$G as x5,B as y5,E as z5,WG as A5,qG as B5,wG as C5,XG as D5,BG as E5,RG as F5,zG as G5,y as H5};
2
+ import{l_ as R,p_ as O,v_ as Y,y_ as M}from"./cli-hke6r0q8.js";import{H_ as N,I_ as D,S_ as v}from"./cli-tq5z9qv3.js";import{fda as H,gda as X}from"./cli-w1d8n9g3.js";import P from"lodash-es/memoize.js";function c(){W.cache.clear?.(),Y("Cleared CA certificates cache")}var W;var I=H(()=>{M();v();O();W=P(()=>{let G=N("--use-system-ca")||N("--use-openssl-ca"),J=process.env.NODE_EXTRA_CA_CERTS;if(Y(`CA certs: useSystemCA=${G}, extraCertsPath=${J}`),!G&&!J)return;let K=X("tls"),Q=[];if(G){let V=K.getCACertificates,Z=V?.("system");if(Z&&Z.length>0)Q.push(...Z),Y(`CA certs: Loaded ${Q.length} system CA certificates (--use-system-ca)`);else if(!V&&!J){Y("CA certs: --use-system-ca set but system CA API unavailable, deferring to runtime");return}else Q.push(...K.rootCertificates),Y(`CA certs: Loaded ${Q.length} bundled root certificates as base (--use-system-ca fallback)`)}else Q.push(...K.rootCertificates),Y(`CA certs: Loaded ${Q.length} bundled root certificates as base`);if(J)try{let V=R().readFileSync(J,{encoding:"utf8"});Q.push(V),Y(`CA certs: Appended extra certificates from NODE_EXTRA_CA_CERTS (${J})`)}catch(V){Y(`CA certs: Failed to read NODE_EXTRA_CA_CERTS file (${J}): ${V}`,{level:"error"})}return Q.length>0?Q:void 0})});import{Agent as d}from"https";import S from"lodash-es/memoize.js";function r(){let G=q(),J=W();if(!G&&!J)return;return{...G,...J&&{ca:J}}}function _(){let G=q(),J=W();if(!G&&!J)return{};let K={...G,...J&&{ca:J}};if(typeof Bun<"u")return{tls:K};return Y("TLS: Created undici agent with custom certificates"),{dispatcher:new(X("undici")).Agent({connect:{cert:K.cert,key:K.key,passphrase:K.passphrase,...K.ca&&{ca:K.ca}},pipelining:1})}}function o(){q.cache.clear?.(),z.cache.clear?.(),Y("Cleared mTLS configuration cache")}function e(){if(!q())return;if(process.env.NODE_EXTRA_CA_CERTS)Y("NODE_EXTRA_CA_CERTS detected - Node.js will automatically append to built-in CAs")}var q,z;var U=H(()=>{I();M();O();q=S(()=>{let G={};if(process.env.CLAUDE_CODE_CLIENT_CERT)try{G.cert=R().readFileSync(process.env.CLAUDE_CODE_CLIENT_CERT,{encoding:"utf8"}),Y("mTLS: Loaded client certificate from CLAUDE_CODE_CLIENT_CERT")}catch(J){Y(`mTLS: Failed to load client certificate: ${J}`,{level:"error"})}if(process.env.CLAUDE_CODE_CLIENT_KEY)try{G.key=R().readFileSync(process.env.CLAUDE_CODE_CLIENT_KEY,{encoding:"utf8"}),Y("mTLS: Loaded client key from CLAUDE_CODE_CLIENT_KEY")}catch(J){Y(`mTLS: Failed to load client key: ${J}`,{level:"error"})}if(process.env.CLAUDE_CODE_CLIENT_KEY_PASSPHRASE)G.passphrase=process.env.CLAUDE_CODE_CLIENT_KEY_PASSPHRASE,Y("mTLS: Using client key passphrase");if(Object.keys(G).length===0)return;return G}),z=S(()=>{let G=q(),J=W();if(!G&&!J)return;let K={...G,...J&&{ca:J},keepAlive:!0};return Y("mTLS: Creating HTTPS agent with custom certificates"),new d(K)})});import w from"axios";import{HttpsProxyAgent as h}from"https-proxy-agent";import A from"lodash-es/memoize.js";function $G(){F=!0}function u(G){switch(G.family){case 0:case 4:case 6:return G.family;case"IPv6":return 6;case"IPv4":case void 0:return 4;default:throw Error(`Unsupported address family: ${G.family}`)}}function B(G=process.env){return G.https_proxy||G.HTTPS_PROXY||G.http_proxy||G.HTTP_PROXY}function m(G=process.env){return G.no_proxy||G.NO_PROXY}function E(G,J=m()){if(!J)return!1;if(J==="*")return!0;try{let K=new URL(G),Q=K.hostname.toLowerCase(),V=K.port||(K.protocol==="https:"?"443":"80"),Z=`${Q}:${V}`;return J.split(/[,\s]+/).filter(Boolean).some(($)=>{if($=$.toLowerCase().trim(),$.includes(":"))return Z===$;if($.startsWith(".")){let b=$;return Q===$.substring(1)||Q.endsWith(b)}return Q===$})}catch{return!1}}function j(G,J={}){let K=q(),Q=W(),V={...K&&{cert:K.cert,key:K.key,passphrase:K.passphrase},...Q&&{ca:Q}};if(D(process.env.CLAUDE_CODE_PROXY_RESOLVES_HOSTS))V.lookup=(Z,T,$)=>{$(null,Z,u(T))};return new h(G,{...V,...J})}function WG(G={}){let J=B(),K=z(),Q=w.create({proxy:!1});if(!J){if(K)Q.defaults.httpsAgent=K;return Q}let V=j(J,G);return Q.interceptors.request.use((Z)=>{if(Z.url&&E(Z.url))Z.httpsAgent=K,Z.httpAgent=K;else Z.httpsAgent=V,Z.httpAgent=V;return Z}),Q}function qG(G){let J=B();if(!J)return;if(E(G))return;return j(J)}function wG(G){let J=B();if(!J)return;if(E(G))return;return J}function XG(G){let J=F?{keepalive:!1}:{};if(G?.forAnthropicAPI){let Q=process.env.ANTHROPIC_UNIX_SOCKET;if(Q&&typeof Bun<"u")return{...J,unix:Q}}let K=G?.proxyUrl!==void 0?G.proxyUrl||void 0:B();if(K){if(typeof Bun<"u")return{...J,proxy:K,..._()};return{...J,dispatcher:L(K)}}return{...J,..._()}}function BG(){let G=B(),J=z();if(k!==void 0)w.interceptors.request.eject(k),k=void 0;if(w.defaults.proxy=void 0,w.defaults.httpAgent=void 0,w.defaults.httpsAgent=void 0,G){w.defaults.proxy=!1;let K=j(G);k=w.interceptors.request.use((Q)=>{if(Q.url&&E(Q.url))if(J)Q.httpsAgent=J,Q.httpAgent=J;else delete Q.httpsAgent,delete Q.httpAgent;else Q.httpsAgent=K,Q.httpAgent=K;return Q}),X("undici").setGlobalDispatcher(L(G))}else if(J){w.defaults.httpsAgent=J;let K=_();if(K.dispatcher)X("undici").setGlobalDispatcher(K.dispatcher)}}async function RG(){let G=B();if(!G)return{};let[{NodeHttpHandler:J},{defaultProvider:K}]=await Promise.all([import("@smithy/node-http-handler"),import("@aws-sdk/credential-provider-node")]),Q=j(G),V=new J({httpAgent:Q,httpsAgent:Q});return{requestHandler:V,credentials:K({clientConfig:{requestHandler:V}})}}function zG(){L.cache.clear?.(),Y("Cleared proxy agent cache")}var F=!1,L,k;var y=H(()=>{I();M();v();U();L=A((G)=>{let J=X("undici"),K=q(),Q=W(),V={httpProxy:G,httpsProxy:G,noProxy:process.env.NO_PROXY||process.env.no_proxy};if(K||Q){let Z={...K&&{cert:K.cert,key:K.key,passphrase:K.passphrase},...Q&&{ca:Q}};V.connect=Z,V.requestTls=Z}return new J.EnvHttpProxyAgent(V)})});
3
+ export{W as h5,c as i5,I as j5,q as k5,r as l5,o as m5,e as n5,U as o5,$G as p5,B as q5,E as r5,WG as s5,qG as t5,wG as u5,XG as v5,BG as w5,RG as x5,zG as y5,y as z5};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{fda as c}from"./cli-w1d8n9g3.js";function n(t){let e;return()=>e??=t()}var o=()=>{};
3
+ export{n as $4,o as a5};
@@ -1,10 +1,10 @@
1
1
  // @bun
2
- import{y7 as m,z7 as oJ}from"./cli-ewts4g0p.js";import{C7 as X,E7 as rJ}from"./cli-hpzy0mat.js";import{B8 as nJ,w8 as EJ}from"./cli-3bxtq5dc.js";import{I8 as k,J8 as e}from"./cli-mx6xk0dw.js";import{A9 as jJ,B9 as iJ}from"./cli-d58ptbve.js";import{$9 as l,G9 as t,I9 as DJ,d_ as GJ,h_ as R,l_ as s,r_ as O,u_ as aJ}from"./cli-a98b285v.js";import{Zca as pJ,iaa as i}from"./cli-w754xmyv.js";import{bda as v,cda as sJ}from"./cli-x514vyva.js";function h(J){let $=J.slice(J.lastIndexOf(".")).toLowerCase();return kJ.has($)}function g(J){let $=Math.min(J.length,IJ),q=0;for(let K=0;K<$;K++){let Q=J[K];if(Q===0)return!0;if(Q<32&&Q!==9&&Q!==10&&Q!==13)q++}return q/$>0.1}var kJ,IJ=8192;var c=v(()=>{kJ=new Set([".png",".jpg",".jpeg",".gif",".bmp",".ico",".webp",".tiff",".tif",".mp4",".mov",".avi",".mkv",".webm",".wmv",".flv",".m4v",".mpeg",".mpg",".mp3",".wav",".ogg",".flac",".aac",".m4a",".wma",".aiff",".opus",".zip",".tar",".gz",".bz2",".7z",".rar",".xz",".z",".tgz",".iso",".exe",".dll",".so",".dylib",".bin",".o",".a",".obj",".lib",".app",".msi",".deb",".rpm",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odt",".ods",".odp",".ttf",".otf",".woff",".woff2",".eot",".pyc",".pyo",".class",".jar",".war",".ear",".node",".wasm",".rlib",".sqlite",".sqlite3",".db",".mdb",".idx",".psd",".ai",".eps",".sketch",".fig",".xd",".blend",".3ds",".max",".swf",".fla",".lockb",".dat",".data"])});import{dirname as bJ}from"path";function U(J,$,q){let K=yJ();if(!K)return;let Q={timestamp:new Date().toISOString(),level:J,event:$,data:q??{}},Y=R(),Z=l(Q)+`
2
+ import{C7 as m,D7 as oJ}from"./cli-mzcsnm06.js";import{G7 as X,I7 as rJ}from"./cli-p0vh69b9.js";import{L7 as k,M7 as e}from"./cli-rvad3yhg.js";import{E8 as EJ,J8 as nJ}from"./cli-4ewb3q42.js";import{E9 as jJ,F9 as iJ}from"./cli-xpa1neza.js";import{K9 as t,M9 as DJ,d_ as l,h_ as GJ,l_ as R,p_ as s,v_ as O,y_ as aJ}from"./cli-hke6r0q8.js";import{bda as pJ,maa as i}from"./cli-3ac555qw.js";import{fda as v,gda as sJ}from"./cli-w1d8n9g3.js";function h(J){let $=J.slice(J.lastIndexOf(".")).toLowerCase();return kJ.has($)}function g(J){let $=Math.min(J.length,IJ),q=0;for(let K=0;K<$;K++){let Q=J[K];if(Q===0)return!0;if(Q<32&&Q!==9&&Q!==10&&Q!==13)q++}return q/$>0.1}var kJ,IJ=8192;var c=v(()=>{kJ=new Set([".png",".jpg",".jpeg",".gif",".bmp",".ico",".webp",".tiff",".tif",".mp4",".mov",".avi",".mkv",".webm",".wmv",".flv",".m4v",".mpeg",".mpg",".mp3",".wav",".ogg",".flac",".aac",".m4a",".wma",".aiff",".opus",".zip",".tar",".gz",".bz2",".7z",".rar",".xz",".z",".tgz",".iso",".exe",".dll",".so",".dylib",".bin",".o",".a",".obj",".lib",".app",".msi",".deb",".rpm",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odt",".ods",".odp",".ttf",".otf",".woff",".woff2",".eot",".pyc",".pyo",".class",".jar",".war",".ear",".node",".wasm",".rlib",".sqlite",".sqlite3",".db",".mdb",".idx",".psd",".ai",".eps",".sketch",".fig",".xd",".blend",".3ds",".max",".swf",".fla",".lockb",".dat",".data"])});import{dirname as bJ}from"path";function U(J,$,q){let K=yJ();if(!K)return;let Q={timestamp:new Date().toISOString(),level:J,event:$,data:q??{}},Y=R(),Z=l(Q)+`
3
3
  `;try{Y.appendFileSync(K,Z)}catch{try{Y.mkdirSync(bJ(K)),Y.appendFileSync(K,Z)}catch{}}}function yJ(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function T2(J,$,q){let K=Date.now();U("info",`${J}_started`);try{let Q=await $(),Y=q?q(Q):{};return U("info",`${J}_completed`,{duration_ms:Date.now()-K,...Y}),Q}catch(Q){throw U("error",`${J}_failed`,{duration_ms:Date.now()-K}),Q}}var a=v(()=>{s();GJ()});import{readFile as vJ}from"fs/promises";import{join as CJ}from"path";async function C(J,$,q,K){try{let Q=await vJ(CJ(J,"config"),"utf-8");return SJ(Q,$,q,K)}catch{return null}}function SJ(J,$,q,K){let Q=J.split(`
4
4
  `),Y=$.toLowerCase(),Z=K.toLowerCase(),A=!1;for(let W of Q){let H=W.trim();if(H.length===0||H[0]==="#"||H[0]===";")continue;if(H[0]==="["){A=wJ(H,Y,q);continue}if(!A)continue;let _=RJ(H);if(_&&_.key.toLowerCase()===Z)return _.value}return null}function RJ(J){let $=0;while($<J.length&&FJ(J[$]))$++;if($===0)return null;let q=J.slice(0,$);while($<J.length&&(J[$]===" "||J[$]==="\t"))$++;if($>=J.length||J[$]!=="=")return null;$++;while($<J.length&&(J[$]===" "||J[$]==="\t"))$++;let K=PJ(J,$);return{key:q,value:K}}function PJ(J,$){let q="",K=!1,Q=$;while(Q<J.length){let Y=J[Q];if(!K&&(Y==="#"||Y===";"))break;if(Y==='"'){K=!K,Q++;continue}if(Y==="\\"&&Q+1<J.length){let Z=J[Q+1];if(K){switch(Z){case"n":q+=`
5
5
  `;break;case"t":q+="\t";break;case"b":q+="\b";break;case'"':q+='"';break;case"\\":q+="\\";break;default:q+=Z;break}Q+=2;continue}if(Z==="\\"){q+="\\",Q+=2;continue}}q+=Y,Q++}if(!K)q=xJ(q);return q}function xJ(J){let $=J.length;while($>0&&(J[$-1]===" "||J[$-1]==="\t"))$--;return J.slice(0,$)}function wJ(J,$,q){let K=1;while(K<J.length&&J[K]!=="]"&&J[K]!==" "&&J[K]!=="\t"&&J[K]!=='"')K++;if(J.slice(1,K).toLowerCase()!==$)return!1;if(q===null)return K<J.length&&J[K]==="]";while(K<J.length&&(J[K]===" "||J[K]==="\t"))K++;if(K>=J.length||J[K]!=='"')return!1;K++;let Y="";while(K<J.length&&J[K]!=='"'){if(J[K]==="\\"&&K+1<J.length){let Z=J[K+1];if(Z==="\\"||Z==='"'){Y+=Z,K+=2;continue}Y+=Z,K+=2;continue}Y+=J[K],K++}if(K>=J.length||J[K]!=='"')return!1;if(K++,K>=J.length||J[K]!=="]")return!1;return Y===q}function FJ(J){return J>="a"&&J<="z"||J>="A"&&J<="Z"||J>="0"&&J<="9"||J==="-"}var n=()=>{};import{unwatchFile as o,watchFile as fJ}from"fs";import{readdir as uJ,readFile as j,stat as JJ}from"fs/promises";import{join as L,resolve as P}from"path";function w2(){N.clear()}async function z(J){let $=P(J??k()),q=N.get($);if(q!==void 0)return q;let K=G($);if(!K)return N.set($,null),null;let Q=L(K,".git");try{if((await JJ(Q)).isFile()){let Z=(await j(Q,"utf-8")).trim();if(Z.startsWith("gitdir:")){let A=Z.slice(7).trim(),W=P(K,A);return N.set($,W),W}}return N.set($,Q),Q}catch{return N.set($,null),null}}function x(J){if(!J||J.startsWith("-")||J.startsWith("/"))return!1;if(J.includes(".."))return!1;if(J.split("/").some(($)=>$==="."||$===""))return!1;if(!/^[a-zA-Z0-9/._+@-]+$/.test(J))return!1;return!0}function D(J){return/^[0-9a-f]{40}$/.test(J)||/^[0-9a-f]{64}$/.test(J)}async function S(J){try{let $=(await j(L(J,"HEAD"),"utf-8")).trim();if($.startsWith("ref:")){let q=$.slice(4).trim();if(q.startsWith("refs/heads/")){let Q=q.slice(11);if(!x(Q))return null;return{type:"branch",name:Q}}if(!x(q))return null;let K=await I(J,q);return K?{type:"detached",sha:K}:{type:"detached",sha:""}}if(!D($))return null;return{type:"detached",sha:$}}catch{return null}}async function I(J,$){let q=await r(J,$);if(q)return q;let K=await T(J);if(K&&K!==J)return r(K,$);return null}async function r(J,$){try{let q=(await j(L(J,$),"utf-8")).trim();if(q.startsWith("ref:")){let K=q.slice(4).trim();if(!x(K))return null;return I(J,K)}if(!D(q))return null;return q}catch{}try{let q=await j(L(J,"packed-refs"),"utf-8");for(let K of q.split(`
6
- `)){if(K.startsWith("#")||K.startsWith("^"))continue;let Q=K.indexOf(" ");if(Q===-1)continue;if(K.slice(Q+1)===$){let Y=K.slice(0,Q);return D(Y)?Y:null}}}catch{}return null}async function T(J){try{let $=(await j(L(J,"commondir"),"utf-8")).trim();return P(J,$)}catch{return null}}async function mJ(J,$,q){try{let K=(await j(L(J,$),"utf-8")).trim();if(K.startsWith("ref:")){let Q=K.slice(4).trim();if(Q.startsWith(q)){let Y=Q.slice(q.length);if(!x(Y))return null;return Y}}}catch{}return null}class $J{gitDir=null;commonDir=null;initialized=!1;initPromise=null;watchedPaths=[];branchRefPath=null;cache=new Map;async ensureStarted(){if(this.initialized)return;if(this.initPromise)return this.initPromise;return this.initPromise=this.start(),this.initPromise}async start(){if(this.gitDir=await z(),this.initialized=!0,!this.gitDir)return;this.commonDir=await T(this.gitDir),this.watchPath(L(this.gitDir,"HEAD"),()=>{this.onHeadChanged()}),this.watchPath(L(this.commonDir??this.gitDir,"config"),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),t(async()=>{this.stopWatching()})}watchPath(J,$){this.watchedPaths.push(J),fJ(J,{interval:dJ},$)}async watchCurrentBranchRef(){if(!this.gitDir)return;let J=await S(this.gitDir),$=this.commonDir??this.gitDir,q=J?.type==="branch"?L($,"refs","heads",J.name):null;if(q===this.branchRefPath)return;if(this.branchRefPath)o(this.branchRefPath),this.watchedPaths=this.watchedPaths.filter((K)=>K!==this.branchRefPath);if(this.branchRefPath=q,!q)return;this.watchPath(q,()=>{this.invalidate()})}async onHeadChanged(){this.invalidate(),await i(),await this.watchCurrentBranchRef()}invalidate(){for(let J of this.cache.values())J.dirty=!0}stopWatching(){for(let J of this.watchedPaths)o(J);this.watchedPaths=[],this.branchRefPath=null}async get(J,$){await this.ensureStarted();let q=this.cache.get(J);if(q&&!q.dirty)return q.value;if(q)q.dirty=!1;let K=await $(),Q=this.cache.get(J);if(Q&&!Q.dirty)Q.value=K;if(!Q)this.cache.set(J,{value:K,dirty:!1,compute:$});return K}reset(){this.stopWatching(),this.cache.clear(),this.initialized=!1,this.initPromise=null,this.gitDir=null,this.commonDir=null}}async function hJ(){let J=await z();if(!J)return"HEAD";let $=await S(J);if(!$)return"HEAD";return $.type==="branch"?$.name:"HEAD"}async function gJ(){let J=await z();if(!J)return"";let $=await S(J);if(!$)return"";if($.type==="branch")return await I(J,`refs/heads/${$.name}`)??"";return $.sha}async function cJ(){let J=await z();if(!J)return null;let $=await C(J,"remote","origin","url");if($)return $;let q=await T(J);if(q&&q!==J)return C(q,"remote","origin","url");return null}async function lJ(){let J=await z();if(!J)return"main";let $=await T(J)??J,q=await mJ($,"refs/remotes/origin/HEAD","refs/remotes/origin/");if(q)return q;for(let K of["main","master"])if(await I($,`refs/remotes/origin/${K}`))return K;return"main"}function qJ(){return w.get("branch",hJ)}function KJ(){return w.get("head",gJ)}function QJ(){return w.get("remoteUrl",cJ)}function YJ(){return w.get("defaultBranch",lJ)}async function F2(J){let $=await z(J);if(!$)return null;let q=await S($);if(!q)return null;if(q.type==="branch")return I($,`refs/heads/${q.name}`);return q.sha}async function p2(J){let $;try{let K=(await j(L(J,".git"),"utf-8")).trim();if(!K.startsWith("gitdir:"))return null;$=P(J,K.slice(7).trim())}catch{return null}let q=await S($);if(!q)return null;if(q.type==="branch")return I($,`refs/heads/${q.name}`);return q.sha}async function D2(J){let $=await z(J);if(!$)return null;let q=await C($,"remote","origin","url");if(q)return q;let K=await T($);if(K&&K!==$)return C(K,"remote","origin","url");return null}async function ZJ(){let J=await z();if(!J)return!1;let $=await T(J)??J;try{return await JJ(L($,"shallow")),!0}catch{return!1}}async function XJ(){try{let J=await z();if(!J)return 0;let $=await T(J)??J;return(await uJ(L($,"worktrees"))).length+1}catch{return 1}}var N,dJ=1000,w;var VJ=v(()=>{pJ();DJ();e();AJ();n();N=new Map;w=new $J});import{createHash as tJ}from"crypto";import{readFileSync as f,realpathSync as WJ,statSync as HJ}from"fs";import{open as eJ,readFile as J2,realpath as LJ,stat as $2}from"fs/promises";import TJ from"lodash-es/memoize.js";import{basename as q2,dirname as u,join as M,resolve as p,sep as MJ}from"path";function K2(){function J($){let q=zJ($);return q===NJ?null:q}return J.cache=zJ.cache,J}function Q2(){function J($){let q=G($);if(!q)return null;return OJ(q)}return J.cache=OJ.cache,J}function $3(J){return z(J)}async function q3(){let J=k(),$=G(J);if(!$)return!1;try{let[q,K]=await Promise.all([LJ(J),LJ($)]);return q===K}catch{return J===$}}function V2(J){let $=J.trim();if(!$)return null;let q=$.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(q&&q[1]&&q[2])return`${q[1]}/${q[2]}`.toLowerCase();let K=$.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);if(K&&K[1]&&K[2]){let Q=K[1],Y=K[2];if(U2(Q)&&Y.startsWith("git/")){let Z=Y.slice(4),A=Z.split("/");if(A.length>=3&&A[0].includes("."))return Z.toLowerCase();return`github.com/${Z}`.toLowerCase()}return`${Q}/${Y}`.toLowerCase()}return null}async function Y3(){let J=await d();if(!J)return null;let $=V2(J);if(!$)return null;return tJ("sha256").update($).digest("hex").substring(0,16)}async function A3(){try{let[J,$,q,K,Q,Y]=await Promise.all([Z2(),X2(),d(),A2(),W2(),L2()]);return{commitHash:J,branchName:$,remoteUrl:q,isHeadOnRemote:K,isClean:Q,worktreeCount:Y}}catch(J){return null}}async function W3(){let{parseGitRemote:J}=await import("./detectRepository-djxyq37h.js"),$=await d();if(!$)return O("Local GitHub repo: unknown"),null;let q=J($);if(q&&q.host==="github.com"){let K=`${q.owner}/${q.name}`;return O(`Local GitHub repo: ${K}`),K}return O("Local GitHub repo: unknown"),null}async function z2(){let{stdout:J,code:$}=await X(V(),["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"],{preserveOutputOnError:!1});if($===0&&J.trim())return J.trim();let{stdout:q,code:K}=await X(V(),["remote","show","origin","--","HEAD"],{preserveOutputOnError:!1});if(K===0){let Y=q.match(/HEAD branch: (\S+)/);if(Y&&Y[1])return`origin/${Y[1]}`}let Q=["origin/main","origin/staging","origin/master"];for(let Y of Q){let{code:Z}=await X(V(),["rev-parse","--verify",Y],{preserveOutputOnError:!1});if(Z===0)return Y}return null}function O2(){return ZJ()}async function F(){let{stdout:J,code:$}=await X(V(),["ls-files","--others","--exclude-standard"],{preserveOutputOnError:!1}),q=J.trim();if($!==0||!q)return[];let K=q.split(`
6
+ `)){if(K.startsWith("#")||K.startsWith("^"))continue;let Q=K.indexOf(" ");if(Q===-1)continue;if(K.slice(Q+1)===$){let Y=K.slice(0,Q);return D(Y)?Y:null}}}catch{}return null}async function T(J){try{let $=(await j(L(J,"commondir"),"utf-8")).trim();return P(J,$)}catch{return null}}async function mJ(J,$,q){try{let K=(await j(L(J,$),"utf-8")).trim();if(K.startsWith("ref:")){let Q=K.slice(4).trim();if(Q.startsWith(q)){let Y=Q.slice(q.length);if(!x(Y))return null;return Y}}}catch{}return null}class $J{gitDir=null;commonDir=null;initialized=!1;initPromise=null;watchedPaths=[];branchRefPath=null;cache=new Map;async ensureStarted(){if(this.initialized)return;if(this.initPromise)return this.initPromise;return this.initPromise=this.start(),this.initPromise}async start(){if(this.gitDir=await z(),this.initialized=!0,!this.gitDir)return;this.commonDir=await T(this.gitDir),this.watchPath(L(this.gitDir,"HEAD"),()=>{this.onHeadChanged()}),this.watchPath(L(this.commonDir??this.gitDir,"config"),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),t(async()=>{this.stopWatching()})}watchPath(J,$){this.watchedPaths.push(J),fJ(J,{interval:dJ},$)}async watchCurrentBranchRef(){if(!this.gitDir)return;let J=await S(this.gitDir),$=this.commonDir??this.gitDir,q=J?.type==="branch"?L($,"refs","heads",J.name):null;if(q===this.branchRefPath)return;if(this.branchRefPath)o(this.branchRefPath),this.watchedPaths=this.watchedPaths.filter((K)=>K!==this.branchRefPath);if(this.branchRefPath=q,!q)return;this.watchPath(q,()=>{this.invalidate()})}async onHeadChanged(){this.invalidate(),await i(),await this.watchCurrentBranchRef()}invalidate(){for(let J of this.cache.values())J.dirty=!0}stopWatching(){for(let J of this.watchedPaths)o(J);this.watchedPaths=[],this.branchRefPath=null}async get(J,$){await this.ensureStarted();let q=this.cache.get(J);if(q&&!q.dirty)return q.value;if(q)q.dirty=!1;let K=await $(),Q=this.cache.get(J);if(Q&&!Q.dirty)Q.value=K;if(!Q)this.cache.set(J,{value:K,dirty:!1,compute:$});return K}reset(){this.stopWatching(),this.cache.clear(),this.initialized=!1,this.initPromise=null,this.gitDir=null,this.commonDir=null}}async function hJ(){let J=await z();if(!J)return"HEAD";let $=await S(J);if(!$)return"HEAD";return $.type==="branch"?$.name:"HEAD"}async function gJ(){let J=await z();if(!J)return"";let $=await S(J);if(!$)return"";if($.type==="branch")return await I(J,`refs/heads/${$.name}`)??"";return $.sha}async function cJ(){let J=await z();if(!J)return null;let $=await C(J,"remote","origin","url");if($)return $;let q=await T(J);if(q&&q!==J)return C(q,"remote","origin","url");return null}async function lJ(){let J=await z();if(!J)return"main";let $=await T(J)??J,q=await mJ($,"refs/remotes/origin/HEAD","refs/remotes/origin/");if(q)return q;for(let K of["main","master"])if(await I($,`refs/remotes/origin/${K}`))return K;return"main"}function qJ(){return w.get("branch",hJ)}function KJ(){return w.get("head",gJ)}function QJ(){return w.get("remoteUrl",cJ)}function YJ(){return w.get("defaultBranch",lJ)}async function F2(J){let $=await z(J);if(!$)return null;let q=await S($);if(!q)return null;if(q.type==="branch")return I($,`refs/heads/${q.name}`);return q.sha}async function p2(J){let $;try{let K=(await j(L(J,".git"),"utf-8")).trim();if(!K.startsWith("gitdir:"))return null;$=P(J,K.slice(7).trim())}catch{return null}let q=await S($);if(!q)return null;if(q.type==="branch")return I($,`refs/heads/${q.name}`);return q.sha}async function D2(J){let $=await z(J);if(!$)return null;let q=await C($,"remote","origin","url");if(q)return q;let K=await T($);if(K&&K!==$)return C(K,"remote","origin","url");return null}async function ZJ(){let J=await z();if(!J)return!1;let $=await T(J)??J;try{return await JJ(L($,"shallow")),!0}catch{return!1}}async function XJ(){try{let J=await z();if(!J)return 0;let $=await T(J)??J;return(await uJ(L($,"worktrees"))).length+1}catch{return 1}}var N,dJ=1000,w;var VJ=v(()=>{pJ();DJ();e();AJ();n();N=new Map;w=new $J});import{createHash as tJ}from"crypto";import{readFileSync as f,realpathSync as WJ,statSync as HJ}from"fs";import{open as eJ,readFile as J2,realpath as LJ,stat as $2}from"fs/promises";import TJ from"lodash-es/memoize.js";import{basename as q2,dirname as u,join as M,resolve as p,sep as MJ}from"path";function K2(){function J($){let q=zJ($);return q===NJ?null:q}return J.cache=zJ.cache,J}function Q2(){function J($){let q=G($);if(!q)return null;return OJ(q)}return J.cache=OJ.cache,J}function $3(J){return z(J)}async function q3(){let J=k(),$=G(J);if(!$)return!1;try{let[q,K]=await Promise.all([LJ(J),LJ($)]);return q===K}catch{return J===$}}function V2(J){let $=J.trim();if(!$)return null;let q=$.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(q&&q[1]&&q[2])return`${q[1]}/${q[2]}`.toLowerCase();let K=$.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);if(K&&K[1]&&K[2]){let Q=K[1],Y=K[2];if(U2(Q)&&Y.startsWith("git/")){let Z=Y.slice(4),A=Z.split("/");if(A.length>=3&&A[0].includes("."))return Z.toLowerCase();return`github.com/${Z}`.toLowerCase()}return`${Q}/${Y}`.toLowerCase()}return null}async function Y3(){let J=await d();if(!J)return null;let $=V2(J);if(!$)return null;return tJ("sha256").update($).digest("hex").substring(0,16)}async function A3(){try{let[J,$,q,K,Q,Y]=await Promise.all([Z2(),X2(),d(),A2(),W2(),L2()]);return{commitHash:J,branchName:$,remoteUrl:q,isHeadOnRemote:K,isClean:Q,worktreeCount:Y}}catch(J){return null}}async function W3(){let{parseGitRemote:J}=await import("./detectRepository-w6wawmmg.js"),$=await d();if(!$)return O("Local GitHub repo: unknown"),null;let q=J($);if(q&&q.host==="github.com"){let K=`${q.owner}/${q.name}`;return O(`Local GitHub repo: ${K}`),K}return O("Local GitHub repo: unknown"),null}async function z2(){let{stdout:J,code:$}=await X(V(),["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"],{preserveOutputOnError:!1});if($===0&&J.trim())return J.trim();let{stdout:q,code:K}=await X(V(),["remote","show","origin","--","HEAD"],{preserveOutputOnError:!1});if(K===0){let Y=q.match(/HEAD branch: (\S+)/);if(Y&&Y[1])return`origin/${Y[1]}`}let Q=["origin/main","origin/staging","origin/master"];for(let Y of Q){let{code:Z}=await X(V(),["rev-parse","--verify",Y],{preserveOutputOnError:!1});if(Z===0)return Y}return null}function O2(){return ZJ()}async function F(){let{stdout:J,code:$}=await X(V(),["ls-files","--others","--exclude-standard"],{preserveOutputOnError:!1}),q=J.trim();if($!==0||!q)return[];let K=q.split(`
7
7
  `).filter(Boolean),Q=[],Y=0;for(let Z of K){if(Q.length>=_J){O(`Untracked file capture: reached max file count (${_J})`);break}if(h(Z))continue;try{let W=(await $2(Z)).size;if(W>UJ){O(`Untracked file capture: skipping ${Z} (exceeds ${UJ} bytes)`);continue}if(Y+W>BJ){O(`Untracked file capture: reached total size limit (${BJ} bytes)`);break}if(W===0){Q.push({path:Z,content:""});continue}let H=Math.min(M2,W),_=await eJ(Z,"r");try{let b=Buffer.alloc(H),{bytesRead:y}=await _.read(b,0,H,0),E=b.subarray(0,y);if(g(E))continue;let B;if(W<=H)B=E.toString("utf-8");else B=await J2(Z,"utf-8");Q.push({path:Z,content:B}),Y+=W}finally{await _.close()}}catch(A){O(`Failed to read untracked file ${Z}: ${A}`)}}return Q}async function H3(){try{if(!await Y2())return null;if(await O2()){O("Shallow clone detected, using HEAD-only mode for issue");let[{stdout:E},B]=await Promise.all([X(V(),["diff","HEAD"]),F()]);return{remote_base_sha:null,remote_base:null,patch:E||"",untracked_files:B,format_patch:null,head_sha:null,branch_name:null}}let $=await z2();if(!$){O("No remote found, using HEAD-only mode for issue");let[{stdout:E},B]=await Promise.all([X(V(),["diff","HEAD"]),F()]);return{remote_base_sha:null,remote_base:null,patch:E||"",untracked_files:B,format_patch:null,head_sha:null,branch_name:null}}let{stdout:q,code:K}=await X(V(),["merge-base","HEAD",$],{preserveOutputOnError:!1});if(K!==0||!q.trim()){O("Merge-base failed, using HEAD-only mode for issue");let[{stdout:E},B]=await Promise.all([X(V(),["diff","HEAD"]),F()]);return{remote_base_sha:null,remote_base:null,patch:E||"",untracked_files:B,format_patch:null,head_sha:null,branch_name:null}}let Q=q.trim(),[{stdout:Y},Z,{stdout:A,code:W},{stdout:H},{stdout:_}]=await Promise.all([X(V(),["diff",Q]),F(),X(V(),["format-patch",`${Q}..HEAD`,"--stdout"]),X(V(),["rev-parse","HEAD"]),X(V(),["rev-parse","--abbrev-ref","HEAD"])]),b=null;if(W===0&&A&&A.trim())b=A;let y=_?.trim();return{remote_base_sha:Q,remote_base:$,patch:Y||"",untracked_files:Z,format_patch:b,head_sha:H?.trim()||null,branch_name:y&&y!=="HEAD"?y:null}}catch(J){return EJ(J),null}}function U2(J){let $=J.split(":")[0]??"";return $==="localhost"||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test($)}function L3(){let J=R(),$=k(),q=M($,".git");try{let K=J.statSync(q);if(K.isFile())return!1;if(K.isDirectory()){let Q=M(q,"HEAD");try{if(J.statSync(Q).isFile())return!1}catch{}}}catch{}try{if(J.statSync(M($,"HEAD")).isFile())return!0}catch{}try{if(J.statSync(M($,"objects")).isDirectory())return!0}catch{}try{if(J.statSync(M($,"refs")).isDirectory())return!0}catch{}return!1}var NJ,zJ,G,OJ,J3,V,Y2,K3=async(J)=>{return G(J)!==null},Z2=async()=>{return KJ()},X2=async()=>{return qJ()},Q3=async()=>{return YJ()},d=async()=>{return QJ()},A2=async()=>{let{code:J}=await X(V(),["rev-parse","@{u}"],{preserveOutputOnError:!1});return J===0},Z3=async()=>{let{stdout:J,code:$}=await X(V(),["rev-list","--count","@{u}..HEAD"],{preserveOutputOnError:!1});return $===0&&parseInt(J.trim(),10)>0},W2=async(J)=>{let $=["--no-optional-locks","status","--porcelain"];if(J?.ignoreUntracked)$.push("-uno");let{stdout:q}=await X(V(),$,{preserveOutputOnError:!1});return q.trim().length===0},X3=async()=>{let{stdout:J}=await X(V(),["--no-optional-locks","status","--porcelain"],{preserveOutputOnError:!1});return J.trim().split(`
8
8
  `).map(($)=>$.trim().split(" ",2)[1]?.trim()).filter(($)=>typeof $==="string")},H2=async()=>{let{stdout:J}=await X(V(),["--no-optional-locks","status","--porcelain"],{preserveOutputOnError:!1}),$=[],q=[];return J.trim().split(`
9
9
  `).filter((K)=>K.length>0).forEach((K)=>{let Q=K.substring(0,2),Y=K.substring(2).trim();if(Q==="??")q.push(Y);else if(Y)$.push(Y)}),{tracked:$,untracked:q}},L2=async()=>{return XJ()},V3=async(J)=>{try{let $=J||`Claude Code auto-stash - ${new Date().toISOString()}`,{untracked:q}=await H2();if(q.length>0){let{code:Q}=await X(V(),["add",...q],{preserveOutputOnError:!1});if(Q!==0)return!1}let{code:K}=await X(V(),["stash","push","--message",$],{preserveOutputOnError:!1});return K===0}catch($){return!1}},UJ=524288000,BJ=5368709120,_J=20000,M2=65536;var AJ=v(()=>{c();e();aJ();a();rJ();s();VJ();nJ();oJ();iJ();NJ=Symbol("git-root-not-found"),zJ=m((J)=>{let $=Date.now();U("info","find_git_root_started");let q=p(J),K=q.substring(0,q.indexOf(MJ)+1)||MJ,Q=0;while(q!==K){try{let Z=M(q,".git");Q++;let A=HJ(Z);if(A.isDirectory()||A.isFile())return U("info","find_git_root_completed",{duration_ms:Date.now()-$,stat_count:Q,found:!0}),q.normalize("NFC")}catch{}let Y=u(q);if(Y===q)break;q=Y}try{let Y=M(K,".git");Q++;let Z=HJ(Y);if(Z.isDirectory()||Z.isFile())return U("info","find_git_root_completed",{duration_ms:Date.now()-$,stat_count:Q,found:!0}),K.normalize("NFC")}catch{}return U("info","find_git_root_completed",{duration_ms:Date.now()-$,stat_count:Q,found:!1}),NJ},(J)=>J,50),G=K2();OJ=m((J)=>{try{let $=f(M(J,".git"),"utf-8").trim();if(!$.startsWith("gitdir:"))return J;let q=p(J,$.slice(7).trim()),K=p(q,f(M(q,"commondir"),"utf-8").trim());if(p(u(q))!==M(K,"worktrees"))return J;if(WJ(f(M(q,"gitdir"),"utf-8").trim())!==M(WJ(J),".git"))return J;if(q2(K)!==".git")return K.normalize("NFC");return u(K).normalize("NFC")}catch{return J}},(J)=>J,50),J3=Q2();V=TJ(()=>{return jJ("git")||"git"}),Y2=TJ(async()=>{let J=Date.now();U("info","is_git_check_started");let $=G(k())!==null;return U("info","is_git_check_completed",{duration_ms:Date.now()-J,is_git:$}),$})});
10
- export{U as K6,T2 as L6,a as M6,h as N6,c as O6,C as P6,n as Q6,w2 as R6,z as S6,I as T6,T as U6,F2 as V6,p2 as W6,D2 as X6,VJ as Y6,G as Z6,J3 as _6,V as $6,Y2 as a7,$3 as b7,q3 as c7,K3 as d7,Z2 as e7,X2 as f7,Q3 as g7,d as h7,V2 as i7,Y3 as j7,A2 as k7,Z3 as l7,W2 as m7,X3 as n7,H2 as o7,L2 as p7,V3 as q7,A3 as r7,W3 as s7,z2 as t7,H3 as u7,L3 as v7,AJ as w7};
10
+ export{U as O6,T2 as P6,a as Q6,h as R6,c as S6,C as T6,n as U6,w2 as V6,z as W6,I as X6,T as Y6,F2 as Z6,p2 as _6,D2 as $6,VJ as a7,G as b7,J3 as c7,V as d7,Y2 as e7,$3 as f7,q3 as g7,K3 as h7,Z2 as i7,X2 as j7,Q3 as k7,d as l7,V2 as m7,Y3 as n7,A2 as o7,Z3 as p7,W2 as q7,X3 as r7,H2 as s7,L2 as t7,V3 as u7,A3 as v7,W3 as w7,z2 as x7,H3 as y7,L3 as z7,AJ as A7};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{o5 as v}from"./cli-bthzmdgv.js";import{L5 as Y,P5 as A}from"./cli-1215h20m.js";import{y7 as O,z7 as E}from"./cli-ewts4g0p.js";import{I8 as V,J8 as k}from"./cli-mx6xk0dw.js";import{C9 as $,D9 as y}from"./cli-3q7meftn.js";import{h_ as I,l_ as z,r_ as X,u_ as F}from"./cli-a98b285v.js";import{bda as _}from"./cli-x514vyva.js";import R from"lodash-es/memoize.js";import*as Q from"path";import*as S from"path/win32";function Z(q){try{return $(`dir "${q}"`,{stdio:"pipe"}),!0}catch{return!1}}function f(q){if(q==="git"){let H=["C:\\Program Files\\Git\\cmd\\git.exe","C:\\Program Files (x86)\\Git\\cmd\\git.exe"];for(let J of H)if(Z(J))return J}try{let J=$(`where.exe ${q}`,{stdio:"pipe",encoding:"utf8"}).trim().split(`\r
2
+ import{_4 as v}from"./cli-1ny2386w.js";import{c5 as Y,g5 as A}from"./cli-mb1qrqw1.js";import{C7 as O,D7 as E}from"./cli-mzcsnm06.js";import{L7 as V,M7 as k}from"./cli-rvad3yhg.js";import{G9 as $,H9 as y}from"./cli-rjerv816.js";import{l_ as I,p_ as z,v_ as X,y_ as F}from"./cli-hke6r0q8.js";import{fda as _}from"./cli-w1d8n9g3.js";import R from"lodash-es/memoize.js";import*as Q from"path";import*as S from"path/win32";function Z(q){try{return $(`dir "${q}"`,{stdio:"pipe"}),!0}catch{return!1}}function f(q){if(q==="git"){let H=["C:\\Program Files\\Git\\cmd\\git.exe","C:\\Program Files (x86)\\Git\\cmd\\git.exe"];for(let J of H)if(Z(J))return J}try{let J=$(`where.exe ${q}`,{stdio:"pipe",encoding:"utf8"}).trim().split(`\r
3
3
  `).filter(Boolean),K=V().toLowerCase();for(let N of J){let U=Q.resolve(N).toLowerCase();if(Q.dirname(U).toLowerCase()===K||U.startsWith(K+Q.sep)){X(`Skipping potentially malicious executable in current directory: ${N}`);continue}return N}return null}catch{return null}}function d(){if(Y()==="windows"){let q=T();if(!q){X("Git Bash not found on Windows; leaving SHELL unset for lazy fallback handling",{level:"warn"});return}process.env.SHELL=q,X(`Using bash path: "${q}"`)}}var T,r,P,C;var L=_(()=>{k();F();y();E();A();T=R(()=>{if(process.env.CLAUDE_CODE_GIT_BASH_PATH){if(Z(process.env.CLAUDE_CODE_GIT_BASH_PATH))return process.env.CLAUDE_CODE_GIT_BASH_PATH;return null}let q=f("git");if(q){let H=S.join(q,"..","..","bin","bash.exe");if(Z(H))return H}return null}),r=R(()=>{let q=T();if(q)return q;if(process.env.CLAUDE_CODE_GIT_BASH_PATH)console.error(`Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path "${process.env.CLAUDE_CODE_GIT_BASH_PATH}"`),process.exit(1);console.error("Claude Code on Windows requires git-bash (https://git-scm.com/downloads/win). If installed but not in PATH, set environment variable pointing to your bash.exe, similar to: CLAUDE_CODE_GIT_BASH_PATH=C:\\Program Files\\Git\\bin\\bash.exe"),process.exit(1)}),P=O((q)=>{if(q.startsWith("\\\\"))return q.replace(/\\/g,"/");let H=q.match(/^([A-Za-z]):[/\\]/);if(H)return"/"+H[1].toLowerCase()+q.slice(2).replace(/\\/g,"/");return q.replace(/\\/g,"/")},(q)=>q,500),C=O((q)=>{if(q.startsWith("//"))return q.replace(/\//g,"\\");let H=q.match(/^\/cygdrive\/([A-Za-z])(\/|$)/);if(H){let K=H[1].toUpperCase(),N=q.slice(("/cygdrive/"+H[1]).length);return K+":"+(N||"\\").replace(/\//g,"\\")}let J=q.match(/^\/([A-Za-z])(\/|$)/);if(J){let K=J[1].toUpperCase(),N=q.slice(2);return K+":"+(N||"\\").replace(/\//g,"\\")}return q.replace(/\//g,"\\")},(q)=>q,500)});import{homedir as M}from"os";import{dirname as W,isAbsolute as B,join as j,normalize as G,relative as D,resolve as b}from"path";function x(q,H){let J=H??V()??I().cwd();if(typeof q!=="string")throw TypeError(`Path must be a string, received ${typeof q}`);if(typeof J!=="string")throw TypeError(`Base directory must be a string, received ${typeof J}`);if(q.includes("\x00")||J.includes("\x00"))throw Error("Path contains null bytes");let K=q.trim();if(!K)return G(J).normalize("NFC");if(K==="~")return M().normalize("NFC");if(K.startsWith("~/"))return j(M(),K.slice(2)).normalize("NFC");let N=K;if(Y()==="windows"&&K.match(/^\/[a-z]\//i))try{N=C(K)}catch{N=K}if(B(N))return G(N).normalize("NFC");return b(J,N).normalize("NFC")}function Hq(q){let H=D(V(),q);return H.startsWith("..")?q:H}function Jq(q){let H=x(q);if(H.startsWith("\\\\")||H.startsWith("//"))return W(H);try{if(I().statSync(H).isDirectory())return H}catch{}return W(H)}function Kq(q){return/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(q)}function Nq(q){return G(q).replace(/\\/g,"/")}var u=_(()=>{k();z();A();L();v()});
4
- export{d as U4,T as V4,P as W4,C as X4,L as Y4,x as Z4,Hq as _4,Jq as $4,Kq as a5,Nq as b5,u as c5};
4
+ export{d as E4,T as F4,P as G4,C as H4,L as I4,x as J4,Hq as K4,Jq as L4,Kq as M4,Nq as N4,u as O4};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{fS as $,hS as m,mS as L}from"./cli-pmzht94n.js";import{K3 as Q,N3 as V,V1 as M,e4 as H,z1 as P}from"./cli-9hskw92e.js";import{B8 as D,p8 as Y,s8 as k,w8 as Z}from"./cli-3bxtq5dc.js";import{x9 as X,y9 as R}from"./cli-shz2e0q5.js";import{bda as F}from"./cli-x514vyva.js";import S from"axios";async function E(){try{let{accessToken:B,orgUUID:z}=await $(),J=`${X().BASE_API_URL}/api/oauth/organizations/${z}/overage_credit_grant`;return(await S.get(J,{headers:m(B)})).data}catch(B){return Z(B),null}}function O(){let B=P()?.organizationUuid;if(!B)return null;let z=V().overageCreditGrantCache?.[B];if(!z)return null;if(Date.now()-z.timestamp>q)return null;return z.info}function x(){let B=P()?.organizationUuid;if(!B)return;let z=V().overageCreditGrantCache;if(!z||!(B in z))return;Q((J)=>{let K={...J.overageCreditGrantCache};return delete K[B],{...J,overageCreditGrantCache:K}})}async function I(){if(Y())return;let B=P()?.organizationUuid;if(!B)return;let z=await E();if(!z)return;Q((J)=>{let K=J.overageCreditGrantCache?.[B],N=K?.info,W=N&&N.available===z.available&&N.eligible===z.eligible&&N.granted===z.granted&&N.amount_minor_units===z.amount_minor_units&&N.currency===z.currency;if(W&&K&&Date.now()-K.timestamp<=q)return J;let w={info:W?N:z,timestamp:Date.now()};return{...J,overageCreditGrantCache:{...J.overageCreditGrantCache,[B]:w}}})}function C(B){if(B.amount_minor_units==null||!B.currency)return null;if(B.currency.toUpperCase()==="USD"){let z=B.amount_minor_units/100;return Number.isInteger(z)?`$${z}`:`$${z.toFixed(2)}`}return null}var q=3600000;var _=F(()=>{R();M();H();D();k();L()});
2
+ import{iS as $,kS as m,pS as L}from"./cli-br6zjh6x.js";import{F1 as M,Q3 as H,j1 as P,u3 as Q,x3 as V}from"./cli-msmzt4c3.js";import{A8 as k,E8 as Z,J8 as D,x8 as Y}from"./cli-4ewb3q42.js";import{B9 as X,C9 as R}from"./cli-kq16afrr.js";import{fda as F}from"./cli-w1d8n9g3.js";import S from"axios";async function E(){try{let{accessToken:B,orgUUID:z}=await $(),J=`${X().BASE_API_URL}/api/oauth/organizations/${z}/overage_credit_grant`;return(await S.get(J,{headers:m(B)})).data}catch(B){return Z(B),null}}function O(){let B=P()?.organizationUuid;if(!B)return null;let z=V().overageCreditGrantCache?.[B];if(!z)return null;if(Date.now()-z.timestamp>q)return null;return z.info}function x(){let B=P()?.organizationUuid;if(!B)return;let z=V().overageCreditGrantCache;if(!z||!(B in z))return;Q((J)=>{let K={...J.overageCreditGrantCache};return delete K[B],{...J,overageCreditGrantCache:K}})}async function I(){if(Y())return;let B=P()?.organizationUuid;if(!B)return;let z=await E();if(!z)return;Q((J)=>{let K=J.overageCreditGrantCache?.[B],N=K?.info,W=N&&N.available===z.available&&N.eligible===z.eligible&&N.granted===z.granted&&N.amount_minor_units===z.amount_minor_units&&N.currency===z.currency;if(W&&K&&Date.now()-K.timestamp<=q)return J;let w={info:W?N:z,timestamp:Date.now()};return{...J,overageCreditGrantCache:{...J.overageCreditGrantCache,[B]:w}}})}function C(B){if(B.amount_minor_units==null||!B.currency)return null;if(B.currency.toUpperCase()==="USD"){let z=B.amount_minor_units/100;return Number.isInteger(z)?`$${z}`:`$${z.toFixed(2)}`}return null}var q=3600000;var _=F(()=>{R();M();H();D();k();L()});
3
3
  export{O as mg,x as ng,I as og,C as pg,_ as qg};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{V8 as Y}from"./cli-s5epnnj5.js";import{u_ as U}from"./cli-a98b285v.js";import{bda as F}from"./cli-x514vyva.js";var O,K;var G=F(()=>{O=Promise.resolve(),K=new Set(["if","then","elif","else","fi","while","until","for","in","do","done","case","esac","function","select"])});async function C(){}async function y(z){if(!z||z.length>V)return null;return null}async function b(z){if(!z||z.length>V)return null;return null}function T(z){if(z.type==="declaration_command"){let J=z.children[0];return J&&q.has(J.text)?[J.text]:[]}let Z=[],$=!1;for(let J of z.children){if(J.type==="variable_assignment")continue;if(J.type==="command_name"||!$&&J.type==="word"){$=!0,Z.push(J.text);continue}if(Q.has(J.type))Z.push(M(J.text));else if(H.has(J.type))break}return Z}function M(z){return z.length>=2&&(z[0]==='"'&&z.at(-1)==='"'||z[0]==="'"&&z.at(-1)==="'")?z.slice(1,-1):z}var V=1e4,q,Q,H,u;var W=F(()=>{Y();U();G();q=new Set(["export","declare","typeset","readonly","local","unset","unsetenv"]),Q=new Set(["word","string","raw_string","number"]),H=new Set(["command_substitution","process_substitution"]);u=Symbol("parse-aborted")});
3
- export{K as K8,G as L8,C as M8,y as N8,u as O8,b as P8,T as Q8,W as R8};
2
+ import{Z8 as Y}from"./cli-t9jht3kb.js";import{y_ as U}from"./cli-hke6r0q8.js";import{fda as F}from"./cli-w1d8n9g3.js";var O,K;var G=F(()=>{O=Promise.resolve(),K=new Set(["if","then","elif","else","fi","while","until","for","in","do","done","case","esac","function","select"])});async function C(){}async function y(z){if(!z||z.length>V)return null;return null}async function b(z){if(!z||z.length>V)return null;return null}function T(z){if(z.type==="declaration_command"){let J=z.children[0];return J&&q.has(J.text)?[J.text]:[]}let Z=[],$=!1;for(let J of z.children){if(J.type==="variable_assignment")continue;if(J.type==="command_name"||!$&&J.type==="word"){$=!0,Z.push(J.text);continue}if(Q.has(J.type))Z.push(M(J.text));else if(H.has(J.type))break}return Z}function M(z){return z.length>=2&&(z[0]==='"'&&z.at(-1)==='"'||z[0]==="'"&&z.at(-1)==="'")?z.slice(1,-1):z}var V=1e4,q,Q,H,u;var W=F(()=>{Y();U();G();q=new Set(["export","declare","typeset","readonly","local","unset","unsetenv"]),Q=new Set(["word","string","raw_string","number"]),H=new Set(["command_substitution","process_substitution"]);u=Symbol("parse-aborted")});
3
+ export{K as O8,G as P8,C as Q8,y as R8,u as S8,b as T8,T as U8,W as V8};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{$Y as F,HY as k,K2 as R,KY as O,L2 as v,UW as K,XW as p,Y3 as j,e4 as A,j2 as G,l2 as I,oZ as S}from"./cli-9hskw92e.js";import{B8 as L,w8 as b}from"./cli-3bxtq5dc.js";import{bda as C}from"./cli-x514vyva.js";import c from"axios";import{createHash as N}from"crypto";import B from"lodash-es/memoize.js";function P(Q){return Q.replace(/[A-Z]/g,(Y)=>`_${Y.toLowerCase()}`)}async function y(){if(X.length===0)return;let Q=X;X=[];try{await c.post(_,Q,{headers:{"Content-Type":"application/json","DD-API-KEY":U},timeout:h})}catch(Y){b(Y)}}function g(){if($)return;$=setTimeout(()=>{$=null,y()},d()).unref()}async function $q(){if($)clearTimeout($),$=null;await y()}async function wq(Q,Y){return}function d(){return parseInt(process.env.CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS||"",10)||E}var _="https://http-intake.logs.us5.datadoghq.com/api/v2/logs",U="",E=15000,f=100,h=5000,n,u,X,$=null,Z=null,T,m=30,D;var o=C(()=>{A();L();S();p();O();I();v();n=new Set(["chrome_bridge_connection_succeeded","chrome_bridge_connection_failed","chrome_bridge_disconnected","chrome_bridge_tool_call_completed","chrome_bridge_tool_call_error","chrome_bridge_tool_call_started","chrome_bridge_tool_call_timeout","tengu_api_error","tengu_api_success","tengu_brief_mode_enabled","tengu_brief_mode_toggled","tengu_brief_send","tengu_cancel","tengu_compact_failed","tengu_exit","tengu_flicker","tengu_init","tengu_model_fallback_triggered","tengu_oauth_error","tengu_oauth_success","tengu_oauth_token_refresh_failure","tengu_oauth_token_refresh_success","tengu_oauth_token_refresh_lock_acquiring","tengu_oauth_token_refresh_lock_acquired","tengu_oauth_token_refresh_starting","tengu_oauth_token_refresh_completed","tengu_oauth_token_refresh_lock_releasing","tengu_oauth_token_refresh_lock_released","tengu_query_error","tengu_session_file_read","tengu_started","tengu_tool_use_error","tengu_tool_use_granted_in_prompt_permanent","tengu_tool_use_granted_in_prompt_temporary","tengu_tool_use_rejected_in_prompt","tengu_tool_use_success","tengu_uncaught_exception","tengu_unhandled_rejection","tengu_voice_recording_started","tengu_voice_toggled","tengu_team_mem_sync_pull","tengu_team_mem_sync_push","tengu_team_mem_sync_started","tengu_team_mem_entries_capped"]),u=["arch","clientType","errorType","http_status_range","http_status","kairosActive","model","platform","provider","skillMode","subscriptionType","toolName","userBucket","userType","version","versionBase"];X=[];T=B(async()=>{if(!U||G())return Z=!1,!1;try{return Z=!0,!0}catch(Q){return b(Q),Z=!1,!1}});D=B(()=>{let Q=j(),Y=N("sha256").update(Q).digest("hex");return parseInt(Y.slice(0,8),16)%m})});
3
- export{$q as pS,wq as qS,o as rS};
2
+ import{I3 as j,KY as k,NY as O,Q3 as A,V1 as G,X1 as I,XW as K,_W as p,cZ as F,rZ as S,u2 as R,v2 as v}from"./cli-msmzt4c3.js";import{E8 as b,J8 as L}from"./cli-4ewb3q42.js";import{fda as C}from"./cli-w1d8n9g3.js";import c from"axios";import{createHash as N}from"crypto";import B from"lodash-es/memoize.js";function P(Q){return Q.replace(/[A-Z]/g,(Y)=>`_${Y.toLowerCase()}`)}async function y(){if(X.length===0)return;let Q=X;X=[];try{await c.post(_,Q,{headers:{"Content-Type":"application/json","DD-API-KEY":U},timeout:h})}catch(Y){b(Y)}}function g(){if($)return;$=setTimeout(()=>{$=null,y()},d()).unref()}async function $q(){if($)clearTimeout($),$=null;await y()}async function wq(Q,Y){return}function d(){return parseInt(process.env.CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS||"",10)||E}var _="https://http-intake.logs.us5.datadoghq.com/api/v2/logs",U="",E=15000,f=100,h=5000,n,u,X,$=null,Z=null,T,m=30,D;var o=C(()=>{A();L();S();p();O();I();v();n=new Set(["chrome_bridge_connection_succeeded","chrome_bridge_connection_failed","chrome_bridge_disconnected","chrome_bridge_tool_call_completed","chrome_bridge_tool_call_error","chrome_bridge_tool_call_started","chrome_bridge_tool_call_timeout","tengu_api_error","tengu_api_success","tengu_brief_mode_enabled","tengu_brief_mode_toggled","tengu_brief_send","tengu_cancel","tengu_compact_failed","tengu_exit","tengu_flicker","tengu_init","tengu_model_fallback_triggered","tengu_oauth_error","tengu_oauth_success","tengu_oauth_token_refresh_failure","tengu_oauth_token_refresh_success","tengu_oauth_token_refresh_lock_acquiring","tengu_oauth_token_refresh_lock_acquired","tengu_oauth_token_refresh_starting","tengu_oauth_token_refresh_completed","tengu_oauth_token_refresh_lock_releasing","tengu_oauth_token_refresh_lock_released","tengu_query_error","tengu_session_file_read","tengu_started","tengu_tool_use_error","tengu_tool_use_granted_in_prompt_permanent","tengu_tool_use_granted_in_prompt_temporary","tengu_tool_use_rejected_in_prompt","tengu_tool_use_success","tengu_uncaught_exception","tengu_unhandled_rejection","tengu_voice_recording_started","tengu_voice_toggled","tengu_team_mem_sync_pull","tengu_team_mem_sync_push","tengu_team_mem_sync_started","tengu_team_mem_entries_capped"]),u=["arch","clientType","errorType","http_status_range","http_status","kairosActive","model","platform","provider","skillMode","subscriptionType","toolName","userBucket","userType","version","versionBase"];X=[];T=B(async()=>{if(!U||G())return Z=!1,!1;try{return Z=!0,!0}catch(Q){return b(Q),Z=!1,!1}});D=B(()=>{let Q=j(),Y=N("sha256").update(Q).digest("hex");return parseInt(Y.slice(0,8),16)%m})});
3
+ export{$q as wS,wq as xS,o as yS};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{T3 as z,e4 as Y}from"./cli-9hskw92e.js";Y();import{c as M}from"react/compiler-runtime";import{createContext as n,useContext as m,useEffect as a}from"react";import{jsxDEV as G}from"react/jsx-dev-runtime";function O(P,$){let K=$/100*(P.length-1),_=Math.floor(K),q=Math.ceil(K);if(_===q)return P[_];return P[_]+(P[q]-P[_])*(K-_)}var h=1024;function X(){let P=new Map,$=new Map,K=new Map;return{increment(_,q=1){P.set(_,(P.get(_)??0)+q)},set(_,q){P.set(_,q)},observe(_,q){let f=$.get(_);if(!f)f={reservoir:[],count:0,sum:0,min:q,max:q},$.set(_,f);if(f.count++,f.sum+=q,q<f.min)f.min=q;if(q>f.max)f.max=q;if(f.reservoir.length<h)f.reservoir.push(q);else{let j=Math.floor(Math.random()*f.count);if(j<h)f.reservoir[j]=q}},add(_,q){let f=K.get(_);if(!f)f=new Set,K.set(_,f);f.add(q)},getAll(){let _=Object.fromEntries(P);for(let[q,f]of $){if(f.count===0)continue;_[`${q}_count`]=f.count,_[`${q}_min`]=f.min,_[`${q}_max`]=f.max,_[`${q}_avg`]=f.sum/f.count;let j=[...f.reservoir].sort((w,k)=>w-k);_[`${q}_p50`]=O(j,50),_[`${q}_p95`]=O(j,95),_[`${q}_p99`]=O(j,99)}for(let[q,f]of K)_[q]=f.size;return _}}}var A=n(null);function y(P){let $=M(7),{store:K,children:_}=P,q;if($[0]===Symbol.for("react.memo_cache_sentinel"))q=X(),$[0]=q;else q=$[0];let j=K??q,w,k;if($[1]!==j)w=()=>{let p=()=>{let v=j.getAll();if(Object.keys(v).length>0)z((o)=>({...o,lastSessionMetrics:v}))};return process.on("exit",p),()=>{process.off("exit",p)}},k=[j],$[1]=j,$[2]=w,$[3]=k;else w=$[2],k=$[3];a(w,k);let r;if($[4]!==_||$[5]!==j)r=G(A.Provider,{value:j,children:_},void 0,!1,void 0,this),$[4]=_,$[5]=j,$[6]=r;else r=$[6];return r}
2
+ import{D3 as z,Q3 as Y}from"./cli-msmzt4c3.js";Y();import{c as M}from"react/compiler-runtime";import{createContext as n,useContext as m,useEffect as a}from"react";import{jsxDEV as G}from"react/jsx-dev-runtime";function O(P,$){let K=$/100*(P.length-1),_=Math.floor(K),q=Math.ceil(K);if(_===q)return P[_];return P[_]+(P[q]-P[_])*(K-_)}var h=1024;function X(){let P=new Map,$=new Map,K=new Map;return{increment(_,q=1){P.set(_,(P.get(_)??0)+q)},set(_,q){P.set(_,q)},observe(_,q){let f=$.get(_);if(!f)f={reservoir:[],count:0,sum:0,min:q,max:q},$.set(_,f);if(f.count++,f.sum+=q,q<f.min)f.min=q;if(q>f.max)f.max=q;if(f.reservoir.length<h)f.reservoir.push(q);else{let j=Math.floor(Math.random()*f.count);if(j<h)f.reservoir[j]=q}},add(_,q){let f=K.get(_);if(!f)f=new Set,K.set(_,f);f.add(q)},getAll(){let _=Object.fromEntries(P);for(let[q,f]of $){if(f.count===0)continue;_[`${q}_count`]=f.count,_[`${q}_min`]=f.min,_[`${q}_max`]=f.max,_[`${q}_avg`]=f.sum/f.count;let j=[...f.reservoir].sort((w,k)=>w-k);_[`${q}_p50`]=O(j,50),_[`${q}_p95`]=O(j,95),_[`${q}_p99`]=O(j,99)}for(let[q,f]of K)_[q]=f.size;return _}}}var A=n(null);function y(P){let $=M(7),{store:K,children:_}=P,q;if($[0]===Symbol.for("react.memo_cache_sentinel"))q=X(),$[0]=q;else q=$[0];let j=K??q,w,k;if($[1]!==j)w=()=>{let p=()=>{let v=j.getAll();if(Object.keys(v).length>0)z((o)=>({...o,lastSessionMetrics:v}))};return process.on("exit",p),()=>{process.off("exit",p)}},k=[j],$[1]=j,$[2]=w,$[3]=k;else w=$[2],k=$[3];a(w,k);let r;if($[4]!==_||$[5]!==j)r=G(A.Provider,{value:j,children:_},void 0,!1,void 0,this),$[4]=_,$[5]=j,$[6]=r;else r=$[6];return r}
3
3
  export{X as I,y as J};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{fS as X,hS as Y,mS as f}from"./cli-pmzht94n.js";import{C1 as q,K3 as x,N3 as Q,V1 as w,e4 as U,w1 as G,z1 as L}from"./cli-9hskw92e.js";import{B8 as A,p8 as $,s8 as P,w8 as v}from"./cli-3bxtq5dc.js";import{x9 as W,y9 as T}from"./cli-shz2e0q5.js";import{r_ as K,u_ as R}from"./cli-a98b285v.js";import{bda as O}from"./cli-x514vyva.js";import H from"axios";async function F(j="claude_code_guest_pass"){let{accessToken:B,orgUUID:z}=await X(),J={...Y(B),"x-organization-uuid":z},M=`${W().BASE_API_URL}/api/oauth/organizations/${z}/referral/eligibility`;return(await H.get(M,{headers:J,params:{campaign:j},timeout:5000})).data}async function c(j="claude_code_guest_pass"){let{accessToken:B,orgUUID:z}=await X(),J={...Y(B),"x-organization-uuid":z},M=`${W().BASE_API_URL}/api/oauth/organizations/${z}/referral/redemptions`;return(await H.get(M,{headers:J,params:{campaign:j},timeout:1e4})).data}function k(){return!!(L()?.organizationUuid&&G()&&q()==="max")}function t(){if(!k())return{eligible:!1,needsRefresh:!1,hasCache:!1};let j=L()?.organizationUuid;if(!j)return{eligible:!1,needsRefresh:!1,hasCache:!1};let z=Q().passesEligibilityCache?.[j];if(!z)return{eligible:!1,needsRefresh:!0,hasCache:!1};let{eligible:J,timestamp:M}=z,Z=Date.now()-M>S;return{eligible:J,needsRefresh:Z,hasCache:!0}}function i(j){let B=D[j.currency]??`${j.currency} `,z=j.amount_minor_units/100,J=z%1===0?z.toString():z.toFixed(2);return`${B}${J}`}function n(){let j=L()?.organizationUuid;if(!j)return null;return Q().passesEligibilityCache?.[j]?.referrer_reward??null}function a(){let j=L()?.organizationUuid;if(!j)return null;return Q().passesEligibilityCache?.[j]?.remaining_passes??null}async function _(){if(N)return K("Passes: Reusing in-flight eligibility fetch"),N;let j=L()?.organizationUuid;if(!j)return null;return N=(async()=>{try{let B=await F(),z={...B,timestamp:Date.now()};return x((J)=>({...J,passesEligibilityCache:{...J.passesEligibilityCache,[j]:z}})),K(`Passes eligibility cached for org ${j}: ${B.eligible}`),B}catch(B){return K("Failed to fetch and cache passes eligibility"),v(B),null}finally{N=null}})(),N}async function m(){if(!k())return null;let j=L()?.organizationUuid;if(!j)return null;let z=Q().passesEligibilityCache?.[j],J=Date.now();if(!z)return K("Passes: No cache, fetching eligibility in background (command unavailable this session)"),_(),null;if(J-z.timestamp>S){K("Passes: Cache stale, returning cached data and refreshing in background"),_();let{timestamp:Z,...C}=z;return C}K("Passes: Using fresh cached eligibility data");let{timestamp:M,...V}=z;return V}async function s(){if($())return;m()}var S=86400000,N=null,D;var E=O(()=>{T();w();U();R();A();P();f();D={USD:"$",EUR:"\u20AC",GBP:"\xA3",BRL:"R$",CAD:"CA$",AUD:"A$",NZD:"NZ$",SGD:"S$"}});
3
- export{c as ON,t as PN,i as QN,n as RN,a as SN,m as TN,s as UN,E as VN};
2
+ import{iS as X,kS as Y,pS as f}from"./cli-br6zjh6x.js";import{F1 as w,Q3 as U,g1 as G,j1 as L,m1 as q,u3 as x,x3 as Q}from"./cli-msmzt4c3.js";import{A8 as P,E8 as v,J8 as A,x8 as $}from"./cli-4ewb3q42.js";import{B9 as W,C9 as T}from"./cli-kq16afrr.js";import{v_ as K,y_ as R}from"./cli-hke6r0q8.js";import{fda as O}from"./cli-w1d8n9g3.js";import H from"axios";async function F(j="claude_code_guest_pass"){let{accessToken:B,orgUUID:z}=await X(),J={...Y(B),"x-organization-uuid":z},M=`${W().BASE_API_URL}/api/oauth/organizations/${z}/referral/eligibility`;return(await H.get(M,{headers:J,params:{campaign:j},timeout:5000})).data}async function c(j="claude_code_guest_pass"){let{accessToken:B,orgUUID:z}=await X(),J={...Y(B),"x-organization-uuid":z},M=`${W().BASE_API_URL}/api/oauth/organizations/${z}/referral/redemptions`;return(await H.get(M,{headers:J,params:{campaign:j},timeout:1e4})).data}function k(){return!!(L()?.organizationUuid&&G()&&q()==="max")}function t(){if(!k())return{eligible:!1,needsRefresh:!1,hasCache:!1};let j=L()?.organizationUuid;if(!j)return{eligible:!1,needsRefresh:!1,hasCache:!1};let z=Q().passesEligibilityCache?.[j];if(!z)return{eligible:!1,needsRefresh:!0,hasCache:!1};let{eligible:J,timestamp:M}=z,Z=Date.now()-M>S;return{eligible:J,needsRefresh:Z,hasCache:!0}}function i(j){let B=D[j.currency]??`${j.currency} `,z=j.amount_minor_units/100,J=z%1===0?z.toString():z.toFixed(2);return`${B}${J}`}function n(){let j=L()?.organizationUuid;if(!j)return null;return Q().passesEligibilityCache?.[j]?.referrer_reward??null}function a(){let j=L()?.organizationUuid;if(!j)return null;return Q().passesEligibilityCache?.[j]?.remaining_passes??null}async function _(){if(N)return K("Passes: Reusing in-flight eligibility fetch"),N;let j=L()?.organizationUuid;if(!j)return null;return N=(async()=>{try{let B=await F(),z={...B,timestamp:Date.now()};return x((J)=>({...J,passesEligibilityCache:{...J.passesEligibilityCache,[j]:z}})),K(`Passes eligibility cached for org ${j}: ${B.eligible}`),B}catch(B){return K("Failed to fetch and cache passes eligibility"),v(B),null}finally{N=null}})(),N}async function m(){if(!k())return null;let j=L()?.organizationUuid;if(!j)return null;let z=Q().passesEligibilityCache?.[j],J=Date.now();if(!z)return K("Passes: No cache, fetching eligibility in background (command unavailable this session)"),_(),null;if(J-z.timestamp>S){K("Passes: Cache stale, returning cached data and refreshing in background"),_();let{timestamp:Z,...C}=z;return C}K("Passes: Using fresh cached eligibility data");let{timestamp:M,...V}=z;return V}async function s(){if($())return;m()}var S=86400000,N=null,D;var E=O(()=>{T();w();U();R();A();P();f();D={USD:"$",EUR:"\u20AC",GBP:"\xA3",BRL:"R$",CAD:"CA$",AUD:"A$",NZD:"NZ$",SGD:"S$"}});
3
+ export{c as SN,t as TN,i as UN,n as VN,a as WN,m as XN,s as YN,E as ZN};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{$f as q,ag as k}from"./cli-zac1afnb.js";import{kg as f,lg as z}from"./cli-15tr7ade.js";import{bda as O}from"./cli-x514vyva.js";import{jsxDEV as P}from"react/jsx-dev-runtime";async function Y(_,K){let $=await f();if($.type==="message")return _($.value),null;return P(q,{startingMessage:"Starting new login following /extra-usage. Exit with Ctrl-C to use existing account.",onDone:(r)=>{K.onChangeAPIKey(),_(r?"Login successful":"Login interrupted")}},void 0,!1,void 0,this)}var w=O(()=>{k();z()});
2
+ import{$f as q,ag as k}from"./cli-6bxfdgv1.js";import{kg as f,lg as z}from"./cli-sh9w2tbd.js";import{fda as O}from"./cli-w1d8n9g3.js";import{jsxDEV as P}from"react/jsx-dev-runtime";async function Y(_,K){let $=await f();if($.type==="message")return _($.value),null;return P(q,{startingMessage:"Starting new login following /extra-usage. Exit with Ctrl-C to use existing account.",onDone:(r)=>{K.onChangeAPIKey(),_(r?"Login successful":"Login interrupted")}},void 0,!1,void 0,this)}var w=O(()=>{k();z()});
3
3
  export{Y as Yf,w as Zf};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Ln as M,Vn as Z,co as d,do as G,jo as t}from"./cli-5pb6kdxn.js";import{GQ as k,IQ as $,MQ as n,iR as X}from"./cli-5wh173wa.js";import{bda as W}from"./cli-x514vyva.js";import{c as T}from"react/compiler-runtime";import{jsxDEV as K}from"react/jsx-dev-runtime";function b(_){let q=T(26),{scope:f,parsingErrors:w,warnings:z}=_,P=w.length>0,v=z.length>0;if(!P&&!v)return null;let h;if(q[0]!==P||q[1]!==v)h=(P||v)&&K($,{color:P?"error":"warning",children:["[",P?"Failed to parse":"Contains warnings","]"," "]},void 0,!0,void 0,this),q[0]=P,q[1]=v,q[2]=h;else h=q[2];let j;if(q[3]!==f)j=G(f),q[3]=f,q[4]=j;else j=q[4];let O;if(q[5]!==j)O=K($,{children:j},void 0,!1,void 0,this),q[5]=j,q[6]=O;else O=q[6];let o;if(q[7]!==h||q[8]!==O)o=K(k,{children:[h,O]},void 0,!0,void 0,this),q[7]=h,q[8]=O,q[9]=o;else o=q[9];let Y;if(q[10]===Symbol.for("react.memo_cache_sentinel"))Y=K($,{dimColor:!0,children:"Location: "},void 0,!1,void 0,this),q[10]=Y;else Y=q[10];let p;if(q[11]!==f)p=d(f),q[11]=f,q[12]=p;else p=q[12];let H;if(q[13]!==p)H=K(k,{children:[Y,K($,{dimColor:!0,children:p},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q[13]=p,q[14]=H;else H=q[14];let e;if(q[15]!==w)e=w.map(J),q[15]=w,q[16]=e;else e=q[16];let u;if(q[17]!==z)u=z.map(l),q[17]=z,q[18]=u;else u=q[18];let r;if(q[19]!==e||q[20]!==u)r=K(k,{marginLeft:1,flexDirection:"column",children:[e,u]},void 0,!0,void 0,this),q[19]=e,q[20]=u,q[21]=r;else r=q[21];let a;if(q[22]!==r||q[23]!==o||q[24]!==H)a=K(k,{flexDirection:"column",marginTop:1,children:[o,H,r]},void 0,!0,void 0,this),q[22]=r,q[23]=o,q[24]=H,q[25]=a;else a=q[25];return a}function l(_,q){let f=_.mcpErrorMetadata?.serverName;return K(k,{children:K($,{children:[K($,{dimColor:!0,children:"\u2514 "},void 0,!1,void 0,this),K($,{color:"warning",children:"[Warning]"},void 0,!1,void 0,this),K($,{dimColor:!0,children:[" ",f&&`[${f}] `,_.path&&_.path!==""?`${_.path}: `:"",_.message]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},`warning-${q}`,!1,void 0,this)}function J(_,q){let f=_.mcpErrorMetadata?.serverName;return K(k,{children:K($,{children:[K($,{dimColor:!0,children:"\u2514 "},void 0,!1,void 0,this),K($,{color:"error",children:"[Error]"},void 0,!1,void 0,this),K($,{dimColor:!0,children:[" ",f&&`[${f}] `,_.path&&_.path!==""?`${_.path}: `:"",_.message]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},`error-${q}`,!1,void 0,this)}function V(){let _=T(6),q;if(_[0]===Symbol.for("react.memo_cache_sentinel"))q={scope:"user",config:M("user")},_[0]=q;else q=_[0];let f;if(_[1]===Symbol.for("react.memo_cache_sentinel"))f={scope:"project",config:M("project")},_[1]=f;else f=_[1];let w;if(_[2]===Symbol.for("react.memo_cache_sentinel"))w={scope:"local",config:M("local")},_[2]=w;else w=_[2];let z;if(_[3]===Symbol.for("react.memo_cache_sentinel"))z=[q,f,w,{scope:"enterprise",config:M("enterprise")}],_[3]=z;else z=_[3];let P=z,v=P.some(D),h=P.some(y);if(!v&&!h)return null;let j;if(_[4]===Symbol.for("react.memo_cache_sentinel"))j=K($,{bold:!0,children:"MCP Config Diagnostics"},void 0,!1,void 0,this),_[4]=j;else j=_[4];let O;if(_[5]===Symbol.for("react.memo_cache_sentinel"))O=K(k,{flexDirection:"column",marginTop:1,marginBottom:1,children:[j,K(k,{marginTop:1,children:K($,{dimColor:!0,children:["For help configuring MCP servers, see:"," ",K(n,{url:"https://code.claude.com/docs/en/mcp",children:"https://code.claude.com/docs/en/mcp"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),P.map(i)]},void 0,!0,void 0,this),_[5]=O;else O=_[5];return O}function i(_){let{scope:q,config:f}=_;return K(b,{scope:q,parsingErrors:m(f.errors,"fatal"),warnings:m(f.errors,"warning")},q,!1,void 0,this)}function y(_){let{config:q}=_;return m(q.errors,"warning").length>0}function D(_){let{config:q}=_;return m(q.errors,"fatal").length>0}function m(_,q){return _.filter((f)=>f.mcpErrorMetadata?.severity===q)}var R=W(()=>{Z();t();X()});
2
+ import{Ln as M,Vn as Z,co as d,do as G,jo as t}from"./cli-me4e2p3e.js";import{DQ as k,FQ as $,JQ as n,fR as X}from"./cli-x8xgga1a.js";import{fda as W}from"./cli-w1d8n9g3.js";import{c as T}from"react/compiler-runtime";import{jsxDEV as K}from"react/jsx-dev-runtime";function b(_){let q=T(26),{scope:f,parsingErrors:w,warnings:z}=_,P=w.length>0,v=z.length>0;if(!P&&!v)return null;let h;if(q[0]!==P||q[1]!==v)h=(P||v)&&K($,{color:P?"error":"warning",children:["[",P?"Failed to parse":"Contains warnings","]"," "]},void 0,!0,void 0,this),q[0]=P,q[1]=v,q[2]=h;else h=q[2];let j;if(q[3]!==f)j=G(f),q[3]=f,q[4]=j;else j=q[4];let O;if(q[5]!==j)O=K($,{children:j},void 0,!1,void 0,this),q[5]=j,q[6]=O;else O=q[6];let o;if(q[7]!==h||q[8]!==O)o=K(k,{children:[h,O]},void 0,!0,void 0,this),q[7]=h,q[8]=O,q[9]=o;else o=q[9];let Y;if(q[10]===Symbol.for("react.memo_cache_sentinel"))Y=K($,{dimColor:!0,children:"Location: "},void 0,!1,void 0,this),q[10]=Y;else Y=q[10];let p;if(q[11]!==f)p=d(f),q[11]=f,q[12]=p;else p=q[12];let H;if(q[13]!==p)H=K(k,{children:[Y,K($,{dimColor:!0,children:p},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q[13]=p,q[14]=H;else H=q[14];let e;if(q[15]!==w)e=w.map(J),q[15]=w,q[16]=e;else e=q[16];let u;if(q[17]!==z)u=z.map(l),q[17]=z,q[18]=u;else u=q[18];let r;if(q[19]!==e||q[20]!==u)r=K(k,{marginLeft:1,flexDirection:"column",children:[e,u]},void 0,!0,void 0,this),q[19]=e,q[20]=u,q[21]=r;else r=q[21];let a;if(q[22]!==r||q[23]!==o||q[24]!==H)a=K(k,{flexDirection:"column",marginTop:1,children:[o,H,r]},void 0,!0,void 0,this),q[22]=r,q[23]=o,q[24]=H,q[25]=a;else a=q[25];return a}function l(_,q){let f=_.mcpErrorMetadata?.serverName;return K(k,{children:K($,{children:[K($,{dimColor:!0,children:"\u2514 "},void 0,!1,void 0,this),K($,{color:"warning",children:"[Warning]"},void 0,!1,void 0,this),K($,{dimColor:!0,children:[" ",f&&`[${f}] `,_.path&&_.path!==""?`${_.path}: `:"",_.message]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},`warning-${q}`,!1,void 0,this)}function J(_,q){let f=_.mcpErrorMetadata?.serverName;return K(k,{children:K($,{children:[K($,{dimColor:!0,children:"\u2514 "},void 0,!1,void 0,this),K($,{color:"error",children:"[Error]"},void 0,!1,void 0,this),K($,{dimColor:!0,children:[" ",f&&`[${f}] `,_.path&&_.path!==""?`${_.path}: `:"",_.message]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},`error-${q}`,!1,void 0,this)}function V(){let _=T(6),q;if(_[0]===Symbol.for("react.memo_cache_sentinel"))q={scope:"user",config:M("user")},_[0]=q;else q=_[0];let f;if(_[1]===Symbol.for("react.memo_cache_sentinel"))f={scope:"project",config:M("project")},_[1]=f;else f=_[1];let w;if(_[2]===Symbol.for("react.memo_cache_sentinel"))w={scope:"local",config:M("local")},_[2]=w;else w=_[2];let z;if(_[3]===Symbol.for("react.memo_cache_sentinel"))z=[q,f,w,{scope:"enterprise",config:M("enterprise")}],_[3]=z;else z=_[3];let P=z,v=P.some(D),h=P.some(y);if(!v&&!h)return null;let j;if(_[4]===Symbol.for("react.memo_cache_sentinel"))j=K($,{bold:!0,children:"MCP Config Diagnostics"},void 0,!1,void 0,this),_[4]=j;else j=_[4];let O;if(_[5]===Symbol.for("react.memo_cache_sentinel"))O=K(k,{flexDirection:"column",marginTop:1,marginBottom:1,children:[j,K(k,{marginTop:1,children:K($,{dimColor:!0,children:["For help configuring MCP servers, see:"," ",K(n,{url:"https://code.claude.com/docs/en/mcp",children:"https://code.claude.com/docs/en/mcp"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),P.map(i)]},void 0,!0,void 0,this),_[5]=O;else O=_[5];return O}function i(_){let{scope:q,config:f}=_;return K(b,{scope:q,parsingErrors:m(f.errors,"fatal"),warnings:m(f.errors,"warning")},q,!1,void 0,this)}function y(_){let{config:q}=_;return m(q.errors,"warning").length>0}function D(_){let{config:q}=_;return m(q.errors,"fatal").length>0}function m(_,q){return _.filter((f)=>f.mcpErrorMetadata?.severity===q)}var R=W(()=>{Z();t();X()});
3
3
  export{V as ne,R as oe};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{B_ as o,O_ as i}from"./cli-1qszxdan.js";import{bda as a}from"./cli-x514vyva.js";import{mkdir as p,readFile as s,writeFile as u}from"fs/promises";import{dirname as l,join as d}from"path";function n(){return d(o(),"cc-haha","computer-use-config.json")}function r(t){return{enabled:t?.enabled??g,authorizedApps:t?.authorizedApps??[],grantFlags:{...m,...t?.grantFlags??{}},pythonPath:h(t?.pythonPath)}}function h(t){if(typeof t!=="string")return null;let e=t.trim();return e.length>0?e:null}async function A(){try{let t=await s(n(),"utf8");return r(JSON.parse(t))}catch{return r()}}async function S(t){let e=n();await p(l(e),{recursive:!0}),await u(e,JSON.stringify(t,null,2),"utf8")}var g=!0,m;var C=a(()=>{i();m={clipboardRead:!0,clipboardWrite:!0,systemKeyCombos:!0}});
3
- export{g as BS,m as CS,n as DS,r as ES,h as FS,A as GS,S as HS,C as IS};
2
+ import{F_ as o,S_ as i}from"./cli-tq5z9qv3.js";import{fda as a}from"./cli-w1d8n9g3.js";import{mkdir as p,readFile as s,writeFile as u}from"fs/promises";import{dirname as l,join as d}from"path";function n(){return d(o(),"cc-haha","computer-use-config.json")}function r(t){return{enabled:t?.enabled??g,authorizedApps:t?.authorizedApps??[],grantFlags:{...m,...t?.grantFlags??{}},pythonPath:h(t?.pythonPath)}}function h(t){if(typeof t!=="string")return null;let e=t.trim();return e.length>0?e:null}async function A(){try{let t=await s(n(),"utf8");return r(JSON.parse(t))}catch{return r()}}async function S(t){let e=n();await p(l(e),{recursive:!0}),await u(e,JSON.stringify(t,null,2),"utf8")}var g=!0,m;var C=a(()=>{i();m={clipboardRead:!0,clipboardWrite:!0,systemKeyCombos:!0}});
3
+ export{g as ES,m as FS,n as GS,r as HS,h as IS,A as JS,S as KS,C as LS};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Nh as E,Oh as p,Ph as e,ci as S,gh as h,hh as Oq,hi as qq,ih as n,kh as Uq}from"./cli-5pb6kdxn.js";import{dV as c,fV as d,iV as u,jV as g,oV as Wq}from"./cli-9hskw92e.js";import{B8 as r,w8 as D}from"./cli-3bxtq5dc.js";import{$9 as P,T9 as W,U9 as O,V9 as C,Z9 as _,a_ as v,d_ as f,h_ as M,l_ as y,r_ as V,u_ as t}from"./cli-a98b285v.js";import{bda as N}from"./cli-x514vyva.js";import{homedir as o}from"os";import{resolve as s}from"path";async function kq(Z){let q=Z.trim(),$=M(),Q=q.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(Q?.[1]){let z=Q[1],G=Q[3];return G?{source:"git",url:z,ref:G}:{source:"git",url:z}}if(q.startsWith("http://")||q.startsWith("https://")){let z=q.match(/^([^#]+)(#(.+))?$/),G=z?.[1]||q,X=z?.[3];if(G.endsWith(".git")||G.includes("/_git/"))return X?{source:"git",url:G,ref:X}:{source:"git",url:G};let Y;try{Y=new URL(G)}catch(J){return{source:"url",url:G}}if(Y.hostname==="github.com"||Y.hostname==="www.github.com"){if(Y.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let K=G.endsWith(".git")?G:`${G}.git`;return X?{source:"git",url:K,ref:X}:{source:"git",url:K}}}return{source:"url",url:G}}let x=process.platform==="win32"&&(q.startsWith(".\\")||q.startsWith("..\\")||/^[a-zA-Z]:[/\\]/.test(q));if(q.startsWith("./")||q.startsWith("../")||q.startsWith("/")||q.startsWith("~")||x){let z=s(q.startsWith("~")?q.replace(/^~/,o()):q),G;try{G=await $.stat(z)}catch(X){let Y=O(X);return{error:Y==="ENOENT"?`Path does not exist: ${z}`:`Cannot access path: ${z} (${Y??X})`}}if(G.isFile())if(z.endsWith(".json"))return{source:"file",path:z};else return{error:`File path must point to a .json file (marketplace.json), but got: ${z}`};else if(G.isDirectory())return{source:"directory",path:z};else return{error:`Path is neither a file nor a directory: ${z}`}}if(q.includes("/")&&!q.startsWith("@")){if(q.includes(":"))return null;let z=q.match(/^([^#@]+)(?:[#@](.+))?$/),G=z?.[1]||q,X=z?.[2];return X?{source:"github",repo:G,ref:X}:{source:"github",repo:G}}return null}var a=N(()=>{_();y()});import Qq from"axios";import{randomBytes as Xq}from"crypto";import{readFile as Zq,rename as $q,unlink as Bq,writeFile as Gq}from"fs/promises";import{join as Yq}from"path";function m(){return Yq(S(),Jq)}async function xq(){let Z=m();try{let q=await Zq(Z,{encoding:"utf-8"}),$=v(q);if(typeof $!=="object"||$===null||!("version"in $)||!("fetchedAt"in $)||!("counts"in $))return V("Install counts cache has invalid structure"),null;let Q=$;if(Q.version!==L)return V(`Install counts cache version mismatch (got ${Q.version}, expected ${L})`),null;if(typeof Q.fetchedAt!=="string"||!Array.isArray(Q.counts))return V("Install counts cache has invalid structure"),null;let B=new Date(Q.fetchedAt).getTime();if(Number.isNaN(B))return V("Install counts cache has invalid fetchedAt timestamp"),null;if(!Q.counts.every((G)=>typeof G==="object"&&G!==null&&typeof G.plugin==="string"&&typeof G.unique_installs==="number"))return V("Install counts cache has malformed entries"),null;if(Date.now()-B>Kq)return V("Install counts cache is stale (>24h old)"),null;return{version:Q.version,fetchedAt:Q.fetchedAt,counts:Q.counts}}catch(q){if(O(q)!=="ENOENT")V(`Failed to load install counts cache: ${W(q)}`);return null}}async function zq(Z){let q=m(),$=`${q}.${Xq(8).toString("hex")}.tmp`;try{let Q=S();await M().mkdir(Q);let B=P(Z,null,2);await Gq($,B,{encoding:"utf-8",mode:384}),await $q($,q),V("Install counts cache saved successfully")}catch(Q){D(Q);try{await Bq($)}catch{}}}async function Hq(){V(`Fetching install counts from ${I}`);let Z=performance.now();try{let q=await Qq.get(I,{timeout:1e4});if(!q.data?.plugins||!Array.isArray(q.data.plugins))throw Error("Invalid response format from install counts API");return E("install_counts",I,"success",performance.now()-Z),q.data.plugins}catch(q){throw E("install_counts",I,"failure",performance.now()-Z,p(q)),q}}async function gq(){let Z=await xq();if(Z){V("Using cached install counts"),E("install_counts",I,"cache_hit",0);let q=new Map;for(let $ of Z.counts)q.set($.plugin,$.unique_installs);return q}try{let q=await Hq(),$={version:L,fetchedAt:new Date().toISOString(),counts:q};await zq($);let Q=new Map;for(let B of q)Q.set(B.plugin,B.unique_installs);return Q}catch(q){return D(q),V(`Failed to fetch install counts: ${W(q)}`),null}}function hq(Z){if(Z<1000)return String(Z);if(Z<1e6){let B=(Z/1000).toFixed(1);return B.endsWith(".0")?`${B.slice(0,-2)}K`:`${B}K`}let $=(Z/1e6).toFixed(1);return $.endsWith(".0")?`${$.slice(0,-2)}M`:`${$}M`}var L=1,Jq="install-counts-cache.json",I="https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json",Kq=86400000;var Vq=N(()=>{t();_();y();r();f();e();qq()});import{readdir as vq,readFile as A,stat as Rq}from"fs/promises";import*as H from"path";import{z as Aq}from"zod/v4";function wq(Z){let q=H.basename(Z),$=H.basename(H.dirname(Z));if(q==="plugin.json")return"plugin";if(q==="marketplace.json")return"marketplace";if($===".claude-plugin")return"plugin";return"unknown"}function F(Z){return Z.issues.map((q)=>({path:q.path.join(".")||"root",message:q.message,code:q.code}))}function w(Z,q,$,Q){if(Z.includes(".."))$.push({path:q,message:Q?`Path contains "..": ${Z}. ${Q}`:`Path contains ".." which could be a path traversal attempt: ${Z}`})}function Mq(Z){let q=Z.replace(/^(\.\.\/)+/,"");return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${q!==Z?`./${q}`:"./plugins/my-plugin"}" instead of "${Z}".`}async function j(Z){let q=[],$=[],Q=H.resolve(Z),B;try{B=await A(Q,{encoding:"utf-8"})}catch(X){let Y=O(X),J;if(Y==="ENOENT")J=`File not found: ${Q}`;else if(Y==="EISDIR")J=`Path is not a file: ${Q}`;else J=`Failed to read file: ${W(X)}`;return{success:!1,errors:[{path:"file",message:J,code:Y}],warnings:[],filePath:Q,fileType:"plugin"}}let x;try{x=v(B)}catch(X){return{success:!1,errors:[{path:"json",message:`Invalid JSON syntax: ${W(X)}`}],warnings:[],filePath:Q,fileType:"plugin"}}if(x&&typeof x==="object"){let X=x;if(X.commands)(Array.isArray(X.commands)?X.commands:[X.commands]).forEach((J,K)=>{if(typeof J==="string")w(J,`commands[${K}]`,q)});if(X.agents)(Array.isArray(X.agents)?X.agents:[X.agents]).forEach((J,K)=>{if(typeof J==="string")w(J,`agents[${K}]`,q)});if(X.skills)(Array.isArray(X.skills)?X.skills:[X.skills]).forEach((J,K)=>{if(typeof J==="string")w(J,`skills[${K}]`,q)})}let z=x;if(typeof x==="object"&&x!==null){let X=x,Y=Object.keys(X).filter((J)=>Iq.has(J));if(Y.length>0){let J={...X};for(let K of Y)delete J[K],$.push({path:K,message:`Field '${K}' belongs in the marketplace entry (marketplace.json), `+"not plugin.json. It's harmless here but unused \u2014 Claude Code "+"ignores it at load time."});z=J}}let G=d().strict().safeParse(z);if(!G.success)q.push(...F(G.error));if(G.success){let X=G.data;if(!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(X.name))$.push({path:"name",message:`Plugin name "${X.name}" is not kebab-case. Claude Code accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`});if(!X.version)$.push({path:"version",message:'No version specified. Consider adding a version following semver (e.g., "1.0.0")'});if(!X.description)$.push({path:"description",message:"No description provided. Adding a description helps users understand what your plugin does"});if(!X.author)$.push({path:"author",message:"No author information provided. Consider adding author details for plugin attribution"})}return{success:q.length===0,errors:q,warnings:$,filePath:Q,fileType:"plugin"}}async function k(Z){let q=[],$=[],Q=H.resolve(Z),B;try{B=await A(Q,{encoding:"utf-8"})}catch(X){let Y=O(X),J;if(Y==="ENOENT")J=`File not found: ${Q}`;else if(Y==="EISDIR")J=`Path is not a file: ${Q}`;else J=`Failed to read file: ${W(X)}`;return{success:!1,errors:[{path:"file",message:J,code:Y}],warnings:[],filePath:Q,fileType:"marketplace"}}let x;try{x=v(B)}catch(X){return{success:!1,errors:[{path:"json",message:`Invalid JSON syntax: ${W(X)}`}],warnings:[],filePath:Q,fileType:"marketplace"}}if(x&&typeof x==="object"){let X=x;if(Array.isArray(X.plugins))X.plugins.forEach((Y,J)=>{if(Y&&typeof Y==="object"&&"source"in Y){let K=Y.source;if(typeof K==="string")w(K,`plugins[${J}].source`,q,Mq(K));if(K&&typeof K==="object"&&"path"in K&&typeof K.path==="string")w(K.path,`plugins[${J}].source.path`,q)}})}let G=g().extend({plugins:Aq.array(u().strict())}).strict().safeParse(x);if(!G.success)q.push(...F(G.error));if(G.success){let X=G.data;if(!X.plugins||X.plugins.length===0)$.push({path:"plugins",message:"Marketplace has no plugins defined"});if(X.plugins){X.plugins.forEach((K,U)=>{if(X.plugins.filter((R)=>R.name===K.name).length>1)q.push({path:`plugins[${U}].name`,message:`Duplicate plugin name "${K.name}" found in marketplace`})});let Y=H.dirname(Q),J=H.basename(Y)===".claude-plugin"?H.dirname(Y):Y;for(let[K,U]of X.plugins.entries()){if(!U.version||typeof U.source!=="string"||!U.source.startsWith("./"))continue;let T=H.join(J,U.source,".claude-plugin","plugin.json"),R;try{let i=await A(T,{encoding:"utf-8"}),b=v(i);if(typeof b.version==="string")R=b.version}catch{continue}if(R&&R!==U.version)$.push({path:`plugins[${K}].version`,message:`Entry declares version "${U.version}" but ${U.source}/.claude-plugin/plugin.json says "${R}". `+"At install time, plugin.json wins (calculatePluginVersion precedence) \u2014 the entry version is silently ignored. "+`Update this entry to "${R}" to match.`})}}if(!X.metadata?.description)$.push({path:"metadata.description",message:"No marketplace description provided. Adding a description helps users understand what this marketplace offers"})}return{success:q.length===0,errors:q,warnings:$,filePath:Q,fileType:"marketplace"}}function Eq(Z,q,$){let Q=[],B=[],x=q.match(n);if(!x)return B.push({path:"frontmatter",message:"No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata."}),{success:!0,errors:Q,warnings:B,filePath:Z,fileType:$};let z=x[1]||"",G;try{G=h(z)}catch(K){return Q.push({path:"frontmatter",message:`YAML frontmatter failed to parse: ${W(K)}. At runtime this ${$} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:Q,warnings:B,filePath:Z,fileType:$}}if(G===null||typeof G!=="object"||Array.isArray(G))return Q.push({path:"frontmatter",message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(G)?"an array":G===null?"null":typeof G}.`}),{success:!1,errors:Q,warnings:B,filePath:Z,fileType:$};let X=G;if(X.description!==void 0){let K=X.description;if(typeof K!=="string"&&typeof K!=="number"&&typeof K!=="boolean"&&K!==null)Q.push({path:"description",message:`description must be a string, got ${Array.isArray(K)?"array":typeof K}. At runtime this value is dropped.`})}else B.push({path:"description",message:`No description in frontmatter. A description helps users and Claude understand when to use this ${$}.`});if(X.name!==void 0&&X.name!==null&&typeof X.name!=="string")Q.push({path:"name",message:`name must be a string, got ${typeof X.name}.`});let Y=X["allowed-tools"];if(Y!==void 0&&Y!==null){if(typeof Y!=="string"&&!Array.isArray(Y))Q.push({path:"allowed-tools",message:`allowed-tools must be a string or array of strings, got ${typeof Y}.`});else if(Array.isArray(Y)&&Y.some((K)=>typeof K!=="string"))Q.push({path:"allowed-tools",message:"allowed-tools array must contain only strings."})}let J=X.shell;if(J!==void 0&&J!==null)if(typeof J!=="string")Q.push({path:"shell",message:`shell must be a string, got ${typeof J}.`});else{let K=J.trim().toLowerCase();if(K!=="bash"&&K!=="powershell")Q.push({path:"shell",message:`shell must be 'bash' or 'powershell', got '${J}'.`})}return{success:Q.length===0,errors:Q,warnings:B,filePath:Z,fileType:$}}async function Nq(Z){let q;try{q=await A(Z,{encoding:"utf-8"})}catch(B){if(O(B)==="ENOENT")return{success:!0,errors:[],warnings:[],filePath:Z,fileType:"hooks"};return{success:!1,errors:[{path:"file",message:`Failed to read file: ${W(B)}`}],warnings:[],filePath:Z,fileType:"hooks"}}let $;try{$=v(q)}catch(B){return{success:!1,errors:[{path:"json",message:`Invalid JSON syntax: ${W(B)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:Z,fileType:"hooks"}}let Q=c().safeParse($);if(!Q.success)return{success:!1,errors:F(Q.error),warnings:[],filePath:Z,fileType:"hooks"};return{success:!0,errors:[],warnings:[],filePath:Z,fileType:"hooks"}}async function l(Z,q){let $;try{$=await vq(Z,{withFileTypes:!0})}catch(B){let x=O(B);if(x==="ENOENT"||x==="ENOTDIR")return[];throw B}if(q)return $.filter((B)=>B.isDirectory()).map((B)=>H.join(Z,B.name,"SKILL.md"));let Q=[];for(let B of $){let x=H.join(Z,B.name);if(B.isDirectory())Q.push(...await l(x,!1));else if(B.isFile()&&B.name.toLowerCase().endsWith(".md"))Q.push(x)}return Q}async function eq(Z){let q=[],$=[["skill",H.join(Z,"skills")],["agent",H.join(Z,"agents")],["command",H.join(Z,"commands")]];for(let[B,x]of $){let z=await l(x,B==="skill");for(let G of z){let X;try{X=await A(G,{encoding:"utf-8"})}catch(J){if(C(J))continue;q.push({success:!1,errors:[{path:"file",message:`Failed to read: ${W(J)}`}],warnings:[],filePath:G,fileType:B});continue}let Y=Eq(G,X,B);if(Y.errors.length>0||Y.warnings.length>0)q.push(Y)}}let Q=await Nq(H.join(Z,"hooks","hooks.json"));if(Q.errors.length>0||Q.warnings.length>0)q.push(Q);return q}async function qQ(Z){let q=H.resolve(Z),$=null;try{$=await Rq(q)}catch(B){if(!C(B))throw B}if($?.isDirectory()){let B=H.join(q,".claude-plugin","marketplace.json"),x=await k(B);if(x.errors[0]?.code!=="ENOENT")return x;let z=H.join(q,".claude-plugin","plugin.json"),G=await j(z);if(G.errors[0]?.code!=="ENOENT")return G;return{success:!1,errors:[{path:"directory",message:"No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json"}],warnings:[],filePath:q,fileType:"plugin"}}switch(wq(Z)){case"plugin":return j(Z);case"marketplace":return k(Z);case"unknown":{try{let B=await A(q,{encoding:"utf-8"}),x=v(B);if(Array.isArray(x.plugins))return k(Z)}catch(B){if(O(B)==="ENOENT")return{success:!1,errors:[{path:"file",message:`File not found: ${q}`}],warnings:[],filePath:q,fileType:"plugin"}}return j(Z)}}}var Iq;var _q=N(()=>{_();Uq();f();Oq();Wq();Iq=new Set(["category","source","tags","strict","id"])});
2
+ import{Nh as E,Oh as p,Ph as e,ci as S,gh as h,hh as Oq,hi as qq,ih as n,kh as Uq}from"./cli-me4e2p3e.js";import{gV as c,iV as d,lV as u,mV as g,rV as Wq}from"./cli-msmzt4c3.js";import{E8 as D,J8 as r}from"./cli-4ewb3q42.js";import{X9 as W,Y9 as O,Z9 as C,b_ as _,d_ as P,e_ as v,h_ as f,l_ as M,p_ as y,v_ as V,y_ as t}from"./cli-hke6r0q8.js";import{fda as N}from"./cli-w1d8n9g3.js";import{homedir as o}from"os";import{resolve as s}from"path";async function kq(Z){let q=Z.trim(),$=M(),Q=q.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(Q?.[1]){let z=Q[1],G=Q[3];return G?{source:"git",url:z,ref:G}:{source:"git",url:z}}if(q.startsWith("http://")||q.startsWith("https://")){let z=q.match(/^([^#]+)(#(.+))?$/),G=z?.[1]||q,X=z?.[3];if(G.endsWith(".git")||G.includes("/_git/"))return X?{source:"git",url:G,ref:X}:{source:"git",url:G};let Y;try{Y=new URL(G)}catch(J){return{source:"url",url:G}}if(Y.hostname==="github.com"||Y.hostname==="www.github.com"){if(Y.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let K=G.endsWith(".git")?G:`${G}.git`;return X?{source:"git",url:K,ref:X}:{source:"git",url:K}}}return{source:"url",url:G}}let x=process.platform==="win32"&&(q.startsWith(".\\")||q.startsWith("..\\")||/^[a-zA-Z]:[/\\]/.test(q));if(q.startsWith("./")||q.startsWith("../")||q.startsWith("/")||q.startsWith("~")||x){let z=s(q.startsWith("~")?q.replace(/^~/,o()):q),G;try{G=await $.stat(z)}catch(X){let Y=O(X);return{error:Y==="ENOENT"?`Path does not exist: ${z}`:`Cannot access path: ${z} (${Y??X})`}}if(G.isFile())if(z.endsWith(".json"))return{source:"file",path:z};else return{error:`File path must point to a .json file (marketplace.json), but got: ${z}`};else if(G.isDirectory())return{source:"directory",path:z};else return{error:`Path is neither a file nor a directory: ${z}`}}if(q.includes("/")&&!q.startsWith("@")){if(q.includes(":"))return null;let z=q.match(/^([^#@]+)(?:[#@](.+))?$/),G=z?.[1]||q,X=z?.[2];return X?{source:"github",repo:G,ref:X}:{source:"github",repo:G}}return null}var a=N(()=>{_();y()});import Qq from"axios";import{randomBytes as Xq}from"crypto";import{readFile as Zq,rename as $q,unlink as Bq,writeFile as Gq}from"fs/promises";import{join as Yq}from"path";function m(){return Yq(S(),Jq)}async function xq(){let Z=m();try{let q=await Zq(Z,{encoding:"utf-8"}),$=v(q);if(typeof $!=="object"||$===null||!("version"in $)||!("fetchedAt"in $)||!("counts"in $))return V("Install counts cache has invalid structure"),null;let Q=$;if(Q.version!==L)return V(`Install counts cache version mismatch (got ${Q.version}, expected ${L})`),null;if(typeof Q.fetchedAt!=="string"||!Array.isArray(Q.counts))return V("Install counts cache has invalid structure"),null;let B=new Date(Q.fetchedAt).getTime();if(Number.isNaN(B))return V("Install counts cache has invalid fetchedAt timestamp"),null;if(!Q.counts.every((G)=>typeof G==="object"&&G!==null&&typeof G.plugin==="string"&&typeof G.unique_installs==="number"))return V("Install counts cache has malformed entries"),null;if(Date.now()-B>Kq)return V("Install counts cache is stale (>24h old)"),null;return{version:Q.version,fetchedAt:Q.fetchedAt,counts:Q.counts}}catch(q){if(O(q)!=="ENOENT")V(`Failed to load install counts cache: ${W(q)}`);return null}}async function zq(Z){let q=m(),$=`${q}.${Xq(8).toString("hex")}.tmp`;try{let Q=S();await M().mkdir(Q);let B=P(Z,null,2);await Gq($,B,{encoding:"utf-8",mode:384}),await $q($,q),V("Install counts cache saved successfully")}catch(Q){D(Q);try{await Bq($)}catch{}}}async function Hq(){V(`Fetching install counts from ${I}`);let Z=performance.now();try{let q=await Qq.get(I,{timeout:1e4});if(!q.data?.plugins||!Array.isArray(q.data.plugins))throw Error("Invalid response format from install counts API");return E("install_counts",I,"success",performance.now()-Z),q.data.plugins}catch(q){throw E("install_counts",I,"failure",performance.now()-Z,p(q)),q}}async function gq(){let Z=await xq();if(Z){V("Using cached install counts"),E("install_counts",I,"cache_hit",0);let q=new Map;for(let $ of Z.counts)q.set($.plugin,$.unique_installs);return q}try{let q=await Hq(),$={version:L,fetchedAt:new Date().toISOString(),counts:q};await zq($);let Q=new Map;for(let B of q)Q.set(B.plugin,B.unique_installs);return Q}catch(q){return D(q),V(`Failed to fetch install counts: ${W(q)}`),null}}function hq(Z){if(Z<1000)return String(Z);if(Z<1e6){let B=(Z/1000).toFixed(1);return B.endsWith(".0")?`${B.slice(0,-2)}K`:`${B}K`}let $=(Z/1e6).toFixed(1);return $.endsWith(".0")?`${$.slice(0,-2)}M`:`${$}M`}var L=1,Jq="install-counts-cache.json",I="https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json",Kq=86400000;var Vq=N(()=>{t();_();y();r();f();e();qq()});import{readdir as vq,readFile as A,stat as Rq}from"fs/promises";import*as H from"path";import{z as Aq}from"zod/v4";function wq(Z){let q=H.basename(Z),$=H.basename(H.dirname(Z));if(q==="plugin.json")return"plugin";if(q==="marketplace.json")return"marketplace";if($===".claude-plugin")return"plugin";return"unknown"}function F(Z){return Z.issues.map((q)=>({path:q.path.join(".")||"root",message:q.message,code:q.code}))}function w(Z,q,$,Q){if(Z.includes(".."))$.push({path:q,message:Q?`Path contains "..": ${Z}. ${Q}`:`Path contains ".." which could be a path traversal attempt: ${Z}`})}function Mq(Z){let q=Z.replace(/^(\.\.\/)+/,"");return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${q!==Z?`./${q}`:"./plugins/my-plugin"}" instead of "${Z}".`}async function j(Z){let q=[],$=[],Q=H.resolve(Z),B;try{B=await A(Q,{encoding:"utf-8"})}catch(X){let Y=O(X),J;if(Y==="ENOENT")J=`File not found: ${Q}`;else if(Y==="EISDIR")J=`Path is not a file: ${Q}`;else J=`Failed to read file: ${W(X)}`;return{success:!1,errors:[{path:"file",message:J,code:Y}],warnings:[],filePath:Q,fileType:"plugin"}}let x;try{x=v(B)}catch(X){return{success:!1,errors:[{path:"json",message:`Invalid JSON syntax: ${W(X)}`}],warnings:[],filePath:Q,fileType:"plugin"}}if(x&&typeof x==="object"){let X=x;if(X.commands)(Array.isArray(X.commands)?X.commands:[X.commands]).forEach((J,K)=>{if(typeof J==="string")w(J,`commands[${K}]`,q)});if(X.agents)(Array.isArray(X.agents)?X.agents:[X.agents]).forEach((J,K)=>{if(typeof J==="string")w(J,`agents[${K}]`,q)});if(X.skills)(Array.isArray(X.skills)?X.skills:[X.skills]).forEach((J,K)=>{if(typeof J==="string")w(J,`skills[${K}]`,q)})}let z=x;if(typeof x==="object"&&x!==null){let X=x,Y=Object.keys(X).filter((J)=>Iq.has(J));if(Y.length>0){let J={...X};for(let K of Y)delete J[K],$.push({path:K,message:`Field '${K}' belongs in the marketplace entry (marketplace.json), `+"not plugin.json. It's harmless here but unused \u2014 Claude Code "+"ignores it at load time."});z=J}}let G=d().strict().safeParse(z);if(!G.success)q.push(...F(G.error));if(G.success){let X=G.data;if(!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(X.name))$.push({path:"name",message:`Plugin name "${X.name}" is not kebab-case. Claude Code accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`});if(!X.version)$.push({path:"version",message:'No version specified. Consider adding a version following semver (e.g., "1.0.0")'});if(!X.description)$.push({path:"description",message:"No description provided. Adding a description helps users understand what your plugin does"});if(!X.author)$.push({path:"author",message:"No author information provided. Consider adding author details for plugin attribution"})}return{success:q.length===0,errors:q,warnings:$,filePath:Q,fileType:"plugin"}}async function k(Z){let q=[],$=[],Q=H.resolve(Z),B;try{B=await A(Q,{encoding:"utf-8"})}catch(X){let Y=O(X),J;if(Y==="ENOENT")J=`File not found: ${Q}`;else if(Y==="EISDIR")J=`Path is not a file: ${Q}`;else J=`Failed to read file: ${W(X)}`;return{success:!1,errors:[{path:"file",message:J,code:Y}],warnings:[],filePath:Q,fileType:"marketplace"}}let x;try{x=v(B)}catch(X){return{success:!1,errors:[{path:"json",message:`Invalid JSON syntax: ${W(X)}`}],warnings:[],filePath:Q,fileType:"marketplace"}}if(x&&typeof x==="object"){let X=x;if(Array.isArray(X.plugins))X.plugins.forEach((Y,J)=>{if(Y&&typeof Y==="object"&&"source"in Y){let K=Y.source;if(typeof K==="string")w(K,`plugins[${J}].source`,q,Mq(K));if(K&&typeof K==="object"&&"path"in K&&typeof K.path==="string")w(K.path,`plugins[${J}].source.path`,q)}})}let G=g().extend({plugins:Aq.array(u().strict())}).strict().safeParse(x);if(!G.success)q.push(...F(G.error));if(G.success){let X=G.data;if(!X.plugins||X.plugins.length===0)$.push({path:"plugins",message:"Marketplace has no plugins defined"});if(X.plugins){X.plugins.forEach((K,U)=>{if(X.plugins.filter((R)=>R.name===K.name).length>1)q.push({path:`plugins[${U}].name`,message:`Duplicate plugin name "${K.name}" found in marketplace`})});let Y=H.dirname(Q),J=H.basename(Y)===".claude-plugin"?H.dirname(Y):Y;for(let[K,U]of X.plugins.entries()){if(!U.version||typeof U.source!=="string"||!U.source.startsWith("./"))continue;let T=H.join(J,U.source,".claude-plugin","plugin.json"),R;try{let i=await A(T,{encoding:"utf-8"}),b=v(i);if(typeof b.version==="string")R=b.version}catch{continue}if(R&&R!==U.version)$.push({path:`plugins[${K}].version`,message:`Entry declares version "${U.version}" but ${U.source}/.claude-plugin/plugin.json says "${R}". `+"At install time, plugin.json wins (calculatePluginVersion precedence) \u2014 the entry version is silently ignored. "+`Update this entry to "${R}" to match.`})}}if(!X.metadata?.description)$.push({path:"metadata.description",message:"No marketplace description provided. Adding a description helps users understand what this marketplace offers"})}return{success:q.length===0,errors:q,warnings:$,filePath:Q,fileType:"marketplace"}}function Eq(Z,q,$){let Q=[],B=[],x=q.match(n);if(!x)return B.push({path:"frontmatter",message:"No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata."}),{success:!0,errors:Q,warnings:B,filePath:Z,fileType:$};let z=x[1]||"",G;try{G=h(z)}catch(K){return Q.push({path:"frontmatter",message:`YAML frontmatter failed to parse: ${W(K)}. At runtime this ${$} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:Q,warnings:B,filePath:Z,fileType:$}}if(G===null||typeof G!=="object"||Array.isArray(G))return Q.push({path:"frontmatter",message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(G)?"an array":G===null?"null":typeof G}.`}),{success:!1,errors:Q,warnings:B,filePath:Z,fileType:$};let X=G;if(X.description!==void 0){let K=X.description;if(typeof K!=="string"&&typeof K!=="number"&&typeof K!=="boolean"&&K!==null)Q.push({path:"description",message:`description must be a string, got ${Array.isArray(K)?"array":typeof K}. At runtime this value is dropped.`})}else B.push({path:"description",message:`No description in frontmatter. A description helps users and Claude understand when to use this ${$}.`});if(X.name!==void 0&&X.name!==null&&typeof X.name!=="string")Q.push({path:"name",message:`name must be a string, got ${typeof X.name}.`});let Y=X["allowed-tools"];if(Y!==void 0&&Y!==null){if(typeof Y!=="string"&&!Array.isArray(Y))Q.push({path:"allowed-tools",message:`allowed-tools must be a string or array of strings, got ${typeof Y}.`});else if(Array.isArray(Y)&&Y.some((K)=>typeof K!=="string"))Q.push({path:"allowed-tools",message:"allowed-tools array must contain only strings."})}let J=X.shell;if(J!==void 0&&J!==null)if(typeof J!=="string")Q.push({path:"shell",message:`shell must be a string, got ${typeof J}.`});else{let K=J.trim().toLowerCase();if(K!=="bash"&&K!=="powershell")Q.push({path:"shell",message:`shell must be 'bash' or 'powershell', got '${J}'.`})}return{success:Q.length===0,errors:Q,warnings:B,filePath:Z,fileType:$}}async function Nq(Z){let q;try{q=await A(Z,{encoding:"utf-8"})}catch(B){if(O(B)==="ENOENT")return{success:!0,errors:[],warnings:[],filePath:Z,fileType:"hooks"};return{success:!1,errors:[{path:"file",message:`Failed to read file: ${W(B)}`}],warnings:[],filePath:Z,fileType:"hooks"}}let $;try{$=v(q)}catch(B){return{success:!1,errors:[{path:"json",message:`Invalid JSON syntax: ${W(B)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:Z,fileType:"hooks"}}let Q=c().safeParse($);if(!Q.success)return{success:!1,errors:F(Q.error),warnings:[],filePath:Z,fileType:"hooks"};return{success:!0,errors:[],warnings:[],filePath:Z,fileType:"hooks"}}async function l(Z,q){let $;try{$=await vq(Z,{withFileTypes:!0})}catch(B){let x=O(B);if(x==="ENOENT"||x==="ENOTDIR")return[];throw B}if(q)return $.filter((B)=>B.isDirectory()).map((B)=>H.join(Z,B.name,"SKILL.md"));let Q=[];for(let B of $){let x=H.join(Z,B.name);if(B.isDirectory())Q.push(...await l(x,!1));else if(B.isFile()&&B.name.toLowerCase().endsWith(".md"))Q.push(x)}return Q}async function eq(Z){let q=[],$=[["skill",H.join(Z,"skills")],["agent",H.join(Z,"agents")],["command",H.join(Z,"commands")]];for(let[B,x]of $){let z=await l(x,B==="skill");for(let G of z){let X;try{X=await A(G,{encoding:"utf-8"})}catch(J){if(C(J))continue;q.push({success:!1,errors:[{path:"file",message:`Failed to read: ${W(J)}`}],warnings:[],filePath:G,fileType:B});continue}let Y=Eq(G,X,B);if(Y.errors.length>0||Y.warnings.length>0)q.push(Y)}}let Q=await Nq(H.join(Z,"hooks","hooks.json"));if(Q.errors.length>0||Q.warnings.length>0)q.push(Q);return q}async function qQ(Z){let q=H.resolve(Z),$=null;try{$=await Rq(q)}catch(B){if(!C(B))throw B}if($?.isDirectory()){let B=H.join(q,".claude-plugin","marketplace.json"),x=await k(B);if(x.errors[0]?.code!=="ENOENT")return x;let z=H.join(q,".claude-plugin","plugin.json"),G=await j(z);if(G.errors[0]?.code!=="ENOENT")return G;return{success:!1,errors:[{path:"directory",message:"No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json"}],warnings:[],filePath:q,fileType:"plugin"}}switch(wq(Z)){case"plugin":return j(Z);case"marketplace":return k(Z);case"unknown":{try{let B=await A(q,{encoding:"utf-8"}),x=v(B);if(Array.isArray(x.plugins))return k(Z)}catch(B){if(O(B)==="ENOENT")return{success:!1,errors:[{path:"file",message:`File not found: ${q}`}],warnings:[],filePath:q,fileType:"plugin"}}return j(Z)}}}var Iq;var _q=N(()=>{_();Uq();f();Oq();Wq();Iq=new Set(["category","source","tags","strict","id"])});
3
3
  export{kq as Xc,a as Yc,gq as Zc,hq as _c,Vq as $c,eq as ad,qQ as bd,_q as cd};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Fg as M,Gg as W,gF as O,hF as P,iF as Q,jF as U,mF as X}from"./cli-5pb6kdxn.js";import{bda as V}from"./cli-x514vyva.js";function Y(f){return f==="projectSettings"||f==="policySettings"||f==="command"}function J(f){return O(f)}function L(f,G,q){let v=J(G.source),z=J(q.source),j=G.ruleValue.toolName;if(f==="deny")return`Remove the "${j}" deny rule from ${v}, or remove the specific allow rule from ${z}`;return`Remove the "${j}" ask rule from ${v}, or remove the specific allow rule from ${z}`}function Z(f,G,q){let{toolName:v,ruleContent:z}=f.ruleValue;if(z===void 0)return{shadowed:!1};let j=G.find((E)=>E.ruleValue.toolName===v&&E.ruleValue.ruleContent===void 0);if(!j)return{shadowed:!1};if(v===M&&q.sandboxAutoAllowEnabled){if(!Y(j.source))return{shadowed:!1}}return{shadowed:!0,shadowedBy:j,shadowType:"ask"}}function _(f,G){let{toolName:q,ruleContent:v}=f.ruleValue;if(v===void 0)return{shadowed:!1};let z=G.find((j)=>j.ruleValue.toolName===q&&j.ruleValue.ruleContent===void 0);if(!z)return{shadowed:!1};return{shadowed:!0,shadowedBy:z,shadowType:"deny"}}function F(f,G){let q=[],v=P(f),z=U(f),j=Q(f);for(let E of v){let H=_(E,j);if(H.shadowed){let K=J(H.shadowedBy.source);q.push({rule:E,reason:`Blocked by "${H.shadowedBy.ruleValue.toolName}" deny rule (from ${K})`,shadowedBy:H.shadowedBy,shadowType:"deny",fix:L("deny",H.shadowedBy,E)});continue}let I=Z(E,z,G);if(I.shadowed){let K=J(I.shadowedBy.source);q.push({rule:E,reason:`Shadowed by "${I.shadowedBy.ruleValue.toolName}" ask rule (from ${K})`,shadowedBy:I.shadowedBy,shadowType:"ask",fix:L("ask",I.shadowedBy,E)})}}return q}var $=V(()=>{W();X()});
2
+ import{Fg as M,Gg as W,dF as O,eF as P,fF as Q,gF as U,jF as X}from"./cli-me4e2p3e.js";import{fda as V}from"./cli-w1d8n9g3.js";function Y(f){return f==="projectSettings"||f==="policySettings"||f==="command"}function J(f){return O(f)}function L(f,G,q){let v=J(G.source),z=J(q.source),j=G.ruleValue.toolName;if(f==="deny")return`Remove the "${j}" deny rule from ${v}, or remove the specific allow rule from ${z}`;return`Remove the "${j}" ask rule from ${v}, or remove the specific allow rule from ${z}`}function Z(f,G,q){let{toolName:v,ruleContent:z}=f.ruleValue;if(z===void 0)return{shadowed:!1};let j=G.find((E)=>E.ruleValue.toolName===v&&E.ruleValue.ruleContent===void 0);if(!j)return{shadowed:!1};if(v===M&&q.sandboxAutoAllowEnabled){if(!Y(j.source))return{shadowed:!1}}return{shadowed:!0,shadowedBy:j,shadowType:"ask"}}function _(f,G){let{toolName:q,ruleContent:v}=f.ruleValue;if(v===void 0)return{shadowed:!1};let z=G.find((j)=>j.ruleValue.toolName===q&&j.ruleValue.ruleContent===void 0);if(!z)return{shadowed:!1};return{shadowed:!0,shadowedBy:z,shadowType:"deny"}}function F(f,G){let q=[],v=P(f),z=U(f),j=Q(f);for(let E of v){let H=_(E,j);if(H.shadowed){let K=J(H.shadowedBy.source);q.push({rule:E,reason:`Blocked by "${H.shadowedBy.ruleValue.toolName}" deny rule (from ${K})`,shadowedBy:H.shadowedBy,shadowType:"deny",fix:L("deny",H.shadowedBy,E)});continue}let I=Z(E,z,G);if(I.shadowed){let K=J(I.shadowedBy.source);q.push({rule:E,reason:`Shadowed by "${I.shadowedBy.ruleValue.toolName}" ask rule (from ${K})`,shadowedBy:I.shadowedBy,shadowType:"ask",fix:L("ask",I.shadowedBy,E)})}}return q}var $=V(()=>{W();X()});
3
3
  export{F as ie,$ as je};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{$F as X,aG as n,bG as l,cG as A,dG as o,eG as V,fG as c,jG as u,kG as t}from"./cli-5pb6kdxn.js";import{HO as y,IO as I}from"./cli-s6qk3rbv.js";import{GQ as L,IQ as m,ZQ as S,iR as D,sQ as a,tQ as x}from"./cli-5wh173wa.js";import{bda as N}from"./cli-x514vyva.js";import{useCallback as C,useState as T}from"react";function e(Y){if(Y.ctrl&&(Y.key==="k"||Y.key==="u"||Y.key==="w"))return!0;if(Y.meta&&Y.key==="backspace")return!0;return!1}function s(Y){return(Y.ctrl||Y.meta)&&Y.key==="y"}function P_({isActive:Y,onExit:K,onCancel:j,onExitUp:J,columns:O,passthroughCtrlKeys:w=[],initialQuery:W="",backspaceExitsOnEmpty:k=!0}){let{columns:Z}=y(),R=O??Z,[M,v]=T(W),[f,$]=T(W.length),b=C((_)=>{v(_),$(_.length)},[]),p=(_)=>{if(!Y)return;let z=u.fromText(M,R,f);if(_.ctrl&&w.includes(_.key.toLowerCase()))return;if(!e(_))l();if(!s(_))c();if(_.key==="return"||_.key==="down"){_.preventDefault(),K();return}if(_.key==="up"){if(_.preventDefault(),J)J();return}if(_.key==="escape"){if(_.preventDefault(),j)j();else if(M.length>0)v(""),$(0);else K();return}if(_.key==="backspace"){if(_.preventDefault(),_.meta){let{cursor:P,killed:h}=z.deleteWordBefore();X(h,"prepend"),v(P.text),$(P.offset);return}if(M.length===0){if(k)(j??K)();return}let q=z.backspace();v(q.text),$(q.offset);return}if(_.key==="delete"){_.preventDefault();let q=z.del();v(q.text),$(q.offset);return}if(_.key==="left"&&(_.ctrl||_.meta||_.fn)){_.preventDefault();let q=z.prevWord();$(q.offset);return}if(_.key==="right"&&(_.ctrl||_.meta||_.fn)){_.preventDefault();let q=z.nextWord();$(q.offset);return}if(_.key==="left"){_.preventDefault();let q=z.left();$(q.offset);return}if(_.key==="right"){_.preventDefault();let q=z.right();$(q.offset);return}if(_.key==="home"){_.preventDefault(),$(0);return}if(_.key==="end"){_.preventDefault(),$(M.length);return}if(_.ctrl){switch(_.preventDefault(),_.key.toLowerCase()){case"a":$(0);return;case"e":$(M.length);return;case"b":$(z.left().offset);return;case"f":$(z.right().offset);return;case"d":{if(M.length===0){(j??K)();return}let q=z.del();v(q.text),$(q.offset);return}case"h":{if(M.length===0){if(k)(j??K)();return}let q=z.backspace();v(q.text),$(q.offset);return}case"k":{let{cursor:q,killed:P}=z.deleteToLineEnd();X(P,"append"),v(q.text),$(q.offset);return}case"u":{let{cursor:q,killed:P}=z.deleteToLineStart();X(P,"prepend"),v(q.text),$(q.offset);return}case"w":{let{cursor:q,killed:P}=z.deleteWordBefore();X(P,"prepend"),v(q.text),$(q.offset);return}case"y":{let q=n();if(q.length>0){let P=z.offset,h=z.insert(q);A(P,q.length),v(h.text),$(h.offset)}return}case"g":case"c":if(j){j();return}}return}if(_.meta){switch(_.preventDefault(),_.key.toLowerCase()){case"b":$(z.prevWord().offset);return;case"f":$(z.nextWord().offset);return;case"d":{let q=z.deleteWordAfter();v(q.text),$(q.offset);return}case"y":{let q=o();if(q){let{text:P,start:h,length:G}=q,i=M.slice(0,h),g=M.slice(h+G),r=i+P+g,E=h+P.length;V(P.length),v(r),$(E)}return}}return}if(_.key==="tab")return;if(_.key.length>=1&&!B.has(_.key)){_.preventDefault();let q=z.insert(_.key);v(q.text),$(q.offset)}};return S((_,z,q)=>{p(new a(q.keypress))},{isActive:Y}),{query:M,setQuery:b,cursorOffset:f,handleKeyDown:p}}var B;var F=N(()=>{x();D();t();I();B=new Set(["pageup","pagedown","insert","wheelup","wheeldown","mouse","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12"])});import{c as U}from"react/compiler-runtime";import{jsxDEV as H,Fragment as d}from"react/jsx-dev-runtime";function Y_(Y){let K=U(17),{query:j,placeholder:J,isFocused:O,isTerminalFocused:w,prefix:W,width:k,cursorOffset:Z,borderless:R}=Y,M=J===void 0?"Search\u2026":J,v=W===void 0?"\u2315":W,f=R===void 0?!1:R,$=Z??j.length,b=f?void 0:"round",p=O?"suggestion":void 0,_=!O,z=f?0:1,q=!O,P;if(K[0]!==O||K[1]!==w||K[2]!==$||K[3]!==M||K[4]!==j)P=O?H(d,{children:j?w?H(d,{children:[H(m,{children:j.slice(0,$)},void 0,!1,void 0,this),H(m,{inverse:!0,children:$<j.length?j[$]:" "},void 0,!1,void 0,this),$<j.length&&H(m,{children:j.slice($+1)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H(m,{children:j},void 0,!1,void 0,this):w?H(d,{children:[H(m,{inverse:!0,children:M.charAt(0)},void 0,!1,void 0,this),H(m,{dimColor:!0,children:M.slice(1)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H(m,{dimColor:!0,children:M},void 0,!1,void 0,this)},void 0,!1,void 0,this):j?H(m,{children:j},void 0,!1,void 0,this):H(m,{children:M},void 0,!1,void 0,this),K[0]=O,K[1]=w,K[2]=$,K[3]=M,K[4]=j,K[5]=P;else P=K[5];let h;if(K[6]!==v||K[7]!==q||K[8]!==P)h=H(m,{dimColor:q,children:[v," ",P]},void 0,!0,void 0,this),K[6]=v,K[7]=q,K[8]=P,K[9]=h;else h=K[9];let G;if(K[10]!==h||K[11]!==b||K[12]!==p||K[13]!==_||K[14]!==z||K[15]!==k)G=H(L,{flexShrink:0,borderStyle:b,borderColor:p,borderDimColor:_,paddingX:z,width:k,children:h},void 0,!1,void 0,this),K[10]=h,K[11]=b,K[12]=p,K[13]=_,K[14]=z,K[15]=k,K[16]=G;else G=K[16];return G}var Q=N(()=>{D()});
2
+ import{$F as A,YF as X,ZF as n,_F as l,aG as o,bG as V,cG as c,gG as u,hG as t}from"./cli-me4e2p3e.js";import{EO as y,FO as I}from"./cli-akcxtvv9.js";import{DQ as L,FQ as m,WQ as S,fR as D,pQ as a,qQ as x}from"./cli-x8xgga1a.js";import{fda as N}from"./cli-w1d8n9g3.js";import{useCallback as C,useState as T}from"react";function e(Y){if(Y.ctrl&&(Y.key==="k"||Y.key==="u"||Y.key==="w"))return!0;if(Y.meta&&Y.key==="backspace")return!0;return!1}function s(Y){return(Y.ctrl||Y.meta)&&Y.key==="y"}function P_({isActive:Y,onExit:K,onCancel:j,onExitUp:J,columns:O,passthroughCtrlKeys:w=[],initialQuery:W="",backspaceExitsOnEmpty:k=!0}){let{columns:Z}=y(),R=O??Z,[M,v]=T(W),[f,$]=T(W.length),b=C((_)=>{v(_),$(_.length)},[]),p=(_)=>{if(!Y)return;let z=u.fromText(M,R,f);if(_.ctrl&&w.includes(_.key.toLowerCase()))return;if(!e(_))l();if(!s(_))c();if(_.key==="return"||_.key==="down"){_.preventDefault(),K();return}if(_.key==="up"){if(_.preventDefault(),J)J();return}if(_.key==="escape"){if(_.preventDefault(),j)j();else if(M.length>0)v(""),$(0);else K();return}if(_.key==="backspace"){if(_.preventDefault(),_.meta){let{cursor:P,killed:h}=z.deleteWordBefore();X(h,"prepend"),v(P.text),$(P.offset);return}if(M.length===0){if(k)(j??K)();return}let q=z.backspace();v(q.text),$(q.offset);return}if(_.key==="delete"){_.preventDefault();let q=z.del();v(q.text),$(q.offset);return}if(_.key==="left"&&(_.ctrl||_.meta||_.fn)){_.preventDefault();let q=z.prevWord();$(q.offset);return}if(_.key==="right"&&(_.ctrl||_.meta||_.fn)){_.preventDefault();let q=z.nextWord();$(q.offset);return}if(_.key==="left"){_.preventDefault();let q=z.left();$(q.offset);return}if(_.key==="right"){_.preventDefault();let q=z.right();$(q.offset);return}if(_.key==="home"){_.preventDefault(),$(0);return}if(_.key==="end"){_.preventDefault(),$(M.length);return}if(_.ctrl){switch(_.preventDefault(),_.key.toLowerCase()){case"a":$(0);return;case"e":$(M.length);return;case"b":$(z.left().offset);return;case"f":$(z.right().offset);return;case"d":{if(M.length===0){(j??K)();return}let q=z.del();v(q.text),$(q.offset);return}case"h":{if(M.length===0){if(k)(j??K)();return}let q=z.backspace();v(q.text),$(q.offset);return}case"k":{let{cursor:q,killed:P}=z.deleteToLineEnd();X(P,"append"),v(q.text),$(q.offset);return}case"u":{let{cursor:q,killed:P}=z.deleteToLineStart();X(P,"prepend"),v(q.text),$(q.offset);return}case"w":{let{cursor:q,killed:P}=z.deleteWordBefore();X(P,"prepend"),v(q.text),$(q.offset);return}case"y":{let q=n();if(q.length>0){let P=z.offset,h=z.insert(q);A(P,q.length),v(h.text),$(h.offset)}return}case"g":case"c":if(j){j();return}}return}if(_.meta){switch(_.preventDefault(),_.key.toLowerCase()){case"b":$(z.prevWord().offset);return;case"f":$(z.nextWord().offset);return;case"d":{let q=z.deleteWordAfter();v(q.text),$(q.offset);return}case"y":{let q=o();if(q){let{text:P,start:h,length:G}=q,i=M.slice(0,h),g=M.slice(h+G),r=i+P+g,E=h+P.length;V(P.length),v(r),$(E)}return}}return}if(_.key==="tab")return;if(_.key.length>=1&&!B.has(_.key)){_.preventDefault();let q=z.insert(_.key);v(q.text),$(q.offset)}};return S((_,z,q)=>{p(new a(q.keypress))},{isActive:Y}),{query:M,setQuery:b,cursorOffset:f,handleKeyDown:p}}var B;var F=N(()=>{x();D();t();I();B=new Set(["pageup","pagedown","insert","wheelup","wheeldown","mouse","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12"])});import{c as U}from"react/compiler-runtime";import{jsxDEV as H,Fragment as d}from"react/jsx-dev-runtime";function Y_(Y){let K=U(17),{query:j,placeholder:J,isFocused:O,isTerminalFocused:w,prefix:W,width:k,cursorOffset:Z,borderless:R}=Y,M=J===void 0?"Search\u2026":J,v=W===void 0?"\u2315":W,f=R===void 0?!1:R,$=Z??j.length,b=f?void 0:"round",p=O?"suggestion":void 0,_=!O,z=f?0:1,q=!O,P;if(K[0]!==O||K[1]!==w||K[2]!==$||K[3]!==M||K[4]!==j)P=O?H(d,{children:j?w?H(d,{children:[H(m,{children:j.slice(0,$)},void 0,!1,void 0,this),H(m,{inverse:!0,children:$<j.length?j[$]:" "},void 0,!1,void 0,this),$<j.length&&H(m,{children:j.slice($+1)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H(m,{children:j},void 0,!1,void 0,this):w?H(d,{children:[H(m,{inverse:!0,children:M.charAt(0)},void 0,!1,void 0,this),H(m,{dimColor:!0,children:M.slice(1)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H(m,{dimColor:!0,children:M},void 0,!1,void 0,this)},void 0,!1,void 0,this):j?H(m,{children:j},void 0,!1,void 0,this):H(m,{children:M},void 0,!1,void 0,this),K[0]=O,K[1]=w,K[2]=$,K[3]=M,K[4]=j,K[5]=P;else P=K[5];let h;if(K[6]!==v||K[7]!==q||K[8]!==P)h=H(m,{dimColor:q,children:[v," ",P]},void 0,!0,void 0,this),K[6]=v,K[7]=q,K[8]=P,K[9]=h;else h=K[9];let G;if(K[10]!==h||K[11]!==b||K[12]!==p||K[13]!==_||K[14]!==z||K[15]!==k)G=H(L,{flexShrink:0,borderStyle:b,borderColor:p,borderDimColor:_,paddingX:z,width:k,children:h},void 0,!1,void 0,this),K[10]=h,K[11]=b,K[12]=p,K[13]=_,K[14]=z,K[15]=k,K[16]=G;else G=K[16];return G}var Q=N(()=>{D()});
3
3
  export{Y_ as cf,Q as df,P_ as ef,F as ff};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Ck as _,Vj as f}from"./cli-me4e2p3e.js";import{F1 as x,H1 as K,NW as T,Q3 as A,_W as W,a3 as k,rU as L}from"./cli-msmzt4c3.js";import{$4 as q,a5 as Q}from"./cli-fakdskp6.js";import{E5 as v}from"./cli-pgg33dhw.js";import{A7 as H,Q6 as w}from"./cli-fdya77ch.js";import{Z8 as B}from"./cli-t9jht3kb.js";import{C9 as U}from"./cli-kq16afrr.js";import{b_ as O}from"./cli-hke6r0q8.js";import{b$ as $,bda as X}from"./cli-3ac555qw.js";import{fda as G}from"./cli-w1d8n9g3.js";import{z as b}from"zod/v4";var V,Z;var J=G(()=>{Q();V=q(()=>b.object({entries:b.record(b.string(),b.string())})),Z=q(()=>b.object({userId:b.string(),version:b.number(),lastModified:b.string(),checksum:b.string(),content:V()}))});import r from"axios";import o from"lodash-es/pickBy.js";var Y=G(()=>{X();U();x();f();A();w();O();H();W();L();T();$();v();K();k();B();_();J()});
3
+ export{Y as tb};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{A_ as FJ,x_ as a}from"./cli-jmypsed1.js";import{B_ as i,E_ as F,O_ as RJ}from"./cli-1qszxdan.js";import{Zca as o,a$ as n}from"./cli-w754xmyv.js";import{bda as B,dda as V,eda as H}from"./cli-x514vyva.js";function y({writeFn:J,flushIntervalMs:K=1000,maxBufferSize:Q=100,maxBufferBytes:X=1/0,immediateMode:Z=!1}){let Y=[],$=0,G=null,U=null;function j(){if(G)clearTimeout(G),G=null}function I(){if(U)J(U.join("")),U=null;if(Y.length===0)return;J(Y.join("")),Y=[],$=0,j()}function N(){if(!G)G=setTimeout(I,K)}function C(){if(U){U.push(...Y),Y=[],$=0,j();return}let W=Y;Y=[],$=0,j(),U=W,setImmediate(()=>{let w=U;if(U=null,w)J(w.join(""))})}return{write(W){if(Z){J(W);return}if(Y.push(W),$+=W.length,N(),Y.length>=Q||$>=X)C()},flush:I,dispose(){I()}}}var v=()=>{};function b(J){return D.add(J),()=>D.delete(J)}async function nJ(){await Promise.all(Array.from(D).map((J)=>J()))}var D;var P=B(()=>{D=new Set});import{APIUserAbortError as qJ}from"@anthropic-ai/sdk";function rJ(J){return J instanceof c||J instanceof qJ||J instanceof Error&&J.name==="AbortError"}function aJ(J,K){return J instanceof Error&&J.message===K}function sJ(J){return J instanceof Error?J:Error(String(J))}function jJ(J){return J instanceof Error?J.message:String(J)}function z(J){if(J&&typeof J==="object"&&"code"in J&&typeof J.code==="string")return J.code;return}function tJ(J){return z(J)==="ENOENT"}function eJ(J){if(J&&typeof J==="object"&&"path"in J&&typeof J.path==="string")return J.path;return}function JK(J){let K=z(J);return K==="ENOENT"||K==="EACCES"||K==="EPERM"||K==="ENOTDIR"||K==="ELOOP"}function KK(J){let K=jJ(J);if(!J||typeof J!=="object"||!("isAxiosError"in J)||!J.isAxiosError)return{kind:"other",message:K};let Q=J,X=Q.response?.status;if(X===401||X===403)return{kind:"auth",status:X,message:K};if(Q.code==="ECONNABORTED")return{kind:"timeout",status:X,message:K};if(Q.code==="ECONNREFUSED"||Q.code==="ENOTFOUND")return{kind:"network",status:X,message:K};return{kind:"http",status:X,message:K}}var GJ,UJ,c,VJ,HJ,_J,NJ;var m=B(()=>{GJ=class GJ extends Error{constructor(J){super(J);this.name=this.constructor.name}};UJ=class UJ extends Error{};c=class c extends Error{constructor(J){super(J);this.name="AbortError"}};VJ=class VJ extends Error{filePath;defaultConfig;constructor(J,K,Q){super(J);this.name="ConfigParseError",this.filePath=K,this.defaultConfig=Q}};HJ=class HJ extends Error{stdout;stderr;code;interrupted;constructor(J,K,Q,X){super("Shell command failed");this.stdout=J;this.stderr=K;this.code=Q;this.interrupted=X;this.name="ShellError"}};_J=class _J extends Error{formattedMessage;constructor(J,K){super(J);this.formattedMessage=K;this.name="TeleportOperationError"}};NJ=class NJ extends Error{telemetryMessage;constructor(J,K){super(J);this.name="TelemetrySafeError",this.telemetryMessage=K??J}}});import IJ from"lodash-es/memoize.js";function AJ(J){let K=[],Q=J.match(/^MCP server ["']([^"']+)["']/);if(Q&&Q[1])K.push("mcp"),K.push(Q[1].toLowerCase());else{let Y=J.match(/^([^:[]+):/);if(Y&&Y[1])K.push(Y[1].trim().toLowerCase())}let X=J.match(/^\[([^\]]+)]/);if(X&&X[1])K.push(X[1].trim().toLowerCase());if(J.toLowerCase().includes("1p event:"))K.push("1p");let Z=J.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(Z&&Z[1]){let Y=Z[1].trim().toLowerCase();if(Y.length<30&&!Y.includes(" "))K.push(Y)}return Array.from(new Set(K))}function WJ(J,K){if(!K)return!0;if(J.length===0)return!1;if(K.isExclusive)return!J.some((Q)=>K.exclude.includes(Q));else return J.some((Q)=>K.include.includes(Q))}function p(J,K){if(!K)return!0;let Q=AJ(J);return WJ(Q,K)}var u;var h=B(()=>{u=IJ((J)=>{if(!J||J.trim()==="")return null;let K=J.split(",").map((Y)=>Y.trim()).filter(Boolean);if(K.length===0)return null;let Q=K.some((Y)=>Y.startsWith("!")),X=K.some((Y)=>!Y.startsWith("!"));if(Q&&X)return null;let Z=K.map((Y)=>Y.replace(/^!/,"").toLowerCase());return{include:Q?[]:Z,exclude:Q?Z:[],isExclusive:Q}})});import*as q from"fs";import{mkdir as CJ,open as M,readdir as BJ,readFile as d,rename as zJ,rmdir as TJ,rm as kJ,stat as MJ,unlink as OJ}from"fs/promises";import{homedir as f}from"os";import*as A from"path";function l(J,K){if(K.startsWith("//")||K.startsWith("\\\\"))return{resolvedPath:K,isSymlink:!1,isCanonical:!1};try{let Q=J.lstatSync(K);if(Q.isFIFO()||Q.isSocket()||Q.isCharacterDevice()||Q.isBlockDevice())return{resolvedPath:K,isSymlink:!1,isCanonical:!1};let X=J.realpathSync(K);return{resolvedPath:X,isSymlink:X!==K,isCanonical:!0}}catch(Q){return{resolvedPath:K,isSymlink:!1,isCanonical:!1}}}function UK(J,K,Q){let{resolvedPath:X}=l(J,K);if(Q.has(X))return!0;return Q.add(X),!1}function xJ(J,K){let Q=K,X=[];while(Q!==A.dirname(Q)){let Z;try{Z=J.lstatSync(Q)}catch{X.unshift(A.basename(Q)),Q=A.dirname(Q);continue}if(Z.isSymbolicLink())try{let Y=J.realpathSync(Q);return X.length===0?Y:A.join(Y,...X)}catch{let Y=J.readlinkSync(Q),$=A.isAbsolute(Y)?Y:A.resolve(A.dirname(Q),Y);return X.length===0?$:A.join($,...X)}try{let Y=J.realpathSync(Q);if(Y!==Q)return X.length===0?Y:A.join(Y,...X)}catch{}return}return}function VK(J){let K=J;if(K==="~")K=f().normalize("NFC");else if(K.startsWith("~/"))K=A.join(f().normalize("NFC"),K.slice(2));let Q=new Set,X=O();if(Q.add(K),K.startsWith("//")||K.startsWith("\\\\"))return Array.from(Q);try{let $=K,G=new Set,U=40;for(let j=0;j<U;j++){if(G.has($))break;if(G.add($),!X.existsSync($)){if($===K){let W=xJ(X,K);if(W!==void 0)Q.add(W)}break}let I=X.lstatSync($);if(I.isFIFO()||I.isSocket()||I.isCharacterDevice()||I.isBlockDevice())break;if(!I.isSymbolicLink())break;let N=X.readlinkSync($),C=A.isAbsolute(N)?N:A.resolve(A.dirname($),N);Q.add(C),$=C}}catch{}let{resolvedPath:Z,isSymlink:Y}=l(X,K);if(Y&&Z!==K)Q.add(Z);return Array.from(Q)}function O(){return EJ}async function HK(J,K,Q){let U=[];try{const X=V(U,await M(J,"r"),1);let Z=(await X.stat()).size;if(Z<=K)return null;let Y=Math.min(Z-K,Q);let $=Buffer.allocUnsafe(Y);let G=0;while(G<Y){let{bytesRead:W}=await X.read($,G,Y-G,K+G);if(W===0)break;G+=W}return{content:$.toString("utf8",0,G),bytesRead:G,bytesTotal:Z}}catch(j){var I=j,N=1}finally{var C=H(U,I,N);C&&await C}}async function _K(J,K){let U=[];try{const Q=V(U,await M(J,"r"),1);let X=(await Q.stat()).size;if(X===0)return{content:"",bytesRead:0,bytesTotal:0};let Z=Math.max(0,X-K);let Y=X-Z;let $=Buffer.allocUnsafe(Y);let G=0;while(G<Y){let{bytesRead:W}=await Q.read($,G,Y-G,Z+G);if(W===0)break;G+=W}return{content:$.toString("utf8",0,G),bytesRead:G,bytesTotal:X}}catch(j){var I=j,N=1}finally{var C=H(U,I,N);C&&await C}}async function*NK(J){let Q=await M(J,"r");try{let Z=(await Q.stat()).size,Y=Buffer.alloc(0),$=Buffer.alloc(4096);while(Z>0){let G=Math.min(4096,Z);Z-=G,await Q.read($,0,G,Z);let U=Buffer.concat([$.subarray(0,G),Y]),j=U.indexOf(10);if(j===-1){Y=U;continue}Y=Buffer.from(U.subarray(0,j));let I=U.toString("utf8",j+1).split(`
2
+ import{B_ as a,E_ as FJ}from"./cli-x70v8rsj.js";import{F_ as i,I_ as F,S_ as RJ}from"./cli-tq5z9qv3.js";import{bda as o,e$ as n}from"./cli-3ac555qw.js";import{fda as B,hda as V,ida as H}from"./cli-w1d8n9g3.js";function y({writeFn:J,flushIntervalMs:K=1000,maxBufferSize:Q=100,maxBufferBytes:X=1/0,immediateMode:Z=!1}){let Y=[],$=0,G=null,U=null;function j(){if(G)clearTimeout(G),G=null}function I(){if(U)J(U.join("")),U=null;if(Y.length===0)return;J(Y.join("")),Y=[],$=0,j()}function N(){if(!G)G=setTimeout(I,K)}function C(){if(U){U.push(...Y),Y=[],$=0,j();return}let W=Y;Y=[],$=0,j(),U=W,setImmediate(()=>{let w=U;if(U=null,w)J(w.join(""))})}return{write(W){if(Z){J(W);return}if(Y.push(W),$+=W.length,N(),Y.length>=Q||$>=X)C()},flush:I,dispose(){I()}}}var v=()=>{};function b(J){return D.add(J),()=>D.delete(J)}async function nJ(){await Promise.all(Array.from(D).map((J)=>J()))}var D;var P=B(()=>{D=new Set});import{APIUserAbortError as qJ}from"@anthropic-ai/sdk";function rJ(J){return J instanceof c||J instanceof qJ||J instanceof Error&&J.name==="AbortError"}function aJ(J,K){return J instanceof Error&&J.message===K}function sJ(J){return J instanceof Error?J:Error(String(J))}function jJ(J){return J instanceof Error?J.message:String(J)}function z(J){if(J&&typeof J==="object"&&"code"in J&&typeof J.code==="string")return J.code;return}function tJ(J){return z(J)==="ENOENT"}function eJ(J){if(J&&typeof J==="object"&&"path"in J&&typeof J.path==="string")return J.path;return}function JK(J){let K=z(J);return K==="ENOENT"||K==="EACCES"||K==="EPERM"||K==="ENOTDIR"||K==="ELOOP"}function KK(J){let K=jJ(J);if(!J||typeof J!=="object"||!("isAxiosError"in J)||!J.isAxiosError)return{kind:"other",message:K};let Q=J,X=Q.response?.status;if(X===401||X===403)return{kind:"auth",status:X,message:K};if(Q.code==="ECONNABORTED")return{kind:"timeout",status:X,message:K};if(Q.code==="ECONNREFUSED"||Q.code==="ENOTFOUND")return{kind:"network",status:X,message:K};return{kind:"http",status:X,message:K}}var GJ,UJ,c,VJ,HJ,_J,NJ;var m=B(()=>{GJ=class GJ extends Error{constructor(J){super(J);this.name=this.constructor.name}};UJ=class UJ extends Error{};c=class c extends Error{constructor(J){super(J);this.name="AbortError"}};VJ=class VJ extends Error{filePath;defaultConfig;constructor(J,K,Q){super(J);this.name="ConfigParseError",this.filePath=K,this.defaultConfig=Q}};HJ=class HJ extends Error{stdout;stderr;code;interrupted;constructor(J,K,Q,X){super("Shell command failed");this.stdout=J;this.stderr=K;this.code=Q;this.interrupted=X;this.name="ShellError"}};_J=class _J extends Error{formattedMessage;constructor(J,K){super(J);this.formattedMessage=K;this.name="TeleportOperationError"}};NJ=class NJ extends Error{telemetryMessage;constructor(J,K){super(J);this.name="TelemetrySafeError",this.telemetryMessage=K??J}}});import IJ from"lodash-es/memoize.js";function AJ(J){let K=[],Q=J.match(/^MCP server ["']([^"']+)["']/);if(Q&&Q[1])K.push("mcp"),K.push(Q[1].toLowerCase());else{let Y=J.match(/^([^:[]+):/);if(Y&&Y[1])K.push(Y[1].trim().toLowerCase())}let X=J.match(/^\[([^\]]+)]/);if(X&&X[1])K.push(X[1].trim().toLowerCase());if(J.toLowerCase().includes("1p event:"))K.push("1p");let Z=J.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(Z&&Z[1]){let Y=Z[1].trim().toLowerCase();if(Y.length<30&&!Y.includes(" "))K.push(Y)}return Array.from(new Set(K))}function WJ(J,K){if(!K)return!0;if(J.length===0)return!1;if(K.isExclusive)return!J.some((Q)=>K.exclude.includes(Q));else return J.some((Q)=>K.include.includes(Q))}function p(J,K){if(!K)return!0;let Q=AJ(J);return WJ(Q,K)}var u;var h=B(()=>{u=IJ((J)=>{if(!J||J.trim()==="")return null;let K=J.split(",").map((Y)=>Y.trim()).filter(Boolean);if(K.length===0)return null;let Q=K.some((Y)=>Y.startsWith("!")),X=K.some((Y)=>!Y.startsWith("!"));if(Q&&X)return null;let Z=K.map((Y)=>Y.replace(/^!/,"").toLowerCase());return{include:Q?[]:Z,exclude:Q?Z:[],isExclusive:Q}})});import*as q from"fs";import{mkdir as CJ,open as M,readdir as BJ,readFile as d,rename as zJ,rmdir as TJ,rm as kJ,stat as MJ,unlink as OJ}from"fs/promises";import{homedir as f}from"os";import*as A from"path";function l(J,K){if(K.startsWith("//")||K.startsWith("\\\\"))return{resolvedPath:K,isSymlink:!1,isCanonical:!1};try{let Q=J.lstatSync(K);if(Q.isFIFO()||Q.isSocket()||Q.isCharacterDevice()||Q.isBlockDevice())return{resolvedPath:K,isSymlink:!1,isCanonical:!1};let X=J.realpathSync(K);return{resolvedPath:X,isSymlink:X!==K,isCanonical:!0}}catch(Q){return{resolvedPath:K,isSymlink:!1,isCanonical:!1}}}function UK(J,K,Q){let{resolvedPath:X}=l(J,K);if(Q.has(X))return!0;return Q.add(X),!1}function xJ(J,K){let Q=K,X=[];while(Q!==A.dirname(Q)){let Z;try{Z=J.lstatSync(Q)}catch{X.unshift(A.basename(Q)),Q=A.dirname(Q);continue}if(Z.isSymbolicLink())try{let Y=J.realpathSync(Q);return X.length===0?Y:A.join(Y,...X)}catch{let Y=J.readlinkSync(Q),$=A.isAbsolute(Y)?Y:A.resolve(A.dirname(Q),Y);return X.length===0?$:A.join($,...X)}try{let Y=J.realpathSync(Q);if(Y!==Q)return X.length===0?Y:A.join(Y,...X)}catch{}return}return}function VK(J){let K=J;if(K==="~")K=f().normalize("NFC");else if(K.startsWith("~/"))K=A.join(f().normalize("NFC"),K.slice(2));let Q=new Set,X=O();if(Q.add(K),K.startsWith("//")||K.startsWith("\\\\"))return Array.from(Q);try{let $=K,G=new Set,U=40;for(let j=0;j<U;j++){if(G.has($))break;if(G.add($),!X.existsSync($)){if($===K){let W=xJ(X,K);if(W!==void 0)Q.add(W)}break}let I=X.lstatSync($);if(I.isFIFO()||I.isSocket()||I.isCharacterDevice()||I.isBlockDevice())break;if(!I.isSymbolicLink())break;let N=X.readlinkSync($),C=A.isAbsolute(N)?N:A.resolve(A.dirname($),N);Q.add(C),$=C}}catch{}let{resolvedPath:Z,isSymlink:Y}=l(X,K);if(Y&&Z!==K)Q.add(Z);return Array.from(Q)}function O(){return EJ}async function HK(J,K,Q){let U=[];try{const X=V(U,await M(J,"r"),1);let Z=(await X.stat()).size;if(Z<=K)return null;let Y=Math.min(Z-K,Q);let $=Buffer.allocUnsafe(Y);let G=0;while(G<Y){let{bytesRead:W}=await X.read($,G,Y-G,K+G);if(W===0)break;G+=W}return{content:$.toString("utf8",0,G),bytesRead:G,bytesTotal:Z}}catch(j){var I=j,N=1}finally{var C=H(U,I,N);C&&await C}}async function _K(J,K){let U=[];try{const Q=V(U,await M(J,"r"),1);let X=(await Q.stat()).size;if(X===0)return{content:"",bytesRead:0,bytesTotal:0};let Z=Math.max(0,X-K);let Y=X-Z;let $=Buffer.allocUnsafe(Y);let G=0;while(G<Y){let{bytesRead:W}=await Q.read($,G,Y-G,Z+G);if(W===0)break;G+=W}return{content:$.toString("utf8",0,G),bytesRead:G,bytesTotal:X}}catch(j){var I=j,N=1}finally{var C=H(U,I,N);C&&await C}}async function*NK(J){let Q=await M(J,"r");try{let Z=(await Q.stat()).size,Y=Buffer.alloc(0),$=Buffer.alloc(4096);while(Z>0){let G=Math.min(4096,Z);Z-=G,await Q.read($,0,G,Z);let U=Buffer.concat([$.subarray(0,G),Y]),j=U.indexOf(10);if(j===-1){Y=U;continue}Y=Buffer.from(U.subarray(0,j));let I=U.toString("utf8",j+1).split(`
3
3
  `);for(let N=I.length-1;N>=0;N--){let C=I[N];if(C)yield C}}if(Y.length>0)yield Y.toString("utf8")}finally{await Q.close()}}var DJ,EJ;var g=B(()=>{m();E();DJ={cwd(){return process.cwd()},existsSync(J){let Q=[];try{const K=V(Q,_`fs.existsSync(${J})`,0);return q.existsSync(J)}catch(X){var Z=X,Y=1}finally{H(Q,Z,Y)}},async stat(J){return MJ(J)},async readdir(J){return BJ(J,{withFileTypes:!0})},async unlink(J){return OJ(J)},async rmdir(J){return TJ(J)},async rm(J,K){return kJ(J,K)},async mkdir(J,K){try{await CJ(J,{recursive:!0,...K})}catch(Q){if(z(Q)!=="EEXIST")throw Q}},async readFile(J,K){return d(J,{encoding:K.encoding})},async rename(J,K){return zJ(J,K)},statSync(J){let Q=[];try{const K=V(Q,_`fs.statSync(${J})`,0);return q.statSync(J)}catch(X){var Z=X,Y=1}finally{H(Q,Z,Y)}},lstatSync(J){let Q=[];try{const K=V(Q,_`fs.lstatSync(${J})`,0);return q.lstatSync(J)}catch(X){var Z=X,Y=1}finally{H(Q,Z,Y)}},readFileSync(J,K){let X=[];try{const Q=V(X,_`fs.readFileSync(${J})`,0);return q.readFileSync(J,{encoding:K.encoding})}catch(Z){var Y=Z,$=1}finally{H(X,Y,$)}},readFileBytesSync(J){let Q=[];try{const K=V(Q,_`fs.readFileBytesSync(${J})`,0);return q.readFileSync(J)}catch(X){var Z=X,Y=1}finally{H(Q,Z,Y)}},readSync(J,K){let Z=[];try{const Q=V(Z,_`fs.readSync(${J}, ${K.length} bytes)`,0);let X=void 0;try{X=q.openSync(J,"r");let U=Buffer.alloc(K.length),j=q.readSync(X,U,0,K.length,0);return{buffer:U,bytesRead:j}}finally{if(X)q.closeSync(X)}}catch(Y){var $=Y,G=1}finally{H(Z,$,G)}},appendFileSync(J,K,Q){let Z=[];try{const X=V(Z,_`fs.appendFileSync(${J}, ${K.length} chars)`,0);if(Q?.mode!==void 0)try{let U=q.openSync(J,"ax",Q.mode);try{q.appendFileSync(U,K)}finally{q.closeSync(U)}return}catch(U){if(z(U)!=="EEXIST")throw U}q.appendFileSync(J,K)}catch(Y){var $=Y,G=1}finally{H(Z,$,G)}},copyFileSync(J,K){let X=[];try{const Q=V(X,_`fs.copyFileSync(${J} \u2192 ${K})`,0);q.copyFileSync(J,K)}catch(Z){var Y=Z,$=1}finally{H(X,Y,$)}},unlinkSync(J){let Q=[];try{const K=V(Q,_`fs.unlinkSync(${J})`,0);q.unlinkSync(J)}catch(X){var Z=X,Y=1}finally{H(Q,Z,Y)}},renameSync(J,K){let X=[];try{const Q=V(X,_`fs.renameSync(${J} \u2192 ${K})`,0);q.renameSync(J,K)}catch(Z){var Y=Z,$=1}finally{H(X,Y,$)}},linkSync(J,K){let X=[];try{const Q=V(X,_`fs.linkSync(${J} \u2192 ${K})`,0);q.linkSync(J,K)}catch(Z){var Y=Z,$=1}finally{H(X,Y,$)}},symlinkSync(J,K,Q){let Z=[];try{const X=V(Z,_`fs.symlinkSync(${J} \u2192 ${K})`,0);q.symlinkSync(J,K,Q)}catch(Y){var $=Y,G=1}finally{H(Z,$,G)}},readlinkSync(J){let Q=[];try{const K=V(Q,_`fs.readlinkSync(${J})`,0);return q.readlinkSync(J)}catch(X){var Z=X,Y=1}finally{H(Q,Z,Y)}},realpathSync(J){let Q=[];try{const K=V(Q,_`fs.realpathSync(${J})`,0);return q.realpathSync(J).normalize("NFC")}catch(X){var Z=X,Y=1}finally{H(Q,Z,Y)}},mkdirSync(J,K){let Z=[];try{const Q=V(Z,_`fs.mkdirSync(${J})`,0);let X={recursive:!0};if(K?.mode!==void 0)X.mode=K.mode;try{q.mkdirSync(J,X)}catch(U){if(z(U)!=="EEXIST")throw U}}catch(Y){var $=Y,G=1}finally{H(Z,$,G)}},readdirSync(J){let Q=[];try{const K=V(Q,_`fs.readdirSync(${J})`,0);return q.readdirSync(J,{withFileTypes:!0})}catch(X){var Z=X,Y=1}finally{H(Q,Z,Y)}},readdirStringSync(J){let Q=[];try{const K=V(Q,_`fs.readdirStringSync(${J})`,0);return q.readdirSync(J)}catch(X){var Z=X,Y=1}finally{H(Q,Z,Y)}},isDirEmptySync(J){let X=[];try{const K=V(X,_`fs.isDirEmptySync(${J})`,0);let Q=this.readdirSync(J);return Q.length===0}catch(Z){var Y=Z,$=1}finally{H(X,Y,$)}},rmdirSync(J){let Q=[];try{const K=V(Q,_`fs.rmdirSync(${J})`,0);q.rmdirSync(J)}catch(X){var Z=X,Y=1}finally{H(Q,Z,Y)}},rmSync(J,K){let X=[];try{const Q=V(X,_`fs.rmSync(${J})`,0);q.rmSync(J,K)}catch(Z){var Y=Z,$=1}finally{H(X,Y,$)}},createWriteStream(J){return q.createWriteStream(J)},async readFileBytes(J,K){if(K===void 0)return d(J);let Q=await M(J,"r");try{let{size:X}=await Q.stat(),Z=Math.min(X,K),Y=Buffer.allocUnsafe(Z),$=0;while($<Z){let{bytesRead:G}=await Q.read(Y,$,Z-$,$);if(G===0)break;$+=G}return $<Z?Y.subarray(0,$):Y}finally{await Q.close()}}},EJ=DJ});import{appendFile as SJ,mkdir as LJ,symlink as wJ,unlink as yJ}from"fs/promises";import T from"lodash-es/memoize.js";import{dirname as s,join as t}from"path";function EK(){let J=k()||process.env.USER_TYPE==="ant";return e=!0,k.cache.clear?.(),J}function PJ(J){if(process.env.USER_TYPE!=="ant"&&!k())return!1;if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let K=bJ();return p(J,K)}function RK(J){L=J}function FK(){return L}async function cJ(J,K,Q,X){if(J)await LJ(K,{recursive:!0}).catch(()=>{});await SJ(Q,X),YJ()}function mJ(){}function uJ(){if(!x){let J=null;x=y({writeFn:(K)=>{let Q=XJ(),X=s(Q),Z=J!==X;if(J=X,k()){if(Z)try{O().mkdirSync(X)}catch{}O().appendFileSync(Q,K),YJ();return}R=R.then(cJ.bind(null,Z,X,Q,K)).catch(mJ)},flushIntervalMs:1000,maxBufferSize:100,immediateMode:k()}),b(async()=>{x?.dispose(),await R})}return x}function QJ(J,{level:K}={level:"debug"}){if(S[K]<S[vJ()])return;if(!PJ(J))return;if(L&&J.includes(`
4
4
  `))J=r(J);let X=`${new Date().toISOString()} [${K.toUpperCase()}] ${J.trim()}
5
5
  `;if(JJ()){a(X);return}uJ().write(X)}function XJ(){return KJ()??process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??t(i(),"debug",`${n()}.txt`)}function SK(J,K){if(process.env.USER_TYPE!=="ant")return;if(K instanceof Error&&K.stack)QJ(`[ANT-ONLY] ${J} stack trace:
6
6
  ${K.stack}`,{level:"error"})}var S,vJ,e=!1,k,bJ,JJ,KJ,L=!1,x=null,R,YJ;var ZJ=B(()=>{o();v();P();h();RJ();g();FJ();E();S={verbose:0,debug:1,info:2,warn:3,error:4},vJ=T(()=>{let J=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();if(J&&Object.hasOwn(S,J))return J;return"debug"}),k=T(()=>{return e||F(process.env.DEBUG)||F(process.env.DEBUG_SDK)||process.argv.includes("--debug")||process.argv.includes("-d")||JJ()||process.argv.some((J)=>J.startsWith("--debug="))||KJ()!==null});bJ=T(()=>{let J=process.argv.find((Q)=>Q.startsWith("--debug="));if(!J)return null;let K=J.substring(8);return u(K)}),JJ=T(()=>{return process.argv.includes("--debug-to-stderr")||process.argv.includes("-d2e")}),KJ=T(()=>{for(let J=0;J<process.argv.length;J++){let K=process.argv[J];if(K.startsWith("--debug-file="))return K.substring(13);if(K==="--debug-file"&&J+1<process.argv.length)return process.argv[J+1]}return null});R=Promise.resolve();YJ=T(async()=>{try{let J=XJ(),K=s(J),Q=t(K,"latest");await yJ(Q).catch(()=>{}),await wJ(J,Q)}catch{}})});import{closeSync as pJ,writeFileSync as $J,fsyncSync as hJ,openSync as dJ}from"fs";import PK from"lodash-es/cloneDeep.js";function lJ(){return fJ}function r(J,K,Q){let Z=[];try{const X=V(Z,_`JSON.stringify(${J})`,0);return JSON.stringify(J,K,Q)}catch(Y){var $=Y,G=1}finally{H(Z,$,G)}}function hK(J,K){let X=[];try{const Q=V(X,_`structuredClone(${J})`,0);return structuredClone(J,K)}catch(Z){var Y=Z,$=1}finally{H(X,Y,$)}}function dK(J,K,Q){let Y=[];try{const X=V(Y,_`fs.writeFileSync(${J}, ${K})`,0);let Z=Q!==null&&typeof Q==="object"&&"flush"in Q&&Q.flush===!0;if(Z){let j=typeof Q==="object"&&"encoding"in Q?Q.encoding:void 0,I=typeof Q==="object"&&"mode"in Q?Q.mode:void 0,N;try{N=dJ(J,"w",I),$J(N,K,{encoding:j??void 0}),hJ(N)}finally{if(N!==void 0)pJ(N)}}else $J(J,K,Q)}catch($){var G=$,U=1}finally{H(Y,G,U)}}var uK,fJ,_,pK=(J,K)=>{let X=[];try{const Q=V(X,_`JSON.parse(${J})`,0);return typeof K>"u"?JSON.parse(J):JSON.parse(J,K)}catch(Z){var Y=Z,$=1}finally{H(X,Y,$)}};var E=B(()=>{o();ZJ();uK=(()=>{let J=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(J!==void 0){let K=Number(J);if(!Number.isNaN(K)&&K>=0)return K}return 20})(),fJ={[Symbol.dispose](){}};_=lJ});
7
- export{y as E9,v as F9,b as G9,nJ as H9,P as I9,GJ as J9,UJ as K9,c as L9,rJ as M9,VJ as N9,HJ as O9,_J as P9,NJ as Q9,aJ as R9,sJ as S9,jJ as T9,z as U9,tJ as V9,eJ as W9,JK as X9,KK as Y9,m as Z9,_ as _9,r as $9,pK as a_,hK as b_,dK as c_,E as d_,l as e_,UK as f_,VK as g_,O as h_,HK as i_,_K as j_,NK as k_,g as l_,k as m_,EK as n_,JJ as o_,RK as p_,FK as q_,QJ as r_,XJ as s_,SK as t_,ZJ as u_};
7
+ export{y as I9,v as J9,b as K9,nJ as L9,P as M9,GJ as N9,UJ as O9,c as P9,rJ as Q9,VJ as R9,HJ as S9,_J as T9,NJ as U9,aJ as V9,sJ as W9,jJ as X9,z as Y9,tJ as Z9,eJ as _9,JK as $9,KK as a_,m as b_,_ as c_,r as d_,pK as e_,hK as f_,dK as g_,E as h_,l as i_,UK as j_,VK as k_,O as l_,HK as m_,_K as n_,NK as o_,g as p_,k as q_,EK as r_,JJ as s_,RK as t_,FK as u_,QJ as v_,XJ as w_,SK as x_,ZJ as y_};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Dd as w,Ed as _,Fd as D,Gd as L,Hd as A,Id as h,Jd as O}from"./cli-zdy5bccv.js";import{Ch as Q,Cv as R,DD as W,ED as I,Fh as S,Fv as j,Hv as C,Mq as V,Nq as b}from"./cli-5pb6kdxn.js";import{B8 as N,w8 as U}from"./cli-3bxtq5dc.js";import{U8 as K,V8 as v}from"./cli-s5epnnj5.js";import{T9 as B,Z9 as F}from"./cli-a98b285v.js";import{A_ as M,w_ as x}from"./cli-jmypsed1.js";F();b();N();I();S();M();C();v();O();import X from"figures";function Z(z,J,q){U(z);let G=q?`${J} plugin "${q}"`:J==="disable-all"?"disable all plugins":`${J} plugins`;console.error(`${X.cross} Failed to ${G}: ${B(z)}`);let H=q?(()=>{let{name:Y,marketplace:$}=Q(q);return{_PROTO_plugin_name:Y,...$&&{_PROTO_marketplace_name:$},...R(Y,$,W())}})():{};K("tengu_plugin_command_failed",{command:J,error_category:j(z),...H}),process.exit(1)}async function p(z,J="user"){try{console.log(`Installing plugin "${z}"...`);let q=await w(z,J);if(!q.success)throw Error(q.message);console.log(`${X.tick} ${q.message}`);let{name:G,marketplace:H}=Q(q.pluginId||z);K("tengu_plugin_installed_cli",{_PROTO_plugin_name:G,...H&&{_PROTO_marketplace_name:H},scope:q.scope||J,install_source:"cli-explicit",...R(G,H,W())}),process.exit(0)}catch(q){Z(q,"install",z)}}async function g(z,J="user",q=!1){try{let G=await _(z,J,!q);if(!G.success)throw Error(G.message);console.log(`${X.tick} ${G.message}`);let{name:H,marketplace:Y}=Q(G.pluginId||z);K("tengu_plugin_uninstalled_cli",{_PROTO_plugin_name:H,...Y&&{_PROTO_marketplace_name:Y},scope:G.scope||J,...R(H,Y,W())}),process.exit(0)}catch(G){Z(G,"uninstall",z)}}async function a(z,J){try{let q=await D(z,J);if(!q.success)throw Error(q.message);console.log(`${X.tick} ${q.message}`);let{name:G,marketplace:H}=Q(q.pluginId||z);K("tengu_plugin_enabled_cli",{_PROTO_plugin_name:G,...H&&{_PROTO_marketplace_name:H},scope:q.scope,...R(G,H,W())}),process.exit(0)}catch(q){Z(q,"enable",z)}}async function i(z,J){try{let q=await L(z,J);if(!q.success)throw Error(q.message);console.log(`${X.tick} ${q.message}`);let{name:G,marketplace:H}=Q(q.pluginId||z);K("tengu_plugin_disabled_cli",{_PROTO_plugin_name:G,...H&&{_PROTO_marketplace_name:H},scope:q.scope,...R(G,H,W())}),process.exit(0)}catch(q){Z(q,"disable",z)}}async function u(){try{let z=await A();if(!z.success)throw Error(z.message);console.log(`${X.tick} ${z.message}`),K("tengu_plugin_disabled_all_cli",{}),process.exit(0)}catch(z){Z(z,"disable-all")}}async function n(z,J){try{x(`Checking for updates for plugin "${z}" at ${J} scope\u2026
2
+ import{Dd as w,Ed as _,Fd as D,Gd as L,Hd as A,Id as h,Jd as O}from"./cli-q46epwyh.js";import{AD as W,BD as I,Ch as Q,Cv as j,Ev as C,Fh as S,Mq as V,Nq as b,zv as R}from"./cli-me4e2p3e.js";import{E8 as U,J8 as N}from"./cli-4ewb3q42.js";import{Y8 as K,Z8 as v}from"./cli-t9jht3kb.js";import{X9 as B,b_ as F}from"./cli-hke6r0q8.js";import{A_ as x,E_ as M}from"./cli-x70v8rsj.js";F();b();N();I();S();M();C();v();O();import X from"figures";function Z(z,J,q){U(z);let G=q?`${J} plugin "${q}"`:J==="disable-all"?"disable all plugins":`${J} plugins`;console.error(`${X.cross} Failed to ${G}: ${B(z)}`);let H=q?(()=>{let{name:Y,marketplace:$}=Q(q);return{_PROTO_plugin_name:Y,...$&&{_PROTO_marketplace_name:$},...R(Y,$,W())}})():{};K("tengu_plugin_command_failed",{command:J,error_category:j(z),...H}),process.exit(1)}async function p(z,J="user"){try{console.log(`Installing plugin "${z}"...`);let q=await w(z,J);if(!q.success)throw Error(q.message);console.log(`${X.tick} ${q.message}`);let{name:G,marketplace:H}=Q(q.pluginId||z);K("tengu_plugin_installed_cli",{_PROTO_plugin_name:G,...H&&{_PROTO_marketplace_name:H},scope:q.scope||J,install_source:"cli-explicit",...R(G,H,W())}),process.exit(0)}catch(q){Z(q,"install",z)}}async function g(z,J="user",q=!1){try{let G=await _(z,J,!q);if(!G.success)throw Error(G.message);console.log(`${X.tick} ${G.message}`);let{name:H,marketplace:Y}=Q(G.pluginId||z);K("tengu_plugin_uninstalled_cli",{_PROTO_plugin_name:H,...Y&&{_PROTO_marketplace_name:Y},scope:G.scope||J,...R(H,Y,W())}),process.exit(0)}catch(G){Z(G,"uninstall",z)}}async function a(z,J){try{let q=await D(z,J);if(!q.success)throw Error(q.message);console.log(`${X.tick} ${q.message}`);let{name:G,marketplace:H}=Q(q.pluginId||z);K("tengu_plugin_enabled_cli",{_PROTO_plugin_name:G,...H&&{_PROTO_marketplace_name:H},scope:q.scope,...R(G,H,W())}),process.exit(0)}catch(q){Z(q,"enable",z)}}async function i(z,J){try{let q=await L(z,J);if(!q.success)throw Error(q.message);console.log(`${X.tick} ${q.message}`);let{name:G,marketplace:H}=Q(q.pluginId||z);K("tengu_plugin_disabled_cli",{_PROTO_plugin_name:G,...H&&{_PROTO_marketplace_name:H},scope:q.scope,...R(G,H,W())}),process.exit(0)}catch(q){Z(q,"disable",z)}}async function u(){try{let z=await A();if(!z.success)throw Error(z.message);console.log(`${X.tick} ${z.message}`),K("tengu_plugin_disabled_all_cli",{}),process.exit(0)}catch(z){Z(z,"disable-all")}}async function n(z,J){try{x(`Checking for updates for plugin "${z}" at ${J} scope\u2026
3
3
  `);let q=await h(z,J);if(!q.success)throw Error(q.message);if(x(`${X.tick} ${q.message}
4
4
  `),!q.alreadyUpToDate){let{name:G,marketplace:H}=Q(q.pluginId||z);K("tengu_plugin_updated_cli",{_PROTO_plugin_name:G,...H&&{_PROTO_marketplace_name:H},old_version:q.oldVersion||"unknown",new_version:q.newVersion||"unknown",...R(G,H,W())})}await V(0)}catch(q){Z(q,"update",z)}}
5
5
  export{p as a,g as b,a as c,i as d,u as e,n as f};