zen-code 4.10.2 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +149 -239
- package/dist/{chunk-pzb224c5.js → chunk-0p3df51n.js} +2 -2
- package/dist/{chunk-tjg2e8v3.js → chunk-0pzpg2ra.js} +2 -2
- package/dist/{chunk-wmyc17aa.js → chunk-142wmdx8.js} +1 -1
- package/dist/chunk-1t3rabge.js +1 -0
- package/dist/chunk-2gd8vzrf.js +2 -0
- package/dist/{chunk-vrnj0659.js → chunk-2z45fjmt.js} +51 -51
- package/dist/chunk-3gn0c0j2.js +2 -0
- package/dist/chunk-3nhw50tg.js +1 -0
- package/dist/{chunk-g974hxbz.js → chunk-4260bzp9.js} +1 -1
- package/dist/{chunk-5c3bpcpm.js → chunk-4vh3dxeg.js} +1 -1
- package/dist/{chunk-hnnwbfqk.js → chunk-5e2s5jvw.js} +2 -2
- package/dist/{chunk-s5cqejr6.js → chunk-5kcxxes1.js} +1 -1
- package/dist/chunk-6t0qzren.js +2 -0
- package/dist/chunk-74k5n8f5.js +2 -0
- package/dist/chunk-780j97nd.js +1 -0
- package/dist/chunk-78t2g3ht.js +1 -0
- package/dist/chunk-7d48d71t.js +228 -0
- package/dist/chunk-96b00ygr.js +1 -0
- package/dist/chunk-9kbktaf8.js +89 -0
- package/dist/chunk-a4rvf135.js +1 -0
- package/dist/chunk-ahsvdb98.js +1 -0
- package/dist/{chunk-k4q8j7pg.js → chunk-an34z8wv.js} +1 -1
- package/dist/chunk-arm90pny.js +1 -0
- package/dist/{chunk-40ht9pe1.js → chunk-avqzptcg.js} +2 -2
- package/dist/{chunk-s1tbdcs8.js → chunk-b0yk07x5.js} +1 -1
- package/dist/{chunk-nqh1pptf.js → chunk-be8n8w26.js} +1 -1
- package/dist/{chunk-c7kd2qrp.js → chunk-bqkrynm6.js} +112 -111
- package/dist/chunk-bv28r5cf.js +1 -0
- package/dist/{chunk-mmx0k2yq.js → chunk-c59eqb10.js} +1 -1
- package/dist/{chunk-t6440ajd.js → chunk-cbr2vrpt.js} +2 -2
- package/dist/{chunk-fzh0v6r0.js → chunk-csn4vg3d.js} +2 -2
- package/dist/chunk-df36fv24.js +1 -0
- package/dist/chunk-e3jv1c1w.js +1 -0
- package/dist/{chunk-vbb3m0vz.js → chunk-e6m161vn.js} +1 -1
- package/dist/{chunk-vfxjbdz4.js → chunk-eqetcfer.js} +1 -1
- package/dist/{chunk-8f19qk9r.js → chunk-eze2fzrq.js} +1 -1
- package/dist/{chunk-nmzx5nmt.js → chunk-femf7e4d.js} +1 -1
- package/dist/{chunk-gt8c6dne.js → chunk-fvg6pct8.js} +1 -1
- package/dist/chunk-g2n6hnjp.js +5 -0
- package/dist/{chunk-e8kxa5vj.js → chunk-ge071wp4.js} +2 -2
- package/dist/chunk-h9w6y105.js +1 -0
- package/dist/chunk-hzxg9kx6.js +1 -0
- package/dist/{chunk-g2zskge5.js → chunk-j2qd9mfs.js} +2 -2
- package/dist/chunk-j40cj742.js +2 -0
- package/dist/chunk-jbqqb1ht.js +2 -0
- package/dist/chunk-jz0kw4yt.js +2 -0
- package/dist/chunk-kknfcsyy.js +1 -0
- package/dist/{chunk-zg54h6gy.js → chunk-kvnw06wg.js} +1 -1
- package/dist/chunk-kyb15dg8.js +2 -0
- package/dist/chunk-mq4m1w4w.js +15 -0
- package/dist/chunk-mqcbjght.js +1 -0
- package/dist/{chunk-pe8mzxwn.js → chunk-mqm8wnc8.js} +11 -11
- package/dist/chunk-n7bpjcb0.js +1 -0
- package/dist/chunk-ncaqgas1.js +160 -0
- package/dist/{chunk-f0m4532p.js → chunk-nh11afw0.js} +5 -5
- package/dist/{chunk-spx7nn8t.js → chunk-nwmvyez4.js} +2 -2
- package/dist/chunk-nzyvqxt4.js +1 -0
- package/dist/{chunk-nsw5168d.js → chunk-p6c1xbd5.js} +2 -2
- package/dist/chunk-p75m7q2h.js +1 -0
- package/dist/{chunk-spa69h7p.js → chunk-pffdbhs6.js} +2 -2
- package/dist/chunk-phw7yp5t.js +1 -0
- package/dist/{chunk-8tbtavry.js → chunk-q0452p0f.js} +2 -2
- package/dist/chunk-r133z8tq.js +8 -0
- package/dist/{chunk-qxebn3jw.js → chunk-rqymdmqg.js} +3 -3
- package/dist/chunk-rr7h6wdp.js +7 -0
- package/dist/{chunk-gfhmzpy7.js → chunk-s04zfe57.js} +2 -3
- package/dist/chunk-twhnh3dc.js +1 -0
- package/dist/chunk-tws3wcnm.js +2 -0
- package/dist/chunk-txnezkkt.js +1 -0
- package/dist/{chunk-tjvhqr94.js → chunk-vttq7sqg.js} +1 -1
- package/dist/chunk-vvs5da2x.js +281 -0
- package/dist/{chunk-n9rpnke9.js → chunk-vwj4n000.js} +1 -1
- package/dist/{chunk-4wnmk2tj.js → chunk-w4tbr5h7.js} +3 -3
- package/dist/{chunk-n7s6my89.js → chunk-wts8db9p.js} +32 -32
- package/dist/{chunk-y8qhrx11.js → chunk-x17jyjan.js} +1 -1
- package/dist/chunk-x7x7esvz.js +8 -0
- package/dist/chunk-xprg4hxp.js +17 -0
- package/dist/chunk-xrfpz1vw.js +2 -0
- package/dist/{chunk-hve2a279.js → chunk-xtr6s7kh.js} +2 -2
- package/dist/{chunk-bzgznka5.js → chunk-y807k0kw.js} +1 -1
- package/dist/chunk-ycp2e43r.js +1 -0
- package/dist/chunk-yfv1xeeh.js +2 -0
- package/dist/chunk-zxpb45tb.js +1 -0
- package/dist/cli.js +1 -1
- package/dist/nonInteractive.js +80 -80
- package/dist/zen-core.js +261 -0
- package/dist/zen-keyboard.js +1 -1
- package/package.json +5 -3
- package/dist/chunk-0ddrb30y.js +0 -1
- package/dist/chunk-215an3fz.js +0 -1
- package/dist/chunk-4z0w0ng1.js +0 -2
- package/dist/chunk-57bj89e2.js +0 -1
- package/dist/chunk-5a5mepqj.js +0 -1
- package/dist/chunk-7kw7ss8d.js +0 -1
- package/dist/chunk-86m0rmtc.js +0 -1
- package/dist/chunk-9rayxazs.js +0 -8
- package/dist/chunk-a9gpb2tx.js +0 -2
- package/dist/chunk-a9tw6d68.js +0 -1
- package/dist/chunk-anbtppz1.js +0 -294
- package/dist/chunk-bca8tkkr.js +0 -1
- package/dist/chunk-bdqds8vh.js +0 -1
- package/dist/chunk-dvbb3dd1.js +0 -233
- package/dist/chunk-ehmmd8qc.js +0 -1
- package/dist/chunk-ejfa95sm.js +0 -1
- package/dist/chunk-f7cps5x1.js +0 -1
- package/dist/chunk-fbemqjck.js +0 -2
- package/dist/chunk-feeqtzv5.js +0 -1
- package/dist/chunk-g9911ymn.js +0 -1
- package/dist/chunk-h8fdexm4.js +0 -2
- package/dist/chunk-hp2jzn9x.js +0 -166
- package/dist/chunk-js4qp900.js +0 -2
- package/dist/chunk-m21hvv91.js +0 -2
- package/dist/chunk-mnnyjmgw.js +0 -224
- package/dist/chunk-mw7x6xqp.js +0 -1
- package/dist/chunk-nk62q95g.js +0 -93
- package/dist/chunk-pg1ppq4y.js +0 -1
- package/dist/chunk-q1cxrg0x.js +0 -2
- package/dist/chunk-swc7se71.js +0 -2
- package/dist/chunk-swyc15ym.js +0 -1
- package/dist/chunk-t2s3s6af.js +0 -1
- package/dist/chunk-vdmq9d9x.js +0 -4
- package/dist/chunk-wt3p1w1g.js +0 -1
- package/dist/chunk-y5ry5c7v.js +0 -1
- package/dist/chunk-yy8p9zph.js +0 -2
- package/dist/chunk-z61m3anh.js +0 -1
- package/dist/chunk-zr90qp47.js +0 -1
- package/dist/chunk-zsa62xr0.js +0 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
3
|
+
* http://github.com/janl/mustache.js
|
|
4
|
+
*/var f=Object.prototype.toString,w=Array.isArray||function(z){return f.call(z)==="[object Array]"};function S(J){return typeof J==="function"}function d(J){return w(J)?"array":typeof J}function V(J){return J.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function y(J,z){return J!=null&&typeof J==="object"&&z in J}function x(J,z){return J!=null&&typeof J!=="object"&&J.hasOwnProperty&&J.hasOwnProperty(z)}var v=RegExp.prototype.test;function k(J,z){return v.call(J,z)}var u=/\S/;function g(J){return!k(u,J)}var m={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function p(J){return String(J).replace(/[&<>"'`=\/]/g,function(D){return m[D]})}var r=/\s*/,c=/\s+/,h=/\s*=/,l=/\s*\}/,s=/#|\^|\/|>|\{|&|=|!/;function o(J,z){if(!J)return[];var D=!1,G=[],Q=[],U=[],X=!1,Y=!1,Z="",_=0;function O(){if(X&&!Y)while(U.length)delete Q[U.pop()];else U=[];X=!1,Y=!1}var L,A,C;function b(q){if(typeof q==="string")q=q.split(c,2);if(!w(q)||q.length!==2)throw Error("Invalid tags: "+q);L=new RegExp(V(q[0])+"\\s*"),A=new RegExp("\\s*"+V(q[1])),C=new RegExp("\\s*"+V("}"+q[1]))}b(z||P.tags);var $=new j(J),B,K,F,H,W,I;while(!$.eos()){if(B=$.pos,F=$.scanUntil(L),F)for(var R=0,T=F.length;R<T;++R){if(H=F.charAt(R),g(H))U.push(Q.length),Z+=H;else Y=!0,D=!0,Z+=" ";if(Q.push(["text",H,B,B+1]),B+=1,H===`
|
|
5
|
+
`)O(),Z="",_=0,D=!1}if(!$.scan(L))break;if(X=!0,K=$.scan(s)||"name",$.scan(r),K==="=")F=$.scanUntil(h),$.scan(h),$.scanUntil(A);else if(K==="{")F=$.scanUntil(C),$.scan(l),$.scanUntil(A),K="&";else F=$.scanUntil(A);if(!$.scan(A))throw Error("Unclosed tag at "+$.pos);if(K==">")W=[K,F,B,$.pos,Z,_,D];else W=[K,F,B,$.pos];if(_++,Q.push(W),K==="#"||K==="^")G.push(W);else if(K==="/"){if(I=G.pop(),!I)throw Error('Unopened section "'+F+'" at '+B);if(I[1]!==F)throw Error('Unclosed section "'+I[1]+'" at '+B)}else if(K==="name"||K==="{"||K==="&")Y=!0;else if(K==="=")b(F)}if(O(),I=G.pop(),I)throw Error('Unclosed section "'+I[1]+'" at '+$.pos);return a(i(Q))}function i(J){var z=[],D,G;for(var Q=0,U=J.length;Q<U;++Q)if(D=J[Q],D)if(D[0]==="text"&&G&&G[0]==="text")G[1]+=D[1],G[3]=D[3];else z.push(D),G=D;return z}function a(J){var z=[],D=z,G=[],Q,U;for(var X=0,Y=J.length;X<Y;++X)switch(Q=J[X],Q[0]){case"#":case"^":D.push(Q),G.push(Q),D=Q[4]=[];break;case"/":U=G.pop(),U[5]=Q[2],D=G.length>0?G[G.length-1][4]:z;break;default:D.push(Q)}return z}function j(J){this.string=J,this.tail=J,this.pos=0}j.prototype.eos=function(){return this.tail===""};j.prototype.scan=function(z){var D=this.tail.match(z);if(!D||D.index!==0)return"";var G=D[0];return this.tail=this.tail.substring(G.length),this.pos+=G.length,G};j.prototype.scanUntil=function(z){var D=this.tail.search(z),G;switch(D){case-1:G=this.tail,this.tail="";break;case 0:G="";break;default:G=this.tail.substring(0,D),this.tail=this.tail.substring(D)}return this.pos+=G.length,G};function E(J,z){this.view=J,this.cache={".":this.view},this.parent=z}E.prototype.push=function(z){return new E(z,this)};E.prototype.lookup=function(z){var D=this.cache,G;if(D.hasOwnProperty(z))G=D[z];else{var Q=this,U,X,Y,Z=!1;while(Q){if(z.indexOf(".")>0){U=Q.view,X=z.split("."),Y=0;while(U!=null&&Y<X.length){if(Y===X.length-1)Z=y(U,X[Y])||x(U,X[Y]);U=U[X[Y++]]}}else U=Q.view[z],Z=y(Q.view,z);if(Z){G=U;break}Q=Q.parent}D[z]=G}if(S(G))G=G.call(this.view);return G};function M(){this.templateCache={_cache:{},set:function(z,D){this._cache[z]=D},get:function(z){return this._cache[z]},clear:function(){this._cache={}}}}M.prototype.clearCache=function(){if(typeof this.templateCache<"u")this.templateCache.clear()};M.prototype.parse=function(z,D){var G=this.templateCache,Q=z+":"+(D||P.tags).join(":"),U=typeof G<"u",X=U?G.get(Q):void 0;if(X==null)X=o(z,D),U&&G.set(Q,X);return X};M.prototype.render=function(z,D,G,Q){var U=this.getConfigTags(Q),X=this.parse(z,U),Y=D instanceof E?D:new E(D,void 0);return this.renderTokens(X,Y,G,z,Q)};M.prototype.renderTokens=function(z,D,G,Q,U){var X="",Y,Z,_;for(var O=0,L=z.length;O<L;++O){if(_=void 0,Y=z[O],Z=Y[0],Z==="#")_=this.renderSection(Y,D,G,Q,U);else if(Z==="^")_=this.renderInverted(Y,D,G,Q,U);else if(Z===">")_=this.renderPartial(Y,D,G,U);else if(Z==="&")_=this.unescapedValue(Y,D);else if(Z==="name")_=this.escapedValue(Y,D,U);else if(Z==="text")_=this.rawValue(Y);if(_!==void 0)X+=_}return X};M.prototype.renderSection=function(z,D,G,Q,U){var X=this,Y="",Z=D.lookup(z[1]);function _(A){return X.render(A,D,G,U)}if(!Z)return;if(w(Z))for(var O=0,L=Z.length;O<L;++O)Y+=this.renderTokens(z[4],D.push(Z[O]),G,Q,U);else if(typeof Z==="object"||typeof Z==="string"||typeof Z==="number")Y+=this.renderTokens(z[4],D.push(Z),G,Q,U);else if(S(Z)){if(typeof Q!=="string")throw Error("Cannot use higher-order sections without the original template");if(Z=Z.call(D.view,Q.slice(z[3],z[5]),_),Z!=null)Y+=Z}else Y+=this.renderTokens(z[4],D,G,Q,U);return Y};M.prototype.renderInverted=function(z,D,G,Q,U){var X=D.lookup(z[1]);if(!X||w(X)&&X.length===0)return this.renderTokens(z[4],D,G,Q,U)};M.prototype.indentPartial=function(z,D,G){var Q=D.replace(/[^ \t]/g,""),U=z.split(`
|
|
6
|
+
`);for(var X=0;X<U.length;X++)if(U[X].length&&(X>0||!G))U[X]=Q+U[X];return U.join(`
|
|
7
|
+
`)};M.prototype.renderPartial=function(z,D,G,Q){if(!G)return;var U=this.getConfigTags(Q),X=S(G)?G(z[1]):G[z[1]];if(X!=null){var Y=z[6],Z=z[5],_=z[4],O=X;if(Z==0&&_)O=this.indentPartial(X,_,Y);var L=this.parse(O,U);return this.renderTokens(L,D,G,O,Q)}};M.prototype.unescapedValue=function(z,D){var G=D.lookup(z[1]);if(G!=null)return G};M.prototype.escapedValue=function(z,D,G){var Q=this.getConfigEscape(G)||P.escape,U=D.lookup(z[1]);if(U!=null)return typeof U==="number"&&Q===P.escape?String(U):Q(U)};M.prototype.rawValue=function(z){return z[1]};M.prototype.getConfigTags=function(z){if(w(z))return z;else if(z&&typeof z==="object")return z.tags;else return};M.prototype.getConfigEscape=function(z){if(z&&typeof z==="object"&&!w(z))return z.escape;else return};var P={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(J){N.templateCache=J},get templateCache(){return N.templateCache}},N=new M;P.clearCache=function(){return N.clearCache()};P.parse=function(z,D){return N.parse(z,D)};P.render=function(z,D,G,Q){if(typeof z!=="string")throw TypeError('Invalid template! Template should be a "string" but "'+d(z)+'" was given as the first argument for mustache#render(template, view, partials)');return N.render(z,D,G,Q)};P.escape=p;P.Scanner=j;P.Context=E;P.Writer=M;var t=P;
|
|
8
|
+
export{t as yk};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{xl as h}from"./chunk-0pzpg2ra.js";import{Rl as yw,Tl as d,Wl as t}from"./chunk-x17jyjan.js";var G0=d((n1)=>{n1.isInteger=($)=>{if(typeof $==="number")return Number.isInteger($);if(typeof $==="string"&&$.trim()!=="")return Number.isInteger(Number($));return!1};n1.find=($,w)=>$.nodes.find((q)=>q.type===w);n1.exceedsLimit=($,w,q=1,J)=>{if(J===!1)return!1;if(!n1.isInteger($)||!n1.isInteger(w))return!1;return(Number(w)-Number($))/Number(q)>=J};n1.escapeNode=($,w=0,q)=>{let J=$.nodes[w];if(!J)return;if(q&&J.type===q||J.type==="open"||J.type==="close"){if(J.escaped!==!0)J.value="\\"+J.value,J.escaped=!0}};n1.encloseBrace=($)=>{if($.type!=="brace")return!1;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;return!1};n1.isInvalidBrace=($)=>{if($.type!=="brace")return!1;if($.invalid===!0||$.dollar)return!0;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;if($.open!==!0||$.close!==!0)return $.invalid=!0,!0;return!1};n1.isOpenOrClose=($)=>{if($.type==="open"||$.type==="close")return!0;return $.open===!0||$.close===!0};n1.reduce=($)=>$.reduce((w,q)=>{if(q.type==="text")w.push(q.value);if(q.type==="range")q.type="text";return w},[]);n1.flatten=(...$)=>{let w=[],q=(J)=>{for(let f=0;f<J.length;f++){let Z=J[f];if(Array.isArray(Z)){q(Z);continue}if(Z!==void 0)w.push(Z)}return w};return q($),w}});var M0=d((jw,v0)=>{var d0=G0();v0.exports=($,w={})=>{let q=(J,f={})=>{let Z=w.escapeInvalid&&d0.isInvalidBrace(f),V=J.invalid===!0&&w.escapeInvalid===!0,F="";if(J.value){if((Z||V)&&d0.isOpenOrClose(J))return"\\"+J.value;return J.value}if(J.value)return J.value;if(J.nodes)for(let N of J.nodes)F+=q(N);return F};return q($)}});var l0=d((zw,m0)=>{/*!
|
|
2
2
|
* is-number <https://github.com/jonschlinkert/is-number>
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
@@ -14,5 +14,5 @@ import{tl as h}from"./chunk-tjg2e8v3.js";import{Dl as yw,Fl as d,Il as t}from"./
|
|
|
14
14
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
15
15
|
* Licensed under the MIT License.
|
|
16
16
|
*/var F$=t("util"),t0=e0(),o0=($)=>$!==null&&typeof $==="object"&&!Array.isArray($),U$=($)=>{return(w)=>$===!0?Number(w):String(w)},L0=($)=>{return typeof $==="number"||typeof $==="string"&&$!==""},Y0=($)=>Number.isInteger(+$),O0=($)=>{let w=`${$}`,q=-1;if(w[0]==="-")w=w.slice(1);if(w==="0")return!1;while(w[++q]==="0");return q>0},X$=($,w,q)=>{if(typeof $==="string"||typeof w==="string")return!0;return q.stringify===!0},Q$=($,w,q)=>{if(w>0){let J=$[0]==="-"?"-":"";if(J)$=$.slice(1);$=J+$.padStart(J?w-1:w,"0")}if(q===!1)return String($);return $},K0=($,w)=>{let q=$[0]==="-"?"-":"";if(q)$=$.slice(1),w--;while($.length<w)$="0"+$;return q?"-"+$:$},B$=($,w,q)=>{$.negatives.sort((F,N)=>F<N?-1:F>N?1:0),$.positives.sort((F,N)=>F<N?-1:F>N?1:0);let J=w.capture?"":"?:",f="",Z="",V;if($.positives.length)f=$.positives.map((F)=>K0(String(F),q)).join("|");if($.negatives.length)Z=`-(${J}${$.negatives.map((F)=>K0(String(F),q)).join("|")})`;if(f&&Z)V=`${f}|${Z}`;else V=f||Z;if(w.wrap)return`(${J}${V})`;return V},$1=($,w,q,J)=>{if(q)return t0($,w,{wrap:!1,...J});let f=String.fromCharCode($);if($===w)return f;let Z=String.fromCharCode(w);return`[${f}-${Z}]`},w1=($,w,q)=>{if(Array.isArray($)){let J=q.wrap===!0,f=q.capture?"":"?:";return J?`(${f}${$.join("|")})`:$.join("|")}return t0($,w,q)},q1=(...$)=>{return RangeError("Invalid range arguments: "+F$.inspect(...$))},J1=($,w,q)=>{if(q.strictRanges===!0)throw q1([$,w]);return[]},N$=($,w)=>{if(w.strictRanges===!0)throw TypeError(`Expected step "${$}" to be a number`);return[]},G$=($,w,q=1,J={})=>{let f=Number($),Z=Number(w);if(!Number.isInteger(f)||!Number.isInteger(Z)){if(J.strictRanges===!0)throw q1([$,w]);return[]}if(f===0)f=0;if(Z===0)Z=0;let V=f>Z,F=String($),N=String(w),K=String(q);q=Math.max(Math.abs(q),1);let B=O0(F)||O0(N)||O0(K),j=B?Math.max(F.length,N.length,K.length):0,X=B===!1&&X$($,w,J)===!1,H=J.transform||U$(X);if(J.toRegex&&q===1)return $1(K0($,j),K0(w,j),!0,J);let y={negatives:[],positives:[]},M=(u)=>y[u<0?"negatives":"positives"].push(Math.abs(u)),L=[],A=0;while(V?f>=Z:f<=Z){if(J.toRegex===!0&&q>1)M(f);else L.push(Q$(H(f,A),j,X));f=V?f-q:f+q,A++}if(J.toRegex===!0)return q>1?B$(y,J,j):w1(L,null,{wrap:!1,...J});return L},M$=($,w,q=1,J={})=>{if(!Y0($)&&$.length>1||!Y0(w)&&w.length>1)return J1($,w,J);let f=J.transform||((X)=>String.fromCharCode(X)),Z=`${$}`.charCodeAt(0),V=`${w}`.charCodeAt(0),F=Z>V,N=Math.min(Z,V),K=Math.max(Z,V);if(J.toRegex&&q===1)return $1(N,K,!1,J);let B=[],j=0;while(F?Z>=V:Z<=V)B.push(f(Z,j)),Z=F?Z-q:Z+q,j++;if(J.toRegex===!0)return w1(B,null,{wrap:!1,options:J});return B},y0=($,w,q,J={})=>{if(w==null&&L0($))return[$];if(!L0($)||!L0(w))return J1($,w,J);if(typeof q==="function")return y0($,w,1,{transform:q});if(o0(q))return y0($,w,0,q);let f={...J};if(f.capture===!0)f.wrap=!0;if(q=q||f.step||1,!Y0(q)){if(q!=null&&!o0(q))return N$(q,f);return y0($,w,1,q)}if(Y0($)&&Y0(w))return G$($,w,q,f);return M$($,w,Math.max(Math.abs(q),1),f)};f1.exports=y0});var Y1=d((Dw,Z1)=>{var y$=E0(),V1=G0(),K$=($,w={})=>{let q=(J,f={})=>{let Z=V1.isInvalidBrace(f),V=J.invalid===!0&&w.escapeInvalid===!0,F=Z===!0||V===!0,N=w.escapeInvalid===!0?"\\":"",K="";if(J.isOpen===!0)return N+J.value;if(J.isClose===!0)return console.log("node.isClose",N,J.value),N+J.value;if(J.type==="open")return F?N+J.value:"(";if(J.type==="close")return F?N+J.value:")";if(J.type==="comma")return J.prev.type==="comma"?"":F?J.value:"|";if(J.value)return J.value;if(J.nodes&&J.ranges>0){let B=V1.reduce(J.nodes),j=y$(...B,{...w,wrap:!1,toRegex:!0,strictZeros:!0});if(j.length!==0)return B.length>1&&j.length>1?`(${j})`:j}if(J.nodes)for(let B of J.nodes)K+=q(B,J);return K};return q($)};Z1.exports=K$});var U1=d((Hw,F1)=>{var j$=E0(),W1=M0(),V0=G0(),J0=($="",w="",q=!1)=>{let J=[];if($=[].concat($),w=[].concat(w),!w.length)return $;if(!$.length)return q?V0.flatten(w).map((f)=>`{${f}}`):w;for(let f of $)if(Array.isArray(f))for(let Z of f)J.push(J0(Z,w,q));else for(let Z of w){if(q===!0&&typeof Z==="string")Z=`{${Z}}`;J.push(Array.isArray(Z)?J0(f,Z,q):f+Z)}return V0.flatten(J)},z$=($,w={})=>{let q=w.rangeLimit===void 0?1000:w.rangeLimit,J=(f,Z={})=>{f.queue=[];let V=Z,F=Z.queue;while(V.type!=="brace"&&V.type!=="root"&&V.parent)V=V.parent,F=V.queue;if(f.invalid||f.dollar){F.push(J0(F.pop(),W1(f,w)));return}if(f.type==="brace"&&f.invalid!==!0&&f.nodes.length===2){F.push(J0(F.pop(),["{}"]));return}if(f.nodes&&f.ranges>0){let j=V0.reduce(f.nodes);if(V0.exceedsLimit(...j,w.step,q))throw RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let X=j$(...j,w);if(X.length===0)X=W1(f,w);F.push(J0(F.pop(),X)),f.nodes=[];return}let N=V0.encloseBrace(f),K=f.queue,B=f;while(B.type!=="brace"&&B.type!=="root"&&B.parent)B=B.parent,K=B.queue;for(let j=0;j<f.nodes.length;j++){let X=f.nodes[j];if(X.type==="comma"&&f.type==="brace"){if(j===1)K.push("");K.push("");continue}if(X.type==="close"){F.push(J0(F.pop(),K,N));continue}if(X.value&&X.type!=="open"){K.push(J0(K.pop(),X.value));continue}if(X.nodes)J(X,f)}return K};return V0.flatten(J($))};F1.exports=z$});var Q1=d((Pw,X1)=>{X1.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
17
|
-
`,CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var y1=d((Lw,M1)=>{var I$=M0(),{MAX_LENGTH:B1,CHAR_BACKSLASH:R0,CHAR_BACKTICK:C$,CHAR_COMMA:D$,CHAR_DOT:H$,CHAR_LEFT_PARENTHESES:P$,CHAR_RIGHT_PARENTHESES:L$,CHAR_LEFT_CURLY_BRACE:O$,CHAR_RIGHT_CURLY_BRACE:E$,CHAR_LEFT_SQUARE_BRACKET:N1,CHAR_RIGHT_SQUARE_BRACKET:G1,CHAR_DOUBLE_QUOTE:R$,CHAR_SINGLE_QUOTE:_$,CHAR_NO_BREAK_SPACE:T$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:A$}=Q1(),S$=($,w={})=>{if(typeof $!=="string")throw TypeError("Expected a string");let q=w||{},J=typeof q.maxLength==="number"?Math.min(B1,q.maxLength):B1;if($.length>J)throw SyntaxError(`Input length (${$.length}), exceeds max characters (${J})`);let f={type:"root",input:$,nodes:[]},Z=[f],V=f,F=f,N=0,K=$.length,B=0,j=0,X,H=()=>$[B++],y=(M)=>{if(M.type==="text"&&F.type==="dot")F.type="text";if(F&&F.type==="text"&&M.type==="text"){F.value+=M.value;return}return V.nodes.push(M),M.parent=V,M.prev=F,F=M,M};y({type:"bos"});while(B<K){if(V=Z[Z.length-1],X=H(),X===A$||X===T$)continue;if(X===R0){y({type:"text",value:(w.keepEscaping?X:"")+H()});continue}if(X===G1){y({type:"text",value:"\\"+X});continue}if(X===N1){N++;let M;while(B<K&&(M=H())){if(X+=M,M===N1){N++;continue}if(M===R0){X+=H();continue}if(M===G1){if(N--,N===0)break}}y({type:"text",value:X});continue}if(X===P$){V=y({type:"paren",nodes:[]}),Z.push(V),y({type:"text",value:X});continue}if(X===L$){if(V.type!=="paren"){y({type:"text",value:X});continue}V=Z.pop(),y({type:"text",value:X}),V=Z[Z.length-1];continue}if(X===R$||X===_$||X===C$){let M=X,L;if(w.keepQuotes!==!0)X="";while(B<K&&(L=H())){if(L===R0){X+=L+H();continue}if(L===M){if(w.keepQuotes===!0)X+=L;break}X+=L}y({type:"text",value:X});continue}if(X===O$){j++;let L={type:"brace",open:!0,close:!1,dollar:F.value&&F.value.slice(-1)==="$"||V.dollar===!0,depth:j,commas:0,ranges:0,nodes:[]};V=y(L),Z.push(V),y({type:"open",value:X});continue}if(X===E$){if(V.type!=="brace"){y({type:"text",value:X});continue}let M="close";V=Z.pop(),V.close=!0,y({type:M,value:X}),j--,V=Z[Z.length-1];continue}if(X===D$&&j>0){if(V.ranges>0){V.ranges=0;let M=V.nodes.shift();V.nodes=[M,{type:"text",value:I$(V)}]}y({type:"comma",value:X}),V.commas++;continue}if(X===H$&&j>0&&V.commas===0){let M=V.nodes;if(j===0||M.length===0){y({type:"text",value:X});continue}if(F.type==="dot"){if(V.range=[],F.value+=X,F.type="range",V.nodes.length!==3&&V.nodes.length!==5){V.invalid=!0,V.ranges=0,F.type="text";continue}V.ranges++,V.args=[];continue}if(F.type==="range"){M.pop();let L=M[M.length-1];L.value+=F.value+X,F=L,V.ranges--;continue}y({type:"dot",value:X});continue}y({type:"text",value:X})}do if(V=Z.pop(),V.type!=="root"){V.nodes.forEach((A)=>{if(!A.nodes){if(A.type==="open")A.isOpen=!0;if(A.type==="close")A.isClose=!0;if(!A.nodes)A.type="text";A.invalid=!0}});let M=Z[Z.length-1],L=M.nodes.indexOf(V);M.nodes.splice(L,1,...V.nodes)}while(Z.length>0);return y({type:"eos"}),f};M1.exports=S$});var z1=d((Ow,j1)=>{var K1=M0(),x$=Y1(),g$=U1(),h$=y1(),r=($,w={})=>{let q=[];if(Array.isArray($))for(let J of $){let f=r.create(J,w);if(Array.isArray(f))q.push(...f);else q.push(f)}else q=[].concat(r.create($,w));if(w&&w.expand===!0&&w.nodupes===!0)q=[...new Set(q)];return q};r.parse=($,w={})=>h$($,w);r.stringify=($,w={})=>{if(typeof $==="string")return K1(r.parse($,w),w);return K1($,w)};r.compile=($,w={})=>{if(typeof $==="string")$=r.parse($,w);return x$($,w)};r.expand=($,w={})=>{if(typeof $==="string")$=r.parse($,w);let q=g$($,w);if(w.noempty===!0)q=q.filter(Boolean);if(w.nodupes===!0)q=[...new Set(q)];return q};r.create=($,w={})=>{if($===""||$.length<3)return[$];return w.expand!==!0?r.compile($,w):r.expand($,w)};j1.exports=r});var W0=d((Ew,C1)=>{var k$=t("path"),I1={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)"},b$={...I1,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)"},d$={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};C1.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:d$,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:k$.sep,extglobChars($){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${$.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars($){return $===!0?b$:I1}}});var F0=d((i$)=>{var v$=t("path"),m$=process.platform==="win32",{REGEX_BACKSLASH:l$,REGEX_REMOVE_BACKSLASH:u$,REGEX_SPECIAL_CHARS:c$,REGEX_SPECIAL_CHARS_GLOBAL:r$}=W0();i$.isObject=($)=>$!==null&&typeof $==="object"&&!Array.isArray($);i$.hasRegexChars=($)=>c$.test($);i$.isRegexChar=($)=>$.length===1&&i$.hasRegexChars($);i$.escapeRegex=($)=>$.replace(r$,"\\$1");i$.toPosixSlashes=($)=>$.replace(l$,"/");i$.removeBackslashes=($)=>{return $.replace(u$,(w)=>{return w==="\\"?"":w})};i$.supportsLookbehinds=()=>{let $=process.version.slice(1).split(".").map(Number);if($.length===3&&$[0]>=9||$[0]===8&&$[1]>=10)return!0;return!1};i$.isWindows=($)=>{if($&&typeof $.windows==="boolean")return $.windows;return m$===!0||v$.sep==="\\"};i$.escapeLast=($,w,q)=>{let J=$.lastIndexOf(w,q);if(J===-1)return $;if($[J-1]==="\\")return i$.escapeLast($,w,J-1);return`${$.slice(0,J)}\\${$.slice(J)}`};i$.removePrefix=($,w={})=>{let q=$;if(q.startsWith("./"))q=q.slice(2),w.prefix="./";return q};i$.wrapOutput=($,w={},q={})=>{let J=q.contains?"":"^",f=q.contains?"":"$",Z=`${J}(?:${$})${f}`;if(w.negated===!0)Z=`(?:^(?!${Z}).*$)`;return Z}});var A1=d((_w,T1)=>{var P1=F0(),{CHAR_ASTERISK:_0,CHAR_AT:qw,CHAR_BACKWARD_SLASH:U0,CHAR_COMMA:Jw,CHAR_DOT:T0,CHAR_EXCLAMATION_MARK:A0,CHAR_FORWARD_SLASH:_1,CHAR_LEFT_CURLY_BRACE:S0,CHAR_LEFT_PARENTHESES:x0,CHAR_LEFT_SQUARE_BRACKET:fw,CHAR_PLUS:Vw,CHAR_QUESTION_MARK:L1,CHAR_RIGHT_CURLY_BRACE:Zw,CHAR_RIGHT_PARENTHESES:O1,CHAR_RIGHT_SQUARE_BRACKET:Yw}=W0(),E1=($)=>{return $===_1||$===U0},R1=($)=>{if($.isPrefix!==!0)$.depth=$.isGlobstar?1/0:1},Ww=($,w)=>{let q=w||{},J=$.length-1,f=q.parts===!0||q.scanToEnd===!0,Z=[],V=[],F=[],N=$,K=-1,B=0,j=0,X=!1,H=!1,y=!1,M=!1,L=!1,A=!1,u=!1,S=!1,n=!1,b=!1,e=0,v,z,P={value:"",depth:0,isGlob:!1},k=()=>K>=J,U=()=>N.charCodeAt(K+1),_=()=>{return v=z,N.charCodeAt(++K)};while(K<J){z=_();let m;if(z===U0){if(u=P.backslashes=!0,z=_(),z===S0)A=!0;continue}if(A===!0||z===S0){e++;while(k()!==!0&&(z=_())){if(z===U0){u=P.backslashes=!0,_();continue}if(z===S0){e++;continue}if(A!==!0&&z===T0&&(z=_())===T0){if(X=P.isBrace=!0,y=P.isGlob=!0,b=!0,f===!0)continue;break}if(A!==!0&&z===Jw){if(X=P.isBrace=!0,y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===Zw){if(e--,e===0){A=!1,X=P.isBrace=!0,b=!0;break}}}if(f===!0)continue;break}if(z===_1){if(Z.push(K),V.push(P),P={value:"",depth:0,isGlob:!1},b===!0)continue;if(v===T0&&K===B+1){B+=2;continue}j=K+1;continue}if(q.noext!==!0){if((z===Vw||z===qw||z===_0||z===L1||z===A0)===!0&&U()===x0){if(y=P.isGlob=!0,M=P.isExtglob=!0,b=!0,z===A0&&K===B)n=!0;if(f===!0){while(k()!==!0&&(z=_())){if(z===U0){u=P.backslashes=!0,z=_();continue}if(z===O1){y=P.isGlob=!0,b=!0;break}}continue}break}}if(z===_0){if(v===_0)L=P.isGlobstar=!0;if(y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===L1){if(y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===fw){while(k()!==!0&&(m=_())){if(m===U0){u=P.backslashes=!0,_();continue}if(m===Yw){H=P.isBracket=!0,y=P.isGlob=!0,b=!0;break}}if(f===!0)continue;break}if(q.nonegate!==!0&&z===A0&&K===B){S=P.negated=!0,B++;continue}if(q.noparen!==!0&&z===x0){if(y=P.isGlob=!0,f===!0){while(k()!==!0&&(z=_())){if(z===x0){u=P.backslashes=!0,z=_();continue}if(z===O1){b=!0;break}}continue}break}if(y===!0){if(b=!0,f===!0)continue;break}}if(q.noext===!0)M=!1,y=!1;let O=N,o="",Y="";if(B>0)o=N.slice(0,B),N=N.slice(B),j-=B;if(O&&y===!0&&j>0)O=N.slice(0,j),Y=N.slice(j);else if(y===!0)O="",Y=N;else O=N;if(O&&O!==""&&O!=="/"&&O!==N){if(E1(O.charCodeAt(O.length-1)))O=O.slice(0,-1)}if(q.unescape===!0){if(Y)Y=P1.removeBackslashes(Y);if(O&&u===!0)O=P1.removeBackslashes(O)}let W={prefix:o,input:$,start:B,base:O,glob:Y,isBrace:X,isBracket:H,isGlob:y,isExtglob:M,isGlobstar:L,negated:S,negatedExtglob:n};if(q.tokens===!0){if(W.maxDepth=0,!E1(z))V.push(P);W.tokens=V}if(q.parts===!0||q.tokens===!0){let m;for(let D=0;D<Z.length;D++){let p=m?m+1:B,a=Z[D],c=$.slice(p,a);if(q.tokens){if(D===0&&B!==0)V[D].isPrefix=!0,V[D].value=o;else V[D].value=c;R1(V[D]),W.maxDepth+=V[D].depth}if(D!==0||c!=="")F.push(c);m=a}if(m&&m+1<$.length){let D=$.slice(m+1);if(F.push(D),q.tokens)V[V.length-1].value=D,R1(V[V.length-1]),W.maxDepth+=V[V.length-1].depth}W.slashes=Z,W.parts=F}return W};T1.exports=Ww});var g1=d((Tw,x1)=>{var j0=W0(),i=F0(),{MAX_LENGTH:z0,POSIX_REGEX_SOURCE:Fw,REGEX_NON_SPECIAL_CHARS:Uw,REGEX_SPECIAL_CHARS_BACKREF:Xw,REPLACEMENTS:S1}=j0,Qw=($,w)=>{if(typeof w.expandRange==="function")return w.expandRange(...$,w);$.sort();let q=`[${$.join("-")}]`;try{new RegExp(q)}catch(J){return $.map((f)=>i.escapeRegex(f)).join("..")}return q},Z0=($,w)=>{return`Missing ${$}: "${w}" - use "\\\\${w}" to match literal characters`},g0=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");$=S1[$]||$;let q={...w},J=typeof q.maxLength==="number"?Math.min(z0,q.maxLength):z0,f=$.length;if(f>J)throw SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${J}`);let Z={type:"bos",value:"",output:q.prepend||""},V=[Z],F=q.capture?"":"?:",N=i.isWindows(w),K=j0.globChars(N),B=j0.extglobChars(K),{DOT_LITERAL:j,PLUS_LITERAL:X,SLASH_LITERAL:H,ONE_CHAR:y,DOTS_SLASH:M,NO_DOT:L,NO_DOT_SLASH:A,NO_DOTS_SLASH:u,QMARK:S,QMARK_NO_DOT:n,STAR:b,START_ANCHOR:e}=K,v=(G)=>{return`(${F}(?:(?!${e}${G.dot?M:j}).)*?)`},z=q.dot?"":L,P=q.dot?S:n,k=q.bash===!0?v(q):b;if(q.capture)k=`(${k})`;if(typeof q.noext==="boolean")q.noextglob=q.noext;let U={input:$,index:-1,start:0,dot:q.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:V};$=i.removePrefix($,U),f=$.length;let _=[],O=[],o=[],Y=Z,W,m=()=>U.index===f-1,D=U.peek=(G=1)=>$[U.index+G],p=U.advance=()=>$[++U.index]||"",a=()=>$.slice(U.index+1),c=(G="",E=0)=>{U.consumed+=G,U.index+=E},X0=(G)=>{U.output+=G.output!=null?G.output:G.value,c(G.value)},r1=()=>{let G=1;while(D()==="!"&&(D(2)!=="("||D(3)==="?"))p(),U.start++,G++;if(G%2===0)return!1;return U.negated=!0,U.start++,!0},Q0=(G)=>{U[G]++,o.push(G)},w0=(G)=>{U[G]--,o.pop()},C=(G)=>{if(Y.type==="globstar"){let E=U.braces>0&&(G.type==="comma"||G.type==="brace"),Q=G.extglob===!0||_.length&&(G.type==="pipe"||G.type==="paren");if(G.type!=="slash"&&G.type!=="paren"&&!E&&!Q)U.output=U.output.slice(0,-Y.output.length),Y.type="star",Y.value="*",Y.output=k,U.output+=Y.output}if(_.length&&G.type!=="paren")_[_.length-1].inner+=G.value;if(G.value||G.output)X0(G);if(Y&&Y.type==="text"&&G.type==="text"){Y.value+=G.value,Y.output=(Y.output||"")+G.value;return}G.prev=Y,V.push(G),Y=G},B0=(G,E)=>{let Q={...B[E],conditions:1,inner:""};Q.prev=Y,Q.parens=U.parens,Q.output=U.output;let I=(q.capture?"(":"")+Q.open;Q0("parens"),C({type:G,value:E,output:U.output?"":y}),C({type:"paren",extglob:!0,value:p(),output:I}),_.push(Q)},i1=(G)=>{let E=G.close+(q.capture?")":""),Q;if(G.type==="negate"){let I=k;if(G.inner&&G.inner.length>1&&G.inner.includes("/"))I=v(q);if(I!==k||m()||/^\)+$/.test(a()))E=G.close=`)$))${I}`;if(G.inner.includes("*")&&(Q=a())&&/^\.[^\\/.]+$/.test(Q)){let T=g0(Q,{...w,fastpaths:!1}).output;E=G.close=`)${T})${I})`}if(G.prev.type==="bos")U.negatedExtglob=!0}C({type:"paren",extglob:!0,value:W,output:E}),w0("parens")};if(q.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test($)){let G=!1,E=$.replace(Xw,(Q,I,T,l,g,D0)=>{if(l==="\\")return G=!0,Q;if(l==="?"){if(I)return I+l+(g?S.repeat(g.length):"");if(D0===0)return P+(g?S.repeat(g.length):"");return S.repeat(T.length)}if(l===".")return j.repeat(T.length);if(l==="*"){if(I)return I+l+(g?k:"");return k}return I?Q:`\\${Q}`});if(G===!0)if(q.unescape===!0)E=E.replace(/\\/g,"");else E=E.replace(/\\+/g,(Q)=>{return Q.length%2===0?"\\\\":Q?"\\":""});if(E===$&&q.contains===!0)return U.output=$,U;return U.output=i.wrapOutput(E,U,w),U}while(!m()){if(W=p(),W==="\x00")continue;if(W==="\\"){let Q=D();if(Q==="/"&&q.bash!==!0)continue;if(Q==="."||Q===";")continue;if(!Q){W+="\\",C({type:"text",value:W});continue}let I=/^\\+/.exec(a()),T=0;if(I&&I[0].length>2){if(T=I[0].length,U.index+=T,T%2!==0)W+="\\"}if(q.unescape===!0)W=p();else W+=p();if(U.brackets===0){C({type:"text",value:W});continue}}if(U.brackets>0&&(W!=="]"||Y.value==="["||Y.value==="[^")){if(q.posix!==!1&&W===":"){let Q=Y.value.slice(1);if(Q.includes("[")){if(Y.posix=!0,Q.includes(":")){let I=Y.value.lastIndexOf("["),T=Y.value.slice(0,I),l=Y.value.slice(I+2),g=Fw[l];if(g){if(Y.value=T+g,U.backtrack=!0,p(),!Z.output&&V.indexOf(Y)===1)Z.output=y;continue}}}}if(W==="["&&D()!==":"||W==="-"&&D()==="]")W=`\\${W}`;if(W==="]"&&(Y.value==="["||Y.value==="[^"))W=`\\${W}`;if(q.posix===!0&&W==="!"&&Y.value==="[")W="^";Y.value+=W,X0({value:W});continue}if(U.quotes===1&&W!=='"'){W=i.escapeRegex(W),Y.value+=W,X0({value:W});continue}if(W==='"'){if(U.quotes=U.quotes===1?0:1,q.keepQuotes===!0)C({type:"text",value:W});continue}if(W==="("){Q0("parens"),C({type:"paren",value:W});continue}if(W===")"){if(U.parens===0&&q.strictBrackets===!0)throw SyntaxError(Z0("opening","("));let Q=_[_.length-1];if(Q&&U.parens===Q.parens+1){i1(_.pop());continue}C({type:"paren",value:W,output:U.parens?")":"\\)"}),w0("parens");continue}if(W==="["){if(q.nobracket===!0||!a().includes("]")){if(q.nobracket!==!0&&q.strictBrackets===!0)throw SyntaxError(Z0("closing","]"));W=`\\${W}`}else Q0("brackets");C({type:"bracket",value:W});continue}if(W==="]"){if(q.nobracket===!0||Y&&Y.type==="bracket"&&Y.value.length===1){C({type:"text",value:W,output:`\\${W}`});continue}if(U.brackets===0){if(q.strictBrackets===!0)throw SyntaxError(Z0("opening","["));C({type:"text",value:W,output:`\\${W}`});continue}w0("brackets");let Q=Y.value.slice(1);if(Y.posix!==!0&&Q[0]==="^"&&!Q.includes("/"))W=`/${W}`;if(Y.value+=W,X0({value:W}),q.literalBrackets===!1||i.hasRegexChars(Q))continue;let I=i.escapeRegex(Y.value);if(U.output=U.output.slice(0,-Y.value.length),q.literalBrackets===!0){U.output+=I,Y.value=I;continue}Y.value=`(${F}${I}|${Y.value})`,U.output+=Y.value;continue}if(W==="{"&&q.nobrace!==!0){Q0("braces");let Q={type:"brace",value:W,output:"(",outputIndex:U.output.length,tokensIndex:U.tokens.length};O.push(Q),C(Q);continue}if(W==="}"){let Q=O[O.length-1];if(q.nobrace===!0||!Q){C({type:"text",value:W,output:W});continue}let I=")";if(Q.dots===!0){let T=V.slice(),l=[];for(let g=T.length-1;g>=0;g--){if(V.pop(),T[g].type==="brace")break;if(T[g].type!=="dots")l.unshift(T[g].value)}I=Qw(l,q),U.backtrack=!0}if(Q.comma!==!0&&Q.dots!==!0){let T=U.output.slice(0,Q.outputIndex),l=U.tokens.slice(Q.tokensIndex);Q.value=Q.output="\\{",W=I="\\}",U.output=T;for(let g of l)U.output+=g.output||g.value}C({type:"brace",value:W,output:I}),w0("braces"),O.pop();continue}if(W==="|"){if(_.length>0)_[_.length-1].conditions++;C({type:"text",value:W});continue}if(W===","){let Q=W,I=O[O.length-1];if(I&&o[o.length-1]==="braces")I.comma=!0,Q="|";C({type:"comma",value:W,output:Q});continue}if(W==="/"){if(Y.type==="dot"&&U.index===U.start+1){U.start=U.index+1,U.consumed="",U.output="",V.pop(),Y=Z;continue}C({type:"slash",value:W,output:H});continue}if(W==="."){if(U.braces>0&&Y.type==="dot"){if(Y.value===".")Y.output=j;let Q=O[O.length-1];Y.type="dots",Y.output+=W,Y.value+=W,Q.dots=!0;continue}if(U.braces+U.parens===0&&Y.type!=="bos"&&Y.type!=="slash"){C({type:"text",value:W,output:j});continue}C({type:"dot",value:W,output:j});continue}if(W==="?"){if(!(Y&&Y.value==="(")&&q.noextglob!==!0&&D()==="("&&D(2)!=="?"){B0("qmark",W);continue}if(Y&&Y.type==="paren"){let I=D(),T=W;if(I==="<"&&!i.supportsLookbehinds())throw Error("Node.js v10 or higher is required for regex lookbehinds");if(Y.value==="("&&!/[!=<:]/.test(I)||I==="<"&&!/<([!=]|\w+>)/.test(a()))T=`\\${W}`;C({type:"text",value:W,output:T});continue}if(q.dot!==!0&&(Y.type==="slash"||Y.type==="bos")){C({type:"qmark",value:W,output:n});continue}C({type:"qmark",value:W,output:S});continue}if(W==="!"){if(q.noextglob!==!0&&D()==="("){if(D(2)!=="?"||!/[!=<:]/.test(D(3))){B0("negate",W);continue}}if(q.nonegate!==!0&&U.index===0){r1();continue}}if(W==="+"){if(q.noextglob!==!0&&D()==="("&&D(2)!=="?"){B0("plus",W);continue}if(Y&&Y.value==="("||q.regex===!1){C({type:"plus",value:W,output:X});continue}if(Y&&(Y.type==="bracket"||Y.type==="paren"||Y.type==="brace")||U.parens>0){C({type:"plus",value:W});continue}C({type:"plus",value:X});continue}if(W==="@"){if(q.noextglob!==!0&&D()==="("&&D(2)!=="?"){C({type:"at",extglob:!0,value:W,output:""});continue}C({type:"text",value:W});continue}if(W!=="*"){if(W==="$"||W==="^")W=`\\${W}`;let Q=Uw.exec(a());if(Q)W+=Q[0],U.index+=Q[0].length;C({type:"text",value:W});continue}if(Y&&(Y.type==="globstar"||Y.star===!0)){Y.type="star",Y.star=!0,Y.value+=W,Y.output=k,U.backtrack=!0,U.globstar=!0,c(W);continue}let G=a();if(q.noextglob!==!0&&/^\([^?]/.test(G)){B0("star",W);continue}if(Y.type==="star"){if(q.noglobstar===!0){c(W);continue}let Q=Y.prev,I=Q.prev,T=Q.type==="slash"||Q.type==="bos",l=I&&(I.type==="star"||I.type==="globstar");if(q.bash===!0&&(!T||G[0]&&G[0]!=="/")){C({type:"star",value:W,output:""});continue}let g=U.braces>0&&(Q.type==="comma"||Q.type==="brace"),D0=_.length&&(Q.type==="pipe"||Q.type==="paren");if(!T&&Q.type!=="paren"&&!g&&!D0){C({type:"star",value:W,output:""});continue}while(G.slice(0,3)==="/**"){let N0=$[U.index+4];if(N0&&N0!=="/")break;G=G.slice(3),c("/**",3)}if(Q.type==="bos"&&m()){Y.type="globstar",Y.value+=W,Y.output=v(q),U.output=Y.output,U.globstar=!0,c(W);continue}if(Q.type==="slash"&&Q.prev.type!=="bos"&&!l&&m()){U.output=U.output.slice(0,-(Q.output+Y.output).length),Q.output=`(?:${Q.output}`,Y.type="globstar",Y.output=v(q)+(q.strictSlashes?")":"|$)"),Y.value+=W,U.globstar=!0,U.output+=Q.output+Y.output,c(W);continue}if(Q.type==="slash"&&Q.prev.type!=="bos"&&G[0]==="/"){let N0=G[1]!==void 0?"|$":"";U.output=U.output.slice(0,-(Q.output+Y.output).length),Q.output=`(?:${Q.output}`,Y.type="globstar",Y.output=`${v(q)}${H}|${H}${N0})`,Y.value+=W,U.output+=Q.output+Y.output,U.globstar=!0,c(W+p()),C({type:"slash",value:"/",output:""});continue}if(Q.type==="bos"&&G[0]==="/"){Y.type="globstar",Y.value+=W,Y.output=`(?:^|${H}|${v(q)}${H})`,U.output=Y.output,U.globstar=!0,c(W+p()),C({type:"slash",value:"/",output:""});continue}U.output=U.output.slice(0,-Y.output.length),Y.type="globstar",Y.output=v(q),Y.value+=W,U.output+=Y.output,U.globstar=!0,c(W);continue}let E={type:"star",value:W,output:k};if(q.bash===!0){if(E.output=".*?",Y.type==="bos"||Y.type==="slash")E.output=z+E.output;C(E);continue}if(Y&&(Y.type==="bracket"||Y.type==="paren")&&q.regex===!0){E.output=W,C(E);continue}if(U.index===U.start||Y.type==="slash"||Y.type==="dot"){if(Y.type==="dot")U.output+=A,Y.output+=A;else if(q.dot===!0)U.output+=u,Y.output+=u;else U.output+=z,Y.output+=z;if(D()!=="*")U.output+=y,Y.output+=y}C(E)}while(U.brackets>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing","]"));U.output=i.escapeLast(U.output,"["),w0("brackets")}while(U.parens>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing",")"));U.output=i.escapeLast(U.output,"("),w0("parens")}while(U.braces>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing","}"));U.output=i.escapeLast(U.output,"{"),w0("braces")}if(q.strictSlashes!==!0&&(Y.type==="star"||Y.type==="bracket"))C({type:"maybe_slash",value:"",output:`${H}?`});if(U.backtrack===!0){U.output="";for(let G of U.tokens)if(U.output+=G.output!=null?G.output:G.value,G.suffix)U.output+=G.suffix}return U};g0.fastpaths=($,w)=>{let q={...w},J=typeof q.maxLength==="number"?Math.min(z0,q.maxLength):z0,f=$.length;if(f>J)throw SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${J}`);$=S1[$]||$;let Z=i.isWindows(w),{DOT_LITERAL:V,SLASH_LITERAL:F,ONE_CHAR:N,DOTS_SLASH:K,NO_DOT:B,NO_DOTS:j,NO_DOTS_SLASH:X,STAR:H,START_ANCHOR:y}=j0.globChars(Z),M=q.dot?j:B,L=q.dot?X:B,A=q.capture?"":"?:",u={negated:!1,prefix:""},S=q.bash===!0?".*?":H;if(q.capture)S=`(${S})`;let n=(z)=>{if(z.noglobstar===!0)return S;return`(${A}(?:(?!${y}${z.dot?K:V}).)*?)`},b=(z)=>{switch(z){case"*":return`${M}${N}${S}`;case".*":return`${V}${N}${S}`;case"*.*":return`${M}${S}${V}${N}${S}`;case"*/*":return`${M}${S}${F}${N}${L}${S}`;case"**":return M+n(q);case"**/*":return`(?:${M}${n(q)}${F})?${L}${N}${S}`;case"**/*.*":return`(?:${M}${n(q)}${F})?${L}${S}${V}${N}${S}`;case"**/.*":return`(?:${M}${n(q)}${F})?${V}${N}${S}`;default:{let P=/^(.*?)\.(\w+)$/.exec(z);if(!P)return;let k=b(P[1]);if(!k)return;return k+V+P[2]}}},e=i.removePrefix($,u),v=b(e);if(v&&q.strictSlashes!==!0)v+=`${F}?`;return v};x1.exports=g0});var k1=d((Aw,h1)=>{var Bw=t("path"),Nw=A1(),h0=g1(),k0=F0(),Gw=W0(),Mw=($)=>$&&typeof $==="object"&&!Array.isArray($),x=($,w,q=!1)=>{if(Array.isArray($)){let B=$.map((X)=>x(X,w,q));return(X)=>{for(let H of B){let y=H(X);if(y)return y}return!1}}let J=Mw($)&&$.tokens&&$.input;if($===""||typeof $!=="string"&&!J)throw TypeError("Expected pattern to be a non-empty string");let f=w||{},Z=k0.isWindows(w),V=J?x.compileRe($,w):x.makeRe($,w,!1,!0),F=V.state;delete V.state;let N=()=>!1;if(f.ignore){let B={...w,ignore:null,onMatch:null,onResult:null};N=x(f.ignore,B,q)}let K=(B,j=!1)=>{let{isMatch:X,match:H,output:y}=x.test(B,V,w,{glob:$,posix:Z}),M={glob:$,state:F,regex:V,posix:Z,input:B,output:y,match:H,isMatch:X};if(typeof f.onResult==="function")f.onResult(M);if(X===!1)return M.isMatch=!1,j?M:!1;if(N(B)){if(typeof f.onIgnore==="function")f.onIgnore(M);return M.isMatch=!1,j?M:!1}if(typeof f.onMatch==="function")f.onMatch(M);return j?M:!0};if(q)K.state=F;return K};x.test=($,w,q,{glob:J,posix:f}={})=>{if(typeof $!=="string")throw TypeError("Expected input to be a string");if($==="")return{isMatch:!1,output:""};let Z=q||{},V=Z.format||(f?k0.toPosixSlashes:null),F=$===J,N=F&&V?V($):$;if(F===!1)N=V?V($):$,F=N===J;if(F===!1||Z.capture===!0)if(Z.matchBase===!0||Z.basename===!0)F=x.matchBase($,w,q,f);else F=w.exec(N);return{isMatch:Boolean(F),match:F,output:N}};x.matchBase=($,w,q,J=k0.isWindows(q))=>{return(w instanceof RegExp?w:x.makeRe(w,q)).test(Bw.basename($))};x.isMatch=($,w,q)=>x(w,q)($);x.parse=($,w)=>{if(Array.isArray($))return $.map((q)=>x.parse(q,w));return h0($,{...w,fastpaths:!1})};x.scan=($,w)=>Nw($,w);x.compileRe=($,w,q=!1,J=!1)=>{if(q===!0)return $.output;let f=w||{},Z=f.contains?"":"^",V=f.contains?"":"$",F=`${Z}(?:${$.output})${V}`;if($&&$.negated===!0)F=`^(?!${F}).*$`;let N=x.toRegex(F,w);if(J===!0)N.state=$;return N};x.makeRe=($,w={},q=!1,J=!1)=>{if(!$||typeof $!=="string")throw TypeError("Expected a non-empty string");let f={negated:!1,fastpaths:!0};if(w.fastpaths!==!1&&($[0]==="."||$[0]==="*"))f.output=h0.fastpaths($,w);if(!f.output)f=h0($,w);return x.compileRe(f,w,q,J)};x.toRegex=($,w)=>{try{let q=w||{};return new RegExp($,q.flags||(q.nocase?"i":""))}catch(q){if(w&&w.debug===!0)throw q;return/$^/}};x.constants=Gw;h1.exports=x});var u1=d((Sw,l1)=>{var d1=t("util"),v1=z1(),s=k1(),b0=F0(),b1=($)=>$===""||$==="./",m1=($)=>{let w=$.indexOf("{");return w>-1&&$.indexOf("}",w)>-1},R=($,w,q)=>{w=[].concat(w),$=[].concat($);let J=new Set,f=new Set,Z=new Set,V=0,F=(B)=>{if(Z.add(B.output),q&&q.onResult)q.onResult(B)};for(let B=0;B<w.length;B++){let j=s(String(w[B]),{...q,onResult:F},!0),X=j.state.negated||j.state.negatedExtglob;if(X)V++;for(let H of $){let y=j(H,!0);if(!(X?!y.isMatch:y.isMatch))continue;if(X)J.add(y.output);else J.delete(y.output),f.add(y.output)}}let K=(V===w.length?[...Z]:[...f]).filter((B)=>!J.has(B));if(q&&K.length===0){if(q.failglob===!0)throw Error(`No matches found for "${w.join(", ")}"`);if(q.nonull===!0||q.nullglob===!0)return q.unescape?w.map((B)=>B.replace(/\\/g,"")):w}return K};R.match=R;R.matcher=($,w)=>s($,w);R.isMatch=($,w,q)=>s(w,q)($);R.any=R.isMatch;R.not=($,w,q={})=>{w=[].concat(w).map(String);let J=new Set,f=[],V=new Set(R($,w,{...q,onResult:(F)=>{if(q.onResult)q.onResult(F);f.push(F.output)}}));for(let F of f)if(!V.has(F))J.add(F);return[...J]};R.contains=($,w,q)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${d1.inspect($)}"`);if(Array.isArray(w))return w.some((J)=>R.contains($,J,q));if(typeof w==="string"){if(b1($)||b1(w))return!1;if($.includes(w)||$.startsWith("./")&&$.slice(2).includes(w))return!0}return R.isMatch($,w,{...q,contains:!0})};R.matchKeys=($,w,q)=>{if(!b0.isObject($))throw TypeError("Expected the first argument to be an object");let J=R(Object.keys($),w,q),f={};for(let Z of J)f[Z]=$[Z];return f};R.some=($,w,q)=>{let J=[].concat($);for(let f of[].concat(w)){let Z=s(String(f),q);if(J.some((V)=>Z(V)))return!0}return!1};R.every=($,w,q)=>{let J=[].concat($);for(let f of[].concat(w)){let Z=s(String(f),q);if(!J.every((V)=>Z(V)))return!1}return!0};R.all=($,w,q)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${d1.inspect($)}"`);return[].concat(w).every((J)=>s(J,q)($))};R.capture=($,w,q)=>{let J=b0.isWindows(q),Z=s.makeRe(String($),{...q,capture:!0}).exec(J?b0.toPosixSlashes(w):w);if(Z)return Z.slice(1).map((V)=>V===void 0?"":V)};R.makeRe=(...$)=>s.makeRe(...$);R.scan=(...$)=>s.scan(...$);R.parse=($,w)=>{let q=[];for(let J of[].concat($||[]))for(let f of v1(String(J),w))q.push(s.parse(f,w));return q};R.braces=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");if(w&&w.nobrace===!0||!m1($))return[$];return v1($,w)};R.braceExpand=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");return R.braces($,{...w,expand:!0})};R.hasBraces=m1;l1.exports=R});var c1=yw(u1(),1);var I0;((J)=>{J.ALLOW="allow";J.ASK="ask";J.DENY="deny"})(I0||={});var gw=h.object({tool:h.string(),specifier:h.string().optional(),action:h.nativeEnum(I0)}),hw=h.object({allow:h.array(h.string()).optional(),ask:h.array(h.string()).optional(),deny:h.array(h.string()).optional(),defaultMode:h.nativeEnum(I0).optional()}),kw=h.object({name:h.string(),args:h.record(h.string(),h.any())});class f0{rules;defaultMode;patternCache=new Map;constructor($){this.rules=$.rules,this.defaultMode=$.defaultMode||"ask",this.rules.sort((w,q)=>{let J={deny:0,ask:1,allow:2},f=J[w.action]-J[q.action];if(f!==0)return f;let Z=w.specifier==null?1:0,V=q.specifier==null?1:0;return Z-V})}checkPermission($){for(let w of this.rules)if(this.matchRule(w,$))return{allowed:w.action==="allow"||w.action==="ask",requiresApproval:w.action==="ask",matchedRule:w,reason:this.getReason(w)};return{allowed:this.defaultMode==="allow"||this.defaultMode==="ask",requiresApproval:this.defaultMode==="ask",reason:`No matching rule, using default mode: ${this.defaultMode}`}}matchRule($,w){if($.tool!==w.name)return!1;if(!$.specifier)return!0;let q=this.argsToString(w.args);if(w.name==="Bash")return this.matchBashCommand($.specifier,q);if($.specifier.endsWith(" ")&&!/[*?[\\]/.test($.specifier))return q.startsWith($.specifier);return this.matchGlob($.specifier,q)}matchBashCommand($,w){if(/[;&|]/.test(w))return!1;let J=/[<>()]/;if(J.test(w)){let f=w.split(J)[0].trim();return this.matchBashPattern($,f)}return this.matchBashPattern($,w)}matchBashPattern($,w){if($.endsWith(" "))return w.startsWith($);return this.matchGlob($,w)}matchGlob($,w){try{let q=$.replace(/^\.\//,""),J=w.replace(/^\.\//,""),f=`${$}::${w}`,Z=this.patternCache.get(f);if(Z!==void 0)return Z;let V=c1.default.isMatch(J,q,{nocase:!1,dot:!0});return this.cacheResult(f,V),V}catch(q){return w===$}}cacheResult($,w){if(this.patternCache.size>1000){let q=this.patternCache.keys().next().value;if(q)this.patternCache.delete(q)}this.patternCache.set($,w)}argsToString($){if(typeof $==="object"&&$!==null){if("command"in $&&$.command)return String($.command);if("file_path"in $&&$.file_path)return String($.file_path);return Object.values($).flat().join(" ")}return String($)}getReason($){let w=$.action.toUpperCase(),q=$.tool,J=$.specifier?`(${$.specifier})`:"";return`${w} rule matched: ${q}${J}`}static parseRule($,w){let q=$.match(/^(\w+)(?:\((.*)\))?$/);if(!q)throw Error(`Invalid permission rule format: ${$}`);let[,J,f]=q;return{tool:J,specifier:f,action:w}}static fromConfig($){let w=[];for(let q of $.allow||[])w.push(f0.parseRule(q,"allow"));for(let q of $.ask||[])w.push(f0.parseRule(q,"ask"));for(let q of $.deny||[])w.push(f0.parseRule(q,"deny"));return new f0({rules:w,defaultMode:$.defaultMode||"ask"})}clearCache(){this.patternCache.clear()}getCacheSize(){return this.patternCache.size}}class $0{configStore;toolNameMapper={};constructor($){this.configStore=$}static instance=null;static getInstance($){if(!$0.instance){if(!$)throw Error("PermissionStore not initialized. Provide configStore on first call.");$0.instance=new $0($)}return $0.instance}static resetInstance(){$0.instance=null}async getPermissions(){let $=await this.configStore.getConfig();if($.permissions)return f0.fromConfig($.permissions);return}async checkBashPermission($,w){return(await this.getPermissions())?.checkPermission({name:"Bash",args:{command:$,cwd:w}})}async checkReadPermission($){return(await this.getPermissions())?.checkPermission({name:"Read",args:{file_path:$}})}async checkWritePermission($){return(await this.getPermissions())?.checkPermission({name:"Write",args:{file_path:$}})}}class C0{configStore;skillStore;pluginStore;remoteStore;permissionStore;_initialized=!1;constructor($,w,q,J){this.configStore=$,this.skillStore=w,this.pluginStore=q,this.remoteStore=J,this.permissionStore=$0.getInstance($)}async initialize(){if(this._initialized)return;if("initialize"in this.configStore&&typeof this.configStore.initialize==="function")await this.configStore.initialize();if("initialize"in this.skillStore&&typeof this.skillStore.initialize==="function")await this.skillStore.initialize();if("initialize"in this.pluginStore&&typeof this.pluginStore.initialize==="function")await this.pluginStore.initialize();this._initialized=!0}async ensureInitialized(){if(!this._initialized)throw Error("ConfigManager not initialized. Call await manager.initialize() first.")}async getConfig(){return await this.ensureInitialized(),await this.configStore.getConfig()}async updateConfig($){return await this.ensureInitialized(),await this.configStore.updateConfig($)}async listSkills(){return await this.ensureInitialized(),await this.skillStore.listSkills()}async getSkill($){return await this.ensureInitialized(),await this.skillStore.getSkill($)}async saveSkill($,w){return await this.ensureInitialized(),await this.skillStore.saveSkill($,w)}async deleteSkill($){return await this.ensureInitialized(),await this.skillStore.deleteSkill($)}async syncSkillsFromRemote(){if(await this.ensureInitialized(),!this.remoteStore)throw Error("Remote store not configured");return await this.skillStore.syncFromRemote(this.remoteStore)}async listPlugins(){return await this.ensureInitialized(),await this.pluginStore.listPlugins()}async getPluginConfig($){return await this.ensureInitialized(),await this.pluginStore.getPluginConfig($)}async updatePluginConfig($,w){return await this.ensureInitialized(),await this.pluginStore.updatePluginConfig($,w)}async installPlugin($,w){return await this.ensureInitialized(),await this.pluginStore.installPlugin($,w)}async uninstallPlugin($){return await this.ensureInitialized(),await this.pluginStore.uninstallPlugin($)}async checkBashPermission($,w){return await this.ensureInitialized(),await this.permissionStore.checkBashPermission($,w)}async checkReadPermission($){return await this.ensureInitialized(),await this.permissionStore.checkReadPermission($)}async checkWritePermission($){return await this.ensureInitialized(),await this.permissionStore.checkWritePermission($)}async getPermissionMatcher(){return await this.ensureInitialized(),await this.permissionStore.getPermissions()}getConfigPath(){return this.configStore?.dbPath}}async function ow(){let{FileSystemConfigStore:$}=await import("./chunk-86m0rmtc.js"),{FileSystemSkillStore:w}=await import("./chunk-bca8tkkr.js"),{FileSystemPluginStore:q}=await import("./chunk-57bj89e2.js"),J=new $,f=new w,Z=new q,V=new C0(J,f,Z);return await V.initialize(),V}async function tw($){let{configStore:w,skillStore:q,pluginStore:J,remoteStore:f}=$,Z=new C0(w,q,J,f);return await Z.initialize(),Z}
|
|
18
|
-
export{ow as
|
|
17
|
+
`,CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var y1=d((Lw,M1)=>{var I$=M0(),{MAX_LENGTH:B1,CHAR_BACKSLASH:R0,CHAR_BACKTICK:C$,CHAR_COMMA:D$,CHAR_DOT:H$,CHAR_LEFT_PARENTHESES:P$,CHAR_RIGHT_PARENTHESES:L$,CHAR_LEFT_CURLY_BRACE:O$,CHAR_RIGHT_CURLY_BRACE:E$,CHAR_LEFT_SQUARE_BRACKET:N1,CHAR_RIGHT_SQUARE_BRACKET:G1,CHAR_DOUBLE_QUOTE:R$,CHAR_SINGLE_QUOTE:_$,CHAR_NO_BREAK_SPACE:T$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:A$}=Q1(),S$=($,w={})=>{if(typeof $!=="string")throw TypeError("Expected a string");let q=w||{},J=typeof q.maxLength==="number"?Math.min(B1,q.maxLength):B1;if($.length>J)throw SyntaxError(`Input length (${$.length}), exceeds max characters (${J})`);let f={type:"root",input:$,nodes:[]},Z=[f],V=f,F=f,N=0,K=$.length,B=0,j=0,X,H=()=>$[B++],y=(M)=>{if(M.type==="text"&&F.type==="dot")F.type="text";if(F&&F.type==="text"&&M.type==="text"){F.value+=M.value;return}return V.nodes.push(M),M.parent=V,M.prev=F,F=M,M};y({type:"bos"});while(B<K){if(V=Z[Z.length-1],X=H(),X===A$||X===T$)continue;if(X===R0){y({type:"text",value:(w.keepEscaping?X:"")+H()});continue}if(X===G1){y({type:"text",value:"\\"+X});continue}if(X===N1){N++;let M;while(B<K&&(M=H())){if(X+=M,M===N1){N++;continue}if(M===R0){X+=H();continue}if(M===G1){if(N--,N===0)break}}y({type:"text",value:X});continue}if(X===P$){V=y({type:"paren",nodes:[]}),Z.push(V),y({type:"text",value:X});continue}if(X===L$){if(V.type!=="paren"){y({type:"text",value:X});continue}V=Z.pop(),y({type:"text",value:X}),V=Z[Z.length-1];continue}if(X===R$||X===_$||X===C$){let M=X,L;if(w.keepQuotes!==!0)X="";while(B<K&&(L=H())){if(L===R0){X+=L+H();continue}if(L===M){if(w.keepQuotes===!0)X+=L;break}X+=L}y({type:"text",value:X});continue}if(X===O$){j++;let L={type:"brace",open:!0,close:!1,dollar:F.value&&F.value.slice(-1)==="$"||V.dollar===!0,depth:j,commas:0,ranges:0,nodes:[]};V=y(L),Z.push(V),y({type:"open",value:X});continue}if(X===E$){if(V.type!=="brace"){y({type:"text",value:X});continue}let M="close";V=Z.pop(),V.close=!0,y({type:M,value:X}),j--,V=Z[Z.length-1];continue}if(X===D$&&j>0){if(V.ranges>0){V.ranges=0;let M=V.nodes.shift();V.nodes=[M,{type:"text",value:I$(V)}]}y({type:"comma",value:X}),V.commas++;continue}if(X===H$&&j>0&&V.commas===0){let M=V.nodes;if(j===0||M.length===0){y({type:"text",value:X});continue}if(F.type==="dot"){if(V.range=[],F.value+=X,F.type="range",V.nodes.length!==3&&V.nodes.length!==5){V.invalid=!0,V.ranges=0,F.type="text";continue}V.ranges++,V.args=[];continue}if(F.type==="range"){M.pop();let L=M[M.length-1];L.value+=F.value+X,F=L,V.ranges--;continue}y({type:"dot",value:X});continue}y({type:"text",value:X})}do if(V=Z.pop(),V.type!=="root"){V.nodes.forEach((A)=>{if(!A.nodes){if(A.type==="open")A.isOpen=!0;if(A.type==="close")A.isClose=!0;if(!A.nodes)A.type="text";A.invalid=!0}});let M=Z[Z.length-1],L=M.nodes.indexOf(V);M.nodes.splice(L,1,...V.nodes)}while(Z.length>0);return y({type:"eos"}),f};M1.exports=S$});var z1=d((Ow,j1)=>{var K1=M0(),x$=Y1(),g$=U1(),h$=y1(),r=($,w={})=>{let q=[];if(Array.isArray($))for(let J of $){let f=r.create(J,w);if(Array.isArray(f))q.push(...f);else q.push(f)}else q=[].concat(r.create($,w));if(w&&w.expand===!0&&w.nodupes===!0)q=[...new Set(q)];return q};r.parse=($,w={})=>h$($,w);r.stringify=($,w={})=>{if(typeof $==="string")return K1(r.parse($,w),w);return K1($,w)};r.compile=($,w={})=>{if(typeof $==="string")$=r.parse($,w);return x$($,w)};r.expand=($,w={})=>{if(typeof $==="string")$=r.parse($,w);let q=g$($,w);if(w.noempty===!0)q=q.filter(Boolean);if(w.nodupes===!0)q=[...new Set(q)];return q};r.create=($,w={})=>{if($===""||$.length<3)return[$];return w.expand!==!0?r.compile($,w):r.expand($,w)};j1.exports=r});var W0=d((Ew,C1)=>{var k$=t("path"),I1={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)"},b$={...I1,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)"},d$={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};C1.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:d$,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:k$.sep,extglobChars($){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${$.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars($){return $===!0?b$:I1}}});var F0=d((i$)=>{var v$=t("path"),m$=process.platform==="win32",{REGEX_BACKSLASH:l$,REGEX_REMOVE_BACKSLASH:u$,REGEX_SPECIAL_CHARS:c$,REGEX_SPECIAL_CHARS_GLOBAL:r$}=W0();i$.isObject=($)=>$!==null&&typeof $==="object"&&!Array.isArray($);i$.hasRegexChars=($)=>c$.test($);i$.isRegexChar=($)=>$.length===1&&i$.hasRegexChars($);i$.escapeRegex=($)=>$.replace(r$,"\\$1");i$.toPosixSlashes=($)=>$.replace(l$,"/");i$.removeBackslashes=($)=>{return $.replace(u$,(w)=>{return w==="\\"?"":w})};i$.supportsLookbehinds=()=>{let $=process.version.slice(1).split(".").map(Number);if($.length===3&&$[0]>=9||$[0]===8&&$[1]>=10)return!0;return!1};i$.isWindows=($)=>{if($&&typeof $.windows==="boolean")return $.windows;return m$===!0||v$.sep==="\\"};i$.escapeLast=($,w,q)=>{let J=$.lastIndexOf(w,q);if(J===-1)return $;if($[J-1]==="\\")return i$.escapeLast($,w,J-1);return`${$.slice(0,J)}\\${$.slice(J)}`};i$.removePrefix=($,w={})=>{let q=$;if(q.startsWith("./"))q=q.slice(2),w.prefix="./";return q};i$.wrapOutput=($,w={},q={})=>{let J=q.contains?"":"^",f=q.contains?"":"$",Z=`${J}(?:${$})${f}`;if(w.negated===!0)Z=`(?:^(?!${Z}).*$)`;return Z}});var A1=d((_w,T1)=>{var P1=F0(),{CHAR_ASTERISK:_0,CHAR_AT:qw,CHAR_BACKWARD_SLASH:U0,CHAR_COMMA:Jw,CHAR_DOT:T0,CHAR_EXCLAMATION_MARK:A0,CHAR_FORWARD_SLASH:_1,CHAR_LEFT_CURLY_BRACE:S0,CHAR_LEFT_PARENTHESES:x0,CHAR_LEFT_SQUARE_BRACKET:fw,CHAR_PLUS:Vw,CHAR_QUESTION_MARK:L1,CHAR_RIGHT_CURLY_BRACE:Zw,CHAR_RIGHT_PARENTHESES:O1,CHAR_RIGHT_SQUARE_BRACKET:Yw}=W0(),E1=($)=>{return $===_1||$===U0},R1=($)=>{if($.isPrefix!==!0)$.depth=$.isGlobstar?1/0:1},Ww=($,w)=>{let q=w||{},J=$.length-1,f=q.parts===!0||q.scanToEnd===!0,Z=[],V=[],F=[],N=$,K=-1,B=0,j=0,X=!1,H=!1,y=!1,M=!1,L=!1,A=!1,u=!1,S=!1,n=!1,b=!1,e=0,v,z,P={value:"",depth:0,isGlob:!1},k=()=>K>=J,U=()=>N.charCodeAt(K+1),_=()=>{return v=z,N.charCodeAt(++K)};while(K<J){z=_();let m;if(z===U0){if(u=P.backslashes=!0,z=_(),z===S0)A=!0;continue}if(A===!0||z===S0){e++;while(k()!==!0&&(z=_())){if(z===U0){u=P.backslashes=!0,_();continue}if(z===S0){e++;continue}if(A!==!0&&z===T0&&(z=_())===T0){if(X=P.isBrace=!0,y=P.isGlob=!0,b=!0,f===!0)continue;break}if(A!==!0&&z===Jw){if(X=P.isBrace=!0,y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===Zw){if(e--,e===0){A=!1,X=P.isBrace=!0,b=!0;break}}}if(f===!0)continue;break}if(z===_1){if(Z.push(K),V.push(P),P={value:"",depth:0,isGlob:!1},b===!0)continue;if(v===T0&&K===B+1){B+=2;continue}j=K+1;continue}if(q.noext!==!0){if((z===Vw||z===qw||z===_0||z===L1||z===A0)===!0&&U()===x0){if(y=P.isGlob=!0,M=P.isExtglob=!0,b=!0,z===A0&&K===B)n=!0;if(f===!0){while(k()!==!0&&(z=_())){if(z===U0){u=P.backslashes=!0,z=_();continue}if(z===O1){y=P.isGlob=!0,b=!0;break}}continue}break}}if(z===_0){if(v===_0)L=P.isGlobstar=!0;if(y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===L1){if(y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===fw){while(k()!==!0&&(m=_())){if(m===U0){u=P.backslashes=!0,_();continue}if(m===Yw){H=P.isBracket=!0,y=P.isGlob=!0,b=!0;break}}if(f===!0)continue;break}if(q.nonegate!==!0&&z===A0&&K===B){S=P.negated=!0,B++;continue}if(q.noparen!==!0&&z===x0){if(y=P.isGlob=!0,f===!0){while(k()!==!0&&(z=_())){if(z===x0){u=P.backslashes=!0,z=_();continue}if(z===O1){b=!0;break}}continue}break}if(y===!0){if(b=!0,f===!0)continue;break}}if(q.noext===!0)M=!1,y=!1;let O=N,o="",Y="";if(B>0)o=N.slice(0,B),N=N.slice(B),j-=B;if(O&&y===!0&&j>0)O=N.slice(0,j),Y=N.slice(j);else if(y===!0)O="",Y=N;else O=N;if(O&&O!==""&&O!=="/"&&O!==N){if(E1(O.charCodeAt(O.length-1)))O=O.slice(0,-1)}if(q.unescape===!0){if(Y)Y=P1.removeBackslashes(Y);if(O&&u===!0)O=P1.removeBackslashes(O)}let W={prefix:o,input:$,start:B,base:O,glob:Y,isBrace:X,isBracket:H,isGlob:y,isExtglob:M,isGlobstar:L,negated:S,negatedExtglob:n};if(q.tokens===!0){if(W.maxDepth=0,!E1(z))V.push(P);W.tokens=V}if(q.parts===!0||q.tokens===!0){let m;for(let D=0;D<Z.length;D++){let p=m?m+1:B,a=Z[D],c=$.slice(p,a);if(q.tokens){if(D===0&&B!==0)V[D].isPrefix=!0,V[D].value=o;else V[D].value=c;R1(V[D]),W.maxDepth+=V[D].depth}if(D!==0||c!=="")F.push(c);m=a}if(m&&m+1<$.length){let D=$.slice(m+1);if(F.push(D),q.tokens)V[V.length-1].value=D,R1(V[V.length-1]),W.maxDepth+=V[V.length-1].depth}W.slashes=Z,W.parts=F}return W};T1.exports=Ww});var g1=d((Tw,x1)=>{var j0=W0(),i=F0(),{MAX_LENGTH:z0,POSIX_REGEX_SOURCE:Fw,REGEX_NON_SPECIAL_CHARS:Uw,REGEX_SPECIAL_CHARS_BACKREF:Xw,REPLACEMENTS:S1}=j0,Qw=($,w)=>{if(typeof w.expandRange==="function")return w.expandRange(...$,w);$.sort();let q=`[${$.join("-")}]`;try{new RegExp(q)}catch(J){return $.map((f)=>i.escapeRegex(f)).join("..")}return q},Z0=($,w)=>{return`Missing ${$}: "${w}" - use "\\\\${w}" to match literal characters`},g0=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");$=S1[$]||$;let q={...w},J=typeof q.maxLength==="number"?Math.min(z0,q.maxLength):z0,f=$.length;if(f>J)throw SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${J}`);let Z={type:"bos",value:"",output:q.prepend||""},V=[Z],F=q.capture?"":"?:",N=i.isWindows(w),K=j0.globChars(N),B=j0.extglobChars(K),{DOT_LITERAL:j,PLUS_LITERAL:X,SLASH_LITERAL:H,ONE_CHAR:y,DOTS_SLASH:M,NO_DOT:L,NO_DOT_SLASH:A,NO_DOTS_SLASH:u,QMARK:S,QMARK_NO_DOT:n,STAR:b,START_ANCHOR:e}=K,v=(G)=>{return`(${F}(?:(?!${e}${G.dot?M:j}).)*?)`},z=q.dot?"":L,P=q.dot?S:n,k=q.bash===!0?v(q):b;if(q.capture)k=`(${k})`;if(typeof q.noext==="boolean")q.noextglob=q.noext;let U={input:$,index:-1,start:0,dot:q.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:V};$=i.removePrefix($,U),f=$.length;let _=[],O=[],o=[],Y=Z,W,m=()=>U.index===f-1,D=U.peek=(G=1)=>$[U.index+G],p=U.advance=()=>$[++U.index]||"",a=()=>$.slice(U.index+1),c=(G="",E=0)=>{U.consumed+=G,U.index+=E},X0=(G)=>{U.output+=G.output!=null?G.output:G.value,c(G.value)},r1=()=>{let G=1;while(D()==="!"&&(D(2)!=="("||D(3)==="?"))p(),U.start++,G++;if(G%2===0)return!1;return U.negated=!0,U.start++,!0},Q0=(G)=>{U[G]++,o.push(G)},w0=(G)=>{U[G]--,o.pop()},C=(G)=>{if(Y.type==="globstar"){let E=U.braces>0&&(G.type==="comma"||G.type==="brace"),Q=G.extglob===!0||_.length&&(G.type==="pipe"||G.type==="paren");if(G.type!=="slash"&&G.type!=="paren"&&!E&&!Q)U.output=U.output.slice(0,-Y.output.length),Y.type="star",Y.value="*",Y.output=k,U.output+=Y.output}if(_.length&&G.type!=="paren")_[_.length-1].inner+=G.value;if(G.value||G.output)X0(G);if(Y&&Y.type==="text"&&G.type==="text"){Y.value+=G.value,Y.output=(Y.output||"")+G.value;return}G.prev=Y,V.push(G),Y=G},B0=(G,E)=>{let Q={...B[E],conditions:1,inner:""};Q.prev=Y,Q.parens=U.parens,Q.output=U.output;let I=(q.capture?"(":"")+Q.open;Q0("parens"),C({type:G,value:E,output:U.output?"":y}),C({type:"paren",extglob:!0,value:p(),output:I}),_.push(Q)},i1=(G)=>{let E=G.close+(q.capture?")":""),Q;if(G.type==="negate"){let I=k;if(G.inner&&G.inner.length>1&&G.inner.includes("/"))I=v(q);if(I!==k||m()||/^\)+$/.test(a()))E=G.close=`)$))${I}`;if(G.inner.includes("*")&&(Q=a())&&/^\.[^\\/.]+$/.test(Q)){let T=g0(Q,{...w,fastpaths:!1}).output;E=G.close=`)${T})${I})`}if(G.prev.type==="bos")U.negatedExtglob=!0}C({type:"paren",extglob:!0,value:W,output:E}),w0("parens")};if(q.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test($)){let G=!1,E=$.replace(Xw,(Q,I,T,l,g,D0)=>{if(l==="\\")return G=!0,Q;if(l==="?"){if(I)return I+l+(g?S.repeat(g.length):"");if(D0===0)return P+(g?S.repeat(g.length):"");return S.repeat(T.length)}if(l===".")return j.repeat(T.length);if(l==="*"){if(I)return I+l+(g?k:"");return k}return I?Q:`\\${Q}`});if(G===!0)if(q.unescape===!0)E=E.replace(/\\/g,"");else E=E.replace(/\\+/g,(Q)=>{return Q.length%2===0?"\\\\":Q?"\\":""});if(E===$&&q.contains===!0)return U.output=$,U;return U.output=i.wrapOutput(E,U,w),U}while(!m()){if(W=p(),W==="\x00")continue;if(W==="\\"){let Q=D();if(Q==="/"&&q.bash!==!0)continue;if(Q==="."||Q===";")continue;if(!Q){W+="\\",C({type:"text",value:W});continue}let I=/^\\+/.exec(a()),T=0;if(I&&I[0].length>2){if(T=I[0].length,U.index+=T,T%2!==0)W+="\\"}if(q.unescape===!0)W=p();else W+=p();if(U.brackets===0){C({type:"text",value:W});continue}}if(U.brackets>0&&(W!=="]"||Y.value==="["||Y.value==="[^")){if(q.posix!==!1&&W===":"){let Q=Y.value.slice(1);if(Q.includes("[")){if(Y.posix=!0,Q.includes(":")){let I=Y.value.lastIndexOf("["),T=Y.value.slice(0,I),l=Y.value.slice(I+2),g=Fw[l];if(g){if(Y.value=T+g,U.backtrack=!0,p(),!Z.output&&V.indexOf(Y)===1)Z.output=y;continue}}}}if(W==="["&&D()!==":"||W==="-"&&D()==="]")W=`\\${W}`;if(W==="]"&&(Y.value==="["||Y.value==="[^"))W=`\\${W}`;if(q.posix===!0&&W==="!"&&Y.value==="[")W="^";Y.value+=W,X0({value:W});continue}if(U.quotes===1&&W!=='"'){W=i.escapeRegex(W),Y.value+=W,X0({value:W});continue}if(W==='"'){if(U.quotes=U.quotes===1?0:1,q.keepQuotes===!0)C({type:"text",value:W});continue}if(W==="("){Q0("parens"),C({type:"paren",value:W});continue}if(W===")"){if(U.parens===0&&q.strictBrackets===!0)throw SyntaxError(Z0("opening","("));let Q=_[_.length-1];if(Q&&U.parens===Q.parens+1){i1(_.pop());continue}C({type:"paren",value:W,output:U.parens?")":"\\)"}),w0("parens");continue}if(W==="["){if(q.nobracket===!0||!a().includes("]")){if(q.nobracket!==!0&&q.strictBrackets===!0)throw SyntaxError(Z0("closing","]"));W=`\\${W}`}else Q0("brackets");C({type:"bracket",value:W});continue}if(W==="]"){if(q.nobracket===!0||Y&&Y.type==="bracket"&&Y.value.length===1){C({type:"text",value:W,output:`\\${W}`});continue}if(U.brackets===0){if(q.strictBrackets===!0)throw SyntaxError(Z0("opening","["));C({type:"text",value:W,output:`\\${W}`});continue}w0("brackets");let Q=Y.value.slice(1);if(Y.posix!==!0&&Q[0]==="^"&&!Q.includes("/"))W=`/${W}`;if(Y.value+=W,X0({value:W}),q.literalBrackets===!1||i.hasRegexChars(Q))continue;let I=i.escapeRegex(Y.value);if(U.output=U.output.slice(0,-Y.value.length),q.literalBrackets===!0){U.output+=I,Y.value=I;continue}Y.value=`(${F}${I}|${Y.value})`,U.output+=Y.value;continue}if(W==="{"&&q.nobrace!==!0){Q0("braces");let Q={type:"brace",value:W,output:"(",outputIndex:U.output.length,tokensIndex:U.tokens.length};O.push(Q),C(Q);continue}if(W==="}"){let Q=O[O.length-1];if(q.nobrace===!0||!Q){C({type:"text",value:W,output:W});continue}let I=")";if(Q.dots===!0){let T=V.slice(),l=[];for(let g=T.length-1;g>=0;g--){if(V.pop(),T[g].type==="brace")break;if(T[g].type!=="dots")l.unshift(T[g].value)}I=Qw(l,q),U.backtrack=!0}if(Q.comma!==!0&&Q.dots!==!0){let T=U.output.slice(0,Q.outputIndex),l=U.tokens.slice(Q.tokensIndex);Q.value=Q.output="\\{",W=I="\\}",U.output=T;for(let g of l)U.output+=g.output||g.value}C({type:"brace",value:W,output:I}),w0("braces"),O.pop();continue}if(W==="|"){if(_.length>0)_[_.length-1].conditions++;C({type:"text",value:W});continue}if(W===","){let Q=W,I=O[O.length-1];if(I&&o[o.length-1]==="braces")I.comma=!0,Q="|";C({type:"comma",value:W,output:Q});continue}if(W==="/"){if(Y.type==="dot"&&U.index===U.start+1){U.start=U.index+1,U.consumed="",U.output="",V.pop(),Y=Z;continue}C({type:"slash",value:W,output:H});continue}if(W==="."){if(U.braces>0&&Y.type==="dot"){if(Y.value===".")Y.output=j;let Q=O[O.length-1];Y.type="dots",Y.output+=W,Y.value+=W,Q.dots=!0;continue}if(U.braces+U.parens===0&&Y.type!=="bos"&&Y.type!=="slash"){C({type:"text",value:W,output:j});continue}C({type:"dot",value:W,output:j});continue}if(W==="?"){if(!(Y&&Y.value==="(")&&q.noextglob!==!0&&D()==="("&&D(2)!=="?"){B0("qmark",W);continue}if(Y&&Y.type==="paren"){let I=D(),T=W;if(I==="<"&&!i.supportsLookbehinds())throw Error("Node.js v10 or higher is required for regex lookbehinds");if(Y.value==="("&&!/[!=<:]/.test(I)||I==="<"&&!/<([!=]|\w+>)/.test(a()))T=`\\${W}`;C({type:"text",value:W,output:T});continue}if(q.dot!==!0&&(Y.type==="slash"||Y.type==="bos")){C({type:"qmark",value:W,output:n});continue}C({type:"qmark",value:W,output:S});continue}if(W==="!"){if(q.noextglob!==!0&&D()==="("){if(D(2)!=="?"||!/[!=<:]/.test(D(3))){B0("negate",W);continue}}if(q.nonegate!==!0&&U.index===0){r1();continue}}if(W==="+"){if(q.noextglob!==!0&&D()==="("&&D(2)!=="?"){B0("plus",W);continue}if(Y&&Y.value==="("||q.regex===!1){C({type:"plus",value:W,output:X});continue}if(Y&&(Y.type==="bracket"||Y.type==="paren"||Y.type==="brace")||U.parens>0){C({type:"plus",value:W});continue}C({type:"plus",value:X});continue}if(W==="@"){if(q.noextglob!==!0&&D()==="("&&D(2)!=="?"){C({type:"at",extglob:!0,value:W,output:""});continue}C({type:"text",value:W});continue}if(W!=="*"){if(W==="$"||W==="^")W=`\\${W}`;let Q=Uw.exec(a());if(Q)W+=Q[0],U.index+=Q[0].length;C({type:"text",value:W});continue}if(Y&&(Y.type==="globstar"||Y.star===!0)){Y.type="star",Y.star=!0,Y.value+=W,Y.output=k,U.backtrack=!0,U.globstar=!0,c(W);continue}let G=a();if(q.noextglob!==!0&&/^\([^?]/.test(G)){B0("star",W);continue}if(Y.type==="star"){if(q.noglobstar===!0){c(W);continue}let Q=Y.prev,I=Q.prev,T=Q.type==="slash"||Q.type==="bos",l=I&&(I.type==="star"||I.type==="globstar");if(q.bash===!0&&(!T||G[0]&&G[0]!=="/")){C({type:"star",value:W,output:""});continue}let g=U.braces>0&&(Q.type==="comma"||Q.type==="brace"),D0=_.length&&(Q.type==="pipe"||Q.type==="paren");if(!T&&Q.type!=="paren"&&!g&&!D0){C({type:"star",value:W,output:""});continue}while(G.slice(0,3)==="/**"){let N0=$[U.index+4];if(N0&&N0!=="/")break;G=G.slice(3),c("/**",3)}if(Q.type==="bos"&&m()){Y.type="globstar",Y.value+=W,Y.output=v(q),U.output=Y.output,U.globstar=!0,c(W);continue}if(Q.type==="slash"&&Q.prev.type!=="bos"&&!l&&m()){U.output=U.output.slice(0,-(Q.output+Y.output).length),Q.output=`(?:${Q.output}`,Y.type="globstar",Y.output=v(q)+(q.strictSlashes?")":"|$)"),Y.value+=W,U.globstar=!0,U.output+=Q.output+Y.output,c(W);continue}if(Q.type==="slash"&&Q.prev.type!=="bos"&&G[0]==="/"){let N0=G[1]!==void 0?"|$":"";U.output=U.output.slice(0,-(Q.output+Y.output).length),Q.output=`(?:${Q.output}`,Y.type="globstar",Y.output=`${v(q)}${H}|${H}${N0})`,Y.value+=W,U.output+=Q.output+Y.output,U.globstar=!0,c(W+p()),C({type:"slash",value:"/",output:""});continue}if(Q.type==="bos"&&G[0]==="/"){Y.type="globstar",Y.value+=W,Y.output=`(?:^|${H}|${v(q)}${H})`,U.output=Y.output,U.globstar=!0,c(W+p()),C({type:"slash",value:"/",output:""});continue}U.output=U.output.slice(0,-Y.output.length),Y.type="globstar",Y.output=v(q),Y.value+=W,U.output+=Y.output,U.globstar=!0,c(W);continue}let E={type:"star",value:W,output:k};if(q.bash===!0){if(E.output=".*?",Y.type==="bos"||Y.type==="slash")E.output=z+E.output;C(E);continue}if(Y&&(Y.type==="bracket"||Y.type==="paren")&&q.regex===!0){E.output=W,C(E);continue}if(U.index===U.start||Y.type==="slash"||Y.type==="dot"){if(Y.type==="dot")U.output+=A,Y.output+=A;else if(q.dot===!0)U.output+=u,Y.output+=u;else U.output+=z,Y.output+=z;if(D()!=="*")U.output+=y,Y.output+=y}C(E)}while(U.brackets>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing","]"));U.output=i.escapeLast(U.output,"["),w0("brackets")}while(U.parens>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing",")"));U.output=i.escapeLast(U.output,"("),w0("parens")}while(U.braces>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing","}"));U.output=i.escapeLast(U.output,"{"),w0("braces")}if(q.strictSlashes!==!0&&(Y.type==="star"||Y.type==="bracket"))C({type:"maybe_slash",value:"",output:`${H}?`});if(U.backtrack===!0){U.output="";for(let G of U.tokens)if(U.output+=G.output!=null?G.output:G.value,G.suffix)U.output+=G.suffix}return U};g0.fastpaths=($,w)=>{let q={...w},J=typeof q.maxLength==="number"?Math.min(z0,q.maxLength):z0,f=$.length;if(f>J)throw SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${J}`);$=S1[$]||$;let Z=i.isWindows(w),{DOT_LITERAL:V,SLASH_LITERAL:F,ONE_CHAR:N,DOTS_SLASH:K,NO_DOT:B,NO_DOTS:j,NO_DOTS_SLASH:X,STAR:H,START_ANCHOR:y}=j0.globChars(Z),M=q.dot?j:B,L=q.dot?X:B,A=q.capture?"":"?:",u={negated:!1,prefix:""},S=q.bash===!0?".*?":H;if(q.capture)S=`(${S})`;let n=(z)=>{if(z.noglobstar===!0)return S;return`(${A}(?:(?!${y}${z.dot?K:V}).)*?)`},b=(z)=>{switch(z){case"*":return`${M}${N}${S}`;case".*":return`${V}${N}${S}`;case"*.*":return`${M}${S}${V}${N}${S}`;case"*/*":return`${M}${S}${F}${N}${L}${S}`;case"**":return M+n(q);case"**/*":return`(?:${M}${n(q)}${F})?${L}${N}${S}`;case"**/*.*":return`(?:${M}${n(q)}${F})?${L}${S}${V}${N}${S}`;case"**/.*":return`(?:${M}${n(q)}${F})?${V}${N}${S}`;default:{let P=/^(.*?)\.(\w+)$/.exec(z);if(!P)return;let k=b(P[1]);if(!k)return;return k+V+P[2]}}},e=i.removePrefix($,u),v=b(e);if(v&&q.strictSlashes!==!0)v+=`${F}?`;return v};x1.exports=g0});var k1=d((Aw,h1)=>{var Bw=t("path"),Nw=A1(),h0=g1(),k0=F0(),Gw=W0(),Mw=($)=>$&&typeof $==="object"&&!Array.isArray($),x=($,w,q=!1)=>{if(Array.isArray($)){let B=$.map((X)=>x(X,w,q));return(X)=>{for(let H of B){let y=H(X);if(y)return y}return!1}}let J=Mw($)&&$.tokens&&$.input;if($===""||typeof $!=="string"&&!J)throw TypeError("Expected pattern to be a non-empty string");let f=w||{},Z=k0.isWindows(w),V=J?x.compileRe($,w):x.makeRe($,w,!1,!0),F=V.state;delete V.state;let N=()=>!1;if(f.ignore){let B={...w,ignore:null,onMatch:null,onResult:null};N=x(f.ignore,B,q)}let K=(B,j=!1)=>{let{isMatch:X,match:H,output:y}=x.test(B,V,w,{glob:$,posix:Z}),M={glob:$,state:F,regex:V,posix:Z,input:B,output:y,match:H,isMatch:X};if(typeof f.onResult==="function")f.onResult(M);if(X===!1)return M.isMatch=!1,j?M:!1;if(N(B)){if(typeof f.onIgnore==="function")f.onIgnore(M);return M.isMatch=!1,j?M:!1}if(typeof f.onMatch==="function")f.onMatch(M);return j?M:!0};if(q)K.state=F;return K};x.test=($,w,q,{glob:J,posix:f}={})=>{if(typeof $!=="string")throw TypeError("Expected input to be a string");if($==="")return{isMatch:!1,output:""};let Z=q||{},V=Z.format||(f?k0.toPosixSlashes:null),F=$===J,N=F&&V?V($):$;if(F===!1)N=V?V($):$,F=N===J;if(F===!1||Z.capture===!0)if(Z.matchBase===!0||Z.basename===!0)F=x.matchBase($,w,q,f);else F=w.exec(N);return{isMatch:Boolean(F),match:F,output:N}};x.matchBase=($,w,q,J=k0.isWindows(q))=>{return(w instanceof RegExp?w:x.makeRe(w,q)).test(Bw.basename($))};x.isMatch=($,w,q)=>x(w,q)($);x.parse=($,w)=>{if(Array.isArray($))return $.map((q)=>x.parse(q,w));return h0($,{...w,fastpaths:!1})};x.scan=($,w)=>Nw($,w);x.compileRe=($,w,q=!1,J=!1)=>{if(q===!0)return $.output;let f=w||{},Z=f.contains?"":"^",V=f.contains?"":"$",F=`${Z}(?:${$.output})${V}`;if($&&$.negated===!0)F=`^(?!${F}).*$`;let N=x.toRegex(F,w);if(J===!0)N.state=$;return N};x.makeRe=($,w={},q=!1,J=!1)=>{if(!$||typeof $!=="string")throw TypeError("Expected a non-empty string");let f={negated:!1,fastpaths:!0};if(w.fastpaths!==!1&&($[0]==="."||$[0]==="*"))f.output=h0.fastpaths($,w);if(!f.output)f=h0($,w);return x.compileRe(f,w,q,J)};x.toRegex=($,w)=>{try{let q=w||{};return new RegExp($,q.flags||(q.nocase?"i":""))}catch(q){if(w&&w.debug===!0)throw q;return/$^/}};x.constants=Gw;h1.exports=x});var u1=d((Sw,l1)=>{var d1=t("util"),v1=z1(),s=k1(),b0=F0(),b1=($)=>$===""||$==="./",m1=($)=>{let w=$.indexOf("{");return w>-1&&$.indexOf("}",w)>-1},R=($,w,q)=>{w=[].concat(w),$=[].concat($);let J=new Set,f=new Set,Z=new Set,V=0,F=(B)=>{if(Z.add(B.output),q&&q.onResult)q.onResult(B)};for(let B=0;B<w.length;B++){let j=s(String(w[B]),{...q,onResult:F},!0),X=j.state.negated||j.state.negatedExtglob;if(X)V++;for(let H of $){let y=j(H,!0);if(!(X?!y.isMatch:y.isMatch))continue;if(X)J.add(y.output);else J.delete(y.output),f.add(y.output)}}let K=(V===w.length?[...Z]:[...f]).filter((B)=>!J.has(B));if(q&&K.length===0){if(q.failglob===!0)throw Error(`No matches found for "${w.join(", ")}"`);if(q.nonull===!0||q.nullglob===!0)return q.unescape?w.map((B)=>B.replace(/\\/g,"")):w}return K};R.match=R;R.matcher=($,w)=>s($,w);R.isMatch=($,w,q)=>s(w,q)($);R.any=R.isMatch;R.not=($,w,q={})=>{w=[].concat(w).map(String);let J=new Set,f=[],V=new Set(R($,w,{...q,onResult:(F)=>{if(q.onResult)q.onResult(F);f.push(F.output)}}));for(let F of f)if(!V.has(F))J.add(F);return[...J]};R.contains=($,w,q)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${d1.inspect($)}"`);if(Array.isArray(w))return w.some((J)=>R.contains($,J,q));if(typeof w==="string"){if(b1($)||b1(w))return!1;if($.includes(w)||$.startsWith("./")&&$.slice(2).includes(w))return!0}return R.isMatch($,w,{...q,contains:!0})};R.matchKeys=($,w,q)=>{if(!b0.isObject($))throw TypeError("Expected the first argument to be an object");let J=R(Object.keys($),w,q),f={};for(let Z of J)f[Z]=$[Z];return f};R.some=($,w,q)=>{let J=[].concat($);for(let f of[].concat(w)){let Z=s(String(f),q);if(J.some((V)=>Z(V)))return!0}return!1};R.every=($,w,q)=>{let J=[].concat($);for(let f of[].concat(w)){let Z=s(String(f),q);if(!J.every((V)=>Z(V)))return!1}return!0};R.all=($,w,q)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${d1.inspect($)}"`);return[].concat(w).every((J)=>s(J,q)($))};R.capture=($,w,q)=>{let J=b0.isWindows(q),Z=s.makeRe(String($),{...q,capture:!0}).exec(J?b0.toPosixSlashes(w):w);if(Z)return Z.slice(1).map((V)=>V===void 0?"":V)};R.makeRe=(...$)=>s.makeRe(...$);R.scan=(...$)=>s.scan(...$);R.parse=($,w)=>{let q=[];for(let J of[].concat($||[]))for(let f of v1(String(J),w))q.push(s.parse(f,w));return q};R.braces=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");if(w&&w.nobrace===!0||!m1($))return[$];return v1($,w)};R.braceExpand=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");return R.braces($,{...w,expand:!0})};R.hasBraces=m1;l1.exports=R});var c1=yw(u1(),1);var I0;((J)=>{J.ALLOW="allow";J.ASK="ask";J.DENY="deny"})(I0||={});var gw=h.object({tool:h.string(),specifier:h.string().optional(),action:h.nativeEnum(I0)}),hw=h.object({allow:h.array(h.string()).optional(),ask:h.array(h.string()).optional(),deny:h.array(h.string()).optional(),defaultMode:h.nativeEnum(I0).optional()}),kw=h.object({name:h.string(),args:h.record(h.string(),h.any())});class f0{rules;defaultMode;patternCache=new Map;constructor($){this.rules=$.rules,this.defaultMode=$.defaultMode||"ask",this.rules.sort((w,q)=>{let J={deny:0,ask:1,allow:2},f=J[w.action]-J[q.action];if(f!==0)return f;let Z=w.specifier==null?1:0,V=q.specifier==null?1:0;return Z-V})}checkPermission($){for(let w of this.rules)if(this.matchRule(w,$))return{allowed:w.action==="allow"||w.action==="ask",requiresApproval:w.action==="ask",matchedRule:w,reason:this.getReason(w)};return{allowed:this.defaultMode==="allow"||this.defaultMode==="ask",requiresApproval:this.defaultMode==="ask",reason:`No matching rule, using default mode: ${this.defaultMode}`}}matchRule($,w){if($.tool!==w.name)return!1;if(!$.specifier)return!0;let q=this.argsToString(w.args);if(w.name==="Bash")return this.matchBashCommand($.specifier,q);if($.specifier.endsWith(" ")&&!/[*?[\\]/.test($.specifier))return q.startsWith($.specifier);return this.matchGlob($.specifier,q)}matchBashCommand($,w){if(/[;&|]/.test(w))return!1;let J=/[<>()]/;if(J.test(w)){let f=w.split(J)[0].trim();return this.matchBashPattern($,f)}return this.matchBashPattern($,w)}matchBashPattern($,w){if($.endsWith(" "))return w.startsWith($);return this.matchGlob($,w)}matchGlob($,w){try{let q=$.replace(/^\.\//,""),J=w.replace(/^\.\//,""),f=`${$}::${w}`,Z=this.patternCache.get(f);if(Z!==void 0)return Z;let V=c1.default.isMatch(J,q,{nocase:!1,dot:!0});return this.cacheResult(f,V),V}catch(q){return w===$}}cacheResult($,w){if(this.patternCache.size>1000){let q=this.patternCache.keys().next().value;if(q)this.patternCache.delete(q)}this.patternCache.set($,w)}argsToString($){if(typeof $==="object"&&$!==null){if("command"in $&&$.command)return String($.command);if("file_path"in $&&$.file_path)return String($.file_path);return Object.values($).flat().join(" ")}return String($)}getReason($){let w=$.action.toUpperCase(),q=$.tool,J=$.specifier?`(${$.specifier})`:"";return`${w} rule matched: ${q}${J}`}static parseRule($,w){let q=$.match(/^(\w+)(?:\((.*)\))?$/);if(!q)throw Error(`Invalid permission rule format: ${$}`);let[,J,f]=q;return{tool:J,specifier:f,action:w}}static fromConfig($){let w=[];for(let q of $.allow||[])w.push(f0.parseRule(q,"allow"));for(let q of $.ask||[])w.push(f0.parseRule(q,"ask"));for(let q of $.deny||[])w.push(f0.parseRule(q,"deny"));return new f0({rules:w,defaultMode:$.defaultMode||"ask"})}clearCache(){this.patternCache.clear()}getCacheSize(){return this.patternCache.size}}class $0{configStore;toolNameMapper={};constructor($){this.configStore=$}static instance=null;static getInstance($){if(!$0.instance){if(!$)throw Error("PermissionStore not initialized. Provide configStore on first call.");$0.instance=new $0($)}return $0.instance}static resetInstance(){$0.instance=null}async getPermissions(){let $=await this.configStore.getConfig();if($.permissions)return f0.fromConfig($.permissions);return}async checkBashPermission($,w){return(await this.getPermissions())?.checkPermission({name:"Bash",args:{command:$,cwd:w}})}async checkReadPermission($){return(await this.getPermissions())?.checkPermission({name:"Read",args:{file_path:$}})}async checkWritePermission($){return(await this.getPermissions())?.checkPermission({name:"Write",args:{file_path:$}})}}class C0{configStore;skillStore;pluginStore;remoteStore;permissionStore;_initialized=!1;constructor($,w,q,J){this.configStore=$,this.skillStore=w,this.pluginStore=q,this.remoteStore=J,this.permissionStore=$0.getInstance($)}async initialize(){if(this._initialized)return;if("initialize"in this.configStore&&typeof this.configStore.initialize==="function")await this.configStore.initialize();if("initialize"in this.skillStore&&typeof this.skillStore.initialize==="function")await this.skillStore.initialize();if("initialize"in this.pluginStore&&typeof this.pluginStore.initialize==="function")await this.pluginStore.initialize();this._initialized=!0}async ensureInitialized(){if(!this._initialized)throw Error("ConfigManager not initialized. Call await manager.initialize() first.")}async getConfig(){return await this.ensureInitialized(),await this.configStore.getConfig()}async updateConfig($){return await this.ensureInitialized(),await this.configStore.updateConfig($)}async listSkills(){return await this.ensureInitialized(),await this.skillStore.listSkills()}async getSkill($){return await this.ensureInitialized(),await this.skillStore.getSkill($)}async saveSkill($,w){return await this.ensureInitialized(),await this.skillStore.saveSkill($,w)}async deleteSkill($){return await this.ensureInitialized(),await this.skillStore.deleteSkill($)}async syncSkillsFromRemote(){if(await this.ensureInitialized(),!this.remoteStore)throw Error("Remote store not configured");return await this.skillStore.syncFromRemote(this.remoteStore)}async listPlugins(){return await this.ensureInitialized(),await this.pluginStore.listPlugins()}async getPluginConfig($){return await this.ensureInitialized(),await this.pluginStore.getPluginConfig($)}async updatePluginConfig($,w){return await this.ensureInitialized(),await this.pluginStore.updatePluginConfig($,w)}async installPlugin($,w){return await this.ensureInitialized(),await this.pluginStore.installPlugin($,w)}async uninstallPlugin($){return await this.ensureInitialized(),await this.pluginStore.uninstallPlugin($)}async checkBashPermission($,w){return await this.ensureInitialized(),await this.permissionStore.checkBashPermission($,w)}async checkReadPermission($){return await this.ensureInitialized(),await this.permissionStore.checkReadPermission($)}async checkWritePermission($){return await this.ensureInitialized(),await this.permissionStore.checkWritePermission($)}async getPermissionMatcher(){return await this.ensureInitialized(),await this.permissionStore.getPermissions()}getConfigPath(){return this.configStore?.dbPath}}async function ow(){let{FileSystemConfigStore:$}=await import("./chunk-zxpb45tb.js"),{FileSystemSkillStore:w}=await import("./chunk-78t2g3ht.js"),{FileSystemPluginStore:q}=await import("./chunk-780j97nd.js"),J=new $,f=new w,Z=new q,V=new C0(J,f,Z);return await V.initialize(),V}async function tw($){let{configStore:w,skillStore:q,pluginStore:J,remoteStore:f}=$,Z=new C0(w,q,J,f);return await Z.initialize(),Z}
|
|
18
|
+
export{ow as wk,tw as xk};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{n as k}from"./chunk-2gd8vzrf.js";import{na as l,oa as m}from"./chunk-yfv1xeeh.js";import{sa as T,ua as _,va as S,wa as x}from"./chunk-74k5n8f5.js";import"./chunk-vwj4n000.js";import"./chunk-mqm8wnc8.js";import"./chunk-ncaqgas1.js";import"./chunk-0p3df51n.js";import"./chunk-9kbktaf8.js";import"./chunk-r133z8tq.js";import"./chunk-g2n6hnjp.js";import"./chunk-femf7e4d.js";import{Nk as z}from"./chunk-jbqqb1ht.js";import"./chunk-0pzpg2ra.js";import"./chunk-xtr6s7kh.js";import"./chunk-x17jyjan.js";var Q=m(),n=z.object({thread_id:z.string().optional(),thread_ts:z.string().optional()}).catchall(z.unknown()),j=z.object({tags:z.array(z.string()).optional(),recursion_limit:z.number().int().optional(),configurable:n.optional()}).catchall(z.unknown()).describe("The configuration of an assistant.");z.object({assistant_id:z.string(),graph_id:z.string(),config:j,created_at:z.string(),updated_at:z.string(),metadata:z.object({}).catchall(z.any())});var H=z.object({source:z.union([z.literal("input"),z.literal("loop"),z.literal("update"),z.string()]).optional(),step:z.number().optional(),writes:z.any().nullable().optional(),parents:z.any().optional()}).catchall(z.unknown()),h=z.object({node:z.string(),input:z.unknown().optional()}),g=z.object({update:z.union([z.any(),z.array(z.tuple([z.string(),z.any()]))]).nullable().optional(),resume:z.unknown().optional(),goto:z.union([h,z.array(h),z.string(),z.array(z.string())]).optional()});z.object({limit:z.number().int().optional(),offset:z.number().int().optional()});var V=z.object({thread_id:z.string()}),w=z.object({thread_id:z.string(),run_id:z.string()}),s=z.object({graph_id:z.string().optional(),metadata:H.optional(),limit:z.number().int().optional(),offset:z.number().int().optional(),sort_by:z.enum(["assistant_id","graph_id","name","created_at","updated_at"]).optional(),sort_order:z.enum(["asc","desc"]).optional()}),o=z.object({graph_id:z.string().optional(),metadata:H.optional()}),t=z.object({xray:z.union([z.string(),z.boolean(),z.number()]).optional()}),c=z.object({name:z.string().optional(),description:z.string().optional(),metadata:H.optional(),config:j.optional()}).optional(),a=z.object({assistant_id:z.string().optional(),graph_id:z.string().describe("The ID of graph to create an assistant from."),name:z.string().optional(),description:z.string().optional(),metadata:H.optional(),config:j.optional(),if_exists:z.enum(["raise","do_nothing"]).optional()}),r=z.object({assistant_id:z.union([z.string(),z.string()]),checkpoint_id:z.string().optional(),input:z.any().optional(),command:g.optional(),metadata:H.optional(),config:j.optional(),webhook:z.string().optional(),interrupt_before:z.union([z.literal("*"),z.array(z.string())]).optional(),interrupt_after:z.union([z.literal("*"),z.array(z.string())]).optional(),on_disconnect:z.enum(["cancel","continue"]).optional().default("continue"),multitask_strategy:z.enum(["reject","rollback","interrupt","enqueue"]).optional(),stream_mode:z.array(z.enum(["values","messages","messages-tuple","updates","events","debug","custom"])).optional(),stream_subgraphs:z.boolean().optional(),stream_resumable:z.boolean().optional(),after_seconds:z.number().optional(),if_not_exists:z.enum(["create","reject"]).optional(),on_completion:z.enum(["complete","continue"]).optional(),feedback_keys:z.array(z.string()).optional(),langsmith_tracer:z.unknown().optional()}).describe("Payload for creating a stateful run."),e=z.object({limit:z.coerce.number().int().optional().default(10),offset:z.coerce.number().int().optional().default(0),status:z.enum(["pending","running","error","success","timeout","interrupted"]).optional()}),zz=z.object({wait:z.coerce.boolean().optional().default(!1),action:z.enum(["interrupt","rollback"]).optional().default("interrupt")}),Dz=z.object({cancel_on_disconnect:z.coerce.boolean().optional().default(!1),last_event_id:z.string().optional(),stream_mode:z.enum(["values","messages","messages-tuple","updates","events","debug","custom"]).optional()}),Kz=z.object({thread_id:z.string().describe("The ID of thread. If not provided, an ID is generated.").optional(),metadata:H.optional(),if_exists:z.union([z.literal("raise"),z.literal("do_nothing")]).optional()}).describe("Payload for creating a thread."),i=z.object({ids:z.array(z.string()).describe("List of thread IDs to include. Others are excluded.").optional(),metadata:H.describe("Metadata to search for.").optional(),status:z.enum(["idle","busy","interrupted","error"]).describe("Filter by thread status.").optional(),values:z.any().describe("Filter by thread values.").optional(),limit:z.number().int().gte(1).lte(1000).describe("Maximum number to return.").optional(),offset:z.number().int().gte(0).describe("Offset to start from.").optional(),sort_by:z.enum(["thread_id","status","created_at","updated_at"]).describe("Sort by field.").optional(),sort_order:z.enum(["asc","desc"]).describe("Sort order.").optional(),select:z.array(z.enum(["thread_id","created_at","updated_at","metadata","config","context","status","values","interrupts","title"])).describe("Specify which fields to return. If not provided, all fields are returned.").optional(),without_details:z.boolean().describe("Whether to return values.").optional()}).describe("Payload for listing threads.");z.object({values:z.union([z.record(z.string(),z.unknown()),z.array(z.record(z.string(),z.unknown()))]).nullish()}).describe("Payload for adding state to a thread.");var Oz=z.object({metadata:H.optional(),status:z.enum(["idle","busy","interrupted","error"]).optional(),values:z.any().optional()}).describe("Payload for patching a thread."),p=z.object({assistant_id:z.string(),input:z.any().optional(),command:g.optional(),metadata:H.optional(),config:j.optional(),webhook:z.string().optional(),interrupt_before:z.union([z.literal("*"),z.array(z.string())]).optional(),interrupt_after:z.union([z.literal("*"),z.array(z.string())]).optional(),on_disconnect:z.enum(["cancel","continue"]).optional().default("continue"),multitask_strategy:z.enum(["reject","rollback","interrupt","enqueue"]).optional(),stream_mode:z.array(z.enum(["values","messages","messages-tuple","updates","events","debug","custom"])).optional(),stream_subgraphs:z.boolean().optional(),stream_resumable:z.boolean().optional(),after_seconds:z.number().optional(),if_not_exists:z.enum(["create","reject"]).optional(),on_completion:z.enum(["complete","continue"]).optional(),feedback_keys:z.array(z.string()).optional(),langsmith_tracer:z.unknown().optional()}).describe("Payload for creating a run (background/wait)."),Xz=z.object({cancel_on_disconnect:z.coerce.boolean().optional().default(!1)}),Yz=z.object({cancel_on_disconnect:z.coerce.boolean().optional().default(!1)}),b=z.object({assistant_id:z.string().describe("The assistant ID or graph name to run."),input:z.any().optional().describe("The input to the graph."),command:g.optional(),metadata:H.optional().describe("Metadata to assign to the run."),config:j.optional(),context:z.object({}).catchall(z.any()).optional().describe("Static context added to the assistant."),webhook:z.string().optional(),interrupt_before:z.union([z.literal("*"),z.array(z.string())]).optional(),interrupt_after:z.union([z.literal("*"),z.array(z.string())]).optional(),stream_mode:z.union([z.enum(["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]),z.array(z.enum(["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]))]).optional().default(["values"]),feedback_keys:z.array(z.string()).optional(),stream_subgraphs:z.boolean().optional().default(!1),stream_resumable:z.boolean().optional().default(!1)}).describe("Payload for creating a stateless run."),Zz=z.array(b).min(1).describe("Payload for creating a batch of stateless runs."),$z=z.object({action:z.enum(["interrupt","rollback"]).optional().default("interrupt").describe("Action to take when cancelling the run."),wait:z.coerce.boolean().optional().default(!1)}),Jz=z.union([z.object({status:z.enum(["pending","running","all"]).describe("Filter runs by status to cancel.")}),z.object({thread_id:z.string().describe("The ID of the thread containing runs to cancel.")}),z.object({run_ids:z.array(z.string()).min(1).describe("List of run IDs to cancel.")})]);function E(K,$){let D=$.split("/").filter((Y)=>Y),X=new URL(K).pathname.split("/").filter((Y)=>Y),O={};return D.forEach((Y,Z)=>{if(Y.startsWith(":")){let W=Y.slice(1);O[W]=X[Z]}}),O}function A(K){let $=new URL(K).searchParams,D={};return $.forEach((X,O)=>{if(!isNaN(Number(X))&&X!=="")D[O]=Number(X);else if(X==="true"||X==="false")D[O]=X==="true";else D[O]=X}),D}function f(K,$){let D=K.safeParse($);if(!D.success)throw new P(D.error.issues);return D.data}class P extends Error{errors;constructor(K){super("Validation failed");this.name="ValidationError",this.errors=K}}function L(K,$=200,D){return new Response(JSON.stringify(K),{status:$,headers:{"Content-Type":"application/json",...D}})}function F(K,$=500){if(K instanceof P)return L({error:"Validation Error",details:K.errors},400);return L({error:K instanceof Error?K.message:"Unknown error"},$)}function R(K){let $,D=!1,X=new AbortController,O=new ReadableStream({async start(Y){$=Y;let Z=new TextEncoder,W={signal:X.signal,writeSSE:async({data:J,event:M,id:N})=>{if(D||X.signal.aborted)return;try{let B="";if(N)B+=`id: ${N}
|
|
2
|
+
`;if(M)B+=`event: ${M}
|
|
3
|
+
`;B+=`data: ${J}
|
|
4
|
+
|
|
5
|
+
`,$.enqueue(Z.encode(B))}catch(B){if(!D&&!X.signal.aborted)throw B}},close:()=>{if(!D){D=!0;try{$.close()}catch(J){}}}};try{await K(W)}catch(J){if(!X.signal.aborted)console.error("SSE stream error:",J)}finally{if(!D){D=!0;try{$.close()}catch(J){}}}},cancel(){if(D=!0,!X.signal.aborted)X.abort("Client disconnected")}});return new Response(O,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}function u(K,$=process.env.HEARTBEAT_INTERVAL?parseInt(process.env.HEARTBEAT_INTERVAL):1500){return async(D)=>{let X=null,O=!1,Y=()=>{if(X)clearInterval(X),X=null},Z=()=>{Y(),X=setInterval(async()=>{if(D.signal.aborted||O){Y();return}try{await D.writeSSE({event:"ping",data:"{}"})}catch(M){Y()}},$)},W=()=>{Y()};D.signal.addEventListener("abort",W);let J={signal:D.signal,writeSSE:async(M)=>{if(D.signal.aborted)return;if(Y(),await D.writeSSE(M),!D.signal.aborted)Z()},close:()=>{Y(),D.close()}};Z();try{await K(J)}finally{O=!0,Y(),D.signal.removeEventListener("abort",W)}}}async function Mz(K,$){try{let D=await K.json(),X=f(s,D),O=await Q.assistants.search(k(X));return L(O,200,{"X-Pagination-Total":"0"})}catch(D){return F(D)}}async function Wz(K,$){try{let D=await K.json(),X=f(o,D),O=await Q.assistants.count(k(X));return L(O)}catch(D){return F(D)}}async function Nz(K,$){try{let O=new URL(K.url).pathname.split("/").filter((Z)=>Z)[1],Y=await Q.assistants.get(O);return L(Y)}catch(D){return F(D)}}async function fz(K,$){try{let O=new URL(K.url).pathname.split("/").filter((Y)=>Y)[1];return await Q.assistants.delete(O),L({})}catch(D){return F(D)}}async function Bz(K,$){try{let O=new URL(K.url).pathname.split("/").filter((J)=>J)[1],Y=await K.json(),Z=f(c,Y),W=await Q.assistants.update(O,k(Z));return L(W)}catch(D){return F(D)}}async function Fz(K,$){try{let O=new URL(K.url).pathname.split("/").filter((J)=>J)[1],Y=A(K.url),{xray:Z}=f(t,Y),W=await Q.assistants.getGraph(O,{xray:Z!==void 0?Z==="true":void 0});return L(W)}catch(D){return F(D)}}async function Qz(K,$){return F({},501)}async function Lz(K,$){return F({},501)}async function Ez(K,$){try{let O=new URL(K.url).pathname.split("/").filter((Z)=>Z)[1],Y=await Q.assistants.getSchemas(O);return L(Y)}catch(D){return F(D)}}async function kz(K,$){try{let O=new URL(K.url).pathname.split("/").filter((J)=>J)[1],Y=await K.json(),Z=f(c,Y),W=await Q.assistants.getVersions(O,k(Z));return L(W)}catch(D){return F(D)}}async function Uz(K,$){try{let O=new URL(K.url).pathname.split("/").filter((J)=>J)[1],Y=A(K.url),Z=Y.version?parseInt(Y.version):1,W=await Q.assistants.setLatest(O,Z);return L(W)}catch(D){return F(D)}}async function Vz(K,$){try{let D=await K.json(),X=f(a,D),O=await Q.assistants.create(k(X));return L(O)}catch(D){return F(D)}}async function Gz(K,$){try{let D=await K.json(),X=f(Kz,D),O=await Q.threads.create(k(X));return L(O)}catch(D){return F(D)}}async function Az(K,$){try{let D=await K.json(),X=f(i,D),O=await Q.threads.search(k(X));return L(O,200,{"X-Pagination-Total":O.length.toString()})}catch(D){return F(D)}}async function Iz(K,$){try{let D=await K.json(),X=f(i.partial(),D),O=await Q.threads.count(k(X));return L(O)}catch(D){return F(D)}}async function Hz(K,$){try{let D=E(K.url,"/threads/:thread_id"),{thread_id:X}=f(V,D),O=await Q.threads.get(X);return L(O)}catch(D){return F(D)}}async function vz(K,$){try{let D=E(K.url,"/threads/:thread_id"),{thread_id:X}=f(V,D),O=await K.json(),Y=f(Oz,O),Z=await Q.threads.patch(X,k(Y));return L(Z)}catch(D){return F(D)}}async function Tz(K,$){try{let D=E(K.url,"/threads/:thread_id"),{thread_id:X}=f(V,D);return await Q.threads.delete(X),new Response(null,{status:204})}catch(D){return F(D)}}async function xz(K,$){try{let D=E(K.url,"/threads/:thread_id/state"),{thread_id:X}=f(V,D),O=A(K.url),Y={subgraphs:O.subgraphs==="true"||O.subgraphs===!0},Z=await Q.threads.getState(X,Y);return L(Z)}catch(D){return F(D)}}async function jz(K,$){try{let D=E(K.url,"/threads/:thread_id/state"),{thread_id:X}=f(V,D),O=await K.json(),Y=await Q.threads.updateState(X,k(O));return L(Y)}catch(D){return F(D)}}async function _z(K,$){try{let D=E(K.url,"/threads/:thread_id/state/checkpoint"),{thread_id:X}=f(V,D),O=await K.json(),Y=A(K.url),Z={subgraphs:Y.subgraphs==="true"||Y.subgraphs===!0,...O},W=await Q.threads.getState(X,Z);return L(W)}catch(D){return F(D)}}async function wz(K,$){try{let D=E(K.url,"/threads/:thread_id/history"),{thread_id:X}=f(V,D),O=A(K.url),Y={limit:O.limit?parseInt(O.limit,10):void 0,before:O.before},Z=await Q.threads.getStateHistory(X,Y);return L(Z)}catch(D){return F(D)}}async function Cz(K,$){try{let D=E(K.url,"/threads/:thread_id/history"),{thread_id:X}=f(V,D),O=await K.json(),Y={limit:O.limit,before:O.before},Z=await Q.threads.getStateHistory(X,Y);return L(Z)}catch(D){return F(D)}}async function bz(K,$){try{let D=E(K.url,"/threads/:thread_id/copy"),{thread_id:X}=f(V,D),O=await Q.threads.copy(X);return L(O)}catch(D){return F(D)}}async function Sz(K,$){try{let D=E(K.url,"/threads/:thread_id/stream"),{thread_id:X}=f(V,D),O=A(K.url),Y={lastEventId:K.headers.get("Last-Event-ID")||O.last_event_id,streamModes:O.stream_modes?Array.isArray(O.stream_modes)?O.stream_modes:[O.stream_modes]:void 0};return new Response(`data: {"status": "stream_ready"}
|
|
6
|
+
|
|
7
|
+
`,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}catch(D){return F(D)}}async function gz(K,$){try{let D=E(K.url,"/threads/:thread_id/runs/stream"),{thread_id:X}=f(V,D),O=await K.json(),Y=f(r,O);return R(u(async(Z)=>{Y.config=Y.config||{},Y.config.configurable=Y.config.configurable||{};let W=$?.langgraph_context;if(W)Object.assign(Y.config.configurable,W);let J=null,M=!1,N=()=>{M=!0};Z.signal.addEventListener("abort",N);try{J=Q.runs.stream(X,Y.assistant_id,k(Y));for await(let{event:B,data:U}of J){if(M||Z.signal.aborted)break;await Z.writeSSE({data:S(U)??"",event:B})}}catch(B){if(!Z.signal.aborted&&!M)throw B}finally{if(Z.signal.removeEventListener("abort",N),J){try{await J.return(void 0)}catch(B){}J=null}}}))}catch(D){return F(D)}}async function Pz(K,$){try{let D=E(K.url,"/threads/:thread_id/runs/:run_id/stream"),{thread_id:X,run_id:O}=f(w,D),Y=A(K.url),{cancel_on_disconnect:Z,last_event_id:W,stream_mode:J}=f(Dz,Y);return R(u(async(M)=>{let N=new AbortController,B=null,U=!1,v=[],G=()=>{N.abort("Client disconnected")};if(K.signal)K.signal.addEventListener("abort",G),v.push({signal:K.signal,handler:G});let y=()=>{U=!0,N.abort("SSE stream closed")};M.signal.addEventListener("abort",y),v.push({signal:M.signal,handler:y});try{B=Q.runs.joinStream(X,O,{signal:N.signal,cancelOnDisconnect:Z,lastEventId:W,streamMode:J?[J]:void 0});for await(let{event:I,data:C,id:q}of B){if(U||M.signal.aborted||N.signal.aborted)break;await M.writeSSE({data:S(C)??"",event:I,id:q})}}catch(I){if(!(N.signal.aborted||M.signal.aborted)&&!(I instanceof Error&&I.message.includes("user cancel")))console.error("Join stream error:",I),await M.writeSSE({event:"error",data:JSON.stringify({error:I instanceof Error?I.message:"Unknown error"})})}finally{for(let{signal:I,handler:C}of v)try{I.removeEventListener("abort",C)}catch(q){}if(B){try{await B.return(void 0)}catch(I){}B=null}}}))}catch(D){return F(D)}}async function Rz(K,$){try{let D=E(K.url,"/threads/:thread_id/runs"),{thread_id:X}=f(V,D),O=A(K.url),{limit:Y,offset:Z,status:W}=f(e,O),J=await Q.runs.list(X,{limit:Y,offset:Z,status:W});return L(J)}catch(D){return F(D)}}async function uz(K,$){try{let D=E(K.url,"/threads/:thread_id/runs/:run_id/cancel"),{thread_id:X,run_id:O}=f(w,D),Y=A(K.url),{wait:Z,action:W}=f(zz,Y),J=Q.runs.cancel(X,O,Z,W);if(Z)await J;return new Response(null,{status:Z?204:202})}catch(D){return F(D)}}async function yz(K,$){try{let D=E(K.url,"/threads/:thread_id/runs"),{thread_id:X}=f(V,D),O=await K.json(),Y=f(p,O),Z=k(Y);Z.config=Z.config||{},Z.config.configurable=Z.config.configurable||{};let W=$?.langgraph_context;if(W)Object.assign(Z.config.configurable,W);Z.config.configurable.graph_id=Y.assistant_id,Z.config.configurable.thread_id=X;let J=Q.threads,M=await J.createRun(X,Y.assistant_id,Z);return(async()=>{let N=!1;try{for await(let B of x(J,M,Z,{attempt:0,getGraph:T}));}catch(B){console.error("Background run error:",B)}finally{if(!N){N=!0;try{await _.globalMessageQueue.removeQueue(M.run_id)}catch(B){}}}})(),L(M,200,{"Content-Location":`/threads/${X}/runs/${M.run_id}`})}catch(D){return F(D)}}async function qz(K,$){try{let D=E(K.url,"/threads/:thread_id/runs/wait"),{thread_id:X}=f(V,D),O=await K.json(),Y=f(p,O),Z=A(K.url),{cancel_on_disconnect:W}=f(Xz,Z),J=k(Y);J.config=J.config||{},J.config.configurable=J.config.configurable||{};let M=$?.langgraph_context;if(M)Object.assign(J.config.configurable,M);J.config.configurable.graph_id=Y.assistant_id,J.config.configurable.thread_id=X;let N=Q.threads,B=await N.createRun(X,Y.assistant_id,J),U={};for await(let{event:v,data:G}of x(N,B,J,{attempt:0,getGraph:T}))if(v==="end"||v==="writes/value"){if(G&&typeof G==="object")Object.assign(U,G)}return L(U,200,{"Content-Location":`/threads/${X}/runs/${B.run_id}`})}catch(D){return F(D)}}async function hz(K,$){try{let D=E(K.url,"/threads/:thread_id/runs/:run_id"),{thread_id:X,run_id:O}=f(w,D),Z=(await Q.runs.list(X,{limit:1000})).find((W)=>W.run_id===O);if(!Z)return F(Error("Run not found"),404);return L(Z)}catch(D){return F(D)}}async function mz(K,$){try{let D=E(K.url,"/threads/:thread_id/runs/:run_id"),{thread_id:X,run_id:O}=f(w,D);return await Q.threads.updateRun(O,{status:"deleted"}),new Response(null,{status:204})}catch(D){return F(D)}}async function cz(K,$){try{let D=E(K.url,"/threads/:thread_id/runs/:run_id/join"),{thread_id:X,run_id:O}=f(w,D),Y=A(K.url),{cancel_on_disconnect:Z}=f(Yz,Y),J=(await Q.runs.list(X,{limit:1000})).find((B)=>B.run_id===O);if(!J)return F(Error("Run not found"),404);if(J.status==="success"||J.status==="error")return L({});let M=new AbortController;if(Z){let B=()=>{M.abort("Client disconnected")};K.signal?.addEventListener("abort",B)}let N={};for await(let{event:B,data:U}of Q.runs.joinStream(X,O,{signal:M.signal,cancelOnDisconnect:Z}))if(B.event==="end"||B.event==="writes/value"){if(U&&typeof U==="object")Object.assign(N,U)}return L(N)}catch(D){return F(D)}}async function iz(K,$){try{let D=await K.json(),X=f(b,D),O=k(X);O.config=O.config||{},O.config.configurable=O.config.configurable||{};let Y=$?.langgraph_context;if(Y)Object.assign(O.config.configurable,Y);let Z=Q.threads,W=await Z.create({metadata:{...O.metadata,temporary:!0}});O.config.configurable.graph_id=X.assistant_id,O.config.configurable.thread_id=W.thread_id,O.temporary=!0;let J=await Z.createRun(W.thread_id,X.assistant_id,O);return(async()=>{let M=!1;try{for await(let N of x(Z,J,O,{attempt:0,getGraph:T}));}catch(N){console.error("Stateless run error:",N)}finally{try{await Z.delete(W.thread_id)}catch(N){console.error("Error cleaning up temporary thread:",N)}if(!M){M=!0;try{await _.globalMessageQueue.removeQueue(J.run_id)}catch(N){}}}})(),L(J,200,{"Content-Location":`/threads/${W.thread_id}/runs/${J.run_id}`})}catch(D){return F(D)}}async function pz(K,$){try{let D=await K.json(),X=f(b,D),O=k(X);O.config=O.config||{},O.config.configurable=O.config.configurable||{};let Y=$?.langgraph_context;if(Y)Object.assign(O.config.configurable,Y);let Z=Q.threads,W=await Z.create({metadata:{...O.metadata,temporary:!0}});O.config.configurable.graph_id=X.assistant_id,O.config.configurable.thread_id=W.thread_id,O.temporary=!0;let J=await Z.createRun(W.thread_id,X.assistant_id,O);return R(u(async(M)=>{try{for await(let N of x(Z,J,O,{attempt:0,getGraph:T}))await M.writeSSE({data:JSON.stringify(N),event:"data"})}catch(N){if(N instanceof Error&&N.name!=="AbortError")throw console.error("Stream error:",N),N}finally{try{await Z.delete(W.thread_id)}catch(N){console.error("Error cleaning up temporary thread:",N)}}}))}catch(D){return F(D)}}async function dz(K,$){try{let D=await K.json(),X=f(b,D),O=k(X);O.config=O.config||{},O.config.configurable=O.config.configurable||{};let Y=$?.langgraph_context;if(Y)Object.assign(O.config.configurable,Y);let Z=Q.threads,W=await Z.create({metadata:{...O.metadata,temporary:!0}});O.config.configurable.graph_id=X.assistant_id,O.config.configurable.thread_id=W.thread_id,O.temporary=!0;let J=await Z.createRun(W.thread_id,X.assistant_id,O),M={};try{for await(let{event:N,data:B}of x(Z,J,O,{attempt:0,getGraph:T}))if(N==="end"||N==="writes/value"){if(B&&typeof B==="object")Object.assign(M,B)}}finally{try{await Z.delete(W.thread_id)}catch(N){console.error("Error cleaning up temporary thread:",N)}}return L(M,200,{"Content-Location":`/threads/${W.thread_id}/runs/${J.run_id}`})}catch(D){return F(D)}}async function lz(K,$){try{let D=await K.json(),X=f(Zz,D),O=Q.threads,Y=[],Z=X.map(async(J)=>{try{let M=k(J);M.config=M.config||{},M.config.configurable=M.config.configurable||{};let N=$?.langgraph_context;if(N)Object.assign(M.config.configurable,N);let B=await O.create({metadata:{...M.metadata,temporary:!0}});M.config.configurable.graph_id=J.assistant_id,M.config.configurable.thread_id=B.thread_id,M.temporary=!0;let U=await O.createRun(B.thread_id,J.assistant_id,M);return(async()=>{let v=!1;try{for await(let G of x(O,U,M,{attempt:0,getGraph:T}));}catch(G){console.error("Batch run error:",G)}finally{try{await O.delete(B.thread_id)}catch(G){console.error("Error cleaning up temporary thread:",G)}if(!v){v=!0;try{await _.globalMessageQueue.removeQueue(U.run_id)}catch(G){}}}})(),{thread_id:B.thread_id,run_id:U.run_id}}catch(M){return console.error("Batch run creation error:",M),{error:(M instanceof Error?M.message:"Unknown error")||"Unknown error"}}}),W=await Promise.all(Z);return Y.push(...W),L(Y,200)}catch(D){return F(D)}}async function nz(K,$){try{let D=await K.json(),X=f(Jz,D),O=new URL(K.url),Y=f($z,{action:O.searchParams.get("action")||"interrupt"}),Z=Q.threads,W=[];if("run_ids"in X&&X.run_ids)for(let J of X.run_ids)try{console.warn(`Cancel by run_id ${J} not fully implemented yet`)}catch(M){console.error(`Error cancelling run ${J}:`,M)}else if("thread_id"in X&&X.thread_id){let J=X.thread_id;try{let M=await Z.listRuns(J,{limit:1000,offset:0});for(let N of M)try{Q.runs.cancel(J,N.run_id,Y.wait,Y.action),W.push(N.run_id)}catch(B){console.error(`Error cancelling run ${N.run_id}:`,B)}}catch(M){console.error(`Error listing runs for thread ${J}:`,M)}}else if("status"in X&&X.status)console.warn(`Cancel by status ${X.status} not fully implemented yet`);return new Response(null,{status:204})}catch(D){return F(D)}}var sz=[{method:"POST",pattern:/^\/assistants\/search$/,handler:Mz},{method:"POST",pattern:/^\/assistants\/count$/,handler:Wz},{method:"GET",pattern:/^\/assistants\/[^/]+$/,handler:Nz},{method:"DELETE",pattern:/^\/assistants\/[^/]+$/,handler:fz},{method:"PATCH",pattern:/^\/assistants\/[^/]+$/,handler:Bz},{method:"GET",pattern:/^\/assistants\/[^/]+\/graph$/,handler:Fz},{method:"GET",pattern:/^\/assistants\/[^/]+\/subgraphs$/,handler:Qz},{method:"GET",pattern:/^\/assistants\/[^/]+\/subgraphs\/[^/]+$/,handler:Lz},{method:"GET",pattern:/^\/assistants\/[^/]+\/schemas$/,handler:Ez},{method:"POST",pattern:/^\/assistants\/[^/]+\/versions$/,handler:kz},{method:"POST",pattern:/^\/assistants\/[^/]+\/latest$/,handler:Uz},{method:"POST",pattern:/^\/assistants$/,handler:Vz},{method:"POST",pattern:/^\/threads$/,handler:Gz},{method:"POST",pattern:/^\/threads\/search$/,handler:Az},{method:"POST",pattern:/^\/threads\/count$/,handler:Iz},{method:"GET",pattern:/^\/threads\/[^/]+$/,handler:Hz},{method:"PATCH",pattern:/^\/threads\/[^/]+$/,handler:vz},{method:"DELETE",pattern:/^\/threads\/[^/]+$/,handler:Tz},{method:"GET",pattern:/^\/threads\/[^/]+\/state$/,handler:xz},{method:"POST",pattern:/^\/threads\/[^/]+\/state$/,handler:jz},{method:"POST",pattern:/^\/threads\/[^/]+\/state\/checkpoint$/,handler:_z},{method:"GET",pattern:/^\/threads\/[^/]+\/history$/,handler:wz},{method:"POST",pattern:/^\/threads\/[^/]+\/history$/,handler:Cz},{method:"POST",pattern:/^\/threads\/[^/]+\/copy$/,handler:bz},{method:"GET",pattern:/^\/threads\/[^/]+\/stream$/,handler:Sz},{method:"POST",pattern:/^\/threads\/[^/]+\/runs$/,handler:yz},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/stream$/,handler:gz},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/wait$/,handler:qz},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/cancel$/,handler:uz},{method:"GET",pattern:/^\/threads\/[^/]+\/runs$/,handler:Rz},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+$/,handler:hz},{method:"DELETE",pattern:/^\/threads\/[^/]+\/runs\/[^/]+$/,handler:mz},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/join$/,handler:cz},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/stream$/,handler:Pz},{method:"POST",pattern:/^\/runs$/,handler:iz},{method:"POST",pattern:/^\/runs\/stream$/,handler:pz},{method:"POST",pattern:/^\/runs\/wait$/,handler:dz},{method:"POST",pattern:/^\/runs\/batch$/,handler:lz},{method:"POST",pattern:/^\/runs\/cancel$/,handler:nz}],oz=(K)=>{let $=new URL(K.url).pathname.toString(),D="";if($.includes("/threads"))D=$.split("/threads")[0];else if($.includes("/assistants"))D=$.split("/assistants")[0];return new Request(K.url.replace(D,""),{method:K.method,headers:K.headers,body:K.body,duplex:K.duplex})};async function d(K,$={}){K=oz(K);try{await _.initGlobal();let X=new URL(K.url).pathname,O=K.method;for(let Y of sz)if(Y.method===O&&Y.pattern.test(X))return await Y.handler(K,$);return new Response("Not Found",{status:404})}catch(D){return console.error("Request error:",D),F(D)}}var tz=new l;tz.all("*",async(K)=>{let $={langgraph_context:K.get("langgraph_context")};return await d(K.req.raw,$)});export{tz as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import"./chunk-nh11afw0.js";import"./chunk-mqm8wnc8.js";import"./chunk-ncaqgas1.js";import{qk as t}from"./chunk-9kbktaf8.js";import"./chunk-r133z8tq.js";import"./chunk-g2n6hnjp.js";import"./chunk-femf7e4d.js";import"./chunk-jbqqb1ht.js";import{xl as e}from"./chunk-0pzpg2ra.js";import"./chunk-xtr6s7kh.js";import"./chunk-x17jyjan.js";var a=e.object({content:e.string().min(1),status:e.enum(["pending","in_progress","completed"]),id:e.string()}),o=e.object({todos:e.array(a).describe("The updated todo list")}),s=t(async()=>{return"todo saved successfully"},{name:"todo_write",description:`Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
|
|
2
2
|
It also helps the user understand the progress of the task and overall progress of their requests.
|
|
3
3
|
## When to Use This Tool
|
|
4
4
|
Use this tool proactively in these scenarios:
|
|
@@ -172,5 +172,4 @@ The assistant did not use the todo list because this is a single command executi
|
|
|
172
172
|
- Use clear, descriptive task names
|
|
173
173
|
|
|
174
174
|
When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.
|
|
175
|
-
`,schema:
|
|
176
|
-
export{a as re,n as se};
|
|
175
|
+
`,schema:o});var m={name:"task",tools:[s]};export{m as taskMiddleware};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$a as D,$b as Da,$c as Db,$d as Dc,Aa as c,Ab as ca,Ac as cb,Ad as cc,Ae as cd,Ba as d,Bb as da,Bc as db,Bd as dc,Be as dd,Ca as e,Cb as ea,Cc as eb,Cd as ec,Ce as ed,Da as f,Db as fa,Dc as fb,Dd as fc,De as fd,Ea as g,Eb as ga,Ec as gb,Ed as gc,Ee as gd,Fa as h,Fb as ha,Fc as hb,Fd as hc,Fe as hd,Ga as i,Gb as ia,Gc as ib,Gd as ic,Ge as id,Ha as j,Hb as ja,Hc as jb,Hd as jc,He as jd,Ia as k,Ib as ka,Ic as kb,Id as kc,Ie as kd,Ja as l,Jb as la,Jc as lb,Jd as lc,Je as ld,Ka as m,Kb as ma,Kc as mb,Kd as mc,Ke as md,La as n,Lb as na,Lc as nb,Ld as nc,Le as nd,Ma as o,Mb as oa,Mc as ob,Md as oc,Me as od,Na as p,Nb as pa,Nc as pb,Nd as pc,Ne as pd,Oa as q,Ob as qa,Oc as qb,Od as qc,Oe as qd,Pa as r,Pb as ra,Pc as rb,Pd as rc,Pe as rd,Qa as s,Qb as sa,Qc as sb,Qd as sc,Qe as sd,Ra as t,Rb as ta,Rc as tb,Rd as tc,Re as td,Sa as u,Sb as ua,Sc as ub,Sd as uc,Ta as v,Tb as va,Tc as vb,Td as vc,Ua as w,Ub as wa,Uc as wb,Ud as wc,Va as x,Vb as xa,Vc as xb,Vd as xc,Wa as y,Wb as ya,Wc as yb,Wd as yc,Xa as z,Xb as za,Xc as zb,Xd as zc,Ya as A,Yb as Aa,Yc as Ab,Yd as Ac,Za as B,Zb as Ba,Zc as Bb,Zd as Bc,_a as C,_b as Ca,_c as Cb,_d as Cc,ab as E,ac as Ea,ad as Eb,ae as Ec,bb as F,bc as Fa,bd as Fb,be as Fc,cb as G,cc as Ga,cd as Gb,ce as Gc,db as H,dc as Ha,dd as Hb,de as Hc,eb as I,ec as Ia,ed as Ib,ee as Ic,fb as J,fc as Ja,fd as Jb,fe as Jc,gb as K,gc as Ka,gd as Kb,ge as Kc,hb as L,hc as La,hd as Lb,he as Lc,ib as M,ic as Ma,id as Mb,ie as Mc,jb as N,jc as Na,jd as Nb,je as Nc,kb as O,kc as Oa,kd as Ob,ke as Oc,lb as P,lc as Pa,ld as Pb,le as Pc,mb as Q,mc as Qa,md as Qb,me as Qc,nb as R,nc as Ra,nd as Rb,ne as Rc,ob as S,oc as Sa,od as Sb,oe as Sc,pb as T,pc as Ta,pd as Tb,pe as Tc,qb as U,qc as Ua,qd as Ub,qe as Uc,rb as V,rc as Va,rd as Vb,re as Vc,sb as W,sc as Wa,sd as Wb,se as Wc,tb as X,tc as Xa,td as Xb,te as Xc,ub as Y,uc as Ya,ud as Yb,ue as Yc,vb as Z,vc as Za,vd as Zb,ve as Zc,wb as _,wc as _a,wd as _b,we as _c,xb as $,xc as $a,xd as $b,xe as $c,ya as a,yb as aa,yc as ab,yd as ac,ye as ad,za as b,zb as ba,zc as bb,zd as bc,ze as bd}from"./chunk-vwj4n000.js";import"./chunk-x17jyjan.js";export{wc as validateTransactionSettings,Jc as sql,sd as replaceWithNoncontingentExpression,td as pushValueIntoList,D as isOperator,m as isOperationNodeSource,ya as isNoResultErrorConstructor,Cc as isKyselyProps,H as isJSONOperator,n as isExpression,M as isDynamicReferenceBuilder,zc as isCompilable,F as isComparisonOperator,xb as isColumnDataType,E as isBinaryOperator,G as isArithmeticOperator,o as isAliasedExpression,Bb as isAliasedDynamicTableBuilder,fb as createSelectQueryBuilder,Ic as createRawBuilder,kb as createFunctionModule,Pa as WithSchemaPlugin,Na as WithNode,ha as WhereNode,Va as WheneableMergeQueryBuilder,ka as WhenNode,sa as ValuesNode,W as ValueNode,V as ValueListNode,fa as UsingNode,Ja as UpdateResult,ea as UpdateQueryNode,Ka as UpdateQueryBuilder,Qb as UniqueConstraintNode,lb as UnaryOperationNode,A as UNARY_OPERATORS,z as UNARY_FILTER_OPERATORS,vb as TupleNode,tb as TraversedJSONPathBuilder,Ec as TransactionBuilder,Bc as Transaction,Da as TopNode,l as TableNode,vc as TRANSACTION_ISOLATION_LEVELS,uc as TRANSACTION_ACCESS_MODES,Qc as SqliteQueryCompiler,Xc as SqliteIntrospector,Pc as SqliteDriver,Zc as SqliteDialect,Yc as SqliteAdapter,tc as SingleConnectionProvider,$a as SetOperationNode,ra as SelectionNode,oa as SelectQueryNode,p as SelectModifierNode,J as SelectAllNode,g as SchemableIdentifierNode,pc as SchemaModule,ia as ReturningNode,Yb as RenameConstraintNode,Fb as RenameColumnNode,nc as RefreshMaterializedViewNode,oc as RefreshMaterializedViewBuilder,Ib as ReferencesNode,K as ReferenceNode,O as RawNode,na as QueryNode,Ya as QueryCreator,U as PrimitiveValueListNode,Vb as PrimaryKeyConstraintNode,Wb as PrimaryConstraintNode,_c as PostgresQueryCompiler,$c as PostgresIntrospector,gd as PostgresDriver,hd as PostgresDialect,ad as PostgresAdapter,Z as PartitionByNode,qa as PartitionByItemNode,qd as ParseJSONResultsPlugin,X as ParensNode,_ as OverNode,ma as OutputNode,Y as OrderByNode,N as OrderByItemNode,Q as OrderByItemBuilder,cb as OrWrapper,r as OrNode,Ea as OrActionNode,C as OperatorNode,Kc as OperationNodeVisitor,Oa as OperationNodeTransformer,s as OnNode,va as OnDuplicateKeyNode,Ca as OnConflictUpdateBuilder,za as OnConflictNode,Ba as OnConflictDoNothingBuilder,Aa as OnConflictBuilder,Za as OffsetNode,B as OPERATORS,Hb as ON_MODIFY_FOREIGN_ACTIONS,e as ON_COMMIT_ACTIONS,Xa as NotMatchedThenableMergeQueryBuilder,Ra as NoopQueryExecutor,xa as NoResultError,Vc as NO_MIGRATIONS,Sa as NOOP_QUERY_EXECUTOR,cd as MysqlQueryCompiler,dd as MysqlIntrospector,bd as MysqlDriver,fd as MysqlDialect,ed as MysqlAdapter,ld as MssqlQueryCompiler,kd as MssqlIntrospector,jd as MssqlDriver,md as MssqlDialect,id as MssqlAdapter,Mb as ModifyColumnNode,Wc as Migrator,Ta as MergeResult,la as MergeQueryNode,Ua as MergeQueryBuilder,Wa as MatchedThenableMergeQueryBuilder,Qa as MatchedNode,Uc as MIGRATION_LOCK_ID,yc as Log,da as ListNode,Ha as LimitNode,xc as LOG_LEVELS,Ac as Kysely,t as JoinNode,pa as JoinBuilder,x as JSON_OPERATORS,R as JSONReferenceNode,T as JSONPathNode,rb as JSONPathLegNode,sb as JSONPathBuilder,S as JSONOperatorChainNode,wa as InsertResult,ca as InsertQueryNode,Fa as InsertQueryBuilder,b as IdentifierNode,ba as HavingNode,rd as HandleEmptyInListsPlugin,aa as GroupByNode,_a as GroupByItemNode,Jb as GeneratedNode,hb as FunctionNode,$ as FromNode,Nb as ForeignKeyConstraintNode,Ob as ForeignKeyConstraintBuilder,nd as FileMigrationProvider,eb as FetchNode,ab as ExpressionWrapper,ja as ExplainNode,zb as DynamicTableBuilder,L as DynamicReferenceBuilder,qc as DynamicModule,Nc as DummyDriver,hc as DropViewNode,ic as DropViewBuilder,lc as DropTypeNode,mc as DropTypeBuilder,j as DropTableNode,ec as DropTableBuilder,i as DropSchemaNode,dc as DropSchemaBuilder,h as DropIndexNode,cc as DropIndexBuilder,Rb as DropConstraintNode,Eb as DropColumnNode,Oc as DialectAdapterBase,Ga as DeleteResult,ga as DeleteQueryNode,Ia as DeleteQueryBuilder,Kb as DefaultValueNode,sc as DefaultQueryExecutor,Lc as DefaultQueryCompiler,ta as DefaultInsertValueNode,rc as DefaultConnectionProvider,pd as DeduplicateJoinsPlugin,wb as DataTypeNode,Rc as DEFAULT_MIGRATION_TABLE,Sc as DEFAULT_MIGRATION_LOCK_TABLE,Tc as DEFAULT_ALLOW_UNORDERED_MIGRATIONS,fc as CreateViewNode,gc as CreateViewBuilder,jc as CreateTypeNode,kc as CreateTypeBuilder,f as CreateTableNode,bc as CreateTableBuilder,d as CreateSchemaNode,ac as CreateSchemaBuilder,c as CreateIndexNode,$b as CreateIndexBuilder,Fc as ControlledTransactionBuilder,Gc as ControlledTransaction,Dc as ConnectionBuilder,Mc as CompiledQuery,Ma as CommonTableExpressionNode,La as CommonTableExpressionNameNode,Hc as Command,ua as ColumnUpdateNode,I as ColumnNode,Db as ColumnDefinitionNode,Lb as ColumnDefinitionBuilder,P as CollateNode,Gb as CheckConstraintNode,yb as CastNode,pb as CaseWhenBuilder,ob as CaseThenBuilder,mb as CaseNode,qb as CaseEndBuilder,nb as CaseBuilder,od as CamelCasePlugin,v as COMPARISON_OPERATORS,u as BinaryOperationNode,y as BINARY_OPERATORS,db as AndWrapper,q as AndNode,Ub as AlteredColumnBuilder,a as AlterTableNode,_b as AlterTableColumnAlteringBuilder,Zb as AlterTableBuilder,Sb as AlterColumnNode,Tb as AlterColumnBuilder,ub as AliasedJSONPathBuilder,bb as AliasedExpressionWrapper,Ab as AliasedDynamicTableBuilder,jb as AliasedAggregateFunctionBuilder,k as AliasNode,gb as AggregateFunctionNode,ib as AggregateFunctionBuilder,Xb as AddIndexNode,Pb as AddConstraintNode,Cb as AddColumnNode,w as ARITHMETIC_OPERATORS};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as f}from"node:module";var i=Object.create,{getPrototypeOf:s,defineProperty:a,getOwnPropertyNames:v}=Object,m=Object.prototype.hasOwnProperty;function d(e){return this[e]}var g,c,j=(e,r,t)=>{var l=e!=null&&typeof e==="object";if(l){var u=r?g??=new WeakMap:c??=new WeakMap,p=u.get(e);if(p)return p}t=e!=null?i(s(e)):{};let o=r||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t;for(let n of v(e))if(!m.call(o,n))a(o,n,{get:d.bind(e,n),enumerable:!0});if(l)u.set(e,o);return o},x=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),y=(e)=>e;function O(e,r){this[e]=y.bind(null,r)}var w=(e,r)=>{for(var t in r)a(e,t,{get:r[t],enumerable:!0,configurable:!0,set:O.bind(r,t)})},P=f(import.meta.url);
|
|
2
|
+
export{j as Jg,x as Kg,w as Lg};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$e as b,Af as C,Bf as D,Cf as E,Df as F,Ef as G,Ff as H,Gf as I,Hf as J,If as K,Jf as L,Kf as M,Lf as N,_e as a,af as c,bf as d,cf as e,df as f,ef as g,ff as h,gf as i,hf as j,if as k,jf as l,kf as m,lf as n,mf as o,nf as p,of as q,pf as r,qf as s,rf as t,sf as u,tf as v,uf as w,vf as x,wf as y,xf as z,yf as A,zf as B}from"./chunk-7d48d71t.js";import"./chunk-nh11afw0.js";import"./chunk-mqm8wnc8.js";import"./chunk-ncaqgas1.js";import"./chunk-cbr2vrpt.js";import"./chunk-csn4vg3d.js";import"./chunk-9kbktaf8.js";import"./chunk-p6c1xbd5.js";import"./chunk-r133z8tq.js";import"./chunk-ge071wp4.js";import"./chunk-g2n6hnjp.js";import"./chunk-femf7e4d.js";import"./chunk-jbqqb1ht.js";import"./chunk-0pzpg2ra.js";import"./chunk-xtr6s7kh.js";import"./chunk-x17jyjan.js";export{L as validateAgentConfig,r as toStandardTool,K as parseAgentMd,u as listSkills,w as listMemories,M as isAgentMdContent,J as humanInTheLoopMiddleware,H as getAgentListFromPackage,q as fromLangChainTool,F as create_task_tool,G as createTaskTool,A as createMCPMiddleware,s as anthropicPromptCachingMiddleware,E as TaskSchema,I as SubAgentsMiddleware,C as SubAgentStateSchema,B as SubAgentSchema,D as SubAgentAnnotation,j as StandardAgent,v as SkillsMiddleware,a as ProviderTypeSchema,d as PromptVersionSchema,c as PromptSchema,b as ModelSchema,f as MiddlewareSchema,i as MiddlewareRegistry,e as MiddlewareCustomParamsSchema,p as MemoryStorage,z as MCPMiddleware,x as LoadMcpToolsSchema,y as ExecuteMcpToolSchema,N as ClaudeAgentLoader,o as BaseStorage,t as AgentsMdMiddleware,l as AgentValidator,m as AgentSerializer,g as AgentSchema,k as AgentRepository,h as AgentPackageSchema,n as AgentPackage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-x17jyjan.js";var V=((f)=>{return f.NETWORK_ERROR="NETWORK_ERROR",f.CONNECTION_TIMEOUT="CONNECTION_TIMEOUT",f.INTERNAL_ERROR="INTERNAL_ERROR",f.THREAD_NOT_FOUND="THREAD_NOT_FOUND",f.THREAD_BUSY="THREAD_BUSY",f.RUN_NOT_FOUND="RUN_NOT_FOUND",f.GRAPH_NOT_FOUND="GRAPH_NOT_FOUND",f.INVALID_REQUEST="INVALID_REQUEST",f})(V||{});class N extends Error{constructor(f,w,x){super(w);this.code=f,this.statusCode=x,this.name="RemoteApiError"}}async function O(f,w,x){try{let z=f;if(x?.query){let W=new URLSearchParams;Object.entries(x.query).forEach(([Z,_])=>{W.append(Z,String(_))}),z+=`?${W.toString()}`}let Q=await fetch(z,{method:w,headers:{"Content-Type":"application/json"},body:x?.body?JSON.stringify(x.body):void 0}),H=await Q.json();if(!Q.ok||!H.success)throw new N(H.error?.code||V.INTERNAL_ERROR,H.error?.message||"Unknown error",Q.status);return H}catch(z){if(z instanceof N)throw z;throw new N(V.NETWORK_ERROR,`Network error: ${z instanceof Error?z.message:"Unknown error"}`)}}async function J(f,w){return O(f,"GET",{query:w})}async function F(f,w,x){return O(f,"POST",{body:w,query:x})}async function Y(f,w,x){return O(f,"PUT",{body:w,query:x})}async function $(f,w){return O(f,"DELETE",{query:w})}class j{constructor(f,w){this.serverUrl=f,this.httpClient=w,this.serverUrl=f.replace(/\/$/,""),this.httpClient=w||fetch}async setup(){await F(`${this.serverUrl}/setup`)}async create(f){return(await F(`${this.serverUrl}/threads`,f)).data}async search(f){let w={};if(f?.ids!==void 0&&f.ids.length>0)w.ids=JSON.stringify(f.ids);if(f?.metadata!==void 0)w.metadata=JSON.stringify(f.metadata);if(f?.limit!==void 0)w.limit=f.limit;if(f?.offset!==void 0)w.offset=f.offset;if(f?.status!==void 0)w.status=f.status;if(f?.sortBy!==void 0)w.sortBy=f.sortBy;if(f?.sortOrder!==void 0)w.sortOrder=f.sortOrder;if(f?.values!==void 0)w.values=JSON.stringify(f.values);if(f?.select!==void 0)w.select=JSON.stringify(f.select);if(f?.withoutDetails!==void 0)w.withoutDetails=f.withoutDetails;return(await J(`${this.serverUrl}/threads`,w)).data}async get(f){return(await J(`${this.serverUrl}/threads/${f}`)).data}async set(f,w){await Y(`${this.serverUrl}/threads/${f}`,w)}async delete(f){await $(`${this.serverUrl}/threads/${f}`)}async updateState(f,w){return(await F(`${this.serverUrl}/threads/${f}/state`,w)).data}async createRun(f,w,x){return(await F(`${this.serverUrl}/threads/${f}/runs`,x||{},{assistantId:w})).data}async listRuns(f,w){let x={};if(w?.limit!==void 0)x.limit=w.limit;if(w?.offset!==void 0)x.offset=w.offset;if(w?.status!==void 0)x.status=w.status;return(await J(`${this.serverUrl}/threads/${f}/runs`,x)).data}async updateRun(f,w){await Y(`${this.serverUrl}/runs/${f}`,w)}async count(f){let w={};if(f?.ids!==void 0&&f.ids.length>0)w.ids=JSON.stringify(f.ids);if(f?.metadata!==void 0)w.metadata=JSON.stringify(f.metadata);if(f?.status!==void 0)w.status=f.status;if(f?.values!==void 0)w.values=JSON.stringify(f.values);return(await J(`${this.serverUrl}/threads/count`,w)).data}async patch(f,w){return(await F(`${this.serverUrl}/threads/${f}`,w)).data}async getState(f,w){let x={};if(w?.subgraphs!==void 0)x.subgraphs=w.subgraphs;if(w?.checkpointId!==void 0)x.checkpointId=w.checkpointId;return(await F(`${this.serverUrl}/threads/${f}/state`,x)).data}async getStateHistory(f,w){let x={};if(w?.limit!==void 0)x.limit=w.limit;if(w?.before!==void 0)x.before=w.before;return(await F(`${this.serverUrl}/threads/${f}/history`,x)).data}async copy(f){return(await F(`${this.serverUrl}/threads/${f}/copy`)).data}async setTitleIfNull(f,w){try{return(await F(`${this.serverUrl}/threads/${f}/title`,{title:w})).data.success}catch(x){let z=await this.get(f);if(z?.title===null||z?.title===void 0)return await this.set(f,{title:w}),!0;return!1}}}export{j as RemoteKyselyThreadsManager};
|