claude-code-best 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -75
- package/dist/chunk-03hxwxzh.js +344 -0
- package/dist/chunk-07069jq1.js +30 -0
- package/dist/{chunk-kq098bkj.js → chunk-08g51x43.js} +254 -320
- package/dist/{chunk-7tqhx6dr.js → chunk-093r60b7.js} +109 -213
- package/dist/{chunk-ahjgghpe.js → chunk-0aya4737.js} +1 -1
- package/dist/{chunk-b4mnbry0.js → chunk-0fsdxz74.js} +4 -4
- package/dist/chunk-0jzdwbdc.js +14 -0
- package/dist/chunk-0mbxeb5q.js +406 -0
- package/dist/chunk-0pryepme.js +66 -0
- package/dist/chunk-0qsm7jac.js +169 -0
- package/dist/{chunk-1cbn5kxf.js → chunk-0rpb2bdp.js} +3 -2
- package/dist/chunk-0se7sxd4.js +38 -0
- package/dist/{chunk-3m7ge6tj.js → chunk-0xnepnph.js} +14 -12
- package/dist/{chunk-q7tvkc86.js → chunk-0zsam7pn.js} +10 -115
- package/dist/{chunk-44fpr6jq.js → chunk-168xb8v1.js} +4 -2
- package/dist/{chunk-bj0rvnjw.js → chunk-19h3a9pw.js} +40 -30
- package/dist/chunk-19wjkpe7.js +115 -0
- package/dist/{chunk-wsqhnjj3.js → chunk-1atfzck5.js} +24 -24
- package/dist/{chunk-0e1xsncc.js → chunk-1cwdhk7a.js} +1 -1
- package/dist/{chunk-c8jv6rtj.js → chunk-1hq59w8z.js} +78 -69
- package/dist/chunk-1qzk963z.js +108 -0
- package/dist/{chunk-fk06pejm.js → chunk-1rrmvwjn.js} +9 -9
- package/dist/{chunk-d18z9pna.js → chunk-1thgdca1.js} +2 -2
- package/dist/chunk-1tjnmcw7.js +68 -0
- package/dist/chunk-1xj83yc8.js +219 -0
- package/dist/chunk-21j2jfen.js +435 -0
- package/dist/{chunk-wc6wwwyb.js → chunk-21z7acxh.js} +3 -3
- package/dist/chunk-22gbbc5x.js +313 -0
- package/dist/chunk-238g70xa.js +1 -1
- package/dist/{chunk-vpb723tx.js → chunk-23ad5t92.js} +5 -5
- package/dist/{chunk-vbbf707n.js → chunk-24r3gfks.js} +39 -29
- package/dist/chunk-24sahbec.js +71 -0
- package/dist/chunk-28az45r7.js +112 -0
- package/dist/{chunk-9g827w4j.js → chunk-2q39ej51.js} +6 -6
- package/dist/chunk-2qwgfjcj.js +5370 -0
- package/dist/{chunk-0cpnzx7t.js → chunk-2rgvd09y.js} +118 -151
- package/dist/chunk-2wq8q15s.js +475 -0
- package/dist/{chunk-bqq4zamw.js → chunk-2ys5wcxk.js} +3 -3
- package/dist/{chunk-t24ytdcw.js → chunk-31nce7eh.js} +12 -10
- package/dist/chunk-31q6p2ke.js +123 -0
- package/dist/chunk-3394wc12.js +1024 -0
- package/dist/{chunk-33khw5gy.js → chunk-365zvqv3.js} +7 -7
- package/dist/{chunk-9g2ncq68.js → chunk-36gkb95k.js} +124 -128
- package/dist/{chunk-khdjg2v9.js → chunk-37y42ayh.js} +39 -29
- package/dist/chunk-3816xd5p.js +195 -0
- package/dist/chunk-3a6bynts.js +656 -0
- package/dist/{chunk-qvd0k5dn.js → chunk-3avfhw6x.js} +190 -348
- package/dist/{chunk-660kcy7p.js → chunk-3b25ycrx.js} +14 -8
- package/dist/chunk-3b4xhwhp.js +113 -0
- package/dist/chunk-3fjzvf0e.js +128 -0
- package/dist/chunk-3fvc0a79.js +67 -0
- package/dist/chunk-3g50kcwk.js +513 -0
- package/dist/chunk-3jnmy0nd.js +114 -0
- package/dist/chunk-3jzsxj3v.js +310 -0
- package/dist/{chunk-frbv3xqa.js → chunk-3mpfxbab.js} +2 -2
- package/dist/{chunk-aqa7w38f.js → chunk-3v03e2kz.js} +5 -5
- package/dist/chunk-3x5hdd5g.js +1030 -0
- package/dist/{chunk-mecs0gpc.js → chunk-3xv7rjsy.js} +14 -11
- package/dist/{chunk-j3215c49.js → chunk-3ygnhge8.js} +232 -372
- package/dist/chunk-42x5tjk2.js +42 -0
- package/dist/chunk-430tvx8d.js +110 -0
- package/dist/{chunk-dh6c8y1j.js → chunk-43h8sw5x.js} +3 -3
- package/dist/chunk-44d150tz.js +1175 -0
- package/dist/chunk-45dj834r.js +115 -0
- package/dist/{chunk-yhd82045.js → chunk-46fcr28b.js} +30 -9
- package/dist/{chunk-wm2f2f1z.js → chunk-474y75ga.js} +2 -2
- package/dist/{chunk-6fkwz9yk.js → chunk-478rpnqm.js} +8 -8
- package/dist/{chunk-83z0wrnz.js → chunk-47j9e6m2.js} +2 -2
- package/dist/chunk-47wqjw88.js +112 -0
- package/dist/{chunk-v4t6dyyh.js → chunk-4cp6193g.js} +2 -2
- package/dist/chunk-4h102wt5.js +65 -0
- package/dist/{chunk-3mgywd32.js → chunk-4hv90qcz.js} +1 -1
- package/dist/chunk-4k2270je.js +295 -0
- package/dist/{chunk-2wcbcdky.js → chunk-4k842par.js} +5 -5
- package/dist/chunk-4nspekjp.js +69 -0
- package/dist/chunk-4pjqtps4.js +151 -0
- package/dist/chunk-4sehjy27.js +112 -0
- package/dist/{chunk-pgnnrm2v.js → chunk-4t86n23n.js} +21 -17
- package/dist/{chunk-2de1vaxf.js → chunk-4whfjn78.js} +68 -78
- package/dist/{chunk-41mpwc8h.js → chunk-53c9gb9c.js} +19 -15
- package/dist/chunk-53kt8caz.js +122 -0
- package/dist/chunk-5a6ahhvy.js +594 -0
- package/dist/{chunk-12pv5fez.js → chunk-5gbqknz6.js} +10 -8
- package/dist/{chunk-hfzj1m07.js → chunk-5kkvfgzs.js} +14 -5
- package/dist/{chunk-4ycz58wj.js → chunk-5pxygepg.js} +68 -8
- package/dist/{chunk-2w8633e3.js → chunk-5rgbq3kf.js} +61 -100
- package/dist/{chunk-ggqx30m9.js → chunk-5z28bqne.js} +23 -311
- package/dist/{chunk-7ejt5gqq.js → chunk-5z8w2q5k.js} +65 -48
- package/dist/chunk-60k6v40t.js +70 -0
- package/dist/{chunk-p7g7pf3f.js → chunk-61ahbn23.js} +8 -6
- package/dist/{chunk-rmbp2das.js → chunk-64pp4hsr.js} +21 -19
- package/dist/{chunk-0sb5scxx.js → chunk-652wnf1z.js} +5 -5
- package/dist/{chunk-q25bjaev.js → chunk-677as3nh.js} +2 -2
- package/dist/{chunk-xs0hwvpa.js → chunk-68pfxvxt.js} +14 -9
- package/dist/{chunk-epmheefa.js → chunk-69hys77v.js} +8 -8
- package/dist/{chunk-427m88ms.js → chunk-6p1cptq5.js} +9 -9
- package/dist/{chunk-0nqrscrr.js → chunk-6p3mtny2.js} +5 -5
- package/dist/{chunk-v1mgv1et.js → chunk-6p4cyhb3.js} +4 -3
- package/dist/{chunk-m17y8b22.js → chunk-6rxz872v.js} +39 -29
- package/dist/chunk-6sjxvthw.js +106 -0
- package/dist/{chunk-6mz58s8p.js → chunk-6xana182.js} +18 -14
- package/dist/{chunk-vaebptnz.js → chunk-6zn3fm1k.js} +39 -29
- package/dist/chunk-704jkbsp.js +183 -0
- package/dist/chunk-71sf47by.js +154 -0
- package/dist/chunk-73a5g713.js +78 -0
- package/dist/chunk-78p7h20f.js +259 -0
- package/dist/chunk-7a3b1d4s.js +75 -0
- package/dist/{chunk-fpf4cgbt.js → chunk-7bfach0x.js} +9 -9
- package/dist/{chunk-ckcagq32.js → chunk-7gqf9wej.js} +5 -5
- package/dist/{chunk-sa7nc0vv.js → chunk-7y25wk51.js} +1 -1
- package/dist/{chunk-vyd8jzde.js → chunk-81v55vtd.js} +96 -85
- package/dist/{chunk-dv1wfr85.js → chunk-8225arm6.js} +5 -4
- package/dist/chunk-86715d2d.js +186 -0
- package/dist/chunk-8ah9easf.js +365 -0
- package/dist/{chunk-rwexx5ns.js → chunk-8baq1s87.js} +1 -3
- package/dist/chunk-8fy8hx84.js +386 -0
- package/dist/{chunk-4pbx3g7s.js → chunk-8g747a8x.js} +1 -1
- package/dist/{chunk-xyqr1cww.js → chunk-8me0yq6v.js} +12 -12
- package/dist/{chunk-sdj9b9wh.js → chunk-8pn8tvgg.js} +9 -154
- package/dist/chunk-8qxyxgkb.js +161 -0
- package/dist/{chunk-ecsw41df.js → chunk-8xs4yp9x.js} +85 -77
- package/dist/{chunk-24x87knx.js → chunk-9000dg9h.js} +1327 -2882
- package/dist/{chunk-bmvb57qb.js → chunk-905d2hee.js} +5 -5
- package/dist/chunk-90qsc60s.js +378 -0
- package/dist/chunk-92x6xgex.js +265 -0
- package/dist/{chunk-jknt3rxg.js → chunk-9ctg4x6c.js} +7 -9
- package/dist/chunk-9e4z7dx7.js +389 -0
- package/dist/chunk-9hy6ejmp.js +151 -0
- package/dist/chunk-9jvggd30.js +173 -0
- package/dist/{chunk-z9tgzh90.js → chunk-9m729tsn.js} +46 -35
- package/dist/chunk-9r90d3jt.js +121 -0
- package/dist/chunk-9rx2m3cb.js +124 -0
- package/dist/chunk-9sr2etaw.js +110 -0
- package/dist/chunk-9z8hzgve.js +68 -0
- package/dist/{chunk-yxnwsp4f.js → chunk-9zy607vw.js} +8 -6
- package/dist/chunk-a0bz6g5e.js +63 -0
- package/dist/chunk-a136cvvz.js +27 -0
- package/dist/{chunk-n5t9m8h9.js → chunk-a1bjde7d.js} +7 -7
- package/dist/{chunk-mvss16tj.js → chunk-a2aj2mtb.js} +414 -636
- package/dist/{chunk-8hsyagr8.js → chunk-a3sfy6as.js} +1 -1
- package/dist/{chunk-8hq5kk3y.js → chunk-a4twdmhf.js} +3 -2
- package/dist/chunk-ae76ded0.js +30 -0
- package/dist/chunk-aegyxcne.js +111 -0
- package/dist/chunk-aj1dcvrh.js +131 -0
- package/dist/{chunk-1yabrspp.js → chunk-amxm6996.js} +2 -2
- package/dist/{chunk-t6h4wf3k.js → chunk-ar39mr9c.js} +11 -11
- package/dist/{chunk-r6b58y3x.js → chunk-ase86y73.js} +1 -3
- package/dist/chunk-asfxrz4f.js +94 -0
- package/dist/chunk-axj46c2c.js +196 -0
- package/dist/{chunk-m5eb5pt2.js → chunk-ayz6f38j.js} +6 -6
- package/dist/{chunk-5b7119h5.js → chunk-b00zd850.js} +8 -6
- package/dist/chunk-b2abjkf7.js +126 -0
- package/dist/{chunk-8bedvdm1.js → chunk-b81hd3m6.js} +1 -1
- package/dist/chunk-bcfd2zw7.js +20 -0
- package/dist/{chunk-n5516f5q.js → chunk-bd8zk9tn.js} +4 -4
- package/dist/chunk-bhdt6k7w.js +15 -0
- package/dist/{chunk-jy35mvy3.js → chunk-bmjmrk76.js} +7 -7
- package/dist/chunk-bqaqz1j1.js +126 -0
- package/dist/chunk-bsbmmfyt.js +17 -0
- package/dist/{chunk-snvypj85.js → chunk-bt64sq5y.js} +3 -2
- package/dist/{chunk-zq9xa1xe.js → chunk-bwevztsj.js} +109 -141
- package/dist/{chunk-vyc0rjyx.js → chunk-bwg7582d.js} +1 -1
- package/dist/{chunk-3be7ka25.js → chunk-bxcfz5gy.js} +1 -1
- package/dist/chunk-c2mn2fyg.js +1406 -0
- package/dist/chunk-c2tw0dep.js +1811 -0
- package/dist/{chunk-402jrnj6.js → chunk-c5bngssh.js} +8 -8
- package/dist/chunk-c6sjhj89.js +1284 -0
- package/dist/chunk-cb2hpe6k.js +443 -0
- package/dist/{chunk-91r0z5qq.js → chunk-ccr1s7qs.js} +1152 -1771
- package/dist/chunk-cewqh6rb.js +111 -0
- package/dist/{chunk-k9a8jemz.js → chunk-cg01f3ez.js} +7 -7
- package/dist/{chunk-f64npa3b.js → chunk-chsyvavm.js} +704 -4
- package/dist/{chunk-z8nbjar4.js → chunk-cmcbatgz.js} +7 -5
- package/dist/chunk-cnsj3vq2.js +35 -0
- package/dist/{chunk-rj86xm6z.js → chunk-cpwe0yw7.js} +1 -1
- package/dist/chunk-cqjmxeqv.js +269 -0
- package/dist/{chunk-qpm1tmzz.js → chunk-crefny3c.js} +125 -193
- package/dist/{chunk-ks0m9njy.js → chunk-d2jekryq.js} +8 -8
- package/dist/chunk-d4mdda98.js +94 -0
- package/dist/{chunk-26wtxbdc.js → chunk-d7886r6a.js} +6928 -6928
- package/dist/chunk-dfkgpfaj.js +135 -0
- package/dist/{chunk-9mfbqw9k.js → chunk-dm3n2qgd.js} +4 -4
- package/dist/chunk-dnj95atq.js +66 -0
- package/dist/{chunk-vjc1svpc.js → chunk-dqgzpb0q.js} +87 -77
- package/dist/chunk-drenq3c7.js +383 -0
- package/dist/chunk-drkm8yx2.js +34 -0
- package/dist/{chunk-ra8fbt9p.js → chunk-dvjzq9x9.js} +543 -874
- package/dist/{chunk-w7h2yphx.js → chunk-dwekpr47.js} +2 -2
- package/dist/{chunk-49k5ktrj.js → chunk-e18dg1md.js} +31 -16
- package/dist/chunk-e396ak46.js +111 -0
- package/dist/{chunk-r55r29js.js → chunk-e3c32vwa.js} +191 -276
- package/dist/chunk-e3m7kqkb.js +1185 -0
- package/dist/{chunk-9cc60ae5.js → chunk-ea9m4e0k.js} +79 -70
- package/dist/chunk-ecsa9nd5.js +63 -0
- package/dist/{chunk-cmdsbsb6.js → chunk-edzkkadh.js} +2 -2
- package/dist/chunk-ek1jasqg.js +142 -0
- package/dist/chunk-ep0hwv07.js +126 -0
- package/dist/{chunk-cs6y2pc9.js → chunk-ergam9ft.js} +5 -5
- package/dist/{chunk-ptwn7qw7.js → chunk-f2k8b4nd.js} +38 -10
- package/dist/{chunk-h0rbjg6x.js → chunk-f2mhrmww.js} +8 -1
- package/dist/{chunk-s84smrx4.js → chunk-f32cksgw.js} +155 -190
- package/dist/{chunk-vzqrbsd1.js → chunk-f69rgsm2.js} +5 -5
- package/dist/{chunk-f3bapa1x.js → chunk-f6rbj3gz.js} +12 -7
- package/dist/chunk-f7n3xete.js +113 -0
- package/dist/chunk-fbest4vx.js +109 -0
- package/dist/{chunk-v0wa5ref.js → chunk-fdtcb8qr.js} +13 -555
- package/dist/chunk-feh2j8m2.js +136 -0
- package/dist/chunk-feyzykye.js +10 -0
- package/dist/chunk-fkkysfev.js +158 -0
- package/dist/chunk-fn510gqw.js +216 -0
- package/dist/{chunk-ch53fgm5.js → chunk-ft9qsa01.js} +13 -11
- package/dist/chunk-fw0ckaxh.js +109 -0
- package/dist/{chunk-kd97kxjn.js → chunk-fz0ch109.js} +3 -2
- package/dist/{chunk-ks0dm6t3.js → chunk-fzn524wa.js} +17 -71
- package/dist/chunk-g1k68z1b.js +15 -0
- package/dist/{chunk-9t1x831d.js → chunk-g5nb4xhz.js} +86 -74
- package/dist/chunk-g82mdy27.js +429 -0
- package/dist/{chunk-68qevppc.js → chunk-g8sz060e.js} +82 -72
- package/dist/chunk-g9f19ttm.js +15 -0
- package/dist/{chunk-zz21rvr7.js → chunk-gdqxtdh4.js} +9 -6
- package/dist/chunk-get9fk3h.js +74 -0
- package/dist/{chunk-4x5ym4h2.js → chunk-gf6qjt7j.js} +130 -16
- package/dist/{chunk-bq6x1ehp.js → chunk-gpz0ddyz.js} +8 -8
- package/dist/{chunk-mwp7sj0q.js → chunk-gs5eeqmc.js} +110336 -114801
- package/dist/{chunk-qqfa0dqg.js → chunk-h4b85amj.js} +20 -32
- package/dist/{chunk-j4c8s7tn.js → chunk-h5zv78zq.js} +9 -6
- package/dist/{chunk-cgn27dqf.js → chunk-ha5d5zfj.js} +3 -3
- package/dist/{chunk-crr52hf4.js → chunk-han7cwc0.js} +14 -12
- package/dist/{chunk-dnyeb288.js → chunk-hbv0tk35.js} +74 -106
- package/dist/{chunk-nxsh6de2.js → chunk-hcgkak1j.js} +20 -125
- package/dist/{chunk-224x480q.js → chunk-hd1p4hrd.js} +8 -6
- package/dist/{chunk-tjaqa99q.js → chunk-hezj20qy.js} +3 -3
- package/dist/{chunk-z7pr85qw.js → chunk-hfdyez7b.js} +3 -3
- package/dist/chunk-hh7hqa2c.js +272 -0
- package/dist/chunk-hk4a2sks.js +83 -0
- package/dist/{chunk-5zh1fbrj.js → chunk-hq85v2s7.js} +3 -3
- package/dist/chunk-hr06142m.js +117 -0
- package/dist/chunk-j1b3r6v6.js +66 -0
- package/dist/{chunk-v8xem37v.js → chunk-j2fgn3kq.js} +8 -6
- package/dist/chunk-j2wgj22c.js +441 -0
- package/dist/{chunk-9gbamk79.js → chunk-j5bth84e.js} +5 -1
- package/dist/{chunk-vratq94g.js → chunk-j9gxwbe3.js} +1 -1
- package/dist/{chunk-cettj572.js → chunk-ja87jt56.js} +7 -131
- package/dist/{chunk-3r24h7t6.js → chunk-jaaxk89e.js} +1 -1
- package/dist/{chunk-f4jcw0ea.js → chunk-jaew3662.js} +18 -14
- package/dist/{chunk-e1ge9n4d.js → chunk-jb2nh0m0.js} +2 -2
- package/dist/{chunk-f9b4wb89.js → chunk-jb4fc073.js} +84 -75
- package/dist/chunk-jba8f3hz.js +108 -0
- package/dist/{chunk-er9vzjac.js → chunk-jbt0jgtc.js} +16 -14
- package/dist/{chunk-v399mzxk.js → chunk-jf0p00fz.js} +2 -2
- package/dist/{chunk-vygf94dw.js → chunk-jg4ge4de.js} +78 -69
- package/dist/chunk-jkvy2cmt.js +346 -0
- package/dist/{chunk-80qg1pzv.js → chunk-jmdy5vdy.js} +11 -9
- package/dist/{chunk-dqh7e4mt.js → chunk-jn08nxj8.js} +52 -42
- package/dist/{chunk-av73dywf.js → chunk-jna2tcvj.js} +8 -8
- package/dist/chunk-jwh384j5.js +126 -0
- package/dist/chunk-jwx2scxy.js +222 -0
- package/dist/{chunk-41xeh3t9.js → chunk-jy6c07wa.js} +4 -4
- package/dist/{chunk-ctmt7xh1.js → chunk-jy77nthd.js} +740 -907
- package/dist/{chunk-hzttn8j7.js → chunk-jyjpaqbt.js} +139 -135
- package/dist/chunk-jztjnw31.js +147 -0
- package/dist/chunk-k0jhzcwg.js +2540 -0
- package/dist/{chunk-myzwt5yw.js → chunk-k0kwfqr8.js} +9 -15
- package/dist/{chunk-bqfnp99q.js → chunk-k3s4yk22.js} +1 -1
- package/dist/{chunk-1dyeexvn.js → chunk-kd3mmsd2.js} +4 -4
- package/dist/{chunk-x51h62jq.js → chunk-ke78h68m.js} +78 -69
- package/dist/{chunk-1xkekb9y.js → chunk-kfd89dsd.js} +5 -3
- package/dist/chunk-ksvvwa9w.js +111 -0
- package/dist/{chunk-jy35z4n0.js → chunk-m1z5td19.js} +9 -9
- package/dist/{chunk-jafes477.js → chunk-m2bcpk8j.js} +4 -3
- package/dist/{chunk-n6fbyke9.js → chunk-m2mzpskw.js} +3 -3
- package/dist/{chunk-s2dmn3yg.js → chunk-m47q5mxt.js} +5 -5
- package/dist/{chunk-s7qj2hg5.js → chunk-m8vyp6rw.js} +2 -2
- package/dist/chunk-mm4m13ng.js +881 -0
- package/dist/{chunk-ghr4s9g6.js → chunk-mq1qrwhq.js} +79 -70
- package/dist/{chunk-45e9mkyr.js → chunk-mqqw60br.js} +43 -83
- package/dist/chunk-mtcdknc8.js +2842 -0
- package/dist/{chunk-cvge4pvp.js → chunk-mzd6frw6.js} +2 -2
- package/dist/{chunk-n2874aq5.js → chunk-n1neft0d.js} +13 -7
- package/dist/{chunk-bcrxtdcy.js → chunk-n2mysxn1.js} +40 -30
- package/dist/chunk-n4wkxbq0.js +365 -0
- package/dist/chunk-n57dw6h9.js +128 -0
- package/dist/chunk-n5wf3b82.js +118 -0
- package/dist/{chunk-zgrg0wk3.js → chunk-n7ce94nd.js} +27 -67
- package/dist/{chunk-me2ef6g4.js → chunk-n8mpqdje.js} +1 -1
- package/dist/{chunk-g5sg6y9q.js → chunk-na2e0dfj.js} +82 -72
- package/dist/chunk-netzwgv1.js +154 -0
- package/dist/{chunk-xszk7n10.js → chunk-nh3cd07f.js} +1 -1
- package/dist/{chunk-5tx8dsy0.js → chunk-npjsp3z3.js} +10493 -18453
- package/dist/{chunk-5hva0tsg.js → chunk-p2yv7m0g.js} +6 -6
- package/dist/chunk-p4rmbc1e.js +409 -0
- package/dist/chunk-p7jdncj4.js +122 -0
- package/dist/{chunk-zk2wsm7d.js → chunk-p7vkh4wx.js} +2 -2
- package/dist/{chunk-da4ve9t5.js → chunk-p8crqj70.js} +10 -10
- package/dist/{chunk-hy3g1nv8.js → chunk-prw4xz5q.js} +9 -7
- package/dist/{chunk-zsfxha74.js → chunk-pshjyzq4.js} +8 -7
- package/dist/{chunk-684kdqez.js → chunk-q08sb44h.js} +203 -304
- package/dist/{chunk-n7158r58.js → chunk-q78bgdtk.js} +79 -70
- package/dist/{chunk-e5pntxye.js → chunk-q7tpyeb3.js} +6 -4
- package/dist/{chunk-7ymfj7m3.js → chunk-q82r31er.js} +1 -1
- package/dist/chunk-qajrkk97.js +298 -0
- package/dist/chunk-qbrsmra3.js +23 -0
- package/dist/chunk-qhfn4vgv.js +66 -0
- package/dist/{chunk-d7mx1phm.js → chunk-qndzvkdx.js} +61 -103
- package/dist/{chunk-35y0r56v.js → chunk-qtfc6wdh.js} +1 -4
- package/dist/{chunk-v9y80148.js → chunk-qwcnwn5t.js} +100 -191
- package/dist/chunk-qwehvedn.js +440 -0
- package/dist/{chunk-2cgdr2n7.js → chunk-qwk9fq7r.js} +78 -69
- package/dist/chunk-qy75c2vm.js +70 -0
- package/dist/{chunk-rryx19hp.js → chunk-r2k2jy0y.js} +2 -2
- package/dist/chunk-r47p0ff0.js +61 -0
- package/dist/{chunk-t3bf8hcf.js → chunk-r5tk54yt.js} +2 -2
- package/dist/{chunk-bt9krt49.js → chunk-r8q993g6.js} +38 -32
- package/dist/{chunk-veb0gkcf.js → chunk-ra2rykps.js} +78 -69
- package/dist/{chunk-gbcqdr0x.js → chunk-rav5xp8h.js} +1 -1
- package/dist/chunk-rbe0tcn9.js +120 -0
- package/dist/chunk-rd5cfz3k.js +68 -0
- package/dist/{chunk-cenpqc2t.js → chunk-rdvaan98.js} +8 -6
- package/dist/{chunk-dr4qq42x.js → chunk-rgbbtszq.js} +9 -9
- package/dist/chunk-rjsb9s3q.js +206 -0
- package/dist/{chunk-fdwa7gem.js → chunk-rkak3kjw.js} +7 -7
- package/dist/{chunk-a6s8wnhe.js → chunk-rnam0xc5.js} +4 -4
- package/dist/chunk-rqkqbppr.js +112 -0
- package/dist/{chunk-ye18m1zb.js → chunk-rqvqqrpg.js} +38 -8
- package/dist/{chunk-rw466wqn.js → chunk-rvkvehat.js} +5284 -3093
- package/dist/chunk-s1baskk7.js +14 -0
- package/dist/{chunk-jt0pha6y.js → chunk-s5gnvx67.js} +227 -198
- package/dist/chunk-s7dtt7tw.js +109 -0
- package/dist/chunk-s9ftt1fh.js +135 -0
- package/dist/chunk-sc6sy490.js +240 -0
- package/dist/chunk-sh9er84d.js +1073 -0
- package/dist/{chunk-faycqscv.js → chunk-sk9xag9g.js} +2 -2
- package/dist/{chunk-zpc0kwkb.js → chunk-t0g8wbcq.js} +7 -7
- package/dist/chunk-tbgm1v8n.js +146 -0
- package/dist/{chunk-35b0ek0j.js → chunk-tcdv4gp8.js} +13 -9
- package/dist/{chunk-mt25echc.js → chunk-tezak8rx.js} +1 -1
- package/dist/chunk-thk6yn51.js +154 -0
- package/dist/{chunk-s2gm9vfk.js → chunk-tkf24yhv.js} +7 -7
- package/dist/{chunk-6td4c2eq.js → chunk-tkrjcekq.js} +54 -72
- package/dist/{chunk-9rcbyag3.js → chunk-tmdbrszg.js} +2 -2
- package/dist/chunk-tw2g1yhq.js +118 -0
- package/dist/chunk-twzjxwhf.js +182 -0
- package/dist/{chunk-m94pnhfa.js → chunk-v4e4f711.js} +39 -29
- package/dist/{chunk-b51jjfh5.js → chunk-v5k7zmqm.js} +43 -32
- package/dist/chunk-var1et7e.js +66 -0
- package/dist/chunk-vd11xbz3.js +304 -0
- package/dist/{chunk-hqmz36b3.js → chunk-vf612n57.js} +21 -101
- package/dist/chunk-vfhqj46w.js +144 -0
- package/dist/chunk-vkxx8ymr.js +2377 -0
- package/dist/{chunk-n9x557ea.js → chunk-vs094cby.js} +2332 -4220
- package/dist/{chunk-dxc7begm.js → chunk-vtb8z6as.js} +14 -10
- package/dist/{chunk-x51mdzqq.js → chunk-vzd3cjy9.js} +3 -3
- package/dist/chunk-w2es9743.js +439 -0
- package/dist/{chunk-8z039kef.js → chunk-w92b262y.js} +53 -54
- package/dist/chunk-wa1dpga1.js +236 -0
- package/dist/{chunk-qf2v384j.js → chunk-wbmacbfb.js} +9 -7
- package/dist/{chunk-ryj80g9p.js → chunk-wbn46nb4.js} +136 -178
- package/dist/{chunk-t9z6njcr.js → chunk-wtycm8km.js} +9 -9
- package/dist/{chunk-q6rax9kh.js → chunk-wymtgh88.js} +5 -5
- package/dist/{chunk-pa7saazk.js → chunk-x0aj8rh8.js} +28 -56
- package/dist/{chunk-1szr63w0.js → chunk-x69w7xr7.js} +86 -74
- package/dist/{chunk-k5gdea6r.js → chunk-x6qmm22r.js} +84 -75
- package/dist/{chunk-zrse3zpz.js → chunk-xbprynsc.js} +18 -46
- package/dist/chunk-xc0v11v6.js +914 -0
- package/dist/chunk-xed18bb5.js +233 -0
- package/dist/{chunk-gjyc3293.js → chunk-xj76qk4z.js} +288 -499
- package/dist/chunk-xmd9eezd.js +83 -0
- package/dist/chunk-xrzrbw0f.js +142 -0
- package/dist/{chunk-fzxg8v1y.js → chunk-xycy3c8q.js} +15 -12
- package/dist/chunk-y0m0rd5v.js +140 -0
- package/dist/chunk-y2vtmzre.js +137 -0
- package/dist/{chunk-vybkxr18.js → chunk-y5z1cjbk.js} +42 -32
- package/dist/chunk-y60q54ph.js +111 -0
- package/dist/{chunk-d7vv2ydf.js → chunk-y78t50v0.js} +2 -2
- package/dist/{chunk-xkr7as9h.js → chunk-y9bgt2k1.js} +13 -9
- package/dist/chunk-ycwdzwz5.js +233 -0
- package/dist/chunk-yfyc2y1v.js +136 -0
- package/dist/chunk-yg6gtf9j.js +152 -0
- package/dist/{chunk-kyer92r4.js → chunk-yk8vcecd.js} +33 -5
- package/dist/{chunk-hkn7tzgv.js → chunk-ym5r3jnk.js} +1 -1
- package/dist/chunk-yr6gqw17.js +132 -0
- package/dist/chunk-yw62vhjz.js +445 -0
- package/dist/{chunk-athjeyrt.js → chunk-yw79dz62.js} +4 -4
- package/dist/{chunk-5mrhhmas.js → chunk-yx64nmbh.js} +8 -5
- package/dist/chunk-yy232vtj.js +84 -0
- package/dist/chunk-z1bs6d7k.js +24 -0
- package/dist/chunk-z4mgvsdj.js +456 -0
- package/dist/chunk-z6e5jp2w.js +119 -0
- package/dist/{chunk-t7cbhqd2.js → chunk-z6zt2ns7.js} +111 -123
- package/dist/chunk-z735r3p2.js +114 -0
- package/dist/{chunk-rjz6btwk.js → chunk-z7ssqvt6.js} +4972 -4638
- package/dist/{chunk-bpts9jbq.js → chunk-z8nv1ah0.js} +39 -31
- package/dist/chunk-z9mbssbe.js +128 -0
- package/dist/chunk-zdctabq6.js +264 -0
- package/dist/{chunk-ve60fbtd.js → chunk-ze6zvkg6.js} +2 -2
- package/dist/{chunk-t0rgmccj.js → chunk-zejm280k.js} +1 -1
- package/dist/{chunk-krstc7m7.js → chunk-zfapazzd.js} +15 -11
- package/dist/{chunk-2j0j79p0.js → chunk-zg4ae27v.js} +8 -8
- package/dist/chunk-zqxe8qnw.js +3590 -0
- package/dist/{chunk-q6dpqj3z.js → chunk-zs2ddzfv.js} +10 -7
- package/dist/chunk-zy80g72r.js +512 -0
- package/dist/{chunk-g3t0act8.js → chunk-zzm33q8x.js} +1 -1
- package/dist/{chunk-s8fzxy94.js → chunk-zzzc1ead.js} +17 -13
- package/dist/cli.js +63 -11
- package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
- package/package.json +8 -5
- package/scripts/postinstall.cjs +319 -0
- package/dist/chunk-0291smg3.js +0 -42
- package/dist/chunk-04g2ty3v.js +0 -104
- package/dist/chunk-069x95ne.js +0 -764
- package/dist/chunk-06x02eab.js +0 -655
- package/dist/chunk-09pjmga5.js +0 -713
- package/dist/chunk-0g90je6r.js +0 -145
- package/dist/chunk-0paqc2yw.js +0 -15
- package/dist/chunk-0rddv9vb.js +0 -328
- package/dist/chunk-162w6yv3.js +0 -756
- package/dist/chunk-1gjbaa3n.js +0 -128
- package/dist/chunk-23wg4mnt.js +0 -404
- package/dist/chunk-2gbjtg7c.js +0 -102
- package/dist/chunk-2v1q0ezq.js +0 -102
- package/dist/chunk-37n7jkxe.js +0 -436
- package/dist/chunk-38svjnh4.js +0 -158
- package/dist/chunk-3bg1089y.js +0 -616
- package/dist/chunk-3d8ck5ne.js +0 -112
- package/dist/chunk-3g6rf9sz.js +0 -106
- package/dist/chunk-3x3rr2n5.js +0 -57
- package/dist/chunk-4f6q3d38.js +0 -117
- package/dist/chunk-4h57km3m.js +0 -74
- package/dist/chunk-4kyh2618.js +0 -99
- package/dist/chunk-4w9vc9vc.js +0 -119
- package/dist/chunk-53hqpp5z.js +0 -208
- package/dist/chunk-5deqy8r0.js +0 -143
- package/dist/chunk-5m2rmc2k.js +0 -128
- package/dist/chunk-5wp9pkpt.js +0 -539
- package/dist/chunk-5ym9f6w3.js +0 -263
- package/dist/chunk-6f938733.js +0 -1027
- package/dist/chunk-6nenxecd.js +0 -115
- package/dist/chunk-6rja0h86.js +0 -1593
- package/dist/chunk-70q6dp4d.js +0 -96
- package/dist/chunk-7bn0wzs3.js +0 -1493
- package/dist/chunk-7e2e0bfm.js +0 -65
- package/dist/chunk-7ywadnax.js +0 -490
- package/dist/chunk-7z33j54s.js +0 -142
- package/dist/chunk-8yvfkzyh.js +0 -58
- package/dist/chunk-9abpx1kv.js +0 -2833
- package/dist/chunk-9ks2nswb.js +0 -114
- package/dist/chunk-9wrds5tr.js +0 -109
- package/dist/chunk-ab2twken.js +0 -102
- package/dist/chunk-abncjeag.js +0 -97
- package/dist/chunk-am6w4x6y.js +0 -103
- package/dist/chunk-b1xt9jqg.js +0 -28
- package/dist/chunk-b73bd7db.js +0 -496
- package/dist/chunk-bc7nvynh.js +0 -195
- package/dist/chunk-br17dhef.js +0 -103
- package/dist/chunk-c3k0sdey.js +0 -281
- package/dist/chunk-c909bmyv.js +0 -103
- package/dist/chunk-cftsv9w4.js +0 -129
- package/dist/chunk-cj1a7npk.js +0 -99
- package/dist/chunk-cpma9zs5.js +0 -335
- package/dist/chunk-cyscs4k5.js +0 -1330
- package/dist/chunk-czr7y063.js +0 -348
- package/dist/chunk-d93sndem.js +0 -372
- package/dist/chunk-ddz8xbpd.js +0 -481
- package/dist/chunk-dkhqx4hk.js +0 -84
- package/dist/chunk-dsrharmv.js +0 -359
- package/dist/chunk-eqmy5d05.js +0 -56
- package/dist/chunk-f2crxw2c.js +0 -5400
- package/dist/chunk-f8zga40p.js +0 -234
- package/dist/chunk-fbgm2ym6.js +0 -990
- package/dist/chunk-fcbbsswe.js +0 -119
- package/dist/chunk-fda654nt.js +0 -6121
- package/dist/chunk-ffmv9ezj.js +0 -104
- package/dist/chunk-fmjte7md.js +0 -38
- package/dist/chunk-fqtwqxxc.js +0 -293
- package/dist/chunk-g8k85nkd.js +0 -802
- package/dist/chunk-ge4ak7dj.js +0 -127
- package/dist/chunk-gpqemecy.js +0 -126
- package/dist/chunk-h19p6s3b.js +0 -131
- package/dist/chunk-j0sk1rct.js +0 -998
- package/dist/chunk-j1wfpa1a.js +0 -70
- package/dist/chunk-j829fx31.js +0 -3458
- package/dist/chunk-jqctzrvd.js +0 -722
- package/dist/chunk-jx817w05.js +0 -11
- package/dist/chunk-ka6sab33.js +0 -174
- package/dist/chunk-krjsvmwp.js +0 -101
- package/dist/chunk-kvpe50pm.js +0 -311
- package/dist/chunk-mez504fj.js +0 -113
- package/dist/chunk-mj6wbrae.js +0 -105
- package/dist/chunk-n0k8xrey.js +0 -319
- package/dist/chunk-n0pg2kpe.js +0 -122
- package/dist/chunk-n4qtqkp0.js +0 -295
- package/dist/chunk-n9meha2m.js +0 -73
- package/dist/chunk-ndk7q5n3.js +0 -169
- package/dist/chunk-ng6n9t4h.js +0 -56
- package/dist/chunk-p3pz13x2.js +0 -1933
- package/dist/chunk-p9ez6zgq.js +0 -2656
- package/dist/chunk-ph750kx1.js +0 -550
- package/dist/chunk-pxb99zqs.js +0 -117
- package/dist/chunk-q1yqc5n3.js +0 -100
- package/dist/chunk-q5b91nhh.js +0 -40
- package/dist/chunk-qtfqk0jr.js +0 -131
- package/dist/chunk-qzfmdh1t.js +0 -388
- package/dist/chunk-r3cv0j9n.js +0 -456
- package/dist/chunk-rx0pbgym.js +0 -97
- package/dist/chunk-s624rd5j.js +0 -531
- package/dist/chunk-satndwqj.js +0 -285
- package/dist/chunk-ssrxnkd1.js +0 -109
- package/dist/chunk-t2pgctqx.js +0 -106
- package/dist/chunk-t7sgwf31.js +0 -644
- package/dist/chunk-tth904tj.js +0 -53
- package/dist/chunk-typpbjhy.js +0 -128
- package/dist/chunk-vp6nrhdq.js +0 -102
- package/dist/chunk-vtjm53nt.js +0 -432
- package/dist/chunk-w412n7tq.js +0 -469
- package/dist/chunk-w4153rky.js +0 -1885
- package/dist/chunk-wdgv15as.js +0 -212
- package/dist/chunk-wgn9kydv.js +0 -58
- package/dist/chunk-whknbrk0.js +0 -184
- package/dist/chunk-x1k8e1xc.js +0 -56
- package/dist/chunk-x45xx6sc.js +0 -105
- package/dist/chunk-x4xvqbe5.js +0 -1166
- package/dist/chunk-x8b7vft8.js +0 -132
- package/dist/chunk-xaycc8qe.js +0 -44
- package/dist/chunk-xd4785ks.js +0 -73
- package/dist/chunk-xjxgmxhq.js +0 -463
- package/dist/chunk-xx2x3tz9.js +0 -166
- package/dist/chunk-y2j23eem.js +0 -101
- package/dist/chunk-y83j09wv.js +0 -123
- package/dist/chunk-yh8460pb.js +0 -119
- package/dist/chunk-z6nhchdb.js +0 -60
- package/dist/chunk-zbt73sj7.js +0 -192
- package/dist/chunk-zmwaatmq.js +0 -118
- package/dist/chunk-zvdg9tex.js +0 -135
- package/dist/chunk-zwa780cx.js +0 -584
- package/dist/{chunk-whvdag1y.js → chunk-3bfs3x0h.js} +9 -9
- package/dist/{chunk-27xc1csx.js → chunk-dggvswz1.js} +3 -3
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
Select,
|
|
4
|
+
init_CustomSelect
|
|
5
|
+
} from "./chunk-gs5eeqmc.js";
|
|
6
|
+
import {
|
|
7
|
+
init_settings1 as init_settings,
|
|
8
|
+
updateSettingsForSource
|
|
9
|
+
} from "./chunk-a2aj2mtb.js";
|
|
10
|
+
import {
|
|
11
|
+
Dialog,
|
|
12
|
+
Link,
|
|
13
|
+
ThemedBox_default,
|
|
14
|
+
ThemedText,
|
|
15
|
+
init_src
|
|
16
|
+
} from "./chunk-rvkvehat.js";
|
|
17
|
+
import {
|
|
18
|
+
require_jsx_dev_runtime,
|
|
19
|
+
require_react
|
|
20
|
+
} from "./chunk-g338npwr.js";
|
|
21
|
+
import {
|
|
22
|
+
init_analytics,
|
|
23
|
+
logEvent
|
|
24
|
+
} from "./chunk-f2mhrmww.js";
|
|
25
|
+
import {
|
|
26
|
+
__toESM
|
|
27
|
+
} from "./chunk-qp2qdcda.js";
|
|
28
|
+
|
|
29
|
+
// src/components/AutoModeOptInDialog.tsx
|
|
30
|
+
init_analytics();
|
|
31
|
+
init_src();
|
|
32
|
+
init_settings();
|
|
33
|
+
init_CustomSelect();
|
|
34
|
+
var import_react = __toESM(require_react(), 1);
|
|
35
|
+
var jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
|
|
36
|
+
var AUTO_MODE_DESCRIPTION = "Auto mode lets Claude handle permission prompts automatically \u2014 Claude checks each tool call for risky actions and prompt injection before executing. Actions Claude identifies as safe are executed, while actions Claude identifies as risky are blocked and Claude may try a different approach. Ideal for long-running tasks. Sessions are slightly more expensive. Claude can make mistakes that allow harmful commands to run, it's recommended to only use in isolated environments. Shift+Tab to change mode.";
|
|
37
|
+
function AutoModeOptInDialog({
|
|
38
|
+
onAccept,
|
|
39
|
+
onDecline,
|
|
40
|
+
declineExits
|
|
41
|
+
}) {
|
|
42
|
+
import_react.default.useEffect(() => {
|
|
43
|
+
logEvent("tengu_auto_mode_opt_in_dialog_shown", {});
|
|
44
|
+
}, []);
|
|
45
|
+
function onChange(value) {
|
|
46
|
+
switch (value) {
|
|
47
|
+
case "accept": {
|
|
48
|
+
logEvent("tengu_auto_mode_opt_in_dialog_accept", {});
|
|
49
|
+
updateSettingsForSource("userSettings", {
|
|
50
|
+
skipAutoPermissionPrompt: true
|
|
51
|
+
});
|
|
52
|
+
onAccept();
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
case "accept-default": {
|
|
56
|
+
logEvent("tengu_auto_mode_opt_in_dialog_accept_default", {});
|
|
57
|
+
updateSettingsForSource("userSettings", {
|
|
58
|
+
skipAutoPermissionPrompt: true,
|
|
59
|
+
permissions: { defaultMode: "auto" }
|
|
60
|
+
});
|
|
61
|
+
onAccept();
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
case "decline": {
|
|
65
|
+
logEvent("tengu_auto_mode_opt_in_dialog_decline", {});
|
|
66
|
+
onDecline();
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Dialog, {
|
|
72
|
+
title: "Enable auto mode?",
|
|
73
|
+
color: "warning",
|
|
74
|
+
onCancel: onDecline,
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
77
|
+
flexDirection: "column",
|
|
78
|
+
gap: 1,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
81
|
+
children: AUTO_MODE_DESCRIPTION
|
|
82
|
+
}, undefined, false, undefined, this),
|
|
83
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(Link, {
|
|
84
|
+
url: "https://code.claude.com/docs/en/security"
|
|
85
|
+
}, undefined, false, undefined, this)
|
|
86
|
+
]
|
|
87
|
+
}, undefined, true, undefined, this),
|
|
88
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(Select, {
|
|
89
|
+
options: [
|
|
90
|
+
...[
|
|
91
|
+
{
|
|
92
|
+
label: "Yes, and make it my default mode",
|
|
93
|
+
value: "accept-default"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
{ label: "Yes, enable auto mode", value: "accept" },
|
|
97
|
+
{
|
|
98
|
+
label: declineExits ? "No, exit" : "No, go back",
|
|
99
|
+
value: "decline"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
onChange: (value) => onChange(value),
|
|
103
|
+
onCancel: onDecline
|
|
104
|
+
}, undefined, false, undefined, this)
|
|
105
|
+
]
|
|
106
|
+
}, undefined, true, undefined, this);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { AUTO_MODE_DESCRIPTION, AutoModeOptInDialog };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
decodeJwtExpiry
|
|
4
|
+
} from "./chunk-71sf47by.js";
|
|
2
5
|
import {
|
|
3
6
|
getSessionIngressAuthHeaders,
|
|
4
7
|
getSessionIngressAuthToken,
|
|
@@ -6,174 +9,34 @@ import {
|
|
|
6
9
|
init_sessionIngressAuth,
|
|
7
10
|
registerSessionActivityCallback,
|
|
8
11
|
unregisterSessionActivityCallback
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-rqvqqrpg.js";
|
|
10
13
|
import {
|
|
11
14
|
getClaudeCodeUserAgent,
|
|
12
15
|
init_userAgent
|
|
13
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-a2aj2mtb.js";
|
|
14
17
|
import {
|
|
15
18
|
createAxiosInstance,
|
|
16
19
|
init_proxy
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-p2yv7m0g.js";
|
|
18
21
|
import {
|
|
19
22
|
init_sleep,
|
|
20
23
|
sleep
|
|
21
24
|
} from "./chunk-8g5pe1gr.js";
|
|
22
|
-
import {
|
|
23
|
-
init_analytics,
|
|
24
|
-
logEvent
|
|
25
|
-
} from "./chunk-h0rbjg6x.js";
|
|
26
25
|
import {
|
|
27
26
|
init_diagLogs,
|
|
28
27
|
logForDiagnosticsNoPII
|
|
29
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-rgbbtszq.js";
|
|
30
29
|
import {
|
|
31
|
-
errorMessage,
|
|
32
|
-
getErrnoCode,
|
|
33
30
|
init_debug,
|
|
34
|
-
init_errors,
|
|
35
31
|
init_slowOperations,
|
|
36
|
-
jsonParse,
|
|
37
32
|
jsonStringify,
|
|
38
33
|
logForDebugging
|
|
39
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-hcgkak1j.js";
|
|
40
35
|
import {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// src/bridge/jwtUtils.ts
|
|
46
|
-
init_analytics();
|
|
47
|
-
init_debug();
|
|
48
|
-
init_diagLogs();
|
|
49
|
-
init_errors();
|
|
50
|
-
init_slowOperations();
|
|
51
|
-
function formatDuration(ms) {
|
|
52
|
-
if (ms < 60000)
|
|
53
|
-
return `${Math.round(ms / 1000)}s`;
|
|
54
|
-
const m = Math.floor(ms / 60000);
|
|
55
|
-
const s = Math.round(ms % 60000 / 1000);
|
|
56
|
-
return s > 0 ? `${m}m ${s}s` : `${m}m`;
|
|
57
|
-
}
|
|
58
|
-
function decodeJwtPayload(token) {
|
|
59
|
-
const jwt = token.startsWith("sk-ant-si-") ? token.slice("sk-ant-si-".length) : token;
|
|
60
|
-
const parts = jwt.split(".");
|
|
61
|
-
if (parts.length !== 3 || !parts[1])
|
|
62
|
-
return null;
|
|
63
|
-
try {
|
|
64
|
-
return jsonParse(Buffer.from(parts[1], "base64url").toString("utf8"));
|
|
65
|
-
} catch {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function decodeJwtExpiry(token) {
|
|
70
|
-
const payload = decodeJwtPayload(token);
|
|
71
|
-
if (payload !== null && typeof payload === "object" && "exp" in payload && typeof payload.exp === "number") {
|
|
72
|
-
return payload.exp;
|
|
73
|
-
}
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
var TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1000;
|
|
77
|
-
var FALLBACK_REFRESH_INTERVAL_MS = 30 * 60 * 1000;
|
|
78
|
-
var MAX_REFRESH_FAILURES = 3;
|
|
79
|
-
var REFRESH_RETRY_DELAY_MS = 60000;
|
|
80
|
-
function createTokenRefreshScheduler({
|
|
81
|
-
getAccessToken,
|
|
82
|
-
onRefresh,
|
|
83
|
-
label,
|
|
84
|
-
refreshBufferMs = TOKEN_REFRESH_BUFFER_MS
|
|
85
|
-
}) {
|
|
86
|
-
const timers = new Map;
|
|
87
|
-
const failureCounts = new Map;
|
|
88
|
-
const generations = new Map;
|
|
89
|
-
function nextGeneration(sessionId) {
|
|
90
|
-
const gen = (generations.get(sessionId) ?? 0) + 1;
|
|
91
|
-
generations.set(sessionId, gen);
|
|
92
|
-
return gen;
|
|
93
|
-
}
|
|
94
|
-
function schedule(sessionId, token) {
|
|
95
|
-
const expiry = decodeJwtExpiry(token);
|
|
96
|
-
if (!expiry) {
|
|
97
|
-
logForDebugging(`[${label}:token] Could not decode JWT expiry for sessionId=${sessionId}, token prefix=${token.slice(0, 15)}\u2026, keeping existing timer`);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const existing = timers.get(sessionId);
|
|
101
|
-
if (existing) {
|
|
102
|
-
clearTimeout(existing);
|
|
103
|
-
}
|
|
104
|
-
const gen = nextGeneration(sessionId);
|
|
105
|
-
const expiryDate = new Date(expiry * 1000).toISOString();
|
|
106
|
-
const delayMs = expiry * 1000 - Date.now() - refreshBufferMs;
|
|
107
|
-
if (delayMs <= 0) {
|
|
108
|
-
logForDebugging(`[${label}:token] Token for sessionId=${sessionId} expires=${expiryDate} (past or within buffer), refreshing immediately`);
|
|
109
|
-
doRefresh(sessionId, gen);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
logForDebugging(`[${label}:token] Scheduled token refresh for sessionId=${sessionId} in ${formatDuration(delayMs)} (expires=${expiryDate}, buffer=${refreshBufferMs / 1000}s)`);
|
|
113
|
-
const timer = setTimeout(doRefresh, delayMs, sessionId, gen);
|
|
114
|
-
timers.set(sessionId, timer);
|
|
115
|
-
}
|
|
116
|
-
function scheduleFromExpiresIn(sessionId, expiresInSeconds) {
|
|
117
|
-
const existing = timers.get(sessionId);
|
|
118
|
-
if (existing)
|
|
119
|
-
clearTimeout(existing);
|
|
120
|
-
const gen = nextGeneration(sessionId);
|
|
121
|
-
const delayMs = Math.max(expiresInSeconds * 1000 - refreshBufferMs, 30000);
|
|
122
|
-
logForDebugging(`[${label}:token] Scheduled token refresh for sessionId=${sessionId} in ${formatDuration(delayMs)} (expires_in=${expiresInSeconds}s, buffer=${refreshBufferMs / 1000}s)`);
|
|
123
|
-
const timer = setTimeout(doRefresh, delayMs, sessionId, gen);
|
|
124
|
-
timers.set(sessionId, timer);
|
|
125
|
-
}
|
|
126
|
-
async function doRefresh(sessionId, gen) {
|
|
127
|
-
let oauthToken;
|
|
128
|
-
try {
|
|
129
|
-
oauthToken = await getAccessToken();
|
|
130
|
-
} catch (err) {
|
|
131
|
-
logForDebugging(`[${label}:token] getAccessToken threw for sessionId=${sessionId}: ${errorMessage(err)}`, { level: "error" });
|
|
132
|
-
}
|
|
133
|
-
if (generations.get(sessionId) !== gen) {
|
|
134
|
-
logForDebugging(`[${label}:token] doRefresh for sessionId=${sessionId} stale (gen ${gen} vs ${generations.get(sessionId)}), skipping`);
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
if (!oauthToken) {
|
|
138
|
-
const failures = (failureCounts.get(sessionId) ?? 0) + 1;
|
|
139
|
-
failureCounts.set(sessionId, failures);
|
|
140
|
-
logForDebugging(`[${label}:token] No OAuth token available for refresh, sessionId=${sessionId} (failure ${failures}/${MAX_REFRESH_FAILURES})`, { level: "error" });
|
|
141
|
-
logForDiagnosticsNoPII("error", "bridge_token_refresh_no_oauth");
|
|
142
|
-
if (failures < MAX_REFRESH_FAILURES) {
|
|
143
|
-
const retryTimer = setTimeout(doRefresh, REFRESH_RETRY_DELAY_MS, sessionId, gen);
|
|
144
|
-
timers.set(sessionId, retryTimer);
|
|
145
|
-
}
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
failureCounts.delete(sessionId);
|
|
149
|
-
logForDebugging(`[${label}:token] Refreshing token for sessionId=${sessionId}: new token prefix=${oauthToken.slice(0, 15)}\u2026`);
|
|
150
|
-
logEvent("tengu_bridge_token_refreshed", {});
|
|
151
|
-
onRefresh(sessionId, oauthToken);
|
|
152
|
-
const timer = setTimeout(doRefresh, FALLBACK_REFRESH_INTERVAL_MS, sessionId, gen);
|
|
153
|
-
timers.set(sessionId, timer);
|
|
154
|
-
logForDebugging(`[${label}:token] Scheduled follow-up refresh for sessionId=${sessionId} in ${formatDuration(FALLBACK_REFRESH_INTERVAL_MS)}`);
|
|
155
|
-
}
|
|
156
|
-
function cancel(sessionId) {
|
|
157
|
-
nextGeneration(sessionId);
|
|
158
|
-
const timer = timers.get(sessionId);
|
|
159
|
-
if (timer) {
|
|
160
|
-
clearTimeout(timer);
|
|
161
|
-
timers.delete(sessionId);
|
|
162
|
-
}
|
|
163
|
-
failureCounts.delete(sessionId);
|
|
164
|
-
}
|
|
165
|
-
function cancelAll() {
|
|
166
|
-
for (const sessionId of generations.keys()) {
|
|
167
|
-
nextGeneration(sessionId);
|
|
168
|
-
}
|
|
169
|
-
for (const timer of timers.values()) {
|
|
170
|
-
clearTimeout(timer);
|
|
171
|
-
}
|
|
172
|
-
timers.clear();
|
|
173
|
-
failureCounts.clear();
|
|
174
|
-
}
|
|
175
|
-
return { schedule, scheduleFromExpiresIn, cancel, cancelAll };
|
|
176
|
-
}
|
|
36
|
+
errorMessage,
|
|
37
|
+
getErrnoCode,
|
|
38
|
+
init_errors
|
|
39
|
+
} from "./chunk-z6e5jp2w.js";
|
|
177
40
|
|
|
178
41
|
// src/cli/transports/ccrClient.ts
|
|
179
42
|
import { randomUUID } from "crypto";
|
|
@@ -916,409 +779,4 @@ class CCRClient {
|
|
|
916
779
|
}
|
|
917
780
|
}
|
|
918
781
|
|
|
919
|
-
|
|
920
|
-
init_axios();
|
|
921
|
-
init_debug();
|
|
922
|
-
init_diagLogs();
|
|
923
|
-
init_errors();
|
|
924
|
-
init_sessionIngressAuth();
|
|
925
|
-
init_sleep();
|
|
926
|
-
init_slowOperations();
|
|
927
|
-
init_userAgent();
|
|
928
|
-
var RECONNECT_BASE_DELAY_MS = 1000;
|
|
929
|
-
var RECONNECT_MAX_DELAY_MS = 30000;
|
|
930
|
-
var RECONNECT_GIVE_UP_MS = 600000;
|
|
931
|
-
var LIVENESS_TIMEOUT_MS = 45000;
|
|
932
|
-
var PERMANENT_HTTP_CODES = new Set([401, 403, 404]);
|
|
933
|
-
var POST_MAX_RETRIES = 10;
|
|
934
|
-
var POST_BASE_DELAY_MS = 500;
|
|
935
|
-
var POST_MAX_DELAY_MS = 8000;
|
|
936
|
-
var STREAM_DECODE_OPTS = { stream: true };
|
|
937
|
-
function alwaysValidStatus2() {
|
|
938
|
-
return true;
|
|
939
|
-
}
|
|
940
|
-
function parseSSEFrames(buffer) {
|
|
941
|
-
const frames = [];
|
|
942
|
-
let pos = 0;
|
|
943
|
-
let idx;
|
|
944
|
-
while ((idx = buffer.indexOf(`
|
|
945
|
-
|
|
946
|
-
`, pos)) !== -1) {
|
|
947
|
-
const rawFrame = buffer.slice(pos, idx);
|
|
948
|
-
pos = idx + 2;
|
|
949
|
-
if (!rawFrame.trim())
|
|
950
|
-
continue;
|
|
951
|
-
const frame = {};
|
|
952
|
-
let isComment = false;
|
|
953
|
-
for (const line of rawFrame.split(`
|
|
954
|
-
`)) {
|
|
955
|
-
if (line.startsWith(":")) {
|
|
956
|
-
isComment = true;
|
|
957
|
-
continue;
|
|
958
|
-
}
|
|
959
|
-
const colonIdx = line.indexOf(":");
|
|
960
|
-
if (colonIdx === -1)
|
|
961
|
-
continue;
|
|
962
|
-
const field = line.slice(0, colonIdx);
|
|
963
|
-
const value = line[colonIdx + 1] === " " ? line.slice(colonIdx + 2) : line.slice(colonIdx + 1);
|
|
964
|
-
switch (field) {
|
|
965
|
-
case "event":
|
|
966
|
-
frame.event = value;
|
|
967
|
-
break;
|
|
968
|
-
case "id":
|
|
969
|
-
frame.id = value;
|
|
970
|
-
break;
|
|
971
|
-
case "data":
|
|
972
|
-
frame.data = frame.data ? frame.data + `
|
|
973
|
-
` + value : value;
|
|
974
|
-
break;
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
if (frame.data || isComment) {
|
|
978
|
-
frames.push(frame);
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
return { frames, remaining: buffer.slice(pos) };
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
class SSETransport {
|
|
985
|
-
url;
|
|
986
|
-
state = "idle";
|
|
987
|
-
onData;
|
|
988
|
-
onCloseCallback;
|
|
989
|
-
onEventCallback;
|
|
990
|
-
headers;
|
|
991
|
-
sessionId;
|
|
992
|
-
refreshHeaders;
|
|
993
|
-
getAuthHeaders;
|
|
994
|
-
abortController = null;
|
|
995
|
-
lastSequenceNum = 0;
|
|
996
|
-
seenSequenceNums = new Set;
|
|
997
|
-
reconnectAttempts = 0;
|
|
998
|
-
reconnectStartTime = null;
|
|
999
|
-
reconnectTimer = null;
|
|
1000
|
-
livenessTimer = null;
|
|
1001
|
-
postUrl;
|
|
1002
|
-
constructor(url, headers = {}, sessionId, refreshHeaders, initialSequenceNum, getAuthHeaders) {
|
|
1003
|
-
this.url = url;
|
|
1004
|
-
this.headers = headers;
|
|
1005
|
-
this.sessionId = sessionId;
|
|
1006
|
-
this.refreshHeaders = refreshHeaders;
|
|
1007
|
-
this.getAuthHeaders = getAuthHeaders ?? getSessionIngressAuthHeaders;
|
|
1008
|
-
this.postUrl = convertSSEUrlToPostUrl(url);
|
|
1009
|
-
if (initialSequenceNum !== undefined && initialSequenceNum > 0) {
|
|
1010
|
-
this.lastSequenceNum = initialSequenceNum;
|
|
1011
|
-
}
|
|
1012
|
-
logForDebugging(`SSETransport: SSE URL = ${url.href}`);
|
|
1013
|
-
logForDebugging(`SSETransport: POST URL = ${this.postUrl}`);
|
|
1014
|
-
logForDiagnosticsNoPII("info", "cli_sse_transport_initialized");
|
|
1015
|
-
}
|
|
1016
|
-
getLastSequenceNum() {
|
|
1017
|
-
return this.lastSequenceNum;
|
|
1018
|
-
}
|
|
1019
|
-
async connect() {
|
|
1020
|
-
if (this.state !== "idle" && this.state !== "reconnecting") {
|
|
1021
|
-
logForDebugging(`SSETransport: Cannot connect, current state is ${this.state}`, { level: "error" });
|
|
1022
|
-
logForDiagnosticsNoPII("error", "cli_sse_connect_failed");
|
|
1023
|
-
return;
|
|
1024
|
-
}
|
|
1025
|
-
this.state = "reconnecting";
|
|
1026
|
-
const connectStartTime = Date.now();
|
|
1027
|
-
const sseUrl = new URL(this.url.href);
|
|
1028
|
-
if (this.lastSequenceNum > 0) {
|
|
1029
|
-
sseUrl.searchParams.set("from_sequence_num", String(this.lastSequenceNum));
|
|
1030
|
-
}
|
|
1031
|
-
const authHeaders = this.getAuthHeaders();
|
|
1032
|
-
const headers = {
|
|
1033
|
-
...this.headers,
|
|
1034
|
-
...authHeaders,
|
|
1035
|
-
Accept: "text/event-stream",
|
|
1036
|
-
"anthropic-version": "2023-06-01",
|
|
1037
|
-
"User-Agent": getClaudeCodeUserAgent()
|
|
1038
|
-
};
|
|
1039
|
-
if (authHeaders["Cookie"]) {
|
|
1040
|
-
delete headers["Authorization"];
|
|
1041
|
-
}
|
|
1042
|
-
if (this.lastSequenceNum > 0) {
|
|
1043
|
-
headers["Last-Event-ID"] = String(this.lastSequenceNum);
|
|
1044
|
-
}
|
|
1045
|
-
logForDebugging(`SSETransport: Opening ${sseUrl.href}`);
|
|
1046
|
-
logForDiagnosticsNoPII("info", "cli_sse_connect_opening");
|
|
1047
|
-
this.abortController = new AbortController;
|
|
1048
|
-
try {
|
|
1049
|
-
const response = await fetch(sseUrl.href, {
|
|
1050
|
-
headers,
|
|
1051
|
-
signal: this.abortController.signal
|
|
1052
|
-
});
|
|
1053
|
-
if (!response.ok) {
|
|
1054
|
-
const isPermanent = PERMANENT_HTTP_CODES.has(response.status);
|
|
1055
|
-
logForDebugging(`SSETransport: HTTP ${response.status}${isPermanent ? " (permanent)" : ""}`, { level: "error" });
|
|
1056
|
-
logForDiagnosticsNoPII("error", "cli_sse_connect_http_error", {
|
|
1057
|
-
status: response.status
|
|
1058
|
-
});
|
|
1059
|
-
if (isPermanent) {
|
|
1060
|
-
this.state = "closed";
|
|
1061
|
-
this.onCloseCallback?.(response.status);
|
|
1062
|
-
return;
|
|
1063
|
-
}
|
|
1064
|
-
this.handleConnectionError();
|
|
1065
|
-
return;
|
|
1066
|
-
}
|
|
1067
|
-
if (!response.body) {
|
|
1068
|
-
logForDebugging("SSETransport: No response body");
|
|
1069
|
-
this.handleConnectionError();
|
|
1070
|
-
return;
|
|
1071
|
-
}
|
|
1072
|
-
const connectDuration = Date.now() - connectStartTime;
|
|
1073
|
-
logForDebugging("SSETransport: Connected");
|
|
1074
|
-
logForDiagnosticsNoPII("info", "cli_sse_connect_connected", {
|
|
1075
|
-
duration_ms: connectDuration
|
|
1076
|
-
});
|
|
1077
|
-
this.state = "connected";
|
|
1078
|
-
this.reconnectAttempts = 0;
|
|
1079
|
-
this.reconnectStartTime = null;
|
|
1080
|
-
this.resetLivenessTimer();
|
|
1081
|
-
await this.readStream(response.body);
|
|
1082
|
-
} catch (error) {
|
|
1083
|
-
if (this.abortController?.signal.aborted) {
|
|
1084
|
-
return;
|
|
1085
|
-
}
|
|
1086
|
-
logForDebugging(`SSETransport: Connection error: ${errorMessage(error)}`, { level: "error" });
|
|
1087
|
-
logForDiagnosticsNoPII("error", "cli_sse_connect_error");
|
|
1088
|
-
this.handleConnectionError();
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
async readStream(body) {
|
|
1092
|
-
const reader = body.getReader();
|
|
1093
|
-
const decoder = new TextDecoder;
|
|
1094
|
-
let buffer = "";
|
|
1095
|
-
try {
|
|
1096
|
-
while (true) {
|
|
1097
|
-
const { done, value } = await reader.read();
|
|
1098
|
-
if (done)
|
|
1099
|
-
break;
|
|
1100
|
-
buffer += decoder.decode(value, STREAM_DECODE_OPTS);
|
|
1101
|
-
const { frames, remaining } = parseSSEFrames(buffer);
|
|
1102
|
-
buffer = remaining;
|
|
1103
|
-
for (const frame of frames) {
|
|
1104
|
-
this.resetLivenessTimer();
|
|
1105
|
-
if (frame.id) {
|
|
1106
|
-
const seqNum = parseInt(frame.id, 10);
|
|
1107
|
-
if (!isNaN(seqNum)) {
|
|
1108
|
-
if (this.seenSequenceNums.has(seqNum)) {
|
|
1109
|
-
logForDebugging(`SSETransport: DUPLICATE frame seq=${seqNum} (lastSequenceNum=${this.lastSequenceNum}, seenCount=${this.seenSequenceNums.size})`, { level: "warn" });
|
|
1110
|
-
logForDiagnosticsNoPII("warn", "cli_sse_duplicate_sequence");
|
|
1111
|
-
} else {
|
|
1112
|
-
this.seenSequenceNums.add(seqNum);
|
|
1113
|
-
if (this.seenSequenceNums.size > 1000) {
|
|
1114
|
-
const threshold = this.lastSequenceNum - 200;
|
|
1115
|
-
for (const s of this.seenSequenceNums) {
|
|
1116
|
-
if (s < threshold) {
|
|
1117
|
-
this.seenSequenceNums.delete(s);
|
|
1118
|
-
}
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
if (seqNum > this.lastSequenceNum) {
|
|
1123
|
-
this.lastSequenceNum = seqNum;
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
if (frame.event && frame.data) {
|
|
1128
|
-
this.handleSSEFrame(frame.event, frame.data);
|
|
1129
|
-
} else if (frame.data) {
|
|
1130
|
-
logForDebugging("SSETransport: Frame has data: but no event: field \u2014 dropped", { level: "warn" });
|
|
1131
|
-
logForDiagnosticsNoPII("warn", "cli_sse_frame_missing_event_field");
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
} catch (error) {
|
|
1136
|
-
if (this.abortController?.signal.aborted)
|
|
1137
|
-
return;
|
|
1138
|
-
logForDebugging(`SSETransport: Stream read error: ${errorMessage(error)}`, { level: "error" });
|
|
1139
|
-
logForDiagnosticsNoPII("error", "cli_sse_stream_read_error");
|
|
1140
|
-
} finally {
|
|
1141
|
-
reader.releaseLock();
|
|
1142
|
-
}
|
|
1143
|
-
if (this.state !== "closing" && this.state !== "closed") {
|
|
1144
|
-
logForDebugging("SSETransport: Stream ended, reconnecting");
|
|
1145
|
-
this.handleConnectionError();
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
handleSSEFrame(eventType, data) {
|
|
1149
|
-
if (eventType !== "client_event") {
|
|
1150
|
-
logForDebugging(`SSETransport: Unexpected SSE event type '${eventType}' on worker stream`, { level: "warn" });
|
|
1151
|
-
logForDiagnosticsNoPII("warn", "cli_sse_unexpected_event_type", {
|
|
1152
|
-
event_type: eventType
|
|
1153
|
-
});
|
|
1154
|
-
return;
|
|
1155
|
-
}
|
|
1156
|
-
let ev;
|
|
1157
|
-
try {
|
|
1158
|
-
ev = jsonParse(data);
|
|
1159
|
-
} catch (error) {
|
|
1160
|
-
logForDebugging(`SSETransport: Failed to parse client_event data: ${errorMessage(error)}`, { level: "error" });
|
|
1161
|
-
return;
|
|
1162
|
-
}
|
|
1163
|
-
const payload = ev.payload;
|
|
1164
|
-
if (payload && typeof payload === "object" && "type" in payload) {
|
|
1165
|
-
const sessionLabel = this.sessionId ? ` session=${this.sessionId}` : "";
|
|
1166
|
-
logForDebugging(`SSETransport: Event seq=${ev.sequence_num} event_id=${ev.event_id} event_type=${ev.event_type} payload_type=${String(payload.type)}${sessionLabel}`);
|
|
1167
|
-
logForDiagnosticsNoPII("info", "cli_sse_message_received");
|
|
1168
|
-
this.onData?.(jsonStringify(payload) + `
|
|
1169
|
-
`);
|
|
1170
|
-
} else {
|
|
1171
|
-
logForDebugging(`SSETransport: Ignoring client_event with no type in payload: event_id=${ev.event_id}`);
|
|
1172
|
-
}
|
|
1173
|
-
this.onEventCallback?.(ev);
|
|
1174
|
-
}
|
|
1175
|
-
handleConnectionError() {
|
|
1176
|
-
this.clearLivenessTimer();
|
|
1177
|
-
if (this.state === "closing" || this.state === "closed")
|
|
1178
|
-
return;
|
|
1179
|
-
this.abortController?.abort();
|
|
1180
|
-
this.abortController = null;
|
|
1181
|
-
const now = Date.now();
|
|
1182
|
-
if (!this.reconnectStartTime) {
|
|
1183
|
-
this.reconnectStartTime = now;
|
|
1184
|
-
}
|
|
1185
|
-
const elapsed = now - this.reconnectStartTime;
|
|
1186
|
-
if (elapsed < RECONNECT_GIVE_UP_MS) {
|
|
1187
|
-
if (this.reconnectTimer) {
|
|
1188
|
-
clearTimeout(this.reconnectTimer);
|
|
1189
|
-
this.reconnectTimer = null;
|
|
1190
|
-
}
|
|
1191
|
-
if (this.refreshHeaders) {
|
|
1192
|
-
const freshHeaders = this.refreshHeaders();
|
|
1193
|
-
Object.assign(this.headers, freshHeaders);
|
|
1194
|
-
logForDebugging("SSETransport: Refreshed headers for reconnect");
|
|
1195
|
-
}
|
|
1196
|
-
this.state = "reconnecting";
|
|
1197
|
-
this.reconnectAttempts++;
|
|
1198
|
-
const baseDelay = Math.min(RECONNECT_BASE_DELAY_MS * Math.pow(2, this.reconnectAttempts - 1), RECONNECT_MAX_DELAY_MS);
|
|
1199
|
-
const delay = Math.max(0, baseDelay + baseDelay * 0.25 * (2 * Math.random() - 1));
|
|
1200
|
-
logForDebugging(`SSETransport: Reconnecting in ${Math.round(delay)}ms (attempt ${this.reconnectAttempts}, ${Math.round(elapsed / 1000)}s elapsed)`);
|
|
1201
|
-
logForDiagnosticsNoPII("error", "cli_sse_reconnect_attempt", {
|
|
1202
|
-
reconnectAttempts: this.reconnectAttempts
|
|
1203
|
-
});
|
|
1204
|
-
this.reconnectTimer = setTimeout(() => {
|
|
1205
|
-
this.reconnectTimer = null;
|
|
1206
|
-
this.connect();
|
|
1207
|
-
}, delay);
|
|
1208
|
-
} else {
|
|
1209
|
-
logForDebugging(`SSETransport: Reconnection time budget exhausted after ${Math.round(elapsed / 1000)}s`, { level: "error" });
|
|
1210
|
-
logForDiagnosticsNoPII("error", "cli_sse_reconnect_exhausted", {
|
|
1211
|
-
reconnectAttempts: this.reconnectAttempts,
|
|
1212
|
-
elapsedMs: elapsed
|
|
1213
|
-
});
|
|
1214
|
-
this.state = "closed";
|
|
1215
|
-
this.onCloseCallback?.();
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
onLivenessTimeout = () => {
|
|
1219
|
-
this.livenessTimer = null;
|
|
1220
|
-
logForDebugging("SSETransport: Liveness timeout, reconnecting", {
|
|
1221
|
-
level: "error"
|
|
1222
|
-
});
|
|
1223
|
-
logForDiagnosticsNoPII("error", "cli_sse_liveness_timeout");
|
|
1224
|
-
this.abortController?.abort();
|
|
1225
|
-
this.handleConnectionError();
|
|
1226
|
-
};
|
|
1227
|
-
resetLivenessTimer() {
|
|
1228
|
-
this.clearLivenessTimer();
|
|
1229
|
-
this.livenessTimer = setTimeout(this.onLivenessTimeout, LIVENESS_TIMEOUT_MS);
|
|
1230
|
-
}
|
|
1231
|
-
clearLivenessTimer() {
|
|
1232
|
-
if (this.livenessTimer) {
|
|
1233
|
-
clearTimeout(this.livenessTimer);
|
|
1234
|
-
this.livenessTimer = null;
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
async write(message) {
|
|
1238
|
-
const authHeaders = this.getAuthHeaders();
|
|
1239
|
-
if (Object.keys(authHeaders).length === 0) {
|
|
1240
|
-
logForDebugging("SSETransport: No session token available for POST");
|
|
1241
|
-
logForDiagnosticsNoPII("warn", "cli_sse_post_no_token");
|
|
1242
|
-
return;
|
|
1243
|
-
}
|
|
1244
|
-
const headers = {
|
|
1245
|
-
...authHeaders,
|
|
1246
|
-
"Content-Type": "application/json",
|
|
1247
|
-
"anthropic-version": "2023-06-01",
|
|
1248
|
-
"User-Agent": getClaudeCodeUserAgent()
|
|
1249
|
-
};
|
|
1250
|
-
logForDebugging(`SSETransport: POST body keys=${Object.keys(message).join(",")}`);
|
|
1251
|
-
for (let attempt = 1;attempt <= POST_MAX_RETRIES; attempt++) {
|
|
1252
|
-
try {
|
|
1253
|
-
const response = await axios_default.post(this.postUrl, message, {
|
|
1254
|
-
headers,
|
|
1255
|
-
validateStatus: alwaysValidStatus2
|
|
1256
|
-
});
|
|
1257
|
-
if (response.status === 200 || response.status === 201) {
|
|
1258
|
-
logForDebugging(`SSETransport: POST success type=${message.type}`);
|
|
1259
|
-
return;
|
|
1260
|
-
}
|
|
1261
|
-
logForDebugging(`SSETransport: POST ${response.status} body=${jsonStringify(response.data).slice(0, 200)}`);
|
|
1262
|
-
if (response.status >= 400 && response.status < 500 && response.status !== 429) {
|
|
1263
|
-
logForDebugging(`SSETransport: POST returned ${response.status} (client error), not retrying`);
|
|
1264
|
-
logForDiagnosticsNoPII("warn", "cli_sse_post_client_error", {
|
|
1265
|
-
status: response.status
|
|
1266
|
-
});
|
|
1267
|
-
return;
|
|
1268
|
-
}
|
|
1269
|
-
logForDebugging(`SSETransport: POST returned ${response.status}, attempt ${attempt}/${POST_MAX_RETRIES}`);
|
|
1270
|
-
logForDiagnosticsNoPII("warn", "cli_sse_post_retryable_error", {
|
|
1271
|
-
status: response.status,
|
|
1272
|
-
attempt
|
|
1273
|
-
});
|
|
1274
|
-
} catch (error) {
|
|
1275
|
-
const axiosError = error;
|
|
1276
|
-
logForDebugging(`SSETransport: POST error: ${axiosError.message}, attempt ${attempt}/${POST_MAX_RETRIES}`);
|
|
1277
|
-
logForDiagnosticsNoPII("warn", "cli_sse_post_network_error", {
|
|
1278
|
-
attempt
|
|
1279
|
-
});
|
|
1280
|
-
}
|
|
1281
|
-
if (attempt === POST_MAX_RETRIES) {
|
|
1282
|
-
logForDebugging(`SSETransport: POST failed after ${POST_MAX_RETRIES} attempts, continuing`);
|
|
1283
|
-
logForDiagnosticsNoPII("warn", "cli_sse_post_retries_exhausted");
|
|
1284
|
-
return;
|
|
1285
|
-
}
|
|
1286
|
-
const delayMs = Math.min(POST_BASE_DELAY_MS * Math.pow(2, attempt - 1), POST_MAX_DELAY_MS);
|
|
1287
|
-
await sleep(delayMs);
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
isConnectedStatus() {
|
|
1291
|
-
return this.state === "connected";
|
|
1292
|
-
}
|
|
1293
|
-
isClosedStatus() {
|
|
1294
|
-
return this.state === "closed";
|
|
1295
|
-
}
|
|
1296
|
-
setOnData(callback) {
|
|
1297
|
-
this.onData = callback;
|
|
1298
|
-
}
|
|
1299
|
-
setOnClose(callback) {
|
|
1300
|
-
this.onCloseCallback = callback;
|
|
1301
|
-
}
|
|
1302
|
-
setOnEvent(callback) {
|
|
1303
|
-
this.onEventCallback = callback;
|
|
1304
|
-
}
|
|
1305
|
-
close() {
|
|
1306
|
-
if (this.reconnectTimer) {
|
|
1307
|
-
clearTimeout(this.reconnectTimer);
|
|
1308
|
-
this.reconnectTimer = null;
|
|
1309
|
-
}
|
|
1310
|
-
this.clearLivenessTimer();
|
|
1311
|
-
this.state = "closing";
|
|
1312
|
-
this.abortController?.abort();
|
|
1313
|
-
this.abortController = null;
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
function convertSSEUrlToPostUrl(sseUrl) {
|
|
1317
|
-
let pathname = sseUrl.pathname;
|
|
1318
|
-
if (pathname.endsWith("/stream")) {
|
|
1319
|
-
pathname = pathname.slice(0, -"/stream".length);
|
|
1320
|
-
}
|
|
1321
|
-
return `${sseUrl.protocol}//${sseUrl.host}${pathname}`;
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
export { createTokenRefreshScheduler, SerialBatchEventUploader, CCRInitError, CCRClient, SSETransport };
|
|
782
|
+
export { SerialBatchEventUploader, CCRInitError, CCRClient };
|