@rainhole/rain-code 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +172 -0
- package/dist/chunk-06b2745w.js +3583 -0
- package/dist/chunk-06saje2v.js +39 -0
- package/dist/chunk-07069jq1.js +30 -0
- package/dist/chunk-0731m51q.js +8 -0
- package/dist/chunk-0bs2528v.js +192 -0
- package/dist/chunk-0fj1d707.js +313 -0
- package/dist/chunk-0gdkvtx4.js +117 -0
- package/dist/chunk-0jd8rpt4.js +34257 -0
- package/dist/chunk-0paqc2yw.js +15 -0
- package/dist/chunk-0pk0w4j1.js +332 -0
- package/dist/chunk-0rpb2bdp.js +8 -0
- package/dist/chunk-0rvwew67.js +9300 -0
- package/dist/chunk-0sa1g8jf.js +318 -0
- package/dist/chunk-0vkfrmqm.js +690 -0
- package/dist/chunk-0xgxxqhr.js +708 -0
- package/dist/chunk-0xjaqda8.js +1124 -0
- package/dist/chunk-0zep39v0.js +81 -0
- package/dist/chunk-1141xmr4.js +8 -0
- package/dist/chunk-12hn2mhy.js +17 -0
- package/dist/chunk-12rjry89.js +81 -0
- package/dist/chunk-168xb8v1.js +436 -0
- package/dist/chunk-1cwdhk7a.js +969 -0
- package/dist/chunk-1cx0fd76.js +132 -0
- package/dist/chunk-1erfksyp.js +107 -0
- package/dist/chunk-1h1tc4mw.js +126 -0
- package/dist/chunk-1h2famwb.js +49 -0
- package/dist/chunk-1jnbys9f.js +1811 -0
- package/dist/chunk-1k4fp6ft.js +389 -0
- package/dist/chunk-1mjn8xxc.js +22 -0
- package/dist/chunk-1mn6r4y2.js +747 -0
- package/dist/chunk-1p8myfza.js +1568 -0
- package/dist/chunk-1vthytca.js +79 -0
- package/dist/chunk-1y32rx73.js +145 -0
- package/dist/chunk-200781fd.js +64 -0
- package/dist/chunk-205mmm67.js +100 -0
- package/dist/chunk-209eh6ak.js +9381 -0
- package/dist/chunk-21mfpnva.js +85 -0
- package/dist/chunk-238g70xa.js +36 -0
- package/dist/chunk-24k6t9fa.js +151 -0
- package/dist/chunk-29gg6hx0.js +2992 -0
- package/dist/chunk-2a42s11t.js +412 -0
- package/dist/chunk-2ekjxh7d.js +289 -0
- package/dist/chunk-2eykm0j0.js +20 -0
- package/dist/chunk-2fwze72g.js +24 -0
- package/dist/chunk-2gzv8nrw.js +205 -0
- package/dist/chunk-2k995y2x.js +880 -0
- package/dist/chunk-2nayx6q1.js +63 -0
- package/dist/chunk-2pg9pmvc.js +182 -0
- package/dist/chunk-2qp2hc02.js +36 -0
- package/dist/chunk-2rj0dnps.js +436 -0
- package/dist/chunk-2t0xa4dt.js +145 -0
- package/dist/chunk-2ym6tnww.js +216 -0
- package/dist/chunk-30bpz5m2.js +34 -0
- package/dist/chunk-30rst83v.js +168 -0
- package/dist/chunk-36b2q5fg.js +1299 -0
- package/dist/chunk-3c25bcsw.js +17 -0
- package/dist/chunk-3ewzhjyb.js +207 -0
- package/dist/chunk-3h8a89gy.js +46 -0
- package/dist/chunk-3nk79af8.js +8 -0
- package/dist/chunk-3sfr7j85.js +884 -0
- package/dist/chunk-3w6s9m5w.js +16 -0
- package/dist/chunk-3x52v1wb.js +660 -0
- package/dist/chunk-404qm8xt.js +1715 -0
- package/dist/chunk-42fjay4q.js +141 -0
- package/dist/chunk-48649h96.js +8590 -0
- package/dist/chunk-495d85x1.js +8066 -0
- package/dist/chunk-4anj5saq.js +111 -0
- package/dist/chunk-4asynmj4.js +259 -0
- package/dist/chunk-4ck9wve9.js +225 -0
- package/dist/chunk-4cp6193g.js +9076 -0
- package/dist/chunk-4g3v8y12.js +23 -0
- package/dist/chunk-4geyher8.js +244 -0
- package/dist/chunk-4hv90qcz.js +8 -0
- package/dist/chunk-4jhr03e7.js +61 -0
- package/dist/chunk-4jm600zv.js +13 -0
- package/dist/chunk-4nspekjp.js +69 -0
- package/dist/chunk-4ptqcw4p.js +16 -0
- package/dist/chunk-4qj8cqbh.js +173 -0
- package/dist/chunk-4wxsg6a0.js +122 -0
- package/dist/chunk-4zfkzkt6.js +37 -0
- package/dist/chunk-54dckh8a.js +1169 -0
- package/dist/chunk-54y13759.js +650 -0
- package/dist/chunk-54yf6e8d.js +91 -0
- package/dist/chunk-57qz90z8.js +154 -0
- package/dist/chunk-59k0mjnc.js +120 -0
- package/dist/chunk-59p9jye4.js +104 -0
- package/dist/chunk-5c753bd4.js +64 -0
- package/dist/chunk-5cw6zwep.js +106 -0
- package/dist/chunk-5eaf3j24.js +133 -0
- package/dist/chunk-5me7398b.js +81 -0
- package/dist/chunk-5pevjsyw.js +118 -0
- package/dist/chunk-5q3c2rf4.js +107 -0
- package/dist/chunk-5xwtnq4g.js +146 -0
- package/dist/chunk-5z28bqne.js +6748 -0
- package/dist/chunk-613f6fbv.js +63 -0
- package/dist/chunk-641hawvm.js +95 -0
- package/dist/chunk-64c1avct.js +13 -0
- package/dist/chunk-64hks9ax.js +456 -0
- package/dist/chunk-677as3nh.js +15 -0
- package/dist/chunk-6bd8brc4.js +48 -0
- package/dist/chunk-6cs6mmez.js +112 -0
- package/dist/chunk-6dj5t602.js +341 -0
- package/dist/chunk-6e8vht4y.js +780 -0
- package/dist/chunk-6gr3c3w9.js +378 -0
- package/dist/chunk-6hkd32eh.js +83 -0
- package/dist/chunk-6jqxvef0.js +198 -0
- package/dist/chunk-6mh3vfa4.js +115 -0
- package/dist/chunk-6mpw9h55.js +1071 -0
- package/dist/chunk-6p4cyhb3.js +16 -0
- package/dist/chunk-6qvgnepd.js +26 -0
- package/dist/chunk-6r2bhsvt.js +6956 -0
- package/dist/chunk-6tq2v3rk.js +186 -0
- package/dist/chunk-7316m01k.js +125 -0
- package/dist/chunk-73rpbt04.js +1947 -0
- package/dist/chunk-75zk7zr1.js +309 -0
- package/dist/chunk-760252na.js +101 -0
- package/dist/chunk-764ec4ja.js +173 -0
- package/dist/chunk-76vgnv24.js +108 -0
- package/dist/chunk-7739pg2c.js +4261 -0
- package/dist/chunk-7a7hxy3d.js +167 -0
- package/dist/chunk-7aw745vx.js +40175 -0
- package/dist/chunk-7b6bg1r4.js +16128 -0
- package/dist/chunk-7ca4qskp.js +99 -0
- package/dist/chunk-7deph26x.js +311 -0
- package/dist/chunk-7ds8zqar.js +108 -0
- package/dist/chunk-7fqxw3d2.js +479 -0
- package/dist/chunk-7nysf9yd.js +266 -0
- package/dist/chunk-7tascxe2.js +90 -0
- package/dist/chunk-7wm5s02e.js +216 -0
- package/dist/chunk-7xmw2tcz.js +277 -0
- package/dist/chunk-7xyswgjh.js +8 -0
- package/dist/chunk-7zkhadkb.js +220 -0
- package/dist/chunk-8225arm6.js +6374 -0
- package/dist/chunk-83hfzbx3.js +10 -0
- package/dist/chunk-85tag8nv.js +1391 -0
- package/dist/chunk-8bd8q5xw.js +359 -0
- package/dist/chunk-8bwqtasa.js +213 -0
- package/dist/chunk-8g5pe1gr.js +37 -0
- package/dist/chunk-8g747a8x.js +26 -0
- package/dist/chunk-8h6sdj66.js +447 -0
- package/dist/chunk-8mm8b6dd.js +19 -0
- package/dist/chunk-8ndwn6st.js +120 -0
- package/dist/chunk-8pn8tvgg.js +637 -0
- package/dist/chunk-8tnn9kcb.js +131 -0
- package/dist/chunk-8tnsngw2.js +31 -0
- package/dist/chunk-8x5w267y.js +112 -0
- package/dist/chunk-8y12jxg8.js +10 -0
- package/dist/chunk-8ymf4e6z.js +48 -0
- package/dist/chunk-90mt0m1w.js +102 -0
- package/dist/chunk-90wp6wez.js +10510 -0
- package/dist/chunk-91ew1d6f.js +2689 -0
- package/dist/chunk-97jsc1kn.js +231 -0
- package/dist/chunk-993pnm45.js +4521 -0
- package/dist/chunk-9a0rsdre.js +46 -0
- package/dist/chunk-9d7fmqkw.js +41 -0
- package/dist/chunk-9dgaq0g4.js +667 -0
- package/dist/chunk-9f52phb8.js +138 -0
- package/dist/chunk-9fbpqghc.js +105 -0
- package/dist/chunk-9hzxd5q3.js +122 -0
- package/dist/chunk-9kyrssch.js +28 -0
- package/dist/chunk-9q93n4w6.js +308 -0
- package/dist/chunk-9s0xs06y.js +581 -0
- package/dist/chunk-9x5zgy22.js +12 -0
- package/dist/chunk-9zdcb9jy.js +105 -0
- package/dist/chunk-a136cvvz.js +27 -0
- package/dist/chunk-a4psxnr1.js +224 -0
- package/dist/chunk-a4twdmhf.js +45 -0
- package/dist/chunk-a7rhvq9b.js +106 -0
- package/dist/chunk-a8ejc632.js +3094 -0
- package/dist/chunk-a9vdeb6y.js +258 -0
- package/dist/chunk-a9zh40sj.js +48 -0
- package/dist/chunk-aawg48hh.js +4102 -0
- package/dist/chunk-ad2f3890.js +65 -0
- package/dist/chunk-ae7ar1jk.js +105 -0
- package/dist/chunk-ak3hdbe4.js +234 -0
- package/dist/chunk-as4e9g8f.js +298 -0
- package/dist/chunk-ase86y73.js +15 -0
- package/dist/chunk-awb4vc41.js +69 -0
- package/dist/chunk-b4bep0aq.js +5041 -0
- package/dist/chunk-b4wg70y1.js +54 -0
- package/dist/chunk-b81hd3m6.js +32 -0
- package/dist/chunk-b9knmzt0.js +106 -0
- package/dist/chunk-besmz4ym.js +32 -0
- package/dist/chunk-bgpkemkg.js +65 -0
- package/dist/chunk-bj8x29tz.js +54 -0
- package/dist/chunk-bkqsnwrq.js +239 -0
- package/dist/chunk-bnf662he.js +359 -0
- package/dist/chunk-bq00fcsd.js +165 -0
- package/dist/chunk-brz2c4cq.js +275 -0
- package/dist/chunk-bsa118r4.js +502 -0
- package/dist/chunk-bsengrbt.js +2737 -0
- package/dist/chunk-bt64sq5y.js +19 -0
- package/dist/chunk-bxcfz5gy.js +56 -0
- package/dist/chunk-bxs2a71m.js +213 -0
- package/dist/chunk-byv2p9hn.js +397 -0
- package/dist/chunk-c03am3es.js +29 -0
- package/dist/chunk-c2ahb7yg.js +105 -0
- package/dist/chunk-c2qm0t6p.js +111 -0
- package/dist/chunk-c42h9gzx.js +71 -0
- package/dist/chunk-c47xbxqw.js +38 -0
- package/dist/chunk-c5vkve4j.js +68 -0
- package/dist/chunk-c6sjhj89.js +1284 -0
- package/dist/chunk-ca147npg.js +27 -0
- package/dist/chunk-caxx597g.js +71 -0
- package/dist/chunk-cbrt5vsb.js +31 -0
- package/dist/chunk-ce0z23ct.js +443 -0
- package/dist/chunk-cefsp8h1.js +155 -0
- package/dist/chunk-cfv996bs.js +22 -0
- package/dist/chunk-cgfdkzhb.js +12 -0
- package/dist/chunk-chsyvavm.js +3435 -0
- package/dist/chunk-cmsknj6n.js +28228 -0
- package/dist/chunk-cn8bkmvj.js +264 -0
- package/dist/chunk-crmjpsqe.js +68 -0
- package/dist/chunk-cthpw4pj.js +849 -0
- package/dist/chunk-cwy9nj4y.js +134 -0
- package/dist/chunk-cyagce56.js +155 -0
- package/dist/chunk-cynewytp.js +227 -0
- package/dist/chunk-cznf6k4g.js +46 -0
- package/dist/chunk-d0954t9j.js +267 -0
- package/dist/chunk-d1qhftze.js +118 -0
- package/dist/chunk-d4mdda98.js +94 -0
- package/dist/chunk-d4rnqevg.js +41 -0
- package/dist/chunk-d7886r6a.js +13870 -0
- package/dist/chunk-dd1qvamk.js +678 -0
- package/dist/chunk-dg4je8qj.js +183 -0
- package/dist/chunk-dggvswz1.js +104 -0
- package/dist/chunk-dgqrcy74.js +48 -0
- package/dist/chunk-dm3n2qgd.js +24 -0
- package/dist/chunk-dnh7jtpb.js +37 -0
- package/dist/chunk-dsenyfax.js +105 -0
- package/dist/chunk-dtf0a7rr.js +655 -0
- package/dist/chunk-dxdb7bs1.js +60 -0
- package/dist/chunk-e0pth8g7.js +79 -0
- package/dist/chunk-e36y0q82.js +109 -0
- package/dist/chunk-ef55cwrv.js +267 -0
- package/dist/chunk-efh644hv.js +915 -0
- package/dist/chunk-ehtwnxpg.js +1591 -0
- package/dist/chunk-ejahyhd8.js +120 -0
- package/dist/chunk-ejk1bpzz.js +472 -0
- package/dist/chunk-emef71ea.js +202 -0
- package/dist/chunk-en7v028t.js +333 -0
- package/dist/chunk-eqp1rfft.js +17 -0
- package/dist/chunk-ewadzrm8.js +103 -0
- package/dist/chunk-exh7z6tv.js +132 -0
- package/dist/chunk-f0npbgyf.js +340 -0
- package/dist/chunk-f2qkc8ce.js +229 -0
- package/dist/chunk-f49sb3q7.js +40 -0
- package/dist/chunk-f5ma3nh5.js +3436 -0
- package/dist/chunk-fbv4apne.js +51 -0
- package/dist/chunk-fday7sfg.js +269 -0
- package/dist/chunk-feyzykye.js +10 -0
- package/dist/chunk-fgqwr70t.js +241 -0
- package/dist/chunk-fhy7zs1w.js +943 -0
- package/dist/chunk-fmw3f68k.js +432 -0
- package/dist/chunk-fmwqvpqm.js +506 -0
- package/dist/chunk-fn1apgre.js +66 -0
- package/dist/chunk-fpy4nam9.js +21933 -0
- package/dist/chunk-fqy0erkw.js +908 -0
- package/dist/chunk-ftqwza3a.js +43 -0
- package/dist/chunk-fyc5fepv.js +10 -0
- package/dist/chunk-fz0ch109.js +329 -0
- package/dist/chunk-fzhn8z8j.js +253 -0
- package/dist/chunk-g12brv6y.js +321 -0
- package/dist/chunk-g338npwr.js +1061 -0
- package/dist/chunk-g5tpks28.js +795 -0
- package/dist/chunk-g63tgj4f.js +58 -0
- package/dist/chunk-g827r0mk.js +266 -0
- package/dist/chunk-g8wzsxgc.js +2534 -0
- package/dist/chunk-gey7mwcw.js +36 -0
- package/dist/chunk-gghb9pks.js +120 -0
- package/dist/chunk-grdpaf1p.js +606 -0
- package/dist/chunk-gx8016vp.js +125 -0
- package/dist/chunk-h0qngp9w.js +157 -0
- package/dist/chunk-h0rbjg6x.js +55 -0
- package/dist/chunk-h1mr3371.js +121 -0
- package/dist/chunk-h3xwdgpd.js +68 -0
- package/dist/chunk-h4b85amj.js +2331 -0
- package/dist/chunk-h6d137aa.js +20 -0
- package/dist/chunk-h9n7z00d.js +95 -0
- package/dist/chunk-hakdhagh.js +16606 -0
- package/dist/chunk-hd8531ec.js +685 -0
- package/dist/chunk-heq3rn8t.js +33068 -0
- package/dist/chunk-hfvxc9fd.js +542 -0
- package/dist/chunk-hgpd0qmm.js +371 -0
- package/dist/chunk-hh7cmy4k.js +20 -0
- package/dist/chunk-hhjs87wh.js +1407 -0
- package/dist/chunk-hjtvdvgj.js +208 -0
- package/dist/chunk-hk9xz7gk.js +118 -0
- package/dist/chunk-hknbjky3.js +160798 -0
- package/dist/chunk-htsbqyf9.js +338 -0
- package/dist/chunk-htx7jmxk.js +78 -0
- package/dist/chunk-hzhe8ygc.js +547 -0
- package/dist/chunk-j2k4p94p.js +55 -0
- package/dist/chunk-j3a4p81y.js +184 -0
- package/dist/chunk-j46rb9m9.js +544 -0
- package/dist/chunk-j5bth84e.js +97 -0
- package/dist/chunk-j64ga6ta.js +8035 -0
- package/dist/chunk-j6jh72hw.js +140 -0
- package/dist/chunk-j9gxwbe3.js +349 -0
- package/dist/chunk-jaaxk89e.js +113 -0
- package/dist/chunk-jd32zbps.js +15 -0
- package/dist/chunk-jdgeec04.js +4249 -0
- package/dist/chunk-jk826edv.js +174 -0
- package/dist/chunk-jnhkref0.js +30 -0
- package/dist/chunk-jsx72hep.js +208 -0
- package/dist/chunk-jx817w05.js +11 -0
- package/dist/chunk-jzmz18nn.js +65 -0
- package/dist/chunk-k0p9w03v.js +4957 -0
- package/dist/chunk-k3s4yk22.js +477 -0
- package/dist/chunk-kfd89dsd.js +21 -0
- package/dist/chunk-kgfz4522.js +126 -0
- package/dist/chunk-kn6zg6bd.js +524 -0
- package/dist/chunk-kp9vkzj6.js +120 -0
- package/dist/chunk-kraf793v.js +118 -0
- package/dist/chunk-kw0r30h3.js +208 -0
- package/dist/chunk-kwekc97v.js +18 -0
- package/dist/chunk-m2bcpk8j.js +30 -0
- package/dist/chunk-m2kp5f7p.js +4389 -0
- package/dist/chunk-m74w3187.js +164 -0
- package/dist/chunk-m88q4jmb.js +61 -0
- package/dist/chunk-man6wb4n.js +1456 -0
- package/dist/chunk-mdk3xgya.js +42 -0
- package/dist/chunk-mf4g439x.js +82 -0
- package/dist/chunk-mg8g0xqs.js +71 -0
- package/dist/chunk-mkwzrqvf.js +38 -0
- package/dist/chunk-mn61mk4v.js +351 -0
- package/dist/chunk-ms09sxcj.js +908 -0
- package/dist/chunk-mtn1anwe.js +2351 -0
- package/dist/chunk-mv0zm0qj.js +65 -0
- package/dist/chunk-mx28h61f.js +1147 -0
- package/dist/chunk-mxbf8ajn.js +1067 -0
- package/dist/chunk-n0qaeaa5.js +256 -0
- package/dist/chunk-n34z5cw8.js +74 -0
- package/dist/chunk-n55ehz77.js +120 -0
- package/dist/chunk-n7ttdtk0.js +641 -0
- package/dist/chunk-n9ktjngj.js +336 -0
- package/dist/chunk-nb2ntesh.js +149 -0
- package/dist/chunk-netzwgv1.js +154 -0
- package/dist/chunk-nh3cd07f.js +14358 -0
- package/dist/chunk-nka1g8f4.js +773 -0
- package/dist/chunk-nm97cw83.js +458 -0
- package/dist/chunk-nq0fxyxh.js +752 -0
- package/dist/chunk-nt837qt9.js +21 -0
- package/dist/chunk-nx87c0vw.js +250 -0
- package/dist/chunk-nxw6y6xm.js +862 -0
- package/dist/chunk-nzt717xg.js +32 -0
- package/dist/chunk-p2816w9z.js +1486 -0
- package/dist/chunk-p2d5nh3g.js +342 -0
- package/dist/chunk-p9cdykwf.js +72 -0
- package/dist/chunk-paxw1ryd.js +227 -0
- package/dist/chunk-ph5g4d1j.js +109 -0
- package/dist/chunk-pp42p8y3.js +574 -0
- package/dist/chunk-ppdn71n4.js +400 -0
- package/dist/chunk-ppwjyveh.js +8 -0
- package/dist/chunk-ps49ymvj.js +43 -0
- package/dist/chunk-pshjyzq4.js +17656 -0
- package/dist/chunk-pw8nf9rt.js +126 -0
- package/dist/chunk-pwwa7s62.js +11 -0
- package/dist/chunk-py3zxq5j.js +129 -0
- package/dist/chunk-pyz1qswz.js +300 -0
- package/dist/chunk-q50q8mc5.js +157 -0
- package/dist/chunk-q7tpyeb3.js +39 -0
- package/dist/chunk-q82r31er.js +151 -0
- package/dist/chunk-qajrkk97.js +298 -0
- package/dist/chunk-qcpxnyeh.js +110 -0
- package/dist/chunk-qeabchwr.js +132 -0
- package/dist/chunk-qm7nbd10.js +755 -0
- package/dist/chunk-qm8j7kxr.js +280 -0
- package/dist/chunk-qmwgg5zy.js +136 -0
- package/dist/chunk-qnfx3qtx.js +617 -0
- package/dist/chunk-qp2qdcda.js +100 -0
- package/dist/chunk-qphaajd7.js +305 -0
- package/dist/chunk-qt21xxgm.js +419 -0
- package/dist/chunk-qy2z2p0b.js +122 -0
- package/dist/chunk-qyz8q0dj.js +689 -0
- package/dist/chunk-qz2x630m.js +49145 -0
- package/dist/chunk-qzq5n1yn.js +76 -0
- package/dist/chunk-r0ya57xw.js +170 -0
- package/dist/chunk-r7j395t6.js +122 -0
- package/dist/chunk-r7trcrs7.js +62 -0
- package/dist/chunk-re4yh70t.js +1095 -0
- package/dist/chunk-rhte1r8g.js +272 -0
- package/dist/chunk-rhw4ayb1.js +6851 -0
- package/dist/chunk-rn0v1hk8.js +34 -0
- package/dist/chunk-rphakhme.js +281 -0
- package/dist/chunk-rrtzz2pv.js +32 -0
- package/dist/chunk-rtnjk8ge.js +726 -0
- package/dist/chunk-rwhswkma.js +87 -0
- package/dist/chunk-rxd4kn2g.js +308 -0
- package/dist/chunk-s083x8ry.js +2840 -0
- package/dist/chunk-s16sn02n.js +365 -0
- package/dist/chunk-s1s8qfdh.js +182 -0
- package/dist/chunk-s2bwz69v.js +473 -0
- package/dist/chunk-s3pzvdss.js +50 -0
- package/dist/chunk-s9y6t0mt.js +291 -0
- package/dist/chunk-sd36yzx8.js +954 -0
- package/dist/chunk-se8xzw8h.js +87 -0
- package/dist/chunk-sg66v252.js +1648 -0
- package/dist/chunk-sg7gf3hj.js +1585 -0
- package/dist/chunk-spx24x6j.js +98 -0
- package/dist/chunk-sybxpy18.js +73 -0
- package/dist/chunk-szj5wvdy.js +28 -0
- package/dist/chunk-t0gb304x.js +182 -0
- package/dist/chunk-t3fr4skc.js +165 -0
- package/dist/chunk-t58wfamm.js +5368 -0
- package/dist/chunk-t6s2kkm3.js +104 -0
- package/dist/chunk-t8hv0x81.js +116 -0
- package/dist/chunk-tezak8rx.js +6157 -0
- package/dist/chunk-th5y3hj5.js +189 -0
- package/dist/chunk-tj0d3870.js +180 -0
- package/dist/chunk-tjgsawpx.js +40 -0
- package/dist/chunk-ts2p6bv1.js +224 -0
- package/dist/chunk-ttk5dzz8.js +25 -0
- package/dist/chunk-tv9pcdnz.js +51 -0
- package/dist/chunk-ty99rgvw.js +122 -0
- package/dist/chunk-tzgp8av2.js +61 -0
- package/dist/chunk-v1kzp02e.js +785 -0
- package/dist/chunk-v2c9dq7t.js +275 -0
- package/dist/chunk-v3aq3heg.js +620 -0
- package/dist/chunk-v78fj8by.js +145 -0
- package/dist/chunk-v9smspw2.js +4301 -0
- package/dist/chunk-var1et7e.js +66 -0
- package/dist/chunk-vchrkvet.js +120 -0
- package/dist/chunk-vest0y6x.js +3830 -0
- package/dist/chunk-vf5sd1nq.js +12 -0
- package/dist/chunk-vf612n57.js +472 -0
- package/dist/chunk-vgpy9md6.js +339 -0
- package/dist/chunk-vkzt82ry.js +644 -0
- package/dist/chunk-vsh80y0c.js +100 -0
- package/dist/chunk-vxkdxhyk.js +103 -0
- package/dist/chunk-vxt6ywm9.js +485 -0
- package/dist/chunk-vyjeh50y.js +2149 -0
- package/dist/chunk-vytdzvqs.js +1181 -0
- package/dist/chunk-w0qks2ja.js +1030 -0
- package/dist/chunk-wfz0qffj.js +3939 -0
- package/dist/chunk-wp1568nt.js +828 -0
- package/dist/chunk-wpckhx7b.js +66 -0
- package/dist/chunk-wpvkvwvc.js +41 -0
- package/dist/chunk-ws5d6qs4.js +655 -0
- package/dist/chunk-wsnxrrb5.js +986 -0
- package/dist/chunk-wyavftcj.js +103 -0
- package/dist/chunk-wybh0bvv.js +121 -0
- package/dist/chunk-wzpdet3m.js +843 -0
- package/dist/chunk-x2dp18yj.js +74 -0
- package/dist/chunk-x6r4v44b.js +8 -0
- package/dist/chunk-x7r5k0hf.js +423 -0
- package/dist/chunk-xahk20z8.js +877 -0
- package/dist/chunk-xajwdaxm.js +295 -0
- package/dist/chunk-xkt36p6r.js +61 -0
- package/dist/chunk-xnav6j8h.js +490 -0
- package/dist/chunk-xrj294jg.js +440 -0
- package/dist/chunk-xsq9ae7x.js +90 -0
- package/dist/chunk-xt9z9t7b.js +40 -0
- package/dist/chunk-xv3era3s.js +8 -0
- package/dist/chunk-y1784krc.js +19 -0
- package/dist/chunk-y289fz8y.js +116 -0
- package/dist/chunk-y3r7v9pq.js +336 -0
- package/dist/chunk-y98z50mm.js +158 -0
- package/dist/chunk-yhce3x0q.js +64 -0
- package/dist/chunk-yhhf6n9p.js +338 -0
- package/dist/chunk-ykr34msh.js +411 -0
- package/dist/chunk-yks9ggzn.js +103 -0
- package/dist/chunk-ym5r3jnk.js +2007 -0
- package/dist/chunk-ypa349qq.js +148 -0
- package/dist/chunk-yzx3mhfd.js +110 -0
- package/dist/chunk-z1bs6d7k.js +24 -0
- package/dist/chunk-z2dp53wn.js +17 -0
- package/dist/chunk-z3k0k30d.js +882 -0
- package/dist/chunk-z42cqdtf.js +107 -0
- package/dist/chunk-z7asrz6j.js +259 -0
- package/dist/chunk-za09fhhh.js +716 -0
- package/dist/chunk-zae0t3p4.js +252 -0
- package/dist/chunk-zbsw794g.js +259 -0
- package/dist/chunk-ze6zvkg6.js +22820 -0
- package/dist/chunk-zejm280k.js +39 -0
- package/dist/chunk-zk2wsm7d.js +15 -0
- package/dist/chunk-znf2b75k.js +113 -0
- package/dist/chunk-zqpnvsdz.js +24 -0
- package/dist/chunk-zs2gdkj5.js +433 -0
- package/dist/chunk-zseb1639.js +37 -0
- package/dist/chunk-zsgha506.js +63 -0
- package/dist/chunk-zvsfgmq8.js +146 -0
- package/dist/chunk-zw5xd7m9.js +160 -0
- package/dist/chunk-zzm33q8x.js +8 -0
- package/dist/cli.js +97 -0
- package/dist/download-ripgrep.js +24821 -0
- package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
- package/package.json +178 -0
- package/scripts/download-ripgrep.ts +335 -0
- package/scripts/postinstall.cjs +319 -0
|
@@ -0,0 +1,1407 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
getAutoModeDenials,
|
|
4
|
+
init_autoModeDenials
|
|
5
|
+
} from "./chunk-0paqc2yw.js";
|
|
6
|
+
import {
|
|
7
|
+
detectUnreachableRules,
|
|
8
|
+
init_shadowedRuleDetection
|
|
9
|
+
} from "./chunk-641hawvm.js";
|
|
10
|
+
import {
|
|
11
|
+
SearchBox,
|
|
12
|
+
init_SearchBox
|
|
13
|
+
} from "./chunk-21mfpnva.js";
|
|
14
|
+
import {
|
|
15
|
+
init_useSearchInput,
|
|
16
|
+
useSearchInput
|
|
17
|
+
} from "./chunk-9q93n4w6.js";
|
|
18
|
+
import {
|
|
19
|
+
Tab,
|
|
20
|
+
init_Tabs,
|
|
21
|
+
useTabHeaderFocus,
|
|
22
|
+
useTabsWidth
|
|
23
|
+
} from "./chunk-mv0zm0qj.js";
|
|
24
|
+
import {
|
|
25
|
+
AddWorkspaceDirectory,
|
|
26
|
+
init_AddWorkspaceDirectory
|
|
27
|
+
} from "./chunk-xajwdaxm.js";
|
|
28
|
+
import"./chunk-q50q8mc5.js";
|
|
29
|
+
import"./chunk-24k6t9fa.js";
|
|
30
|
+
import"./chunk-z1bs6d7k.js";
|
|
31
|
+
import {
|
|
32
|
+
BashTool,
|
|
33
|
+
SandboxManager,
|
|
34
|
+
Select,
|
|
35
|
+
TextInput,
|
|
36
|
+
WebFetchTool,
|
|
37
|
+
applyPermissionUpdate,
|
|
38
|
+
createPermissionRetryMessage,
|
|
39
|
+
deletePermissionRule,
|
|
40
|
+
getAllowRules,
|
|
41
|
+
getAskRules,
|
|
42
|
+
getDenyRules,
|
|
43
|
+
init_AppState,
|
|
44
|
+
init_BashTool,
|
|
45
|
+
init_PermissionUpdate,
|
|
46
|
+
init_TextInput,
|
|
47
|
+
init_WebFetchTool,
|
|
48
|
+
init_messages1 as init_messages,
|
|
49
|
+
init_permissions,
|
|
50
|
+
init_sandbox_adapter,
|
|
51
|
+
init_select,
|
|
52
|
+
init_useTerminalSize,
|
|
53
|
+
permissionRuleSourceDisplayString,
|
|
54
|
+
persistPermissionUpdate,
|
|
55
|
+
useAppState,
|
|
56
|
+
useSetAppState,
|
|
57
|
+
useTerminalSize
|
|
58
|
+
} from "./chunk-hknbjky3.js";
|
|
59
|
+
import"./chunk-a4psxnr1.js";
|
|
60
|
+
import"./chunk-613f6fbv.js";
|
|
61
|
+
import"./chunk-zejm280k.js";
|
|
62
|
+
import"./chunk-57qz90z8.js";
|
|
63
|
+
import"./chunk-4nspekjp.js";
|
|
64
|
+
import"./chunk-heq3rn8t.js";
|
|
65
|
+
import"./chunk-var1et7e.js";
|
|
66
|
+
import"./chunk-e0pth8g7.js";
|
|
67
|
+
import"./chunk-ws5d6qs4.js";
|
|
68
|
+
import"./chunk-bxcfz5gy.js";
|
|
69
|
+
import"./chunk-wp1568nt.js";
|
|
70
|
+
import"./chunk-2gzv8nrw.js";
|
|
71
|
+
import"./chunk-ehtwnxpg.js";
|
|
72
|
+
import"./chunk-cgfdkzhb.js";
|
|
73
|
+
import"./chunk-8h6sdj66.js";
|
|
74
|
+
import {
|
|
75
|
+
init_useExitOnCtrlCDWithKeybindings,
|
|
76
|
+
useExitOnCtrlCDWithKeybindings
|
|
77
|
+
} from "./chunk-75zk7zr1.js";
|
|
78
|
+
import"./chunk-j5bth84e.js";
|
|
79
|
+
import"./chunk-qm7nbd10.js";
|
|
80
|
+
import"./chunk-5pevjsyw.js";
|
|
81
|
+
import {
|
|
82
|
+
init_useKeybinding,
|
|
83
|
+
useKeybinding
|
|
84
|
+
} from "./chunk-xnav6j8h.js";
|
|
85
|
+
import"./chunk-ps49ymvj.js";
|
|
86
|
+
import"./chunk-zk2wsm7d.js";
|
|
87
|
+
import"./chunk-2t0xa4dt.js";
|
|
88
|
+
import"./chunk-bgpkemkg.js";
|
|
89
|
+
import"./chunk-rrtzz2pv.js";
|
|
90
|
+
import"./chunk-zsgha506.js";
|
|
91
|
+
import"./chunk-4jm600zv.js";
|
|
92
|
+
import"./chunk-xkt36p6r.js";
|
|
93
|
+
import"./chunk-2ekjxh7d.js";
|
|
94
|
+
import"./chunk-85tag8nv.js";
|
|
95
|
+
import"./chunk-mx28h61f.js";
|
|
96
|
+
import"./chunk-kraf793v.js";
|
|
97
|
+
import"./chunk-bj8x29tz.js";
|
|
98
|
+
import"./chunk-zae0t3p4.js";
|
|
99
|
+
import"./chunk-t58wfamm.js";
|
|
100
|
+
import"./chunk-chsyvavm.js";
|
|
101
|
+
import"./chunk-6mpw9h55.js";
|
|
102
|
+
import {
|
|
103
|
+
SOURCES,
|
|
104
|
+
getRelativeSettingsFilePathForSource,
|
|
105
|
+
init_constants,
|
|
106
|
+
init_permissionRuleParser,
|
|
107
|
+
init_settings1 as init_settings,
|
|
108
|
+
init_stringUtils,
|
|
109
|
+
permissionRuleValueFromString,
|
|
110
|
+
permissionRuleValueToString,
|
|
111
|
+
plural
|
|
112
|
+
} from "./chunk-7b6bg1r4.js";
|
|
113
|
+
import"./chunk-sg66v252.js";
|
|
114
|
+
import"./chunk-8bwqtasa.js";
|
|
115
|
+
import"./chunk-j9gxwbe3.js";
|
|
116
|
+
import"./chunk-1cwdhk7a.js";
|
|
117
|
+
import"./chunk-rtnjk8ge.js";
|
|
118
|
+
import"./chunk-64c1avct.js";
|
|
119
|
+
import"./chunk-8g5pe1gr.js";
|
|
120
|
+
import"./chunk-gx8016vp.js";
|
|
121
|
+
import"./chunk-4cp6193g.js";
|
|
122
|
+
import"./chunk-8g747a8x.js";
|
|
123
|
+
import"./chunk-d7886r6a.js";
|
|
124
|
+
import"./chunk-f5ma3nh5.js";
|
|
125
|
+
import"./chunk-qz2x630m.js";
|
|
126
|
+
import"./chunk-r7j395t6.js";
|
|
127
|
+
import"./chunk-tv9pcdnz.js";
|
|
128
|
+
import"./chunk-3c25bcsw.js";
|
|
129
|
+
import"./chunk-n9ktjngj.js";
|
|
130
|
+
import"./chunk-q82r31er.js";
|
|
131
|
+
import"./chunk-p2816w9z.js";
|
|
132
|
+
import"./chunk-v9smspw2.js";
|
|
133
|
+
import"./chunk-v1kzp02e.js";
|
|
134
|
+
import"./chunk-64hks9ax.js";
|
|
135
|
+
import"./chunk-crmjpsqe.js";
|
|
136
|
+
import {
|
|
137
|
+
Dialog,
|
|
138
|
+
Newline,
|
|
139
|
+
Pane,
|
|
140
|
+
StatusIcon,
|
|
141
|
+
Tabs,
|
|
142
|
+
ThemedBox_default,
|
|
143
|
+
ThemedText,
|
|
144
|
+
init_source,
|
|
145
|
+
init_src,
|
|
146
|
+
source_default,
|
|
147
|
+
useTerminalFocus,
|
|
148
|
+
use_input_default
|
|
149
|
+
} from "./chunk-cmsknj6n.js";
|
|
150
|
+
import {
|
|
151
|
+
require_jsx_dev_runtime,
|
|
152
|
+
require_react
|
|
153
|
+
} from "./chunk-g338npwr.js";
|
|
154
|
+
import"./chunk-h0rbjg6x.js";
|
|
155
|
+
import"./chunk-0vkfrmqm.js";
|
|
156
|
+
import"./chunk-0xjaqda8.js";
|
|
157
|
+
import"./chunk-h1mr3371.js";
|
|
158
|
+
import"./chunk-36b2q5fg.js";
|
|
159
|
+
import"./chunk-a7rhvq9b.js";
|
|
160
|
+
import"./chunk-qnfx3qtx.js";
|
|
161
|
+
import"./chunk-m74w3187.js";
|
|
162
|
+
import"./chunk-b81hd3m6.js";
|
|
163
|
+
import"./chunk-y3r7v9pq.js";
|
|
164
|
+
import"./chunk-8tnsngw2.js";
|
|
165
|
+
import"./chunk-awb4vc41.js";
|
|
166
|
+
import"./chunk-cbrt5vsb.js";
|
|
167
|
+
import"./chunk-5z28bqne.js";
|
|
168
|
+
import {
|
|
169
|
+
figures_default,
|
|
170
|
+
init_figures
|
|
171
|
+
} from "./chunk-qajrkk97.js";
|
|
172
|
+
import {
|
|
173
|
+
init_slowOperations,
|
|
174
|
+
jsonStringify
|
|
175
|
+
} from "./chunk-404qm8xt.js";
|
|
176
|
+
import"./chunk-fbv4apne.js";
|
|
177
|
+
import"./chunk-jaaxk89e.js";
|
|
178
|
+
import {
|
|
179
|
+
getOriginalCwd,
|
|
180
|
+
init_state
|
|
181
|
+
} from "./chunk-h4b85amj.js";
|
|
182
|
+
import"./chunk-07069jq1.js";
|
|
183
|
+
import"./chunk-vf612n57.js";
|
|
184
|
+
import"./chunk-d4mdda98.js";
|
|
185
|
+
import"./chunk-7wm5s02e.js";
|
|
186
|
+
import"./chunk-4g3v8y12.js";
|
|
187
|
+
import"./chunk-7739pg2c.js";
|
|
188
|
+
import"./chunk-nh3cd07f.js";
|
|
189
|
+
import"./chunk-8pn8tvgg.js";
|
|
190
|
+
import"./chunk-netzwgv1.js";
|
|
191
|
+
import {
|
|
192
|
+
__esm,
|
|
193
|
+
__toESM
|
|
194
|
+
} from "./chunk-qp2qdcda.js";
|
|
195
|
+
|
|
196
|
+
// src/components/permissions/rules/PermissionRuleDescription.tsx
|
|
197
|
+
function PermissionRuleDescription({
|
|
198
|
+
ruleValue
|
|
199
|
+
}) {
|
|
200
|
+
switch (ruleValue.toolName) {
|
|
201
|
+
case BashTool.name: {
|
|
202
|
+
if (ruleValue.ruleContent) {
|
|
203
|
+
if (ruleValue.ruleContent.endsWith(":*")) {
|
|
204
|
+
return /* @__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: ruleValue.ruleContent.slice(0, -2)
|
|
212
|
+
}, undefined, false, undefined, this)
|
|
213
|
+
]
|
|
214
|
+
}, undefined, true, undefined, this);
|
|
215
|
+
} else {
|
|
216
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
217
|
+
dimColor: true,
|
|
218
|
+
children: [
|
|
219
|
+
"The Bash command ",
|
|
220
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
221
|
+
bold: true,
|
|
222
|
+
children: ruleValue.ruleContent
|
|
223
|
+
}, undefined, false, undefined, this)
|
|
224
|
+
]
|
|
225
|
+
}, undefined, true, undefined, this);
|
|
226
|
+
}
|
|
227
|
+
} else {
|
|
228
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
229
|
+
dimColor: true,
|
|
230
|
+
children: "Any Bash command"
|
|
231
|
+
}, undefined, false, undefined, this);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
default: {
|
|
235
|
+
if (!ruleValue.ruleContent) {
|
|
236
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
237
|
+
dimColor: true,
|
|
238
|
+
children: [
|
|
239
|
+
"Any use of the ",
|
|
240
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
241
|
+
bold: true,
|
|
242
|
+
children: ruleValue.toolName
|
|
243
|
+
}, undefined, false, undefined, this),
|
|
244
|
+
" tool"
|
|
245
|
+
]
|
|
246
|
+
}, undefined, true, undefined, this);
|
|
247
|
+
} else {
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
var jsx_dev_runtime;
|
|
254
|
+
var init_PermissionRuleDescription = __esm(() => {
|
|
255
|
+
init_src();
|
|
256
|
+
init_BashTool();
|
|
257
|
+
jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// src/components/permissions/rules/AddPermissionRules.tsx
|
|
261
|
+
function optionForPermissionSaveDestination(saveDestination) {
|
|
262
|
+
switch (saveDestination) {
|
|
263
|
+
case "localSettings":
|
|
264
|
+
return {
|
|
265
|
+
label: "Project settings (local)",
|
|
266
|
+
description: `Saved in ${getRelativeSettingsFilePathForSource("localSettings")}`,
|
|
267
|
+
value: saveDestination
|
|
268
|
+
};
|
|
269
|
+
case "projectSettings":
|
|
270
|
+
return {
|
|
271
|
+
label: "Project settings",
|
|
272
|
+
description: `Checked in at ${getRelativeSettingsFilePathForSource("projectSettings")}`,
|
|
273
|
+
value: saveDestination
|
|
274
|
+
};
|
|
275
|
+
case "userSettings":
|
|
276
|
+
return {
|
|
277
|
+
label: "User settings",
|
|
278
|
+
description: `Saved in at ~/.claude/settings.json`,
|
|
279
|
+
value: saveDestination
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
function AddPermissionRules({
|
|
284
|
+
onAddRules,
|
|
285
|
+
onCancel,
|
|
286
|
+
ruleValues,
|
|
287
|
+
ruleBehavior,
|
|
288
|
+
initialContext,
|
|
289
|
+
setToolPermissionContext
|
|
290
|
+
}) {
|
|
291
|
+
const allOptions = SOURCES.map(optionForPermissionSaveDestination);
|
|
292
|
+
const onSelect = import_react.useCallback((selectedValue) => {
|
|
293
|
+
if (selectedValue === "cancel") {
|
|
294
|
+
onCancel();
|
|
295
|
+
return;
|
|
296
|
+
} else if (SOURCES.includes(selectedValue)) {
|
|
297
|
+
const destination = selectedValue;
|
|
298
|
+
const updatedContext = applyPermissionUpdate(initialContext, {
|
|
299
|
+
type: "addRules",
|
|
300
|
+
rules: ruleValues,
|
|
301
|
+
behavior: ruleBehavior,
|
|
302
|
+
destination
|
|
303
|
+
});
|
|
304
|
+
persistPermissionUpdate({
|
|
305
|
+
type: "addRules",
|
|
306
|
+
rules: ruleValues,
|
|
307
|
+
behavior: ruleBehavior,
|
|
308
|
+
destination
|
|
309
|
+
});
|
|
310
|
+
setToolPermissionContext(updatedContext);
|
|
311
|
+
const rules = ruleValues.map((ruleValue) => ({
|
|
312
|
+
ruleValue,
|
|
313
|
+
ruleBehavior,
|
|
314
|
+
source: destination
|
|
315
|
+
}));
|
|
316
|
+
const sandboxAutoAllowEnabled = SandboxManager.isSandboxingEnabled() && SandboxManager.isAutoAllowBashIfSandboxedEnabled();
|
|
317
|
+
const allUnreachable = detectUnreachableRules(updatedContext, {
|
|
318
|
+
sandboxAutoAllowEnabled
|
|
319
|
+
});
|
|
320
|
+
const newUnreachable = allUnreachable.filter((u) => ruleValues.some((rv) => rv.toolName === u.rule.ruleValue.toolName && rv.ruleContent === u.rule.ruleValue.ruleContent));
|
|
321
|
+
onAddRules(rules, newUnreachable.length > 0 ? newUnreachable : undefined);
|
|
322
|
+
}
|
|
323
|
+
}, [
|
|
324
|
+
onAddRules,
|
|
325
|
+
onCancel,
|
|
326
|
+
ruleValues,
|
|
327
|
+
ruleBehavior,
|
|
328
|
+
initialContext,
|
|
329
|
+
setToolPermissionContext
|
|
330
|
+
]);
|
|
331
|
+
const title = `Add ${ruleBehavior} permission ${plural(ruleValues.length, "rule")}`;
|
|
332
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Dialog, {
|
|
333
|
+
title,
|
|
334
|
+
onCancel,
|
|
335
|
+
color: "permission",
|
|
336
|
+
children: [
|
|
337
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
|
|
338
|
+
flexDirection: "column",
|
|
339
|
+
paddingX: 2,
|
|
340
|
+
children: ruleValues.map((ruleValue) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
|
|
341
|
+
flexDirection: "column",
|
|
342
|
+
children: [
|
|
343
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
|
|
344
|
+
bold: true,
|
|
345
|
+
children: permissionRuleValueToString(ruleValue)
|
|
346
|
+
}, undefined, false, undefined, this),
|
|
347
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(PermissionRuleDescription, {
|
|
348
|
+
ruleValue
|
|
349
|
+
}, undefined, false, undefined, this)
|
|
350
|
+
]
|
|
351
|
+
}, permissionRuleValueToString(ruleValue), true, undefined, this))
|
|
352
|
+
}, undefined, false, undefined, this),
|
|
353
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
|
|
354
|
+
flexDirection: "column",
|
|
355
|
+
marginY: 1,
|
|
356
|
+
children: [
|
|
357
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
|
|
358
|
+
children: ruleValues.length === 1 ? "Where should this rule be saved?" : "Where should these rules be saved?"
|
|
359
|
+
}, undefined, false, undefined, this),
|
|
360
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Select, {
|
|
361
|
+
options: allOptions,
|
|
362
|
+
onChange: onSelect
|
|
363
|
+
}, undefined, false, undefined, this)
|
|
364
|
+
]
|
|
365
|
+
}, undefined, true, undefined, this)
|
|
366
|
+
]
|
|
367
|
+
}, undefined, true, undefined, this);
|
|
368
|
+
}
|
|
369
|
+
var import_react, jsx_dev_runtime2;
|
|
370
|
+
var init_AddPermissionRules = __esm(() => {
|
|
371
|
+
init_select();
|
|
372
|
+
init_src();
|
|
373
|
+
init_PermissionUpdate();
|
|
374
|
+
init_permissionRuleParser();
|
|
375
|
+
init_shadowedRuleDetection();
|
|
376
|
+
init_sandbox_adapter();
|
|
377
|
+
init_constants();
|
|
378
|
+
init_settings();
|
|
379
|
+
init_stringUtils();
|
|
380
|
+
init_PermissionRuleDescription();
|
|
381
|
+
import_react = __toESM(require_react(), 1);
|
|
382
|
+
jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
// src/components/permissions/rules/PermissionRuleInput.tsx
|
|
386
|
+
function PermissionRuleInput({
|
|
387
|
+
onCancel,
|
|
388
|
+
onSubmit,
|
|
389
|
+
ruleBehavior
|
|
390
|
+
}) {
|
|
391
|
+
const [inputValue, setInputValue] = import_react2.useState("");
|
|
392
|
+
const [cursorOffset, setCursorOffset] = import_react2.useState(0);
|
|
393
|
+
const exitState = useExitOnCtrlCDWithKeybindings();
|
|
394
|
+
useKeybinding("confirm:no", onCancel, { context: "Settings" });
|
|
395
|
+
const { columns } = useTerminalSize();
|
|
396
|
+
const textInputColumns = columns - 6;
|
|
397
|
+
const handleSubmit = (value) => {
|
|
398
|
+
const trimmedValue = value.trim();
|
|
399
|
+
if (trimmedValue.length === 0) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
const ruleValue = permissionRuleValueFromString(trimmedValue);
|
|
403
|
+
onSubmit(ruleValue, ruleBehavior);
|
|
404
|
+
};
|
|
405
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
|
|
406
|
+
children: [
|
|
407
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
|
|
408
|
+
flexDirection: "column",
|
|
409
|
+
gap: 1,
|
|
410
|
+
borderStyle: "round",
|
|
411
|
+
paddingLeft: 1,
|
|
412
|
+
paddingRight: 1,
|
|
413
|
+
borderColor: "permission",
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
416
|
+
bold: true,
|
|
417
|
+
color: "permission",
|
|
418
|
+
children: [
|
|
419
|
+
"Add ",
|
|
420
|
+
ruleBehavior,
|
|
421
|
+
" permission rule"
|
|
422
|
+
]
|
|
423
|
+
}, undefined, true, undefined, this),
|
|
424
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
|
|
425
|
+
flexDirection: "column",
|
|
426
|
+
children: [
|
|
427
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
428
|
+
children: [
|
|
429
|
+
"Permission rules are a tool name, optionally followed by a specifier in parentheses.",
|
|
430
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Newline, {}, undefined, false, undefined, this),
|
|
431
|
+
"e.g.,",
|
|
432
|
+
" ",
|
|
433
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
434
|
+
bold: true,
|
|
435
|
+
children: permissionRuleValueToString({ toolName: WebFetchTool.name })
|
|
436
|
+
}, undefined, false, undefined, this),
|
|
437
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
438
|
+
bold: false,
|
|
439
|
+
children: " or "
|
|
440
|
+
}, undefined, false, undefined, this),
|
|
441
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
442
|
+
bold: true,
|
|
443
|
+
children: permissionRuleValueToString({
|
|
444
|
+
toolName: BashTool.name,
|
|
445
|
+
ruleContent: "ls:*"
|
|
446
|
+
})
|
|
447
|
+
}, undefined, false, undefined, this)
|
|
448
|
+
]
|
|
449
|
+
}, undefined, true, undefined, this),
|
|
450
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
|
|
451
|
+
borderDimColor: true,
|
|
452
|
+
borderStyle: "round",
|
|
453
|
+
marginY: 1,
|
|
454
|
+
paddingLeft: 1,
|
|
455
|
+
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(TextInput, {
|
|
456
|
+
showCursor: true,
|
|
457
|
+
value: inputValue,
|
|
458
|
+
onChange: setInputValue,
|
|
459
|
+
onSubmit: handleSubmit,
|
|
460
|
+
placeholder: `Enter permission rule${figures_default.ellipsis}`,
|
|
461
|
+
columns: textInputColumns,
|
|
462
|
+
cursorOffset,
|
|
463
|
+
onChangeCursorOffset: setCursorOffset
|
|
464
|
+
}, undefined, false, undefined, this)
|
|
465
|
+
}, undefined, false, undefined, this)
|
|
466
|
+
]
|
|
467
|
+
}, undefined, true, undefined, this)
|
|
468
|
+
]
|
|
469
|
+
}, undefined, true, undefined, this),
|
|
470
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
|
|
471
|
+
marginLeft: 3,
|
|
472
|
+
children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
473
|
+
dimColor: true,
|
|
474
|
+
children: [
|
|
475
|
+
"Press ",
|
|
476
|
+
exitState.keyName,
|
|
477
|
+
" again to exit"
|
|
478
|
+
]
|
|
479
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
480
|
+
dimColor: true,
|
|
481
|
+
children: "Enter to submit \xB7 Esc to cancel"
|
|
482
|
+
}, undefined, false, undefined, this)
|
|
483
|
+
}, undefined, false, undefined, this)
|
|
484
|
+
]
|
|
485
|
+
}, undefined, true, undefined, this);
|
|
486
|
+
}
|
|
487
|
+
var import_react2, jsx_dev_runtime3;
|
|
488
|
+
var init_PermissionRuleInput = __esm(() => {
|
|
489
|
+
init_figures();
|
|
490
|
+
init_TextInput();
|
|
491
|
+
init_useExitOnCtrlCDWithKeybindings();
|
|
492
|
+
init_useTerminalSize();
|
|
493
|
+
init_src();
|
|
494
|
+
init_useKeybinding();
|
|
495
|
+
init_BashTool();
|
|
496
|
+
init_WebFetchTool();
|
|
497
|
+
init_permissionRuleParser();
|
|
498
|
+
import_react2 = __toESM(require_react(), 1);
|
|
499
|
+
jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
// src/components/permissions/rules/RecentDenialsTab.tsx
|
|
503
|
+
function RecentDenialsTab({
|
|
504
|
+
onHeaderFocusChange,
|
|
505
|
+
onStateChange
|
|
506
|
+
}) {
|
|
507
|
+
const { headerFocused, focusHeader } = useTabHeaderFocus();
|
|
508
|
+
import_react3.useEffect(() => {
|
|
509
|
+
onHeaderFocusChange?.(headerFocused);
|
|
510
|
+
}, [headerFocused, onHeaderFocusChange]);
|
|
511
|
+
const [denials] = import_react3.useState(() => getAutoModeDenials());
|
|
512
|
+
const [approved, setApproved] = import_react3.useState(() => new Set);
|
|
513
|
+
const [retry, setRetry] = import_react3.useState(() => new Set);
|
|
514
|
+
const [focusedIdx, setFocusedIdx] = import_react3.useState(0);
|
|
515
|
+
import_react3.useEffect(() => {
|
|
516
|
+
onStateChange({ approved, retry, denials });
|
|
517
|
+
}, [approved, retry, denials, onStateChange]);
|
|
518
|
+
const handleSelect = import_react3.useCallback((value) => {
|
|
519
|
+
const idx = Number(value);
|
|
520
|
+
setApproved((prev) => {
|
|
521
|
+
const next = new Set(prev);
|
|
522
|
+
if (next.has(idx))
|
|
523
|
+
next.delete(idx);
|
|
524
|
+
else
|
|
525
|
+
next.add(idx);
|
|
526
|
+
return next;
|
|
527
|
+
});
|
|
528
|
+
}, []);
|
|
529
|
+
const handleFocus = import_react3.useCallback((value) => {
|
|
530
|
+
setFocusedIdx(Number(value));
|
|
531
|
+
}, []);
|
|
532
|
+
use_input_default((input, _key) => {
|
|
533
|
+
if (input === "r") {
|
|
534
|
+
setRetry((prev) => {
|
|
535
|
+
const next = new Set(prev);
|
|
536
|
+
if (next.has(focusedIdx))
|
|
537
|
+
next.delete(focusedIdx);
|
|
538
|
+
else
|
|
539
|
+
next.add(focusedIdx);
|
|
540
|
+
return next;
|
|
541
|
+
});
|
|
542
|
+
setApproved((prev) => {
|
|
543
|
+
if (prev.has(focusedIdx))
|
|
544
|
+
return prev;
|
|
545
|
+
const next = new Set(prev);
|
|
546
|
+
next.add(focusedIdx);
|
|
547
|
+
return next;
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
}, { isActive: denials.length > 0 });
|
|
551
|
+
if (denials.length === 0) {
|
|
552
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
553
|
+
dimColor: true,
|
|
554
|
+
children: "No recent denials. Commands denied by the auto mode classifier will appear here."
|
|
555
|
+
}, undefined, false, undefined, this);
|
|
556
|
+
}
|
|
557
|
+
const options = denials.map((d, idx) => {
|
|
558
|
+
const isApproved = approved.has(idx);
|
|
559
|
+
const suffix = retry.has(idx) ? " (retry)" : "";
|
|
560
|
+
return {
|
|
561
|
+
label: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
562
|
+
children: [
|
|
563
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(StatusIcon, {
|
|
564
|
+
status: isApproved ? "success" : "error",
|
|
565
|
+
withSpace: true
|
|
566
|
+
}, undefined, false, undefined, this),
|
|
567
|
+
d.display,
|
|
568
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
569
|
+
dimColor: true,
|
|
570
|
+
children: suffix
|
|
571
|
+
}, undefined, false, undefined, this)
|
|
572
|
+
]
|
|
573
|
+
}, undefined, true, undefined, this),
|
|
574
|
+
value: String(idx)
|
|
575
|
+
};
|
|
576
|
+
});
|
|
577
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
578
|
+
flexDirection: "column",
|
|
579
|
+
children: [
|
|
580
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
581
|
+
children: "Commands recently denied by the auto mode classifier."
|
|
582
|
+
}, undefined, false, undefined, this),
|
|
583
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
584
|
+
marginTop: 1,
|
|
585
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Select, {
|
|
586
|
+
options,
|
|
587
|
+
onChange: handleSelect,
|
|
588
|
+
onFocus: handleFocus,
|
|
589
|
+
visibleOptionCount: Math.min(10, options.length),
|
|
590
|
+
isDisabled: headerFocused,
|
|
591
|
+
onUpFromFirstItem: focusHeader
|
|
592
|
+
}, undefined, false, undefined, this)
|
|
593
|
+
}, undefined, false, undefined, this)
|
|
594
|
+
]
|
|
595
|
+
}, undefined, true, undefined, this);
|
|
596
|
+
}
|
|
597
|
+
var import_react3, jsx_dev_runtime4;
|
|
598
|
+
var init_RecentDenialsTab = __esm(() => {
|
|
599
|
+
init_src();
|
|
600
|
+
init_autoModeDenials();
|
|
601
|
+
init_select();
|
|
602
|
+
init_src();
|
|
603
|
+
init_Tabs();
|
|
604
|
+
import_react3 = __toESM(require_react(), 1);
|
|
605
|
+
jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
// src/components/permissions/rules/RemoveWorkspaceDirectory.tsx
|
|
609
|
+
function RemoveWorkspaceDirectory({
|
|
610
|
+
directoryPath,
|
|
611
|
+
onRemove,
|
|
612
|
+
onCancel,
|
|
613
|
+
permissionContext,
|
|
614
|
+
setPermissionContext
|
|
615
|
+
}) {
|
|
616
|
+
const handleRemove = import_react4.useCallback(() => {
|
|
617
|
+
const updatedContext = applyPermissionUpdate(permissionContext, {
|
|
618
|
+
type: "removeDirectories",
|
|
619
|
+
directories: [directoryPath],
|
|
620
|
+
destination: "session"
|
|
621
|
+
});
|
|
622
|
+
setPermissionContext(updatedContext);
|
|
623
|
+
onRemove();
|
|
624
|
+
}, [directoryPath, permissionContext, setPermissionContext, onRemove]);
|
|
625
|
+
const handleSelect = import_react4.useCallback((value) => {
|
|
626
|
+
if (value === "yes") {
|
|
627
|
+
handleRemove();
|
|
628
|
+
} else {
|
|
629
|
+
onCancel();
|
|
630
|
+
}
|
|
631
|
+
}, [handleRemove, onCancel]);
|
|
632
|
+
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Dialog, {
|
|
633
|
+
title: "Remove directory from workspace?",
|
|
634
|
+
onCancel,
|
|
635
|
+
color: "error",
|
|
636
|
+
children: [
|
|
637
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
|
|
638
|
+
marginX: 2,
|
|
639
|
+
flexDirection: "column",
|
|
640
|
+
children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
|
|
641
|
+
bold: true,
|
|
642
|
+
children: directoryPath
|
|
643
|
+
}, undefined, false, undefined, this)
|
|
644
|
+
}, undefined, false, undefined, this),
|
|
645
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
|
|
646
|
+
children: "Claude Code will no longer have access to files in this directory."
|
|
647
|
+
}, undefined, false, undefined, this),
|
|
648
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Select, {
|
|
649
|
+
onChange: handleSelect,
|
|
650
|
+
onCancel,
|
|
651
|
+
options: [
|
|
652
|
+
{ label: "Yes", value: "yes" },
|
|
653
|
+
{ label: "No", value: "no" }
|
|
654
|
+
]
|
|
655
|
+
}, undefined, false, undefined, this)
|
|
656
|
+
]
|
|
657
|
+
}, undefined, true, undefined, this);
|
|
658
|
+
}
|
|
659
|
+
var import_react4, jsx_dev_runtime5;
|
|
660
|
+
var init_RemoveWorkspaceDirectory = __esm(() => {
|
|
661
|
+
init_select();
|
|
662
|
+
init_src();
|
|
663
|
+
init_PermissionUpdate();
|
|
664
|
+
init_src();
|
|
665
|
+
import_react4 = __toESM(require_react(), 1);
|
|
666
|
+
jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
// src/components/permissions/rules/WorkspaceTab.tsx
|
|
670
|
+
function WorkspaceTab({
|
|
671
|
+
onExit,
|
|
672
|
+
toolPermissionContext,
|
|
673
|
+
onRequestAddDirectory,
|
|
674
|
+
onRequestRemoveDirectory,
|
|
675
|
+
onHeaderFocusChange
|
|
676
|
+
}) {
|
|
677
|
+
const { headerFocused, focusHeader } = useTabHeaderFocus();
|
|
678
|
+
import_react5.useEffect(() => {
|
|
679
|
+
onHeaderFocusChange?.(headerFocused);
|
|
680
|
+
}, [headerFocused, onHeaderFocusChange]);
|
|
681
|
+
const additionalDirectories = React.useMemo(() => {
|
|
682
|
+
return Array.from(toolPermissionContext.additionalWorkingDirectories.keys()).map((path) => ({
|
|
683
|
+
path,
|
|
684
|
+
isCurrent: false,
|
|
685
|
+
isDeletable: true
|
|
686
|
+
}));
|
|
687
|
+
}, [toolPermissionContext.additionalWorkingDirectories]);
|
|
688
|
+
const handleDirectorySelect = import_react5.useCallback((selectedValue) => {
|
|
689
|
+
if (selectedValue === "add-directory") {
|
|
690
|
+
onRequestAddDirectory();
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
const directory = additionalDirectories.find((d) => d.path === selectedValue);
|
|
694
|
+
if (directory && directory.isDeletable) {
|
|
695
|
+
onRequestRemoveDirectory(directory.path);
|
|
696
|
+
}
|
|
697
|
+
}, [additionalDirectories, onRequestAddDirectory, onRequestRemoveDirectory]);
|
|
698
|
+
const handleCancel = import_react5.useCallback(() => onExit("Workspace dialog dismissed", { display: "system" }), [onExit]);
|
|
699
|
+
const options = React.useMemo(() => {
|
|
700
|
+
const opts = additionalDirectories.map((dir) => ({
|
|
701
|
+
label: dir.path,
|
|
702
|
+
value: dir.path
|
|
703
|
+
}));
|
|
704
|
+
opts.push({
|
|
705
|
+
label: `Add directory${figures_default.ellipsis}`,
|
|
706
|
+
value: "add-directory"
|
|
707
|
+
});
|
|
708
|
+
return opts;
|
|
709
|
+
}, [additionalDirectories]);
|
|
710
|
+
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
|
|
711
|
+
flexDirection: "column",
|
|
712
|
+
marginBottom: 1,
|
|
713
|
+
children: [
|
|
714
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
|
|
715
|
+
flexDirection: "row",
|
|
716
|
+
marginTop: 1,
|
|
717
|
+
marginLeft: 2,
|
|
718
|
+
gap: 1,
|
|
719
|
+
children: [
|
|
720
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
|
|
721
|
+
children: `- ${getOriginalCwd()}`
|
|
722
|
+
}, undefined, false, undefined, this),
|
|
723
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
|
|
724
|
+
dimColor: true,
|
|
725
|
+
children: "(Original working directory)"
|
|
726
|
+
}, undefined, false, undefined, this)
|
|
727
|
+
]
|
|
728
|
+
}, undefined, true, undefined, this),
|
|
729
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Select, {
|
|
730
|
+
options,
|
|
731
|
+
onChange: handleDirectorySelect,
|
|
732
|
+
onCancel: handleCancel,
|
|
733
|
+
visibleOptionCount: Math.min(10, options.length),
|
|
734
|
+
onUpFromFirstItem: focusHeader,
|
|
735
|
+
isDisabled: headerFocused
|
|
736
|
+
}, undefined, false, undefined, this)
|
|
737
|
+
]
|
|
738
|
+
}, undefined, true, undefined, this);
|
|
739
|
+
}
|
|
740
|
+
var React, import_react5, jsx_dev_runtime6;
|
|
741
|
+
var init_WorkspaceTab = __esm(() => {
|
|
742
|
+
init_figures();
|
|
743
|
+
init_state();
|
|
744
|
+
init_select();
|
|
745
|
+
init_src();
|
|
746
|
+
init_Tabs();
|
|
747
|
+
React = __toESM(require_react(), 1);
|
|
748
|
+
import_react5 = __toESM(require_react(), 1);
|
|
749
|
+
jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
// src/components/permissions/rules/PermissionRuleList.tsx
|
|
753
|
+
function RuleSourceText({ rule }) {
|
|
754
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
755
|
+
dimColor: true,
|
|
756
|
+
children: `From ${permissionRuleSourceDisplayString(rule.source)}`
|
|
757
|
+
}, undefined, false, undefined, this);
|
|
758
|
+
}
|
|
759
|
+
function getRuleBehaviorLabel(ruleBehavior) {
|
|
760
|
+
switch (ruleBehavior) {
|
|
761
|
+
case "allow":
|
|
762
|
+
return "allowed";
|
|
763
|
+
case "deny":
|
|
764
|
+
return "denied";
|
|
765
|
+
case "ask":
|
|
766
|
+
return "ask";
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
function RuleDetails({
|
|
770
|
+
rule,
|
|
771
|
+
onDelete,
|
|
772
|
+
onCancel
|
|
773
|
+
}) {
|
|
774
|
+
const exitState = useExitOnCtrlCDWithKeybindings();
|
|
775
|
+
useKeybinding("confirm:no", onCancel, { context: "Confirmation" });
|
|
776
|
+
const ruleDescription = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
777
|
+
flexDirection: "column",
|
|
778
|
+
marginX: 2,
|
|
779
|
+
children: [
|
|
780
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
781
|
+
bold: true,
|
|
782
|
+
children: permissionRuleValueToString(rule.ruleValue)
|
|
783
|
+
}, undefined, false, undefined, this),
|
|
784
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRuleDescription, {
|
|
785
|
+
ruleValue: rule.ruleValue
|
|
786
|
+
}, undefined, false, undefined, this),
|
|
787
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RuleSourceText, {
|
|
788
|
+
rule
|
|
789
|
+
}, undefined, false, undefined, this)
|
|
790
|
+
]
|
|
791
|
+
}, undefined, true, undefined, this);
|
|
792
|
+
const footer = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
793
|
+
marginLeft: 3,
|
|
794
|
+
children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
795
|
+
dimColor: true,
|
|
796
|
+
children: [
|
|
797
|
+
"Press ",
|
|
798
|
+
exitState.keyName,
|
|
799
|
+
" again to exit"
|
|
800
|
+
]
|
|
801
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
802
|
+
dimColor: true,
|
|
803
|
+
children: "Esc to cancel"
|
|
804
|
+
}, undefined, false, undefined, this)
|
|
805
|
+
}, undefined, false, undefined, this);
|
|
806
|
+
if (rule.source === "policySettings") {
|
|
807
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
|
|
808
|
+
children: [
|
|
809
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
810
|
+
flexDirection: "column",
|
|
811
|
+
gap: 1,
|
|
812
|
+
borderStyle: "round",
|
|
813
|
+
paddingLeft: 1,
|
|
814
|
+
paddingRight: 1,
|
|
815
|
+
borderColor: "permission",
|
|
816
|
+
children: [
|
|
817
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
818
|
+
bold: true,
|
|
819
|
+
color: "permission",
|
|
820
|
+
children: "Rule details"
|
|
821
|
+
}, undefined, false, undefined, this),
|
|
822
|
+
ruleDescription,
|
|
823
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
824
|
+
italic: true,
|
|
825
|
+
children: [
|
|
826
|
+
"This rule is configured by managed settings and cannot be modified.",
|
|
827
|
+
`
|
|
828
|
+
`,
|
|
829
|
+
"Contact your system administrator for more information."
|
|
830
|
+
]
|
|
831
|
+
}, undefined, true, undefined, this)
|
|
832
|
+
]
|
|
833
|
+
}, undefined, true, undefined, this),
|
|
834
|
+
footer
|
|
835
|
+
]
|
|
836
|
+
}, undefined, true, undefined, this);
|
|
837
|
+
}
|
|
838
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
|
|
839
|
+
children: [
|
|
840
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
841
|
+
flexDirection: "column",
|
|
842
|
+
gap: 1,
|
|
843
|
+
borderStyle: "round",
|
|
844
|
+
paddingLeft: 1,
|
|
845
|
+
paddingRight: 1,
|
|
846
|
+
borderColor: "error",
|
|
847
|
+
children: [
|
|
848
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
849
|
+
bold: true,
|
|
850
|
+
color: "error",
|
|
851
|
+
children: [
|
|
852
|
+
"Delete ",
|
|
853
|
+
getRuleBehaviorLabel(rule.ruleBehavior),
|
|
854
|
+
" tool?"
|
|
855
|
+
]
|
|
856
|
+
}, undefined, true, undefined, this),
|
|
857
|
+
ruleDescription,
|
|
858
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
859
|
+
children: "Are you sure you want to delete this permission rule?"
|
|
860
|
+
}, undefined, false, undefined, this),
|
|
861
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Select, {
|
|
862
|
+
onChange: (_) => _ === "yes" ? onDelete() : onCancel(),
|
|
863
|
+
onCancel,
|
|
864
|
+
options: [
|
|
865
|
+
{ label: "Yes", value: "yes" },
|
|
866
|
+
{ label: "No", value: "no" }
|
|
867
|
+
]
|
|
868
|
+
}, undefined, false, undefined, this)
|
|
869
|
+
]
|
|
870
|
+
}, undefined, true, undefined, this),
|
|
871
|
+
footer
|
|
872
|
+
]
|
|
873
|
+
}, undefined, true, undefined, this);
|
|
874
|
+
}
|
|
875
|
+
function RulesTabContent(props) {
|
|
876
|
+
const {
|
|
877
|
+
options,
|
|
878
|
+
searchQuery,
|
|
879
|
+
isSearchMode,
|
|
880
|
+
isFocused,
|
|
881
|
+
onSelect,
|
|
882
|
+
onCancel,
|
|
883
|
+
lastFocusedRuleKey,
|
|
884
|
+
cursorOffset,
|
|
885
|
+
onHeaderFocusChange
|
|
886
|
+
} = props;
|
|
887
|
+
const tabWidth = useTabsWidth();
|
|
888
|
+
const { headerFocused, focusHeader, blurHeader } = useTabHeaderFocus();
|
|
889
|
+
import_react6.useEffect(() => {
|
|
890
|
+
if (isSearchMode && headerFocused)
|
|
891
|
+
blurHeader();
|
|
892
|
+
}, [isSearchMode, headerFocused, blurHeader]);
|
|
893
|
+
import_react6.useEffect(() => {
|
|
894
|
+
onHeaderFocusChange?.(headerFocused);
|
|
895
|
+
}, [headerFocused, onHeaderFocusChange]);
|
|
896
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
897
|
+
flexDirection: "column",
|
|
898
|
+
children: [
|
|
899
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
900
|
+
marginBottom: 1,
|
|
901
|
+
flexDirection: "column",
|
|
902
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(SearchBox, {
|
|
903
|
+
query: searchQuery,
|
|
904
|
+
isFocused: isSearchMode && !headerFocused,
|
|
905
|
+
isTerminalFocused: isFocused,
|
|
906
|
+
width: tabWidth,
|
|
907
|
+
cursorOffset
|
|
908
|
+
}, undefined, false, undefined, this)
|
|
909
|
+
}, undefined, false, undefined, this),
|
|
910
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Select, {
|
|
911
|
+
options,
|
|
912
|
+
onChange: onSelect,
|
|
913
|
+
onCancel,
|
|
914
|
+
visibleOptionCount: Math.min(10, options.length),
|
|
915
|
+
isDisabled: isSearchMode || headerFocused,
|
|
916
|
+
defaultFocusValue: lastFocusedRuleKey,
|
|
917
|
+
onUpFromFirstItem: focusHeader
|
|
918
|
+
}, undefined, false, undefined, this)
|
|
919
|
+
]
|
|
920
|
+
}, undefined, true, undefined, this);
|
|
921
|
+
}
|
|
922
|
+
function PermissionRulesTab({
|
|
923
|
+
tab,
|
|
924
|
+
getRulesOptions,
|
|
925
|
+
handleToolSelect,
|
|
926
|
+
...rulesProps
|
|
927
|
+
}) {
|
|
928
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
929
|
+
flexDirection: "column",
|
|
930
|
+
flexShrink: tab === "allow" ? 0 : undefined,
|
|
931
|
+
children: [
|
|
932
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
933
|
+
children: {
|
|
934
|
+
allow: "Claude Code won't ask before using allowed tools.",
|
|
935
|
+
ask: "Claude Code will always ask for confirmation before using these tools.",
|
|
936
|
+
deny: "Claude Code will always reject requests to use denied tools."
|
|
937
|
+
}[tab]
|
|
938
|
+
}, undefined, false, undefined, this),
|
|
939
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RulesTabContent, {
|
|
940
|
+
options: getRulesOptions(tab, rulesProps.searchQuery).options,
|
|
941
|
+
onSelect: (v) => handleToolSelect(v, tab),
|
|
942
|
+
...rulesProps
|
|
943
|
+
}, undefined, false, undefined, this)
|
|
944
|
+
]
|
|
945
|
+
}, undefined, true, undefined, this);
|
|
946
|
+
}
|
|
947
|
+
function PermissionRuleList({
|
|
948
|
+
onExit,
|
|
949
|
+
initialTab,
|
|
950
|
+
onRetryDenials
|
|
951
|
+
}) {
|
|
952
|
+
const hasDenials = getAutoModeDenials().length > 0;
|
|
953
|
+
const defaultTab = initialTab ?? (hasDenials ? "recent" : "allow");
|
|
954
|
+
const [changes, setChanges] = import_react6.useState([]);
|
|
955
|
+
const toolPermissionContext = useAppState((s) => s.toolPermissionContext);
|
|
956
|
+
const setAppState = useSetAppState();
|
|
957
|
+
const isTerminalFocused = useTerminalFocus();
|
|
958
|
+
const denialStateRef = import_react6.useRef({ approved: new Set, retry: new Set, denials: [] });
|
|
959
|
+
const handleDenialStateChange = import_react6.useCallback((s) => {
|
|
960
|
+
denialStateRef.current = s;
|
|
961
|
+
}, []);
|
|
962
|
+
const [selectedRule, setSelectedRule] = import_react6.useState();
|
|
963
|
+
const [lastFocusedRuleKey, setLastFocusedRuleKey] = import_react6.useState();
|
|
964
|
+
const [addingRuleToTab, setAddingRuleToTab] = import_react6.useState(null);
|
|
965
|
+
const [validatedRule, setValidatedRule] = import_react6.useState(null);
|
|
966
|
+
const [isAddingWorkspaceDirectory, setIsAddingWorkspaceDirectory] = import_react6.useState(false);
|
|
967
|
+
const [removingDirectory, setRemovingDirectory] = import_react6.useState(null);
|
|
968
|
+
const [isSearchMode, setIsSearchMode] = import_react6.useState(false);
|
|
969
|
+
const [headerFocused, setHeaderFocused] = import_react6.useState(true);
|
|
970
|
+
const handleHeaderFocusChange = import_react6.useCallback((focused) => {
|
|
971
|
+
setHeaderFocused(focused);
|
|
972
|
+
}, []);
|
|
973
|
+
const allowRulesByKey = import_react6.useMemo(() => {
|
|
974
|
+
const map = new Map;
|
|
975
|
+
getAllowRules(toolPermissionContext).forEach((rule) => {
|
|
976
|
+
map.set(jsonStringify(rule), rule);
|
|
977
|
+
});
|
|
978
|
+
return map;
|
|
979
|
+
}, [toolPermissionContext]);
|
|
980
|
+
const denyRulesByKey = import_react6.useMemo(() => {
|
|
981
|
+
const map = new Map;
|
|
982
|
+
getDenyRules(toolPermissionContext).forEach((rule) => {
|
|
983
|
+
map.set(jsonStringify(rule), rule);
|
|
984
|
+
});
|
|
985
|
+
return map;
|
|
986
|
+
}, [toolPermissionContext]);
|
|
987
|
+
const askRulesByKey = import_react6.useMemo(() => {
|
|
988
|
+
const map = new Map;
|
|
989
|
+
getAskRules(toolPermissionContext).forEach((rule) => {
|
|
990
|
+
map.set(jsonStringify(rule), rule);
|
|
991
|
+
});
|
|
992
|
+
return map;
|
|
993
|
+
}, [toolPermissionContext]);
|
|
994
|
+
const getRulesOptions = import_react6.useCallback((tab, query = "") => {
|
|
995
|
+
const rulesByKey = (() => {
|
|
996
|
+
switch (tab) {
|
|
997
|
+
case "allow":
|
|
998
|
+
return allowRulesByKey;
|
|
999
|
+
case "deny":
|
|
1000
|
+
return denyRulesByKey;
|
|
1001
|
+
case "ask":
|
|
1002
|
+
return askRulesByKey;
|
|
1003
|
+
case "workspace":
|
|
1004
|
+
case "recent":
|
|
1005
|
+
return new Map;
|
|
1006
|
+
}
|
|
1007
|
+
})();
|
|
1008
|
+
const options = [];
|
|
1009
|
+
if (tab !== "workspace" && tab !== "recent" && !query) {
|
|
1010
|
+
options.push({
|
|
1011
|
+
label: `Add a new rule${figures_default.ellipsis}`,
|
|
1012
|
+
value: "add-new-rule"
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
const sortedRuleKeys = Array.from(rulesByKey.keys()).sort((a, b) => {
|
|
1016
|
+
const ruleA = rulesByKey.get(a);
|
|
1017
|
+
const ruleB = rulesByKey.get(b);
|
|
1018
|
+
if (ruleA && ruleB) {
|
|
1019
|
+
const ruleAString = permissionRuleValueToString(ruleA.ruleValue).toLowerCase();
|
|
1020
|
+
const ruleBString = permissionRuleValueToString(ruleB.ruleValue).toLowerCase();
|
|
1021
|
+
return ruleAString.localeCompare(ruleBString);
|
|
1022
|
+
}
|
|
1023
|
+
return 0;
|
|
1024
|
+
});
|
|
1025
|
+
const lowerQuery = query.toLowerCase();
|
|
1026
|
+
for (const ruleKey of sortedRuleKeys) {
|
|
1027
|
+
const rule = rulesByKey.get(ruleKey);
|
|
1028
|
+
if (rule) {
|
|
1029
|
+
const ruleString = permissionRuleValueToString(rule.ruleValue);
|
|
1030
|
+
if (query && !ruleString.toLowerCase().includes(lowerQuery)) {
|
|
1031
|
+
continue;
|
|
1032
|
+
}
|
|
1033
|
+
options.push({
|
|
1034
|
+
label: ruleString,
|
|
1035
|
+
value: ruleKey
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
return { options, rulesByKey };
|
|
1040
|
+
}, [allowRulesByKey, denyRulesByKey, askRulesByKey]);
|
|
1041
|
+
const exitState = useExitOnCtrlCDWithKeybindings();
|
|
1042
|
+
const isSearchModeActive = !selectedRule && !addingRuleToTab && !validatedRule && !isAddingWorkspaceDirectory && !removingDirectory;
|
|
1043
|
+
const {
|
|
1044
|
+
query: searchQuery,
|
|
1045
|
+
setQuery: setSearchQuery,
|
|
1046
|
+
cursorOffset: searchCursorOffset
|
|
1047
|
+
} = useSearchInput({
|
|
1048
|
+
isActive: isSearchModeActive && isSearchMode,
|
|
1049
|
+
onExit: () => {
|
|
1050
|
+
setIsSearchMode(false);
|
|
1051
|
+
}
|
|
1052
|
+
});
|
|
1053
|
+
const handleKeyDown = import_react6.useCallback((e) => {
|
|
1054
|
+
if (!isSearchModeActive)
|
|
1055
|
+
return;
|
|
1056
|
+
if (isSearchMode)
|
|
1057
|
+
return;
|
|
1058
|
+
if (e.ctrl || e.meta)
|
|
1059
|
+
return;
|
|
1060
|
+
if (e.key === "/") {
|
|
1061
|
+
e.preventDefault();
|
|
1062
|
+
setIsSearchMode(true);
|
|
1063
|
+
setSearchQuery("");
|
|
1064
|
+
} else if (e.key.length === 1 && e.key !== "j" && e.key !== "k" && e.key !== "m" && e.key !== "i" && e.key !== "r" && e.key !== " ") {
|
|
1065
|
+
e.preventDefault();
|
|
1066
|
+
setIsSearchMode(true);
|
|
1067
|
+
setSearchQuery(e.key);
|
|
1068
|
+
}
|
|
1069
|
+
}, [isSearchModeActive, isSearchMode, setSearchQuery]);
|
|
1070
|
+
const handleToolSelect = import_react6.useCallback((selectedValue, tab) => {
|
|
1071
|
+
const { rulesByKey } = getRulesOptions(tab);
|
|
1072
|
+
if (selectedValue === "add-new-rule") {
|
|
1073
|
+
setAddingRuleToTab(tab);
|
|
1074
|
+
return;
|
|
1075
|
+
} else {
|
|
1076
|
+
setSelectedRule(rulesByKey.get(selectedValue));
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1079
|
+
}, [getRulesOptions]);
|
|
1080
|
+
const handleRuleInputCancel = import_react6.useCallback(() => {
|
|
1081
|
+
setAddingRuleToTab(null);
|
|
1082
|
+
}, []);
|
|
1083
|
+
const handleRuleInputSubmit = import_react6.useCallback((ruleValue, ruleBehavior) => {
|
|
1084
|
+
setValidatedRule({ ruleValue, ruleBehavior });
|
|
1085
|
+
setAddingRuleToTab(null);
|
|
1086
|
+
}, []);
|
|
1087
|
+
const handleAddRulesSuccess = import_react6.useCallback((rules, unreachable) => {
|
|
1088
|
+
setValidatedRule(null);
|
|
1089
|
+
for (const rule of rules) {
|
|
1090
|
+
setChanges((prev) => [
|
|
1091
|
+
...prev,
|
|
1092
|
+
`Added ${rule.ruleBehavior} rule ${source_default.bold(permissionRuleValueToString(rule.ruleValue))}`
|
|
1093
|
+
]);
|
|
1094
|
+
}
|
|
1095
|
+
if (unreachable && unreachable.length > 0) {
|
|
1096
|
+
for (const u of unreachable) {
|
|
1097
|
+
const severity = u.shadowType === "deny" ? "blocked" : "shadowed";
|
|
1098
|
+
setChanges((prev) => [
|
|
1099
|
+
...prev,
|
|
1100
|
+
source_default.yellow(`${figures_default.warning} Warning: ${permissionRuleValueToString(u.rule.ruleValue)} is ${severity}`),
|
|
1101
|
+
source_default.dim(` ${u.reason}`),
|
|
1102
|
+
source_default.dim(` Fix: ${u.fix}`)
|
|
1103
|
+
]);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
}, []);
|
|
1107
|
+
const handleAddRuleCancel = import_react6.useCallback(() => {
|
|
1108
|
+
setValidatedRule(null);
|
|
1109
|
+
}, []);
|
|
1110
|
+
const handleRequestAddDirectory = import_react6.useCallback(() => setIsAddingWorkspaceDirectory(true), []);
|
|
1111
|
+
const handleRequestRemoveDirectory = import_react6.useCallback((path) => setRemovingDirectory(path), []);
|
|
1112
|
+
const handleRulesCancel = import_react6.useCallback(() => {
|
|
1113
|
+
const s = denialStateRef.current;
|
|
1114
|
+
const denialsFor = (set) => Array.from(set).map((idx) => s.denials[idx]).filter((d) => d !== undefined);
|
|
1115
|
+
const retryDenials = denialsFor(s.retry);
|
|
1116
|
+
if (retryDenials.length > 0) {
|
|
1117
|
+
const commands = retryDenials.map((d) => d.display);
|
|
1118
|
+
onRetryDenials?.(commands);
|
|
1119
|
+
onExit(undefined, {
|
|
1120
|
+
shouldQuery: true,
|
|
1121
|
+
metaMessages: [
|
|
1122
|
+
`Permission granted for: ${commands.join(", ")}. You may now retry ${commands.length === 1 ? "this command" : "these commands"} if you would like.`
|
|
1123
|
+
]
|
|
1124
|
+
});
|
|
1125
|
+
return;
|
|
1126
|
+
}
|
|
1127
|
+
const approvedDenials = denialsFor(s.approved);
|
|
1128
|
+
if (approvedDenials.length > 0 || changes.length > 0) {
|
|
1129
|
+
const approvedMsg = approvedDenials.length > 0 ? [
|
|
1130
|
+
`Approved ${approvedDenials.map((d) => source_default.bold(d.display)).join(", ")}`
|
|
1131
|
+
] : [];
|
|
1132
|
+
onExit([...approvedMsg, ...changes].join(`
|
|
1133
|
+
`));
|
|
1134
|
+
} else {
|
|
1135
|
+
onExit("Permissions dialog dismissed", {
|
|
1136
|
+
display: "system"
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
}, [changes, onExit, onRetryDenials]);
|
|
1140
|
+
useKeybinding("confirm:no", handleRulesCancel, {
|
|
1141
|
+
context: "Settings",
|
|
1142
|
+
isActive: isSearchModeActive && !isSearchMode
|
|
1143
|
+
});
|
|
1144
|
+
const handleDeleteRule = () => {
|
|
1145
|
+
if (!selectedRule)
|
|
1146
|
+
return;
|
|
1147
|
+
const { options } = getRulesOptions(selectedRule.ruleBehavior);
|
|
1148
|
+
const selectedKey = jsonStringify(selectedRule);
|
|
1149
|
+
const ruleKeys = options.filter((opt) => opt.value !== "add-new-rule").map((opt) => opt.value);
|
|
1150
|
+
const currentIndex = ruleKeys.indexOf(selectedKey);
|
|
1151
|
+
let nextFocusKey;
|
|
1152
|
+
if (currentIndex !== -1) {
|
|
1153
|
+
if (currentIndex < ruleKeys.length - 1) {
|
|
1154
|
+
nextFocusKey = ruleKeys[currentIndex + 1];
|
|
1155
|
+
} else if (currentIndex > 0) {
|
|
1156
|
+
nextFocusKey = ruleKeys[currentIndex - 1];
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
setLastFocusedRuleKey(nextFocusKey);
|
|
1160
|
+
deletePermissionRule({
|
|
1161
|
+
rule: selectedRule,
|
|
1162
|
+
initialContext: toolPermissionContext,
|
|
1163
|
+
setToolPermissionContext(toolPermissionContext2) {
|
|
1164
|
+
setAppState((prev) => ({
|
|
1165
|
+
...prev,
|
|
1166
|
+
toolPermissionContext: toolPermissionContext2
|
|
1167
|
+
}));
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
setChanges((prev) => [
|
|
1171
|
+
...prev,
|
|
1172
|
+
`Deleted ${selectedRule.ruleBehavior} rule ${source_default.bold(permissionRuleValueToString(selectedRule.ruleValue))}`
|
|
1173
|
+
]);
|
|
1174
|
+
setSelectedRule(undefined);
|
|
1175
|
+
};
|
|
1176
|
+
if (selectedRule) {
|
|
1177
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RuleDetails, {
|
|
1178
|
+
rule: selectedRule,
|
|
1179
|
+
onDelete: handleDeleteRule,
|
|
1180
|
+
onCancel: () => setSelectedRule(undefined)
|
|
1181
|
+
}, undefined, false, undefined, this);
|
|
1182
|
+
}
|
|
1183
|
+
if (addingRuleToTab && addingRuleToTab !== "workspace" && addingRuleToTab !== "recent") {
|
|
1184
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRuleInput, {
|
|
1185
|
+
onCancel: handleRuleInputCancel,
|
|
1186
|
+
onSubmit: handleRuleInputSubmit,
|
|
1187
|
+
ruleBehavior: addingRuleToTab
|
|
1188
|
+
}, undefined, false, undefined, this);
|
|
1189
|
+
}
|
|
1190
|
+
if (validatedRule) {
|
|
1191
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(AddPermissionRules, {
|
|
1192
|
+
onAddRules: handleAddRulesSuccess,
|
|
1193
|
+
onCancel: handleAddRuleCancel,
|
|
1194
|
+
ruleValues: [validatedRule.ruleValue],
|
|
1195
|
+
ruleBehavior: validatedRule.ruleBehavior,
|
|
1196
|
+
initialContext: toolPermissionContext,
|
|
1197
|
+
setToolPermissionContext: (toolPermissionContext2) => {
|
|
1198
|
+
setAppState((prev) => ({
|
|
1199
|
+
...prev,
|
|
1200
|
+
toolPermissionContext: toolPermissionContext2
|
|
1201
|
+
}));
|
|
1202
|
+
}
|
|
1203
|
+
}, undefined, false, undefined, this);
|
|
1204
|
+
}
|
|
1205
|
+
if (isAddingWorkspaceDirectory) {
|
|
1206
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(AddWorkspaceDirectory, {
|
|
1207
|
+
onAddDirectory: (path, remember) => {
|
|
1208
|
+
const destination = remember ? "localSettings" : "session";
|
|
1209
|
+
const permissionUpdate = {
|
|
1210
|
+
type: "addDirectories",
|
|
1211
|
+
directories: [path],
|
|
1212
|
+
destination
|
|
1213
|
+
};
|
|
1214
|
+
const updatedContext = applyPermissionUpdate(toolPermissionContext, permissionUpdate);
|
|
1215
|
+
setAppState((prev) => ({
|
|
1216
|
+
...prev,
|
|
1217
|
+
toolPermissionContext: updatedContext
|
|
1218
|
+
}));
|
|
1219
|
+
if (remember) {
|
|
1220
|
+
persistPermissionUpdate(permissionUpdate);
|
|
1221
|
+
}
|
|
1222
|
+
setChanges((prev) => [
|
|
1223
|
+
...prev,
|
|
1224
|
+
`Added directory ${source_default.bold(path)} to workspace${remember ? " and saved to local settings" : " for this session"}`
|
|
1225
|
+
]);
|
|
1226
|
+
setIsAddingWorkspaceDirectory(false);
|
|
1227
|
+
},
|
|
1228
|
+
onCancel: () => setIsAddingWorkspaceDirectory(false),
|
|
1229
|
+
permissionContext: toolPermissionContext
|
|
1230
|
+
}, undefined, false, undefined, this);
|
|
1231
|
+
}
|
|
1232
|
+
if (removingDirectory) {
|
|
1233
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RemoveWorkspaceDirectory, {
|
|
1234
|
+
directoryPath: removingDirectory,
|
|
1235
|
+
onRemove: () => {
|
|
1236
|
+
setChanges((prev) => [
|
|
1237
|
+
...prev,
|
|
1238
|
+
`Removed directory ${source_default.bold(removingDirectory)} from workspace`
|
|
1239
|
+
]);
|
|
1240
|
+
setRemovingDirectory(null);
|
|
1241
|
+
},
|
|
1242
|
+
onCancel: () => setRemovingDirectory(null),
|
|
1243
|
+
permissionContext: toolPermissionContext,
|
|
1244
|
+
setPermissionContext: (toolPermissionContext2) => {
|
|
1245
|
+
setAppState((prev) => ({
|
|
1246
|
+
...prev,
|
|
1247
|
+
toolPermissionContext: toolPermissionContext2
|
|
1248
|
+
}));
|
|
1249
|
+
}
|
|
1250
|
+
}, undefined, false, undefined, this);
|
|
1251
|
+
}
|
|
1252
|
+
const sharedRulesProps = {
|
|
1253
|
+
searchQuery,
|
|
1254
|
+
isSearchMode,
|
|
1255
|
+
isFocused: isTerminalFocused,
|
|
1256
|
+
onCancel: handleRulesCancel,
|
|
1257
|
+
lastFocusedRuleKey,
|
|
1258
|
+
cursorOffset: searchCursorOffset,
|
|
1259
|
+
getRulesOptions,
|
|
1260
|
+
handleToolSelect,
|
|
1261
|
+
onHeaderFocusChange: handleHeaderFocusChange
|
|
1262
|
+
};
|
|
1263
|
+
const isHidden = !!selectedRule || !!addingRuleToTab || !!validatedRule || isAddingWorkspaceDirectory || !!removingDirectory;
|
|
1264
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
1265
|
+
flexDirection: "column",
|
|
1266
|
+
onKeyDown: handleKeyDown,
|
|
1267
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Pane, {
|
|
1268
|
+
color: "permission",
|
|
1269
|
+
children: [
|
|
1270
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tabs, {
|
|
1271
|
+
title: "Permissions:",
|
|
1272
|
+
color: "permission",
|
|
1273
|
+
defaultTab,
|
|
1274
|
+
hidden: isHidden,
|
|
1275
|
+
initialHeaderFocused: !hasDenials,
|
|
1276
|
+
navFromContent: !isSearchMode,
|
|
1277
|
+
children: [
|
|
1278
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
|
|
1279
|
+
id: "recent",
|
|
1280
|
+
title: "Recently denied",
|
|
1281
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RecentDenialsTab, {
|
|
1282
|
+
onHeaderFocusChange: handleHeaderFocusChange,
|
|
1283
|
+
onStateChange: handleDenialStateChange
|
|
1284
|
+
}, undefined, false, undefined, this)
|
|
1285
|
+
}, undefined, false, undefined, this),
|
|
1286
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
|
|
1287
|
+
id: "allow",
|
|
1288
|
+
title: "Allow",
|
|
1289
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRulesTab, {
|
|
1290
|
+
tab: "allow",
|
|
1291
|
+
...sharedRulesProps
|
|
1292
|
+
}, undefined, false, undefined, this)
|
|
1293
|
+
}, undefined, false, undefined, this),
|
|
1294
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
|
|
1295
|
+
id: "ask",
|
|
1296
|
+
title: "Ask",
|
|
1297
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRulesTab, {
|
|
1298
|
+
tab: "ask",
|
|
1299
|
+
...sharedRulesProps
|
|
1300
|
+
}, undefined, false, undefined, this)
|
|
1301
|
+
}, undefined, false, undefined, this),
|
|
1302
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
|
|
1303
|
+
id: "deny",
|
|
1304
|
+
title: "Deny",
|
|
1305
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRulesTab, {
|
|
1306
|
+
tab: "deny",
|
|
1307
|
+
...sharedRulesProps
|
|
1308
|
+
}, undefined, false, undefined, this)
|
|
1309
|
+
}, undefined, false, undefined, this),
|
|
1310
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
|
|
1311
|
+
id: "workspace",
|
|
1312
|
+
title: "Workspace",
|
|
1313
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
1314
|
+
flexDirection: "column",
|
|
1315
|
+
children: [
|
|
1316
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
1317
|
+
children: "Claude Code can read files in the workspace, and make edits when auto-accept edits is on."
|
|
1318
|
+
}, undefined, false, undefined, this),
|
|
1319
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(WorkspaceTab, {
|
|
1320
|
+
onExit,
|
|
1321
|
+
toolPermissionContext,
|
|
1322
|
+
onRequestAddDirectory: handleRequestAddDirectory,
|
|
1323
|
+
onRequestRemoveDirectory: handleRequestRemoveDirectory,
|
|
1324
|
+
onHeaderFocusChange: handleHeaderFocusChange
|
|
1325
|
+
}, undefined, false, undefined, this)
|
|
1326
|
+
]
|
|
1327
|
+
}, undefined, true, undefined, this)
|
|
1328
|
+
}, undefined, false, undefined, this)
|
|
1329
|
+
]
|
|
1330
|
+
}, undefined, true, undefined, this),
|
|
1331
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
1332
|
+
marginTop: 1,
|
|
1333
|
+
paddingLeft: 1,
|
|
1334
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
1335
|
+
dimColor: true,
|
|
1336
|
+
children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
|
|
1337
|
+
children: [
|
|
1338
|
+
"Press ",
|
|
1339
|
+
exitState.keyName,
|
|
1340
|
+
" again to exit"
|
|
1341
|
+
]
|
|
1342
|
+
}, undefined, true, undefined, this) : headerFocused ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
|
|
1343
|
+
children: "\u2190/\u2192 tab switch \xB7 \u2193 return \xB7 Esc cancel"
|
|
1344
|
+
}, undefined, false, undefined, this) : isSearchMode ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
|
|
1345
|
+
children: "Type to filter \xB7 Enter/\u2193 select \xB7 \u2191 tabs \xB7 Esc clear"
|
|
1346
|
+
}, undefined, false, undefined, this) : hasDenials && defaultTab === "recent" ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
|
|
1347
|
+
children: "Enter approve \xB7 r retry \xB7 \u2191\u2193 navigate \xB7 \u2190/\u2192 switch \xB7 Esc cancel"
|
|
1348
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
|
|
1349
|
+
children: "\u2191\u2193 navigate \xB7 Enter select \xB7 Type to search \xB7 \u2190/\u2192 switch \xB7 Esc cancel"
|
|
1350
|
+
}, undefined, false, undefined, this)
|
|
1351
|
+
}, undefined, false, undefined, this)
|
|
1352
|
+
}, undefined, false, undefined, this)
|
|
1353
|
+
]
|
|
1354
|
+
}, undefined, true, undefined, this)
|
|
1355
|
+
}, undefined, false, undefined, this);
|
|
1356
|
+
}
|
|
1357
|
+
var import_react6, jsx_dev_runtime7;
|
|
1358
|
+
var init_PermissionRuleList = __esm(() => {
|
|
1359
|
+
init_source();
|
|
1360
|
+
init_figures();
|
|
1361
|
+
init_AppState();
|
|
1362
|
+
init_PermissionUpdate();
|
|
1363
|
+
init_select();
|
|
1364
|
+
init_useExitOnCtrlCDWithKeybindings();
|
|
1365
|
+
init_useSearchInput();
|
|
1366
|
+
init_src();
|
|
1367
|
+
init_useKeybinding();
|
|
1368
|
+
init_autoModeDenials();
|
|
1369
|
+
init_permissionRuleParser();
|
|
1370
|
+
init_permissions();
|
|
1371
|
+
init_slowOperations();
|
|
1372
|
+
init_src();
|
|
1373
|
+
init_Tabs();
|
|
1374
|
+
init_SearchBox();
|
|
1375
|
+
init_AddPermissionRules();
|
|
1376
|
+
init_AddWorkspaceDirectory();
|
|
1377
|
+
init_PermissionRuleDescription();
|
|
1378
|
+
init_PermissionRuleInput();
|
|
1379
|
+
init_RecentDenialsTab();
|
|
1380
|
+
init_RemoveWorkspaceDirectory();
|
|
1381
|
+
init_WorkspaceTab();
|
|
1382
|
+
import_react6 = __toESM(require_react(), 1);
|
|
1383
|
+
jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
|
|
1384
|
+
});
|
|
1385
|
+
|
|
1386
|
+
// src/commands/permissions/permissions.tsx
|
|
1387
|
+
var jsx_dev_runtime8, call = async (onDone, context) => {
|
|
1388
|
+
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(PermissionRuleList, {
|
|
1389
|
+
onExit: onDone,
|
|
1390
|
+
onRetryDenials: (commands) => {
|
|
1391
|
+
context.setMessages((prev) => [
|
|
1392
|
+
...prev,
|
|
1393
|
+
createPermissionRetryMessage(commands)
|
|
1394
|
+
]);
|
|
1395
|
+
}
|
|
1396
|
+
}, undefined, false, undefined, this);
|
|
1397
|
+
};
|
|
1398
|
+
var init_permissions2 = __esm(() => {
|
|
1399
|
+
init_PermissionRuleList();
|
|
1400
|
+
init_messages();
|
|
1401
|
+
jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
|
|
1402
|
+
});
|
|
1403
|
+
init_permissions2();
|
|
1404
|
+
|
|
1405
|
+
export {
|
|
1406
|
+
call
|
|
1407
|
+
};
|