@easbot/ollama-sdk 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1 +1,7 @@
1
- import {createOllama}from'ai-sdk-ollama';var S=Object.defineProperty;var A=(r,a,e)=>a in r?S(r,a,{enumerable:true,configurable:true,writable:true,value:e}):r[a]=e;var l=(r,a,e)=>A(r,typeof a!="symbol"?a+"":a,e);async function*I(r,a){let e="txt-0",o="reasoning-0",n=false,d=false,p=false,v=false,L=false,y=null,c,h=r.getReader();try{for(;;){let{done:P,value:t}=await h.read();if(P)break;if(!(t.type==="text-start"||t.type==="text-end")&&!(t.type==="reasoning-start"||t.type==="reasoning-end")){if(t.type==="reasoning-delta"){p||(yield {type:"reasoning-start",id:o,providerMetadata:t.providerMetadata},p=!0,v=!0),t.providerMetadata&&(c=t.providerMetadata),yield {type:"reasoning-delta",id:o,delta:t.delta,providerMetadata:t.providerMetadata};continue}if(t.type==="text-delta"){n||(yield {type:"text-start",id:e,providerMetadata:t.providerMetadata},n=!0,d=!0),t.providerMetadata&&(c=t.providerMetadata),yield {type:"text-delta",id:e,delta:t.delta,providerMetadata:t.providerMetadata};continue}if(t.type==="finish"){L=!0,y=t;continue}yield t;}}}finally{h.releaseLock();}v&&(yield {type:"reasoning-end",id:o,providerMetadata:c}),d&&(yield {type:"text-end",id:e,providerMetadata:c}),L&&y?yield y:yield {type:"finish",finishReason:"stop",usage:{inputTokens:0,outputTokens:0,totalTokens:0}};}var g={numCtx:4096,temperature:.7,topK:40,topP:.9,repeatPenalty:1.1,numPredict:2048},E=["numCtx","repeatPenalty","numPredict"];var i=class{constructor(a,e={}){l(this,"specificationVersion","v2");l(this,"provider","ollama");l(this,"modelId");l(this,"defaultObjectGenerationMode","json");l(this,"supportedUrls",{});l(this,"baseModel");this.modelId=a;let o=createOllama(e);this.baseModel=o(a,{options:g});}async doGenerate(a){return this.baseModel.doGenerate(a)}async doStream(a){let e=await this.baseModel.doStream(a),o=this.modelId,n=new ReadableStream({async start(d){try{for await(let p of I(e.stream,{modelId:o}))d.enqueue(p);d.close();}catch(p){d.error(p);}},cancel(){}});return {...e,stream:n}}};function b(r={}){return Object.assign(e=>new i(e,r),{languageModel:e=>new i(e,r),chat:e=>new i(e,r)})}var w="0.1.0";var s=class extends Error{constructor(e,o){super(e);this.cause=o;this.name="OllamaError",Object.setPrototypeOf(this,new.target.prototype);}},M=class extends s{constructor(e,o,n){super(e,n);this.url=o;this.name="ConnectionError";}},f=class extends s{constructor(e,o){super(`Model not found: ${e}`,o);this.modelId=e;this.name="ModelNotFoundError";}},O=class extends s{constructor(e,o,n,d){super(e,d);this.field=o;this.value=n;this.name="ValidationError";}},x=class extends s{constructor(e,o,n){super(e,n);this.timeoutMs=o;this.name="TimeoutError";}};export{M as ConnectionError,f as ModelNotFoundError,g as OLLAMA_DEFAULT_OPTIONS,E as OLLAMA_SPECIFIC_PARAMS,s as OllamaError,i as OllamaLanguageModel,x as TimeoutError,w as VERSION,O as ValidationError,b as createOllama};
1
+ import On,{win32,posix}from'path';import kn,{realpath,readlink,readdir,lstat}from'fs/promises';import*as Ho from'fs';import {realpathSync,createWriteStream,readlinkSync,readdirSync,readdir as readdir$1,lstatSync}from'fs';import La from'zod';import {fileURLToPath}from'url';import {EventEmitter}from'events';import Kr from'stream';import {StringDecoder}from'string_decoder';var Ln=Object.defineProperty;var Ii=e=>{throw TypeError(e)};var _n=(e,t,s)=>t in e?Ln(e,t,{enumerable:true,configurable:true,writable:true,value:s}):e[t]=s;var p=(e,t,s)=>_n(e,typeof t!="symbol"?t+"":t,s),oi=(e,t,s)=>t.has(e)||Ii("Cannot "+s);var r=(e,t,s)=>(oi(e,t,"read from private field"),s?s.call(e):t.get(e)),y=(e,t,s)=>t.has(e)?Ii("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),u=(e,t,s,i)=>(oi(e,t,"write to private field"),t.set(e,s),s),m=(e,t,s)=>(oi(e,t,"access private method"),s);var As=(e,t,s,i)=>({set _(n){u(e,t,n);},get _(){return r(e,t,i)}});var Ms=class{constructor(t="http://localhost:11434"){this.baseURL=t;}async*streamChat(t){let s=await fetch(`${this.baseURL}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,stream:true})});if(!s.ok)throw new Error(`Ollama API error: ${s.status} ${s.statusText}`);if(!s.body)throw new Error("Response body is null");let i=s.body.getReader(),n=new TextDecoder,o="";try{for(;;){let{done:a,value:h}=await i.read();if(a){if(o.trim())try{yield JSON.parse(o);}catch{console.error("Failed to parse final chunk:",o);}break}o+=n.decode(h,{stream:!0});let l=o.split(`
2
+ `);o=l.pop()||"";for(let c of l){let f=c.trim();if(f)try{yield JSON.parse(f);}catch{console.error("Failed to parse chunk:",f);}}}}finally{i.releaseLock();}}async chat(t){let s=await fetch(`${this.baseURL}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,stream:false})});if(!s.ok)throw new Error(`Ollama API error: ${s.status} ${s.statusText}`);return s.json()}};var Te={numCtx:32768,temperature:.7,topK:40,topP:.9,repeatPenalty:1.1,numPredict:32e3},Fn=["numCtx","repeatPenalty","numPredict"];var Yt=class extends Error{constructor(s,i){super(s);this.cause=i;this.name="OllamaError",Object.setPrototypeOf(this,new.target.prototype);}},ai=class extends Yt{constructor(s,i,n){super(s,n);this.url=i;this.name="ConnectionError";}},hi=class extends Yt{constructor(s,i){super(`Model not found: ${s}`,i);this.modelId=s;this.name="ModelNotFoundError";}},li=class extends Yt{constructor(s,i,n,o){super(s,o);this.field=i;this.value=n;this.name="ValidationError";}},ci=class extends Yt{constructor(s,i,n){super(s,n);this.timeoutMs=i;this.name="TimeoutError";}},Ve=class extends Yt{constructor(s,i,n){super(`Invalid tool definition for "${s}": missing ${i}`,n);this.toolName=s;this.missingField=i;this.name="InvalidToolDefinitionError";}};var _r=(e,t,s)=>{let i=e instanceof RegExp?zi(e,s):e,n=t instanceof RegExp?zi(t,s):t,o=i!==null&&n!=null&&Pn(i,n,s);return o&&{start:o[0],end:o[1],pre:s.slice(0,o[0]),body:s.slice(o[0]+i.length,o[1]),post:s.slice(o[1]+n.length)}},zi=(e,t)=>{let s=t.match(e);return s?s[0]:null},Pn=(e,t,s)=>{let i,n,o,a,h,l=s.indexOf(e),c=s.indexOf(t,l+1),f=l;if(l>=0&&c>0){if(e===t)return [l,c];for(i=[],o=s.length;f>=0&&!h;){if(f===l)i.push(f),l=s.indexOf(e,f+1);else if(i.length===1){let d=i.pop();d!==void 0&&(h=[d,c]);}else n=i.pop(),n!==void 0&&n<o&&(o=n,a=c),c=s.indexOf(t,f+1);f=l<c&&l>=0?l:c;}i.length&&a!==void 0&&(h=[o,a]);}return h},Fr="\0SLASH"+Math.random()+"\0",Pr="\0OPEN"+Math.random()+"\0",Fi="\0CLOSE"+Math.random()+"\0",Dr="\0COMMA"+Math.random()+"\0",Nr="\0PERIOD"+Math.random()+"\0",Dn=new RegExp(Fr,"g"),Nn=new RegExp(Pr,"g"),Wn=new RegExp(Fi,"g"),jn=new RegExp(Dr,"g"),In=new RegExp(Nr,"g"),zn=/\\\\/g,$n=/\\{/g,Bn=/\\}/g,Un=/\\,/g,Gn=/\\./g,Vn=1e5;function ui(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function qn(e){return e.replace(zn,Fr).replace($n,Pr).replace(Bn,Fi).replace(Un,Dr).replace(Gn,Nr)}function Jn(e){return e.replace(Dn,"\\").replace(Nn,"{").replace(Wn,"}").replace(jn,",").replace(In,".")}function Wr(e){if(!e)return [""];let t=[],s=_r("{","}",e);if(!s)return e.split(",");let{pre:i,body:n,post:o}=s,a=i.split(",");a[a.length-1]+="{"+n+"}";let h=Wr(o);return o.length&&(a[a.length-1]+=h.shift(),a.push.apply(a,h)),t.push.apply(t,a),t}function Hn(e,t={}){if(!e)return [];let{max:s=Vn}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Qe(qn(e),s,true).map(Jn)}function Zn(e){return "{"+e+"}"}function Kn(e){return /^-?0\d/.test(e)}function Yn(e,t){return e<=t}function Qn(e,t){return e>=t}function Qe(e,t,s){let i=[],n=_r("{","}",e);if(!n)return [e];let o=n.pre,a=n.post.length?Qe(n.post,t,false):[""];if(/\$$/.test(n.pre))for(let h=0;h<a.length&&h<t;h++){let l=o+"{"+n.body+"}"+a[h];i.push(l);}else {let h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),c=h||l,f=n.body.indexOf(",")>=0;if(!c&&!f)return n.post.match(/,(?!,).*\}/)?(e=n.pre+"{"+n.body+Fi+n.post,Qe(e,t,true)):[e];let d;if(c)d=n.body.split(/\.\./);else if(d=Wr(n.body),d.length===1&&d[0]!==void 0&&(d=Qe(d[0],t,false).map(Zn),d.length===1))return a.map(v=>n.pre+d[0]+v);let g;if(c&&d[0]!==void 0&&d[1]!==void 0){let v=ui(d[0]),x=ui(d[1]),w=Math.max(d[0].length,d[1].length),k=d.length===3&&d[2]!==void 0?Math.abs(ui(d[2])):1,b=Yn;x<v&&(k*=-1,b=Qn);let C=d.some(Kn);g=[];for(let R=v;b(R,x);R+=k){let O;if(l)O=String.fromCharCode(R),O==="\\"&&(O="");else if(O=String(R),C){let E=w-O.length;if(E>0){let A=new Array(E+1).join("0");R<0?O="-"+A+O.slice(1):O=A+O;}}g.push(O);}}else {g=[];for(let v=0;v<d.length;v++)g.push.apply(g,Qe(d[v],t,false));}for(let v=0;v<g.length;v++)for(let x=0;x<a.length&&i.length<t;x++){let w=o+g[v]+a[x];(!s||c||w)&&i.push(w);}}return i}var Js=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},Xn={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x00-\\x7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]},qe=e=>e.replace(/[[\]\\-]/g,"\\$&"),to=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),$i=e=>e.join(""),eo=(e,t)=>{let s=t;if(e.charAt(s)!=="[")throw new Error("not in a brace expression");let i=[],n=[],o=s+1,a=false,h=false,l=false,c=false,f=s,d="";t:for(;o<e.length;){let x=e.charAt(o);if((x==="!"||x==="^")&&o===s+1){c=true,o++;continue}if(x==="]"&&a&&!l){f=o+1;break}if(a=true,x==="\\"&&!l){l=true,o++;continue}if(x==="["&&!l){for(let[w,[k,b,C]]of Object.entries(Xn))if(e.startsWith(w,o)){if(d)return ["$.",false,e.length-s,true];o+=w.length,C?n.push(k):i.push(k),h=h||b;continue t}}if(l=false,d){x>d?i.push(qe(d)+"-"+qe(x)):x===d&&i.push(qe(x)),d="",o++;continue}if(e.startsWith("-]",o+1)){i.push(qe(x+"-")),o+=2;continue}if(e.startsWith("-",o+1)){d=x,o+=2;continue}i.push(qe(x)),o++;}if(f<o)return ["",false,0,false];if(!i.length&&!n.length)return ["$.",false,e.length-s,true];if(n.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!c){let x=i[0].length===2?i[0].slice(-1):i[0];return [to(x),false,f-s,false]}let g="["+(c?"^":"")+$i(i)+"]",v="["+(c?"":"^")+$i(n)+"]";return [i.length&&n.length?"("+g+"|"+v+")":i.length?g:v,h,f-s,true]},Le=(e,{windowsPathsNoEscape:t=false,magicalBraces:s=true}={})=>s?t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?e.replace(/\[([^\/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1"),so=new Set(["!","?","+","*","@"]),Bi=e=>so.has(e),io="(?!(?:^|/)\\.\\.?(?:$|/))",Ls="(?!\\.)",ro=new Set(["[","."]),no=new Set(["..","."]),oo=new Set("().*{}+?[]^$\\!"),ao=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Pi="[^/]",Ui=Pi+"*?",Gi=Pi+"+?",z,J,Ut,D,j,ie,ge,re,Dt,me,ns,Ce,Ir,ce,Y,Is,bi,zr,jr=(Y=class{constructor(t,s,i={}){y(this,Ce);p(this,"type");y(this,z);y(this,J);y(this,Ut,false);y(this,D,[]);y(this,j);y(this,ie);y(this,ge);y(this,re,false);y(this,Dt);y(this,me);y(this,ns,false);this.type=t,t&&u(this,J,true),u(this,j,s),u(this,z,r(this,j)?r(r(this,j),z):this),u(this,Dt,r(this,z)===this?i:r(r(this,z),Dt)),u(this,ge,r(this,z)===this?[]:r(r(this,z),ge)),t==="!"&&!r(r(this,z),re)&&r(this,ge).push(this),u(this,ie,r(this,j)?r(r(this,j),D).length:0);}get hasMagic(){if(r(this,J)!==void 0)return r(this,J);for(let t of r(this,D))if(typeof t!="string"&&(t.type||t.hasMagic))return u(this,J,true);return r(this,J)}toString(){return r(this,me)!==void 0?r(this,me):this.type?u(this,me,this.type+"("+r(this,D).map(t=>String(t)).join("|")+")"):u(this,me,r(this,D).map(t=>String(t)).join(""))}push(...t){for(let s of t)if(s!==""){if(typeof s!="string"&&!(s instanceof Y&&r(s,j)===this))throw new Error("invalid part: "+s);r(this,D).push(s);}}toJSON(){let t=this.type===null?r(this,D).slice().map(s=>typeof s=="string"?s:s.toJSON()):[this.type,...r(this,D).map(s=>s.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===r(this,z)||r(r(this,z),re)&&r(this,j)?.type==="!")&&t.push({}),t}isStart(){if(r(this,z)===this)return true;if(!r(this,j)?.isStart())return false;if(r(this,ie)===0)return true;let t=r(this,j);for(let s=0;s<r(this,ie);s++){let i=r(t,D)[s];if(!(i instanceof Y&&i.type==="!"))return false}return true}isEnd(){if(r(this,z)===this||r(this,j)?.type==="!")return true;if(!r(this,j)?.isEnd())return false;if(!this.type)return r(this,j)?.isEnd();let t=r(this,j)?r(r(this,j),D).length:0;return r(this,ie)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this));}clone(t){let s=new Y(this.type,t);for(let i of r(this,D))s.copyIn(i);return s}static fromGlob(t,s={}){var n;let i=new Y(null,void 0,s);return m(n=Y,ce,Is).call(n,t,i,0,s),i}toMMPattern(){if(this!==r(this,z))return r(this,z).toMMPattern();let t=this.toString(),[s,i,n,o]=this.toRegExpSource();if(!(n||r(this,J)||r(this,Dt).nocase&&!r(this,Dt).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;let a=(r(this,Dt).nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${s}$`,a),{_src:s,_glob:t})}get options(){return r(this,Dt)}toRegExpSource(t){let s=t??!!r(this,Dt).dot;if(r(this,z)===this&&m(this,Ce,Ir).call(this),!this.type){let l=this.isStart()&&this.isEnd()&&!r(this,D).some(g=>typeof g!="string"),c=r(this,D).map(g=>{var b;let[v,x,w,k]=typeof g=="string"?m(b=Y,ce,zr).call(b,g,r(this,J),l):g.toRegExpSource(t);return u(this,J,r(this,J)||w),u(this,Ut,r(this,Ut)||k),v}).join(""),f="";if(this.isStart()&&typeof r(this,D)[0]=="string"&&!(r(this,D).length===1&&no.has(r(this,D)[0]))){let g=ro,v=s&&g.has(c.charAt(0))||c.startsWith("\\.")&&g.has(c.charAt(2))||c.startsWith("\\.\\.")&&g.has(c.charAt(4)),x=!s&&!t&&g.has(c.charAt(0));f=v?io:x?Ls:"";}let d="";return this.isEnd()&&r(r(this,z),re)&&r(this,j)?.type==="!"&&(d="(?:$|\\/)"),[f+c+d,Le(c),u(this,J,!!r(this,J)),r(this,Ut)]}let i=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",o=m(this,Ce,bi).call(this,s);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){let l=this.toString();return u(this,D,[l]),this.type=null,u(this,J,void 0),[l,Le(this.toString()),false,false]}let a=!i||t||s||!Ls?"":m(this,Ce,bi).call(this,true);a===o&&(a=""),a&&(o=`(?:${o})(?:${a})*?`);let h="";if(this.type==="!"&&r(this,ns))h=(this.isStart()&&!s?Ls:"")+Gi;else {let l=this.type==="!"?"))"+(this.isStart()&&!s&&!t?Ls:"")+Ui+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;h=n+o+l;}return [h,Le(o),u(this,J,!!r(this,J)),r(this,Ut)]}},z=new WeakMap,J=new WeakMap,Ut=new WeakMap,D=new WeakMap,j=new WeakMap,ie=new WeakMap,ge=new WeakMap,re=new WeakMap,Dt=new WeakMap,me=new WeakMap,ns=new WeakMap,Ce=new WeakSet,Ir=function(){if(this!==r(this,z))throw new Error("should only call on root");if(r(this,re))return this;this.toString(),u(this,re,true);let t;for(;t=r(this,ge).pop();){if(t.type!=="!")continue;let s=t,i=r(s,j);for(;i;){for(let n=r(s,ie)+1;!i.type&&n<r(i,D).length;n++)for(let o of r(t,D)){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(r(i,D)[n]);}s=i,i=r(s,j);}}return this},ce=new WeakSet,Is=function(t,s,i,n){var v,x;let o=false,a=false,h=-1,l=false;if(s.type===null){let w=i,k="";for(;w<t.length;){let b=t.charAt(w++);if(o||b==="\\"){o=!o,k+=b;continue}if(a){w===h+1?(b==="^"||b==="!")&&(l=true):b==="]"&&!(w===h+2&&l)&&(a=false),k+=b;continue}else if(b==="["){a=true,h=w,l=false,k+=b;continue}if(!n.noext&&Bi(b)&&t.charAt(w)==="("){s.push(k),k="";let C=new Y(b,s);w=m(v=Y,ce,Is).call(v,t,C,w,n),s.push(C);continue}k+=b;}return s.push(k),w}let c=i+1,f=new Y(null,s),d=[],g="";for(;c<t.length;){let w=t.charAt(c++);if(o||w==="\\"){o=!o,g+=w;continue}if(a){c===h+1?(w==="^"||w==="!")&&(l=true):w==="]"&&!(c===h+2&&l)&&(a=false),g+=w;continue}else if(w==="["){a=true,h=c,l=false,g+=w;continue}if(Bi(w)&&t.charAt(c)==="("){f.push(g),g="";let k=new Y(w,f);f.push(k),c=m(x=Y,ce,Is).call(x,t,k,c,n);continue}if(w==="|"){f.push(g),g="",d.push(f),f=new Y(null,s);continue}if(w===")")return g===""&&r(s,D).length===0&&u(s,ns,true),f.push(g),g="",s.push(...d,f),c;g+=w;}return s.type=null,u(s,J,void 0),u(s,D,[t.substring(i-1)]),c},bi=function(t){return r(this,D).map(s=>{if(typeof s=="string")throw new Error("string type in extglob ast??");let[i,n,o,a]=s.toRegExpSource(t);return u(this,Ut,r(this,Ut)||a),i}).filter(s=>!(this.isStart()&&this.isEnd())||!!s).join("|")},zr=function(t,s,i=false){let n=false,o="",a=false;for(let h=0;h<t.length;h++){let l=t.charAt(h);if(n){n=false,o+=(oo.has(l)?"\\":"")+l;continue}if(l==="\\"){h===t.length-1?o+="\\\\":n=true;continue}if(l==="["){let[c,f,d,g]=eo(t,h);if(d){o+=c,a=a||f,h+=d-1,s=s||g;continue}}if(l==="*"){o+=i&&t==="*"?Gi:Ui,s=true;continue}if(l==="?"){o+=Pi,s=true;continue}o+=ao(l);}return [o,Le(t),!!s,a]},y(Y,ce),Y),$r=(e,{windowsPathsNoEscape:t=false,magicalBraces:s=false}={})=>s?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),ot=(e,t,s={})=>(Js(t),!s.nocomment&&t.charAt(0)==="#"?false:new ue(t,s).match(e)),ho=/^\*+([^+@!?\*\[\(]*)$/,lo=e=>t=>!t.startsWith(".")&&t.endsWith(e),co=e=>t=>t.endsWith(e),uo=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),po=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),fo=/^\*+\.\*+$/,go=e=>!e.startsWith(".")&&e.includes("."),mo=e=>e!=="."&&e!==".."&&e.includes("."),yo=/^\.\*+$/,wo=e=>e!=="."&&e!==".."&&e.startsWith("."),bo=/^\*+$/,vo=e=>e.length!==0&&!e.startsWith("."),So=e=>e.length!==0&&e!=="."&&e!=="..",xo=/^\?+([^+@!?\*\[\(]*)?$/,Eo=([e,t=""])=>{let s=Br([e]);return t?(t=t.toLowerCase(),i=>s(i)&&i.toLowerCase().endsWith(t)):s},ko=([e,t=""])=>{let s=Ur([e]);return t?(t=t.toLowerCase(),i=>s(i)&&i.toLowerCase().endsWith(t)):s},Co=([e,t=""])=>{let s=Ur([e]);return t?i=>s(i)&&i.endsWith(t):s},Oo=([e,t=""])=>{let s=Br([e]);return t?i=>s(i)&&i.endsWith(t):s},Br=([e])=>{let t=e.length;return s=>s.length===t&&!s.startsWith(".")},Ur=([e])=>{let t=e.length;return s=>s.length===t&&s!=="."&&s!==".."},Gr=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Vi={win32:{sep:"\\"},posix:{sep:"/"}},Ro=Gr==="win32"?Vi.win32.sep:Vi.posix.sep;ot.sep=Ro;var nt=Symbol("globstar **");ot.GLOBSTAR=nt;var To="[^/]",Ao=To+"*?",Mo="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Lo="(?:(?!(?:\\/|^)\\.).)*?",_o=(e,t={})=>s=>ot(s,e,t);ot.filter=_o;var gt=(e,t={})=>Object.assign({},e,t),Fo=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return ot;let t=ot;return Object.assign((s,i,n={})=>t(s,i,gt(e,n)),{Minimatch:class extends t.Minimatch{constructor(s,i={}){super(s,gt(e,i));}static defaults(s){return t.defaults(gt(e,s)).Minimatch}},AST:class extends t.AST{constructor(s,i,n={}){super(s,i,gt(e,n));}static fromGlob(s,i={}){return t.AST.fromGlob(s,gt(e,i))}},unescape:(s,i={})=>t.unescape(s,gt(e,i)),escape:(s,i={})=>t.escape(s,gt(e,i)),filter:(s,i={})=>t.filter(s,gt(e,i)),defaults:s=>t.defaults(gt(e,s)),makeRe:(s,i={})=>t.makeRe(s,gt(e,i)),braceExpand:(s,i={})=>t.braceExpand(s,gt(e,i)),match:(s,i,n={})=>t.match(s,i,gt(e,n)),sep:t.sep,GLOBSTAR:nt})};ot.defaults=Fo;var Vr=(e,t={})=>(Js(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Hn(e,{max:t.braceExpandMax}));ot.braceExpand=Vr;var Po=(e,t={})=>new ue(e,t).makeRe();ot.makeRe=Po;var Do=(e,t,s={})=>{let i=new ue(t,s);return e=e.filter(n=>i.match(n)),i.options.nonull&&!e.length&&e.push(t),e};ot.match=Do;var qi=/[?*]|[+@!]\(.*?\)|\[|\]/,No=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ue=class{constructor(e,t={}){p(this,"options");p(this,"set");p(this,"pattern");p(this,"windowsPathsNoEscape");p(this,"nonegate");p(this,"negate");p(this,"comment");p(this,"empty");p(this,"preserveMultipleSlashes");p(this,"partial");p(this,"globSet");p(this,"globParts");p(this,"nocase");p(this,"isWindows");p(this,"platform");p(this,"windowsNoMagicRoot");p(this,"regexp");Js(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||Gr,this.isWindows=this.platform==="win32";let s="allowWindowsEscape";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t[s]===false,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=false,this.nonegate=!!t.nonegate,this.comment=false,this.empty=false,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make();}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return true;for(let e of this.set)for(let t of e)if(typeof t!="string")return true;return false}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let i=this.globParts.map((n,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=n[0]===""&&n[1]===""&&(n[2]==="?"||!qi.test(n[2]))&&!qi.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(h)return [...n.slice(0,4),...n.slice(4).map(c=>this.parse(c))];if(l)return [n[0],...n.slice(1).map(c=>this.parse(c))]}return n.map(h=>this.parse(h))});if(this.debug(this.pattern,i),this.set=i.filter(n=>n.indexOf(false)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let o=this.set[n];o[0]===""&&o[1]===""&&this.globParts[n][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?");}this.debug(this.pattern,this.set);}preprocess(e){if(this.options.noglobstar)for(let s=0;s<e.length;s++)for(let i=0;i<e[s].length;i++)e[s][i]==="**"&&(e[s][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let s=-1;for(;(s=t.indexOf("**",s+1))!==-1;){let i=s;for(;t[i+1]==="**";)i++;i!==s&&t.splice(s,i-s);}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((s,i)=>{let n=s[s.length-1];return i==="**"&&n==="**"?s:i===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(s.pop(),s):(s.push(i),s)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=false;do{if(t=false,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let n=e[i];i===1&&n===""&&e[0]===""||(n==="."||n==="")&&(t=true,e.splice(i,1),i--);}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=true,e.pop());}let s=0;for(;(s=e.indexOf("..",s+1))!==-1;){let i=e[s-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=true,e.splice(s-1,2),s-=2);}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=false;do{t=false;for(let s of e){let i=-1;for(;(i=s.indexOf("**",i+1))!==-1;){let o=i;for(;s[o+1]==="**";)o++;o>i&&s.splice(i+1,o-i);let a=s[i+1],h=s[i+2],l=s[i+3];if(a!==".."||!h||h==="."||h===".."||!l||l==="."||l==="..")continue;t=true,s.splice(i,1);let c=s.slice(0);c[i]="**",e.push(c),i--;}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let a=s[o];o===1&&a===""&&s[0]===""||(a==="."||a==="")&&(t=true,s.splice(o,1),o--);}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(t=true,s.pop());}let n=0;for(;(n=s.indexOf("..",n+1))!==-1;){let o=s[n-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=true;let a=n===1&&s[n+1]==="**"?["."]:[];s.splice(n-1,2,...a),s.length===0&&s.push(""),n-=2;}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let s=t+1;s<e.length;s++){let i=this.partsMatch(e[t],e[s],!this.preserveMultipleSlashes);if(i){e[t]=[],e[s]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,s=false){let i=0,n=0,o=[],a="";for(;i<e.length&&n<t.length;)if(e[i]===t[n])o.push(a==="b"?t[n]:e[i]),i++,n++;else if(s&&e[i]==="**"&&t[n]===e[i+1])o.push(e[i]),i++;else if(s&&t[n]==="**"&&e[i]===t[n+1])o.push(t[n]),n++;else if(e[i]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(a==="b")return false;a="a",o.push(e[i]),i++,n++;}else if(t[n]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return false;a="b",o.push(t[n]),i++,n++;}else return false;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=false,s=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,s++;s&&(this.pattern=e.slice(s)),this.negate=t;}matchOne(e,t,s=false){let i=this.options;if(this.isWindows){let x=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),w=!x&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),k=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),b=!k&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),C=w?3:x?0:void 0,R=b?3:k?0:void 0;if(typeof C=="number"&&typeof R=="number"){let[O,E]=[e[C],t[R]];O.toLowerCase()===E.toLowerCase()&&(t[R]=O,R>C?t=t.slice(R):C>R&&(e=e.slice(C)));}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,h=e.length,l=t.length;o<h&&a<l;o++,a++){this.debug("matchOne loop");var c=t[a],f=e[o];if(this.debug(t,c,f),c===false)return false;if(c===nt){this.debug("GLOBSTAR",[t,c,f]);var d=o,g=a+1;if(g===l){for(this.debug("** at the end");o<h;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return false;return true}for(;d<h;){var v=e[d];if(this.debug(`
3
+ globstar while`,e,d,t,g,v),this.matchOne(e.slice(d),t.slice(g),s))return this.debug("globstar found match!",d,h,v),true;if(v==="."||v===".."||!i.dot&&v.charAt(0)==="."){this.debug("dot detected!",e,d,t,g);break}this.debug("globstar swallow a segment, and continue"),d++;}return !!(s&&(this.debug(`
4
+ >>> no match, partial?`,e,d,t,g),d===h))}let x;if(typeof c=="string"?(x=f===c,this.debug("string match",c,f,x)):(x=c.test(f),this.debug("pattern match",c,f,x)),!x)return false}if(o===h&&a===l)return true;if(o===h)return s;if(a===l)return o===h-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Vr(this.pattern,this.options)}parse(e){Js(e);let t=this.options;if(e==="**")return nt;if(e==="")return "";let s,i=null;(s=e.match(bo))?i=t.dot?So:vo:(s=e.match(ho))?i=(t.nocase?t.dot?po:uo:t.dot?co:lo)(s[1]):(s=e.match(xo))?i=(t.nocase?t.dot?ko:Eo:t.dot?Co:Oo)(s):(s=e.match(fo))?i=t.dot?mo:go:(s=e.match(yo))&&(i=wo);let n=jr.fromGlob(e,this.options).toMMPattern();return i&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:i}),n}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;let e=this.set;if(!e.length)return this.regexp=false,this.regexp;let t=this.options,s=t.noglobstar?Ao:t.dot?Mo:Lo,i=new Set(t.nocase?["i"]:[]),n=e.map(h=>{let l=h.map(f=>{if(f instanceof RegExp)for(let d of f.flags.split(""))i.add(d);return typeof f=="string"?No(f):f===nt?nt:f._src});l.forEach((f,d)=>{let g=l[d+1],v=l[d-1];f!==nt||v===nt||(v===void 0?g!==void 0&&g!==nt?l[d+1]="(?:\\/|"+s+"\\/)?"+g:l[d]=s:g===void 0?l[d-1]=v+"(?:\\/|\\/"+s+")?":g!==nt&&(l[d-1]=v+"(?:\\/|\\/"+s+"\\/)"+g,l[d+1]=nt));});let c=l.filter(f=>f!==nt);if(this.partial&&c.length>=1){let f=[];for(let d=1;d<=c.length;d++)f.push(c.slice(0,d).join("/"));return "(?:"+f.join("|")+")"}return c.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];n="^"+o+n+a+"$",this.partial&&(n="^(?:\\/|"+o+n.slice(1,-1)+a+")$"),this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...i].join(""));}catch{this.regexp=false;}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return false;if(this.empty)return e==="";if(e==="/"&&t)return true;let s=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let n=this.set;this.debug(this.pattern,"set",n);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<n.length;a++){let h=n[a],l=i;if(s.matchBase&&h.length===1&&(l=[o]),this.matchOne(l,h,t))return s.flipNegate?true:!this.negate}return s.flipNegate?false:this.negate}static defaults(e){return ot.defaults(e).Minimatch}};ot.AST=jr;ot.Minimatch=ue;ot.escape=$r;ot.unescape=Le;var jo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,qr=new Set,vi=typeof process=="object"&&process?process:{},Jr=(e,t,s,i)=>{typeof vi.emitWarning=="function"?vi.emitWarning(e,t,s,i):console.error(`[${s}] ${t}: ${e}`);},Hs=globalThis.AbortController,Ji=globalThis.AbortSignal;if(typeof Hs>"u"){Ji=class{constructor(){p(this,"onabort");p(this,"_onabort",[]);p(this,"reason");p(this,"aborted",false);}addEventListener(s,i){this._onabort.push(i);}},Hs=class{constructor(){p(this,"signal",new Ji);t();}abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=true;for(let i of this.signal._onabort)i(s);this.signal.onabort?.(s);}}};let e=vi.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{e&&(e=false,Jr("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t));};}var Io=e=>!qr.has(e),Xt=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Hr=e=>Xt(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?zs:null:null,zs=class extends Array{constructor(e){super(e),this.fill(0);}},jt,_e,zo=(jt=class{constructor(t,s){p(this,"heap");p(this,"length");if(!r(jt,_e))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new s(t),this.length=0;}static create(t){let s=Hr(t);if(!s)return [];u(jt,_e,true);let i=new jt(t,s);return u(jt,_e,false),i}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}},_e=new WeakMap,y(jt,_e,false),jt),hr,lr,yt,lt,kt,ye,Ct,Fe,Pe,Ot,$,Rt,I,N,L,st,ct,tt,H,Tt,Z,At,Mt,ut,pt,Lt,ne,it,De,S,Si,we,Gt,os,dt,Zr,be,Ne,as,te,ee,xi,$s,Bs,P,Ei,Xe,se,ki,We,Ys=(We=class{constructor(t){y(this,S);y(this,yt);y(this,lt);y(this,kt);y(this,ye);y(this,Ct);y(this,Fe);y(this,Pe);y(this,Ot);p(this,"ttl");p(this,"ttlResolution");p(this,"ttlAutopurge");p(this,"updateAgeOnGet");p(this,"updateAgeOnHas");p(this,"allowStale");p(this,"noDisposeOnSet");p(this,"noUpdateTTL");p(this,"maxEntrySize");p(this,"sizeCalculation");p(this,"noDeleteOnFetchRejection");p(this,"noDeleteOnStaleGet");p(this,"allowStaleOnFetchAbort");p(this,"allowStaleOnFetchRejection");p(this,"ignoreFetchAbort");y(this,$);y(this,Rt);y(this,I);y(this,N);y(this,L);y(this,st);y(this,ct);y(this,tt);y(this,H);y(this,Tt);y(this,Z);y(this,At);y(this,Mt);y(this,ut);y(this,pt);y(this,Lt);y(this,ne);y(this,it);y(this,De);y(this,we,()=>{});y(this,Gt,()=>{});y(this,os,()=>{});y(this,dt,()=>false);y(this,be,t=>{});y(this,Ne,(t,s,i)=>{});y(this,as,(t,s,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});p(this,hr,"LRUCache");let{max:s=0,ttl:i,ttlResolution:n=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:h,allowStale:l,dispose:c,onInsert:f,disposeAfter:d,noDisposeOnSet:g,noUpdateTTL:v,maxSize:x=0,maxEntrySize:w=0,sizeCalculation:k,fetchMethod:b,memoMethod:C,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:A,ignoreFetchAbort:_,perf:Q}=t;if(Q!==void 0&&typeof Q?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,Ot,Q??jo),s!==0&&!Xt(s))throw new TypeError("max option must be a nonnegative integer");let F=s?Hr(s):Array;if(!F)throw new Error("invalid max value: "+s);if(u(this,yt,s),u(this,lt,x),this.maxEntrySize=w||r(this,lt),this.sizeCalculation=k,this.sizeCalculation){if(!r(this,lt)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,Pe,C),b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,Fe,b),u(this,ne,!!b),u(this,I,new Map),u(this,N,new Array(s).fill(void 0)),u(this,L,new Array(s).fill(void 0)),u(this,st,new F(s)),u(this,ct,new F(s)),u(this,tt,0),u(this,H,0),u(this,Tt,zo.create(s)),u(this,$,0),u(this,Rt,0),typeof c=="function"&&u(this,kt,c),typeof f=="function"&&u(this,ye,f),typeof d=="function"?(u(this,Ct,d),u(this,Z,[])):(u(this,Ct,void 0),u(this,Z,void 0)),u(this,Lt,!!r(this,kt)),u(this,De,!!r(this,ye)),u(this,it,!!r(this,Ct)),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!_,this.maxEntrySize!==0){if(r(this,lt)!==0&&!Xt(r(this,lt)))throw new TypeError("maxSize must be a positive integer if specified");if(!Xt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");m(this,S,Zr).call(this);}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!h,this.ttlResolution=Xt(n)||n===0?n:1,this.ttlAutopurge=!!o,this.ttl=i||0,this.ttl){if(!Xt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");m(this,S,Si).call(this);}if(r(this,yt)===0&&this.ttl===0&&r(this,lt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!r(this,yt)&&!r(this,lt)){let U="LRU_CACHE_UNBOUNDED";Io(U)&&(qr.add(U),Jr("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,We));}}get perf(){return r(this,Ot)}static unsafeExposeInternals(t){return {starts:r(t,Mt),ttls:r(t,ut),autopurgeTimers:r(t,pt),sizes:r(t,At),keyMap:r(t,I),keyList:r(t,N),valList:r(t,L),next:r(t,st),prev:r(t,ct),get head(){return r(t,tt)},get tail(){return r(t,H)},free:r(t,Tt),isBackgroundFetch:s=>{var i;return m(i=t,S,P).call(i,s)},backgroundFetch:(s,i,n,o)=>{var a;return m(a=t,S,Bs).call(a,s,i,n,o)},moveToTail:s=>{var i;return m(i=t,S,Xe).call(i,s)},indexes:s=>{var i;return m(i=t,S,te).call(i,s)},rindexes:s=>{var i;return m(i=t,S,ee).call(i,s)},isStale:s=>{var i;return r(i=t,dt).call(i,s)}}}get max(){return r(this,yt)}get maxSize(){return r(this,lt)}get calculatedSize(){return r(this,Rt)}get size(){return r(this,$)}get fetchMethod(){return r(this,Fe)}get memoMethod(){return r(this,Pe)}get dispose(){return r(this,kt)}get onInsert(){return r(this,ye)}get disposeAfter(){return r(this,Ct)}getRemainingTTL(t){return r(this,I).has(t)?1/0:0}*entries(){for(let t of m(this,S,te).call(this))r(this,L)[t]!==void 0&&r(this,N)[t]!==void 0&&!m(this,S,P).call(this,r(this,L)[t])&&(yield [r(this,N)[t],r(this,L)[t]]);}*rentries(){for(let t of m(this,S,ee).call(this))r(this,L)[t]!==void 0&&r(this,N)[t]!==void 0&&!m(this,S,P).call(this,r(this,L)[t])&&(yield [r(this,N)[t],r(this,L)[t]]);}*keys(){for(let t of m(this,S,te).call(this)){let s=r(this,N)[t];s!==void 0&&!m(this,S,P).call(this,r(this,L)[t])&&(yield s);}}*rkeys(){for(let t of m(this,S,ee).call(this)){let s=r(this,N)[t];s!==void 0&&!m(this,S,P).call(this,r(this,L)[t])&&(yield s);}}*values(){for(let t of m(this,S,te).call(this))r(this,L)[t]!==void 0&&!m(this,S,P).call(this,r(this,L)[t])&&(yield r(this,L)[t]);}*rvalues(){for(let t of m(this,S,ee).call(this))r(this,L)[t]!==void 0&&!m(this,S,P).call(this,r(this,L)[t])&&(yield r(this,L)[t]);}[(lr=Symbol.iterator,hr=Symbol.toStringTag,lr)](){return this.entries()}find(t,s={}){for(let i of m(this,S,te).call(this)){let n=r(this,L)[i],o=m(this,S,P).call(this,n)?n.__staleWhileFetching:n;if(o!==void 0&&t(o,r(this,N)[i],this))return this.get(r(this,N)[i],s)}}forEach(t,s=this){for(let i of m(this,S,te).call(this)){let n=r(this,L)[i],o=m(this,S,P).call(this,n)?n.__staleWhileFetching:n;o!==void 0&&t.call(s,o,r(this,N)[i],this);}}rforEach(t,s=this){for(let i of m(this,S,ee).call(this)){let n=r(this,L)[i],o=m(this,S,P).call(this,n)?n.__staleWhileFetching:n;o!==void 0&&t.call(s,o,r(this,N)[i],this);}}purgeStale(){let t=false;for(let s of m(this,S,ee).call(this,{allowStale:true}))r(this,dt).call(this,s)&&(m(this,S,se).call(this,r(this,N)[s],"expire"),t=true);return t}info(t){let s=r(this,I).get(t);if(s===void 0)return;let i=r(this,L)[s],n=m(this,S,P).call(this,i)?i.__staleWhileFetching:i;if(n===void 0)return;let o={value:n};if(r(this,ut)&&r(this,Mt)){let a=r(this,ut)[s],h=r(this,Mt)[s];if(a&&h){let l=a-(r(this,Ot).now()-h);o.ttl=l,o.start=Date.now();}}return r(this,At)&&(o.size=r(this,At)[s]),o}dump(){let t=[];for(let s of m(this,S,te).call(this,{allowStale:true})){let i=r(this,N)[s],n=r(this,L)[s],o=m(this,S,P).call(this,n)?n.__staleWhileFetching:n;if(o===void 0||i===void 0)continue;let a={value:o};if(r(this,ut)&&r(this,Mt)){a.ttl=r(this,ut)[s];let h=r(this,Ot).now()-r(this,Mt)[s];a.start=Math.floor(Date.now()-h);}r(this,At)&&(a.size=r(this,At)[s]),t.unshift([i,a]);}return t}load(t){this.clear();for(let[s,i]of t){if(i.start){let n=Date.now()-i.start;i.start=r(this,Ot).now()-n;}this.set(s,i.value,i);}}set(t,s,i={}){var g,v,x,w;if(s===void 0)return this.delete(t),this;let{ttl:n=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:l}=i,{noUpdateTTL:c=this.noUpdateTTL}=i,f=r(this,as).call(this,t,s,i.size||0,h);if(this.maxEntrySize&&f>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=true),m(this,S,se).call(this,t,"set"),this;let d=r(this,$)===0?void 0:r(this,I).get(t);if(d===void 0)d=r(this,$)===0?r(this,H):r(this,Tt).length!==0?r(this,Tt).pop():r(this,$)===r(this,yt)?m(this,S,$s).call(this,false):r(this,$),r(this,N)[d]=t,r(this,L)[d]=s,r(this,I).set(t,d),r(this,st)[r(this,H)]=d,r(this,ct)[d]=r(this,H),u(this,H,d),As(this,$)._++,r(this,Ne).call(this,d,f,l),l&&(l.set="add"),c=false,r(this,De)&&((g=r(this,ye))==null||g.call(this,s,t,"add"));else {m(this,S,Xe).call(this,d);let k=r(this,L)[d];if(s!==k){if(r(this,ne)&&m(this,S,P).call(this,k)){k.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:b}=k;b!==void 0&&!a&&(r(this,Lt)&&((v=r(this,kt))==null||v.call(this,b,t,"set")),r(this,it)&&r(this,Z)?.push([b,t,"set"]));}else a||(r(this,Lt)&&((x=r(this,kt))==null||x.call(this,k,t,"set")),r(this,it)&&r(this,Z)?.push([k,t,"set"]));if(r(this,be).call(this,d),r(this,Ne).call(this,d,f,l),r(this,L)[d]=s,l){l.set="replace";let b=k&&m(this,S,P).call(this,k)?k.__staleWhileFetching:k;b!==void 0&&(l.oldValue=b);}}else l&&(l.set="update");r(this,De)&&this.onInsert?.(s,t,s===k?"update":"replace");}if(n!==0&&!r(this,ut)&&m(this,S,Si).call(this),r(this,ut)&&(c||r(this,os).call(this,d,n,o),l&&r(this,Gt).call(this,l,d)),!a&&r(this,it)&&r(this,Z)){let k=r(this,Z),b;for(;b=k?.shift();)(w=r(this,Ct))==null||w.call(this,...b);}return this}pop(){var t;try{for(;r(this,$);){let s=r(this,L)[r(this,tt)];if(m(this,S,$s).call(this,!0),m(this,S,P).call(this,s)){if(s.__staleWhileFetching)return s.__staleWhileFetching}else if(s!==void 0)return s}}finally{if(r(this,it)&&r(this,Z)){let s=r(this,Z),i;for(;i=s?.shift();)(t=r(this,Ct))==null||t.call(this,...i);}}}has(t,s={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=s,o=r(this,I).get(t);if(o!==void 0){let a=r(this,L)[o];if(m(this,S,P).call(this,a)&&a.__staleWhileFetching===void 0)return false;if(r(this,dt).call(this,o))n&&(n.has="stale",r(this,Gt).call(this,n,o));else return i&&r(this,we).call(this,o),n&&(n.has="hit",r(this,Gt).call(this,n,o)),true}else n&&(n.has="miss");return false}peek(t,s={}){let{allowStale:i=this.allowStale}=s,n=r(this,I).get(t);if(n===void 0||!i&&r(this,dt).call(this,n))return;let o=r(this,L)[n];return m(this,S,P).call(this,o)?o.__staleWhileFetching:o}async fetch(t,s={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:l=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:x=this.allowStaleOnFetchAbort,context:w,forceRefresh:k=false,status:b,signal:C}=s;if(!r(this,ne))return b&&(b.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:b});let R={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:h,size:l,sizeCalculation:c,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:x,ignoreFetchAbort:v,status:b,signal:C},O=r(this,I).get(t);if(O===void 0){b&&(b.fetch="miss");let E=m(this,S,Bs).call(this,t,O,R,w);return E.__returned=E}else {let E=r(this,L)[O];if(m(this,S,P).call(this,E)){let F=i&&E.__staleWhileFetching!==void 0;return b&&(b.fetch="inflight",F&&(b.returnedStale=true)),F?E.__staleWhileFetching:E.__returned=E}let A=r(this,dt).call(this,O);if(!k&&!A)return b&&(b.fetch="hit"),m(this,S,Xe).call(this,O),n&&r(this,we).call(this,O),b&&r(this,Gt).call(this,b,O),E;let _=m(this,S,Bs).call(this,t,O,R,w),Q=_.__staleWhileFetching!==void 0&&i;return b&&(b.fetch=A?"stale":"refresh",Q&&A&&(b.returnedStale=true)),Q?_.__staleWhileFetching:_.__returned=_}}async forceFetch(t,s={}){let i=await this.fetch(t,s);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,s={}){let i=r(this,Pe);if(!i)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:o,...a}=s,h=this.get(t,a);if(!o&&h!==void 0)return h;let l=i(t,h,{options:a,context:n});return this.set(t,l,a),l}get(t,s={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:a}=s,h=r(this,I).get(t);if(h!==void 0){let l=r(this,L)[h],c=m(this,S,P).call(this,l);return a&&r(this,Gt).call(this,a,h),r(this,dt).call(this,h)?(a&&(a.get="stale"),c?(a&&i&&l.__staleWhileFetching!==void 0&&(a.returnedStale=true),i?l.__staleWhileFetching:void 0):(o||m(this,S,se).call(this,t,"expire"),a&&i&&(a.returnedStale=true),i?l:void 0)):(a&&(a.get="hit"),c?l.__staleWhileFetching:(m(this,S,Xe).call(this,h),n&&r(this,we).call(this,h),l))}else a&&(a.get="miss");}delete(t){return m(this,S,se).call(this,t,"delete")}clear(){return m(this,S,ki).call(this,"delete")}},yt=new WeakMap,lt=new WeakMap,kt=new WeakMap,ye=new WeakMap,Ct=new WeakMap,Fe=new WeakMap,Pe=new WeakMap,Ot=new WeakMap,$=new WeakMap,Rt=new WeakMap,I=new WeakMap,N=new WeakMap,L=new WeakMap,st=new WeakMap,ct=new WeakMap,tt=new WeakMap,H=new WeakMap,Tt=new WeakMap,Z=new WeakMap,At=new WeakMap,Mt=new WeakMap,ut=new WeakMap,pt=new WeakMap,Lt=new WeakMap,ne=new WeakMap,it=new WeakMap,De=new WeakMap,S=new WeakSet,Si=function(){let t=new zs(r(this,yt)),s=new zs(r(this,yt));u(this,ut,t),u(this,Mt,s);let i=this.ttlAutopurge?new Array(r(this,yt)):void 0;u(this,pt,i),u(this,os,(a,h,l=r(this,Ot).now())=>{if(s[a]=h!==0?l:0,t[a]=h,i?.[a]&&(clearTimeout(i[a]),i[a]=void 0),h!==0&&i){let c=setTimeout(()=>{r(this,dt).call(this,a)&&m(this,S,se).call(this,r(this,N)[a],"expire");},h+1);c.unref&&c.unref(),i[a]=c;}}),u(this,we,a=>{s[a]=t[a]!==0?r(this,Ot).now():0;}),u(this,Gt,(a,h)=>{if(t[h]){let l=t[h],c=s[h];if(!l||!c)return;a.ttl=l,a.start=c,a.now=n||o();let f=a.now-c;a.remainingTTL=l-f;}});let n=0,o=()=>{let a=r(this,Ot).now();if(this.ttlResolution>0){n=a;let h=setTimeout(()=>n=0,this.ttlResolution);h.unref&&h.unref();}return a};this.getRemainingTTL=a=>{let h=r(this,I).get(a);if(h===void 0)return 0;let l=t[h],c=s[h];if(!l||!c)return 1/0;let f=(n||o())-c;return l-f},u(this,dt,a=>{let h=s[a],l=t[a];return !!l&&!!h&&(n||o())-h>l});},we=new WeakMap,Gt=new WeakMap,os=new WeakMap,dt=new WeakMap,Zr=function(){let t=new zs(r(this,yt));u(this,Rt,0),u(this,At,t),u(this,be,s=>{u(this,Rt,r(this,Rt)-t[s]),t[s]=0;}),u(this,as,(s,i,n,o)=>{if(m(this,S,P).call(this,i))return 0;if(!Xt(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(i,s),!Xt(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n}),u(this,Ne,(s,i,n)=>{if(t[s]=i,r(this,lt)){let o=r(this,lt)-t[s];for(;r(this,Rt)>o;)m(this,S,$s).call(this,true);}u(this,Rt,r(this,Rt)+t[s]),n&&(n.entrySize=i,n.totalCalculatedSize=r(this,Rt));});},be=new WeakMap,Ne=new WeakMap,as=new WeakMap,te=function*({allowStale:t=this.allowStale}={}){if(r(this,$))for(let s=r(this,H);!(!m(this,S,xi).call(this,s)||((t||!r(this,dt).call(this,s))&&(yield s),s===r(this,tt)));)s=r(this,ct)[s];},ee=function*({allowStale:t=this.allowStale}={}){if(r(this,$))for(let s=r(this,tt);!(!m(this,S,xi).call(this,s)||((t||!r(this,dt).call(this,s))&&(yield s),s===r(this,H)));)s=r(this,st)[s];},xi=function(t){return t!==void 0&&r(this,I).get(r(this,N)[t])===t},$s=function(t){var o;let s=r(this,tt),i=r(this,N)[s],n=r(this,L)[s];return r(this,ne)&&m(this,S,P).call(this,n)?n.__abortController.abort(new Error("evicted")):(r(this,Lt)||r(this,it))&&(r(this,Lt)&&((o=r(this,kt))==null||o.call(this,n,i,"evict")),r(this,it)&&r(this,Z)?.push([n,i,"evict"])),r(this,be).call(this,s),r(this,pt)?.[s]&&(clearTimeout(r(this,pt)[s]),r(this,pt)[s]=void 0),t&&(r(this,N)[s]=void 0,r(this,L)[s]=void 0,r(this,Tt).push(s)),r(this,$)===1?(u(this,tt,u(this,H,0)),r(this,Tt).length=0):u(this,tt,r(this,st)[s]),r(this,I).delete(i),As(this,$)._--,s},Bs=function(t,s,i,n){let o=s===void 0?void 0:r(this,L)[s];if(m(this,S,P).call(this,o))return o;let a=new Hs,{signal:h}=i;h?.addEventListener("abort",()=>a.abort(h.reason),{signal:a.signal});let l={signal:a.signal,options:i,context:n},c=(w,k=false)=>{let{aborted:b}=a.signal,C=i.ignoreFetchAbort&&w!==void 0,R=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&w!==void 0);if(i.status&&(b&&!k?(i.status.fetchAborted=true,i.status.fetchError=a.signal.reason,C&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),b&&!C&&!k)return d(a.signal.reason,R);let O=v,E=r(this,L)[s];return (E===v||C&&k&&E===void 0)&&(w===void 0?O.__staleWhileFetching!==void 0?r(this,L)[s]=O.__staleWhileFetching:m(this,S,se).call(this,t,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(t,w,l.options))),w},f=w=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=w),d(w,false)),d=(w,k)=>{let{aborted:b}=a.signal,C=b&&i.allowStaleOnFetchAbort,R=C||i.allowStaleOnFetchRejection,O=R||i.noDeleteOnFetchRejection,E=v;if(r(this,L)[s]===v&&(!O||!k&&E.__staleWhileFetching===void 0?m(this,S,se).call(this,t,"fetch"):C||(r(this,L)[s]=E.__staleWhileFetching)),R)return i.status&&E.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),E.__staleWhileFetching;if(E.__returned===E)throw w},g=(w,k)=>{var C;let b=(C=r(this,Fe))==null?void 0:C.call(this,t,o,l);b&&b instanceof Promise&&b.then(R=>w(R===void 0?void 0:R),k),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(w(void 0),i.allowStaleOnFetchAbort&&(w=R=>c(R,true)));});};i.status&&(i.status.fetchDispatched=true);let v=new Promise(g).then(c,f),x=Object.assign(v,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return s===void 0?(this.set(t,x,{...l.options,status:void 0}),s=r(this,I).get(t)):r(this,L)[s]=x,x},P=function(t){if(!r(this,ne))return false;let s=t;return !!s&&s instanceof Promise&&s.hasOwnProperty("__staleWhileFetching")&&s.__abortController instanceof Hs},Ei=function(t,s){r(this,ct)[s]=t,r(this,st)[t]=s;},Xe=function(t){t!==r(this,H)&&(t===r(this,tt)?u(this,tt,r(this,st)[t]):m(this,S,Ei).call(this,r(this,ct)[t],r(this,st)[t]),m(this,S,Ei).call(this,r(this,H),t),u(this,H,t));},se=function(t,s){var n,o;let i=false;if(r(this,$)!==0){let a=r(this,I).get(t);if(a!==void 0)if(r(this,pt)?.[a]&&(clearTimeout(r(this,pt)?.[a]),r(this,pt)[a]=void 0),i=true,r(this,$)===1)m(this,S,ki).call(this,s);else {r(this,be).call(this,a);let h=r(this,L)[a];if(m(this,S,P).call(this,h)?h.__abortController.abort(new Error("deleted")):(r(this,Lt)||r(this,it))&&(r(this,Lt)&&((n=r(this,kt))==null||n.call(this,h,t,s)),r(this,it)&&r(this,Z)?.push([h,t,s])),r(this,I).delete(t),r(this,N)[a]=void 0,r(this,L)[a]=void 0,a===r(this,H))u(this,H,r(this,ct)[a]);else if(a===r(this,tt))u(this,tt,r(this,st)[a]);else {let l=r(this,ct)[a];r(this,st)[l]=r(this,st)[a];let c=r(this,st)[a];r(this,ct)[c]=r(this,ct)[a];}As(this,$)._--,r(this,Tt).push(a);}}if(r(this,it)&&r(this,Z)?.length){let a=r(this,Z),h;for(;h=a?.shift();)(o=r(this,Ct))==null||o.call(this,...h);}return i},ki=function(t){var s,i;for(let n of m(this,S,ee).call(this,{allowStale:true})){let o=r(this,L)[n];if(m(this,S,P).call(this,o))o.__abortController.abort(new Error("deleted"));else {let a=r(this,N)[n];r(this,Lt)&&((s=r(this,kt))==null||s.call(this,o,a,t)),r(this,it)&&r(this,Z)?.push([o,a,t]);}}if(r(this,I).clear(),r(this,L).fill(void 0),r(this,N).fill(void 0),r(this,ut)&&r(this,Mt)){r(this,ut).fill(0),r(this,Mt).fill(0);for(let n of r(this,pt)??[])n!==void 0&&clearTimeout(n);r(this,pt)?.fill(void 0);}if(r(this,At)&&r(this,At).fill(0),u(this,tt,0),u(this,H,0),r(this,Tt).length=0,u(this,Rt,0),u(this,$,0),r(this,it)&&r(this,Z)){let n=r(this,Z),o;for(;o=n?.shift();)(i=r(this,Ct))==null||i.call(this,...o);}},We),Hi=typeof process=="object"&&process?process:{stdout:null,stderr:null},ta=e=>!!e&&typeof e=="object"&&(e instanceof Zs||e instanceof Kr||ea(e)||sa(e)),ea=e=>!!e&&typeof e=="object"&&e instanceof EventEmitter&&typeof e.pipe=="function"&&e.pipe!==Kr.Writable.prototype.pipe,sa=e=>!!e&&typeof e=="object"&&e instanceof EventEmitter&&typeof e.write=="function"&&typeof e.end=="function",$t=Symbol("EOF"),Bt=Symbol("maybeEmitEnd"),Qt=Symbol("emittedEnd"),_s=Symbol("emittingEnd"),Je=Symbol("emittedError"),Fs=Symbol("closed"),Zi=Symbol("read"),Ps=Symbol("flush"),Ki=Symbol("flushChunk"),xt=Symbol("encoding"),Ae=Symbol("decoder"),G=Symbol("flowing"),He=Symbol("paused"),Me=Symbol("resume"),V=Symbol("buffer"),et=Symbol("pipes"),q=Symbol("bufferLength"),pi=Symbol("bufferPush"),Ds=Symbol("bufferShift"),X=Symbol("objectMode"),W=Symbol("destroyed"),di=Symbol("error"),fi=Symbol("emitData"),Yi=Symbol("emitEnd"),gi=Symbol("emitEnd2"),Ft=Symbol("async"),mi=Symbol("abort"),Ns=Symbol("aborted"),Ze=Symbol("signal"),pe=Symbol("dataListeners"),ht=Symbol("discarded"),Ke=e=>Promise.resolve().then(e),ia=e=>e(),ra=e=>e==="end"||e==="finish"||e==="prefinish",na=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,oa=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),Yr=class{constructor(e,t,s){p(this,"src");p(this,"dest");p(this,"opts");p(this,"ondrain");this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Me](),this.dest.on("drain",this.ondrain);}unpipe(){this.dest.removeListener("drain",this.ondrain);}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end();}},aa=class extends Yr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe();}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors);}},ha=e=>!!e.objectMode,la=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",cr,ur,pr,dr,fr,gr,mr,yr,wr,br,vr,Sr,xr,Er,kr,Cr,Or,Rr,Tr,Zs=class extends EventEmitter{constructor(...t){let s=t[0]||{};super();p(this,Tr,false);p(this,Rr,false);p(this,Or,[]);p(this,Cr,[]);p(this,kr);p(this,Er);p(this,xr);p(this,Sr);p(this,vr,false);p(this,br,false);p(this,wr,false);p(this,yr,false);p(this,mr,null);p(this,gr,0);p(this,fr,false);p(this,dr);p(this,pr,false);p(this,ur,0);p(this,cr,false);p(this,"writable",true);p(this,"readable",true);if(s.objectMode&&typeof s.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");ha(s)?(this[X]=true,this[xt]=null):la(s)?(this[xt]=s.encoding,this[X]=false):(this[X]=false,this[xt]=null),this[Ft]=!!s.async,this[Ae]=this[xt]?new StringDecoder(this[xt]):null,s&&s.debugExposeBuffer===true&&Object.defineProperty(this,"buffer",{get:()=>this[V]}),s&&s.debugExposePipes===true&&Object.defineProperty(this,"pipes",{get:()=>this[et]});let{signal:i}=s;i&&(this[Ze]=i,i.aborted?this[mi]():i.addEventListener("abort",()=>this[mi]()));}get bufferLength(){return this[q]}get encoding(){return this[xt]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[X]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Ft]}set async(t){this[Ft]=this[Ft]||!!t;}[(Tr=G,Rr=He,Or=et,Cr=V,kr=X,Er=xt,xr=Ft,Sr=Ae,vr=$t,br=Qt,wr=_s,yr=Fs,mr=Je,gr=q,fr=W,dr=Ze,pr=Ns,ur=pe,cr=ht,mi)](){this[Ns]=true,this.emit("abort",this[Ze]?.reason),this.destroy(this[Ze]?.reason);}get aborted(){return this[Ns]}set aborted(t){}write(t,s,i){if(this[Ns])return false;if(this[$t])throw new Error("write after end");if(this[W])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),true;typeof s=="function"&&(i=s,s="utf8"),s||(s="utf8");let n=this[Ft]?Ke:ia;if(!this[X]&&!Buffer.isBuffer(t)){if(oa(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(na(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[X]?(this[G]&&this[q]!==0&&this[Ps](true),this[G]?this.emit("data",t):this[pi](t),this[q]!==0&&this.emit("readable"),i&&n(i),this[G]):t.length?(typeof t=="string"&&!(s===this[xt]&&!this[Ae]?.lastNeed)&&(t=Buffer.from(t,s)),Buffer.isBuffer(t)&&this[xt]&&(t=this[Ae].write(t)),this[G]&&this[q]!==0&&this[Ps](true),this[G]?this.emit("data",t):this[pi](t),this[q]!==0&&this.emit("readable"),i&&n(i),this[G]):(this[q]!==0&&this.emit("readable"),i&&n(i),this[G])}read(t){if(this[W])return null;if(this[ht]=false,this[q]===0||t===0||t&&t>this[q])return this[Bt](),null;this[X]&&(t=null),this[V].length>1&&!this[X]&&(this[V]=[this[xt]?this[V].join(""):Buffer.concat(this[V],this[q])]);let s=this[Zi](t||null,this[V][0]);return this[Bt](),s}[Zi](t,s){if(this[X])this[Ds]();else {let i=s;t===i.length||t===null?this[Ds]():typeof i=="string"?(this[V][0]=i.slice(t),s=i.slice(0,t),this[q]-=t):(this[V][0]=i.subarray(t),s=i.subarray(0,t),this[q]-=t);}return this.emit("data",s),!this[V].length&&!this[$t]&&this.emit("drain"),s}end(t,s,i){return typeof t=="function"&&(i=t,t=void 0),typeof s=="function"&&(i=s,s="utf8"),t!==void 0&&this.write(t,s),i&&this.once("end",i),this[$t]=true,this.writable=false,(this[G]||!this[He])&&this[Bt](),this}[Me](){this[W]||(!this[pe]&&!this[et].length&&(this[ht]=true),this[He]=false,this[G]=true,this.emit("resume"),this[V].length?this[Ps]():this[$t]?this[Bt]():this.emit("drain"));}resume(){return this[Me]()}pause(){this[G]=false,this[He]=true,this[ht]=false;}get destroyed(){return this[W]}get flowing(){return this[G]}get paused(){return this[He]}[pi](t){this[X]?this[q]+=1:this[q]+=t.length,this[V].push(t);}[Ds](){return this[X]?this[q]-=1:this[q]-=this[V][0].length,this[V].shift()}[Ps](t=false){do;while(this[Ki](this[Ds]())&&this[V].length);!t&&!this[V].length&&!this[$t]&&this.emit("drain");}[Ki](t){return this.emit("data",t),this[G]}pipe(t,s){if(this[W])return t;this[ht]=false;let i=this[Qt];return s=s||{},t===Hi.stdout||t===Hi.stderr?s.end=false:s.end=s.end!==false,s.proxyErrors=!!s.proxyErrors,i?s.end&&t.end():(this[et].push(s.proxyErrors?new aa(this,t,s):new Yr(this,t,s)),this[Ft]?Ke(()=>this[Me]()):this[Me]()),t}unpipe(t){let s=this[et].find(i=>i.dest===t);s&&(this[et].length===1?(this[G]&&this[pe]===0&&(this[G]=false),this[et]=[]):this[et].splice(this[et].indexOf(s),1),s.unpipe());}addListener(t,s){return this.on(t,s)}on(t,s){let i=super.on(t,s);if(t==="data")this[ht]=false,this[pe]++,!this[et].length&&!this[G]&&this[Me]();else if(t==="readable"&&this[q]!==0)super.emit("readable");else if(ra(t)&&this[Qt])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[Je]){let n=s;this[Ft]?Ke(()=>n.call(this,this[Je])):n.call(this,this[Je]);}return i}removeListener(t,s){return this.off(t,s)}off(t,s){let i=super.off(t,s);return t==="data"&&(this[pe]=this.listeners("data").length,this[pe]===0&&!this[ht]&&!this[et].length&&(this[G]=false)),i}removeAllListeners(t){let s=super.removeAllListeners(t);return (t==="data"||t===void 0)&&(this[pe]=0,!this[ht]&&!this[et].length&&(this[G]=false)),s}get emittedEnd(){return this[Qt]}[Bt](){!this[_s]&&!this[Qt]&&!this[W]&&this[V].length===0&&this[$t]&&(this[_s]=true,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Fs]&&this.emit("close"),this[_s]=false);}emit(t,...s){let i=s[0];if(t!=="error"&&t!=="close"&&t!==W&&this[W])return false;if(t==="data")return !this[X]&&!i?false:this[Ft]?(Ke(()=>this[fi](i)),true):this[fi](i);if(t==="end")return this[Yi]();if(t==="close"){if(this[Fs]=true,!this[Qt]&&!this[W])return false;let o=super.emit("close");return this.removeAllListeners("close"),o}else if(t==="error"){this[Je]=i,super.emit(di,i);let o=!this[Ze]||this.listeners("error").length?super.emit("error",i):false;return this[Bt](),o}else if(t==="resume"){let o=super.emit("resume");return this[Bt](),o}else if(t==="finish"||t==="prefinish"){let o=super.emit(t);return this.removeAllListeners(t),o}let n=super.emit(t,...s);return this[Bt](),n}[fi](t){for(let i of this[et])i.dest.write(t)===false&&this.pause();let s=this[ht]?false:super.emit("data",t);return this[Bt](),s}[Yi](){return this[Qt]?false:(this[Qt]=true,this.readable=false,this[Ft]?(Ke(()=>this[gi]()),true):this[gi]())}[gi](){if(this[Ae]){let s=this[Ae].end();if(s){for(let i of this[et])i.dest.write(s);this[ht]||super.emit("data",s);}}for(let s of this[et])s.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[X]||(t.dataLength=0);let s=this.promise();return this.on("data",i=>{t.push(i),this[X]||(t.dataLength+=i.length);}),await s,t}async concat(){if(this[X])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[xt]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,s)=>{this.on(W,()=>s(new Error("stream destroyed"))),this.on("error",i=>s(i)),this.on("end",()=>t());})}[Symbol.asyncIterator](){this[ht]=false;let t=false,s=async()=>(this.pause(),t=true,{value:void 0,done:true});return {next:()=>{if(t)return s();let i=this.read();if(i!==null)return Promise.resolve({done:false,value:i});if(this[$t])return s();let n,o,a=f=>{this.off("data",h),this.off("end",l),this.off(W,c),s(),o(f);},h=f=>{this.off("error",a),this.off("end",l),this.off(W,c),this.pause(),n({value:f,done:!!this[$t]});},l=()=>{this.off("error",a),this.off("data",h),this.off(W,c),s(),n({done:true,value:void 0});},c=()=>a(new Error("stream destroyed"));return new Promise((f,d)=>{o=d,n=f,this.once(W,c),this.once("error",a),this.once("end",l),this.once("data",h);})},throw:s,return:s,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[ht]=false;let t=false,s=()=>(this.pause(),this.off(di,s),this.off(W,s),this.off("end",s),t=true,{done:true,value:void 0}),i=()=>{if(t)return s();let n=this.read();return n===null?s():{done:false,value:n}};return this.once("end",s),this.once(di,s),this.once(W,s),{next:i,throw:s,return:s,[Symbol.iterator](){return this}}}destroy(t){if(this[W])return t?this.emit("error",t):this.emit(W),this;this[W]=true,this[ht]=true,this[V].length=0,this[q]=0;let s=this;return typeof s.close=="function"&&!this[Fs]&&s.close(),t?this.emit("error",t):this.emit(W),this}static get isStream(){return ta}},ca=realpathSync.native,ts={lstatSync:lstatSync,readdir:readdir$1,readdirSync:readdirSync,readlinkSync:readlinkSync,realpathSync:ca,promises:{lstat:lstat,readdir:readdir,readlink:readlink,realpath:realpath}},Qr=e=>!e||e===ts||e===Ho?ts:{...ts,...e,promises:{...ts.promises,...e.promises||{}}},Xr=/^\\\\\?\\([a-z]:)\\?$/i,ua=e=>e.replace(/\//g,"\\").replace(Xr,"$1\\"),pa=/[\\\/]/,wt=0,tn=1,en=2,Pt=4,sn=6,rn=8,de=10,nn=12,mt=15,Ye=~mt,yi=16,Qi=32,es=64,Et=128,Ws=256,Us=512,Xi=es|Et|Us,da=1023,wi=e=>e.isFile()?rn:e.isDirectory()?Pt:e.isSymbolicLink()?de:e.isCharacterDevice()?en:e.isBlockDevice()?sn:e.isSocket()?nn:e.isFIFO()?tn:wt,tr=new Ys({max:2**12}),ss=e=>{let t=tr.get(e);if(t)return t;let s=e.normalize("NFKD");return tr.set(e,s),s},er=new Ys({max:2**12}),js=e=>{let t=er.get(e);if(t)return t;let s=ss(e.toLowerCase());return er.set(e,s),s},sr=class extends Ys{constructor(){super({max:256});}},fa=class extends Ys{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1});}},on=Symbol("PathScurry setAsCwd"),rt,hs,ls,cs,us,ps,ds,fs,gs,ms,ys,ws,bs,vs,Ss,xs,Es,ks,Cs,oe,ve,Nt,Vt,qt,Jt,M,Se,Ht,Wt,T,Oi,Gs,is,Ri,Ti,rs,Vs,Ai,Mi,qs,an,hn,ln,Li,je,Ie,cn,xe,Ar,at=(Ar=class{constructor(e,t=wt,s,i,n,o,a){y(this,T);p(this,"name");p(this,"root");p(this,"roots");p(this,"parent");p(this,"nocase");p(this,"isCWD",false);y(this,rt);y(this,hs);y(this,ls);y(this,cs);y(this,us);y(this,ps);y(this,ds);y(this,fs);y(this,gs);y(this,ms);y(this,ys);y(this,ws);y(this,bs);y(this,vs);y(this,Ss);y(this,xs);y(this,Es);y(this,ks);y(this,Cs);y(this,oe);y(this,ve);y(this,Nt);y(this,Vt);y(this,qt);y(this,Jt);y(this,M);y(this,Se);y(this,Ht);y(this,Wt);y(this,je,[]);y(this,Ie,false);y(this,xe);this.name=e,u(this,oe,n?js(e):ss(e)),u(this,M,t&da),this.nocase=n,this.roots=i,this.root=s||this,u(this,Se,o),u(this,Nt,a.fullpath),u(this,qt,a.relative),u(this,Jt,a.relativePosix),this.parent=a.parent,this.parent?u(this,rt,r(this.parent,rt)):u(this,rt,Qr(a.fs));}get dev(){return r(this,hs)}get mode(){return r(this,ls)}get nlink(){return r(this,cs)}get uid(){return r(this,us)}get gid(){return r(this,ps)}get rdev(){return r(this,ds)}get blksize(){return r(this,fs)}get ino(){return r(this,gs)}get size(){return r(this,ms)}get blocks(){return r(this,ys)}get atimeMs(){return r(this,ws)}get mtimeMs(){return r(this,bs)}get ctimeMs(){return r(this,vs)}get birthtimeMs(){return r(this,Ss)}get atime(){return r(this,xs)}get mtime(){return r(this,Es)}get ctime(){return r(this,ks)}get birthtime(){return r(this,Cs)}get parentPath(){return (this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return r(this,ve)!==void 0?r(this,ve):this.parent?u(this,ve,this.parent.depth()+1):u(this,ve,0)}childrenCache(){return r(this,Se)}resolve(e){var i;if(!e)return this;let t=this.getRootString(e),s=e.substring(t.length).split(this.splitSep);return t?m(i=this.getRoot(t),T,Oi).call(i,s):m(this,T,Oi).call(this,s)}children(){let e=r(this,Se).get(this);if(e)return e;let t=Object.assign([],{provisional:0});return r(this,Se).set(this,t),u(this,M,r(this,M)&~yi),t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let s=this.children(),i=this.nocase?js(e):ss(e);for(let h of s)if(r(h,oe)===i)return h;let n=this.parent?this.sep:"",o=r(this,Nt)?r(this,Nt)+n+e:void 0,a=this.newChild(e,wt,{...t,parent:this,fullpath:o});return this.canReaddir()||u(a,M,r(a,M)|Et),s.push(a),a}relative(){if(this.isCWD)return "";if(r(this,qt)!==void 0)return r(this,qt);let e=this.name,t=this.parent;if(!t)return u(this,qt,this.name);let s=t.relative();return s+(!s||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return "";if(r(this,Jt)!==void 0)return r(this,Jt);let e=this.name,t=this.parent;if(!t)return u(this,Jt,this.fullpathPosix());let s=t.relativePosix();return s+(!s||!t.parent?"":"/")+e}fullpath(){if(r(this,Nt)!==void 0)return r(this,Nt);let e=this.name,t=this.parent;if(!t)return u(this,Nt,this.name);let s=t.fullpath()+(t.parent?this.sep:"")+e;return u(this,Nt,s)}fullpathPosix(){if(r(this,Vt)!==void 0)return r(this,Vt);if(this.sep==="/")return u(this,Vt,this.fullpath());if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return /^[a-z]:\//i.test(i)?u(this,Vt,`//?/${i}`):u(this,Vt,i)}let e=this.parent,t=e.fullpathPosix(),s=t+(!t||!e.parent?"":"/")+this.name;return u(this,Vt,s)}isUnknown(){return (r(this,M)&mt)===wt}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return (r(this,M)&mt)===rn}isDirectory(){return (r(this,M)&mt)===Pt}isCharacterDevice(){return (r(this,M)&mt)===en}isBlockDevice(){return (r(this,M)&mt)===sn}isFIFO(){return (r(this,M)&mt)===tn}isSocket(){return (r(this,M)&mt)===nn}isSymbolicLink(){return (r(this,M)&de)===de}lstatCached(){return r(this,M)&Qi?this:void 0}readlinkCached(){return r(this,Ht)}realpathCached(){return r(this,Wt)}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(r(this,Ht))return true;if(!this.parent)return false;let e=r(this,M)&mt;return !(e!==wt&&e!==de||r(this,M)&Ws||r(this,M)&Et)}calledReaddir(){return !!(r(this,M)&yi)}isENOENT(){return !!(r(this,M)&Et)}isNamed(e){return this.nocase?r(this,oe)===js(e):r(this,oe)===ss(e)}async readlink(){let e=r(this,Ht);if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await r(this,rt).promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(t);if(s)return u(this,Ht,s)}catch(t){m(this,T,Mi).call(this,t.code);return}}readlinkSync(){let e=r(this,Ht);if(e)return e;if(this.canReadlink()&&this.parent)try{let t=r(this,rt).readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(t);if(s)return u(this,Ht,s)}catch(t){m(this,T,Mi).call(this,t.code);return}}async lstat(){if((r(this,M)&Et)===0)try{return m(this,T,Li).call(this,await r(this,rt).promises.lstat(this.fullpath())),this}catch(e){m(this,T,Ai).call(this,e.code);}}lstatSync(){if((r(this,M)&Et)===0)try{return m(this,T,Li).call(this,r(this,rt).lstatSync(this.fullpath())),this}catch(e){m(this,T,Ai).call(this,e.code);}}readdirCB(e,t=false){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);t?e(null,n):queueMicrotask(()=>e(null,n));return}if(r(this,je).push(e),r(this,Ie))return;u(this,Ie,true);let i=this.fullpath();r(this,rt).readdir(i,{withFileTypes:true},(n,o)=>{if(n)m(this,T,Vs).call(this,n.code),s.provisional=0;else {for(let a of o)m(this,T,qs).call(this,a,s);m(this,T,Gs).call(this,s);}m(this,T,cn).call(this,s.slice(0,s.provisional));});}async readdir(){if(!this.canReaddir())return [];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(r(this,xe))await r(this,xe);else {let s=()=>{};u(this,xe,new Promise(i=>s=i));try{for(let i of await r(this,rt).promises.readdir(t,{withFileTypes:!0}))m(this,T,qs).call(this,i,e);m(this,T,Gs).call(this,e);}catch(i){m(this,T,Vs).call(this,i.code),e.provisional=0;}u(this,xe,void 0),s();}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return [];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let s of r(this,rt).readdirSync(t,{withFileTypes:!0}))m(this,T,qs).call(this,s,e);m(this,T,Gs).call(this,e);}catch(s){m(this,T,Vs).call(this,s.code),e.provisional=0;}return e.slice(0,e.provisional)}canReaddir(){if(r(this,M)&Xi)return false;let e=mt&r(this,M);return e===wt||e===Pt||e===de}shouldWalk(e,t){return (r(this,M)&Pt)===Pt&&!(r(this,M)&Xi)&&!e.has(this)&&(!t||t(this))}async realpath(){if(r(this,Wt))return r(this,Wt);if(!((Us|Ws|Et)&r(this,M)))try{let e=await r(this,rt).promises.realpath(this.fullpath());return u(this,Wt,this.resolve(e))}catch{m(this,T,Ti).call(this);}}realpathSync(){if(r(this,Wt))return r(this,Wt);if(!((Us|Ws|Et)&r(this,M)))try{let e=r(this,rt).realpathSync(this.fullpath());return u(this,Wt,this.resolve(e))}catch{m(this,T,Ti).call(this);}}[on](e){if(e===this)return;e.isCWD=false,this.isCWD=true;let t=new Set([]),s=[],i=this;for(;i&&i.parent;)t.add(i),u(i,qt,s.join(this.sep)),u(i,Jt,s.join("/")),i=i.parent,s.push("..");for(i=e;i&&i.parent&&!t.has(i);)u(i,qt,void 0),u(i,Jt,void 0),i=i.parent;}},rt=new WeakMap,hs=new WeakMap,ls=new WeakMap,cs=new WeakMap,us=new WeakMap,ps=new WeakMap,ds=new WeakMap,fs=new WeakMap,gs=new WeakMap,ms=new WeakMap,ys=new WeakMap,ws=new WeakMap,bs=new WeakMap,vs=new WeakMap,Ss=new WeakMap,xs=new WeakMap,Es=new WeakMap,ks=new WeakMap,Cs=new WeakMap,oe=new WeakMap,ve=new WeakMap,Nt=new WeakMap,Vt=new WeakMap,qt=new WeakMap,Jt=new WeakMap,M=new WeakMap,Se=new WeakMap,Ht=new WeakMap,Wt=new WeakMap,T=new WeakSet,Oi=function(e){let t=this;for(let s of e)t=t.child(s);return t},Gs=function(e){var t;u(this,M,r(this,M)|yi);for(let s=e.provisional;s<e.length;s++){let i=e[s];i&&m(t=i,T,is).call(t);}},is=function(){r(this,M)&Et||(u(this,M,(r(this,M)|Et)&Ye),m(this,T,Ri).call(this));},Ri=function(){var t;let e=this.children();e.provisional=0;for(let s of e)m(t=s,T,is).call(t);},Ti=function(){u(this,M,r(this,M)|Us),m(this,T,rs).call(this);},rs=function(){if(r(this,M)&es)return;let e=r(this,M);(e&mt)===Pt&&(e&=Ye),u(this,M,e|es),m(this,T,Ri).call(this);},Vs=function(e=""){e==="ENOTDIR"||e==="EPERM"?m(this,T,rs).call(this):e==="ENOENT"?m(this,T,is).call(this):this.children().provisional=0;},Ai=function(e=""){var t;e==="ENOTDIR"?m(t=this.parent,T,rs).call(t):e==="ENOENT"&&m(this,T,is).call(this);},Mi=function(e=""){var s;let t=r(this,M);t|=Ws,e==="ENOENT"&&(t|=Et),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Ye),u(this,M,t),e==="ENOTDIR"&&this.parent&&m(s=this.parent,T,rs).call(s);},qs=function(e,t){return m(this,T,hn).call(this,e,t)||m(this,T,an).call(this,e,t)},an=function(e,t){let s=wi(e),i=this.newChild(e.name,s,{parent:this}),n=r(i,M)&mt;return n!==Pt&&n!==de&&n!==wt&&u(i,M,r(i,M)|es),t.unshift(i),t.provisional++,i},hn=function(e,t){for(let s=t.provisional;s<t.length;s++){let i=t[s];if((this.nocase?js(e.name):ss(e.name))===r(i,oe))return m(this,T,ln).call(this,e,i,s,t)}},ln=function(e,t,s,i){let n=t.name;return u(t,M,r(t,M)&Ye|wi(e)),n!==e.name&&(t.name=e.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(t)),i.provisional++,t},Li=function(e){let{atime:t,atimeMs:s,birthtime:i,birthtimeMs:n,blksize:o,blocks:a,ctime:h,ctimeMs:l,dev:c,gid:f,ino:d,mode:g,mtime:v,mtimeMs:x,nlink:w,rdev:k,size:b,uid:C}=e;u(this,xs,t),u(this,ws,s),u(this,Cs,i),u(this,Ss,n),u(this,fs,o),u(this,ys,a),u(this,ks,h),u(this,vs,l),u(this,hs,c),u(this,ps,f),u(this,gs,d),u(this,ls,g),u(this,Es,v),u(this,bs,x),u(this,cs,w),u(this,ds,k),u(this,ms,b),u(this,us,C);let R=wi(e);u(this,M,r(this,M)&Ye|R|Qi),R!==wt&&R!==Pt&&R!==de&&u(this,M,r(this,M)|es);},je=new WeakMap,Ie=new WeakMap,cn=function(e){u(this,Ie,false);let t=r(this,je).slice();r(this,je).length=0,t.forEach(s=>s(null,e));},xe=new WeakMap,Ar),un=class pn extends at{constructor(s,i=wt,n,o,a,h,l){super(s,i,n,o,a,h,l);p(this,"sep","\\");p(this,"splitSep",pa);}newChild(s,i=wt,n={}){return new pn(s,i,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(s){return win32.parse(s).root}getRoot(s){if(s=ua(s.toUpperCase()),s===this.root.name)return this.root;for(let[i,n]of Object.entries(this.roots))if(this.sameRoot(s,i))return this.roots[s]=n;return this.roots[s]=new Ni(s,this).root}sameRoot(s,i=this.root.name){return s=s.toUpperCase().replace(/\//g,"\\").replace(Xr,"$1\\"),s===i}},dn=class fn extends at{constructor(s,i=wt,n,o,a,h,l){super(s,i,n,o,a,h,l);p(this,"splitSep","/");p(this,"sep","/");}getRootString(s){return s.startsWith("/")?"/":""}getRoot(s){return this.root}newChild(s,i=wt,n={}){return new fn(s,i,this.root,this.roots,this.nocase,this.childrenCache(),n)}},ze,$e,Os,Rs,Mr,gn=(Mr=class{constructor(e=process.cwd(),t,s,{nocase:i,childrenCacheSize:n=16*1024,fs:o=ts}={}){p(this,"root");p(this,"rootPath");p(this,"roots");p(this,"cwd");y(this,ze);y(this,$e);y(this,Os);p(this,"nocase");y(this,Rs);u(this,Rs,Qr(o)),(e instanceof URL||e.startsWith("file://"))&&(e=fileURLToPath(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),u(this,ze,new sr),u(this,$e,new sr),u(this,Os,new fa(n));let h=a.substring(this.rootPath.length).split(s);if(h.length===1&&!h[0]&&h.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(r(this,Rs)),this.roots[this.rootPath]=this.root;let l=this.root,c=h.length-1,f=t.sep,d=this.rootPath,g=false;for(let v of h){let x=c--;l=l.child(v,{relative:new Array(x).fill("..").join(f),relativePosix:new Array(x).fill("..").join("/"),fullpath:d+=(g?"":f)+v}),g=true;}this.cwd=l;}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return r(this,Os)}resolve(...e){let t="";for(let n=e.length-1;n>=0;n--){let o=e[n];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let s=r(this,ze).get(t);if(s!==void 0)return s;let i=this.cwd.resolve(t).fullpath();return r(this,ze).set(t,i),i}resolvePosix(...e){let t="";for(let n=e.length-1;n>=0;n--){let o=e[n];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let s=r(this,$e).get(t);if(s!==void 0)return s;let i=this.cwd.resolve(t).fullpathPosix();return r(this,$e).set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:true}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:s}=t;if(e.canReaddir()){let i=await e.readdir();return s?i:i.map(n=>n.name)}else return []}readdirSync(e=this.cwd,t={withFileTypes:true}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:s=true}=t;return e.canReaddir()?s?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e.withFileTypes,e=this.cwd);let s=await e.readlink();return t?s:s?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e.withFileTypes,e=this.cwd);let s=e.readlinkSync();return t?s:s?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e.withFileTypes,e=this.cwd);let s=await e.realpath();return t?s:s?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e.withFileTypes,e=this.cwd);let s=e.realpathSync();return t?s:s?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:s=true,follow:i=false,filter:n,walkFilter:o}=t,a=[];(!n||n(e))&&a.push(s?e:e.fullpath());let h=new Set,l=(f,d)=>{h.add(f),f.readdirCB((g,v)=>{if(g)return d(g);let x=v.length;if(!x)return d();let w=()=>{--x===0&&d();};for(let k of v)(!n||n(k))&&a.push(s?k:k.fullpath()),i&&k.isSymbolicLink()?k.realpath().then(b=>b?.isUnknown()?b.lstat():b).then(b=>b?.shouldWalk(h,o)?l(b,w):w()):k.shouldWalk(h,o)?l(k,w):w();},true);},c=e;return new Promise((f,d)=>{l(c,g=>{if(g)return d(g);f(a);});})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:s=true,follow:i=false,filter:n,walkFilter:o}=t,a=[];(!n||n(e))&&a.push(s?e:e.fullpath());let h=new Set([e]);for(let l of h){let c=l.readdirSync();for(let f of c){(!n||n(f))&&a.push(s?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync();}d.shouldWalk(h,o)&&h.add(d);}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:s=true,follow:i=false,filter:n,walkFilter:o}=t;(!n||n(e))&&(yield s?e:e.fullpath());let a=new Set([e]);for(let h of a){let l=h.readdirSync();for(let c of l){(!n||n(c))&&(yield s?c:c.fullpath());let f=c;if(c.isSymbolicLink()){if(!(i&&(f=c.realpathSync())))continue;f.isUnknown()&&f.lstatSync();}f.shouldWalk(a,o)&&a.add(f);}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:s=true,follow:i=false,filter:n,walkFilter:o}=t,a=new Zs({objectMode:true});(!n||n(e))&&a.write(s?e:e.fullpath());let h=new Set,l=[e],c=0,f=()=>{let d=false;for(;!d;){let g=l.shift();if(!g){c===0&&a.end();return}c++,h.add(g);let v=(w,k,b=false)=>{if(w)return a.emit("error",w);if(i&&!b){let C=[];for(let R of k)R.isSymbolicLink()&&C.push(R.realpath().then(O=>O?.isUnknown()?O.lstat():O));if(C.length){Promise.all(C).then(()=>v(null,k,true));return}}for(let C of k)C&&(!n||n(C))&&(a.write(s?C:C.fullpath())||(d=true));c--;for(let C of k){let R=C.realpathCached()||C;R.shouldWalk(h,o)&&l.push(R);}d&&!a.flowing?a.once("drain",f):x||f();},x=true;g.readdirCB(v,true),x=false;}};return f(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:s=true,follow:i=false,filter:n,walkFilter:o}=t,a=new Zs({objectMode:true}),h=new Set;(!n||n(e))&&a.write(s?e:e.fullpath());let l=[e],c=0,f=()=>{let d=false;for(;!d;){let g=l.shift();if(!g){c===0&&a.end();return}c++,h.add(g);let v=g.readdirSync();for(let x of v)(!n||n(x))&&(a.write(s?x:x.fullpath())||(d=true));c--;for(let x of v){let w=x;if(x.isSymbolicLink()){if(!(i&&(w=x.realpathSync())))continue;w.isUnknown()&&w.lstatSync();}w.shouldWalk(h,o)&&l.push(w);}}d&&!a.flowing&&a.once("drain",f);};return f(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[on](t);}},ze=new WeakMap,$e=new WeakMap,Os=new WeakMap,Rs=new WeakMap,Mr),Ni=class extends gn{constructor(t=process.cwd(),s={}){let{nocase:i=true}=s;super(t,win32,"\\",{...s,nocase:i});p(this,"sep","\\");this.nocase=i;for(let n=this.cwd;n;n=n.parent)n.nocase=this.nocase;}parseRootPath(t){return win32.parse(t).root.toUpperCase()}newRoot(t){return new un(this.rootPath,Pt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},Wi=class extends gn{constructor(t=process.cwd(),s={}){let{nocase:i=false}=s;super(t,posix,"/",{...s,nocase:i});p(this,"sep","/");this.nocase=i;}parseRootPath(t){return "/"}newRoot(t){return new dn(this.rootPath,Pt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},mn=class extends Wi{constructor(e=process.cwd(),t={}){let{nocase:s=true}=t;super(e,{...t,nocase:s});}};process.platform==="win32"?un:dn;var ga=process.platform==="win32"?Ni:process.platform==="darwin"?mn:Wi,ma=e=>e.length>=1,ya=e=>e.length>=1,B,ft,K,Ee,_t,Ts,ae,he,le,Be,Ue,yn=(Ue=class{constructor(t,s,i,n){y(this,B);y(this,ft);y(this,K);p(this,"length");y(this,Ee);y(this,_t);y(this,Ts);y(this,ae);y(this,he);y(this,le);y(this,Be,true);if(!ma(t))throw new TypeError("empty pattern list");if(!ya(s))throw new TypeError("empty glob list");if(s.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,i<0||i>=this.length)throw new TypeError("index out of range");if(u(this,B,t),u(this,ft,s),u(this,K,i),u(this,Ee,n),r(this,K)===0){if(this.isUNC()){let[o,a,h,l,...c]=r(this,B),[f,d,g,v,...x]=r(this,ft);c[0]===""&&(c.shift(),x.shift());let w=[o,a,h,l,""].join("/"),k=[f,d,g,v,""].join("/");u(this,B,[w,...c]),u(this,ft,[k,...x]),this.length=r(this,B).length;}else if(this.isDrive()||this.isAbsolute()){let[o,...a]=r(this,B),[h,...l]=r(this,ft);a[0]===""&&(a.shift(),l.shift());let c=o+"/",f=h+"/";u(this,B,[c,...a]),u(this,ft,[f,...l]),this.length=r(this,B).length;}}}pattern(){return r(this,B)[r(this,K)]}isString(){return typeof r(this,B)[r(this,K)]=="string"}isGlobstar(){return r(this,B)[r(this,K)]===nt}isRegExp(){return r(this,B)[r(this,K)]instanceof RegExp}globString(){return u(this,Ts,r(this,Ts)||(r(this,K)===0?this.isAbsolute()?r(this,ft)[0]+r(this,ft).slice(1).join("/"):r(this,ft).join("/"):r(this,ft).slice(r(this,K)).join("/")))}hasMore(){return this.length>r(this,K)+1}rest(){return r(this,_t)!==void 0?r(this,_t):this.hasMore()?(u(this,_t,new Ue(r(this,B),r(this,ft),r(this,K)+1,r(this,Ee))),u(r(this,_t),le,r(this,le)),u(r(this,_t),he,r(this,he)),u(r(this,_t),ae,r(this,ae)),r(this,_t)):u(this,_t,null)}isUNC(){let t=r(this,B);return r(this,he)!==void 0?r(this,he):u(this,he,r(this,Ee)==="win32"&&r(this,K)===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3])}isDrive(){let t=r(this,B);return r(this,ae)!==void 0?r(this,ae):u(this,ae,r(this,Ee)==="win32"&&r(this,K)===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]))}isAbsolute(){let t=r(this,B);return r(this,le)!==void 0?r(this,le):u(this,le,t[0]===""&&t.length>1||this.isDrive()||this.isUNC())}root(){let t=r(this,B)[0];return typeof t=="string"&&this.isAbsolute()&&r(this,K)===0?t:""}checkFollowGlobstar(){return !(r(this,K)===0||!this.isGlobstar()||!r(this,Be))}markFollowGlobstar(){return r(this,K)===0||!this.isGlobstar()||!r(this,Be)?false:(u(this,Be,false),true)}},B=new WeakMap,ft=new WeakMap,K=new WeakMap,Ee=new WeakMap,_t=new WeakMap,Ts=new WeakMap,ae=new WeakMap,he=new WeakMap,le=new WeakMap,Be=new WeakMap,Ue),wa=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ir=class{constructor(e,{nobrace:t,nocase:s,noext:i,noglobstar:n,platform:o=wa}){p(this,"relative");p(this,"relativeChildren");p(this,"absolute");p(this,"absoluteChildren");p(this,"platform");p(this,"mmopts");this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:true,nobrace:t,nocase:s,noext:i,noglobstar:n,optimizationLevel:2,platform:o,nocomment:true,nonegate:true};for(let a of e)this.add(a);}add(e){let t=new ue(e,this.mmopts);for(let s=0;s<t.set.length;s++){let i=t.set[s],n=t.globParts[s];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let o=new yn(i,n,0,this.platform),a=new ue(o.globString(),this.mmopts),h=n[n.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),h&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a));}}ignored(e){let t=e.fullpath(),s=`${t}/`,i=e.relative()||".",n=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(n))return true;for(let o of this.absolute)if(o.match(t)||o.match(s))return true;return false}childrenIgnored(e){let t=e.fullpath()+"/",s=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(s))return true;for(let i of this.absoluteChildren)if(i.match(t))return true;return false}},ba=class wn{constructor(t=new Map){p(this,"store");this.store=t;}copy(){return new wn(new Map(this.store))}hasWalked(t,s){return this.store.get(t.fullpath())?.has(s.globString())}storeWalked(t,s){let i=t.fullpath(),n=this.store.get(i);n?n.add(s.globString()):this.store.set(i,new Set([s.globString()]));}},va=class{constructor(){p(this,"store",new Map);}add(e,t,s){let i=(t?2:0)|(s?1:0),n=this.store.get(e);this.store.set(e,n===void 0?i:i&n);}entries(){return [...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},Sa=class{constructor(){p(this,"store",new Map);}add(e,t){if(!e.canReaddir())return;let s=this.store.get(e);s?s.find(i=>i.globString()===t.globString())||s.push(t):this.store.set(e,[t]);}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return [...this.store.keys()].filter(e=>e.canReaddir())}},rr=class bn{constructor(t,s){p(this,"hasWalkedCache");p(this,"matches",new va);p(this,"subwalks",new Sa);p(this,"patterns");p(this,"follow");p(this,"dot");p(this,"opts");this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=s?s.copy():new ba;}processPatterns(t,s){this.patterns=s;let i=s.map(n=>[t,n]);for(let[n,o]of i){this.hasWalkedCache.storeWalked(n,o);let a=o.root(),h=o.isAbsolute()&&this.opts.absolute!==false;if(a){n=n.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let d=o.rest();if(d)o=d;else {this.matches.add(n,true,false);continue}}if(n.isENOENT())continue;let l,c,f=false;for(;typeof(l=o.pattern())=="string"&&(c=o.rest());)n=n.resolve(l),o=c,f=true;if(l=o.pattern(),c=o.rest(),f){if(this.hasWalkedCache.hasWalked(n,o))continue;this.hasWalkedCache.storeWalked(n,o);}if(typeof l=="string"){let d=l===".."||l===""||l===".";this.matches.add(n.resolve(l),h,d);continue}else if(l===nt){(!n.isSymbolicLink()||this.follow||o.checkFollowGlobstar())&&this.subwalks.add(n,o);let d=c?.pattern(),g=c?.rest();if(!c||(d===""||d===".")&&!g)this.matches.add(n,h,d===""||d===".");else if(d===".."){let v=n.parent||n;g?this.hasWalkedCache.hasWalked(v,g)||this.subwalks.add(v,g):this.matches.add(v,h,true);}}else l instanceof RegExp&&this.subwalks.add(n,o);}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new bn(this.opts,this.hasWalkedCache)}filterEntries(t,s){let i=this.subwalks.get(t),n=this.child();for(let o of s)for(let a of i){let h=a.isAbsolute(),l=a.pattern(),c=a.rest();l===nt?n.testGlobstar(o,a,c,h):l instanceof RegExp?n.testRegExp(o,l,c,h):n.testString(o,l,c,h);}return n}testGlobstar(t,s,i,n){if((this.dot||!t.name.startsWith("."))&&(s.hasMore()||this.matches.add(t,n,false),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,s):t.isSymbolicLink()&&(i&&s.checkFollowGlobstar()?this.subwalks.add(t,i):s.markFollowGlobstar()&&this.subwalks.add(t,s)))),i){let o=i.pattern();if(typeof o=="string"&&o!==".."&&o!==""&&o!==".")this.testString(t,o,i.rest(),n);else if(o===".."){let a=t.parent||t;this.subwalks.add(a,i);}else o instanceof RegExp&&this.testRegExp(t,o,i.rest(),n);}}testRegExp(t,s,i,n){s.test(t.name)&&(i?this.subwalks.add(t,i):this.matches.add(t,n,false));}testString(t,s,i,n){t.isNamed(s)&&(i?this.subwalks.add(t,i):this.matches.add(t,n,false));}},xa=(e,t)=>typeof e=="string"?new ir([e],t):Array.isArray(e)?new ir(e,t):e,Ge,Zt,ke,bt,fe,_i,Lr,vn=(Lr=class{constructor(e,t,s){y(this,bt);p(this,"path");p(this,"patterns");p(this,"opts");p(this,"seen",new Set);p(this,"paused",false);p(this,"aborted",false);y(this,Ge,[]);y(this,Zt);y(this,ke);p(this,"signal");p(this,"maxDepth");p(this,"includeChildMatches");if(this.patterns=e,this.path=t,this.opts=s,u(this,ke,!s.posix&&s.platform==="win32"?"\\":"/"),this.includeChildMatches=s.includeChildMatches!==false,(s.ignore||!this.includeChildMatches)&&(u(this,Zt,xa(s.ignore??[],s)),!this.includeChildMatches&&typeof r(this,Zt).add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{r(this,Ge).length=0;}));}pause(){this.paused=true;}resume(){if(this.signal?.aborted)return;this.paused=false;let e;for(;!this.paused&&(e=r(this,Ge).shift());)e();}onResume(e){this.signal?.aborted||(this.paused?r(this,Ge).push(e):e());}async matchCheck(e,t){if(t&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=e.realpathCached()||await e.realpath(),!s)return;e=s;}let i=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let n=await i.realpath();n&&(n.isUnknown()||this.opts.stat)&&await n.lstat();}return this.matchCheckTest(i,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!m(this,bt,fe).call(this,e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=e.realpathCached()||e.realpathSync(),!s)return;e=s;}let i=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let n=i.realpathSync();n&&(n?.isUnknown()||this.opts.stat)&&n.lstatSync();}return this.matchCheckTest(i,t)}matchFinish(e,t){if(m(this,bt,fe).call(this,e))return;if(!this.includeChildMatches&&r(this,Zt)?.add){let n=`${e.relativePosix()}/**`;r(this,Zt).add(n);}let s=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?r(this,ke):"";if(this.opts.withFileTypes)this.matchEmit(e);else if(s){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+i);}else {let n=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!n.startsWith(".."+r(this,ke))?"."+r(this,ke):"";this.matchEmit(n?o+n+i:"."+i);}}async match(e,t,s){let i=await this.matchCheck(e,s);i&&this.matchFinish(i,t);}matchSync(e,t,s){let i=this.matchCheckSync(e,s);i&&this.matchFinish(i,t);}walkCB(e,t,s){this.signal?.aborted&&s(),this.walkCB2(e,t,new rr(this.opts),s);}walkCB2(e,t,s,i){if(m(this,bt,_i).call(this,e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,s,i));return}s.processPatterns(e,t);let n=1,o=()=>{--n===0&&i();};for(let[a,h,l]of s.matches.entries())m(this,bt,fe).call(this,a)||(n++,this.match(a,h,l).then(()=>o()));for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;n++;let h=a.readdirCached();a.calledReaddir()?this.walkCB3(a,h,s,o):a.readdirCB((l,c)=>this.walkCB3(a,c,s,o),true);}o();}walkCB3(e,t,s,i){s=s.filterEntries(e,t);let n=1,o=()=>{--n===0&&i();};for(let[a,h,l]of s.matches.entries())m(this,bt,fe).call(this,a)||(n++,this.match(a,h,l).then(()=>o()));for(let[a,h]of s.subwalks.entries())n++,this.walkCB2(a,h,s.child(),o);o();}walkCBSync(e,t,s){this.signal?.aborted&&s(),this.walkCB2Sync(e,t,new rr(this.opts),s);}walkCB2Sync(e,t,s,i){if(m(this,bt,_i).call(this,e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,s,i));return}s.processPatterns(e,t);let n=1,o=()=>{--n===0&&i();};for(let[a,h,l]of s.matches.entries())m(this,bt,fe).call(this,a)||this.matchSync(a,h,l);for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;n++;let h=a.readdirSync();this.walkCB3Sync(a,h,s,o);}o();}walkCB3Sync(e,t,s,i){s=s.filterEntries(e,t);let n=1,o=()=>{--n===0&&i();};for(let[a,h,l]of s.matches.entries())m(this,bt,fe).call(this,a)||this.matchSync(a,h,l);for(let[a,h]of s.subwalks.entries())n++,this.walkCB2Sync(a,h,s.child(),o);o();}},Ge=new WeakMap,Zt=new WeakMap,ke=new WeakMap,bt=new WeakSet,fe=function(e){return this.seen.has(e)||!!r(this,Zt)?.ignored?.(e)},_i=function(e){return !!r(this,Zt)?.childrenIgnored?.(e)},Lr),nr=class extends vn{constructor(t,s,i){super(t,s,i);p(this,"matches",new Set);}matchEmit(t){this.matches.add(t);}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,s)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?s(this.signal.reason):t(this.matches);});}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},or=class extends vn{constructor(t,s,i){super(t,s,i);p(this,"results");this.results=new Zs({signal:this.signal,objectMode:true}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume());}matchEmit(t){this.results.write(t),this.results.flowing||this.pause();}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end());}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}},Ea=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Oe=class{constructor(e,t){p(this,"absolute");p(this,"cwd");p(this,"root");p(this,"dot");p(this,"dotRelative");p(this,"follow");p(this,"ignore");p(this,"magicalBraces");p(this,"mark");p(this,"matchBase");p(this,"maxDepth");p(this,"nobrace");p(this,"nocase");p(this,"nodir");p(this,"noext");p(this,"noglobstar");p(this,"pattern");p(this,"platform");p(this,"realpath");p(this,"scurry");p(this,"stat");p(this,"signal");p(this,"windowsPathsNoEscape");p(this,"withFileTypes");p(this,"includeChildMatches");p(this,"opts");p(this,"patterns");if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=fileURLToPath(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==false,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===false,this.windowsPathsNoEscape&&(e=e.map(h=>h.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(h=>h.includes("/")?h:`./**/${h}`);}if(this.pattern=e,this.platform=t.platform||Ea,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else {let h=t.platform==="win32"?Ni:t.platform==="darwin"?mn:t.platform?Wi:ga;this.scurry=new h(this.cwd,{nocase:t.nocase,fs:t.fs});}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(h=>new ue(h,i)),[o,a]=n.reduce((h,l)=>(h[0].push(...l.set),h[1].push(...l.globParts),h),[[],[]]);this.patterns=o.map((h,l)=>{let c=a[l];if(!c)throw new Error("invalid pattern object");return new yn(h,c,0,this.platform)});}async walk(){return [...await new nr(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return [...new nr(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new or(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new or(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}},ka=(e,t={})=>{Array.isArray(e)||(e=[e]);for(let s of e)if(new ue(s,t).hasMagic())return true;return false};function Qs(e,t={}){return new Oe(e,t).streamSync()}function Sn(e,t={}){return new Oe(e,t).stream()}function xn(e,t={}){return new Oe(e,t).walkSync()}async function ar(e,t={}){return new Oe(e,t).walk()}function Xs(e,t={}){return new Oe(e,t).iterateSync()}function En(e,t={}){return new Oe(e,t).iterate()}var Ca=Qs,Oa=Object.assign(Sn,{sync:Qs}),Ra=Xs,Ta=Object.assign(En,{sync:Xs}),Aa=Object.assign(xn,{stream:Qs,iterate:Xs}),Ks=Object.assign(ar,{glob:ar,globSync:xn,sync:Aa,globStream:Sn,stream:Oa,globStreamSync:Qs,streamSync:Ca,globIterate:En,iterate:Ta,globIterateSync:Xs,iterateSync:Ra,Glob:Oe,hasMagic:ka,escape:$r,unescape:Le});Ks.glob=Ks;var Cn=On.join(process.cwd(),"log"),ti;(O=>{O.Level=La.enum(["DEBUG","INFO","WARN","ERROR"]).meta({ref:"LogLevel",description:"Log level"});let t={DEBUG:0,INFO:1,WARN:2,ERROR:3},s="INFO";function i(E){return t[E]>=t[s]}function n(){return s}O.getLevel=n;let o=new Map;O.Default=R({service:"default"});let h="";function l(){return h}O.file=l;let c,f,d=false,g=E=>{try{process.stderr.write(E);}catch{}},v=false;async function x(E){if(E.level&&(s=E.level),k(Cn).catch(A=>{}),E.print){d=true;return}h=On.join(Cn,E.dev?"dev.log":(new Date().toISOString().split(".")[0]??"").replace(/:/g,"")+".log");try{c=await kn.open(h,"w"),f=createWriteStream("",{fd:c.fd,autoClose:!1}),g=A=>{if(!(v||!f||f.destroyed))try{if(!f.writable)return;f.write(A,_=>{_&&!v&&(v=!0,setTimeout(()=>{v=!1;},1e3));});}catch{v||(v=!0,setTimeout(()=>{v=!1;},1e3));}},d=!0;}catch{g=_=>{try{process.stderr.write(_);}catch{}},d=true;}}O.init=x;async function w(){d&&(f&&!f.destroyed&&(await new Promise((E,A)=>{f.end(_=>{_?A(_):E();});}).catch(E=>{console.error("Failed to close log stream:",E);}),f=void 0),c&&(await c.close().catch(E=>{console.error("Failed to close log file handle:",E);}),c=void 0),g=E=>{try{process.stderr.write(E);}catch{}},d=false);}O.close=w;async function k(E){let A=await Ks("????-??-??T??????.log",{cwd:E,absolute:true});if(A.length<=5)return;let _=A.slice(0,-10);await Promise.all(_.map(Q=>kn.unlink(Q).catch(()=>{})));}function b(E,A=0){let _=E.message;return E.cause instanceof Error&&A<10?_+" Caused by: "+b(E.cause,A+1):_}let C=Date.now();function R(E){E=E||{};let A=E.service;if(A&&typeof A=="string"){let F=o.get(A);if(F)return F}function _(F,U){let ri=Object.entries({...E,...U}).filter(([ji,Kt])=>Kt!=null).map(([ji,Kt])=>{let ni=`${ji}=`;return Kt instanceof Error?ni+b(Kt):typeof Kt=="object"?ni+JSON.stringify(Kt):ni+Kt}).join(" "),St=new Date,Mn=St.getTime()-C;return C=St.getTime(),[St.getFullYear()+"-"+String(St.getMonth()+1).padStart(2,"0")+"-"+String(St.getDate()).padStart(2,"0")+"T"+String(St.getHours()).padStart(2,"0")+":"+String(St.getMinutes()).padStart(2,"0")+":"+String(St.getSeconds()).padStart(2,"0"),"+"+Mn+"ms",ri,F].filter(Boolean).join(" ")+`
5
+ `}let Q={debug(F,U){i("DEBUG")&&g("DEBUG "+_(F,U));},info(F,U){i("INFO")&&g("INFO "+_(F,U));},error(F,U){i("ERROR")&&g("ERROR "+_(F,U));},warn(F,U){i("WARN")&&g("WARN "+_(F,U));},tag(F,U){return E&&(E[F]=U),Q},clone(){return O.create({...E})},time(F,U){let ri=Date.now();Q.info(F,{status:"started",...U});function St(){Q.info(F,{status:"completed",duration:Date.now()-ri,...U});}return {stop:St,[Symbol.dispose](){St();}}}};return A&&typeof A=="string"&&o.set(A,Q),Q}O.create=R;})(ti||(ti={}));var vt=ti.create({service:"ollama-sdk",module:"native-language-model"});function ei(){return `${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function si(e){if(!e||e.trim().length===0)return false;try{return JSON.parse(e),!0}catch{return false}}function Rn(e){return typeof e=="string"?e:JSON.stringify(e)}function Tn(e){return !e.tools||e.tools.length===0?{}:{tools:e.tools.map(t=>{if(!t.name)throw new Ve(t.name||"unknown","name");let s=t.inputSchema||t.parameters;if(!s)throw new Ve(t.name,"inputSchema");return {type:"function",function:{name:t.name,description:t.description,parameters:s}}})}}function An(e){let t=[];for(let s of e)try{switch(s.role){case "system":t.push({role:"system",content:s.content});break;case "user":{let i=s.content.filter(n=>n.type==="text").map(n=>n.text).join(`
6
+ `);i&&t.push({role:"user",content:i});break}case "assistant":{let i="",n=[];for(let o of s.content)if(o.type==="text")i+=o.text;else if(o.type==="tool-call"){let a=o;n.push({id:a.toolCallId,type:"function",function:{name:a.toolName,arguments:JSON.stringify(a.input)}});}t.push({role:"assistant",content:i||null,tool_calls:n.length>0?n:void 0});break}case "tool":for(let i of s.content){let n=i.output,o;switch(n.type){case "text":case "error-text":o=n.value;break;case "content":case "json":case "error-json":o=JSON.stringify(n.value);break;default:o=String(n.value);break}t.push({role:"tool",tool_call_id:i.toolCallId,content:o});}break}}catch(i){vt.warn("Failed to convert message",{messageRole:s.role,error:i instanceof Error?i.message:String(i)});}return t}var ii=class{constructor(t,s={}){p(this,"specificationVersion","v2");p(this,"provider","ollama");p(this,"modelId");p(this,"defaultObjectGenerationMode","json");p(this,"supportedUrls",{});p(this,"client");this.modelId=t,this.client=new Ms(s.baseURL);}async doStream(t){let s=ei();vt.debug("Stream request started",{traceId:s,modelId:this.modelId,hasTools:!!t.tools&&t.tools.length>0,toolCount:t.tools?.length||0,messageCount:t.prompt.length});let i=An(t.prompt),n=Tn({tools:t.tools}),o=JSON.stringify({model:this.modelId,messages:i,options:Te,...n});return {stream:new ReadableStream({start:async h=>{try{let l=!0,c=!1,f=!1,d="",g="",v=!1,x=[],w=[],k=()=>{if(w.length>0){for(let C of w)h.enqueue(C);w.length=0;}},b=null;for await(let C of this.client.streamChat({model:this.modelId,messages:i,options:Te,...n})){if(b&&b.chunkCount++,l){l=!1;let R={type:"response-metadata",id:ei(),modelId:this.modelId,timestamp:new Date(C.created_at)};h.enqueue(R),b&&b.eventCount++;}if(C.message?.tool_calls){f&&(w.push({type:"reasoning-end",id:"reasoning-0"}),f=!1),c&&(w.push({type:"text-end",id:"txt-0"}),c=!1);for(let R of C.message.tool_calls){if(!R.id||!R.function?.name){let F=R.id?"function.name":"id";vt.error("Invalid tool call: missing field",{traceId:s,missingField:F,toolCall:void 0}),w.push({type:"error",error:`Invalid tool call: missing ${F}`});continue}let O=R.id,E=R.function.name,A=Rn(R.function.arguments),_=x.find(F=>F.id===O);_?(_.function.arguments+=A,vt.debug("Tool call arguments accumulated",{traceId:s,toolCallId:O,toolName:E,deltaLength:A.length,totalLength:_.function.arguments.length,isComplete:si(_.function.arguments)}),A&&w.push({type:"tool-input-delta",id:O,delta:A})):(_={id:O,type:"function",function:{name:E,arguments:A},hasFinished:!1},x.push(_),b&&b.toolCallCount++,vt.debug("Tool call received",{traceId:s,toolCallId:O,toolName:E,argumentsLength:A.length,isComplete:si(A)}),w.push({type:"tool-input-start",id:O,toolName:E}),A&&w.push({type:"tool-input-delta",id:O,delta:A}));let Q=si(_.function.arguments);!_.hasFinished&&Q&&(vt.debug("Tool call arguments complete",{traceId:s,toolCallId:O,toolName:E,isComplete:Q,argumentsLength:_.function.arguments.length}),w.push({type:"tool-input-end",id:O}),w.push({type:"tool-call",toolCallId:O,toolName:E,input:_.function.arguments}),_.hasFinished=!0);}k(),b&&(b.eventCount+=w.length);}if(C.message?.content){let R=C.message.content;for(g+=R;g.length>0;)if(v){let O=g.indexOf("</think>");if(O===-1){g.length>0&&h.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:g}),g="";break}else {if(O>0){let E=g.substring(0,O);h.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:E});}h.enqueue({type:"reasoning-end",id:"reasoning-0"}),f=!1,v=!1,g=g.substring(O+8);}}else {let O=g.indexOf("<think>");if(O===-1){g.length>0&&(c||(c=!0,h.enqueue({type:"text-start",id:"txt-0"})),h.enqueue({type:"text-delta",id:"txt-0",delta:g}),d+=g),g="";break}else {if(O>0){let E=g.substring(0,O);c||(c=!0,h.enqueue({type:"text-start",id:"txt-0"})),h.enqueue({type:"text-delta",id:"txt-0",delta:E}),d+=E,h.enqueue({type:"text-end",id:"txt-0"}),c=!1;}v=!0,g=g.substring(O+7),f||(f=!0,h.enqueue({type:"reasoning-start",id:"reasoning-0"}));}}}if(C.done){let R=x.filter(A=>!A.hasFinished);for(let A of R)w.push({type:"tool-input-end",id:A.id}),w.push({type:"tool-call",toolCallId:A.id,toolName:A.function.name,input:A.function.arguments});g.length>0&&(v?(w.push({type:"reasoning-delta",id:"reasoning-0",delta:g}),w.push({type:"reasoning-end",id:"reasoning-0"})):(c||(c=!0,w.push({type:"text-start",id:"txt-0"})),w.push({type:"text-delta",id:"txt-0",delta:g}),d+=g)),c&&w.push({type:"text-end",id:"txt-0"});let E=x.length>0?"tool-calls":"stop";if(w.push({type:"finish",finishReason:E,usage:{inputTokens:C.prompt_eval_count||0,outputTokens:C.eval_count||0,totalTokens:(C.prompt_eval_count||0)+(C.eval_count||0)},providerMetadata:{ollama:{totalDuration:C.total_duration||0,loadDuration:C.load_duration||0,promptEvalDuration:C.prompt_eval_duration||0,evalDuration:C.eval_duration||0}}}),k(),b&&(b.eventCount+=w.length),b);x.length=0;}}}catch(l){vt.error("Stream processing error",{traceId:s,error:l instanceof Error?l.message:String(l),stack:void 0}),h.enqueue({type:"error",error:l instanceof Error?l.message:String(l)}),h.enqueue({type:"finish",finishReason:"error",usage:{inputTokens:0,outputTokens:0,totalTokens:0}});}finally{h.close();}}}),request:{body:o},response:{}}}async doGenerate(t){let s=ei();vt.debug("Generate request started",{traceId:s,modelId:this.modelId,hasTools:!!t.tools&&t.tools.length>0,toolCount:t.tools?.length||0,messageCount:t.prompt.length});let i=An(t.prompt),n=Tn({tools:t.tools}),o=await this.client.chat({model:this.modelId,messages:i,options:Te,...n}),a=[];if(o.message?.content&&a.push({type:"text",text:o.message.content}),o.message?.tool_calls){vt.debug("Tool calls received in generate",{traceId:s,toolCallCount:o.message.tool_calls.length});for(let c of o.message.tool_calls){let f=c.id||ei(),d=c.function.name,g=Rn(c.function.arguments);vt.debug("Processing tool call in generate",{traceId:s,toolCallId:f,toolName:d,argumentsLength:g.length,isComplete:si(g)}),a.push({type:"tool-call",toolCallId:f,toolName:d,input:g});}}let h=o.message?.tool_calls&&o.message.tool_calls.length>0,l=h?"tool-calls":"stop";return vt.debug("Generate request completed",{traceId:s,finishReason:l,contentParts:a.length,hasToolCalls:h,inputTokens:o.prompt_eval_count||0,outputTokens:o.eval_count||0}),{content:a,finishReason:l,usage:{inputTokens:o.prompt_eval_count,outputTokens:o.eval_count,totalTokens:(o.prompt_eval_count||0)+(o.eval_count||0)},providerMetadata:{ollama:{totalDuration:o.total_duration,loadDuration:o.load_duration,promptEvalDuration:o.prompt_eval_duration,evalDuration:o.eval_duration}},request:{body:JSON.stringify({model:this.modelId,messages:i,options:Te,...n})},response:{}}}};var Re=class{constructor(t,s={}){p(this,"specificationVersion","v2");p(this,"provider","ollama");p(this,"modelId");p(this,"defaultObjectGenerationMode","json");p(this,"supportedUrls",{});p(this,"nativeModel");this.modelId=t,this.nativeModel=new ii(t,{baseURL:s.baseURL||"http://localhost:11434"});}doGenerate(t){return this.nativeModel.doGenerate(t)}doStream(t){return this.nativeModel.doStream(t)}};function _a(e={}){return Object.assign(s=>new Re(s,e),{languageModel:s=>new Re(s,e),chat:s=>new Re(s,e)})}var Fa="0.1.0";
7
+ export{ai as ConnectionError,hi as ModelNotFoundError,Te as OLLAMA_DEFAULT_OPTIONS,Fn as OLLAMA_SPECIFIC_PARAMS,Yt as OllamaError,Re as OllamaLanguageModel,ci as TimeoutError,Fa as VERSION,li as ValidationError,_a as createOllama};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easbot/ollama-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Ollama provider for Vercel AI SDK - Run local LLMs with Ollama in your AI applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -27,7 +27,7 @@
27
27
  "type-check": "tsc --noEmit",
28
28
  "clean": "npx rimraf dist node_modules",
29
29
  "prepare": "echo norun",
30
- "prepublishOnly": "pnpm test:run && pnpm type-check && pnpm build",
30
+ "prepublishOnly": "pnpm build",
31
31
  "publish:npm": "bash scripts/publish.sh",
32
32
  "publish:npm:win": "powershell -ExecutionPolicy Bypass -File scripts/publish.ps1"
33
33
  },
@@ -57,8 +57,7 @@
57
57
  ],
58
58
  "dependencies": {
59
59
  "@ai-sdk/provider": "^2.0.1",
60
- "@ai-sdk/provider-utils": "^3.0.20",
61
- "ai-sdk-ollama": "^2.2.0"
60
+ "@ai-sdk/provider-utils": "^3.0.20"
62
61
  },
63
62
  "peerDependencies": {
64
63
  "ai": "^5.0.0"