claude-code-best 1.1.0 → 1.2.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 (514) hide show
  1. package/README.md +66 -75
  2. package/dist/{chunk-q5b91nhh.js → chunk-01qzvbp3.js} +8 -2
  3. package/dist/{chunk-f9b4wb89.js → chunk-053bj0m0.js} +79 -73
  4. package/dist/chunk-05tt9tt1.js +653 -0
  5. package/dist/chunk-06sq1vz3.js +403 -0
  6. package/dist/chunk-07069jq1.js +30 -0
  7. package/dist/chunk-0dac8msw.js +135 -0
  8. package/dist/{chunk-m5eb5pt2.js → chunk-0ja0y3at.js} +6 -6
  9. package/dist/chunk-0jzdwbdc.js +14 -0
  10. package/dist/chunk-0nrq46nf.js +313 -0
  11. package/dist/chunk-0qz705wz.js +192 -0
  12. package/dist/{chunk-m94pnhfa.js → chunk-0rn4v8sg.js} +38 -28
  13. package/dist/{chunk-1cbn5kxf.js → chunk-0rpb2bdp.js} +3 -2
  14. package/dist/{chunk-zz21rvr7.js → chunk-127cmycn.js} +8 -5
  15. package/dist/chunk-12vk6z7z.js +109 -0
  16. package/dist/{chunk-vybkxr18.js → chunk-15y014gg.js} +41 -31
  17. package/dist/{chunk-44fpr6jq.js → chunk-168xb8v1.js} +4 -2
  18. package/dist/{chunk-8hsyagr8.js → chunk-16bnxyz0.js} +1 -1
  19. package/dist/{chunk-wsqhnjj3.js → chunk-1atfzck5.js} +24 -24
  20. package/dist/chunk-1cbhkqxg.js +310 -0
  21. package/dist/chunk-1csq8bf1.js +295 -0
  22. package/dist/{chunk-0e1xsncc.js → chunk-1cwdhk7a.js} +1 -1
  23. package/dist/{chunk-c8jv6rtj.js → chunk-1ebqpwhn.js} +74 -68
  24. package/dist/{chunk-vyd8jzde.js → chunk-1mh5vt6v.js} +91 -83
  25. package/dist/chunk-1qf125vg.js +123 -0
  26. package/dist/{chunk-ryj80g9p.js → chunk-1sp6713v.js} +131 -176
  27. package/dist/{chunk-d18z9pna.js → chunk-1thgdca1.js} +2 -2
  28. package/dist/chunk-1z1gfx2c.js +443 -0
  29. package/dist/{chunk-wc6wwwyb.js → chunk-21z7acxh.js} +3 -3
  30. package/dist/chunk-229pcf6p.js +509 -0
  31. package/dist/chunk-238g70xa.js +1 -1
  32. package/dist/{chunk-vpb723tx.js → chunk-23ad5t92.js} +5 -5
  33. package/dist/chunk-28043j1k.js +68 -0
  34. package/dist/chunk-299r6d9v.js +141 -0
  35. package/dist/{chunk-a6s8wnhe.js → chunk-2bw5nqsw.js} +4 -4
  36. package/dist/chunk-2mxstrx5.js +445 -0
  37. package/dist/{chunk-9g827w4j.js → chunk-2q39ej51.js} +6 -6
  38. package/dist/chunk-2qwgfjcj.js +5370 -0
  39. package/dist/chunk-2ss23j0q.js +3587 -0
  40. package/dist/{chunk-hy3g1nv8.js → chunk-2wvxddsg.js} +9 -7
  41. package/dist/chunk-2x2aznpc.js +134 -0
  42. package/dist/{chunk-bqq4zamw.js → chunk-2ys5wcxk.js} +3 -3
  43. package/dist/{chunk-x51h62jq.js → chunk-3cvcwgsr.js} +74 -68
  44. package/dist/{chunk-mecs0gpc.js → chunk-3xv7rjsy.js} +14 -11
  45. package/dist/chunk-42x5tjk2.js +42 -0
  46. package/dist/{chunk-q6rax9kh.js → chunk-436r0x2n.js} +5 -5
  47. package/dist/{chunk-zgrg0wk3.js → chunk-44q4jkwa.js} +27 -67
  48. package/dist/{chunk-zq9xa1xe.js → chunk-44w22kyx.js} +104 -139
  49. package/dist/{chunk-yhd82045.js → chunk-46fcr28b.js} +30 -9
  50. package/dist/{chunk-wm2f2f1z.js → chunk-474y75ga.js} +2 -2
  51. package/dist/{chunk-6fkwz9yk.js → chunk-478rpnqm.js} +8 -8
  52. package/dist/{chunk-rj86xm6z.js → chunk-48w0df8a.js} +1 -1
  53. package/dist/{chunk-v4t6dyyh.js → chunk-4cp6193g.js} +2 -2
  54. package/dist/chunk-4d0de73v.js +436 -0
  55. package/dist/chunk-4eecm90d.js +1030 -0
  56. package/dist/{chunk-q7tvkc86.js → chunk-4f4ccg1h.js} +10 -115
  57. package/dist/chunk-4h102wt5.js +65 -0
  58. package/dist/{chunk-3mgywd32.js → chunk-4hv90qcz.js} +1 -1
  59. package/dist/{chunk-bcrxtdcy.js → chunk-4jcqmf9w.js} +39 -29
  60. package/dist/{chunk-v8xem37v.js → chunk-4kk7vxed.js} +8 -6
  61. package/dist/chunk-4nspekjp.js +69 -0
  62. package/dist/chunk-4xmb7bvy.js +125 -0
  63. package/dist/{chunk-427m88ms.js → chunk-4xy0c1dz.js} +8 -8
  64. package/dist/{chunk-41mpwc8h.js → chunk-53c9gb9c.js} +19 -15
  65. package/dist/{chunk-bpts9jbq.js → chunk-53zsn91p.js} +39 -31
  66. package/dist/{chunk-t7cbhqd2.js → chunk-548g1d6z.js} +104 -119
  67. package/dist/chunk-559yvwh1.js +63 -0
  68. package/dist/chunk-5a6ahhvy.js +594 -0
  69. package/dist/{chunk-5tx8dsy0.js → chunk-5c6man70.js} +9531 -18004
  70. package/dist/chunk-5hb5ev7b.js +74 -0
  71. package/dist/{chunk-ggqx30m9.js → chunk-5z28bqne.js} +23 -311
  72. package/dist/{chunk-p7g7pf3f.js → chunk-61ahbn23.js} +8 -6
  73. package/dist/{chunk-0sb5scxx.js → chunk-652wnf1z.js} +5 -5
  74. package/dist/{chunk-7tqhx6dr.js → chunk-66jkaz3q.js} +109 -213
  75. package/dist/{chunk-q25bjaev.js → chunk-677as3nh.js} +2 -2
  76. package/dist/chunk-68ksfahx.js +386 -0
  77. package/dist/{chunk-xs0hwvpa.js → chunk-68pfxvxt.js} +14 -9
  78. package/dist/{chunk-epmheefa.js → chunk-69hys77v.js} +8 -8
  79. package/dist/{chunk-9g2ncq68.js → chunk-6ayqcq3h.js} +120 -127
  80. package/dist/chunk-6kpbgc5w.js +23 -0
  81. package/dist/chunk-6mpsxxsf.js +362 -0
  82. package/dist/chunk-6nze0g86.js +119 -0
  83. package/dist/{chunk-v1mgv1et.js → chunk-6p4cyhb3.js} +4 -3
  84. package/dist/{chunk-2w8633e3.js → chunk-6t62dbnb.js} +61 -100
  85. package/dist/chunk-6t87a3q6.js +2842 -0
  86. package/dist/{chunk-6mz58s8p.js → chunk-6xana182.js} +18 -14
  87. package/dist/{chunk-fpf4cgbt.js → chunk-7bfach0x.js} +9 -9
  88. package/dist/{chunk-n7158r58.js → chunk-7f1ggjr2.js} +75 -69
  89. package/dist/chunk-7fxjmmfw.js +1172 -0
  90. package/dist/{chunk-ckcagq32.js → chunk-7gqf9wej.js} +5 -5
  91. package/dist/{chunk-b1xt9jqg.js → chunk-7j3dkjqq.js} +15 -5
  92. package/dist/chunk-7ns74x0q.js +475 -0
  93. package/dist/{chunk-ghr4s9g6.js → chunk-7qmknpkq.js} +75 -69
  94. package/dist/chunk-7rzepn9c.js +83 -0
  95. package/dist/chunk-7tdcwje9.js +68 -0
  96. package/dist/{chunk-b4mnbry0.js → chunk-8201tnhf.js} +4 -4
  97. package/dist/{chunk-dv1wfr85.js → chunk-8225arm6.js} +5 -4
  98. package/dist/chunk-822wfv88.js +70 -0
  99. package/dist/chunk-837tm8ht.js +183 -0
  100. package/dist/chunk-8a2ajt5d.js +878 -0
  101. package/dist/{chunk-bj0rvnjw.js → chunk-8bymxfn4.js} +39 -29
  102. package/dist/chunk-8cwbzk7h.js +118 -0
  103. package/dist/chunk-8d0ev0m2.js +111 -0
  104. package/dist/{chunk-4pbx3g7s.js → chunk-8g747a8x.js} +1 -1
  105. package/dist/chunk-8kfwb79z.js +436 -0
  106. package/dist/{chunk-xyqr1cww.js → chunk-8me0yq6v.js} +12 -12
  107. package/dist/{chunk-k5gdea6r.js → chunk-8n8285ax.js} +78 -72
  108. package/dist/{chunk-sdj9b9wh.js → chunk-8pn8tvgg.js} +9 -154
  109. package/dist/{chunk-d7mx1phm.js → chunk-8qhr4n77.js} +61 -103
  110. package/dist/{chunk-7ejt5gqq.js → chunk-8s9bbk3r.js} +58 -45
  111. package/dist/{chunk-bmvb57qb.js → chunk-905d2hee.js} +5 -5
  112. package/dist/{chunk-fk06pejm.js → chunk-91xq5y4a.js} +9 -9
  113. package/dist/{chunk-ahjgghpe.js → chunk-93xsyzsp.js} +1 -1
  114. package/dist/chunk-99pmbfqp.js +230 -0
  115. package/dist/{chunk-cgn27dqf.js → chunk-9f14bkn9.js} +3 -3
  116. package/dist/{chunk-sa7nc0vv.js → chunk-9m78gjpd.js} +1 -1
  117. package/dist/{chunk-kq098bkj.js → chunk-9pm2d2gv.js} +245 -316
  118. package/dist/chunk-a136cvvz.js +27 -0
  119. package/dist/{chunk-n5t9m8h9.js → chunk-a1bjde7d.js} +7 -7
  120. package/dist/chunk-a2evk7n1.js +168 -0
  121. package/dist/{chunk-khdjg2v9.js → chunk-a3k4w4cm.js} +38 -28
  122. package/dist/chunk-a3mcc1sb.js +1403 -0
  123. package/dist/{chunk-8hq5kk3y.js → chunk-a4twdmhf.js} +3 -2
  124. package/dist/chunk-a8eaey19.js +66 -0
  125. package/dist/chunk-abkb5pw6.js +426 -0
  126. package/dist/chunk-ae76ded0.js +30 -0
  127. package/dist/{chunk-660kcy7p.js → chunk-agx5w9ce.js} +14 -8
  128. package/dist/chunk-ah46h8rp.js +70 -0
  129. package/dist/chunk-aj3azy6z.js +409 -0
  130. package/dist/chunk-an6z4rzv.js +158 -0
  131. package/dist/{chunk-r6b58y3x.js → chunk-ase86y73.js} +1 -3
  132. package/dist/{chunk-v0wa5ref.js → chunk-avfjb6pd.js} +13 -555
  133. package/dist/{chunk-5mrhhmas.js → chunk-az5x70pn.js} +8 -5
  134. package/dist/{chunk-49k5ktrj.js → chunk-b6rg3egp.js} +30 -15
  135. package/dist/chunk-b73r6ngr.js +125 -0
  136. package/dist/{chunk-8bedvdm1.js → chunk-b81hd3m6.js} +1 -1
  137. package/dist/{chunk-z7pr85qw.js → chunk-b9mhpc0v.js} +3 -3
  138. package/dist/chunk-b9ndqcdv.js +139 -0
  139. package/dist/{chunk-n5516f5q.js → chunk-bd8zk9tn.js} +4 -4
  140. package/dist/chunk-bdy6n17s.js +343 -0
  141. package/dist/{chunk-r55r29js.js → chunk-bf1j3azq.js} +131 -111
  142. package/dist/{chunk-83z0wrnz.js → chunk-bfcet2mw.js} +2 -2
  143. package/dist/{chunk-jy35mvy3.js → chunk-bmjmrk76.js} +7 -7
  144. package/dist/{chunk-2j0j79p0.js → chunk-bsj8e2mb.js} +8 -8
  145. package/dist/{chunk-snvypj85.js → chunk-bt64sq5y.js} +3 -2
  146. package/dist/{chunk-vyc0rjyx.js → chunk-bwg7582d.js} +1 -1
  147. package/dist/{chunk-3be7ka25.js → chunk-bxcfz5gy.js} +1 -1
  148. package/dist/{chunk-mvss16tj.js → chunk-c1k9tg7h.js} +289 -624
  149. package/dist/{chunk-crr52hf4.js → chunk-c5pxerks.js} +13 -11
  150. package/dist/chunk-c6sjhj89.js +1284 -0
  151. package/dist/{chunk-q6dpqj3z.js → chunk-c9q0phsg.js} +9 -6
  152. package/dist/chunk-caj0ab74.js +129 -0
  153. package/dist/{chunk-f64npa3b.js → chunk-chsyvavm.js} +704 -4
  154. package/dist/{chunk-dqh7e4mt.js → chunk-cjpt035a.js} +51 -41
  155. package/dist/{chunk-z8nbjar4.js → chunk-cmcbatgz.js} +7 -5
  156. package/dist/chunk-cnsj3vq2.js +35 -0
  157. package/dist/chunk-cqjmxeqv.js +269 -0
  158. package/dist/{chunk-bt9krt49.js → chunk-cvb1v08x.js} +38 -32
  159. package/dist/{chunk-j3215c49.js → chunk-cxhvyf7c.js} +227 -370
  160. package/dist/{chunk-24x87knx.js → chunk-cxx0e4nv.js} +1326 -2881
  161. package/dist/chunk-cy2hswr1.js +15 -0
  162. package/dist/{chunk-mwp7sj0q.js → chunk-cy6ezb6j.js} +115140 -121540
  163. package/dist/{chunk-ks0m9njy.js → chunk-d2jekryq.js} +8 -8
  164. package/dist/chunk-d4mdda98.js +94 -0
  165. package/dist/{chunk-33khw5gy.js → chunk-d6ve5pze.js} +7 -7
  166. package/dist/{chunk-26wtxbdc.js → chunk-d7886r6a.js} +6928 -6928
  167. package/dist/{chunk-9t1x831d.js → chunk-d83tmb5h.js} +82 -73
  168. package/dist/{chunk-g5sg6y9q.js → chunk-d8meetqc.js} +78 -71
  169. package/dist/{chunk-ra8fbt9p.js → chunk-d8r0q4ps.js} +537 -871
  170. package/dist/chunk-d95k8xkm.js +84 -0
  171. package/dist/chunk-dd4m7t1v.js +112 -0
  172. package/dist/{chunk-er9vzjac.js → chunk-dekbr08w.js} +16 -14
  173. package/dist/{chunk-cvge4pvp.js → chunk-dk8287aa.js} +1 -1
  174. package/dist/{chunk-9mfbqw9k.js → chunk-dm3n2qgd.js} +4 -4
  175. package/dist/{chunk-n6fbyke9.js → chunk-dmxte86x.js} +3 -3
  176. package/dist/{chunk-t24ytdcw.js → chunk-dqvwn28p.js} +12 -10
  177. package/dist/chunk-drkm8yx2.js +34 -0
  178. package/dist/{chunk-ptwn7qw7.js → chunk-dsbewdgm.js} +38 -10
  179. package/dist/{chunk-w7h2yphx.js → chunk-dwekpr47.js} +2 -2
  180. package/dist/{chunk-ks0dm6t3.js → chunk-e3299veq.js} +16 -70
  181. package/dist/{chunk-4x5ym4h2.js → chunk-e5hcyxae.js} +129 -15
  182. package/dist/chunk-e7h0nd5w.js +106 -0
  183. package/dist/{chunk-s2dmn3yg.js → chunk-eaemyebz.js} +5 -5
  184. package/dist/{chunk-cmdsbsb6.js → chunk-edzkkadh.js} +2 -2
  185. package/dist/chunk-em99fnet.js +128 -0
  186. package/dist/{chunk-hfzj1m07.js → chunk-epyaq1z0.js} +13 -4
  187. package/dist/{chunk-v9y80148.js → chunk-eqmkajs4.js} +96 -189
  188. package/dist/{chunk-cs6y2pc9.js → chunk-ergam9ft.js} +5 -5
  189. package/dist/chunk-es2fdse0.js +63 -0
  190. package/dist/{chunk-cenpqc2t.js → chunk-esn3tgm2.js} +8 -6
  191. package/dist/{chunk-qf2v384j.js → chunk-et8ybmt2.js} +9 -7
  192. package/dist/{chunk-aqa7w38f.js → chunk-ew9rp41b.js} +5 -5
  193. package/dist/{chunk-1yabrspp.js → chunk-ewx6xfzb.js} +2 -2
  194. package/dist/chunk-eyjtbtt0.js +137 -0
  195. package/dist/{chunk-rmbp2das.js → chunk-f0jd2p9n.js} +20 -18
  196. package/dist/{chunk-vzqrbsd1.js → chunk-f69rgsm2.js} +5 -5
  197. package/dist/{chunk-f3bapa1x.js → chunk-f6rbj3gz.js} +12 -7
  198. package/dist/chunk-fbhyqxdg.js +1182 -0
  199. package/dist/chunk-feyzykye.js +10 -0
  200. package/dist/chunk-ffhejx56.js +107 -0
  201. package/dist/{chunk-vbbf707n.js → chunk-fhx6nt2a.js} +38 -28
  202. package/dist/chunk-fkkysfev.js +158 -0
  203. package/dist/chunk-fn510gqw.js +216 -0
  204. package/dist/chunk-ftsg8bjm.js +117 -0
  205. package/dist/{chunk-t3bf8hcf.js → chunk-fyts9grb.js} +2 -2
  206. package/dist/{chunk-kd97kxjn.js → chunk-fz0ch109.js} +3 -2
  207. package/dist/{chunk-ye18m1zb.js → chunk-g1jarkx9.js} +38 -8
  208. package/dist/chunk-g9f19ttm.js +15 -0
  209. package/dist/chunk-g9qte35t.js +341 -0
  210. package/dist/chunk-gaav53dc.js +105 -0
  211. package/dist/chunk-gfx3cwrk.js +75 -0
  212. package/dist/{chunk-z9tgzh90.js → chunk-gk2d1x2a.js} +44 -33
  213. package/dist/chunk-gkbat1p9.js +121 -0
  214. package/dist/{chunk-5b7119h5.js → chunk-gmnyk2t8.js} +8 -6
  215. package/dist/{chunk-qvd0k5dn.js → chunk-gnmdprq3.js} +184 -345
  216. package/dist/{chunk-bq6x1ehp.js → chunk-gpz0ddyz.js} +8 -8
  217. package/dist/{chunk-684kdqez.js → chunk-gv1csnc3.js} +198 -302
  218. package/dist/{chunk-x51mdzqq.js → chunk-gv37c8ax.js} +3 -3
  219. package/dist/{chunk-t6h4wf3k.js → chunk-gzr2601k.js} +9 -9
  220. package/dist/{chunk-45e9mkyr.js → chunk-h3pda469.js} +37 -82
  221. package/dist/{chunk-qqfa0dqg.js → chunk-h4b85amj.js} +20 -32
  222. package/dist/{chunk-j4c8s7tn.js → chunk-h5zv78zq.js} +9 -6
  223. package/dist/{chunk-2wcbcdky.js → chunk-h7edytkc.js} +5 -5
  224. package/dist/{chunk-402jrnj6.js → chunk-ha0wbzc3.js} +8 -8
  225. package/dist/{chunk-nxsh6de2.js → chunk-hcgkak1j.js} +20 -125
  226. package/dist/{chunk-tjaqa99q.js → chunk-hezj20qy.js} +3 -3
  227. package/dist/{chunk-kyer92r4.js → chunk-hf85ht0m.js} +2 -2
  228. package/dist/{chunk-m17y8b22.js → chunk-ht1nfygk.js} +38 -28
  229. package/dist/chunk-j316jjby.js +108 -0
  230. package/dist/chunk-j3fge71v.js +115 -0
  231. package/dist/{chunk-b51jjfh5.js → chunk-j4x0t6k2.js} +42 -31
  232. package/dist/{chunk-9gbamk79.js → chunk-j5bth84e.js} +5 -1
  233. package/dist/chunk-j783d5af.js +134 -0
  234. package/dist/chunk-j7pbwf9x.js +108 -0
  235. package/dist/{chunk-0cpnzx7t.js → chunk-j8rnrm5n.js} +114 -150
  236. package/dist/{chunk-vratq94g.js → chunk-j9gxwbe3.js} +1 -1
  237. package/dist/{chunk-3r24h7t6.js → chunk-jaaxk89e.js} +1 -1
  238. package/dist/{chunk-f4jcw0ea.js → chunk-jaew3662.js} +18 -14
  239. package/dist/{chunk-qpm1tmzz.js → chunk-jbbj16w2.js} +120 -191
  240. package/dist/chunk-jerew25v.js +148 -0
  241. package/dist/{chunk-v399mzxk.js → chunk-jf0p00fz.js} +2 -2
  242. package/dist/{chunk-91r0z5qq.js → chunk-jfsah2w3.js} +1059 -1756
  243. package/dist/{chunk-av73dywf.js → chunk-jna2tcvj.js} +8 -8
  244. package/dist/{chunk-jy35z4n0.js → chunk-jng0mb4r.js} +8 -8
  245. package/dist/chunk-jrrmwfp4.js +66 -0
  246. package/dist/{chunk-3m7ge6tj.js → chunk-jt6fa514.js} +14 -12
  247. package/dist/chunk-jvkyx1b7.js +911 -0
  248. package/dist/{chunk-41xeh3t9.js → chunk-jy6c07wa.js} +4 -4
  249. package/dist/chunk-k1fvb16y.js +269 -0
  250. package/dist/{chunk-bqfnp99q.js → chunk-k3s4yk22.js} +1 -1
  251. package/dist/{chunk-4ycz58wj.js → chunk-k46gxg21.js} +68 -8
  252. package/dist/chunk-k8wwyz2t.js +110 -0
  253. package/dist/{chunk-68qevppc.js → chunk-ka3fdfyb.js} +78 -71
  254. package/dist/{chunk-vaebptnz.js → chunk-ka4x7mhn.js} +38 -28
  255. package/dist/chunk-kb99zpps.js +216 -0
  256. package/dist/{chunk-1dyeexvn.js → chunk-kd3mmsd2.js} +4 -4
  257. package/dist/{chunk-1xkekb9y.js → chunk-kfd89dsd.js} +5 -3
  258. package/dist/{chunk-ecsw41df.js → chunk-km1wcchx.js} +81 -76
  259. package/dist/{chunk-dh6c8y1j.js → chunk-kmhwx18d.js} +3 -3
  260. package/dist/{chunk-224x480q.js → chunk-kq91dwkq.js} +8 -6
  261. package/dist/chunk-m17m84b7.js +111 -0
  262. package/dist/chunk-m1a0s9fd.js +1070 -0
  263. package/dist/{chunk-jafes477.js → chunk-m2bcpk8j.js} +4 -3
  264. package/dist/{chunk-veb0gkcf.js → chunk-m7jtn7dk.js} +74 -68
  265. package/dist/chunk-mq2mgyt9.js +103 -0
  266. package/dist/chunk-msv3w4qp.js +1811 -0
  267. package/dist/{chunk-ch53fgm5.js → chunk-mxe1f4jg.js} +13 -11
  268. package/dist/{chunk-hzttn8j7.js → chunk-mzwjvfr2.js} +124 -126
  269. package/dist/{chunk-2de1vaxf.js → chunk-n2n0sq7r.js} +67 -77
  270. package/dist/{chunk-me2ef6g4.js → chunk-n8mpqdje.js} +1 -1
  271. package/dist/chunk-n9e984ba.js +132 -0
  272. package/dist/chunk-netzwgv1.js +154 -0
  273. package/dist/{chunk-xszk7n10.js → chunk-nh3cd07f.js} +1 -1
  274. package/dist/chunk-njrz6mbe.js +66 -0
  275. package/dist/{chunk-e1ge9n4d.js → chunk-nv7pfr7k.js} +2 -2
  276. package/dist/{chunk-vygf94dw.js → chunk-nwd8pb55.js} +74 -68
  277. package/dist/{chunk-5hva0tsg.js → chunk-p2yv7m0g.js} +6 -6
  278. package/dist/chunk-p5t2vy90.js +259 -0
  279. package/dist/{chunk-zk2wsm7d.js → chunk-p7vkh4wx.js} +2 -2
  280. package/dist/{chunk-da4ve9t5.js → chunk-p8crqj70.js} +10 -10
  281. package/dist/{chunk-n2874aq5.js → chunk-pcngtzr8.js} +12 -6
  282. package/dist/{chunk-6td4c2eq.js → chunk-pdjem6h1.js} +53 -71
  283. package/dist/{chunk-zpc0kwkb.js → chunk-pmxdzjq0.js} +6 -6
  284. package/dist/{chunk-pa7saazk.js → chunk-pnkcecq2.js} +27 -55
  285. package/dist/{chunk-zsfxha74.js → chunk-pshjyzq4.js} +8 -7
  286. package/dist/chunk-pt1yj9zf.js +107 -0
  287. package/dist/{chunk-n9x557ea.js → chunk-py6b9d5b.js} +2312 -4200
  288. package/dist/chunk-q7n8d91g.js +67 -0
  289. package/dist/{chunk-e5pntxye.js → chunk-q7tpyeb3.js} +6 -4
  290. package/dist/{chunk-7ymfj7m3.js → chunk-q82r31er.js} +1 -1
  291. package/dist/chunk-qajrkk97.js +298 -0
  292. package/dist/chunk-qbrh24cn.js +119 -0
  293. package/dist/chunk-qd9ntz7c.js +230 -0
  294. package/dist/chunk-qfr5tcd5.js +2537 -0
  295. package/dist/chunk-qpzfmkct.js +456 -0
  296. package/dist/{chunk-35y0r56v.js → chunk-qtfc6wdh.js} +1 -4
  297. package/dist/chunk-r032587e.js +83 -0
  298. package/dist/{chunk-rryx19hp.js → chunk-r2k2jy0y.js} +2 -2
  299. package/dist/{chunk-pgnnrm2v.js → chunk-r4dnnggx.js} +21 -17
  300. package/dist/{chunk-k9a8jemz.js → chunk-r5n8fvw0.js} +7 -7
  301. package/dist/{chunk-jt0pha6y.js → chunk-r7kh03er.js} +222 -196
  302. package/dist/{chunk-n0k8xrey.js → chunk-rfs0mfg8.js} +140 -158
  303. package/dist/{chunk-dr4qq42x.js → chunk-rgbbtszq.js} +9 -9
  304. package/dist/{chunk-fdwa7gem.js → chunk-rkak3kjw.js} +7 -7
  305. package/dist/chunk-rp568bfw.js +111 -0
  306. package/dist/chunk-rtv718sv.js +146 -0
  307. package/dist/{chunk-rw466wqn.js → chunk-rvkvehat.js} +5284 -3093
  308. package/dist/chunk-s1baskk7.js +14 -0
  309. package/dist/{chunk-2cgdr2n7.js → chunk-s1eb67v3.js} +74 -68
  310. package/dist/{chunk-1szr63w0.js → chunk-s59kx26r.js} +81 -72
  311. package/dist/chunk-s6yk6m3b.js +109 -0
  312. package/dist/{chunk-80qg1pzv.js → chunk-sca71yv8.js} +11 -9
  313. package/dist/chunk-sfrwm87k.js +151 -0
  314. package/dist/chunk-sgaknx21.js +123 -0
  315. package/dist/{chunk-myzwt5yw.js → chunk-snyaz093.js} +9 -15
  316. package/dist/{chunk-rwexx5ns.js → chunk-sq8wkk3z.js} +1 -3
  317. package/dist/{chunk-faycqscv.js → chunk-sxqj7s2h.js} +2 -2
  318. package/dist/chunk-t2m6cjp1.js +264 -0
  319. package/dist/chunk-t6hmvb6k.js +1021 -0
  320. package/dist/chunk-t72x960a.js +125 -0
  321. package/dist/chunk-t9kashay.js +440 -0
  322. package/dist/chunk-t9wzf009.js +151 -0
  323. package/dist/chunk-ta1dgyj1.js +154 -0
  324. package/dist/{chunk-5deqy8r0.js → chunk-tavxhayf.js} +77 -71
  325. package/dist/{chunk-35b0ek0j.js → chunk-tcdv4gp8.js} +13 -9
  326. package/dist/chunk-td3b74vm.js +362 -0
  327. package/dist/{chunk-mt25echc.js → chunk-tezak8rx.js} +1 -1
  328. package/dist/chunk-tgcw0rzx.js +262 -0
  329. package/dist/{chunk-9rcbyag3.js → chunk-tmdbrszg.js} +2 -2
  330. package/dist/{chunk-jknt3rxg.js → chunk-v17qee2y.js} +7 -9
  331. package/dist/{chunk-frbv3xqa.js → chunk-v1jd31dw.js} +2 -2
  332. package/dist/chunk-var1et7e.js +66 -0
  333. package/dist/{chunk-cettj572.js → chunk-ve9wswz4.js} +7 -131
  334. package/dist/{chunk-hqmz36b3.js → chunk-vf612n57.js} +21 -101
  335. package/dist/chunk-vfhabc5j.js +109 -0
  336. package/dist/{chunk-s7qj2hg5.js → chunk-vgy0w6tt.js} +2 -2
  337. package/dist/chunk-vh02fvz1.js +375 -0
  338. package/dist/{chunk-ctmt7xh1.js → chunk-vm935era.js} +619 -887
  339. package/dist/{chunk-dxc7begm.js → chunk-vtb8z6as.js} +14 -10
  340. package/dist/chunk-w2kf9sxn.js +115 -0
  341. package/dist/chunk-w7trx259.js +132 -0
  342. package/dist/{chunk-8z039kef.js → chunk-w92b262y.js} +53 -54
  343. package/dist/chunk-w9zqjhvm.js +103 -0
  344. package/dist/{chunk-9cc60ae5.js → chunk-wb2fvy1k.js} +74 -68
  345. package/dist/chunk-ws2d81aj.js +123 -0
  346. package/dist/{chunk-5zh1fbrj.js → chunk-wssgdcck.js} +2 -2
  347. package/dist/{chunk-t9z6njcr.js → chunk-wtycm8km.js} +9 -9
  348. package/dist/chunk-wz0d8mna.js +108 -0
  349. package/dist/chunk-x01wtn3p.js +144 -0
  350. package/dist/{chunk-dnyeb288.js → chunk-x2sp7rcv.js} +73 -105
  351. package/dist/{chunk-zrse3zpz.js → chunk-xbprynsc.js} +18 -46
  352. package/dist/{chunk-yxnwsp4f.js → chunk-xext3y2y.js} +8 -6
  353. package/dist/{chunk-fzxg8v1y.js → chunk-xycy3c8q.js} +15 -12
  354. package/dist/{chunk-cpma9zs5.js → chunk-y01ys1vm.js} +20 -71
  355. package/dist/{chunk-d7vv2ydf.js → chunk-y78t50v0.js} +2 -2
  356. package/dist/{chunk-xkr7as9h.js → chunk-y9bgt2k1.js} +13 -9
  357. package/dist/{chunk-s2gm9vfk.js → chunk-ydm0nfsv.js} +5 -5
  358. package/dist/{chunk-gjyc3293.js → chunk-yetebjek.js} +282 -495
  359. package/dist/{chunk-hkn7tzgv.js → chunk-ym5r3jnk.js} +1 -1
  360. package/dist/chunk-ysks0ewj.js +237 -0
  361. package/dist/chunk-yv3evkgg.js +68 -0
  362. package/dist/{chunk-athjeyrt.js → chunk-yw79dz62.js} +4 -4
  363. package/dist/{chunk-s84smrx4.js → chunk-yy59gvs4.js} +151 -189
  364. package/dist/{chunk-12pv5fez.js → chunk-yyax4hdg.js} +10 -8
  365. package/dist/chunk-z0q85m5f.js +108 -0
  366. package/dist/chunk-z1bs6d7k.js +24 -0
  367. package/dist/chunk-z6e5jp2w.js +119 -0
  368. package/dist/{chunk-rjz6btwk.js → chunk-z7ssqvt6.js} +4972 -4638
  369. package/dist/chunk-z95yxwyb.js +61 -0
  370. package/dist/{chunk-0nqrscrr.js → chunk-z9aqj026.js} +5 -5
  371. package/dist/chunk-zc6dxhk9.js +169 -0
  372. package/dist/{chunk-ve60fbtd.js → chunk-ze6zvkg6.js} +2 -2
  373. package/dist/{chunk-t0rgmccj.js → chunk-zejm280k.js} +1 -1
  374. package/dist/{chunk-krstc7m7.js → chunk-zfapazzd.js} +15 -11
  375. package/dist/chunk-zj4fqmnc.js +219 -0
  376. package/dist/chunk-zkrpbswn.js +1608 -0
  377. package/dist/chunk-zktbb38m.js +112 -0
  378. package/dist/{chunk-vjc1svpc.js → chunk-zptcqa7t.js} +82 -75
  379. package/dist/{chunk-gbcqdr0x.js → chunk-zvnsjbt8.js} +1 -1
  380. package/dist/chunk-zwaanw8y.js +110 -0
  381. package/dist/{chunk-g3t0act8.js → chunk-zzm33q8x.js} +1 -1
  382. package/dist/{chunk-s8fzxy94.js → chunk-zzzc1ead.js} +17 -13
  383. package/dist/cli.js +34 -10
  384. package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
  385. package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
  386. package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
  387. package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
  388. package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
  389. package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
  390. package/package.json +8 -5
  391. package/scripts/postinstall.cjs +319 -0
  392. package/dist/chunk-0291smg3.js +0 -42
  393. package/dist/chunk-04g2ty3v.js +0 -104
  394. package/dist/chunk-069x95ne.js +0 -764
  395. package/dist/chunk-06x02eab.js +0 -655
  396. package/dist/chunk-09pjmga5.js +0 -713
  397. package/dist/chunk-0g90je6r.js +0 -145
  398. package/dist/chunk-0rddv9vb.js +0 -328
  399. package/dist/chunk-162w6yv3.js +0 -756
  400. package/dist/chunk-1gjbaa3n.js +0 -128
  401. package/dist/chunk-23wg4mnt.js +0 -404
  402. package/dist/chunk-2gbjtg7c.js +0 -102
  403. package/dist/chunk-2v1q0ezq.js +0 -102
  404. package/dist/chunk-37n7jkxe.js +0 -436
  405. package/dist/chunk-38svjnh4.js +0 -158
  406. package/dist/chunk-3bg1089y.js +0 -616
  407. package/dist/chunk-3d8ck5ne.js +0 -112
  408. package/dist/chunk-3g6rf9sz.js +0 -106
  409. package/dist/chunk-3x3rr2n5.js +0 -57
  410. package/dist/chunk-4f6q3d38.js +0 -117
  411. package/dist/chunk-4h57km3m.js +0 -74
  412. package/dist/chunk-4kyh2618.js +0 -99
  413. package/dist/chunk-4w9vc9vc.js +0 -119
  414. package/dist/chunk-53hqpp5z.js +0 -208
  415. package/dist/chunk-5m2rmc2k.js +0 -128
  416. package/dist/chunk-5wp9pkpt.js +0 -539
  417. package/dist/chunk-5ym9f6w3.js +0 -263
  418. package/dist/chunk-6f938733.js +0 -1027
  419. package/dist/chunk-6nenxecd.js +0 -115
  420. package/dist/chunk-6rja0h86.js +0 -1593
  421. package/dist/chunk-70q6dp4d.js +0 -96
  422. package/dist/chunk-7bn0wzs3.js +0 -1493
  423. package/dist/chunk-7e2e0bfm.js +0 -65
  424. package/dist/chunk-7ywadnax.js +0 -490
  425. package/dist/chunk-7z33j54s.js +0 -142
  426. package/dist/chunk-8yvfkzyh.js +0 -58
  427. package/dist/chunk-9abpx1kv.js +0 -2833
  428. package/dist/chunk-9ks2nswb.js +0 -114
  429. package/dist/chunk-9wrds5tr.js +0 -109
  430. package/dist/chunk-ab2twken.js +0 -102
  431. package/dist/chunk-abncjeag.js +0 -97
  432. package/dist/chunk-am6w4x6y.js +0 -103
  433. package/dist/chunk-b73bd7db.js +0 -496
  434. package/dist/chunk-bc7nvynh.js +0 -195
  435. package/dist/chunk-br17dhef.js +0 -103
  436. package/dist/chunk-c3k0sdey.js +0 -281
  437. package/dist/chunk-c909bmyv.js +0 -103
  438. package/dist/chunk-cftsv9w4.js +0 -129
  439. package/dist/chunk-cj1a7npk.js +0 -99
  440. package/dist/chunk-cyscs4k5.js +0 -1330
  441. package/dist/chunk-czr7y063.js +0 -348
  442. package/dist/chunk-d93sndem.js +0 -372
  443. package/dist/chunk-ddz8xbpd.js +0 -481
  444. package/dist/chunk-dkhqx4hk.js +0 -84
  445. package/dist/chunk-dsrharmv.js +0 -359
  446. package/dist/chunk-eqmy5d05.js +0 -56
  447. package/dist/chunk-f2crxw2c.js +0 -5400
  448. package/dist/chunk-f8zga40p.js +0 -234
  449. package/dist/chunk-fbgm2ym6.js +0 -990
  450. package/dist/chunk-fcbbsswe.js +0 -119
  451. package/dist/chunk-fda654nt.js +0 -6121
  452. package/dist/chunk-ffmv9ezj.js +0 -104
  453. package/dist/chunk-fmjte7md.js +0 -38
  454. package/dist/chunk-fqtwqxxc.js +0 -293
  455. package/dist/chunk-g8k85nkd.js +0 -802
  456. package/dist/chunk-ge4ak7dj.js +0 -127
  457. package/dist/chunk-gpqemecy.js +0 -126
  458. package/dist/chunk-h19p6s3b.js +0 -131
  459. package/dist/chunk-j0sk1rct.js +0 -998
  460. package/dist/chunk-j1wfpa1a.js +0 -70
  461. package/dist/chunk-j829fx31.js +0 -3458
  462. package/dist/chunk-jqctzrvd.js +0 -722
  463. package/dist/chunk-jx817w05.js +0 -11
  464. package/dist/chunk-ka6sab33.js +0 -174
  465. package/dist/chunk-krjsvmwp.js +0 -101
  466. package/dist/chunk-kvpe50pm.js +0 -311
  467. package/dist/chunk-mez504fj.js +0 -113
  468. package/dist/chunk-mj6wbrae.js +0 -105
  469. package/dist/chunk-n0pg2kpe.js +0 -122
  470. package/dist/chunk-n4qtqkp0.js +0 -295
  471. package/dist/chunk-n9meha2m.js +0 -73
  472. package/dist/chunk-ndk7q5n3.js +0 -169
  473. package/dist/chunk-ng6n9t4h.js +0 -56
  474. package/dist/chunk-p3pz13x2.js +0 -1933
  475. package/dist/chunk-p9ez6zgq.js +0 -2656
  476. package/dist/chunk-ph750kx1.js +0 -550
  477. package/dist/chunk-pxb99zqs.js +0 -117
  478. package/dist/chunk-q1yqc5n3.js +0 -100
  479. package/dist/chunk-qtfqk0jr.js +0 -131
  480. package/dist/chunk-qzfmdh1t.js +0 -388
  481. package/dist/chunk-r3cv0j9n.js +0 -456
  482. package/dist/chunk-rx0pbgym.js +0 -97
  483. package/dist/chunk-s624rd5j.js +0 -531
  484. package/dist/chunk-satndwqj.js +0 -285
  485. package/dist/chunk-ssrxnkd1.js +0 -109
  486. package/dist/chunk-t2pgctqx.js +0 -106
  487. package/dist/chunk-t7sgwf31.js +0 -644
  488. package/dist/chunk-tth904tj.js +0 -53
  489. package/dist/chunk-typpbjhy.js +0 -128
  490. package/dist/chunk-vp6nrhdq.js +0 -102
  491. package/dist/chunk-vtjm53nt.js +0 -432
  492. package/dist/chunk-w412n7tq.js +0 -469
  493. package/dist/chunk-w4153rky.js +0 -1885
  494. package/dist/chunk-wdgv15as.js +0 -212
  495. package/dist/chunk-wgn9kydv.js +0 -58
  496. package/dist/chunk-whknbrk0.js +0 -184
  497. package/dist/chunk-x1k8e1xc.js +0 -56
  498. package/dist/chunk-x45xx6sc.js +0 -105
  499. package/dist/chunk-x4xvqbe5.js +0 -1166
  500. package/dist/chunk-x8b7vft8.js +0 -132
  501. package/dist/chunk-xaycc8qe.js +0 -44
  502. package/dist/chunk-xd4785ks.js +0 -73
  503. package/dist/chunk-xjxgmxhq.js +0 -463
  504. package/dist/chunk-xx2x3tz9.js +0 -166
  505. package/dist/chunk-y2j23eem.js +0 -101
  506. package/dist/chunk-y83j09wv.js +0 -123
  507. package/dist/chunk-yh8460pb.js +0 -119
  508. package/dist/chunk-z6nhchdb.js +0 -60
  509. package/dist/chunk-zbt73sj7.js +0 -192
  510. package/dist/chunk-zmwaatmq.js +0 -118
  511. package/dist/chunk-zvdg9tex.js +0 -135
  512. package/dist/chunk-zwa780cx.js +0 -584
  513. package/dist/{chunk-whvdag1y.js → chunk-3bfs3x0h.js} +9 -9
  514. package/dist/{chunk-27xc1csx.js → chunk-dggvswz1.js} +3 -3
@@ -1,3458 +0,0 @@
1
- // @bun
2
- import {
3
- OAuthService,
4
- Select,
5
- SelectMulti,
6
- Spinner,
7
- TextInput,
8
- init_CustomSelect,
9
- init_SelectMulti,
10
- init_Spinner,
11
- init_TextInput,
12
- init_oauth
13
- } from "./chunk-mwp7sj0q.js";
14
- import"./chunk-t0rgmccj.js";
15
- import"./chunk-ye18m1zb.js";
16
- import"./chunk-12pv5fez.js";
17
- import"./chunk-cgn27dqf.js";
18
- import"./chunk-dh6c8y1j.js";
19
- import {
20
- Byline,
21
- ConfigurableShortcutHint,
22
- Dialog,
23
- KeyboardShortcutHint,
24
- init_Byline,
25
- init_ConfigurableShortcutHint,
26
- init_Dialog,
27
- init_KeyboardShortcutHint
28
- } from "./chunk-xjxgmxhq.js";
29
- import"./chunk-2gzv8nrw.js";
30
- import"./chunk-ehtwnxpg.js";
31
- import"./chunk-n6fbyke9.js";
32
- import"./chunk-33khw5gy.js";
33
- import"./chunk-3be7ka25.js";
34
- import"./chunk-er9vzjac.js";
35
- import"./chunk-f3bapa1x.js";
36
- import"./chunk-cgfdkzhb.js";
37
- import"./chunk-4ycz58wj.js";
38
- import {
39
- init_useExitOnCtrlCDWithKeybindings,
40
- useExitOnCtrlCDWithKeybindings
41
- } from "./chunk-4kyh2618.js";
42
- import"./chunk-9gbamk79.js";
43
- import"./chunk-d7mx1phm.js";
44
- import"./chunk-hfzj1m07.js";
45
- import {
46
- init_useKeybinding,
47
- init_useTerminalSize,
48
- useKeybinding,
49
- useKeybindings,
50
- useTerminalSize
51
- } from "./chunk-g8k85nkd.js";
52
- import {
53
- Link,
54
- ThemedBox_default,
55
- ThemedText,
56
- color,
57
- init_ink,
58
- init_osc,
59
- require_compiler_runtime,
60
- setClipboard,
61
- useTheme
62
- } from "./chunk-rw466wqn.js";
63
- import"./chunk-yhd82045.js";
64
- import"./chunk-ps49ymvj.js";
65
- import {
66
- require_jsx_dev_runtime,
67
- require_react
68
- } from "./chunk-g338npwr.js";
69
- import"./chunk-zk2wsm7d.js";
70
- import"./chunk-z8nbjar4.js";
71
- import"./chunk-660kcy7p.js";
72
- import"./chunk-rj86xm6z.js";
73
- import"./chunk-d7vv2ydf.js";
74
- import"./chunk-4jm600zv.js";
75
- import {
76
- init_browser,
77
- openBrowser
78
- } from "./chunk-me2ef6g4.js";
79
- import"./chunk-t24ytdcw.js";
80
- import"./chunk-cenpqc2t.js";
81
- import"./chunk-mx28h61f.js";
82
- import"./chunk-ptwn7qw7.js";
83
- import"./chunk-b4mnbry0.js";
84
- import"./chunk-faycqscv.js";
85
- import"./chunk-fbgm2ym6.js";
86
- import"./chunk-f64npa3b.js";
87
- import"./chunk-8z039kef.js";
88
- import {
89
- getAnthropicApiKey,
90
- init_auth,
91
- init_config1 as init_config,
92
- init_stringUtils,
93
- isAnthropicAuthEnabled,
94
- plural,
95
- saveGlobalConfig,
96
- saveOAuthTokensIfNeeded
97
- } from "./chunk-mvss16tj.js";
98
- import"./chunk-bmvb57qb.js";
99
- import"./chunk-fdwa7gem.js";
100
- import"./chunk-vratq94g.js";
101
- import"./chunk-5hva0tsg.js";
102
- import"./chunk-0e1xsncc.js";
103
- import"./chunk-64c1avct.js";
104
- import"./chunk-8g5pe1gr.js";
105
- import"./chunk-tjaqa99q.js";
106
- import"./chunk-v4t6dyyh.js";
107
- import"./chunk-4pbx3g7s.js";
108
- import"./chunk-26wtxbdc.js";
109
- import"./chunk-f5ma3nh5.js";
110
- import"./chunk-qz2x630m.js";
111
- import"./chunk-cvge4pvp.js";
112
- import"./chunk-rryx19hp.js";
113
- import"./chunk-3c25bcsw.js";
114
- import"./chunk-9g827w4j.js";
115
- import"./chunk-7ymfj7m3.js";
116
- import"./chunk-p2816w9z.js";
117
- import"./chunk-v9smspw2.js";
118
- import"./chunk-v1kzp02e.js";
119
- import"./chunk-0vkfrmqm.js";
120
- import"./chunk-0xjaqda8.js";
121
- import"./chunk-jqctzrvd.js";
122
- import"./chunk-crmjpsqe.js";
123
- import {
124
- init_analytics,
125
- logEvent
126
- } from "./chunk-h0rbjg6x.js";
127
- import"./chunk-wc6wwwyb.js";
128
- import {
129
- getGithubRepo,
130
- init_git
131
- } from "./chunk-dr4qq42x.js";
132
- import"./chunk-d18z9pna.js";
133
- import"./chunk-qnfx3qtx.js";
134
- import {
135
- execFileNoThrow,
136
- init_execFileNoThrow
137
- } from "./chunk-athjeyrt.js";
138
- import"./chunk-8bedvdm1.js";
139
- import {
140
- init_log,
141
- logError
142
- } from "./chunk-p7g7pf3f.js";
143
- import"./chunk-8tnsngw2.js";
144
- import"./chunk-cmdsbsb6.js";
145
- import"./chunk-vyc0rjyx.js";
146
- import {
147
- execa,
148
- figures_default,
149
- init_execa,
150
- init_figures
151
- } from "./chunk-ggqx30m9.js";
152
- import"./chunk-7wm5s02e.js";
153
- import"./chunk-nxsh6de2.js";
154
- import"./chunk-fbv4apne.js";
155
- import"./chunk-3r24h7t6.js";
156
- import"./chunk-qqfa0dqg.js";
157
- import"./chunk-hqmz36b3.js";
158
- import"./chunk-4g3v8y12.js";
159
- import"./chunk-7739pg2c.js";
160
- import"./chunk-xszk7n10.js";
161
- import"./chunk-sdj9b9wh.js";
162
- import {
163
- __esm,
164
- __toESM
165
- } from "./chunk-qp2qdcda.js";
166
-
167
- // src/components/WorkflowMultiselectDialog.tsx
168
- function renderInputGuide(exitState) {
169
- if (exitState.pending) {
170
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
171
- children: [
172
- "Press ",
173
- exitState.keyName,
174
- " again to exit"
175
- ]
176
- }, undefined, true, undefined, this);
177
- }
178
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Byline, {
179
- children: [
180
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
181
- shortcut: "\u2191\u2193",
182
- action: "navigate"
183
- }, undefined, false, undefined, this),
184
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
185
- shortcut: "Space",
186
- action: "toggle"
187
- }, undefined, false, undefined, this),
188
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
189
- shortcut: "Enter",
190
- action: "confirm"
191
- }, undefined, false, undefined, this),
192
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
193
- action: "confirm:no",
194
- context: "Confirmation",
195
- fallback: "Esc",
196
- description: "cancel"
197
- }, undefined, false, undefined, this)
198
- ]
199
- }, undefined, true, undefined, this);
200
- }
201
- function WorkflowMultiselectDialog(t0) {
202
- const $ = import_compiler_runtime.c(14);
203
- const {
204
- onSubmit,
205
- defaultSelections
206
- } = t0;
207
- const [showError, setShowError] = import_react.useState(false);
208
- let t1;
209
- if ($[0] !== onSubmit) {
210
- t1 = (selectedValues) => {
211
- if (selectedValues.length === 0) {
212
- setShowError(true);
213
- return;
214
- }
215
- setShowError(false);
216
- onSubmit(selectedValues);
217
- };
218
- $[0] = onSubmit;
219
- $[1] = t1;
220
- } else {
221
- t1 = $[1];
222
- }
223
- const handleSubmit = t1;
224
- let t2;
225
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
226
- t2 = () => {
227
- setShowError(false);
228
- };
229
- $[2] = t2;
230
- } else {
231
- t2 = $[2];
232
- }
233
- const handleChange = t2;
234
- let t3;
235
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
236
- t3 = () => {
237
- setShowError(true);
238
- };
239
- $[3] = t3;
240
- } else {
241
- t3 = $[3];
242
- }
243
- const handleCancel = t3;
244
- let t4;
245
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
246
- t4 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
247
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
248
- dimColor: true,
249
- children: [
250
- "More workflow examples (issue triage, CI fixes, etc.) at:",
251
- " ",
252
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Link, {
253
- url: "https://github.com/anthropics/claude-code-action/blob/main/examples/",
254
- children: "https://github.com/anthropics/claude-code-action/blob/main/examples/"
255
- }, undefined, false, undefined, this)
256
- ]
257
- }, undefined, true, undefined, this)
258
- }, undefined, false, undefined, this);
259
- $[4] = t4;
260
- } else {
261
- t4 = $[4];
262
- }
263
- let t5;
264
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
265
- t5 = WORKFLOWS.map(_temp);
266
- $[5] = t5;
267
- } else {
268
- t5 = $[5];
269
- }
270
- let t6;
271
- if ($[6] !== defaultSelections || $[7] !== handleSubmit) {
272
- t6 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(SelectMulti, {
273
- options: t5,
274
- defaultValue: defaultSelections,
275
- onSubmit: handleSubmit,
276
- onChange: handleChange,
277
- onCancel: handleCancel,
278
- hideIndexes: true
279
- }, undefined, false, undefined, this);
280
- $[6] = defaultSelections;
281
- $[7] = handleSubmit;
282
- $[8] = t6;
283
- } else {
284
- t6 = $[8];
285
- }
286
- let t7;
287
- if ($[9] !== showError) {
288
- t7 = showError && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
289
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
290
- color: "error",
291
- children: "You must select at least one workflow to continue"
292
- }, undefined, false, undefined, this)
293
- }, undefined, false, undefined, this);
294
- $[9] = showError;
295
- $[10] = t7;
296
- } else {
297
- t7 = $[10];
298
- }
299
- let t8;
300
- if ($[11] !== t6 || $[12] !== t7) {
301
- t8 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Dialog, {
302
- title: "Select GitHub workflows to install",
303
- subtitle: "We'll create a workflow file in your repository for each one you select.",
304
- onCancel: handleCancel,
305
- inputGuide: renderInputGuide,
306
- children: [
307
- t4,
308
- t6,
309
- t7
310
- ]
311
- }, undefined, true, undefined, this);
312
- $[11] = t6;
313
- $[12] = t7;
314
- $[13] = t8;
315
- } else {
316
- t8 = $[13];
317
- }
318
- return t8;
319
- }
320
- function _temp(workflow) {
321
- return {
322
- label: workflow.label,
323
- value: workflow.value
324
- };
325
- }
326
- var import_compiler_runtime, import_react, jsx_dev_runtime, WORKFLOWS;
327
- var init_WorkflowMultiselectDialog = __esm(() => {
328
- init_ink();
329
- init_ConfigurableShortcutHint();
330
- init_SelectMulti();
331
- init_Byline();
332
- init_Dialog();
333
- init_KeyboardShortcutHint();
334
- import_compiler_runtime = __toESM(require_compiler_runtime(), 1);
335
- import_react = __toESM(require_react(), 1);
336
- jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
337
- WORKFLOWS = [{
338
- value: "claude",
339
- label: "@Claude Code - Tag @claude in issues and PR comments"
340
- }, {
341
- value: "claude-review",
342
- label: "Claude Code Review - Automated code review on new PRs"
343
- }];
344
- });
345
-
346
- // src/constants/github-app.ts
347
- 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
348
-
349
- on:
350
- issue_comment:
351
- types: [created]
352
- pull_request_review_comment:
353
- types: [created]
354
- issues:
355
- types: [opened, assigned]
356
- pull_request_review:
357
- types: [submitted]
358
-
359
- jobs:
360
- claude:
361
- if: |
362
- (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
363
- (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
364
- (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
365
- (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
366
- runs-on: ubuntu-latest
367
- permissions:
368
- contents: read
369
- pull-requests: read
370
- issues: read
371
- id-token: write
372
- actions: read # Required for Claude to read CI results on PRs
373
- steps:
374
- - name: Checkout repository
375
- uses: actions/checkout@v4
376
- with:
377
- fetch-depth: 1
378
-
379
- - name: Run Claude Code
380
- id: claude
381
- uses: anthropics/claude-code-action@v1
382
- with:
383
- anthropic_api_key: \${{ secrets.ANTHROPIC_API_KEY }}
384
-
385
- # This is an optional setting that allows Claude to read CI results on PRs
386
- additional_permissions: |
387
- actions: read
388
-
389
- # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
390
- # prompt: 'Update the pull request description to include a summary of changes.'
391
-
392
- # Optional: Add claude_args to customize behavior and configuration
393
- # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
394
- # or https://code.claude.com/docs/en/cli-reference for available options
395
- # claude_args: '--allowed-tools Bash(gh pr:*)'
396
-
397
- `, PR_BODY = `## \uD83E\uDD16 Installing Claude Code GitHub App
398
-
399
- This PR adds a GitHub Actions workflow that enables Claude Code integration in our repository.
400
-
401
- ### What is Claude Code?
402
-
403
- [Claude Code](https://claude.com/claude-code) is an AI coding agent that can help with:
404
- - Bug fixes and improvements
405
- - Documentation updates
406
- - Implementing new features
407
- - Code reviews and suggestions
408
- - Writing tests
409
- - And more!
410
-
411
- ### How it works
412
-
413
- Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment.
414
- Once the workflow is triggered, Claude will analyze the comment and surrounding context, and execute on the request in a GitHub action.
415
-
416
- ### Important Notes
417
-
418
- - **This workflow won't take effect until this PR is merged**
419
- - **@claude mentions won't work until after the merge is complete**
420
- - The workflow runs automatically whenever Claude is mentioned in PR or issue comments
421
- - Claude gets access to the entire PR or issue context including files, diffs, and previous comments
422
-
423
- ### Security
424
-
425
- - Our Anthropic API key is securely stored as a GitHub Actions secret
426
- - Only users with write access to the repository can trigger the workflow
427
- - All Claude runs are stored in the GitHub Actions run history
428
- - Claude's default tools are limited to reading/writing files and interacting with our repo by creating comments, branches, and commits.
429
- - We can add more allowed tools by adding them to the workflow file like:
430
-
431
- \`\`\`
432
- allowed_tools: Bash(npm install),Bash(npm run build),Bash(npm run lint),Bash(npm run test)
433
- \`\`\`
434
-
435
- There's more information in the [Claude Code action repo](https://github.com/anthropics/claude-code-action).
436
-
437
- 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
438
-
439
- on:
440
- pull_request:
441
- types: [opened, synchronize, ready_for_review, reopened]
442
- # Optional: Only run on specific file changes
443
- # paths:
444
- # - "src/**/*.ts"
445
- # - "src/**/*.tsx"
446
- # - "src/**/*.js"
447
- # - "src/**/*.jsx"
448
-
449
- jobs:
450
- claude-review:
451
- # Optional: Filter by PR author
452
- # if: |
453
- # github.event.pull_request.user.login == 'external-contributor' ||
454
- # github.event.pull_request.user.login == 'new-developer' ||
455
- # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
456
-
457
- runs-on: ubuntu-latest
458
- permissions:
459
- contents: read
460
- pull-requests: read
461
- issues: read
462
- id-token: write
463
-
464
- steps:
465
- - name: Checkout repository
466
- uses: actions/checkout@v4
467
- with:
468
- fetch-depth: 1
469
-
470
- - name: Run Claude Code Review
471
- id: claude-review
472
- uses: anthropics/claude-code-action@v1
473
- with:
474
- anthropic_api_key: \${{ secrets.ANTHROPIC_API_KEY }}
475
- plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
476
- plugins: 'code-review@claude-code-plugins'
477
- prompt: '/code-review:code-review \${{ github.repository }}/pull/\${{ github.event.pull_request.number }}'
478
- # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
479
- # or https://code.claude.com/docs/en/cli-reference for available options
480
-
481
- `;
482
- var init_github_app = () => {};
483
-
484
- // src/commands/install-github-app/ApiKeyStep.tsx
485
- function ApiKeyStep(t0) {
486
- const $ = import_compiler_runtime2.c(55);
487
- const {
488
- existingApiKey,
489
- apiKeyOrOAuthToken,
490
- onApiKeyChange,
491
- onSubmit,
492
- onToggleUseExistingKey,
493
- onCreateOAuthToken,
494
- selectedOption: t1,
495
- onSelectOption
496
- } = t0;
497
- const selectedOption = t1 === undefined ? existingApiKey ? "existing" : onCreateOAuthToken ? "oauth" : "new" : t1;
498
- const [cursorOffset, setCursorOffset] = import_react2.useState(0);
499
- const terminalSize = useTerminalSize();
500
- const [theme] = useTheme();
501
- let t2;
502
- if ($[0] !== existingApiKey || $[1] !== onCreateOAuthToken || $[2] !== onSelectOption || $[3] !== onToggleUseExistingKey || $[4] !== selectedOption) {
503
- t2 = () => {
504
- if (selectedOption === "new" && onCreateOAuthToken) {
505
- onSelectOption?.("oauth");
506
- } else {
507
- if (selectedOption === "oauth" && existingApiKey) {
508
- onSelectOption?.("existing");
509
- onToggleUseExistingKey(true);
510
- }
511
- }
512
- };
513
- $[0] = existingApiKey;
514
- $[1] = onCreateOAuthToken;
515
- $[2] = onSelectOption;
516
- $[3] = onToggleUseExistingKey;
517
- $[4] = selectedOption;
518
- $[5] = t2;
519
- } else {
520
- t2 = $[5];
521
- }
522
- const handlePrevious = t2;
523
- let t3;
524
- if ($[6] !== onCreateOAuthToken || $[7] !== onSelectOption || $[8] !== onToggleUseExistingKey || $[9] !== selectedOption) {
525
- t3 = () => {
526
- if (selectedOption === "existing") {
527
- onSelectOption?.(onCreateOAuthToken ? "oauth" : "new");
528
- onToggleUseExistingKey(false);
529
- } else {
530
- if (selectedOption === "oauth") {
531
- onSelectOption?.("new");
532
- }
533
- }
534
- };
535
- $[6] = onCreateOAuthToken;
536
- $[7] = onSelectOption;
537
- $[8] = onToggleUseExistingKey;
538
- $[9] = selectedOption;
539
- $[10] = t3;
540
- } else {
541
- t3 = $[10];
542
- }
543
- const handleNext = t3;
544
- let t4;
545
- if ($[11] !== onCreateOAuthToken || $[12] !== onSubmit || $[13] !== selectedOption) {
546
- t4 = () => {
547
- if (selectedOption === "oauth" && onCreateOAuthToken) {
548
- onCreateOAuthToken();
549
- } else {
550
- onSubmit();
551
- }
552
- };
553
- $[11] = onCreateOAuthToken;
554
- $[12] = onSubmit;
555
- $[13] = selectedOption;
556
- $[14] = t4;
557
- } else {
558
- t4 = $[14];
559
- }
560
- const handleConfirm = t4;
561
- const isTextInputVisible = selectedOption === "new";
562
- let t5;
563
- if ($[15] !== handleConfirm || $[16] !== handleNext || $[17] !== handlePrevious) {
564
- t5 = {
565
- "confirm:previous": handlePrevious,
566
- "confirm:next": handleNext,
567
- "confirm:yes": handleConfirm
568
- };
569
- $[15] = handleConfirm;
570
- $[16] = handleNext;
571
- $[17] = handlePrevious;
572
- $[18] = t5;
573
- } else {
574
- t5 = $[18];
575
- }
576
- const t6 = !isTextInputVisible;
577
- let t7;
578
- if ($[19] !== t6) {
579
- t7 = {
580
- context: "Confirmation",
581
- isActive: t6
582
- };
583
- $[19] = t6;
584
- $[20] = t7;
585
- } else {
586
- t7 = $[20];
587
- }
588
- useKeybindings(t5, t7);
589
- let t8;
590
- if ($[21] !== handleNext || $[22] !== handlePrevious) {
591
- t8 = {
592
- "confirm:previous": handlePrevious,
593
- "confirm:next": handleNext
594
- };
595
- $[21] = handleNext;
596
- $[22] = handlePrevious;
597
- $[23] = t8;
598
- } else {
599
- t8 = $[23];
600
- }
601
- let t9;
602
- if ($[24] !== isTextInputVisible) {
603
- t9 = {
604
- context: "Confirmation",
605
- isActive: isTextInputVisible
606
- };
607
- $[24] = isTextInputVisible;
608
- $[25] = t9;
609
- } else {
610
- t9 = $[25];
611
- }
612
- useKeybindings(t8, t9);
613
- let t10;
614
- if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
615
- t10 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
616
- flexDirection: "column",
617
- marginBottom: 1,
618
- children: [
619
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
620
- bold: true,
621
- children: "Install GitHub App"
622
- }, undefined, false, undefined, this),
623
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
624
- dimColor: true,
625
- children: "Choose API key"
626
- }, undefined, false, undefined, this)
627
- ]
628
- }, undefined, true, undefined, this);
629
- $[26] = t10;
630
- } else {
631
- t10 = $[26];
632
- }
633
- let t11;
634
- if ($[27] !== existingApiKey || $[28] !== selectedOption || $[29] !== theme) {
635
- t11 = existingApiKey && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
636
- marginBottom: 1,
637
- children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
638
- children: [
639
- selectedOption === "existing" ? color("success", theme)("> ") : " ",
640
- "Use your existing Claude Code API key"
641
- ]
642
- }, undefined, true, undefined, this)
643
- }, undefined, false, undefined, this);
644
- $[27] = existingApiKey;
645
- $[28] = selectedOption;
646
- $[29] = theme;
647
- $[30] = t11;
648
- } else {
649
- t11 = $[30];
650
- }
651
- let t12;
652
- if ($[31] !== onCreateOAuthToken || $[32] !== selectedOption || $[33] !== theme) {
653
- t12 = onCreateOAuthToken && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
654
- marginBottom: 1,
655
- children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
656
- children: [
657
- selectedOption === "oauth" ? color("success", theme)("> ") : " ",
658
- "Create a long-lived token with your Claude subscription"
659
- ]
660
- }, undefined, true, undefined, this)
661
- }, undefined, false, undefined, this);
662
- $[31] = onCreateOAuthToken;
663
- $[32] = selectedOption;
664
- $[33] = theme;
665
- $[34] = t12;
666
- } else {
667
- t12 = $[34];
668
- }
669
- let t13;
670
- if ($[35] !== selectedOption || $[36] !== theme) {
671
- t13 = selectedOption === "new" ? color("success", theme)("> ") : " ";
672
- $[35] = selectedOption;
673
- $[36] = theme;
674
- $[37] = t13;
675
- } else {
676
- t13 = $[37];
677
- }
678
- let t14;
679
- if ($[38] !== t13) {
680
- t14 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
681
- marginBottom: 1,
682
- children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
683
- children: [
684
- t13,
685
- "Enter a new API key"
686
- ]
687
- }, undefined, true, undefined, this)
688
- }, undefined, false, undefined, this);
689
- $[38] = t13;
690
- $[39] = t14;
691
- } else {
692
- t14 = $[39];
693
- }
694
- let t15;
695
- if ($[40] !== apiKeyOrOAuthToken || $[41] !== cursorOffset || $[42] !== onApiKeyChange || $[43] !== onSubmit || $[44] !== selectedOption || $[45] !== terminalSize) {
696
- t15 = selectedOption === "new" && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(TextInput, {
697
- value: apiKeyOrOAuthToken,
698
- onChange: onApiKeyChange,
699
- onSubmit,
700
- onPaste: onApiKeyChange,
701
- focus: true,
702
- placeholder: "sk-ant\u2026 (Create a new key at https://platform.claude.com/settings/keys)",
703
- mask: "*",
704
- columns: terminalSize.columns,
705
- cursorOffset,
706
- onChangeCursorOffset: setCursorOffset,
707
- showCursor: true
708
- }, undefined, false, undefined, this);
709
- $[40] = apiKeyOrOAuthToken;
710
- $[41] = cursorOffset;
711
- $[42] = onApiKeyChange;
712
- $[43] = onSubmit;
713
- $[44] = selectedOption;
714
- $[45] = terminalSize;
715
- $[46] = t15;
716
- } else {
717
- t15 = $[46];
718
- }
719
- let t16;
720
- if ($[47] !== t11 || $[48] !== t12 || $[49] !== t14 || $[50] !== t15) {
721
- t16 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
722
- flexDirection: "column",
723
- borderStyle: "round",
724
- paddingX: 1,
725
- children: [
726
- t10,
727
- t11,
728
- t12,
729
- t14,
730
- t15
731
- ]
732
- }, undefined, true, undefined, this);
733
- $[47] = t11;
734
- $[48] = t12;
735
- $[49] = t14;
736
- $[50] = t15;
737
- $[51] = t16;
738
- } else {
739
- t16 = $[51];
740
- }
741
- let t17;
742
- if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
743
- t17 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
744
- marginLeft: 3,
745
- children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
746
- dimColor: true,
747
- children: "\u2191/\u2193 to select \xB7 Enter to continue"
748
- }, undefined, false, undefined, this)
749
- }, undefined, false, undefined, this);
750
- $[52] = t17;
751
- } else {
752
- t17 = $[52];
753
- }
754
- let t18;
755
- if ($[53] !== t16) {
756
- t18 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
757
- children: [
758
- t16,
759
- t17
760
- ]
761
- }, undefined, true, undefined, this);
762
- $[53] = t16;
763
- $[54] = t18;
764
- } else {
765
- t18 = $[54];
766
- }
767
- return t18;
768
- }
769
- var import_compiler_runtime2, import_react2, jsx_dev_runtime2;
770
- var init_ApiKeyStep = __esm(() => {
771
- init_TextInput();
772
- init_useTerminalSize();
773
- init_ink();
774
- init_useKeybinding();
775
- import_compiler_runtime2 = __toESM(require_compiler_runtime(), 1);
776
- import_react2 = __toESM(require_react(), 1);
777
- jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
778
- });
779
-
780
- // src/commands/install-github-app/CheckExistingSecretStep.tsx
781
- function CheckExistingSecretStep(t0) {
782
- const $ = import_compiler_runtime3.c(42);
783
- const {
784
- useExistingSecret,
785
- secretName,
786
- onToggleUseExistingSecret,
787
- onSecretNameChange,
788
- onSubmit
789
- } = t0;
790
- const [cursorOffset, setCursorOffset] = import_react3.useState(0);
791
- const terminalSize = useTerminalSize();
792
- const [theme] = useTheme();
793
- let t1;
794
- if ($[0] !== onToggleUseExistingSecret) {
795
- t1 = () => onToggleUseExistingSecret(true);
796
- $[0] = onToggleUseExistingSecret;
797
- $[1] = t1;
798
- } else {
799
- t1 = $[1];
800
- }
801
- const handlePrevious = t1;
802
- let t2;
803
- if ($[2] !== onToggleUseExistingSecret) {
804
- t2 = () => onToggleUseExistingSecret(false);
805
- $[2] = onToggleUseExistingSecret;
806
- $[3] = t2;
807
- } else {
808
- t2 = $[3];
809
- }
810
- const handleNext = t2;
811
- let t3;
812
- if ($[4] !== handleNext || $[5] !== handlePrevious || $[6] !== onSubmit) {
813
- t3 = {
814
- "confirm:previous": handlePrevious,
815
- "confirm:next": handleNext,
816
- "confirm:yes": onSubmit
817
- };
818
- $[4] = handleNext;
819
- $[5] = handlePrevious;
820
- $[6] = onSubmit;
821
- $[7] = t3;
822
- } else {
823
- t3 = $[7];
824
- }
825
- let t4;
826
- if ($[8] !== useExistingSecret) {
827
- t4 = {
828
- context: "Confirmation",
829
- isActive: useExistingSecret
830
- };
831
- $[8] = useExistingSecret;
832
- $[9] = t4;
833
- } else {
834
- t4 = $[9];
835
- }
836
- useKeybindings(t3, t4);
837
- let t5;
838
- if ($[10] !== handleNext || $[11] !== handlePrevious) {
839
- t5 = {
840
- "confirm:previous": handlePrevious,
841
- "confirm:next": handleNext
842
- };
843
- $[10] = handleNext;
844
- $[11] = handlePrevious;
845
- $[12] = t5;
846
- } else {
847
- t5 = $[12];
848
- }
849
- const t6 = !useExistingSecret;
850
- let t7;
851
- if ($[13] !== t6) {
852
- t7 = {
853
- context: "Confirmation",
854
- isActive: t6
855
- };
856
- $[13] = t6;
857
- $[14] = t7;
858
- } else {
859
- t7 = $[14];
860
- }
861
- useKeybindings(t5, t7);
862
- let t8;
863
- if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
864
- t8 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
865
- flexDirection: "column",
866
- marginBottom: 1,
867
- children: [
868
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
869
- bold: true,
870
- children: "Install GitHub App"
871
- }, undefined, false, undefined, this),
872
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
873
- dimColor: true,
874
- children: "Setup API key secret"
875
- }, undefined, false, undefined, this)
876
- ]
877
- }, undefined, true, undefined, this);
878
- $[15] = t8;
879
- } else {
880
- t8 = $[15];
881
- }
882
- let t9;
883
- if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
884
- t9 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
885
- marginBottom: 1,
886
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
887
- color: "warning",
888
- children: "ANTHROPIC_API_KEY already exists in repository secrets!"
889
- }, undefined, false, undefined, this)
890
- }, undefined, false, undefined, this);
891
- $[16] = t9;
892
- } else {
893
- t9 = $[16];
894
- }
895
- let t10;
896
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
897
- t10 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
898
- marginBottom: 1,
899
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
900
- children: "Would you like to:"
901
- }, undefined, false, undefined, this)
902
- }, undefined, false, undefined, this);
903
- $[17] = t10;
904
- } else {
905
- t10 = $[17];
906
- }
907
- let t11;
908
- if ($[18] !== theme || $[19] !== useExistingSecret) {
909
- t11 = useExistingSecret ? color("success", theme)("> ") : " ";
910
- $[18] = theme;
911
- $[19] = useExistingSecret;
912
- $[20] = t11;
913
- } else {
914
- t11 = $[20];
915
- }
916
- let t12;
917
- if ($[21] !== t11) {
918
- t12 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
919
- marginBottom: 1,
920
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
921
- children: [
922
- t11,
923
- "Use the existing API key"
924
- ]
925
- }, undefined, true, undefined, this)
926
- }, undefined, false, undefined, this);
927
- $[21] = t11;
928
- $[22] = t12;
929
- } else {
930
- t12 = $[22];
931
- }
932
- let t13;
933
- if ($[23] !== theme || $[24] !== useExistingSecret) {
934
- t13 = !useExistingSecret ? color("success", theme)("> ") : " ";
935
- $[23] = theme;
936
- $[24] = useExistingSecret;
937
- $[25] = t13;
938
- } else {
939
- t13 = $[25];
940
- }
941
- let t14;
942
- if ($[26] !== t13) {
943
- t14 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
944
- marginBottom: 1,
945
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
946
- children: [
947
- t13,
948
- "Create a new secret with a different name"
949
- ]
950
- }, undefined, true, undefined, this)
951
- }, undefined, false, undefined, this);
952
- $[26] = t13;
953
- $[27] = t14;
954
- } else {
955
- t14 = $[27];
956
- }
957
- let t15;
958
- if ($[28] !== cursorOffset || $[29] !== onSecretNameChange || $[30] !== onSubmit || $[31] !== secretName || $[32] !== terminalSize || $[33] !== useExistingSecret) {
959
- t15 = !useExistingSecret && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
960
- children: [
961
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
962
- marginBottom: 1,
963
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
964
- children: "Enter new secret name (alphanumeric with underscores):"
965
- }, undefined, false, undefined, this)
966
- }, undefined, false, undefined, this),
967
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(TextInput, {
968
- value: secretName,
969
- onChange: onSecretNameChange,
970
- onSubmit,
971
- focus: true,
972
- placeholder: "e.g., CLAUDE_API_KEY",
973
- columns: terminalSize.columns,
974
- cursorOffset,
975
- onChangeCursorOffset: setCursorOffset,
976
- showCursor: true
977
- }, undefined, false, undefined, this)
978
- ]
979
- }, undefined, true, undefined, this);
980
- $[28] = cursorOffset;
981
- $[29] = onSecretNameChange;
982
- $[30] = onSubmit;
983
- $[31] = secretName;
984
- $[32] = terminalSize;
985
- $[33] = useExistingSecret;
986
- $[34] = t15;
987
- } else {
988
- t15 = $[34];
989
- }
990
- let t16;
991
- if ($[35] !== t12 || $[36] !== t14 || $[37] !== t15) {
992
- t16 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
993
- flexDirection: "column",
994
- borderStyle: "round",
995
- paddingX: 1,
996
- children: [
997
- t8,
998
- t9,
999
- t10,
1000
- t12,
1001
- t14,
1002
- t15
1003
- ]
1004
- }, undefined, true, undefined, this);
1005
- $[35] = t12;
1006
- $[36] = t14;
1007
- $[37] = t15;
1008
- $[38] = t16;
1009
- } else {
1010
- t16 = $[38];
1011
- }
1012
- let t17;
1013
- if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
1014
- t17 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
1015
- marginLeft: 3,
1016
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1017
- dimColor: true,
1018
- children: "\u2191/\u2193 to select \xB7 Enter to continue"
1019
- }, undefined, false, undefined, this)
1020
- }, undefined, false, undefined, this);
1021
- $[39] = t17;
1022
- } else {
1023
- t17 = $[39];
1024
- }
1025
- let t18;
1026
- if ($[40] !== t16) {
1027
- t18 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
1028
- children: [
1029
- t16,
1030
- t17
1031
- ]
1032
- }, undefined, true, undefined, this);
1033
- $[40] = t16;
1034
- $[41] = t18;
1035
- } else {
1036
- t18 = $[41];
1037
- }
1038
- return t18;
1039
- }
1040
- var import_compiler_runtime3, import_react3, jsx_dev_runtime3;
1041
- var init_CheckExistingSecretStep = __esm(() => {
1042
- init_TextInput();
1043
- init_useTerminalSize();
1044
- init_ink();
1045
- init_useKeybinding();
1046
- import_compiler_runtime3 = __toESM(require_compiler_runtime(), 1);
1047
- import_react3 = __toESM(require_react(), 1);
1048
- jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
1049
- });
1050
-
1051
- // src/commands/install-github-app/CheckGitHubStep.tsx
1052
- function CheckGitHubStep() {
1053
- const $ = import_compiler_runtime4.c(1);
1054
- let t0;
1055
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1056
- t0 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1057
- children: "Checking GitHub CLI installation\u2026"
1058
- }, undefined, false, undefined, this);
1059
- $[0] = t0;
1060
- } else {
1061
- t0 = $[0];
1062
- }
1063
- return t0;
1064
- }
1065
- var import_compiler_runtime4, jsx_dev_runtime4;
1066
- var init_CheckGitHubStep = __esm(() => {
1067
- init_ink();
1068
- import_compiler_runtime4 = __toESM(require_compiler_runtime(), 1);
1069
- jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
1070
- });
1071
-
1072
- // src/commands/install-github-app/ChooseRepoStep.tsx
1073
- function ChooseRepoStep(t0) {
1074
- const $ = import_compiler_runtime5.c(49);
1075
- const {
1076
- currentRepo,
1077
- useCurrentRepo,
1078
- repoUrl,
1079
- onRepoUrlChange,
1080
- onSubmit,
1081
- onToggleUseCurrentRepo
1082
- } = t0;
1083
- const [cursorOffset, setCursorOffset] = import_react4.useState(0);
1084
- const [showEmptyError, setShowEmptyError] = import_react4.useState(false);
1085
- const terminalSize = useTerminalSize();
1086
- const textInputColumns = terminalSize.columns;
1087
- let t1;
1088
- if ($[0] !== currentRepo || $[1] !== onSubmit || $[2] !== repoUrl || $[3] !== useCurrentRepo) {
1089
- t1 = () => {
1090
- const repoName = useCurrentRepo ? currentRepo : repoUrl;
1091
- if (!repoName?.trim()) {
1092
- setShowEmptyError(true);
1093
- return;
1094
- }
1095
- onSubmit();
1096
- };
1097
- $[0] = currentRepo;
1098
- $[1] = onSubmit;
1099
- $[2] = repoUrl;
1100
- $[3] = useCurrentRepo;
1101
- $[4] = t1;
1102
- } else {
1103
- t1 = $[4];
1104
- }
1105
- const handleSubmit = t1;
1106
- const isTextInputVisible = !useCurrentRepo || !currentRepo;
1107
- let t2;
1108
- if ($[5] !== onToggleUseCurrentRepo) {
1109
- t2 = () => {
1110
- onToggleUseCurrentRepo(true);
1111
- setShowEmptyError(false);
1112
- };
1113
- $[5] = onToggleUseCurrentRepo;
1114
- $[6] = t2;
1115
- } else {
1116
- t2 = $[6];
1117
- }
1118
- const handlePrevious = t2;
1119
- let t3;
1120
- if ($[7] !== onToggleUseCurrentRepo) {
1121
- t3 = () => {
1122
- onToggleUseCurrentRepo(false);
1123
- setShowEmptyError(false);
1124
- };
1125
- $[7] = onToggleUseCurrentRepo;
1126
- $[8] = t3;
1127
- } else {
1128
- t3 = $[8];
1129
- }
1130
- const handleNext = t3;
1131
- let t4;
1132
- if ($[9] !== handleNext || $[10] !== handlePrevious || $[11] !== handleSubmit) {
1133
- t4 = {
1134
- "confirm:previous": handlePrevious,
1135
- "confirm:next": handleNext,
1136
- "confirm:yes": handleSubmit
1137
- };
1138
- $[9] = handleNext;
1139
- $[10] = handlePrevious;
1140
- $[11] = handleSubmit;
1141
- $[12] = t4;
1142
- } else {
1143
- t4 = $[12];
1144
- }
1145
- const t5 = !isTextInputVisible;
1146
- let t6;
1147
- if ($[13] !== t5) {
1148
- t6 = {
1149
- context: "Confirmation",
1150
- isActive: t5
1151
- };
1152
- $[13] = t5;
1153
- $[14] = t6;
1154
- } else {
1155
- t6 = $[14];
1156
- }
1157
- useKeybindings(t4, t6);
1158
- let t7;
1159
- if ($[15] !== handleNext || $[16] !== handlePrevious) {
1160
- t7 = {
1161
- "confirm:previous": handlePrevious,
1162
- "confirm:next": handleNext
1163
- };
1164
- $[15] = handleNext;
1165
- $[16] = handlePrevious;
1166
- $[17] = t7;
1167
- } else {
1168
- t7 = $[17];
1169
- }
1170
- let t8;
1171
- if ($[18] !== isTextInputVisible) {
1172
- t8 = {
1173
- context: "Confirmation",
1174
- isActive: isTextInputVisible
1175
- };
1176
- $[18] = isTextInputVisible;
1177
- $[19] = t8;
1178
- } else {
1179
- t8 = $[19];
1180
- }
1181
- useKeybindings(t7, t8);
1182
- let t9;
1183
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
1184
- t9 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1185
- flexDirection: "column",
1186
- marginBottom: 1,
1187
- children: [
1188
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1189
- bold: true,
1190
- children: "Install GitHub App"
1191
- }, undefined, false, undefined, this),
1192
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1193
- dimColor: true,
1194
- children: "Select GitHub repository"
1195
- }, undefined, false, undefined, this)
1196
- ]
1197
- }, undefined, true, undefined, this);
1198
- $[20] = t9;
1199
- } else {
1200
- t9 = $[20];
1201
- }
1202
- let t10;
1203
- if ($[21] !== currentRepo || $[22] !== useCurrentRepo) {
1204
- t10 = currentRepo && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1205
- marginBottom: 1,
1206
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1207
- bold: useCurrentRepo,
1208
- color: useCurrentRepo ? "permission" : undefined,
1209
- children: [
1210
- useCurrentRepo ? "> " : " ",
1211
- "Use current repository: ",
1212
- currentRepo
1213
- ]
1214
- }, undefined, true, undefined, this)
1215
- }, undefined, false, undefined, this);
1216
- $[21] = currentRepo;
1217
- $[22] = useCurrentRepo;
1218
- $[23] = t10;
1219
- } else {
1220
- t10 = $[23];
1221
- }
1222
- const t11 = !useCurrentRepo || !currentRepo;
1223
- const t12 = !useCurrentRepo || !currentRepo ? "permission" : undefined;
1224
- const t13 = !useCurrentRepo || !currentRepo ? "> " : " ";
1225
- const t14 = currentRepo ? "Enter a different repository" : "Enter repository";
1226
- let t15;
1227
- if ($[24] !== t11 || $[25] !== t12 || $[26] !== t13 || $[27] !== t14) {
1228
- t15 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1229
- marginBottom: 1,
1230
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1231
- bold: t11,
1232
- color: t12,
1233
- children: [
1234
- t13,
1235
- t14
1236
- ]
1237
- }, undefined, true, undefined, this)
1238
- }, undefined, false, undefined, this);
1239
- $[24] = t11;
1240
- $[25] = t12;
1241
- $[26] = t13;
1242
- $[27] = t14;
1243
- $[28] = t15;
1244
- } else {
1245
- t15 = $[28];
1246
- }
1247
- let t16;
1248
- if ($[29] !== currentRepo || $[30] !== cursorOffset || $[31] !== handleSubmit || $[32] !== onRepoUrlChange || $[33] !== repoUrl || $[34] !== textInputColumns || $[35] !== useCurrentRepo) {
1249
- t16 = (!useCurrentRepo || !currentRepo) && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1250
- marginLeft: 2,
1251
- marginBottom: 1,
1252
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TextInput, {
1253
- value: repoUrl,
1254
- onChange: (value) => {
1255
- onRepoUrlChange(value);
1256
- setShowEmptyError(false);
1257
- },
1258
- onSubmit: handleSubmit,
1259
- focus: true,
1260
- placeholder: "Enter a repo as owner/repo or https://github.com/owner/repo\u2026",
1261
- columns: textInputColumns,
1262
- cursorOffset,
1263
- onChangeCursorOffset: setCursorOffset,
1264
- showCursor: true
1265
- }, undefined, false, undefined, this)
1266
- }, undefined, false, undefined, this);
1267
- $[29] = currentRepo;
1268
- $[30] = cursorOffset;
1269
- $[31] = handleSubmit;
1270
- $[32] = onRepoUrlChange;
1271
- $[33] = repoUrl;
1272
- $[34] = textInputColumns;
1273
- $[35] = useCurrentRepo;
1274
- $[36] = t16;
1275
- } else {
1276
- t16 = $[36];
1277
- }
1278
- let t17;
1279
- if ($[37] !== t10 || $[38] !== t15 || $[39] !== t16) {
1280
- t17 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1281
- flexDirection: "column",
1282
- borderStyle: "round",
1283
- paddingX: 1,
1284
- children: [
1285
- t9,
1286
- t10,
1287
- t15,
1288
- t16
1289
- ]
1290
- }, undefined, true, undefined, this);
1291
- $[37] = t10;
1292
- $[38] = t15;
1293
- $[39] = t16;
1294
- $[40] = t17;
1295
- } else {
1296
- t17 = $[40];
1297
- }
1298
- let t18;
1299
- if ($[41] !== showEmptyError) {
1300
- t18 = showEmptyError && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1301
- marginLeft: 3,
1302
- marginBottom: 1,
1303
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1304
- color: "error",
1305
- children: "Please enter a repository name to continue"
1306
- }, undefined, false, undefined, this)
1307
- }, undefined, false, undefined, this);
1308
- $[41] = showEmptyError;
1309
- $[42] = t18;
1310
- } else {
1311
- t18 = $[42];
1312
- }
1313
- const t19 = currentRepo ? "\u2191/\u2193 to select \xB7 " : "";
1314
- let t20;
1315
- if ($[43] !== t19) {
1316
- t20 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1317
- marginLeft: 3,
1318
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1319
- dimColor: true,
1320
- children: [
1321
- t19,
1322
- "Enter to continue"
1323
- ]
1324
- }, undefined, true, undefined, this)
1325
- }, undefined, false, undefined, this);
1326
- $[43] = t19;
1327
- $[44] = t20;
1328
- } else {
1329
- t20 = $[44];
1330
- }
1331
- let t21;
1332
- if ($[45] !== t17 || $[46] !== t18 || $[47] !== t20) {
1333
- t21 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
1334
- children: [
1335
- t17,
1336
- t18,
1337
- t20
1338
- ]
1339
- }, undefined, true, undefined, this);
1340
- $[45] = t17;
1341
- $[46] = t18;
1342
- $[47] = t20;
1343
- $[48] = t21;
1344
- } else {
1345
- t21 = $[48];
1346
- }
1347
- return t21;
1348
- }
1349
- var import_compiler_runtime5, import_react4, jsx_dev_runtime5;
1350
- var init_ChooseRepoStep = __esm(() => {
1351
- init_TextInput();
1352
- init_useTerminalSize();
1353
- init_ink();
1354
- init_useKeybinding();
1355
- import_compiler_runtime5 = __toESM(require_compiler_runtime(), 1);
1356
- import_react4 = __toESM(require_react(), 1);
1357
- jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
1358
- });
1359
-
1360
- // src/commands/install-github-app/CreatingStep.tsx
1361
- function CreatingStep(t0) {
1362
- const $ = import_compiler_runtime6.c(10);
1363
- const {
1364
- currentWorkflowInstallStep,
1365
- secretExists,
1366
- useExistingSecret,
1367
- secretName,
1368
- skipWorkflow: t1,
1369
- selectedWorkflows
1370
- } = t0;
1371
- const skipWorkflow = t1 === undefined ? false : t1;
1372
- let t2;
1373
- if ($[0] !== secretExists || $[1] !== secretName || $[2] !== selectedWorkflows || $[3] !== skipWorkflow || $[4] !== useExistingSecret) {
1374
- 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"];
1375
- $[0] = secretExists;
1376
- $[1] = secretName;
1377
- $[2] = selectedWorkflows;
1378
- $[3] = skipWorkflow;
1379
- $[4] = useExistingSecret;
1380
- $[5] = t2;
1381
- } else {
1382
- t2 = $[5];
1383
- }
1384
- const progressSteps = t2;
1385
- let t3;
1386
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
1387
- t3 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1388
- flexDirection: "column",
1389
- marginBottom: 1,
1390
- children: [
1391
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1392
- bold: true,
1393
- children: "Install GitHub App"
1394
- }, undefined, false, undefined, this),
1395
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1396
- dimColor: true,
1397
- children: "Create GitHub Actions workflow"
1398
- }, undefined, false, undefined, this)
1399
- ]
1400
- }, undefined, true, undefined, this);
1401
- $[6] = t3;
1402
- } else {
1403
- t3 = $[6];
1404
- }
1405
- let t4;
1406
- if ($[7] !== currentWorkflowInstallStep || $[8] !== progressSteps) {
1407
- t4 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
1408
- children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1409
- flexDirection: "column",
1410
- borderStyle: "round",
1411
- paddingX: 1,
1412
- children: [
1413
- t3,
1414
- progressSteps.map((stepText, index) => {
1415
- let status = "pending";
1416
- if (index < currentWorkflowInstallStep) {
1417
- status = "completed";
1418
- } else {
1419
- if (index === currentWorkflowInstallStep) {
1420
- status = "in-progress";
1421
- }
1422
- }
1423
- return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1424
- children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1425
- color: status === "completed" ? "success" : status === "in-progress" ? "warning" : undefined,
1426
- children: [
1427
- status === "completed" ? "\u2713 " : "",
1428
- stepText,
1429
- status === "in-progress" ? "\u2026" : ""
1430
- ]
1431
- }, undefined, true, undefined, this)
1432
- }, index, false, undefined, this);
1433
- })
1434
- ]
1435
- }, undefined, true, undefined, this)
1436
- }, undefined, false, undefined, this);
1437
- $[7] = currentWorkflowInstallStep;
1438
- $[8] = progressSteps;
1439
- $[9] = t4;
1440
- } else {
1441
- t4 = $[9];
1442
- }
1443
- return t4;
1444
- }
1445
- var import_compiler_runtime6, jsx_dev_runtime6;
1446
- var init_CreatingStep = __esm(() => {
1447
- init_ink();
1448
- import_compiler_runtime6 = __toESM(require_compiler_runtime(), 1);
1449
- jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
1450
- });
1451
-
1452
- // src/commands/install-github-app/ErrorStep.tsx
1453
- function ErrorStep(t0) {
1454
- const $ = import_compiler_runtime7.c(15);
1455
- const {
1456
- error,
1457
- errorReason,
1458
- errorInstructions
1459
- } = t0;
1460
- let t1;
1461
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1462
- t1 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1463
- flexDirection: "column",
1464
- marginBottom: 1,
1465
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1466
- bold: true,
1467
- children: "Install GitHub App"
1468
- }, undefined, false, undefined, this)
1469
- }, undefined, false, undefined, this);
1470
- $[0] = t1;
1471
- } else {
1472
- t1 = $[0];
1473
- }
1474
- let t2;
1475
- if ($[1] !== error) {
1476
- t2 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1477
- color: "error",
1478
- children: [
1479
- "Error: ",
1480
- error
1481
- ]
1482
- }, undefined, true, undefined, this);
1483
- $[1] = error;
1484
- $[2] = t2;
1485
- } else {
1486
- t2 = $[2];
1487
- }
1488
- let t3;
1489
- if ($[3] !== errorReason) {
1490
- t3 = errorReason && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1491
- marginTop: 1,
1492
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1493
- dimColor: true,
1494
- children: [
1495
- "Reason: ",
1496
- errorReason
1497
- ]
1498
- }, undefined, true, undefined, this)
1499
- }, undefined, false, undefined, this);
1500
- $[3] = errorReason;
1501
- $[4] = t3;
1502
- } else {
1503
- t3 = $[4];
1504
- }
1505
- let t4;
1506
- if ($[5] !== errorInstructions) {
1507
- t4 = errorInstructions && errorInstructions.length > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1508
- flexDirection: "column",
1509
- marginTop: 1,
1510
- children: [
1511
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1512
- dimColor: true,
1513
- children: "How to fix:"
1514
- }, undefined, false, undefined, this),
1515
- errorInstructions.map(_temp2)
1516
- ]
1517
- }, undefined, true, undefined, this);
1518
- $[5] = errorInstructions;
1519
- $[6] = t4;
1520
- } else {
1521
- t4 = $[6];
1522
- }
1523
- let t5;
1524
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
1525
- t5 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1526
- marginTop: 1,
1527
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1528
- dimColor: true,
1529
- children: [
1530
- "For manual setup instructions, see:",
1531
- " ",
1532
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1533
- color: "claude",
1534
- children: GITHUB_ACTION_SETUP_DOCS_URL
1535
- }, undefined, false, undefined, this)
1536
- ]
1537
- }, undefined, true, undefined, this)
1538
- }, undefined, false, undefined, this);
1539
- $[7] = t5;
1540
- } else {
1541
- t5 = $[7];
1542
- }
1543
- let t6;
1544
- if ($[8] !== t2 || $[9] !== t3 || $[10] !== t4) {
1545
- t6 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1546
- flexDirection: "column",
1547
- borderStyle: "round",
1548
- paddingX: 1,
1549
- children: [
1550
- t1,
1551
- t2,
1552
- t3,
1553
- t4,
1554
- t5
1555
- ]
1556
- }, undefined, true, undefined, this);
1557
- $[8] = t2;
1558
- $[9] = t3;
1559
- $[10] = t4;
1560
- $[11] = t6;
1561
- } else {
1562
- t6 = $[11];
1563
- }
1564
- let t7;
1565
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
1566
- t7 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1567
- marginLeft: 3,
1568
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1569
- dimColor: true,
1570
- children: "Press any key to exit"
1571
- }, undefined, false, undefined, this)
1572
- }, undefined, false, undefined, this);
1573
- $[12] = t7;
1574
- } else {
1575
- t7 = $[12];
1576
- }
1577
- let t8;
1578
- if ($[13] !== t6) {
1579
- t8 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
1580
- children: [
1581
- t6,
1582
- t7
1583
- ]
1584
- }, undefined, true, undefined, this);
1585
- $[13] = t6;
1586
- $[14] = t8;
1587
- } else {
1588
- t8 = $[14];
1589
- }
1590
- return t8;
1591
- }
1592
- function _temp2(instruction, index) {
1593
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1594
- marginLeft: 2,
1595
- children: [
1596
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1597
- dimColor: true,
1598
- children: "\u2022 "
1599
- }, undefined, false, undefined, this),
1600
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1601
- children: instruction
1602
- }, undefined, false, undefined, this)
1603
- ]
1604
- }, index, true, undefined, this);
1605
- }
1606
- var import_compiler_runtime7, jsx_dev_runtime7;
1607
- var init_ErrorStep = __esm(() => {
1608
- init_github_app();
1609
- init_ink();
1610
- import_compiler_runtime7 = __toESM(require_compiler_runtime(), 1);
1611
- jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
1612
- });
1613
-
1614
- // src/commands/install-github-app/ExistingWorkflowStep.tsx
1615
- function ExistingWorkflowStep(t0) {
1616
- const $ = import_compiler_runtime8.c(16);
1617
- const {
1618
- repoName,
1619
- onSelectAction
1620
- } = t0;
1621
- let t1;
1622
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1623
- t1 = [{
1624
- label: "Update workflow file with latest version",
1625
- value: "update"
1626
- }, {
1627
- label: "Skip workflow update (configure secrets only)",
1628
- value: "skip"
1629
- }, {
1630
- label: "Exit without making changes",
1631
- value: "exit"
1632
- }];
1633
- $[0] = t1;
1634
- } else {
1635
- t1 = $[0];
1636
- }
1637
- const options = t1;
1638
- let t2;
1639
- if ($[1] !== onSelectAction) {
1640
- t2 = (value) => {
1641
- onSelectAction(value);
1642
- };
1643
- $[1] = onSelectAction;
1644
- $[2] = t2;
1645
- } else {
1646
- t2 = $[2];
1647
- }
1648
- const handleSelect = t2;
1649
- let t3;
1650
- if ($[3] !== onSelectAction) {
1651
- t3 = () => {
1652
- onSelectAction("exit");
1653
- };
1654
- $[3] = onSelectAction;
1655
- $[4] = t3;
1656
- } else {
1657
- t3 = $[4];
1658
- }
1659
- const handleCancel = t3;
1660
- let t4;
1661
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
1662
- t4 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1663
- bold: true,
1664
- children: "Existing Workflow Found"
1665
- }, undefined, false, undefined, this);
1666
- $[5] = t4;
1667
- } else {
1668
- t4 = $[5];
1669
- }
1670
- let t5;
1671
- if ($[6] !== repoName) {
1672
- t5 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1673
- flexDirection: "column",
1674
- marginBottom: 1,
1675
- children: [
1676
- t4,
1677
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1678
- dimColor: true,
1679
- children: [
1680
- "Repository: ",
1681
- repoName
1682
- ]
1683
- }, undefined, true, undefined, this)
1684
- ]
1685
- }, undefined, true, undefined, this);
1686
- $[6] = repoName;
1687
- $[7] = t5;
1688
- } else {
1689
- t5 = $[7];
1690
- }
1691
- let t6;
1692
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
1693
- t6 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1694
- flexDirection: "column",
1695
- marginBottom: 1,
1696
- children: [
1697
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1698
- children: [
1699
- "A Claude workflow file already exists at",
1700
- " ",
1701
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1702
- color: "claude",
1703
- children: ".github/workflows/claude.yml"
1704
- }, undefined, false, undefined, this)
1705
- ]
1706
- }, undefined, true, undefined, this),
1707
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1708
- dimColor: true,
1709
- children: "What would you like to do?"
1710
- }, undefined, false, undefined, this)
1711
- ]
1712
- }, undefined, true, undefined, this);
1713
- $[8] = t6;
1714
- } else {
1715
- t6 = $[8];
1716
- }
1717
- let t7;
1718
- if ($[9] !== handleCancel || $[10] !== handleSelect) {
1719
- t7 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1720
- flexDirection: "column",
1721
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Select, {
1722
- options,
1723
- onChange: handleSelect,
1724
- onCancel: handleCancel
1725
- }, undefined, false, undefined, this)
1726
- }, undefined, false, undefined, this);
1727
- $[9] = handleCancel;
1728
- $[10] = handleSelect;
1729
- $[11] = t7;
1730
- } else {
1731
- t7 = $[11];
1732
- }
1733
- let t8;
1734
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
1735
- t8 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1736
- marginTop: 1,
1737
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1738
- dimColor: true,
1739
- children: [
1740
- "View the latest workflow template at:",
1741
- " ",
1742
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1743
- color: "claude",
1744
- children: "https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml"
1745
- }, undefined, false, undefined, this)
1746
- ]
1747
- }, undefined, true, undefined, this)
1748
- }, undefined, false, undefined, this);
1749
- $[12] = t8;
1750
- } else {
1751
- t8 = $[12];
1752
- }
1753
- let t9;
1754
- if ($[13] !== t5 || $[14] !== t7) {
1755
- t9 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1756
- flexDirection: "column",
1757
- borderStyle: "round",
1758
- borderDimColor: true,
1759
- paddingX: 1,
1760
- children: [
1761
- t5,
1762
- t6,
1763
- t7,
1764
- t8
1765
- ]
1766
- }, undefined, true, undefined, this);
1767
- $[13] = t5;
1768
- $[14] = t7;
1769
- $[15] = t9;
1770
- } else {
1771
- t9 = $[15];
1772
- }
1773
- return t9;
1774
- }
1775
- var import_compiler_runtime8, jsx_dev_runtime8;
1776
- var init_ExistingWorkflowStep = __esm(() => {
1777
- init_CustomSelect();
1778
- init_ink();
1779
- import_compiler_runtime8 = __toESM(require_compiler_runtime(), 1);
1780
- jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
1781
- });
1782
-
1783
- // src/commands/install-github-app/InstallAppStep.tsx
1784
- function InstallAppStep(t0) {
1785
- const $ = import_compiler_runtime9.c(12);
1786
- const {
1787
- repoUrl,
1788
- onSubmit
1789
- } = t0;
1790
- let t1;
1791
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1792
- t1 = {
1793
- context: "Confirmation"
1794
- };
1795
- $[0] = t1;
1796
- } else {
1797
- t1 = $[0];
1798
- }
1799
- useKeybinding("confirm:yes", onSubmit, t1);
1800
- let t2;
1801
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1802
- t2 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1803
- flexDirection: "column",
1804
- marginBottom: 1,
1805
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1806
- bold: true,
1807
- children: "Install the Claude GitHub App"
1808
- }, undefined, false, undefined, this)
1809
- }, undefined, false, undefined, this);
1810
- $[1] = t2;
1811
- } else {
1812
- t2 = $[1];
1813
- }
1814
- let t3;
1815
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1816
- t3 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1817
- marginBottom: 1,
1818
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1819
- children: "Opening browser to install the Claude GitHub App\u2026"
1820
- }, undefined, false, undefined, this)
1821
- }, undefined, false, undefined, this);
1822
- $[2] = t3;
1823
- } else {
1824
- t3 = $[2];
1825
- }
1826
- let t4;
1827
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
1828
- t4 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1829
- marginBottom: 1,
1830
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1831
- children: "If your browser doesn't open automatically, visit:"
1832
- }, undefined, false, undefined, this)
1833
- }, undefined, false, undefined, this);
1834
- $[3] = t4;
1835
- } else {
1836
- t4 = $[3];
1837
- }
1838
- let t5;
1839
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
1840
- t5 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1841
- marginBottom: 1,
1842
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1843
- underline: true,
1844
- children: "https://github.com/apps/claude"
1845
- }, undefined, false, undefined, this)
1846
- }, undefined, false, undefined, this);
1847
- $[4] = t5;
1848
- } else {
1849
- t5 = $[4];
1850
- }
1851
- let t6;
1852
- if ($[5] !== repoUrl) {
1853
- t6 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1854
- marginBottom: 1,
1855
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1856
- children: [
1857
- "Please install the app for repository: ",
1858
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1859
- bold: true,
1860
- children: repoUrl
1861
- }, undefined, false, undefined, this)
1862
- ]
1863
- }, undefined, true, undefined, this)
1864
- }, undefined, false, undefined, this);
1865
- $[5] = repoUrl;
1866
- $[6] = t6;
1867
- } else {
1868
- t6 = $[6];
1869
- }
1870
- let t7;
1871
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
1872
- t7 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1873
- marginBottom: 1,
1874
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1875
- dimColor: true,
1876
- children: "Important: Make sure to grant access to this specific repository"
1877
- }, undefined, false, undefined, this)
1878
- }, undefined, false, undefined, this);
1879
- $[7] = t7;
1880
- } else {
1881
- t7 = $[7];
1882
- }
1883
- let t8;
1884
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
1885
- t8 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1886
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1887
- bold: true,
1888
- color: "permission",
1889
- children: [
1890
- "Press Enter once you've installed the app",
1891
- figures_default.ellipsis
1892
- ]
1893
- }, undefined, true, undefined, this)
1894
- }, undefined, false, undefined, this);
1895
- $[8] = t8;
1896
- } else {
1897
- t8 = $[8];
1898
- }
1899
- let t9;
1900
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
1901
- t9 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1902
- marginTop: 1,
1903
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1904
- dimColor: true,
1905
- children: [
1906
- "Having trouble? See manual setup instructions at:",
1907
- " ",
1908
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1909
- color: "claude",
1910
- children: GITHUB_ACTION_SETUP_DOCS_URL
1911
- }, undefined, false, undefined, this)
1912
- ]
1913
- }, undefined, true, undefined, this)
1914
- }, undefined, false, undefined, this);
1915
- $[9] = t9;
1916
- } else {
1917
- t9 = $[9];
1918
- }
1919
- let t10;
1920
- if ($[10] !== t6) {
1921
- t10 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1922
- flexDirection: "column",
1923
- borderStyle: "round",
1924
- borderDimColor: true,
1925
- paddingX: 1,
1926
- children: [
1927
- t2,
1928
- t3,
1929
- t4,
1930
- t5,
1931
- t6,
1932
- t7,
1933
- t8,
1934
- t9
1935
- ]
1936
- }, undefined, true, undefined, this);
1937
- $[10] = t6;
1938
- $[11] = t10;
1939
- } else {
1940
- t10 = $[11];
1941
- }
1942
- return t10;
1943
- }
1944
- var import_compiler_runtime9, jsx_dev_runtime9;
1945
- var init_InstallAppStep = __esm(() => {
1946
- init_figures();
1947
- init_github_app();
1948
- init_ink();
1949
- init_useKeybinding();
1950
- import_compiler_runtime9 = __toESM(require_compiler_runtime(), 1);
1951
- jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
1952
- });
1953
-
1954
- // src/commands/install-github-app/OAuthFlowStep.tsx
1955
- function OAuthFlowStep({
1956
- onSuccess,
1957
- onCancel
1958
- }) {
1959
- const [oauthStatus, setOAuthStatus] = import_react5.useState({
1960
- state: "starting"
1961
- });
1962
- const [oauthService] = import_react5.useState(() => new OAuthService);
1963
- const [pastedCode, setPastedCode] = import_react5.useState("");
1964
- const [cursorOffset, setCursorOffset] = import_react5.useState(0);
1965
- const [showPastePrompt, setShowPastePrompt] = import_react5.useState(false);
1966
- const [urlCopied, setUrlCopied] = import_react5.useState(false);
1967
- const timersRef = import_react5.useRef(new Set);
1968
- const urlCopiedTimerRef = import_react5.useRef(undefined);
1969
- const terminalSize = useTerminalSize();
1970
- const textInputColumns = Math.max(50, terminalSize.columns - PASTE_HERE_MSG.length - 4);
1971
- function handleKeyDown(e) {
1972
- if (oauthStatus.state !== "error")
1973
- return;
1974
- e.preventDefault();
1975
- if (e.key === "return" && oauthStatus.toRetry) {
1976
- setPastedCode("");
1977
- setCursorOffset(0);
1978
- setOAuthStatus({
1979
- state: "about_to_retry",
1980
- nextState: oauthStatus.toRetry
1981
- });
1982
- } else {
1983
- onCancel();
1984
- }
1985
- }
1986
- async function handleSubmitCode(value, url) {
1987
- try {
1988
- const [authorizationCode, state] = value.split("#");
1989
- if (!authorizationCode || !state) {
1990
- setOAuthStatus({
1991
- state: "error",
1992
- message: "Invalid code. Please make sure the full code was copied",
1993
- toRetry: {
1994
- state: "waiting_for_login",
1995
- url
1996
- }
1997
- });
1998
- return;
1999
- }
2000
- logEvent("tengu_oauth_manual_entry", {});
2001
- oauthService.handleManualAuthCodeInput({
2002
- authorizationCode,
2003
- state
2004
- });
2005
- } catch (err) {
2006
- logError(err);
2007
- setOAuthStatus({
2008
- state: "error",
2009
- message: err.message,
2010
- toRetry: {
2011
- state: "waiting_for_login",
2012
- url
2013
- }
2014
- });
2015
- }
2016
- }
2017
- const startOAuth = import_react5.useCallback(async () => {
2018
- timersRef.current.forEach((timer) => clearTimeout(timer));
2019
- timersRef.current.clear();
2020
- try {
2021
- const result = await oauthService.startOAuthFlow(async (url_0) => {
2022
- setOAuthStatus({
2023
- state: "waiting_for_login",
2024
- url: url_0
2025
- });
2026
- const timer_0 = setTimeout(setShowPastePrompt, 3000, true);
2027
- timersRef.current.add(timer_0);
2028
- }, {
2029
- loginWithClaudeAi: true,
2030
- inferenceOnly: true,
2031
- expiresIn: 365 * 24 * 60 * 60
2032
- });
2033
- setOAuthStatus({
2034
- state: "processing"
2035
- });
2036
- saveOAuthTokensIfNeeded(result);
2037
- const timer1 = setTimeout((setOAuthStatus_0, accessToken, onSuccess_0, timersRef_0) => {
2038
- setOAuthStatus_0({
2039
- state: "success",
2040
- token: accessToken
2041
- });
2042
- const timer2 = setTimeout(onSuccess_0, 1000, accessToken);
2043
- timersRef_0.current.add(timer2);
2044
- }, 100, setOAuthStatus, result.accessToken, onSuccess, timersRef);
2045
- timersRef.current.add(timer1);
2046
- } catch (err_0) {
2047
- const errorMessage = err_0.message;
2048
- setOAuthStatus({
2049
- state: "error",
2050
- message: errorMessage,
2051
- toRetry: {
2052
- state: "starting"
2053
- }
2054
- });
2055
- logError(err_0);
2056
- logEvent("tengu_oauth_error", {
2057
- error: errorMessage
2058
- });
2059
- }
2060
- }, [oauthService, onSuccess]);
2061
- import_react5.useEffect(() => {
2062
- if (oauthStatus.state === "starting") {
2063
- startOAuth();
2064
- }
2065
- }, [oauthStatus.state, startOAuth]);
2066
- import_react5.useEffect(() => {
2067
- if (oauthStatus.state === "about_to_retry") {
2068
- const timer_1 = setTimeout((nextState, setShowPastePrompt_0, setOAuthStatus_1) => {
2069
- setShowPastePrompt_0(nextState.state === "waiting_for_login");
2070
- setOAuthStatus_1(nextState);
2071
- }, 500, oauthStatus.nextState, setShowPastePrompt, setOAuthStatus);
2072
- timersRef.current.add(timer_1);
2073
- }
2074
- }, [oauthStatus]);
2075
- import_react5.useEffect(() => {
2076
- if (pastedCode === "c" && oauthStatus.state === "waiting_for_login" && showPastePrompt && !urlCopied) {
2077
- setClipboard(oauthStatus.url).then((raw) => {
2078
- if (raw)
2079
- process.stdout.write(raw);
2080
- setUrlCopied(true);
2081
- clearTimeout(urlCopiedTimerRef.current);
2082
- urlCopiedTimerRef.current = setTimeout(setUrlCopied, 2000, false);
2083
- });
2084
- setPastedCode("");
2085
- }
2086
- }, [pastedCode, oauthStatus, showPastePrompt, urlCopied]);
2087
- import_react5.useEffect(() => {
2088
- const timers = timersRef.current;
2089
- return () => {
2090
- oauthService.cleanup();
2091
- timers.forEach((timer_2) => clearTimeout(timer_2));
2092
- timers.clear();
2093
- clearTimeout(urlCopiedTimerRef.current);
2094
- };
2095
- }, [oauthService]);
2096
- function renderStatusMessage() {
2097
- switch (oauthStatus.state) {
2098
- case "starting":
2099
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2100
- children: [
2101
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner, {}, undefined, false, undefined, this),
2102
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2103
- children: "Starting authentication\u2026"
2104
- }, undefined, false, undefined, this)
2105
- ]
2106
- }, undefined, true, undefined, this);
2107
- case "waiting_for_login":
2108
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2109
- flexDirection: "column",
2110
- gap: 1,
2111
- children: [
2112
- !showPastePrompt && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2113
- children: [
2114
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner, {}, undefined, false, undefined, this),
2115
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2116
- children: "Opening browser to sign in with your Claude account\u2026"
2117
- }, undefined, false, undefined, this)
2118
- ]
2119
- }, undefined, true, undefined, this),
2120
- showPastePrompt && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2121
- children: [
2122
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2123
- children: PASTE_HERE_MSG
2124
- }, undefined, false, undefined, this),
2125
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(TextInput, {
2126
- value: pastedCode,
2127
- onChange: setPastedCode,
2128
- onSubmit: (value_0) => handleSubmitCode(value_0, oauthStatus.url),
2129
- cursorOffset,
2130
- onChangeCursorOffset: setCursorOffset,
2131
- columns: textInputColumns
2132
- }, undefined, false, undefined, this)
2133
- ]
2134
- }, undefined, true, undefined, this)
2135
- ]
2136
- }, undefined, true, undefined, this);
2137
- case "processing":
2138
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2139
- children: [
2140
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner, {}, undefined, false, undefined, this),
2141
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2142
- children: "Processing authentication\u2026"
2143
- }, undefined, false, undefined, this)
2144
- ]
2145
- }, undefined, true, undefined, this);
2146
- case "success":
2147
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2148
- flexDirection: "column",
2149
- gap: 1,
2150
- children: [
2151
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2152
- color: "success",
2153
- children: "\u2713 Authentication token created successfully!"
2154
- }, undefined, false, undefined, this),
2155
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2156
- dimColor: true,
2157
- children: "Using token for GitHub Actions setup\u2026"
2158
- }, undefined, false, undefined, this)
2159
- ]
2160
- }, undefined, true, undefined, this);
2161
- case "error":
2162
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2163
- flexDirection: "column",
2164
- gap: 1,
2165
- children: [
2166
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2167
- color: "error",
2168
- children: [
2169
- "OAuth error: ",
2170
- oauthStatus.message
2171
- ]
2172
- }, undefined, true, undefined, this),
2173
- oauthStatus.toRetry ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2174
- dimColor: true,
2175
- children: "Press Enter to try again, or any other key to cancel"
2176
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2177
- dimColor: true,
2178
- children: "Press any key to return to API key selection"
2179
- }, undefined, false, undefined, this)
2180
- ]
2181
- }, undefined, true, undefined, this);
2182
- case "about_to_retry":
2183
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2184
- flexDirection: "column",
2185
- gap: 1,
2186
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2187
- color: "permission",
2188
- children: "Retrying\u2026"
2189
- }, undefined, false, undefined, this)
2190
- }, undefined, false, undefined, this);
2191
- default:
2192
- return null;
2193
- }
2194
- }
2195
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2196
- flexDirection: "column",
2197
- gap: 1,
2198
- tabIndex: 0,
2199
- autoFocus: true,
2200
- onKeyDown: handleKeyDown,
2201
- children: [
2202
- oauthStatus.state === "starting" && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2203
- flexDirection: "column",
2204
- gap: 1,
2205
- paddingBottom: 1,
2206
- children: [
2207
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2208
- bold: true,
2209
- children: "Create Authentication Token"
2210
- }, undefined, false, undefined, this),
2211
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2212
- dimColor: true,
2213
- children: "Creating a long-lived token for GitHub Actions"
2214
- }, undefined, false, undefined, this)
2215
- ]
2216
- }, undefined, true, undefined, this),
2217
- oauthStatus.state !== "success" && oauthStatus.state !== "starting" && oauthStatus.state !== "processing" && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2218
- flexDirection: "column",
2219
- gap: 1,
2220
- paddingBottom: 1,
2221
- children: [
2222
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2223
- bold: true,
2224
- children: "Create Authentication Token"
2225
- }, undefined, false, undefined, this),
2226
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2227
- dimColor: true,
2228
- children: "Creating a long-lived token for GitHub Actions"
2229
- }, undefined, false, undefined, this)
2230
- ]
2231
- }, "header", true, undefined, this),
2232
- oauthStatus.state === "waiting_for_login" && showPastePrompt && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2233
- flexDirection: "column",
2234
- gap: 1,
2235
- paddingBottom: 1,
2236
- children: [
2237
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2238
- paddingX: 1,
2239
- children: [
2240
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2241
- dimColor: true,
2242
- children: [
2243
- "Browser didn't open? Use the url below to sign in",
2244
- " "
2245
- ]
2246
- }, undefined, true, undefined, this),
2247
- urlCopied ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2248
- color: "success",
2249
- children: "(Copied!)"
2250
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2251
- dimColor: true,
2252
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
2253
- shortcut: "c",
2254
- action: "copy",
2255
- parens: true
2256
- }, undefined, false, undefined, this)
2257
- }, undefined, false, undefined, this)
2258
- ]
2259
- }, undefined, true, undefined, this),
2260
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Link, {
2261
- url: oauthStatus.url,
2262
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2263
- dimColor: true,
2264
- children: oauthStatus.url
2265
- }, undefined, false, undefined, this)
2266
- }, undefined, false, undefined, this)
2267
- ]
2268
- }, "urlToCopy", true, undefined, this),
2269
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2270
- paddingLeft: 1,
2271
- flexDirection: "column",
2272
- gap: 1,
2273
- children: renderStatusMessage()
2274
- }, undefined, false, undefined, this)
2275
- ]
2276
- }, undefined, true, undefined, this);
2277
- }
2278
- var import_react5, jsx_dev_runtime10, PASTE_HERE_MSG = "Paste code here if prompted > ";
2279
- var init_OAuthFlowStep = __esm(() => {
2280
- init_analytics();
2281
- init_KeyboardShortcutHint();
2282
- init_Spinner();
2283
- init_TextInput();
2284
- init_useTerminalSize();
2285
- init_osc();
2286
- init_ink();
2287
- init_oauth();
2288
- init_auth();
2289
- init_log();
2290
- import_react5 = __toESM(require_react(), 1);
2291
- jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
2292
- });
2293
-
2294
- // src/commands/install-github-app/SuccessStep.tsx
2295
- function SuccessStep(t0) {
2296
- const $ = import_compiler_runtime10.c(21);
2297
- const {
2298
- secretExists,
2299
- useExistingSecret,
2300
- secretName,
2301
- skipWorkflow: t1
2302
- } = t0;
2303
- const skipWorkflow = t1 === undefined ? false : t1;
2304
- let t2;
2305
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
2306
- t2 = /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
2307
- flexDirection: "column",
2308
- marginBottom: 1,
2309
- children: [
2310
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2311
- bold: true,
2312
- children: "Install GitHub App"
2313
- }, undefined, false, undefined, this),
2314
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2315
- dimColor: true,
2316
- children: "Success"
2317
- }, undefined, false, undefined, this)
2318
- ]
2319
- }, undefined, true, undefined, this);
2320
- $[0] = t2;
2321
- } else {
2322
- t2 = $[0];
2323
- }
2324
- let t3;
2325
- if ($[1] !== skipWorkflow) {
2326
- t3 = !skipWorkflow && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2327
- color: "success",
2328
- children: "\u2713 GitHub Actions workflow created!"
2329
- }, undefined, false, undefined, this);
2330
- $[1] = skipWorkflow;
2331
- $[2] = t3;
2332
- } else {
2333
- t3 = $[2];
2334
- }
2335
- let t4;
2336
- if ($[3] !== secretExists || $[4] !== useExistingSecret) {
2337
- t4 = secretExists && useExistingSecret && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
2338
- marginTop: 1,
2339
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2340
- color: "success",
2341
- children: "\u2713 Using existing ANTHROPIC_API_KEY secret"
2342
- }, undefined, false, undefined, this)
2343
- }, undefined, false, undefined, this);
2344
- $[3] = secretExists;
2345
- $[4] = useExistingSecret;
2346
- $[5] = t4;
2347
- } else {
2348
- t4 = $[5];
2349
- }
2350
- let t5;
2351
- if ($[6] !== secretExists || $[7] !== secretName || $[8] !== useExistingSecret) {
2352
- t5 = (!secretExists || !useExistingSecret) && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
2353
- marginTop: 1,
2354
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2355
- color: "success",
2356
- children: [
2357
- "\u2713 API key saved as ",
2358
- secretName,
2359
- " secret"
2360
- ]
2361
- }, undefined, true, undefined, this)
2362
- }, undefined, false, undefined, this);
2363
- $[6] = secretExists;
2364
- $[7] = secretName;
2365
- $[8] = useExistingSecret;
2366
- $[9] = t5;
2367
- } else {
2368
- t5 = $[9];
2369
- }
2370
- let t6;
2371
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
2372
- t6 = /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
2373
- marginTop: 1,
2374
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2375
- children: "Next steps:"
2376
- }, undefined, false, undefined, this)
2377
- }, undefined, false, undefined, this);
2378
- $[10] = t6;
2379
- } else {
2380
- t6 = $[10];
2381
- }
2382
- let t7;
2383
- if ($[11] !== skipWorkflow) {
2384
- t7 = skipWorkflow ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
2385
- children: [
2386
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2387
- children: "1. Install the Claude GitHub App if you haven't already"
2388
- }, undefined, false, undefined, this),
2389
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2390
- children: "2. Your workflow file was kept unchanged"
2391
- }, undefined, false, undefined, this),
2392
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2393
- children: "3. API key is configured and ready to use"
2394
- }, undefined, false, undefined, this)
2395
- ]
2396
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
2397
- children: [
2398
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2399
- children: "1. A pre-filled PR page has been created"
2400
- }, undefined, false, undefined, this),
2401
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2402
- children: "2. Install the Claude GitHub App if you haven't already"
2403
- }, undefined, false, undefined, this),
2404
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2405
- children: "3. Merge the PR to enable Claude PR assistance"
2406
- }, undefined, false, undefined, this)
2407
- ]
2408
- }, undefined, true, undefined, this);
2409
- $[11] = skipWorkflow;
2410
- $[12] = t7;
2411
- } else {
2412
- t7 = $[12];
2413
- }
2414
- let t8;
2415
- if ($[13] !== t3 || $[14] !== t4 || $[15] !== t5 || $[16] !== t7) {
2416
- t8 = /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
2417
- flexDirection: "column",
2418
- borderStyle: "round",
2419
- paddingX: 1,
2420
- children: [
2421
- t2,
2422
- t3,
2423
- t4,
2424
- t5,
2425
- t6,
2426
- t7
2427
- ]
2428
- }, undefined, true, undefined, this);
2429
- $[13] = t3;
2430
- $[14] = t4;
2431
- $[15] = t5;
2432
- $[16] = t7;
2433
- $[17] = t8;
2434
- } else {
2435
- t8 = $[17];
2436
- }
2437
- let t9;
2438
- if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
2439
- t9 = /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
2440
- marginLeft: 3,
2441
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
2442
- dimColor: true,
2443
- children: "Press any key to exit"
2444
- }, undefined, false, undefined, this)
2445
- }, undefined, false, undefined, this);
2446
- $[18] = t9;
2447
- } else {
2448
- t9 = $[18];
2449
- }
2450
- let t10;
2451
- if ($[19] !== t8) {
2452
- t10 = /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
2453
- children: [
2454
- t8,
2455
- t9
2456
- ]
2457
- }, undefined, true, undefined, this);
2458
- $[19] = t8;
2459
- $[20] = t10;
2460
- } else {
2461
- t10 = $[20];
2462
- }
2463
- return t10;
2464
- }
2465
- var import_compiler_runtime10, jsx_dev_runtime11;
2466
- var init_SuccessStep = __esm(() => {
2467
- init_ink();
2468
- import_compiler_runtime10 = __toESM(require_compiler_runtime(), 1);
2469
- jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
2470
- });
2471
-
2472
- // src/commands/install-github-app/setupGitHubActions.ts
2473
- async function createWorkflowFile(repoName, branchName, workflowPath, workflowContent, secretName, message, context) {
2474
- const checkFileResult = await execFileNoThrow("gh", [
2475
- "api",
2476
- `repos/${repoName}/contents/${workflowPath}`,
2477
- "--jq",
2478
- ".sha"
2479
- ]);
2480
- let fileSha = null;
2481
- if (checkFileResult.code === 0) {
2482
- fileSha = checkFileResult.stdout.trim();
2483
- }
2484
- let content = workflowContent;
2485
- if (secretName === "CLAUDE_CODE_OAUTH_TOKEN") {
2486
- content = workflowContent.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g, `claude_code_oauth_token: \${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}`);
2487
- } else if (secretName !== "ANTHROPIC_API_KEY") {
2488
- content = workflowContent.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g, `anthropic_api_key: \${{ secrets.${secretName} }}`);
2489
- }
2490
- const base64Content = Buffer.from(content).toString("base64");
2491
- const apiParams = [
2492
- "api",
2493
- "--method",
2494
- "PUT",
2495
- `repos/${repoName}/contents/${workflowPath}`,
2496
- "-f",
2497
- `message=${fileSha ? `"Update ${message}"` : `"${message}"`}`,
2498
- "-f",
2499
- `content=${base64Content}`,
2500
- "-f",
2501
- `branch=${branchName}`
2502
- ];
2503
- if (fileSha) {
2504
- apiParams.push("-f", `sha=${fileSha}`);
2505
- }
2506
- const createFileResult = await execFileNoThrow("gh", apiParams);
2507
- if (createFileResult.code !== 0) {
2508
- if (createFileResult.stderr.includes("422") && createFileResult.stderr.includes("sha")) {
2509
- logEvent("tengu_setup_github_actions_failed", {
2510
- reason: "failed_to_create_workflow_file",
2511
- exit_code: createFileResult.code,
2512
- ...context
2513
- });
2514
- 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.`);
2515
- }
2516
- logEvent("tengu_setup_github_actions_failed", {
2517
- reason: "failed_to_create_workflow_file",
2518
- exit_code: createFileResult.code,
2519
- ...context
2520
- });
2521
- const helpText = `
2522
-
2523
- Need help? Common issues:
2524
- ` + `\xB7 Permission denied \u2192 Run: gh auth refresh -h github.com -s repo,workflow
2525
- ` + `\xB7 Not authorized \u2192 Ensure you have admin access to the repository
2526
- ` + "\xB7 For manual setup \u2192 Visit: https://github.com/anthropics/claude-code-action";
2527
- throw new Error(`Failed to create workflow file ${workflowPath}: ${createFileResult.stderr}${helpText}`);
2528
- }
2529
- }
2530
- async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, updateProgress, skipWorkflow = false, selectedWorkflows, authType, context) {
2531
- try {
2532
- logEvent("tengu_setup_github_actions_started", {
2533
- skip_workflow: skipWorkflow,
2534
- has_api_key: !!apiKeyOrOAuthToken,
2535
- using_default_secret_name: secretName === "ANTHROPIC_API_KEY",
2536
- selected_claude_workflow: selectedWorkflows.includes("claude"),
2537
- selected_claude_review_workflow: selectedWorkflows.includes("claude-review"),
2538
- ...context
2539
- });
2540
- const repoCheckResult = await execFileNoThrow("gh", [
2541
- "api",
2542
- `repos/${repoName}`,
2543
- "--jq",
2544
- ".id"
2545
- ]);
2546
- if (repoCheckResult.code !== 0) {
2547
- logEvent("tengu_setup_github_actions_failed", {
2548
- reason: "repo_not_found",
2549
- exit_code: repoCheckResult.code,
2550
- ...context
2551
- });
2552
- throw new Error(`Failed to access repository ${repoName}: ${repoCheckResult.stderr}`);
2553
- }
2554
- const defaultBranchResult = await execFileNoThrow("gh", [
2555
- "api",
2556
- `repos/${repoName}`,
2557
- "--jq",
2558
- ".default_branch"
2559
- ]);
2560
- if (defaultBranchResult.code !== 0) {
2561
- logEvent("tengu_setup_github_actions_failed", {
2562
- reason: "failed_to_get_default_branch",
2563
- exit_code: defaultBranchResult.code,
2564
- ...context
2565
- });
2566
- throw new Error(`Failed to get default branch: ${defaultBranchResult.stderr}`);
2567
- }
2568
- const defaultBranch = defaultBranchResult.stdout.trim();
2569
- const shaResult = await execFileNoThrow("gh", [
2570
- "api",
2571
- `repos/${repoName}/git/ref/heads/${defaultBranch}`,
2572
- "--jq",
2573
- ".object.sha"
2574
- ]);
2575
- if (shaResult.code !== 0) {
2576
- logEvent("tengu_setup_github_actions_failed", {
2577
- reason: "failed_to_get_branch_sha",
2578
- exit_code: shaResult.code,
2579
- ...context
2580
- });
2581
- throw new Error(`Failed to get branch SHA: ${shaResult.stderr}`);
2582
- }
2583
- const sha = shaResult.stdout.trim();
2584
- let branchName = null;
2585
- if (!skipWorkflow) {
2586
- updateProgress();
2587
- branchName = `add-claude-github-actions-${Date.now()}`;
2588
- const createBranchResult = await execFileNoThrow("gh", [
2589
- "api",
2590
- "--method",
2591
- "POST",
2592
- `repos/${repoName}/git/refs`,
2593
- "-f",
2594
- `ref=refs/heads/${branchName}`,
2595
- "-f",
2596
- `sha=${sha}`
2597
- ]);
2598
- if (createBranchResult.code !== 0) {
2599
- logEvent("tengu_setup_github_actions_failed", {
2600
- reason: "failed_to_create_branch",
2601
- exit_code: createBranchResult.code,
2602
- ...context
2603
- });
2604
- throw new Error(`Failed to create branch: ${createBranchResult.stderr}`);
2605
- }
2606
- updateProgress();
2607
- const workflows = [];
2608
- if (selectedWorkflows.includes("claude")) {
2609
- workflows.push({
2610
- path: ".github/workflows/claude.yml",
2611
- content: WORKFLOW_CONTENT,
2612
- message: "Claude PR Assistant workflow"
2613
- });
2614
- }
2615
- if (selectedWorkflows.includes("claude-review")) {
2616
- workflows.push({
2617
- path: ".github/workflows/claude-code-review.yml",
2618
- content: CODE_REVIEW_PLUGIN_WORKFLOW_CONTENT,
2619
- message: "Claude Code Review workflow"
2620
- });
2621
- }
2622
- for (const workflow of workflows) {
2623
- await createWorkflowFile(repoName, branchName, workflow.path, workflow.content, secretName, workflow.message, context);
2624
- }
2625
- }
2626
- updateProgress();
2627
- if (apiKeyOrOAuthToken) {
2628
- const setSecretResult = await execFileNoThrow("gh", [
2629
- "secret",
2630
- "set",
2631
- secretName,
2632
- "--body",
2633
- apiKeyOrOAuthToken,
2634
- "--repo",
2635
- repoName
2636
- ]);
2637
- if (setSecretResult.code !== 0) {
2638
- logEvent("tengu_setup_github_actions_failed", {
2639
- reason: "failed_to_set_api_key_secret",
2640
- exit_code: setSecretResult.code,
2641
- ...context
2642
- });
2643
- const helpText = `
2644
-
2645
- Need help? Common issues:
2646
- ` + `\xB7 Permission denied \u2192 Run: gh auth refresh -h github.com -s repo
2647
- ` + `\xB7 Not authorized \u2192 Ensure you have admin access to the repository
2648
- ` + "\xB7 For manual setup \u2192 Visit: https://github.com/anthropics/claude-code-action";
2649
- throw new Error(`Failed to set API key secret: ${setSecretResult.stderr || "Unknown error"}${helpText}`);
2650
- }
2651
- }
2652
- if (!skipWorkflow && branchName) {
2653
- updateProgress();
2654
- const compareUrl = `https://github.com/${repoName}/compare/${defaultBranch}...${branchName}?quick_pull=1&title=${encodeURIComponent(PR_TITLE)}&body=${encodeURIComponent(PR_BODY)}`;
2655
- await openBrowser(compareUrl);
2656
- }
2657
- logEvent("tengu_setup_github_actions_completed", {
2658
- skip_workflow: skipWorkflow,
2659
- has_api_key: !!apiKeyOrOAuthToken,
2660
- auth_type: authType,
2661
- using_default_secret_name: secretName === "ANTHROPIC_API_KEY",
2662
- selected_claude_workflow: selectedWorkflows.includes("claude"),
2663
- selected_claude_review_workflow: selectedWorkflows.includes("claude-review"),
2664
- ...context
2665
- });
2666
- saveGlobalConfig((current) => ({
2667
- ...current,
2668
- githubActionSetupCount: (current.githubActionSetupCount ?? 0) + 1
2669
- }));
2670
- } catch (error) {
2671
- if (!error || !(error instanceof Error) || !error.message.includes("Failed to")) {
2672
- logEvent("tengu_setup_github_actions_failed", {
2673
- reason: "unexpected_error",
2674
- ...context
2675
- });
2676
- }
2677
- if (error instanceof Error) {
2678
- logError(error);
2679
- }
2680
- throw error;
2681
- }
2682
- }
2683
- var init_setupGitHubActions = __esm(() => {
2684
- init_analytics();
2685
- init_config();
2686
- init_github_app();
2687
- init_browser();
2688
- init_execFileNoThrow();
2689
- init_log();
2690
- });
2691
-
2692
- // src/commands/install-github-app/WarningsStep.tsx
2693
- function WarningsStep(t0) {
2694
- const $ = import_compiler_runtime11.c(8);
2695
- const {
2696
- warnings,
2697
- onContinue
2698
- } = t0;
2699
- let t1;
2700
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
2701
- t1 = {
2702
- context: "Confirmation"
2703
- };
2704
- $[0] = t1;
2705
- } else {
2706
- t1 = $[0];
2707
- }
2708
- useKeybinding("confirm:yes", onContinue, t1);
2709
- let t2;
2710
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
2711
- t2 = /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
2712
- flexDirection: "column",
2713
- marginBottom: 1,
2714
- children: [
2715
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2716
- bold: true,
2717
- children: [
2718
- figures_default.warning,
2719
- " Setup Warnings"
2720
- ]
2721
- }, undefined, true, undefined, this),
2722
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2723
- dimColor: true,
2724
- children: "We found some potential issues, but you can continue anyway"
2725
- }, undefined, false, undefined, this)
2726
- ]
2727
- }, undefined, true, undefined, this);
2728
- $[1] = t2;
2729
- } else {
2730
- t2 = $[1];
2731
- }
2732
- let t3;
2733
- if ($[2] !== warnings) {
2734
- t3 = warnings.map(_temp22);
2735
- $[2] = warnings;
2736
- $[3] = t3;
2737
- } else {
2738
- t3 = $[3];
2739
- }
2740
- let t4;
2741
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
2742
- t4 = /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
2743
- marginTop: 1,
2744
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2745
- bold: true,
2746
- color: "permission",
2747
- children: "Press Enter to continue anyway, or Ctrl+C to exit and fix issues"
2748
- }, undefined, false, undefined, this)
2749
- }, undefined, false, undefined, this);
2750
- $[4] = t4;
2751
- } else {
2752
- t4 = $[4];
2753
- }
2754
- let t5;
2755
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
2756
- t5 = /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
2757
- marginTop: 1,
2758
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2759
- dimColor: true,
2760
- children: [
2761
- "You can also try the manual setup steps if needed:",
2762
- " ",
2763
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2764
- color: "claude",
2765
- children: GITHUB_ACTION_SETUP_DOCS_URL
2766
- }, undefined, false, undefined, this)
2767
- ]
2768
- }, undefined, true, undefined, this)
2769
- }, undefined, false, undefined, this);
2770
- $[5] = t5;
2771
- } else {
2772
- t5 = $[5];
2773
- }
2774
- let t6;
2775
- if ($[6] !== t3) {
2776
- t6 = /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
2777
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
2778
- flexDirection: "column",
2779
- borderStyle: "round",
2780
- paddingX: 1,
2781
- children: [
2782
- t2,
2783
- t3,
2784
- t4,
2785
- t5
2786
- ]
2787
- }, undefined, true, undefined, this)
2788
- }, undefined, false, undefined, this);
2789
- $[6] = t3;
2790
- $[7] = t6;
2791
- } else {
2792
- t6 = $[7];
2793
- }
2794
- return t6;
2795
- }
2796
- function _temp22(warning, index) {
2797
- return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
2798
- flexDirection: "column",
2799
- marginBottom: 1,
2800
- children: [
2801
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2802
- color: "warning",
2803
- bold: true,
2804
- children: warning.title
2805
- }, undefined, false, undefined, this),
2806
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2807
- children: warning.message
2808
- }, undefined, false, undefined, this),
2809
- warning.instructions.length > 0 && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
2810
- flexDirection: "column",
2811
- marginLeft: 2,
2812
- marginTop: 1,
2813
- children: warning.instructions.map(_temp3)
2814
- }, undefined, false, undefined, this)
2815
- ]
2816
- }, index, true, undefined, this);
2817
- }
2818
- function _temp3(instruction, i) {
2819
- return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
2820
- dimColor: true,
2821
- children: [
2822
- "\u2022 ",
2823
- instruction
2824
- ]
2825
- }, i, true, undefined, this);
2826
- }
2827
- var import_compiler_runtime11, jsx_dev_runtime12;
2828
- var init_WarningsStep = __esm(() => {
2829
- init_figures();
2830
- init_github_app();
2831
- init_ink();
2832
- init_useKeybinding();
2833
- import_compiler_runtime11 = __toESM(require_compiler_runtime(), 1);
2834
- jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
2835
- });
2836
-
2837
- // src/commands/install-github-app/install-github-app.tsx
2838
- function InstallGitHubApp(props) {
2839
- const [existingApiKey] = import_react6.useState(() => getAnthropicApiKey());
2840
- const [state, setState] = import_react6.useState({
2841
- ...INITIAL_STATE,
2842
- useExistingKey: !!existingApiKey,
2843
- selectedApiKeyOption: existingApiKey ? "existing" : isAnthropicAuthEnabled() ? "oauth" : "new"
2844
- });
2845
- useExitOnCtrlCDWithKeybindings();
2846
- import_react6.default.useEffect(() => {
2847
- logEvent("tengu_install_github_app_started", {});
2848
- }, []);
2849
- const checkGitHubCLI = import_react6.useCallback(async () => {
2850
- const warnings = [];
2851
- const ghVersionResult = await execa("gh --version", {
2852
- shell: true,
2853
- reject: false
2854
- });
2855
- if (ghVersionResult.exitCode !== 0) {
2856
- warnings.push({
2857
- title: "GitHub CLI not found",
2858
- message: "GitHub CLI (gh) does not appear to be installed or accessible.",
2859
- 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"]
2860
- });
2861
- }
2862
- const authResult = await execa("gh auth status -a", {
2863
- shell: true,
2864
- reject: false
2865
- });
2866
- if (authResult.exitCode !== 0) {
2867
- warnings.push({
2868
- title: "GitHub CLI not authenticated",
2869
- message: "GitHub CLI does not appear to be authenticated.",
2870
- instructions: ["Run: gh auth login", "Follow the prompts to authenticate with GitHub", "Or set up authentication using environment variables or other methods"]
2871
- });
2872
- } else {
2873
- const tokenScopesMatch = authResult.stdout.match(/Token scopes:.*$/m);
2874
- if (tokenScopesMatch) {
2875
- const scopes = tokenScopesMatch[0];
2876
- const missingScopes = [];
2877
- if (!scopes.includes("repo")) {
2878
- missingScopes.push("repo");
2879
- }
2880
- if (!scopes.includes("workflow")) {
2881
- missingScopes.push("workflow");
2882
- }
2883
- if (missingScopes.length > 0) {
2884
- setState((prev) => ({
2885
- ...prev,
2886
- step: "error",
2887
- error: `GitHub CLI is missing required permissions: ${missingScopes.join(", ")}.`,
2888
- errorReason: "Missing required scopes",
2889
- 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."]
2890
- }));
2891
- return;
2892
- }
2893
- }
2894
- }
2895
- const currentRepo = await getGithubRepo() ?? "";
2896
- logEvent("tengu_install_github_app_step_completed", {
2897
- step: "check-gh"
2898
- });
2899
- setState((prev_0) => ({
2900
- ...prev_0,
2901
- warnings,
2902
- currentRepo,
2903
- selectedRepoName: currentRepo,
2904
- useCurrentRepo: !!currentRepo,
2905
- step: warnings.length > 0 ? "warnings" : "choose-repo"
2906
- }));
2907
- }, []);
2908
- import_react6.default.useEffect(() => {
2909
- if (state.step === "check-gh") {
2910
- checkGitHubCLI();
2911
- }
2912
- }, [state.step, checkGitHubCLI]);
2913
- const runSetupGitHubActions = import_react6.useCallback(async (apiKeyOrOAuthToken, secretName) => {
2914
- setState((prev_1) => ({
2915
- ...prev_1,
2916
- step: "creating",
2917
- currentWorkflowInstallStep: 0
2918
- }));
2919
- try {
2920
- await setupGitHubActions(state.selectedRepoName, apiKeyOrOAuthToken, secretName, () => {
2921
- setState((prev_4) => ({
2922
- ...prev_4,
2923
- currentWorkflowInstallStep: prev_4.currentWorkflowInstallStep + 1
2924
- }));
2925
- }, state.workflowAction === "skip", state.selectedWorkflows, state.authType, {
2926
- useCurrentRepo: state.useCurrentRepo,
2927
- workflowExists: state.workflowExists,
2928
- secretExists: state.secretExists
2929
- });
2930
- logEvent("tengu_install_github_app_step_completed", {
2931
- step: "creating"
2932
- });
2933
- setState((prev_5) => ({
2934
- ...prev_5,
2935
- step: "success"
2936
- }));
2937
- } catch (error) {
2938
- const errorMessage = error instanceof Error ? error.message : "Failed to set up GitHub Actions";
2939
- if (errorMessage.includes("workflow file already exists")) {
2940
- logEvent("tengu_install_github_app_error", {
2941
- reason: "workflow_file_exists"
2942
- });
2943
- setState((prev_2) => ({
2944
- ...prev_2,
2945
- step: "error",
2946
- error: "A Claude workflow file already exists in this repository.",
2947
- errorReason: "Workflow file conflict",
2948
- 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}`]
2949
- }));
2950
- } else {
2951
- logEvent("tengu_install_github_app_error", {
2952
- reason: "setup_github_actions_failed"
2953
- });
2954
- setState((prev_3) => ({
2955
- ...prev_3,
2956
- step: "error",
2957
- error: errorMessage,
2958
- errorReason: "GitHub Actions setup failed",
2959
- errorInstructions: []
2960
- }));
2961
- }
2962
- }
2963
- }, [state.selectedRepoName, state.workflowAction, state.selectedWorkflows, state.useCurrentRepo, state.workflowExists, state.secretExists, state.authType]);
2964
- async function openGitHubAppInstallation() {
2965
- const installUrl = "https://github.com/apps/claude";
2966
- await openBrowser(installUrl);
2967
- }
2968
- async function checkRepositoryPermissions(repoName) {
2969
- try {
2970
- const result = await execFileNoThrow("gh", ["api", `repos/${repoName}`, "--jq", ".permissions.admin"]);
2971
- if (result.code === 0) {
2972
- const hasAdmin = result.stdout.trim() === "true";
2973
- return {
2974
- hasAccess: hasAdmin
2975
- };
2976
- }
2977
- if (result.stderr.includes("404") || result.stderr.includes("Not Found")) {
2978
- return {
2979
- hasAccess: false,
2980
- error: "repository_not_found"
2981
- };
2982
- }
2983
- return {
2984
- hasAccess: false
2985
- };
2986
- } catch {
2987
- return {
2988
- hasAccess: false
2989
- };
2990
- }
2991
- }
2992
- async function checkExistingWorkflowFile(repoName_0) {
2993
- const checkFileResult = await execFileNoThrow("gh", ["api", `repos/${repoName_0}/contents/.github/workflows/claude.yml`, "--jq", ".sha"]);
2994
- return checkFileResult.code === 0;
2995
- }
2996
- async function checkExistingSecret() {
2997
- const checkSecretsResult = await execFileNoThrow("gh", ["secret", "list", "--app", "actions", "--repo", state.selectedRepoName]);
2998
- if (checkSecretsResult.code === 0) {
2999
- const lines = checkSecretsResult.stdout.split(`
3000
- `);
3001
- const hasAnthropicKey = lines.some((line) => {
3002
- return /^ANTHROPIC_API_KEY\s+/.test(line);
3003
- });
3004
- if (hasAnthropicKey) {
3005
- setState((prev_6) => ({
3006
- ...prev_6,
3007
- secretExists: true,
3008
- step: "check-existing-secret"
3009
- }));
3010
- } else {
3011
- if (existingApiKey) {
3012
- setState((prev_7) => ({
3013
- ...prev_7,
3014
- apiKeyOrOAuthToken: existingApiKey,
3015
- useExistingKey: true
3016
- }));
3017
- await runSetupGitHubActions(existingApiKey, state.secretName);
3018
- } else {
3019
- setState((prev_8) => ({
3020
- ...prev_8,
3021
- step: "api-key"
3022
- }));
3023
- }
3024
- }
3025
- } else {
3026
- if (existingApiKey) {
3027
- setState((prev_9) => ({
3028
- ...prev_9,
3029
- apiKeyOrOAuthToken: existingApiKey,
3030
- useExistingKey: true
3031
- }));
3032
- await runSetupGitHubActions(existingApiKey, state.secretName);
3033
- } else {
3034
- setState((prev_10) => ({
3035
- ...prev_10,
3036
- step: "api-key"
3037
- }));
3038
- }
3039
- }
3040
- }
3041
- const handleSubmit = async () => {
3042
- if (state.step === "warnings") {
3043
- logEvent("tengu_install_github_app_step_completed", {
3044
- step: "warnings"
3045
- });
3046
- setState((prev_11) => ({
3047
- ...prev_11,
3048
- step: "install-app"
3049
- }));
3050
- setTimeout(openGitHubAppInstallation, 0);
3051
- } else if (state.step === "choose-repo") {
3052
- let repoName_1 = state.useCurrentRepo ? state.currentRepo : state.selectedRepoName;
3053
- if (!repoName_1.trim()) {
3054
- return;
3055
- }
3056
- const repoWarnings = [];
3057
- if (repoName_1.includes("github.com")) {
3058
- const match = repoName_1.match(/github\.com[:/]([^/]+\/[^/]+)(\.git)?$/);
3059
- if (!match) {
3060
- repoWarnings.push({
3061
- title: "Invalid GitHub URL format",
3062
- message: "The repository URL format appears to be invalid.",
3063
- instructions: ["Use format: owner/repo or https://github.com/owner/repo", "Example: anthropics/claude-cli"]
3064
- });
3065
- } else {
3066
- repoName_1 = match[1]?.replace(/\.git$/, "") || "";
3067
- }
3068
- }
3069
- if (!repoName_1.includes("/")) {
3070
- repoWarnings.push({
3071
- title: "Repository format warning",
3072
- message: 'Repository should be in format "owner/repo"',
3073
- instructions: ["Use format: owner/repo", "Example: anthropics/claude-cli"]
3074
- });
3075
- }
3076
- const permissionCheck = await checkRepositoryPermissions(repoName_1);
3077
- if (permissionCheck.error === "repository_not_found") {
3078
- repoWarnings.push({
3079
- title: "Repository not found",
3080
- message: `Repository ${repoName_1} was not found or you don't have access.`,
3081
- 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"]
3082
- });
3083
- } else if (!permissionCheck.hasAccess) {
3084
- repoWarnings.push({
3085
- title: "Admin permissions required",
3086
- message: `You might need admin permissions on ${repoName_1} to set up GitHub Actions.`,
3087
- 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"]
3088
- });
3089
- }
3090
- const workflowExists = await checkExistingWorkflowFile(repoName_1);
3091
- if (repoWarnings.length > 0) {
3092
- const allWarnings = [...state.warnings, ...repoWarnings];
3093
- setState((prev_12) => ({
3094
- ...prev_12,
3095
- selectedRepoName: repoName_1,
3096
- workflowExists,
3097
- warnings: allWarnings,
3098
- step: "warnings"
3099
- }));
3100
- } else {
3101
- logEvent("tengu_install_github_app_step_completed", {
3102
- step: "choose-repo"
3103
- });
3104
- setState((prev_13) => ({
3105
- ...prev_13,
3106
- selectedRepoName: repoName_1,
3107
- workflowExists,
3108
- step: "install-app"
3109
- }));
3110
- setTimeout(openGitHubAppInstallation, 0);
3111
- }
3112
- } else if (state.step === "install-app") {
3113
- logEvent("tengu_install_github_app_step_completed", {
3114
- step: "install-app"
3115
- });
3116
- if (state.workflowExists) {
3117
- setState((prev_14) => ({
3118
- ...prev_14,
3119
- step: "check-existing-workflow"
3120
- }));
3121
- } else {
3122
- setState((prev_15) => ({
3123
- ...prev_15,
3124
- step: "select-workflows"
3125
- }));
3126
- }
3127
- } else if (state.step === "check-existing-workflow") {
3128
- return;
3129
- } else if (state.step === "select-workflows") {
3130
- return;
3131
- } else if (state.step === "check-existing-secret") {
3132
- logEvent("tengu_install_github_app_step_completed", {
3133
- step: "check-existing-secret"
3134
- });
3135
- if (state.useExistingSecret) {
3136
- await runSetupGitHubActions(null, state.secretName);
3137
- } else {
3138
- await runSetupGitHubActions(state.apiKeyOrOAuthToken, state.secretName);
3139
- }
3140
- } else if (state.step === "api-key") {
3141
- if (state.selectedApiKeyOption === "oauth") {
3142
- return;
3143
- }
3144
- const apiKeyToUse = state.selectedApiKeyOption === "existing" ? existingApiKey : state.apiKeyOrOAuthToken;
3145
- if (!apiKeyToUse) {
3146
- logEvent("tengu_install_github_app_error", {
3147
- reason: "api_key_missing"
3148
- });
3149
- setState((prev_16) => ({
3150
- ...prev_16,
3151
- step: "error",
3152
- error: "API key is required"
3153
- }));
3154
- return;
3155
- }
3156
- setState((prev_17) => ({
3157
- ...prev_17,
3158
- apiKeyOrOAuthToken: apiKeyToUse,
3159
- useExistingKey: state.selectedApiKeyOption === "existing"
3160
- }));
3161
- const checkSecretsResult_0 = await execFileNoThrow("gh", ["secret", "list", "--app", "actions", "--repo", state.selectedRepoName]);
3162
- if (checkSecretsResult_0.code === 0) {
3163
- const lines_0 = checkSecretsResult_0.stdout.split(`
3164
- `);
3165
- const hasAnthropicKey_0 = lines_0.some((line_0) => {
3166
- return /^ANTHROPIC_API_KEY\s+/.test(line_0);
3167
- });
3168
- if (hasAnthropicKey_0) {
3169
- logEvent("tengu_install_github_app_step_completed", {
3170
- step: "api-key"
3171
- });
3172
- setState((prev_18) => ({
3173
- ...prev_18,
3174
- secretExists: true,
3175
- step: "check-existing-secret"
3176
- }));
3177
- } else {
3178
- logEvent("tengu_install_github_app_step_completed", {
3179
- step: "api-key"
3180
- });
3181
- await runSetupGitHubActions(apiKeyToUse, state.secretName);
3182
- }
3183
- } else {
3184
- logEvent("tengu_install_github_app_step_completed", {
3185
- step: "api-key"
3186
- });
3187
- await runSetupGitHubActions(apiKeyToUse, state.secretName);
3188
- }
3189
- }
3190
- };
3191
- const handleRepoUrlChange = (value) => {
3192
- setState((prev_19) => ({
3193
- ...prev_19,
3194
- selectedRepoName: value
3195
- }));
3196
- };
3197
- const handleApiKeyChange = (value_0) => {
3198
- setState((prev_20) => ({
3199
- ...prev_20,
3200
- apiKeyOrOAuthToken: value_0
3201
- }));
3202
- };
3203
- const handleApiKeyOptionChange = (option) => {
3204
- setState((prev_21) => ({
3205
- ...prev_21,
3206
- selectedApiKeyOption: option
3207
- }));
3208
- };
3209
- const handleCreateOAuthToken = import_react6.useCallback(() => {
3210
- logEvent("tengu_install_github_app_step_completed", {
3211
- step: "api-key"
3212
- });
3213
- setState((prev_22) => ({
3214
- ...prev_22,
3215
- step: "oauth-flow"
3216
- }));
3217
- }, []);
3218
- const handleOAuthSuccess = import_react6.useCallback((token) => {
3219
- logEvent("tengu_install_github_app_step_completed", {
3220
- step: "oauth-flow"
3221
- });
3222
- setState((prev_23) => ({
3223
- ...prev_23,
3224
- apiKeyOrOAuthToken: token,
3225
- useExistingKey: false,
3226
- secretName: "CLAUDE_CODE_OAUTH_TOKEN",
3227
- authType: "oauth_token"
3228
- }));
3229
- runSetupGitHubActions(token, "CLAUDE_CODE_OAUTH_TOKEN");
3230
- }, [runSetupGitHubActions]);
3231
- const handleOAuthCancel = import_react6.useCallback(() => {
3232
- setState((prev_24) => ({
3233
- ...prev_24,
3234
- step: "api-key"
3235
- }));
3236
- }, []);
3237
- const handleSecretNameChange = (value_1) => {
3238
- if (value_1 && !/^[a-zA-Z0-9_]+$/.test(value_1))
3239
- return;
3240
- setState((prev_25) => ({
3241
- ...prev_25,
3242
- secretName: value_1
3243
- }));
3244
- };
3245
- const handleToggleUseCurrentRepo = (useCurrentRepo) => {
3246
- setState((prev_26) => ({
3247
- ...prev_26,
3248
- useCurrentRepo,
3249
- selectedRepoName: useCurrentRepo ? prev_26.currentRepo : ""
3250
- }));
3251
- };
3252
- const handleToggleUseExistingKey = (useExistingKey) => {
3253
- setState((prev_27) => ({
3254
- ...prev_27,
3255
- useExistingKey
3256
- }));
3257
- };
3258
- const handleToggleUseExistingSecret = (useExistingSecret) => {
3259
- setState((prev_28) => ({
3260
- ...prev_28,
3261
- useExistingSecret,
3262
- secretName: useExistingSecret ? "ANTHROPIC_API_KEY" : ""
3263
- }));
3264
- };
3265
- const handleWorkflowAction = async (action) => {
3266
- if (action === "exit") {
3267
- props.onDone("Installation cancelled by user");
3268
- return;
3269
- }
3270
- logEvent("tengu_install_github_app_step_completed", {
3271
- step: "check-existing-workflow"
3272
- });
3273
- setState((prev_29) => ({
3274
- ...prev_29,
3275
- workflowAction: action
3276
- }));
3277
- if (action === "skip" || action === "update") {
3278
- if (existingApiKey) {
3279
- await checkExistingSecret();
3280
- } else {
3281
- setState((prev_30) => ({
3282
- ...prev_30,
3283
- step: "api-key"
3284
- }));
3285
- }
3286
- }
3287
- };
3288
- function handleDismissKeyDown(e) {
3289
- e.preventDefault();
3290
- if (state.step === "success") {
3291
- logEvent("tengu_install_github_app_completed", {});
3292
- }
3293
- props.onDone(state.step === "success" ? "GitHub Actions setup complete!" : state.error ? `Couldn't install GitHub App: ${state.error}
3294
- For manual setup instructions, see: ${GITHUB_ACTION_SETUP_DOCS_URL}` : `GitHub App installation failed
3295
- For manual setup instructions, see: ${GITHUB_ACTION_SETUP_DOCS_URL}`);
3296
- }
3297
- switch (state.step) {
3298
- case "check-gh":
3299
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(CheckGitHubStep, {}, undefined, false, undefined, this);
3300
- case "warnings":
3301
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(WarningsStep, {
3302
- warnings: state.warnings,
3303
- onContinue: handleSubmit
3304
- }, undefined, false, undefined, this);
3305
- case "choose-repo":
3306
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ChooseRepoStep, {
3307
- currentRepo: state.currentRepo,
3308
- useCurrentRepo: state.useCurrentRepo,
3309
- repoUrl: state.selectedRepoName,
3310
- onRepoUrlChange: handleRepoUrlChange,
3311
- onToggleUseCurrentRepo: handleToggleUseCurrentRepo,
3312
- onSubmit: handleSubmit
3313
- }, undefined, false, undefined, this);
3314
- case "install-app":
3315
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(InstallAppStep, {
3316
- repoUrl: state.selectedRepoName,
3317
- onSubmit: handleSubmit
3318
- }, undefined, false, undefined, this);
3319
- case "check-existing-workflow":
3320
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ExistingWorkflowStep, {
3321
- repoName: state.selectedRepoName,
3322
- onSelectAction: handleWorkflowAction
3323
- }, undefined, false, undefined, this);
3324
- case "check-existing-secret":
3325
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(CheckExistingSecretStep, {
3326
- useExistingSecret: state.useExistingSecret,
3327
- secretName: state.secretName,
3328
- onToggleUseExistingSecret: handleToggleUseExistingSecret,
3329
- onSecretNameChange: handleSecretNameChange,
3330
- onSubmit: handleSubmit
3331
- }, undefined, false, undefined, this);
3332
- case "api-key":
3333
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ApiKeyStep, {
3334
- existingApiKey,
3335
- useExistingKey: state.useExistingKey,
3336
- apiKeyOrOAuthToken: state.apiKeyOrOAuthToken,
3337
- onApiKeyChange: handleApiKeyChange,
3338
- onToggleUseExistingKey: handleToggleUseExistingKey,
3339
- onSubmit: handleSubmit,
3340
- onCreateOAuthToken: isAnthropicAuthEnabled() ? handleCreateOAuthToken : undefined,
3341
- selectedOption: state.selectedApiKeyOption,
3342
- onSelectOption: handleApiKeyOptionChange
3343
- }, undefined, false, undefined, this);
3344
- case "creating":
3345
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(CreatingStep, {
3346
- currentWorkflowInstallStep: state.currentWorkflowInstallStep,
3347
- secretExists: state.secretExists,
3348
- useExistingSecret: state.useExistingSecret,
3349
- secretName: state.secretName,
3350
- skipWorkflow: state.workflowAction === "skip",
3351
- selectedWorkflows: state.selectedWorkflows
3352
- }, undefined, false, undefined, this);
3353
- case "success":
3354
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
3355
- tabIndex: 0,
3356
- autoFocus: true,
3357
- onKeyDown: handleDismissKeyDown,
3358
- children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(SuccessStep, {
3359
- secretExists: state.secretExists,
3360
- useExistingSecret: state.useExistingSecret,
3361
- secretName: state.secretName,
3362
- skipWorkflow: state.workflowAction === "skip"
3363
- }, undefined, false, undefined, this)
3364
- }, undefined, false, undefined, this);
3365
- case "error":
3366
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
3367
- tabIndex: 0,
3368
- autoFocus: true,
3369
- onKeyDown: handleDismissKeyDown,
3370
- children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ErrorStep, {
3371
- error: state.error,
3372
- errorReason: state.errorReason,
3373
- errorInstructions: state.errorInstructions
3374
- }, undefined, false, undefined, this)
3375
- }, undefined, false, undefined, this);
3376
- case "select-workflows":
3377
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(WorkflowMultiselectDialog, {
3378
- defaultSelections: state.selectedWorkflows,
3379
- onSubmit: (selectedWorkflows) => {
3380
- logEvent("tengu_install_github_app_step_completed", {
3381
- step: "select-workflows"
3382
- });
3383
- setState((prev_31) => ({
3384
- ...prev_31,
3385
- selectedWorkflows
3386
- }));
3387
- if (existingApiKey) {
3388
- checkExistingSecret();
3389
- } else {
3390
- setState((prev_32) => ({
3391
- ...prev_32,
3392
- step: "api-key"
3393
- }));
3394
- }
3395
- }
3396
- }, undefined, false, undefined, this);
3397
- case "oauth-flow":
3398
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(OAuthFlowStep, {
3399
- onSuccess: handleOAuthSuccess,
3400
- onCancel: handleOAuthCancel
3401
- }, undefined, false, undefined, this);
3402
- }
3403
- }
3404
- async function call(onDone) {
3405
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(InstallGitHubApp, {
3406
- onDone
3407
- }, undefined, false, undefined, this);
3408
- }
3409
- var import_react6, jsx_dev_runtime13, INITIAL_STATE;
3410
- var init_install_github_app = __esm(() => {
3411
- init_execa();
3412
- init_analytics();
3413
- init_WorkflowMultiselectDialog();
3414
- init_github_app();
3415
- init_useExitOnCtrlCDWithKeybindings();
3416
- init_ink();
3417
- init_auth();
3418
- init_browser();
3419
- init_execFileNoThrow();
3420
- init_git();
3421
- init_stringUtils();
3422
- init_ApiKeyStep();
3423
- init_CheckExistingSecretStep();
3424
- init_CheckGitHubStep();
3425
- init_ChooseRepoStep();
3426
- init_CreatingStep();
3427
- init_ErrorStep();
3428
- init_ExistingWorkflowStep();
3429
- init_InstallAppStep();
3430
- init_OAuthFlowStep();
3431
- init_SuccessStep();
3432
- init_setupGitHubActions();
3433
- init_WarningsStep();
3434
- import_react6 = __toESM(require_react(), 1);
3435
- jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
3436
- INITIAL_STATE = {
3437
- step: "check-gh",
3438
- selectedRepoName: "",
3439
- currentRepo: "",
3440
- useCurrentRepo: false,
3441
- apiKeyOrOAuthToken: "",
3442
- useExistingKey: true,
3443
- currentWorkflowInstallStep: 0,
3444
- warnings: [],
3445
- secretExists: false,
3446
- secretName: "ANTHROPIC_API_KEY",
3447
- useExistingSecret: true,
3448
- workflowExists: false,
3449
- selectedWorkflows: ["claude", "claude-review"],
3450
- selectedApiKeyOption: "new",
3451
- authType: "api_key"
3452
- };
3453
- });
3454
- init_install_github_app();
3455
-
3456
- export {
3457
- call
3458
- };