@visulima/vis 1.0.0-alpha.2 → 1.0.0-alpha.21
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/CHANGELOG.md +840 -14
- package/LICENSE.md +7667 -0
- package/README.md +322 -19
- package/dist/bin.js +1 -146
- package/dist/config/index.d.ts +2795 -0
- package/dist/config/index.js +1 -0
- package/dist/generate/index.d.ts +157 -0
- package/dist/generate/index.js +1 -0
- package/dist/packem_chunks/bin.js +1295 -0
- package/dist/packem_chunks/config.js +19 -0
- package/dist/packem_chunks/doctor-probe.js +2 -0
- package/dist/packem_chunks/fix.js +11 -0
- package/dist/packem_chunks/handler.js +1 -0
- package/dist/packem_chunks/handler10.js +1 -0
- package/dist/packem_chunks/handler11.js +5 -0
- package/dist/packem_chunks/handler12.js +1 -0
- package/dist/packem_chunks/handler13.js +27 -0
- package/dist/packem_chunks/handler14.js +5 -0
- package/dist/packem_chunks/handler15.js +1 -0
- package/dist/packem_chunks/handler16.js +1 -0
- package/dist/packem_chunks/handler17.js +1 -0
- package/dist/packem_chunks/handler18.js +1 -0
- package/dist/packem_chunks/handler19.js +1 -0
- package/dist/packem_chunks/handler2.js +2 -0
- package/dist/packem_chunks/handler20.js +5 -0
- package/dist/packem_chunks/handler21.js +2 -0
- package/dist/packem_chunks/handler22.js +2 -0
- package/dist/packem_chunks/handler23.js +18 -0
- package/dist/packem_chunks/handler24.js +1 -0
- package/dist/packem_chunks/handler25.js +1 -0
- package/dist/packem_chunks/handler26.js +5 -0
- package/dist/packem_chunks/handler27.js +1 -0
- package/dist/packem_chunks/handler28.js +3 -0
- package/dist/packem_chunks/handler29.js +1 -0
- package/dist/packem_chunks/handler3.js +4 -0
- package/dist/packem_chunks/handler30.js +7 -0
- package/dist/packem_chunks/handler31.js +33 -0
- package/dist/packem_chunks/handler32.js +3 -0
- package/dist/packem_chunks/handler33.js +1 -0
- package/dist/packem_chunks/handler34.js +26 -0
- package/dist/packem_chunks/handler35.js +3 -0
- package/dist/packem_chunks/handler36.js +7 -0
- package/dist/packem_chunks/handler37.js +22 -0
- package/dist/packem_chunks/handler38.js +428 -0
- package/dist/packem_chunks/handler39.js +6 -0
- package/dist/packem_chunks/handler4.js +8 -0
- package/dist/packem_chunks/handler40.js +24 -0
- package/dist/packem_chunks/handler41.js +10 -0
- package/dist/packem_chunks/handler42.js +153 -0
- package/dist/packem_chunks/handler43.js +25 -0
- package/dist/packem_chunks/handler44.js +24 -0
- package/dist/packem_chunks/handler45.js +213 -0
- package/dist/packem_chunks/handler46.js +3 -0
- package/dist/packem_chunks/handler47.js +27 -0
- package/dist/packem_chunks/handler48.js +167 -0
- package/dist/packem_chunks/handler49.js +34 -0
- package/dist/packem_chunks/handler5.js +1 -0
- package/dist/packem_chunks/handler6.js +1 -0
- package/dist/packem_chunks/handler7.js +1 -0
- package/dist/packem_chunks/handler8.js +1 -0
- package/dist/packem_chunks/handler9.js +2 -0
- package/dist/packem_chunks/heal-accept.js +10 -0
- package/dist/packem_chunks/heal.js +14 -0
- package/dist/packem_chunks/help-command.js +18 -0
- package/dist/packem_chunks/index.js +7 -0
- package/dist/packem_chunks/keys-refresh.js +4 -0
- package/dist/packem_chunks/list.js +3 -0
- package/dist/packem_chunks/loader.js +1 -0
- package/dist/packem_chunks/prune.js +3 -0
- package/dist/packem_chunks/run.js +1 -0
- package/dist/packem_chunks/status.js +2 -0
- package/dist/packem_chunks/sync.js +2 -0
- package/dist/packem_chunks/sync2.js +2 -0
- package/dist/packem_chunks/tar.js +3 -0
- package/dist/packem_chunks/tripwire.js +2 -0
- package/dist/packem_shared/advisories-DsynpacV.js +1 -0
- package/dist/packem_shared/ai-analysis-uYuTIIXi.js +68 -0
- package/dist/packem_shared/ai-cache-DuwHYx2O.js +1 -0
- package/dist/packem_shared/ai-fix-DzrA-dVz.js +43 -0
- package/dist/packem_shared/applyDefaults-BOVDw1jD.js +1 -0
- package/dist/packem_shared/build-scripts-DsWMSWDs.js +1 -0
- package/dist/packem_shared/cache-directory-DQak1Vjc.js +1 -0
- package/dist/packem_shared/cyclonedx-CiHXuG8M.js +4 -0
- package/dist/packem_shared/definePlugin-CWm4Dv_t.js +1 -0
- package/dist/packem_shared/dependency-scan-DC3nAFHS.js +1 -0
- package/dist/packem_shared/docker-B-CIN_nj.js +60 -0
- package/dist/packem_shared/failure-log-C3LEMmkq.js +2 -0
- package/dist/packem_shared/flakiness-Dq6K4ymq.js +1 -0
- package/dist/packem_shared/giget-CcEy_Elm.js +2 -0
- package/dist/packem_shared/glob-MHJQjR39-CQ2GC0b_.js +1 -0
- package/dist/packem_shared/index-DH-5hsrC.js +1 -0
- package/dist/packem_shared/lifecycle-Dv3nAtoD.js +2 -0
- package/dist/packem_shared/lockfile-C5DYMHVq.js +1 -0
- package/dist/packem_shared/manifests-B0fMp872.js +1 -0
- package/dist/packem_shared/min-release-age-BFozFonQ.js +34 -0
- package/dist/packem_shared/native-config-sync-Dvi1g2nQ.js +21 -0
- package/dist/packem_shared/otelPlugin-CJR2T_lk.js +1 -0
- package/dist/packem_shared/registry-keys-CewRFW0e.js +1 -0
- package/dist/packem_shared/resolve-explicit-CC4Kifk5.js +5 -0
- package/dist/packem_shared/run-summary-utils-BaBGP3bo.js +1 -0
- package/dist/packem_shared/runtime-check-BusAwPb2.js +1 -0
- package/dist/packem_shared/scan-progress-CMynp3eA.js +2 -0
- package/dist/packem_shared/selectors-B2ISH581.js +3 -0
- package/dist/packem_shared/signatures-5ZdjJ2Pu.js +2 -0
- package/dist/packem_shared/symbols-CQmER5MT.js +1 -0
- package/dist/packem_shared/toolchain-Cc3cwyLP.js +5 -0
- package/dist/packem_shared/typosquats-BCeR-sLf.js +1 -0
- package/dist/packem_shared/use-measured-height-DjYgUOKk.js +1 -0
- package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
- package/dist/packem_shared/verify-07kUNTuP.js +1 -0
- package/dist/packem_shared/vis-update-app-CFrlJ3mW.js +1 -0
- package/dist/packem_shared/xxh3-DrAUNq4n.js +1 -0
- package/index.d.ts +358 -0
- package/index.js +609 -0
- package/package.json +57 -22
- package/schemas/project.schema.json +872 -0
- package/schemas/vis-config.schema.json +4306 -0
- package/skills/vis/SKILL.md +96 -0
- package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
- package/templates/buildkite-ci/template.yml +20 -0
- package/dist/ai-analysis.d.ts +0 -40
- package/dist/ai-cache.d.ts +0 -21
- package/dist/bin.d.ts +0 -1
- package/dist/catalog.d.ts +0 -110
- package/dist/commands/affected.d.ts +0 -3
- package/dist/commands/ai.d.ts +0 -3
- package/dist/commands/analyze.d.ts +0 -3
- package/dist/commands/check.d.ts +0 -3
- package/dist/commands/graph.d.ts +0 -3
- package/dist/commands/hook/constants.d.ts +0 -8
- package/dist/commands/hook/index.d.ts +0 -3
- package/dist/commands/hook/install.d.ts +0 -7
- package/dist/commands/hook/migrate.d.ts +0 -27
- package/dist/commands/hook/uninstall.d.ts +0 -3
- package/dist/commands/migrate/constants.d.ts +0 -12
- package/dist/commands/migrate/deps.d.ts +0 -32
- package/dist/commands/migrate/index.d.ts +0 -3
- package/dist/commands/migrate/json.d.ts +0 -20
- package/dist/commands/migrate/lint-staged.d.ts +0 -62
- package/dist/commands/migrate/types.d.ts +0 -20
- package/dist/commands/run.d.ts +0 -3
- package/dist/commands/staged.d.ts +0 -3
- package/dist/commands/update.d.ts +0 -3
- package/dist/config.d.ts +0 -40
- package/dist/config.js +0 -1
- package/dist/package-manager.d.ts +0 -23
- package/dist/workspace.d.ts +0 -58
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var ts=Object.defineProperty;var $=(e,t)=>ts(e,"name",{value:t,configurable:!0});import{createRequire as rs}from"node:module";import{createJiti as Yn}from"jiti";import"../packem_shared/otelPlugin-CJR2T_lk.js";import"../packem_shared/definePlugin-CWm4Dv_t.js";const ns=rs(import.meta.url),hr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,cn=$(e=>{if(typeof hr<"u"&&hr.versions&&hr.versions.node){const[t,o]=hr.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return hr.getBuiltinModule(e)}return ns(e)},"__cjs_getBuiltinModule"),{createHash:Hn}=cn("node:crypto"),{readdirSync:Xn,readFileSync:os,copyFileSync:ss,unlinkSync:is}=cn("node:fs"),{createRequire:ze}=cn("node:module");var as=Object.defineProperty,Je=$((e,t)=>as(e,"name",{value:t,configurable:!0}),"K$3"),cs=Object.defineProperty,W=Je((e,t)=>cs(e,"name",{value:t,configurable:!0}),"E");const ls=ze(import.meta.url),qe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Qn=W(e=>{if(typeof qe<"u"&&qe.versions&&qe.versions.node){const[t,o]=qe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return qe.getBuiltinModule(e)}return ls(e)},"__cjs_getBuiltinModule"),{existsSync:Ue}=Qn("node:fs"),{env:Ze,cwd:eo}=qe,{createRequire:He}=Qn("node:module"),to=0,Ve=2,ro=Symbol("findUpStop");var us=Object.defineProperty,fs=W((e,t)=>us(e,"name",{value:t,configurable:!0}),"t$4"),ps=Object.defineProperty,ds=fs((e,t)=>ps(e,"name",{value:t,configurable:!0}),"t"),gs=Object.defineProperty,hs=ds((e,t)=>gs(e,"name",{value:t,configurable:!0}),"n");const ln=hs(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath");var ms=Object.defineProperty,bs=W((e,t)=>ms(e,"name",{value:t,configurable:!0}),"i$4"),ys=Object.defineProperty,$s=bs((e,t)=>ys(e,"name",{value:t,configurable:!0}),"r"),vs=Object.defineProperty,xs=$s((e,t)=>vs(e,"name",{value:t,configurable:!0}),"i");const kn=xs(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType");var ws=Object.defineProperty,js=W((e,t)=>ws(e,"name",{value:t,configurable:!0}),"i$3"),Os=Object.defineProperty,no=js((e,t)=>Os(e,"name",{value:t,configurable:!0}),"s");const ks=He(import.meta.url),mr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ps=no(e=>{if(typeof mr<"u"&&mr.versions&&mr.versions.node){const[t,o]=mr.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return mr.getBuiltinModule(e)}return ks(e)},"__cjs_getBuiltinModule"),{lstatSync:Pn,mkdirSync:Es}=Ps("node:fs");var As=Object.defineProperty,Ss=no((e,t)=>As(e,"name",{value:t,configurable:!0}),"o");const Ts=Ss(e=>{ln(e);try{const t=Pn(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(kn(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{Es(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const o=Pn(e);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(kn(o))}'`,{cause:t})}},"ensureDirSync");var zs=Object.defineProperty,b=W((e,t)=>zs(e,"name",{value:t,configurable:!0}),"s$6");let En=b(()=>{var e=(()=>{var t=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,f=b((r,n)=>{for(var s in n)t(r,s,{get:n[s],enumerable:!0})},"ne"),g=b((r,n,s,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of i(n))!u.call(r,a)&&a!==s&&t(r,a,{get:b(()=>n[a],"get"),enumerable:!(c=o(n,a))||c.enumerable});return r},"ae"),h=b(r=>g(t({},"__esModule",{value:!0}),r),"oe"),w={};f(w,{zeptomatch:b(()=>Ee,"zeptomatch")});var P=b(r=>{const n=new Set,s=[r];for(let c=0;c<s.length;c++){const a=s[c];if(n.has(a))continue;n.add(a);const{children:l}=a;if(l?.length)for(let p=0,m=l.length;p<m;p++)s.push(l[p])}return Array.from(n)},"M"),k=b(r=>{let n="";const s=P(r);for(let c=0,a=s.length;c<a;c++){const l=s[c];if(!l.regex)continue;const p=l.regex.flags;if(n||(n=p),n!==p)throw new Error(`Inconsistent RegExp flags used: "${n}" and "${p}"`)}return n},"se"),O=b((r,n,s)=>{const c=s.get(r);if(c!==void 0)return c;const a=r.partial??n;let l="";if(r.regex&&(l+=a?"(?:$|":"",l+=r.regex.source),r.children?.length){const p=C(r.children.map(m=>O(m,n,s)).filter(Boolean));if(p?.length){const m=r.children.some(q=>!q.regex||!(q.partial??n)),j=p.length>1||a&&(!l.length||m);l+=j?a?"(?:$|":"(?:":"",l+=p.join("|"),l+=j?")":""}}return r.regex&&(l+=a?")":""),s.set(r,l),l},"O"),N=b((r,n)=>{const s=new Map,c=P(r);for(let a=c.length-1;a>=0;a--){const l=O(c[a],n,s);if(!(a>0))return l}return""},"ie"),C=b(r=>Array.from(new Set(r)),"ue"),E=b((r,n,s)=>E.compile(r,s).test(n),"R");E.compile=(r,n)=>{const s=n?.partial??!1,c=N(r,s),a=k(r);return new RegExp(`^(?:${c})$`,a)};var G=E,X=b((r,n)=>{const s=G.compile(r,n),c=`${s.source.slice(0,-1)}[\\\\/]?$`,a=s.flags;return new RegExp(c,a)},"le"),se=X,_e=b(r=>{const n=r.map(c=>c.source).join("|")||"$^",s=r[0]?.flags;return new RegExp(n,s)},"ve"),Ne=_e,Q=b(r=>Array.isArray(r),"j"),B=b(r=>typeof r=="function","_"),Re=b(r=>r.length===0,"he"),Be=(()=>{const{toString:r}=Function.prototype,n=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return s=>(s.length===0||s.length===1)&&n.test(r.call(s))})(),Ye=b(r=>typeof r=="number","de"),Qe=b(r=>typeof r=="object"&&r!==null,"xe"),et=b(r=>r instanceof RegExp,"me"),tt=(()=>{const r=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return n=>r.test(n.source)})(),rt=(()=>{const r=/^[a-zA-Z0-9_-]+$/;return n=>r.test(n.source)&&!n.flags.includes("i")})(),fe=b(r=>typeof r=="string","A"),T=b(r=>r===void 0,"f"),nt=b(r=>{const n=new Map;return s=>{const c=n.get(s);if(c!==void 0)return c;const a=r(s);return n.set(s,a),a}},"ye"),pe=b((r,n,s={})=>{const c={cache:{},input:r,index:0,indexBacktrackMax:0,options:s,output:[]},a=z(n)(c),l=Math.max(c.index,c.indexBacktrackMax);if(a&&c.index===r.length)return c.output;throw new Error(`Failed to parse at index ${l}`)},"I"),d=b((r,n)=>Q(r)?ot(r,n):fe(r)?de(r,n):st(r,n),"i"),ot=b((r,n)=>{const s={};for(const c of r){if(c.length!==1)throw new Error(`Invalid character: "${c}"`);const a=c.charCodeAt(0);s[a]=!0}return c=>{const a=c.input;let l=c.index,p=l;for(;p<a.length&&a.charCodeAt(p)in s;)p+=1;if(p>l){if(!T(n)&&!c.options.silent){const m=a.slice(l,p),j=B(n)?n(m,a,`${l}`):n;T(j)||c.output.push(j)}c.index=p}return!0}},"we"),st=b((r,n)=>{if(rt(r))return de(r.source,n);{const s=r.source,c=r.flags.replace(/y|$/,"y"),a=new RegExp(s,c);return tt(r)&&B(n)&&!Be(n)?it(a,n):at(a,n)}},"$e"),it=b((r,n)=>s=>{const c=s.index,a=s.input;r.lastIndex=c;const l=r.exec(a);if(l){const p=r.lastIndex;if(!s.options.silent){const m=n(...l,a,`${c}`);T(m)||s.output.push(m)}return s.index=p,!0}else return!1},"Ee"),at=b((r,n)=>s=>{const c=s.index,a=s.input;if(r.lastIndex=c,r.test(a)){const l=r.lastIndex;if(!T(n)&&!s.options.silent){const p=B(n)?n(a.slice(c,l),a,`${c}`):n;T(p)||s.output.push(p)}return s.index=l,!0}else return!1},"Ce"),de=b((r,n)=>s=>{const c=s.index,a=s.input;if(a.startsWith(r,c)){if(!T(n)&&!s.options.silent){const l=B(n)?n(r,a,`${c}`):n;T(l)||s.output.push(l)}return s.index+=r.length,!0}else return!1},"F"),ee=b((r,n,s,c)=>{const a=z(r),l=n>1;return re(te(he(p=>{let m=0;for(;m<s;){const j=p.index;if(!a(p)||(m+=1,p.index===j))break}return m>=n},l),c))},"k"),ge=b((r,n)=>ee(r,0,1,n),"L"),K=b((r,n)=>ee(r,0,1/0,n),"$"),ct=b((r,n)=>ee(r,1,1/0,n),"Re"),I=b((r,n)=>{const s=r.map(z);return re(te(he(c=>{for(let a=0,l=s.length;a<l;a++)if(!s[a](c))return!1;return!0}),n))},"x"),A=b((r,n)=>{const s=r.map(z);return re(te(c=>{for(let a=0,l=s.length;a<l;a++)if(s[a](c))return!0;return!1},n))},"p"),he=b((r,n=!0,s=!1)=>{const c=z(r);return n?a=>{const l=a.index,p=a.output.length,m=c(a);return!m&&!s&&(a.indexBacktrackMax=Math.max(a.indexBacktrackMax,a.index)),(!m||s)&&(a.index=l,a.output.length!==p&&(a.output.length=p)),m}:c},"q"),te=b((r,n)=>{const s=z(r);return n?c=>{if(c.options.silent)return s(c);const a=c.output.length;if(s(c)){const l=c.output.splice(a,1/0),p=n(l);return T(p)||c.output.push(p),!0}else return!1}:s},"B"),re=(()=>{let r=0;return n=>{const s=z(n),c=r+=1;return a=>{var l;if(a.options.memoization===!1)return s(a);const p=a.index,m=(l=a.cache)[c]||(l[c]={indexMax:-1,queue:[]}),j=m.queue;if(p<=m.indexMax){const U=m.store||(m.store=new Map);if(j.length){for(let F=0,pr=j.length;F<pr;F+=2){const dr=j[F*2],gr=j[F*2+1];U.set(dr,gr)}j.length=0}const S=U.get(p);if(S===!1)return!1;if(Ye(S))return a.index=S,!0;if(S)return a.index=S.index,S.output?.length&&a.output.push(...S.output),!0}const q=a.output.length,fr=s(a);if(m.indexMax=Math.max(m.indexMax,p),fr){const U=a.index,S=a.output.length;if(S>q){const F=a.output.slice(q,S);j.push(p,{index:U,output:F})}else j.push(p,U);return!0}else return j.push(p,!1),!1}}})(),me=b(r=>{let n;return s=>(n||(n=z(r())),n(s))},"G"),z=nt(r=>{if(B(r))return Re(r)?me(r):r;if(fe(r)||et(r))return d(r);if(Q(r))return I(r);if(Qe(r))return A(Object.values(r));throw new Error("Invalid rule")}),_=b(r=>r,"d"),lt=b(r=>typeof r=="string","ke"),ut=b(r=>{const n=new WeakMap,s=new WeakMap;return(c,a)=>{const l=a?.partial?s:n,p=l.get(c);if(p!==void 0)return p;const m=r(c,a);return l.set(c,m),m}},"Be"),ft=b(r=>{const n={},s={};return(c,a)=>{const l=a?.partial?s:n;return l[c]??(l[c]=r(c,a))}},"Pe"),pt=d(/\\./,_),dt=d(/./,_),gt=d(/\*\*\*+/,"*"),ht=d(/([^/{[(!])\*\*/,(r,n)=>`${n}*`),mt=d(/(^|.)\*\*(?=[^*/)\]}])/,(r,n)=>`${n}*`),bt=K(A([pt,gt,ht,mt,dt])),yt=bt,$t=b(r=>pe(r,yt,{memoization:!1}).join(""),"Ie"),vt=$t,be="abcdefghijklmnopqrstuvwxyz",xt=b(r=>{let n="";for(;r>0;){const s=(r-1)%26;n=be[s]+n,r=Math.floor((r-1)/26)}return n},"Le"),ye=b(r=>{let n=0;for(let s=0,c=r.length;s<c;s++)n=n*26+be.indexOf(r[s])+1;return n},"V"),ne=b((r,n)=>{if(n<r)return ne(n,r);const s=[];for(;r<=n;)s.push(r++);return s},"b"),wt=b((r,n,s)=>ne(r,n).map(c=>String(c).padStart(s,"0")),"qe"),$e=b((r,n)=>ne(ye(r),ye(n)).map(xt),"W"),y=b(r=>({partial:!1,regex:new RegExp(r,"s"),children:[]}),"c"),L=b(r=>({children:r}),"y"),D=(()=>{const r=b((n,s,c)=>{if(c.has(n))return;c.add(n);const{children:a}=n;if(!a.length)a.push(s);else for(let l=0,p=a.length;l<p;l++)r(a[l],s,c)},"e");return n=>{if(!n.length)return L([]);for(let s=n.length-1;s>=1;s--){const c=new Set,a=n[s-1],l=n[s];r(a,l,c)}return n[0]}})(),M=b(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),jt=d(/\\./,y),Ot=d(/[$.*+?^(){}[\]\|]/,r=>y(`\\${r}`)),kt=d(/[\\\/]/,M),Pt=d(/[^$.*+?^(){}[\]\|\\\/]+/,y),Et=d(/^(?:!!)*!(.*)$/,(r,n)=>y(`(?!^${Ee.compile(n).source}$).*?`)),At=d(/^(!!)+/),St=A([Et,At]),Tt=d(/\/(\*\*\/)+/,()=>L([D([M(),y(".+?"),M()]),M()])),zt=d(/^(\*\*\/)+/,()=>L([y("^"),D([y(".*?"),M()])])),Mt=d(/\/(\*\*)$/,()=>L([D([M(),y(".*?")]),y("$")])),Ct=d(/\*\*/,()=>y(".*?")),ve=A([Tt,zt,Mt,Ct]),_t=d(/\*\/(?!\*\*\/|\*$)/,()=>D([y("[^\\\\/]*?"),M()])),Nt=d(/\*/,()=>y("[^\\\\/]*")),xe=A([_t,Nt]),we=d("?",()=>y("[^\\\\/]")),Rt=d("[",_),Bt=d("]",_),It=d(/[!^]/,"^\\\\/"),Dt=d(/[a-z]-[a-z]|[0-9]-[0-9]/i,_),Ft=d(/\\./,_),Wt=d(/[$.*+?^(){}[\|]/,r=>`\\${r}`),Lt=d(/[\\\/]/,"\\\\/"),qt=d(/[^$.*+?^(){}[\]\|\\\/]+/,_),Ut=A([Ft,Wt,Lt,Dt,qt]),je=I([Rt,ge(It),K(Ut),Bt],r=>y(r.join(""))),Zt=d("{","(?:"),Vt=d("}",")"),Gt=d(/(\d+)\.\.(\d+)/,(r,n,s)=>wt(+n,+s,Math.min(n.length,s.length)).join("|")),Kt=d(/([a-z]+)\.\.([a-z]+)/,(r,n,s)=>$e(n,s).join("|")),Jt=d(/([A-Z]+)\.\.([A-Z]+)/,(r,n,s)=>$e(n.toLowerCase(),s.toLowerCase()).join("|").toUpperCase()),Ht=A([Gt,Kt,Jt]),Oe=I([Zt,Ht,Vt],r=>y(r.join(""))),Xt=d("{"),Yt=d("}"),Qt=d(","),er=d(/\\./,y),tr=d(/[$.*+?^(){[\]\|]/,r=>y(`\\${r}`)),rr=d(/[\\\/]/,M),nr=d(/[^$.*+?^(){}[\]\|\\\/,]+/,y),or=me(()=>Pe),sr=d("",()=>y("(?:)")),ir=ct(A([ve,xe,we,je,Oe,or,er,tr,rr,nr]),D),ke=A([ir,sr]),Pe=I([Xt,ge(I([ke,K(I([Qt,ke]))])),Yt],L),ar=K(A([St,ve,xe,we,je,Oe,Pe,jt,Ot,kt,Pt]),D),cr=ar,lr=b(r=>pe(r,cr,{memoization:!1})[0],"kr"),ur=lr,oe=b((r,n,s)=>oe.compile(r,s).test(n),"N");oe.compile=(()=>{const r=ft((s,c)=>se(ur(vt(s)),c)),n=ut((s,c)=>Ne(s.map(a=>r(a,c))));return(s,c)=>lt(s)?r(s,c):n(s,c)})();var Ee=oe;return h(w)})();return e.default||e},"_lazyMatch"),Yr;const Ms=b((e,t)=>(Yr||(Yr=En(),En=null),Yr(e,t)),"zeptomatch"),Cs=/^[A-Z]:\//i,ie=b((e="")=>e&&e.replaceAll("\\","/").replace(Cs,t=>t.toUpperCase()),"normalizeWindowsPath"),_s=/^[/\\]{2}/,Ns=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,oo=/^[A-Z]:$/i,An=/^\/([A-Z]:)?$/i,Rs=/.(\.[^./]+)$/,Bs=/^[/\\]|^[a-z]:[/\\]/i,Is=/\/$/,Ds=b(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),so=b((e,t)=>{let o="",i=0,u=-1,f=0,g;for(let h=0;h<=e.length;++h){if(h<e.length)g=e[h];else{if(g==="/")break;g="/"}if(g==="/"){if(!(u===h-1||f===1))if(f===2){if(o.length<2||i!==2||!o.endsWith(".")||o.at(-2)!=="."){if(o.length>2){const w=o.lastIndexOf("/");w===-1?(o="",i=0):(o=o.slice(0,w),i=o.length-1-o.lastIndexOf("/")),u=h,f=0;continue}else if(o.length>0){o="",i=0,u=h,f=0;continue}}t&&(o+=o.length>0?"/..":"..",i=2)}else o.length>0?o+=`/${e.slice(u+1,h)}`:o=e.slice(u+1,h),i=h-u-1;u=h,f=0}else g==="."&&f!==-1?++f:f=-1}return o},"normalizeString"),Ie=b(e=>Ns.test(e),"isAbsolute"),io=b(function(e){if(e.length===0)return".";e=ie(e);const t=_s.exec(e),o=Ie(e),i=e.at(-1)==="/";return e=so(e,!o),e.length===0?o?"/":i?"./":".":(i&&(e+="/"),oo.test(e)&&(e+="/"),t?o?`//${e}`:`//./${e}`:o&&!Ie(e)?`/${e}`:e)},"normalize"),ao=b((...e)=>{let t="";for(const o of e)if(o)if(t.length>0){const i=t.at(-1)==="/",u=o[0]==="/";i&&u?t+=o.slice(1):t+=i||u?o:`/${o}`}else t+=o;return io(t)},"join"),le=b(function(...e){e=e.map(i=>ie(i));let t="",o=!1;for(let i=e.length-1;i>=-1&&!o;i--){const u=i>=0?e[i]:Ds();!u||u.length===0||(t=`${u}/${t}`,o=Ie(u))}return t=so(t,!o),o&&!Ie(t)?`/${t}`:t.length>0?t:"."},"resolve");b(function(e){return ie(e)},"toNamespacedPath");const co=b(function(e){return Rs.exec(ie(e))?.[1]??""},"extname");b(function(e,t){const o=le(e).replace(An,"$1").split("/"),i=le(t).replace(An,"$1").split("/");if(i[0][1]===":"&&o[0][1]===":"&&o[0]!==i[0])return i.join("/");const u=[...o];for(const f of u){if(i[0]!==f)break;o.shift(),i.shift()}return[...o.map(()=>".."),...i].join("/")},"relative");const un=b(e=>{const t=ie(e).replace(Is,"").split("/").slice(0,-1);return t.length===1&&oo.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(Ie(e)?"/":".")},"dirname");b(function(e){const t=[e.root,e.dir,e.base??e.name+e.ext].filter(Boolean);return ie(e.root?le(...t):t.join("/"))},"format");const Fs=b((e,t)=>{const o=ie(e).split("/").pop();return t&&o.endsWith(t)?o.slice(0,-t.length):o},"basename"),lo=b(function(e){const t=Bs.exec(e)?.[0]?.replaceAll("\\","/")??"",o=Fs(e),i=co(o);return{base:o,dir:un(e),ext:i,name:o.slice(0,o.length-i.length),root:t}},"parse");b((e,t)=>Ms(t,io(e)),"matchesGlob");var Ws=Object.defineProperty,Y=W((e,t)=>Ws(e,"name",{value:t,configurable:!0}),"i$2");const Ls=He(import.meta.url),br=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qs=Y(e=>{if(typeof br<"u"&&br.versions&&br.versions.node){const[t,o]=br.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return br.getBuiltinModule(e)}return Ls(e)},"__cjs_getBuiltinModule"),{fileURLToPath:Us}=qs("node:url");function Ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}$(Ir,"dn$1");Je(Ir,"Nr");W(Ir,"w$1");Y(Ir,"getDefaultExportFromCjs");var Sn,Tn;function Dr(){return Tn||(Tn=1,Sn=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Sn}$(Dr,"gn$1");Je(Dr,"Dr");W(Dr,"y$2");Y(Dr,"requireBinaryExtensions");var Zs=Dr();const Vs=Ir(Zs),Gs=new Set(Vs),Ks=new Set(["/","\\",void 0]),zn=Symbol.for("pathe:normalizedAlias"),Js=/(^|[/\\])([^/\\]+?)(?=(?:\.[^.]+)?$)/,Hs=Y((e,t)=>t.split("/").length-e.split("/").length,"compareAliases"),Nr=Y((e="/")=>{const t=e.at(-1);return t==="/"||t==="\\"},"hasTrailingSlash"),uo=Y(e=>{if(e[zn])return e;const t=Object.fromEntries(Object.entries(e).toSorted(([o],[i])=>Hs(o,i)));for(const o in t)for(const i in t)i===o||o.startsWith(i)||t[o].startsWith(i)&&Ks.has(t[o][i.length])&&(t[o]=t[i]+t[o].slice(i.length));return Object.defineProperty(t,zn,{enumerable:!1,value:!0}),t},"normalizeAliases");Y((e,t)=>{e=ie(e),t=uo(t);for(const[o,i]of Object.entries(t)){if(!e.startsWith(o))continue;const u=Nr(o)?o.slice(0,-1):o;if(Nr(e[u.length]))return ao(i,e.slice(o.length))}return e},"resolveAlias");Y(e=>Js.exec(e)?.[2],"filename");Y((e,t)=>{e=ie(e),t=uo(t);for(const[o,i]of Object.entries(t).toReversed()){if(!e.startsWith(i))continue;const u=Nr(i)?i.slice(0,-1):i;if(Nr(e[u.length]))return ao(o,e.slice(i.length))}return e},"reverseResolveAlias");const Xs=/^(?:\.?\.[/\\]|\.\.\B)/,Ys=/^(?:msys|cygwin)$/;Y(e=>Xs.test(e)||e==="..","isRelative");Y(e=>Gs.has(co(e).slice(1).toLowerCase()),"isBinaryPath");const Ge=Y(e=>ie(e instanceof URL?Us(e):e),"toPath");Y(()=>{if(!globalThis.process)return!1;if(globalThis.process.platform==="win32"||globalThis.process.platform==="cygwin")return!0;const e=globalThis.process.env.OSTYPE;return typeof e!="string"?!1:Ys.test(e)},"isWindows");var Qs=Object.defineProperty,ei=W((e,t)=>Qs(e,"name",{value:t,configurable:!0}),"p"),ti=Object.defineProperty,fo=ei((e,t)=>ti(e,"name",{value:t,configurable:!0}),"a");const ri=He(import.meta.url),yr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,po=fo(e=>{if(typeof yr<"u"&&yr.versions&&yr.versions.node){const[t,o]=yr.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return yr.getBuiltinModule(e)}return ri(e)},"__cjs_getBuiltinModule"),{stat:ni,lstat:oi}=po("node:fs/promises"),{fileURLToPath:si}=po("node:url");var ii=Object.defineProperty,Mn=fo((e,t)=>ii(e,"name",{value:t,configurable:!0}),"n");const ai=Mn(async(e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const o=t.cwd?Ge(t.cwd):process.cwd();let i=le(o);const{root:u}=lo(i),f=Ge(t.stopAt??u),g=le(i,f),h=t.type??"file",w=Mn(async function(k){return typeof e=="function"?[await e(k)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const P=t.allowSymlinks?ni:oi;for(;i&&i!==g&&i!==u;){const k=await w(i);for(let O of k){if(O===ro)return;if(O===void 0)continue;Buffer.isBuffer(O)?O=O.toString():O instanceof URL&&(O=si(O));const N=Ie(O)?O:le(i,O);try{const C=await P(N);if(h==="file"&&C.isFile()||h==="directory"&&C.isDirectory())return N}catch{}}i=un(i)}},"findUp");var ci=Object.defineProperty,li=W((e,t)=>ci(e,"name",{value:t,configurable:!0}),"u$3"),ui=Object.defineProperty,go=li((e,t)=>ui(e,"name",{value:t,configurable:!0}),"i");const fi=He(import.meta.url),$r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ho=go(e=>{if(typeof $r<"u"&&$r.versions&&$r.versions.node){const[t,o]=$r.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return $r.getBuiltinModule(e)}return fi(e)},"__cjs_getBuiltinModule"),{statSync:pi,lstatSync:di}=ho("node:fs"),{fileURLToPath:gi}=ho("node:url");var hi=Object.defineProperty,Cn=go((e,t)=>hi(e,"name",{value:t,configurable:!0}),"o");const mi=Cn((e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const o=t.cwd?Ge(t.cwd):process.cwd();let i=le(o);const{root:u}=lo(i),f=Ge(t.stopAt??u),g=le(i,f),h=t.type??"file",w=Cn(function(k){return typeof e=="function"?[e(k)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const P=t.allowSymlinks?pi:di;for(;i&&i!==g&&i!==u;){for(let k of w(i)){if(k===ro)return;if(k===void 0)continue;Buffer.isBuffer(k)?k=k.toString():k instanceof URL&&(k=gi(k));const O=Ie(k)?k:le(i,k);try{const N=P(O);if(h==="file"&&N.isFile()||h==="directory"&&N.isDirectory())return O}catch{}}i=un(i)}},"findUpSync");var bi=Object.defineProperty,mo=W((e,t)=>bi(e,"name",{value:t,configurable:!0}),"t$2"),yi=Object.defineProperty,fn=mo((e,t)=>yi(e,"name",{value:t,configurable:!0}),"s");const $i=He(import.meta.url),vr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,vi=fn(e=>{if(typeof vr<"u"&&vr.versions&&vr.versions.node){const[t,o]=vr.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return vr.getBuiltinModule(e)}return $i(e)},"__cjs_getBuiltinModule"),{access:xi}=vi("node:fs/promises");var wi=Object.defineProperty,ji=fn((e,t)=>wi(e,"name",{value:t,configurable:!0}),"o");async function Se(e,t=to){ln(e),e=Ge(e);try{return await xi(e,t),!0}catch{return!1}}$(Se,"Q$3");Je(Se,"se");W(Se,"i$1");mo(Se,"d");fn(Se,"m");ji(Se,"isAccessible");var Oi=Object.defineProperty,bo=W((e,t)=>Oi(e,"name",{value:t,configurable:!0}),"t$1"),ki=Object.defineProperty,pn=bo((e,t)=>ki(e,"name",{value:t,configurable:!0}),"t");const Pi=He(import.meta.url),xr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ei=pn(e=>{if(typeof xr<"u"&&xr.versions&&xr.versions.node){const[t,o]=xr.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return xr.getBuiltinModule(e)}return Pi(e)},"__cjs_getBuiltinModule"),{accessSync:Ai}=Ei("node:fs");var Si=Object.defineProperty,Ti=pn((e,t)=>Si(e,"name",{value:t,configurable:!0}),"o");function Te(e,t=to){ln(e),e=Ge(e);try{return Ai(e,t),!0}catch{return!1}}$(Te,"ee$1");Je(Te,"ie");W(Te,"i");bo(Te,"d");pn(Te,"m");Ti(Te,"isAccessibleSync");var zi=Object.defineProperty,yo=W((e,t)=>zi(e,"name",{value:t,configurable:!0}),"o"),Mi=Object.defineProperty,$o=yo((e,t)=>Mi(e,"name",{value:t,configurable:!0}),"o"),Ci=Object.defineProperty,_i=$o((e,t)=>Ci(e,"name",{value:t,configurable:!0}),"o");let vo=class extends Error{static{$(this,"Jn")}static{Je(this,"Xr")}static{W(this,"s")}static{yo(this,"u")}static{$o(this,"n")}static{_i(this,"NotFoundError")}constructor(e){super(`ENOENT: ${e}`)}get code(){return"ENOENT"}set code(e){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(e){throw new Error("Cannot overwrite name of NotFoundError")}};var Ni=Object.defineProperty,Ri=W((e,t)=>Ni(e,"name",{value:t,configurable:!0}),"$e"),Bi=Object.defineProperty,dn=Ri((e,t)=>Bi(e,"name",{value:t,configurable:!0}),"W"),Ii=Object.defineProperty,v=dn((e,t)=>Ii(e,"name",{value:t,configurable:!0}),"u$1");let _n=v(()=>{var e=(()=>{var t=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,f=v((r,n)=>{for(var s in n)t(r,s,{get:n[s],enumerable:!0})},"ne"),g=v((r,n,s,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of i(n))!u.call(r,a)&&a!==s&&t(r,a,{get:v(()=>n[a],"get"),enumerable:!(c=o(n,a))||c.enumerable});return r},"ae"),h=v(r=>g(t({},"__esModule",{value:!0}),r),"oe"),w={};f(w,{zeptomatch:v(()=>Ee,"zeptomatch")});var P=v(r=>{const n=new Set,s=[r];for(let c=0;c<s.length;c++){const a=s[c];if(n.has(a))continue;n.add(a);const{children:l}=a;if(l?.length)for(let p=0,m=l.length;p<m;p++)s.push(l[p])}return Array.from(n)},"M"),k=v(r=>{let n="";const s=P(r);for(let c=0,a=s.length;c<a;c++){const l=s[c];if(!l.regex)continue;const p=l.regex.flags;if(n||(n=p),n!==p)throw new Error(`Inconsistent RegExp flags used: "${n}" and "${p}"`)}return n},"se"),O=v((r,n,s)=>{const c=s.get(r);if(c!==void 0)return c;const a=r.partial??n;let l="";if(r.regex&&(l+=a?"(?:$|":"",l+=r.regex.source),r.children?.length){const p=C(r.children.map(m=>O(m,n,s)).filter(Boolean));if(p?.length){const m=r.children.some(q=>!q.regex||!(q.partial??n)),j=p.length>1||a&&(!l.length||m);l+=j?a?"(?:$|":"(?:":"",l+=p.join("|"),l+=j?")":""}}return r.regex&&(l+=a?")":""),s.set(r,l),l},"O"),N=v((r,n)=>{const s=new Map,c=P(r);for(let a=c.length-1;a>=0;a--){const l=O(c[a],n,s);if(!(a>0))return l}return""},"ie"),C=v(r=>Array.from(new Set(r)),"ue"),E=v((r,n,s)=>E.compile(r,s).test(n),"R");E.compile=(r,n)=>{const s=n?.partial??!1,c=N(r,s),a=k(r);return new RegExp(`^(?:${c})$`,a)};var G=E,X=v((r,n)=>{const s=G.compile(r,n),c=`${s.source.slice(0,-1)}[\\\\/]?$`,a=s.flags;return new RegExp(c,a)},"le"),se=X,_e=v(r=>{const n=r.map(c=>c.source).join("|")||"$^",s=r[0]?.flags;return new RegExp(n,s)},"ve"),Ne=_e,Q=v(r=>Array.isArray(r),"j"),B=v(r=>typeof r=="function","_"),Re=v(r=>r.length===0,"he"),Be=(()=>{const{toString:r}=Function.prototype,n=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return s=>(s.length===0||s.length===1)&&n.test(r.call(s))})(),Ye=v(r=>typeof r=="number","de"),Qe=v(r=>typeof r=="object"&&r!==null,"xe"),et=v(r=>r instanceof RegExp,"me"),tt=(()=>{const r=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return n=>r.test(n.source)})(),rt=(()=>{const r=/^[a-zA-Z0-9_-]+$/;return n=>r.test(n.source)&&!n.flags.includes("i")})(),fe=v(r=>typeof r=="string","A"),T=v(r=>r===void 0,"f"),nt=v(r=>{const n=new Map;return s=>{const c=n.get(s);if(c!==void 0)return c;const a=r(s);return n.set(s,a),a}},"ye"),pe=v((r,n,s={})=>{const c={cache:{},input:r,index:0,indexBacktrackMax:0,options:s,output:[]},a=z(n)(c),l=Math.max(c.index,c.indexBacktrackMax);if(a&&c.index===r.length)return c.output;throw new Error(`Failed to parse at index ${l}`)},"I"),d=v((r,n)=>Q(r)?ot(r,n):fe(r)?de(r,n):st(r,n),"i"),ot=v((r,n)=>{const s={};for(const c of r){if(c.length!==1)throw new Error(`Invalid character: "${c}"`);const a=c.charCodeAt(0);s[a]=!0}return c=>{const a=c.input;let l=c.index,p=l;for(;p<a.length&&a.charCodeAt(p)in s;)p+=1;if(p>l){if(!T(n)&&!c.options.silent){const m=a.slice(l,p),j=B(n)?n(m,a,`${l}`):n;T(j)||c.output.push(j)}c.index=p}return!0}},"we"),st=v((r,n)=>{if(rt(r))return de(r.source,n);{const s=r.source,c=r.flags.replace(/y|$/,"y"),a=new RegExp(s,c);return tt(r)&&B(n)&&!Be(n)?it(a,n):at(a,n)}},"$e"),it=v((r,n)=>s=>{const c=s.index,a=s.input;r.lastIndex=c;const l=r.exec(a);if(l){const p=r.lastIndex;if(!s.options.silent){const m=n(...l,a,`${c}`);T(m)||s.output.push(m)}return s.index=p,!0}else return!1},"Ee"),at=v((r,n)=>s=>{const c=s.index,a=s.input;if(r.lastIndex=c,r.test(a)){const l=r.lastIndex;if(!T(n)&&!s.options.silent){const p=B(n)?n(a.slice(c,l),a,`${c}`):n;T(p)||s.output.push(p)}return s.index=l,!0}else return!1},"Ce"),de=v((r,n)=>s=>{const c=s.index,a=s.input;if(a.startsWith(r,c)){if(!T(n)&&!s.options.silent){const l=B(n)?n(r,a,`${c}`):n;T(l)||s.output.push(l)}return s.index+=r.length,!0}else return!1},"F"),ee=v((r,n,s,c)=>{const a=z(r),l=n>1;return re(te(he(p=>{let m=0;for(;m<s;){const j=p.index;if(!a(p)||(m+=1,p.index===j))break}return m>=n},l),c))},"k"),ge=v((r,n)=>ee(r,0,1,n),"L"),K=v((r,n)=>ee(r,0,1/0,n),"$"),ct=v((r,n)=>ee(r,1,1/0,n),"Re"),I=v((r,n)=>{const s=r.map(z);return re(te(he(c=>{for(let a=0,l=s.length;a<l;a++)if(!s[a](c))return!1;return!0}),n))},"x"),A=v((r,n)=>{const s=r.map(z);return re(te(c=>{for(let a=0,l=s.length;a<l;a++)if(s[a](c))return!0;return!1},n))},"p"),he=v((r,n=!0,s=!1)=>{const c=z(r);return n?a=>{const l=a.index,p=a.output.length,m=c(a);return!m&&!s&&(a.indexBacktrackMax=Math.max(a.indexBacktrackMax,a.index)),(!m||s)&&(a.index=l,a.output.length!==p&&(a.output.length=p)),m}:c},"q"),te=v((r,n)=>{const s=z(r);return n?c=>{if(c.options.silent)return s(c);const a=c.output.length;if(s(c)){const l=c.output.splice(a,1/0),p=n(l);return T(p)||c.output.push(p),!0}else return!1}:s},"B"),re=(()=>{let r=0;return n=>{const s=z(n),c=r+=1;return a=>{var l;if(a.options.memoization===!1)return s(a);const p=a.index,m=(l=a.cache)[c]||(l[c]={indexMax:-1,queue:[]}),j=m.queue;if(p<=m.indexMax){const U=m.store||(m.store=new Map);if(j.length){for(let F=0,pr=j.length;F<pr;F+=2){const dr=j[F*2],gr=j[F*2+1];U.set(dr,gr)}j.length=0}const S=U.get(p);if(S===!1)return!1;if(Ye(S))return a.index=S,!0;if(S)return a.index=S.index,S.output?.length&&a.output.push(...S.output),!0}const q=a.output.length,fr=s(a);if(m.indexMax=Math.max(m.indexMax,p),fr){const U=a.index,S=a.output.length;if(S>q){const F=a.output.slice(q,S);j.push(p,{index:U,output:F})}else j.push(p,U);return!0}else return j.push(p,!1),!1}}})(),me=v(r=>{let n;return s=>(n||(n=z(r())),n(s))},"G"),z=nt(r=>{if(B(r))return Re(r)?me(r):r;if(fe(r)||et(r))return d(r);if(Q(r))return I(r);if(Qe(r))return A(Object.values(r));throw new Error("Invalid rule")}),_=v(r=>r,"d"),lt=v(r=>typeof r=="string","ke"),ut=v(r=>{const n=new WeakMap,s=new WeakMap;return(c,a)=>{const l=a?.partial?s:n,p=l.get(c);if(p!==void 0)return p;const m=r(c,a);return l.set(c,m),m}},"Be"),ft=v(r=>{const n={},s={};return(c,a)=>{const l=a?.partial?s:n;return l[c]??(l[c]=r(c,a))}},"Pe"),pt=d(/\\./,_),dt=d(/./,_),gt=d(/\*\*\*+/,"*"),ht=d(/([^/{[(!])\*\*/,(r,n)=>`${n}*`),mt=d(/(^|.)\*\*(?=[^*/)\]}])/,(r,n)=>`${n}*`),bt=K(A([pt,gt,ht,mt,dt])),yt=bt,$t=v(r=>pe(r,yt,{memoization:!1}).join(""),"Ie"),vt=$t,be="abcdefghijklmnopqrstuvwxyz",xt=v(r=>{let n="";for(;r>0;){const s=(r-1)%26;n=be[s]+n,r=Math.floor((r-1)/26)}return n},"Le"),ye=v(r=>{let n=0;for(let s=0,c=r.length;s<c;s++)n=n*26+be.indexOf(r[s])+1;return n},"V"),ne=v((r,n)=>{if(n<r)return ne(n,r);const s=[];for(;r<=n;)s.push(r++);return s},"b"),wt=v((r,n,s)=>ne(r,n).map(c=>String(c).padStart(s,"0")),"qe"),$e=v((r,n)=>ne(ye(r),ye(n)).map(xt),"W"),y=v(r=>({partial:!1,regex:new RegExp(r,"s"),children:[]}),"c"),L=v(r=>({children:r}),"y"),D=(()=>{const r=v((n,s,c)=>{if(c.has(n))return;c.add(n);const{children:a}=n;if(!a.length)a.push(s);else for(let l=0,p=a.length;l<p;l++)r(a[l],s,c)},"e");return n=>{if(!n.length)return L([]);for(let s=n.length-1;s>=1;s--){const c=new Set,a=n[s-1],l=n[s];r(a,l,c)}return n[0]}})(),M=v(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),jt=d(/\\./,y),Ot=d(/[$.*+?^(){}[\]\|]/,r=>y(`\\${r}`)),kt=d(/[\\\/]/,M),Pt=d(/[^$.*+?^(){}[\]\|\\\/]+/,y),Et=d(/^(?:!!)*!(.*)$/,(r,n)=>y(`(?!^${Ee.compile(n).source}$).*?`)),At=d(/^(!!)+/),St=A([Et,At]),Tt=d(/\/(\*\*\/)+/,()=>L([D([M(),y(".+?"),M()]),M()])),zt=d(/^(\*\*\/)+/,()=>L([y("^"),D([y(".*?"),M()])])),Mt=d(/\/(\*\*)$/,()=>L([D([M(),y(".*?")]),y("$")])),Ct=d(/\*\*/,()=>y(".*?")),ve=A([Tt,zt,Mt,Ct]),_t=d(/\*\/(?!\*\*\/|\*$)/,()=>D([y("[^\\\\/]*?"),M()])),Nt=d(/\*/,()=>y("[^\\\\/]*")),xe=A([_t,Nt]),we=d("?",()=>y("[^\\\\/]")),Rt=d("[",_),Bt=d("]",_),It=d(/[!^]/,"^\\\\/"),Dt=d(/[a-z]-[a-z]|[0-9]-[0-9]/i,_),Ft=d(/\\./,_),Wt=d(/[$.*+?^(){}[\|]/,r=>`\\${r}`),Lt=d(/[\\\/]/,"\\\\/"),qt=d(/[^$.*+?^(){}[\]\|\\\/]+/,_),Ut=A([Ft,Wt,Lt,Dt,qt]),je=I([Rt,ge(It),K(Ut),Bt],r=>y(r.join(""))),Zt=d("{","(?:"),Vt=d("}",")"),Gt=d(/(\d+)\.\.(\d+)/,(r,n,s)=>wt(+n,+s,Math.min(n.length,s.length)).join("|")),Kt=d(/([a-z]+)\.\.([a-z]+)/,(r,n,s)=>$e(n,s).join("|")),Jt=d(/([A-Z]+)\.\.([A-Z]+)/,(r,n,s)=>$e(n.toLowerCase(),s.toLowerCase()).join("|").toUpperCase()),Ht=A([Gt,Kt,Jt]),Oe=I([Zt,Ht,Vt],r=>y(r.join(""))),Xt=d("{"),Yt=d("}"),Qt=d(","),er=d(/\\./,y),tr=d(/[$.*+?^(){[\]\|]/,r=>y(`\\${r}`)),rr=d(/[\\\/]/,M),nr=d(/[^$.*+?^(){}[\]\|\\\/,]+/,y),or=me(()=>Pe),sr=d("",()=>y("(?:)")),ir=ct(A([ve,xe,we,je,Oe,or,er,tr,rr,nr]),D),ke=A([ir,sr]),Pe=I([Xt,ge(I([ke,K(I([Qt,ke]))])),Yt],L),ar=K(A([St,ve,xe,we,je,Oe,Pe,jt,Ot,kt,Pt]),D),cr=ar,lr=v(r=>pe(r,cr,{memoization:!1})[0],"kr"),ur=lr,oe=v((r,n,s)=>oe.compile(r,s).test(n),"N");oe.compile=(()=>{const r=ft((s,c)=>se(ur(vt(s)),c)),n=ut((s,c)=>Ne(s.map(a=>r(a,c))));return(s,c)=>lt(s)?r(s,c):n(s,c)})();var Ee=oe;return h(w)})();return e.default||e},"_lazyMatch"),Qr;const Di=v((e,t)=>(Qr||(Qr=_n(),_n=null),Qr(e,t)),"default");var Fi=Object.defineProperty,Wi=dn((e,t)=>Fi(e,"name",{value:t,configurable:!0}),"t$1");const Li=/^[A-Z]:\//i,Fe=Wi((e="")=>e&&e.replaceAll("\\","/").replace(Li,t=>t.toUpperCase()),"normalizeWindowsPath");var qi=Object.defineProperty,J=dn((e,t)=>qi(e,"name",{value:t,configurable:!0}),"r");const Ui=/^[/\\]{2}/,Zi=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,xo=/^[A-Z]:$/i,Nn=/^\/([A-Z]:)?$/i,Vi=/.(\.[^./]+)$/,Gi=/^[/\\]|^[a-z]:[/\\]/i,Ki=/\/$/,Ji=J(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),wo=J((e,t)=>{let o="",i=0,u=-1,f=0,g;for(let h=0;h<=e.length;++h){if(h<e.length)g=e[h];else{if(g==="/")break;g="/"}if(g==="/"){if(!(u===h-1||f===1))if(f===2){if(o.length<2||i!==2||!o.endsWith(".")||o.at(-2)!=="."){if(o.length>2){const w=o.lastIndexOf("/");w===-1?(o="",i=0):(o=o.slice(0,w),i=o.length-1-o.lastIndexOf("/")),u=h,f=0;continue}else if(o.length>0){o="",i=0,u=h,f=0;continue}}t&&(o+=o.length>0?"/..":"..",i=2)}else o.length>0?o+=`/${e.slice(u+1,h)}`:o=e.slice(u+1,h),i=h-u-1;u=h,f=0}else g==="."&&f!==-1?++f:f=-1}return o},"normalizeString"),Ar=J(e=>Zi.test(e),"isAbsolute"),jo=J(function(e){if(e.length===0)return".";e=Fe(e);const t=Ui.exec(e),o=Ar(e),i=e.at(-1)==="/";return e=wo(e,!o),e.length===0?o?"/":i?"./":".":(i&&(e+="/"),xo.test(e)&&(e+="/"),t?o?`//${e}`:`//./${e}`:o&&!Ar(e)?`/${e}`:e)},"normalize"),Ae=J((...e)=>{let t="";for(const o of e)if(o)if(t.length>0){const i=t.at(-1)==="/",u=o[0]==="/";i&&u?t+=o.slice(1):t+=i||u?o:`/${o}`}else t+=o;return jo(t)},"join"),nn=J(function(...e){e=e.map(i=>Fe(i));let t="",o=!1;for(let i=e.length-1;i>=-1&&!o;i--){const u=i>=0?e[i]:Ji();!u||u.length===0||(t=`${u}/${t}`,o=Ar(u))}return t=wo(t,!o),o&&!Ar(t)?`/${t}`:t.length>0?t:"."},"resolve");J(function(e){return Fe(e)},"toNamespacedPath");const Hi=J(function(e){return Vi.exec(Fe(e))?.[1]??""},"extname");J(function(e,t){const o=nn(e).replace(Nn,"$1").split("/"),i=nn(t).replace(Nn,"$1").split("/");if(i[0][1]===":"&&o[0][1]===":"&&o[0]!==i[0])return i.join("/");const u=[...o];for(const f of u){if(i[0]!==f)break;o.shift(),i.shift()}return[...o.map(()=>".."),...i].join("/")},"relative");const gn=J(e=>{const t=Fe(e).replace(Ki,"").split("/").slice(0,-1);return t.length===1&&xo.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(Ar(e)?"/":".")},"dirname");J(function(e){const t=[e.root,e.dir,e.base??e.name+e.ext].filter(Boolean);return Fe(e.root?nn(...t):t.join("/"))},"format");const Xi=J((e,t)=>{const o=Fe(e).split("/").pop();return t&&o.endsWith(t)?o.slice(0,-t.length):o},"basename");J(function(e){const t=Gi.exec(e)?.[0]?.replaceAll("\\","/")??"",o=Xi(e),i=Hi(o);return{base:o,dir:gn(e),ext:i,name:o.slice(0,o.length-i.length),root:t}},"parse");J((e,t)=>Di(t,jo(e)),"matchesGlob");var Yi=Object.defineProperty,hn=W((e,t)=>Yi(e,"name",{value:t,configurable:!0}),"u");const Rr=hn((e,t)=>(t?.create&&Ts(e),e),"useDirectory");hn(async(e,t)=>{if(Ze.CACHE_DIR&&!["0","1","false","true"].includes(Ze.CACHE_DIR))return Rr(Ae(Ze.CACHE_DIR,e),t);const o=await ai("package.json",{cwd:t?.cwd??eo(),type:"file"});if(!o){if(t?.throwError)throw new vo("No such file or directory found.");return}const i=Ae(gn(o),"node_modules"),u=Ae(i,".cache"),f=Ae(u,e);if(!(Ue(f)&&!await Se(f,Ve))&&!(Ue(u)&&!await Se(u,Ve))&&!(Ue(i)&&!await Se(i,Ve)))return Rr(f,t)},"findCacheDirectory");const Qi=hn((e,t)=>{if(Ze.CACHE_DIR&&!["0","1","false","true"].includes(Ze.CACHE_DIR))return Rr(Ae(Ze.CACHE_DIR,e),t);const o=mi("package.json",{cwd:t?.cwd??eo(),type:"file"});if(!o){if(t?.throwError)throw new vo("No such file or directory found.");return}const i=Ae(gn(o),"node_modules"),u=Ae(i,".cache"),f=Ae(u,e);if(!(Ue(f)&&!Te(f,Ve))&&!(Ue(u)&&!Te(u,Ve))&&!(Ue(i)&&!Te(i,Ve)))return Rr(f,t)},"findCacheDirectorySync"),Oo=Qi,on=0,ko=4,Ru=Symbol("findUpStop"),Bu=/"(?:[^"\\]|\\.)*"|\/\/[^\r\n]*|\/\*[\s\S]*?\*\//g;var ea=Object.defineProperty,ta=$((e,t)=>ea(e,"name",{value:t,configurable:!0}),"t$a"),ra=Object.defineProperty,na=ta((e,t)=>ra(e,"name",{value:t,configurable:!0}),"t"),oa=Object.defineProperty,sa=na((e,t)=>oa(e,"name",{value:t,configurable:!0}),"n");const Fr=sa(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath");var ia=Object.defineProperty,aa=$((e,t)=>ia(e,"name",{value:t,configurable:!0}),"i$a"),ca=Object.defineProperty,la=aa((e,t)=>ca(e,"name",{value:t,configurable:!0}),"r"),ua=Object.defineProperty,fa=la((e,t)=>ua(e,"name",{value:t,configurable:!0}),"i");const Rn=fa(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType");var pa=Object.defineProperty,da=$((e,t)=>pa(e,"name",{value:t,configurable:!0}),"i$9"),ga=Object.defineProperty,Po=da((e,t)=>ga(e,"name",{value:t,configurable:!0}),"s");const ha=ze(import.meta.url),wr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ma=Po(e=>{if(typeof wr<"u"&&wr.versions&&wr.versions.node){const[t,o]=wr.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return wr.getBuiltinModule(e)}return ha(e)},"__cjs_getBuiltinModule"),{lstatSync:Bn,mkdirSync:ba}=ma("node:fs");var ya=Object.defineProperty,$a=Po((e,t)=>ya(e,"name",{value:t,configurable:!0}),"o");const Wr=$a(e=>{Fr(e);try{const t=Bn(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Rn(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{ba(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const o=Bn(e);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Rn(o))}'`,{cause:t})}},"ensureDirSync");var va=Object.defineProperty,xa=$((e,t)=>va(e,"name",{value:t,configurable:!0}),"$e"),wa=Object.defineProperty,mn=xa((e,t)=>wa(e,"name",{value:t,configurable:!0}),"W"),ja=Object.defineProperty,x=mn((e,t)=>ja(e,"name",{value:t,configurable:!0}),"u$1");let In=x(()=>{var e=(()=>{var t=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,f=x((r,n)=>{for(var s in n)t(r,s,{get:n[s],enumerable:!0})},"ne"),g=x((r,n,s,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of i(n))!u.call(r,a)&&a!==s&&t(r,a,{get:x(()=>n[a],"get"),enumerable:!(c=o(n,a))||c.enumerable});return r},"ae"),h=x(r=>g(t({},"__esModule",{value:!0}),r),"oe"),w={};f(w,{zeptomatch:x(()=>Ee,"zeptomatch")});var P=x(r=>{const n=new Set,s=[r];for(let c=0;c<s.length;c++){const a=s[c];if(n.has(a))continue;n.add(a);const{children:l}=a;if(l?.length)for(let p=0,m=l.length;p<m;p++)s.push(l[p])}return Array.from(n)},"M"),k=x(r=>{let n="";const s=P(r);for(let c=0,a=s.length;c<a;c++){const l=s[c];if(!l.regex)continue;const p=l.regex.flags;if(n||(n=p),n!==p)throw new Error(`Inconsistent RegExp flags used: "${n}" and "${p}"`)}return n},"se"),O=x((r,n,s)=>{const c=s.get(r);if(c!==void 0)return c;const a=r.partial??n;let l="";if(r.regex&&(l+=a?"(?:$|":"",l+=r.regex.source),r.children?.length){const p=C(r.children.map(m=>O(m,n,s)).filter(Boolean));if(p?.length){const m=r.children.some(q=>!q.regex||!(q.partial??n)),j=p.length>1||a&&(!l.length||m);l+=j?a?"(?:$|":"(?:":"",l+=p.join("|"),l+=j?")":""}}return r.regex&&(l+=a?")":""),s.set(r,l),l},"O"),N=x((r,n)=>{const s=new Map,c=P(r);for(let a=c.length-1;a>=0;a--){const l=O(c[a],n,s);if(!(a>0))return l}return""},"ie"),C=x(r=>Array.from(new Set(r)),"ue"),E=x((r,n,s)=>E.compile(r,s).test(n),"R");E.compile=(r,n)=>{const s=n?.partial??!1,c=N(r,s),a=k(r);return new RegExp(`^(?:${c})$`,a)};var G=E,X=x((r,n)=>{const s=G.compile(r,n),c=`${s.source.slice(0,-1)}[\\\\/]?$`,a=s.flags;return new RegExp(c,a)},"le"),se=X,_e=x(r=>{const n=r.map(c=>c.source).join("|")||"$^",s=r[0]?.flags;return new RegExp(n,s)},"ve"),Ne=_e,Q=x(r=>Array.isArray(r),"j"),B=x(r=>typeof r=="function","_"),Re=x(r=>r.length===0,"he"),Be=(()=>{const{toString:r}=Function.prototype,n=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return s=>(s.length===0||s.length===1)&&n.test(r.call(s))})(),Ye=x(r=>typeof r=="number","de"),Qe=x(r=>typeof r=="object"&&r!==null,"xe"),et=x(r=>r instanceof RegExp,"me"),tt=(()=>{const r=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return n=>r.test(n.source)})(),rt=(()=>{const r=/^[a-zA-Z0-9_-]+$/;return n=>r.test(n.source)&&!n.flags.includes("i")})(),fe=x(r=>typeof r=="string","A"),T=x(r=>r===void 0,"f"),nt=x(r=>{const n=new Map;return s=>{const c=n.get(s);if(c!==void 0)return c;const a=r(s);return n.set(s,a),a}},"ye"),pe=x((r,n,s={})=>{const c={cache:{},input:r,index:0,indexBacktrackMax:0,options:s,output:[]},a=z(n)(c),l=Math.max(c.index,c.indexBacktrackMax);if(a&&c.index===r.length)return c.output;throw new Error(`Failed to parse at index ${l}`)},"I"),d=x((r,n)=>Q(r)?ot(r,n):fe(r)?de(r,n):st(r,n),"i"),ot=x((r,n)=>{const s={};for(const c of r){if(c.length!==1)throw new Error(`Invalid character: "${c}"`);const a=c.charCodeAt(0);s[a]=!0}return c=>{const a=c.input;let l=c.index,p=l;for(;p<a.length&&a.charCodeAt(p)in s;)p+=1;if(p>l){if(!T(n)&&!c.options.silent){const m=a.slice(l,p),j=B(n)?n(m,a,`${l}`):n;T(j)||c.output.push(j)}c.index=p}return!0}},"we"),st=x((r,n)=>{if(rt(r))return de(r.source,n);{const s=r.source,c=r.flags.replace(/y|$/,"y"),a=new RegExp(s,c);return tt(r)&&B(n)&&!Be(n)?it(a,n):at(a,n)}},"$e"),it=x((r,n)=>s=>{const c=s.index,a=s.input;r.lastIndex=c;const l=r.exec(a);if(l){const p=r.lastIndex;if(!s.options.silent){const m=n(...l,a,`${c}`);T(m)||s.output.push(m)}return s.index=p,!0}else return!1},"Ee"),at=x((r,n)=>s=>{const c=s.index,a=s.input;if(r.lastIndex=c,r.test(a)){const l=r.lastIndex;if(!T(n)&&!s.options.silent){const p=B(n)?n(a.slice(c,l),a,`${c}`):n;T(p)||s.output.push(p)}return s.index=l,!0}else return!1},"Ce"),de=x((r,n)=>s=>{const c=s.index,a=s.input;if(a.startsWith(r,c)){if(!T(n)&&!s.options.silent){const l=B(n)?n(r,a,`${c}`):n;T(l)||s.output.push(l)}return s.index+=r.length,!0}else return!1},"F"),ee=x((r,n,s,c)=>{const a=z(r),l=n>1;return re(te(he(p=>{let m=0;for(;m<s;){const j=p.index;if(!a(p)||(m+=1,p.index===j))break}return m>=n},l),c))},"k"),ge=x((r,n)=>ee(r,0,1,n),"L"),K=x((r,n)=>ee(r,0,1/0,n),"$"),ct=x((r,n)=>ee(r,1,1/0,n),"Re"),I=x((r,n)=>{const s=r.map(z);return re(te(he(c=>{for(let a=0,l=s.length;a<l;a++)if(!s[a](c))return!1;return!0}),n))},"x"),A=x((r,n)=>{const s=r.map(z);return re(te(c=>{for(let a=0,l=s.length;a<l;a++)if(s[a](c))return!0;return!1},n))},"p"),he=x((r,n=!0,s=!1)=>{const c=z(r);return n?a=>{const l=a.index,p=a.output.length,m=c(a);return!m&&!s&&(a.indexBacktrackMax=Math.max(a.indexBacktrackMax,a.index)),(!m||s)&&(a.index=l,a.output.length!==p&&(a.output.length=p)),m}:c},"q"),te=x((r,n)=>{const s=z(r);return n?c=>{if(c.options.silent)return s(c);const a=c.output.length;if(s(c)){const l=c.output.splice(a,1/0),p=n(l);return T(p)||c.output.push(p),!0}else return!1}:s},"B"),re=(()=>{let r=0;return n=>{const s=z(n),c=r+=1;return a=>{var l;if(a.options.memoization===!1)return s(a);const p=a.index,m=(l=a.cache)[c]||(l[c]={indexMax:-1,queue:[]}),j=m.queue;if(p<=m.indexMax){const U=m.store||(m.store=new Map);if(j.length){for(let F=0,pr=j.length;F<pr;F+=2){const dr=j[F*2],gr=j[F*2+1];U.set(dr,gr)}j.length=0}const S=U.get(p);if(S===!1)return!1;if(Ye(S))return a.index=S,!0;if(S)return a.index=S.index,S.output?.length&&a.output.push(...S.output),!0}const q=a.output.length,fr=s(a);if(m.indexMax=Math.max(m.indexMax,p),fr){const U=a.index,S=a.output.length;if(S>q){const F=a.output.slice(q,S);j.push(p,{index:U,output:F})}else j.push(p,U);return!0}else return j.push(p,!1),!1}}})(),me=x(r=>{let n;return s=>(n||(n=z(r())),n(s))},"G"),z=nt(r=>{if(B(r))return Re(r)?me(r):r;if(fe(r)||et(r))return d(r);if(Q(r))return I(r);if(Qe(r))return A(Object.values(r));throw new Error("Invalid rule")}),_=x(r=>r,"d"),lt=x(r=>typeof r=="string","ke"),ut=x(r=>{const n=new WeakMap,s=new WeakMap;return(c,a)=>{const l=a?.partial?s:n,p=l.get(c);if(p!==void 0)return p;const m=r(c,a);return l.set(c,m),m}},"Be"),ft=x(r=>{const n={},s={};return(c,a)=>{const l=a?.partial?s:n;return l[c]??(l[c]=r(c,a))}},"Pe"),pt=d(/\\./,_),dt=d(/./,_),gt=d(/\*\*\*+/,"*"),ht=d(/([^/{[(!])\*\*/,(r,n)=>`${n}*`),mt=d(/(^|.)\*\*(?=[^*/)\]}])/,(r,n)=>`${n}*`),bt=K(A([pt,gt,ht,mt,dt])),yt=bt,$t=x(r=>pe(r,yt,{memoization:!1}).join(""),"Ie"),vt=$t,be="abcdefghijklmnopqrstuvwxyz",xt=x(r=>{let n="";for(;r>0;){const s=(r-1)%26;n=be[s]+n,r=Math.floor((r-1)/26)}return n},"Le"),ye=x(r=>{let n=0;for(let s=0,c=r.length;s<c;s++)n=n*26+be.indexOf(r[s])+1;return n},"V"),ne=x((r,n)=>{if(n<r)return ne(n,r);const s=[];for(;r<=n;)s.push(r++);return s},"b"),wt=x((r,n,s)=>ne(r,n).map(c=>String(c).padStart(s,"0")),"qe"),$e=x((r,n)=>ne(ye(r),ye(n)).map(xt),"W"),y=x(r=>({partial:!1,regex:new RegExp(r,"s"),children:[]}),"c"),L=x(r=>({children:r}),"y"),D=(()=>{const r=x((n,s,c)=>{if(c.has(n))return;c.add(n);const{children:a}=n;if(!a.length)a.push(s);else for(let l=0,p=a.length;l<p;l++)r(a[l],s,c)},"e");return n=>{if(!n.length)return L([]);for(let s=n.length-1;s>=1;s--){const c=new Set,a=n[s-1],l=n[s];r(a,l,c)}return n[0]}})(),M=x(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),jt=d(/\\./,y),Ot=d(/[$.*+?^(){}[\]\|]/,r=>y(`\\${r}`)),kt=d(/[\\\/]/,M),Pt=d(/[^$.*+?^(){}[\]\|\\\/]+/,y),Et=d(/^(?:!!)*!(.*)$/,(r,n)=>y(`(?!^${Ee.compile(n).source}$).*?`)),At=d(/^(!!)+/),St=A([Et,At]),Tt=d(/\/(\*\*\/)+/,()=>L([D([M(),y(".+?"),M()]),M()])),zt=d(/^(\*\*\/)+/,()=>L([y("^"),D([y(".*?"),M()])])),Mt=d(/\/(\*\*)$/,()=>L([D([M(),y(".*?")]),y("$")])),Ct=d(/\*\*/,()=>y(".*?")),ve=A([Tt,zt,Mt,Ct]),_t=d(/\*\/(?!\*\*\/|\*$)/,()=>D([y("[^\\\\/]*?"),M()])),Nt=d(/\*/,()=>y("[^\\\\/]*")),xe=A([_t,Nt]),we=d("?",()=>y("[^\\\\/]")),Rt=d("[",_),Bt=d("]",_),It=d(/[!^]/,"^\\\\/"),Dt=d(/[a-z]-[a-z]|[0-9]-[0-9]/i,_),Ft=d(/\\./,_),Wt=d(/[$.*+?^(){}[\|]/,r=>`\\${r}`),Lt=d(/[\\\/]/,"\\\\/"),qt=d(/[^$.*+?^(){}[\]\|\\\/]+/,_),Ut=A([Ft,Wt,Lt,Dt,qt]),je=I([Rt,ge(It),K(Ut),Bt],r=>y(r.join(""))),Zt=d("{","(?:"),Vt=d("}",")"),Gt=d(/(\d+)\.\.(\d+)/,(r,n,s)=>wt(+n,+s,Math.min(n.length,s.length)).join("|")),Kt=d(/([a-z]+)\.\.([a-z]+)/,(r,n,s)=>$e(n,s).join("|")),Jt=d(/([A-Z]+)\.\.([A-Z]+)/,(r,n,s)=>$e(n.toLowerCase(),s.toLowerCase()).join("|").toUpperCase()),Ht=A([Gt,Kt,Jt]),Oe=I([Zt,Ht,Vt],r=>y(r.join(""))),Xt=d("{"),Yt=d("}"),Qt=d(","),er=d(/\\./,y),tr=d(/[$.*+?^(){[\]\|]/,r=>y(`\\${r}`)),rr=d(/[\\\/]/,M),nr=d(/[^$.*+?^(){}[\]\|\\\/,]+/,y),or=me(()=>Pe),sr=d("",()=>y("(?:)")),ir=ct(A([ve,xe,we,je,Oe,or,er,tr,rr,nr]),D),ke=A([ir,sr]),Pe=I([Xt,ge(I([ke,K(I([Qt,ke]))])),Yt],L),ar=K(A([St,ve,xe,we,je,Oe,Pe,jt,Ot,kt,Pt]),D),cr=ar,lr=x(r=>pe(r,cr,{memoization:!1})[0],"kr"),ur=lr,oe=x((r,n,s)=>oe.compile(r,s).test(n),"N");oe.compile=(()=>{const r=ft((s,c)=>se(ur(vt(s)),c)),n=ut((s,c)=>Ne(s.map(a=>r(a,c))));return(s,c)=>lt(s)?r(s,c):n(s,c)})();var Ee=oe;return h(w)})();return e.default||e},"_lazyMatch"),en;const Oa=x((e,t)=>(en||(en=In(),In=null),en(e,t)),"default");var ka=Object.defineProperty,Pa=mn((e,t)=>ka(e,"name",{value:t,configurable:!0}),"t$1");const Ea=/^[A-Z]:\//i,ae=Pa((e="")=>e&&e.replaceAll("\\","/").replace(Ea,t=>t.toUpperCase()),"normalizeWindowsPath");var Aa=Object.defineProperty,H=mn((e,t)=>Aa(e,"name",{value:t,configurable:!0}),"r");const Sa=/^[/\\]{2}/,Ta=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,Eo=/^[A-Z]:$/i,Dn=/^\/([A-Z]:)?$/i,za=/.(\.[^./]+)$/,Ma=/^[/\\]|^[a-z]:[/\\]/i,Ca=/\/$/,_a=/^win/i,Na=H(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Iu="/",Du=_a.test(globalThis.process?.platform??"")?";":":",Ao=H((e,t)=>{let o="",i=0,u=-1,f=0,g;for(let h=0;h<=e.length;++h){if(h<e.length)g=e[h];else{if(g==="/")break;g="/"}if(g==="/"){if(!(u===h-1||f===1))if(f===2){if(o.length<2||i!==2||!o.endsWith(".")||o.at(-2)!=="."){if(o.length>2){const w=o.lastIndexOf("/");w===-1?(o="",i=0):(o=o.slice(0,w),i=o.length-1-o.lastIndexOf("/")),u=h,f=0;continue}else if(o.length>0){o="",i=0,u=h,f=0;continue}}t&&(o+=o.length>0?"/..":"..",i=2)}else o.length>0?o+=`/${e.slice(u+1,h)}`:o=e.slice(u+1,h),i=h-u-1;u=h,f=0}else g==="."&&f!==-1?++f:f=-1}return o},"normalizeString"),De=H(e=>Ta.test(e),"isAbsolute"),So=H(function(e){if(e.length===0)return".";e=ae(e);const t=Sa.exec(e),o=De(e),i=e.at(-1)==="/";return e=Ao(e,!o),e.length===0?o?"/":i?"./":".":(i&&(e+="/"),Eo.test(e)&&(e+="/"),t?o?`//${e}`:`//./${e}`:o&&!De(e)?`/${e}`:e)},"normalize"),Z=H((...e)=>{let t="";for(const o of e)if(o)if(t.length>0){const i=t.at(-1)==="/",u=o[0]==="/";i&&u?t+=o.slice(1):t+=i||u?o:`/${o}`}else t+=o;return So(t)},"join"),sn=H(function(...e){e=e.map(i=>ae(i));let t="",o=!1;for(let i=e.length-1;i>=-1&&!o;i--){const u=i>=0?e[i]:Na();!u||u.length===0||(t=`${u}/${t}`,o=De(u))}return t=Ao(t,!o),o&&!De(t)?`/${t}`:t.length>0?t:"."},"resolve");H(function(e){return ae(e)},"toNamespacedPath");const To=H(function(e){return za.exec(ae(e))?.[1]??""},"extname"),Fu=H(function(e,t){const o=sn(e).replace(Dn,"$1").split("/"),i=sn(t).replace(Dn,"$1").split("/");if(i[0][1]===":"&&o[0][1]===":"&&o[0]!==i[0])return i.join("/");const u=[...o];for(const f of u){if(i[0]!==f)break;o.shift(),i.shift()}return[...o.map(()=>".."),...i].join("/")},"relative"),Xe=H(e=>{const t=ae(e).replace(Ca,"").split("/").slice(0,-1);return t.length===1&&Eo.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(De(e)?"/":".")},"dirname");H(function(e){const t=[e.root,e.dir,e.base??e.name+e.ext].filter(Boolean);return ae(e.root?sn(...t):t.join("/"))},"format");const Ra=H((e,t)=>{const o=ae(e).split("/").pop();return t&&o.endsWith(t)?o.slice(0,-t.length):o},"basename"),Wu=H(function(e){const t=Ma.exec(e)?.[0]?.replaceAll("\\","/")??"",o=Ra(e),i=To(o);return{base:o,dir:Xe(e),ext:i,name:o.slice(0,o.length-i.length),root:t}},"parse");H((e,t)=>Oa(t,So(e)),"matchesGlob");var Ba=Object.defineProperty,We=$((e,t)=>Ba(e,"name",{value:t,configurable:!0}),"n$5"),Ia=Object.defineProperty,ue=We((e,t)=>Ia(e,"name",{value:t,configurable:!0}),"a");const Da=ze(import.meta.url),jr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fa=ue(e=>{if(typeof jr<"u"&&jr.versions&&jr.versions.node){const[t,o]=jr.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return jr.getBuiltinModule(e)}return Da(e)},"__cjs_getBuiltinModule"),{fileURLToPath:Wa}=Fa("node:url");var La=Object.defineProperty,Ke=ue((e,t)=>La(e,"name",{value:t,configurable:!0}),"t$1");function Lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}$(Lr,"m$4");We(Lr,"d");ue(Lr,"getDefaultExportFromCjs");Ke(Lr,"getDefaultExportFromCjs");function bn(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}$(bn,"h$3");We(bn,"O");ue(bn,"getDefaultExportFromNamespaceIfPresent");Ke(bn,"getDefaultExportFromNamespaceIfPresent");function yn(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}$(yn,"x$3");We(yn,"P");ue(yn,"getDefaultExportFromNamespaceIfNotNamed");Ke(yn,"getDefaultExportFromNamespaceIfNotNamed");function $n(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var o=Ke(ue(We($(function i(){var u=!1;try{u=this instanceof i}catch{}return u?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"a"),"s"),"a"),"a");o.prototype=t.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var u=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(o,i,u.get?u:{enumerable:!0,get:Ke(function(){return e[i]},"get")})}),o}$($n,"y$4");We($n,"_");ue($n,"getAugmentedNamespace");Ke($n,"getAugmentedNamespace");var Fn,Wn;function vn(){return Wn||(Wn=1,Fn=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Fn}$(vn,"w$3");We(vn,"k");ue(vn,"requireBinaryExtensions");var qa=vn();const Ua=Lr(qa);var Za=Object.defineProperty,ce=ue((e,t)=>Za(e,"name",{value:t,configurable:!0}),"r");const Va=new Set(Ua),Ga=new Set(["/","\\",void 0]),Ln=Symbol.for("pathe:normalizedAlias"),Ka=/(^|[/\\])([^/\\]+?)(?=(?:\.[^.]+)?$)/,Ja=ce((e,t)=>t.split("/").length-e.split("/").length,"compareAliases"),Br=ce((e="/")=>{const t=e.at(-1);return t==="/"||t==="\\"},"hasTrailingSlash"),zo=ce(e=>{if(e[Ln])return e;const t=Object.fromEntries(Object.entries(e).toSorted(([o],[i])=>Ja(o,i)));for(const o in t)for(const i in t)i===o||o.startsWith(i)||t[o].startsWith(i)&&Ga.has(t[o][i.length])&&(t[o]=t[i]+t[o].slice(i.length));return Object.defineProperty(t,Ln,{enumerable:!1,value:!0}),t},"normalizeAliases");ce((e,t)=>{e=ae(e),t=zo(t);for(const[o,i]of Object.entries(t)){if(!e.startsWith(o))continue;const u=Br(o)?o.slice(0,-1):o;if(Br(e[u.length]))return Z(i,e.slice(o.length))}return e},"resolveAlias");ce(e=>Ka.exec(e)?.[2],"filename");ce((e,t)=>{e=ae(e),t=zo(t);for(const[o,i]of Object.entries(t).toReversed()){if(!e.startsWith(i))continue;const u=Br(i)?i.slice(0,-1):i;if(Br(e[u.length]))return Z(o,e.slice(i.length))}return e},"reverseResolveAlias");const Ha=/^(?:\.?\.[/\\]|\.\.\B)/,Xa=/^(?:msys|cygwin)$/;ce(e=>Ha.test(e)||e==="..","isRelative");ce(e=>Va.has(To(e).slice(1).toLowerCase()),"isBinaryPath");const qr=ce(e=>ae(e instanceof URL?Wa(e):e),"toPath");ce(()=>{if(!globalThis.process)return!1;if(globalThis.process.platform==="win32"||globalThis.process.platform==="cygwin")return!0;const e=globalThis.process.env.OSTYPE;return typeof e!="string"?!1:Xa.test(e)},"isWindows");var Ya=Object.defineProperty,Mo=$((e,t)=>Ya(e,"name",{value:t,configurable:!0}),"t$8"),Qa=Object.defineProperty,xn=Mo((e,t)=>Qa(e,"name",{value:t,configurable:!0}),"t");const ec=ze(import.meta.url),Or=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,tc=xn(e=>{if(typeof Or<"u"&&Or.versions&&Or.versions.node){const[t,o]=Or.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Or.getBuiltinModule(e)}return ec(e)},"__cjs_getBuiltinModule"),{accessSync:rc}=tc("node:fs");var nc=Object.defineProperty,oc=xn((e,t)=>nc(e,"name",{value:t,configurable:!0}),"o");function V(e,t=on){Fr(e),e=qr(e);try{return rc(e,t),!0}catch{return!1}}$(V,"i$7");Mo(V,"d");xn(V,"m");oc(V,"isAccessibleSync");var sc=Object.defineProperty,Co=$((e,t)=>sc(e,"name",{value:t,configurable:!0}),"t$7"),ic=Object.defineProperty,_o=Co((e,t)=>ic(e,"name",{value:t,configurable:!0}),"t"),ac=Object.defineProperty,cc=_o((e,t)=>ac(e,"name",{value:t,configurable:!0}),"o");let qn=class extends Error{static{$(this,"c")}static{Co(this,"i")}static{_o(this,"n")}static{cc(this,"PermissionError")}constructor(t){super(`EPERM: Operation not permitted, ${t}`)}get code(){return"EPERM"}set code(t){throw new Error("Cannot overwrite code EPERM")}get name(){return"PermissionError"}set name(t){throw new Error("Cannot overwrite name of PermissionError")}};var lc=Object.defineProperty,uc=$((e,t)=>lc(e,"name",{value:t,configurable:!0}),"a$5"),fc=Object.defineProperty,No=uc((e,t)=>fc(e,"name",{value:t,configurable:!0}),"i");const pc=ze(import.meta.url),kr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ro=No(e=>{if(typeof kr<"u"&&kr.versions&&kr.versions.node){const[t,o]=kr.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return kr.getBuiltinModule(e)}return pc(e)},"__cjs_getBuiltinModule"),{readFileSync:dc}=Ro("node:fs"),{unzipSync:gc,brotliDecompressSync:hc}=Ro("node:zlib");var mc=Object.defineProperty,Bo=No((e,t)=>mc(e,"name",{value:t,configurable:!0}),"r");const bc={brotli:hc,gzip:gc,none:Bo(e=>e,"none")},yc=Bo((e,t)=>{if(Fr(e),e=qr(e),!V(e))throw new qn(`unable to read the non-accessible file: ${e}`);if(!V(e,ko))throw new qn(`invalid access to read file at: ${e}`);const{buffer:o,compression:i,encoding:u,flag:f}=t??{},g=dc(e,f?{encoding:u,flag:f}:{encoding:u}),h=bc[i??"none"],w=h(g);return o?w:w.toString()},"readFileSync");var $c=Object.defineProperty,vc=$((e,t)=>$c(e,"name",{value:t,configurable:!0}),"x$2"),xc=Object.defineProperty,Io=vc((e,t)=>xc(e,"name",{value:t,configurable:!0}),"$"),wc=Object.defineProperty,jc=Io((e,t)=>wc(e,"name",{value:t,configurable:!0}),"A"),Oc=Object.defineProperty,wn=jc((e,t)=>Oc(e,"name",{value:t,configurable:!0}),"$"),kc=Object.defineProperty,Pc=wn((e,t)=>kc(e,"name",{value:t,configurable:!0}),"r$1");const Ec=Pc(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
+
`),"normalizeLF"),Ac=globalThis.process??Object.create(null),Un={versions:{}},Zn=new Proxy(Ac,{get(e,t){if(t in e)return e[t];if(t in Un)return Un[t]}});var Sc=Object.defineProperty,Tc=wn((e,t)=>Sc(e,"name",{value:t,configurable:!0}),"b");const zc=Tc((e,t,o,i)=>{const u={column:0,line:-1,...e.start},f={...u,...e.end},g=u.line,h=u.column,w=f.line,P=f.column;let k=Math.max(g-(o+1),0),O=Math.min(t.length,w+i);g===-1&&(k=0),w===-1&&(O=t.length);const N=w-g,C={};if(N)for(let E=0;E<=N;E++){const G=E+g;if(!h)C[G]=!0;else if(E===0){const X=t[G-1]?.length;C[G]=[h,(X??0)-h+1]}else if(E===N)C[G]=[0,P];else{const X=t[G-E]?.length;C[G]=[0,X]}}else h===P?C[g]=h?[h,0]:!0:C[g]=[h,(P??0)-(h??0)];return{end:O,markerLines:C,start:k}},"getMarkerLines");var Mc=Object.defineProperty,_r=wn((e,t)=>Mc(e,"name",{value:t,configurable:!0}),"t");const Cc=Zn.platform==="win32"&&!Zn.env?.WT_SESSION?">":"❯",_c=_r((e,t,o)=>{const i={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...o,color:{gutter:_r(E=>E,"gutter"),marker:_r(E=>E,"marker"),message:_r(E=>E,"message"),...o?.color}},u=typeof t.start.column=="number";let f=Ec(e).split(`
|
|
3
|
+
`);typeof i.tabWidth=="number"&&(f=f.map(E=>E.replaceAll(" "," ".repeat(i.tabWidth))));const{end:g,markerLines:h,start:w}=zc(t,f,i.linesAbove,i.linesBelow),P=String(g).length,{gutter:k,marker:O,message:N}=i.color;let C=f.slice(w,g).map((E,G)=>{const X=w+1+G,se=h[X],_e=` ${String(X)}`.slice(-P),Ne=!h[X+1],Q=` ${_e}${i.showGutter?" |":""}`;if(se){let B="";if(Array.isArray(se)){const Re=E.replaceAll(/[^\t]/g," ").slice(0,Math.max(se[0]-1,0)),Be=se[1]||1;B=[`
|
|
4
|
+
`,i.prefix+k(Q.replaceAll(/\d/g," "))," ",Re,O("^").repeat(Be)].join(""),Ne&&i.message&&(B+=` ${N(i.message)}`)}return[i.prefix+O(Cc),k(Q),E.length>0?` ${E}`:"",B].join("")}return`${i.prefix} ${k(Q)}${E.length>0?` ${E}`:""}`}).join(`
|
|
5
|
+
`);return i.message&&!u&&(C=`${i.prefix+" ".repeat(P+1)+i.message}
|
|
6
|
+
${C}`),C},"codeFrame");var Nc=Object.defineProperty,Rc=Io((e,t)=>Nc(e,"name",{value:t,configurable:!0}),"s"),Bc=Object.defineProperty,Ic=Rc((e,t)=>Bc(e,"name",{value:t,configurable:!0}),"o"),Dc=Object.defineProperty,jn=Ic((e,t)=>Dc(e,"name",{value:t,configurable:!0}),"l");const Vn=jn((e,t)=>{let o=0,i=t.length-2;for(;o<i;){const u=o+(i-o>>1);if(e<t[u])i=u-1;else if(e>=t[u+1])o=u+1;else{o=u;break}}return o},"binarySearch"),Fc=/\n|\r(?!\n)/,Wc=jn(e=>e.split(Fc).reduce((t,o)=>(t.push(t.at(-1)+o.length+1),t),[0]),"getLineStartIndexes"),Lc=jn((e,t,o)=>{const i=o?.skipChecks??!1;if(!i&&(!Array.isArray(e)&&typeof e!="string"||(typeof e=="string"||Array.isArray(e))&&e.length===0))return{column:0,line:0};if(!i&&(typeof t!="number"||typeof e=="string"&&t>=e.length||Array.isArray(e)&&t+1>=e.at(-1)))return{column:0,line:0};if(typeof e=="string"){const f=Wc(e),g=Vn(t,f);return{column:t-f[g]+1,line:g+1}}const u=Vn(t,e);return{column:t-e[u]+1,line:u+1}},"indexToLineColumn");var qc=Object.defineProperty,Do=$((e,t)=>qc(e,"name",{value:t,configurable:!0}),"t$6"),Uc=Object.defineProperty,Fo=Do((e,t)=>Uc(e,"name",{value:t,configurable:!0}),"t"),Zc=Object.defineProperty,Vc=Fo((e,t)=>Zc(e,"name",{value:t,configurable:!0}),"i");let Gc=class extends Error{static{$(this,"m")}static{Do(this,"m")}static{Fo(this,"t")}static{Vc(this,"JSONError")}fileName;codeFrame;name="JSONError";#e;constructor(t){super(),this.#e=t}get message(){return`${this.#e}${this.fileName?` in ${this.fileName}`:""}${this.codeFrame?`
|
|
7
|
+
|
|
8
|
+
${this.codeFrame}
|
|
9
|
+
`:""}`}set message(t){this.#e=t}};var Kc=Object.defineProperty,Wo=$((e,t)=>Kc(e,"name",{value:t,configurable:!0}),"u$3"),Jc=Object.defineProperty,Lo=Wo((e,t)=>Jc(e,"name",{value:t,configurable:!0}),"s"),Hc=Object.defineProperty,zr=Lo((e,t)=>Hc(e,"name",{value:t,configurable:!0}),"a");const Xc=zr(e=>String.raw`\u{${e.codePointAt(0).toString(16)}}`,"getCodePoint"),Yc=zr((e,t,o)=>_c(e,{start:t},{tabWidth:!1,...o}),"generateCodeFrame"),Qc=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,el=zr((e,t)=>{const o=Qc.exec(t);if(!o)return;const[,i,u,f]=o;if(u&&f)return{column:Number(f),line:Number(u)};let g=Number(i);return g===e.length&&(g=e.length-1),Lc(e,g)},"getErrorLocation"),tl=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,rl=zr(e=>e.replace(tl,(t,o,i)=>`"${i}"(${Xc(i)})`),"addCodePointToUnexpectedToken");function Ur(e,t,o,i){typeof t=="string"&&(typeof o=="object"&&(i=o),o=t,t=void 0);let u;try{return JSON.parse(e,t)}catch(h){u=h.message}let f;e?(f=el(e,u),u=rl(u)):u+=" while parsing empty string";const g=new Gc(u);throw g.fileName=o,f&&(g.codeFrame=Yc(e,f,i)),g}$(Ur,"d$5");Wo(Ur,"w");Lo(Ur,"E");zr(Ur,"parseJson");var nl=Object.defineProperty,qo=$((e,t)=>nl(e,"name",{value:t,configurable:!0}),"t$5"),ol=Object.defineProperty,Uo=qo((e,t)=>ol(e,"name",{value:t,configurable:!0}),"t"),sl=Object.defineProperty,il=Uo((e,t)=>sl(e,"name",{value:t,configurable:!0}),"r");function Mr(e,t,o){typeof t=="object"&&(o=t,t=void 0);const i=yc(e,{buffer:!0,encoding:void 0});let u=new TextDecoder().decode(i);const{beforeParse:f,color:g}=o??{};return typeof f=="function"&&(u=f(u)),Ur(u,t,qr(e),{color:g})}$(Mr,"n$3");qo(Mr,"s");Uo(Mr,"J");il(Mr,"readJsonSync");var al=Object.defineProperty,cl=$((e,t)=>al(e,"name",{value:t,configurable:!0}),"a$3"),ll=Object.defineProperty,ul=cl((e,t)=>ll(e,"name",{value:t,configurable:!0}),"t"),fl=Object.defineProperty,pl=ul((e,t)=>fl(e,"name",{value:t,configurable:!0}),"e");const dl=pl(e=>{if(typeof e!="string"&&!(e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")},"assertValidFileContents");var gl=Object.defineProperty,hl=$((e,t)=>gl(e,"name",{value:t,configurable:!0}),"t$3"),ml=Object.defineProperty,bl=hl((e,t)=>ml(e,"name",{value:t,configurable:!0}),"r"),yl=Object.defineProperty,$l=bl((e,t)=>yl(e,"name",{value:t,configurable:!0}),"f");const vl=new TextEncoder,xl=$l(e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return vl.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")},"toUint8Array");var wl=Object.defineProperty,jl=$((e,t)=>wl(e,"name",{value:t,configurable:!0}),"m"),Ol=Object.defineProperty,Zo=jl((e,t)=>Ol(e,"name",{value:t,configurable:!0}),"s");const kl=ze(import.meta.url),Pr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Pl=Zo(e=>{if(typeof Pr<"u"&&Pr.versions&&Pr.versions.node){const[t,o]=Pr.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Pr.getBuiltinModule(e)}return kl(e)},"__cjs_getBuiltinModule"),{mkdirSync:El,writeFileSync:Al,statSync:Sl,renameSync:Gn,chownSync:Tl,chmodSync:zl,unlinkSync:Ml}=Pl("node:fs");var Cl=Object.defineProperty,_l=Zo((e,t)=>Cl(e,"name",{value:t,configurable:!0}),"f");const Nl=_l((e,t,o)=>{o={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...o},Fr(e),dl(t),e=qr(e);const i=`${e}.tmp`;try{const u=V(e,on);if(!u&&o.recursive){const g=Xe(e);V(g,on)||El(g,{recursive:!0})}let f;if(Al(i,xl(t),{encoding:o.encoding,flag:o.flag}),u&&!o.overwrite&&(f=Sl(e),o.chown??={gid:f.gid,uid:f.uid},Gn(e,`${e}.bak`)),o.chown)try{Tl(i,o.chown.uid,o.chown.gid)}catch{}zl(i,f&&!o.mode?f.mode:o.mode??438),Gn(i,e)}catch(u){throw new Error(`Failed to write file at: ${e} - ${u.message}`,{cause:u})}finally{V(i)&&Ml(`${e}.tmp`)}},"writeFileSync");var Rl=Object.defineProperty,Me=$((e,t)=>Rl(e,"name",{value:t,configurable:!0}),"i$2"),Bl=Object.defineProperty,Ce=Me((e,t)=>Bl(e,"name",{value:t,configurable:!0}),"s"),Il=Object.defineProperty,Le=Ce((e,t)=>Il(e,"name",{value:t,configurable:!0}),"i");const Dl=/^(?:( )+|\t+)/,Cr="space";function Sr(e,t,o){return e&&t===Cr&&o===1}$(Sr,"d$3");Me(Sr,"g");Ce(Sr,"I");Le(Sr,"shouldIgnoreSingleSpace");function Tr(e,t){const o=new Map;let i=0,u,f;for(const g of e.split(/\n/g)){if(!g)continue;const h=g.match(Dl);if(h===null)i=0,u="";else{const w=h[0].length,P=h[1]?Cr:"tab";if(Sr(t,P,w))continue;P!==u&&(i=0),u=P;let k=1,O=0;const N=w-i;if(i=w,N===0)k=0,O=1;else{const E=Math.abs(N);if(Sr(t,P,E))continue;f=Zr(P,E)}const C=o.get(f);o.set(f,C===void 0?[1,0]:[C[0]+k,C[1]+O])}}return o}$(Tr,"p");Me(Tr,"y");Ce(Tr,"h");Le(Tr,"makeIndentsMap");function Zr(e,t){return(e===Cr?"s":"t")+String(t)}$(Zr,"b$1");Me(Zr,"v");Ce(Zr,"m");Le(Zr,"encodeIndentsKey");function Vr(e){const t=e[0]==="s"?Cr:"tab",o=Number(e.slice(1));return{type:t,amount:o}}$(Vr,"v");Me(Vr,"M");Ce(Vr,"_");Le(Vr,"decodeIndentsKey");function Gr(e){let t,o=0,i=0;for(const[u,[f,g]]of e)(f>o||f===o&&g>i)&&(o=f,i=g,t=u);return t}$(Gr,"I");Me(Gr,"S");Ce(Gr,"k");Le(Gr,"getMostUsedKey");function Kr(e,t){return(e===Cr?" ":" ").repeat(t)}$(Kr,"h$1");Me(Kr,"k");Ce(Kr,"D");Le(Kr,"makeIndentString");function Jr(e){if(typeof e!="string")throw new TypeError("Expected a string");let t=Tr(e,!0);t.size===0&&(t=Tr(e,!1));const o=Gr(t);let i,u=0,f="";return o!==void 0&&({type:i,amount:u}=Vr(o),f=Kr(i,u)),{amount:u,type:i,indent:f}}$(Jr,"M");Me(Jr,"x");Ce(Jr,"C");Le(Jr,"detectIndent");var Fl=Object.defineProperty,Wl=$((e,t)=>Fl(e,"name",{value:t,configurable:!0}),"a$1"),Ll=Object.defineProperty,Vo=Wl((e,t)=>Ll(e,"name",{value:t,configurable:!0}),"i");const ql=ze(import.meta.url),Er=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ul=Vo(e=>{if(typeof Er<"u"&&Er.versions&&Er.versions.node){const[t,o]=Er.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Er.getBuiltinModule(e)}return ql(e)},"__cjs_getBuiltinModule"),{readFileSync:Zl}=Ul("node:fs");var Vl=Object.defineProperty,Gl=Vo((e,t)=>Vl(e,"name",{value:t,configurable:!0}),"r");const Go=Gl((e,t,o={})=>{const{detectIndent:i,indent:u,replacer:f,stringify:g=JSON.stringify,...h}={indent:" ",...o};let w=u,P=`
|
|
10
|
+
`;if(V(e,ko))try{const O=Zl(e,"utf8");if(i){const{indent:N}=Jr(O);w=N}P=O.endsWith(`
|
|
11
|
+
`)?`
|
|
12
|
+
`:""}catch(O){if(O.code!=="ENOENT")throw O}const k=g(t,f,w);Nl(e,`${k}${P}`,h)},"writeJsonSync");var Kl=Object.defineProperty,Jl=$((e,t)=>Kl(e,"name",{value:t,configurable:!0}),"s$1");class Hr extends Error{static{$(this,"VisConfigError")}static{Jl(this,"VisConfigError")}chain;constructor(t,o,i){super(t,i),this.name=this.constructor.name,this.chain=o}}var Hl=Object.defineProperty,Xl=$((e,t)=>Hl(e,"name",{value:t,configurable:!0}),"e");class Yl extends Hr{static{$(this,"VisConfigCycleError")}static{Xl(this,"VisConfigCycleError")}constructor(t,o){const i=[...o,`${t} (re-enters)`].join(" → ");super(`Config cycle: ${i}`,o)}}var Ql=Object.defineProperty,eu=$((e,t)=>Ql(e,"name",{value:t,configurable:!0}),"s");class Ko extends Hr{static{$(this,"VisConfigDeprecatedKeyError")}static{eu(this,"VisConfigDeprecatedKeyError")}filePath;removedKeys;constructor(t,o,i){const u=[`${t} uses removed keys.`,""];for(const f of i){const g=f.location?` (at ${f.location})`:"";u.push(` • ${f.name}${g} → renamed to \`${f.renamedTo}\``);for(const h of f.children??[])u.push(` ↳ ${h.name} → renamed to \`${h.renamedTo}\``)}u.push("","Run `vis migrate self` to auto-rewrite the config (use --dry-run to preview)."),super(u.join(`
|
|
13
|
+
`),o),this.filePath=t,this.removedKeys=i}}var tu=Object.defineProperty,ru=$((e,t)=>tu(e,"name",{value:t,configurable:!0}),"t$1");class Kn extends Hr{static{$(this,"VisConfigLoadError")}static{ru(this,"VisConfigLoadError")}constructor(t,o,i){const u=i instanceof Error?i.message:String(i),f=o.length>0?`
|
|
14
|
+
Chain: ${o.join(" → ")}`:"";super(`Failed to load ${t}: ${u}${f}`,o,{cause:i})}}var nu=Object.defineProperty,Jo=$((e,t)=>nu(e,"name",{value:t,configurable:!0}),"t");const ou=Jo(e=>e.join(" → "),"formatChain");class tn extends Hr{static{$(this,"VisConfigNotFoundError")}static{Jo(this,"VisConfigNotFoundError")}constructor(t,o,i){const u=o.length>0?o[o.length-1]:"<unknown>",f=i.length>0?`
|
|
15
|
+
Tried:
|
|
16
|
+
${i.join(`
|
|
17
|
+
`)}`:"";super(`Cannot resolve "${t}" extended from ${u}.${f}
|
|
18
|
+
Chain: ${ou(o)}`,o)}}var su=Object.defineProperty,Ho=$((e,t)=>su(e,"name",{value:t,configurable:!0}),"i$1");const Jn="@inherit",iu=["aliases","dependsOn","inputs","outputs"],au=Ho((e,t)=>{if(t===void 0)return e===void 0?void 0:[...e];if(!t.includes(Jn))return[...t];const o=[];for(const i of t){if(i===Jn){e!==void 0&&o.push(...e);continue}o.push(i)}return o},"mergeArrayWithInherit"),cu=Ho((e,t)=>{const o={...e,...t};for(const i of iu){const u=e?.[i],f=t?.[i],g=au(u,f);g===void 0?delete o[i]:o[i]=g}return o},"mergeTargetWithInherit");var lu=Object.defineProperty,Xr=$((e,t)=>lu(e,"name",{value:t,configurable:!0}),"o");const uu=Xr(e=>{const t=[];if(Object.hasOwn(e,"targetDefaults")&&t.push({name:"targetDefaults",renamedTo:"tasks"}),Object.hasOwn(e,"taskRunnerOptions")&&t.push({name:"taskRunnerOptions",renamedTo:"taskRunner"}),Object.hasOwn(e,"taskDefaults")){const{taskDefaults:o}=e,i=[];if(Array.isArray(o))for(const[u,f]of o.entries())f&&typeof f=="object"&&(Object.hasOwn(f,"scope")&&i.push({location:`taskDefaults[${u}].scope`,name:"scope",renamedTo:"match"}),Object.hasOwn(f,"targets")&&i.push({location:`taskDefaults[${u}].targets`,name:"targets",renamedTo:"tasks"}));t.push({children:i.length>0?i:void 0,name:"taskDefaults",renamedTo:"scopedTasks"})}else if(Array.isArray(e.scopedTasks))for(const[o,i]of e.scopedTasks.entries())i&&typeof i=="object"&&(Object.hasOwn(i,"scope")&&t.push({location:`scopedTasks[${o}].scope`,name:"scope",renamedTo:"match"}),Object.hasOwn(i,"targets")&&t.push({location:`scopedTasks[${o}].targets`,name:"targets",renamedTo:"tasks"}));return t},"detectDeprecatedConfigKeys"),fu=Xr(e=>Object.hasOwn(e,"targets")&&!Object.hasOwn(e,"tasks")?[{name:"targets",renamedTo:"tasks"}]:[],"detectDeprecatedTaskKeys"),pu=Xr((e,t,o)=>{if(!o||typeof o!="object")return;const i=uu(o);if(i.length>0)throw new Ko(e,t,i)},"assertNoDeprecatedConfigKeys"),du=Xr((e,t,o)=>{if(!o||typeof o!="object")return;const i=fu(o);if(i.length>0)throw new Ko(e,t,i)},"assertNoDeprecatedTaskKeys");var gu=Object.defineProperty,R=$((e,t)=>gu(e,"name",{value:t,configurable:!0}),"r");const Xo=["vis.config.ts","vis.config.mts","vis.config.cts","vis.config.js","vis.config.mjs","vis.config.cjs"],hu=new Set(Xo),Yo=["vis.task.ts","vis.task.mts","vis.task.cts","vis.task.js","vis.task.mjs","vis.task.cjs"],mu=new Set(Yo),Uu=2880,rn={blockExoticSubdeps:!0,policies:{installScripts:{strict:!0},publisherChange:{ignoreAfter:43200,mode:"no-downgrade"}}},bu=R(e=>{if(!e)return{...rn};const t=rn.policies??{},o=e.policies??{},i={...t,...o};for(const u of Object.keys(t)){const f=t[u],g=o[u];f!==void 0&&g!==void 0&&(i[u]={...f,...g})}return{...rn,...e,policies:i}},"mergeSecurityDefaults"),an=R(e=>({...e,security:bu(e.security),update:{security:!0,target:"minor",...e.update}}),"applyDefaults"),yu=R(e=>{let t;try{t=Xn(e)}catch{return}const o=new Set(t.filter(i=>hu.has(i)));for(const i of Xo)if(o.has(i))return Z(e,i)},"findVisConfigFile"),$u=R(e=>{let t;try{t=Xn(e)}catch{return}const o=new Set(t.filter(i=>mu.has(i)));for(const i of Yo)if(o.has(i))return Z(e,i)},"findVisTaskConfigFile"),On=R(e=>Hn("sha256").update(os(e)).digest("hex"),"hashFileContents"),vu=R(e=>{const t=Hn("sha256"),o=[...e].sort();for(const i of o)t.update(i),t.update(":"),t.update(On(i)),t.update(`
|
|
19
|
+
`);return t.digest("hex")},"hashConfigChain"),xu=R(e=>{const t=Z(e,"node_modules");if(V(t)){const i=Z(t,".cache","vis");return Wr(i),Z(i,"vis-config-cache.json")}const o=Oo("vis",{create:!0,cwd:e});return o?Z(o,"vis-config-cache.json"):void 0},"getConfigCachePath"),wu=R((e,t)=>{if(V(e))try{const o=Mr(e);if(o.hash===t)return o.config}catch{}},"readConfigCache"),ju=R((e,t,o)=>{try{Wr(Xe(e)),Go(e,{config:o,hash:t})}catch{}},"writeConfigCache"),Ou=R(e=>e===void 0?[]:Array.isArray(e)?e:[e],"normalizeExtends"),ku=R((e,t,o)=>{if(De(e))throw new tn(e,[...o,t],["Absolute paths in `extends` are not supported. Use a relative path or an npm package name."]);const i=[];if(e.startsWith("./")||e.startsWith("../")){const u=Xe(t),f=Z(u,e);if(i.push(f),V(f))return f;throw new tn(e,[...o,t],i)}try{return ze(t).resolve(e)}catch{throw i.push(`require.resolve("${e}") from ${t}`),new tn(e,[...o,t],i)}},"resolveExtendsSpecifier"),Qo=R(async(e,t,o)=>{const i=On(t),u=t.slice(t.lastIndexOf(".")),f=Z(Xe(t),`.vis-config-tmp-${i}${u}`);ss(t,f);let g;try{g=await e.import(f,{default:!0,try:!0})??{}}catch(h){throw new Kn(t,o,h)}finally{try{is(f)}catch{}}try{return(typeof g=="function"?await g()??{}:g)??{}}catch(h){throw new Kn(t,o,h)}},"loadRawConfig"),Pu=R((e,t)=>{const o={...e,...t};if(e.tasks||t.tasks){const i=new Set([...Object.keys(e.tasks??{}),...Object.keys(t.tasks??{})]),u={};for(const f of i)u[f]=cu(e.tasks?.[f],t.tasks?.[f]);o.tasks=u}if((e.scopedTasks||t.scopedTasks)&&(o.scopedTasks=[...e.scopedTasks??[],...t.scopedTasks??[]]),(e.fileGroups||t.fileGroups)&&(o.fileGroups={...e.fileGroups,...t.fileGroups}),(e.taskGroups||t.taskGroups)&&(o.taskGroups={...e.taskGroups,...t.taskGroups}),e.security||t.security){const i=e.security?.policies??{},u=t.security?.policies??{},f={...i,...u};for(const g of Object.keys(i)){const h=i[g],w=u[g];h!==void 0&&w!==void 0&&(f[g]={...h,...w})}o.security={...e.security,...t.security,acceptedRisks:{...e.security?.acceptedRisks,...t.security?.acceptedRisks},policies:f}}return(e.update||t.update)&&(o.update={...e.update,...t.update}),(e.taskRunner||t.taskRunner)&&(o.taskRunner={...e.taskRunner,...t.taskRunner}),delete o.extends,o},"mergeVisConfigs"),es=R(async(e,t,o,i,u,f)=>{if(i.has(t))throw new Yl(t,o);if(!u.has(t)){i.add(t);try{const g=await Qo(e,t,o);pu(t,o,g);const h=Ou(g.extends);for(const w of h){const P=ku(w,t,o);await es(e,P,[...o,t],i,u,f)}u.set(t,g),f.push(t)}finally{i.delete(t)}}},"resolveConfigChain"),Zu=R(async(e,t)=>{let o;if(t?.explicitConfigPath){const O=De(t.explicitConfigPath)?t.explicitConfigPath:Z(e,t.explicitConfigPath);if(!V(O))throw new Error(`Cannot find config file at ${O}`);o=O}else o=yu(e);if(!o)return an({});const i=Yn(e,{fsCache:!1,moduleCache:!1}),u=new Set,f=new Map,g=[];await es(i,o,[],u,f,g);const h=vu(g),w=xu(e);if(w){const O=wu(w,h);if(O)return O}let P={};for(const O of g)P=Pu(P,f.get(O));const k=an(P);return w&&ju(w,h,k),k},"loadVisConfig"),Eu=R(e=>e.replaceAll(/[^\w.-]+/g,"_"),"sanitizeProjectName"),Au=R((e,t)=>{const o=Z(e,"node_modules"),i=Eu(t);if(V(o)){const f=Z(o,".cache","vis","task-configs");return Wr(f),Z(f,`${i}.json`)}const u=Oo("vis",{create:!0,cwd:e});return u?Z(u,"task-configs",`${i}.json`):void 0},"getVisTaskCachePath"),Su=R((e,t)=>{if(V(e))try{const o=Mr(e);if(o.hash===t)return o.config}catch{}},"readVisTaskCache"),Tu=R((e,t,o)=>{try{Wr(Xe(e)),Go(e,{config:o,hash:t})}catch{}},"writeVisTaskCache"),Vu=R(async(e,t,o)=>{const i=$u(t);if(!i)return;const u=On(i),f=Au(e,o);if(f){const P=Su(f,u);if(P)return P}const g=Yn(t,{fsCache:!1,moduleCache:!1}),h=await Qo(g,i,[]);du(i,[],h);const w=h;return f&&Tu(f,u,w),w},"loadVisTaskConfig"),Gu=R(e=>e,"defineTaskConfig"),Ku=R(e=>an(e),"defineConfig");export{yc as $,Jr as A,Nl as B,sn as C,cu as D,$u as G,Uu as H,Oo as K,So as L,Z as M,De as O,Ra as Q,qr as U,Yo as V,on as _,Gu as a,Wr as b,Ku as c,Du as d,Zu as e,Iu as f,Xe as g,Xo as h,V as i,yu as j,Wu as k,rn as l,Fr as m,Mr as n,Rn as o,Bu as p,Ru as q,Vu as r,qn as s,ko as t,Ur as u,dl as v,Go as w,xl as x,an as y,Fu as z};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var h=Object.defineProperty;var p=(e,t)=>h(e,"name",{value:t,configurable:!0});import{I as g,a as l,j as b,E as n,q as d,e as m,p as f}from"./bin.js";import{ReapiRemoteCache as k,resolveTurboEnvCompat as $}from"@visulima/task-runner";var w=Object.defineProperty,s=p((e,t)=>w(e,"name",{value:t,configurable:!0}),"s");const y=s((e,t)=>t==="http"||t==="reapi"?t:e.startsWith("grpc://")||e.startsWith("grpcs://")?"reapi":"http","inferBackend"),S=s(async(e,t)=>{const o=Date.now(),a=new AbortController,r=setTimeout(()=>{a.abort()},t);try{const i=await fetch(e,{method:"HEAD",signal:a.signal});return{backend:"http",durationMs:Date.now()-o,httpStatus:i.status,ok:!0,url:e}}catch(i){return{backend:"http",durationMs:Date.now()-o,error:i instanceof Error?i.message:String(i),ok:!1,url:e}}finally{clearTimeout(r)}},"probeHttp"),C=s(async(e,t)=>{const o=Date.now(),a=new k({...e,timeout:t});try{return{backend:"reapi",capabilities:await a.probeCapabilities(),durationMs:Date.now()-o,ok:!0,url:e.url}}catch(r){return{backend:"reapi",durationMs:Date.now()-o,error:r instanceof Error?r.message:String(r),ok:!1,url:e.url}}finally{try{await a.close()}catch{}}},"probeReapi"),D=s(e=>{const t=[],o=e.ok?g("OK"):l("FAIL");if(t.push(`${b("Remote cache")} ${o}`),t.push(` ${n("URL:")} ${d(e.url)}`),t.push(` ${n("Backend:")} ${e.backend}`),t.push(` ${n("Latency:")} ${String(e.durationMs)}ms`),e.httpStatus!==void 0&&t.push(` ${n("Status:")} ${String(e.httpStatus)}`),e.capabilities){const a=e.capabilities.digestFunctions.length>0?e.capabilities.digestFunctions.join(", "):m("(none advertised)");t.push(` ${n("Digests:")} ${a}`),t.push(` ${n("Batch:")} ${String(e.capabilities.maxBatchTotalSizeBytes)} bytes`)}return e.error&&t.push(` ${n("Error:")} ${l(e.error)}`),t.join(`
|
|
2
|
+
`)},"formatTable"),x=s(async({logger:e,options:t,visConfig:o})=>{const a=$((o??{}).taskRunner?.remoteCache),r=t.url??a?.url,i=t.format??"table",u=t.timeout??5e3;if(!r){f.error("No remote cache configured. Set taskRunner.remoteCache.url in vis.config.ts, pass --url=..., or export TURBO_API."),process.exitCode=1;return}const c=y(r,t.backend)==="reapi"?await C({...a??{url:r},backend:"reapi",url:r},u):await S(r,u);i==="json"?e.log(JSON.stringify(c,null,2)):e.log(D(c)),c.ok||(process.exitCode=1)},"cacheDoctorExecute");export{x as cacheDoctorExecute};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var T=Object.defineProperty;var v=(e,t)=>T(e,"name",{value:t,configurable:!0});import{createRequire as q}from"node:module";import{j as $,E as P,e as R,q as D,a as j,I,p}from"./bin.js";import{z as _}from"./config.js";import{r as W,a as B,b as L,c as w}from"../packem_shared/ai-fix-DzrA-dVz.js";import{l as N}from"../packem_shared/failure-log-C3LEMmkq.js";const A=q(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,J=v(e=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[t,r]=m.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return m.getBuiltinModule(e)}return A(e)},"__cjs_getBuiltinModule"),{createInterface:z}=J("node:readline");var M=Object.defineProperty,l=v((e,t)=>M(e,"name",{value:t,configurable:!0}),"c");const U={"ambiguous-match":"ambiguous match",applied:"applied",error:"error","missing-file":"missing file","no-match":"no match","outside-workspace":"outside workspace"},S=l((e,t,r)=>{const o=W(e,t,r),s=_(e,o);return s===""||s.startsWith("..")?o:s},"formatDisplayPath"),E=l((e,t,r)=>{const o=[$(`Fix proposal (${e.provider}, confidence: ${e.confidence})`),"",e.explanation||P("<no explanation>")];if(e.cannotFix)return o.push(""),o.push(R(`Cannot fix automatically: ${e.cannotFix}`)),o.join(`
|
|
2
|
+
`);if(e.patches.length===0)return o.push(""),o.push(R("No patches were proposed.")),o.join(`
|
|
3
|
+
`);o.push(""),o.push($(`Patches (${String(e.patches.length)}):`));for(const[s,i]of e.patches.entries()){const a=S(t,r,i.file);o.push(""),o.push(D(`[${String(s+1)}] ${a}`)),i.reason&&o.push(P(` reason: ${i.reason}`));for(const c of i.oldString.split(`
|
|
4
|
+
`))o.push(j(` - ${c}`));for(const c of i.newString.split(`
|
|
5
|
+
`))o.push(I(` + ${c}`))}return o.join(`
|
|
6
|
+
`)},"formatProposalText"),C=l((e,t,r)=>{const o=[];for(const s of e){const i=s.absolutePath?_(t,s.absolutePath)||s.absolutePath:S(t,r,s.patch.file),a=U[s.status];s.status==="applied"?o.push(I(` ✓ ${i}: ${a}`)):o.push(j(` ✗ ${i}: ${a}${s.error?` (${s.error})`:""}`))}return o.join(`
|
|
7
|
+
`)},"formatPatchResultsText"),x=l(e=>{let t=0,r=0;for(const o of e)o.status==="applied"?t+=1:r+=1;return{applied:t,failed:r}},"summarizePatchResults"),G=l(e=>new Promise(t=>{const r=z({input:process.stdin,output:process.stderr});r.question(`${e} (y/N) `,o=>{r.close();const s=o.trim().toLowerCase();t(s==="y"||s==="yes")})}),"confirmPrompt"),H=l(e=>e??process.cwd(),"resolveWorkspaceRoot"),tt=l(async({argument:e,logger:t,options:r,visConfig:o,workspaceRoot:s})=>{const i=e[0],a=H(s),c=(r.format??"text")==="json";if(!i){if(c){const f=N(a);process.stdout.write(`${JSON.stringify({availableTasks:f,error:"No task ID specified"},void 0,2)}
|
|
8
|
+
`)}else{p.error("No task ID specified. Usage: vis ai fix <project>:<target>");const f=N(a);if(f.length>0){p.info("Tasks with captured failure logs:");for(const h of f)p.info(` - ${h}`)}else p.notice("No failure logs found. Re-run a failing task with `vis run` to capture logs.")}process.exitCode=1;return}const n=await B(a,i,{runId:r.run});if(!n){c?process.stdout.write(`${JSON.stringify({error:"No failure log or run summary found",taskId:i},void 0,2)}
|
|
9
|
+
`):(p.error(`No failure log or run summary found for task "${i}".`),p.notice("Re-run the task with `vis run` so its terminal output and run metadata are captured.")),process.exitCode=1;return}n.terminalOutputCaptured||p.warn(`No captured terminal output for "${i}". Re-run with \`vis run\` for a better fix proposal.`);const F=o?.ai,u=await L(n,t,{cache:r.cache!==!1,config:F});if(!u){c&&process.stdout.write(`${JSON.stringify({error:"AI fix proposal failed or no provider available",taskId:i},void 0,2)}
|
|
10
|
+
`),process.exitCode=1;return}const g=r.apply===!0;if(c){const f=g?void 0:await w(a,n.cwd,u,{dryRun:!0}),h=g?await w(a,n.cwd,u):void 0;if(process.stdout.write(`${JSON.stringify({appliedResults:h,dryRunResults:f,failureContext:{cwd:n.cwd,hash:n.hash,runId:n.runId,taskId:n.taskId,terminalOutputCaptured:n.terminalOutputCaptured},proposal:u},void 0,2)}
|
|
11
|
+
`),g&&h){const{failed:O}=x(h);O>0&&(process.exitCode=1)}return}if(t.info(E(u,a,n.cwd)),u.cannotFix||u.patches.length===0)return;const k=await w(a,n.cwd,u,{dryRun:!0}),y=x(k);if(t.info(""),t.info($("Patch validation:")),t.info(C(k,a,n.cwd)),!g){t.info(""),p.info("Re-run with --apply to write these patches to disk.");return}if(y.applied===0){p.error("No patches can be applied (every patch failed validation)."),process.exitCode=1;return}if(r.yes!==!0&&(t.info(""),!await G(`Apply ${String(y.applied)} patch${y.applied===1?"":"es"} to disk?`))){p.notice("Aborted. Nothing written.");return}const b=await w(a,n.cwd,u),d=x(b);t.info(""),t.info($("Apply results:")),t.info(C(b,a,n.cwd)),t.info(""),d.failed===0?p.success(`Applied ${String(d.applied)} patch${d.applied===1?"":"es"}.`):(p.warn(`${String(d.applied)} applied, ${String(d.failed)} failed.`),process.exitCode=1)},"aiFix");export{tt as aiFix};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var O=Object.defineProperty;var w=(t,e)=>O(t,"name",{value:e,configurable:!0});import{createTaskGraph as b}from"@visulima/task-runner";import{y as E,m as R}from"./bin.js";import{r as x,f as G}from"../packem_shared/selectors-B2ISH581.js";var J=Object.defineProperty,m=w((t,e)=>J(t,"name",{value:e,configurable:!0}),"u");const P=m((t,e,n)=>{const c=[],o=new Set,l=m((r,f)=>{if(o.has(r))return;o.add(r);const s=e[r]??[];for(const i of s)l(i,f+1);const d=n[r],u=" ".repeat(f);c.push(`${u}${r}${d?.cache===!1?" (no-cache)":""}`)},"walk");for(const r of t)l(r,0);return c},"renderPlan"),S=m((t,e,n)=>({roots:t,tasks:Object.fromEntries(Object.entries(n).map(([c,o])=>[c,{cache:o.cache,dependsOn:e[c]??[],outputs:o.outputs,parallelism:o.parallelism,projectRoot:o.projectRoot,target:o.target}]))}),"toJson"),B=m(async({argument:t,logger:e,options:n,visConfig:c,workspaceRoot:o})=>{const l=t[0];if(!l)throw new Error("Missing selector. Usage: vis action-graph <selector>");if(!o)throw new Error("Could not determine workspace root. Run inside a monorepo.");const{config:r,packageJsons:f,workspace:s}=E(o,c),d=R(o,s,f),u=await x(l,s,process.cwd(),o),{target:i}=u;let h=u.projects;n.query&&(h=G(h,s,n.query));const j=h.filter(p=>s.projects[p]?.targets?.[i]!==void 0);if(j.length===0){e.info(`No projects have a "${i}" target.`);return}const y=j.map(p=>{const k=s.projects[p],g=k.targets?.[i],$={project:p,target:i};return{cache:g?.cache,id:`${p}:${i}`,outputs:g?.outputs??[],overrides:{command:g?.command},parallelism:g?.parallelism,projectRoot:k.root,target:$}}),a=b(y,{projectGraph:d,targetDefaults:r.tasks,workspace:s});if(n.json){e.info(JSON.stringify(S(a.roots,a.dependencies,a.tasks),null,2));return}const v=P(a.roots,a.dependencies,a.tasks);e.info(`Execution plan (${Object.keys(a.tasks).length} task(s), ${a.roots.length} root(s)):`),e.info("");for(const p of v)e.info(p)},"execute");export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=Object.defineProperty;var n=(o,r)=>d(o,"name",{value:r,configurable:!0});import{f as m,l as g}from"./bin.js";import{o as u}from"../packem_shared/utils-DrNg0XTR.js";var v=Object.defineProperty,k=n((o,r)=>v(o,"name",{value:r,configurable:!0}),"t");const b=k(async({argument:o,logger:r,options:e,visConfig:s,workspaceRoot:t})=>{const a=o;if(!a||a.length===0)throw new Error("No command specified. Usage: vis exec <command> [args...]");const[i,...f]=a,l=t??process.cwd(),p=m(l,{configBackend:s?.install?.backend,configCorepack:s?.install?.corepack}),c=g(p,{args:f,command:i,filter:u(e.filter),parallel:e.parallel||!1,recursive:e.recursive||!1,reverse:e.reverse||!1,shellMode:e.shellMode||!1,workspaceRoot:e.workspaceRoot||!1},l,r);c!==0&&(process.exitCode=c)},"execute");export{b as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var g=Object.defineProperty;var a=(e,i)=>g(e,"name",{value:i,configurable:!0});import{createRequire as _}from"node:module";import{M as r,i as u,$ as p,B as $}from"./config.js";import{B as j}from"./bin.js";const b=_(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=a(e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[i,s]=c.versions.node.split(".").map(Number);if(i>22||i===22&&s>=3||i===20&&s>=16)return c.getBuiltinModule(e)}return b(e)},"__cjs_getBuiltinModule"),{rmSync:y}=d("node:fs"),{homedir:n}=d("node:os"),{createInterface:w}=d("node:readline");var T=Object.defineProperty,m=a((e,i)=>T(e,"name",{value:i,configurable:!0}),"l");const f=j(),h=[r(n(),".zshrc"),r(n(),".zshenv"),r(n(),".bashrc"),r(n(),".bash_profile"),r(n(),".profile"),r(n(),".config","fish","config.fish")],M=m(e=>{const i=[];for(const s of h)if(u(s))try{const l=p(s).split(`
|
|
2
|
+
`),o=l.filter(t=>!t.includes(".vis/bin")&&!t.includes("VIS_HOME")&&!t.includes("# vis "));o.length!==l.length&&($(s,o.join(`
|
|
3
|
+
`)),i.push(s))}catch{e.warn(`warning: could not clean ${s}`)}return i},"cleanShellProfiles"),P=m(async({logger:e,options:i})=>{if(!u(f)){e.info("vis is not installed (no ~/.vis directory found).");return}e.info("This will remove:"),e.info(` ${f}/`);const s=h.filter(o=>u(o)&&p(o).includes(".vis"));for(const o of s)e.info(` Lines in ${o}`);if(!i.yes){if(!process.stdin.isTTY)throw new Error("Non-interactive terminal. Use --yes to confirm.");const o=w({input:process.stdin,output:process.stdout}),t=await new Promise(v=>{o.question(`
|
|
4
|
+
Type "uninstall" to confirm: `,v)});if(o.close(),t.trim()!=="uninstall"){e.info("Aborted.");return}}const l=M(e);for(const o of l)e.info(`Cleaned ${o}`);try{y(f,{force:!0,recursive:!0}),e.info(`
|
|
5
|
+
✓ Removed ${f}`)}catch(o){throw new Error(`Failed to remove ${f}: ${o instanceof Error?o.message:String(o)}`,{cause:o})}e.info("✓ vis has been uninstalled.")},"execute");export{P as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l=Object.defineProperty;var r=(e,a)=>l(e,"name",{value:a,configurable:!0});import{f as g,C as d}from"./bin.js";var k=Object.defineProperty,u=r((e,a)=>k(e,"name",{value:a,configurable:!0}),"t");const w=u(async({argument:e,logger:a,options:c,visConfig:n,workspaceRoot:i})=>{if(!e||e.length===0)throw new Error("No package specified. Usage: vis info <package> [field...]");const[t,...f]=e,s=i??process.cwd(),p=g(s,{configBackend:n?.install?.backend,configCorepack:n?.install?.corepack}),o=d(p,{fields:f,json:c.json||!1,package:t},s,a);o!==0&&o!==1&&(process.exitCode=o)},"execute");export{w as default};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var N=Object.defineProperty;var w=(t,e)=>N(t,"name",{value:e,configurable:!0});import{createRequire as T}from"node:module";import{i as $,M as b,H as g,B as S,j as I}from"./config.js";import{p as s,A as P}from"./bin.js";import{O as q}from"../packem_shared/build-scripts-DsWMSWDs.js";import{N as x}from"../packem_shared/native-config-sync-Dvi1g2nQ.js";import{E as R}from"../packem_shared/min-release-age-BFozFonQ.js";const M=T(import.meta.url),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=w(t=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[e,o]=p.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return p.getBuiltinModule(t)}return M(t)},"__cjs_getBuiltinModule"),{execFileSync:A}=_("node:child_process"),{createInterface:E}=_("node:readline");var K=Object.defineProperty,d=w((t,e)=>K(t,"name",{value:e,configurable:!0}),"u");const F=d(t=>{const e=[];return $(b(t,"turbo.json"))&&e.push("turborepo"),$(b(t,"nx.json"))&&e.push("nx"),$(b(t,".moon"))&&e.push("moon"),e},"detectExistingTools"),C=d((t,e)=>new Promise(o=>{t.question(e,i=>{o(i.trim())})}),"ask"),m=d(async(t,e,o=!0)=>{const i=await C(t,`${e} ${o?"[Y/n]":"[y/N]"} `);return i===""?o:i.toLowerCase()==="y"||i.toLowerCase()==="yes"},"confirm"),j=d((t,e)=>{const o=[],i=Object.entries(e.allowBuilds).filter(([,l])=>l).map(([l])=>` "${l}": true,`).join(`
|
|
2
|
+
`),a=[` installScripts: {
|
|
3
|
+
allow: ${i?`{
|
|
4
|
+
${i}
|
|
5
|
+
}`:"{}"},
|
|
6
|
+
},`];e.minimumReleaseAge!==void 0&&a.push(` firstSeen: {
|
|
7
|
+
minutes: ${String(e.minimumReleaseAge)},
|
|
8
|
+
},`);let r=` policies: {
|
|
9
|
+
${a.join(`
|
|
10
|
+
`)}
|
|
11
|
+
},`;return e.enableSocket&&(r+=`
|
|
12
|
+
socket: { enabled: true },`),o.push(` security: {
|
|
13
|
+
${r}
|
|
14
|
+
},`),e.staged&&o.push(` staged: {
|
|
15
|
+
"*.{ts,tsx}": "eslint --fix",
|
|
16
|
+
"*.{ts,tsx,js,jsx,json,md}": "prettier --write",
|
|
17
|
+
},`),`import { defineConfig } from "@visulima/vis/config";
|
|
18
|
+
|
|
19
|
+
export default defineConfig({
|
|
20
|
+
${o.join(`
|
|
21
|
+
|
|
22
|
+
`)}
|
|
23
|
+
});
|
|
24
|
+
`},"generateConfigContent"),Y=d(async(t,e,o)=>{const i=E({input:process.stdin,output:process.stdout});s.info(`
|
|
25
|
+
vis init — interactive setup
|
|
26
|
+
`);const a=await m(i," Enable Socket.dev security scanning?");a&&(s.success(" Socket.dev enabled — scores, alerts, and supply chain data active."),process.env.VIS_SOCKET_TOKEN||s.notice(" Set VIS_SOCKET_TOKEN for a custom API token (optional).")),s.info("");const r=await m(i," Scan for packages with build scripts?"),l={};if(r){s.info(" Scanning node_modules...");const c=q(t,{});if(c.length>0){s.info(` Found ${String(c.length)} package${c.length===1?"":"s"} with build scripts:
|
|
27
|
+
`);for(const n of c){const u=await m(i,` Allow ${n}?`,!1),k=n.split(" (")[0]??n;l[k]=u,u&&s.success(` ✓ ${k} approved`)}}else s.info(" No packages with build scripts found.")}s.info("");const O=await m(i," Enforce a minimum release age (block freshly-published versions)?");let f;if(O){const c=await C(i,` Minimum age in minutes (default ${String(g)} = 2 days): `),n=c===""?g:Number.parseInt(c,10);f=Number.isFinite(n)&&n>0?n:g,s.success(` minimumReleaseAge: ${String(f)} minutes`)}s.info("");const v=await m(i," Set up pre-commit hooks (lint-staged)?",!1);let y=!1;(e.name==="pnpm"||e.name==="yarn"||e.name==="npm"||e.name==="bun")&&(s.info(""),y=await m(i,` Sync security settings to ${e.name} config?`));const h=F(t);if(h.length>0&&(s.info(""),s.info(` Detected existing tools: ${h.join(", ")}`),await m(i,` Run \`vis migrate\` for ${h.join(", ")}?`,!1))){i.close();const[c,...n]=e.name==="pnpm"?["pnpm","exec"]:e.name==="yarn"?["yarn","exec"]:e.name==="bun"?["bunx"]:["npx"];for(const u of h){s.info(` Migrating from ${u}...`);try{A(c,[...n,"vis","migrate",u],{cwd:t,stdio:"inherit"})}catch{s.warn(` Migration from ${u} had issues — run \`vis migrate ${u}\` manually.`)}}if($(o))s.success(`Migrated config written to ${o}`);else{const u=j(e.name,{allowBuilds:l,enableSocket:a,minimumReleaseAge:f,staged:v});S(o,u),s.success(`Created ${o}`)}s.notice(" Run 'vis doctor' to see your project's full health status.");return}i.close(),s.info("");const B=j(e.name,{allowBuilds:l,enableSocket:a,minimumReleaseAge:f,staged:v});if(S(o,B),s.success(`Created ${o}`),y){const c=Object.fromEntries(Object.entries(l).filter(([,n])=>n));for(const n of x(e.name,t,c))s.success(` ${n}`);for(const n of R(e.name,t,f))s.success(` ${n}`)}s.info(""),s.info(" Setup complete. Your config:"),s.info(` Security: ${a?"Socket.dev enabled":"defaults only"}`),s.info(` Build scripts: ${Object.values(l).filter(Boolean).length} approved`),s.info(` Min age: ${f===void 0?"not enforced":`${String(f)} minutes`}`),s.info(` Git hooks: ${v?"lint-staged configured":"not configured"}`),s.info(` PM sync: ${y?"done":"skipped"}`),s.info(""),s.notice(" Run 'vis doctor' to see your project's full health status."),s.info("")},"runInteractiveInit"),L=d((t,e,o,i)=>{const a=j(e.name,{allowBuilds:{},enableSocket:!1,minimumReleaseAge:g,staged:!1});if(S(i,a),s.success(`Created ${i}`),s.info(" Secure defaults applied automatically by defineConfig()."),o.syncNative){for(const r of x(e.name,t,{}))s.success(` ${r}`);for(const r of R(e.name,t,g))s.success(` ${r}`)}s.info(""),s.notice("Run 'vis doctor' for a full health check, or 'vis init' in a terminal for guided setup.")},"runStaticInit"),Q=d(async({options:t,workspaceRoot:e})=>{const o=e??process.cwd(),i=P(o),a=I(o);if(a&&!t.force){s.warn(`Config already exists: ${a}`),s.notice("Use --force to overwrite, or edit the existing file.");return}const r=a??b(o,"vis.config.ts");process.stdin.isTTY&&t.interactive!==!1?await Y(o,i,r):L(o,i,t,r)},"execute");export{Q as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var k=Object.defineProperty;var v=(s,a)=>k(s,"name",{value:a,configurable:!0});import{p,I as y,E as w,a as N,e as M}from"./bin.js";import{g as R,r as x,a as S,M as A,b as P,c as b,d as j,e as E,f as B,h as I,i as O,j as C,k as D}from"../packem_shared/signatures-5ZdjJ2Pu.js";var V=Object.defineProperty,l=v((s,a)=>V(s,"name",{value:a,configurable:!0}),"c");const $=new Set(["archivedRepo","author","downloads","expiredDomains","metadata","newBin","provenance","signatures"]),F=l(s=>{const a=s.trim();if(a==="")return;if(a.startsWith("@")){const o=a.indexOf("@",1);return o===-1?{name:a,spec:void 0}:{name:a.slice(0,o),spec:a.slice(o+1)||void 0}}const i=a.indexOf("@");return i===-1?{name:a,spec:void 0}:{name:a.slice(0,i),spec:a.slice(i+1)||void 0}},"parsePackageArg"),L=l(s=>{if(s===void 0||s.trim()==="")return;const a=new Set;for(const i of s.split(",")){const o=i.trim();if(!$.has(o))throw new Error(`Unknown marshall in --only: ${o}. Known: ${[...$].sort().join(", ")}.`);a.add(o)}return a},"parseOnlyFlag"),d=l((s,a)=>s===void 0||s.has(a),"should"),U=l(s=>s?.has("signatures")??!1,"shouldRunSignatures"),G=l(async({argument:s,options:a,workspaceRoot:i})=>{if(!s||s.length===0)throw new Error("No package specified. Usage: vis inspect <package>[@<spec>]");const o=F(s[0]);if(o===void 0)throw new Error(`Invalid package argument: "${String(s[0])}". Usage: vis inspect <package>[@<spec>]`);const t=L(a.only),u=await R(o.name,{workspaceRoot:i});if(u===void 0){p.error(`Package ${o.name} not found in the registry.`),process.exitCode=2;return}const g=x(u,o.spec);if(g===void 0){p.error(`Could not resolve ${o.name}@${o.spec??"latest"} to a published version.`),process.exitCode=2;return}const c=[{name:o.name,version:g}],r=new A;if(d(t,"author")){const n=await S(c,{workspaceRoot:i});for(const e of n)r.add({marshall:"author",message:e.message,packageName:e.packageName,severity:e.severity})}if(d(t,"provenance")){const n=await P(c);for(const e of n)r.add({marshall:"provenance",message:`Prior version ${e.priorVersionWithProvenance} had provenance but ${e.version} does not.`,packageName:e.packageName,severity:"error"})}if(d(t,"newBin")){const n=await b(c);for(const e of n){const m=e.newBins.map(h=>h.command).join(", ");r.add({marshall:"newBin",message:`${e.toVersion} adds new bin script${e.newBins.length===1?"":"s"}: ${m} (prior: ${e.fromVersion}).`,packageName:e.packageName,severity:"warning"})}}if(d(t,"metadata")){const n=await j(c,{workspaceRoot:i});for(const e of n)r.add({marshall:"metadata",message:`Missing/invalid metadata: ${e.issues.join(", ")}.`,packageName:e.packageName,severity:"warning"})}if(d(t,"downloads")){const n=await E([o.name]);for(const e of n){const m=e.downloadsLastMonth===void 0?"unknown":String(e.downloadsLastMonth);r.add({marshall:"downloads",message:e.kind==="no-data"?"npm stats API returned no monthly download data.":`Only ${m} downloads in the past month.`,packageName:e.packageName,severity:e.severity})}}if(d(t,"expiredDomains")){const n=await B(c,{workspaceRoot:i});for(const e of n)r.add({marshall:"expiredDomains",message:e.kind==="expired"?`Maintainer email domain ${e.domain} (${e.maintainer}) is unregistered — potential hijack risk.`:`Could not verify maintainer email domain ${e.domain} (${e.maintainer}).`,packageName:e.packageName,severity:e.severity})}if(U(t)){const n=await I(c,{workspaceRoot:i});for(const e of n)r.add({marshall:"signatures",message:e.message,packageName:e.packageName,severity:e.severity})}if(d(t,"archivedRepo")){const n=await O(c,{workspaceRoot:i});for(const e of n)r.add({marshall:"archivedRepo",message:e.kind==="archived"?`Source repo ${e.owner}/${e.repo} is archived${e.archivedAt===void 0?"":` (since ${e.archivedAt})`}.`:`Source repo ${e.owner}/${e.repo} returned 404 from GitHub.`,packageName:e.packageName,severity:"warning"})}const f=r.all();if(a.json===!0)process.stdout.write(`${JSON.stringify(C(f),void 0,2)}
|
|
2
|
+
`);else{const n=`${o.name}@${g}`;if(f.length===0)p.info(`${y("✓")} ${n} — no findings.`);else{p.info(`${w("Inspecting")} ${n}`);for(const h of D(f))process.stdout.write(`${h}
|
|
3
|
+
`);const e=r.errors().length,m=r.warnings().length;process.stdout.write(`
|
|
4
|
+
${w("Summary:")} ${N(`${String(e)} error${e===1?"":"s"}`)}, ${M(`${String(m)} warning${m===1?"":"s"}`)}.
|
|
5
|
+
`)}}(r.hasErrors()||a.strict===!0&&!r.isEmpty())&&(process.exitCode=1)},"execute");export{G as default,F as parsePackageArg};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var I=Object.defineProperty;var u=(s,r)=>I(s,"name",{value:r,configurable:!0});import{createRequire as P}from"node:module";import{i as $,M as h,g as F,k as G}from"./config.js";import{p as n,A as H,f as K,L as N,M as W}from"./bin.js";import{s as J}from"../packem_shared/typosquats-BCeR-sLf.js";import{o as Q}from"../packem_shared/utils-DrNg0XTR.js";const T=P(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=u(s=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[r,t]=l.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return l.getBuiltinModule(s)}return T(s)},"__cjs_getBuiltinModule"),{rmSync:D}=A("node:fs");var U=Object.defineProperty,y=u((s,r)=>U(s,"name",{value:r,configurable:!0}),"u");const V=["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json","bun.lock","bun.lockb"],X=y(s=>{let r=s;for(;;){for(const e of V)if($(h(r,e)))return!0;const t=F(r);if(t===r||G(r).root===r)return!1;r=t}},"hasLockfile"),g=new Set(["aube","auto","bun","npm","pnpm","yarn"]),te=y(async s=>{const{argument:r,logger:t,options:e,visConfig:c,workspaceRoot:b}=s,a=b??process.cwd();if(r&&r.length>0){const o=e,{default:q}=await import("./handler16.js"),j=o.marshallCheck===!1||o["no-marshall-check"]===!0?!1:void 0,R=o.socketCheck===!1||o["no-socket-check"]===!0?!1:void 0,S=o.typosquatCheck===!1||o["no-typosquat-check"]===!0?!1:void 0,z=o.runScripts===!0||o["run-scripts"]===!0,L=o.workspaceRoot===!0||o["workspace-root"]===!0,M=o.saveOptional===!0||o["save-optional"]===!0,B=e.dev===!0,E={autoInstallPeers:!1,exact:o.exact===!0,filter:e.filter,global:!1,marshallCheck:j,runScripts:z,saveDev:B,saveOptional:M,savePeer:!1,socketCheck:R,to:void 0,typosquatCheck:S,workspace:!1,workspaceRoot:L};await q({...s,argument:r,options:E});return}if(e.typosquatCheck!==!1&&!await J(a,c?.security?.typosquatAllowlist)){process.exitCode=1;return}const i=e.installer;if(i&&!g.has(i)){n.error(`Invalid --installer value: "${i}". Expected one of: ${[...g].join(", ")}.`),process.exitCode=1;return}const w=i,C=e.aube===!1;let f;try{f=C?H(a):K(a,{backend:w,configBackend:c?.install?.backend,configCorepack:c?.install?.corepack})}catch(o){n.error(o instanceof Error?o.message:String(o)),process.exitCode=1;return}const k=N(a,f);k&&n.warn(k);const _=Q(e.filter),p=e.ci||!1,d=e.frozenLockfile||p,x=e.frozenLockfile===!1||e.force||e.lockfileOnly,O=X(a),m=d||!x&&O;if(!d&&m&&!e.silent&&n.info("Defaulting to frozen lockfile (pass --no-frozen-lockfile to allow lockfile updates)."),p){n.info("Clean install: removing node_modules...");try{D(h(a,"node_modules"),{force:!0,recursive:!0})}catch(o){n.error(`Failed to remove node_modules: ${o instanceof Error?o.message:String(o)}`),process.exitCode=1;return}}const v=W(f,{dev:e.dev||!1,filter:_,force:e.force||!1,frozenLockfile:m,ignoreScripts:!e.runScripts,lockfileOnly:e.lockfileOnly||!1,noOptional:e.optional===!1,offline:e.offline||!1,prod:e.prod||!1,recursive:e.recursive||!1,silent:e.silent||!1,workspaceRoot:e.workspaceRoot||!1},a,t,{ciMode:p,preferOffline:e.preferOffline||!1});v!==0&&(process.exitCode=v)},"execute");export{te as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var q=Object.defineProperty;var $=(s,n)=>q(s,"name",{value:n,configurable:!0});import{createRequire as O}from"node:module";import{W as I,a8 as C,a9 as N,p as f,aa as x,E as j,a as B,e as z,I as M,ab as U,ac as J,N as W,y as Q,U as V,R as Y,ad as G,M as H,i as K,J as X,ae as Z,f as ee,af as oe}from"./bin.js";import{M as se,n as te,w as re}from"./config.js";import{r as D,a as ne,b as ae,p as ie}from"../packem_shared/resolve-explicit-CC4Kifk5.js";import{r as ce}from"../packem_shared/typosquats-BCeR-sLf.js";import{d as E,o as R}from"../packem_shared/utils-DrNg0XTR.js";const A=O(import.meta.url),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,L=$(s=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[n,e]=h.versions.node.split(".").map(Number);if(n>22||n===22&&e>=3||n===20&&e>=16)return h.getBuiltinModule(s)}return A(s)},"__cjs_getBuiltinModule"),{createInterface:F}=L("node:readline");var le=Object.defineProperty,v=$((s,n)=>le(s,"name",{value:n,configurable:!0}),"c");const P=v(s=>s==="default"?"catalog:":`catalog:${s}`,"buildCatalogRef"),b=v(s=>s==="default"?"default catalog":`catalog "${s}"`,"labelForCatalog"),pe=v((s,n)=>{const e=[];for(const[o,t]of n)o.includes(":")||t.has(s)&&e.push(o);if(e.length===0)return;if(e.length===1){const[o]=e;return{source:b(o),spec:P(o)}}const a=e.find(o=>o==="default")??e[0],i=e.filter(o=>o!==a);return{candidates:[...e],conflict:!0,source:`${b(a)} (also in: ${i.map(o=>b(o)).join(", ")})`,spec:P(a)}},"resolveFromCatalogs"),fe=v((s,n)=>{const e=new Map;for(const[c,l]of n){if(!c.includes(":"))continue;const u=l.get(s);u!==void 0&&e.set(u,(e.get(u)??0)+1)}if(e.size===0)return;const a=[...e.entries()],i=a.reduce((c,[,l])=>c+l,0);if(a.length===1){const[[c]]=a;return{source:`siblings (${String(i)} pkg${i===1?"":"s"} on ${c})`,spec:c}}const o=[...a].sort((c,l)=>l[1]-c[1]),[t,r]=o[0],p=o.slice(1).map(([c,l])=>`${c} (×${String(l)})`);return{candidates:o.map(([c])=>c),conflict:!0,source:`siblings (most common: ${t} ×${String(r)}; conflicts: ${p.join(", ")})`,spec:t}},"resolveFromSiblings"),ue=v((s,n)=>pe(s,n)||fe(s,n),"conformToCatalog");var ge=Object.defineProperty,d=$((s,n)=>ge(s,"name",{value:n,configurable:!0}),"u");const de=d((s,n,e)=>{const a=[];for(const i of s.values()){const{overall:o}=i.score,t=I(o),r=`${String(Math.round(o*100))}%`,p=i.alerts.length,c=C(i),l=N(c,i.version,e),u=t==="red"?B:t==="yellow"?z:M;if(l?f.info(` ${u(r)} ${x(i)} ${j(`[accepted: ${l.reason}]`)}`):f.info(` ${u(r)} ${x(i)}`),p>0){const g=i.alerts.filter(m=>m.severity==="critical"||m.severity==="high").length;g>0&&f.warn(` ${String(g)} critical/high alert${g===1?"":"s"}`)}o<n&&!l&&a.push(i)}return a},"displaySecurityReports"),me=d(async(s,n)=>{const e=F({input:process.stdin,output:process.stdout}),a=d(r=>new Promise(p=>{e.question(r,c=>{p(c.trim())})}),"ask"),i=String(Math.round(n*100));f.warn(""),f.warn(`${String(s.length)} package${s.length===1?"":"s"} scored below the minimum threshold (${i}%):`);for(const r of s){const p=C(r),c=`${String(Math.round(r.score.overall*100))}%`;f.warn(` • ${p}@${r.version} — score: ${c} (${U(r.score.overall)})`)}f.warn("");const o=await a("Continue adding these packages? [y/N] ");if(o.toLowerCase()!=="y"&&o.toLowerCase()!=="yes")return e.close(),!1;const t=await a("Remember this decision? (prints config snippet) [y/N] ");if(e.close(),t.toLowerCase()==="y"||t.toLowerCase()==="yes"){f.notice(""),f.notice("Add the following to security.acceptedRisks in vis.config.ts:"),f.notice("");for(const r of s){const p=C(r),c=J(p,r.version,r.score.overall,"Reviewed and accepted");f.notice(c)}f.notice("")}return!0},"confirmLowScorePackages"),ke=d(async(s,n,e,a)=>{const i=await D(s);if(i.length===0)return!0;f.info(""),f.info("Socket.dev security check:");const o=await W(i,n);if(o.size===0)return f.info(" Could not fetch security data. Proceeding."),!0;const t=de(o,e,a);return t.length===0?(f.info(""),!0):process.stdin.isTTY?me(t,e):(f.warn(`Aborting: ${String(t.length)} package${t.length===1?"":"s"} below minimum score. Use --no-socket-check to skip.`),!1)},"runSocketPreCheck"),we=["dependencies","devDependencies","peerDependencies","optionalDependencies"],he=d(s=>s.savePeer?"peerDependencies":s.saveOptional?"optionalDependencies":s.saveDev?"devDependencies":"dependencies","pickDepSection"),_=d((s,n)=>s.startsWith("catalog:")||!n?s:s.replace(/^[\^~]/,""),"applyExactPrefix"),ve=d(async(s,n)=>{const e=[];for(const o of s){const{name:t,versionSpec:r}=E(o);if(!t)continue;if(r!==void 0){e.push({explicit:r,name:t});continue}const p=ue(t,n);if(p){p.conflict&&f.warn(`${t}: ambiguous constraint — picking ${p.spec} (${p.source}). Pass ${t}@<version> to override.`),e.push({entry:{name:t,source:p.source,spec:p.spec},kind:"resolved",name:t});continue}e.push({kind:"missing",name:t})}const a=e.filter(o=>"kind"in o&&o.kind==="missing").map(o=>o.name),i=a.length>0?await ne(a):new Map;return e.map(o=>{if("explicit"in o)return{name:o.name,source:"explicit",spec:o.explicit};if(o.kind==="resolved")return o.entry;const t=i.get(o.name);if(t===void 0)throw new Error(`--to: cannot resolve a version for "${o.name}" (not in any catalog or sibling, and registry lookup failed). Pass ${o.name}@<version> explicitly.`);const r=`^${t}`;return f.info(`${o.name}: no existing constraint — using registry latest (${r}). Add to a catalog to share this version across workspace packages.`),{name:o.name,source:"registry latest",spec:r}})},"planConformedSpecs"),$e=d((s,n,e,a)=>{for(const{name:i,spec:o}of n){const t=_(o,a);for(const p of we){if(p===e)continue;const c=s[p];c?.[i]!==void 0&&(delete c[i],Object.keys(c).length===0&&delete s[p])}let r=s[e];r===void 0&&(r={},s[e]=r),r[i]=t}},"applyPlannedSpecsToPackageJson"),ye=d(async({ignoreScripts:s,logger:n,options:e,packages:a,pm:i,target:o,visConfig:t,workspaceRoot:r})=>{const{workspace:p}=Q(r,t??{}),c=p.projects[o];if(!c){const k=Object.keys(p.projects).sort();throw new Error(`--to: workspace package "${o}" not found. Available: ${k.length>0?k.slice(0,10).join(", "):"(none)"}${k.length>10?`, ... (${String(k.length-10)} more)`:""}.`)}const l=se(r,c.root,"package.json"),{packageManager:u}=V(r),g=Y(r,u),m=he(e),w=e.exact??!1,y=await ve(a,g);if(y.length===0)return 0;const S=te(l);$e(S,y,m,w),re(l,S,{indent:G(l,{useEditorconfig:t?.editorconfig??!0}),overwrite:!0});for(const k of y){const T=_(k.spec,w);f.info(`${M("+")} ${k.name}@${T} → ${o}/${m} (${j(k.source)})`)}return H(i,{dev:!1,filter:[],force:!1,frozenLockfile:!1,ignoreScripts:s,lockfileOnly:!1,noOptional:!1,offline:!1,prod:!1,recursive:!1,silent:!1,workspaceRoot:!1},r,n)},"applyConformedAdd"),Me=d(async({argument:s,logger:n,options:e,visConfig:a,workspaceRoot:i})=>{let o=s;if(!o||o.length===0)throw new Error("No packages specified. Usage: vis add <packages...>");if(e.typosquatCheck!==!1){const l=o.map(g=>E(g)),u=await ce(l.map(g=>g.name),a?.security?.typosquatAllowlist);if(!u.ok){process.exitCode=1;return}o=l.map((g,m)=>{const w=u.packages[m];return w!==g.name?g.versionSpec?`${w}@${g.versionSpec}`:w??"":o[m]??""})}if(e.marshallCheck!==!1){const l=await D(o);if(l.length>0){const u=await ae(l,{config:a?.security?.marshalls,workspaceRoot:i});if(!await ie(u)){process.exitCode=1;return}}}if(e.socketCheck!==!1&&!K("socket")){const l=X(a?.security?.socket,a?.security?.policies?.score?.minimum);if(l&&!await ke(o,l,l.minimumScore??Z,a?.security?.acceptedRisks)){process.exitCode=1;return}}const t=process.cwd(),r=ee(i??t,{configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),p=!e.runScripts;if(e.to){if(e.global||e.workspaceRoot)throw new Error("--to is incompatible with --global / --workspace-root.");if(e.filter&&R(e.filter).length>0)throw new Error("--to and --filter are mutually exclusive — --to already targets one package.");if(!i)throw new Error("--to requires a monorepo workspace. Run from inside a pnpm/bun/yarn/npm workspace.");const l=await ye({ignoreScripts:p,logger:n,options:e,packages:o,pm:r,target:e.to,visConfig:a,workspaceRoot:i});l!==0&&(process.exitCode=l);return}const c=oe(r,{exact:e.exact||!1,filter:R(e.filter),global:e.global||!1,optional:e.saveOptional||!1,packages:o,peer:e.savePeer||!1,saveDev:e.saveDev||!1,workspace:e.workspace||!1,workspaceRoot:e.workspaceRoot||!1},t,n,{autoInstallPeers:e.autoInstallPeers||!1,ignoreScripts:p});c!==0&&(process.exitCode=c)},"execute");export{Me as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l=Object.defineProperty;var c=(e,a)=>l(e,"name",{value:a,configurable:!0});import{f,Q as p}from"./bin.js";var g=Object.defineProperty,u=c((e,a)=>g(e,"name",{value:a,configurable:!0}),"s");const m=u(async({argument:e,logger:a,visConfig:o,workspaceRoot:s})=>{const t=e?.[0]??null,n=s??process.cwd(),i=f(n,{configBackend:o?.install?.backend,configCorepack:o?.install?.corepack}),r=p(i,t,n,a);r!==0&&(process.exitCode=r)},"execute");export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=Object.defineProperty;var i=(e,o)=>d(e,"name",{value:o,configurable:!0});import{f as g,$ as u}from"./bin.js";var f=Object.defineProperty,b=i((e,o)=>f(e,"name",{value:o,configurable:!0}),"t");const w=b(async({argument:e,logger:o,visConfig:c,workspaceRoot:t})=>{const a=e;if(!a||a.length===0)throw new Error("No subcommand specified. Available: cache, publish, audit, list, view, config, whoami, login, logout, pack, owner, dist-tag, search, fund, ping, token, deprecate, rebuild, prune, plugin");const[s,...l]=a,n=t??process.cwd(),p=g(n,{configBackend:c?.install?.backend,configCorepack:c?.install?.corepack}),r=u(p,s,l,n,o);r!==0&&(process.exitCode=r)},"execute");export{w as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var n=(e,o)=>f(e,"name",{value:o,configurable:!0});import{f as p,X as g}from"./bin.js";import{o as v}from"../packem_shared/utils-DrNg0XTR.js";var k=Object.defineProperty,d=n((e,o)=>k(e,"name",{value:o,configurable:!0}),"l");const b=d(async({argument:e,logger:o,options:a,visConfig:s,workspaceRoot:i})=>{const r=e;if(!r||r.length===0)throw new Error("No packages specified. Usage: vis remove <packages...>");const c=process.cwd(),l=p(i??c,{configBackend:s?.install?.backend,configCorepack:s?.install?.corepack}),t=g(l,{filter:v(a.filter),global:a.global||!1,packages:r,recursive:a.recursive||!1,saveDev:a.saveDev||!1,workspaceRoot:a.workspaceRoot||!1},c,o);t!==0&&(process.exitCode=t)},"execute");export{b as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var j=Object.defineProperty;var g=(n,r)=>j(n,"name",{value:r,configurable:!0});import{getAffectedProjects as v}from"@visulima/task-runner";import{y as E,m as F}from"./bin.js";import{f as b}from"../packem_shared/selectors-B2ISH581.js";var S=Object.defineProperty,$=g((n,r)=>S(n,"name",{value:r,configurable:!0}),"m");const T=$(async({argument:n,logger:r,options:e,runtime:l,visConfig:h,workspaceRoot:u})=>{const f=n[0];if(!f)throw new Error("Missing target. Usage: vis affected <target>");if(!u)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const s=u,{packageJsons:m,workspace:i}=E(s,h),w=F(s,i,m),d=new Set(["deep","direct","none"]),c=e.downstream??"deep",p=e.upstream??"none";if(!d.has(c))throw new Error(`Invalid --downstream value: "${c}". Must be "none", "direct", or "deep".`);if(!d.has(p))throw new Error(`Invalid --upstream value: "${p}". Must be "none", "direct", or "deep".`);const y={base:e.base,downstream:c,head:e.head,projectGraph:w,projects:i.projects,upstream:p,workspaceRoot:s},o=await v(y);if(o.changedFiles.length===0){r.info("No files changed. Nothing to run.");return}if(o.affectedProjects.length===0){r.info("No projects affected by the changes.");return}let{affectedProjects:a}=o;if(e.query&&(a=b(a,i,e.query),a.length===0)){r.info(`Query "${String(e.query)}" matched no affected projects.`);return}r.info(`Affected projects: ${a.join(", ")}`),o.changedFiles.length>0&&(process.env.VIS_AFFECTED_FILES=o.changedFiles.join(`
|
|
2
|
+
`));const t=[f,`--projects=${a.join(",")}`];e.parallel!==void 0&&t.push(`--parallel=${String(e.parallel)}`),e.cache||t.push("--no-cache"),e.dryRun&&t.push("--dry-run"),e.partition&&t.push(`--partition=${String(e.partition)}`),e.reverse&&t.push("--reverse"),typeof e.runnerTags=="string"&&e.runnerTags!==""&&t.push(`--runner-tags=${e.runnerTags}`);try{await l.runCommand("run",{argv:t})}finally{delete process.env.VIS_AFFECTED_FILES}},"execute");export{T as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var S=Object.defineProperty;var p=(t,a)=>S(t,"name",{value:a,configurable:!0});import{readLastRunSummary as v,getLastRunSummaryPath as x}from"@visulima/task-runner";import{p as f,o as $,Y as l}from"./bin.js";import{r as I,l as y}from"../packem_shared/run-summary-utils-BaBGP3bo.js";var w=Object.defineProperty,n=p((t,a)=>w(t,"name",{value:a,configurable:!0}),"a");const T=new Set(["json","table"]),C=n(t=>t??process.cwd(),"resolveWorkspaceRoot"),h=n(t=>t===void 0?"-":t<1e3?`${String(t)}ms`:`${(t/1e3).toFixed(2)}s`,"formatDuration"),k=n(t=>t.exitCode===void 0?t.cacheStatus:t.exitCode===0?t.cacheStatus==="MISS"?"OK":t.cacheStatus:`FAIL(${String(t.exitCode)})`,"formatStatus"),o=n((t,a)=>t.length>=a?t:t+" ".repeat(a-t.length),"padCell"),R=n(t=>t.exitCode!==void 0&&t.exitCode!==0,"isFailedTask"),g=n((t,a)=>{a.info(`Run ${t.id}`),a.info(` start: ${t.startTime}`),a.info(` end: ${t.endTime}`),a.info(` duration: ${h(t.duration)}`),a.info(` totals: ${String(t.stats.total)} total · ${String(t.stats.succeeded)} ok · ${String(t.stats.cached)} cached · ${String(t.stats.skipped)} skipped · ${String(t.stats.failed)} failed`),a.info(` env: node ${t.environment.nodeVersion} · ${t.environment.platform}/${t.environment.arch}`),a.info("")},"renderRunHeader"),D=n((t,a)=>{if(t.length===0){a.info("(no tasks match the current filter)");return}const r=t.map(e=>({duration:h(e.duration),hash:e.hash?e.hash.slice(0,12):"-",status:k(e),taskId:e.taskId})),s={duration:Math.max(8,...r.map(e=>e.duration.length)),hash:Math.max(4,...r.map(e=>e.hash.length)),status:Math.max(6,...r.map(e=>e.status.length)),taskId:Math.max(4,...r.map(e=>e.taskId.length))};a.info(` ${o("task",s.taskId)} ${o("status",s.status)} ${o("duration",s.duration)} ${o("hash",s.hash)}`),a.info(` ${"-".repeat(s.taskId)} ${"-".repeat(s.status)} ${"-".repeat(s.duration)} ${"-".repeat(s.hash)}`);for(const e of r)a.info(` ${o(e.taskId,s.taskId)} ${o(e.status,s.status)} ${o(e.duration,s.duration)} ${o(e.hash,s.hash)}`)},"renderTaskTable"),j=n((t,a,r)=>{g(t,r),r.info(`Task ${a.taskId}`),r.info(` status: ${k(a)}`),r.info(` cache: ${a.cacheStatus}`),r.info(` duration: ${h(a.duration)}`),r.info(` exit: ${a.exitCode===void 0?"-":String(a.exitCode)}`),r.info(` hash: ${a.hash??"(none)"}`),r.info(` start: ${a.startTime??"-"}`),r.info(` end: ${a.endTime??"-"}`),a.dependencies.length>0&&r.info(` deps: ${a.dependencies.join(", ")}`),r.info(""),f.info(`Drill into hash inputs with: vis cache why ${a.taskId} --run ${t.id}`)},"renderTaskDetail"),M=n(t=>{process.stdout.write(`${JSON.stringify(t.map(a=>({id:a.id,mtime:new Date(a.mtimeMs).toISOString(),path:a.path})),void 0,2)}
|
|
2
|
+
`)},"renderListJson"),O=n((t,a,r)=>{if(t.length===0){f.info(`No recorded runs found in ${$(a)}/. Run with --summarize to record a run.`);return}const s={id:Math.max(2,...t.map(e=>e.id.length)),mtime:24};r.info(` ${o("id",s.id)} ${o("mtime",s.mtime)}`),r.info(` ${"-".repeat(s.id)} ${"-".repeat(s.mtime)}`);for(const e of t)r.info(` ${o(e.id,s.id)} ${new Date(e.mtimeMs).toISOString()}`)},"renderListTable"),b=n((t,a)=>{let{tasks:r}=t;return a.task!==void 0&&(r=r.filter(s=>s.taskId===a.task)),a.failed&&(r=r.filter(s=>R(s))),r},"filterTasks"),N=n(async(t,a)=>{const{failed:r,format:s,runId:e,task:d,workspaceRoot:m}=t,i=e===void 0?await v(m,{dataDirectory:l(m)}):await I(m,e);if(!i){if(s==="json"){process.stdout.write(`${JSON.stringify({error:"no-summary",runId:e??null},void 0,2)}
|
|
3
|
+
`),process.exitCode=1;return}e===void 0?f.error(`No previous run summary found. Run a task first to populate \`${x(m,{dataDirectory:l(m)})}\`.`):f.error(`Run summary "${e}" not found in ${$(m)}/.`),process.exitCode=1;return}const c=b(i,{failed:r,task:d});if(d!==void 0&&c.length===0){if(s==="json"){process.stdout.write(`${JSON.stringify({error:"task-not-in-summary",runId:i.id,taskId:d},void 0,2)}
|
|
4
|
+
`),process.exitCode=1;return}f.error(`Task "${d}" was not part of run ${i.id}.`),process.exitCode=1;return}if(i.stats.failed>0&&(process.exitCode=1),s==="json"){process.stdout.write(`${JSON.stringify({duration:i.duration,endTime:i.endTime,environment:i.environment,runId:i.id,startTime:i.startTime,stats:i.stats,tasks:c.map(u=>({cacheStatus:u.cacheStatus,dependencies:u.dependencies,duration:u.duration,endTime:u.endTime,exitCode:u.exitCode,hash:u.hash??null,startTime:u.startTime,taskId:u.taskId}))},void 0,2)}
|
|
5
|
+
`);return}if(d!==void 0){j(i,c[0],a);return}g(i,a),D(c,a)},"runReplay"),V=n(async({logger:t,options:a,workspaceRoot:r})=>{const s=C(r),e=a.format??"table";if(!T.has(e)){f.error(`Invalid --format: ${e}. Expected "table" or "json".`),process.exitCode=1;return}if(a.list===!0){const d=await y(s);if(e==="json"){M(d);return}O(d,s,t);return}await N({failed:a.failed===!0,format:e,runId:a.run,task:a.task,workspaceRoot:s},t)},"replayExecute");export{V as default,V as replayExecute,N as runReplay};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var v=Object.defineProperty;var c=(e,o)=>v(e,"name",{value:o,configurable:!0});import{createRequire as x}from"node:module";import{C as B,b as C,g as R}from"./config.js";import{y as O,m as S,p as u}from"./bin.js";import{b as T,s as q}from"../packem_shared/cyclonedx-CiHXuG8M.js";const h=x(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=c(e=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[o,s]=n.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return n.getBuiltinModule(e)}return h(e)},"__cjs_getBuiltinModule"),{writeFileSync:$}=k("node:fs");var D=Object.defineProperty,d=c((e,o)=>D(e,"name",{value:o,configurable:!0}),"m");const f=["json","xml"],E=d(e=>f.includes(e),"isSbomFormat"),z=d(async({options:e,visConfig:o,workspaceRoot:s})=>{if(!s)throw new Error("Could not determine workspace root. Run inside a monorepo.");const{packageJsons:w,workspace:a}=O(s,o),g=S(s,a,w),p=e.focus,b=p?p.split(",").map(j=>j.trim()).filter(Boolean):void 0,t=(e.format??"json").toLowerCase();if(!E(t))throw new Error(`Unknown --format: "${t}". Expected one of: ${f.join(", ")}.`);const r=T({focus:b,includeDev:!!e.includeDev,projectGraph:g,workspace:a,workspaceRoot:s}),m=t==="xml"?q(r):`${JSON.stringify(r,void 0,2)}
|
|
2
|
+
`,l=e.output??(t==="xml"?"sbom.cdx.xml":"sbom.cdx.json");if(l==="-"){process.stdout.write(m);return}const i=B(s,l);C(R(i)),$(i,m,"utf8");const y=r.components?.length??0,_=r.dependencies?.length??0;u.success(`SBOM written to ${i}`),u.notice(`${y} components, ${_} dependency edges`)},"execute");export{z as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var T=Object.defineProperty;var h=(o,e)=>T(o,"name",{value:e,configurable:!0});import{createRequire as F}from"node:module";import{p as c,a1 as A,y as H,a2 as L,a3 as P,a4 as U}from"./bin.js";import{c as D,r as O,s as b,S as z,a as $,b as C,d as G,p as q,i as M,e as B}from"../packem_shared/lifecycle-Dv3nAtoD.js";import{formatAge as V}from"./handler23.js";const _=F(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=h(o=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[e,r]=m.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return m.getBuiltinModule(o)}return _(o)},"__cjs_getBuiltinModule"),{stat:y,open:R,watch:N}=I("node:fs/promises");var W=Object.defineProperty,g=h((o,e)=>W(o,"name",{value:e,configurable:!0}),"f");const k=g(async o=>{const e=o?.plugins;if(!e||e.length===0)return;const r=D();return await O(r,e),{callHook:g(async(d,...s)=>{try{await r.callHook(d,...s)}catch(t){const n=t instanceof Error?t.message:String(t);c.warn(`Plugin error in ${d}: ${n}`)}},"callHook")}},"loadServiceHooks"),J=g(o=>{const e=o.trim(),r=e.lastIndexOf(":");if(!(r<=0||r===e.length-1))return{project:e.slice(0,r),target:e.slice(r+1)}},"splitTargetId"),j=g(async(o,e,r)=>{const d=J(r);if(!d){c.error(`Invalid target id "${r}". Expected "<project>:<target>", e.g. "@my/api:db".`);return}const s=await A(o),{projectOptions:t,workspace:n}=H(o,e,s),i=n.projects[d.project],a=t.get(d.project)?.[d.target];if(!i||!a){c.error(`Target "${r}" not found in this workspace.`);return}const p=a.options?.service;if(!p){c.error(`Target "${r}" is not a service. Add an \`options.service\` block to make it eligible for \`vis service\`.`);return}if(!a.command){c.error(`Target "${r}" has no command — services must be runnable.`);return}const f=L(o,i.root,a.options?.runFromWorkspaceRoot===!0),v=a.options?.envFile?P(f,a.options.envFile):{};return{command:a.command,cwd:f,env:{...v,...p.env},service:p,target:a,targetId:r}},"resolveTarget"),w=g(o=>{if(!o)throw new Error("Could not determine workspace root. Run `vis service` inside a workspace.");return o},"requireWorkspace"),se=g(async({argument:o,options:e,visConfig:r,workspaceRoot:d})=>{const s=w(d),t=o[0]?.trim();if(!t){c.error("Missing target id. Usage: vis service start <project>:<target>"),process.exitCode=1;return}const n=await j(s,r,t);if(!n){process.exitCode=1;return}try{const{entry:i}=await b({command:n.command,config:n.service,cwd:n.cwd,env:n.env,id:t,readinessTimeoutMs:e.timeout,skipReadiness:e.readiness===!1,workspaceRoot:s});await(await k(r))?.callHook("service:start",i),c.success(`Started ${t} (pid ${String(i.pid)})`),c.info(` log: ${i.logFile}`)}catch(i){const a=i instanceof Error?i.message:String(i);i instanceof z?c.error(`Readiness probe failed for ${t}: ${a}`):c.error(`Failed to start ${t}: ${a}`),process.exitCode=1}},"serviceStartExecute"),S=g(async({graceMs:o,hookSink:e,id:r,workspaceRoot:d})=>{const s=await $(d,r),{stopped:t}=await C({graceMs:o,id:r,workspaceRoot:d});return t?(s&&await e?.callHook("service:stop",s),c.success(`Stopped ${r}`),!0):(c.info(`No running service registered for ${r}`),!1)},"stopOne"),ie=g(async({argument:o,options:e,visConfig:r,workspaceRoot:d})=>{const s=w(d),{graceMs:t}=e,n=o[0]?.trim(),i=await k(r);if(e.all===!0){if(n){c.error("Cannot combine --all with a target id. Use one or the other."),process.exitCode=1;return}const a=await G(s);if(a.length===0){c.info("No running services registered for this workspace.");return}for(const p of a)await S({graceMs:t,hookSink:i,id:p.id,workspaceRoot:s});return}if(!n){c.error("Missing target id. Usage: vis service stop <project>:<target> | --all"),process.exitCode=1;return}await S({graceMs:t,hookSink:i,id:n,workspaceRoot:s})||(process.exitCode=1)},"serviceStopExecute"),K=g(o=>{const e=o.config.readiness?.tcp.port??o.config.port;return e===void 0?"—":String(e)},"formatPort"),E=new Set(["json","table"]),ae=g(async({logger:o,options:e,workspaceRoot:r})=>{const d=w(r),s=e.format??"table";if(!E.has(s)){c.error(`Invalid --format "${s}". Expected one of: ${[...E].sort().join(", ")}.`),process.exitCode=1;return}const{surviving:t}=await q(d);if(s==="json"){const l=Date.now();process.stdout.write(`${JSON.stringify(t.map(u=>{const x=Date.parse(u.startedAt);return{ageMs:Number.isFinite(x)?l-x:null,alive:M(u.pid),command:u.command,cwd:u.cwd,env:u.env,id:u.id,logFile:u.logFile,pid:u.pid,port:u.config.readiness?.tcp.port??u.config.port??null,startedAt:u.startedAt,visVersion:u.visVersion}}),void 0,2)}
|
|
2
|
+
`);return}if(t.length===0){c.info("No running services registered for this workspace.");return}const n=Date.now(),i=t.map(l=>{const u=Date.parse(l.startedAt);return{age:Number.isFinite(u)?V(u,n):"?",id:l.id,log:l.logFile,pid:String(l.pid),port:K(l)}}),a=Math.max(2,...i.map(l=>l.id.length)),p=Math.max(3,...i.map(l=>l.pid.length)),f=Math.max(4,...i.map(l=>l.port.length)),v=Math.max(3,...i.map(l=>l.age.length));o.info(` ${"id".padEnd(a)} ${"pid".padEnd(p)} ${"port".padEnd(f)} ${"age".padEnd(v)} log`),o.info(` ${"-".repeat(a)} ${"-".repeat(p)} ${"-".repeat(f)} ${"-".repeat(v)} ---`);for(const l of i)o.info(` ${l.id.padEnd(a)} ${l.pid.padEnd(p)} ${l.port.padEnd(f)} ${l.age.padEnd(v)} ${l.log}`)},"serviceListExecute"),ne=g(async({argument:o,options:e,workspaceRoot:r})=>{const d=w(r),s=o[0]?.trim();if(!s){c.error("Missing target id. Usage: vis service status <project>:<target>"),process.exitCode=1;return}const t=await $(d,s);if(!t){c.error(`No service registered for ${s}.`),process.exitCode=1;return}if(!M(t.pid)){c.error(`Service ${s} is not running (pid ${String(t.pid)} is dead). Run \`vis service start ${s}\` to recover.`),process.exitCode=1;return}try{await B(t.config,{timeoutMs:e.timeout}),c.success(`${s} healthy (pid ${String(t.pid)})`)}catch(n){const i=n instanceof Error?n.message:String(n);c.error(`${s} probe failed: ${i}`),process.exitCode=1}},"serviceStatusExecute"),ce=g(async({argument:o,options:e,visConfig:r,workspaceRoot:d})=>{const s=w(d),t=o[0]?.trim();if(!t){c.error("Missing target id. Usage: vis service restart <project>:<target>"),process.exitCode=1;return}const n=await k(r),i=await $(s,t);(await C({graceMs:e.graceMs,id:t,workspaceRoot:s})).stopped&&i&&await n?.callHook("service:stop",i);const a=await j(s,r,t);if(!a){process.exitCode=1;return}try{const{entry:p}=await b({command:a.command,config:a.service,cwd:a.cwd,env:a.env,id:t,readinessTimeoutMs:e.timeout,skipReadiness:e.readiness===!1,workspaceRoot:s});await n?.callHook("service:start",p),c.success(`Restarted ${t} (pid ${String(p.pid)})`)}catch(p){const f=p instanceof Error?p.message:String(p);c.error(`Failed to restart ${t}: ${f}`),process.exitCode=1}},"serviceRestartExecute"),Q=200,X=1024*1024,Y=g(async o=>{let e=0;try{e=(await y(o)).size}catch{e=0}const r=new AbortController;let d=!1;const s=g(()=>{d=!0,r.abort()},"onSigint"),t=g(()=>{r.abort()},"onSigterm");process.on("SIGINT",s),process.on("SIGTERM",t);let n=!1;const i=g(async()=>{if(!n){n=!0;try{const a=await y(o).catch(()=>{});if(!a||(a.size<e&&(e=0),a.size===e))return;const p=a.size-e,f=Math.min(p,X),v=await R(o,"r");try{const l=Buffer.alloc(f);await v.read(l,0,f,e),process.stdout.write(l),e+=f}finally{await v.close().catch(()=>{})}}finally{n=!1}}},"tickOnce");try{const a=(async()=>{try{const p=N(o,{signal:r.signal});for(;!(await p.next()).done;)await i()}catch{}})();for(;!r.signal.aborted;)await i(),await new Promise(p=>{const f=setTimeout(p,Q);r.signal.addEventListener("abort",()=>{clearTimeout(f),p()},{once:!0})});await a.catch(()=>{}),await i().catch(()=>{})}finally{process.off("SIGINT",s),process.off("SIGTERM",t)}d&&(process.exitCode=130)},"tailLog"),de=g(async({argument:o,options:e,workspaceRoot:r})=>{const d=w(r),s=o[0]?.trim();if(!s){c.error("Missing target id. Usage: vis service logs <project>:<target>"),process.exitCode=1;return}const t=await $(d,s);if(!t){c.error(`No service registered for ${s}.`),process.exitCode=1;return}if(!await U(t.logFile)){c.warn(`Log file is missing for ${s}: ${t.logFile}`),process.exitCode=1;return}if(e.follow===!0){await Y(t.logFile);return}const n=await R(t.logFile,"r");try{const i=n.createReadStream();await new Promise((a,p)=>{i.on("end",a),i.on("error",p),i.pipe(process.stdout,{end:!1})})}finally{await n.close().catch(()=>{})}},"serviceLogsExecute");export{ae as serviceListExecute,de as serviceLogsExecute,ce as serviceRestartExecute,se as serviceStartExecute,ne as serviceStatusExecute,ie as serviceStopExecute};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var se=Object.defineProperty;var E=(e,o)=>se(e,"name",{value:o,configurable:!0});import{createRequire as re}from"node:module";import{M as b,i as C,z as he}from"./config.js";import{Cache as I,parseCacheSize as le,readLastRunSummary as H,getLastRunSummaryPath as T,digestFile as Z}from"@visulima/task-runner";import{B as de,J as O}from"../packem_shared/ai-cache-DuwHYx2O.js";import{_ as ue,E as G}from"../packem_shared/cache-directory-DQak1Vjc.js";import{p as n,ah as fe,Y as x,o as K,ai as A}from"./bin.js";import{r as V,f as P,a as me,d as pe}from"../packem_shared/run-summary-utils-BaBGP3bo.js";const ae=re(import.meta.url),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,j=E(e=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[o,t]=S.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return S.getBuiltinModule(e)}return ae(e)},"__cjs_getBuiltinModule"),{readdir:F,stat:B,realpath:_,rm:L,mkdtemp:ie}=j("node:fs/promises"),{tmpdir:ne}=j("node:os"),{createInterface:ce}=j("node:readline");var ge=Object.defineProperty,ye=E((e,o)=>ge(e,"name",{value:o,configurable:!0}),"y"),we=Object.defineProperty,$e=ye((e,o)=>we(e,"name",{value:o,configurable:!0}),"y"),ke=Object.defineProperty,M=$e((e,o)=>ke(e,"name",{value:o,configurable:!0}),"i");const ve=/^(?<value>-?\d+(?:[.,]\d+)*) *(?<type>[a-z]+)?$/i,Se=/^KIBI/,xe=/^MIBI/,be=/^GIBI/,Ce=/^TEBI/,De=/^PEBI/,Ee=/^EXBI/,Ie=/^ZEBI/,Be=/^YIBI/,Me=/^(.)IB$/,q={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},Ne=M((e,o)=>{const t=new Intl.NumberFormat(o).format(11111).replaceAll(new RegExp("\\p{Number}","gu"),""),a=new Intl.NumberFormat(o).format(1.1).replaceAll(new RegExp("\\p{Number}","gu"),"");return Number.parseFloat(e.replaceAll(new RegExp(`\\${t}`,"g"),"").replace(new RegExp(`\\${a}`),"."))},"parseLocalizedNumber"),X=M(e=>{switch(e){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},"fromBase");M((e,o)=>{const t={base:2,locale:"en-US",units:"metric",...o};if(typeof e!="string"||e.length===0)throw new TypeError("Value is not a string or is empty.");if(e.length>100)throw new TypeError("Value exceeds the maximum length of 100 characters.");const a=ve.exec(e)?.groups;if(!a)return Number.NaN;const r=Ne(a.value,t.locale),s=(a.type??"Bytes").toUpperCase().replace(Se,"KILO").replace(xe,"MEGA").replace(be,"GIGA").replace(Ce,"TERA").replace(De,"PETA").replace(Ee,"EXA").replace(Ie,"ZETTA").replace(Be,"YOTTA").replace(Me,"$1B"),i=q[t.units].findIndex(m=>m.short[0].toUpperCase()===s[0]),h=X(t.base);return r*h**i},"parseBytes");const w=M((e,o)=>{if(typeof e!="number"||!Number.isFinite(e))throw new TypeError("Bytesize is not a number.");const{base:t,decimals:a,locale:r,long:s,unit:i,units:h,...m}={base:2,decimals:0,locale:"en-US",long:!1,units:"metric",...o},u=X(t),c=Math.abs(e),l=o?.space??!0?" ":"",d=q[h],p=d.findIndex(R=>R.short===i);if(e===0){const R=Math.min(0,Math.max(p,d.length-1));return"0"+l+d[R][s?"long":"short"]}const D=p===-1?Math.min(Math.floor(Math.log(c)/Math.log(u)),d.length-1):p,v=d[D][s?"long":"short"],N=e/u**D,J=a<0?void 0:a;return new Intl.NumberFormat(r,{maximumFractionDigits:J,minimumFractionDigits:J,...m}).format(N)+l+v},"formatBytes");var Re=Object.defineProperty,f=E((e,o)=>Re(e,"name",{value:o,configurable:!0}),"u");const Q=f(async e=>{let o=0;try{const t=await F(e,{withFileTypes:!0});for(const a of t){const r=b(e,a.name);if(a.isDirectory())o+=await Q(r);else if(a.isFile()){const s=await B(r);o+=s.size}}}catch{}return o},"sumDirectorySize"),$=f(async e=>{const o=[];let t;try{t=await F(e)}catch{return[]}for(const a of t){if(a.startsWith("."))continue;const r=b(e,a);try{const s=await B(r);if(!s.isDirectory())continue;const i=await Q(r);o.push({hash:a,mtimeMs:s.mtimeMs,path:r,sizeBytes:i})}catch{}}return o.sort((a,r)=>r.mtimeMs-a.mtimeMs),o},"collectCacheEntries"),ze=f((e,o=Date.now())=>{const t=Math.max(0,Math.floor((o-e)/1e3));return t<60?`${String(t)}s`:t<3600?`${String(Math.floor(t/60))}m`:t<86400?`${String(Math.floor(t/3600))}h`:`${String(Math.floor(t/86400))}d`},"formatAge"),Te=f(e=>new Promise(o=>{const t=ce({input:process.stdin,output:process.stderr});t.question(`${e} (y/N) `,a=>{t.close();const r=a.trim().toLowerCase();o(r==="y"||r==="yes")})}),"confirmPrompt"),Oe=f(async(e,o,t)=>{if(!C(e)){if(o==="json"){process.stdout.write(`${JSON.stringify({directory:e,entries:[],totalBytes:0,totalCount:0},void 0,2)}
|
|
2
|
+
`);return}n.info(`No cache directory found at ${e}`);return}const a=await $(e);if(a.length===0){if(o==="json"){process.stdout.write(`${JSON.stringify({directory:e,entries:[],totalBytes:0,totalCount:0},void 0,2)}
|
|
3
|
+
`);return}n.info(`Cache directory is empty: ${e}`);return}const r=a.reduce((c,l)=>c+l.sizeBytes,0);if(o==="json"){const c=Date.now();process.stdout.write(`${JSON.stringify({directory:e,entries:a.map(l=>({ageMs:c-l.mtimeMs,hash:l.hash,mtimeIso:new Date(l.mtimeMs).toISOString(),sizeBytes:l.sizeBytes})),totalBytes:r,totalCount:a.length},void 0,2)}
|
|
4
|
+
`);return}n.info(`Cache directory: ${e}`),n.info(`Entries: ${String(a.length)} (${w(r,{decimals:1,space:!1})})`),t.info("");const s=Date.now(),i=a.map(c=>({age:ze(c.mtimeMs,s),hash:c.hash.slice(0,12),size:w(c.sizeBytes,{decimals:1,space:!1})})),h=Math.max(4,...i.map(c=>c.hash.length)),m=Math.max(4,...i.map(c=>c.size.length)),u=Math.max(3,...i.map(c=>c.age.length));t.info(` ${"hash".padEnd(h)} ${"size".padEnd(m)} ${"age".padEnd(u)}`),t.info(` ${"-".repeat(h)} ${"-".repeat(m)} ${"-".repeat(u)}`);for(const c of i)t.info(` ${c.hash.padEnd(h)} ${c.size.padEnd(m)} ${c.age.padEnd(u)}`)},"runList"),Ae=f(()=>{try{const e=de();e>0&&n.info(`Cleared ${String(e)} cached AI response${e===1?"":"s"}.`)}catch(e){n.warn(`Failed to clear AI response cache: ${e instanceof Error?e.message:String(e)}`)}},"clearAiCacheSafe"),Pe=f(()=>{try{const e=fe();e>0&&n.info(`Cleared ${String(e)} cached Socket.dev report${e===1?"":"s"}.`)}catch(e){n.warn(`Failed to clear Socket.dev cache: ${e instanceof Error?e.message:String(e)}`)}},"clearSocketCacheSafe"),je=f(async(e,o,t)=>{if(!C(e)){n.info(`No cache directory to clean at ${e}`);return}if(t.dryRun){const r=await $(e),s=r.reduce((i,h)=>i+h.sizeBytes,0);n.info(`Would remove ${String(r.length)} cache entr${r.length===1?"y":"ies"} (${w(s,{decimals:1,space:!1})}) from ${e}`);return}const a=ue(e,o);try{const r=await _(e),s=await _(o);if(r===s){n.error("Refusing to delete the workspace root. The cache directory resolved to the same path as the workspace."),process.exitCode=1;return}}catch{}if(!a&&!t.force){if(n.warn(`Cache directory is outside the workspace root: ${e}`),n.warn("This will recursively delete the entire directory, including anything stored there by other tools."),!process.stdin.isTTY){n.error("Refusing to clean an out-of-workspace cache without --force (stdin is not a TTY)."),process.exitCode=1;return}if(!await Te(" Continue?")){n.info("Aborted.");return}}a?await new I({cacheDirectory:e,workspaceRoot:o}).clear():await L(e,{force:!0,recursive:!0}),n.success(`Cleared cache: ${e}`)},"runClean"),Fe=f(async(e,o,t)=>{if(!C(e)){n.info(`No cache directory to prune at ${e}`);return}if(t.maxCacheAgeDays!==void 0&&(!Number.isFinite(t.maxCacheAgeDays)||t.maxCacheAgeDays<0)){n.error(`Invalid --max-age-days value: expected a finite number >= 0, got ${String(t.maxCacheAgeDays)}`),process.exitCode=1;return}if(t.keepLast!==void 0&&(!Number.isFinite(t.keepLast)||t.keepLast<0||!Number.isInteger(t.keepLast))){n.error(`Invalid --keep-last value: expected a non-negative integer, got ${String(t.keepLast)}`),process.exitCode=1;return}if(t.maxCacheSize!==void 0){let c;try{c=le(t.maxCacheSize)}catch(l){n.error(`Invalid --max-size value: ${l instanceof Error?l.message:String(l)}`),process.exitCode=1;return}if(!Number.isFinite(c)||c<=0){n.error(`Invalid --max-size value: expected a positive size, got "${t.maxCacheSize}" (${String(c)} bytes)`),process.exitCode=1;return}}const a=t.maxCacheAgeDays===void 0?void 0:t.maxCacheAgeDays*24*60*60*1e3,r=await $(e),s=r.reduce((c,l)=>c+l.sizeBytes,0);if(t.keepLast!==void 0&&r.length>t.keepLast){const c=r.slice(t.keepLast);await Promise.all(c.map(l=>L(l.path,{force:!0,recursive:!0})))}await new I({cacheDirectory:e,maxCacheAge:a,maxCacheSize:t.maxCacheSize,workspaceRoot:o}).removeOldEntries();const i=await $(e),h=i.reduce((c,l)=>c+l.sizeBytes,0),m=r.length-i.length,u=s-h;if(m<=0){n.info("Nothing to prune — all entries are within the configured limits.");return}n.success(`Pruned ${String(m)} entr${m===1?"y":"ies"}, freed ${w(u,{decimals:1,space:!1})}.`)},"runPrune"),W=16,ee=f(e=>e.length>W?`${e.slice(0,W)}…`:e,"truncateHash"),z=f((e,o,t)=>{const a=Object.entries(o??{});if(a.length!==0){t.info(` ${e}:`),a.sort(([r],[s])=>r.localeCompare(s));for(const[r,s]of a)t.info(` ${r.padEnd(40)} ${ee(s)}`)}},"renderHashDetailsBucket"),Le=f(async(e,o,t)=>{const{format:a,runId:r,workspaceRoot:s}=o,i=r===void 0?await H(s,{dataDirectory:x(s)}):await V(s,r);if(!i){if(a==="json"){process.stdout.write(`${JSON.stringify({error:"no-summary",runId:r??null,taskId:e},void 0,2)}
|
|
5
|
+
`),process.exitCode=1;return}r===void 0?n.error(`No previous run summary found. Run a task first to populate \`${T(s,{dataDirectory:x(s)})}\`.`):n.error(`Run summary "${r}" not found in ${K(s)}/.`),process.exitCode=1;return}const h=P(i,e);if(!h){if(a==="json"){process.stdout.write(`${JSON.stringify({error:"task-not-in-summary",runId:i.id,taskId:e},void 0,2)}
|
|
6
|
+
`),process.exitCode=1;return}n.error(`Task "${e}" was not part of run ${i.id}.`),n.info(`Tasks in this run: ${i.tasks.map(l=>l.taskId).join(", ")||"(none)"}`),process.exitCode=1;return}const m=await me(s,i.id),u=m?P(m,e):void 0,c=pe(h.hashDetails,u?.hashDetails);if(a==="json"){process.stdout.write(`${JSON.stringify({diff:c,previousRunId:m?.id??null,previousTask:u?{cacheStatus:u.cacheStatus,hash:u.hash??null,hashDetails:u.hashDetails??null}:null,runId:i.id,task:{cacheStatus:h.cacheStatus,hash:h.hash??null,hashDetails:h.hashDetails??null,taskId:h.taskId}},void 0,2)}
|
|
7
|
+
`);return}if(n.info(`Why ${e}? (run ${i.id})`),t.info(""),t.info(` status: ${h.cacheStatus}`),t.info(` hash: ${h.hash??"(none)"}`),u?t.info(` prev: ${u.hash??"(none)"} [run ${m?.id??"?"}]`):t.info(" prev: (no prior run found)"),t.info(""),!u){n.info("No previous run to diff against — first time this task was recorded.");return}if(!c.commandChanged&&c.nodes.added.length===0&&c.nodes.changed.length===0&&c.nodes.removed.length===0&&c.runtime.added.length===0&&c.runtime.changed.length===0&&c.runtime.removed.length===0&&c.implicitDeps.added.length===0&&c.implicitDeps.changed.length===0&&c.implicitDeps.removed.length===0){n.success("No hash inputs changed since the previous run.");return}t.info("Hash inputs that changed since the previous run:"),t.info(""),c.commandChanged&&t.info(" command: changed");for(const l of["nodes","runtime","implicitDeps"]){const d=c[l];if(!(d.added.length===0&&d.changed.length===0&&d.removed.length===0)){t.info(` ${l}:`);for(const p of d.added)t.info(` + ${p}`);for(const p of d.changed)t.info(` ~ ${p}`);for(const p of d.removed)t.info(` - ${p}`)}}t.info(""),n.info(`Last summary file: ${T(s,{dataDirectory:x(s)})}`)},"runWhy"),Je=f(async(e,o,t)=>{const{format:a,runId:r,workspaceRoot:s}=o,i=r===void 0?await H(s,{dataDirectory:x(s)}):await V(s,r);if(!i){if(a==="json"){process.stdout.write(`${JSON.stringify({error:"no-summary",runId:r??null,taskId:e},void 0,2)}
|
|
8
|
+
`),process.exitCode=1;return}r===void 0?n.error(`No previous run summary found. Run a task first to populate \`${T(s,{dataDirectory:x(s)})}\`.`):n.error(`Run summary "${r}" not found in ${K(s)}/.`),process.exitCode=1;return}const h=P(i,e);if(!h){if(a==="json"){process.stdout.write(`${JSON.stringify({error:"task-not-in-summary",runId:i.id,taskId:e},void 0,2)}
|
|
9
|
+
`),process.exitCode=1;return}n.error(`Task "${e}" was not part of run ${i.id}.`),process.exitCode=1;return}if(a==="json"){process.stdout.write(`${JSON.stringify({cacheStatus:h.cacheStatus,hash:h.hash??null,hashDetails:h.hashDetails??null,runId:i.id,taskId:h.taskId},void 0,2)}
|
|
10
|
+
`);return}n.info(`Hash for ${e} (run ${i.id})`),t.info(""),t.info(` status: ${h.cacheStatus}`),t.info(` hash: ${h.hash??"(none)"}`),h.hashDetails?(t.info(""),t.info(` command: ${ee(h.hashDetails.command)}`),z("nodes",h.hashDetails.nodes,t),z("runtime",h.hashDetails.runtime,t),z("implicitDeps",h.hashDetails.implicitDeps,t)):(t.info(""),n.info("No hash details recorded for this task."))},"runHash"),_e=f(async(e,o)=>{if(!C(e)){if(o==="json"){process.stdout.write(`${JSON.stringify({directory:e,exists:!1,totalBytes:0,totalCount:0})}
|
|
11
|
+
`);return}n.info(`No cache directory at ${e}`);return}const t=await $(e),a=t.reduce((r,s)=>r+s.sizeBytes,0);if(o==="json"){process.stdout.write(`${JSON.stringify({directory:e,exists:!0,totalBytes:a,totalCount:t.length})}
|
|
12
|
+
`);return}n.info(`Cache directory: ${e}`),n.info(`Entries: ${String(t.length)}`),n.info(`Total size: ${w(a,{decimals:1,space:!1})}`)},"runSize"),Ge=f(async e=>{const o=[],t=f(async a=>{const r=(await F(a,{withFileTypes:!0})).toSorted((s,i)=>s.name.localeCompare(i.name));for(const s of r){const i=b(a,s.name);if(s.isDirectory()){await t(i);continue}if(!s.isFile())continue;const[h,m]=await Promise.all([B(i),Z(i)]);o.push({hash:m?.hash??"",mode:h.mode&4095,mtimeMs:h.mtimeMs,relativePath:he(e,i).replaceAll("\\","/"),sizeBytes:h.size})}},"walk");return await t(e),o},"walkAndDigest"),We=f((e,o)=>Math.floor(e/1e3)===Math.floor(o/1e3),"compareSecondsTruncated"),Y=16,Ye=f(async(e,o)=>{const t=b(o,e.relativePath),a=await B(t).catch(()=>{});if(!a)return{expected:{hash:e.hash,mode:e.mode,mtimeMs:e.mtimeMs},issues:["missing"],relativePath:e.relativePath};const r=await Z(t),s=[];(r?.hash??"")!==e.hash&&s.push("content");const i=a.mode&4095;if(process.platform!=="win32"&&i!==e.mode&&s.push("mode"),We(a.mtimeMs,e.mtimeMs)||s.push("mtime"),s.length!==0)return{actual:{hash:r?.hash,mode:i,mtimeMs:a.mtimeMs},expected:{hash:e.hash,mode:e.mode,mtimeMs:e.mtimeMs},issues:s,relativePath:e.relativePath}},"computeFileDiff"),Ue=f(async(e,o,t)=>{const{cacheDirectories:a,format:r,workspaceRoot:s}=o;if(a.length===0){r==="json"?process.stdout.write(`${JSON.stringify({error:"no-cache-directory",taskId:e},void 0,2)}
|
|
13
|
+
`):n.error("No cache directory resolved — pass --cache-dir or run inside a workspace."),process.exitCode=1;return}let i,h;for(const u of a){const c=await new I({cacheDirectory:u,workspaceRoot:s}).getByTaskId(e);if(c){i=u,h=c;break}}if(!h||!i){r==="json"?process.stdout.write(`${JSON.stringify({error:"no-cached-entry",searchedCaches:a,taskId:e},void 0,2)}
|
|
14
|
+
`):n.error(`No cached entry found for task "${e}". Run it once before verifying.`),process.exitCode=1;return}const m=await ie(b(ne(),"vis-cache-verify-"));try{if(!await new I({cacheDirectory:i,workspaceRoot:m}).restoreOutputs(h.hash)){r==="json"?process.stdout.write(`${JSON.stringify({error:"restore-failed",hash:h.hash,taskId:e},void 0,2)}
|
|
15
|
+
`):n.error(`Cache restore failed for ${e} (hash ${h.hash}).`),process.exitCode=1;return}const u=await Ge(m);if(u.length===0){r==="json"?process.stdout.write(`${JSON.stringify({diffs:[],hash:h.hash,status:"no-outputs",taskId:e},void 0,2)}
|
|
16
|
+
`):n.info(`Cached entry for ${e} has no recorded outputs — nothing to verify.`);return}const c=Array.from({length:u.length});for(let d=0;d<u.length;d+=Y){const p=u.slice(d,d+Y),D=await Promise.all(p.map(async v=>Ye(v,s)));for(const[v,N]of D.entries())c[d+v]=N}const l=c.filter(d=>d!==void 0);if(r==="json"){process.stdout.write(`${JSON.stringify({cachedFileCount:u.length,cacheDirectory:i,diffs:l,hash:h.hash,status:l.length===0?"ok":"drift",taskId:e},void 0,2)}
|
|
17
|
+
`),l.length>0&&(process.exitCode=1);return}if(n.info(`Verify ${e} (hash ${h.hash})`),t.info(""),t.info(` cache: ${i}`),t.info(` files: ${String(u.length)}`),l.length===0){t.info(""),n.success("Cache restore is faithful — all files match content, mode, and mtime.");return}t.info(` drift: ${String(l.length)} file(s)`),t.info("");for(const d of l){const p=d.issues.includes("missing")?"MISSING":d.issues.join(",").toUpperCase();t.info(` [${p}] ${d.relativePath}`),!d.issues.includes("missing")&&d.expected&&d.actual&&(d.issues.includes("content")&&(t.info(` expected hash: ${d.expected.hash||"(none)"}`),t.info(` actual hash: ${d.actual.hash??"(unreadable)"}`)),d.issues.includes("mode")&&(t.info(` expected mode: ${d.expected.mode.toString(8)}`),t.info(` actual mode: ${(d.actual.mode??0).toString(8)}`)),d.issues.includes("mtime")&&(t.info(` expected mtime: ${new Date(d.expected.mtimeMs).toISOString()}`),t.info(` actual mtime: ${d.actual.mtimeMs===void 0?"(unreadable)":new Date(d.actual.mtimeMs).toISOString()}`)))}process.exitCode=1}finally{await L(m,{force:!0,recursive:!0}).catch(()=>{})}},"runVerify"),te=f(e=>e==="task"||e==="ai"||e==="socket"||e==="all"?e:(e&&e.length>0&&n.warn(`Unknown --type value '${e}'; falling back to 'all'.`),"all"),"parseCacheTarget"),g=f((e,o)=>e==="all"||e===o,"includesTarget"),y=f(e=>e===void 0?null:new Date(e).toISOString(),"isoOrNull"),U=f((e,o)=>{n.info(`${e}:`),n.info(` Entries: ${String(o.entries)}`),n.info(` Total size: ${w(o.totalSizeBytes,{decimals:1,space:!1})}`),n.info(` Oldest: ${o.oldestEntry?new Date(o.oldestEntry).toISOString():"N/A"}`),n.info(` Newest: ${o.newestEntry?new Date(o.newestEntry).toISOString():"N/A"}`)},"printAuxStatsBlock"),He=f(e=>e==="worktree"||e==="shared"||e==="all"?e:(e&&e.length>0&&n.warn(`Unknown --scope value '${e}'; falling back to 'shared'.`),"shared"),"parseScope"),k=f((e,o,t)=>{const a=e??process.cwd(),r=t??{},s=r.taskRunner??{},i=He(o.scope),h=o.cacheDir,m=G(a,h,s.cacheDirectory,!1),u=G(a,h,s.cacheDirectory,r.sharedWorktreeCache);let c,l;switch(i){case"all":{c=u,l=u===m?[u]:[u,m];break}case"worktree":{c=m,l=[m];break}default:c=u,l=[u]}return{cacheDirectories:l,cacheDirectory:c,scope:i,sharedWorktreeCache:r.sharedWorktreeCache,workspaceRoot:a}},"resolveCacheDirectoryFromContext"),ot=f(async({logger:e,options:o,visConfig:t,workspaceRoot:a})=>{const{cacheDirectories:r}=k(a,o,t),s=o.format??"table";for(const i of r)r.length>1&&n.info(`# ${i}`),await Oe(i,s,e)},"cacheListExecute"),st=f(async({options:e,visConfig:o,workspaceRoot:t})=>{const a=te(e.type),r=!!e.dryRun;if(g(a,"task")){const{cacheDirectory:s,workspaceRoot:i}=k(t,e,o);await je(s,i,{dryRun:r,force:!!e.force})}if(g(a,"ai"))if(r){const s=O();n.info(`Would clear ${String(s.entries)} cached AI response${s.entries===1?"":"s"}.`)}else Ae();if(g(a,"socket"))if(r){const s=A();n.info(`Would clear ${String(s.entries)} cached Socket.dev report${s.entries===1?"":"s"}.`)}else Pe()},"cacheCleanExecute"),rt=f(async({options:e,visConfig:o,workspaceRoot:t})=>{const{cacheDirectories:a,workspaceRoot:r}=k(t,e,o);for(const s of a)a.length>1&&n.info(`# ${s}`),await Fe(s,r,{keepLast:typeof e.keepLast=="number"?e.keepLast:void 0,maxCacheAgeDays:typeof e.maxAgeDays=="number"?e.maxAgeDays:void 0,maxCacheSize:e.maxSize})},"cachePruneExecute"),oe=f(e=>e??process.cwd(),"resolveWorkspaceRoot"),at=f(async({argument:e,logger:o,options:t,workspaceRoot:a})=>{const r=e[0];if(!r){n.error("No task ID specified. Usage: vis cache why <project>:<target>"),process.exitCode=1;return}await Le(r,{format:t.format??"table",runId:t.run,workspaceRoot:oe(a)},o)},"cacheWhyExecute"),it=f(async({argument:e,logger:o,options:t,workspaceRoot:a})=>{const r=e[0];if(!r){n.error("No task ID specified. Usage: vis cache hash <project>:<target>"),process.exitCode=1;return}await Je(r,{format:t.format??"table",runId:t.run,workspaceRoot:oe(a)},o)},"cacheHashExecute"),nt=f(async({options:e,visConfig:o,workspaceRoot:t})=>{const a=te(e.type);if((e.format??"table")==="json"){const r={};if(g(a,"task")){const{cacheDirectories:s}=k(t,e,o);r.task=await Promise.all(s.map(async i=>{const h=C(i),m=h?await $(i):[],u=m.reduce((c,l)=>c+l.sizeBytes,0);return{directory:i,entries:m.length,exists:h,newestEntry:y(m[0]?.mtimeMs),oldestEntry:y(m.at(-1)?.mtimeMs),totalBytes:u}}))}if(g(a,"ai")){const s=O();r.ai={entries:s.entries,newestEntry:y(s.newestEntry),oldestEntry:y(s.oldestEntry),totalBytes:s.totalSizeBytes}}if(g(a,"socket")){const s=A();r.socket={entries:s.entries,newestEntry:y(s.newestEntry),oldestEntry:y(s.oldestEntry),totalBytes:s.totalSizeBytes}}process.stdout.write(`${JSON.stringify(r,void 0,2)}
|
|
18
|
+
`);return}if(g(a,"task")){const{cacheDirectories:r}=k(t,e,o);for(const s of r)r.length>1&&n.info(`# ${s}`),await _e(s,"table")}g(a,"ai")&&U("AI response cache",O()),g(a,"socket")&&U("Socket.dev report cache",A())},"cacheSizeExecute"),ct=f(async({argument:e,logger:o,options:t,visConfig:a,workspaceRoot:r})=>{const s=e[0];if(!s){n.error("No task ID specified. Usage: vis cache verify <project>:<target>"),process.exitCode=1;return}const{cacheDirectories:i,workspaceRoot:h}=k(r,t,a);await Ue(s,{cacheDirectories:i,format:t.format??"table",workspaceRoot:h},o)},"cacheVerifyExecute");export{st as cacheCleanExecute,it as cacheHashExecute,ot as cacheListExecute,rt as cachePruneExecute,nt as cacheSizeExecute,ct as cacheVerifyExecute,at as cacheWhyExecute,Ae as clearAiCacheSafe,Pe as clearSocketCacheSafe,$ as collectCacheEntries,ze as formatAge,je as runClean,Je as runHash,Oe as runList,Fe as runPrune,_e as runSize,Ue as runVerify,Le as runWhy};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var j=(e,t)=>T(e,"name",{value:t,configurable:!0});import{createRequire as w}from"node:module";import{I as f,a as b,y as x,m as V,o as F,E as I,e as $}from"./bin.js";import{i as P,n as z,M as B}from"./config.js";import{enforceProjectConstraints as E}from"@visulima/task-runner";import{a as J}from"../packem_shared/flakiness-Dq6K4ymq.js";import{c as K}from"../packem_shared/runtime-check-BusAwPb2.js";const C=w(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=j(e=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[t,i]=n.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return n.getBuiltinModule(e)}return C(e)},"__cjs_getBuiltinModule"),{readdirSync:q}=M("node:fs");var N=Object.defineProperty,v=j((e,t)=>N(e,"name",{value:t,configurable:!0}),"h");const r=v(e=>e?f("✓"):b("✗"),"icon"),Q=v(async({logger:e,options:t,visConfig:i,workspaceRoot:s})=>{if(!s)throw new Error("Could not determine workspace root.");const{config:y,packageJsons:O,workspace:u}=x(s,i),R=V(s,u,O),k=Object.keys(u.projects).length,S=new Set(Object.values(u.projects).flatMap(p=>Object.keys(p.targets??{}))).size,a=K(s);let o=0;y.constraints&&(o=E(R,y.constraints).length);const c=J(s,{minRuns:2});let l;const g=F(s);if(P(g)){const p=q(g).filter(h=>h.endsWith(".json")).sort();let m=0,_=0;for(const h of p.slice(-20))try{const d=z(B(g,h));d.stats&&(m+=d.stats.total??0,_+=d.stats.cached??0)}catch{continue}m>0&&(l=`${(_/m*100).toFixed(0)}%`)}if(t.json){e.info(JSON.stringify({cacheHitRate:l??null,constraintViolations:o,flakyTasks:c.length,projects:k,runtimeIssues:a.length,targets:S},null,2));return}e.info(""),e.info(` ${I("VIS STATUS")}`),e.info(""),e.info(` ${r(!0)} ${String(k)} projects · ${String(S)} unique targets`),e.info(` ${r(a.length===0)} Runtime: ${a.length===0?f("OK"):$(`${String(a.length)} issue(s)`)}`),e.info(` ${r(o===0)} Constraints: ${o===0?f("OK"):b(`${String(o)} violation(s)`)}`),e.info(` ${r(c.length===0)} Flaky tasks: ${c.length===0?f("none"):$(String(c.length))}`),l&&e.info(` ${r(!0)} Cache hit rate: ${l} (last 20 runs)`),e.info("")},"execute");export{Q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var y=Object.defineProperty;var j=(t,e)=>y(t,"name",{value:e,configurable:!0});import{createTaskGraph as b}from"@visulima/task-runner";import{y as v,m as E}from"./bin.js";var T=Object.defineProperty,w=j((t,e)=>T(t,"name",{value:e,configurable:!0}),"h");const O=w((t,e)=>{const s=new Map;for(const[i,r]of Object.entries(t.dependencies))for(const f of r){const c=s.get(f)??[];c.push(i),s.set(f,c)}if(!t.tasks[e])return;const a=new Set([e]),o=[{node:e,path:[e]}];for(;o.length>0;){const i=o.shift();if(t.roots.includes(i.node))return i.path;for(const r of s.get(i.node)??[])a.has(r)||(a.add(r),o.push({node:r,path:[r,...i.path]}))}return[e]},"findShortestPathToRoot"),x=w((t,e)=>{const s=[];for(const[a,o]of Object.entries(t.dependencies))o.includes(e)&&s.push(a);return s.sort()},"collectParents"),I=w(async({argument:t,logger:e,visConfig:s,workspaceRoot:a})=>{if(!a)throw new Error("Could not determine workspace root.");const o=t[0];if(!o)throw new Error("No task ID specified. Usage: vis task-why <project>:<target>");if(!o.includes(":"))throw new Error(`Invalid task ID "${o}" — expected format "project:target".`);const{packageJsons:i,workspace:r}=v(a,s),f=E(a,r,i),[c,k]=o.split(":",2),$=r.projects[c];if(!$)throw new Error(`Unknown project "${c}".`);if(!$.targets?.[k])throw new Error(`Project "${c}" has no target "${k}".`);const m=Object.entries(r.projects).flatMap(([n,u])=>Object.keys(u.targets??{}).map(h=>({id:`${n}:${h}`,outputs:[],overrides:{},target:{project:n,target:h}}))),p=b(m,{projectGraph:f,workspace:r});if(!p.tasks[o])throw new Error(`Task "${o}" is not reachable in the graph.`);const d=O(p,o),g=x(p,o);if(e.info(""),e.info(`Why ${o}?`),e.info(""),d&&d.length>1){e.info("Shortest path from a root to this task:");for(const[n,u]of d.entries()){const h=n===0?" ":`${" ".repeat(n+1)}└─ `;e.info(`${h}${u}`)}e.info("")}else e.info(" This task is itself a root — nothing upstream depends on it."),e.info("");if(g.length>0){e.info(`Directly depended on by ${g.length} task(s):`);for(const n of g)e.info(` - ${n}`);e.info("")}const l=p.dependencies[o]??[];if(l.length>0){e.info(`This task depends on ${l.length} task(s):`);for(const n of[...l].sort())e.info(` - ${n}`);e.info("")}},"execute");export{I as default};
|