@caspian2026/agent-sdk 0.0.18 → 0.0.19
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.
- package/dist/{chunk-frnaaxw8.js → chunk-0075f5sb.js} +4 -4
- package/dist/{chunk-0vz3p22g.js → chunk-03jc62cq.js} +37 -37
- package/dist/{chunk-b66hjndz.js → chunk-0e495v4y.js} +37 -37
- package/dist/{chunk-sqq17sk1.js → chunk-0n4n14c1.js} +16 -16
- package/dist/{chunk-y6ktw609.js → chunk-0r04e4ap.js} +3 -3
- package/dist/{chunk-2avrzsjc.js → chunk-0r5bb9j4.js} +3 -3
- package/dist/{chunk-aejj9p9y.js → chunk-0rs4m3ya.js} +2 -2
- package/dist/{chunk-657y059h.js → chunk-0t81d427.js} +7 -7
- package/dist/{chunk-7ekgfz41.js → chunk-0zprysa2.js} +37 -37
- package/dist/{chunk-a7gk9w5h.js → chunk-110c7hek.js} +2 -2
- package/dist/{chunk-2tm611h9.js → chunk-1ae3nt9j.js} +2 -2
- package/dist/{chunk-asenzcq2.js → chunk-1cpeddhv.js} +3 -3
- package/dist/{chunk-fbfjz4mv.js → chunk-1e1rjstz.js} +37 -37
- package/dist/{chunk-afbvx9ey.js → chunk-1fb0jqty.js} +40 -40
- package/dist/{chunk-d1m96xhv.js → chunk-1hg8ktay.js} +38 -38
- package/dist/{chunk-43rp9zbk.js → chunk-1j0n05rf.js} +2 -2
- package/dist/{chunk-hm185n1k.js → chunk-1pjgxfeq.js} +37 -37
- package/dist/{chunk-sd8209pb.js → chunk-1ts9qapj.js} +8 -88
- package/dist/{chunk-96523fnw.js → chunk-1vyfr81c.js} +1 -1
- package/dist/{chunk-9t6ktd1k.js → chunk-21jaw3mt.js} +3 -3
- package/dist/{chunk-mbz52548.js → chunk-2e8ybf05.js} +12 -12
- package/dist/{chunk-3b2t95m2.js → chunk-2ewarpza.js} +38 -38
- package/dist/{chunk-07nc7v02.js → chunk-2tb0e476.js} +49 -49
- package/dist/{chunk-qt5e2evw.js → chunk-2vj1ta7d.js} +37 -37
- package/dist/{chunk-kgk4p214.js → chunk-302xme7e.js} +77 -77
- package/dist/{chunk-fryfy1ac.js → chunk-36akc07b.js} +1 -1
- package/dist/{chunk-fhwnqkps.js → chunk-3dx4h9pq.js} +38 -38
- package/dist/{chunk-c7c3t5kg.js → chunk-3f2ryn4p.js} +6 -6
- package/dist/{chunk-ytw7cet7.js → chunk-3jh2z27c.js} +37 -37
- package/dist/{chunk-xycbvwy2.js → chunk-3jp8zgek.js} +1 -1
- package/dist/{chunk-gt5qmg5w.js → chunk-3kf30xba.js} +40 -40
- package/dist/{chunk-fkttqetc.js → chunk-3t2pkmek.js} +12 -12
- package/dist/{chunk-x66axbfx.js → chunk-3t7kecay.js} +41 -41
- package/dist/{chunk-kd5k97vr.js → chunk-3vy1jt9p.js} +6 -24
- package/dist/{chunk-6sdx75d8.js → chunk-40gj4vgn.js} +4 -4
- package/dist/{chunk-5zqatqff.js → chunk-4ce75svs.js} +6 -6
- package/dist/{chunk-gq4ptzy4.js → chunk-4e708nwk.js} +13 -13
- package/dist/{chunk-jbv0d2xg.js → chunk-4k9d7gxv.js} +1 -1
- package/dist/{chunk-qsxj0kfc.js → chunk-4wx02mba.js} +4 -4
- package/dist/{chunk-2zf2y9xh.js → chunk-4xwfsejb.js} +3 -3
- package/dist/{chunk-sm9q19ws.js → chunk-5bs3xf11.js} +37 -37
- package/dist/{chunk-e86wz4cn.js → chunk-5c980jax.js} +13 -13
- package/dist/{chunk-0a8mnxpe.js → chunk-5cj7yfg1.js} +43 -47
- package/dist/{chunk-1a5w7wdt.js → chunk-5ekyhb1w.js} +3 -3
- package/dist/{chunk-bxd7dzz4.js → chunk-5gjwp5bc.js} +49 -49
- package/dist/{chunk-p4k5pzge.js → chunk-5h1wfdk2.js} +16 -22
- package/dist/{chunk-2apvtmkd.js → chunk-5h4berfm.js} +6 -6
- package/dist/{chunk-hqdwr6mz.js → chunk-5h5kx2jd.js} +1 -1
- package/dist/{chunk-nsc89h0n.js → chunk-5n1jc02d.js} +1 -7
- package/dist/{chunk-84hebfv5.js → chunk-5xkp0tnb.js} +45 -45
- package/dist/{chunk-9an46bhy.js → chunk-64r16v22.js} +1 -1
- package/dist/{chunk-yd5sv0na.js → chunk-65j4q40b.js} +38 -38
- package/dist/{chunk-kwkcmv5p.js → chunk-670trxyg.js} +12 -12
- package/dist/{chunk-cfvgegjj.js → chunk-6dngjwkh.js} +2 -2
- package/dist/{chunk-5vzqvgea.js → chunk-6fes9049.js} +8 -8
- package/dist/{chunk-p620jjt8.js → chunk-6g0hnb1k.js} +37 -37
- package/dist/{chunk-175v9c0j.js → chunk-6mqmk16a.js} +37 -37
- package/dist/{chunk-djna15b0.js → chunk-6rvr3wwq.js} +18 -18
- package/dist/{chunk-v786pxdf.js → chunk-6s68m1dg.js} +4 -4
- package/dist/{chunk-1e7a4d58.js → chunk-7d24zw5w.js} +37 -37
- package/dist/{chunk-dd3fkytw.js → chunk-7eb2qp91.js} +40 -40
- package/dist/{chunk-2jyvw1vd.js → chunk-7hfzfe98.js} +1 -1
- package/dist/{chunk-3cmhd7fz.js → chunk-7m3a6kb8.js} +37 -37
- package/dist/{chunk-hxavvf2h.js → chunk-7n6tk7rw.js} +35 -329
- package/dist/{chunk-q9pw9pca.js → chunk-7s3g2nbw.js} +4 -4
- package/dist/{chunk-hd6rkyjg.js → chunk-7wg82yq4.js} +91 -91
- package/dist/{chunk-ksrvrndt.js → chunk-7yp1ra14.js} +6 -6
- package/dist/{chunk-v4dh4hcd.js → chunk-844zmnw6.js} +37 -37
- package/dist/{chunk-2jzpw1pf.js → chunk-8457y05z.js} +16 -16
- package/dist/{chunk-yt3s7a7d.js → chunk-89vrm4ae.js} +5 -5
- package/dist/{chunk-9d13k3m6.js → chunk-8bxm9bv1.js} +40 -40
- package/dist/{chunk-5hnhres8.js → chunk-8svj497n.js} +13 -13
- package/dist/{chunk-2nya3j5t.js → chunk-8yhf030a.js} +1 -1
- package/dist/{chunk-5dpys8tw.js → chunk-9ed7v1qq.js} +37 -37
- package/dist/{chunk-pxqvh94k.js → chunk-9hd3p970.js} +38 -38
- package/dist/{chunk-x43vg58b.js → chunk-a1gwg4fx.js} +14 -14
- package/dist/{chunk-vdagxf3w.js → chunk-a1s9n17m.js} +5 -5
- package/dist/{chunk-qmaadr70.js → chunk-a2hq2yt9.js} +5 -5
- package/dist/{chunk-tbhsqgh4.js → chunk-a2v77s0p.js} +2 -2
- package/dist/{chunk-g7qtsqk8.js → chunk-a5cj5yk1.js} +1 -1
- package/dist/{chunk-wvxaaw85.js → chunk-a5ry85ct.js} +3 -3
- package/dist/{chunk-7bz03dax.js → chunk-a6328ts5.js} +2 -2
- package/dist/{chunk-3g03wcny.js → chunk-adtgferq.js} +37 -37
- package/dist/{chunk-485en4m4.js → chunk-ahxpxdqg.js} +38 -38
- package/dist/{chunk-df4rn6zx.js → chunk-ajrrg4t1.js} +40 -40
- package/dist/{chunk-6p6mwfc8.js → chunk-arhmkw0v.js} +37 -37
- package/dist/{chunk-xqa13w46.js → chunk-b3q5g3x5.js} +1 -1
- package/dist/{chunk-xrtkg6a5.js → chunk-b9t57m67.js} +4 -4
- package/dist/{chunk-jtwdv23y.js → chunk-bamjc1k5.js} +3 -3
- package/dist/{chunk-7p9xptww.js → chunk-bbc9f5q9.js} +8 -8
- package/dist/{chunk-39dpcr2t.js → chunk-bdb81673.js} +5 -5
- package/dist/{chunk-eyys9mkd.js → chunk-bh5zqvyc.js} +9 -9
- package/dist/{chunk-vkaz7qe2.js → chunk-bjwdqabf.js} +45 -45
- package/dist/{chunk-hc158qrt.js → chunk-bpkpy613.js} +15 -15
- package/dist/{chunk-h6bgcfma.js → chunk-brjd9zmk.js} +4 -4
- package/dist/{chunk-98hsxvwg.js → chunk-brqy29g9.js} +42 -42
- package/dist/{chunk-sactn8fj.js → chunk-by2e46kd.js} +40 -40
- package/dist/{chunk-db92x7yq.js → chunk-byfawrfx.js} +2 -2
- package/dist/{chunk-9gn2ft16.js → chunk-c073acgz.js} +6 -6
- package/dist/{chunk-fq5vhqx0.js → chunk-c0vhnnct.js} +37 -37
- package/dist/{chunk-n4022dzr.js → chunk-c2nnhgr2.js} +2 -2
- package/dist/{chunk-je14p1p5.js → chunk-c33r7wby.js} +1 -1
- package/dist/{chunk-h3rtwnzt.js → chunk-cdef9v7b.js} +3 -3
- package/dist/{chunk-fys33rtr.js → chunk-cxrktb5g.js} +1 -1
- package/dist/{chunk-qk9hhrzj.js → chunk-czsjnagp.js} +45 -45
- package/dist/{chunk-9pnc5v9y.js → chunk-d4q90j1w.js} +37 -37
- package/dist/{chunk-ztc0wy8h.js → chunk-d564dtpq.js} +46 -46
- package/dist/{chunk-vkcqcmdv.js → chunk-d5eckc42.js} +4 -4
- package/dist/{chunk-5mxbpsb4.js → chunk-d6eym4sa.js} +38 -38
- package/dist/{chunk-wqdfck13.js → chunk-d9e7ndag.js} +18 -18
- package/dist/{chunk-gtn3b2xr.js → chunk-dfszv6kn.js} +3 -3
- package/dist/{chunk-qhsd552n.js → chunk-dfzkwynj.js} +4 -4
- package/dist/{chunk-rh5v7hf7.js → chunk-dhfag5m0.js} +3 -3
- package/dist/{chunk-gq2ty76e.js → chunk-dmahh26f.js} +1 -1
- package/dist/{chunk-t5b0h3vc.js → chunk-dn00fcy7.js} +13 -13
- package/dist/{chunk-4fvbhs6s.js → chunk-dnb45dhp.js} +37 -37
- package/dist/{chunk-b8zcqbbd.js → chunk-drqk484j.js} +3 -3
- package/dist/{chunk-2h6f45jx.js → chunk-e0abab5b.js} +3 -3
- package/dist/{chunk-ht2vfyw7.js → chunk-e2nwdr09.js} +39 -39
- package/dist/{chunk-510y033v.js → chunk-e4vx828d.js} +39 -39
- package/dist/{chunk-c2he84t1.js → chunk-e83tfqyt.js} +2 -2
- package/dist/{chunk-vtxskzvg.js → chunk-e8s2e141.js} +4 -4
- package/dist/{chunk-qd5n2h9f.js → chunk-e9w9zc0g.js} +6 -6
- package/dist/{chunk-hf0q1g1n.js → chunk-eady4fzn.js} +4 -4
- package/dist/{chunk-51pjmydp.js → chunk-eert2day.js} +7 -7
- package/dist/{chunk-c5hr98qm.js → chunk-eqj42wkk.js} +39 -39
- package/dist/{chunk-xf4d0bmf.js → chunk-f0eqte4j.js} +37 -37
- package/dist/{chunk-6xe15dps.js → chunk-f3ychkjd.js} +2 -2
- package/dist/{chunk-0m45arzy.js → chunk-f6xzr8q2.js} +37 -37
- package/dist/{chunk-tmjt0nae.js → chunk-f84vvk41.js} +1 -1
- package/dist/{chunk-j1y56wgn.js → chunk-f98yad99.js} +4 -4
- package/dist/{chunk-6gjke1xd.js → chunk-f9wnty9x.js} +2 -2
- package/dist/{chunk-a4vds27m.js → chunk-fcynwjpm.js} +1 -1
- package/dist/{chunk-a4x613vq.js → chunk-fkr3tfcs.js} +4 -4
- package/dist/{chunk-bwtw1cbj.js → chunk-fqak69ft.js} +2 -2
- package/dist/{chunk-q41bvf6v.js → chunk-ft4dxnwq.js} +1 -1
- package/dist/{chunk-aejyn03k.js → chunk-fvm8gehr.js} +4 -4
- package/dist/{chunk-gnhr6m0v.js → chunk-g0x0gksg.js} +38 -38
- package/dist/{chunk-yb6xww2x.js → chunk-gg55fns0.js} +1 -1
- package/dist/{chunk-s9dazft8.js → chunk-ggg97179.js} +37 -37
- package/dist/{chunk-2jdbfhb2.js → chunk-gmdt7w5d.js} +8 -8
- package/dist/{chunk-7ep76qfm.js → chunk-gw9291xk.js} +15 -15
- package/dist/{chunk-tzfd1egv.js → chunk-gy4se0z5.js} +38 -38
- package/dist/{chunk-eszdke28.js → chunk-gz1e8y1w.js} +6 -6
- package/dist/{chunk-2671jfzz.js → chunk-hav5hw2k.js} +37 -37
- package/dist/{chunk-0m6r5xry.js → chunk-hca6b2e5.js} +39 -39
- package/dist/{chunk-3fhrs3qm.js → chunk-hgdxffqr.js} +2 -2
- package/dist/{chunk-5xt8w19j.js → chunk-hnwg3k83.js} +1 -1
- package/dist/{chunk-3ecxxh0v.js → chunk-hpd100ja.js} +42 -42
- package/dist/{chunk-0fjwyhtj.js → chunk-hr9c2w99.js} +6 -6
- package/dist/{chunk-gfvab3pt.js → chunk-hszdxe8f.js} +39 -39
- package/dist/{chunk-27west95.js → chunk-hz31bs21.js} +14 -14
- package/dist/{chunk-wp3ryedc.js → chunk-j03zh8dy.js} +38 -38
- package/dist/{chunk-72na7rqk.js → chunk-jqn60wdn.js} +10 -10
- package/dist/{chunk-jch08yr8.js → chunk-k2p273gs.js} +39 -39
- package/dist/{chunk-4v6h9fhy.js → chunk-k6bpr2zz.js} +37 -37
- package/dist/{chunk-9k9th7xv.js → chunk-k737m0z6.js} +38 -38
- package/dist/{chunk-ckg9f3bq.js → chunk-kc8am0nn.js} +37 -37
- package/dist/chunk-kde61fqf.js +148 -0
- package/dist/{chunk-24s7fatk.js → chunk-knbjqnc7.js} +13 -13
- package/dist/{chunk-a7fqavjt.js → chunk-ksq6zjys.js} +2 -2
- package/dist/{chunk-g6xtx9ad.js → chunk-kwp6116t.js} +39 -39
- package/dist/{chunk-etnkcek5.js → chunk-ky1z78ve.js} +4 -4
- package/dist/{chunk-8sxpmxaj.js → chunk-m2yqqry6.js} +124 -124
- package/dist/{chunk-av6sfjhb.js → chunk-m626yecd.js} +38 -38
- package/dist/{chunk-85hp74zz.js → chunk-m86p6rs2.js} +49 -49
- package/dist/{chunk-fhej4f56.js → chunk-m8wxbjg3.js} +5 -5
- package/dist/{chunk-1h6cfybr.js → chunk-mccjtnrw.js} +6 -6
- package/dist/{chunk-ymxwas49.js → chunk-mq451b1k.js} +46 -46
- package/dist/{chunk-57qr194r.js → chunk-mys37bb4.js} +37 -37
- package/dist/{chunk-gp605hkw.js → chunk-nc0ve25x.js} +4 -4
- package/dist/{chunk-7xee389k.js → chunk-nc7kjfxk.js} +37 -37
- package/dist/{chunk-5vp228m5.js → chunk-ngc2r6jc.js} +1 -1
- package/dist/{chunk-h8e89948.js → chunk-nmgj86tt.js} +5 -5
- package/dist/{chunk-14xjyt14.js → chunk-nsbtda9y.js} +20 -20
- package/dist/{chunk-xe47nxbq.js → chunk-ntztbz5t.js} +37 -37
- package/dist/{chunk-e0pv7mxq.js → chunk-nzdz8raj.js} +37 -37
- package/dist/{chunk-zpnrabf3.js → chunk-p1sn36ax.js} +4 -4
- package/dist/{chunk-96thjkqe.js → chunk-p81gg65v.js} +1166 -2108
- package/dist/{chunk-f5f76rs0.js → chunk-pd0yqtm8.js} +49 -49
- package/dist/{chunk-agfhxmaa.js → chunk-pe3rkfp2.js} +5 -5
- package/dist/{chunk-j1jcmemq.js → chunk-pgs47kqs.js} +37 -37
- package/dist/{chunk-j7ptfetg.js → chunk-pgtnj1mt.js} +2 -2
- package/dist/{chunk-5j8md8dg.js → chunk-py5ytxp4.js} +3 -3
- package/dist/{chunk-ckx8wtr1.js → chunk-py7pm42n.js} +15 -15
- package/dist/{chunk-6rhzfq66.js → chunk-pywnxth6.js} +11 -11
- package/dist/{chunk-vgn0fyes.js → chunk-pzxz2an7.js} +38 -38
- package/dist/{chunk-qjr6jsys.js → chunk-q0kafg58.js} +37 -37
- package/dist/{chunk-grbjajg5.js → chunk-q3w82drt.js} +3 -3
- package/dist/{chunk-dapz0pb2.js → chunk-q9t2n7d1.js} +38 -38
- package/dist/{chunk-mn96ajge.js → chunk-qatqd4rk.js} +5 -5
- package/dist/{chunk-7v42bsr9.js → chunk-qh5p43j4.js} +2 -2
- package/dist/{chunk-83pxcp3r.js → chunk-qpaeatmf.js} +37 -37
- package/dist/{chunk-8y55mc4q.js → chunk-qs3g8f9e.js} +3 -3
- package/dist/{chunk-ch53xex6.js → chunk-qwa7xy95.js} +37 -37
- package/dist/{chunk-dsd0v5za.js → chunk-qzf23s30.js} +3 -3
- package/dist/{chunk-d348dy5e.js → chunk-readr4t2.js} +39 -39
- package/dist/{chunk-grd58s24.js → chunk-rjsfkzty.js} +4 -4
- package/dist/{chunk-45fm4zby.js → chunk-rmbbmd3s.js} +2 -2
- package/dist/{chunk-svx8h8tt.js → chunk-rn7w9k0a.js} +15 -15
- package/dist/{chunk-wd531rah.js → chunk-rnajq3vk.js} +38 -38
- package/dist/{chunk-ejjp1fy1.js → chunk-rnxctq9p.js} +2 -2
- package/dist/{chunk-b71fc01f.js → chunk-rs4yayw6.js} +1 -1
- package/dist/{chunk-dg5g4rx6.js → chunk-rshp5b43.js} +3 -3
- package/dist/{chunk-rgk6mfwe.js → chunk-rtbar3a1.js} +37 -37
- package/dist/{chunk-c54cp070.js → chunk-rtbrh4ac.js} +43 -43
- package/dist/{chunk-865gwyhc.js → chunk-s6cxke3j.js} +38 -38
- package/dist/{chunk-hp00gn9k.js → chunk-s7x8ajv3.js} +6 -6
- package/dist/{chunk-c25z9zmd.js → chunk-s8gy4ky9.js} +1 -1
- package/dist/{chunk-vfszgkkq.js → chunk-sa1pvh58.js} +38 -38
- package/dist/{chunk-6w51dnv1.js → chunk-sgpmpn90.js} +3 -3
- package/dist/{chunk-xxahhkz2.js → chunk-sh02d2qn.js} +8 -8
- package/dist/{chunk-s43qhc1v.js → chunk-sqckd5nx.js} +38 -38
- package/dist/{chunk-efr7hp9d.js → chunk-srkc8pwp.js} +2 -2
- package/dist/{chunk-3b8bwc0r.js → chunk-t04tpqda.js} +38 -38
- package/dist/{chunk-aj428gay.js → chunk-t300xs2e.js} +7 -7
- package/dist/{chunk-h5kqbyza.js → chunk-t3se5crr.js} +38 -38
- package/dist/{chunk-a6d2q415.js → chunk-t4khqff1.js} +2 -2
- package/dist/{chunk-xs6my1r1.js → chunk-t5jqejqk.js} +47 -47
- package/dist/{chunk-8p1zdkhr.js → chunk-txn11vtv.js} +2 -2
- package/dist/{chunk-n8780srz.js → chunk-tz9r44d9.js} +37 -38
- package/dist/{chunk-zthjz9rz.js → chunk-v311af96.js} +41 -41
- package/dist/{chunk-a9jh9m0x.js → chunk-v4162e76.js} +4 -4
- package/dist/{chunk-zx09tq9a.js → chunk-v6qvcajp.js} +1 -1
- package/dist/{chunk-2k3y6fnp.js → chunk-v8kjswxt.js} +1 -1
- package/dist/{chunk-bpa7mm4n.js → chunk-v8twrmnw.js} +46 -46
- package/dist/{chunk-wpegnpmd.js → chunk-vc12yftf.js} +2 -2
- package/dist/{chunk-sq32fw07.js → chunk-vffwxpad.js} +40 -40
- package/dist/{chunk-634c89zh.js → chunk-vj9segre.js} +12 -12
- package/dist/{chunk-w28t9jy7.js → chunk-vkhrrvfq.js} +1 -1
- package/dist/{chunk-t0fqphva.js → chunk-vtjgsgyf.js} +37 -37
- package/dist/{chunk-wrtabh03.js → chunk-w022zpyz.js} +13 -13
- package/dist/{chunk-r9fbv9wd.js → chunk-w28zrffk.js} +46 -46
- package/dist/{chunk-gapsz2hr.js → chunk-w2qjc4dy.js} +4 -4
- package/dist/{chunk-cg185b3s.js → chunk-w328d3yn.js} +17 -17
- package/dist/{chunk-6e84jw8j.js → chunk-w6m6trzq.js} +2 -2
- package/dist/{chunk-fdhbpqkt.js → chunk-wc67aegv.js} +1 -1
- package/dist/{chunk-6vrbnjz8.js → chunk-wn3zb71r.js} +38 -38
- package/dist/{chunk-87xg6yb4.js → chunk-x47h283a.js} +1 -1
- package/dist/{chunk-jnqvh4rm.js → chunk-xk89d6vy.js} +7 -7
- package/dist/{chunk-we205f8x.js → chunk-xq0q4bky.js} +4 -4
- package/dist/{chunk-amkyhs41.js → chunk-xrb6mn8j.js} +39 -39
- package/dist/{chunk-e8xjcdk1.js → chunk-xtanrzac.js} +11 -11
- package/dist/{chunk-zkyqgt3m.js → chunk-y6x9kgba.js} +4 -4
- package/dist/{chunk-kpr0q6sr.js → chunk-y9bhjjdz.js} +2 -2
- package/dist/{chunk-ng3tkgf2.js → chunk-ypsecc1v.js} +38 -38
- package/dist/{chunk-c01dn3n0.js → chunk-yrr23vr1.js} +13 -13
- package/dist/{chunk-ap1wxeh4.js → chunk-yvvgfb9f.js} +38 -38
- package/dist/{chunk-egme4m15.js → chunk-ywhmg8xp.js} +6 -6
- package/dist/{chunk-eeag0gpw.js → chunk-z0pmdn8s.js} +2 -2
- package/dist/{chunk-0z7km4rh.js → chunk-z2npjf0h.js} +63 -65
- package/dist/{chunk-mjgzpvks.js → chunk-zt86q6j5.js} +38 -38
- package/dist/{chunk-dwyaks7s.js → chunk-zxh62ved.js} +1 -1
- package/dist/cli.js +7 -7
- package/dist/gateway/worker.js +5644 -8987
- package/package.json +1 -1
- package/dist/chunk-405v2pq2.js +0 -2186
- package/dist/chunk-rnmravvv.js +0 -148
package/dist/chunk-405v2pq2.js
DELETED
|
@@ -1,2186 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
ConfigurableShortcutHint,
|
|
4
|
-
Select,
|
|
5
|
-
SelectMulti,
|
|
6
|
-
TextInput,
|
|
7
|
-
init_ConfigurableShortcutHint,
|
|
8
|
-
init_CustomSelect,
|
|
9
|
-
init_SelectMulti,
|
|
10
|
-
init_TextInput,
|
|
11
|
-
init_useTerminalSize
|
|
12
|
-
} from "./chunk-96thjkqe.js";
|
|
13
|
-
import"./chunk-mcws22k3.js";
|
|
14
|
-
import"./chunk-jzthz1bx.js";
|
|
15
|
-
import"./chunk-aejj9p9y.js";
|
|
16
|
-
import"./chunk-hwfknpxv.js";
|
|
17
|
-
import"./chunk-1gx78081.js";
|
|
18
|
-
import"./chunk-ehtwnxpg.js";
|
|
19
|
-
import"./chunk-y6ktw609.js";
|
|
20
|
-
import"./chunk-vtxskzvg.js";
|
|
21
|
-
import"./chunk-87xg6yb4.js";
|
|
22
|
-
import"./chunk-ksrvrndt.js";
|
|
23
|
-
import"./chunk-2gzv8nrw.js";
|
|
24
|
-
import"./chunk-2h6f45jx.js";
|
|
25
|
-
import"./chunk-cgfdkzhb.js";
|
|
26
|
-
import {
|
|
27
|
-
init_useExitOnCtrlCDWithKeybindings,
|
|
28
|
-
useExitOnCtrlCDWithKeybindings
|
|
29
|
-
} from "./chunk-jbv0d2xg.js";
|
|
30
|
-
import"./chunk-j5bth84e.js";
|
|
31
|
-
import"./chunk-mn96ajge.js";
|
|
32
|
-
import"./chunk-ps49ymvj.js";
|
|
33
|
-
import {
|
|
34
|
-
init_useKeybinding
|
|
35
|
-
} from "./chunk-68ffk5qa.js";
|
|
36
|
-
import"./chunk-a9jh9m0x.js";
|
|
37
|
-
import"./chunk-1h6cfybr.js";
|
|
38
|
-
import"./chunk-j7ptfetg.js";
|
|
39
|
-
import"./chunk-q41bvf6v.js";
|
|
40
|
-
import"./chunk-p7vkh4wx.js";
|
|
41
|
-
import"./chunk-kpr0q6sr.js";
|
|
42
|
-
import"./chunk-39dpcr2t.js";
|
|
43
|
-
import"./chunk-43rp9zbk.js";
|
|
44
|
-
import"./chunk-qhsd552n.js";
|
|
45
|
-
import"./chunk-xeb6075z.js";
|
|
46
|
-
import"./chunk-a4vds27m.js";
|
|
47
|
-
import"./chunk-v4t6dyyh.js";
|
|
48
|
-
import"./chunk-yt3s7a7d.js";
|
|
49
|
-
import {
|
|
50
|
-
init_browser,
|
|
51
|
-
openBrowser
|
|
52
|
-
} from "./chunk-2k3y6fnp.js";
|
|
53
|
-
import {
|
|
54
|
-
getAnthropicApiKey,
|
|
55
|
-
init_auth,
|
|
56
|
-
init_config,
|
|
57
|
-
init_stringUtils,
|
|
58
|
-
plural,
|
|
59
|
-
saveGlobalConfig
|
|
60
|
-
} from "./chunk-7p9xptww.js";
|
|
61
|
-
import"./chunk-ejjp1fy1.js";
|
|
62
|
-
import"./chunk-j1y56wgn.js";
|
|
63
|
-
import"./chunk-6nsd9606.js";
|
|
64
|
-
import"./chunk-64c1avct.js";
|
|
65
|
-
import"./chunk-8g5pe1gr.js";
|
|
66
|
-
import"./chunk-4pbx3g7s.js";
|
|
67
|
-
import"./chunk-26wtxbdc.js";
|
|
68
|
-
import"./chunk-cfvgegjj.js";
|
|
69
|
-
import"./chunk-4jm600zv.js";
|
|
70
|
-
import"./chunk-c25z9zmd.js";
|
|
71
|
-
import"./chunk-fys33rtr.js";
|
|
72
|
-
import"./chunk-3c25bcsw.js";
|
|
73
|
-
import"./chunk-1a5w7wdt.js";
|
|
74
|
-
import"./chunk-bwtw1cbj.js";
|
|
75
|
-
import"./chunk-cdz5yb0r.js";
|
|
76
|
-
import {
|
|
77
|
-
Byline,
|
|
78
|
-
Dialog,
|
|
79
|
-
KeyboardShortcutHint,
|
|
80
|
-
Link,
|
|
81
|
-
ThemedBox_default,
|
|
82
|
-
ThemedText,
|
|
83
|
-
color,
|
|
84
|
-
init_src,
|
|
85
|
-
useKeybinding,
|
|
86
|
-
useKeybindings,
|
|
87
|
-
useTerminalSize,
|
|
88
|
-
useTheme
|
|
89
|
-
} from "./chunk-c7jwbe76.js";
|
|
90
|
-
import"./chunk-0vkfrmqm.js";
|
|
91
|
-
import {
|
|
92
|
-
require_jsx_dev_runtime,
|
|
93
|
-
require_react
|
|
94
|
-
} from "./chunk-7sgtxrsc.js";
|
|
95
|
-
import"./chunk-0xjaqda8.js";
|
|
96
|
-
import {
|
|
97
|
-
init_analytics,
|
|
98
|
-
logEvent
|
|
99
|
-
} from "./chunk-x8d2ehd7.js";
|
|
100
|
-
import"./chunk-db92x7yq.js";
|
|
101
|
-
import {
|
|
102
|
-
getGithubRepo,
|
|
103
|
-
init_git
|
|
104
|
-
} from "./chunk-kd5k97vr.js";
|
|
105
|
-
import"./chunk-w28t9jy7.js";
|
|
106
|
-
import"./chunk-qnfx3qtx.js";
|
|
107
|
-
import {
|
|
108
|
-
execFileNoThrow,
|
|
109
|
-
init_execFileNoThrow
|
|
110
|
-
} from "./chunk-9an46bhy.js";
|
|
111
|
-
import"./chunk-s8kj6ajy.js";
|
|
112
|
-
import"./chunk-2nya3j5t.js";
|
|
113
|
-
import"./chunk-dwyaks7s.js";
|
|
114
|
-
import {
|
|
115
|
-
execa,
|
|
116
|
-
init_execa
|
|
117
|
-
} from "./chunk-5z28bqne.js";
|
|
118
|
-
import {
|
|
119
|
-
figures_default,
|
|
120
|
-
init_figures
|
|
121
|
-
} from "./chunk-qajrkk97.js";
|
|
122
|
-
import {
|
|
123
|
-
init_log,
|
|
124
|
-
logError
|
|
125
|
-
} from "./chunk-yb6xww2x.js";
|
|
126
|
-
import"./chunk-nsc89h0n.js";
|
|
127
|
-
import"./chunk-fbv4apne.js";
|
|
128
|
-
import"./chunk-k8vp0atq.js";
|
|
129
|
-
import"./chunk-vf612n57.js";
|
|
130
|
-
import"./chunk-07069jq1.js";
|
|
131
|
-
import"./chunk-d4mdda98.js";
|
|
132
|
-
import"./chunk-55raexh7.js";
|
|
133
|
-
import"./chunk-v9smspw2.js";
|
|
134
|
-
import"./chunk-v1kzp02e.js";
|
|
135
|
-
import"./chunk-7wm5s02e.js";
|
|
136
|
-
import"./chunk-b0kf00ff.js";
|
|
137
|
-
import"./chunk-netzwgv1.js";
|
|
138
|
-
import {
|
|
139
|
-
__esm,
|
|
140
|
-
__toESM
|
|
141
|
-
} from "./chunk-qp2qdcda.js";
|
|
142
|
-
|
|
143
|
-
// src/components/WorkflowMultiselectDialog.tsx
|
|
144
|
-
function renderInputGuide(exitState) {
|
|
145
|
-
if (exitState.pending) {
|
|
146
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
147
|
-
children: [
|
|
148
|
-
"Press ",
|
|
149
|
-
exitState.keyName,
|
|
150
|
-
" again to exit"
|
|
151
|
-
]
|
|
152
|
-
}, undefined, true, undefined, this);
|
|
153
|
-
}
|
|
154
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Byline, {
|
|
155
|
-
children: [
|
|
156
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
|
|
157
|
-
shortcut: "\u2191\u2193",
|
|
158
|
-
action: "navigate"
|
|
159
|
-
}, undefined, false, undefined, this),
|
|
160
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
|
|
161
|
-
shortcut: "Space",
|
|
162
|
-
action: "toggle"
|
|
163
|
-
}, undefined, false, undefined, this),
|
|
164
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
|
|
165
|
-
shortcut: "Enter",
|
|
166
|
-
action: "confirm"
|
|
167
|
-
}, undefined, false, undefined, this),
|
|
168
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
|
|
169
|
-
action: "confirm:no",
|
|
170
|
-
context: "Confirmation",
|
|
171
|
-
fallback: "Esc",
|
|
172
|
-
description: "cancel"
|
|
173
|
-
}, undefined, false, undefined, this)
|
|
174
|
-
]
|
|
175
|
-
}, undefined, true, undefined, this);
|
|
176
|
-
}
|
|
177
|
-
function WorkflowMultiselectDialog({
|
|
178
|
-
onSubmit,
|
|
179
|
-
defaultSelections
|
|
180
|
-
}) {
|
|
181
|
-
const [showError, setShowError] = import_react.useState(false);
|
|
182
|
-
const handleSubmit = import_react.useCallback((selectedValues) => {
|
|
183
|
-
if (selectedValues.length === 0) {
|
|
184
|
-
setShowError(true);
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
setShowError(false);
|
|
188
|
-
onSubmit(selectedValues);
|
|
189
|
-
}, [onSubmit]);
|
|
190
|
-
const handleChange = import_react.useCallback(() => {
|
|
191
|
-
setShowError(false);
|
|
192
|
-
}, []);
|
|
193
|
-
const handleCancel = import_react.useCallback(() => {
|
|
194
|
-
setShowError(true);
|
|
195
|
-
}, []);
|
|
196
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Dialog, {
|
|
197
|
-
title: "Select GitHub workflows to install",
|
|
198
|
-
subtitle: "We'll create a workflow file in your repository for each one you select.",
|
|
199
|
-
onCancel: handleCancel,
|
|
200
|
-
inputGuide: renderInputGuide,
|
|
201
|
-
children: [
|
|
202
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
203
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
204
|
-
dimColor: true,
|
|
205
|
-
children: [
|
|
206
|
-
"More workflow examples (issue triage, CI fixes, etc.) at:",
|
|
207
|
-
" ",
|
|
208
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(Link, {
|
|
209
|
-
url: "https://github.com/anthropics/claude-code-action/blob/main/examples/",
|
|
210
|
-
children: "https://github.com/anthropics/claude-code-action/blob/main/examples/"
|
|
211
|
-
}, undefined, false, undefined, this)
|
|
212
|
-
]
|
|
213
|
-
}, undefined, true, undefined, this)
|
|
214
|
-
}, undefined, false, undefined, this),
|
|
215
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(SelectMulti, {
|
|
216
|
-
options: WORKFLOWS.map((workflow) => ({
|
|
217
|
-
label: workflow.label,
|
|
218
|
-
value: workflow.value
|
|
219
|
-
})),
|
|
220
|
-
defaultValue: defaultSelections,
|
|
221
|
-
onSubmit: handleSubmit,
|
|
222
|
-
onChange: handleChange,
|
|
223
|
-
onCancel: handleCancel,
|
|
224
|
-
hideIndexes: true
|
|
225
|
-
}, undefined, false, undefined, this),
|
|
226
|
-
showError && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
227
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
228
|
-
color: "error",
|
|
229
|
-
children: "You must select at least one workflow to continue"
|
|
230
|
-
}, undefined, false, undefined, this)
|
|
231
|
-
}, undefined, false, undefined, this)
|
|
232
|
-
]
|
|
233
|
-
}, undefined, true, undefined, this);
|
|
234
|
-
}
|
|
235
|
-
var import_react, jsx_dev_runtime, WORKFLOWS;
|
|
236
|
-
var init_WorkflowMultiselectDialog = __esm(() => {
|
|
237
|
-
init_src();
|
|
238
|
-
init_ConfigurableShortcutHint();
|
|
239
|
-
init_SelectMulti();
|
|
240
|
-
import_react = __toESM(require_react(), 1);
|
|
241
|
-
jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
|
|
242
|
-
WORKFLOWS = [
|
|
243
|
-
{
|
|
244
|
-
value: "claude",
|
|
245
|
-
label: "@Claude Code - Tag @claude in issues and PR comments"
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
value: "claude-review",
|
|
249
|
-
label: "Claude Code Review - Automated code review on new PRs"
|
|
250
|
-
}
|
|
251
|
-
];
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
// src/constants/github-app.ts
|
|
255
|
-
var PR_TITLE = "Add Claude Code GitHub Workflow", GITHUB_ACTION_SETUP_DOCS_URL = "https://github.com/anthropics/claude-code-action/blob/main/docs/setup.md", WORKFLOW_CONTENT = `name: Claude Code
|
|
256
|
-
|
|
257
|
-
on:
|
|
258
|
-
issue_comment:
|
|
259
|
-
types: [created]
|
|
260
|
-
pull_request_review_comment:
|
|
261
|
-
types: [created]
|
|
262
|
-
issues:
|
|
263
|
-
types: [opened, assigned]
|
|
264
|
-
pull_request_review:
|
|
265
|
-
types: [submitted]
|
|
266
|
-
|
|
267
|
-
jobs:
|
|
268
|
-
claude:
|
|
269
|
-
if: |
|
|
270
|
-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
271
|
-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
272
|
-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
|
273
|
-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
|
|
274
|
-
runs-on: ubuntu-latest
|
|
275
|
-
permissions:
|
|
276
|
-
contents: read
|
|
277
|
-
pull-requests: read
|
|
278
|
-
issues: read
|
|
279
|
-
id-token: write
|
|
280
|
-
actions: read # Required for Claude to read CI results on PRs
|
|
281
|
-
steps:
|
|
282
|
-
- name: Checkout repository
|
|
283
|
-
uses: actions/checkout@v4
|
|
284
|
-
with:
|
|
285
|
-
fetch-depth: 1
|
|
286
|
-
|
|
287
|
-
- name: Run Claude Code
|
|
288
|
-
id: claude
|
|
289
|
-
uses: anthropics/claude-code-action@v1
|
|
290
|
-
with:
|
|
291
|
-
anthropic_api_key: \${{ secrets.ANTHROPIC_API_KEY }}
|
|
292
|
-
|
|
293
|
-
# This is an optional setting that allows Claude to read CI results on PRs
|
|
294
|
-
additional_permissions: |
|
|
295
|
-
actions: read
|
|
296
|
-
|
|
297
|
-
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
|
|
298
|
-
# prompt: 'Update the pull request description to include a summary of changes.'
|
|
299
|
-
|
|
300
|
-
# Optional: Add claude_args to customize behavior and configuration
|
|
301
|
-
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
302
|
-
# or https://code.claude.com/docs/en/cli-reference for available options
|
|
303
|
-
# claude_args: '--allowed-tools Bash(gh pr:*)'
|
|
304
|
-
|
|
305
|
-
`, PR_BODY = `## \uD83E\uDD16 Installing Claude Code GitHub App
|
|
306
|
-
|
|
307
|
-
This PR adds a GitHub Actions workflow that enables Claude Code integration in our repository.
|
|
308
|
-
|
|
309
|
-
### What is Claude Code?
|
|
310
|
-
|
|
311
|
-
[Claude Code](https://claude.com/claude-code) is an AI coding agent that can help with:
|
|
312
|
-
- Bug fixes and improvements
|
|
313
|
-
- Documentation updates
|
|
314
|
-
- Implementing new features
|
|
315
|
-
- Code reviews and suggestions
|
|
316
|
-
- Writing tests
|
|
317
|
-
- And more!
|
|
318
|
-
|
|
319
|
-
### How it works
|
|
320
|
-
|
|
321
|
-
Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment.
|
|
322
|
-
Once the workflow is triggered, Claude will analyze the comment and surrounding context, and execute on the request in a GitHub action.
|
|
323
|
-
|
|
324
|
-
### Important Notes
|
|
325
|
-
|
|
326
|
-
- **This workflow won't take effect until this PR is merged**
|
|
327
|
-
- **@claude mentions won't work until after the merge is complete**
|
|
328
|
-
- The workflow runs automatically whenever Claude is mentioned in PR or issue comments
|
|
329
|
-
- Claude gets access to the entire PR or issue context including files, diffs, and previous comments
|
|
330
|
-
|
|
331
|
-
### Security
|
|
332
|
-
|
|
333
|
-
- Our Anthropic API key is securely stored as a GitHub Actions secret
|
|
334
|
-
- Only users with write access to the repository can trigger the workflow
|
|
335
|
-
- All Claude runs are stored in the GitHub Actions run history
|
|
336
|
-
- Claude's default tools are limited to reading/writing files and interacting with our repo by creating comments, branches, and commits.
|
|
337
|
-
- We can add more allowed tools by adding them to the workflow file like:
|
|
338
|
-
|
|
339
|
-
\`\`\`
|
|
340
|
-
allowed_tools: Bash(npm install),Bash(npm run build),Bash(npm run lint),Bash(npm run test)
|
|
341
|
-
\`\`\`
|
|
342
|
-
|
|
343
|
-
There's more information in the [Claude Code action repo](https://github.com/anthropics/claude-code-action).
|
|
344
|
-
|
|
345
|
-
After merging this PR, let's try mentioning @claude in a comment on any PR to get started!`, CODE_REVIEW_PLUGIN_WORKFLOW_CONTENT = `name: Claude Code Review
|
|
346
|
-
|
|
347
|
-
on:
|
|
348
|
-
pull_request:
|
|
349
|
-
types: [opened, synchronize, ready_for_review, reopened]
|
|
350
|
-
# Optional: Only run on specific file changes
|
|
351
|
-
# paths:
|
|
352
|
-
# - "src/**/*.ts"
|
|
353
|
-
# - "src/**/*.tsx"
|
|
354
|
-
# - "src/**/*.js"
|
|
355
|
-
# - "src/**/*.jsx"
|
|
356
|
-
|
|
357
|
-
jobs:
|
|
358
|
-
claude-review:
|
|
359
|
-
# Optional: Filter by PR author
|
|
360
|
-
# if: |
|
|
361
|
-
# github.event.pull_request.user.login == 'external-contributor' ||
|
|
362
|
-
# github.event.pull_request.user.login == 'new-developer' ||
|
|
363
|
-
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
|
364
|
-
|
|
365
|
-
runs-on: ubuntu-latest
|
|
366
|
-
permissions:
|
|
367
|
-
contents: read
|
|
368
|
-
pull-requests: read
|
|
369
|
-
issues: read
|
|
370
|
-
id-token: write
|
|
371
|
-
|
|
372
|
-
steps:
|
|
373
|
-
- name: Checkout repository
|
|
374
|
-
uses: actions/checkout@v4
|
|
375
|
-
with:
|
|
376
|
-
fetch-depth: 1
|
|
377
|
-
|
|
378
|
-
- name: Run Claude Code Review
|
|
379
|
-
id: claude-review
|
|
380
|
-
uses: anthropics/claude-code-action@v1
|
|
381
|
-
with:
|
|
382
|
-
anthropic_api_key: \${{ secrets.ANTHROPIC_API_KEY }}
|
|
383
|
-
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
|
|
384
|
-
plugins: 'code-review@claude-code-plugins'
|
|
385
|
-
prompt: '/code-review:code-review \${{ github.repository }}/pull/\${{ github.event.pull_request.number }}'
|
|
386
|
-
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
387
|
-
# or https://code.claude.com/docs/en/cli-reference for available options
|
|
388
|
-
|
|
389
|
-
`;
|
|
390
|
-
var init_github_app = () => {};
|
|
391
|
-
|
|
392
|
-
// src/commands/install-github-app/ApiKeyStep.tsx
|
|
393
|
-
function ApiKeyStep({
|
|
394
|
-
existingApiKey,
|
|
395
|
-
apiKeyOrOAuthToken,
|
|
396
|
-
onApiKeyChange,
|
|
397
|
-
onSubmit,
|
|
398
|
-
onToggleUseExistingKey,
|
|
399
|
-
onCreateOAuthToken,
|
|
400
|
-
selectedOption = existingApiKey ? "existing" : onCreateOAuthToken ? "oauth" : "new",
|
|
401
|
-
onSelectOption
|
|
402
|
-
}) {
|
|
403
|
-
const [cursorOffset, setCursorOffset] = import_react2.useState(0);
|
|
404
|
-
const terminalSize = useTerminalSize();
|
|
405
|
-
const [theme] = useTheme();
|
|
406
|
-
const handlePrevious = import_react2.useCallback(() => {
|
|
407
|
-
if (selectedOption === "new" && onCreateOAuthToken) {
|
|
408
|
-
onSelectOption?.("oauth");
|
|
409
|
-
} else if (selectedOption === "oauth" && existingApiKey) {
|
|
410
|
-
onSelectOption?.("existing");
|
|
411
|
-
onToggleUseExistingKey(true);
|
|
412
|
-
}
|
|
413
|
-
}, [
|
|
414
|
-
selectedOption,
|
|
415
|
-
onCreateOAuthToken,
|
|
416
|
-
existingApiKey,
|
|
417
|
-
onSelectOption,
|
|
418
|
-
onToggleUseExistingKey
|
|
419
|
-
]);
|
|
420
|
-
const handleNext = import_react2.useCallback(() => {
|
|
421
|
-
if (selectedOption === "existing") {
|
|
422
|
-
onSelectOption?.(onCreateOAuthToken ? "oauth" : "new");
|
|
423
|
-
onToggleUseExistingKey(false);
|
|
424
|
-
} else if (selectedOption === "oauth") {
|
|
425
|
-
onSelectOption?.("new");
|
|
426
|
-
}
|
|
427
|
-
}, [
|
|
428
|
-
selectedOption,
|
|
429
|
-
onCreateOAuthToken,
|
|
430
|
-
onSelectOption,
|
|
431
|
-
onToggleUseExistingKey
|
|
432
|
-
]);
|
|
433
|
-
const handleConfirm = import_react2.useCallback(() => {
|
|
434
|
-
if (selectedOption === "oauth" && onCreateOAuthToken) {
|
|
435
|
-
onCreateOAuthToken();
|
|
436
|
-
} else {
|
|
437
|
-
onSubmit();
|
|
438
|
-
}
|
|
439
|
-
}, [selectedOption, onCreateOAuthToken, onSubmit]);
|
|
440
|
-
const isTextInputVisible = selectedOption === "new";
|
|
441
|
-
useKeybindings({
|
|
442
|
-
"confirm:previous": handlePrevious,
|
|
443
|
-
"confirm:next": handleNext,
|
|
444
|
-
"confirm:yes": handleConfirm
|
|
445
|
-
}, { context: "Confirmation", isActive: !isTextInputVisible });
|
|
446
|
-
useKeybindings({
|
|
447
|
-
"confirm:previous": handlePrevious,
|
|
448
|
-
"confirm:next": handleNext
|
|
449
|
-
}, { context: "Confirmation", isActive: isTextInputVisible });
|
|
450
|
-
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
|
|
451
|
-
children: [
|
|
452
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
|
|
453
|
-
flexDirection: "column",
|
|
454
|
-
borderStyle: "round",
|
|
455
|
-
paddingX: 1,
|
|
456
|
-
children: [
|
|
457
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
|
|
458
|
-
flexDirection: "column",
|
|
459
|
-
marginBottom: 1,
|
|
460
|
-
children: [
|
|
461
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
|
|
462
|
-
bold: true,
|
|
463
|
-
children: "Install GitHub App"
|
|
464
|
-
}, undefined, false, undefined, this),
|
|
465
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
|
|
466
|
-
dimColor: true,
|
|
467
|
-
children: "Choose API key"
|
|
468
|
-
}, undefined, false, undefined, this)
|
|
469
|
-
]
|
|
470
|
-
}, undefined, true, undefined, this),
|
|
471
|
-
existingApiKey && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
|
|
472
|
-
marginBottom: 1,
|
|
473
|
-
children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
|
|
474
|
-
children: [
|
|
475
|
-
selectedOption === "existing" ? color("success", theme)("> ") : " ",
|
|
476
|
-
"Use your existing Claude Code API key"
|
|
477
|
-
]
|
|
478
|
-
}, undefined, true, undefined, this)
|
|
479
|
-
}, undefined, false, undefined, this),
|
|
480
|
-
onCreateOAuthToken && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
|
|
481
|
-
marginBottom: 1,
|
|
482
|
-
children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
|
|
483
|
-
children: [
|
|
484
|
-
selectedOption === "oauth" ? color("success", theme)("> ") : " ",
|
|
485
|
-
"Create a long-lived token with your Claude subscription"
|
|
486
|
-
]
|
|
487
|
-
}, undefined, true, undefined, this)
|
|
488
|
-
}, undefined, false, undefined, this),
|
|
489
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
|
|
490
|
-
marginBottom: 1,
|
|
491
|
-
children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
|
|
492
|
-
children: [
|
|
493
|
-
selectedOption === "new" ? color("success", theme)("> ") : " ",
|
|
494
|
-
"Enter a new API key"
|
|
495
|
-
]
|
|
496
|
-
}, undefined, true, undefined, this)
|
|
497
|
-
}, undefined, false, undefined, this),
|
|
498
|
-
selectedOption === "new" && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(TextInput, {
|
|
499
|
-
value: apiKeyOrOAuthToken,
|
|
500
|
-
onChange: onApiKeyChange,
|
|
501
|
-
onSubmit,
|
|
502
|
-
onPaste: onApiKeyChange,
|
|
503
|
-
focus: true,
|
|
504
|
-
placeholder: "sk-ant\u2026 (Create a new key at https://platform.claude.com/settings/keys)",
|
|
505
|
-
mask: "*",
|
|
506
|
-
columns: terminalSize.columns,
|
|
507
|
-
cursorOffset,
|
|
508
|
-
onChangeCursorOffset: setCursorOffset,
|
|
509
|
-
showCursor: true
|
|
510
|
-
}, undefined, false, undefined, this)
|
|
511
|
-
]
|
|
512
|
-
}, undefined, true, undefined, this),
|
|
513
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
|
|
514
|
-
marginLeft: 3,
|
|
515
|
-
children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
|
|
516
|
-
dimColor: true,
|
|
517
|
-
children: "\u2191/\u2193 to select \xB7 Enter to continue"
|
|
518
|
-
}, undefined, false, undefined, this)
|
|
519
|
-
}, undefined, false, undefined, this)
|
|
520
|
-
]
|
|
521
|
-
}, undefined, true, undefined, this);
|
|
522
|
-
}
|
|
523
|
-
var import_react2, jsx_dev_runtime2;
|
|
524
|
-
var init_ApiKeyStep = __esm(() => {
|
|
525
|
-
init_TextInput();
|
|
526
|
-
init_useTerminalSize();
|
|
527
|
-
init_src();
|
|
528
|
-
init_useKeybinding();
|
|
529
|
-
import_react2 = __toESM(require_react(), 1);
|
|
530
|
-
jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
|
|
531
|
-
});
|
|
532
|
-
|
|
533
|
-
// src/commands/install-github-app/CheckExistingSecretStep.tsx
|
|
534
|
-
function CheckExistingSecretStep({
|
|
535
|
-
useExistingSecret,
|
|
536
|
-
secretName,
|
|
537
|
-
onToggleUseExistingSecret,
|
|
538
|
-
onSecretNameChange,
|
|
539
|
-
onSubmit
|
|
540
|
-
}) {
|
|
541
|
-
const [cursorOffset, setCursorOffset] = import_react3.useState(0);
|
|
542
|
-
const terminalSize = useTerminalSize();
|
|
543
|
-
const [theme] = useTheme();
|
|
544
|
-
const handlePrevious = import_react3.useCallback(() => onToggleUseExistingSecret(true), [onToggleUseExistingSecret]);
|
|
545
|
-
const handleNext = import_react3.useCallback(() => onToggleUseExistingSecret(false), [onToggleUseExistingSecret]);
|
|
546
|
-
useKeybindings({
|
|
547
|
-
"confirm:previous": handlePrevious,
|
|
548
|
-
"confirm:next": handleNext,
|
|
549
|
-
"confirm:yes": onSubmit
|
|
550
|
-
}, { context: "Confirmation", isActive: useExistingSecret });
|
|
551
|
-
useKeybindings({
|
|
552
|
-
"confirm:previous": handlePrevious,
|
|
553
|
-
"confirm:next": handleNext
|
|
554
|
-
}, { context: "Confirmation", isActive: !useExistingSecret });
|
|
555
|
-
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
|
|
556
|
-
children: [
|
|
557
|
-
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
|
|
558
|
-
flexDirection: "column",
|
|
559
|
-
borderStyle: "round",
|
|
560
|
-
paddingX: 1,
|
|
561
|
-
children: [
|
|
562
|
-
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
|
|
563
|
-
flexDirection: "column",
|
|
564
|
-
marginBottom: 1,
|
|
565
|
-
children: [
|
|
566
|
-
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
567
|
-
bold: true,
|
|
568
|
-
children: "Install GitHub App"
|
|
569
|
-
}, undefined, false, undefined, this),
|
|
570
|
-
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
571
|
-
dimColor: true,
|
|
572
|
-
children: "Setup API key secret"
|
|
573
|
-
}, undefined, false, undefined, this)
|
|
574
|
-
]
|
|
575
|
-
}, undefined, true, undefined, this),
|
|
576
|
-
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
|
|
577
|
-
marginBottom: 1,
|
|
578
|
-
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
579
|
-
color: "warning",
|
|
580
|
-
children: "ANTHROPIC_API_KEY already exists in repository secrets!"
|
|
581
|
-
}, undefined, false, undefined, this)
|
|
582
|
-
}, undefined, false, undefined, this),
|
|
583
|
-
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
|
|
584
|
-
marginBottom: 1,
|
|
585
|
-
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
586
|
-
children: "Would you like to:"
|
|
587
|
-
}, undefined, false, undefined, this)
|
|
588
|
-
}, undefined, false, undefined, this),
|
|
589
|
-
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
|
|
590
|
-
marginBottom: 1,
|
|
591
|
-
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
592
|
-
children: [
|
|
593
|
-
useExistingSecret ? color("success", theme)("> ") : " ",
|
|
594
|
-
"Use the existing API key"
|
|
595
|
-
]
|
|
596
|
-
}, undefined, true, undefined, this)
|
|
597
|
-
}, undefined, false, undefined, this),
|
|
598
|
-
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
|
|
599
|
-
marginBottom: 1,
|
|
600
|
-
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
601
|
-
children: [
|
|
602
|
-
!useExistingSecret ? color("success", theme)("> ") : " ",
|
|
603
|
-
"Create a new secret with a different name"
|
|
604
|
-
]
|
|
605
|
-
}, undefined, true, undefined, this)
|
|
606
|
-
}, undefined, false, undefined, this),
|
|
607
|
-
!useExistingSecret && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
|
|
608
|
-
children: [
|
|
609
|
-
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
|
|
610
|
-
marginBottom: 1,
|
|
611
|
-
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
612
|
-
children: "Enter new secret name (alphanumeric with underscores):"
|
|
613
|
-
}, undefined, false, undefined, this)
|
|
614
|
-
}, undefined, false, undefined, this),
|
|
615
|
-
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(TextInput, {
|
|
616
|
-
value: secretName,
|
|
617
|
-
onChange: onSecretNameChange,
|
|
618
|
-
onSubmit,
|
|
619
|
-
focus: true,
|
|
620
|
-
placeholder: "e.g., CLAUDE_API_KEY",
|
|
621
|
-
columns: terminalSize.columns,
|
|
622
|
-
cursorOffset,
|
|
623
|
-
onChangeCursorOffset: setCursorOffset,
|
|
624
|
-
showCursor: true
|
|
625
|
-
}, undefined, false, undefined, this)
|
|
626
|
-
]
|
|
627
|
-
}, undefined, true, undefined, this)
|
|
628
|
-
]
|
|
629
|
-
}, undefined, true, undefined, this),
|
|
630
|
-
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
|
|
631
|
-
marginLeft: 3,
|
|
632
|
-
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
|
|
633
|
-
dimColor: true,
|
|
634
|
-
children: "\u2191/\u2193 to select \xB7 Enter to continue"
|
|
635
|
-
}, undefined, false, undefined, this)
|
|
636
|
-
}, undefined, false, undefined, this)
|
|
637
|
-
]
|
|
638
|
-
}, undefined, true, undefined, this);
|
|
639
|
-
}
|
|
640
|
-
var import_react3, jsx_dev_runtime3;
|
|
641
|
-
var init_CheckExistingSecretStep = __esm(() => {
|
|
642
|
-
init_TextInput();
|
|
643
|
-
init_useTerminalSize();
|
|
644
|
-
init_src();
|
|
645
|
-
init_useKeybinding();
|
|
646
|
-
import_react3 = __toESM(require_react(), 1);
|
|
647
|
-
jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
|
|
648
|
-
});
|
|
649
|
-
|
|
650
|
-
// src/commands/install-github-app/CheckGitHubStep.tsx
|
|
651
|
-
function CheckGitHubStep() {
|
|
652
|
-
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
653
|
-
children: "Checking GitHub CLI installation\u2026"
|
|
654
|
-
}, undefined, false, undefined, this);
|
|
655
|
-
}
|
|
656
|
-
var jsx_dev_runtime4;
|
|
657
|
-
var init_CheckGitHubStep = __esm(() => {
|
|
658
|
-
init_src();
|
|
659
|
-
jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
|
|
660
|
-
});
|
|
661
|
-
|
|
662
|
-
// src/commands/install-github-app/ChooseRepoStep.tsx
|
|
663
|
-
function ChooseRepoStep({
|
|
664
|
-
currentRepo,
|
|
665
|
-
useCurrentRepo,
|
|
666
|
-
repoUrl,
|
|
667
|
-
onRepoUrlChange,
|
|
668
|
-
onSubmit,
|
|
669
|
-
onToggleUseCurrentRepo
|
|
670
|
-
}) {
|
|
671
|
-
const [cursorOffset, setCursorOffset] = import_react4.useState(0);
|
|
672
|
-
const [showEmptyError, setShowEmptyError] = import_react4.useState(false);
|
|
673
|
-
const terminalSize = useTerminalSize();
|
|
674
|
-
const textInputColumns = terminalSize.columns;
|
|
675
|
-
const handleSubmit = import_react4.useCallback(() => {
|
|
676
|
-
const repoName = useCurrentRepo ? currentRepo : repoUrl;
|
|
677
|
-
if (!repoName?.trim()) {
|
|
678
|
-
setShowEmptyError(true);
|
|
679
|
-
return;
|
|
680
|
-
}
|
|
681
|
-
onSubmit();
|
|
682
|
-
}, [useCurrentRepo, currentRepo, repoUrl, onSubmit]);
|
|
683
|
-
const isTextInputVisible = !useCurrentRepo || !currentRepo;
|
|
684
|
-
const handlePrevious = import_react4.useCallback(() => {
|
|
685
|
-
onToggleUseCurrentRepo(true);
|
|
686
|
-
setShowEmptyError(false);
|
|
687
|
-
}, [onToggleUseCurrentRepo]);
|
|
688
|
-
const handleNext = import_react4.useCallback(() => {
|
|
689
|
-
onToggleUseCurrentRepo(false);
|
|
690
|
-
setShowEmptyError(false);
|
|
691
|
-
}, [onToggleUseCurrentRepo]);
|
|
692
|
-
useKeybindings({
|
|
693
|
-
"confirm:previous": handlePrevious,
|
|
694
|
-
"confirm:next": handleNext,
|
|
695
|
-
"confirm:yes": handleSubmit
|
|
696
|
-
}, { context: "Confirmation", isActive: !isTextInputVisible });
|
|
697
|
-
useKeybindings({
|
|
698
|
-
"confirm:previous": handlePrevious,
|
|
699
|
-
"confirm:next": handleNext
|
|
700
|
-
}, { context: "Confirmation", isActive: isTextInputVisible });
|
|
701
|
-
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
|
|
702
|
-
children: [
|
|
703
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
|
|
704
|
-
flexDirection: "column",
|
|
705
|
-
borderStyle: "round",
|
|
706
|
-
paddingX: 1,
|
|
707
|
-
children: [
|
|
708
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
|
|
709
|
-
flexDirection: "column",
|
|
710
|
-
marginBottom: 1,
|
|
711
|
-
children: [
|
|
712
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
|
|
713
|
-
bold: true,
|
|
714
|
-
children: "Install GitHub App"
|
|
715
|
-
}, undefined, false, undefined, this),
|
|
716
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
|
|
717
|
-
dimColor: true,
|
|
718
|
-
children: "Select GitHub repository"
|
|
719
|
-
}, undefined, false, undefined, this)
|
|
720
|
-
]
|
|
721
|
-
}, undefined, true, undefined, this),
|
|
722
|
-
currentRepo && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
|
|
723
|
-
marginBottom: 1,
|
|
724
|
-
children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
|
|
725
|
-
bold: useCurrentRepo,
|
|
726
|
-
color: useCurrentRepo ? "permission" : undefined,
|
|
727
|
-
children: [
|
|
728
|
-
useCurrentRepo ? "> " : " ",
|
|
729
|
-
"Use current repository: ",
|
|
730
|
-
currentRepo
|
|
731
|
-
]
|
|
732
|
-
}, undefined, true, undefined, this)
|
|
733
|
-
}, undefined, false, undefined, this),
|
|
734
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
|
|
735
|
-
marginBottom: 1,
|
|
736
|
-
children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
|
|
737
|
-
bold: !useCurrentRepo || !currentRepo,
|
|
738
|
-
color: !useCurrentRepo || !currentRepo ? "permission" : undefined,
|
|
739
|
-
children: [
|
|
740
|
-
!useCurrentRepo || !currentRepo ? "> " : " ",
|
|
741
|
-
currentRepo ? "Enter a different repository" : "Enter repository"
|
|
742
|
-
]
|
|
743
|
-
}, undefined, true, undefined, this)
|
|
744
|
-
}, undefined, false, undefined, this),
|
|
745
|
-
(!useCurrentRepo || !currentRepo) && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
|
|
746
|
-
marginLeft: 2,
|
|
747
|
-
marginBottom: 1,
|
|
748
|
-
children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TextInput, {
|
|
749
|
-
value: repoUrl,
|
|
750
|
-
onChange: (value) => {
|
|
751
|
-
onRepoUrlChange(value);
|
|
752
|
-
setShowEmptyError(false);
|
|
753
|
-
},
|
|
754
|
-
onSubmit: handleSubmit,
|
|
755
|
-
focus: true,
|
|
756
|
-
placeholder: "Enter a repo as owner/repo or https://github.com/owner/repo\u2026",
|
|
757
|
-
columns: textInputColumns,
|
|
758
|
-
cursorOffset,
|
|
759
|
-
onChangeCursorOffset: setCursorOffset,
|
|
760
|
-
showCursor: true
|
|
761
|
-
}, undefined, false, undefined, this)
|
|
762
|
-
}, undefined, false, undefined, this)
|
|
763
|
-
]
|
|
764
|
-
}, undefined, true, undefined, this),
|
|
765
|
-
showEmptyError && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
|
|
766
|
-
marginLeft: 3,
|
|
767
|
-
marginBottom: 1,
|
|
768
|
-
children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
|
|
769
|
-
color: "error",
|
|
770
|
-
children: "Please enter a repository name to continue"
|
|
771
|
-
}, undefined, false, undefined, this)
|
|
772
|
-
}, undefined, false, undefined, this),
|
|
773
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
|
|
774
|
-
marginLeft: 3,
|
|
775
|
-
children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
|
|
776
|
-
dimColor: true,
|
|
777
|
-
children: [
|
|
778
|
-
currentRepo ? "\u2191/\u2193 to select \xB7 " : "",
|
|
779
|
-
"Enter to continue"
|
|
780
|
-
]
|
|
781
|
-
}, undefined, true, undefined, this)
|
|
782
|
-
}, undefined, false, undefined, this)
|
|
783
|
-
]
|
|
784
|
-
}, undefined, true, undefined, this);
|
|
785
|
-
}
|
|
786
|
-
var import_react4, jsx_dev_runtime5;
|
|
787
|
-
var init_ChooseRepoStep = __esm(() => {
|
|
788
|
-
init_TextInput();
|
|
789
|
-
init_useTerminalSize();
|
|
790
|
-
init_src();
|
|
791
|
-
init_useKeybinding();
|
|
792
|
-
import_react4 = __toESM(require_react(), 1);
|
|
793
|
-
jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
|
|
794
|
-
});
|
|
795
|
-
|
|
796
|
-
// src/commands/install-github-app/CreatingStep.tsx
|
|
797
|
-
function CreatingStep({
|
|
798
|
-
currentWorkflowInstallStep,
|
|
799
|
-
secretExists,
|
|
800
|
-
useExistingSecret,
|
|
801
|
-
secretName,
|
|
802
|
-
skipWorkflow = false,
|
|
803
|
-
selectedWorkflows
|
|
804
|
-
}) {
|
|
805
|
-
const progressSteps = skipWorkflow ? [
|
|
806
|
-
"Getting repository information",
|
|
807
|
-
secretExists && useExistingSecret ? "Using existing API key secret" : `Setting up ${secretName} secret`
|
|
808
|
-
] : [
|
|
809
|
-
"Getting repository information",
|
|
810
|
-
"Creating branch",
|
|
811
|
-
selectedWorkflows.length > 1 ? "Creating workflow files" : "Creating workflow file",
|
|
812
|
-
secretExists && useExistingSecret ? "Using existing API key secret" : `Setting up ${secretName} secret`,
|
|
813
|
-
"Opening pull request page"
|
|
814
|
-
];
|
|
815
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
|
|
816
|
-
children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
|
|
817
|
-
flexDirection: "column",
|
|
818
|
-
borderStyle: "round",
|
|
819
|
-
paddingX: 1,
|
|
820
|
-
children: [
|
|
821
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
|
|
822
|
-
flexDirection: "column",
|
|
823
|
-
marginBottom: 1,
|
|
824
|
-
children: [
|
|
825
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
|
|
826
|
-
bold: true,
|
|
827
|
-
children: "Install GitHub App"
|
|
828
|
-
}, undefined, false, undefined, this),
|
|
829
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
|
|
830
|
-
dimColor: true,
|
|
831
|
-
children: "Create GitHub Actions workflow"
|
|
832
|
-
}, undefined, false, undefined, this)
|
|
833
|
-
]
|
|
834
|
-
}, undefined, true, undefined, this),
|
|
835
|
-
progressSteps.map((stepText, index) => {
|
|
836
|
-
let status = "pending";
|
|
837
|
-
if (index < currentWorkflowInstallStep) {
|
|
838
|
-
status = "completed";
|
|
839
|
-
} else if (index === currentWorkflowInstallStep) {
|
|
840
|
-
status = "in-progress";
|
|
841
|
-
}
|
|
842
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
|
|
843
|
-
children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
|
|
844
|
-
color: status === "completed" ? "success" : status === "in-progress" ? "warning" : undefined,
|
|
845
|
-
children: [
|
|
846
|
-
status === "completed" ? "\u2713 " : "",
|
|
847
|
-
stepText,
|
|
848
|
-
status === "in-progress" ? "\u2026" : ""
|
|
849
|
-
]
|
|
850
|
-
}, undefined, true, undefined, this)
|
|
851
|
-
}, index, false, undefined, this);
|
|
852
|
-
})
|
|
853
|
-
]
|
|
854
|
-
}, undefined, true, undefined, this)
|
|
855
|
-
}, undefined, false, undefined, this);
|
|
856
|
-
}
|
|
857
|
-
var jsx_dev_runtime6;
|
|
858
|
-
var init_CreatingStep = __esm(() => {
|
|
859
|
-
init_src();
|
|
860
|
-
jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
|
|
861
|
-
});
|
|
862
|
-
|
|
863
|
-
// src/commands/install-github-app/ErrorStep.tsx
|
|
864
|
-
function ErrorStep({
|
|
865
|
-
error,
|
|
866
|
-
errorReason,
|
|
867
|
-
errorInstructions
|
|
868
|
-
}) {
|
|
869
|
-
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
|
|
870
|
-
children: [
|
|
871
|
-
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
872
|
-
flexDirection: "column",
|
|
873
|
-
borderStyle: "round",
|
|
874
|
-
paddingX: 1,
|
|
875
|
-
children: [
|
|
876
|
-
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
877
|
-
flexDirection: "column",
|
|
878
|
-
marginBottom: 1,
|
|
879
|
-
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
880
|
-
bold: true,
|
|
881
|
-
children: "Install GitHub App"
|
|
882
|
-
}, undefined, false, undefined, this)
|
|
883
|
-
}, undefined, false, undefined, this),
|
|
884
|
-
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
885
|
-
color: "error",
|
|
886
|
-
children: [
|
|
887
|
-
"Error: ",
|
|
888
|
-
error
|
|
889
|
-
]
|
|
890
|
-
}, undefined, true, undefined, this),
|
|
891
|
-
errorReason && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
892
|
-
marginTop: 1,
|
|
893
|
-
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
894
|
-
dimColor: true,
|
|
895
|
-
children: [
|
|
896
|
-
"Reason: ",
|
|
897
|
-
errorReason
|
|
898
|
-
]
|
|
899
|
-
}, undefined, true, undefined, this)
|
|
900
|
-
}, undefined, false, undefined, this),
|
|
901
|
-
errorInstructions && errorInstructions.length > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
902
|
-
flexDirection: "column",
|
|
903
|
-
marginTop: 1,
|
|
904
|
-
children: [
|
|
905
|
-
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
906
|
-
dimColor: true,
|
|
907
|
-
children: "How to fix:"
|
|
908
|
-
}, undefined, false, undefined, this),
|
|
909
|
-
errorInstructions.map((instruction, index) => /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
910
|
-
marginLeft: 2,
|
|
911
|
-
children: [
|
|
912
|
-
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
913
|
-
dimColor: true,
|
|
914
|
-
children: "\u2022 "
|
|
915
|
-
}, undefined, false, undefined, this),
|
|
916
|
-
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
917
|
-
children: instruction
|
|
918
|
-
}, undefined, false, undefined, this)
|
|
919
|
-
]
|
|
920
|
-
}, index, true, undefined, this))
|
|
921
|
-
]
|
|
922
|
-
}, undefined, true, undefined, this),
|
|
923
|
-
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
924
|
-
marginTop: 1,
|
|
925
|
-
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
926
|
-
dimColor: true,
|
|
927
|
-
children: [
|
|
928
|
-
"For manual setup instructions, see:",
|
|
929
|
-
" ",
|
|
930
|
-
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
931
|
-
color: "claude",
|
|
932
|
-
children: GITHUB_ACTION_SETUP_DOCS_URL
|
|
933
|
-
}, undefined, false, undefined, this)
|
|
934
|
-
]
|
|
935
|
-
}, undefined, true, undefined, this)
|
|
936
|
-
}, undefined, false, undefined, this)
|
|
937
|
-
]
|
|
938
|
-
}, undefined, true, undefined, this),
|
|
939
|
-
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
|
|
940
|
-
marginLeft: 3,
|
|
941
|
-
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
|
|
942
|
-
dimColor: true,
|
|
943
|
-
children: "Press any key to exit"
|
|
944
|
-
}, undefined, false, undefined, this)
|
|
945
|
-
}, undefined, false, undefined, this)
|
|
946
|
-
]
|
|
947
|
-
}, undefined, true, undefined, this);
|
|
948
|
-
}
|
|
949
|
-
var jsx_dev_runtime7;
|
|
950
|
-
var init_ErrorStep = __esm(() => {
|
|
951
|
-
init_github_app();
|
|
952
|
-
init_src();
|
|
953
|
-
jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
|
|
954
|
-
});
|
|
955
|
-
|
|
956
|
-
// src/commands/install-github-app/ExistingWorkflowStep.tsx
|
|
957
|
-
function ExistingWorkflowStep({
|
|
958
|
-
repoName,
|
|
959
|
-
onSelectAction
|
|
960
|
-
}) {
|
|
961
|
-
const options = [
|
|
962
|
-
{
|
|
963
|
-
label: "Update workflow file with latest version",
|
|
964
|
-
value: "update"
|
|
965
|
-
},
|
|
966
|
-
{
|
|
967
|
-
label: "Skip workflow update (configure secrets only)",
|
|
968
|
-
value: "skip"
|
|
969
|
-
},
|
|
970
|
-
{
|
|
971
|
-
label: "Exit without making changes",
|
|
972
|
-
value: "exit"
|
|
973
|
-
}
|
|
974
|
-
];
|
|
975
|
-
const handleSelect = (value) => {
|
|
976
|
-
onSelectAction(value);
|
|
977
|
-
};
|
|
978
|
-
const handleCancel = () => {
|
|
979
|
-
onSelectAction("exit");
|
|
980
|
-
};
|
|
981
|
-
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
|
|
982
|
-
flexDirection: "column",
|
|
983
|
-
borderStyle: "round",
|
|
984
|
-
borderDimColor: true,
|
|
985
|
-
paddingX: 1,
|
|
986
|
-
children: [
|
|
987
|
-
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
|
|
988
|
-
flexDirection: "column",
|
|
989
|
-
marginBottom: 1,
|
|
990
|
-
children: [
|
|
991
|
-
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
|
|
992
|
-
bold: true,
|
|
993
|
-
children: "Existing Workflow Found"
|
|
994
|
-
}, undefined, false, undefined, this),
|
|
995
|
-
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
|
|
996
|
-
dimColor: true,
|
|
997
|
-
children: [
|
|
998
|
-
"Repository: ",
|
|
999
|
-
repoName
|
|
1000
|
-
]
|
|
1001
|
-
}, undefined, true, undefined, this)
|
|
1002
|
-
]
|
|
1003
|
-
}, undefined, true, undefined, this),
|
|
1004
|
-
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
|
|
1005
|
-
flexDirection: "column",
|
|
1006
|
-
marginBottom: 1,
|
|
1007
|
-
children: [
|
|
1008
|
-
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
|
|
1009
|
-
children: [
|
|
1010
|
-
"A Claude workflow file already exists at",
|
|
1011
|
-
" ",
|
|
1012
|
-
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
|
|
1013
|
-
color: "claude",
|
|
1014
|
-
children: ".github/workflows/claude.yml"
|
|
1015
|
-
}, undefined, false, undefined, this)
|
|
1016
|
-
]
|
|
1017
|
-
}, undefined, true, undefined, this),
|
|
1018
|
-
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
|
|
1019
|
-
dimColor: true,
|
|
1020
|
-
children: "What would you like to do?"
|
|
1021
|
-
}, undefined, false, undefined, this)
|
|
1022
|
-
]
|
|
1023
|
-
}, undefined, true, undefined, this),
|
|
1024
|
-
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
|
|
1025
|
-
flexDirection: "column",
|
|
1026
|
-
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Select, {
|
|
1027
|
-
options,
|
|
1028
|
-
onChange: handleSelect,
|
|
1029
|
-
onCancel: handleCancel
|
|
1030
|
-
}, undefined, false, undefined, this)
|
|
1031
|
-
}, undefined, false, undefined, this),
|
|
1032
|
-
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
|
|
1033
|
-
marginTop: 1,
|
|
1034
|
-
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
|
|
1035
|
-
dimColor: true,
|
|
1036
|
-
children: [
|
|
1037
|
-
"View the latest workflow template at:",
|
|
1038
|
-
" ",
|
|
1039
|
-
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
|
|
1040
|
-
color: "claude",
|
|
1041
|
-
children: "https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml"
|
|
1042
|
-
}, undefined, false, undefined, this)
|
|
1043
|
-
]
|
|
1044
|
-
}, undefined, true, undefined, this)
|
|
1045
|
-
}, undefined, false, undefined, this)
|
|
1046
|
-
]
|
|
1047
|
-
}, undefined, true, undefined, this);
|
|
1048
|
-
}
|
|
1049
|
-
var jsx_dev_runtime8;
|
|
1050
|
-
var init_ExistingWorkflowStep = __esm(() => {
|
|
1051
|
-
init_CustomSelect();
|
|
1052
|
-
init_src();
|
|
1053
|
-
jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
|
|
1054
|
-
});
|
|
1055
|
-
|
|
1056
|
-
// src/commands/install-github-app/InstallAppStep.tsx
|
|
1057
|
-
function InstallAppStep({ repoUrl, onSubmit }) {
|
|
1058
|
-
useKeybinding("confirm:yes", onSubmit, { context: "Confirmation" });
|
|
1059
|
-
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
|
|
1060
|
-
flexDirection: "column",
|
|
1061
|
-
borderStyle: "round",
|
|
1062
|
-
borderDimColor: true,
|
|
1063
|
-
paddingX: 1,
|
|
1064
|
-
children: [
|
|
1065
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
|
|
1066
|
-
flexDirection: "column",
|
|
1067
|
-
marginBottom: 1,
|
|
1068
|
-
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
|
|
1069
|
-
bold: true,
|
|
1070
|
-
children: "Install the Claude GitHub App"
|
|
1071
|
-
}, undefined, false, undefined, this)
|
|
1072
|
-
}, undefined, false, undefined, this),
|
|
1073
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
|
|
1074
|
-
marginBottom: 1,
|
|
1075
|
-
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
|
|
1076
|
-
children: "Opening browser to install the Claude GitHub App\u2026"
|
|
1077
|
-
}, undefined, false, undefined, this)
|
|
1078
|
-
}, undefined, false, undefined, this),
|
|
1079
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
|
|
1080
|
-
marginBottom: 1,
|
|
1081
|
-
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
|
|
1082
|
-
children: "If your browser doesn't open automatically, visit:"
|
|
1083
|
-
}, undefined, false, undefined, this)
|
|
1084
|
-
}, undefined, false, undefined, this),
|
|
1085
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
|
|
1086
|
-
marginBottom: 1,
|
|
1087
|
-
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
|
|
1088
|
-
underline: true,
|
|
1089
|
-
children: "https://github.com/apps/claude"
|
|
1090
|
-
}, undefined, false, undefined, this)
|
|
1091
|
-
}, undefined, false, undefined, this),
|
|
1092
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
|
|
1093
|
-
marginBottom: 1,
|
|
1094
|
-
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
|
|
1095
|
-
children: [
|
|
1096
|
-
"Please install the app for repository: ",
|
|
1097
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
|
|
1098
|
-
bold: true,
|
|
1099
|
-
children: repoUrl
|
|
1100
|
-
}, undefined, false, undefined, this)
|
|
1101
|
-
]
|
|
1102
|
-
}, undefined, true, undefined, this)
|
|
1103
|
-
}, undefined, false, undefined, this),
|
|
1104
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
|
|
1105
|
-
marginBottom: 1,
|
|
1106
|
-
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
|
|
1107
|
-
dimColor: true,
|
|
1108
|
-
children: "Important: Make sure to grant access to this specific repository"
|
|
1109
|
-
}, undefined, false, undefined, this)
|
|
1110
|
-
}, undefined, false, undefined, this),
|
|
1111
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
|
|
1112
|
-
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
|
|
1113
|
-
bold: true,
|
|
1114
|
-
color: "permission",
|
|
1115
|
-
children: [
|
|
1116
|
-
"Press Enter once you've installed the app",
|
|
1117
|
-
figures_default.ellipsis
|
|
1118
|
-
]
|
|
1119
|
-
}, undefined, true, undefined, this)
|
|
1120
|
-
}, undefined, false, undefined, this),
|
|
1121
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
|
|
1122
|
-
marginTop: 1,
|
|
1123
|
-
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
|
|
1124
|
-
dimColor: true,
|
|
1125
|
-
children: [
|
|
1126
|
-
"Having trouble? See manual setup instructions at:",
|
|
1127
|
-
" ",
|
|
1128
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
|
|
1129
|
-
color: "claude",
|
|
1130
|
-
children: GITHUB_ACTION_SETUP_DOCS_URL
|
|
1131
|
-
}, undefined, false, undefined, this)
|
|
1132
|
-
]
|
|
1133
|
-
}, undefined, true, undefined, this)
|
|
1134
|
-
}, undefined, false, undefined, this)
|
|
1135
|
-
]
|
|
1136
|
-
}, undefined, true, undefined, this);
|
|
1137
|
-
}
|
|
1138
|
-
var jsx_dev_runtime9;
|
|
1139
|
-
var init_InstallAppStep = __esm(() => {
|
|
1140
|
-
init_figures();
|
|
1141
|
-
init_github_app();
|
|
1142
|
-
init_src();
|
|
1143
|
-
init_useKeybinding();
|
|
1144
|
-
jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
|
|
1145
|
-
});
|
|
1146
|
-
|
|
1147
|
-
// src/commands/install-github-app/SuccessStep.tsx
|
|
1148
|
-
function SuccessStep({
|
|
1149
|
-
secretExists,
|
|
1150
|
-
useExistingSecret,
|
|
1151
|
-
secretName,
|
|
1152
|
-
skipWorkflow = false
|
|
1153
|
-
}) {
|
|
1154
|
-
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
|
|
1155
|
-
children: [
|
|
1156
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
|
|
1157
|
-
flexDirection: "column",
|
|
1158
|
-
borderStyle: "round",
|
|
1159
|
-
paddingX: 1,
|
|
1160
|
-
children: [
|
|
1161
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
|
|
1162
|
-
flexDirection: "column",
|
|
1163
|
-
marginBottom: 1,
|
|
1164
|
-
children: [
|
|
1165
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
|
|
1166
|
-
bold: true,
|
|
1167
|
-
children: "Install GitHub App"
|
|
1168
|
-
}, undefined, false, undefined, this),
|
|
1169
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
|
|
1170
|
-
dimColor: true,
|
|
1171
|
-
children: "Success"
|
|
1172
|
-
}, undefined, false, undefined, this)
|
|
1173
|
-
]
|
|
1174
|
-
}, undefined, true, undefined, this),
|
|
1175
|
-
!skipWorkflow && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
|
|
1176
|
-
color: "success",
|
|
1177
|
-
children: "\u2713 GitHub Actions workflow created!"
|
|
1178
|
-
}, undefined, false, undefined, this),
|
|
1179
|
-
secretExists && useExistingSecret && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
|
|
1180
|
-
marginTop: 1,
|
|
1181
|
-
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
|
|
1182
|
-
color: "success",
|
|
1183
|
-
children: "\u2713 Using existing ANTHROPIC_API_KEY secret"
|
|
1184
|
-
}, undefined, false, undefined, this)
|
|
1185
|
-
}, undefined, false, undefined, this),
|
|
1186
|
-
(!secretExists || !useExistingSecret) && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
|
|
1187
|
-
marginTop: 1,
|
|
1188
|
-
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
|
|
1189
|
-
color: "success",
|
|
1190
|
-
children: [
|
|
1191
|
-
"\u2713 API key saved as ",
|
|
1192
|
-
secretName,
|
|
1193
|
-
" secret"
|
|
1194
|
-
]
|
|
1195
|
-
}, undefined, true, undefined, this)
|
|
1196
|
-
}, undefined, false, undefined, this),
|
|
1197
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
|
|
1198
|
-
marginTop: 1,
|
|
1199
|
-
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
|
|
1200
|
-
children: "Next steps:"
|
|
1201
|
-
}, undefined, false, undefined, this)
|
|
1202
|
-
}, undefined, false, undefined, this),
|
|
1203
|
-
skipWorkflow ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
|
|
1204
|
-
children: [
|
|
1205
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
|
|
1206
|
-
children: "1. Install the Claude GitHub App if you haven't already"
|
|
1207
|
-
}, undefined, false, undefined, this),
|
|
1208
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
|
|
1209
|
-
children: "2. Your workflow file was kept unchanged"
|
|
1210
|
-
}, undefined, false, undefined, this),
|
|
1211
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
|
|
1212
|
-
children: "3. API key is configured and ready to use"
|
|
1213
|
-
}, undefined, false, undefined, this)
|
|
1214
|
-
]
|
|
1215
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
|
|
1216
|
-
children: [
|
|
1217
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
|
|
1218
|
-
children: "1. A pre-filled PR page has been created"
|
|
1219
|
-
}, undefined, false, undefined, this),
|
|
1220
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
|
|
1221
|
-
children: "2. Install the Claude GitHub App if you haven't already"
|
|
1222
|
-
}, undefined, false, undefined, this),
|
|
1223
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
|
|
1224
|
-
children: "3. Merge the PR to enable Claude PR assistance"
|
|
1225
|
-
}, undefined, false, undefined, this)
|
|
1226
|
-
]
|
|
1227
|
-
}, undefined, true, undefined, this)
|
|
1228
|
-
]
|
|
1229
|
-
}, undefined, true, undefined, this),
|
|
1230
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
|
|
1231
|
-
marginLeft: 3,
|
|
1232
|
-
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
|
|
1233
|
-
dimColor: true,
|
|
1234
|
-
children: "Press any key to exit"
|
|
1235
|
-
}, undefined, false, undefined, this)
|
|
1236
|
-
}, undefined, false, undefined, this)
|
|
1237
|
-
]
|
|
1238
|
-
}, undefined, true, undefined, this);
|
|
1239
|
-
}
|
|
1240
|
-
var jsx_dev_runtime10;
|
|
1241
|
-
var init_SuccessStep = __esm(() => {
|
|
1242
|
-
init_src();
|
|
1243
|
-
jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
|
|
1244
|
-
});
|
|
1245
|
-
|
|
1246
|
-
// src/commands/install-github-app/setupGitHubActions.ts
|
|
1247
|
-
async function createWorkflowFile(repoName, branchName, workflowPath, workflowContent, secretName, message, context) {
|
|
1248
|
-
const checkFileResult = await execFileNoThrow("gh", [
|
|
1249
|
-
"api",
|
|
1250
|
-
`repos/${repoName}/contents/${workflowPath}`,
|
|
1251
|
-
"--jq",
|
|
1252
|
-
".sha"
|
|
1253
|
-
]);
|
|
1254
|
-
let fileSha = null;
|
|
1255
|
-
if (checkFileResult.code === 0) {
|
|
1256
|
-
fileSha = checkFileResult.stdout.trim();
|
|
1257
|
-
}
|
|
1258
|
-
let content = workflowContent;
|
|
1259
|
-
if (secretName === "CLAUDE_CODE_OAUTH_TOKEN") {
|
|
1260
|
-
content = workflowContent.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g, `claude_code_oauth_token: \${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}`);
|
|
1261
|
-
} else if (secretName !== "ANTHROPIC_API_KEY") {
|
|
1262
|
-
content = workflowContent.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g, `anthropic_api_key: \${{ secrets.${secretName} }}`);
|
|
1263
|
-
}
|
|
1264
|
-
const base64Content = Buffer.from(content).toString("base64");
|
|
1265
|
-
const apiParams = [
|
|
1266
|
-
"api",
|
|
1267
|
-
"--method",
|
|
1268
|
-
"PUT",
|
|
1269
|
-
`repos/${repoName}/contents/${workflowPath}`,
|
|
1270
|
-
"-f",
|
|
1271
|
-
`message=${fileSha ? `"Update ${message}"` : `"${message}"`}`,
|
|
1272
|
-
"-f",
|
|
1273
|
-
`content=${base64Content}`,
|
|
1274
|
-
"-f",
|
|
1275
|
-
`branch=${branchName}`
|
|
1276
|
-
];
|
|
1277
|
-
if (fileSha) {
|
|
1278
|
-
apiParams.push("-f", `sha=${fileSha}`);
|
|
1279
|
-
}
|
|
1280
|
-
const createFileResult = await execFileNoThrow("gh", apiParams);
|
|
1281
|
-
if (createFileResult.code !== 0) {
|
|
1282
|
-
if (createFileResult.stderr.includes("422") && createFileResult.stderr.includes("sha")) {
|
|
1283
|
-
logEvent("tengu_setup_github_actions_failed", {
|
|
1284
|
-
reason: "failed_to_create_workflow_file",
|
|
1285
|
-
exit_code: createFileResult.code,
|
|
1286
|
-
...context
|
|
1287
|
-
});
|
|
1288
|
-
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.`);
|
|
1289
|
-
}
|
|
1290
|
-
logEvent("tengu_setup_github_actions_failed", {
|
|
1291
|
-
reason: "failed_to_create_workflow_file",
|
|
1292
|
-
exit_code: createFileResult.code,
|
|
1293
|
-
...context
|
|
1294
|
-
});
|
|
1295
|
-
const helpText = `
|
|
1296
|
-
|
|
1297
|
-
Need help? Common issues:
|
|
1298
|
-
` + `\xB7 Permission denied \u2192 Run: gh auth refresh -h github.com -s repo,workflow
|
|
1299
|
-
` + `\xB7 Not authorized \u2192 Ensure you have admin access to the repository
|
|
1300
|
-
` + "\xB7 For manual setup \u2192 Visit: https://github.com/anthropics/claude-code-action";
|
|
1301
|
-
throw new Error(`Failed to create workflow file ${workflowPath}: ${createFileResult.stderr}${helpText}`);
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, updateProgress, skipWorkflow = false, selectedWorkflows, authType, context) {
|
|
1305
|
-
try {
|
|
1306
|
-
logEvent("tengu_setup_github_actions_started", {
|
|
1307
|
-
skip_workflow: skipWorkflow,
|
|
1308
|
-
has_api_key: !!apiKeyOrOAuthToken,
|
|
1309
|
-
using_default_secret_name: secretName === "ANTHROPIC_API_KEY",
|
|
1310
|
-
selected_claude_workflow: selectedWorkflows.includes("claude"),
|
|
1311
|
-
selected_claude_review_workflow: selectedWorkflows.includes("claude-review"),
|
|
1312
|
-
...context
|
|
1313
|
-
});
|
|
1314
|
-
const repoCheckResult = await execFileNoThrow("gh", [
|
|
1315
|
-
"api",
|
|
1316
|
-
`repos/${repoName}`,
|
|
1317
|
-
"--jq",
|
|
1318
|
-
".id"
|
|
1319
|
-
]);
|
|
1320
|
-
if (repoCheckResult.code !== 0) {
|
|
1321
|
-
logEvent("tengu_setup_github_actions_failed", {
|
|
1322
|
-
reason: "repo_not_found",
|
|
1323
|
-
exit_code: repoCheckResult.code,
|
|
1324
|
-
...context
|
|
1325
|
-
});
|
|
1326
|
-
throw new Error(`Failed to access repository ${repoName}: ${repoCheckResult.stderr}`);
|
|
1327
|
-
}
|
|
1328
|
-
const defaultBranchResult = await execFileNoThrow("gh", [
|
|
1329
|
-
"api",
|
|
1330
|
-
`repos/${repoName}`,
|
|
1331
|
-
"--jq",
|
|
1332
|
-
".default_branch"
|
|
1333
|
-
]);
|
|
1334
|
-
if (defaultBranchResult.code !== 0) {
|
|
1335
|
-
logEvent("tengu_setup_github_actions_failed", {
|
|
1336
|
-
reason: "failed_to_get_default_branch",
|
|
1337
|
-
exit_code: defaultBranchResult.code,
|
|
1338
|
-
...context
|
|
1339
|
-
});
|
|
1340
|
-
throw new Error(`Failed to get default branch: ${defaultBranchResult.stderr}`);
|
|
1341
|
-
}
|
|
1342
|
-
const defaultBranch = defaultBranchResult.stdout.trim();
|
|
1343
|
-
const shaResult = await execFileNoThrow("gh", [
|
|
1344
|
-
"api",
|
|
1345
|
-
`repos/${repoName}/git/ref/heads/${defaultBranch}`,
|
|
1346
|
-
"--jq",
|
|
1347
|
-
".object.sha"
|
|
1348
|
-
]);
|
|
1349
|
-
if (shaResult.code !== 0) {
|
|
1350
|
-
logEvent("tengu_setup_github_actions_failed", {
|
|
1351
|
-
reason: "failed_to_get_branch_sha",
|
|
1352
|
-
exit_code: shaResult.code,
|
|
1353
|
-
...context
|
|
1354
|
-
});
|
|
1355
|
-
throw new Error(`Failed to get branch SHA: ${shaResult.stderr}`);
|
|
1356
|
-
}
|
|
1357
|
-
const sha = shaResult.stdout.trim();
|
|
1358
|
-
let branchName = null;
|
|
1359
|
-
if (!skipWorkflow) {
|
|
1360
|
-
updateProgress();
|
|
1361
|
-
branchName = `add-claude-github-actions-${Date.now()}`;
|
|
1362
|
-
const createBranchResult = await execFileNoThrow("gh", [
|
|
1363
|
-
"api",
|
|
1364
|
-
"--method",
|
|
1365
|
-
"POST",
|
|
1366
|
-
`repos/${repoName}/git/refs`,
|
|
1367
|
-
"-f",
|
|
1368
|
-
`ref=refs/heads/${branchName}`,
|
|
1369
|
-
"-f",
|
|
1370
|
-
`sha=${sha}`
|
|
1371
|
-
]);
|
|
1372
|
-
if (createBranchResult.code !== 0) {
|
|
1373
|
-
logEvent("tengu_setup_github_actions_failed", {
|
|
1374
|
-
reason: "failed_to_create_branch",
|
|
1375
|
-
exit_code: createBranchResult.code,
|
|
1376
|
-
...context
|
|
1377
|
-
});
|
|
1378
|
-
throw new Error(`Failed to create branch: ${createBranchResult.stderr}`);
|
|
1379
|
-
}
|
|
1380
|
-
updateProgress();
|
|
1381
|
-
const workflows = [];
|
|
1382
|
-
if (selectedWorkflows.includes("claude")) {
|
|
1383
|
-
workflows.push({
|
|
1384
|
-
path: ".github/workflows/claude.yml",
|
|
1385
|
-
content: WORKFLOW_CONTENT,
|
|
1386
|
-
message: "Claude PR Assistant workflow"
|
|
1387
|
-
});
|
|
1388
|
-
}
|
|
1389
|
-
if (selectedWorkflows.includes("claude-review")) {
|
|
1390
|
-
workflows.push({
|
|
1391
|
-
path: ".github/workflows/claude-code-review.yml",
|
|
1392
|
-
content: CODE_REVIEW_PLUGIN_WORKFLOW_CONTENT,
|
|
1393
|
-
message: "Claude Code Review workflow"
|
|
1394
|
-
});
|
|
1395
|
-
}
|
|
1396
|
-
for (const workflow of workflows) {
|
|
1397
|
-
await createWorkflowFile(repoName, branchName, workflow.path, workflow.content, secretName, workflow.message, context);
|
|
1398
|
-
}
|
|
1399
|
-
}
|
|
1400
|
-
updateProgress();
|
|
1401
|
-
if (apiKeyOrOAuthToken) {
|
|
1402
|
-
const setSecretResult = await execFileNoThrow("gh", [
|
|
1403
|
-
"secret",
|
|
1404
|
-
"set",
|
|
1405
|
-
secretName,
|
|
1406
|
-
"--body",
|
|
1407
|
-
apiKeyOrOAuthToken,
|
|
1408
|
-
"--repo",
|
|
1409
|
-
repoName
|
|
1410
|
-
]);
|
|
1411
|
-
if (setSecretResult.code !== 0) {
|
|
1412
|
-
logEvent("tengu_setup_github_actions_failed", {
|
|
1413
|
-
reason: "failed_to_set_api_key_secret",
|
|
1414
|
-
exit_code: setSecretResult.code,
|
|
1415
|
-
...context
|
|
1416
|
-
});
|
|
1417
|
-
const helpText = `
|
|
1418
|
-
|
|
1419
|
-
Need help? Common issues:
|
|
1420
|
-
` + `\xB7 Permission denied \u2192 Run: gh auth refresh -h github.com -s repo
|
|
1421
|
-
` + `\xB7 Not authorized \u2192 Ensure you have admin access to the repository
|
|
1422
|
-
` + "\xB7 For manual setup \u2192 Visit: https://github.com/anthropics/claude-code-action";
|
|
1423
|
-
throw new Error(`Failed to set API key secret: ${setSecretResult.stderr || "Unknown error"}${helpText}`);
|
|
1424
|
-
}
|
|
1425
|
-
}
|
|
1426
|
-
if (!skipWorkflow && branchName) {
|
|
1427
|
-
updateProgress();
|
|
1428
|
-
const compareUrl = `https://github.com/${repoName}/compare/${defaultBranch}...${branchName}?quick_pull=1&title=${encodeURIComponent(PR_TITLE)}&body=${encodeURIComponent(PR_BODY)}`;
|
|
1429
|
-
await openBrowser(compareUrl);
|
|
1430
|
-
}
|
|
1431
|
-
logEvent("tengu_setup_github_actions_completed", {
|
|
1432
|
-
skip_workflow: skipWorkflow,
|
|
1433
|
-
has_api_key: !!apiKeyOrOAuthToken,
|
|
1434
|
-
auth_type: authType,
|
|
1435
|
-
using_default_secret_name: secretName === "ANTHROPIC_API_KEY",
|
|
1436
|
-
selected_claude_workflow: selectedWorkflows.includes("claude"),
|
|
1437
|
-
selected_claude_review_workflow: selectedWorkflows.includes("claude-review"),
|
|
1438
|
-
...context
|
|
1439
|
-
});
|
|
1440
|
-
saveGlobalConfig((current) => ({
|
|
1441
|
-
...current,
|
|
1442
|
-
githubActionSetupCount: (current.githubActionSetupCount ?? 0) + 1
|
|
1443
|
-
}));
|
|
1444
|
-
} catch (error) {
|
|
1445
|
-
if (!error || !(error instanceof Error) || !error.message.includes("Failed to")) {
|
|
1446
|
-
logEvent("tengu_setup_github_actions_failed", {
|
|
1447
|
-
reason: "unexpected_error",
|
|
1448
|
-
...context
|
|
1449
|
-
});
|
|
1450
|
-
}
|
|
1451
|
-
if (error instanceof Error) {
|
|
1452
|
-
logError(error);
|
|
1453
|
-
}
|
|
1454
|
-
throw error;
|
|
1455
|
-
}
|
|
1456
|
-
}
|
|
1457
|
-
var init_setupGitHubActions = __esm(() => {
|
|
1458
|
-
init_analytics();
|
|
1459
|
-
init_config();
|
|
1460
|
-
init_github_app();
|
|
1461
|
-
init_browser();
|
|
1462
|
-
init_execFileNoThrow();
|
|
1463
|
-
init_log();
|
|
1464
|
-
});
|
|
1465
|
-
|
|
1466
|
-
// src/commands/install-github-app/WarningsStep.tsx
|
|
1467
|
-
function WarningsStep({ warnings, onContinue }) {
|
|
1468
|
-
useKeybinding("confirm:yes", onContinue, { context: "Confirmation" });
|
|
1469
|
-
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
|
|
1470
|
-
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
|
|
1471
|
-
flexDirection: "column",
|
|
1472
|
-
borderStyle: "round",
|
|
1473
|
-
paddingX: 1,
|
|
1474
|
-
children: [
|
|
1475
|
-
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
|
|
1476
|
-
flexDirection: "column",
|
|
1477
|
-
marginBottom: 1,
|
|
1478
|
-
children: [
|
|
1479
|
-
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
|
|
1480
|
-
bold: true,
|
|
1481
|
-
children: [
|
|
1482
|
-
figures_default.warning,
|
|
1483
|
-
" Setup Warnings"
|
|
1484
|
-
]
|
|
1485
|
-
}, undefined, true, undefined, this),
|
|
1486
|
-
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
|
|
1487
|
-
dimColor: true,
|
|
1488
|
-
children: "We found some potential issues, but you can continue anyway"
|
|
1489
|
-
}, undefined, false, undefined, this)
|
|
1490
|
-
]
|
|
1491
|
-
}, undefined, true, undefined, this),
|
|
1492
|
-
warnings.map((warning, index) => /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
|
|
1493
|
-
flexDirection: "column",
|
|
1494
|
-
marginBottom: 1,
|
|
1495
|
-
children: [
|
|
1496
|
-
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
|
|
1497
|
-
color: "warning",
|
|
1498
|
-
bold: true,
|
|
1499
|
-
children: warning.title
|
|
1500
|
-
}, undefined, false, undefined, this),
|
|
1501
|
-
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
|
|
1502
|
-
children: warning.message
|
|
1503
|
-
}, undefined, false, undefined, this),
|
|
1504
|
-
warning.instructions.length > 0 && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
|
|
1505
|
-
flexDirection: "column",
|
|
1506
|
-
marginLeft: 2,
|
|
1507
|
-
marginTop: 1,
|
|
1508
|
-
children: warning.instructions.map((instruction, i) => /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
|
|
1509
|
-
dimColor: true,
|
|
1510
|
-
children: [
|
|
1511
|
-
"\u2022 ",
|
|
1512
|
-
instruction
|
|
1513
|
-
]
|
|
1514
|
-
}, i, true, undefined, this))
|
|
1515
|
-
}, undefined, false, undefined, this)
|
|
1516
|
-
]
|
|
1517
|
-
}, index, true, undefined, this)),
|
|
1518
|
-
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
|
|
1519
|
-
marginTop: 1,
|
|
1520
|
-
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
|
|
1521
|
-
bold: true,
|
|
1522
|
-
color: "permission",
|
|
1523
|
-
children: "Press Enter to continue anyway, or Ctrl+C to exit and fix issues"
|
|
1524
|
-
}, undefined, false, undefined, this)
|
|
1525
|
-
}, undefined, false, undefined, this),
|
|
1526
|
-
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
|
|
1527
|
-
marginTop: 1,
|
|
1528
|
-
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
|
|
1529
|
-
dimColor: true,
|
|
1530
|
-
children: [
|
|
1531
|
-
"You can also try the manual setup steps if needed:",
|
|
1532
|
-
" ",
|
|
1533
|
-
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
|
|
1534
|
-
color: "claude",
|
|
1535
|
-
children: GITHUB_ACTION_SETUP_DOCS_URL
|
|
1536
|
-
}, undefined, false, undefined, this)
|
|
1537
|
-
]
|
|
1538
|
-
}, undefined, true, undefined, this)
|
|
1539
|
-
}, undefined, false, undefined, this)
|
|
1540
|
-
]
|
|
1541
|
-
}, undefined, true, undefined, this)
|
|
1542
|
-
}, undefined, false, undefined, this);
|
|
1543
|
-
}
|
|
1544
|
-
var jsx_dev_runtime11;
|
|
1545
|
-
var init_WarningsStep = __esm(() => {
|
|
1546
|
-
init_figures();
|
|
1547
|
-
init_github_app();
|
|
1548
|
-
init_src();
|
|
1549
|
-
init_useKeybinding();
|
|
1550
|
-
jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
|
|
1551
|
-
});
|
|
1552
|
-
|
|
1553
|
-
// src/commands/install-github-app/install-github-app.tsx
|
|
1554
|
-
function InstallGitHubApp(props) {
|
|
1555
|
-
const [existingApiKey] = import_react5.useState(() => getAnthropicApiKey());
|
|
1556
|
-
const [state, setState] = import_react5.useState({
|
|
1557
|
-
...INITIAL_STATE,
|
|
1558
|
-
useExistingKey: !!existingApiKey,
|
|
1559
|
-
selectedApiKeyOption: existingApiKey ? "existing" : "new"
|
|
1560
|
-
});
|
|
1561
|
-
useExitOnCtrlCDWithKeybindings();
|
|
1562
|
-
import_react5.default.useEffect(() => {
|
|
1563
|
-
logEvent("tengu_install_github_app_started", {});
|
|
1564
|
-
}, []);
|
|
1565
|
-
const checkGitHubCLI = import_react5.useCallback(async () => {
|
|
1566
|
-
const warnings = [];
|
|
1567
|
-
const ghVersionResult = await execa("gh --version", {
|
|
1568
|
-
shell: true,
|
|
1569
|
-
reject: false
|
|
1570
|
-
});
|
|
1571
|
-
if (ghVersionResult.exitCode !== 0) {
|
|
1572
|
-
warnings.push({
|
|
1573
|
-
title: "GitHub CLI not found",
|
|
1574
|
-
message: "GitHub CLI (gh) does not appear to be installed or accessible.",
|
|
1575
|
-
instructions: [
|
|
1576
|
-
"Install GitHub CLI from https://cli.github.com/",
|
|
1577
|
-
"macOS: brew install gh",
|
|
1578
|
-
"Windows: winget install --id GitHub.cli",
|
|
1579
|
-
"Linux: See installation instructions at https://github.com/cli/cli#installation"
|
|
1580
|
-
]
|
|
1581
|
-
});
|
|
1582
|
-
}
|
|
1583
|
-
const authResult = await execa("gh auth status -a", {
|
|
1584
|
-
shell: true,
|
|
1585
|
-
reject: false
|
|
1586
|
-
});
|
|
1587
|
-
if (authResult.exitCode !== 0) {
|
|
1588
|
-
warnings.push({
|
|
1589
|
-
title: "GitHub CLI not authenticated",
|
|
1590
|
-
message: "GitHub CLI does not appear to be authenticated.",
|
|
1591
|
-
instructions: [
|
|
1592
|
-
"Run: gh auth login",
|
|
1593
|
-
"Follow the prompts to authenticate with GitHub",
|
|
1594
|
-
"Or set up authentication using environment variables or other methods"
|
|
1595
|
-
]
|
|
1596
|
-
});
|
|
1597
|
-
} else {
|
|
1598
|
-
const tokenScopesMatch = authResult.stdout.match(/Token scopes:.*$/m);
|
|
1599
|
-
if (tokenScopesMatch) {
|
|
1600
|
-
const scopes = tokenScopesMatch[0];
|
|
1601
|
-
const missingScopes = [];
|
|
1602
|
-
if (!scopes.includes("repo")) {
|
|
1603
|
-
missingScopes.push("repo");
|
|
1604
|
-
}
|
|
1605
|
-
if (!scopes.includes("workflow")) {
|
|
1606
|
-
missingScopes.push("workflow");
|
|
1607
|
-
}
|
|
1608
|
-
if (missingScopes.length > 0) {
|
|
1609
|
-
setState((prev) => ({
|
|
1610
|
-
...prev,
|
|
1611
|
-
step: "error",
|
|
1612
|
-
error: `GitHub CLI is missing required permissions: ${missingScopes.join(", ")}.`,
|
|
1613
|
-
errorReason: "Missing required scopes",
|
|
1614
|
-
errorInstructions: [
|
|
1615
|
-
`Your GitHub CLI authentication is missing the "${missingScopes.join('" and "')}" ${plural(missingScopes.length, "scope")} needed to manage GitHub Actions and secrets.`,
|
|
1616
|
-
"",
|
|
1617
|
-
"To fix this, run:",
|
|
1618
|
-
" gh auth refresh -h github.com -s repo,workflow",
|
|
1619
|
-
"",
|
|
1620
|
-
"This will add the necessary permissions to manage workflows and secrets."
|
|
1621
|
-
]
|
|
1622
|
-
}));
|
|
1623
|
-
return;
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1626
|
-
}
|
|
1627
|
-
const currentRepo = await getGithubRepo() ?? "";
|
|
1628
|
-
logEvent("tengu_install_github_app_step_completed", {
|
|
1629
|
-
step: "check-gh"
|
|
1630
|
-
});
|
|
1631
|
-
setState((prev) => ({
|
|
1632
|
-
...prev,
|
|
1633
|
-
warnings,
|
|
1634
|
-
currentRepo,
|
|
1635
|
-
selectedRepoName: currentRepo,
|
|
1636
|
-
useCurrentRepo: !!currentRepo,
|
|
1637
|
-
step: warnings.length > 0 ? "warnings" : "choose-repo"
|
|
1638
|
-
}));
|
|
1639
|
-
}, []);
|
|
1640
|
-
import_react5.default.useEffect(() => {
|
|
1641
|
-
if (state.step === "check-gh") {
|
|
1642
|
-
checkGitHubCLI();
|
|
1643
|
-
}
|
|
1644
|
-
}, [state.step, checkGitHubCLI]);
|
|
1645
|
-
const runSetupGitHubActions = import_react5.useCallback(async (apiKeyOrOAuthToken, secretName) => {
|
|
1646
|
-
setState((prev) => ({
|
|
1647
|
-
...prev,
|
|
1648
|
-
step: "creating",
|
|
1649
|
-
currentWorkflowInstallStep: 0
|
|
1650
|
-
}));
|
|
1651
|
-
try {
|
|
1652
|
-
await setupGitHubActions(state.selectedRepoName, apiKeyOrOAuthToken, secretName, () => {
|
|
1653
|
-
setState((prev) => ({
|
|
1654
|
-
...prev,
|
|
1655
|
-
currentWorkflowInstallStep: prev.currentWorkflowInstallStep + 1
|
|
1656
|
-
}));
|
|
1657
|
-
}, state.workflowAction === "skip", state.selectedWorkflows, state.authType, {
|
|
1658
|
-
useCurrentRepo: state.useCurrentRepo,
|
|
1659
|
-
workflowExists: state.workflowExists,
|
|
1660
|
-
secretExists: state.secretExists
|
|
1661
|
-
});
|
|
1662
|
-
logEvent("tengu_install_github_app_step_completed", {
|
|
1663
|
-
step: "creating"
|
|
1664
|
-
});
|
|
1665
|
-
setState((prev) => ({ ...prev, step: "success" }));
|
|
1666
|
-
} catch (error) {
|
|
1667
|
-
const errorMessage = error instanceof Error ? error.message : "Failed to set up GitHub Actions";
|
|
1668
|
-
if (errorMessage.includes("workflow file already exists")) {
|
|
1669
|
-
logEvent("tengu_install_github_app_error", {
|
|
1670
|
-
reason: "workflow_file_exists"
|
|
1671
|
-
});
|
|
1672
|
-
setState((prev) => ({
|
|
1673
|
-
...prev,
|
|
1674
|
-
step: "error",
|
|
1675
|
-
error: "A Claude workflow file already exists in this repository.",
|
|
1676
|
-
errorReason: "Workflow file conflict",
|
|
1677
|
-
errorInstructions: [
|
|
1678
|
-
"The file .github/workflows/claude.yml already exists",
|
|
1679
|
-
"You can either:",
|
|
1680
|
-
" 1. Delete the existing file and run this command again",
|
|
1681
|
-
" 2. Update the existing file manually using the template from:",
|
|
1682
|
-
` ${GITHUB_ACTION_SETUP_DOCS_URL}`
|
|
1683
|
-
]
|
|
1684
|
-
}));
|
|
1685
|
-
} else {
|
|
1686
|
-
logEvent("tengu_install_github_app_error", {
|
|
1687
|
-
reason: "setup_github_actions_failed"
|
|
1688
|
-
});
|
|
1689
|
-
setState((prev) => ({
|
|
1690
|
-
...prev,
|
|
1691
|
-
step: "error",
|
|
1692
|
-
error: errorMessage,
|
|
1693
|
-
errorReason: "GitHub Actions setup failed",
|
|
1694
|
-
errorInstructions: []
|
|
1695
|
-
}));
|
|
1696
|
-
}
|
|
1697
|
-
}
|
|
1698
|
-
}, [
|
|
1699
|
-
state.selectedRepoName,
|
|
1700
|
-
state.workflowAction,
|
|
1701
|
-
state.selectedWorkflows,
|
|
1702
|
-
state.useCurrentRepo,
|
|
1703
|
-
state.workflowExists,
|
|
1704
|
-
state.secretExists,
|
|
1705
|
-
state.authType
|
|
1706
|
-
]);
|
|
1707
|
-
async function openGitHubAppInstallation() {
|
|
1708
|
-
const installUrl = "https://github.com/apps/claude";
|
|
1709
|
-
await openBrowser(installUrl);
|
|
1710
|
-
}
|
|
1711
|
-
async function checkRepositoryPermissions(repoName) {
|
|
1712
|
-
try {
|
|
1713
|
-
const result = await execFileNoThrow("gh", [
|
|
1714
|
-
"api",
|
|
1715
|
-
`repos/${repoName}`,
|
|
1716
|
-
"--jq",
|
|
1717
|
-
".permissions.admin"
|
|
1718
|
-
]);
|
|
1719
|
-
if (result.code === 0) {
|
|
1720
|
-
const hasAdmin = result.stdout.trim() === "true";
|
|
1721
|
-
return { hasAccess: hasAdmin };
|
|
1722
|
-
}
|
|
1723
|
-
if (result.stderr.includes("404") || result.stderr.includes("Not Found")) {
|
|
1724
|
-
return {
|
|
1725
|
-
hasAccess: false,
|
|
1726
|
-
error: "repository_not_found"
|
|
1727
|
-
};
|
|
1728
|
-
}
|
|
1729
|
-
return { hasAccess: false };
|
|
1730
|
-
} catch {
|
|
1731
|
-
return { hasAccess: false };
|
|
1732
|
-
}
|
|
1733
|
-
}
|
|
1734
|
-
async function checkExistingWorkflowFile(repoName) {
|
|
1735
|
-
const checkFileResult = await execFileNoThrow("gh", [
|
|
1736
|
-
"api",
|
|
1737
|
-
`repos/${repoName}/contents/.github/workflows/claude.yml`,
|
|
1738
|
-
"--jq",
|
|
1739
|
-
".sha"
|
|
1740
|
-
]);
|
|
1741
|
-
return checkFileResult.code === 0;
|
|
1742
|
-
}
|
|
1743
|
-
async function checkExistingSecret() {
|
|
1744
|
-
const checkSecretsResult = await execFileNoThrow("gh", [
|
|
1745
|
-
"secret",
|
|
1746
|
-
"list",
|
|
1747
|
-
"--app",
|
|
1748
|
-
"actions",
|
|
1749
|
-
"--repo",
|
|
1750
|
-
state.selectedRepoName
|
|
1751
|
-
]);
|
|
1752
|
-
if (checkSecretsResult.code === 0) {
|
|
1753
|
-
const lines = checkSecretsResult.stdout.split(`
|
|
1754
|
-
`);
|
|
1755
|
-
const hasAnthropicKey = lines.some((line) => {
|
|
1756
|
-
return /^ANTHROPIC_API_KEY\s+/.test(line);
|
|
1757
|
-
});
|
|
1758
|
-
if (hasAnthropicKey) {
|
|
1759
|
-
setState((prev) => ({
|
|
1760
|
-
...prev,
|
|
1761
|
-
secretExists: true,
|
|
1762
|
-
step: "check-existing-secret"
|
|
1763
|
-
}));
|
|
1764
|
-
} else {
|
|
1765
|
-
if (existingApiKey) {
|
|
1766
|
-
setState((prev) => ({
|
|
1767
|
-
...prev,
|
|
1768
|
-
apiKeyOrOAuthToken: existingApiKey,
|
|
1769
|
-
useExistingKey: true
|
|
1770
|
-
}));
|
|
1771
|
-
await runSetupGitHubActions(existingApiKey, state.secretName);
|
|
1772
|
-
} else {
|
|
1773
|
-
setState((prev) => ({ ...prev, step: "api-key" }));
|
|
1774
|
-
}
|
|
1775
|
-
}
|
|
1776
|
-
} else {
|
|
1777
|
-
if (existingApiKey) {
|
|
1778
|
-
setState((prev) => ({
|
|
1779
|
-
...prev,
|
|
1780
|
-
apiKeyOrOAuthToken: existingApiKey,
|
|
1781
|
-
useExistingKey: true
|
|
1782
|
-
}));
|
|
1783
|
-
await runSetupGitHubActions(existingApiKey, state.secretName);
|
|
1784
|
-
} else {
|
|
1785
|
-
setState((prev) => ({ ...prev, step: "api-key" }));
|
|
1786
|
-
}
|
|
1787
|
-
}
|
|
1788
|
-
}
|
|
1789
|
-
const handleSubmit = async () => {
|
|
1790
|
-
if (state.step === "warnings") {
|
|
1791
|
-
logEvent("tengu_install_github_app_step_completed", {
|
|
1792
|
-
step: "warnings"
|
|
1793
|
-
});
|
|
1794
|
-
setState((prev) => ({ ...prev, step: "install-app" }));
|
|
1795
|
-
setTimeout(openGitHubAppInstallation, 0);
|
|
1796
|
-
} else if (state.step === "choose-repo") {
|
|
1797
|
-
let repoName = state.useCurrentRepo ? state.currentRepo : state.selectedRepoName;
|
|
1798
|
-
if (!repoName.trim()) {
|
|
1799
|
-
return;
|
|
1800
|
-
}
|
|
1801
|
-
const repoWarnings = [];
|
|
1802
|
-
if (repoName.includes("github.com")) {
|
|
1803
|
-
const match = repoName.match(/github\.com[:/]([^/]+\/[^/]+)(\.git)?$/);
|
|
1804
|
-
if (!match) {
|
|
1805
|
-
repoWarnings.push({
|
|
1806
|
-
title: "Invalid GitHub URL format",
|
|
1807
|
-
message: "The repository URL format appears to be invalid.",
|
|
1808
|
-
instructions: [
|
|
1809
|
-
"Use format: owner/repo or https://github.com/owner/repo",
|
|
1810
|
-
"Example: anthropics/claude-cli"
|
|
1811
|
-
]
|
|
1812
|
-
});
|
|
1813
|
-
} else {
|
|
1814
|
-
repoName = match[1]?.replace(/\.git$/, "") || "";
|
|
1815
|
-
}
|
|
1816
|
-
}
|
|
1817
|
-
if (!repoName.includes("/")) {
|
|
1818
|
-
repoWarnings.push({
|
|
1819
|
-
title: "Repository format warning",
|
|
1820
|
-
message: 'Repository should be in format "owner/repo"',
|
|
1821
|
-
instructions: [
|
|
1822
|
-
"Use format: owner/repo",
|
|
1823
|
-
"Example: anthropics/claude-cli"
|
|
1824
|
-
]
|
|
1825
|
-
});
|
|
1826
|
-
}
|
|
1827
|
-
const permissionCheck = await checkRepositoryPermissions(repoName);
|
|
1828
|
-
if (permissionCheck.error === "repository_not_found") {
|
|
1829
|
-
repoWarnings.push({
|
|
1830
|
-
title: "Repository not found",
|
|
1831
|
-
message: `Repository ${repoName} was not found or you don't have access.`,
|
|
1832
|
-
instructions: [
|
|
1833
|
-
`Check that the repository name is correct: ${repoName}`,
|
|
1834
|
-
"Ensure you have access to this repository",
|
|
1835
|
-
'For private repositories, make sure your GitHub token has the "repo" scope',
|
|
1836
|
-
"You can add the repo scope with: gh auth refresh -h github.com -s repo,workflow"
|
|
1837
|
-
]
|
|
1838
|
-
});
|
|
1839
|
-
} else if (!permissionCheck.hasAccess) {
|
|
1840
|
-
repoWarnings.push({
|
|
1841
|
-
title: "Admin permissions required",
|
|
1842
|
-
message: `You might need admin permissions on ${repoName} to set up GitHub Actions.`,
|
|
1843
|
-
instructions: [
|
|
1844
|
-
"Repository admins can install GitHub Apps and set secrets",
|
|
1845
|
-
"Ask a repository admin to run this command if setup fails",
|
|
1846
|
-
"Alternatively, you can use the manual setup instructions"
|
|
1847
|
-
]
|
|
1848
|
-
});
|
|
1849
|
-
}
|
|
1850
|
-
const workflowExists = await checkExistingWorkflowFile(repoName);
|
|
1851
|
-
if (repoWarnings.length > 0) {
|
|
1852
|
-
const allWarnings = [...state.warnings, ...repoWarnings];
|
|
1853
|
-
setState((prev) => ({
|
|
1854
|
-
...prev,
|
|
1855
|
-
selectedRepoName: repoName,
|
|
1856
|
-
workflowExists,
|
|
1857
|
-
warnings: allWarnings,
|
|
1858
|
-
step: "warnings"
|
|
1859
|
-
}));
|
|
1860
|
-
} else {
|
|
1861
|
-
logEvent("tengu_install_github_app_step_completed", {
|
|
1862
|
-
step: "choose-repo"
|
|
1863
|
-
});
|
|
1864
|
-
setState((prev) => ({
|
|
1865
|
-
...prev,
|
|
1866
|
-
selectedRepoName: repoName,
|
|
1867
|
-
workflowExists,
|
|
1868
|
-
step: "install-app"
|
|
1869
|
-
}));
|
|
1870
|
-
setTimeout(openGitHubAppInstallation, 0);
|
|
1871
|
-
}
|
|
1872
|
-
} else if (state.step === "install-app") {
|
|
1873
|
-
logEvent("tengu_install_github_app_step_completed", {
|
|
1874
|
-
step: "install-app"
|
|
1875
|
-
});
|
|
1876
|
-
if (state.workflowExists) {
|
|
1877
|
-
setState((prev) => ({ ...prev, step: "check-existing-workflow" }));
|
|
1878
|
-
} else {
|
|
1879
|
-
setState((prev) => ({ ...prev, step: "select-workflows" }));
|
|
1880
|
-
}
|
|
1881
|
-
} else if (state.step === "check-existing-workflow") {
|
|
1882
|
-
return;
|
|
1883
|
-
} else if (state.step === "select-workflows") {
|
|
1884
|
-
return;
|
|
1885
|
-
} else if (state.step === "check-existing-secret") {
|
|
1886
|
-
logEvent("tengu_install_github_app_step_completed", {
|
|
1887
|
-
step: "check-existing-secret"
|
|
1888
|
-
});
|
|
1889
|
-
if (state.useExistingSecret) {
|
|
1890
|
-
await runSetupGitHubActions(null, state.secretName);
|
|
1891
|
-
} else {
|
|
1892
|
-
await runSetupGitHubActions(state.apiKeyOrOAuthToken, state.secretName);
|
|
1893
|
-
}
|
|
1894
|
-
} else if (state.step === "api-key") {
|
|
1895
|
-
if (state.selectedApiKeyOption === "oauth") {
|
|
1896
|
-
return;
|
|
1897
|
-
}
|
|
1898
|
-
const apiKeyToUse = state.selectedApiKeyOption === "existing" ? existingApiKey : state.apiKeyOrOAuthToken;
|
|
1899
|
-
if (!apiKeyToUse) {
|
|
1900
|
-
logEvent("tengu_install_github_app_error", {
|
|
1901
|
-
reason: "api_key_missing"
|
|
1902
|
-
});
|
|
1903
|
-
setState((prev) => ({
|
|
1904
|
-
...prev,
|
|
1905
|
-
step: "error",
|
|
1906
|
-
error: "API key is required"
|
|
1907
|
-
}));
|
|
1908
|
-
return;
|
|
1909
|
-
}
|
|
1910
|
-
setState((prev) => ({
|
|
1911
|
-
...prev,
|
|
1912
|
-
apiKeyOrOAuthToken: apiKeyToUse,
|
|
1913
|
-
useExistingKey: state.selectedApiKeyOption === "existing"
|
|
1914
|
-
}));
|
|
1915
|
-
const checkSecretsResult = await execFileNoThrow("gh", [
|
|
1916
|
-
"secret",
|
|
1917
|
-
"list",
|
|
1918
|
-
"--app",
|
|
1919
|
-
"actions",
|
|
1920
|
-
"--repo",
|
|
1921
|
-
state.selectedRepoName
|
|
1922
|
-
]);
|
|
1923
|
-
if (checkSecretsResult.code === 0) {
|
|
1924
|
-
const lines = checkSecretsResult.stdout.split(`
|
|
1925
|
-
`);
|
|
1926
|
-
const hasAnthropicKey = lines.some((line) => {
|
|
1927
|
-
return /^ANTHROPIC_API_KEY\s+/.test(line);
|
|
1928
|
-
});
|
|
1929
|
-
if (hasAnthropicKey) {
|
|
1930
|
-
logEvent("tengu_install_github_app_step_completed", {
|
|
1931
|
-
step: "api-key"
|
|
1932
|
-
});
|
|
1933
|
-
setState((prev) => ({
|
|
1934
|
-
...prev,
|
|
1935
|
-
secretExists: true,
|
|
1936
|
-
step: "check-existing-secret"
|
|
1937
|
-
}));
|
|
1938
|
-
} else {
|
|
1939
|
-
logEvent("tengu_install_github_app_step_completed", {
|
|
1940
|
-
step: "api-key"
|
|
1941
|
-
});
|
|
1942
|
-
await runSetupGitHubActions(apiKeyToUse, state.secretName);
|
|
1943
|
-
}
|
|
1944
|
-
} else {
|
|
1945
|
-
logEvent("tengu_install_github_app_step_completed", {
|
|
1946
|
-
step: "api-key"
|
|
1947
|
-
});
|
|
1948
|
-
await runSetupGitHubActions(apiKeyToUse, state.secretName);
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
};
|
|
1952
|
-
const handleRepoUrlChange = (value) => {
|
|
1953
|
-
setState((prev) => ({ ...prev, selectedRepoName: value }));
|
|
1954
|
-
};
|
|
1955
|
-
const handleApiKeyChange = (value) => {
|
|
1956
|
-
setState((prev) => ({ ...prev, apiKeyOrOAuthToken: value }));
|
|
1957
|
-
};
|
|
1958
|
-
const handleApiKeyOptionChange = (option) => {
|
|
1959
|
-
setState((prev) => ({ ...prev, selectedApiKeyOption: option }));
|
|
1960
|
-
};
|
|
1961
|
-
const handleCreateOAuthToken = import_react5.useCallback(() => {
|
|
1962
|
-
logEvent("tengu_install_github_app_step_completed", {
|
|
1963
|
-
step: "api-key"
|
|
1964
|
-
});
|
|
1965
|
-
setState((prev) => ({ ...prev, step: "oauth-flow" }));
|
|
1966
|
-
}, []);
|
|
1967
|
-
const handleOAuthSuccess = import_react5.useCallback((token) => {
|
|
1968
|
-
logEvent("tengu_install_github_app_step_completed", {
|
|
1969
|
-
step: "oauth-flow"
|
|
1970
|
-
});
|
|
1971
|
-
setState((prev) => ({
|
|
1972
|
-
...prev,
|
|
1973
|
-
apiKeyOrOAuthToken: token,
|
|
1974
|
-
useExistingKey: false,
|
|
1975
|
-
secretName: "CLAUDE_CODE_OAUTH_TOKEN",
|
|
1976
|
-
authType: "oauth_token"
|
|
1977
|
-
}));
|
|
1978
|
-
runSetupGitHubActions(token, "CLAUDE_CODE_OAUTH_TOKEN");
|
|
1979
|
-
}, [runSetupGitHubActions]);
|
|
1980
|
-
const handleOAuthCancel = import_react5.useCallback(() => {
|
|
1981
|
-
setState((prev) => ({ ...prev, step: "api-key" }));
|
|
1982
|
-
}, []);
|
|
1983
|
-
const handleSecretNameChange = (value) => {
|
|
1984
|
-
if (value && !/^[a-zA-Z0-9_]+$/.test(value))
|
|
1985
|
-
return;
|
|
1986
|
-
setState((prev) => ({ ...prev, secretName: value }));
|
|
1987
|
-
};
|
|
1988
|
-
const handleToggleUseCurrentRepo = (useCurrentRepo) => {
|
|
1989
|
-
setState((prev) => ({
|
|
1990
|
-
...prev,
|
|
1991
|
-
useCurrentRepo,
|
|
1992
|
-
selectedRepoName: useCurrentRepo ? prev.currentRepo : ""
|
|
1993
|
-
}));
|
|
1994
|
-
};
|
|
1995
|
-
const handleToggleUseExistingKey = (useExistingKey) => {
|
|
1996
|
-
setState((prev) => ({ ...prev, useExistingKey }));
|
|
1997
|
-
};
|
|
1998
|
-
const handleToggleUseExistingSecret = (useExistingSecret) => {
|
|
1999
|
-
setState((prev) => ({
|
|
2000
|
-
...prev,
|
|
2001
|
-
useExistingSecret,
|
|
2002
|
-
secretName: useExistingSecret ? "ANTHROPIC_API_KEY" : ""
|
|
2003
|
-
}));
|
|
2004
|
-
};
|
|
2005
|
-
const handleWorkflowAction = async (action) => {
|
|
2006
|
-
if (action === "exit") {
|
|
2007
|
-
props.onDone("Installation cancelled by user");
|
|
2008
|
-
return;
|
|
2009
|
-
}
|
|
2010
|
-
logEvent("tengu_install_github_app_step_completed", {
|
|
2011
|
-
step: "check-existing-workflow"
|
|
2012
|
-
});
|
|
2013
|
-
setState((prev) => ({ ...prev, workflowAction: action }));
|
|
2014
|
-
if (action === "skip" || action === "update") {
|
|
2015
|
-
if (existingApiKey) {
|
|
2016
|
-
await checkExistingSecret();
|
|
2017
|
-
} else {
|
|
2018
|
-
setState((prev) => ({ ...prev, step: "api-key" }));
|
|
2019
|
-
}
|
|
2020
|
-
}
|
|
2021
|
-
};
|
|
2022
|
-
function handleDismissKeyDown(e) {
|
|
2023
|
-
e.preventDefault();
|
|
2024
|
-
if (state.step === "success") {
|
|
2025
|
-
logEvent("tengu_install_github_app_completed", {});
|
|
2026
|
-
}
|
|
2027
|
-
props.onDone(state.step === "success" ? "GitHub Actions setup complete!" : state.error ? `Couldn't install GitHub App: ${state.error}
|
|
2028
|
-
For manual setup instructions, see: ${GITHUB_ACTION_SETUP_DOCS_URL}` : `GitHub App installation failed
|
|
2029
|
-
For manual setup instructions, see: ${GITHUB_ACTION_SETUP_DOCS_URL}`);
|
|
2030
|
-
}
|
|
2031
|
-
switch (state.step) {
|
|
2032
|
-
case "check-gh":
|
|
2033
|
-
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(CheckGitHubStep, {}, undefined, false, undefined, this);
|
|
2034
|
-
case "warnings":
|
|
2035
|
-
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(WarningsStep, {
|
|
2036
|
-
warnings: state.warnings,
|
|
2037
|
-
onContinue: handleSubmit
|
|
2038
|
-
}, undefined, false, undefined, this);
|
|
2039
|
-
case "choose-repo":
|
|
2040
|
-
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ChooseRepoStep, {
|
|
2041
|
-
currentRepo: state.currentRepo,
|
|
2042
|
-
useCurrentRepo: state.useCurrentRepo,
|
|
2043
|
-
repoUrl: state.selectedRepoName,
|
|
2044
|
-
onRepoUrlChange: handleRepoUrlChange,
|
|
2045
|
-
onToggleUseCurrentRepo: handleToggleUseCurrentRepo,
|
|
2046
|
-
onSubmit: handleSubmit
|
|
2047
|
-
}, undefined, false, undefined, this);
|
|
2048
|
-
case "install-app":
|
|
2049
|
-
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(InstallAppStep, {
|
|
2050
|
-
repoUrl: state.selectedRepoName,
|
|
2051
|
-
onSubmit: handleSubmit
|
|
2052
|
-
}, undefined, false, undefined, this);
|
|
2053
|
-
case "check-existing-workflow":
|
|
2054
|
-
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ExistingWorkflowStep, {
|
|
2055
|
-
repoName: state.selectedRepoName,
|
|
2056
|
-
onSelectAction: handleWorkflowAction
|
|
2057
|
-
}, undefined, false, undefined, this);
|
|
2058
|
-
case "check-existing-secret":
|
|
2059
|
-
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(CheckExistingSecretStep, {
|
|
2060
|
-
useExistingSecret: state.useExistingSecret,
|
|
2061
|
-
secretName: state.secretName,
|
|
2062
|
-
onToggleUseExistingSecret: handleToggleUseExistingSecret,
|
|
2063
|
-
onSecretNameChange: handleSecretNameChange,
|
|
2064
|
-
onSubmit: handleSubmit
|
|
2065
|
-
}, undefined, false, undefined, this);
|
|
2066
|
-
case "api-key":
|
|
2067
|
-
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ApiKeyStep, {
|
|
2068
|
-
existingApiKey,
|
|
2069
|
-
useExistingKey: state.useExistingKey,
|
|
2070
|
-
apiKeyOrOAuthToken: state.apiKeyOrOAuthToken,
|
|
2071
|
-
onApiKeyChange: handleApiKeyChange,
|
|
2072
|
-
onToggleUseExistingKey: handleToggleUseExistingKey,
|
|
2073
|
-
onSubmit: handleSubmit,
|
|
2074
|
-
onCreateOAuthToken: undefined,
|
|
2075
|
-
selectedOption: state.selectedApiKeyOption,
|
|
2076
|
-
onSelectOption: handleApiKeyOptionChange
|
|
2077
|
-
}, undefined, false, undefined, this);
|
|
2078
|
-
case "creating":
|
|
2079
|
-
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(CreatingStep, {
|
|
2080
|
-
currentWorkflowInstallStep: state.currentWorkflowInstallStep,
|
|
2081
|
-
secretExists: state.secretExists,
|
|
2082
|
-
useExistingSecret: state.useExistingSecret,
|
|
2083
|
-
secretName: state.secretName,
|
|
2084
|
-
skipWorkflow: state.workflowAction === "skip",
|
|
2085
|
-
selectedWorkflows: state.selectedWorkflows
|
|
2086
|
-
}, undefined, false, undefined, this);
|
|
2087
|
-
case "success":
|
|
2088
|
-
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
|
|
2089
|
-
tabIndex: 0,
|
|
2090
|
-
autoFocus: true,
|
|
2091
|
-
onKeyDown: handleDismissKeyDown,
|
|
2092
|
-
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(SuccessStep, {
|
|
2093
|
-
secretExists: state.secretExists,
|
|
2094
|
-
useExistingSecret: state.useExistingSecret,
|
|
2095
|
-
secretName: state.secretName,
|
|
2096
|
-
skipWorkflow: state.workflowAction === "skip"
|
|
2097
|
-
}, undefined, false, undefined, this)
|
|
2098
|
-
}, undefined, false, undefined, this);
|
|
2099
|
-
case "error":
|
|
2100
|
-
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
|
|
2101
|
-
tabIndex: 0,
|
|
2102
|
-
autoFocus: true,
|
|
2103
|
-
onKeyDown: handleDismissKeyDown,
|
|
2104
|
-
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ErrorStep, {
|
|
2105
|
-
error: state.error,
|
|
2106
|
-
errorReason: state.errorReason,
|
|
2107
|
-
errorInstructions: state.errorInstructions
|
|
2108
|
-
}, undefined, false, undefined, this)
|
|
2109
|
-
}, undefined, false, undefined, this);
|
|
2110
|
-
case "select-workflows":
|
|
2111
|
-
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(WorkflowMultiselectDialog, {
|
|
2112
|
-
defaultSelections: state.selectedWorkflows,
|
|
2113
|
-
onSubmit: (selectedWorkflows) => {
|
|
2114
|
-
logEvent("tengu_install_github_app_step_completed", {
|
|
2115
|
-
step: "select-workflows"
|
|
2116
|
-
});
|
|
2117
|
-
setState((prev) => ({
|
|
2118
|
-
...prev,
|
|
2119
|
-
selectedWorkflows
|
|
2120
|
-
}));
|
|
2121
|
-
if (existingApiKey) {
|
|
2122
|
-
checkExistingSecret();
|
|
2123
|
-
} else {
|
|
2124
|
-
setState((prev) => ({ ...prev, step: "api-key" }));
|
|
2125
|
-
}
|
|
2126
|
-
}
|
|
2127
|
-
}, undefined, false, undefined, this);
|
|
2128
|
-
case "oauth-flow":
|
|
2129
|
-
setState((prev) => ({ ...prev, step: "api-key" }));
|
|
2130
|
-
return null;
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
2133
|
-
async function call(onDone) {
|
|
2134
|
-
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(InstallGitHubApp, {
|
|
2135
|
-
onDone
|
|
2136
|
-
}, undefined, false, undefined, this);
|
|
2137
|
-
}
|
|
2138
|
-
var import_react5, jsx_dev_runtime12, INITIAL_STATE;
|
|
2139
|
-
var init_install_github_app = __esm(() => {
|
|
2140
|
-
init_execa();
|
|
2141
|
-
init_analytics();
|
|
2142
|
-
init_WorkflowMultiselectDialog();
|
|
2143
|
-
init_github_app();
|
|
2144
|
-
init_useExitOnCtrlCDWithKeybindings();
|
|
2145
|
-
init_src();
|
|
2146
|
-
init_auth();
|
|
2147
|
-
init_browser();
|
|
2148
|
-
init_execFileNoThrow();
|
|
2149
|
-
init_git();
|
|
2150
|
-
init_stringUtils();
|
|
2151
|
-
init_ApiKeyStep();
|
|
2152
|
-
init_CheckExistingSecretStep();
|
|
2153
|
-
init_CheckGitHubStep();
|
|
2154
|
-
init_ChooseRepoStep();
|
|
2155
|
-
init_CreatingStep();
|
|
2156
|
-
init_ErrorStep();
|
|
2157
|
-
init_ExistingWorkflowStep();
|
|
2158
|
-
init_InstallAppStep();
|
|
2159
|
-
init_SuccessStep();
|
|
2160
|
-
init_setupGitHubActions();
|
|
2161
|
-
init_WarningsStep();
|
|
2162
|
-
import_react5 = __toESM(require_react(), 1);
|
|
2163
|
-
jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
|
|
2164
|
-
INITIAL_STATE = {
|
|
2165
|
-
step: "check-gh",
|
|
2166
|
-
selectedRepoName: "",
|
|
2167
|
-
currentRepo: "",
|
|
2168
|
-
useCurrentRepo: false,
|
|
2169
|
-
apiKeyOrOAuthToken: "",
|
|
2170
|
-
useExistingKey: true,
|
|
2171
|
-
currentWorkflowInstallStep: 0,
|
|
2172
|
-
warnings: [],
|
|
2173
|
-
secretExists: false,
|
|
2174
|
-
secretName: "ANTHROPIC_API_KEY",
|
|
2175
|
-
useExistingSecret: true,
|
|
2176
|
-
workflowExists: false,
|
|
2177
|
-
selectedWorkflows: ["claude", "claude-review"],
|
|
2178
|
-
selectedApiKeyOption: "new",
|
|
2179
|
-
authType: "api_key"
|
|
2180
|
-
};
|
|
2181
|
-
});
|
|
2182
|
-
init_install_github_app();
|
|
2183
|
-
|
|
2184
|
-
export {
|
|
2185
|
-
call
|
|
2186
|
-
};
|