@bkm016/basalt 0.1.9 → 0.1.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/{chunk-0xd9mnc2.js → chunk-0mjb3sm3.js} +2 -2
- package/{chunk-66h5qpc6.js → chunk-3mqf9ped.js} +89 -89
- package/compiled.js +1 -1
- package/package.json +1 -1
- package/ui-test-worker.js +1 -1
- package/web/chunk-045d3b5d.js +1 -0
- package/web/{chunk-ff1pmd3g.js → chunk-0770q5e1.js} +1 -1
- package/web/{chunk-2x4g9t37.js → chunk-18neka5g.js} +2 -2
- package/web/{chunk-w3w18stt.js → chunk-1ev0n3n4.js} +1 -1
- package/web/chunk-1ex3wgms.js +2 -0
- package/web/{chunk-7qkav30b.js → chunk-1qh7f5kr.js} +1 -1
- package/web/{chunk-rayf24gy.js → chunk-26ecc2xh.js} +8 -8
- package/web/{chunk-me7dza1c.js → chunk-2cz7tx8q.js} +1 -1
- package/web/{chunk-mdfksj61.js → chunk-32ty2xfn.js} +1 -1
- package/web/{chunk-ts6jsfdk.js → chunk-3eexx7y5.js} +1 -1
- package/web/{chunk-2dvbeqt0.js → chunk-46jnkghq.js} +1 -1
- package/web/chunk-4am8j3k3.js +1 -0
- package/web/{chunk-qz6r9v1z.js → chunk-5qvmefq2.js} +1 -1
- package/web/{chunk-9ctg0f30.js → chunk-5svqfj4g.js} +1 -1
- package/web/{chunk-qsqtwf34.js → chunk-5v5q13hz.js} +1 -1
- package/web/chunk-7np1jp3x.js +8 -0
- package/web/chunk-87e8d1hv.js +1 -0
- package/web/{chunk-kcjz03h5.js → chunk-88wd49xe.js} +2 -2
- package/web/{chunk-0pghpg4y.js → chunk-8h2x89tw.js} +1 -1
- package/web/chunk-8y2526ve.js +1 -0
- package/web/{chunk-8jcvdd5d.js → chunk-905vw286.js} +1 -1
- package/web/{chunk-2hrswh3d.js → chunk-918e5t4x.js} +1 -1
- package/web/chunk-96m2m3e8.js +1 -0
- package/web/{chunk-43g4wd7a.js → chunk-9f4zzqbx.js} +1 -1
- package/web/{chunk-dnv8dx72.js → chunk-a1n4468c.js} +1 -1
- package/web/{chunk-s37beysw.js → chunk-b46ws7rf.js} +1 -1
- package/web/{chunk-24jhbz82.js → chunk-bc3ajvfg.js} +1 -1
- package/web/{chunk-ket6g0yd.js → chunk-d5gshd1a.js} +1 -1
- package/web/{chunk-c6yacwbc.js → chunk-de40q05r.js} +1 -1
- package/web/chunk-dp0k5vhd.js +1 -0
- package/web/{chunk-5dr4tkem.js → chunk-dv1berk6.js} +3 -3
- package/web/{chunk-dwjmr0zj.js → chunk-eh7wp62z.js} +1 -1
- package/web/{chunk-ctzkqx2g.js → chunk-ehtmb6sn.js} +1 -1
- package/web/chunk-et1hytyv.js +1 -0
- package/web/chunk-f9m9seam.js +1 -0
- package/web/{chunk-3pd0qt83.js → chunk-fmmrthpa.js} +2 -2
- package/web/chunk-g2erm7k0.js +1 -0
- package/web/chunk-g3kbn0t2.js +1 -0
- package/web/{chunk-t893141g.js → chunk-g7dc4hrd.js} +1 -1
- package/web/{chunk-p9hfcamx.js → chunk-g7kz8f7q.js} +1 -1
- package/web/chunk-ght0t49g.js +1 -0
- package/web/{chunk-xa43ndfj.js → chunk-ghwm7bdj.js} +2 -2
- package/web/{chunk-8z0r0wtk.js → chunk-grm2208k.js} +1 -1
- package/web/{chunk-0zwc2rvh.js → chunk-gsw1tv96.js} +1 -1
- package/web/{chunk-tftc5v89.js → chunk-gw8x1g61.js} +1 -1
- package/web/chunk-gx340asc.js +1 -0
- package/web/{chunk-935mjq1c.js → chunk-h2txs73e.js} +1 -1
- package/web/chunk-h3tkacc7.js +1 -0
- package/web/{chunk-ewx42c11.js → chunk-h5ckjk48.js} +1 -1
- package/web/{chunk-nnyc889n.js → chunk-j37p0b13.js} +1 -1
- package/web/{chunk-fjb3ksfd.js → chunk-j89s11x8.js} +1 -1
- package/web/chunk-je78j3vr.js +1 -0
- package/web/{chunk-fpb2dd2d.js → chunk-jke2ev6m.js} +1 -1
- package/web/{chunk-98y92vmh.js → chunk-js6kb05s.js} +1 -1
- package/web/{chunk-30b33r2w.js → chunk-k0cg4n2k.js} +2 -2
- package/web/{chunk-b5h52neg.js → chunk-knm82fw9.js} +1 -1
- package/web/{chunk-vqmj6peg.js → chunk-kxdtg9dt.js} +1 -1
- package/web/{chunk-db3twjvk.js → chunk-m4fxd5d9.js} +5 -5
- package/web/chunk-m9xzt9p7.js +1 -0
- package/web/{chunk-xx11yv61.js → chunk-n4yzs2q0.js} +1 -1
- package/web/{chunk-zdyys4ar.js → chunk-nawxgz87.js} +2 -2
- package/web/chunk-ngt1j8py.js +1139 -0
- package/web/{chunk-3ak5dg10.js → chunk-p55vhns6.js} +1 -1
- package/web/{chunk-nvpp0ghj.js → chunk-pgwf37s2.js} +1 -1
- package/web/{chunk-af9evdza.js → chunk-q4bst4an.js} +1 -1
- package/web/{chunk-9fnr00kv.js → chunk-qdzy124b.js} +2 -2
- package/web/chunk-qe0bgeda.js +1 -0
- package/web/{chunk-60axh4sa.js → chunk-qy1zx2yw.js} +2 -2
- package/web/{chunk-sk1wkgjw.js → chunk-rag65pfs.js} +1 -1
- package/web/{chunk-5jdrev9p.js → chunk-rbqnre6q.js} +3 -3
- package/web/{chunk-ddyyc20r.js → chunk-rh3xb76f.js} +1 -1
- package/web/{chunk-wzd2a4k5.js → chunk-rwfmccmh.js} +1 -1
- package/web/{chunk-zb2bkr7f.js → chunk-rxvm70w5.js} +1 -1
- package/web/{chunk-z05x9cbm.js → chunk-sat7zyva.js} +1 -1
- package/web/{chunk-rrpn5r5w.js → chunk-sc63488q.js} +1 -1
- package/web/{chunk-v1exk5wd.js → chunk-sd3xat3r.js} +6 -6
- package/web/{chunk-4a6gdrbs.js → chunk-se4h6wx0.js} +1 -1
- package/web/{chunk-a0ryzdnp.js → chunk-sjkg40ay.js} +1 -1
- package/web/chunk-sk0hpa80.js +1 -0
- package/web/{chunk-spbs56wz.js → chunk-t5nvgz7z.js} +1 -1
- package/web/{chunk-veam6vk4.js → chunk-tfqarvdx.js} +30 -30
- package/web/{chunk-5a4mj3qz.js → chunk-tqze6d6b.js} +1 -1
- package/web/{chunk-8w7fyb3v.js → chunk-tt93zbn4.js} +7 -7
- package/web/chunk-tvcxrx6h.js +1 -0
- package/web/chunk-tzpnh70q.js +1 -0
- package/web/{chunk-79e08rk1.js → chunk-vasppf6b.js} +1 -1
- package/web/chunk-vb7g4xg6.js +1 -0
- package/web/{chunk-dz7g1gnv.js → chunk-w3zgfhjb.js} +1 -1
- package/web/{chunk-gn8kyz76.js → chunk-wrevb4ew.js} +1 -1
- package/web/{chunk-3ecrkvr3.js → chunk-wtvch4ad.js} +1 -1
- package/web/chunk-wzfe6jtq.js +1 -0
- package/web/{chunk-eadfxfkw.js → chunk-x5g1yy12.js} +1 -1
- package/web/{chunk-m9q5nr8f.js → chunk-x850q01z.js} +1 -1
- package/web/{chunk-a61zrp66.js → chunk-xk904wqv.js} +1 -1
- package/web/{chunk-3hr3ew9w.js → chunk-xtn305fd.js} +1 -1
- package/web/{chunk-3txxt0a7.js → chunk-yekaz74b.js} +1 -1
- package/web/{chunk-rasjtvsb.js → chunk-yppgejg7.js} +2 -2
- package/web/{chunk-66wb0p6e.js → chunk-z4bp6p32.js} +1 -1
- package/web/{chunk-5v2c0aqk.js → chunk-z5qn0xev.js} +1 -1
- package/web/{chunk-5baeh8q7.js → chunk-zms6mrqk.js} +4 -4
- package/web/{chunk-601k823s.js → chunk-zse05v6j.js} +2 -2
- package/web/{chunk-vsjpnwsr.js → chunk-zz1qkaar.js} +1 -1
- package/web/index.html +1 -1
- package/web/chunk-08sq3cwm.js +0 -1
- package/web/chunk-24fjnnee.js +0 -1
- package/web/chunk-2j2atyjw.js +0 -1
- package/web/chunk-3h3g3ca3.js +0 -1
- package/web/chunk-3pcrxg6m.js +0 -1
- package/web/chunk-814kkkmq.js +0 -8
- package/web/chunk-8w8atrdh.js +0 -1
- package/web/chunk-942g3eqn.js +0 -1
- package/web/chunk-avxk6jpc.js +0 -2
- package/web/chunk-fmthkpff.js +0 -1
- package/web/chunk-gv99c8zv.js +0 -1
- package/web/chunk-h0767tjv.js +0 -1
- package/web/chunk-hqynf99g.js +0 -1
- package/web/chunk-mbwwj216.js +0 -1
- package/web/chunk-n0wazxgz.js +0 -1
- package/web/chunk-nvt9tkt4.js +0 -1139
- package/web/chunk-ph1dgffm.js +0 -1
- package/web/chunk-rad2s9ha.js +0 -1
- package/web/chunk-s60s09mb.js +0 -1
- package/web/chunk-tfvcs2xx.js +0 -1
- package/web/chunk-wdq2tp9e.js +0 -1
- package/web/chunk-wkf5xfyr.js +0 -1
- package/web/chunk-y1qty77a.js +0 -1
- package/web/chunk-zgavhnt8.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import{t,f,Fr,Wr,li,$r,er,Io,Ln,ci,ui,pi,Bt,di,mi,Hr,Mo,hi,Be,fi,ut,Ft,z,Lo,je,et,B,n,l,qr,O,_,s,Y,a,m,h,le,On,Oo,No,Do,Uo,_e,x,tt,pt,k,D,F,Re,ce,Te,c,de,rt,tr,rr,nr,dt,ie,Bo,or,ir,ne,Nn,Gr,Fo,zr,Ce,Wt,sr,ar,lr,N,v,Wo,gi}from"./chunk-66h5qpc6.js";import"./chunk-4gtgqcct.js";import"./chunk-c71173py.js";import{ro,Qt,Vo,yt,Ko,Tr,Qo,Rt,A,Xo,bt,Ct,en,no,Jo,tn,rn,It,kr,nn,on,sn,an,ln,cn,Yo,oo,io,so,ao,lo,co,uo,po,it,Rr,Zo,mo,ho,fo,go,yo,bo,S,he,$e,Mt}from"./chunk-d5j74pcp.js";import{xo,ei,ti,dn,mn,hn,fn,gn,Xt,vo}from"./chunk-95964592.js";import"./chunk-c4qr1f41.js";import{mr,to}from"./chunk-13gvs0ax.js";import{Jt}from"./chunk-8mezk0cb.js";import{ai}from"./chunk-c6q04xrd.js";import{Ie,te,Me,Qn,d}from"./chunk-1n7dat03.js";import{i,r,p}from"./chunk-bwawt15q.js";var Es=r(function(Ax){Object.defineProperty(Ax,"__esModule",{value:!0});Ax.regexpCode=Ax.getEsmExportName=Ax.getProperty=Ax.safeStringify=Ax.stringify=Ax.strConcat=Ax.addCodeArg=Ax.str=Ax._=Ax.nil=Ax._Code=Ax.Name=Ax.IDENTIFIER=Ax._CodeOrName=void 0;class Mc{}Ax._CodeOrName=Mc;Ax.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Sn extends Mc{constructor(e){super();if(!Ax.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Ax.Name=Sn;class ia extends Mc{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((o,u)=>`${o}${u}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((o,u)=>{if(u instanceof Sn)o[u.str]=(o[u.str]||0)+1;return o},{})}}Ax._Code=ia;Ax.nil=new ia("");function Tx(e,...o){let u=[e[0]],g=0;while(g<o.length)Tm(u,o[g]),u.push(e[++g]);return new ia(u)}Ax._=Tx;var _m=new ia("+");function Rx(e,...o){let u=[Ms(e[0])],g=0;while(g<o.length)u.push(_m),Tm(u,o[g]),u.push(_m,Ms(e[++g]));return SW(u),new ia(u)}Ax.str=Rx;function Tm(e,o){if(o instanceof ia)e.push(...o._items);else if(o instanceof Sn)e.push(o);else e.push(RW(o))}Ax.addCodeArg=Tm;function SW(e){let o=1;while(o<e.length-1){if(e[o]===_m){let u=_W(e[o-1],e[o+1]);if(u!==void 0){e.splice(o-1,3,u);continue}e[o++]="+"}o++}}function _W(e,o){if(o==='""')return e;if(e==='""')return o;if(typeof e=="string"){if(o instanceof Sn||e[e.length-1]!=='"')return;if(typeof o!="string")return`${e.slice(0,-1)}${o}"`;if(o[0]==='"')return e.slice(0,-1)+o.slice(1);return}if(typeof o=="string"&&o[0]==='"'&&!(e instanceof Sn))return`"${e}${o.slice(1)}`;return}function TW(e,o){return o.emptyStr()?e:e.emptyStr()?o:Rx`${e}${o}`}Ax.strConcat=TW;function RW(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ms(Array.isArray(e)?e.join(","):e)}function AW(e){return new ia(Ms(e))}Ax.stringify=AW;function Ms(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ax.safeStringify=Ms;function WW(e){return typeof e=="string"&&Ax.IDENTIFIER.test(e)?new ia(`.${e}`):Tx`[${e}]`}Ax.getProperty=WW;function MW(e){if(typeof e=="string"&&Ax.IDENTIFIER.test(e))return new ia(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Ax.getEsmExportName=MW;function EW(e){return new ia(e.toString())}Ax.regexpCode=EW});var Mm=r(function(Lx){Object.defineProperty(Lx,"__esModule",{value:!0});Lx.ValueScope=Lx.ValueScopeName=Lx.Scope=Lx.varKinds=Lx.UsedValueState=void 0;var Tt=Es();class Mx extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Lc;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Lc||(Lx.UsedValueState=Lc={}));Lx.varKinds={const:new Tt.Name("const"),let:new Tt.Name("let"),var:new Tt.Name("var")};class Am{constructor({prefixes:e,parent:o}={}){this._names={},this._prefixes=e,this._parent=o}toName(e){return e instanceof Tt.Name?e:this.name(e)}name(e){return new Tt.Name(this._newName(e))}_newName(e){let o=this._names[e]||this._nameGroup(e);return`${e}${o.index++}`}_nameGroup(e){var o,u;if(((u=(o=this._parent)===null||o===void 0?void 0:o._prefixes)===null||u===void 0?void 0:u.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}Lx.Scope=Am;class Wm extends Tt.Name{constructor(e,o){super(o);this.prefix=e}setValue(e,{property:o,itemIndex:u}){this.value=e,this.scopePath=Tt._`.${new Tt.Name(o)}[${u}]`}}Lx.ValueScopeName=Wm;var FW=Tt._`\n`;class Ex extends Am{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?FW:Tt.nil}}get(){return this._scope}name(e){return new Wm(e,this._newName(e))}value(e,o){var u;if(o.ref===void 0)throw Error("CodeGen: ref must be passed in value");let g=this.toName(e),{prefix:y}=g,w=(u=o.key)!==null&&u!==void 0?u:o.ref,T=this._values[y];if(T){let W=T.get(w);if(W)return W}else T=this._values[y]=new Map;T.set(w,g);let b=this._scope[y]||(this._scope[y]=[]),R=b.length;return b[R]=o.ref,g.setValue(o,{property:y,itemIndex:R}),g}getValue(e,o){let u=this._values[e];if(!u)return;return u.get(o)}scopeRefs(e,o=this._values){return this._reduceValues(o,(u)=>{if(u.scopePath===void 0)throw Error(`CodeGen: name "${u}" has no value`);return Tt._`${e}${u.scopePath}`})}scopeCode(e=this._values,o,u){return this._reduceValues(e,(g)=>{if(g.value===void 0)throw Error(`CodeGen: name "${g}" has no value`);return g.value.code},o,u)}_reduceValues(e,o,u={},g){let y=Tt.nil;for(let w in e){let T=e[w];if(!T)continue;let b=u[w]=u[w]||new Map;T.forEach((R)=>{if(b.has(R))return;b.set(R,Lc.Started);let W=o(R);if(W){let E=this.opts.es5?Lx.varKinds.var:Lx.varKinds.const;y=Tt._`${y}${E} ${R} = ${W};${this.opts._n}`}else if(W=g===null||g===void 0?void 0:g(R))y=Tt._`${y}${W}${this.opts._n}`;else throw new Mx(R);b.set(R,Lc.Completed)})}return y}}Lx.ValueScope=Ex});var ct=r(function(Oi){Object.defineProperty(Oi,"__esModule",{value:!0});Oi.or=Oi.and=Oi.not=Oi.CodeGen=Oi.operators=Oi.varKinds=Oi.ValueScopeName=Oi.ValueScope=Oi.Scope=Oi.Name=Oi.regexpCode=Oi.stringify=Oi.getProperty=Oi.nil=Oi.strConcat=Oi.str=Oi._=void 0;var qe=Es(),$t=Mm(),Qa=Es();Object.defineProperty(Oi,"_",{enumerable:!0,get:function(){return Qa._}});Object.defineProperty(Oi,"str",{enumerable:!0,get:function(){return Qa.str}});Object.defineProperty(Oi,"strConcat",{enumerable:!0,get:function(){return Qa.strConcat}});Object.defineProperty(Oi,"nil",{enumerable:!0,get:function(){return Qa.nil}});Object.defineProperty(Oi,"getProperty",{enumerable:!0,get:function(){return Qa.getProperty}});Object.defineProperty(Oi,"stringify",{enumerable:!0,get:function(){return Qa.stringify}});Object.defineProperty(Oi,"regexpCode",{enumerable:!0,get:function(){return Qa.regexpCode}});Object.defineProperty(Oi,"Name",{enumerable:!0,get:function(){return Qa.Name}});var Uc=Mm();Object.defineProperty(Oi,"Scope",{enumerable:!0,get:function(){return Uc.Scope}});Object.defineProperty(Oi,"ValueScope",{enumerable:!0,get:function(){return Uc.ValueScope}});Object.defineProperty(Oi,"ValueScopeName",{enumerable:!0,get:function(){return Uc.ValueScopeName}});Object.defineProperty(Oi,"varKinds",{enumerable:!0,get:function(){return Uc.varKinds}});Oi.operators={GT:new qe._Code(">"),GTE:new qe._Code(">="),LT:new qe._Code("<"),LTE:new qe._Code("<="),EQ:new qe._Code("==="),NEQ:new qe._Code("!=="),NOT:new qe._Code("!"),OR:new qe._Code("||"),AND:new qe._Code("&&"),ADD:new qe._Code("+")};class Va{optimizeNodes(){return this}optimizeNames(e,o){return this}}class Ix extends Va{constructor(e,o,u){super();this.varKind=e,this.name=o,this.rhs=u}render({es5:e,_n:o}){let u=e?$t.varKinds.var:this.varKind,g=this.rhs===void 0?"":` = ${this.rhs}`;return`${u} ${this.name}${g};`+o}optimizeNames(e,o){if(!e[this.name.str])return;if(this.rhs)this.rhs=Tn(this.rhs,e,o);return this}get names(){return this.rhs instanceof qe._CodeOrName?this.rhs.names:{}}}class Cm extends Va{constructor(e,o,u){super();this.lhs=e,this.rhs=o,this.sideEffects=u}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,o){if(this.lhs instanceof qe.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Tn(this.rhs,e,o),this}get names(){let e=this.lhs instanceof qe.Name?{}:{...this.lhs.names};return Oc(e,this.rhs)}}class Px extends Cm{constructor(e,o,u,g){super(e,u,g);this.op=o}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Dx extends Va{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Ox extends Va{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Ux extends Va{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Bx extends Va{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,o){return this.code=Tn(this.code,e,o),this}get names(){return this.code instanceof qe._CodeOrName?this.code.names:{}}}class Bc extends Va{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((o,u)=>o+u.render(e),"")}optimizeNodes(){let{nodes:e}=this,o=e.length;while(o--){let u=e[o].optimizeNodes();if(Array.isArray(u))e.splice(o,1,...u);else if(u)e[o]=u;else e.splice(o,1)}return e.length>0?this:void 0}optimizeNames(e,o){let{nodes:u}=this,g=u.length;while(g--){let y=u[g];if(y.optimizeNames(e,o))continue;QW(e,y.names),u.splice(g,1)}return u.length>0?this:void 0}get names(){return this.nodes.reduce((e,o)=>_r(e,o.names),{})}}class Ka extends Bc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class jx extends Bc{}class Ls extends Ka{}Ls.kind="else";class Ea extends Ka{constructor(e,o){super(o);this.condition=e}render(e){let o=`if(${this.condition})`+super.render(e);if(this.else)o+="else "+this.else.render(e);return o}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let o=this.else;if(o){let u=o.optimizeNodes();o=this.else=Array.isArray(u)?new Ls(u):u}if(o){if(e===!1)return o instanceof Ea?o:o.nodes;if(this.nodes.length)return this;return new Ea(Nx(e),o instanceof Ea?[o]:o.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,o){var u;if(this.else=(u=this.else)===null||u===void 0?void 0:u.optimizeNames(e,o),!(super.optimizeNames(e,o)||this.else))return;return this.condition=Tn(this.condition,e,o),this}get names(){let e=super.names;if(Oc(e,this.condition),this.else)_r(e,this.else.names);return e}}Ea.kind="if";class _n extends Ka{}_n.kind="for";class Hx extends _n{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,o){if(!super.optimizeNames(e,o))return;return this.iteration=Tn(this.iteration,e,o),this}get names(){return _r(super.names,this.iteration.names)}}class zx extends _n{constructor(e,o,u,g){super();this.varKind=e,this.name=o,this.from=u,this.to=g}render(e){let o=e.es5?$t.varKinds.var:this.varKind,{name:u,from:g,to:y}=this;return`for(${o} ${u}=${g}; ${u}<${y}; ${u}++)`+super.render(e)}get names(){let e=Oc(super.names,this.from);return Oc(e,this.to)}}class Em extends _n{constructor(e,o,u,g){super();this.loop=e,this.varKind=o,this.name=u,this.iterable=g}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,o){if(!super.optimizeNames(e,o))return;return this.iterable=Tn(this.iterable,e,o),this}get names(){return _r(super.names,this.iterable.names)}}class Cc extends Ka{constructor(e,o,u){super();this.name=e,this.args=o,this.async=u}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Cc.kind="func";class Ic extends Bc{render(e){return"return "+super.render(e)}}Ic.kind="return";class qx extends Ka{render(e){let o="try"+super.render(e);if(this.catch)o+=this.catch.render(e);if(this.finally)o+=this.finally.render(e);return o}optimizeNodes(){var e,o;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(o=this.finally)===null||o===void 0||o.optimizeNodes(),this}optimizeNames(e,o){var u,g;return super.optimizeNames(e,o),(u=this.catch)===null||u===void 0||u.optimizeNames(e,o),(g=this.finally)===null||g===void 0||g.optimizeNames(e,o),this}get names(){let e=super.names;if(this.catch)_r(e,this.catch.names);if(this.finally)_r(e,this.finally.names);return e}}class Pc extends Ka{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Pc.kind="catch";class Dc extends Ka{render(e){return"finally"+super.render(e)}}Dc.kind="finally";class Fx{constructor(e,o={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...o,_n:o.lines?`
|
|
3
|
+
import{t,f,Fr,Wr,li,$r,er,Io,Ln,ci,ui,pi,Bt,di,mi,Hr,Mo,hi,Be,fi,ut,Ft,z,Lo,je,et,B,n,l,qr,O,_,s,Y,a,m,h,le,On,Oo,No,Do,Uo,_e,x,tt,pt,k,D,F,Re,ce,Te,c,de,rt,tr,rr,nr,dt,ie,Bo,or,ir,ne,Nn,Gr,Fo,zr,Ce,Wt,sr,ar,lr,N,v,Wo,gi}from"./chunk-3mqf9ped.js";import"./chunk-4gtgqcct.js";import"./chunk-c71173py.js";import{ro,Qt,Vo,yt,Ko,Tr,Qo,Rt,A,Xo,bt,Ct,en,no,Jo,tn,rn,It,kr,nn,on,sn,an,ln,cn,Yo,oo,io,so,ao,lo,co,uo,po,it,Rr,Zo,mo,ho,fo,go,yo,bo,S,he,$e,Mt}from"./chunk-d5j74pcp.js";import{xo,ei,ti,dn,mn,hn,fn,gn,Xt,vo}from"./chunk-95964592.js";import"./chunk-c4qr1f41.js";import{mr,to}from"./chunk-13gvs0ax.js";import{Jt}from"./chunk-8mezk0cb.js";import{ai}from"./chunk-c6q04xrd.js";import{Ie,te,Me,Qn,d}from"./chunk-1n7dat03.js";import{i,r,p}from"./chunk-bwawt15q.js";var Es=r(function(Ax){Object.defineProperty(Ax,"__esModule",{value:!0});Ax.regexpCode=Ax.getEsmExportName=Ax.getProperty=Ax.safeStringify=Ax.stringify=Ax.strConcat=Ax.addCodeArg=Ax.str=Ax._=Ax.nil=Ax._Code=Ax.Name=Ax.IDENTIFIER=Ax._CodeOrName=void 0;class Mc{}Ax._CodeOrName=Mc;Ax.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Sn extends Mc{constructor(e){super();if(!Ax.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Ax.Name=Sn;class ia extends Mc{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((o,u)=>`${o}${u}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((o,u)=>{if(u instanceof Sn)o[u.str]=(o[u.str]||0)+1;return o},{})}}Ax._Code=ia;Ax.nil=new ia("");function Tx(e,...o){let u=[e[0]],g=0;while(g<o.length)Tm(u,o[g]),u.push(e[++g]);return new ia(u)}Ax._=Tx;var _m=new ia("+");function Rx(e,...o){let u=[Ms(e[0])],g=0;while(g<o.length)u.push(_m),Tm(u,o[g]),u.push(_m,Ms(e[++g]));return SW(u),new ia(u)}Ax.str=Rx;function Tm(e,o){if(o instanceof ia)e.push(...o._items);else if(o instanceof Sn)e.push(o);else e.push(RW(o))}Ax.addCodeArg=Tm;function SW(e){let o=1;while(o<e.length-1){if(e[o]===_m){let u=_W(e[o-1],e[o+1]);if(u!==void 0){e.splice(o-1,3,u);continue}e[o++]="+"}o++}}function _W(e,o){if(o==='""')return e;if(e==='""')return o;if(typeof e=="string"){if(o instanceof Sn||e[e.length-1]!=='"')return;if(typeof o!="string")return`${e.slice(0,-1)}${o}"`;if(o[0]==='"')return e.slice(0,-1)+o.slice(1);return}if(typeof o=="string"&&o[0]==='"'&&!(e instanceof Sn))return`"${e}${o.slice(1)}`;return}function TW(e,o){return o.emptyStr()?e:e.emptyStr()?o:Rx`${e}${o}`}Ax.strConcat=TW;function RW(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ms(Array.isArray(e)?e.join(","):e)}function AW(e){return new ia(Ms(e))}Ax.stringify=AW;function Ms(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ax.safeStringify=Ms;function WW(e){return typeof e=="string"&&Ax.IDENTIFIER.test(e)?new ia(`.${e}`):Tx`[${e}]`}Ax.getProperty=WW;function MW(e){if(typeof e=="string"&&Ax.IDENTIFIER.test(e))return new ia(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Ax.getEsmExportName=MW;function EW(e){return new ia(e.toString())}Ax.regexpCode=EW});var Mm=r(function(Lx){Object.defineProperty(Lx,"__esModule",{value:!0});Lx.ValueScope=Lx.ValueScopeName=Lx.Scope=Lx.varKinds=Lx.UsedValueState=void 0;var Tt=Es();class Mx extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Lc;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Lc||(Lx.UsedValueState=Lc={}));Lx.varKinds={const:new Tt.Name("const"),let:new Tt.Name("let"),var:new Tt.Name("var")};class Am{constructor({prefixes:e,parent:o}={}){this._names={},this._prefixes=e,this._parent=o}toName(e){return e instanceof Tt.Name?e:this.name(e)}name(e){return new Tt.Name(this._newName(e))}_newName(e){let o=this._names[e]||this._nameGroup(e);return`${e}${o.index++}`}_nameGroup(e){var o,u;if(((u=(o=this._parent)===null||o===void 0?void 0:o._prefixes)===null||u===void 0?void 0:u.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}Lx.Scope=Am;class Wm extends Tt.Name{constructor(e,o){super(o);this.prefix=e}setValue(e,{property:o,itemIndex:u}){this.value=e,this.scopePath=Tt._`.${new Tt.Name(o)}[${u}]`}}Lx.ValueScopeName=Wm;var FW=Tt._`\n`;class Ex extends Am{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?FW:Tt.nil}}get(){return this._scope}name(e){return new Wm(e,this._newName(e))}value(e,o){var u;if(o.ref===void 0)throw Error("CodeGen: ref must be passed in value");let g=this.toName(e),{prefix:y}=g,w=(u=o.key)!==null&&u!==void 0?u:o.ref,T=this._values[y];if(T){let W=T.get(w);if(W)return W}else T=this._values[y]=new Map;T.set(w,g);let b=this._scope[y]||(this._scope[y]=[]),R=b.length;return b[R]=o.ref,g.setValue(o,{property:y,itemIndex:R}),g}getValue(e,o){let u=this._values[e];if(!u)return;return u.get(o)}scopeRefs(e,o=this._values){return this._reduceValues(o,(u)=>{if(u.scopePath===void 0)throw Error(`CodeGen: name "${u}" has no value`);return Tt._`${e}${u.scopePath}`})}scopeCode(e=this._values,o,u){return this._reduceValues(e,(g)=>{if(g.value===void 0)throw Error(`CodeGen: name "${g}" has no value`);return g.value.code},o,u)}_reduceValues(e,o,u={},g){let y=Tt.nil;for(let w in e){let T=e[w];if(!T)continue;let b=u[w]=u[w]||new Map;T.forEach((R)=>{if(b.has(R))return;b.set(R,Lc.Started);let W=o(R);if(W){let E=this.opts.es5?Lx.varKinds.var:Lx.varKinds.const;y=Tt._`${y}${E} ${R} = ${W};${this.opts._n}`}else if(W=g===null||g===void 0?void 0:g(R))y=Tt._`${y}${W}${this.opts._n}`;else throw new Mx(R);b.set(R,Lc.Completed)})}return y}}Lx.ValueScope=Ex});var ct=r(function(Oi){Object.defineProperty(Oi,"__esModule",{value:!0});Oi.or=Oi.and=Oi.not=Oi.CodeGen=Oi.operators=Oi.varKinds=Oi.ValueScopeName=Oi.ValueScope=Oi.Scope=Oi.Name=Oi.regexpCode=Oi.stringify=Oi.getProperty=Oi.nil=Oi.strConcat=Oi.str=Oi._=void 0;var qe=Es(),$t=Mm(),Qa=Es();Object.defineProperty(Oi,"_",{enumerable:!0,get:function(){return Qa._}});Object.defineProperty(Oi,"str",{enumerable:!0,get:function(){return Qa.str}});Object.defineProperty(Oi,"strConcat",{enumerable:!0,get:function(){return Qa.strConcat}});Object.defineProperty(Oi,"nil",{enumerable:!0,get:function(){return Qa.nil}});Object.defineProperty(Oi,"getProperty",{enumerable:!0,get:function(){return Qa.getProperty}});Object.defineProperty(Oi,"stringify",{enumerable:!0,get:function(){return Qa.stringify}});Object.defineProperty(Oi,"regexpCode",{enumerable:!0,get:function(){return Qa.regexpCode}});Object.defineProperty(Oi,"Name",{enumerable:!0,get:function(){return Qa.Name}});var Uc=Mm();Object.defineProperty(Oi,"Scope",{enumerable:!0,get:function(){return Uc.Scope}});Object.defineProperty(Oi,"ValueScope",{enumerable:!0,get:function(){return Uc.ValueScope}});Object.defineProperty(Oi,"ValueScopeName",{enumerable:!0,get:function(){return Uc.ValueScopeName}});Object.defineProperty(Oi,"varKinds",{enumerable:!0,get:function(){return Uc.varKinds}});Oi.operators={GT:new qe._Code(">"),GTE:new qe._Code(">="),LT:new qe._Code("<"),LTE:new qe._Code("<="),EQ:new qe._Code("==="),NEQ:new qe._Code("!=="),NOT:new qe._Code("!"),OR:new qe._Code("||"),AND:new qe._Code("&&"),ADD:new qe._Code("+")};class Va{optimizeNodes(){return this}optimizeNames(e,o){return this}}class Ix extends Va{constructor(e,o,u){super();this.varKind=e,this.name=o,this.rhs=u}render({es5:e,_n:o}){let u=e?$t.varKinds.var:this.varKind,g=this.rhs===void 0?"":` = ${this.rhs}`;return`${u} ${this.name}${g};`+o}optimizeNames(e,o){if(!e[this.name.str])return;if(this.rhs)this.rhs=Tn(this.rhs,e,o);return this}get names(){return this.rhs instanceof qe._CodeOrName?this.rhs.names:{}}}class Cm extends Va{constructor(e,o,u){super();this.lhs=e,this.rhs=o,this.sideEffects=u}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,o){if(this.lhs instanceof qe.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Tn(this.rhs,e,o),this}get names(){let e=this.lhs instanceof qe.Name?{}:{...this.lhs.names};return Oc(e,this.rhs)}}class Px extends Cm{constructor(e,o,u,g){super(e,u,g);this.op=o}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Dx extends Va{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Ox extends Va{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Ux extends Va{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Bx extends Va{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,o){return this.code=Tn(this.code,e,o),this}get names(){return this.code instanceof qe._CodeOrName?this.code.names:{}}}class Bc extends Va{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((o,u)=>o+u.render(e),"")}optimizeNodes(){let{nodes:e}=this,o=e.length;while(o--){let u=e[o].optimizeNodes();if(Array.isArray(u))e.splice(o,1,...u);else if(u)e[o]=u;else e.splice(o,1)}return e.length>0?this:void 0}optimizeNames(e,o){let{nodes:u}=this,g=u.length;while(g--){let y=u[g];if(y.optimizeNames(e,o))continue;QW(e,y.names),u.splice(g,1)}return u.length>0?this:void 0}get names(){return this.nodes.reduce((e,o)=>_r(e,o.names),{})}}class Ka extends Bc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class jx extends Bc{}class Ls extends Ka{}Ls.kind="else";class Ea extends Ka{constructor(e,o){super(o);this.condition=e}render(e){let o=`if(${this.condition})`+super.render(e);if(this.else)o+="else "+this.else.render(e);return o}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let o=this.else;if(o){let u=o.optimizeNodes();o=this.else=Array.isArray(u)?new Ls(u):u}if(o){if(e===!1)return o instanceof Ea?o:o.nodes;if(this.nodes.length)return this;return new Ea(Nx(e),o instanceof Ea?[o]:o.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,o){var u;if(this.else=(u=this.else)===null||u===void 0?void 0:u.optimizeNames(e,o),!(super.optimizeNames(e,o)||this.else))return;return this.condition=Tn(this.condition,e,o),this}get names(){let e=super.names;if(Oc(e,this.condition),this.else)_r(e,this.else.names);return e}}Ea.kind="if";class _n extends Ka{}_n.kind="for";class Hx extends _n{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,o){if(!super.optimizeNames(e,o))return;return this.iteration=Tn(this.iteration,e,o),this}get names(){return _r(super.names,this.iteration.names)}}class zx extends _n{constructor(e,o,u,g){super();this.varKind=e,this.name=o,this.from=u,this.to=g}render(e){let o=e.es5?$t.varKinds.var:this.varKind,{name:u,from:g,to:y}=this;return`for(${o} ${u}=${g}; ${u}<${y}; ${u}++)`+super.render(e)}get names(){let e=Oc(super.names,this.from);return Oc(e,this.to)}}class Em extends _n{constructor(e,o,u,g){super();this.loop=e,this.varKind=o,this.name=u,this.iterable=g}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,o){if(!super.optimizeNames(e,o))return;return this.iterable=Tn(this.iterable,e,o),this}get names(){return _r(super.names,this.iterable.names)}}class Cc extends Ka{constructor(e,o,u){super();this.name=e,this.args=o,this.async=u}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Cc.kind="func";class Ic extends Bc{render(e){return"return "+super.render(e)}}Ic.kind="return";class qx extends Ka{render(e){let o="try"+super.render(e);if(this.catch)o+=this.catch.render(e);if(this.finally)o+=this.finally.render(e);return o}optimizeNodes(){var e,o;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(o=this.finally)===null||o===void 0||o.optimizeNodes(),this}optimizeNames(e,o){var u,g;return super.optimizeNames(e,o),(u=this.catch)===null||u===void 0||u.optimizeNames(e,o),(g=this.finally)===null||g===void 0||g.optimizeNames(e,o),this}get names(){let e=super.names;if(this.catch)_r(e,this.catch.names);if(this.finally)_r(e,this.finally.names);return e}}class Pc extends Ka{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Pc.kind="catch";class Dc extends Ka{render(e){return"finally"+super.render(e)}}Dc.kind="finally";class Fx{constructor(e,o={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...o,_n:o.lines?`
|
|
4
4
|
`:""},this._extScope=e,this._scope=new $t.Scope({parent:e}),this._nodes=[new jx]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,o){let u=this._extScope.value(e,o);return(this._values[u.prefix]||(this._values[u.prefix]=new Set)).add(u),u}getScopeValue(e,o){return this._extScope.getValue(e,o)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,o,u,g){let y=this._scope.toName(o);if(u!==void 0&&g)this._constants[y.str]=u;return this._leafNode(new Ix(e,y,u)),y}const(e,o,u){return this._def($t.varKinds.const,e,o,u)}let(e,o,u){return this._def($t.varKinds.let,e,o,u)}var(e,o,u){return this._def($t.varKinds.var,e,o,u)}assign(e,o,u){return this._leafNode(new Cm(e,o,u))}add(e,o){return this._leafNode(new Px(e,Oi.operators.ADD,o))}code(e){if(typeof e=="function")e();else if(e!==qe.nil)this._leafNode(new Bx(e));return this}object(...e){let o=["{"];for(let[u,g]of e){if(o.length>1)o.push(",");if(o.push(u),u!==g||this.opts.es5)o.push(":"),qe.addCodeArg(o,g)}return o.push("}"),new qe._Code(o)}if(e,o,u){if(this._blockNode(new Ea(e)),o&&u)this.code(o).else().code(u).endIf();else if(o)this.code(o).endIf();else if(u)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Ea(e))}else(){return this._elseNode(new Ls)}endIf(){return this._endBlockNode(Ea,Ls)}_for(e,o){if(this._blockNode(e),o)this.code(o).endFor();return this}for(e,o){return this._for(new Hx(e),o)}forRange(e,o,u,g,y=this.opts.es5?$t.varKinds.var:$t.varKinds.let){let w=this._scope.toName(e);return this._for(new zx(y,w,o,u),()=>g(w))}forOf(e,o,u,g=$t.varKinds.const){let y=this._scope.toName(e);if(this.opts.es5){let w=o instanceof qe.Name?o:this.var("_arr",o);return this.forRange("_i",0,qe._`${w}.length`,(T)=>{this.var(y,qe._`${w}[${T}]`),u(y)})}return this._for(new Em("of",g,y,o),()=>u(y))}forIn(e,o,u,g=this.opts.es5?$t.varKinds.var:$t.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,qe._`Object.keys(${o})`,u);let y=this._scope.toName(e);return this._for(new Em("in",g,y,o),()=>u(y))}endFor(){return this._endBlockNode(_n)}label(e){return this._leafNode(new Dx(e))}break(e){return this._leafNode(new Ox(e))}return(e){let o=new Ic;if(this._blockNode(o),this.code(e),o.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Ic)}try(e,o,u){if(!o&&!u)throw Error('CodeGen: "try" without "catch" and "finally"');let g=new qx;if(this._blockNode(g),this.code(e),o){let y=this.name("e");this._currNode=g.catch=new Pc(y),o(y)}if(u)this._currNode=g.finally=new Dc,this.code(u);return this._endBlockNode(Pc,Dc)}throw(e){return this._leafNode(new Ux(e))}block(e,o){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(o);return this}endBlock(e){let o=this._blockStarts.pop();if(o===void 0)throw Error("CodeGen: not in self-balancing block");let u=this._nodes.length-o;if(u<0||e!==void 0&&u!==e)throw Error(`CodeGen: wrong number of nodes: ${u} vs ${e} expected`);return this._nodes.length=o,this}func(e,o=qe.nil,u,g){if(this._blockNode(new Cc(e,o,u)),g)this.code(g).endFunc();return this}endFunc(){return this._endBlockNode(Cc)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,o){let u=this._currNode;if(u instanceof e||o&&u instanceof o)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${o?`${e.kind}/${o.kind}`:e.kind}"`)}_elseNode(e){let o=this._currNode;if(!(o instanceof Ea))throw Error('CodeGen: "else" without "if"');return this._currNode=o.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let o=this._nodes;o[o.length-1]=e}}Oi.CodeGen=Fx;function _r(e,o){for(let u in o)e[u]=(e[u]||0)+(o[u]||0);return e}function Oc(e,o){return o instanceof qe._CodeOrName?_r(e,o.names):e}function Tn(e,o,u){if(e instanceof qe.Name)return g(e);if(!y(e))return e;return new qe._Code(e._items.reduce((w,T)=>{if(T instanceof qe.Name)T=g(T);if(T instanceof qe._Code)w.push(...T._items);else w.push(T);return w},[]));function g(w){let T=u[w.str];if(T===void 0||o[w.str]!==1)return w;return delete o[w.str],T}function y(w){return w instanceof qe._Code&&w._items.some((T)=>T instanceof qe.Name&&o[T.str]===1&&u[T.str]!==void 0)}}function QW(e,o){for(let u in o)e[u]=(e[u]||0)-(o[u]||0)}function Nx(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:qe._`!${Lm(e)}`}Oi.not=Nx;var VW=$x(Oi.operators.AND);function KW(...e){return e.reduce(VW)}Oi.and=KW;var JW=$x(Oi.operators.OR);function XW(...e){return e.reduce(JW)}Oi.or=XW;function $x(e){return(o,u)=>o===qe.nil?u:u===qe.nil?o:qe._`${Lm(o)} ${e} ${Lm(u)}`}function Lm(e){return e instanceof qe.Name?e:qe._`(${e})`}});var gt=r(function(ty){Object.defineProperty(ty,"__esModule",{value:!0});ty.checkStrictMode=ty.getErrorPath=ty.Type=ty.useFunc=ty.setEvaluated=ty.evaluatedPropsToName=ty.mergeEvaluated=ty.eachItem=ty.unescapeJsonPointer=ty.escapeJsonPointer=ty.escapeFragment=ty.unescapeFragment=ty.schemaRefOrVal=ty.schemaHasRulesButRef=ty.schemaHasRules=ty.checkUnknownRules=ty.alwaysValidSchema=ty.toHash=void 0;var Ke=ct(),Kx=Es();function tM(e){let o={};for(let u of e)o[u]=!0;return o}ty.toHash=tM;function iM(e,o){if(typeof o=="boolean")return o;if(Object.keys(o).length===0)return!0;return Jx(e,o),!Xx(o,e.self.RULES.all)}ty.alwaysValidSchema=iM;function Jx(e,o=e.schema){let{opts:u,self:g}=e;if(!u.strictSchema)return;if(typeof o==="boolean")return;let y=g.RULES.keywords;for(let w in o)if(!y[w])ey(e,`unknown keyword: "${w}"`)}ty.checkUnknownRules=Jx;function Xx(e,o){if(typeof e=="boolean")return!e;for(let u in e)if(o[u])return!0;return!1}ty.schemaHasRules=Xx;function aM(e,o){if(typeof e=="boolean")return!e;for(let u in e)if(u!=="$ref"&&o.all[u])return!0;return!1}ty.schemaHasRulesButRef=aM;function oM({topSchemaRef:e,schemaPath:o},u,g,y){if(!y){if(typeof u=="number"||typeof u=="boolean")return u;if(typeof u=="string")return Ke._`${u}`}return Ke._`${e}${o}${Ke.getProperty(g)}`}ty.schemaRefOrVal=oM;function rM(e){return Yx(decodeURIComponent(e))}ty.unescapeFragment=rM;function nM(e){return encodeURIComponent(Pm(e))}ty.escapeFragment=nM;function Pm(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}ty.escapeJsonPointer=Pm;function Yx(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ty.unescapeJsonPointer=Yx;function sM(e,o){if(Array.isArray(e))for(let u of e)o(u);else o(e)}ty.eachItem=sM;function Qx({mergeNames:e,mergeToName:o,mergeValues:u,resultToName:g}){return(y,w,T,b)=>{let R=T===void 0?w:T instanceof Ke.Name?(w instanceof Ke.Name?e(y,w,T):o(y,w,T),T):w instanceof Ke.Name?(o(y,T,w),w):u(w,T);return b===Ke.Name&&!(R instanceof Ke.Name)?g(y,R):R}}ty.mergeEvaluated={props:Qx({mergeNames:(e,o,u)=>e.if(Ke._`${u} !== true && ${o} !== undefined`,()=>{e.if(Ke._`${o} === true`,()=>e.assign(u,!0),()=>e.assign(u,Ke._`${u} || {}`).code(Ke._`Object.assign(${u}, ${o})`))}),mergeToName:(e,o,u)=>e.if(Ke._`${u} !== true`,()=>{if(o===!0)e.assign(u,!0);else e.assign(u,Ke._`${u} || {}`),Dm(e,u,o)}),mergeValues:(e,o)=>e===!0?!0:{...e,...o},resultToName:Zx}),items:Qx({mergeNames:(e,o,u)=>e.if(Ke._`${u} !== true && ${o} !== undefined`,()=>e.assign(u,Ke._`${o} === true ? true : ${u} > ${o} ? ${u} : ${o}`)),mergeToName:(e,o,u)=>e.if(Ke._`${u} !== true`,()=>e.assign(u,o===!0?!0:Ke._`${u} > ${o} ? ${u} : ${o}`)),mergeValues:(e,o)=>e===!0?!0:Math.max(e,o),resultToName:(e,o)=>e.var("items",o)})};function Zx(e,o){if(o===!0)return e.var("props",!0);let u=e.var("props",Ke._`{}`);if(o!==void 0)Dm(e,u,o);return u}ty.evaluatedPropsToName=Zx;function Dm(e,o,u){Object.keys(u).forEach((g)=>e.assign(Ke._`${o}${Ke.getProperty(g)}`,!0))}ty.setEvaluated=Dm;var Vx={};function cM(e,o){return e.scopeValue("func",{ref:o,code:Vx[o.code]||(Vx[o.code]=new Kx._Code(o.code))})}ty.useFunc=cM;var Im;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Im||(ty.Type=Im={}));function uM(e,o,u){if(e instanceof Ke.Name){let g=o===Im.Num;return u?g?Ke._`"[" + ${e} + "]"`:Ke._`"['" + ${e} + "']"`:g?Ke._`"/" + ${e}`:Ke._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return u?Ke.getProperty(e).toString():"/"+Pm(e)}ty.getErrorPath=uM;function ey(e,o,u=e.opts.strictSchema){if(!u)return;if(o=`strict mode: ${o}`,u===!0)throw Error(o);e.self.logger.warn(o)}ty.checkStrictMode=ey});var La=r(function(ay){Object.defineProperty(ay,"__esModule",{value:!0});var xt=ct(),AM={data:new xt.Name("data"),valCxt:new xt.Name("valCxt"),instancePath:new xt.Name("instancePath"),parentData:new xt.Name("parentData"),parentDataProperty:new xt.Name("parentDataProperty"),rootData:new xt.Name("rootData"),dynamicAnchors:new xt.Name("dynamicAnchors"),vErrors:new xt.Name("vErrors"),errors:new xt.Name("errors"),this:new xt.Name("this"),self:new xt.Name("self"),scope:new xt.Name("scope"),json:new xt.Name("json"),jsonPos:new xt.Name("jsonPos"),jsonLen:new xt.Name("jsonLen"),jsonPart:new xt.Name("jsonPart")};ay.default=AM});var Cs=r(function(sy){Object.defineProperty(sy,"__esModule",{value:!0});sy.extendErrors=sy.resetErrorsCount=sy.reportExtraError=sy.reportError=sy.keyword$DataError=sy.keywordError=void 0;var Fe=ct(),Ja=gt(),Li=La();sy.keywordError={message:({keyword:e})=>Fe.str`must pass "${e}" keyword validation`};sy.keyword$DataError={message:({keyword:e,schemaType:o})=>o?Fe.str`"${e}" keyword must be ${o} ($data)`:Fe.str`"${e}" keyword is invalid ($data)`};function MM(e,o=sy.keywordError,u,g){let{it:y}=e,{gen:w,compositeRule:T,allErrors:b}=y,R=ny(e,o,u);if(g!==null&&g!==void 0?g:T||b)oy(w,R);else ry(y,Fe._`[${R}]`)}sy.reportError=MM;function EM(e,o=sy.keywordError,u){let{it:g}=e,{gen:y,compositeRule:w,allErrors:T}=g,b=ny(e,o,u);if(oy(y,b),!(w||T))ry(g,Li.default.vErrors)}sy.reportExtraError=EM;function LM(e,o){e.assign(Li.default.errors,o),e.if(Fe._`${Li.default.vErrors} !== null`,()=>e.if(o,()=>e.assign(Fe._`${Li.default.vErrors}.length`,o),()=>e.assign(Li.default.vErrors,null)))}sy.resetErrorsCount=LM;function CM({gen:e,keyword:o,schemaValue:u,data:g,errsCount:y,it:w}){if(y===void 0)throw Error("ajv implementation error");let T=e.name("err");e.forRange("i",y,Li.default.errors,(b)=>{if(e.const(T,Fe._`${Li.default.vErrors}[${b}]`),e.if(Fe._`${T}.instancePath === undefined`,()=>e.assign(Fe._`${T}.instancePath`,Fe.strConcat(Li.default.instancePath,w.errorPath))),e.assign(Fe._`${T}.schemaPath`,Fe.str`${w.errSchemaPath}/${o}`),w.opts.verbose)e.assign(Fe._`${T}.schema`,u),e.assign(Fe._`${T}.data`,g)})}sy.extendErrors=CM;function oy(e,o){let u=e.const("err",o);e.if(Fe._`${Li.default.vErrors} === null`,()=>e.assign(Li.default.vErrors,Fe._`[${u}]`),Fe._`${Li.default.vErrors}.push(${u})`),e.code(Fe._`${Li.default.errors}++`)}function ry(e,o){let{gen:u,validateName:g,schemaEnv:y}=e;if(y.$async)u.throw(Fe._`new ${e.ValidationError}(${o})`);else u.assign(Fe._`${g}.errors`,o),u.return(!1)}var Ar={keyword:new Fe.Name("keyword"),schemaPath:new Fe.Name("schemaPath"),params:new Fe.Name("params"),propertyName:new Fe.Name("propertyName"),message:new Fe.Name("message"),schema:new Fe.Name("schema"),parentSchema:new Fe.Name("parentSchema")};function ny(e,o,u){let{createErrors:g}=e.it;if(g===!1)return Fe._`{}`;return IM(e,o,u)}function IM(e,o,u={}){let{gen:g,it:y}=e,w=[PM(y,u),DM(e,u)];return OM(e,o,w),g.object(...w)}function PM({errorPath:e},{instancePath:o}){let u=o?Fe.str`${e}${Ja.getErrorPath(o,Ja.Type.Str)}`:e;return[Li.default.instancePath,Fe.strConcat(Li.default.instancePath,u)]}function DM({keyword:e,it:{errSchemaPath:o}},{schemaPath:u,parentSchema:g}){let y=g?o:Fe.str`${o}/${e}`;if(u)y=Fe.str`${y}${Ja.getErrorPath(u,Ja.Type.Str)}`;return[Ar.schemaPath,y]}function OM(e,{params:o,message:u},g){let{keyword:y,data:w,schemaValue:T,it:b}=e,{opts:R,propertyName:W,topSchemaRef:E,schemaPath:M}=b;if(g.push([Ar.keyword,y],[Ar.params,typeof o=="function"?o(e):o||Fe._`{}`]),R.messages)g.push([Ar.message,typeof u=="function"?u(e):u]);if(R.verbose)g.push([Ar.schema,T],[Ar.parentSchema,Fe._`${E}${M}`],[Li.default.data,w]);if(W)g.push([Ar.propertyName,W])}});var hy=r(function(my){Object.defineProperty(my,"__esModule",{value:!0});my.boolOrEmptySchema=my.topBoolOrEmptySchema=void 0;var uy=Cs(),py=ct(),zM=La(),qM={message:"boolean schema is false"};function FM(e){let{gen:o,schema:u,validateName:g}=e;if(u===!1)ly(e,!1);else if(typeof u=="object"&&u.$async===!0)o.return(zM.default.data);else o.assign(py._`${g}.errors`,null),o.return(!0)}my.topBoolOrEmptySchema=FM;function NM(e,o){let{gen:u,schema:g}=e;if(g===!1)u.var(o,!1),ly(e);else u.var(o,!0)}my.boolOrEmptySchema=NM;function ly(e,o){let{gen:u,data:g}=e;uy.reportError({gen:u,keyword:"false schema",data:g,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},qM,void 0,o)}});var Um=r(function(gy){Object.defineProperty(gy,"__esModule",{value:!0});gy.getRules=gy.isJSONType=void 0;var GM=["string","number","integer","boolean","null","object","array"],QM=new Set(GM);function VM(e){return typeof e=="string"&&QM.has(e)}gy.isJSONType=VM;function KM(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}gy.getRules=KM});var Bm=r(function(vy){Object.defineProperty(vy,"__esModule",{value:!0});vy.shouldUseRule=vy.shouldUseGroup=vy.schemaHasRulesForType=void 0;function XM({schema:e,self:o},u){let g=o.RULES.types[u];return g&&g!==!0&&xy(e,g)}vy.schemaHasRulesForType=XM;function xy(e,o){return o.rules.some((u)=>yy(e,u))}vy.shouldUseGroup=xy;function yy(e,o){var u;return e[o.keyword]!==void 0||((u=o.definition.implements)===null||u===void 0?void 0:u.some((g)=>e[g]!==void 0))}vy.shouldUseRule=yy});var Is=r(function(Ry){Object.defineProperty(Ry,"__esModule",{value:!0});Ry.reportTypeError=Ry.checkDataTypes=Ry.checkDataType=Ry.coerceAndCheckDataType=Ry.getJSONTypes=Ry.getSchemaTypes=Ry.DataType=void 0;var by=Um(),ky=Bm(),Sy=Cs(),De=ct(),Hc=gt(),Rn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Rn||(Ry.DataType=Rn={}));function e8(e){let o=_y(e.type);if(o.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!o.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)o.push("null")}return o}Ry.getSchemaTypes=e8;function _y(e){let o=Array.isArray(e)?e:e?[e]:[];if(o.every(by.isJSONType))return o;throw Error("type must be JSONType or JSONType[]: "+o.join(","))}Ry.getJSONTypes=_y;function t8(e,o){let{gen:u,data:g,opts:y}=e,w=i8(o,y.coerceTypes),T=o.length>0&&!(w.length===0&&o.length===1&&ky.schemaHasRulesForType(e,o[0]));if(T){let b=Hm(o,g,y.strictNumbers,Rn.Wrong);u.if(b,()=>{if(w.length)a8(e,o,w);else zm(e)})}return T}Ry.coerceAndCheckDataType=t8;var Ty=new Set(["string","number","integer","boolean","null"]);function i8(e,o){return o?e.filter((u)=>Ty.has(u)||o==="array"&&u==="array"):[]}function a8(e,o,u){let{gen:g,data:y,opts:w}=e,T=g.let("dataType",De._`typeof ${y}`),b=g.let("coerced",De._`undefined`);if(w.coerceTypes==="array")g.if(De._`${T} == 'object' && Array.isArray(${y}) && ${y}.length == 1`,()=>g.assign(y,De._`${y}[0]`).assign(T,De._`typeof ${y}`).if(Hm(o,y,w.strictNumbers),()=>g.assign(b,y)));g.if(De._`${b} !== undefined`);for(let W of u)if(Ty.has(W)||W==="array"&&w.coerceTypes==="array")R(W);g.else(),zm(e),g.endIf(),g.if(De._`${b} !== undefined`,()=>{g.assign(y,b),o8(e,b)});function R(W){switch(W){case"string":g.elseIf(De._`${T} == "number" || ${T} == "boolean"`).assign(b,De._`"" + ${y}`).elseIf(De._`${y} === null`).assign(b,De._`""`);return;case"number":g.elseIf(De._`${T} == "boolean" || ${y} === null
|
|
5
5
|
|| (${T} == "string" && ${y} && ${y} == +${y})`).assign(b,De._`+${y}`);return;case"integer":g.elseIf(De._`${T} === "boolean" || ${y} === null
|
|
6
6
|
|| (${T} === "string" && ${y} && ${y} == +${y} && !(${y} % 1))`).assign(b,De._`+${y}`);return;case"boolean":g.elseIf(De._`${y} === "false" || ${y} === 0 || ${y} === null`).assign(b,!1).elseIf(De._`${y} === "true" || ${y} === 1`).assign(b,!0);return;case"null":g.elseIf(De._`${y} === "" || ${y} === 0 || ${y} === false`),g.assign(b,null);return;case"array":g.elseIf(De._`${T} === "string" || ${T} === "number"
|
|
@@ -115,7 +115,7 @@ name: ${e.name}
|
|
|
115
115
|
description: ${e.description??""}
|
|
116
116
|
---
|
|
117
117
|
|
|
118
|
-
${o}`,body:o,name:e.name,description:e.description,directory:"<built-in>",bin:"",commands:[],scope:"builtin",platforms:e.platforms,disableModelInvocation:e.disableModelInvocation}}function GR(e,o="custom",u=[]){let g="parse";try{let y=FR(e,"utf8"),w=y.match(/^---\s*\n([\s\S]*?)\n---\s*\n?([\s\S]*)$/);if(!w)throw Error("missing YAML frontmatter");let T=Bun.YAML.parse(w[1]??"");if(!T||typeof T!=="object"||Array.isArray(T))throw Error("invalid frontmatter");let b=T,R=hc(e),W=b.name;if(typeof W!=="string"||!W.trim()){u.push({path:e,reason:"\u7F3A\u5C11 name",kind:"missing-field"});return}let E=typeof b.description!=="string"||!b.description.trim();if(W!==NR(R))throw Error("name must match directory");if(g="bin",b.bin!==void 0&&(typeof b.bin!=="string"||!b.bin.trim()))throw Error("bin must be a non-empty directory path");let M=typeof b.bin==="string"?b.bin:"bin",L=yc(R,M),P=L;while(!gc(P)&&hc(P)!==P)P=hc(P);if(!qa(yc(R),L)||!qa(fc(R),fc(P)))throw Error("bin must stay inside the skill directory");let U=[];if(gc(L)&&xc(L).isDirectory()){for(let C of Bl(L,{withFileTypes:!0})){if(C.name.startsWith(".")||!C.isFile())continue;if(process.platform==="win32"||(xc(Ra(L,C.name)).mode&73)!==0)U.push(C.name)}U.sort()}if(g="parse",b["disable-model-invocation"]!==void 0&&typeof b["disable-model-invocation"]!=="boolean")throw Error("disable-model-invocation must be a boolean");if(b.platforms!==void 0&&(!Array.isArray(b.platforms)||!b.platforms.every((C)=>typeof C==="string")))throw Error("platforms must be a list of platform names");let I=Array.isArray(b.platforms)&&b.platforms.every((C)=>typeof C==="string")?b.platforms:void 0;if(I&&!I.includes(process.platform))return;if(E)u.push({path:e,reason:"\u7F3A\u5C11 description",kind:"missing-field"});return{raw:y,body:(w[2]??"").trim(),name:W,description:typeof b.description==="string"?b.description:void 0,directory:R,bin:L,commands:U,platforms:I,scope:o,disableModelInvocation:b["disable-model-invocation"]===!0}}catch(y){let w=y instanceof Error?y.message:String(y),b={"name must match directory":"name \u4E0E\u76EE\u5F55\u540D\u4E0D\u4E00\u81F4","bin must stay inside the skill directory":"bin \u8D8A\u51FA\u6280\u80FD\u76EE\u5F55","bin must be a non-empty directory path":"bin \u5FC5\u987B\u662F\u975E\u7A7A\u76EE\u5F55\u8DEF\u5F84","disable-model-invocation must be a boolean":"disable-model-invocation \u5FC5\u987B\u662F\u5E03\u5C14\u503C","platforms must be a list of platform names":"platforms \u5FC5\u987B\u662F\u5E73\u53F0\u540D\u79F0\u5217\u8868"}[w]??"frontmatter \u89E3\u6790\u5931\u8D25";u.push({path:e,reason:b,detail:w,kind:g});return}}function cg(e,o=[],u=et(),g=[],y=[]){let w=Hl(e,o,u),T=new Map,b=new Set;for(let R of w){if(!gc(R.path)){if(R.scope==="custom")g.push({path:R.path,reason:"\u81EA\u5B9A\u4E49\u8DEF\u5F84\u4E0D\u5B58\u5728",kind:"path"});continue}let W;try{W=Bl(R.path).sort()}catch(M){g.push({path:R.path,reason:"\u65E0\u6CD5\u626B\u63CF\u76EE\u5F55",detail:M instanceof Error?M.message:String(M),kind:"path"});continue}let E=0;for(let M of W){let L=Ra(R.path,M,"SKILL.md");if(!QR(L))continue;if(E++,b.has(L))continue;b.add(L);let P=GR(L,R.scope,g);if(P){y.push(P);let U=T.get(P.name);if(U&&!g.some((I)=>I.path===Ra(U.directory,"SKILL.md")))g.push({path:Ra(U.directory,"SKILL.md"),reason:"\u540C\u540D\u88AB\u8986\u76D6",kind:"overridden",overriddenBy:L});T.delete(P.name),T.set(P.name,P)}}if(R.scope==="custom"&&E===0)g.push({path:R.path,reason:"\u81EA\u5B9A\u4E49\u8DEF\u5F84\u6CA1\u6709\u6280\u80FD",kind:"path"})}return[...T.values()].filter((R)=>R.platforms===void 0||R.platforms.includes(process.platform))}function QR(e){try{return xc(e).isFile()}catch{return!1}}function ug(e,o=process.env){let u=Object.keys(o).find((T)=>T.toLowerCase()==="path"),g=(u?o[u]:void 0)??process.env.PATH??"",y=new Set(g.split(process.platform==="win32"?";":":").map((T)=>process.platform==="win32"?T.toLowerCase():T)),w=e.map((T)=>T.bin).filter((T)=>{let b=process.platform==="win32"?T.toLowerCase():T;if(y.has(b))return!1;return y.add(b),!0});return[...g?[g]:[],...w].join(process.platform==="win32"?";":":")}function jl(e){return e.body}function qa(e,o){let u=ng(e,o);return u===""||u!==".."&&!u.startsWith(`..${process.platform==="win32"?"\\":"/"}`)&&!$R(u)}function Hl(e,o=[],u=et()){let g=[];if(g.push({path:Ra(rg(),".claude/skills"),scope:"global"}),g.push({path:Ra(rg(),".agents/skills"),scope:"global"}),g.push({path:Ra(u,"skills"),scope:"global"}),e){let y=yc(e);for(;;){for(let T of[".claude/skills",".agents/skills",".basalt/skills"])g.push({path:Ra(y,T),scope:"project"});let w=hc(y);if(w===y)break;y=w}}for(let y of o)g.push({path:yc(y),scope:"custom"});return g}function yn(e){return e.map((o)=>({name:o.name,...o.description?{description:o.description}:{},location:o.scope==="builtin"?"<built-in>":o.directory,scope:o.scope,bin:o.bin,...o.commands?.length?{commands:o.commands}:{},disableModelInvocation:o.disableModelInvocation,...o.platforms?{platforms:o.platforms}:{}}))}function pg(e){if(e.scope==="builtin"||!gc(e.directory))return[];let o=fc(e.directory),u=[];function g(y){for(let w of Bl(y,{withFileTypes:!0}).sort((T,b)=>{if(T.name<b.name)return-1;if(T.name>b.name)return 1;return 0})){if(u.length>=200)return;if(w.name.startsWith(".")||w.name==="node_modules")continue;let T=Ra(y,w.name),b;try{b=fc(T)}catch(R){if(R instanceof Error&&"code"in R&&R.code==="ENOENT")continue;throw R}if(!qa(o,b))continue;if(w.isDirectory())g(T);else if(w.isFile()||w.isSymbolicLink()&&xc(T).isFile())u.push(ng(e.directory,T).split("\\").join("/"))}}return g(e.directory),u}import{existsSync as VR,watch as KR}from"fs";import{dirname as lg,resolve as JR}from"path";class zl{storageDirectory;settings;builtinSkills;candidates=new Map;snapshots=new Map;issues=new Map;watchers=[];timer;closed=!1;constructor(e,o,u=()=>[]){this.storageDirectory=e;this.settings=o;this.builtinSkills=u}open(){this.closed=!1}get(e){if(this.closed)return[];let o=e??"",u=this.snapshots.get(o);if(u)return u;let g=this.scan(e);return this.snapshots.set(o,g),this.listen(),g}all(e){if(this.closed)return[];return this.get(e),this.candidates.get(e??"")??[]}getIssues(e){if(this.closed)return[];return this.get(e),this.issues.get(e??"")??[]}rescan(){if(this.closed)return;for(let e of this.snapshots.keys()){if(this.closed)return;this.snapshots.set(e,this.scan(e||void 0))}if(this.closed)return;this.listen()}closeWatchers(){if(this.timer)clearTimeout(this.timer),this.timer=void 0;for(let e of this.watchers)e.close();this.watchers=[]}close(){this.closed=!0,this.closeWatchers()}scan(e){if(this.closed)return[];let o;try{o=this.settings()}catch{return[]}let u=[],g=[],y=this.builtinSkills().filter((R)=>R.platforms===void 0||R.platforms.includes(process.platform));for(let R of y)g.push(R);let w=cg(e,o.customPaths,this.storageDirectory,u,g),T=new Set(w.map((R)=>R.name)),b=[];for(let R of y)if(T.has(R.name)){let W=w.find((E)=>E.name===R.name);if(W)u.push({path:"<built-in>",reason:"\u540C\u540D\u88AB\u8986\u76D6",kind:"overridden",overriddenBy:W.directory})}else b.push(R);return b.push(...w),this.candidates.set(e??"",g),this.issues.set(e??"",u),b}listen(){if(this.closeWatchers(),this.closed)return;let e;try{e=this.settings()}catch{return}let o=new Set([...this.snapshots.keys()].flatMap((g)=>Hl(g||void 0,e.customPaths,this.storageDirectory).map((y)=>y.path))),u=new Set;for(let g of o){let y=g;while(!VR(y)&&lg(y)!==y)y=lg(y);if(u.has(y))continue;u.add(y);try{let w=KR(y,{recursive:y===g},(T,b)=>{if(this.closed||!b)return;let R=JR(y,b);if(![...o].some((E)=>qa(E,R)&&/\.md$/i.test(R)||qa(R,E)))return;if(this.timer)clearTimeout(this.timer);this.timer=setTimeout(()=>{if(this.closed)return;try{this.rescan()}catch(E){console.warn("Skill rescan failed:",E)}},1000),this.timer.unref?.()});w.on("error",(T)=>console.warn(`Skill watcher failed for ${g}:`,T)),w.unref(),this.watchers.push(w)}catch(w){console.warn(`Cannot watch skills directory ${g}:`,w)}}}}class ql{database;constructor(e){this.database=e}skillSettings(){let e=this.database.query("SELECT custom_paths, disabled FROM skill_settings WHERE id = 1").get();if(!e)throw Error("Missing skill settings; database migration is incomplete");return{customPaths:JSON.parse(e.custom_paths),disabled:JSON.parse(e.disabled??"[]")}}saveSkillSettings(e){this.database.query("UPDATE skill_settings SET custom_paths = ?, disabled = ? WHERE id = 1").run(JSON.stringify(e.customPaths),JSON.stringify(e.disabled??[]))}}class Fl{runtime;store;owners=0;enabled;sessionSkills=new Map;skillCatalog;builtins=new Map;constructor(e,o,u){this.runtime=e;this.store=new ql(u),this.skillCatalog=new zl(o,()=>this.store.skillSettings(),()=>[...this.builtins.values()]),this.enabled=!0}registerBuiltinSkill(e){let o=sg(e);return this.builtins.set(o.name,o),this.skillCatalog.rescan(),()=>{if(this.builtins.get(o.name)===o)this.builtins.delete(o.name),this.skillCatalog.rescan()}}capture(e,o){if(!this.enabled)return;let u=this.runtime.plugins.list().find((y)=>y.id==="skills");if(u&&(!u.builtin||u.status!=="enabled"))return;let g=this.store.skillSettings().disabled??[];this.sessionSkills.set(e,this.skillCatalog.get(o).filter((y)=>!g.includes(y.name)))}inherit(e,o){if(!this.enabled)return;let u=this.sessionSkills.get(o)??this.availableSkills(void 0,o);this.sessionSkills.set(e,[...u])}retain(){if(this.enabled=!0,this.skillCatalog.open(),this.owners++===0)this.skillCatalog.rescan();let e=!1;return()=>{if(e)return;if(e=!0,--this.owners<=0)this.owners=0,this.enabled=!1,this.skillCatalog.close()}}close(){this.enabled=!1,this.owners=0,this.skillCatalog.close()}requireProject(e){let o=this.runtime.project(e);if(!o)throw new f("no such project");return o}skills(e,o){let u=this.store.skillSettings();return yn(this.availableSkills(e,o).filter((g)=>!(u.disabled??[]).includes(g.name))).map((g)=>({...g,disabled:!1}))}skillList(e,o){let u=e?this.requireProject(e):void 0;return{skills:this.skills(e,o),issues:this.skillCatalog.getIssues(u?.directory)}}allSkills(){let e=this.store.skillSettings(),o=[void 0,...this.runtime.store.projects()],u=o.flatMap((y)=>yn(this.skillCatalog.all(y?.directory)).map((w)=>({...w,disabled:(e.disabled??[]).includes(w.name),...y?{projectID:y.id,projectName:y.name}:{}}))),g=o.flatMap((y)=>this.skillCatalog.getIssues(y?.directory));return{skills:[...new Map(u.map((y)=>[`${y.location}\x00${y.name}`,y])).values()],issues:[...new Map(g.map((y)=>[y.path,y])).values()]}}skillFiles(e,o,u,g){let y=this.previewSkill(e,o,u,g);return{files:pg(y)}}previewSkill(e,o,u,g){let y=o?this.requireProject(o):void 0,T=(g&&!u?this.skillCatalog.all(y?.directory):this.availableSkills(o,u)).find((b)=>b.name===e&&(!g||b.directory===g||b.scope==="builtin"&&g==="<built-in>"));if(!T)throw new f("Skill not found; rescan skills and try again");return T}availableSkills(e,o){if(o){let g=this.sessionSkills.get(o);if(g)return g;let y=this.runtime.get(o);if(!y)throw new f("Session not found");let w=y.projectID?this.runtime.project(y.projectID):void 0;return this.capture(o,w?.directory),this.sessionSkills.get(o)??[]}let u=e?this.requireProject(e):void 0;return this.skillCatalog.get(u?.directory)}skillContent(e,o,u,g){return{text:this.previewSkill(e,o,u,g).raw}}skillSettings(){return this.store.skillSettings()}saveSkillSettings(e){if(!e||!Array.isArray(e.customPaths)||e.customPaths.length>100||e.disabled!==void 0&&(!Array.isArray(e.disabled)||e.disabled.length>1e4||e.disabled.some((u)=>typeof u!=="string"||!u.trim()||u.length>256))||e.customPaths.some((u)=>typeof u!=="string"||!u.trim()||u.length>4096||u.includes("\x00")||!XR(u)))throw new t("Skills accept up to 100 absolute local paths");let o={customPaths:[...new Set(e.customPaths.map((u)=>YR(u)))],disabled:[...new Set(e.disabled??[])]};return this.store.saveSkillSettings(o),this.skillCatalog.rescan(),o}rescanSkills(){return this.skillCatalog.rescan(),this.skills()}}var vn={pluginID:"skills",name:"service",validate(e){return e instanceof Fl}},mg=new WeakMap;function dg(e,o){let u=mg.get(e);if(!u)u=new Fl(e,e.options.dataDir,o),mg.set(e,u);return u}import{join as Eg}from"path";var Fa={name:"@basalt/cli",version:"0.1.9",private:!0,type:"module",imports:{"#*":"./src/*","#test/*":"./test/*"},bin:{basalt:"./src/main.ts"},scripts:{typecheck:"tsgo --noEmit -p ."},dependencies:{"@basalt/builtins":"workspace:*","@basalt/core":"workspace:*","@basalt/protocol":"workspace:*","@basalt/server":"workspace:*","@basalt/web":"workspace:*","@earendil-works/pi-ai":"1.2.0"},exports:{"./plugin-sdk":"./src/plugin-sdk.ts"}};var wr=`# Basalt plugins
|
|
118
|
+
${o}`,body:o,name:e.name,description:e.description,directory:"<built-in>",bin:"",commands:[],scope:"builtin",platforms:e.platforms,disableModelInvocation:e.disableModelInvocation}}function GR(e,o="custom",u=[]){let g="parse";try{let y=FR(e,"utf8"),w=y.match(/^---\s*\n([\s\S]*?)\n---\s*\n?([\s\S]*)$/);if(!w)throw Error("missing YAML frontmatter");let T=Bun.YAML.parse(w[1]??"");if(!T||typeof T!=="object"||Array.isArray(T))throw Error("invalid frontmatter");let b=T,R=hc(e),W=b.name;if(typeof W!=="string"||!W.trim()){u.push({path:e,reason:"\u7F3A\u5C11 name",kind:"missing-field"});return}let E=typeof b.description!=="string"||!b.description.trim();if(W!==NR(R))throw Error("name must match directory");if(g="bin",b.bin!==void 0&&(typeof b.bin!=="string"||!b.bin.trim()))throw Error("bin must be a non-empty directory path");let M=typeof b.bin==="string"?b.bin:"bin",L=yc(R,M),P=L;while(!gc(P)&&hc(P)!==P)P=hc(P);if(!qa(yc(R),L)||!qa(fc(R),fc(P)))throw Error("bin must stay inside the skill directory");let U=[];if(gc(L)&&xc(L).isDirectory()){for(let C of Bl(L,{withFileTypes:!0})){if(C.name.startsWith(".")||!C.isFile())continue;if(process.platform==="win32"||(xc(Ra(L,C.name)).mode&73)!==0)U.push(C.name)}U.sort()}if(g="parse",b["disable-model-invocation"]!==void 0&&typeof b["disable-model-invocation"]!=="boolean")throw Error("disable-model-invocation must be a boolean");if(b.platforms!==void 0&&(!Array.isArray(b.platforms)||!b.platforms.every((C)=>typeof C==="string")))throw Error("platforms must be a list of platform names");let I=Array.isArray(b.platforms)&&b.platforms.every((C)=>typeof C==="string")?b.platforms:void 0;if(I&&!I.includes(process.platform))return;if(E)u.push({path:e,reason:"\u7F3A\u5C11 description",kind:"missing-field"});return{raw:y,body:(w[2]??"").trim(),name:W,description:typeof b.description==="string"?b.description:void 0,directory:R,bin:L,commands:U,platforms:I,scope:o,disableModelInvocation:b["disable-model-invocation"]===!0}}catch(y){let w=y instanceof Error?y.message:String(y),b={"name must match directory":"name \u4E0E\u76EE\u5F55\u540D\u4E0D\u4E00\u81F4","bin must stay inside the skill directory":"bin \u8D8A\u51FA\u6280\u80FD\u76EE\u5F55","bin must be a non-empty directory path":"bin \u5FC5\u987B\u662F\u975E\u7A7A\u76EE\u5F55\u8DEF\u5F84","disable-model-invocation must be a boolean":"disable-model-invocation \u5FC5\u987B\u662F\u5E03\u5C14\u503C","platforms must be a list of platform names":"platforms \u5FC5\u987B\u662F\u5E73\u53F0\u540D\u79F0\u5217\u8868"}[w]??"frontmatter \u89E3\u6790\u5931\u8D25";u.push({path:e,reason:b,detail:w,kind:g});return}}function cg(e,o=[],u=et(),g=[],y=[]){let w=Hl(e,o,u),T=new Map,b=new Set;for(let R of w){if(!gc(R.path)){if(R.scope==="custom")g.push({path:R.path,reason:"\u81EA\u5B9A\u4E49\u8DEF\u5F84\u4E0D\u5B58\u5728",kind:"path"});continue}let W;try{W=Bl(R.path).sort()}catch(M){g.push({path:R.path,reason:"\u65E0\u6CD5\u626B\u63CF\u76EE\u5F55",detail:M instanceof Error?M.message:String(M),kind:"path"});continue}let E=0;for(let M of W){let L=Ra(R.path,M,"SKILL.md");if(!QR(L))continue;if(E++,b.has(L))continue;b.add(L);let P=GR(L,R.scope,g);if(P){y.push(P);let U=T.get(P.name);if(U&&!g.some((I)=>I.path===Ra(U.directory,"SKILL.md")))g.push({path:Ra(U.directory,"SKILL.md"),reason:"\u540C\u540D\u88AB\u8986\u76D6",kind:"overridden",overriddenBy:L});T.delete(P.name),T.set(P.name,P)}}if(R.scope==="custom"&&E===0)g.push({path:R.path,reason:"\u81EA\u5B9A\u4E49\u8DEF\u5F84\u6CA1\u6709\u6280\u80FD",kind:"path"})}return[...T.values()].filter((R)=>R.platforms===void 0||R.platforms.includes(process.platform))}function QR(e){try{return xc(e).isFile()}catch{return!1}}function ug(e,o=process.env){let u=Object.keys(o).find((T)=>T.toLowerCase()==="path"),g=(u?o[u]:void 0)??process.env.PATH??"",y=new Set(g.split(process.platform==="win32"?";":":").map((T)=>process.platform==="win32"?T.toLowerCase():T)),w=e.map((T)=>T.bin).filter((T)=>{let b=process.platform==="win32"?T.toLowerCase():T;if(y.has(b))return!1;return y.add(b),!0});return[...g?[g]:[],...w].join(process.platform==="win32"?";":":")}function jl(e){return e.body}function qa(e,o){let u=ng(e,o);return u===""||u!==".."&&!u.startsWith(`..${process.platform==="win32"?"\\":"/"}`)&&!$R(u)}function Hl(e,o=[],u=et()){let g=[];if(g.push({path:Ra(rg(),".claude/skills"),scope:"global"}),g.push({path:Ra(rg(),".agents/skills"),scope:"global"}),g.push({path:Ra(u,"skills"),scope:"global"}),e){let y=yc(e);for(;;){for(let T of[".claude/skills",".agents/skills",".basalt/skills"])g.push({path:Ra(y,T),scope:"project"});let w=hc(y);if(w===y)break;y=w}}for(let y of o)g.push({path:yc(y),scope:"custom"});return g}function yn(e){return e.map((o)=>({name:o.name,...o.description?{description:o.description}:{},location:o.scope==="builtin"?"<built-in>":o.directory,scope:o.scope,bin:o.bin,...o.commands?.length?{commands:o.commands}:{},disableModelInvocation:o.disableModelInvocation,...o.platforms?{platforms:o.platforms}:{}}))}function pg(e){if(e.scope==="builtin"||!gc(e.directory))return[];let o=fc(e.directory),u=[];function g(y){for(let w of Bl(y,{withFileTypes:!0}).sort((T,b)=>{if(T.name<b.name)return-1;if(T.name>b.name)return 1;return 0})){if(u.length>=200)return;if(w.name.startsWith(".")||w.name==="node_modules")continue;let T=Ra(y,w.name),b;try{b=fc(T)}catch(R){if(R instanceof Error&&"code"in R&&R.code==="ENOENT")continue;throw R}if(!qa(o,b))continue;if(w.isDirectory())g(T);else if(w.isFile()||w.isSymbolicLink()&&xc(T).isFile())u.push(ng(e.directory,T).split("\\").join("/"))}}return g(e.directory),u}import{existsSync as VR,watch as KR}from"fs";import{dirname as lg,resolve as JR}from"path";class zl{storageDirectory;settings;builtinSkills;candidates=new Map;snapshots=new Map;issues=new Map;watchers=[];timer;closed=!1;constructor(e,o,u=()=>[]){this.storageDirectory=e;this.settings=o;this.builtinSkills=u}open(){this.closed=!1}get(e){if(this.closed)return[];let o=e??"",u=this.snapshots.get(o);if(u)return u;let g=this.scan(e);return this.snapshots.set(o,g),this.listen(),g}all(e){if(this.closed)return[];return this.get(e),this.candidates.get(e??"")??[]}getIssues(e){if(this.closed)return[];return this.get(e),this.issues.get(e??"")??[]}rescan(){if(this.closed)return;for(let e of this.snapshots.keys()){if(this.closed)return;this.snapshots.set(e,this.scan(e||void 0))}if(this.closed)return;this.listen()}closeWatchers(){if(this.timer)clearTimeout(this.timer),this.timer=void 0;for(let e of this.watchers)e.close();this.watchers=[]}close(){this.closed=!0,this.closeWatchers()}scan(e){if(this.closed)return[];let o;try{o=this.settings()}catch{return[]}let u=[],g=[],y=this.builtinSkills().filter((R)=>R.platforms===void 0||R.platforms.includes(process.platform));for(let R of y)g.push(R);let w=cg(e,o.customPaths,this.storageDirectory,u,g),T=new Set(w.map((R)=>R.name)),b=[];for(let R of y)if(T.has(R.name)){let W=w.find((E)=>E.name===R.name);if(W)u.push({path:"<built-in>",reason:"\u540C\u540D\u88AB\u8986\u76D6",kind:"overridden",overriddenBy:W.directory})}else b.push(R);return b.push(...w),this.candidates.set(e??"",g),this.issues.set(e??"",u),b}listen(){if(this.closeWatchers(),this.closed)return;let e;try{e=this.settings()}catch{return}let o=new Set([...this.snapshots.keys()].flatMap((g)=>Hl(g||void 0,e.customPaths,this.storageDirectory).map((y)=>y.path))),u=new Set;for(let g of o){let y=g;while(!VR(y)&&lg(y)!==y)y=lg(y);if(u.has(y))continue;u.add(y);try{let w=KR(y,{recursive:y===g},(T,b)=>{if(this.closed||!b)return;let R=JR(y,b);if(![...o].some((E)=>qa(E,R)&&/\.md$/i.test(R)||qa(R,E)))return;if(this.timer)clearTimeout(this.timer);this.timer=setTimeout(()=>{if(this.closed)return;try{this.rescan()}catch(E){console.warn("Skill rescan failed:",E)}},1000),this.timer.unref?.()});w.on("error",(T)=>console.warn(`Skill watcher failed for ${g}:`,T)),w.unref(),this.watchers.push(w)}catch(w){console.warn(`Cannot watch skills directory ${g}:`,w)}}}}class ql{database;constructor(e){this.database=e}skillSettings(){let e=this.database.query("SELECT custom_paths, disabled FROM skill_settings WHERE id = 1").get();if(!e)throw Error("Missing skill settings; database migration is incomplete");return{customPaths:JSON.parse(e.custom_paths),disabled:JSON.parse(e.disabled??"[]")}}saveSkillSettings(e){this.database.query("UPDATE skill_settings SET custom_paths = ?, disabled = ? WHERE id = 1").run(JSON.stringify(e.customPaths),JSON.stringify(e.disabled??[]))}}class Fl{runtime;store;owners=0;enabled;sessionSkills=new Map;skillCatalog;builtins=new Map;constructor(e,o,u){this.runtime=e;this.store=new ql(u),this.skillCatalog=new zl(o,()=>this.store.skillSettings(),()=>[...this.builtins.values()]),this.enabled=!0}registerBuiltinSkill(e){let o=sg(e);return this.builtins.set(o.name,o),this.skillCatalog.rescan(),()=>{if(this.builtins.get(o.name)===o)this.builtins.delete(o.name),this.skillCatalog.rescan()}}capture(e,o){if(!this.enabled)return;let u=this.runtime.plugins.list().find((y)=>y.id==="skills");if(u&&(!u.builtin||u.status!=="enabled"))return;let g=this.store.skillSettings().disabled??[];this.sessionSkills.set(e,this.skillCatalog.get(o).filter((y)=>!g.includes(y.name)))}inherit(e,o){if(!this.enabled)return;let u=this.sessionSkills.get(o)??this.availableSkills(void 0,o);this.sessionSkills.set(e,[...u])}retain(){if(this.enabled=!0,this.skillCatalog.open(),this.owners++===0)this.skillCatalog.rescan();let e=!1;return()=>{if(e)return;if(e=!0,--this.owners<=0)this.owners=0,this.enabled=!1,this.skillCatalog.close()}}close(){this.enabled=!1,this.owners=0,this.skillCatalog.close()}requireProject(e){let o=this.runtime.project(e);if(!o)throw new f("no such project");return o}skills(e,o){let u=this.store.skillSettings();return yn(this.availableSkills(e,o).filter((g)=>!(u.disabled??[]).includes(g.name))).map((g)=>({...g,disabled:!1}))}skillList(e,o){let u=e?this.requireProject(e):void 0;return{skills:this.skills(e,o),issues:this.skillCatalog.getIssues(u?.directory)}}allSkills(){let e=this.store.skillSettings(),o=[void 0,...this.runtime.store.projects()],u=o.flatMap((y)=>yn(this.skillCatalog.all(y?.directory)).map((w)=>({...w,disabled:(e.disabled??[]).includes(w.name),...y?{projectID:y.id,projectName:y.name}:{}}))),g=o.flatMap((y)=>this.skillCatalog.getIssues(y?.directory));return{skills:[...new Map(u.map((y)=>[`${y.location}\x00${y.name}`,y])).values()],issues:[...new Map(g.map((y)=>[y.path,y])).values()]}}skillFiles(e,o,u,g){let y=this.previewSkill(e,o,u,g);return{files:pg(y)}}previewSkill(e,o,u,g){let y=o?this.requireProject(o):void 0,T=(g&&!u?this.skillCatalog.all(y?.directory):this.availableSkills(o,u)).find((b)=>b.name===e&&(!g||b.directory===g||b.scope==="builtin"&&g==="<built-in>"));if(!T)throw new f("Skill not found; rescan skills and try again");return T}availableSkills(e,o){if(o){let g=this.sessionSkills.get(o);if(g)return g;let y=this.runtime.get(o);if(!y)throw new f("Session not found");let w=y.projectID?this.runtime.project(y.projectID):void 0;return this.capture(o,w?.directory),this.sessionSkills.get(o)??[]}let u=e?this.requireProject(e):void 0;return this.skillCatalog.get(u?.directory)}skillContent(e,o,u,g){return{text:this.previewSkill(e,o,u,g).raw}}skillSettings(){return this.store.skillSettings()}saveSkillSettings(e){if(!e||!Array.isArray(e.customPaths)||e.customPaths.length>100||e.disabled!==void 0&&(!Array.isArray(e.disabled)||e.disabled.length>1e4||e.disabled.some((u)=>typeof u!=="string"||!u.trim()||u.length>256))||e.customPaths.some((u)=>typeof u!=="string"||!u.trim()||u.length>4096||u.includes("\x00")||!XR(u)))throw new t("Skills accept up to 100 absolute local paths");let o={customPaths:[...new Set(e.customPaths.map((u)=>YR(u)))],disabled:[...new Set(e.disabled??[])]};return this.store.saveSkillSettings(o),this.skillCatalog.rescan(),o}rescanSkills(){return this.skillCatalog.rescan(),this.skills()}}var vn={pluginID:"skills",name:"service",validate(e){return e instanceof Fl}},mg=new WeakMap;function dg(e,o){let u=mg.get(e);if(!u)u=new Fl(e,e.options.dataDir,o),mg.set(e,u);return u}import{join as Eg}from"path";var Fa={name:"@basalt/cli",version:"0.1.10",private:!0,type:"module",imports:{"#*":"./src/*","#test/*":"./test/*"},bin:{basalt:"./src/main.ts"},scripts:{typecheck:"tsgo --noEmit -p ."},dependencies:{"@basalt/builtins":"workspace:*","@basalt/core":"workspace:*","@basalt/protocol":"workspace:*","@basalt/server":"workspace:*","@basalt/web":"workspace:*","@earendil-works/pi-ai":"1.2.0"},exports:{"./plugin-sdk":"./src/plugin-sdk.ts"}};var wr=`# Basalt plugins
|
|
119
119
|
|
|
120
120
|
\u8FDB\u7A0B\u5185\u3001\u5B8C\u5168\u4FE1\u4EFB\u7684 Bun TypeScript \u63D2\u4EF6\u3002\u63D2\u4EF6\u6301\u6709\u771F\u5B9E Runtime\uFF0C\u6CA1\u6709\u6C99\u7BB1\uFF1B\u53EA\u5B89\u88C5\u4F60\u613F\u610F\u6388\u4E88\u670D\u52A1\u8FDB\u7A0B\u5168\u90E8\u6743\u9650\u7684\u4EE3\u7801\u3002\u5185\u7F6E\u529F\u80FD\u4E5F\u4F7F\u7528\u4E0B\u9762\u7684 definePlugin \u548C PluginHost \u5165\u53E3\u3002
|
|
121
121
|
|