@zyycn/claudex 1.0.3-fork.0cb3e59

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 (456) hide show
  1. package/LICENSE.md +5 -0
  2. package/README.md +515 -0
  3. package/bin/claudex.js +40 -0
  4. package/dist/chunk-00xcm9ma.js +21933 -0
  5. package/dist/chunk-02gx6hwz.js +655 -0
  6. package/dist/chunk-06saje2v.js +39 -0
  7. package/dist/chunk-0731m51q.js +8 -0
  8. package/dist/chunk-08gaq1e6.js +253 -0
  9. package/dist/chunk-0dc7sstd.js +112 -0
  10. package/dist/chunk-0et2fwnm.js +169 -0
  11. package/dist/chunk-0fzmdbg5.js +216 -0
  12. package/dist/chunk-0gby1zjm.js +98 -0
  13. package/dist/chunk-0npyf61x.js +91 -0
  14. package/dist/chunk-0paqc2yw.js +15 -0
  15. package/dist/chunk-0phtbe2q.js +458 -0
  16. package/dist/chunk-0q2xkmse.js +58 -0
  17. package/dist/chunk-0sdqeyab.js +116 -0
  18. package/dist/chunk-0vkfrmqm.js +690 -0
  19. package/dist/chunk-0xjaqda8.js +1124 -0
  20. package/dist/chunk-0zqd56e7.js +86 -0
  21. package/dist/chunk-1141xmr4.js +8 -0
  22. package/dist/chunk-13n2g124.js +83 -0
  23. package/dist/chunk-14jv3jm7.js +17 -0
  24. package/dist/chunk-17ke93s2.js +91 -0
  25. package/dist/chunk-1bwnpgmv.js +644 -0
  26. package/dist/chunk-1cbn5kxf.js +7 -0
  27. package/dist/chunk-1h2famwb.js +49 -0
  28. package/dist/chunk-1j23x6pe.js +198 -0
  29. package/dist/chunk-1vh98qr0.js +4521 -0
  30. package/dist/chunk-1xkekb9y.js +19 -0
  31. package/dist/chunk-238g70xa.js +36 -0
  32. package/dist/chunk-2534gszj.js +95 -0
  33. package/dist/chunk-27xc1csx.js +104 -0
  34. package/dist/chunk-29heyb0a.js +654 -0
  35. package/dist/chunk-2a42s11t.js +412 -0
  36. package/dist/chunk-2eykm0j0.js +20 -0
  37. package/dist/chunk-2fwze72g.js +24 -0
  38. package/dist/chunk-2gzv8nrw.js +205 -0
  39. package/dist/chunk-2jhpjejz.js +605 -0
  40. package/dist/chunk-2k995y2x.js +880 -0
  41. package/dist/chunk-2m0wm5mn.js +756 -0
  42. package/dist/chunk-2nayx6q1.js +63 -0
  43. package/dist/chunk-2remehvd.js +6110 -0
  44. package/dist/chunk-2t1frg13.js +716 -0
  45. package/dist/chunk-2t3vw4tx.js +22820 -0
  46. package/dist/chunk-2tfdd2x0.js +95 -0
  47. package/dist/chunk-2yneprmc.js +87 -0
  48. package/dist/chunk-2zcggr61.js +33312 -0
  49. package/dist/chunk-30rst83v.js +168 -0
  50. package/dist/chunk-328dhq0p.js +208 -0
  51. package/dist/chunk-32q1kp1y.js +197 -0
  52. package/dist/chunk-32remjv9.js +5020 -0
  53. package/dist/chunk-3322z7nj.js +250 -0
  54. package/dist/chunk-35wnmznv.js +339 -0
  55. package/dist/chunk-36zeg659.js +90 -0
  56. package/dist/chunk-38700exh.js +42 -0
  57. package/dist/chunk-3c25bcsw.js +17 -0
  58. package/dist/chunk-3h8a89gy.js +46 -0
  59. package/dist/chunk-3nk79af8.js +8 -0
  60. package/dist/chunk-3peatsdv.js +41 -0
  61. package/dist/chunk-3vs3nm7w.js +31 -0
  62. package/dist/chunk-3w6s9m5w.js +16 -0
  63. package/dist/chunk-3xba7r34.js +469 -0
  64. package/dist/chunk-41fv13be.js +131 -0
  65. package/dist/chunk-44fpr6jq.js +434 -0
  66. package/dist/chunk-46bzfjbb.js +83 -0
  67. package/dist/chunk-46xsszyy.js +154 -0
  68. package/dist/chunk-483649rh.js +3418 -0
  69. package/dist/chunk-48nen4vg.js +41634 -0
  70. package/dist/chunk-495d85x1.js +8066 -0
  71. package/dist/chunk-4f6xmap7.js +153 -0
  72. package/dist/chunk-4g3v8y12.js +23 -0
  73. package/dist/chunk-4j2pg3ms.js +338 -0
  74. package/dist/chunk-4jm600zv.js +13 -0
  75. package/dist/chunk-4ka7s9ee.js +115 -0
  76. package/dist/chunk-4q95g821.js +460 -0
  77. package/dist/chunk-4qz9vbs1.js +349 -0
  78. package/dist/chunk-4t19tx5p.js +109 -0
  79. package/dist/chunk-4zfkzkt6.js +37 -0
  80. package/dist/chunk-4zjtn4vd.js +108 -0
  81. package/dist/chunk-50f017g0.js +849 -0
  82. package/dist/chunk-51kecgmn.js +168 -0
  83. package/dist/chunk-54ea16pv.js +155 -0
  84. package/dist/chunk-54ycqnh3.js +275 -0
  85. package/dist/chunk-55wgxwa9.js +13877 -0
  86. package/dist/chunk-56jgazae.js +28 -0
  87. package/dist/chunk-5bfzxa5p.js +300 -0
  88. package/dist/chunk-5eecpt8g.js +173807 -0
  89. package/dist/chunk-5j35ewt6.js +277 -0
  90. package/dist/chunk-5wrm5rwf.js +202 -0
  91. package/dist/chunk-5zrajk5c.js +328 -0
  92. package/dist/chunk-63grvbnw.js +373 -0
  93. package/dist/chunk-65s8h28p.js +123 -0
  94. package/dist/chunk-66pc6ar2.js +229 -0
  95. package/dist/chunk-6bd8brc4.js +48 -0
  96. package/dist/chunk-6dj5t602.js +341 -0
  97. package/dist/chunk-6g31pd6r.js +535 -0
  98. package/dist/chunk-6gr3c3w9.js +378 -0
  99. package/dist/chunk-6n15fb31.js +130 -0
  100. package/dist/chunk-6n2qgm9v.js +8 -0
  101. package/dist/chunk-6p9kb0sw.js +281 -0
  102. package/dist/chunk-6tq2v3rk.js +186 -0
  103. package/dist/chunk-6va3sq9g.js +500 -0
  104. package/dist/chunk-6vkpgtyn.js +101 -0
  105. package/dist/chunk-6w5bpt04.js +267 -0
  106. package/dist/chunk-73rpbt04.js +1947 -0
  107. package/dist/chunk-74bkpcta.js +850 -0
  108. package/dist/chunk-758rh65t.js +223 -0
  109. package/dist/chunk-760252na.js +101 -0
  110. package/dist/chunk-76xdyehq.js +84 -0
  111. package/dist/chunk-7739pg2c.js +4261 -0
  112. package/dist/chunk-78ja94ve.js +400 -0
  113. package/dist/chunk-7aw745vx.js +40175 -0
  114. package/dist/chunk-7e6ahfxz.js +61 -0
  115. package/dist/chunk-7m2nd8da.js +110 -0
  116. package/dist/chunk-7mmew3dp.js +54 -0
  117. package/dist/chunk-7mw85a2s.js +1155 -0
  118. package/dist/chunk-7q18p7bc.js +288 -0
  119. package/dist/chunk-7q237ftq.js +1585 -0
  120. package/dist/chunk-7wm5s02e.js +216 -0
  121. package/dist/chunk-7xyswgjh.js +8 -0
  122. package/dist/chunk-7zaxrfnt.js +42 -0
  123. package/dist/chunk-83hfzbx3.js +10 -0
  124. package/dist/chunk-83y7b98g.js +421 -0
  125. package/dist/chunk-85tc0rn1.js +212 -0
  126. package/dist/chunk-869898a3.js +765 -0
  127. package/dist/chunk-89f4afyz.js +117 -0
  128. package/dist/chunk-8bedvdm1.js +32 -0
  129. package/dist/chunk-8hq5kk3y.js +44 -0
  130. package/dist/chunk-8hw9w1wm.js +3446 -0
  131. package/dist/chunk-8k6q5mnn.js +26 -0
  132. package/dist/chunk-8ktxqpch.js +3060 -0
  133. package/dist/chunk-8ma0b3en.js +674 -0
  134. package/dist/chunk-8qmmgwm9.js +269 -0
  135. package/dist/chunk-8rjvjb5t.js +779 -0
  136. package/dist/chunk-8tnsngw2.js +31 -0
  137. package/dist/chunk-8y12jxg8.js +10 -0
  138. package/dist/chunk-8ymf4e6z.js +48 -0
  139. package/dist/chunk-90wp6wez.js +10510 -0
  140. package/dist/chunk-91q08khb.js +5954 -0
  141. package/dist/chunk-93mnvd83.js +274 -0
  142. package/dist/chunk-988f7f5d.js +192 -0
  143. package/dist/chunk-9c2way1p.js +106 -0
  144. package/dist/chunk-9gbamk79.js +93 -0
  145. package/dist/chunk-9k27xdmg.js +542 -0
  146. package/dist/chunk-9k2drwej.js +106 -0
  147. package/dist/chunk-9mh799n8.js +319 -0
  148. package/dist/chunk-9vqxfdra.js +102 -0
  149. package/dist/chunk-9x5zgy22.js +12 -0
  150. package/dist/chunk-a4zg3cnt.js +90 -0
  151. package/dist/chunk-a6xzz4qc.js +60 -0
  152. package/dist/chunk-a7rt19gv.js +2645 -0
  153. package/dist/chunk-a8ejc632.js +3094 -0
  154. package/dist/chunk-a8x7bb4n.js +372 -0
  155. package/dist/chunk-a900qr4e.js +120 -0
  156. package/dist/chunk-a9pjza30.js +128 -0
  157. package/dist/chunk-a9vdeb6y.js +258 -0
  158. package/dist/chunk-a9zh40sj.js +48 -0
  159. package/dist/chunk-aa3rx320.js +26840 -0
  160. package/dist/chunk-ab89rmm2.js +155 -0
  161. package/dist/chunk-aj6461xm.js +284 -0
  162. package/dist/chunk-any9980a.js +69 -0
  163. package/dist/chunk-ar1vk71q.js +220 -0
  164. package/dist/chunk-ar42apnb.js +692 -0
  165. package/dist/chunk-ass81j08.js +245 -0
  166. package/dist/chunk-b3r6mj2e.js +306 -0
  167. package/dist/chunk-b4wg70y1.js +54 -0
  168. package/dist/chunk-b75fzr8e.js +969 -0
  169. package/dist/chunk-b7cywkg9.js +908 -0
  170. package/dist/chunk-b8x1gk3y.js +1299 -0
  171. package/dist/chunk-b9kme9pv.js +38 -0
  172. package/dist/chunk-bc8tzdm6.js +98 -0
  173. package/dist/chunk-bf2yj476.js +523 -0
  174. package/dist/chunk-bjqw6798.js +328 -0
  175. package/dist/chunk-bm1qb16p.js +17 -0
  176. package/dist/chunk-bqfnp99q.js +477 -0
  177. package/dist/chunk-bt6pjwk8.js +53 -0
  178. package/dist/chunk-bvp4dgm4.js +182 -0
  179. package/dist/chunk-bxqv04xx.js +69 -0
  180. package/dist/chunk-c0hb3epj.js +1556 -0
  181. package/dist/chunk-c7ctgdbk.js +225 -0
  182. package/dist/chunk-cdz5yb0r.js +57 -0
  183. package/dist/chunk-cfv996bs.js +22 -0
  184. package/dist/chunk-cgfdkzhb.js +12 -0
  185. package/dist/chunk-ckj99whh.js +93 -0
  186. package/dist/chunk-cs5excdt.js +10476 -0
  187. package/dist/chunk-ctw3ccd6.js +584 -0
  188. package/dist/chunk-cveeqv76.js +91 -0
  189. package/dist/chunk-czensfac.js +476 -0
  190. package/dist/chunk-czvztj44.js +224 -0
  191. package/dist/chunk-d1r095gm.js +699 -0
  192. package/dist/chunk-d1x7cza8.js +445 -0
  193. package/dist/chunk-d3vvfd8r.js +106 -0
  194. package/dist/chunk-d9kz373t.js +122 -0
  195. package/dist/chunk-d9y2zh54.js +463 -0
  196. package/dist/chunk-ddz739ks.js +441 -0
  197. package/dist/chunk-de4kzjb1.js +1552 -0
  198. package/dist/chunk-dgqrcy74.js +48 -0
  199. package/dist/chunk-dnh7jtpb.js +37 -0
  200. package/dist/chunk-ds5nkfg0.js +1095 -0
  201. package/dist/chunk-dstxhxsx.js +121 -0
  202. package/dist/chunk-dv1wfr85.js +6373 -0
  203. package/dist/chunk-e5pntxye.js +37 -0
  204. package/dist/chunk-e77n3wgc.js +765 -0
  205. package/dist/chunk-e7ksgwbq.js +120 -0
  206. package/dist/chunk-ebkahz1j.js +24 -0
  207. package/dist/chunk-eebcvtbb.js +1646 -0
  208. package/dist/chunk-ehtwnxpg.js +1591 -0
  209. package/dist/chunk-eqp1rfft.js +17 -0
  210. package/dist/chunk-ewadzrm8.js +103 -0
  211. package/dist/chunk-ewhachv2.js +120 -0
  212. package/dist/chunk-excnajfs.js +108 -0
  213. package/dist/chunk-ez6gfswn.js +348 -0
  214. package/dist/chunk-ezf1ppbj.js +208 -0
  215. package/dist/chunk-f58ec6xk.js +91 -0
  216. package/dist/chunk-f5ma3nh5.js +3436 -0
  217. package/dist/chunk-f7q4yc1j.js +675 -0
  218. package/dist/chunk-f7qqfve4.js +160 -0
  219. package/dist/chunk-f9yjwf9r.js +1322 -0
  220. package/dist/chunk-fbpftpf0.js +69 -0
  221. package/dist/chunk-fbv4apne.js +51 -0
  222. package/dist/chunk-fd7nt73r.js +117 -0
  223. package/dist/chunk-ffk8cg49.js +61 -0
  224. package/dist/chunk-fpcjbens.js +184 -0
  225. package/dist/chunk-fvt4y30r.js +1319 -0
  226. package/dist/chunk-fyc5fepv.js +10 -0
  227. package/dist/chunk-g0j0t6qk.js +26 -0
  228. package/dist/chunk-g338npwr.js +1061 -0
  229. package/dist/chunk-g3t0act8.js +8 -0
  230. package/dist/chunk-gj2rs1h5.js +182 -0
  231. package/dist/chunk-gmaybtrd.js +726 -0
  232. package/dist/chunk-gmpyhcdr.js +567 -0
  233. package/dist/chunk-gq0kzj2c.js +195 -0
  234. package/dist/chunk-gq1sc60w.js +5398 -0
  235. package/dist/chunk-gr76xkdb.js +266 -0
  236. package/dist/chunk-gv0tqhg0.js +118 -0
  237. package/dist/chunk-gvx0ghfc.js +156 -0
  238. package/dist/chunk-gyj242zr.js +20 -0
  239. package/dist/chunk-gz4etn3r.js +102 -0
  240. package/dist/chunk-gzzfhtdv.js +7189 -0
  241. package/dist/chunk-h0qngp9w.js +157 -0
  242. package/dist/chunk-h0rbjg6x.js +55 -0
  243. package/dist/chunk-h20nxmw7.js +97 -0
  244. package/dist/chunk-h2bvdmje.js +111 -0
  245. package/dist/chunk-h5r7m7ze.js +727 -0
  246. package/dist/chunk-h6he4c34.js +71 -0
  247. package/dist/chunk-h8k6be74.js +528 -0
  248. package/dist/chunk-h9xcymwn.js +71 -0
  249. package/dist/chunk-hakdhagh.js +16606 -0
  250. package/dist/chunk-hdwqy5n7.js +146 -0
  251. package/dist/chunk-hgba8zda.js +16453 -0
  252. package/dist/chunk-hgfabxva.js +713 -0
  253. package/dist/chunk-hh7cmy4k.js +20 -0
  254. package/dist/chunk-hhwvfv1c.js +2337 -0
  255. package/dist/chunk-hhxc0wcy.js +103 -0
  256. package/dist/chunk-hj63t9sr.js +92 -0
  257. package/dist/chunk-hjd7rv7x.js +108 -0
  258. package/dist/chunk-hk9xz7gk.js +118 -0
  259. package/dist/chunk-hp1dhvmv.js +74 -0
  260. package/dist/chunk-hqmz36b3.js +552 -0
  261. package/dist/chunk-hzhe8ygc.js +547 -0
  262. package/dist/chunk-j2k4p94p.js +55 -0
  263. package/dist/chunk-j3a4p81y.js +184 -0
  264. package/dist/chunk-j5hc27hv.js +444 -0
  265. package/dist/chunk-j64ga6ta.js +8035 -0
  266. package/dist/chunk-jce5r25x.js +18 -0
  267. package/dist/chunk-jcyvmtj2.js +160 -0
  268. package/dist/chunk-jd32zbps.js +15 -0
  269. package/dist/chunk-jdgeec04.js +4249 -0
  270. package/dist/chunk-jgyff58b.js +258 -0
  271. package/dist/chunk-jjr5r7w7.js +92 -0
  272. package/dist/chunk-jn0mpjqf.js +333 -0
  273. package/dist/chunk-jnhkref0.js +30 -0
  274. package/dist/chunk-jpggn642.js +432 -0
  275. package/dist/chunk-jpp9dqv4.js +6956 -0
  276. package/dist/chunk-jx817w05.js +11 -0
  277. package/dist/chunk-jxtre36y.js +40 -0
  278. package/dist/chunk-jzmz18nn.js +65 -0
  279. package/dist/chunk-k0p9w03v.js +4957 -0
  280. package/dist/chunk-k0zwdngv.js +490 -0
  281. package/dist/chunk-k2aj61ee.js +27 -0
  282. package/dist/chunk-k8w1ezmk.js +90 -0
  283. package/dist/chunk-kcsn5yw7.js +44 -0
  284. package/dist/chunk-kdqsfmc5.js +196 -0
  285. package/dist/chunk-ke1tnbrn.js +377 -0
  286. package/dist/chunk-kjzy2qna.js +107 -0
  287. package/dist/chunk-kpm9svs6.js +95 -0
  288. package/dist/chunk-kwekc97v.js +18 -0
  289. package/dist/chunk-ky45jk6r.js +3205 -0
  290. package/dist/chunk-m0t8da6q.js +117 -0
  291. package/dist/chunk-m2j40h9c.js +9200 -0
  292. package/dist/chunk-mbaff8kf.js +146 -0
  293. package/dist/chunk-mhgvx0zj.js +73 -0
  294. package/dist/chunk-mk4gn915.js +470 -0
  295. package/dist/chunk-mt25echc.js +6157 -0
  296. package/dist/chunk-mt5bv97a.js +438 -0
  297. package/dist/chunk-mx28h61f.js +1147 -0
  298. package/dist/chunk-mzxce5mm.js +88 -0
  299. package/dist/chunk-n0qaeaa5.js +256 -0
  300. package/dist/chunk-n2pzg3mt.js +59 -0
  301. package/dist/chunk-n5k4xha0.js +32 -0
  302. package/dist/chunk-n7ttdtk0.js +641 -0
  303. package/dist/chunk-nc0gdh9t.js +606 -0
  304. package/dist/chunk-nj17bhkh.js +125 -0
  305. package/dist/chunk-nka1g8f4.js +773 -0
  306. package/dist/chunk-nnzxefrw.js +87 -0
  307. package/dist/chunk-nq0fxyxh.js +752 -0
  308. package/dist/chunk-nswvw0j4.js +473 -0
  309. package/dist/chunk-nt837qt9.js +21 -0
  310. package/dist/chunk-nw5zdpcj.js +802 -0
  311. package/dist/chunk-nwsmn6zm.js +15 -0
  312. package/dist/chunk-p2816w9z.js +1486 -0
  313. package/dist/chunk-p2d5nh3g.js +342 -0
  314. package/dist/chunk-p331ghzg.js +391 -0
  315. package/dist/chunk-p664cp33.js +99 -0
  316. package/dist/chunk-pak5mb7s.js +42 -0
  317. package/dist/chunk-pe6w0anj.js +780 -0
  318. package/dist/chunk-pkm43mwf.js +282 -0
  319. package/dist/chunk-pm3ng0bm.js +70 -0
  320. package/dist/chunk-pmsp9ed2.js +34 -0
  321. package/dist/chunk-ppwjyveh.js +8 -0
  322. package/dist/chunk-ps49ymvj.js +43 -0
  323. package/dist/chunk-pwwa7s62.js +11 -0
  324. package/dist/chunk-py5y9jh1.js +38 -0
  325. package/dist/chunk-pyesx3a8.js +140 -0
  326. package/dist/chunk-q0q2tsae.js +63 -0
  327. package/dist/chunk-q0sq5qtt.js +606 -0
  328. package/dist/chunk-q1by1vax.js +54 -0
  329. package/dist/chunk-q25bjaev.js +15 -0
  330. package/dist/chunk-q2hty1hy.js +61 -0
  331. package/dist/chunk-q7bxdsfd.js +22 -0
  332. package/dist/chunk-qbt1tq74.js +145 -0
  333. package/dist/chunk-qetzwv5m.js +28 -0
  334. package/dist/chunk-qnfx3qtx.js +617 -0
  335. package/dist/chunk-qp2qdcda.js +100 -0
  336. package/dist/chunk-qqfa0dqg.js +2343 -0
  337. package/dist/chunk-qz2x630m.js +49145 -0
  338. package/dist/chunk-r3ecyyb3.js +642 -0
  339. package/dist/chunk-r3pxqd84.js +89 -0
  340. package/dist/chunk-r53sxdq1.js +513 -0
  341. package/dist/chunk-r6b58y3x.js +17 -0
  342. package/dist/chunk-r6dahdmd.js +62 -0
  343. package/dist/chunk-r9xapwyb.js +745 -0
  344. package/dist/chunk-ra06qpba.js +132 -0
  345. package/dist/chunk-raq35wpc.js +1922 -0
  346. package/dist/chunk-raqgs410.js +116 -0
  347. package/dist/chunk-res15ktd.js +18 -0
  348. package/dist/chunk-rgwhsqte.js +348 -0
  349. package/dist/chunk-rn0v1hk8.js +34 -0
  350. package/dist/chunk-rtgznsee.js +43 -0
  351. package/dist/chunk-rtt7r7pp.js +93 -0
  352. package/dist/chunk-rwqp8zag.js +539 -0
  353. package/dist/chunk-ryydxc3f.js +931 -0
  354. package/dist/chunk-rzeekzsp.js +87 -0
  355. package/dist/chunk-s3pzvdss.js +50 -0
  356. package/dist/chunk-s4c5a2td.js +40 -0
  357. package/dist/chunk-s5n2qgaz.js +258 -0
  358. package/dist/chunk-s87dt0fj.js +1493 -0
  359. package/dist/chunk-sbbj6ta3.js +1711 -0
  360. package/dist/chunk-sc47b62f.js +165 -0
  361. package/dist/chunk-sd36yzx8.js +954 -0
  362. package/dist/chunk-sdj9b9wh.js +782 -0
  363. package/dist/chunk-shb6nvk6.js +27 -0
  364. package/dist/chunk-sn49y8be.js +99 -0
  365. package/dist/chunk-sp8wb67m.js +703 -0
  366. package/dist/chunk-sxa8b5t8.js +124 -0
  367. package/dist/chunk-szj5wvdy.js +28 -0
  368. package/dist/chunk-szqvjwww.js +96 -0
  369. package/dist/chunk-t0rgmccj.js +39 -0
  370. package/dist/chunk-t311b37r.js +163 -0
  371. package/dist/chunk-t3360k46.js +75 -0
  372. package/dist/chunk-t63re27d.js +38 -0
  373. package/dist/chunk-t6j5es92.js +134 -0
  374. package/dist/chunk-tag6m3ab.js +308 -0
  375. package/dist/chunk-tdgkxc3j.js +287 -0
  376. package/dist/chunk-tgw8v0sq.js +98 -0
  377. package/dist/chunk-th93qf0c.js +93 -0
  378. package/dist/chunk-tjk56vh8.js +81 -0
  379. package/dist/chunk-ts2p6bv1.js +224 -0
  380. package/dist/chunk-ttk5dzz8.js +25 -0
  381. package/dist/chunk-v073zhk5.js +40 -0
  382. package/dist/chunk-v1kzp02e.js +785 -0
  383. package/dist/chunk-v78fj8by.js +145 -0
  384. package/dist/chunk-v90xv5n9.js +157 -0
  385. package/dist/chunk-v9nt9zq6.js +648 -0
  386. package/dist/chunk-v9smspw2.js +4301 -0
  387. package/dist/chunk-vd3bb2zh.js +173 -0
  388. package/dist/chunk-vest0y6x.js +3830 -0
  389. package/dist/chunk-vf5sd1nq.js +12 -0
  390. package/dist/chunk-vhjx5fag.js +56 -0
  391. package/dist/chunk-vqk1n5qr.js +63 -0
  392. package/dist/chunk-vqn6x094.js +229 -0
  393. package/dist/chunk-vqvd3qz0.js +151 -0
  394. package/dist/chunk-vs89tkvk.js +92 -0
  395. package/dist/chunk-vtapv44m.js +165 -0
  396. package/dist/chunk-vyjeh50y.js +2149 -0
  397. package/dist/chunk-w100pzs6.js +41 -0
  398. package/dist/chunk-w2yzntwd.js +826 -0
  399. package/dist/chunk-w62fme7p.js +86 -0
  400. package/dist/chunk-w7993vfy.js +71 -0
  401. package/dist/chunk-w8gahavr.js +496 -0
  402. package/dist/chunk-wc4aza46.js +79 -0
  403. package/dist/chunk-wewayn8z.js +1016 -0
  404. package/dist/chunk-weydtrhz.js +791 -0
  405. package/dist/chunk-wfz0qffj.js +3939 -0
  406. package/dist/chunk-wgcssf6v.js +722 -0
  407. package/dist/chunk-whkhe74c.js +266 -0
  408. package/dist/chunk-wn2268qd.js +335 -0
  409. package/dist/chunk-wq5q81g4.js +1582 -0
  410. package/dist/chunk-wrhhmkf7.js +16 -0
  411. package/dist/chunk-wspjz9er.js +214 -0
  412. package/dist/chunk-wtpx8wcx.js +1874 -0
  413. package/dist/chunk-wyp16717.js +302 -0
  414. package/dist/chunk-wzpdet3m.js +843 -0
  415. package/dist/chunk-x0ypwxsz.js +104 -0
  416. package/dist/chunk-x67ffx2k.js +270 -0
  417. package/dist/chunk-x6r4v44b.js +8 -0
  418. package/dist/chunk-x8b7vft8.js +132 -0
  419. package/dist/chunk-x9k4fdvw.js +32 -0
  420. package/dist/chunk-xbsf7t5r.js +173 -0
  421. package/dist/chunk-xbtacp2f.js +4389 -0
  422. package/dist/chunk-xffq0yyv.js +79 -0
  423. package/dist/chunk-xm1c1mzd.js +56 -0
  424. package/dist/chunk-xq4cfvpn.js +213 -0
  425. package/dist/chunk-xq9wsyp9.js +48 -0
  426. package/dist/chunk-xqy6f112.js +277 -0
  427. package/dist/chunk-xsq9ae7x.js +90 -0
  428. package/dist/chunk-xszk7n10.js +14358 -0
  429. package/dist/chunk-xv3era3s.js +8 -0
  430. package/dist/chunk-xy0ep5zm.js +118 -0
  431. package/dist/chunk-xzxf08w0.js +247 -0
  432. package/dist/chunk-y1784krc.js +19 -0
  433. package/dist/chunk-y4cvymbk.js +2838 -0
  434. package/dist/chunk-y88sk42h.js +388 -0
  435. package/dist/chunk-y953qcc7.js +66 -0
  436. package/dist/chunk-ycgvqt42.js +178 -0
  437. package/dist/chunk-ycpq7mn5.js +644 -0
  438. package/dist/chunk-yfb6k7aw.js +94 -0
  439. package/dist/chunk-yp69m4qn.js +94 -0
  440. package/dist/chunk-ysvwcdav.js +9300 -0
  441. package/dist/chunk-ytvzxnx2.js +862 -0
  442. package/dist/chunk-ywxd4qw4.js +22 -0
  443. package/dist/chunk-yysj6sxt.js +336 -0
  444. package/dist/chunk-z2dp53wn.js +17 -0
  445. package/dist/chunk-zagmz9sy.js +247 -0
  446. package/dist/chunk-zbpm3xad.js +998 -0
  447. package/dist/chunk-zc6g0qqe.js +29 -0
  448. package/dist/chunk-zfavvrhe.js +753 -0
  449. package/dist/chunk-zk2wsm7d.js +15 -0
  450. package/dist/chunk-zrw9ava1.js +1391 -0
  451. package/dist/chunk-zsfxha74.js +17655 -0
  452. package/dist/chunk-ztmjzgq7.js +524 -0
  453. package/dist/chunk-zx7pgp71.js +20 -0
  454. package/dist/chunk-zz9km6hr.js +127 -0
  455. package/dist/cli.js +92 -0
  456. package/package.json +36 -0
@@ -0,0 +1,2645 @@
1
+ // @bun
2
+ import {
3
+ getAutoModeDenials,
4
+ init_autoModeDenials
5
+ } from "./chunk-0paqc2yw.js";
6
+ import {
7
+ SearchBox,
8
+ init_SearchBox,
9
+ init_useSearchInput,
10
+ useSearchInput
11
+ } from "./chunk-jpggn642.js";
12
+ import {
13
+ Tab,
14
+ Tabs,
15
+ init_Tabs,
16
+ useTabHeaderFocus,
17
+ useTabsWidth
18
+ } from "./chunk-a8x7bb4n.js";
19
+ import {
20
+ StatusIcon,
21
+ init_StatusIcon
22
+ } from "./chunk-76xdyehq.js";
23
+ import {
24
+ detectUnreachableRules,
25
+ init_shadowedRuleDetection
26
+ } from "./chunk-2534gszj.js";
27
+ import {
28
+ AddWorkspaceDirectory,
29
+ init_AddWorkspaceDirectory
30
+ } from "./chunk-w8gahavr.js";
31
+ import"./chunk-v90xv5n9.js";
32
+ import"./chunk-5zrajk5c.js";
33
+ import"./chunk-0et2fwnm.js";
34
+ import {
35
+ BashTool,
36
+ SandboxManager,
37
+ Select,
38
+ TextInput,
39
+ WebFetchTool,
40
+ applyPermissionUpdate,
41
+ createPermissionRetryMessage,
42
+ deletePermissionRule,
43
+ getAllowRules,
44
+ getAskRules,
45
+ getDenyRules,
46
+ init_AppState,
47
+ init_BashTool,
48
+ init_PermissionUpdate,
49
+ init_TextInput,
50
+ init_WebFetchTool,
51
+ init_messages1 as init_messages,
52
+ init_permissions,
53
+ init_sandbox_adapter,
54
+ init_select,
55
+ permissionRuleSourceDisplayString,
56
+ persistPermissionUpdate,
57
+ useAppState,
58
+ useSetAppState
59
+ } from "./chunk-5eecpt8g.js";
60
+ import"./chunk-czvztj44.js";
61
+ import"./chunk-46xsszyy.js";
62
+ import"./chunk-2zcggr61.js";
63
+ import"./chunk-q0q2tsae.js";
64
+ import"./chunk-t0rgmccj.js";
65
+ import {
66
+ Dialog,
67
+ init_Dialog
68
+ } from "./chunk-d9y2zh54.js";
69
+ import"./chunk-2gzv8nrw.js";
70
+ import"./chunk-ehtwnxpg.js";
71
+ import"./chunk-xffq0yyv.js";
72
+ import"./chunk-02gx6hwz.js";
73
+ import"./chunk-vhjx5fag.js";
74
+ import"./chunk-w2yzntwd.js";
75
+ import"./chunk-kdqsfmc5.js";
76
+ import"./chunk-j5hc27hv.js";
77
+ import"./chunk-cgfdkzhb.js";
78
+ import"./chunk-0fzmdbg5.js";
79
+ import {
80
+ init_useExitOnCtrlCDWithKeybindings,
81
+ useExitOnCtrlCDWithKeybindings
82
+ } from "./chunk-sn49y8be.js";
83
+ import"./chunk-9gbamk79.js";
84
+ import"./chunk-8rjvjb5t.js";
85
+ import"./chunk-gv0tqhg0.js";
86
+ import {
87
+ Pane,
88
+ init_Pane,
89
+ init_useKeybinding,
90
+ init_useTerminalSize,
91
+ useKeybinding,
92
+ useTerminalSize
93
+ } from "./chunk-nw5zdpcj.js";
94
+ import {
95
+ Newline,
96
+ ThemedBox_default,
97
+ ThemedText,
98
+ init_ink,
99
+ require_compiler_runtime,
100
+ useTerminalFocus,
101
+ use_input_default
102
+ } from "./chunk-aa3rx320.js";
103
+ import"./chunk-7m2nd8da.js";
104
+ import"./chunk-ps49ymvj.js";
105
+ import {
106
+ require_jsx_dev_runtime,
107
+ require_react
108
+ } from "./chunk-g338npwr.js";
109
+ import"./chunk-n2pzg3mt.js";
110
+ import"./chunk-zk2wsm7d.js";
111
+ import"./chunk-tdgkxc3j.js";
112
+ import"./chunk-7e6ahfxz.js";
113
+ import"./chunk-zrw9ava1.js";
114
+ import"./chunk-mx28h61f.js";
115
+ import {
116
+ SOURCES,
117
+ getRelativeSettingsFilePathForSource,
118
+ init_constants,
119
+ init_permissionRuleParser,
120
+ init_settings1 as init_settings,
121
+ init_source,
122
+ init_stringUtils,
123
+ permissionRuleValueFromString,
124
+ permissionRuleValueToString,
125
+ plural,
126
+ source_default
127
+ } from "./chunk-hgba8zda.js";
128
+ import"./chunk-eebcvtbb.js";
129
+ import"./chunk-xq4cfvpn.js";
130
+ import"./chunk-4qz9vbs1.js";
131
+ import"./chunk-gmaybtrd.js";
132
+ import"./chunk-b75fzr8e.js";
133
+ import"./chunk-g0j0t6qk.js";
134
+ import"./chunk-3c25bcsw.js";
135
+ import"./chunk-nj17bhkh.js";
136
+ import"./chunk-55wgxwa9.js";
137
+ import"./chunk-vqk1n5qr.js";
138
+ import"./chunk-4jm600zv.js";
139
+ import"./chunk-wn2268qd.js";
140
+ import"./chunk-vqvd3qz0.js";
141
+ import"./chunk-f5ma3nh5.js";
142
+ import"./chunk-qz2x630m.js";
143
+ import"./chunk-d9kz373t.js";
144
+ import"./chunk-p2816w9z.js";
145
+ import"./chunk-v9smspw2.js";
146
+ import"./chunk-v1kzp02e.js";
147
+ import"./chunk-0vkfrmqm.js";
148
+ import"./chunk-0xjaqda8.js";
149
+ import"./chunk-res15ktd.js";
150
+ import"./chunk-wgcssf6v.js";
151
+ import"./chunk-cdz5yb0r.js";
152
+ import"./chunk-h0rbjg6x.js";
153
+ import"./chunk-dstxhxsx.js";
154
+ import"./chunk-b8x1gk3y.js";
155
+ import"./chunk-9k2drwej.js";
156
+ import"./chunk-qnfx3qtx.js";
157
+ import"./chunk-fbpftpf0.js";
158
+ import"./chunk-3vs3nm7w.js";
159
+ import {
160
+ figures_default,
161
+ init_figures
162
+ } from "./chunk-gzzfhtdv.js";
163
+ import"./chunk-yysj6sxt.js";
164
+ import"./chunk-8tnsngw2.js";
165
+ import"./chunk-8bedvdm1.js";
166
+ import"./chunk-7wm5s02e.js";
167
+ import {
168
+ init_slowOperations,
169
+ jsonStringify
170
+ } from "./chunk-sbbj6ta3.js";
171
+ import"./chunk-fbv4apne.js";
172
+ import"./chunk-raqgs410.js";
173
+ import {
174
+ getOriginalCwd,
175
+ init_state
176
+ } from "./chunk-qqfa0dqg.js";
177
+ import"./chunk-hqmz36b3.js";
178
+ import"./chunk-4g3v8y12.js";
179
+ import"./chunk-7739pg2c.js";
180
+ import"./chunk-xszk7n10.js";
181
+ import"./chunk-sdj9b9wh.js";
182
+ import {
183
+ __esm,
184
+ __toESM
185
+ } from "./chunk-qp2qdcda.js";
186
+
187
+ // src/components/permissions/rules/PermissionRuleDescription.tsx
188
+ function PermissionRuleDescription(t0) {
189
+ const $ = import_compiler_runtime.c(9);
190
+ const {
191
+ ruleValue
192
+ } = t0;
193
+ switch (ruleValue.toolName) {
194
+ case BashTool.name: {
195
+ if (ruleValue.ruleContent) {
196
+ if (ruleValue.ruleContent.endsWith(":*")) {
197
+ let t1;
198
+ if ($[0] !== ruleValue.ruleContent) {
199
+ t1 = ruleValue.ruleContent.slice(0, -2);
200
+ $[0] = ruleValue.ruleContent;
201
+ $[1] = t1;
202
+ } else {
203
+ t1 = $[1];
204
+ }
205
+ let t2;
206
+ if ($[2] !== t1) {
207
+ t2 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
208
+ dimColor: true,
209
+ children: [
210
+ "Any Bash command starting with",
211
+ " ",
212
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
213
+ bold: true,
214
+ children: t1
215
+ }, undefined, false, undefined, this)
216
+ ]
217
+ }, undefined, true, undefined, this);
218
+ $[2] = t1;
219
+ $[3] = t2;
220
+ } else {
221
+ t2 = $[3];
222
+ }
223
+ return t2;
224
+ } else {
225
+ let t1;
226
+ if ($[4] !== ruleValue.ruleContent) {
227
+ t1 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
228
+ dimColor: true,
229
+ children: [
230
+ "The Bash command ",
231
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
232
+ bold: true,
233
+ children: ruleValue.ruleContent
234
+ }, undefined, false, undefined, this)
235
+ ]
236
+ }, undefined, true, undefined, this);
237
+ $[4] = ruleValue.ruleContent;
238
+ $[5] = t1;
239
+ } else {
240
+ t1 = $[5];
241
+ }
242
+ return t1;
243
+ }
244
+ } else {
245
+ let t1;
246
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
247
+ t1 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
248
+ dimColor: true,
249
+ children: "Any Bash command"
250
+ }, undefined, false, undefined, this);
251
+ $[6] = t1;
252
+ } else {
253
+ t1 = $[6];
254
+ }
255
+ return t1;
256
+ }
257
+ }
258
+ default: {
259
+ if (!ruleValue.ruleContent) {
260
+ let t1;
261
+ if ($[7] !== ruleValue.toolName) {
262
+ t1 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
263
+ dimColor: true,
264
+ children: [
265
+ "Any use of the ",
266
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
267
+ bold: true,
268
+ children: ruleValue.toolName
269
+ }, undefined, false, undefined, this),
270
+ " tool"
271
+ ]
272
+ }, undefined, true, undefined, this);
273
+ $[7] = ruleValue.toolName;
274
+ $[8] = t1;
275
+ } else {
276
+ t1 = $[8];
277
+ }
278
+ return t1;
279
+ } else {
280
+ return null;
281
+ }
282
+ }
283
+ }
284
+ }
285
+ var import_compiler_runtime, jsx_dev_runtime;
286
+ var init_PermissionRuleDescription = __esm(() => {
287
+ init_ink();
288
+ init_BashTool();
289
+ import_compiler_runtime = __toESM(require_compiler_runtime(), 1);
290
+ jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
291
+ });
292
+
293
+ // src/components/permissions/rules/AddPermissionRules.tsx
294
+ function optionForPermissionSaveDestination(saveDestination) {
295
+ switch (saveDestination) {
296
+ case "localSettings":
297
+ return {
298
+ label: "Project settings (local)",
299
+ description: `Saved in ${getRelativeSettingsFilePathForSource("localSettings")}`,
300
+ value: saveDestination
301
+ };
302
+ case "projectSettings":
303
+ return {
304
+ label: "Project settings",
305
+ description: `Checked in at ${getRelativeSettingsFilePathForSource("projectSettings")}`,
306
+ value: saveDestination
307
+ };
308
+ case "userSettings":
309
+ return {
310
+ label: "User settings",
311
+ description: `Saved in at ~/.claude/settings.json`,
312
+ value: saveDestination
313
+ };
314
+ }
315
+ }
316
+ function AddPermissionRules(t0) {
317
+ const $ = import_compiler_runtime2.c(26);
318
+ const {
319
+ onAddRules,
320
+ onCancel,
321
+ ruleValues,
322
+ ruleBehavior,
323
+ initialContext,
324
+ setToolPermissionContext
325
+ } = t0;
326
+ let t1;
327
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
328
+ t1 = SOURCES.map(optionForPermissionSaveDestination);
329
+ $[0] = t1;
330
+ } else {
331
+ t1 = $[0];
332
+ }
333
+ const allOptions = t1;
334
+ let t2;
335
+ if ($[1] !== initialContext || $[2] !== onAddRules || $[3] !== onCancel || $[4] !== ruleBehavior || $[5] !== ruleValues || $[6] !== setToolPermissionContext) {
336
+ t2 = (selectedValue) => {
337
+ if (selectedValue === "cancel") {
338
+ onCancel();
339
+ return;
340
+ } else {
341
+ if (SOURCES.includes(selectedValue)) {
342
+ const destination = selectedValue;
343
+ const updatedContext = applyPermissionUpdate(initialContext, {
344
+ type: "addRules",
345
+ rules: ruleValues,
346
+ behavior: ruleBehavior,
347
+ destination
348
+ });
349
+ persistPermissionUpdate({
350
+ type: "addRules",
351
+ rules: ruleValues,
352
+ behavior: ruleBehavior,
353
+ destination
354
+ });
355
+ setToolPermissionContext(updatedContext);
356
+ const rules = ruleValues.map((ruleValue) => ({
357
+ ruleValue,
358
+ ruleBehavior,
359
+ source: destination
360
+ }));
361
+ const sandboxAutoAllowEnabled = SandboxManager.isSandboxingEnabled() && SandboxManager.isAutoAllowBashIfSandboxedEnabled();
362
+ const allUnreachable = detectUnreachableRules(updatedContext, {
363
+ sandboxAutoAllowEnabled
364
+ });
365
+ const newUnreachable = allUnreachable.filter((u) => ruleValues.some((rv) => rv.toolName === u.rule.ruleValue.toolName && rv.ruleContent === u.rule.ruleValue.ruleContent));
366
+ onAddRules(rules, newUnreachable.length > 0 ? newUnreachable : undefined);
367
+ }
368
+ }
369
+ };
370
+ $[1] = initialContext;
371
+ $[2] = onAddRules;
372
+ $[3] = onCancel;
373
+ $[4] = ruleBehavior;
374
+ $[5] = ruleValues;
375
+ $[6] = setToolPermissionContext;
376
+ $[7] = t2;
377
+ } else {
378
+ t2 = $[7];
379
+ }
380
+ const onSelect = t2;
381
+ let t3;
382
+ if ($[8] !== ruleValues.length) {
383
+ t3 = plural(ruleValues.length, "rule");
384
+ $[8] = ruleValues.length;
385
+ $[9] = t3;
386
+ } else {
387
+ t3 = $[9];
388
+ }
389
+ const title = `Add ${ruleBehavior} permission ${t3}`;
390
+ let t4;
391
+ if ($[10] !== ruleValues) {
392
+ t4 = ruleValues.map(_temp);
393
+ $[10] = ruleValues;
394
+ $[11] = t4;
395
+ } else {
396
+ t4 = $[11];
397
+ }
398
+ let t5;
399
+ if ($[12] !== t4) {
400
+ t5 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
401
+ flexDirection: "column",
402
+ paddingX: 2,
403
+ children: t4
404
+ }, undefined, false, undefined, this);
405
+ $[12] = t4;
406
+ $[13] = t5;
407
+ } else {
408
+ t5 = $[13];
409
+ }
410
+ const t6 = ruleValues.length === 1 ? "Where should this rule be saved?" : "Where should these rules be saved?";
411
+ let t7;
412
+ if ($[14] !== t6) {
413
+ t7 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
414
+ children: t6
415
+ }, undefined, false, undefined, this);
416
+ $[14] = t6;
417
+ $[15] = t7;
418
+ } else {
419
+ t7 = $[15];
420
+ }
421
+ let t8;
422
+ if ($[16] !== onSelect) {
423
+ t8 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Select, {
424
+ options: allOptions,
425
+ onChange: onSelect
426
+ }, undefined, false, undefined, this);
427
+ $[16] = onSelect;
428
+ $[17] = t8;
429
+ } else {
430
+ t8 = $[17];
431
+ }
432
+ let t9;
433
+ if ($[18] !== t7 || $[19] !== t8) {
434
+ t9 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
435
+ flexDirection: "column",
436
+ marginY: 1,
437
+ children: [
438
+ t7,
439
+ t8
440
+ ]
441
+ }, undefined, true, undefined, this);
442
+ $[18] = t7;
443
+ $[19] = t8;
444
+ $[20] = t9;
445
+ } else {
446
+ t9 = $[20];
447
+ }
448
+ let t10;
449
+ if ($[21] !== onCancel || $[22] !== t5 || $[23] !== t9 || $[24] !== title) {
450
+ t10 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Dialog, {
451
+ title,
452
+ onCancel,
453
+ color: "permission",
454
+ children: [
455
+ t5,
456
+ t9
457
+ ]
458
+ }, undefined, true, undefined, this);
459
+ $[21] = onCancel;
460
+ $[22] = t5;
461
+ $[23] = t9;
462
+ $[24] = title;
463
+ $[25] = t10;
464
+ } else {
465
+ t10 = $[25];
466
+ }
467
+ return t10;
468
+ }
469
+ function _temp(ruleValue_0) {
470
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
471
+ flexDirection: "column",
472
+ children: [
473
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
474
+ bold: true,
475
+ children: permissionRuleValueToString(ruleValue_0)
476
+ }, undefined, false, undefined, this),
477
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(PermissionRuleDescription, {
478
+ ruleValue: ruleValue_0
479
+ }, undefined, false, undefined, this)
480
+ ]
481
+ }, permissionRuleValueToString(ruleValue_0), true, undefined, this);
482
+ }
483
+ var import_compiler_runtime2, jsx_dev_runtime2;
484
+ var init_AddPermissionRules = __esm(() => {
485
+ init_select();
486
+ init_ink();
487
+ init_PermissionUpdate();
488
+ init_permissionRuleParser();
489
+ init_shadowedRuleDetection();
490
+ init_sandbox_adapter();
491
+ init_constants();
492
+ init_settings();
493
+ init_stringUtils();
494
+ init_Dialog();
495
+ init_PermissionRuleDescription();
496
+ import_compiler_runtime2 = __toESM(require_compiler_runtime(), 1);
497
+ jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
498
+ });
499
+
500
+ // src/components/permissions/rules/PermissionRuleInput.tsx
501
+ function PermissionRuleInput(t0) {
502
+ const $ = import_compiler_runtime3.c(24);
503
+ const {
504
+ onCancel,
505
+ onSubmit,
506
+ ruleBehavior
507
+ } = t0;
508
+ const [inputValue, setInputValue] = import_react.useState("");
509
+ const [cursorOffset, setCursorOffset] = import_react.useState(0);
510
+ const exitState = useExitOnCtrlCDWithKeybindings();
511
+ let t1;
512
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
513
+ t1 = {
514
+ context: "Settings"
515
+ };
516
+ $[0] = t1;
517
+ } else {
518
+ t1 = $[0];
519
+ }
520
+ useKeybinding("confirm:no", onCancel, t1);
521
+ const {
522
+ columns
523
+ } = useTerminalSize();
524
+ const textInputColumns = columns - 6;
525
+ let t2;
526
+ if ($[1] !== onSubmit || $[2] !== ruleBehavior) {
527
+ t2 = (value) => {
528
+ const trimmedValue = value.trim();
529
+ if (trimmedValue.length === 0) {
530
+ return;
531
+ }
532
+ const ruleValue = permissionRuleValueFromString(trimmedValue);
533
+ onSubmit(ruleValue, ruleBehavior);
534
+ };
535
+ $[1] = onSubmit;
536
+ $[2] = ruleBehavior;
537
+ $[3] = t2;
538
+ } else {
539
+ t2 = $[3];
540
+ }
541
+ const handleSubmit = t2;
542
+ let t3;
543
+ if ($[4] !== ruleBehavior) {
544
+ t3 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
545
+ bold: true,
546
+ color: "permission",
547
+ children: [
548
+ "Add ",
549
+ ruleBehavior,
550
+ " permission rule"
551
+ ]
552
+ }, undefined, true, undefined, this);
553
+ $[4] = ruleBehavior;
554
+ $[5] = t3;
555
+ } else {
556
+ t3 = $[5];
557
+ }
558
+ let t4;
559
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
560
+ t4 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Newline, {}, undefined, false, undefined, this);
561
+ $[6] = t4;
562
+ } else {
563
+ t4 = $[6];
564
+ }
565
+ let t5;
566
+ let t6;
567
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
568
+ t5 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
569
+ bold: true,
570
+ children: permissionRuleValueToString({
571
+ toolName: WebFetchTool.name
572
+ })
573
+ }, undefined, false, undefined, this);
574
+ t6 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
575
+ bold: false,
576
+ children: " or "
577
+ }, undefined, false, undefined, this);
578
+ $[7] = t5;
579
+ $[8] = t6;
580
+ } else {
581
+ t5 = $[7];
582
+ t6 = $[8];
583
+ }
584
+ let t7;
585
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
586
+ t7 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
587
+ children: [
588
+ "Permission rules are a tool name, optionally followed by a specifier in parentheses.",
589
+ t4,
590
+ "e.g.,",
591
+ " ",
592
+ t5,
593
+ t6,
594
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
595
+ bold: true,
596
+ children: permissionRuleValueToString({
597
+ toolName: BashTool.name,
598
+ ruleContent: "ls:*"
599
+ })
600
+ }, undefined, false, undefined, this)
601
+ ]
602
+ }, undefined, true, undefined, this);
603
+ $[9] = t7;
604
+ } else {
605
+ t7 = $[9];
606
+ }
607
+ let t8;
608
+ if ($[10] !== cursorOffset || $[11] !== handleSubmit || $[12] !== inputValue || $[13] !== textInputColumns) {
609
+ t8 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
610
+ flexDirection: "column",
611
+ children: [
612
+ t7,
613
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
614
+ borderDimColor: true,
615
+ borderStyle: "round",
616
+ marginY: 1,
617
+ paddingLeft: 1,
618
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(TextInput, {
619
+ showCursor: true,
620
+ value: inputValue,
621
+ onChange: setInputValue,
622
+ onSubmit: handleSubmit,
623
+ placeholder: `Enter permission rule${figures_default.ellipsis}`,
624
+ columns: textInputColumns,
625
+ cursorOffset,
626
+ onChangeCursorOffset: setCursorOffset
627
+ }, undefined, false, undefined, this)
628
+ }, undefined, false, undefined, this)
629
+ ]
630
+ }, undefined, true, undefined, this);
631
+ $[10] = cursorOffset;
632
+ $[11] = handleSubmit;
633
+ $[12] = inputValue;
634
+ $[13] = textInputColumns;
635
+ $[14] = t8;
636
+ } else {
637
+ t8 = $[14];
638
+ }
639
+ let t9;
640
+ if ($[15] !== t3 || $[16] !== t8) {
641
+ t9 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
642
+ flexDirection: "column",
643
+ gap: 1,
644
+ borderStyle: "round",
645
+ paddingLeft: 1,
646
+ paddingRight: 1,
647
+ borderColor: "permission",
648
+ children: [
649
+ t3,
650
+ t8
651
+ ]
652
+ }, undefined, true, undefined, this);
653
+ $[15] = t3;
654
+ $[16] = t8;
655
+ $[17] = t9;
656
+ } else {
657
+ t9 = $[17];
658
+ }
659
+ let t10;
660
+ if ($[18] !== exitState.keyName || $[19] !== exitState.pending) {
661
+ t10 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
662
+ marginLeft: 3,
663
+ children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
664
+ dimColor: true,
665
+ children: [
666
+ "Press ",
667
+ exitState.keyName,
668
+ " again to exit"
669
+ ]
670
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
671
+ dimColor: true,
672
+ children: "Enter to submit \xB7 Esc to cancel"
673
+ }, undefined, false, undefined, this)
674
+ }, undefined, false, undefined, this);
675
+ $[18] = exitState.keyName;
676
+ $[19] = exitState.pending;
677
+ $[20] = t10;
678
+ } else {
679
+ t10 = $[20];
680
+ }
681
+ let t11;
682
+ if ($[21] !== t10 || $[22] !== t9) {
683
+ t11 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
684
+ children: [
685
+ t9,
686
+ t10
687
+ ]
688
+ }, undefined, true, undefined, this);
689
+ $[21] = t10;
690
+ $[22] = t9;
691
+ $[23] = t11;
692
+ } else {
693
+ t11 = $[23];
694
+ }
695
+ return t11;
696
+ }
697
+ var import_compiler_runtime3, import_react, jsx_dev_runtime3;
698
+ var init_PermissionRuleInput = __esm(() => {
699
+ init_figures();
700
+ init_TextInput();
701
+ init_useExitOnCtrlCDWithKeybindings();
702
+ init_useTerminalSize();
703
+ init_ink();
704
+ init_useKeybinding();
705
+ init_BashTool();
706
+ init_WebFetchTool();
707
+ init_permissionRuleParser();
708
+ import_compiler_runtime3 = __toESM(require_compiler_runtime(), 1);
709
+ import_react = __toESM(require_react(), 1);
710
+ jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
711
+ });
712
+
713
+ // src/components/permissions/rules/RecentDenialsTab.tsx
714
+ function RecentDenialsTab(t0) {
715
+ const $ = import_compiler_runtime4.c(30);
716
+ const {
717
+ onHeaderFocusChange,
718
+ onStateChange
719
+ } = t0;
720
+ const {
721
+ headerFocused,
722
+ focusHeader
723
+ } = useTabHeaderFocus();
724
+ let t1;
725
+ let t2;
726
+ if ($[0] !== headerFocused || $[1] !== onHeaderFocusChange) {
727
+ t1 = () => {
728
+ onHeaderFocusChange?.(headerFocused);
729
+ };
730
+ t2 = [headerFocused, onHeaderFocusChange];
731
+ $[0] = headerFocused;
732
+ $[1] = onHeaderFocusChange;
733
+ $[2] = t1;
734
+ $[3] = t2;
735
+ } else {
736
+ t1 = $[2];
737
+ t2 = $[3];
738
+ }
739
+ import_react2.useEffect(t1, t2);
740
+ const [denials] = import_react2.useState(_temp4);
741
+ const [approved, setApproved] = import_react2.useState(_temp2);
742
+ const [retry, setRetry] = import_react2.useState(_temp3);
743
+ const [focusedIdx, setFocusedIdx] = import_react2.useState(0);
744
+ let t3;
745
+ let t4;
746
+ if ($[4] !== approved || $[5] !== denials || $[6] !== onStateChange || $[7] !== retry) {
747
+ t3 = () => {
748
+ onStateChange({
749
+ approved,
750
+ retry,
751
+ denials
752
+ });
753
+ };
754
+ t4 = [approved, retry, denials, onStateChange];
755
+ $[4] = approved;
756
+ $[5] = denials;
757
+ $[6] = onStateChange;
758
+ $[7] = retry;
759
+ $[8] = t3;
760
+ $[9] = t4;
761
+ } else {
762
+ t3 = $[8];
763
+ t4 = $[9];
764
+ }
765
+ import_react2.useEffect(t3, t4);
766
+ let t5;
767
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
768
+ t5 = (value) => {
769
+ const idx = Number(value);
770
+ setApproved((prev) => {
771
+ const next = new Set(prev);
772
+ if (next.has(idx)) {
773
+ next.delete(idx);
774
+ } else {
775
+ next.add(idx);
776
+ }
777
+ return next;
778
+ });
779
+ };
780
+ $[10] = t5;
781
+ } else {
782
+ t5 = $[10];
783
+ }
784
+ const handleSelect = t5;
785
+ let t6;
786
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
787
+ t6 = (value_0) => {
788
+ setFocusedIdx(Number(value_0));
789
+ };
790
+ $[11] = t6;
791
+ } else {
792
+ t6 = $[11];
793
+ }
794
+ const handleFocus = t6;
795
+ let t7;
796
+ if ($[12] !== focusedIdx) {
797
+ t7 = (input, _key) => {
798
+ if (input === "r") {
799
+ setRetry((prev_0) => {
800
+ const next_0 = new Set(prev_0);
801
+ if (next_0.has(focusedIdx)) {
802
+ next_0.delete(focusedIdx);
803
+ } else {
804
+ next_0.add(focusedIdx);
805
+ }
806
+ return next_0;
807
+ });
808
+ setApproved((prev_1) => {
809
+ if (prev_1.has(focusedIdx)) {
810
+ return prev_1;
811
+ }
812
+ const next_1 = new Set(prev_1);
813
+ next_1.add(focusedIdx);
814
+ return next_1;
815
+ });
816
+ }
817
+ };
818
+ $[12] = focusedIdx;
819
+ $[13] = t7;
820
+ } else {
821
+ t7 = $[13];
822
+ }
823
+ const t8 = denials.length > 0;
824
+ let t9;
825
+ if ($[14] !== t8) {
826
+ t9 = {
827
+ isActive: t8
828
+ };
829
+ $[14] = t8;
830
+ $[15] = t9;
831
+ } else {
832
+ t9 = $[15];
833
+ }
834
+ use_input_default(t7, t9);
835
+ if (denials.length === 0) {
836
+ let t102;
837
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
838
+ t102 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
839
+ dimColor: true,
840
+ children: "No recent denials. Commands denied by the auto mode classifier will appear here."
841
+ }, undefined, false, undefined, this);
842
+ $[16] = t102;
843
+ } else {
844
+ t102 = $[16];
845
+ }
846
+ return t102;
847
+ }
848
+ let t10;
849
+ if ($[17] !== approved || $[18] !== denials || $[19] !== retry) {
850
+ let t112;
851
+ if ($[21] !== approved || $[22] !== retry) {
852
+ t112 = (d, idx_0) => {
853
+ const isApproved = approved.has(idx_0);
854
+ const suffix = retry.has(idx_0) ? " (retry)" : "";
855
+ return {
856
+ label: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
857
+ children: [
858
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(StatusIcon, {
859
+ status: isApproved ? "success" : "error",
860
+ withSpace: true
861
+ }, undefined, false, undefined, this),
862
+ d.display,
863
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
864
+ dimColor: true,
865
+ children: suffix
866
+ }, undefined, false, undefined, this)
867
+ ]
868
+ }, undefined, true, undefined, this),
869
+ value: String(idx_0)
870
+ };
871
+ };
872
+ $[21] = approved;
873
+ $[22] = retry;
874
+ $[23] = t112;
875
+ } else {
876
+ t112 = $[23];
877
+ }
878
+ t10 = denials.map(t112);
879
+ $[17] = approved;
880
+ $[18] = denials;
881
+ $[19] = retry;
882
+ $[20] = t10;
883
+ } else {
884
+ t10 = $[20];
885
+ }
886
+ const options = t10;
887
+ let t11;
888
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
889
+ t11 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
890
+ children: "Commands recently denied by the auto mode classifier."
891
+ }, undefined, false, undefined, this);
892
+ $[24] = t11;
893
+ } else {
894
+ t11 = $[24];
895
+ }
896
+ const t12 = Math.min(10, options.length);
897
+ let t13;
898
+ if ($[25] !== focusHeader || $[26] !== headerFocused || $[27] !== options || $[28] !== t12) {
899
+ t13 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
900
+ flexDirection: "column",
901
+ children: [
902
+ t11,
903
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
904
+ marginTop: 1,
905
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Select, {
906
+ options,
907
+ onChange: handleSelect,
908
+ onFocus: handleFocus,
909
+ visibleOptionCount: t12,
910
+ isDisabled: headerFocused,
911
+ onUpFromFirstItem: focusHeader
912
+ }, undefined, false, undefined, this)
913
+ }, undefined, false, undefined, this)
914
+ ]
915
+ }, undefined, true, undefined, this);
916
+ $[25] = focusHeader;
917
+ $[26] = headerFocused;
918
+ $[27] = options;
919
+ $[28] = t12;
920
+ $[29] = t13;
921
+ } else {
922
+ t13 = $[29];
923
+ }
924
+ return t13;
925
+ }
926
+ function _temp3() {
927
+ return new Set;
928
+ }
929
+ function _temp2() {
930
+ return new Set;
931
+ }
932
+ function _temp4() {
933
+ return getAutoModeDenials();
934
+ }
935
+ var import_compiler_runtime4, import_react2, jsx_dev_runtime4;
936
+ var init_RecentDenialsTab = __esm(() => {
937
+ init_ink();
938
+ init_autoModeDenials();
939
+ init_select();
940
+ init_StatusIcon();
941
+ init_Tabs();
942
+ import_compiler_runtime4 = __toESM(require_compiler_runtime(), 1);
943
+ import_react2 = __toESM(require_react(), 1);
944
+ jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
945
+ });
946
+
947
+ // src/components/permissions/rules/RemoveWorkspaceDirectory.tsx
948
+ function RemoveWorkspaceDirectory(t0) {
949
+ const $ = import_compiler_runtime5.c(19);
950
+ const {
951
+ directoryPath,
952
+ onRemove,
953
+ onCancel,
954
+ permissionContext,
955
+ setPermissionContext
956
+ } = t0;
957
+ let t1;
958
+ if ($[0] !== directoryPath || $[1] !== onRemove || $[2] !== permissionContext || $[3] !== setPermissionContext) {
959
+ t1 = () => {
960
+ const updatedContext = applyPermissionUpdate(permissionContext, {
961
+ type: "removeDirectories",
962
+ directories: [directoryPath],
963
+ destination: "session"
964
+ });
965
+ setPermissionContext(updatedContext);
966
+ onRemove();
967
+ };
968
+ $[0] = directoryPath;
969
+ $[1] = onRemove;
970
+ $[2] = permissionContext;
971
+ $[3] = setPermissionContext;
972
+ $[4] = t1;
973
+ } else {
974
+ t1 = $[4];
975
+ }
976
+ const handleRemove = t1;
977
+ let t2;
978
+ if ($[5] !== handleRemove || $[6] !== onCancel) {
979
+ t2 = (value) => {
980
+ if (value === "yes") {
981
+ handleRemove();
982
+ } else {
983
+ onCancel();
984
+ }
985
+ };
986
+ $[5] = handleRemove;
987
+ $[6] = onCancel;
988
+ $[7] = t2;
989
+ } else {
990
+ t2 = $[7];
991
+ }
992
+ const handleSelect = t2;
993
+ let t3;
994
+ if ($[8] !== directoryPath) {
995
+ t3 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
996
+ marginX: 2,
997
+ flexDirection: "column",
998
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
999
+ bold: true,
1000
+ children: directoryPath
1001
+ }, undefined, false, undefined, this)
1002
+ }, undefined, false, undefined, this);
1003
+ $[8] = directoryPath;
1004
+ $[9] = t3;
1005
+ } else {
1006
+ t3 = $[9];
1007
+ }
1008
+ let t4;
1009
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
1010
+ t4 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1011
+ children: "Claude Code will no longer have access to files in this directory."
1012
+ }, undefined, false, undefined, this);
1013
+ $[10] = t4;
1014
+ } else {
1015
+ t4 = $[10];
1016
+ }
1017
+ let t5;
1018
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
1019
+ t5 = [{
1020
+ label: "Yes",
1021
+ value: "yes"
1022
+ }, {
1023
+ label: "No",
1024
+ value: "no"
1025
+ }];
1026
+ $[11] = t5;
1027
+ } else {
1028
+ t5 = $[11];
1029
+ }
1030
+ let t6;
1031
+ if ($[12] !== handleSelect || $[13] !== onCancel) {
1032
+ t6 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Select, {
1033
+ onChange: handleSelect,
1034
+ onCancel,
1035
+ options: t5
1036
+ }, undefined, false, undefined, this);
1037
+ $[12] = handleSelect;
1038
+ $[13] = onCancel;
1039
+ $[14] = t6;
1040
+ } else {
1041
+ t6 = $[14];
1042
+ }
1043
+ let t7;
1044
+ if ($[15] !== onCancel || $[16] !== t3 || $[17] !== t6) {
1045
+ t7 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Dialog, {
1046
+ title: "Remove directory from workspace?",
1047
+ onCancel,
1048
+ color: "error",
1049
+ children: [
1050
+ t3,
1051
+ t4,
1052
+ t6
1053
+ ]
1054
+ }, undefined, true, undefined, this);
1055
+ $[15] = onCancel;
1056
+ $[16] = t3;
1057
+ $[17] = t6;
1058
+ $[18] = t7;
1059
+ } else {
1060
+ t7 = $[18];
1061
+ }
1062
+ return t7;
1063
+ }
1064
+ var import_compiler_runtime5, jsx_dev_runtime5;
1065
+ var init_RemoveWorkspaceDirectory = __esm(() => {
1066
+ init_select();
1067
+ init_ink();
1068
+ init_PermissionUpdate();
1069
+ init_Dialog();
1070
+ import_compiler_runtime5 = __toESM(require_compiler_runtime(), 1);
1071
+ jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
1072
+ });
1073
+
1074
+ // src/components/permissions/rules/WorkspaceTab.tsx
1075
+ function WorkspaceTab(t0) {
1076
+ const $ = import_compiler_runtime6.c(23);
1077
+ const {
1078
+ onExit,
1079
+ toolPermissionContext,
1080
+ onRequestAddDirectory,
1081
+ onRequestRemoveDirectory,
1082
+ onHeaderFocusChange
1083
+ } = t0;
1084
+ const {
1085
+ headerFocused,
1086
+ focusHeader
1087
+ } = useTabHeaderFocus();
1088
+ let t1;
1089
+ let t2;
1090
+ if ($[0] !== headerFocused || $[1] !== onHeaderFocusChange) {
1091
+ t1 = () => {
1092
+ onHeaderFocusChange?.(headerFocused);
1093
+ };
1094
+ t2 = [headerFocused, onHeaderFocusChange];
1095
+ $[0] = headerFocused;
1096
+ $[1] = onHeaderFocusChange;
1097
+ $[2] = t1;
1098
+ $[3] = t2;
1099
+ } else {
1100
+ t1 = $[2];
1101
+ t2 = $[3];
1102
+ }
1103
+ import_react3.useEffect(t1, t2);
1104
+ let t3;
1105
+ if ($[4] !== toolPermissionContext.additionalWorkingDirectories) {
1106
+ t3 = Array.from(toolPermissionContext.additionalWorkingDirectories.keys()).map(_temp6);
1107
+ $[4] = toolPermissionContext.additionalWorkingDirectories;
1108
+ $[5] = t3;
1109
+ } else {
1110
+ t3 = $[5];
1111
+ }
1112
+ const additionalDirectories = t3;
1113
+ let t4;
1114
+ if ($[6] !== additionalDirectories || $[7] !== onRequestAddDirectory || $[8] !== onRequestRemoveDirectory) {
1115
+ t4 = (selectedValue) => {
1116
+ if (selectedValue === "add-directory") {
1117
+ onRequestAddDirectory();
1118
+ return;
1119
+ }
1120
+ const directory = additionalDirectories.find((d) => d.path === selectedValue);
1121
+ if (directory && directory.isDeletable) {
1122
+ onRequestRemoveDirectory(directory.path);
1123
+ }
1124
+ };
1125
+ $[6] = additionalDirectories;
1126
+ $[7] = onRequestAddDirectory;
1127
+ $[8] = onRequestRemoveDirectory;
1128
+ $[9] = t4;
1129
+ } else {
1130
+ t4 = $[9];
1131
+ }
1132
+ const handleDirectorySelect = t4;
1133
+ let t5;
1134
+ if ($[10] !== onExit) {
1135
+ t5 = () => onExit("Workspace dialog dismissed", {
1136
+ display: "system"
1137
+ });
1138
+ $[10] = onExit;
1139
+ $[11] = t5;
1140
+ } else {
1141
+ t5 = $[11];
1142
+ }
1143
+ const handleCancel = t5;
1144
+ let opts;
1145
+ if ($[12] !== additionalDirectories) {
1146
+ opts = additionalDirectories.map(_temp22);
1147
+ let t62;
1148
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
1149
+ t62 = {
1150
+ label: `Add directory${figures_default.ellipsis}`,
1151
+ value: "add-directory"
1152
+ };
1153
+ $[14] = t62;
1154
+ } else {
1155
+ t62 = $[14];
1156
+ }
1157
+ opts.push(t62);
1158
+ $[12] = additionalDirectories;
1159
+ $[13] = opts;
1160
+ } else {
1161
+ opts = $[13];
1162
+ }
1163
+ const options = opts;
1164
+ let t6;
1165
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
1166
+ t6 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1167
+ flexDirection: "row",
1168
+ marginTop: 1,
1169
+ marginLeft: 2,
1170
+ gap: 1,
1171
+ children: [
1172
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1173
+ children: `- ${getOriginalCwd()}`
1174
+ }, undefined, false, undefined, this),
1175
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1176
+ dimColor: true,
1177
+ children: "(Original working directory)"
1178
+ }, undefined, false, undefined, this)
1179
+ ]
1180
+ }, undefined, true, undefined, this);
1181
+ $[15] = t6;
1182
+ } else {
1183
+ t6 = $[15];
1184
+ }
1185
+ const t7 = Math.min(10, options.length);
1186
+ let t8;
1187
+ if ($[16] !== focusHeader || $[17] !== handleCancel || $[18] !== handleDirectorySelect || $[19] !== headerFocused || $[20] !== options || $[21] !== t7) {
1188
+ t8 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1189
+ flexDirection: "column",
1190
+ marginBottom: 1,
1191
+ children: [
1192
+ t6,
1193
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Select, {
1194
+ options,
1195
+ onChange: handleDirectorySelect,
1196
+ onCancel: handleCancel,
1197
+ visibleOptionCount: t7,
1198
+ onUpFromFirstItem: focusHeader,
1199
+ isDisabled: headerFocused
1200
+ }, undefined, false, undefined, this)
1201
+ ]
1202
+ }, undefined, true, undefined, this);
1203
+ $[16] = focusHeader;
1204
+ $[17] = handleCancel;
1205
+ $[18] = handleDirectorySelect;
1206
+ $[19] = headerFocused;
1207
+ $[20] = options;
1208
+ $[21] = t7;
1209
+ $[22] = t8;
1210
+ } else {
1211
+ t8 = $[22];
1212
+ }
1213
+ return t8;
1214
+ }
1215
+ function _temp22(dir) {
1216
+ return {
1217
+ label: dir.path,
1218
+ value: dir.path
1219
+ };
1220
+ }
1221
+ function _temp6(path) {
1222
+ return {
1223
+ path,
1224
+ isCurrent: false,
1225
+ isDeletable: true
1226
+ };
1227
+ }
1228
+ var import_compiler_runtime6, import_react3, jsx_dev_runtime6;
1229
+ var init_WorkspaceTab = __esm(() => {
1230
+ init_figures();
1231
+ init_state();
1232
+ init_select();
1233
+ init_ink();
1234
+ init_Tabs();
1235
+ import_compiler_runtime6 = __toESM(require_compiler_runtime(), 1);
1236
+ import_react3 = __toESM(require_react(), 1);
1237
+ jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
1238
+ });
1239
+
1240
+ // src/components/permissions/rules/PermissionRuleList.tsx
1241
+ function RuleSourceText(t0) {
1242
+ const $ = import_compiler_runtime7.c(4);
1243
+ const {
1244
+ rule
1245
+ } = t0;
1246
+ let t1;
1247
+ if ($[0] !== rule.source) {
1248
+ t1 = permissionRuleSourceDisplayString(rule.source);
1249
+ $[0] = rule.source;
1250
+ $[1] = t1;
1251
+ } else {
1252
+ t1 = $[1];
1253
+ }
1254
+ const t2 = `From ${t1}`;
1255
+ let t3;
1256
+ if ($[2] !== t2) {
1257
+ t3 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1258
+ dimColor: true,
1259
+ children: t2
1260
+ }, undefined, false, undefined, this);
1261
+ $[2] = t2;
1262
+ $[3] = t3;
1263
+ } else {
1264
+ t3 = $[3];
1265
+ }
1266
+ return t3;
1267
+ }
1268
+ function getRuleBehaviorLabel(ruleBehavior) {
1269
+ switch (ruleBehavior) {
1270
+ case "allow":
1271
+ return "allowed";
1272
+ case "deny":
1273
+ return "denied";
1274
+ case "ask":
1275
+ return "ask";
1276
+ }
1277
+ }
1278
+ function RuleDetails(t0) {
1279
+ const $ = import_compiler_runtime7.c(42);
1280
+ const {
1281
+ rule,
1282
+ onDelete,
1283
+ onCancel
1284
+ } = t0;
1285
+ const exitState = useExitOnCtrlCDWithKeybindings();
1286
+ let t1;
1287
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1288
+ t1 = {
1289
+ context: "Confirmation"
1290
+ };
1291
+ $[0] = t1;
1292
+ } else {
1293
+ t1 = $[0];
1294
+ }
1295
+ useKeybinding("confirm:no", onCancel, t1);
1296
+ let t2;
1297
+ if ($[1] !== rule.ruleValue) {
1298
+ t2 = permissionRuleValueToString(rule.ruleValue);
1299
+ $[1] = rule.ruleValue;
1300
+ $[2] = t2;
1301
+ } else {
1302
+ t2 = $[2];
1303
+ }
1304
+ let t3;
1305
+ if ($[3] !== t2) {
1306
+ t3 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1307
+ bold: true,
1308
+ children: t2
1309
+ }, undefined, false, undefined, this);
1310
+ $[3] = t2;
1311
+ $[4] = t3;
1312
+ } else {
1313
+ t3 = $[4];
1314
+ }
1315
+ let t4;
1316
+ if ($[5] !== rule.ruleValue) {
1317
+ t4 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRuleDescription, {
1318
+ ruleValue: rule.ruleValue
1319
+ }, undefined, false, undefined, this);
1320
+ $[5] = rule.ruleValue;
1321
+ $[6] = t4;
1322
+ } else {
1323
+ t4 = $[6];
1324
+ }
1325
+ let t5;
1326
+ if ($[7] !== rule) {
1327
+ t5 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RuleSourceText, {
1328
+ rule
1329
+ }, undefined, false, undefined, this);
1330
+ $[7] = rule;
1331
+ $[8] = t5;
1332
+ } else {
1333
+ t5 = $[8];
1334
+ }
1335
+ let t6;
1336
+ if ($[9] !== t3 || $[10] !== t4 || $[11] !== t5) {
1337
+ t6 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1338
+ flexDirection: "column",
1339
+ marginX: 2,
1340
+ children: [
1341
+ t3,
1342
+ t4,
1343
+ t5
1344
+ ]
1345
+ }, undefined, true, undefined, this);
1346
+ $[9] = t3;
1347
+ $[10] = t4;
1348
+ $[11] = t5;
1349
+ $[12] = t6;
1350
+ } else {
1351
+ t6 = $[12];
1352
+ }
1353
+ const ruleDescription = t6;
1354
+ let t7;
1355
+ if ($[13] !== exitState.keyName || $[14] !== exitState.pending) {
1356
+ t7 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1357
+ marginLeft: 3,
1358
+ children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1359
+ dimColor: true,
1360
+ children: [
1361
+ "Press ",
1362
+ exitState.keyName,
1363
+ " again to exit"
1364
+ ]
1365
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1366
+ dimColor: true,
1367
+ children: "Esc to cancel"
1368
+ }, undefined, false, undefined, this)
1369
+ }, undefined, false, undefined, this);
1370
+ $[13] = exitState.keyName;
1371
+ $[14] = exitState.pending;
1372
+ $[15] = t7;
1373
+ } else {
1374
+ t7 = $[15];
1375
+ }
1376
+ const footer = t7;
1377
+ if (rule.source === "policySettings") {
1378
+ let t82;
1379
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
1380
+ t82 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1381
+ bold: true,
1382
+ color: "permission",
1383
+ children: "Rule details"
1384
+ }, undefined, false, undefined, this);
1385
+ $[16] = t82;
1386
+ } else {
1387
+ t82 = $[16];
1388
+ }
1389
+ let t92;
1390
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
1391
+ t92 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1392
+ italic: true,
1393
+ children: [
1394
+ "This rule is configured by managed settings and cannot be modified.",
1395
+ `
1396
+ `,
1397
+ "Contact your system administrator for more information."
1398
+ ]
1399
+ }, undefined, true, undefined, this);
1400
+ $[17] = t92;
1401
+ } else {
1402
+ t92 = $[17];
1403
+ }
1404
+ let t102;
1405
+ if ($[18] !== ruleDescription) {
1406
+ t102 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1407
+ flexDirection: "column",
1408
+ gap: 1,
1409
+ borderStyle: "round",
1410
+ paddingLeft: 1,
1411
+ paddingRight: 1,
1412
+ borderColor: "permission",
1413
+ children: [
1414
+ t82,
1415
+ ruleDescription,
1416
+ t92
1417
+ ]
1418
+ }, undefined, true, undefined, this);
1419
+ $[18] = ruleDescription;
1420
+ $[19] = t102;
1421
+ } else {
1422
+ t102 = $[19];
1423
+ }
1424
+ let t112;
1425
+ if ($[20] !== footer || $[21] !== t102) {
1426
+ t112 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
1427
+ children: [
1428
+ t102,
1429
+ footer
1430
+ ]
1431
+ }, undefined, true, undefined, this);
1432
+ $[20] = footer;
1433
+ $[21] = t102;
1434
+ $[22] = t112;
1435
+ } else {
1436
+ t112 = $[22];
1437
+ }
1438
+ return t112;
1439
+ }
1440
+ let t8;
1441
+ if ($[23] !== rule.ruleBehavior) {
1442
+ t8 = getRuleBehaviorLabel(rule.ruleBehavior);
1443
+ $[23] = rule.ruleBehavior;
1444
+ $[24] = t8;
1445
+ } else {
1446
+ t8 = $[24];
1447
+ }
1448
+ let t9;
1449
+ if ($[25] !== t8) {
1450
+ t9 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1451
+ bold: true,
1452
+ color: "error",
1453
+ children: [
1454
+ "Delete ",
1455
+ t8,
1456
+ " tool?"
1457
+ ]
1458
+ }, undefined, true, undefined, this);
1459
+ $[25] = t8;
1460
+ $[26] = t9;
1461
+ } else {
1462
+ t9 = $[26];
1463
+ }
1464
+ let t10;
1465
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
1466
+ t10 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1467
+ children: "Are you sure you want to delete this permission rule?"
1468
+ }, undefined, false, undefined, this);
1469
+ $[27] = t10;
1470
+ } else {
1471
+ t10 = $[27];
1472
+ }
1473
+ let t11;
1474
+ if ($[28] !== onCancel || $[29] !== onDelete) {
1475
+ t11 = (_) => _ === "yes" ? onDelete() : onCancel();
1476
+ $[28] = onCancel;
1477
+ $[29] = onDelete;
1478
+ $[30] = t11;
1479
+ } else {
1480
+ t11 = $[30];
1481
+ }
1482
+ let t12;
1483
+ if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
1484
+ t12 = [{
1485
+ label: "Yes",
1486
+ value: "yes"
1487
+ }, {
1488
+ label: "No",
1489
+ value: "no"
1490
+ }];
1491
+ $[31] = t12;
1492
+ } else {
1493
+ t12 = $[31];
1494
+ }
1495
+ let t13;
1496
+ if ($[32] !== onCancel || $[33] !== t11) {
1497
+ t13 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Select, {
1498
+ onChange: t11,
1499
+ onCancel,
1500
+ options: t12
1501
+ }, undefined, false, undefined, this);
1502
+ $[32] = onCancel;
1503
+ $[33] = t11;
1504
+ $[34] = t13;
1505
+ } else {
1506
+ t13 = $[34];
1507
+ }
1508
+ let t14;
1509
+ if ($[35] !== ruleDescription || $[36] !== t13 || $[37] !== t9) {
1510
+ t14 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1511
+ flexDirection: "column",
1512
+ gap: 1,
1513
+ borderStyle: "round",
1514
+ paddingLeft: 1,
1515
+ paddingRight: 1,
1516
+ borderColor: "error",
1517
+ children: [
1518
+ t9,
1519
+ ruleDescription,
1520
+ t10,
1521
+ t13
1522
+ ]
1523
+ }, undefined, true, undefined, this);
1524
+ $[35] = ruleDescription;
1525
+ $[36] = t13;
1526
+ $[37] = t9;
1527
+ $[38] = t14;
1528
+ } else {
1529
+ t14 = $[38];
1530
+ }
1531
+ let t15;
1532
+ if ($[39] !== footer || $[40] !== t14) {
1533
+ t15 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
1534
+ children: [
1535
+ t14,
1536
+ footer
1537
+ ]
1538
+ }, undefined, true, undefined, this);
1539
+ $[39] = footer;
1540
+ $[40] = t14;
1541
+ $[41] = t15;
1542
+ } else {
1543
+ t15 = $[41];
1544
+ }
1545
+ return t15;
1546
+ }
1547
+ function RulesTabContent(props) {
1548
+ const $ = import_compiler_runtime7.c(26);
1549
+ const {
1550
+ options,
1551
+ searchQuery,
1552
+ isSearchMode,
1553
+ isFocused,
1554
+ onSelect,
1555
+ onCancel,
1556
+ lastFocusedRuleKey,
1557
+ cursorOffset,
1558
+ onHeaderFocusChange
1559
+ } = props;
1560
+ const tabWidth = useTabsWidth();
1561
+ const {
1562
+ headerFocused,
1563
+ focusHeader,
1564
+ blurHeader
1565
+ } = useTabHeaderFocus();
1566
+ let t0;
1567
+ let t1;
1568
+ if ($[0] !== blurHeader || $[1] !== headerFocused || $[2] !== isSearchMode) {
1569
+ t0 = () => {
1570
+ if (isSearchMode && headerFocused) {
1571
+ blurHeader();
1572
+ }
1573
+ };
1574
+ t1 = [isSearchMode, headerFocused, blurHeader];
1575
+ $[0] = blurHeader;
1576
+ $[1] = headerFocused;
1577
+ $[2] = isSearchMode;
1578
+ $[3] = t0;
1579
+ $[4] = t1;
1580
+ } else {
1581
+ t0 = $[3];
1582
+ t1 = $[4];
1583
+ }
1584
+ import_react4.useEffect(t0, t1);
1585
+ let t2;
1586
+ let t3;
1587
+ if ($[5] !== headerFocused || $[6] !== onHeaderFocusChange) {
1588
+ t2 = () => {
1589
+ onHeaderFocusChange?.(headerFocused);
1590
+ };
1591
+ t3 = [headerFocused, onHeaderFocusChange];
1592
+ $[5] = headerFocused;
1593
+ $[6] = onHeaderFocusChange;
1594
+ $[7] = t2;
1595
+ $[8] = t3;
1596
+ } else {
1597
+ t2 = $[7];
1598
+ t3 = $[8];
1599
+ }
1600
+ import_react4.useEffect(t2, t3);
1601
+ const t4 = isSearchMode && !headerFocused;
1602
+ let t5;
1603
+ if ($[9] !== cursorOffset || $[10] !== isFocused || $[11] !== searchQuery || $[12] !== t4 || $[13] !== tabWidth) {
1604
+ t5 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1605
+ marginBottom: 1,
1606
+ flexDirection: "column",
1607
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(SearchBox, {
1608
+ query: searchQuery,
1609
+ isFocused: t4,
1610
+ isTerminalFocused: isFocused,
1611
+ width: tabWidth,
1612
+ cursorOffset
1613
+ }, undefined, false, undefined, this)
1614
+ }, undefined, false, undefined, this);
1615
+ $[9] = cursorOffset;
1616
+ $[10] = isFocused;
1617
+ $[11] = searchQuery;
1618
+ $[12] = t4;
1619
+ $[13] = tabWidth;
1620
+ $[14] = t5;
1621
+ } else {
1622
+ t5 = $[14];
1623
+ }
1624
+ const t6 = Math.min(10, options.length);
1625
+ const t7 = isSearchMode || headerFocused;
1626
+ let t8;
1627
+ if ($[15] !== focusHeader || $[16] !== lastFocusedRuleKey || $[17] !== onCancel || $[18] !== onSelect || $[19] !== options || $[20] !== t6 || $[21] !== t7) {
1628
+ t8 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Select, {
1629
+ options,
1630
+ onChange: onSelect,
1631
+ onCancel,
1632
+ visibleOptionCount: t6,
1633
+ isDisabled: t7,
1634
+ defaultFocusValue: lastFocusedRuleKey,
1635
+ onUpFromFirstItem: focusHeader
1636
+ }, undefined, false, undefined, this);
1637
+ $[15] = focusHeader;
1638
+ $[16] = lastFocusedRuleKey;
1639
+ $[17] = onCancel;
1640
+ $[18] = onSelect;
1641
+ $[19] = options;
1642
+ $[20] = t6;
1643
+ $[21] = t7;
1644
+ $[22] = t8;
1645
+ } else {
1646
+ t8 = $[22];
1647
+ }
1648
+ let t9;
1649
+ if ($[23] !== t5 || $[24] !== t8) {
1650
+ t9 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1651
+ flexDirection: "column",
1652
+ children: [
1653
+ t5,
1654
+ t8
1655
+ ]
1656
+ }, undefined, true, undefined, this);
1657
+ $[23] = t5;
1658
+ $[24] = t8;
1659
+ $[25] = t9;
1660
+ } else {
1661
+ t9 = $[25];
1662
+ }
1663
+ return t9;
1664
+ }
1665
+ function PermissionRulesTab(t0) {
1666
+ const $ = import_compiler_runtime7.c(27);
1667
+ let T0;
1668
+ let T1;
1669
+ let handleToolSelect;
1670
+ let rulesProps;
1671
+ let t1;
1672
+ let t2;
1673
+ let t3;
1674
+ let t4;
1675
+ let tab;
1676
+ if ($[0] !== t0) {
1677
+ const {
1678
+ tab: t52,
1679
+ getRulesOptions,
1680
+ handleToolSelect: t62,
1681
+ ...t72
1682
+ } = t0;
1683
+ tab = t52;
1684
+ handleToolSelect = t62;
1685
+ rulesProps = t72;
1686
+ T1 = ThemedBox_default;
1687
+ t2 = "column";
1688
+ t3 = tab === "allow" ? 0 : undefined;
1689
+ let t8;
1690
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
1691
+ t8 = {
1692
+ allow: "Claude Code won't ask before using allowed tools.",
1693
+ ask: "Claude Code will always ask for confirmation before using these tools.",
1694
+ deny: "Claude Code will always reject requests to use denied tools."
1695
+ };
1696
+ $[10] = t8;
1697
+ } else {
1698
+ t8 = $[10];
1699
+ }
1700
+ const t9 = t8[tab];
1701
+ if ($[11] !== t9) {
1702
+ t4 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1703
+ children: t9
1704
+ }, undefined, false, undefined, this);
1705
+ $[11] = t9;
1706
+ $[12] = t4;
1707
+ } else {
1708
+ t4 = $[12];
1709
+ }
1710
+ T0 = RulesTabContent;
1711
+ t1 = getRulesOptions(tab, rulesProps.searchQuery);
1712
+ $[0] = t0;
1713
+ $[1] = T0;
1714
+ $[2] = T1;
1715
+ $[3] = handleToolSelect;
1716
+ $[4] = rulesProps;
1717
+ $[5] = t1;
1718
+ $[6] = t2;
1719
+ $[7] = t3;
1720
+ $[8] = t4;
1721
+ $[9] = tab;
1722
+ } else {
1723
+ T0 = $[1];
1724
+ T1 = $[2];
1725
+ handleToolSelect = $[3];
1726
+ rulesProps = $[4];
1727
+ t1 = $[5];
1728
+ t2 = $[6];
1729
+ t3 = $[7];
1730
+ t4 = $[8];
1731
+ tab = $[9];
1732
+ }
1733
+ let t5;
1734
+ if ($[13] !== handleToolSelect || $[14] !== tab) {
1735
+ t5 = (v) => handleToolSelect(v, tab);
1736
+ $[13] = handleToolSelect;
1737
+ $[14] = tab;
1738
+ $[15] = t5;
1739
+ } else {
1740
+ t5 = $[15];
1741
+ }
1742
+ let t6;
1743
+ if ($[16] !== T0 || $[17] !== rulesProps || $[18] !== t1.options || $[19] !== t5) {
1744
+ t6 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(T0, {
1745
+ options: t1.options,
1746
+ onSelect: t5,
1747
+ ...rulesProps
1748
+ }, undefined, false, undefined, this);
1749
+ $[16] = T0;
1750
+ $[17] = rulesProps;
1751
+ $[18] = t1.options;
1752
+ $[19] = t5;
1753
+ $[20] = t6;
1754
+ } else {
1755
+ t6 = $[20];
1756
+ }
1757
+ let t7;
1758
+ if ($[21] !== T1 || $[22] !== t2 || $[23] !== t3 || $[24] !== t4 || $[25] !== t6) {
1759
+ t7 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(T1, {
1760
+ flexDirection: t2,
1761
+ flexShrink: t3,
1762
+ children: [
1763
+ t4,
1764
+ t6
1765
+ ]
1766
+ }, undefined, true, undefined, this);
1767
+ $[21] = T1;
1768
+ $[22] = t2;
1769
+ $[23] = t3;
1770
+ $[24] = t4;
1771
+ $[25] = t6;
1772
+ $[26] = t7;
1773
+ } else {
1774
+ t7 = $[26];
1775
+ }
1776
+ return t7;
1777
+ }
1778
+ function PermissionRuleList(t0) {
1779
+ const $ = import_compiler_runtime7.c(113);
1780
+ const {
1781
+ onExit,
1782
+ initialTab,
1783
+ onRetryDenials
1784
+ } = t0;
1785
+ let t1;
1786
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1787
+ t1 = getAutoModeDenials();
1788
+ $[0] = t1;
1789
+ } else {
1790
+ t1 = $[0];
1791
+ }
1792
+ const hasDenials = t1.length > 0;
1793
+ const defaultTab = initialTab ?? (hasDenials ? "recent" : "allow");
1794
+ let t2;
1795
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1796
+ t2 = [];
1797
+ $[1] = t2;
1798
+ } else {
1799
+ t2 = $[1];
1800
+ }
1801
+ const [changes, setChanges] = import_react4.useState(t2);
1802
+ const toolPermissionContext = useAppState(_temp7);
1803
+ const setAppState = useSetAppState();
1804
+ const isTerminalFocused = useTerminalFocus();
1805
+ let t3;
1806
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1807
+ t3 = {
1808
+ approved: new Set,
1809
+ retry: new Set,
1810
+ denials: []
1811
+ };
1812
+ $[2] = t3;
1813
+ } else {
1814
+ t3 = $[2];
1815
+ }
1816
+ const denialStateRef = import_react4.useRef(t3);
1817
+ let t4;
1818
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
1819
+ t4 = (s_0) => {
1820
+ denialStateRef.current = s_0;
1821
+ };
1822
+ $[3] = t4;
1823
+ } else {
1824
+ t4 = $[3];
1825
+ }
1826
+ const handleDenialStateChange = t4;
1827
+ const [selectedRule, setSelectedRule] = import_react4.useState();
1828
+ const [lastFocusedRuleKey, setLastFocusedRuleKey] = import_react4.useState();
1829
+ const [addingRuleToTab, setAddingRuleToTab] = import_react4.useState(null);
1830
+ const [validatedRule, setValidatedRule] = import_react4.useState(null);
1831
+ const [isAddingWorkspaceDirectory, setIsAddingWorkspaceDirectory] = import_react4.useState(false);
1832
+ const [removingDirectory, setRemovingDirectory] = import_react4.useState(null);
1833
+ const [isSearchMode, setIsSearchMode] = import_react4.useState(false);
1834
+ const [headerFocused, setHeaderFocused] = import_react4.useState(true);
1835
+ let t5;
1836
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
1837
+ t5 = (focused) => {
1838
+ setHeaderFocused(focused);
1839
+ };
1840
+ $[4] = t5;
1841
+ } else {
1842
+ t5 = $[4];
1843
+ }
1844
+ const handleHeaderFocusChange = t5;
1845
+ let map;
1846
+ if ($[5] !== toolPermissionContext) {
1847
+ map = new Map;
1848
+ getAllowRules(toolPermissionContext).forEach((rule) => {
1849
+ map.set(jsonStringify(rule), rule);
1850
+ });
1851
+ $[5] = toolPermissionContext;
1852
+ $[6] = map;
1853
+ } else {
1854
+ map = $[6];
1855
+ }
1856
+ const allowRulesByKey = map;
1857
+ let map_0;
1858
+ if ($[7] !== toolPermissionContext) {
1859
+ map_0 = new Map;
1860
+ getDenyRules(toolPermissionContext).forEach((rule_0) => {
1861
+ map_0.set(jsonStringify(rule_0), rule_0);
1862
+ });
1863
+ $[7] = toolPermissionContext;
1864
+ $[8] = map_0;
1865
+ } else {
1866
+ map_0 = $[8];
1867
+ }
1868
+ const denyRulesByKey = map_0;
1869
+ let map_1;
1870
+ if ($[9] !== toolPermissionContext) {
1871
+ map_1 = new Map;
1872
+ getAskRules(toolPermissionContext).forEach((rule_1) => {
1873
+ map_1.set(jsonStringify(rule_1), rule_1);
1874
+ });
1875
+ $[9] = toolPermissionContext;
1876
+ $[10] = map_1;
1877
+ } else {
1878
+ map_1 = $[10];
1879
+ }
1880
+ const askRulesByKey = map_1;
1881
+ let t6;
1882
+ if ($[11] !== allowRulesByKey || $[12] !== askRulesByKey || $[13] !== denyRulesByKey) {
1883
+ t6 = (tab, t72) => {
1884
+ const query = t72 === undefined ? "" : t72;
1885
+ const rulesByKey = (() => {
1886
+ switch (tab) {
1887
+ case "allow": {
1888
+ return allowRulesByKey;
1889
+ }
1890
+ case "deny": {
1891
+ return denyRulesByKey;
1892
+ }
1893
+ case "ask": {
1894
+ return askRulesByKey;
1895
+ }
1896
+ case "workspace":
1897
+ case "recent": {
1898
+ return new Map;
1899
+ }
1900
+ }
1901
+ })();
1902
+ const options = [];
1903
+ if (tab !== "workspace" && tab !== "recent" && !query) {
1904
+ options.push({
1905
+ label: `Add a new rule${figures_default.ellipsis}`,
1906
+ value: "add-new-rule"
1907
+ });
1908
+ }
1909
+ const sortedRuleKeys = Array.from(rulesByKey.keys()).sort((a, b) => {
1910
+ const ruleA = rulesByKey.get(a);
1911
+ const ruleB = rulesByKey.get(b);
1912
+ if (ruleA && ruleB) {
1913
+ const ruleAString = permissionRuleValueToString(ruleA.ruleValue).toLowerCase();
1914
+ const ruleBString = permissionRuleValueToString(ruleB.ruleValue).toLowerCase();
1915
+ return ruleAString.localeCompare(ruleBString);
1916
+ }
1917
+ return 0;
1918
+ });
1919
+ const lowerQuery = query.toLowerCase();
1920
+ for (const ruleKey of sortedRuleKeys) {
1921
+ const rule_2 = rulesByKey.get(ruleKey);
1922
+ if (rule_2) {
1923
+ const ruleString = permissionRuleValueToString(rule_2.ruleValue);
1924
+ if (query && !ruleString.toLowerCase().includes(lowerQuery)) {
1925
+ continue;
1926
+ }
1927
+ options.push({
1928
+ label: ruleString,
1929
+ value: ruleKey
1930
+ });
1931
+ }
1932
+ }
1933
+ return {
1934
+ options,
1935
+ rulesByKey
1936
+ };
1937
+ };
1938
+ $[11] = allowRulesByKey;
1939
+ $[12] = askRulesByKey;
1940
+ $[13] = denyRulesByKey;
1941
+ $[14] = t6;
1942
+ } else {
1943
+ t6 = $[14];
1944
+ }
1945
+ const getRulesOptions = t6;
1946
+ const exitState = useExitOnCtrlCDWithKeybindings();
1947
+ const isSearchModeActive = !selectedRule && !addingRuleToTab && !validatedRule && !isAddingWorkspaceDirectory && !removingDirectory;
1948
+ const t7 = isSearchModeActive && isSearchMode;
1949
+ let t8;
1950
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
1951
+ t8 = () => {
1952
+ setIsSearchMode(false);
1953
+ };
1954
+ $[15] = t8;
1955
+ } else {
1956
+ t8 = $[15];
1957
+ }
1958
+ let t9;
1959
+ if ($[16] !== t7) {
1960
+ t9 = {
1961
+ isActive: t7,
1962
+ onExit: t8
1963
+ };
1964
+ $[16] = t7;
1965
+ $[17] = t9;
1966
+ } else {
1967
+ t9 = $[17];
1968
+ }
1969
+ const {
1970
+ query: searchQuery,
1971
+ setQuery: setSearchQuery,
1972
+ cursorOffset: searchCursorOffset
1973
+ } = useSearchInput(t9);
1974
+ let t10;
1975
+ if ($[18] !== isSearchMode || $[19] !== isSearchModeActive || $[20] !== setSearchQuery) {
1976
+ t10 = (e) => {
1977
+ if (!isSearchModeActive) {
1978
+ return;
1979
+ }
1980
+ if (isSearchMode) {
1981
+ return;
1982
+ }
1983
+ if (e.ctrl || e.meta) {
1984
+ return;
1985
+ }
1986
+ if (e.key === "/") {
1987
+ e.preventDefault();
1988
+ setIsSearchMode(true);
1989
+ setSearchQuery("");
1990
+ } else {
1991
+ if (e.key.length === 1 && e.key !== "j" && e.key !== "k" && e.key !== "m" && e.key !== "i" && e.key !== "r" && e.key !== " ") {
1992
+ e.preventDefault();
1993
+ setIsSearchMode(true);
1994
+ setSearchQuery(e.key);
1995
+ }
1996
+ }
1997
+ };
1998
+ $[18] = isSearchMode;
1999
+ $[19] = isSearchModeActive;
2000
+ $[20] = setSearchQuery;
2001
+ $[21] = t10;
2002
+ } else {
2003
+ t10 = $[21];
2004
+ }
2005
+ const handleKeyDown = t10;
2006
+ let t11;
2007
+ if ($[22] !== getRulesOptions) {
2008
+ t11 = (selectedValue, tab_0) => {
2009
+ const {
2010
+ rulesByKey: rulesByKey_0
2011
+ } = getRulesOptions(tab_0);
2012
+ if (selectedValue === "add-new-rule") {
2013
+ setAddingRuleToTab(tab_0);
2014
+ return;
2015
+ } else {
2016
+ setSelectedRule(rulesByKey_0.get(selectedValue));
2017
+ return;
2018
+ }
2019
+ };
2020
+ $[22] = getRulesOptions;
2021
+ $[23] = t11;
2022
+ } else {
2023
+ t11 = $[23];
2024
+ }
2025
+ const handleToolSelect = t11;
2026
+ let t12;
2027
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
2028
+ t12 = () => {
2029
+ setAddingRuleToTab(null);
2030
+ };
2031
+ $[24] = t12;
2032
+ } else {
2033
+ t12 = $[24];
2034
+ }
2035
+ const handleRuleInputCancel = t12;
2036
+ let t13;
2037
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
2038
+ t13 = (ruleValue, ruleBehavior) => {
2039
+ setValidatedRule({
2040
+ ruleValue,
2041
+ ruleBehavior
2042
+ });
2043
+ setAddingRuleToTab(null);
2044
+ };
2045
+ $[25] = t13;
2046
+ } else {
2047
+ t13 = $[25];
2048
+ }
2049
+ const handleRuleInputSubmit = t13;
2050
+ let t14;
2051
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
2052
+ t14 = (rules, unreachable) => {
2053
+ setValidatedRule(null);
2054
+ for (const rule_3 of rules) {
2055
+ setChanges((prev) => [...prev, `Added ${rule_3.ruleBehavior} rule ${source_default.bold(permissionRuleValueToString(rule_3.ruleValue))}`]);
2056
+ }
2057
+ if (unreachable && unreachable.length > 0) {
2058
+ for (const u of unreachable) {
2059
+ const severity = u.shadowType === "deny" ? "blocked" : "shadowed";
2060
+ setChanges((prev_0) => [...prev_0, source_default.yellow(`${figures_default.warning} Warning: ${permissionRuleValueToString(u.rule.ruleValue)} is ${severity}`), source_default.dim(` ${u.reason}`), source_default.dim(` Fix: ${u.fix}`)]);
2061
+ }
2062
+ }
2063
+ };
2064
+ $[26] = t14;
2065
+ } else {
2066
+ t14 = $[26];
2067
+ }
2068
+ const handleAddRulesSuccess = t14;
2069
+ let t15;
2070
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
2071
+ t15 = () => {
2072
+ setValidatedRule(null);
2073
+ };
2074
+ $[27] = t15;
2075
+ } else {
2076
+ t15 = $[27];
2077
+ }
2078
+ const handleAddRuleCancel = t15;
2079
+ let t16;
2080
+ if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
2081
+ t16 = () => setIsAddingWorkspaceDirectory(true);
2082
+ $[28] = t16;
2083
+ } else {
2084
+ t16 = $[28];
2085
+ }
2086
+ const handleRequestAddDirectory = t16;
2087
+ let t17;
2088
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
2089
+ t17 = (path) => setRemovingDirectory(path);
2090
+ $[29] = t17;
2091
+ } else {
2092
+ t17 = $[29];
2093
+ }
2094
+ const handleRequestRemoveDirectory = t17;
2095
+ let t18;
2096
+ if ($[30] !== changes || $[31] !== onExit || $[32] !== onRetryDenials) {
2097
+ t18 = () => {
2098
+ const s_1 = denialStateRef.current;
2099
+ const denialsFor = (set) => Array.from(set).map((idx) => s_1.denials[idx]).filter(_temp23);
2100
+ const retryDenials = denialsFor(s_1.retry);
2101
+ if (retryDenials.length > 0) {
2102
+ const commands = retryDenials.map(_temp32);
2103
+ onRetryDenials?.(commands);
2104
+ onExit(undefined, {
2105
+ shouldQuery: true,
2106
+ metaMessages: [`Permission granted for: ${commands.join(", ")}. You may now retry ${commands.length === 1 ? "this command" : "these commands"} if you would like.`]
2107
+ });
2108
+ return;
2109
+ }
2110
+ const approvedDenials = denialsFor(s_1.approved);
2111
+ if (approvedDenials.length > 0 || changes.length > 0) {
2112
+ const approvedMsg = approvedDenials.length > 0 ? [`Approved ${approvedDenials.map(_temp42).join(", ")}`] : [];
2113
+ onExit([...approvedMsg, ...changes].join(`
2114
+ `));
2115
+ } else {
2116
+ onExit("Permissions dialog dismissed", {
2117
+ display: "system"
2118
+ });
2119
+ }
2120
+ };
2121
+ $[30] = changes;
2122
+ $[31] = onExit;
2123
+ $[32] = onRetryDenials;
2124
+ $[33] = t18;
2125
+ } else {
2126
+ t18 = $[33];
2127
+ }
2128
+ const handleRulesCancel = t18;
2129
+ const t19 = isSearchModeActive && !isSearchMode;
2130
+ let t20;
2131
+ if ($[34] !== t19) {
2132
+ t20 = {
2133
+ context: "Settings",
2134
+ isActive: t19
2135
+ };
2136
+ $[34] = t19;
2137
+ $[35] = t20;
2138
+ } else {
2139
+ t20 = $[35];
2140
+ }
2141
+ useKeybinding("confirm:no", handleRulesCancel, t20);
2142
+ let t21;
2143
+ if ($[36] !== getRulesOptions || $[37] !== selectedRule || $[38] !== setAppState || $[39] !== toolPermissionContext) {
2144
+ t21 = () => {
2145
+ if (!selectedRule) {
2146
+ return;
2147
+ }
2148
+ const {
2149
+ options: options_0
2150
+ } = getRulesOptions(selectedRule.ruleBehavior);
2151
+ const selectedKey = jsonStringify(selectedRule);
2152
+ const ruleKeys = options_0.filter(_temp5).map(_temp62);
2153
+ const currentIndex = ruleKeys.indexOf(selectedKey);
2154
+ let nextFocusKey;
2155
+ if (currentIndex !== -1) {
2156
+ if (currentIndex < ruleKeys.length - 1) {
2157
+ nextFocusKey = ruleKeys[currentIndex + 1];
2158
+ } else {
2159
+ if (currentIndex > 0) {
2160
+ nextFocusKey = ruleKeys[currentIndex - 1];
2161
+ }
2162
+ }
2163
+ }
2164
+ setLastFocusedRuleKey(nextFocusKey);
2165
+ deletePermissionRule({
2166
+ rule: selectedRule,
2167
+ initialContext: toolPermissionContext,
2168
+ setToolPermissionContext(toolPermissionContext_0) {
2169
+ setAppState((prev_1) => ({
2170
+ ...prev_1,
2171
+ toolPermissionContext: toolPermissionContext_0
2172
+ }));
2173
+ }
2174
+ });
2175
+ setChanges((prev_2) => [...prev_2, `Deleted ${selectedRule.ruleBehavior} rule ${source_default.bold(permissionRuleValueToString(selectedRule.ruleValue))}`]);
2176
+ setSelectedRule(undefined);
2177
+ };
2178
+ $[36] = getRulesOptions;
2179
+ $[37] = selectedRule;
2180
+ $[38] = setAppState;
2181
+ $[39] = toolPermissionContext;
2182
+ $[40] = t21;
2183
+ } else {
2184
+ t21 = $[40];
2185
+ }
2186
+ const handleDeleteRule = t21;
2187
+ if (selectedRule) {
2188
+ let t222;
2189
+ if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
2190
+ t222 = () => setSelectedRule(undefined);
2191
+ $[41] = t222;
2192
+ } else {
2193
+ t222 = $[41];
2194
+ }
2195
+ let t232;
2196
+ if ($[42] !== handleDeleteRule || $[43] !== selectedRule) {
2197
+ t232 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RuleDetails, {
2198
+ rule: selectedRule,
2199
+ onDelete: handleDeleteRule,
2200
+ onCancel: t222
2201
+ }, undefined, false, undefined, this);
2202
+ $[42] = handleDeleteRule;
2203
+ $[43] = selectedRule;
2204
+ $[44] = t232;
2205
+ } else {
2206
+ t232 = $[44];
2207
+ }
2208
+ return t232;
2209
+ }
2210
+ if (addingRuleToTab && addingRuleToTab !== "workspace" && addingRuleToTab !== "recent") {
2211
+ let t222;
2212
+ if ($[45] !== addingRuleToTab) {
2213
+ t222 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRuleInput, {
2214
+ onCancel: handleRuleInputCancel,
2215
+ onSubmit: handleRuleInputSubmit,
2216
+ ruleBehavior: addingRuleToTab
2217
+ }, undefined, false, undefined, this);
2218
+ $[45] = addingRuleToTab;
2219
+ $[46] = t222;
2220
+ } else {
2221
+ t222 = $[46];
2222
+ }
2223
+ return t222;
2224
+ }
2225
+ if (validatedRule) {
2226
+ let t222;
2227
+ if ($[47] !== validatedRule.ruleValue) {
2228
+ t222 = [validatedRule.ruleValue];
2229
+ $[47] = validatedRule.ruleValue;
2230
+ $[48] = t222;
2231
+ } else {
2232
+ t222 = $[48];
2233
+ }
2234
+ let t232;
2235
+ if ($[49] !== setAppState) {
2236
+ t232 = (toolPermissionContext_1) => {
2237
+ setAppState((prev_3) => ({
2238
+ ...prev_3,
2239
+ toolPermissionContext: toolPermissionContext_1
2240
+ }));
2241
+ };
2242
+ $[49] = setAppState;
2243
+ $[50] = t232;
2244
+ } else {
2245
+ t232 = $[50];
2246
+ }
2247
+ let t242;
2248
+ if ($[51] !== t222 || $[52] !== t232 || $[53] !== toolPermissionContext || $[54] !== validatedRule.ruleBehavior) {
2249
+ t242 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(AddPermissionRules, {
2250
+ onAddRules: handleAddRulesSuccess,
2251
+ onCancel: handleAddRuleCancel,
2252
+ ruleValues: t222,
2253
+ ruleBehavior: validatedRule.ruleBehavior,
2254
+ initialContext: toolPermissionContext,
2255
+ setToolPermissionContext: t232
2256
+ }, undefined, false, undefined, this);
2257
+ $[51] = t222;
2258
+ $[52] = t232;
2259
+ $[53] = toolPermissionContext;
2260
+ $[54] = validatedRule.ruleBehavior;
2261
+ $[55] = t242;
2262
+ } else {
2263
+ t242 = $[55];
2264
+ }
2265
+ return t242;
2266
+ }
2267
+ if (isAddingWorkspaceDirectory) {
2268
+ let t222;
2269
+ if ($[56] !== setAppState || $[57] !== toolPermissionContext) {
2270
+ t222 = (path_0, remember) => {
2271
+ const destination = remember ? "localSettings" : "session";
2272
+ const permissionUpdate = {
2273
+ type: "addDirectories",
2274
+ directories: [path_0],
2275
+ destination
2276
+ };
2277
+ const updatedContext = applyPermissionUpdate(toolPermissionContext, permissionUpdate);
2278
+ setAppState((prev_4) => ({
2279
+ ...prev_4,
2280
+ toolPermissionContext: updatedContext
2281
+ }));
2282
+ if (remember) {
2283
+ persistPermissionUpdate(permissionUpdate);
2284
+ }
2285
+ setChanges((prev_5) => [...prev_5, `Added directory ${source_default.bold(path_0)} to workspace${remember ? " and saved to local settings" : " for this session"}`]);
2286
+ setIsAddingWorkspaceDirectory(false);
2287
+ };
2288
+ $[56] = setAppState;
2289
+ $[57] = toolPermissionContext;
2290
+ $[58] = t222;
2291
+ } else {
2292
+ t222 = $[58];
2293
+ }
2294
+ let t232;
2295
+ if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
2296
+ t232 = () => setIsAddingWorkspaceDirectory(false);
2297
+ $[59] = t232;
2298
+ } else {
2299
+ t232 = $[59];
2300
+ }
2301
+ let t242;
2302
+ if ($[60] !== t222 || $[61] !== toolPermissionContext) {
2303
+ t242 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(AddWorkspaceDirectory, {
2304
+ onAddDirectory: t222,
2305
+ onCancel: t232,
2306
+ permissionContext: toolPermissionContext
2307
+ }, undefined, false, undefined, this);
2308
+ $[60] = t222;
2309
+ $[61] = toolPermissionContext;
2310
+ $[62] = t242;
2311
+ } else {
2312
+ t242 = $[62];
2313
+ }
2314
+ return t242;
2315
+ }
2316
+ if (removingDirectory) {
2317
+ let t222;
2318
+ if ($[63] !== removingDirectory) {
2319
+ t222 = () => {
2320
+ setChanges((prev_6) => [...prev_6, `Removed directory ${source_default.bold(removingDirectory)} from workspace`]);
2321
+ setRemovingDirectory(null);
2322
+ };
2323
+ $[63] = removingDirectory;
2324
+ $[64] = t222;
2325
+ } else {
2326
+ t222 = $[64];
2327
+ }
2328
+ let t232;
2329
+ if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
2330
+ t232 = () => setRemovingDirectory(null);
2331
+ $[65] = t232;
2332
+ } else {
2333
+ t232 = $[65];
2334
+ }
2335
+ let t242;
2336
+ if ($[66] !== setAppState) {
2337
+ t242 = (toolPermissionContext_2) => {
2338
+ setAppState((prev_7) => ({
2339
+ ...prev_7,
2340
+ toolPermissionContext: toolPermissionContext_2
2341
+ }));
2342
+ };
2343
+ $[66] = setAppState;
2344
+ $[67] = t242;
2345
+ } else {
2346
+ t242 = $[67];
2347
+ }
2348
+ let t252;
2349
+ if ($[68] !== removingDirectory || $[69] !== t222 || $[70] !== t242 || $[71] !== toolPermissionContext) {
2350
+ t252 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RemoveWorkspaceDirectory, {
2351
+ directoryPath: removingDirectory,
2352
+ onRemove: t222,
2353
+ onCancel: t232,
2354
+ permissionContext: toolPermissionContext,
2355
+ setPermissionContext: t242
2356
+ }, undefined, false, undefined, this);
2357
+ $[68] = removingDirectory;
2358
+ $[69] = t222;
2359
+ $[70] = t242;
2360
+ $[71] = toolPermissionContext;
2361
+ $[72] = t252;
2362
+ } else {
2363
+ t252 = $[72];
2364
+ }
2365
+ return t252;
2366
+ }
2367
+ let t22;
2368
+ if ($[73] !== getRulesOptions || $[74] !== handleRulesCancel || $[75] !== handleToolSelect || $[76] !== isSearchMode || $[77] !== isTerminalFocused || $[78] !== lastFocusedRuleKey || $[79] !== searchCursorOffset || $[80] !== searchQuery) {
2369
+ t22 = {
2370
+ searchQuery,
2371
+ isSearchMode,
2372
+ isFocused: isTerminalFocused,
2373
+ onCancel: handleRulesCancel,
2374
+ lastFocusedRuleKey,
2375
+ cursorOffset: searchCursorOffset,
2376
+ getRulesOptions,
2377
+ handleToolSelect,
2378
+ onHeaderFocusChange: handleHeaderFocusChange
2379
+ };
2380
+ $[73] = getRulesOptions;
2381
+ $[74] = handleRulesCancel;
2382
+ $[75] = handleToolSelect;
2383
+ $[76] = isSearchMode;
2384
+ $[77] = isTerminalFocused;
2385
+ $[78] = lastFocusedRuleKey;
2386
+ $[79] = searchCursorOffset;
2387
+ $[80] = searchQuery;
2388
+ $[81] = t22;
2389
+ } else {
2390
+ t22 = $[81];
2391
+ }
2392
+ const sharedRulesProps = t22;
2393
+ const isHidden = !!selectedRule || !!addingRuleToTab || !!validatedRule || isAddingWorkspaceDirectory || !!removingDirectory;
2394
+ const t23 = !isSearchMode;
2395
+ let t24;
2396
+ if ($[82] === Symbol.for("react.memo_cache_sentinel")) {
2397
+ t24 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2398
+ id: "recent",
2399
+ title: "Recently denied",
2400
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RecentDenialsTab, {
2401
+ onHeaderFocusChange: handleHeaderFocusChange,
2402
+ onStateChange: handleDenialStateChange
2403
+ }, undefined, false, undefined, this)
2404
+ }, undefined, false, undefined, this);
2405
+ $[82] = t24;
2406
+ } else {
2407
+ t24 = $[82];
2408
+ }
2409
+ let t25;
2410
+ if ($[83] !== sharedRulesProps) {
2411
+ t25 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2412
+ id: "allow",
2413
+ title: "Allow",
2414
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRulesTab, {
2415
+ tab: "allow",
2416
+ ...sharedRulesProps
2417
+ }, undefined, false, undefined, this)
2418
+ }, undefined, false, undefined, this);
2419
+ $[83] = sharedRulesProps;
2420
+ $[84] = t25;
2421
+ } else {
2422
+ t25 = $[84];
2423
+ }
2424
+ let t26;
2425
+ if ($[85] !== sharedRulesProps) {
2426
+ t26 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2427
+ id: "ask",
2428
+ title: "Ask",
2429
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRulesTab, {
2430
+ tab: "ask",
2431
+ ...sharedRulesProps
2432
+ }, undefined, false, undefined, this)
2433
+ }, undefined, false, undefined, this);
2434
+ $[85] = sharedRulesProps;
2435
+ $[86] = t26;
2436
+ } else {
2437
+ t26 = $[86];
2438
+ }
2439
+ let t27;
2440
+ if ($[87] !== sharedRulesProps) {
2441
+ t27 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2442
+ id: "deny",
2443
+ title: "Deny",
2444
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRulesTab, {
2445
+ tab: "deny",
2446
+ ...sharedRulesProps
2447
+ }, undefined, false, undefined, this)
2448
+ }, undefined, false, undefined, this);
2449
+ $[87] = sharedRulesProps;
2450
+ $[88] = t27;
2451
+ } else {
2452
+ t27 = $[88];
2453
+ }
2454
+ let t28;
2455
+ if ($[89] === Symbol.for("react.memo_cache_sentinel")) {
2456
+ t28 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
2457
+ children: "Claude Code can read files in the workspace, and make edits when auto-accept edits is on."
2458
+ }, undefined, false, undefined, this);
2459
+ $[89] = t28;
2460
+ } else {
2461
+ t28 = $[89];
2462
+ }
2463
+ let t29;
2464
+ if ($[90] !== onExit || $[91] !== toolPermissionContext) {
2465
+ t29 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2466
+ id: "workspace",
2467
+ title: "Workspace",
2468
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
2469
+ flexDirection: "column",
2470
+ children: [
2471
+ t28,
2472
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(WorkspaceTab, {
2473
+ onExit,
2474
+ toolPermissionContext,
2475
+ onRequestAddDirectory: handleRequestAddDirectory,
2476
+ onRequestRemoveDirectory: handleRequestRemoveDirectory,
2477
+ onHeaderFocusChange: handleHeaderFocusChange
2478
+ }, undefined, false, undefined, this)
2479
+ ]
2480
+ }, undefined, true, undefined, this)
2481
+ }, undefined, false, undefined, this);
2482
+ $[90] = onExit;
2483
+ $[91] = toolPermissionContext;
2484
+ $[92] = t29;
2485
+ } else {
2486
+ t29 = $[92];
2487
+ }
2488
+ let t30;
2489
+ if ($[93] !== defaultTab || $[94] !== isHidden || $[95] !== t23 || $[96] !== t25 || $[97] !== t26 || $[98] !== t27 || $[99] !== t29) {
2490
+ t30 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tabs, {
2491
+ title: "Permissions:",
2492
+ color: "permission",
2493
+ defaultTab,
2494
+ hidden: isHidden,
2495
+ initialHeaderFocused: !hasDenials,
2496
+ navFromContent: t23,
2497
+ children: [
2498
+ t24,
2499
+ t25,
2500
+ t26,
2501
+ t27,
2502
+ t29
2503
+ ]
2504
+ }, undefined, true, undefined, this);
2505
+ $[93] = defaultTab;
2506
+ $[94] = isHidden;
2507
+ $[95] = t23;
2508
+ $[96] = t25;
2509
+ $[97] = t26;
2510
+ $[98] = t27;
2511
+ $[99] = t29;
2512
+ $[100] = t30;
2513
+ } else {
2514
+ t30 = $[100];
2515
+ }
2516
+ let t31;
2517
+ if ($[101] !== defaultTab || $[102] !== exitState.keyName || $[103] !== exitState.pending || $[104] !== headerFocused || $[105] !== isSearchMode) {
2518
+ t31 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
2519
+ marginTop: 1,
2520
+ paddingLeft: 1,
2521
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
2522
+ dimColor: true,
2523
+ children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2524
+ children: [
2525
+ "Press ",
2526
+ exitState.keyName,
2527
+ " again to exit"
2528
+ ]
2529
+ }, undefined, true, undefined, this) : headerFocused ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2530
+ children: "\u2190/\u2192 tab switch \xB7 \u2193 return \xB7 Esc cancel"
2531
+ }, undefined, false, undefined, this) : isSearchMode ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2532
+ children: "Type to filter \xB7 Enter/\u2193 select \xB7 \u2191 tabs \xB7 Esc clear"
2533
+ }, undefined, false, undefined, this) : hasDenials && defaultTab === "recent" ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2534
+ children: "Enter approve \xB7 r retry \xB7 \u2191\u2193 navigate \xB7 \u2190/\u2192 switch \xB7 Esc cancel"
2535
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2536
+ children: "\u2191\u2193 navigate \xB7 Enter select \xB7 Type to search \xB7 \u2190/\u2192 switch \xB7 Esc cancel"
2537
+ }, undefined, false, undefined, this)
2538
+ }, undefined, false, undefined, this)
2539
+ }, undefined, false, undefined, this);
2540
+ $[101] = defaultTab;
2541
+ $[102] = exitState.keyName;
2542
+ $[103] = exitState.pending;
2543
+ $[104] = headerFocused;
2544
+ $[105] = isSearchMode;
2545
+ $[106] = t31;
2546
+ } else {
2547
+ t31 = $[106];
2548
+ }
2549
+ let t32;
2550
+ if ($[107] !== t30 || $[108] !== t31) {
2551
+ t32 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Pane, {
2552
+ color: "permission",
2553
+ children: [
2554
+ t30,
2555
+ t31
2556
+ ]
2557
+ }, undefined, true, undefined, this);
2558
+ $[107] = t30;
2559
+ $[108] = t31;
2560
+ $[109] = t32;
2561
+ } else {
2562
+ t32 = $[109];
2563
+ }
2564
+ let t33;
2565
+ if ($[110] !== handleKeyDown || $[111] !== t32) {
2566
+ t33 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
2567
+ flexDirection: "column",
2568
+ onKeyDown: handleKeyDown,
2569
+ children: t32
2570
+ }, undefined, false, undefined, this);
2571
+ $[110] = handleKeyDown;
2572
+ $[111] = t32;
2573
+ $[112] = t33;
2574
+ } else {
2575
+ t33 = $[112];
2576
+ }
2577
+ return t33;
2578
+ }
2579
+ function _temp62(opt_0) {
2580
+ return opt_0.value;
2581
+ }
2582
+ function _temp5(opt) {
2583
+ return opt.value !== "add-new-rule";
2584
+ }
2585
+ function _temp42(d_1) {
2586
+ return source_default.bold(d_1.display);
2587
+ }
2588
+ function _temp32(d_0) {
2589
+ return d_0.display;
2590
+ }
2591
+ function _temp23(d) {
2592
+ return d !== undefined;
2593
+ }
2594
+ function _temp7(s) {
2595
+ return s.toolPermissionContext;
2596
+ }
2597
+ var import_compiler_runtime7, import_react4, jsx_dev_runtime7;
2598
+ var init_PermissionRuleList = __esm(() => {
2599
+ init_source();
2600
+ init_figures();
2601
+ init_AppState();
2602
+ init_PermissionUpdate();
2603
+ init_select();
2604
+ init_useExitOnCtrlCDWithKeybindings();
2605
+ init_useSearchInput();
2606
+ init_ink();
2607
+ init_useKeybinding();
2608
+ init_autoModeDenials();
2609
+ init_permissionRuleParser();
2610
+ init_permissions();
2611
+ init_slowOperations();
2612
+ init_Pane();
2613
+ init_Tabs();
2614
+ init_SearchBox();
2615
+ init_AddPermissionRules();
2616
+ init_AddWorkspaceDirectory();
2617
+ init_PermissionRuleDescription();
2618
+ init_PermissionRuleInput();
2619
+ init_RecentDenialsTab();
2620
+ init_RemoveWorkspaceDirectory();
2621
+ init_WorkspaceTab();
2622
+ import_compiler_runtime7 = __toESM(require_compiler_runtime(), 1);
2623
+ import_react4 = __toESM(require_react(), 1);
2624
+ jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
2625
+ });
2626
+
2627
+ // src/commands/permissions/permissions.tsx
2628
+ var jsx_dev_runtime8, call = async (onDone, context) => {
2629
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(PermissionRuleList, {
2630
+ onExit: onDone,
2631
+ onRetryDenials: (commands) => {
2632
+ context.setMessages((prev) => [...prev, createPermissionRetryMessage(commands)]);
2633
+ }
2634
+ }, undefined, false, undefined, this);
2635
+ };
2636
+ var init_permissions2 = __esm(() => {
2637
+ init_PermissionRuleList();
2638
+ init_messages();
2639
+ jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
2640
+ });
2641
+ init_permissions2();
2642
+
2643
+ export {
2644
+ call
2645
+ };