gong-code 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/README.md +38 -0
  2. package/dist/SKILL-22jccbka.md +1 -0
  3. package/dist/chunk-01wdn84e.js +8 -0
  4. package/dist/chunk-04bc74vz.js +243 -0
  5. package/dist/chunk-05t2vqsb.js +490 -0
  6. package/dist/chunk-0727wret.js +159 -0
  7. package/dist/chunk-07rervty.js +200 -0
  8. package/dist/chunk-0b9nxvyg.js +478 -0
  9. package/dist/chunk-0e428b73.js +600 -0
  10. package/dist/chunk-0hqfheht.js +3439 -0
  11. package/dist/chunk-0pnk52c2.js +116 -0
  12. package/dist/chunk-0sbddf6m.js +68 -0
  13. package/dist/chunk-0vf7xb84.js +176 -0
  14. package/dist/chunk-0yz17yjy.js +1061 -0
  15. package/dist/chunk-0zscb6c7.js +10 -0
  16. package/dist/chunk-10p21kq6.js +378 -0
  17. package/dist/chunk-17k78pmz.js +120 -0
  18. package/dist/chunk-19jvvqzp.js +1390 -0
  19. package/dist/chunk-1d5czqnr.js +173 -0
  20. package/dist/chunk-1gjysfnf.js +13876 -0
  21. package/dist/chunk-1jjfv0wd.js +467 -0
  22. package/dist/chunk-1jjzp2pa.js +617 -0
  23. package/dist/chunk-1m38dj2k.js +155 -0
  24. package/dist/chunk-1pgttway.js +211 -0
  25. package/dist/chunk-1vvnx0gb.js +8035 -0
  26. package/dist/chunk-1ztm9yps.js +49145 -0
  27. package/dist/chunk-208x1t0m.js +88 -0
  28. package/dist/chunk-20xqs3yk.js +843 -0
  29. package/dist/chunk-2b2c0wnn.js +584 -0
  30. package/dist/chunk-2g07117j.js +541 -0
  31. package/dist/chunk-2g6p2t3w.js +780 -0
  32. package/dist/chunk-2kjeaeg7.js +28 -0
  33. package/dist/chunk-2n0s2dhc.js +12 -0
  34. package/dist/chunk-2p0hvt8k.js +785 -0
  35. package/dist/chunk-2qmxg9y7.js +40174 -0
  36. package/dist/chunk-2qpy8kne.js +28 -0
  37. package/dist/chunk-2rgbf62a.js +40 -0
  38. package/dist/chunk-2tx0s41y.js +150 -0
  39. package/dist/chunk-2x8zk5cz.js +101 -0
  40. package/dist/chunk-2yqy25z4.js +48 -0
  41. package/dist/chunk-318g78ty.js +552 -0
  42. package/dist/chunk-31gfg8tz.js +290 -0
  43. package/dist/chunk-32n0s532.js +1317 -0
  44. package/dist/chunk-35dw2r9g.js +137 -0
  45. package/dist/chunk-36b5zqvn.js +1865 -0
  46. package/dist/chunk-38kpx69j.js +97 -0
  47. package/dist/chunk-3b01vp8p.js +815 -0
  48. package/dist/chunk-3f76a1ek.js +317 -0
  49. package/dist/chunk-3fd1hkhh.js +4254 -0
  50. package/dist/chunk-3ffxa7zj.js +8 -0
  51. package/dist/chunk-3gcj7w95.js +8 -0
  52. package/dist/chunk-3jf3k40v.js +970 -0
  53. package/dist/chunk-3k51qfp9.js +9301 -0
  54. package/dist/chunk-3mhygd2v.js +1180 -0
  55. package/dist/chunk-3p6y0gvb.js +117 -0
  56. package/dist/chunk-3r60xdt5.js +93 -0
  57. package/dist/chunk-43agf6xv.js +8 -0
  58. package/dist/chunk-46zr418r.js +15 -0
  59. package/dist/chunk-48k2bs4w.js +118 -0
  60. package/dist/chunk-4p987a4z.js +84 -0
  61. package/dist/chunk-4px25pe0.js +776 -0
  62. package/dist/chunk-4s93jyky.js +113 -0
  63. package/dist/chunk-4xv8bedf.js +58 -0
  64. package/dist/chunk-4y382mzd.js +346 -0
  65. package/dist/chunk-52dzw4bc.js +246 -0
  66. package/dist/chunk-52qqmh5g.js +110 -0
  67. package/dist/chunk-53grnhp7.js +8 -0
  68. package/dist/chunk-59craaxx.js +4249 -0
  69. package/dist/chunk-5b833jqs.js +96 -0
  70. package/dist/chunk-5cp2q9sh.js +58 -0
  71. package/dist/chunk-5dbaxmts.js +87 -0
  72. package/dist/chunk-5f5sxgp0.js +96 -0
  73. package/dist/chunk-5mkfderj.js +195 -0
  74. package/dist/chunk-5qw0mpvq.js +389 -0
  75. package/dist/chunk-5rxmszm8.js +48 -0
  76. package/dist/chunk-5ygxa3hr.js +65 -0
  77. package/dist/chunk-61d5dqq2.js +71 -0
  78. package/dist/chunk-6350958y.js +272 -0
  79. package/dist/chunk-65z8hg8j.js +1337 -0
  80. package/dist/chunk-6aq85gdq.js +8 -0
  81. package/dist/chunk-6cjh9exg.js +40751 -0
  82. package/dist/chunk-6e41p5m6.js +187 -0
  83. package/dist/chunk-6jb6xcnq.js +10511 -0
  84. package/dist/chunk-6jta29r1.js +20 -0
  85. package/dist/chunk-6q7f2rrv.js +4757 -0
  86. package/dist/chunk-6sg0ec6v.js +41 -0
  87. package/dist/chunk-6v0rhx4e.js +328 -0
  88. package/dist/chunk-6x5mz95v.js +751 -0
  89. package/dist/chunk-6xqp51qr.js +87 -0
  90. package/dist/chunk-6xvyx1s9.js +6957 -0
  91. package/dist/chunk-6ywh7wgp.js +468 -0
  92. package/dist/chunk-75ne77gm.js +1920 -0
  93. package/dist/chunk-77cb06js.js +602 -0
  94. package/dist/chunk-78n9kfp8.js +1645 -0
  95. package/dist/chunk-7be87rww.js +277 -0
  96. package/dist/chunk-7e1qjk3s.js +125 -0
  97. package/dist/chunk-7e7nxnss.js +360 -0
  98. package/dist/chunk-7g8156qp.js +55 -0
  99. package/dist/chunk-7nz71s42.js +3353 -0
  100. package/dist/chunk-7r078t2x.js +113 -0
  101. package/dist/chunk-7shx41hj.js +3094 -0
  102. package/dist/chunk-7yexhdjs.js +216 -0
  103. package/dist/chunk-83kmfcjv.js +256 -0
  104. package/dist/chunk-846rr9n1.js +107 -0
  105. package/dist/chunk-84ncsm1r.js +183 -0
  106. package/dist/chunk-867x8aq0.js +8936 -0
  107. package/dist/chunk-8byh30kb.js +1947 -0
  108. package/dist/chunk-8c8f6gnt.js +432 -0
  109. package/dist/chunk-8gtdseev.js +454 -0
  110. package/dist/chunk-8jfh9rq6.js +642 -0
  111. package/dist/chunk-8n4n4m67.js +800 -0
  112. package/dist/chunk-8za61tze.js +847 -0
  113. package/dist/chunk-9029sbq1.js +57 -0
  114. package/dist/chunk-94dm5rrm.js +673 -0
  115. package/dist/chunk-9bs8n985.js +329 -0
  116. package/dist/chunk-9c23776j.js +763 -0
  117. package/dist/chunk-9e93g81n.js +298 -0
  118. package/dist/chunk-9f3d61y7.js +548 -0
  119. package/dist/chunk-9gc3andd.js +422 -0
  120. package/dist/chunk-9kn3tgpb.js +130 -0
  121. package/dist/chunk-9m5rn7hk.js +61 -0
  122. package/dist/chunk-9p4hsd6a.js +50 -0
  123. package/dist/chunk-9qasfk8n.js +758 -0
  124. package/dist/chunk-9snp5mn2.js +533 -0
  125. package/dist/chunk-9tcvras3.js +2331 -0
  126. package/dist/chunk-a0186ngk.js +57 -0
  127. package/dist/chunk-a2m8f0aj.js +268 -0
  128. package/dist/chunk-a2rcafav.js +716 -0
  129. package/dist/chunk-a9hjdzar.js +160 -0
  130. package/dist/chunk-aak6ts5n.js +526 -0
  131. package/dist/chunk-aca3w84n.js +267 -0
  132. package/dist/chunk-ae76ded0.js +30 -0
  133. package/dist/chunk-afnjhn3j.js +21933 -0
  134. package/dist/chunk-ahj70tf0.js +880 -0
  135. package/dist/chunk-apjsxssq.js +169 -0
  136. package/dist/chunk-av49wjj1.js +43 -0
  137. package/dist/chunk-axggebfy.js +206 -0
  138. package/dist/chunk-az7jpbv8.js +16 -0
  139. package/dist/chunk-azz7sep6.js +328 -0
  140. package/dist/chunk-b4tpz2g1.js +93 -0
  141. package/dist/chunk-bczf2eyq.js +115 -0
  142. package/dist/chunk-bd95f637.js +208 -0
  143. package/dist/chunk-bdhdmkya.js +10 -0
  144. package/dist/chunk-bp0ynk17.js +32 -0
  145. package/dist/chunk-bq75gxjs.js +90 -0
  146. package/dist/chunk-btk5jaq6.js +10464 -0
  147. package/dist/chunk-bv4c48a5.js +120 -0
  148. package/dist/chunk-byfb105n.js +341 -0
  149. package/dist/chunk-c0bdmy7w.js +4223 -0
  150. package/dist/chunk-c20aqkz8.js +641 -0
  151. package/dist/chunk-c4jg3s2c.js +163 -0
  152. package/dist/chunk-c61q5cer.js +258 -0
  153. package/dist/chunk-c9f761sy.js +386 -0
  154. package/dist/chunk-ca6jkz06.js +157 -0
  155. package/dist/chunk-ccyg9ap9.js +171374 -0
  156. package/dist/chunk-cfej8cc7.js +371 -0
  157. package/dist/chunk-cjqxdnf9.js +23 -0
  158. package/dist/chunk-ckrs789w.js +8 -0
  159. package/dist/chunk-cqeq13wg.js +48 -0
  160. package/dist/chunk-crfj3w5e.js +22821 -0
  161. package/dist/chunk-ct5x6z7g.js +8066 -0
  162. package/dist/chunk-cv5h8n8c.js +101 -0
  163. package/dist/chunk-cwe8h159.js +1563 -0
  164. package/dist/chunk-cwm234zz.js +908 -0
  165. package/dist/chunk-d1jkfp45.js +1580 -0
  166. package/dist/chunk-d3hb1qdr.js +126 -0
  167. package/dist/chunk-d70d0zer.js +713 -0
  168. package/dist/chunk-d91tx29f.js +105 -0
  169. package/dist/chunk-d952pymh.js +20 -0
  170. package/dist/chunk-d9af3z8k.js +720 -0
  171. package/dist/chunk-da1n53c2.js +47 -0
  172. package/dist/chunk-df5c1x8m.js +732 -0
  173. package/dist/chunk-dkv64xys.js +71 -0
  174. package/dist/chunk-dm7166v6.js +251 -0
  175. package/dist/chunk-dr0y5a61.js +258 -0
  176. package/dist/chunk-drzb0rrd.js +306 -0
  177. package/dist/chunk-dw1v1q7w.js +37 -0
  178. package/dist/chunk-e224qet4.js +348 -0
  179. package/dist/chunk-e50ckbv0.js +1099 -0
  180. package/dist/chunk-e5gn6by6.js +1165 -0
  181. package/dist/chunk-e7m3f74m.js +37 -0
  182. package/dist/chunk-e8ghgwaj.js +295 -0
  183. package/dist/chunk-ed8k4ya2.js +41 -0
  184. package/dist/chunk-eh0vnqdz.js +76 -0
  185. package/dist/chunk-epwrzr35.js +4301 -0
  186. package/dist/chunk-er9h6sw5.js +5379 -0
  187. package/dist/chunk-eta5aekm.js +79 -0
  188. package/dist/chunk-ev5gxscq.js +63 -0
  189. package/dist/chunk-evp72hv5.js +212 -0
  190. package/dist/chunk-ex41stfq.js +127 -0
  191. package/dist/chunk-ezpa510h.js +62 -0
  192. package/dist/chunk-f0fm6dey.js +477 -0
  193. package/dist/chunk-f239sbhc.js +152 -0
  194. package/dist/chunk-f2bj47xf.js +109 -0
  195. package/dist/chunk-f4t24rq4.js +258 -0
  196. package/dist/chunk-f9ghvzy8.js +106 -0
  197. package/dist/chunk-f9rahzgr.js +99 -0
  198. package/dist/chunk-ff75qzty.js +521 -0
  199. package/dist/chunk-fj0ctt6q.js +264 -0
  200. package/dist/chunk-fj7wxdt3.js +221 -0
  201. package/dist/chunk-fnnpqv92.js +714 -0
  202. package/dist/chunk-fpd3zzx1.js +26696 -0
  203. package/dist/chunk-fqv2cn76.js +227 -0
  204. package/dist/chunk-fqw9j3bj.js +439 -0
  205. package/dist/chunk-frbcqhz0.js +4984 -0
  206. package/dist/chunk-fzkj59sg.js +174 -0
  207. package/dist/chunk-fzpzbpbw.js +248 -0
  208. package/dist/chunk-g52cpmd1.js +686 -0
  209. package/dist/chunk-g98m2qe6.js +31 -0
  210. package/dist/chunk-g9zgq4vy.js +715 -0
  211. package/dist/chunk-gbpt7tm8.js +687 -0
  212. package/dist/chunk-gg52jka8.js +373 -0
  213. package/dist/chunk-gjttphax.js +5793 -0
  214. package/dist/chunk-gs7vjaas.js +65 -0
  215. package/dist/chunk-gv8n85j2.js +8 -0
  216. package/dist/chunk-gxdwm6pt.js +650 -0
  217. package/dist/chunk-gy8wajg2.js +1014 -0
  218. package/dist/chunk-gz3647m0.js +200 -0
  219. package/dist/chunk-gzg07mqh.js +16 -0
  220. package/dist/chunk-h3zc60tq.js +44 -0
  221. package/dist/chunk-h4p1qt16.js +74 -0
  222. package/dist/chunk-h8219f18.js +282 -0
  223. package/dist/chunk-h9agq92v.js +331 -0
  224. package/dist/chunk-hhjtpwbj.js +16 -0
  225. package/dist/chunk-hpgpwzra.js +548 -0
  226. package/dist/chunk-hsnjvn19.js +80 -0
  227. package/dist/chunk-hsp9qrry.js +417 -0
  228. package/dist/chunk-hwz6aq2m.js +3939 -0
  229. package/dist/chunk-hzph0hbh.js +272 -0
  230. package/dist/chunk-hzqkss6v.js +153 -0
  231. package/dist/chunk-j0t31f39.js +1149 -0
  232. package/dist/chunk-j1qm6n1v.js +30 -0
  233. package/dist/chunk-j6e4b522.js +81 -0
  234. package/dist/chunk-j7qfbvxk.js +84 -0
  235. package/dist/chunk-j7qv3hvm.js +1635 -0
  236. package/dist/chunk-j8mxc6k6.js +213 -0
  237. package/dist/chunk-jevj87jn.js +224 -0
  238. package/dist/chunk-jk2ps88q.js +815 -0
  239. package/dist/chunk-jz7tbdyv.js +1599 -0
  240. package/dist/chunk-k36jpjvh.js +300 -0
  241. package/dist/chunk-k4nmrt3w.js +61 -0
  242. package/dist/chunk-kavn03r9.js +16606 -0
  243. package/dist/chunk-kkgav8dm.js +54 -0
  244. package/dist/chunk-kkq26g5c.js +33 -0
  245. package/dist/chunk-kp6nepx4.js +106 -0
  246. package/dist/chunk-ksefybc8.js +1551 -0
  247. package/dist/chunk-kv147680.js +3436 -0
  248. package/dist/chunk-kya46axt.js +833 -0
  249. package/dist/chunk-kyz233ny.js +227 -0
  250. package/dist/chunk-kzs75xmj.js +143 -0
  251. package/dist/chunk-m0vrez9w.js +266 -0
  252. package/dist/chunk-m1wadav3.js +118 -0
  253. package/dist/chunk-m4rfx3cj.js +221 -0
  254. package/dist/chunk-mc9zaggs.js +6374 -0
  255. package/dist/chunk-mcg5ttj4.js +105 -0
  256. package/dist/chunk-mf4r7918.js +63 -0
  257. package/dist/chunk-mh9khrt4.js +286 -0
  258. package/dist/chunk-mhc4szw7.js +22 -0
  259. package/dist/chunk-mkq0yzp0.js +38 -0
  260. package/dist/chunk-mr58jv4w.js +256 -0
  261. package/dist/chunk-mrrx3bmt.js +168 -0
  262. package/dist/chunk-mtyk3zz6.js +87 -0
  263. package/dist/chunk-mvgxntv6.js +62 -0
  264. package/dist/chunk-mwnjydcm.js +102 -0
  265. package/dist/chunk-mwxt0m3f.js +862 -0
  266. package/dist/chunk-mz1pxck8.js +998 -0
  267. package/dist/chunk-n3agghys.js +214 -0
  268. package/dist/chunk-n6q02ya9.js +442 -0
  269. package/dist/chunk-nt3y91vh.js +443 -0
  270. package/dist/chunk-nt837qt9.js +21 -0
  271. package/dist/chunk-ntgmegfs.js +39 -0
  272. package/dist/chunk-nwk16bbd.js +30 -0
  273. package/dist/chunk-p367ay90.js +672 -0
  274. package/dist/chunk-p7m3x9qk.js +48 -0
  275. package/dist/chunk-pagmjwp5.js +132 -0
  276. package/dist/chunk-pbd4r8ek.js +161 -0
  277. package/dist/chunk-pdkpssgv.js +2422 -0
  278. package/dist/chunk-pf6z1e35.js +32 -0
  279. package/dist/chunk-pfzejvpt.js +213 -0
  280. package/dist/chunk-pktxyhvk.js +400 -0
  281. package/dist/chunk-pp5xhveq.js +124 -0
  282. package/dist/chunk-ppnd7a8x.js +38 -0
  283. package/dist/chunk-pqh2w7dr.js +2202 -0
  284. package/dist/chunk-pr878d0z.js +240 -0
  285. package/dist/chunk-psf0y7hy.js +140 -0
  286. package/dist/chunk-pz2zz2f7.js +1586 -0
  287. package/dist/chunk-q0xkrxy8.js +890 -0
  288. package/dist/chunk-q5b0kpr3.js +14369 -0
  289. package/dist/chunk-q7z3t531.js +334 -0
  290. package/dist/chunk-qdjjtgwt.js +3183 -0
  291. package/dist/chunk-qezv7msv.js +26 -0
  292. package/dist/chunk-qmxn7f86.js +2643 -0
  293. package/dist/chunk-qqc3b97c.js +15 -0
  294. package/dist/chunk-qwrp63wh.js +145 -0
  295. package/dist/chunk-qyvqbst3.js +537 -0
  296. package/dist/chunk-qztvd4hd.js +465 -0
  297. package/dist/chunk-r0bvez4y.js +235 -0
  298. package/dist/chunk-r3z0896k.js +2831 -0
  299. package/dist/chunk-r4cxb6t7.js +32 -0
  300. package/dist/chunk-rb8k68m7.js +118 -0
  301. package/dist/chunk-rdprgm4t.js +42 -0
  302. package/dist/chunk-rex82hys.js +1710 -0
  303. package/dist/chunk-rjjakkw2.js +2560 -0
  304. package/dist/chunk-rka6gcv3.js +304 -0
  305. package/dist/chunk-rkz12ghm.js +144 -0
  306. package/dist/chunk-rnc7m1qs.js +436 -0
  307. package/dist/chunk-rx6z23h0.js +165 -0
  308. package/dist/chunk-s76582j1.js +28 -0
  309. package/dist/chunk-sez03qd9.js +7140 -0
  310. package/dist/chunk-sjvdn2ep.js +130 -0
  311. package/dist/chunk-smwhyy8p.js +115 -0
  312. package/dist/chunk-snw7nh0d.js +695 -0
  313. package/dist/chunk-sqx9c057.js +193 -0
  314. package/dist/chunk-sscms68s.js +16 -0
  315. package/dist/chunk-stknnmsb.js +272 -0
  316. package/dist/chunk-sywdxbs6.js +853 -0
  317. package/dist/chunk-syxy4pf2.js +782 -0
  318. package/dist/chunk-t0hpqsqn.js +6157 -0
  319. package/dist/chunk-tjm70vnw.js +123 -0
  320. package/dist/chunk-trzh0msn.js +154 -0
  321. package/dist/chunk-v1z17cpg.js +723 -0
  322. package/dist/chunk-vsfj449x.js +333 -0
  323. package/dist/chunk-vvkq20tt.js +287 -0
  324. package/dist/chunk-vxgdzx6p.js +338 -0
  325. package/dist/chunk-vxqhjyfz.js +15 -0
  326. package/dist/chunk-vzsstfmb.js +80 -0
  327. package/dist/chunk-w1jew5sn.js +69 -0
  328. package/dist/chunk-w3kwr76v.js +789 -0
  329. package/dist/chunk-w40netr9.js +59 -0
  330. package/dist/chunk-w99cpfdg.js +559 -0
  331. package/dist/chunk-wacn14d2.js +271 -0
  332. package/dist/chunk-wbhrqrq3.js +3033 -0
  333. package/dist/chunk-wfg9g0p7.js +17612 -0
  334. package/dist/chunk-wj3vjsbx.js +93 -0
  335. package/dist/chunk-wjhq855a.js +372 -0
  336. package/dist/chunk-wr06gqxh.js +114 -0
  337. package/dist/chunk-ws0z2y1g.js +195 -0
  338. package/dist/chunk-wt62wqcj.js +98 -0
  339. package/dist/chunk-wx4v7ddx.js +42 -0
  340. package/dist/chunk-wy0t3vb2.js +6101 -0
  341. package/dist/chunk-wysz7qk4.js +280 -0
  342. package/dist/chunk-x63fx1vd.js +192 -0
  343. package/dist/chunk-x8b7vft8.js +132 -0
  344. package/dist/chunk-x8jhkgxb.js +346 -0
  345. package/dist/chunk-x9z4q5k5.js +275 -0
  346. package/dist/chunk-xjd7e9jq.js +126 -0
  347. package/dist/chunk-xjr0n27e.js +42 -0
  348. package/dist/chunk-xpwyw7cd.js +24 -0
  349. package/dist/chunk-xw4ycnyz.js +37 -0
  350. package/dist/chunk-y66bqywr.js +17303 -0
  351. package/dist/chunk-ycarry7d.js +157 -0
  352. package/dist/chunk-ycr0hp6v.js +1486 -0
  353. package/dist/chunk-yqmaw6hf.js +496 -0
  354. package/dist/chunk-yrtm7d23.js +602 -0
  355. package/dist/chunk-yts879rw.js +48 -0
  356. package/dist/chunk-yvmhx96e.js +347 -0
  357. package/dist/chunk-ywq00rg4.js +246 -0
  358. package/dist/chunk-yygeg5mj.js +752 -0
  359. package/dist/chunk-z0exw850.js +726 -0
  360. package/dist/chunk-z2dp53wn.js +17 -0
  361. package/dist/chunk-z4rzc9nd.js +103 -0
  362. package/dist/chunk-zb0akt77.js +684 -0
  363. package/dist/chunk-zb2xrj5t.js +1789 -0
  364. package/dist/chunk-zbptn0ky.js +423 -0
  365. package/dist/chunk-zd45wbmf.js +1090 -0
  366. package/dist/chunk-zjkvspz9.js +2050 -0
  367. package/dist/chunk-zke1sp3x.js +1524 -0
  368. package/dist/chunk-zv2cvfsv.js +58 -0
  369. package/dist/chunk-zy4tmqst.js +644 -0
  370. package/dist/chunk-zygzzzvk.js +192 -0
  371. package/dist/cli-21v3v6ny.md +1 -0
  372. package/dist/cli.js +246 -0
  373. package/dist/server-n5f2q89z.md +1 -0
  374. package/package.json +161 -0
@@ -0,0 +1,3439 @@
1
+ // @bun
2
+ import"./chunk-jevj87jn.js";
3
+ import {
4
+ Byline,
5
+ ConfigurableShortcutHint,
6
+ Dialog,
7
+ KeyboardShortcutHint,
8
+ init_Byline,
9
+ init_ConfigurableShortcutHint,
10
+ init_Dialog,
11
+ init_KeyboardShortcutHint
12
+ } from "./chunk-qztvd4hd.js";
13
+ import"./chunk-q0xkrxy8.js";
14
+ import"./chunk-52dzw4bc.js";
15
+ import"./chunk-n6q02ya9.js";
16
+ import"./chunk-b4tpz2g1.js";
17
+ import"./chunk-n3agghys.js";
18
+ import {
19
+ init_useExitOnCtrlCDWithKeybindings,
20
+ useExitOnCtrlCDWithKeybindings
21
+ } from "./chunk-f9rahzgr.js";
22
+ import"./chunk-ex41stfq.js";
23
+ import {
24
+ init_useKeybinding,
25
+ init_useTerminalSize,
26
+ useKeybinding,
27
+ useKeybindings,
28
+ useTerminalSize
29
+ } from "./chunk-8n4n4m67.js";
30
+ import"./chunk-xjr0n27e.js";
31
+ import {
32
+ require_jsx_dev_runtime,
33
+ require_react
34
+ } from "./chunk-0yz17yjy.js";
35
+ import {
36
+ init_browser,
37
+ openBrowser
38
+ } from "./chunk-9m5rn7hk.js";
39
+ import"./chunk-19jvvqzp.js";
40
+ import"./chunk-2n0s2dhc.js";
41
+ import"./chunk-epwrzr35.js";
42
+ import"./chunk-1ztm9yps.js";
43
+ import"./chunk-78n9kfp8.js";
44
+ import"./chunk-j8mxc6k6.js";
45
+ import"./chunk-z0exw850.js";
46
+ import"./chunk-3jf3k40v.js";
47
+ import"./chunk-yvmhx96e.js";
48
+ import"./chunk-qezv7msv.js";
49
+ import"./chunk-sscms68s.js";
50
+ import"./chunk-7e1qjk3s.js";
51
+ import"./chunk-1gjysfnf.js";
52
+ import"./chunk-vxgdzx6p.js";
53
+ import"./chunk-kv147680.js";
54
+ import"./chunk-2p0hvt8k.js";
55
+ import"./chunk-ycr0hp6v.js";
56
+ import"./chunk-zb2xrj5t.js";
57
+ import"./chunk-9029sbq1.js";
58
+ import {
59
+ init_analytics,
60
+ logEvent
61
+ } from "./chunk-ezpa510h.js";
62
+ import"./chunk-kp6nepx4.js";
63
+ import"./chunk-1jjzp2pa.js";
64
+ import"./chunk-w1jew5sn.js";
65
+ import"./chunk-g98m2qe6.js";
66
+ import {
67
+ execFileNoThrow,
68
+ execa,
69
+ figures_default,
70
+ init_execFileNoThrow,
71
+ init_execa,
72
+ init_figures
73
+ } from "./chunk-sez03qd9.js";
74
+ import {
75
+ init_log,
76
+ logError
77
+ } from "./chunk-vsfj449x.js";
78
+ import"./chunk-r4cxb6t7.js";
79
+ import"./chunk-bp0ynk17.js";
80
+ import"./chunk-7yexhdjs.js";
81
+ import"./chunk-rex82hys.js";
82
+ import"./chunk-4s93jyky.js";
83
+ import"./chunk-318g78ty.js";
84
+ import"./chunk-c0bdmy7w.js";
85
+ import"./chunk-syxy4pf2.js";
86
+ import {
87
+ __esm,
88
+ __toESM
89
+ } from "./chunk-eta5aekm.js";
90
+ import {
91
+ OAuthService,
92
+ Select,
93
+ SelectMulti,
94
+ Spinner,
95
+ TextInput,
96
+ __INVALID__REF__,
97
+ init_CustomSelect,
98
+ init_SelectMulti,
99
+ init_Spinner,
100
+ init_TextInput,
101
+ init_oauth
102
+ } from "./chunk-ccyg9ap9.js";
103
+ import"./chunk-846rr9n1.js";
104
+ import"./chunk-fnnpqv92.js";
105
+ import"./chunk-2yqy25z4.js";
106
+ import"./chunk-zygzzzvk.js";
107
+ import"./chunk-evp72hv5.js";
108
+ import"./chunk-jz7tbdyv.js";
109
+ import"./chunk-vxqhjyfz.js";
110
+ import"./chunk-mf4r7918.js";
111
+ import"./chunk-sywdxbs6.js";
112
+ import"./chunk-cjqxdnf9.js";
113
+ import"./chunk-9qasfk8n.js";
114
+ import {
115
+ Link,
116
+ ThemedBox_default,
117
+ ThemedText,
118
+ color,
119
+ init_ink,
120
+ init_osc,
121
+ require_compiler_runtime,
122
+ setClipboard,
123
+ useTheme
124
+ } from "./chunk-fpd3zzx1.js";
125
+ import"./chunk-bv4c48a5.js";
126
+ import"./chunk-6jta29r1.js";
127
+ import"./chunk-z4rzc9nd.js";
128
+ import"./chunk-9bs8n985.js";
129
+ import"./chunk-6xqp51qr.js";
130
+ import"./chunk-35dw2r9g.js";
131
+ import {
132
+ getAnthropicApiKey,
133
+ init_auth,
134
+ init_config1 as init_config,
135
+ init_stringUtils,
136
+ isAnthropicAuthEnabled,
137
+ plural,
138
+ saveGlobalConfig,
139
+ saveOAuthTokensIfNeeded
140
+ } from "./chunk-y66bqywr.js";
141
+ import"./chunk-nwk16bbd.js";
142
+ import"./chunk-rx6z23h0.js";
143
+ import"./chunk-df5c1x8m.js";
144
+ import"./chunk-qwrp63wh.js";
145
+ import {
146
+ getGithubRepo,
147
+ init_git
148
+ } from "./chunk-65z8hg8j.js";
149
+ import"./chunk-5cp2q9sh.js";
150
+ import"./chunk-rjjakkw2.js";
151
+ import"./chunk-0sbddf6m.js";
152
+ import"./chunk-q5b0kpr3.js";
153
+
154
+ // src/components/WorkflowMultiselectDialog.tsx
155
+ function renderInputGuide(exitState) {
156
+ if (exitState.pending) {
157
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
158
+ children: [
159
+ "Press ",
160
+ exitState.keyName,
161
+ " again to exit"
162
+ ]
163
+ }, undefined, true, undefined, this);
164
+ }
165
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Byline, {
166
+ children: [
167
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
168
+ shortcut: "\u2191\u2193",
169
+ action: "navigate"
170
+ }, undefined, false, undefined, this),
171
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
172
+ shortcut: "Space",
173
+ action: "toggle"
174
+ }, undefined, false, undefined, this),
175
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
176
+ shortcut: "Enter",
177
+ action: "confirm"
178
+ }, undefined, false, undefined, this),
179
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
180
+ action: "confirm:no",
181
+ context: "Confirmation",
182
+ fallback: "Esc",
183
+ description: "cancel"
184
+ }, undefined, false, undefined, this)
185
+ ]
186
+ }, undefined, true, undefined, this);
187
+ }
188
+ function WorkflowMultiselectDialog(t0) {
189
+ const $ = import_compiler_runtime.c(14);
190
+ const {
191
+ onSubmit,
192
+ defaultSelections
193
+ } = t0;
194
+ const [showError, setShowError] = import_react.useState(false);
195
+ let t1;
196
+ if ($[0] !== onSubmit) {
197
+ t1 = (selectedValues) => {
198
+ if (selectedValues.length === 0) {
199
+ setShowError(true);
200
+ return;
201
+ }
202
+ setShowError(false);
203
+ onSubmit(selectedValues);
204
+ };
205
+ $[0] = onSubmit;
206
+ $[1] = t1;
207
+ } else {
208
+ t1 = $[1];
209
+ }
210
+ const handleSubmit = t1;
211
+ let t2;
212
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
213
+ t2 = () => {
214
+ setShowError(false);
215
+ };
216
+ $[2] = t2;
217
+ } else {
218
+ t2 = $[2];
219
+ }
220
+ const handleChange = t2;
221
+ let t3;
222
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
223
+ t3 = () => {
224
+ setShowError(true);
225
+ };
226
+ $[3] = t3;
227
+ } else {
228
+ t3 = $[3];
229
+ }
230
+ const handleCancel = t3;
231
+ let t4;
232
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
233
+ t4 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
234
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
235
+ dimColor: true,
236
+ children: [
237
+ "More workflow examples (issue triage, CI fixes, etc.) at:",
238
+ " ",
239
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Link, {
240
+ url: "https://github.com/anthropics/claude-code-action/blob/main/examples/",
241
+ children: "https://github.com/anthropics/claude-code-action/blob/main/examples/"
242
+ }, undefined, false, undefined, this)
243
+ ]
244
+ }, undefined, true, undefined, this)
245
+ }, undefined, false, undefined, this);
246
+ $[4] = t4;
247
+ } else {
248
+ t4 = $[4];
249
+ }
250
+ let t5;
251
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
252
+ t5 = WORKFLOWS.map(_temp);
253
+ $[5] = t5;
254
+ } else {
255
+ t5 = $[5];
256
+ }
257
+ let t6;
258
+ if ($[6] !== defaultSelections || $[7] !== handleSubmit) {
259
+ t6 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(SelectMulti, {
260
+ options: t5,
261
+ defaultValue: defaultSelections,
262
+ onSubmit: handleSubmit,
263
+ onChange: handleChange,
264
+ onCancel: handleCancel,
265
+ hideIndexes: true
266
+ }, undefined, false, undefined, this);
267
+ $[6] = defaultSelections;
268
+ $[7] = handleSubmit;
269
+ $[8] = t6;
270
+ } else {
271
+ t6 = $[8];
272
+ }
273
+ let t7;
274
+ if ($[9] !== showError) {
275
+ t7 = showError && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
276
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
277
+ color: "error",
278
+ children: "You must select at least one workflow to continue"
279
+ }, undefined, false, undefined, this)
280
+ }, undefined, false, undefined, this);
281
+ $[9] = showError;
282
+ $[10] = t7;
283
+ } else {
284
+ t7 = $[10];
285
+ }
286
+ let t8;
287
+ if ($[11] !== t6 || $[12] !== t7) {
288
+ t8 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Dialog, {
289
+ title: "Select GitHub workflows to install",
290
+ subtitle: "We'll create a workflow file in your repository for each one you select.",
291
+ onCancel: handleCancel,
292
+ inputGuide: renderInputGuide,
293
+ children: [
294
+ t4,
295
+ t6,
296
+ t7
297
+ ]
298
+ }, undefined, true, undefined, this);
299
+ $[11] = t6;
300
+ $[12] = t7;
301
+ $[13] = t8;
302
+ } else {
303
+ t8 = $[13];
304
+ }
305
+ return t8;
306
+ }
307
+ function _temp(workflow) {
308
+ return {
309
+ label: workflow.label,
310
+ value: workflow.value
311
+ };
312
+ }
313
+ var import_compiler_runtime, import_react, jsx_dev_runtime, WORKFLOWS;
314
+ var init_WorkflowMultiselectDialog = __esm(() => {
315
+ init_ink();
316
+ init_ConfigurableShortcutHint();
317
+ init_SelectMulti();
318
+ init_Byline();
319
+ init_Dialog();
320
+ init_KeyboardShortcutHint();
321
+ import_compiler_runtime = __toESM(require_compiler_runtime(), 1);
322
+ import_react = __toESM(require_react(), 1);
323
+ jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
324
+ WORKFLOWS = [{
325
+ value: "claude",
326
+ label: "@Claude Code - Tag @claude in issues and PR comments"
327
+ }, {
328
+ value: "claude-review",
329
+ label: "Claude Code Review - Automated code review on new PRs"
330
+ }];
331
+ });
332
+
333
+ // src/constants/github-app.ts
334
+ 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
335
+
336
+ on:
337
+ issue_comment:
338
+ types: [created]
339
+ pull_request_review_comment:
340
+ types: [created]
341
+ issues:
342
+ types: [opened, assigned]
343
+ pull_request_review:
344
+ types: [submitted]
345
+
346
+ jobs:
347
+ claude:
348
+ if: |
349
+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
350
+ (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
351
+ (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
352
+ (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
353
+ runs-on: ubuntu-latest
354
+ permissions:
355
+ contents: read
356
+ pull-requests: read
357
+ issues: read
358
+ id-token: write
359
+ actions: read # Required for Claude to read CI results on PRs
360
+ steps:
361
+ - name: Checkout repository
362
+ uses: actions/checkout@v4
363
+ with:
364
+ fetch-depth: 1
365
+
366
+ - name: Run Claude Code
367
+ id: claude
368
+ uses: anthropics/claude-code-action@v1
369
+ with:
370
+ anthropic_api_key: \${{ secrets.ANTHROPIC_API_KEY }}
371
+
372
+ # This is an optional setting that allows Claude to read CI results on PRs
373
+ additional_permissions: |
374
+ actions: read
375
+
376
+ # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
377
+ # prompt: 'Update the pull request description to include a summary of changes.'
378
+
379
+ # Optional: Add claude_args to customize behavior and configuration
380
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
381
+ # or https://code.claude.com/docs/en/cli-reference for available options
382
+ # claude_args: '--allowed-tools Bash(gh pr:*)'
383
+
384
+ `, PR_BODY = `## \uD83E\uDD16 Installing Claude Code GitHub App
385
+
386
+ This PR adds a GitHub Actions workflow that enables Claude Code integration in our repository.
387
+
388
+ ### What is Claude Code?
389
+
390
+ [Claude Code](https://claude.com/claude-code) is an AI coding agent that can help with:
391
+ - Bug fixes and improvements
392
+ - Documentation updates
393
+ - Implementing new features
394
+ - Code reviews and suggestions
395
+ - Writing tests
396
+ - And more!
397
+
398
+ ### How it works
399
+
400
+ Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment.
401
+ Once the workflow is triggered, Claude will analyze the comment and surrounding context, and execute on the request in a GitHub action.
402
+
403
+ ### Important Notes
404
+
405
+ - **This workflow won't take effect until this PR is merged**
406
+ - **@claude mentions won't work until after the merge is complete**
407
+ - The workflow runs automatically whenever Claude is mentioned in PR or issue comments
408
+ - Claude gets access to the entire PR or issue context including files, diffs, and previous comments
409
+
410
+ ### Security
411
+
412
+ - Our Anthropic API key is securely stored as a GitHub Actions secret
413
+ - Only users with write access to the repository can trigger the workflow
414
+ - All Claude runs are stored in the GitHub Actions run history
415
+ - Claude's default tools are limited to reading/writing files and interacting with our repo by creating comments, branches, and commits.
416
+ - We can add more allowed tools by adding them to the workflow file like:
417
+
418
+ \`\`\`
419
+ allowed_tools: Bash(npm install),Bash(npm run build),Bash(npm run lint),Bash(npm run test)
420
+ \`\`\`
421
+
422
+ There's more information in the [Claude Code action repo](https://github.com/anthropics/claude-code-action).
423
+
424
+ 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
425
+
426
+ on:
427
+ pull_request:
428
+ types: [opened, synchronize, ready_for_review, reopened]
429
+ # Optional: Only run on specific file changes
430
+ # paths:
431
+ # - "src/**/*.ts"
432
+ # - "src/**/*.tsx"
433
+ # - "src/**/*.js"
434
+ # - "src/**/*.jsx"
435
+
436
+ jobs:
437
+ claude-review:
438
+ # Optional: Filter by PR author
439
+ # if: |
440
+ # github.event.pull_request.user.login == 'external-contributor' ||
441
+ # github.event.pull_request.user.login == 'new-developer' ||
442
+ # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
443
+
444
+ runs-on: ubuntu-latest
445
+ permissions:
446
+ contents: read
447
+ pull-requests: read
448
+ issues: read
449
+ id-token: write
450
+
451
+ steps:
452
+ - name: Checkout repository
453
+ uses: actions/checkout@v4
454
+ with:
455
+ fetch-depth: 1
456
+
457
+ - name: Run Claude Code Review
458
+ id: claude-review
459
+ uses: anthropics/claude-code-action@v1
460
+ with:
461
+ anthropic_api_key: \${{ secrets.ANTHROPIC_API_KEY }}
462
+ plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
463
+ plugins: 'code-review@claude-code-plugins'
464
+ prompt: '/code-review:code-review \${{ github.repository }}/pull/\${{ github.event.pull_request.number }}'
465
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
466
+ # or https://code.claude.com/docs/en/cli-reference for available options
467
+
468
+ `;
469
+
470
+ // src/commands/install-github-app/ApiKeyStep.tsx
471
+ function ApiKeyStep(t0) {
472
+ const $ = import_compiler_runtime2.c(55);
473
+ const {
474
+ existingApiKey,
475
+ apiKeyOrOAuthToken,
476
+ onApiKeyChange,
477
+ onSubmit,
478
+ onToggleUseExistingKey,
479
+ onCreateOAuthToken,
480
+ selectedOption: t1,
481
+ onSelectOption
482
+ } = t0;
483
+ const selectedOption = t1 === undefined ? existingApiKey ? "existing" : onCreateOAuthToken ? "oauth" : "new" : t1;
484
+ const [cursorOffset, setCursorOffset] = import_react2.useState(0);
485
+ const terminalSize = useTerminalSize();
486
+ const [theme] = useTheme();
487
+ let t2;
488
+ if ($[0] !== existingApiKey || $[1] !== onCreateOAuthToken || $[2] !== onSelectOption || $[3] !== onToggleUseExistingKey || $[4] !== selectedOption) {
489
+ t2 = () => {
490
+ if (selectedOption === "new" && onCreateOAuthToken) {
491
+ onSelectOption?.("oauth");
492
+ } else {
493
+ if (selectedOption === "oauth" && existingApiKey) {
494
+ onSelectOption?.("existing");
495
+ onToggleUseExistingKey(true);
496
+ }
497
+ }
498
+ };
499
+ $[0] = existingApiKey;
500
+ $[1] = onCreateOAuthToken;
501
+ $[2] = onSelectOption;
502
+ $[3] = onToggleUseExistingKey;
503
+ $[4] = selectedOption;
504
+ $[5] = t2;
505
+ } else {
506
+ t2 = $[5];
507
+ }
508
+ const handlePrevious = t2;
509
+ let t3;
510
+ if ($[6] !== onCreateOAuthToken || $[7] !== onSelectOption || $[8] !== onToggleUseExistingKey || $[9] !== selectedOption) {
511
+ t3 = () => {
512
+ if (selectedOption === "existing") {
513
+ onSelectOption?.(onCreateOAuthToken ? "oauth" : "new");
514
+ onToggleUseExistingKey(false);
515
+ } else {
516
+ if (selectedOption === "oauth") {
517
+ onSelectOption?.("new");
518
+ }
519
+ }
520
+ };
521
+ $[6] = onCreateOAuthToken;
522
+ $[7] = onSelectOption;
523
+ $[8] = onToggleUseExistingKey;
524
+ $[9] = selectedOption;
525
+ $[10] = t3;
526
+ } else {
527
+ t3 = $[10];
528
+ }
529
+ const handleNext = t3;
530
+ let t4;
531
+ if ($[11] !== onCreateOAuthToken || $[12] !== onSubmit || $[13] !== selectedOption) {
532
+ t4 = () => {
533
+ if (selectedOption === "oauth" && onCreateOAuthToken) {
534
+ onCreateOAuthToken();
535
+ } else {
536
+ onSubmit();
537
+ }
538
+ };
539
+ $[11] = onCreateOAuthToken;
540
+ $[12] = onSubmit;
541
+ $[13] = selectedOption;
542
+ $[14] = t4;
543
+ } else {
544
+ t4 = $[14];
545
+ }
546
+ const handleConfirm = t4;
547
+ const isTextInputVisible = selectedOption === "new";
548
+ let t5;
549
+ if ($[15] !== handleConfirm || $[16] !== handleNext || $[17] !== handlePrevious) {
550
+ t5 = {
551
+ "confirm:previous": handlePrevious,
552
+ "confirm:next": handleNext,
553
+ "confirm:yes": handleConfirm
554
+ };
555
+ $[15] = handleConfirm;
556
+ $[16] = handleNext;
557
+ $[17] = handlePrevious;
558
+ $[18] = t5;
559
+ } else {
560
+ t5 = $[18];
561
+ }
562
+ const t6 = !isTextInputVisible;
563
+ let t7;
564
+ if ($[19] !== t6) {
565
+ t7 = {
566
+ context: "Confirmation",
567
+ isActive: t6
568
+ };
569
+ $[19] = t6;
570
+ $[20] = t7;
571
+ } else {
572
+ t7 = $[20];
573
+ }
574
+ useKeybindings(t5, t7);
575
+ let t8;
576
+ if ($[21] !== handleNext || $[22] !== handlePrevious) {
577
+ t8 = {
578
+ "confirm:previous": handlePrevious,
579
+ "confirm:next": handleNext
580
+ };
581
+ $[21] = handleNext;
582
+ $[22] = handlePrevious;
583
+ $[23] = t8;
584
+ } else {
585
+ t8 = $[23];
586
+ }
587
+ let t9;
588
+ if ($[24] !== isTextInputVisible) {
589
+ t9 = {
590
+ context: "Confirmation",
591
+ isActive: isTextInputVisible
592
+ };
593
+ $[24] = isTextInputVisible;
594
+ $[25] = t9;
595
+ } else {
596
+ t9 = $[25];
597
+ }
598
+ useKeybindings(t8, t9);
599
+ let t10;
600
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
601
+ t10 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
602
+ flexDirection: "column",
603
+ marginBottom: 1,
604
+ children: [
605
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
606
+ bold: true,
607
+ children: "Install GitHub App"
608
+ }, undefined, false, undefined, this),
609
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
610
+ dimColor: true,
611
+ children: "Choose API key"
612
+ }, undefined, false, undefined, this)
613
+ ]
614
+ }, undefined, true, undefined, this);
615
+ $[26] = t10;
616
+ } else {
617
+ t10 = $[26];
618
+ }
619
+ let t11;
620
+ if ($[27] !== existingApiKey || $[28] !== selectedOption || $[29] !== theme) {
621
+ t11 = existingApiKey && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
622
+ marginBottom: 1,
623
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
624
+ children: [
625
+ selectedOption === "existing" ? color("success", theme)("> ") : " ",
626
+ "Use your existing Claude Code API key"
627
+ ]
628
+ }, undefined, true, undefined, this)
629
+ }, undefined, false, undefined, this);
630
+ $[27] = existingApiKey;
631
+ $[28] = selectedOption;
632
+ $[29] = theme;
633
+ $[30] = t11;
634
+ } else {
635
+ t11 = $[30];
636
+ }
637
+ let t12;
638
+ if ($[31] !== onCreateOAuthToken || $[32] !== selectedOption || $[33] !== theme) {
639
+ t12 = onCreateOAuthToken && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
640
+ marginBottom: 1,
641
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
642
+ children: [
643
+ selectedOption === "oauth" ? color("success", theme)("> ") : " ",
644
+ "Create a long-lived token with your Claude subscription"
645
+ ]
646
+ }, undefined, true, undefined, this)
647
+ }, undefined, false, undefined, this);
648
+ $[31] = onCreateOAuthToken;
649
+ $[32] = selectedOption;
650
+ $[33] = theme;
651
+ $[34] = t12;
652
+ } else {
653
+ t12 = $[34];
654
+ }
655
+ let t13;
656
+ if ($[35] !== selectedOption || $[36] !== theme) {
657
+ t13 = selectedOption === "new" ? color("success", theme)("> ") : " ";
658
+ $[35] = selectedOption;
659
+ $[36] = theme;
660
+ $[37] = t13;
661
+ } else {
662
+ t13 = $[37];
663
+ }
664
+ let t14;
665
+ if ($[38] !== t13) {
666
+ t14 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
667
+ marginBottom: 1,
668
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
669
+ children: [
670
+ t13,
671
+ "Enter a new API key"
672
+ ]
673
+ }, undefined, true, undefined, this)
674
+ }, undefined, false, undefined, this);
675
+ $[38] = t13;
676
+ $[39] = t14;
677
+ } else {
678
+ t14 = $[39];
679
+ }
680
+ let t15;
681
+ if ($[40] !== apiKeyOrOAuthToken || $[41] !== cursorOffset || $[42] !== onApiKeyChange || $[43] !== onSubmit || $[44] !== selectedOption || $[45] !== terminalSize) {
682
+ t15 = selectedOption === "new" && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(TextInput, {
683
+ value: apiKeyOrOAuthToken,
684
+ onChange: onApiKeyChange,
685
+ onSubmit,
686
+ onPaste: onApiKeyChange,
687
+ focus: true,
688
+ placeholder: "sk-ant\u2026 (Create a new key at https://platform.claude.com/settings/keys)",
689
+ mask: "*",
690
+ columns: terminalSize.columns,
691
+ cursorOffset,
692
+ onChangeCursorOffset: setCursorOffset,
693
+ showCursor: true
694
+ }, undefined, false, undefined, this);
695
+ $[40] = apiKeyOrOAuthToken;
696
+ $[41] = cursorOffset;
697
+ $[42] = onApiKeyChange;
698
+ $[43] = onSubmit;
699
+ $[44] = selectedOption;
700
+ $[45] = terminalSize;
701
+ $[46] = t15;
702
+ } else {
703
+ t15 = $[46];
704
+ }
705
+ let t16;
706
+ if ($[47] !== t11 || $[48] !== t12 || $[49] !== t14 || $[50] !== t15) {
707
+ t16 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
708
+ flexDirection: "column",
709
+ borderStyle: "round",
710
+ paddingX: 1,
711
+ children: [
712
+ t10,
713
+ t11,
714
+ t12,
715
+ t14,
716
+ t15
717
+ ]
718
+ }, undefined, true, undefined, this);
719
+ $[47] = t11;
720
+ $[48] = t12;
721
+ $[49] = t14;
722
+ $[50] = t15;
723
+ $[51] = t16;
724
+ } else {
725
+ t16 = $[51];
726
+ }
727
+ let t17;
728
+ if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
729
+ t17 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
730
+ marginLeft: 3,
731
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
732
+ dimColor: true,
733
+ children: "\u2191/\u2193 to select \xB7 Enter to continue"
734
+ }, undefined, false, undefined, this)
735
+ }, undefined, false, undefined, this);
736
+ $[52] = t17;
737
+ } else {
738
+ t17 = $[52];
739
+ }
740
+ let t18;
741
+ if ($[53] !== t16) {
742
+ t18 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
743
+ children: [
744
+ t16,
745
+ t17
746
+ ]
747
+ }, undefined, true, undefined, this);
748
+ $[53] = t16;
749
+ $[54] = t18;
750
+ } else {
751
+ t18 = $[54];
752
+ }
753
+ return t18;
754
+ }
755
+ var import_compiler_runtime2, import_react2, jsx_dev_runtime2;
756
+ var init_ApiKeyStep = __esm(() => {
757
+ init_TextInput();
758
+ init_useTerminalSize();
759
+ init_ink();
760
+ init_useKeybinding();
761
+ import_compiler_runtime2 = __toESM(require_compiler_runtime(), 1);
762
+ import_react2 = __toESM(require_react(), 1);
763
+ jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
764
+ });
765
+
766
+ // src/commands/install-github-app/CheckExistingSecretStep.tsx
767
+ function CheckExistingSecretStep(t0) {
768
+ const $ = import_compiler_runtime3.c(42);
769
+ const {
770
+ useExistingSecret,
771
+ secretName,
772
+ onToggleUseExistingSecret,
773
+ onSecretNameChange,
774
+ onSubmit
775
+ } = t0;
776
+ const [cursorOffset, setCursorOffset] = import_react3.useState(0);
777
+ const terminalSize = useTerminalSize();
778
+ const [theme] = useTheme();
779
+ let t1;
780
+ if ($[0] !== onToggleUseExistingSecret) {
781
+ t1 = () => onToggleUseExistingSecret(true);
782
+ $[0] = onToggleUseExistingSecret;
783
+ $[1] = t1;
784
+ } else {
785
+ t1 = $[1];
786
+ }
787
+ const handlePrevious = t1;
788
+ let t2;
789
+ if ($[2] !== onToggleUseExistingSecret) {
790
+ t2 = () => onToggleUseExistingSecret(false);
791
+ $[2] = onToggleUseExistingSecret;
792
+ $[3] = t2;
793
+ } else {
794
+ t2 = $[3];
795
+ }
796
+ const handleNext = t2;
797
+ let t3;
798
+ if ($[4] !== handleNext || $[5] !== handlePrevious || $[6] !== onSubmit) {
799
+ t3 = {
800
+ "confirm:previous": handlePrevious,
801
+ "confirm:next": handleNext,
802
+ "confirm:yes": onSubmit
803
+ };
804
+ $[4] = handleNext;
805
+ $[5] = handlePrevious;
806
+ $[6] = onSubmit;
807
+ $[7] = t3;
808
+ } else {
809
+ t3 = $[7];
810
+ }
811
+ let t4;
812
+ if ($[8] !== useExistingSecret) {
813
+ t4 = {
814
+ context: "Confirmation",
815
+ isActive: useExistingSecret
816
+ };
817
+ $[8] = useExistingSecret;
818
+ $[9] = t4;
819
+ } else {
820
+ t4 = $[9];
821
+ }
822
+ useKeybindings(t3, t4);
823
+ let t5;
824
+ if ($[10] !== handleNext || $[11] !== handlePrevious) {
825
+ t5 = {
826
+ "confirm:previous": handlePrevious,
827
+ "confirm:next": handleNext
828
+ };
829
+ $[10] = handleNext;
830
+ $[11] = handlePrevious;
831
+ $[12] = t5;
832
+ } else {
833
+ t5 = $[12];
834
+ }
835
+ const t6 = !useExistingSecret;
836
+ let t7;
837
+ if ($[13] !== t6) {
838
+ t7 = {
839
+ context: "Confirmation",
840
+ isActive: t6
841
+ };
842
+ $[13] = t6;
843
+ $[14] = t7;
844
+ } else {
845
+ t7 = $[14];
846
+ }
847
+ useKeybindings(t5, t7);
848
+ let t8;
849
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
850
+ t8 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
851
+ flexDirection: "column",
852
+ marginBottom: 1,
853
+ children: [
854
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
855
+ bold: true,
856
+ children: "Install GitHub App"
857
+ }, undefined, false, undefined, this),
858
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
859
+ dimColor: true,
860
+ children: "Setup API key secret"
861
+ }, undefined, false, undefined, this)
862
+ ]
863
+ }, undefined, true, undefined, this);
864
+ $[15] = t8;
865
+ } else {
866
+ t8 = $[15];
867
+ }
868
+ let t9;
869
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
870
+ t9 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
871
+ marginBottom: 1,
872
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
873
+ color: "warning",
874
+ children: "ANTHROPIC_API_KEY already exists in repository secrets!"
875
+ }, undefined, false, undefined, this)
876
+ }, undefined, false, undefined, this);
877
+ $[16] = t9;
878
+ } else {
879
+ t9 = $[16];
880
+ }
881
+ let t10;
882
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
883
+ t10 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
884
+ marginBottom: 1,
885
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
886
+ children: "Would you like to:"
887
+ }, undefined, false, undefined, this)
888
+ }, undefined, false, undefined, this);
889
+ $[17] = t10;
890
+ } else {
891
+ t10 = $[17];
892
+ }
893
+ let t11;
894
+ if ($[18] !== theme || $[19] !== useExistingSecret) {
895
+ t11 = useExistingSecret ? color("success", theme)("> ") : " ";
896
+ $[18] = theme;
897
+ $[19] = useExistingSecret;
898
+ $[20] = t11;
899
+ } else {
900
+ t11 = $[20];
901
+ }
902
+ let t12;
903
+ if ($[21] !== t11) {
904
+ t12 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
905
+ marginBottom: 1,
906
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
907
+ children: [
908
+ t11,
909
+ "Use the existing API key"
910
+ ]
911
+ }, undefined, true, undefined, this)
912
+ }, undefined, false, undefined, this);
913
+ $[21] = t11;
914
+ $[22] = t12;
915
+ } else {
916
+ t12 = $[22];
917
+ }
918
+ let t13;
919
+ if ($[23] !== theme || $[24] !== useExistingSecret) {
920
+ t13 = !useExistingSecret ? color("success", theme)("> ") : " ";
921
+ $[23] = theme;
922
+ $[24] = useExistingSecret;
923
+ $[25] = t13;
924
+ } else {
925
+ t13 = $[25];
926
+ }
927
+ let t14;
928
+ if ($[26] !== t13) {
929
+ t14 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
930
+ marginBottom: 1,
931
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
932
+ children: [
933
+ t13,
934
+ "Create a new secret with a different name"
935
+ ]
936
+ }, undefined, true, undefined, this)
937
+ }, undefined, false, undefined, this);
938
+ $[26] = t13;
939
+ $[27] = t14;
940
+ } else {
941
+ t14 = $[27];
942
+ }
943
+ let t15;
944
+ if ($[28] !== cursorOffset || $[29] !== onSecretNameChange || $[30] !== onSubmit || $[31] !== secretName || $[32] !== terminalSize || $[33] !== useExistingSecret) {
945
+ t15 = !useExistingSecret && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
946
+ children: [
947
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
948
+ marginBottom: 1,
949
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
950
+ children: "Enter new secret name (alphanumeric with underscores):"
951
+ }, undefined, false, undefined, this)
952
+ }, undefined, false, undefined, this),
953
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(TextInput, {
954
+ value: secretName,
955
+ onChange: onSecretNameChange,
956
+ onSubmit,
957
+ focus: true,
958
+ placeholder: "e.g., CLAUDE_API_KEY",
959
+ columns: terminalSize.columns,
960
+ cursorOffset,
961
+ onChangeCursorOffset: setCursorOffset,
962
+ showCursor: true
963
+ }, undefined, false, undefined, this)
964
+ ]
965
+ }, undefined, true, undefined, this);
966
+ $[28] = cursorOffset;
967
+ $[29] = onSecretNameChange;
968
+ $[30] = onSubmit;
969
+ $[31] = secretName;
970
+ $[32] = terminalSize;
971
+ $[33] = useExistingSecret;
972
+ $[34] = t15;
973
+ } else {
974
+ t15 = $[34];
975
+ }
976
+ let t16;
977
+ if ($[35] !== t12 || $[36] !== t14 || $[37] !== t15) {
978
+ t16 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
979
+ flexDirection: "column",
980
+ borderStyle: "round",
981
+ paddingX: 1,
982
+ children: [
983
+ t8,
984
+ t9,
985
+ t10,
986
+ t12,
987
+ t14,
988
+ t15
989
+ ]
990
+ }, undefined, true, undefined, this);
991
+ $[35] = t12;
992
+ $[36] = t14;
993
+ $[37] = t15;
994
+ $[38] = t16;
995
+ } else {
996
+ t16 = $[38];
997
+ }
998
+ let t17;
999
+ if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
1000
+ t17 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
1001
+ marginLeft: 3,
1002
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1003
+ dimColor: true,
1004
+ children: "\u2191/\u2193 to select \xB7 Enter to continue"
1005
+ }, undefined, false, undefined, this)
1006
+ }, undefined, false, undefined, this);
1007
+ $[39] = t17;
1008
+ } else {
1009
+ t17 = $[39];
1010
+ }
1011
+ let t18;
1012
+ if ($[40] !== t16) {
1013
+ t18 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
1014
+ children: [
1015
+ t16,
1016
+ t17
1017
+ ]
1018
+ }, undefined, true, undefined, this);
1019
+ $[40] = t16;
1020
+ $[41] = t18;
1021
+ } else {
1022
+ t18 = $[41];
1023
+ }
1024
+ return t18;
1025
+ }
1026
+ var import_compiler_runtime3, import_react3, jsx_dev_runtime3;
1027
+ var init_CheckExistingSecretStep = __esm(() => {
1028
+ init_TextInput();
1029
+ init_useTerminalSize();
1030
+ init_ink();
1031
+ init_useKeybinding();
1032
+ import_compiler_runtime3 = __toESM(require_compiler_runtime(), 1);
1033
+ import_react3 = __toESM(require_react(), 1);
1034
+ jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
1035
+ });
1036
+
1037
+ // src/commands/install-github-app/CheckGitHubStep.tsx
1038
+ function CheckGitHubStep() {
1039
+ const $ = import_compiler_runtime4.c(1);
1040
+ let t0;
1041
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1042
+ t0 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1043
+ children: "Checking GitHub CLI installation\u2026"
1044
+ }, undefined, false, undefined, this);
1045
+ $[0] = t0;
1046
+ } else {
1047
+ t0 = $[0];
1048
+ }
1049
+ return t0;
1050
+ }
1051
+ var import_compiler_runtime4, jsx_dev_runtime4;
1052
+ var init_CheckGitHubStep = __esm(() => {
1053
+ init_ink();
1054
+ import_compiler_runtime4 = __toESM(require_compiler_runtime(), 1);
1055
+ jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
1056
+ });
1057
+
1058
+ // src/commands/install-github-app/ChooseRepoStep.tsx
1059
+ function ChooseRepoStep(t0) {
1060
+ const $ = import_compiler_runtime5.c(49);
1061
+ const {
1062
+ currentRepo,
1063
+ useCurrentRepo,
1064
+ repoUrl,
1065
+ onRepoUrlChange,
1066
+ onSubmit,
1067
+ onToggleUseCurrentRepo
1068
+ } = t0;
1069
+ const [cursorOffset, setCursorOffset] = import_react4.useState(0);
1070
+ const [showEmptyError, setShowEmptyError] = import_react4.useState(false);
1071
+ const terminalSize = useTerminalSize();
1072
+ const textInputColumns = terminalSize.columns;
1073
+ let t1;
1074
+ if ($[0] !== currentRepo || $[1] !== onSubmit || $[2] !== repoUrl || $[3] !== useCurrentRepo) {
1075
+ t1 = () => {
1076
+ const repoName = useCurrentRepo ? currentRepo : repoUrl;
1077
+ if (!repoName?.trim()) {
1078
+ setShowEmptyError(true);
1079
+ return;
1080
+ }
1081
+ onSubmit();
1082
+ };
1083
+ $[0] = currentRepo;
1084
+ $[1] = onSubmit;
1085
+ $[2] = repoUrl;
1086
+ $[3] = useCurrentRepo;
1087
+ $[4] = t1;
1088
+ } else {
1089
+ t1 = $[4];
1090
+ }
1091
+ const handleSubmit = t1;
1092
+ const isTextInputVisible = !useCurrentRepo || !currentRepo;
1093
+ let t2;
1094
+ if ($[5] !== onToggleUseCurrentRepo) {
1095
+ t2 = () => {
1096
+ onToggleUseCurrentRepo(true);
1097
+ setShowEmptyError(false);
1098
+ };
1099
+ $[5] = onToggleUseCurrentRepo;
1100
+ $[6] = t2;
1101
+ } else {
1102
+ t2 = $[6];
1103
+ }
1104
+ const handlePrevious = t2;
1105
+ let t3;
1106
+ if ($[7] !== onToggleUseCurrentRepo) {
1107
+ t3 = () => {
1108
+ onToggleUseCurrentRepo(false);
1109
+ setShowEmptyError(false);
1110
+ };
1111
+ $[7] = onToggleUseCurrentRepo;
1112
+ $[8] = t3;
1113
+ } else {
1114
+ t3 = $[8];
1115
+ }
1116
+ const handleNext = t3;
1117
+ let t4;
1118
+ if ($[9] !== handleNext || $[10] !== handlePrevious || $[11] !== handleSubmit) {
1119
+ t4 = {
1120
+ "confirm:previous": handlePrevious,
1121
+ "confirm:next": handleNext,
1122
+ "confirm:yes": handleSubmit
1123
+ };
1124
+ $[9] = handleNext;
1125
+ $[10] = handlePrevious;
1126
+ $[11] = handleSubmit;
1127
+ $[12] = t4;
1128
+ } else {
1129
+ t4 = $[12];
1130
+ }
1131
+ const t5 = !isTextInputVisible;
1132
+ let t6;
1133
+ if ($[13] !== t5) {
1134
+ t6 = {
1135
+ context: "Confirmation",
1136
+ isActive: t5
1137
+ };
1138
+ $[13] = t5;
1139
+ $[14] = t6;
1140
+ } else {
1141
+ t6 = $[14];
1142
+ }
1143
+ useKeybindings(t4, t6);
1144
+ let t7;
1145
+ if ($[15] !== handleNext || $[16] !== handlePrevious) {
1146
+ t7 = {
1147
+ "confirm:previous": handlePrevious,
1148
+ "confirm:next": handleNext
1149
+ };
1150
+ $[15] = handleNext;
1151
+ $[16] = handlePrevious;
1152
+ $[17] = t7;
1153
+ } else {
1154
+ t7 = $[17];
1155
+ }
1156
+ let t8;
1157
+ if ($[18] !== isTextInputVisible) {
1158
+ t8 = {
1159
+ context: "Confirmation",
1160
+ isActive: isTextInputVisible
1161
+ };
1162
+ $[18] = isTextInputVisible;
1163
+ $[19] = t8;
1164
+ } else {
1165
+ t8 = $[19];
1166
+ }
1167
+ useKeybindings(t7, t8);
1168
+ let t9;
1169
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
1170
+ t9 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1171
+ flexDirection: "column",
1172
+ marginBottom: 1,
1173
+ children: [
1174
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1175
+ bold: true,
1176
+ children: "Install GitHub App"
1177
+ }, undefined, false, undefined, this),
1178
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1179
+ dimColor: true,
1180
+ children: "Select GitHub repository"
1181
+ }, undefined, false, undefined, this)
1182
+ ]
1183
+ }, undefined, true, undefined, this);
1184
+ $[20] = t9;
1185
+ } else {
1186
+ t9 = $[20];
1187
+ }
1188
+ let t10;
1189
+ if ($[21] !== currentRepo || $[22] !== useCurrentRepo) {
1190
+ t10 = currentRepo && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1191
+ marginBottom: 1,
1192
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1193
+ bold: useCurrentRepo,
1194
+ color: useCurrentRepo ? "permission" : undefined,
1195
+ children: [
1196
+ useCurrentRepo ? "> " : " ",
1197
+ "Use current repository: ",
1198
+ currentRepo
1199
+ ]
1200
+ }, undefined, true, undefined, this)
1201
+ }, undefined, false, undefined, this);
1202
+ $[21] = currentRepo;
1203
+ $[22] = useCurrentRepo;
1204
+ $[23] = t10;
1205
+ } else {
1206
+ t10 = $[23];
1207
+ }
1208
+ const t11 = !useCurrentRepo || !currentRepo;
1209
+ const t12 = !useCurrentRepo || !currentRepo ? "permission" : undefined;
1210
+ const t13 = !useCurrentRepo || !currentRepo ? "> " : " ";
1211
+ const t14 = currentRepo ? "Enter a different repository" : "Enter repository";
1212
+ let t15;
1213
+ if ($[24] !== t11 || $[25] !== t12 || $[26] !== t13 || $[27] !== t14) {
1214
+ t15 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1215
+ marginBottom: 1,
1216
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1217
+ bold: t11,
1218
+ color: t12,
1219
+ children: [
1220
+ t13,
1221
+ t14
1222
+ ]
1223
+ }, undefined, true, undefined, this)
1224
+ }, undefined, false, undefined, this);
1225
+ $[24] = t11;
1226
+ $[25] = t12;
1227
+ $[26] = t13;
1228
+ $[27] = t14;
1229
+ $[28] = t15;
1230
+ } else {
1231
+ t15 = $[28];
1232
+ }
1233
+ let t16;
1234
+ if ($[29] !== currentRepo || $[30] !== cursorOffset || $[31] !== handleSubmit || $[32] !== onRepoUrlChange || $[33] !== repoUrl || $[34] !== textInputColumns || $[35] !== useCurrentRepo) {
1235
+ t16 = (!useCurrentRepo || !currentRepo) && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1236
+ marginLeft: 2,
1237
+ marginBottom: 1,
1238
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TextInput, {
1239
+ value: repoUrl,
1240
+ onChange: (value) => {
1241
+ onRepoUrlChange(value);
1242
+ setShowEmptyError(false);
1243
+ },
1244
+ onSubmit: handleSubmit,
1245
+ focus: true,
1246
+ placeholder: "Enter a repo as owner/repo or https://github.com/owner/repo\u2026",
1247
+ columns: textInputColumns,
1248
+ cursorOffset,
1249
+ onChangeCursorOffset: setCursorOffset,
1250
+ showCursor: true
1251
+ }, undefined, false, undefined, this)
1252
+ }, undefined, false, undefined, this);
1253
+ $[29] = currentRepo;
1254
+ $[30] = cursorOffset;
1255
+ $[31] = handleSubmit;
1256
+ $[32] = onRepoUrlChange;
1257
+ $[33] = repoUrl;
1258
+ $[34] = textInputColumns;
1259
+ $[35] = useCurrentRepo;
1260
+ $[36] = t16;
1261
+ } else {
1262
+ t16 = $[36];
1263
+ }
1264
+ let t17;
1265
+ if ($[37] !== t10 || $[38] !== t15 || $[39] !== t16) {
1266
+ t17 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1267
+ flexDirection: "column",
1268
+ borderStyle: "round",
1269
+ paddingX: 1,
1270
+ children: [
1271
+ t9,
1272
+ t10,
1273
+ t15,
1274
+ t16
1275
+ ]
1276
+ }, undefined, true, undefined, this);
1277
+ $[37] = t10;
1278
+ $[38] = t15;
1279
+ $[39] = t16;
1280
+ $[40] = t17;
1281
+ } else {
1282
+ t17 = $[40];
1283
+ }
1284
+ let t18;
1285
+ if ($[41] !== showEmptyError) {
1286
+ t18 = showEmptyError && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1287
+ marginLeft: 3,
1288
+ marginBottom: 1,
1289
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1290
+ color: "error",
1291
+ children: "Please enter a repository name to continue"
1292
+ }, undefined, false, undefined, this)
1293
+ }, undefined, false, undefined, this);
1294
+ $[41] = showEmptyError;
1295
+ $[42] = t18;
1296
+ } else {
1297
+ t18 = $[42];
1298
+ }
1299
+ const t19 = currentRepo ? "\u2191/\u2193 to select \xB7 " : "";
1300
+ let t20;
1301
+ if ($[43] !== t19) {
1302
+ t20 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1303
+ marginLeft: 3,
1304
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1305
+ dimColor: true,
1306
+ children: [
1307
+ t19,
1308
+ "Enter to continue"
1309
+ ]
1310
+ }, undefined, true, undefined, this)
1311
+ }, undefined, false, undefined, this);
1312
+ $[43] = t19;
1313
+ $[44] = t20;
1314
+ } else {
1315
+ t20 = $[44];
1316
+ }
1317
+ let t21;
1318
+ if ($[45] !== t17 || $[46] !== t18 || $[47] !== t20) {
1319
+ t21 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
1320
+ children: [
1321
+ t17,
1322
+ t18,
1323
+ t20
1324
+ ]
1325
+ }, undefined, true, undefined, this);
1326
+ $[45] = t17;
1327
+ $[46] = t18;
1328
+ $[47] = t20;
1329
+ $[48] = t21;
1330
+ } else {
1331
+ t21 = $[48];
1332
+ }
1333
+ return t21;
1334
+ }
1335
+ var import_compiler_runtime5, import_react4, jsx_dev_runtime5;
1336
+ var init_ChooseRepoStep = __esm(() => {
1337
+ init_TextInput();
1338
+ init_useTerminalSize();
1339
+ init_ink();
1340
+ init_useKeybinding();
1341
+ import_compiler_runtime5 = __toESM(require_compiler_runtime(), 1);
1342
+ import_react4 = __toESM(require_react(), 1);
1343
+ jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
1344
+ });
1345
+
1346
+ // src/commands/install-github-app/CreatingStep.tsx
1347
+ function CreatingStep(t0) {
1348
+ const $ = import_compiler_runtime6.c(10);
1349
+ const {
1350
+ currentWorkflowInstallStep,
1351
+ secretExists,
1352
+ useExistingSecret,
1353
+ secretName,
1354
+ skipWorkflow: t1,
1355
+ selectedWorkflows
1356
+ } = t0;
1357
+ const skipWorkflow = t1 === undefined ? false : t1;
1358
+ let t2;
1359
+ if ($[0] !== secretExists || $[1] !== secretName || $[2] !== selectedWorkflows || $[3] !== skipWorkflow || $[4] !== useExistingSecret) {
1360
+ t2 = skipWorkflow ? ["Getting repository information", secretExists && useExistingSecret ? "Using existing API key secret" : `Setting up ${secretName} secret`] : ["Getting repository information", "Creating branch", selectedWorkflows.length > 1 ? "Creating workflow files" : "Creating workflow file", secretExists && useExistingSecret ? "Using existing API key secret" : `Setting up ${secretName} secret`, "Opening pull request page"];
1361
+ $[0] = secretExists;
1362
+ $[1] = secretName;
1363
+ $[2] = selectedWorkflows;
1364
+ $[3] = skipWorkflow;
1365
+ $[4] = useExistingSecret;
1366
+ $[5] = t2;
1367
+ } else {
1368
+ t2 = $[5];
1369
+ }
1370
+ const progressSteps = t2;
1371
+ let t3;
1372
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
1373
+ t3 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1374
+ flexDirection: "column",
1375
+ marginBottom: 1,
1376
+ children: [
1377
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1378
+ bold: true,
1379
+ children: "Install GitHub App"
1380
+ }, undefined, false, undefined, this),
1381
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1382
+ dimColor: true,
1383
+ children: "Create GitHub Actions workflow"
1384
+ }, undefined, false, undefined, this)
1385
+ ]
1386
+ }, undefined, true, undefined, this);
1387
+ $[6] = t3;
1388
+ } else {
1389
+ t3 = $[6];
1390
+ }
1391
+ let t4;
1392
+ if ($[7] !== currentWorkflowInstallStep || $[8] !== progressSteps) {
1393
+ t4 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
1394
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1395
+ flexDirection: "column",
1396
+ borderStyle: "round",
1397
+ paddingX: 1,
1398
+ children: [
1399
+ t3,
1400
+ progressSteps.map((stepText, index) => {
1401
+ let status = "pending";
1402
+ if (index < currentWorkflowInstallStep) {
1403
+ status = "completed";
1404
+ } else {
1405
+ if (index === currentWorkflowInstallStep) {
1406
+ status = "in-progress";
1407
+ }
1408
+ }
1409
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1410
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1411
+ color: status === "completed" ? "success" : status === "in-progress" ? "warning" : undefined,
1412
+ children: [
1413
+ status === "completed" ? "\u2713 " : "",
1414
+ stepText,
1415
+ status === "in-progress" ? "\u2026" : ""
1416
+ ]
1417
+ }, undefined, true, undefined, this)
1418
+ }, index, false, undefined, this);
1419
+ })
1420
+ ]
1421
+ }, undefined, true, undefined, this)
1422
+ }, undefined, false, undefined, this);
1423
+ $[7] = currentWorkflowInstallStep;
1424
+ $[8] = progressSteps;
1425
+ $[9] = t4;
1426
+ } else {
1427
+ t4 = $[9];
1428
+ }
1429
+ return t4;
1430
+ }
1431
+ var import_compiler_runtime6, jsx_dev_runtime6;
1432
+ var init_CreatingStep = __esm(() => {
1433
+ init_ink();
1434
+ import_compiler_runtime6 = __toESM(require_compiler_runtime(), 1);
1435
+ jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
1436
+ });
1437
+
1438
+ // src/commands/install-github-app/ErrorStep.tsx
1439
+ function ErrorStep(t0) {
1440
+ const $ = import_compiler_runtime7.c(15);
1441
+ const {
1442
+ error,
1443
+ errorReason,
1444
+ errorInstructions
1445
+ } = t0;
1446
+ let t1;
1447
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1448
+ t1 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1449
+ flexDirection: "column",
1450
+ marginBottom: 1,
1451
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1452
+ bold: true,
1453
+ children: "Install GitHub App"
1454
+ }, undefined, false, undefined, this)
1455
+ }, undefined, false, undefined, this);
1456
+ $[0] = t1;
1457
+ } else {
1458
+ t1 = $[0];
1459
+ }
1460
+ let t2;
1461
+ if ($[1] !== error) {
1462
+ t2 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1463
+ color: "error",
1464
+ children: [
1465
+ "Error: ",
1466
+ error
1467
+ ]
1468
+ }, undefined, true, undefined, this);
1469
+ $[1] = error;
1470
+ $[2] = t2;
1471
+ } else {
1472
+ t2 = $[2];
1473
+ }
1474
+ let t3;
1475
+ if ($[3] !== errorReason) {
1476
+ t3 = errorReason && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1477
+ marginTop: 1,
1478
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1479
+ dimColor: true,
1480
+ children: [
1481
+ "Reason: ",
1482
+ errorReason
1483
+ ]
1484
+ }, undefined, true, undefined, this)
1485
+ }, undefined, false, undefined, this);
1486
+ $[3] = errorReason;
1487
+ $[4] = t3;
1488
+ } else {
1489
+ t3 = $[4];
1490
+ }
1491
+ let t4;
1492
+ if ($[5] !== errorInstructions) {
1493
+ t4 = errorInstructions && errorInstructions.length > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1494
+ flexDirection: "column",
1495
+ marginTop: 1,
1496
+ children: [
1497
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1498
+ dimColor: true,
1499
+ children: "How to fix:"
1500
+ }, undefined, false, undefined, this),
1501
+ errorInstructions.map(_temp2)
1502
+ ]
1503
+ }, undefined, true, undefined, this);
1504
+ $[5] = errorInstructions;
1505
+ $[6] = t4;
1506
+ } else {
1507
+ t4 = $[6];
1508
+ }
1509
+ let t5;
1510
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
1511
+ t5 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1512
+ marginTop: 1,
1513
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1514
+ dimColor: true,
1515
+ children: [
1516
+ "For manual setup instructions, see:",
1517
+ " ",
1518
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1519
+ color: "claude",
1520
+ children: GITHUB_ACTION_SETUP_DOCS_URL
1521
+ }, undefined, false, undefined, this)
1522
+ ]
1523
+ }, undefined, true, undefined, this)
1524
+ }, undefined, false, undefined, this);
1525
+ $[7] = t5;
1526
+ } else {
1527
+ t5 = $[7];
1528
+ }
1529
+ let t6;
1530
+ if ($[8] !== t2 || $[9] !== t3 || $[10] !== t4) {
1531
+ t6 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1532
+ flexDirection: "column",
1533
+ borderStyle: "round",
1534
+ paddingX: 1,
1535
+ children: [
1536
+ t1,
1537
+ t2,
1538
+ t3,
1539
+ t4,
1540
+ t5
1541
+ ]
1542
+ }, undefined, true, undefined, this);
1543
+ $[8] = t2;
1544
+ $[9] = t3;
1545
+ $[10] = t4;
1546
+ $[11] = t6;
1547
+ } else {
1548
+ t6 = $[11];
1549
+ }
1550
+ let t7;
1551
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
1552
+ t7 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1553
+ marginLeft: 3,
1554
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1555
+ dimColor: true,
1556
+ children: "Press any key to exit"
1557
+ }, undefined, false, undefined, this)
1558
+ }, undefined, false, undefined, this);
1559
+ $[12] = t7;
1560
+ } else {
1561
+ t7 = $[12];
1562
+ }
1563
+ let t8;
1564
+ if ($[13] !== t6) {
1565
+ t8 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
1566
+ children: [
1567
+ t6,
1568
+ t7
1569
+ ]
1570
+ }, undefined, true, undefined, this);
1571
+ $[13] = t6;
1572
+ $[14] = t8;
1573
+ } else {
1574
+ t8 = $[14];
1575
+ }
1576
+ return t8;
1577
+ }
1578
+ function _temp2(instruction, index) {
1579
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1580
+ marginLeft: 2,
1581
+ children: [
1582
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1583
+ dimColor: true,
1584
+ children: "\u2022 "
1585
+ }, undefined, false, undefined, this),
1586
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1587
+ children: instruction
1588
+ }, undefined, false, undefined, this)
1589
+ ]
1590
+ }, index, true, undefined, this);
1591
+ }
1592
+ var import_compiler_runtime7, jsx_dev_runtime7;
1593
+ var init_ErrorStep = __esm(() => {
1594
+ init_ink();
1595
+ import_compiler_runtime7 = __toESM(require_compiler_runtime(), 1);
1596
+ jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
1597
+ });
1598
+
1599
+ // src/commands/install-github-app/ExistingWorkflowStep.tsx
1600
+ function ExistingWorkflowStep(t0) {
1601
+ const $ = import_compiler_runtime8.c(16);
1602
+ const {
1603
+ repoName,
1604
+ onSelectAction
1605
+ } = t0;
1606
+ let t1;
1607
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1608
+ t1 = [{
1609
+ label: "Update workflow file with latest version",
1610
+ value: "update"
1611
+ }, {
1612
+ label: "Skip workflow update (configure secrets only)",
1613
+ value: "skip"
1614
+ }, {
1615
+ label: "Exit without making changes",
1616
+ value: "exit"
1617
+ }];
1618
+ $[0] = t1;
1619
+ } else {
1620
+ t1 = $[0];
1621
+ }
1622
+ const options = t1;
1623
+ let t2;
1624
+ if ($[1] !== onSelectAction) {
1625
+ t2 = (value) => {
1626
+ onSelectAction(value);
1627
+ };
1628
+ $[1] = onSelectAction;
1629
+ $[2] = t2;
1630
+ } else {
1631
+ t2 = $[2];
1632
+ }
1633
+ const handleSelect = t2;
1634
+ let t3;
1635
+ if ($[3] !== onSelectAction) {
1636
+ t3 = () => {
1637
+ onSelectAction("exit");
1638
+ };
1639
+ $[3] = onSelectAction;
1640
+ $[4] = t3;
1641
+ } else {
1642
+ t3 = $[4];
1643
+ }
1644
+ const handleCancel = t3;
1645
+ let t4;
1646
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
1647
+ t4 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1648
+ bold: true,
1649
+ children: "Existing Workflow Found"
1650
+ }, undefined, false, undefined, this);
1651
+ $[5] = t4;
1652
+ } else {
1653
+ t4 = $[5];
1654
+ }
1655
+ let t5;
1656
+ if ($[6] !== repoName) {
1657
+ t5 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1658
+ flexDirection: "column",
1659
+ marginBottom: 1,
1660
+ children: [
1661
+ t4,
1662
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1663
+ dimColor: true,
1664
+ children: [
1665
+ "Repository: ",
1666
+ repoName
1667
+ ]
1668
+ }, undefined, true, undefined, this)
1669
+ ]
1670
+ }, undefined, true, undefined, this);
1671
+ $[6] = repoName;
1672
+ $[7] = t5;
1673
+ } else {
1674
+ t5 = $[7];
1675
+ }
1676
+ let t6;
1677
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
1678
+ t6 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1679
+ flexDirection: "column",
1680
+ marginBottom: 1,
1681
+ children: [
1682
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1683
+ children: [
1684
+ "A Claude workflow file already exists at",
1685
+ " ",
1686
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1687
+ color: "claude",
1688
+ children: ".github/workflows/claude.yml"
1689
+ }, undefined, false, undefined, this)
1690
+ ]
1691
+ }, undefined, true, undefined, this),
1692
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1693
+ dimColor: true,
1694
+ children: "What would you like to do?"
1695
+ }, undefined, false, undefined, this)
1696
+ ]
1697
+ }, undefined, true, undefined, this);
1698
+ $[8] = t6;
1699
+ } else {
1700
+ t6 = $[8];
1701
+ }
1702
+ let t7;
1703
+ if ($[9] !== handleCancel || $[10] !== handleSelect) {
1704
+ t7 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1705
+ flexDirection: "column",
1706
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Select, {
1707
+ options,
1708
+ onChange: handleSelect,
1709
+ onCancel: handleCancel
1710
+ }, undefined, false, undefined, this)
1711
+ }, undefined, false, undefined, this);
1712
+ $[9] = handleCancel;
1713
+ $[10] = handleSelect;
1714
+ $[11] = t7;
1715
+ } else {
1716
+ t7 = $[11];
1717
+ }
1718
+ let t8;
1719
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
1720
+ t8 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1721
+ marginTop: 1,
1722
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1723
+ dimColor: true,
1724
+ children: [
1725
+ "View the latest workflow template at:",
1726
+ " ",
1727
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1728
+ color: "claude",
1729
+ children: "https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml"
1730
+ }, undefined, false, undefined, this)
1731
+ ]
1732
+ }, undefined, true, undefined, this)
1733
+ }, undefined, false, undefined, this);
1734
+ $[12] = t8;
1735
+ } else {
1736
+ t8 = $[12];
1737
+ }
1738
+ let t9;
1739
+ if ($[13] !== t5 || $[14] !== t7) {
1740
+ t9 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1741
+ flexDirection: "column",
1742
+ borderStyle: "round",
1743
+ borderDimColor: true,
1744
+ paddingX: 1,
1745
+ children: [
1746
+ t5,
1747
+ t6,
1748
+ t7,
1749
+ t8
1750
+ ]
1751
+ }, undefined, true, undefined, this);
1752
+ $[13] = t5;
1753
+ $[14] = t7;
1754
+ $[15] = t9;
1755
+ } else {
1756
+ t9 = $[15];
1757
+ }
1758
+ return t9;
1759
+ }
1760
+ var import_compiler_runtime8, jsx_dev_runtime8;
1761
+ var init_ExistingWorkflowStep = __esm(() => {
1762
+ init_CustomSelect();
1763
+ init_ink();
1764
+ import_compiler_runtime8 = __toESM(require_compiler_runtime(), 1);
1765
+ jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
1766
+ });
1767
+
1768
+ // src/commands/install-github-app/InstallAppStep.tsx
1769
+ function InstallAppStep(t0) {
1770
+ const $ = import_compiler_runtime9.c(12);
1771
+ const {
1772
+ repoUrl,
1773
+ onSubmit
1774
+ } = t0;
1775
+ let t1;
1776
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1777
+ t1 = {
1778
+ context: "Confirmation"
1779
+ };
1780
+ $[0] = t1;
1781
+ } else {
1782
+ t1 = $[0];
1783
+ }
1784
+ useKeybinding("confirm:yes", onSubmit, t1);
1785
+ let t2;
1786
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1787
+ t2 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1788
+ flexDirection: "column",
1789
+ marginBottom: 1,
1790
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1791
+ bold: true,
1792
+ children: "Install the Claude GitHub App"
1793
+ }, undefined, false, undefined, this)
1794
+ }, undefined, false, undefined, this);
1795
+ $[1] = t2;
1796
+ } else {
1797
+ t2 = $[1];
1798
+ }
1799
+ let t3;
1800
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1801
+ t3 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1802
+ marginBottom: 1,
1803
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1804
+ children: "Opening browser to install the Claude GitHub App\u2026"
1805
+ }, undefined, false, undefined, this)
1806
+ }, undefined, false, undefined, this);
1807
+ $[2] = t3;
1808
+ } else {
1809
+ t3 = $[2];
1810
+ }
1811
+ let t4;
1812
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
1813
+ t4 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1814
+ marginBottom: 1,
1815
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1816
+ children: "If your browser doesn't open automatically, visit:"
1817
+ }, undefined, false, undefined, this)
1818
+ }, undefined, false, undefined, this);
1819
+ $[3] = t4;
1820
+ } else {
1821
+ t4 = $[3];
1822
+ }
1823
+ let t5;
1824
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
1825
+ t5 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1826
+ marginBottom: 1,
1827
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1828
+ underline: true,
1829
+ children: "https://github.com/apps/claude"
1830
+ }, undefined, false, undefined, this)
1831
+ }, undefined, false, undefined, this);
1832
+ $[4] = t5;
1833
+ } else {
1834
+ t5 = $[4];
1835
+ }
1836
+ let t6;
1837
+ if ($[5] !== repoUrl) {
1838
+ t6 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1839
+ marginBottom: 1,
1840
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1841
+ children: [
1842
+ "Please install the app for repository: ",
1843
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1844
+ bold: true,
1845
+ children: repoUrl
1846
+ }, undefined, false, undefined, this)
1847
+ ]
1848
+ }, undefined, true, undefined, this)
1849
+ }, undefined, false, undefined, this);
1850
+ $[5] = repoUrl;
1851
+ $[6] = t6;
1852
+ } else {
1853
+ t6 = $[6];
1854
+ }
1855
+ let t7;
1856
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
1857
+ t7 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1858
+ marginBottom: 1,
1859
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1860
+ dimColor: true,
1861
+ children: "Important: Make sure to grant access to this specific repository"
1862
+ }, undefined, false, undefined, this)
1863
+ }, undefined, false, undefined, this);
1864
+ $[7] = t7;
1865
+ } else {
1866
+ t7 = $[7];
1867
+ }
1868
+ let t8;
1869
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
1870
+ t8 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1871
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1872
+ bold: true,
1873
+ color: "permission",
1874
+ children: [
1875
+ "Press Enter once you've installed the app",
1876
+ figures_default.ellipsis
1877
+ ]
1878
+ }, undefined, true, undefined, this)
1879
+ }, undefined, false, undefined, this);
1880
+ $[8] = t8;
1881
+ } else {
1882
+ t8 = $[8];
1883
+ }
1884
+ let t9;
1885
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
1886
+ t9 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1887
+ marginTop: 1,
1888
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1889
+ dimColor: true,
1890
+ children: [
1891
+ "Having trouble? See manual setup instructions at:",
1892
+ " ",
1893
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1894
+ color: "claude",
1895
+ children: GITHUB_ACTION_SETUP_DOCS_URL
1896
+ }, undefined, false, undefined, this)
1897
+ ]
1898
+ }, undefined, true, undefined, this)
1899
+ }, undefined, false, undefined, this);
1900
+ $[9] = t9;
1901
+ } else {
1902
+ t9 = $[9];
1903
+ }
1904
+ let t10;
1905
+ if ($[10] !== t6) {
1906
+ t10 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1907
+ flexDirection: "column",
1908
+ borderStyle: "round",
1909
+ borderDimColor: true,
1910
+ paddingX: 1,
1911
+ children: [
1912
+ t2,
1913
+ t3,
1914
+ t4,
1915
+ t5,
1916
+ t6,
1917
+ t7,
1918
+ t8,
1919
+ t9
1920
+ ]
1921
+ }, undefined, true, undefined, this);
1922
+ $[10] = t6;
1923
+ $[11] = t10;
1924
+ } else {
1925
+ t10 = $[11];
1926
+ }
1927
+ return t10;
1928
+ }
1929
+ var import_compiler_runtime9, jsx_dev_runtime9;
1930
+ var init_InstallAppStep = __esm(() => {
1931
+ init_figures();
1932
+ init_ink();
1933
+ init_useKeybinding();
1934
+ import_compiler_runtime9 = __toESM(require_compiler_runtime(), 1);
1935
+ jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
1936
+ });
1937
+
1938
+ // src/commands/install-github-app/OAuthFlowStep.tsx
1939
+ function OAuthFlowStep({
1940
+ onSuccess,
1941
+ onCancel
1942
+ }) {
1943
+ const [oauthStatus, setOAuthStatus] = import_react5.useState({
1944
+ state: "starting"
1945
+ });
1946
+ const [oauthService] = import_react5.useState(() => new OAuthService);
1947
+ const [pastedCode, setPastedCode] = import_react5.useState("");
1948
+ const [cursorOffset, setCursorOffset] = import_react5.useState(0);
1949
+ const [showPastePrompt, setShowPastePrompt] = import_react5.useState(false);
1950
+ const [urlCopied, setUrlCopied] = import_react5.useState(false);
1951
+ const timersRef = import_react5.useRef(new Set);
1952
+ const urlCopiedTimerRef = import_react5.useRef(undefined);
1953
+ const terminalSize = useTerminalSize();
1954
+ const textInputColumns = Math.max(50, terminalSize.columns - PASTE_HERE_MSG.length - 4);
1955
+ function handleKeyDown(e) {
1956
+ if (oauthStatus.state !== "error")
1957
+ return;
1958
+ e.preventDefault();
1959
+ if (e.key === "return" && oauthStatus.toRetry) {
1960
+ setPastedCode("");
1961
+ setCursorOffset(0);
1962
+ setOAuthStatus({
1963
+ state: "about_to_retry",
1964
+ nextState: oauthStatus.toRetry
1965
+ });
1966
+ } else {
1967
+ onCancel();
1968
+ }
1969
+ }
1970
+ async function handleSubmitCode(value, url) {
1971
+ try {
1972
+ const [authorizationCode, state] = value.split("#");
1973
+ if (!authorizationCode || !state) {
1974
+ setOAuthStatus({
1975
+ state: "error",
1976
+ message: "Invalid code. Please make sure the full code was copied",
1977
+ toRetry: {
1978
+ state: "waiting_for_login",
1979
+ url
1980
+ }
1981
+ });
1982
+ return;
1983
+ }
1984
+ logEvent("tengu_oauth_manual_entry", {});
1985
+ oauthService.handleManualAuthCodeInput({
1986
+ authorizationCode,
1987
+ state
1988
+ });
1989
+ } catch (err) {
1990
+ logError(err);
1991
+ setOAuthStatus({
1992
+ state: "error",
1993
+ message: err.message,
1994
+ toRetry: {
1995
+ state: "waiting_for_login",
1996
+ url
1997
+ }
1998
+ });
1999
+ }
2000
+ }
2001
+ const startOAuth = import_react5.useCallback(async () => {
2002
+ timersRef.current.forEach((timer) => clearTimeout(timer));
2003
+ timersRef.current.clear();
2004
+ try {
2005
+ const result = await oauthService.startOAuthFlow(async (url_0) => {
2006
+ setOAuthStatus({
2007
+ state: "waiting_for_login",
2008
+ url: url_0
2009
+ });
2010
+ const timer_0 = setTimeout(setShowPastePrompt, 3000, true);
2011
+ timersRef.current.add(timer_0);
2012
+ }, {
2013
+ loginWithClaudeAi: true,
2014
+ inferenceOnly: true,
2015
+ expiresIn: 365 * 24 * 60 * 60
2016
+ });
2017
+ setOAuthStatus({
2018
+ state: "processing"
2019
+ });
2020
+ saveOAuthTokensIfNeeded(result);
2021
+ const timer1 = setTimeout((setOAuthStatus_0, accessToken, onSuccess_0, timersRef_0) => {
2022
+ setOAuthStatus_0({
2023
+ state: "success",
2024
+ token: accessToken
2025
+ });
2026
+ const timer2 = setTimeout(onSuccess_0, 1000, accessToken);
2027
+ timersRef_0.current.add(timer2);
2028
+ }, 100, setOAuthStatus, result.accessToken, onSuccess, timersRef);
2029
+ timersRef.current.add(timer1);
2030
+ } catch (err_0) {
2031
+ const errorMessage = err_0.message;
2032
+ setOAuthStatus({
2033
+ state: "error",
2034
+ message: errorMessage,
2035
+ toRetry: {
2036
+ state: "starting"
2037
+ }
2038
+ });
2039
+ logError(err_0);
2040
+ logEvent("tengu_oauth_error", {
2041
+ error: errorMessage
2042
+ });
2043
+ }
2044
+ }, [oauthService, onSuccess]);
2045
+ import_react5.useEffect(() => {
2046
+ if (oauthStatus.state === "starting") {
2047
+ startOAuth();
2048
+ }
2049
+ }, [oauthStatus.state, startOAuth]);
2050
+ import_react5.useEffect(() => {
2051
+ if (oauthStatus.state === "about_to_retry") {
2052
+ const timer_1 = setTimeout((nextState, setShowPastePrompt_0, setOAuthStatus_1) => {
2053
+ setShowPastePrompt_0(nextState.state === "waiting_for_login");
2054
+ setOAuthStatus_1(nextState);
2055
+ }, 500, oauthStatus.nextState, setShowPastePrompt, setOAuthStatus);
2056
+ timersRef.current.add(timer_1);
2057
+ }
2058
+ }, [oauthStatus]);
2059
+ import_react5.useEffect(() => {
2060
+ if (pastedCode === "c" && oauthStatus.state === "waiting_for_login" && showPastePrompt && !urlCopied) {
2061
+ setClipboard(oauthStatus.url).then((raw) => {
2062
+ if (raw)
2063
+ process.stdout.write(raw);
2064
+ setUrlCopied(true);
2065
+ clearTimeout(urlCopiedTimerRef.current);
2066
+ urlCopiedTimerRef.current = setTimeout(setUrlCopied, 2000, false);
2067
+ });
2068
+ setPastedCode("");
2069
+ }
2070
+ }, [pastedCode, oauthStatus, showPastePrompt, urlCopied]);
2071
+ import_react5.useEffect(() => {
2072
+ const timers = timersRef.current;
2073
+ return () => {
2074
+ oauthService.cleanup();
2075
+ timers.forEach((timer_2) => clearTimeout(timer_2));
2076
+ timers.clear();
2077
+ clearTimeout(urlCopiedTimerRef.current);
2078
+ };
2079
+ }, [oauthService]);
2080
+ function renderStatusMessage() {
2081
+ switch (oauthStatus.state) {
2082
+ case "starting":
2083
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2084
+ children: [
2085
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner, {}, undefined, false, undefined, this),
2086
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2087
+ children: "Starting authentication\u2026"
2088
+ }, undefined, false, undefined, this)
2089
+ ]
2090
+ }, undefined, true, undefined, this);
2091
+ case "waiting_for_login":
2092
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2093
+ flexDirection: "column",
2094
+ gap: 1,
2095
+ children: [
2096
+ !showPastePrompt && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2097
+ children: [
2098
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner, {}, undefined, false, undefined, this),
2099
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2100
+ children: "Opening browser to sign in with your Claude account\u2026"
2101
+ }, undefined, false, undefined, this)
2102
+ ]
2103
+ }, undefined, true, undefined, this),
2104
+ showPastePrompt && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2105
+ children: [
2106
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2107
+ children: PASTE_HERE_MSG
2108
+ }, undefined, false, undefined, this),
2109
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(TextInput, {
2110
+ value: pastedCode,
2111
+ onChange: setPastedCode,
2112
+ onSubmit: (value_0) => handleSubmitCode(value_0, oauthStatus.url),
2113
+ cursorOffset,
2114
+ onChangeCursorOffset: setCursorOffset,
2115
+ columns: textInputColumns
2116
+ }, undefined, false, undefined, this)
2117
+ ]
2118
+ }, undefined, true, undefined, this)
2119
+ ]
2120
+ }, undefined, true, undefined, this);
2121
+ case "processing":
2122
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2123
+ children: [
2124
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner, {}, undefined, false, undefined, this),
2125
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2126
+ children: "Processing authentication\u2026"
2127
+ }, undefined, false, undefined, this)
2128
+ ]
2129
+ }, undefined, true, undefined, this);
2130
+ case "success":
2131
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2132
+ flexDirection: "column",
2133
+ gap: 1,
2134
+ children: [
2135
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2136
+ color: "success",
2137
+ children: "\u2713 Authentication token created successfully!"
2138
+ }, undefined, false, undefined, this),
2139
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2140
+ dimColor: true,
2141
+ children: "Using token for GitHub Actions setup\u2026"
2142
+ }, undefined, false, undefined, this)
2143
+ ]
2144
+ }, undefined, true, undefined, this);
2145
+ case "error":
2146
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2147
+ flexDirection: "column",
2148
+ gap: 1,
2149
+ children: [
2150
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2151
+ color: "error",
2152
+ children: [
2153
+ "OAuth error: ",
2154
+ oauthStatus.message
2155
+ ]
2156
+ }, undefined, true, undefined, this),
2157
+ oauthStatus.toRetry ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2158
+ dimColor: true,
2159
+ children: "Press Enter to try again, or any other key to cancel"
2160
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2161
+ dimColor: true,
2162
+ children: "Press any key to return to API key selection"
2163
+ }, undefined, false, undefined, this)
2164
+ ]
2165
+ }, undefined, true, undefined, this);
2166
+ case "about_to_retry":
2167
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2168
+ flexDirection: "column",
2169
+ gap: 1,
2170
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2171
+ color: "permission",
2172
+ children: "Retrying\u2026"
2173
+ }, undefined, false, undefined, this)
2174
+ }, undefined, false, undefined, this);
2175
+ default:
2176
+ return null;
2177
+ }
2178
+ }
2179
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2180
+ flexDirection: "column",
2181
+ gap: 1,
2182
+ tabIndex: 0,
2183
+ autoFocus: true,
2184
+ onKeyDown: handleKeyDown,
2185
+ children: [
2186
+ oauthStatus.state === "starting" && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2187
+ flexDirection: "column",
2188
+ gap: 1,
2189
+ paddingBottom: 1,
2190
+ children: [
2191
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2192
+ bold: true,
2193
+ children: "Create Authentication Token"
2194
+ }, undefined, false, undefined, this),
2195
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2196
+ dimColor: true,
2197
+ children: "Creating a long-lived token for GitHub Actions"
2198
+ }, undefined, false, undefined, this)
2199
+ ]
2200
+ }, undefined, true, undefined, this),
2201
+ oauthStatus.state !== "success" && oauthStatus.state !== "starting" && oauthStatus.state !== "processing" && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2202
+ flexDirection: "column",
2203
+ gap: 1,
2204
+ paddingBottom: 1,
2205
+ children: [
2206
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2207
+ bold: true,
2208
+ children: "Create Authentication Token"
2209
+ }, undefined, false, undefined, this),
2210
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2211
+ dimColor: true,
2212
+ children: "Creating a long-lived token for GitHub Actions"
2213
+ }, undefined, false, undefined, this)
2214
+ ]
2215
+ }, "header", true, undefined, this),
2216
+ oauthStatus.state === "waiting_for_login" && showPastePrompt && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2217
+ flexDirection: "column",
2218
+ gap: 1,
2219
+ paddingBottom: 1,
2220
+ children: [
2221
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2222
+ paddingX: 1,
2223
+ children: [
2224
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2225
+ dimColor: true,
2226
+ children: [
2227
+ "Browser didn't open? Use the url below to sign in",
2228
+ " "
2229
+ ]
2230
+ }, undefined, true, undefined, this),
2231
+ urlCopied ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2232
+ color: "success",
2233
+ children: "(Copied!)"
2234
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2235
+ dimColor: true,
2236
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
2237
+ shortcut: "c",
2238
+ action: "copy",
2239
+ parens: true
2240
+ }, undefined, false, undefined, this)
2241
+ }, undefined, false, undefined, this)
2242
+ ]
2243
+ }, undefined, true, undefined, this),
2244
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Link, {
2245
+ url: oauthStatus.url,
2246
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2247
+ dimColor: true,
2248
+ children: oauthStatus.url
2249
+ }, undefined, false, undefined, this)
2250
+ }, undefined, false, undefined, this)
2251
+ ]
2252
+ }, "urlToCopy", true, undefined, this),
2253
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2254
+ paddingLeft: 1,
2255
+ flexDirection: "column",
2256
+ gap: 1,
2257
+ children: renderStatusMessage()
2258
+ }, undefined, false, undefined, this)
2259
+ ]
2260
+ }, undefined, true, undefined, this);
2261
+ }
2262
+ var import_react5, jsx_dev_runtime10, PASTE_HERE_MSG = "Paste code here if prompted > ";
2263
+ var init_OAuthFlowStep = __esm(() => {
2264
+ init_analytics();
2265
+ init_KeyboardShortcutHint();
2266
+ init_Spinner();
2267
+ init_TextInput();
2268
+ init_useTerminalSize();
2269
+ init_osc();
2270
+ init_ink();
2271
+ init_oauth();
2272
+ init_auth();
2273
+ init_log();
2274
+ import_react5 = __toESM(require_react(), 1);
2275
+ jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
2276
+ });
2277
+
2278
+ // src/commands/install-github-app/SuccessStep.tsx
2279
+ function SuccessStep(t0) {
2280
+ const $ = import_compiler_runtime10.c(21);
2281
+ const {
2282
+ secretExists,
2283
+ useExistingSecret,
2284
+ secretName,
2285
+ skipWorkflow: t1
2286
+ } = t0;
2287
+ const skipWorkflow = t1 === undefined ? false : t1;
2288
+ let t2;
2289
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
2290
+ t2 = /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
2291
+ flexDirection: "column",
2292
+ marginBottom: 1,
2293
+ children: [
2294
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2295
+ bold: true,
2296
+ children: "Install GitHub App"
2297
+ }, undefined, false, undefined, this),
2298
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2299
+ dimColor: true,
2300
+ children: "Success"
2301
+ }, undefined, false, undefined, this)
2302
+ ]
2303
+ }, undefined, true, undefined, this);
2304
+ $[0] = t2;
2305
+ } else {
2306
+ t2 = $[0];
2307
+ }
2308
+ let t3;
2309
+ if ($[1] !== skipWorkflow) {
2310
+ t3 = !skipWorkflow && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2311
+ color: "success",
2312
+ children: "\u2713 GitHub Actions workflow created!"
2313
+ }, undefined, false, undefined, this);
2314
+ $[1] = skipWorkflow;
2315
+ $[2] = t3;
2316
+ } else {
2317
+ t3 = $[2];
2318
+ }
2319
+ let t4;
2320
+ if ($[3] !== secretExists || $[4] !== useExistingSecret) {
2321
+ t4 = secretExists && useExistingSecret && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
2322
+ marginTop: 1,
2323
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2324
+ color: "success",
2325
+ children: "\u2713 Using existing ANTHROPIC_API_KEY secret"
2326
+ }, undefined, false, undefined, this)
2327
+ }, undefined, false, undefined, this);
2328
+ $[3] = secretExists;
2329
+ $[4] = useExistingSecret;
2330
+ $[5] = t4;
2331
+ } else {
2332
+ t4 = $[5];
2333
+ }
2334
+ let t5;
2335
+ if ($[6] !== secretExists || $[7] !== secretName || $[8] !== useExistingSecret) {
2336
+ t5 = (!secretExists || !useExistingSecret) && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
2337
+ marginTop: 1,
2338
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2339
+ color: "success",
2340
+ children: [
2341
+ "\u2713 API key saved as ",
2342
+ secretName,
2343
+ " secret"
2344
+ ]
2345
+ }, undefined, true, undefined, this)
2346
+ }, undefined, false, undefined, this);
2347
+ $[6] = secretExists;
2348
+ $[7] = secretName;
2349
+ $[8] = useExistingSecret;
2350
+ $[9] = t5;
2351
+ } else {
2352
+ t5 = $[9];
2353
+ }
2354
+ let t6;
2355
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
2356
+ t6 = /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
2357
+ marginTop: 1,
2358
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2359
+ children: "Next steps:"
2360
+ }, undefined, false, undefined, this)
2361
+ }, undefined, false, undefined, this);
2362
+ $[10] = t6;
2363
+ } else {
2364
+ t6 = $[10];
2365
+ }
2366
+ let t7;
2367
+ if ($[11] !== skipWorkflow) {
2368
+ t7 = skipWorkflow ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
2369
+ children: [
2370
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2371
+ children: "1. Install the Claude GitHub App if you haven't already"
2372
+ }, undefined, false, undefined, this),
2373
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2374
+ children: "2. Your workflow file was kept unchanged"
2375
+ }, undefined, false, undefined, this),
2376
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2377
+ children: "3. API key is configured and ready to use"
2378
+ }, undefined, false, undefined, this)
2379
+ ]
2380
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
2381
+ children: [
2382
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2383
+ children: "1. A pre-filled PR page has been created"
2384
+ }, undefined, false, undefined, this),
2385
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2386
+ children: "2. Install the Claude GitHub App if you haven't already"
2387
+ }, undefined, false, undefined, this),
2388
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2389
+ children: "3. Merge the PR to enable Claude PR assistance"
2390
+ }, undefined, false, undefined, this)
2391
+ ]
2392
+ }, undefined, true, undefined, this);
2393
+ $[11] = skipWorkflow;
2394
+ $[12] = t7;
2395
+ } else {
2396
+ t7 = $[12];
2397
+ }
2398
+ let t8;
2399
+ if ($[13] !== t3 || $[14] !== t4 || $[15] !== t5 || $[16] !== t7) {
2400
+ t8 = /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
2401
+ flexDirection: "column",
2402
+ borderStyle: "round",
2403
+ paddingX: 1,
2404
+ children: [
2405
+ t2,
2406
+ t3,
2407
+ t4,
2408
+ t5,
2409
+ t6,
2410
+ t7
2411
+ ]
2412
+ }, undefined, true, undefined, this);
2413
+ $[13] = t3;
2414
+ $[14] = t4;
2415
+ $[15] = t5;
2416
+ $[16] = t7;
2417
+ $[17] = t8;
2418
+ } else {
2419
+ t8 = $[17];
2420
+ }
2421
+ let t9;
2422
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
2423
+ t9 = /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
2424
+ marginLeft: 3,
2425
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2426
+ dimColor: true,
2427
+ children: "Press any key to exit"
2428
+ }, undefined, false, undefined, this)
2429
+ }, undefined, false, undefined, this);
2430
+ $[18] = t9;
2431
+ } else {
2432
+ t9 = $[18];
2433
+ }
2434
+ let t10;
2435
+ if ($[19] !== t8) {
2436
+ t10 = /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
2437
+ children: [
2438
+ t8,
2439
+ t9
2440
+ ]
2441
+ }, undefined, true, undefined, this);
2442
+ $[19] = t8;
2443
+ $[20] = t10;
2444
+ } else {
2445
+ t10 = $[20];
2446
+ }
2447
+ return t10;
2448
+ }
2449
+ var import_compiler_runtime10, jsx_dev_runtime11;
2450
+ var init_SuccessStep = __esm(() => {
2451
+ init_ink();
2452
+ import_compiler_runtime10 = __toESM(require_compiler_runtime(), 1);
2453
+ jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
2454
+ });
2455
+
2456
+ // src/commands/install-github-app/setupGitHubActions.ts
2457
+ async function createWorkflowFile(repoName, branchName, workflowPath, workflowContent, secretName, message, context) {
2458
+ const checkFileResult = await execFileNoThrow("gh", [
2459
+ "api",
2460
+ `repos/${repoName}/contents/${workflowPath}`,
2461
+ "--jq",
2462
+ ".sha"
2463
+ ]);
2464
+ let fileSha = null;
2465
+ if (checkFileResult.code === 0) {
2466
+ fileSha = checkFileResult.stdout.trim();
2467
+ }
2468
+ let content = workflowContent;
2469
+ if (secretName === "CLAUDE_CODE_OAUTH_TOKEN") {
2470
+ content = workflowContent.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g, `claude_code_oauth_token: \${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}`);
2471
+ } else if (secretName !== "ANTHROPIC_API_KEY") {
2472
+ content = workflowContent.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g, `anthropic_api_key: \${{ secrets.${secretName} }}`);
2473
+ }
2474
+ const base64Content = Buffer.from(content).toString("base64");
2475
+ const apiParams = [
2476
+ "api",
2477
+ "--method",
2478
+ "PUT",
2479
+ `repos/${repoName}/contents/${workflowPath}`,
2480
+ "-f",
2481
+ `message=${fileSha ? `"Update ${message}"` : `"${message}"`}`,
2482
+ "-f",
2483
+ `content=${base64Content}`,
2484
+ "-f",
2485
+ `branch=${branchName}`
2486
+ ];
2487
+ if (fileSha) {
2488
+ apiParams.push("-f", `sha=${fileSha}`);
2489
+ }
2490
+ const createFileResult = await execFileNoThrow("gh", apiParams);
2491
+ if (createFileResult.code !== 0) {
2492
+ if (createFileResult.stderr.includes("422") && createFileResult.stderr.includes("sha")) {
2493
+ logEvent("tengu_setup_github_actions_failed", {
2494
+ reason: "failed_to_create_workflow_file",
2495
+ exit_code: createFileResult.code,
2496
+ ...context
2497
+ });
2498
+ 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.`);
2499
+ }
2500
+ logEvent("tengu_setup_github_actions_failed", {
2501
+ reason: "failed_to_create_workflow_file",
2502
+ exit_code: createFileResult.code,
2503
+ ...context
2504
+ });
2505
+ const helpText = `
2506
+
2507
+ Need help? Common issues:
2508
+ ` + `\xB7 Permission denied \u2192 Run: gh auth refresh -h github.com -s repo,workflow
2509
+ ` + `\xB7 Not authorized \u2192 Ensure you have admin access to the repository
2510
+ ` + "\xB7 For manual setup \u2192 Visit: https://github.com/anthropics/claude-code-action";
2511
+ throw new Error(`Failed to create workflow file ${workflowPath}: ${createFileResult.stderr}${helpText}`);
2512
+ }
2513
+ }
2514
+ async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, updateProgress, skipWorkflow = false, selectedWorkflows, authType, context) {
2515
+ try {
2516
+ logEvent("tengu_setup_github_actions_started", {
2517
+ skip_workflow: skipWorkflow,
2518
+ has_api_key: !!apiKeyOrOAuthToken,
2519
+ using_default_secret_name: secretName === "ANTHROPIC_API_KEY",
2520
+ selected_claude_workflow: selectedWorkflows.includes("claude"),
2521
+ selected_claude_review_workflow: selectedWorkflows.includes("claude-review"),
2522
+ ...context
2523
+ });
2524
+ const repoCheckResult = await execFileNoThrow("gh", [
2525
+ "api",
2526
+ `repos/${repoName}`,
2527
+ "--jq",
2528
+ ".id"
2529
+ ]);
2530
+ if (repoCheckResult.code !== 0) {
2531
+ logEvent("tengu_setup_github_actions_failed", {
2532
+ reason: "repo_not_found",
2533
+ exit_code: repoCheckResult.code,
2534
+ ...context
2535
+ });
2536
+ throw new Error(`Failed to access repository ${repoName}: ${repoCheckResult.stderr}`);
2537
+ }
2538
+ const defaultBranchResult = await execFileNoThrow("gh", [
2539
+ "api",
2540
+ `repos/${repoName}`,
2541
+ "--jq",
2542
+ ".default_branch"
2543
+ ]);
2544
+ if (defaultBranchResult.code !== 0) {
2545
+ logEvent("tengu_setup_github_actions_failed", {
2546
+ reason: "failed_to_get_default_branch",
2547
+ exit_code: defaultBranchResult.code,
2548
+ ...context
2549
+ });
2550
+ throw new Error(`Failed to get default branch: ${defaultBranchResult.stderr}`);
2551
+ }
2552
+ const defaultBranch = defaultBranchResult.stdout.trim();
2553
+ const shaResult = await execFileNoThrow("gh", [
2554
+ "api",
2555
+ `repos/${repoName}/git/ref/heads/${defaultBranch}`,
2556
+ "--jq",
2557
+ ".object.sha"
2558
+ ]);
2559
+ if (shaResult.code !== 0) {
2560
+ logEvent("tengu_setup_github_actions_failed", {
2561
+ reason: "failed_to_get_branch_sha",
2562
+ exit_code: shaResult.code,
2563
+ ...context
2564
+ });
2565
+ throw new Error(`Failed to get branch SHA: ${shaResult.stderr}`);
2566
+ }
2567
+ const sha = shaResult.stdout.trim();
2568
+ let branchName = null;
2569
+ if (!skipWorkflow) {
2570
+ updateProgress();
2571
+ branchName = `add-claude-github-actions-${Date.now()}`;
2572
+ const createBranchResult = await execFileNoThrow("gh", [
2573
+ "api",
2574
+ "--method",
2575
+ "POST",
2576
+ `repos/${repoName}/git/refs`,
2577
+ "-f",
2578
+ `ref=refs/heads/${branchName}`,
2579
+ "-f",
2580
+ `sha=${sha}`
2581
+ ]);
2582
+ if (createBranchResult.code !== 0) {
2583
+ logEvent("tengu_setup_github_actions_failed", {
2584
+ reason: "failed_to_create_branch",
2585
+ exit_code: createBranchResult.code,
2586
+ ...context
2587
+ });
2588
+ throw new Error(`Failed to create branch: ${createBranchResult.stderr}`);
2589
+ }
2590
+ updateProgress();
2591
+ const workflows = [];
2592
+ if (selectedWorkflows.includes("claude")) {
2593
+ workflows.push({
2594
+ path: ".github/workflows/claude.yml",
2595
+ content: WORKFLOW_CONTENT,
2596
+ message: "Claude PR Assistant workflow"
2597
+ });
2598
+ }
2599
+ if (selectedWorkflows.includes("claude-review")) {
2600
+ workflows.push({
2601
+ path: ".github/workflows/claude-code-review.yml",
2602
+ content: CODE_REVIEW_PLUGIN_WORKFLOW_CONTENT,
2603
+ message: "Claude Code Review workflow"
2604
+ });
2605
+ }
2606
+ for (const workflow of workflows) {
2607
+ await createWorkflowFile(repoName, branchName, workflow.path, workflow.content, secretName, workflow.message, context);
2608
+ }
2609
+ }
2610
+ updateProgress();
2611
+ if (apiKeyOrOAuthToken) {
2612
+ const setSecretResult = await execFileNoThrow("gh", [
2613
+ "secret",
2614
+ "set",
2615
+ secretName,
2616
+ "--body",
2617
+ apiKeyOrOAuthToken,
2618
+ "--repo",
2619
+ repoName
2620
+ ]);
2621
+ if (setSecretResult.code !== 0) {
2622
+ logEvent("tengu_setup_github_actions_failed", {
2623
+ reason: "failed_to_set_api_key_secret",
2624
+ exit_code: setSecretResult.code,
2625
+ ...context
2626
+ });
2627
+ const helpText = `
2628
+
2629
+ Need help? Common issues:
2630
+ ` + `\xB7 Permission denied \u2192 Run: gh auth refresh -h github.com -s repo
2631
+ ` + `\xB7 Not authorized \u2192 Ensure you have admin access to the repository
2632
+ ` + "\xB7 For manual setup \u2192 Visit: https://github.com/anthropics/claude-code-action";
2633
+ throw new Error(`Failed to set API key secret: ${setSecretResult.stderr || "Unknown error"}${helpText}`);
2634
+ }
2635
+ }
2636
+ if (!skipWorkflow && branchName) {
2637
+ updateProgress();
2638
+ const compareUrl = `https://github.com/${repoName}/compare/${defaultBranch}...${branchName}?quick_pull=1&title=${encodeURIComponent(PR_TITLE)}&body=${encodeURIComponent(PR_BODY)}`;
2639
+ await openBrowser(compareUrl);
2640
+ }
2641
+ logEvent("tengu_setup_github_actions_completed", {
2642
+ skip_workflow: skipWorkflow,
2643
+ has_api_key: !!apiKeyOrOAuthToken,
2644
+ auth_type: authType,
2645
+ using_default_secret_name: secretName === "ANTHROPIC_API_KEY",
2646
+ selected_claude_workflow: selectedWorkflows.includes("claude"),
2647
+ selected_claude_review_workflow: selectedWorkflows.includes("claude-review"),
2648
+ ...context
2649
+ });
2650
+ saveGlobalConfig((current) => ({
2651
+ ...current,
2652
+ githubActionSetupCount: (current.githubActionSetupCount ?? 0) + 1
2653
+ }));
2654
+ } catch (error) {
2655
+ if (!error || !(error instanceof Error) || !error.message.includes("Failed to")) {
2656
+ logEvent("tengu_setup_github_actions_failed", {
2657
+ reason: "unexpected_error",
2658
+ ...context
2659
+ });
2660
+ }
2661
+ if (error instanceof Error) {
2662
+ logError(error);
2663
+ }
2664
+ throw error;
2665
+ }
2666
+ }
2667
+ var init_setupGitHubActions = __esm(() => {
2668
+ init_analytics();
2669
+ init_config();
2670
+ init_browser();
2671
+ init_execFileNoThrow();
2672
+ init_log();
2673
+ });
2674
+
2675
+ // src/commands/install-github-app/WarningsStep.tsx
2676
+ function WarningsStep(t0) {
2677
+ const $ = import_compiler_runtime11.c(8);
2678
+ const {
2679
+ warnings,
2680
+ onContinue
2681
+ } = t0;
2682
+ let t1;
2683
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
2684
+ t1 = {
2685
+ context: "Confirmation"
2686
+ };
2687
+ $[0] = t1;
2688
+ } else {
2689
+ t1 = $[0];
2690
+ }
2691
+ useKeybinding("confirm:yes", onContinue, t1);
2692
+ let t2;
2693
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
2694
+ t2 = /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
2695
+ flexDirection: "column",
2696
+ marginBottom: 1,
2697
+ children: [
2698
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2699
+ bold: true,
2700
+ children: [
2701
+ figures_default.warning,
2702
+ " Setup Warnings"
2703
+ ]
2704
+ }, undefined, true, undefined, this),
2705
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2706
+ dimColor: true,
2707
+ children: "We found some potential issues, but you can continue anyway"
2708
+ }, undefined, false, undefined, this)
2709
+ ]
2710
+ }, undefined, true, undefined, this);
2711
+ $[1] = t2;
2712
+ } else {
2713
+ t2 = $[1];
2714
+ }
2715
+ let t3;
2716
+ if ($[2] !== warnings) {
2717
+ t3 = warnings.map(_temp22);
2718
+ $[2] = warnings;
2719
+ $[3] = t3;
2720
+ } else {
2721
+ t3 = $[3];
2722
+ }
2723
+ let t4;
2724
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
2725
+ t4 = /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
2726
+ marginTop: 1,
2727
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2728
+ bold: true,
2729
+ color: "permission",
2730
+ children: "Press Enter to continue anyway, or Ctrl+C to exit and fix issues"
2731
+ }, undefined, false, undefined, this)
2732
+ }, undefined, false, undefined, this);
2733
+ $[4] = t4;
2734
+ } else {
2735
+ t4 = $[4];
2736
+ }
2737
+ let t5;
2738
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
2739
+ t5 = /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
2740
+ marginTop: 1,
2741
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2742
+ dimColor: true,
2743
+ children: [
2744
+ "You can also try the manual setup steps if needed:",
2745
+ " ",
2746
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2747
+ color: "claude",
2748
+ children: GITHUB_ACTION_SETUP_DOCS_URL
2749
+ }, undefined, false, undefined, this)
2750
+ ]
2751
+ }, undefined, true, undefined, this)
2752
+ }, undefined, false, undefined, this);
2753
+ $[5] = t5;
2754
+ } else {
2755
+ t5 = $[5];
2756
+ }
2757
+ let t6;
2758
+ if ($[6] !== t3) {
2759
+ t6 = /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
2760
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
2761
+ flexDirection: "column",
2762
+ borderStyle: "round",
2763
+ paddingX: 1,
2764
+ children: [
2765
+ t2,
2766
+ t3,
2767
+ t4,
2768
+ t5
2769
+ ]
2770
+ }, undefined, true, undefined, this)
2771
+ }, undefined, false, undefined, this);
2772
+ $[6] = t3;
2773
+ $[7] = t6;
2774
+ } else {
2775
+ t6 = $[7];
2776
+ }
2777
+ return t6;
2778
+ }
2779
+ function _temp22(warning, index) {
2780
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
2781
+ flexDirection: "column",
2782
+ marginBottom: 1,
2783
+ children: [
2784
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2785
+ color: "warning",
2786
+ bold: true,
2787
+ children: warning.title
2788
+ }, undefined, false, undefined, this),
2789
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2790
+ children: warning.message
2791
+ }, undefined, false, undefined, this),
2792
+ warning.instructions.length > 0 && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
2793
+ flexDirection: "column",
2794
+ marginLeft: 2,
2795
+ marginTop: 1,
2796
+ children: warning.instructions.map(_temp3)
2797
+ }, undefined, false, undefined, this)
2798
+ ]
2799
+ }, index, true, undefined, this);
2800
+ }
2801
+ function _temp3(instruction, i) {
2802
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2803
+ dimColor: true,
2804
+ children: [
2805
+ "\u2022 ",
2806
+ instruction
2807
+ ]
2808
+ }, i, true, undefined, this);
2809
+ }
2810
+ var import_compiler_runtime11, jsx_dev_runtime12;
2811
+ var init_WarningsStep = __esm(() => {
2812
+ init_figures();
2813
+ init_ink();
2814
+ init_useKeybinding();
2815
+ import_compiler_runtime11 = __toESM(require_compiler_runtime(), 1);
2816
+ jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
2817
+ });
2818
+
2819
+ // src/commands/install-github-app/install-github-app.tsx
2820
+ function InstallGitHubApp(props) {
2821
+ const [existingApiKey] = import_react6.useState(() => getAnthropicApiKey());
2822
+ const [state, setState] = import_react6.useState({
2823
+ ...INITIAL_STATE,
2824
+ useExistingKey: !!existingApiKey,
2825
+ selectedApiKeyOption: existingApiKey ? "existing" : isAnthropicAuthEnabled() ? "oauth" : "new"
2826
+ });
2827
+ useExitOnCtrlCDWithKeybindings();
2828
+ import_react6.default.useEffect(() => {
2829
+ logEvent("tengu_install_github_app_started", {});
2830
+ }, []);
2831
+ const checkGitHubCLI = import_react6.useCallback(async () => {
2832
+ const warnings = [];
2833
+ const ghVersionResult = await execa("gh --version", {
2834
+ shell: true,
2835
+ reject: false
2836
+ });
2837
+ if (ghVersionResult.exitCode !== 0) {
2838
+ warnings.push({
2839
+ title: "GitHub CLI not found",
2840
+ message: "GitHub CLI (gh) does not appear to be installed or accessible.",
2841
+ instructions: ["Install GitHub CLI from https://cli.github.com/", "macOS: brew install gh", "Windows: winget install --id GitHub.cli", "Linux: See installation instructions at https://github.com/cli/cli#installation"]
2842
+ });
2843
+ }
2844
+ const authResult = await execa("gh auth status -a", {
2845
+ shell: true,
2846
+ reject: false
2847
+ });
2848
+ if (authResult.exitCode !== 0) {
2849
+ warnings.push({
2850
+ title: "GitHub CLI not authenticated",
2851
+ message: "GitHub CLI does not appear to be authenticated.",
2852
+ instructions: ["Run: gh auth login", "Follow the prompts to authenticate with GitHub", "Or set up authentication using environment variables or other methods"]
2853
+ });
2854
+ } else {
2855
+ const tokenScopesMatch = authResult.stdout.match(/Token scopes:.*$/m);
2856
+ if (tokenScopesMatch) {
2857
+ const scopes = tokenScopesMatch[0];
2858
+ const missingScopes = [];
2859
+ if (!scopes.includes("repo")) {
2860
+ missingScopes.push("repo");
2861
+ }
2862
+ if (!scopes.includes("workflow")) {
2863
+ missingScopes.push("workflow");
2864
+ }
2865
+ if (missingScopes.length > 0) {
2866
+ setState((prev) => ({
2867
+ ...prev,
2868
+ step: "error",
2869
+ error: `GitHub CLI is missing required permissions: ${missingScopes.join(", ")}.`,
2870
+ errorReason: "Missing required scopes",
2871
+ errorInstructions: [`Your GitHub CLI authentication is missing the "${missingScopes.join('" and "')}" ${plural(missingScopes.length, "scope")} needed to manage GitHub Actions and secrets.`, "", "To fix this, run:", " gh auth refresh -h github.com -s repo,workflow", "", "This will add the necessary permissions to manage workflows and secrets."]
2872
+ }));
2873
+ return;
2874
+ }
2875
+ }
2876
+ }
2877
+ const currentRepo = await getGithubRepo() ?? "";
2878
+ logEvent("tengu_install_github_app_step_completed", {
2879
+ step: "check-gh"
2880
+ });
2881
+ setState((prev_0) => ({
2882
+ ...prev_0,
2883
+ warnings,
2884
+ currentRepo,
2885
+ selectedRepoName: currentRepo,
2886
+ useCurrentRepo: !!currentRepo,
2887
+ step: warnings.length > 0 ? "warnings" : "choose-repo"
2888
+ }));
2889
+ }, []);
2890
+ import_react6.default.useEffect(() => {
2891
+ if (state.step === "check-gh") {
2892
+ checkGitHubCLI();
2893
+ }
2894
+ }, [state.step, checkGitHubCLI]);
2895
+ const runSetupGitHubActions = import_react6.useCallback(async (apiKeyOrOAuthToken, secretName) => {
2896
+ setState((prev_1) => ({
2897
+ ...prev_1,
2898
+ step: "creating",
2899
+ currentWorkflowInstallStep: 0
2900
+ }));
2901
+ try {
2902
+ await setupGitHubActions(state.selectedRepoName, apiKeyOrOAuthToken, secretName, () => {
2903
+ setState((prev_4) => ({
2904
+ ...prev_4,
2905
+ currentWorkflowInstallStep: prev_4.currentWorkflowInstallStep + 1
2906
+ }));
2907
+ }, state.workflowAction === "skip", state.selectedWorkflows, state.authType, {
2908
+ useCurrentRepo: state.useCurrentRepo,
2909
+ workflowExists: state.workflowExists,
2910
+ secretExists: state.secretExists
2911
+ });
2912
+ logEvent("tengu_install_github_app_step_completed", {
2913
+ step: "creating"
2914
+ });
2915
+ setState((prev_5) => ({
2916
+ ...prev_5,
2917
+ step: "success"
2918
+ }));
2919
+ } catch (error) {
2920
+ const errorMessage = error instanceof Error ? error.message : "Failed to set up GitHub Actions";
2921
+ if (errorMessage.includes("workflow file already exists")) {
2922
+ logEvent("tengu_install_github_app_error", {
2923
+ reason: "workflow_file_exists"
2924
+ });
2925
+ setState((prev_2) => ({
2926
+ ...prev_2,
2927
+ step: "error",
2928
+ error: "A Claude workflow file already exists in this repository.",
2929
+ errorReason: "Workflow file conflict",
2930
+ errorInstructions: ["The file .github/workflows/claude.yml already exists", "You can either:", " 1. Delete the existing file and run this command again", " 2. Update the existing file manually using the template from:", ` ${GITHUB_ACTION_SETUP_DOCS_URL}`]
2931
+ }));
2932
+ } else {
2933
+ logEvent("tengu_install_github_app_error", {
2934
+ reason: "setup_github_actions_failed"
2935
+ });
2936
+ setState((prev_3) => ({
2937
+ ...prev_3,
2938
+ step: "error",
2939
+ error: errorMessage,
2940
+ errorReason: "GitHub Actions setup failed",
2941
+ errorInstructions: []
2942
+ }));
2943
+ }
2944
+ }
2945
+ }, [state.selectedRepoName, state.workflowAction, state.selectedWorkflows, state.useCurrentRepo, state.workflowExists, state.secretExists, state.authType]);
2946
+ async function openGitHubAppInstallation() {
2947
+ const installUrl = "https://github.com/apps/claude";
2948
+ await openBrowser(installUrl);
2949
+ }
2950
+ async function checkRepositoryPermissions(repoName) {
2951
+ try {
2952
+ const result = await execFileNoThrow("gh", ["api", `repos/${repoName}`, "--jq", ".permissions.admin"]);
2953
+ if (result.code === 0) {
2954
+ const hasAdmin = result.stdout.trim() === "true";
2955
+ return {
2956
+ hasAccess: hasAdmin
2957
+ };
2958
+ }
2959
+ if (result.stderr.includes("404") || result.stderr.includes("Not Found")) {
2960
+ return {
2961
+ hasAccess: false,
2962
+ error: "repository_not_found"
2963
+ };
2964
+ }
2965
+ return {
2966
+ hasAccess: false
2967
+ };
2968
+ } catch {
2969
+ return {
2970
+ hasAccess: false
2971
+ };
2972
+ }
2973
+ }
2974
+ async function checkExistingWorkflowFile(repoName_0) {
2975
+ const checkFileResult = await execFileNoThrow("gh", ["api", `repos/${repoName_0}/contents/.github/workflows/claude.yml`, "--jq", ".sha"]);
2976
+ return checkFileResult.code === 0;
2977
+ }
2978
+ async function checkExistingSecret() {
2979
+ const checkSecretsResult = await execFileNoThrow("gh", ["secret", "list", "--app", "actions", "--repo", state.selectedRepoName]);
2980
+ if (checkSecretsResult.code === 0) {
2981
+ const lines = checkSecretsResult.stdout.split(`
2982
+ `);
2983
+ const hasAnthropicKey = lines.some((line) => {
2984
+ return /^ANTHROPIC_API_KEY\s+/.test(line);
2985
+ });
2986
+ if (hasAnthropicKey) {
2987
+ setState((prev_6) => ({
2988
+ ...prev_6,
2989
+ secretExists: true,
2990
+ step: "check-existing-secret"
2991
+ }));
2992
+ } else {
2993
+ if (existingApiKey) {
2994
+ setState((prev_7) => ({
2995
+ ...prev_7,
2996
+ apiKeyOrOAuthToken: existingApiKey,
2997
+ useExistingKey: true
2998
+ }));
2999
+ await runSetupGitHubActions(existingApiKey, state.secretName);
3000
+ } else {
3001
+ setState((prev_8) => ({
3002
+ ...prev_8,
3003
+ step: "api-key"
3004
+ }));
3005
+ }
3006
+ }
3007
+ } else {
3008
+ if (existingApiKey) {
3009
+ setState((prev_9) => ({
3010
+ ...prev_9,
3011
+ apiKeyOrOAuthToken: existingApiKey,
3012
+ useExistingKey: true
3013
+ }));
3014
+ await runSetupGitHubActions(existingApiKey, state.secretName);
3015
+ } else {
3016
+ setState((prev_10) => ({
3017
+ ...prev_10,
3018
+ step: "api-key"
3019
+ }));
3020
+ }
3021
+ }
3022
+ }
3023
+ const handleSubmit = async () => {
3024
+ if (state.step === "warnings") {
3025
+ logEvent("tengu_install_github_app_step_completed", {
3026
+ step: "warnings"
3027
+ });
3028
+ setState((prev_11) => ({
3029
+ ...prev_11,
3030
+ step: "install-app"
3031
+ }));
3032
+ setTimeout(openGitHubAppInstallation, 0);
3033
+ } else if (state.step === "choose-repo") {
3034
+ let repoName_1 = state.useCurrentRepo ? state.currentRepo : state.selectedRepoName;
3035
+ if (!repoName_1.trim()) {
3036
+ return;
3037
+ }
3038
+ const repoWarnings = [];
3039
+ if (repoName_1.includes("github.com")) {
3040
+ const match = repoName_1.match(/github\.com[:/]([^/]+\/[^/]+)(\.git)?$/);
3041
+ if (!match) {
3042
+ repoWarnings.push({
3043
+ title: "Invalid GitHub URL format",
3044
+ message: "The repository URL format appears to be invalid.",
3045
+ instructions: ["Use format: owner/repo or https://github.com/owner/repo", "Example: anthropics/claude-cli"]
3046
+ });
3047
+ } else {
3048
+ repoName_1 = match[1]?.replace(/\.git$/, "") || "";
3049
+ }
3050
+ }
3051
+ if (!repoName_1.includes("/")) {
3052
+ repoWarnings.push({
3053
+ title: "Repository format warning",
3054
+ message: 'Repository should be in format "owner/repo"',
3055
+ instructions: ["Use format: owner/repo", "Example: anthropics/claude-cli"]
3056
+ });
3057
+ }
3058
+ const permissionCheck = await checkRepositoryPermissions(repoName_1);
3059
+ if (permissionCheck.error === "repository_not_found") {
3060
+ repoWarnings.push({
3061
+ title: "Repository not found",
3062
+ message: `Repository ${repoName_1} was not found or you don't have access.`,
3063
+ instructions: [`Check that the repository name is correct: ${repoName_1}`, "Ensure you have access to this repository", 'For private repositories, make sure your GitHub token has the "repo" scope', "You can add the repo scope with: gh auth refresh -h github.com -s repo,workflow"]
3064
+ });
3065
+ } else if (!permissionCheck.hasAccess) {
3066
+ repoWarnings.push({
3067
+ title: "Admin permissions required",
3068
+ message: `You might need admin permissions on ${repoName_1} to set up GitHub Actions.`,
3069
+ instructions: ["Repository admins can install GitHub Apps and set secrets", "Ask a repository admin to run this command if setup fails", "Alternatively, you can use the manual setup instructions"]
3070
+ });
3071
+ }
3072
+ const workflowExists = await checkExistingWorkflowFile(repoName_1);
3073
+ if (repoWarnings.length > 0) {
3074
+ const allWarnings = [...state.warnings, ...repoWarnings];
3075
+ setState((prev_12) => ({
3076
+ ...prev_12,
3077
+ selectedRepoName: repoName_1,
3078
+ workflowExists,
3079
+ warnings: allWarnings,
3080
+ step: "warnings"
3081
+ }));
3082
+ } else {
3083
+ logEvent("tengu_install_github_app_step_completed", {
3084
+ step: "choose-repo"
3085
+ });
3086
+ setState((prev_13) => ({
3087
+ ...prev_13,
3088
+ selectedRepoName: repoName_1,
3089
+ workflowExists,
3090
+ step: "install-app"
3091
+ }));
3092
+ setTimeout(openGitHubAppInstallation, 0);
3093
+ }
3094
+ } else if (state.step === "install-app") {
3095
+ logEvent("tengu_install_github_app_step_completed", {
3096
+ step: "install-app"
3097
+ });
3098
+ if (state.workflowExists) {
3099
+ setState((prev_14) => ({
3100
+ ...prev_14,
3101
+ step: "check-existing-workflow"
3102
+ }));
3103
+ } else {
3104
+ setState((prev_15) => ({
3105
+ ...prev_15,
3106
+ step: "select-workflows"
3107
+ }));
3108
+ }
3109
+ } else if (state.step === "check-existing-workflow") {
3110
+ return;
3111
+ } else if (state.step === "select-workflows") {
3112
+ return;
3113
+ } else if (state.step === "check-existing-secret") {
3114
+ logEvent("tengu_install_github_app_step_completed", {
3115
+ step: "check-existing-secret"
3116
+ });
3117
+ if (state.useExistingSecret) {
3118
+ await runSetupGitHubActions(null, state.secretName);
3119
+ } else {
3120
+ await runSetupGitHubActions(state.apiKeyOrOAuthToken, state.secretName);
3121
+ }
3122
+ } else if (state.step === "api-key") {
3123
+ if (state.selectedApiKeyOption === "oauth") {
3124
+ return;
3125
+ }
3126
+ const apiKeyToUse = state.selectedApiKeyOption === "existing" ? existingApiKey : state.apiKeyOrOAuthToken;
3127
+ if (!apiKeyToUse) {
3128
+ logEvent("tengu_install_github_app_error", {
3129
+ reason: "api_key_missing"
3130
+ });
3131
+ setState((prev_16) => ({
3132
+ ...prev_16,
3133
+ step: "error",
3134
+ error: "API key is required"
3135
+ }));
3136
+ return;
3137
+ }
3138
+ setState((prev_17) => ({
3139
+ ...prev_17,
3140
+ apiKeyOrOAuthToken: apiKeyToUse,
3141
+ useExistingKey: state.selectedApiKeyOption === "existing"
3142
+ }));
3143
+ const checkSecretsResult_0 = await execFileNoThrow("gh", ["secret", "list", "--app", "actions", "--repo", state.selectedRepoName]);
3144
+ if (checkSecretsResult_0.code === 0) {
3145
+ const lines_0 = checkSecretsResult_0.stdout.split(`
3146
+ `);
3147
+ const hasAnthropicKey_0 = lines_0.some((line_0) => {
3148
+ return /^ANTHROPIC_API_KEY\s+/.test(line_0);
3149
+ });
3150
+ if (hasAnthropicKey_0) {
3151
+ logEvent("tengu_install_github_app_step_completed", {
3152
+ step: "api-key"
3153
+ });
3154
+ setState((prev_18) => ({
3155
+ ...prev_18,
3156
+ secretExists: true,
3157
+ step: "check-existing-secret"
3158
+ }));
3159
+ } else {
3160
+ logEvent("tengu_install_github_app_step_completed", {
3161
+ step: "api-key"
3162
+ });
3163
+ await runSetupGitHubActions(apiKeyToUse, state.secretName);
3164
+ }
3165
+ } else {
3166
+ logEvent("tengu_install_github_app_step_completed", {
3167
+ step: "api-key"
3168
+ });
3169
+ await runSetupGitHubActions(apiKeyToUse, state.secretName);
3170
+ }
3171
+ }
3172
+ };
3173
+ const handleRepoUrlChange = (value) => {
3174
+ setState((prev_19) => ({
3175
+ ...prev_19,
3176
+ selectedRepoName: value
3177
+ }));
3178
+ };
3179
+ const handleApiKeyChange = (value_0) => {
3180
+ setState((prev_20) => ({
3181
+ ...prev_20,
3182
+ apiKeyOrOAuthToken: value_0
3183
+ }));
3184
+ };
3185
+ const handleApiKeyOptionChange = (option) => {
3186
+ setState((prev_21) => ({
3187
+ ...prev_21,
3188
+ selectedApiKeyOption: option
3189
+ }));
3190
+ };
3191
+ const handleCreateOAuthToken = import_react6.useCallback(() => {
3192
+ logEvent("tengu_install_github_app_step_completed", {
3193
+ step: "api-key"
3194
+ });
3195
+ setState((prev_22) => ({
3196
+ ...prev_22,
3197
+ step: "oauth-flow"
3198
+ }));
3199
+ }, []);
3200
+ const handleOAuthSuccess = import_react6.useCallback((token) => {
3201
+ logEvent("tengu_install_github_app_step_completed", {
3202
+ step: "oauth-flow"
3203
+ });
3204
+ setState((prev_23) => ({
3205
+ ...prev_23,
3206
+ apiKeyOrOAuthToken: token,
3207
+ useExistingKey: false,
3208
+ secretName: "CLAUDE_CODE_OAUTH_TOKEN",
3209
+ authType: "oauth_token"
3210
+ }));
3211
+ runSetupGitHubActions(token, "CLAUDE_CODE_OAUTH_TOKEN");
3212
+ }, [runSetupGitHubActions]);
3213
+ const handleOAuthCancel = import_react6.useCallback(() => {
3214
+ setState((prev_24) => ({
3215
+ ...prev_24,
3216
+ step: "api-key"
3217
+ }));
3218
+ }, []);
3219
+ const handleSecretNameChange = (value_1) => {
3220
+ if (value_1 && !/^[a-zA-Z0-9_]+$/.test(value_1))
3221
+ return;
3222
+ setState((prev_25) => ({
3223
+ ...prev_25,
3224
+ secretName: value_1
3225
+ }));
3226
+ };
3227
+ const handleToggleUseCurrentRepo = (useCurrentRepo) => {
3228
+ setState((prev_26) => ({
3229
+ ...prev_26,
3230
+ useCurrentRepo,
3231
+ selectedRepoName: useCurrentRepo ? prev_26.currentRepo : ""
3232
+ }));
3233
+ };
3234
+ const handleToggleUseExistingKey = (useExistingKey) => {
3235
+ setState((prev_27) => ({
3236
+ ...prev_27,
3237
+ useExistingKey
3238
+ }));
3239
+ };
3240
+ const handleToggleUseExistingSecret = (useExistingSecret) => {
3241
+ setState((prev_28) => ({
3242
+ ...prev_28,
3243
+ useExistingSecret,
3244
+ secretName: useExistingSecret ? "ANTHROPIC_API_KEY" : ""
3245
+ }));
3246
+ };
3247
+ const handleWorkflowAction = async (action) => {
3248
+ if (action === "exit") {
3249
+ props.onDone("Installation cancelled by user");
3250
+ return;
3251
+ }
3252
+ logEvent("tengu_install_github_app_step_completed", {
3253
+ step: "check-existing-workflow"
3254
+ });
3255
+ setState((prev_29) => ({
3256
+ ...prev_29,
3257
+ workflowAction: action
3258
+ }));
3259
+ if (action === "skip" || action === "update") {
3260
+ if (existingApiKey) {
3261
+ await checkExistingSecret();
3262
+ } else {
3263
+ setState((prev_30) => ({
3264
+ ...prev_30,
3265
+ step: "api-key"
3266
+ }));
3267
+ }
3268
+ }
3269
+ };
3270
+ function handleDismissKeyDown(e) {
3271
+ e.preventDefault();
3272
+ if (state.step === "success") {
3273
+ logEvent("tengu_install_github_app_completed", {});
3274
+ }
3275
+ props.onDone(state.step === "success" ? "GitHub Actions setup complete!" : state.error ? `Couldn't install GitHub App: ${state.error}
3276
+ For manual setup instructions, see: ${GITHUB_ACTION_SETUP_DOCS_URL}` : `GitHub App installation failed
3277
+ For manual setup instructions, see: ${GITHUB_ACTION_SETUP_DOCS_URL}`);
3278
+ }
3279
+ switch (state.step) {
3280
+ case "check-gh":
3281
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(CheckGitHubStep, {}, undefined, false, undefined, this);
3282
+ case "warnings":
3283
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(WarningsStep, {
3284
+ warnings: state.warnings,
3285
+ onContinue: handleSubmit
3286
+ }, undefined, false, undefined, this);
3287
+ case "choose-repo":
3288
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ChooseRepoStep, {
3289
+ currentRepo: state.currentRepo,
3290
+ useCurrentRepo: state.useCurrentRepo,
3291
+ repoUrl: state.selectedRepoName,
3292
+ onRepoUrlChange: handleRepoUrlChange,
3293
+ onToggleUseCurrentRepo: handleToggleUseCurrentRepo,
3294
+ onSubmit: handleSubmit
3295
+ }, undefined, false, undefined, this);
3296
+ case "install-app":
3297
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(InstallAppStep, {
3298
+ repoUrl: state.selectedRepoName,
3299
+ onSubmit: handleSubmit
3300
+ }, undefined, false, undefined, this);
3301
+ case "check-existing-workflow":
3302
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ExistingWorkflowStep, {
3303
+ repoName: state.selectedRepoName,
3304
+ onSelectAction: handleWorkflowAction
3305
+ }, undefined, false, undefined, this);
3306
+ case "check-existing-secret":
3307
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(CheckExistingSecretStep, {
3308
+ useExistingSecret: state.useExistingSecret,
3309
+ secretName: state.secretName,
3310
+ onToggleUseExistingSecret: handleToggleUseExistingSecret,
3311
+ onSecretNameChange: handleSecretNameChange,
3312
+ onSubmit: handleSubmit
3313
+ }, undefined, false, undefined, this);
3314
+ case "api-key":
3315
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ApiKeyStep, {
3316
+ existingApiKey,
3317
+ useExistingKey: state.useExistingKey,
3318
+ apiKeyOrOAuthToken: state.apiKeyOrOAuthToken,
3319
+ onApiKeyChange: handleApiKeyChange,
3320
+ onToggleUseExistingKey: handleToggleUseExistingKey,
3321
+ onSubmit: handleSubmit,
3322
+ onCreateOAuthToken: isAnthropicAuthEnabled() ? handleCreateOAuthToken : undefined,
3323
+ selectedOption: state.selectedApiKeyOption,
3324
+ onSelectOption: handleApiKeyOptionChange
3325
+ }, undefined, false, undefined, this);
3326
+ case "creating":
3327
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(CreatingStep, {
3328
+ currentWorkflowInstallStep: state.currentWorkflowInstallStep,
3329
+ secretExists: state.secretExists,
3330
+ useExistingSecret: state.useExistingSecret,
3331
+ secretName: state.secretName,
3332
+ skipWorkflow: state.workflowAction === "skip",
3333
+ selectedWorkflows: state.selectedWorkflows
3334
+ }, undefined, false, undefined, this);
3335
+ case "success":
3336
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
3337
+ tabIndex: 0,
3338
+ autoFocus: true,
3339
+ onKeyDown: handleDismissKeyDown,
3340
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(SuccessStep, {
3341
+ secretExists: state.secretExists,
3342
+ useExistingSecret: state.useExistingSecret,
3343
+ secretName: state.secretName,
3344
+ skipWorkflow: state.workflowAction === "skip"
3345
+ }, undefined, false, undefined, this)
3346
+ }, undefined, false, undefined, this);
3347
+ case "error":
3348
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
3349
+ tabIndex: 0,
3350
+ autoFocus: true,
3351
+ onKeyDown: handleDismissKeyDown,
3352
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ErrorStep, {
3353
+ error: state.error,
3354
+ errorReason: state.errorReason,
3355
+ errorInstructions: state.errorInstructions
3356
+ }, undefined, false, undefined, this)
3357
+ }, undefined, false, undefined, this);
3358
+ case "select-workflows":
3359
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(WorkflowMultiselectDialog, {
3360
+ defaultSelections: state.selectedWorkflows,
3361
+ onSubmit: (selectedWorkflows) => {
3362
+ logEvent("tengu_install_github_app_step_completed", {
3363
+ step: "select-workflows"
3364
+ });
3365
+ setState((prev_31) => ({
3366
+ ...prev_31,
3367
+ selectedWorkflows
3368
+ }));
3369
+ if (existingApiKey) {
3370
+ checkExistingSecret();
3371
+ } else {
3372
+ setState((prev_32) => ({
3373
+ ...prev_32,
3374
+ step: "api-key"
3375
+ }));
3376
+ }
3377
+ }
3378
+ }, undefined, false, undefined, this);
3379
+ case "oauth-flow":
3380
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(OAuthFlowStep, {
3381
+ onSuccess: handleOAuthSuccess,
3382
+ onCancel: handleOAuthCancel
3383
+ }, undefined, false, undefined, this);
3384
+ }
3385
+ }
3386
+ async function call(onDone) {
3387
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(InstallGitHubApp, {
3388
+ onDone
3389
+ }, undefined, false, undefined, this);
3390
+ }
3391
+ var import_react6, jsx_dev_runtime13, INITIAL_STATE;
3392
+ var init_install_github_app = __esm(() => {
3393
+ init_execa();
3394
+ init_analytics();
3395
+ init_WorkflowMultiselectDialog();
3396
+ init_useExitOnCtrlCDWithKeybindings();
3397
+ init_ink();
3398
+ init_auth();
3399
+ init_browser();
3400
+ init_execFileNoThrow();
3401
+ init_git();
3402
+ init_stringUtils();
3403
+ init_ApiKeyStep();
3404
+ init_CheckExistingSecretStep();
3405
+ init_CheckGitHubStep();
3406
+ init_ChooseRepoStep();
3407
+ init_CreatingStep();
3408
+ init_ErrorStep();
3409
+ init_ExistingWorkflowStep();
3410
+ init_InstallAppStep();
3411
+ init_OAuthFlowStep();
3412
+ init_SuccessStep();
3413
+ init_setupGitHubActions();
3414
+ init_WarningsStep();
3415
+ import_react6 = __toESM(require_react(), 1);
3416
+ jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
3417
+ INITIAL_STATE = {
3418
+ step: "check-gh",
3419
+ selectedRepoName: "",
3420
+ currentRepo: "",
3421
+ useCurrentRepo: false,
3422
+ apiKeyOrOAuthToken: "",
3423
+ useExistingKey: true,
3424
+ currentWorkflowInstallStep: 0,
3425
+ warnings: [],
3426
+ secretExists: false,
3427
+ secretName: "ANTHROPIC_API_KEY",
3428
+ useExistingSecret: true,
3429
+ workflowExists: false,
3430
+ selectedWorkflows: ["claude", "claude-review"],
3431
+ selectedApiKeyOption: "new",
3432
+ authType: "api_key"
3433
+ };
3434
+ });
3435
+ init_install_github_app();
3436
+
3437
+ export {
3438
+ call
3439
+ };