@bkm016/basalt 0.1.13 → 0.1.14
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 +3 -2
- package/{chunk-bng72094.js → chunk-03wzwnn6.js} +1 -1
- package/{chunk-9e8vhzy7.js → chunk-0crbhhna.js} +1 -1
- package/{chunk-h9zxqeqr.js → chunk-0rasqm8y.js} +2 -2
- package/{chunk-0x9netvr.js → chunk-1w4nh5t6.js} +1 -1
- package/{chunk-dk6fgprw.js → chunk-2eaehpp6.js} +1 -1
- package/{chunk-6sea12mw.js → chunk-30dxcr91.js} +1 -1
- package/{chunk-2zbj8ny6.js → chunk-343jsm46.js} +2 -2
- package/chunk-38g4jd6v.js +5 -0
- package/{chunk-zx75vnw8.js → chunk-39mh7h58.js} +22 -22
- package/chunk-44b9yx79.js +2 -0
- package/{chunk-r1jn77q6.js → chunk-4f6p4n7k.js} +2 -2
- package/{chunk-sgz87ht5.js → chunk-4w8j6n7z.js} +1 -1
- package/{chunk-szj85dqe.js → chunk-4yxd2kg1.js} +2 -2
- package/{chunk-bp61xdsc.js → chunk-59hg9a84.js} +1 -1
- package/{chunk-bq54argx.js → chunk-62ebm0bn.js} +1 -1
- package/{chunk-6d9r9p91.js → chunk-6ef085c1.js} +4 -4
- package/{chunk-zk91579b.js → chunk-6hx9y86d.js} +2 -2
- package/chunk-73t051r6.js +2 -0
- package/{chunk-pryvvs96.js → chunk-7mgkpn94.js} +22 -22
- package/{chunk-2q56egb8.js → chunk-81x8r8w4.js} +1 -1
- package/{chunk-rn3jwyh1.js → chunk-8np9b2y8.js} +2 -2
- package/{chunk-1q6e3mj7.js → chunk-9ew8cap5.js} +2 -2
- package/chunk-9v3b7jjv.js +2 -0
- package/{chunk-tjg0gcks.js → chunk-9vam83py.js} +1 -1
- package/{chunk-ct77cdg7.js → chunk-9xjecw6c.js} +1 -1
- package/{chunk-8cgz8xv7.js → chunk-b2wpj81x.js} +2 -2
- package/{chunk-302n9g7p.js → chunk-bjvv3403.js} +1 -1
- package/{chunk-tfhze1vq.js → chunk-c8g9jjqs.js} +2 -2
- package/{chunk-0a7ft50x.js → chunk-cs91rmbf.js} +8 -8
- package/{chunk-gpnqmtbk.js → chunk-edcf97ka.js} +1 -1
- package/{chunk-74wwdx3y.js → chunk-en7z6ne5.js} +2 -2
- package/{chunk-f0h2bv11.js → chunk-evnqkyt7.js} +10 -10
- package/{chunk-4rnmxtpx.js → chunk-ge38dhv9.js} +2 -2
- package/chunk-hggam3je.js +2 -0
- package/{chunk-mf04h0yy.js → chunk-k38jaz6c.js} +4 -4
- package/{chunk-jjtt9aq8.js → chunk-kcn05erf.js} +3 -3
- package/{chunk-y23dpz5e.js → chunk-m5km74eq.js} +2 -2
- package/{chunk-095adzn5.js → chunk-mfb3dgs8.js} +2 -2
- package/{chunk-0nedq669.js → chunk-mh4bjtfs.js} +3 -3
- package/{chunk-yy1f9jxc.js → chunk-nysatg77.js} +429 -312
- package/{chunk-bja7p3em.js → chunk-p886jr17.js} +13 -13
- package/{chunk-xvm0y99b.js → chunk-pdt65s31.js} +2 -2
- package/{chunk-ymg7mtcx.js → chunk-pjgt1bdx.js} +2 -2
- package/{chunk-959z9efn.js → chunk-pyj6avd5.js} +2 -2
- package/chunk-qd2enpr2.js +3 -0
- package/{chunk-tnj2kqb8.js → chunk-qe76naq9.js} +1 -1
- package/{chunk-z0c8ek0j.js → chunk-qjnx4fsn.js} +2 -2
- package/{chunk-2tf7qfbx.js → chunk-qs161f2q.js} +2 -2
- package/{chunk-nbjnwd54.js → chunk-rghqprav.js} +1 -1
- package/{chunk-7chv3knf.js → chunk-t33bm5aa.js} +1 -1
- package/chunk-vd5332ps.js +2 -0
- package/{chunk-22az84sh.js → chunk-w55cnj0f.js} +2 -2
- package/{chunk-4k9t9jvx.js → chunk-wnd3y4c0.js} +1 -1
- package/{chunk-snz19yc2.js → chunk-xafx1p7z.js} +2 -2
- package/{chunk-15ve3nmv.js → chunk-xf7zw32f.js} +12 -12
- package/chunk-xk3t5ves.js +482 -0
- package/{chunk-kbpbrr11.js → chunk-xq74x4gc.js} +2 -2
- package/{chunk-mdkfm1ak.js → chunk-y0274xr2.js} +3 -3
- package/{chunk-y4pvhes1.js → chunk-z9p6s986.js} +6 -6
- package/{chunk-41das1ty.js → chunk-zcwz44db.js} +1 -1
- package/{chunk-77c2cqp2.js → chunk-zhyzhekt.js} +1 -1
- package/compiled.js +12 -12
- package/package.json +1 -1
- package/ui-test-worker.js +51 -51
- package/web/chunk-15g9pnzy.js +1 -0
- package/web/{chunk-16jc5m0f.js → chunk-17wwzrp4.js} +1 -1
- package/web/chunk-19tkjg9w.js +1 -0
- package/web/chunk-1y387f45.js +1 -0
- package/web/{chunk-mykrm8ba.js → chunk-25sn840r.js} +2 -2
- package/web/chunk-26sp6jre.js +1 -0
- package/web/{chunk-wpxtkxjt.js → chunk-2c7kxr4v.js} +2 -2
- package/web/{chunk-et1rsgmp.js → chunk-2gsf89vs.js} +2 -2
- package/web/{chunk-jpem3qvs.js → chunk-2gvz70wr.js} +5 -5
- package/web/chunk-2s3my1jn.js +1 -0
- package/web/{chunk-yn4t5s9r.js → chunk-32dh0hft.js} +1 -1
- package/web/{chunk-5cwxhhae.js → chunk-3haw3wcw.js} +2 -2
- package/web/{chunk-t82sngk9.js → chunk-3rxhs9qm.js} +7 -7
- package/web/chunk-410qdvmv.js +1 -0
- package/web/chunk-4qehf2xx.js +2 -0
- package/web/{chunk-b9jry5a3.js → chunk-51b8n5e1.js} +1 -1
- package/web/{chunk-xe121vg7.js → chunk-54mgncq3.js} +1 -1
- package/web/{chunk-ze6azq7z.js → chunk-59g6rrew.js} +4 -4
- package/web/{chunk-h6k1x096.js → chunk-5d9veaef.js} +2 -2
- package/web/chunk-6481wt3t.js +1 -0
- package/web/chunk-6ehecat3.js +1 -0
- package/web/chunk-6m8hq6ph.js +1 -0
- package/web/chunk-73941p08.js +1 -0
- package/web/{chunk-0jbf73pr.js → chunk-783s8jds.js} +3 -3
- package/web/{chunk-qbmtah1x.js → chunk-78m018ya.js} +1 -1
- package/web/{chunk-3p9w8sg5.js → chunk-797bh7z6.js} +3 -3
- package/web/{chunk-1xm9x7d6.js → chunk-7hpqrfgg.js} +2 -2
- package/web/{chunk-zxrbbbtp.js → chunk-7kywe73f.js} +2 -2
- package/web/chunk-7qq1ypvj.js +1 -0
- package/web/{chunk-awkdw9rw.js → chunk-7wzszsf5.js} +2 -2
- package/web/{chunk-c57f714b.js → chunk-7zfqppsx.js} +2 -2
- package/web/{chunk-jh33m2mq.js → chunk-8sr9w61v.js} +3 -3
- package/web/{chunk-4py9sndw.js → chunk-8ttp8fh3.js} +6 -6
- package/web/chunk-8zg89764.js +1 -0
- package/web/{chunk-ct7z7bea.js → chunk-988e9wx6.js} +3 -3
- package/web/{chunk-vk7ch6fh.js → chunk-9h0f3gar.js} +2 -2
- package/web/{chunk-p6e2vr51.js → chunk-9vr6hpmk.js} +6 -6
- package/web/chunk-9vrp249f.js +2 -0
- package/web/{chunk-eqxy6535.js → chunk-a205cj09.js} +2 -2
- package/web/{chunk-980zhtht.js → chunk-ahn2frbt.js} +1 -1
- package/web/{chunk-xvm66b7v.js → chunk-aknsydan.js} +4 -4
- package/web/chunk-at0xtfhy.js +1 -0
- package/web/chunk-bahccwb9.js +1 -0
- package/web/{chunk-w4tfad6c.js → chunk-c7fqrs8j.js} +1 -1
- package/web/{chunk-zqcg6frm.js → chunk-d3hyf9yd.js} +1 -1
- package/web/chunk-dcegr80c.js +1 -0
- package/web/{chunk-v4cqc9f9.js → chunk-dwtatme7.js} +1 -1
- package/web/{chunk-cr04125j.js → chunk-ex8rmqn1.js} +12 -12
- package/web/{chunk-jh3k7xex.js → chunk-faskbfjf.js} +3 -3
- package/web/{chunk-zb61mf0a.js → chunk-feanedhx.js} +1 -1
- package/web/{chunk-xk1vkcj4.js → chunk-ffywf5w5.js} +4 -4
- package/web/chunk-fx3d48e6.js +1 -0
- package/web/{chunk-3jjksgze.js → chunk-g3szt4c4.js} +1 -1
- package/web/chunk-g7bcntpm.js +1 -0
- package/web/chunk-gr1tjqbd.js +1 -0
- package/web/{chunk-2sef2wft.js → chunk-hbwxtbq3.js} +2 -2
- package/web/{chunk-6e87m0nm.js → chunk-hdtvrh0f.js} +2 -2
- package/web/chunk-j031r08w.js +1 -0
- package/web/{chunk-5ym5ffd5.js → chunk-j6wcszxq.js} +2 -2
- package/web/{chunk-jccz14ye.js → chunk-jdx7qp2w.js} +2 -2
- package/web/chunk-jge7nn3s.js +1 -0
- package/web/chunk-jy8zat04.js +1 -0
- package/web/{chunk-0rhx7qb8.js → chunk-jzge034r.js} +1 -1
- package/web/{chunk-qq6m2my8.js → chunk-k4qrqmdk.js} +2 -2
- package/web/chunk-k8s7kye3.js +1 -0
- package/web/{chunk-ke8dffnk.js → chunk-k9fyqrhp.js} +2 -2
- package/web/chunk-k9zn1n6d.js +1 -0
- package/web/chunk-kg3tksv7.js +1 -0
- package/web/chunk-kk5rw81s.js +2 -0
- package/web/{chunk-y9waq403.js → chunk-kpmd893m.js} +2 -2
- package/web/chunk-md9j949p.js +1 -0
- package/web/{chunk-e57h40qa.js → chunk-mn2wv9ye.js} +2 -2
- package/web/{chunk-14vmr99v.js → chunk-mv7jgmnb.js} +3 -3
- package/web/{chunk-qq06x2ce.js → chunk-mvm68qtt.js} +2 -2
- package/web/chunk-nbcpbqq4.js +1 -0
- package/web/{chunk-6rsr2cyw.js → chunk-nfpff7yf.js} +8 -8
- package/web/chunk-nk7jkpam.js +1 -0
- package/web/chunk-nmvt1rn3.js +1 -0
- package/web/{chunk-3ctmehg4.js → chunk-npw1s1h2.js} +1 -1
- package/web/chunk-nzzxv84v.js +8 -0
- package/web/{chunk-a9er7a7c.js → chunk-p4pqtybm.js} +19 -19
- package/web/{chunk-ba9qy65y.js → chunk-p79c7aak.js} +1 -1
- package/web/{chunk-frnh4zqf.js → chunk-pafw34vg.js} +2 -2
- package/web/{chunk-ct90yf8z.js → chunk-pf65cank.js} +2 -2
- package/web/{chunk-g0be12na.js → chunk-ppa21760.js} +1 -1
- package/web/{chunk-g7hqafb8.js → chunk-ptpkv0te.js} +1 -1
- package/web/{chunk-ddg8rz82.js → chunk-qcdej581.js} +1 -1
- package/web/{chunk-xxmaqj1m.js → chunk-qftcdcps.js} +2 -2
- package/web/{chunk-eqndhs21.js → chunk-qv1w36ja.js} +2 -2
- package/web/{chunk-mnf4ngj9.js → chunk-r8p741qj.js} +2 -2
- package/web/chunk-rcexbkjj.js +1 -0
- package/web/{chunk-w28dn4dw.js → chunk-rjakb64x.js} +1 -1
- package/web/{chunk-k0cg4n2k.js → chunk-s0xy00v5.js} +2 -2
- package/web/{chunk-cr05dttm.js → chunk-s2ps0ct5.js} +1 -1
- package/web/{chunk-xcyqd7cn.js → chunk-s45g7fp6.js} +1 -1
- package/web/{chunk-h1k2kqbs.js → chunk-s70aj1v5.js} +4 -4
- package/web/chunk-say8bvkc.js +1 -0
- package/web/{chunk-qh62nkem.js → chunk-sd3cdqcm.js} +2 -2
- package/web/{chunk-a6g3nqp0.js → chunk-sgkevxdf.js} +2 -2
- package/web/chunk-sjffrcq9.js +1 -0
- package/web/{chunk-2y1avvqj.js → chunk-snaepr87.js} +3 -3
- package/web/{chunk-p7pa02k9.js → chunk-tdzh6nsz.js} +2 -2
- package/web/{chunk-ga07tv37.js → chunk-tjd8qp87.js} +1 -1
- package/web/chunk-tncc9e57.js +1 -0
- package/web/{chunk-ve8gy05p.js → chunk-ty2rmwda.js} +92 -92
- package/web/chunk-v22hp18w.js +1 -0
- package/web/{chunk-zh7193nq.js → chunk-ve9dz857.js} +2 -2
- package/web/{chunk-s935z8er.js → chunk-vg346gxc.js} +2 -2
- package/web/{chunk-b4gcpsbg.js → chunk-vpegzgzb.js} +5 -5
- package/web/{chunk-pzg25qqe.js → chunk-vvvd3grf.js} +2 -2
- package/web/{chunk-ss96cz1f.js → chunk-vwv6pqy7.js} +1 -1
- package/web/{chunk-sq75q603.js → chunk-vxm7n7w6.js} +6 -6
- package/web/{chunk-qb8mbptk.js → chunk-w5q7978e.js} +1 -1
- package/web/{chunk-97t3ngqf.js → chunk-we4mhfmq.js} +7 -7
- package/web/{chunk-20jxvmbw.js → chunk-wfgrdabk.js} +1 -1
- package/web/{chunk-3wpxymxa.js → chunk-wkhj4hsw.js} +3 -3
- package/web/{chunk-q4vy3dkk.js → chunk-wspk8qbg.js} +2 -2
- package/web/{chunk-9wz8jne3.js → chunk-xf1hnpme.js} +1 -1
- package/web/{chunk-fnvgdvrg.js → chunk-xhqvzmfj.js} +4 -4
- package/web/chunk-xq70hgre.js +1 -0
- package/web/chunk-xtss82z2.js +1 -0
- package/web/{chunk-8j4tzff5.js → chunk-y3tb6410.js} +3 -3
- package/web/{chunk-mkxeenph.js → chunk-y6mcxfm0.js} +1 -1
- package/web/{chunk-0rvwj2wh.js → chunk-ya696bfe.js} +2 -2
- package/web/{chunk-2x7vmhm0.js → chunk-ysw5fs45.js} +3 -3
- package/web/{chunk-atppv8fk.js → chunk-zkq1xknc.js} +1 -1
- package/web/chunk-zkv025s5.js +1 -0
- package/web/{chunk-dmha2y9c.js → chunk-zpzvz973.js} +18 -18
- package/web/{chunk-c6m4vfn5.js → chunk-zsat72qd.js} +68 -68
- package/web/{chunk-9k7fkx80.js → chunk-zx3h7v72.js} +1 -1
- package/web/index.html +1 -1
- package/chunk-1dbfmejf.js +0 -2
- package/chunk-4w9zqv0k.js +0 -2
- package/chunk-6f4ht2hw.js +0 -2
- package/chunk-edbq461k.js +0 -5
- package/chunk-m71pj3g1.js +0 -2
- package/chunk-n22vd4at.js +0 -2
- package/chunk-sgrrxsnz.js +0 -482
- package/chunk-ydzag81d.js +0 -3
- package/web/chunk-12qf1r6m.js +0 -1
- package/web/chunk-1m6fx2h7.js +0 -2
- package/web/chunk-2n5xbnrt.js +0 -1
- package/web/chunk-36s08nye.js +0 -1
- package/web/chunk-4swea9sn.js +0 -1
- package/web/chunk-4zz5a483.js +0 -1
- package/web/chunk-6y55gk1n.js +0 -1
- package/web/chunk-7aep7k4v.js +0 -1
- package/web/chunk-8tgavnwx.js +0 -1
- package/web/chunk-a00vg115.js +0 -1
- package/web/chunk-a4gbxnm3.js +0 -1
- package/web/chunk-bq6mep6p.js +0 -2
- package/web/chunk-bwy3e58v.js +0 -1
- package/web/chunk-de29pe57.js +0 -1
- package/web/chunk-eeesa5q1.js +0 -1
- package/web/chunk-f7jpakwh.js +0 -1
- package/web/chunk-fp62avjh.js +0 -1
- package/web/chunk-gr163fex.js +0 -1
- package/web/chunk-gx340asc.js +0 -1
- package/web/chunk-gxtz10wf.js +0 -1
- package/web/chunk-k9qnvx86.js +0 -2
- package/web/chunk-kcnj0gan.js +0 -1
- package/web/chunk-kpp5xqsb.js +0 -1
- package/web/chunk-m33yted6.js +0 -1
- package/web/chunk-me5jqqn6.js +0 -1
- package/web/chunk-mzqqwbmr.js +0 -1
- package/web/chunk-mzzaet63.js +0 -1
- package/web/chunk-q34as3v6.js +0 -1
- package/web/chunk-q6c8p73w.js +0 -1
- package/web/chunk-qn93we3a.js +0 -1
- package/web/chunk-r1f1egve.js +0 -1
- package/web/chunk-tt9410zw.js +0 -8
- package/web/chunk-vg1ebkce.js +0 -1
- package/web/chunk-vnt34mkb.js +0 -1
- package/web/chunk-xh4xn1az.js +0 -1
- package/web/chunk-xrk5ewsn.js +0 -1
- package/web/chunk-xzwxcxb4.js +0 -1
- package/web/chunk-ydhnkws0.js +0 -1
- package/web/chunk-ys2tns0p.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{vr,It,Xt,Jt,Yt,Zt,_r,Ar,Mt,Er,Tr,Pr,kr,Rr,Cr}from"./chunk-39mh7h58.js";import{_}from"./chunk-ge38dhv9.js";import{oe}from"./chunk-pyj6avd5.js";import{X}from"./chunk-qs161f2q.js";import{w}from"./chunk-b516bp7n.js";import{V,J}from"./chunk-8np9b2y8.js";import{we}from"./chunk-tfhp09nj.js";import{W,ge,ae,Ue,Y,K}from"./chunk-z9p6s986.js";import{U}from"./chunk-4yxd2kg1.js";var T="v1",v="gcp-vertex-credentials",O=0,C=(e,o,t)=>{let i=new U,u=Ue(o);return(async()=>{let n={role:"assistant",content:[],api:"google-vertex",provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{if(t?.fetch&&t.fetch!==globalThis.fetch)throw Error("Custom fetch is not supported by the Google Vertex adapter");let c=L(t),g=c?I(e,c,t?.headers):R(e,M(t),P(t),t?.headers,t?.env),h=D(e,u,t),m=await t?.onPayload?.(h,e);if(m!==void 0)h=m;let p=await Cr(()=>g.models.generateContentStream(h),t);i.push({type:"start",partial:n});let r=null,f=n.content,l=()=>f.length-1;for await(let s of p){await t?.onProviderStreamEvent?.(s,e),n.responseId||=s.responseId;let k=s.candidates?.[0];if(k?.content?.parts)for(let a of k.content.parts){if(a.text!==void 0){let d=Ar(a);if(!r||d&&r.type!=="thinking"||!d&&r.type!=="text"){if(r)if(r.type==="text")i.push({type:"text_end",contentIndex:f.length-1,content:r.text,partial:n});else i.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:n});if(d)r={type:"thinking",thinking:"",thinkingSignature:void 0},n.content.push(r),i.push({type:"thinking_start",contentIndex:l(),partial:n});else r={type:"text",text:""},n.content.push(r),i.push({type:"text_start",contentIndex:l(),partial:n})}if(r.type==="thinking")r.thinking+=a.text,r.thinkingSignature=Mt(r.thinkingSignature,a.thoughtSignature),i.push({type:"thinking_delta",contentIndex:l(),delta:a.text,partial:n});else r.text+=a.text,r.textSignature=Mt(r.textSignature,a.thoughtSignature),i.push({type:"text_delta",contentIndex:l(),delta:a.text,partial:n})}if(a.functionCall){if(r){if(r.type==="text")i.push({type:"text_end",contentIndex:l(),content:r.text,partial:n});else i.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:n});r=null}let d=a.functionCall.id,y={type:"toolCall",id:!d||n.content.some((x)=>x.type==="toolCall"&&x.id===d)?`${a.functionCall.name}_${Date.now()}_${++O}`:d,name:a.functionCall.name||"",arguments:a.functionCall.args??{},...a.thoughtSignature&&{thoughtSignature:a.thoughtSignature}};n.content.push(y),i.push({type:"toolcall_start",contentIndex:l(),partial:n}),i.push({type:"toolcall_delta",contentIndex:l(),delta:JSON.stringify(y.arguments),partial:n}),i.push({type:"toolcall_end",contentIndex:l(),toolCall:y,partial:n})}}if(k?.finishReason){if(n.rawStopReason=k.finishReason,n.stopReason=Rr(k.finishReason),n.content.some((a)=>a.type==="toolCall")&&n.stopReason==="stop")n.stopReason="toolUse"}if(s.usageMetadata)n.usage={input:(s.usageMetadata.promptTokenCount||0)-(s.usageMetadata.cachedContentTokenCount||0),output:(s.usageMetadata.candidatesTokenCount||0)+(s.usageMetadata.thoughtsTokenCount||0),cacheRead:s.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:s.usageMetadata.thoughtsTokenCount||0,totalTokens:s.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},Y(e,n.usage)}if(r)if(r.type==="text")i.push({type:"text_end",contentIndex:l(),content:r.text,partial:n});else i.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:n});if(t?.signal?.aborted)throw Error("Request was aborted");if(n.stopReason==="pending")throw Error("Google Vertex stream ended without a finish reason");if(n.stopReason==="aborted"||n.stopReason==="error"){let s=n.rawStopReason?`Provider stopped with: ${n.rawStopReason}`:"An unknown error occurred";throw Error(s)}i.push({type:"done",reason:n.stopReason,message:n}),i.end()}catch(c){for(let g of n.content)if("index"in g)delete g.index;n.stopReason=t?.signal?.aborted?"aborted":"error",n.errorMessage=J(V(c)),i.push({type:"error",reason:n.stopReason,error:n}),i.end()}})(),i},ue=(e,o,t)=>{let i={...X(e,o,t,void 0),toolChoice:t?.toolChoice};if(!t?.reasoning)return C(e,o,{...i,thinking:{enabled:!1}});let u=K(e,t.reasoning);if(u==="off")return C(e,o,{...i,thinking:{enabled:!1}});let n=Xt(e,u);if(Jt(e))return C(e,o,{...i,thinking:{enabled:!0,level:Yt(n)}});return C(e,o,{...i,thinking:{enabled:!0,budgetTokens:N(e,n,t.thinkingBudgets)}})};function R(e,o,t,i,u){let n=G(u);return new It({vertexai:!0,project:o,location:t,apiVersion:T,...n?{googleAuthOptions:n}:{},httpOptions:b(e,i)})}function I(e,o,t){return new It({vertexai:!0,apiKey:o,apiVersion:T,httpOptions:b(e,t)})}function b(e,o){let t={},i=S(e.baseUrl);if(i){if(t.baseUrl=i,t.baseUrlResourceScope=vr.COLLECTION,E(i))t.apiVersion=""}let u=we({"User-Agent":oe(),...e.headers,...o});if(u)t.headers=u;return Object.keys(t).length>0?t:void 0}function S(e){let o=e.trim();if(!o||o.includes("{location}"))return;return o}function E(e){try{return new URL(e).pathname.split("/").some((t)=>/^v\d+(?:beta\d*)?$/.test(t))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function G(e){let o=_("GOOGLE_APPLICATION_CREDENTIALS",e);return o?{keyFilename:o}:void 0}function L(e){let o=e?.apiKey?.trim();if(!o||o===v||A(o))return;return o}function A(e){return/^<[^>]+>$/.test(e)}function M(e){let o=e?.project||_("GOOGLE_CLOUD_PROJECT",e?.env)||_("GCLOUD_PROJECT",e?.env);if(!o)throw Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");return o}function P(e){let o=e?.location||_("GOOGLE_CLOUD_LOCATION",e?.env);if(!o)throw Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");return o}function D(e,o,t={}){let i=Er(e,o),u=ge(o.messages),n=ae(o.messages),c={};if(t.temperature!==void 0)c.temperature=t.temperature;if(t.maxTokens!==void 0)c.maxOutputTokens=t.maxTokens;let g=Pr(e.id),h=n.length>0?kr(n,t.toolChoice,g):void 0,m=u?W(u):"",p={...Object.keys(c).length>0&&c,...m&&{systemInstruction:w(m)},...n.length>0&&{tools:Tr(n,!1,g)},...h!==void 0&&{toolConfig:{functionCallingConfig:{mode:h}}}};if(t.thinking?.enabled&&e.reasoning){let f={includeThoughts:!0};if(t.thinking.level!==void 0)f.thinkingLevel=Zt(t.thinking.level);else if(t.thinking.budgetTokens!==void 0)f.thinkingBudget=t.thinking.budgetTokens;p.thinkingConfig=f}else if(e.reasoning&&t.thinking&&!t.thinking.enabled)p.thinkingConfig=_r(e);if(t.signal){if(t.signal.aborted)throw Error("Request aborted");p.abortSignal=t.signal}return{model:e.id,contents:i,config:p}}function N(e,o,t){if(t?.[o]!==void 0)return t[o];if(e.id.includes("2.5-pro"))return{minimal:128,low:2048,medium:8192,high:32768}[o];if(e.id.includes("2.5-flash"))return{minimal:128,low:2048,medium:8192,high:24576}[o];return-1}export{C as stream,ue as streamSimple};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{oe}from"./chunk-y4pvhes1.js";var g=function(t,i){if(typeof t==="string"&&/^\.\.?\//.test(t))return t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,s,a,r,p){return s?i?".jsx":".js":a&&(!r||!p)?e:a+r+"."+p.toLowerCase()+"js"});return t},x=(t)=>{let i=import.meta.url.endsWith(".js")?t.replace(/\.ts$/,".js"):t;return import(g(i))},l;function Si(t){l=t}var wi=()=>oe(async()=>l??await x("./bedrock-converse-stream.ts"));var u={"anthropic-messages":{"chat:claude-fable-5":{id:"claude-fable-5",name:"Claude Fable 5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-fable-5.1":{id:"claude-fable-5.1",name:"Claude Fable 5.1",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:0.25,cacheWrite:12.5},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-haiku-4.5":{id:"claude-haiku-4.5",name:"Claude Haiku 4.5 (latest)",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25},contextWindow:200000,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsEagerToolInputStreaming:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-haiku-5.5":{id:"claude-haiku-5.5",name:"Claude Haiku 5.5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.1,output:0.5,cacheRead:0.01,cacheWrite:0.125,tiers:[{inputTokensAbove:1e5,input:0.5,output:2.5,cacheRead:0.05,cacheWrite:0.625}]},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-opus-4.7":{id:"claude-opus-4.7",name:"Claude Opus 4.7",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:32000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{xhigh:"xhigh",max:"max",minimal:"low"},compat:{forceAdaptiveThinking:!0,supportsTemperature:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-opus-4.8":{id:"claude-opus-4.8",name:"Claude Opus 4.8",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max",minimal:"low"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-opus-5":{id:"claude-opus-5",name:"Claude Opus 5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max",minimal:"low"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-opus-5.5":{id:"claude-opus-5.5",name:"Claude Opus 5.5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:0.2,cacheWrite:5},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-sonnet-4.6":{id:"claude-sonnet-4.6",name:"Claude Sonnet 4.6",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:32000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{max:"max",minimal:"low"},compat:{forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-sonnet-5":{id:"claude-sonnet-5",name:"Claude Sonnet 5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:0.2,cacheWrite:2.5},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{xhigh:"xhigh",max:"max"},compat:{forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-sonnet-5.5":{id:"claude-sonnet-5.5",name:"Claude Sonnet 5.5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:0.1,cacheWrite:2.5},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"}},"openai-completions":{"chat:gemini-3.5-flash":{id:"gemini-3.5-flash",name:"Gemini 3.5 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0},contextWindow:200000,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gemini-3.6-flash":{id:"gemini-3.6-flash",name:"Gemini 3.6 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.75,output:3.75,cacheRead:0.075,cacheWrite:0},contextWindow:1e6,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gemini-3.7-flash":{id:"gemini-3.7-flash",name:"Gemini 3.7 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.75,output:3.75,cacheRead:0.075,cacheWrite:0},contextWindow:1e6,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gemini-3.8-flash":{id:"gemini-3.8-flash",name:"Gemini 3.8 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.75,output:3.75,cacheRead:0.075,cacheWrite:0},contextWindow:1e6,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0},contextWindow:256000,maxTokens:32000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:kimi-k3":{id:"kimi-k3",name:"Kimi K3",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:0.3,cacheWrite:0},contextWindow:1048576,maxTokens:131072,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"}},"openai-responses":{"chat:gpt-5-mini":{id:"gpt-5-mini",name:"GPT-5 Mini",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0},contextWindow:264000,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.3-codex":{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.4":{id:"gpt-5.4",name:"GPT-5.4",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0,tiers:[{inputTokensAbove:272000,input:5,output:22.5,cacheRead:0.5,cacheWrite:0}]},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.4-mini":{id:"gpt-5.4-mini",name:"GPT-5.4 mini",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0},contextWindow:400000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.4-nano":{id:"gpt-5.4-nano",name:"GPT-5.4 nano",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0},contextWindow:400000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.5":{id:"gpt-5.5",name:"GPT-5.5",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0,tiers:[{inputTokensAbove:272000,input:10,output:45,cacheRead:1,cacheWrite:0}]},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.6-luna":{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.2,output:1.2,cacheRead:0.02,cacheWrite:0.25,tiers:[{inputTokensAbove:200000,input:0.4,output:1.8,cacheRead:0.04,cacheWrite:0.5}]},contextWindow:1050000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.6-sol":{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:0.4,cacheWrite:5,tiers:[{inputTokensAbove:272000,input:8,output:30,cacheRead:0.8,cacheWrite:10}]},contextWindow:1050000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.6-terra":{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:12,cacheRead:0.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272000,input:4,output:18,cacheRead:0.4,cacheWrite:5}]},contextWindow:1050000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-6-astra":{id:"gpt-6-astra",name:"GPT-6 Astra",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5,tiers:[{inputTokensAbove:272000,input:20,output:75,cacheRead:2,cacheWrite:25}]},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-6-luna":{id:"gpt-6-luna",name:"GPT-6 Luna",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.1,output:0.5,cacheRead:0.01,cacheWrite:0.125,tiers:[{inputTokensAbove:272000,input:0.2,output:0.75,cacheRead:0.02,cacheWrite:0.25}]},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-6-sol":{id:"gpt-6-sol",name:"GPT-6 Sol",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:0.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272000,input:4,output:15,cacheRead:0.4,cacheWrite:5}]},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-6.1-sol":{id:"gpt-6.1-sol",name:"GPT-6.1 Sol",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:0.1,cacheWrite:2.5,tiers:[{inputTokensAbove:272000,input:4,output:15,cacheRead:0.2,cacheWrite:5}]},contextWindow:1050000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:grok-4.5":{id:"grok-4.5",name:"Grok 4.5",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:0.5,cacheWrite:0,tiers:[{inputTokensAbove:200000,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:500000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:grok-4.6":{id:"grok-4.6",name:"Grok 4.6",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:0.5,cacheWrite:0,tiers:[{inputTokensAbove:200000,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:500000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:grok-4.7":{id:"grok-4.7",name:"Grok 4.7",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:0.5,cacheWrite:0,tiers:[{inputTokensAbove:200000,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:500000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:mai-code-1-flash-picker":{id:"mai-code-1-flash-picker",name:"MAI-Code-1-Flash",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text"],cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0},contextWindow:256000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},type:"chat"},"chat:mai-code-1.1-flash":{id:"mai-code-1.1-flash",name:"MAI-Code-1.1-Flash",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.2,output:1.2,cacheRead:0.02,cacheWrite:0},contextWindow:256000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"}}};function c(t,i){return Object.fromEntries(Object.values(t).flatMap((e)=>Object.values(e)).filter((e)=>e.type===i).map((e)=>[e.id,e]))}function m(t,i){return c(i,"chat")}function h(t,i){return c(i,"image")}function f(t,i){return c(i,"classifier")}var Fr=m("github-copilot",u),E=h("github-copilot",u),G=f("github-copilot",u);var b=function(t,i){if(typeof t==="string"&&/^\.\.?\//.test(t))return t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,s,a,r,p){return s?i?".jsx":".js":a&&(!r||!p)?e:a+r+"."+p.toLowerCase()+"js"});return t},n=(t)=>{let i=import.meta.url.endsWith(".js")?t.replace(/\.ts$/,".js"):t;return import(b(i))},o;function xi(t){o=t}var vi=async()=>{if(o)return o.anthropic();return(await n("./anthropic.ts")).anthropicOAuth},_i=async()=>{if(o)return o.openaiCodex();return(await n("./openai-codex.ts")).openaiCodexOAuth},Ai=async()=>{if(o)return o.openaiChatGPT();return(await n("./openai-chatgpt.ts")).openaiChatGPTOAuth},Ei=async()=>{if(o)return o.githubCopilot();return(await n("./github-copilot.ts")).githubCopilotOAuth},Pi=async()=>{if(o)return o.openrouter();return(await n("./openrouter.ts")).openRouterOAuth},Ti=async()=>{if(o)return o.kimiCoding();return(await n("./kimi-coding.ts")).kimiCodingOAuth},ki=async()=>{if(o)return o.meta();return(await n("./meta.ts")).metaOAuth},Ri=async()=>{if(o)return o.xai();return(await n("./xai.ts")).xaiOAuth},Ci=async(t)=>{if(o)return o.radius(t);return(await n("./radius.ts")).createRadiusOAuth(t)};var Bo="https://radius.pi.dev";function C(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t;return typeof i.id==="string"&&typeof i.name==="string"&&typeof i.reasoning==="boolean"&&Array.isArray(i.input)&&typeof i.cost==="object"&&i.cost!==null&&!Array.isArray(i.cost)&&typeof i.contextWindow==="number"&&typeof i.maxTokens==="number"}function d(t){if(typeof t!=="object"||t===null||Array.isArray(t))return;let{baseUrl:i,models:e}=t;if(typeof i!=="string"||!Array.isArray(e))return;return{baseUrl:i,models:e.filter(C).map((s)=>({...s}))}}function rr(t){return(/^https?:\/\//iu.test(t)?t:`https://${t}`).replace(/\/+$/u,"")}function y(t){return d(t?.gatewayConfig)}function Fo(t,i){return i.models.map((e)=>({...e,api:"pi-messages",provider:t,baseUrl:i.baseUrl}))}function Ii(t,i){let e=y(i);return e?Fo(t,e):[]}function A(t){let i=t.trim();return i.length>512?`${i.slice(0,512)}\u2026`:i}async function Mi(t,i,e){let s={accept:"application/json"};if(i)s.authorization=`Bearer ${i}`;let a=await fetch(new URL("/v1/config",t),{headers:s,signal:e});if(!a.ok)throw Error(`Could not load Radius config from ${t}: ${a.status}: ${A(await a.text())}`);let r=d(await a.json());if(!r)throw Error(`Invalid Radius config from ${t}`);return r}
|
|
3
|
-
export{Si,wi,m,h,f,
|
|
2
|
+
import{ie}from"./chunk-z9p6s986.js";var g=function(t,i){if(typeof t==="string"&&/^\.\.?\//.test(t))return t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,s,a,r,p){return s?i?".jsx":".js":a&&(!r||!p)?e:a+r+"."+p.toLowerCase()+"js"});return t},x=(t)=>{let i=import.meta.url.endsWith(".js")?t.replace(/\.ts$/,".js"):t;return import(g(i))},l;function Si(t){l=t}var wi=()=>ie(async()=>l??await x("./bedrock-converse-stream.ts"));var u={"anthropic-messages":{"chat:claude-fable-5":{id:"claude-fable-5",name:"Claude Fable 5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-fable-5.1":{id:"claude-fable-5.1",name:"Claude Fable 5.1",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:0.25,cacheWrite:12.5},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0},thinkingLevelMap:{off:null,xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-haiku-4.5":{id:"claude-haiku-4.5",name:"Claude Haiku 4.5 (latest)",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25},contextWindow:200000,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsEagerToolInputStreaming:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-haiku-5.5":{id:"claude-haiku-5.5",name:"Claude Haiku 5.5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.1,output:0.5,cacheRead:0.01,cacheWrite:0.125,tiers:[{inputTokensAbove:1e5,input:0.5,output:2.5,cacheRead:0.05,cacheWrite:0.625}]},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-opus-4.7":{id:"claude-opus-4.7",name:"Claude Opus 4.7",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:32000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{xhigh:"xhigh",max:"max",minimal:"low"},compat:{forceAdaptiveThinking:!0,supportsTemperature:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-opus-4.8":{id:"claude-opus-4.8",name:"Claude Opus 4.8",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max",minimal:"low"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-opus-5":{id:"claude-opus-5",name:"Claude Opus 5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25},contextWindow:1e6,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max",minimal:"low"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-opus-5.5":{id:"claude-opus-5.5",name:"Claude Opus 5.5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:0.2,cacheWrite:5},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-sonnet-4.6":{id:"claude-sonnet-4.6",name:"Claude Sonnet 4.6",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75},contextWindow:1e6,maxTokens:32000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{max:"max",minimal:"low"},compat:{forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-sonnet-5":{id:"claude-sonnet-5",name:"Claude Sonnet 5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:0.2,cacheWrite:2.5},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{xhigh:"xhigh",max:"max"},compat:{forceAdaptiveThinking:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:claude-sonnet-5.5":{id:"claude-sonnet-5.5",name:"Claude Sonnet 5.5",api:"anthropic-messages",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:0.1,cacheWrite:2.5},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsMidConvoSystemMessages:!0,forceAdaptiveThinking:!0,supportsTemperature:!1},thinkingLevelMap:{xhigh:"xhigh",max:"max"},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"}},"openai-completions":{"chat:gemini-3.5-flash":{id:"gemini-3.5-flash",name:"Gemini 3.5 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0},contextWindow:200000,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gemini-3.6-flash":{id:"gemini-3.6-flash",name:"Gemini 3.6 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.75,output:3.75,cacheRead:0.075,cacheWrite:0},contextWindow:1e6,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gemini-3.7-flash":{id:"gemini-3.7-flash",name:"Gemini 3.7 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.75,output:3.75,cacheRead:0.075,cacheWrite:0},contextWindow:1e6,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gemini-3.8-flash":{id:"gemini-3.8-flash",name:"Gemini 3.8 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.75,output:3.75,cacheRead:0.075,cacheWrite:0},contextWindow:1e6,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0},contextWindow:256000,maxTokens:32000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:kimi-k3":{id:"kimi-k3",name:"Kimi K3",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:0.3,cacheWrite:0},contextWindow:1048576,maxTokens:131072,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"}},"openai-responses":{"chat:gpt-5-mini":{id:"gpt-5-mini",name:"GPT-5 Mini",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0},contextWindow:264000,maxTokens:64000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.3-codex":{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.4":{id:"gpt-5.4",name:"GPT-5.4",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0,tiers:[{inputTokensAbove:272000,input:5,output:22.5,cacheRead:0.5,cacheWrite:0}]},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.4-mini":{id:"gpt-5.4-mini",name:"GPT-5.4 mini",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0},contextWindow:400000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.4-nano":{id:"gpt-5.4-nano",name:"GPT-5.4 nano",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0},contextWindow:400000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.5":{id:"gpt-5.5",name:"GPT-5.5",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0,tiers:[{inputTokensAbove:272000,input:10,output:45,cacheRead:1,cacheWrite:0}]},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.6-luna":{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.2,output:1.2,cacheRead:0.02,cacheWrite:0.25,tiers:[{inputTokensAbove:200000,input:0.4,output:1.8,cacheRead:0.04,cacheWrite:0.5}]},contextWindow:1050000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.6-sol":{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:0.4,cacheWrite:5,tiers:[{inputTokensAbove:272000,input:8,output:30,cacheRead:0.8,cacheWrite:10}]},contextWindow:1050000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.6-terra":{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:12,cacheRead:0.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272000,input:4,output:18,cacheRead:0.4,cacheWrite:5}]},contextWindow:1050000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-6-astra":{id:"gpt-6-astra",name:"GPT-6 Astra",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5,tiers:[{inputTokensAbove:272000,input:20,output:75,cacheRead:2,cacheWrite:25}]},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-6-luna":{id:"gpt-6-luna",name:"GPT-6 Luna",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.1,output:0.5,cacheRead:0.01,cacheWrite:0.125,tiers:[{inputTokensAbove:272000,input:0.2,output:0.75,cacheRead:0.02,cacheWrite:0.25}]},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-6-sol":{id:"gpt-6-sol",name:"GPT-6 Sol",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:0.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272000,input:4,output:15,cacheRead:0.4,cacheWrite:5}]},contextWindow:1e6,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-6.1-sol":{id:"gpt-6.1-sol",name:"GPT-6.1 Sol",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:0.1,cacheWrite:2.5,tiers:[{inputTokensAbove:272000,input:4,output:15,cacheRead:0.2,cacheWrite:5}]},contextWindow:1050000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:grok-4.5":{id:"grok-4.5",name:"Grok 4.5",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:0.5,cacheWrite:0,tiers:[{inputTokensAbove:200000,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:500000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:grok-4.6":{id:"grok-4.6",name:"Grok 4.6",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:0.5,cacheWrite:0,tiers:[{inputTokensAbove:200000,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:500000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:grok-4.7":{id:"grok-4.7",name:"Grok 4.7",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:0.5,cacheWrite:0,tiers:[{inputTokensAbove:200000,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:500000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:mai-code-1-flash-picker":{id:"mai-code-1-flash-picker",name:"MAI-Code-1-Flash",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text"],cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0},contextWindow:256000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},type:"chat"},"chat:mai-code-1.1-flash":{id:"mai-code-1.1-flash",name:"MAI-Code-1.1-Flash",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:0.2,output:1.2,cacheRead:0.02,cacheWrite:0},contextWindow:256000,maxTokens:128000,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2000,maxHeight:2000,maxBytes:4718592,jpegQuality:80}}},type:"chat"}}};function c(t,i){return Object.fromEntries(Object.values(t).flatMap((e)=>Object.values(e)).filter((e)=>e.type===i).map((e)=>[e.id,e]))}function m(t,i){return c(i,"chat")}function h(t,i){return c(i,"image")}function f(t,i){return c(i,"classifier")}var $r=m("github-copilot",u),E=h("github-copilot",u),G=f("github-copilot",u);var b=function(t,i){if(typeof t==="string"&&/^\.\.?\//.test(t))return t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,s,a,r,p){return s?i?".jsx":".js":a&&(!r||!p)?e:a+r+"."+p.toLowerCase()+"js"});return t},n=(t)=>{let i=import.meta.url.endsWith(".js")?t.replace(/\.ts$/,".js"):t;return import(b(i))},o;function xi(t){o=t}var vi=async()=>{if(o)return o.anthropic();return(await n("./anthropic.ts")).anthropicOAuth},_i=async()=>{if(o)return o.openaiCodex();return(await n("./openai-codex.ts")).openaiCodexOAuth},Ai=async()=>{if(o)return o.openaiChatGPT();return(await n("./openai-chatgpt.ts")).openaiChatGPTOAuth},Ei=async()=>{if(o)return o.githubCopilot();return(await n("./github-copilot.ts")).githubCopilotOAuth},Ti=async()=>{if(o)return o.openrouter();return(await n("./openrouter.ts")).openRouterOAuth},Pi=async()=>{if(o)return o.kimiCoding();return(await n("./kimi-coding.ts")).kimiCodingOAuth},ki=async()=>{if(o)return o.meta();return(await n("./meta.ts")).metaOAuth},Ri=async()=>{if(o)return o.xai();return(await n("./xai.ts")).xaiOAuth},Ci=async(t)=>{if(o)return o.radius(t);return(await n("./radius.ts")).createRadiusOAuth(t)};var Bo="https://radius.pi.dev";function C(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t;return typeof i.id==="string"&&typeof i.name==="string"&&typeof i.reasoning==="boolean"&&Array.isArray(i.input)&&typeof i.cost==="object"&&i.cost!==null&&!Array.isArray(i.cost)&&typeof i.contextWindow==="number"&&typeof i.maxTokens==="number"}function d(t){if(typeof t!=="object"||t===null||Array.isArray(t))return;let{baseUrl:i,models:e}=t;if(typeof i!=="string"||!Array.isArray(e))return;return{baseUrl:i,models:e.filter(C).map((s)=>({...s}))}}function rr(t){return(/^https?:\/\//iu.test(t)?t:`https://${t}`).replace(/\/+$/u,"")}function y(t){return d(t?.gatewayConfig)}function Fo(t,i){return i.models.map((e)=>({...e,api:"pi-messages",provider:t,baseUrl:i.baseUrl}))}function Ii(t,i){let e=y(i);return e?Fo(t,e):[]}function A(t){let i=t.trim();return i.length>512?`${i.slice(0,512)}\u2026`:i}async function Mi(t,i,e){let s={accept:"application/json"};if(i)s.authorization=`Bearer ${i}`;let a=await fetch(new URL("/v1/config",t),{headers:s,signal:e});if(!a.ok)throw Error(`Could not load Radius config from ${t}: ${a.status}: ${A(await a.text())}`);let r=d(await a.json());if(!r)throw Error(`Invalid Radius config from ${t}`);return r}
|
|
3
|
+
export{Si,wi,m,h,f,$r,xi,vi,_i,Ai,Ei,Ti,Pi,ki,Ri,Ci,Bo,rr,Fo,Ii,Mi};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Do,Et,ct,
|
|
3
|
-
`);if(r[r.length-1]==="")r.pop();return r}function Ot(a,r){return/^[\x20-\x7E]+$/.test(r)&&!/[\\^#]/.test(r)&&!(a==="unzip"&&r.startsWith("-"))}function Mt(a,r,t){let i=xe(r),n=xe(t);if(i.length!==n.length)throw new u(Me);let s=[],c=[];return i.forEach((l,f)=>{if(bt[a].has(n[f].charAt(0))){s.push(l);return}if(!Ot(a,l))throw new u(`refusing to extract archive: cannot safely exclude member ${JSON.stringify(l)}`);c.push(l)}),{plain:s,special:c}}async function De(a){for(let r of await k.readdir(a,{withFileTypes:!0}))if(r.isDirectory())await De(
|
|
2
|
+
import{Do,Et,ct,P,Un,Uo}from"./chunk-vd5332ps.js";import{o,e,u,Bt,At,I,he,R,No,Ur,$t}from"./chunk-pjgt1bdx.js";import*as S from"fs/promises";import*as ne from"fs";import*as O from"path";import*as $e from"child_process";import*as at from"crypto";import*as lt from"readline";function D(a){if(a.inputSchema.type!=="object")throw Error(`JSON schema for tool "${a.name}" must be an object, but got ${a.inputSchema.type}`);return{type:"custom",name:a.name,input_schema:a.inputSchema,description:a.description,run:a.run,parse:(r)=>r,...a.close?{close:a.close}:{}}}var C=ct.promises,J=448,yt=384;function ae(a,r){let t=P.relative(a,r);return t===""||!t.startsWith(".."+P.sep)&&t!==".."&&!P.isAbsolute(t)}async function Ee(a,r){for(let t of a)if(ae(await X(P.resolve(t)),r))return t;return}var wt=40;function Z(a){let r=a?.code;return typeof r==="string"?r:void 0}async function X(a){let r=[],t=a,i=0;for(;;){let n;try{n=await C.realpath(t)}catch(s){let c;try{c=(await C.lstat(t)).isSymbolicLink()}catch(l){let f=Z(l);if(f!=="ENOENT"&&f!=="ENOTDIR")throw l;let h=P.dirname(t);if(h===t)throw l;r.push(P.basename(t)),t=h;continue}if(!c)throw s;if(++i>wt)throw Object.assign(Error("too many levels of symbolic links"),{code:"ELOOP"});t=P.resolve(P.dirname(t),await C.readlink(t));continue}return r.length?P.join(n,...r.reverse()):n}}async function Ae(a,r,t){let i=t?.allowedRoots??[],n=await X(P.resolve(a)),s;try{s=await X(P.resolve(n,r))}catch(l){throw new R(q(l,`path ${JSON.stringify(r)}`))}if(ae(n,s)||await Ee(i,s)!==void 0)return s;let c=i.length?"the session's working directory and its other permitted directories":"the session's working directory";throw new R(`path ${JSON.stringify(r)} is outside ${c}`)}async function be(a,r){let t=P.dirname(a),i=P.join(t,`.tmp-${process.pid}-${Et.randomUUID()}`),n=await C.stat(a).then((c)=>c.mode&511,()=>{return}),s;try{if(s=await C.open(i,"wx",yt),n!==void 0)await s.chmod(n);await s.writeFile(r,"utf-8"),await s.sync(),await s.close(),s=void 0,await C.rename(i,a)}catch(c){if(s)await s.close().catch(()=>{});throw await C.unlink(i).catch(()=>{}),c}}function q(a,r){let t=Z(a);switch(t){case"ENOENT":return`${r}: no such file or directory`;case"EACCES":case"EPERM":return`${r}: permission denied`;case"ENOTDIR":return`${r}: not a directory`;case"EISDIR":return`${r}: is a directory`;case"ELOOP":return`${r}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${r}: file name too long`;case"ENOSPC":return`${r}: no space left on device`;case"EMFILE":case"ENFILE":return`${r}: too many open files`;default:return`${r}: ${t!==void 0?`i/o error (${t})`:"i/o error"}`}}var k=ct.promises,_t=Uo.promisify(Do.execFile);async function gt(a){let{client:r,sessionId:t}=a;if(!r)return async()=>{};let i=I(r),n=a.session;if(!n){if(t===void 0)return async()=>{};i.warn("AgentToolContext.sessionId is deprecated and costs an extra session fetch; fetch the session once and set `session` instead",{component:"agent-tool-context"}),n=await r.beta.sessions.retrieve(t)}let s=P.resolve(a.workdir,"skills"),c=[];for(let l of n.agent.skills)try{let f=await r.beta.skills.versions.retrieve(l.version,{skill_id:l.skill_id}),h=P.basename(f.name.trim());if(h===""||h==="."||h==="..")h=l.skill_id;let d=P.resolve(s,h);if(d!==s&&!d.startsWith(s+P.sep)){i.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:f.name});continue}let m=await r.beta.skills.versions.download(f.id,{skill_id:l.skill_id});await k.rm(d,{recursive:!0,force:!0}),await k.mkdir(d,{recursive:!0,mode:J}),c.push(d),await Ce(m,d),i.info("downloaded skill",{component:"agent-tool-context",skill_id:l.skill_id,version:f.id,dest:d})}catch(f){i.warn("failed to download skill",{component:"agent-tool-context",skill_id:l.skill_id,error:String(f)})}return async()=>{for(let l of c)await k.rm(l,{recursive:!0,force:!0}).catch((f)=>{i.warn("failed to clean up skill",{component:"agent-tool-context",dest:l,error:String(f)})})}}function St(a){for(let r of a){let t=r.trim();if(!t)continue;if(P.isAbsolute(t)||t.split(/[\\/]/).includes(".."))throw new u(`refusing to extract unsafe archive member: ${t}`)}}var Me="skill archive listing is inconsistent; refusing to extract",bt={unzip:new Set(["-","d","?"]),tar:new Set(["-","d","C"])};function xe(a){let r=a.split(`
|
|
3
|
+
`);if(r[r.length-1]==="")r.pop();return r}function Ot(a,r){return/^[\x20-\x7E]+$/.test(r)&&!/[\\^#]/.test(r)&&!(a==="unzip"&&r.startsWith("-"))}function Mt(a,r,t){let i=xe(r),n=xe(t);if(i.length!==n.length)throw new u(Me);let s=[],c=[];return i.forEach((l,f)=>{if(bt[a].has(n[f].charAt(0))){s.push(l);return}if(!Ot(a,l))throw new u(`refusing to extract archive: cannot safely exclude member ${JSON.stringify(l)}`);c.push(l)}),{plain:s,special:c}}async function De(a){for(let r of await k.readdir(a,{withFileTypes:!0}))if(r.isDirectory())await De(P.join(a,r.name));else if(!r.isFile())throw new u(Me)}async function Oe(a,r){try{let{stdout:t}=await _t(a,r);return t}catch(t){if(Z(t)==="ENOENT")throw new u(`skill extraction requires the \`${a}\` command, but it was not found on PATH`);throw t}}function vt(a){let r,t=!1;for(let i of a){let n=i.trim().split("/").filter((c)=>c!==""&&c!==".");if(n.length===0)continue;let s=n[0];if(r===void 0)r=s;else if(s!==r)return"";if(n.length>1)t=!0}return r!==void 0&&t?r:""}async function Ce(a,r){let t=P.join(r,`.skill-archive-${process.pid}-${Date.now()}`);if(!a.body)throw new u("skill download response had no body");await Un.promises.pipeline(Un.Readable.fromWeb(a.body),ct.createWriteStream(t));let i=P.join(P.dirname(r),`.skill-stage-${process.pid}-${Date.now()}`),n=P.join(P.dirname(r),`.skill-exclude-${process.pid}-${Date.now()}`);try{let s=await It(t,4),c=s.length>=4&&s[0]===80&&s[1]===75&&s[2]===3&&s[3]===4,l=c?"unzip":"tar",f=await Oe(l,c?["-Z1",t]:["-tf",t]),h=await Oe(l,c?["-Z","--h","--t",t]:["-tvf",t]),{plain:d,special:m}=Mt(l,f,h);St([...d,...m]);let _=vt(d);if(await k.mkdir(i,{recursive:!0,mode:J}),d.length>0)await Oe(l,await kt(l,t,i,m,n));await De(i);let E=_?P.join(i,_):i,x=await k.readdir(E).catch((M)=>{throw Z(M)==="ENOENT"?new u(Me):M});for(let M of x)await k.rename(P.join(E,M),P.join(r,M))}finally{await k.rm(t,{force:!0}),await k.rm(n,{force:!0}),await k.rm(i,{recursive:!0,force:!0})}}async function kt(a,r,t,i,n){let s=i.map((c)=>c.replace(/[*?[\\]/g,"\\$&"));if(a==="unzip")return["-oq",r,"-d",t,...s.length>0?["-x",...s]:[]];if(s.length===0)return["-xf",r,"-C",t];return await k.writeFile(n,s.join(`
|
|
4
4
|
`)+`
|
|
5
|
-
`,{flag:"wx",mode:384}),["-xf",r,"-C",t,"-X",n]}async function It(a,r){let t=await k.open(a,"r");try{let i=Buffer.alloc(r),{bytesRead:n}=await t.read(i,0,r,0);return i.subarray(0,n)}finally{await t.close()}}var g=ct.promises,z=ct.constants,Ue=448,Rt=384,Nt=448,ke=z.O_NOFOLLOW??0,Tt=z.O_NONBLOCK??0,y=(()=>{class a extends Error{constructor(r,t){super(`path ${JSON.stringify(t)} ${r}`);this.name="FileStoreError",this.reason=r,this.relPath=t}}return a.ESCAPES_ROOT="escapes the store root",a.IS_A_SYMLINK="is a symlink",a.NOT_A_FILE="is not a regular file",a.NOT_A_DIRECTORY="is not a directory",a.NOT_UTF8="is not valid utf-8",a.MOVE_DESTINATION_EXISTS="already exists",a})();function Ie(a){return a.startsWith("/")&&!a.split("/").includes("..")}var ve=(()=>{class a{constructor(r,t,i=!1){this.hashes=new Map,this.rootPath=r,this.removedOnDispose=t,this.decoder=i?new TextDecoder("utf-8",{fatal:!0}):void 0}static async open(r,t){if(!Lt())throw Error("FileStore requires O_NOFOLLOW support on this platform");let i=!1;try{await g.lstat(r)}catch(n){if(n.code!=="ENOENT")throw n;i=!0}return new a(
|
|
6
|
-
${a}`,"utf-8").digest("hex")}var qt=30000,zt=100,Gt=20,Ht=16,Kt=32,Vt=8,Xt=50;class
|
|
7
|
-
${t.memoryStoreId}`);for await(let[i,n]of e(this,w,"m",ue).call(this,t.memoryStoreId,"full"))if(await e(this,w,"m",Te).call(this,t,i,n.content??""))t.baseline.set(i,n.content_sha256)},He=async function(t,i,n,s,c){let l=t.baseline.get(i);if(s!==void 0)t.pendingDeletes.delete(i);if(!n){if(s===void 0){t.pendingDeletes.delete(i);return}if(l!==void 0){if(s===l){let _=await e(this,w,"m",Ke).call(this,t,i,l);if(_===void 0)return;if(_===l)return l;s=_}if(t.readOnly)e(this,p,"f").warn("memory deleted remotely but edited locally; keeping the file, which a read-only store cannot push",{path:i,memory_store_id:t.memoryStoreId});else if(t.refusedShas.get(i)!==s)e(this,p,"f").info("memory deleted remotely but edited locally; re-creating it from the file",{path:i,memory_store_id:t.memoryStoreId})}if(t.readOnly)return;if(t.refusedShas.get(i)===s)return;return await e(this,w,"m",pe).call(this,t,i,s,void 0)}let f=n.content_sha256,h=f!==l,d=s!==void 0&&s!==l&&s!==f,m=!t.readOnly&&d;if(s===void 0&&l!==void 0){if(h)e(this,p,"f").warn("memory deleted locally but changed remotely; restoring the remote version",{path:i,memory_store_id:t.memoryStoreId}),t.pendingDeletes.delete(i),c.push([i,n]);return l}if(h){if(s===f)return f;if(d)e(this,p,"f").warn("memory changed both locally and remotely; keeping the remote version",{path:i,memory_store_id:t.memoryStoreId});return c.push([i,n]),l}if(m){if(t.refusedShas.get(i)===s)return f;return await e(this,w,"m",pe).call(this,t,i,s,n)??f}return f},Ke=async function(t,i,n){let s;try{s=await t.files.hashFile(i)}catch(c){if(!(c instanceof y)&&!H(c))throw c;return n}if(s===null)return;if(s!==n)return s;try{await t.files.remove(i)}catch(c){if(!(c instanceof y)&&!H(c))throw c;return e(this,p,"f").warn("failed to remove memory deleted remotely",{path:i,memory_store_id:t.memoryStoreId,error:String(c)}),n}return},Te=async function(t,i,n){try{await t.files.put(i,n)}catch(s){if(!(s instanceof y)&&!H(s))throw s;return e(this,p,"f").warn("failed to write memory",{path:i,memory_store_id:t.memoryStoreId,error:String(s)}),!1}return!0},Ve=async function(t,i){if(i.length===0)return;let n=async(l,f)=>{let h;try{h=await e(this,T,"f").beta.memoryStores.memories.retrieve(f.id,{memory_store_id:t.memoryStoreId,view:"full"})}catch(d){if(he(d,404))return;e(this,p,"f").warn("failed to fetch memory content",{path:l,memory_store_id:t.memoryStoreId,error:String(d)});return}if(await e(this,w,"m",Te).call(this,t,l,h.content??""))t.baseline.set(l,h.content_sha256)},s=i[Symbol.iterator](),c=async()=>{for(let[l,f]of s)await n(l,f)};await Promise.all(Array.from({length:Math.min(Ht,i.length)},c))},Xe=async function(t,i,n,s){let c=i[Symbol.iterator](),l=async()=>{for(let[f,h,d]of c){if(s?.aborted)return;let m=await e(this,w,"m",pe).call(this,t,f,h,d);if(n.delete(f),m!==void 0)t.baseline.set(f,m)}};await Promise.all(Array.from({length:Math.min(Kt,i.length)},l))},ue=async function*(t,i="basic"){let n=i==="basic"?zt:Gt;for await(let s of e(this,T,"f").beta.memoryStores.memories.list(t,{view:i,limit:n})){if(s.type!=="memory")continue;let c=s.path.replace(/^\/+/,"");if(c===K){e(this,p,"f").warn("the server listed the reserved marker path; skipping",{path:s.path,memory_store_id:t});continue}yield[c,s]}},pe=async function r(t,i,n,s){try{let c=await t.files.get(i);if(c===null)return;let l=At(c),f=s?await e(this,T,"f").beta.memoryStores.memories.update(s.id,{memory_store_id:t.memoryStoreId,content:l,precondition:{type:"content_sha256",content_sha256:s.content_sha256}}):await e(this,T,"f").beta.memoryStores.memories.create(t.memoryStoreId,{path:"/"+i,content:l});return t.refusedShas.delete(i),f.content_sha256}catch(c){if(s&&he(c,404))return await e(this,w,"m",r).call(this,t,i,n,void 0);let l=c instanceof y||he(c,400)||he(c,413);if(s&&he(c,409))e(this,p,"f").warn("memory changed both locally and remotely; the upload was refused and the local edit loses",{path:i,memory_store_id:t.memoryStoreId});else if(l&&n!==void 0)t.refusedShas.set(i,n),e(this,p,"f").warn("the server rejected this memory file, so it stays un-synced until its content changes",{path:i,memory_store_id:t.memoryStoreId,rejection:String(c)});else e(this,p,"f").warn("failed to upload memory",{path:i,memory_store_id:t.memoryStoreId,error:String(c)});return}},Je=async function(t,i,n,s,c){if(c.mode==="disabled")return c.suppressed++,s;let l=t.pendingDeletes.get(i);if(l===void 0)l=Date.now(),t.pendingDeletes.set(i,l);if(!c.waiveWindow&&Date.now()-l<qt)return s;let f,h;try{f=await t.files.hashFile(K)===Qe(t.memoryStoreId),h=await t.files.hashFile(i)===null}catch(m){if(!(m instanceof y)&&!H(m))throw m;f=h=!1}if(!f)return s;if(!h)return t.pendingDeletes.delete(i),s;if(!c.takeSlot())return s;if(c.mode==="log_only")return e(this,p,"f").info("log-only: sync would delete this memory on the server",{path:i,memory_store_id:t.memoryStoreId}),s;let d=await e(this,w,"m",Ze).call(this,t,i,n,s);if(d===void 0)t.pendingDeletes.delete(i);return d},Ze=async function(t,i,n,s){try{await e(this,T,"f").beta.memoryStores.memories.delete(n.id,{memory_store_id:t.memoryStoreId,expected_content_sha256:s})}catch(c){if(he(c,404))return;if(he(c,409)||he(c,412))e(this,p,"f").warn("memory deleted locally but changed remotely; keeping the remote version",{path:i,memory_store_id:t.memoryStoreId});else e(this,p,"f").warn("failed to delete memory",{path:i,memory_store_id:t.memoryStoreId,error:String(c)});return s}e(this,p,"f").info("propagated local deletion",{path:i,memory_store_id:t.memoryStoreId});return},a})();function H(a){return typeof a==="object"&&a!==null&&typeof a.code==="string"}async function Zt(a,r){if(!r){await a;return}let t,i=new Promise((n)=>{if(t=n,r.aborted)n()});r.addEventListener("abort",t,{once:!0});try{await Promise.race([a,i])}finally{r.removeEventListener("abort",t)}}var ye,b,v,ee,W,N,Le,we,te,_e,ge,U,j,V,B,re,
|
|
5
|
+
`,{flag:"wx",mode:384}),["-xf",r,"-C",t,"-X",n]}async function It(a,r){let t=await k.open(a,"r");try{let i=Buffer.alloc(r),{bytesRead:n}=await t.read(i,0,r,0);return i.subarray(0,n)}finally{await t.close()}}var g=ct.promises,z=ct.constants,Ue=448,Rt=384,Nt=448,ke=z.O_NOFOLLOW??0,Tt=z.O_NONBLOCK??0,y=(()=>{class a extends Error{constructor(r,t){super(`path ${JSON.stringify(t)} ${r}`);this.name="FileStoreError",this.reason=r,this.relPath=t}}return a.ESCAPES_ROOT="escapes the store root",a.IS_A_SYMLINK="is a symlink",a.NOT_A_FILE="is not a regular file",a.NOT_A_DIRECTORY="is not a directory",a.NOT_UTF8="is not valid utf-8",a.MOVE_DESTINATION_EXISTS="already exists",a})();function Ie(a){return a.startsWith("/")&&!a.split("/").includes("..")}var ve=(()=>{class a{constructor(r,t,i=!1){this.hashes=new Map,this.rootPath=r,this.removedOnDispose=t,this.decoder=i?new TextDecoder("utf-8",{fatal:!0}):void 0}static async open(r,t){if(!Lt())throw Error("FileStore requires O_NOFOLLOW support on this platform");let i=!1;try{await g.lstat(r)}catch(n){if(n.code!=="ENOENT")throw n;i=!0}return new a(P.resolve(r),i,t?.utf8??!1)}async createRoot(){await xt(this.rootPath)}root(){return{path:this.rootPath,removedOnDispose:this.removedOnDispose}}async dispose(){if(!this.removedOnDispose)return;await g.rm(this.rootPath,{recursive:!0,force:!0})}async put(r,t,i){let n=r.replace(/\\/g,"/");if(n.endsWith("/")||n.endsWith("/.")||n===""||n===".")throw new y(y.NOT_A_FILE,r);let s=this.resolveUnderRoot(r),c=typeof t==="string"?Bt(t):t;this.requireUtf8(r,c),await Fe(this.rootPath,P.dirname(s)),await Dt(s,c,i?.executable??!1)}async get(r){let t=this.resolveUnderRoot(r),i;try{i=await je(r,t)}catch(s){if(s.code==="ENOENT")return null;throw s}let n;try{let s=await i.readFile();n=new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}finally{await i.close()}return this.requireUtf8(r,n),n}async ls(r="/"){let t=this.resolveUnderRoot(r);return new Set((await Pe(this.rootPath,r,t)).map(([i])=>i))}async findSymlinks(r="/"){let t=this.resolveUnderRoot(r);return Ft(this.rootPath,r,t)}async hashtree(r="/"){let t=this.resolveUnderRoot(r),i=ce.nowNs(),n=Object.create(null);for(let[s,c]of await Pe(this.rootPath,r,t)){let l=await this.hashViaCache(s,c,i);if(l!==null)n[s]=l}return n}async hashFile(r){let t=this.resolveUnderRoot(r),i;try{i=await g.lstat(t,{bigint:!0})}catch(s){if(s.code==="ENOENT")return null;throw s}if(i.isSymbolicLink())throw new y(y.IS_A_SYMLINK,r);if(!i.isFile())throw new y(y.NOT_A_FILE,r);let n=P.relative(this.rootPath,t).split(P.sep).join("/");return this.hashViaCache(n,t,ce.nowNs())}async move(r,t){let i=this.resolveUnderRoot(r),n=this.resolveUnderRoot(t);if(i===this.rootPath||n===this.rootPath)return;if(await g.stat(n).then(()=>!0,()=>!1))throw new y(y.MOVE_DESTINATION_EXISTS,t);await Fe(this.rootPath,P.dirname(n)),await g.rename(i,n)}async remove(r){let t=this.resolveUnderRoot(r);if(t===this.rootPath)return;let i;try{i=await g.lstat(t,{bigint:!0})}catch(n){if(n.code==="ENOENT")return;throw n}if(i.isDirectory())await g.rm(t,{recursive:!0,force:!0});else try{await g.unlink(t)}catch(n){if(n.code!=="ENOENT")throw n}}resolveUnderRoot(r){let t=r.replace(/\\/g,"/").replace(/^\/+/,""),i=t.split("/").filter((n)=>n!==""&&n!==".");if(P.posix.isAbsolute(t)||i.includes(".."))throw new y(y.ESCAPES_ROOT,r);return i.length===0?this.rootPath:P.join(this.rootPath,...i)}requireUtf8(r,t){if(!this.decoder)return;try{this.decoder.decode(t)}catch{throw new y(y.NOT_UTF8,r)}}async hashViaCache(r,t,i){let n;try{n=await g.lstat(t,{bigint:!0})}catch(l){if(l.code==="ENOENT")return null;throw l}if(!n.isFile())return null;let s=this.hashes.get(r),c;if(s!==void 0&&Wt(s,n))c=s.sha;else try{c=await ce.hashFile(t)}catch(l){let f=l.code;if(f==="ENOENT"||l instanceof y)return null;if(f==="ELOOP"||f==="EMLINK")return null;throw l}if(Ut(n,i))this.hashes.set(r,{mtimeNs:n.mtimeNs,ctimeNs:n.ctimeNs,size:n.size,sha:c});return c}}return a.isPathLegal=Ie,a})();function Lt(){return ke!==0}async function xt(a){let r=[],t=a;for(;;){try{await g.stat(t);break}catch(n){let s=n.code;if(s!=="ENOENT"&&s!=="ENOTDIR"&&s!=="ELOOP")throw n}r.push(t);let i=P.dirname(t);if(i===t)break;t=i}for(let i of r.reverse())try{await g.mkdir(i,{mode:Ue})}catch(n){if(n.code!=="EEXIST")throw n}}async function Fe(a,r){let t=P.relative(a,r);if(t==="")return;let i=a;for(let n of t.split(P.sep)){i=P.join(i,n);try{await g.mkdir(i,{mode:Ue})}catch(s){if(s.code!=="EEXIST")throw s}}}async function Dt(a,r,t){let i=t?Nt:Rt,n=P.join(P.dirname(a),`.fs-${Et.randomBytes(8).toString("hex")}.tmp`),s;try{s=await g.open(n,z.O_WRONLY|z.O_CREAT|z.O_EXCL|ke,i),await s.writeFile(r),await s.close(),s=void 0,await g.rename(n,a)}catch(c){if(s)await s.close().catch(()=>{});throw await g.unlink(n).catch(()=>{}),c}}async function je(a,r){let t;try{t=await g.open(r,z.O_RDONLY|ke|Tt)}catch(i){let n=i.code;if(n==="ELOOP"||n==="EMLINK")throw new y(y.IS_A_SYMLINK,a);throw i}try{if(!(await t.stat()).isFile())throw new y(y.NOT_A_FILE,a)}catch(i){throw await t.close().catch(()=>{}),i}return t}async function Ct(a){let r=Et.createHash("sha256"),t=await je(P.basename(a),a),i=new Uint8Array(1048576);try{for(;;){let{bytesRead:n}=await t.read(i,0,i.length);if(n===0)break;r.update(i.subarray(0,n))}}finally{await t.close()}return r.digest("hex")}async function Pe(a,r,t){if(!await Pt(r,t))return[];let i=[];return await Be(t,(n,s)=>{if(s.isFile())i.push([P.relative(a,n).split(P.sep).join("/"),n])}),i.sort(),i}async function Ft(a,r,t){let i=(c)=>P.relative(a,c).split(P.sep).join("/"),n;try{n=await g.lstat(t,{bigint:!0})}catch(c){let l=c.code;if(l==="ENOENT"||l==="ENOTDIR")return new Set;throw c}if(n.isSymbolicLink())return new Set([i(t)]);if(!n.isDirectory())throw new y(y.NOT_A_DIRECTORY,r);let s=new Set;return await Be(t,(c,l)=>{if(l.isSymbolicLink())s.add(i(c))}),s}async function Pt(a,r){let t;try{t=await g.lstat(r,{bigint:!0})}catch(i){let n=i.code;if(n==="ENOENT"||n==="ENOTDIR")return!1;throw i}if(!t.isDirectory())throw new y(y.NOT_A_DIRECTORY,a);return!0}async function Be(a,r){let t=[a];while(t.length){let i=t.pop(),n;try{n=await g.readdir(i,{withFileTypes:!0})}catch(s){if(s.code==="ENOENT")continue;throw s}for(let s of n){let c=P.join(i,s.name);if(r(c,s),s.isDirectory()&&!s.isSymbolicLink())t.push(c)}}}function Wt(a,r){return r.mtimeNs===a.mtimeNs&&r.ctimeNs===a.ctimeNs&&r.size===a.size}function Ut(a,r){return(a.mtimeNs>a.ctimeNs?a.mtimeNs:a.ctimeNs)<r-ce.timestampTrustMarginNs}var jt=2000000000n,ce={hashFile:Ct,timestampTrustMarginNs:jt,nowNs:()=>BigInt(Date.now())*1000000n},Ye=ve,We=Symbol.asyncDispose;if(We)Object.defineProperty(ve.prototype,We,{value:ve.prototype.dispose,configurable:!0,writable:!0});var w,T,le,Q,fe,p,G,de,L,qe,me,ze,Ge,Re,Ne,He,Ke,Te,Ve,Xe,ue,pe,Je,Ze,Yt=30000,K=".anthropic-memory-store",et=1;function Qe(a){return Et.createHash("sha256").update(`version ${et}
|
|
6
|
+
${a}`,"utf-8").digest("hex")}var qt=30000,zt=100,Gt=20,Ht=16,Kt=32,Vt=8,Xt=50;class F extends u{constructor(a,r){super(a);if(this.name="SessionMemoryError",r!==void 0)this.cause=r}}class tt{constructor(a,r,t){this.mode=a,this.cap=r,this.waiveWindow=t,this.attempted=0,this.capped=0,this.suppressed=0}takeSlot(){if(this.attempted>=this.cap)return this.capped++,!1;return this.attempted++,!0}}var Jt=(()=>{class a{constructor(r,t){w.add(this),T.set(this,void 0),le.set(this,void 0),Q.set(this,void 0),fe.set(this,void 0),p.set(this,void 0),G.set(this,void 0),de.set(this,!1),L.set(this,[]),o(this,T,r,"f"),o(this,le,t.workdir,"f"),o(this,Q,t.syncIntervalMs??No,"f"),Ur(e(this,Q,"f"),"syncIntervalMs"),o(this,fe,t.syncDeletions??"enabled","f"),o(this,p,I(r),"f"),o(this,G,Date.now(),"f")}get roots(){return e(this,L,"f").map((r)=>r.files.root().path)}get readOnlyRoots(){return e(this,L,"f").filter((r)=>r.readOnly).map((r)=>r.files.root().path)}async download(r){for(let t of r.resources){if(t.type!=="memory_store")continue;let i=e(this,w,"m",qe).call(this,t),n;try{if(n={memoryStoreId:t.memory_store_id,files:await Ye.open(i,{utf8:!0}),readOnly:t.access==="read_only",baseline:new Map,refusedShas:new Map,pendingDeletes:new Map},!n.files.root().removedOnDispose)throw new F(`something already exists at the memory store's path: ${i} (memory_store_id=${t.memory_store_id}); it must not exist when the session starts`);try{await n.files.createRoot()}catch(s){if(!H(s))throw s;throw new F(`cannot create the memory store's folder: ${i} (memory_store_id=${t.memory_store_id}): ${s}; the worker host must make this mount path writable`,s)}await e(this,w,"m",Ne).call(this,n),e(this,p,"f").info("downloaded memories",{count:n.baseline.size,memory_store_id:n.memoryStoreId,dest:n.files.root().path}),e(this,L,"f").push(n)}catch(s){if(n)await n.files.dispose().catch(()=>{});if(s instanceof F)throw s;throw new F(`failed to download memory store memory_store_id=${t.memory_store_id}: ${s}`,s)}}o(this,G,Date.now(),"f")}async finish(){if(e(this,de,"f"))throw new u("finish() was already called: it is the session's last sync and runs once");o(this,de,!0,"f"),await this.syncAll(!0)}async syncAll(r){await Promise.all(e(this,L,"f").map((t)=>e(this,w,"m",ze).call(this,t,r))),o(this,G,Date.now(),"f")}async syncIfDue(){if(Date.now()-e(this,G,"f")<e(this,Q,"f"))return;await this.syncAll(!1)}async flushWrites(r){await Promise.all(e(this,L,"f").map((t)=>e(this,w,"m",Ge).call(this,t,r)))}async dispose(){for(let r of e(this,L,"f")){let t=r.files.root();try{let i=await e(this,w,"m",me).call(this,r);if(!i.markerOk&&Object.keys(i.files).length>0){e(this,p,"f").warn(`${i.distrustReason}; leaving the memory store folder on disk`,{root:t.path,memory_store_id:r.memoryStoreId});continue}await r.files.dispose()}catch(i){if(!(i instanceof y)&&!H(i))throw i;e(this,p,"f").warn("failed to remove the memory store folder",{root:r.files.root().path,memory_store_id:r.memoryStoreId,error:String(i)});continue}if(t.removedOnDispose)e(this,p,"f").info("removed memory store dir",{dest:t.path,memory_store_id:r.memoryStoreId})}}}return T=new WeakMap,le=new WeakMap,Q=new WeakMap,fe=new WeakMap,p=new WeakMap,G=new WeakMap,de=new WeakMap,L=new WeakMap,w=new WeakSet,qe=function(t){if(t.mount_path){if(!Ie(t.mount_path))throw new F(`memory store mount_path is not a clean absolute path: ${JSON.stringify(t.mount_path)} (memory_store_id=${t.memory_store_id})`);return t.mount_path}return P.join(e(this,le,"f"),"memory",t.name||t.memory_store_id)},me=async function(t){let i=await t.files.hashtree(),n=i[K];if(delete i[K],n===Qe(t.memoryStoreId))return{files:i,markerOk:!0,distrustReason:null};return{files:i,markerOk:!1,distrustReason:n!==void 0?"the marker file does not match this store":"the marker file is gone"}},ze=async function(t,i){try{let n=await e(this,w,"m",me).call(this,t),s=n.files;if(!n.markerOk){if(Object.keys(s).length>0){e(this,p,"f").warn(`${n.distrustReason}; leaving the memory store folder as found and not syncing`,{root:t.files.root().path,memory_store_id:t.memoryStoreId});return}await e(this,w,"m",Re).call(this,t,"the folder or its marker is gone");return}if(Object.keys(s).length===0&&t.baseline.size>1){await e(this,w,"m",Re).call(this,t,"every memory file is gone at once");return}let c=new Map;for await(let[m,_]of e(this,w,"m",ue).call(this,t.memoryStoreId))c.set(m,_);let l=new tt(e(this,fe,"f"),Math.max(Vt,Math.min(Xt,Math.floor(t.baseline.size/4))),i),f=[],h=new Map,d=[...new Set([...c.keys(),...Object.keys(s),...t.baseline.keys()])].sort();for(let m of d){let _=c.get(m),E=s[m],x=t.baseline.get(m),M;if(E===void 0&&x!==void 0&&_!==void 0&&_.content_sha256===x&&!t.readOnly)M=await e(this,w,"m",Je).call(this,t,m,_,x,l);else M=await e(this,w,"m",He).call(this,t,m,_,E,f);if(M!==void 0)h.set(m,M)}if(t.baseline=h,await e(this,w,"m",Ve).call(this,t,f),l.suppressed>0)e(this,p,"f").debug("remote deletes are disabled; locally deleted memories stay on the server",{count:l.suppressed,memory_store_id:t.memoryStoreId});if(l.capped>0)e(this,p,"f").warn(`delete cap reached: ${l.mode==="log_only"?"would send":"sent"} ${l.attempted} deletes, held ${l.capped} for later syncs`,{memory_store_id:t.memoryStoreId})}catch(n){e(this,p,"f").warn("memory sync failed",{memory_store_id:t.memoryStoreId,error:String(n)})}},Ge=async function(t,i){let n=new Map,s=new Set,c=async()=>{if(t.readOnly)return;let l=await e(this,w,"m",me).call(this,t);if(!l.markerOk){e(this,p,"f").warn(`${l.distrustReason}; not uploading anything from the memory store folder`,{root:t.files.root().path,memory_store_id:t.memoryStoreId});return}for(let[d,m]of Object.entries(l.files))if(m!==t.baseline.get(d)&&t.refusedShas.get(d)!==m)n.set(d,m),s.add(d);if(n.size===0||i?.aborted)return;let f=new Map;for await(let[d,m]of e(this,w,"m",ue).call(this,t.memoryStoreId)){if(i?.aborted)return;f.set(d,m)}let h=[];for(let d of[...n.keys()].sort()){let m=n.get(d),_=t.baseline.get(d),E=f.get(d);if(E!==void 0&&E.content_sha256===m){t.baseline.set(d,E.content_sha256),s.delete(d);continue}if(E!==void 0&&E.content_sha256!==_){e(this,p,"f").warn("memory changed both locally and remotely; the flush leaves the remote version",{path:d,memory_store_id:t.memoryStoreId}),s.delete(d);continue}h.push([d,m,E])}await e(this,w,"m",Xe).call(this,t,h,s,i)};try{if(await Zt(c(),i),i?.aborted&&s.size>0)e(this,p,"f").warn(`memory flush cut off part-way; ${s.size} of ${n.size} changed files had not finished uploading`,{memory_store_id:t.memoryStoreId})}catch(l){e(this,p,"f").warn("memory flush failed",{memory_store_id:t.memoryStoreId,error:String(l)})}},Re=async function(t,i){e(this,p,"f").warn(`${i}; re-downloading the memory store folder instead of syncing`,{root:t.files.root().path,memory_store_id:t.memoryStoreId}),await t.files.createRoot(),await e(this,w,"m",Ne).call(this,t)},Ne=async function(t){t.baseline=new Map,t.pendingDeletes.clear(),await t.files.put(K,`version ${et}
|
|
7
|
+
${t.memoryStoreId}`);for await(let[i,n]of e(this,w,"m",ue).call(this,t.memoryStoreId,"full"))if(await e(this,w,"m",Te).call(this,t,i,n.content??""))t.baseline.set(i,n.content_sha256)},He=async function(t,i,n,s,c){let l=t.baseline.get(i);if(s!==void 0)t.pendingDeletes.delete(i);if(!n){if(s===void 0){t.pendingDeletes.delete(i);return}if(l!==void 0){if(s===l){let _=await e(this,w,"m",Ke).call(this,t,i,l);if(_===void 0)return;if(_===l)return l;s=_}if(t.readOnly)e(this,p,"f").warn("memory deleted remotely but edited locally; keeping the file, which a read-only store cannot push",{path:i,memory_store_id:t.memoryStoreId});else if(t.refusedShas.get(i)!==s)e(this,p,"f").info("memory deleted remotely but edited locally; re-creating it from the file",{path:i,memory_store_id:t.memoryStoreId})}if(t.readOnly)return;if(t.refusedShas.get(i)===s)return;return await e(this,w,"m",pe).call(this,t,i,s,void 0)}let f=n.content_sha256,h=f!==l,d=s!==void 0&&s!==l&&s!==f,m=!t.readOnly&&d;if(s===void 0&&l!==void 0){if(h)e(this,p,"f").warn("memory deleted locally but changed remotely; restoring the remote version",{path:i,memory_store_id:t.memoryStoreId}),t.pendingDeletes.delete(i),c.push([i,n]);return l}if(h){if(s===f)return f;if(d)e(this,p,"f").warn("memory changed both locally and remotely; keeping the remote version",{path:i,memory_store_id:t.memoryStoreId});return c.push([i,n]),l}if(m){if(t.refusedShas.get(i)===s)return f;return await e(this,w,"m",pe).call(this,t,i,s,n)??f}return f},Ke=async function(t,i,n){let s;try{s=await t.files.hashFile(i)}catch(c){if(!(c instanceof y)&&!H(c))throw c;return n}if(s===null)return;if(s!==n)return s;try{await t.files.remove(i)}catch(c){if(!(c instanceof y)&&!H(c))throw c;return e(this,p,"f").warn("failed to remove memory deleted remotely",{path:i,memory_store_id:t.memoryStoreId,error:String(c)}),n}return},Te=async function(t,i,n){try{await t.files.put(i,n)}catch(s){if(!(s instanceof y)&&!H(s))throw s;return e(this,p,"f").warn("failed to write memory",{path:i,memory_store_id:t.memoryStoreId,error:String(s)}),!1}return!0},Ve=async function(t,i){if(i.length===0)return;let n=async(l,f)=>{let h;try{h=await e(this,T,"f").beta.memoryStores.memories.retrieve(f.id,{memory_store_id:t.memoryStoreId,view:"full"})}catch(d){if(he(d,404))return;e(this,p,"f").warn("failed to fetch memory content",{path:l,memory_store_id:t.memoryStoreId,error:String(d)});return}if(await e(this,w,"m",Te).call(this,t,l,h.content??""))t.baseline.set(l,h.content_sha256)},s=i[Symbol.iterator](),c=async()=>{for(let[l,f]of s)await n(l,f)};await Promise.all(Array.from({length:Math.min(Ht,i.length)},c))},Xe=async function(t,i,n,s){let c=i[Symbol.iterator](),l=async()=>{for(let[f,h,d]of c){if(s?.aborted)return;let m=await e(this,w,"m",pe).call(this,t,f,h,d);if(n.delete(f),m!==void 0)t.baseline.set(f,m)}};await Promise.all(Array.from({length:Math.min(Kt,i.length)},l))},ue=async function*(t,i="basic"){let n=i==="basic"?zt:Gt;for await(let s of e(this,T,"f").beta.memoryStores.memories.list(t,{view:i,limit:n})){if(s.type!=="memory")continue;let c=s.path.replace(/^\/+/,"");if(c===K){e(this,p,"f").warn("the server listed the reserved marker path; skipping",{path:s.path,memory_store_id:t});continue}yield[c,s]}},pe=async function r(t,i,n,s){try{let c=await t.files.get(i);if(c===null)return;let l=At(c),f=s?await e(this,T,"f").beta.memoryStores.memories.update(s.id,{memory_store_id:t.memoryStoreId,content:l,precondition:{type:"content_sha256",content_sha256:s.content_sha256}}):await e(this,T,"f").beta.memoryStores.memories.create(t.memoryStoreId,{path:"/"+i,content:l});return t.refusedShas.delete(i),f.content_sha256}catch(c){if(s&&he(c,404))return await e(this,w,"m",r).call(this,t,i,n,void 0);let l=c instanceof y||he(c,400)||he(c,413);if(s&&he(c,409))e(this,p,"f").warn("memory changed both locally and remotely; the upload was refused and the local edit loses",{path:i,memory_store_id:t.memoryStoreId});else if(l&&n!==void 0)t.refusedShas.set(i,n),e(this,p,"f").warn("the server rejected this memory file, so it stays un-synced until its content changes",{path:i,memory_store_id:t.memoryStoreId,rejection:String(c)});else e(this,p,"f").warn("failed to upload memory",{path:i,memory_store_id:t.memoryStoreId,error:String(c)});return}},Je=async function(t,i,n,s,c){if(c.mode==="disabled")return c.suppressed++,s;let l=t.pendingDeletes.get(i);if(l===void 0)l=Date.now(),t.pendingDeletes.set(i,l);if(!c.waiveWindow&&Date.now()-l<qt)return s;let f,h;try{f=await t.files.hashFile(K)===Qe(t.memoryStoreId),h=await t.files.hashFile(i)===null}catch(m){if(!(m instanceof y)&&!H(m))throw m;f=h=!1}if(!f)return s;if(!h)return t.pendingDeletes.delete(i),s;if(!c.takeSlot())return s;if(c.mode==="log_only")return e(this,p,"f").info("log-only: sync would delete this memory on the server",{path:i,memory_store_id:t.memoryStoreId}),s;let d=await e(this,w,"m",Ze).call(this,t,i,n,s);if(d===void 0)t.pendingDeletes.delete(i);return d},Ze=async function(t,i,n,s){try{await e(this,T,"f").beta.memoryStores.memories.delete(n.id,{memory_store_id:t.memoryStoreId,expected_content_sha256:s})}catch(c){if(he(c,404))return;if(he(c,409)||he(c,412))e(this,p,"f").warn("memory deleted locally but changed remotely; keeping the remote version",{path:i,memory_store_id:t.memoryStoreId});else e(this,p,"f").warn("failed to delete memory",{path:i,memory_store_id:t.memoryStoreId,error:String(c)});return s}e(this,p,"f").info("propagated local deletion",{path:i,memory_store_id:t.memoryStoreId});return},a})();function H(a){return typeof a==="object"&&a!==null&&typeof a.code==="string"}async function Zt(a,r){if(!r){await a;return}let t,i=new Promise((n)=>{if(t=n,r.aborted)n()});r.addEventListener("abort",t,{once:!0});try{await Promise.race([a,i])}finally{r.removeEventListener("abort",t)}}var ye,b,v,ee,W,N,Le,we,te,_e,ge,U,j,V,B,re,A,rt,it,nt=102400,ft=120000,Qt=262144,er=65536,ot=Buffer.from(`
|
|
8
8
|
`),ie=102400,tr=2000,rr=200;class dt extends u{constructor(a){super(`bash command timed out after ${a}ms`);this.name="BashTimeoutError",this.timeoutMs=a}}var ir=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,nr=S.glob;function ht(a){return a===void 0?Qt:a}function Y(a){if(a===void 0)return;throw new u("The `unrestrictedPaths` option you passed to the agent toolset (AgentToolContext) is no longer supported. The toolset's file tools (read, write, edit, glob, grep) are now always confined to the working directory plus the directories listed in `allowedRoots`. Remove `unrestrictedPaths` from your context; to let the file tools reach any other directory, add it to `allowedRoots`.")}function Xr(a){return[ar(a),cr(a),dr(a),hr(a),ur(a),pr(a)]}async function oe(a,r){return Y(a.unrestrictedPaths),Ae(a.workdir,r,{allowedRoots:a.allowedRoots??[]})}function mt(a,r){return Ee(a.readOnlyRoots??[],r)}function or(){let a={};for(let[r,t]of Object.entries(process.env)){if(r.startsWith("ANTHROPIC_"))continue;a[r]=t}return a}var sr=(()=>{class a{constructor(r,t=or()){ye.add(this),b.set(this,void 0),v.set(this,""),ee.set(this,!1),W.set(this,!1),N.set(this,null),o(this,b,$e.spawn("/bin/bash",["--noprofile","--norc"],{cwd:r,env:{...t,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),e(this,b,"f").stdout.setEncoding("utf8"),e(this,b,"f").stderr.setEncoding("utf8"),e(this,b,"f").stdout.on("data",(i)=>e(this,ye,"m",Le).call(this,i)),e(this,b,"f").stderr.on("data",(i)=>e(this,ye,"m",Le).call(this,i)),e(this,b,"f").once("close",()=>{o(this,W,!0,"f");let i=e(this,N,"f");o(this,N,null,"f"),i?.resolve()})}get closed(){return e(this,W,"f")}async exec(r,t={}){if(e(this,W,"f"))throw new u("bash session terminated");let i=t.timeoutMs??ft,n=t.signal;n?.throwIfAborted(),o(this,v,"","f"),o(this,ee,!1,"f");let s=`__ANT_CMD_${at.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${r}
|
|
9
9
|
} </dev/null 2>&1; printf '\\n${c}%d\\n' $?
|
|
10
|
-
`;if(e(this,b,"f").stdin.write(l),e(this,v,"f").indexOf(s)<0){let{promise:E,resolve:
|
|
11
|
-
${_}`;return{output:_,exitCode:m}}close(){if(e(this,W,"f"))return;o(this,W,!0,"f");let r=e(this,N,"f");o(this,N,null,"f"),r?.resolve(),e(this,b,"f").stdout.destroy(),e(this,b,"f").stderr.destroy(),e(this,b,"f").stdin.destroy();try{process.kill(-e(this,b,"f").pid,"SIGKILL")}catch{e(this,b,"f").kill("SIGKILL")}e(this,b,"f").unref()}}return b=new WeakMap,v=new WeakMap,ee=new WeakMap,W=new WeakMap,N=new WeakMap,ye=new WeakSet,Le=function(t){if(o(this,v,e(this,v,"f")+t,"f"),e(this,v,"f").length>nt)o(this,v,e(this,v,"f").slice(e(this,v,"f").length-nt),"f"),o(this,ee,!0,"f");if(e(this,N,"f")&&e(this,v,"f").indexOf(e(this,N,"f").sentinel)>=0){let i=e(this,N,"f");o(this,N,null,"f"),i.resolve()}},a})();function ar(a){Y(a.unrestrictedPaths);let r,t=Promise.resolve();return
|
|
10
|
+
`;if(e(this,b,"f").stdin.write(l),e(this,v,"f").indexOf(s)<0){let{promise:E,resolve:x}=$t();o(this,N,{sentinel:s,resolve:x},"f");let M,se;try{await Promise.race([E,new Promise((pt,Se)=>{M=setTimeout(()=>Se(new dt(i)),i)}),new Promise((pt,Se)=>{if(!n)return;se=()=>Se(n.reason),n.addEventListener("abort",se,{once:!0})})])}finally{if(M)clearTimeout(M);if(se&&n)n.removeEventListener("abort",se);o(this,N,null,"f")}}let f=e(this,v,"f").indexOf(s);if(f<0)throw new u("bash session terminated");let d=e(this,v,"f").slice(f+s.length).match(/^(-?\d+)/),m=d?parseInt(d[1],10):-1,_=e(this,v,"f").slice(0,f).replace(ir,"").replace(/\n+$/,"");if(e(this,ee,"f"))_=`[output truncated]
|
|
11
|
+
${_}`;return{output:_,exitCode:m}}close(){if(e(this,W,"f"))return;o(this,W,!0,"f");let r=e(this,N,"f");o(this,N,null,"f"),r?.resolve(),e(this,b,"f").stdout.destroy(),e(this,b,"f").stderr.destroy(),e(this,b,"f").stdin.destroy();try{process.kill(-e(this,b,"f").pid,"SIGKILL")}catch{e(this,b,"f").kill("SIGKILL")}e(this,b,"f").unref()}}return b=new WeakMap,v=new WeakMap,ee=new WeakMap,W=new WeakMap,N=new WeakMap,ye=new WeakSet,Le=function(t){if(o(this,v,e(this,v,"f")+t,"f"),e(this,v,"f").length>nt)o(this,v,e(this,v,"f").slice(e(this,v,"f").length-nt),"f"),o(this,ee,!0,"f");if(e(this,N,"f")&&e(this,v,"f").indexOf(e(this,N,"f").sentinel)>=0){let i=e(this,N,"f");o(this,N,null,"f"),i.resolve()}},a})();function ar(a){Y(a.unrestrictedPaths);let r,t=Promise.resolve();return D({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:async({command:i,restart:n,timeout_ms:s},c)=>{let l=t,f=$t();t=f.promise;try{await l}catch{}try{if(n)r?.close(),r=void 0;if(!i){if(n)return"bash session restarted";throw new R("bash: command is required")}r??(r=new sr(a.workdir,a.env));try{let{output:h,exitCode:d}=await r.exec(i,{timeoutMs:s??ft,signal:c?.signal});if(d!==0)throw new R(h||`exit ${d}`);return h}catch(h){if(h instanceof R)throw h;throw r.close(),r=void 0,new R(`bash: ${h instanceof Error?h.message:String(h)}`)}}finally{f.resolve()}},close:()=>{r?.close(),r=void 0}})}function cr(a){return Y(a.unrestrictedPaths),D({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:async({file_path:r,view_range:t})=>{if(!r)throw new R("read: file_path is required");let i=await oe(a,r);if(t?.length&&t.length!==2)throw new R("read: view_range must be [start_line, end_line]");let n;try{let d=await S.stat(i);if(!d.isFile())throw new R(`read: ${r} is not a regular file`);let m=ht(a.maxFileBytes);if(m!==null&&d.size>m){if(!t?.length)throw new R(`read: ${r} is ${d.size} bytes, exceeds ${m}-byte limit. Use the view_range parameter to read specific line ranges, e.g. view_range: [1, 500].`);let[_,E]=t;return await lr(i,r,_,E,m)}n=await S.readFile(i,"utf8")}catch(d){if(d instanceof R)throw d;throw new R(`read: ${q(d,r)}`)}if(!t?.length)return n;let[s,c]=t,l=n.split(`
|
|
12
12
|
`),f=Math.max(0,s-1),h=c>0?c:l.length;return l.slice(f,h).join(`
|
|
13
|
-
`)}})}async function lr(a,r,t,i,n){let s=new fr(r,t,i,n);if(s.rangeIsEmpty())return"";let c=ne.createReadStream(a,{highWaterMark:er});try{for await(let l of c)if(s.collectFrom(l),s.rangeIsCollected())break}finally{c.destroy()}return s.text()}var fr=(()=>{class a{constructor(r,t,i,n){we.add(this),te.set(this,void 0),_e.set(this,void 0),ge.set(this,void 0),U.set(this,void 0),j.set(this,void 0),V.set(this,void 0),B.set(this,0),re.set(this,[]),
|
|
14
|
-
`)}})}function pr(a){return Y(a.unrestrictedPaths),
|
|
13
|
+
`)}})}async function lr(a,r,t,i,n){let s=new fr(r,t,i,n);if(s.rangeIsEmpty())return"";let c=ne.createReadStream(a,{highWaterMark:er});try{for await(let l of c)if(s.collectFrom(l),s.rangeIsCollected())break}finally{c.destroy()}return s.text()}var fr=(()=>{class a{constructor(r,t,i,n){we.add(this),te.set(this,void 0),_e.set(this,void 0),ge.set(this,void 0),U.set(this,void 0),j.set(this,void 0),V.set(this,void 0),B.set(this,0),re.set(this,[]),A.set(this,0),o(this,te,r,"f"),o(this,_e,t,"f"),o(this,ge,i,"f"),o(this,U,Math.max(0,t-1),"f"),o(this,j,i>0?i:1/0,"f"),o(this,V,n,"f")}rangeIsEmpty(){return e(this,j,"f")<=e(this,U,"f")}rangeIsCollected(){return e(this,B,"f")>=e(this,j,"f")}collectFrom(r){var t;let i=0;while(i<r.length&&!this.rangeIsCollected()){let n=r.indexOf(10,i),s=n<0?r.length:n;if(e(this,B,"f")>=e(this,U,"f"))e(this,we,"m",rt).call(this,r.subarray(i,s),n>=0);if(n<0)break;o(this,B,(t=e(this,B,"f"),t++,t),"f"),i=n+1}}text(){return Buffer.concat(e(this,re,"f"),e(this,A,"f")).toString("utf8")}}return te=new WeakMap,_e=new WeakMap,ge=new WeakMap,U=new WeakMap,j=new WeakMap,V=new WeakMap,B=new WeakMap,re=new WeakMap,A=new WeakMap,we=new WeakSet,rt=function(t,i){if(e(this,re,"f").push(t),o(this,A,e(this,A,"f")+t.length,"f"),i&&e(this,B,"f")+1<e(this,j,"f"))e(this,re,"f").push(ot),o(this,A,e(this,A,"f")+ot.length,"f");if(e(this,A,"f")>e(this,V,"f"))throw e(this,we,"m",it).call(this)},it=function(){if(e(this,j,"f")-e(this,U,"f")===1)return new R(`read: line ${e(this,U,"f")+1} of ${e(this,te,"f")} alone exceeds ${e(this,V,"f")}-byte limit. The read tool cannot return part of a line, so view_range cannot narrow this further.`);return new R(`read: view_range [${e(this,_e,"f")}, ${e(this,ge,"f")}] of ${e(this,te,"f")} exceeds ${e(this,V,"f")}-byte limit. Narrow the view_range to read a smaller portion.`)},a})();function dr(a){return Y(a.unrestrictedPaths),D({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:async({file_path:r,content:t})=>{if(!r)throw new R("write: file_path is required");let i=await oe(a,r),n=await mt(a,i);if(n!==void 0)throw new R(`write: ${r} is inside read-only directory ${n}`);try{await S.mkdir(O.dirname(i),{recursive:!0,mode:J}),await be(i,t??"")}catch(s){throw new R(`write: ${q(s,r)}`)}return`wrote ${Buffer.byteLength(t??"")} bytes to ${r}`}})}function hr(a){return Y(a.unrestrictedPaths),D({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:async({file_path:r,old_string:t,new_string:i,replace_all:n})=>{if(!r)throw new R("edit: file_path is required");if(!t)throw new R("edit: old_string is required");let s=await oe(a,r),c=await mt(a,s);if(c!==void 0)throw new R(`edit: ${r} is inside read-only directory ${c}`);let l;try{let d=await S.stat(s);if(!d.isFile())throw new R(`edit: ${r} is not a regular file`);let m=ht(a.maxFileBytes);if(m!==null&&d.size>m)throw new R(`edit: ${r} is ${d.size} bytes, exceeds ${m}-byte limit. The edit tool loads the whole file and cannot modify a file this large.`);l=await S.readFile(s,"utf8")}catch(d){if(d instanceof R)throw d;throw new R(`edit: ${q(d,r)}`)}let f=l.split(t).length-1;if(f===0)throw new R(`edit: old_string not found in ${r}`);let h;if(n)h=l.split(t).join(i);else{if(f>1)throw new R(`edit: old_string appears ${f} times in ${r} (must be unique)`);h=l.replace(t,()=>i)}try{await be(s,h)}catch(d){throw new R(`edit: write: ${q(d,r)}`)}return`edited ${r} (${n?f:1} replacement(s))`}})}function mr(a){return a.split(/[\\/{},]/).includes("..")}function ur(a){return Y(a.unrestrictedPaths),D({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:async({pattern:r,path:t})=>{if(!r)throw new R("glob: pattern is required");if(O.isAbsolute(r))throw new R("glob: absolute pattern not permitted; pass a relative pattern (and optionally path)");if(mr(r))throw new R('glob: ".." is not permitted in the pattern');let i=t?await oe(a,t):O.resolve(a.workdir),n=t?i:await X(i),s=[],c=ut;try{for await(let l of nr(r,{cwd:i,withFileTypes:!0,exclude:(f)=>f.name===".git"||f.name==="node_modules"})){if(c--<=0)break;if(!l.isFile())continue;let f=O.join(l.parentPath,l.name),h;try{h=await S.realpath(f)}catch{continue}if(!ae(n,h))continue;let d=0;try{d=(await S.stat(f)).mtimeMs}catch{}s.push({path:f,mtime:d})}}catch(l){throw new R(`glob: ${l instanceof Error?l.message:String(l)}`)}if(s.length===0)return"no matches";return s.sort((l,f)=>f.mtime-l.mtime),s.slice(0,rr).map((l)=>l.path).join(`
|
|
14
|
+
`)}})}function pr(a){return Y(a.unrestrictedPaths),D({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:async({pattern:r,path:t},i)=>{if(!r)throw new R("grep: pattern is required");let n=O.resolve(a.workdir);if(t)n=await oe(a,t);let s=await Sr();return s?yr(s,r,n,i?.signal):wr(r,n,i?.signal)}})}function yr(a,r,t,i){return new Promise((n,s)=>{let c=$e.spawn(a,["-n","--no-heading","-e",r,"--",t],{...i?{signal:i}:{}}),l="",f="",h=!1;c.stdout.on("data",(d)=>{if(h)return;if(l+=d,l.length>ie)h=!0,l=l.slice(0,ie),c.kill("SIGKILL")}),c.stderr.on("data",(d)=>f+=d),c.on("close",(d)=>{if(i?.aborted)return s(new R("grep: aborted"));if(h)return n(l+`
|
|
15
15
|
[output truncated at ${ie} bytes]`);if(d===0)return n(l);if(d===1)return n("no matches");s(new R(`grep: rg failed: ${f||`exit ${d}`}`))}),c.on("error",(d)=>{if(i?.aborted)return s(new R("grep: aborted"));s(new R(`grep: rg failed: ${d.message}`))})})}async function wr(a,r,t){let i;try{i=new RegExp(a)}catch(f){throw new R(`grep: invalid regex: ${f instanceof Error?f.message:String(f)}`)}let n=[],s=ie,c=(f)=>{if(s-=f.length+1,s<0)return n.push(`[output truncated at ${ie} bytes]`),!1;return n.push(f),!0};if((await S.stat(r).catch(()=>null))?.isFile())await st(r,i,c);else await gr(r,"",(f)=>st(O.join(r,f),i,c),t);if(t?.aborted)throw new R("grep: aborted");if(n.length===0)return"no matches";return n.join(`
|
|
16
|
-
`)}async function st(a,r,t){let i=ne.createReadStream(a,{encoding:"utf8"}),n=lt.createInterface({input:i,crlfDelay:1/0}),s=0;try{for await(let c of n){if(s++,c.length>tr)continue;if(r.test(c)&&!t(`${a}:${s}:${c}`))return!1}}catch{}finally{i.destroy()}return!0}var _r=40,ut=50000;async function gr(a,r,t,i){let n=ut;async function s(c,l){if(l>_r)return!0;if(i?.aborted)return!1;let f;try{f=await S.readdir(O.join(a,c),{withFileTypes:!0})}catch{return!0}for(let h of f){if(h.name===".git"||h.name==="node_modules")continue;if(n--<=0)return!1;if(i?.aborted)return!1;let d=c?O.join(c,h.name):h.name;if(h.isDirectory()){if(!await s(d,l+1))return!1}else if(h.isFile()){if(await t(d)===!1)return!1}}return!0}await s(r,0)}async function Sr(){let a=(process.env.PATH??"").split(O.delimiter);for(let r of a){let t=O.join(r,"rg");try{return await S.access(t,ne.constants.X_OK),t}catch{}}return null}export{Yt as MEMORY_FLUSH_TIMEOUT_MS,
|
|
16
|
+
`)}async function st(a,r,t){let i=ne.createReadStream(a,{encoding:"utf8"}),n=lt.createInterface({input:i,crlfDelay:1/0}),s=0;try{for await(let c of n){if(s++,c.length>tr)continue;if(r.test(c)&&!t(`${a}:${s}:${c}`))return!1}}catch{}finally{i.destroy()}return!0}var _r=40,ut=50000;async function gr(a,r,t,i){let n=ut;async function s(c,l){if(l>_r)return!0;if(i?.aborted)return!1;let f;try{f=await S.readdir(O.join(a,c),{withFileTypes:!0})}catch{return!0}for(let h of f){if(h.name===".git"||h.name==="node_modules")continue;if(n--<=0)return!1;if(i?.aborted)return!1;let d=c?O.join(c,h.name):h.name;if(h.isDirectory()){if(!await s(d,l+1))return!1}else if(h.isFile()){if(await t(d)===!1)return!1}}return!0}await s(r,0)}async function Sr(){let a=(process.env.PATH??"").split(O.delimiter);for(let r of a){let t=O.join(r,"rg");try{return await S.access(t,ne.constants.X_OK),t}catch{}}return null}export{Yt as MEMORY_FLUSH_TIMEOUT_MS,F as SessionMemoryError,Jt as SessionMemoryStores,Xr as betaAgentToolset20260401,gt as setupSkills};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{p}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{p}from"./chunk-qd2enpr2.js";var n=null;function c(e){if(typeof process>"u"||!process.versions?.bun||Object.keys(process.env).length>0)return;if(n===null){n=new Map;try{let{readFileSync:t}=p("fs"),s=t("/proc/self/environ","utf-8");for(let r of s.split("\x00")){let o=r.indexOf("=");if(o>0)n.set(r.slice(0,o),r.slice(o+1))}}catch{}}return n.get(e)}function _(e,t){return t?.[e]||(typeof process<"u"?process.env[e]:void 0)||c(e)||void 0}
|
|
3
|
+
export{_};
|