gong-code 0.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.
Files changed (374) hide show
  1. package/README.md +38 -0
  2. package/dist/SKILL-22jccbka.md +1 -0
  3. package/dist/chunk-01wdn84e.js +8 -0
  4. package/dist/chunk-04bc74vz.js +243 -0
  5. package/dist/chunk-05t2vqsb.js +490 -0
  6. package/dist/chunk-0727wret.js +159 -0
  7. package/dist/chunk-07rervty.js +200 -0
  8. package/dist/chunk-0b9nxvyg.js +478 -0
  9. package/dist/chunk-0e428b73.js +600 -0
  10. package/dist/chunk-0hqfheht.js +3439 -0
  11. package/dist/chunk-0pnk52c2.js +116 -0
  12. package/dist/chunk-0sbddf6m.js +68 -0
  13. package/dist/chunk-0vf7xb84.js +176 -0
  14. package/dist/chunk-0yz17yjy.js +1061 -0
  15. package/dist/chunk-0zscb6c7.js +10 -0
  16. package/dist/chunk-10p21kq6.js +378 -0
  17. package/dist/chunk-17k78pmz.js +120 -0
  18. package/dist/chunk-19jvvqzp.js +1390 -0
  19. package/dist/chunk-1d5czqnr.js +173 -0
  20. package/dist/chunk-1gjysfnf.js +13876 -0
  21. package/dist/chunk-1jjfv0wd.js +467 -0
  22. package/dist/chunk-1jjzp2pa.js +617 -0
  23. package/dist/chunk-1m38dj2k.js +155 -0
  24. package/dist/chunk-1pgttway.js +211 -0
  25. package/dist/chunk-1vvnx0gb.js +8035 -0
  26. package/dist/chunk-1ztm9yps.js +49145 -0
  27. package/dist/chunk-208x1t0m.js +88 -0
  28. package/dist/chunk-20xqs3yk.js +843 -0
  29. package/dist/chunk-2b2c0wnn.js +584 -0
  30. package/dist/chunk-2g07117j.js +541 -0
  31. package/dist/chunk-2g6p2t3w.js +780 -0
  32. package/dist/chunk-2kjeaeg7.js +28 -0
  33. package/dist/chunk-2n0s2dhc.js +12 -0
  34. package/dist/chunk-2p0hvt8k.js +785 -0
  35. package/dist/chunk-2qmxg9y7.js +40174 -0
  36. package/dist/chunk-2qpy8kne.js +28 -0
  37. package/dist/chunk-2rgbf62a.js +40 -0
  38. package/dist/chunk-2tx0s41y.js +150 -0
  39. package/dist/chunk-2x8zk5cz.js +101 -0
  40. package/dist/chunk-2yqy25z4.js +48 -0
  41. package/dist/chunk-318g78ty.js +552 -0
  42. package/dist/chunk-31gfg8tz.js +290 -0
  43. package/dist/chunk-32n0s532.js +1317 -0
  44. package/dist/chunk-35dw2r9g.js +137 -0
  45. package/dist/chunk-36b5zqvn.js +1865 -0
  46. package/dist/chunk-38kpx69j.js +97 -0
  47. package/dist/chunk-3b01vp8p.js +815 -0
  48. package/dist/chunk-3f76a1ek.js +317 -0
  49. package/dist/chunk-3fd1hkhh.js +4254 -0
  50. package/dist/chunk-3ffxa7zj.js +8 -0
  51. package/dist/chunk-3gcj7w95.js +8 -0
  52. package/dist/chunk-3jf3k40v.js +970 -0
  53. package/dist/chunk-3k51qfp9.js +9301 -0
  54. package/dist/chunk-3mhygd2v.js +1180 -0
  55. package/dist/chunk-3p6y0gvb.js +117 -0
  56. package/dist/chunk-3r60xdt5.js +93 -0
  57. package/dist/chunk-43agf6xv.js +8 -0
  58. package/dist/chunk-46zr418r.js +15 -0
  59. package/dist/chunk-48k2bs4w.js +118 -0
  60. package/dist/chunk-4p987a4z.js +84 -0
  61. package/dist/chunk-4px25pe0.js +776 -0
  62. package/dist/chunk-4s93jyky.js +113 -0
  63. package/dist/chunk-4xv8bedf.js +58 -0
  64. package/dist/chunk-4y382mzd.js +346 -0
  65. package/dist/chunk-52dzw4bc.js +246 -0
  66. package/dist/chunk-52qqmh5g.js +110 -0
  67. package/dist/chunk-53grnhp7.js +8 -0
  68. package/dist/chunk-59craaxx.js +4249 -0
  69. package/dist/chunk-5b833jqs.js +96 -0
  70. package/dist/chunk-5cp2q9sh.js +58 -0
  71. package/dist/chunk-5dbaxmts.js +87 -0
  72. package/dist/chunk-5f5sxgp0.js +96 -0
  73. package/dist/chunk-5mkfderj.js +195 -0
  74. package/dist/chunk-5qw0mpvq.js +389 -0
  75. package/dist/chunk-5rxmszm8.js +48 -0
  76. package/dist/chunk-5ygxa3hr.js +65 -0
  77. package/dist/chunk-61d5dqq2.js +71 -0
  78. package/dist/chunk-6350958y.js +272 -0
  79. package/dist/chunk-65z8hg8j.js +1337 -0
  80. package/dist/chunk-6aq85gdq.js +8 -0
  81. package/dist/chunk-6cjh9exg.js +40751 -0
  82. package/dist/chunk-6e41p5m6.js +187 -0
  83. package/dist/chunk-6jb6xcnq.js +10511 -0
  84. package/dist/chunk-6jta29r1.js +20 -0
  85. package/dist/chunk-6q7f2rrv.js +4757 -0
  86. package/dist/chunk-6sg0ec6v.js +41 -0
  87. package/dist/chunk-6v0rhx4e.js +328 -0
  88. package/dist/chunk-6x5mz95v.js +751 -0
  89. package/dist/chunk-6xqp51qr.js +87 -0
  90. package/dist/chunk-6xvyx1s9.js +6957 -0
  91. package/dist/chunk-6ywh7wgp.js +468 -0
  92. package/dist/chunk-75ne77gm.js +1920 -0
  93. package/dist/chunk-77cb06js.js +602 -0
  94. package/dist/chunk-78n9kfp8.js +1645 -0
  95. package/dist/chunk-7be87rww.js +277 -0
  96. package/dist/chunk-7e1qjk3s.js +125 -0
  97. package/dist/chunk-7e7nxnss.js +360 -0
  98. package/dist/chunk-7g8156qp.js +55 -0
  99. package/dist/chunk-7nz71s42.js +3353 -0
  100. package/dist/chunk-7r078t2x.js +113 -0
  101. package/dist/chunk-7shx41hj.js +3094 -0
  102. package/dist/chunk-7yexhdjs.js +216 -0
  103. package/dist/chunk-83kmfcjv.js +256 -0
  104. package/dist/chunk-846rr9n1.js +107 -0
  105. package/dist/chunk-84ncsm1r.js +183 -0
  106. package/dist/chunk-867x8aq0.js +8936 -0
  107. package/dist/chunk-8byh30kb.js +1947 -0
  108. package/dist/chunk-8c8f6gnt.js +432 -0
  109. package/dist/chunk-8gtdseev.js +454 -0
  110. package/dist/chunk-8jfh9rq6.js +642 -0
  111. package/dist/chunk-8n4n4m67.js +800 -0
  112. package/dist/chunk-8za61tze.js +847 -0
  113. package/dist/chunk-9029sbq1.js +57 -0
  114. package/dist/chunk-94dm5rrm.js +673 -0
  115. package/dist/chunk-9bs8n985.js +329 -0
  116. package/dist/chunk-9c23776j.js +763 -0
  117. package/dist/chunk-9e93g81n.js +298 -0
  118. package/dist/chunk-9f3d61y7.js +548 -0
  119. package/dist/chunk-9gc3andd.js +422 -0
  120. package/dist/chunk-9kn3tgpb.js +130 -0
  121. package/dist/chunk-9m5rn7hk.js +61 -0
  122. package/dist/chunk-9p4hsd6a.js +50 -0
  123. package/dist/chunk-9qasfk8n.js +758 -0
  124. package/dist/chunk-9snp5mn2.js +533 -0
  125. package/dist/chunk-9tcvras3.js +2331 -0
  126. package/dist/chunk-a0186ngk.js +57 -0
  127. package/dist/chunk-a2m8f0aj.js +268 -0
  128. package/dist/chunk-a2rcafav.js +716 -0
  129. package/dist/chunk-a9hjdzar.js +160 -0
  130. package/dist/chunk-aak6ts5n.js +526 -0
  131. package/dist/chunk-aca3w84n.js +267 -0
  132. package/dist/chunk-ae76ded0.js +30 -0
  133. package/dist/chunk-afnjhn3j.js +21933 -0
  134. package/dist/chunk-ahj70tf0.js +880 -0
  135. package/dist/chunk-apjsxssq.js +169 -0
  136. package/dist/chunk-av49wjj1.js +43 -0
  137. package/dist/chunk-axggebfy.js +206 -0
  138. package/dist/chunk-az7jpbv8.js +16 -0
  139. package/dist/chunk-azz7sep6.js +328 -0
  140. package/dist/chunk-b4tpz2g1.js +93 -0
  141. package/dist/chunk-bczf2eyq.js +115 -0
  142. package/dist/chunk-bd95f637.js +208 -0
  143. package/dist/chunk-bdhdmkya.js +10 -0
  144. package/dist/chunk-bp0ynk17.js +32 -0
  145. package/dist/chunk-bq75gxjs.js +90 -0
  146. package/dist/chunk-btk5jaq6.js +10464 -0
  147. package/dist/chunk-bv4c48a5.js +120 -0
  148. package/dist/chunk-byfb105n.js +341 -0
  149. package/dist/chunk-c0bdmy7w.js +4223 -0
  150. package/dist/chunk-c20aqkz8.js +641 -0
  151. package/dist/chunk-c4jg3s2c.js +163 -0
  152. package/dist/chunk-c61q5cer.js +258 -0
  153. package/dist/chunk-c9f761sy.js +386 -0
  154. package/dist/chunk-ca6jkz06.js +157 -0
  155. package/dist/chunk-ccyg9ap9.js +171374 -0
  156. package/dist/chunk-cfej8cc7.js +371 -0
  157. package/dist/chunk-cjqxdnf9.js +23 -0
  158. package/dist/chunk-ckrs789w.js +8 -0
  159. package/dist/chunk-cqeq13wg.js +48 -0
  160. package/dist/chunk-crfj3w5e.js +22821 -0
  161. package/dist/chunk-ct5x6z7g.js +8066 -0
  162. package/dist/chunk-cv5h8n8c.js +101 -0
  163. package/dist/chunk-cwe8h159.js +1563 -0
  164. package/dist/chunk-cwm234zz.js +908 -0
  165. package/dist/chunk-d1jkfp45.js +1580 -0
  166. package/dist/chunk-d3hb1qdr.js +126 -0
  167. package/dist/chunk-d70d0zer.js +713 -0
  168. package/dist/chunk-d91tx29f.js +105 -0
  169. package/dist/chunk-d952pymh.js +20 -0
  170. package/dist/chunk-d9af3z8k.js +720 -0
  171. package/dist/chunk-da1n53c2.js +47 -0
  172. package/dist/chunk-df5c1x8m.js +732 -0
  173. package/dist/chunk-dkv64xys.js +71 -0
  174. package/dist/chunk-dm7166v6.js +251 -0
  175. package/dist/chunk-dr0y5a61.js +258 -0
  176. package/dist/chunk-drzb0rrd.js +306 -0
  177. package/dist/chunk-dw1v1q7w.js +37 -0
  178. package/dist/chunk-e224qet4.js +348 -0
  179. package/dist/chunk-e50ckbv0.js +1099 -0
  180. package/dist/chunk-e5gn6by6.js +1165 -0
  181. package/dist/chunk-e7m3f74m.js +37 -0
  182. package/dist/chunk-e8ghgwaj.js +295 -0
  183. package/dist/chunk-ed8k4ya2.js +41 -0
  184. package/dist/chunk-eh0vnqdz.js +76 -0
  185. package/dist/chunk-epwrzr35.js +4301 -0
  186. package/dist/chunk-er9h6sw5.js +5379 -0
  187. package/dist/chunk-eta5aekm.js +79 -0
  188. package/dist/chunk-ev5gxscq.js +63 -0
  189. package/dist/chunk-evp72hv5.js +212 -0
  190. package/dist/chunk-ex41stfq.js +127 -0
  191. package/dist/chunk-ezpa510h.js +62 -0
  192. package/dist/chunk-f0fm6dey.js +477 -0
  193. package/dist/chunk-f239sbhc.js +152 -0
  194. package/dist/chunk-f2bj47xf.js +109 -0
  195. package/dist/chunk-f4t24rq4.js +258 -0
  196. package/dist/chunk-f9ghvzy8.js +106 -0
  197. package/dist/chunk-f9rahzgr.js +99 -0
  198. package/dist/chunk-ff75qzty.js +521 -0
  199. package/dist/chunk-fj0ctt6q.js +264 -0
  200. package/dist/chunk-fj7wxdt3.js +221 -0
  201. package/dist/chunk-fnnpqv92.js +714 -0
  202. package/dist/chunk-fpd3zzx1.js +26696 -0
  203. package/dist/chunk-fqv2cn76.js +227 -0
  204. package/dist/chunk-fqw9j3bj.js +439 -0
  205. package/dist/chunk-frbcqhz0.js +4984 -0
  206. package/dist/chunk-fzkj59sg.js +174 -0
  207. package/dist/chunk-fzpzbpbw.js +248 -0
  208. package/dist/chunk-g52cpmd1.js +686 -0
  209. package/dist/chunk-g98m2qe6.js +31 -0
  210. package/dist/chunk-g9zgq4vy.js +715 -0
  211. package/dist/chunk-gbpt7tm8.js +687 -0
  212. package/dist/chunk-gg52jka8.js +373 -0
  213. package/dist/chunk-gjttphax.js +5793 -0
  214. package/dist/chunk-gs7vjaas.js +65 -0
  215. package/dist/chunk-gv8n85j2.js +8 -0
  216. package/dist/chunk-gxdwm6pt.js +650 -0
  217. package/dist/chunk-gy8wajg2.js +1014 -0
  218. package/dist/chunk-gz3647m0.js +200 -0
  219. package/dist/chunk-gzg07mqh.js +16 -0
  220. package/dist/chunk-h3zc60tq.js +44 -0
  221. package/dist/chunk-h4p1qt16.js +74 -0
  222. package/dist/chunk-h8219f18.js +282 -0
  223. package/dist/chunk-h9agq92v.js +331 -0
  224. package/dist/chunk-hhjtpwbj.js +16 -0
  225. package/dist/chunk-hpgpwzra.js +548 -0
  226. package/dist/chunk-hsnjvn19.js +80 -0
  227. package/dist/chunk-hsp9qrry.js +417 -0
  228. package/dist/chunk-hwz6aq2m.js +3939 -0
  229. package/dist/chunk-hzph0hbh.js +272 -0
  230. package/dist/chunk-hzqkss6v.js +153 -0
  231. package/dist/chunk-j0t31f39.js +1149 -0
  232. package/dist/chunk-j1qm6n1v.js +30 -0
  233. package/dist/chunk-j6e4b522.js +81 -0
  234. package/dist/chunk-j7qfbvxk.js +84 -0
  235. package/dist/chunk-j7qv3hvm.js +1635 -0
  236. package/dist/chunk-j8mxc6k6.js +213 -0
  237. package/dist/chunk-jevj87jn.js +224 -0
  238. package/dist/chunk-jk2ps88q.js +815 -0
  239. package/dist/chunk-jz7tbdyv.js +1599 -0
  240. package/dist/chunk-k36jpjvh.js +300 -0
  241. package/dist/chunk-k4nmrt3w.js +61 -0
  242. package/dist/chunk-kavn03r9.js +16606 -0
  243. package/dist/chunk-kkgav8dm.js +54 -0
  244. package/dist/chunk-kkq26g5c.js +33 -0
  245. package/dist/chunk-kp6nepx4.js +106 -0
  246. package/dist/chunk-ksefybc8.js +1551 -0
  247. package/dist/chunk-kv147680.js +3436 -0
  248. package/dist/chunk-kya46axt.js +833 -0
  249. package/dist/chunk-kyz233ny.js +227 -0
  250. package/dist/chunk-kzs75xmj.js +143 -0
  251. package/dist/chunk-m0vrez9w.js +266 -0
  252. package/dist/chunk-m1wadav3.js +118 -0
  253. package/dist/chunk-m4rfx3cj.js +221 -0
  254. package/dist/chunk-mc9zaggs.js +6374 -0
  255. package/dist/chunk-mcg5ttj4.js +105 -0
  256. package/dist/chunk-mf4r7918.js +63 -0
  257. package/dist/chunk-mh9khrt4.js +286 -0
  258. package/dist/chunk-mhc4szw7.js +22 -0
  259. package/dist/chunk-mkq0yzp0.js +38 -0
  260. package/dist/chunk-mr58jv4w.js +256 -0
  261. package/dist/chunk-mrrx3bmt.js +168 -0
  262. package/dist/chunk-mtyk3zz6.js +87 -0
  263. package/dist/chunk-mvgxntv6.js +62 -0
  264. package/dist/chunk-mwnjydcm.js +102 -0
  265. package/dist/chunk-mwxt0m3f.js +862 -0
  266. package/dist/chunk-mz1pxck8.js +998 -0
  267. package/dist/chunk-n3agghys.js +214 -0
  268. package/dist/chunk-n6q02ya9.js +442 -0
  269. package/dist/chunk-nt3y91vh.js +443 -0
  270. package/dist/chunk-nt837qt9.js +21 -0
  271. package/dist/chunk-ntgmegfs.js +39 -0
  272. package/dist/chunk-nwk16bbd.js +30 -0
  273. package/dist/chunk-p367ay90.js +672 -0
  274. package/dist/chunk-p7m3x9qk.js +48 -0
  275. package/dist/chunk-pagmjwp5.js +132 -0
  276. package/dist/chunk-pbd4r8ek.js +161 -0
  277. package/dist/chunk-pdkpssgv.js +2422 -0
  278. package/dist/chunk-pf6z1e35.js +32 -0
  279. package/dist/chunk-pfzejvpt.js +213 -0
  280. package/dist/chunk-pktxyhvk.js +400 -0
  281. package/dist/chunk-pp5xhveq.js +124 -0
  282. package/dist/chunk-ppnd7a8x.js +38 -0
  283. package/dist/chunk-pqh2w7dr.js +2202 -0
  284. package/dist/chunk-pr878d0z.js +240 -0
  285. package/dist/chunk-psf0y7hy.js +140 -0
  286. package/dist/chunk-pz2zz2f7.js +1586 -0
  287. package/dist/chunk-q0xkrxy8.js +890 -0
  288. package/dist/chunk-q5b0kpr3.js +14369 -0
  289. package/dist/chunk-q7z3t531.js +334 -0
  290. package/dist/chunk-qdjjtgwt.js +3183 -0
  291. package/dist/chunk-qezv7msv.js +26 -0
  292. package/dist/chunk-qmxn7f86.js +2643 -0
  293. package/dist/chunk-qqc3b97c.js +15 -0
  294. package/dist/chunk-qwrp63wh.js +145 -0
  295. package/dist/chunk-qyvqbst3.js +537 -0
  296. package/dist/chunk-qztvd4hd.js +465 -0
  297. package/dist/chunk-r0bvez4y.js +235 -0
  298. package/dist/chunk-r3z0896k.js +2831 -0
  299. package/dist/chunk-r4cxb6t7.js +32 -0
  300. package/dist/chunk-rb8k68m7.js +118 -0
  301. package/dist/chunk-rdprgm4t.js +42 -0
  302. package/dist/chunk-rex82hys.js +1710 -0
  303. package/dist/chunk-rjjakkw2.js +2560 -0
  304. package/dist/chunk-rka6gcv3.js +304 -0
  305. package/dist/chunk-rkz12ghm.js +144 -0
  306. package/dist/chunk-rnc7m1qs.js +436 -0
  307. package/dist/chunk-rx6z23h0.js +165 -0
  308. package/dist/chunk-s76582j1.js +28 -0
  309. package/dist/chunk-sez03qd9.js +7140 -0
  310. package/dist/chunk-sjvdn2ep.js +130 -0
  311. package/dist/chunk-smwhyy8p.js +115 -0
  312. package/dist/chunk-snw7nh0d.js +695 -0
  313. package/dist/chunk-sqx9c057.js +193 -0
  314. package/dist/chunk-sscms68s.js +16 -0
  315. package/dist/chunk-stknnmsb.js +272 -0
  316. package/dist/chunk-sywdxbs6.js +853 -0
  317. package/dist/chunk-syxy4pf2.js +782 -0
  318. package/dist/chunk-t0hpqsqn.js +6157 -0
  319. package/dist/chunk-tjm70vnw.js +123 -0
  320. package/dist/chunk-trzh0msn.js +154 -0
  321. package/dist/chunk-v1z17cpg.js +723 -0
  322. package/dist/chunk-vsfj449x.js +333 -0
  323. package/dist/chunk-vvkq20tt.js +287 -0
  324. package/dist/chunk-vxgdzx6p.js +338 -0
  325. package/dist/chunk-vxqhjyfz.js +15 -0
  326. package/dist/chunk-vzsstfmb.js +80 -0
  327. package/dist/chunk-w1jew5sn.js +69 -0
  328. package/dist/chunk-w3kwr76v.js +789 -0
  329. package/dist/chunk-w40netr9.js +59 -0
  330. package/dist/chunk-w99cpfdg.js +559 -0
  331. package/dist/chunk-wacn14d2.js +271 -0
  332. package/dist/chunk-wbhrqrq3.js +3033 -0
  333. package/dist/chunk-wfg9g0p7.js +17612 -0
  334. package/dist/chunk-wj3vjsbx.js +93 -0
  335. package/dist/chunk-wjhq855a.js +372 -0
  336. package/dist/chunk-wr06gqxh.js +114 -0
  337. package/dist/chunk-ws0z2y1g.js +195 -0
  338. package/dist/chunk-wt62wqcj.js +98 -0
  339. package/dist/chunk-wx4v7ddx.js +42 -0
  340. package/dist/chunk-wy0t3vb2.js +6101 -0
  341. package/dist/chunk-wysz7qk4.js +280 -0
  342. package/dist/chunk-x63fx1vd.js +192 -0
  343. package/dist/chunk-x8b7vft8.js +132 -0
  344. package/dist/chunk-x8jhkgxb.js +346 -0
  345. package/dist/chunk-x9z4q5k5.js +275 -0
  346. package/dist/chunk-xjd7e9jq.js +126 -0
  347. package/dist/chunk-xjr0n27e.js +42 -0
  348. package/dist/chunk-xpwyw7cd.js +24 -0
  349. package/dist/chunk-xw4ycnyz.js +37 -0
  350. package/dist/chunk-y66bqywr.js +17303 -0
  351. package/dist/chunk-ycarry7d.js +157 -0
  352. package/dist/chunk-ycr0hp6v.js +1486 -0
  353. package/dist/chunk-yqmaw6hf.js +496 -0
  354. package/dist/chunk-yrtm7d23.js +602 -0
  355. package/dist/chunk-yts879rw.js +48 -0
  356. package/dist/chunk-yvmhx96e.js +347 -0
  357. package/dist/chunk-ywq00rg4.js +246 -0
  358. package/dist/chunk-yygeg5mj.js +752 -0
  359. package/dist/chunk-z0exw850.js +726 -0
  360. package/dist/chunk-z2dp53wn.js +17 -0
  361. package/dist/chunk-z4rzc9nd.js +103 -0
  362. package/dist/chunk-zb0akt77.js +684 -0
  363. package/dist/chunk-zb2xrj5t.js +1789 -0
  364. package/dist/chunk-zbptn0ky.js +423 -0
  365. package/dist/chunk-zd45wbmf.js +1090 -0
  366. package/dist/chunk-zjkvspz9.js +2050 -0
  367. package/dist/chunk-zke1sp3x.js +1524 -0
  368. package/dist/chunk-zv2cvfsv.js +58 -0
  369. package/dist/chunk-zy4tmqst.js +644 -0
  370. package/dist/chunk-zygzzzvk.js +192 -0
  371. package/dist/cli-21v3v6ny.md +1 -0
  372. package/dist/cli.js +246 -0
  373. package/dist/server-n5f2q89z.md +1 -0
  374. package/package.json +161 -0
@@ -0,0 +1,2643 @@
1
+ // @bun
2
+ import {
3
+ getAutoModeDenials,
4
+ init_autoModeDenials
5
+ } from "./chunk-qqc3b97c.js";
6
+ import {
7
+ detectUnreachableRules,
8
+ init_shadowedRuleDetection
9
+ } from "./chunk-wj3vjsbx.js";
10
+ import {
11
+ SearchBox,
12
+ init_SearchBox,
13
+ init_useSearchInput,
14
+ useSearchInput
15
+ } from "./chunk-8c8f6gnt.js";
16
+ import {
17
+ Tab,
18
+ Tabs,
19
+ init_Tabs,
20
+ useTabHeaderFocus,
21
+ useTabsWidth
22
+ } from "./chunk-wjhq855a.js";
23
+ import {
24
+ StatusIcon,
25
+ init_StatusIcon
26
+ } from "./chunk-4p987a4z.js";
27
+ import {
28
+ AddWorkspaceDirectory,
29
+ init_AddWorkspaceDirectory
30
+ } from "./chunk-yqmaw6hf.js";
31
+ import"./chunk-ca6jkz06.js";
32
+ import"./chunk-azz7sep6.js";
33
+ import"./chunk-apjsxssq.js";
34
+ import"./chunk-jevj87jn.js";
35
+ import {
36
+ Dialog,
37
+ init_Dialog
38
+ } from "./chunk-qztvd4hd.js";
39
+ import"./chunk-q0xkrxy8.js";
40
+ import"./chunk-52dzw4bc.js";
41
+ import"./chunk-n6q02ya9.js";
42
+ import"./chunk-b4tpz2g1.js";
43
+ import"./chunk-n3agghys.js";
44
+ import {
45
+ init_useExitOnCtrlCDWithKeybindings,
46
+ useExitOnCtrlCDWithKeybindings
47
+ } from "./chunk-f9rahzgr.js";
48
+ import"./chunk-ex41stfq.js";
49
+ import {
50
+ Pane,
51
+ init_Pane,
52
+ init_useKeybinding,
53
+ init_useTerminalSize,
54
+ useKeybinding,
55
+ useTerminalSize
56
+ } from "./chunk-8n4n4m67.js";
57
+ import"./chunk-xjr0n27e.js";
58
+ import {
59
+ require_jsx_dev_runtime,
60
+ require_react
61
+ } from "./chunk-0yz17yjy.js";
62
+ import"./chunk-9m5rn7hk.js";
63
+ import"./chunk-19jvvqzp.js";
64
+ import"./chunk-2n0s2dhc.js";
65
+ import"./chunk-epwrzr35.js";
66
+ import"./chunk-1ztm9yps.js";
67
+ import"./chunk-78n9kfp8.js";
68
+ import"./chunk-j8mxc6k6.js";
69
+ import"./chunk-z0exw850.js";
70
+ import"./chunk-3jf3k40v.js";
71
+ import"./chunk-yvmhx96e.js";
72
+ import"./chunk-qezv7msv.js";
73
+ import"./chunk-sscms68s.js";
74
+ import"./chunk-7e1qjk3s.js";
75
+ import"./chunk-1gjysfnf.js";
76
+ import"./chunk-vxgdzx6p.js";
77
+ import"./chunk-kv147680.js";
78
+ import"./chunk-2p0hvt8k.js";
79
+ import"./chunk-ycr0hp6v.js";
80
+ import"./chunk-zb2xrj5t.js";
81
+ import"./chunk-9029sbq1.js";
82
+ import"./chunk-ezpa510h.js";
83
+ import"./chunk-kp6nepx4.js";
84
+ import"./chunk-1jjzp2pa.js";
85
+ import"./chunk-w1jew5sn.js";
86
+ import"./chunk-g98m2qe6.js";
87
+ import {
88
+ figures_default,
89
+ init_figures
90
+ } from "./chunk-sez03qd9.js";
91
+ import"./chunk-vsfj449x.js";
92
+ import"./chunk-r4cxb6t7.js";
93
+ import"./chunk-bp0ynk17.js";
94
+ import"./chunk-7yexhdjs.js";
95
+ import {
96
+ init_slowOperations,
97
+ jsonStringify
98
+ } from "./chunk-rex82hys.js";
99
+ import"./chunk-4s93jyky.js";
100
+ import"./chunk-318g78ty.js";
101
+ import"./chunk-c0bdmy7w.js";
102
+ import"./chunk-syxy4pf2.js";
103
+ import {
104
+ __esm,
105
+ __toESM
106
+ } from "./chunk-eta5aekm.js";
107
+ import {
108
+ BashTool,
109
+ SandboxManager,
110
+ Select,
111
+ TextInput,
112
+ WebFetchTool,
113
+ applyPermissionUpdate,
114
+ createPermissionRetryMessage,
115
+ deletePermissionRule,
116
+ getAllowRules,
117
+ getAskRules,
118
+ getDenyRules,
119
+ init_AppState,
120
+ init_BashTool,
121
+ init_PermissionUpdate,
122
+ init_TextInput,
123
+ init_WebFetchTool,
124
+ init_messages,
125
+ init_permissions,
126
+ init_sandbox_adapter,
127
+ init_select,
128
+ permissionRuleSourceDisplayString,
129
+ persistPermissionUpdate,
130
+ useAppState,
131
+ useSetAppState
132
+ } from "./chunk-ccyg9ap9.js";
133
+ import"./chunk-846rr9n1.js";
134
+ import"./chunk-fnnpqv92.js";
135
+ import"./chunk-2yqy25z4.js";
136
+ import"./chunk-zygzzzvk.js";
137
+ import"./chunk-evp72hv5.js";
138
+ import"./chunk-jz7tbdyv.js";
139
+ import"./chunk-vxqhjyfz.js";
140
+ import"./chunk-mf4r7918.js";
141
+ import"./chunk-sywdxbs6.js";
142
+ import"./chunk-cjqxdnf9.js";
143
+ import"./chunk-9qasfk8n.js";
144
+ import {
145
+ Newline,
146
+ ThemedBox_default,
147
+ ThemedText,
148
+ init_ink,
149
+ require_compiler_runtime,
150
+ useTerminalFocus,
151
+ use_input_default
152
+ } from "./chunk-fpd3zzx1.js";
153
+ import"./chunk-bv4c48a5.js";
154
+ import"./chunk-6jta29r1.js";
155
+ import"./chunk-z4rzc9nd.js";
156
+ import"./chunk-9bs8n985.js";
157
+ import"./chunk-6xqp51qr.js";
158
+ import"./chunk-35dw2r9g.js";
159
+ import {
160
+ SOURCES,
161
+ getRelativeSettingsFilePathForSource,
162
+ init_constants,
163
+ init_permissionRuleParser,
164
+ init_settings1 as init_settings,
165
+ init_source,
166
+ init_stringUtils,
167
+ permissionRuleValueFromString,
168
+ permissionRuleValueToString,
169
+ plural,
170
+ source_default
171
+ } from "./chunk-y66bqywr.js";
172
+ import"./chunk-nwk16bbd.js";
173
+ import"./chunk-rx6z23h0.js";
174
+ import"./chunk-df5c1x8m.js";
175
+ import"./chunk-qwrp63wh.js";
176
+ import"./chunk-65z8hg8j.js";
177
+ import"./chunk-5cp2q9sh.js";
178
+ import {
179
+ getOriginalCwd,
180
+ init_state
181
+ } from "./chunk-rjjakkw2.js";
182
+ import"./chunk-0sbddf6m.js";
183
+ import"./chunk-q5b0kpr3.js";
184
+
185
+ // src/components/permissions/rules/PermissionRuleDescription.tsx
186
+ function PermissionRuleDescription(t0) {
187
+ const $ = import_compiler_runtime.c(9);
188
+ const {
189
+ ruleValue
190
+ } = t0;
191
+ switch (ruleValue.toolName) {
192
+ case BashTool.name: {
193
+ if (ruleValue.ruleContent) {
194
+ if (ruleValue.ruleContent.endsWith(":*")) {
195
+ let t1;
196
+ if ($[0] !== ruleValue.ruleContent) {
197
+ t1 = ruleValue.ruleContent.slice(0, -2);
198
+ $[0] = ruleValue.ruleContent;
199
+ $[1] = t1;
200
+ } else {
201
+ t1 = $[1];
202
+ }
203
+ let t2;
204
+ if ($[2] !== t1) {
205
+ t2 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
206
+ dimColor: true,
207
+ children: [
208
+ "Any Bash command starting with",
209
+ " ",
210
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
211
+ bold: true,
212
+ children: t1
213
+ }, undefined, false, undefined, this)
214
+ ]
215
+ }, undefined, true, undefined, this);
216
+ $[2] = t1;
217
+ $[3] = t2;
218
+ } else {
219
+ t2 = $[3];
220
+ }
221
+ return t2;
222
+ } else {
223
+ let t1;
224
+ if ($[4] !== ruleValue.ruleContent) {
225
+ t1 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
226
+ dimColor: true,
227
+ children: [
228
+ "The Bash command ",
229
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
230
+ bold: true,
231
+ children: ruleValue.ruleContent
232
+ }, undefined, false, undefined, this)
233
+ ]
234
+ }, undefined, true, undefined, this);
235
+ $[4] = ruleValue.ruleContent;
236
+ $[5] = t1;
237
+ } else {
238
+ t1 = $[5];
239
+ }
240
+ return t1;
241
+ }
242
+ } else {
243
+ let t1;
244
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
245
+ t1 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
246
+ dimColor: true,
247
+ children: "Any Bash command"
248
+ }, undefined, false, undefined, this);
249
+ $[6] = t1;
250
+ } else {
251
+ t1 = $[6];
252
+ }
253
+ return t1;
254
+ }
255
+ }
256
+ default: {
257
+ if (!ruleValue.ruleContent) {
258
+ let t1;
259
+ if ($[7] !== ruleValue.toolName) {
260
+ t1 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
261
+ dimColor: true,
262
+ children: [
263
+ "Any use of the ",
264
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
265
+ bold: true,
266
+ children: ruleValue.toolName
267
+ }, undefined, false, undefined, this),
268
+ " tool"
269
+ ]
270
+ }, undefined, true, undefined, this);
271
+ $[7] = ruleValue.toolName;
272
+ $[8] = t1;
273
+ } else {
274
+ t1 = $[8];
275
+ }
276
+ return t1;
277
+ } else {
278
+ return null;
279
+ }
280
+ }
281
+ }
282
+ }
283
+ var import_compiler_runtime, jsx_dev_runtime;
284
+ var init_PermissionRuleDescription = __esm(() => {
285
+ init_ink();
286
+ init_BashTool();
287
+ import_compiler_runtime = __toESM(require_compiler_runtime(), 1);
288
+ jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
289
+ });
290
+
291
+ // src/components/permissions/rules/AddPermissionRules.tsx
292
+ function optionForPermissionSaveDestination(saveDestination) {
293
+ switch (saveDestination) {
294
+ case "localSettings":
295
+ return {
296
+ label: "Project settings (local)",
297
+ description: `Saved in ${getRelativeSettingsFilePathForSource("localSettings")}`,
298
+ value: saveDestination
299
+ };
300
+ case "projectSettings":
301
+ return {
302
+ label: "Project settings",
303
+ description: `Checked in at ${getRelativeSettingsFilePathForSource("projectSettings")}`,
304
+ value: saveDestination
305
+ };
306
+ case "userSettings":
307
+ return {
308
+ label: "User settings",
309
+ description: `Saved in at ~/.claude/settings.json`,
310
+ value: saveDestination
311
+ };
312
+ }
313
+ }
314
+ function AddPermissionRules(t0) {
315
+ const $ = import_compiler_runtime2.c(26);
316
+ const {
317
+ onAddRules,
318
+ onCancel,
319
+ ruleValues,
320
+ ruleBehavior,
321
+ initialContext,
322
+ setToolPermissionContext
323
+ } = t0;
324
+ let t1;
325
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
326
+ t1 = SOURCES.map(optionForPermissionSaveDestination);
327
+ $[0] = t1;
328
+ } else {
329
+ t1 = $[0];
330
+ }
331
+ const allOptions = t1;
332
+ let t2;
333
+ if ($[1] !== initialContext || $[2] !== onAddRules || $[3] !== onCancel || $[4] !== ruleBehavior || $[5] !== ruleValues || $[6] !== setToolPermissionContext) {
334
+ t2 = (selectedValue) => {
335
+ if (selectedValue === "cancel") {
336
+ onCancel();
337
+ return;
338
+ } else {
339
+ if (SOURCES.includes(selectedValue)) {
340
+ const destination = selectedValue;
341
+ const updatedContext = applyPermissionUpdate(initialContext, {
342
+ type: "addRules",
343
+ rules: ruleValues,
344
+ behavior: ruleBehavior,
345
+ destination
346
+ });
347
+ persistPermissionUpdate({
348
+ type: "addRules",
349
+ rules: ruleValues,
350
+ behavior: ruleBehavior,
351
+ destination
352
+ });
353
+ setToolPermissionContext(updatedContext);
354
+ const rules = ruleValues.map((ruleValue) => ({
355
+ ruleValue,
356
+ ruleBehavior,
357
+ source: destination
358
+ }));
359
+ const sandboxAutoAllowEnabled = SandboxManager.isSandboxingEnabled() && SandboxManager.isAutoAllowBashIfSandboxedEnabled();
360
+ const allUnreachable = detectUnreachableRules(updatedContext, {
361
+ sandboxAutoAllowEnabled
362
+ });
363
+ const newUnreachable = allUnreachable.filter((u) => ruleValues.some((rv) => rv.toolName === u.rule.ruleValue.toolName && rv.ruleContent === u.rule.ruleValue.ruleContent));
364
+ onAddRules(rules, newUnreachable.length > 0 ? newUnreachable : undefined);
365
+ }
366
+ }
367
+ };
368
+ $[1] = initialContext;
369
+ $[2] = onAddRules;
370
+ $[3] = onCancel;
371
+ $[4] = ruleBehavior;
372
+ $[5] = ruleValues;
373
+ $[6] = setToolPermissionContext;
374
+ $[7] = t2;
375
+ } else {
376
+ t2 = $[7];
377
+ }
378
+ const onSelect = t2;
379
+ let t3;
380
+ if ($[8] !== ruleValues.length) {
381
+ t3 = plural(ruleValues.length, "rule");
382
+ $[8] = ruleValues.length;
383
+ $[9] = t3;
384
+ } else {
385
+ t3 = $[9];
386
+ }
387
+ const title = `Add ${ruleBehavior} permission ${t3}`;
388
+ let t4;
389
+ if ($[10] !== ruleValues) {
390
+ t4 = ruleValues.map(_temp);
391
+ $[10] = ruleValues;
392
+ $[11] = t4;
393
+ } else {
394
+ t4 = $[11];
395
+ }
396
+ let t5;
397
+ if ($[12] !== t4) {
398
+ t5 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
399
+ flexDirection: "column",
400
+ paddingX: 2,
401
+ children: t4
402
+ }, undefined, false, undefined, this);
403
+ $[12] = t4;
404
+ $[13] = t5;
405
+ } else {
406
+ t5 = $[13];
407
+ }
408
+ const t6 = ruleValues.length === 1 ? "Where should this rule be saved?" : "Where should these rules be saved?";
409
+ let t7;
410
+ if ($[14] !== t6) {
411
+ t7 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
412
+ children: t6
413
+ }, undefined, false, undefined, this);
414
+ $[14] = t6;
415
+ $[15] = t7;
416
+ } else {
417
+ t7 = $[15];
418
+ }
419
+ let t8;
420
+ if ($[16] !== onSelect) {
421
+ t8 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Select, {
422
+ options: allOptions,
423
+ onChange: onSelect
424
+ }, undefined, false, undefined, this);
425
+ $[16] = onSelect;
426
+ $[17] = t8;
427
+ } else {
428
+ t8 = $[17];
429
+ }
430
+ let t9;
431
+ if ($[18] !== t7 || $[19] !== t8) {
432
+ t9 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
433
+ flexDirection: "column",
434
+ marginY: 1,
435
+ children: [
436
+ t7,
437
+ t8
438
+ ]
439
+ }, undefined, true, undefined, this);
440
+ $[18] = t7;
441
+ $[19] = t8;
442
+ $[20] = t9;
443
+ } else {
444
+ t9 = $[20];
445
+ }
446
+ let t10;
447
+ if ($[21] !== onCancel || $[22] !== t5 || $[23] !== t9 || $[24] !== title) {
448
+ t10 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Dialog, {
449
+ title,
450
+ onCancel,
451
+ color: "permission",
452
+ children: [
453
+ t5,
454
+ t9
455
+ ]
456
+ }, undefined, true, undefined, this);
457
+ $[21] = onCancel;
458
+ $[22] = t5;
459
+ $[23] = t9;
460
+ $[24] = title;
461
+ $[25] = t10;
462
+ } else {
463
+ t10 = $[25];
464
+ }
465
+ return t10;
466
+ }
467
+ function _temp(ruleValue_0) {
468
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
469
+ flexDirection: "column",
470
+ children: [
471
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
472
+ bold: true,
473
+ children: permissionRuleValueToString(ruleValue_0)
474
+ }, undefined, false, undefined, this),
475
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(PermissionRuleDescription, {
476
+ ruleValue: ruleValue_0
477
+ }, undefined, false, undefined, this)
478
+ ]
479
+ }, permissionRuleValueToString(ruleValue_0), true, undefined, this);
480
+ }
481
+ var import_compiler_runtime2, jsx_dev_runtime2;
482
+ var init_AddPermissionRules = __esm(() => {
483
+ init_select();
484
+ init_ink();
485
+ init_PermissionUpdate();
486
+ init_permissionRuleParser();
487
+ init_shadowedRuleDetection();
488
+ init_sandbox_adapter();
489
+ init_constants();
490
+ init_settings();
491
+ init_stringUtils();
492
+ init_Dialog();
493
+ init_PermissionRuleDescription();
494
+ import_compiler_runtime2 = __toESM(require_compiler_runtime(), 1);
495
+ jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
496
+ });
497
+
498
+ // src/components/permissions/rules/PermissionRuleInput.tsx
499
+ function PermissionRuleInput(t0) {
500
+ const $ = import_compiler_runtime3.c(24);
501
+ const {
502
+ onCancel,
503
+ onSubmit,
504
+ ruleBehavior
505
+ } = t0;
506
+ const [inputValue, setInputValue] = import_react.useState("");
507
+ const [cursorOffset, setCursorOffset] = import_react.useState(0);
508
+ const exitState = useExitOnCtrlCDWithKeybindings();
509
+ let t1;
510
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
511
+ t1 = {
512
+ context: "Settings"
513
+ };
514
+ $[0] = t1;
515
+ } else {
516
+ t1 = $[0];
517
+ }
518
+ useKeybinding("confirm:no", onCancel, t1);
519
+ const {
520
+ columns
521
+ } = useTerminalSize();
522
+ const textInputColumns = columns - 6;
523
+ let t2;
524
+ if ($[1] !== onSubmit || $[2] !== ruleBehavior) {
525
+ t2 = (value) => {
526
+ const trimmedValue = value.trim();
527
+ if (trimmedValue.length === 0) {
528
+ return;
529
+ }
530
+ const ruleValue = permissionRuleValueFromString(trimmedValue);
531
+ onSubmit(ruleValue, ruleBehavior);
532
+ };
533
+ $[1] = onSubmit;
534
+ $[2] = ruleBehavior;
535
+ $[3] = t2;
536
+ } else {
537
+ t2 = $[3];
538
+ }
539
+ const handleSubmit = t2;
540
+ let t3;
541
+ if ($[4] !== ruleBehavior) {
542
+ t3 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
543
+ bold: true,
544
+ color: "permission",
545
+ children: [
546
+ "Add ",
547
+ ruleBehavior,
548
+ " permission rule"
549
+ ]
550
+ }, undefined, true, undefined, this);
551
+ $[4] = ruleBehavior;
552
+ $[5] = t3;
553
+ } else {
554
+ t3 = $[5];
555
+ }
556
+ let t4;
557
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
558
+ t4 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Newline, {}, undefined, false, undefined, this);
559
+ $[6] = t4;
560
+ } else {
561
+ t4 = $[6];
562
+ }
563
+ let t5;
564
+ let t6;
565
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
566
+ t5 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
567
+ bold: true,
568
+ children: permissionRuleValueToString({
569
+ toolName: WebFetchTool.name
570
+ })
571
+ }, undefined, false, undefined, this);
572
+ t6 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
573
+ bold: false,
574
+ children: " or "
575
+ }, undefined, false, undefined, this);
576
+ $[7] = t5;
577
+ $[8] = t6;
578
+ } else {
579
+ t5 = $[7];
580
+ t6 = $[8];
581
+ }
582
+ let t7;
583
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
584
+ t7 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
585
+ children: [
586
+ "Permission rules are a tool name, optionally followed by a specifier in parentheses.",
587
+ t4,
588
+ "e.g.,",
589
+ " ",
590
+ t5,
591
+ t6,
592
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
593
+ bold: true,
594
+ children: permissionRuleValueToString({
595
+ toolName: BashTool.name,
596
+ ruleContent: "ls:*"
597
+ })
598
+ }, undefined, false, undefined, this)
599
+ ]
600
+ }, undefined, true, undefined, this);
601
+ $[9] = t7;
602
+ } else {
603
+ t7 = $[9];
604
+ }
605
+ let t8;
606
+ if ($[10] !== cursorOffset || $[11] !== handleSubmit || $[12] !== inputValue || $[13] !== textInputColumns) {
607
+ t8 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
608
+ flexDirection: "column",
609
+ children: [
610
+ t7,
611
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
612
+ borderDimColor: true,
613
+ borderStyle: "round",
614
+ marginY: 1,
615
+ paddingLeft: 1,
616
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(TextInput, {
617
+ showCursor: true,
618
+ value: inputValue,
619
+ onChange: setInputValue,
620
+ onSubmit: handleSubmit,
621
+ placeholder: `Enter permission rule${figures_default.ellipsis}`,
622
+ columns: textInputColumns,
623
+ cursorOffset,
624
+ onChangeCursorOffset: setCursorOffset
625
+ }, undefined, false, undefined, this)
626
+ }, undefined, false, undefined, this)
627
+ ]
628
+ }, undefined, true, undefined, this);
629
+ $[10] = cursorOffset;
630
+ $[11] = handleSubmit;
631
+ $[12] = inputValue;
632
+ $[13] = textInputColumns;
633
+ $[14] = t8;
634
+ } else {
635
+ t8 = $[14];
636
+ }
637
+ let t9;
638
+ if ($[15] !== t3 || $[16] !== t8) {
639
+ t9 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
640
+ flexDirection: "column",
641
+ gap: 1,
642
+ borderStyle: "round",
643
+ paddingLeft: 1,
644
+ paddingRight: 1,
645
+ borderColor: "permission",
646
+ children: [
647
+ t3,
648
+ t8
649
+ ]
650
+ }, undefined, true, undefined, this);
651
+ $[15] = t3;
652
+ $[16] = t8;
653
+ $[17] = t9;
654
+ } else {
655
+ t9 = $[17];
656
+ }
657
+ let t10;
658
+ if ($[18] !== exitState.keyName || $[19] !== exitState.pending) {
659
+ t10 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
660
+ marginLeft: 3,
661
+ children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
662
+ dimColor: true,
663
+ children: [
664
+ "Press ",
665
+ exitState.keyName,
666
+ " again to exit"
667
+ ]
668
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
669
+ dimColor: true,
670
+ children: "Enter to submit \xB7 Esc to cancel"
671
+ }, undefined, false, undefined, this)
672
+ }, undefined, false, undefined, this);
673
+ $[18] = exitState.keyName;
674
+ $[19] = exitState.pending;
675
+ $[20] = t10;
676
+ } else {
677
+ t10 = $[20];
678
+ }
679
+ let t11;
680
+ if ($[21] !== t10 || $[22] !== t9) {
681
+ t11 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
682
+ children: [
683
+ t9,
684
+ t10
685
+ ]
686
+ }, undefined, true, undefined, this);
687
+ $[21] = t10;
688
+ $[22] = t9;
689
+ $[23] = t11;
690
+ } else {
691
+ t11 = $[23];
692
+ }
693
+ return t11;
694
+ }
695
+ var import_compiler_runtime3, import_react, jsx_dev_runtime3;
696
+ var init_PermissionRuleInput = __esm(() => {
697
+ init_figures();
698
+ init_TextInput();
699
+ init_useExitOnCtrlCDWithKeybindings();
700
+ init_useTerminalSize();
701
+ init_ink();
702
+ init_useKeybinding();
703
+ init_BashTool();
704
+ init_WebFetchTool();
705
+ init_permissionRuleParser();
706
+ import_compiler_runtime3 = __toESM(require_compiler_runtime(), 1);
707
+ import_react = __toESM(require_react(), 1);
708
+ jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
709
+ });
710
+
711
+ // src/components/permissions/rules/RecentDenialsTab.tsx
712
+ function RecentDenialsTab(t0) {
713
+ const $ = import_compiler_runtime4.c(30);
714
+ const {
715
+ onHeaderFocusChange,
716
+ onStateChange
717
+ } = t0;
718
+ const {
719
+ headerFocused,
720
+ focusHeader
721
+ } = useTabHeaderFocus();
722
+ let t1;
723
+ let t2;
724
+ if ($[0] !== headerFocused || $[1] !== onHeaderFocusChange) {
725
+ t1 = () => {
726
+ onHeaderFocusChange?.(headerFocused);
727
+ };
728
+ t2 = [headerFocused, onHeaderFocusChange];
729
+ $[0] = headerFocused;
730
+ $[1] = onHeaderFocusChange;
731
+ $[2] = t1;
732
+ $[3] = t2;
733
+ } else {
734
+ t1 = $[2];
735
+ t2 = $[3];
736
+ }
737
+ import_react2.useEffect(t1, t2);
738
+ const [denials] = import_react2.useState(_temp4);
739
+ const [approved, setApproved] = import_react2.useState(_temp2);
740
+ const [retry, setRetry] = import_react2.useState(_temp3);
741
+ const [focusedIdx, setFocusedIdx] = import_react2.useState(0);
742
+ let t3;
743
+ let t4;
744
+ if ($[4] !== approved || $[5] !== denials || $[6] !== onStateChange || $[7] !== retry) {
745
+ t3 = () => {
746
+ onStateChange({
747
+ approved,
748
+ retry,
749
+ denials
750
+ });
751
+ };
752
+ t4 = [approved, retry, denials, onStateChange];
753
+ $[4] = approved;
754
+ $[5] = denials;
755
+ $[6] = onStateChange;
756
+ $[7] = retry;
757
+ $[8] = t3;
758
+ $[9] = t4;
759
+ } else {
760
+ t3 = $[8];
761
+ t4 = $[9];
762
+ }
763
+ import_react2.useEffect(t3, t4);
764
+ let t5;
765
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
766
+ t5 = (value) => {
767
+ const idx = Number(value);
768
+ setApproved((prev) => {
769
+ const next = new Set(prev);
770
+ if (next.has(idx)) {
771
+ next.delete(idx);
772
+ } else {
773
+ next.add(idx);
774
+ }
775
+ return next;
776
+ });
777
+ };
778
+ $[10] = t5;
779
+ } else {
780
+ t5 = $[10];
781
+ }
782
+ const handleSelect = t5;
783
+ let t6;
784
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
785
+ t6 = (value_0) => {
786
+ setFocusedIdx(Number(value_0));
787
+ };
788
+ $[11] = t6;
789
+ } else {
790
+ t6 = $[11];
791
+ }
792
+ const handleFocus = t6;
793
+ let t7;
794
+ if ($[12] !== focusedIdx) {
795
+ t7 = (input, _key) => {
796
+ if (input === "r") {
797
+ setRetry((prev_0) => {
798
+ const next_0 = new Set(prev_0);
799
+ if (next_0.has(focusedIdx)) {
800
+ next_0.delete(focusedIdx);
801
+ } else {
802
+ next_0.add(focusedIdx);
803
+ }
804
+ return next_0;
805
+ });
806
+ setApproved((prev_1) => {
807
+ if (prev_1.has(focusedIdx)) {
808
+ return prev_1;
809
+ }
810
+ const next_1 = new Set(prev_1);
811
+ next_1.add(focusedIdx);
812
+ return next_1;
813
+ });
814
+ }
815
+ };
816
+ $[12] = focusedIdx;
817
+ $[13] = t7;
818
+ } else {
819
+ t7 = $[13];
820
+ }
821
+ const t8 = denials.length > 0;
822
+ let t9;
823
+ if ($[14] !== t8) {
824
+ t9 = {
825
+ isActive: t8
826
+ };
827
+ $[14] = t8;
828
+ $[15] = t9;
829
+ } else {
830
+ t9 = $[15];
831
+ }
832
+ use_input_default(t7, t9);
833
+ if (denials.length === 0) {
834
+ let t102;
835
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
836
+ t102 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
837
+ dimColor: true,
838
+ children: "No recent denials. Commands denied by the auto mode classifier will appear here."
839
+ }, undefined, false, undefined, this);
840
+ $[16] = t102;
841
+ } else {
842
+ t102 = $[16];
843
+ }
844
+ return t102;
845
+ }
846
+ let t10;
847
+ if ($[17] !== approved || $[18] !== denials || $[19] !== retry) {
848
+ let t112;
849
+ if ($[21] !== approved || $[22] !== retry) {
850
+ t112 = (d, idx_0) => {
851
+ const isApproved = approved.has(idx_0);
852
+ const suffix = retry.has(idx_0) ? " (retry)" : "";
853
+ return {
854
+ label: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
855
+ children: [
856
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(StatusIcon, {
857
+ status: isApproved ? "success" : "error",
858
+ withSpace: true
859
+ }, undefined, false, undefined, this),
860
+ d.display,
861
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
862
+ dimColor: true,
863
+ children: suffix
864
+ }, undefined, false, undefined, this)
865
+ ]
866
+ }, undefined, true, undefined, this),
867
+ value: String(idx_0)
868
+ };
869
+ };
870
+ $[21] = approved;
871
+ $[22] = retry;
872
+ $[23] = t112;
873
+ } else {
874
+ t112 = $[23];
875
+ }
876
+ t10 = denials.map(t112);
877
+ $[17] = approved;
878
+ $[18] = denials;
879
+ $[19] = retry;
880
+ $[20] = t10;
881
+ } else {
882
+ t10 = $[20];
883
+ }
884
+ const options = t10;
885
+ let t11;
886
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
887
+ t11 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
888
+ children: "Commands recently denied by the auto mode classifier."
889
+ }, undefined, false, undefined, this);
890
+ $[24] = t11;
891
+ } else {
892
+ t11 = $[24];
893
+ }
894
+ const t12 = Math.min(10, options.length);
895
+ let t13;
896
+ if ($[25] !== focusHeader || $[26] !== headerFocused || $[27] !== options || $[28] !== t12) {
897
+ t13 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
898
+ flexDirection: "column",
899
+ children: [
900
+ t11,
901
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
902
+ marginTop: 1,
903
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Select, {
904
+ options,
905
+ onChange: handleSelect,
906
+ onFocus: handleFocus,
907
+ visibleOptionCount: t12,
908
+ isDisabled: headerFocused,
909
+ onUpFromFirstItem: focusHeader
910
+ }, undefined, false, undefined, this)
911
+ }, undefined, false, undefined, this)
912
+ ]
913
+ }, undefined, true, undefined, this);
914
+ $[25] = focusHeader;
915
+ $[26] = headerFocused;
916
+ $[27] = options;
917
+ $[28] = t12;
918
+ $[29] = t13;
919
+ } else {
920
+ t13 = $[29];
921
+ }
922
+ return t13;
923
+ }
924
+ function _temp3() {
925
+ return new Set;
926
+ }
927
+ function _temp2() {
928
+ return new Set;
929
+ }
930
+ function _temp4() {
931
+ return getAutoModeDenials();
932
+ }
933
+ var import_compiler_runtime4, import_react2, jsx_dev_runtime4;
934
+ var init_RecentDenialsTab = __esm(() => {
935
+ init_ink();
936
+ init_autoModeDenials();
937
+ init_select();
938
+ init_StatusIcon();
939
+ init_Tabs();
940
+ import_compiler_runtime4 = __toESM(require_compiler_runtime(), 1);
941
+ import_react2 = __toESM(require_react(), 1);
942
+ jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
943
+ });
944
+
945
+ // src/components/permissions/rules/RemoveWorkspaceDirectory.tsx
946
+ function RemoveWorkspaceDirectory(t0) {
947
+ const $ = import_compiler_runtime5.c(19);
948
+ const {
949
+ directoryPath,
950
+ onRemove,
951
+ onCancel,
952
+ permissionContext,
953
+ setPermissionContext
954
+ } = t0;
955
+ let t1;
956
+ if ($[0] !== directoryPath || $[1] !== onRemove || $[2] !== permissionContext || $[3] !== setPermissionContext) {
957
+ t1 = () => {
958
+ const updatedContext = applyPermissionUpdate(permissionContext, {
959
+ type: "removeDirectories",
960
+ directories: [directoryPath],
961
+ destination: "session"
962
+ });
963
+ setPermissionContext(updatedContext);
964
+ onRemove();
965
+ };
966
+ $[0] = directoryPath;
967
+ $[1] = onRemove;
968
+ $[2] = permissionContext;
969
+ $[3] = setPermissionContext;
970
+ $[4] = t1;
971
+ } else {
972
+ t1 = $[4];
973
+ }
974
+ const handleRemove = t1;
975
+ let t2;
976
+ if ($[5] !== handleRemove || $[6] !== onCancel) {
977
+ t2 = (value) => {
978
+ if (value === "yes") {
979
+ handleRemove();
980
+ } else {
981
+ onCancel();
982
+ }
983
+ };
984
+ $[5] = handleRemove;
985
+ $[6] = onCancel;
986
+ $[7] = t2;
987
+ } else {
988
+ t2 = $[7];
989
+ }
990
+ const handleSelect = t2;
991
+ let t3;
992
+ if ($[8] !== directoryPath) {
993
+ t3 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
994
+ marginX: 2,
995
+ flexDirection: "column",
996
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
997
+ bold: true,
998
+ children: directoryPath
999
+ }, undefined, false, undefined, this)
1000
+ }, undefined, false, undefined, this);
1001
+ $[8] = directoryPath;
1002
+ $[9] = t3;
1003
+ } else {
1004
+ t3 = $[9];
1005
+ }
1006
+ let t4;
1007
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
1008
+ t4 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1009
+ children: "Claude Code will no longer have access to files in this directory."
1010
+ }, undefined, false, undefined, this);
1011
+ $[10] = t4;
1012
+ } else {
1013
+ t4 = $[10];
1014
+ }
1015
+ let t5;
1016
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
1017
+ t5 = [{
1018
+ label: "Yes",
1019
+ value: "yes"
1020
+ }, {
1021
+ label: "No",
1022
+ value: "no"
1023
+ }];
1024
+ $[11] = t5;
1025
+ } else {
1026
+ t5 = $[11];
1027
+ }
1028
+ let t6;
1029
+ if ($[12] !== handleSelect || $[13] !== onCancel) {
1030
+ t6 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Select, {
1031
+ onChange: handleSelect,
1032
+ onCancel,
1033
+ options: t5
1034
+ }, undefined, false, undefined, this);
1035
+ $[12] = handleSelect;
1036
+ $[13] = onCancel;
1037
+ $[14] = t6;
1038
+ } else {
1039
+ t6 = $[14];
1040
+ }
1041
+ let t7;
1042
+ if ($[15] !== onCancel || $[16] !== t3 || $[17] !== t6) {
1043
+ t7 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Dialog, {
1044
+ title: "Remove directory from workspace?",
1045
+ onCancel,
1046
+ color: "error",
1047
+ children: [
1048
+ t3,
1049
+ t4,
1050
+ t6
1051
+ ]
1052
+ }, undefined, true, undefined, this);
1053
+ $[15] = onCancel;
1054
+ $[16] = t3;
1055
+ $[17] = t6;
1056
+ $[18] = t7;
1057
+ } else {
1058
+ t7 = $[18];
1059
+ }
1060
+ return t7;
1061
+ }
1062
+ var import_compiler_runtime5, jsx_dev_runtime5;
1063
+ var init_RemoveWorkspaceDirectory = __esm(() => {
1064
+ init_select();
1065
+ init_ink();
1066
+ init_PermissionUpdate();
1067
+ init_Dialog();
1068
+ import_compiler_runtime5 = __toESM(require_compiler_runtime(), 1);
1069
+ jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
1070
+ });
1071
+
1072
+ // src/components/permissions/rules/WorkspaceTab.tsx
1073
+ function WorkspaceTab(t0) {
1074
+ const $ = import_compiler_runtime6.c(23);
1075
+ const {
1076
+ onExit,
1077
+ toolPermissionContext,
1078
+ onRequestAddDirectory,
1079
+ onRequestRemoveDirectory,
1080
+ onHeaderFocusChange
1081
+ } = t0;
1082
+ const {
1083
+ headerFocused,
1084
+ focusHeader
1085
+ } = useTabHeaderFocus();
1086
+ let t1;
1087
+ let t2;
1088
+ if ($[0] !== headerFocused || $[1] !== onHeaderFocusChange) {
1089
+ t1 = () => {
1090
+ onHeaderFocusChange?.(headerFocused);
1091
+ };
1092
+ t2 = [headerFocused, onHeaderFocusChange];
1093
+ $[0] = headerFocused;
1094
+ $[1] = onHeaderFocusChange;
1095
+ $[2] = t1;
1096
+ $[3] = t2;
1097
+ } else {
1098
+ t1 = $[2];
1099
+ t2 = $[3];
1100
+ }
1101
+ import_react3.useEffect(t1, t2);
1102
+ let t3;
1103
+ if ($[4] !== toolPermissionContext.additionalWorkingDirectories) {
1104
+ t3 = Array.from(toolPermissionContext.additionalWorkingDirectories.keys()).map(_temp6);
1105
+ $[4] = toolPermissionContext.additionalWorkingDirectories;
1106
+ $[5] = t3;
1107
+ } else {
1108
+ t3 = $[5];
1109
+ }
1110
+ const additionalDirectories = t3;
1111
+ let t4;
1112
+ if ($[6] !== additionalDirectories || $[7] !== onRequestAddDirectory || $[8] !== onRequestRemoveDirectory) {
1113
+ t4 = (selectedValue) => {
1114
+ if (selectedValue === "add-directory") {
1115
+ onRequestAddDirectory();
1116
+ return;
1117
+ }
1118
+ const directory = additionalDirectories.find((d) => d.path === selectedValue);
1119
+ if (directory && directory.isDeletable) {
1120
+ onRequestRemoveDirectory(directory.path);
1121
+ }
1122
+ };
1123
+ $[6] = additionalDirectories;
1124
+ $[7] = onRequestAddDirectory;
1125
+ $[8] = onRequestRemoveDirectory;
1126
+ $[9] = t4;
1127
+ } else {
1128
+ t4 = $[9];
1129
+ }
1130
+ const handleDirectorySelect = t4;
1131
+ let t5;
1132
+ if ($[10] !== onExit) {
1133
+ t5 = () => onExit("Workspace dialog dismissed", {
1134
+ display: "system"
1135
+ });
1136
+ $[10] = onExit;
1137
+ $[11] = t5;
1138
+ } else {
1139
+ t5 = $[11];
1140
+ }
1141
+ const handleCancel = t5;
1142
+ let opts;
1143
+ if ($[12] !== additionalDirectories) {
1144
+ opts = additionalDirectories.map(_temp22);
1145
+ let t62;
1146
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
1147
+ t62 = {
1148
+ label: `Add directory${figures_default.ellipsis}`,
1149
+ value: "add-directory"
1150
+ };
1151
+ $[14] = t62;
1152
+ } else {
1153
+ t62 = $[14];
1154
+ }
1155
+ opts.push(t62);
1156
+ $[12] = additionalDirectories;
1157
+ $[13] = opts;
1158
+ } else {
1159
+ opts = $[13];
1160
+ }
1161
+ const options = opts;
1162
+ let t6;
1163
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
1164
+ t6 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1165
+ flexDirection: "row",
1166
+ marginTop: 1,
1167
+ marginLeft: 2,
1168
+ gap: 1,
1169
+ children: [
1170
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1171
+ children: `- ${getOriginalCwd()}`
1172
+ }, undefined, false, undefined, this),
1173
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1174
+ dimColor: true,
1175
+ children: "(Original working directory)"
1176
+ }, undefined, false, undefined, this)
1177
+ ]
1178
+ }, undefined, true, undefined, this);
1179
+ $[15] = t6;
1180
+ } else {
1181
+ t6 = $[15];
1182
+ }
1183
+ const t7 = Math.min(10, options.length);
1184
+ let t8;
1185
+ if ($[16] !== focusHeader || $[17] !== handleCancel || $[18] !== handleDirectorySelect || $[19] !== headerFocused || $[20] !== options || $[21] !== t7) {
1186
+ t8 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1187
+ flexDirection: "column",
1188
+ marginBottom: 1,
1189
+ children: [
1190
+ t6,
1191
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Select, {
1192
+ options,
1193
+ onChange: handleDirectorySelect,
1194
+ onCancel: handleCancel,
1195
+ visibleOptionCount: t7,
1196
+ onUpFromFirstItem: focusHeader,
1197
+ isDisabled: headerFocused
1198
+ }, undefined, false, undefined, this)
1199
+ ]
1200
+ }, undefined, true, undefined, this);
1201
+ $[16] = focusHeader;
1202
+ $[17] = handleCancel;
1203
+ $[18] = handleDirectorySelect;
1204
+ $[19] = headerFocused;
1205
+ $[20] = options;
1206
+ $[21] = t7;
1207
+ $[22] = t8;
1208
+ } else {
1209
+ t8 = $[22];
1210
+ }
1211
+ return t8;
1212
+ }
1213
+ function _temp22(dir) {
1214
+ return {
1215
+ label: dir.path,
1216
+ value: dir.path
1217
+ };
1218
+ }
1219
+ function _temp6(path) {
1220
+ return {
1221
+ path,
1222
+ isCurrent: false,
1223
+ isDeletable: true
1224
+ };
1225
+ }
1226
+ var import_compiler_runtime6, import_react3, jsx_dev_runtime6;
1227
+ var init_WorkspaceTab = __esm(() => {
1228
+ init_figures();
1229
+ init_state();
1230
+ init_select();
1231
+ init_ink();
1232
+ init_Tabs();
1233
+ import_compiler_runtime6 = __toESM(require_compiler_runtime(), 1);
1234
+ import_react3 = __toESM(require_react(), 1);
1235
+ jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
1236
+ });
1237
+
1238
+ // src/components/permissions/rules/PermissionRuleList.tsx
1239
+ function RuleSourceText(t0) {
1240
+ const $ = import_compiler_runtime7.c(4);
1241
+ const {
1242
+ rule
1243
+ } = t0;
1244
+ let t1;
1245
+ if ($[0] !== rule.source) {
1246
+ t1 = permissionRuleSourceDisplayString(rule.source);
1247
+ $[0] = rule.source;
1248
+ $[1] = t1;
1249
+ } else {
1250
+ t1 = $[1];
1251
+ }
1252
+ const t2 = `From ${t1}`;
1253
+ let t3;
1254
+ if ($[2] !== t2) {
1255
+ t3 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1256
+ dimColor: true,
1257
+ children: t2
1258
+ }, undefined, false, undefined, this);
1259
+ $[2] = t2;
1260
+ $[3] = t3;
1261
+ } else {
1262
+ t3 = $[3];
1263
+ }
1264
+ return t3;
1265
+ }
1266
+ function getRuleBehaviorLabel(ruleBehavior) {
1267
+ switch (ruleBehavior) {
1268
+ case "allow":
1269
+ return "allowed";
1270
+ case "deny":
1271
+ return "denied";
1272
+ case "ask":
1273
+ return "ask";
1274
+ }
1275
+ }
1276
+ function RuleDetails(t0) {
1277
+ const $ = import_compiler_runtime7.c(42);
1278
+ const {
1279
+ rule,
1280
+ onDelete,
1281
+ onCancel
1282
+ } = t0;
1283
+ const exitState = useExitOnCtrlCDWithKeybindings();
1284
+ let t1;
1285
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1286
+ t1 = {
1287
+ context: "Confirmation"
1288
+ };
1289
+ $[0] = t1;
1290
+ } else {
1291
+ t1 = $[0];
1292
+ }
1293
+ useKeybinding("confirm:no", onCancel, t1);
1294
+ let t2;
1295
+ if ($[1] !== rule.ruleValue) {
1296
+ t2 = permissionRuleValueToString(rule.ruleValue);
1297
+ $[1] = rule.ruleValue;
1298
+ $[2] = t2;
1299
+ } else {
1300
+ t2 = $[2];
1301
+ }
1302
+ let t3;
1303
+ if ($[3] !== t2) {
1304
+ t3 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1305
+ bold: true,
1306
+ children: t2
1307
+ }, undefined, false, undefined, this);
1308
+ $[3] = t2;
1309
+ $[4] = t3;
1310
+ } else {
1311
+ t3 = $[4];
1312
+ }
1313
+ let t4;
1314
+ if ($[5] !== rule.ruleValue) {
1315
+ t4 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRuleDescription, {
1316
+ ruleValue: rule.ruleValue
1317
+ }, undefined, false, undefined, this);
1318
+ $[5] = rule.ruleValue;
1319
+ $[6] = t4;
1320
+ } else {
1321
+ t4 = $[6];
1322
+ }
1323
+ let t5;
1324
+ if ($[7] !== rule) {
1325
+ t5 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RuleSourceText, {
1326
+ rule
1327
+ }, undefined, false, undefined, this);
1328
+ $[7] = rule;
1329
+ $[8] = t5;
1330
+ } else {
1331
+ t5 = $[8];
1332
+ }
1333
+ let t6;
1334
+ if ($[9] !== t3 || $[10] !== t4 || $[11] !== t5) {
1335
+ t6 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1336
+ flexDirection: "column",
1337
+ marginX: 2,
1338
+ children: [
1339
+ t3,
1340
+ t4,
1341
+ t5
1342
+ ]
1343
+ }, undefined, true, undefined, this);
1344
+ $[9] = t3;
1345
+ $[10] = t4;
1346
+ $[11] = t5;
1347
+ $[12] = t6;
1348
+ } else {
1349
+ t6 = $[12];
1350
+ }
1351
+ const ruleDescription = t6;
1352
+ let t7;
1353
+ if ($[13] !== exitState.keyName || $[14] !== exitState.pending) {
1354
+ t7 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1355
+ marginLeft: 3,
1356
+ children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1357
+ dimColor: true,
1358
+ children: [
1359
+ "Press ",
1360
+ exitState.keyName,
1361
+ " again to exit"
1362
+ ]
1363
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1364
+ dimColor: true,
1365
+ children: "Esc to cancel"
1366
+ }, undefined, false, undefined, this)
1367
+ }, undefined, false, undefined, this);
1368
+ $[13] = exitState.keyName;
1369
+ $[14] = exitState.pending;
1370
+ $[15] = t7;
1371
+ } else {
1372
+ t7 = $[15];
1373
+ }
1374
+ const footer = t7;
1375
+ if (rule.source === "policySettings") {
1376
+ let t82;
1377
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
1378
+ t82 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1379
+ bold: true,
1380
+ color: "permission",
1381
+ children: "Rule details"
1382
+ }, undefined, false, undefined, this);
1383
+ $[16] = t82;
1384
+ } else {
1385
+ t82 = $[16];
1386
+ }
1387
+ let t92;
1388
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
1389
+ t92 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1390
+ italic: true,
1391
+ children: [
1392
+ "This rule is configured by managed settings and cannot be modified.",
1393
+ `
1394
+ `,
1395
+ "Contact your system administrator for more information."
1396
+ ]
1397
+ }, undefined, true, undefined, this);
1398
+ $[17] = t92;
1399
+ } else {
1400
+ t92 = $[17];
1401
+ }
1402
+ let t102;
1403
+ if ($[18] !== ruleDescription) {
1404
+ t102 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1405
+ flexDirection: "column",
1406
+ gap: 1,
1407
+ borderStyle: "round",
1408
+ paddingLeft: 1,
1409
+ paddingRight: 1,
1410
+ borderColor: "permission",
1411
+ children: [
1412
+ t82,
1413
+ ruleDescription,
1414
+ t92
1415
+ ]
1416
+ }, undefined, true, undefined, this);
1417
+ $[18] = ruleDescription;
1418
+ $[19] = t102;
1419
+ } else {
1420
+ t102 = $[19];
1421
+ }
1422
+ let t112;
1423
+ if ($[20] !== footer || $[21] !== t102) {
1424
+ t112 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
1425
+ children: [
1426
+ t102,
1427
+ footer
1428
+ ]
1429
+ }, undefined, true, undefined, this);
1430
+ $[20] = footer;
1431
+ $[21] = t102;
1432
+ $[22] = t112;
1433
+ } else {
1434
+ t112 = $[22];
1435
+ }
1436
+ return t112;
1437
+ }
1438
+ let t8;
1439
+ if ($[23] !== rule.ruleBehavior) {
1440
+ t8 = getRuleBehaviorLabel(rule.ruleBehavior);
1441
+ $[23] = rule.ruleBehavior;
1442
+ $[24] = t8;
1443
+ } else {
1444
+ t8 = $[24];
1445
+ }
1446
+ let t9;
1447
+ if ($[25] !== t8) {
1448
+ t9 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1449
+ bold: true,
1450
+ color: "error",
1451
+ children: [
1452
+ "Delete ",
1453
+ t8,
1454
+ " tool?"
1455
+ ]
1456
+ }, undefined, true, undefined, this);
1457
+ $[25] = t8;
1458
+ $[26] = t9;
1459
+ } else {
1460
+ t9 = $[26];
1461
+ }
1462
+ let t10;
1463
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
1464
+ t10 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1465
+ children: "Are you sure you want to delete this permission rule?"
1466
+ }, undefined, false, undefined, this);
1467
+ $[27] = t10;
1468
+ } else {
1469
+ t10 = $[27];
1470
+ }
1471
+ let t11;
1472
+ if ($[28] !== onCancel || $[29] !== onDelete) {
1473
+ t11 = (_) => _ === "yes" ? onDelete() : onCancel();
1474
+ $[28] = onCancel;
1475
+ $[29] = onDelete;
1476
+ $[30] = t11;
1477
+ } else {
1478
+ t11 = $[30];
1479
+ }
1480
+ let t12;
1481
+ if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
1482
+ t12 = [{
1483
+ label: "Yes",
1484
+ value: "yes"
1485
+ }, {
1486
+ label: "No",
1487
+ value: "no"
1488
+ }];
1489
+ $[31] = t12;
1490
+ } else {
1491
+ t12 = $[31];
1492
+ }
1493
+ let t13;
1494
+ if ($[32] !== onCancel || $[33] !== t11) {
1495
+ t13 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Select, {
1496
+ onChange: t11,
1497
+ onCancel,
1498
+ options: t12
1499
+ }, undefined, false, undefined, this);
1500
+ $[32] = onCancel;
1501
+ $[33] = t11;
1502
+ $[34] = t13;
1503
+ } else {
1504
+ t13 = $[34];
1505
+ }
1506
+ let t14;
1507
+ if ($[35] !== ruleDescription || $[36] !== t13 || $[37] !== t9) {
1508
+ t14 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1509
+ flexDirection: "column",
1510
+ gap: 1,
1511
+ borderStyle: "round",
1512
+ paddingLeft: 1,
1513
+ paddingRight: 1,
1514
+ borderColor: "error",
1515
+ children: [
1516
+ t9,
1517
+ ruleDescription,
1518
+ t10,
1519
+ t13
1520
+ ]
1521
+ }, undefined, true, undefined, this);
1522
+ $[35] = ruleDescription;
1523
+ $[36] = t13;
1524
+ $[37] = t9;
1525
+ $[38] = t14;
1526
+ } else {
1527
+ t14 = $[38];
1528
+ }
1529
+ let t15;
1530
+ if ($[39] !== footer || $[40] !== t14) {
1531
+ t15 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
1532
+ children: [
1533
+ t14,
1534
+ footer
1535
+ ]
1536
+ }, undefined, true, undefined, this);
1537
+ $[39] = footer;
1538
+ $[40] = t14;
1539
+ $[41] = t15;
1540
+ } else {
1541
+ t15 = $[41];
1542
+ }
1543
+ return t15;
1544
+ }
1545
+ function RulesTabContent(props) {
1546
+ const $ = import_compiler_runtime7.c(26);
1547
+ const {
1548
+ options,
1549
+ searchQuery,
1550
+ isSearchMode,
1551
+ isFocused,
1552
+ onSelect,
1553
+ onCancel,
1554
+ lastFocusedRuleKey,
1555
+ cursorOffset,
1556
+ onHeaderFocusChange
1557
+ } = props;
1558
+ const tabWidth = useTabsWidth();
1559
+ const {
1560
+ headerFocused,
1561
+ focusHeader,
1562
+ blurHeader
1563
+ } = useTabHeaderFocus();
1564
+ let t0;
1565
+ let t1;
1566
+ if ($[0] !== blurHeader || $[1] !== headerFocused || $[2] !== isSearchMode) {
1567
+ t0 = () => {
1568
+ if (isSearchMode && headerFocused) {
1569
+ blurHeader();
1570
+ }
1571
+ };
1572
+ t1 = [isSearchMode, headerFocused, blurHeader];
1573
+ $[0] = blurHeader;
1574
+ $[1] = headerFocused;
1575
+ $[2] = isSearchMode;
1576
+ $[3] = t0;
1577
+ $[4] = t1;
1578
+ } else {
1579
+ t0 = $[3];
1580
+ t1 = $[4];
1581
+ }
1582
+ import_react4.useEffect(t0, t1);
1583
+ let t2;
1584
+ let t3;
1585
+ if ($[5] !== headerFocused || $[6] !== onHeaderFocusChange) {
1586
+ t2 = () => {
1587
+ onHeaderFocusChange?.(headerFocused);
1588
+ };
1589
+ t3 = [headerFocused, onHeaderFocusChange];
1590
+ $[5] = headerFocused;
1591
+ $[6] = onHeaderFocusChange;
1592
+ $[7] = t2;
1593
+ $[8] = t3;
1594
+ } else {
1595
+ t2 = $[7];
1596
+ t3 = $[8];
1597
+ }
1598
+ import_react4.useEffect(t2, t3);
1599
+ const t4 = isSearchMode && !headerFocused;
1600
+ let t5;
1601
+ if ($[9] !== cursorOffset || $[10] !== isFocused || $[11] !== searchQuery || $[12] !== t4 || $[13] !== tabWidth) {
1602
+ t5 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1603
+ marginBottom: 1,
1604
+ flexDirection: "column",
1605
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(SearchBox, {
1606
+ query: searchQuery,
1607
+ isFocused: t4,
1608
+ isTerminalFocused: isFocused,
1609
+ width: tabWidth,
1610
+ cursorOffset
1611
+ }, undefined, false, undefined, this)
1612
+ }, undefined, false, undefined, this);
1613
+ $[9] = cursorOffset;
1614
+ $[10] = isFocused;
1615
+ $[11] = searchQuery;
1616
+ $[12] = t4;
1617
+ $[13] = tabWidth;
1618
+ $[14] = t5;
1619
+ } else {
1620
+ t5 = $[14];
1621
+ }
1622
+ const t6 = Math.min(10, options.length);
1623
+ const t7 = isSearchMode || headerFocused;
1624
+ let t8;
1625
+ if ($[15] !== focusHeader || $[16] !== lastFocusedRuleKey || $[17] !== onCancel || $[18] !== onSelect || $[19] !== options || $[20] !== t6 || $[21] !== t7) {
1626
+ t8 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Select, {
1627
+ options,
1628
+ onChange: onSelect,
1629
+ onCancel,
1630
+ visibleOptionCount: t6,
1631
+ isDisabled: t7,
1632
+ defaultFocusValue: lastFocusedRuleKey,
1633
+ onUpFromFirstItem: focusHeader
1634
+ }, undefined, false, undefined, this);
1635
+ $[15] = focusHeader;
1636
+ $[16] = lastFocusedRuleKey;
1637
+ $[17] = onCancel;
1638
+ $[18] = onSelect;
1639
+ $[19] = options;
1640
+ $[20] = t6;
1641
+ $[21] = t7;
1642
+ $[22] = t8;
1643
+ } else {
1644
+ t8 = $[22];
1645
+ }
1646
+ let t9;
1647
+ if ($[23] !== t5 || $[24] !== t8) {
1648
+ t9 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1649
+ flexDirection: "column",
1650
+ children: [
1651
+ t5,
1652
+ t8
1653
+ ]
1654
+ }, undefined, true, undefined, this);
1655
+ $[23] = t5;
1656
+ $[24] = t8;
1657
+ $[25] = t9;
1658
+ } else {
1659
+ t9 = $[25];
1660
+ }
1661
+ return t9;
1662
+ }
1663
+ function PermissionRulesTab(t0) {
1664
+ const $ = import_compiler_runtime7.c(27);
1665
+ let T0;
1666
+ let T1;
1667
+ let handleToolSelect;
1668
+ let rulesProps;
1669
+ let t1;
1670
+ let t2;
1671
+ let t3;
1672
+ let t4;
1673
+ let tab;
1674
+ if ($[0] !== t0) {
1675
+ const {
1676
+ tab: t52,
1677
+ getRulesOptions,
1678
+ handleToolSelect: t62,
1679
+ ...t72
1680
+ } = t0;
1681
+ tab = t52;
1682
+ handleToolSelect = t62;
1683
+ rulesProps = t72;
1684
+ T1 = ThemedBox_default;
1685
+ t2 = "column";
1686
+ t3 = tab === "allow" ? 0 : undefined;
1687
+ let t8;
1688
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
1689
+ t8 = {
1690
+ allow: "Claude Code won't ask before using allowed tools.",
1691
+ ask: "Claude Code will always ask for confirmation before using these tools.",
1692
+ deny: "Claude Code will always reject requests to use denied tools."
1693
+ };
1694
+ $[10] = t8;
1695
+ } else {
1696
+ t8 = $[10];
1697
+ }
1698
+ const t9 = t8[tab];
1699
+ if ($[11] !== t9) {
1700
+ t4 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1701
+ children: t9
1702
+ }, undefined, false, undefined, this);
1703
+ $[11] = t9;
1704
+ $[12] = t4;
1705
+ } else {
1706
+ t4 = $[12];
1707
+ }
1708
+ T0 = RulesTabContent;
1709
+ t1 = getRulesOptions(tab, rulesProps.searchQuery);
1710
+ $[0] = t0;
1711
+ $[1] = T0;
1712
+ $[2] = T1;
1713
+ $[3] = handleToolSelect;
1714
+ $[4] = rulesProps;
1715
+ $[5] = t1;
1716
+ $[6] = t2;
1717
+ $[7] = t3;
1718
+ $[8] = t4;
1719
+ $[9] = tab;
1720
+ } else {
1721
+ T0 = $[1];
1722
+ T1 = $[2];
1723
+ handleToolSelect = $[3];
1724
+ rulesProps = $[4];
1725
+ t1 = $[5];
1726
+ t2 = $[6];
1727
+ t3 = $[7];
1728
+ t4 = $[8];
1729
+ tab = $[9];
1730
+ }
1731
+ let t5;
1732
+ if ($[13] !== handleToolSelect || $[14] !== tab) {
1733
+ t5 = (v) => handleToolSelect(v, tab);
1734
+ $[13] = handleToolSelect;
1735
+ $[14] = tab;
1736
+ $[15] = t5;
1737
+ } else {
1738
+ t5 = $[15];
1739
+ }
1740
+ let t6;
1741
+ if ($[16] !== T0 || $[17] !== rulesProps || $[18] !== t1.options || $[19] !== t5) {
1742
+ t6 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(T0, {
1743
+ options: t1.options,
1744
+ onSelect: t5,
1745
+ ...rulesProps
1746
+ }, undefined, false, undefined, this);
1747
+ $[16] = T0;
1748
+ $[17] = rulesProps;
1749
+ $[18] = t1.options;
1750
+ $[19] = t5;
1751
+ $[20] = t6;
1752
+ } else {
1753
+ t6 = $[20];
1754
+ }
1755
+ let t7;
1756
+ if ($[21] !== T1 || $[22] !== t2 || $[23] !== t3 || $[24] !== t4 || $[25] !== t6) {
1757
+ t7 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(T1, {
1758
+ flexDirection: t2,
1759
+ flexShrink: t3,
1760
+ children: [
1761
+ t4,
1762
+ t6
1763
+ ]
1764
+ }, undefined, true, undefined, this);
1765
+ $[21] = T1;
1766
+ $[22] = t2;
1767
+ $[23] = t3;
1768
+ $[24] = t4;
1769
+ $[25] = t6;
1770
+ $[26] = t7;
1771
+ } else {
1772
+ t7 = $[26];
1773
+ }
1774
+ return t7;
1775
+ }
1776
+ function PermissionRuleList(t0) {
1777
+ const $ = import_compiler_runtime7.c(113);
1778
+ const {
1779
+ onExit,
1780
+ initialTab,
1781
+ onRetryDenials
1782
+ } = t0;
1783
+ let t1;
1784
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1785
+ t1 = getAutoModeDenials();
1786
+ $[0] = t1;
1787
+ } else {
1788
+ t1 = $[0];
1789
+ }
1790
+ const hasDenials = t1.length > 0;
1791
+ const defaultTab = initialTab ?? (hasDenials ? "recent" : "allow");
1792
+ let t2;
1793
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1794
+ t2 = [];
1795
+ $[1] = t2;
1796
+ } else {
1797
+ t2 = $[1];
1798
+ }
1799
+ const [changes, setChanges] = import_react4.useState(t2);
1800
+ const toolPermissionContext = useAppState(_temp7);
1801
+ const setAppState = useSetAppState();
1802
+ const isTerminalFocused = useTerminalFocus();
1803
+ let t3;
1804
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1805
+ t3 = {
1806
+ approved: new Set,
1807
+ retry: new Set,
1808
+ denials: []
1809
+ };
1810
+ $[2] = t3;
1811
+ } else {
1812
+ t3 = $[2];
1813
+ }
1814
+ const denialStateRef = import_react4.useRef(t3);
1815
+ let t4;
1816
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
1817
+ t4 = (s_0) => {
1818
+ denialStateRef.current = s_0;
1819
+ };
1820
+ $[3] = t4;
1821
+ } else {
1822
+ t4 = $[3];
1823
+ }
1824
+ const handleDenialStateChange = t4;
1825
+ const [selectedRule, setSelectedRule] = import_react4.useState();
1826
+ const [lastFocusedRuleKey, setLastFocusedRuleKey] = import_react4.useState();
1827
+ const [addingRuleToTab, setAddingRuleToTab] = import_react4.useState(null);
1828
+ const [validatedRule, setValidatedRule] = import_react4.useState(null);
1829
+ const [isAddingWorkspaceDirectory, setIsAddingWorkspaceDirectory] = import_react4.useState(false);
1830
+ const [removingDirectory, setRemovingDirectory] = import_react4.useState(null);
1831
+ const [isSearchMode, setIsSearchMode] = import_react4.useState(false);
1832
+ const [headerFocused, setHeaderFocused] = import_react4.useState(true);
1833
+ let t5;
1834
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
1835
+ t5 = (focused) => {
1836
+ setHeaderFocused(focused);
1837
+ };
1838
+ $[4] = t5;
1839
+ } else {
1840
+ t5 = $[4];
1841
+ }
1842
+ const handleHeaderFocusChange = t5;
1843
+ let map;
1844
+ if ($[5] !== toolPermissionContext) {
1845
+ map = new Map;
1846
+ getAllowRules(toolPermissionContext).forEach((rule) => {
1847
+ map.set(jsonStringify(rule), rule);
1848
+ });
1849
+ $[5] = toolPermissionContext;
1850
+ $[6] = map;
1851
+ } else {
1852
+ map = $[6];
1853
+ }
1854
+ const allowRulesByKey = map;
1855
+ let map_0;
1856
+ if ($[7] !== toolPermissionContext) {
1857
+ map_0 = new Map;
1858
+ getDenyRules(toolPermissionContext).forEach((rule_0) => {
1859
+ map_0.set(jsonStringify(rule_0), rule_0);
1860
+ });
1861
+ $[7] = toolPermissionContext;
1862
+ $[8] = map_0;
1863
+ } else {
1864
+ map_0 = $[8];
1865
+ }
1866
+ const denyRulesByKey = map_0;
1867
+ let map_1;
1868
+ if ($[9] !== toolPermissionContext) {
1869
+ map_1 = new Map;
1870
+ getAskRules(toolPermissionContext).forEach((rule_1) => {
1871
+ map_1.set(jsonStringify(rule_1), rule_1);
1872
+ });
1873
+ $[9] = toolPermissionContext;
1874
+ $[10] = map_1;
1875
+ } else {
1876
+ map_1 = $[10];
1877
+ }
1878
+ const askRulesByKey = map_1;
1879
+ let t6;
1880
+ if ($[11] !== allowRulesByKey || $[12] !== askRulesByKey || $[13] !== denyRulesByKey) {
1881
+ t6 = (tab, t72) => {
1882
+ const query = t72 === undefined ? "" : t72;
1883
+ const rulesByKey = (() => {
1884
+ switch (tab) {
1885
+ case "allow": {
1886
+ return allowRulesByKey;
1887
+ }
1888
+ case "deny": {
1889
+ return denyRulesByKey;
1890
+ }
1891
+ case "ask": {
1892
+ return askRulesByKey;
1893
+ }
1894
+ case "workspace":
1895
+ case "recent": {
1896
+ return new Map;
1897
+ }
1898
+ }
1899
+ })();
1900
+ const options = [];
1901
+ if (tab !== "workspace" && tab !== "recent" && !query) {
1902
+ options.push({
1903
+ label: `Add a new rule${figures_default.ellipsis}`,
1904
+ value: "add-new-rule"
1905
+ });
1906
+ }
1907
+ const sortedRuleKeys = Array.from(rulesByKey.keys()).sort((a, b) => {
1908
+ const ruleA = rulesByKey.get(a);
1909
+ const ruleB = rulesByKey.get(b);
1910
+ if (ruleA && ruleB) {
1911
+ const ruleAString = permissionRuleValueToString(ruleA.ruleValue).toLowerCase();
1912
+ const ruleBString = permissionRuleValueToString(ruleB.ruleValue).toLowerCase();
1913
+ return ruleAString.localeCompare(ruleBString);
1914
+ }
1915
+ return 0;
1916
+ });
1917
+ const lowerQuery = query.toLowerCase();
1918
+ for (const ruleKey of sortedRuleKeys) {
1919
+ const rule_2 = rulesByKey.get(ruleKey);
1920
+ if (rule_2) {
1921
+ const ruleString = permissionRuleValueToString(rule_2.ruleValue);
1922
+ if (query && !ruleString.toLowerCase().includes(lowerQuery)) {
1923
+ continue;
1924
+ }
1925
+ options.push({
1926
+ label: ruleString,
1927
+ value: ruleKey
1928
+ });
1929
+ }
1930
+ }
1931
+ return {
1932
+ options,
1933
+ rulesByKey
1934
+ };
1935
+ };
1936
+ $[11] = allowRulesByKey;
1937
+ $[12] = askRulesByKey;
1938
+ $[13] = denyRulesByKey;
1939
+ $[14] = t6;
1940
+ } else {
1941
+ t6 = $[14];
1942
+ }
1943
+ const getRulesOptions = t6;
1944
+ const exitState = useExitOnCtrlCDWithKeybindings();
1945
+ const isSearchModeActive = !selectedRule && !addingRuleToTab && !validatedRule && !isAddingWorkspaceDirectory && !removingDirectory;
1946
+ const t7 = isSearchModeActive && isSearchMode;
1947
+ let t8;
1948
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
1949
+ t8 = () => {
1950
+ setIsSearchMode(false);
1951
+ };
1952
+ $[15] = t8;
1953
+ } else {
1954
+ t8 = $[15];
1955
+ }
1956
+ let t9;
1957
+ if ($[16] !== t7) {
1958
+ t9 = {
1959
+ isActive: t7,
1960
+ onExit: t8
1961
+ };
1962
+ $[16] = t7;
1963
+ $[17] = t9;
1964
+ } else {
1965
+ t9 = $[17];
1966
+ }
1967
+ const {
1968
+ query: searchQuery,
1969
+ setQuery: setSearchQuery,
1970
+ cursorOffset: searchCursorOffset
1971
+ } = useSearchInput(t9);
1972
+ let t10;
1973
+ if ($[18] !== isSearchMode || $[19] !== isSearchModeActive || $[20] !== setSearchQuery) {
1974
+ t10 = (e) => {
1975
+ if (!isSearchModeActive) {
1976
+ return;
1977
+ }
1978
+ if (isSearchMode) {
1979
+ return;
1980
+ }
1981
+ if (e.ctrl || e.meta) {
1982
+ return;
1983
+ }
1984
+ if (e.key === "/") {
1985
+ e.preventDefault();
1986
+ setIsSearchMode(true);
1987
+ setSearchQuery("");
1988
+ } else {
1989
+ if (e.key.length === 1 && e.key !== "j" && e.key !== "k" && e.key !== "m" && e.key !== "i" && e.key !== "r" && e.key !== " ") {
1990
+ e.preventDefault();
1991
+ setIsSearchMode(true);
1992
+ setSearchQuery(e.key);
1993
+ }
1994
+ }
1995
+ };
1996
+ $[18] = isSearchMode;
1997
+ $[19] = isSearchModeActive;
1998
+ $[20] = setSearchQuery;
1999
+ $[21] = t10;
2000
+ } else {
2001
+ t10 = $[21];
2002
+ }
2003
+ const handleKeyDown = t10;
2004
+ let t11;
2005
+ if ($[22] !== getRulesOptions) {
2006
+ t11 = (selectedValue, tab_0) => {
2007
+ const {
2008
+ rulesByKey: rulesByKey_0
2009
+ } = getRulesOptions(tab_0);
2010
+ if (selectedValue === "add-new-rule") {
2011
+ setAddingRuleToTab(tab_0);
2012
+ return;
2013
+ } else {
2014
+ setSelectedRule(rulesByKey_0.get(selectedValue));
2015
+ return;
2016
+ }
2017
+ };
2018
+ $[22] = getRulesOptions;
2019
+ $[23] = t11;
2020
+ } else {
2021
+ t11 = $[23];
2022
+ }
2023
+ const handleToolSelect = t11;
2024
+ let t12;
2025
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
2026
+ t12 = () => {
2027
+ setAddingRuleToTab(null);
2028
+ };
2029
+ $[24] = t12;
2030
+ } else {
2031
+ t12 = $[24];
2032
+ }
2033
+ const handleRuleInputCancel = t12;
2034
+ let t13;
2035
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
2036
+ t13 = (ruleValue, ruleBehavior) => {
2037
+ setValidatedRule({
2038
+ ruleValue,
2039
+ ruleBehavior
2040
+ });
2041
+ setAddingRuleToTab(null);
2042
+ };
2043
+ $[25] = t13;
2044
+ } else {
2045
+ t13 = $[25];
2046
+ }
2047
+ const handleRuleInputSubmit = t13;
2048
+ let t14;
2049
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
2050
+ t14 = (rules, unreachable) => {
2051
+ setValidatedRule(null);
2052
+ for (const rule_3 of rules) {
2053
+ setChanges((prev) => [...prev, `Added ${rule_3.ruleBehavior} rule ${source_default.bold(permissionRuleValueToString(rule_3.ruleValue))}`]);
2054
+ }
2055
+ if (unreachable && unreachable.length > 0) {
2056
+ for (const u of unreachable) {
2057
+ const severity = u.shadowType === "deny" ? "blocked" : "shadowed";
2058
+ 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}`)]);
2059
+ }
2060
+ }
2061
+ };
2062
+ $[26] = t14;
2063
+ } else {
2064
+ t14 = $[26];
2065
+ }
2066
+ const handleAddRulesSuccess = t14;
2067
+ let t15;
2068
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
2069
+ t15 = () => {
2070
+ setValidatedRule(null);
2071
+ };
2072
+ $[27] = t15;
2073
+ } else {
2074
+ t15 = $[27];
2075
+ }
2076
+ const handleAddRuleCancel = t15;
2077
+ let t16;
2078
+ if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
2079
+ t16 = () => setIsAddingWorkspaceDirectory(true);
2080
+ $[28] = t16;
2081
+ } else {
2082
+ t16 = $[28];
2083
+ }
2084
+ const handleRequestAddDirectory = t16;
2085
+ let t17;
2086
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
2087
+ t17 = (path) => setRemovingDirectory(path);
2088
+ $[29] = t17;
2089
+ } else {
2090
+ t17 = $[29];
2091
+ }
2092
+ const handleRequestRemoveDirectory = t17;
2093
+ let t18;
2094
+ if ($[30] !== changes || $[31] !== onExit || $[32] !== onRetryDenials) {
2095
+ t18 = () => {
2096
+ const s_1 = denialStateRef.current;
2097
+ const denialsFor = (set) => Array.from(set).map((idx) => s_1.denials[idx]).filter(_temp23);
2098
+ const retryDenials = denialsFor(s_1.retry);
2099
+ if (retryDenials.length > 0) {
2100
+ const commands = retryDenials.map(_temp32);
2101
+ onRetryDenials?.(commands);
2102
+ onExit(undefined, {
2103
+ shouldQuery: true,
2104
+ metaMessages: [`Permission granted for: ${commands.join(", ")}. You may now retry ${commands.length === 1 ? "this command" : "these commands"} if you would like.`]
2105
+ });
2106
+ return;
2107
+ }
2108
+ const approvedDenials = denialsFor(s_1.approved);
2109
+ if (approvedDenials.length > 0 || changes.length > 0) {
2110
+ const approvedMsg = approvedDenials.length > 0 ? [`Approved ${approvedDenials.map(_temp42).join(", ")}`] : [];
2111
+ onExit([...approvedMsg, ...changes].join(`
2112
+ `));
2113
+ } else {
2114
+ onExit("Permissions dialog dismissed", {
2115
+ display: "system"
2116
+ });
2117
+ }
2118
+ };
2119
+ $[30] = changes;
2120
+ $[31] = onExit;
2121
+ $[32] = onRetryDenials;
2122
+ $[33] = t18;
2123
+ } else {
2124
+ t18 = $[33];
2125
+ }
2126
+ const handleRulesCancel = t18;
2127
+ const t19 = isSearchModeActive && !isSearchMode;
2128
+ let t20;
2129
+ if ($[34] !== t19) {
2130
+ t20 = {
2131
+ context: "Settings",
2132
+ isActive: t19
2133
+ };
2134
+ $[34] = t19;
2135
+ $[35] = t20;
2136
+ } else {
2137
+ t20 = $[35];
2138
+ }
2139
+ useKeybinding("confirm:no", handleRulesCancel, t20);
2140
+ let t21;
2141
+ if ($[36] !== getRulesOptions || $[37] !== selectedRule || $[38] !== setAppState || $[39] !== toolPermissionContext) {
2142
+ t21 = () => {
2143
+ if (!selectedRule) {
2144
+ return;
2145
+ }
2146
+ const {
2147
+ options: options_0
2148
+ } = getRulesOptions(selectedRule.ruleBehavior);
2149
+ const selectedKey = jsonStringify(selectedRule);
2150
+ const ruleKeys = options_0.filter(_temp5).map(_temp62);
2151
+ const currentIndex = ruleKeys.indexOf(selectedKey);
2152
+ let nextFocusKey;
2153
+ if (currentIndex !== -1) {
2154
+ if (currentIndex < ruleKeys.length - 1) {
2155
+ nextFocusKey = ruleKeys[currentIndex + 1];
2156
+ } else {
2157
+ if (currentIndex > 0) {
2158
+ nextFocusKey = ruleKeys[currentIndex - 1];
2159
+ }
2160
+ }
2161
+ }
2162
+ setLastFocusedRuleKey(nextFocusKey);
2163
+ deletePermissionRule({
2164
+ rule: selectedRule,
2165
+ initialContext: toolPermissionContext,
2166
+ setToolPermissionContext(toolPermissionContext_0) {
2167
+ setAppState((prev_1) => ({
2168
+ ...prev_1,
2169
+ toolPermissionContext: toolPermissionContext_0
2170
+ }));
2171
+ }
2172
+ });
2173
+ setChanges((prev_2) => [...prev_2, `Deleted ${selectedRule.ruleBehavior} rule ${source_default.bold(permissionRuleValueToString(selectedRule.ruleValue))}`]);
2174
+ setSelectedRule(undefined);
2175
+ };
2176
+ $[36] = getRulesOptions;
2177
+ $[37] = selectedRule;
2178
+ $[38] = setAppState;
2179
+ $[39] = toolPermissionContext;
2180
+ $[40] = t21;
2181
+ } else {
2182
+ t21 = $[40];
2183
+ }
2184
+ const handleDeleteRule = t21;
2185
+ if (selectedRule) {
2186
+ let t222;
2187
+ if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
2188
+ t222 = () => setSelectedRule(undefined);
2189
+ $[41] = t222;
2190
+ } else {
2191
+ t222 = $[41];
2192
+ }
2193
+ let t232;
2194
+ if ($[42] !== handleDeleteRule || $[43] !== selectedRule) {
2195
+ t232 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RuleDetails, {
2196
+ rule: selectedRule,
2197
+ onDelete: handleDeleteRule,
2198
+ onCancel: t222
2199
+ }, undefined, false, undefined, this);
2200
+ $[42] = handleDeleteRule;
2201
+ $[43] = selectedRule;
2202
+ $[44] = t232;
2203
+ } else {
2204
+ t232 = $[44];
2205
+ }
2206
+ return t232;
2207
+ }
2208
+ if (addingRuleToTab && addingRuleToTab !== "workspace" && addingRuleToTab !== "recent") {
2209
+ let t222;
2210
+ if ($[45] !== addingRuleToTab) {
2211
+ t222 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRuleInput, {
2212
+ onCancel: handleRuleInputCancel,
2213
+ onSubmit: handleRuleInputSubmit,
2214
+ ruleBehavior: addingRuleToTab
2215
+ }, undefined, false, undefined, this);
2216
+ $[45] = addingRuleToTab;
2217
+ $[46] = t222;
2218
+ } else {
2219
+ t222 = $[46];
2220
+ }
2221
+ return t222;
2222
+ }
2223
+ if (validatedRule) {
2224
+ let t222;
2225
+ if ($[47] !== validatedRule.ruleValue) {
2226
+ t222 = [validatedRule.ruleValue];
2227
+ $[47] = validatedRule.ruleValue;
2228
+ $[48] = t222;
2229
+ } else {
2230
+ t222 = $[48];
2231
+ }
2232
+ let t232;
2233
+ if ($[49] !== setAppState) {
2234
+ t232 = (toolPermissionContext_1) => {
2235
+ setAppState((prev_3) => ({
2236
+ ...prev_3,
2237
+ toolPermissionContext: toolPermissionContext_1
2238
+ }));
2239
+ };
2240
+ $[49] = setAppState;
2241
+ $[50] = t232;
2242
+ } else {
2243
+ t232 = $[50];
2244
+ }
2245
+ let t242;
2246
+ if ($[51] !== t222 || $[52] !== t232 || $[53] !== toolPermissionContext || $[54] !== validatedRule.ruleBehavior) {
2247
+ t242 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(AddPermissionRules, {
2248
+ onAddRules: handleAddRulesSuccess,
2249
+ onCancel: handleAddRuleCancel,
2250
+ ruleValues: t222,
2251
+ ruleBehavior: validatedRule.ruleBehavior,
2252
+ initialContext: toolPermissionContext,
2253
+ setToolPermissionContext: t232
2254
+ }, undefined, false, undefined, this);
2255
+ $[51] = t222;
2256
+ $[52] = t232;
2257
+ $[53] = toolPermissionContext;
2258
+ $[54] = validatedRule.ruleBehavior;
2259
+ $[55] = t242;
2260
+ } else {
2261
+ t242 = $[55];
2262
+ }
2263
+ return t242;
2264
+ }
2265
+ if (isAddingWorkspaceDirectory) {
2266
+ let t222;
2267
+ if ($[56] !== setAppState || $[57] !== toolPermissionContext) {
2268
+ t222 = (path_0, remember) => {
2269
+ const destination = remember ? "localSettings" : "session";
2270
+ const permissionUpdate = {
2271
+ type: "addDirectories",
2272
+ directories: [path_0],
2273
+ destination
2274
+ };
2275
+ const updatedContext = applyPermissionUpdate(toolPermissionContext, permissionUpdate);
2276
+ setAppState((prev_4) => ({
2277
+ ...prev_4,
2278
+ toolPermissionContext: updatedContext
2279
+ }));
2280
+ if (remember) {
2281
+ persistPermissionUpdate(permissionUpdate);
2282
+ }
2283
+ setChanges((prev_5) => [...prev_5, `Added directory ${source_default.bold(path_0)} to workspace${remember ? " and saved to local settings" : " for this session"}`]);
2284
+ setIsAddingWorkspaceDirectory(false);
2285
+ };
2286
+ $[56] = setAppState;
2287
+ $[57] = toolPermissionContext;
2288
+ $[58] = t222;
2289
+ } else {
2290
+ t222 = $[58];
2291
+ }
2292
+ let t232;
2293
+ if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
2294
+ t232 = () => setIsAddingWorkspaceDirectory(false);
2295
+ $[59] = t232;
2296
+ } else {
2297
+ t232 = $[59];
2298
+ }
2299
+ let t242;
2300
+ if ($[60] !== t222 || $[61] !== toolPermissionContext) {
2301
+ t242 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(AddWorkspaceDirectory, {
2302
+ onAddDirectory: t222,
2303
+ onCancel: t232,
2304
+ permissionContext: toolPermissionContext
2305
+ }, undefined, false, undefined, this);
2306
+ $[60] = t222;
2307
+ $[61] = toolPermissionContext;
2308
+ $[62] = t242;
2309
+ } else {
2310
+ t242 = $[62];
2311
+ }
2312
+ return t242;
2313
+ }
2314
+ if (removingDirectory) {
2315
+ let t222;
2316
+ if ($[63] !== removingDirectory) {
2317
+ t222 = () => {
2318
+ setChanges((prev_6) => [...prev_6, `Removed directory ${source_default.bold(removingDirectory)} from workspace`]);
2319
+ setRemovingDirectory(null);
2320
+ };
2321
+ $[63] = removingDirectory;
2322
+ $[64] = t222;
2323
+ } else {
2324
+ t222 = $[64];
2325
+ }
2326
+ let t232;
2327
+ if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
2328
+ t232 = () => setRemovingDirectory(null);
2329
+ $[65] = t232;
2330
+ } else {
2331
+ t232 = $[65];
2332
+ }
2333
+ let t242;
2334
+ if ($[66] !== setAppState) {
2335
+ t242 = (toolPermissionContext_2) => {
2336
+ setAppState((prev_7) => ({
2337
+ ...prev_7,
2338
+ toolPermissionContext: toolPermissionContext_2
2339
+ }));
2340
+ };
2341
+ $[66] = setAppState;
2342
+ $[67] = t242;
2343
+ } else {
2344
+ t242 = $[67];
2345
+ }
2346
+ let t252;
2347
+ if ($[68] !== removingDirectory || $[69] !== t222 || $[70] !== t242 || $[71] !== toolPermissionContext) {
2348
+ t252 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RemoveWorkspaceDirectory, {
2349
+ directoryPath: removingDirectory,
2350
+ onRemove: t222,
2351
+ onCancel: t232,
2352
+ permissionContext: toolPermissionContext,
2353
+ setPermissionContext: t242
2354
+ }, undefined, false, undefined, this);
2355
+ $[68] = removingDirectory;
2356
+ $[69] = t222;
2357
+ $[70] = t242;
2358
+ $[71] = toolPermissionContext;
2359
+ $[72] = t252;
2360
+ } else {
2361
+ t252 = $[72];
2362
+ }
2363
+ return t252;
2364
+ }
2365
+ let t22;
2366
+ if ($[73] !== getRulesOptions || $[74] !== handleRulesCancel || $[75] !== handleToolSelect || $[76] !== isSearchMode || $[77] !== isTerminalFocused || $[78] !== lastFocusedRuleKey || $[79] !== searchCursorOffset || $[80] !== searchQuery) {
2367
+ t22 = {
2368
+ searchQuery,
2369
+ isSearchMode,
2370
+ isFocused: isTerminalFocused,
2371
+ onCancel: handleRulesCancel,
2372
+ lastFocusedRuleKey,
2373
+ cursorOffset: searchCursorOffset,
2374
+ getRulesOptions,
2375
+ handleToolSelect,
2376
+ onHeaderFocusChange: handleHeaderFocusChange
2377
+ };
2378
+ $[73] = getRulesOptions;
2379
+ $[74] = handleRulesCancel;
2380
+ $[75] = handleToolSelect;
2381
+ $[76] = isSearchMode;
2382
+ $[77] = isTerminalFocused;
2383
+ $[78] = lastFocusedRuleKey;
2384
+ $[79] = searchCursorOffset;
2385
+ $[80] = searchQuery;
2386
+ $[81] = t22;
2387
+ } else {
2388
+ t22 = $[81];
2389
+ }
2390
+ const sharedRulesProps = t22;
2391
+ const isHidden = !!selectedRule || !!addingRuleToTab || !!validatedRule || isAddingWorkspaceDirectory || !!removingDirectory;
2392
+ const t23 = !isSearchMode;
2393
+ let t24;
2394
+ if ($[82] === Symbol.for("react.memo_cache_sentinel")) {
2395
+ t24 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2396
+ id: "recent",
2397
+ title: "Recently denied",
2398
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RecentDenialsTab, {
2399
+ onHeaderFocusChange: handleHeaderFocusChange,
2400
+ onStateChange: handleDenialStateChange
2401
+ }, undefined, false, undefined, this)
2402
+ }, undefined, false, undefined, this);
2403
+ $[82] = t24;
2404
+ } else {
2405
+ t24 = $[82];
2406
+ }
2407
+ let t25;
2408
+ if ($[83] !== sharedRulesProps) {
2409
+ t25 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2410
+ id: "allow",
2411
+ title: "Allow",
2412
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRulesTab, {
2413
+ tab: "allow",
2414
+ ...sharedRulesProps
2415
+ }, undefined, false, undefined, this)
2416
+ }, undefined, false, undefined, this);
2417
+ $[83] = sharedRulesProps;
2418
+ $[84] = t25;
2419
+ } else {
2420
+ t25 = $[84];
2421
+ }
2422
+ let t26;
2423
+ if ($[85] !== sharedRulesProps) {
2424
+ t26 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2425
+ id: "ask",
2426
+ title: "Ask",
2427
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRulesTab, {
2428
+ tab: "ask",
2429
+ ...sharedRulesProps
2430
+ }, undefined, false, undefined, this)
2431
+ }, undefined, false, undefined, this);
2432
+ $[85] = sharedRulesProps;
2433
+ $[86] = t26;
2434
+ } else {
2435
+ t26 = $[86];
2436
+ }
2437
+ let t27;
2438
+ if ($[87] !== sharedRulesProps) {
2439
+ t27 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2440
+ id: "deny",
2441
+ title: "Deny",
2442
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRulesTab, {
2443
+ tab: "deny",
2444
+ ...sharedRulesProps
2445
+ }, undefined, false, undefined, this)
2446
+ }, undefined, false, undefined, this);
2447
+ $[87] = sharedRulesProps;
2448
+ $[88] = t27;
2449
+ } else {
2450
+ t27 = $[88];
2451
+ }
2452
+ let t28;
2453
+ if ($[89] === Symbol.for("react.memo_cache_sentinel")) {
2454
+ t28 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
2455
+ children: "Claude Code can read files in the workspace, and make edits when auto-accept edits is on."
2456
+ }, undefined, false, undefined, this);
2457
+ $[89] = t28;
2458
+ } else {
2459
+ t28 = $[89];
2460
+ }
2461
+ let t29;
2462
+ if ($[90] !== onExit || $[91] !== toolPermissionContext) {
2463
+ t29 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2464
+ id: "workspace",
2465
+ title: "Workspace",
2466
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
2467
+ flexDirection: "column",
2468
+ children: [
2469
+ t28,
2470
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(WorkspaceTab, {
2471
+ onExit,
2472
+ toolPermissionContext,
2473
+ onRequestAddDirectory: handleRequestAddDirectory,
2474
+ onRequestRemoveDirectory: handleRequestRemoveDirectory,
2475
+ onHeaderFocusChange: handleHeaderFocusChange
2476
+ }, undefined, false, undefined, this)
2477
+ ]
2478
+ }, undefined, true, undefined, this)
2479
+ }, undefined, false, undefined, this);
2480
+ $[90] = onExit;
2481
+ $[91] = toolPermissionContext;
2482
+ $[92] = t29;
2483
+ } else {
2484
+ t29 = $[92];
2485
+ }
2486
+ let t30;
2487
+ if ($[93] !== defaultTab || $[94] !== isHidden || $[95] !== t23 || $[96] !== t25 || $[97] !== t26 || $[98] !== t27 || $[99] !== t29) {
2488
+ t30 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tabs, {
2489
+ title: "Permissions:",
2490
+ color: "permission",
2491
+ defaultTab,
2492
+ hidden: isHidden,
2493
+ initialHeaderFocused: !hasDenials,
2494
+ navFromContent: t23,
2495
+ children: [
2496
+ t24,
2497
+ t25,
2498
+ t26,
2499
+ t27,
2500
+ t29
2501
+ ]
2502
+ }, undefined, true, undefined, this);
2503
+ $[93] = defaultTab;
2504
+ $[94] = isHidden;
2505
+ $[95] = t23;
2506
+ $[96] = t25;
2507
+ $[97] = t26;
2508
+ $[98] = t27;
2509
+ $[99] = t29;
2510
+ $[100] = t30;
2511
+ } else {
2512
+ t30 = $[100];
2513
+ }
2514
+ let t31;
2515
+ if ($[101] !== defaultTab || $[102] !== exitState.keyName || $[103] !== exitState.pending || $[104] !== headerFocused || $[105] !== isSearchMode) {
2516
+ t31 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
2517
+ marginTop: 1,
2518
+ paddingLeft: 1,
2519
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
2520
+ dimColor: true,
2521
+ children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2522
+ children: [
2523
+ "Press ",
2524
+ exitState.keyName,
2525
+ " again to exit"
2526
+ ]
2527
+ }, undefined, true, undefined, this) : headerFocused ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2528
+ children: "\u2190/\u2192 tab switch \xB7 \u2193 return \xB7 Esc cancel"
2529
+ }, undefined, false, undefined, this) : isSearchMode ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2530
+ children: "Type to filter \xB7 Enter/\u2193 select \xB7 \u2191 tabs \xB7 Esc clear"
2531
+ }, undefined, false, undefined, this) : hasDenials && defaultTab === "recent" ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2532
+ children: "Enter approve \xB7 r retry \xB7 \u2191\u2193 navigate \xB7 \u2190/\u2192 switch \xB7 Esc cancel"
2533
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2534
+ children: "\u2191\u2193 navigate \xB7 Enter select \xB7 Type to search \xB7 \u2190/\u2192 switch \xB7 Esc cancel"
2535
+ }, undefined, false, undefined, this)
2536
+ }, undefined, false, undefined, this)
2537
+ }, undefined, false, undefined, this);
2538
+ $[101] = defaultTab;
2539
+ $[102] = exitState.keyName;
2540
+ $[103] = exitState.pending;
2541
+ $[104] = headerFocused;
2542
+ $[105] = isSearchMode;
2543
+ $[106] = t31;
2544
+ } else {
2545
+ t31 = $[106];
2546
+ }
2547
+ let t32;
2548
+ if ($[107] !== t30 || $[108] !== t31) {
2549
+ t32 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Pane, {
2550
+ color: "permission",
2551
+ children: [
2552
+ t30,
2553
+ t31
2554
+ ]
2555
+ }, undefined, true, undefined, this);
2556
+ $[107] = t30;
2557
+ $[108] = t31;
2558
+ $[109] = t32;
2559
+ } else {
2560
+ t32 = $[109];
2561
+ }
2562
+ let t33;
2563
+ if ($[110] !== handleKeyDown || $[111] !== t32) {
2564
+ t33 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
2565
+ flexDirection: "column",
2566
+ onKeyDown: handleKeyDown,
2567
+ children: t32
2568
+ }, undefined, false, undefined, this);
2569
+ $[110] = handleKeyDown;
2570
+ $[111] = t32;
2571
+ $[112] = t33;
2572
+ } else {
2573
+ t33 = $[112];
2574
+ }
2575
+ return t33;
2576
+ }
2577
+ function _temp62(opt_0) {
2578
+ return opt_0.value;
2579
+ }
2580
+ function _temp5(opt) {
2581
+ return opt.value !== "add-new-rule";
2582
+ }
2583
+ function _temp42(d_1) {
2584
+ return source_default.bold(d_1.display);
2585
+ }
2586
+ function _temp32(d_0) {
2587
+ return d_0.display;
2588
+ }
2589
+ function _temp23(d) {
2590
+ return d !== undefined;
2591
+ }
2592
+ function _temp7(s) {
2593
+ return s.toolPermissionContext;
2594
+ }
2595
+ var import_compiler_runtime7, import_react4, jsx_dev_runtime7;
2596
+ var init_PermissionRuleList = __esm(() => {
2597
+ init_source();
2598
+ init_figures();
2599
+ init_AppState();
2600
+ init_PermissionUpdate();
2601
+ init_select();
2602
+ init_useExitOnCtrlCDWithKeybindings();
2603
+ init_useSearchInput();
2604
+ init_ink();
2605
+ init_useKeybinding();
2606
+ init_autoModeDenials();
2607
+ init_permissionRuleParser();
2608
+ init_permissions();
2609
+ init_slowOperations();
2610
+ init_Pane();
2611
+ init_Tabs();
2612
+ init_SearchBox();
2613
+ init_AddPermissionRules();
2614
+ init_AddWorkspaceDirectory();
2615
+ init_PermissionRuleDescription();
2616
+ init_PermissionRuleInput();
2617
+ init_RecentDenialsTab();
2618
+ init_RemoveWorkspaceDirectory();
2619
+ init_WorkspaceTab();
2620
+ import_compiler_runtime7 = __toESM(require_compiler_runtime(), 1);
2621
+ import_react4 = __toESM(require_react(), 1);
2622
+ jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
2623
+ });
2624
+
2625
+ // src/commands/permissions/permissions.tsx
2626
+ var jsx_dev_runtime8, call = async (onDone, context) => {
2627
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(PermissionRuleList, {
2628
+ onExit: onDone,
2629
+ onRetryDenials: (commands) => {
2630
+ context.setMessages((prev) => [...prev, createPermissionRetryMessage(commands)]);
2631
+ }
2632
+ }, undefined, false, undefined, this);
2633
+ };
2634
+ var init_permissions2 = __esm(() => {
2635
+ init_PermissionRuleList();
2636
+ init_messages();
2637
+ jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
2638
+ });
2639
+ init_permissions2();
2640
+
2641
+ export {
2642
+ call
2643
+ };