@maincode-ai/matilda-code 0.21.2 → 0.21.3-nightly.20260904.5d9ffd0a1
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/README.md +7 -0
- package/chunks/{agent-B4THN25M.js → agent-TVHA32GK.js} +1 -1
- package/chunks/{agent-headless-CR55Q5QA.js → agent-headless-X55KH44N.js} +1 -1
- package/chunks/{anthropicContentGenerator-GW3P6NLQ.js → anthropicContentGenerator-EFVV6ZTA.js} +1 -1
- package/chunks/{chunk-MAQJCFZU.js → chunk-4PSJRPDD.js} +526 -517
- package/chunks/{chunk-JEDNTIM3.js → chunk-5XXCSRLC.js} +1 -1
- package/chunks/{chunk-CFBZKYFB.js → chunk-6QP5C76Y.js} +52 -52
- package/chunks/{chunk-NUJ63BIE.js → chunk-ASUYFPBP.js} +1 -1
- package/chunks/{chunk-GIIMOLLN.js → chunk-C2ZWB2NT.js} +1 -1
- package/chunks/{chunk-M3G4PG2T.js → chunk-EFZRQMHP.js} +15 -15
- package/chunks/{chunk-SS5WUOSJ.js → chunk-FT76AZPN.js} +1 -1
- package/chunks/chunk-MJEXA2MA.js +8 -0
- package/chunks/chunk-MTMU7JYZ.js +11 -0
- package/chunks/chunk-SDTWBD62.js +8 -0
- package/chunks/{chunk-QEUJHX22.js → chunk-U7RTVF3B.js} +13 -13
- package/chunks/chunk-XF6LOHQN.js +108 -0
- package/chunks/{computer-use-STZBQBFP.js → computer-use-CLYL4ARA.js} +1 -1
- package/chunks/{contextCommand-LB5MHXJY.js → contextCommand-YP4QR5BY.js} +1 -1
- package/chunks/edit-GWHSJ6AS.js +39 -0
- package/chunks/{enter-worktree-V6TA7IPP.js → enter-worktree-KY7VH2ET.js} +1 -1
- package/chunks/{enterPlanMode-KQCLOC2K.js → enterPlanMode-HPGWQNUC.js} +1 -1
- package/chunks/{exit-worktree-B3SWF6PM.js → exit-worktree-YZUMK44D.js} +1 -1
- package/chunks/{exitPlanMode-7OHF37SX.js → exitPlanMode-5H75VMWO.js} +1 -1
- package/chunks/{geminiContentGenerator-6VRAJ3BI.js → geminiContentGenerator-5JOLLSMY.js} +1 -1
- package/chunks/{glob-ZAZPTZD5.js → glob-YJA47R2V.js} +1 -1
- package/chunks/{grep-DNYRXQWA.js → grep-BER26HYO.js} +1 -1
- package/chunks/{matildaAgentContentGenerator-S26H4H3W.js → matildaAgentContentGenerator-E7W4FOVL.js} +10 -10
- package/chunks/{matildaContentGenerator-UFATU4UK.js → matildaContentGenerator-PFRHHWYA.js} +1 -1
- package/chunks/{monitor-HQXCJQ3M.js → monitor-WPVU645X.js} +1 -1
- package/chunks/notebook-edit-B5RQKQ2X.js +17 -0
- package/chunks/{openaiContentGenerator-XAPZXISY.js → openaiContentGenerator-NEPOGUJL.js} +1 -1
- package/chunks/{read-file-HEVXSNSO.js → read-file-URGJTANM.js} +1 -1
- package/chunks/{ripGrep-BNBRX7HQ.js → ripGrep-AAUJPWGU.js} +1 -1
- package/chunks/{scheduler-3K7OROFK.js → scheduler-GGNU67Z4.js} +1 -1
- package/chunks/{serve-MBVRWSOA.js → serve-M76B2F3W.js} +7 -7
- package/chunks/{shell-3YF6VEDO.js → shell-E3PQ5M5Q.js} +1 -1
- package/chunks/{skill-4GKPLUND.js → skill-6564NE3I.js} +1 -1
- package/chunks/src-MVWQHOUB.js +3 -0
- package/chunks/{symbol-search-WVNUJRET.js → symbol-search-3A66G4MP.js} +1 -1
- package/chunks/{team-create-2LLJKRSY.js → team-create-4EAGRIJ2.js} +1 -1
- package/chunks/{tool-search-47TA6SG4.js → tool-search-7D46IF5G.js} +1 -1
- package/chunks/{update-goal-6WDBMJ2I.js → update-goal-EUJYH23K.js} +1 -1
- package/chunks/{web-fetch-QP42GV23.js → web-fetch-UGTFUOQN.js} +1 -1
- package/chunks/{workflow-EIZTKOPX.js → workflow-GVYJBNNP.js} +2 -2
- package/chunks/write-file-MHVLN44P.js +15 -0
- package/cli.js +443 -444
- package/package.json +2 -2
- package/sandbox-macos-restrictive-open.sb +22 -2
- package/chunks/chunk-I55PXD4N.js +0 -10
- package/chunks/chunk-KFULPF66.js +0 -107
- package/chunks/chunk-OCXGNAAT.js +0 -8
- package/chunks/chunk-RBG4ERTN.js +0 -11
- package/chunks/chunk-XJDC3ZQZ.js +0 -8
- package/chunks/edit-EP7HIW5W.js +0 -39
- package/chunks/notebook-edit-S63FQCCF.js +0 -17
- package/chunks/src-4XJIGVTS.js +0 -3
- package/chunks/write-file-YT7UT6TX.js +0 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{k as C}from"./chunk-
|
|
3
|
+
import{k as C}from"./chunk-SDTWBD62.js";import{Y as p}from"./chunk-QWBNNEV2.js";import{b as g}from"./chunk-GZPNIYVZ.js";g();var u=new Map;function ge(e,t){return e===t?!0:!e||!t?!1:_(e)===_(t)}function _(e){let t={};for(let n of Object.keys(e).sort()){let o=e[n];o!==void 0&&(t[n]=o)}return JSON.stringify(t)}function v(e){return u.get(e)}function I(e,t){u.set(e,t)}function R(e){let t=u.get(e);return u.delete(e),t}function L(e,t){let n=u.get(e);if(!n)return;let o={...n,iterations:n.iterations+1,lastReason:t};return u.set(e,o),o}function fe(e,t,n){let o=u.get(e);if(!o)return;let i={...o,status:t,statusNote:t==="active"?void 0:n?.trim()||o.statusNote};return t==="active"&&delete i.statusNote,u.set(e,i),i}function M(e){return e.status??"active"}function pe(){u.clear(),b.clear(),k.clear()}var b=new Map;function me(e,t){b.set(e,t)}function w(e){b.delete(e)}function N(e,t){K(e,t);let n=b.get(e);if(n)try{n(t)}catch{}}var k=new Map;function K(e,t){k.set(e,t)}function ye(e){return k.get(e)}function Ge(e,t){if(!t){k.delete(e);return}k.set(e,t)}g();g();var A=p("ERROR_REPORT");async function j(e,t,n,o="general"){let i;e instanceof Error?i={message:e.message,stack:e.stack}:typeof e=="object"&&e!==null&&"message"in e?i={message:String(e.message)}:i={message:String(e)};let r={error:i};n&&(r.context=n);let s=`${t} [${o}]`,c;try{c=JSON.stringify(r,null,2)}catch(l){A.error(`${s} Could not stringify report content (likely due to context):`,l,e);try{c=JSON.stringify({error:i},null,2),A.error(s,c)}catch(f){A.error(`${s} Failed to stringify minimal error report:`,f,e)}return}A.error(s,c)}var h=p("GOAL_JUDGE"),q=`You are evaluating a stop-condition hook in an autonomous coding agent.
|
|
4
4
|
Read the conversation transcript above carefully, then judge whether the
|
|
5
5
|
user-provided condition is satisfied.
|
|
6
6
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{w as i}from"./chunk-UY2R3ZQ4.js";import{b as o}from"./chunk-GZPNIYVZ.js";o();import l from"node:path";function d(t,n){if(t.getApprovalMode()!=="bogan")return null;let r=l.resolve(n),s=t.getProjectRoot?.()??t.getTargetDir();if(i(r,s))return null;let e=t.getWorkspaceContext?.();if(!e||(typeof e.isPathWithinWorkspaceFresh=="function"?e.isPathWithinWorkspaceFresh(r):e.isPathWithinWorkspace(r)))return null;let a=e.getDirectories?.()??[t.getTargetDir()],p=t.getChannel?.()==="desktop"?"Approve the folder from Matilda Desktop, then retry the write.":"Use --include-directories to add extra roots, or a non-BOGAN approval mode for intentional external writes.";return`Refusing out-of-workspace write in BOGAN mode: ${r}. Workspace root(s): ${a.join(", ")}. This blocks path typos (e.g. writing under $HOME when the project is elsewhere). `+p}export{d as a};
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2025 Matilda Team
|
|
7
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{b as g}from"./chunk-GZPNIYVZ.js";import{a as re,d as I,e as Rn,f as ut}from"./chunk-OWGSC52X.js";var ft=I(Y=>{"use strict";g();Object.defineProperty(Y,"__esModule",{value:!0});Y.normalizePath=Y.isRootDirectory=Y.convertSlashes=Y.cleanPath=void 0;var at=re("path");function Ut(e){let t=(0,at.normalize)(e);return t.length>1&&t[t.length-1]===at.sep&&(t=t.substring(0,t.length-1)),t}Y.cleanPath=Ut;var An=/[\\/]/g;function Qt(e,t){return e.replace(An,t)}Y.convertSlashes=Qt;var En=/^[a-z]:[\\/]$/i;function Sn(e){return e==="/"||En.test(e)}Y.isRootDirectory=Sn;function xn(e,t){let{resolvePaths:r,normalizePath:n,pathSeparator:s}=t,i=process.platform==="win32"&&e.includes("/")||e.startsWith(".");if(r&&(e=(0,at.resolve)(e)),(n||i)&&(e=Ut(e)),e===".")return"";let c=e[e.length-1]!==s;return Qt(c?e+s:e,s)}Y.normalizePath=xn});var Yt=I(le=>{"use strict";g();Object.defineProperty(le,"__esModule",{value:!0});le.build=le.joinDirectoryPath=le.joinPathWithBasePath=void 0;var Cn=re("path"),wn=ft();function Vt(e,t){return t+e}le.joinPathWithBasePath=Vt;function vn(e,t){return function(r,n){return n.startsWith(e)?n.replace(e,"")+r:(0,wn.convertSlashes)((0,Cn.relative)(e,n),t.pathSeparator)+t.pathSeparator+r}}function $n(e){return e}function Pn(e,t,r){return t+e+r}le.joinDirectoryPath=Pn;function Tn(e,t){let{relativePaths:r,includeBasePath:n}=t;return r&&e?vn(e,t):n?Vt:$n}le.build=Tn});var Zt=I(ke=>{"use strict";g();Object.defineProperty(ke,"__esModule",{value:!0});ke.build=void 0;function On(e){return function(t,r){r.push(t.substring(e.length)||".")}}function Ln(e){return function(t,r,n){let s=t.substring(e.length)||".";n.every(i=>i(s,!0))&&r.push(s)}}var Fn=(e,t)=>{t.push(e||".")},Dn=(e,t,r)=>{let n=e||".";r.every(s=>s(n,!0))&&t.push(n)},kn=()=>{};function Hn(e,t){let{includeDirs:r,filters:n,relativePaths:s}=t;return r?s?n&&n.length?Ln(e):On(e):n&&n.length?Dn:Fn:kn}ke.build=Hn});var Jt=I(He=>{"use strict";g();Object.defineProperty(He,"__esModule",{value:!0});He.build=void 0;var In=(e,t,r,n)=>{n.every(s=>s(e,!1))&&r.files++},Mn=(e,t,r,n)=>{n.every(s=>s(e,!1))&&t.push(e)},Nn=(e,t,r,n)=>{r.files++},Gn=(e,t)=>{t.push(e)},jn=()=>{};function Bn(e){let{excludeFiles:t,filters:r,onlyCounts:n}=e;return t?jn:r&&r.length?n?In:Mn:n?Nn:Gn}He.build=Bn});var er=I(Ie=>{"use strict";g();Object.defineProperty(Ie,"__esModule",{value:!0});Ie.build=void 0;var qn=e=>e,Wn=()=>[""].slice(0,0);function Xn(e){return e.group?Wn:qn}Ie.build=Xn});var tr=I(Me=>{"use strict";g();Object.defineProperty(Me,"__esModule",{value:!0});Me.build=void 0;var zn=(e,t,r)=>{e.push({directory:t,files:r,dir:t})},Kn=()=>{};function Un(e){return e.group?zn:Kn}Me.build=Un});var sr=I(pe=>{"use strict";g();var Qn=pe&&pe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pe,"__esModule",{value:!0});pe.build=void 0;var Ne=Qn(re("fs")),rr=re("path"),Vn=function(e,t,r){let{queue:n,options:{suppressErrors:s}}=t;n.enqueue(),Ne.default.realpath(e,(i,c)=>{if(i)return n.dequeue(s?null:i,t);Ne.default.stat(c,(a,h)=>{if(a)return n.dequeue(s?null:a,t);if(h.isDirectory()&&nr(e,c,t))return n.dequeue(null,t);r(h,c),n.dequeue(null,t)})})},Yn=function(e,t,r){let{queue:n,options:{suppressErrors:s}}=t;n.enqueue();try{let i=Ne.default.realpathSync(e),c=Ne.default.statSync(i);if(c.isDirectory()&&nr(e,i,t))return;r(c,i)}catch(i){if(!s)throw i}};function Zn(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?Yn:Vn}pe.build=Zn;function nr(e,t,r){if(r.options.useRealPaths)return Jn(t,r);let n=(0,rr.dirname)(e),s=1;for(;n!==r.root&&s<2;){let i=r.symlinks.get(n);!!i&&(i===t||i.startsWith(t)||t.startsWith(i))?s++:n=(0,rr.dirname)(n)}return r.symlinks.set(e,t),s>1}function Jn(e,t){return t.visited.includes(e+t.options.pathSeparator)}});var ir=I(je=>{"use strict";g();Object.defineProperty(je,"__esModule",{value:!0});je.build=void 0;var es=e=>e.counts,ts=e=>e.groups,rs=e=>e.paths,ns=e=>e.paths.slice(0,e.options.maxFiles),ss=(e,t,r)=>(Ge(t,r,e.counts,e.options.suppressErrors),null),is=(e,t,r)=>(Ge(t,r,e.paths,e.options.suppressErrors),null),os=(e,t,r)=>(Ge(t,r,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),us=(e,t,r)=>(Ge(t,r,e.groups,e.options.suppressErrors),null);function Ge(e,t,r,n){t(e&&!n?e:null,r)}function ls(e,t){let{onlyCounts:r,group:n,maxFiles:s}=e;return r?t?es:ss:n?t?ts:us:s?t?ns:os:t?rs:is}je.build=ls});var lr=I(ge=>{"use strict";g();var cs=ge&&ge.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ge,"__esModule",{value:!0});ge.build=void 0;var or=cs(re("fs")),ur={withFileTypes:!0},as=(e,t,r,n,s)=>{if(e.queue.enqueue(),n<0)return e.queue.dequeue(null,e);e.visited.push(t),e.counts.directories++,or.default.readdir(t||".",ur,(i,c=[])=>{s(c,r,n),e.queue.dequeue(e.options.suppressErrors?null:i,e)})},fs=(e,t,r,n,s)=>{if(n<0)return;e.visited.push(t),e.counts.directories++;let i=[];try{i=or.default.readdirSync(t||".",ur)}catch(c){if(!e.options.suppressErrors)throw c}s(i,r,n)};function hs(e){return e?fs:as}ge.build=hs});var cr=I(Be=>{"use strict";g();Object.defineProperty(Be,"__esModule",{value:!0});Be.Queue=void 0;var ht=class{onQueueEmpty;count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,r){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,r),t&&(r.controller.abort(),this.onQueueEmpty=void 0))}};Be.Queue=ht});var ar=I(qe=>{"use strict";g();Object.defineProperty(qe,"__esModule",{value:!0});qe.Counter=void 0;var dt=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}};qe.Counter=dt});var _t=I(Z=>{"use strict";g();var ds=Z&&Z.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),ps=Z&&Z.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ce=Z&&Z.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&ds(t,e,r);return ps(t,e),t};Object.defineProperty(Z,"__esModule",{value:!0});Z.Walker=void 0;var fr=re("path"),We=ft(),pt=ce(Yt()),gs=ce(Zt()),_s=ce(Jt()),bs=ce(er()),Rs=ce(tr()),ms=ce(sr()),ys=ce(ir()),As=ce(lr()),Es=cr(),Ss=ar(),gt=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,r,n){this.isSynchronous=!n,this.callbackInvoker=ys.build(r,this.isSynchronous),this.root=(0,We.normalizePath)(t,r),this.state={root:(0,We.isRootDirectory)(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new Ss.Counter,options:r,queue:new Es.Queue((s,i)=>this.callbackInvoker(i,s,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new AbortController},this.joinPath=pt.build(this.root,r),this.pushDirectory=gs.build(this.root,r),this.pushFile=_s.build(r),this.getArray=bs.build(r),this.groupFiles=Rs.build(r),this.resolveSymlink=ms.build(r,this.isSynchronous),this.walkDirectory=As.build(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,r,n)=>{let{paths:s,options:{filters:i,resolveSymlinks:c,excludeSymlinks:a,exclude:h,maxFiles:d,signal:b,useRealPaths:E,pathSeparator:S},controller:D}=this.state;if(D.signal.aborted||b&&b.aborted||d&&s.length>d)return;let R=this.getArray(this.state.paths);for(let y=0;y<t.length;++y){let $=t[y];if($.isFile()||$.isSymbolicLink()&&!c&&!a){let C=this.joinPath($.name,r);this.pushFile(C,R,this.state.counts,i)}else if($.isDirectory()){let C=pt.joinDirectoryPath($.name,r,this.state.options.pathSeparator);if(h&&h($.name,C))continue;this.pushDirectory(C,s,i),this.walkDirectory(this.state,C,C,n-1,this.walk)}else if(this.resolveSymlink&&$.isSymbolicLink()){let C=pt.joinPathWithBasePath($.name,r);this.resolveSymlink(C,this.state,(v,L)=>{if(v.isDirectory()){if(L=(0,We.normalizePath)(L,this.state.options),h&&h($.name,E?L:C+S))return;this.walkDirectory(this.state,L,E?L:C+S,n-1,this.walk)}else{L=E?L:C;let W=(0,fr.basename)(L),A=(0,We.normalizePath)((0,fr.dirname)(L),this.state.options);L=this.joinPath(W,A),this.pushFile(L,R,this.state.counts,i)}})}}this.groupFiles(this.state.groups,r,R)}};Z.Walker=gt});var dr=I(_e=>{"use strict";g();Object.defineProperty(_e,"__esModule",{value:!0});_e.callback=_e.promise=void 0;var xs=_t();function Cs(e,t){return new Promise((r,n)=>{hr(e,t,(s,i)=>{if(s)return n(s);r(i)})})}_e.promise=Cs;function hr(e,t,r){new xs.Walker(e,t,r).start()}_e.callback=hr});var pr=I(Xe=>{"use strict";g();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.sync=void 0;var ws=_t();function vs(e,t){return new ws.Walker(e,t).start()}Xe.sync=vs});var _r=I(ze=>{"use strict";g();Object.defineProperty(ze,"__esModule",{value:!0});ze.APIBuilder=void 0;var gr=dr(),$s=pr(),bt=class{root;options;constructor(t,r){this.root=t,this.options=r}withPromise(){return(0,gr.promise)(this.root,this.options)}withCallback(t){(0,gr.callback)(this.root,this.options,t)}sync(){return(0,$s.sync)(this.root,this.options)}};ze.APIBuilder=bt});var Ee=I((Do,Ar)=>{"use strict";g();var J="\\\\/",br=`[^${J}]`,ne="\\.",Ps="\\+",Ts="\\?",Ke="\\/",Os="(?=.)",Rr="[^/]",Rt=`(?:${Ke}|$)`,mr=`(?:^|${Ke})`,mt=`${ne}{1,2}${Rt}`,Ls=`(?!${ne})`,Fs=`(?!${mr}${mt})`,Ds=`(?!${ne}{0,1}${Rt})`,ks=`(?!${mt})`,Hs=`[^.${Ke}]`,Is=`${Rr}*?`,Ms="/",yr={DOT_LITERAL:ne,PLUS_LITERAL:Ps,QMARK_LITERAL:Ts,SLASH_LITERAL:Ke,ONE_CHAR:Os,QMARK:Rr,END_ANCHOR:Rt,DOTS_SLASH:mt,NO_DOT:Ls,NO_DOTS:Fs,NO_DOT_SLASH:Ds,NO_DOTS_SLASH:ks,QMARK_NO_DOT:Hs,STAR:Is,START_ANCHOR:mr,SEP:Ms},Ns={...yr,SLASH_LITERAL:`[${J}]`,QMARK:br,STAR:`${br}*?`,DOTS_SLASH:`${ne}{1,2}(?:[${J}]|$)`,NO_DOT:`(?!${ne})`,NO_DOTS:`(?!(?:^|[${J}])${ne}{1,2}(?:[${J}]|$))`,NO_DOT_SLASH:`(?!${ne}{0,1}(?:[${J}]|$))`,NO_DOTS_SLASH:`(?!${ne}{1,2}(?:[${J}]|$))`,QMARK_NO_DOT:`[^.${J}]`,START_ANCHOR:`(?:^|[${J}])`,END_ANCHOR:`(?:[${J}]|$)`,SEP:"\\"},Gs={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"};Ar.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Gs,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:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},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,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Ns:yr}}});var Se=I(K=>{"use strict";g();var{REGEX_BACKSLASH:js,REGEX_REMOVE_BACKSLASH:Bs,REGEX_SPECIAL_CHARS:qs,REGEX_SPECIAL_CHARS_GLOBAL:Ws}=Ee();K.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);K.hasRegexChars=e=>qs.test(e);K.isRegexChar=e=>e.length===1&&K.hasRegexChars(e);K.escapeRegex=e=>e.replace(Ws,"\\$1");K.toPosixSlashes=e=>e.replace(js,"/");K.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let e=navigator.platform.toLowerCase();return e==="win32"||e==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};K.removeBackslashes=e=>e.replace(Bs,t=>t==="\\"?"":t);K.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?K.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};K.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};K.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${e})${s}`;return t.negated===!0&&(i=`(?:^(?!${i}).*$)`),i};K.basename=(e,{windows:t}={})=>{let r=e.split(t?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var Pr=I((Mo,$r)=>{"use strict";g();var Er=Se(),{CHAR_ASTERISK:yt,CHAR_AT:Xs,CHAR_BACKWARD_SLASH:xe,CHAR_COMMA:zs,CHAR_DOT:At,CHAR_EXCLAMATION_MARK:Et,CHAR_FORWARD_SLASH:vr,CHAR_LEFT_CURLY_BRACE:St,CHAR_LEFT_PARENTHESES:xt,CHAR_LEFT_SQUARE_BRACKET:Ks,CHAR_PLUS:Us,CHAR_QUESTION_MARK:Sr,CHAR_RIGHT_CURLY_BRACE:Qs,CHAR_RIGHT_PARENTHESES:xr,CHAR_RIGHT_SQUARE_BRACKET:Vs}=Ee(),Cr=e=>e===vr||e===xe,wr=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},Ys=(e,t)=>{let r=t||{},n=e.length-1,s=r.parts===!0||r.scanToEnd===!0,i=[],c=[],a=[],h=e,d=-1,b=0,E=0,S=!1,D=!1,R=!1,y=!1,$=!1,C=!1,v=!1,L=!1,W=!1,A=!1,P=0,F,m,_={value:"",depth:0,isGlob:!1},o=()=>d>=n,B=()=>h.charCodeAt(d+1),M=()=>(F=m,h.charCodeAt(++d));for(;d<n;){m=M();let T;if(m===xe){v=_.backslashes=!0,m=M(),m===St&&(C=!0);continue}if(C===!0||m===St){for(P++;o()!==!0&&(m=M());){if(m===xe){v=_.backslashes=!0,M();continue}if(m===St){P++;continue}if(C!==!0&&m===At&&(m=M())===At){if(S=_.isBrace=!0,R=_.isGlob=!0,A=!0,s===!0)continue;break}if(C!==!0&&m===zs){if(S=_.isBrace=!0,R=_.isGlob=!0,A=!0,s===!0)continue;break}if(m===Qs&&(P--,P===0)){C=!1,S=_.isBrace=!0,A=!0;break}}if(s===!0)continue;break}if(m===vr){if(i.push(d),c.push(_),_={value:"",depth:0,isGlob:!1},A===!0)continue;if(F===At&&d===b+1){b+=2;continue}E=d+1;continue}if(r.noext!==!0&&(m===Us||m===Xs||m===yt||m===Sr||m===Et)===!0&&B()===xt){if(R=_.isGlob=!0,y=_.isExtglob=!0,A=!0,m===Et&&d===b&&(W=!0),s===!0){for(;o()!==!0&&(m=M());){if(m===xe){v=_.backslashes=!0,m=M();continue}if(m===xr){R=_.isGlob=!0,A=!0;break}}continue}break}if(m===yt){if(F===yt&&($=_.isGlobstar=!0),R=_.isGlob=!0,A=!0,s===!0)continue;break}if(m===Sr){if(R=_.isGlob=!0,A=!0,s===!0)continue;break}if(m===Ks){for(;o()!==!0&&(T=M());){if(T===xe){v=_.backslashes=!0,M();continue}if(T===Vs){D=_.isBracket=!0,R=_.isGlob=!0,A=!0;break}}if(s===!0)continue;break}if(r.nonegate!==!0&&m===Et&&d===b){L=_.negated=!0,b++;continue}if(r.noparen!==!0&&m===xt){if(R=_.isGlob=!0,s===!0){for(;o()!==!0&&(m=M());){if(m===xt){v=_.backslashes=!0,m=M();continue}if(m===xr){A=!0;break}}continue}break}if(R===!0){if(A=!0,s===!0)continue;break}}r.noext===!0&&(y=!1,R=!1);let k=h,u="",l="";b>0&&(u=h.slice(0,b),h=h.slice(b),E-=b),k&&R===!0&&E>0?(k=h.slice(0,E),l=h.slice(E)):R===!0?(k="",l=h):k=h,k&&k!==""&&k!=="/"&&k!==h&&Cr(k.charCodeAt(k.length-1))&&(k=k.slice(0,-1)),r.unescape===!0&&(l&&(l=Er.removeBackslashes(l)),k&&v===!0&&(k=Er.removeBackslashes(k)));let U={prefix:u,input:e,start:b,base:k,glob:l,isBrace:S,isBracket:D,isGlob:R,isExtglob:y,isGlobstar:$,negated:L,negatedExtglob:W};if(r.tokens===!0&&(U.maxDepth=0,Cr(m)||c.push(_),U.tokens=c),r.parts===!0||r.tokens===!0){let T;for(let N=0;N<i.length;N++){let te=T?T+1:b,Q=i[N],ue=e.slice(te,Q);r.tokens&&(N===0&&b!==0?(c[N].isPrefix=!0,c[N].value=u):c[N].value=ue,wr(c[N]),U.maxDepth+=c[N].depth),(N!==0||ue!=="")&&a.push(ue),T=Q}if(T&&T+1<e.length){let N=e.slice(T+1);a.push(N),r.tokens&&(c[c.length-1].value=N,wr(c[c.length-1]),U.maxDepth+=c[c.length-1].depth)}U.slashes=i,U.parts=a}return U};$r.exports=Ys});var Lr=I((Go,Or)=>{"use strict";g();var Ue=Ee(),ee=Se(),{MAX_LENGTH:Qe,POSIX_REGEX_SOURCE:Zs,REGEX_NON_SPECIAL_CHARS:Js,REGEX_SPECIAL_CHARS_BACKREF:ei,REPLACEMENTS:Tr}=Ue,ti=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch{return e.map(s=>ee.escapeRegex(s)).join("..")}return r},be=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Ct=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=Tr[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(Qe,r.maxLength):Qe,s=e.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},c=[i],a=r.capture?"":"?:",h=Ue.globChars(r.windows),d=Ue.extglobChars(h),{DOT_LITERAL:b,PLUS_LITERAL:E,SLASH_LITERAL:S,ONE_CHAR:D,DOTS_SLASH:R,NO_DOT:y,NO_DOT_SLASH:$,NO_DOTS_SLASH:C,QMARK:v,QMARK_NO_DOT:L,STAR:W,START_ANCHOR:A}=h,P=p=>`(${a}(?:(?!${A}${p.dot?R:b}).)*?)`,F=r.dot?"":y,m=r.dot?v:L,_=r.bash===!0?P(r):W;r.capture&&(_=`(${_})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let o={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:c};e=ee.removePrefix(e,o),s=e.length;let B=[],M=[],k=[],u=i,l,U=()=>o.index===s-1,T=o.peek=(p=1)=>e[o.index+p],N=o.advance=()=>e[++o.index]||"",te=()=>e.slice(o.index+1),Q=(p="",H=0)=>{o.consumed+=p,o.index+=H},ue=p=>{o.output+=p.output!=null?p.output:p.value,Q(p.value)},_n=()=>{let p=1;for(;T()==="!"&&(T(2)!=="("||T(3)==="?");)N(),o.start++,p++;return p%2===0?!1:(o.negated=!0,o.start++,!0)},Le=p=>{o[p]++,k.push(p)},fe=p=>{o[p]--,k.pop()},w=p=>{if(u.type==="globstar"){let H=o.braces>0&&(p.type==="comma"||p.type==="brace"),f=p.extglob===!0||B.length&&(p.type==="pipe"||p.type==="paren");p.type!=="slash"&&p.type!=="paren"&&!H&&!f&&(o.output=o.output.slice(0,-u.output.length),u.type="star",u.value="*",u.output=_,o.output+=u.output)}if(B.length&&p.type!=="paren"&&(B[B.length-1].inner+=p.value),(p.value||p.output)&&ue(p),u&&u.type==="text"&&p.type==="text"){u.output=(u.output||u.value)+p.value,u.value+=p.value;return}p.prev=u,c.push(p),u=p},Fe=(p,H)=>{let f={...d[H],conditions:1,inner:""};f.prev=u,f.parens=o.parens,f.output=o.output;let x=(r.capture?"(":"")+f.open;Le("parens"),w({type:p,value:H,output:o.output?"":D}),w({type:"paren",extglob:!0,value:N(),output:x}),B.push(f)},bn=p=>{let H=p.close+(r.capture?")":""),f;if(p.type==="negate"){let x=_;if(p.inner&&p.inner.length>1&&p.inner.includes("/")&&(x=P(r)),(x!==_||U()||/^\)+$/.test(te()))&&(H=p.close=`)$))${x}`),p.inner.includes("*")&&(f=te())&&/^\.[^\\/.]+$/.test(f)){let G=Ct(f,{...t,fastpaths:!1}).output;H=p.close=`)${G})${x})`}p.prev.type==="bos"&&(o.negatedExtglob=!0)}w({type:"paren",extglob:!0,value:l,output:H}),fe("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let p=!1,H=e.replace(ei,(f,x,G,z,q,ot)=>z==="\\"?(p=!0,f):z==="?"?x?x+z+(q?v.repeat(q.length):""):ot===0?m+(q?v.repeat(q.length):""):v.repeat(G.length):z==="."?b.repeat(G.length):z==="*"?x?x+z+(q?_:""):_:x?f:`\\${f}`);return p===!0&&(r.unescape===!0?H=H.replace(/\\/g,""):H=H.replace(/\\+/g,f=>f.length%2===0?"\\\\":f?"\\":"")),H===e&&r.contains===!0?(o.output=e,o):(o.output=ee.wrapOutput(H,o,t),o)}for(;!U();){if(l=N(),l==="\0")continue;if(l==="\\"){let f=T();if(f==="/"&&r.bash!==!0||f==="."||f===";")continue;if(!f){l+="\\",w({type:"text",value:l});continue}let x=/^\\+/.exec(te()),G=0;if(x&&x[0].length>2&&(G=x[0].length,o.index+=G,G%2!==0&&(l+="\\")),r.unescape===!0?l=N():l+=N(),o.brackets===0){w({type:"text",value:l});continue}}if(o.brackets>0&&(l!=="]"||u.value==="["||u.value==="[^")){if(r.posix!==!1&&l===":"){let f=u.value.slice(1);if(f.includes("[")&&(u.posix=!0,f.includes(":"))){let x=u.value.lastIndexOf("["),G=u.value.slice(0,x),z=u.value.slice(x+2),q=Zs[z];if(q){u.value=G+q,o.backtrack=!0,N(),!i.output&&c.indexOf(u)===1&&(i.output=D);continue}}}(l==="["&&T()!==":"||l==="-"&&T()==="]")&&(l=`\\${l}`),l==="]"&&(u.value==="["||u.value==="[^")&&(l=`\\${l}`),r.posix===!0&&l==="!"&&u.value==="["&&(l="^"),u.value+=l,ue({value:l});continue}if(o.quotes===1&&l!=='"'){l=ee.escapeRegex(l),u.value+=l,ue({value:l});continue}if(l==='"'){o.quotes=o.quotes===1?0:1,r.keepQuotes===!0&&w({type:"text",value:l});continue}if(l==="("){Le("parens"),w({type:"paren",value:l});continue}if(l===")"){if(o.parens===0&&r.strictBrackets===!0)throw new SyntaxError(be("opening","("));let f=B[B.length-1];if(f&&o.parens===f.parens+1){bn(B.pop());continue}w({type:"paren",value:l,output:o.parens?")":"\\)"}),fe("parens");continue}if(l==="["){if(r.nobracket===!0||!te().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(be("closing","]"));l=`\\${l}`}else Le("brackets");w({type:"bracket",value:l});continue}if(l==="]"){if(r.nobracket===!0||u&&u.type==="bracket"&&u.value.length===1){w({type:"text",value:l,output:`\\${l}`});continue}if(o.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(be("opening","["));w({type:"text",value:l,output:`\\${l}`});continue}fe("brackets");let f=u.value.slice(1);if(u.posix!==!0&&f[0]==="^"&&!f.includes("/")&&(l=`/${l}`),u.value+=l,ue({value:l}),r.literalBrackets===!1||ee.hasRegexChars(f))continue;let x=ee.escapeRegex(u.value);if(o.output=o.output.slice(0,-u.value.length),r.literalBrackets===!0){o.output+=x,u.value=x;continue}u.value=`(${a}${x}|${u.value})`,o.output+=u.value;continue}if(l==="{"&&r.nobrace!==!0){Le("braces");let f={type:"brace",value:l,output:"(",outputIndex:o.output.length,tokensIndex:o.tokens.length};M.push(f),w(f);continue}if(l==="}"){let f=M[M.length-1];if(r.nobrace===!0||!f){w({type:"text",value:l,output:l});continue}let x=")";if(f.dots===!0){let G=c.slice(),z=[];for(let q=G.length-1;q>=0&&(c.pop(),G[q].type!=="brace");q--)G[q].type!=="dots"&&z.unshift(G[q].value);x=ti(z,r),o.backtrack=!0}if(f.comma!==!0&&f.dots!==!0){let G=o.output.slice(0,f.outputIndex),z=o.tokens.slice(f.tokensIndex);f.value=f.output="\\{",l=x="\\}",o.output=G;for(let q of z)o.output+=q.output||q.value}w({type:"brace",value:l,output:x}),fe("braces"),M.pop();continue}if(l==="|"){B.length>0&&B[B.length-1].conditions++,w({type:"text",value:l});continue}if(l===","){let f=l,x=M[M.length-1];x&&k[k.length-1]==="braces"&&(x.comma=!0,f="|"),w({type:"comma",value:l,output:f});continue}if(l==="/"){if(u.type==="dot"&&o.index===o.start+1){o.start=o.index+1,o.consumed="",o.output="",c.pop(),u=i;continue}w({type:"slash",value:l,output:S});continue}if(l==="."){if(o.braces>0&&u.type==="dot"){u.value==="."&&(u.output=b);let f=M[M.length-1];u.type="dots",u.output+=l,u.value+=l,f.dots=!0;continue}if(o.braces+o.parens===0&&u.type!=="bos"&&u.type!=="slash"){w({type:"text",value:l,output:b});continue}w({type:"dot",value:l,output:b});continue}if(l==="?"){if(!(u&&u.value==="(")&&r.noextglob!==!0&&T()==="("&&T(2)!=="?"){Fe("qmark",l);continue}if(u&&u.type==="paren"){let x=T(),G=l;(u.value==="("&&!/[!=<:]/.test(x)||x==="<"&&!/<([!=]|\w+>)/.test(te()))&&(G=`\\${l}`),w({type:"text",value:l,output:G});continue}if(r.dot!==!0&&(u.type==="slash"||u.type==="bos")){w({type:"qmark",value:l,output:L});continue}w({type:"qmark",value:l,output:v});continue}if(l==="!"){if(r.noextglob!==!0&&T()==="("&&(T(2)!=="?"||!/[!=<:]/.test(T(3)))){Fe("negate",l);continue}if(r.nonegate!==!0&&o.index===0){_n();continue}}if(l==="+"){if(r.noextglob!==!0&&T()==="("&&T(2)!=="?"){Fe("plus",l);continue}if(u&&u.value==="("||r.regex===!1){w({type:"plus",value:l,output:E});continue}if(u&&(u.type==="bracket"||u.type==="paren"||u.type==="brace")||o.parens>0){w({type:"plus",value:l});continue}w({type:"plus",value:E});continue}if(l==="@"){if(r.noextglob!==!0&&T()==="("&&T(2)!=="?"){w({type:"at",extglob:!0,value:l,output:""});continue}w({type:"text",value:l});continue}if(l!=="*"){(l==="$"||l==="^")&&(l=`\\${l}`);let f=Js.exec(te());f&&(l+=f[0],o.index+=f[0].length),w({type:"text",value:l});continue}if(u&&(u.type==="globstar"||u.star===!0)){u.type="star",u.star=!0,u.value+=l,u.output=_,o.backtrack=!0,o.globstar=!0,Q(l);continue}let p=te();if(r.noextglob!==!0&&/^\([^?]/.test(p)){Fe("star",l);continue}if(u.type==="star"){if(r.noglobstar===!0){Q(l);continue}let f=u.prev,x=f.prev,G=f.type==="slash"||f.type==="bos",z=x&&(x.type==="star"||x.type==="globstar");if(r.bash===!0&&(!G||p[0]&&p[0]!=="/")){w({type:"star",value:l,output:""});continue}let q=o.braces>0&&(f.type==="comma"||f.type==="brace"),ot=B.length&&(f.type==="pipe"||f.type==="paren");if(!G&&f.type!=="paren"&&!q&&!ot){w({type:"star",value:l,output:""});continue}for(;p.slice(0,3)==="/**";){let De=e[o.index+4];if(De&&De!=="/")break;p=p.slice(3),Q("/**",3)}if(f.type==="bos"&&U()){u.type="globstar",u.value+=l,u.output=P(r),o.output=u.output,o.globstar=!0,Q(l);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&!z&&U()){o.output=o.output.slice(0,-(f.output+u.output).length),f.output=`(?:${f.output}`,u.type="globstar",u.output=P(r)+(r.strictSlashes?")":"|$)"),u.value+=l,o.globstar=!0,o.output+=f.output+u.output,Q(l);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&p[0]==="/"){let De=p[1]!==void 0?"|$":"";o.output=o.output.slice(0,-(f.output+u.output).length),f.output=`(?:${f.output}`,u.type="globstar",u.output=`${P(r)}${S}|${S}${De})`,u.value+=l,o.output+=f.output+u.output,o.globstar=!0,Q(l+N()),w({type:"slash",value:"/",output:""});continue}if(f.type==="bos"&&p[0]==="/"){u.type="globstar",u.value+=l,u.output=`(?:^|${S}|${P(r)}${S})`,o.output=u.output,o.globstar=!0,Q(l+N()),w({type:"slash",value:"/",output:""});continue}o.output=o.output.slice(0,-u.output.length),u.type="globstar",u.output=P(r),u.value+=l,o.output+=u.output,o.globstar=!0,Q(l);continue}let H={type:"star",value:l,output:_};if(r.bash===!0){H.output=".*?",(u.type==="bos"||u.type==="slash")&&(H.output=F+H.output),w(H);continue}if(u&&(u.type==="bracket"||u.type==="paren")&&r.regex===!0){H.output=l,w(H);continue}(o.index===o.start||u.type==="slash"||u.type==="dot")&&(u.type==="dot"?(o.output+=$,u.output+=$):r.dot===!0?(o.output+=C,u.output+=C):(o.output+=F,u.output+=F),T()!=="*"&&(o.output+=D,u.output+=D)),w(H)}for(;o.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(be("closing","]"));o.output=ee.escapeLast(o.output,"["),fe("brackets")}for(;o.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(be("closing",")"));o.output=ee.escapeLast(o.output,"("),fe("parens")}for(;o.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(be("closing","}"));o.output=ee.escapeLast(o.output,"{"),fe("braces")}if(r.strictSlashes!==!0&&(u.type==="star"||u.type==="bracket")&&w({type:"maybe_slash",value:"",output:`${S}?`}),o.backtrack===!0){o.output="";for(let p of o.tokens)o.output+=p.output!=null?p.output:p.value,p.suffix&&(o.output+=p.suffix)}return o};Ct.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(Qe,r.maxLength):Qe,s=e.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);e=Tr[e]||e;let{DOT_LITERAL:i,SLASH_LITERAL:c,ONE_CHAR:a,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:b,NO_DOTS_SLASH:E,STAR:S,START_ANCHOR:D}=Ue.globChars(r.windows),R=r.dot?b:d,y=r.dot?E:d,$=r.capture?"":"?:",C={negated:!1,prefix:""},v=r.bash===!0?".*?":S;r.capture&&(v=`(${v})`);let L=F=>F.noglobstar===!0?v:`(${$}(?:(?!${D}${F.dot?h:i}).)*?)`,W=F=>{switch(F){case"*":return`${R}${a}${v}`;case".*":return`${i}${a}${v}`;case"*.*":return`${R}${v}${i}${a}${v}`;case"*/*":return`${R}${v}${c}${a}${y}${v}`;case"**":return R+L(r);case"**/*":return`(?:${R}${L(r)}${c})?${y}${a}${v}`;case"**/*.*":return`(?:${R}${L(r)}${c})?${y}${v}${i}${a}${v}`;case"**/.*":return`(?:${R}${L(r)}${c})?${i}${a}${v}`;default:{let m=/^(.*?)\.(\w+)$/.exec(F);if(!m)return;let _=W(m[1]);return _?_+i+m[2]:void 0}}},A=ee.removePrefix(e,C),P=W(A);return P&&r.strictSlashes!==!0&&(P+=`${c}?`),P};Or.exports=Ct});var kr=I((Bo,Dr)=>{"use strict";g();var ri=Pr(),wt=Lr(),Fr=Se(),ni=Ee(),si=e=>e&&typeof e=="object"&&!Array.isArray(e),j=(e,t,r=!1)=>{if(Array.isArray(e)){let b=e.map(S=>j(S,t,r));return S=>{for(let D of b){let R=D(S);if(R)return R}return!1}}let n=si(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=t||{},i=s.windows,c=n?j.compileRe(e,t):j.makeRe(e,t,!1,!0),a=c.state;delete c.state;let h=()=>!1;if(s.ignore){let b={...t,ignore:null,onMatch:null,onResult:null};h=j(s.ignore,b,r)}let d=(b,E=!1)=>{let{isMatch:S,match:D,output:R}=j.test(b,c,t,{glob:e,posix:i}),y={glob:e,state:a,regex:c,posix:i,input:b,output:R,match:D,isMatch:S};return typeof s.onResult=="function"&&s.onResult(y),S===!1?(y.isMatch=!1,E?y:!1):h(b)?(typeof s.onIgnore=="function"&&s.onIgnore(y),y.isMatch=!1,E?y:!1):(typeof s.onMatch=="function"&&s.onMatch(y),E?y:!0)};return r&&(d.state=a),d};j.test=(e,t,r,{glob:n,posix:s}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let i=r||{},c=i.format||(s?Fr.toPosixSlashes:null),a=e===n,h=a&&c?c(e):e;return a===!1&&(h=c?c(e):e,a=h===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=j.matchBase(e,t,r,s):a=t.exec(h)),{isMatch:!!a,match:a,output:h}};j.matchBase=(e,t,r)=>(t instanceof RegExp?t:j.makeRe(t,r)).test(Fr.basename(e));j.isMatch=(e,t,r)=>j(t,r)(e);j.parse=(e,t)=>Array.isArray(e)?e.map(r=>j.parse(r,t)):wt(e,{...t,fastpaths:!1});j.scan=(e,t)=>ri(e,t);j.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let s=t||{},i=s.contains?"":"^",c=s.contains?"":"$",a=`${i}(?:${e.output})${c}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);let h=j.toRegex(a,t);return n===!0&&(h.state=e),h};j.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(s.output=wt.fastpaths(e,t)),s.output||(s=wt(e,t)),j.compileRe(s,t,r,n)};j.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};j.constants=ni;Dr.exports=j});var vt=I((Wo,Mr)=>{"use strict";g();var Hr=kr(),ii=Se();function Ir(e,t,r=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:ii.isWindows()}),Hr(e,t,r)}Object.assign(Ir,Hr);Mr.exports=Ir});var jr=I(Ve=>{"use strict";g();Object.defineProperty(Ve,"__esModule",{value:!0});Ve.Builder=void 0;var oi=re("path"),Nr=_r(),Gr=null;try{re.resolve("picomatch"),Gr=vt()}catch{}var $t=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:oi.sep,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new Nr.APIBuilder(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,r){return this.options={...this.options,...r},new Nr.APIBuilder(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...r){let n=this.globFunction||Gr;if(!n)throw new Error("Please specify a glob function to use glob matching.");var s=this.globCache[t.join("\0")];return s||(s=n(t,...r),this.globCache[t.join("\0")]=s),this.options.filters.push(i=>s(i)),this}};Ve.Builder=$t});var qr=I(Br=>{"use strict";g();Object.defineProperty(Br,"__esModule",{value:!0})});var Wr=I(se=>{"use strict";g();var ui=se&&se.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),li=se&&se.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&ui(t,e,r)};Object.defineProperty(se,"__esModule",{value:!0});se.fdir=void 0;var ci=jr();Object.defineProperty(se,"fdir",{enumerable:!0,get:function(){return ci.Builder}});li(qr(),se)});var dn=I((iu,st)=>{g();function un(e){return Array.isArray(e)?e:[e]}var Fi=void 0,Mt="",sn=" ",It="\\",Di=/^\s+$/,ki=/(?:[^\\]|^)\\$/,Hi=/^\\!/,Ii=/^\\#/,Mi=/\r?\n/g,Ni=/^\.{0,2}\/|^\.{1,2}$/,Gi=/\/$/,me="/",ln="node-ignore";typeof Symbol<"u"&&(ln=Symbol.for("node-ignore"));var cn=ln,ye=(e,t,r)=>(Object.defineProperty(e,t,{value:r}),r),ji=/([0-z])-([0-z])/g,an=()=>!1,Bi=e=>e.replace(ji,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:Mt),qi=e=>{let{length:t}=e;return e.slice(0,t-t%2)},Wi=[[/^\uFEFF/,()=>Mt],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?sn:Mt)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+sn}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return t+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>It],[/\\\\/g,()=>It],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,s)=>t===It?`\\[${r}${qi(n)}${s}`:s==="]"&&n.length%2===0?`[${Bi(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],Xi=/(^|\\\/)?\\\*$/,Oe="regex",rt="checkRegex",on="_",zi={[Oe](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[rt](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},Ki=e=>Wi.reduce((t,[r,n])=>t.replace(r,n.bind(e)),e),nt=e=>typeof e=="string",Ui=e=>e&&nt(e)&&!Di.test(e)&&!ki.test(e)&&e.indexOf("#")!==0,Qi=e=>e.split(Mi).filter(Boolean),Nt=class{constructor(t,r,n,s,i,c){this.pattern=t,this.mark=r,this.negative=i,ye(this,"body",n),ye(this,"ignoreCase",s),ye(this,"regexPrefix",c)}get regex(){let t=on+Oe;return this[t]?this[t]:this._make(Oe,t)}get checkRegex(){let t=on+rt;return this[t]?this[t]:this._make(rt,t)}_make(t,r){let n=this.regexPrefix.replace(Xi,zi[t]),s=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return ye(this,r,s)}},Vi=({pattern:e,mark:t},r)=>{let n=!1,s=e;s.indexOf("!")===0&&(n=!0,s=s.substr(1)),s=s.replace(Hi,"!").replace(Ii,"#");let i=Ki(s);return new Nt(e,t,s,r,n,i)},Gt=class{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[cn]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(nt(t)&&(t={pattern:t}),Ui(t.pattern)){let r=Vi(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,un(nt(t)?Qi(t):t).forEach(this._add,this),this._added}test(t,r,n){let s=!1,i=!1,c;this._rules.forEach(h=>{let{negative:d}=h;i===d&&s!==i||d&&!s&&!i&&!r||!h[n].test(t)||(s=!d,i=d,c=d?Fi:h)});let a={ignored:s,unignored:i};return c&&(a.rule=c),a}},Yi=(e,t)=>{throw new t(e)},oe=(e,t,r)=>nt(e)?e?oe.isNotRelative(e)?r(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${t}\``,TypeError),fn=e=>Ni.test(e);oe.isNotRelative=fn;oe.convert=e=>e;var jt=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){ye(this,cn,!0),this._rules=new Gt(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(t){return this._rules.add(t)&&this._initCache(),this}addPattern(t){return this.add(t)}_test(t,r,n,s){let i=t&&oe.convert(t);return oe(i,t,this._strictPathCheck?Yi:an),this._t(i,r,n,s)}checkIgnore(t){if(!Gi.test(t))return this.test(t);let r=t.split(me).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(me)+me,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(t,!1,rt)}_t(t,r,n,s){if(t in r)return r[t];if(s||(s=t.split(me).filter(Boolean)),s.pop(),!s.length)return r[t]=this._rules.test(t,n,Oe);let i=this._t(s.join(me)+me,r,n,s);return r[t]=i.ignored?i:this._rules.test(t,n,Oe)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return un(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},Bt=e=>new jt(e),Zi=e=>oe(e&&oe.convert(e),e,an),hn=()=>{let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");oe.convert=e;let t=/^[a-z]:\//i;oe.isNotRelative=r=>t.test(r)||fn(r)};typeof process<"u"&&process.platform==="win32"&&hn();st.exports=Bt;Bt.default=Bt;st.exports.isPathValid=Zi;ye(st.exports,Symbol.for("setupWindows"),hn)});var Kt={};Rn(Kt,{MAX_CACHE_ENTRIES:()=>Xt,MAX_TOTAL_PATHS:()=>zt,clear:()=>yn,getCacheKey:()=>lt,read:()=>ct,write:()=>Ae});g();import mn from"node:crypto";var X=new Map,V=new Map,Xt=256,zt=5e4,lt=(e,t,r,n,s=!0)=>{let i=mn.createHash("sha256");return i.update(e),i.update(t),i.update(s?"gitignore":"no-gitignore"),r!==void 0&&i.update(String(r)),n!==void 0&&i.update(`maxFiles:${n}`),i.digest("hex")},ct=e=>{let t=X.get(e);return t!==void 0&&(X.delete(e),X.set(e,t)),t},Ae=(e,t,r)=>{for(V.has(e)&&clearTimeout(V.get(e));X.size>=Xt&&!X.has(e);){let i=X.keys().next().value;i&&(X.delete(i),V.has(i)&&(clearTimeout(V.get(i)),V.delete(i)))}let n=0;for(let[i,c]of X)i!==e&&(n+=c.length);for(;n+t.length>zt&&X.size>0;){let i,c=0;for(let[a,h]of X)a!==e&&h.length>c&&(c=h.length,i=a);if(i)n-=X.get(i).length,X.delete(i),V.has(i)&&(clearTimeout(V.get(i)),V.delete(i));else break}X.has(e)&&X.delete(e),X.set(e,t);let s=setTimeout(()=>{X.delete(e),V.delete(e)},r);V.set(e,s)},yn=()=>{for(let e of V.values())clearTimeout(e);X.clear(),V.clear()};g();var Ur=ut(Wr(),1);import O from"node:path";import ie from"node:fs";import{spawn as ai}from"node:child_process";function $e(e){return e.split(O.sep).join(O.posix.sep)}function Pt(e,t=!1){let r=$e(e);for(;r.startsWith("./");)r=r.slice(2);return t?r.replace(/\/+$/,""):r}function Qr(){return process.platform==="win32"||process.platform==="darwin"}function fi(e,t){let r=e.replace(/\/+$/,""),n=t.replace(/\/+$/,"");return r===n?!0:Qr()?r.toLowerCase()===n.toLowerCase():!1}function hi(e,t){let r=`${t}/`;if(e.startsWith(r)){let n=e.slice(r.length);return n===""?null:n}if(Qr()){let n=`${t.toLowerCase()}/`;if(e.toLowerCase().startsWith(n)){let i=e.slice(n.length);return i===""?null:i}}return null}var di=5e3,pi=3e4,gi=200,_i=50,Ce=4096,Lt=new Map;function bi(e){for(;e.size>gi;){let t=e.keys().next().value;if(t===void 0)break;e.delete(t)}}function Ri(e,t){let r=e.get(t);if(r){if(Date.now()-r.cachedAt>pi){e.delete(t);return}return r.value}}function Re(e,t,r){e.set(t,{value:r,cachedAt:Date.now()}),bi(e)}function mi(e){let t=e.trim();return t.length<=Ce?t:`${t.slice(0,Ce)}\u2026`}function yi(e){return e.map(t=>/^[A-Za-z]:[\\/]/.test(t)||t.startsWith("/")&&t.length>1?"<abs-path>":t.includes(O.sep)&&t.length>32?"<path>":t).join(" ")}function Ye(e,t,r,n){let s=[`[crawler] ${e}:`,t,yi(r)];n.code!==void 0&&n.code!==null&&s.push(`exit=${String(n.code)}`),n.stderr&&n.stderr.length>0&&s.push(mi(n.stderr)),console.warn(s.join(" "))}function et(e){return["-c","core.fsmonitor=false","-c","core.untrackedCache=false","-c","core.quotePath=false",...e]}function Ze(e){return $e(O.resolve(e))}function Ai(e){return[Ze(e.crawlDirectory),Ze(e.cwd),e.ignore.getFingerprint(),e.useGitignore===!1?"no-gitignore":"gitignore",e.maxDepth===void 0?"undefined":String(e.maxDepth),e.maxFiles===void 0?"undefined":String(e.maxFiles)].join("|")}function Xr(e){let t=Lt.get(e);return t===void 0?!1:Date.now()-t<di}function Ft(e){Lt.set(e,Date.now())}var ae=new Map,he=new Map;function Ei(){for(;ae.size>=_i;){let e=ae.keys().next().value;if(e===void 0)break;ae.delete(e),Lt.delete(e)}}function Si(e){let t=Ze(e),r=Ri(he,t);if(r!==void 0)return r;let n=e;for(;n;){let s=O.join(n,".git");try{let c=ie.statSync(s);if(c.isDirectory())return Re(he,t,s),s;if(c.isFile()){let h=ie.readFileSync(s,"utf8").trim().match(/^gitdir:\s*(.+)$/i);if(!h)return Re(he,t,null),null;let d=h[1].trim(),b=O.isAbsolute(d)?O.resolve(d):O.resolve(n,d);try{b=ie.realpathSync(b);try{ie.statSync(O.join(b,"HEAD"))}catch{ie.statSync(O.join(b,"index"))}}catch{return Re(he,t,null),null}return Re(he,t,b),b}}catch(c){if(c.code!=="ENOENT")return Re(he,t,null),null}let i=O.dirname(n);if(i===n)break;n=i}return Re(he,t,null),null}function tt(e){try{let t=Si(e);if(!t)return null;let r=O.join(t,"index");return ie.statSync(r).mtimeMs}catch{}return null}function xi(e,t){let r=tt(t),n=ae.get(e);return n?r!==null&&n.gitRootMtimeMs!==null?r<n.gitRootMtimeMs||!Xr(e):r===null&&n.gitRootMtimeMs===null?!Xr(e):!0:!0}function Ci(e,t){let r=ae.get(e);if(!r)return;let n=tt(t);ae.set(e,{...r,gitRootMtimeMs:n})}function Dt(e,t,r,n,s){Ei();let i=tt(t);ae.set(e,{gitRootMtimeMs:i,untrackedFingerprint:n===void 0?null:Je(n),deletedFingerprint:s===void 0?null:Je(s),fileList:r})}function Je(e){let t=5381;for(let r of e){for(let n=0;n<r.length;n++)t=(t<<5)+t+r.charCodeAt(n)>>>0;t=(t<<5)+t+10>>>0}return`${e.length}:${t}`}function wi(e,t=[0]){return e!==null&&t.includes(e)}function vi(e,t,r,n=2e4,s){let i=s?.collectLines!==!1;return new Promise(c=>{let a=[],h=!1,d=!1,b=!1,E="",S=0,D=(A,P)=>{h||(h=!0,c({success:A,lines:P}))},R="",y;try{y=ai(e,t,{cwd:r,windowsHide:!0,stdio:["ignore","pipe","pipe"],...e==="git"?{env:{...process.env,GIT_DIR:void 0,GIT_WORK_TREE:void 0,GIT_INDEX_FILE:void 0}}:{}})}catch(A){s?.silentOnFailure||Ye("command spawn threw",e,t,{stderr:A instanceof Error?A.message:String(A)}),D(!1,[]);return}y.stderr&&(y.stderr.setEncoding("utf8"),y.stderr.on("data",A=>{R.length<Ce&&(R+=A,R.length>Ce&&(R=R.slice(0,Ce)))}));let $=()=>{if(!y.killed)try{y.kill()}catch{}},C=A=>{let P=A.endsWith("\r")?A.slice(0,-1):A;if(P.length===0)return!0;if(s?.onLine&&!s.onLine(P))return b=!0,$(),!1;i&&a.push(P),S++;let F=s?.yieldEveryLines;return F!==void 0&&F>0&&S%F===0&&y.stdout&&typeof y.stdout.pause=="function"&&(y.stdout.pause(),setImmediate(()=>{try{y.stdout?.resume()}catch{}})),!0},v=A=>{if(E+=A,(s?.recordDelimiter??`
|
|
4
|
+
`)==="\0"){for(;;){let F=E.indexOf("\0");if(F===-1)break;let m=E.slice(0,F);if(E=E.slice(F+1),!C(m))break}return}for(;;){let F=E.indexOf(`
|
|
5
|
+
`);if(F===-1)break;let m=E.slice(0,F);if(E=E.slice(F+1),!C(m))break}},L=()=>{E.length!==0&&(C(E),E="")},W;n>0&&(W=setTimeout(()=>{d=!0,$()},n)),y.stdout.setEncoding("utf8"),y.stdout.on("data",A=>{v(A)}),y.on("error",A=>{W&&clearTimeout(W),s?.silentOnFailure||Ye("command spawn failed",e,t,{stderr:`${String(A.code??"")} ${String(A)}`.trim()}),D(!1,[])}),y.on("close",A=>{if(W&&clearTimeout(W),b){D(!0,a);return}if(d){s?.silentOnFailure||Ye("command timed out",e,t,{code:A,stderr:R}),D(!1,[]);return}L();let P=wi(A,s?.successExitCodes);!P&&!s?.silentOnFailure&&Ye("command failed",e,t,{code:A,stderr:R}),D(P,P?a:[])})})}var Pe=vi;function Te(e){return $e(e)}function de(e,t){let r=O.resolve(e),n=O.resolve(t),s=r,i=n;try{s=ie.realpathSync(r)}catch{}try{i=ie.realpathSync(n)}catch{}let c=O.relative(s,i),a=$e(c);return a===""?".":a}function ve(e){return!e||e==="."||O.posix.isAbsolute(e)?!1:e!==".."&&!e.startsWith("../")&&!e.includes("/../")}function $i(e,t){let r=O.resolve(e),n=O.isAbsolute(t)?t:O.join(r,t),s=O.relative(r,n);return s=$e(s),!s||s.startsWith("..")||O.posix.isAbsolute(s)?null:ve(s)?s:null}function Vr(e){if(e===".")return-1;let t=e.endsWith("/")?e.slice(0,-1):e;return t.length===0?-1:t.split("/").length-1}function Yr(e,t){if(e==="."||t===""||t===".")return e;let r=t.endsWith("/")?t:`${t}/`;return e===t?".":e.startsWith(r)?e.slice(r.length)||".":e}function kt(e,t,r,n){let s=t.maxDepth,i=t.ignore.getDirectoryFilter(),c=t.ignore.getFileFilter();return e.filter(a=>{if(s!==void 0&&a!=="."){let h=r?Yr(a,r):a;if(Vr(h)>s)return!1}return a==="."?!0:a.endsWith("/")?ve(a.slice(0,-1))?!i(a):!1:n?.has(a)?!0:!ve(a)||Zr(a,i)?!1:!c(a)})}function Zr(e,t){let r=e.split("/"),n="";for(let s=0;s<r.length-1;s++)if(n=n?`${n}/${r[s]}`:r[s],t(`${n}/`))return!0;return!1}var Jr=1e3;async function Pi(e){e>0&&e%Jr===0&&await new Promise(t=>setImmediate(t))}async function en(e){let t=await Pe("git",et(["rev-parse","--show-toplevel"]),e,5e3,{silentOnFailure:!0});return!t.success||t.lines.length===0?null:Te(t.lines[0])}function Tt(e,t,r){return!(!ve(e)||Zr(e,t)||r(e))}function we(e,t){return t!==void 0&&e>=t}function Ot(e,t,r){if(r===void 0)return!0;let n=Yr(e,t);return Vr(n)<=r}async function tn(e,t,r){let n=["--literal-pathspecs","ls-files","-z","--others"];r&&n.push("--exclude-standard"),t&&t!=="."&&n.push(t);let s=await Pe("git",et(n),e,1e4,{silentOnFailure:!0,recordDelimiter:"\0"});return s.success?s.lines.map(i=>Te(i)):null}async function rn(e,t){let r=["--literal-pathspecs","ls-files","-z","--deleted"];t&&t!=="."&&r.push(t);let n=await Pe("git",et(r),e,1e4,{silentOnFailure:!0,recordDelimiter:"\0"});return n.success?n.lines.map(s=>Te(s)):null}async function zr(e,t,r){if(e.gitRootMtimeMs===null&&e.untrackedFingerprint===null&&e.deletedFingerprint===null)return{changed:!1};let n=await en(t);if(e.untrackedFingerprint===null&&e.deletedFingerprint===null)return n?{changed:!0}:{changed:!1};if(!n)return{changed:!0};let s=de(n,t),[i,c]=await Promise.all([tn(n,s,r),rn(n,s)]);return i===null||c===null?{changed:!0}:Je(i)!==e.untrackedFingerprint||Je(c)!==e.deletedFingerprint?{changed:!0,prefetch:{gitRoot:n,untrackedFiles:i,deletedFiles:c}}:{changed:!1}}function Kr(e,t,r,n,s){let i=Pt(e,!1);if(t&&t!=="."){let c=hi(i,n);if(c!==null)return O.posix.join(s,c);if(fi(i,n))return`${i.replace(/\/+$/,"")}/`;let a=i.replace(/\/+$/,"");return O.posix.join(s,a)}return O.posix.join(s,i.replace(/\/+$/,""))}async function Ti(e,t,r,n,s){let i,c,a;if(s)i=s.gitRoot,c=s.untrackedFiles,a=s.deletedFiles;else{if(i=await en(t),!i)return{success:!1,files:[],gitRepoListingFailed:!1};let _=de(i,t),o=await Promise.all([tn(i,_,n.useGitignore!==!1),rn(i,_)]);c=o[0],a=o[1]}if(!i)return{success:!1,files:[],gitRepoListingFailed:!1};if(!s&&(c===null||a===null))return{success:!1,files:[],gitRepoListingFailed:!0};let h=de(r,t),d=de(i,t),b=Pt(d,!0),E=Pt(h,!0),S=n.ignore.getDirectoryFilter(),D=n.ignore.getFileFilter(),R=["--literal-pathspecs","ls-files","--cached","--recurse-submodules"];R.push("-t"),d&&d!=="."&&R.push(d);let y=new Set(a),$=new Set,C=0,v=_=>_.length===0?null:_.length>=3&&/\s/.test(_[1])&&/[A-Za-z]/.test(_[0])?{status:_[0].toUpperCase(),filePath:_.slice(2)}:{status:null,filePath:_},L=_=>{if(we(C,n.maxFiles))return!1;let o=v(_);if(!o||o.status==="S")return!0;let B=Te(o.filePath);if(y.has(B))return!0;let M;try{M=ie.lstatSync(O.join(i,...B.split("/")))}catch{return!0}if(M.isDirectory()||d&&d!=="."&&B===d)return!0;let k=Kr(B,d,h,b,E);if(!Tt(k,S,D))return!0;let u=$.size;return $.add(k),$.size>u&&Ot(k,h,n.maxDepth)&&C++,!we(C,n.maxFiles)},W=await Pe("git",et(R),i,2e4,{collectLines:!1,onLine:L,yieldEveryLines:Jr});if(!W.success)return{success:!1,files:[],gitRepoListingFailed:!0};for(let _ of W.lines)if(!L(_))break;let A=0;if(c!==null)for(let _ of c){if(we(C,n.maxFiles))break;await Pi(A++);let o=Kr(_,d,h,b,E);Tt(o,S,D)&&($.has(o)||($.add(o),Ot(o,h,n.maxDepth)&&C++))}let P=nn($),F=kt(P,n,h,$),m=Ht(F,n.maxFiles);return Dt(e,t,m,c===null?void 0:c,a===null?void 0:a),Ft(e),{success:!0,files:m}}function nn(e){let t=new Set;for(let r of e){let n=r.split("/"),s="";for(let i=0;i<n.length-1;i++)s=s?s+"/"+n[i]:n[i],t.add(s+"/")}return[".",...Array.from(t),...Array.from(e)]}async function Oi(e,t,r,n){let s=["--files","--no-require-git","--hidden"];n.useGitignore===!1&&s.push("--no-ignore");let i=de(r,t),c=n.ignore.getDirectoryFilter(),a=n.ignore.getFileFilter(),h=new Set,d=0,b=y=>{if(we(d,n.maxFiles))return!1;let $=Te(y),C=O.posix.join(i,$);if(!Tt(C,c,a))return!0;let v=h.size;return h.add(C),h.size>v&&Ot(C,i,n.maxDepth)&&d++,!we(d,n.maxFiles)},E=await Pe("rg",s,t,2e4,{collectLines:!1,onLine:b,successExitCodes:[0,1]});if(!E.success)return{success:!1,files:[]};for(let y of E.lines)if(!b(y))break;let S=nn(h),D=kt(S,n,i,h),R=Ht(D,n.maxFiles);return Dt(e,t,R),Ft(e),{success:!0,files:R}}async function Li(e){let t=de(e.cwd,e.crawlDirectory),r;try{let s=e.ignore.getDirectoryFilter(),i=e.ignore.getFileFilter(),c=new Ur.fdir().withRelativePaths().withDirs().withPathSeparator("/").exclude((a,h)=>{let d=$i(e.crawlDirectory,h);return d?s(`${d}/`):!1}).filter((a,h)=>{if(h)return!0;let d=O.posix.join(t,a);return ve(d)?!i(d):!1});e.maxDepth!==void 0&&c.withMaxDepth(e.maxDepth),r=await c.crawl(e.crawlDirectory).withPromise()}catch{return[]}let n=r.filter(s=>s.length>0&&s!==".").map(s=>O.posix.join(t,s));if(t!=="."){let s=t.endsWith("/")?t:`${t}/`;if(!n.includes(s))return[s,...n]}return n}async function ru(e){let t=Ai(e),r=e.cache?lt(Ze(e.crawlDirectory),e.ignore.getFingerprint(),e.maxDepth,e.maxFiles,e.useGitignore!==!1):void 0;if(e.cache){let d=ct(r);if(d)return d}let n;if(!e.cache){let d=ae.get(t);if(d){let b=tt(e.crawlDirectory);if(b!==null&&d.gitRootMtimeMs!==null&&b>d.gitRootMtimeMs){let S=await zr(d,e.crawlDirectory,e.useGitignore!==!1);if(!S.changed)return Ci(t,e.crawlDirectory),d.fileList;n=S.prefetch}else if(!xi(t,e.crawlDirectory)){let S=await zr(d,e.crawlDirectory,e.useGitignore!==!1);if(!S.changed)return d.fileList;n=S.prefetch}}}let s=await Ti(t,e.crawlDirectory,e.cwd,e,n);if(s.success){let d=s.files;return e.cache&&Ae(r,d,e.cacheTtl*1e3),d}s.gitRepoListingFailed&&console.warn("[crawler] falling back to ripgrep (git ls-files unavailable)");let i=await Oi(t,e.crawlDirectory,e.cwd,e);if(i.success){let d=i.files;return e.cache&&Ae(r,d,e.cacheTtl*1e3),d}console.warn("[crawler] falling back to fdir (ripgrep unavailable)");let c=de(e.cwd,e.crawlDirectory),a=await Li(e);a=kt(a,e,c),a.length===0?a=["."]:a[0]!=="."&&(a=[".",...a]);let h=Ht(a,e.maxFiles);return Dt(t,e.crawlDirectory,h),Ft(t),e.cache&&Ae(r,h,e.cacheTtl*1e3),h}function Ht(e,t){if(t===void 0||e.length<=t)return e;let r=e.slice(0,t),n=i=>i!=="."&&!i.endsWith("/");if(r.some(n))return r;let s=e.findIndex(n);return s===-1?r:e.slice(0,s+1)}g();var qt=ut(dn(),1),gn=ut(vt(),1);import it from"node:fs";import pn from"node:path";var Ji=(0,gn.default)("**/*[*.]*"),eo=[".git","node_modules",".venv","venv","__pycache__",".mypy_cache",".pytest_cache",".ruff_cache",".next",".nuxt",".turbo",".cache","target",".gradle",".terraform"];function cu(e){let t=new Wt,r=new Set([...eo,...e.ignoreDirs]);if(t.add([...r].map(n=>n.endsWith("/")?n:`${n}/`)),e.useGitignore){let n=pn.join(e.projectRoot,".gitignore");it.existsSync(n)&&t.add(it.readFileSync(n,"utf8"))}if(e.useMatildaignore){let n=pn.join(e.projectRoot,".matildaignore");it.existsSync(n)&&t.add(it.readFileSync(n,"utf8"))}return t}var Wt=class{allPatterns=[];dirIgnorer=(0,qt.default)();fileIgnorer=(0,qt.default)();add(t){typeof t=="string"&&(t=t.split(/\r?\n/));for(let r of t){let n=r.trim();if(n===""||n.startsWith("#"))continue;this.allPatterns.push(n),n.endsWith("/")&&!n.startsWith("!")?this.dirIgnorer.add(n):(this.fileIgnorer.add(n),Ji(n)||this.dirIgnorer.add(n))}return this}getDirectoryFilter(){return t=>this.dirIgnorer.ignores(t)}getFileFilter(){return t=>this.fileIgnorer.ignores(t)}getFingerprint(){return this.allPatterns.join(`
|
|
6
|
+
`)}};export{vt as a,dn as b,Kt as c,ru as d,cu as e,Wt as f};
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2025 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
11
|
+
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{b as i}from"./chunk-GZPNIYVZ.js";i();import{AsyncLocalStorage as P}from"node:async_hooks";import{randomUUID as f}from"node:crypto";i();import{AsyncLocalStorage as E}from"node:async_hooks";var c=new E;var x="x-matilda-reported-operation-id",m="x-matilda-reported-attempt-purpose",A=[x,m],y=new Set(A),l=["answer","tool_followup","continuation","retry","compaction","unknown"],_=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,C=new Set(l),u=new P,O=new WeakSet;function R(){return f()}function s(t,e){let o=Object.freeze({operationId:t,attemptPurpose:e});return O.add(o),o}function g(t){return y.has(t.toLowerCase())}function a(){let t=u.getStore();return t&&O.has(t)?t:void 0}var T=class{activeOperationId;begin(e){return this.activeOperationId=R(),s(this.activeOperationId,e)}continue(e){let o=a()?.operationId??this.activeOperationId??R();return this.activeOperationId=o,s(o,e)}};function n(t,e){return u.run(t,e)}function v(t){u.enterWith(t)}function M(t,e){let o=a();return o?n(s(o.operationId,t),e):e()}function I(t,e){let o={next:(...r)=>n(t,()=>e.next(...r)),return:r=>n(t,()=>e.return(r)),throw:r=>n(t,()=>e.throw(r)),[Symbol.asyncIterator]:()=>o},p=Symbol.asyncDispose,d=p&&e[p];return p&&typeof d=="function"&&(o[p]=()=>n(t,()=>d.call(e))),o}function k(t,e){let o=a();return o?I(s(o.operationId,t),e):e}function Y(){let t=a();if(!t||!_.test(t.operationId))return{};let e=c.getStore()?.attempt,o=e!==void 0&&e>1?"retry":t.attemptPurpose;return C.has(o)?{[x]:t.operationId,[m]:o}:{}}export{c as a,x as b,m as c,A as d,l as e,g as f,a as g,T as h,n as i,v as j,M as k,I as l,k as m,Y as n};
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2026 Matilda Team
|
|
7
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|