@rainhole/rain-code 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (496) hide show
  1. package/README.md +172 -0
  2. package/dist/chunk-06b2745w.js +3583 -0
  3. package/dist/chunk-06saje2v.js +39 -0
  4. package/dist/chunk-07069jq1.js +30 -0
  5. package/dist/chunk-0731m51q.js +8 -0
  6. package/dist/chunk-0bs2528v.js +192 -0
  7. package/dist/chunk-0fj1d707.js +313 -0
  8. package/dist/chunk-0gdkvtx4.js +117 -0
  9. package/dist/chunk-0jd8rpt4.js +34257 -0
  10. package/dist/chunk-0paqc2yw.js +15 -0
  11. package/dist/chunk-0pk0w4j1.js +332 -0
  12. package/dist/chunk-0rpb2bdp.js +8 -0
  13. package/dist/chunk-0rvwew67.js +9300 -0
  14. package/dist/chunk-0sa1g8jf.js +318 -0
  15. package/dist/chunk-0vkfrmqm.js +690 -0
  16. package/dist/chunk-0xgxxqhr.js +708 -0
  17. package/dist/chunk-0xjaqda8.js +1124 -0
  18. package/dist/chunk-0zep39v0.js +81 -0
  19. package/dist/chunk-1141xmr4.js +8 -0
  20. package/dist/chunk-12hn2mhy.js +17 -0
  21. package/dist/chunk-12rjry89.js +81 -0
  22. package/dist/chunk-168xb8v1.js +436 -0
  23. package/dist/chunk-1cwdhk7a.js +969 -0
  24. package/dist/chunk-1cx0fd76.js +132 -0
  25. package/dist/chunk-1erfksyp.js +107 -0
  26. package/dist/chunk-1h1tc4mw.js +126 -0
  27. package/dist/chunk-1h2famwb.js +49 -0
  28. package/dist/chunk-1jnbys9f.js +1811 -0
  29. package/dist/chunk-1k4fp6ft.js +389 -0
  30. package/dist/chunk-1mjn8xxc.js +22 -0
  31. package/dist/chunk-1mn6r4y2.js +747 -0
  32. package/dist/chunk-1p8myfza.js +1568 -0
  33. package/dist/chunk-1vthytca.js +79 -0
  34. package/dist/chunk-1y32rx73.js +145 -0
  35. package/dist/chunk-200781fd.js +64 -0
  36. package/dist/chunk-205mmm67.js +100 -0
  37. package/dist/chunk-209eh6ak.js +9381 -0
  38. package/dist/chunk-21mfpnva.js +85 -0
  39. package/dist/chunk-238g70xa.js +36 -0
  40. package/dist/chunk-24k6t9fa.js +151 -0
  41. package/dist/chunk-29gg6hx0.js +2992 -0
  42. package/dist/chunk-2a42s11t.js +412 -0
  43. package/dist/chunk-2ekjxh7d.js +289 -0
  44. package/dist/chunk-2eykm0j0.js +20 -0
  45. package/dist/chunk-2fwze72g.js +24 -0
  46. package/dist/chunk-2gzv8nrw.js +205 -0
  47. package/dist/chunk-2k995y2x.js +880 -0
  48. package/dist/chunk-2nayx6q1.js +63 -0
  49. package/dist/chunk-2pg9pmvc.js +182 -0
  50. package/dist/chunk-2qp2hc02.js +36 -0
  51. package/dist/chunk-2rj0dnps.js +436 -0
  52. package/dist/chunk-2t0xa4dt.js +145 -0
  53. package/dist/chunk-2ym6tnww.js +216 -0
  54. package/dist/chunk-30bpz5m2.js +34 -0
  55. package/dist/chunk-30rst83v.js +168 -0
  56. package/dist/chunk-36b2q5fg.js +1299 -0
  57. package/dist/chunk-3c25bcsw.js +17 -0
  58. package/dist/chunk-3ewzhjyb.js +207 -0
  59. package/dist/chunk-3h8a89gy.js +46 -0
  60. package/dist/chunk-3nk79af8.js +8 -0
  61. package/dist/chunk-3sfr7j85.js +884 -0
  62. package/dist/chunk-3w6s9m5w.js +16 -0
  63. package/dist/chunk-3x52v1wb.js +660 -0
  64. package/dist/chunk-404qm8xt.js +1715 -0
  65. package/dist/chunk-42fjay4q.js +141 -0
  66. package/dist/chunk-48649h96.js +8590 -0
  67. package/dist/chunk-495d85x1.js +8066 -0
  68. package/dist/chunk-4anj5saq.js +111 -0
  69. package/dist/chunk-4asynmj4.js +259 -0
  70. package/dist/chunk-4ck9wve9.js +225 -0
  71. package/dist/chunk-4cp6193g.js +9076 -0
  72. package/dist/chunk-4g3v8y12.js +23 -0
  73. package/dist/chunk-4geyher8.js +244 -0
  74. package/dist/chunk-4hv90qcz.js +8 -0
  75. package/dist/chunk-4jhr03e7.js +61 -0
  76. package/dist/chunk-4jm600zv.js +13 -0
  77. package/dist/chunk-4nspekjp.js +69 -0
  78. package/dist/chunk-4ptqcw4p.js +16 -0
  79. package/dist/chunk-4qj8cqbh.js +173 -0
  80. package/dist/chunk-4wxsg6a0.js +122 -0
  81. package/dist/chunk-4zfkzkt6.js +37 -0
  82. package/dist/chunk-54dckh8a.js +1169 -0
  83. package/dist/chunk-54y13759.js +650 -0
  84. package/dist/chunk-54yf6e8d.js +91 -0
  85. package/dist/chunk-57qz90z8.js +154 -0
  86. package/dist/chunk-59k0mjnc.js +120 -0
  87. package/dist/chunk-59p9jye4.js +104 -0
  88. package/dist/chunk-5c753bd4.js +64 -0
  89. package/dist/chunk-5cw6zwep.js +106 -0
  90. package/dist/chunk-5eaf3j24.js +133 -0
  91. package/dist/chunk-5me7398b.js +81 -0
  92. package/dist/chunk-5pevjsyw.js +118 -0
  93. package/dist/chunk-5q3c2rf4.js +107 -0
  94. package/dist/chunk-5xwtnq4g.js +146 -0
  95. package/dist/chunk-5z28bqne.js +6748 -0
  96. package/dist/chunk-613f6fbv.js +63 -0
  97. package/dist/chunk-641hawvm.js +95 -0
  98. package/dist/chunk-64c1avct.js +13 -0
  99. package/dist/chunk-64hks9ax.js +456 -0
  100. package/dist/chunk-677as3nh.js +15 -0
  101. package/dist/chunk-6bd8brc4.js +48 -0
  102. package/dist/chunk-6cs6mmez.js +112 -0
  103. package/dist/chunk-6dj5t602.js +341 -0
  104. package/dist/chunk-6e8vht4y.js +780 -0
  105. package/dist/chunk-6gr3c3w9.js +378 -0
  106. package/dist/chunk-6hkd32eh.js +83 -0
  107. package/dist/chunk-6jqxvef0.js +198 -0
  108. package/dist/chunk-6mh3vfa4.js +115 -0
  109. package/dist/chunk-6mpw9h55.js +1071 -0
  110. package/dist/chunk-6p4cyhb3.js +16 -0
  111. package/dist/chunk-6qvgnepd.js +26 -0
  112. package/dist/chunk-6r2bhsvt.js +6956 -0
  113. package/dist/chunk-6tq2v3rk.js +186 -0
  114. package/dist/chunk-7316m01k.js +125 -0
  115. package/dist/chunk-73rpbt04.js +1947 -0
  116. package/dist/chunk-75zk7zr1.js +309 -0
  117. package/dist/chunk-760252na.js +101 -0
  118. package/dist/chunk-764ec4ja.js +173 -0
  119. package/dist/chunk-76vgnv24.js +108 -0
  120. package/dist/chunk-7739pg2c.js +4261 -0
  121. package/dist/chunk-7a7hxy3d.js +167 -0
  122. package/dist/chunk-7aw745vx.js +40175 -0
  123. package/dist/chunk-7b6bg1r4.js +16128 -0
  124. package/dist/chunk-7ca4qskp.js +99 -0
  125. package/dist/chunk-7deph26x.js +311 -0
  126. package/dist/chunk-7ds8zqar.js +108 -0
  127. package/dist/chunk-7fqxw3d2.js +479 -0
  128. package/dist/chunk-7nysf9yd.js +266 -0
  129. package/dist/chunk-7tascxe2.js +90 -0
  130. package/dist/chunk-7wm5s02e.js +216 -0
  131. package/dist/chunk-7xmw2tcz.js +277 -0
  132. package/dist/chunk-7xyswgjh.js +8 -0
  133. package/dist/chunk-7zkhadkb.js +220 -0
  134. package/dist/chunk-8225arm6.js +6374 -0
  135. package/dist/chunk-83hfzbx3.js +10 -0
  136. package/dist/chunk-85tag8nv.js +1391 -0
  137. package/dist/chunk-8bd8q5xw.js +359 -0
  138. package/dist/chunk-8bwqtasa.js +213 -0
  139. package/dist/chunk-8g5pe1gr.js +37 -0
  140. package/dist/chunk-8g747a8x.js +26 -0
  141. package/dist/chunk-8h6sdj66.js +447 -0
  142. package/dist/chunk-8mm8b6dd.js +19 -0
  143. package/dist/chunk-8ndwn6st.js +120 -0
  144. package/dist/chunk-8pn8tvgg.js +637 -0
  145. package/dist/chunk-8tnn9kcb.js +131 -0
  146. package/dist/chunk-8tnsngw2.js +31 -0
  147. package/dist/chunk-8x5w267y.js +112 -0
  148. package/dist/chunk-8y12jxg8.js +10 -0
  149. package/dist/chunk-8ymf4e6z.js +48 -0
  150. package/dist/chunk-90mt0m1w.js +102 -0
  151. package/dist/chunk-90wp6wez.js +10510 -0
  152. package/dist/chunk-91ew1d6f.js +2689 -0
  153. package/dist/chunk-97jsc1kn.js +231 -0
  154. package/dist/chunk-993pnm45.js +4521 -0
  155. package/dist/chunk-9a0rsdre.js +46 -0
  156. package/dist/chunk-9d7fmqkw.js +41 -0
  157. package/dist/chunk-9dgaq0g4.js +667 -0
  158. package/dist/chunk-9f52phb8.js +138 -0
  159. package/dist/chunk-9fbpqghc.js +105 -0
  160. package/dist/chunk-9hzxd5q3.js +122 -0
  161. package/dist/chunk-9kyrssch.js +28 -0
  162. package/dist/chunk-9q93n4w6.js +308 -0
  163. package/dist/chunk-9s0xs06y.js +581 -0
  164. package/dist/chunk-9x5zgy22.js +12 -0
  165. package/dist/chunk-9zdcb9jy.js +105 -0
  166. package/dist/chunk-a136cvvz.js +27 -0
  167. package/dist/chunk-a4psxnr1.js +224 -0
  168. package/dist/chunk-a4twdmhf.js +45 -0
  169. package/dist/chunk-a7rhvq9b.js +106 -0
  170. package/dist/chunk-a8ejc632.js +3094 -0
  171. package/dist/chunk-a9vdeb6y.js +258 -0
  172. package/dist/chunk-a9zh40sj.js +48 -0
  173. package/dist/chunk-aawg48hh.js +4102 -0
  174. package/dist/chunk-ad2f3890.js +65 -0
  175. package/dist/chunk-ae7ar1jk.js +105 -0
  176. package/dist/chunk-ak3hdbe4.js +234 -0
  177. package/dist/chunk-as4e9g8f.js +298 -0
  178. package/dist/chunk-ase86y73.js +15 -0
  179. package/dist/chunk-awb4vc41.js +69 -0
  180. package/dist/chunk-b4bep0aq.js +5041 -0
  181. package/dist/chunk-b4wg70y1.js +54 -0
  182. package/dist/chunk-b81hd3m6.js +32 -0
  183. package/dist/chunk-b9knmzt0.js +106 -0
  184. package/dist/chunk-besmz4ym.js +32 -0
  185. package/dist/chunk-bgpkemkg.js +65 -0
  186. package/dist/chunk-bj8x29tz.js +54 -0
  187. package/dist/chunk-bkqsnwrq.js +239 -0
  188. package/dist/chunk-bnf662he.js +359 -0
  189. package/dist/chunk-bq00fcsd.js +165 -0
  190. package/dist/chunk-brz2c4cq.js +275 -0
  191. package/dist/chunk-bsa118r4.js +502 -0
  192. package/dist/chunk-bsengrbt.js +2737 -0
  193. package/dist/chunk-bt64sq5y.js +19 -0
  194. package/dist/chunk-bxcfz5gy.js +56 -0
  195. package/dist/chunk-bxs2a71m.js +213 -0
  196. package/dist/chunk-byv2p9hn.js +397 -0
  197. package/dist/chunk-c03am3es.js +29 -0
  198. package/dist/chunk-c2ahb7yg.js +105 -0
  199. package/dist/chunk-c2qm0t6p.js +111 -0
  200. package/dist/chunk-c42h9gzx.js +71 -0
  201. package/dist/chunk-c47xbxqw.js +38 -0
  202. package/dist/chunk-c5vkve4j.js +68 -0
  203. package/dist/chunk-c6sjhj89.js +1284 -0
  204. package/dist/chunk-ca147npg.js +27 -0
  205. package/dist/chunk-caxx597g.js +71 -0
  206. package/dist/chunk-cbrt5vsb.js +31 -0
  207. package/dist/chunk-ce0z23ct.js +443 -0
  208. package/dist/chunk-cefsp8h1.js +155 -0
  209. package/dist/chunk-cfv996bs.js +22 -0
  210. package/dist/chunk-cgfdkzhb.js +12 -0
  211. package/dist/chunk-chsyvavm.js +3435 -0
  212. package/dist/chunk-cmsknj6n.js +28228 -0
  213. package/dist/chunk-cn8bkmvj.js +264 -0
  214. package/dist/chunk-crmjpsqe.js +68 -0
  215. package/dist/chunk-cthpw4pj.js +849 -0
  216. package/dist/chunk-cwy9nj4y.js +134 -0
  217. package/dist/chunk-cyagce56.js +155 -0
  218. package/dist/chunk-cynewytp.js +227 -0
  219. package/dist/chunk-cznf6k4g.js +46 -0
  220. package/dist/chunk-d0954t9j.js +267 -0
  221. package/dist/chunk-d1qhftze.js +118 -0
  222. package/dist/chunk-d4mdda98.js +94 -0
  223. package/dist/chunk-d4rnqevg.js +41 -0
  224. package/dist/chunk-d7886r6a.js +13870 -0
  225. package/dist/chunk-dd1qvamk.js +678 -0
  226. package/dist/chunk-dg4je8qj.js +183 -0
  227. package/dist/chunk-dggvswz1.js +104 -0
  228. package/dist/chunk-dgqrcy74.js +48 -0
  229. package/dist/chunk-dm3n2qgd.js +24 -0
  230. package/dist/chunk-dnh7jtpb.js +37 -0
  231. package/dist/chunk-dsenyfax.js +105 -0
  232. package/dist/chunk-dtf0a7rr.js +655 -0
  233. package/dist/chunk-dxdb7bs1.js +60 -0
  234. package/dist/chunk-e0pth8g7.js +79 -0
  235. package/dist/chunk-e36y0q82.js +109 -0
  236. package/dist/chunk-ef55cwrv.js +267 -0
  237. package/dist/chunk-efh644hv.js +915 -0
  238. package/dist/chunk-ehtwnxpg.js +1591 -0
  239. package/dist/chunk-ejahyhd8.js +120 -0
  240. package/dist/chunk-ejk1bpzz.js +472 -0
  241. package/dist/chunk-emef71ea.js +202 -0
  242. package/dist/chunk-en7v028t.js +333 -0
  243. package/dist/chunk-eqp1rfft.js +17 -0
  244. package/dist/chunk-ewadzrm8.js +103 -0
  245. package/dist/chunk-exh7z6tv.js +132 -0
  246. package/dist/chunk-f0npbgyf.js +340 -0
  247. package/dist/chunk-f2qkc8ce.js +229 -0
  248. package/dist/chunk-f49sb3q7.js +40 -0
  249. package/dist/chunk-f5ma3nh5.js +3436 -0
  250. package/dist/chunk-fbv4apne.js +51 -0
  251. package/dist/chunk-fday7sfg.js +269 -0
  252. package/dist/chunk-feyzykye.js +10 -0
  253. package/dist/chunk-fgqwr70t.js +241 -0
  254. package/dist/chunk-fhy7zs1w.js +943 -0
  255. package/dist/chunk-fmw3f68k.js +432 -0
  256. package/dist/chunk-fmwqvpqm.js +506 -0
  257. package/dist/chunk-fn1apgre.js +66 -0
  258. package/dist/chunk-fpy4nam9.js +21933 -0
  259. package/dist/chunk-fqy0erkw.js +908 -0
  260. package/dist/chunk-ftqwza3a.js +43 -0
  261. package/dist/chunk-fyc5fepv.js +10 -0
  262. package/dist/chunk-fz0ch109.js +329 -0
  263. package/dist/chunk-fzhn8z8j.js +253 -0
  264. package/dist/chunk-g12brv6y.js +321 -0
  265. package/dist/chunk-g338npwr.js +1061 -0
  266. package/dist/chunk-g5tpks28.js +795 -0
  267. package/dist/chunk-g63tgj4f.js +58 -0
  268. package/dist/chunk-g827r0mk.js +266 -0
  269. package/dist/chunk-g8wzsxgc.js +2534 -0
  270. package/dist/chunk-gey7mwcw.js +36 -0
  271. package/dist/chunk-gghb9pks.js +120 -0
  272. package/dist/chunk-grdpaf1p.js +606 -0
  273. package/dist/chunk-gx8016vp.js +125 -0
  274. package/dist/chunk-h0qngp9w.js +157 -0
  275. package/dist/chunk-h0rbjg6x.js +55 -0
  276. package/dist/chunk-h1mr3371.js +121 -0
  277. package/dist/chunk-h3xwdgpd.js +68 -0
  278. package/dist/chunk-h4b85amj.js +2331 -0
  279. package/dist/chunk-h6d137aa.js +20 -0
  280. package/dist/chunk-h9n7z00d.js +95 -0
  281. package/dist/chunk-hakdhagh.js +16606 -0
  282. package/dist/chunk-hd8531ec.js +685 -0
  283. package/dist/chunk-heq3rn8t.js +33068 -0
  284. package/dist/chunk-hfvxc9fd.js +542 -0
  285. package/dist/chunk-hgpd0qmm.js +371 -0
  286. package/dist/chunk-hh7cmy4k.js +20 -0
  287. package/dist/chunk-hhjs87wh.js +1407 -0
  288. package/dist/chunk-hjtvdvgj.js +208 -0
  289. package/dist/chunk-hk9xz7gk.js +118 -0
  290. package/dist/chunk-hknbjky3.js +160798 -0
  291. package/dist/chunk-htsbqyf9.js +338 -0
  292. package/dist/chunk-htx7jmxk.js +78 -0
  293. package/dist/chunk-hzhe8ygc.js +547 -0
  294. package/dist/chunk-j2k4p94p.js +55 -0
  295. package/dist/chunk-j3a4p81y.js +184 -0
  296. package/dist/chunk-j46rb9m9.js +544 -0
  297. package/dist/chunk-j5bth84e.js +97 -0
  298. package/dist/chunk-j64ga6ta.js +8035 -0
  299. package/dist/chunk-j6jh72hw.js +140 -0
  300. package/dist/chunk-j9gxwbe3.js +349 -0
  301. package/dist/chunk-jaaxk89e.js +113 -0
  302. package/dist/chunk-jd32zbps.js +15 -0
  303. package/dist/chunk-jdgeec04.js +4249 -0
  304. package/dist/chunk-jk826edv.js +174 -0
  305. package/dist/chunk-jnhkref0.js +30 -0
  306. package/dist/chunk-jsx72hep.js +208 -0
  307. package/dist/chunk-jx817w05.js +11 -0
  308. package/dist/chunk-jzmz18nn.js +65 -0
  309. package/dist/chunk-k0p9w03v.js +4957 -0
  310. package/dist/chunk-k3s4yk22.js +477 -0
  311. package/dist/chunk-kfd89dsd.js +21 -0
  312. package/dist/chunk-kgfz4522.js +126 -0
  313. package/dist/chunk-kn6zg6bd.js +524 -0
  314. package/dist/chunk-kp9vkzj6.js +120 -0
  315. package/dist/chunk-kraf793v.js +118 -0
  316. package/dist/chunk-kw0r30h3.js +208 -0
  317. package/dist/chunk-kwekc97v.js +18 -0
  318. package/dist/chunk-m2bcpk8j.js +30 -0
  319. package/dist/chunk-m2kp5f7p.js +4389 -0
  320. package/dist/chunk-m74w3187.js +164 -0
  321. package/dist/chunk-m88q4jmb.js +61 -0
  322. package/dist/chunk-man6wb4n.js +1456 -0
  323. package/dist/chunk-mdk3xgya.js +42 -0
  324. package/dist/chunk-mf4g439x.js +82 -0
  325. package/dist/chunk-mg8g0xqs.js +71 -0
  326. package/dist/chunk-mkwzrqvf.js +38 -0
  327. package/dist/chunk-mn61mk4v.js +351 -0
  328. package/dist/chunk-ms09sxcj.js +908 -0
  329. package/dist/chunk-mtn1anwe.js +2351 -0
  330. package/dist/chunk-mv0zm0qj.js +65 -0
  331. package/dist/chunk-mx28h61f.js +1147 -0
  332. package/dist/chunk-mxbf8ajn.js +1067 -0
  333. package/dist/chunk-n0qaeaa5.js +256 -0
  334. package/dist/chunk-n34z5cw8.js +74 -0
  335. package/dist/chunk-n55ehz77.js +120 -0
  336. package/dist/chunk-n7ttdtk0.js +641 -0
  337. package/dist/chunk-n9ktjngj.js +336 -0
  338. package/dist/chunk-nb2ntesh.js +149 -0
  339. package/dist/chunk-netzwgv1.js +154 -0
  340. package/dist/chunk-nh3cd07f.js +14358 -0
  341. package/dist/chunk-nka1g8f4.js +773 -0
  342. package/dist/chunk-nm97cw83.js +458 -0
  343. package/dist/chunk-nq0fxyxh.js +752 -0
  344. package/dist/chunk-nt837qt9.js +21 -0
  345. package/dist/chunk-nx87c0vw.js +250 -0
  346. package/dist/chunk-nxw6y6xm.js +862 -0
  347. package/dist/chunk-nzt717xg.js +32 -0
  348. package/dist/chunk-p2816w9z.js +1486 -0
  349. package/dist/chunk-p2d5nh3g.js +342 -0
  350. package/dist/chunk-p9cdykwf.js +72 -0
  351. package/dist/chunk-paxw1ryd.js +227 -0
  352. package/dist/chunk-ph5g4d1j.js +109 -0
  353. package/dist/chunk-pp42p8y3.js +574 -0
  354. package/dist/chunk-ppdn71n4.js +400 -0
  355. package/dist/chunk-ppwjyveh.js +8 -0
  356. package/dist/chunk-ps49ymvj.js +43 -0
  357. package/dist/chunk-pshjyzq4.js +17656 -0
  358. package/dist/chunk-pw8nf9rt.js +126 -0
  359. package/dist/chunk-pwwa7s62.js +11 -0
  360. package/dist/chunk-py3zxq5j.js +129 -0
  361. package/dist/chunk-pyz1qswz.js +300 -0
  362. package/dist/chunk-q50q8mc5.js +157 -0
  363. package/dist/chunk-q7tpyeb3.js +39 -0
  364. package/dist/chunk-q82r31er.js +151 -0
  365. package/dist/chunk-qajrkk97.js +298 -0
  366. package/dist/chunk-qcpxnyeh.js +110 -0
  367. package/dist/chunk-qeabchwr.js +132 -0
  368. package/dist/chunk-qm7nbd10.js +755 -0
  369. package/dist/chunk-qm8j7kxr.js +280 -0
  370. package/dist/chunk-qmwgg5zy.js +136 -0
  371. package/dist/chunk-qnfx3qtx.js +617 -0
  372. package/dist/chunk-qp2qdcda.js +100 -0
  373. package/dist/chunk-qphaajd7.js +305 -0
  374. package/dist/chunk-qt21xxgm.js +419 -0
  375. package/dist/chunk-qy2z2p0b.js +122 -0
  376. package/dist/chunk-qyz8q0dj.js +689 -0
  377. package/dist/chunk-qz2x630m.js +49145 -0
  378. package/dist/chunk-qzq5n1yn.js +76 -0
  379. package/dist/chunk-r0ya57xw.js +170 -0
  380. package/dist/chunk-r7j395t6.js +122 -0
  381. package/dist/chunk-r7trcrs7.js +62 -0
  382. package/dist/chunk-re4yh70t.js +1095 -0
  383. package/dist/chunk-rhte1r8g.js +272 -0
  384. package/dist/chunk-rhw4ayb1.js +6851 -0
  385. package/dist/chunk-rn0v1hk8.js +34 -0
  386. package/dist/chunk-rphakhme.js +281 -0
  387. package/dist/chunk-rrtzz2pv.js +32 -0
  388. package/dist/chunk-rtnjk8ge.js +726 -0
  389. package/dist/chunk-rwhswkma.js +87 -0
  390. package/dist/chunk-rxd4kn2g.js +308 -0
  391. package/dist/chunk-s083x8ry.js +2840 -0
  392. package/dist/chunk-s16sn02n.js +365 -0
  393. package/dist/chunk-s1s8qfdh.js +182 -0
  394. package/dist/chunk-s2bwz69v.js +473 -0
  395. package/dist/chunk-s3pzvdss.js +50 -0
  396. package/dist/chunk-s9y6t0mt.js +291 -0
  397. package/dist/chunk-sd36yzx8.js +954 -0
  398. package/dist/chunk-se8xzw8h.js +87 -0
  399. package/dist/chunk-sg66v252.js +1648 -0
  400. package/dist/chunk-sg7gf3hj.js +1585 -0
  401. package/dist/chunk-spx24x6j.js +98 -0
  402. package/dist/chunk-sybxpy18.js +73 -0
  403. package/dist/chunk-szj5wvdy.js +28 -0
  404. package/dist/chunk-t0gb304x.js +182 -0
  405. package/dist/chunk-t3fr4skc.js +165 -0
  406. package/dist/chunk-t58wfamm.js +5368 -0
  407. package/dist/chunk-t6s2kkm3.js +104 -0
  408. package/dist/chunk-t8hv0x81.js +116 -0
  409. package/dist/chunk-tezak8rx.js +6157 -0
  410. package/dist/chunk-th5y3hj5.js +189 -0
  411. package/dist/chunk-tj0d3870.js +180 -0
  412. package/dist/chunk-tjgsawpx.js +40 -0
  413. package/dist/chunk-ts2p6bv1.js +224 -0
  414. package/dist/chunk-ttk5dzz8.js +25 -0
  415. package/dist/chunk-tv9pcdnz.js +51 -0
  416. package/dist/chunk-ty99rgvw.js +122 -0
  417. package/dist/chunk-tzgp8av2.js +61 -0
  418. package/dist/chunk-v1kzp02e.js +785 -0
  419. package/dist/chunk-v2c9dq7t.js +275 -0
  420. package/dist/chunk-v3aq3heg.js +620 -0
  421. package/dist/chunk-v78fj8by.js +145 -0
  422. package/dist/chunk-v9smspw2.js +4301 -0
  423. package/dist/chunk-var1et7e.js +66 -0
  424. package/dist/chunk-vchrkvet.js +120 -0
  425. package/dist/chunk-vest0y6x.js +3830 -0
  426. package/dist/chunk-vf5sd1nq.js +12 -0
  427. package/dist/chunk-vf612n57.js +472 -0
  428. package/dist/chunk-vgpy9md6.js +339 -0
  429. package/dist/chunk-vkzt82ry.js +644 -0
  430. package/dist/chunk-vsh80y0c.js +100 -0
  431. package/dist/chunk-vxkdxhyk.js +103 -0
  432. package/dist/chunk-vxt6ywm9.js +485 -0
  433. package/dist/chunk-vyjeh50y.js +2149 -0
  434. package/dist/chunk-vytdzvqs.js +1181 -0
  435. package/dist/chunk-w0qks2ja.js +1030 -0
  436. package/dist/chunk-wfz0qffj.js +3939 -0
  437. package/dist/chunk-wp1568nt.js +828 -0
  438. package/dist/chunk-wpckhx7b.js +66 -0
  439. package/dist/chunk-wpvkvwvc.js +41 -0
  440. package/dist/chunk-ws5d6qs4.js +655 -0
  441. package/dist/chunk-wsnxrrb5.js +986 -0
  442. package/dist/chunk-wyavftcj.js +103 -0
  443. package/dist/chunk-wybh0bvv.js +121 -0
  444. package/dist/chunk-wzpdet3m.js +843 -0
  445. package/dist/chunk-x2dp18yj.js +74 -0
  446. package/dist/chunk-x6r4v44b.js +8 -0
  447. package/dist/chunk-x7r5k0hf.js +423 -0
  448. package/dist/chunk-xahk20z8.js +877 -0
  449. package/dist/chunk-xajwdaxm.js +295 -0
  450. package/dist/chunk-xkt36p6r.js +61 -0
  451. package/dist/chunk-xnav6j8h.js +490 -0
  452. package/dist/chunk-xrj294jg.js +440 -0
  453. package/dist/chunk-xsq9ae7x.js +90 -0
  454. package/dist/chunk-xt9z9t7b.js +40 -0
  455. package/dist/chunk-xv3era3s.js +8 -0
  456. package/dist/chunk-y1784krc.js +19 -0
  457. package/dist/chunk-y289fz8y.js +116 -0
  458. package/dist/chunk-y3r7v9pq.js +336 -0
  459. package/dist/chunk-y98z50mm.js +158 -0
  460. package/dist/chunk-yhce3x0q.js +64 -0
  461. package/dist/chunk-yhhf6n9p.js +338 -0
  462. package/dist/chunk-ykr34msh.js +411 -0
  463. package/dist/chunk-yks9ggzn.js +103 -0
  464. package/dist/chunk-ym5r3jnk.js +2007 -0
  465. package/dist/chunk-ypa349qq.js +148 -0
  466. package/dist/chunk-yzx3mhfd.js +110 -0
  467. package/dist/chunk-z1bs6d7k.js +24 -0
  468. package/dist/chunk-z2dp53wn.js +17 -0
  469. package/dist/chunk-z3k0k30d.js +882 -0
  470. package/dist/chunk-z42cqdtf.js +107 -0
  471. package/dist/chunk-z7asrz6j.js +259 -0
  472. package/dist/chunk-za09fhhh.js +716 -0
  473. package/dist/chunk-zae0t3p4.js +252 -0
  474. package/dist/chunk-zbsw794g.js +259 -0
  475. package/dist/chunk-ze6zvkg6.js +22820 -0
  476. package/dist/chunk-zejm280k.js +39 -0
  477. package/dist/chunk-zk2wsm7d.js +15 -0
  478. package/dist/chunk-znf2b75k.js +113 -0
  479. package/dist/chunk-zqpnvsdz.js +24 -0
  480. package/dist/chunk-zs2gdkj5.js +433 -0
  481. package/dist/chunk-zseb1639.js +37 -0
  482. package/dist/chunk-zsgha506.js +63 -0
  483. package/dist/chunk-zvsfgmq8.js +146 -0
  484. package/dist/chunk-zw5xd7m9.js +160 -0
  485. package/dist/chunk-zzm33q8x.js +8 -0
  486. package/dist/cli.js +97 -0
  487. package/dist/download-ripgrep.js +24821 -0
  488. package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
  489. package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
  490. package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
  491. package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
  492. package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
  493. package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
  494. package/package.json +178 -0
  495. package/scripts/download-ripgrep.ts +335 -0
  496. package/scripts/postinstall.cjs +319 -0
@@ -0,0 +1,2534 @@
1
+ // @bun
2
+ import {
3
+ ConfigurableShortcutHint,
4
+ OAuthService,
5
+ Select,
6
+ SelectMulti,
7
+ Spinner,
8
+ TextInput,
9
+ init_ConfigurableShortcutHint,
10
+ init_CustomSelect,
11
+ init_SelectMulti,
12
+ init_Spinner,
13
+ init_TextInput,
14
+ init_oauth,
15
+ init_useTerminalSize,
16
+ useTerminalSize
17
+ } from "./chunk-hknbjky3.js";
18
+ import"./chunk-a4psxnr1.js";
19
+ import"./chunk-613f6fbv.js";
20
+ import"./chunk-zejm280k.js";
21
+ import"./chunk-57qz90z8.js";
22
+ import"./chunk-4nspekjp.js";
23
+ import"./chunk-heq3rn8t.js";
24
+ import"./chunk-var1et7e.js";
25
+ import"./chunk-e0pth8g7.js";
26
+ import"./chunk-ws5d6qs4.js";
27
+ import"./chunk-bxcfz5gy.js";
28
+ import"./chunk-wp1568nt.js";
29
+ import"./chunk-2gzv8nrw.js";
30
+ import"./chunk-ehtwnxpg.js";
31
+ import"./chunk-cgfdkzhb.js";
32
+ import"./chunk-8h6sdj66.js";
33
+ import {
34
+ init_useExitOnCtrlCDWithKeybindings,
35
+ useExitOnCtrlCDWithKeybindings
36
+ } from "./chunk-75zk7zr1.js";
37
+ import"./chunk-j5bth84e.js";
38
+ import"./chunk-qm7nbd10.js";
39
+ import"./chunk-5pevjsyw.js";
40
+ import {
41
+ init_useKeybinding,
42
+ useKeybinding,
43
+ useKeybindings
44
+ } from "./chunk-xnav6j8h.js";
45
+ import"./chunk-ps49ymvj.js";
46
+ import"./chunk-zk2wsm7d.js";
47
+ import"./chunk-2t0xa4dt.js";
48
+ import"./chunk-bgpkemkg.js";
49
+ import"./chunk-rrtzz2pv.js";
50
+ import"./chunk-zsgha506.js";
51
+ import"./chunk-4jm600zv.js";
52
+ import {
53
+ init_browser,
54
+ openBrowser
55
+ } from "./chunk-xkt36p6r.js";
56
+ import"./chunk-2ekjxh7d.js";
57
+ import"./chunk-85tag8nv.js";
58
+ import"./chunk-mx28h61f.js";
59
+ import"./chunk-kraf793v.js";
60
+ import"./chunk-bj8x29tz.js";
61
+ import"./chunk-zae0t3p4.js";
62
+ import"./chunk-t58wfamm.js";
63
+ import"./chunk-chsyvavm.js";
64
+ import"./chunk-6mpw9h55.js";
65
+ import {
66
+ getAnthropicApiKey,
67
+ init_auth,
68
+ init_config1 as init_config,
69
+ init_stringUtils,
70
+ isAnthropicAuthEnabled,
71
+ plural,
72
+ saveGlobalConfig,
73
+ saveOAuthTokensIfNeeded
74
+ } from "./chunk-7b6bg1r4.js";
75
+ import"./chunk-sg66v252.js";
76
+ import"./chunk-8bwqtasa.js";
77
+ import"./chunk-j9gxwbe3.js";
78
+ import"./chunk-1cwdhk7a.js";
79
+ import"./chunk-rtnjk8ge.js";
80
+ import"./chunk-64c1avct.js";
81
+ import"./chunk-8g5pe1gr.js";
82
+ import"./chunk-gx8016vp.js";
83
+ import"./chunk-4cp6193g.js";
84
+ import"./chunk-8g747a8x.js";
85
+ import"./chunk-d7886r6a.js";
86
+ import"./chunk-f5ma3nh5.js";
87
+ import"./chunk-qz2x630m.js";
88
+ import"./chunk-r7j395t6.js";
89
+ import"./chunk-tv9pcdnz.js";
90
+ import"./chunk-3c25bcsw.js";
91
+ import"./chunk-n9ktjngj.js";
92
+ import"./chunk-q82r31er.js";
93
+ import"./chunk-p2816w9z.js";
94
+ import"./chunk-v9smspw2.js";
95
+ import"./chunk-v1kzp02e.js";
96
+ import"./chunk-64hks9ax.js";
97
+ import"./chunk-crmjpsqe.js";
98
+ import {
99
+ Byline,
100
+ Dialog,
101
+ KeyboardShortcutHint,
102
+ Link,
103
+ ThemedBox_default,
104
+ ThemedText,
105
+ color,
106
+ init_src,
107
+ setClipboard,
108
+ useTheme
109
+ } from "./chunk-cmsknj6n.js";
110
+ import {
111
+ require_jsx_dev_runtime,
112
+ require_react
113
+ } from "./chunk-g338npwr.js";
114
+ import {
115
+ init_analytics,
116
+ logEvent
117
+ } from "./chunk-h0rbjg6x.js";
118
+ import"./chunk-0vkfrmqm.js";
119
+ import"./chunk-0xjaqda8.js";
120
+ import"./chunk-h1mr3371.js";
121
+ import {
122
+ getGithubRepo,
123
+ init_git
124
+ } from "./chunk-36b2q5fg.js";
125
+ import"./chunk-a7rhvq9b.js";
126
+ import"./chunk-qnfx3qtx.js";
127
+ import {
128
+ execFileNoThrow,
129
+ init_execFileNoThrow
130
+ } from "./chunk-m74w3187.js";
131
+ import"./chunk-b81hd3m6.js";
132
+ import {
133
+ init_log,
134
+ logError
135
+ } from "./chunk-y3r7v9pq.js";
136
+ import"./chunk-8tnsngw2.js";
137
+ import"./chunk-awb4vc41.js";
138
+ import"./chunk-cbrt5vsb.js";
139
+ import {
140
+ execa,
141
+ init_execa
142
+ } from "./chunk-5z28bqne.js";
143
+ import {
144
+ figures_default,
145
+ init_figures
146
+ } from "./chunk-qajrkk97.js";
147
+ import"./chunk-404qm8xt.js";
148
+ import"./chunk-fbv4apne.js";
149
+ import"./chunk-jaaxk89e.js";
150
+ import"./chunk-h4b85amj.js";
151
+ import"./chunk-07069jq1.js";
152
+ import"./chunk-vf612n57.js";
153
+ import"./chunk-d4mdda98.js";
154
+ import"./chunk-7wm5s02e.js";
155
+ import"./chunk-4g3v8y12.js";
156
+ import"./chunk-7739pg2c.js";
157
+ import"./chunk-nh3cd07f.js";
158
+ import"./chunk-8pn8tvgg.js";
159
+ import"./chunk-netzwgv1.js";
160
+ import {
161
+ __esm,
162
+ __toESM
163
+ } from "./chunk-qp2qdcda.js";
164
+
165
+ // src/components/WorkflowMultiselectDialog.tsx
166
+ function renderInputGuide(exitState) {
167
+ if (exitState.pending) {
168
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
169
+ children: [
170
+ "Press ",
171
+ exitState.keyName,
172
+ " again to exit"
173
+ ]
174
+ }, undefined, true, undefined, this);
175
+ }
176
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Byline, {
177
+ children: [
178
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
179
+ shortcut: "\u2191\u2193",
180
+ action: "navigate"
181
+ }, undefined, false, undefined, this),
182
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
183
+ shortcut: "Space",
184
+ action: "toggle"
185
+ }, undefined, false, undefined, this),
186
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
187
+ shortcut: "Enter",
188
+ action: "confirm"
189
+ }, undefined, false, undefined, this),
190
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
191
+ action: "confirm:no",
192
+ context: "Confirmation",
193
+ fallback: "Esc",
194
+ description: "cancel"
195
+ }, undefined, false, undefined, this)
196
+ ]
197
+ }, undefined, true, undefined, this);
198
+ }
199
+ function WorkflowMultiselectDialog({
200
+ onSubmit,
201
+ defaultSelections
202
+ }) {
203
+ const [showError, setShowError] = import_react.useState(false);
204
+ const handleSubmit = import_react.useCallback((selectedValues) => {
205
+ if (selectedValues.length === 0) {
206
+ setShowError(true);
207
+ return;
208
+ }
209
+ setShowError(false);
210
+ onSubmit(selectedValues);
211
+ }, [onSubmit]);
212
+ const handleChange = import_react.useCallback(() => {
213
+ setShowError(false);
214
+ }, []);
215
+ const handleCancel = import_react.useCallback(() => {
216
+ setShowError(true);
217
+ }, []);
218
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Dialog, {
219
+ title: "Select GitHub workflows to install",
220
+ subtitle: "We'll create a workflow file in your repository for each one you select.",
221
+ onCancel: handleCancel,
222
+ inputGuide: renderInputGuide,
223
+ children: [
224
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
225
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
226
+ dimColor: true,
227
+ children: [
228
+ "More workflow examples (issue triage, CI fixes, etc.) at:",
229
+ " ",
230
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Link, {
231
+ url: "https://github.com/anthropics/claude-code-action/blob/main/examples/",
232
+ children: "https://github.com/anthropics/claude-code-action/blob/main/examples/"
233
+ }, undefined, false, undefined, this)
234
+ ]
235
+ }, undefined, true, undefined, this)
236
+ }, undefined, false, undefined, this),
237
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(SelectMulti, {
238
+ options: WORKFLOWS.map((workflow) => ({
239
+ label: workflow.label,
240
+ value: workflow.value
241
+ })),
242
+ defaultValue: defaultSelections,
243
+ onSubmit: handleSubmit,
244
+ onChange: handleChange,
245
+ onCancel: handleCancel,
246
+ hideIndexes: true
247
+ }, undefined, false, undefined, this),
248
+ showError && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
249
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
250
+ color: "error",
251
+ children: "You must select at least one workflow to continue"
252
+ }, undefined, false, undefined, this)
253
+ }, undefined, false, undefined, this)
254
+ ]
255
+ }, undefined, true, undefined, this);
256
+ }
257
+ var import_react, jsx_dev_runtime, WORKFLOWS;
258
+ var init_WorkflowMultiselectDialog = __esm(() => {
259
+ init_src();
260
+ init_ConfigurableShortcutHint();
261
+ init_SelectMulti();
262
+ import_react = __toESM(require_react(), 1);
263
+ jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
264
+ WORKFLOWS = [
265
+ {
266
+ value: "claude",
267
+ label: "@Claude Code - Tag @claude in issues and PR comments"
268
+ },
269
+ {
270
+ value: "claude-review",
271
+ label: "Claude Code Review - Automated code review on new PRs"
272
+ }
273
+ ];
274
+ });
275
+
276
+ // src/constants/github-app.ts
277
+ var PR_TITLE = "Add Claude Code GitHub Workflow", GITHUB_ACTION_SETUP_DOCS_URL = "https://github.com/anthropics/claude-code-action/blob/main/docs/setup.md", WORKFLOW_CONTENT = `name: Claude Code
278
+
279
+ on:
280
+ issue_comment:
281
+ types: [created]
282
+ pull_request_review_comment:
283
+ types: [created]
284
+ issues:
285
+ types: [opened, assigned]
286
+ pull_request_review:
287
+ types: [submitted]
288
+
289
+ jobs:
290
+ claude:
291
+ if: |
292
+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
293
+ (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
294
+ (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
295
+ (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
296
+ runs-on: ubuntu-latest
297
+ permissions:
298
+ contents: read
299
+ pull-requests: read
300
+ issues: read
301
+ id-token: write
302
+ actions: read # Required for Claude to read CI results on PRs
303
+ steps:
304
+ - name: Checkout repository
305
+ uses: actions/checkout@v4
306
+ with:
307
+ fetch-depth: 1
308
+
309
+ - name: Run Claude Code
310
+ id: claude
311
+ uses: anthropics/claude-code-action@v1
312
+ with:
313
+ anthropic_api_key: \${{ secrets.ANTHROPIC_API_KEY }}
314
+
315
+ # This is an optional setting that allows Claude to read CI results on PRs
316
+ additional_permissions: |
317
+ actions: read
318
+
319
+ # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
320
+ # prompt: 'Update the pull request description to include a summary of changes.'
321
+
322
+ # Optional: Add claude_args to customize behavior and configuration
323
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
324
+ # or https://code.claude.com/docs/en/cli-reference for available options
325
+ # claude_args: '--allowed-tools Bash(gh pr:*)'
326
+
327
+ `, PR_BODY = `## \uD83E\uDD16 Installing Claude Code GitHub App
328
+
329
+ This PR adds a GitHub Actions workflow that enables Claude Code integration in our repository.
330
+
331
+ ### What is Claude Code?
332
+
333
+ [Claude Code](https://claude.com/claude-code) is an AI coding agent that can help with:
334
+ - Bug fixes and improvements
335
+ - Documentation updates
336
+ - Implementing new features
337
+ - Code reviews and suggestions
338
+ - Writing tests
339
+ - And more!
340
+
341
+ ### How it works
342
+
343
+ Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment.
344
+ Once the workflow is triggered, Claude will analyze the comment and surrounding context, and execute on the request in a GitHub action.
345
+
346
+ ### Important Notes
347
+
348
+ - **This workflow won't take effect until this PR is merged**
349
+ - **@claude mentions won't work until after the merge is complete**
350
+ - The workflow runs automatically whenever Claude is mentioned in PR or issue comments
351
+ - Claude gets access to the entire PR or issue context including files, diffs, and previous comments
352
+
353
+ ### Security
354
+
355
+ - Our Anthropic API key is securely stored as a GitHub Actions secret
356
+ - Only users with write access to the repository can trigger the workflow
357
+ - All Claude runs are stored in the GitHub Actions run history
358
+ - Claude's default tools are limited to reading/writing files and interacting with our repo by creating comments, branches, and commits.
359
+ - We can add more allowed tools by adding them to the workflow file like:
360
+
361
+ \`\`\`
362
+ allowed_tools: Bash(npm install),Bash(npm run build),Bash(npm run lint),Bash(npm run test)
363
+ \`\`\`
364
+
365
+ There's more information in the [Claude Code action repo](https://github.com/anthropics/claude-code-action).
366
+
367
+ After merging this PR, let's try mentioning @claude in a comment on any PR to get started!`, CODE_REVIEW_PLUGIN_WORKFLOW_CONTENT = `name: Claude Code Review
368
+
369
+ on:
370
+ pull_request:
371
+ types: [opened, synchronize, ready_for_review, reopened]
372
+ # Optional: Only run on specific file changes
373
+ # paths:
374
+ # - "src/**/*.ts"
375
+ # - "src/**/*.tsx"
376
+ # - "src/**/*.js"
377
+ # - "src/**/*.jsx"
378
+
379
+ jobs:
380
+ claude-review:
381
+ # Optional: Filter by PR author
382
+ # if: |
383
+ # github.event.pull_request.user.login == 'external-contributor' ||
384
+ # github.event.pull_request.user.login == 'new-developer' ||
385
+ # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
386
+
387
+ runs-on: ubuntu-latest
388
+ permissions:
389
+ contents: read
390
+ pull-requests: read
391
+ issues: read
392
+ id-token: write
393
+
394
+ steps:
395
+ - name: Checkout repository
396
+ uses: actions/checkout@v4
397
+ with:
398
+ fetch-depth: 1
399
+
400
+ - name: Run Claude Code Review
401
+ id: claude-review
402
+ uses: anthropics/claude-code-action@v1
403
+ with:
404
+ anthropic_api_key: \${{ secrets.ANTHROPIC_API_KEY }}
405
+ plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
406
+ plugins: 'code-review@claude-code-plugins'
407
+ prompt: '/code-review:code-review \${{ github.repository }}/pull/\${{ github.event.pull_request.number }}'
408
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
409
+ # or https://code.claude.com/docs/en/cli-reference for available options
410
+
411
+ `;
412
+ var init_github_app = () => {};
413
+
414
+ // src/commands/install-github-app/ApiKeyStep.tsx
415
+ function ApiKeyStep({
416
+ existingApiKey,
417
+ apiKeyOrOAuthToken,
418
+ onApiKeyChange,
419
+ onSubmit,
420
+ onToggleUseExistingKey,
421
+ onCreateOAuthToken,
422
+ selectedOption = existingApiKey ? "existing" : onCreateOAuthToken ? "oauth" : "new",
423
+ onSelectOption
424
+ }) {
425
+ const [cursorOffset, setCursorOffset] = import_react2.useState(0);
426
+ const terminalSize = useTerminalSize();
427
+ const [theme] = useTheme();
428
+ const handlePrevious = import_react2.useCallback(() => {
429
+ if (selectedOption === "new" && onCreateOAuthToken) {
430
+ onSelectOption?.("oauth");
431
+ } else if (selectedOption === "oauth" && existingApiKey) {
432
+ onSelectOption?.("existing");
433
+ onToggleUseExistingKey(true);
434
+ }
435
+ }, [
436
+ selectedOption,
437
+ onCreateOAuthToken,
438
+ existingApiKey,
439
+ onSelectOption,
440
+ onToggleUseExistingKey
441
+ ]);
442
+ const handleNext = import_react2.useCallback(() => {
443
+ if (selectedOption === "existing") {
444
+ onSelectOption?.(onCreateOAuthToken ? "oauth" : "new");
445
+ onToggleUseExistingKey(false);
446
+ } else if (selectedOption === "oauth") {
447
+ onSelectOption?.("new");
448
+ }
449
+ }, [
450
+ selectedOption,
451
+ onCreateOAuthToken,
452
+ onSelectOption,
453
+ onToggleUseExistingKey
454
+ ]);
455
+ const handleConfirm = import_react2.useCallback(() => {
456
+ if (selectedOption === "oauth" && onCreateOAuthToken) {
457
+ onCreateOAuthToken();
458
+ } else {
459
+ onSubmit();
460
+ }
461
+ }, [selectedOption, onCreateOAuthToken, onSubmit]);
462
+ const isTextInputVisible = selectedOption === "new";
463
+ useKeybindings({
464
+ "confirm:previous": handlePrevious,
465
+ "confirm:next": handleNext,
466
+ "confirm:yes": handleConfirm
467
+ }, { context: "Confirmation", isActive: !isTextInputVisible });
468
+ useKeybindings({
469
+ "confirm:previous": handlePrevious,
470
+ "confirm:next": handleNext
471
+ }, { context: "Confirmation", isActive: isTextInputVisible });
472
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
473
+ children: [
474
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
475
+ flexDirection: "column",
476
+ borderStyle: "round",
477
+ paddingX: 1,
478
+ children: [
479
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
480
+ flexDirection: "column",
481
+ marginBottom: 1,
482
+ children: [
483
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
484
+ bold: true,
485
+ children: "Install GitHub App"
486
+ }, undefined, false, undefined, this),
487
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
488
+ dimColor: true,
489
+ children: "Choose API key"
490
+ }, undefined, false, undefined, this)
491
+ ]
492
+ }, undefined, true, undefined, this),
493
+ existingApiKey && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
494
+ marginBottom: 1,
495
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
496
+ children: [
497
+ selectedOption === "existing" ? color("success", theme)("> ") : " ",
498
+ "Use your existing Claude Code API key"
499
+ ]
500
+ }, undefined, true, undefined, this)
501
+ }, undefined, false, undefined, this),
502
+ onCreateOAuthToken && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
503
+ marginBottom: 1,
504
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
505
+ children: [
506
+ selectedOption === "oauth" ? color("success", theme)("> ") : " ",
507
+ "Create a long-lived token with your Claude subscription"
508
+ ]
509
+ }, undefined, true, undefined, this)
510
+ }, undefined, false, undefined, this),
511
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
512
+ marginBottom: 1,
513
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
514
+ children: [
515
+ selectedOption === "new" ? color("success", theme)("> ") : " ",
516
+ "Enter a new API key"
517
+ ]
518
+ }, undefined, true, undefined, this)
519
+ }, undefined, false, undefined, this),
520
+ selectedOption === "new" && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(TextInput, {
521
+ value: apiKeyOrOAuthToken,
522
+ onChange: onApiKeyChange,
523
+ onSubmit,
524
+ onPaste: onApiKeyChange,
525
+ focus: true,
526
+ placeholder: "sk-ant\u2026 (Create a new key at https://platform.claude.com/settings/keys)",
527
+ mask: "*",
528
+ columns: terminalSize.columns,
529
+ cursorOffset,
530
+ onChangeCursorOffset: setCursorOffset,
531
+ showCursor: true
532
+ }, undefined, false, undefined, this)
533
+ ]
534
+ }, undefined, true, undefined, this),
535
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
536
+ marginLeft: 3,
537
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
538
+ dimColor: true,
539
+ children: "\u2191/\u2193 to select \xB7 Enter to continue"
540
+ }, undefined, false, undefined, this)
541
+ }, undefined, false, undefined, this)
542
+ ]
543
+ }, undefined, true, undefined, this);
544
+ }
545
+ var import_react2, jsx_dev_runtime2;
546
+ var init_ApiKeyStep = __esm(() => {
547
+ init_TextInput();
548
+ init_useTerminalSize();
549
+ init_src();
550
+ init_useKeybinding();
551
+ import_react2 = __toESM(require_react(), 1);
552
+ jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
553
+ });
554
+
555
+ // src/commands/install-github-app/CheckExistingSecretStep.tsx
556
+ function CheckExistingSecretStep({
557
+ useExistingSecret,
558
+ secretName,
559
+ onToggleUseExistingSecret,
560
+ onSecretNameChange,
561
+ onSubmit
562
+ }) {
563
+ const [cursorOffset, setCursorOffset] = import_react3.useState(0);
564
+ const terminalSize = useTerminalSize();
565
+ const [theme] = useTheme();
566
+ const handlePrevious = import_react3.useCallback(() => onToggleUseExistingSecret(true), [onToggleUseExistingSecret]);
567
+ const handleNext = import_react3.useCallback(() => onToggleUseExistingSecret(false), [onToggleUseExistingSecret]);
568
+ useKeybindings({
569
+ "confirm:previous": handlePrevious,
570
+ "confirm:next": handleNext,
571
+ "confirm:yes": onSubmit
572
+ }, { context: "Confirmation", isActive: useExistingSecret });
573
+ useKeybindings({
574
+ "confirm:previous": handlePrevious,
575
+ "confirm:next": handleNext
576
+ }, { context: "Confirmation", isActive: !useExistingSecret });
577
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
578
+ children: [
579
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
580
+ flexDirection: "column",
581
+ borderStyle: "round",
582
+ paddingX: 1,
583
+ children: [
584
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
585
+ flexDirection: "column",
586
+ marginBottom: 1,
587
+ children: [
588
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
589
+ bold: true,
590
+ children: "Install GitHub App"
591
+ }, undefined, false, undefined, this),
592
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
593
+ dimColor: true,
594
+ children: "Setup API key secret"
595
+ }, undefined, false, undefined, this)
596
+ ]
597
+ }, undefined, true, undefined, this),
598
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
599
+ marginBottom: 1,
600
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
601
+ color: "warning",
602
+ children: "ANTHROPIC_API_KEY already exists in repository secrets!"
603
+ }, undefined, false, undefined, this)
604
+ }, undefined, false, undefined, this),
605
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
606
+ marginBottom: 1,
607
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
608
+ children: "Would you like to:"
609
+ }, undefined, false, undefined, this)
610
+ }, undefined, false, undefined, this),
611
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
612
+ marginBottom: 1,
613
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
614
+ children: [
615
+ useExistingSecret ? color("success", theme)("> ") : " ",
616
+ "Use the existing API key"
617
+ ]
618
+ }, undefined, true, undefined, this)
619
+ }, undefined, false, undefined, this),
620
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
621
+ marginBottom: 1,
622
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
623
+ children: [
624
+ !useExistingSecret ? color("success", theme)("> ") : " ",
625
+ "Create a new secret with a different name"
626
+ ]
627
+ }, undefined, true, undefined, this)
628
+ }, undefined, false, undefined, this),
629
+ !useExistingSecret && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
630
+ children: [
631
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
632
+ marginBottom: 1,
633
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
634
+ children: "Enter new secret name (alphanumeric with underscores):"
635
+ }, undefined, false, undefined, this)
636
+ }, undefined, false, undefined, this),
637
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(TextInput, {
638
+ value: secretName,
639
+ onChange: onSecretNameChange,
640
+ onSubmit,
641
+ focus: true,
642
+ placeholder: "e.g., CLAUDE_API_KEY",
643
+ columns: terminalSize.columns,
644
+ cursorOffset,
645
+ onChangeCursorOffset: setCursorOffset,
646
+ showCursor: true
647
+ }, undefined, false, undefined, this)
648
+ ]
649
+ }, undefined, true, undefined, this)
650
+ ]
651
+ }, undefined, true, undefined, this),
652
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
653
+ marginLeft: 3,
654
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
655
+ dimColor: true,
656
+ children: "\u2191/\u2193 to select \xB7 Enter to continue"
657
+ }, undefined, false, undefined, this)
658
+ }, undefined, false, undefined, this)
659
+ ]
660
+ }, undefined, true, undefined, this);
661
+ }
662
+ var import_react3, jsx_dev_runtime3;
663
+ var init_CheckExistingSecretStep = __esm(() => {
664
+ init_TextInput();
665
+ init_useTerminalSize();
666
+ init_src();
667
+ init_useKeybinding();
668
+ import_react3 = __toESM(require_react(), 1);
669
+ jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
670
+ });
671
+
672
+ // src/commands/install-github-app/CheckGitHubStep.tsx
673
+ function CheckGitHubStep() {
674
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
675
+ children: "Checking GitHub CLI installation\u2026"
676
+ }, undefined, false, undefined, this);
677
+ }
678
+ var jsx_dev_runtime4;
679
+ var init_CheckGitHubStep = __esm(() => {
680
+ init_src();
681
+ jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
682
+ });
683
+
684
+ // src/commands/install-github-app/ChooseRepoStep.tsx
685
+ function ChooseRepoStep({
686
+ currentRepo,
687
+ useCurrentRepo,
688
+ repoUrl,
689
+ onRepoUrlChange,
690
+ onSubmit,
691
+ onToggleUseCurrentRepo
692
+ }) {
693
+ const [cursorOffset, setCursorOffset] = import_react4.useState(0);
694
+ const [showEmptyError, setShowEmptyError] = import_react4.useState(false);
695
+ const terminalSize = useTerminalSize();
696
+ const textInputColumns = terminalSize.columns;
697
+ const handleSubmit = import_react4.useCallback(() => {
698
+ const repoName = useCurrentRepo ? currentRepo : repoUrl;
699
+ if (!repoName?.trim()) {
700
+ setShowEmptyError(true);
701
+ return;
702
+ }
703
+ onSubmit();
704
+ }, [useCurrentRepo, currentRepo, repoUrl, onSubmit]);
705
+ const isTextInputVisible = !useCurrentRepo || !currentRepo;
706
+ const handlePrevious = import_react4.useCallback(() => {
707
+ onToggleUseCurrentRepo(true);
708
+ setShowEmptyError(false);
709
+ }, [onToggleUseCurrentRepo]);
710
+ const handleNext = import_react4.useCallback(() => {
711
+ onToggleUseCurrentRepo(false);
712
+ setShowEmptyError(false);
713
+ }, [onToggleUseCurrentRepo]);
714
+ useKeybindings({
715
+ "confirm:previous": handlePrevious,
716
+ "confirm:next": handleNext,
717
+ "confirm:yes": handleSubmit
718
+ }, { context: "Confirmation", isActive: !isTextInputVisible });
719
+ useKeybindings({
720
+ "confirm:previous": handlePrevious,
721
+ "confirm:next": handleNext
722
+ }, { context: "Confirmation", isActive: isTextInputVisible });
723
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
724
+ children: [
725
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
726
+ flexDirection: "column",
727
+ borderStyle: "round",
728
+ paddingX: 1,
729
+ children: [
730
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
731
+ flexDirection: "column",
732
+ marginBottom: 1,
733
+ children: [
734
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
735
+ bold: true,
736
+ children: "Install GitHub App"
737
+ }, undefined, false, undefined, this),
738
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
739
+ dimColor: true,
740
+ children: "Select GitHub repository"
741
+ }, undefined, false, undefined, this)
742
+ ]
743
+ }, undefined, true, undefined, this),
744
+ currentRepo && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
745
+ marginBottom: 1,
746
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
747
+ bold: useCurrentRepo,
748
+ color: useCurrentRepo ? "permission" : undefined,
749
+ children: [
750
+ useCurrentRepo ? "> " : " ",
751
+ "Use current repository: ",
752
+ currentRepo
753
+ ]
754
+ }, undefined, true, undefined, this)
755
+ }, undefined, false, undefined, this),
756
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
757
+ marginBottom: 1,
758
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
759
+ bold: !useCurrentRepo || !currentRepo,
760
+ color: !useCurrentRepo || !currentRepo ? "permission" : undefined,
761
+ children: [
762
+ !useCurrentRepo || !currentRepo ? "> " : " ",
763
+ currentRepo ? "Enter a different repository" : "Enter repository"
764
+ ]
765
+ }, undefined, true, undefined, this)
766
+ }, undefined, false, undefined, this),
767
+ (!useCurrentRepo || !currentRepo) && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
768
+ marginLeft: 2,
769
+ marginBottom: 1,
770
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TextInput, {
771
+ value: repoUrl,
772
+ onChange: (value) => {
773
+ onRepoUrlChange(value);
774
+ setShowEmptyError(false);
775
+ },
776
+ onSubmit: handleSubmit,
777
+ focus: true,
778
+ placeholder: "Enter a repo as owner/repo or https://github.com/owner/repo\u2026",
779
+ columns: textInputColumns,
780
+ cursorOffset,
781
+ onChangeCursorOffset: setCursorOffset,
782
+ showCursor: true
783
+ }, undefined, false, undefined, this)
784
+ }, undefined, false, undefined, this)
785
+ ]
786
+ }, undefined, true, undefined, this),
787
+ showEmptyError && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
788
+ marginLeft: 3,
789
+ marginBottom: 1,
790
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
791
+ color: "error",
792
+ children: "Please enter a repository name to continue"
793
+ }, undefined, false, undefined, this)
794
+ }, undefined, false, undefined, this),
795
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
796
+ marginLeft: 3,
797
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
798
+ dimColor: true,
799
+ children: [
800
+ currentRepo ? "\u2191/\u2193 to select \xB7 " : "",
801
+ "Enter to continue"
802
+ ]
803
+ }, undefined, true, undefined, this)
804
+ }, undefined, false, undefined, this)
805
+ ]
806
+ }, undefined, true, undefined, this);
807
+ }
808
+ var import_react4, jsx_dev_runtime5;
809
+ var init_ChooseRepoStep = __esm(() => {
810
+ init_TextInput();
811
+ init_useTerminalSize();
812
+ init_src();
813
+ init_useKeybinding();
814
+ import_react4 = __toESM(require_react(), 1);
815
+ jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
816
+ });
817
+
818
+ // src/commands/install-github-app/CreatingStep.tsx
819
+ function CreatingStep({
820
+ currentWorkflowInstallStep,
821
+ secretExists,
822
+ useExistingSecret,
823
+ secretName,
824
+ skipWorkflow = false,
825
+ selectedWorkflows
826
+ }) {
827
+ const progressSteps = skipWorkflow ? [
828
+ "Getting repository information",
829
+ secretExists && useExistingSecret ? "Using existing API key secret" : `Setting up ${secretName} secret`
830
+ ] : [
831
+ "Getting repository information",
832
+ "Creating branch",
833
+ selectedWorkflows.length > 1 ? "Creating workflow files" : "Creating workflow file",
834
+ secretExists && useExistingSecret ? "Using existing API key secret" : `Setting up ${secretName} secret`,
835
+ "Opening pull request page"
836
+ ];
837
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
838
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
839
+ flexDirection: "column",
840
+ borderStyle: "round",
841
+ paddingX: 1,
842
+ children: [
843
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
844
+ flexDirection: "column",
845
+ marginBottom: 1,
846
+ children: [
847
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
848
+ bold: true,
849
+ children: "Install GitHub App"
850
+ }, undefined, false, undefined, this),
851
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
852
+ dimColor: true,
853
+ children: "Create GitHub Actions workflow"
854
+ }, undefined, false, undefined, this)
855
+ ]
856
+ }, undefined, true, undefined, this),
857
+ progressSteps.map((stepText, index) => {
858
+ let status = "pending";
859
+ if (index < currentWorkflowInstallStep) {
860
+ status = "completed";
861
+ } else if (index === currentWorkflowInstallStep) {
862
+ status = "in-progress";
863
+ }
864
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
865
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
866
+ color: status === "completed" ? "success" : status === "in-progress" ? "warning" : undefined,
867
+ children: [
868
+ status === "completed" ? "\u2713 " : "",
869
+ stepText,
870
+ status === "in-progress" ? "\u2026" : ""
871
+ ]
872
+ }, undefined, true, undefined, this)
873
+ }, index, false, undefined, this);
874
+ })
875
+ ]
876
+ }, undefined, true, undefined, this)
877
+ }, undefined, false, undefined, this);
878
+ }
879
+ var jsx_dev_runtime6;
880
+ var init_CreatingStep = __esm(() => {
881
+ init_src();
882
+ jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
883
+ });
884
+
885
+ // src/commands/install-github-app/ErrorStep.tsx
886
+ function ErrorStep({
887
+ error,
888
+ errorReason,
889
+ errorInstructions
890
+ }) {
891
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
892
+ children: [
893
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
894
+ flexDirection: "column",
895
+ borderStyle: "round",
896
+ paddingX: 1,
897
+ children: [
898
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
899
+ flexDirection: "column",
900
+ marginBottom: 1,
901
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
902
+ bold: true,
903
+ children: "Install GitHub App"
904
+ }, undefined, false, undefined, this)
905
+ }, undefined, false, undefined, this),
906
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
907
+ color: "error",
908
+ children: [
909
+ "Error: ",
910
+ error
911
+ ]
912
+ }, undefined, true, undefined, this),
913
+ errorReason && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
914
+ marginTop: 1,
915
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
916
+ dimColor: true,
917
+ children: [
918
+ "Reason: ",
919
+ errorReason
920
+ ]
921
+ }, undefined, true, undefined, this)
922
+ }, undefined, false, undefined, this),
923
+ errorInstructions && errorInstructions.length > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
924
+ flexDirection: "column",
925
+ marginTop: 1,
926
+ children: [
927
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
928
+ dimColor: true,
929
+ children: "How to fix:"
930
+ }, undefined, false, undefined, this),
931
+ errorInstructions.map((instruction, index) => /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
932
+ marginLeft: 2,
933
+ children: [
934
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
935
+ dimColor: true,
936
+ children: "\u2022 "
937
+ }, undefined, false, undefined, this),
938
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
939
+ children: instruction
940
+ }, undefined, false, undefined, this)
941
+ ]
942
+ }, index, true, undefined, this))
943
+ ]
944
+ }, undefined, true, undefined, this),
945
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
946
+ marginTop: 1,
947
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
948
+ dimColor: true,
949
+ children: [
950
+ "For manual setup instructions, see:",
951
+ " ",
952
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
953
+ color: "claude",
954
+ children: GITHUB_ACTION_SETUP_DOCS_URL
955
+ }, undefined, false, undefined, this)
956
+ ]
957
+ }, undefined, true, undefined, this)
958
+ }, undefined, false, undefined, this)
959
+ ]
960
+ }, undefined, true, undefined, this),
961
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
962
+ marginLeft: 3,
963
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
964
+ dimColor: true,
965
+ children: "Press any key to exit"
966
+ }, undefined, false, undefined, this)
967
+ }, undefined, false, undefined, this)
968
+ ]
969
+ }, undefined, true, undefined, this);
970
+ }
971
+ var jsx_dev_runtime7;
972
+ var init_ErrorStep = __esm(() => {
973
+ init_github_app();
974
+ init_src();
975
+ jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
976
+ });
977
+
978
+ // src/commands/install-github-app/ExistingWorkflowStep.tsx
979
+ function ExistingWorkflowStep({
980
+ repoName,
981
+ onSelectAction
982
+ }) {
983
+ const options = [
984
+ {
985
+ label: "Update workflow file with latest version",
986
+ value: "update"
987
+ },
988
+ {
989
+ label: "Skip workflow update (configure secrets only)",
990
+ value: "skip"
991
+ },
992
+ {
993
+ label: "Exit without making changes",
994
+ value: "exit"
995
+ }
996
+ ];
997
+ const handleSelect = (value) => {
998
+ onSelectAction(value);
999
+ };
1000
+ const handleCancel = () => {
1001
+ onSelectAction("exit");
1002
+ };
1003
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1004
+ flexDirection: "column",
1005
+ borderStyle: "round",
1006
+ borderDimColor: true,
1007
+ paddingX: 1,
1008
+ children: [
1009
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1010
+ flexDirection: "column",
1011
+ marginBottom: 1,
1012
+ children: [
1013
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1014
+ bold: true,
1015
+ children: "Existing Workflow Found"
1016
+ }, undefined, false, undefined, this),
1017
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1018
+ dimColor: true,
1019
+ children: [
1020
+ "Repository: ",
1021
+ repoName
1022
+ ]
1023
+ }, undefined, true, undefined, this)
1024
+ ]
1025
+ }, undefined, true, undefined, this),
1026
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1027
+ flexDirection: "column",
1028
+ marginBottom: 1,
1029
+ children: [
1030
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1031
+ children: [
1032
+ "A Claude workflow file already exists at",
1033
+ " ",
1034
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1035
+ color: "claude",
1036
+ children: ".github/workflows/claude.yml"
1037
+ }, undefined, false, undefined, this)
1038
+ ]
1039
+ }, undefined, true, undefined, this),
1040
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1041
+ dimColor: true,
1042
+ children: "What would you like to do?"
1043
+ }, undefined, false, undefined, this)
1044
+ ]
1045
+ }, undefined, true, undefined, this),
1046
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1047
+ flexDirection: "column",
1048
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Select, {
1049
+ options,
1050
+ onChange: handleSelect,
1051
+ onCancel: handleCancel
1052
+ }, undefined, false, undefined, this)
1053
+ }, undefined, false, undefined, this),
1054
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1055
+ marginTop: 1,
1056
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1057
+ dimColor: true,
1058
+ children: [
1059
+ "View the latest workflow template at:",
1060
+ " ",
1061
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1062
+ color: "claude",
1063
+ children: "https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml"
1064
+ }, undefined, false, undefined, this)
1065
+ ]
1066
+ }, undefined, true, undefined, this)
1067
+ }, undefined, false, undefined, this)
1068
+ ]
1069
+ }, undefined, true, undefined, this);
1070
+ }
1071
+ var jsx_dev_runtime8;
1072
+ var init_ExistingWorkflowStep = __esm(() => {
1073
+ init_CustomSelect();
1074
+ init_src();
1075
+ jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
1076
+ });
1077
+
1078
+ // src/commands/install-github-app/InstallAppStep.tsx
1079
+ function InstallAppStep({ repoUrl, onSubmit }) {
1080
+ useKeybinding("confirm:yes", onSubmit, { context: "Confirmation" });
1081
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1082
+ flexDirection: "column",
1083
+ borderStyle: "round",
1084
+ borderDimColor: true,
1085
+ paddingX: 1,
1086
+ children: [
1087
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1088
+ flexDirection: "column",
1089
+ marginBottom: 1,
1090
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1091
+ bold: true,
1092
+ children: "Install the Claude GitHub App"
1093
+ }, undefined, false, undefined, this)
1094
+ }, undefined, false, undefined, this),
1095
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1096
+ marginBottom: 1,
1097
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1098
+ children: "Opening browser to install the Claude GitHub App\u2026"
1099
+ }, undefined, false, undefined, this)
1100
+ }, undefined, false, undefined, this),
1101
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1102
+ marginBottom: 1,
1103
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1104
+ children: "If your browser doesn't open automatically, visit:"
1105
+ }, undefined, false, undefined, this)
1106
+ }, undefined, false, undefined, this),
1107
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1108
+ marginBottom: 1,
1109
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1110
+ underline: true,
1111
+ children: "https://github.com/apps/claude"
1112
+ }, undefined, false, undefined, this)
1113
+ }, undefined, false, undefined, this),
1114
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1115
+ marginBottom: 1,
1116
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1117
+ children: [
1118
+ "Please install the app for repository: ",
1119
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1120
+ bold: true,
1121
+ children: repoUrl
1122
+ }, undefined, false, undefined, this)
1123
+ ]
1124
+ }, undefined, true, undefined, this)
1125
+ }, undefined, false, undefined, this),
1126
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1127
+ marginBottom: 1,
1128
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1129
+ dimColor: true,
1130
+ children: "Important: Make sure to grant access to this specific repository"
1131
+ }, undefined, false, undefined, this)
1132
+ }, undefined, false, undefined, this),
1133
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1134
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1135
+ bold: true,
1136
+ color: "permission",
1137
+ children: [
1138
+ "Press Enter once you've installed the app",
1139
+ figures_default.ellipsis
1140
+ ]
1141
+ }, undefined, true, undefined, this)
1142
+ }, undefined, false, undefined, this),
1143
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1144
+ marginTop: 1,
1145
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1146
+ dimColor: true,
1147
+ children: [
1148
+ "Having trouble? See manual setup instructions at:",
1149
+ " ",
1150
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1151
+ color: "claude",
1152
+ children: GITHUB_ACTION_SETUP_DOCS_URL
1153
+ }, undefined, false, undefined, this)
1154
+ ]
1155
+ }, undefined, true, undefined, this)
1156
+ }, undefined, false, undefined, this)
1157
+ ]
1158
+ }, undefined, true, undefined, this);
1159
+ }
1160
+ var jsx_dev_runtime9;
1161
+ var init_InstallAppStep = __esm(() => {
1162
+ init_figures();
1163
+ init_github_app();
1164
+ init_src();
1165
+ init_useKeybinding();
1166
+ jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
1167
+ });
1168
+
1169
+ // src/commands/install-github-app/OAuthFlowStep.tsx
1170
+ function OAuthFlowStep({
1171
+ onSuccess,
1172
+ onCancel
1173
+ }) {
1174
+ const [oauthStatus, setOAuthStatus] = import_react5.useState({
1175
+ state: "starting"
1176
+ });
1177
+ const [oauthService] = import_react5.useState(() => new OAuthService);
1178
+ const [pastedCode, setPastedCode] = import_react5.useState("");
1179
+ const [cursorOffset, setCursorOffset] = import_react5.useState(0);
1180
+ const [showPastePrompt, setShowPastePrompt] = import_react5.useState(false);
1181
+ const [urlCopied, setUrlCopied] = import_react5.useState(false);
1182
+ const timersRef = import_react5.useRef(new Set);
1183
+ const urlCopiedTimerRef = import_react5.useRef(undefined);
1184
+ const terminalSize = useTerminalSize();
1185
+ const textInputColumns = Math.max(50, terminalSize.columns - PASTE_HERE_MSG.length - 4);
1186
+ function handleKeyDown(e) {
1187
+ if (oauthStatus.state !== "error")
1188
+ return;
1189
+ e.preventDefault();
1190
+ if (e.key === "return" && oauthStatus.toRetry) {
1191
+ setPastedCode("");
1192
+ setCursorOffset(0);
1193
+ setOAuthStatus({
1194
+ state: "about_to_retry",
1195
+ nextState: oauthStatus.toRetry
1196
+ });
1197
+ } else {
1198
+ onCancel();
1199
+ }
1200
+ }
1201
+ async function handleSubmitCode(value, url) {
1202
+ try {
1203
+ const [authorizationCode, state] = value.split("#");
1204
+ if (!authorizationCode || !state) {
1205
+ setOAuthStatus({
1206
+ state: "error",
1207
+ message: "Invalid code. Please make sure the full code was copied",
1208
+ toRetry: { state: "waiting_for_login", url }
1209
+ });
1210
+ return;
1211
+ }
1212
+ logEvent("tengu_oauth_manual_entry", {});
1213
+ oauthService.handleManualAuthCodeInput({
1214
+ authorizationCode,
1215
+ state
1216
+ });
1217
+ } catch (err) {
1218
+ logError(err);
1219
+ setOAuthStatus({
1220
+ state: "error",
1221
+ message: err.message,
1222
+ toRetry: { state: "waiting_for_login", url }
1223
+ });
1224
+ }
1225
+ }
1226
+ const startOAuth = import_react5.useCallback(async () => {
1227
+ timersRef.current.forEach((timer) => clearTimeout(timer));
1228
+ timersRef.current.clear();
1229
+ try {
1230
+ const result = await oauthService.startOAuthFlow(async (url) => {
1231
+ setOAuthStatus({ state: "waiting_for_login", url });
1232
+ const timer = setTimeout(setShowPastePrompt, 3000, true);
1233
+ timersRef.current.add(timer);
1234
+ }, {
1235
+ loginWithClaudeAi: true,
1236
+ inferenceOnly: true,
1237
+ expiresIn: 365 * 24 * 60 * 60
1238
+ });
1239
+ setOAuthStatus({ state: "processing" });
1240
+ saveOAuthTokensIfNeeded(result);
1241
+ const timer1 = setTimeout((setOAuthStatus2, accessToken, onSuccess2, timersRef2) => {
1242
+ setOAuthStatus2({ state: "success", token: accessToken });
1243
+ const timer2 = setTimeout(onSuccess2, 1000, accessToken);
1244
+ timersRef2.current.add(timer2);
1245
+ }, 100, setOAuthStatus, result.accessToken, onSuccess, timersRef);
1246
+ timersRef.current.add(timer1);
1247
+ } catch (err) {
1248
+ const errorMessage = err.message;
1249
+ setOAuthStatus({
1250
+ state: "error",
1251
+ message: errorMessage,
1252
+ toRetry: { state: "starting" }
1253
+ });
1254
+ logError(err);
1255
+ logEvent("tengu_oauth_error", {
1256
+ error: errorMessage
1257
+ });
1258
+ }
1259
+ }, [oauthService, onSuccess]);
1260
+ import_react5.useEffect(() => {
1261
+ if (oauthStatus.state === "starting") {
1262
+ startOAuth();
1263
+ }
1264
+ }, [oauthStatus.state, startOAuth]);
1265
+ import_react5.useEffect(() => {
1266
+ if (oauthStatus.state === "about_to_retry") {
1267
+ const timer = setTimeout((nextState, setShowPastePrompt2, setOAuthStatus2) => {
1268
+ setShowPastePrompt2(nextState.state === "waiting_for_login");
1269
+ setOAuthStatus2(nextState);
1270
+ }, 500, oauthStatus.nextState, setShowPastePrompt, setOAuthStatus);
1271
+ timersRef.current.add(timer);
1272
+ }
1273
+ }, [oauthStatus]);
1274
+ import_react5.useEffect(() => {
1275
+ if (pastedCode === "c" && oauthStatus.state === "waiting_for_login" && showPastePrompt && !urlCopied) {
1276
+ setClipboard(oauthStatus.url).then((raw) => {
1277
+ if (raw)
1278
+ process.stdout.write(raw);
1279
+ setUrlCopied(true);
1280
+ clearTimeout(urlCopiedTimerRef.current);
1281
+ urlCopiedTimerRef.current = setTimeout(setUrlCopied, 2000, false);
1282
+ });
1283
+ setPastedCode("");
1284
+ }
1285
+ }, [pastedCode, oauthStatus, showPastePrompt, urlCopied]);
1286
+ import_react5.useEffect(() => {
1287
+ const timers = timersRef.current;
1288
+ return () => {
1289
+ oauthService.cleanup();
1290
+ timers.forEach((timer) => clearTimeout(timer));
1291
+ timers.clear();
1292
+ clearTimeout(urlCopiedTimerRef.current);
1293
+ };
1294
+ }, [oauthService]);
1295
+ function renderStatusMessage() {
1296
+ switch (oauthStatus.state) {
1297
+ case "starting":
1298
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1299
+ children: [
1300
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner, {}, undefined, false, undefined, this),
1301
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1302
+ children: "Starting authentication\u2026"
1303
+ }, undefined, false, undefined, this)
1304
+ ]
1305
+ }, undefined, true, undefined, this);
1306
+ case "waiting_for_login":
1307
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1308
+ flexDirection: "column",
1309
+ gap: 1,
1310
+ children: [
1311
+ !showPastePrompt && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1312
+ children: [
1313
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner, {}, undefined, false, undefined, this),
1314
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1315
+ children: "Opening browser to sign in with your Claude account\u2026"
1316
+ }, undefined, false, undefined, this)
1317
+ ]
1318
+ }, undefined, true, undefined, this),
1319
+ showPastePrompt && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1320
+ children: [
1321
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1322
+ children: PASTE_HERE_MSG
1323
+ }, undefined, false, undefined, this),
1324
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(TextInput, {
1325
+ value: pastedCode,
1326
+ onChange: setPastedCode,
1327
+ onSubmit: (value) => handleSubmitCode(value, oauthStatus.url),
1328
+ cursorOffset,
1329
+ onChangeCursorOffset: setCursorOffset,
1330
+ columns: textInputColumns
1331
+ }, undefined, false, undefined, this)
1332
+ ]
1333
+ }, undefined, true, undefined, this)
1334
+ ]
1335
+ }, undefined, true, undefined, this);
1336
+ case "processing":
1337
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1338
+ children: [
1339
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner, {}, undefined, false, undefined, this),
1340
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1341
+ children: "Processing authentication\u2026"
1342
+ }, undefined, false, undefined, this)
1343
+ ]
1344
+ }, undefined, true, undefined, this);
1345
+ case "success":
1346
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1347
+ flexDirection: "column",
1348
+ gap: 1,
1349
+ children: [
1350
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1351
+ color: "success",
1352
+ children: "\u2713 Authentication token created successfully!"
1353
+ }, undefined, false, undefined, this),
1354
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1355
+ dimColor: true,
1356
+ children: "Using token for GitHub Actions setup\u2026"
1357
+ }, undefined, false, undefined, this)
1358
+ ]
1359
+ }, undefined, true, undefined, this);
1360
+ case "error":
1361
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1362
+ flexDirection: "column",
1363
+ gap: 1,
1364
+ children: [
1365
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1366
+ color: "error",
1367
+ children: [
1368
+ "OAuth error: ",
1369
+ oauthStatus.message
1370
+ ]
1371
+ }, undefined, true, undefined, this),
1372
+ oauthStatus.toRetry ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1373
+ dimColor: true,
1374
+ children: "Press Enter to try again, or any other key to cancel"
1375
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1376
+ dimColor: true,
1377
+ children: "Press any key to return to API key selection"
1378
+ }, undefined, false, undefined, this)
1379
+ ]
1380
+ }, undefined, true, undefined, this);
1381
+ case "about_to_retry":
1382
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1383
+ flexDirection: "column",
1384
+ gap: 1,
1385
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1386
+ color: "permission",
1387
+ children: "Retrying\u2026"
1388
+ }, undefined, false, undefined, this)
1389
+ }, undefined, false, undefined, this);
1390
+ default:
1391
+ return null;
1392
+ }
1393
+ }
1394
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1395
+ flexDirection: "column",
1396
+ gap: 1,
1397
+ tabIndex: 0,
1398
+ autoFocus: true,
1399
+ onKeyDown: handleKeyDown,
1400
+ children: [
1401
+ oauthStatus.state === "starting" && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1402
+ flexDirection: "column",
1403
+ gap: 1,
1404
+ paddingBottom: 1,
1405
+ children: [
1406
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1407
+ bold: true,
1408
+ children: "Create Authentication Token"
1409
+ }, undefined, false, undefined, this),
1410
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1411
+ dimColor: true,
1412
+ children: "Creating a long-lived token for GitHub Actions"
1413
+ }, undefined, false, undefined, this)
1414
+ ]
1415
+ }, undefined, true, undefined, this),
1416
+ oauthStatus.state !== "success" && oauthStatus.state !== "starting" && oauthStatus.state !== "processing" && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1417
+ flexDirection: "column",
1418
+ gap: 1,
1419
+ paddingBottom: 1,
1420
+ children: [
1421
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1422
+ bold: true,
1423
+ children: "Create Authentication Token"
1424
+ }, undefined, false, undefined, this),
1425
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1426
+ dimColor: true,
1427
+ children: "Creating a long-lived token for GitHub Actions"
1428
+ }, undefined, false, undefined, this)
1429
+ ]
1430
+ }, "header", true, undefined, this),
1431
+ oauthStatus.state === "waiting_for_login" && showPastePrompt && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1432
+ flexDirection: "column",
1433
+ gap: 1,
1434
+ paddingBottom: 1,
1435
+ children: [
1436
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1437
+ paddingX: 1,
1438
+ children: [
1439
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1440
+ dimColor: true,
1441
+ children: [
1442
+ "Browser didn't open? Use the url below to sign in",
1443
+ " "
1444
+ ]
1445
+ }, undefined, true, undefined, this),
1446
+ urlCopied ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1447
+ color: "success",
1448
+ children: "(Copied!)"
1449
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1450
+ dimColor: true,
1451
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
1452
+ shortcut: "c",
1453
+ action: "copy",
1454
+ parens: true
1455
+ }, undefined, false, undefined, this)
1456
+ }, undefined, false, undefined, this)
1457
+ ]
1458
+ }, undefined, true, undefined, this),
1459
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Link, {
1460
+ url: oauthStatus.url,
1461
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1462
+ dimColor: true,
1463
+ children: oauthStatus.url
1464
+ }, undefined, false, undefined, this)
1465
+ }, undefined, false, undefined, this)
1466
+ ]
1467
+ }, "urlToCopy", true, undefined, this),
1468
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1469
+ paddingLeft: 1,
1470
+ flexDirection: "column",
1471
+ gap: 1,
1472
+ children: renderStatusMessage()
1473
+ }, undefined, false, undefined, this)
1474
+ ]
1475
+ }, undefined, true, undefined, this);
1476
+ }
1477
+ var import_react5, jsx_dev_runtime10, PASTE_HERE_MSG = "Paste code here if prompted > ";
1478
+ var init_OAuthFlowStep = __esm(() => {
1479
+ init_analytics();
1480
+ init_src();
1481
+ init_Spinner();
1482
+ init_TextInput();
1483
+ init_useTerminalSize();
1484
+ init_src();
1485
+ init_oauth();
1486
+ init_auth();
1487
+ init_log();
1488
+ import_react5 = __toESM(require_react(), 1);
1489
+ jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
1490
+ });
1491
+
1492
+ // src/commands/install-github-app/SuccessStep.tsx
1493
+ function SuccessStep({
1494
+ secretExists,
1495
+ useExistingSecret,
1496
+ secretName,
1497
+ skipWorkflow = false
1498
+ }) {
1499
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
1500
+ children: [
1501
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
1502
+ flexDirection: "column",
1503
+ borderStyle: "round",
1504
+ paddingX: 1,
1505
+ children: [
1506
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
1507
+ flexDirection: "column",
1508
+ marginBottom: 1,
1509
+ children: [
1510
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1511
+ bold: true,
1512
+ children: "Install GitHub App"
1513
+ }, undefined, false, undefined, this),
1514
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1515
+ dimColor: true,
1516
+ children: "Success"
1517
+ }, undefined, false, undefined, this)
1518
+ ]
1519
+ }, undefined, true, undefined, this),
1520
+ !skipWorkflow && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1521
+ color: "success",
1522
+ children: "\u2713 GitHub Actions workflow created!"
1523
+ }, undefined, false, undefined, this),
1524
+ secretExists && useExistingSecret && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
1525
+ marginTop: 1,
1526
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1527
+ color: "success",
1528
+ children: "\u2713 Using existing ANTHROPIC_API_KEY secret"
1529
+ }, undefined, false, undefined, this)
1530
+ }, undefined, false, undefined, this),
1531
+ (!secretExists || !useExistingSecret) && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
1532
+ marginTop: 1,
1533
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1534
+ color: "success",
1535
+ children: [
1536
+ "\u2713 API key saved as ",
1537
+ secretName,
1538
+ " secret"
1539
+ ]
1540
+ }, undefined, true, undefined, this)
1541
+ }, undefined, false, undefined, this),
1542
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
1543
+ marginTop: 1,
1544
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1545
+ children: "Next steps:"
1546
+ }, undefined, false, undefined, this)
1547
+ }, undefined, false, undefined, this),
1548
+ skipWorkflow ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
1549
+ children: [
1550
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1551
+ children: "1. Install the Claude GitHub App if you haven't already"
1552
+ }, undefined, false, undefined, this),
1553
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1554
+ children: "2. Your workflow file was kept unchanged"
1555
+ }, undefined, false, undefined, this),
1556
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1557
+ children: "3. API key is configured and ready to use"
1558
+ }, undefined, false, undefined, this)
1559
+ ]
1560
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
1561
+ children: [
1562
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1563
+ children: "1. A pre-filled PR page has been created"
1564
+ }, undefined, false, undefined, this),
1565
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1566
+ children: "2. Install the Claude GitHub App if you haven't already"
1567
+ }, undefined, false, undefined, this),
1568
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1569
+ children: "3. Merge the PR to enable Claude PR assistance"
1570
+ }, undefined, false, undefined, this)
1571
+ ]
1572
+ }, undefined, true, undefined, this)
1573
+ ]
1574
+ }, undefined, true, undefined, this),
1575
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
1576
+ marginLeft: 3,
1577
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1578
+ dimColor: true,
1579
+ children: "Press any key to exit"
1580
+ }, undefined, false, undefined, this)
1581
+ }, undefined, false, undefined, this)
1582
+ ]
1583
+ }, undefined, true, undefined, this);
1584
+ }
1585
+ var jsx_dev_runtime11;
1586
+ var init_SuccessStep = __esm(() => {
1587
+ init_src();
1588
+ jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
1589
+ });
1590
+
1591
+ // src/commands/install-github-app/setupGitHubActions.ts
1592
+ async function createWorkflowFile(repoName, branchName, workflowPath, workflowContent, secretName, message, context) {
1593
+ const checkFileResult = await execFileNoThrow("gh", [
1594
+ "api",
1595
+ `repos/${repoName}/contents/${workflowPath}`,
1596
+ "--jq",
1597
+ ".sha"
1598
+ ]);
1599
+ let fileSha = null;
1600
+ if (checkFileResult.code === 0) {
1601
+ fileSha = checkFileResult.stdout.trim();
1602
+ }
1603
+ let content = workflowContent;
1604
+ if (secretName === "CLAUDE_CODE_OAUTH_TOKEN") {
1605
+ content = workflowContent.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g, `claude_code_oauth_token: \${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}`);
1606
+ } else if (secretName !== "ANTHROPIC_API_KEY") {
1607
+ content = workflowContent.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g, `anthropic_api_key: \${{ secrets.${secretName} }}`);
1608
+ }
1609
+ const base64Content = Buffer.from(content).toString("base64");
1610
+ const apiParams = [
1611
+ "api",
1612
+ "--method",
1613
+ "PUT",
1614
+ `repos/${repoName}/contents/${workflowPath}`,
1615
+ "-f",
1616
+ `message=${fileSha ? `"Update ${message}"` : `"${message}"`}`,
1617
+ "-f",
1618
+ `content=${base64Content}`,
1619
+ "-f",
1620
+ `branch=${branchName}`
1621
+ ];
1622
+ if (fileSha) {
1623
+ apiParams.push("-f", `sha=${fileSha}`);
1624
+ }
1625
+ const createFileResult = await execFileNoThrow("gh", apiParams);
1626
+ if (createFileResult.code !== 0) {
1627
+ if (createFileResult.stderr.includes("422") && createFileResult.stderr.includes("sha")) {
1628
+ logEvent("tengu_setup_github_actions_failed", {
1629
+ reason: "failed_to_create_workflow_file",
1630
+ exit_code: createFileResult.code,
1631
+ ...context
1632
+ });
1633
+ throw new Error(`Failed to create workflow file ${workflowPath}: A Claude workflow file already exists in this repository. Please remove it first or update it manually.`);
1634
+ }
1635
+ logEvent("tengu_setup_github_actions_failed", {
1636
+ reason: "failed_to_create_workflow_file",
1637
+ exit_code: createFileResult.code,
1638
+ ...context
1639
+ });
1640
+ const helpText = `
1641
+
1642
+ Need help? Common issues:
1643
+ ` + `\xB7 Permission denied \u2192 Run: gh auth refresh -h github.com -s repo,workflow
1644
+ ` + `\xB7 Not authorized \u2192 Ensure you have admin access to the repository
1645
+ ` + "\xB7 For manual setup \u2192 Visit: https://github.com/anthropics/claude-code-action";
1646
+ throw new Error(`Failed to create workflow file ${workflowPath}: ${createFileResult.stderr}${helpText}`);
1647
+ }
1648
+ }
1649
+ async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, updateProgress, skipWorkflow = false, selectedWorkflows, authType, context) {
1650
+ try {
1651
+ logEvent("tengu_setup_github_actions_started", {
1652
+ skip_workflow: skipWorkflow,
1653
+ has_api_key: !!apiKeyOrOAuthToken,
1654
+ using_default_secret_name: secretName === "ANTHROPIC_API_KEY",
1655
+ selected_claude_workflow: selectedWorkflows.includes("claude"),
1656
+ selected_claude_review_workflow: selectedWorkflows.includes("claude-review"),
1657
+ ...context
1658
+ });
1659
+ const repoCheckResult = await execFileNoThrow("gh", [
1660
+ "api",
1661
+ `repos/${repoName}`,
1662
+ "--jq",
1663
+ ".id"
1664
+ ]);
1665
+ if (repoCheckResult.code !== 0) {
1666
+ logEvent("tengu_setup_github_actions_failed", {
1667
+ reason: "repo_not_found",
1668
+ exit_code: repoCheckResult.code,
1669
+ ...context
1670
+ });
1671
+ throw new Error(`Failed to access repository ${repoName}: ${repoCheckResult.stderr}`);
1672
+ }
1673
+ const defaultBranchResult = await execFileNoThrow("gh", [
1674
+ "api",
1675
+ `repos/${repoName}`,
1676
+ "--jq",
1677
+ ".default_branch"
1678
+ ]);
1679
+ if (defaultBranchResult.code !== 0) {
1680
+ logEvent("tengu_setup_github_actions_failed", {
1681
+ reason: "failed_to_get_default_branch",
1682
+ exit_code: defaultBranchResult.code,
1683
+ ...context
1684
+ });
1685
+ throw new Error(`Failed to get default branch: ${defaultBranchResult.stderr}`);
1686
+ }
1687
+ const defaultBranch = defaultBranchResult.stdout.trim();
1688
+ const shaResult = await execFileNoThrow("gh", [
1689
+ "api",
1690
+ `repos/${repoName}/git/ref/heads/${defaultBranch}`,
1691
+ "--jq",
1692
+ ".object.sha"
1693
+ ]);
1694
+ if (shaResult.code !== 0) {
1695
+ logEvent("tengu_setup_github_actions_failed", {
1696
+ reason: "failed_to_get_branch_sha",
1697
+ exit_code: shaResult.code,
1698
+ ...context
1699
+ });
1700
+ throw new Error(`Failed to get branch SHA: ${shaResult.stderr}`);
1701
+ }
1702
+ const sha = shaResult.stdout.trim();
1703
+ let branchName = null;
1704
+ if (!skipWorkflow) {
1705
+ updateProgress();
1706
+ branchName = `add-claude-github-actions-${Date.now()}`;
1707
+ const createBranchResult = await execFileNoThrow("gh", [
1708
+ "api",
1709
+ "--method",
1710
+ "POST",
1711
+ `repos/${repoName}/git/refs`,
1712
+ "-f",
1713
+ `ref=refs/heads/${branchName}`,
1714
+ "-f",
1715
+ `sha=${sha}`
1716
+ ]);
1717
+ if (createBranchResult.code !== 0) {
1718
+ logEvent("tengu_setup_github_actions_failed", {
1719
+ reason: "failed_to_create_branch",
1720
+ exit_code: createBranchResult.code,
1721
+ ...context
1722
+ });
1723
+ throw new Error(`Failed to create branch: ${createBranchResult.stderr}`);
1724
+ }
1725
+ updateProgress();
1726
+ const workflows = [];
1727
+ if (selectedWorkflows.includes("claude")) {
1728
+ workflows.push({
1729
+ path: ".github/workflows/claude.yml",
1730
+ content: WORKFLOW_CONTENT,
1731
+ message: "Claude PR Assistant workflow"
1732
+ });
1733
+ }
1734
+ if (selectedWorkflows.includes("claude-review")) {
1735
+ workflows.push({
1736
+ path: ".github/workflows/claude-code-review.yml",
1737
+ content: CODE_REVIEW_PLUGIN_WORKFLOW_CONTENT,
1738
+ message: "Claude Code Review workflow"
1739
+ });
1740
+ }
1741
+ for (const workflow of workflows) {
1742
+ await createWorkflowFile(repoName, branchName, workflow.path, workflow.content, secretName, workflow.message, context);
1743
+ }
1744
+ }
1745
+ updateProgress();
1746
+ if (apiKeyOrOAuthToken) {
1747
+ const setSecretResult = await execFileNoThrow("gh", [
1748
+ "secret",
1749
+ "set",
1750
+ secretName,
1751
+ "--body",
1752
+ apiKeyOrOAuthToken,
1753
+ "--repo",
1754
+ repoName
1755
+ ]);
1756
+ if (setSecretResult.code !== 0) {
1757
+ logEvent("tengu_setup_github_actions_failed", {
1758
+ reason: "failed_to_set_api_key_secret",
1759
+ exit_code: setSecretResult.code,
1760
+ ...context
1761
+ });
1762
+ const helpText = `
1763
+
1764
+ Need help? Common issues:
1765
+ ` + `\xB7 Permission denied \u2192 Run: gh auth refresh -h github.com -s repo
1766
+ ` + `\xB7 Not authorized \u2192 Ensure you have admin access to the repository
1767
+ ` + "\xB7 For manual setup \u2192 Visit: https://github.com/anthropics/claude-code-action";
1768
+ throw new Error(`Failed to set API key secret: ${setSecretResult.stderr || "Unknown error"}${helpText}`);
1769
+ }
1770
+ }
1771
+ if (!skipWorkflow && branchName) {
1772
+ updateProgress();
1773
+ const compareUrl = `https://github.com/${repoName}/compare/${defaultBranch}...${branchName}?quick_pull=1&title=${encodeURIComponent(PR_TITLE)}&body=${encodeURIComponent(PR_BODY)}`;
1774
+ await openBrowser(compareUrl);
1775
+ }
1776
+ logEvent("tengu_setup_github_actions_completed", {
1777
+ skip_workflow: skipWorkflow,
1778
+ has_api_key: !!apiKeyOrOAuthToken,
1779
+ auth_type: authType,
1780
+ using_default_secret_name: secretName === "ANTHROPIC_API_KEY",
1781
+ selected_claude_workflow: selectedWorkflows.includes("claude"),
1782
+ selected_claude_review_workflow: selectedWorkflows.includes("claude-review"),
1783
+ ...context
1784
+ });
1785
+ saveGlobalConfig((current) => ({
1786
+ ...current,
1787
+ githubActionSetupCount: (current.githubActionSetupCount ?? 0) + 1
1788
+ }));
1789
+ } catch (error) {
1790
+ if (!error || !(error instanceof Error) || !error.message.includes("Failed to")) {
1791
+ logEvent("tengu_setup_github_actions_failed", {
1792
+ reason: "unexpected_error",
1793
+ ...context
1794
+ });
1795
+ }
1796
+ if (error instanceof Error) {
1797
+ logError(error);
1798
+ }
1799
+ throw error;
1800
+ }
1801
+ }
1802
+ var init_setupGitHubActions = __esm(() => {
1803
+ init_analytics();
1804
+ init_config();
1805
+ init_github_app();
1806
+ init_browser();
1807
+ init_execFileNoThrow();
1808
+ init_log();
1809
+ });
1810
+
1811
+ // src/commands/install-github-app/WarningsStep.tsx
1812
+ function WarningsStep({ warnings, onContinue }) {
1813
+ useKeybinding("confirm:yes", onContinue, { context: "Confirmation" });
1814
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
1815
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
1816
+ flexDirection: "column",
1817
+ borderStyle: "round",
1818
+ paddingX: 1,
1819
+ children: [
1820
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
1821
+ flexDirection: "column",
1822
+ marginBottom: 1,
1823
+ children: [
1824
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
1825
+ bold: true,
1826
+ children: [
1827
+ figures_default.warning,
1828
+ " Setup Warnings"
1829
+ ]
1830
+ }, undefined, true, undefined, this),
1831
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
1832
+ dimColor: true,
1833
+ children: "We found some potential issues, but you can continue anyway"
1834
+ }, undefined, false, undefined, this)
1835
+ ]
1836
+ }, undefined, true, undefined, this),
1837
+ warnings.map((warning, index) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
1838
+ flexDirection: "column",
1839
+ marginBottom: 1,
1840
+ children: [
1841
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
1842
+ color: "warning",
1843
+ bold: true,
1844
+ children: warning.title
1845
+ }, undefined, false, undefined, this),
1846
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
1847
+ children: warning.message
1848
+ }, undefined, false, undefined, this),
1849
+ warning.instructions.length > 0 && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
1850
+ flexDirection: "column",
1851
+ marginLeft: 2,
1852
+ marginTop: 1,
1853
+ children: warning.instructions.map((instruction, i) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
1854
+ dimColor: true,
1855
+ children: [
1856
+ "\u2022 ",
1857
+ instruction
1858
+ ]
1859
+ }, i, true, undefined, this))
1860
+ }, undefined, false, undefined, this)
1861
+ ]
1862
+ }, index, true, undefined, this)),
1863
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
1864
+ marginTop: 1,
1865
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
1866
+ bold: true,
1867
+ color: "permission",
1868
+ children: "Press Enter to continue anyway, or Ctrl+C to exit and fix issues"
1869
+ }, undefined, false, undefined, this)
1870
+ }, undefined, false, undefined, this),
1871
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
1872
+ marginTop: 1,
1873
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
1874
+ dimColor: true,
1875
+ children: [
1876
+ "You can also try the manual setup steps if needed:",
1877
+ " ",
1878
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
1879
+ color: "claude",
1880
+ children: GITHUB_ACTION_SETUP_DOCS_URL
1881
+ }, undefined, false, undefined, this)
1882
+ ]
1883
+ }, undefined, true, undefined, this)
1884
+ }, undefined, false, undefined, this)
1885
+ ]
1886
+ }, undefined, true, undefined, this)
1887
+ }, undefined, false, undefined, this);
1888
+ }
1889
+ var jsx_dev_runtime12;
1890
+ var init_WarningsStep = __esm(() => {
1891
+ init_figures();
1892
+ init_github_app();
1893
+ init_src();
1894
+ init_useKeybinding();
1895
+ jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
1896
+ });
1897
+
1898
+ // src/commands/install-github-app/install-github-app.tsx
1899
+ function InstallGitHubApp(props) {
1900
+ const [existingApiKey] = import_react6.useState(() => getAnthropicApiKey());
1901
+ const [state, setState] = import_react6.useState({
1902
+ ...INITIAL_STATE,
1903
+ useExistingKey: !!existingApiKey,
1904
+ selectedApiKeyOption: existingApiKey ? "existing" : isAnthropicAuthEnabled() ? "oauth" : "new"
1905
+ });
1906
+ useExitOnCtrlCDWithKeybindings();
1907
+ import_react6.default.useEffect(() => {
1908
+ logEvent("tengu_install_github_app_started", {});
1909
+ }, []);
1910
+ const checkGitHubCLI = import_react6.useCallback(async () => {
1911
+ const warnings = [];
1912
+ const ghVersionResult = await execa("gh --version", {
1913
+ shell: true,
1914
+ reject: false
1915
+ });
1916
+ if (ghVersionResult.exitCode !== 0) {
1917
+ warnings.push({
1918
+ title: "GitHub CLI not found",
1919
+ message: "GitHub CLI (gh) does not appear to be installed or accessible.",
1920
+ instructions: [
1921
+ "Install GitHub CLI from https://cli.github.com/",
1922
+ "macOS: brew install gh",
1923
+ "Windows: winget install --id GitHub.cli",
1924
+ "Linux: See installation instructions at https://github.com/cli/cli#installation"
1925
+ ]
1926
+ });
1927
+ }
1928
+ const authResult = await execa("gh auth status -a", {
1929
+ shell: true,
1930
+ reject: false
1931
+ });
1932
+ if (authResult.exitCode !== 0) {
1933
+ warnings.push({
1934
+ title: "GitHub CLI not authenticated",
1935
+ message: "GitHub CLI does not appear to be authenticated.",
1936
+ instructions: [
1937
+ "Run: gh auth login",
1938
+ "Follow the prompts to authenticate with GitHub",
1939
+ "Or set up authentication using environment variables or other methods"
1940
+ ]
1941
+ });
1942
+ } else {
1943
+ const tokenScopesMatch = authResult.stdout.match(/Token scopes:.*$/m);
1944
+ if (tokenScopesMatch) {
1945
+ const scopes = tokenScopesMatch[0];
1946
+ const missingScopes = [];
1947
+ if (!scopes.includes("repo")) {
1948
+ missingScopes.push("repo");
1949
+ }
1950
+ if (!scopes.includes("workflow")) {
1951
+ missingScopes.push("workflow");
1952
+ }
1953
+ if (missingScopes.length > 0) {
1954
+ setState((prev) => ({
1955
+ ...prev,
1956
+ step: "error",
1957
+ error: `GitHub CLI is missing required permissions: ${missingScopes.join(", ")}.`,
1958
+ errorReason: "Missing required scopes",
1959
+ errorInstructions: [
1960
+ `Your GitHub CLI authentication is missing the "${missingScopes.join('" and "')}" ${plural(missingScopes.length, "scope")} needed to manage GitHub Actions and secrets.`,
1961
+ "",
1962
+ "To fix this, run:",
1963
+ " gh auth refresh -h github.com -s repo,workflow",
1964
+ "",
1965
+ "This will add the necessary permissions to manage workflows and secrets."
1966
+ ]
1967
+ }));
1968
+ return;
1969
+ }
1970
+ }
1971
+ }
1972
+ const currentRepo = await getGithubRepo() ?? "";
1973
+ logEvent("tengu_install_github_app_step_completed", {
1974
+ step: "check-gh"
1975
+ });
1976
+ setState((prev) => ({
1977
+ ...prev,
1978
+ warnings,
1979
+ currentRepo,
1980
+ selectedRepoName: currentRepo,
1981
+ useCurrentRepo: !!currentRepo,
1982
+ step: warnings.length > 0 ? "warnings" : "choose-repo"
1983
+ }));
1984
+ }, []);
1985
+ import_react6.default.useEffect(() => {
1986
+ if (state.step === "check-gh") {
1987
+ checkGitHubCLI();
1988
+ }
1989
+ }, [state.step, checkGitHubCLI]);
1990
+ const runSetupGitHubActions = import_react6.useCallback(async (apiKeyOrOAuthToken, secretName) => {
1991
+ setState((prev) => ({
1992
+ ...prev,
1993
+ step: "creating",
1994
+ currentWorkflowInstallStep: 0
1995
+ }));
1996
+ try {
1997
+ await setupGitHubActions(state.selectedRepoName, apiKeyOrOAuthToken, secretName, () => {
1998
+ setState((prev) => ({
1999
+ ...prev,
2000
+ currentWorkflowInstallStep: prev.currentWorkflowInstallStep + 1
2001
+ }));
2002
+ }, state.workflowAction === "skip", state.selectedWorkflows, state.authType, {
2003
+ useCurrentRepo: state.useCurrentRepo,
2004
+ workflowExists: state.workflowExists,
2005
+ secretExists: state.secretExists
2006
+ });
2007
+ logEvent("tengu_install_github_app_step_completed", {
2008
+ step: "creating"
2009
+ });
2010
+ setState((prev) => ({ ...prev, step: "success" }));
2011
+ } catch (error) {
2012
+ const errorMessage = error instanceof Error ? error.message : "Failed to set up GitHub Actions";
2013
+ if (errorMessage.includes("workflow file already exists")) {
2014
+ logEvent("tengu_install_github_app_error", {
2015
+ reason: "workflow_file_exists"
2016
+ });
2017
+ setState((prev) => ({
2018
+ ...prev,
2019
+ step: "error",
2020
+ error: "A Claude workflow file already exists in this repository.",
2021
+ errorReason: "Workflow file conflict",
2022
+ errorInstructions: [
2023
+ "The file .github/workflows/claude.yml already exists",
2024
+ "You can either:",
2025
+ " 1. Delete the existing file and run this command again",
2026
+ " 2. Update the existing file manually using the template from:",
2027
+ ` ${GITHUB_ACTION_SETUP_DOCS_URL}`
2028
+ ]
2029
+ }));
2030
+ } else {
2031
+ logEvent("tengu_install_github_app_error", {
2032
+ reason: "setup_github_actions_failed"
2033
+ });
2034
+ setState((prev) => ({
2035
+ ...prev,
2036
+ step: "error",
2037
+ error: errorMessage,
2038
+ errorReason: "GitHub Actions setup failed",
2039
+ errorInstructions: []
2040
+ }));
2041
+ }
2042
+ }
2043
+ }, [
2044
+ state.selectedRepoName,
2045
+ state.workflowAction,
2046
+ state.selectedWorkflows,
2047
+ state.useCurrentRepo,
2048
+ state.workflowExists,
2049
+ state.secretExists,
2050
+ state.authType
2051
+ ]);
2052
+ async function openGitHubAppInstallation() {
2053
+ const installUrl = "https://github.com/apps/claude";
2054
+ await openBrowser(installUrl);
2055
+ }
2056
+ async function checkRepositoryPermissions(repoName) {
2057
+ try {
2058
+ const result = await execFileNoThrow("gh", [
2059
+ "api",
2060
+ `repos/${repoName}`,
2061
+ "--jq",
2062
+ ".permissions.admin"
2063
+ ]);
2064
+ if (result.code === 0) {
2065
+ const hasAdmin = result.stdout.trim() === "true";
2066
+ return { hasAccess: hasAdmin };
2067
+ }
2068
+ if (result.stderr.includes("404") || result.stderr.includes("Not Found")) {
2069
+ return {
2070
+ hasAccess: false,
2071
+ error: "repository_not_found"
2072
+ };
2073
+ }
2074
+ return { hasAccess: false };
2075
+ } catch {
2076
+ return { hasAccess: false };
2077
+ }
2078
+ }
2079
+ async function checkExistingWorkflowFile(repoName) {
2080
+ const checkFileResult = await execFileNoThrow("gh", [
2081
+ "api",
2082
+ `repos/${repoName}/contents/.github/workflows/claude.yml`,
2083
+ "--jq",
2084
+ ".sha"
2085
+ ]);
2086
+ return checkFileResult.code === 0;
2087
+ }
2088
+ async function checkExistingSecret() {
2089
+ const checkSecretsResult = await execFileNoThrow("gh", [
2090
+ "secret",
2091
+ "list",
2092
+ "--app",
2093
+ "actions",
2094
+ "--repo",
2095
+ state.selectedRepoName
2096
+ ]);
2097
+ if (checkSecretsResult.code === 0) {
2098
+ const lines = checkSecretsResult.stdout.split(`
2099
+ `);
2100
+ const hasAnthropicKey = lines.some((line) => {
2101
+ return /^ANTHROPIC_API_KEY\s+/.test(line);
2102
+ });
2103
+ if (hasAnthropicKey) {
2104
+ setState((prev) => ({
2105
+ ...prev,
2106
+ secretExists: true,
2107
+ step: "check-existing-secret"
2108
+ }));
2109
+ } else {
2110
+ if (existingApiKey) {
2111
+ setState((prev) => ({
2112
+ ...prev,
2113
+ apiKeyOrOAuthToken: existingApiKey,
2114
+ useExistingKey: true
2115
+ }));
2116
+ await runSetupGitHubActions(existingApiKey, state.secretName);
2117
+ } else {
2118
+ setState((prev) => ({ ...prev, step: "api-key" }));
2119
+ }
2120
+ }
2121
+ } else {
2122
+ if (existingApiKey) {
2123
+ setState((prev) => ({
2124
+ ...prev,
2125
+ apiKeyOrOAuthToken: existingApiKey,
2126
+ useExistingKey: true
2127
+ }));
2128
+ await runSetupGitHubActions(existingApiKey, state.secretName);
2129
+ } else {
2130
+ setState((prev) => ({ ...prev, step: "api-key" }));
2131
+ }
2132
+ }
2133
+ }
2134
+ const handleSubmit = async () => {
2135
+ if (state.step === "warnings") {
2136
+ logEvent("tengu_install_github_app_step_completed", {
2137
+ step: "warnings"
2138
+ });
2139
+ setState((prev) => ({ ...prev, step: "install-app" }));
2140
+ setTimeout(openGitHubAppInstallation, 0);
2141
+ } else if (state.step === "choose-repo") {
2142
+ let repoName = state.useCurrentRepo ? state.currentRepo : state.selectedRepoName;
2143
+ if (!repoName.trim()) {
2144
+ return;
2145
+ }
2146
+ const repoWarnings = [];
2147
+ if (repoName.includes("github.com")) {
2148
+ const match = repoName.match(/github\.com[:/]([^/]+\/[^/]+)(\.git)?$/);
2149
+ if (!match) {
2150
+ repoWarnings.push({
2151
+ title: "Invalid GitHub URL format",
2152
+ message: "The repository URL format appears to be invalid.",
2153
+ instructions: [
2154
+ "Use format: owner/repo or https://github.com/owner/repo",
2155
+ "Example: anthropics/claude-cli"
2156
+ ]
2157
+ });
2158
+ } else {
2159
+ repoName = match[1]?.replace(/\.git$/, "") || "";
2160
+ }
2161
+ }
2162
+ if (!repoName.includes("/")) {
2163
+ repoWarnings.push({
2164
+ title: "Repository format warning",
2165
+ message: 'Repository should be in format "owner/repo"',
2166
+ instructions: [
2167
+ "Use format: owner/repo",
2168
+ "Example: anthropics/claude-cli"
2169
+ ]
2170
+ });
2171
+ }
2172
+ const permissionCheck = await checkRepositoryPermissions(repoName);
2173
+ if (permissionCheck.error === "repository_not_found") {
2174
+ repoWarnings.push({
2175
+ title: "Repository not found",
2176
+ message: `Repository ${repoName} was not found or you don't have access.`,
2177
+ instructions: [
2178
+ `Check that the repository name is correct: ${repoName}`,
2179
+ "Ensure you have access to this repository",
2180
+ 'For private repositories, make sure your GitHub token has the "repo" scope',
2181
+ "You can add the repo scope with: gh auth refresh -h github.com -s repo,workflow"
2182
+ ]
2183
+ });
2184
+ } else if (!permissionCheck.hasAccess) {
2185
+ repoWarnings.push({
2186
+ title: "Admin permissions required",
2187
+ message: `You might need admin permissions on ${repoName} to set up GitHub Actions.`,
2188
+ instructions: [
2189
+ "Repository admins can install GitHub Apps and set secrets",
2190
+ "Ask a repository admin to run this command if setup fails",
2191
+ "Alternatively, you can use the manual setup instructions"
2192
+ ]
2193
+ });
2194
+ }
2195
+ const workflowExists = await checkExistingWorkflowFile(repoName);
2196
+ if (repoWarnings.length > 0) {
2197
+ const allWarnings = [...state.warnings, ...repoWarnings];
2198
+ setState((prev) => ({
2199
+ ...prev,
2200
+ selectedRepoName: repoName,
2201
+ workflowExists,
2202
+ warnings: allWarnings,
2203
+ step: "warnings"
2204
+ }));
2205
+ } else {
2206
+ logEvent("tengu_install_github_app_step_completed", {
2207
+ step: "choose-repo"
2208
+ });
2209
+ setState((prev) => ({
2210
+ ...prev,
2211
+ selectedRepoName: repoName,
2212
+ workflowExists,
2213
+ step: "install-app"
2214
+ }));
2215
+ setTimeout(openGitHubAppInstallation, 0);
2216
+ }
2217
+ } else if (state.step === "install-app") {
2218
+ logEvent("tengu_install_github_app_step_completed", {
2219
+ step: "install-app"
2220
+ });
2221
+ if (state.workflowExists) {
2222
+ setState((prev) => ({ ...prev, step: "check-existing-workflow" }));
2223
+ } else {
2224
+ setState((prev) => ({ ...prev, step: "select-workflows" }));
2225
+ }
2226
+ } else if (state.step === "check-existing-workflow") {
2227
+ return;
2228
+ } else if (state.step === "select-workflows") {
2229
+ return;
2230
+ } else if (state.step === "check-existing-secret") {
2231
+ logEvent("tengu_install_github_app_step_completed", {
2232
+ step: "check-existing-secret"
2233
+ });
2234
+ if (state.useExistingSecret) {
2235
+ await runSetupGitHubActions(null, state.secretName);
2236
+ } else {
2237
+ await runSetupGitHubActions(state.apiKeyOrOAuthToken, state.secretName);
2238
+ }
2239
+ } else if (state.step === "api-key") {
2240
+ if (state.selectedApiKeyOption === "oauth") {
2241
+ return;
2242
+ }
2243
+ const apiKeyToUse = state.selectedApiKeyOption === "existing" ? existingApiKey : state.apiKeyOrOAuthToken;
2244
+ if (!apiKeyToUse) {
2245
+ logEvent("tengu_install_github_app_error", {
2246
+ reason: "api_key_missing"
2247
+ });
2248
+ setState((prev) => ({
2249
+ ...prev,
2250
+ step: "error",
2251
+ error: "API key is required"
2252
+ }));
2253
+ return;
2254
+ }
2255
+ setState((prev) => ({
2256
+ ...prev,
2257
+ apiKeyOrOAuthToken: apiKeyToUse,
2258
+ useExistingKey: state.selectedApiKeyOption === "existing"
2259
+ }));
2260
+ const checkSecretsResult = await execFileNoThrow("gh", [
2261
+ "secret",
2262
+ "list",
2263
+ "--app",
2264
+ "actions",
2265
+ "--repo",
2266
+ state.selectedRepoName
2267
+ ]);
2268
+ if (checkSecretsResult.code === 0) {
2269
+ const lines = checkSecretsResult.stdout.split(`
2270
+ `);
2271
+ const hasAnthropicKey = lines.some((line) => {
2272
+ return /^ANTHROPIC_API_KEY\s+/.test(line);
2273
+ });
2274
+ if (hasAnthropicKey) {
2275
+ logEvent("tengu_install_github_app_step_completed", {
2276
+ step: "api-key"
2277
+ });
2278
+ setState((prev) => ({
2279
+ ...prev,
2280
+ secretExists: true,
2281
+ step: "check-existing-secret"
2282
+ }));
2283
+ } else {
2284
+ logEvent("tengu_install_github_app_step_completed", {
2285
+ step: "api-key"
2286
+ });
2287
+ await runSetupGitHubActions(apiKeyToUse, state.secretName);
2288
+ }
2289
+ } else {
2290
+ logEvent("tengu_install_github_app_step_completed", {
2291
+ step: "api-key"
2292
+ });
2293
+ await runSetupGitHubActions(apiKeyToUse, state.secretName);
2294
+ }
2295
+ }
2296
+ };
2297
+ const handleRepoUrlChange = (value) => {
2298
+ setState((prev) => ({ ...prev, selectedRepoName: value }));
2299
+ };
2300
+ const handleApiKeyChange = (value) => {
2301
+ setState((prev) => ({ ...prev, apiKeyOrOAuthToken: value }));
2302
+ };
2303
+ const handleApiKeyOptionChange = (option) => {
2304
+ setState((prev) => ({ ...prev, selectedApiKeyOption: option }));
2305
+ };
2306
+ const handleCreateOAuthToken = import_react6.useCallback(() => {
2307
+ logEvent("tengu_install_github_app_step_completed", {
2308
+ step: "api-key"
2309
+ });
2310
+ setState((prev) => ({ ...prev, step: "oauth-flow" }));
2311
+ }, []);
2312
+ const handleOAuthSuccess = import_react6.useCallback((token) => {
2313
+ logEvent("tengu_install_github_app_step_completed", {
2314
+ step: "oauth-flow"
2315
+ });
2316
+ setState((prev) => ({
2317
+ ...prev,
2318
+ apiKeyOrOAuthToken: token,
2319
+ useExistingKey: false,
2320
+ secretName: "CLAUDE_CODE_OAUTH_TOKEN",
2321
+ authType: "oauth_token"
2322
+ }));
2323
+ runSetupGitHubActions(token, "CLAUDE_CODE_OAUTH_TOKEN");
2324
+ }, [runSetupGitHubActions]);
2325
+ const handleOAuthCancel = import_react6.useCallback(() => {
2326
+ setState((prev) => ({ ...prev, step: "api-key" }));
2327
+ }, []);
2328
+ const handleSecretNameChange = (value) => {
2329
+ if (value && !/^[a-zA-Z0-9_]+$/.test(value))
2330
+ return;
2331
+ setState((prev) => ({ ...prev, secretName: value }));
2332
+ };
2333
+ const handleToggleUseCurrentRepo = (useCurrentRepo) => {
2334
+ setState((prev) => ({
2335
+ ...prev,
2336
+ useCurrentRepo,
2337
+ selectedRepoName: useCurrentRepo ? prev.currentRepo : ""
2338
+ }));
2339
+ };
2340
+ const handleToggleUseExistingKey = (useExistingKey) => {
2341
+ setState((prev) => ({ ...prev, useExistingKey }));
2342
+ };
2343
+ const handleToggleUseExistingSecret = (useExistingSecret) => {
2344
+ setState((prev) => ({
2345
+ ...prev,
2346
+ useExistingSecret,
2347
+ secretName: useExistingSecret ? "ANTHROPIC_API_KEY" : ""
2348
+ }));
2349
+ };
2350
+ const handleWorkflowAction = async (action) => {
2351
+ if (action === "exit") {
2352
+ props.onDone("Installation cancelled by user");
2353
+ return;
2354
+ }
2355
+ logEvent("tengu_install_github_app_step_completed", {
2356
+ step: "check-existing-workflow"
2357
+ });
2358
+ setState((prev) => ({ ...prev, workflowAction: action }));
2359
+ if (action === "skip" || action === "update") {
2360
+ if (existingApiKey) {
2361
+ await checkExistingSecret();
2362
+ } else {
2363
+ setState((prev) => ({ ...prev, step: "api-key" }));
2364
+ }
2365
+ }
2366
+ };
2367
+ function handleDismissKeyDown(e) {
2368
+ e.preventDefault();
2369
+ if (state.step === "success") {
2370
+ logEvent("tengu_install_github_app_completed", {});
2371
+ }
2372
+ props.onDone(state.step === "success" ? "GitHub Actions setup complete!" : state.error ? `Couldn't install GitHub App: ${state.error}
2373
+ For manual setup instructions, see: ${GITHUB_ACTION_SETUP_DOCS_URL}` : `GitHub App installation failed
2374
+ For manual setup instructions, see: ${GITHUB_ACTION_SETUP_DOCS_URL}`);
2375
+ }
2376
+ switch (state.step) {
2377
+ case "check-gh":
2378
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(CheckGitHubStep, {}, undefined, false, undefined, this);
2379
+ case "warnings":
2380
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(WarningsStep, {
2381
+ warnings: state.warnings,
2382
+ onContinue: handleSubmit
2383
+ }, undefined, false, undefined, this);
2384
+ case "choose-repo":
2385
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ChooseRepoStep, {
2386
+ currentRepo: state.currentRepo,
2387
+ useCurrentRepo: state.useCurrentRepo,
2388
+ repoUrl: state.selectedRepoName,
2389
+ onRepoUrlChange: handleRepoUrlChange,
2390
+ onToggleUseCurrentRepo: handleToggleUseCurrentRepo,
2391
+ onSubmit: handleSubmit
2392
+ }, undefined, false, undefined, this);
2393
+ case "install-app":
2394
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(InstallAppStep, {
2395
+ repoUrl: state.selectedRepoName,
2396
+ onSubmit: handleSubmit
2397
+ }, undefined, false, undefined, this);
2398
+ case "check-existing-workflow":
2399
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ExistingWorkflowStep, {
2400
+ repoName: state.selectedRepoName,
2401
+ onSelectAction: handleWorkflowAction
2402
+ }, undefined, false, undefined, this);
2403
+ case "check-existing-secret":
2404
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(CheckExistingSecretStep, {
2405
+ useExistingSecret: state.useExistingSecret,
2406
+ secretName: state.secretName,
2407
+ onToggleUseExistingSecret: handleToggleUseExistingSecret,
2408
+ onSecretNameChange: handleSecretNameChange,
2409
+ onSubmit: handleSubmit
2410
+ }, undefined, false, undefined, this);
2411
+ case "api-key":
2412
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ApiKeyStep, {
2413
+ existingApiKey,
2414
+ useExistingKey: state.useExistingKey,
2415
+ apiKeyOrOAuthToken: state.apiKeyOrOAuthToken,
2416
+ onApiKeyChange: handleApiKeyChange,
2417
+ onToggleUseExistingKey: handleToggleUseExistingKey,
2418
+ onSubmit: handleSubmit,
2419
+ onCreateOAuthToken: isAnthropicAuthEnabled() ? handleCreateOAuthToken : undefined,
2420
+ selectedOption: state.selectedApiKeyOption,
2421
+ onSelectOption: handleApiKeyOptionChange
2422
+ }, undefined, false, undefined, this);
2423
+ case "creating":
2424
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(CreatingStep, {
2425
+ currentWorkflowInstallStep: state.currentWorkflowInstallStep,
2426
+ secretExists: state.secretExists,
2427
+ useExistingSecret: state.useExistingSecret,
2428
+ secretName: state.secretName,
2429
+ skipWorkflow: state.workflowAction === "skip",
2430
+ selectedWorkflows: state.selectedWorkflows
2431
+ }, undefined, false, undefined, this);
2432
+ case "success":
2433
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2434
+ tabIndex: 0,
2435
+ autoFocus: true,
2436
+ onKeyDown: handleDismissKeyDown,
2437
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(SuccessStep, {
2438
+ secretExists: state.secretExists,
2439
+ useExistingSecret: state.useExistingSecret,
2440
+ secretName: state.secretName,
2441
+ skipWorkflow: state.workflowAction === "skip"
2442
+ }, undefined, false, undefined, this)
2443
+ }, undefined, false, undefined, this);
2444
+ case "error":
2445
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2446
+ tabIndex: 0,
2447
+ autoFocus: true,
2448
+ onKeyDown: handleDismissKeyDown,
2449
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ErrorStep, {
2450
+ error: state.error,
2451
+ errorReason: state.errorReason,
2452
+ errorInstructions: state.errorInstructions
2453
+ }, undefined, false, undefined, this)
2454
+ }, undefined, false, undefined, this);
2455
+ case "select-workflows":
2456
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(WorkflowMultiselectDialog, {
2457
+ defaultSelections: state.selectedWorkflows,
2458
+ onSubmit: (selectedWorkflows) => {
2459
+ logEvent("tengu_install_github_app_step_completed", {
2460
+ step: "select-workflows"
2461
+ });
2462
+ setState((prev) => ({
2463
+ ...prev,
2464
+ selectedWorkflows
2465
+ }));
2466
+ if (existingApiKey) {
2467
+ checkExistingSecret();
2468
+ } else {
2469
+ setState((prev) => ({ ...prev, step: "api-key" }));
2470
+ }
2471
+ }
2472
+ }, undefined, false, undefined, this);
2473
+ case "oauth-flow":
2474
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(OAuthFlowStep, {
2475
+ onSuccess: handleOAuthSuccess,
2476
+ onCancel: handleOAuthCancel
2477
+ }, undefined, false, undefined, this);
2478
+ }
2479
+ }
2480
+ async function call(onDone) {
2481
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(InstallGitHubApp, {
2482
+ onDone
2483
+ }, undefined, false, undefined, this);
2484
+ }
2485
+ var import_react6, jsx_dev_runtime13, INITIAL_STATE;
2486
+ var init_install_github_app = __esm(() => {
2487
+ init_execa();
2488
+ init_analytics();
2489
+ init_WorkflowMultiselectDialog();
2490
+ init_github_app();
2491
+ init_useExitOnCtrlCDWithKeybindings();
2492
+ init_src();
2493
+ init_auth();
2494
+ init_browser();
2495
+ init_execFileNoThrow();
2496
+ init_git();
2497
+ init_stringUtils();
2498
+ init_ApiKeyStep();
2499
+ init_CheckExistingSecretStep();
2500
+ init_CheckGitHubStep();
2501
+ init_ChooseRepoStep();
2502
+ init_CreatingStep();
2503
+ init_ErrorStep();
2504
+ init_ExistingWorkflowStep();
2505
+ init_InstallAppStep();
2506
+ init_OAuthFlowStep();
2507
+ init_SuccessStep();
2508
+ init_setupGitHubActions();
2509
+ init_WarningsStep();
2510
+ import_react6 = __toESM(require_react(), 1);
2511
+ jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
2512
+ INITIAL_STATE = {
2513
+ step: "check-gh",
2514
+ selectedRepoName: "",
2515
+ currentRepo: "",
2516
+ useCurrentRepo: false,
2517
+ apiKeyOrOAuthToken: "",
2518
+ useExistingKey: true,
2519
+ currentWorkflowInstallStep: 0,
2520
+ warnings: [],
2521
+ secretExists: false,
2522
+ secretName: "ANTHROPIC_API_KEY",
2523
+ useExistingSecret: true,
2524
+ workflowExists: false,
2525
+ selectedWorkflows: ["claude", "claude-review"],
2526
+ selectedApiKeyOption: "new",
2527
+ authType: "api_key"
2528
+ };
2529
+ });
2530
+ init_install_github_app();
2531
+
2532
+ export {
2533
+ call
2534
+ };