@costrict/csc 4.0.1

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