claude-code-best 1.0.3

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