@easbot/utils 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/chunk-3U5YF6EI.cjs +20 -0
- package/dist/chunks/chunk-6BCTOX3Z.mjs +2 -0
- package/dist/chunks/chunk-AUS6KQNI.cjs +5 -0
- package/dist/chunks/chunk-DELWLFU5.mjs +5 -0
- package/dist/chunks/chunk-EN7LFV4R.cjs +2 -0
- package/dist/chunks/{chunk-UZ52E7FE.mjs → chunk-EWRFKUXM.mjs} +1 -1
- package/dist/chunks/chunk-MHARKEDN.mjs +1 -0
- package/dist/chunks/{chunk-YC4AEMOP.cjs → chunk-PJIZPZPO.cjs} +1 -1
- package/dist/chunks/chunk-WW6DVU53.mjs +20 -0
- package/dist/chunks/chunk-XBAP2B6J.cjs +1 -0
- package/dist/chunks/filesystem-26SI2VQU.cjs +1 -0
- package/dist/chunks/filesystem-GHRTFLEY.mjs +1 -0
- package/dist/chunks/lock-BQX6RGCF.mjs +1 -0
- package/dist/chunks/lock-RMTHF4F6.cjs +1 -0
- package/dist/chunks/{main-ZMRSNK7G.mjs → main-GVYBF75T.mjs} +4 -4
- package/dist/chunks/{main-RIJAJS2R.cjs → main-K27GCHMT.cjs} +4 -4
- package/dist/chunks/registry-5BYC5NYM.mjs +1 -0
- package/dist/chunks/registry-Z3XETZ6O.cjs +1 -0
- package/dist/chunks/shell-52EI6MQK.cjs +1 -0
- package/dist/chunks/shell-JJRFPZC7.mjs +1 -0
- package/dist/index.cjs +40 -39
- package/dist/index.d.cts +49 -1
- package/dist/index.d.ts +49 -1
- package/dist/index.mjs +41 -40
- package/package.json +3 -2
- package/dist/chunks/chunk-6HZ7Q7NO.mjs +0 -2
- package/dist/chunks/chunk-6JM5F6FM.cjs +0 -2
- package/dist/chunks/chunk-A2TCSTSM.cjs +0 -5
- package/dist/chunks/chunk-AHO55TRS.cjs +0 -4
- package/dist/chunks/chunk-DAYGB2XR.mjs +0 -4
- package/dist/chunks/chunk-JQNKLHWT.cjs +0 -20
- package/dist/chunks/chunk-LBWRSUJC.mjs +0 -20
- package/dist/chunks/chunk-T3MZ3YS3.mjs +0 -5
- package/dist/chunks/chunk-V6YNYGNC.mjs +0 -1
- package/dist/chunks/chunk-VRQQ33YH.cjs +0 -1
- package/dist/chunks/filesystem-HQDKXRWJ.cjs +0 -1
- package/dist/chunks/filesystem-XE6UYBAE.mjs +0 -1
- package/dist/chunks/lock-EGXJVIO5.mjs +0 -1
- package/dist/chunks/lock-LMCPTUNU.cjs +0 -1
- package/dist/chunks/registry-BGNK5LJC.cjs +0 -1
- package/dist/chunks/registry-NQR4SFLJ.mjs +0 -1
- package/dist/chunks/shell-PXZK5BNW.mjs +0 -1
- package/dist/chunks/shell-RJBXISIH.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{o as PackageRegistry}from'./chunk-DELWLFU5.mjs';import'./chunk-MHARKEDN.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkAUS6KQNI_cjs=require('./chunk-AUS6KQNI.cjs');require('./chunk-XBAP2B6J.cjs');Object.defineProperty(exports,"PackageRegistry",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.o}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk3U5YF6EI_cjs=require('./chunk-3U5YF6EI.cjs');require('./chunk-EN7LFV4R.cjs'),require('./chunk-AUS6KQNI.cjs'),require('./chunk-XBAP2B6J.cjs');Object.defineProperty(exports,"$",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.H}});Object.defineProperty(exports,"Shell",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.G}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{H as $,G as Shell}from'./chunk-WW6DVU53.mjs';import'./chunk-6BCTOX3Z.mjs';import'./chunk-DELWLFU5.mjs';import'./chunk-MHARKEDN.mjs';
|
package/dist/index.cjs
CHANGED
|
@@ -1,65 +1,66 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkPJIZPZPO_cjs=require('./chunks/chunk-PJIZPZPO.cjs'),chunk3U5YF6EI_cjs=require('./chunks/chunk-3U5YF6EI.cjs'),chunkEN7LFV4R_cjs=require('./chunks/chunk-EN7LFV4R.cjs'),chunkAUS6KQNI_cjs=require('./chunks/chunk-AUS6KQNI.cjs'),chunkXBAP2B6J_cjs=require('./chunks/chunk-XBAP2B6J.cjs'),me=require('fs/promises'),xe=require('zod'),crypto$1=require('crypto'),dotenv=require('dotenv'),He=require('path'),fs=require('fs'),xdgBasedir=require('xdg-basedir'),url=require('url'),In=require('markdown-it'),Ot=require('yaml'),undici=require('undici'),async_hooks=require('async_hooks');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var me__default=/*#__PURE__*/_interopDefault(me);var xe__default=/*#__PURE__*/_interopDefault(xe);var He__default=/*#__PURE__*/_interopDefault(He);var In__default=/*#__PURE__*/_interopDefault(In);var Ot__default=/*#__PURE__*/_interopDefault(Ot);chunkXBAP2B6J_cjs.e();chunkXBAP2B6J_cjs.e();function rn(t,e){for(let n=t.length-1;n>=0;n-=1){let r=t[n];if(r!==void 0&&e(r,n,t))return r}}chunkXBAP2B6J_cjs.e();exports.Binary=void 0;(n=>{function t(r,o,i){let a=0,s=r.length-1;for(;a<=s;){let l=Math.floor((a+s)/2),f=r[l];if(f===void 0)break;let c=i(f);if(c===o)return {found:true,index:l};c<o?a=l+1:s=l-1;}return {found:false,index:a}}n.search=t;function e(r,o,i){let a=i(o),s=0,l=r.length;for(;s<l;){let f=Math.floor((s+l)/2),c=r[f];if(c===void 0)break;i(c)<a?s=f+1:l=f;}return r.splice(s,0,o),r}n.insert=e;})(exports.Binary||(exports.Binary={}));chunkXBAP2B6J_cjs.e();exports.Encode=void 0;(i=>{function t(a){let s=new TextEncoder().encode(a),l=Array.from(s,f=>String.fromCharCode(f)).join("");return btoa(l).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}i.base64Encode=t;function e(a){let s=atob(a.replace(/-/g,"+").replace(/_/g,"/")),l=Uint8Array.from(s,f=>f.charCodeAt(0));return new TextDecoder().decode(l)}i.base64Decode=e;async function n(a,s="SHA-256"){let f=new TextEncoder().encode(a),c=await crypto.subtle.digest(s,f);return Array.from(new Uint8Array(c)).map(h=>h.toString(16).padStart(2,"0")).join("")}i.hash=n;function r(a){if(!a)return;let s=2166136261;for(let l=0;l<a.length;l++)s^=a.charCodeAt(l),s=Math.imul(s,16777619);return (s>>>0).toString(36)}i.checksum=r;function o(a,s=5e5){if(!a)return;if(a.length<=s)return r(a);let l=4096,c=[0,Math.floor(a.length*.25),Math.floor(a.length*.5),Math.floor(a.length*.75),a.length-l].map(u=>{let d=Math.max(0,Math.min(a.length-l,u-Math.floor(l/2)));return r(a.slice(d,d+l))??""}).join(":");return `${a.length}:${c}`}i.sampledChecksum=o;})(exports.Encode||(exports.Encode={}));chunkXBAP2B6J_cjs.e();chunkXBAP2B6J_cjs.e();exports.Identifier=void 0;(u=>{let t={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 e(d){return xe__default.default.string().startsWith(t[d])}u.schema=e;let n=26,r=0,o=0;function i(d,h){return s(d,false,h)}u.ascending=i;function a(d,h){return s(d,true,h)}u.descending=a;function s(d,h,k){if(!k)return f(d,h);if(!k.startsWith(t[d]))throw new Error(`ID ${k} does not start with ${t[d]}`);return k}function l(d){let h="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",k="",P=crypto$1.randomBytes(d);for(let p=0;p<d;p++){let g=P[p];g!==void 0&&(k+=h[g%62]);}return k}function f(d,h,k){let P=k??Date.now();P!==r&&(r=P,o=0),o++;let p=BigInt(P)*BigInt(4096)+BigInt(o);p=h?~p:p;let g=Buffer.alloc(6);for(let M=0;M<6;M++)g[M]=Number(p>>BigInt(40-8*M)&BigInt(255));return t[d]+"_"+g.toString("hex")+l(n-12)}u.create=f;function c(d){let h=d.split("_")[0];if(!h)return 0;let k=d.slice(h.length+1,h.length+13),P=BigInt("0x"+k);return Number(P/BigInt(4096))}u.timestamp=c;})(exports.Identifier||(exports.Identifier={}));exports.TruncateContent=void 0;(f=>{f.DEFAULT_MAX_CHARS=4e3,f.DIRECTION="head",f.DIR=chunkEN7LFV4R_cjs.d.join(process.env.EASBOT_DATA_PATH??`${process.cwd()}/data`,"context-output"),f.GLOB=chunkEN7LFV4R_cjs.d.join(f.DIR,"*");let o=10080*60*1e3;function i(c,u,d){return d?`[Content truncated. Source: ${d}
|
|
2
2
|
Full ${u} saved to: ${c}
|
|
3
3
|
Use Read tool with offset/limit parameters to view specific sections.]`:`[Content truncated. Full ${u} saved to: ${c}
|
|
4
|
-
Use Read tool with offset/limit parameters to view specific sections.]`}async function a(c,u={}){let d=u.maxChars??4e3,
|
|
4
|
+
Use Read tool with offset/limit parameters to view specific sections.]`}async function a(c,u={}){let d=u.maxChars??4e3,h=u.direction??f.DIRECTION,k=u.label??"content",P=u.sourcePath,p=chunkEN7LFV4R_cjs.d.join(process.env.EASBOT_DATA_PATH??`${process.cwd()}/data`,"context-output"),g=u.dir??p;if(c.length<=d)return {content:c,truncated:false};let M=exports.Identifier.ascending("context"),O=chunkEN7LFV4R_cjs.d.join(g,M);await me__default.default.mkdir(g,{recursive:true}).catch(()=>{}),await me__default.default.writeFile(O,c,"utf-8");let N=c.length-d,A;h==="head"?A=c.slice(0,d):A=c.slice(-d);let F=i(O,k,P),C=`${N} characters truncated`;return {content:h==="head"?`${A}
|
|
5
5
|
|
|
6
|
-
...${
|
|
6
|
+
...${C}...
|
|
7
7
|
|
|
8
|
-
${
|
|
8
|
+
${F}`:`...${C}...
|
|
9
9
|
|
|
10
|
-
${
|
|
10
|
+
${F}
|
|
11
11
|
|
|
12
|
-
${
|
|
13
|
-
`):e;for(let r=0;r<n.length;r++){let o=n[r];this.parseRule(o,r+1);}return this}parseRule(e,n){let r=e,o=e;if(r.length===0||r.startsWith("#"))return;let i=r.startsWith("!");if(i&&(r=r.slice(1)),r=r.trim(),r.length===0||(r.startsWith("\\#")&&(r=r.slice(1)),r.startsWith("#")))return;let a=r.startsWith("/");a&&(r=r.slice(1));let s=r.endsWith("/");s&&(r=r.slice(0,-1)),r.length!==0&&this.rules.push({pattern:r,negative:i,isDirectory:s,anchored:a,original:o,lineNumber:n});}ignores(e,n){let r=this.normalizePath(e),o=n??e.endsWith("/"),i=this.checkIgnore(r,o);return this.debug&&console.log(`Ignore.ignores("${e}", isDirectory=${o}) => ${i}`),i}checkIgnore(e,n){let r=false;for(let o of this.rules)o.isDirectory&&!n||this.matchPath(o,e)&&(o.negative?r=false:r=true);return r}matchPath(e,n){let r=this.ignorecase?n.toLowerCase():n,i=this.ignorecase?e.pattern.toLowerCase():e.pattern;if(e.anchored)return
|
|
12
|
+
${A}`,truncated:true,outputPath:O,originalLength:c.length,removedLength:N,label:k}}f.truncate=a;function s(c){return c.truncated?i(c.outputPath,c.label):""}f.formatHint=s;async function l(){let c=exports.Identifier.timestamp(exports.Identifier.create("context",false,Date.now()-o)),d=(await me__default.default.readdir(f.DIR).catch(()=>[])).filter(h=>h.startsWith("context_"));for(let h of d)exports.Identifier.timestamp(h)>=c||await me__default.default.unlink(chunkEN7LFV4R_cjs.d.join(f.DIR,h)).catch(()=>{});}f.cleanup=l;})(exports.TruncateContent||(exports.TruncateContent={}));chunkXBAP2B6J_cjs.e();exports.SessionTitle=void 0;(s=>{let t="New session - ",e="Child session - ";s.parentTitlePrefix=t,s.childTitlePrefix=e;function o(l=false){return (l?e:t)+chunkAUS6KQNI_cjs.b(new Date)}s.createDefault=o;function i(l){return new RegExp(`^(${t}|${e})\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}[+-]\\d{2}:\\d{2}$`).test(l)}s.isDefault=i;function a(l){let f=l.match(/^(.+) \(fork #(\d+)\)$/);if(f){let c=f[1]??"",u=parseInt(f[2]??"0",10);return `${c} (fork #${u+1})`}return `${l} (fork #1)`}s.getForked=a;})(exports.SessionTitle||(exports.SessionTitle={}));chunkXBAP2B6J_cjs.e();var ae=class ae extends Error{static create(e,n){var i;let r=xe__default.default.object({name:xe__default.default.literal(e),data:n}).meta({ref:e}),o=(i=class extends ae{constructor(s,l){super(e,l);chunkXBAP2B6J_cjs.c(this,"data",s);chunkXBAP2B6J_cjs.c(this,"name",e);this.name=e;}static isInstance(s){return s!==null&&typeof s=="object"&&"name"in s&&s.name===e}schema(){return r}toObject(){return {name:e,data:this.data}}},chunkXBAP2B6J_cjs.c(i,"Schema",r),i);return Object.defineProperty(o,"name",{value:e}),o}};chunkXBAP2B6J_cjs.c(ae,"Unknown",ae.create("UnknownError",xe__default.default.object({message:xe__default.default.string()})));var ze=ae;chunkXBAP2B6J_cjs.e();exports.Ignore=void 0;(e=>{function t(n){return new je(n)}e.create=t;})(exports.Ignore||(exports.Ignore={}));var je=class{constructor(e){chunkXBAP2B6J_cjs.c(this,"rules",[]);chunkXBAP2B6J_cjs.c(this,"ignorecase");chunkXBAP2B6J_cjs.c(this,"debug");this.ignorecase=e?.ignorecase??false,this.debug=e?.debug??false;}add(e){let n=typeof e=="string"?e.split(`
|
|
13
|
+
`):e;for(let r=0;r<n.length;r++){let o=n[r];this.parseRule(o,r+1);}return this}parseRule(e,n){let r=e,o=e;if(r.length===0||r.startsWith("#"))return;let i=r.startsWith("!");if(i&&(r=r.slice(1)),r=r.trim(),r.length===0||(r.startsWith("\\#")&&(r=r.slice(1)),r.startsWith("#")))return;let a=r.startsWith("/");a&&(r=r.slice(1));let s=r.endsWith("/");s&&(r=r.slice(0,-1)),r.length!==0&&this.rules.push({pattern:r,negative:i,isDirectory:s,anchored:a,original:o,lineNumber:n});}ignores(e,n){let r=this.normalizePath(e),o=n??e.endsWith("/"),i=this.checkIgnore(r,o);return this.debug&&console.log(`Ignore.ignores("${e}", isDirectory=${o}) => ${i}`),i}checkIgnore(e,n){let r=false;for(let o of this.rules)o.isDirectory&&!n||this.matchPath(o,e)&&(o.negative?r=false:r=true);return r}matchPath(e,n){let r=this.ignorecase?n.toLowerCase():n,i=this.ignorecase?e.pattern.toLowerCase():e.pattern;if(e.anchored)return chunkEN7LFV4R_cjs.a.match(r,i);if(i.includes("/"))return chunkEN7LFV4R_cjs.a.match(r,i);let a=r.split("/");for(let s of a)if(chunkEN7LFV4R_cjs.a.match(s,i))return true;return false}filter(e){return e.filter(n=>!this.ignores(n))}createFilter(){return e=>!this.ignores(e)}normalizePath(e){let n=e.replace(/\\/g,"/");if(n==="/")return "";for(;n.startsWith("./");)n=n.slice(2);return n.endsWith("/")&&n.length>1&&(n=n.slice(0,-1)),n}};chunkXBAP2B6J_cjs.e();function dt(t,e){let n=r=>{let o;try{o=t.parse(r);}catch(i){throw console.trace("schema validation failure stack trace:"),i instanceof xe.z.ZodError&&console.error("schema validation issues:",JSON.stringify(i.issues,null,2)),i}return e(o)};return n.force=r=>e(r),n.schema=t,n}var ln=dt;exports.Fn=void 0;(e=>e.fn=dt)(exports.Fn||(exports.Fn={}));chunkXBAP2B6J_cjs.e();function fn(t={}){let e=t.isDevelopment??false,n=e?".env.dev":".env",r=t.globalConfigPath??(xdgBasedir.xdgConfig?He__default.default.join(xdgBasedir.xdgConfig,"easbot"):void 0),o=t.projectRoot??process.cwd(),i=o?He__default.default.join(o,".easbot"):void 0,a=[{root:r,label:"global"},{root:o,label:"project"},{root:i,label:"workspace"}];for(let{root:s}of a){if(!s)continue;let l=He__default.default.join(s,n);if(!fs.existsSync(l))continue;let f=dotenv.config({path:l,override:true,debug:e,encoding:"utf-8",quiet:!e});if(e&&f.parsed){let u=["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","EASBOT_BIN_PATH"].filter(d=>d in f.parsed);u.length>0&&console.warn(`[loadEnv] ${l} contains keys that have no effect: ${u.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.`);}}}
|
|
16
|
-
`?o=s:/\s/.test(l)&&(i=s));}}return {lastNewline:o,lastWhitespace:i}}function
|
|
15
|
+
How to override: export them in the shell before loadEnv() runs, or set process.env directly.`);}}}chunkXBAP2B6J_cjs.e();async function dn(t,e){if(process.env.EASBOT_CLIENT==="acp")try{let i=process.platform==="win32"?"cmd":void 0,a=chunk3U5YF6EI_cjs.G.spawn(i,`git ${t.join(" ")}`,{stdin:void 0,stdout:"pipe",stderr:"pipe",cwd:e.cwd,env:e.env?{...process.env,...e.env}:process.env}),[s,l,f]=await Promise.all([a.exited,new Response(a.stdout).arrayBuffer(),new Response(a.stderr).arrayBuffer()]),c=Buffer.from(l),u=Buffer.from(f);return {exitCode:s,text:()=>c.toString(),stdout:c,stderr:u}}catch(i){let a=Buffer.from(i instanceof Error?i.message:String(i));return {exitCode:1,text:()=>"",stdout:Buffer.alloc(0),stderr:a}}let n=e.env?{...process.env,...e.env}:void 0,r=chunk3U5YF6EI_cjs.G.$`git ${t.join(" ")}`.quiet().nothrow().cwd(e.cwd);n&&(r=r.env(n));let o=await r;return {exitCode:o.exitCode,text:()=>o.text(),stdout:o.stdout,stderr:o.stderr}}chunkXBAP2B6J_cjs.e();function ht(t){return t?He.dirname(url.fileURLToPath(t)):typeof __dirname<"u"?__dirname:process.cwd()}function mt(t,e,n=3){function r(o,i){if(i>n||!fs.existsSync(o))return null;try{let a=fs.readdirSync(o);for(let s of a){let l=He.join(o,s);try{let f=fs.statSync(l);if(f.isFile()&&l.endsWith(e))return l;if(f.isDirectory()&&i<n){let c=r(l,i+1);if(c)return c}}catch{}}}catch{}return null}return r(t,0)}function gt(t,e){let n=He.join(t,e);if(fs.existsSync(n))return n;let r=e.split("/").pop()||e,o=t;for(let i=0;i<5;i++){let a=He.join(o,"assets","txt");if(fs.existsSync(a)){let f=mt(a,r,5);if(f)return f}let s=He.join(o,"dist","assets","txt");if(fs.existsSync(s)){let f=mt(s,r,5);if(f)return f}let l=He.join(o,"..");if(l===o)break;o=l;}return n}function yn(t,e){return chunk3U5YF6EI_cjs.c.lazy(()=>{try{let n=ht(e),r=gt(n,t);return chunk3U5YF6EI_cjs.D.file(r).textSync()}catch(n){throw console.error(`Failed to load text file: ${t}`,n),n}})}function bn(t,e){return chunk3U5YF6EI_cjs.c.lazy(async()=>{try{let n=ht(e),r=gt(n,t);return await chunk3U5YF6EI_cjs.D.file(r).text()}catch(n){throw console.error(`Failed to load text file: ${t}`,n),n}})}chunkXBAP2B6J_cjs.e();function xn(t){return t()}chunkXBAP2B6J_cjs.e();function kn(t){if(!t||typeof t!="string")return {provider:"",model:""};let e=t.indexOf("/");return e===-1?{provider:"",model:t}:{provider:t.substring(0,e),model:t.substring(e+1)}}chunkXBAP2B6J_cjs.e();chunkXBAP2B6J_cjs.e();chunkXBAP2B6J_cjs.e();function Ue(t,e,n,r=()=>true){let o=-1,i=-1,a=0;for(let s=e;s<n;s++){if(!r(s))continue;let l=t[s];if(l){if(l==="("){a+=1;continue}if(l===")"&&a>0){a-=1;continue}a===0&&(l===`
|
|
16
|
+
`?o=s:/\s/.test(l)&&(i=s));}}return {lastNewline:o,lastWhitespace:i}}function wn(t,e){if(!t)return [];if(e<=0)return [t];if(t.length<=e)return [t]}function ee(t,e,n){try{let r=xe.z.string().parse(t),o=xe.z.number().int().parse(e),i=wn(r,o);if(i)return i;let a=qe(r,o,s=>{let{lastNewline:l,lastWhitespace:f}=Ue(s,0,s.length);return l>0?l:f});return n?.minLength&&n.minLength>0&&(a=bt(a,n.minLength)),a}catch(r){return console.warn("Invalid input for chunkText:",r),typeof t=="string"&&t.length>0?[t]:[]}}function bt(t,e){if(t.length<=1||e<=0)return t;let n=[],r=t[0]??"";for(let o=1;o<t.length;o++){let i=t[o]??"";r.length<e?r=r+`
|
|
17
17
|
|
|
18
18
|
`+i:(n.push(r),r=i);}if(r.length>0)if(r.length<e&&n.length>0){let o=n.pop();n.push(o+`
|
|
19
19
|
|
|
20
|
-
`+r);}else n.push(r);return n}function
|
|
20
|
+
`+r);}else n.push(r);return n}function qe(t,e,n){if(!t)return [];if(e<=0||t.length<=e)return [t];let r=[],o=t;for(;o.length>e;){let i=o.slice(0,e),a=n(i),s=Number.isFinite(a)&&a>0&&a<=e?a:e,f=o.slice(0,s).trimEnd();f.length>0&&r.push(f);let c=s<o.length&&o[s]!==void 0&&/\s/.test(o[s]),u=Math.min(o.length,s+(c?1:0));o=o.slice(u).trimStart();}return o.length>0&&r.push(o),r}chunkXBAP2B6J_cjs.e();var Ge=xe.z.enum(["bold","italic","strikethrough","code","code_block","spoiler","blockquote"]),xt=xe.z.object({start:xe.z.number().int().min(0),end:xe.z.number().int().min(0),style:Ge}).strict().refine(t=>t.end>=t.start,{message:"end must be greater than or equal to start"}),kt=xe.z.object({start:xe.z.number().int().min(0),end:xe.z.number().int().min(0),href:xe.z.string().min(1)}).strict().refine(t=>t.end>=t.start,{message:"end must be greater than or equal to start"}),ce=xe.z.object({text:xe.z.string(),styles:xe.z.array(xt),links:xe.z.array(kt)}).strict(),ue=xe.z.enum(["off","bullets","code"]),we=xe.z.object({linkify:xe.z.boolean().default(true),enableSpoilers:xe.z.boolean().default(false),headingStyle:xe.z.enum(["none","bold"]).default("none"),blockquotePrefix:xe.z.string().default(""),autolink:xe.z.boolean().default(true),tableMode:ue.default("off")}).partial().default({}),wt=xe.z.object({open:xe.z.string(),close:xe.z.string()}).strict(),Ye=xe.z.object({styleMarkers:xe.z.record(Ge,wt).optional(),escapeText:xe.z.any().optional(),buildLink:xe.z.any().optional()}).strict();xe.z.object({start:xe.z.number().int().min(0),end:xe.z.number().int().min(0),open:xe.z.string(),close:xe.z.string()}).strict();var Xe=xe.z.object({indentSize:xe.z.number().int().min(1).default(2),listMarker:xe.z.enum(["\u2022","-","*"]).default("\u2022"),codeBlockMarker:xe.z.enum(["```","~~~"]).default("```"),preserveFrontmatter:xe.z.boolean().default(true)}).strict(),Ve=xe.z.record(xe.z.string(),xe.z.string()),Se=xe.z.object({open:xe.z.boolean(),ticks:xe.z.number().int().min(0)}).strict();xe.z.object({inlineState:Se,isInside:xe.z.any()}).strict();xe.z.object({start:xe.z.number().int().min(0),end:xe.z.number().int().min(0),openLine:xe.z.string(),marker:xe.z.string(),indent:xe.z.string()}).strict();xe.z.object({tables:ue.optional()}).strict();function Pn(t){let e=new In__default.default({html:false,linkify:t.linkify??true,breaks:false,typographer:false});return e.enable("strikethrough"),t.tableMode&&t.tableMode!=="off"?e.enable("table"):e.disable("table"),t.autolink===false&&e.disable("autolink"),e}function St(t,e){if(t.attrGet)return t.attrGet(e);if(t.attrs){for(let[n,r]of t.attrs)if(n===e)return r}return null}function Je(t,e){return {...t,type:"text",content:e,children:void 0}}function vn(t){for(let e of t)e.children&&e.children.length>0&&(e.children=On(e.children));}function On(t){let e=0;for(let a of t){if(a.type!=="text")continue;let s=a.content??"",l=0;for(;l<s.length;){let f=s.indexOf("||",l);if(f===-1)break;e+=1,l=f+2;}}if(e<2)return t;let n=e-e%2,r=[],o={spoilerOpen:false},i=0;for(let a of t){if(a.type!=="text"){r.push(a);continue}let s=a.content??"";if(!s.includes("||")){r.push(a);continue}let l=0;for(;l<s.length;){let f=s.indexOf("||",l);if(f===-1){l<s.length&&r.push(Je(a,s.slice(l)));break}if(i>=n){r.push(Je(a,s.slice(l)));break}f>l&&r.push(Je(a,s.slice(l,f))),i+=1,o.spoilerOpen=!o.spoilerOpen,r.push({type:o.spoilerOpen?"spoiler_open":"spoiler_close"}),l=f+2;}}return r}function Fn(){return {text:"",styles:[],openStyles:[],links:[],linkStack:[]}}function Z(t){return t.table?.currentCell??t}function Te(t,e){if(!e)return;let n=Z(t);n.text+=e;}function te(t,e){let n=Z(t);n.openStyles.push({style:e,start:n.text.length});}function ne(t,e){let n=Z(t);for(let r=n.openStyles.length-1;r>=0;r-=1){let o=n.openStyles[r];if(o?.style===e){let i=o.start;n.openStyles.splice(r,1);let a=n.text.length;a>i&&n.styles.push({start:i,end:a,style:e});return}}}function Tt(t){t.env.listStack.length>0||t.table||(t.text+=`
|
|
21
21
|
|
|
22
|
-
`);}function
|
|
23
|
-
`);}function
|
|
24
|
-
`;}for(let a=1;a<o.length;a++)
|
|
25
|
-
`;}else for(let o of n){for(let i=0;i<o.length;i++)
|
|
26
|
-
`;}}function
|
|
22
|
+
`);}function En(t){let e=t.env.listStack,n=e[e.length-1];if(!n)return;n.index+=1;let r=" ".repeat(Math.max(0,e.length-1)),o=n.type==="ordered"?`${n.index}. `:"\u2022 ";t.text+=`${r}${o}`;}function _n(t,e){if(!e)return;let n=Z(t),r=n.text.length;n.text+=e,n.styles.push({start:r,end:r+e.length,style:"code"});}function Cn(t,e){let n=e??"",r=Z(t),o=r.text.length;r.text+=n,r.styles.push({start:o,end:o+n.length,style:"code_block"});}function An(t){let e=Z(t),n=e.linkStack.pop();if(!n?.href)return;let r=n.href.trim();if(!r)return;let o=n.labelStart,i=e.text.length;if(i<=o){e.links.push({start:o,end:i,href:r});return}e.links.push({start:o,end:i,href:r});}function Ln(){return {headers:[],rows:[],currentRow:[],currentCell:null,inHeader:false}}function Dn(t){return Rt(t),{text:t.text,styles:t.styles,links:t.links}}function Me(t){let e=t.text,n=0,r=e.length;for(;n<r&&/\s/.test(e[n]??"");)n+=1;for(;r>n&&/\s/.test(e[r-1]??"");)r-=1;if(n===0&&r===e.length)return t;let o=e.slice(n,r),i=o.length,a=[];for(let l of t.styles){let f=Math.max(0,l.start-n),c=Math.min(i,l.end-n);c>f&&a.push({start:f,end:c,style:l.style});}let s=[];for(let l of t.links){let f=Math.max(0,l.start-n),c=Math.min(i,l.end-n);c>f&&s.push({start:f,end:c,href:l.href});}return {text:o,styles:a,links:s}}function Ke(t,e){if(!e.text)return;let n=t.text.length;t.text+=e.text;for(let r of e.styles)t.styles.push({start:n+r.start,end:n+r.end,style:r.style});for(let r of e.links)t.links.push({start:n+r.start,end:n+r.end,href:r.href});}function $n(t,e){e.text&&(t.text+=e.text);}function Mt(t,e){let{header:n,value:r,columnIndex:o,includeColumnFallback:i}=e;r?.text&&(t.text+="\u2022 ",n?.text?(Ke(t,n),t.text+=": "):i&&(t.text+=`Column ${o}: `),Ke(t,r),t.text+=`
|
|
23
|
+
`);}function Nn(t){if(!t.table)return;let e=t.table.headers.map(Me),n=t.table.rows.map(o=>o.map(Me));if(e.length===0&&n.length===0)return;if(e.length>1&&n.length>0)for(let o of n){if(o.length===0)continue;let i=o[0];if(i?.text){let a=t.text.length;Ke(t,i);let s=t.text.length;s>a&&t.styles.push({start:a,end:s,style:"bold"}),t.text+=`
|
|
24
|
+
`;}for(let a=1;a<o.length;a++)Mt(t,{header:e[a],value:o[a],columnIndex:a,includeColumnFallback:true});t.text+=`
|
|
25
|
+
`;}else for(let o of n){for(let i=0;i<o.length;i++)Mt(t,{header:e[i],value:o[i],columnIndex:i,includeColumnFallback:false});t.text+=`
|
|
26
|
+
`;}}function zn(t){if(!t.table)return;let e=t.table.headers.map(Me),n=t.table.rows.map(c=>c.map(Me)),r=Math.max(e.length,...n.map(c=>c.length));if(r===0)return;let o=Array.from({length:r},()=>0),i=c=>{for(let u=0;u<r;u+=1){let h=c[u]?.text.length??0;(o[u]??0)<h&&(o[u]=h);}};i(e);for(let c of n)i(c);let a=t.text.length,s=c=>{t.text+="|";for(let u=0;u<r;u+=1){t.text+=" ";let d=c[u];d&&$n(t,d);let h=d?.text.length??0,P=(o[u]??0)-h;P>0&&(t.text+=" ".repeat(P)),t.text+=" |";}t.text+=`
|
|
27
27
|
`;},l=()=>{t.text+="|";for(let c=0;c<r;c+=1){let u=o[c]??0,d=Math.max(3,u);t.text+=` ${"-".repeat(d)} |`;}t.text+=`
|
|
28
|
-
`;};s(e),l();for(let c of n)s(c);let
|
|
29
|
-
`);break;case "paragraph_close":
|
|
28
|
+
`;};s(e),l();for(let c of n)s(c);let f=t.text.length;f>a&&t.styles.push({start:a,end:f,style:"code_block"});}function Ze(t,e){for(let n of t)switch(n.type){case "inline":n.children&&Ze(n.children,e);break;case "text":Te(e,n.content??"");break;case "em_open":te(e,"italic");break;case "em_close":ne(e,"italic");break;case "strong_open":te(e,"bold");break;case "strong_close":ne(e,"bold");break;case "s_open":te(e,"strikethrough");break;case "s_close":ne(e,"strikethrough");break;case "code_inline":_n(e,n.content??"");break;case "spoiler_open":e.enableSpoilers&&te(e,"spoiler");break;case "spoiler_close":e.enableSpoilers&&ne(e,"spoiler");break;case "link_open":{let r=St(n,"href")??"",o=Z(e);o.linkStack.push({href:r,labelStart:o.text.length});break}case "link_close":An(e);break;case "image":Te(e,n.content??"");break;case "softbreak":case "hardbreak":Te(e,`
|
|
29
|
+
`);break;case "paragraph_close":Tt(e);break;case "heading_open":e.headingStyle==="bold"&&te(e,"bold");break;case "heading_close":e.headingStyle==="bold"&&ne(e,"bold"),Tt(e);break;case "blockquote_open":e.blockquotePrefix&&(e.text+=e.blockquotePrefix),te(e,"blockquote");break;case "blockquote_close":ne(e,"blockquote");break;case "bullet_list_open":e.env.listStack.length>0&&(e.text+=`
|
|
30
30
|
`),e.env.listStack.push({type:"bullet",index:0});break;case "bullet_list_close":e.env.listStack.pop(),e.env.listStack.length===0&&(e.text+=`
|
|
31
31
|
`);break;case "ordered_list_open":{e.env.listStack.length>0&&(e.text+=`
|
|
32
|
-
`);let r=Number(
|
|
33
|
-
`);break;case "list_item_open":
|
|
32
|
+
`);let r=Number(St(n,"start")??"1");e.env.listStack.push({type:"ordered",index:r-1});break}case "ordered_list_close":e.env.listStack.pop(),e.env.listStack.length===0&&(e.text+=`
|
|
33
|
+
`);break;case "list_item_open":En(e);break;case "list_item_close":e.text.endsWith(`
|
|
34
34
|
`)||(e.text+=`
|
|
35
|
-
`);break;case "code_block":case "fence":
|
|
35
|
+
`);break;case "code_block":case "fence":Cn(e,n.content??"");break;case "html_block":case "html_inline":Te(e,n.content??"");break;case "table_open":e.tableMode!=="off"&&(e.table=Ln(),e.hasTables=true);break;case "table_close":e.table&&(e.tableMode==="bullets"?Nn(e):e.tableMode==="code"&&zn(e)),e.table=null;break;case "thead_open":e.table&&(e.table.inHeader=true);break;case "thead_close":e.table&&(e.table.inHeader=false);break;case "tbody_open":case "tbody_close":break;case "tr_open":e.table&&(e.table.currentRow=[]);break;case "tr_close":e.table&&(e.table.inHeader?e.table.headers=e.table.currentRow:e.table.rows.push(e.table.currentRow),e.table.currentRow=[]);break;case "th_open":case "td_open":e.table&&(e.table.currentCell=Fn());break;case "th_close":case "td_close":e.table?.currentCell&&(e.table.currentRow.push(Dn(e.table.currentCell)),e.table.currentCell=null);break;case "hr":e.text+=`\u2500\u2500\u2500
|
|
36
36
|
|
|
37
|
-
`;break;default:n.children&&
|
|
38
|
-
`);let
|
|
37
|
+
`;break;default:n.children&&Ze(n.children,e);break}}function Rt(t){for(let e=t.openStyles.length-1;e>=0;e-=1){let n=t.openStyles[e];if(!n)continue;let r=t.text.length;r>n.start&&t.styles.push({start:n.start,end:r,style:n.style});}t.openStyles=[];}function Bn(t,e){let n=[];for(let r of t){let o=Math.max(0,Math.min(r.start,e)),i=Math.max(o,Math.min(r.end,e));i>o&&n.push({start:o,end:i,style:r.style});}return n}function jn(t,e){let n=[];for(let r of t){let o=Math.max(0,Math.min(r.start,e)),i=Math.max(o,Math.min(r.end,e));i>o&&n.push({start:o,end:i,href:r.href});}return n}function It(t){let e=[...t].toSorted((r,o)=>r.start!==o.start?r.start-o.start:r.end!==o.end?r.end-o.end:r.style.localeCompare(o.style)),n=[];for(let r of e){let o=n[n.length-1];if(o&&o.style===r.style&&(r.start<o.end||r.start===o.end&&r.style!=="blockquote")){o.end=Math.max(o.end,r.end);continue}n.push({...r});}return n}function Pt(t,e,n){let r=Math.max(t.start,e),o=Math.min(t.end,n);return o<=r?null:{start:r,end:o}}function Wn(t,e,n){if(t.length===0)return [];let r=[];for(let o of t){let i=Pt(o,e,n);i&&r.push({start:i.start-e,end:i.end-e,style:o.style});}return It(r)}function Hn(t,e,n){if(t.length===0)return [];let r=[];for(let o of t){let i=Pt(o,e,n);i&&r.push({start:i.start-e,end:i.end-e,href:o.href});}return r}function re(t,e){try{let n=typeof t=="string"?t:"",r=we.parse(e??{});return fe(n,r).ir}catch(n){return console.error("Markdown parse error:",n),{text:"",styles:[],links:[]}}}function fe(t,e){try{let n=typeof t=="string"?t:"",r=we.parse(e),o={listStack:[]},a=Pn(r).parse(n||"",o);r.enableSpoilers&&vn(a);let s=r.tableMode??"off",l={text:"",styles:[],openStyles:[],links:[],linkStack:[],env:o,headingStyle:r.headingStyle??"none",blockquotePrefix:r.blockquotePrefix??"",enableSpoilers:r.enableSpoilers??!1,tableMode:s,table:null,hasTables:!1};Ze(a,l),Rt(l);let c=l.text.trimEnd().length,u=0;for(let k of l.styles)k.style==="code_block"&&k.end>u&&(u=k.end);let d=Math.max(c,u);return {ir:{text:d===l.text.length?l.text:l.text.slice(0,d),styles:It(Bn(l.styles,d)),links:jn(l.links,d)},hasTables:l.hasTables}}catch(n){return console.error("Markdown parse error:",n),{ir:{text:"",styles:[],links:[]},hasTables:false}}}function vt(t,e){try{let n=ce.parse(t),r=typeof e=="number"&&e>0?e:0;if(!n.text)return [];if(r<=0||n.text.length<=r)return [n];let o=ee(n.text,r),i=[],a=0;return o.forEach((s,l)=>{if(!s)return;if(l>0)for(;a<n.text.length&&/\s/.test(n.text[a]??"");)a+=1;let f=a,c=Math.min(n.text.length,f+s.length);i.push({text:s,styles:Wn(n.styles,f,c),links:Hn(n.links,f,c)}),a=c;}),i}catch(n){return console.error("Chunk IR error:",n),[]}}chunkXBAP2B6J_cjs.e();var Un={bold:{open:"**",close:"**"},italic:{open:"*",close:"*"},strikethrough:{open:"~~",close:"~~"},code:{open:"`",close:"`"},code_block:{open:"```\n",close:"```"},spoiler:{open:"||",close:"||"},blockquote:{open:"> ",close:""}};function de(t,e){try{let n=ce.parse(t),r=Ye.parse(e??{});if(!n.text)return "";let o=r.styleMarkers??Un,i=r.escapeText??(u=>u),a=r.buildLink,s=[];for(let u=0;u<n.styles.length;u++){let d=n.styles[u];d&&(s.push({position:d.start,type:"open",style:d.style,spanIndex:u}),s.push({position:d.end,type:"close",style:d.style,spanIndex:u}));}for(let u=0;u<n.links.length;u++){let d=n.links[u];d&&(s.push({position:d.start,type:"link_open",spanIndex:u,href:d.href}),s.push({position:d.end,type:"link_close",spanIndex:u,href:d.href}));}s.sort((u,d)=>{if(u.position!==d.position)return u.position-d.position;let h=(M,O)=>M==="link_open"?0:M==="open"?1:M==="close"?2:M==="link_close"?3:4,k=u.type==="close"||u.type==="link_close",P=d.type==="close"||d.type==="link_close",p=h(u.type,k),g=h(d.type,P);return p!==g?p-g:u.type==="open"&&d.type==="open"?u.spanIndex-d.spanIndex:u.type==="close"&&d.type==="close"?d.spanIndex-u.spanIndex:u.spanIndex-d.spanIndex});let l="",f=0,c=[];for(let u of s){if(u.position>f){let d=n.text.slice(f,u.position);l+=i?i(d):d;}if(u.type==="open"||u.type==="close"){let d=o[u.style];if(d)if(u.type==="open")l+=d.open,c.push(u);else {l+=d.close,u.style==="code_block"&&u.position<n.text.length&&(l+=`
|
|
38
|
+
`);let h=c.findIndex(k=>k.spanIndex===u.spanIndex&&k.type==="open");h!==-1&&c.splice(h,1);}}else if(u.type==="link_open")l+="[",c.push(u);else if(u.type==="link_close"){l+="]("+u.href+")";let d=c.findIndex(h=>h.spanIndex===u.spanIndex&&h.type==="link_open");d!==-1&&c.splice(d,1);}f=u.position;}if(f<n.text.length){let u=n.text.slice(f);l+=i?i(u):u;}return l}catch(n){return console.error("Markdown render error:",n),""}}function oe(t,e){return de(t,e)}chunkXBAP2B6J_cjs.e();function qn(t){let e=t.replace(/\r\n/g,`
|
|
39
39
|
`).replace(/\r/g,`
|
|
40
40
|
`);if(!e.startsWith("---"))return {frontmatter:"",content:t};let n=e.indexOf(`
|
|
41
|
-
---`,3);if(n===-1)return {frontmatter:"",content:t};let r=e.slice(0,n+4),o=e.slice(n+4).trimStart();return {frontmatter:r,content:o}}function
|
|
41
|
+
---`,3);if(n===-1)return {frontmatter:"",content:t};let r=e.slice(0,n+4),o=e.slice(n+4).trimStart();return {frontmatter:r,content:o}}function Re(t,e){try{let n=typeof t=="string"?t:"",r=Xe.parse(e??{});if(!n)return "";let{frontmatter:o,content:i}=qn(n),a=re(i,{linkify:!0,enableSpoilers:!1,autolink:!0,headingStyle:"none",blockquotePrefix:"",tableMode:"off"}),s=oe(a);return s=s.replace(/\n{3,}/g,`
|
|
42
42
|
|
|
43
43
|
`),s=s.trimEnd()+`
|
|
44
44
|
`,r.preserveFrontmatter&&o&&(s=o+`
|
|
45
|
-
`+s),s}catch(n){return console.error("Markdown format error:",n),t}}
|
|
46
|
-
`).trim(),linesConsumed:r-e}}function
|
|
47
|
-
`),r=0;for(;r<n.length;){let o=n[r];if(!o){r+=1;continue}let i=o.match(/^([\w-]+):\s*(.*)$/);if(!i?.[1]||!i[2]){r+=1;continue}let a=i[1],s=i[2].trim();if(!a){r+=1;continue}if(!s&&r+1<n.length){let
|
|
45
|
+
`+s),s}catch(n){return console.error("Markdown format error:",n),t}}chunkXBAP2B6J_cjs.e();function Gn(t){return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t}function Yn(t){if(t!=null){if(typeof t=="string")return {value:t.trim(),kind:"scalar"};if(typeof t=="number"||typeof t=="boolean")return {value:String(t),kind:"scalar"};if(typeof t=="object")try{return {value:JSON.stringify(t),kind:"structured"}}catch{return}}}function Xn(t){try{let e=Ot__default.default.parse(t,{schema:"core"});if(!e||typeof e!="object"||Array.isArray(e))return null;let n={};for(let[r,o]of Object.entries(e)){let i=r.trim();if(!i)continue;let a=Yn(o);a&&(n[i]=a);}return n}catch{return null}}function Vn(t,e){let n=[],r=e+1;for(;r<t.length;){let i=t[r];if(!i){r+=1;continue}if(i.length>0&&!i.startsWith(" ")&&!i.startsWith(" "))break;n.push(i),r+=1;}return {value:n.join(`
|
|
46
|
+
`).trim(),linesConsumed:r-e}}function Jn(t){let e={},n=t.split(`
|
|
47
|
+
`),r=0;for(;r<n.length;){let o=n[r];if(!o){r+=1;continue}let i=o.match(/^([\w-]+):\s*(.*)$/);if(!i?.[1]||!i[2]){r+=1;continue}let a=i[1],s=i[2].trim();if(!a){r+=1;continue}if(!s&&r+1<n.length){let f=n[r+1];if(f&&(f.startsWith(" ")||f.startsWith(" "))){let{value:c,linesConsumed:u}=Vn(n,r);c&&(e[a]={value:c,kind:"multiline",rawInline:s}),r+=u;continue}}let l=Gn(s);l&&(e[a]={value:l,kind:"inline",rawInline:s}),r+=1;}return e}function Kn(t){let e={};for(let[n,r]of Object.entries(t))e[n]=r.value;return e}function Zn(t){return /^[|>][+-]?(\d+)?[+-]?$/.test(t)}function Qn(t){let{lineEntry:e,yamlValue:n}=t;return n.kind!=="structured"||e.kind!=="inline"||Zn(e.rawInline)?false:e.value.includes(":")}function er(t){let e=t.replace(/\r\n/g,`
|
|
48
48
|
`).replace(/\r/g,`
|
|
49
49
|
`);if(!e.startsWith("---"))return;let n=e.indexOf(`
|
|
50
|
-
---`,3);if(n!==-1)return e.slice(4,n)}function
|
|
51
|
-
${
|
|
52
|
-
---`}catch(e){return console.warn("Failed to serialize frontmatter:",e),""}}function
|
|
50
|
+
---`,3);if(n!==-1)return e.slice(4,n)}function pe(t){try{if(typeof t!="string")return {};let e=er(t);if(!e)return {};let n=Jn(e),r=Xn(e);if(r===null)return Kn(n);let o={};for(let[i,a]of Object.entries(r)){o[i]=a.value;let s=n[i];s&&Qn({lineEntry:s,yamlValue:a})&&(o[i]=s.value);}for(let[i,a]of Object.entries(n))i in o||(o[i]=a.value);return o}catch(e){return console.warn("Failed to parse frontmatter:",e),{}}}function Ie(t){try{let e=Ve.parse(t);if(Object.keys(e).length===0)return "";let n={};for(let[o,i]of Object.entries(e))try{let a=JSON.parse(i);n[o]=a;}catch{n[o]=i;}return `---
|
|
51
|
+
${Ot__default.default.stringify(n,{lineWidth:0,defaultStringType:"QUOTE_DOUBLE"}).trim()}
|
|
52
|
+
---`}catch(e){return console.warn("Failed to serialize frontmatter:",e),""}}function Pe(t){try{if(typeof t!="string")return {frontmatter:{},content:""};let e=t.replace(/\r\n/g,`
|
|
53
53
|
`).replace(/\r/g,`
|
|
54
54
|
`);if(!e.startsWith("---"))return {frontmatter:{},content:t};let n=e.indexOf(`
|
|
55
|
-
---`,3);if(n===-1)return {frontmatter:{},content:t};let r=e.slice(4,n),o=e.slice(n+4).trimStart();return {frontmatter:
|
|
56
|
-
`,o),a=i===-1?e.length:i,s=e.slice(o,a),l=s.match(/^( {0,3})(`{3,}|~{3,})(.*)$/);if(l){let
|
|
57
|
-
Content-Type: ${
|
|
55
|
+
---`,3);if(n===-1)return {frontmatter:{},content:t};let r=e.slice(4,n),o=e.slice(n+4).trimStart();return {frontmatter:pe(t),content:o}}catch(e){return console.warn("Failed to extract frontmatter:",e),{frontmatter:{},content:t}}}chunkXBAP2B6J_cjs.e();chunkXBAP2B6J_cjs.e();function ve(t){try{let e=xe.z.string().parse(t),n=[],r,o=0;for(;o<=e.length;){let i=e.indexOf(`
|
|
56
|
+
`,o),a=i===-1?e.length:i,s=e.slice(o,a),l=s.match(/^( {0,3})(`{3,}|~{3,})(.*)$/);if(l){let f=l[1],c=l[2];if(!f||!c){o=a+1;continue}let u=c[0];if(!u){o=a+1;continue}let d=c.length;if(!r)r={start:o,markerChar:u,markerLen:d,openLine:s,marker:c,indent:f};else if(r.markerChar===u&&d>=r.markerLen){let h=a;n.push({start:r.start,end:h,openLine:r.openLine,marker:r.marker,indent:r.indent}),r=void 0;}}if(i===-1)break;o=i+1;}return r&&n.push({start:r.start,end:e.length,openLine:r.openLine,marker:r.marker,indent:r.indent}),n}catch(e){return console.warn("Invalid input for parseFenceSpans:",e),[]}}function Qe(t,e){let n=0,r=t.length-1;for(;n<=r;){let o=Math.floor((n+r)/2),i=t[o];if(!i)break;if(e<=i.start){r=o-1;continue}if(e>=i.end){n=o+1;continue}return i}}function Ft(t,e){return !Qe(t,e)}function Oe(){return {open:false,ticks:0}}function Fe(t,e){try{let n=xe.z.string().parse(t),r=e?Se.parse(e):Oe(),o=ve(n),i={open:r.open,ticks:r.ticks},{spans:a,state:s}=rr(n,o,i);return {inlineState:s,isInside:l=>sr(l,o)||ir(l,a)}}catch(n){return console.warn("Invalid input for buildCodeSpanIndex:",n),{inlineState:Oe(),isInside:()=>false}}}function rr(t,e,n){let r=[],o=n.open,i=n.ticks,a=o?0:-1,s=0;for(;s<t.length;){let l=or(e,s);if(l){s=l.end;continue}if(t[s]!=="`"){s+=1;continue}let f=s,c=0;for(;s<t.length&&t[s]==="`";)c+=1,s+=1;if(!o){o=true,i=c,a=f;continue}c===i&&(r.push([a,s]),o=false,i=0,a=-1);}return o&&r.push([a,t.length]),{spans:r,state:{open:o,ticks:i}}}function or(t,e){return t.find(n=>e>=n.start&&e<n.end)}function sr(t,e){return e.some(n=>t>=n.start&&t<n.end)}function ir(t,e){return e.some(([n,r])=>t>=n&&t<r)}chunkXBAP2B6J_cjs.e();var lr={bold:{open:"**",close:"**"},italic:{open:"_",close:"_"},strikethrough:{open:"~~",close:"~~"},code:{open:"`",close:"`"},code_block:{open:"```\n",close:"```"},spoiler:{open:"||",close:"||"},blockquote:{open:"> ",close:""}};function Ee(t,e){try{let n=xe.z.string().parse(t),r=ue.parse(e);if(!n||r==="off")return n;let{ir:o,hasTables:i}=fe(n,{linkify:!1,enableSpoilers:!1,autolink:!1,headingStyle:"none",blockquotePrefix:"",tableMode:r});return i?de(o,{styleMarkers:lr,escapeText:a=>a,buildLink:(a,s)=>{let l=a.href.trim();return !l||!s.slice(a.start,a.end)?null:{start:a.start,end:a.end,open:"[",close:`](${l})`}}}):n}catch(n){return console.warn("Invalid input for convertMarkdownTables:",n),typeof t=="string"?t:""}}exports.Markdown=void 0;(f=>{function t(c,u){try{return re(c,u)}catch(d){return console.warn("Markdown.parse error:",d),{text:"",styles:[],links:[]}}}f.parse=t;function e(c,u){try{return oe(c,u)}catch(d){return console.warn("Markdown.render error:",d),""}}f.render=e;function n(c,u){try{return Re(c,u)}catch(d){return console.warn("Markdown.format error:",d),typeof c=="string"?c:""}}f.format=n;function r(c){try{return pe(c)}catch(u){return console.warn("Markdown.parseFrontmatter error:",u),{}}}f.parseFrontmatter=r;function o(c){try{return Ie(c)}catch(u){return console.warn("Markdown.serializeFrontmatter error:",u),""}}f.serializeFrontmatter=o;function i(c){try{return Pe(c)}catch(u){return console.warn("Markdown.extractFrontmatter error:",u),{frontmatter:{},content:typeof c=="string"?c:""}}}f.extractFrontmatter=i;function a(c,u,d){try{return ee(c,u,d)}catch(h){return console.warn("Markdown.chunk error:",h),typeof c=="string"&&c.length>0?[c]:[]}}f.chunk=a;function s(c,u){try{return Fe(c,u)}catch(d){return console.warn("Markdown.buildCodeIndex error:",d),{inlineState:{open:false,ticks:0},isInside:()=>false}}}f.buildCodeIndex=s;function l(c,u){try{return Ee(c,u)}catch(d){return console.warn("Markdown.convertTables error:",d),typeof c=="string"?c:""}}f.convertTables=l;})(exports.Markdown||(exports.Markdown={}));chunkXBAP2B6J_cjs.e();function Et(t){if(!t)return "";let n=t.replace(/[/\\]+$/,"").split(/[/\\]/);return n[n.length-1]??""}function cr(t){if(!t)return "";let n=t.replace(/[/\\]+$/,"").split(/[/\\]/);return n.slice(0,n.length-1).join("/")+"/"}function ur(t){if(!t)return "";let e=t.split(".");return e[e.length-1]}function fr(t,e=20){let n=Et(t);if(n.length<=e)return n;let r=n.lastIndexOf("."),o=r<=0?"":n.slice(r),i=e-o.length-1;return i<=0?n.slice(0,e-1)+"\u2026":n.slice(0,i)+"\u2026"+o}function dr(t,e=20){if(t.length<=e)return t;let n=e-1,r=Math.ceil(n/2),o=Math.floor(n/2);return t.slice(0,r)+"\u2026"+t.slice(-o)}chunkXBAP2B6J_cjs.e();var pr=["load failed","network connection was lost","network request failed","failed to fetch","econnreset","econnrefused","etimedout","socket hang up"];function mr(t){if(!t)return false;let e=String(t instanceof Error?t.message:t).toLowerCase();return pr.some(n=>e.includes(n))}async function tt(t,e={}){let{attempts:n=3,delay:r=500,factor:o=2,maxDelay:i=1e4,retryIf:a=mr}=e,s;for(let l=0;l<n;l++)try{return await t()}catch(f){if(s=f,l===n-1||!a(f))throw f;let c=Math.min(r*o**l,i);await new Promise(u=>setTimeout(u,c));}throw s}chunkXBAP2B6J_cjs.e();exports.Fetch=void 0;(S=>{let t=chunkAUS6KQNI_cjs.m.create({service:"fetch"}),e=["HTTP_PROXY","HTTPS_PROXY","http_proxy","https_proxy"],n=false,r=null;function o(){return e.some(x=>{let y=process.env[x];return typeof y=="string"&&y.trim().length>0})}S.hasProxyConfigured=o;function i(){let x=process.env.http_proxy||process.env.HTTP_PROXY;return process.env.https_proxy||process.env.HTTPS_PROXY||x}S.getProxyUrl=i;function a(x={}){let y=x.httpProxy||x.httpsProxy||i();if(!y){t.warn("[Fetch] No proxy configured, HTTP_PROXY/HTTPS_PROXY environment variables not set");return}let R=new undici.ProxyAgent({uri:y,connectTimeout:x.connectTimeout||1e4,keepAliveTimeout:x.keepAliveTimeout||3e4});r=undici.getGlobalDispatcher(),undici.setGlobalDispatcher(R),n=true,t.info(`[Fetch] Global proxy enabled: ${y}`);}S.enableProxy=a;function s(){!n||!r||(undici.setGlobalDispatcher(r),n=false,r=null,t.info("[Fetch] \u5168\u5C40\u4EE3\u7406\u5DF2\u7981\u7528"));}S.disableProxy=s;function l(){return n}S.isProxyEnabled=l;async function f(x,y){let R=y?.timeout||3e4,L=y?.responseType||"json",{timeout:_,responseType:H,...$}=y||{},T=null,v=null;try{$.signal||(T=new AbortController,v=setTimeout(()=>T.abort(),R));let I=await fetch(x,{...$,signal:$.signal||T.signal});v&&clearTimeout(v);let D;switch(L){case "arrayBuffer":D=await I.arrayBuffer();break;case "blob":D=await I.blob();break;case "buffer":{let Y=await I.arrayBuffer();D=Buffer.from(Y);break}case "text":D=await I.text();break;default:{let Y=await I.text();try{D=JSON.parse(Y);}catch{D=Y;}break}}return {ok:I.ok,status:I.status,statusText:I.statusText,headers:I.headers,data:D,url:I.url}}catch(I){throw v&&clearTimeout(v),I}}async function c(x,y){let R=y?.retries??0,L=y?.retryDelay??1e3,{retries:_,retryDelay:H,responseType:$,...T}=y||{};return tt(()=>f(x,{...T,responseType:y?.responseType}),{attempts:R+1,delay:L,maxDelay:L*2**(R+1)})}async function u(x,y){return c(x,{method:"GET",...y})}S.get=u;async function d(x,y,R){return c(x,{method:"POST",headers:{"Content-Type":"application/json",...R?.headers},body:y?JSON.stringify(y):void 0,...R})}S.post=d;async function h(x,y,R){return c(x,{method:"PUT",headers:{"Content-Type":"application/json",...R?.headers},body:y?JSON.stringify(y):void 0,...R})}S.put=h;async function k(x,y,R){return c(x,{method:"DELETE",headers:{"Content-Type":"application/json",...R?.headers},body:y?JSON.stringify(y):void 0,...R})}S.del=k;async function P(x,y,R){return c(x,{method:"PATCH",headers:{"Content-Type":"application/json",...R?.headers},body:y?JSON.stringify(y):void 0,...R})}S.patch=P;async function p(x,y){return c(x,y)}S.request=p;function g(x={}){return o()?(a(x),true):false}S.autoProxy=g;let M=5*1024*1024;function O(x){return new TextEncoder().encode(x)}function N(x){return chunkEN7LFV4R_cjs.d.mimeType(x)}function A(x){return x.startsWith("file://")}async function F(x){let y=url.fileURLToPath(x);return await chunk3U5YF6EI_cjs.D.file(y).bytes()}async function C(x,y,R){let L=`----FetchFormBoundary${Date.now()}`,_=[],$=y.some(E=>E.filename||E.value instanceof Uint8Array||Buffer.isBuffer(E.value))&&!R?.timeout?3e5:R?.timeout;for(let E of y){let U=E.maxSize??M,q=E.filename,Q=`Content-Disposition: form-data; name="${E.name}"${q?`; filename="${q}"`:""}`;q&&(Q+=`\r
|
|
57
|
+
Content-Type: ${N(q)}`),Q+=`\r
|
|
58
58
|
\r
|
|
59
|
-
`,_.push(O(
|
|
60
|
-
--${
|
|
61
|
-
--${
|
|
62
|
-
`),
|
|
63
|
-
`));for(let
|
|
64
|
-
`)));
|
|
65
|
-
`);C=A.pop()??"";for(let D of A)if(D.startsWith("data: ")){let W=D.slice(6);if(W==="[DONE]"){b.onComplete?.();return}b.onMessage?.(W);}}b.onComplete?.();}catch(L){L.name!=="AbortError"&&b.onError?.(L);}})(),()=>{F.abort();}}Cr.sse=Pt;})(exports.Fetch||(exports.Fetch={}));chunkVRQQ33YH_cjs.j();exports.Slug=void 0;(r=>{let t=["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"],e=["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 [t[Math.floor(Math.random()*t.length)],e[Math.floor(Math.random()*e.length)]].join("-")}r.create=n;})(exports.Slug||(exports.Slug={}));chunkVRQQ33YH_cjs.j();function vt(t){let e=new AbortController,n=setTimeout(e.abort.bind(e),t);return {controller:e,signal:e.signal,clearTimeout:()=>globalThis.clearTimeout(n)}}function hr(t,...e){let n=vt(t);return {signal:AbortSignal.any([n.signal,...e]),clearTimeout:n.clearTimeout}}chunkVRQQ33YH_cjs.j();exports.Archive=void 0;(e=>{async function t(n,r){if(process.platform==="win32"){let o=De__default.default.resolve(n),i=De__default.default.resolve(r),a=`Expand-Archive -Path '${o}' -DestinationPath '${i}' -Force`,s=await chunkJQNKLHWT_cjs.G.run("powershell",`-NoProfile -NonInteractive -Command "$global:ProgressPreference = 'SilentlyContinue'; ${a}"`);if(s.code!==0)throw new Error(`PowerShell exited with code ${s.code}: ${s.stderr}`)}else {let o=`unzip -o -q ${n} -d ${r}`,i=await chunkJQNKLHWT_cjs.G.run(void 0,o);if(i.code!==0)throw new Error(`unzip exited with code ${i.code}: ${i.stderr}`)}}e.extractZip=t;})(exports.Archive||(exports.Archive={}));chunkVRQQ33YH_cjs.j();exports.Color=void 0;(r=>{function t(o){return o?/^#[0-9a-fA-F]{6}$/.test(o):false}r.isValidHex=t;function e(o){let i=parseInt(o.slice(1,3),16),a=parseInt(o.slice(3,5),16),s=parseInt(o.slice(5,7),16);return {r:i,g:a,b:s}}r.hexToRgb=e;function n(o){if(!t(o))return;let{r:i,g:a,b:s}=e(o);return `\x1B[38;2;${i};${a};${s}m\x1B[1m`}r.hexToAnsiBold=n;})(exports.Color||(exports.Color={}));chunkVRQQ33YH_cjs.j();exports.Context=void 0;(n=>{class t extends Error{constructor(i){super(`No context found for ${i}`);chunkVRQQ33YH_cjs.c(this,"name",i);}}n.NotFound=t;function e(r){let o=new async_hooks.AsyncLocalStorage;return {use(){let i=o.getStore();if(!i)throw new t(r);return i},provide(i,a){return o.run(i,a)}}}n.create=e;})(exports.Context||(exports.Context={}));chunkVRQQ33YH_cjs.j();function yr(t){return {[Symbol.dispose](){t();},[Symbol.asyncDispose](){return Promise.resolve(t())}}}chunkVRQQ33YH_cjs.j();exports.EventLoop=void 0;(e=>{async function t(){return new Promise(n=>{let r=()=>{process._getActiveHandles().length===0&&process._getActiveRequests().length===0?n():setImmediate(r);};r();})}e.wait=t;})(exports.EventLoop||(exports.EventLoop={}));chunkVRQQ33YH_cjs.j();function br(t){if(t<=0)return "";if(t<60)return `${t}s`;if(t<3600){let n=Math.floor(t/60),r=t%60;return r>0?`${n}m ${r}s`:`${n}m`}if(t<86400){let n=Math.floor(t/3600),r=Math.floor(t%3600/60);return r>0?`${n}h ${r}m`:`${n}h`}if(t<604800){let n=Math.floor(t/86400);return n===1?"~1 day":`~${n} days`}let e=Math.floor(t/604800);return e===1?"~1 week":`~${e} weeks`}chunkVRQQ33YH_cjs.j();exports.Keybind=void 0;(a=>{function t(s,l){if(s===l)return true;if(typeof s!="object"||typeof l!="object"||s===null||l===null)return false;let p=Object.keys(s),c=Object.keys(l);if(p.length!==c.length)return false;for(let u of p)if(!c.includes(u)||!t(s[u],l[u]))return false;return true}function e(s){return {...s,super:s.super??false}}function n(s,l){return s?t(e(s),e(l)):false}a.match=n;function r(s,l=false){return {name:s.name,ctrl:s.ctrl,meta:s.meta,shift:s.shift,super:s.super??false,leader:l}}a.fromParsedKey=r;function o(s){if(!s)return "";let l=[];s.ctrl&&l.push("ctrl"),s.meta&&l.push("alt"),s.super&&l.push("super"),s.shift&&l.push("shift"),s.name&&(s.name==="delete"?l.push("del"):l.push(s.name));let p=l.join("+");return s.leader&&(p=p?`<leader> ${p}`:"<leader>"),p}a.keyToString=o;function i(s){return s==="none"?[]:s.split(",").map(l=>{let c=l.replace(/<leader>/g,"leader+").toLowerCase().split("+"),u={ctrl:false,meta:false,shift:false,super:false,leader:false,name:""};for(let d of c)switch(d){case "ctrl":u.ctrl=true;break;case "alt":case "meta":case "option":u.meta=true;break;case "super":u.super=true;break;case "shift":u.shift=true;break;case "leader":u.leader=true;break;case "esc":u.name="escape";break;default:u.name=d;break}return u})}a.parse=i;})(exports.Keybind||(exports.Keybind={}));chunkVRQQ33YH_cjs.j();exports.Locale=void 0;(d=>{d.SUPPORTED_LANGS=["zh-CN","en-US"],d.DEFAULT_LANG="zh-CN";function n(m,g="EASBOT_LANG"){let k=[m,process.env[g]?.trim()];for(let S of k)if(S&&d.SUPPORTED_LANGS.includes(S))return S;return d.DEFAULT_LANG}d.resolveLocaleLang=n;function r(m){return m.replace(/\b\w/g,g=>g.toUpperCase())}d.titlecase=r;function o(m){return new Date(m).toLocaleTimeString(void 0,{timeStyle:"short"})}d.time=o;function i(m){let g=new Date(m),k=o(m),S=g.toLocaleDateString();return `${k} \xB7 ${S}`}d.datetime=i;function a(m){let g=new Date(m),k=new Date;return g.getFullYear()===k.getFullYear()&&g.getMonth()===k.getMonth()&&g.getDate()===k.getDate()?o(m):i(m)}d.todayTimeOrDateTime=a;function s(m){return m>=1e6?(m/1e6).toFixed(1)+"M":m>=1e3?(m/1e3).toFixed(1)+"K":m.toString()}d.number=s;function l(m){if(m<1e3)return `${m}ms`;if(m<6e4)return `${(m/1e3).toFixed(1)}s`;if(m<36e5){let S=Math.floor(m/6e4),R=Math.floor(m%6e4/1e3);return `${S}m ${R}s`}if(m<864e5){let S=Math.floor(m/36e5),R=Math.floor(m%36e5/6e4);return `${S}h ${R}m`}let g=Math.floor(m/36e5);return `${Math.floor(m%36e5/864e5)}d ${g}h`}d.duration=l;function p(m,g){return m.length<=g?m:m.slice(0,g-1)+"\u2026"}d.truncate=p;function c(m,g=35){if(m.length<=g)return m;let k="\u2026",S=Math.ceil((g-k.length)/2),R=Math.floor((g-k.length)/2);return m.slice(0,S)+k+m.slice(-R)}d.truncateMiddle=c;function u(m,g,k){return (m===1?g:k).replace("{}",m.toString())}d.pluralize=u;})(exports.Locale||(exports.Locale={}));var xr=exports.Locale.resolveLocaleLang,kr=exports.Locale.SUPPORTED_LANGS,Sr=exports.Locale.DEFAULT_LANG;chunkVRQQ33YH_cjs.j();var wr=["HTTP_PROXY","HTTPS_PROXY","http_proxy","https_proxy"];function Tr(){return wr.some(t=>process.env[t])}function Mr(){return process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy}function Rr(){let t=process.env.HTTP_PROXY||process.env.http_proxy,e=process.env.HTTPS_PROXY||process.env.https_proxy;return {http:t,https:e,enabled:!!(t||e)}}chunkVRQQ33YH_cjs.j();var rt=class{constructor(){chunkVRQQ33YH_cjs.c(this,"queue",[]);chunkVRQQ33YH_cjs.c(this,"resolvers",[]);}push(e){let n=this.resolvers.shift();n?n(e):this.queue.push(e);}async next(){return this.queue.length>0?this.queue.shift():new Promise(e=>this.resolvers.push(e))}async*[Symbol.asyncIterator](){for(;;)yield await this.next();}};async function vr(t,e,n){let r=[...e];await Promise.all(Array.from({length:t},async()=>{for(;;){let o=r.pop();if(o===void 0)return;await n(o);}}));}chunkVRQQ33YH_cjs.j();function Ir(){let t,e=new Promise(n=>t=n);return {trigger(){return t()},wait(){return e}}}chunkVRQQ33YH_cjs.j();function Pr(t,e){let n;return Promise.race([t.then(r=>(clearTimeout(n),r)),new Promise((r,o)=>{n=setTimeout(()=>{o(new Error(`Operation timed out after ${e}ms`));},e);})])}chunkVRQQ33YH_cjs.j();exports.Token=void 0;(a=>{let n=/[\u4e00-\u9fff\u3400-\u4dbf]/g;function r(s){if(!s)return 0;let l=String(s),p=(l.match(n)||[]).length,c=l.length-p,u=Math.round(p/1.5),d=Math.round(c/4);return Math.max(0,u+d)}a.estimate=r;function o(s){if(s==null)return 0;try{let l=typeof s=="string"?s:JSON.stringify(s);return r(l)}catch{return 0}}a.estimateObject=o;function i(s){if(s.total!==void 0&&s.total>0)return s.total;let l=s.input??0,p=s.output??0,c=s.cache?.read??0,u=s.cache?.write??0;return l+p+c+u}a.total=i;})(exports.Token||(exports.Token={}));chunkVRQQ33YH_cjs.j();function _r(t){let e={},n=t.shape??t.required().shape;for(let[r,o]of Object.entries(n))e[r]=o.nullable().optional();return pe__default.default.object(e)}Object.defineProperty(exports,"Lock",{enumerable:true,get:function(){return chunkYC4AEMOP_cjs.a}});Object.defineProperty(exports,"$",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.H}});Object.defineProperty(exports,"HTTPException",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.j}});Object.defineProperty(exports,"Hono",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.d}});Object.defineProperty(exports,"Lazy",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.c}});Object.defineProperty(exports,"PKG",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.D}});Object.defineProperty(exports,"PkgShell",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.A}});Object.defineProperty(exports,"Shell",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.G}});Object.defineProperty(exports,"compress",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.g}});Object.defineProperty(exports,"cors",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.e}});Object.defineProperty(exports,"createNodeWebSocket",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.s}});Object.defineProperty(exports,"createPkgShell",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.B}});Object.defineProperty(exports,"createRESTServer",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.p}});Object.defineProperty(exports,"createRPCServer",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.n}});Object.defineProperty(exports,"createServer",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.m}});Object.defineProperty(exports,"createStreamingServer",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.r}});Object.defineProperty(exports,"createWebSocketServer",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.q}});Object.defineProperty(exports,"detectPlatform",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.y}});Object.defineProperty(exports,"escapeCommandArg",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.w}});Object.defineProperty(exports,"escapeCommandArgSafe",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.x}});Object.defineProperty(exports,"joinCommandArgs",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.z}});Object.defineProperty(exports,"lazy",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.a}});Object.defineProperty(exports,"lazyAsync",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.b}});Object.defineProperty(exports,"logger",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.f}});Object.defineProperty(exports,"needsShellExecution",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.u}});Object.defineProperty(exports,"parseCommand",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.t}});Object.defineProperty(exports,"parseCommandWithOptions",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.v}});Object.defineProperty(exports,"readableStreamToText",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.E}});Object.defineProperty(exports,"secureHeaders",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.h}});Object.defineProperty(exports,"shell",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.C}});Object.defineProperty(exports,"startServer",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.o}});Object.defineProperty(exports,"timeout",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.i}});Object.defineProperty(exports,"validator",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.k}});Object.defineProperty(exports,"whichSync",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.F}});Object.defineProperty(exports,"zValidator",{enumerable:true,get:function(){return chunkJQNKLHWT_cjs.l}});Object.defineProperty(exports,"Filesystem",{enumerable:true,get:function(){return chunk6JM5F6FM_cjs.d}});Object.defineProperty(exports,"Glob",{enumerable:true,get:function(){return chunk6JM5F6FM_cjs.b}});Object.defineProperty(exports,"MIME_TYPES",{enumerable:true,get:function(){return chunk6JM5F6FM_cjs.c}});Object.defineProperty(exports,"Wildcard",{enumerable:true,get:function(){return chunk6JM5F6FM_cjs.a}});Object.defineProperty(exports,"Log",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.m}});Object.defineProperty(exports,"PackageRegistry",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.o}});Object.defineProperty(exports,"Semver",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.n}});Object.defineProperty(exports,"addMinutesInTimezone",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.l}});Object.defineProperty(exports,"formatLocalISO",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.a}});Object.defineProperty(exports,"formatLocalISOCompact",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.b}});Object.defineProperty(exports,"formatLogTime",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.f}});Object.defineProperty(exports,"formatLogTimeMs",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.g}});Object.defineProperty(exports,"getTimezoneOffset",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.h}});Object.defineProperty(exports,"getTimezoneParts",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.i}});Object.defineProperty(exports,"isValidTimezone",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.j}});Object.defineProperty(exports,"normalizeTimezone",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.k}});Object.defineProperty(exports,"now",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.c}});Object.defineProperty(exports,"nowLocalISO",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.d}});Object.defineProperty(exports,"parseLocalISO",{enumerable:true,get:function(){return chunkA2TCSTSM_cjs.e}});exports.AsyncQueue=rt;exports.DEFAULT_LANG=Sr;exports.NamedError=Le;exports.SUPPORTED_LANGS=kr;exports.abortAfter=vt;exports.abortAfterAny=hr;exports.buildCodeSpanIndex=we;exports.chunkMarkdownIR=St;exports.chunkText=q;exports.chunkTextByBreakResolver=Be;exports.convertMarkdownTables=Te;exports.createInlineCodeState=Se;exports.defer=yr;exports.extractFrontmatter=xe;exports.findFenceSpanAt=Ye;exports.findLast=en;exports.fn=on;exports.formatDuration=br;exports.formatMarkdown=ye;exports.getDirectory=ir;exports.getFileExtension=ar;exports.getFilename=Mt;exports.getFilenameTruncated=lr;exports.getProxyConfig=Rr;exports.getProxyUrl=Mr;exports.git=cn;exports.iife=gn;exports.isSafeFenceBreak=Tt;exports.loadEnv=ln;exports.loadTextFile=mn;exports.loadTextFileAsync=hn;exports.markdownToIR=X;exports.markdownToIRWithMeta=re;exports.parseFenceSpans=ke;exports.parseFrontmatterBlock=se;exports.parseModelId=yn;exports.proxied=Tr;exports.renderMarkdown=V;exports.renderMarkdownWithMarkers=oe;exports.resolveLocaleLang=xr;exports.retry=Ve;exports.scanParenAwareBreakpoints=ze;exports.serializeFrontmatter=be;exports.signal=Ir;exports.truncateMiddle=cr;exports.updateSchema=_r;exports.withTimeout=Pr;exports.work=vr;
|
|
59
|
+
`,_.push(O(Q));let z=E.value;if(typeof z=="string")if(A(z)){let _e=await F(z);if(q||(q=z.split("/").pop()||"file"),_e.byteLength>U)throw new Error(`File size ${_e.byteLength} exceeds limit ${U} bytes: ${q}`);_.push(_e);}else _.push(O(z));else if(Buffer.isBuffer(z)){if(z.byteLength>U)throw new Error(`Buffer size ${z.byteLength} exceeds limit ${U} bytes: ${E.name}`);_.push(new Uint8Array(z.buffer,z.byteOffset,z.byteLength));}else if(z instanceof Uint8Array){if(z.byteLength>U)throw new Error(`File size ${z.byteLength} exceeds limit ${U} bytes: ${E.name}`);_.push(z);}}let T=O(`\r
|
|
60
|
+
--${L}--`),v=O(`\r
|
|
61
|
+
--${L}\r
|
|
62
|
+
`),I=[];I.push(O(`--${L}\r
|
|
63
|
+
`));for(let E=0;E<_.length;E++)I.push(_[E]),E%2===1&&E<_.length-1&&(I.push(v),I.push(O(`--${L}\r
|
|
64
|
+
`)));I.push(T);let D=I.reduce((E,U)=>E+U.length,0),Y=new Uint8Array(D),he=0;for(let E of I)Y.set(E,he),he+=E.length;return c(x,{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${L}`,...R?.headers},body:Y,timeout:$,...R})}S.postForm=C;function B(x,y,R){let L=new AbortController,_=L.signal;return (async()=>{try{let $={Accept:"text/event-stream",...R?.headers||{}},T=await fetch(x,{...R,headers:$,signal:_});if(!T.ok)throw new Error(`SSE connection failed: ${T.status}`);let v=T.body?.getReader();if(!v)throw new Error("SSE stream not available");let I=new TextDecoder("utf-8"),D="";for(;!_.aborted;){let{done:Y,value:he}=await v.read();if(Y)break;let E=I.decode(he,{stream:!0});D+=E;let U=D.split(`
|
|
65
|
+
`);D=U.pop()??"";for(let q of U)if(q.startsWith("data: ")){let Q=q.slice(6);if(Q==="[DONE]"){y.onComplete?.();return}y.onMessage?.(Q);}}y.onComplete?.();}catch($){$.name!=="AbortError"&&y.onError?.($);}})(),()=>{L.abort();}}S.sse=B;})(exports.Fetch||(exports.Fetch={}));chunkXBAP2B6J_cjs.e();exports.Slug=void 0;(r=>{let t=["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"],e=["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 [t[Math.floor(Math.random()*t.length)],e[Math.floor(Math.random()*e.length)]].join("-")}r.create=n;})(exports.Slug||(exports.Slug={}));chunkXBAP2B6J_cjs.e();function Ct(t){let e=new AbortController,n=setTimeout(e.abort.bind(e),t);return {controller:e,signal:e.signal,clearTimeout:()=>globalThis.clearTimeout(n)}}function br(t,...e){let n=Ct(t);return {signal:AbortSignal.any([n.signal,...e]),clearTimeout:n.clearTimeout}}chunkXBAP2B6J_cjs.e();exports.Archive=void 0;(e=>{async function t(n,r){if(process.platform==="win32"){let o=He__default.default.resolve(n),i=He__default.default.resolve(r),a=`Expand-Archive -Path '${o}' -DestinationPath '${i}' -Force`,s=await chunk3U5YF6EI_cjs.G.run("powershell",`-NoProfile -NonInteractive -Command "$global:ProgressPreference = 'SilentlyContinue'; ${a}"`);if(s.code!==0)throw new Error(`PowerShell exited with code ${s.code}: ${s.stderr}`)}else {let o=`unzip -o -q ${n} -d ${r}`,i=await chunk3U5YF6EI_cjs.G.run(void 0,o);if(i.code!==0)throw new Error(`unzip exited with code ${i.code}: ${i.stderr}`)}}e.extractZip=t;})(exports.Archive||(exports.Archive={}));chunkXBAP2B6J_cjs.e();exports.Color=void 0;(r=>{function t(o){return o?/^#[0-9a-fA-F]{6}$/.test(o):false}r.isValidHex=t;function e(o){let i=parseInt(o.slice(1,3),16),a=parseInt(o.slice(3,5),16),s=parseInt(o.slice(5,7),16);return {r:i,g:a,b:s}}r.hexToRgb=e;function n(o){if(!t(o))return;let{r:i,g:a,b:s}=e(o);return `\x1B[38;2;${i};${a};${s}m\x1B[1m`}r.hexToAnsiBold=n;})(exports.Color||(exports.Color={}));chunkXBAP2B6J_cjs.e();exports.Context=void 0;(n=>{class t extends Error{constructor(i){super(`No context found for ${i}`);chunkXBAP2B6J_cjs.c(this,"name",i);}}n.NotFound=t;function e(r){let o=new async_hooks.AsyncLocalStorage;return {use(){let i=o.getStore();if(!i)throw new t(r);return i},provide(i,a){return o.run(i,a)}}}n.create=e;})(exports.Context||(exports.Context={}));chunkXBAP2B6J_cjs.e();function kr(t){return {[Symbol.dispose](){t();},[Symbol.asyncDispose](){return Promise.resolve(t())}}}chunkXBAP2B6J_cjs.e();exports.EventLoop=void 0;(e=>{async function t(){return new Promise(n=>{let r=()=>{process._getActiveHandles().length===0&&process._getActiveRequests().length===0?n():setImmediate(r);};r();})}e.wait=t;})(exports.EventLoop||(exports.EventLoop={}));chunkXBAP2B6J_cjs.e();function wr(t){if(t<=0)return "";if(t<60)return `${t}s`;if(t<3600){let n=Math.floor(t/60),r=t%60;return r>0?`${n}m ${r}s`:`${n}m`}if(t<86400){let n=Math.floor(t/3600),r=Math.floor(t%3600/60);return r>0?`${n}h ${r}m`:`${n}h`}if(t<604800){let n=Math.floor(t/86400);return n===1?"~1 day":`~${n} days`}let e=Math.floor(t/604800);return e===1?"~1 week":`~${e} weeks`}chunkXBAP2B6J_cjs.e();exports.Grep=void 0;(P=>{let t=chunkAUS6KQNI_cjs.m.create({service:"grep"});async function e(){return n()}P.filepath=e;let n=chunk3U5YF6EI_cjs.b(async()=>{let p=await chunk3U5YF6EI_cjs.D.which("rg");if(!p)return null;try{if(!(await me__default.default.stat(p)).isFile())return null}catch{return null}try{let g=await chunk3U5YF6EI_cjs.D.run([p,"--version"],{timeout:5e3});if(g.code!==0||!g.stdout.startsWith("ripgrep "))return t.warn("rg failed self-test, falling back to pure JS",{filepath:p,code:g.code,stderr:g.stderr.slice(0,200)}),null}catch(g){return t.warn("rg spawn failed during self-test, falling back to pure JS",{filepath:p,error:g.message.slice(0,200)}),null}return p});async function r(){return await e()!==null}P.isUsingRipgrep=r;async function*o(p){p.signal?.throwIfAborted();let g=await e();g?yield*i(g,p):(t.debug("ripgrep not available, using pure JS fallback for files()",{cwd:p.cwd}),yield*a(p));}P.files=o;async function*i(p,g){g.signal?.throwIfAborted();let M=["--files","--glob=!.git/*"];g.follow&&M.push("--follow");let O=g.hidden!==false;if(g.maxDepth!==void 0&&M.push(`--max-depth=${g.maxDepth}`),g.glob)for(let F of g.glob)M.push(`--glob=${F}`);try{if(!(await me__default.default.stat(g.cwd)).isDirectory())throw Object.assign(new Error(`Not a directory: '${g.cwd}'`),{code:"ENOTDIR",errno:-20,path:g.cwd})}catch(F){throw F.code==="ENOENT"?Object.assign(new Error(`No such file or directory: '${g.cwd}'`),{code:"ENOENT",errno:-2,path:g.cwd}):F}let N=await chunk3U5YF6EI_cjs.D.run([p,...M],{cwd:g.cwd});if(N.code!==0&&N.code!==1)return;let A=N.stdout.split(/\r?\n/);for(let F of A){g.signal?.throwIfAborted();let C=F.trim();if(!C)continue;let B=chunkEN7LFV4R_cjs.d.toUnixPath(C);!O&&B.split("/").some(S=>S.startsWith("."))||(yield B);}}async function*a(p){p.signal?.throwIfAborted();try{if(!(await me__default.default.stat(p.cwd)).isDirectory())throw Object.assign(new Error(`Not a directory: '${p.cwd}'`),{code:"ENOTDIR",errno:-20,path:p.cwd})}catch(S){throw S.code==="ENOENT"?Object.assign(new Error(`No such file or directory: '${p.cwd}'`),{code:"ENOENT",errno:-2,path:p.cwd}):S}let g=[],M=[];if(p.glob)for(let S of p.glob)S.startsWith("!")?M.push(S.slice(1)):g.push(S);let O=g.length>0?g:["**/*"],N=p.hidden!==false,A=new Set,F=chunkEN7LFV4R_cjs.b.DEFAULT_MAX_DEPTH,C;p.maxDepth===void 0?C=F:p.maxDepth<0?C=1:C=p.maxDepth+1;let B=Math.min(Math.max(C,1),F);for(let S of O){p.signal?.throwIfAborted();let x=await chunkEN7LFV4R_cjs.b.scan(S,{cwd:p.cwd,absolute:false,include:"file",dot:N,symlink:p.follow??false,maxDepth:B,ignore:M});for(let y of x)!N&&y.split("/").some(R=>R.startsWith("."))||A.add(y);}for(let S of Array.from(A).sort())p.signal?.throwIfAborted(),yield S;p.signal?.throwIfAborted();}async function s(p){t.debug("tree",{cwd:p.cwd}),p.signal?.throwIfAborted();let g=p.hidden!==false,M=p.glob??[],O=M.filter(T=>!T.startsWith("!")),N=M.filter(T=>T.startsWith("!")).map(T=>T.slice(1)),A=O.length>0?O:["**/*"],F=new Set,C=[];for(let T of A){p.signal?.throwIfAborted();let v=await chunkEN7LFV4R_cjs.b.scan(T,{cwd:p.cwd,absolute:false,include:"file",dot:g,symlink:false,maxDepth:chunkEN7LFV4R_cjs.b.DEFAULT_MAX_DEPTH});for(let I of v)F.has(I)||(F.add(I),C.push(I));}let B=C.filter(T=>{for(let v of N)if(chunkEN7LFV4R_cjs.b.match(v,T))return false;return true});function S(T,v){let I=T.children.get(v);if(I)return I;let D={name:v,children:new Map};return T.children.set(v,D),D}let x={children:new Map};for(let T of B){let v=T.split("/");if(v.length<2)continue;let I=x;for(let D of v.slice(0,-1))I=S(I,D);}let y=Array.from(x.children.values()).sort((T,v)=>T.name.localeCompare(v.name)),R=p.limit??Number.POSITIVE_INFINITY,L=[],_=y.map(T=>({node:T,path:T.name})),H=0,$=0;for(;_.length>0;){let T=_.shift();if(!T)break;if(H++,$<R){L.push(T.path),$++;for(let v of Array.from(T.node.children.values()).sort((I,D)=>I.name.localeCompare(D.name))){if($>=R)break;_.push({node:v,path:`${T.path}/${v.name}`});}}}return H>$&&L.push(`[${$}/${H} shown, ${H-$} truncated]`),L.join(`
|
|
66
|
+
`)}P.tree=s;async function l(p){let g=await e();return g?f(g,p):(t.debug("ripgrep not available, using pure JS fallback for search()",{cwd:p.cwd,pattern:p.pattern}),c(p))}P.search=l;async function f(p,g){let M=["--json","--glob=!.git/*"];if(g.follow&&M.push("--follow"),g.glob)for(let C of g.glob)M.push(`--glob=${C}`);g.limit&&M.push(`--max-count=${g.limit}`),M.push("--"),M.push(g.pattern);let O=await chunk3U5YF6EI_cjs.D.run([p,...M],{cwd:g.cwd});if(O.code!==0)return [];let N=g.hidden!==false,A=O.stdout.split(/\r?\n/).filter(Boolean),F=[];for(let C of A)try{let B=JSON.parse(C);if(B?.type!=="match")continue;let S=B.data;if(!S?.path?.text||!S?.lines?.text)continue;let x=chunkEN7LFV4R_cjs.d.toUnixPath(S.path.text);if(!N&&x.split("/").some(y=>y.startsWith(".")))continue;if(F.push({path:x,lines:S.lines.text,line_number:S.line_number,absolute_offset:S.absolute_offset??0}),g.limit&&F.length>=g.limit)break}catch{}return F}async function c(p){let g;try{g=new RegExp(p.pattern);}catch{return []}try{if(!(await me__default.default.stat(p.cwd)).isDirectory())throw Object.assign(new Error(`Not a directory: '${p.cwd}'`),{code:"ENOTDIR",errno:-20,path:p.cwd})}catch(S){throw S.code==="ENOENT"?Object.assign(new Error(`No such file or directory: '${p.cwd}'`),{code:"ENOENT",errno:-2,path:p.cwd}):S}let M=[],O=[];if(p.glob)for(let S of p.glob)S.startsWith("!")?O.push(S.slice(1)):M.push(S);let N=p.hidden!==false,A=[],F=M.length>0?M:["**/*"],C=new Set,B=[];for(let S of F){p.signal?.throwIfAborted();let x=await chunkEN7LFV4R_cjs.b.scan(S,{cwd:p.cwd,absolute:false,include:"file",dot:N,symlink:p.follow??false,maxDepth:void 0,ignore:O});for(let y of x)C.has(y)||(C.add(y),B.push(y));}for(let S of B){if(p.signal?.throwIfAborted(),p.limit&&A.length>=p.limit)break;let x=chunkEN7LFV4R_cjs.d.join(p.cwd,S),y;try{y=await me__default.default.readFile(x,"utf-8");}catch{continue}let R=y.split(/\r?\n/),L=0;for(let _=0;_<R.length;_++){let H=R[_]??"";if(g.test(H)&&(A.push({path:S,lines:H,line_number:_+1,absolute_offset:L}),p.limit&&A.length>=p.limit))break;L+=Buffer.byteLength(H,"utf-8")+1;}}return A}function u(p,g){return chunkEN7LFV4R_cjs.a.match(p,g)}P.match=u;let d=chunk3U5YF6EI_cjs.a(async()=>await e());async function h(){return await d()}P.filepathCached=h,P._ready=chunk3U5YF6EI_cjs.a(async()=>{let p=await e();return t.debug("Grep initialized",{ripgrep:p?"available":"fallback (pure JS)"}),p});})(exports.Grep||(exports.Grep={}));chunkXBAP2B6J_cjs.e();exports.Keybind=void 0;(a=>{function t(s,l){if(s===l)return true;if(typeof s!="object"||typeof l!="object"||s===null||l===null)return false;let f=Object.keys(s),c=Object.keys(l);if(f.length!==c.length)return false;for(let u of f)if(!c.includes(u)||!t(s[u],l[u]))return false;return true}function e(s){return {...s,super:s.super??false}}function n(s,l){return s?t(e(s),e(l)):false}a.match=n;function r(s,l=false){return {name:s.name,ctrl:s.ctrl,meta:s.meta,shift:s.shift,super:s.super??false,leader:l}}a.fromParsedKey=r;function o(s){if(!s)return "";let l=[];s.ctrl&&l.push("ctrl"),s.meta&&l.push("alt"),s.super&&l.push("super"),s.shift&&l.push("shift"),s.name&&(s.name==="delete"?l.push("del"):l.push(s.name));let f=l.join("+");return s.leader&&(f=f?`<leader> ${f}`:"<leader>"),f}a.keyToString=o;function i(s){return s==="none"?[]:s.split(",").map(l=>{let c=l.replace(/<leader>/g,"leader+").toLowerCase().split("+"),u={ctrl:false,meta:false,shift:false,super:false,leader:false,name:""};for(let d of c)switch(d){case "ctrl":u.ctrl=true;break;case "alt":case "meta":case "option":u.meta=true;break;case "super":u.super=true;break;case "shift":u.shift=true;break;case "leader":u.leader=true;break;case "esc":u.name="escape";break;default:u.name=d;break}return u})}a.parse=i;})(exports.Keybind||(exports.Keybind={}));chunkXBAP2B6J_cjs.e();exports.Locale=void 0;(d=>{d.SUPPORTED_LANGS=["zh-CN","en-US"],d.DEFAULT_LANG="zh-CN";function n(h,k="EASBOT_LANG"){let P=[h,process.env[k]?.trim()];for(let p of P)if(p&&d.SUPPORTED_LANGS.includes(p))return p;return d.DEFAULT_LANG}d.resolveLocaleLang=n;function r(h){return h.replace(/\b\w/g,k=>k.toUpperCase())}d.titlecase=r;function o(h){return new Date(h).toLocaleTimeString(void 0,{timeStyle:"short"})}d.time=o;function i(h){let k=new Date(h),P=o(h),p=k.toLocaleDateString();return `${P} \xB7 ${p}`}d.datetime=i;function a(h){let k=new Date(h),P=new Date;return k.getFullYear()===P.getFullYear()&&k.getMonth()===P.getMonth()&&k.getDate()===P.getDate()?o(h):i(h)}d.todayTimeOrDateTime=a;function s(h){return h>=1e6?(h/1e6).toFixed(1)+"M":h>=1e3?(h/1e3).toFixed(1)+"K":h.toString()}d.number=s;function l(h){if(h<1e3)return `${h}ms`;if(h<6e4)return `${(h/1e3).toFixed(1)}s`;if(h<36e5){let p=Math.floor(h/6e4),g=Math.floor(h%6e4/1e3);return `${p}m ${g}s`}if(h<864e5){let p=Math.floor(h/36e5),g=Math.floor(h%36e5/6e4);return `${p}h ${g}m`}let k=Math.floor(h/36e5);return `${Math.floor(h%36e5/864e5)}d ${k}h`}d.duration=l;function f(h,k){return h.length<=k?h:h.slice(0,k-1)+"\u2026"}d.truncate=f;function c(h,k=35){if(h.length<=k)return h;let P="\u2026",p=Math.ceil((k-P.length)/2),g=Math.floor((k-P.length)/2);return h.slice(0,p)+P+h.slice(-g)}d.truncateMiddle=c;function u(h,k,P){return (h===1?k:P).replace("{}",h.toString())}d.pluralize=u;})(exports.Locale||(exports.Locale={}));var Sr=exports.Locale.resolveLocaleLang,Tr=exports.Locale.SUPPORTED_LANGS,Mr=exports.Locale.DEFAULT_LANG;chunkXBAP2B6J_cjs.e();var Rr=["HTTP_PROXY","HTTPS_PROXY","http_proxy","https_proxy"];function Ir(){return Rr.some(t=>process.env[t])}function Pr(){return process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy}function vr(){let t=process.env.HTTP_PROXY||process.env.http_proxy,e=process.env.HTTPS_PROXY||process.env.https_proxy;return {http:t,https:e,enabled:!!(t||e)}}chunkXBAP2B6J_cjs.e();var ut=class{constructor(){chunkXBAP2B6J_cjs.c(this,"queue",[]);chunkXBAP2B6J_cjs.c(this,"resolvers",[]);}push(e){let n=this.resolvers.shift();n?n(e):this.queue.push(e);}async next(){return this.queue.length>0?this.queue.shift():new Promise(e=>this.resolvers.push(e))}async*[Symbol.asyncIterator](){for(;;)yield await this.next();}};async function Or(t,e,n){let r=[...e];await Promise.all(Array.from({length:t},async()=>{for(;;){let o=r.pop();if(o===void 0)return;await n(o);}}));}chunkXBAP2B6J_cjs.e();function Fr(){let t,e=new Promise(n=>t=n);return {trigger(){return t()},wait(){return e}}}chunkXBAP2B6J_cjs.e();function Er(t,e){let n;return Promise.race([t.then(r=>(clearTimeout(n),r)),new Promise((r,o)=>{n=setTimeout(()=>{o(new Error(`Operation timed out after ${e}ms`));},e);})])}chunkXBAP2B6J_cjs.e();exports.Token=void 0;(a=>{let n=/[\u4e00-\u9fff\u3400-\u4dbf]/g;function r(s){if(!s)return 0;let l=String(s),f=(l.match(n)||[]).length,c=l.length-f,u=Math.round(f/1.5),d=Math.round(c/4);return Math.max(0,u+d)}a.estimate=r;function o(s){if(s==null)return 0;try{let l=typeof s=="string"?s:JSON.stringify(s);return r(l)}catch{return 0}}a.estimateObject=o;function i(s){if(s.total!==void 0&&s.total>0)return s.total;let l=s.input??0,f=s.output??0,c=s.cache?.read??0,u=s.cache?.write??0;return l+f+c+u}a.total=i;})(exports.Token||(exports.Token={}));chunkXBAP2B6J_cjs.e();function Cr(t){let e={},n=t.shape??t.required().shape;for(let[r,o]of Object.entries(n))e[r]=o.nullable().optional();return xe__default.default.object(e)}Object.defineProperty(exports,"Lock",{enumerable:true,get:function(){return chunkPJIZPZPO_cjs.a}});Object.defineProperty(exports,"$",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.H}});Object.defineProperty(exports,"HTTPException",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.j}});Object.defineProperty(exports,"Hono",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.d}});Object.defineProperty(exports,"Lazy",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.c}});Object.defineProperty(exports,"PKG",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.D}});Object.defineProperty(exports,"PkgShell",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.A}});Object.defineProperty(exports,"Shell",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.G}});Object.defineProperty(exports,"compress",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.g}});Object.defineProperty(exports,"cors",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.e}});Object.defineProperty(exports,"createNodeWebSocket",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.s}});Object.defineProperty(exports,"createPkgShell",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.B}});Object.defineProperty(exports,"createRESTServer",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.p}});Object.defineProperty(exports,"createRPCServer",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.n}});Object.defineProperty(exports,"createServer",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.m}});Object.defineProperty(exports,"createStreamingServer",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.r}});Object.defineProperty(exports,"createWebSocketServer",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.q}});Object.defineProperty(exports,"detectPlatform",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.y}});Object.defineProperty(exports,"escapeCommandArg",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.w}});Object.defineProperty(exports,"escapeCommandArgSafe",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.x}});Object.defineProperty(exports,"joinCommandArgs",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.z}});Object.defineProperty(exports,"lazy",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.a}});Object.defineProperty(exports,"lazyAsync",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.b}});Object.defineProperty(exports,"logger",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.f}});Object.defineProperty(exports,"needsShellExecution",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.u}});Object.defineProperty(exports,"parseCommand",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.t}});Object.defineProperty(exports,"parseCommandWithOptions",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.v}});Object.defineProperty(exports,"readableStreamToText",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.E}});Object.defineProperty(exports,"secureHeaders",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.h}});Object.defineProperty(exports,"shell",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.C}});Object.defineProperty(exports,"startServer",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.o}});Object.defineProperty(exports,"timeout",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.i}});Object.defineProperty(exports,"validator",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.k}});Object.defineProperty(exports,"whichSync",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.F}});Object.defineProperty(exports,"zValidator",{enumerable:true,get:function(){return chunk3U5YF6EI_cjs.l}});Object.defineProperty(exports,"Filesystem",{enumerable:true,get:function(){return chunkEN7LFV4R_cjs.d}});Object.defineProperty(exports,"Glob",{enumerable:true,get:function(){return chunkEN7LFV4R_cjs.b}});Object.defineProperty(exports,"MIME_TYPES",{enumerable:true,get:function(){return chunkEN7LFV4R_cjs.c}});Object.defineProperty(exports,"Wildcard",{enumerable:true,get:function(){return chunkEN7LFV4R_cjs.a}});Object.defineProperty(exports,"Log",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.m}});Object.defineProperty(exports,"PackageRegistry",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.o}});Object.defineProperty(exports,"Semver",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.n}});Object.defineProperty(exports,"addMinutesInTimezone",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.l}});Object.defineProperty(exports,"formatLocalISO",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.a}});Object.defineProperty(exports,"formatLocalISOCompact",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.b}});Object.defineProperty(exports,"formatLogTime",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.f}});Object.defineProperty(exports,"formatLogTimeMs",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.g}});Object.defineProperty(exports,"getTimezoneOffset",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.h}});Object.defineProperty(exports,"getTimezoneParts",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.i}});Object.defineProperty(exports,"isValidTimezone",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.j}});Object.defineProperty(exports,"normalizeTimezone",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.k}});Object.defineProperty(exports,"now",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.c}});Object.defineProperty(exports,"nowLocalISO",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.d}});Object.defineProperty(exports,"parseLocalISO",{enumerable:true,get:function(){return chunkAUS6KQNI_cjs.e}});exports.AsyncQueue=ut;exports.DEFAULT_LANG=Mr;exports.NamedError=ze;exports.SUPPORTED_LANGS=Tr;exports.abortAfter=Ct;exports.abortAfterAny=br;exports.buildCodeSpanIndex=Fe;exports.chunkMarkdownIR=vt;exports.chunkText=ee;exports.chunkTextByBreakResolver=qe;exports.convertMarkdownTables=Ee;exports.createInlineCodeState=Oe;exports.defer=kr;exports.extractFrontmatter=Pe;exports.findFenceSpanAt=Qe;exports.findLast=rn;exports.fn=ln;exports.formatDuration=wr;exports.formatMarkdown=Re;exports.getDirectory=cr;exports.getFileExtension=ur;exports.getFilename=Et;exports.getFilenameTruncated=fr;exports.getProxyConfig=vr;exports.getProxyUrl=Pr;exports.git=dn;exports.iife=xn;exports.isSafeFenceBreak=Ft;exports.loadEnv=fn;exports.loadTextFile=yn;exports.loadTextFileAsync=bn;exports.markdownToIR=re;exports.markdownToIRWithMeta=fe;exports.parseFenceSpans=ve;exports.parseFrontmatterBlock=pe;exports.parseModelId=kn;exports.proxied=Ir;exports.renderMarkdown=oe;exports.renderMarkdownWithMarkers=de;exports.resolveLocaleLang=Sr;exports.retry=tt;exports.scanParenAwareBreakpoints=Ue;exports.serializeFrontmatter=Ie;exports.signal=Fr;exports.truncateMiddle=dr;exports.updateSchema=Cr;exports.withTimeout=Er;exports.work=Or;
|
package/dist/index.d.cts
CHANGED
|
@@ -1223,6 +1223,7 @@ declare namespace Glob {
|
|
|
1223
1223
|
symlink?: boolean;
|
|
1224
1224
|
ignore?: string[];
|
|
1225
1225
|
}
|
|
1226
|
+
const DEFAULT_MAX_DEPTH = 20;
|
|
1226
1227
|
function scan(pattern: string, options?: Options): Promise<string[]>;
|
|
1227
1228
|
function scanSync(pattern: string, options?: Options): string[];
|
|
1228
1229
|
function match(pattern: string, filepath: string): boolean;
|
|
@@ -1232,6 +1233,53 @@ declare namespace Glob {
|
|
|
1232
1233
|
const DEFAULT_IGNORE_PATTERNS: string[];
|
|
1233
1234
|
}
|
|
1234
1235
|
|
|
1236
|
+
declare namespace Grep {
|
|
1237
|
+
interface RipgrepInfo {
|
|
1238
|
+
filepath: string;
|
|
1239
|
+
}
|
|
1240
|
+
interface Match {
|
|
1241
|
+
path: string;
|
|
1242
|
+
lines: string;
|
|
1243
|
+
line_number: number;
|
|
1244
|
+
absolute_offset: number;
|
|
1245
|
+
}
|
|
1246
|
+
interface FilesOptions {
|
|
1247
|
+
cwd: string;
|
|
1248
|
+
glob?: string[];
|
|
1249
|
+
hidden?: boolean;
|
|
1250
|
+
follow?: boolean;
|
|
1251
|
+
maxDepth?: number;
|
|
1252
|
+
signal?: AbortSignal;
|
|
1253
|
+
}
|
|
1254
|
+
interface TreeOptions {
|
|
1255
|
+
cwd: string;
|
|
1256
|
+
limit?: number;
|
|
1257
|
+
signal?: AbortSignal;
|
|
1258
|
+
glob?: string[];
|
|
1259
|
+
hidden?: boolean;
|
|
1260
|
+
}
|
|
1261
|
+
interface SearchOptions {
|
|
1262
|
+
cwd: string;
|
|
1263
|
+
pattern: string;
|
|
1264
|
+
glob?: string[];
|
|
1265
|
+
limit?: number;
|
|
1266
|
+
hidden?: boolean;
|
|
1267
|
+
follow?: boolean;
|
|
1268
|
+
signal?: AbortSignal;
|
|
1269
|
+
}
|
|
1270
|
+
function filepath(): Promise<string | null>;
|
|
1271
|
+
function isUsingRipgrep(): Promise<boolean>;
|
|
1272
|
+
function files(options: FilesOptions): AsyncGenerator<string>;
|
|
1273
|
+
function tree(options: TreeOptions): Promise<string>;
|
|
1274
|
+
function search(options: SearchOptions): Promise<Match[]>;
|
|
1275
|
+
function match(filepath: string, pattern: string): boolean;
|
|
1276
|
+
function filepathCached(): Promise<string | null>;
|
|
1277
|
+
const _ready: {
|
|
1278
|
+
(): Promise<string | null>;
|
|
1279
|
+
reset(): void;
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1235
1283
|
declare namespace Keybind {
|
|
1236
1284
|
type Info = {
|
|
1237
1285
|
name: string;
|
|
@@ -1374,4 +1422,4 @@ declare namespace Log {
|
|
|
1374
1422
|
function create(tags?: Record<string, any>): Logger;
|
|
1375
1423
|
}
|
|
1376
1424
|
|
|
1377
|
-
export { $, Archive, AsyncQueue, Binary, type CodeSpanIndex$1 as CodeSpanIndex, Color, Context, DEFAULT_LANG, type EasServer, Encode, EventLoop, type FenceSpan$1 as FenceSpan, Fetch, type FetchResponse, Filesystem, Fn, type FormatOptions, type GitResult, Glob, Identifier, Ignore, type InlineCodeState$1 as InlineCodeState, Keybind, type Lang, Lazy, Locale, Lock, Log, MIME_TYPES, Markdown, type MarkdownConfig, type MarkdownIR, type MarkdownLinkSpan, type MarkdownParseOptions, type MarkdownStyle, type MarkdownStyleSpan, type MarkdownTableMode, type MiddlewareDefinition, NamedError, type NodeSpawnObjectArgs, type NodeSpawnOptions, type NodeSpawnResult, type NodeWhichOptions, PKG, PackageRegistry, type ParseCommandResult, type ParsedFrontmatter, type ParsedVersion, PkgShell, type ProxyOptions, type RPCMethod, type RenderLink, type RenderOptions, type RequestOptions, type RouteDefinition, type SSEHandler, SUPPORTED_LANGS, Semver, type ServerOptions, SessionTitle, Shell, Slug, type StreamHandler, type StyleMarker, type TimezoneDateParts, Token, TruncateContent, type WebSocketHandler, type WebSocketRouteDefinition, Wildcard, abortAfter, abortAfterAny, addMinutesInTimezone, buildCodeSpanIndex, chunkMarkdownIR, chunkText, chunkTextByBreakResolver, convertMarkdownTables, createInlineCodeState, createPkgShell, createRESTServer, createRPCServer, createServer, createStreamingServer, createWebSocketServer, defer, detectPlatform, escapeCommandArg, escapeCommandArgSafe, extractFrontmatter, findFenceSpanAt, findLast, fn, formatDuration, formatLocalISO, formatLocalISOCompact, formatLogTime, formatLogTimeMs, formatMarkdown, getDirectory, getFileExtension, getFilename, getFilenameTruncated, getProxyConfig, getProxyUrl, getTimezoneOffset, getTimezoneParts, git, iife, isSafeFenceBreak, isValidTimezone, joinCommandArgs, lazy, lazyAsync, loadEnv, loadTextFile, loadTextFileAsync, markdownToIR, markdownToIRWithMeta, needsShellExecution, normalizeTimezone, now, nowLocalISO, parseCommand, parseCommandWithOptions, parseFenceSpans, parseFrontmatterBlock, parseLocalISO, parseModelId, proxied, readableStreamToText, renderMarkdown, renderMarkdownWithMarkers, resolveLocaleLang, retry, scanParenAwareBreakpoints, serializeFrontmatter, shell, signal, startServer, truncateMiddle, updateSchema, whichSync, withTimeout, work };
|
|
1425
|
+
export { $, Archive, AsyncQueue, Binary, type CodeSpanIndex$1 as CodeSpanIndex, Color, Context, DEFAULT_LANG, type EasServer, Encode, EventLoop, type FenceSpan$1 as FenceSpan, Fetch, type FetchResponse, Filesystem, Fn, type FormatOptions, type GitResult, Glob, Grep, Identifier, Ignore, type InlineCodeState$1 as InlineCodeState, Keybind, type Lang, Lazy, Locale, Lock, Log, MIME_TYPES, Markdown, type MarkdownConfig, type MarkdownIR, type MarkdownLinkSpan, type MarkdownParseOptions, type MarkdownStyle, type MarkdownStyleSpan, type MarkdownTableMode, type MiddlewareDefinition, NamedError, type NodeSpawnObjectArgs, type NodeSpawnOptions, type NodeSpawnResult, type NodeWhichOptions, PKG, PackageRegistry, type ParseCommandResult, type ParsedFrontmatter, type ParsedVersion, PkgShell, type ProxyOptions, type RPCMethod, type RenderLink, type RenderOptions, type RequestOptions, type RouteDefinition, type SSEHandler, SUPPORTED_LANGS, Semver, type ServerOptions, SessionTitle, Shell, Slug, type StreamHandler, type StyleMarker, type TimezoneDateParts, Token, TruncateContent, type WebSocketHandler, type WebSocketRouteDefinition, Wildcard, abortAfter, abortAfterAny, addMinutesInTimezone, buildCodeSpanIndex, chunkMarkdownIR, chunkText, chunkTextByBreakResolver, convertMarkdownTables, createInlineCodeState, createPkgShell, createRESTServer, createRPCServer, createServer, createStreamingServer, createWebSocketServer, defer, detectPlatform, escapeCommandArg, escapeCommandArgSafe, extractFrontmatter, findFenceSpanAt, findLast, fn, formatDuration, formatLocalISO, formatLocalISOCompact, formatLogTime, formatLogTimeMs, formatMarkdown, getDirectory, getFileExtension, getFilename, getFilenameTruncated, getProxyConfig, getProxyUrl, getTimezoneOffset, getTimezoneParts, git, iife, isSafeFenceBreak, isValidTimezone, joinCommandArgs, lazy, lazyAsync, loadEnv, loadTextFile, loadTextFileAsync, markdownToIR, markdownToIRWithMeta, needsShellExecution, normalizeTimezone, now, nowLocalISO, parseCommand, parseCommandWithOptions, parseFenceSpans, parseFrontmatterBlock, parseLocalISO, parseModelId, proxied, readableStreamToText, renderMarkdown, renderMarkdownWithMarkers, resolveLocaleLang, retry, scanParenAwareBreakpoints, serializeFrontmatter, shell, signal, startServer, truncateMiddle, updateSchema, whichSync, withTimeout, work };
|
package/dist/index.d.ts
CHANGED
|
@@ -1223,6 +1223,7 @@ declare namespace Glob {
|
|
|
1223
1223
|
symlink?: boolean;
|
|
1224
1224
|
ignore?: string[];
|
|
1225
1225
|
}
|
|
1226
|
+
const DEFAULT_MAX_DEPTH = 20;
|
|
1226
1227
|
function scan(pattern: string, options?: Options): Promise<string[]>;
|
|
1227
1228
|
function scanSync(pattern: string, options?: Options): string[];
|
|
1228
1229
|
function match(pattern: string, filepath: string): boolean;
|
|
@@ -1232,6 +1233,53 @@ declare namespace Glob {
|
|
|
1232
1233
|
const DEFAULT_IGNORE_PATTERNS: string[];
|
|
1233
1234
|
}
|
|
1234
1235
|
|
|
1236
|
+
declare namespace Grep {
|
|
1237
|
+
interface RipgrepInfo {
|
|
1238
|
+
filepath: string;
|
|
1239
|
+
}
|
|
1240
|
+
interface Match {
|
|
1241
|
+
path: string;
|
|
1242
|
+
lines: string;
|
|
1243
|
+
line_number: number;
|
|
1244
|
+
absolute_offset: number;
|
|
1245
|
+
}
|
|
1246
|
+
interface FilesOptions {
|
|
1247
|
+
cwd: string;
|
|
1248
|
+
glob?: string[];
|
|
1249
|
+
hidden?: boolean;
|
|
1250
|
+
follow?: boolean;
|
|
1251
|
+
maxDepth?: number;
|
|
1252
|
+
signal?: AbortSignal;
|
|
1253
|
+
}
|
|
1254
|
+
interface TreeOptions {
|
|
1255
|
+
cwd: string;
|
|
1256
|
+
limit?: number;
|
|
1257
|
+
signal?: AbortSignal;
|
|
1258
|
+
glob?: string[];
|
|
1259
|
+
hidden?: boolean;
|
|
1260
|
+
}
|
|
1261
|
+
interface SearchOptions {
|
|
1262
|
+
cwd: string;
|
|
1263
|
+
pattern: string;
|
|
1264
|
+
glob?: string[];
|
|
1265
|
+
limit?: number;
|
|
1266
|
+
hidden?: boolean;
|
|
1267
|
+
follow?: boolean;
|
|
1268
|
+
signal?: AbortSignal;
|
|
1269
|
+
}
|
|
1270
|
+
function filepath(): Promise<string | null>;
|
|
1271
|
+
function isUsingRipgrep(): Promise<boolean>;
|
|
1272
|
+
function files(options: FilesOptions): AsyncGenerator<string>;
|
|
1273
|
+
function tree(options: TreeOptions): Promise<string>;
|
|
1274
|
+
function search(options: SearchOptions): Promise<Match[]>;
|
|
1275
|
+
function match(filepath: string, pattern: string): boolean;
|
|
1276
|
+
function filepathCached(): Promise<string | null>;
|
|
1277
|
+
const _ready: {
|
|
1278
|
+
(): Promise<string | null>;
|
|
1279
|
+
reset(): void;
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1235
1283
|
declare namespace Keybind {
|
|
1236
1284
|
type Info = {
|
|
1237
1285
|
name: string;
|
|
@@ -1374,4 +1422,4 @@ declare namespace Log {
|
|
|
1374
1422
|
function create(tags?: Record<string, any>): Logger;
|
|
1375
1423
|
}
|
|
1376
1424
|
|
|
1377
|
-
export { $, Archive, AsyncQueue, Binary, type CodeSpanIndex$1 as CodeSpanIndex, Color, Context, DEFAULT_LANG, type EasServer, Encode, EventLoop, type FenceSpan$1 as FenceSpan, Fetch, type FetchResponse, Filesystem, Fn, type FormatOptions, type GitResult, Glob, Identifier, Ignore, type InlineCodeState$1 as InlineCodeState, Keybind, type Lang, Lazy, Locale, Lock, Log, MIME_TYPES, Markdown, type MarkdownConfig, type MarkdownIR, type MarkdownLinkSpan, type MarkdownParseOptions, type MarkdownStyle, type MarkdownStyleSpan, type MarkdownTableMode, type MiddlewareDefinition, NamedError, type NodeSpawnObjectArgs, type NodeSpawnOptions, type NodeSpawnResult, type NodeWhichOptions, PKG, PackageRegistry, type ParseCommandResult, type ParsedFrontmatter, type ParsedVersion, PkgShell, type ProxyOptions, type RPCMethod, type RenderLink, type RenderOptions, type RequestOptions, type RouteDefinition, type SSEHandler, SUPPORTED_LANGS, Semver, type ServerOptions, SessionTitle, Shell, Slug, type StreamHandler, type StyleMarker, type TimezoneDateParts, Token, TruncateContent, type WebSocketHandler, type WebSocketRouteDefinition, Wildcard, abortAfter, abortAfterAny, addMinutesInTimezone, buildCodeSpanIndex, chunkMarkdownIR, chunkText, chunkTextByBreakResolver, convertMarkdownTables, createInlineCodeState, createPkgShell, createRESTServer, createRPCServer, createServer, createStreamingServer, createWebSocketServer, defer, detectPlatform, escapeCommandArg, escapeCommandArgSafe, extractFrontmatter, findFenceSpanAt, findLast, fn, formatDuration, formatLocalISO, formatLocalISOCompact, formatLogTime, formatLogTimeMs, formatMarkdown, getDirectory, getFileExtension, getFilename, getFilenameTruncated, getProxyConfig, getProxyUrl, getTimezoneOffset, getTimezoneParts, git, iife, isSafeFenceBreak, isValidTimezone, joinCommandArgs, lazy, lazyAsync, loadEnv, loadTextFile, loadTextFileAsync, markdownToIR, markdownToIRWithMeta, needsShellExecution, normalizeTimezone, now, nowLocalISO, parseCommand, parseCommandWithOptions, parseFenceSpans, parseFrontmatterBlock, parseLocalISO, parseModelId, proxied, readableStreamToText, renderMarkdown, renderMarkdownWithMarkers, resolveLocaleLang, retry, scanParenAwareBreakpoints, serializeFrontmatter, shell, signal, startServer, truncateMiddle, updateSchema, whichSync, withTimeout, work };
|
|
1425
|
+
export { $, Archive, AsyncQueue, Binary, type CodeSpanIndex$1 as CodeSpanIndex, Color, Context, DEFAULT_LANG, type EasServer, Encode, EventLoop, type FenceSpan$1 as FenceSpan, Fetch, type FetchResponse, Filesystem, Fn, type FormatOptions, type GitResult, Glob, Grep, Identifier, Ignore, type InlineCodeState$1 as InlineCodeState, Keybind, type Lang, Lazy, Locale, Lock, Log, MIME_TYPES, Markdown, type MarkdownConfig, type MarkdownIR, type MarkdownLinkSpan, type MarkdownParseOptions, type MarkdownStyle, type MarkdownStyleSpan, type MarkdownTableMode, type MiddlewareDefinition, NamedError, type NodeSpawnObjectArgs, type NodeSpawnOptions, type NodeSpawnResult, type NodeWhichOptions, PKG, PackageRegistry, type ParseCommandResult, type ParsedFrontmatter, type ParsedVersion, PkgShell, type ProxyOptions, type RPCMethod, type RenderLink, type RenderOptions, type RequestOptions, type RouteDefinition, type SSEHandler, SUPPORTED_LANGS, Semver, type ServerOptions, SessionTitle, Shell, Slug, type StreamHandler, type StyleMarker, type TimezoneDateParts, Token, TruncateContent, type WebSocketHandler, type WebSocketRouteDefinition, Wildcard, abortAfter, abortAfterAny, addMinutesInTimezone, buildCodeSpanIndex, chunkMarkdownIR, chunkText, chunkTextByBreakResolver, convertMarkdownTables, createInlineCodeState, createPkgShell, createRESTServer, createRPCServer, createServer, createStreamingServer, createWebSocketServer, defer, detectPlatform, escapeCommandArg, escapeCommandArgSafe, extractFrontmatter, findFenceSpanAt, findLast, fn, formatDuration, formatLocalISO, formatLocalISOCompact, formatLogTime, formatLogTimeMs, formatMarkdown, getDirectory, getFileExtension, getFilename, getFilenameTruncated, getProxyConfig, getProxyUrl, getTimezoneOffset, getTimezoneParts, git, iife, isSafeFenceBreak, isValidTimezone, joinCommandArgs, lazy, lazyAsync, loadEnv, loadTextFile, loadTextFileAsync, markdownToIR, markdownToIRWithMeta, needsShellExecution, normalizeTimezone, now, nowLocalISO, parseCommand, parseCommandWithOptions, parseFenceSpans, parseFrontmatterBlock, parseLocalISO, parseModelId, proxied, readableStreamToText, renderMarkdown, renderMarkdownWithMarkers, resolveLocaleLang, retry, scanParenAwareBreakpoints, serializeFrontmatter, shell, signal, startServer, truncateMiddle, updateSchema, whichSync, withTimeout, work };
|