@caspian2026/agent-sdk 0.0.8 → 0.0.11
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-dtgh4te6.js → chunk-0ac6r0fw.js} +46 -45
- package/dist/{chunk-cfgha78n.js → chunk-0dm971mw.js} +2 -2
- package/dist/{chunk-0mej3p7q.js → chunk-0f5anjkb.js} +14 -14
- package/dist/{chunk-6g5qbbxk.js → chunk-0k9sft0s.js} +47 -46
- package/dist/chunk-0kgwksm1.js +57 -0
- package/dist/chunk-0vp3wfab.js +12 -0
- package/dist/{chunk-d9yghsfg.js → chunk-1etzkkxs.js} +1 -1
- package/dist/{chunk-a4npwxvb.js → chunk-1gz2wrhq.js} +46 -45
- package/dist/{chunk-25bwa70y.js → chunk-1pr4hr5x.js} +49 -48
- package/dist/{chunk-2f21meep.js → chunk-1v01c96r.js} +1 -1
- package/dist/{chunk-jvmybb06.js → chunk-1vhjn1j9.js} +46 -45
- package/dist/{chunk-69r3hm9b.js → chunk-1wr6ag3j.js} +13 -19
- package/dist/{chunk-83e71kz6.js → chunk-2072dpbx.js} +2 -2
- package/dist/{chunk-8hpq2659.js → chunk-24t2wjab.js} +1 -1
- package/dist/{chunk-q7e0106d.js → chunk-2589k4k0.js} +51 -56
- package/dist/{chunk-d7886r6a.js → chunk-26wtxbdc.js} +7774 -7774
- package/dist/{chunk-ahrhwpm9.js → chunk-28k13wc7.js} +2 -2
- package/dist/{chunk-vvjgdzhn.js → chunk-2cr43hzw.js} +55 -51
- package/dist/{chunk-mw1kpeg9.js → chunk-2sqhjnpn.js} +1909 -1377
- package/dist/chunk-2tfe2zs1.js +87 -0
- package/dist/{chunk-c11swzas.js → chunk-2vteceqh.js} +5 -5
- package/dist/{chunk-zmra45az.js → chunk-2z9rak9s.js} +47 -46
- package/dist/chunk-31bwdrm5.js +93 -0
- package/dist/{chunk-2xbyb015.js → chunk-38rkx4cj.js} +47 -46
- package/dist/{chunk-am3qcgzp.js → chunk-394djs3v.js} +56 -55
- package/dist/{chunk-15m49c67.js → chunk-3e28fvn0.js} +2 -2
- package/dist/{chunk-4hv90qcz.js → chunk-3mgywd32.js} +1 -1
- package/dist/{chunk-234668cb.js → chunk-3we6j8b4.js} +5 -5
- package/dist/{chunk-7rnqsng2.js → chunk-400r5gmq.js} +19 -19
- package/dist/{chunk-yc23zxmj.js → chunk-4057dtxd.js} +1 -1
- package/dist/{chunk-70eey1nh.js → chunk-40s88wdg.js} +2 -2
- package/dist/{chunk-8nfn89nz.js → chunk-41en0cc6.js} +9 -9
- package/dist/{chunk-t5vbqd9d.js → chunk-488spx13.js} +55 -54
- package/dist/{chunk-9v13f3gm.js → chunk-49bs7x5p.js} +558 -196
- package/dist/{chunk-0awwmrwr.js → chunk-4ayjwyqj.js} +2 -2
- package/dist/chunk-4d0g9n3q.js +92 -0
- package/dist/{chunk-denyma1s.js → chunk-4fh25m1z.js} +14 -12
- package/dist/chunk-4hgxxzdw.js +94 -0
- package/dist/{chunk-8g747a8x.js → chunk-4pbx3g7s.js} +1 -1
- package/dist/{chunk-fkhs3myp.js → chunk-4pj88fnc.js} +5 -3
- package/dist/{chunk-st73prx0.js → chunk-4re879ja.js} +47 -46
- package/dist/{chunk-pb92bj1h.js → chunk-50art2hr.js} +6 -6
- package/dist/{chunk-1nk93fqz.js → chunk-5cxjxxx8.js} +2 -7
- package/dist/{chunk-kek5v6ef.js → chunk-5pqq0nym.js} +3 -3
- package/dist/{chunk-nk82j7r2.js → chunk-6696fngv.js} +7 -7
- package/dist/{chunk-ya40p6vj.js → chunk-66dk94r4.js} +46 -45
- package/dist/{chunk-xrpstt41.js → chunk-67808qek.js} +4 -4
- package/dist/{chunk-zhk465tg.js → chunk-69841w77.js} +46 -45
- package/dist/{chunk-jgzxmtpf.js → chunk-6ebvysef.js} +52 -52
- package/dist/{chunk-bmbq6nt1.js → chunk-6wzg2hpc.js} +2 -2
- package/dist/{chunk-12k745vf.js → chunk-6zsxtysq.js} +3 -3
- package/dist/{chunk-qcnhb4cd.js → chunk-75qqeec8.js} +3 -3
- package/dist/{chunk-nvwwtq1w.js → chunk-765zdaq8.js} +49 -48
- package/dist/{chunk-zq6ezxh2.js → chunk-7ce8wn1f.js} +49 -45
- package/dist/{chunk-e7h4qxgw.js → chunk-7etkb4pr.js} +4 -4
- package/dist/{chunk-wha6v7za.js → chunk-7krg0dkt.js} +2 -2
- package/dist/{chunk-nqrc7pc4.js → chunk-7p2vw8qe.js} +29 -27
- package/dist/{chunk-q1ah9nbq.js → chunk-7t5ymv2m.js} +1 -1
- package/dist/{chunk-xz655xxa.js → chunk-7tphrzjj.js} +2 -2
- package/dist/{chunk-hzknr99c.js → chunk-83b2frat.js} +4 -4
- package/dist/{chunk-bxcfz5gy.js → chunk-87xg6yb4.js} +1 -1
- package/dist/{chunk-nrtksr2p.js → chunk-8b2y3x7a.js} +1 -1
- package/dist/{chunk-1cq2vrzq.js → chunk-8c907cv9.js} +4 -4
- package/dist/{chunk-88cekjja.js → chunk-8dzg4nr5.js} +47 -46
- package/dist/{chunk-2fxpd35d.js → chunk-8hn2xqjz.js} +2 -2
- package/dist/{chunk-3g1vqhyx.js → chunk-8kmna3cc.js} +17 -21
- package/dist/{chunk-1zhy5cbc.js → chunk-8r5eevap.js} +13 -13
- package/dist/{chunk-7n51wk9k.js → chunk-8vkv63c5.js} +2 -2
- package/dist/{chunk-268jd0rc.js → chunk-8w21adpe.js} +6 -4
- package/dist/{chunk-21gmrwhs.js → chunk-8w8d1k7b.js} +17 -21
- package/dist/{chunk-yzcjz0gg.js → chunk-90bqyqfd.js} +46 -45
- package/dist/{chunk-2xvc97x4.js → chunk-942yq6xx.js} +3 -3
- package/dist/{chunk-88xc4d7f.js → chunk-99ck62v1.js} +49 -48
- package/dist/chunk-9ewnsd7f.js +31 -0
- package/dist/{chunk-xwg327ys.js → chunk-9g29z3dv.js} +6 -6
- package/dist/{chunk-5a5w0ygx.js → chunk-9nj016rn.js} +2 -2
- package/dist/chunk-9nk34wee.js +441 -0
- package/dist/{chunk-2v4x8kaq.js → chunk-9z45660r.js} +51 -50
- package/dist/{chunk-s1tg295x.js → chunk-a3gq2vv4.js} +10 -8
- package/dist/{chunk-6p4cyhb3.js → chunk-a6d2q415.js} +2 -2
- package/dist/{chunk-0jtbeesf.js → chunk-akqsq8bn.js} +16 -20
- package/dist/{chunk-tff58196.js → chunk-aqq5qh2y.js} +48 -47
- package/dist/{chunk-dvcwahst.js → chunk-awdftfcf.js} +51 -50
- package/dist/{chunk-3zxswxtg.js → chunk-b3nkagky.js} +2 -2
- package/dist/{chunk-jgjqa49s.js → chunk-b56smerd.js} +3 -3
- package/dist/{chunk-enkdxqas.js → chunk-b5asw4tj.js} +6 -6
- package/dist/{chunk-1x0y4426.js → chunk-b8f5dz5b.js} +4 -4
- package/dist/{chunk-30smv00b.js → chunk-bayvqjm6.js} +47 -46
- package/dist/chunk-bgyb0z0p.js +96 -0
- package/dist/{chunk-3skj4gfg.js → chunk-bhabqhx1.js} +47 -46
- package/dist/{chunk-4140c8xy.js → chunk-bj85dnsy.js} +20 -24
- package/dist/{chunk-vdcm8hz6.js → chunk-bp4s0gry.js} +47 -46
- package/dist/{chunk-d00mfc1e.js → chunk-brng9f4q.js} +46 -45
- package/dist/{chunk-a3ws4gae.js → chunk-bvdzmdw4.js} +47 -46
- package/dist/{chunk-m87bhhqv.js → chunk-bzatg35k.js} +1 -1
- package/dist/{chunk-hxzt3r84.js → chunk-ca72efeb.js} +51 -50
- package/dist/{chunk-vajwapkf.js → chunk-cdact4jj.js} +17 -23
- package/dist/{chunk-s3hsqf80.js → chunk-cexw1jmv.js} +30 -81
- package/dist/chunk-cfyvkbe5.js +197 -0
- package/dist/{chunk-jj5wj46b.js → chunk-cjca0q27.js} +7 -7
- package/dist/{chunk-3hwa20vg.js → chunk-cs9aqzag.js} +49 -46
- package/dist/{chunk-1ax1znzj.js → chunk-cttezxcb.js} +24 -14
- package/dist/chunk-d2g976qe.js +1457 -0
- package/dist/{chunk-d6rypdxt.js → chunk-d7ws01qk.js} +1 -1
- package/dist/{chunk-xxw9a0bq.js → chunk-dhwr4fz4.js} +2 -2
- package/dist/{chunk-x2pvw7xw.js → chunk-dmyedkpw.js} +8 -8
- package/dist/{chunk-af868wet.js → chunk-dsqfe05n.js} +46 -45
- package/dist/{chunk-4r50c14n.js → chunk-e82vbky2.js} +46 -45
- package/dist/{chunk-vawgyev5.js → chunk-eba0b85f.js} +3 -3
- package/dist/{chunk-87e209aj.js → chunk-eqnfk1g0.js} +46 -45
- package/dist/chunk-erj5nc8b.js +92 -0
- package/dist/{chunk-ky39hkg1.js → chunk-eseq7djh.js} +9 -7
- package/dist/{chunk-vvsbvz2b.js → chunk-esrkw9v4.js} +2 -2
- package/dist/{chunk-jgpmpgx6.js → chunk-etdt1xz3.js} +1 -1
- package/dist/{chunk-w05jpkkr.js → chunk-ewbvcf88.js} +5 -9
- package/dist/chunk-ewhxddsa.js +445 -0
- package/dist/{chunk-jjh7m5sg.js → chunk-ey1pg5v8.js} +66 -77
- package/dist/{chunk-h02gcdx5.js → chunk-f1v8h236.js} +8 -8
- package/dist/chunk-f70fwxds.js +211 -0
- package/dist/{chunk-1dwvgrfc.js → chunk-f73trmvk.js} +46 -45
- package/dist/{chunk-xnv6kb39.js → chunk-fcww10dt.js} +22 -23
- package/dist/{chunk-15edybe0.js → chunk-fhprmgf4.js} +1 -1
- package/dist/{chunk-5awgsvrw.js → chunk-fnf4av18.js} +14 -6
- package/dist/{chunk-j4m8fd76.js → chunk-fy543pwf.js} +7 -11
- package/dist/chunk-fybanr7d.js +988 -0
- package/dist/chunk-g5epkvz2.js +331 -0
- package/dist/chunk-g5pe8dew.js +25 -0
- package/dist/chunk-g8183rkv.js +517 -0
- package/dist/{chunk-4g0nj78p.js → chunk-gbztsm42.js} +46 -45
- package/dist/{chunk-ga86yjm1.js → chunk-gdwdqewd.js} +3 -3
- package/dist/{chunk-kva79cra.js → chunk-ge57c9hg.js} +7 -5
- package/dist/{chunk-f2hbn5rk.js → chunk-ggq2y3tn.js} +100420 -57118
- package/dist/{chunk-w0gmf6bv.js → chunk-gpzkzg7v.js} +47 -46
- package/dist/{chunk-v0bykh19.js → chunk-gw1a82j8.js} +108 -102
- package/dist/chunk-gw1g065z.js +20 -0
- package/dist/{chunk-21jsjcfa.js → chunk-h4dnamt5.js} +46 -45
- package/dist/{chunk-hh3k5s1s.js → chunk-h5mkzk0z.js} +3 -3
- package/dist/chunk-h7dm24cc.js +108 -0
- package/dist/{chunk-wr3pd88n.js → chunk-hadww3nd.js} +40 -9
- package/dist/{chunk-8ywngxqt.js → chunk-hapvn84d.js} +10 -10
- package/dist/{chunk-gbte7d7h.js → chunk-hekf5s9q.js} +4 -2
- package/dist/{chunk-veap97he.js → chunk-hkgb5y9f.js} +46 -45
- package/dist/{chunk-23fkapww.js → chunk-hzceftr4.js} +2 -2
- package/dist/chunk-j2x6fp25.js +29 -0
- package/dist/{chunk-vsqwd13w.js → chunk-j30g8fd1.js} +17 -19
- package/dist/{chunk-yyf72f78.js → chunk-j35mw64g.js} +4 -2
- package/dist/{chunk-qq5d2s0d.js → chunk-j3awswy3.js} +46 -45
- package/dist/{chunk-dmqeqxfz.js → chunk-j513wqe9.js} +46 -45
- package/dist/{chunk-hya4c599.js → chunk-jkens34n.js} +46 -45
- package/dist/{chunk-s4zb3f1b.js → chunk-jperb6n2.js} +46 -45
- package/dist/{chunk-psnsve7m.js → chunk-jqmr6ag1.js} +49 -48
- package/dist/{chunk-q7jnesv8.js → chunk-jsj3fx0g.js} +5 -5
- package/dist/{chunk-w1sv7j01.js → chunk-jx6k8msx.js} +46 -45
- package/dist/{chunk-xw8pjerk.js → chunk-jyz65rfv.js} +48 -47
- package/dist/{chunk-1avzakfd.js → chunk-k5mckm5f.js} +3 -3
- package/dist/{chunk-zctfbr1v.js → chunk-k7cw1a8a.js} +1 -1
- package/dist/{chunk-m46xyqr6.js → chunk-k9z36r5q.js} +48 -47
- package/dist/{chunk-th4y838y.js → chunk-kamesdff.js} +51 -50
- package/dist/{chunk-y7we499r.js → chunk-kj4m0j4n.js} +8 -8
- package/dist/{chunk-tdbz9gbm.js → chunk-kjqyhxz7.js} +6 -6
- package/dist/{chunk-k0v0cz71.js → chunk-m25yfqc3.js} +46 -45
- package/dist/{chunk-4nspekjp.js → chunk-mcws22k3.js} +1 -28
- package/dist/chunk-mgpj5f7h.js +150 -0
- package/dist/{chunk-1ybvj5df.js → chunk-mmn62bh2.js} +47 -46
- package/dist/{chunk-jpc9zwsk.js → chunk-mq94v5vn.js} +3 -3
- package/dist/{chunk-a1bf2kh4.js → chunk-msvv7dpt.js} +46 -45
- package/dist/chunk-mtv83pq4.js +123 -0
- package/dist/chunk-n36xjgtj.js +95 -0
- package/dist/{chunk-twqzmqsn.js → chunk-n9d0gg9z.js} +31 -27
- package/dist/{chunk-cvm2tmwg.js → chunk-na63s9wn.js} +20 -24
- package/dist/{chunk-jtztm8f5.js → chunk-nebntwvd.js} +44 -43
- package/dist/{chunk-0ym2z0c7.js → chunk-nj02kck4.js} +1 -1
- package/dist/{chunk-5rv9c8yd.js → chunk-nrjtxhyr.js} +1 -1
- package/dist/{chunk-nqn45znr.js → chunk-ns7x6xam.js} +9 -9
- package/dist/{chunk-jaaxk89e.js → chunk-nsc89h0n.js} +2 -22
- package/dist/{chunk-gnj7tyj6.js → chunk-nv7vcqme.js} +49 -48
- package/dist/{chunk-z19sd3bt.js → chunk-p4196wzm.js} +5 -5
- package/dist/{chunk-as5rvw4n.js → chunk-pbeee2kp.js} +17 -21
- package/dist/{chunk-va8drjmv.js → chunk-pcbm66ch.js} +48 -47
- package/dist/{chunk-phd1qfpc.js → chunk-pd2vy8hx.js} +5 -5
- package/dist/chunk-pe3n0w2t.js +91 -0
- package/dist/{chunk-bd5sqj86.js → chunk-peh3mj19.js} +11 -11
- package/dist/{chunk-mk1y74w7.js → chunk-pepgckn4.js} +17 -21
- package/dist/{chunk-wqvr37xp.js → chunk-pm67yj46.js} +15 -31
- package/dist/{chunk-qyqpb15f.js → chunk-pp8nrx40.js} +205 -261
- package/dist/{chunk-nx7c354z.js → chunk-pq5290db.js} +46 -45
- package/dist/{chunk-w4yn8cq7.js → chunk-psm26hv7.js} +8 -8
- package/dist/{chunk-hwn8vetn.js → chunk-pwpk3gm6.js} +10 -10
- package/dist/chunk-pzp8fj0a.js +123 -0
- package/dist/{chunk-x94btg29.js → chunk-q1j8ebyf.js} +17 -21
- package/dist/{chunk-87scz097.js → chunk-q2fn2p7y.js} +46 -45
- package/dist/chunk-q347821k.js +99 -0
- package/dist/{chunk-23jzrwsw.js → chunk-q6tdxy8v.js} +5 -5
- package/dist/{chunk-byb2mn1c.js → chunk-qb88vpgy.js} +118 -450
- package/dist/{chunk-eenq3avg.js → chunk-qcrpqjya.js} +1 -1
- package/dist/chunk-qehbwde1.js +90 -0
- package/dist/{chunk-ck0ap688.js → chunk-qkczt8cr.js} +4 -4
- package/dist/{chunk-c3d2cnz5.js → chunk-qmmxwh8x.js} +7 -7
- package/dist/{chunk-1a6ez1mg.js → chunk-qxmm3jbn.js} +51 -49
- package/dist/{chunk-njxgct8f.js → chunk-qywk2c7m.js} +46 -45
- package/dist/{chunk-rkg741k3.js → chunk-qz0xdht6.js} +14 -14
- package/dist/chunk-r0dpeqg0.js +468 -0
- package/dist/{chunk-6ksdp40n.js → chunk-r0m970pk.js} +1 -1
- package/dist/{chunk-fape0yfp.js → chunk-r5bf0h0t.js} +46 -45
- package/dist/{chunk-jcwkgtbp.js → chunk-r7xpsch7.js} +52 -90
- package/dist/{chunk-z9n0183s.js → chunk-rfq9kmsy.js} +9 -9
- package/dist/{chunk-xp61y5ba.js → chunk-rkv8bdtr.js} +2 -2
- package/dist/{chunk-5cem2v7n.js → chunk-rkvwts6v.js} +5 -5
- package/dist/{chunk-1vnd9s2j.js → chunk-rm4c8zd9.js} +57 -66
- package/dist/{chunk-e7efcp3k.js → chunk-rm9gb396.js} +257 -2857
- package/dist/{chunk-0m9w9esf.js → chunk-s213xmp8.js} +46 -45
- package/dist/{chunk-c42pqnxx.js → chunk-s3s0611n.js} +1 -1
- package/dist/{chunk-qdnxk7d7.js → chunk-scrk9jbt.js} +29 -30
- package/dist/{chunk-wayfjcwt.js → chunk-sdfvr9ps.js} +4 -4
- package/dist/{chunk-7mqab3z7.js → chunk-skp5w8bq.js} +1 -1
- package/dist/{chunk-76j2e9vy.js → chunk-snxp8mxj.js} +2 -2
- package/dist/{chunk-ad3v6mzw.js → chunk-tgmettzd.js} +12 -12
- package/dist/{chunk-cdj51xbj.js → chunk-tj6hejny.js} +46 -45
- package/dist/chunk-tn0xnp8a.js +124 -0
- package/dist/chunk-tpn6rh31.js +62 -0
- package/dist/{chunk-qsc98gbe.js → chunk-tq4vws6e.js} +2 -2
- package/dist/{chunk-ydcsbj4t.js → chunk-tzzzbb9d.js} +11 -9
- package/dist/chunk-v3s93bzd.js +34 -0
- package/dist/{chunk-4cp6193g.js → chunk-v4t6dyyh.js} +2 -2
- package/dist/{chunk-xfkfh5sd.js → chunk-v6fcbmqz.js} +1808 -1643
- package/dist/{chunk-k7g9gcr9.js → chunk-vc59jf3q.js} +64 -58
- package/dist/{chunk-gdhz1652.js → chunk-vdk9b74d.js} +27 -30
- package/dist/{chunk-tvzr9c8a.js → chunk-vf9c1649.js} +46 -45
- package/dist/{chunk-naybw0p0.js → chunk-vgk0nymz.js} +8 -8
- package/dist/{chunk-jh965sa0.js → chunk-vgzpbh28.js} +47 -46
- package/dist/{chunk-q87kegxh.js → chunk-vhxrn87v.js} +49 -48
- package/dist/chunk-vnzgpyrz.js +1534 -0
- package/dist/{chunk-r6kaak61.js → chunk-vqh6cjfx.js} +16 -20
- package/dist/{chunk-wbbykfdd.js → chunk-vz3pa5n6.js} +1 -1
- package/dist/{chunk-pwqm47kn.js → chunk-w1h5z2sy.js} +46 -45
- package/dist/{chunk-rm2vtv77.js → chunk-w2vvxj1f.js} +22 -25
- package/dist/{chunk-s7q42kp2.js → chunk-w5zezk61.js} +9 -9
- package/dist/{chunk-vrjbc8ap.js → chunk-wa8yn2p0.js} +1 -1
- package/dist/{chunk-a3wczqrp.js → chunk-wahqac7c.js} +37 -41
- package/dist/{chunk-qvd3hbqs.js → chunk-wc0np2zw.js} +5 -5
- package/dist/{chunk-2j3v2dgk.js → chunk-wcpmtszh.js} +47 -46
- package/dist/{chunk-jxfp3g9b.js → chunk-wdzjtdye.js} +4 -4
- package/dist/{chunk-0g5cy3wj.js → chunk-wgk9sxk7.js} +4 -4
- package/dist/{chunk-rc9x0raa.js → chunk-wmbpjx7v.js} +56 -55
- package/dist/chunk-wrsy4y58.js +93 -0
- package/dist/{chunk-rtmh0v4c.js → chunk-wskkym13.js} +6 -6
- package/dist/{chunk-bm5rc541.js → chunk-wt6v1zbe.js} +5 -5
- package/dist/{chunk-37p5p94r.js → chunk-wyj3wpjv.js} +55 -54
- package/dist/chunk-x7fdwq3d.js +33 -0
- package/dist/{chunk-6t5zvnrg.js → chunk-xdg2rpj3.js} +48 -46
- package/dist/{chunk-chsyvavm.js → chunk-xeb6075z.js} +1 -1
- package/dist/{chunk-23q4jpn2.js → chunk-xemw9d52.js} +3 -3
- package/dist/{chunk-n7pnyq43.js → chunk-xhfmdq1y.js} +16 -0
- package/dist/{chunk-jmkn11my.js → chunk-xmdny0m1.js} +20 -20
- package/dist/chunk-xswyz2es.js +118 -0
- package/dist/{chunk-67a4147x.js → chunk-xv5a2xbe.js} +1 -1
- package/dist/{chunk-1dgdjrm1.js → chunk-xx709m24.js} +4 -4
- package/dist/{chunk-qn8z4r79.js → chunk-y024419t.js} +50 -48
- package/dist/{chunk-dbwmzvfj.js → chunk-y1ps26mz.js} +46 -45
- package/dist/{chunk-4m9df5ef.js → chunk-y2r5e6kv.js} +17 -21
- package/dist/{chunk-k1crm94z.js → chunk-y41svpxw.js} +46 -45
- package/dist/{chunk-qjyg1dv7.js → chunk-ygwcq4vd.js} +6 -10
- package/dist/{chunk-fk8crdnk.js → chunk-ykv414dd.js} +48 -46
- package/dist/{chunk-g5pgham9.js → chunk-ynkzfhs1.js} +20 -14
- package/dist/{chunk-gvrjgq1n.js → chunk-yrqx3p9k.js} +16 -20
- package/dist/{chunk-c9dmpdss.js → chunk-ys17e80d.js} +46 -45
- package/dist/{chunk-97wgdsab.js → chunk-z16txqz0.js} +3 -3
- package/dist/{chunk-yvtzznds.js → chunk-z6wm96eh.js} +2 -2
- package/dist/{chunk-8ybw2s0h.js → chunk-zbb7qd0v.js} +4 -4
- package/dist/{chunk-030rqd3a.js → chunk-zjxv5g2n.js} +54 -53
- package/dist/{chunk-425w66ka.js → chunk-zmwgp2sh.js} +4 -4
- package/dist/cli.js +8 -8
- package/dist/gateway/index.js +430 -0
- package/dist/gateway/worker.js +482687 -0
- package/package.json +1 -1
- package/dist/chunk-11cz07kz.js +0 -93
- package/dist/chunk-1pbtp2z2.js +0 -92
- package/dist/chunk-25y2dtzf.js +0 -91
- package/dist/chunk-3hyj0zpy.js +0 -95
- package/dist/chunk-4kqjjakw.js +0 -73
- package/dist/chunk-4zwqbg7s.js +0 -87
- package/dist/chunk-5be33wja.js +0 -120
- package/dist/chunk-70mgxhkz.js +0 -369
- package/dist/chunk-7gmk09cq.js +0 -116
- package/dist/chunk-8dprcdra.js +0 -92
- package/dist/chunk-8xwx1xtg.js +0 -120
- package/dist/chunk-a579wjd2.js +0 -436
- package/dist/chunk-axqk3mxk.js +0 -116
- package/dist/chunk-c0ckmxr1.js +0 -86
- package/dist/chunk-c6t24y8q.js +0 -94
- package/dist/chunk-cfv996bs.js +0 -22
- package/dist/chunk-e5t5eefc.js +0 -62
- package/dist/chunk-eyph0250.js +0 -88
- package/dist/chunk-f825x57v.js +0 -91
- package/dist/chunk-h9xx5bj6.js +0 -91
- package/dist/chunk-j1dg659r.js +0 -89
- package/dist/chunk-jk8seqkk.js +0 -90
- package/dist/chunk-jzg4nddc.js +0 -92
- package/dist/chunk-k5vy0s3c.js +0 -93
- package/dist/chunk-ke820fjw.js +0 -91
- package/dist/chunk-kyzd4p8z.js +0 -111
- package/dist/chunk-njrt3tac.js +0 -640
- package/dist/chunk-pavb6a7w.js +0 -516
- package/dist/chunk-q268gpa0.js +0 -145
- package/dist/chunk-qvh1w3t7.js +0 -157
- package/dist/chunk-qy1es4jj.js +0 -95
- package/dist/chunk-qz2x630m.js +0 -49145
- package/dist/chunk-tw48evtr.js +0 -40
- package/dist/chunk-w0gfctyc.js +0 -117
- package/dist/chunk-y0fhjxef.js +0 -276
- package/dist/chunk-y275vgmw.js +0 -654
- package/dist/chunk-zq7pmdas.js +0 -1003
|
@@ -0,0 +1,988 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
SandboxManager,
|
|
4
|
+
getProcessCommand,
|
|
5
|
+
getRipgrepStatus,
|
|
6
|
+
init_genericProcessUtils,
|
|
7
|
+
init_ripgrep,
|
|
8
|
+
init_sandbox_adapter
|
|
9
|
+
} from "./chunk-ggq2y3tn.js";
|
|
10
|
+
import {
|
|
11
|
+
CUSTOMIZATION_SURFACES,
|
|
12
|
+
formatAutoUpdaterDisabledReason,
|
|
13
|
+
getAutoUpdaterDisabledReason,
|
|
14
|
+
getFeatureValue_CACHED_MAY_BE_STALE,
|
|
15
|
+
getGlobalConfig,
|
|
16
|
+
getManagedFilePath,
|
|
17
|
+
init_config,
|
|
18
|
+
init_growthbook,
|
|
19
|
+
init_managedPath,
|
|
20
|
+
init_types
|
|
21
|
+
} from "./chunk-rm9gb396.js";
|
|
22
|
+
import {
|
|
23
|
+
getPlatform,
|
|
24
|
+
init_platform
|
|
25
|
+
} from "./chunk-rkv8bdtr.js";
|
|
26
|
+
import {
|
|
27
|
+
init_bundledMode,
|
|
28
|
+
isInBundledMode
|
|
29
|
+
} from "./chunk-cexw1jmv.js";
|
|
30
|
+
import {
|
|
31
|
+
execFileNoThrow,
|
|
32
|
+
init_execFileNoThrow
|
|
33
|
+
} from "./chunk-40s88wdg.js";
|
|
34
|
+
import {
|
|
35
|
+
init_log,
|
|
36
|
+
logError
|
|
37
|
+
} from "./chunk-5cxjxxx8.js";
|
|
38
|
+
import {
|
|
39
|
+
getCwd,
|
|
40
|
+
init_cwd
|
|
41
|
+
} from "./chunk-s8kj6ajy.js";
|
|
42
|
+
import {
|
|
43
|
+
init_which,
|
|
44
|
+
which
|
|
45
|
+
} from "./chunk-qcrpqjya.js";
|
|
46
|
+
import {
|
|
47
|
+
execa,
|
|
48
|
+
init_execa
|
|
49
|
+
} from "./chunk-5z28bqne.js";
|
|
50
|
+
import {
|
|
51
|
+
getFsImplementation,
|
|
52
|
+
init_debug,
|
|
53
|
+
init_errors,
|
|
54
|
+
init_fsOperations,
|
|
55
|
+
init_slowOperations,
|
|
56
|
+
isENOENT,
|
|
57
|
+
isFsInaccessible,
|
|
58
|
+
jsonParse,
|
|
59
|
+
jsonStringify,
|
|
60
|
+
logForDebugging,
|
|
61
|
+
toError,
|
|
62
|
+
writeFileSync_DEPRECATED
|
|
63
|
+
} from "./chunk-pd2vy8hx.js";
|
|
64
|
+
import {
|
|
65
|
+
getClaudeConfigHomeDir,
|
|
66
|
+
init_envUtils,
|
|
67
|
+
isEnvDefinedFalsy,
|
|
68
|
+
isEnvTruthy
|
|
69
|
+
} from "./chunk-nsc89h0n.js";
|
|
70
|
+
import {
|
|
71
|
+
init_memoize,
|
|
72
|
+
memoize_default
|
|
73
|
+
} from "./chunk-vf612n57.js";
|
|
74
|
+
import {
|
|
75
|
+
__esm
|
|
76
|
+
} from "./chunk-qp2qdcda.js";
|
|
77
|
+
|
|
78
|
+
// src/utils/localInstaller.ts
|
|
79
|
+
import { access, chmod, writeFile } from "fs/promises";
|
|
80
|
+
import { join } from "path";
|
|
81
|
+
function getLocalInstallDir() {
|
|
82
|
+
return join(getClaudeConfigHomeDir(), "local");
|
|
83
|
+
}
|
|
84
|
+
function getLocalClaudePath() {
|
|
85
|
+
return join(getLocalInstallDir(), "claude");
|
|
86
|
+
}
|
|
87
|
+
function isRunningFromLocalInstallation() {
|
|
88
|
+
const execPath = process.argv[1] || "";
|
|
89
|
+
return execPath.includes("/.claude/local/node_modules/");
|
|
90
|
+
}
|
|
91
|
+
async function localInstallationExists() {
|
|
92
|
+
try {
|
|
93
|
+
await access(join(getLocalInstallDir(), "node_modules", ".bin", "claude"));
|
|
94
|
+
return true;
|
|
95
|
+
} catch {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function getShellType() {
|
|
100
|
+
const shellPath = process.env.SHELL || "";
|
|
101
|
+
if (shellPath.includes("zsh"))
|
|
102
|
+
return "zsh";
|
|
103
|
+
if (shellPath.includes("bash"))
|
|
104
|
+
return "bash";
|
|
105
|
+
if (shellPath.includes("fish"))
|
|
106
|
+
return "fish";
|
|
107
|
+
return "unknown";
|
|
108
|
+
}
|
|
109
|
+
var init_localInstaller = __esm(() => {
|
|
110
|
+
init_config();
|
|
111
|
+
init_envUtils();
|
|
112
|
+
init_errors();
|
|
113
|
+
init_execFileNoThrow();
|
|
114
|
+
init_fsOperations();
|
|
115
|
+
init_log();
|
|
116
|
+
init_slowOperations();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// src/utils/nativeInstaller/packageManagers.ts
|
|
120
|
+
import { readFile } from "fs/promises";
|
|
121
|
+
function isDistroFamily(osRelease, families) {
|
|
122
|
+
return families.includes(osRelease.id) || osRelease.idLike.some((like) => families.includes(like));
|
|
123
|
+
}
|
|
124
|
+
function detectMise() {
|
|
125
|
+
const execPath = process.execPath || process.argv[0] || "";
|
|
126
|
+
if (/[/\\]mise[/\\]installs[/\\]/i.test(execPath)) {
|
|
127
|
+
logForDebugging(`Detected mise installation: ${execPath}`);
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
function detectAsdf() {
|
|
133
|
+
const execPath = process.execPath || process.argv[0] || "";
|
|
134
|
+
if (/[/\\]\.?asdf[/\\]installs[/\\]/i.test(execPath)) {
|
|
135
|
+
logForDebugging(`Detected asdf installation: ${execPath}`);
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
function detectHomebrew() {
|
|
141
|
+
const platform = getPlatform();
|
|
142
|
+
if (platform !== "macos" && platform !== "linux" && platform !== "wsl") {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
const execPath = process.execPath || process.argv[0] || "";
|
|
146
|
+
if (execPath.includes("/Caskroom/")) {
|
|
147
|
+
logForDebugging(`Detected Homebrew cask installation: ${execPath}`);
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
function detectWinget() {
|
|
153
|
+
const platform = getPlatform();
|
|
154
|
+
if (platform !== "windows") {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
const execPath = process.execPath || process.argv[0] || "";
|
|
158
|
+
const wingetPatterns = [
|
|
159
|
+
/Microsoft[/\\]WinGet[/\\]Packages/i,
|
|
160
|
+
/Microsoft[/\\]WinGet[/\\]Links/i
|
|
161
|
+
];
|
|
162
|
+
for (const pattern of wingetPatterns) {
|
|
163
|
+
if (pattern.test(execPath)) {
|
|
164
|
+
logForDebugging(`Detected winget installation: ${execPath}`);
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
var getOsRelease, detectPacman, detectDeb, detectRpm, detectApk, getPackageManager;
|
|
171
|
+
var init_packageManagers = __esm(() => {
|
|
172
|
+
init_memoize();
|
|
173
|
+
init_debug();
|
|
174
|
+
init_execFileNoThrow();
|
|
175
|
+
init_platform();
|
|
176
|
+
getOsRelease = memoize_default(async () => {
|
|
177
|
+
try {
|
|
178
|
+
const content = await readFile("/etc/os-release", "utf8");
|
|
179
|
+
const idMatch = content.match(/^ID=["']?(\S+?)["']?\s*$/m);
|
|
180
|
+
const idLikeMatch = content.match(/^ID_LIKE=["']?(.+?)["']?\s*$/m);
|
|
181
|
+
return {
|
|
182
|
+
id: idMatch?.[1] ?? "",
|
|
183
|
+
idLike: idLikeMatch?.[1]?.split(" ") ?? []
|
|
184
|
+
};
|
|
185
|
+
} catch {
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
detectPacman = memoize_default(async () => {
|
|
190
|
+
const platform = getPlatform();
|
|
191
|
+
if (platform !== "linux") {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
const osRelease = await getOsRelease();
|
|
195
|
+
if (osRelease && !isDistroFamily(osRelease, ["arch"])) {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
const execPath = process.execPath || process.argv[0] || "";
|
|
199
|
+
const result = await execFileNoThrow("pacman", ["-Qo", execPath], {
|
|
200
|
+
timeout: 5000,
|
|
201
|
+
useCwd: false
|
|
202
|
+
});
|
|
203
|
+
if (result.code === 0 && result.stdout) {
|
|
204
|
+
logForDebugging(`Detected pacman installation: ${result.stdout.trim()}`);
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
return false;
|
|
208
|
+
});
|
|
209
|
+
detectDeb = memoize_default(async () => {
|
|
210
|
+
const platform = getPlatform();
|
|
211
|
+
if (platform !== "linux") {
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
const osRelease = await getOsRelease();
|
|
215
|
+
if (osRelease && !isDistroFamily(osRelease, ["debian"])) {
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
const execPath = process.execPath || process.argv[0] || "";
|
|
219
|
+
const result = await execFileNoThrow("dpkg", ["-S", execPath], {
|
|
220
|
+
timeout: 5000,
|
|
221
|
+
useCwd: false
|
|
222
|
+
});
|
|
223
|
+
if (result.code === 0 && result.stdout) {
|
|
224
|
+
logForDebugging(`Detected deb installation: ${result.stdout.trim()}`);
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
227
|
+
return false;
|
|
228
|
+
});
|
|
229
|
+
detectRpm = memoize_default(async () => {
|
|
230
|
+
const platform = getPlatform();
|
|
231
|
+
if (platform !== "linux") {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
const osRelease = await getOsRelease();
|
|
235
|
+
if (osRelease && !isDistroFamily(osRelease, ["fedora", "rhel", "suse"])) {
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
const execPath = process.execPath || process.argv[0] || "";
|
|
239
|
+
const result = await execFileNoThrow("rpm", ["-qf", execPath], {
|
|
240
|
+
timeout: 5000,
|
|
241
|
+
useCwd: false
|
|
242
|
+
});
|
|
243
|
+
if (result.code === 0 && result.stdout) {
|
|
244
|
+
logForDebugging(`Detected rpm installation: ${result.stdout.trim()}`);
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
return false;
|
|
248
|
+
});
|
|
249
|
+
detectApk = memoize_default(async () => {
|
|
250
|
+
const platform = getPlatform();
|
|
251
|
+
if (platform !== "linux") {
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
const osRelease = await getOsRelease();
|
|
255
|
+
if (osRelease && !isDistroFamily(osRelease, ["alpine"])) {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
const execPath = process.execPath || process.argv[0] || "";
|
|
259
|
+
const result = await execFileNoThrow("apk", ["info", "--who-owns", execPath], {
|
|
260
|
+
timeout: 5000,
|
|
261
|
+
useCwd: false
|
|
262
|
+
});
|
|
263
|
+
if (result.code === 0 && result.stdout) {
|
|
264
|
+
logForDebugging(`Detected apk installation: ${result.stdout.trim()}`);
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
return false;
|
|
268
|
+
});
|
|
269
|
+
getPackageManager = memoize_default(async () => {
|
|
270
|
+
if (detectHomebrew()) {
|
|
271
|
+
return "homebrew";
|
|
272
|
+
}
|
|
273
|
+
if (detectWinget()) {
|
|
274
|
+
return "winget";
|
|
275
|
+
}
|
|
276
|
+
if (detectMise()) {
|
|
277
|
+
return "mise";
|
|
278
|
+
}
|
|
279
|
+
if (detectAsdf()) {
|
|
280
|
+
return "asdf";
|
|
281
|
+
}
|
|
282
|
+
if (await detectPacman()) {
|
|
283
|
+
return "pacman";
|
|
284
|
+
}
|
|
285
|
+
if (await detectApk()) {
|
|
286
|
+
return "apk";
|
|
287
|
+
}
|
|
288
|
+
if (await detectDeb()) {
|
|
289
|
+
return "deb";
|
|
290
|
+
}
|
|
291
|
+
if (await detectRpm()) {
|
|
292
|
+
return "rpm";
|
|
293
|
+
}
|
|
294
|
+
return "unknown";
|
|
295
|
+
});
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
// src/utils/shellConfig.ts
|
|
299
|
+
import { open, readFile as readFile2, stat } from "fs/promises";
|
|
300
|
+
import { homedir as osHomedir } from "os";
|
|
301
|
+
import { join as join2 } from "path";
|
|
302
|
+
function getShellConfigPaths(options) {
|
|
303
|
+
const home = options?.homedir ?? osHomedir();
|
|
304
|
+
const env = options?.env ?? process.env;
|
|
305
|
+
const zshConfigDir = env.ZDOTDIR || home;
|
|
306
|
+
return {
|
|
307
|
+
zsh: join2(zshConfigDir, ".zshrc"),
|
|
308
|
+
bash: join2(home, ".bashrc"),
|
|
309
|
+
fish: join2(home, ".config/fish/config.fish")
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
function filterClaudeAliases(lines) {
|
|
313
|
+
let hadAlias = false;
|
|
314
|
+
const filtered = lines.filter((line) => {
|
|
315
|
+
if (CLAUDE_ALIAS_REGEX.test(line)) {
|
|
316
|
+
let match = line.match(/alias\s+claude\s*=\s*["']([^"']+)["']/);
|
|
317
|
+
if (!match) {
|
|
318
|
+
match = line.match(/alias\s+claude\s*=\s*([^#\n]+)/);
|
|
319
|
+
}
|
|
320
|
+
if (match && match[1]) {
|
|
321
|
+
const target = match[1].trim();
|
|
322
|
+
if (target === getLocalClaudePath()) {
|
|
323
|
+
hadAlias = true;
|
|
324
|
+
return false;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return true;
|
|
329
|
+
});
|
|
330
|
+
return { filtered, hadAlias };
|
|
331
|
+
}
|
|
332
|
+
async function readFileLines(filePath) {
|
|
333
|
+
try {
|
|
334
|
+
const content = await readFile2(filePath, { encoding: "utf8" });
|
|
335
|
+
return content.split(`
|
|
336
|
+
`);
|
|
337
|
+
} catch (e) {
|
|
338
|
+
if (isFsInaccessible(e))
|
|
339
|
+
return null;
|
|
340
|
+
throw e;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
async function writeFileLines(filePath, lines) {
|
|
344
|
+
const fh = await open(filePath, "w");
|
|
345
|
+
try {
|
|
346
|
+
await fh.writeFile(lines.join(`
|
|
347
|
+
`), { encoding: "utf8" });
|
|
348
|
+
await fh.datasync();
|
|
349
|
+
} finally {
|
|
350
|
+
await fh.close();
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
async function findClaudeAlias(options) {
|
|
354
|
+
const configs = getShellConfigPaths(options);
|
|
355
|
+
for (const configPath of Object.values(configs)) {
|
|
356
|
+
const lines = await readFileLines(configPath);
|
|
357
|
+
if (!lines)
|
|
358
|
+
continue;
|
|
359
|
+
for (const line of lines) {
|
|
360
|
+
if (CLAUDE_ALIAS_REGEX.test(line)) {
|
|
361
|
+
const match = line.match(/alias\s+claude=["']?([^"'\s]+)/);
|
|
362
|
+
if (match && match[1]) {
|
|
363
|
+
return match[1];
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
async function findValidClaudeAlias(options) {
|
|
371
|
+
const aliasTarget = await findClaudeAlias(options);
|
|
372
|
+
if (!aliasTarget)
|
|
373
|
+
return null;
|
|
374
|
+
const home = options?.homedir ?? osHomedir();
|
|
375
|
+
const expandedPath = aliasTarget.startsWith("~") ? aliasTarget.replace("~", home) : aliasTarget;
|
|
376
|
+
try {
|
|
377
|
+
const stats = await stat(expandedPath);
|
|
378
|
+
if (stats.isFile() || stats.isSymbolicLink()) {
|
|
379
|
+
return aliasTarget;
|
|
380
|
+
}
|
|
381
|
+
} catch {}
|
|
382
|
+
return null;
|
|
383
|
+
}
|
|
384
|
+
var CLAUDE_ALIAS_REGEX;
|
|
385
|
+
var init_shellConfig = __esm(() => {
|
|
386
|
+
init_errors();
|
|
387
|
+
init_localInstaller();
|
|
388
|
+
CLAUDE_ALIAS_REGEX = /^\s*alias\s+claude\s*=/;
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
// src/utils/doctorDiagnostic.ts
|
|
392
|
+
import { readFile as readFile3, realpath } from "fs/promises";
|
|
393
|
+
import { homedir } from "os";
|
|
394
|
+
import { delimiter, join as join3, posix, win32 } from "path";
|
|
395
|
+
function getNormalizedPaths() {
|
|
396
|
+
let invokedPath = process.argv[1] || "";
|
|
397
|
+
let execPath = process.execPath || process.argv[0] || "";
|
|
398
|
+
if (getPlatform() === "windows") {
|
|
399
|
+
invokedPath = invokedPath.split(win32.sep).join(posix.sep);
|
|
400
|
+
execPath = execPath.split(win32.sep).join(posix.sep);
|
|
401
|
+
}
|
|
402
|
+
return [invokedPath, execPath];
|
|
403
|
+
}
|
|
404
|
+
async function getCurrentInstallationType() {
|
|
405
|
+
if (true) {
|
|
406
|
+
return "development";
|
|
407
|
+
}
|
|
408
|
+
const [invokedPath] = getNormalizedPaths();
|
|
409
|
+
if (isInBundledMode()) {
|
|
410
|
+
if (detectHomebrew() || detectWinget() || detectMise() || detectAsdf() || await detectPacman() || await detectDeb() || await detectRpm() || await detectApk()) {
|
|
411
|
+
return "package-manager";
|
|
412
|
+
}
|
|
413
|
+
return "native";
|
|
414
|
+
}
|
|
415
|
+
if (isRunningFromLocalInstallation()) {
|
|
416
|
+
return "npm-local";
|
|
417
|
+
}
|
|
418
|
+
const npmGlobalPaths = [
|
|
419
|
+
"/usr/local/lib/node_modules",
|
|
420
|
+
"/usr/lib/node_modules",
|
|
421
|
+
"/opt/homebrew/lib/node_modules",
|
|
422
|
+
"/opt/homebrew/bin",
|
|
423
|
+
"/usr/local/bin",
|
|
424
|
+
"/.nvm/versions/node/"
|
|
425
|
+
];
|
|
426
|
+
if (npmGlobalPaths.some((path) => invokedPath.includes(path))) {
|
|
427
|
+
return "npm-global";
|
|
428
|
+
}
|
|
429
|
+
if (invokedPath.includes("/npm/") || invokedPath.includes("/nvm/")) {
|
|
430
|
+
return "npm-global";
|
|
431
|
+
}
|
|
432
|
+
const npmConfigResult = await execa("npm config get prefix", {
|
|
433
|
+
shell: true,
|
|
434
|
+
reject: false
|
|
435
|
+
});
|
|
436
|
+
const globalPrefix = npmConfigResult.exitCode === 0 ? npmConfigResult.stdout.trim() : null;
|
|
437
|
+
if (globalPrefix && invokedPath.startsWith(globalPrefix)) {
|
|
438
|
+
return "npm-global";
|
|
439
|
+
}
|
|
440
|
+
return "unknown";
|
|
441
|
+
}
|
|
442
|
+
async function getInstallationPath() {
|
|
443
|
+
if (true) {
|
|
444
|
+
return getCwd();
|
|
445
|
+
}
|
|
446
|
+
if (isInBundledMode()) {
|
|
447
|
+
try {
|
|
448
|
+
return await realpath(process.execPath);
|
|
449
|
+
} catch {}
|
|
450
|
+
try {
|
|
451
|
+
const path = await which("claude");
|
|
452
|
+
if (path) {
|
|
453
|
+
return path;
|
|
454
|
+
}
|
|
455
|
+
} catch {}
|
|
456
|
+
try {
|
|
457
|
+
await getFsImplementation().stat(join3(homedir(), ".local/bin/claude"));
|
|
458
|
+
return join3(homedir(), ".local/bin/claude");
|
|
459
|
+
} catch {}
|
|
460
|
+
return "native";
|
|
461
|
+
}
|
|
462
|
+
try {
|
|
463
|
+
return process.argv[0] || "unknown";
|
|
464
|
+
} catch {
|
|
465
|
+
return "unknown";
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
function getInvokedBinary() {
|
|
469
|
+
try {
|
|
470
|
+
if (isInBundledMode()) {
|
|
471
|
+
return process.execPath || "unknown";
|
|
472
|
+
}
|
|
473
|
+
return process.argv[1] || "unknown";
|
|
474
|
+
} catch {
|
|
475
|
+
return "unknown";
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
async function detectMultipleInstallations() {
|
|
479
|
+
const fs = getFsImplementation();
|
|
480
|
+
const installations = [];
|
|
481
|
+
const localPath = join3(homedir(), ".claude", "local");
|
|
482
|
+
if (await localInstallationExists()) {
|
|
483
|
+
installations.push({ type: "npm-local", path: localPath });
|
|
484
|
+
}
|
|
485
|
+
const packagesToCheck = ["@anthropic-ai/claude-code"];
|
|
486
|
+
if ("") {}
|
|
487
|
+
const npmResult = await execFileNoThrow("npm", [
|
|
488
|
+
"-g",
|
|
489
|
+
"config",
|
|
490
|
+
"get",
|
|
491
|
+
"prefix"
|
|
492
|
+
]);
|
|
493
|
+
if (npmResult.code === 0 && npmResult.stdout) {
|
|
494
|
+
const npmPrefix = npmResult.stdout.trim();
|
|
495
|
+
const isWindows = getPlatform() === "windows";
|
|
496
|
+
const globalBinPath = isWindows ? join3(npmPrefix, "claude") : join3(npmPrefix, "bin", "claude");
|
|
497
|
+
let globalBinExists = false;
|
|
498
|
+
try {
|
|
499
|
+
await fs.stat(globalBinPath);
|
|
500
|
+
globalBinExists = true;
|
|
501
|
+
} catch {}
|
|
502
|
+
if (globalBinExists) {
|
|
503
|
+
let isCurrentHomebrewInstallation = false;
|
|
504
|
+
try {
|
|
505
|
+
const realPath = await realpath(globalBinPath);
|
|
506
|
+
if (realPath.includes("/Caskroom/")) {
|
|
507
|
+
isCurrentHomebrewInstallation = detectHomebrew();
|
|
508
|
+
}
|
|
509
|
+
} catch {}
|
|
510
|
+
if (!isCurrentHomebrewInstallation) {
|
|
511
|
+
installations.push({ type: "npm-global", path: globalBinPath });
|
|
512
|
+
}
|
|
513
|
+
} else {
|
|
514
|
+
for (const packageName of packagesToCheck) {
|
|
515
|
+
const globalPackagePath = isWindows ? join3(npmPrefix, "node_modules", packageName) : join3(npmPrefix, "lib", "node_modules", packageName);
|
|
516
|
+
try {
|
|
517
|
+
await fs.stat(globalPackagePath);
|
|
518
|
+
installations.push({
|
|
519
|
+
type: "npm-global-orphan",
|
|
520
|
+
path: globalPackagePath
|
|
521
|
+
});
|
|
522
|
+
} catch {}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
const nativeBinPath = join3(homedir(), ".local", "bin", "claude");
|
|
527
|
+
try {
|
|
528
|
+
await fs.stat(nativeBinPath);
|
|
529
|
+
installations.push({ type: "native", path: nativeBinPath });
|
|
530
|
+
} catch {}
|
|
531
|
+
const config = getGlobalConfig();
|
|
532
|
+
if (config.installMethod === "native") {
|
|
533
|
+
const nativeDataPath = join3(homedir(), ".local", "share", "claude");
|
|
534
|
+
try {
|
|
535
|
+
await fs.stat(nativeDataPath);
|
|
536
|
+
if (!installations.some((i) => i.type === "native")) {
|
|
537
|
+
installations.push({ type: "native", path: nativeDataPath });
|
|
538
|
+
}
|
|
539
|
+
} catch {}
|
|
540
|
+
}
|
|
541
|
+
return installations;
|
|
542
|
+
}
|
|
543
|
+
async function detectConfigurationIssues(type) {
|
|
544
|
+
const warnings = [];
|
|
545
|
+
try {
|
|
546
|
+
const raw = await readFile3(join3(getManagedFilePath(), "managed-settings.json"), "utf-8");
|
|
547
|
+
const parsed = jsonParse(raw);
|
|
548
|
+
const field = parsed && typeof parsed === "object" ? parsed.strictPluginOnlyCustomization : undefined;
|
|
549
|
+
if (field !== undefined && typeof field !== "boolean") {
|
|
550
|
+
if (!Array.isArray(field)) {
|
|
551
|
+
warnings.push({
|
|
552
|
+
issue: `managed-settings.json: strictPluginOnlyCustomization has an invalid value (expected true or an array, got ${typeof field})`,
|
|
553
|
+
fix: `The field is silently ignored (schema .catch rescues it). Set it to true, or an array of: ${CUSTOMIZATION_SURFACES.join(", ")}.`
|
|
554
|
+
});
|
|
555
|
+
} else {
|
|
556
|
+
const unknown = field.filter((x) => typeof x === "string" && !CUSTOMIZATION_SURFACES.includes(x));
|
|
557
|
+
if (unknown.length > 0) {
|
|
558
|
+
warnings.push({
|
|
559
|
+
issue: `managed-settings.json: strictPluginOnlyCustomization has ${unknown.length} value(s) this client doesn't recognize: ${unknown.map(String).join(", ")}`,
|
|
560
|
+
fix: `These are silently ignored (forwards-compat). Known surfaces for this version: ${CUSTOMIZATION_SURFACES.join(", ")}. Either remove them, or this client is older than the managed-settings intended.`
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
} catch {}
|
|
566
|
+
const config = getGlobalConfig();
|
|
567
|
+
if (type === "development") {
|
|
568
|
+
return warnings;
|
|
569
|
+
}
|
|
570
|
+
if (type === "native") {
|
|
571
|
+
const path = process.env.PATH || "";
|
|
572
|
+
const pathDirectories = path.split(delimiter);
|
|
573
|
+
const homeDir = homedir();
|
|
574
|
+
const localBinPath = join3(homeDir, ".local", "bin");
|
|
575
|
+
let normalizedLocalBinPath = localBinPath;
|
|
576
|
+
if (getPlatform() === "windows") {
|
|
577
|
+
normalizedLocalBinPath = localBinPath.split(win32.sep).join(posix.sep);
|
|
578
|
+
}
|
|
579
|
+
const localBinInPath = pathDirectories.some((dir) => {
|
|
580
|
+
let normalizedDir = dir;
|
|
581
|
+
if (getPlatform() === "windows") {
|
|
582
|
+
normalizedDir = dir.split(win32.sep).join(posix.sep);
|
|
583
|
+
}
|
|
584
|
+
const trimmedDir = normalizedDir.replace(/\/+$/, "");
|
|
585
|
+
const trimmedRawDir = dir.replace(/[/\\]+$/, "");
|
|
586
|
+
return trimmedDir === normalizedLocalBinPath || trimmedRawDir === "~/.local/bin" || trimmedRawDir === "$HOME/.local/bin";
|
|
587
|
+
});
|
|
588
|
+
if (!localBinInPath) {
|
|
589
|
+
const isWindows = getPlatform() === "windows";
|
|
590
|
+
if (isWindows) {
|
|
591
|
+
const windowsLocalBinPath = localBinPath.split(posix.sep).join(win32.sep);
|
|
592
|
+
warnings.push({
|
|
593
|
+
issue: `Native installation exists but ${windowsLocalBinPath} is not in your PATH`,
|
|
594
|
+
fix: `Add it by opening: System Properties \u2192 Environment Variables \u2192 Edit User PATH \u2192 New \u2192 Add the path above. Then restart your terminal.`
|
|
595
|
+
});
|
|
596
|
+
} else {
|
|
597
|
+
const shellType = getShellType();
|
|
598
|
+
const configPaths = getShellConfigPaths();
|
|
599
|
+
const configFile = configPaths[shellType];
|
|
600
|
+
const displayPath = configFile ? configFile.replace(homedir(), "~") : "your shell config file";
|
|
601
|
+
warnings.push({
|
|
602
|
+
issue: "Native installation exists but ~/.local/bin is not in your PATH",
|
|
603
|
+
fix: `Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ${displayPath} then open a new terminal or run: source ${displayPath}`
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
if (!isEnvTruthy(process.env.DISABLE_INSTALLATION_CHECKS)) {
|
|
609
|
+
if (type === "npm-local" && config.installMethod !== "local") {
|
|
610
|
+
warnings.push({
|
|
611
|
+
issue: `Running from local installation but config install method is '${config.installMethod}'`,
|
|
612
|
+
fix: "Consider using native installation: claude install"
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
if (type === "native" && config.installMethod !== "native") {
|
|
616
|
+
warnings.push({
|
|
617
|
+
issue: `Running native installation but config install method is '${config.installMethod}'`,
|
|
618
|
+
fix: "Run claude install to update configuration"
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
if (type === "npm-global" && await localInstallationExists()) {
|
|
623
|
+
warnings.push({
|
|
624
|
+
issue: "Local installation exists but not being used",
|
|
625
|
+
fix: "Consider using native installation: claude install"
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
const existingAlias = await findClaudeAlias();
|
|
629
|
+
const validAlias = await findValidClaudeAlias();
|
|
630
|
+
if (type === "npm-local") {
|
|
631
|
+
const whichResult = await which("claude");
|
|
632
|
+
const claudeInPath = !!whichResult;
|
|
633
|
+
if (!claudeInPath && !validAlias) {
|
|
634
|
+
if (existingAlias) {
|
|
635
|
+
warnings.push({
|
|
636
|
+
issue: "Local installation not accessible",
|
|
637
|
+
fix: `Alias exists but points to invalid target: ${existingAlias}. Update alias: alias claude="~/.claude/local/claude"`
|
|
638
|
+
});
|
|
639
|
+
} else {
|
|
640
|
+
warnings.push({
|
|
641
|
+
issue: "Local installation not accessible",
|
|
642
|
+
fix: 'Create alias: alias claude="~/.claude/local/claude"'
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
return warnings;
|
|
648
|
+
}
|
|
649
|
+
function detectLinuxGlobPatternWarnings() {
|
|
650
|
+
if (getPlatform() !== "linux") {
|
|
651
|
+
return [];
|
|
652
|
+
}
|
|
653
|
+
const warnings = [];
|
|
654
|
+
const globPatterns = SandboxManager.getLinuxGlobPatternWarnings();
|
|
655
|
+
if (globPatterns.length > 0) {
|
|
656
|
+
const displayPatterns = globPatterns.slice(0, 3).join(", ");
|
|
657
|
+
const remaining = globPatterns.length - 3;
|
|
658
|
+
const patternList = remaining > 0 ? `${displayPatterns} (${remaining} more)` : displayPatterns;
|
|
659
|
+
warnings.push({
|
|
660
|
+
issue: `Glob patterns in sandbox permission rules are not fully supported on Linux`,
|
|
661
|
+
fix: `Found ${globPatterns.length} pattern(s): ${patternList}. On Linux, glob patterns in Edit/Read rules will be ignored.`
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
return warnings;
|
|
665
|
+
}
|
|
666
|
+
async function getDoctorDiagnostic() {
|
|
667
|
+
const installationType = await getCurrentInstallationType();
|
|
668
|
+
const version = typeof MACRO !== "undefined" ? "2.1.888" : "unknown";
|
|
669
|
+
const installationPath = await getInstallationPath();
|
|
670
|
+
const invokedBinary = getInvokedBinary();
|
|
671
|
+
const multipleInstallations = await detectMultipleInstallations();
|
|
672
|
+
const warnings = await detectConfigurationIssues(installationType);
|
|
673
|
+
warnings.push(...detectLinuxGlobPatternWarnings());
|
|
674
|
+
if (installationType === "native") {
|
|
675
|
+
const npmInstalls = multipleInstallations.filter((i) => i.type === "npm-global" || i.type === "npm-global-orphan" || i.type === "npm-local");
|
|
676
|
+
const isWindows = getPlatform() === "windows";
|
|
677
|
+
for (const install of npmInstalls) {
|
|
678
|
+
if (install.type === "npm-global") {
|
|
679
|
+
let uninstallCmd = "npm -g uninstall @anthropic-ai/claude-code";
|
|
680
|
+
if ("") {}
|
|
681
|
+
warnings.push({
|
|
682
|
+
issue: `Leftover npm global installation at ${install.path}`,
|
|
683
|
+
fix: `Run: ${uninstallCmd}`
|
|
684
|
+
});
|
|
685
|
+
} else if (install.type === "npm-global-orphan") {
|
|
686
|
+
warnings.push({
|
|
687
|
+
issue: `Orphaned npm global package at ${install.path}`,
|
|
688
|
+
fix: isWindows ? `Run: rmdir /s /q "${install.path}"` : `Run: rm -rf ${install.path}`
|
|
689
|
+
});
|
|
690
|
+
} else if (install.type === "npm-local") {
|
|
691
|
+
warnings.push({
|
|
692
|
+
issue: `Leftover npm local installation at ${install.path}`,
|
|
693
|
+
fix: isWindows ? `Run: rmdir /s /q "${install.path}"` : `Run: rm -rf ${install.path}`
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
const config = getGlobalConfig();
|
|
699
|
+
const configInstallMethod = config.installMethod || "not set";
|
|
700
|
+
let hasUpdatePermissions = null;
|
|
701
|
+
if (installationType === "npm-global") {
|
|
702
|
+
const permCheck = await checkGlobalInstallPermissions();
|
|
703
|
+
hasUpdatePermissions = permCheck.hasPermissions;
|
|
704
|
+
if (!hasUpdatePermissions && !getAutoUpdaterDisabledReason()) {
|
|
705
|
+
warnings.push({
|
|
706
|
+
issue: "Insufficient permissions for auto-updates",
|
|
707
|
+
fix: "Do one of: (1) Re-install node without sudo, or (2) Use `claude install` for native installation"
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
const ripgrepStatusRaw = getRipgrepStatus();
|
|
712
|
+
const ripgrepStatus = {
|
|
713
|
+
working: ripgrepStatusRaw.working ?? true,
|
|
714
|
+
mode: ripgrepStatusRaw.mode,
|
|
715
|
+
systemPath: ripgrepStatusRaw.mode === "system" ? ripgrepStatusRaw.path : null
|
|
716
|
+
};
|
|
717
|
+
const packageManager = installationType === "package-manager" ? await getPackageManager() : undefined;
|
|
718
|
+
const diagnostic = {
|
|
719
|
+
installationType,
|
|
720
|
+
version,
|
|
721
|
+
installationPath,
|
|
722
|
+
invokedBinary,
|
|
723
|
+
configInstallMethod,
|
|
724
|
+
autoUpdates: (() => {
|
|
725
|
+
const reason = getAutoUpdaterDisabledReason();
|
|
726
|
+
return reason ? `disabled (${formatAutoUpdaterDisabledReason(reason)})` : "enabled";
|
|
727
|
+
})(),
|
|
728
|
+
hasUpdatePermissions,
|
|
729
|
+
multipleInstallations,
|
|
730
|
+
warnings,
|
|
731
|
+
packageManager,
|
|
732
|
+
ripgrepStatus
|
|
733
|
+
};
|
|
734
|
+
return diagnostic;
|
|
735
|
+
}
|
|
736
|
+
var checkGlobalInstallPermissions = async () => ({ allowed: false, reason: "autoUpdater removed" });
|
|
737
|
+
var init_doctorDiagnostic = __esm(() => {
|
|
738
|
+
init_execa();
|
|
739
|
+
init_bundledMode();
|
|
740
|
+
init_config();
|
|
741
|
+
init_cwd();
|
|
742
|
+
init_envUtils();
|
|
743
|
+
init_execFileNoThrow();
|
|
744
|
+
init_fsOperations();
|
|
745
|
+
init_localInstaller();
|
|
746
|
+
init_packageManagers();
|
|
747
|
+
init_platform();
|
|
748
|
+
init_ripgrep();
|
|
749
|
+
init_sandbox_adapter();
|
|
750
|
+
init_managedPath();
|
|
751
|
+
init_types();
|
|
752
|
+
init_shellConfig();
|
|
753
|
+
init_slowOperations();
|
|
754
|
+
init_which();
|
|
755
|
+
});
|
|
756
|
+
|
|
757
|
+
// src/utils/nativeInstaller/pidLock.ts
|
|
758
|
+
import { basename, join as join4 } from "path";
|
|
759
|
+
function isPidBasedLockingEnabled() {
|
|
760
|
+
const envVar = process.env.ENABLE_PID_BASED_VERSION_LOCKING;
|
|
761
|
+
if (isEnvTruthy(envVar)) {
|
|
762
|
+
return true;
|
|
763
|
+
}
|
|
764
|
+
if (isEnvDefinedFalsy(envVar)) {
|
|
765
|
+
return false;
|
|
766
|
+
}
|
|
767
|
+
return getFeatureValue_CACHED_MAY_BE_STALE("tengu_pid_based_version_locking", false);
|
|
768
|
+
}
|
|
769
|
+
function isProcessRunning(pid) {
|
|
770
|
+
if (pid <= 1) {
|
|
771
|
+
return false;
|
|
772
|
+
}
|
|
773
|
+
try {
|
|
774
|
+
process.kill(pid, 0);
|
|
775
|
+
return true;
|
|
776
|
+
} catch {
|
|
777
|
+
return false;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
function isClaudeProcess(pid, expectedExecPath) {
|
|
781
|
+
if (!isProcessRunning(pid)) {
|
|
782
|
+
return false;
|
|
783
|
+
}
|
|
784
|
+
if (pid === process.pid) {
|
|
785
|
+
return true;
|
|
786
|
+
}
|
|
787
|
+
try {
|
|
788
|
+
const command = getProcessCommand(pid);
|
|
789
|
+
if (!command) {
|
|
790
|
+
return true;
|
|
791
|
+
}
|
|
792
|
+
const normalizedCommand = command.toLowerCase();
|
|
793
|
+
const normalizedExecPath = expectedExecPath.toLowerCase();
|
|
794
|
+
return normalizedCommand.includes("claude") || normalizedCommand.includes(normalizedExecPath);
|
|
795
|
+
} catch {
|
|
796
|
+
return true;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
function readLockContent(lockFilePath) {
|
|
800
|
+
const fs = getFsImplementation();
|
|
801
|
+
try {
|
|
802
|
+
const content = fs.readFileSync(lockFilePath, { encoding: "utf8" });
|
|
803
|
+
if (!content || content.trim() === "") {
|
|
804
|
+
return null;
|
|
805
|
+
}
|
|
806
|
+
const parsed = jsonParse(content);
|
|
807
|
+
if (typeof parsed.pid !== "number" || !parsed.version || !parsed.execPath) {
|
|
808
|
+
return null;
|
|
809
|
+
}
|
|
810
|
+
return parsed;
|
|
811
|
+
} catch {
|
|
812
|
+
return null;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
function isLockActive(lockFilePath) {
|
|
816
|
+
const content = readLockContent(lockFilePath);
|
|
817
|
+
if (!content) {
|
|
818
|
+
return false;
|
|
819
|
+
}
|
|
820
|
+
const { pid, execPath } = content;
|
|
821
|
+
if (!isProcessRunning(pid)) {
|
|
822
|
+
return false;
|
|
823
|
+
}
|
|
824
|
+
if (!isClaudeProcess(pid, execPath)) {
|
|
825
|
+
logForDebugging(`Lock PID ${pid} is running but does not appear to be Claude - treating as stale`);
|
|
826
|
+
return false;
|
|
827
|
+
}
|
|
828
|
+
const fs = getFsImplementation();
|
|
829
|
+
try {
|
|
830
|
+
const stats = fs.statSync(lockFilePath);
|
|
831
|
+
const age = Date.now() - stats.mtimeMs;
|
|
832
|
+
if (age > FALLBACK_STALE_MS) {
|
|
833
|
+
if (!isProcessRunning(pid)) {
|
|
834
|
+
return false;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
} catch {}
|
|
838
|
+
return true;
|
|
839
|
+
}
|
|
840
|
+
function writeLockFile(lockFilePath, content) {
|
|
841
|
+
const fs = getFsImplementation();
|
|
842
|
+
const tempPath = `${lockFilePath}.tmp.${process.pid}.${Date.now()}`;
|
|
843
|
+
try {
|
|
844
|
+
writeFileSync_DEPRECATED(tempPath, jsonStringify(content, null, 2), {
|
|
845
|
+
encoding: "utf8",
|
|
846
|
+
flush: true
|
|
847
|
+
});
|
|
848
|
+
fs.renameSync(tempPath, lockFilePath);
|
|
849
|
+
} catch (error) {
|
|
850
|
+
try {
|
|
851
|
+
fs.unlinkSync(tempPath);
|
|
852
|
+
} catch {}
|
|
853
|
+
throw error;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
async function tryAcquireLock(versionPath, lockFilePath) {
|
|
857
|
+
const fs = getFsImplementation();
|
|
858
|
+
const versionName = basename(versionPath);
|
|
859
|
+
if (isLockActive(lockFilePath)) {
|
|
860
|
+
const existingContent = readLockContent(lockFilePath);
|
|
861
|
+
logForDebugging(`Cannot acquire lock for ${versionName} - held by PID ${existingContent?.pid}`);
|
|
862
|
+
return null;
|
|
863
|
+
}
|
|
864
|
+
const lockContent = {
|
|
865
|
+
pid: process.pid,
|
|
866
|
+
version: versionName,
|
|
867
|
+
execPath: process.execPath,
|
|
868
|
+
acquiredAt: Date.now()
|
|
869
|
+
};
|
|
870
|
+
try {
|
|
871
|
+
writeLockFile(lockFilePath, lockContent);
|
|
872
|
+
const verifyContent = readLockContent(lockFilePath);
|
|
873
|
+
if (verifyContent?.pid !== process.pid) {
|
|
874
|
+
return null;
|
|
875
|
+
}
|
|
876
|
+
logForDebugging(`Acquired PID lock for ${versionName} (PID ${process.pid})`);
|
|
877
|
+
return () => {
|
|
878
|
+
try {
|
|
879
|
+
const currentContent = readLockContent(lockFilePath);
|
|
880
|
+
if (currentContent?.pid === process.pid) {
|
|
881
|
+
fs.unlinkSync(lockFilePath);
|
|
882
|
+
logForDebugging(`Released PID lock for ${versionName}`);
|
|
883
|
+
}
|
|
884
|
+
} catch (error) {
|
|
885
|
+
logForDebugging(`Failed to release lock for ${versionName}: ${error}`);
|
|
886
|
+
}
|
|
887
|
+
};
|
|
888
|
+
} catch (error) {
|
|
889
|
+
logForDebugging(`Failed to acquire lock for ${versionName}: ${error}`);
|
|
890
|
+
return null;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
async function acquireProcessLifetimeLock(versionPath, lockFilePath) {
|
|
894
|
+
const release = await tryAcquireLock(versionPath, lockFilePath);
|
|
895
|
+
if (!release) {
|
|
896
|
+
return false;
|
|
897
|
+
}
|
|
898
|
+
const cleanup = () => {
|
|
899
|
+
try {
|
|
900
|
+
release();
|
|
901
|
+
} catch {}
|
|
902
|
+
};
|
|
903
|
+
process.on("exit", cleanup);
|
|
904
|
+
process.on("SIGINT", cleanup);
|
|
905
|
+
process.on("SIGTERM", cleanup);
|
|
906
|
+
return true;
|
|
907
|
+
}
|
|
908
|
+
async function withLock(versionPath, lockFilePath, callback) {
|
|
909
|
+
const release = await tryAcquireLock(versionPath, lockFilePath);
|
|
910
|
+
if (!release) {
|
|
911
|
+
return false;
|
|
912
|
+
}
|
|
913
|
+
try {
|
|
914
|
+
await callback();
|
|
915
|
+
return true;
|
|
916
|
+
} finally {
|
|
917
|
+
release();
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
function getAllLockInfo(locksDir) {
|
|
921
|
+
const fs = getFsImplementation();
|
|
922
|
+
const lockInfos = [];
|
|
923
|
+
try {
|
|
924
|
+
const lockFiles = fs.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock"));
|
|
925
|
+
for (const lockFile of lockFiles) {
|
|
926
|
+
const lockFilePath = join4(locksDir, lockFile);
|
|
927
|
+
const content = readLockContent(lockFilePath);
|
|
928
|
+
if (content) {
|
|
929
|
+
lockInfos.push({
|
|
930
|
+
version: content.version,
|
|
931
|
+
pid: content.pid,
|
|
932
|
+
isProcessRunning: isProcessRunning(content.pid),
|
|
933
|
+
execPath: content.execPath,
|
|
934
|
+
acquiredAt: new Date(content.acquiredAt),
|
|
935
|
+
lockFilePath
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
} catch (error) {
|
|
940
|
+
if (isENOENT(error)) {
|
|
941
|
+
return lockInfos;
|
|
942
|
+
}
|
|
943
|
+
logError(toError(error));
|
|
944
|
+
}
|
|
945
|
+
return lockInfos;
|
|
946
|
+
}
|
|
947
|
+
function cleanupStaleLocks(locksDir) {
|
|
948
|
+
const fs = getFsImplementation();
|
|
949
|
+
let cleanedCount = 0;
|
|
950
|
+
try {
|
|
951
|
+
const lockEntries = fs.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock"));
|
|
952
|
+
for (const lockEntry of lockEntries) {
|
|
953
|
+
const lockFilePath = join4(locksDir, lockEntry);
|
|
954
|
+
try {
|
|
955
|
+
const stats = fs.lstatSync(lockFilePath);
|
|
956
|
+
if (stats.isDirectory()) {
|
|
957
|
+
fs.rmSync(lockFilePath, { recursive: true, force: true });
|
|
958
|
+
cleanedCount++;
|
|
959
|
+
logForDebugging(`Cleaned up legacy directory lock: ${lockEntry}`);
|
|
960
|
+
} else if (!isLockActive(lockFilePath)) {
|
|
961
|
+
fs.unlinkSync(lockFilePath);
|
|
962
|
+
cleanedCount++;
|
|
963
|
+
logForDebugging(`Cleaned up stale lock: ${lockEntry}`);
|
|
964
|
+
}
|
|
965
|
+
} catch {}
|
|
966
|
+
}
|
|
967
|
+
} catch (error) {
|
|
968
|
+
if (isENOENT(error)) {
|
|
969
|
+
return 0;
|
|
970
|
+
}
|
|
971
|
+
logError(toError(error));
|
|
972
|
+
}
|
|
973
|
+
return cleanedCount;
|
|
974
|
+
}
|
|
975
|
+
var FALLBACK_STALE_MS;
|
|
976
|
+
var init_pidLock = __esm(() => {
|
|
977
|
+
init_growthbook();
|
|
978
|
+
init_debug();
|
|
979
|
+
init_envUtils();
|
|
980
|
+
init_errors();
|
|
981
|
+
init_fsOperations();
|
|
982
|
+
init_genericProcessUtils();
|
|
983
|
+
init_log();
|
|
984
|
+
init_slowOperations();
|
|
985
|
+
FALLBACK_STALE_MS = 2 * 60 * 60 * 1000;
|
|
986
|
+
});
|
|
987
|
+
|
|
988
|
+
export { getShellType, init_localInstaller, getShellConfigPaths, filterClaudeAliases, readFileLines, writeFileLines, init_shellConfig, getCurrentInstallationType, getDoctorDiagnostic, init_doctorDiagnostic, isPidBasedLockingEnabled, readLockContent, isLockActive, acquireProcessLifetimeLock, withLock, getAllLockInfo, cleanupStaleLocks, init_pidLock };
|