@easbot/utils 0.3.21 → 0.3.22

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.
Files changed (31) hide show
  1. package/dist/chunks/{chunk-KKCFNFFR.cjs → chunk-2KQO2CPV.cjs} +5 -5
  2. package/dist/chunks/{chunk-N26SFBEH.mjs → chunk-4ML53C4G.mjs} +2 -2
  3. package/dist/chunks/{chunk-5XHOPT4Y.cjs → chunk-AV7EICQL.cjs} +2 -2
  4. package/dist/chunks/{chunk-GOEMY5AZ.mjs → chunk-PI6LRPHA.mjs} +1 -1
  5. package/dist/chunks/{chunk-GVXRTRAT.cjs → chunk-QNBTABHK.cjs} +1 -1
  6. package/dist/chunks/{chunk-IVVWAT7R.cjs → chunk-RDSCQNRW.cjs} +1 -1
  7. package/dist/chunks/{chunk-OEWMITBM.mjs → chunk-UVVMQYTY.mjs} +2 -2
  8. package/dist/chunks/{chunk-XGZ7XJWW.mjs → chunk-XLTYO4H4.mjs} +1 -1
  9. package/dist/chunks/filesystem-R3ZGPMU5.cjs +1 -0
  10. package/dist/chunks/filesystem-SN2NDRQ7.mjs +1 -0
  11. package/dist/chunks/lock-K72H2PY4.cjs +1 -0
  12. package/dist/chunks/lock-KA2PUOBL.mjs +1 -0
  13. package/dist/chunks/{main-AFZUDH75.cjs → main-V5WRX5GG.cjs} +4 -4
  14. package/dist/chunks/{main-3SAATRGB.mjs → main-YN5MJ4HJ.mjs} +2 -2
  15. package/dist/chunks/registry-VY6GTWN2.cjs +1 -0
  16. package/dist/chunks/registry-WF5KKNGL.mjs +1 -0
  17. package/dist/chunks/shell-QEWMGBOX.mjs +1 -0
  18. package/dist/chunks/shell-XX3LLBBX.cjs +1 -0
  19. package/dist/index.cjs +8 -8
  20. package/dist/index.mjs +1 -1
  21. package/package.json +3 -3
  22. package/dist/chunks/filesystem-DXKLXORJ.cjs +0 -1
  23. package/dist/chunks/filesystem-YGESISP6.mjs +0 -1
  24. package/dist/chunks/lock-FS4EHXSK.cjs +0 -1
  25. package/dist/chunks/lock-GNVDLOKR.mjs +0 -1
  26. package/dist/chunks/registry-CEQNVNEA.cjs +0 -1
  27. package/dist/chunks/registry-JMOZUWPG.mjs +0 -1
  28. package/dist/chunks/shell-4USPDVM2.cjs +0 -1
  29. package/dist/chunks/shell-GC34UPJP.mjs +0 -1
  30. /package/dist/chunks/{chunk-6GV3NECV.mjs → chunk-B4W5JDXX.mjs} +0 -0
  31. /package/dist/chunks/{chunk-K7PV4FXJ.cjs → chunk-E2GY67T5.cjs} +0 -0
@@ -1,2 +1,2 @@
1
- import {f}from'./chunk-6GV3NECV.mjs';import bt,{mkdir,stat,cp,readFile,writeFile}from'fs/promises';import {statSync,createWriteStream,readdirSync}from'fs';import {extname,basename,resolve,relative}from'path';import {Readable}from'stream';import {pipeline}from'stream/promises';import Pt from'os';import {glob,globSync}from'glob';f();f();f();function ot(e,n){let a=new Set,r=0;for(;r<e.length;){let c=e[r];if(e[r+1]==="-"&&r+2<e.length){let l=e[r+2],g=c.charCodeAt(0),m=l.charCodeAt(0);if(g>m)return null;for(let S=g;S<=m;S++)a.add(String.fromCharCode(S));r+=3;}else a.add(c),r++;}return {kind:"class",chars:a,negate:n}}function _(e){let n=[],a="",r=0;for(;r<e.length;){let c=e[r];if(c==="\\"&&r+1<e.length){a+=e[r+1],r+=2;continue}if(c==="["){let o=e.indexOf("]",r+1);if(o!==-1){let l=e.slice(r+1,o),g=false,m=0;(l.startsWith("!")||l.startsWith("^"))&&(g=true,m=1);let S=ot(l.slice(m),g);if(S){a&&(n.push({kind:"literal",text:a}),a=""),n.push(S),r=o+1;continue}}}a+=c,r++;}return a&&n.push({kind:"literal",text:a}),n}function at(e){let n=ct(e);if(n===-1)return null;let a=lt(e,n);if(a===-1)return null;let r=e.slice(n+1,a),c=ft(r);if(!c)return null;let o=e.slice(0,n),l=e.slice(a+1),g=[];for(let m of c)g.push(o+m+l);return g}function ct(e){for(let n=0;n<e.length;n++){if(e[n]==="\\"&&n+1<e.length){n++;continue}if(e[n]==="{")return n}return -1}function lt(e,n){let a=1;for(let r=n+1;r<e.length;r++){if(e[r]==="\\"&&r+1<e.length){r++;continue}if(e[r]==="{")a++;else if(e[r]==="}"&&(a--,a===0))return r}return -1}function ft(e){let n=[],a="",r=0;for(let c=0;c<e.length;c++){let o=e[c];if(o==="\\"&&c+1<e.length){a+=e[c+1],c++;continue}if(o==="{")r++,a+=o;else if(o==="}"){if(r--,a+=o,r<0)return null}else o===","&&r===0?(n.push(a),a=""):a+=o;}return r!==0?null:(n.push(a),n)}function ut(e){let n=at(e);return n?[{kind:"brace",alternatives:n.map(r=>G(r))}]:G(e)}function G(e,n=false){let a=[],r="",c=0,o=n?e.length-2:e.length;for(;c<o;){let l=e[c];if(l==="\\"&&c+1<o){r+=e[c+1],c+=2;continue}if(l==="*"&&e[c+1]==="*"&&(c+2>=o||e[c+2]==="/")&&(c===0||e[c-1]==="/")){r&&(a.push(..._(r)),r=""),a.push({kind:"starstar"}),c+=2,e[c]==="/"&&c++;continue}if(l==="*"){r&&(a.push(..._(r)),r=""),a.push({kind:"star"}),c++;continue}if(l==="?"){r&&(a.push(..._(r)),r=""),a.push({kind:"question"}),c++;continue}r+=l,c++;}return r&&a.push(..._(r)),a}function pt(e){let n=0;for(;n<e.length;){let a=e[n];if(a==="\\"&&n+1<e.length){n+=2;continue}if(a===" ")return e[n+1]==="*"&&n+2===e.length;n++;}return false}function j(e,n,a=0,r=0){for(;a<e.length;){let c=e[a];if(c.kind==="literal"){if(!n.startsWith(c.text,r))return false;r+=c.text.length;}else if(c.kind==="star"){let o=a+1;for(;o<e.length&&e[o].kind==="star";)o++;if(o>=e.length){for(let l=r;l<n.length;l++)if(n[l]==="/")return false;return true}for(let l=r;l<=n.length;l++){if(j(e,n,o,l))return true;if(n[l]==="/")break}return false}else if(c.kind==="starstar"){let o=a+1;for(;o<e.length&&e[o].kind==="starstar";)o++;if(o>=e.length)return true;for(let l=r;l<=n.length;l++)if(j(e,n,o,l))return true;return false}else if(c.kind==="question"){if(r>=n.length||n[r]==="/")return false;r++;}else if(c.kind==="class"){let o=n[r];if(o===void 0||c.chars.has(o)===c.negate)return false;r++;}else if(c.kind==="brace"){for(let o of c.alternatives)if(j(o,n,0,r))return true;return false}a++;}return r===n.length}function I(e){return e.sort((n,a)=>{let r=n[0].length-a[0].length;return r!==0?r:n[0].localeCompare(a[0])})}var O=new Map,gt=1024;function X(e){let n=O.get(e);if(n)return n;let a=ut(e);if(O.size>=gt){let r=O.keys().next().value;r!==void 0&&O.delete(r);}return O.set(e,a),a}var w;(c=>{function e(o,l){if(!l)return o==="";try{if(n(o,l))return !0;if(pt(l)){let g=l.slice(0,-2);if(n(o,g))return !0}return !1}catch{return false}}c.match=e;function n(o,l){if(!o)return mt(l);let g=X(l);return j(g,o)}function a(o,l){let g=I(Object.entries(l)),m;for(let[S,v]of g)e(o,S)&&(m=v);return m}c.all=a;function r(o,l){let g=I(Object.entries(l)),m;for(let[S,v]of g){let p=S.split(/\s+/);p.length!==0&&e(o.head,p[0])&&(p.length===1||dt(o.tail,p.slice(1)))&&(m=v);}return m}c.allStructured=r;})(w||(w={}));function dt(e,n){if(n.length===0)return true;if(e.length<n.length)return false;for(let a=0;a<n.length;a++)if(!w.match(e[a],n[a]))return false;return true}function mt(e){let n=X(e);return j(n,"")}var $;(v=>{v.DEFAULT_MAX_DEPTH=20;function n(p){let d;return p.maxDepth===void 0?d=20:p.maxDepth<1?d=1:p.maxDepth>20?d=20:d=p.maxDepth,{...p,follow:p.symlink??false,nodir:p.include!=="all",maxDepth:d}}async function a(p,d={}){let b=await glob(p,n(d));return c(b)}v.scan=a;function r(p,d={}){let b=globSync(p,n(d));return c(b)}v.scanSync=r;function c(p){let d=false;for(let b of p)if(b.indexOf("\\")!==-1){d=true;break}return d?p.map(b=>D.toUnixPath(b)):p}function o(p,d){return w.match(d,p)}v.match=o;async function l(p){try{let d=await bt.readFile(p,"utf-8");return g(d)}catch{return []}}v.parseGitignore=l;function g(p){let d=[],b=p.split(/\r?\n/);for(let T of b){let E=T.trim();if(!E||E.startsWith("#")||E.startsWith("!"))continue;let x=E;x.endsWith("/")&&(x=`${x}**`),!x.includes("*")&&!x.includes("?")&&!x.includes("[")&&(x=`**/${x}/**`),d.push(x);}return d}v.parseGitignoreContent=g;function m(p,d){let b=p.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/$/,"");for(let T of d)if(w.match(b,T)||w.match(b,`${T}/**`))return true;return false}v.isIgnored=m,v.DEFAULT_IGNORE_PATTERNS=["**/node_modules/**","**/dist/**","**/build/**","**/out/**","**/target/**","**/.cache/**","**/.vite/**","**/.turbo/**","**/.next/**","**/.nuxt/**","**/coverage/**","**/.nyc_output/**","**/logs/**","**/*.log","**/.DS_Store","**/Thumbs.db","**/tmp/**","**/temp/**","**/.git/**","**/*.min.js","**/*.min.ts","**/*.db","**/data/**"];})($||($={}));var W=process.platform==="win32",et={".html":"text/html",".htm":"text/html",".css":"text/css",".csv":"text/csv",".txt":"text/plain",".md":"text/markdown",".xml":"application/xml",".yaml":"application/yaml",".yml":"application/yaml",".toml":"application/toml",".ini":"text/plain",".cfg":"text/plain",".conf":"text/plain",".log":"text/plain",".sh":"application/x-sh",".bash":"application/x-bash",".zsh":"application/x-zsh",".fish":"application/x-fish",".ps1":"application/x-powershell",".bat":"application/x-batch",".cmd":"application/x-batch",".dockerfile":"application/x-dockerfile",".makefile":"application/x-makefile",".properties":"text/plain",".js":"application/javascript",".mjs":"application/javascript",".cjs":"application/javascript",".jsx":"text/javascript",".ts":"application/typescript",".tsx":"text/typescript",".mts":"application/typescript",".json":"application/json",".jsonc":"application/json",".json5":"application/json",".webmanifest":"application/manifest+json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".webp":"image/webp",".avif":"image/avif",".heic":"image/heic",".heif":"image/heif",".bmp":"image/bmp",".tiff":"image/tiff",".tif":"image/tiff",".mp4":"video/mp4",".webm":"video/webm",".ogg":"video/ogg",".avi":"video/x-msvideo",".mkv":"video/x-matroska",".mov":"video/quicktime",".mp3":"audio/mpeg",".wav":"audio/wav",".flac":"audio/flac",".aac":"audio/aac",".opus":"audio/opus",".m4a":"audio/mp4",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".rtf":"application/rtf",".epub":"application/epub+zip",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".tgz":"application/gzip",".bz2":"application/x-bzip2",".xz":"application/x-xz",".7z":"application/x-7z-compressed",".rar":"application/vnd.rar",".wasm":"application/wasm",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject",".db":"application/x-sqlite3",".sqlite":"application/vnd.sqlite3",".proto":"application/protobuf"},Ct=Object.fromEntries(Object.entries(et).map(([e,n])=>[n,e])),D;(Wt=>{async function e(t,s){await mkdir(t,{recursive:s?.recursive??true});}Wt.mkdir=e;async function n(t,s,i){let f=i?.recursive??true;try{(await stat(t)).isDirectory()||(f=!1);}catch{}await cp(t,s,{recursive:f,dereference:i?.dereference??true,force:i?.force??true});}Wt.cp=n;async function a(t){try{return await stat(t),!0}catch{return false}}Wt.exists=a;function r(t){try{return statSync(t).isDirectory()}catch{return false}}Wt.isDir=r;function c(t){try{return statSync(t)}catch{return}}Wt.stat=c;async function o(t){return c(t)?.size??0}Wt.size=o;async function l(t){return readFile(t,"utf-8")}Wt.readText=l;async function g(t){let s=await readFile(t,"utf-8");try{return JSON.parse(s)}catch(i){let u=i instanceof Error?i.message:String(i);throw new Error(`Invalid JSON in ${t}: ${u}`,{cause:i})}}Wt.readJson=g;async function m(t){return readFile(t)}Wt.readBytes=m;async function S(t){let s=await readFile(t);return s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}Wt.readArrayBuffer=S;async function v(t,s,i){let u=i!==void 0?{mode:i}:void 0;try{await writeFile(t,s,u);}catch(f){if(Ot(f)){await mkdir(x(t),{recursive:true}),await writeFile(t,s,u);return}throw f}}Wt.write=v;async function p(t,s,i){return v(t,JSON.stringify(s,null,2),i)}Wt.writeJson=p;async function d(t,s,i){await mkdir(x(t),{recursive:true});let u=s instanceof ReadableStream?Readable.fromWeb(s):s,f=i!==void 0?createWriteStream(t,{mode:i}):createWriteStream(t);await pipeline(u,f);}Wt.writeStream=d;function b(t){let s=extname(t).toLowerCase();return et[s]||"application/octet-stream"}Wt.mimeType=b;function T(t){return Ct[t]}Wt.mimeTypeToExt=T;function E(t){return t?!!(t.startsWith("text/")||t==="application/json"||t==="application/xml"||t==="application/javascript"||t==="application/typescript"||t==="application/x-javascript"||t==="application/yaml"||t==="application/x-yaml"||t==="application/toml"||t==="application/x-sh"||t==="application/x-bash"||t==="application/x-zsh"||t==="application/x-powershell"||t==="application/x-batch"||t==="application/x-dockerfile"||t==="application/x-makefile"):false}Wt.isTextMime=E;function x(t){if(!t)return ".";let s=y(t).replace(/\/+$/,"")||"/";if(s==="/")return "/";let i=s.lastIndexOf("/");return i===-1?".":i===0?"/":s.slice(0,i)}Wt.dirname=x;function jt(t,s){if(!t)return "";let i=y(t).replace(/\/+$/,"");if(!i||i==="/")return "";let u=i.lastIndexOf("/"),f=u===-1?i:i.slice(u+1);return f?(s&&f.endsWith(s)&&(f=f.slice(0,-s.length)),f):""}Wt.basename=jt;function zt(t){if(!t)return "";let s=basename(y(t));if(!s||s==="."||s==="..")return "";let i=s.lastIndexOf(".");return i<=0?"":s.slice(i)}Wt.extname=zt;function y(t){return t==null?"":String(t).replace(/\\/g,"/")}Wt.toUnixPath=y;function nt(t,s){if(!t||!s)return "";let i=y(t),u=y(s),f=C(i)?i:resolve(i),h=C(u)?u:resolve(u);return y(relative(f,h))}Wt.relative=nt;function M(t=process.env,s=Pt.homedir){let i=[t.EASBOT_TEST_HOME,t.EASBOT_HOME,t.HOME,t.USERPROFILE];for(let u of i)if(u?.trim())return y(u.trim());try{return y(s())}catch{return ""}}function P(t,s){let i=s??M();return t?(W&&(t=B(t)),t==="~"?t=i:t.startsWith("~/")?t=z(i,t.slice(2)):C(t)||(t=resolve(t)),t=y(t),W&&(t=it(t)),t):i}Wt.normalize=P;function it(t){let s=t.match(/^([A-Za-z]):/);if(!s?.[1])return t;let i=s[1].toUpperCase(),f=t.slice(s[0].length).split("/").filter(A=>A!=="");if(f.length===0)return `${i}:/`;let h=[],R=`${i}:/`;for(let A of f){let H=rt(R,A);if(H===null)return h.push(A),`${i}:/${[...h,...f.slice(h.length)].join("/")}`;let[q,st]=H;if(st)return h.push(A),`${i}:/${[...h,...f.slice(h.length)].join("/")}`;h.push(q),R=`${R}${q}/`;}return `${i}:/${h.join("/")}`}function rt(t,s){let i;try{i=readdirSync(t,{withFileTypes:!0});}catch{return null}let u=s.toLowerCase(),f=i.find(h=>h.name.toLowerCase()===u);return f?[f.name,f.isSymbolicLink()]:null}function _t(t,s){let i=s??M();return t?(W&&(t=B(t)),t==="~"?t=i:t.startsWith("~/")?t=z(i,t.slice(2)):C(t)||(t=resolve(t)),y(t)):i}Wt.resolve=_t;function C(t){return t?!!(t.startsWith("/")||/^[a-zA-Z]:[/\\]?$/.test(t)||/^[a-zA-Z]:[/\\]/.test(t)):false}Wt.isAbsolute=C;function z(t,...s){let i=y(t);for(let u of s){let f=y(u);C(f)?i=f:(i&&!i.endsWith("/")&&(i+="/"),i+=f);}return i}Wt.join=z;function B(t){return W?t.replace(/^\/([a-zA-Z]):(?:[\\/]|$)/,(s,i)=>`${i.toUpperCase()}:/`).replace(/^\/([a-zA-Z])(?:\/|$)/,(s,i)=>`${i.toUpperCase()}:/`).replace(/^\/cygdrive\/([a-zA-Z])(?:\/|$)/,(s,i)=>`${i.toUpperCase()}:/`).replace(/^\/mnt\/([a-zA-Z])(?:\/|$)/,(s,i)=>`${i.toUpperCase()}:/`):t}Wt.windowsPath=B;function F(t,s){if(!t||!s)return false;let i=P(t),u=P(s);if(!i||!u)return false;let f=nt(i,u);return f?f!==".."&&!f.startsWith("../"):i===u}Wt.contains=F;function $t(t,s){return !t||!s?false:F(t,s)||F(s,t)}Wt.overlaps=$t;async function Dt(t,s,i){let u=[];return await tt(s,i,P,x,async f=>{let h=z(f,t);await a(h)&&u.push(h);}),u}Wt.findUp=Dt;async function*Lt(t){let{targets:s,stop:i}=t;yield*At(t.start,i,P,x,async function*(u){for(let f of s){let h=z(u,f);await a(h)&&(yield h);}});}Wt.up=Lt;async function Ut(t,s,i){let u=[];return await tt(s,i,P,x,async f=>{try{let h=await $.scan(t,{cwd:f,absolute:!0,include:"file",dot:!0});u.push(...h);}catch{}}),u}Wt.globUp=Ut;})(D||(D={}));async function tt(e,n,a,r,c){let o=a(e);if(!o)return;let l=n?a(n):void 0,g=new Set;for(;o&&!g.has(o)&&(g.add(o),await c(o),!(l&&o===l));){let m=r(o);if(m===o)break;o=m;}}async function*At(e,n,a,r,c){let o=a(e);if(!o)return;let l=n?a(n):void 0,g=new Set;for(;o&&!g.has(o)&&(g.add(o),yield*c(o),!(l&&o===l));){let m=r(o);if(m===o)break;o=m;}}function Ot(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}
1
+ import {f}from'./chunk-B4W5JDXX.mjs';import bt,{mkdir,stat,cp,readFile,writeFile}from'fs/promises';import {statSync,createWriteStream,readdirSync}from'fs';import {extname,basename,resolve,relative}from'path';import {Readable}from'stream';import {pipeline}from'stream/promises';import Pt from'os';import {glob,globSync}from'glob';f();f();f();function ot(e,n){let a=new Set,r=0;for(;r<e.length;){let c=e[r];if(e[r+1]==="-"&&r+2<e.length){let l=e[r+2],g=c.charCodeAt(0),m=l.charCodeAt(0);if(g>m)return null;for(let S=g;S<=m;S++)a.add(String.fromCharCode(S));r+=3;}else a.add(c),r++;}return {kind:"class",chars:a,negate:n}}function _(e){let n=[],a="",r=0;for(;r<e.length;){let c=e[r];if(c==="\\"&&r+1<e.length){a+=e[r+1],r+=2;continue}if(c==="["){let o=e.indexOf("]",r+1);if(o!==-1){let l=e.slice(r+1,o),g=false,m=0;(l.startsWith("!")||l.startsWith("^"))&&(g=true,m=1);let S=ot(l.slice(m),g);if(S){a&&(n.push({kind:"literal",text:a}),a=""),n.push(S),r=o+1;continue}}}a+=c,r++;}return a&&n.push({kind:"literal",text:a}),n}function at(e){let n=ct(e);if(n===-1)return null;let a=lt(e,n);if(a===-1)return null;let r=e.slice(n+1,a),c=ft(r);if(!c)return null;let o=e.slice(0,n),l=e.slice(a+1),g=[];for(let m of c)g.push(o+m+l);return g}function ct(e){for(let n=0;n<e.length;n++){if(e[n]==="\\"&&n+1<e.length){n++;continue}if(e[n]==="{")return n}return -1}function lt(e,n){let a=1;for(let r=n+1;r<e.length;r++){if(e[r]==="\\"&&r+1<e.length){r++;continue}if(e[r]==="{")a++;else if(e[r]==="}"&&(a--,a===0))return r}return -1}function ft(e){let n=[],a="",r=0;for(let c=0;c<e.length;c++){let o=e[c];if(o==="\\"&&c+1<e.length){a+=e[c+1],c++;continue}if(o==="{")r++,a+=o;else if(o==="}"){if(r--,a+=o,r<0)return null}else o===","&&r===0?(n.push(a),a=""):a+=o;}return r!==0?null:(n.push(a),n)}function ut(e){let n=at(e);return n?[{kind:"brace",alternatives:n.map(r=>G(r))}]:G(e)}function G(e,n=false){let a=[],r="",c=0,o=n?e.length-2:e.length;for(;c<o;){let l=e[c];if(l==="\\"&&c+1<o){r+=e[c+1],c+=2;continue}if(l==="*"&&e[c+1]==="*"&&(c+2>=o||e[c+2]==="/")&&(c===0||e[c-1]==="/")){r&&(a.push(..._(r)),r=""),a.push({kind:"starstar"}),c+=2,e[c]==="/"&&c++;continue}if(l==="*"){r&&(a.push(..._(r)),r=""),a.push({kind:"star"}),c++;continue}if(l==="?"){r&&(a.push(..._(r)),r=""),a.push({kind:"question"}),c++;continue}r+=l,c++;}return r&&a.push(..._(r)),a}function pt(e){let n=0;for(;n<e.length;){let a=e[n];if(a==="\\"&&n+1<e.length){n+=2;continue}if(a===" ")return e[n+1]==="*"&&n+2===e.length;n++;}return false}function j(e,n,a=0,r=0){for(;a<e.length;){let c=e[a];if(c.kind==="literal"){if(!n.startsWith(c.text,r))return false;r+=c.text.length;}else if(c.kind==="star"){let o=a+1;for(;o<e.length&&e[o].kind==="star";)o++;if(o>=e.length){for(let l=r;l<n.length;l++)if(n[l]==="/")return false;return true}for(let l=r;l<=n.length;l++){if(j(e,n,o,l))return true;if(n[l]==="/")break}return false}else if(c.kind==="starstar"){let o=a+1;for(;o<e.length&&e[o].kind==="starstar";)o++;if(o>=e.length)return true;for(let l=r;l<=n.length;l++)if(j(e,n,o,l))return true;return false}else if(c.kind==="question"){if(r>=n.length||n[r]==="/")return false;r++;}else if(c.kind==="class"){let o=n[r];if(o===void 0||c.chars.has(o)===c.negate)return false;r++;}else if(c.kind==="brace"){for(let o of c.alternatives)if(j(o,n,0,r))return true;return false}a++;}return r===n.length}function I(e){return e.sort((n,a)=>{let r=n[0].length-a[0].length;return r!==0?r:n[0].localeCompare(a[0])})}var O=new Map,gt=1024;function X(e){let n=O.get(e);if(n)return n;let a=ut(e);if(O.size>=gt){let r=O.keys().next().value;r!==void 0&&O.delete(r);}return O.set(e,a),a}var w;(c=>{function e(o,l){if(!l)return o==="";try{if(n(o,l))return !0;if(pt(l)){let g=l.slice(0,-2);if(n(o,g))return !0}return !1}catch{return false}}c.match=e;function n(o,l){if(!o)return mt(l);let g=X(l);return j(g,o)}function a(o,l){let g=I(Object.entries(l)),m;for(let[S,v]of g)e(o,S)&&(m=v);return m}c.all=a;function r(o,l){let g=I(Object.entries(l)),m;for(let[S,v]of g){let p=S.split(/\s+/);p.length!==0&&e(o.head,p[0])&&(p.length===1||dt(o.tail,p.slice(1)))&&(m=v);}return m}c.allStructured=r;})(w||(w={}));function dt(e,n){if(n.length===0)return true;if(e.length<n.length)return false;for(let a=0;a<n.length;a++)if(!w.match(e[a],n[a]))return false;return true}function mt(e){let n=X(e);return j(n,"")}var $;(v=>{v.DEFAULT_MAX_DEPTH=20;function n(p){let d;return p.maxDepth===void 0?d=20:p.maxDepth<1?d=1:p.maxDepth>20?d=20:d=p.maxDepth,{...p,follow:p.symlink??false,nodir:p.include!=="all",maxDepth:d}}async function a(p,d={}){let b=await glob(p,n(d));return c(b)}v.scan=a;function r(p,d={}){let b=globSync(p,n(d));return c(b)}v.scanSync=r;function c(p){let d=false;for(let b of p)if(b.indexOf("\\")!==-1){d=true;break}return d?p.map(b=>D.toUnixPath(b)):p}function o(p,d){return w.match(d,p)}v.match=o;async function l(p){try{let d=await bt.readFile(p,"utf-8");return g(d)}catch{return []}}v.parseGitignore=l;function g(p){let d=[],b=p.split(/\r?\n/);for(let T of b){let E=T.trim();if(!E||E.startsWith("#")||E.startsWith("!"))continue;let x=E;x.endsWith("/")&&(x=`${x}**`),!x.includes("*")&&!x.includes("?")&&!x.includes("[")&&(x=`**/${x}/**`),d.push(x);}return d}v.parseGitignoreContent=g;function m(p,d){let b=p.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/$/,"");for(let T of d)if(w.match(b,T)||w.match(b,`${T}/**`))return true;return false}v.isIgnored=m,v.DEFAULT_IGNORE_PATTERNS=["**/node_modules/**","**/dist/**","**/build/**","**/out/**","**/target/**","**/.cache/**","**/.vite/**","**/.turbo/**","**/.next/**","**/.nuxt/**","**/coverage/**","**/.nyc_output/**","**/logs/**","**/*.log","**/.DS_Store","**/Thumbs.db","**/tmp/**","**/temp/**","**/.git/**","**/*.min.js","**/*.min.ts","**/*.db","**/data/**"];})($||($={}));var W=process.platform==="win32",et={".html":"text/html",".htm":"text/html",".css":"text/css",".csv":"text/csv",".txt":"text/plain",".md":"text/markdown",".xml":"application/xml",".yaml":"application/yaml",".yml":"application/yaml",".toml":"application/toml",".ini":"text/plain",".cfg":"text/plain",".conf":"text/plain",".log":"text/plain",".sh":"application/x-sh",".bash":"application/x-bash",".zsh":"application/x-zsh",".fish":"application/x-fish",".ps1":"application/x-powershell",".bat":"application/x-batch",".cmd":"application/x-batch",".dockerfile":"application/x-dockerfile",".makefile":"application/x-makefile",".properties":"text/plain",".js":"application/javascript",".mjs":"application/javascript",".cjs":"application/javascript",".jsx":"text/javascript",".ts":"application/typescript",".tsx":"text/typescript",".mts":"application/typescript",".json":"application/json",".jsonc":"application/json",".json5":"application/json",".webmanifest":"application/manifest+json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".webp":"image/webp",".avif":"image/avif",".heic":"image/heic",".heif":"image/heif",".bmp":"image/bmp",".tiff":"image/tiff",".tif":"image/tiff",".mp4":"video/mp4",".webm":"video/webm",".ogg":"video/ogg",".avi":"video/x-msvideo",".mkv":"video/x-matroska",".mov":"video/quicktime",".mp3":"audio/mpeg",".wav":"audio/wav",".flac":"audio/flac",".aac":"audio/aac",".opus":"audio/opus",".m4a":"audio/mp4",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".rtf":"application/rtf",".epub":"application/epub+zip",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".tgz":"application/gzip",".bz2":"application/x-bzip2",".xz":"application/x-xz",".7z":"application/x-7z-compressed",".rar":"application/vnd.rar",".wasm":"application/wasm",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject",".db":"application/x-sqlite3",".sqlite":"application/vnd.sqlite3",".proto":"application/protobuf"},Ct=Object.fromEntries(Object.entries(et).map(([e,n])=>[n,e])),D;(Wt=>{async function e(t,s){await mkdir(t,{recursive:s?.recursive??true});}Wt.mkdir=e;async function n(t,s,i){let f=i?.recursive??true;try{(await stat(t)).isDirectory()||(f=!1);}catch{}await cp(t,s,{recursive:f,dereference:i?.dereference??true,force:i?.force??true});}Wt.cp=n;async function a(t){try{return await stat(t),!0}catch{return false}}Wt.exists=a;function r(t){try{return statSync(t).isDirectory()}catch{return false}}Wt.isDir=r;function c(t){try{return statSync(t)}catch{return}}Wt.stat=c;async function o(t){return c(t)?.size??0}Wt.size=o;async function l(t){return readFile(t,"utf-8")}Wt.readText=l;async function g(t){let s=await readFile(t,"utf-8");try{return JSON.parse(s)}catch(i){let u=i instanceof Error?i.message:String(i);throw new Error(`Invalid JSON in ${t}: ${u}`,{cause:i})}}Wt.readJson=g;async function m(t){return readFile(t)}Wt.readBytes=m;async function S(t){let s=await readFile(t);return s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}Wt.readArrayBuffer=S;async function v(t,s,i){let u=i!==void 0?{mode:i}:void 0;try{await writeFile(t,s,u);}catch(f){if(Ot(f)){await mkdir(x(t),{recursive:true}),await writeFile(t,s,u);return}throw f}}Wt.write=v;async function p(t,s,i){return v(t,JSON.stringify(s,null,2),i)}Wt.writeJson=p;async function d(t,s,i){await mkdir(x(t),{recursive:true});let u=s instanceof ReadableStream?Readable.fromWeb(s):s,f=i!==void 0?createWriteStream(t,{mode:i}):createWriteStream(t);await pipeline(u,f);}Wt.writeStream=d;function b(t){let s=extname(t).toLowerCase();return et[s]||"application/octet-stream"}Wt.mimeType=b;function T(t){return Ct[t]}Wt.mimeTypeToExt=T;function E(t){return t?!!(t.startsWith("text/")||t==="application/json"||t==="application/xml"||t==="application/javascript"||t==="application/typescript"||t==="application/x-javascript"||t==="application/yaml"||t==="application/x-yaml"||t==="application/toml"||t==="application/x-sh"||t==="application/x-bash"||t==="application/x-zsh"||t==="application/x-powershell"||t==="application/x-batch"||t==="application/x-dockerfile"||t==="application/x-makefile"):false}Wt.isTextMime=E;function x(t){if(!t)return ".";let s=y(t).replace(/\/+$/,"")||"/";if(s==="/")return "/";let i=s.lastIndexOf("/");return i===-1?".":i===0?"/":s.slice(0,i)}Wt.dirname=x;function jt(t,s){if(!t)return "";let i=y(t).replace(/\/+$/,"");if(!i||i==="/")return "";let u=i.lastIndexOf("/"),f=u===-1?i:i.slice(u+1);return f?(s&&f.endsWith(s)&&(f=f.slice(0,-s.length)),f):""}Wt.basename=jt;function zt(t){if(!t)return "";let s=basename(y(t));if(!s||s==="."||s==="..")return "";let i=s.lastIndexOf(".");return i<=0?"":s.slice(i)}Wt.extname=zt;function y(t){return t==null?"":String(t).replace(/\\/g,"/")}Wt.toUnixPath=y;function nt(t,s){if(!t||!s)return "";let i=y(t),u=y(s),f=C(i)?i:resolve(i),h=C(u)?u:resolve(u);return y(relative(f,h))}Wt.relative=nt;function M(t=process.env,s=Pt.homedir){let i=[t.EASBOT_TEST_HOME,t.EASBOT_HOME,t.HOME,t.USERPROFILE];for(let u of i)if(u?.trim())return y(u.trim());try{return y(s())}catch{return ""}}function P(t,s){let i=s??M();return t?(W&&(t=B(t)),t==="~"?t=i:t.startsWith("~/")?t=z(i,t.slice(2)):C(t)||(t=resolve(t)),t=y(t),W&&(t=it(t)),t):i}Wt.normalize=P;function it(t){let s=t.match(/^([A-Za-z]):/);if(!s?.[1])return t;let i=s[1].toUpperCase(),f=t.slice(s[0].length).split("/").filter(A=>A!=="");if(f.length===0)return `${i}:/`;let h=[],R=`${i}:/`;for(let A of f){let H=rt(R,A);if(H===null)return h.push(A),`${i}:/${[...h,...f.slice(h.length)].join("/")}`;let[q,st]=H;if(st)return h.push(A),`${i}:/${[...h,...f.slice(h.length)].join("/")}`;h.push(q),R=`${R}${q}/`;}return `${i}:/${h.join("/")}`}function rt(t,s){let i;try{i=readdirSync(t,{withFileTypes:!0});}catch{return null}let u=s.toLowerCase(),f=i.find(h=>h.name.toLowerCase()===u);return f?[f.name,f.isSymbolicLink()]:null}function _t(t,s){let i=s??M();return t?(W&&(t=B(t)),t==="~"?t=i:t.startsWith("~/")?t=z(i,t.slice(2)):C(t)||(t=resolve(t)),y(t)):i}Wt.resolve=_t;function C(t){return t?!!(t.startsWith("/")||/^[a-zA-Z]:[/\\]?$/.test(t)||/^[a-zA-Z]:[/\\]/.test(t)):false}Wt.isAbsolute=C;function z(t,...s){let i=y(t);for(let u of s){let f=y(u);C(f)?i=f:(i&&!i.endsWith("/")&&(i+="/"),i+=f);}return i}Wt.join=z;function B(t){return W?t.replace(/^\/([a-zA-Z]):(?:[\\/]|$)/,(s,i)=>`${i.toUpperCase()}:/`).replace(/^\/([a-zA-Z])(?:\/|$)/,(s,i)=>`${i.toUpperCase()}:/`).replace(/^\/cygdrive\/([a-zA-Z])(?:\/|$)/,(s,i)=>`${i.toUpperCase()}:/`).replace(/^\/mnt\/([a-zA-Z])(?:\/|$)/,(s,i)=>`${i.toUpperCase()}:/`):t}Wt.windowsPath=B;function F(t,s){if(!t||!s)return false;let i=P(t),u=P(s);if(!i||!u)return false;let f=nt(i,u);return f?f!==".."&&!f.startsWith("../"):i===u}Wt.contains=F;function $t(t,s){return !t||!s?false:F(t,s)||F(s,t)}Wt.overlaps=$t;async function Dt(t,s,i){let u=[];return await tt(s,i,P,x,async f=>{let h=z(f,t);await a(h)&&u.push(h);}),u}Wt.findUp=Dt;async function*Lt(t){let{targets:s,stop:i}=t;yield*At(t.start,i,P,x,async function*(u){for(let f of s){let h=z(u,f);await a(h)&&(yield h);}});}Wt.up=Lt;async function Ut(t,s,i){let u=[];return await tt(s,i,P,x,async f=>{try{let h=await $.scan(t,{cwd:f,absolute:!0,include:"file",dot:!0});u.push(...h);}catch{}}),u}Wt.globUp=Ut;})(D||(D={}));async function tt(e,n,a,r,c){let o=a(e);if(!o)return;let l=n?a(n):void 0,g=new Set;for(;o&&!g.has(o)&&(g.add(o),await c(o),!(l&&o===l));){let m=r(o);if(m===o)break;o=m;}}async function*At(e,n,a,r,c){let o=a(e);if(!o)return;let l=n?a(n):void 0,g=new Set;for(;o&&!g.has(o)&&(g.add(o),yield*c(o),!(l&&o===l));){let m=r(o);if(m===o)break;o=m;}}function Ot(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}
2
2
  export{w as a,$ as b,et as c,D as d};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkQNBTABHK_cjs=require('./chunk-QNBTABHK.cjs');require('./chunk-E2GY67T5.cjs');Object.defineProperty(exports,"Filesystem",{enumerable:true,get:function(){return chunkQNBTABHK_cjs.d}});Object.defineProperty(exports,"MIME_TYPES",{enumerable:true,get:function(){return chunkQNBTABHK_cjs.c}});
@@ -0,0 +1 @@
1
+ export{d as Filesystem,c as MIME_TYPES}from'./chunk-XLTYO4H4.mjs';import'./chunk-B4W5JDXX.mjs';
@@ -0,0 +1 @@
1
+ 'use strict';var chunkRDSCQNRW_cjs=require('./chunk-RDSCQNRW.cjs');require('./chunk-E2GY67T5.cjs');Object.defineProperty(exports,"Lock",{enumerable:true,get:function(){return chunkRDSCQNRW_cjs.a}});
@@ -0,0 +1 @@
1
+ export{a as Lock}from'./chunk-PI6LRPHA.mjs';import'./chunk-B4W5JDXX.mjs';
@@ -1,4 +1,4 @@
1
- 'use strict';var chunkK7PV4FXJ_cjs=require('./chunk-K7PV4FXJ.cjs');var fr=chunkK7PV4FXJ_cjs.b((hr,gt)=>{chunkK7PV4FXJ_cjs.e();var qe=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,xt=Object.getOwnPropertyNames,kt=Object.prototype.hasOwnProperty,$t=(e,t)=>{for(var r in t)qe(e,r,{get:t[r],enumerable:true});},St=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of xt(t))!kt.call(e,o)&&o!==r&&qe(e,o,{get:()=>t[o],enumerable:!(n=vt(t,o))||n.enumerable});return e},Et=e=>St(qe({},"__esModule",{value:true}),e),Pe={};$t(Pe,{analyzeMetafile:()=>rr,analyzeMetafileSync:()=>ar,build:()=>Xt,buildSync:()=>nr,context:()=>Zt,default:()=>cr,formatMessages:()=>tr,formatMessagesSync:()=>lr,initialize:()=>sr,stop:()=>or,transform:()=>er,transformSync:()=>ir,version:()=>Gt});gt.exports=Et(Pe);function Ve(e){let t=n=>{if(n===null)r.write8(0);else if(typeof n=="boolean")r.write8(1),r.write8(+n);else if(typeof n=="number")r.write8(2),r.write32(n|0);else if(typeof n=="string")r.write8(3),r.write(ie(n));else if(n instanceof Uint8Array)r.write8(4),r.write(n);else if(n instanceof Array){r.write8(5),r.write32(n.length);for(let o of n)t(o);}else {let o=Object.keys(n);r.write8(6),r.write32(o.length);for(let s of o)r.write(ie(s)),t(n[s]);}},r=new rt;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),Ue(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function At(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return !!r.read8();case 2:return r.read32();case 3:return we(r.read());case 4:return r.read();case 5:{let a=r.read32(),d=[];for(let i=0;i<a;i++)d.push(t());return d}case 6:{let a=r.read32(),d={};for(let i=0;i<a;i++)d[we(r.read())]=t();return d}default:throw new Error("Invalid packet")}},r=new rt(e),n=r.read32(),o=(n&1)===0;n>>>=1;let s=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return {id:n,isRequest:o,value:s}}var rt=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0;}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t;}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e;}write32(e){let t=this._write(4);Ue(this.buf,e,t);}write(e){let t=this._write(4+e.length);Ue(this.buf,e.length,t),this.buf.set(e,t+4);}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return nt(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},ie,we,Re;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;ie=r=>e.encode(r),we=r=>t.decode(r),Re='new TextEncoder().encode("")';}else if(typeof Buffer<"u")ie=e=>Buffer.from(e),we=e=>{let{buffer:t,byteOffset:r,byteLength:n}=e;return Buffer.from(t,r,n).toString()},Re='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(ie("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Re} instanceof Uint8Array" is incorrectly false
1
+ 'use strict';var chunkE2GY67T5_cjs=require('./chunk-E2GY67T5.cjs');var fr=chunkE2GY67T5_cjs.b((hr,gt)=>{chunkE2GY67T5_cjs.e();var qe=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,xt=Object.getOwnPropertyNames,kt=Object.prototype.hasOwnProperty,$t=(e,t)=>{for(var r in t)qe(e,r,{get:t[r],enumerable:true});},St=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of xt(t))!kt.call(e,o)&&o!==r&&qe(e,o,{get:()=>t[o],enumerable:!(n=vt(t,o))||n.enumerable});return e},Et=e=>St(qe({},"__esModule",{value:true}),e),Pe={};$t(Pe,{analyzeMetafile:()=>rr,analyzeMetafileSync:()=>ar,build:()=>Xt,buildSync:()=>nr,context:()=>Zt,default:()=>cr,formatMessages:()=>tr,formatMessagesSync:()=>lr,initialize:()=>sr,stop:()=>or,transform:()=>er,transformSync:()=>ir,version:()=>Gt});gt.exports=Et(Pe);function Ve(e){let t=n=>{if(n===null)r.write8(0);else if(typeof n=="boolean")r.write8(1),r.write8(+n);else if(typeof n=="number")r.write8(2),r.write32(n|0);else if(typeof n=="string")r.write8(3),r.write(ie(n));else if(n instanceof Uint8Array)r.write8(4),r.write(n);else if(n instanceof Array){r.write8(5),r.write32(n.length);for(let o of n)t(o);}else {let o=Object.keys(n);r.write8(6),r.write32(o.length);for(let s of o)r.write(ie(s)),t(n[s]);}},r=new rt;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),Ue(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function At(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return !!r.read8();case 2:return r.read32();case 3:return we(r.read());case 4:return r.read();case 5:{let a=r.read32(),d=[];for(let i=0;i<a;i++)d.push(t());return d}case 6:{let a=r.read32(),d={};for(let i=0;i<a;i++)d[we(r.read())]=t();return d}default:throw new Error("Invalid packet")}},r=new rt(e),n=r.read32(),o=(n&1)===0;n>>>=1;let s=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return {id:n,isRequest:o,value:s}}var rt=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0;}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t;}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e;}write32(e){let t=this._write(4);Ue(this.buf,e,t);}write(e){let t=this._write(4+e.length);Ue(this.buf,e.length,t),this.buf.set(e,t+4);}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return nt(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},ie,we,Re;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;ie=r=>e.encode(r),we=r=>t.decode(r),Re='new TextEncoder().encode("")';}else if(typeof Buffer<"u")ie=e=>Buffer.from(e),we=e=>{let{buffer:t,byteOffset:r,byteLength:n}=e;return Buffer.from(t,r,n).toString()},Re='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(ie("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Re} instanceof Uint8Array" is incorrectly false
2
2
 
3
3
  This indicates that your JavaScript environment is broken. You cannot use
4
4
  esbuild in this environment because esbuild relies on this invariant. This
@@ -11,7 +11,7 @@ is not a problem with esbuild. You need to fix your environment instead.
11
11
  `),suggestion:""}}break}}return null}function Ee(e,t,r){let n=5;e+=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,n+1).map((s,a)=>{if(a===n)return `
12
12
  ...`;if(!s.location)return `
13
13
  error: ${s.text}`;let{file:d,line:i,column:c}=s.location,u=s.pluginName?`[plugin: ${s.pluginName}] `:"";return `
14
- ${d}:${i}:${c}: ERROR: ${u}${s.text}`}).join("");let o=new Error(e);for(let[s,a]of [["errors",t],["warnings",r]])Object.defineProperty(o,s,{configurable:true,enumerable:true,get:()=>a,set:d=>Object.defineProperty(o,s,{configurable:true,enumerable:true,value:d})});return o}function ke(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Qe(e,t,r){if(e==null)return null;let n={},o=l(e,n,"file",b),s=l(e,n,"namespace",b),a=l(e,n,"line",me),d=l(e,n,"column",me),i=l(e,n,"length",me),c=l(e,n,"lineText",b),u=l(e,n,"suggestion",b);if(J(e,n,t),c){let y=c.slice(0,(d&&d>0?d:0)+(i&&i>0?i:0)+(r&&r>0?r:80));!/[\x7F-\uFFFF]/.test(y)&&!/\n/.test(c)&&(c=y);}return {file:o||"",namespace:s||"",line:a||0,column:d||0,length:i||0,lineText:c||"",suggestion:u||""}}function fe(e,t,r,n,o){let s=[],a=0;for(let d of e){let i={},c=l(d,i,"id",b),u=l(d,i,"pluginName",b),y=l(d,i,"text",b),B=l(d,i,"location",Ke),_=l(d,i,"notes",ce),N=l(d,i,"detail",Me),I=`in element ${a} of "${t}"`;J(d,i,I);let L=[];if(_)for(let W of _){let z={},k=l(W,z,"text",b),w=l(W,z,"location",Ke);J(W,z,I),L.push({text:k||"",location:Qe(w,I,o)});}s.push({id:c||"",pluginName:u||n,text:y||"",location:Qe(B,I,o),notes:L,detail:r?r.store(N):-1}),a++;}return s}function Ce(e,t){let r=[];for(let n of e){if(typeof n!="string")throw new Error(`${V(t)} must be an array of strings`);r.push(n);}return r}function Nt(e,t){let r=Object.create(null);for(let n in e){let o=e[n];if(typeof o!="string")throw new Error(`key ${V(n)} in object ${V(t)} must be a string`);r[n]=o;}return r}function It({path:e,contents:t,hash:r}){let n=null;return {path:e,contents:t,hash:r,get text(){let o=this.contents;return (n===null||o!==t)&&(t=o,n=we(o)),n}}}function Le(e){let t=e.source;return e.flags&&(t=`(?${e.flags})${t}`),t}function Rt(e){let t;try{t=we(e);}catch{return Pt(e)}return JSON.parse(t)}var de=chunkK7PV4FXJ_cjs.a("fs"),Ge=chunkK7PV4FXJ_cjs.a("os"),ne=chunkK7PV4FXJ_cjs.a("path"),ve=process.env.ESBUILD_BINARY_PATH||ve,Ut=e=>!!e&&e!=="/usr/bin/esbuild",Xe="@esbuild/darwin-arm64",Ze="@esbuild/darwin-x64",Te={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},Fe={"aix ppc64 BE":"@esbuild/aix-ppc64","android arm64 LE":"@esbuild/android-arm64","darwin arm64 LE":"@esbuild/darwin-arm64","darwin x64 LE":"@esbuild/darwin-x64","freebsd arm64 LE":"@esbuild/freebsd-arm64","freebsd x64 LE":"@esbuild/freebsd-x64","linux arm LE":"@esbuild/linux-arm","linux arm64 LE":"@esbuild/linux-arm64","linux ia32 LE":"@esbuild/linux-ia32","linux mips64el LE":"@esbuild/linux-mips64el","linux ppc64 LE":"@esbuild/linux-ppc64","linux riscv64 LE":"@esbuild/linux-riscv64","linux s390x BE":"@esbuild/linux-s390x","linux x64 LE":"@esbuild/linux-x64","linux loong64 LE":"@esbuild/linux-loong64","netbsd arm64 LE":"@esbuild/netbsd-arm64","netbsd x64 LE":"@esbuild/netbsd-x64","openbsd arm64 LE":"@esbuild/openbsd-arm64","openbsd x64 LE":"@esbuild/openbsd-x64","sunos x64 LE":"@esbuild/sunos-x64"},et={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function Wt(){let e,t,r=false,n=`${process.platform} ${Ge.arch()} ${Ge.endianness()}`;if(n in Te)e=Te[n],t="esbuild.exe";else if(n in Fe)e=Fe[n],t="bin/esbuild";else if(n in et)e=et[n],t="bin/esbuild",r=true;else throw new Error(`Unsupported platform: ${n}`);return {pkg:e,subpath:t,isWASM:r}}function zt(){let e=chunkK7PV4FXJ_cjs.a.resolve("esbuild"),t=ne.dirname(ne.dirname(ne.dirname(e)));if(ne.basename(t)==="node_modules"){for(let r in Fe)try{let n=Fe[r];if(de.existsSync(ne.join(t,n)))return n}catch{}for(let r in Te)try{let n=Te[r];if(de.existsSync(ne.join(t,n)))return n}catch{}}return null}function qt(e,t){let r=ne.dirname(chunkK7PV4FXJ_cjs.a.resolve("esbuild"));return ne.join(r,`downloaded-${e.replace("/","-")}-${ne.basename(t)}`)}function Jt(){if(Ut(ve))if(!de.existsSync(ve))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ve}`);else return {binPath:ve,isWASM:false};let{pkg:e,subpath:t,isWASM:r}=Wt(),n;try{n=chunkK7PV4FXJ_cjs.a.resolve(`${e}/${t}`);}catch(o){if(n=qt(e,t),!de.existsSync(n)){try{chunkK7PV4FXJ_cjs.a.resolve(e);}catch{let s=zt();if(s){let a=`
14
+ ${d}:${i}:${c}: ERROR: ${u}${s.text}`}).join("");let o=new Error(e);for(let[s,a]of [["errors",t],["warnings",r]])Object.defineProperty(o,s,{configurable:true,enumerable:true,get:()=>a,set:d=>Object.defineProperty(o,s,{configurable:true,enumerable:true,value:d})});return o}function ke(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Qe(e,t,r){if(e==null)return null;let n={},o=l(e,n,"file",b),s=l(e,n,"namespace",b),a=l(e,n,"line",me),d=l(e,n,"column",me),i=l(e,n,"length",me),c=l(e,n,"lineText",b),u=l(e,n,"suggestion",b);if(J(e,n,t),c){let y=c.slice(0,(d&&d>0?d:0)+(i&&i>0?i:0)+(r&&r>0?r:80));!/[\x7F-\uFFFF]/.test(y)&&!/\n/.test(c)&&(c=y);}return {file:o||"",namespace:s||"",line:a||0,column:d||0,length:i||0,lineText:c||"",suggestion:u||""}}function fe(e,t,r,n,o){let s=[],a=0;for(let d of e){let i={},c=l(d,i,"id",b),u=l(d,i,"pluginName",b),y=l(d,i,"text",b),B=l(d,i,"location",Ke),_=l(d,i,"notes",ce),N=l(d,i,"detail",Me),I=`in element ${a} of "${t}"`;J(d,i,I);let L=[];if(_)for(let W of _){let z={},k=l(W,z,"text",b),w=l(W,z,"location",Ke);J(W,z,I),L.push({text:k||"",location:Qe(w,I,o)});}s.push({id:c||"",pluginName:u||n,text:y||"",location:Qe(B,I,o),notes:L,detail:r?r.store(N):-1}),a++;}return s}function Ce(e,t){let r=[];for(let n of e){if(typeof n!="string")throw new Error(`${V(t)} must be an array of strings`);r.push(n);}return r}function Nt(e,t){let r=Object.create(null);for(let n in e){let o=e[n];if(typeof o!="string")throw new Error(`key ${V(n)} in object ${V(t)} must be a string`);r[n]=o;}return r}function It({path:e,contents:t,hash:r}){let n=null;return {path:e,contents:t,hash:r,get text(){let o=this.contents;return (n===null||o!==t)&&(t=o,n=we(o)),n}}}function Le(e){let t=e.source;return e.flags&&(t=`(?${e.flags})${t}`),t}function Rt(e){let t;try{t=we(e);}catch{return Pt(e)}return JSON.parse(t)}var de=chunkE2GY67T5_cjs.a("fs"),Ge=chunkE2GY67T5_cjs.a("os"),ne=chunkE2GY67T5_cjs.a("path"),ve=process.env.ESBUILD_BINARY_PATH||ve,Ut=e=>!!e&&e!=="/usr/bin/esbuild",Xe="@esbuild/darwin-arm64",Ze="@esbuild/darwin-x64",Te={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},Fe={"aix ppc64 BE":"@esbuild/aix-ppc64","android arm64 LE":"@esbuild/android-arm64","darwin arm64 LE":"@esbuild/darwin-arm64","darwin x64 LE":"@esbuild/darwin-x64","freebsd arm64 LE":"@esbuild/freebsd-arm64","freebsd x64 LE":"@esbuild/freebsd-x64","linux arm LE":"@esbuild/linux-arm","linux arm64 LE":"@esbuild/linux-arm64","linux ia32 LE":"@esbuild/linux-ia32","linux mips64el LE":"@esbuild/linux-mips64el","linux ppc64 LE":"@esbuild/linux-ppc64","linux riscv64 LE":"@esbuild/linux-riscv64","linux s390x BE":"@esbuild/linux-s390x","linux x64 LE":"@esbuild/linux-x64","linux loong64 LE":"@esbuild/linux-loong64","netbsd arm64 LE":"@esbuild/netbsd-arm64","netbsd x64 LE":"@esbuild/netbsd-x64","openbsd arm64 LE":"@esbuild/openbsd-arm64","openbsd x64 LE":"@esbuild/openbsd-x64","sunos x64 LE":"@esbuild/sunos-x64"},et={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function Wt(){let e,t,r=false,n=`${process.platform} ${Ge.arch()} ${Ge.endianness()}`;if(n in Te)e=Te[n],t="esbuild.exe";else if(n in Fe)e=Fe[n],t="bin/esbuild";else if(n in et)e=et[n],t="bin/esbuild",r=true;else throw new Error(`Unsupported platform: ${n}`);return {pkg:e,subpath:t,isWASM:r}}function zt(){let e=chunkE2GY67T5_cjs.a.resolve("esbuild"),t=ne.dirname(ne.dirname(ne.dirname(e)));if(ne.basename(t)==="node_modules"){for(let r in Fe)try{let n=Fe[r];if(de.existsSync(ne.join(t,n)))return n}catch{}for(let r in Te)try{let n=Te[r];if(de.existsSync(ne.join(t,n)))return n}catch{}}return null}function qt(e,t){let r=ne.dirname(chunkE2GY67T5_cjs.a.resolve("esbuild"));return ne.join(r,`downloaded-${e.replace("/","-")}-${ne.basename(t)}`)}function Jt(){if(Ut(ve))if(!de.existsSync(ve))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ve}`);else return {binPath:ve,isWASM:false};let{pkg:e,subpath:t,isWASM:r}=Wt(),n;try{n=chunkE2GY67T5_cjs.a.resolve(`${e}/${t}`);}catch(o){if(n=qt(e,t),!de.existsSync(n)){try{chunkE2GY67T5_cjs.a.resolve(e);}catch{let s=zt();if(s){let a=`
15
15
  Specifically the "${s}" package is present but this platform
16
16
  needs the "${e}" package instead. People often get into this
17
17
  situation by installing esbuild on Windows or macOS and copying "node_modules"
@@ -60,7 +60,7 @@ want to do that.
60
60
  If you are installing esbuild with npm, make sure that you don't specify the
61
61
  "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
62
62
  of "package.json" is used by esbuild to install the correct binary executable
63
- for your current platform.`)}throw o}}if(/\.zip\//.test(n)){let o;try{o=chunkK7PV4FXJ_cjs.a("pnpapi");}catch{}if(o){let s=o.getPackageInformation(o.topLevel).packageLocation,a=ne.join(s,"node_modules",".cache","esbuild",`pnpapi-${e.replace("/","-")}-0.28.2-${ne.basename(t)}`);return de.existsSync(a)||(de.mkdirSync(ne.dirname(a),{recursive:true}),de.copyFileSync(n,a),de.chmodSync(a,493)),{binPath:a,isWASM:r}}}return {binPath:n,isWASM:r}}var ht=chunkK7PV4FXJ_cjs.a("child_process"),Vt=chunkK7PV4FXJ_cjs.a("crypto"),We=chunkK7PV4FXJ_cjs.a("path"),pe=chunkK7PV4FXJ_cjs.a("fs"),Yt=chunkK7PV4FXJ_cjs.a("os"),Ht=chunkK7PV4FXJ_cjs.a("tty"),H;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{H=chunkK7PV4FXJ_cjs.a("worker_threads");}catch{}let[e,t]=process.versions.node.split(".");(+e<12||+e==12&&+t<17||+e==13&&+t<13)&&(H=void 0);}var tt,Oe=((tt=H?.workerData)==null?void 0:tt.esbuildVersion)==="0.28.2",mt=()=>{if(!ve&&(We.basename(__filename)!=="main.js"||We.basename(__dirname)!=="lib"))throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
63
+ for your current platform.`)}throw o}}if(/\.zip\//.test(n)){let o;try{o=chunkE2GY67T5_cjs.a("pnpapi");}catch{}if(o){let s=o.getPackageInformation(o.topLevel).packageLocation,a=ne.join(s,"node_modules",".cache","esbuild",`pnpapi-${e.replace("/","-")}-0.28.2-${ne.basename(t)}`);return de.existsSync(a)||(de.mkdirSync(ne.dirname(a),{recursive:true}),de.copyFileSync(n,a),de.chmodSync(a,493)),{binPath:a,isWASM:r}}}return {binPath:n,isWASM:r}}var ht=chunkE2GY67T5_cjs.a("child_process"),Vt=chunkE2GY67T5_cjs.a("crypto"),We=chunkE2GY67T5_cjs.a("path"),pe=chunkE2GY67T5_cjs.a("fs"),Yt=chunkE2GY67T5_cjs.a("os"),Ht=chunkE2GY67T5_cjs.a("tty"),H;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{H=chunkE2GY67T5_cjs.a("worker_threads");}catch{}let[e,t]=process.versions.node.split(".");(+e<12||+e==12&&+t<17||+e==13&&+t<13)&&(H=void 0);}var tt,Oe=((tt=H?.workerData)==null?void 0:tt.esbuildVersion)==="0.28.2",mt=()=>{if(!ve&&(We.basename(__filename)!=="main.js"||We.basename(__dirname)!=="lib"))throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
64
64
 
65
65
  More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`);{let{binPath:e,isWASM:t}=Jt();return t?["node",[e]]:[e,[]]}},Ae=()=>Ht.isatty(2),Kt={readFile(e,t){try{let r=pe.readFileSync(e,"utf8");try{pe.unlinkSync(e);}catch{}t(null,r);}catch(r){t(r,null);}},writeFile(e,t){try{let r=pt();pe.writeFileSync(r,e),t(r);}catch{t(null);}}},Qt={readFile(e,t){try{pe.readFile(e,"utf8",(r,n)=>{try{pe.unlink(e,()=>t(r,n));}catch{t(r,n);}});}catch(r){t(r,null);}},writeFile(e,t){try{let r=pt();pe.writeFile(r,e,n=>t(n!==null?null:r));}catch{t(null);}}},Gt="0.28.2",Xt=e=>ye().build(e),Zt=e=>ye().context(e),er=(e,t)=>ye().transform(e,t),tr=(e,t)=>ye().formatMessages(e,t),rr=(e,t)=>ye().analyzeMetafile(e,t),nr=e=>{if(H&&!Oe)return K||(K=Ie(H)),K.buildSync(e);let t;return Ne(r=>r.buildOrContext({callName:"buildSync",refs:null,options:e,isTTY:Ae(),defaultWD:ge,callback:(n,o)=>{if(n)throw n;t=o;}})),t},ir=(e,t)=>{if(H&&!Oe)return K||(K=Ie(H)),K.transformSync(e,t);let r;return Ne(n=>n.transform({callName:"transformSync",refs:null,input:e,options:t||{},isTTY:Ae(),fs:Kt,callback:(o,s)=>{if(o)throw o;r=s;}})),r},lr=(e,t)=>{if(H&&!Oe)return K||(K=Ie(H)),K.formatMessagesSync(e,t);let r;return Ne(n=>n.formatMessages({callName:"formatMessagesSync",refs:null,messages:e,options:t,callback:(o,s)=>{if(o)throw o;r=s;}})),r},ar=(e,t)=>{if(H&&!Oe)return K||(K=Ie(H)),K.analyzeMetafileSync(e,t);let r;return Ne(n=>n.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof e=="string"?e:JSON.stringify(e),options:t,callback:(o,s)=>{if(o)throw o;r=s;}})),r},or=()=>(_e&&_e(),K&&K.stop(),Promise.resolve()),ze=false,sr=e=>{if(e=Lt(e||{}),e.wasmURL)throw new Error('The "wasmURL" option only works in the browser');if(e.wasmModule)throw new Error('The "wasmModule" option only works in the browser');if(e.worker)throw new Error('The "worker" option only works in the browser');if(ze)throw new Error('Cannot call "initialize" more than once');return ye(),ze=true,Promise.resolve()},ge=process.cwd(),Se,_e,ye=()=>{if(Se)return Se;let[e,t]=mt(),r=ht.spawn(e,t.concat("--service=0.28.2","--ping"),{windowsHide:true,stdio:["pipe","pipe","inherit"],cwd:ge}),{readFromStdout:n,afterClose:o,service:s}=ct({writeToStdin(u){r.stdin.write(u,y=>{y&&o(y);});},readFileSync:pe.readFileSync,isSync:false,hasFS:true,esbuild:Pe});r.stdin.on("error",o),r.on("error",o);let a=r.stdin,d=r.stdout;d.on("data",n),d.on("end",o),_e=()=>{a.destroy(),d.destroy(),r.kill(),ze=false,Se=void 0,_e=void 0;};let i=0;r.unref(),a.unref&&a.unref(),d.unref&&d.unref();let c={ref(){++i===1&&r.ref();},unref(){--i===0&&r.unref();}};return Se={build:u=>new Promise((y,B)=>{s.buildOrContext({callName:"build",refs:c,options:u,isTTY:Ae(),defaultWD:ge,callback:(_,N)=>_?B(_):y(N)});}),context:u=>new Promise((y,B)=>s.buildOrContext({callName:"context",refs:c,options:u,isTTY:Ae(),defaultWD:ge,callback:(_,N)=>_?B(_):y(N)})),transform:(u,y)=>new Promise((B,_)=>s.transform({callName:"transform",refs:c,input:u,options:y||{},isTTY:Ae(),fs:Qt,callback:(N,I)=>N?_(N):B(I)})),formatMessages:(u,y)=>new Promise((B,_)=>s.formatMessages({callName:"formatMessages",refs:c,messages:u,options:y,callback:(N,I)=>N?_(N):B(I)})),analyzeMetafile:(u,y)=>new Promise((B,_)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:c,metafile:typeof u=="string"?u:JSON.stringify(u),options:y,callback:(N,I)=>N?_(N):B(I)}))},Se},Ne=e=>{let[t,r]=mt(),n=new Uint8Array,{readFromStdout:o,afterClose:s,service:a}=ct({writeToStdin(i){if(n.length!==0)throw new Error("Must run at most one command");n=i;},isSync:true,hasFS:true,esbuild:Pe});e(a);let d=ht.execFileSync(t,r.concat("--service=0.28.2"),{cwd:ge,windowsHide:true,input:n,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16*1024*1024});o(d),s(null);},pt=()=>We.join(Yt.tmpdir(),`esbuild-${Vt.randomBytes(32).toString("hex")}`),K=null,Ie=e=>{let{port1:t,port2:r}=new e.MessageChannel,n=new e.Worker(__filename,{workerData:{workerPort:r,defaultWD:ge,esbuildVersion:"0.28.2"},transferList:[r],execArgv:[]}),o=0,s=c=>{let u=new Error(`Build failed with 1 error:
66
- error: ${c}`),y=[{id:"",pluginName:"",text:c,location:null,notes:[],detail:void 0}];return u.errors=y,u.warnings=[],u},a=c=>{if(!c)return;let u=c.plugins;if(u&&u.length>0)throw s("Cannot use plugins in synchronous API calls")},d=(c,u)=>{for(let y in u)c[y]=u[y];},i=(c,u)=>{let y=o++,B=new SharedArrayBuffer(8),_=new Int32Array(B),N={sharedBuffer:B,id:y,command:c,args:u};n.postMessage(N);let I=Atomics.wait(_,0,0);if(I!=="ok"&&I!=="not-equal")throw new Error("Internal error: Atomics.wait() failed: "+I);let{message:{id:L,resolve:W,reject:z,properties:k}}=e.receiveMessageOnPort(t);if(y!==L)throw new Error(`Internal error: Expected id ${y} but got id ${L}`);if(z)throw d(z,k),z;return W};return n.unref(),{buildSync(c){return a(c),i("build",[c])},transformSync(c,u){return i("transform",[c,u])},formatMessagesSync(c,u){return i("formatMessages",[c,u])},analyzeMetafileSync(c,u){return i("analyzeMetafile",[c,u])},stop(){n.terminate(),K=null;}}},ur=()=>{let e=H.workerData.workerPort,t=H.parentPort,r=n=>{let o={};if(n&&typeof n=="object")for(let s in n)o[s]=n[s];return o};try{let n=ye();ge=H.workerData.defaultWD,t.on("message",o=>{(async()=>{let{sharedBuffer:s,id:a,command:d,args:i}=o,c=new Int32Array(s);try{switch(d){case "build":e.postMessage({id:a,resolve:await n.build(i[0])});break;case "transform":e.postMessage({id:a,resolve:await n.transform(i[0],i[1])});break;case "formatMessages":e.postMessage({id:a,resolve:await n.formatMessages(i[0],i[1])});break;case "analyzeMetafile":e.postMessage({id:a,resolve:await n.analyzeMetafile(i[0],i[1])});break;default:throw new Error(`Invalid command: ${d}`)}}catch(u){e.postMessage({id:a,reject:u,properties:r(u)});}Atomics.add(c,0,1),Atomics.notify(c,0,1/0);})();});}catch(n){t.on("message",o=>{let{sharedBuffer:s,id:a}=o,d=new Int32Array(s);e.postMessage({id:a,reject:n,properties:r(n)}),Atomics.add(d,0,1),Atomics.notify(d,0,1/0);});}};Oe&&ur();var cr=Pe;});var mainAFZUDH75 = fr();module.exports=mainAFZUDH75;
66
+ error: ${c}`),y=[{id:"",pluginName:"",text:c,location:null,notes:[],detail:void 0}];return u.errors=y,u.warnings=[],u},a=c=>{if(!c)return;let u=c.plugins;if(u&&u.length>0)throw s("Cannot use plugins in synchronous API calls")},d=(c,u)=>{for(let y in u)c[y]=u[y];},i=(c,u)=>{let y=o++,B=new SharedArrayBuffer(8),_=new Int32Array(B),N={sharedBuffer:B,id:y,command:c,args:u};n.postMessage(N);let I=Atomics.wait(_,0,0);if(I!=="ok"&&I!=="not-equal")throw new Error("Internal error: Atomics.wait() failed: "+I);let{message:{id:L,resolve:W,reject:z,properties:k}}=e.receiveMessageOnPort(t);if(y!==L)throw new Error(`Internal error: Expected id ${y} but got id ${L}`);if(z)throw d(z,k),z;return W};return n.unref(),{buildSync(c){return a(c),i("build",[c])},transformSync(c,u){return i("transform",[c,u])},formatMessagesSync(c,u){return i("formatMessages",[c,u])},analyzeMetafileSync(c,u){return i("analyzeMetafile",[c,u])},stop(){n.terminate(),K=null;}}},ur=()=>{let e=H.workerData.workerPort,t=H.parentPort,r=n=>{let o={};if(n&&typeof n=="object")for(let s in n)o[s]=n[s];return o};try{let n=ye();ge=H.workerData.defaultWD,t.on("message",o=>{(async()=>{let{sharedBuffer:s,id:a,command:d,args:i}=o,c=new Int32Array(s);try{switch(d){case "build":e.postMessage({id:a,resolve:await n.build(i[0])});break;case "transform":e.postMessage({id:a,resolve:await n.transform(i[0],i[1])});break;case "formatMessages":e.postMessage({id:a,resolve:await n.formatMessages(i[0],i[1])});break;case "analyzeMetafile":e.postMessage({id:a,resolve:await n.analyzeMetafile(i[0],i[1])});break;default:throw new Error(`Invalid command: ${d}`)}}catch(u){e.postMessage({id:a,reject:u,properties:r(u)});}Atomics.add(c,0,1),Atomics.notify(c,0,1/0);})();});}catch(n){t.on("message",o=>{let{sharedBuffer:s,id:a}=o,d=new Int32Array(s);e.postMessage({id:a,reject:n,properties:r(n)}),Atomics.add(d,0,1),Atomics.notify(d,0,1/0);});}};Oe&&ur();var cr=Pe;});var mainV5WRX5GG = fr();module.exports=mainV5WRX5GG;
@@ -1,4 +1,4 @@
1
- import {b,f,a,e,d}from'./chunk-6GV3NECV.mjs';var hr=b((mr,yt)=>{f();var Je=Object.defineProperty,kt=Object.getOwnPropertyDescriptor,$t=Object.getOwnPropertyNames,St=Object.prototype.hasOwnProperty,Et=(e,t)=>{for(var r in t)Je(e,r,{get:t[r],enumerable:true});},At=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $t(t))!St.call(e,o)&&o!==r&&Je(e,o,{get:()=>t[o],enumerable:!(n=kt(t,o))||n.enumerable});return e},Pt=e=>At(Je({},"__esModule",{value:true}),e),Pe={};Et(Pe,{analyzeMetafile:()=>ir,analyzeMetafileSync:()=>sr,build:()=>er,buildSync:()=>lr,context:()=>tr,default:()=>dr,formatMessages:()=>nr,formatMessagesSync:()=>or,initialize:()=>cr,stop:()=>ur,transform:()=>rr,transformSync:()=>ar,version:()=>Zt});yt.exports=Pt(Pe);function He(e){let t=n=>{if(n===null)r.write8(0);else if(typeof n=="boolean")r.write8(1),r.write8(+n);else if(typeof n=="number")r.write8(2),r.write32(n|0);else if(typeof n=="string")r.write8(3),r.write(ie(n));else if(n instanceof Uint8Array)r.write8(4),r.write(n);else if(n instanceof Array){r.write8(5),r.write32(n.length);for(let o of n)t(o);}else {let o=Object.keys(n);r.write8(6),r.write32(o.length);for(let s of o)r.write(ie(s)),t(n[s]);}},r=new it;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),We(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Ot(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return !!r.read8();case 2:return r.read32();case 3:return we(r.read());case 4:return r.read();case 5:{let a=r.read32(),d=[];for(let i=0;i<a;i++)d.push(t());return d}case 6:{let a=r.read32(),d={};for(let i=0;i<a;i++)d[we(r.read())]=t();return d}default:throw new Error("Invalid packet")}},r=new it(e),n=r.read32(),o=(n&1)===0;n>>>=1;let s=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return {id:n,isRequest:o,value:s}}var it=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0;}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t;}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e;}write32(e){let t=this._write(4);We(this.buf,e,t);}write(e){let t=this._write(4+e.length);We(this.buf,e.length,t),this.buf.set(e,t+4);}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return lt(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},ie,we,Ue;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;ie=r=>e.encode(r),we=r=>t.decode(r),Ue='new TextEncoder().encode("")';}else if(typeof Buffer<"u")ie=e=>Buffer.from(e),we=e=>{let{buffer:t,byteOffset:r,byteLength:n}=e;return Buffer.from(t,r,n).toString()},Ue='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(ie("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Ue} instanceof Uint8Array" is incorrectly false
1
+ import {b,f,a,e,d}from'./chunk-B4W5JDXX.mjs';var hr=b((mr,yt)=>{f();var Je=Object.defineProperty,kt=Object.getOwnPropertyDescriptor,$t=Object.getOwnPropertyNames,St=Object.prototype.hasOwnProperty,Et=(e,t)=>{for(var r in t)Je(e,r,{get:t[r],enumerable:true});},At=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $t(t))!St.call(e,o)&&o!==r&&Je(e,o,{get:()=>t[o],enumerable:!(n=kt(t,o))||n.enumerable});return e},Pt=e=>At(Je({},"__esModule",{value:true}),e),Pe={};Et(Pe,{analyzeMetafile:()=>ir,analyzeMetafileSync:()=>sr,build:()=>er,buildSync:()=>lr,context:()=>tr,default:()=>dr,formatMessages:()=>nr,formatMessagesSync:()=>or,initialize:()=>cr,stop:()=>ur,transform:()=>rr,transformSync:()=>ar,version:()=>Zt});yt.exports=Pt(Pe);function He(e){let t=n=>{if(n===null)r.write8(0);else if(typeof n=="boolean")r.write8(1),r.write8(+n);else if(typeof n=="number")r.write8(2),r.write32(n|0);else if(typeof n=="string")r.write8(3),r.write(ie(n));else if(n instanceof Uint8Array)r.write8(4),r.write(n);else if(n instanceof Array){r.write8(5),r.write32(n.length);for(let o of n)t(o);}else {let o=Object.keys(n);r.write8(6),r.write32(o.length);for(let s of o)r.write(ie(s)),t(n[s]);}},r=new it;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),We(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Ot(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return !!r.read8();case 2:return r.read32();case 3:return we(r.read());case 4:return r.read();case 5:{let a=r.read32(),d=[];for(let i=0;i<a;i++)d.push(t());return d}case 6:{let a=r.read32(),d={};for(let i=0;i<a;i++)d[we(r.read())]=t();return d}default:throw new Error("Invalid packet")}},r=new it(e),n=r.read32(),o=(n&1)===0;n>>>=1;let s=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return {id:n,isRequest:o,value:s}}var it=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0;}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t;}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e;}write32(e){let t=this._write(4);We(this.buf,e,t);}write(e){let t=this._write(4+e.length);We(this.buf,e.length,t),this.buf.set(e,t+4);}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return lt(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},ie,we,Ue;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;ie=r=>e.encode(r),we=r=>t.decode(r),Ue='new TextEncoder().encode("")';}else if(typeof Buffer<"u")ie=e=>Buffer.from(e),we=e=>{let{buffer:t,byteOffset:r,byteLength:n}=e;return Buffer.from(t,r,n).toString()},Ue='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(ie("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Ue} instanceof Uint8Array" is incorrectly false
2
2
 
3
3
  This indicates that your JavaScript environment is broken. You cannot use
4
4
  esbuild in this environment because esbuild relies on this invariant. This
@@ -63,4 +63,4 @@ of "package.json" is used by esbuild to install the correct binary executable
63
63
  for your current platform.`)}throw o}}if(/\.zip\//.test(n)){let o;try{o=a("pnpapi");}catch{}if(o){let s=o.getPackageInformation(o.topLevel).packageLocation,a=ne.join(s,"node_modules",".cache","esbuild",`pnpapi-${e.replace("/","-")}-0.28.2-${ne.basename(t)}`);return de.existsSync(a)||(de.mkdirSync(ne.dirname(a),{recursive:true}),de.copyFileSync(n,a),de.chmodSync(a,493)),{binPath:a,isWASM:r}}}return {binPath:n,isWASM:r}}var pt=a("child_process"),Ht=a("crypto"),ze=a("path"),pe=a("fs"),Kt=a("os"),Qt=a("tty"),H;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{H=a("worker_threads");}catch{}let[e,t]=process.versions.node.split(".");(+e<12||+e==12&&+t<17||+e==13&&+t<13)&&(H=void 0);}var nt,Oe=((nt=H?.workerData)==null?void 0:nt.esbuildVersion)==="0.28.2",gt=()=>{if(!ve&&(ze.basename(e)!=="main.js"||ze.basename(d)!=="lib"))throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
64
64
 
65
65
  More information: The file containing the code for esbuild's JavaScript API (${e}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`);{let{binPath:e,isWASM:t}=Yt();return t?["node",[e]]:[e,[]]}},Ae=()=>Qt.isatty(2),Gt={readFile(e,t){try{let r=pe.readFileSync(e,"utf8");try{pe.unlinkSync(e);}catch{}t(null,r);}catch(r){t(r,null);}},writeFile(e,t){try{let r=wt();pe.writeFileSync(r,e),t(r);}catch{t(null);}}},Xt={readFile(e,t){try{pe.readFile(e,"utf8",(r,n)=>{try{pe.unlink(e,()=>t(r,n));}catch{t(r,n);}});}catch(r){t(r,null);}},writeFile(e,t){try{let r=wt();pe.writeFile(r,e,n=>t(n!==null?null:r));}catch{t(null);}}},Zt="0.28.2",er=e=>ye().build(e),tr=e=>ye().context(e),rr=(e,t)=>ye().transform(e,t),nr=(e,t)=>ye().formatMessages(e,t),ir=(e,t)=>ye().analyzeMetafile(e,t),lr=e=>{if(H&&!Oe)return K||(K=Re(H)),K.buildSync(e);let t;return Ie(r=>r.buildOrContext({callName:"buildSync",refs:null,options:e,isTTY:Ae(),defaultWD:ge,callback:(n,o)=>{if(n)throw n;t=o;}})),t},ar=(e,t)=>{if(H&&!Oe)return K||(K=Re(H)),K.transformSync(e,t);let r;return Ie(n=>n.transform({callName:"transformSync",refs:null,input:e,options:t||{},isTTY:Ae(),fs:Gt,callback:(o,s)=>{if(o)throw o;r=s;}})),r},or=(e,t)=>{if(H&&!Oe)return K||(K=Re(H)),K.formatMessagesSync(e,t);let r;return Ie(n=>n.formatMessages({callName:"formatMessagesSync",refs:null,messages:e,options:t,callback:(o,s)=>{if(o)throw o;r=s;}})),r},sr=(e,t)=>{if(H&&!Oe)return K||(K=Re(H)),K.analyzeMetafileSync(e,t);let r;return Ie(n=>n.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof e=="string"?e:JSON.stringify(e),options:t,callback:(o,s)=>{if(o)throw o;r=s;}})),r},ur=()=>(Ne&&Ne(),K&&K.stop(),Promise.resolve()),qe=false,cr=e=>{if(e=Ft(e||{}),e.wasmURL)throw new Error('The "wasmURL" option only works in the browser');if(e.wasmModule)throw new Error('The "wasmModule" option only works in the browser');if(e.worker)throw new Error('The "worker" option only works in the browser');if(qe)throw new Error('Cannot call "initialize" more than once');return ye(),qe=true,Promise.resolve()},ge=process.cwd(),Se,Ne,ye=()=>{if(Se)return Se;let[e,t]=gt(),r=pt.spawn(e,t.concat("--service=0.28.2","--ping"),{windowsHide:true,stdio:["pipe","pipe","inherit"],cwd:ge}),{readFromStdout:n,afterClose:o,service:s}=dt({writeToStdin(u){r.stdin.write(u,y=>{y&&o(y);});},readFileSync:pe.readFileSync,isSync:false,hasFS:true,esbuild:Pe});r.stdin.on("error",o),r.on("error",o);let a=r.stdin,d=r.stdout;d.on("data",n),d.on("end",o),Ne=()=>{a.destroy(),d.destroy(),r.kill(),qe=false,Se=void 0,Ne=void 0;};let i=0;r.unref(),a.unref&&a.unref(),d.unref&&d.unref();let c={ref(){++i===1&&r.ref();},unref(){--i===0&&r.unref();}};return Se={build:u=>new Promise((y,N)=>{s.buildOrContext({callName:"build",refs:c,options:u,isTTY:Ae(),defaultWD:ge,callback:(B,_)=>B?N(B):y(_)});}),context:u=>new Promise((y,N)=>s.buildOrContext({callName:"context",refs:c,options:u,isTTY:Ae(),defaultWD:ge,callback:(B,_)=>B?N(B):y(_)})),transform:(u,y)=>new Promise((N,B)=>s.transform({callName:"transform",refs:c,input:u,options:y||{},isTTY:Ae(),fs:Xt,callback:(_,I)=>_?B(_):N(I)})),formatMessages:(u,y)=>new Promise((N,B)=>s.formatMessages({callName:"formatMessages",refs:c,messages:u,options:y,callback:(_,I)=>_?B(_):N(I)})),analyzeMetafile:(u,y)=>new Promise((N,B)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:c,metafile:typeof u=="string"?u:JSON.stringify(u),options:y,callback:(_,I)=>_?B(_):N(I)}))},Se},Ie=e=>{let[t,r]=gt(),n=new Uint8Array,{readFromStdout:o,afterClose:s,service:a}=dt({writeToStdin(i){if(n.length!==0)throw new Error("Must run at most one command");n=i;},isSync:true,hasFS:true,esbuild:Pe});e(a);let d=pt.execFileSync(t,r.concat("--service=0.28.2"),{cwd:ge,windowsHide:true,input:n,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16*1024*1024});o(d),s(null);},wt=()=>ze.join(Kt.tmpdir(),`esbuild-${Ht.randomBytes(32).toString("hex")}`),K=null,Re=e$1=>{let{port1:t,port2:r}=new e$1.MessageChannel,n=new e$1.Worker(e,{workerData:{workerPort:r,defaultWD:ge,esbuildVersion:"0.28.2"},transferList:[r],execArgv:[]}),o=0,s=c=>{let u=new Error(`Build failed with 1 error:
66
- error: ${c}`),y=[{id:"",pluginName:"",text:c,location:null,notes:[],detail:void 0}];return u.errors=y,u.warnings=[],u},a=c=>{if(!c)return;let u=c.plugins;if(u&&u.length>0)throw s("Cannot use plugins in synchronous API calls")},d=(c,u)=>{for(let y in u)c[y]=u[y];},i=(c,u)=>{let y=o++,N=new SharedArrayBuffer(8),B=new Int32Array(N),_={sharedBuffer:N,id:y,command:c,args:u};n.postMessage(_);let I=Atomics.wait(B,0,0);if(I!=="ok"&&I!=="not-equal")throw new Error("Internal error: Atomics.wait() failed: "+I);let{message:{id:L,resolve:W,reject:z,properties:k}}=e$1.receiveMessageOnPort(t);if(y!==L)throw new Error(`Internal error: Expected id ${y} but got id ${L}`);if(z)throw d(z,k),z;return W};return n.unref(),{buildSync(c){return a(c),i("build",[c])},transformSync(c,u){return i("transform",[c,u])},formatMessagesSync(c,u){return i("formatMessages",[c,u])},analyzeMetafileSync(c,u){return i("analyzeMetafile",[c,u])},stop(){n.terminate(),K=null;}}},fr=()=>{let e=H.workerData.workerPort,t=H.parentPort,r=n=>{let o={};if(n&&typeof n=="object")for(let s in n)o[s]=n[s];return o};try{let n=ye();ge=H.workerData.defaultWD,t.on("message",o=>{(async()=>{let{sharedBuffer:s,id:a,command:d,args:i}=o,c=new Int32Array(s);try{switch(d){case "build":e.postMessage({id:a,resolve:await n.build(i[0])});break;case "transform":e.postMessage({id:a,resolve:await n.transform(i[0],i[1])});break;case "formatMessages":e.postMessage({id:a,resolve:await n.formatMessages(i[0],i[1])});break;case "analyzeMetafile":e.postMessage({id:a,resolve:await n.analyzeMetafile(i[0],i[1])});break;default:throw new Error(`Invalid command: ${d}`)}}catch(u){e.postMessage({id:a,reject:u,properties:r(u)});}Atomics.add(c,0,1),Atomics.notify(c,0,1/0);})();});}catch(n){t.on("message",o=>{let{sharedBuffer:s,id:a}=o,d=new Int32Array(s);e.postMessage({id:a,reject:n,properties:r(n)}),Atomics.add(d,0,1),Atomics.notify(d,0,1/0);});}};Oe&&fr();var dr=Pe;});var main3SAATRGB = hr();export{main3SAATRGB as default};
66
+ error: ${c}`),y=[{id:"",pluginName:"",text:c,location:null,notes:[],detail:void 0}];return u.errors=y,u.warnings=[],u},a=c=>{if(!c)return;let u=c.plugins;if(u&&u.length>0)throw s("Cannot use plugins in synchronous API calls")},d=(c,u)=>{for(let y in u)c[y]=u[y];},i=(c,u)=>{let y=o++,N=new SharedArrayBuffer(8),B=new Int32Array(N),_={sharedBuffer:N,id:y,command:c,args:u};n.postMessage(_);let I=Atomics.wait(B,0,0);if(I!=="ok"&&I!=="not-equal")throw new Error("Internal error: Atomics.wait() failed: "+I);let{message:{id:L,resolve:W,reject:z,properties:k}}=e$1.receiveMessageOnPort(t);if(y!==L)throw new Error(`Internal error: Expected id ${y} but got id ${L}`);if(z)throw d(z,k),z;return W};return n.unref(),{buildSync(c){return a(c),i("build",[c])},transformSync(c,u){return i("transform",[c,u])},formatMessagesSync(c,u){return i("formatMessages",[c,u])},analyzeMetafileSync(c,u){return i("analyzeMetafile",[c,u])},stop(){n.terminate(),K=null;}}},fr=()=>{let e=H.workerData.workerPort,t=H.parentPort,r=n=>{let o={};if(n&&typeof n=="object")for(let s in n)o[s]=n[s];return o};try{let n=ye();ge=H.workerData.defaultWD,t.on("message",o=>{(async()=>{let{sharedBuffer:s,id:a,command:d,args:i}=o,c=new Int32Array(s);try{switch(d){case "build":e.postMessage({id:a,resolve:await n.build(i[0])});break;case "transform":e.postMessage({id:a,resolve:await n.transform(i[0],i[1])});break;case "formatMessages":e.postMessage({id:a,resolve:await n.formatMessages(i[0],i[1])});break;case "analyzeMetafile":e.postMessage({id:a,resolve:await n.analyzeMetafile(i[0],i[1])});break;default:throw new Error(`Invalid command: ${d}`)}}catch(u){e.postMessage({id:a,reject:u,properties:r(u)});}Atomics.add(c,0,1),Atomics.notify(c,0,1/0);})();});}catch(n){t.on("message",o=>{let{sharedBuffer:s,id:a}=o,d=new Int32Array(s);e.postMessage({id:a,reject:n,properties:r(n)}),Atomics.add(d,0,1),Atomics.notify(d,0,1/0);});}};Oe&&fr();var dr=Pe;});var mainYN5MJ4HJ = hr();export{mainYN5MJ4HJ as default};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkAV7EICQL_cjs=require('./chunk-AV7EICQL.cjs');require('./chunk-E2GY67T5.cjs');Object.defineProperty(exports,"PackageRegistry",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.o}});
@@ -0,0 +1 @@
1
+ export{o as PackageRegistry}from'./chunk-UVVMQYTY.mjs';import'./chunk-B4W5JDXX.mjs';
@@ -0,0 +1 @@
1
+ export{H as $,G as Shell}from'./chunk-4ML53C4G.mjs';import'./chunk-XLTYO4H4.mjs';import'./chunk-UVVMQYTY.mjs';import'./chunk-B4W5JDXX.mjs';
@@ -0,0 +1 @@
1
+ 'use strict';var chunk2KQO2CPV_cjs=require('./chunk-2KQO2CPV.cjs');require('./chunk-QNBTABHK.cjs'),require('./chunk-AV7EICQL.cjs'),require('./chunk-E2GY67T5.cjs');Object.defineProperty(exports,"$",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.H}});Object.defineProperty(exports,"Shell",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.G}});
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
- 'use strict';var chunkIVVWAT7R_cjs=require('./chunks/chunk-IVVWAT7R.cjs'),chunkKKCFNFFR_cjs=require('./chunks/chunk-KKCFNFFR.cjs'),chunkGVXRTRAT_cjs=require('./chunks/chunk-GVXRTRAT.cjs'),chunk5XHOPT4Y_cjs=require('./chunks/chunk-5XHOPT4Y.cjs'),chunkK7PV4FXJ_cjs=require('./chunks/chunk-K7PV4FXJ.cjs'),fe=require('fs/promises'),G=require('zod'),crypto$1=require('crypto'),dotenv=require('dotenv'),ve=require('path'),xdgBasedir=require('xdg-basedir'),_t=require('os'),fs=require('fs'),url=require('url'),he=require('gray-matter'),undici=require('undici'),async_hooks=require('async_hooks');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var fe__default=/*#__PURE__*/_interopDefault(fe);var G__default=/*#__PURE__*/_interopDefault(G);var ve__default=/*#__PURE__*/_interopDefault(ve);var _t__default=/*#__PURE__*/_interopDefault(_t);var he__default=/*#__PURE__*/_interopDefault(he);chunkK7PV4FXJ_cjs.e();chunkK7PV4FXJ_cjs.e();function Pt(r,t){for(let n=r.length-1;n>=0;n-=1){let o=r[n];if(o!==void 0&&t(o,n,r))return o}}chunkK7PV4FXJ_cjs.e();exports.Binary=void 0;(n=>{function r(o,a,c){let m=0,i=o.length-1;for(;m<=i;){let f=Math.floor((m+i)/2),x=o[f];if(x===void 0)break;let T=c(x);if(T===a)return {found:true,index:f};T<a?m=f+1:i=f-1;}return {found:false,index:m}}n.search=r;function t(o,a,c){let m=c(a),i=0,f=o.length;for(;i<f;){let x=Math.floor((i+f)/2),T=o[x];if(T===void 0)break;c(T)<m?i=x+1:f=x;}return o.splice(i,0,a),o}n.insert=t;})(exports.Binary||(exports.Binary={}));chunkK7PV4FXJ_cjs.e();exports.Encode=void 0;(c=>{function r(m){let i=new TextEncoder().encode(m),f=Array.from(i,x=>String.fromCharCode(x)).join("");return btoa(f).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}c.base64Encode=r;function t(m){let i=atob(m.replace(/-/g,"+").replace(/_/g,"/")),f=Uint8Array.from(i,x=>x.charCodeAt(0));return new TextDecoder().decode(f)}c.base64Decode=t;async function n(m,i="SHA-256"){let x=new TextEncoder().encode(m),T=await crypto.subtle.digest(i,x);return Array.from(new Uint8Array(T)).map(h=>h.toString(16).padStart(2,"0")).join("")}c.hash=n;function o(m){if(!m)return;let i=2166136261;for(let f=0;f<m.length;f++)i^=m.charCodeAt(f),i=Math.imul(i,16777619);return (i>>>0).toString(36)}c.checksum=o;function a(m,i=5e5){if(!m)return;if(m.length<=i)return o(m);let f=4096,T=[0,Math.floor(m.length*.25),Math.floor(m.length*.5),Math.floor(m.length*.75),m.length-f].map(v=>{let y=Math.max(0,Math.min(m.length-f,v-Math.floor(f/2)));return o(m.slice(y,y+f))??""}).join(":");return `${m.length}:${T}`}c.sampledChecksum=a;})(exports.Encode||(exports.Encode={}));chunkK7PV4FXJ_cjs.e();chunkK7PV4FXJ_cjs.e();exports.Identifier=void 0;(v=>{let r={event:"evt",session:"ses",message:"msg",permission:"per",question:"que",user:"usr",part:"prt",pty:"pty",tool:"tool",workspace:"wrk",command:"cmd",task:"task",heartbeat:"hb",agent:"ag",subagent:"sub",hook:"hok",compaction:"cmp",context:"ctx",experience:"exp",pattern:"pat",knowledge:"knw",evolution:"evo",result:"res"};function t(y){return G__default.default.string().startsWith(r[y])}v.schema=t;let n=26,o=0,a=0;function c(y,h){return i(y,false,h)}v.ascending=c;function m(y,h){return i(y,true,h)}v.descending=m;function i(y,h,b){if(!b)return x(y,h);if(!b.startsWith(r[y]))throw new Error(`ID ${b} does not start with ${r[y]}`);return b}function f(y){let h="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",b="",A=crypto$1.randomBytes(y);for(let k=0;k<y;k++){let $=A[k];$!==void 0&&(b+=h[$%62]);}return b}function x(y,h,b){let A=b??Date.now();A!==o&&(o=A,a=0),a++;let k=BigInt(A)*BigInt(4096)+BigInt(a);k=h?~k:k;let $=Buffer.alloc(6);for(let j=0;j<6;j++)$[j]=Number(k>>BigInt(40-8*j)&BigInt(255));return r[y]+"_"+$.toString("hex")+f(n-12)}v.create=x;function T(y){let h=y.split("_")[0];if(!h)return 0;let b=y.slice(h.length+1,h.length+13),A=BigInt("0x"+b);return Number(A/BigInt(4096))}v.timestamp=T;})(exports.Identifier||(exports.Identifier={}));exports.TruncateContent=void 0;(x=>{x.DEFAULT_MAX_CHARS=4e3,x.DIRECTION="head",x.DIR=chunkGVXRTRAT_cjs.d.join(process.env.EASBOT_DATA_PATH??`${process.cwd()}/data`,"context-output"),x.GLOB=chunkGVXRTRAT_cjs.d.join(x.DIR,"*");let a=10080*60*1e3;function c(T,v,y){return y?`[Content truncated. Source: ${y}
1
+ 'use strict';var chunkRDSCQNRW_cjs=require('./chunks/chunk-RDSCQNRW.cjs'),chunk2KQO2CPV_cjs=require('./chunks/chunk-2KQO2CPV.cjs'),chunkQNBTABHK_cjs=require('./chunks/chunk-QNBTABHK.cjs'),chunkAV7EICQL_cjs=require('./chunks/chunk-AV7EICQL.cjs'),chunkE2GY67T5_cjs=require('./chunks/chunk-E2GY67T5.cjs'),fe=require('fs/promises'),G=require('zod'),crypto$1=require('crypto'),dotenv=require('dotenv'),ve=require('path'),xdgBasedir=require('xdg-basedir'),_t=require('os'),fs=require('fs'),url=require('url'),he=require('gray-matter'),undici=require('undici'),async_hooks=require('async_hooks');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var fe__default=/*#__PURE__*/_interopDefault(fe);var G__default=/*#__PURE__*/_interopDefault(G);var ve__default=/*#__PURE__*/_interopDefault(ve);var _t__default=/*#__PURE__*/_interopDefault(_t);var he__default=/*#__PURE__*/_interopDefault(he);chunkE2GY67T5_cjs.e();chunkE2GY67T5_cjs.e();function Pt(r,t){for(let n=r.length-1;n>=0;n-=1){let o=r[n];if(o!==void 0&&t(o,n,r))return o}}chunkE2GY67T5_cjs.e();exports.Binary=void 0;(n=>{function r(o,a,c){let m=0,i=o.length-1;for(;m<=i;){let f=Math.floor((m+i)/2),x=o[f];if(x===void 0)break;let T=c(x);if(T===a)return {found:true,index:f};T<a?m=f+1:i=f-1;}return {found:false,index:m}}n.search=r;function t(o,a,c){let m=c(a),i=0,f=o.length;for(;i<f;){let x=Math.floor((i+f)/2),T=o[x];if(T===void 0)break;c(T)<m?i=x+1:f=x;}return o.splice(i,0,a),o}n.insert=t;})(exports.Binary||(exports.Binary={}));chunkE2GY67T5_cjs.e();exports.Encode=void 0;(c=>{function r(m){let i=new TextEncoder().encode(m),f=Array.from(i,x=>String.fromCharCode(x)).join("");return btoa(f).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}c.base64Encode=r;function t(m){let i=atob(m.replace(/-/g,"+").replace(/_/g,"/")),f=Uint8Array.from(i,x=>x.charCodeAt(0));return new TextDecoder().decode(f)}c.base64Decode=t;async function n(m,i="SHA-256"){let x=new TextEncoder().encode(m),T=await crypto.subtle.digest(i,x);return Array.from(new Uint8Array(T)).map(h=>h.toString(16).padStart(2,"0")).join("")}c.hash=n;function o(m){if(!m)return;let i=2166136261;for(let f=0;f<m.length;f++)i^=m.charCodeAt(f),i=Math.imul(i,16777619);return (i>>>0).toString(36)}c.checksum=o;function a(m,i=5e5){if(!m)return;if(m.length<=i)return o(m);let f=4096,T=[0,Math.floor(m.length*.25),Math.floor(m.length*.5),Math.floor(m.length*.75),m.length-f].map(v=>{let y=Math.max(0,Math.min(m.length-f,v-Math.floor(f/2)));return o(m.slice(y,y+f))??""}).join(":");return `${m.length}:${T}`}c.sampledChecksum=a;})(exports.Encode||(exports.Encode={}));chunkE2GY67T5_cjs.e();chunkE2GY67T5_cjs.e();exports.Identifier=void 0;(v=>{let r={event:"evt",session:"ses",message:"msg",permission:"per",question:"que",user:"usr",part:"prt",pty:"pty",tool:"tool",workspace:"wrk",command:"cmd",task:"task",heartbeat:"hb",agent:"ag",subagent:"sub",hook:"hok",compaction:"cmp",context:"ctx",experience:"exp",pattern:"pat",knowledge:"knw",evolution:"evo",result:"res"};function t(y){return G__default.default.string().startsWith(r[y])}v.schema=t;let n=26,o=0,a=0;function c(y,h){return i(y,false,h)}v.ascending=c;function m(y,h){return i(y,true,h)}v.descending=m;function i(y,h,b){if(!b)return x(y,h);if(!b.startsWith(r[y]))throw new Error(`ID ${b} does not start with ${r[y]}`);return b}function f(y){let h="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",b="",A=crypto$1.randomBytes(y);for(let k=0;k<y;k++){let $=A[k];$!==void 0&&(b+=h[$%62]);}return b}function x(y,h,b){let A=b??Date.now();A!==o&&(o=A,a=0),a++;let k=BigInt(A)*BigInt(4096)+BigInt(a);k=h?~k:k;let $=Buffer.alloc(6);for(let j=0;j<6;j++)$[j]=Number(k>>BigInt(40-8*j)&BigInt(255));return r[y]+"_"+$.toString("hex")+f(n-12)}v.create=x;function T(y){let h=y.split("_")[0];if(!h)return 0;let b=y.slice(h.length+1,h.length+13),A=BigInt("0x"+b);return Number(A/BigInt(4096))}v.timestamp=T;})(exports.Identifier||(exports.Identifier={}));exports.TruncateContent=void 0;(x=>{x.DEFAULT_MAX_CHARS=4e3,x.DIRECTION="head",x.DIR=chunkQNBTABHK_cjs.d.join(process.env.EASBOT_DATA_PATH??`${process.cwd()}/data`,"context-output"),x.GLOB=chunkQNBTABHK_cjs.d.join(x.DIR,"*");let a=10080*60*1e3;function c(T,v,y){return y?`[Content truncated. Source: ${y}
2
2
  Full ${v} saved to: ${T}
3
3
  Use Read tool with offset/limit parameters to view specific sections.]`:`[Content truncated. Full ${v} saved to: ${T}
4
- Use Read tool with offset/limit parameters to view specific sections.]`}async function m(T,v={}){let y=v.maxChars??4e3,h=v.direction??x.DIRECTION,b=v.label??"content",A=v.sourcePath,k=chunkGVXRTRAT_cjs.d.join(process.env.EASBOT_DATA_PATH??`${process.cwd()}/data`,"context-output"),$=v.dir??k;if(T.length<=y)return {content:T,truncated:false};let j=exports.Identifier.ascending("context"),B=chunkGVXRTRAT_cjs.d.join($,j);await fe__default.default.mkdir($,{recursive:true}).catch(()=>{}),await fe__default.default.writeFile(B,T,"utf-8");let W=T.length-y,z;h==="head"?z=T.slice(0,y):z=T.slice(-y);let q=c(B,b,A),e=`${W} characters truncated`;return {content:h==="head"?`${z}
4
+ Use Read tool with offset/limit parameters to view specific sections.]`}async function m(T,v={}){let y=v.maxChars??4e3,h=v.direction??x.DIRECTION,b=v.label??"content",A=v.sourcePath,k=chunkQNBTABHK_cjs.d.join(process.env.EASBOT_DATA_PATH??`${process.cwd()}/data`,"context-output"),$=v.dir??k;if(T.length<=y)return {content:T,truncated:false};let j=exports.Identifier.ascending("context"),B=chunkQNBTABHK_cjs.d.join($,j);await fe__default.default.mkdir($,{recursive:true}).catch(()=>{}),await fe__default.default.writeFile(B,T,"utf-8");let W=T.length-y,z;h==="head"?z=T.slice(0,y):z=T.slice(-y);let q=c(B,b,A),e=`${W} characters truncated`;return {content:h==="head"?`${z}
5
5
 
6
6
  ...${e}...
7
7
 
@@ -9,14 +9,14 @@ ${q}`:`...${e}...
9
9
 
10
10
  ${q}
11
11
 
12
- ${z}`,truncated:true,outputPath:B,originalLength:T.length,removedLength:W,label:b}}x.truncate=m;function i(T){return T.truncated?c(T.outputPath,T.label):""}x.formatHint=i;async function f(){let T=exports.Identifier.timestamp(exports.Identifier.create("context",false,Date.now()-a)),y=(await fe__default.default.readdir(x.DIR).catch(()=>[])).filter(h=>h.startsWith("context_"));for(let h of y)exports.Identifier.timestamp(h)>=T||await fe__default.default.unlink(chunkGVXRTRAT_cjs.d.join(x.DIR,h)).catch(()=>{});}x.cleanup=f;})(exports.TruncateContent||(exports.TruncateContent={}));chunkK7PV4FXJ_cjs.e();exports.SessionTitle=void 0;(i=>{let r="New session - ",t="Child session - ";i.parentTitlePrefix=r,i.childTitlePrefix=t;function a(f=false){return (f?t:r)+chunk5XHOPT4Y_cjs.b(new Date)}i.createDefault=a;function c(f){return new RegExp(`^(${r}|${t})\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}[+-]\\d{2}:\\d{2}$`).test(f)}i.isDefault=c;function m(f){let x=f.match(/^(.+) \(fork #(\d+)\)$/);if(x){let T=x[1]??"",v=parseInt(x[2]??"0",10);return `${T} (fork #${v+1})`}return `${f} (fork #1)`}i.getForked=m;})(exports.SessionTitle||(exports.SessionTitle={}));chunkK7PV4FXJ_cjs.e();var ce=class ce extends Error{static create(t,n){var c;let o=G__default.default.object({name:G__default.default.literal(t),data:n}).meta({ref:t}),a=(c=class extends ce{constructor(i,f){super(t,f);chunkK7PV4FXJ_cjs.c(this,"data",i);chunkK7PV4FXJ_cjs.c(this,"name",t);this.name=t;}static isInstance(i){return i!==null&&typeof i=="object"&&"name"in i&&i.name===t}schema(){return o}toObject(){return {name:t,data:this.data}}},chunkK7PV4FXJ_cjs.c(c,"Schema",o),c);return Object.defineProperty(a,"name",{value:t}),a}};chunkK7PV4FXJ_cjs.c(ce,"Unknown",ce.create("UnknownError",G__default.default.object({message:G__default.default.string()})));var le=ce;chunkK7PV4FXJ_cjs.e();exports.Ignore=void 0;(t=>{function r(n){return new Ee(n)}t.create=r;})(exports.Ignore||(exports.Ignore={}));var Ee=class{constructor(t){chunkK7PV4FXJ_cjs.c(this,"rules",[]);chunkK7PV4FXJ_cjs.c(this,"ignorecase");chunkK7PV4FXJ_cjs.c(this,"debug");this.ignorecase=t?.ignorecase??false,this.debug=t?.debug??false;}add(t){let n=typeof t=="string"?t.split(`
13
- `):t;for(let o=0;o<n.length;o++){let a=n[o];this.parseRule(a,o+1);}return this}parseRule(t,n){let o=t,a=t;if(o.length===0||o.startsWith("#"))return;let c=o.startsWith("!");if(c&&(o=o.slice(1)),o=o.trim(),o.length===0||(o.startsWith("\\#")&&(o=o.slice(1)),o.startsWith("#")))return;let m=o.startsWith("/");m&&(o=o.slice(1));let i=o.endsWith("/");i&&(o=o.slice(0,-1)),o.length!==0&&this.rules.push({pattern:o,negative:c,isDirectory:i,anchored:m,original:a,lineNumber:n});}ignores(t,n){let o=this.normalizePath(t),a=n??t.endsWith("/"),c=this.checkIgnore(o,a);return this.debug&&console.log(`Ignore.ignores("${t}", isDirectory=${a}) => ${c}`),c}checkIgnore(t,n){let o=false;for(let a of this.rules)a.isDirectory&&!n||this.matchPath(a,t)&&(a.negative?o=false:o=true);return o}matchPath(t,n){let o=this.ignorecase?n.toLowerCase():n,c=this.ignorecase?t.pattern.toLowerCase():t.pattern;if(t.anchored)return chunkGVXRTRAT_cjs.a.match(o,c);if(c.includes("/"))return chunkGVXRTRAT_cjs.a.match(o,c);let m=o.split("/");for(let i of m)if(chunkGVXRTRAT_cjs.a.match(i,c))return true;return false}filter(t){return t.filter(n=>!this.ignores(n))}createFilter(){return t=>!this.ignores(t)}normalizePath(t){let n=t.replace(/\\/g,"/");if(n==="/")return "";for(;n.startsWith("./");)n=n.slice(2);return n.endsWith("/")&&n.length>1&&(n=n.slice(0,-1)),n}};chunkK7PV4FXJ_cjs.e();function Ge(r,t){let n=o=>{let a;try{a=r.parse(o);}catch(c){throw console.trace("schema validation failure stack trace:"),c instanceof G.z.ZodError&&console.error("schema validation issues:",JSON.stringify(c.issues,null,2)),c}return t(a)};return n.force=o=>t(o),n.schema=r,n}var vt=Ge;exports.Fn=void 0;(t=>t.fn=Ge)(exports.Fn||(exports.Fn={}));chunkK7PV4FXJ_cjs.e();var kt=chunk5XHOPT4Y_cjs.m.create({service:"env"});function Ot(r={}){let t=r.isDevelopment??false,n=t?".env.dev":".env",o=r.globalConfigPath??(xdgBasedir.xdgConfig?ve__default.default.join(xdgBasedir.xdgConfig,"easbot"):void 0),a=r.projectRoot??process.cwd(),c=a?ve__default.default.join(a,".easbot"):void 0,m=[{root:o,label:"global"},{root:a,label:"project"},{root:c,label:"workspace"}],i=["XDG_CONFIG_HOME","XDG_DATA_HOME","XDG_CACHE_HOME","XDG_STATE_HOME","XDG_RUNTIME_DIR","EASBOT_CONFIG_PATH","EASBOT_DATA_PATH","EASBOT_CACHE_PATH","EASBOT_STATE_PATH","EASBOT_LOG_PATH"];for(let{root:f,label:x}of m){if(!f)continue;let T=ve__default.default.join(f,n),y=dotenv.config({path:T,override:true,debug:false,encoding:"utf-8",quiet:true}).parsed;if(y&&(t&&kt.debug("loadEnv: loaded env file",{layer:x,path:T,keyCount:Object.keys(y).length}),t)){let h=i.filter(b=>b in y);h.length>0&&console.warn(`[loadEnv] ${T} contains keys that have no effect: ${h.join(", ")}.
12
+ ${z}`,truncated:true,outputPath:B,originalLength:T.length,removedLength:W,label:b}}x.truncate=m;function i(T){return T.truncated?c(T.outputPath,T.label):""}x.formatHint=i;async function f(){let T=exports.Identifier.timestamp(exports.Identifier.create("context",false,Date.now()-a)),y=(await fe__default.default.readdir(x.DIR).catch(()=>[])).filter(h=>h.startsWith("context_"));for(let h of y)exports.Identifier.timestamp(h)>=T||await fe__default.default.unlink(chunkQNBTABHK_cjs.d.join(x.DIR,h)).catch(()=>{});}x.cleanup=f;})(exports.TruncateContent||(exports.TruncateContent={}));chunkE2GY67T5_cjs.e();exports.SessionTitle=void 0;(i=>{let r="New session - ",t="Child session - ";i.parentTitlePrefix=r,i.childTitlePrefix=t;function a(f=false){return (f?t:r)+chunkAV7EICQL_cjs.b(new Date)}i.createDefault=a;function c(f){return new RegExp(`^(${r}|${t})\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}[+-]\\d{2}:\\d{2}$`).test(f)}i.isDefault=c;function m(f){let x=f.match(/^(.+) \(fork #(\d+)\)$/);if(x){let T=x[1]??"",v=parseInt(x[2]??"0",10);return `${T} (fork #${v+1})`}return `${f} (fork #1)`}i.getForked=m;})(exports.SessionTitle||(exports.SessionTitle={}));chunkE2GY67T5_cjs.e();var ce=class ce extends Error{static create(t,n){var c;let o=G__default.default.object({name:G__default.default.literal(t),data:n}).meta({ref:t}),a=(c=class extends ce{constructor(i,f){super(t,f);chunkE2GY67T5_cjs.c(this,"data",i);chunkE2GY67T5_cjs.c(this,"name",t);this.name=t;}static isInstance(i){return i!==null&&typeof i=="object"&&"name"in i&&i.name===t}schema(){return o}toObject(){return {name:t,data:this.data}}},chunkE2GY67T5_cjs.c(c,"Schema",o),c);return Object.defineProperty(a,"name",{value:t}),a}};chunkE2GY67T5_cjs.c(ce,"Unknown",ce.create("UnknownError",G__default.default.object({message:G__default.default.string()})));var le=ce;chunkE2GY67T5_cjs.e();exports.Ignore=void 0;(t=>{function r(n){return new Ee(n)}t.create=r;})(exports.Ignore||(exports.Ignore={}));var Ee=class{constructor(t){chunkE2GY67T5_cjs.c(this,"rules",[]);chunkE2GY67T5_cjs.c(this,"ignorecase");chunkE2GY67T5_cjs.c(this,"debug");this.ignorecase=t?.ignorecase??false,this.debug=t?.debug??false;}add(t){let n=typeof t=="string"?t.split(`
13
+ `):t;for(let o=0;o<n.length;o++){let a=n[o];this.parseRule(a,o+1);}return this}parseRule(t,n){let o=t,a=t;if(o.length===0||o.startsWith("#"))return;let c=o.startsWith("!");if(c&&(o=o.slice(1)),o=o.trim(),o.length===0||(o.startsWith("\\#")&&(o=o.slice(1)),o.startsWith("#")))return;let m=o.startsWith("/");m&&(o=o.slice(1));let i=o.endsWith("/");i&&(o=o.slice(0,-1)),o.length!==0&&this.rules.push({pattern:o,negative:c,isDirectory:i,anchored:m,original:a,lineNumber:n});}ignores(t,n){let o=this.normalizePath(t),a=n??t.endsWith("/"),c=this.checkIgnore(o,a);return this.debug&&console.log(`Ignore.ignores("${t}", isDirectory=${a}) => ${c}`),c}checkIgnore(t,n){let o=false;for(let a of this.rules)a.isDirectory&&!n||this.matchPath(a,t)&&(a.negative?o=false:o=true);return o}matchPath(t,n){let o=this.ignorecase?n.toLowerCase():n,c=this.ignorecase?t.pattern.toLowerCase():t.pattern;if(t.anchored)return chunkQNBTABHK_cjs.a.match(o,c);if(c.includes("/"))return chunkQNBTABHK_cjs.a.match(o,c);let m=o.split("/");for(let i of m)if(chunkQNBTABHK_cjs.a.match(i,c))return true;return false}filter(t){return t.filter(n=>!this.ignores(n))}createFilter(){return t=>!this.ignores(t)}normalizePath(t){let n=t.replace(/\\/g,"/");if(n==="/")return "";for(;n.startsWith("./");)n=n.slice(2);return n.endsWith("/")&&n.length>1&&(n=n.slice(0,-1)),n}};chunkE2GY67T5_cjs.e();function Ge(r,t){let n=o=>{let a;try{a=r.parse(o);}catch(c){throw console.trace("schema validation failure stack trace:"),c instanceof G.z.ZodError&&console.error("schema validation issues:",JSON.stringify(c.issues,null,2)),c}return t(a)};return n.force=o=>t(o),n.schema=r,n}var vt=Ge;exports.Fn=void 0;(t=>t.fn=Ge)(exports.Fn||(exports.Fn={}));chunkE2GY67T5_cjs.e();var kt=chunkAV7EICQL_cjs.m.create({service:"env"});function Ot(r={}){let t=r.isDevelopment??false,n=t?".env.dev":".env",o=r.globalConfigPath??(xdgBasedir.xdgConfig?ve__default.default.join(xdgBasedir.xdgConfig,"easbot"):void 0),a=r.projectRoot??process.cwd(),c=a?ve__default.default.join(a,".easbot"):void 0,m=[{root:o,label:"global"},{root:a,label:"project"},{root:c,label:"workspace"}],i=["XDG_CONFIG_HOME","XDG_DATA_HOME","XDG_CACHE_HOME","XDG_STATE_HOME","XDG_RUNTIME_DIR","EASBOT_CONFIG_PATH","EASBOT_DATA_PATH","EASBOT_CACHE_PATH","EASBOT_STATE_PATH","EASBOT_LOG_PATH"];for(let{root:f,label:x}of m){if(!f)continue;let T=ve__default.default.join(f,n),y=dotenv.config({path:T,override:true,debug:false,encoding:"utf-8",quiet:true}).parsed;if(y&&(t&&kt.debug("loadEnv: loaded env file",{layer:x,path:T,keyCount:Object.keys(y).length}),t)){let h=i.filter(b=>b in y);h.length>0&&console.warn(`[loadEnv] ${T} contains keys that have no effect: ${h.join(", ")}.
14
14
  Reason: xdg-basedir caches XDG_* on import, so this .env file loads too late.
15
- How to override: export them in the shell before loadEnv() runs, or set process.env directly.`);}}}exports.Env=void 0;(m=>{let r=chunkKKCFNFFR_cjs.a(()=>({...process.env}));function t(){r.reset();}m.reset=t;async function n(i){return r()[i]}m.get=n;async function o(){return r()}m.all=o;async function a(i,f){r()[i]=f;}m.set=a;async function c(i){delete r()[i];}m.remove=c;})(exports.Env||(exports.Env={}));chunkK7PV4FXJ_cjs.e();var Ft="easbot-oauth-dummy-key",Lt=chunk5XHOPT4Y_cjs.m.create({service:"auth"});exports.Auth=void 0;(b=>{b.Oauth=G__default.default.object({type:G__default.default.literal("oauth"),refresh:G__default.default.string(),access:G__default.default.string(),expires:G__default.default.number(),accountId:G__default.default.string().optional(),enterpriseUrl:G__default.default.string().optional()}).meta({ref:"OAuth"}),b.Api=G__default.default.object({type:G__default.default.literal("api"),key:G__default.default.string()}).meta({ref:"ApiAuth"}),b.WellKnown=G__default.default.object({type:G__default.default.literal("wellknown"),key:G__default.default.string(),token:G__default.default.string()}).meta({ref:"WellKnownAuth"}),b.Info=G__default.default.discriminatedUnion("type",[b.Oauth,b.Api,b.WellKnown]).meta({ref:"Auth"});function a(){let A=process.env.EASBOT_DATA_PATH??(xdgBasedir.xdgData?ve__default.default.join(xdgBasedir.xdgData,"easbot"):_t__default.default.tmpdir());return ve__default.default.join(A,"auth.json")}let c=chunkKKCFNFFR_cjs.b(async()=>{let k=await chunkKKCFNFFR_cjs.D.file(a()).json().catch(()=>({})),$={};for(let[j,B]of Object.entries(k)){let W=b.Info.safeParse(B);if(W.success){$[j]=W.data;continue}Lt.warn("auth.json entry skipped: schema validation failed",{providerId:j,issues:W.error.issues.map(z=>({path:z.path,message:z.message}))});}return $}),m=Promise.resolve(),i=A=>{let k=m.then(A,A);return m=k.catch(()=>{}),k};async function f(A,k){let $=ve__default.default.dirname(A);fs.existsSync($)||fs.mkdirSync($,{recursive:true});let j=`${A}.${process.pid}.${Date.now()}.tmp`;await fe.writeFile(j,JSON.stringify(k,null,2),{mode:384});try{await fe.rename(j,A);}catch(B){try{let{unlink:W}=await import('fs/promises');await W(j);}catch{}throw await chunkKKCFNFFR_cjs.D.write(A,JSON.stringify(k,null,2)),B}}function x(){c.reset();}b.reset=x;async function T(A){return (await c())[A]}b.get=T;async function v(){return c()}b.all=v;async function y(A,k){await i(async()=>{let $=a(),j=await chunkKKCFNFFR_cjs.D.file($).json().catch(()=>({})),B={};for(let[W,z]of Object.entries(j)){let q=b.Info.safeParse(z);q.success&&(B[W]=q.data);}B[A]=k,await f($,B),c.reset();});}b.set=y;async function h(A){await i(async()=>{let k=a(),$=await chunkKKCFNFFR_cjs.D.file(k).json().catch(()=>({}));if(!(A in $)){c.reset();return}let j={};for(let[B,W]of Object.entries($)){if(B===A)continue;let z=b.Info.safeParse(W);z.success&&(j[B]=z.data);}await f(k,j),c.reset();});}b.remove=h;})(exports.Auth||(exports.Auth={}));chunkK7PV4FXJ_cjs.e();async function Mt(r,t){if(process.env.EASBOT_CLIENT==="acp")try{let c=process.platform==="win32"?"cmd":void 0,m=chunkKKCFNFFR_cjs.G.spawn(c,`git ${r.join(" ")}`,{stdin:void 0,stdout:"pipe",stderr:"pipe",cwd:t.cwd,env:t.env?{...process.env,...t.env}:process.env}),[i,f,x]=await Promise.all([m.exited,new Response(m.stdout).arrayBuffer(),new Response(m.stderr).arrayBuffer()]),T=Buffer.from(f),v=Buffer.from(x);return {exitCode:i,text:()=>T.toString(),stdout:T,stderr:v}}catch(c){let m=Buffer.from(c instanceof Error?c.message:String(c));return {exitCode:1,text:()=>"",stdout:Buffer.alloc(0),stderr:m}}let n=t.env?{...process.env,...t.env}:void 0,o=chunkKKCFNFFR_cjs.G.$`git ${r.join(" ")}`.quiet().nothrow().cwd(t.cwd);n&&(o=o.env(n));let a=await o;return {exitCode:a.exitCode,text:()=>a.text(),stdout:a.stdout,stderr:a.stderr}}chunkK7PV4FXJ_cjs.e();function Ye(r){return r?ve.dirname(url.fileURLToPath(r)):typeof __dirname<"u"?__dirname:process.cwd()}function Xe(r,t,n=3){function o(a,c){if(c>n||!fs.existsSync(a))return null;try{let m=fs.readdirSync(a);for(let i of m){let f=ve.join(a,i);try{let x=fs.statSync(f);if(x.isFile()&&f.endsWith(t))return f;if(x.isDirectory()&&c<n){let T=o(f,c+1);if(T)return T}}catch{}}}catch{}return null}return o(r,0)}function Je(r,t){let n=ve.join(r,t);if(fs.existsSync(n))return n;let o=t.split("/").pop()||t,a=r;for(let c=0;c<5;c++){let m=ve.join(a,"assets","txt");if(fs.existsSync(m)){let x=Xe(m,o,5);if(x)return x}let i=ve.join(a,"dist","assets","txt");if(fs.existsSync(i)){let x=Xe(i,o,5);if(x)return x}let f=ve.join(a,"..");if(f===a)break;a=f;}return n}function Ht(r,t){return chunkKKCFNFFR_cjs.c.lazy(()=>{try{let n=Ye(t),o=Je(n,r);return chunkKKCFNFFR_cjs.D.file(o).textSync()}catch(n){throw console.error(`Failed to load text file: ${r}`,n),n}})}function Bt(r,t){return chunkKKCFNFFR_cjs.c.lazy(async()=>{try{let n=Ye(t),o=Je(n,r);return await chunkKKCFNFFR_cjs.D.file(o).text()}catch(n){throw console.error(`Failed to load text file: ${r}`,n),n}})}chunkK7PV4FXJ_cjs.e();function Gt(r){return r()}chunkK7PV4FXJ_cjs.e();function Wt(r){if(!r||typeof r!="string")return {provider:"",model:""};let t=r.indexOf("/");return t===-1?{provider:"",model:r}:{provider:r.substring(0,t),model:r.substring(t+1)}}chunkK7PV4FXJ_cjs.e();exports.Markdown=void 0;(q=>{q.FILE_REGEX=/(?<![\w`])#(\S+)/g,q.SHELL_REGEX=/!`([^`]+)`/g;function n(e){return Array.from(e.matchAll(q.FILE_REGEX))}q.files=n;function o(e){return Array.from(e.matchAll(q.SHELL_REGEX))}q.shell=o;function a(e){if(!e||typeof e!="string")return typeof e=="string"?e:"";let s=e.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!s)return e;let d=s[0],w=(s[1]??"").split(`
15
+ How to override: export them in the shell before loadEnv() runs, or set process.env directly.`);}}}exports.Env=void 0;(m=>{let r=chunk2KQO2CPV_cjs.a(()=>({...process.env}));function t(){r.reset();}m.reset=t;async function n(i){return r()[i]}m.get=n;async function o(){return r()}m.all=o;async function a(i,f){r()[i]=f;}m.set=a;async function c(i){delete r()[i];}m.remove=c;})(exports.Env||(exports.Env={}));chunkE2GY67T5_cjs.e();var Ft="easbot-oauth-dummy-key",Lt=chunkAV7EICQL_cjs.m.create({service:"auth"});exports.Auth=void 0;(b=>{b.Oauth=G__default.default.object({type:G__default.default.literal("oauth"),refresh:G__default.default.string(),access:G__default.default.string(),expires:G__default.default.number(),accountId:G__default.default.string().optional(),enterpriseUrl:G__default.default.string().optional()}).meta({ref:"OAuth"}),b.Api=G__default.default.object({type:G__default.default.literal("api"),key:G__default.default.string()}).meta({ref:"ApiAuth"}),b.WellKnown=G__default.default.object({type:G__default.default.literal("wellknown"),key:G__default.default.string(),token:G__default.default.string()}).meta({ref:"WellKnownAuth"}),b.Info=G__default.default.discriminatedUnion("type",[b.Oauth,b.Api,b.WellKnown]).meta({ref:"Auth"});function a(){let A=process.env.EASBOT_DATA_PATH??(xdgBasedir.xdgData?ve__default.default.join(xdgBasedir.xdgData,"easbot"):_t__default.default.tmpdir());return ve__default.default.join(A,"auth.json")}let c=chunk2KQO2CPV_cjs.b(async()=>{let k=await chunk2KQO2CPV_cjs.D.file(a()).json().catch(()=>({})),$={};for(let[j,B]of Object.entries(k)){let W=b.Info.safeParse(B);if(W.success){$[j]=W.data;continue}Lt.warn("auth.json entry skipped: schema validation failed",{providerId:j,issues:W.error.issues.map(z=>({path:z.path,message:z.message}))});}return $}),m=Promise.resolve(),i=A=>{let k=m.then(A,A);return m=k.catch(()=>{}),k};async function f(A,k){let $=ve__default.default.dirname(A);fs.existsSync($)||fs.mkdirSync($,{recursive:true});let j=`${A}.${process.pid}.${Date.now()}.tmp`;await fe.writeFile(j,JSON.stringify(k,null,2),{mode:384});try{await fe.rename(j,A);}catch(B){try{let{unlink:W}=await import('fs/promises');await W(j);}catch{}throw await chunk2KQO2CPV_cjs.D.write(A,JSON.stringify(k,null,2)),B}}function x(){c.reset();}b.reset=x;async function T(A){return (await c())[A]}b.get=T;async function v(){return c()}b.all=v;async function y(A,k){await i(async()=>{let $=a(),j=await chunk2KQO2CPV_cjs.D.file($).json().catch(()=>({})),B={};for(let[W,z]of Object.entries(j)){let q=b.Info.safeParse(z);q.success&&(B[W]=q.data);}B[A]=k,await f($,B),c.reset();});}b.set=y;async function h(A){await i(async()=>{let k=a(),$=await chunk2KQO2CPV_cjs.D.file(k).json().catch(()=>({}));if(!(A in $)){c.reset();return}let j={};for(let[B,W]of Object.entries($)){if(B===A)continue;let z=b.Info.safeParse(W);z.success&&(j[B]=z.data);}await f(k,j),c.reset();});}b.remove=h;})(exports.Auth||(exports.Auth={}));chunkE2GY67T5_cjs.e();async function Mt(r,t){if(process.env.EASBOT_CLIENT==="acp")try{let c=process.platform==="win32"?"cmd":void 0,m=chunk2KQO2CPV_cjs.G.spawn(c,`git ${r.join(" ")}`,{stdin:void 0,stdout:"pipe",stderr:"pipe",cwd:t.cwd,env:t.env?{...process.env,...t.env}:process.env}),[i,f,x]=await Promise.all([m.exited,new Response(m.stdout).arrayBuffer(),new Response(m.stderr).arrayBuffer()]),T=Buffer.from(f),v=Buffer.from(x);return {exitCode:i,text:()=>T.toString(),stdout:T,stderr:v}}catch(c){let m=Buffer.from(c instanceof Error?c.message:String(c));return {exitCode:1,text:()=>"",stdout:Buffer.alloc(0),stderr:m}}let n=t.env?{...process.env,...t.env}:void 0,o=chunk2KQO2CPV_cjs.G.$`git ${r.join(" ")}`.quiet().nothrow().cwd(t.cwd);n&&(o=o.env(n));let a=await o;return {exitCode:a.exitCode,text:()=>a.text(),stdout:a.stdout,stderr:a.stderr}}chunkE2GY67T5_cjs.e();function Ye(r){return r?ve.dirname(url.fileURLToPath(r)):typeof __dirname<"u"?__dirname:process.cwd()}function Xe(r,t,n=3){function o(a,c){if(c>n||!fs.existsSync(a))return null;try{let m=fs.readdirSync(a);for(let i of m){let f=ve.join(a,i);try{let x=fs.statSync(f);if(x.isFile()&&f.endsWith(t))return f;if(x.isDirectory()&&c<n){let T=o(f,c+1);if(T)return T}}catch{}}}catch{}return null}return o(r,0)}function Je(r,t){let n=ve.join(r,t);if(fs.existsSync(n))return n;let o=t.split("/").pop()||t,a=r;for(let c=0;c<5;c++){let m=ve.join(a,"assets","txt");if(fs.existsSync(m)){let x=Xe(m,o,5);if(x)return x}let i=ve.join(a,"dist","assets","txt");if(fs.existsSync(i)){let x=Xe(i,o,5);if(x)return x}let f=ve.join(a,"..");if(f===a)break;a=f;}return n}function Ht(r,t){return chunk2KQO2CPV_cjs.c.lazy(()=>{try{let n=Ye(t),o=Je(n,r);return chunk2KQO2CPV_cjs.D.file(o).textSync()}catch(n){throw console.error(`Failed to load text file: ${r}`,n),n}})}function Bt(r,t){return chunk2KQO2CPV_cjs.c.lazy(async()=>{try{let n=Ye(t),o=Je(n,r);return await chunk2KQO2CPV_cjs.D.file(o).text()}catch(n){throw console.error(`Failed to load text file: ${r}`,n),n}})}chunkE2GY67T5_cjs.e();function Gt(r){return r()}chunkE2GY67T5_cjs.e();function Wt(r){if(!r||typeof r!="string")return {provider:"",model:""};let t=r.indexOf("/");return t===-1?{provider:"",model:r}:{provider:r.substring(0,t),model:r.substring(t+1)}}chunkE2GY67T5_cjs.e();exports.Markdown=void 0;(q=>{q.FILE_REGEX=/(?<![\w`])#(\S+)/g,q.SHELL_REGEX=/!`([^`]+)`/g;function n(e){return Array.from(e.matchAll(q.FILE_REGEX))}q.files=n;function o(e){return Array.from(e.matchAll(q.SHELL_REGEX))}q.shell=o;function a(e){if(!e||typeof e!="string")return typeof e=="string"?e:"";let s=e.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!s)return e;let d=s[0],w=(s[1]??"").split(`
16
16
  `),u=[];for(let p of w){if(p.trim().startsWith("#")||p.trim()===""){u.push(p);continue}if(p.match(/^\s+/)){u.push(p);continue}let S=p.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\s*:\s*(.*)$/);if(!S){u.push(p);continue}let E=S[1],D=S?.[2]?.trim();if(D===""||D===">"||D==="|"||D?.startsWith('"')||D?.startsWith("'")){u.push(p);continue}if(D?.includes(":")){u.push(`${E}: |-`),u.push(` ${D}`);continue}u.push(p);}let l=u.join(`
17
17
  `);return e.replace(d,`---
18
18
  ${l}
19
- ---`)}q.fallbackSanitization=a;function c(e){if(typeof e!="string")return null;if(!e)return {data:{},content:""};try{let s=he__default.default(e);return {data:s.data??{},content:s.content??""}}catch{try{let s=he__default.default(a(e));return {data:s.data??{},content:s.content??""}}catch{return null}}}async function m(e){let s=await fe.readFile(e,"utf-8"),d=c(s);if(!d){let P=`${e}: Failed to parse YAML frontmatter`;throw new q.FrontmatterError({path:e,message:P},{cause:new Error(P)})}return d}q.parse=m;function i(e){if(!e||typeof e!="string")return {frontmatter:{},content:typeof e=="string"?e:""};let s=c(e);return s?{frontmatter:s.data,content:s.content}:{frontmatter:{},content:e}}q.extractFrontmatter=i;function f(e,s){let d=e??"";return !s||Object.keys(s).length===0?he__default.default.stringify(d,void 0):he__default.default.stringify(d,s)}q.format=f,q.FrontmatterError=le.create("ConfigFrontmatterError",G.z.object({path:G.z.string(),message:G.z.string()}));function T(e,s){return v(e,s)}q.replaceVariables=T;function v(e,s){return y(e,s)}q.renderTemplate=v;function y(e,s){let d=e;return d=h(d,s),d=k(d,s),d=B(d,s),d=j(d,s),d=d.replace(/\{\{([^}]*)\}\}/g,(P,w)=>{let u=w.trim();if(!u)return "";let l=xe(u,s);return l!==void 0?String(z(l)):""}),d}function h(e,s){let d=e.replace(/\{\{#if\s+\((eq|ne|gt|lt|gte|lte)\s+([^)]+)\)\}\}([\s\S]*?)\{\{(?:else)\}\}([\s\S]*?)\{\{\/if\}\}/g,(P,w,u,l,p)=>{if(!w||!u||!l||!p)return P;let{a:S,b:E}=b(u,s);return S===void 0||E===void 0?P:A(w,S,E)?l:p});return d=d.replace(/\{\{#if\s+\((eq|ne|gt|lt|gte|lte)\s+([^)]+)\)\}\}([\s\S]*?)\{\{\/if\}\}/g,(P,w,u,l)=>{if(!w||!u||!l)return P;let{a:p,b:S}=b(u,s);return p===void 0||S===void 0?P:A(w,p,S)?l:""}),d}function b(e,s){let d=/"([^"]*)"|(\w+(?:\.\w+|\[\d+\])*)/g,P=[],w;for(;(w=d.exec(e))!==null;)w[1]!==void 0?P.push(w[1]):w[2]!==void 0&&P.push(w[2]);if(P.length<2)return {a:void 0,b:void 0};let u=xe(P[0],s),l=xe(P[1],s);return {a:u,b:l}}function A(e,s,d){switch(e){case "eq":return s===d;case "ne":return s!==d;case "gt":return Number(s)>Number(d);case "lt":return Number(s)<Number(d);case "gte":return Number(s)>=Number(d);case "lte":return Number(s)<=Number(d);default:return false}}function k(e,s){let d=e.replace(/\{\{#unless\s+(\w+)\}\}([\s\S]*?)\{\{(?:else)\}\}([\s\S]*?)\{\{\/unless\}\}/g,(P,w,u,l)=>{if(!w||!u||!l)return P;let p=s[w];return $(p)?u:l});return d=d.replace(/\{\{#unless\s+(\w+)\}\}([\s\S]*?)\{\{\/unless\}\}/g,(P,w,u)=>{if(!w||!u)return P;let l=s[w];return $(l)?u:""}),d}function $(e){return e==null||e===false||e===""}function j(e,s){let d=e.replace(/\{\{#if\s+(\w+)\}\}([\s\S]*?)\{\{(?:else)\}\}([\s\S]*?)\{\{\/if\}\}/g,(P,w,u,l)=>{if(!w||!u||!l)return P;let p=w in s?s[w]:void 0;return $(p)?l:u});return d=d.replace(/\{\{#if\s+(\w+)\}\}([\s\S]*?)\{\{\/if\}\}/g,(P,w,u)=>{if(!w||!u)return P;let l=w in s?s[w]:void 0;return $(l)?"":u}),d}function B(e,s){let d=e.match(/\{\{#each\s+([\w.]+)\}\}/);if(!d?.[1])return e;let P=d[1],w=xe(P,s),u=d[0],l=d.index,p=e.slice(l+u.length),S;if(Array.isArray(w))S=w.map((O,R)=>({key:String(R),value:O}));else if(w!==null&&typeof w=="object")S=Object.entries(w).map(([O,R])=>({key:O,value:R}));else return W(e,l,u,p);let E=1,D=-1,_=/\{\{#each\s+[\w.]+\}\}|\{\{\/each\}\}/g,M;for(_.lastIndex=0;(M=_.exec(p))!==null;)if(M[0].startsWith("{{#each"))E++;else if(E--,E===0){D=M.index;break}if(D===-1)return e;let U=p.slice(0,D),C=e.slice(l,l+u.length+D+"{{/each}}".length);if(S.length===0)return e.replace(C,"");let H=S.map(({key:O,value:R},L)=>{let F={...s};return typeof R=="object"&&R!==null?(Object.assign(F,R),F.this=R,F["@value"]=R,F["@index"]=L,F["@key"]=O):(F.this=R,F["@value"]=R,F["@index"]=L,F["@key"]=O),y(U,F)});return e.replace(C,H.join(""))}function W(e,s,d,P,w){let u=/\{\{#each\s+[\w.]+\}\}|\{\{\/each\}\}/g,l=1,p=-1,S;for(u.lastIndex=0;(S=u.exec(P))!==null;)if(S[0].startsWith("{{#each"))l++;else if(l--,l===0){p=S.index;break}if(p===-1)return e;let D=e.slice(s,s+d.length+p+"{{/each}}".length);return e.replace(D,"")}function z(e){return e instanceof Date?chunk5XHOPT4Y_cjs.b(e):Array.isArray(e)?e.map(z).join(", "):e!==null&&typeof e=="object"?JSON.stringify(e,null,2):String(e)}q.formatVariableValue=z;})(exports.Markdown||(exports.Markdown={}));function xe(r,t){let n=/(@\w+)|(\w+)|\[(\d+)\]/g,o=t,a;for(;(a=n.exec(r))!==null;){if(o==null)return;if(a[1]!==void 0){let c=a[1];o=t[c];}else if(a[2]!==void 0){let c=a[2];if(typeof o=="object"&&o!==null)o=o[c];else return}else if(a[3]!==void 0){let c=Number(a[3]);if(Array.isArray(o)&&c>=0&&c<o.length)o=o[c];else return}}return o}chunkK7PV4FXJ_cjs.e();function Ke(r){if(!r)return "";let n=r.replace(/[/\\]+$/,"").split(/[/\\]/);return n[n.length-1]??""}function Xt(r){if(!r)return "";let n=r.replace(/[/\\]+$/,"").split(/[/\\]/);return n.slice(0,n.length-1).join("/")+"/"}function Yt(r){if(!r)return "";let t=r.split(".");return t[t.length-1]}function Jt(r,t=20){let n=Ke(r);if(n.length<=t)return n;let o=n.lastIndexOf("."),a=o<=0?"":n.slice(o),c=t-a.length-1;return c<=0?n.slice(0,t-1)+"\u2026":n.slice(0,c)+"\u2026"+a}function Kt(r,t=20){if(r.length<=t)return r;let n=t-1,o=Math.ceil(n/2),a=Math.floor(n/2);return r.slice(0,o)+"\u2026"+r.slice(-a)}chunkK7PV4FXJ_cjs.e();var Vt=["load failed","network connection was lost","network request failed","failed to fetch","econnreset","econnrefused","etimedout","socket hang up"];function Zt(r){if(!r)return false;let t=String(r instanceof Error?r.message:r).toLowerCase();return Vt.some(n=>t.includes(n))}async function $e(r,t={}){let{attempts:n=3,delay:o=500,factor:a=2,maxDelay:c=1e4,retryIf:m=Zt}=t,i;for(let f=0;f<n;f++)try{return await r()}catch(x){if(i=x,f===n-1||!m(x))throw x;let T=Math.min(o*a**f,c);await new Promise(v=>setTimeout(v,T));}throw i}chunkK7PV4FXJ_cjs.e();exports.Fetch=void 0;(w=>{let r=chunk5XHOPT4Y_cjs.m.create({service:"fetch"}),t=["HTTP_PROXY","HTTPS_PROXY","http_proxy","https_proxy"],n=false,o=null,a,c;function m(){return t.some(u=>{let l=process.env[u];return typeof l=="string"&&l.trim().length>0})}w.hasProxyConfigured=m;function i(){let u=process.env.http_proxy||process.env.HTTP_PROXY;return process.env.https_proxy||process.env.HTTPS_PROXY||u}w.getProxyUrl=i;function f(u={}){let l=u.httpProxy||u.httpsProxy||i();if(!l){r.warn("[Fetch] No proxy configured, HTTP_PROXY/HTTPS_PROXY environment variables not set");return}let p;!u.httpProxy&&!u.httpsProxy?(!process.env.NO_PROXY&&!process.env.no_proxy?(a=void 0,c=void 0,process.env.NO_PROXY="localhost,127.0.0.1,::1",process.env.no_proxy="localhost,127.0.0.1,::1"):(a=process.env.NO_PROXY,c=process.env.no_proxy),p=new undici.EnvHttpProxyAgent({connectTimeout:u.connectTimeout||1e4,keepAliveTimeout:u.keepAliveTimeout||3e4}),r.info(`[Fetch] Global proxy enabled via EnvHttpProxyAgent (honors NO_PROXY=${process.env.NO_PROXY})`)):(p=new undici.ProxyAgent({uri:l,connectTimeout:u.connectTimeout||1e4,keepAliveTimeout:u.keepAliveTimeout||3e4}),r.info(`[Fetch] Global proxy enabled: ${l}`)),o=undici.getGlobalDispatcher(),undici.setGlobalDispatcher(p),n=true;}w.enableProxy=f;function x(){!n||!o||(undici.setGlobalDispatcher(o),n=false,o=null,a===void 0?delete process.env.NO_PROXY:process.env.NO_PROXY=a,c===void 0?delete process.env.no_proxy:process.env.no_proxy=c,a=void 0,c=void 0,r.info("[Fetch] Global proxy disabled"));}w.disableProxy=x;function T(){return n}w.isProxyEnabled=T;async function v(u,l){let p=l?.timeout||3e4,S=l?.responseType||"json",{timeout:E,responseType:D,..._}=l||{},M=null,U=null;try{_.signal||(M=new AbortController,U=setTimeout(()=>M.abort(),p));let N=await fetch(u,{..._,signal:_.signal||M.signal});U&&clearTimeout(U);let C;switch(S){case "arrayBuffer":C=await N.arrayBuffer();break;case "blob":C=await N.blob();break;case "buffer":{let H=await N.arrayBuffer();C=Buffer.from(H);break}case "text":C=await N.text();break;default:{let H=await N.text();try{C=JSON.parse(H);}catch{C=H;}break}}return {ok:N.ok,status:N.status,statusText:N.statusText,headers:N.headers,data:C,url:N.url}}catch(N){throw U&&clearTimeout(U),N}}async function y(u,l){let p=l?.retries??0,S=l?.retryDelay??1e3,{retries:E,retryDelay:D,responseType:_,...M}=l||{};return $e(()=>v(u,{...M,responseType:l?.responseType}),{attempts:p+1,delay:S,maxDelay:S*2**(p+1)})}async function h(u,l){return y(u,{method:"GET",...l})}w.get=h;async function b(u,l,p){return y(u,{method:"POST",headers:{"Content-Type":"application/json",...p?.headers},body:l?JSON.stringify(l):void 0,...p})}w.post=b;async function A(u,l,p){return y(u,{method:"PUT",headers:{"Content-Type":"application/json",...p?.headers},body:l?JSON.stringify(l):void 0,...p})}w.put=A;async function k(u,l,p){return y(u,{method:"DELETE",headers:{"Content-Type":"application/json",...p?.headers},body:l?JSON.stringify(l):void 0,...p})}w.del=k;async function $(u,l,p){return y(u,{method:"PATCH",headers:{"Content-Type":"application/json",...p?.headers},body:l?JSON.stringify(l):void 0,...p})}w.patch=$;async function j(u,l){return y(u,l)}w.request=j;function B(u={}){return m()?(f(u),true):false}w.autoProxy=B;let W=5*1024*1024;function z(u){return new TextEncoder().encode(u)}function q(u){return chunkGVXRTRAT_cjs.d.mimeType(u)}function e(u){return u.startsWith("file://")}async function s(u){let l=url.fileURLToPath(u);return await chunkKKCFNFFR_cjs.D.file(l).bytes()}async function d(u,l,p){let S=`----FetchFormBoundary${Date.now()}`,E=[],_=l.some(R=>R.filename||R.value instanceof Uint8Array||Buffer.isBuffer(R.value))&&!p?.timeout?3e5:p?.timeout;for(let R of l){let L=R.maxSize??W,F=R.filename,ne=`Content-Disposition: form-data; name="${R.name}"${F?`; filename="${F}"`:""}`;F&&(ne+=`\r
19
+ ---`)}q.fallbackSanitization=a;function c(e){if(typeof e!="string")return null;if(!e)return {data:{},content:""};try{let s=he__default.default(e);return {data:s.data??{},content:s.content??""}}catch{try{let s=he__default.default(a(e));return {data:s.data??{},content:s.content??""}}catch{return null}}}async function m(e){let s=await fe.readFile(e,"utf-8"),d=c(s);if(!d){let P=`${e}: Failed to parse YAML frontmatter`;throw new q.FrontmatterError({path:e,message:P},{cause:new Error(P)})}return d}q.parse=m;function i(e){if(!e||typeof e!="string")return {frontmatter:{},content:typeof e=="string"?e:""};let s=c(e);return s?{frontmatter:s.data,content:s.content}:{frontmatter:{},content:e}}q.extractFrontmatter=i;function f(e,s){let d=e??"";return !s||Object.keys(s).length===0?he__default.default.stringify(d,void 0):he__default.default.stringify(d,s)}q.format=f,q.FrontmatterError=le.create("ConfigFrontmatterError",G.z.object({path:G.z.string(),message:G.z.string()}));function T(e,s){return v(e,s)}q.replaceVariables=T;function v(e,s){return y(e,s)}q.renderTemplate=v;function y(e,s){let d=e;return d=h(d,s),d=k(d,s),d=B(d,s),d=j(d,s),d=d.replace(/\{\{([^}]*)\}\}/g,(P,w)=>{let u=w.trim();if(!u)return "";let l=xe(u,s);return l!==void 0?String(z(l)):""}),d}function h(e,s){let d=e.replace(/\{\{#if\s+\((eq|ne|gt|lt|gte|lte)\s+([^)]+)\)\}\}([\s\S]*?)\{\{(?:else)\}\}([\s\S]*?)\{\{\/if\}\}/g,(P,w,u,l,p)=>{if(!w||!u||!l||!p)return P;let{a:S,b:E}=b(u,s);return S===void 0||E===void 0?P:A(w,S,E)?l:p});return d=d.replace(/\{\{#if\s+\((eq|ne|gt|lt|gte|lte)\s+([^)]+)\)\}\}([\s\S]*?)\{\{\/if\}\}/g,(P,w,u,l)=>{if(!w||!u||!l)return P;let{a:p,b:S}=b(u,s);return p===void 0||S===void 0?P:A(w,p,S)?l:""}),d}function b(e,s){let d=/"([^"]*)"|(\w+(?:\.\w+|\[\d+\])*)/g,P=[],w;for(;(w=d.exec(e))!==null;)w[1]!==void 0?P.push(w[1]):w[2]!==void 0&&P.push(w[2]);if(P.length<2)return {a:void 0,b:void 0};let u=xe(P[0],s),l=xe(P[1],s);return {a:u,b:l}}function A(e,s,d){switch(e){case "eq":return s===d;case "ne":return s!==d;case "gt":return Number(s)>Number(d);case "lt":return Number(s)<Number(d);case "gte":return Number(s)>=Number(d);case "lte":return Number(s)<=Number(d);default:return false}}function k(e,s){let d=e.replace(/\{\{#unless\s+(\w+)\}\}([\s\S]*?)\{\{(?:else)\}\}([\s\S]*?)\{\{\/unless\}\}/g,(P,w,u,l)=>{if(!w||!u||!l)return P;let p=s[w];return $(p)?u:l});return d=d.replace(/\{\{#unless\s+(\w+)\}\}([\s\S]*?)\{\{\/unless\}\}/g,(P,w,u)=>{if(!w||!u)return P;let l=s[w];return $(l)?u:""}),d}function $(e){return e==null||e===false||e===""}function j(e,s){let d=e.replace(/\{\{#if\s+(\w+)\}\}([\s\S]*?)\{\{(?:else)\}\}([\s\S]*?)\{\{\/if\}\}/g,(P,w,u,l)=>{if(!w||!u||!l)return P;let p=w in s?s[w]:void 0;return $(p)?l:u});return d=d.replace(/\{\{#if\s+(\w+)\}\}([\s\S]*?)\{\{\/if\}\}/g,(P,w,u)=>{if(!w||!u)return P;let l=w in s?s[w]:void 0;return $(l)?"":u}),d}function B(e,s){let d=e.match(/\{\{#each\s+([\w.]+)\}\}/);if(!d?.[1])return e;let P=d[1],w=xe(P,s),u=d[0],l=d.index,p=e.slice(l+u.length),S;if(Array.isArray(w))S=w.map((O,R)=>({key:String(R),value:O}));else if(w!==null&&typeof w=="object")S=Object.entries(w).map(([O,R])=>({key:O,value:R}));else return W(e,l,u,p);let E=1,D=-1,_=/\{\{#each\s+[\w.]+\}\}|\{\{\/each\}\}/g,M;for(_.lastIndex=0;(M=_.exec(p))!==null;)if(M[0].startsWith("{{#each"))E++;else if(E--,E===0){D=M.index;break}if(D===-1)return e;let U=p.slice(0,D),C=e.slice(l,l+u.length+D+"{{/each}}".length);if(S.length===0)return e.replace(C,"");let H=S.map(({key:O,value:R},L)=>{let F={...s};return typeof R=="object"&&R!==null?(Object.assign(F,R),F.this=R,F["@value"]=R,F["@index"]=L,F["@key"]=O):(F.this=R,F["@value"]=R,F["@index"]=L,F["@key"]=O),y(U,F)});return e.replace(C,H.join(""))}function W(e,s,d,P,w){let u=/\{\{#each\s+[\w.]+\}\}|\{\{\/each\}\}/g,l=1,p=-1,S;for(u.lastIndex=0;(S=u.exec(P))!==null;)if(S[0].startsWith("{{#each"))l++;else if(l--,l===0){p=S.index;break}if(p===-1)return e;let D=e.slice(s,s+d.length+p+"{{/each}}".length);return e.replace(D,"")}function z(e){return e instanceof Date?chunkAV7EICQL_cjs.b(e):Array.isArray(e)?e.map(z).join(", "):e!==null&&typeof e=="object"?JSON.stringify(e,null,2):String(e)}q.formatVariableValue=z;})(exports.Markdown||(exports.Markdown={}));function xe(r,t){let n=/(@\w+)|(\w+)|\[(\d+)\]/g,o=t,a;for(;(a=n.exec(r))!==null;){if(o==null)return;if(a[1]!==void 0){let c=a[1];o=t[c];}else if(a[2]!==void 0){let c=a[2];if(typeof o=="object"&&o!==null)o=o[c];else return}else if(a[3]!==void 0){let c=Number(a[3]);if(Array.isArray(o)&&c>=0&&c<o.length)o=o[c];else return}}return o}chunkE2GY67T5_cjs.e();function Ke(r){if(!r)return "";let n=r.replace(/[/\\]+$/,"").split(/[/\\]/);return n[n.length-1]??""}function Xt(r){if(!r)return "";let n=r.replace(/[/\\]+$/,"").split(/[/\\]/);return n.slice(0,n.length-1).join("/")+"/"}function Yt(r){if(!r)return "";let t=r.split(".");return t[t.length-1]}function Jt(r,t=20){let n=Ke(r);if(n.length<=t)return n;let o=n.lastIndexOf("."),a=o<=0?"":n.slice(o),c=t-a.length-1;return c<=0?n.slice(0,t-1)+"\u2026":n.slice(0,c)+"\u2026"+a}function Kt(r,t=20){if(r.length<=t)return r;let n=t-1,o=Math.ceil(n/2),a=Math.floor(n/2);return r.slice(0,o)+"\u2026"+r.slice(-a)}chunkE2GY67T5_cjs.e();var Vt=["load failed","network connection was lost","network request failed","failed to fetch","econnreset","econnrefused","etimedout","socket hang up"];function Zt(r){if(!r)return false;let t=String(r instanceof Error?r.message:r).toLowerCase();return Vt.some(n=>t.includes(n))}async function $e(r,t={}){let{attempts:n=3,delay:o=500,factor:a=2,maxDelay:c=1e4,retryIf:m=Zt}=t,i;for(let f=0;f<n;f++)try{return await r()}catch(x){if(i=x,f===n-1||!m(x))throw x;let T=Math.min(o*a**f,c);await new Promise(v=>setTimeout(v,T));}throw i}chunkE2GY67T5_cjs.e();exports.Fetch=void 0;(w=>{let r=chunkAV7EICQL_cjs.m.create({service:"fetch"}),t=["HTTP_PROXY","HTTPS_PROXY","http_proxy","https_proxy"],n=false,o=null,a,c;function m(){return t.some(u=>{let l=process.env[u];return typeof l=="string"&&l.trim().length>0})}w.hasProxyConfigured=m;function i(){let u=process.env.http_proxy||process.env.HTTP_PROXY;return process.env.https_proxy||process.env.HTTPS_PROXY||u}w.getProxyUrl=i;function f(u={}){let l=u.httpProxy||u.httpsProxy||i();if(!l){r.warn("[Fetch] No proxy configured, HTTP_PROXY/HTTPS_PROXY environment variables not set");return}let p;!u.httpProxy&&!u.httpsProxy?(!process.env.NO_PROXY&&!process.env.no_proxy?(a=void 0,c=void 0,process.env.NO_PROXY="localhost,127.0.0.1,::1",process.env.no_proxy="localhost,127.0.0.1,::1"):(a=process.env.NO_PROXY,c=process.env.no_proxy),p=new undici.EnvHttpProxyAgent({connectTimeout:u.connectTimeout||1e4,keepAliveTimeout:u.keepAliveTimeout||3e4}),r.info(`[Fetch] Global proxy enabled via EnvHttpProxyAgent (honors NO_PROXY=${process.env.NO_PROXY})`)):(p=new undici.ProxyAgent({uri:l,connectTimeout:u.connectTimeout||1e4,keepAliveTimeout:u.keepAliveTimeout||3e4}),r.info(`[Fetch] Global proxy enabled: ${l}`)),o=undici.getGlobalDispatcher(),undici.setGlobalDispatcher(p),n=true;}w.enableProxy=f;function x(){!n||!o||(undici.setGlobalDispatcher(o),n=false,o=null,a===void 0?delete process.env.NO_PROXY:process.env.NO_PROXY=a,c===void 0?delete process.env.no_proxy:process.env.no_proxy=c,a=void 0,c=void 0,r.info("[Fetch] Global proxy disabled"));}w.disableProxy=x;function T(){return n}w.isProxyEnabled=T;async function v(u,l){let p=l?.timeout||3e4,S=l?.responseType||"json",{timeout:E,responseType:D,..._}=l||{},M=null,U=null;try{_.signal||(M=new AbortController,U=setTimeout(()=>M.abort(),p));let N=await fetch(u,{..._,signal:_.signal||M.signal});U&&clearTimeout(U);let C;switch(S){case "arrayBuffer":C=await N.arrayBuffer();break;case "blob":C=await N.blob();break;case "buffer":{let H=await N.arrayBuffer();C=Buffer.from(H);break}case "text":C=await N.text();break;default:{let H=await N.text();try{C=JSON.parse(H);}catch{C=H;}break}}return {ok:N.ok,status:N.status,statusText:N.statusText,headers:N.headers,data:C,url:N.url}}catch(N){throw U&&clearTimeout(U),N}}async function y(u,l){let p=l?.retries??0,S=l?.retryDelay??1e3,{retries:E,retryDelay:D,responseType:_,...M}=l||{};return $e(()=>v(u,{...M,responseType:l?.responseType}),{attempts:p+1,delay:S,maxDelay:S*2**(p+1)})}async function h(u,l){return y(u,{method:"GET",...l})}w.get=h;async function b(u,l,p){return y(u,{method:"POST",headers:{"Content-Type":"application/json",...p?.headers},body:l?JSON.stringify(l):void 0,...p})}w.post=b;async function A(u,l,p){return y(u,{method:"PUT",headers:{"Content-Type":"application/json",...p?.headers},body:l?JSON.stringify(l):void 0,...p})}w.put=A;async function k(u,l,p){return y(u,{method:"DELETE",headers:{"Content-Type":"application/json",...p?.headers},body:l?JSON.stringify(l):void 0,...p})}w.del=k;async function $(u,l,p){return y(u,{method:"PATCH",headers:{"Content-Type":"application/json",...p?.headers},body:l?JSON.stringify(l):void 0,...p})}w.patch=$;async function j(u,l){return y(u,l)}w.request=j;function B(u={}){return m()?(f(u),true):false}w.autoProxy=B;let W=5*1024*1024;function z(u){return new TextEncoder().encode(u)}function q(u){return chunkQNBTABHK_cjs.d.mimeType(u)}function e(u){return u.startsWith("file://")}async function s(u){let l=url.fileURLToPath(u);return await chunk2KQO2CPV_cjs.D.file(l).bytes()}async function d(u,l,p){let S=`----FetchFormBoundary${Date.now()}`,E=[],_=l.some(R=>R.filename||R.value instanceof Uint8Array||Buffer.isBuffer(R.value))&&!p?.timeout?3e5:p?.timeout;for(let R of l){let L=R.maxSize??W,F=R.filename,ne=`Content-Disposition: form-data; name="${R.name}"${F?`; filename="${F}"`:""}`;F&&(ne+=`\r
20
20
  Content-Type: ${q(F)}`),ne+=`\r
21
21
  \r
22
22
  `,E.push(z(ne));let X=R.value;if(typeof X=="string")if(e(X)){let ye=await s(X);if(F||(F=X.split("/").pop()||"file"),ye.byteLength>L)throw new Error(`File size ${ye.byteLength} exceeds limit ${L} bytes: ${F}`);E.push(ye);}else E.push(z(X));else if(Buffer.isBuffer(X)){if(X.byteLength>L)throw new Error(`Buffer size ${X.byteLength} exceeds limit ${L} bytes: ${R.name}`);E.push(new Uint8Array(X.buffer,X.byteOffset,X.byteLength));}else if(X instanceof Uint8Array){if(X.byteLength>L)throw new Error(`File size ${X.byteLength} exceeds limit ${L} bytes: ${R.name}`);E.push(X);}}let M=z(`\r
@@ -25,5 +25,5 @@ Content-Type: ${q(F)}`),ne+=`\r
25
25
  `),N=[];N.push(z(`--${S}\r
26
26
  `));for(let R=0;R<E.length;R++)N.push(E[R]),R%2===1&&R<E.length-1&&(N.push(U),N.push(z(`--${S}\r
27
27
  `)));N.push(M);let C=N.reduce((R,L)=>R+L.length,0),H=new Uint8Array(C),O=0;for(let R of N)H.set(R,O),O+=R.length;return y(u,{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${S}`,...p?.headers},body:H,timeout:_,...p})}w.postForm=d;function P(u,l,p){let S=new AbortController,E=S.signal;return (async()=>{try{let _={Accept:"text/event-stream",...p?.headers||{}},M=await fetch(u,{...p,headers:_,signal:E});if(!M.ok)throw new Error(`SSE connection failed: ${M.status}`);let U=M.body?.getReader();if(!U)throw new Error("SSE stream not available");let N=new TextDecoder("utf-8"),C="";for(;!E.aborted;){let{done:H,value:O}=await U.read();if(H)break;let R=N.decode(O,{stream:!0});C+=R;let L=C.split(`
28
- `);C=L.pop()??"";for(let F of L)if(F.startsWith("data: ")){let ne=F.slice(6);if(ne==="[DONE]"){l.onComplete?.();return}l.onMessage?.(ne);}}l.onComplete?.();}catch(_){_.name!=="AbortError"&&l.onError?.(_);}})(),()=>{S.abort();}}w.sse=P;})(exports.Fetch||(exports.Fetch={}));chunkK7PV4FXJ_cjs.e();exports.Slug=void 0;(o=>{let r=["brave","calm","clever","cosmic","crisp","curious","eager","gentle","glowing","happy","hidden","jolly","kind","lucky","mighty","misty","neon","nimble","playful","proud","quick","quiet","shiny","silent","stellar","sunny","swift","tidy","witty"],t=["cabin","cactus","canyon","circuit","comet","eagle","engine","falcon","forest","garden","harbor","island","knight","lagoon","meadow","moon","mountain","nebula","orchid","otter","panda","pixel","planet","river","rocket","sailor","squid","star","tiger","wizard","wolf"];function n(){return [r[Math.floor(Math.random()*r.length)],t[Math.floor(Math.random()*t.length)]].join("-")}o.create=n;})(exports.Slug||(exports.Slug={}));chunkK7PV4FXJ_cjs.e();exports.Schema=void 0;(a=>(a.positiveInt=G__default.default.union([G__default.default.number(),G__default.default.string().regex(/^\d+$/,"must be a positive integer (digits only)")]).transform(c=>typeof c=="number"?c:Number.parseInt(c,10)).pipe(G__default.default.number().int().positive()),a.nonNegativeInt=G__default.default.union([G__default.default.number(),G__default.default.string().regex(/^\d+$/,"must be a non-negative integer (digits only)")]).transform(c=>typeof c=="number"?c:Number.parseInt(c,10)).pipe(G__default.default.number().int().nonnegative()),a.booleanLike=G__default.default.union([G__default.default.boolean(),G__default.default.string()]).transform((c,m)=>{if(typeof c=="boolean")return c;let i=c.trim().toLowerCase();return ["true","1","yes","on"].includes(i)?true:["false","0","no","off"].includes(i)?false:(m.addIssue({code:"custom",message:`invalid boolean string: ${JSON.stringify(c)}`}),G__default.default.NEVER)}).pipe(G__default.default.boolean()),a.stringArray=(c=",")=>G__default.default.union([G__default.default.array(G__default.default.string()),G__default.default.string()]).transform(m=>Array.isArray(m)?m:m.split(c).map(f=>f.trim()).filter(f=>f.length>0)).pipe(G__default.default.array(G__default.default.string()))))(exports.Schema||(exports.Schema={}));chunkK7PV4FXJ_cjs.e();function Ze(r){let t=new AbortController,n=setTimeout(t.abort.bind(t),r);return {controller:t,signal:t.signal,clearTimeout:()=>globalThis.clearTimeout(n)}}function nr(r,...t){let n=Ze(r);return {signal:AbortSignal.any([n.signal,...t]),clearTimeout:n.clearTimeout}}chunkK7PV4FXJ_cjs.e();exports.Archive=void 0;(t=>{async function r(n,o){if(process.platform==="win32"){let a=ve__default.default.resolve(n),c=ve__default.default.resolve(o),m=`Expand-Archive -Path '${a}' -DestinationPath '${c}' -Force`,i=await chunkKKCFNFFR_cjs.G.run("powershell",`-NoProfile -NonInteractive -Command "$global:ProgressPreference = 'SilentlyContinue'; ${m}"`);if(i.code!==0)throw new Error(`PowerShell exited with code ${i.code}: ${i.stderr}`)}else {let a=`unzip -o -q ${n} -d ${o}`,c=await chunkKKCFNFFR_cjs.G.run(void 0,a);if(c.code!==0)throw new Error(`unzip exited with code ${c.code}: ${c.stderr}`)}}t.extractZip=r;})(exports.Archive||(exports.Archive={}));chunkK7PV4FXJ_cjs.e();exports.Color=void 0;(o=>{function r(a){return a?/^#[0-9a-fA-F]{6}$/.test(a):false}o.isValidHex=r;function t(a){let c=parseInt(a.slice(1,3),16),m=parseInt(a.slice(3,5),16),i=parseInt(a.slice(5,7),16);return {r:c,g:m,b:i}}o.hexToRgb=t;function n(a){if(!r(a))return;let{r:c,g:m,b:i}=t(a);return `\x1B[38;2;${c};${m};${i}m\x1B[1m`}o.hexToAnsiBold=n;})(exports.Color||(exports.Color={}));chunkK7PV4FXJ_cjs.e();exports.Context=void 0;(n=>{class r extends Error{constructor(c){super(`No context found for ${c}`);chunkK7PV4FXJ_cjs.c(this,"name",c);}}n.NotFound=r;function t(o){let a=new async_hooks.AsyncLocalStorage;return {use(){let c=a.getStore();if(!c)throw new r(o);return c},provide(c,m){return a.run(c,m)}}}n.create=t;})(exports.Context||(exports.Context={}));chunkK7PV4FXJ_cjs.e();function sr(r){return {[Symbol.dispose](){r();},[Symbol.asyncDispose](){return Promise.resolve(r())}}}chunkK7PV4FXJ_cjs.e();exports.EventLoop=void 0;(t=>{async function r(){return new Promise(n=>{let o=()=>{process._getActiveHandles().length===0&&process._getActiveRequests().length===0?n():setImmediate(o);};o();})}t.wait=r;})(exports.EventLoop||(exports.EventLoop={}));chunkK7PV4FXJ_cjs.e();function ir(r){if(r<=0)return "";if(r<60)return `${r}s`;if(r<3600){let n=Math.floor(r/60),o=r%60;return o>0?`${n}m ${o}s`:`${n}m`}if(r<86400){let n=Math.floor(r/3600),o=Math.floor(r%3600/60);return o>0?`${n}h ${o}m`:`${n}h`}if(r<604800){let n=Math.floor(r/86400);return n===1?"~1 day":`~${n} days`}let t=Math.floor(r/604800);return t===1?"~1 week":`~${t} weeks`}chunkK7PV4FXJ_cjs.e();exports.Grep=void 0;(q=>{let r=chunk5XHOPT4Y_cjs.m.create({service:"grep"});async function t(){return n()}q.filepath=t;let n=chunkKKCFNFFR_cjs.b(async()=>{let e=await chunkKKCFNFFR_cjs.D.which("rg");if(!e)return null;try{if(!(await fe__default.default.stat(e)).isFile())return null}catch{return null}try{let s=await chunkKKCFNFFR_cjs.D.run([e,"--version"],{timeout:5e3});if(s.code!==0||!s.stdout.startsWith("ripgrep "))return r.warn("rg failed self-test, falling back to pure JS",{filepath:e,code:s.code,stderr:s.stderr.slice(0,200)}),null}catch(s){return r.warn("rg spawn failed during self-test, falling back to pure JS",{filepath:e,error:s.message.slice(0,200)}),null}return e});async function o(){return await t()!==null}q.isUsingRipgrep=o;async function*a(e){e.signal?.throwIfAborted();let s=await t();s?yield*c(s,e):(r.debug("ripgrep not available, using pure JS fallback for files()",{cwd:e.cwd}),yield*m(e));}q.files=a;async function*c(e,s){s.signal?.throwIfAborted();let d=["--files","--glob=!.git/*"];s.follow&&d.push("--follow");let P=s.hidden!==false;if(s.maxDepth!==void 0&&d.push(`--max-depth=${s.maxDepth}`),s.glob)for(let l of s.glob)d.push(`--glob=${l}`);try{if(!(await fe__default.default.stat(s.cwd)).isDirectory())throw Object.assign(new Error(`Not a directory: '${s.cwd}'`),{code:"ENOTDIR",errno:-20,path:s.cwd})}catch(l){throw l.code==="ENOENT"?Object.assign(new Error(`No such file or directory: '${s.cwd}'`),{code:"ENOENT",errno:-2,path:s.cwd}):l}let w=await chunkKKCFNFFR_cjs.D.run([e,...d],{cwd:s.cwd});if(w.code!==0&&w.code!==1)return;let u=w.stdout.split(/\r?\n/);for(let l of u){s.signal?.throwIfAborted();let p=l.trim();if(!p)continue;let S=chunkGVXRTRAT_cjs.d.toUnixPath(p);!P&&S.split("/").some(E=>E.startsWith("."))||(yield S);}}async function*m(e){e.signal?.throwIfAborted();try{if(!(await fe__default.default.stat(e.cwd)).isDirectory())throw Object.assign(new Error(`Not a directory: '${e.cwd}'`),{code:"ENOTDIR",errno:-20,path:e.cwd})}catch(E){throw E.code==="ENOENT"?Object.assign(new Error(`No such file or directory: '${e.cwd}'`),{code:"ENOENT",errno:-2,path:e.cwd}):E}let s=[],d=[];if(e.glob)for(let E of e.glob)E.startsWith("!")?d.push(E.slice(1)):s.push(E);let P=s.length>0?b(s):["**/*"],w=e.hidden!==false,u=new Set,l=chunkGVXRTRAT_cjs.b.DEFAULT_MAX_DEPTH,p;e.maxDepth===void 0?p=l:e.maxDepth<0?p=1:p=e.maxDepth+1;let S=Math.min(Math.max(p,1),l);for(let E of P){e.signal?.throwIfAborted();let D=await chunkGVXRTRAT_cjs.b.scan(E,{cwd:e.cwd,absolute:false,include:"file",dot:w,symlink:e.follow??false,maxDepth:S,ignore:d});for(let _ of D)!w&&_.split("/").some(M=>M.startsWith("."))||u.add(_);}for(let E of Array.from(u).sort())e.signal?.throwIfAborted(),yield E;e.signal?.throwIfAborted();}async function i(e){r.debug("tree",{cwd:e.cwd}),e.signal?.throwIfAborted();let s=e.hidden!==false,d=e.glob??[],P=d.filter(O=>!O.startsWith("!")),w=d.filter(O=>O.startsWith("!")).map(O=>O.slice(1)),u=P.length>0?P:["**/*"],l=new Set,p=[];for(let O of u){e.signal?.throwIfAborted();let R=await chunkGVXRTRAT_cjs.b.scan(O,{cwd:e.cwd,absolute:false,include:"file",dot:s,symlink:false,maxDepth:chunkGVXRTRAT_cjs.b.DEFAULT_MAX_DEPTH});for(let L of R)l.has(L)||(l.add(L),p.push(L));}let S=p.filter(O=>{for(let R of w)if(chunkGVXRTRAT_cjs.b.match(R,O))return false;return true});function E(O,R){let L=O.children.get(R);if(L)return L;let F={name:R,children:new Map};return O.children.set(R,F),F}let D={children:new Map};for(let O of S){let R=O.split("/");if(R.length<2)continue;let L=D;for(let F of R.slice(0,-1))L=E(L,F);}let _=Array.from(D.children.values()).sort((O,R)=>O.name.localeCompare(R.name)),M=e.limit??Number.POSITIVE_INFINITY,U=[],N=_.map(O=>({node:O,path:O.name})),C=0,H=0;for(;N.length>0;){let O=N.shift();if(!O)break;if(C++,H<M){U.push(O.path),H++;for(let R of Array.from(O.node.children.values()).sort((L,F)=>L.name.localeCompare(F.name))){if(H>=M)break;N.push({node:R,path:`${O.path}/${R.name}`});}}}return C>H&&U.push(`[${H}/${C} shown, ${C-H} truncated]`),U.join(`
29
- `)}q.tree=i;async function f(e){let s=await t();return s?x(s,e):(r.debug("ripgrep not available, using pure JS fallback for search()",{cwd:e.cwd,pattern:e.pattern}),T(e))}q.search=f;async function x(e,s){let d=["--json","--glob=!.git/*"];if(s.follow&&d.push("--follow"),s.glob)for(let p of s.glob)d.push(`--glob=${p}`);s.limit&&d.push(`--max-count=${s.limit}`),d.push("--"),d.push(s.pattern);let P=await chunkKKCFNFFR_cjs.D.run([e,...d],{cwd:s.cwd});if(P.code!==0)return [];let w=s.hidden!==false,u=P.stdout.split(/\r?\n/).filter(Boolean),l=[];for(let p of u)try{let S=JSON.parse(p);if(S?.type!=="match")continue;let E=S.data;if(!E?.path?.text||!E?.lines?.text)continue;let D=chunkGVXRTRAT_cjs.d.toUnixPath(E.path.text);if(!w&&D.split("/").some(_=>_.startsWith(".")))continue;if(l.push({path:D,lines:E.lines.text,line_number:E.line_number,absolute_offset:E.absolute_offset??0}),s.limit&&l.length>=s.limit)break}catch{}return l}async function T(e){let s;try{s=new RegExp(e.pattern);}catch{return []}try{if(!(await fe__default.default.stat(e.cwd)).isDirectory())throw Object.assign(new Error(`Not a directory: '${e.cwd}'`),{code:"ENOTDIR",errno:-20,path:e.cwd})}catch(_){throw _.code==="ENOENT"?Object.assign(new Error(`No such file or directory: '${e.cwd}'`),{code:"ENOENT",errno:-2,path:e.cwd}):_}let d=[],P=[];if(e.glob)for(let _ of e.glob)_.startsWith("!")?P.push(_):d.push(_);let u=b(P).map(_=>_.startsWith("!")?_.slice(1):_),l=e.hidden!==false,p=[],S=d.length>0?b(d):["**/*"],E=new Set,D=[];for(let _ of S){e.signal?.throwIfAborted();let M=await chunkGVXRTRAT_cjs.b.scan(_,{cwd:e.cwd,absolute:false,include:"file",dot:l,symlink:e.follow??false,maxDepth:void 0,ignore:u});for(let U of M)E.has(U)||(E.add(U),D.push(U));}for(let _ of D){if(e.signal?.throwIfAborted(),e.limit&&p.length>=e.limit)break;let M=chunkGVXRTRAT_cjs.d.join(e.cwd,_),U;try{U=await fe__default.default.readFile(M,"utf-8");}catch{continue}let N=U.split(/\r?\n/),C=0;for(let H=0;H<N.length;H++){let O=N[H]??"";if(s.test(O)&&(p.push({path:_,lines:O,line_number:H+1,absolute_offset:C}),e.limit&&p.length>=e.limit))break;C+=Buffer.byteLength(O,"utf-8")+1;}}return p}function v(e,s){return chunkGVXRTRAT_cjs.a.match(e,s)}q.match=v;let y=chunkKKCFNFFR_cjs.a(async()=>await t());async function h(){return await y()}q.filepathCached=h;function b(e){let s=[];for(let d of e){if(d.startsWith("!")){let w=d.slice(1);s.push(`!${A(w)}`);continue}let P=k(d);for(let w of P)s.push($(w));}return s}function A(e){return !e||e.startsWith("**")||e.includes("/")?e:/[*?[\]]/.test(e)?`**/${e}`:`**/${e}/**`}function k(e){let s=j(e);if(s===-1)return [e];let d=B(e,s);if(d===-1)return [e];let P=e.slice(s+1,d),w=W(P);if(!w||w.length<=1)return [e];let u=e.slice(0,s),l=e.slice(d+1);return w.map(p=>u+p+l)}function $(e){return !e||e.includes("/")||e.startsWith("**")?e:`**/${e}`}function j(e){for(let d=0;d<e.length;d++){let P=e[d];if(P==="\\"){d++;continue}if(P==="{"){return d;}}return -1}function B(e,s){for(let d=s+1;d<e.length;d++){let P=e[d];if(P==="\\"){d++;continue}if(P==="}")return d}return -1}function W(e){return e?e.split(","):null}q._ready=chunkKKCFNFFR_cjs.a(async()=>{let e=await t();return r.debug("Grep initialized",{ripgrep:e?"available":"fallback (pure JS)"}),e});})(exports.Grep||(exports.Grep={}));chunkK7PV4FXJ_cjs.e();exports.Keybind=void 0;(m=>{function r(i,f){if(i===f)return true;if(typeof i!="object"||typeof f!="object"||i===null||f===null)return false;let x=Object.keys(i),T=Object.keys(f);if(x.length!==T.length)return false;for(let v of x)if(!T.includes(v)||!r(i[v],f[v]))return false;return true}function t(i){return {...i,super:i.super??false}}function n(i,f){return i?r(t(i),t(f)):false}m.match=n;function o(i,f=false){return {name:i.name,ctrl:i.ctrl,meta:i.meta,shift:i.shift,super:i.super??false,leader:f}}m.fromParsedKey=o;function a(i){if(!i)return "";let f=[];i.ctrl&&f.push("ctrl"),i.meta&&f.push("alt"),i.super&&f.push("super"),i.shift&&f.push("shift"),i.name&&(i.name==="delete"?f.push("del"):f.push(i.name));let x=f.join("+");return i.leader&&(x=x?`<leader> ${x}`:"<leader>"),x}m.keyToString=a;function c(i){return i==="none"?[]:i.split(",").map(f=>{let T=f.replace(/<leader>/g,"leader+").toLowerCase().split("+"),v={ctrl:false,meta:false,shift:false,super:false,leader:false,name:""};for(let y of T)switch(y){case "ctrl":v.ctrl=true;break;case "alt":case "meta":case "option":v.meta=true;break;case "super":v.super=true;break;case "shift":v.shift=true;break;case "leader":v.leader=true;break;case "esc":v.name="escape";break;default:v.name=y;break}return v})}m.parse=c;})(exports.Keybind||(exports.Keybind={}));chunkK7PV4FXJ_cjs.e();exports.Locale=void 0;(y=>{y.SUPPORTED_LANGS=["zh-CN","en-US"],y.DEFAULT_LANG="zh-CN";function n(h,b="EASBOT_LANG"){let A=[h,process.env[b]?.trim()];for(let k of A)if(k&&y.SUPPORTED_LANGS.includes(k))return k;return y.DEFAULT_LANG}y.resolveLocaleLang=n;function o(h){return h.replace(/\b\w/g,b=>b.toUpperCase())}y.titlecase=o;function a(h){return new Date(h).toLocaleTimeString(void 0,{timeStyle:"short"})}y.time=a;function c(h){let b=new Date(h),A=a(h),k=b.toLocaleDateString();return `${A} \xB7 ${k}`}y.datetime=c;function m(h){let b=new Date(h),A=new Date;return b.getFullYear()===A.getFullYear()&&b.getMonth()===A.getMonth()&&b.getDate()===A.getDate()?a(h):c(h)}y.todayTimeOrDateTime=m;function i(h){return h>=1e6?(h/1e6).toFixed(1)+"M":h>=1e3?(h/1e3).toFixed(1)+"K":h.toString()}y.number=i;function f(h){if(h<1e3)return `${h}ms`;if(h<6e4)return `${(h/1e3).toFixed(1)}s`;if(h<36e5){let k=Math.floor(h/6e4),$=Math.floor(h%6e4/1e3);return `${k}m ${$}s`}if(h<864e5){let k=Math.floor(h/36e5),$=Math.floor(h%36e5/6e4);return `${k}h ${$}m`}let b=Math.floor(h/36e5);return `${Math.floor(h%36e5/864e5)}d ${b}h`}y.duration=f;function x(h,b){return h.length<=b?h:h.slice(0,b-1)+"\u2026"}y.truncate=x;function T(h,b=35){if(h.length<=b)return h;let A="\u2026",k=Math.ceil((b-A.length)/2),$=Math.floor((b-A.length)/2);return h.slice(0,k)+A+h.slice(-$)}y.truncateMiddle=T;function v(h,b,A){return (h===1?b:A).replace("{}",h.toString())}y.pluralize=v;})(exports.Locale||(exports.Locale={}));var ar=exports.Locale.resolveLocaleLang,cr=exports.Locale.SUPPORTED_LANGS,lr=exports.Locale.DEFAULT_LANG;chunkK7PV4FXJ_cjs.e();var ur=["HTTP_PROXY","HTTPS_PROXY","http_proxy","https_proxy"];function fr(){return ur.some(r=>process.env[r])}function dr(){return process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy}function pr(){let r=process.env.HTTP_PROXY||process.env.http_proxy,t=process.env.HTTPS_PROXY||process.env.https_proxy;return {http:r,https:t,enabled:!!(r||t)}}chunkK7PV4FXJ_cjs.e();var He=class{constructor(){chunkK7PV4FXJ_cjs.c(this,"queue",[]);chunkK7PV4FXJ_cjs.c(this,"resolvers",[]);}push(t){let n=this.resolvers.shift();n?n(t):this.queue.push(t);}async next(){return this.queue.length>0?this.queue.shift():new Promise(t=>this.resolvers.push(t))}async*[Symbol.asyncIterator](){for(;;)yield await this.next();}};async function mr(r,t,n){let o=[...t];await Promise.all(Array.from({length:r},async()=>{for(;;){let a=o.pop();if(a===void 0)return;await n(a);}}));}chunkK7PV4FXJ_cjs.e();function gr(){let r,t=new Promise(n=>r=n);return {trigger(){return r()},wait(){return t}}}chunkK7PV4FXJ_cjs.e();function hr(r,t){let n;return Promise.race([r.then(o=>(clearTimeout(n),o)),new Promise((o,a)=>{n=setTimeout(()=>{a(new Error(`Operation timed out after ${t}ms`));},t);})])}chunkK7PV4FXJ_cjs.e();exports.Token=void 0;(m=>{let n=/[\u4e00-\u9fff\u3400-\u4dbf]/g;function o(i){if(!i)return 0;let f=String(i),x=(f.match(n)||[]).length,T=f.length-x,v=Math.round(x/1.5),y=Math.round(T/4);return Math.max(0,v+y)}m.estimate=o;function a(i){if(i==null)return 0;try{let f=typeof i=="string"?i:JSON.stringify(i);return o(f)}catch{return 0}}m.estimateObject=a;function c(i){if(i.total!==void 0&&i.total>0)return i.total;let f=i.input??0,x=i.output??0,T=i.cache?.read??0,v=i.cache?.write??0;return f+x+T+v}m.total=c;})(exports.Token||(exports.Token={}));chunkK7PV4FXJ_cjs.e();function yr(r){let t={},n=r.shape??r.required().shape;for(let[o,a]of Object.entries(n))t[o]=a.nullable().optional();return G__default.default.object(t)}Object.defineProperty(exports,"Lock",{enumerable:true,get:function(){return chunkIVVWAT7R_cjs.a}});Object.defineProperty(exports,"$",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.H}});Object.defineProperty(exports,"HTTPException",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.j}});Object.defineProperty(exports,"Hono",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.d}});Object.defineProperty(exports,"Lazy",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.c}});Object.defineProperty(exports,"PKG",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.D}});Object.defineProperty(exports,"PkgShell",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.A}});Object.defineProperty(exports,"Shell",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.G}});Object.defineProperty(exports,"compress",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.g}});Object.defineProperty(exports,"cors",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.e}});Object.defineProperty(exports,"createNodeWebSocket",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.s}});Object.defineProperty(exports,"createPkgShell",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.B}});Object.defineProperty(exports,"createRESTServer",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.p}});Object.defineProperty(exports,"createRPCServer",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.n}});Object.defineProperty(exports,"createServer",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.m}});Object.defineProperty(exports,"createStreamingServer",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.r}});Object.defineProperty(exports,"createWebSocketServer",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.q}});Object.defineProperty(exports,"detectPlatform",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.y}});Object.defineProperty(exports,"escapeCommandArg",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.w}});Object.defineProperty(exports,"escapeCommandArgSafe",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.x}});Object.defineProperty(exports,"joinCommandArgs",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.z}});Object.defineProperty(exports,"lazy",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.a}});Object.defineProperty(exports,"lazyAsync",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.b}});Object.defineProperty(exports,"logger",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.f}});Object.defineProperty(exports,"needsShellExecution",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.u}});Object.defineProperty(exports,"parseCommand",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.t}});Object.defineProperty(exports,"parseCommandWithOptions",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.v}});Object.defineProperty(exports,"readableStreamToText",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.E}});Object.defineProperty(exports,"secureHeaders",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.h}});Object.defineProperty(exports,"shell",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.C}});Object.defineProperty(exports,"startServer",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.o}});Object.defineProperty(exports,"timeout",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.i}});Object.defineProperty(exports,"validator",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.k}});Object.defineProperty(exports,"whichSync",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.F}});Object.defineProperty(exports,"zValidator",{enumerable:true,get:function(){return chunkKKCFNFFR_cjs.l}});Object.defineProperty(exports,"Filesystem",{enumerable:true,get:function(){return chunkGVXRTRAT_cjs.d}});Object.defineProperty(exports,"Glob",{enumerable:true,get:function(){return chunkGVXRTRAT_cjs.b}});Object.defineProperty(exports,"MIME_TYPES",{enumerable:true,get:function(){return chunkGVXRTRAT_cjs.c}});Object.defineProperty(exports,"Wildcard",{enumerable:true,get:function(){return chunkGVXRTRAT_cjs.a}});Object.defineProperty(exports,"Log",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.m}});Object.defineProperty(exports,"PackageRegistry",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.o}});Object.defineProperty(exports,"Semver",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.n}});Object.defineProperty(exports,"addMinutesInTimezone",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.l}});Object.defineProperty(exports,"formatLocalISO",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.a}});Object.defineProperty(exports,"formatLocalISOCompact",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.b}});Object.defineProperty(exports,"formatLogTime",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.f}});Object.defineProperty(exports,"formatLogTimeMs",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.g}});Object.defineProperty(exports,"getTimezoneOffset",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.h}});Object.defineProperty(exports,"getTimezoneParts",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.i}});Object.defineProperty(exports,"isValidTimezone",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.j}});Object.defineProperty(exports,"normalizeTimezone",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.k}});Object.defineProperty(exports,"now",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.c}});Object.defineProperty(exports,"nowLocalISO",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.d}});Object.defineProperty(exports,"parseLocalISO",{enumerable:true,get:function(){return chunk5XHOPT4Y_cjs.e}});exports.AsyncQueue=He;exports.DEFAULT_LANG=lr;exports.NamedError=le;exports.OAUTH_DUMMY_KEY=Ft;exports.SUPPORTED_LANGS=cr;exports.abortAfter=Ze;exports.abortAfterAny=nr;exports.defer=sr;exports.findLast=Pt;exports.fn=vt;exports.formatDuration=ir;exports.getDirectory=Xt;exports.getFileExtension=Yt;exports.getFilename=Ke;exports.getFilenameTruncated=Jt;exports.getProxyConfig=pr;exports.getProxyUrl=dr;exports.git=Mt;exports.iife=Gt;exports.loadEnv=Ot;exports.loadTextFile=Ht;exports.loadTextFileAsync=Bt;exports.parseModelId=Wt;exports.proxied=fr;exports.resolveLocaleLang=ar;exports.retry=$e;exports.signal=gr;exports.truncateMiddle=Kt;exports.updateSchema=yr;exports.withTimeout=hr;exports.work=mr;
28
+ `);C=L.pop()??"";for(let F of L)if(F.startsWith("data: ")){let ne=F.slice(6);if(ne==="[DONE]"){l.onComplete?.();return}l.onMessage?.(ne);}}l.onComplete?.();}catch(_){_.name!=="AbortError"&&l.onError?.(_);}})(),()=>{S.abort();}}w.sse=P;})(exports.Fetch||(exports.Fetch={}));chunkE2GY67T5_cjs.e();exports.Slug=void 0;(o=>{let r=["brave","calm","clever","cosmic","crisp","curious","eager","gentle","glowing","happy","hidden","jolly","kind","lucky","mighty","misty","neon","nimble","playful","proud","quick","quiet","shiny","silent","stellar","sunny","swift","tidy","witty"],t=["cabin","cactus","canyon","circuit","comet","eagle","engine","falcon","forest","garden","harbor","island","knight","lagoon","meadow","moon","mountain","nebula","orchid","otter","panda","pixel","planet","river","rocket","sailor","squid","star","tiger","wizard","wolf"];function n(){return [r[Math.floor(Math.random()*r.length)],t[Math.floor(Math.random()*t.length)]].join("-")}o.create=n;})(exports.Slug||(exports.Slug={}));chunkE2GY67T5_cjs.e();exports.Schema=void 0;(a=>(a.positiveInt=G__default.default.union([G__default.default.number(),G__default.default.string().regex(/^\d+$/,"must be a positive integer (digits only)")]).transform(c=>typeof c=="number"?c:Number.parseInt(c,10)).pipe(G__default.default.number().int().positive()),a.nonNegativeInt=G__default.default.union([G__default.default.number(),G__default.default.string().regex(/^\d+$/,"must be a non-negative integer (digits only)")]).transform(c=>typeof c=="number"?c:Number.parseInt(c,10)).pipe(G__default.default.number().int().nonnegative()),a.booleanLike=G__default.default.union([G__default.default.boolean(),G__default.default.string()]).transform((c,m)=>{if(typeof c=="boolean")return c;let i=c.trim().toLowerCase();return ["true","1","yes","on"].includes(i)?true:["false","0","no","off"].includes(i)?false:(m.addIssue({code:"custom",message:`invalid boolean string: ${JSON.stringify(c)}`}),G__default.default.NEVER)}).pipe(G__default.default.boolean()),a.stringArray=(c=",")=>G__default.default.union([G__default.default.array(G__default.default.string()),G__default.default.string()]).transform(m=>Array.isArray(m)?m:m.split(c).map(f=>f.trim()).filter(f=>f.length>0)).pipe(G__default.default.array(G__default.default.string()))))(exports.Schema||(exports.Schema={}));chunkE2GY67T5_cjs.e();function Ze(r){let t=new AbortController,n=setTimeout(t.abort.bind(t),r);return {controller:t,signal:t.signal,clearTimeout:()=>globalThis.clearTimeout(n)}}function nr(r,...t){let n=Ze(r);return {signal:AbortSignal.any([n.signal,...t]),clearTimeout:n.clearTimeout}}chunkE2GY67T5_cjs.e();exports.Archive=void 0;(t=>{async function r(n,o){if(process.platform==="win32"){let a=ve__default.default.resolve(n),c=ve__default.default.resolve(o),m=`Expand-Archive -Path '${a}' -DestinationPath '${c}' -Force`,i=await chunk2KQO2CPV_cjs.G.run("powershell",`-NoProfile -NonInteractive -Command "$global:ProgressPreference = 'SilentlyContinue'; ${m}"`);if(i.code!==0)throw new Error(`PowerShell exited with code ${i.code}: ${i.stderr}`)}else {let a=`unzip -o -q ${n} -d ${o}`,c=await chunk2KQO2CPV_cjs.G.run(void 0,a);if(c.code!==0)throw new Error(`unzip exited with code ${c.code}: ${c.stderr}`)}}t.extractZip=r;})(exports.Archive||(exports.Archive={}));chunkE2GY67T5_cjs.e();exports.Color=void 0;(o=>{function r(a){return a?/^#[0-9a-fA-F]{6}$/.test(a):false}o.isValidHex=r;function t(a){let c=parseInt(a.slice(1,3),16),m=parseInt(a.slice(3,5),16),i=parseInt(a.slice(5,7),16);return {r:c,g:m,b:i}}o.hexToRgb=t;function n(a){if(!r(a))return;let{r:c,g:m,b:i}=t(a);return `\x1B[38;2;${c};${m};${i}m\x1B[1m`}o.hexToAnsiBold=n;})(exports.Color||(exports.Color={}));chunkE2GY67T5_cjs.e();exports.Context=void 0;(n=>{class r extends Error{constructor(c){super(`No context found for ${c}`);chunkE2GY67T5_cjs.c(this,"name",c);}}n.NotFound=r;function t(o){let a=new async_hooks.AsyncLocalStorage;return {use(){let c=a.getStore();if(!c)throw new r(o);return c},provide(c,m){return a.run(c,m)}}}n.create=t;})(exports.Context||(exports.Context={}));chunkE2GY67T5_cjs.e();function sr(r){return {[Symbol.dispose](){r();},[Symbol.asyncDispose](){return Promise.resolve(r())}}}chunkE2GY67T5_cjs.e();exports.EventLoop=void 0;(t=>{async function r(){return new Promise(n=>{let o=()=>{process._getActiveHandles().length===0&&process._getActiveRequests().length===0?n():setImmediate(o);};o();})}t.wait=r;})(exports.EventLoop||(exports.EventLoop={}));chunkE2GY67T5_cjs.e();function ir(r){if(r<=0)return "";if(r<60)return `${r}s`;if(r<3600){let n=Math.floor(r/60),o=r%60;return o>0?`${n}m ${o}s`:`${n}m`}if(r<86400){let n=Math.floor(r/3600),o=Math.floor(r%3600/60);return o>0?`${n}h ${o}m`:`${n}h`}if(r<604800){let n=Math.floor(r/86400);return n===1?"~1 day":`~${n} days`}let t=Math.floor(r/604800);return t===1?"~1 week":`~${t} weeks`}chunkE2GY67T5_cjs.e();exports.Grep=void 0;(q=>{let r=chunkAV7EICQL_cjs.m.create({service:"grep"});async function t(){return n()}q.filepath=t;let n=chunk2KQO2CPV_cjs.b(async()=>{let e=await chunk2KQO2CPV_cjs.D.which("rg");if(!e)return null;try{if(!(await fe__default.default.stat(e)).isFile())return null}catch{return null}try{let s=await chunk2KQO2CPV_cjs.D.run([e,"--version"],{timeout:5e3});if(s.code!==0||!s.stdout.startsWith("ripgrep "))return r.warn("rg failed self-test, falling back to pure JS",{filepath:e,code:s.code,stderr:s.stderr.slice(0,200)}),null}catch(s){return r.warn("rg spawn failed during self-test, falling back to pure JS",{filepath:e,error:s.message.slice(0,200)}),null}return e});async function o(){return await t()!==null}q.isUsingRipgrep=o;async function*a(e){e.signal?.throwIfAborted();let s=await t();s?yield*c(s,e):(r.debug("ripgrep not available, using pure JS fallback for files()",{cwd:e.cwd}),yield*m(e));}q.files=a;async function*c(e,s){s.signal?.throwIfAborted();let d=["--files","--glob=!.git/*"];s.follow&&d.push("--follow");let P=s.hidden!==false;if(s.maxDepth!==void 0&&d.push(`--max-depth=${s.maxDepth}`),s.glob)for(let l of s.glob)d.push(`--glob=${l}`);try{if(!(await fe__default.default.stat(s.cwd)).isDirectory())throw Object.assign(new Error(`Not a directory: '${s.cwd}'`),{code:"ENOTDIR",errno:-20,path:s.cwd})}catch(l){throw l.code==="ENOENT"?Object.assign(new Error(`No such file or directory: '${s.cwd}'`),{code:"ENOENT",errno:-2,path:s.cwd}):l}let w=await chunk2KQO2CPV_cjs.D.run([e,...d],{cwd:s.cwd});if(w.code!==0&&w.code!==1)return;let u=w.stdout.split(/\r?\n/);for(let l of u){s.signal?.throwIfAborted();let p=l.trim();if(!p)continue;let S=chunkQNBTABHK_cjs.d.toUnixPath(p);!P&&S.split("/").some(E=>E.startsWith("."))||(yield S);}}async function*m(e){e.signal?.throwIfAborted();try{if(!(await fe__default.default.stat(e.cwd)).isDirectory())throw Object.assign(new Error(`Not a directory: '${e.cwd}'`),{code:"ENOTDIR",errno:-20,path:e.cwd})}catch(E){throw E.code==="ENOENT"?Object.assign(new Error(`No such file or directory: '${e.cwd}'`),{code:"ENOENT",errno:-2,path:e.cwd}):E}let s=[],d=[];if(e.glob)for(let E of e.glob)E.startsWith("!")?d.push(E.slice(1)):s.push(E);let P=s.length>0?b(s):["**/*"],w=e.hidden!==false,u=new Set,l=chunkQNBTABHK_cjs.b.DEFAULT_MAX_DEPTH,p;e.maxDepth===void 0?p=l:e.maxDepth<0?p=1:p=e.maxDepth+1;let S=Math.min(Math.max(p,1),l);for(let E of P){e.signal?.throwIfAborted();let D=await chunkQNBTABHK_cjs.b.scan(E,{cwd:e.cwd,absolute:false,include:"file",dot:w,symlink:e.follow??false,maxDepth:S,ignore:d});for(let _ of D)!w&&_.split("/").some(M=>M.startsWith("."))||u.add(_);}for(let E of Array.from(u).sort())e.signal?.throwIfAborted(),yield E;e.signal?.throwIfAborted();}async function i(e){r.debug("tree",{cwd:e.cwd}),e.signal?.throwIfAborted();let s=e.hidden!==false,d=e.glob??[],P=d.filter(O=>!O.startsWith("!")),w=d.filter(O=>O.startsWith("!")).map(O=>O.slice(1)),u=P.length>0?P:["**/*"],l=new Set,p=[];for(let O of u){e.signal?.throwIfAborted();let R=await chunkQNBTABHK_cjs.b.scan(O,{cwd:e.cwd,absolute:false,include:"file",dot:s,symlink:false,maxDepth:chunkQNBTABHK_cjs.b.DEFAULT_MAX_DEPTH});for(let L of R)l.has(L)||(l.add(L),p.push(L));}let S=p.filter(O=>{for(let R of w)if(chunkQNBTABHK_cjs.b.match(R,O))return false;return true});function E(O,R){let L=O.children.get(R);if(L)return L;let F={name:R,children:new Map};return O.children.set(R,F),F}let D={children:new Map};for(let O of S){let R=O.split("/");if(R.length<2)continue;let L=D;for(let F of R.slice(0,-1))L=E(L,F);}let _=Array.from(D.children.values()).sort((O,R)=>O.name.localeCompare(R.name)),M=e.limit??Number.POSITIVE_INFINITY,U=[],N=_.map(O=>({node:O,path:O.name})),C=0,H=0;for(;N.length>0;){let O=N.shift();if(!O)break;if(C++,H<M){U.push(O.path),H++;for(let R of Array.from(O.node.children.values()).sort((L,F)=>L.name.localeCompare(F.name))){if(H>=M)break;N.push({node:R,path:`${O.path}/${R.name}`});}}}return C>H&&U.push(`[${H}/${C} shown, ${C-H} truncated]`),U.join(`
29
+ `)}q.tree=i;async function f(e){let s=await t();return s?x(s,e):(r.debug("ripgrep not available, using pure JS fallback for search()",{cwd:e.cwd,pattern:e.pattern}),T(e))}q.search=f;async function x(e,s){let d=["--json","--glob=!.git/*"];if(s.follow&&d.push("--follow"),s.glob)for(let p of s.glob)d.push(`--glob=${p}`);s.limit&&d.push(`--max-count=${s.limit}`),d.push("--"),d.push(s.pattern);let P=await chunk2KQO2CPV_cjs.D.run([e,...d],{cwd:s.cwd});if(P.code!==0)return [];let w=s.hidden!==false,u=P.stdout.split(/\r?\n/).filter(Boolean),l=[];for(let p of u)try{let S=JSON.parse(p);if(S?.type!=="match")continue;let E=S.data;if(!E?.path?.text||!E?.lines?.text)continue;let D=chunkQNBTABHK_cjs.d.toUnixPath(E.path.text);if(!w&&D.split("/").some(_=>_.startsWith(".")))continue;if(l.push({path:D,lines:E.lines.text,line_number:E.line_number,absolute_offset:E.absolute_offset??0}),s.limit&&l.length>=s.limit)break}catch{}return l}async function T(e){let s;try{s=new RegExp(e.pattern);}catch{return []}try{if(!(await fe__default.default.stat(e.cwd)).isDirectory())throw Object.assign(new Error(`Not a directory: '${e.cwd}'`),{code:"ENOTDIR",errno:-20,path:e.cwd})}catch(_){throw _.code==="ENOENT"?Object.assign(new Error(`No such file or directory: '${e.cwd}'`),{code:"ENOENT",errno:-2,path:e.cwd}):_}let d=[],P=[];if(e.glob)for(let _ of e.glob)_.startsWith("!")?P.push(_):d.push(_);let u=b(P).map(_=>_.startsWith("!")?_.slice(1):_),l=e.hidden!==false,p=[],S=d.length>0?b(d):["**/*"],E=new Set,D=[];for(let _ of S){e.signal?.throwIfAborted();let M=await chunkQNBTABHK_cjs.b.scan(_,{cwd:e.cwd,absolute:false,include:"file",dot:l,symlink:e.follow??false,maxDepth:void 0,ignore:u});for(let U of M)E.has(U)||(E.add(U),D.push(U));}for(let _ of D){if(e.signal?.throwIfAborted(),e.limit&&p.length>=e.limit)break;let M=chunkQNBTABHK_cjs.d.join(e.cwd,_),U;try{U=await fe__default.default.readFile(M,"utf-8");}catch{continue}let N=U.split(/\r?\n/),C=0;for(let H=0;H<N.length;H++){let O=N[H]??"";if(s.test(O)&&(p.push({path:_,lines:O,line_number:H+1,absolute_offset:C}),e.limit&&p.length>=e.limit))break;C+=Buffer.byteLength(O,"utf-8")+1;}}return p}function v(e,s){return chunkQNBTABHK_cjs.a.match(e,s)}q.match=v;let y=chunk2KQO2CPV_cjs.a(async()=>await t());async function h(){return await y()}q.filepathCached=h;function b(e){let s=[];for(let d of e){if(d.startsWith("!")){let w=d.slice(1);s.push(`!${A(w)}`);continue}let P=k(d);for(let w of P)s.push($(w));}return s}function A(e){return !e||e.startsWith("**")||e.includes("/")?e:/[*?[\]]/.test(e)?`**/${e}`:`**/${e}/**`}function k(e){let s=j(e);if(s===-1)return [e];let d=B(e,s);if(d===-1)return [e];let P=e.slice(s+1,d),w=W(P);if(!w||w.length<=1)return [e];let u=e.slice(0,s),l=e.slice(d+1);return w.map(p=>u+p+l)}function $(e){return !e||e.includes("/")||e.startsWith("**")?e:`**/${e}`}function j(e){for(let d=0;d<e.length;d++){let P=e[d];if(P==="\\"){d++;continue}if(P==="{"){return d;}}return -1}function B(e,s){for(let d=s+1;d<e.length;d++){let P=e[d];if(P==="\\"){d++;continue}if(P==="}")return d}return -1}function W(e){return e?e.split(","):null}q._ready=chunk2KQO2CPV_cjs.a(async()=>{let e=await t();return r.debug("Grep initialized",{ripgrep:e?"available":"fallback (pure JS)"}),e});})(exports.Grep||(exports.Grep={}));chunkE2GY67T5_cjs.e();exports.Keybind=void 0;(m=>{function r(i,f){if(i===f)return true;if(typeof i!="object"||typeof f!="object"||i===null||f===null)return false;let x=Object.keys(i),T=Object.keys(f);if(x.length!==T.length)return false;for(let v of x)if(!T.includes(v)||!r(i[v],f[v]))return false;return true}function t(i){return {...i,super:i.super??false}}function n(i,f){return i?r(t(i),t(f)):false}m.match=n;function o(i,f=false){return {name:i.name,ctrl:i.ctrl,meta:i.meta,shift:i.shift,super:i.super??false,leader:f}}m.fromParsedKey=o;function a(i){if(!i)return "";let f=[];i.ctrl&&f.push("ctrl"),i.meta&&f.push("alt"),i.super&&f.push("super"),i.shift&&f.push("shift"),i.name&&(i.name==="delete"?f.push("del"):f.push(i.name));let x=f.join("+");return i.leader&&(x=x?`<leader> ${x}`:"<leader>"),x}m.keyToString=a;function c(i){return i==="none"?[]:i.split(",").map(f=>{let T=f.replace(/<leader>/g,"leader+").toLowerCase().split("+"),v={ctrl:false,meta:false,shift:false,super:false,leader:false,name:""};for(let y of T)switch(y){case "ctrl":v.ctrl=true;break;case "alt":case "meta":case "option":v.meta=true;break;case "super":v.super=true;break;case "shift":v.shift=true;break;case "leader":v.leader=true;break;case "esc":v.name="escape";break;default:v.name=y;break}return v})}m.parse=c;})(exports.Keybind||(exports.Keybind={}));chunkE2GY67T5_cjs.e();exports.Locale=void 0;(y=>{y.SUPPORTED_LANGS=["zh-CN","en-US"],y.DEFAULT_LANG="zh-CN";function n(h,b="EASBOT_LANG"){let A=[h,process.env[b]?.trim()];for(let k of A)if(k&&y.SUPPORTED_LANGS.includes(k))return k;return y.DEFAULT_LANG}y.resolveLocaleLang=n;function o(h){return h.replace(/\b\w/g,b=>b.toUpperCase())}y.titlecase=o;function a(h){return new Date(h).toLocaleTimeString(void 0,{timeStyle:"short"})}y.time=a;function c(h){let b=new Date(h),A=a(h),k=b.toLocaleDateString();return `${A} \xB7 ${k}`}y.datetime=c;function m(h){let b=new Date(h),A=new Date;return b.getFullYear()===A.getFullYear()&&b.getMonth()===A.getMonth()&&b.getDate()===A.getDate()?a(h):c(h)}y.todayTimeOrDateTime=m;function i(h){return h>=1e6?(h/1e6).toFixed(1)+"M":h>=1e3?(h/1e3).toFixed(1)+"K":h.toString()}y.number=i;function f(h){if(h<1e3)return `${h}ms`;if(h<6e4)return `${(h/1e3).toFixed(1)}s`;if(h<36e5){let k=Math.floor(h/6e4),$=Math.floor(h%6e4/1e3);return `${k}m ${$}s`}if(h<864e5){let k=Math.floor(h/36e5),$=Math.floor(h%36e5/6e4);return `${k}h ${$}m`}let b=Math.floor(h/36e5);return `${Math.floor(h%36e5/864e5)}d ${b}h`}y.duration=f;function x(h,b){return h.length<=b?h:h.slice(0,b-1)+"\u2026"}y.truncate=x;function T(h,b=35){if(h.length<=b)return h;let A="\u2026",k=Math.ceil((b-A.length)/2),$=Math.floor((b-A.length)/2);return h.slice(0,k)+A+h.slice(-$)}y.truncateMiddle=T;function v(h,b,A){return (h===1?b:A).replace("{}",h.toString())}y.pluralize=v;})(exports.Locale||(exports.Locale={}));var ar=exports.Locale.resolveLocaleLang,cr=exports.Locale.SUPPORTED_LANGS,lr=exports.Locale.DEFAULT_LANG;chunkE2GY67T5_cjs.e();var ur=["HTTP_PROXY","HTTPS_PROXY","http_proxy","https_proxy"];function fr(){return ur.some(r=>process.env[r])}function dr(){return process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy}function pr(){let r=process.env.HTTP_PROXY||process.env.http_proxy,t=process.env.HTTPS_PROXY||process.env.https_proxy;return {http:r,https:t,enabled:!!(r||t)}}chunkE2GY67T5_cjs.e();var He=class{constructor(){chunkE2GY67T5_cjs.c(this,"queue",[]);chunkE2GY67T5_cjs.c(this,"resolvers",[]);}push(t){let n=this.resolvers.shift();n?n(t):this.queue.push(t);}async next(){return this.queue.length>0?this.queue.shift():new Promise(t=>this.resolvers.push(t))}async*[Symbol.asyncIterator](){for(;;)yield await this.next();}};async function mr(r,t,n){let o=[...t];await Promise.all(Array.from({length:r},async()=>{for(;;){let a=o.pop();if(a===void 0)return;await n(a);}}));}chunkE2GY67T5_cjs.e();function gr(){let r,t=new Promise(n=>r=n);return {trigger(){return r()},wait(){return t}}}chunkE2GY67T5_cjs.e();function hr(r,t){let n;return Promise.race([r.then(o=>(clearTimeout(n),o)),new Promise((o,a)=>{n=setTimeout(()=>{a(new Error(`Operation timed out after ${t}ms`));},t);})])}chunkE2GY67T5_cjs.e();exports.Token=void 0;(m=>{let n=/[\u4e00-\u9fff\u3400-\u4dbf]/g;function o(i){if(!i)return 0;let f=String(i),x=(f.match(n)||[]).length,T=f.length-x,v=Math.round(x/1.5),y=Math.round(T/4);return Math.max(0,v+y)}m.estimate=o;function a(i){if(i==null)return 0;try{let f=typeof i=="string"?i:JSON.stringify(i);return o(f)}catch{return 0}}m.estimateObject=a;function c(i){if(i.total!==void 0&&i.total>0)return i.total;let f=i.input??0,x=i.output??0,T=i.cache?.read??0,v=i.cache?.write??0;return f+x+T+v}m.total=c;})(exports.Token||(exports.Token={}));chunkE2GY67T5_cjs.e();function yr(r){let t={},n=r.shape??r.required().shape;for(let[o,a]of Object.entries(n))t[o]=a.nullable().optional();return G__default.default.object(t)}Object.defineProperty(exports,"Lock",{enumerable:true,get:function(){return chunkRDSCQNRW_cjs.a}});Object.defineProperty(exports,"$",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.H}});Object.defineProperty(exports,"HTTPException",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.j}});Object.defineProperty(exports,"Hono",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.d}});Object.defineProperty(exports,"Lazy",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.c}});Object.defineProperty(exports,"PKG",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.D}});Object.defineProperty(exports,"PkgShell",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.A}});Object.defineProperty(exports,"Shell",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.G}});Object.defineProperty(exports,"compress",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.g}});Object.defineProperty(exports,"cors",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.e}});Object.defineProperty(exports,"createNodeWebSocket",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.s}});Object.defineProperty(exports,"createPkgShell",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.B}});Object.defineProperty(exports,"createRESTServer",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.p}});Object.defineProperty(exports,"createRPCServer",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.n}});Object.defineProperty(exports,"createServer",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.m}});Object.defineProperty(exports,"createStreamingServer",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.r}});Object.defineProperty(exports,"createWebSocketServer",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.q}});Object.defineProperty(exports,"detectPlatform",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.y}});Object.defineProperty(exports,"escapeCommandArg",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.w}});Object.defineProperty(exports,"escapeCommandArgSafe",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.x}});Object.defineProperty(exports,"joinCommandArgs",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.z}});Object.defineProperty(exports,"lazy",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.a}});Object.defineProperty(exports,"lazyAsync",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.b}});Object.defineProperty(exports,"logger",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.f}});Object.defineProperty(exports,"needsShellExecution",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.u}});Object.defineProperty(exports,"parseCommand",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.t}});Object.defineProperty(exports,"parseCommandWithOptions",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.v}});Object.defineProperty(exports,"readableStreamToText",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.E}});Object.defineProperty(exports,"secureHeaders",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.h}});Object.defineProperty(exports,"shell",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.C}});Object.defineProperty(exports,"startServer",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.o}});Object.defineProperty(exports,"timeout",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.i}});Object.defineProperty(exports,"validator",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.k}});Object.defineProperty(exports,"whichSync",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.F}});Object.defineProperty(exports,"zValidator",{enumerable:true,get:function(){return chunk2KQO2CPV_cjs.l}});Object.defineProperty(exports,"Filesystem",{enumerable:true,get:function(){return chunkQNBTABHK_cjs.d}});Object.defineProperty(exports,"Glob",{enumerable:true,get:function(){return chunkQNBTABHK_cjs.b}});Object.defineProperty(exports,"MIME_TYPES",{enumerable:true,get:function(){return chunkQNBTABHK_cjs.c}});Object.defineProperty(exports,"Wildcard",{enumerable:true,get:function(){return chunkQNBTABHK_cjs.a}});Object.defineProperty(exports,"Log",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.m}});Object.defineProperty(exports,"PackageRegistry",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.o}});Object.defineProperty(exports,"Semver",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.n}});Object.defineProperty(exports,"addMinutesInTimezone",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.l}});Object.defineProperty(exports,"formatLocalISO",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.a}});Object.defineProperty(exports,"formatLocalISOCompact",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.b}});Object.defineProperty(exports,"formatLogTime",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.f}});Object.defineProperty(exports,"formatLogTimeMs",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.g}});Object.defineProperty(exports,"getTimezoneOffset",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.h}});Object.defineProperty(exports,"getTimezoneParts",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.i}});Object.defineProperty(exports,"isValidTimezone",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.j}});Object.defineProperty(exports,"normalizeTimezone",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.k}});Object.defineProperty(exports,"now",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.c}});Object.defineProperty(exports,"nowLocalISO",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.d}});Object.defineProperty(exports,"parseLocalISO",{enumerable:true,get:function(){return chunkAV7EICQL_cjs.e}});exports.AsyncQueue=He;exports.DEFAULT_LANG=lr;exports.NamedError=le;exports.OAUTH_DUMMY_KEY=Ft;exports.SUPPORTED_LANGS=cr;exports.abortAfter=Ze;exports.abortAfterAny=nr;exports.defer=sr;exports.findLast=Pt;exports.fn=vt;exports.formatDuration=ir;exports.getDirectory=Xt;exports.getFileExtension=Yt;exports.getFilename=Ke;exports.getFilenameTruncated=Jt;exports.getProxyConfig=pr;exports.getProxyUrl=dr;exports.git=Mt;exports.iife=Gt;exports.loadEnv=Ot;exports.loadTextFile=Ht;exports.loadTextFileAsync=Bt;exports.parseModelId=Wt;exports.proxied=fr;exports.resolveLocaleLang=ar;exports.retry=$e;exports.signal=gr;exports.truncateMiddle=Kt;exports.updateSchema=yr;exports.withTimeout=hr;exports.work=mr;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export{a as Lock}from'./chunks/chunk-GOEMY5AZ.mjs';import {a,b,D,G,c as c$1}from'./chunks/chunk-N26SFBEH.mjs';export{H as $,j as HTTPException,d as Hono,c as Lazy,D as PKG,A as PkgShell,G as Shell,g as compress,e as cors,s as createNodeWebSocket,B as createPkgShell,p as createRESTServer,n as createRPCServer,m as createServer,r as createStreamingServer,q as createWebSocketServer,y as detectPlatform,w as escapeCommandArg,x as escapeCommandArgSafe,z as joinCommandArgs,a as lazy,b as lazyAsync,f as logger,u as needsShellExecution,t as parseCommand,v as parseCommandWithOptions,E as readableStreamToText,h as secureHeaders,C as shell,o as startServer,i as timeout,k as validator,F as whichSync,l as zValidator}from'./chunks/chunk-N26SFBEH.mjs';import {d,b as b$2,a as a$1}from'./chunks/chunk-XGZ7XJWW.mjs';export{d as Filesystem,b as Glob,c as MIME_TYPES,a as Wildcard}from'./chunks/chunk-XGZ7XJWW.mjs';import {m,b as b$1}from'./chunks/chunk-OEWMITBM.mjs';export{m as Log,o as PackageRegistry,n as Semver,l as addMinutesInTimezone,a as formatLocalISO,b as formatLocalISOCompact,f as formatLogTime,g as formatLogTimeMs,h as getTimezoneOffset,i as getTimezoneParts,j as isValidTimezone,k as normalizeTimezone,c as now,d as nowLocalISO,e as parseLocalISO}from'./chunks/chunk-OEWMITBM.mjs';import {f,c,d as d$1}from'./chunks/chunk-6GV3NECV.mjs';import de,{readFile,writeFile,rename}from'fs/promises';import W,{z}from'zod';import {randomBytes}from'crypto';import {config}from'dotenv';import Se,{dirname,join}from'path';import {xdgData,xdgConfig}from'xdg-basedir';import It from'os';import {existsSync,mkdirSync,readdirSync,statSync}from'fs';import {fileURLToPath}from'url';import xe from'gray-matter';import {EnvHttpProxyAgent,ProxyAgent,getGlobalDispatcher,setGlobalDispatcher}from'undici';import {AsyncLocalStorage}from'async_hooks';f();f();function Rt(r,t){for(let n=r.length-1;n>=0;n-=1){let o=r[n];if(o!==void 0&&t(o,n,r))return o}}f();var we;(n=>{function r(o,a,c){let m=0,i=o.length-1;for(;m<=i;){let f=Math.floor((m+i)/2),x=o[f];if(x===void 0)break;let T=c(x);if(T===a)return {found:true,index:f};T<a?m=f+1:i=f-1;}return {found:false,index:m}}n.search=r;function t(o,a,c){let m=c(a),i=0,f=o.length;for(;i<f;){let x=Math.floor((i+f)/2),T=o[x];if(T===void 0)break;c(T)<m?i=x+1:f=x;}return o.splice(i,0,a),o}n.insert=t;})(we||(we={}));f();var Te;(c=>{function r(m){let i=new TextEncoder().encode(m),f=Array.from(i,x=>String.fromCharCode(x)).join("");return btoa(f).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}c.base64Encode=r;function t(m){let i=atob(m.replace(/-/g,"+").replace(/_/g,"/")),f=Uint8Array.from(i,x=>x.charCodeAt(0));return new TextDecoder().decode(f)}c.base64Decode=t;async function n(m,i="SHA-256"){let x=new TextEncoder().encode(m),T=await crypto.subtle.digest(i,x);return Array.from(new Uint8Array(T)).map(h=>h.toString(16).padStart(2,"0")).join("")}c.hash=n;function o(m){if(!m)return;let i=2166136261;for(let f=0;f<m.length;f++)i^=m.charCodeAt(f),i=Math.imul(i,16777619);return (i>>>0).toString(36)}c.checksum=o;function a(m,i=5e5){if(!m)return;if(m.length<=i)return o(m);let f=4096,T=[0,Math.floor(m.length*.25),Math.floor(m.length*.5),Math.floor(m.length*.75),m.length-f].map(v=>{let y=Math.max(0,Math.min(m.length-f,v-Math.floor(f/2)));return o(m.slice(y,y+f))??""}).join(":");return `${m.length}:${T}`}c.sampledChecksum=a;})(Te||(Te={}));f();f();var te;(v=>{let r={event:"evt",session:"ses",message:"msg",permission:"per",question:"que",user:"usr",part:"prt",pty:"pty",tool:"tool",workspace:"wrk",command:"cmd",task:"task",heartbeat:"hb",agent:"ag",subagent:"sub",hook:"hok",compaction:"cmp",context:"ctx",experience:"exp",pattern:"pat",knowledge:"knw",evolution:"evo",result:"res"};function t(y){return W.string().startsWith(r[y])}v.schema=t;let n=26,o=0,a=0;function c(y,h){return i(y,false,h)}v.ascending=c;function m(y,h){return i(y,true,h)}v.descending=m;function i(y,h,b){if(!b)return x(y,h);if(!b.startsWith(r[y]))throw new Error(`ID ${b} does not start with ${r[y]}`);return b}function f(y){let h="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",b="",A=randomBytes(y);for(let k=0;k<y;k++){let D=A[k];D!==void 0&&(b+=h[D%62]);}return b}function x(y,h,b){let A=b??Date.now();A!==o&&(o=A,a=0),a++;let k=BigInt(A)*BigInt(4096)+BigInt(a);k=h?~k:k;let D=Buffer.alloc(6);for(let z=0;z<6;z++)D[z]=Number(k>>BigInt(40-8*z)&BigInt(255));return r[y]+"_"+D.toString("hex")+f(n-12)}v.create=x;function T(y){let h=y.split("_")[0];if(!h)return 0;let b=y.slice(h.length+1,h.length+13),A=BigInt("0x"+b);return Number(A/BigInt(4096))}v.timestamp=T;})(te||(te={}));var Pe;(x=>{x.DEFAULT_MAX_CHARS=4e3,x.DIRECTION="head",x.DIR=d.join(process.env.EASBOT_DATA_PATH??`${process.cwd()}/data`,"context-output"),x.GLOB=d.join(x.DIR,"*");let a=10080*60*1e3;function c(T,v,y){return y?`[Content truncated. Source: ${y}
1
+ export{a as Lock}from'./chunks/chunk-PI6LRPHA.mjs';import {a,b,D,G,c as c$1}from'./chunks/chunk-4ML53C4G.mjs';export{H as $,j as HTTPException,d as Hono,c as Lazy,D as PKG,A as PkgShell,G as Shell,g as compress,e as cors,s as createNodeWebSocket,B as createPkgShell,p as createRESTServer,n as createRPCServer,m as createServer,r as createStreamingServer,q as createWebSocketServer,y as detectPlatform,w as escapeCommandArg,x as escapeCommandArgSafe,z as joinCommandArgs,a as lazy,b as lazyAsync,f as logger,u as needsShellExecution,t as parseCommand,v as parseCommandWithOptions,E as readableStreamToText,h as secureHeaders,C as shell,o as startServer,i as timeout,k as validator,F as whichSync,l as zValidator}from'./chunks/chunk-4ML53C4G.mjs';import {d,b as b$2,a as a$1}from'./chunks/chunk-XLTYO4H4.mjs';export{d as Filesystem,b as Glob,c as MIME_TYPES,a as Wildcard}from'./chunks/chunk-XLTYO4H4.mjs';import {m,b as b$1}from'./chunks/chunk-UVVMQYTY.mjs';export{m as Log,o as PackageRegistry,n as Semver,l as addMinutesInTimezone,a as formatLocalISO,b as formatLocalISOCompact,f as formatLogTime,g as formatLogTimeMs,h as getTimezoneOffset,i as getTimezoneParts,j as isValidTimezone,k as normalizeTimezone,c as now,d as nowLocalISO,e as parseLocalISO}from'./chunks/chunk-UVVMQYTY.mjs';import {f,c,d as d$1}from'./chunks/chunk-B4W5JDXX.mjs';import de,{readFile,writeFile,rename}from'fs/promises';import W,{z}from'zod';import {randomBytes}from'crypto';import {config}from'dotenv';import Se,{dirname,join}from'path';import {xdgData,xdgConfig}from'xdg-basedir';import It from'os';import {existsSync,mkdirSync,readdirSync,statSync}from'fs';import {fileURLToPath}from'url';import xe from'gray-matter';import {EnvHttpProxyAgent,ProxyAgent,getGlobalDispatcher,setGlobalDispatcher}from'undici';import {AsyncLocalStorage}from'async_hooks';f();f();function Rt(r,t){for(let n=r.length-1;n>=0;n-=1){let o=r[n];if(o!==void 0&&t(o,n,r))return o}}f();var we;(n=>{function r(o,a,c){let m=0,i=o.length-1;for(;m<=i;){let f=Math.floor((m+i)/2),x=o[f];if(x===void 0)break;let T=c(x);if(T===a)return {found:true,index:f};T<a?m=f+1:i=f-1;}return {found:false,index:m}}n.search=r;function t(o,a,c){let m=c(a),i=0,f=o.length;for(;i<f;){let x=Math.floor((i+f)/2),T=o[x];if(T===void 0)break;c(T)<m?i=x+1:f=x;}return o.splice(i,0,a),o}n.insert=t;})(we||(we={}));f();var Te;(c=>{function r(m){let i=new TextEncoder().encode(m),f=Array.from(i,x=>String.fromCharCode(x)).join("");return btoa(f).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}c.base64Encode=r;function t(m){let i=atob(m.replace(/-/g,"+").replace(/_/g,"/")),f=Uint8Array.from(i,x=>x.charCodeAt(0));return new TextDecoder().decode(f)}c.base64Decode=t;async function n(m,i="SHA-256"){let x=new TextEncoder().encode(m),T=await crypto.subtle.digest(i,x);return Array.from(new Uint8Array(T)).map(h=>h.toString(16).padStart(2,"0")).join("")}c.hash=n;function o(m){if(!m)return;let i=2166136261;for(let f=0;f<m.length;f++)i^=m.charCodeAt(f),i=Math.imul(i,16777619);return (i>>>0).toString(36)}c.checksum=o;function a(m,i=5e5){if(!m)return;if(m.length<=i)return o(m);let f=4096,T=[0,Math.floor(m.length*.25),Math.floor(m.length*.5),Math.floor(m.length*.75),m.length-f].map(v=>{let y=Math.max(0,Math.min(m.length-f,v-Math.floor(f/2)));return o(m.slice(y,y+f))??""}).join(":");return `${m.length}:${T}`}c.sampledChecksum=a;})(Te||(Te={}));f();f();var te;(v=>{let r={event:"evt",session:"ses",message:"msg",permission:"per",question:"que",user:"usr",part:"prt",pty:"pty",tool:"tool",workspace:"wrk",command:"cmd",task:"task",heartbeat:"hb",agent:"ag",subagent:"sub",hook:"hok",compaction:"cmp",context:"ctx",experience:"exp",pattern:"pat",knowledge:"knw",evolution:"evo",result:"res"};function t(y){return W.string().startsWith(r[y])}v.schema=t;let n=26,o=0,a=0;function c(y,h){return i(y,false,h)}v.ascending=c;function m(y,h){return i(y,true,h)}v.descending=m;function i(y,h,b){if(!b)return x(y,h);if(!b.startsWith(r[y]))throw new Error(`ID ${b} does not start with ${r[y]}`);return b}function f(y){let h="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",b="",A=randomBytes(y);for(let k=0;k<y;k++){let D=A[k];D!==void 0&&(b+=h[D%62]);}return b}function x(y,h,b){let A=b??Date.now();A!==o&&(o=A,a=0),a++;let k=BigInt(A)*BigInt(4096)+BigInt(a);k=h?~k:k;let D=Buffer.alloc(6);for(let z=0;z<6;z++)D[z]=Number(k>>BigInt(40-8*z)&BigInt(255));return r[y]+"_"+D.toString("hex")+f(n-12)}v.create=x;function T(y){let h=y.split("_")[0];if(!h)return 0;let b=y.slice(h.length+1,h.length+13),A=BigInt("0x"+b);return Number(A/BigInt(4096))}v.timestamp=T;})(te||(te={}));var Pe;(x=>{x.DEFAULT_MAX_CHARS=4e3,x.DIRECTION="head",x.DIR=d.join(process.env.EASBOT_DATA_PATH??`${process.cwd()}/data`,"context-output"),x.GLOB=d.join(x.DIR,"*");let a=10080*60*1e3;function c(T,v,y){return y?`[Content truncated. Source: ${y}
2
2
  Full ${v} saved to: ${T}
3
3
  Use Read tool with offset/limit parameters to view specific sections.]`:`[Content truncated. Full ${v} saved to: ${T}
4
4
  Use Read tool with offset/limit parameters to view specific sections.]`}async function m(T,v={}){let y=v.maxChars??4e3,h=v.direction??x.DIRECTION,b=v.label??"content",A=v.sourcePath,k=d.join(process.env.EASBOT_DATA_PATH??`${process.cwd()}/data`,"context-output"),D=v.dir??k;if(T.length<=y)return {content:T,truncated:false};let z=te.ascending("context"),G=d.join(D,z);await de.mkdir(D,{recursive:true}).catch(()=>{}),await de.writeFile(G,T,"utf-8");let q=T.length-y,U;h==="head"?U=T.slice(0,y):U=T.slice(-y);let X=c(G,b,A),e=`${q} characters truncated`;return {content:h==="head"?`${U}