zen-code 4.8.2 → 4.8.3

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 (385) hide show
  1. package/dist/app.js +93 -93
  2. package/dist/{chunk-8kk9kv6s.js → chunk-03bb6pab.js} +1 -1
  3. package/dist/{chunk-jva13pdt.js → chunk-03d08304.js} +1 -1
  4. package/dist/{chunk-e3narvkn.js → chunk-04kzaj7h.js} +2 -2
  5. package/dist/{chunk-10stn7rc.js → chunk-09f94dtz.js} +1 -1
  6. package/dist/chunk-0bpvpy2e.js +1 -0
  7. package/dist/{chunk-r53nsqbh.js → chunk-0ch9bkct.js} +1 -1
  8. package/dist/{chunk-645r8yk7.js → chunk-0cz1ygrn.js} +1 -1
  9. package/dist/{chunk-3xfw5w0d.js → chunk-0dstjr38.js} +1 -1
  10. package/dist/chunk-0gb5n1jp.js +1 -0
  11. package/dist/{chunk-j07r3an3.js → chunk-0gpa9n28.js} +1 -1
  12. package/dist/{chunk-exj3mryv.js → chunk-0mryaqgb.js} +1 -1
  13. package/dist/{chunk-4cg3jh38.js → chunk-0myk23dw.js} +1 -1
  14. package/dist/{chunk-zxqs1xns.js → chunk-0qrqmmqt.js} +1 -1
  15. package/dist/{chunk-yzgwn422.js → chunk-1163kxya.js} +1 -1
  16. package/dist/chunk-13f0qh77.js +1 -0
  17. package/dist/chunk-17zj2hd5.js +1 -0
  18. package/dist/{chunk-ntc51kg0.js → chunk-1a5zv67s.js} +1 -1
  19. package/dist/{chunk-tfqwrnhz.js → chunk-1dwn0qqb.js} +1 -1
  20. package/dist/{chunk-kz78gsrq.js → chunk-1efcgvx0.js} +1 -1
  21. package/dist/{chunk-6qce4a2z.js → chunk-1ggv4msc.js} +1 -1
  22. package/dist/{chunk-9dhex1sf.js → chunk-1mdbzd7e.js} +1 -1
  23. package/dist/{chunk-665a7fke.js → chunk-1pm5qfkm.js} +1 -1
  24. package/dist/{chunk-1a34fyjt.js → chunk-1q8wzky6.js} +1 -1
  25. package/dist/{chunk-ft4z3z88.js → chunk-1w5m9c5y.js} +1 -1
  26. package/dist/{chunk-axn0n4dh.js → chunk-21w7a0t2.js} +1 -1
  27. package/dist/{chunk-8w10sa5e.js → chunk-25es8s2e.js} +1 -1
  28. package/dist/{chunk-yynk0bam.js → chunk-28p35k17.js} +1 -1
  29. package/dist/{chunk-p8pfkf84.js → chunk-2gr7rdv0.js} +1 -1
  30. package/dist/{chunk-dee62n5c.js → chunk-2hjzw0cx.js} +1 -1
  31. package/dist/{chunk-8fzw4gqz.js → chunk-2kka9ex2.js} +1 -1
  32. package/dist/chunk-2m3g6fah.js +1 -0
  33. package/dist/{chunk-fsqndb8n.js → chunk-2qx9kzj1.js} +1 -1
  34. package/dist/{chunk-9n2ge60j.js → chunk-2vtz4ypn.js} +1 -1
  35. package/dist/{chunk-vfwh7m86.js → chunk-2w2pzwmm.js} +1 -1
  36. package/dist/{chunk-4w4ezegn.js → chunk-323aj0k7.js} +1 -1
  37. package/dist/{chunk-j4c847h3.js → chunk-3b8bw2gg.js} +1 -1
  38. package/dist/{chunk-1ja6becj.js → chunk-3c791dd5.js} +1 -1
  39. package/dist/{chunk-j7dazkh4.js → chunk-3dqan531.js} +1 -1
  40. package/dist/{chunk-bmb36b05.js → chunk-3ek4pcr6.js} +1 -1
  41. package/dist/{chunk-xxwnet5y.js → chunk-3mzwewcx.js} +1 -1
  42. package/dist/{chunk-g1z6k96z.js → chunk-3ns6c29z.js} +1 -1
  43. package/dist/{chunk-tv25zrtk.js → chunk-3p4khpea.js} +1 -1
  44. package/dist/{chunk-1yq51mb3.js → chunk-3pd9zqn2.js} +1 -1
  45. package/dist/{chunk-bnma63xz.js → chunk-3pqm74e3.js} +1 -1
  46. package/dist/{chunk-7kb8ygdr.js → chunk-3s46q55v.js} +1 -1
  47. package/dist/{chunk-qhs3hh67.js → chunk-3s6j6d1z.js} +1 -1
  48. package/dist/{chunk-srtwf73c.js → chunk-3tq80kwe.js} +1 -1
  49. package/dist/{chunk-9frwhzz8.js → chunk-3z87tvcn.js} +1 -1
  50. package/dist/chunk-40fxbk0k.js +1 -0
  51. package/dist/{chunk-mwqg224k.js → chunk-41hzdwnx.js} +1 -1
  52. package/dist/{chunk-54j5njdj.js → chunk-45dyg3fv.js} +1 -1
  53. package/dist/{chunk-hqhqqe9q.js → chunk-4ecfe9a1.js} +1 -1
  54. package/dist/{chunk-bwvxp5dp.js → chunk-4g796wg5.js} +1 -1
  55. package/dist/{chunk-j3c65h0m.js → chunk-4j4w856j.js} +1 -1
  56. package/dist/{chunk-kbaz8s34.js → chunk-4mw5szy1.js} +1 -1
  57. package/dist/{chunk-dchaphvw.js → chunk-4n978rje.js} +2 -2
  58. package/dist/chunk-4pa2a33z.js +1 -0
  59. package/dist/{chunk-35bvsa6m.js → chunk-4qs8qf3g.js} +1 -1
  60. package/dist/{chunk-30hxw04w.js → chunk-4s6z4724.js} +1 -1
  61. package/dist/{chunk-httqsv3p.js → chunk-4tgv8687.js} +1 -1
  62. package/dist/{chunk-sdr9ywjt.js → chunk-4vr7sc1e.js} +1 -1
  63. package/dist/{chunk-5kns073z.js → chunk-4wmmjwq3.js} +1 -1
  64. package/dist/{chunk-f4cn2y4x.js → chunk-4z0wk36t.js} +1 -1
  65. package/dist/{chunk-9skn642s.js → chunk-4zemyepb.js} +1 -1
  66. package/dist/{chunk-x0xaw21f.js → chunk-501c35tf.js} +1 -1
  67. package/dist/{chunk-xg586hyh.js → chunk-50hw7e2n.js} +1 -1
  68. package/dist/{chunk-a07p1cfs.js → chunk-51cf1nrg.js} +1 -1
  69. package/dist/{chunk-ffyj4q4f.js → chunk-51h1tm3c.js} +1 -1
  70. package/dist/{chunk-zj03ksjd.js → chunk-5743qc09.js} +1 -1
  71. package/dist/{chunk-54ya969p.js → chunk-5g0asgdm.js} +1 -1
  72. package/dist/{chunk-84nqfeqh.js → chunk-5gaygdyf.js} +1 -1
  73. package/dist/{chunk-my5y2p5a.js → chunk-5n3h6mhr.js} +1 -1
  74. package/dist/{chunk-46ac6010.js → chunk-5vzt6z7d.js} +1 -1
  75. package/dist/{chunk-yd3vzgxs.js → chunk-62zhdx11.js} +1 -1
  76. package/dist/{chunk-khd8ds90.js → chunk-63ghca0g.js} +1 -1
  77. package/dist/{chunk-9xcz69sj.js → chunk-6a35z43a.js} +1 -1
  78. package/dist/{chunk-kkk1k414.js → chunk-6e734rff.js} +1 -1
  79. package/dist/chunk-6ezeq351.js +1 -0
  80. package/dist/{chunk-tr01bt0h.js → chunk-6gxwe3hq.js} +1 -1
  81. package/dist/chunk-6hbnk94n.js +1 -0
  82. package/dist/{chunk-00jvgph3.js → chunk-6meyz753.js} +1 -1
  83. package/dist/{chunk-en2d49a7.js → chunk-6nhdwm44.js} +1 -1
  84. package/dist/{chunk-dtha8g8n.js → chunk-6r7b9pg1.js} +1 -1
  85. package/dist/{chunk-2cj25dc6.js → chunk-6rzyzk0g.js} +1 -1
  86. package/dist/{chunk-hd39y2wf.js → chunk-6v5eepr1.js} +1 -1
  87. package/dist/{chunk-fyay9ztg.js → chunk-70gnwjt8.js} +1 -1
  88. package/dist/{chunk-jeavnd8g.js → chunk-72h39xc8.js} +1 -1
  89. package/dist/{chunk-8p1ebpny.js → chunk-76gx2wc0.js} +1 -1
  90. package/dist/{chunk-zqg7xzex.js → chunk-77gv3r7z.js} +1 -1
  91. package/dist/{chunk-4g2gfvyd.js → chunk-7893pky5.js} +1 -1
  92. package/dist/{chunk-v6faz3vj.js → chunk-7dmms791.js} +1 -1
  93. package/dist/{chunk-v667b8k4.js → chunk-7h9sjfmy.js} +1 -1
  94. package/dist/{chunk-n4s96jdz.js → chunk-7hvw60gp.js} +1 -1
  95. package/dist/{chunk-sw4h382q.js → chunk-7pntzqpm.js} +1 -1
  96. package/dist/{chunk-4k9xgsq4.js → chunk-7zprjevz.js} +1 -1
  97. package/dist/chunk-80jab8dy.js +1 -0
  98. package/dist/{chunk-e43hpgc8.js → chunk-85j75g9q.js} +1 -1
  99. package/dist/{chunk-ajxzbnbp.js → chunk-86em0evs.js} +1 -1
  100. package/dist/{chunk-sbcw8d8z.js → chunk-86exrje1.js} +1 -1
  101. package/dist/{chunk-wgwaq8q1.js → chunk-88191bqb.js} +1 -1
  102. package/dist/{chunk-daahmb61.js → chunk-8chx87e7.js} +1 -1
  103. package/dist/{chunk-d20g16c2.js → chunk-8evmvqza.js} +1 -1
  104. package/dist/{chunk-sexnhyqf.js → chunk-8hp4t30w.js} +1 -1
  105. package/dist/{chunk-k45jk0ge.js → chunk-8kv8e5sn.js} +1 -1
  106. package/dist/{chunk-a5k1t6aj.js → chunk-8m5dqftt.js} +1 -1
  107. package/dist/{chunk-8ynj83n2.js → chunk-8m6adpjf.js} +1 -1
  108. package/dist/{chunk-sy7vf5c5.js → chunk-8mmvxxyj.js} +1 -1
  109. package/dist/{chunk-en6q3h2k.js → chunk-8nkp692y.js} +1 -1
  110. package/dist/{chunk-2p664mgv.js → chunk-8tg10bhe.js} +1 -1
  111. package/dist/{chunk-qddn1sea.js → chunk-91rrbsk7.js} +1 -1
  112. package/dist/{chunk-x0gm6db7.js → chunk-952k4ak8.js} +1 -1
  113. package/dist/{chunk-3f6xf4mm.js → chunk-97bsgfnr.js} +1 -1
  114. package/dist/chunk-9c0wnb5t.js +1 -0
  115. package/dist/{chunk-kwhma00c.js → chunk-9dh8d15f.js} +1 -1
  116. package/dist/chunk-9dn65rqp.js +1 -0
  117. package/dist/{chunk-mnxav3bw.js → chunk-9gnhztzd.js} +1 -1
  118. package/dist/{chunk-2mesyv20.js → chunk-9hkn5b8e.js} +1 -1
  119. package/dist/{chunk-xtrkc4bn.js → chunk-9kydh60d.js} +1 -1
  120. package/dist/{chunk-fm4a6pgp.js → chunk-9ynmrc70.js} +1 -1
  121. package/dist/{chunk-bkan2fr3.js → chunk-acceg8yk.js} +1 -1
  122. package/dist/{chunk-xqhnnbfr.js → chunk-afdat9a4.js} +1 -1
  123. package/dist/{chunk-zgnjqvkp.js → chunk-ajtch74a.js} +1 -1
  124. package/dist/{chunk-9a6kwz9e.js → chunk-ak0aqr2c.js} +1 -1
  125. package/dist/{chunk-ewgpt1pm.js → chunk-ak2n1ckf.js} +1 -1
  126. package/dist/{chunk-7wqcxfc4.js → chunk-ak43xwf1.js} +1 -1
  127. package/dist/{chunk-vxggg3ea.js → chunk-anbr96y3.js} +1 -1
  128. package/dist/{chunk-q37swcyw.js → chunk-aqyqcpz2.js} +1 -1
  129. package/dist/{chunk-2kw6zxt8.js → chunk-arppjtcv.js} +1 -1
  130. package/dist/{chunk-s4ksgmax.js → chunk-azxn0zvz.js} +1 -1
  131. package/dist/{chunk-7wnxdt11.js → chunk-b4fn3tre.js} +1 -1
  132. package/dist/{chunk-vxzy50p0.js → chunk-b68ekt52.js} +1 -1
  133. package/dist/{chunk-pht0yvya.js → chunk-b6xencpw.js} +1 -1
  134. package/dist/{chunk-wxm0c8ec.js → chunk-b9fn4n7z.js} +1 -1
  135. package/dist/{chunk-r038t2rw.js → chunk-ba18by4y.js} +1 -1
  136. package/dist/{chunk-2yrz4qdk.js → chunk-bb9mvt9d.js} +1 -1
  137. package/dist/{chunk-dne3hqde.js → chunk-bd35cx5s.js} +1 -1
  138. package/dist/{chunk-ky2zgpqq.js → chunk-bf0pjbfa.js} +1 -1
  139. package/dist/chunk-bfm294j1.js +1 -0
  140. package/dist/{chunk-vbwkgvhq.js → chunk-bh33p34p.js} +1 -1
  141. package/dist/{chunk-0y6jq0a0.js → chunk-bngqptzm.js} +1 -1
  142. package/dist/{chunk-pr8jrhq9.js → chunk-bwjh7xrm.js} +1 -1
  143. package/dist/{chunk-04mq56m4.js → chunk-bwnx1zht.js} +1 -1
  144. package/dist/{chunk-9dse3mh2.js → chunk-c1345z85.js} +1 -1
  145. package/dist/{chunk-ny0zjscg.js → chunk-c1gpr8nz.js} +1 -1
  146. package/dist/{chunk-czkt4sv0.js → chunk-c1r7zjt3.js} +1 -1
  147. package/dist/{chunk-satxmrvx.js → chunk-c3b7gwkd.js} +1 -1
  148. package/dist/{chunk-vdd1xyrt.js → chunk-c5d87fzk.js} +1 -1
  149. package/dist/{chunk-zv0nefnm.js → chunk-cd37w7qk.js} +1 -1
  150. package/dist/chunk-cegx2zze.js +1 -0
  151. package/dist/{chunk-by1h1fy3.js → chunk-cm6vfvym.js} +1 -1
  152. package/dist/chunk-crjf70s3.js +1 -0
  153. package/dist/{chunk-b79d73fy.js → chunk-crvp4wnc.js} +1 -1
  154. package/dist/{chunk-yj3fncjn.js → chunk-cwvb8zr5.js} +1 -1
  155. package/dist/{chunk-6fzgq7sb.js → chunk-cyd358a8.js} +1 -1
  156. package/dist/chunk-d08qq3wd.js +1 -0
  157. package/dist/chunk-d9xgby9w.js +1 -0
  158. package/dist/{chunk-ggwb349q.js → chunk-dhgjjhh7.js} +1 -1
  159. package/dist/{chunk-07fnyy77.js → chunk-djmxgj5c.js} +1 -1
  160. package/dist/{chunk-55pfd4pp.js → chunk-dvmzq40v.js} +1 -1
  161. package/dist/{chunk-jpkm78je.js → chunk-dw3081wb.js} +1 -1
  162. package/dist/{chunk-jmp4rprf.js → chunk-e112438q.js} +1 -1
  163. package/dist/{chunk-667brfhx.js → chunk-e2qmvzgm.js} +1 -1
  164. package/dist/{chunk-t1pybn6p.js → chunk-e2vdc3vs.js} +1 -1
  165. package/dist/{chunk-0dvy62vd.js → chunk-eh3cemzk.js} +1 -1
  166. package/dist/{chunk-w4kh5s54.js → chunk-ehpz2t7m.js} +1 -1
  167. package/dist/{chunk-p1e4d1an.js → chunk-ek58k066.js} +1 -1
  168. package/dist/{chunk-1w5vehgm.js → chunk-emdn1c33.js} +1 -1
  169. package/dist/{chunk-dxyv2b1c.js → chunk-eyty7ng4.js} +1 -1
  170. package/dist/{chunk-fg2zmrdg.js → chunk-f3jbz60e.js} +1 -1
  171. package/dist/{chunk-fj71pv2k.js → chunk-f40x0w1g.js} +1 -1
  172. package/dist/{chunk-vpbyhd1b.js → chunk-f6cbjh6q.js} +1 -1
  173. package/dist/{chunk-f7rxszbz.js → chunk-fbf3gztk.js} +1 -1
  174. package/dist/{chunk-z578v7vz.js → chunk-fcexqvhh.js} +1 -1
  175. package/dist/{chunk-583jqck6.js → chunk-fcxgd3qb.js} +1 -1
  176. package/dist/{chunk-kn8f91na.js → chunk-feptb1bb.js} +1 -1
  177. package/dist/{chunk-cmfrm6a7.js → chunk-fmmsa2ry.js} +1 -1
  178. package/dist/{chunk-yyr27vj3.js → chunk-frzyyytq.js} +1 -1
  179. package/dist/{chunk-v02wftj8.js → chunk-fs2mzcgs.js} +1 -1
  180. package/dist/chunk-g1yt0qc9.js +1 -0
  181. package/dist/{chunk-33xp86w3.js → chunk-g30bcqjk.js} +1 -1
  182. package/dist/{chunk-51rhc5g1.js → chunk-g8k4dhcx.js} +1 -1
  183. package/dist/{chunk-5pt6e5bh.js → chunk-g9q5nbz0.js} +1 -1
  184. package/dist/{chunk-wkvnhk36.js → chunk-geyhpd32.js} +1 -1
  185. package/dist/{chunk-k06v7jh2.js → chunk-gh5vbn9x.js} +1 -1
  186. package/dist/{chunk-46bmfch2.js → chunk-gp1ensbx.js} +1 -1
  187. package/dist/chunk-gphyz2x3.js +1 -0
  188. package/dist/{chunk-qcyfn6sh.js → chunk-gpmj4w3z.js} +1 -1
  189. package/dist/{chunk-33j3j89j.js → chunk-gqdapzfq.js} +1 -1
  190. package/dist/{chunk-d7b0m60j.js → chunk-gtms11w9.js} +1 -1
  191. package/dist/{chunk-5eg3bn3m.js → chunk-gy4p2qnz.js} +1 -1
  192. package/dist/{chunk-9as23fmk.js → chunk-h5k1z56v.js} +1 -1
  193. package/dist/{chunk-c2gqabg2.js → chunk-h8ay3dqc.js} +1 -1
  194. package/dist/{chunk-nzfjhsr7.js → chunk-h8de6gyf.js} +1 -1
  195. package/dist/{chunk-x6je1qsq.js → chunk-hgpmrbsr.js} +1 -1
  196. package/dist/{chunk-ftc3mh9t.js → chunk-htgt048s.js} +1 -1
  197. package/dist/{chunk-a1s72wx6.js → chunk-hvekwfwd.js} +1 -1
  198. package/dist/{chunk-ksx0ymk7.js → chunk-hxw717c2.js} +1 -1
  199. package/dist/{chunk-n3e766aj.js → chunk-hzejh175.js} +1 -1
  200. package/dist/{chunk-mttnv195.js → chunk-j5e4dmw7.js} +1 -1
  201. package/dist/{chunk-b3s0bcp6.js → chunk-j8b7x5pr.js} +1 -1
  202. package/dist/{chunk-g1r86637.js → chunk-jafhgffb.js} +1 -1
  203. package/dist/{chunk-3k4101h5.js → chunk-jam7nh0r.js} +1 -1
  204. package/dist/chunk-jh6wwc9v.js +1 -0
  205. package/dist/chunk-jhjbxj1k.js +1 -0
  206. package/dist/chunk-jhwm3phf.js +1 -0
  207. package/dist/{chunk-b6xdt5xb.js → chunk-jmzy9per.js} +1 -1
  208. package/dist/{chunk-fwmc6hwy.js → chunk-jppcve2j.js} +1 -1
  209. package/dist/{chunk-m0k36mwn.js → chunk-jy5kmp4s.js} +1 -1
  210. package/dist/{chunk-kny33kyv.js → chunk-k1kzp019.js} +1 -1
  211. package/dist/{chunk-c04rr3mc.js → chunk-k7e2abhq.js} +1 -1
  212. package/dist/chunk-k97swe5s.js +1 -0
  213. package/dist/{chunk-fesyrdnx.js → chunk-ke9tpkk2.js} +1 -1
  214. package/dist/{chunk-6tf8wacp.js → chunk-kncs6js6.js} +1 -1
  215. package/dist/{chunk-q9wkyq6a.js → chunk-ksr76npa.js} +1 -1
  216. package/dist/chunk-ksy4d0za.js +1 -0
  217. package/dist/{chunk-962ms02t.js → chunk-kwgygr4z.js} +1 -1
  218. package/dist/{chunk-p3yymm16.js → chunk-m3zge9wv.js} +1 -1
  219. package/dist/{chunk-2xrccbwa.js → chunk-m7bwshtn.js} +1 -1
  220. package/dist/{chunk-gt6xd3pb.js → chunk-m8mdqeye.js} +1 -1
  221. package/dist/{chunk-jw043xpz.js → chunk-mcrmg4m8.js} +1 -1
  222. package/dist/{chunk-pdfvchxr.js → chunk-mfexzmw2.js} +1 -1
  223. package/dist/{chunk-dn2fe6a4.js → chunk-mjwypsrz.js} +1 -1
  224. package/dist/{chunk-2xr9jk3t.js → chunk-mp6yhf6a.js} +1 -1
  225. package/dist/chunk-mr7em8w4.js +1 -0
  226. package/dist/chunk-mrkf2b3t.js +434 -0
  227. package/dist/{chunk-66s9chr5.js → chunk-msha9pw1.js} +1 -1
  228. package/dist/{chunk-bcwnznke.js → chunk-mvv3ktys.js} +1 -1
  229. package/dist/{chunk-a4ah9wgn.js → chunk-mymqnpgf.js} +1 -1
  230. package/dist/{chunk-74j5prfv.js → chunk-n220pha2.js} +1 -1
  231. package/dist/{chunk-mx8stxha.js → chunk-n65ycayf.js} +1 -1
  232. package/dist/{chunk-pz1y3zyg.js → chunk-n72x5y7a.js} +1 -1
  233. package/dist/{chunk-5c13nrde.js → chunk-n9x46wsq.js} +1 -1
  234. package/dist/{chunk-8kt765dh.js → chunk-n9zmzbyq.js} +1 -1
  235. package/dist/{chunk-sd9rvjt6.js → chunk-nbcah8mh.js} +1 -1
  236. package/dist/chunk-ncs4rnsn.js +1 -0
  237. package/dist/{chunk-sjkk13dd.js → chunk-nt5n8jcr.js} +1 -1
  238. package/dist/{chunk-131cad67.js → chunk-nv58ta3s.js} +1 -1
  239. package/dist/{chunk-eceb8jjd.js → chunk-nw76mbwc.js} +1 -1
  240. package/dist/{chunk-cypczp4s.js → chunk-p2z2bacg.js} +1 -1
  241. package/dist/{chunk-zq5ncapf.js → chunk-p3mpqeqw.js} +1 -1
  242. package/dist/{chunk-t3q0fpe0.js → chunk-p3p6a3ht.js} +1 -1
  243. package/dist/{chunk-h1j74efh.js → chunk-p46at2ts.js} +1 -1
  244. package/dist/{chunk-5em7s1at.js → chunk-p6dgtz38.js} +1 -1
  245. package/dist/{chunk-nay5m04y.js → chunk-p70r0dds.js} +1 -1
  246. package/dist/{chunk-ntcxtgqe.js → chunk-p89xw4y2.js} +1 -1
  247. package/dist/{chunk-rnpfchb9.js → chunk-pd4wysbn.js} +1 -1
  248. package/dist/{chunk-5yv6fsvn.js → chunk-pe45n68n.js} +1 -1
  249. package/dist/{chunk-01tsa9cq.js → chunk-pf09ha3g.js} +1 -1
  250. package/dist/{chunk-v6nssgv7.js → chunk-pn04v4sv.js} +1 -1
  251. package/dist/{chunk-15zc0x9q.js → chunk-pnhf6jtr.js} +2 -2
  252. package/dist/{chunk-fdvezfdb.js → chunk-pr7vzg5y.js} +1 -1
  253. package/dist/{chunk-kz9rfhe3.js → chunk-psdrzwp5.js} +1 -1
  254. package/dist/{chunk-t6bb31dn.js → chunk-px75djc6.js} +1 -1
  255. package/dist/{chunk-m0czpwvf.js → chunk-q3x300wy.js} +1 -1
  256. package/dist/{chunk-mxwqk6ht.js → chunk-q56ns9ta.js} +1 -1
  257. package/dist/{chunk-zed64rf0.js → chunk-q86xqx6c.js} +1 -1
  258. package/dist/{chunk-gc0daqhj.js → chunk-q9711zm8.js} +1 -1
  259. package/dist/{chunk-m5rj1w7e.js → chunk-qpkn7wvc.js} +1 -1
  260. package/dist/{chunk-vsedmhna.js → chunk-r0gjpz5m.js} +1 -1
  261. package/dist/{chunk-5q1qtbx4.js → chunk-r1enj0f0.js} +1 -1
  262. package/dist/{chunk-0qys39ww.js → chunk-r9r1v9kw.js} +1 -1
  263. package/dist/{chunk-p0ys44e5.js → chunk-rc027n67.js} +1 -1
  264. package/dist/{chunk-zcg0fy8h.js → chunk-rmrp92n9.js} +1 -1
  265. package/dist/{chunk-1r67ngsh.js → chunk-rv0x9fbs.js} +1 -1
  266. package/dist/chunk-rvxb17kx.js +1 -0
  267. package/dist/{chunk-5gjt4v98.js → chunk-rxs4gexg.js} +1 -1
  268. package/dist/{chunk-5gp7nsdp.js → chunk-rxxn6qxm.js} +1 -1
  269. package/dist/{chunk-jk42e7d2.js → chunk-s6t5vxm9.js} +1 -1
  270. package/dist/chunk-s6xjfvvd.js +1 -0
  271. package/dist/{chunk-t7qx43hg.js → chunk-s719ttj9.js} +1 -1
  272. package/dist/{chunk-2mb0trr0.js → chunk-sd6qvm4t.js} +1 -1
  273. package/dist/chunk-shc3fcge.js +1 -0
  274. package/dist/chunk-ss233wsa.js +1 -0
  275. package/dist/{chunk-0b5e8zpy.js → chunk-stp38gza.js} +1 -1
  276. package/dist/{chunk-1mrzmr8f.js → chunk-sws9653v.js} +1 -1
  277. package/dist/{chunk-yk20e377.js → chunk-syme57ea.js} +1 -1
  278. package/dist/{chunk-07em03a3.js → chunk-t0tznkac.js} +1 -1
  279. package/dist/{chunk-zf96st2f.js → chunk-t32zj7ah.js} +1 -1
  280. package/dist/{chunk-vrjcy7h1.js → chunk-t5z5e89a.js} +1 -1
  281. package/dist/{chunk-87w588zd.js → chunk-t8w9hqaa.js} +1 -1
  282. package/dist/chunk-t97kks4j.js +1 -0
  283. package/dist/{chunk-f6rsbhs6.js → chunk-tamfhbc6.js} +1 -1
  284. package/dist/{chunk-s6qt552a.js → chunk-tchg9ygq.js} +1 -1
  285. package/dist/{chunk-6dat5vvb.js → chunk-te7k3eqj.js} +1 -1
  286. package/dist/{chunk-6r8jhnde.js → chunk-tpgf3t6p.js} +1 -1
  287. package/dist/{chunk-j2vek58t.js → chunk-tpyp8wqr.js} +1 -1
  288. package/dist/{chunk-vg1dem7m.js → chunk-trx18gxg.js} +1 -1
  289. package/dist/chunk-ts98e90r.js +1 -0
  290. package/dist/{chunk-brcvpmwp.js → chunk-tv1kqdv9.js} +1 -1
  291. package/dist/{chunk-zv3jegxm.js → chunk-tvbj84md.js} +1 -1
  292. package/dist/{chunk-16jx4h98.js → chunk-tx71e422.js} +1 -1
  293. package/dist/{chunk-3pzth5e2.js → chunk-ty5eswjv.js} +1 -1
  294. package/dist/{chunk-zwhbdwnt.js → chunk-v1e0cwqh.js} +1 -1
  295. package/dist/{chunk-3tfjvh53.js → chunk-v28dexnx.js} +1 -1
  296. package/dist/{chunk-cfsnygh0.js → chunk-v3bw2mnd.js} +1 -1
  297. package/dist/{chunk-10qr9jk1.js → chunk-v3ta4qyy.js} +1 -1
  298. package/dist/{chunk-8vsqygpz.js → chunk-v85y10pz.js} +1 -1
  299. package/dist/{chunk-9qtsjepd.js → chunk-v8ag7wgx.js} +1 -1
  300. package/dist/{chunk-x866vcqf.js → chunk-v9b5r8aq.js} +1 -1
  301. package/dist/chunk-vgvekk29.js +1 -0
  302. package/dist/{chunk-3mjwhvpy.js → chunk-vjvr9n6y.js} +1 -1
  303. package/dist/{chunk-vxdkfxtq.js → chunk-vkfhjhhh.js} +1 -1
  304. package/dist/{chunk-xkfzt78k.js → chunk-vxzscaap.js} +1 -1
  305. package/dist/{chunk-jrmcscsp.js → chunk-vyfvrrc8.js} +1 -1
  306. package/dist/{chunk-5hcvm27y.js → chunk-w0me5x6g.js} +1 -1
  307. package/dist/{chunk-vpah11mp.js → chunk-w69pf8zx.js} +1 -1
  308. package/dist/{chunk-e07gx0kg.js → chunk-w895krdx.js} +1 -1
  309. package/dist/{chunk-zgyww0w8.js → chunk-w8vzpn90.js} +1 -1
  310. package/dist/{chunk-18k4wz02.js → chunk-wb0ms9q0.js} +1 -1
  311. package/dist/{chunk-9rks3bc7.js → chunk-wk8sx9ev.js} +1 -1
  312. package/dist/{chunk-myx87v1y.js → chunk-wtwgpw9g.js} +1 -1
  313. package/dist/{chunk-vs72fgve.js → chunk-x0mnchxz.js} +1 -1
  314. package/dist/{chunk-9b45fe34.js → chunk-x0qb9311.js} +1 -1
  315. package/dist/chunk-x7g4cwft.js +1 -0
  316. package/dist/{chunk-t7zrr341.js → chunk-xb46b3bf.js} +1 -1
  317. package/dist/{chunk-b9s35wb6.js → chunk-xk0abc6t.js} +1 -1
  318. package/dist/{chunk-95963acy.js → chunk-xmp5jp4r.js} +1 -1
  319. package/dist/{chunk-wbcfbyft.js → chunk-xzpqbfjh.js} +1 -1
  320. package/dist/{chunk-s7qqrnzh.js → chunk-y1f3hfaq.js} +1 -1
  321. package/dist/{chunk-b7h6wk4v.js → chunk-y3d9nwzf.js} +1 -1
  322. package/dist/{chunk-mkzpj7ht.js → chunk-y3gfd4y3.js} +1 -1
  323. package/dist/{chunk-xc8efvab.js → chunk-y5pf2d0x.js} +1 -1
  324. package/dist/{chunk-6yk2jj1m.js → chunk-y6vatv51.js} +1 -1
  325. package/dist/{chunk-6wbgc1xz.js → chunk-y971vkwy.js} +1 -1
  326. package/dist/{chunk-w3y3sdmt.js → chunk-yb2kp04v.js} +1 -1
  327. package/dist/chunk-yctck6wf.js +1 -0
  328. package/dist/{chunk-nvynvczn.js → chunk-yfasv01s.js} +1 -1
  329. package/dist/{chunk-bj4851d8.js → chunk-yj27rmw2.js} +1 -1
  330. package/dist/{chunk-y62ja3na.js → chunk-ypj2k2de.js} +1 -1
  331. package/dist/{chunk-n9yfs19q.js → chunk-yr04s6b7.js} +1 -1
  332. package/dist/{chunk-xkvnfywa.js → chunk-yr48as8z.js} +1 -1
  333. package/dist/{chunk-35ncgr15.js → chunk-ywas7wb8.js} +1 -1
  334. package/dist/{chunk-jv8shhgk.js → chunk-ywp666sg.js} +1 -1
  335. package/dist/{chunk-1ek0xjkr.js → chunk-yx4mdqvf.js} +1 -1
  336. package/dist/{chunk-9xtq15gy.js → chunk-yxwramd1.js} +1 -1
  337. package/dist/{chunk-2kqs0amy.js → chunk-yz8sseev.js} +1 -1
  338. package/dist/{chunk-6jdfap4a.js → chunk-z0abvgpr.js} +1 -1
  339. package/dist/{chunk-wp436n3r.js → chunk-z46zzhqf.js} +1 -1
  340. package/dist/{chunk-dj82prdc.js → chunk-z6rwg7bs.js} +1 -1
  341. package/dist/{chunk-yd6e0k1x.js → chunk-zb9wth64.js} +1 -1
  342. package/dist/{chunk-p57dfnmm.js → chunk-zkfa00mf.js} +1 -1
  343. package/dist/{chunk-7jy1478y.js → chunk-znpdxhep.js} +1 -1
  344. package/dist/{chunk-4mj1r6nd.js → chunk-zpes0b8m.js} +1 -1
  345. package/dist/{chunk-5xhjmcrr.js → chunk-ztpff54v.js} +1 -1
  346. package/dist/cli.js +1 -1
  347. package/dist/nonInteractive.js +3 -3
  348. package/dist/zen-keyboard.js +1 -1
  349. package/package.json +2 -1
  350. package/dist/chunk-0c25y7k9.js +0 -1
  351. package/dist/chunk-29tmghhd.js +0 -1
  352. package/dist/chunk-3b63e6mc.js +0 -1
  353. package/dist/chunk-3st09pbw.js +0 -1
  354. package/dist/chunk-3zf20ctr.js +0 -1
  355. package/dist/chunk-4h4fdqy9.js +0 -1
  356. package/dist/chunk-87s313qe.js +0 -1
  357. package/dist/chunk-8n9e3wbs.js +0 -1
  358. package/dist/chunk-9xp471ze.js +0 -1
  359. package/dist/chunk-a0jc9gfw.js +0 -1
  360. package/dist/chunk-a22ebaj5.js +0 -1
  361. package/dist/chunk-bc95nfbs.js +0 -1
  362. package/dist/chunk-cd3rdhh1.js +0 -424
  363. package/dist/chunk-cdp5c1vf.js +0 -1
  364. package/dist/chunk-fsh8c4gw.js +0 -1
  365. package/dist/chunk-g0c5mmdz.js +0 -1
  366. package/dist/chunk-gz0bg0j5.js +0 -1
  367. package/dist/chunk-h77takma.js +0 -1
  368. package/dist/chunk-j9bkjc22.js +0 -1
  369. package/dist/chunk-jn4wgzaz.js +0 -1
  370. package/dist/chunk-jwtpf45z.js +0 -1
  371. package/dist/chunk-kephawnc.js +0 -1
  372. package/dist/chunk-kzafnaxn.js +0 -1
  373. package/dist/chunk-mgkmr3xy.js +0 -1
  374. package/dist/chunk-nq1k5tw4.js +0 -1
  375. package/dist/chunk-q2qcexv0.js +0 -1
  376. package/dist/chunk-s237yqg5.js +0 -1
  377. package/dist/chunk-sch9d3fe.js +0 -1
  378. package/dist/chunk-skh4rx0s.js +0 -1
  379. package/dist/chunk-svcy27ht.js +0 -1
  380. package/dist/chunk-t49vbac9.js +0 -1
  381. package/dist/chunk-txdyy4ya.js +0 -1
  382. package/dist/chunk-vcbgawge.js +0 -1
  383. package/dist/chunk-y7qk76sv.js +0 -1
  384. package/dist/chunk-yhpg01ds.js +0 -1
  385. package/dist/chunk-ynjy01zm.js +0 -1
@@ -0,0 +1,434 @@
1
+ import{Fb as D1}from"./chunk-y5pf2d0x.js";import{kc as Y2}from"./chunk-feptb1bb.js";import{AgentPackage as X0,MemoryStorage as Z0}from"@langgraph-js/standard-agent";import{tool as P1}from"@langchain/core/tools";import{z as Z2}from"zod";var y1=Z2.object({content:Z2.string().min(1),status:Z2.enum(["pending","in_progress","completed"]),id:Z2.string()}),b1=Z2.object({todos:Z2.array(y1).describe("The updated todo list")}),I5=P1(async()=>{return"todo saved successfully"},{name:"todo_write",description:`Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
2
+ It also helps the user understand the progress of the task and overall progress of their requests.
3
+ ## When to Use This Tool
4
+ Use this tool proactively in these scenarios:
5
+
6
+ 1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions
7
+ 2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations
8
+ 3. User explicitly requests todo list - When the user directly asks you to use the todo list
9
+ 4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)
10
+ 5. After receiving new instructions - Immediately capture user requirements as todos
11
+ 6. When you start working on a task - Mark it as in_progress BEFORE beginning work. Ideally you should only have one todo as in_progress at a time
12
+ 7. After completing a task - Mark it as completed and add any new follow-up tasks discovered during implementation
13
+
14
+ ## When NOT to Use This Tool
15
+
16
+ Skip using this tool when:
17
+ 1. There is only a single, straightforward task
18
+ 2. The task is trivial and tracking it provides no organizational benefit
19
+ 3. The task can be completed in less than 3 trivial steps
20
+ 4. The task is purely conversational or informational
21
+
22
+ NOTE that you should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.
23
+
24
+ ## Examples of When to Use the Todo List
25
+
26
+ <example>
27
+ User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!
28
+ Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.
29
+ *Creates todo list with the following items:*
30
+ 1. Create dark mode toggle component in Settings page
31
+ 2. Add dark mode state management (context/store)
32
+ 3. Implement CSS-in-JS styles for dark theme
33
+ 4. Update existing components to support theme switching
34
+ 5. Run tests and build process, addressing any failures or errors that occur
35
+ *Begins working on the first task*
36
+
37
+ <reasoning>
38
+ The assistant used the todo list because:
39
+ 1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes
40
+ 2. The user explicitly requested tests and build be run afterward
41
+ 3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task
42
+ </reasoning>
43
+ </example>
44
+
45
+ <example>
46
+ User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project
47
+ Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.
48
+ *Uses grep or search tools to locate all instances of getCwd in the codebase*
49
+ Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.
50
+ *Creates todo list with specific items for each file that needs updating*
51
+
52
+ <reasoning>
53
+ The assistant used the todo list because:
54
+ 1. First, the assistant searched to understand the scope of the task
55
+ 2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps
56
+ 3. The todo list helps ensure every instance is tracked and updated systematically
57
+ 4. This approach prevents missing any occurrences and maintains code consistency
58
+ </reasoning>
59
+ </example>
60
+
61
+
62
+ <example>
63
+ User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.
64
+ Assistant: I'll help implement these features. First, let's add all the features to the todo list.
65
+ *Creates a todo list breaking down each feature into specific tasks based on the project architecture*
66
+ Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.
67
+
68
+ <reasoning>
69
+ The assistant used the todo list because:
70
+ 1. The user provided multiple complex features to implement in a comma separated list
71
+ 2. The todo list helps organize these large features into manageable tasks
72
+ 3. This approach allows for tracking progress across the entire implementation
73
+ </reasoning>
74
+ </example>
75
+
76
+ <example>
77
+ User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>
78
+ Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.
79
+ *Reviews component structure, render patterns, state management, and data fetching*
80
+ Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.
81
+ *Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*
82
+ Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>
83
+
84
+ <reasoning>
85
+ The assistant used the todo list because:
86
+ 1. First, the assistant examined the codebase to identify specific performance issues
87
+ 2. Based on this analysis, it identified multiple optimization opportunities
88
+ 3. Performance optimization is a non-trivial task requiring multiple steps
89
+ 4. The todo list helps methodically track improvements across different components
90
+ 5. This systematic approach ensures all performance bottlenecks are addressed
91
+ </reasoning>
92
+ </example>
93
+
94
+ ## Examples of When NOT to Use the Todo List
95
+
96
+ <example>
97
+ User: How do I print 'Hello World' in Python?
98
+ Assistant: In Python, you can print "Hello World" with this simple code:
99
+
100
+ python
101
+ print("Hello World")
102
+
103
+ This will output the text "Hello World" to the console when executed.</assistant>
104
+
105
+ <reasoning>
106
+ The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.
107
+ </reasoning>
108
+ </example>
109
+
110
+ <example>
111
+ User: What does the git status command do?
112
+ Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.
113
+
114
+ <reasoning>
115
+ The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.
116
+ </reasoning>
117
+ </example>
118
+
119
+ <example>
120
+ User: Can you add a comment to the calculateTotal function to explain what it does?
121
+ Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.
122
+ * Uses the Edit tool to add a comment to the calculateTotal function *
123
+
124
+ <reasoning>
125
+ The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.
126
+ </reasoning>
127
+ </example>
128
+
129
+ <example>
130
+ User: Run npm install for me and tell me what happens.
131
+ Assistant: I'll run the npm install command for you.
132
+
133
+ *Executes: npm install*
134
+
135
+ The command completed successfully. Here's the output:
136
+ [Output of npm install command]
137
+
138
+ All dependencies have been installed according to your package.json file.
139
+
140
+ <reasoning>
141
+ The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.
142
+ </reasoning>
143
+ </example>
144
+
145
+ ## Task States and Management
146
+
147
+ 1. **Task States**: Use these states to track progress:
148
+ - pending: Task not yet started
149
+ - in_progress: Currently working on (limit to ONE task at a time)
150
+ - completed: Task finished successfully
151
+
152
+ 2. **Task Management**:
153
+ - Update task status in real-time as you work
154
+ - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)
155
+ - Only have ONE task in_progress at any time
156
+ - Complete current tasks before starting new ones
157
+ - Remove tasks that are no longer relevant from the list entirely
158
+
159
+ 3. **Task Completion Requirements**:
160
+ - ONLY mark a task as completed when you have FULLY accomplished it
161
+ - If you encounter errors, blockers, or cannot finish, keep the task as in_progress
162
+ - When blocked, create a new task describing what needs to be resolved
163
+ - Never mark a task as completed if:
164
+ - Tests are failing
165
+ - Implementation is partial
166
+ - You encountered unresolved errors
167
+ - You couldn't find necessary files or dependencies
168
+
169
+ 4. **Task Breakdown**:
170
+ - Create specific, actionable items
171
+ - Break complex tasks into smaller, manageable steps
172
+ - Use clear, descriptive task names
173
+
174
+ When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.
175
+ `,schema:b1});import{z as o}from"zod";import{tool as f1}from"langchain";var E1=o.object({label:o.string().min(1).max(50).describe("选项显示文本,简洁明了(1-50 字符)")}),h1=o.object({description:o.string().min(1).describe("向用户提出的问题,清晰具体,包含必要的上下文"),type:o.enum(["single_select","multi_select"]).describe("选择类型:single_select(单选)或 multi_select(多选)"),options:o.array(E1).min(2).max(6).describe("选项列表,至少 2 个,最多 6 个"),allow_custom_input:o.boolean().default(!0).describe("是否允许用户输入自定义文本,默认 true"),placeholder:o.string().optional().describe("自定义输入框的占位符文本")}),x5=f1(()=>{},{name:"ask_user_questions",description:"Ask the user a question with selectable options",schema:h1});var g1=[x5,I5];async function d1(Q,X){await Q.addTool({id:X.name,name:X.name,description:X.description});let Z={id:X.name,name:X.name,description:X.description,paramsSchema:X.schema,execute:async(q)=>{let V=await X.invoke(q);if(V&&typeof V==="object"&&"content"in V)return V.content;return V}};Q.tools.registerImplementation(Z)}async function O5(Q){return await Promise.all(g1.map((X)=>d1(Q,X)))}import{tool as c1}from"@langchain/core/tools";import{z as H2}from"zod";import{promises as W2}from"fs";import{resolve as l1,join as n1}from"path";var i1=H2.object({operation:H2.enum(["create","list","exists"]).describe("The folder operation to perform"),folder_path:H2.string().describe("The path to the folder (absolute or relative to cwd)"),description:H2.string().optional().describe("What you want to do"),recursive:H2.boolean().default(!0).optional().describe("For create: create parent directories if they do not exist")}).strict(),u5=c1(async({operation:Q,folder_path:X,recursive:Z=!0},q)=>{try{let V=l1(q.state.cwd,X);switch(Q){case"create":return await W2.mkdir(V,{recursive:Z}),`✓ Folder created successfully at: ${V}`;case"exists":try{await W2.access(V);let $=await W2.stat(V);return`✓ Folder exists at: ${V}
176
+ Type: ${$.isDirectory()?"Directory":"File"}`}catch{return`✗ Folder does not exist at: ${V}`}case"list":try{let $=await W2.readdir(V,{withFileTypes:!0});if($.length===0)return`Folder is empty: ${V}`;let J=[];J.push(`\uD83D\uDCC1 ${V}
177
+ `);let K=[],Y=[];for(let H of $){let z=n1(V,H.name);try{let W=await W2.stat(z),j=W.size,U=W.mtime.toLocaleDateString(),G=`${H.isDirectory()?"\uD83D\uDCC1":"\uD83D\uDCC4"} ${H.name}${H.isDirectory()?"/":""} (${j} bytes, ${U})`;if(H.isDirectory())K.push(G);else Y.push(G)}catch(W){Y.push(`⚠️ ${H.name} (unreadable)`)}}if(K.length>0)J.push("Directories:"),K.forEach((H)=>J.push(` ${H}`)),J.push("");if(Y.length>0)J.push("Files:"),Y.forEach((H)=>J.push(` ${H}`));return J.push(`
178
+ Total: ${K.length} directories, ${Y.length} files`),J.join(`
179
+ `)}catch($){if($.code==="ENOENT")return`✗ Folder not found: ${V}`;if($.code==="ENOTDIR")return`✗ Path exists but is not a folder: ${V}`;throw $}default:return`✗ Unknown operation: ${Q}`}}catch(V){if(V.code==="ENOENT")return`✗ Folder not found: ${X}`;if(V.code==="EACCES")return`✗ Permission denied: ${X}`;return`✗ Error: ${V.message}`}},{name:"folder_operations",description:`Unified folder operations tool supporting create, list, and existence check. Relative paths are resolved based on the current working directory (cwd).
180
+
181
+ **Operations:**
182
+ - create: Create a folder (supports nested directory creation)
183
+ - list: List all files and subdirectories with metadata
184
+ - exists: Check if a folder exists
185
+
186
+ **Usage Examples:**
187
+ - Create nested folders: {operation: "create", folder_path: "/path/to/nested/folder"}
188
+ - Create with relative path: {operation: "create", folder_path: "data/output"}
189
+ - List contents: {operation: "list", folder_path: "/path/to/folder"}
190
+ - List with relative path: {operation: "list", folder_path: "src"}
191
+ - Check existence: {operation: "exists", folder_path: "path/to/folder"}
192
+
193
+ **Important:**
194
+ - All folder paths can be absolute or relative to cwd
195
+ - Create operation is recursive (creates parent directories if needed)
196
+ - List operation shows file sizes and modification dates
197
+ - Delete operations are not supported for safety reasons. Use terminal commands with user approval if needed.`,schema:i1});import{tool as D6}from"@langchain/core/tools";import{z as a2}from"zod";var X5=(Q,X,Z)=>{let q=Q instanceof RegExp?R5(Q,Z):Q,V=X instanceof RegExp?R5(X,Z):X,$=q!==null&&V!=null&&o1(q,V,Z);return $&&{start:$[0],end:$[1],pre:Z.slice(0,$[0]),body:Z.slice($[0]+q.length,$[1]),post:Z.slice($[1]+V.length)}},R5=(Q,X)=>{let Z=X.match(Q);return Z?Z[0]:null},o1=(Q,X,Z)=>{let q,V,$,J=void 0,K,Y=Z.indexOf(Q),H=Z.indexOf(X,Y+1),z=Y;if(Y>=0&&H>0){if(Q===X)return[Y,H];q=[],$=Z.length;while(z>=0&&!K){if(z===Y)q.push(z),Y=Z.indexOf(Q,z+1);else if(q.length===1){let W=q.pop();if(W!==void 0)K=[W,H]}else{if(V=q.pop(),V!==void 0&&V<$)$=V,J=H;H=Z.indexOf(X,z+1)}z=Y<H&&Y>=0?Y:H}if(q.length&&J!==void 0)K=[$,J]}return K};var F5="\x00SLASH"+Math.random()+"\x00",T5="\x00OPEN"+Math.random()+"\x00",q5="\x00CLOSE"+Math.random()+"\x00",m5="\x00COMMA"+Math.random()+"\x00",N5="\x00PERIOD"+Math.random()+"\x00",a1=new RegExp(F5,"g"),p1=new RegExp(T5,"g"),s1=new RegExp(q5,"g"),r1=new RegExp(m5,"g"),e1=new RegExp(N5,"g"),t1=/\\\\/g,QQ=/\\{/g,XQ=/\\}/g,ZQ=/\\,/g,qQ=/\\./g,VQ=1e5;function Z5(Q){return!isNaN(Q)?parseInt(Q,10):Q.charCodeAt(0)}function $Q(Q){return Q.replace(t1,F5).replace(QQ,T5).replace(XQ,q5).replace(ZQ,m5).replace(qQ,N5)}function JQ(Q){return Q.replace(a1,"\\").replace(p1,"{").replace(s1,"}").replace(r1,",").replace(e1,".")}function D5(Q){if(!Q)return[""];let X=[],Z=X5("{","}",Q);if(!Z)return Q.split(",");let{pre:q,body:V,post:$}=Z,J=q.split(",");J[J.length-1]+="{"+V+"}";let K=D5($);if($.length)J[J.length-1]+=K.shift(),J.push.apply(J,K);return X.push.apply(X,J),X}function S5(Q,X={}){if(!Q)return[];let{max:Z=VQ}=X;if(Q.slice(0,2)==="{}")Q="\\{\\}"+Q.slice(2);return z2($Q(Q),Z,!0).map(JQ)}function KQ(Q){return"{"+Q+"}"}function YQ(Q){return/^-?0\d/.test(Q)}function HQ(Q,X){return Q<=X}function WQ(Q,X){return Q>=X}function z2(Q,X,Z){let q=[],V=X5("{","}",Q);if(!V)return[Q];let $=V.pre,J=V.post.length?z2(V.post,X,!1):[""];if(/\$$/.test(V.pre))for(let K=0;K<J.length&&K<X;K++){let Y=$+"{"+V.body+"}"+J[K];q.push(Y)}else{let K=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(V.body),Y=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(V.body),H=K||Y,z=V.body.indexOf(",")>=0;if(!H&&!z){if(V.post.match(/,(?!,).*\}/))return Q=V.pre+"{"+V.body+q5+V.post,z2(Q,X,!0);return[Q]}let W;if(H)W=V.body.split(/\.\./);else if(W=D5(V.body),W.length===1&&W[0]!==void 0){if(W=z2(W[0],X,!1).map(KQ),W.length===1)return J.map((U)=>V.pre+W[0]+U)}let j;if(H&&W[0]!==void 0&&W[1]!==void 0){let U=Z5(W[0]),k=Z5(W[1]),G=Math.max(W[0].length,W[1].length),v=W.length===3&&W[2]!==void 0?Math.abs(Z5(W[2])):1,B=HQ;if(k<U)v*=-1,B=WQ;let A=W.some(YQ);j=[];for(let _=U;B(_,k);_+=v){let w;if(Y){if(w=String.fromCharCode(_),w==="\\")w=""}else if(w=String(_),A){let i=G-w.length;if(i>0){let c=Array(i+1).join("0");if(_<0)w="-"+c+w.slice(1);else w=c+w}}j.push(w)}}else{j=[];for(let U=0;U<W.length;U++)j.push.apply(j,z2(W[U],X,!1))}for(let U=0;U<j.length;U++)for(let k=0;k<J.length&&q.length<X;k++){let G=$+j[U]+J[k];if(!Z||H||G)q.push(G)}}return q}var j2=(Q)=>{if(typeof Q!=="string")throw TypeError("invalid pattern");if(Q.length>65536)throw TypeError("pattern is too long")};var zQ={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},U2=(Q)=>Q.replace(/[[\]\\-]/g,"\\$&"),jQ=(Q)=>Q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),P5=(Q)=>Q.join(""),y5=(Q,X)=>{let Z=X;if(Q.charAt(Z)!=="[")throw Error("not in a brace expression");let q=[],V=[],$=Z+1,J=!1,K=!1,Y=!1,H=!1,z=Z,W="";Q:while($<Q.length){let G=Q.charAt($);if((G==="!"||G==="^")&&$===Z+1){H=!0,$++;continue}if(G==="]"&&J&&!Y){z=$+1;break}if(J=!0,G==="\\"){if(!Y){Y=!0,$++;continue}}if(G==="["&&!Y){for(let[v,[B,C,A]]of Object.entries(zQ))if(Q.startsWith(v,$)){if(W)return["$.",!1,Q.length-Z,!0];if($+=v.length,A)V.push(B);else q.push(B);K=K||C;continue Q}}if(Y=!1,W){if(G>W)q.push(U2(W)+"-"+U2(G));else if(G===W)q.push(U2(G));W="",$++;continue}if(Q.startsWith("-]",$+1)){q.push(U2(G+"-")),$+=2;continue}if(Q.startsWith("-",$+1)){W=G,$+=2;continue}q.push(U2(G)),$++}if(z<$)return["",!1,0,!1];if(!q.length&&!V.length)return["$.",!1,Q.length-Z,!0];if(V.length===0&&q.length===1&&/^\\?.$/.test(q[0])&&!H){let G=q[0].length===2?q[0].slice(-1):q[0];return[jQ(G),!1,z-Z,!1]}let j="["+(H?"^":"")+P5(q)+"]",U="["+(H?"":"^")+P5(V)+"]";return[q.length&&V.length?"("+j+"|"+U+")":q.length?j:U,K,z-Z,!0]};var b=(Q,{windowsPathsNoEscape:X=!1,magicalBraces:Z=!0}={})=>{if(Z)return X?Q.replace(/\[([^\/\\])\]/g,"$1"):Q.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");return X?Q.replace(/\[([^\/\\{}])\]/g,"$1"):Q.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};var UQ=new Set(["!","?","+","*","@"]),b5=(Q)=>UQ.has(Q),GQ="(?!(?:^|/)\\.\\.?(?:$|/))",F2="(?!\\.)",kQ=new Set(["[","."]),BQ=new Set(["..","."]),CQ=new Set("().*{}+?[]^$\\!"),vQ=(Q)=>Q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),V5="[^/]",f5=V5+"*?",E5=V5+"+?";class O{type;#Q;#Z;#$=!1;#V=[];#J;#A;#C;#W=!1;#K;#j;#z=!1;constructor(Q,X,Z={}){if(this.type=Q,Q)this.#Z=!0;if(this.#J=X,this.#Q=this.#J?this.#J.#Q:this,this.#K=this.#Q===this?Z:this.#Q.#K,this.#C=this.#Q===this?[]:this.#Q.#C,Q==="!"&&!this.#Q.#W)this.#C.push(this);this.#A=this.#J?this.#J.#V.length:0}get hasMagic(){if(this.#Z!==void 0)return this.#Z;for(let Q of this.#V){if(typeof Q==="string")continue;if(Q.type||Q.hasMagic)return this.#Z=!0}return this.#Z}toString(){if(this.#j!==void 0)return this.#j;if(!this.type)return this.#j=this.#V.map((Q)=>String(Q)).join("");else return this.#j=this.type+"("+this.#V.map((Q)=>String(Q)).join("|")+")"}#Y(){if(this!==this.#Q)throw Error("should only call on root");if(this.#W)return this;this.toString(),this.#W=!0;let Q;while(Q=this.#C.pop()){if(Q.type!=="!")continue;let X=Q,Z=X.#J;while(Z){for(let q=X.#A+1;!Z.type&&q<Z.#V.length;q++)for(let V of Q.#V){if(typeof V==="string")throw Error("string part in extglob AST??");V.copyIn(Z.#V[q])}X=Z,Z=X.#J}}return this}push(...Q){for(let X of Q){if(X==="")continue;if(typeof X!=="string"&&!(X instanceof O&&X.#J===this))throw Error("invalid part: "+X);this.#V.push(X)}}toJSON(){let Q=this.type===null?this.#V.slice().map((X)=>typeof X==="string"?X:X.toJSON()):[this.type,...this.#V.map((X)=>X.toJSON())];if(this.isStart()&&!this.type)Q.unshift([]);if(this.isEnd()&&(this===this.#Q||this.#Q.#W&&this.#J?.type==="!"))Q.push({});return Q}isStart(){if(this.#Q===this)return!0;if(!this.#J?.isStart())return!1;if(this.#A===0)return!0;let Q=this.#J;for(let X=0;X<this.#A;X++){let Z=Q.#V[X];if(!(Z instanceof O&&Z.type==="!"))return!1}return!0}isEnd(){if(this.#Q===this)return!0;if(this.#J?.type==="!")return!0;if(!this.#J?.isEnd())return!1;if(!this.type)return this.#J?.isEnd();let Q=this.#J?this.#J.#V.length:0;return this.#A===Q-1}copyIn(Q){if(typeof Q==="string")this.push(Q);else this.push(Q.clone(this))}clone(Q){let X=new O(this.type,Q);for(let Z of this.#V)X.copyIn(Z);return X}static#q(Q,X,Z,q){let V=!1,$=!1,J=-1,K=!1;if(X.type===null){let j=Z,U="";while(j<Q.length){let k=Q.charAt(j++);if(V||k==="\\"){V=!V,U+=k;continue}if($){if(j===J+1){if(k==="^"||k==="!")K=!0}else if(k==="]"&&!(j===J+2&&K))$=!1;U+=k;continue}else if(k==="["){$=!0,J=j,K=!1,U+=k;continue}if(!q.noext&&b5(k)&&Q.charAt(j)==="("){X.push(U),U="";let G=new O(k,X);j=O.#q(Q,G,j,q),X.push(G);continue}U+=k}return X.push(U),j}let Y=Z+1,H=new O(null,X),z=[],W="";while(Y<Q.length){let j=Q.charAt(Y++);if(V||j==="\\"){V=!V,W+=j;continue}if($){if(Y===J+1){if(j==="^"||j==="!")K=!0}else if(j==="]"&&!(Y===J+2&&K))$=!1;W+=j;continue}else if(j==="["){$=!0,J=Y,K=!1,W+=j;continue}if(b5(j)&&Q.charAt(Y)==="("){H.push(W),W="";let U=new O(j,H);H.push(U),Y=O.#q(Q,U,Y,q);continue}if(j==="|"){H.push(W),W="",z.push(H),H=new O(null,X);continue}if(j===")"){if(W===""&&X.#V.length===0)X.#z=!0;return H.push(W),W="",X.push(...z,H),Y}W+=j}return X.type=null,X.#Z=void 0,X.#V=[Q.substring(Z-1)],Y}static fromGlob(Q,X={}){let Z=new O(null,void 0,X);return O.#q(Q,Z,0,X),Z}toMMPattern(){if(this!==this.#Q)return this.#Q.toMMPattern();let Q=this.toString(),[X,Z,q,V]=this.toRegExpSource();if(!(q||this.#Z||this.#K.nocase&&!this.#K.nocaseMagicOnly&&Q.toUpperCase()!==Q.toLowerCase()))return Z;let J=(this.#K.nocase?"i":"")+(V?"u":"");return Object.assign(new RegExp(`^${X}$`,J),{_src:X,_glob:Q})}get options(){return this.#K}toRegExpSource(Q){let X=Q??!!this.#K.dot;if(this.#Q===this)this.#Y();if(!this.type){let K=this.isStart()&&this.isEnd()&&!this.#V.some((j)=>typeof j!=="string"),Y=this.#V.map((j)=>{let[U,k,G,v]=typeof j==="string"?O.#_(j,this.#Z,K):j.toRegExpSource(Q);return this.#Z=this.#Z||G,this.#$=this.#$||v,U}).join(""),H="";if(this.isStart()){if(typeof this.#V[0]==="string"){if(!(this.#V.length===1&&BQ.has(this.#V[0]))){let U=kQ,k=X&&U.has(Y.charAt(0))||Y.startsWith("\\.")&&U.has(Y.charAt(2))||Y.startsWith("\\.\\.")&&U.has(Y.charAt(4)),G=!X&&!Q&&U.has(Y.charAt(0));H=k?GQ:G?F2:""}}}let z="";if(this.isEnd()&&this.#Q.#W&&this.#J?.type==="!")z="(?:$|\\/)";return[H+Y+z,b(Y),this.#Z=!!this.#Z,this.#$]}let Z=this.type==="*"||this.type==="+",q=this.type==="!"?"(?:(?!(?:":"(?:",V=this.#U(X);if(this.isStart()&&this.isEnd()&&!V&&this.type!=="!"){let K=this.toString();return this.#V=[K],this.type=null,this.#Z=void 0,[K,b(this.toString()),!1,!1]}let $=!Z||Q||X||!F2?"":this.#U(!0);if($===V)$="";if($)V=`(?:${V})(?:${$})*?`;let J="";if(this.type==="!"&&this.#z)J=(this.isStart()&&!X?F2:"")+E5;else{let K=this.type==="!"?"))"+(this.isStart()&&!X&&!Q?F2:"")+f5+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&$?")":this.type==="*"&&$?")?":`)${this.type}`;J=q+V+K}return[J,b(V),this.#Z=!!this.#Z,this.#$]}#U(Q){return this.#V.map((X)=>{if(typeof X==="string")throw Error("string type in extglob ast??");let[Z,q,V,$]=X.toRegExpSource(Q);return this.#$=this.#$||$,Z}).filter((X)=>!(this.isStart()&&this.isEnd())||!!X).join("|")}static#_(Q,X,Z=!1){let q=!1,V="",$=!1,J=!1;for(let K=0;K<Q.length;K++){let Y=Q.charAt(K);if(q){q=!1,V+=(CQ.has(Y)?"\\":"")+Y;continue}if(Y==="*"){if(J)continue;J=!0,V+=Z&&/^[*]+$/.test(Q)?E5:f5,X=!0;continue}else J=!1;if(Y==="\\"){if(K===Q.length-1)V+="\\\\";else q=!0;continue}if(Y==="["){let[H,z,W,j]=y5(Q,K);if(W){V+=H,$=$||z,K+=W-1,X=X||j;continue}}if(Y==="?"){V+=V5,X=!0;continue}V+=vQ(Y)}return[V,b(Q),!!X,$]}}var q2=(Q,{windowsPathsNoEscape:X=!1,magicalBraces:Z=!1}={})=>{if(Z)return X?Q.replace(/[?*()[\]{}]/g,"[$&]"):Q.replace(/[?*()[\]\\{}]/g,"\\$&");return X?Q.replace(/[?*()[\]]/g,"[$&]"):Q.replace(/[?*()[\]\\]/g,"\\$&")};var F=(Q,X,Z={})=>{if(j2(X),!Z.nocomment&&X.charAt(0)==="#")return!1;return new S(X,Z).match(Q)},wQ=/^\*+([^+@!?\*\[\(]*)$/,AQ=(Q)=>(X)=>!X.startsWith(".")&&X.endsWith(Q),_Q=(Q)=>(X)=>X.endsWith(Q),LQ=(Q)=>{return Q=Q.toLowerCase(),(X)=>!X.startsWith(".")&&X.toLowerCase().endsWith(Q)},MQ=(Q)=>{return Q=Q.toLowerCase(),(X)=>X.toLowerCase().endsWith(Q)},IQ=/^\*+\.\*+$/,xQ=(Q)=>!Q.startsWith(".")&&Q.includes("."),OQ=(Q)=>Q!=="."&&Q!==".."&&Q.includes("."),uQ=/^\.\*+$/,RQ=(Q)=>Q!=="."&&Q!==".."&&Q.startsWith("."),FQ=/^\*+$/,TQ=(Q)=>Q.length!==0&&!Q.startsWith("."),mQ=(Q)=>Q.length!==0&&Q!=="."&&Q!=="..",NQ=/^\?+([^+@!?\*\[\(]*)?$/,DQ=([Q,X=""])=>{let Z=d5([Q]);if(!X)return Z;return X=X.toLowerCase(),(q)=>Z(q)&&q.toLowerCase().endsWith(X)},SQ=([Q,X=""])=>{let Z=c5([Q]);if(!X)return Z;return X=X.toLowerCase(),(q)=>Z(q)&&q.toLowerCase().endsWith(X)},PQ=([Q,X=""])=>{let Z=c5([Q]);return!X?Z:(q)=>Z(q)&&q.endsWith(X)},yQ=([Q,X=""])=>{let Z=d5([Q]);return!X?Z:(q)=>Z(q)&&q.endsWith(X)},d5=([Q])=>{let X=Q.length;return(Z)=>Z.length===X&&!Z.startsWith(".")},c5=([Q])=>{let X=Q.length;return(Z)=>Z.length===X&&Z!=="."&&Z!==".."},l5=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",h5={win32:{sep:"\\"},posix:{sep:"/"}},bQ=l5==="win32"?h5.win32.sep:h5.posix.sep;F.sep=bQ;var u=Symbol("globstar **");F.GLOBSTAR=u;var fQ="[^/]",EQ=fQ+"*?",hQ="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",gQ="(?:(?!(?:\\/|^)\\.).)*?",dQ=(Q,X={})=>(Z)=>F(Z,Q,X);F.filter=dQ;var D=(Q,X={})=>Object.assign({},Q,X),cQ=(Q)=>{if(!Q||typeof Q!=="object"||!Object.keys(Q).length)return F;let X=F;return Object.assign((q,V,$={})=>X(q,V,D(Q,$)),{Minimatch:class extends X.Minimatch{constructor(V,$={}){super(V,D(Q,$))}static defaults(V){return X.defaults(D(Q,V)).Minimatch}},AST:class extends X.AST{constructor(V,$,J={}){super(V,$,D(Q,J))}static fromGlob(V,$={}){return X.AST.fromGlob(V,D(Q,$))}},unescape:(q,V={})=>X.unescape(q,D(Q,V)),escape:(q,V={})=>X.escape(q,D(Q,V)),filter:(q,V={})=>X.filter(q,D(Q,V)),defaults:(q)=>X.defaults(D(Q,q)),makeRe:(q,V={})=>X.makeRe(q,D(Q,V)),braceExpand:(q,V={})=>X.braceExpand(q,D(Q,V)),match:(q,V,$={})=>X.match(q,V,D(Q,$)),sep:X.sep,GLOBSTAR:u})};F.defaults=cQ;var n5=(Q,X={})=>{if(j2(Q),X.nobrace||!/\{(?:(?!\{).)*\}/.test(Q))return[Q];return S5(Q,{max:X.braceExpandMax})};F.braceExpand=n5;var lQ=(Q,X={})=>new S(Q,X).makeRe();F.makeRe=lQ;var nQ=(Q,X,Z={})=>{let q=new S(X,Z);if(Q=Q.filter((V)=>q.match(V)),q.options.nonull&&!Q.length)Q.push(X);return Q};F.match=nQ;var g5=/[?*]|[+@!]\(.*?\)|\[|\]/,iQ=(Q)=>Q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class S{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(Q,X={}){j2(Q),X=X||{},this.options=X,this.pattern=Q,this.platform=X.platform||l5,this.isWindows=this.platform==="win32";let Z="allowWindowsEscape";if(this.windowsPathsNoEscape=!!X.windowsPathsNoEscape||X[Z]===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!X.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!X.nonegate,this.comment=!1,this.empty=!1,this.partial=!!X.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=X.windowsNoMagicRoot!==void 0?X.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let Q of this.set)for(let X of Q)if(typeof X!=="string")return!0;return!1}debug(...Q){}make(){let Q=this.pattern,X=this.options;if(!X.nocomment&&Q.charAt(0)==="#"){this.comment=!0;return}if(!Q){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],X.debug)this.debug=(...V)=>console.error(...V);this.debug(this.pattern,this.globSet);let Z=this.globSet.map((V)=>this.slashSplit(V));this.globParts=this.preprocess(Z),this.debug(this.pattern,this.globParts);let q=this.globParts.map((V,$,J)=>{if(this.isWindows&&this.windowsNoMagicRoot){let K=V[0]===""&&V[1]===""&&(V[2]==="?"||!g5.test(V[2]))&&!g5.test(V[3]),Y=/^[a-z]:/i.test(V[0]);if(K)return[...V.slice(0,4),...V.slice(4).map((H)=>this.parse(H))];else if(Y)return[V[0],...V.slice(1).map((H)=>this.parse(H))]}return V.map((K)=>this.parse(K))});if(this.debug(this.pattern,q),this.set=q.filter((V)=>V.indexOf(!1)===-1),this.isWindows)for(let V=0;V<this.set.length;V++){let $=this.set[V];if($[0]===""&&$[1]===""&&this.globParts[V][2]==="?"&&typeof $[3]==="string"&&/^[a-z]:$/i.test($[3]))$[2]="?"}this.debug(this.pattern,this.set)}preprocess(Q){if(this.options.noglobstar){for(let Z=0;Z<Q.length;Z++)for(let q=0;q<Q[Z].length;q++)if(Q[Z][q]==="**")Q[Z][q]="*"}let{optimizationLevel:X=1}=this.options;if(X>=2)Q=this.firstPhasePreProcess(Q),Q=this.secondPhasePreProcess(Q);else if(X>=1)Q=this.levelOneOptimize(Q);else Q=this.adjascentGlobstarOptimize(Q);return Q}adjascentGlobstarOptimize(Q){return Q.map((X)=>{let Z=-1;while((Z=X.indexOf("**",Z+1))!==-1){let q=Z;while(X[q+1]==="**")q++;if(q!==Z)X.splice(Z,q-Z)}return X})}levelOneOptimize(Q){return Q.map((X)=>{return X=X.reduce((Z,q)=>{let V=Z[Z.length-1];if(q==="**"&&V==="**")return Z;if(q===".."){if(V&&V!==".."&&V!=="."&&V!=="**")return Z.pop(),Z}return Z.push(q),Z},[]),X.length===0?[""]:X})}levelTwoFileOptimize(Q){if(!Array.isArray(Q))Q=this.slashSplit(Q);let X=!1;do{if(X=!1,!this.preserveMultipleSlashes){for(let q=1;q<Q.length-1;q++){let V=Q[q];if(q===1&&V===""&&Q[0]==="")continue;if(V==="."||V==="")X=!0,Q.splice(q,1),q--}if(Q[0]==="."&&Q.length===2&&(Q[1]==="."||Q[1]===""))X=!0,Q.pop()}let Z=0;while((Z=Q.indexOf("..",Z+1))!==-1){let q=Q[Z-1];if(q&&q!=="."&&q!==".."&&q!=="**")X=!0,Q.splice(Z-1,2),Z-=2}}while(X);return Q.length===0?[""]:Q}firstPhasePreProcess(Q){let X=!1;do{X=!1;for(let Z of Q){let q=-1;while((q=Z.indexOf("**",q+1))!==-1){let $=q;while(Z[$+1]==="**")$++;if($>q)Z.splice(q+1,$-q);let J=Z[q+1],K=Z[q+2],Y=Z[q+3];if(J!=="..")continue;if(!K||K==="."||K===".."||!Y||Y==="."||Y==="..")continue;X=!0,Z.splice(q,1);let H=Z.slice(0);H[q]="**",Q.push(H),q--}if(!this.preserveMultipleSlashes){for(let $=1;$<Z.length-1;$++){let J=Z[$];if($===1&&J===""&&Z[0]==="")continue;if(J==="."||J==="")X=!0,Z.splice($,1),$--}if(Z[0]==="."&&Z.length===2&&(Z[1]==="."||Z[1]===""))X=!0,Z.pop()}let V=0;while((V=Z.indexOf("..",V+1))!==-1){let $=Z[V-1];if($&&$!=="."&&$!==".."&&$!=="**"){X=!0;let K=V===1&&Z[V+1]==="**"?["."]:[];if(Z.splice(V-1,2,...K),Z.length===0)Z.push("");V-=2}}}}while(X);return Q}secondPhasePreProcess(Q){for(let X=0;X<Q.length-1;X++)for(let Z=X+1;Z<Q.length;Z++){let q=this.partsMatch(Q[X],Q[Z],!this.preserveMultipleSlashes);if(q){Q[X]=[],Q[Z]=q;break}}return Q.filter((X)=>X.length)}partsMatch(Q,X,Z=!1){let q=0,V=0,$=[],J="";while(q<Q.length&&V<X.length)if(Q[q]===X[V])$.push(J==="b"?X[V]:Q[q]),q++,V++;else if(Z&&Q[q]==="**"&&X[V]===Q[q+1])$.push(Q[q]),q++;else if(Z&&X[V]==="**"&&Q[q]===X[V+1])$.push(X[V]),V++;else if(Q[q]==="*"&&X[V]&&(this.options.dot||!X[V].startsWith("."))&&X[V]!=="**"){if(J==="b")return!1;J="a",$.push(Q[q]),q++,V++}else if(X[V]==="*"&&Q[q]&&(this.options.dot||!Q[q].startsWith("."))&&Q[q]!=="**"){if(J==="a")return!1;J="b",$.push(X[V]),q++,V++}else return!1;return Q.length===X.length&&$}parseNegate(){if(this.nonegate)return;let Q=this.pattern,X=!1,Z=0;for(let q=0;q<Q.length&&Q.charAt(q)==="!";q++)X=!X,Z++;if(Z)this.pattern=Q.slice(Z);this.negate=X}matchOne(Q,X,Z=!1){let q=this.options;if(this.isWindows){let k=typeof Q[0]==="string"&&/^[a-z]:$/i.test(Q[0]),G=!k&&Q[0]===""&&Q[1]===""&&Q[2]==="?"&&/^[a-z]:$/i.test(Q[3]),v=typeof X[0]==="string"&&/^[a-z]:$/i.test(X[0]),B=!v&&X[0]===""&&X[1]===""&&X[2]==="?"&&typeof X[3]==="string"&&/^[a-z]:$/i.test(X[3]),C=G?3:k?0:void 0,A=B?3:v?0:void 0;if(typeof C==="number"&&typeof A==="number"){let[_,w]=[Q[C],X[A]];if(_.toLowerCase()===w.toLowerCase()){if(X[A]=_,A>C)X=X.slice(A);else if(C>A)Q=Q.slice(C)}}}let{optimizationLevel:V=1}=this.options;if(V>=2)Q=this.levelTwoFileOptimize(Q);this.debug("matchOne",this,{file:Q,pattern:X}),this.debug("matchOne",Q.length,X.length);for(var $=0,J=0,K=Q.length,Y=X.length;$<K&&J<Y;$++,J++){this.debug("matchOne loop");var H=X[J],z=Q[$];if(this.debug(X,H,z),H===!1)return!1;if(H===u){this.debug("GLOBSTAR",[X,H,z]);var W=$,j=J+1;if(j===Y){this.debug("** at the end");for(;$<K;$++)if(Q[$]==="."||Q[$]===".."||!q.dot&&Q[$].charAt(0)===".")return!1;return!0}while(W<K){var U=Q[W];if(this.debug(`
198
+ globstar while`,Q,W,X,j,U),this.matchOne(Q.slice(W),X.slice(j),Z))return this.debug("globstar found match!",W,K,U),!0;else{if(U==="."||U===".."||!q.dot&&U.charAt(0)==="."){this.debug("dot detected!",Q,W,X,j);break}this.debug("globstar swallow a segment, and continue"),W++}}if(Z){if(this.debug(`
199
+ >>> no match, partial?`,Q,W,X,j),W===K)return!0}return!1}let k;if(typeof H==="string")k=z===H,this.debug("string match",H,z,k);else k=H.test(z),this.debug("pattern match",H,z,k);if(!k)return!1}if($===K&&J===Y)return!0;else if($===K)return Z;else if(J===Y)return $===K-1&&Q[$]==="";else throw Error("wtf?")}braceExpand(){return n5(this.pattern,this.options)}parse(Q){j2(Q);let X=this.options;if(Q==="**")return u;if(Q==="")return"";let Z,q=null;if(Z=Q.match(FQ))q=X.dot?mQ:TQ;else if(Z=Q.match(wQ))q=(X.nocase?X.dot?MQ:LQ:X.dot?_Q:AQ)(Z[1]);else if(Z=Q.match(NQ))q=(X.nocase?X.dot?SQ:DQ:X.dot?PQ:yQ)(Z);else if(Z=Q.match(IQ))q=X.dot?OQ:xQ;else if(Z=Q.match(uQ))q=RQ;let V=O.fromGlob(Q,this.options).toMMPattern();if(q&&typeof V==="object")Reflect.defineProperty(V,"test",{value:q});return V}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let Q=this.set;if(!Q.length)return this.regexp=!1,this.regexp;let X=this.options,Z=X.noglobstar?EQ:X.dot?hQ:gQ,q=new Set(X.nocase?["i"]:[]),V=Q.map((K)=>{let Y=K.map((z)=>{if(z instanceof RegExp)for(let W of z.flags.split(""))q.add(W);return typeof z==="string"?iQ(z):z===u?u:z._src});Y.forEach((z,W)=>{let j=Y[W+1],U=Y[W-1];if(z!==u||U===u)return;if(U===void 0)if(j!==void 0&&j!==u)Y[W+1]="(?:\\/|"+Z+"\\/)?"+j;else Y[W]=Z;else if(j===void 0)Y[W-1]=U+"(?:\\/|\\/"+Z+")?";else if(j!==u)Y[W-1]=U+"(?:\\/|\\/"+Z+"\\/)"+j,Y[W+1]=u});let H=Y.filter((z)=>z!==u);if(this.partial&&H.length>=1){let z=[];for(let W=1;W<=H.length;W++)z.push(H.slice(0,W).join("/"));return"(?:"+z.join("|")+")"}return H.join("/")}).join("|"),[$,J]=Q.length>1?["(?:",")"]:["",""];if(V="^"+$+V+J+"$",this.partial)V="^(?:\\/|"+$+V.slice(1,-1)+J+")$";if(this.negate)V="^(?!"+V+").+$";try{this.regexp=new RegExp(V,[...q].join(""))}catch(K){this.regexp=!1}return this.regexp}slashSplit(Q){if(this.preserveMultipleSlashes)return Q.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test(Q))return["",...Q.split(/\/+/)];else return Q.split(/\/+/)}match(Q,X=this.partial){if(this.debug("match",Q,this.pattern),this.comment)return!1;if(this.empty)return Q==="";if(Q==="/"&&X)return!0;let Z=this.options;if(this.isWindows)Q=Q.split("\\").join("/");let q=this.slashSplit(Q);this.debug(this.pattern,"split",q);let V=this.set;this.debug(this.pattern,"set",V);let $=q[q.length-1];if(!$)for(let J=q.length-2;!$&&J>=0;J--)$=q[J];for(let J=0;J<V.length;J++){let K=V[J],Y=q;if(Z.matchBase&&K.length===1)Y=[$];if(this.matchOne(Y,K,X)){if(Z.flipNegate)return!0;return!this.negate}}if(Z.flipNegate)return!1;return this.negate}static defaults(Q){return F.defaults(Q).Minimatch}}F.AST=O;F.Minimatch=S;F.escape=q2;F.unescape=b;import{fileURLToPath as O6}from"node:url";var oQ=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,o5=new Set,$5=typeof process=="object"&&process?process:{},a5=(Q,X,Z,q)=>{typeof $5.emitWarning=="function"?$5.emitWarning(Q,X,Z,q):console.error(`[${Z}] ${X}: ${Q}`)},m2=globalThis.AbortController,i5=globalThis.AbortSignal;if(typeof m2>"u"){i5=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(Z,q){this._onabort.push(q)}},m2=class{constructor(){X()}signal=new i5;abort(Z){if(!this.signal.aborted){this.signal.reason=Z,this.signal.aborted=!0;for(let q of this.signal._onabort)q(Z);this.signal.onabort?.(Z)}}};let Q=$5.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",X=()=>{Q&&(Q=!1,a5("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",X))}}var aQ=(Q)=>!o5.has(Q),h0=Symbol("type"),a=(Q)=>Q&&Q===Math.floor(Q)&&Q>0&&isFinite(Q),p5=(Q)=>a(Q)?Q<=Math.pow(2,8)?Uint8Array:Q<=Math.pow(2,16)?Uint16Array:Q<=Math.pow(2,32)?Uint32Array:Q<=Number.MAX_SAFE_INTEGER?T2:null:null,T2=class extends Array{constructor(Q){super(Q),this.fill(0)}},pQ=class Q{heap;length;static#Q=!1;static create(X){let Z=p5(X);if(!Z)return[];Q.#Q=!0;let q=new Q(X,Z);return Q.#Q=!1,q}constructor(X,Z){if(!Q.#Q)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new Z(X),this.length=0}push(X){this.heap[this.length++]=X}pop(){return this.heap[--this.length]}},G2=class Q{#Q;#Z;#$;#V;#J;#A;#C;#W;get perf(){return this.#W}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#K;#j;#z;#Y;#q;#U;#_;#w;#G;#R;#k;#I;#x;#B;#v;#L;#O;#X;#S;static unsafeExposeInternals(X){return{starts:X.#x,ttls:X.#B,autopurgeTimers:X.#v,sizes:X.#I,keyMap:X.#z,keyList:X.#Y,valList:X.#q,next:X.#U,prev:X.#_,get head(){return X.#w},get tail(){return X.#G},free:X.#R,isBackgroundFetch:(Z)=>X.#H(Z),backgroundFetch:(Z,q,V,$)=>X.#d(Z,q,V,$),moveToTail:(Z)=>X.#y(Z),indexes:(Z)=>X.#T(Z),rindexes:(Z)=>X.#m(Z),isStale:(Z)=>X.#M(Z)}}get max(){return this.#Q}get maxSize(){return this.#Z}get calculatedSize(){return this.#j}get size(){return this.#K}get fetchMethod(){return this.#A}get memoMethod(){return this.#C}get dispose(){return this.#$}get onInsert(){return this.#V}get disposeAfter(){return this.#J}constructor(X){let{max:Z=0,ttl:q,ttlResolution:V=1,ttlAutopurge:$,updateAgeOnGet:J,updateAgeOnHas:K,allowStale:Y,dispose:H,onInsert:z,disposeAfter:W,noDisposeOnSet:j,noUpdateTTL:U,maxSize:k=0,maxEntrySize:G=0,sizeCalculation:v,fetchMethod:B,memoMethod:C,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:_,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:i,ignoreFetchAbort:c,perf:Q2}=X;if(Q2!==void 0&&typeof Q2?.now!="function")throw TypeError("perf option must have a now() method if specified");if(this.#W=Q2??oQ,Z!==0&&!a(Z))throw TypeError("max option must be a nonnegative integer");let X2=Z?p5(Z):Array;if(!X2)throw Error("invalid max value: "+Z);if(this.#Q=Z,this.#Z=k,this.maxEntrySize=G||this.#Z,this.sizeCalculation=v,this.sizeCalculation){if(!this.#Z&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw TypeError("memoMethod must be a function if defined");if(this.#C=C,B!==void 0&&typeof B!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#A=B,this.#O=!!B,this.#z=new Map,this.#Y=Array(Z).fill(void 0),this.#q=Array(Z).fill(void 0),this.#U=new X2(Z),this.#_=new X2(Z),this.#w=0,this.#G=0,this.#R=pQ.create(Z),this.#K=0,this.#j=0,typeof H=="function"&&(this.#$=H),typeof z=="function"&&(this.#V=z),typeof W=="function"?(this.#J=W,this.#k=[]):(this.#J=void 0,this.#k=void 0),this.#L=!!this.#$,this.#S=!!this.#V,this.#X=!!this.#J,this.noDisposeOnSet=!!j,this.noUpdateTTL=!!U,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!i,this.ignoreFetchAbort=!!c,this.maxEntrySize!==0){if(this.#Z!==0&&!a(this.#Z))throw TypeError("maxSize must be a positive integer if specified");if(!a(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#l()}if(this.allowStale=!!Y,this.noDeleteOnStaleGet=!!_,this.updateAgeOnGet=!!J,this.updateAgeOnHas=!!K,this.ttlResolution=a(V)||V===0?V:1,this.ttlAutopurge=!!$,this.ttl=q||0,this.ttl){if(!a(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#N()}if(this.#Q===0&&this.ttl===0&&this.#Z===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#Q&&!this.#Z){let Q5="LRU_CACHE_UNBOUNDED";aQ(Q5)&&(o5.add(Q5),a5("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Q5,Q))}}getRemainingTTL(X){return this.#z.has(X)?1/0:0}#N(){let X=new T2(this.#Q),Z=new T2(this.#Q);this.#B=X,this.#x=Z;let q=this.ttlAutopurge?Array(this.#Q):void 0;this.#v=q,this.#f=(J,K,Y=this.#W.now())=>{if(Z[J]=K!==0?Y:0,X[J]=K,q?.[J]&&(clearTimeout(q[J]),q[J]=void 0),K!==0&&q){let H=setTimeout(()=>{this.#M(J)&&this.#F(this.#Y[J],"expire")},K+1);H.unref&&H.unref(),q[J]=H}},this.#u=(J)=>{Z[J]=X[J]!==0?this.#W.now():0},this.#D=(J,K)=>{if(X[K]){let Y=X[K],H=Z[K];if(!Y||!H)return;J.ttl=Y,J.start=H,J.now=V||$();let z=J.now-H;J.remainingTTL=Y-z}};let V=0,$=()=>{let J=this.#W.now();if(this.ttlResolution>0){V=J;let K=setTimeout(()=>V=0,this.ttlResolution);K.unref&&K.unref()}return J};this.getRemainingTTL=(J)=>{let K=this.#z.get(J);if(K===void 0)return 0;let Y=X[K],H=Z[K];if(!Y||!H)return 1/0;let z=(V||$())-H;return Y-z},this.#M=(J)=>{let K=Z[J],Y=X[J];return!!Y&&!!K&&(V||$())-K>Y}}#u=()=>{};#D=()=>{};#f=()=>{};#M=()=>!1;#l(){let X=new T2(this.#Q);this.#j=0,this.#I=X,this.#b=(Z)=>{this.#j-=X[Z],X[Z]=0},this.#E=(Z,q,V,$)=>{if(this.#H(q))return 0;if(!a(V))if($){if(typeof $!="function")throw TypeError("sizeCalculation must be a function");if(V=$(q,Z),!a(V))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return V},this.#P=(Z,q,V)=>{if(X[Z]=q,this.#Z){let $=this.#Z-X[Z];for(;this.#j>$;)this.#g(!0)}this.#j+=X[Z],V&&(V.entrySize=q,V.totalCalculatedSize=this.#j)}}#b=(X)=>{};#P=(X,Z,q)=>{};#E=(X,Z,q,V)=>{if(q||V)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:X=this.allowStale}={}){if(this.#K)for(let Z=this.#G;!(!this.#h(Z)||((X||!this.#M(Z))&&(yield Z),Z===this.#w));)Z=this.#_[Z]}*#m({allowStale:X=this.allowStale}={}){if(this.#K)for(let Z=this.#w;!(!this.#h(Z)||((X||!this.#M(Z))&&(yield Z),Z===this.#G));)Z=this.#U[Z]}#h(X){return X!==void 0&&this.#z.get(this.#Y[X])===X}*entries(){for(let X of this.#T())this.#q[X]!==void 0&&this.#Y[X]!==void 0&&!this.#H(this.#q[X])&&(yield[this.#Y[X],this.#q[X]])}*rentries(){for(let X of this.#m())this.#q[X]!==void 0&&this.#Y[X]!==void 0&&!this.#H(this.#q[X])&&(yield[this.#Y[X],this.#q[X]])}*keys(){for(let X of this.#T()){let Z=this.#Y[X];Z!==void 0&&!this.#H(this.#q[X])&&(yield Z)}}*rkeys(){for(let X of this.#m()){let Z=this.#Y[X];Z!==void 0&&!this.#H(this.#q[X])&&(yield Z)}}*values(){for(let X of this.#T())this.#q[X]!==void 0&&!this.#H(this.#q[X])&&(yield this.#q[X])}*rvalues(){for(let X of this.#m())this.#q[X]!==void 0&&!this.#H(this.#q[X])&&(yield this.#q[X])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(X,Z={}){for(let q of this.#T()){let V=this.#q[q],$=this.#H(V)?V.__staleWhileFetching:V;if($!==void 0&&X($,this.#Y[q],this))return this.get(this.#Y[q],Z)}}forEach(X,Z=this){for(let q of this.#T()){let V=this.#q[q],$=this.#H(V)?V.__staleWhileFetching:V;$!==void 0&&X.call(Z,$,this.#Y[q],this)}}rforEach(X,Z=this){for(let q of this.#m()){let V=this.#q[q],$=this.#H(V)?V.__staleWhileFetching:V;$!==void 0&&X.call(Z,$,this.#Y[q],this)}}purgeStale(){let X=!1;for(let Z of this.#m({allowStale:!0}))this.#M(Z)&&(this.#F(this.#Y[Z],"expire"),X=!0);return X}info(X){let Z=this.#z.get(X);if(Z===void 0)return;let q=this.#q[Z],V=this.#H(q)?q.__staleWhileFetching:q;if(V===void 0)return;let $={value:V};if(this.#B&&this.#x){let J=this.#B[Z],K=this.#x[Z];if(J&&K){let Y=J-(this.#W.now()-K);$.ttl=Y,$.start=Date.now()}}return this.#I&&($.size=this.#I[Z]),$}dump(){let X=[];for(let Z of this.#T({allowStale:!0})){let q=this.#Y[Z],V=this.#q[Z],$=this.#H(V)?V.__staleWhileFetching:V;if($===void 0||q===void 0)continue;let J={value:$};if(this.#B&&this.#x){J.ttl=this.#B[Z];let K=this.#W.now()-this.#x[Z];J.start=Math.floor(Date.now()-K)}this.#I&&(J.size=this.#I[Z]),X.unshift([q,J])}return X}load(X){this.clear();for(let[Z,q]of X){if(q.start){let V=Date.now()-q.start;q.start=this.#W.now()-V}this.set(Z,q.value,q)}}set(X,Z,q={}){if(Z===void 0)return this.delete(X),this;let{ttl:V=this.ttl,start:$,noDisposeOnSet:J=this.noDisposeOnSet,sizeCalculation:K=this.sizeCalculation,status:Y}=q,{noUpdateTTL:H=this.noUpdateTTL}=q,z=this.#E(X,Z,q.size||0,K);if(this.maxEntrySize&&z>this.maxEntrySize)return Y&&(Y.set="miss",Y.maxEntrySizeExceeded=!0),this.#F(X,"set"),this;let W=this.#K===0?void 0:this.#z.get(X);if(W===void 0)W=this.#K===0?this.#G:this.#R.length!==0?this.#R.pop():this.#K===this.#Q?this.#g(!1):this.#K,this.#Y[W]=X,this.#q[W]=Z,this.#z.set(X,W),this.#U[this.#G]=W,this.#_[W]=this.#G,this.#G=W,this.#K++,this.#P(W,z,Y),Y&&(Y.set="add"),H=!1,this.#S&&this.#V?.(Z,X,"add");else{this.#y(W);let j=this.#q[W];if(Z!==j){if(this.#O&&this.#H(j)){j.__abortController.abort(Error("replaced"));let{__staleWhileFetching:U}=j;U!==void 0&&!J&&(this.#L&&this.#$?.(U,X,"set"),this.#X&&this.#k?.push([U,X,"set"]))}else J||(this.#L&&this.#$?.(j,X,"set"),this.#X&&this.#k?.push([j,X,"set"]));if(this.#b(W),this.#P(W,z,Y),this.#q[W]=Z,Y){Y.set="replace";let U=j&&this.#H(j)?j.__staleWhileFetching:j;U!==void 0&&(Y.oldValue=U)}}else Y&&(Y.set="update");this.#S&&this.onInsert?.(Z,X,Z===j?"update":"replace")}if(V!==0&&!this.#B&&this.#N(),this.#B&&(H||this.#f(W,V,$),Y&&this.#D(Y,W)),!J&&this.#X&&this.#k){let j=this.#k,U;for(;U=j?.shift();)this.#J?.(...U)}return this}pop(){try{for(;this.#K;){let X=this.#q[this.#w];if(this.#g(!0),this.#H(X)){if(X.__staleWhileFetching)return X.__staleWhileFetching}else if(X!==void 0)return X}}finally{if(this.#X&&this.#k){let X=this.#k,Z;for(;Z=X?.shift();)this.#J?.(...Z)}}}#g(X){let Z=this.#w,q=this.#Y[Z],V=this.#q[Z];return this.#O&&this.#H(V)?V.__abortController.abort(Error("evicted")):(this.#L||this.#X)&&(this.#L&&this.#$?.(V,q,"evict"),this.#X&&this.#k?.push([V,q,"evict"])),this.#b(Z),this.#v?.[Z]&&(clearTimeout(this.#v[Z]),this.#v[Z]=void 0),X&&(this.#Y[Z]=void 0,this.#q[Z]=void 0,this.#R.push(Z)),this.#K===1?(this.#w=this.#G=0,this.#R.length=0):this.#w=this.#U[Z],this.#z.delete(q),this.#K--,Z}has(X,Z={}){let{updateAgeOnHas:q=this.updateAgeOnHas,status:V}=Z,$=this.#z.get(X);if($!==void 0){let J=this.#q[$];if(this.#H(J)&&J.__staleWhileFetching===void 0)return!1;if(this.#M($))V&&(V.has="stale",this.#D(V,$));else return q&&this.#u($),V&&(V.has="hit",this.#D(V,$)),!0}else V&&(V.has="miss");return!1}peek(X,Z={}){let{allowStale:q=this.allowStale}=Z,V=this.#z.get(X);if(V===void 0||!q&&this.#M(V))return;let $=this.#q[V];return this.#H($)?$.__staleWhileFetching:$}#d(X,Z,q,V){let $=Z===void 0?void 0:this.#q[Z];if(this.#H($))return $;let J=new m2,{signal:K}=q;K?.addEventListener("abort",()=>J.abort(K.reason),{signal:J.signal});let Y={signal:J.signal,options:q,context:V},H=(G,v=!1)=>{let{aborted:B}=J.signal,C=q.ignoreFetchAbort&&G!==void 0,A=q.ignoreFetchAbort||!!(q.allowStaleOnFetchAbort&&G!==void 0);if(q.status&&(B&&!v?(q.status.fetchAborted=!0,q.status.fetchError=J.signal.reason,C&&(q.status.fetchAbortIgnored=!0)):q.status.fetchResolved=!0),B&&!C&&!v)return W(J.signal.reason,A);let _=U,w=this.#q[Z];return(w===U||C&&v&&w===void 0)&&(G===void 0?_.__staleWhileFetching!==void 0?this.#q[Z]=_.__staleWhileFetching:this.#F(X,"fetch"):(q.status&&(q.status.fetchUpdated=!0),this.set(X,G,Y.options))),G},z=(G)=>(q.status&&(q.status.fetchRejected=!0,q.status.fetchError=G),W(G,!1)),W=(G,v)=>{let{aborted:B}=J.signal,C=B&&q.allowStaleOnFetchAbort,A=C||q.allowStaleOnFetchRejection,_=A||q.noDeleteOnFetchRejection,w=U;if(this.#q[Z]===U&&(!_||!v&&w.__staleWhileFetching===void 0?this.#F(X,"fetch"):C||(this.#q[Z]=w.__staleWhileFetching)),A)return q.status&&w.__staleWhileFetching!==void 0&&(q.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw G},j=(G,v)=>{let B=this.#A?.(X,$,Y);B&&B instanceof Promise&&B.then((C)=>G(C===void 0?void 0:C),v),J.signal.addEventListener("abort",()=>{(!q.ignoreFetchAbort||q.allowStaleOnFetchAbort)&&(G(void 0),q.allowStaleOnFetchAbort&&(G=(C)=>H(C,!0)))})};q.status&&(q.status.fetchDispatched=!0);let U=new Promise(j).then(H,z),k=Object.assign(U,{__abortController:J,__staleWhileFetching:$,__returned:void 0});return Z===void 0?(this.set(X,k,{...Y.options,status:void 0}),Z=this.#z.get(X)):this.#q[Z]=k,k}#H(X){if(!this.#O)return!1;let Z=X;return!!Z&&Z instanceof Promise&&Z.hasOwnProperty("__staleWhileFetching")&&Z.__abortController instanceof m2}async fetch(X,Z={}){let{allowStale:q=this.allowStale,updateAgeOnGet:V=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,ttl:J=this.ttl,noDisposeOnSet:K=this.noDisposeOnSet,size:Y=0,sizeCalculation:H=this.sizeCalculation,noUpdateTTL:z=this.noUpdateTTL,noDeleteOnFetchRejection:W=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:j=this.allowStaleOnFetchRejection,ignoreFetchAbort:U=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:G,forceRefresh:v=!1,status:B,signal:C}=Z;if(!this.#O)return B&&(B.fetch="get"),this.get(X,{allowStale:q,updateAgeOnGet:V,noDeleteOnStaleGet:$,status:B});let A={allowStale:q,updateAgeOnGet:V,noDeleteOnStaleGet:$,ttl:J,noDisposeOnSet:K,size:Y,sizeCalculation:H,noUpdateTTL:z,noDeleteOnFetchRejection:W,allowStaleOnFetchRejection:j,allowStaleOnFetchAbort:k,ignoreFetchAbort:U,status:B,signal:C},_=this.#z.get(X);if(_===void 0){B&&(B.fetch="miss");let w=this.#d(X,_,A,G);return w.__returned=w}else{let w=this.#q[_];if(this.#H(w)){let X2=q&&w.__staleWhileFetching!==void 0;return B&&(B.fetch="inflight",X2&&(B.returnedStale=!0)),X2?w.__staleWhileFetching:w.__returned=w}let i=this.#M(_);if(!v&&!i)return B&&(B.fetch="hit"),this.#y(_),V&&this.#u(_),B&&this.#D(B,_),w;let c=this.#d(X,_,A,G),Q2=c.__staleWhileFetching!==void 0&&q;return B&&(B.fetch=i?"stale":"refresh",Q2&&i&&(B.returnedStale=!0)),Q2?c.__staleWhileFetching:c.__returned=c}}async forceFetch(X,Z={}){let q=await this.fetch(X,Z);if(q===void 0)throw Error("fetch() returned undefined");return q}memo(X,Z={}){let q=this.#C;if(!q)throw Error("no memoMethod provided to constructor");let{context:V,forceRefresh:$,...J}=Z,K=this.get(X,J);if(!$&&K!==void 0)return K;let Y=q(X,K,{options:J,context:V});return this.set(X,Y,J),Y}get(X,Z={}){let{allowStale:q=this.allowStale,updateAgeOnGet:V=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,status:J}=Z,K=this.#z.get(X);if(K!==void 0){let Y=this.#q[K],H=this.#H(Y);return J&&this.#D(J,K),this.#M(K)?(J&&(J.get="stale"),H?(J&&q&&Y.__staleWhileFetching!==void 0&&(J.returnedStale=!0),q?Y.__staleWhileFetching:void 0):($||this.#F(X,"expire"),J&&q&&(J.returnedStale=!0),q?Y:void 0)):(J&&(J.get="hit"),H?Y.__staleWhileFetching:(this.#y(K),V&&this.#u(K),Y))}else J&&(J.get="miss")}#c(X,Z){this.#_[Z]=X,this.#U[X]=Z}#y(X){X!==this.#G&&(X===this.#w?this.#w=this.#U[X]:this.#c(this.#_[X],this.#U[X]),this.#c(this.#G,X),this.#G=X)}delete(X){return this.#F(X,"delete")}#F(X,Z){let q=!1;if(this.#K!==0){let V=this.#z.get(X);if(V!==void 0)if(this.#v?.[V]&&(clearTimeout(this.#v?.[V]),this.#v[V]=void 0),q=!0,this.#K===1)this.#n(Z);else{this.#b(V);let $=this.#q[V];if(this.#H($)?$.__abortController.abort(Error("deleted")):(this.#L||this.#X)&&(this.#L&&this.#$?.($,X,Z),this.#X&&this.#k?.push([$,X,Z])),this.#z.delete(X),this.#Y[V]=void 0,this.#q[V]=void 0,V===this.#G)this.#G=this.#_[V];else if(V===this.#w)this.#w=this.#U[V];else{let J=this.#_[V];this.#U[J]=this.#U[V];let K=this.#U[V];this.#_[K]=this.#_[V]}this.#K--,this.#R.push(V)}}if(this.#X&&this.#k?.length){let V=this.#k,$;for(;$=V?.shift();)this.#J?.(...$)}return q}clear(){return this.#n("delete")}#n(X){for(let Z of this.#m({allowStale:!0})){let q=this.#q[Z];if(this.#H(q))q.__abortController.abort(Error("deleted"));else{let V=this.#Y[Z];this.#L&&this.#$?.(q,V,X),this.#X&&this.#k?.push([q,V,X])}}if(this.#z.clear(),this.#q.fill(void 0),this.#Y.fill(void 0),this.#B&&this.#x){this.#B.fill(0),this.#x.fill(0);for(let Z of this.#v??[])Z!==void 0&&clearTimeout(Z);this.#v?.fill(void 0)}if(this.#I&&this.#I.fill(0),this.#w=0,this.#G=0,this.#R.length=0,this.#j=0,this.#K=0,this.#X&&this.#k){let Z=this.#k,q;for(;q=Z?.shift();)this.#J?.(...q)}}};import{posix as J6,win32 as k5}from"node:path";import{fileURLToPath as K6}from"node:url";import{lstatSync as Y6,readdir as H6,readdirSync as W6,readlinkSync as z6,realpathSync as j6}from"fs";import*as U6 from"node:fs";import{lstat as k6,readdir as B6,readlink as C6,realpath as v6}from"node:fs/promises";import{EventEmitter as z5}from"node:events";import Q1 from"node:stream";import{StringDecoder as sQ}from"node:string_decoder";var s5=typeof process==="object"&&process?process:{stdout:null,stderr:null},rQ=(Q)=>!!Q&&typeof Q==="object"&&(Q instanceof e||Q instanceof Q1||eQ(Q)||tQ(Q)),eQ=(Q)=>!!Q&&typeof Q==="object"&&Q instanceof z5&&typeof Q.pipe==="function"&&Q.pipe!==Q1.Writable.prototype.pipe,tQ=(Q)=>!!Q&&typeof Q==="object"&&Q instanceof z5&&typeof Q.write==="function"&&typeof Q.end==="function",l=Symbol("EOF"),n=Symbol("maybeEmitEnd"),p=Symbol("emittedEnd"),N2=Symbol("emittingEnd"),k2=Symbol("emittedError"),D2=Symbol("closed"),r5=Symbol("read"),S2=Symbol("flush"),e5=Symbol("flushChunk"),f=Symbol("encoding"),V2=Symbol("decoder"),M=Symbol("flowing"),B2=Symbol("paused"),$2=Symbol("resume"),I=Symbol("buffer"),T=Symbol("pipes"),x=Symbol("bufferLength"),J5=Symbol("bufferPush"),P2=Symbol("bufferShift"),R=Symbol("objectMode"),L=Symbol("destroyed"),K5=Symbol("error"),Y5=Symbol("emitData"),t5=Symbol("emitEnd"),H5=Symbol("emitEnd2"),h=Symbol("async"),W5=Symbol("abort"),y2=Symbol("aborted"),C2=Symbol("signal"),r=Symbol("dataListeners"),N=Symbol("discarded"),v2=(Q)=>Promise.resolve().then(Q),Q6=(Q)=>Q(),X6=(Q)=>Q==="end"||Q==="finish"||Q==="prefinish",Z6=(Q)=>Q instanceof ArrayBuffer||!!Q&&typeof Q==="object"&&Q.constructor&&Q.constructor.name==="ArrayBuffer"&&Q.byteLength>=0,q6=(Q)=>!Buffer.isBuffer(Q)&&ArrayBuffer.isView(Q);class j5{src;dest;opts;ondrain;constructor(Q,X,Z){this.src=Q,this.dest=X,this.opts=Z,this.ondrain=()=>Q[$2](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(Q){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class X1 extends j5{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(Q,X,Z){super(Q,X,Z);this.proxyErrors=(q)=>this.dest.emit("error",q),Q.on("error",this.proxyErrors)}}var V6=(Q)=>!!Q.objectMode,$6=(Q)=>!Q.objectMode&&!!Q.encoding&&Q.encoding!=="buffer";class e extends z5{[M]=!1;[B2]=!1;[T]=[];[I]=[];[R];[f];[h];[V2];[l]=!1;[p]=!1;[N2]=!1;[D2]=!1;[k2]=null;[x]=0;[L]=!1;[C2];[y2]=!1;[r]=0;[N]=!1;writable=!0;readable=!0;constructor(...Q){let X=Q[0]||{};super();if(X.objectMode&&typeof X.encoding==="string")throw TypeError("Encoding and objectMode may not be used together");if(V6(X))this[R]=!0,this[f]=null;else if($6(X))this[f]=X.encoding,this[R]=!1;else this[R]=!1,this[f]=null;if(this[h]=!!X.async,this[V2]=this[f]?new sQ(this[f]):null,X&&X.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[I]});if(X&&X.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[T]});let{signal:Z}=X;if(Z)if(this[C2]=Z,Z.aborted)this[W5]();else Z.addEventListener("abort",()=>this[W5]())}get bufferLength(){return this[x]}get encoding(){return this[f]}set encoding(Q){throw Error("Encoding must be set at instantiation time")}setEncoding(Q){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[R]}set objectMode(Q){throw Error("objectMode must be set at instantiation time")}get["async"](){return this[h]}set["async"](Q){this[h]=this[h]||!!Q}[W5](){this[y2]=!0,this.emit("abort",this[C2]?.reason),this.destroy(this[C2]?.reason)}get aborted(){return this[y2]}set aborted(Q){}write(Q,X,Z){if(this[y2])return!1;if(this[l])throw Error("write after end");if(this[L])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof X==="function")Z=X,X="utf8";if(!X)X="utf8";let q=this[h]?v2:Q6;if(!this[R]&&!Buffer.isBuffer(Q)){if(q6(Q))Q=Buffer.from(Q.buffer,Q.byteOffset,Q.byteLength);else if(Z6(Q))Q=Buffer.from(Q);else if(typeof Q!=="string")throw Error("Non-contiguous data written to non-objectMode stream")}if(this[R]){if(this[M]&&this[x]!==0)this[S2](!0);if(this[M])this.emit("data",Q);else this[J5](Q);if(this[x]!==0)this.emit("readable");if(Z)q(Z);return this[M]}if(!Q.length){if(this[x]!==0)this.emit("readable");if(Z)q(Z);return this[M]}if(typeof Q==="string"&&!(X===this[f]&&!this[V2]?.lastNeed))Q=Buffer.from(Q,X);if(Buffer.isBuffer(Q)&&this[f])Q=this[V2].write(Q);if(this[M]&&this[x]!==0)this[S2](!0);if(this[M])this.emit("data",Q);else this[J5](Q);if(this[x]!==0)this.emit("readable");if(Z)q(Z);return this[M]}read(Q){if(this[L])return null;if(this[N]=!1,this[x]===0||Q===0||Q&&Q>this[x])return this[n](),null;if(this[R])Q=null;if(this[I].length>1&&!this[R])this[I]=[this[f]?this[I].join(""):Buffer.concat(this[I],this[x])];let X=this[r5](Q||null,this[I][0]);return this[n](),X}[r5](Q,X){if(this[R])this[P2]();else{let Z=X;if(Q===Z.length||Q===null)this[P2]();else if(typeof Z==="string")this[I][0]=Z.slice(Q),X=Z.slice(0,Q),this[x]-=Q;else this[I][0]=Z.subarray(Q),X=Z.subarray(0,Q),this[x]-=Q}if(this.emit("data",X),!this[I].length&&!this[l])this.emit("drain");return X}end(Q,X,Z){if(typeof Q==="function")Z=Q,Q=void 0;if(typeof X==="function")Z=X,X="utf8";if(Q!==void 0)this.write(Q,X);if(Z)this.once("end",Z);if(this[l]=!0,this.writable=!1,this[M]||!this[B2])this[n]();return this}[$2](){if(this[L])return;if(!this[r]&&!this[T].length)this[N]=!0;if(this[B2]=!1,this[M]=!0,this.emit("resume"),this[I].length)this[S2]();else if(this[l])this[n]();else this.emit("drain")}resume(){return this[$2]()}pause(){this[M]=!1,this[B2]=!0,this[N]=!1}get destroyed(){return this[L]}get flowing(){return this[M]}get paused(){return this[B2]}[J5](Q){if(this[R])this[x]+=1;else this[x]+=Q.length;this[I].push(Q)}[P2](){if(this[R])this[x]-=1;else this[x]-=this[I][0].length;return this[I].shift()}[S2](Q=!1){do;while(this[e5](this[P2]())&&this[I].length);if(!Q&&!this[I].length&&!this[l])this.emit("drain")}[e5](Q){return this.emit("data",Q),this[M]}pipe(Q,X){if(this[L])return Q;this[N]=!1;let Z=this[p];if(X=X||{},Q===s5.stdout||Q===s5.stderr)X.end=!1;else X.end=X.end!==!1;if(X.proxyErrors=!!X.proxyErrors,Z){if(X.end)Q.end()}else if(this[T].push(!X.proxyErrors?new j5(this,Q,X):new X1(this,Q,X)),this[h])v2(()=>this[$2]());else this[$2]();return Q}unpipe(Q){let X=this[T].find((Z)=>Z.dest===Q);if(X){if(this[T].length===1){if(this[M]&&this[r]===0)this[M]=!1;this[T]=[]}else this[T].splice(this[T].indexOf(X),1);X.unpipe()}}addListener(Q,X){return this.on(Q,X)}on(Q,X){let Z=super.on(Q,X);if(Q==="data"){if(this[N]=!1,this[r]++,!this[T].length&&!this[M])this[$2]()}else if(Q==="readable"&&this[x]!==0)super.emit("readable");else if(X6(Q)&&this[p])super.emit(Q),this.removeAllListeners(Q);else if(Q==="error"&&this[k2]){let q=X;if(this[h])v2(()=>q.call(this,this[k2]));else q.call(this,this[k2])}return Z}removeListener(Q,X){return this.off(Q,X)}off(Q,X){let Z=super.off(Q,X);if(Q==="data"){if(this[r]=this.listeners("data").length,this[r]===0&&!this[N]&&!this[T].length)this[M]=!1}return Z}removeAllListeners(Q){let X=super.removeAllListeners(Q);if(Q==="data"||Q===void 0){if(this[r]=0,!this[N]&&!this[T].length)this[M]=!1}return X}get emittedEnd(){return this[p]}[n](){if(!this[N2]&&!this[p]&&!this[L]&&this[I].length===0&&this[l]){if(this[N2]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[D2])this.emit("close");this[N2]=!1}}emit(Q,...X){let Z=X[0];if(Q!=="error"&&Q!=="close"&&Q!==L&&this[L])return!1;else if(Q==="data")return!this[R]&&!Z?!1:this[h]?(v2(()=>this[Y5](Z)),!0):this[Y5](Z);else if(Q==="end")return this[t5]();else if(Q==="close"){if(this[D2]=!0,!this[p]&&!this[L])return!1;let V=super.emit("close");return this.removeAllListeners("close"),V}else if(Q==="error"){this[k2]=Z,super.emit(K5,Z);let V=!this[C2]||this.listeners("error").length?super.emit("error",Z):!1;return this[n](),V}else if(Q==="resume"){let V=super.emit("resume");return this[n](),V}else if(Q==="finish"||Q==="prefinish"){let V=super.emit(Q);return this.removeAllListeners(Q),V}let q=super.emit(Q,...X);return this[n](),q}[Y5](Q){for(let Z of this[T])if(Z.dest.write(Q)===!1)this.pause();let X=this[N]?!1:super.emit("data",Q);return this[n](),X}[t5](){if(this[p])return!1;return this[p]=!0,this.readable=!1,this[h]?(v2(()=>this[H5]()),!0):this[H5]()}[H5](){if(this[V2]){let X=this[V2].end();if(X){for(let Z of this[T])Z.dest.write(X);if(!this[N])super.emit("data",X)}}for(let X of this[T])X.end();let Q=super.emit("end");return this.removeAllListeners("end"),Q}async collect(){let Q=Object.assign([],{dataLength:0});if(!this[R])Q.dataLength=0;let X=this.promise();return this.on("data",(Z)=>{if(Q.push(Z),!this[R])Q.dataLength+=Z.length}),await X,Q}async concat(){if(this[R])throw Error("cannot concat in objectMode");let Q=await this.collect();return this[f]?Q.join(""):Buffer.concat(Q,Q.dataLength)}async promise(){return new Promise((Q,X)=>{this.on(L,()=>X(Error("stream destroyed"))),this.on("error",(Z)=>X(Z)),this.on("end",()=>Q())})}[Symbol.asyncIterator](){this[N]=!1;let Q=!1,X=async()=>{return this.pause(),Q=!0,{value:void 0,done:!0}};return{next:()=>{if(Q)return X();let q=this.read();if(q!==null)return Promise.resolve({done:!1,value:q});if(this[l])return X();let V,$,J=(z)=>{this.off("data",K),this.off("end",Y),this.off(L,H),X(),$(z)},K=(z)=>{this.off("error",J),this.off("end",Y),this.off(L,H),this.pause(),V({value:z,done:!!this[l]})},Y=()=>{this.off("error",J),this.off("data",K),this.off(L,H),X(),V({done:!0,value:void 0})},H=()=>J(Error("stream destroyed"));return new Promise((z,W)=>{$=W,V=z,this.once(L,H),this.once("error",J),this.once("end",Y),this.once("data",K)})},throw:X,return:X,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[N]=!1;let Q=!1,X=()=>{return this.pause(),this.off(K5,X),this.off(L,X),this.off("end",X),Q=!0,{done:!0,value:void 0}},Z=()=>{if(Q)return X();let q=this.read();return q===null?X():{done:!1,value:q}};return this.once("end",X),this.once(K5,X),this.once(L,X),{next:Z,throw:X,return:X,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(Q){if(this[L]){if(Q)this.emit("error",Q);else this.emit(L);return this}this[L]=!0,this[N]=!0,this[I].length=0,this[x]=0;let X=this;if(typeof X.close==="function"&&!this[D2])X.close();if(Q)this.emit("error",Q);else this.emit(L);return this}static get isStream(){return rQ}}var G6=j6.native,A2={lstatSync:Y6,readdir:H6,readdirSync:W6,readlinkSync:z6,realpathSync:G6,promises:{lstat:k6,readdir:B6,readlink:C6,realpath:v6}},J1=(Q)=>!Q||Q===A2||Q===U6?A2:{...A2,...Q,promises:{...A2.promises,...Q.promises||{}}},K1=/^\\\\\?\\([a-z]:)\\?$/i,w6=(Q)=>Q.replace(/\//g,"\\").replace(K1,"$1\\"),A6=/[\\\/]/,y=0,Y1=1,H1=2,g=4,W1=6,z1=8,t=10,j1=12,P=15,w2=~P,U5=16,Z1=32,_2=64,E=128,b2=256,E2=512,q1=_2|E|E2,_6=1023,G5=(Q)=>Q.isFile()?z1:Q.isDirectory()?g:Q.isSymbolicLink()?t:Q.isCharacterDevice()?H1:Q.isBlockDevice()?W1:Q.isSocket()?j1:Q.isFIFO()?Y1:y,V1=new G2({max:4096}),L2=(Q)=>{let X=V1.get(Q);if(X)return X;let Z=Q.normalize("NFKD");return V1.set(Q,Z),Z},$1=new G2({max:4096}),f2=(Q)=>{let X=$1.get(Q);if(X)return X;let Z=L2(Q.toLowerCase());return $1.set(Q,Z),Z};class B5 extends G2{constructor(){super({max:256})}}class U1 extends G2{constructor(Q=16384){super({maxSize:Q,sizeCalculation:(X)=>X.length+1})}}var G1=Symbol("PathScurry setAsCwd");class m{name;root;roots;parent;nocase;isCWD=!1;#Q;#Z;get dev(){return this.#Z}#$;get mode(){return this.#$}#V;get nlink(){return this.#V}#J;get uid(){return this.#J}#A;get gid(){return this.#A}#C;get rdev(){return this.#C}#W;get blksize(){return this.#W}#K;get ino(){return this.#K}#j;get size(){return this.#j}#z;get blocks(){return this.#z}#Y;get atimeMs(){return this.#Y}#q;get mtimeMs(){return this.#q}#U;get ctimeMs(){return this.#U}#_;get birthtimeMs(){return this.#_}#w;get atime(){return this.#w}#G;get mtime(){return this.#G}#R;get ctime(){return this.#R}#k;get birthtime(){return this.#k}#I;#x;#B;#v;#L;#O;#X;#S;#N;#u;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(Q,X=y,Z,q,V,$,J){if(this.name=Q,this.#I=V?f2(Q):L2(Q),this.#X=X&_6,this.nocase=V,this.roots=q,this.root=Z||this,this.#S=$,this.#B=J.fullpath,this.#L=J.relative,this.#O=J.relativePosix,this.parent=J.parent,this.parent)this.#Q=this.parent.#Q;else this.#Q=J1(J.fs)}depth(){if(this.#x!==void 0)return this.#x;if(!this.parent)return this.#x=0;return this.#x=this.parent.depth()+1}childrenCache(){return this.#S}resolve(Q){if(!Q)return this;let X=this.getRootString(Q),q=Q.substring(X.length).split(this.splitSep);return X?this.getRoot(X).#D(q):this.#D(q)}#D(Q){let X=this;for(let Z of Q)X=X.child(Z);return X}children(){let Q=this.#S.get(this);if(Q)return Q;let X=Object.assign([],{provisional:0});return this.#S.set(this,X),this.#X&=~U5,X}child(Q,X){if(Q===""||Q===".")return this;if(Q==="..")return this.parent||this;let Z=this.children(),q=this.nocase?f2(Q):L2(Q);for(let K of Z)if(K.#I===q)return K;let V=this.parent?this.sep:"",$=this.#B?this.#B+V+Q:void 0,J=this.newChild(Q,y,{...X,parent:this,fullpath:$});if(!this.canReaddir())J.#X|=E;return Z.push(J),J}relative(){if(this.isCWD)return"";if(this.#L!==void 0)return this.#L;let Q=this.name,X=this.parent;if(!X)return this.#L=this.name;let Z=X.relative();return Z+(!Z||!X.parent?"":this.sep)+Q}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#O!==void 0)return this.#O;let Q=this.name,X=this.parent;if(!X)return this.#O=this.fullpathPosix();let Z=X.relativePosix();return Z+(!Z||!X.parent?"":"/")+Q}fullpath(){if(this.#B!==void 0)return this.#B;let Q=this.name,X=this.parent;if(!X)return this.#B=this.name;let q=X.fullpath()+(!X.parent?"":this.sep)+Q;return this.#B=q}fullpathPosix(){if(this.#v!==void 0)return this.#v;if(this.sep==="/")return this.#v=this.fullpath();if(!this.parent){let q=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(q))return this.#v=`//?/${q}`;else return this.#v=q}let Q=this.parent,X=Q.fullpathPosix(),Z=X+(!X||!Q.parent?"":"/")+this.name;return this.#v=Z}isUnknown(){return(this.#X&P)===y}isType(Q){return this[`is${Q}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#X&P)===z1}isDirectory(){return(this.#X&P)===g}isCharacterDevice(){return(this.#X&P)===H1}isBlockDevice(){return(this.#X&P)===W1}isFIFO(){return(this.#X&P)===Y1}isSocket(){return(this.#X&P)===j1}isSymbolicLink(){return(this.#X&t)===t}lstatCached(){return this.#X&Z1?this:void 0}readlinkCached(){return this.#N}realpathCached(){return this.#u}readdirCached(){let Q=this.children();return Q.slice(0,Q.provisional)}canReadlink(){if(this.#N)return!0;if(!this.parent)return!1;let Q=this.#X&P;return!(Q!==y&&Q!==t||this.#X&b2||this.#X&E)}calledReaddir(){return!!(this.#X&U5)}isENOENT(){return!!(this.#X&E)}isNamed(Q){return!this.nocase?this.#I===L2(Q):this.#I===f2(Q)}async readlink(){let Q=this.#N;if(Q)return Q;if(!this.canReadlink())return;if(!this.parent)return;try{let X=await this.#Q.promises.readlink(this.fullpath()),Z=(await this.parent.realpath())?.resolve(X);if(Z)return this.#N=Z}catch(X){this.#m(X.code);return}}readlinkSync(){let Q=this.#N;if(Q)return Q;if(!this.canReadlink())return;if(!this.parent)return;try{let X=this.#Q.readlinkSync(this.fullpath()),Z=this.parent.realpathSync()?.resolve(X);if(Z)return this.#N=Z}catch(X){this.#m(X.code);return}}#f(Q){this.#X|=U5;for(let X=Q.provisional;X<Q.length;X++){let Z=Q[X];if(Z)Z.#M()}}#M(){if(this.#X&E)return;this.#X=(this.#X|E)&w2,this.#l()}#l(){let Q=this.children();Q.provisional=0;for(let X of Q)X.#M()}#b(){this.#X|=E2,this.#P()}#P(){if(this.#X&_2)return;let Q=this.#X;if((Q&P)===g)Q&=w2;this.#X=Q|_2,this.#l()}#E(Q=""){if(Q==="ENOTDIR"||Q==="EPERM")this.#P();else if(Q==="ENOENT")this.#M();else this.children().provisional=0}#T(Q=""){if(Q==="ENOTDIR")this.parent.#P();else if(Q==="ENOENT")this.#M()}#m(Q=""){let X=this.#X;if(X|=b2,Q==="ENOENT")X|=E;if(Q==="EINVAL"||Q==="UNKNOWN")X&=w2;if(this.#X=X,Q==="ENOTDIR"&&this.parent)this.parent.#P()}#h(Q,X){return this.#d(Q,X)||this.#g(Q,X)}#g(Q,X){let Z=G5(Q),q=this.newChild(Q.name,Z,{parent:this}),V=q.#X&P;if(V!==g&&V!==t&&V!==y)q.#X|=_2;return X.unshift(q),X.provisional++,q}#d(Q,X){for(let Z=X.provisional;Z<X.length;Z++){let q=X[Z];if((this.nocase?f2(Q.name):L2(Q.name))!==q.#I)continue;return this.#H(Q,q,Z,X)}}#H(Q,X,Z,q){let V=X.name;if(X.#X=X.#X&w2|G5(Q),V!==Q.name)X.name=Q.name;if(Z!==q.provisional){if(Z===q.length-1)q.pop();else q.splice(Z,1);q.unshift(X)}return q.provisional++,X}async lstat(){if((this.#X&E)===0)try{return this.#c(await this.#Q.promises.lstat(this.fullpath())),this}catch(Q){this.#T(Q.code)}}lstatSync(){if((this.#X&E)===0)try{return this.#c(this.#Q.lstatSync(this.fullpath())),this}catch(Q){this.#T(Q.code)}}#c(Q){let{atime:X,atimeMs:Z,birthtime:q,birthtimeMs:V,blksize:$,blocks:J,ctime:K,ctimeMs:Y,dev:H,gid:z,ino:W,mode:j,mtime:U,mtimeMs:k,nlink:G,rdev:v,size:B,uid:C}=Q;this.#w=X,this.#Y=Z,this.#k=q,this.#_=V,this.#W=$,this.#z=J,this.#R=K,this.#U=Y,this.#Z=H,this.#A=z,this.#K=W,this.#$=j,this.#G=U,this.#q=k,this.#V=G,this.#C=v,this.#j=B,this.#J=C;let A=G5(Q);if(this.#X=this.#X&w2|A|Z1,A!==y&&A!==g&&A!==t)this.#X|=_2}#y=[];#F=!1;#n(Q){this.#F=!1;let X=this.#y.slice();this.#y.length=0,X.forEach((Z)=>Z(null,Q))}readdirCB(Q,X=!1){if(!this.canReaddir()){if(X)Q(null,[]);else queueMicrotask(()=>Q(null,[]));return}let Z=this.children();if(this.calledReaddir()){let V=Z.slice(0,Z.provisional);if(X)Q(null,V);else queueMicrotask(()=>Q(null,V));return}if(this.#y.push(Q),this.#F)return;this.#F=!0;let q=this.fullpath();this.#Q.readdir(q,{withFileTypes:!0},(V,$)=>{if(V)this.#E(V.code),Z.provisional=0;else{for(let J of $)this.#h(J,Z);this.#f(Z)}this.#n(Z.slice(0,Z.provisional));return})}#i;async readdir(){if(!this.canReaddir())return[];let Q=this.children();if(this.calledReaddir())return Q.slice(0,Q.provisional);let X=this.fullpath();if(this.#i)await this.#i;else{let Z=()=>{};this.#i=new Promise((q)=>Z=q);try{for(let q of await this.#Q.promises.readdir(X,{withFileTypes:!0}))this.#h(q,Q);this.#f(Q)}catch(q){this.#E(q.code),Q.provisional=0}this.#i=void 0,Z()}return Q.slice(0,Q.provisional)}readdirSync(){if(!this.canReaddir())return[];let Q=this.children();if(this.calledReaddir())return Q.slice(0,Q.provisional);let X=this.fullpath();try{for(let Z of this.#Q.readdirSync(X,{withFileTypes:!0}))this.#h(Z,Q);this.#f(Q)}catch(Z){this.#E(Z.code),Q.provisional=0}return Q.slice(0,Q.provisional)}canReaddir(){if(this.#X&q1)return!1;let Q=P&this.#X;if(!(Q===y||Q===g||Q===t))return!1;return!0}shouldWalk(Q,X){return(this.#X&g)===g&&!(this.#X&q1)&&!Q.has(this)&&(!X||X(this))}async realpath(){if(this.#u)return this.#u;if((E2|b2|E)&this.#X)return;try{let Q=await this.#Q.promises.realpath(this.fullpath());return this.#u=this.resolve(Q)}catch(Q){this.#b()}}realpathSync(){if(this.#u)return this.#u;if((E2|b2|E)&this.#X)return;try{let Q=this.#Q.realpathSync(this.fullpath());return this.#u=this.resolve(Q)}catch(Q){this.#b()}}[G1](Q){if(Q===this)return;Q.isCWD=!1,this.isCWD=!0;let X=new Set([]),Z=[],q=this;while(q&&q.parent)X.add(q),q.#L=Z.join(this.sep),q.#O=Z.join("/"),q=q.parent,Z.push("..");q=Q;while(q&&q.parent&&!X.has(q))q.#L=void 0,q.#O=void 0,q=q.parent}}class h2 extends m{sep="\\";splitSep=A6;constructor(Q,X=y,Z,q,V,$,J){super(Q,X,Z,q,V,$,J)}newChild(Q,X=y,Z={}){return new h2(Q,X,this.root,this.roots,this.nocase,this.childrenCache(),Z)}getRootString(Q){return k5.parse(Q).root}getRoot(Q){if(Q=w6(Q.toUpperCase()),Q===this.root.name)return this.root;for(let[X,Z]of Object.entries(this.roots))if(this.sameRoot(Q,X))return this.roots[Q]=Z;return this.roots[Q]=new M2(Q,this).root}sameRoot(Q,X=this.root.name){return Q=Q.toUpperCase().replace(/\//g,"\\").replace(K1,"$1\\"),Q===X}}class g2 extends m{splitSep="/";sep="/";constructor(Q,X=y,Z,q,V,$,J){super(Q,X,Z,q,V,$,J)}getRootString(Q){return Q.startsWith("/")?"/":""}getRoot(Q){return this.root}newChild(Q,X=y,Z={}){return new g2(Q,X,this.root,this.roots,this.nocase,this.childrenCache(),Z)}}class C5{root;rootPath;roots;cwd;#Q;#Z;#$;nocase;#V;constructor(Q=process.cwd(),X,Z,{nocase:q,childrenCacheSize:V=16384,fs:$=A2}={}){if(this.#V=J1($),Q instanceof URL||Q.startsWith("file://"))Q=K6(Q);let J=X.resolve(Q);this.roots=Object.create(null),this.rootPath=this.parseRootPath(J),this.#Q=new B5,this.#Z=new B5,this.#$=new U1(V);let K=J.substring(this.rootPath.length).split(Z);if(K.length===1&&!K[0])K.pop();if(q===void 0)throw TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=q,this.root=this.newRoot(this.#V),this.roots[this.rootPath]=this.root;let Y=this.root,H=K.length-1,z=X.sep,W=this.rootPath,j=!1;for(let U of K){let k=H--;Y=Y.child(U,{relative:Array(k).fill("..").join(z),relativePosix:Array(k).fill("..").join("/"),fullpath:W+=(j?"":z)+U}),j=!0}this.cwd=Y}depth(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return Q.depth()}childrenCache(){return this.#$}resolve(...Q){let X="";for(let V=Q.length-1;V>=0;V--){let $=Q[V];if(!$||$===".")continue;if(X=X?`${$}/${X}`:$,this.isAbsolute($))break}let Z=this.#Q.get(X);if(Z!==void 0)return Z;let q=this.cwd.resolve(X).fullpath();return this.#Q.set(X,q),q}resolvePosix(...Q){let X="";for(let V=Q.length-1;V>=0;V--){let $=Q[V];if(!$||$===".")continue;if(X=X?`${$}/${X}`:$,this.isAbsolute($))break}let Z=this.#Z.get(X);if(Z!==void 0)return Z;let q=this.cwd.resolve(X).fullpathPosix();return this.#Z.set(X,q),q}relative(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return Q.relative()}relativePosix(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return Q.relativePosix()}basename(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return Q.name}dirname(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return(Q.parent||Q).fullpath()}async readdir(Q=this.cwd,X={withFileTypes:!0}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof m))X=Q,Q=this.cwd;let{withFileTypes:Z}=X;if(!Q.canReaddir())return[];else{let q=await Q.readdir();return Z?q:q.map((V)=>V.name)}}readdirSync(Q=this.cwd,X={withFileTypes:!0}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof m))X=Q,Q=this.cwd;let{withFileTypes:Z=!0}=X;if(!Q.canReaddir())return[];else if(Z)return Q.readdirSync();else return Q.readdirSync().map((q)=>q.name)}async lstat(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return Q.lstat()}lstatSync(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return Q.lstatSync()}async readlink(Q=this.cwd,{withFileTypes:X}={withFileTypes:!1}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof m))X=Q.withFileTypes,Q=this.cwd;let Z=await Q.readlink();return X?Z:Z?.fullpath()}readlinkSync(Q=this.cwd,{withFileTypes:X}={withFileTypes:!1}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof m))X=Q.withFileTypes,Q=this.cwd;let Z=Q.readlinkSync();return X?Z:Z?.fullpath()}async realpath(Q=this.cwd,{withFileTypes:X}={withFileTypes:!1}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof m))X=Q.withFileTypes,Q=this.cwd;let Z=await Q.realpath();return X?Z:Z?.fullpath()}realpathSync(Q=this.cwd,{withFileTypes:X}={withFileTypes:!1}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof m))X=Q.withFileTypes,Q=this.cwd;let Z=Q.realpathSync();return X?Z:Z?.fullpath()}async walk(Q=this.cwd,X={}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof m))X=Q,Q=this.cwd;let{withFileTypes:Z=!0,follow:q=!1,filter:V,walkFilter:$}=X,J=[];if(!V||V(Q))J.push(Z?Q:Q.fullpath());let K=new Set,Y=(z,W)=>{K.add(z),z.readdirCB((j,U)=>{if(j)return W(j);let k=U.length;if(!k)return W();let G=()=>{if(--k===0)W()};for(let v of U){if(!V||V(v))J.push(Z?v:v.fullpath());if(q&&v.isSymbolicLink())v.realpath().then((B)=>B?.isUnknown()?B.lstat():B).then((B)=>B?.shouldWalk(K,$)?Y(B,G):G());else if(v.shouldWalk(K,$))Y(v,G);else G()}},!0)},H=Q;return new Promise((z,W)=>{Y(H,(j)=>{if(j)return W(j);z(J)})})}walkSync(Q=this.cwd,X={}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof m))X=Q,Q=this.cwd;let{withFileTypes:Z=!0,follow:q=!1,filter:V,walkFilter:$}=X,J=[];if(!V||V(Q))J.push(Z?Q:Q.fullpath());let K=new Set([Q]);for(let Y of K){let H=Y.readdirSync();for(let z of H){if(!V||V(z))J.push(Z?z:z.fullpath());let W=z;if(z.isSymbolicLink()){if(!(q&&(W=z.realpathSync())))continue;if(W.isUnknown())W.lstatSync()}if(W.shouldWalk(K,$))K.add(W)}}return J}[Symbol.asyncIterator](){return this.iterate()}iterate(Q=this.cwd,X={}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof m))X=Q,Q=this.cwd;return this.stream(Q,X)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(Q=this.cwd,X={}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof m))X=Q,Q=this.cwd;let{withFileTypes:Z=!0,follow:q=!1,filter:V,walkFilter:$}=X;if(!V||V(Q))yield Z?Q:Q.fullpath();let J=new Set([Q]);for(let K of J){let Y=K.readdirSync();for(let H of Y){if(!V||V(H))yield Z?H:H.fullpath();let z=H;if(H.isSymbolicLink()){if(!(q&&(z=H.realpathSync())))continue;if(z.isUnknown())z.lstatSync()}if(z.shouldWalk(J,$))J.add(z)}}}stream(Q=this.cwd,X={}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof m))X=Q,Q=this.cwd;let{withFileTypes:Z=!0,follow:q=!1,filter:V,walkFilter:$}=X,J=new e({objectMode:!0});if(!V||V(Q))J.write(Z?Q:Q.fullpath());let K=new Set,Y=[Q],H=0,z=()=>{let W=!1;while(!W){let j=Y.shift();if(!j){if(H===0)J.end();return}H++,K.add(j);let U=(G,v,B=!1)=>{if(G)return J.emit("error",G);if(q&&!B){let C=[];for(let A of v)if(A.isSymbolicLink())C.push(A.realpath().then((_)=>_?.isUnknown()?_.lstat():_));if(C.length){Promise.all(C).then(()=>U(null,v,!0));return}}for(let C of v)if(C&&(!V||V(C))){if(!J.write(Z?C:C.fullpath()))W=!0}H--;for(let C of v){let A=C.realpathCached()||C;if(A.shouldWalk(K,$))Y.push(A)}if(W&&!J.flowing)J.once("drain",z);else if(!k)z()},k=!0;j.readdirCB(U,!0),k=!1}};return z(),J}streamSync(Q=this.cwd,X={}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof m))X=Q,Q=this.cwd;let{withFileTypes:Z=!0,follow:q=!1,filter:V,walkFilter:$}=X,J=new e({objectMode:!0}),K=new Set;if(!V||V(Q))J.write(Z?Q:Q.fullpath());let Y=[Q],H=0,z=()=>{let W=!1;while(!W){let j=Y.shift();if(!j){if(H===0)J.end();return}H++,K.add(j);let U=j.readdirSync();for(let k of U)if(!V||V(k)){if(!J.write(Z?k:k.fullpath()))W=!0}H--;for(let k of U){let G=k;if(k.isSymbolicLink()){if(!(q&&(G=k.realpathSync())))continue;if(G.isUnknown())G.lstatSync()}if(G.shouldWalk(K,$))Y.push(G)}}if(W&&!J.flowing)J.once("drain",z)};return z(),J}chdir(Q=this.cwd){let X=this.cwd;this.cwd=typeof Q==="string"?this.cwd.resolve(Q):Q,this.cwd[G1](X)}}class M2 extends C5{sep="\\";constructor(Q=process.cwd(),X={}){let{nocase:Z=!0}=X;super(Q,k5,"\\",{...X,nocase:Z});this.nocase=Z;for(let q=this.cwd;q;q=q.parent)q.nocase=this.nocase}parseRootPath(Q){return k5.parse(Q).root.toUpperCase()}newRoot(Q){return new h2(this.rootPath,g,void 0,this.roots,this.nocase,this.childrenCache(),{fs:Q})}isAbsolute(Q){return Q.startsWith("/")||Q.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(Q)}}class I2 extends C5{sep="/";constructor(Q=process.cwd(),X={}){let{nocase:Z=!1}=X;super(Q,J6,"/",{...X,nocase:Z});this.nocase=Z}parseRootPath(Q){return"/"}newRoot(Q){return new g2(this.rootPath,g,void 0,this.roots,this.nocase,this.childrenCache(),{fs:Q})}isAbsolute(Q){return Q.startsWith("/")}}class d2 extends I2{constructor(Q=process.cwd(),X={}){let{nocase:Z=!0}=X;super(Q,{...X,nocase:Z})}}var X7=process.platform==="win32"?h2:g2,k1=process.platform==="win32"?M2:process.platform==="darwin"?d2:I2;var L6=(Q)=>Q.length>=1,M6=(Q)=>Q.length>=1;class J2{#Q;#Z;#$;length;#V;#J;#A;#C;#W;#K;#j=!0;constructor(Q,X,Z,q){if(!L6(Q))throw TypeError("empty pattern list");if(!M6(X))throw TypeError("empty glob list");if(X.length!==Q.length)throw TypeError("mismatched pattern list and glob list lengths");if(this.length=Q.length,Z<0||Z>=this.length)throw TypeError("index out of range");if(this.#Q=Q,this.#Z=X,this.#$=Z,this.#V=q,this.#$===0){if(this.isUNC()){let[V,$,J,K,...Y]=this.#Q,[H,z,W,j,...U]=this.#Z;if(Y[0]==="")Y.shift(),U.shift();let k=[V,$,J,K,""].join("/"),G=[H,z,W,j,""].join("/");this.#Q=[k,...Y],this.#Z=[G,...U],this.length=this.#Q.length}else if(this.isDrive()||this.isAbsolute()){let[V,...$]=this.#Q,[J,...K]=this.#Z;if($[0]==="")$.shift(),K.shift();let Y=V+"/",H=J+"/";this.#Q=[Y,...$],this.#Z=[H,...K],this.length=this.#Q.length}}}pattern(){return this.#Q[this.#$]}isString(){return typeof this.#Q[this.#$]==="string"}isGlobstar(){return this.#Q[this.#$]===u}isRegExp(){return this.#Q[this.#$]instanceof RegExp}globString(){return this.#A=this.#A||(this.#$===0?this.isAbsolute()?this.#Z[0]+this.#Z.slice(1).join("/"):this.#Z.join("/"):this.#Z.slice(this.#$).join("/"))}hasMore(){return this.length>this.#$+1}rest(){if(this.#J!==void 0)return this.#J;if(!this.hasMore())return this.#J=null;return this.#J=new J2(this.#Q,this.#Z,this.#$+1,this.#V),this.#J.#K=this.#K,this.#J.#W=this.#W,this.#J.#C=this.#C,this.#J}isUNC(){let Q=this.#Q;return this.#W!==void 0?this.#W:this.#W=this.#V==="win32"&&this.#$===0&&Q[0]===""&&Q[1]===""&&typeof Q[2]==="string"&&!!Q[2]&&typeof Q[3]==="string"&&!!Q[3]}isDrive(){let Q=this.#Q;return this.#C!==void 0?this.#C:this.#C=this.#V==="win32"&&this.#$===0&&this.length>1&&typeof Q[0]==="string"&&/^[a-z]:$/i.test(Q[0])}isAbsolute(){let Q=this.#Q;return this.#K!==void 0?this.#K:this.#K=Q[0]===""&&Q.length>1||this.isDrive()||this.isUNC()}root(){let Q=this.#Q[0];return typeof Q==="string"&&this.isAbsolute()&&this.#$===0?Q:""}checkFollowGlobstar(){return!(this.#$===0||!this.isGlobstar()||!this.#j)}markFollowGlobstar(){if(this.#$===0||!this.isGlobstar()||!this.#j)return!1;return this.#j=!1,!0}}var I6=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class x2{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(Q,{nobrace:X,nocase:Z,noext:q,noglobstar:V,platform:$=I6}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=$,this.mmopts={dot:!0,nobrace:X,nocase:Z,noext:q,noglobstar:V,optimizationLevel:2,platform:$,nocomment:!0,nonegate:!0};for(let J of Q)this.add(J)}add(Q){let X=new S(Q,this.mmopts);for(let Z=0;Z<X.set.length;Z++){let q=X.set[Z],V=X.globParts[Z];if(!q||!V)throw Error("invalid pattern object");while(q[0]==="."&&V[0]===".")q.shift(),V.shift();let $=new J2(q,V,0,this.platform),J=new S($.globString(),this.mmopts),K=V[V.length-1]==="**",Y=$.isAbsolute();if(Y)this.absolute.push(J);else this.relative.push(J);if(K)if(Y)this.absoluteChildren.push(J);else this.relativeChildren.push(J)}}ignored(Q){let X=Q.fullpath(),Z=`${X}/`,q=Q.relative()||".",V=`${q}/`;for(let $ of this.relative)if($.match(q)||$.match(V))return!0;for(let $ of this.absolute)if($.match(X)||$.match(Z))return!0;return!1}childrenIgnored(Q){let X=Q.fullpath()+"/",Z=(Q.relative()||".")+"/";for(let q of this.relativeChildren)if(q.match(Z))return!0;for(let q of this.absoluteChildren)if(q.match(X))return!0;return!1}}class v5{store;constructor(Q=new Map){this.store=Q}copy(){return new v5(new Map(this.store))}hasWalked(Q,X){return this.store.get(Q.fullpath())?.has(X.globString())}storeWalked(Q,X){let Z=Q.fullpath(),q=this.store.get(Z);if(q)q.add(X.globString());else this.store.set(Z,new Set([X.globString()]))}}class B1{store=new Map;add(Q,X,Z){let q=(X?2:0)|(Z?1:0),V=this.store.get(Q);this.store.set(Q,V===void 0?q:q&V)}entries(){return[...this.store.entries()].map(([Q,X])=>[Q,!!(X&2),!!(X&1)])}}class C1{store=new Map;add(Q,X){if(!Q.canReaddir())return;let Z=this.store.get(Q);if(Z){if(!Z.find((q)=>q.globString()===X.globString()))Z.push(X)}else this.store.set(Q,[X])}get(Q){let X=this.store.get(Q);if(!X)throw Error("attempting to walk unknown path");return X}entries(){return this.keys().map((Q)=>[Q,this.store.get(Q)])}keys(){return[...this.store.keys()].filter((Q)=>Q.canReaddir())}}class O2{hasWalkedCache;matches=new B1;subwalks=new C1;patterns;follow;dot;opts;constructor(Q,X){this.opts=Q,this.follow=!!Q.follow,this.dot=!!Q.dot,this.hasWalkedCache=X?X.copy():new v5}processPatterns(Q,X){this.patterns=X;let Z=X.map((q)=>[Q,q]);for(let[q,V]of Z){this.hasWalkedCache.storeWalked(q,V);let $=V.root(),J=V.isAbsolute()&&this.opts.absolute!==!1;if($){q=q.resolve($==="/"&&this.opts.root!==void 0?this.opts.root:$);let z=V.rest();if(!z){this.matches.add(q,!0,!1);continue}else V=z}if(q.isENOENT())continue;let K,Y,H=!1;while(typeof(K=V.pattern())==="string"&&(Y=V.rest()))q=q.resolve(K),V=Y,H=!0;if(K=V.pattern(),Y=V.rest(),H){if(this.hasWalkedCache.hasWalked(q,V))continue;this.hasWalkedCache.storeWalked(q,V)}if(typeof K==="string"){let z=K===".."||K===""||K===".";this.matches.add(q.resolve(K),J,z);continue}else if(K===u){if(!q.isSymbolicLink()||this.follow||V.checkFollowGlobstar())this.subwalks.add(q,V);let z=Y?.pattern(),W=Y?.rest();if(!Y||(z===""||z===".")&&!W)this.matches.add(q,J,z===""||z===".");else if(z===".."){let j=q.parent||q;if(!W)this.matches.add(j,J,!0);else if(!this.hasWalkedCache.hasWalked(j,W))this.subwalks.add(j,W)}}else if(K instanceof RegExp)this.subwalks.add(q,V)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new O2(this.opts,this.hasWalkedCache)}filterEntries(Q,X){let Z=this.subwalks.get(Q),q=this.child();for(let V of X)for(let $ of Z){let J=$.isAbsolute(),K=$.pattern(),Y=$.rest();if(K===u)q.testGlobstar(V,$,Y,J);else if(K instanceof RegExp)q.testRegExp(V,K,Y,J);else q.testString(V,K,Y,J)}return q}testGlobstar(Q,X,Z,q){if(this.dot||!Q.name.startsWith(".")){if(!X.hasMore())this.matches.add(Q,q,!1);if(Q.canReaddir()){if(this.follow||!Q.isSymbolicLink())this.subwalks.add(Q,X);else if(Q.isSymbolicLink()){if(Z&&X.checkFollowGlobstar())this.subwalks.add(Q,Z);else if(X.markFollowGlobstar())this.subwalks.add(Q,X)}}}if(Z){let V=Z.pattern();if(typeof V==="string"&&V!==".."&&V!==""&&V!==".")this.testString(Q,V,Z.rest(),q);else if(V===".."){let $=Q.parent||Q;this.subwalks.add($,Z)}else if(V instanceof RegExp)this.testRegExp(Q,V,Z.rest(),q)}}testRegExp(Q,X,Z,q){if(!X.test(Q.name))return;if(!Z)this.matches.add(Q,q,!1);else this.subwalks.add(Q,Z)}testString(Q,X,Z,q){if(!Q.isNamed(X))return;if(!Z)this.matches.add(Q,q,!1);else this.subwalks.add(Q,Z)}}var x6=(Q,X)=>typeof Q==="string"?new x2([Q],X):Array.isArray(Q)?new x2(Q,X):Q;class w5{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#Q=[];#Z;#$;signal;maxDepth;includeChildMatches;constructor(Q,X,Z){if(this.patterns=Q,this.path=X,this.opts=Z,this.#$=!Z.posix&&Z.platform==="win32"?"\\":"/",this.includeChildMatches=Z.includeChildMatches!==!1,Z.ignore||!this.includeChildMatches){if(this.#Z=x6(Z.ignore??[],Z),!this.includeChildMatches&&typeof this.#Z.add!=="function")throw Error("cannot ignore child matches, ignore lacks add() method.")}if(this.maxDepth=Z.maxDepth||1/0,Z.signal)this.signal=Z.signal,this.signal.addEventListener("abort",()=>{this.#Q.length=0})}#V(Q){return this.seen.has(Q)||!!this.#Z?.ignored?.(Q)}#J(Q){return!!this.#Z?.childrenIgnored?.(Q)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let Q=void 0;while(!this.paused&&(Q=this.#Q.shift()))Q()}onResume(Q){if(this.signal?.aborted)return;if(!this.paused)Q();else this.#Q.push(Q)}async matchCheck(Q,X){if(X&&this.opts.nodir)return;let Z;if(this.opts.realpath){if(Z=Q.realpathCached()||await Q.realpath(),!Z)return;Q=Z}let V=Q.isUnknown()||this.opts.stat?await Q.lstat():Q;if(this.opts.follow&&this.opts.nodir&&V?.isSymbolicLink()){let $=await V.realpath();if($&&($.isUnknown()||this.opts.stat))await $.lstat()}return this.matchCheckTest(V,X)}matchCheckTest(Q,X){return Q&&(this.maxDepth===1/0||Q.depth()<=this.maxDepth)&&(!X||Q.canReaddir())&&(!this.opts.nodir||!Q.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!Q.isSymbolicLink()||!Q.realpathCached()?.isDirectory())&&!this.#V(Q)?Q:void 0}matchCheckSync(Q,X){if(X&&this.opts.nodir)return;let Z;if(this.opts.realpath){if(Z=Q.realpathCached()||Q.realpathSync(),!Z)return;Q=Z}let V=Q.isUnknown()||this.opts.stat?Q.lstatSync():Q;if(this.opts.follow&&this.opts.nodir&&V?.isSymbolicLink()){let $=V.realpathSync();if($&&($?.isUnknown()||this.opts.stat))$.lstatSync()}return this.matchCheckTest(V,X)}matchFinish(Q,X){if(this.#V(Q))return;if(!this.includeChildMatches&&this.#Z?.add){let V=`${Q.relativePosix()}/**`;this.#Z.add(V)}let Z=this.opts.absolute===void 0?X:this.opts.absolute;this.seen.add(Q);let q=this.opts.mark&&Q.isDirectory()?this.#$:"";if(this.opts.withFileTypes)this.matchEmit(Q);else if(Z){let V=this.opts.posix?Q.fullpathPosix():Q.fullpath();this.matchEmit(V+q)}else{let V=this.opts.posix?Q.relativePosix():Q.relative(),$=this.opts.dotRelative&&!V.startsWith(".."+this.#$)?"."+this.#$:"";this.matchEmit(!V?"."+q:$+V+q)}}async match(Q,X,Z){let q=await this.matchCheck(Q,Z);if(q)this.matchFinish(q,X)}matchSync(Q,X,Z){let q=this.matchCheckSync(Q,Z);if(q)this.matchFinish(q,X)}walkCB(Q,X,Z){if(this.signal?.aborted)Z();this.walkCB2(Q,X,new O2(this.opts),Z)}walkCB2(Q,X,Z,q){if(this.#J(Q))return q();if(this.signal?.aborted)q();if(this.paused){this.onResume(()=>this.walkCB2(Q,X,Z,q));return}Z.processPatterns(Q,X);let V=1,$=()=>{if(--V===0)q()};for(let[J,K,Y]of Z.matches.entries()){if(this.#V(J))continue;V++,this.match(J,K,Y).then(()=>$())}for(let J of Z.subwalkTargets()){if(this.maxDepth!==1/0&&J.depth()>=this.maxDepth)continue;V++;let K=J.readdirCached();if(J.calledReaddir())this.walkCB3(J,K,Z,$);else J.readdirCB((Y,H)=>this.walkCB3(J,H,Z,$),!0)}$()}walkCB3(Q,X,Z,q){Z=Z.filterEntries(Q,X);let V=1,$=()=>{if(--V===0)q()};for(let[J,K,Y]of Z.matches.entries()){if(this.#V(J))continue;V++,this.match(J,K,Y).then(()=>$())}for(let[J,K]of Z.subwalks.entries())V++,this.walkCB2(J,K,Z.child(),$);$()}walkCBSync(Q,X,Z){if(this.signal?.aborted)Z();this.walkCB2Sync(Q,X,new O2(this.opts),Z)}walkCB2Sync(Q,X,Z,q){if(this.#J(Q))return q();if(this.signal?.aborted)q();if(this.paused){this.onResume(()=>this.walkCB2Sync(Q,X,Z,q));return}Z.processPatterns(Q,X);let V=1,$=()=>{if(--V===0)q()};for(let[J,K,Y]of Z.matches.entries()){if(this.#V(J))continue;this.matchSync(J,K,Y)}for(let J of Z.subwalkTargets()){if(this.maxDepth!==1/0&&J.depth()>=this.maxDepth)continue;V++;let K=J.readdirSync();this.walkCB3Sync(J,K,Z,$)}$()}walkCB3Sync(Q,X,Z,q){Z=Z.filterEntries(Q,X);let V=1,$=()=>{if(--V===0)q()};for(let[J,K,Y]of Z.matches.entries()){if(this.#V(J))continue;this.matchSync(J,K,Y)}for(let[J,K]of Z.subwalks.entries())V++,this.walkCB2Sync(J,K,Z.child(),$);$()}}class c2 extends w5{matches=new Set;constructor(Q,X,Z){super(Q,X,Z)}matchEmit(Q){this.matches.add(Q)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())await this.path.lstat();return await new Promise((Q,X)=>{this.walkCB(this.path,this.patterns,()=>{if(this.signal?.aborted)X(this.signal.reason);else Q(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}}class l2 extends w5{results;constructor(Q,X,Z){super(Q,X,Z);this.results=new e({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(Q){if(this.results.write(Q),!this.results.flowing)this.pause()}stream(){let Q=this.path;if(Q.isUnknown())Q.lstat().then(()=>{this.walkCB(Q,this.patterns,()=>this.results.end())});else this.walkCB(Q,this.patterns,()=>this.results.end());return this.results}streamSync(){if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}var u6=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class d{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(Q,X){if(!X)throw TypeError("glob options required");if(this.withFileTypes=!!X.withFileTypes,this.signal=X.signal,this.follow=!!X.follow,this.dot=!!X.dot,this.dotRelative=!!X.dotRelative,this.nodir=!!X.nodir,this.mark=!!X.mark,!X.cwd)this.cwd="";else if(X.cwd instanceof URL||X.cwd.startsWith("file://"))X.cwd=O6(X.cwd);if(this.cwd=X.cwd||"",this.root=X.root,this.magicalBraces=!!X.magicalBraces,this.nobrace=!!X.nobrace,this.noext=!!X.noext,this.realpath=!!X.realpath,this.absolute=X.absolute,this.includeChildMatches=X.includeChildMatches!==!1,this.noglobstar=!!X.noglobstar,this.matchBase=!!X.matchBase,this.maxDepth=typeof X.maxDepth==="number"?X.maxDepth:1/0,this.stat=!!X.stat,this.ignore=X.ignore,this.withFileTypes&&this.absolute!==void 0)throw Error("cannot set absolute and withFileTypes:true");if(typeof Q==="string")Q=[Q];if(this.windowsPathsNoEscape=!!X.windowsPathsNoEscape||X.allowWindowsEscape===!1,this.windowsPathsNoEscape)Q=Q.map((K)=>K.replace(/\\/g,"/"));if(this.matchBase){if(X.noglobstar)throw TypeError("base matching requires globstar");Q=Q.map((K)=>K.includes("/")?K:`./**/${K}`)}if(this.pattern=Q,this.platform=X.platform||u6,this.opts={...X,platform:this.platform},X.scurry){if(this.scurry=X.scurry,X.nocase!==void 0&&X.nocase!==X.scurry.nocase)throw Error("nocase option contradicts provided scurry option")}else{let K=X.platform==="win32"?M2:X.platform==="darwin"?d2:X.platform?I2:k1;this.scurry=new K(this.cwd,{nocase:X.nocase,fs:X.fs})}this.nocase=this.scurry.nocase;let Z=this.platform==="darwin"||this.platform==="win32",q={...X,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:Z,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},V=this.pattern.map((K)=>new S(K,q)),[$,J]=V.reduce((K,Y)=>{return K[0].push(...Y.set),K[1].push(...Y.globParts),K},[[],[]]);this.patterns=$.map((K,Y)=>{let H=J[Y];if(!H)throw Error("invalid pattern object");return new J2(K,H,0,this.platform)})}async walk(){return[...await new c2(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new c2(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new l2(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new l2(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}var A5=(Q,X={})=>{if(!Array.isArray(Q))Q=[Q];for(let Z of Q)if(new S(Z,X).hasMagic())return!0;return!1};function i2(Q,X={}){return new d(Q,X).streamSync()}function w1(Q,X={}){return new d(Q,X).stream()}function A1(Q,X={}){return new d(Q,X).walkSync()}async function v1(Q,X={}){return new d(Q,X).walk()}function o2(Q,X={}){return new d(Q,X).iterateSync()}function _1(Q,X={}){return new d(Q,X).iterate()}var R6=i2,F6=Object.assign(w1,{sync:i2}),T6=o2,m6=Object.assign(_1,{sync:o2}),N6=Object.assign(A1,{stream:i2,iterate:o2}),n2=Object.assign(v1,{glob:v1,globSync:A1,sync:N6,globStream:w1,stream:F6,globStreamSync:i2,streamSync:R6,globIterate:_1,iterate:m6,globIterateSync:o2,iterateSync:T6,Glob:d,hasMagic:A5,escape:q2,unescape:b});n2.glob=n2;import{resolve as S6}from"path";var P6=a2.object({description:a2.string().optional().describe("what you want to do"),pattern:a2.string().describe("The glob pattern to match files against"),path:a2.string().optional().describe('The directory to search in. Can be absolute or relative to cwd. If not specified, the current working directory (cwd) will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter "undefined" or "null" - simply omit it for the default behavior. Must be a valid directory path if provided.')}),L1=D6(async({pattern:Q,path:X},Z)=>{let q=X?S6(Z.state.cwd,X):Z.state.cwd,V=await n2(Q,{ignore:["node_modules",".git","dist","build",".next",".turbo","coverage",".nyc_output","temp",".cache","vendor","venv","__pycache__","*.pyc","target","out",".output"],cwd:q,absolute:!0});if(V.length===0)return"No files found.";return V.join(`
200
+ `)},{name:"glob_files",description:`- Fast file pattern matching tool that works with any codebase size
201
+ - Supports glob patterns like "**/*.js" or "src/**/*.ts"
202
+ - Returns matching file paths sorted by modification time
203
+ - Use this tool when you need to find files by name patterns
204
+ - When you are doing an open ended search that may require multiple rounds of globbing and grepping, use the Agent tool instead
205
+ - You have the capability to call multiple tools in a single response. It is always better to speculatively perform multiple searches as a batch that are potentially useful.`,schema:P6});import{tool as h6}from"@langchain/core/tools";import{z as u2}from"zod";import{execa as b7}from"execa";import E7 from"extract-zip";import g7 from"fs-extra";import{dirname as y6,join as b6}from"node:path";import{fileURLToPath as f6}from"node:url";import{pathExists as n7}from"path-exists";import{temporaryFile as o7}from"tempy";import{xdgCache as p7}from"xdg-basedir";var E6=y6(f6(import.meta.url));var s7=process.env.RIPGREP_VERSION||"v15.0.0";var M1=b6(E6,`rg${process.platform==="win32"?".exe":""}`);import{execa as g6}from"execa";import{resolve as d6}from"path";var c6=async(Q,X,Z={})=>{let{timeout:q=15000,cwd:V}=Z;try{let $=await g6(Q,X,{cwd:V||process.cwd(),timeout:q,reject:!1,stripFinalNewline:!1,stdio:["pipe","pipe","pipe"],env:process.env});return{code:$.exitCode??0,stdout:$.stdout,stderr:$.stderr}}catch($){if($.timedOut)return{code:124,stdout:$.stdout||"",stderr:($.stderr||"")+`
206
+ Process timed out`};return{code:$.exitCode||1,stdout:$.stdout||"",stderr:$.stderr||$.message||"Unknown error"}}},I1=h6(async({args:Q,head_limit:X},Z)=>{if(!Q||Q.length===0)return"Error: No arguments provided. Please provide ripgrep arguments.";if(!X&&!Q.includes("--max-count"))X=500;let q=Q[Q.length-1],V=[...Q];if(q&&!q.startsWith("-"))V[V.length-1]=d6(Z.state.cwd,q);let $=await c6(M1,V,{timeout:15000,cwd:Z.state.cwd});if(X&&$.stdout){let J=$.stdout.split(`
207
+ `);if(J.length>X)$.stdout=J.slice(0,X).join(`
208
+ `)}if($.code!==0&&$.stderr){if($.code===1&&$.stdout==="")return"No matches found.";if($.code===124||$.stderr.includes("timeout")||$.stderr.includes("timed out"))return"Error: Search timed out after 15 seconds. Please use a more specific pattern or limit the search scope with type/glob/path parameters.";return`Error executing ripgrep: ${$.stderr}`}return $.stdout||"No matches found."},{name:"search_files_rg",description:`Ripgrep (rg) - A fast text search tool that recursively searches directories for regex patterns
209
+
210
+ ⚠️ IMPORTANT USAGE GUIDELINES:
211
+ - This tool wraps the ripgrep (rg) command-line tool
212
+ - Use this ONLY for searching TEXT PATTERNS within file contents
213
+ - For reading entire files, use the Read tool instead
214
+ - For finding files by name patterns, use the Glob tool instead
215
+
216
+ \uD83D\uDD0D SEARCH PATH REQUIREMENT:
217
+ - MUST always specify a search path at the end of args array
218
+ - If no specific path needed, use "./" for current directory
219
+ - Never omit the path parameter - ripgrep requires it
220
+ - Relative paths are resolved relative to the current working directory (cwd)
221
+
222
+ Usage - Pass ripgrep (rg) arguments as an array:
223
+ The args array corresponds directly to 'rg [OPTIONS] PATTERN [PATH...]'
224
+
225
+ Examples:
226
+ - Search pattern in current directory: ["PATTERN", "./"]
227
+ - Search in specific path: ["PATTERN", "src/"]
228
+ - Search with file type filter: ["--type", "ts", "PATTERN", "./"]
229
+ - Case insensitive search: ["-i", "PATTERN", "./"]
230
+ - Show line numbers: ["-n", "PATTERN", "./"]
231
+ - Show context lines: ["-C", "3", "PATTERN", "./"]
232
+ - Only show file names: ["-l", "PATTERN", "./"]
233
+ - Count matches: ["-c", "PATTERN", "./"]
234
+ - Multiple options: ["-n", "-i", "--type", "js", "function", "src/"]
235
+
236
+ Common ripgrep (rg) options:
237
+ - -i, --ignore-case: Case insensitive search
238
+ - -n, --line-number: Show line numbers
239
+ - -A NUM: Show NUM lines after each match
240
+ - -B NUM: Show NUM lines before each match
241
+ - -C NUM: Show NUM lines around each match
242
+ - -l, --files-with-matches: Only show file paths that match
243
+ - -c, --count: Only show count of matches per file
244
+ - --type TYPE: Only search files of TYPE (js, ts, py, rust, etc.)
245
+ - --glob PATTERN: Include/exclude files matching PATTERN
246
+ - --max-count NUM: Stop after NUM matches per file
247
+ - --no-ignore: Don't respect .gitignore files
248
+ - --hidden: Search hidden files and directories
249
+
250
+ Performance:
251
+ - 15 second timeout per search
252
+ - Results limited to 500 lines by default (use head_limit parameter)
253
+ - Respects .gitignore by default (use --no-ignore to override)
254
+ `,schema:u2.object({description:u2.string().optional().describe("what you want to do"),args:u2.array(u2.string()).describe('Ripgrep (rg) command arguments as array. Format: [OPTIONS...] PATTERN [PATH...]. MUST include path at end! Examples: ["import", "./"] (search "import" in current dir), ["-n", "-i", "function", "./"] (search "function" with line numbers, case insensitive), ["--type", "ts", "export", "src/"] (search "export" in TypeScript files in src/).'),head_limit:u2.number().optional().describe("Limit output to first N lines. If not specified and no --max-count in args, defaults to 500 lines for performance.")})});import{tool as l6}from"@langchain/core/tools";import{z as R2}from"zod";import{promises as n6}from"fs";import{resolve as i6}from"path";var _5=2000,o6=R2.object({description:R2.string().optional().describe("what you want to do"),file_path:R2.string().describe("The path to the file to read (absolute or relative to cwd)"),offset:R2.number().default(0).optional().describe("The line number to start reading from. Only provide if the file is too large to read at once"),limit:R2.number().default(_5).optional().describe("The number of lines to read. Only provide if the file is too large to read at once.")}),x1=l6(async({file_path:Q,offset:X,limit:Z},q)=>{try{let V=i6(q.state.cwd,Q),J=(await n6.readFile(V,"utf-8")).split(`
255
+ `);if(X)J=J.slice(X-1);if(Z)J=J.slice(0,Z);return J.join(`
256
+ `)}catch(V){if(V.code==="ENOENT")return`Error: File not found at ${Q}`;throw V}},{name:"read_file",description:`Reads a file from the local filesystem. Relative paths are resolved based on the current working directory (cwd).
257
+ Assume this tool is able to read all files on the machine. If the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.
258
+
259
+ Usage:
260
+ - The file_path parameter can be either an absolute path or a relative path
261
+ - Relative paths are resolved relative to the current working directory (cwd)
262
+ - By default, it reads up to ${_5} lines starting from the beginning of the file
263
+ - You can optionally specify a line offset and limit (especially handy for long files), but it's recommended to read the whole file by not providing these parameters
264
+ - Any lines longer than ${_5} characters will be truncated
265
+ - Results are returned using cat -n format, with line numbers starting at 1
266
+ - This tool allows You to read images (eg PNG, JPG, etc). When reading an image file the contents are presented visually as You is a multimodal LLM.
267
+ - This tool can read PDF files (.pdf). PDFs are processed page by page, extracting both text and visual content for analysis.
268
+ - This tool can read Jupyter notebooks (.ipynb files) and returns all cells with their outputs, combining code, text, and visualizations.
269
+ - You have the capability to call multiple tools in a single response. It is always better to speculatively read multiple files as a batch that are potentially useful.
270
+ - You will regularly be asked to read screenshots. If the user provides a path to a screenshot ALWAYS use this tool to view the file at the path. This tool will work with all temporary file paths like /var/folders/123/abc/T/TemporaryItems/NSIRD_screencaptureui_ZfB1tD/Screenshot.png
271
+ - If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.`,schema:o6});import{tool as a6}from"@langchain/core/tools";import{z as p2}from"zod";import{promises as p6}from"fs";import{resolve as s6}from"path";var O1=a6(async({file_path:Q,content:X},Z)=>{try{let q=s6(Z.state.cwd,Q);return await p6.writeFile(q,X,"utf-8"),`File ${q} has been written successfully.`}catch(q){return`Error writing file: ${q.message}`}},{name:"write_file",description:`Writes a file to the local filesystem. Relative paths are resolved based on the current working directory (cwd).
272
+ Usage:
273
+ - This tool will overwrite the existing file if there is one at the provided path.
274
+ - If this is an existing file, you MUST use the Read tool first to read the file's contents. This tool will fail if you did not read the file first.
275
+ - ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.
276
+ - NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.
277
+ - Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.`,schema:p2.object({description:p2.string().optional().describe("what you want to do"),file_path:p2.string().describe("The path to the file to write (absolute or relative to cwd)"),content:p2.string().describe("The content to write to the file")})});import{tool as r6}from"@langchain/core/tools";import{z as K2}from"zod";import{promises as L5}from"fs";import{resolve as e6}from"path";var t6=K2.object({description:K2.string().optional().describe("what you want to do"),file_path:K2.string().describe("The path to the file to modify (absolute or relative to cwd)"),old_string:K2.string().describe("The text to replace"),new_string:K2.string().describe("The text to replace it with (must be different from old_string)"),replace_all:K2.boolean().optional().default(!1).describe("Replace all occurences of old_string (default false)")}),u1=r6(async({file_path:Q,old_string:X,new_string:Z,replace_all:q=!1},V)=>{try{let $=e6(V.state.cwd,Q),J=await L5.readFile($,"utf-8");if(q){if(!J.includes(X))return`Error: old_string not found in ${$}`;let K=J.split(X).join(Z);return await L5.writeFile($,K,"utf-8"),`File ${$} has been edited successfully. Replaced all occurrences of old_string.`}else{let K=J.split(X);if(K.length===1)return`Error: old_string not found in ${$}`;if(K.length>2)return`Error: old_string is not unique in ${$} (found ${K.length-1} occurrences). Please provide more context or set replace_all to true.`;let Y=J.replace(X,Z);return await L5.writeFile($,Y,"utf-8"),`File ${$} has been edited successfully. Replaced single occurrence of old_string.`}}catch($){if($.code==="ENOENT")return`Error: File not found at ${Q}`;throw $}},{name:"edit_file",description:`Performs exact string replacements in files. Relative paths are resolved based on the current working directory (cwd).
278
+
279
+ Usage:
280
+ - You must use your \`Read\` tool at least once in the conversation before editing. This tool will error if you attempt an edit without reading the file.
281
+ - When editing text from Read tool output, ensure you preserve the exact indentation (tabs/spaces) as it appears AFTER the line number prefix. The line number prefix format is: spaces + line number + tab. Everything after that tab is the actual file content to match. Never include any part of the line number prefix in the old_string or new_string.
282
+ - ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.
283
+ - Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.
284
+ - The edit will FAIL if \`old_string\` is not unique in the file. Either provide a larger string with more surrounding context to make it unique or use \`replace_all\` to change every instance of \`old_string\`.
285
+ - Use \`replace_all\` for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.`,schema:t6});class s2{name="FilesystemMiddleware";contextSchema=void 0;stateSchema=void 0;tools=[x1,O1,u1,L1,I1,u5];async execute(){return this}}import{tool as Q0}from"@langchain/core/tools";import{z as s}from"zod";import{execa as R1}from"execa";var r2=new Map,e2=process.platform==="win32",F1=e2?"cmd.exe":"/bin/bash",T1=e2?["/d","/s","/c"]:["-c"],M5=Q0(async({command:Q,timeout:X,run_in_background:Z,kill_process_id:q,get_output_id:V,filter:$},J)=>{if(q){let K=parseInt(q,10),Y=r2.get(K);if(!Y)return`Error: No background process found with ID ${q}.`;return Y.process.kill(),r2.delete(K),`Successfully killed process with ID ${q}.`}if(V){let K=parseInt(V,10),Y=r2.get(K);if(!Y)return`Error: No background process found with ID ${V}.`;let H=Y.stdout.join(""),z=Y.stderr.join("");if(Y.stdout=[],Y.stderr=[],$){let j=new RegExp($);H=H.split(`
286
+ `).filter((U)=>j.test(U)).join(`
287
+ `),z=z.split(`
288
+ `).filter((U)=>j.test(U)).join(`
289
+ `)}let W="";if(H)W+=`STDOUT:
290
+ ${H}
291
+ `;if(z)W+=`STDERR:
292
+ ${z}
293
+ `;return W||"No new output since last check."}if(!Q)return"Error: 'command' argument is required unless using 'kill_process_id' or 'get_output_id'.";if(Z)try{let K=R1(F1,[...T1,Q],{cwd:J.state.cwd,timeout:X,reject:!1,windowsVerbatimArguments:e2});if(!K.pid)return"Failed to start command in background.";let Y={process:K,stdout:[],stderr:[]};return r2.set(K.pid,Y),K.stdout?.on("data",(H)=>{Y.stdout.push(H.toString())}),K.stderr?.on("data",(H)=>{Y.stderr.push(H.toString())}),K.on("close",()=>{}),`Command started in background with ID: ${K.pid}`}catch(K){return`Error starting background command: ${K}`}else try{let K=await R1(F1,[...T1,Q],{cwd:J.state.cwd,timeout:X,reject:!1,windowsVerbatimArguments:e2});if(K.exitCode!==0)return K.stderr;return K.stdout}catch(K){return`Error executing command: ${K}`}},{name:"terminal",description:`Executes commands in a persistent shell session (Bash on Linux/macOS, CMD on Windows). Commands are executed in the current working directory (cwd).
294
+ Features:
295
+ - Run commands (foreground or background)
296
+ - Retrieve background process output
297
+ - Kill background processes
298
+ - Cross-platform support (auto-detects OS)
299
+
300
+ Usage:
301
+ 1. Run Command: Provide \`command\`. Optional: \`run_in_background\`, \`timeout\`.
302
+ 2. Check Output: Provide \`get_output_id\`. Optional: \`filter\`.
303
+ 3. Kill Process: Provide \`kill_process_id\`.
304
+
305
+ Notes:
306
+ - For file paths with spaces, ALWAYS use quotes: "path/to file"
307
+ - Commands are executed relative to the current working directory (cwd)
308
+ - Avoid interactive commands (like top, vim)
309
+ - Use '&&' or ';' to chain commands (PowerShell/CMD syntax varies, simple chaining often works)
310
+ - CAN'T BATCH CALL THIS TOOL!
311
+ `,schema:s.object({description:s.string().describe("what you want to do"),command:s.string().optional().describe("The command to execute (required for running commands)"),timeout:s.number().optional().describe("Timeout in ms (default: 120000)"),run_in_background:s.boolean().optional().describe("Run command in background"),kill_process_id:s.string().optional().describe("ID of process to kill"),get_output_id:s.string().optional().describe("ID of process to get output from"),filter:s.string().optional().describe("Regex to filter output (only for get_output_id)")})});class t2{name="TerminalMiddleware";contextSchema=void 0;stateSchema=void 0;tools=[M5];async execute(){return this}}async function m1(Q){let X={id:"filesystem",name:"filesystem",description:"File and directory operations (read, write, search, glob)",execute:async()=>{return new s2}};await Q.addMiddleware(X),Q.middlewares.registerImplementation(X);let Z={id:"terminal",name:"terminal",description:"Terminal command execution (Bash/CMD, background processes)",execute:async()=>{return new t2}};await Q.addMiddleware(Z),Q.middlewares.registerImplementation(Z);let q={id:"subagents",name:"subagents",description:"Task delegation to specialized agents",execute:async()=>{let{createSubAgentsMiddleware:K}=await import("./chunk-vgvekk29.js");return await K(Q)}};await Q.addMiddleware(q),Q.middlewares.registerImplementation(q);let V={id:"memories",name:"memories",description:"Knowledge persistence",execute:async(K)=>{K.projectMemoriesDir=K.projectMemoriesDir||"./.claude/memories";let{MemoriesMiddleware:Y}=await import("./chunk-e2vdc3vs.js");return new Y(K)}};await Q.addMiddleware(V),Q.middlewares.registerImplementation(V);let $={id:"skills",name:"skills",description:"Progressive skills disclosure",execute:async(K)=>{if(K.projectSkillsDir=K.projectSkillsDir||"./.claude/skills",!K.skillsDir){let H=await import("os"),z=await import("path");K.skillsDir=z.join(H.homedir(),".claude","skills")}let{SkillsMiddleware:Y}=await import("@langgraph-js/standard-agent");return new Y(K)}};await Q.addMiddleware($),Q.middlewares.registerImplementation($);let J={id:"agents_md",name:"agents_md",description:"Inject agent documentation",execute:async(K)=>{let{AgentsMdMiddleware:Y}=await import("@langgraph-js/standard-agent");return new Y({projectRoot:K?.projectRoot})}};await Q.addMiddleware(J),Q.middlewares.registerImplementation(J)}var N1=`# 架构师 - 任务派发协调者
312
+
313
+ 你是一位**任务派发架构师**,核心职责是将用户需求分析并拆解为子任务,然后委派给合适的子 agent 执行。
314
+
315
+ ## 核心职责
316
+
317
+ **你的唯一任务**:
318
+ 1. 理解用户需求
319
+ 2. 拆解为可执行的子任务
320
+ 3. 委派给合适的子 agent
321
+ 4. 跟踪和汇总结果
322
+
323
+ **不要做的事**:
324
+ - ❌ 不要自己编写代码
325
+ - ❌ 不要自己读取文件或搜索代码
326
+ - ❌ 不要自己执行终端命令
327
+ - ❌ 不要做具体的架构分析或设计文档
328
+
329
+ ## 工作流程
330
+
331
+ ### 步骤 1:需求分析
332
+
333
+ 当收到用户请求时,快速判断:
334
+
335
+ 1. **任务类型**:
336
+ - 代码实现/修改 → 委派给 \`agents/default\`
337
+ - 任务规划/协调 → 委派给 \`agents/manager\`
338
+ - 复杂任务 → 先由 \`agents/manager\` 规划,再由 \`agents/default\` 执行
339
+
340
+ 2. **任务规模**:
341
+ - 单一任务 → 直接委派
342
+ - 多任务 → 拆分后分别委派
343
+
344
+ ### 步骤 2:任务拆解
345
+
346
+ 使用 \`task\` 工具委派任务:
347
+
348
+ \`\`\`typescript
349
+ // 示例:委派代码实现任务
350
+ {
351
+ subagent_id: "agents/default",
352
+ task_description: "实现用户认证功能,包括登录、注册、登出三个接口",
353
+ data_transfer: {
354
+ requirements: "使用 JWT 认证,密码需要加密存储",
355
+ constraints: "使用现有的数据库连接池"
356
+ }
357
+ }
358
+ \`\`\`
359
+
360
+ ### 步骤 3:结果汇总
361
+
362
+ 子 agent 完成后:
363
+ 1. 检查执行结果
364
+ 2. 如果有多个子任务,协调依赖关系
365
+ 3. 向用户汇报整体进度和结果
366
+
367
+ ## 委派策略
368
+
369
+ ### 简单任务
370
+
371
+ 用户请求单一功能时,直接委派:
372
+
373
+ > 用户:添加一个日志工具函数
374
+
375
+ → 委派给 \`agents/default\`,任务描述清晰完整
376
+
377
+ ### 复杂任务
378
+
379
+ 用户请求多功能时,拆分后委派:
380
+
381
+ > 用户:重构用户模块并添加测试
382
+
383
+ → 拆分为:
384
+ 1. 委派 \`agents/default\`:重构用户模块代码
385
+ 2. 等第一步完成后,委派 \`agents/default\`:为用户模块编写测试
386
+
387
+ ### 规划任务
388
+
389
+ 用户需要方案设计时:
390
+
391
+ > 用户:设计一个新的权限系统
392
+
393
+ → 委派 \`agents/manager\` 进行任务规划,然后按规划执行
394
+
395
+ ## 输出格式
396
+
397
+ ### 委派时
398
+
399
+ \`\`\`markdown
400
+ ## 任务分析
401
+
402
+ **用户需求**:{用户原始请求}
403
+
404
+ **任务拆解**:
405
+ 1. 任务 A → 委派给 agents/default
406
+ 2. 任务 B → 委派给 agents/manager
407
+
408
+ **开始执行**...
409
+ \`\`\`
410
+
411
+ ### 汇报时
412
+
413
+ \`\`\`markdown
414
+ ## 执行结果
415
+
416
+ **已完成**:
417
+ - ✅ 任务 A:{简要结果}
418
+ - ✅ 任务 B:{简要结果}
419
+
420
+ **总结**:{整体结果摘要}
421
+ \`\`\`
422
+
423
+ ## 重要约束
424
+
425
+ 1. **立即委派**:收到任务后,不要犹豫,立即分析并委派
426
+ 2. **清晰描述**:给子 agent 的任务描述要完整、清晰
427
+ 3. **传递上下文**:使用 \`data_transfer\` 传递必要的背景信息
428
+ 4. **不要插手**:相信子 agent 的能力,不要自己动手做具体工作
429
+ 5. **保持简洁**:你的输出应该简短,重点是协调和汇总
430
+
431
+ ---
432
+
433
+ **记住**:你是协调者,不是执行者。快速分析需求,立即委派任务,高效汇总结果。`;async function S1(){let Q=new Z0,X=new X0(Q);return await X.addModel({id:"glm-4.7",model_name:"glm-4.7",model_provider:process.env.MODEL_PROVIDER||"openai",stream_usage:!0,enable_thinking:!0,temperature:0.7,max_tokens:4096,top_p:1,frequency_penalty:0,presence_penalty:0}),await X.addPrompt({id:"prompts/default",name:"default",content:D1}),await X.addPrompt({id:"prompts/manager",name:"manager",content:N1}),await O5(X),await m1(X),await X.addAgent({id:"agents/default",name:"Jarvis",description:"代码实现助手",system_prompt:"prompts/default",model:"glm-4.7",tools:{ask_user_questions:!0,todo_write:!0},middleware:{filesystem:!0,terminal:!0,agents_md:!0,skills:!0,memories:!0,subagents:!0}}),await X.addAgent({id:"agents/manager",name:"Manager",description:"任务管理员",system_prompt:"prompts/manager",model:"glm-4.7",tools:{ask_user_questions:!0,todo_write:!0},middleware:{filesystem:!0,terminal:!0,agents_md:!0,skills:!0,memories:!0,subagents:!0}}),X}var q9=await S1();
434
+ export{b1 as tb,u5 as ub,L1 as vb,x1 as wb,u1 as xb,q9 as yb};