@vibgrate/cli 2026.625.2 → 2026.628.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DOCS.md +24 -24
- package/README.md +18 -18
- package/dist/baseline-QM3PG3RY.js +1 -0
- package/dist/{chunk-YF3NML7I.js → chunk-CKBCROBF.js} +1 -1
- package/dist/chunk-RKH4N26K.js +75 -0
- package/dist/{chunk-BHWXSLTQ.js → chunk-ROPIO52N.js} +2 -2
- package/dist/cli.js +145 -145
- package/dist/{dist-AP3RH35M.js → dist-LFSEE53Z.js} +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/baseline-2B6YIW6Z.js +0 -1
- package/dist/chunk-I65B3ZRL.js +0 -78
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {a}from'./chunk-MKDRULJ6.js';import {p,o,j,n,a as a$1,i,k,d,e,q as q$1,r,s}from'./chunk-XTHPCEME.js';import {b}from'./chunk-EK7ODJWE.js';import*as _ from'path';import {basename,dirname}from'path';import*as ye from'fs/promises';import {readFile,mkdtemp,rm,mkdir,writeFile}from'fs/promises';import F from'typescript';import*as Ss from'crypto';import E from'chalk';import*as on from'os';import {spawn}from'child_process';import {createRequire}from'module';import*as Lo from'zlib';import {promisify}from'util';import {mkdirSync,writeFileSync}from'fs';function Wo(t){switch(t){case "node":return "nodejs";case "python":return "python";case "dotnet":return "dotnet";case "java":return "java";case "php":return "php";case "ruby":return "ruby";case "go":return "go";default:return null}}function Ke(t,e){if(!e)return null;switch(t){case "python":case "php":case "ruby":case "go":{let n=e.match(/(\d+)\.(\d+)/);return n?`${n[1]}.${n[2]}`:null}case "dotnet":{let n=e.match(/(\d+)\.(\d+)/)??e.match(/(\d+)/);return n?n[2]!==void 0?`${n[1]}.${n[2]}`:`${n[1]}.0`:null}case "node":{let n=e.match(/(\d+)/);return n?n[1]:null}case "java":{let n=e.match(/1\.(\d+)/);if(n)return n[1];let s=e.match(/(\d+)/);return s?s[1]:null}default:return null}}function zo(t,e,n=Date.now()){let s=e.find(o=>String(o.cycle)===t);if(!s)return null;if(typeof s.eol=="boolean")return s.eol;let r=Date.parse(s.eol);return Number.isNaN(r)?null:r<=n}function Vs(t){let e=String(t).match(/^(\d+)(?:\.(\d+))?/);return e?{major:parseInt(e[1],10),minor:e[2]?parseInt(e[2],10):0}:null}function vn(t){return t.major*1e3+t.minor}function Us(t,e){if(typeof t.releaseDate!="string")return true;let n=Date.parse(t.releaseDate);return Number.isNaN(n)?true:n<=e}function Jo(t,e){if(t.lts===true)return true;if(typeof t.lts=="string"){let n=Date.parse(t.lts);return !Number.isNaN(n)&&n<=e}return false}function wn(t,e){return t.products[e]?.cycles??[]}function Ht(t,e,n=Date.now()){let s=null;for(let r of wn(t,e)){if(!Us(r,n))continue;let o=Vs(r.cycle);o&&(!s||vn(o)>vn(s))&&(s=o);}return s}function Yn(t,e,n=Date.now()){let s=null;for(let r of wn(t,e)){if(!Us(r,n)||!Jo(r,n))continue;let o=Vs(r.cycle);o&&(!s||vn(o)>vn(s))&&(s=o);}return s}function st(t,e,n){let s=wn(t,e).find(r=>String(r.cycle)===n);return s&&typeof s.eol=="string"?s.eol:void 0}function rt(t,e,n,s=Date.now()){let r=Wo(e);if(!r)return null;let o=Ke(e,n);return o?zo(o,wn(t,r),s):null}var Ee={generatedAt:"2026-06-01",source:"endoflife.date",products:{nodejs:{product:"nodejs",cycles:[{cycle:"24",releaseDate:"2025-05-06",lts:"2025-10-28",eol:"2028-04-30"},{cycle:"23",releaseDate:"2024-10-16",lts:false,eol:"2025-06-01"},{cycle:"22",releaseDate:"2024-04-24",lts:"2024-10-29",eol:"2027-04-30"},{cycle:"20",releaseDate:"2023-04-18",lts:"2023-10-24",eol:"2026-04-30"},{cycle:"18",releaseDate:"2022-04-19",lts:"2022-10-25",eol:"2025-04-30"}]},python:{product:"python",cycles:[{cycle:"3.14",releaseDate:"2025-10-07",eol:"2030-10-01"},{cycle:"3.13",releaseDate:"2024-10-07",eol:"2029-10-01"},{cycle:"3.12",releaseDate:"2023-10-02",eol:"2028-10-01"},{cycle:"3.11",releaseDate:"2022-10-24",eol:"2027-10-01"},{cycle:"3.10",releaseDate:"2021-10-04",eol:"2026-10-01"},{cycle:"3.9",releaseDate:"2020-10-05",eol:"2025-10-01"},{cycle:"3.8",releaseDate:"2019-10-14",eol:"2024-10-07"}]},dotnet:{product:"dotnet",cycles:[{cycle:"10.0",releaseDate:"2025-11-11",lts:true,eol:"2028-11-10"},{cycle:"9.0",releaseDate:"2024-11-12",lts:false,eol:"2026-05-12"},{cycle:"8.0",releaseDate:"2023-11-14",lts:true,eol:"2026-11-10"},{cycle:"7.0",releaseDate:"2022-11-08",lts:false,eol:"2024-05-14"},{cycle:"6.0",releaseDate:"2021-11-08",lts:true,eol:"2024-11-12"}]},java:{product:"java",cycles:[{cycle:"25",releaseDate:"2025-09-16",lts:true,eol:"2033-09-01"},{cycle:"21",releaseDate:"2023-09-19",lts:true,eol:"2031-09-01"},{cycle:"17",releaseDate:"2021-09-14",lts:true,eol:"2029-09-01"},{cycle:"11",releaseDate:"2018-09-25",lts:true,eol:"2026-09-01"},{cycle:"8",releaseDate:"2014-03-18",lts:true,eol:"2030-12-01"}]},php:{product:"php",cycles:[{cycle:"8.4",releaseDate:"2024-11-21",eol:"2028-12-31"},{cycle:"8.3",releaseDate:"2023-11-23",eol:"2027-12-31"},{cycle:"8.2",releaseDate:"2022-12-08",eol:"2026-12-31"},{cycle:"8.1",releaseDate:"2021-11-25",eol:"2025-12-31"},{cycle:"8.0",releaseDate:"2020-11-26",eol:"2023-11-26"}]},ruby:{product:"ruby",cycles:[{cycle:"3.5",releaseDate:"2025-12-25",eol:"2029-03-31"},{cycle:"3.4",releaseDate:"2024-12-25",eol:"2028-03-31"},{cycle:"3.3",releaseDate:"2023-12-25",eol:"2027-03-31"},{cycle:"3.2",releaseDate:"2022-12-25",eol:"2026-03-31"},{cycle:"3.1",releaseDate:"2021-12-25",eol:"2025-03-31"}]},go:{product:"go",cycles:[{cycle:"1.25",releaseDate:"2025-08-13",eol:false},{cycle:"1.24",releaseDate:"2025-02-11",eol:false},{cycle:"1.23",releaseDate:"2024-08-13",eol:true},{cycle:"1.22",releaseDate:"2024-02-06",eol:true}]}}};var ve=b(a(),1),et=b(a(),1),ht=b(a(),1);var qs=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Ko=qs+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Qo="["+qs+"]["+Ko+"]*",Yo=new RegExp("^"+Qo+"$");function Sn(t,e){let n=[],s=e.exec(t);for(;s;){let r=[];r.startIndex=e.lastIndex-s[0].length;let o=s.length;for(let a=0;a<o;a++)r.push(s[a]);n.push(r),s=e.exec(t);}return n}var Xn=function(t){let e=Yo.exec(t);return !(e===null||typeof e>"u")};function Gs(t){return typeof t<"u"}var Wt=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],kn=["__proto__","constructor","prototype"];var Xo={allowBooleanAttributes:false,unpairedTags:[]};function Ks(t,e){e=Object.assign({},Xo,e);let n=[],s=false,r=false;t[0]==="\uFEFF"&&(t=t.substr(1));for(let o=0;o<t.length;o++)if(t[o]==="<"&&t[o+1]==="?"){if(o+=2,o=Ws(t,o),o.err)return o}else if(t[o]==="<"){let a=o;if(o++,t[o]==="!"){o=zs(t,o);continue}else {let i=false;t[o]==="/"&&(i=true,o++);let c="";for(;o<t.length&&t[o]!==">"&&t[o]!==" "&&t[o]!==" "&&t[o]!==`
|
|
2
|
+
`&&t[o]!=="\r";o++)c+=t[o];if(c=c.trim(),c[c.length-1]==="/"&&(c=c.substring(0,c.length-1),o--),!ii(c)){let p;return c.trim().length===0?p="Invalid space after '<'.":p="Tag '"+c+"' is an invalid name.",B("InvalidTag",p,K(t,o))}let l=ti(t,o);if(l===false)return B("InvalidAttr","Attributes for '"+c+"' have open quote.",K(t,o));let u=l.value;if(o=l.index,u[u.length-1]==="/"){let p=o-u.length;u=u.substring(0,u.length-1);let d=Js(u,e);if(d===true)s=true;else return B(d.err.code,d.err.msg,K(t,p+d.err.line))}else if(i)if(l.tagClosed){if(u.trim().length>0)return B("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",K(t,a));if(n.length===0)return B("InvalidTag","Closing tag '"+c+"' has not been opened.",K(t,a));{let p=n.pop();if(c!==p.tagName){let d=K(t,p.tagStartPos);return B("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+d.line+", col "+d.col+") instead of closing tag '"+c+"'.",K(t,a))}n.length==0&&(r=true);}}else return B("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",K(t,o));else {let p=Js(u,e);if(p!==true)return B(p.err.code,p.err.msg,K(t,o-u.length+p.err.line));if(r===true)return B("InvalidXml","Multiple possible root nodes found.",K(t,o));e.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:a}),s=true;}for(o++;o<t.length;o++)if(t[o]==="<")if(t[o+1]==="!"){o++,o=zs(t,o);continue}else if(t[o+1]==="?"){if(o=Ws(t,++o),o.err)return o}else break;else if(t[o]==="&"){let p=ri(t,o);if(p==-1)return B("InvalidChar","char '&' is not expected.",K(t,o));o=p;}else if(r===true&&!Hs(t[o]))return B("InvalidXml","Extra text at the end",K(t,o));t[o]==="<"&&o--;}}else {if(Hs(t[o]))continue;return B("InvalidChar","char '"+t[o]+"' is not expected.",K(t,o))}if(s){if(n.length==1)return B("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",K(t,n[0].tagStartPos));if(n.length>0)return B("InvalidXml","Invalid '"+JSON.stringify(n.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return B("InvalidXml","Start tag expected.",1);return true}function Hs(t){return t===" "||t===" "||t===`
|
|
3
|
+
`||t==="\r"}function Ws(t,e){let n=e;for(;e<t.length;e++)if(t[e]=="?"||t[e]==" "){let s=t.substr(n,e-n);if(e>5&&s==="xml")return B("InvalidXml","XML declaration allowed only at the start of the document.",K(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}function zs(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++)if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let n=1;for(e+=8;e<t.length;e++)if(t[e]==="<")n++;else if(t[e]===">"&&(n--,n===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++)if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}return e}var Zo='"',ei="'";function ti(t,e){let n="",s="",r=false;for(;e<t.length;e++){if(t[e]===Zo||t[e]===ei)s===""?s=t[e]:s!==t[e]||(s="");else if(t[e]===">"&&s===""){r=true;break}n+=t[e];}return s!==""?false:{value:n,index:e,tagClosed:r}}var ni=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Js(t,e){let n=Sn(t,ni),s={};for(let r=0;r<n.length;r++){if(n[r][1].length===0)return B("InvalidAttr","Attribute '"+n[r][2]+"' has no space in starting.",zt(n[r]));if(n[r][3]!==void 0&&n[r][4]===void 0)return B("InvalidAttr","Attribute '"+n[r][2]+"' is without value.",zt(n[r]));if(n[r][3]===void 0&&!e.allowBooleanAttributes)return B("InvalidAttr","boolean attribute '"+n[r][2]+"' is not allowed.",zt(n[r]));let o=n[r][2];if(!oi(o))return B("InvalidAttr","Attribute '"+o+"' is an invalid name.",zt(n[r]));if(!Object.prototype.hasOwnProperty.call(s,o))s[o]=1;else return B("InvalidAttr","Attribute '"+o+"' is repeated.",zt(n[r]))}return true}function si(t,e){let n=/\d/;for(t[e]==="x"&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(t[e]===";")return e;if(!t[e].match(n))break}return -1}function ri(t,e){if(e++,t[e]===";")return -1;if(t[e]==="#")return e++,si(t,e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(t[e]===";")break;return -1}return e}function B(t,e,n){return {err:{code:t,msg:e,line:n.line||n,col:n.col}}}function oi(t){return Xn(t)}function ii(t){return Xn(t)}function K(t,e){let n=t.substring(0,e).split(/\r?\n/);return {line:n.length,col:n[n.length-1].length+1}}function zt(t){return t.startIndex+t[1].length}var En={cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",euro:"\u20AC",dollar:"$",fnof:"\u0192",inr:"\u20B9",af:"\u060B",birr:"\u1265\u122D",peso:"\u20B1",rub:"\u20BD",won:"\u20A9",yuan:"\xA5",cedil:"\xB8"},Jt={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Zn={nbsp:"\xA0",copy:"\xA9",reg:"\xAE",trade:"\u2122",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",laquo:"\xAB",raquo:"\xBB",lsquo:"\u2018",rsquo:"\u2019",ldquo:"\u201C",rdquo:"\u201D",bull:"\u2022",para:"\xB6",sect:"\xA7",deg:"\xB0",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE"};var At=Object.freeze({ALLOW:"allow",BLOCK:"block",THROW:"throw"}),ci=new Set("!?\\\\/[]$%{}^&*()<>|+");function cr(t){if(t[0]==="#")throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${t}"`);for(let e of t)if(ci.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: "${t}"`);return t}function Kt(...t){let e=Object.create(null);for(let n of t)if(n)for(let s of Object.keys(n)){let r=n[s];if(typeof r=="string")e[s]=r;else if(r&&typeof r=="object"&&r.val!==void 0){let o=r.val;typeof o=="string"&&(e[s]=o);}}return e}var ot="external",jn="base",es="all";function li(t){return !t||t===ot?new Set([ot]):t===es?new Set([es]):t===jn?new Set([jn]):Array.isArray(t)?new Set(t):new Set([ot])}var X=Object.freeze({allow:0,leave:1,remove:2,throw:3}),ui=new Set([9,10,13]);function pi(t){if(!t)return {xmlVersion:1,onLevel:X.allow,nullLevel:X.remove};let e=t.xmlVersion===1.1?1.1:1,n=X[t.onNCR]??X.allow,s=X[t.nullNCR]??X.remove,r=Math.max(s,X.remove);return {xmlVersion:e,onLevel:n,nullLevel:r}}var Pt=class{constructor(e={}){this._limit=e.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof e.postCheck=="function"?e.postCheck:s=>s,this._limitTiers=li(this._limit.applyLimitsTo??ot),this._numericAllowed=e.numericAllowed??true,this._baseMap=Kt(Jt,e.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(e.remove&&Array.isArray(e.remove)?e.remove:[]),this._leaveSet=new Set(e.leave&&Array.isArray(e.leave)?e.leave:[]);let n=pi(e.ncr);this._ncrXmlVersion=n.xmlVersion,this._ncrOnLevel=n.onLevel,this._ncrNullLevel=n.nullLevel,this._onExternalEntity=typeof e.onExternalEntity=="function"?e.onExternalEntity:null,this._onInputEntity=typeof e.onInputEntity=="function"?e.onInputEntity:null;}_applyRegistrationHook(e,n,s,r){if(!e)return true;let o=e(n,s);if(o===At.BLOCK)return false;if(o===At.THROW)throw new Error(`[EntityDecoder] Registration of ${r} entity "&${n};" was rejected by hook`);return true}setExternalEntities(e){if(e)for(let r of Object.keys(e))cr(r);if(!this._onExternalEntity){this._externalMap=Kt(e);return}let n=Kt(e),s=Object.create(null);for(let[r,o]of Object.entries(n))this._applyRegistrationHook(this._onExternalEntity,r,o,"external")&&(s[r]=o);this._externalMap=s;}addExternalEntity(e,n){cr(e),typeof n=="string"&&n.indexOf("&")===-1&&this._applyRegistrationHook(this._onExternalEntity,e,n,"external")&&(this._externalMap[e]=n);}addInputEntities(e){if(this._totalExpansions=0,this._expandedLength=0,!this._onInputEntity){this._inputMap=Kt(e);return}let n=Kt(e),s=Object.create(null);for(let[r,o]of Object.entries(n))this._applyRegistrationHook(this._onInputEntity,r,o,"input")&&(s[r]=o);this._inputMap=s;}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(e){this._ncrXmlVersion=e===1.1?1.1:1;}decode(e){if(typeof e!="string"||e.length===0||e.indexOf("&")===-1)return e;let n=e,s=[],r=e.length,o=0,a=0,i=this._maxTotalExpansions>0,c=this._maxExpandedLength>0,l=i||c;for(;a<r;){if(e.charCodeAt(a)!==38){a++;continue}let p=a+1;for(;p<r&&e.charCodeAt(p)!==59&&p-a<=32;)p++;if(p>=r||e.charCodeAt(p)!==59){a++;continue}let d=e.slice(a+1,p);if(d.length===0){a++;continue}let f,g;if(this._removeSet.has(d))f="",g===void 0&&(g=ot);else if(this._leaveSet.has(d)){a++;continue}else if(d.charCodeAt(0)===35){let h=this._resolveNCR(d);if(h===void 0){a++;continue}f=h,g=jn;}else {let h=this._resolveName(d);f=h?.value,g=h?.tier;}if(f===void 0){a++;continue}if(a>o&&s.push(e.slice(o,a)),s.push(f),o=p+1,a=o,l&&this._tierCounts(g)){if(i&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(c){let h=f.length-(d.length+2);if(h>0&&(this._expandedLength+=h,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}o<r&&s.push(e.slice(o));let u=s.length===0?e:s.join("");return this._postCheck(u,n)}_tierCounts(e){return this._limitTiers.has(es)?true:this._limitTiers.has(e)}_resolveName(e){if(e in this._inputMap)return {value:this._inputMap[e],tier:ot};if(e in this._externalMap)return {value:this._externalMap[e],tier:ot};if(e in this._baseMap)return {value:this._baseMap[e],tier:jn}}_classifyNCR(e){return e===0?this._ncrNullLevel:e>=55296&&e<=57343||this._ncrXmlVersion===1&&e>=1&&e<=31&&!ui.has(e)?X.remove:-1}_applyNCRAction(e,n,s){switch(e){case X.allow:return String.fromCodePoint(s);case X.remove:return "";case X.leave:return;case X.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${n}; (U+${s.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(s)}}_resolveNCR(e){let n=e.charCodeAt(1),s;if(n===120||n===88?s=parseInt(e.slice(2),16):s=parseInt(e.slice(1),10),Number.isNaN(s)||s<0||s>1114111)return;let r=this._classifyNCR(s);if(!this._numericAllowed&&r<X.remove)return;let o=r===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,r);return this._applyNCRAction(o,e,s)}};var lr=t=>Wt.includes(t)?"__"+t:t,di={preserveOrder:false,attributeNamePrefix:"@_",attributesGroupName:false,textNodeName:"#text",ignoreAttributes:true,removeNSPrefix:false,allowBooleanAttributes:false,parseTagValue:true,parseAttributeValue:false,trimValues:true,cdataPropName:false,numberParseOptions:{hex:true,leadingZeros:true,eNotation:true,unicode:false},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:false,isArray:()=>false,commentPropName:false,unpairedTags:[],processEntities:true,htmlEntities:false,entityDecoder:null,ignoreDeclaration:false,ignorePiTags:false,transformTagName:false,transformAttributeName:false,updateTag:function(t,e,n){return t},captureMetaData:false,maxNestedTags:100,strictReservedNames:true,jPath:true,onDangerousProperty:lr};function fi(t,e){if(typeof t!="string")return;let n=t.toLowerCase();if(Wt.some(s=>n===s.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);if(kn.some(s=>n===s.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`)}function ur(t,e){return typeof t=="boolean"?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:typeof t=="object"&&t!==null?{enabled:t.enabled!==false,maxEntitySize:Math.max(1,t.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,t.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,t.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,t.maxExpandedLength??1e5),maxEntityCount:Math.max(1,t.maxEntityCount??1e3),allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null,appliesTo:t.appliesTo??"all"}:ur(true)}var pr=function(t){let e=Object.assign({},di,t),n=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];for(let{value:s,name:r}of n)s&&fi(s,r);return e.onDangerousProperty===null&&(e.onDangerousProperty=lr),e.processEntities=ur(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(s=>typeof s=="string"&&s.startsWith("*.")?".."+s.substring(2):s)),e};var xn;typeof Symbol!="function"?xn="@@xmlMetadata":xn=Symbol("XML Node Metadata");var Z=class{constructor(e){this.tagname=e,this.child=[],this[":@"]=Object.create(null);}add(e,n){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:n});}addChild(e,n){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),n!==void 0&&(this.child[this.child.length-1][xn]={startIndex:n});}static getMetaDataSymbol(){return xn}};var dr=":A-Za-z_\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",hi=dr+"\\-\\.\\d\xB7\u0300-\u036F\u203F-\u2040",fr=":A-Za-z_\xC0-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",mi=fr+"\\-\\.\\d\xB7\u0300-\u036F\u0487\u203F-\u2040",hr=(t,e,n="")=>{let s=t.replace(":",""),r=e.replace(":",""),o=`[${s}][${r}]*`;return {name:new RegExp(`^[${t}][${e}]*$`,n),ncName:new RegExp(`^${o}$`,n),qName:new RegExp(`^${o}(?::${o})?$`,n),nmToken:new RegExp(`^[${e}]+$`,n),nmTokens:new RegExp(`^[${e}]+(?:\\s+[${e}]+)*$`,n)}},gi=hr(dr,hi),yi=hr(fr,mi,"u"),bi=(t="1.0")=>t==="1.1"?yi:gi;var ts=(t,{xmlVersion:e="1.0"}={})=>bi(e).qName.test(t);var Yt=class{constructor(e,n){this.suppressValidationErr=!e,this.options=e,this.xmlVersion=n||1;}setXmlVersion(e=1){this.xmlVersion=e;}readDocType(e,n){let s=Object.create(null),r=0;if(e[n+3]==="O"&&e[n+4]==="C"&&e[n+5]==="T"&&e[n+6]==="Y"&&e[n+7]==="P"&&e[n+8]==="E"){n=n+9;let o=1,a=false,i=false,c="";for(;n<e.length;n++)if(e[n]==="<"&&!i){if(a&&it(e,"!ENTITY",n)){n+=7;let l,u;if([l,u,n]=this.readEntityExp(e,n+1,this.suppressValidationErr),u.indexOf("&")===-1){if(this.options.enabled!==false&&this.options.maxEntityCount!=null&&r>=this.options.maxEntityCount)throw new Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);s[l]=u,r++;}}else if(a&&it(e,"!ELEMENT",n)){n+=8;let{index:l}=this.readElementExp(e,n+1);n=l;}else if(a&&it(e,"!ATTLIST",n))n+=8;else if(a&&it(e,"!NOTATION",n)){n+=9;let{index:l}=this.readNotationExp(e,n+1,this.suppressValidationErr);n=l;}else if(it(e,"!--",n))i=true;else throw new Error("Invalid DOCTYPE");o++,c="";}else if(e[n]===">"){if(i?e[n-1]==="-"&&e[n-2]==="-"&&(i=false,o--):o--,o===0)break}else e[n]==="["?a=true:c+=e[n];if(o!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return {entities:s,i:n}}readEntityExp(e,n){n=ee(e,n);let s=n;for(;n<e.length&&!/\s/.test(e[n])&&e[n]!=='"'&&e[n]!=="'";)n++;let r=e.substring(s,n);if(Qt(r,{xmlVersion:this.xmlVersion}),n=ee(e,n),!this.suppressValidationErr){if(e.substring(n,n+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[n]==="%")throw new Error("Parameter entities are not supported")}let o="";if([n,o]=this.readIdentifierVal(e,n,"entity"),this.options.enabled!==false&&this.options.maxEntitySize!=null&&o.length>this.options.maxEntitySize)throw new Error(`Entity "${r}" size (${o.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return n--,[r,o,n]}readNotationExp(e,n){n=ee(e,n);let s=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;let r=e.substring(s,n);!this.suppressValidationErr&&Qt(r,{xmlVersion:this.xmlVersion}),n=ee(e,n);let o=e.substring(n,n+6).toUpperCase();if(!this.suppressValidationErr&&o!=="SYSTEM"&&o!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${o}"`);n+=o.length,n=ee(e,n);let a=null,i=null;if(o==="PUBLIC")[n,a]=this.readIdentifierVal(e,n,"publicIdentifier"),n=ee(e,n),(e[n]==='"'||e[n]==="'")&&([n,i]=this.readIdentifierVal(e,n,"systemIdentifier"));else if(o==="SYSTEM"&&([n,i]=this.readIdentifierVal(e,n,"systemIdentifier"),!this.suppressValidationErr&&!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return {notationName:r,publicIdentifier:a,systemIdentifier:i,index:--n}}readIdentifierVal(e,n,s){let r="",o=e[n];if(o!=='"'&&o!=="'")throw new Error(`Expected quoted string, found "${o}"`);n++;let a=n;for(;n<e.length&&e[n]!==o;)n++;if(r=e.substring(a,n),e[n]!==o)throw new Error(`Unterminated ${s} value`);return n++,[n,r]}readElementExp(e,n){n=ee(e,n);let s=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;let r=e.substring(s,n);if(!this.suppressValidationErr&&!ts(r,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid element name: "${r}"`);n=ee(e,n);let o="";if(e[n]==="E"&&it(e,"MPTY",n))n+=4;else if(e[n]==="A"&&it(e,"NY",n))n+=2;else if(e[n]==="("){n++;let a=n;for(;n<e.length&&e[n]!==")";)n++;if(o=e.substring(a,n),e[n]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[n]}"`);return {elementName:r,contentModel:o.trim(),index:n}}readAttlistExp(e,n){n=ee(e,n);let s=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;let r=e.substring(s,n);for(Qt(r,{xmlVersion:this.xmlVersion}),n=ee(e,n),s=n;n<e.length&&!/\s/.test(e[n]);)n++;let o=e.substring(s,n);if(!Qt(o,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid attribute name: "${o}"`);n=ee(e,n);let a="";if(e.substring(n,n+8).toUpperCase()==="NOTATION"){if(a="NOTATION",n+=8,n=ee(e,n),e[n]!=="(")throw new Error(`Expected '(', found "${e[n]}"`);n++;let c=[];for(;n<e.length&&e[n]!==")";){let l=n;for(;n<e.length&&e[n]!=="|"&&e[n]!==")";)n++;let u=e.substring(l,n);if(u=u.trim(),!Qt(u,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid notation name: "${u}"`);c.push(u),e[n]==="|"&&(n++,n=ee(e,n));}if(e[n]!==")")throw new Error("Unterminated list of notations");n++,a+=" ("+c.join("|")+")";}else {let c=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;a+=e.substring(c,n);let l=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!l.includes(a.toUpperCase()))throw new Error(`Invalid attribute type: "${a}"`)}n=ee(e,n);let i="";return e.substring(n,n+8).toUpperCase()==="#REQUIRED"?(i="#REQUIRED",n+=8):e.substring(n,n+7).toUpperCase()==="#IMPLIED"?(i="#IMPLIED",n+=7):[n,i]=this.readIdentifierVal(e,n,"ATTLIST"),{elementName:r,attributeName:o,attributeType:a,defaultValue:i,index:n}}},ee=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function it(t,e,n){for(let s=0;s<e.length;s++)if(e[s]!==t[n+s+1])return false;return true}function Qt(t,e){if(ts(t,{xmlVersion:e}))return t;throw new Error(`Invalid entity name ${t}`)}var vi=[48,1632,1776,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,65296,120782,120792,120802,120812,120822,66720,68912,69734,69872,69942,70096,70384,70736,70864,71248,71360,71472,71904,72016,72688,72784,73040,73120,73552,92768,92864,93008,123200,123632,124144,125264,130032],Tn=255,Cn=new Map,mr=65535,gr=1632,Mt=gr,wi=mr-gr+1,An=new Uint8Array(wi).fill(Tn);for(let t of vi)for(let e=0;e<10;e++){let n=t+e;n<=mr?An[n-Mt]=e:Cn.set(n,e);}var yr=48,br=57,vr=45,Pn=new Set([8722,65293,65123]);function Si(t){if(typeof t!="string")return t;let e=t.length;if(e===0)return t;let n=-1;for(let r=0;r<e;r++){let o=t.charCodeAt(r);if(!(o>=yr&&o<=br||o===vr)){if(o<Mt){if(Pn.has(o)){n=r;break}continue}if(o>=55296&&o<=56319){if(r+1<e){let a=t.charCodeAt(r+1);if(a>=56320&&a<=57343){let i=65536+(o-55296<<10)+(a-56320);if(Cn.has(i)){n=r;break}}}continue}if(An[o-Mt]!==Tn||Pn.has(o)){n=r;break}}}if(n===-1)return t;let s=[];n>0&&s.push(t.slice(0,n));for(let r=n;r<e;r++){let o=t.charCodeAt(r);if(o>=yr&&o<=br||o===vr){s.push(t[r]);continue}if(o<Mt){s.push(Pn.has(o)?"-":t[r]);continue}if(o>=55296&&o<=56319){if(r+1<e){let i=t.charCodeAt(r+1);if(i>=56320&&i<=57343){let c=65536+(o-55296<<10)+(i-56320),l=Cn.get(c);if(l!==void 0){s.push(String.fromCharCode(l+48)),r++;continue}}}s.push(t[r]);continue}if(Pn.has(o)){s.push("-");continue}let a=An[o-Mt];s.push(a!==Tn?String.fromCharCode(a+48):t[r]);}return s.join("")}var wr=Si;var ki=/^[-+]?0x[a-fA-F0-9]+$/,Ei=/^0b[01]+$/,ji=/^0o[0-7]+$/,xi=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Ti={hex:true,binary:false,octal:false,leadingZeros:true,decimalPoint:".",eNotation:true,infinity:"original",unicode:false};function ss(t,e={}){if(e=Object.assign({},Ti,e),!t||typeof t!="string")return t;let n=t.trim();if(n.length===0)return t;if(e.skipLike!==void 0&&e.skipLike.test(n))return t;if(n==="0"||e.unicode&&(n=wr(n),n==="0"))return 0;if(e.hex&&ki.test(n))return ns(n,16);if(e.binary&&Ei.test(n))return ns(n,2);if(e.octal&&ji.test(n))return ns(n,8);if(isFinite(n)){if(n.includes("e")||n.includes("E"))return Ai(t,n,e);{let s=xi.exec(n);if(s){let r=s[1]||"",o=s[2],a=Pi(s[3]),i=r?t[o.length+1]===".":t[o.length]===".";if(!e.leadingZeros&&(o.length>1||o.length===1&&!i))return t;{let c=Number(n),l=String(c);if(c===0)return c;if(l.search(/[eE]/)!==-1)return e.eNotation?c:t;if(n.indexOf(".")!==-1)return l==="0"||l===a||l===`${r}${a}`?c:t;let u=o?a:n;return o?u===l||r+u===l?c:t:u===l||u===r+l?c:t}}else return t}}else return Mi(t,Number(n),e)}var Ci=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Ai(t,e,n){if(!n.eNotation)return t;let s=e.match(Ci);if(s){let r=s[1]||"",o=s[3].indexOf("e")===-1?"E":"e",a=s[2],i=r?t[a.length+1]===o:t[a.length]===o;return a.length>1&&i?t:a.length===1&&(s[3].startsWith(`.${o}`)||s[3][0]===o)?Number(e):a.length>0?n.leadingZeros&&!i?(e=(s[1]||"")+s[3],Number(e)):t:Number(e)}else return t}function Pi(t){return t&&t.indexOf(".")!==-1&&(t=t.replace(/0+$/,""),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substring(0,t.length-1))),t}function ns(t,e){let n=t.trim();if((e===2||e===8)&&(t=n.substring(2)),parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Mi(t,e,n){let s=e===1/0;switch(n.infinity.toLowerCase()){case "null":return null;case "infinity":return e;case "string":return s?"Infinity":"-Infinity";default:return t}}function rs(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(let n of t)if(typeof n=="string"&&e===n||n instanceof RegExp&&n.test(e))return true}:()=>false}var at=class{constructor(e,n={},s){this.pattern=e,this.separator=n.separator||".",this.segments=this._parse(e),this.data=s,this._hasDeepWildcard=this.segments.some(r=>r.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(r=>r.attrName!==void 0),this._hasPositionSelector=this.segments.some(r=>r.position!==void 0);}_parse(e){let n=[],s=0,r="";for(;s<e.length;)e[s]===this.separator?s+1<e.length&&e[s+1]===this.separator?(r.trim()&&(n.push(this._parseSegment(r.trim())),r=""),n.push({type:"deep-wildcard"}),s+=2):(r.trim()&&n.push(this._parseSegment(r.trim())),r="",s++):(r+=e[s],s++);return r.trim()&&n.push(this._parseSegment(r.trim())),n}_parseSegment(e){let n={type:"tag"},s=null,r=e,o=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(o&&(r=o[1]+o[3],o[2])){let u=o[2].slice(1,-1);u&&(s=u);}let a,i=r;if(r.includes("::")){let u=r.indexOf("::");if(a=r.substring(0,u).trim(),i=r.substring(u+2).trim(),!a)throw new Error(`Invalid namespace in pattern: ${e}`)}let c,l=null;if(i.includes(":")){let u=i.lastIndexOf(":"),p=i.substring(0,u).trim(),d=i.substring(u+1).trim();["first","last","odd","even"].includes(d)||/^nth\(\d+\)$/.test(d)?(c=p,l=d):c=i;}else c=i;if(!c)throw new Error(`Invalid segment pattern: ${e}`);if(n.tag=c,a&&(n.namespace=a),s)if(s.includes("=")){let u=s.indexOf("=");n.attrName=s.substring(0,u).trim(),n.attrValue=s.substring(u+1).trim();}else n.attrName=s.trim();if(l){let u=l.match(/^nth\((\d+)\)$/);u?(n.position="nth",n.positionValue=parseInt(u[1],10)):n.position=l;}return n}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}};var $t=class{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._deepByTerminalTag=new Map,this._patterns=new Set,this._sealed=false;}add(e){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(e.pattern))return this;if(this._patterns.add(e.pattern),e.hasDeepWildcard()){let o=e.segments[e.segments.length-1];if(o&&o.type!=="deep-wildcard"&&o.tag!=="*"){let a=o.tag;this._deepByTerminalTag.has(a)||this._deepByTerminalTag.set(a,[]),this._deepByTerminalTag.get(a).push(e);}else this._deepWildcards.push(e);return this}let n=e.length,r=e.segments[e.segments.length-1]?.tag;if(!r||r==="*")this._wildcardByDepth.has(n)||this._wildcardByDepth.set(n,[]),this._wildcardByDepth.get(n).push(e);else {let o=`${n}:${r}`;this._byDepthAndTag.has(o)||this._byDepthAndTag.set(o,[]),this._byDepthAndTag.get(o).push(e);}return this}addAll(e){for(let n of e)this.add(n);return this}has(e){return this._patterns.has(e.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=true,this}get isSealed(){return this._sealed}matchesAny(e){return this.findMatch(e)!==null}findMatch(e){let n=e.getDepth(),s=e.getCurrentTag(),r=`${n}:${s}`,o=this._byDepthAndTag.get(r);if(o){for(let c=0;c<o.length;c++)if(e.matches(o[c]))return o[c]}let a=this._wildcardByDepth.get(n);if(a){for(let c=0;c<a.length;c++)if(e.matches(a[c]))return a[c]}let i=this._deepByTerminalTag.get(s);if(i){for(let c=0;c<i.length;c++)if(e.matches(i[c]))return i[c]}for(let c=0;c<this._deepWildcards.length;c++)if(e.matches(this._deepWildcards[c]))return this._deepWildcards[c];return null}};var os=class{constructor(e){this._matcher=e;}get separator(){return this._matcher.separator}getCurrentTag(){let e=this._matcher.path;return e.length>0?e[e.length-1].tag:void 0}getCurrentNamespace(){let e=this._matcher.path;return e.length>0?e[e.length-1].namespace:void 0}getAttrValue(e){let n=this._matcher.path;if(n.length!==0)return n[n.length-1].values?.[e]}hasAttr(e){let n=this._matcher.path;if(n.length===0)return false;let s=n[n.length-1];return s.values!==void 0&&e in s.values}getAnyParentAttr(e){return this._matcher.getAnyParentAttr(e)}hasAnyParentAttr(e){return this._matcher.hasAnyParentAttr(e)}getPosition(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].position??0}getCounter(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(e,n=true){return this._matcher.toString(e,n)}toArray(){return this._matcher.path.map(e=>e.tag)}matches(e){return this._matcher.matches(e)}matchesAny(e){return e.matchesAny(this._matcher)}},Lt=class{constructor(e={}){this.separator=e.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new os(this),this._keptAttrs=[];}push(e,n=null,s=null,r=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let o=this.path.length;this.siblingStacks[o]||(this.siblingStacks[o]=new Map);let a=this.siblingStacks[o],i=s?`${s}:${e}`:e,c=a.get(i)||0,l=0;for(let f of a.values())l+=f;a.set(i,c+1);let u={tag:e,position:l,counter:c};s!=null&&(u.namespace=s),n!=null&&(u.values=n),this.path.push(u);let p=this.path.length,d=r!==null?r.keep:null;if(d!=null&&d.length>0&&n)for(let f=0;f<d.length;f++){let g=d[f];n[g]!==void 0&&this._keptAttrs.push({depth:p,name:g,value:n[g]});}}pop(){if(this.path.length===0)return;this._pathStringCache=null;let e=this.path.pop();this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1);let n=this.path.length+1;for(;this._keptAttrs.length>0&&this._keptAttrs[this._keptAttrs.length-1].depth>=n;)this._keptAttrs.pop();return e}updateCurrent(e){if(this.path.length>0){let n=this.path[this.path.length-1];e!=null&&(n.values=e);}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return false;let n=this.path[this.path.length-1];return n.values!==void 0&&e in n.values}getAnyParentAttr(e){let n=this._keptAttrs;for(let s=n.length-1;s>=0;s--)if(n[s].name===e)return n[s].value}hasAnyParentAttr(e){let n=this._keptAttrs;for(let s=n.length-1;s>=0;s--)if(n[s].name===e)return true;return false}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,n=true){let s=e||this.separator;if(s===this.separator&&n===true){if(this._pathStringCache!==null)return this._pathStringCache;let o=this.path.map(a=>a.namespace?`${a.namespace}:${a.tag}`:a.tag).join(s);return this._pathStringCache=o,o}return this.path.map(o=>n&&o.namespace?`${o.namespace}:${o.tag}`:o.tag).join(s)}toArray(){return this.path.map(e=>e.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[],this._keptAttrs=[];}matches(e){let n=e.segments;return n.length===0?false:e.hasDeepWildcard()?this._matchWithDeepWildcard(n):this._matchSimple(n)}_matchSimple(e){if(this.path.length!==e.length)return false;for(let n=0;n<e.length;n++)if(!this._matchSegment(e[n],this.path[n],n===this.path.length-1))return false;return true}_matchWithDeepWildcard(e){let n=this.path.length-1,s=e.length-1;for(;s>=0&&n>=0;){let r=e[s];if(r.type==="deep-wildcard"){if(s--,s<0)return true;let o=e[s],a=false;for(let i=n;i>=0;i--)if(this._matchSegment(o,this.path[i],i===this.path.length-1)){n=i-1,s--,a=true;break}if(!a)return false}else {if(!this._matchSegment(r,this.path[n],n===this.path.length-1))return false;n--,s--;}}return s<0}_matchSegment(e,n,s){if(e.tag!=="*"&&e.tag!==n.tag||e.namespace!==void 0&&e.namespace!=="*"&&e.namespace!==n.namespace||e.attrName!==void 0&&(!s||!n.values||!(e.attrName in n.values)||e.attrValue!==void 0&&String(n.values[e.attrName])!==String(e.attrValue)))return false;if(e.position!==void 0){if(!s)return false;let r=n.counter??0;if(e.position==="first"&&r!==0)return false;if(e.position==="odd"&&r%2!==1)return false;if(e.position==="even"&&r%2!==0)return false;if(e.position==="nth"&&r!==e.positionValue)return false}return true}matchesAny(e){return e.matchesAny(this)}snapshot(){return {path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e)),keptAttrs:this._keptAttrs.map(e=>({...e}))}}restore(e){this._pathStringCache=null,this.path=e.path.map(n=>({...n})),this.siblingStacks=e.siblingStacks.map(n=>new Map(n)),this._keptAttrs=(e.keptAttrs||[]).map(n=>({...n}));}readOnly(){return this._view}};var $i=[{id:"html-script-open",description:"<script opening tag",pattern:/<script[\s>/]/i},{id:"html-script-close",description:"</script closing tag",pattern:/<\/script[\s>]/i},{id:"html-javascript-protocol",description:"javascript: URI scheme (with optional whitespace/encoding)",pattern:/j[\t\n\r ]*a[\t\n\r ]*v[\t\n\r ]*a[\t\n\r ]*s[\t\n\r ]*c[\t\n\r ]*r[\t\n\r ]*i[\t\n\r ]*p[\t\n\r ]*t[\t\n\r ]*:/i},{id:"html-vbscript-protocol",description:"vbscript: URI scheme",pattern:/vbscript[\t\n\r ]*:/i},{id:"html-data-html",description:"data:text/html URI \u2014 can execute scripts in browsers",pattern:/data[\t\n\r ]*:[\t\n\r ]*text\/html/i},{id:"html-data-xhtml",description:"data:application/xhtml+xml URI",pattern:/data[\t\n\r ]*:[\t\n\r ]*application\/xhtml/i},{id:"html-data-svg",description:"data:image/svg+xml URI \u2014 can execute scripts",pattern:/data[\t\n\r ]*:[\t\n\r ]*image\/svg\+xml/i},{id:"html-inline-event-handler",description:"Inline event handler attributes: onclick=, onerror=, onload=, etc.",pattern:/\bon\w{1,30}\s*=/i},{id:"html-entity-obfuscated-script",description:"HTML-entity-encoded <script (e.g. <script or <script)",pattern:/(?:�*3[Cc];?|�*60;?|<)\s*script/i},{id:"html-entity-obfuscated-javascript",description:'HTML-entity-encoded javascript: (partial \u2014 catches common j or j for "j")',pattern:/(?:�*6[Aa];?|�*106;?)\s*(?:�*61;?|a)[\s\S]{0,80}script\s*:/i},{id:"html-style-expression",description:"CSS expression() \u2014 IE-era code execution in style attributes",pattern:/style[\s\S]{0,20}expression\s*\(/i},{id:"html-object-embed",description:"<object or <embed tags that can load active content",pattern:/<(?:object|embed)[\s>/]/i},{id:"html-base-tag",description:"<base href= \u2014 can hijack all relative URLs on a page",pattern:/<base[\s>]/i},{id:"html-meta-refresh",description:'<meta http-equiv="refresh" \u2014 can redirect users',pattern:/<meta[\s\S]{0,40}http-equiv[\s\S]{0,20}refresh/i},{id:"html-srcdoc",description:"srcdoc= attribute on iframes \u2014 embeds HTML that can run scripts",pattern:/srcdoc\s*=/i},{id:"html-iframe",description:"<iframe tag",pattern:/<iframe[\s>/]/i},{id:"html-form",description:"<form tag \u2014 can be used for phishing / credential harvesting injection",pattern:/<form[\s>/]/i}],Sr=$i;var Li=[{id:"xml-cdata-injection",description:"CDATA section injection: <![CDATA[ breaks out of text node context",pattern:/<!\[CDATA\[/i},{id:"xml-cdata-close",description:"CDATA close sequence: ]]> can terminate an enclosing CDATA section",pattern:/\]\]>/},{id:"xml-processing-instruction",description:"XML processing instruction: <?xml-stylesheet or <?php etc.",pattern:/<\?(?:xml[\- ]|php|asp)/i},{id:"xml-doctype-injection",description:"DOCTYPE declaration embedded in content \u2014 can define entities",pattern:/<!DOCTYPE(?:[\s[]|$)/i},{id:"xml-entity-system",description:"SYSTEM keyword \u2014 used in external entity declarations (XXE)",pattern:/\bSYSTEM\s+["']/i},{id:"xml-entity-public",description:"PUBLIC keyword \u2014 used in external entity declarations (XXE)",pattern:/\bPUBLIC\s+["']/i},{id:"xml-entity-declaration",description:"<!ENTITY declaration \u2014 defines entities, potential XXE or entity expansion",pattern:/<!ENTITY[\s%]/i},{id:"xml-billion-laughs",description:"Entity reference chaining / billion laughs: repeated &eX; style references",pattern:/(?:&\w{1,20};){3,}/},{id:"xml-namespace-confusion",description:"xmlns: attribute injection \u2014 can redefine namespaces to confuse parsers",pattern:/\bxmlns\s*(?::\w{1,40})?\s*=/i},{id:"xml-comment-injection",description:"<!-- comment injection \u2014 can hide content from some parsers",pattern:/<!--/},{id:"xml-comment-close",description:"--> closes an enclosing XML comment",pattern:/-->/},{id:"xml-pi-close",description:"?> closes an enclosing processing instruction",pattern:/\?>/}],kr=Li;var Ni=[{id:"svg-script-element",description:"<script element inside SVG executes JavaScript",pattern:/<script[\s>/]/i},{id:"svg-xlink-href-javascript",description:"xlink:href with javascript: \u2014 classic SVG XSS via <a> or <use>",pattern:/xlink\s*:\s*href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-href-javascript",description:"href= with javascript: in SVG context (<a>, <animate>, etc.)",pattern:/href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-foreignobject",description:"<foreignObject embeds HTML inside SVG \u2014 can execute scripts",pattern:/<foreignObject[\s>/]/i},{id:"svg-use-external",description:"<use xlink:href or href pointing to external resource (non-fragment URL)",pattern:/<use[\s\S]{0,60}(?:xlink\s*:\s*)?href\s*=\s*(?:["'][^#]|[^"'#\s>])/i},{id:"svg-animate-href",description:'<animate attributeName="href" \u2014 can dynamically change href to javascript:',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*href["']/i},{id:"svg-animate-xlinkhref",description:'<animate attributeName="xlink:href"',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*xlink\s*:\s*href["']/i},{id:"svg-set-javascript",description:'<set to="javascript:..." \u2014 sets an attribute to a javascript: URI',pattern:/<set[\s\S]{0,80}to\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-event-handler",description:"SVG-specific event handler attributes: onload=, onerror=, onactivate=, etc.",pattern:/\bon(?:load|error|activate|begin|end|repeat|focus|blur|click|mouse\w{1,20}|key\w{1,20})\s*=/i},{id:"svg-handler-generic",description:"Generic on* handler catch-all for SVG attributes",pattern:/\bon\w{1,30}\s*=/i},{id:"svg-filter-feimage",description:"<feImage href= \u2014 filter primitive that can load external resources",pattern:/<feImage[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=/i},{id:"svg-image-external",description:"<image xlink:href with http/https or javascript protocol",pattern:/<image[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=\s*["']?\s*(?:https?|javascript)\s*:/i},{id:"svg-style-javascript",description:"style= attribute containing javascript: (e.g. background:url(javascript:...))",pattern:/style\s*=[\s\S]{0,60}javascript\s*:/i}],Er=Ni;var Ri=[{id:"sql-block-comment-open",description:"SQL block comment open: /* ... */ \u2014 unusual in legitimate user text",pattern:/\/\*/},{id:"sql-union-select",description:"UNION SELECT \u2014 most common SQL injection aggregation attack",pattern:/\bUNION\s{1,20}(?:ALL\s{1,20})?SELECT\b/i},{id:"sql-drop-table",description:"DROP TABLE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}TABLE\b/i},{id:"sql-drop-database",description:"DROP DATABASE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}DATABASE\b/i},{id:"sql-insert-into",description:"INSERT INTO \u2014 data injection",pattern:/\bINSERT\s{1,20}INTO\b/i},{id:"sql-delete-from",description:"DELETE FROM \u2014 data deletion injection",pattern:/\bDELETE\s{1,20}FROM\b/i},{id:"sql-update-set",description:"UPDATE ... SET \u2014 data modification injection",pattern:/\bUPDATE\b[\s\S]{1,60}\bSET\b/i},{id:"sql-exec-xp",description:"EXEC xp_ \u2014 MSSQL extended stored procedure execution",pattern:/\bEXEC(?:UTE)?\s{1,20}xp_/i},{id:"sql-tautology-string",description:`Classic string tautology: ' OR '1'='1 or " OR "1"="1"`,pattern:/'\s{0,10}OR\s{0,10}'[^']{0,20}'\s*=\s*'[^']{0,20}/i},{id:"sql-tautology-numeric",description:"Numeric tautology: OR 1=1",pattern:/\bOR\s{1,10}1\s*=\s*1\b/i},{id:"sql-always-true-zero",description:"Numeric tautology: OR 0=0",pattern:/\bOR\s{1,10}0\s*=\s*0\b/i},{id:"sql-sleep-benchmark",description:"Time-based blind injection: SLEEP() or BENCHMARK()",pattern:/\b(?:SLEEP|BENCHMARK)\s*\(/i},{id:"sql-waitfor-delay",description:"MSSQL time-based blind injection: WAITFOR DELAY",pattern:/\bWAITFOR\s{1,20}DELAY\b/i},{id:"sql-char-function",description:"CHAR() function \u2014 used to obfuscate injected strings",pattern:/\bCHAR\s*\(\s*\d{1,3}/i},{id:"sql-information-schema",description:"INFORMATION_SCHEMA \u2014 reconnaissance query for table/column enumeration",pattern:/\bINFORMATION_SCHEMA\b/i}],Mn=Ri;var Ii=[{id:"sql-line-comment",description:"SQL line comment: -- followed by whitespace or end of string",pattern:/--(?:\s|$)/},{id:"sql-stacked-query",description:"Stacked queries: semicolon immediately followed by a SQL keyword",pattern:/;\s{0,10}(?:SELECT|INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|EXEC)\b/i},{id:"sql-hex-encoding",description:"Hex-encoded string injection: 0x41414141 style (MySQL)",pattern:/\b0x[0-9a-f]{4,}/i}],_i=[...Mn,...Ii],jr=_i;var Fi=[{id:"shell-path-traversal-unix",description:"Unix path traversal: ../ \u2014 climbing the directory tree",pattern:/\.\.\//},{id:"shell-path-traversal-windows",description:"Windows path traversal: ..\\ \u2014 climbing the directory tree",pattern:/\.\.\\/},{id:"shell-path-traversal-encoded",description:"URL-encoded path traversal: %2e%2e or %2f variants",pattern:/%2e%2e|%2f\.\.|\.\.%2f/i},{id:"shell-null-byte",description:"Null byte injection: \\x00 or %00 \u2014 truncates strings in C-backed functions",pattern:/\x00|%00/},{id:"shell-semicolon",description:"Semicolon command separator: cmd1; cmd2",pattern:/;/},{id:"shell-pipe",description:"Pipe operator: cmd1 | cmd2",pattern:/\|/},{id:"shell-and-operator",description:"AND operator: cmd1 && cmd2",pattern:/&&/},{id:"shell-or-operator",description:"OR operator: cmd1 || cmd2",pattern:/\|\|/},{id:"shell-backtick",description:"Backtick command substitution: `cmd`",pattern:/`/},{id:"shell-dollar-paren",description:"Dollar-paren command substitution: $(cmd)",pattern:/\$\(/},{id:"shell-dollar-brace",description:"Dollar-brace variable expansion: ${var} \u2014 can be abused for injection",pattern:/\$\{/},{id:"shell-redirect-out",description:"Output redirection: cmd > file or cmd >> file",pattern:/>{1,2}/},{id:"shell-redirect-in",description:"Input redirection: cmd < file",pattern:/</},{id:"shell-newline-injection",description:"Newline injection: \\n or \\r \u2014 can inject new shell commands",pattern:/[\n\r]/},{id:"shell-glob-star",description:"Glob expansion: * or ? \u2014 can expand to unintended files",pattern:/[/\\][*?]/},{id:"shell-absolute-root",description:"Absolute root path injection: string starting with / or \\ (Windows UNC)",pattern:/^(?:\/|\\\\)/},{id:"shell-windows-drive",description:"Windows drive letter path injection: C:\\ or D:/",pattern:/^[a-zA-Z]:[/\\]/},{id:"shell-curl-wget",description:"curl/wget with URL or flags \u2014 can exfiltrate data or download payloads",pattern:/\b(?:curl|wget)\s+(?:https?:\/\/|ftp:\/\/|-)/i}],xr=Fi;var Oi=[{id:"redos-nested-quantifier-plus",description:"Nested + quantifier inside a group with outer quantifier: (a+)+, (.+b)*, etc.",pattern:/\([^)]*\+[^)]*\)[+*]/},{id:"redos-nested-quantifier-star",description:"Nested * quantifier: (a*)* or (a*)+ \u2014 catastrophic backtracking",pattern:/\([^)]*\*[^)]*\)[*+]/},{id:"redos-nested-groups",description:"Doubly nested quantified groups: ((a+)+) \u2014 guaranteed catastrophic",pattern:/\(\([^)]{0,40}\)[+*]\)[+*]/},{id:"redos-alternation-overlap",description:"Overlapping alternation under quantifier: (a|a)+ \u2014 ambiguous NFA paths",pattern:/\(([^|()]{1,20})\|(?:\1)(?:\|[^|()]{1,20}){0,5}\)[+*?]{1,2}/},{id:"redos-star-plus-concat",description:"(x*x)+ pattern \u2014 triggers super-linear backtracking",pattern:/\([^)]{0,10}\*[^)]{0,10}\)[+*]/},{id:"redos-dot-star-greedy",description:"(.*){n,} or (.+){n,} \u2014 repeated greedy dot quantifiers",pattern:/\(\.[*+]\)\{?\d/},{id:"redos-large-repetition",description:"Very large fixed or range repetition count {1000,} or {1000,n} \u2014 denial of service via backtracking",pattern:/\{\d{4,}(?:,\d*)?\}/},{id:"redos-catastrophic-alternation",description:"Long alternation with many similar branches \u2014 polynomial backtracking risk",pattern:/\([^)]{0,200}(?:\|[^|)]{0,50}){9,}\)/}],Tr=Oi;var oe=`["'\\s]*:`,Bi=[{id:"nosql-where-operator",description:"$where \u2014 executes arbitrary JavaScript server-side in MongoDB",pattern:new RegExp(`\\$where${oe}`,"i")},{id:"nosql-ne-operator",description:'$ne \u2014 "not equal" operator used to bypass equality checks',pattern:new RegExp(`\\$ne${oe}`,"i")},{id:"nosql-gt-operator",description:'$gt \u2014 "greater than" used to bypass password/value checks',pattern:new RegExp(`\\$gte?${oe}`,"i")},{id:"nosql-lt-operator",description:'$lt / $lte \u2014 "less than" bypass variants',pattern:new RegExp(`\\$lte?${oe}`,"i")},{id:"nosql-regex-operator",description:"$regex \u2014 can be used to extract data character by character (blind injection)",pattern:new RegExp(`\\$regex${oe}`,"i")},{id:"nosql-or-operator",description:"$or \u2014 logical OR; used to create always-true conditions",pattern:new RegExp(`\\$or${oe}\\s*\\[`,"i")},{id:"nosql-and-operator",description:"$and \u2014 logical AND operator injection",pattern:new RegExp(`\\$and${oe}\\s*\\[`,"i")},{id:"nosql-nor-operator",description:"$nor \u2014 logical NOR operator injection",pattern:new RegExp(`\\$nor${oe}\\s*\\[`,"i")},{id:"nosql-exists-operator",description:"$exists \u2014 can enumerate fields to determine schema",pattern:new RegExp(`\\$exists${oe}`,"i")},{id:"nosql-in-operator",description:"$in \u2014 matches any value in a list; can enumerate values",pattern:new RegExp(`\\$in${oe}\\s*\\[`,"i")},{id:"nosql-expr-operator",description:"$expr \u2014 allows aggregation expressions in queries (MongoDB 3.6+)",pattern:new RegExp(`\\$expr${oe}`,"i")},{id:"nosql-function-operator",description:"$function \u2014 executes arbitrary JavaScript in MongoDB 4.4+",pattern:new RegExp(`\\$function${oe}`,"i")},{id:"nosql-accumulator-operator",description:"$accumulator \u2014 custom aggregation with arbitrary JS execution",pattern:new RegExp(`\\$accumulator${oe}`,"i")},{id:"nosql-proto-pollution",description:"__proto__ \u2014 prototype pollution via object key injection",pattern:/__proto__/},{id:"nosql-constructor-prototype",description:"constructor.prototype \u2014 alternative prototype pollution vector (dot notation or JSON key)",pattern:/constructor[\s"':.,{\[]*prototype/i},{id:"nosql-proto-bracket",description:'["__proto__"] \u2014 bracket-notation prototype pollution',pattern:/\[["']__proto__["']\]/}],Cr=Bi;var Di=[{id:"log-crlf-injection",description:"CRLF injection: literal \\r or \\n embeds fake log lines",pattern:/[\r\n]/},{id:"log-url-encoded-crlf",description:"URL-encoded CRLF: %0d, %0a, %0D, %0A \u2014 decoded by some log parsers",pattern:/%0[dDaA]/},{id:"log-unicode-newline",description:"Unicode newline variants: U+2028 (line separator), U+2029 (paragraph separator)",pattern:/[\u2028\u2029]/},{id:"log-log4shell-jndi",description:"Log4Shell: ${jndi:...} triggers remote code execution in Apache Log4j",pattern:/\$\{jndi\s*:/i},{id:"log-log4shell-obfuscated",description:"Obfuscated Log4Shell: ${::-j}... lookup-bypass prefix used to evade WAF detection",pattern:/\$\{::-/},{id:"log-log4j-lookup",description:"Log4j lookup syntax: ${env:...}, ${sys:...}, ${ctx:...} \u2014 data exfiltration",pattern:/\$\{(?:env|sys|ctx|main|map|sd|web|docker|k8s|spring)\s*:/i},{id:"log-ssti-double-brace",description:"SSTI double-brace: {{expression}} \u2014 Jinja2, Twig, Handlebars, etc.",pattern:/\{\{[\s\S]{0,80}\}\}/},{id:"log-ssti-hash-brace",description:"SSTI hash-brace: #{expression} \u2014 Thymeleaf, Velocity, Ruby ERB",pattern:/#\{[\s\S]{0,80}\}/},{id:"log-ssti-dollar-brace",description:"SSTI/EL injection: ${expression with operators or method calls} \u2014 JSP EL, Freemarker, SpEL",pattern:/\$\{[^}]*(?:\.|\(|\*|\+|\bclass\b|\bruntime\b|\bprocess\b|\bexec\b)[^}]{0,80}\}/i},{id:"log-ssti-percent-tag",description:"SSTI ERB/ASP tag: <%= expression %> \u2014 Ruby ERB, ASP",pattern:/<%=[\s\S]{0,80}%>/},{id:"log-null-byte",description:"Null byte: \\x00 or %00 \u2014 can truncate log entries in C-backed loggers",pattern:/\x00|%00/},{id:"log-ansi-escape",description:"ANSI escape sequence: ESC[ \u2014 can manipulate terminal output when logs are tailed",pattern:/\x1b\[/}],Ar=Di;var Pr={HTML:Sr,XML:kr,SVG:Er,SQL:Mn,"SQL-STRICT":jr,SHELL:xr,REDOS:Tr,NOSQL:Cr,LOG:Ar},$n=Pr,Nt=Object.freeze(Object.fromEntries(Object.keys(Pr).map(t=>[t,t])));function Vi(t){if(typeof t!="string")throw new TypeError(`is-unsafe: first argument must be a string, got ${typeof t}`)}function Ui(t){if(!(t instanceof RegExp)){if(typeof t=="string"){if(!$n[t])throw new TypeError(`is-unsafe: unknown context "${t}". Valid contexts: ${Object.keys(Nt).join(", ")}`);return}if(Array.isArray(t)){if(t.length===0)throw new TypeError("is-unsafe: context array must not be empty");for(let e of t)if(typeof e!="string"||!$n[e])throw new TypeError(`is-unsafe: unknown context "${e}" in array. Valid contexts: ${Object.keys(Nt).join(", ")}`);return}throw new TypeError(`is-unsafe: second argument must be a context string, array of context strings, or RegExp. Got: ${typeof t}`)}}function Mr(t,e){let n=$n[e];for(let s of n)if(s.pattern.test(t))return {context:e,id:s.id,description:s.description,pattern:s.pattern};return null}function $r(t,e){if(Vi(t),Ui(e),e instanceof RegExp)return e.test(t);if(typeof e=="string")return Mr(t,e)!==null;for(let n of e)if(Mr(t,n)!==null)return true;return false}function qi(t,e){if(!t)return {};let n=e.attributesGroupName?t[e.attributesGroupName]:t;if(!n)return {};let s={};for(let r in n)if(r.startsWith(e.attributeNamePrefix)){let o=r.substring(e.attributeNamePrefix.length);s[o]=n[r];}else s[r]=n[r];return s}function Gi(t){if(!t||typeof t!="string")return;let e=t.indexOf(":");if(e!==-1&&e>0){let n=t.substring(0,e);if(n!=="xmlns")return n}}var Xt=class{constructor(e,n){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Ki,this.parseTextData=Hi,this.resolveNameSpace=Wi,this.buildAttributesMap=Ji,this.isItStopNode=Zi,this.replaceEntitiesValue=Yi,this.readStopNodeData=na,this.saveTextToParentTag=Xi,this.addChild=Qi,this.ignoreAttributesFn=rs(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0;let s={...Jt};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities=="object"?s=this.options.htmlEntities:this.options.htmlEntities===true&&(s={...Zn,...En}),this.entityDecoder=new Pt({namedEntities:{...s,...n},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo},onInputEntity:(o,a)=>$r(a,[Nt.HTML,Nt.XML])?At.BLOCK:At.ALLOW})),this.matcher=new Lt,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=false,this.stopNodeExpressionsSet=new $t;let r=this.options.stopNodes;if(r&&r.length>0){for(let o=0;o<r.length;o++){let a=r[o];typeof a=="string"?this.stopNodeExpressionsSet.add(new at(a)):a instanceof at&&this.stopNodeExpressionsSet.add(a);}this.stopNodeExpressionsSet.seal();}}};function Hi(t,e,n,s,r,o,a){let i=this.options;if(t!==void 0&&(i.trimValues&&!s&&(t=t.trim()),t.length>0)){a||(t=this.replaceEntitiesValue(t,e,n));let c=i.jPath?n.toString():n,l=i.tagValueProcessor(e,t,c,r,o);return l==null?t:typeof l!=typeof t||l!==t?l:i.trimValues||t.trim()===t?cs(t,i.parseTagValue,i.numberParseOptions):t}}function Wi(t){if(this.options.removeNSPrefix){let e=t.split(":"),n=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return "";e.length===2&&(t=n+e[1]);}return t}var zi=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Ji(t,e,n,s=false){let r=this.options;if(s===true||r.ignoreAttributes!==true&&typeof t=="string"){let o=Sn(t,zi),a=o.length,i={},c=new Array(a),l=false,u={};for(let f=0;f<a;f++){let g=this.resolveNameSpace(o[f][1]),h=o[f][4];if(g.length&&h!==void 0){let y=h;r.trimValues&&(y=y.trim()),y=this.replaceEntitiesValue(y,n,this.readonlyMatcher),c[f]=y,u[g]=y,l=true;}}l&&typeof e=="object"&&e.updateCurrent&&e.updateCurrent(u);let p=r.jPath?e.toString():this.readonlyMatcher,d=false;for(let f=0;f<a;f++){let g=this.resolveNameSpace(o[f][1]);if(this.ignoreAttributesFn(g,p))continue;let h=r.attributeNamePrefix+g;if(g.length)if(r.transformAttributeName&&(h=r.transformAttributeName(h)),h=Lr(h,r),o[f][4]!==void 0){let y=c[f],j=r.attributeValueProcessor(g,y,p);j==null?i[h]=y:typeof j!=typeof y||j!==y?i[h]=j:i[h]=cs(y,r.parseAttributeValue,r.numberParseOptions),d=true;}else r.allowBooleanAttributes&&(i[h]=true,d=true);}if(!d)return;if(r.attributesGroupName&&!r.preserveOrder){let f={};return f[r.attributesGroupName]=i,f}return i}}var Ki=function(t){t=t.replace(/\r\n?/g,`
|
|
4
|
+
`);let e=new Z("!xml"),n=e,s="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let r=this.options,o=new Yt(r.processEntities),a=t.length;for(let i=0;i<a;i++)if(t[i]==="<"){let l=t.charCodeAt(i+1);if(l===47){let u=Rt(t,">",i,"Closing Tag is not closed."),p=t.substring(i+2,u).trim();if(r.removeNSPrefix){let f=p.indexOf(":");f!==-1&&(p=p.substr(f+1));}p=is(r.transformTagName,p,"",r).tagName,n&&(s=this.saveTextToParentTag(s,n,this.readonlyMatcher));let d=this.matcher.getCurrentTag();if(p&&r.unpairedTagsSet.has(p))throw new Error(`Unpaired tag can not be used as closing tag: </${p}>`);d&&r.unpairedTagsSet.has(d)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=false,n=this.tagsNodeStack.pop(),s="",i=u;}else if(l===63){let u=as(t,i,false,"?>");if(!u)throw new Error("Pi Tag is not closed.");s=this.saveTextToParentTag(s,n,this.readonlyMatcher);let p=this.buildAttributesMap(u.tagExp,this.matcher,u.tagName,true);if(p){let d=p[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(d)||1),o.setXmlVersion(Number(d)||1);}if(!(r.ignoreDeclaration&&u.tagName==="?xml"||r.ignorePiTags)){let d=new Z(u.tagName);d.add(r.textNodeName,""),u.tagName!==u.tagExp&&u.attrExpPresent&&r.ignoreAttributes!==true&&(d[":@"]=p),this.addChild(n,d,this.readonlyMatcher,i);}i=u.closeIndex+1;}else if(l===33&&t.charCodeAt(i+2)===45&&t.charCodeAt(i+3)===45){let u=Rt(t,"-->",i+4,"Comment is not closed.");if(r.commentPropName){let p=t.substring(i+4,u-2);s=this.saveTextToParentTag(s,n,this.readonlyMatcher),n.add(r.commentPropName,[{[r.textNodeName]:p}]);}i=u;}else if(l===33&&t.charCodeAt(i+2)===68){let u=o.readDocType(t,i);this.entityDecoder.addInputEntities(u.entities),i=u.i;}else if(l===33&&t.charCodeAt(i+2)===91){let u=Rt(t,"]]>",i,"CDATA is not closed.")-2,p=t.substring(i+9,u);s=this.saveTextToParentTag(s,n,this.readonlyMatcher);let d=this.parseTextData(p,n.tagname,this.readonlyMatcher,true,false,true,true);d==null&&(d=""),r.cdataPropName?n.add(r.cdataPropName,[{[r.textNodeName]:p}]):n.add(r.textNodeName,d),i=u+2;}else {let u=as(t,i,r.removeNSPrefix);if(!u){let b=t.substring(Math.max(0,i-50),Math.min(a,i+50));throw new Error(`readTagExp returned undefined at position ${i}. Context: "${b}"`)}let p=u.tagName,d=u.rawTagName,f=u.tagExp,g=u.attrExpPresent,h=u.closeIndex;if({tagName:p,tagExp:f}=is(r.transformTagName,p,f,r),r.strictReservedNames&&(p===r.commentPropName||p===r.cdataPropName||p===r.textNodeName||p===r.attributesGroupName))throw new Error(`Invalid tag name: ${p}`);n&&s&&n.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,n,this.readonlyMatcher,false));let y=n;y&&r.unpairedTagsSet.has(y.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let j=false;f.length>0&&f.lastIndexOf("/")===f.length-1&&(j=true,p[p.length-1]==="/"?(p=p.substr(0,p.length-1),f=p):f=f.substr(0,f.length-1),g=p!==f);let C=null,T;T=Gi(d),p!==e.tagname&&this.matcher.push(p,{},T),p!==f&&g&&(C=this.buildAttributesMap(f,this.matcher,p),C&&(qi(C,r))),p!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let v=i;if(this.isCurrentNodeStopNode){let b="";if(j)i=u.closeIndex;else if(r.unpairedTagsSet.has(p))i=u.closeIndex;else {let w=this.readStopNodeData(t,d,h+1);if(!w)throw new Error(`Unexpected end of ${d}`);i=w.i,b=w.tagContent;}let S=new Z(p);C&&(S[":@"]=C),S.add(r.textNodeName,b),this.matcher.pop(),this.isCurrentNodeStopNode=false,this.addChild(n,S,this.readonlyMatcher,v);}else {if(j){({tagName:p,tagExp:f}=is(r.transformTagName,p,f,r));let b=new Z(p);C&&(b[":@"]=C),this.addChild(n,b,this.readonlyMatcher,v),this.matcher.pop(),this.isCurrentNodeStopNode=false;}else if(r.unpairedTagsSet.has(p)){let b=new Z(p);C&&(b[":@"]=C),this.addChild(n,b,this.readonlyMatcher,v),this.matcher.pop(),this.isCurrentNodeStopNode=false,i=u.closeIndex;continue}else {let b=new Z(p);if(this.tagsNodeStack.length>r.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),C&&(b[":@"]=C),this.addChild(n,b,this.readonlyMatcher,v),n=b;}s="",i=h;}}}else s+=t[i];return e.child};function Qi(t,e,n,s){this.options.captureMetaData||(s=void 0);let r=this.options.jPath?n.toString():n,o=this.options.updateTag(e.tagname,r,e[":@"]);o===false||(typeof o=="string"&&(e.tagname=o),t.addChild(e,s));}function Yi(t,e,n){let s=this.options.processEntities;if(!s||!s.enabled)return t;if(s.allowedTags){let r=this.options.jPath?n.toString():n;if(!(Array.isArray(s.allowedTags)?s.allowedTags.includes(e):s.allowedTags(e,r)))return t}if(s.tagFilter){let r=this.options.jPath?n.toString():n;if(!s.tagFilter(e,r))return t}return this.entityDecoder.decode(t)}function Xi(t,e,n,s){return t&&(s===void 0&&(s=e.child.length===0),t=this.parseTextData(t,e.tagname,n,false,e[":@"]?Object.keys(e[":@"]).length!==0:false,s),t!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}function Zi(){return this.stopNodeExpressionsSet.size===0?false:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function ea(t,e,n=">"){let s=0,r=t.length,o=n.charCodeAt(0),a=n.length>1?n.charCodeAt(1):-1,i="",c=e;for(let l=e;l<r;l++){let u=t.charCodeAt(l);if(s)u===s&&(s=0);else if(u===34||u===39)s=u;else if(u===o)if(a!==-1){if(t.charCodeAt(l+1)===a)return i+=t.substring(c,l),{data:i,index:l}}else return i+=t.substring(c,l),{data:i,index:l};else u===9&&!s&&(i+=t.substring(c,l)+" ",c=l+1);}}function Rt(t,e,n,s){let r=t.indexOf(e,n);if(r===-1)throw new Error(s);return r+e.length-1}function ta(t,e,n,s){let r=t.indexOf(e,n);if(r===-1)throw new Error(s);return r}function as(t,e,n,s=">"){let r=ea(t,e+1,s);if(!r)return;let o=r.data,a=r.index,i=o.search(/\s/),c=o,l=true;i!==-1&&(c=o.substring(0,i),o=o.substring(i+1).trimStart());let u=c;if(n){let p=c.indexOf(":");p!==-1&&(c=c.substr(p+1),l=c!==r.data.substr(p+1));}return {tagName:c,tagExp:o,closeIndex:a,attrExpPresent:l,rawTagName:u}}function na(t,e,n){let s=n,r=1,o=t.length;for(;n<o;n++)if(t[n]==="<"){let a=t.charCodeAt(n+1);if(a===47){let i=ta(t,">",n,`${e} is not closed`);if(t.substring(n+2,i).trim()===e&&(r--,r===0))return {tagContent:t.substring(s,n),i};n=i;}else if(a===63)n=Rt(t,"?>",n+1,"StopNode is not closed.");else if(a===33&&t.charCodeAt(n+2)===45&&t.charCodeAt(n+3)===45)n=Rt(t,"-->",n+3,"StopNode is not closed.");else if(a===33&&t.charCodeAt(n+2)===91)n=Rt(t,"]]>",n,"StopNode is not closed.")-2;else {let i=as(t,n,false);i&&((i&&i.tagName)===e&&i.tagExp[i.tagExp.length-1]!=="/"&&r++,n=i.closeIndex);}}}function cs(t,e,n){if(e&&typeof t=="string"){let s=t.trim();return s==="true"?true:s==="false"?false:ss(t,n)}else return Gs(t)?t:""}function is(t,e,n,s){if(t){let r=t(e);n===e&&(n=r),e=r;}return e=Lr(e,s),{tagName:e,tagExp:n}}function Lr(t,e){if(kn.includes(t))throw new Error(`[SECURITY] Invalid name: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);return Wt.includes(t)?e.onDangerousProperty(t):t}var ls=Z.getMetaDataSymbol();function sa(t,e){if(!t||typeof t!="object")return {};if(!e)return t;let n={};for(let s in t)if(s.startsWith(e)){let r=s.substring(e.length);n[r]=t[s];}else n[s]=t[s];return n}function us(t,e,n,s){return Nr(t,e,n,s)}function Nr(t,e,n,s){let r,o={};for(let a=0;a<t.length;a++){let i=t[a],c=ra(i);if(c!==void 0&&c!==e.textNodeName){let l=sa(i[":@"]||{},e.attributeNamePrefix);n.push(c,l);}if(c===e.textNodeName)r===void 0?r=i[c]:r+=""+i[c];else {if(c===void 0)continue;if(i[c]){let l=Nr(i[c],e,n,s),u=ia(l,e);if(Object.keys(l).length===0&&e.alwaysCreateTextNode&&(l[e.textNodeName]=""),i[":@"]?oa(l,i[":@"],s,e):Object.keys(l).length===1&&l[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?l=l[e.textNodeName]:Object.keys(l).length===0&&(e.alwaysCreateTextNode?l[e.textNodeName]="":l=""),i[ls]!==void 0&&typeof l=="object"&&l!==null&&(l[ls]=i[ls]),o[c]!==void 0&&Object.prototype.hasOwnProperty.call(o,c))Array.isArray(o[c])||(o[c]=[o[c]]),o[c].push(l);else {let p=e.jPath?s.toString():s;e.isArray(c,p,u)?o[c]=[l]:o[c]=l;}c!==void 0&&c!==e.textNodeName&&n.pop();}}}return typeof r=="string"?r.length>0&&(o[e.textNodeName]=r):r!==void 0&&(o[e.textNodeName]=r),o}function ra(t){let e=Object.keys(t);for(let n=0;n<e.length;n++){let s=e[n];if(s!==":@")return s}}function oa(t,e,n,s){if(e){let r=Object.keys(e),o=r.length;for(let a=0;a<o;a++){let i=r[a],c=i.startsWith(s.attributeNamePrefix)?i.substring(s.attributeNamePrefix.length):i,l=s.jPath?n.toString()+"."+c:n;s.isArray(i,l,true,true)?t[i]=[e[i]]:t[i]=e[i];}}}function ia(t,e){let{textNodeName:n}=e,s=Object.keys(t).length;return !!(s===0||s===1&&(t[n]||typeof t[n]=="boolean"||t[n]===0))}var Qe=class{constructor(e){this.externalEntities={},this.options=pr(e);}parse(e,n){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===true&&(n={});let o=Ks(e,n);if(o!==true)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}let s=new Xt(this.options,this.externalEntities),r=s.parseXml(e);return this.options.preserveOrder||r===void 0?r:us(r,this.options,s.matcher,s.readonlyMatcher)}addEntity(e,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=n;}static getMetaDataSymbol(){return Z.getMetaDataSymbol()}};var mt=b(a(),1),gt=b(a(),1);var yt=b(a(),1),xe=b(a(),1),Te=b(a(),1),Ce=b(a(),1),Ae=b(a(),1),Pe=b(a(),1),Dn=b(a(),1),me=b(a(),1),Vn=b(a(),1),bt=b(a(),1),ge=b(a(),1),Dt=b(a(),1),Y=b(a(),1),Me=b(a(),1),an=b(a(),1),cn=b(a(),1),ln=b(a(),1),te=b(a(),1),pe=b(a(),1),de=b(a(),1),fe=b(a(),1),he=b(a(),1),Mo=b(a(),1);var aa=["vibgrate.config.ts","vibgrate.config.js","vibgrate.config.json"],ca="VIBGRATE_TRUST_CONFIG";function la(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function en(t,e){if(F.isParenthesizedExpression(t))return en(t.expression,e);if(F.isStringLiteralLike(t))return t.text;if(F.isNumericLiteral(t))return Number(t.text);if(t.kind===F.SyntaxKind.TrueKeyword)return true;if(t.kind===F.SyntaxKind.FalseKeyword)return false;if(t.kind===F.SyntaxKind.NullKeyword)return null;if(F.isArrayLiteralExpression(t))return t.elements.map(n=>{if(F.isSpreadElement(n))throw new Error("Spread not supported in static config arrays");return en(n,e)});if(F.isObjectLiteralExpression(t)){let n={};for(let s of t.properties){if(!F.isPropertyAssignment(s)||s.initializer===void 0)throw new Error("Only plain object properties are supported in static config");if(F.isComputedPropertyName(s.name))throw new Error("Computed property names are not supported in static config");let r=F.isIdentifier(s.name)||F.isStringLiteral(s.name)||F.isNumericLiteral(s.name)?s.name.text:null;if(r===null)throw new Error("Unsupported object key in static config");n[r]=en(s.initializer,e);}return n}if(F.isIdentifier(t)){let n=e.get(t.text);if(!n)throw new Error(`Unknown identifier in static config: ${t.text}`);return en(n,e)}throw new Error("Non-static expression in config")}function ua(t,e){let n=e.endsWith(".ts")?F.ScriptKind.TS:F.ScriptKind.JS,s=F.createSourceFile(e,t,F.ScriptTarget.ESNext,true,n),r=new Map;for(let o of s.statements)if(F.isVariableStatement(o)&&o.declarationList.flags&F.NodeFlags.Const)for(let a of o.declarationList.declarations)F.isIdentifier(a.name)&&a.initializer&&r.set(a.name.text,a.initializer);for(let o of s.statements){if(!F.isExportAssignment(o))continue;let a=en(o.expression,r);return la(a)?{..._n,...a}:null}return null}var pa=5242880,da=180,_n={exclude:[],maxFileSizeToScan:pa,projectScanTimeout:da,thresholds:{failOnError:{eolDays:180,frameworkMajorLag:3,dependencyTwoPlusPercent:50},warn:{frameworkMajorLag:2,dependencyTwoPlusPercent:30}}};async function fa(t){let e=_n;for(let s of aa){let r=_.join(t,s);if(await p(r)){if(s.endsWith(".json")){let i=await o(r);e={..._n,...JSON.parse(i)};break}let o$1=await o(r),a=null;try{a=ua(o$1,r);}catch{a=null;}if(a){e=a;break}if(process.env[ca]==="1")try{let i=await import(r);e={..._n,...i.default??i};break}catch{}}}let n=_.join(t,".vibgrate","auto-excludes.json");if(await p(n))try{let s=await o(n),r=JSON.parse(s);if(Array.isArray(r)&&r.length>0){let o=e.exclude??[];e={...e,exclude:[...new Set([...o,...r])]};}}catch{}return e}async function Zd(t){let e=_.join(t,"vibgrate.config.ts");return await ye.writeFile(e,`import type { VibgrateConfig } from '@vibgrate/cli';
|
|
5
|
+
|
|
6
|
+
const config: VibgrateConfig = {
|
|
7
|
+
// exclude: ['legacy/**'],
|
|
8
|
+
// maxFileSizeToScan: 5_242_880, // 5 MB (default)
|
|
9
|
+
// projectScanTimeout: 180, // 3 min per project (default, in seconds)
|
|
10
|
+
thresholds: {
|
|
11
|
+
failOnError: {
|
|
12
|
+
eolDays: 180,
|
|
13
|
+
frameworkMajorLag: 3,
|
|
14
|
+
dependencyTwoPlusPercent: 50,
|
|
15
|
+
},
|
|
16
|
+
warn: {
|
|
17
|
+
frameworkMajorLag: 2,
|
|
18
|
+
dependencyTwoPlusPercent: 30,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default config;
|
|
24
|
+
`,"utf8"),e}async function ha(t,e){if(e.length===0)return false;let n=_.join(t,"vibgrate.config.json");if(await p(n))try{let i=await o(n),c=JSON.parse(i),l=Array.isArray(c.exclude)?c.exclude:[],u=[...new Set([...l,...e])];return c.exclude=u,await ye.writeFile(n,JSON.stringify(c,null,2)+`
|
|
25
|
+
`,"utf8"),!0}catch{}let s=_.join(t,".vibgrate"),r=_.join(s,"auto-excludes.json"),o$1=[];if(await p(r))try{let i=await o(r),c=JSON.parse(i);Array.isArray(c)&&(o$1=c);}catch{}let a=[...new Set([...o$1,...e])];try{return await ye.mkdir(s,{recursive:!0}),await ye.writeFile(r,JSON.stringify(a,null,2)+`
|
|
26
|
+
`,"utf8"),!0}catch{return false}}var ma=864e5,ga=365.25;function ya(t,e,n){if(!t||!e||!n)return null;let s=n[t],r=n[e];if(!s||!r)return null;let o=Date.parse(s),a=Date.parse(r);if(Number.isNaN(o)||Number.isNaN(a))return null;let i=(a-o)/ma;return i>0?i:0}function ba(t){return t===null?null:t/ga}function va(t){let e=0,n=0,s=0;for(let r of t)r==null||Number.isNaN(r)||(e+=r,r>n&&(n=r),s++);return s===0?null:{total:e,max:n,measured:s}}function wa(t){if(!t||t.measured===0)return null;let e=t.total/t.measured,n=Math.min(e*20,100),s=Math.min(t.max*10,100),r=100-(n*.7+s*.3);return Math.max(0,Math.min(100,Math.round(r)))}var Rr="driftscore-2.0",Ir={failOnError:{eolDays:180,frameworkMajorLag:3,dependencyTwoPlusPercent:50},warn:{frameworkMajorLag:2,dependencyTwoPlusPercent:30}};function so(t,e,n){return Math.min(n,Math.max(e,t))}function Sa(t){if(t.length===0)return null;let e=t.map(s=>s.runtimeMajorsBehind).filter(s=>s!==void 0);if(e.length===0)return null;let n=Math.max(...e);return n===0?100:n===1?80:n===2?50:n===3?20:0}function ka(t){let e=t.flatMap(i=>i.frameworks);if(e.length===0)return null;let n=e.map(i=>i.majorsBehind).filter(i=>i!==null);if(n.length===0)return null;let s=Math.max(...n),r=n.reduce((i,c)=>i+c,0)/n.length,o=Math.min(s*20,100),a=Math.min(r*15,100);return so(100-(o*.6+a*.4),0,100)}function Ea(t){let e=0,n=0,s=0,r=0;for(let l of t)e+=l.dependencyAgeBuckets.current,n+=l.dependencyAgeBuckets.oneBehind,s+=l.dependencyAgeBuckets.twoPlusBehind,r+=l.dependencyAgeBuckets.unknown;let o=e+n+s;if(o===0)return null;let a=e/o,i=n/o,c=s/o;return so(Math.round(a*100-i*10-c*40),0,100)}var _r=1e3*60*60*24*30;function ja(t){if(!t.some(r=>r.runtimeMajorsBehind!==void 0||r.runtimeEol!==void 0&&r.runtimeEol!==null))return null;let n=100,s=Date.now();for(let r of t){if(r.runtimeEol===true){n=Math.min(n,0);continue}if(r.runtimeEol===false){if(r.runtimeEolDate){let o=Date.parse(r.runtimeEolDate)-s;Number.isNaN(o)||(o<=6*_r?n=Math.min(n,40):o<=12*_r&&(n=Math.min(n,75)));}continue}r.type==="node"&&r.runtimeMajorsBehind!==void 0&&(r.runtimeMajorsBehind>=3?n=Math.min(n,0):r.runtimeMajorsBehind>=2?n=Math.min(n,30):r.runtimeMajorsBehind>=1&&(n=Math.min(n,70))),r.type==="dotnet"&&r.runtimeMajorsBehind!==void 0&&(r.runtimeMajorsBehind>=3?n=Math.min(n,0):r.runtimeMajorsBehind>=2?n=Math.min(n,20):r.runtimeMajorsBehind>=1&&(n=Math.min(n,60))),r.type==="python"&&r.runtimeMajorsBehind!==void 0&&(r.runtimeMajorsBehind>=6?n=Math.min(n,0):r.runtimeMajorsBehind>=4?n=Math.min(n,20):r.runtimeMajorsBehind>=2&&(n=Math.min(n,60))),r.type==="java"&&r.runtimeMajorsBehind!==void 0&&(r.runtimeMajorsBehind>=10?n=Math.min(n,0):r.runtimeMajorsBehind>=4?n=Math.min(n,30):r.runtimeMajorsBehind>=1&&(n=Math.min(n,70)));}return n}function xa(t){let e=t.map(o=>o.libyears).filter(o=>!!o);if(e.length===0)return null;let n=e.reduce((o,a)=>o+a.total,0),s=e.reduce((o,a)=>o+a.measured,0),r=e.reduce((o,a)=>Math.max(o,a.max),0);return s===0?null:wa({total:n,max:r,measured:s})}function Ta(t){let e=0,n=0;for(let r of t)e+=r.dependencyAgeBuckets.current+r.dependencyAgeBuckets.oneBehind+r.dependencyAgeBuckets.twoPlusBehind,n+=r.dependencyAgeBuckets.unknown;let s=e+n;return s===0?null:Math.round(e/s*100)/100}function ps(t){let e=Sa(t),n=ka(t),s=Ea(t),r=ja(t),o=xa(t),a=[{score:e,weight:.25},{score:n,weight:.25},{score:s,weight:.3},{score:r,weight:.2},{score:o,weight:.15}],i=Ta(t)??void 0,c=y=>100-y,l=()=>{let y={runtimeScore:c(Math.round(e??100)),frameworkScore:c(Math.round(n??100)),dependencyScore:c(Math.round(s??100)),eolScore:c(Math.round(r??100))};return o!==null&&(y.freshnessScore=c(Math.round(o))),y},u=a.filter(y=>y.score!==null);if(u.length===0)return {score:0,riskLevel:"low",components:l(),methodologyVersion:Rr,...i!==void 0?{confidence:i}:{}};let p=u.reduce((y,j)=>y+j.weight,0),d=0;for(let y of u)d+=y.score*(y.weight/p);let f=c(Math.round(d)),g;f<=30?g="low":f<=60?g="moderate":g="high";let h=[];return e!==null&&h.push("runtime"),n!==null&&h.push("framework"),s!==null&&h.push("dependency"),r!==null&&h.push("eol"),o!==null&&h.push("freshness"),{score:f,riskLevel:g,components:l(),measured:h,methodologyVersion:Rr,...i!==void 0?{confidence:i}:{}}}function Ca(t,e){let n={failOnError:{...Ir.failOnError,...e?.thresholds?.failOnError},warn:{...Ir.warn,...e?.thresholds?.warn}},s=[];for(let r of t){let o=r.type==="node"?"Node.js":r.type==="dotnet"?".NET":r.type==="python"?"Python":r.type==="java"?"Java":r.type;if(r.runtimeEol===true){let i=r.runtimeEolDate?` on ${r.runtimeEolDate}`:"";s.push({ruleId:"vibgrate/runtime-eol",level:"error",message:`${o} runtime "${r.runtime}" reached end-of-life${i} (latest: ${r.runtimeLatest}).`,location:r.path});}else r.runtimeMajorsBehind!==void 0&&r.runtimeMajorsBehind>=3?s.push({ruleId:"vibgrate/runtime-eol",level:"error",message:`${o} runtime "${r.runtime}" is ${r.runtimeMajorsBehind} major versions behind (latest: ${r.runtimeLatest}). Likely at or past EOL.`,location:r.path}):r.runtimeMajorsBehind!==void 0&&r.runtimeMajorsBehind>=2&&s.push({ruleId:"vibgrate/runtime-lag",level:"warning",message:`${o} runtime "${r.runtime}" is ${r.runtimeMajorsBehind} major versions behind (latest: ${r.runtimeLatest}).`,location:r.path});for(let i of r.frameworks)i.majorsBehind!==null&&n.failOnError.frameworkMajorLag!==void 0&&i.majorsBehind>=n.failOnError.frameworkMajorLag?s.push({ruleId:"vibgrate/framework-major-lag",level:"error",message:`${i.name} is ${i.majorsBehind} major versions behind (current: ${i.currentVersion}, latest: ${i.latestVersion}).`,location:r.path}):i.majorsBehind!==null&&n.warn.frameworkMajorLag!==void 0&&i.majorsBehind>=n.warn.frameworkMajorLag&&s.push({ruleId:"vibgrate/framework-major-lag",level:"warning",message:`${i.name} is ${i.majorsBehind} major versions behind (current: ${i.currentVersion}, latest: ${i.latestVersion}).`,location:r.path});let a=r.dependencyAgeBuckets.current+r.dependencyAgeBuckets.oneBehind+r.dependencyAgeBuckets.twoPlusBehind;if(a>0){let i=r.dependencyAgeBuckets.twoPlusBehind/a*100;n.failOnError.dependencyTwoPlusPercent!==void 0&&i>=n.failOnError.dependencyTwoPlusPercent?s.push({ruleId:"vibgrate/dependency-rot",level:"error",message:`${Math.round(i)}% of dependencies are 2+ major versions behind in ${r.name}.`,location:r.path}):n.warn.dependencyTwoPlusPercent!==void 0&&i>=n.warn.dependencyTwoPlusPercent&&s.push({ruleId:"vibgrate/dependency-rot",level:"warning",message:`${Math.round(i)}% of dependencies are 2+ major versions behind in ${r.name}.`,location:r.path});}for(let i of r.dependencies)i.majorsBehind!==null&&i.majorsBehind>=3&&s.push({ruleId:"vibgrate/dependency-major-lag",level:"error",message:`${i.package} is ${i.majorsBehind} major versions behind (spec: ${i.currentSpec}, latest: ${i.latestStable}).`,location:r.path});}return s}function Aa(t,e,n){let s=n?`${t}:${e}:${n}`:`${t}:${e}`;return Ss.createHash("sha256").update(s).digest("hex").slice(0,16)}function Pa(t,e,n){let s=n?`${t}:${e}:${n}`:`${t}:${e}`;return Ss.createHash("sha256").update(s).digest("hex").slice(0,16)}var Ma=20,$a=50,Fr={red:"#E5484D",amber:"#F5A524",green:"#30A46C",unknown:"#6B7280"},ef="#24292F";function tf(t){if(t==null||!Number.isFinite(t))return "unknown";let e=Math.round(t);return e<=Ma?"green":e<=$a?"amber":"red"}function nf(t){if(t==null||!Number.isFinite(t))return "unknown";let e=Math.round(Math.min(100,Math.max(0,t)));return e===100?"100":String(e).padStart(2,"0")}function sf(t){return Fr[t]??Fr.unknown}function La(t){let e=[];e.push(""),e.push(E.bold.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),e.push(E.bold.cyan("\u2551 Vibgrate Drift Report \u2551")),e.push(E.bold.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),e.push("");for(let i of t.projects){if(e.push(E.bold(` \u2500\u2500 ${i.name} `)+E.dim(`(${i.type}) ${i.path}`)),i.runtime){let u=i.runtimeMajorsBehind!==void 0&&i.runtimeMajorsBehind>0?E.yellow(` (${i.runtimeMajorsBehind} major${i.runtimeMajorsBehind>1?"s":""} behind)`):E.green(" (current)");e.push(` Runtime: ${i.runtime}${u}`);}if(i.targetFramework&&e.push(` Target: ${i.targetFramework}`),i.frameworks.length>0){e.push(" Frameworks:");for(let u of i.frameworks){let p=u.majorsBehind!==null?u.majorsBehind===0?E.green("current"):E.yellow(`${u.majorsBehind} behind`):E.dim("unknown");e.push(` ${u.name}: ${u.currentVersion??"?"} \u2192 ${u.latestVersion??"?"} (${p})`);}}let c=i.dependencyAgeBuckets;c.current+c.oneBehind+c.twoPlusBehind+c.unknown>0&&(e.push(" Dependencies:"),e.push(` ${E.green(`${c.current} current`)} ${E.yellow(`${c.oneBehind} 1-behind`)} ${E.red(`${c.twoPlusBehind} 2+ behind`)} ${E.dim(`${c.unknown} unknown`)}`)),e.push("");}if(t.delta!==void 0){let i=t.delta<0?E.green(`${t.delta}`):t.delta>0?E.red(`+${t.delta}`):E.dim("0");e.push(E.bold(" Drift Delta: ")+i+" (vs baseline)"),e.push("");}if(t.extended&&e.push(...Ra(t.extended)),t.findings.length>0){let i=t.findings.filter(p=>p.level==="error"),c=t.findings.filter(p=>p.level==="warning"),l=t.findings.filter(p=>p.level==="note"),u=[i.length>0?E.red(`${i.length} error${i.length!==1?"s":""}`):"",c.length>0?E.yellow(`${c.length} warning${c.length!==1?"s":""}`):"",l.length>0?E.blue(`${l.length} note${l.length!==1?"s":""}`):""].filter(Boolean).join(E.dim(", "));e.push(E.bold.underline(" Findings")+E.dim(` (${u})`));for(let p of t.findings){let d=p.level==="error"?E.red("\u2716"):p.level==="warning"?E.yellow("\u26A0"):E.blue("\u2139");e.push(` ${d} ${p.message}`),e.push(E.dim(` ${p.ruleId} in ${p.location}`));}e.push("");}let n=_a(t);if(n.length>0){e.push(E.bold.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),e.push(E.bold.cyan("\u2551 Top Priority Actions \u2551")),e.push(E.bold.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),e.push("");for(let i=0;i<n.length;i++){let c=n[i],l=E.bold.cyan(` ${i+1}.`);e.push(`${l} ${E.bold(c.title)}`),e.push(E.dim(` ${c.explanation}`)),c.impact&&e.push(` Impact: ${E.green(c.impact)}`),e.push("");}}if(t.extended?.architecture&&e.push(...Ia(t.extended.architecture)),t.solutions&&t.solutions.length>0){e.push(E.bold.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),e.push(E.bold.cyan("\u2551 Solution Drift Summary \u2551")),e.push(E.bold.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),e.push("");for(let i of t.solutions){let c=i.drift?.score,l=typeof c=="number"?c<=30?E.green:c<=60?E.yellow:E.red:E.dim;e.push(` \u2022 ${i.name} (${i.projectPaths.length} projects) \u2014 ${typeof c=="number"?l(`${c}/100`):E.dim("n/a")}`);}e.push("");}let s=t.drift.score<=30?E.green:t.drift.score<=60?E.yellow:E.red;e.push(E.bold.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),e.push(E.bold.cyan("\u2551 Drift Score Summary \u2551")),e.push(E.bold.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),e.push(""),e.push(E.bold(" Drift Score: ")+s.bold(`${t.drift.score}/100`)),e.push(E.bold(" Risk Level: ")+Na(t.drift.riskLevel)),e.push(E.bold(" Projects: ")+`${t.projects.length}`);let r=t.billing;if(r&&(e.push(E.bold(" Classified: ")+`${E.cyan(r.microCount)} micro \xB7 ${E.cyan(r.smallCount)} small \xB7 ${E.cyan(r.standardCount)} standard`),e.push(E.bold(" Billable: ")+E.bold.white(`${r.billableProjects}`)+E.dim(` \xB7 ${r.totalScanned} detected \u2192 ${r.billableProjects} billable (micro-project pricing)`))),t.vcs){let i=[t.vcs.type];t.vcs.branch&&i.push(t.vcs.branch),t.vcs.shortSha&&i.push(E.dim(t.vcs.shortSha)),e.push(E.bold(" VCS: ")+i.join(" "));}e.push("");let o=new Set(t.drift.measured??["runtime","framework","dependency","eol"]);e.push(" "+E.bold.underline("Score Breakdown")),e.push(` Runtime: ${o.has("runtime")?tn(t.drift.components.runtimeScore):E.dim("n/a")}`),e.push(` Frameworks: ${o.has("framework")?tn(t.drift.components.frameworkScore):E.dim("n/a")}`),e.push(` Dependencies: ${o.has("dependency")?tn(t.drift.components.dependencyScore):E.dim("n/a")}`),e.push(` EOL Risk: ${o.has("eol")?tn(t.drift.components.eolScore):E.dim("n/a")}`),e.push("");let a=[`Scanned at ${t.timestamp}`];if(t.durationMs!==void 0){let i=(t.durationMs/1e3).toFixed(1);a.push(`${i}s`);}return t.filesScanned!==void 0&&a.push(`${t.filesScanned} file${t.filesScanned!==1?"s":""} scanned`),t.treeSummary&&(a.push(`${t.treeSummary.totalFiles.toLocaleString()} workspace files`),a.push(`${t.treeSummary.totalDirs.toLocaleString()} dirs`)),e.push(E.dim(` ${a.join(" \xB7 ")}`)),e.push(""),e.join(`
|
|
27
|
+
`)}function Na(t){switch(t){case "low":return E.bgGreen.black(" LOW ");case "moderate":return E.bgYellow.black(" MODERATE ");case "high":return E.bgRed.white(" HIGH ");default:return t}}function tn(t){let n=Math.round(t/100*20),s=20-n;return (t<=30?E.green:t<=60?E.yellow:E.red)("\u2588".repeat(n))+E.dim("\u2591".repeat(s))+` ${Math.round(t)}`}var Or={frontend:"Frontend",metaFrameworks:"Meta-frameworks",bundlers:"Bundlers",css:"CSS / UI",backend:"Backend",orm:"ORM / Database",testing:"Testing",lintFormat:"Lint & Format",apiMessaging:"API & Messaging",observability:"Observability",payment:"Payment",auth:"Auth",email:"Email",cloud:"Cloud",databases:"Databases",messaging:"Messaging",crm:"CRM & Comms",storage:"Storage",search:"Search & AI"};function Ra(t){let e=[];if(t.toolingInventory){let n=t.toolingInventory,s=Object.entries(n).filter(([,r])=>r.length>0);if(s.length>0){e.push(E.bold.underline(" Tech Stack"));for(let[r,o]of s){let a=Or[r]??r,i=o.map(c=>E.white(c.name)).join(E.dim(", "));e.push(` ${E.cyan(a)}: ${i}`);}e.push("");}}if(t.serviceDependencies){let n=t.serviceDependencies,s=Object.entries(n).filter(([,r])=>r.length>0);if(s.length>0){e.push(E.bold.underline(" Services & Integrations"));for(let[r,o]of s){let a=Or[r]??r,i=o.map(c=>{let l=c.version?E.dim(` ${c.version}`):"";return E.white(c.name)+l}).join(E.dim(", "));e.push(` ${E.cyan(a)}: ${i}`);}e.push("");}}if(t.breakingChangeExposure){let n=t.breakingChangeExposure;if(n.deprecatedPackages.length>0||n.legacyPolyfills.length>0){e.push(E.bold.underline(" Breaking Change Exposure"));let s=n.exposureScore>=40?E.red:n.exposureScore>=20?E.yellow:E.green;e.push(` Exposure Score: ${s.bold(`${n.exposureScore}/100`)}`),n.deprecatedPackages.length>0&&e.push(` ${E.red("Deprecated")}: ${n.deprecatedPackages.map(o=>E.dim(o)).join(", ")}`),n.legacyPolyfills.length>0&&e.push(` ${E.yellow("Polyfills")}: ${n.legacyPolyfills.map(o=>E.dim(o)).join(", ")}`),n.peerConflictsDetected&&e.push(` ${E.red("\u26A0")} Peer dependency conflicts detected`),e.push(` Recommendation: ${E.bold(n.overallRecommendation)}`);let r=n.projectIntelligence.filter(o=>o.packages.length>0).slice(0,3);if(r.length>0){e.push(" Major Upgrade Intelligence:");for(let o of r){e.push(` - ${o.project} (${o.recommendation})`);for(let a of o.packages.slice(0,2))e.push(` \xB7 ${a.package} ${a.currentVersion??"?"} \u2192 ${a.targetVersion??"?"} | touched ~${a.usage.touchedPercent}% | ${a.automatable}`);}}e.push("");}}if(t.tsModernity&&t.tsModernity.typescriptVersion){let n=t.tsModernity;e.push(E.bold.underline(" TypeScript"));let s=[];s.push(`v${n.typescriptVersion}`),n.strict===true?s.push(E.green("strict \u2714")):n.strict===false&&s.push(E.yellow("strict \u2716")),n.moduleType&&s.push(n.moduleType.toUpperCase()),n.target&&s.push(`target: ${n.target}`),e.push(` ${s.join(E.dim(" \xB7 "))}`),e.push("");}if(t.buildDeploy){let n=t.buildDeploy;(n.ci.length>0||n.docker.dockerfileCount>0||n.packageManagers.length>0)&&(e.push(E.bold.underline(" Build & Deploy")),n.ci.length>0&&e.push(` CI: ${n.ci.join(", ")}`),n.docker.dockerfileCount>0&&e.push(` Docker: ${n.docker.dockerfileCount} Dockerfile${n.docker.dockerfileCount!==1?"s":""} (${n.docker.baseImages.join(", ")})`),n.packageManagers.length>0&&e.push(` Package Managers: ${n.packageManagers.join(", ")}`),n.monorepoTools.length>0&&e.push(` Monorepo: ${n.monorepoTools.join(", ")}`),n.iac.length>0&&e.push(` IaC: ${n.iac.join(", ")}`),e.push(""));}if(t.uiPurpose){let n=t.uiPurpose;e.push(E.bold.underline(" Product Purpose Signals")),e.push(` Frameworks: ${n.detectedFrameworks.length>0?n.detectedFrameworks.join(", "):E.dim("unknown")}`),e.push(` Evidence: ${n.topEvidence.length}${n.capped?E.dim(` of ${n.evidenceCount} (capped)`):""}`);let s=n.topEvidence.slice(0,8);if(s.length>0){e.push(" Top Signals:");for(let r of s)e.push(` - [${r.kind}] ${r.value} ${E.dim(`(${r.file})`)}`);}if(n.unknownSignals.length>0){e.push(" Unknowns:");for(let r of n.unknownSignals.slice(0,4))e.push(` - ${E.yellow(r)}`);}e.push("");}if(t.securityPosture){let n=t.securityPosture;e.push(E.bold.underline(" Security Posture"));let s=[];s.push(n.lockfilePresent?E.green("Lockfile \u2714"):E.red("Lockfile \u2716")),s.push(n.gitignoreCoversEnv?E.green(".env \u2714"):E.red(".env \u2716")),s.push(n.gitignoreCoversNodeModules?E.green("node_modules \u2714"):E.yellow("node_modules \u2716")),n.multipleLockfileTypes&&s.push(E.yellow("Multiple lockfiles \u26A0")),n.envFilesTracked&&s.push(E.red("Env files tracked \u2716")),e.push(` ${s.join(E.dim(" \xB7 "))}`),e.push("");}if(t.platformMatrix){let n=t.platformMatrix;(n.nativeModules.length>0||n.dockerBaseImages.length>0)&&(e.push(E.bold.underline(" Platform")),n.nativeModules.length>0&&e.push(` Native modules: ${n.nativeModules.map(s=>E.dim(s)).join(", ")}`),n.osAssumptions.length>0&&e.push(` OS assumptions: ${n.osAssumptions.join(", ")}`),e.push(""));}if(t.codeQuality){let n=t.codeQuality;if(e.push(E.bold.underline(" Code Quality")),e.push(` Files: ${E.white(`${n.filesAnalyzed}`)} \xB7 Functions: ${E.white(`${n.functionsAnalyzed}`)} \xB7 Avg complexity: ${E.white(`${n.avgCyclomaticComplexity}`)} \xB7 Avg length: ${E.white(`${n.avgFunctionLength}`)} lines`),e.push(` Max nesting: ${n.maxNestingDepth} \xB7 Circular deps: ${n.circularDependencies} \xB7 Dead code: ${n.deadCodePercent}%`),n.godFiles.length>0){let s=n.godFiles.slice(0,3).map(r=>`${r.path} (${r.lines} lines)`).join(", ");e.push(` ${E.yellow("God files")}: ${s}`);}e.push("");}if(t.dependencyGraph){let n=t.dependencyGraph;n.lockfileType&&(e.push(E.bold.underline(" Dependency Graph")),e.push(` ${n.lockfileType}: ${E.white(`${n.totalUnique}`)} unique, ${E.white(`${n.totalInstalled}`)} installed`),n.duplicatedPackages.length>0&&e.push(` ${E.yellow(`${n.duplicatedPackages.length} duplicated`)} packages`),n.phantomDependencies.length>0&&e.push(` ${E.red(`${n.phantomDependencies.length} phantom`)} dependencies`),e.push(""));}return e}function Ia(t){let e=[];if(e.push(E.bold.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),e.push(E.bold.cyan("\u2551 Architecture Layers \u2551")),e.push(E.bold.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),e.push(""),e.push(E.bold(" Archetype: ")+`${t.archetype}`+E.dim(` (${Math.round(t.archetypeConfidence*100)}% confidence)`)),e.push(` Files classified: ${t.totalClassified}`+(t.unclassified>0?E.dim(` (${t.unclassified} unclassified)`):"")),e.push(""),t.layers.length>0){for(let n of t.layers){let s=n.riskLevel==="none"?E.dim("none"):n.riskLevel==="low"?E.green("low"):n.riskLevel==="moderate"?E.yellow("moderate"):E.red("high");e.push(` ${E.bold(n.layer)} ${n.fileCount} file${n.fileCount!==1?"s":""} drift ${tn(n.driftScore)} risk ${s}`);}e.push("");}return e}function _a(t){let e=[],n=t.projects.filter(a=>a.runtimeMajorsBehind!==void 0&&a.runtimeMajorsBehind>=3);if(n.length>0){let a=n.map(l=>l.name).join(", "),i="End-of-life runtimes no longer receive security patches and block ecosystem upgrades.",c=[];for(let l of n)c.push(`
|
|
28
|
+
./${l.path}`),c.push(`
|
|
29
|
+
${l.runtime} \u2192 ${l.runtimeLatest} (${l.runtimeMajorsBehind} major${l.runtimeMajorsBehind>1?"s":""} behind)`);i+=c.join(""),e.push({title:`Upgrade EOL runtime${n.length>1?"s":""} in ${a}`,explanation:i,impact:`\u2212${Math.min(n.length*10,30)} drift points (runtime & EOL)`,severity:100});}let s=[];for(let a of t.projects)for(let i of a.frameworks)i.majorsBehind!==null&&i.majorsBehind>=3&&s.push({name:i.name,fw:`${i.currentVersion} \u2192 ${i.latestVersion}`,behind:i.majorsBehind,project:a.name,projectPath:a.path});if(s.length>0){let a=s.sort((d,f)=>f.behind-d.behind)[0],i=s.length>1?` (+${s.length-1} more)`:"",c=`${a.behind} major versions behind. Major framework drift increases breaking change risk and blocks access to security fixes and performance improvements.`,l=[],u=0;for(let d of s){if(u>=8)break;l.push(`
|
|
30
|
+
./${d.projectPath}`),l.push(`
|
|
31
|
+
${d.name}: ${d.fw} (${d.behind} major${d.behind>1?"s":""} behind)`),u++;}let p=s.length-u;c+=l.join(""),p>0&&(c+=`
|
|
32
|
+
... and ${p} more`),e.push({title:`Upgrade ${a.name} ${a.fw} in ${a.project}${i}`,explanation:c,impact:"\u22125\u201315 drift points",severity:90});}for(let a of t.projects){let i=a.dependencyAgeBuckets,c=i.current+i.oneBehind+i.twoPlusBehind;if(c===0)continue;let l=Math.round(i.twoPlusBehind/c*100);if(l>=40){let u=`${i.twoPlusBehind} of ${c} dependencies are 2+ majors behind. Run \`npm outdated\` and prioritise packages with known CVEs or breaking API changes.`,p=a.dependencies.filter(d=>d.majorsBehind!==null&&d.majorsBehind>=2).sort((d,f)=>(f.majorsBehind??0)-(d.majorsBehind??0));if(p.length>0){let d=[],f=0;d.push(`
|
|
33
|
+
./${a.path}`);for(let h of p){if(f>=8)break;let y=h.resolvedVersion??h.currentSpec,j=h.latestStable??"?";d.push(`
|
|
34
|
+
${h.package}: ${y} \u2192 ${j} (${h.majorsBehind} major${h.majorsBehind>1?"s":""} behind)`),f++;}let g=p.length-f;u+=d.join(""),g>0&&(u+=`
|
|
35
|
+
... and ${g} more`);}e.push({title:`Reduce dependency rot in ${a.name} (${l}% severely outdated)`,explanation:u,impact:"\u22125\u201310 drift points",severity:80+l/10});}}let r=[];for(let a of t.projects)for(let i of a.frameworks)i.majorsBehind===2&&r.push({name:i.name,project:a.name,projectPath:a.path,fw:`${i.currentVersion} \u2192 ${i.latestVersion}`});let o=[...new Map(r.map(a=>[a.name,a])).values()];if(o.length>0){let a=o.slice(0,3).map(d=>`${d.name} (${d.fw})`).join(", "),i=o.length>3?` +${o.length-3} more`:"",c="These frameworks are 2 major versions behind. Create upgrade tickets and check migration guides \u2014 the gap will widen with each new release.",l=[],u=0;for(let d of r){if(u>=8)break;l.push(`
|
|
36
|
+
./${d.projectPath}`),l.push(`
|
|
37
|
+
${d.name}: ${d.fw}`),u++;}let p=r.length-u;c+=l.join(""),p>0&&(c+=`
|
|
38
|
+
... and ${p} more`),e.push({title:`Plan major framework upgrades: ${a}${i}`,explanation:c,impact:"\u22125\u201310 drift points",severity:60});}if(t.extended?.breakingChangeExposure){let a=t.extended.breakingChangeExposure,i=a.deprecatedPackages.length+a.legacyPolyfills.length;if(i>0){let c=[...a.deprecatedPackages,...a.legacyPolyfills].slice(0,5).join(", "),l=i>5?` +${i-5} more`:"",u=`${i} package${i!==1?"s":""} are deprecated or legacy polyfills. These receive no updates and may have known vulnerabilities.`,p=new Set([...a.deprecatedPackages,...a.legacyPolyfills]),d=[],f=0;for(let h of t.projects){let y=h.dependencies.filter(j=>p.has(j.package));if(y.length!==0){if(f>=10)break;d.push(`
|
|
39
|
+
./${h.path}`);for(let j of y){if(f>=10)break;let C=j.resolvedVersion??j.currentSpec,A=a.deprecatedPackages.includes(j.package)?"deprecated":"polyfill";d.push(`
|
|
40
|
+
${j.package}: ${C} (${A})`),f++;}}}let g=i-f;u+=d.join(""),g>0&&(u+=`
|
|
41
|
+
... and ${g} more`),e.push({title:`Replace deprecated/legacy packages: ${c}${l}`,explanation:u,severity:55});}}if(t.extended?.dependencyGraph){let a=t.extended.dependencyGraph,i=a.phantomDependencies.length;if(i>=10){let c="Packages used in code but not declared in package.json. These rely on transitive installs and can break unpredictably when other packages update.",l=a.phantomDependencyDetails;if(l&&l.length>0){let u=new Map;for(let g of l)u.has(g.sourcePath)||u.set(g.sourcePath,[]),u.get(g.sourcePath).push({package:g.package,spec:g.spec});let p=[],d=0;for(let[g,h]of u){if(d>=10)break;p.push(`
|
|
42
|
+
./${g}`);for(let y of h){if(d>=10)break;p.push(`
|
|
43
|
+
${y.package}: ${y.spec}`),d++;}}let f=i-d;c+=p.join(""),f>0&&(c+=`
|
|
44
|
+
... and ${f} more`);}e.push({title:`Fix ${i} phantom dependencies`,explanation:c,severity:45});}}if(t.extended?.securityPosture){let a=t.extended.securityPosture;if(a.envFilesTracked||!a.lockfilePresent){let i=[];a.envFilesTracked&&i.push(".env files are tracked in git"),a.lockfilePresent||i.push("no lockfile found");let c;a.envFilesTracked?(c="Environment files may contain secrets. Add them to .gitignore and rotate any exposed credentials immediately.",c+=`
|
|
45
|
+
./.gitignore`,c+=`
|
|
46
|
+
Add: .env, .env.*, .env.local`):(c="Without a lockfile, installs are non-deterministic. Run the install command to generate one and commit it.",c+=`
|
|
47
|
+
./`,c+=`
|
|
48
|
+
Missing: ${a.lockfileTypes.length>0?a.lockfileTypes.join(", ")+" (multiple types detected)":"package-lock.json, pnpm-lock.yaml, or yarn.lock"}`),e.push({title:`Fix security posture: ${i.join(", ")}`,explanation:c,severity:95});}}if(t.extended?.dependencyGraph){let i=t.extended.dependencyGraph.duplicatedPackages.filter(c=>c.versions.length>=3);if(i.length>=3){i.slice(0,4).map(f=>`${f.name} (${f.versions.length}v)`).join(", ");let l=`${i.length} packages have 3+ versions installed. Run \`npm dedupe\` to reduce bundle size and install time.`,u=[],p=0;for(let f of i){if(p>=8)break;u.push(`
|
|
49
|
+
${f.name}: ${f.versions.join(", ")} (${f.consumers} consumer${f.consumers!==1?"s":""})`),p++;}let d=i.length-p;l+=u.join(""),d>0&&(l+=`
|
|
50
|
+
... and ${d} more`),e.push({title:"Deduplicate heavily-versioned packages",explanation:l,severity:35});}}return e.sort((a,i)=>i.severity-a.severity),e.slice(0,5)}function Fa(t){let e=Oa(t.findings),n=t.findings.map(s=>Ba(s));return {$schema:"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/main/sarif-2.1/schema/sarif-schema-2.1.0.json",version:"2.1.0",runs:[{tool:{driver:{name:"vibgrate",version:t.vibgrateVersion,informationUri:"https://vibgrate.com",rules:e}},results:n,invocations:[{executionSuccessful:true,startTimeUtc:t.timestamp}]}]}}function Oa(t){return [...new Set(t.map(n=>n.ruleId))].map(n=>({"vibgrate/runtime-eol":{id:"vibgrate/runtime-eol",shortDescription:{text:"Runtime at or past end-of-life"},helpUri:"https://vibgrate.com/rules/runtime-eol"},"vibgrate/runtime-lag":{id:"vibgrate/runtime-lag",shortDescription:{text:"Runtime major version lag"},helpUri:"https://vibgrate.com/rules/runtime-lag"},"vibgrate/framework-major-lag":{id:"vibgrate/framework-major-lag",shortDescription:{text:"Framework major version behind latest"},helpUri:"https://vibgrate.com/rules/framework-major-lag"},"vibgrate/dependency-rot":{id:"vibgrate/dependency-rot",shortDescription:{text:"High percentage of outdated dependencies"},helpUri:"https://vibgrate.com/rules/dependency-rot"},"vibgrate/dependency-major-lag":{id:"vibgrate/dependency-major-lag",shortDescription:{text:"Individual dependency severely behind"},helpUri:"https://vibgrate.com/rules/dependency-major-lag"}})[n]??{id:n,shortDescription:{text:n},helpUri:"https://vibgrate.com"})}function Ba(t){return {ruleId:t.ruleId,level:t.level==="error"?"error":t.level==="warning"?"warning":"note",message:{text:t.message},locations:[{physicalLocation:{artifactLocation:{uri:t.location}}}]}}function Da(t){let e=[],n=t.billing;e.push("# Vibgrate Drift Report"),e.push(""),e.push("| Metric | Value |"),e.push("|--------|-------|"),e.push(`| **Drift Score** | ${t.drift.score}/100 |`),e.push(`| **Risk Level** | ${t.drift.riskLevel.toUpperCase()} |`),e.push(`| **Projects** | ${t.projects.length} |`),n&&(e.push(`| **Classification** | ${n.microCount} micro \xB7 ${n.smallCount} small \xB7 ${n.standardCount} standard |`),e.push(`| **Billable Projects** | ${n.billableProjects} (${n.totalScanned} detected \u2192 ${n.billableProjects} billable) |`));let s=[t.timestamp];t.durationMs!==void 0&&s.push(`${(t.durationMs/1e3).toFixed(1)}s`),t.filesScanned!==void 0&&s.push(`${t.filesScanned} files`),t.treeSummary&&s.push(`${t.treeSummary.totalFiles.toLocaleString()} workspace files \xB7 ${t.treeSummary.totalDirs.toLocaleString()} dirs`),e.push(`| **Scanned** | ${s.join(" \xB7 ")} |`),t.vcs&&(e.push(`| **VCS** | ${t.vcs.type} |`),t.vcs.branch&&e.push(`| **Branch** | ${t.vcs.branch} |`),t.vcs.sha&&e.push(`| **Commit** | \`${t.vcs.shortSha}\` |`)),e.push(""),e.push("## Score Breakdown"),e.push(""),e.push("| Component | Score |"),e.push("|-----------|-------|"),e.push(`| Runtime | ${t.drift.components.runtimeScore} |`),e.push(`| Frameworks | ${t.drift.components.frameworkScore} |`),e.push(`| Dependencies | ${t.drift.components.dependencyScore} |`),e.push(`| EOL Risk | ${t.drift.components.eolScore} |`),e.push(""),e.push("## Projects"),e.push("");for(let r of t.projects){if(e.push(`### ${r.name} (${r.type})`),e.push(""),r.runtime){let i=r.runtimeMajorsBehind!==void 0&&r.runtimeMajorsBehind>0?` \u2014 ${r.runtimeMajorsBehind} major(s) behind`:" \u2014 current";e.push(`- **Runtime:** ${r.runtime}${i}`);}if(r.frameworks.length>0){e.push("- **Frameworks:**");for(let i of r.frameworks){let c=i.majorsBehind!==null?i.majorsBehind===0?"current":`${i.majorsBehind} behind`:"unknown";e.push(` - ${i.name}: ${i.currentVersion??"?"} \u2192 ${i.latestVersion??"?"} (${c})`);}}let o=r.dependencyAgeBuckets;o.current+o.oneBehind+o.twoPlusBehind+o.unknown>0&&e.push(`- **Dependencies:** ${o.current} current, ${o.oneBehind} 1-behind, ${o.twoPlusBehind} 2+ behind, ${o.unknown} unknown`),e.push("");}if(t.extended?.uiPurpose){let r=t.extended.uiPurpose;if(e.push("## Product Purpose Signals"),e.push(""),e.push(`- **Frameworks:** ${r.detectedFrameworks.length>0?r.detectedFrameworks.join(", "):"unknown"}`),e.push(`- **Evidence Items:** ${r.topEvidence.length}${r.capped?` (capped from ${r.evidenceCount})`:""}`),r.topEvidence.length>0){e.push("- **Top Evidence:**");for(let o of r.topEvidence.slice(0,10))e.push(` - [${o.kind}] ${o.value} (${o.file})`);}if(r.unknownSignals.length>0){e.push("- **Unknowns:**");for(let o of r.unknownSignals.slice(0,5))e.push(` - ${o}`);}e.push("");}if(t.extended?.standards&&t.extended.standards.recommended.length>0){let r=t.extended.standards;e.push("## Recommended Standards"),e.push("");let o=r.projectPurposes.map(a=>`${a.project} \u2192 ${a.category}`).join(", ");if(o&&e.push(`- **Detected purpose:** ${o}`),r.frameworks.length>0){e.push("- **Compliance framework coverage:**");for(let a of r.frameworks)e.push(` - ${a.name}: ${a.recommendedMembers}/${a.totalMembers} member standards apply`);}e.push("- **Top standards to consider:**");for(let a of r.recommended.slice(0,10)){let i=a.complianceRelevant?" _(compliance)_":"";e.push(` - **${a.name}** \u2014 ${a.reason}${i}`);}e.push("");}if(t.findings.length>0){e.push("## Findings"),e.push(""),e.push("| Level | Rule | Message | Location |"),e.push("|-------|------|---------|----------|");for(let r of t.findings){let o=r.level==="error"?"\u{1F534}":r.level==="warning"?"\u{1F7E1}":"\u{1F535}";e.push(`| ${o} ${r.level} | ${r.ruleId} | ${r.message} | ${r.location} |`);}e.push("");}if(t.delta!==void 0){let r=t.delta>0?"\u{1F4C8}":t.delta<0?"\u{1F4C9}":"\u27A1\uFE0F";e.push(`## Drift Delta: ${r} ${t.delta>0?"+":""}${t.delta} vs baseline`),e.push("");}return e.join(`
|
|
51
|
+
`)}async function Se(t,e){let n,s=new Promise(r=>{n=setTimeout(()=>r({ok:false}),e);});try{return await Promise.race([t.then(o=>({ok:!0,value:o})),s])}finally{clearTimeout(n);}}function Ha(t,e){return new Promise((n,s)=>{let r=spawn(t,e,{stdio:["ignore","pipe","pipe"]}),o="",a="";r.stdout.on("data",i=>o+=String(i)),r.stderr.on("data",i=>a+=String(i)),r.on("error",s),r.on("close",i=>{if(i!==0){s(new Error(`${t} ${e.join(" ")} failed (code=${i}): ${a.trim()}`));return}n(o);});})}async function io(t,e){try{return JSON.parse(t)}catch{throw new Error(`Invalid JSON in package version manifest: ${e}`)}}async function Wa(t){let e=await mkdtemp(_.join(on.tmpdir(),"vibgrate-manifest-"));try{await Ha("unzip",["-qq",t,"-d",e]);let n=[_.join(e,"package-versions.json"),_.join(e,"manifest.json"),_.join(e,"index.json")];for(let s of n)try{let r=await readFile(s,"utf8");return await io(r,s)}catch{}throw new Error("Zip must contain package-versions.json, manifest.json, or index.json")}finally{await rm(e,{recursive:true,force:true});}}async function za(t){let e=_.resolve(t);if(e.toLowerCase().endsWith(".zip"))return Wa(e);let n=await readFile(e,"utf8");return io(n,e)}function H(t,e,n){if(!t)return;let s=t[e];if(s)return e==="nuget"?s[n.toLowerCase()]??s[n]:s[n]}function sn(t){return t.filter(e=>et.valid(e)&&et.prerelease(e)===null)}function Fn(t){let e=sn(t);return e.length===0?null:e.sort(et.rcompare)[0]??null}function Ja(t){if(!t||typeof t!="object")return;let e={};for(let[n,s]of Object.entries(t))n==="created"||n==="modified"||typeof s=="string"&&(e[n]=s);return Object.keys(e).length>0?e:void 0}function Ln(t){let e=null,n=[],s=null,r;if(t&&typeof t=="object"){let i=t,c=i["dist-tags.latest"];typeof c=="string"&&(e=c);let l=i["dist-tags"];!e&&l&&typeof l=="object"&&typeof l.latest=="string"&&(e=l.latest);let u=i.versions;Array.isArray(u)?n=u.map(String):typeof u=="string"&&(n=[u]),s=ao(i.license??i.licenses),r=Ja(i.time);}let o=sn(n),a=Fn(o);return !e&&a&&(e=a),{latest:e,stableVersions:o,latestStableOverall:a,license:s,...r?{releaseDates:r}:{}}}function ao(t){if(!t)return null;if(typeof t=="string")return t.trim()||null;if(Array.isArray(t)){let e=t.map(ao).filter(n=>!!n);return e.length===0?null:e.length===1?e[0]:`(${e.join(" OR ")})`}if(typeof t=="object"){let e=t;if(typeof e.type=="string")return e.type.trim()||null;if(typeof e.spdx=="string")return e.spdx.trim()||null}return null}var Ka=24,Qa=7e3,Ya=3e4,Xa=process.platform==="win32"?"npm.cmd":"npm";function Za(t,e=process.platform){let n=e==="win32"?Qa:Ya,s=[],r=[],o=0;for(let a of t){let i=a.length+1;(r.length>=Ka||r.length>0&&o+i>n)&&(s.push(r),r=[],o=0),r.push(a),o+=i;}return r.length>0&&s.push(r),s}async function nn(t,e){return new Promise((n,s)=>{let r=spawn(Xa,["view",...t,"--json"],{cwd:e,stdio:["ignore","pipe","pipe"]}),o="",a="";r.stdout.on("data",i=>o+=String(i)),r.stderr.on("data",i=>a+=String(i)),r.on("error",s),r.on("close",i=>{if(i!==0){s(new Error(`npm view ${t.join(" ")} failed (code=${i}): ${a.trim()}`));return}let c=o.trim();if(!c){n(null);return}try{n(JSON.parse(c));}catch{n(c.replace(/^"|"$/g,""));}});})}var ec=class{constructor(t,e,n,s=false){this.cwd=t,this.sem=e,this.manifest=n,this.offline=s;}meta=new Map;async prefetch(t){let n=[...new Set(t.filter(Boolean))].filter(r=>!this.meta.has(r));if(n.length===0)return;let s=this.sem.run(()=>this.fetchBatch(n));for(let r of n){let o=s.then(a=>a.get(r)??{latest:null,stableVersions:[],latestStableOverall:null,license:null});this.meta.set(r,o);}await s;}get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(()=>this.fetchOne(t));return this.meta.set(t,n),n}async fetchBatch(t){let e=new Map,n=[];for(let s of t){let r=H(this.manifest,"npm",s);if(r){let o=sn(r.versions??[]),a=Fn(o);e.set(s,{latest:r.latest??a,stableVersions:o,latestStableOverall:a,license:r.license??null,...r.releaseDates?{releaseDates:r.releaseDates}:{}});}else this.offline?e.set(s,{latest:null,stableVersions:[],latestStableOverall:null,license:null}):n.push(s);}if(n.length===0)return e;for(let s of Za(n)){let r=await this.fetchRemoteChunk(s);for(let[o,a]of r)e.set(o,a);}return e}async fetchRemoteChunk(t){let e=new Map;if(t.length===1)return e.set(t[0],await this.fetchOneRemote(t[0])),e;try{let n=await nn([...t,"dist-tags.latest","versions","license","licenses","time"],this.cwd);if(Array.isArray(n))for(let s=0;s<n.length&&s<t.length;s++)e.set(t[s],Ln(n[s]));else if(n&&typeof n=="object"){let s=n,r=0;for(let o of t)o in s&&(e.set(o,Ln(s[o])),r++);r===0&&t.length===1&&e.set(t[0],Ln(s));}}catch{}for(let n of t)e.has(n)||e.set(n,await this.fetchOneRemote(n));return e}async fetchOne(t){let e=H(this.manifest,"npm",t);if(e){let n=sn(e.versions??[]),s=Fn(n);return {latest:e.latest??s,stableVersions:n,latestStableOverall:s,license:e.license??null,...e.releaseDates?{releaseDates:e.releaseDates}:{}}}return this.offline?{latest:null,stableVersions:[],latestStableOverall:null,license:null}:this.fetchOneRemote(t)}async fetchOneRemote(t){try{let e=await nn([t,"dist-tags.latest","versions","license","licenses","time"],this.cwd);return Ln(e)}catch{let e=null,n=[];try{let o=await nn([t,"dist-tags"],this.cwd);o&&typeof o=="object"&&typeof o.latest=="string"&&(e=o.latest);}catch{}try{let o=await nn([t,"versions"],this.cwd);Array.isArray(o)?n=o.map(String):typeof o=="string"&&(n=[o]);}catch{}let s=sn(n),r=Fn(s);return !e&&r&&(e=r),{latest:e,stableVersions:s,latestStableOverall:r,license:null}}}};async function tc(t){try{let e=new AbortController,n=setTimeout(()=>e.abort(),5e3),s=await fetch("https://registry.npmjs.org/npm/latest",{method:"HEAD",signal:e.signal});return clearTimeout(n),s.ok}catch{try{let e=await nn(["npm","dist-tags.latest"],t);return typeof e=="string"&&e.length>0}catch{return false}}}function co(t){let e=t.trim();return !e||e.startsWith("workspace:")||e.startsWith("file:")||e.startsWith("link:")||e.startsWith("git+")||e.includes("://")||e.startsWith("github:")?false:e==="*"||e.toLowerCase()==="latest"?true:et.validRange(e)!==null}function lo(t){switch(t){case "public-domain":case "permissive":return "low";case "weak-copyleft":return "medium";case "copyleft":case "network-copyleft":case "proprietary":return "high";default:return "medium"}}var uo={attribution:false,copyleft:false,networkCopyleft:false,discloseSource:false,patentGrant:false,commercialRestriction:false};function nc(t){return {spdxId:t.id,name:t.name,family:t.family,category:t.category,osiApproved:t.osi??false,fsfLibre:t.fsf??false,deprecated:t.deprecated??false,referenceUrl:t.url??`https://spdx.org/licenses/${t.id}.html`,riskLevel:lo(t.category),obligations:{...uo,...t.obligations??{}}}}var q={attribution:true},sc={attribution:true,patentGrant:true},ie={attribution:true,copyleft:true,discloseSource:true},Ye={attribution:true,copyleft:true,discloseSource:true},Nn={attribution:true,copyleft:true,networkCopyleft:true,discloseSource:true},rc=[{id:"CC0-1.0",name:"Creative Commons Zero v1.0 Universal",family:"CC",category:"public-domain",fsf:true},{id:"Unlicense",name:"The Unlicense",family:"Public Domain",category:"public-domain",osi:true,fsf:true},{id:"0BSD",name:"BSD Zero Clause License",family:"BSD",category:"permissive",osi:true},{id:"WTFPL",name:"Do What The F*ck You Want To Public License",family:"WTFPL",category:"permissive",fsf:true},{id:"MIT",name:"MIT License",family:"MIT",category:"permissive",osi:true,fsf:true,obligations:q},{id:"MIT-0",name:"MIT No Attribution",family:"MIT",category:"permissive",osi:true},{id:"ISC",name:"ISC License",family:"ISC",category:"permissive",osi:true,fsf:true,obligations:q},{id:"BSD-2-Clause",name:'BSD 2-Clause "Simplified" License',family:"BSD",category:"permissive",osi:true,fsf:true,obligations:q},{id:"BSD-3-Clause",name:'BSD 3-Clause "New" or "Revised" License',family:"BSD",category:"permissive",osi:true,fsf:true,obligations:q},{id:"BSD-3-Clause-Clear",name:"BSD 3-Clause Clear License",family:"BSD",category:"permissive",osi:true,obligations:q},{id:"Apache-2.0",name:"Apache License 2.0",family:"Apache",category:"permissive",osi:true,fsf:true,obligations:sc},{id:"Apache-1.1",name:"Apache Software License 1.1",family:"Apache",category:"permissive",osi:true,obligations:q},{id:"Zlib",name:"zlib License",family:"Zlib",category:"permissive",osi:true,fsf:true},{id:"BSL-1.0",name:"Boost Software License 1.0",family:"Boost",category:"permissive",osi:true,fsf:true,obligations:q},{id:"PostgreSQL",name:"PostgreSQL License",family:"BSD",category:"permissive",osi:true,obligations:q},{id:"Python-2.0",name:"Python License 2.0",family:"Python",category:"permissive",osi:true,obligations:q},{id:"PSF-2.0",name:"Python Software Foundation License 2.0",family:"Python",category:"permissive",obligations:q},{id:"Artistic-2.0",name:"Artistic License 2.0",family:"Artistic",category:"permissive",osi:true,fsf:true,obligations:q},{id:"NCSA",name:"University of Illinois/NCSA Open Source License",family:"NCSA",category:"permissive",osi:true,fsf:true,obligations:q},{id:"Unicode-DFS-2016",name:"Unicode License Agreement - Data Files and Software (2016)",family:"Unicode",category:"permissive",osi:true,obligations:q},{id:"BlueOak-1.0.0",name:"Blue Oak Model License 1.0.0",family:"BlueOak",category:"permissive",obligations:q},{id:"LGPL-2.0-only",name:"GNU Library General Public License v2 only",family:"LGPL",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"LGPL-2.1-only",name:"GNU Lesser General Public License v2.1 only",family:"LGPL",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"LGPL-2.1-or-later",name:"GNU Lesser General Public License v2.1 or later",family:"LGPL",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"LGPL-3.0-only",name:"GNU Lesser General Public License v3.0 only",family:"LGPL",category:"weak-copyleft",osi:true,fsf:true,obligations:{...ie,patentGrant:true}},{id:"LGPL-3.0-or-later",name:"GNU Lesser General Public License v3.0 or later",family:"LGPL",category:"weak-copyleft",osi:true,fsf:true,obligations:{...ie,patentGrant:true}},{id:"MPL-2.0",name:"Mozilla Public License 2.0",family:"MPL",category:"weak-copyleft",osi:true,fsf:true,obligations:{...ie,patentGrant:true}},{id:"MPL-1.1",name:"Mozilla Public License 1.1",family:"MPL",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"EPL-1.0",name:"Eclipse Public License 1.0",family:"EPL",category:"weak-copyleft",osi:true,fsf:true,obligations:{...ie,patentGrant:true}},{id:"EPL-2.0",name:"Eclipse Public License 2.0",family:"EPL",category:"weak-copyleft",osi:true,fsf:true,obligations:{...ie,patentGrant:true}},{id:"CDDL-1.0",name:"Common Development and Distribution License 1.0",family:"CDDL",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"CDDL-1.1",name:"Common Development and Distribution License 1.1",family:"CDDL",category:"weak-copyleft",obligations:ie},{id:"CPL-1.0",name:"Common Public License 1.0",family:"CPL",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"MS-PL",name:"Microsoft Public License",family:"Microsoft",category:"weak-copyleft",osi:true,fsf:true,obligations:q},{id:"MS-RL",name:"Microsoft Reciprocal License",family:"Microsoft",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"GPL-2.0-only",name:"GNU General Public License v2.0 only",family:"GPL",category:"copyleft",osi:true,fsf:true,obligations:Ye},{id:"GPL-2.0-or-later",name:"GNU General Public License v2.0 or later",family:"GPL",category:"copyleft",osi:true,fsf:true,obligations:Ye},{id:"GPL-3.0-only",name:"GNU General Public License v3.0 only",family:"GPL",category:"copyleft",osi:true,fsf:true,obligations:{...Ye,patentGrant:true}},{id:"GPL-3.0-or-later",name:"GNU General Public License v3.0 or later",family:"GPL",category:"copyleft",osi:true,fsf:true,obligations:{...Ye,patentGrant:true}},{id:"EUPL-1.1",name:"European Union Public License 1.1",family:"EUPL",category:"copyleft",osi:true,fsf:true,obligations:Ye},{id:"EUPL-1.2",name:"European Union Public License 1.2",family:"EUPL",category:"copyleft",osi:true,fsf:true,obligations:Ye},{id:"OSL-3.0",name:"Open Software License 3.0",family:"OSL",category:"copyleft",osi:true,fsf:true,obligations:{...Ye,patentGrant:true}},{id:"CECILL-2.1",name:"CeCILL Free Software License Agreement v2.1",family:"CeCILL",category:"copyleft",osi:true,fsf:true,obligations:Ye},{id:"CC-BY-SA-4.0",name:"Creative Commons Attribution Share Alike 4.0 International",family:"CC",category:"copyleft",obligations:{attribution:true,copyleft:true}},{id:"AGPL-3.0-only",name:"GNU Affero General Public License v3.0 only",family:"AGPL",category:"network-copyleft",osi:true,fsf:true,obligations:{...Nn,patentGrant:true}},{id:"AGPL-3.0-or-later",name:"GNU Affero General Public License v3.0 or later",family:"AGPL",category:"network-copyleft",osi:true,fsf:true,obligations:{...Nn,patentGrant:true}},{id:"SSPL-1.0",name:"Server Side Public License 1.0",family:"SSPL",category:"network-copyleft",obligations:Nn},{id:"BUSL-1.1",name:"Business Source License 1.1",family:"BUSL",category:"proprietary",obligations:{commercialRestriction:true,discloseSource:true}},{id:"Elastic-2.0",name:"Elastic License 2.0",family:"Elastic",category:"proprietary",obligations:{commercialRestriction:true}},{id:"RPL-1.5",name:"Reciprocal Public License 1.5",family:"RPL",category:"network-copyleft",osi:true,obligations:Nn},{id:"Commons-Clause",name:"Commons Clause License Condition v1.0",family:"Commons-Clause",category:"proprietary",obligations:{commercialRestriction:true}},{id:"LicenseRef-Proprietary",name:"Proprietary / Commercial",family:"Proprietary",category:"proprietary",obligations:{commercialRestriction:true}},{id:"CC-BY-NC-4.0",name:"Creative Commons Attribution Non Commercial 4.0 International",family:"CC",category:"proprietary",obligations:{attribution:true,commercialRestriction:true}},{id:"CC-BY-4.0",name:"Creative Commons Attribution 4.0 International",family:"CC",category:"permissive",obligations:q}],oc=rc.map(nc),po=new Map;for(let t of oc)po.set(t.spdxId.toLowerCase(),t);function V(t){return po.get(t.trim().toLowerCase())}function On(t="Unknown"){return {spdxId:"NOASSERTION",name:t,family:"Unknown",category:"unknown",osiApproved:false,fsfLibre:false,deprecated:false,referenceUrl:"",riskLevel:"medium",obligations:{...uo}}}function fo(t){return t.trim().toLowerCase().replace(/^\(+|\)+$/g,"").replace(/[._]/g,"-").replace(/\s+/g," ").replace(/\s*-\s*/g,"-").replace(/\bversion\b/g,"v").replace(/\blicen[sc]e\b/g,"").replace(/\s+/g," ").trim()}var ic={mit:"MIT","mit license":"MIT","the mit license":"MIT",expat:"MIT",isc:"ISC",apache:"Apache-2.0","apache 2":"Apache-2.0",apache2:"Apache-2.0","apache 2.0":"Apache-2.0","apache-2":"Apache-2.0","apache license 2.0":"Apache-2.0","apache license version 2.0":"Apache-2.0","asl 2.0":"Apache-2.0",al2:"Apache-2.0",bsd:"BSD-3-Clause","bsd license":"BSD-3-Clause","bsd-2":"BSD-2-Clause","bsd 2-clause":"BSD-2-Clause","simplified bsd":"BSD-2-Clause",freebsd:"BSD-2-Clause","bsd-3":"BSD-3-Clause","bsd 3-clause":"BSD-3-Clause","new bsd":"BSD-3-Clause","modified bsd":"BSD-3-Clause","revised bsd":"BSD-3-Clause",gpl:"GPL-3.0-or-later",gplv2:"GPL-2.0-only",gpl2:"GPL-2.0-only","gpl-2":"GPL-2.0-only","gpl 2.0":"GPL-2.0-only","gpl-2.0":"GPL-2.0-only","gpl-2.0+":"GPL-2.0-or-later","gnu gpl v2":"GPL-2.0-only",gplv3:"GPL-3.0-only",gpl3:"GPL-3.0-only","gpl-3":"GPL-3.0-only","gpl 3.0":"GPL-3.0-only","gpl-3.0":"GPL-3.0-only","gpl-3.0+":"GPL-3.0-or-later","gnu gpl v3":"GPL-3.0-only","gnu general public v3":"GPL-3.0-only",lgpl:"LGPL-3.0-or-later","lgplv2.1":"LGPL-2.1-only","lgpl-2.1":"LGPL-2.1-only","lgpl 2.1":"LGPL-2.1-only",lgplv3:"LGPL-3.0-only","lgpl-3":"LGPL-3.0-only","lgpl-3.0":"LGPL-3.0-only","lgpl 3.0":"LGPL-3.0-only",agpl:"AGPL-3.0-or-later",agplv3:"AGPL-3.0-only","agpl-3":"AGPL-3.0-only","agpl-3.0":"AGPL-3.0-only","agpl 3.0":"AGPL-3.0-only","gnu agpl v3":"AGPL-3.0-only",mpl:"MPL-2.0","mpl 2.0":"MPL-2.0","mpl-2":"MPL-2.0","mozilla public 2.0":"MPL-2.0",epl:"EPL-2.0","eclipse public 2.0":"EPL-2.0","epl-2":"EPL-2.0",sspl:"SSPL-1.0","server side public":"SSPL-1.0",busl:"BUSL-1.1","business source":"BUSL-1.1",elastic:"Elastic-2.0","elastic-2":"Elastic-2.0","commons clause":"Commons-Clause",proprietary:"LicenseRef-Proprietary",commercial:"LicenseRef-Proprietary","see license in license":"LicenseRef-Proprietary",unlicensed:"LicenseRef-Proprietary","all rights reserved":"LicenseRef-Proprietary",cc0:"CC0-1.0","cc0 1.0":"CC0-1.0","public domain":"CC0-1.0","the unlicense":"Unlicense",wtfpl:"WTFPL",boost:"BSL-1.0",bsl:"BSL-1.0","zlib/libpng":"Zlib",python:"Python-2.0",psf:"PSF-2.0",artistic:"Artistic-2.0"},ho=new Map;for(let[t,e]of Object.entries(ic))ho.set(fo(t),e);function mo(t){return ho.get(fo(t))}var ac=/\(|\)|\bWITH\b|\bAND\b|\bOR\b|[^\s()]+/gi;function cc(t){let e=(t??"").trim(),n=[],s=[],r=false,o=false,a=false,i=false,c=e.match(ac)??[];for(let u of c){let p=u.toUpperCase();if(u==="("||u===")")continue;if(p==="OR"){r=true,i=false;continue}if(p==="AND"){o=true,i=false;continue}if(p==="WITH"){i=true;continue}if(i){s.includes(u)||s.push(u),i=false;continue}let d=u;d.endsWith("+")&&(a=true,d=d.slice(0,-1)),d&&!n.includes(d)&&n.push(d);}let l=r?"OR":o?"AND":"SINGLE";return {licenseIds:n,exceptions:s,operator:l,orLater:a,normalized:lc(n,s,l,a,e)}}function lc(t,e,n,s,r){if(t.length===0)return r.trim();if(t.length===1){let a=t[0];return s&&!a.endsWith("+")&&(a+="+"),e.length>0&&(a+=` WITH ${e.join(" WITH ")}`),a}let o=n==="AND"?" AND ":" OR ";return t.join(o)}function uc(t){return /\b(?:AND|OR|WITH)\b|\+\s*$|\(/i.test(t)}var Br={"public-domain":0,permissive:1,"weak-copyleft":2,copyleft:3,"network-copyleft":4,proprietary:5,unknown:2};function be(t,e,n,s,r){return {spdxId:t.spdxId,name:t.name,expression:s??t.spdxId,family:t.family,category:t.category,riskLevel:t.riskLevel,osiApproved:t.osiApproved,fsfLibre:t.fsfLibre,obligations:t.obligations,matchStatus:e,confidence:n,components:r??[t.spdxId]}}function go(t){let e=t.toLowerCase();if(/\bagpl/.test(e))return V("AGPL-3.0-or-later");if(/\bsspl/.test(e))return V("SSPL-1.0");if(/\bbusl|business source/.test(e))return V("BUSL-1.1");if(/\blgpl/.test(e))return V("LGPL-3.0-or-later");if(/\bgpl/.test(e))return V("GPL-3.0-or-later");if(/\bmpl|mozilla/.test(e))return V("MPL-2.0");if(/\bepl|eclipse/.test(e))return V("EPL-2.0");if(/\bapache/.test(e))return V("Apache-2.0");if(/\bbsd/.test(e))return V("BSD-3-Clause");if(/\bmit\b/.test(e))return V("MIT");if(/\bisc\b/.test(e))return V("ISC");if(/commons clause/.test(e))return V("Commons-Clause");if(/proprietary|commercial|all rights reserved/.test(e))return V("LicenseRef-Proprietary");if(/public domain|cc0/.test(e))return V("CC0-1.0")}function pc(t){let e=(t??"").trim();if(!e||/^(unknown|noassertion|none|n\/a)$/i.test(e))return be(On(),"unknown",0);let n=V(e);if(n)return be(n,"exact",1);if(uc(e))return dc(e);let s=mo(e);if(s){let o=V(s);if(o)return be(o,"alias",.95)}let r=go(e);return r?{...be(r,"fuzzy",.6),name:e.slice(0,120)}:be(On(e.slice(0,120)),"unknown",0)}function dc(t){let e=cc(t);if(e.licenseIds.length===0)return be(On(t.slice(0,120)),"unknown",0);let n=e.licenseIds.map(c=>{let l=V(c);if(l)return be(l,"exact",1);let u=mo(c);if(u){let d=V(u);if(d)return be(d,"alias",.95)}let p=go(c);return p?be(p,"fuzzy",.6):be(On(c),"unknown",0)}),s=e.operator!=="OR",r=n[0];for(let c of n){let l=Br[c.category]>Br[r.category];(s?l:!l)&&(r=c);}let o=fc(s?n:[r]),a=n.map(c=>c.spdxId),i=r.category;return {spdxId:r.spdxId,name:e.normalized,expression:e.normalized,family:r.family,category:i,riskLevel:lo(i),osiApproved:n.every(c=>c.osiApproved),fsfLibre:n.every(c=>c.fsfLibre),obligations:o,matchStatus:"expression",confidence:Math.min(...n.map(c=>c.confidence))||.5,components:a}}function fc(t){let e={attribution:false,copyleft:false,networkCopyleft:false,discloseSource:false,patentGrant:false,commercialRestriction:false};for(let n of t)e.attribution||=n.obligations.attribution,e.copyleft||=n.obligations.copyleft,e.networkCopyleft||=n.obligations.networkCopyleft,e.discloseSource||=n.obligations.discloseSource,e.patentGrant||=n.obligations.patentGrant,e.commercialRestriction||=n.obligations.commercialRestriction;return e}function hc(t,e){let n=(t??"").trim();if(!n)return {raw:null,spdxId:null,source:"none",confidence:0};let s=pc(n);return {raw:n.slice(0,200),spdxId:s.matchStatus==="unknown"?null:s.spdxId,source:e,confidence:s.confidence}}var Dr={react:"React","react-dom":"React DOM",vue:"Vue","@angular/core":"Angular",svelte:"Svelte","solid-js":"Solid",preact:"Preact",lit:"Lit",qwik:"Qwik","htmx.org":"htmx",alpinejs:"Alpine.js",stimulus:"Stimulus",next:"Next.js",nuxt:"Nuxt","@remix-run/react":"Remix","@remix-run/node":"Remix (Node)",gatsby:"Gatsby",astro:"Astro","@sveltejs/kit":"SvelteKit","@analogjs/platform":"Analog","@tanstack/start":"TanStack Start",express:"Express",fastify:"Fastify","@nestjs/core":"NestJS",hono:"Hono",koa:"Koa","@hapi/hapi":"Hapi",restify:"Restify","@elysiajs/eden":"Elysia",elysia:"Elysia","@adonisjs/core":"AdonisJS",moleculer:"Moleculer","@feathersjs/feathers":"Feathers",sails:"Sails",typescript:"TypeScript",redux:"Redux","@reduxjs/toolkit":"Redux Toolkit",zustand:"Zustand",mobx:"MobX",jotai:"Jotai",recoil:"Recoil",pinia:"Pinia",vuex:"Vuex","@tanstack/react-query":"TanStack Query",swr:"SWR",xstate:"XState","@ngrx/store":"NgRx",prisma:"Prisma","drizzle-orm":"Drizzle",typeorm:"TypeORM",sequelize:"Sequelize","@mikro-orm/core":"MikroORM",mongoose:"Mongoose",knex:"Knex",kysely:"Kysely",objection:"Objection.js",vite:"Vite",webpack:"webpack",rollup:"Rollup",esbuild:"esbuild",parcel:"Parcel",turbo:"Turbo",tsup:"tsup","@swc/core":"SWC",bun:"Bun",vitest:"Vitest",jest:"Jest","@playwright/test":"Playwright",cypress:"Cypress",mocha:"Mocha",ava:"AVA",storybook:"Storybook","@storybook/react":"Storybook"};async function mc(t,e,n$1,s,r=Ee){let o=n$1?await n$1.findPackageJsonFiles(t):await j(t),a=[],i=new Map,c;try{let h=n$1?j=>n$1.pathExists(j):p,y=_.join(t,"package.json");if(await h(y))try{let j=n$1?await n$1.readJsonFile(y):await n(y);if(j.packageManager){let C=j.packageManager.split("@")[0]?.toLowerCase();C&&["pnpm","yarn","npm","bun"].includes(C)&&(c=C);}}catch{}c||await h(_.join(t,"pnpm-workspace.yaml"))&&(c="pnpm"),c||(await h(_.join(t,"pnpm-lock.yaml"))?c="pnpm":await h(_.join(t,"yarn.lock"))?c="yarn":await h(_.join(t,"package-lock.json"))?c="npm":await h(_.join(t,"bun.lockb"))&&(c="bun"));}catch{}let l=s??n$1?.projectScanTimeout??18e4,u=typeof on.availableParallelism=="function"?on.availableParallelism():on.cpus().length||4,p$1=Math.max(2,Math.min(16,u*2)),d=new a$1(p$1),f=new Set;if(await Promise.all(o.map(async h=>{try{let y=n$1?await n$1.readJsonFile(h):await n(h),j=[y.dependencies,y.devDependencies,y.peerDependencies,y.optionalDependencies];for(let C of j)if(C)for(let[A,T]of Object.entries(C))co(T)&&f.add(A);}catch{}})),f.size>0)try{await e.prefetch([...f]);}catch{}let g=await Promise.all(o.map(async h=>d.run(async()=>{try{let y=gc(h,t,e,n$1,r),j=await Se(y,l);if(j.ok)return j.value;let C=_.relative(t,_.dirname(h));return n$1&&n$1.addStuckPath(C||"."),console.error(`Timeout scanning ${h} (>${l/1e3}s) \u2014 skipped`),n$1?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects"),null}catch(y){let j=y instanceof Error?y.message:String(y);return console.error(`Error scanning ${h}: ${j}`),null}})));for(let h of g)h&&(a.push(h),i.set(h.name,h.path));for(let h of a){let y=[];for(let j of h.dependencies){let C=i.get(j.package);C&&C!==h.path&&y.push({path:C,name:j.package,refType:"workspace"});}y.length>0&&(h.projectReferences=y),c&&(h.packageManager=c);}return a}async function gc(t,e,n$1,s,r){let o=s?await s.readJsonFile(t):await n(t),a=_.dirname(t),i=_.relative(e,a)||".",c=o.engines?.node??void 0,l,u,p,d;if(c){let v=Yn(r,"nodejs"),b=ve.minVersion(c);if(v&&b){let w=ve.major(b);l=`${v.major}.0.0`,u=Math.max(0,v.major-w);}p=rt(r,"node",c);let S=Ke("node",c);S&&(d=st(r,"nodejs",S));}let f=[{name:"dependencies",deps:o.dependencies},{name:"devDependencies",deps:o.devDependencies},{name:"peerDependencies",deps:o.peerDependencies},{name:"optionalDependencies",deps:o.optionalDependencies}],g=[],h=[],y={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},j=[];for(let v of f)if(v.deps)for(let[b,S]of Object.entries(v.deps))co(S)&&j.push({pkg:b,section:v.name,spec:S});await n$1.prefetch(j.map(v=>v.pkg));let C=j.map(async v=>{let b=await n$1.get(v.pkg);return {...v,meta:b}}),A=await Promise.all(C);for(let{pkg:v,section:b,spec:S,meta:w}of A){let x=w.stableVersions.length>0?ve.maxSatisfying(w.stableVersions,S)??null:null,m=w.latestStableOverall,P=null,L="unknown";if(x&&m){let ne=ve.major(x);P=ve.major(m)-ne,P===0?L=ve.eq(x,m)?"current":"minor-behind":L="major-behind",P===0?y.current++:P===1?y.oneBehind++:y.twoPlusBehind++;}else y.unknown++;let D=ya(x,m,w.releaseDates),ce=ba(D);g.push({package:v,section:b,currentSpec:S,resolvedVersion:x,latestStable:m,majorsBehind:P,drift:L,license:hc(w.license,"registry"),ageDays:D,libyears:ce}),v in Dr&&h.push({name:Dr[v],currentVersion:x,latestVersion:m,majorsBehind:P});}for(let v of f)if(v.deps)for(let[b,S]of Object.entries(v.deps))S.trim().startsWith("workspace:")&&(g.push({package:b,section:v.name,currentSpec:S,resolvedVersion:null,latestStable:null,majorsBehind:null,drift:"unknown",license:{raw:null,spdxId:null,source:"none",confidence:0}}),y.unknown++);g.sort((v,b)=>{let S={"major-behind":0,"minor-behind":1,current:2,unknown:3},w=(S[v.drift]??9)-(S[b.drift]??9);return w!==0?w:v.package.localeCompare(b.package)});let T;try{T=s?await s.countFilesUnder(e,a):void 0;}catch{}return {type:"node",path:i,name:o.name??_.basename(a),runtime:c,runtimeLatest:l,runtimeMajorsBehind:u,runtimeEol:p,runtimeEolDate:d,frameworks:h,dependencies:g,dependencyAgeBuckets:y,libyears:va(g.map(v=>v.libyears))??void 0,fileCount:T}}var yo=new Qe({ignoreAttributes:false,attributeNamePrefix:"@_"}),Vr={"Microsoft.AspNetCore.App":"ASP.NET Core","Microsoft.AspNetCore.Mvc":"ASP.NET Core MVC","Microsoft.AspNetCore.Components":"Blazor","Microsoft.AspNetCore.Components.WebAssembly":"Blazor WASM","Microsoft.AspNetCore.SignalR":"SignalR","Microsoft.AspNetCore.OData":"OData","Microsoft.AspNetCore.Identity":"ASP.NET Identity","Microsoft.AspNetCore.Authentication.JwtBearer":"JWT Bearer Auth","Microsoft.AspNetCore.Diagnostics.HealthChecks":"Health Checks","Swashbuckle.AspNetCore":"Swashbuckle","NSwag.AspNetCore":"NSwag","Microsoft.EntityFrameworkCore":"EF Core","Microsoft.EntityFrameworkCore.SqlServer":"EF Core SQL Server","Microsoft.EntityFrameworkCore.Sqlite":"EF Core SQLite","Microsoft.EntityFrameworkCore.Design":"EF Core Design","Microsoft.EntityFrameworkCore.Tools":"EF Core Tools","Npgsql.EntityFrameworkCore.PostgreSQL":"EF Core PostgreSQL","Pomelo.EntityFrameworkCore.MySql":"EF Core MySQL (Pomelo)","MongoDB.EntityFrameworkCore":"EF Core MongoDB",Dapper:"Dapper","Dapper.Contrib":"Dapper Contrib",NHibernate:"NHibernate",Npgsql:"Npgsql",MySqlConnector:"MySqlConnector","MongoDB.Driver":"MongoDB Driver","StackExchange.Redis":"StackExchange.Redis","Microsoft.Data.SqlClient":"SqlClient","Oracle.ManagedDataAccess.Core":"Oracle (Managed)",Cassandra:"Cassandra Driver","Neo4j.Driver":"Neo4j Driver",Marten:"Marten",LiteDB:"LiteDB","RavenDB.Client":"RavenDB","Microsoft.Extensions.Hosting":".NET Hosting","Microsoft.Extensions.Hosting.Abstractions":".NET Hosting Abstractions","Microsoft.Extensions.DependencyInjection":".NET DI","Microsoft.Extensions.DependencyInjection.Abstractions":".NET DI Abstractions","Microsoft.Extensions.Configuration":".NET Configuration","Microsoft.Extensions.Configuration.Abstractions":".NET Configuration Abstractions","Microsoft.Extensions.Configuration.Binder":".NET Configuration Binder","Microsoft.Extensions.Configuration.EnvironmentVariables":".NET Configuration EnvVars","Microsoft.Extensions.Configuration.Json":".NET Configuration JSON","Microsoft.Extensions.Configuration.UserSecrets":".NET Configuration UserSecrets","Microsoft.Extensions.Logging":".NET Logging","Microsoft.Extensions.Logging.Abstractions":".NET Logging Abstractions","Microsoft.Extensions.Logging.Console":".NET Logging Console","Microsoft.Extensions.Logging.Debug":".NET Logging Debug","Microsoft.Extensions.Logging.EventSource":".NET Logging EventSource","Microsoft.Extensions.Options":".NET Options","Microsoft.Extensions.Options.ConfigurationExtensions":".NET Options Configuration","Microsoft.Extensions.Options.DataAnnotations":".NET Options DataAnnotations","Microsoft.Extensions.Caching.Memory":".NET Memory Cache","Microsoft.Extensions.Caching.Abstractions":".NET Caching Abstractions","Microsoft.Extensions.Caching.StackExchangeRedis":".NET Redis Cache","Microsoft.Extensions.Http":".NET HttpClientFactory","Microsoft.Extensions.Http.Resilience":".NET HttpClient Resilience","Microsoft.Extensions.Resilience":".NET Resilience","Microsoft.Extensions.Diagnostics":".NET Diagnostics","Microsoft.Extensions.Diagnostics.HealthChecks":".NET Health Checks (Extensions)","Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions":".NET Health Checks Abstractions","Microsoft.Extensions.FileProviders.Abstractions":".NET File Providers","Microsoft.Extensions.FileProviders.Physical":".NET File Providers Physical","Microsoft.Extensions.Localization":".NET Localization","Microsoft.Extensions.Localization.Abstractions":".NET Localization Abstractions","Microsoft.Extensions.Primitives":".NET Primitives","System.Text.Json":".NET System.Text.Json","System.Text.Encodings.Web":".NET System.Text.Encodings.Web","System.Net.Http.Json":".NET System.Net.Http.Json","System.ComponentModel.Annotations":".NET ComponentModel Annotations",MediatR:"MediatR",Wolverine:"Wolverine",Brighter:"Brighter",AutoMapper:"AutoMapper",Mapster:"Mapster","Riok.Mapperly":"Mapperly",FluentValidation:"FluentValidation","FluentValidation.AspNetCore":"FluentValidation ASP.NET","Newtonsoft.Json":"Newtonsoft.Json",MessagePack:"MessagePack","protobuf-net":"protobuf-net",CsvHelper:"CsvHelper",Serilog:"Serilog","Serilog.AspNetCore":"Serilog ASP.NET","Serilog.Sinks.Console":"Serilog Console","Serilog.Sinks.Seq":"Serilog Seq","Serilog.Sinks.File":"Serilog File","Serilog.Sinks.Elasticsearch":"Serilog Elasticsearch",NLog:"NLog","NLog.Web.AspNetCore":"NLog ASP.NET",log4net:"log4net",OpenTelemetry:"OpenTelemetry","OpenTelemetry.Extensions.Hosting":"OpenTelemetry Hosting","OpenTelemetry.Instrumentation.AspNetCore":"OpenTelemetry ASP.NET","OpenTelemetry.Exporter.Prometheus":"OpenTelemetry Prometheus","OpenTelemetry.Exporter.Jaeger":"OpenTelemetry Jaeger","OpenTelemetry.Exporter.OpenTelemetryProtocol":"OpenTelemetry OTLP","App.Metrics":"App.Metrics","prometheus-net":"Prometheus.NET","Elastic.Apm":"Elastic APM",xunit:"xUnit","xunit.runner.visualstudio":"xUnit Runner",NUnit:"NUnit",NUnit3TestAdapter:"NUnit Adapter","MSTest.TestFramework":"MSTest","MSTest.TestAdapter":"MSTest Adapter",Moq:"Moq",NSubstitute:"NSubstitute",FakeItEasy:"FakeItEasy",FluentAssertions:"FluentAssertions",Shouldly:"Shouldly",Bogus:"Bogus",AutoFixture:"AutoFixture","WireMock.Net":"WireMock.Net",Testcontainers:"Testcontainers",Respawn:"Respawn",BenchmarkDotNet:"BenchmarkDotNet","coverlet.collector":"Coverlet",SpecFlow:"SpecFlow",TUnit:"TUnit","Verify.Xunit":"Verify",Snapshooter:"Snapshooter",MassTransit:"MassTransit","MassTransit.RabbitMQ":"MassTransit RabbitMQ","MassTransit.Azure.ServiceBus.Core":"MassTransit Azure SB",NServiceBus:"NServiceBus","RabbitMQ.Client":"RabbitMQ Client","Confluent.Kafka":"Confluent Kafka","Azure.Messaging.ServiceBus":"Azure Service Bus","Azure.Messaging.EventHubs":"Azure Event Hubs","Amazon.SQS":"AWS SQS","Amazon.SNS":"AWS SNS",Rebus:"Rebus",EasyNetQ:"EasyNetQ",SlimMessageBus:"SlimMessageBus",CAP:"DotNetCore.CAP","AWSSDK.Core":"AWS SDK Core","AWSSDK.S3":"AWS SDK S3","AWSSDK.SQS":"AWS SDK SQS","AWSSDK.DynamoDBv2":"AWS SDK DynamoDB","AWSSDK.Lambda":"AWS SDK Lambda","AWSSDK.SecretsManager":"AWS SDK Secrets Manager","AWSSDK.CloudWatch":"AWS SDK CloudWatch","Azure.Storage.Blobs":"Azure Blob Storage","Azure.Identity":"Azure Identity","Azure.Security.KeyVault.Secrets":"Azure Key Vault","Azure.Cosmos":"Azure Cosmos DB","Microsoft.Azure.Functions.Worker":"Azure Functions","Google.Cloud.Storage.V1":"GCP Storage","Google.Cloud.PubSub.V1":"GCP Pub/Sub","Google.Cloud.Firestore":"GCP Firestore","Microsoft.Identity.Web":"Microsoft Identity Web","Microsoft.Identity.Client":"MSAL",IdentityServer4:"IdentityServer4","Duende.IdentityServer":"Duende IdentityServer","Microsoft.AspNetCore.Authentication.OpenIdConnect":"OpenID Connect",IdentityModel:"IdentityModel",Refit:"Refit",RestSharp:"RestSharp","Flurl.Http":"Flurl",Polly:"Polly","Polly.Extensions.Http":"Polly HTTP","Microsoft.Extensions.Http.Polly":"HttpClient Polly","Grpc.AspNetCore":"gRPC ASP.NET","Grpc.Net.Client":"gRPC Client","GraphQL.Server.All":"GraphQL Server","HotChocolate.AspNetCore":"Hot Chocolate (GraphQL)",Hangfire:"Hangfire","Hangfire.Core":"Hangfire Core","Hangfire.AspNetCore":"Hangfire ASP.NET",Quartz:"Quartz.NET","Quartz.Extensions.Hosting":"Quartz.NET Hosting",Coravel:"Coravel",EPPlus:"EPPlus",ClosedXML:"ClosedXML",iTextSharp:"iTextSharp",QuestPDF:"QuestPDF",ImageSharp:"ImageSharp","SixLabors.ImageSharp":"ImageSharp","LaunchDarkly.ServerSdk":"LaunchDarkly","Microsoft.FeatureManagement":"Feature Management","Microsoft.FeatureManagement.AspNetCore":"Feature Management ASP.NET","Dapr.Client":"Dapr","Steeltoe.Discovery.ClientCore":"Steeltoe",Ocelot:"Ocelot (API Gateway)","Yarp.ReverseProxy":"YARP","Microsoft.AspNetCore.SignalR.Client":"SignalR Client"};function gs(t){return t.replace(/\\/g,"/")}function yc(t){let e=t.match(/^net(\d+)\.\d+$/);if(e?.[1])return parseInt(e[1],10);let n=t.match(/^netcoreapp(\d+)\.\d+$/);return n?.[1]?parseInt(n[1],10):(t.startsWith("netstandard")||t.match(/^net(\d)(\d+)?$/),null)}function Ur(t){return t.endsWith(".csproj")||t.endsWith(".vbproj")}function ys(t){return _.basename(t).replace(/\.(cs|vb)proj$/i,"")}function bc(t,e){let s=yo.parse(t)?.Project;if(!s)return {targetFrameworks:[],packageReferences:[],projectReferences:[],projectName:ys(e)};let r=Array.isArray(s.PropertyGroup)?s.PropertyGroup:s.PropertyGroup?[s.PropertyGroup]:[],o=[];for(let l of r)if(l.TargetFramework&&o.push(String(l.TargetFramework)),l.TargetFrameworks){let u=String(l.TargetFrameworks).split(";").map(p=>p.trim()).filter(Boolean);o.push(...u);}let a=Array.isArray(s.ItemGroup)?s.ItemGroup:s.ItemGroup?[s.ItemGroup]:[],i=[],c=[];for(let l of a){let u=Array.isArray(l.PackageReference)?l.PackageReference:l.PackageReference?[l.PackageReference]:[];for(let d of u){let f=d["@_Include"]??d["@_include"]??"",g=d["@_Version"]??d["@_version"]??d.Version??"";f&&g&&i.push({name:String(f),version:String(g)});}let p=Array.isArray(l.ProjectReference)?l.ProjectReference:l.ProjectReference?[l.ProjectReference]:[];for(let d of p){let f=d["@_Include"]??d["@_include"]??"";f&&c.push(String(f).replace(/\\/g,"/"));}}return {targetFrameworks:[...new Set(o)],packageReferences:i,projectReferences:c,projectName:ys(e)}}function vc(t){let n=yo.parse(t)?.packages;if(!n)return [];let s=Array.isArray(n.package)?n.package:n.package?[n.package]:[],r=[];for(let o of s){let a=o["@_id"]??o["@_Id"]??"",i=o["@_version"]??o["@_Version"]??"";a&&i&&r.push({name:String(a),version:String(i)});}return r}async function wc(t,e,n,s,r=Ee){let o$1=n?await n.findFiles(t,Ur):await i(t,Ur),a=n?await n.findSolutionFiles(t):await k(t),i$1=new Set;for(let p of a)try{let d=n?await n.readTextFile(p):await o(p),f=_.dirname(p),g=/Project\("[^"]*"\)\s*=\s*"[^"]*",\s*"([^"]+\.(?:cs|vb)proj)"/g,h;for(;(h=g.exec(d))!==null;)if(h[1]){let y=_.resolve(f,h[1].replace(/\\/g,"/"));i$1.add(y);}}catch{}let c=new Set([...o$1,...i$1]),l=[],u=s??n?.projectScanTimeout??18e4;for(let p of c)try{let d=Sc(p,t,e,n,r),f=await Se(d,u);if(f.ok)l.push(f.value);else {let g=gs(_.relative(t,_.dirname(p)));n&&n.addStuckPath(g||"."),console.error(`Timeout scanning ${p} (>${u/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(d){let f=d instanceof Error?d.message:String(d);console.error(`Error scanning ${p}: ${f}`);}return l}async function Sc(t,e,n,s,r){let o$1=s?await s.readTextFile(t):await o(t),a=bc(o$1,t),i=_.dirname(t);{let v=_.join(i,"packages.config");try{let b=s?await s.readTextFile(v):await o(v),S=new Set(a.packageReferences.map(w=>w.name.toLowerCase()));for(let w of vc(b))S.has(w.name.toLowerCase())||(a.packageReferences.push(w),S.add(w.name.toLowerCase()));}catch{}}let c=a.targetFrameworks[0],l=Ht(r,"dotnet")?.major,u,p,d,f=c;if(c){let v=yc(c);v!==null&&l!==void 0&&(u=Math.max(0,l-v)),p=rt(r,"dotnet",c);let b=Ke("dotnet",c);b&&(d=st(r,"dotnet",b));}let g=[],h={current:0,oneBehind:0,twoPlusBehind:0,unknown:0};if(n){let v=a.packageReferences.map(async S=>{let w=await n.get(S.name);return {ref:S,meta:w}}),b=await Promise.all(v);for(let{ref:S,meta:w}of b){let x=ht.valid(S.version)?S.version:null,m=w.latestStableOverall,P=null,L="unknown";if(x&&m){let D=ht.major(x);P=ht.major(m)-D,P===0?L=ht.eq(x,m)?"current":"minor-behind":P>0?L="major-behind":L="current",P<=0?h.current++:P===1?h.oneBehind++:h.twoPlusBehind++;}else h.unknown++;g.push({package:S.name,section:"dependencies",currentSpec:S.version,resolvedVersion:x,latestStable:m,majorsBehind:P,drift:L});}}else for(let v of a.packageReferences)g.push({package:v.name,section:"dependencies",currentSpec:v.version,resolvedVersion:v.version,latestStable:null,majorsBehind:null,drift:"unknown"}),h.unknown++;let y=[],j=new Map(g.map(v=>[v.package,v]));for(let v of a.packageReferences)if(v.name in Vr){let b=j.get(v.name);y.push({name:Vr[v.name],currentVersion:b?.resolvedVersion??v.version,latestVersion:b?.latestStable??null,majorsBehind:b?.majorsBehind??null});}let C=a.projectReferences.map(v=>{let b=_.resolve(i,v),S=gs(_.relative(e,_.dirname(b))),w=ys(b);return {path:S||".",name:w,refType:"project"}}),A;try{A=s?await s.countFilesUnder(e,i):void 0;}catch{}g.sort((v,b)=>{let S={"major-behind":0,"minor-behind":1,current:2,unknown:3},w=(S[v.drift]??9)-(S[b.drift]??9);return w!==0?w:v.package.localeCompare(b.package)});let T=h;return {type:"dotnet",path:gs(_.relative(e,i))||".",name:a.projectName,targetFramework:f,runtime:c,runtimeLatest:l!==void 0?`net${l}.0`:void 0,runtimeMajorsBehind:u,runtimeEol:p,runtimeEolDate:d,frameworks:y,dependencies:g,dependencyAgeBuckets:T,projectReferences:C.length>0?C:void 0,fileCount:A}}var qr={django:"Django",flask:"Flask",fastapi:"FastAPI",starlette:"Starlette",tornado:"Tornado",bottle:"Bottle",sanic:"Sanic",falcon:"Falcon",aiohttp:"aiohttp",quart:"Quart",litestar:"Litestar",robyn:"Robyn",sqlalchemy:"SQLAlchemy","django-rest-framework":"DRF",djangorestframework:"DRF",peewee:"Peewee","tortoise-orm":"Tortoise ORM",sqlmodel:"SQLModel",pony:"Pony ORM",alembic:"Alembic",psycopg2:"psycopg2","psycopg2-binary":"psycopg2",psycopg:"psycopg3",asyncpg:"asyncpg",pymongo:"PyMongo",motor:"Motor",redis:"redis-py",celery:"Celery",boto3:"AWS SDK (boto3)",botocore:"AWS SDK (botocore)",numpy:"NumPy",pandas:"pandas",scipy:"SciPy","scikit-learn":"scikit-learn",tensorflow:"TensorFlow",torch:"PyTorch",keras:"Keras",matplotlib:"Matplotlib",seaborn:"Seaborn",plotly:"Plotly",polars:"Polars",dask:"Dask",xgboost:"XGBoost",lightgbm:"LightGBM",transformers:"Transformers (HF)",langchain:"LangChain",openai:"OpenAI SDK",pytest:"pytest",unittest2:"unittest2",nose2:"nose2",tox:"tox",hypothesis:"Hypothesis","factory-boy":"factory_boy",faker:"Faker",coverage:"Coverage.py",responses:"responses",httpx:"HTTPX",uvicorn:"Uvicorn",gunicorn:"Gunicorn",hypercorn:"Hypercorn",dramatiq:"Dramatiq",rq:"RQ",huey:"Huey",pyjwt:"PyJWT",authlib:"Authlib","python-jose":"python-jose",passlib:"Passlib",cryptography:"cryptography",pydantic:"Pydantic",marshmallow:"Marshmallow",attrs:"attrs",cerberus:"Cerberus",msgpack:"msgpack",protobuf:"protobuf",requests:"Requests",urllib3:"urllib3",ansible:"Ansible",fabric:"Fabric",invoke:"Invoke",paramiko:"Paramiko",black:"Black",ruff:"Ruff",flake8:"Flake8",mypy:"mypy",pylint:"Pylint",isort:"isort",bandit:"Bandit",structlog:"structlog",loguru:"Loguru","sentry-sdk":"Sentry SDK","opentelemetry-api":"OpenTelemetry","prometheus-client":"prometheus-client"};function ks(t){let e=t.trim();if(!e||e.startsWith("#")||e.startsWith("-"))return null;let s=e.split(";")[0].trim().match(/^([A-Za-z0-9][-A-Za-z0-9_.]*[A-Za-z0-9]?)(?:\[.*?\])?\s*(.*)?$/);if(!s)return null;let r=s[1],o=(s[2]??"").trim(),a=r.toLowerCase().replace(/[_.]+/g,"-");return {name:r,spec:o,normalisedName:a}}function kc(t){return t.match(/^==\s*([^\s,;]+)/)?.[1]??null}function Ec(t){let e=t.replace(/^[vV]/,"").trim();if(/(?:a\d|b\d|rc\d|alpha|beta|dev|post)/i.test(e))return null;let n=e.split(".");for(;n.length<3;)n.push("0");return e=n.slice(0,3).join("."),mt.valid(e)}function jc(t){let e=[];for(let n of t.split(`
|
|
52
|
+
`)){let s=ks(n);s&&e.push(s);}return e}function xc(t){let e={dependencies:[]},n=t.match(/^\s*name\s*=\s*"([^"]+)"/m);n&&(e.projectName=n[1]);let s=t.match(/^\s*requires-python\s*=\s*"([^"]+)"/m);s&&(e.pythonVersion=s[1]);let r=t.match(/^\s*dependencies\s*=\s*\[([\s\S]*?)\]/m);if(r){let a=r[1],i=/"([^"]+)"/g,c;for(;(c=i.exec(a))!==null;){let l=ks(c[1]);l&&e.dependencies.push(l);}}let o=t.match(/\[tool\.poetry\.dependencies\]([\s\S]*?)(?=\n\s*\[|\n*$)/);if(o){let a=o[1].split(`
|
|
53
|
+
`);for(let i of a){let c=i.match(/^\s*([A-Za-z0-9][-A-Za-z0-9_.]*)\s*=\s*(?:"([^"]+)"|{.*?version\s*=\s*"([^"]+)".*?})/);if(c){let l=c[1];if(l.toLowerCase()==="python"){e.pythonVersion=c[2]??c[3]??void 0;continue}let u=c[2]??c[3]??"",p=l.toLowerCase().replace(/[_.]+/g,"-");e.dependencies.push({name:l,spec:u?`==${u}`:"",normalisedName:p});}}}return e}function Tc(t){let e=[],n=t.match(/\[packages\]([\s\S]*?)(?=\n\s*\[|\n*$)/);if(n){let r=n[1].split(`
|
|
54
|
+
`);for(let o of r){let a=o.match(/^\s*([A-Za-z0-9][-A-Za-z0-9_.]*)\s*=\s*(?:"([^"]+)"|{.*?version\s*=\s*"([^"]+)".*?}|\*|"[*]")/);if(a){let i=a[1],c=a[2]??a[3]??"",l=i.toLowerCase().replace(/[_.]+/g,"-");e.push({name:i,spec:c||"*",normalisedName:l});}}}let s=t.match(/\[dev-packages\]([\s\S]*?)(?=\n\s*\[|\n*$)/);if(s){let r=s[1].split(`
|
|
55
|
+
`);for(let o of r){let a=o.match(/^\s*([A-Za-z0-9][-A-Za-z0-9_.]*)\s*=\s*(?:"([^"]+)"|{.*?version\s*=\s*"([^"]+)".*?}|\*|"[*]")/);if(a){let i=a[1],c=a[2]??a[3]??"",l=i.toLowerCase().replace(/[_.]+/g,"-");e.push({name:i,spec:c||"*",normalisedName:l});}}}return e}function Cc(t){let e={deps:[]},n=t.match(/\[metadata\]([\s\S]*?)(?=\n\s*\[|\n*$)/);if(n){let r=n[1].match(/^\s*name\s*=\s*(.+)$/m);r&&(e.name=r[1].trim());}let s=t.match(/\[options\]([\s\S]*?)(?=\n\s*\[|\n*$)/);if(s){let r=s[1].match(/^\s*python_requires\s*=\s*(.+)$/m);r&&(e.pythonVersion=r[1].trim());let o=s[1].match(/install_requires\s*=\s*\n((?:\s+.*\n?)*)/);if(o){let a=o[1];for(let i of a.split(`
|
|
56
|
+
`)){let c=ks(i);c&&e.deps.push(c);}}}return e}var bo=new Set(["requirements.txt","requirements-dev.txt","requirements_dev.txt","requirements-test.txt","dev-requirements.txt","pyproject.toml","setup.py","setup.cfg","Pipfile"]);async function Ac(t,e,n,s,r=Ee){let o=n?await n.findFiles(t,l=>bo.has(l)||/^requirements.*\.txt$/.test(l)):await Pc(t),a=new Map;for(let l of o){let u=_.dirname(l);a.has(u)||a.set(u,[]),a.get(u).push(l);}let i=[],c=s??n?.projectScanTimeout??18e4;for(let[l,u]of a)try{let p=Mc(l,u,t,e,n,r),d=await Se(p,c);if(d.ok)i.push(d.value);else {let f=_.relative(t,l);n&&n.addStuckPath(f||"."),console.error(`Timeout scanning Python project ${l} (>${c/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(p){let d=p instanceof Error?p.message:String(p);console.error(`Error scanning Python project ${l}: ${d}`);}return i}async function Pc(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>bo.has(n)||/^requirements.*\.txt$/.test(n))}async function Mc(t,e,n,s,r,o$1){let a=_.relative(n,t)||".",i=_.basename(t===n?n:t),c,l=new Map;for(let v of e){let b=_.basename(v),S=r?await r.readTextFile(v):await o(v);if(b==="pyproject.toml"){let w=xc(S);w.projectName&&(i=w.projectName),w.pythonVersion&&(c=w.pythonVersion);for(let x of w.dependencies)l.has(x.normalisedName)||l.set(x.normalisedName,x);}else if(b==="setup.cfg"){let w=Cc(S);w.name&&(i=w.name),w.pythonVersion&&!c&&(c=w.pythonVersion);for(let x of w.deps)l.has(x.normalisedName)||l.set(x.normalisedName,x);}else if(b==="Pipfile")for(let w of Tc(S))l.has(w.normalisedName)||l.set(w.normalisedName,w);else if(b.startsWith("requirements")&&b.endsWith(".txt"))for(let w of jc(S))l.has(w.normalisedName)||l.set(w.normalisedName,w);}let u,p,d,f;if(c){let v=c.match(/(\d+)\.(\d+)/);if(v){let S=parseInt(v[1],10),w=parseInt(v[2],10),x=Ht(o$1,"python");x&&(S===x.major?u=Math.max(0,x.minor-w):S<x.major&&(u=x.minor+(x.major-S)*10),p=`${x.major}.${x.minor}`);}d=rt(o$1,"python",c);let b=Ke("python",c);b&&(f=st(o$1,"python",b));}let g=[],h=[],y={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},C=[...l.values()].map(async v=>{let b=await s.get(v.normalisedName);return {dep:v,meta:b}}),A=await Promise.all(C);for(let{dep:v,meta:b}of A){let S=kc(v.spec),w=S?Ec(S):null,x=b.latestStableOverall,m=null,P="unknown";if(w&&x){let L=mt.major(w);m=mt.major(x)-L,m===0?P=mt.eq(w,x)?"current":"minor-behind":m>0?P="major-behind":P="current",m<=0?y.current++:m===1?y.oneBehind++:y.twoPlusBehind++;}else y.unknown++;g.push({package:v.name,section:"dependencies",currentSpec:v.spec||"*",resolvedVersion:w,latestStable:x,majorsBehind:m,drift:P}),v.normalisedName in qr&&h.push({name:qr[v.normalisedName],currentVersion:w,latestVersion:x,majorsBehind:m});}g.sort((v,b)=>{let S={"major-behind":0,"minor-behind":1,current:2,unknown:3},w=(S[v.drift]??9)-(S[b.drift]??9);return w!==0?w:v.package.localeCompare(b.package)});let T;try{T=r?await r.countFilesUnder(n,t):void 0;}catch{}return {type:"python",path:a,name:i,runtime:c,runtimeLatest:p,runtimeMajorsBehind:u,runtimeEol:d,runtimeEolDate:f,frameworks:h,dependencies:g,dependencyAgeBuckets:y,fileCount:T}}var $c=new Qe({ignoreAttributes:false,attributeNamePrefix:"@_"}),Gr={"org.springframework.boot:spring-boot-starter-web":"Spring Boot Web","org.springframework.boot:spring-boot-starter":"Spring Boot","org.springframework.boot:spring-boot-starter-data-jpa":"Spring Data JPA","org.springframework.boot:spring-boot-starter-security":"Spring Security","org.springframework.boot:spring-boot-starter-webflux":"Spring WebFlux","org.springframework.boot:spring-boot-starter-actuator":"Spring Actuator","org.springframework.boot:spring-boot-starter-test":"Spring Boot Test","org.springframework:spring-core":"Spring Framework","org.springframework:spring-web":"Spring Web","org.springframework:spring-webmvc":"Spring MVC","org.springframework.cloud:spring-cloud-starter-netflix-eureka-client":"Spring Cloud Eureka","org.springframework.cloud:spring-cloud-starter-gateway":"Spring Cloud Gateway","org.springframework.kafka:spring-kafka":"Spring Kafka","jakarta.platform:jakarta.jakartaee-api":"Jakarta EE","jakarta.servlet:jakarta.servlet-api":"Jakarta Servlet","javax.servlet:javax.servlet-api":"Java Servlet (Legacy)","io.micronaut:micronaut-core":"Micronaut","io.micronaut:micronaut-http-server-netty":"Micronaut HTTP","io.quarkus:quarkus-core":"Quarkus","io.quarkus:quarkus-resteasy":"Quarkus RESTEasy","io.quarkus:quarkus-resteasy-reactive":"Quarkus RESTEasy Reactive","io.vertx:vertx-core":"Vert.x","io.vertx:vertx-web":"Vert.x Web","org.hibernate.orm:hibernate-core":"Hibernate","org.hibernate:hibernate-core":"Hibernate","org.mybatis:mybatis":"MyBatis","org.mybatis.spring.boot:mybatis-spring-boot-starter":"MyBatis Spring Boot","org.jooq:jooq":"jOOQ","org.flywaydb:flyway-core":"Flyway","org.liquibase:liquibase-core":"Liquibase","com.zaxxer:HikariCP":"HikariCP","org.postgresql:postgresql":"PostgreSQL JDBC","com.mysql:mysql-connector-j":"MySQL Connector","mysql:mysql-connector-java":"MySQL Connector (Legacy)","com.oracle.database.jdbc:ojdbc11":"Oracle JDBC","org.mongodb:mongodb-driver-sync":"MongoDB Driver","io.lettuce:lettuce-core":"Lettuce (Redis)","redis.clients:jedis":"Jedis (Redis)","org.apache.kafka:kafka-clients":"Apache Kafka","com.rabbitmq:amqp-client":"RabbitMQ Client","software.amazon.awssdk:sqs":"AWS SQS","software.amazon.awssdk:sns":"AWS SNS","com.squareup.okhttp3:okhttp":"OkHttp","com.squareup.retrofit2:retrofit":"Retrofit","org.apache.httpcomponents.client5:httpclient5":"Apache HttpClient 5","io.grpc:grpc-netty":"gRPC","com.graphql-java:graphql-java":"GraphQL Java","com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter":"Netflix DGS","com.fasterxml.jackson.core:jackson-databind":"Jackson","com.google.code.gson:gson":"Gson","junit:junit":"JUnit 4","org.junit.jupiter:junit-jupiter":"JUnit 5","org.junit.jupiter:junit-jupiter-api":"JUnit 5","org.mockito:mockito-core":"Mockito","org.assertj:assertj-core":"AssertJ","org.testcontainers:testcontainers":"Testcontainers","io.rest-assured:rest-assured":"REST Assured","org.awaitility:awaitility":"Awaitility","com.tngtech.archunit:archunit-junit5":"ArchUnit","org.hamcrest:hamcrest":"Hamcrest","org.slf4j:slf4j-api":"SLF4J","ch.qos.logback:logback-classic":"Logback","org.apache.logging.log4j:log4j-core":"Log4j2","org.projectlombok:lombok":"Lombok","org.mapstruct:mapstruct":"MapStruct","software.amazon.awssdk:bom":"AWS SDK v2","com.google.cloud:google-cloud-bom":"Google Cloud SDK","com.azure:azure-sdk-bom":"Azure SDK","io.jsonwebtoken:jjwt-api":"JJWT","com.nimbusds:nimbus-jose-jwt":"Nimbus JOSE+JWT","io.micrometer:micrometer-core":"Micrometer","io.opentelemetry:opentelemetry-api":"OpenTelemetry","io.prometheus:simpleclient":"Prometheus Client","io.projectreactor:reactor-core":"Project Reactor","io.reactivex.rxjava3:rxjava":"RxJava 3"};function Lc(t,e){let s=$c.parse(t)?.project;if(!s)return {artifactId:_.basename(_.dirname(e)),dependencies:[],modules:[],properties:{}};let r={};if(s.properties&&typeof s.properties=="object")for(let[h,y]of Object.entries(s.properties))(typeof y=="string"||typeof y=="number")&&(r[h]=String(y));let o,a=["java.version","maven.compiler.source","maven.compiler.target","maven.compiler.release","java.source.version"];for(let h of a)if(r[h]){o=String(r[h]);break}let i=s.dependencies,l=(i?.dependency?Array.isArray(i.dependency)?i.dependency:[i.dependency]:[]).filter(h=>h.groupId&&h.artifactId).map(h=>({groupId:It(String(h.groupId??""),r),artifactId:It(String(h.artifactId??""),r),version:It(String(h.version??""),r),scope:h.scope?String(h.scope):void 0})),u=s.dependencyManagement?.dependencies,p=u?.dependency?Array.isArray(u.dependency)?u.dependency:[u.dependency]:[];for(let h of p)h.groupId&&h.artifactId&&h.version&&l.push({groupId:It(String(h.groupId),r),artifactId:It(String(h.artifactId),r),version:It(String(h.version),r),scope:h.scope?String(h.scope):void 0});let f=(s.modules?.module?Array.isArray(s.modules.module)?s.modules.module:[s.modules.module]:[]).map(String),g;return s.parent?.groupId&&s.parent?.artifactId&&(g={groupId:String(s.parent.groupId),artifactId:String(s.parent.artifactId),version:String(s.parent.version??"")}),{groupId:s.groupId?String(s.groupId):g?.groupId,artifactId:String(s.artifactId??_.basename(_.dirname(e))),version:s.version?String(s.version):g?.version,packaging:s.packaging?String(s.packaging):void 0,javaVersion:o,dependencies:l,modules:f,parent:g,properties:r}}function It(t,e){return t.replace(/\$\{([^}]+)\}/g,(n,s)=>e[s]??`\${${s}}`)}function Nc(t,e){let n=[],s=_.basename(_.dirname(e)),r,o=t.match(/(?:sourceCompatibility|targetCompatibility|javaVersion)\s*[=:]\s*['"]?(?:JavaVersion\.VERSION_)?(\d+)['"]?/);o&&(r=o[1]);let a=t.match(/JavaLanguageVersion\.of\((\d+)\)/);a&&(r=a[1]);let i=/(?:implementation|api|compileOnly|runtimeOnly|testImplementation|testRuntimeOnly|annotationProcessor|kapt)\s*(?:\(?\s*)?['"]([^'"]+)['"]/g,c;for(;(c=i.exec(t))!==null;){let p=c[1].split(":");p.length>=2&&n.push({groupId:p[0],artifactId:p[1],version:p[2]??"",configuration:c[0].split(/\s/)[0]});}let l=/(?:implementation|api|compileOnly|runtimeOnly|testImplementation|testRuntimeOnly|annotationProcessor|kapt)\s*\(\s*"([^"]+)"\s*\)/g;for(;(c=l.exec(t))!==null;){let p=c[1].split(":");if(p.length>=2){let d=`${p[0]}:${p[1]}`;n.some(f=>`${f.groupId}:${f.artifactId}`===d)||n.push({groupId:p[0],artifactId:p[1],version:p[2]??"",configuration:c[0].split(/\s/)[0]});}}let u=/(?:implementation|api)\s*(?:\(?\s*)?platform\s*\(\s*['"]([^'"]+)['"]\s*\)/g;for(;(c=u.exec(t))!==null;){let p=c[1].split(":");p.length>=2&&n.push({groupId:p[0],artifactId:p[1],version:p[2]??"",configuration:"platform"});}return {javaVersion:r,dependencies:n,projectName:s}}function Rc(t){let e=t.trim();if(!e||e.includes("$")||/(?:-SNAPSHOT|-alpha|-beta|-rc|-M\d|-CR\d)/i.test(e))return null;e=e.replace(/\.(?:RELEASE|Final|GA)$/i,"");let n=e.split(".");for(;n.length<3;)n.push("0");return e=n.slice(0,3).join("."),gt.valid(e)}var vo=new Set(["pom.xml","build.gradle","build.gradle.kts"]);async function Ic(t,e,n,s,r=Ee){let o=n?await n.findFiles(t,u=>vo.has(u)):await _c(t),a=new Map;for(let u of o){let p=_.dirname(u);a.has(p)||a.set(p,[]),a.get(p).push(u);}let i=[],c=s??n?.projectScanTimeout??18e4;for(let[u,p]of a)try{let d=Fc(u,p,t,e,n,r),f=await Se(d,c);if(f.ok)i.push(f.value);else {let g=_.relative(t,u);n&&n.addStuckPath(g||"."),console.error(`Timeout scanning Java project ${u} (>${c/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(d){let f=d instanceof Error?d.message:String(d);console.error(`Error scanning Java project ${u}: ${f}`);}let l=new Map;for(let u of i)l.set(u.name,u.path);return i}async function _c(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>vo.has(n))}async function Fc(t,e,n,s,r,o$1){let a=_.relative(n,t)||".",i=_.basename(t===n?n:t),c,l=new Map,u=[];for(let S of e){let w=_.basename(S),x=r?await r.readTextFile(S):await o(S);if(w==="pom.xml"){let m=Lc(x,S);m.artifactId&&(i=m.artifactId),m.javaVersion&&(c=m.javaVersion);for(let P of m.dependencies){let L=`${P.groupId}:${P.artifactId}`;!l.has(L)&&P.version&&!P.version.includes("${")&&l.set(L,P);}for(let P of m.modules)u.push({path:_.join(a,P),name:P,refType:"project"});}else if(w==="build.gradle"||w==="build.gradle.kts"){let m=Nc(x,S);m.projectName&&(i=m.projectName),m.javaVersion&&(c=m.javaVersion);for(let P of m.dependencies){let L=`${P.groupId}:${P.artifactId}`;!l.has(L)&&P.version&&l.set(L,P);}}}let p,d,f,g=Yn(o$1,"java")?.major,h=g!==void 0?String(g):void 0;if(c){let S=c.match(/^(1\.)?(\d+)/);if(S){let x=(S[1],parseInt(S[2],10));g!==void 0&&(p=Math.max(0,g-x));}d=rt(o$1,"java",c);let w=Ke("java",c);w&&(f=st(o$1,"java",w));}let y=[],j=[],C={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},T=[...l.entries()].map(async([S,w])=>{let x=await s.get(w.groupId,w.artifactId);return {key:S,dep:w,meta:x}}),v=await Promise.all(T);for(let{key:S,dep:w,meta:x}of v){let m=Rc(w.version),P=x.latestStableOverall,L=null,D="unknown";if(m&&P){let ce=gt.major(m);L=gt.major(P)-ce,L===0?D=gt.eq(m,P)?"current":"minor-behind":L>0?D="major-behind":D="current",L<=0?C.current++:L===1?C.oneBehind++:C.twoPlusBehind++;}else C.unknown++;y.push({package:S,section:"dependencies",currentSpec:w.version,resolvedVersion:m,latestStable:P,majorsBehind:L,drift:D}),S in Gr&&j.push({name:Gr[S],currentVersion:m,latestVersion:P,majorsBehind:L});}y.sort((S,w)=>{let x={"major-behind":0,"minor-behind":1,current:2,unknown:3},m=(x[S.drift]??9)-(x[w.drift]??9);return m!==0?m:S.package.localeCompare(w.package)});let b;try{b=r?await r.countFilesUnder(n,t):void 0;}catch{}return {type:"java",path:a,name:i,runtime:c?`Java ${c}`:void 0,runtimeLatest:h,runtimeMajorsBehind:p,runtimeEol:d,runtimeEolDate:f,targetFramework:c?`Java ${c}`:void 0,frameworks:j,dependencies:y,dependencyAgeBuckets:C,projectReferences:u.length>0?u:void 0,fileCount:b}}var Hr={rails:"Ruby on Rails",sinatra:"Sinatra",hanami:"Hanami",padrino:"Padrino",roda:"Roda",grape:"Grape",cuba:"Cuba",camping:"Camping",ramaze:"Ramaze","jsonapi-resources":"JSONAPI::Resources",active_model_serializers:"AMS",blueprinter:"Blueprinter",alba:"Alba","grape-entity":"Grape Entity",jbuilder:"Jbuilder",graphql:"GraphQL Ruby",activerecord:"ActiveRecord",sequel:"Sequel","rom-rb":"ROM",mongoid:"Mongoid",redis:"redis-rb",pg:"pg (PostgreSQL)",mysql2:"mysql2",sqlite3:"sqlite3",sidekiq:"Sidekiq",resque:"Resque",delayed_job:"Delayed Job",good_job:"GoodJob",solid_queue:"Solid Queue",que:"Que",rspec:"RSpec","rspec-rails":"RSpec Rails",minitest:"Minitest",capybara:"Capybara",factory_bot:"FactoryBot",factory_bot_rails:"FactoryBot Rails",faker:"Faker","shoulda-matchers":"Shoulda Matchers",vcr:"VCR",webmock:"WebMock",simplecov:"SimpleCov",cucumber:"Cucumber",devise:"Devise",omniauth:"OmniAuth",pundit:"Pundit",cancancan:"CanCanCan",rodauth:"Rodauth",jwt:"JWT",doorkeeper:"Doorkeeper","turbo-rails":"Turbo","stimulus-rails":"Stimulus","importmap-rails":"Importmap Rails",sprockets:"Sprockets",webpacker:"Webpacker","cssbundling-rails":"CSS Bundling","jsbundling-rails":"JS Bundling","tailwindcss-rails":"Tailwind CSS Rails",propshaft:"Propshaft",faraday:"Faraday",httparty:"HTTParty","rest-client":"REST Client",typhoeus:"Typhoeus",httpx:"HTTPX",puma:"Puma",unicorn:"Unicorn",thin:"Thin",passenger:"Passenger",falcon:"Falcon",capistrano:"Capistrano",kamal:"Kamal",mina:"Mina","sentry-ruby":"Sentry","sentry-rails":"Sentry Rails",newrelic_rpm:"New Relic",datadog:"Datadog",lograge:"Lograge",rubocop:"RuboCop","rubocop-rails":"RuboCop Rails","rubocop-rspec":"RuboCop RSpec","rubocop-performance":"RuboCop Performance",brakeman:"Brakeman","bundler-audit":"Bundler Audit",standard:"Standard",kaminari:"Kaminari",pagy:"Pagy",ransack:"Ransack",searchkick:"Searchkick","elasticsearch-rails":"Elasticsearch Rails",carrierwave:"CarrierWave",shrine:"Shrine",active_storage:"Active Storage",activeadmin:"ActiveAdmin",administrate:"Administrate",avo:"Avo",aasm:"AASM",statesman:"Statesman",dotenv:"dotenv",figaro:"Figaro"};function Oc(t){let e=t.trim();if(!e||e.startsWith("#"))return null;let n=e.match(/^\s*gem\s+['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"])?/);if(!n)return null;let s=n[1],r=n[2]??"*";return {name:s,spec:r}}function Bc(t){if(t==="*")return null;let e=t.match(/(?:~>|>=|>|=|<=|<)?\s*(\d+(?:\.\d+)*)/);return e?e[1]:null}function Dc(t){let e=t.trim();if(/(?:\.pre|\.rc|\.beta|\.alpha|\.dev)/i.test(e))return null;let n=e.split(".");if(n.length<2)return null;for(;n.length<3;)n.push("0");let s=n.slice(0,3).join(".");return yt.valid(s)}function Vc(t){let e=[],n="default",s=[];for(let r of t.split(/\r?\n/)){let o=r.trim(),a=o.match(/^\s*group\s+:(\w+)/);if(a){s.push(n);let u=a[1].toLowerCase();u==="development"||u==="dev"?n="development":u==="test"&&(n="test");}if(o==="end"&&s.length>0){n=s.pop();continue}let i=Oc(o);if(!i)continue;let c=n,l=o.match(/group:\s*(?::(\w+)|\[([^\]]+)\])/);if(l){let u=(l[1]??l[2]??"").toLowerCase();u.includes("development")||u.includes("dev")?c="development":u.includes("test")&&(c="test");}e.push({name:i.name,spec:i.spec,group:c});}return e}function Uc(t){let e=[];for(let n of t.split(/\r?\n/)){let r=n.trim().match(/\.add_(runtime_|development_)?dependency\s+['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"])?/);if(!r)continue;let o=r[1]??"runtime_",a=r[2],i=r[3]??"*";e.push({name:a,spec:i,group:o.startsWith("development")?"development":"default"});}return e}function qc(t){return t.match(/^\s*ruby\s+['"]([^'"]+)['"]/m)?.[1]}var wo=new Set(["Gemfile"]);function Es(t){return t.endsWith(".gemspec")}async function Gc(t,e,n,s,r=Ee){let o=n?await n.findFiles(t,l=>wo.has(l)||Es(l)):await Hc(t),a=new Map;for(let l of o){let u=_.dirname(l);a.has(u)||a.set(u,[]),a.get(u).push(l);}let i=[],c=s??n?.projectScanTimeout??18e4;for(let[l,u]of a)try{let p=Wc(l,u,t,e,n,r),d=await Se(p,c);if(d.ok)i.push(d.value);else {let f=_.relative(t,l);n&&n.addStuckPath(f||"."),console.error(`Timeout scanning Ruby project ${l} (>${c/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(p){let d=p instanceof Error?p.message:String(p);console.error(`Error scanning Ruby project ${l}: ${d}`);}return i}async function Hc(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>wo.has(n)||Es(n))}async function Wc(t,e,n,s,r,o$1){let a=_.relative(n,t)||".",i=_.basename(t===n?n:t),c,l=new Map;for(let v of e){let b=_.basename(v),S=r?await r.readTextFile(v):await o(v);if(b==="Gemfile"){let w=qc(S);w&&(c=w);for(let x of Vc(S))l.has(x.name)||l.set(x.name,x);}else if(Es(b)){let w=b.replace(/\.gemspec$/,"");w&&(i=w);for(let x of Uc(S))l.has(x.name)||l.set(x.name,x);}}let u,p,d,f;if(c){let v=c.match(/(\d+)\.(\d+)/);if(v){let S=parseInt(v[1],10),w=parseInt(v[2],10),x=Ht(o$1,"ruby");x&&(S===x.major?u=Math.max(0,x.minor-w):S<x.major&&(u=x.minor+(x.major-S)*10),p=`${x.major}.${x.minor}`);}d=rt(o$1,"ruby",c);let b=Ke("ruby",c);b&&(f=st(o$1,"ruby",b));}let g=[],h=[],y={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},C=[...l.values()].map(async v=>{let b=await s.get(v.name);return {dep:v,meta:b}}),A=await Promise.all(C);for(let{dep:v,meta:b}of A){let S=Bc(v.spec),w=S?Dc(S):null,x=b.latestStableOverall,m=null,P="unknown";if(w&&x){let D=yt.major(w);m=yt.major(x)-D,m===0?P=yt.eq(w,x)?"current":"minor-behind":m>0?P="major-behind":P="current",m<=0?y.current++:m===1?y.oneBehind++:y.twoPlusBehind++;}else y.unknown++;let L=v.group==="development"||v.group==="test"?"devDependencies":"dependencies";g.push({package:v.name,section:L,currentSpec:v.spec,resolvedVersion:w,latestStable:x,majorsBehind:m,drift:P}),v.name in Hr&&h.push({name:Hr[v.name],currentVersion:w,latestVersion:x,majorsBehind:m});}g.sort((v,b)=>{let S={"major-behind":0,"minor-behind":1,current:2,unknown:3},w=(S[v.drift]??9)-(S[b.drift]??9);return w!==0?w:v.package.localeCompare(b.package)});let T;try{T=r?await r.countFilesUnder(n,t):void 0;}catch{}return {type:"ruby",path:a,name:i,runtime:c,runtimeLatest:p,runtimeMajorsBehind:u,runtimeEol:d,runtimeEolDate:f,frameworks:h,dependencies:g,dependencyAgeBuckets:y,fileCount:T}}var Wr={vapor:"Vapor",hummingbird:"Hummingbird",perfect:"Perfect",kitura:"Kitura",alamofire:"Alamofire",moya:"Moya","apollo-ios":"Apollo iOS",fluent:"Fluent","sqlite.swift":"SQLite.swift","realm-swift":"Realm Swift","grdb.swift":"GRDB.swift",kingfisher:"Kingfisher",snapkit:"SnapKit",sdwebimage:"SDWebImage",rxswift:"RxSwift",combine:"Combine",reactiveswift:"ReactiveSwift",quick:"Quick",nimble:"Nimble",snapshotTesting:"SnapshotTesting",swiftlog:"SwiftLog",cocoalumberjack:"CocoaLumberjack",swinject:"Swinject",needle:"Needle",swiftyjson:"SwiftyJSON",promisekit:"PromiseKit",then:"Then"},ct={major:6,minor:0};function zc(t){let e=[],n=/\.package\s*\(\s*url:\s*"([^"]+)"[^)]*?(from|exact|upToNextMajor|revision|branch):\s*"([^"]+)"/g,s;for(;(s=n.exec(t))!==null;){let r=s[1],o=s[2],a=s[3],c=r.match(/\/([^/]+?)(\.git)?$/)?.[1]??r,l="range",u=a;o==="exact"?l="exact":o==="branch"?l="branch":o==="revision"&&(l="revision"),e.push({name:c,url:r,version:u,type:l});}return e}function Jc(t){let e=new Map;try{let n=JSON.parse(t);if(!n.pins)return e;for(let s of n.pins)!s.identity||!s.state?.version||e.set(s.identity.toLowerCase(),s.state.version);}catch{}return e}function Kc(t){return t.match(/\/\/\s*swift-tools-version:\s*(\d+\.\d+)/i)?.[1]}var So=new Set(["Package.swift"]);async function Qc(t,e,n,s){let r=n?await n.findFiles(t,i=>So.has(i)):await Yc(t),o=[],a=s??n?.projectScanTimeout??18e4;for(let i of r){let c=_.dirname(i);try{let l=Xc(c,i,t,e,n),u=await Se(l,a);if(u.ok)o.push(u.value);else {let p=_.relative(t,c);n&&n.addStuckPath(p||"."),console.error(`Timeout scanning Swift project ${c} (>${a/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(l){let u=l instanceof Error?l.message:String(l);console.error(`Error scanning Swift project ${c}: ${u}`);}}return o}async function Yc(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>So.has(n))}async function Xc(t,e,n,s,r){let o$1=_.relative(n,t)||".",a=_.basename(t===n?n:t),i=r?await r.readTextFile(e):await o(e),c=Kc(i),l=zc(i),u=_.join(t,"Package.resolved"),p=new Map;try{let T=r?await r.readTextFile(u):await o(u);p=Jc(T);}catch{}let d,f;if(c){let T=c.match(/(\d+)\.(\d+)/);if(T){let v=parseInt(T[1],10),b=parseInt(T[2],10);v===ct.major?d=Math.max(0,ct.minor-b):v<ct.major&&(d=(ct.major-v)*10+ct.minor),f=`${ct.major}.${ct.minor}`;}}let g=[],h=[],y={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},j=l.map(async T=>{let v=await s.get(T.url);return {dep:T,meta:v}}),C=await Promise.all(j);for(let{dep:T,meta:v}of C){let b=p.get(T.name.toLowerCase())??(T.type==="exact"?T.version:null),S=b?xe.valid(xe.clean(b)):null,w=v.latestStableOverall,x=null,m="unknown";if(S&&w){let L=xe.major(S);x=xe.major(w)-L,x===0?m=xe.eq(S,w)?"current":"minor-behind":x>0?m="major-behind":m="current",x<=0?y.current++:x===1?y.oneBehind++:y.twoPlusBehind++;}else y.unknown++;g.push({package:T.name,section:"dependencies",currentSpec:T.version,resolvedVersion:S,latestStable:w,majorsBehind:x,drift:m});let P=T.name.toLowerCase();P in Wr&&h.push({name:Wr[P],currentVersion:S,latestVersion:w,majorsBehind:x});}g.sort((T,v)=>{let b={"major-behind":0,"minor-behind":1,current:2,unknown:3},S=(b[T.drift]??9)-(b[v.drift]??9);return S!==0?S:T.package.localeCompare(v.package)});let A;try{A=r?await r.countFilesUnder(n,t):void 0;}catch{}return {type:"swift",path:o$1,name:a,runtime:c,runtimeLatest:f,runtimeMajorsBehind:d,frameworks:h,dependencies:g,dependencyAgeBuckets:y,fileCount:A}}var zr={"github.com/gin-gonic/gin":"Gin","github.com/labstack/echo":"Echo","github.com/gofiber/fiber":"Fiber","github.com/gorilla/mux":"Gorilla Mux","github.com/go-chi/chi":"Chi","github.com/beego/beego":"Beego","github.com/revel/revel":"Revel","k8s.io/kubernetes":"Kubernetes","k8s.io/client-go":"Kubernetes Client","github.com/prometheus/prometheus":"Prometheus","github.com/prometheus/client_golang":"Prometheus Client","go.etcd.io/etcd":"etcd","github.com/hashicorp/consul":"Consul","github.com/hashicorp/vault":"Vault","github.com/traefik/traefik":"Traefik","github.com/istio/istio":"Istio","gorm.io/gorm":"GORM","github.com/jmoiron/sqlx":"sqlx","github.com/go-sql-driver/mysql":"MySQL Driver","github.com/lib/pq":"PostgreSQL Driver","go.mongodb.org/mongo-driver":"MongoDB Driver","github.com/redis/go-redis":"Redis Client","github.com/go-redis/redis":"go-redis","google.golang.org/grpc":"gRPC","google.golang.org/protobuf":"Protobuf","github.com/grpc-ecosystem/grpc-gateway":"gRPC Gateway","github.com/stretchr/testify":"Testify","github.com/onsi/ginkgo":"Ginkgo","github.com/onsi/gomega":"Gomega","github.com/golang/mock":"GoMock","go.uber.org/zap":"Zap","github.com/sirupsen/logrus":"Logrus","github.com/rs/zerolog":"Zerolog","github.com/spf13/viper":"Viper","github.com/spf13/cobra":"Cobra","github.com/urfave/cli":"urfave/cli","github.com/go-resty/resty":"Resty","github.com/json-iterator/go":"jsoniter","gopkg.in/yaml.v3":"YAML v3","github.com/segmentio/kafka-go":"kafka-go","github.com/rabbitmq/amqp091-go":"RabbitMQ","github.com/nats-io/nats.go":"NATS","github.com/google/uuid":"UUID","github.com/spf13/cast":"Cast","github.com/pkg/errors":"pkg/errors"};function Zc(t){let e=[],n,s=false;for(let r of t.split(/\r?\n/)){let o=r.trim();if(o.startsWith("go ")){let l=o.match(/^go\s+(\d+\.\d+)/);l&&(n=l[1]);continue}if(o.startsWith("require (")){s=true;continue}if(o===")"&&s){s=false;continue}let a=o;if(s)a=o;else if(o.startsWith("require "))a=o.substring(8);else continue;let i=a.includes("// indirect");a=a.replace(/\/\/.*$/,"").trim();let c=a.split(/\s+/);if(c.length>=2){let[l,u]=c;l&&u&&e.push({path:l,version:u,indirect:i});}}return {goVersion:n,deps:e}}var ko=new Set(["go.mod"]);async function el(t,e,n,s,r=Ee){let o=n?await n.findFiles(t,c=>ko.has(c)):await tl(t),a=[],i=s??n?.projectScanTimeout??18e4;for(let c of o){let l=_.dirname(c);try{let u=nl(l,c,t,e,n,r),p=await Se(u,i);if(p.ok)a.push(p.value);else {let d=_.relative(t,l);n&&n.addStuckPath(d||"."),console.error(`Timeout scanning Go project ${l} (>${i/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(u){let p=u instanceof Error?u.message:String(u);console.error(`Error scanning Go project ${l}: ${p}`);}}return a}async function tl(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>ko.has(n))}async function nl(t,e,n,s,r,o$1){let a=_.relative(n,t)||".",i=_.basename(t===n?n:t),c=r?await r.readTextFile(e):await o(e),{goVersion:l,deps:u}=Zc(c),p=u.filter(b=>!b.indirect),d,f,g,h;if(l){let b=l.match(/(\d+)\.(\d+)/);if(b){let w=parseInt(b[1],10),x=parseInt(b[2],10),m=Ht(o$1,"go");m&&(w===m.major?d=Math.max(0,m.minor-x):w<m.major&&(d=m.minor+(m.major-w)*100),f=`${m.major}.${m.minor}`);}g=rt(o$1,"go",l);let S=Ke("go",l);S&&(h=st(o$1,"go",S));}let y=[],j=[],C={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},A=p.map(async b=>{let S=await s.get(b.path);return {dep:b,meta:S}}),T=await Promise.all(A);for(let{dep:b,meta:S}of T){let w=Te.valid(Te.clean(b.version)),x=S.latestStableOverall,m=null,P="unknown";if(w&&x){let L=Te.major(w);m=Te.major(x)-L,m===0?P=Te.eq(w,x)?"current":"minor-behind":m>0?P="major-behind":P="current",m<=0?C.current++:m===1?C.oneBehind++:C.twoPlusBehind++;}else C.unknown++;y.push({package:b.path,section:"dependencies",currentSpec:b.version,resolvedVersion:w,latestStable:x,majorsBehind:m,drift:P}),b.path in zr&&j.push({name:zr[b.path],currentVersion:w,latestVersion:x,majorsBehind:m});}y.sort((b,S)=>{let w={"major-behind":0,"minor-behind":1,current:2,unknown:3},x=(w[b.drift]??9)-(w[S.drift]??9);return x!==0?x:b.package.localeCompare(S.package)});let v;try{v=r?await r.countFilesUnder(n,t):void 0;}catch{}return {type:"go",path:a,name:i,runtime:l,runtimeLatest:f,runtimeMajorsBehind:d,runtimeEol:g,runtimeEolDate:h,frameworks:j,dependencies:y,dependencyAgeBuckets:C,fileCount:v}}var Jr={"actix-web":"Actix Web",rocket:"Rocket",axum:"Axum",warp:"Warp",tide:"Tide",poem:"Poem",tokio:"Tokio","async-std":"async-std",smol:"smol",serde:"Serde",serde_json:"Serde JSON",bincode:"Bincode",toml:"TOML",diesel:"Diesel",sqlx:"SQLx","sea-orm":"SeaORM",reqwest:"reqwest",hyper:"hyper",ureq:"ureq",clap:"clap",structopt:"structopt",log:"log",env_logger:"env_logger",tracing:"tracing","tracing-subscriber":"tracing-subscriber",anyhow:"anyhow",thiserror:"thiserror",eyre:"eyre",criterion:"Criterion",proptest:"proptest",mockall:"mockall",ring:"ring",rustls:"rustls",webpki:"webpki",bevy:"Bevy",wgpu:"wgpu",winit:"winit","wasm-bindgen":"wasm-bindgen","wasm-pack":"wasm-pack",substrate:"Substrate",ethers:"ethers-rs"};function sl(t){let e=[],n=null;for(let s of t.split(/\r?\n/)){let r=s.trim();if(r==="[dependencies]"){n="dependencies";continue}else if(r==="[dev-dependencies]"){n="dev-dependencies";continue}else if(r.startsWith("[")&&r.endsWith("]")){n=null;continue}if(!n)continue;let o=r.match(/^([\w-]+)\s*=\s*"([^"]+)"/);if(o){e.push({name:o[1],version:o[2],optional:false,features:[],isDev:n==="dev-dependencies"});continue}let a=r.match(/^([\w-]+)\s*=\s*\{([^}]+)\}/);if(a){let i=a[1],c=a[2],u=c.match(/version\s*=\s*"([^"]+)"/)?.[1]??"*",d=!!c.match(/optional\s*=\s*true/),f=c.match(/features\s*=\s*\[([^\]]*)\]/),g=f?f[1].split(",").map(h=>h.trim().replace(/"/g,"")):[];e.push({name:i,version:u,optional:d,features:g,isDev:n==="dev-dependencies"});}}return e}function rl(t){return t.match(/^\s*edition\s*=\s*"(\d+)"/m)?.[1]}var Eo=new Set(["Cargo.toml"]);async function ol(t,e,n,s){let r=n?await n.findFiles(t,i=>Eo.has(i)):await il(t),o=[],a=s??n?.projectScanTimeout??18e4;for(let i of r){let c=_.dirname(i);try{let l=al(c,i,t,e,n),u=await Se(l,a);if(u.ok)o.push(u.value);else {let p=_.relative(t,c);n&&n.addStuckPath(p||"."),console.error(`Timeout scanning Rust project ${c} (>${a/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(l){let u=l instanceof Error?l.message:String(l);console.error(`Error scanning Rust project ${c}: ${u}`);}}return o}async function il(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>Eo.has(n))}async function al(t,e,n,s,r){let o$1=_.relative(n,t)||".",a=_.basename(t===n?n:t),i=r?await r.readTextFile(e):await o(e),c=rl(i),u=sl(i).filter(A=>!A.isDev),p,d;if(c){let A=parseInt(c,10),T=2024;p=Math.max(0,Math.floor((T-A)/3)),d=T.toString();}let f=[],g=[],h={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},y=u.map(async A=>{let T=await s.get(A.name);return {dep:A,meta:T}}),j=await Promise.all(y);for(let{dep:A,meta:T}of j){let v=Ce.valid(Ce.coerce(A.version)),b=T.latestStableOverall,S=null,w="unknown";if(v&&b){let m=Ce.major(v);S=Ce.major(b)-m,S===0?w=Ce.eq(v,b)?"current":"minor-behind":S>0?w="major-behind":w="current",S<=0?h.current++:S===1?h.oneBehind++:h.twoPlusBehind++;}else h.unknown++;let x=A.isDev?"devDependencies":"dependencies";f.push({package:A.name,section:x,currentSpec:A.version,resolvedVersion:v,latestStable:b,majorsBehind:S,drift:w}),A.name in Jr&&g.push({name:Jr[A.name],currentVersion:v,latestVersion:b,majorsBehind:S});}f.sort((A,T)=>{let v={"major-behind":0,"minor-behind":1,current:2,unknown:3},b=(v[A.drift]??9)-(v[T.drift]??9);return b!==0?b:A.package.localeCompare(T.package)});let C;try{C=r?await r.countFilesUnder(n,t):void 0;}catch{}return {type:"rust",path:o$1,name:a,runtime:c,runtimeLatest:d,runtimeMajorsBehind:p,frameworks:g,dependencies:f,dependencyAgeBuckets:h,fileCount:C}}var Kr={"laravel/framework":"Laravel","symfony/symfony":"Symfony","symfony/http-foundation":"Symfony HttpFoundation","cakephp/cakephp":"CakePHP","yiisoft/yii2":"Yii 2","codeigniter4/framework":"CodeIgniter","slim/slim":"Slim","laminas/laminas-mvc":"Laminas","roots/wordpress":"WordPress","johnpbloch/wordpress":"WordPress Core","doctrine/orm":"Doctrine ORM","doctrine/dbal":"Doctrine DBAL","illuminate/database":"Laravel Eloquent","propel/propel":"Propel","phpunit/phpunit":"PHPUnit","pestphp/pest":"Pest","behat/behat":"Behat","codeception/codeception":"Codeception","mockery/mockery":"Mockery","guzzlehttp/guzzle":"Guzzle","symfony/http-client":"Symfony HttpClient","twig/twig":"Twig","smarty/smarty":"Smarty","league/plates":"Plates","firebase/php-jwt":"PHP-JWT","lcobucci/jwt":"JWT","league/fractal":"Fractal","api-platform/core":"API Platform","symfony/console":"Symfony Console","monolog/monolog":"Monolog","nesbot/carbon":"Carbon","ramsey/uuid":"UUID","vlucas/phpdotenv":"PHP dotenv","phpstan/phpstan":"PHPStan","vimeo/psalm":"Psalm","friendsofphp/php-cs-fixer":"PHP CS Fixer","squizlabs/php_codesniffer":"PHP_CodeSniffer"},lt={major:8,minor:4};async function cl(t,e){let n$1=e?await e.readJsonFile(t):await n(t),s=[],r;if(n$1.require?.php&&(r=n$1.require.php),n$1.require&&typeof n$1.require=="object")for(let[o,a]of Object.entries(n$1.require))o==="php"||o.startsWith("ext-")||s.push({name:o,version:String(a),isDev:false});if(n$1["require-dev"]&&typeof n$1["require-dev"]=="object")for(let[o,a]of Object.entries(n$1["require-dev"]))o==="php"||o.startsWith("ext-")||s.push({name:o,version:String(a),isDev:true});return {phpVersion:r,deps:s}}async function ll(t,e){let n$1=new Map;try{let s=e?await e.readJsonFile(t):await n(t);for(let r of s.packages??[])r.name&&r.version&&n$1.set(r.name,r.version);for(let r of s["packages-dev"]??[])r.name&&r.version&&n$1.set(r.name,r.version);}catch{}return n$1}function ul(t){return t.match(/(\d+)\.(\d+)/)?.[0]}var jo=new Set(["composer.json"]);async function pl(t,e,n,s){let r=n?await n.findFiles(t,i=>jo.has(i)):await dl(t),o=[],a=s??n?.projectScanTimeout??18e4;for(let i of r){let c=_.dirname(i);try{let l=fl(c,i,t,e,n),u=await Se(l,a);if(u.ok)o.push(u.value);else {let p=_.relative(t,c);n&&n.addStuckPath(p||"."),console.error(`Timeout scanning PHP project ${c} (>${a/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(l){let u=l instanceof Error?l.message:String(l);console.error(`Error scanning PHP project ${c}: ${u}`);}}return o}async function dl(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>jo.has(n))}async function fl(t,e,n,s,r){let o=_.relative(n,t)||".",a=_.basename(t===n?n:t),{phpVersion:i,deps:c}=await cl(e,r),l=_.join(t,"composer.lock"),u=new Map;try{u=await ll(l,r);}catch{}let p=c.filter(v=>!v.isDev),d,f,g;if(i&&(g=ul(i),g)){let v=g.match(/(\d+)\.(\d+)/);if(v){let b=parseInt(v[1],10),S=parseInt(v[2],10);b===lt.major?d=Math.max(0,lt.minor-S):b<lt.major&&(d=lt.minor+(lt.major-b)*10),f=`${lt.major}.${lt.minor}`;}}let h=[],y=[],j={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},C=p.map(async v=>{let b=await s.get(v.name);return {dep:v,meta:b}}),A=await Promise.all(C);for(let{dep:v,meta:b}of A){let S=u.get(v.name),w=S?Ae.valid(Ae.clean(S)):null,x=b.latestStableOverall,m=null,P="unknown";if(w&&x){let D=Ae.major(w);m=Ae.major(x)-D,m===0?P=Ae.eq(w,x)?"current":"minor-behind":m>0?P="major-behind":P="current",m<=0?j.current++:m===1?j.oneBehind++:j.twoPlusBehind++;}else j.unknown++;let L=v.isDev?"devDependencies":"dependencies";h.push({package:v.name,section:L,currentSpec:v.version,resolvedVersion:w,latestStable:x,majorsBehind:m,drift:P}),v.name in Kr&&y.push({name:Kr[v.name],currentVersion:w,latestVersion:x,majorsBehind:m});}h.sort((v,b)=>{let S={"major-behind":0,"minor-behind":1,current:2,unknown:3},w=(S[v.drift]??9)-(S[b.drift]??9);return w!==0?w:v.package.localeCompare(b.package)});let T;try{T=r?await r.countFilesUnder(n,t):void 0;}catch{}return {type:"php",path:o,name:a,runtime:g,runtimeLatest:f,runtimeMajorsBehind:d,frameworks:y,dependencies:h,dependencyAgeBuckets:j,fileCount:T}}var Qr={flutter:"Flutter SDK",flutter_test:"Flutter Test",provider:"Provider",riverpod:"Riverpod",flutter_riverpod:"Flutter Riverpod",bloc:"BLoC",flutter_bloc:"Flutter BLoC",get:"GetX",mobx:"MobX",redux:"Redux",go_router:"GoRouter",auto_route:"AutoRoute",http:"http",dio:"Dio",retrofit:"Retrofit",graphql_flutter:"GraphQL Flutter",sqflite:"SQFlite",hive:"Hive",isar:"Isar",drift:"Drift",firebase_core:"Firebase Core",cloud_firestore:"Cloud Firestore",flutter_svg:"Flutter SVG",cached_network_image:"Cached Network Image",shimmer:"Shimmer",lottie:"Lottie",flutter_staggered_grid_view:"Staggered Grid View",mockito:"Mockito",mocktail:"Mocktail",integration_test:"Integration Test",test:"Test",intl:"Intl",shared_preferences:"Shared Preferences",path_provider:"Path Provider",package_info_plus:"Package Info Plus",url_launcher:"URL Launcher",image_picker:"Image Picker",json_serializable:"JSON Serializable",freezed:"Freezed",built_value:"Built Value",logger:"Logger",sentry_flutter:"Sentry Flutter",firebase_crashlytics:"Firebase Crashlytics",build_runner:"Build Runner",injectable:"Injectable",flutter_lints:"Flutter Lints",lint:"Lint"},ut={major:3,minor:6};function hl(t){let e=[],n,s=null;for(let r of t.split(/\r?\n/)){let o=r.trim();if(o.startsWith("sdk:")){let i=o.match(/sdk:\s*['"]?>?=?\s*(\d[^<'"]*)/);i&&(n=i[1].trim());continue}if(o==="dependencies:"){s="dependencies";continue}else if(o==="dev_dependencies:"){s="dev_dependencies";continue}else if(/^\w+:/.test(r)){s=null;continue}if(!s)continue;let a=o.match(/^([\w_]+):\s*([^\s{]+)/);if(a){let i=a[1],c=a[2];if(c==="sdk:"||o.includes("sdk: flutter"))continue;e.push({name:i,version:c,isDev:s==="dev_dependencies"});}}return {dartVersion:n,deps:e}}async function ml(t,e){let n=new Map;try{let s=e?await e.readTextFile(t):await o(t),r=null;for(let o of s.split(/\r?\n/)){let a=o.trim(),i=o.match(/^ {2}(\w+):$/);if(i){r=i[1];continue}if(r&&a.startsWith("version:")){let c=a.match(/version:\s*"?([^"]+)"?/);c&&(n.set(r,c[1]),r=null);}}}catch{}return n}function gl(t){return t.match(/(\d+\.\d+\.\d+)/)?.[0]}var xo=new Set(["pubspec.yaml"]);async function yl(t,e,n,s){let r=n?await n.findFiles(t,i=>xo.has(i)):await bl(t),o=[],a=s??n?.projectScanTimeout??18e4;for(let i of r){let c=_.dirname(i);try{let l=vl(c,i,t,e,n),u=await Se(l,a);if(u.ok)o.push(u.value);else {let p=_.relative(t,c);n&&n.addStuckPath(p||"."),console.error(`Timeout scanning Dart project ${c} (>${a/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(l){let u=l instanceof Error?l.message:String(l);console.error(`Error scanning Dart project ${c}: ${u}`);}}return o}async function bl(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>xo.has(n))}async function vl(t,e,n,s,r){let o$1=_.relative(n,t)||".",a=_.basename(t===n?n:t),i=r?await r.readTextFile(e):await o(e),{dartVersion:c,deps:l}=hl(i),u=_.join(t,"pubspec.lock"),p=new Map;try{p=await ml(u,r);}catch{}let d=l.filter(b=>!b.isDev),f,g,h;if(c&&(h=gl(c),h)){let b=h.match(/(\d+)\.(\d+)/);if(b){let S=parseInt(b[1],10),w=parseInt(b[2],10);S===ut.major?f=Math.max(0,ut.minor-w):S<ut.major&&(f=ut.minor+(ut.major-S)*10),g=`${ut.major}.${ut.minor}`;}}let y=[],j=[],C={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},A=d.map(async b=>{let S=await s.get(b.name);return {dep:b,meta:S}}),T=await Promise.all(A);for(let{dep:b,meta:S}of T){let w=p.get(b.name),x=w?Pe.valid(Pe.clean(w)):null,m=S.latestStableOverall,P=null,L="unknown";if(x&&m){let ce=Pe.major(x);P=Pe.major(m)-ce,P===0?L=Pe.eq(x,m)?"current":"minor-behind":P>0?L="major-behind":L="current",P<=0?C.current++:P===1?C.oneBehind++:C.twoPlusBehind++;}else C.unknown++;let D=b.isDev?"devDependencies":"dependencies";y.push({package:b.name,section:D,currentSpec:b.version,resolvedVersion:x,latestStable:m,majorsBehind:P,drift:L}),b.name in Qr&&j.push({name:Qr[b.name],currentVersion:x,latestVersion:m,majorsBehind:P});}y.sort((b,S)=>{let w={"major-behind":0,"minor-behind":1,current:2,unknown:3},x=(w[b.drift]??9)-(w[S.drift]??9);return x!==0?x:b.package.localeCompare(S.package)});let v;try{v=r?await r.countFilesUnder(n,t):void 0;}catch{}return {type:"dart",path:o$1,name:a,runtime:h,runtimeLatest:g,runtimeMajorsBehind:f,frameworks:j,dependencies:y,dependencyAgeBuckets:C,fileCount:v}}var wl="https://hex.pm/api",Sl=1e4,kl=10;async function El(t,e,n,s=false){let r=H(e,"hex",t);if(r?.latest)return r.latest;if(s)return null;let o=async()=>{try{let a=new AbortController,i=setTimeout(()=>a.abort(),Sl),c=`${wl}/packages/${t}`,l=await fetch(c,{signal:a.signal,headers:{"User-Agent":"vibgrate-cli"}});if(clearTimeout(i),!l.ok)return null;let p=(await l.json()).releases;if(!p||p.length===0)return null;let d=p.filter(f=>!f.retired).map(f=>f.version).filter(f=>{try{return new Dn.SemVer(f).prerelease.length===0}catch{return !1}});return d.length===0?null:(d.sort((f,g)=>{try{return (0,Dn.gt)(f,g)?-1:1}catch{return 0}}),d[0])}catch(a){return a?.name==="AbortError",null}};return n?n.run(o):o()}async function jl(t,e,n=false){let s=new Map,r=new a$1(kl),o=t.map(async a=>{let i=await El(a,e,r,n);i&&s.set(a,i);});return await Promise.all(o),s}var xl=new Set(["mix.exs"]),Tl=new Set(["phoenix","phoenix_live_view","phoenix_html","phoenix_ecto","phoenix_pubsub","ecto","ecto_sql","plug","plug_cowboy","cowboy","ranch","absinthe","absinthe_plug","guardian","comeonin","bcrypt_elixir","argon2_elixir","pbkdf2_elixir","ex_machina","mock","mox","excoveralls","credo","dialyxir","ex_doc","jason","poison","httpoison","tesla","finch","mint","hackney","timex","quantum","oban","broadway","gen_stage","flow","bamboo","swoosh","ex_aws","ex_aws_s3","redix","cachex","nebulex","floki","wallaby","hound"]);async function Cl(t,e){let n=e?await e.readTextFile(t):await o(t),s=[],r,o$1=n.match(/elixir:\s*"([^"]+)"/);o$1&&(r=o$1[1]);let a=/\{\s*:(\w+)\s*,\s*"([^"]+)"(?:,\s*(?:only|optional|runtime):\s*:(\w+))?\s*\}/g,i;for(;(i=a.exec(n))!==null;){let l=i[1],u=i[2],p=i[3];s.push({name:l,version:u,isDev:p==="dev"||p==="test"});}let c=/\{\s*:(\w+)\s*,\s*git:\s*"[^"]+"/g;for(;(i=c.exec(n))!==null;){i[1];}return {elixirVersion:r,deps:s}}async function Al(t,e){let n=new Map;try{let s=e?await e.readTextFile(t):await o(t),r=/"(\w+)":\s*\{\s*:hex\s*,\s*:\w+\s*,\s*"([^"]+)"/g,o$1;for(;(o$1=r.exec(s))!==null;){let a=o$1[1],i=o$1[2];n.set(a,i);}}catch{}return n}function Pl(t,e){try{let n=t.replace(/^[~><=\s]+/,""),s=(0,me.minVersion)((0,me.validRange)(n)||n);if(!s)return "unknown";if(!(0,me.gt)(e,s.version))return "current";let r=(0,me.minVersion)(e);return r?r.major>s.major?"major-behind":"minor-behind":"unknown"}catch{return "unknown"}}async function Ml(t,e,n,s=false){let r=`${t}/mix.exs`;if(!(e?await e.pathExists(r):await p(r)))return null;let{elixirVersion:a,deps:i}=await Cl(r,e),c=`${t}/mix.lock`,l=await Al(c,e),u=i.filter(y=>!y.isDev),p$1=u.map(y=>y.name),d=await jl(p$1,n,s),f=[],g=[],h={current:0,oneBehind:0,twoPlusBehind:0,unknown:0};for(let y of u){let j=l.get(y.name),C=j||y.version,A=d.get(y.name),T=A?Pl(C,A):"unknown",v=null;if(j&&A)try{let b=(0,me.minVersion)((0,me.validRange)(C)||C),S=(0,me.minVersion)((0,me.validRange)(A)||A);b&&S&&(v=S.major-b.major);}catch{}f.push({package:y.name,section:y.isDev?"devDependencies":"dependencies",currentSpec:y.version,resolvedVersion:j||null,latestStable:A||null,majorsBehind:v,drift:T}),T==="current"?h.current++:v===1?h.oneBehind++:v&&v>1?h.twoPlusBehind++:h.unknown++,Tl.has(y.name)&&g.push({name:y.name,currentVersion:j||null,latestVersion:A||null,majorsBehind:v});}return {type:"elixir",path:_.relative(t.includes("/")?t.split("/").slice(0,-1).join("/"):".",t)||".",name:_.basename(t),runtime:a,frameworks:g,dependencies:f,dependencyAgeBuckets:h}}async function $l(t,e,n,s,r=false){let o=n?await n.findFiles(t,c=>xl.has(c)):[],a=new Map;for(let c of o){let l=_.dirname(c);a.has(l)||a.set(l,[]),a.get(l).push(c);}let i=[];for(let[c]of a)try{let l=await Ml(c,n,e,r);l&&(l.path=_.relative(t,c)||".",i.push(l));}catch(l){console.error(`Error scanning Elixir project at ${c}:`,l);}return i}var Ll="https://hub.docker.com/v2",Nl=1e4,Rl=10;function js(t){let e,n,s,r,[o,a]=t.split(":");r=a;let i=o.split("/");return i.length>1&&(i[0].includes(".")||i[0]==="localhost")?(e=i[0],i.length===3?(n=i[1],s=i[2]):s=i[1]):i.length===2?(n=i[0],s=i[1]):s=o,{registry:e,namespace:n,image:s,tag:r}}async function Il(t,e,n){let s=async()=>{try{let r=new AbortController,o=setTimeout(()=>r.abort(),Nl),a=`${Ll}/repositories/${t}/${e}/tags?page_size=100`,i=await fetch(a,{signal:r.signal,headers:{"User-Agent":"vibgrate-cli"}});return clearTimeout(o),i.ok?((await i.json()).results||[]).map(u=>u.name):[]}catch(r){return r?.name==="AbortError"?[]:[]}};return n?n.run(s):s()}function _l(t){let e=[];for(let n of t){if(["latest","master","main","stable","edge","dev"].includes(n))continue;let s=n.replace(/^v/,""),r=s.indexOf("-");r>0&&(s=s.substring(0,r));try{let o=new Vn.SemVer(s);o.prerelease.length===0&&e.push(o);}catch{}}return e.length===0?null:(e.sort((n,s)=>(0, Vn.gt)(n.version,s.version)?-1:1),e[0].version)}async function Fl(t,e,n,s=false){let r=js(t),o=`${r.namespace||"library"}/${r.image}`,a=H(e,"docker",o);if(a?.latest)return a.latest;if(s||r.registry&&r.registry!=="docker.io")return null;let i=r.namespace||"library",c=await Il(i,r.image,n);return _l(c)}async function Ol(t,e,n=false){let s=new Map,r=new a$1(Rl),o=t.map(async a=>{let i=await Fl(a,e,r,n);i&&s.set(a,i);});return await Promise.all(o),s}var Bl=new Set(["Dockerfile","docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"]);async function Dl(t,e){let n=e?await e.readTextFile(t):await o(t),s=[],r=/^FROM\s+(?:--platform=[^\s]+\s+)?([^\s]+)/gm,o$1;for(;(o$1=r.exec(n))!==null;){let a=o$1[1];if(a==="scratch")continue;let i=js(a);s.push({name:`${i.namespace||"library"}/${i.image}`,currentTag:i.tag||"latest"});}return s}async function Vl(t,e){let n=e?await e.readTextFile(t):await o(t),s=[],r=/^\s*image:\s*([^\s#]+)/gm,o$1;for(;(o$1=r.exec(n))!==null;){let a=o$1[1].trim().replace(/["']/g,""),i=js(a);s.push({name:`${i.namespace||"library"}/${i.image}`,currentTag:i.tag||"latest"});}return s}function Ul(t,e){try{if(t==="latest"||t==="stable")return "current";let n=t.replace(/^v/,""),s=n.indexOf("-");s>0&&(n=n.substring(0,s));let r=new bt.SemVer(n),o=new bt.SemVer(e);return (0,bt.gt)(o.version,r.version)?o.major>r.major?"major-behind":"minor-behind":"current"}catch{return "unknown"}}async function ql(t,e,n,s=false){let r=[],o=`${t}/Dockerfile`;if(e?await e.pathExists(o):await p(o)){let f=await Dl(o,e);r.push(...f);}let i=["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"];for(let f of i){let g=`${t}/${f}`;if(e?await e.pathExists(g):await p(g)){let y=await Vl(g,e);r.push(...y);break}}if(r.length===0)return null;let c=new Map;for(let f of r)c.has(f.name)||c.set(f.name,f.currentTag);let l=Array.from(c.keys()),u=await Ol(l,n,s),p$1=[],d={current:0,oneBehind:0,twoPlusBehind:0,unknown:0};for(let f of l){let g=c.get(f),h=u.get(f),y=h?Ul(g,h):"unknown",j=null;if(h)try{let C=g.replace(/^v/,"").split("-")[0],A=new bt.SemVer(C);j=new bt.SemVer(h).major-A.major;}catch{}p$1.push({package:f,section:"dependencies",currentSpec:g,resolvedVersion:g,latestStable:h||null,majorsBehind:j,drift:y}),y==="current"?d.current++:j===1?d.oneBehind++:j&&j>1?d.twoPlusBehind++:d.unknown++;}return {type:"docker",path:_.relative(t.includes("/")?t.split("/").slice(0,-1).join("/"):".",t)||".",name:_.basename(t),frameworks:[],dependencies:p$1,dependencyAgeBuckets:d}}async function Gl(t,e,n,s,r=false){let o=n?await n.findFiles(t,c=>Bl.has(c)):[],a=new Map;for(let c of o){let l=_.dirname(c);a.has(l)||a.set(l,[]),a.get(l).push(c);}let i=[];for(let[c]of a)try{let l=await ql(c,n,e,r);l&&(l.path=_.relative(t,c)||".",i.push(l));}catch(l){console.error(`Error scanning Docker project at ${c}:`,l);}return i}var Hl="https://artifacthub.io/api/v1",Wl=1e4,zl=10;async function Jl(t,e,n,s,r=false){let o=e?`${e}/${t}`:t,a=H(n,"helm",o);if(a?.latest)return a.latest;if(r)return null;let i=async()=>{try{let c=new AbortController,l=setTimeout(()=>c.abort(),Wl),u=`${Hl}/packages/search?kind=0&ts_query_web=${encodeURIComponent(t)}&limit=10`,p=await fetch(u,{signal:c.signal,headers:{"User-Agent":"vibgrate-cli"}});if(clearTimeout(l),!p.ok)return null;let f=(await p.json()).packages||[],g=f.find(h=>h.name===t);return e&&f.length>1&&(g=f.find(h=>h.name===t&&h.repository?.name===e)||g),g?g.version:null}catch(c){return c?.name==="AbortError",null}};return s?s.run(i):i()}async function Kl(t,e,n=false){let s=new Map,r=new a$1(zl),o=t.map(async a=>{let i=await Jl(a.name,a.repo,e,r,n);if(i){let c=a.repo?`${a.repo}/${a.name}`:a.name;s.set(c,i);}});return await Promise.all(o),s}var Ql=new Set(["Chart.yaml","Chart.yml"]);async function Yl(t,e){let n=e?await e.readTextFile(t):await o(t),s=[],r,o$1,a,i=n.match(/^name:\s*(.+)$/m);i&&(r=i[1].trim().replace(/["']/g,""));let c=n.match(/^version:\s*(.+)$/m);c&&(o$1=c[1].trim().replace(/["']/g,""));let l=n.match(/^appVersion:\s*(.+)$/m);l&&(a=l[1].trim().replace(/["']/g,""));let u=n.match(/^dependencies:\s*$/m);if(u){let p=u.index+u[0].length,d=n.substring(p),f=/^\s*-\s+name:\s*(.+)$/gm,g;for(;(g=f.exec(d))!==null;){let h=g[1].trim().replace(/["']/g,""),y=g.index,j=f.exec(d),C=j?j.index:d.length;f.lastIndex=y+1;let A=d.substring(y,C),T=A.match(/version:\s*(.+)$/m),v=T?T[1].trim().replace(/["']/g,""):"*",b=A.match(/repository:\s*(.+)$/m),S=b?b[1].trim().replace(/["']/g,""):void 0,w=A.match(/condition:\s*(.+)$/m),x=w?w[1].trim().replace(/["']/g,""):void 0;s.push({name:h,version:v,repository:S,condition:x});}}return {chartName:r,chartVersion:o$1,appVersion:a,dependencies:s}}async function Xl(t,e){let n=new Map;try{let s=e?await e.readTextFile(t):await o(t),r=/^\s*-\s+name:\s*(.+)$/gm,o$1;for(;(o$1=r.exec(s))!==null;){let a=o$1[1].trim().replace(/["']/g,""),i=o$1.index,c=r.exec(s),l=c?c.index:s.length;r.lastIndex=i+1;let p=s.substring(i,l).match(/version:\s*(.+)$/m);if(p){let d=p[1].trim().replace(/["']/g,"");n.set(a,d);}}}catch{}return n}function Zl(t,e){try{let n=t.replace(/^[~^><=\s]+/,""),s=(0,ge.minVersion)((0,ge.validRange)(n)||n);if(!s)return "unknown";if(!(0,ge.gt)(e,s.version))return "current";let r=(0,ge.minVersion)(e);return r?r.major>s.major?"major-behind":"minor-behind":"unknown"}catch{return "unknown"}}async function eu(t,e,n,s=false){let r=null;for(let h of ["Chart.yaml","Chart.yml"]){let y=`${t}/${h}`;if(e?await e.pathExists(y):await p(y)){r=y;break}}if(!r)return null;let{chartName:o,chartVersion:a,appVersion:i,dependencies:c}=await Yl(r,e),l=`${t}/Chart.lock`,u=await Xl(l,e),p$1=c.map(h=>({name:h.name,repo:h.repository})),d=await Kl(p$1,n,s),f=[],g={current:0,oneBehind:0,twoPlusBehind:0,unknown:0};for(let h of c){let y=u.get(h.name),j=y||h.version,C=h.repository?`${h.repository}/${h.name}`:h.name,A=d.get(C),T=A?Zl(j,A):"unknown",v=null;if(A)try{let b=(0,ge.minVersion)((0,ge.validRange)(j)||j),S=(0,ge.minVersion)((0,ge.validRange)(A)||A);b&&S&&(v=S.major-b.major);}catch{}f.push({package:h.name,section:"dependencies",currentSpec:h.version,resolvedVersion:y||null,latestStable:A||null,majorsBehind:v,drift:T}),T==="current"?g.current++:v===1?g.oneBehind++:v&&v>1?g.twoPlusBehind++:g.unknown++;}return {type:"helm",path:_.relative(t.includes("/")?t.split("/").slice(0,-1).join("/"):".",t)||".",name:o||_.basename(t),runtime:i,frameworks:[],dependencies:f,dependencyAgeBuckets:g}}async function tu(t,e,n,s,r=false){let o=n?await n.findFiles(t,c=>Ql.has(c)):[],a=new Map;for(let c of o){let l=_.dirname(c);a.has(l)||a.set(l,[]),a.get(l).push(c);}let i=[];for(let[c]of a)try{let l=await eu(c,n,e,r);l&&(l.path=_.relative(t,c)||".",i.push(l));}catch(l){console.error(`Error scanning Helm chart at ${c}:`,l);}return i}var To="https://registry.terraform.io/v1",Co=1e4,nu=10;async function su(t,e,n,s,r=false){let o=`${t}/${e}`,a=H(n,"terraform",o);if(a?.latest)return a.latest;if(r)return null;let i=async()=>{try{let c=new AbortController,l=setTimeout(()=>c.abort(),Co),u=`${To}/providers/${t}/${e}/versions`,p=await fetch(u,{signal:c.signal,headers:{"User-Agent":"vibgrate-cli"}});if(clearTimeout(l),!p.ok)return null;let f=(await p.json()).versions||[];if(f.length===0)return null;let g=[];for(let h of f)try{let y=new Dt.SemVer(h.version);y.prerelease.length===0&&g.push(y);}catch{}return g.length===0?null:(g.sort((h,y)=>(0,Dt.gt)(h.version,y.version)?-1:1),g[0].version)}catch(c){return c?.name==="AbortError",null}};return s?s.run(i):i()}async function ru(t,e,n,s,r,o=false){let a=`${t}/${e}/${n}`,i=H(s,"terraform",a);if(i?.latest)return i.latest;if(o)return null;let c=async()=>{try{let l=new AbortController,u=setTimeout(()=>l.abort(),Co),p=`${To}/modules/${t}/${e}/${n}/versions`,d=await fetch(p,{signal:l.signal,headers:{"User-Agent":"vibgrate-cli"}});if(clearTimeout(u),!d.ok)return null;let g=(await d.json()).modules||[];if(g.length===0||!g[0].versions)return null;let h=g[0].versions,y=[];for(let j of h)try{let C=new Dt.SemVer(j.version);C.prerelease.length===0&&y.push(C);}catch{}return y.length===0?null:(y.sort((j,C)=>(0,Dt.gt)(j.version,C.version)?-1:1),y[0].version)}catch(l){return l?.name==="AbortError",null}};return r?r.run(c):c()}async function ou(t,e,n=false){let s=new Map,r=new a$1(nu),o=t.map(async a=>{let i=null,c;a.type==="provider"?(c=`${a.namespace}/${a.name}`,i=await su(a.namespace,a.name,e,r,n)):(c=`${a.namespace}/${a.name}/${a.provider}`,i=await ru(a.namespace,a.name,a.provider,e,r,n)),i&&s.set(c,i);});return await Promise.all(o),s}async function iu(t,e){let n=e?await e.readTextFile(t):await o(t),s=[],r=[],o$1,a=n.match(/terraform\s*\{[^}]*required_version\s*=\s*"([^"]+)"/s);a&&(o$1=a[1]);let i=n.match(/required_providers\s*\{([^}]+)\}/s);if(i){let d=i[1],f=/(\w+)\s*=\s*\{([^}]+)\}/g,g;for(;(g=f.exec(d))!==null;){let h=g[2],y=h.match(/source\s*=\s*"([^"]+)"/);if(!y)continue;let j=y[1],C=h.match(/version\s*=\s*"([^"]+)"/),A=C?C[1]:void 0;s.push({source:j,version:A});}}let c=/provider\s+"(\w+)"\s*\{([^}]+)\}/g,l;for(;(l=c.exec(n))!==null;){let d=l[1],g=l[2].match(/version\s*=\s*"([^"]+)"/);g&&(s.find(y=>y.source.endsWith(`/${d}`))||s.push({source:`hashicorp/${d}`,version:g[1]}));}let u=/module\s+"[^"]+"\s*\{([^}]+)\}/g,p;for(;(p=u.exec(n))!==null;){let d=p[1],f=d.match(/source\s*=\s*"([^"]+)"/);if(!f)continue;let g=f[1];if(g.startsWith("./")||g.startsWith("../")||g.startsWith("git::"))continue;let h=d.match(/version\s*=\s*"([^"]+)"/),y=h?h[1]:void 0;r.push({source:g,version:y});}return {terraformVersion:o$1,providers:s,modules:r}}async function au(t,e){let n=new Map;try{let s=e?await e.readTextFile(t):await o(t),r=/provider\s+"[^"]*\/([^/"]+\/[^/"]+)"\s*\{([^}]+)\}/g,o$1;for(;(o$1=r.exec(s))!==null;){let a=o$1[1],c=o$1[2].match(/version\s*=\s*"([^"]+)"/);c&&n.set(a,c[1]);}}catch{}return n}function Yr(t,e){try{let n=t.replace(/^[~><=\s]+/,""),s=(0,Y.minVersion)((0,Y.validRange)(n)||n);if(!s)return "unknown";if(!(0,Y.gt)(e,s.version))return "current";let r=(0,Y.minVersion)(e);return r?r.major>s.major?"major-behind":"minor-behind":"unknown"}catch{return "unknown"}}async function cu(t,e,n,s=false){let r=[];if(e){let y=await e.findFiles(t,j=>j.endsWith(".tf"));r.push(...y);}else {let y=["main.tf","variables.tf","outputs.tf","versions.tf","providers.tf"];for(let j of y){let C=`${t}/${j}`;await p(C)&&r.push(C);}}if(r.length===0)return null;let o,a=[],i=[];for(let y of r){let{terraformVersion:j,providers:C,modules:A}=await iu(y,e);j&&!o&&(o=j),a.push(...C),i.push(...A);}let c=new Map;for(let y of a)c.has(y.source)||c.set(y.source,y.version);let l=new Map;for(let y of i)l.has(y.source)||l.set(y.source,y.version);let u=`${t}/.terraform.lock.hcl`,p$1=await au(u,e),d=[];for(let[y]of c){let[j,C]=y.split("/");d.push({type:"provider",namespace:j,name:C});}for(let[y]of l){let j=y.split("/");if(j.length===3){let[C,A,T]=j;d.push({type:"module",namespace:C,name:A,provider:T});}}let f=await ou(d,n,s),g=[],h={current:0,oneBehind:0,twoPlusBehind:0,unknown:0};for(let[y,j]of c){let C=p$1.get(y),A=C||j||"unknown",T=f.get(y),v=T&&A!=="unknown"?Yr(A,T):"unknown",b=null;if(T&&A!=="unknown")try{let S=(0,Y.minVersion)((0,Y.validRange)(A)||A),w=(0,Y.minVersion)((0,Y.validRange)(T)||T);S&&w&&(b=w.major-S.major);}catch{}g.push({package:`provider:${y}`,section:"dependencies",currentSpec:j||"unknown",resolvedVersion:C||null,latestStable:T||null,majorsBehind:b,drift:v}),v==="current"?h.current++:b===1?h.oneBehind++:b&&b>1?h.twoPlusBehind++:h.unknown++;}for(let[y,j]of l){let C=j||"unknown",A=f.get(y),T=A&&C!=="unknown"?Yr(C,A):"unknown",v=null;if(A&&C!=="unknown")try{let b=(0,Y.minVersion)((0,Y.validRange)(C)||C),S=(0,Y.minVersion)((0,Y.validRange)(A)||A);b&&S&&(v=S.major-b.major);}catch{}g.push({package:`module:${y}`,section:"dependencies",currentSpec:j||"unknown",resolvedVersion:null,latestStable:A||null,majorsBehind:v,drift:T}),T==="current"?h.current++:v===1?h.oneBehind++:v&&v>1?h.twoPlusBehind++:h.unknown++;}return {type:"terraform",path:_.relative(t.includes("/")?t.split("/").slice(0,-1).join("/"):".",t)||".",name:_.basename(t),runtime:o,frameworks:[],dependencies:g,dependencyAgeBuckets:h}}async function lu(t,e,n,s,r=false){let o=n?await n.findFiles(t,c=>c.endsWith(".tf")):[],a=new Map;for(let c of o){let l=_.dirname(c);a.has(l)||a.set(l,[]),a.get(l).push(c);}let i=[];for(let[c]of a)try{let l=await cu(c,n,e,r);l&&(l.path=_.relative(t,c)||".",i.push(l));}catch(l){console.error(`Error scanning Terraform project at ${c}:`,l);}return i}var Xr=[{name:"go.mod",type:"go"},{name:"Cargo.toml",type:"rust"},{name:"composer.json",type:"php"},{name:"Package.swift",type:"swift"},{name:"pubspec.yaml",type:"dart"},{name:"build.gradle.kts",type:"kotlin"},{name:"build.sbt",type:"scala"},{name:"DESCRIPTION",type:"r"},{name:"Podfile",type:"objective-c"},{name:"mix.exs",type:"elixir"},{name:"cpanfile",type:"perl"},{name:"Project.toml",type:"julia"},{name:"deps.edn",type:"clojure"},{name:"build.gradle",type:"groovy"},{name:"tsconfig.json",type:"typescript"},{name:"Makefile",type:"c"},{name:"CMakeLists.txt",type:"cpp"},{name:"*.vbp",type:"visual-basic"}],uu=[{extensions:[".m",".mm"],type:"objective-c"},{extensions:[".c",".h"],type:"c"},{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],type:"cpp"},{extensions:[".cob",".cbl",".cpy"],type:"cobol"},{extensions:[".f",".for",".f90",".f95",".f03",".f08"],type:"fortran"},{extensions:[".pas",".pp",".lpr"],type:"pascal"},{extensions:[".adb",".ads",".ada"],type:"ada"},{extensions:[".asm",".s",".s43",".s65"],type:"assembly"},{extensions:[".rpg",".rpgle",".sqlrpgle"],type:"rpg"}];function pt(t,e="unknown"){return {package:t,section:"dependencies",currentSpec:e,resolvedVersion:null,latestStable:null,majorsBehind:null,drift:"unknown"}}function _t(t,e,n=1){let s=new Set;for(let r of t.split(/\r?\n/)){let o=r.match(e);o?.[n]&&s.add(o[n]);}return [...s]}function pu(t,e){return _.basename(t)||_.basename(e)}function du(t){return /^\s*(CC|CFLAGS|LDFLAGS)\s*[:?+]?=/m.test(t)||/\b(gcc|clang)\b/.test(t)||/\.(c|o)\b/.test(t)}function ds(t,e,n,s,r,o=[]){let a=s||".",i=`${n}:${a}`;e.has(i)||(e.add(i),t.push({type:n,path:a,name:pu(a,r),frameworks:[],dependencies:o,dependencyAgeBuckets:{current:0,oneBehind:0,twoPlusBehind:0,unknown:o.length}}));}async function fu(t,e){let n$1=_.basename(t),s=async()=>e?e.readTextFile(t):o(t);if(n$1==="composer.json"){let o=e?await e.readJsonFile(t):await n(t);if(!o||typeof o!="object")return [];let a=new Set;for(let i of ["require","require-dev"]){let c=o[i];if(c&&typeof c=="object")for(let l of Object.keys(c))a.add(l);}return [...a].map(i=>pt(i))}let r=await s();return r?n$1==="go.mod"?_t(r,/^\s*require\s+([^\s]+)\s+(.+)$/).map(o=>pt(o)):n$1==="Cargo.toml"?_t(r,/^\s*([A-Za-z0-9_\-]+)\s*=\s*['"{]/).map(o=>pt(o)):n$1==="pubspec.yaml"?_t(r,/^\s{2,}([A-Za-z0-9_\-]+):\s*.+$/).map(o=>pt(o)):n$1==="mix.exs"?_t(r,/\{\s*:([a-zA-Z0-9_]+),/).map(o=>pt(o)):n$1==="cpanfile"?_t(r,/^\s*requires\s+['"]([^'"]+)['"]/).map(o=>pt(o)):n$1==="build.sbt"?_t(r,/"([A-Za-z0-9_.\-]+)"\s*%{1,2}\s*"([A-Za-z0-9_.\-]+)"/,2).map(o=>pt(o)):[]:[]}function hu(t){let e=new Map;for(let n of t){if(!n.isFile)continue;let s=_.extname(n.name).toLowerCase();if(s)for(let r of uu){if(!r.extensions.includes(s))continue;let o=_.dirname(n.relPath)||".";e.has(o)||e.set(o,new Set),e.get(o)?.add(r.type);}}return e}async function mu(t,e){let n=e?await e.walkDir(t):[],s=n.filter(c=>c.isFile&&Xr.some(l=>l.name===c.name||l.name.startsWith("*.")&&c.name.endsWith(l.name.slice(1)))),r=new Set(n.filter(c=>c.isFile&&c.name.endsWith(".sh")).map(c=>_.dirname(c.relPath)||".")),o$1=[],a=new Set;for(let c of s){let l=Xr.find(d=>d.name===c.name||d.name.startsWith("*.")&&c.name.endsWith(d.name.slice(1)));if(!l)continue;if(c.name==="Makefile"){let d=e?await e.readTextFile(c.absPath):await o(c.absPath);if(!du(d))continue}let u=_.dirname(c.relPath)||".",p=await fu(c.absPath,e);ds(o$1,a,l.type,u,t,p);}for(let c of r)ds(o$1,a,"shell",c,t);let i=hu(n);for(let[c,l]of i)for(let u of l)ds(o$1,a,u,c,t);return o$1}var gu=10,yu=1048576,bu=10,vu=30,wu=5242880,Su=25,bs=10,vs=3,pf=1;function Zr(t,e,n,s){let r=0;return t.fileCount!==void 0&&t.fileCount>=1&&t.fileCount<e&&r++,t.sizeBytes!==void 0&&t.sizeBytes>0&&t.sizeBytes<n&&r++,t.dependencyCount!==void 0&&t.dependencyCount<s&&r++,r}function ku(t){return Zr(t,gu,yu,bu)>=2?"micro":Zr(t,vu,wu,Su)>=2?"small":"standard"}function Eu(t){switch(t){case "micro":case "function":return "micro";case "small":return "small";default:return "standard"}}function df(t){switch(t){case "micro":return 1/bs;case "small":return 1/vs;default:return 1}}function ju(t){let e=0,n=0,s=0;for(let o of t)switch(Eu(o.classification)){case "micro":e++;break;case "small":n++;break;default:s++;break}let r=s+n/vs+e/bs;return {microCount:e,smallCount:n,standardCount:s,totalScanned:e+n+s,microBillingRatio:bs,smallBillingRatio:vs,billableProjectsRaw:Math.round(r*100)/100,billableProjects:Math.floor(r)}}var xu=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;baseUrl="https://api.nuget.org/v3-flatcontainer";get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let s=H(this.manifest,"nuget",t);if(s){let r=(s.versions??[]).filter(i=>Me.valid(i)&&Me.prerelease(i)===null),a=[...r].sort(Me.rcompare)[0]??null;return {latest:s.latest??a,stableVersions:r,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let r=`${this.baseUrl}/${t.toLowerCase()}/index.json`,o=await fetch(r,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json"}});if(!o.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let c=((await o.json()).versions??[]).filter(p=>Me.valid(p)&&Me.prerelease(p)===null),u=[...c].sort(Me.rcompare)[0]??null;return {latest:u,stableVersions:c,latestStableOverall:u}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}};function Rn(t){let e=t.replace(/^[vV]/,"").trim();if(/(?:a|b|rc|alpha|beta|dev|post)\d*/i.test(e))return null;let n=e.split(".");for(;n.length<3;)n.push("0");return e=n.slice(0,3).join("."),an.valid(e)}var Tu=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let s=H(this.manifest,"pypi",t);if(s){let r=[];for(let i of s.versions??[]){let c=Rn(i);c&&r.push(c);}let a=[...r].sort(an.rcompare)[0]??null;return {latest:s.latest?Rn(s.latest)??a:a,stableVersions:r,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let r=`https://pypi.org/pypi/${encodeURIComponent(t)}/json`,o=await fetch(r,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json"}});if(!o.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let a=await o.json(),i=Object.keys(a.releases??{}),c=[];for(let f of i){let g=Rn(f);g&&c.push(g);}let l=a.info?.version??null,u=l?Rn(l):null,d=[...c].sort(an.rcompare)[0]??u??null;return {latest:u??d,stableVersions:c,latestStableOverall:d}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}};function fs(t){let e=t.trim();if(/(?:-SNAPSHOT|-alpha|-beta|-rc|-M\d|-CR\d)/i.test(e))return null;e=e.replace(/\.(?:RELEASE|Final|GA)$/i,"");let n=e.split(".");for(;n.length<3;)n.push("0");return e=n.slice(0,3).join("."),cn.valid(e)}var Cu=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t,e){let n=`${t}:${e}`,s=this.meta.get(n);if(s)return s;let r=this.sem.run(async()=>{let o=`${t}:${e}`,a=H(this.manifest,"maven",o);if(a){let i=[];for(let u of a.versions??[]){let p=fs(u);p&&i.push(p);}let l=[...i].sort(cn.rcompare)[0]??null;return {latest:a.latest?fs(a.latest)??l:l,stableVersions:i,latestStableOverall:l}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let i=`https://search.maven.org/solrsearch/select?q=g:%22${encodeURIComponent(t)}%22+AND+a:%22${encodeURIComponent(e)}%22&core=gav&rows=100&wt=json`,c=await fetch(i,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json"}});if(!c.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let p=((await c.json()).response?.docs??[]).map(h=>h.v).filter(h=>typeof h=="string"),d=[];for(let h of p){let y=fs(h);y&&d.push(y);}let g=[...d].sort(cn.rcompare)[0]??null;return {latest:g,stableVersions:d,latestStableOverall:g}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(n,r),r}};function hs(t){let e=t.trim();if(/(?:\.pre|\.rc|\.beta|\.alpha|\.dev)/i.test(e))return null;let n=e.split(".");if(n.length<2)return null;for(;n.length<3;)n.push("0");let s=n.slice(0,3).join(".");return ln.valid(s)}var Au=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let s=H(this.manifest,"rubygems",t);if(s){let r=[];for(let i of s.versions??[]){let c=hs(i);c&&r.push(c);}let a=[...r].sort(ln.rcompare)[0]??null;return {latest:s.latest?hs(s.latest)??a:a,stableVersions:r,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let r=`https://rubygems.org/api/v1/versions/${encodeURIComponent(t)}.json`,o=await fetch(r,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json"}});if(!o.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let a=await o.json();if(!Array.isArray(a))return {latest:null,stableVersions:[],latestStableOverall:null};let i=[];for(let u of a){if(u.prerelease)continue;let p=u.number;if(!p)continue;let d=hs(p);d&&i.push(d);}let l=[...i].sort(ln.rcompare)[0]??null;return {latest:l,stableVersions:i,latestStableOverall:l}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}},Pu=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let s=H(this.manifest,"swift",t);if(s){let r=[];for(let i of s.versions??[]){let c=te.valid(te.clean(i));c&&r.push(c);}let a=[...r].sort(te.rcompare)[0]??null;return {latest:s.latest?te.valid(te.clean(s.latest))??a:a,stableVersions:r,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let r=t.match(/github\.com[/:]([^/]+\/[^/]+?)(\.git)?$/i);if(!r)return {latest:null,stableVersions:[],latestStableOverall:null};let o=r[1],a=`https://api.github.com/repos/${o}/releases`,i=await fetch(a,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/vnd.github+json","User-Agent":"vibgrate-cli"}});if(!i.ok)return this.fetchFromTags(o);let c=await i.json();if(!Array.isArray(c))return {latest:null,stableVersions:[],latestStableOverall:null};let l=[];for(let d of c){if(d.prerelease||d.draft)continue;let f=d.tag_name;if(!f)continue;let g=te.valid(te.clean(f));g&&l.push(g);}let p=[...l].sort(te.rcompare)[0]??null;return {latest:p,stableVersions:l,latestStableOverall:p}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}async fetchFromTags(t){try{let e=`https://api.github.com/repos/${t}/tags`,n=await fetch(e,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/vnd.github+json","User-Agent":"vibgrate-cli"}});if(!n.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let s=await n.json();if(!Array.isArray(s))return {latest:null,stableVersions:[],latestStableOverall:null};let r=[];for(let i of s){let c=i.name;if(!c||/(?:alpha|beta|rc|pre|dev)/i.test(c))continue;let l=te.valid(te.clean(c));l&&r.push(l);}let a=[...r].sort(te.rcompare)[0]??null;return {latest:a,stableVersions:r,latestStableOverall:a}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}}},Mu=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let s=H(this.manifest,"go",t);if(s){let r=[];for(let i of s.versions??[]){let c=pe.valid(pe.clean(i));c&&r.push(c);}let a=[...r].sort(pe.rcompare)[0]??null;return {latest:s.latest?pe.valid(pe.clean(s.latest))??a:a,stableVersions:r,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let o=`https://proxy.golang.org/${encodeURIComponent(t)}/@v/list`,a=await fetch(o,{signal:AbortSignal.timeout(1e4),headers:{Accept:"text/plain"}});if(!a.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let c=(await a.text()).split(`
|
|
57
|
+
`).filter(Boolean),l=[];for(let d of c){if(/[+-](?:alpha|beta|rc|pre|dev)/i.test(d)||/v\d+\.\d+\.\d+-\d{14}-[a-f0-9]+/.test(d))continue;let f=pe.valid(pe.clean(d));f&&l.push(f);}let p=[...l].sort(pe.rcompare)[0]??null;return {latest:p,stableVersions:l,latestStableOverall:p}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}},$u=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let s=H(this.manifest,"cargo",t);if(s){let r=[];for(let i of s.versions??[]){let c=de.valid(de.clean(i));c&&r.push(c);}let a=[...r].sort(de.rcompare)[0]??null;return {latest:s.latest?de.valid(de.clean(s.latest))??a:a,stableVersions:r,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let r=`https://crates.io/api/v1/crates/${encodeURIComponent(t)}`,o=await fetch(r,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json","User-Agent":"vibgrate-cli (https://github.com/vibgrate/vibgrate-cli)"}});if(!o.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let a=await o.json();if(!a.versions)return {latest:null,stableVersions:[],latestStableOverall:null};let i=[];for(let u of a.versions){if(u.yanked||!u.num||/[+-](?:alpha|beta|rc|pre|dev)/i.test(u.num))continue;let p=de.valid(de.clean(u.num));p&&i.push(p);}let l=[...i].sort(de.rcompare)[0]??null;return {latest:l,stableVersions:i,latestStableOverall:l}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}},Lu=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let s=H(this.manifest,"composer",t);if(s){let r=[];for(let i of s.versions??[]){let c=fe.valid(fe.clean(i));c&&r.push(c);}let a=[...r].sort(fe.rcompare)[0]??null;return {latest:s.latest?fe.valid(fe.clean(s.latest))??a:a,stableVersions:r,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let r=`https://repo.packagist.org/p2/${encodeURIComponent(t)}.json`,o=await fetch(r,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json"}});if(!o.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let a=await o.json();if(!a.packages)return {latest:null,stableVersions:[],latestStableOverall:null};let i=a.packages[t];if(!i||!Array.isArray(i))return {latest:null,stableVersions:[],latestStableOverall:null};let c=[];for(let p of i){let d=p.version??p.version_normalized;if(!d||d==="dev-master"||d.startsWith("dev-")||/[+-](?:alpha|beta|rc|pre|dev)/i.test(d))continue;let f=fe.valid(fe.clean(d));f&&c.push(f);}let u=[...c].sort(fe.rcompare)[0]??null;return {latest:u,stableVersions:c,latestStableOverall:u}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}},Nu=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let s=H(this.manifest,"pub",t);if(s){let r=[];for(let i of s.versions??[]){let c=he.valid(he.clean(i));c&&r.push(c);}let a=[...r].sort(he.rcompare)[0]??null;return {latest:s.latest?he.valid(he.clean(s.latest))??a:a,stableVersions:r,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let r=`https://pub.dev/api/packages/${encodeURIComponent(t)}`,o=await fetch(r,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json"}});if(!o.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let a=await o.json();if(!a.versions)return {latest:null,stableVersions:[],latestStableOverall:null};let i=[];for(let u of a.versions){if(!u.version||/[+-](?:alpha|beta|rc|pre|dev)/i.test(u.version))continue;let p=he.valid(he.clean(u.version));p&&i.push(p);}let l=[...i].sort(he.rcompare)[0]??null;return {latest:l,stableVersions:i,latestStableOverall:l}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}};async function Ao(t){try{return await Ru(t)}catch{return {type:"unknown"}}}async function Ru(t){let e=await Iu(t);if(!e)return {type:"unknown"};let n=_.join(e,"HEAD"),s;try{s=(await ye.readFile(n,"utf8")).trim();}catch{return {type:"unknown"}}let r,o;if(s.startsWith("ref: ")){let i=s.slice(5);o=i.startsWith("refs/heads/")?i.slice(11):i,r=await _u(e,i);}else /^[0-9a-f]{40}$/i.test(s)&&(r=s);let a=await Fu(e);return {type:"git",sha:r??void 0,shortSha:r?r.slice(0,7):void 0,branch:o??void 0,remoteUrl:a}}async function Iu(t){let e=_.resolve(t),n=_.parse(e).root;for(;e!==n;){let s=_.join(e,".git");try{let r=await ye.stat(s);if(r.isDirectory())return s;if(r.isFile()){let o=(await ye.readFile(s,"utf8")).trim();if(o.startsWith("gitdir: "))return _.resolve(e,o.slice(8))}}catch{}e=_.dirname(e);}return null}async function _u(t,e){let n=_.join(t,e);try{let r=(await ye.readFile(n,"utf8")).trim();if(/^[0-9a-f]{40}$/i.test(r))return r}catch{}let s=_.join(t,"packed-refs");try{let r=await ye.readFile(s,"utf8");for(let o of r.split(`
|
|
58
|
+
`)){if(o.startsWith("#")||o.startsWith("^"))continue;let a=o.trim().split(" ");if(a.length>=2&&a[1]===e)return a[0]}}catch{}}async function Fu(t){let e=await Ou(t);if(e)try{let s=(await ye.readFile(e,"utf8")).match(/\[remote\s+"origin"\]([\s\S]*?)(?=\n\[|$)/);return s?s[1]?.match(/\n\s*url\s*=\s*(.+)\s*/)?.[1]?.trim():void 0}catch{return}}async function Ou(t){let e=_.join(t,"config");try{if((await ye.stat(e)).isFile())return e}catch{}let n=_.join(t,"commondir");try{let s=(await ye.readFile(n,"utf8")).trim();if(!s)return;let r=_.resolve(t,s),o=_.join(r,"config");if((await ye.stat(o)).isFile())return o}catch{return}}function je(t){return t.replace(/[^a-zA-Z0-9_]/g,"_")}function Ft(t){return t.replace(/"/g,'\\"')}function Ot(t){return t===void 0||Number.isNaN(t)?"scoreUnknown":t>=80?"scoreHigh":t>=50?"scoreModerate":"scoreLow"}function rn(t){let e=t.drift?.score;return typeof e=="number"?`${t.name} (${e})`:t.name}function xs(){return ["classDef scoreHigh fill:#1e293b,stroke:#10b981,color:#f1f5f9,stroke-width:2px","classDef scoreModerate fill:#1e293b,stroke:#f59e0b,color:#f1f5f9,stroke-width:2px","classDef scoreLow fill:#1e293b,stroke:#ef4444,color:#f1f5f9,stroke-width:2px","classDef scoreUnknown fill:#1e293b,stroke:#64748b,color:#94a3b8,stroke-width:2px"]}function Bu(t){let e=["flowchart LR"],n=new Map(t.map(a=>[a.path,a])),s=[],r=new Set;for(let a of t){let i=je(a.projectId||a.path||a.name);for(let c of a.projectReferences??[]){let l=n.get(c.path);if(!l)continue;let u=je(l.projectId||l.path||l.name);s.push(`${i} --> ${u}`),r.add(i),r.add(u);}}let o=r.size===0;for(let a of t){let i=je(a.projectId||a.path||a.name);!o&&!r.has(i)||(e.push(`${i}["${Ft(rn(a))}"]`),e.push(`class ${i} ${Ot(a.drift?.score)}`));}return e.push(...s),e.push(...xs()),{mermaid:e.join(`
|
|
59
|
+
`)}}function Du(t,e){let n=["flowchart LR"],s=new Map(e.map(i=>[i.path,i])),r=e.filter(i=>i.projectReferences?.some(c=>c.path===t.path)),o=(t.projectReferences??[]).map(i=>s.get(i.path)).filter(i=>!!i),a=je(t.projectId||t.path||t.name);n.push(`${a}["${Ft(rn(t))}"]`),n.push(`class ${a} ${Ot(t.drift?.score)}`);for(let i of r){let c=je(i.projectId||i.path||i.name);n.push(`${c}["${Ft(rn(i))}"]`),n.push(`class ${c} ${Ot(i.drift?.score)}`),n.push(`${c} --> ${a}`);}for(let i of o){let c=je(i.projectId||i.path||i.name);n.push(`${c}["${Ft(rn(i))}"]`),n.push(`class ${c} ${Ot(i.drift?.score)}`),n.push(`${a} --> ${c}`);}return n.push(...xs()),{mermaid:n.join(`
|
|
60
|
+
`)}}function Vu(t,e){let n=["flowchart TB"],s=je(t.solutionId||t.path||t.name),r=t.drift?.score,o=typeof r=="number"?` (${r})`:" (n/a)";n.push(`${s}["${Ft(`${t.name}${o}`)}"]`),n.push(`class ${s} ${Ot(r)}`);let a=new Map(e.map(i=>[i.path,i]));for(let i of t.projectPaths){let c=a.get(i);if(!c)continue;let l=je(c.projectId||c.path||c.name);n.push(`${l}["${Ft(rn(c))}"]`),n.push(`class ${l} ${Ot(c.drift?.score)}`),n.push(`${s} --> ${l}`);for(let u of c.projectReferences??[]){let p=a.get(u.path);if(!p)continue;let d=je(p.projectId||p.path||p.name);n.push(`${l} --> ${d}`);}}return n.push(...xs()),{mermaid:n.join(`
|
|
61
|
+
`)}}var qu=createRequire(import.meta.url),Gu=qu("../package.json");Gu.version;var Hu="https://registry.npmjs.org/@vibgrate%2fcli/latest",$o=_.join(on.homedir(),".vibgrate"),Wu=_.join($o,"update-check.json");async function gf(){try{let t=new AbortController,e=setTimeout(()=>t.abort(),1e4);e.unref?.();let n;try{n=await fetch(Hu,{headers:{Accept:"application/json"},signal:t.signal});}finally{clearTimeout(e);}if(!n.ok)return null;let r=(await n.json()).version;return !r||!Mo.default.valid(r)?null:(await zu({latest:r,checkedAt:Date.now()}),r)}catch{return null}}async function zu(t){try{await ye.mkdir($o,{recursive:!0}),await ye.writeFile(Wu,JSON.stringify(t),"utf-8");}catch{}}var Ju=[{category:"pricing",pattern:/price|pricing|billing|subscri|trial|credit|plan|tier|upgrade|premium|pro|enterprise/i},{category:"auth",pattern:/sign[- ]?in|sign[- ]?up|log[- ]?in|log[- ]?out|auth|sso|oauth|password|register|invite|onboard/i},{category:"dashboard",pattern:/dashboard|overview|home|main|summary|stats/i},{category:"settings",pattern:/setting|config|preference|option|profile|account/i},{category:"users",pattern:/user|member|team|role|permission|access|admin|owner/i},{category:"integrations",pattern:/integrat|connect|webhook|api[- ]?key|sync|import|export/i},{category:"reports",pattern:/report|analy|metric|chart|graph|insight|track/i},{category:"workflows",pattern:/workflow|automat|schedule|trigger|action|job|task|pipeline/i},{category:"projects",pattern:/project|workspace|organization|folder|repo/i},{category:"navigation",pattern:/menu|nav|sidebar|header|footer|breadcrumb/i}];function Ku(t,e=3){let n=t.topEvidence,s=n.filter(u=>u.kind==="dependency").map(u=>u.value).slice(0,10),r=Zu(n.filter(u=>u.kind==="route").map(u=>u.value)).slice(0,15),o=n.filter(u=>u.kind!=="dependency"&&u.kind!=="route"&&u.kind!=="feature_flag"),a=new Map,i={};for(let u of o){let p=Qu(u.value);a.has(p)||a.set(p,new Set);let d=Yu(u.value);d.length>=3&&a.get(p).add(d);}let c=[];for(let[u,p]of a){let d=Xu([...p]);i[u]=d.length;for(let f of d.slice(0,e))c.push({kind:"text",value:f,category:u});}let l=n.filter(u=>u.kind==="feature_flag");return l.length>0&&(i.feature_flags=l.length,c.push({kind:"feature_flag",value:"feature flags detected",category:"feature_flags"})),{samples:c,categoryCounts:i,originalCount:n.length,dependencies:s,routes:r,detectedFrameworks:t.detectedFrameworks}}function Qu(t){for(let{category:e,pattern:n}of Ju)if(n.test(t))return e;return "general"}function Yu(t){return t.toLowerCase().replace(/[^a-z0-9\s-]/g," ").replace(/\s+/g," ").trim().slice(0,60)}function Xu(t){let e=t.sort((s,r)=>r.length-s.length),n=[];for(let s of e)n.some(o=>{let a=s.slice(0,6);return o.startsWith(a)||o.includes(s)||s.includes(o)})||n.push(s);return n}function Zu(t){let e=new Set,n=[];for(let s of t){let r=s.replace(/:[a-z_]+/gi,":param").replace(/\[\[*\.*\.*[a-z_]+\]*\]/gi,":param").replace(/\/+$/,"").toLowerCase();e.has(r)||(e.add(r),n.push(s));}return n}var tp=promisify(Lo.gzip),ue=50;function Zt(t){let e=t.match(/^(.+?)\s*\(/);return e?e[1].trim():t.trim()}function np(t){return {databaseTechnologies:t.databaseTechnologies.slice(0,10),connectionStrings:[],connectionPoolSettings:t.connectionPoolSettings.slice(0,ue),replicationSettings:t.replicationSettings.slice(0,20),readReplicaSettings:t.readReplicaSettings.slice(0,20),failoverSettings:t.failoverSettings.slice(0,20),collationAndEncoding:t.collationAndEncoding.slice(0,20),queryTimeoutDefaults:t.queryTimeoutDefaults.slice(0,20),manualIndexes:t.manualIndexes.map(Zt).slice(0,ue),tables:t.tables.map(Zt).slice(0,ue),views:t.views.map(Zt).slice(0,ue),storedProcedures:t.storedProcedures.map(Zt).slice(0,ue),triggers:t.triggers.map(Zt).slice(0,ue),rowLevelSecurityPolicies:t.rowLevelSecurityPolicies.slice(0,20),otherServices:t.otherServices.slice(0,20)}}function sp(t){let e=new Set;return {integrations:t.integrations.filter(s=>{let r=s.provider.split(":")[0];return e.has(r)?false:(e.add(r),true)}).slice(0,ue).map(s=>({provider:s.provider,endpoint:"",version:s.version,parameters:[],configOptions:[],authHints:[],files:[]})),openApiSpecifications:t.openApiSpecifications.slice(0,10),webhookUrls:t.webhookUrls.slice(0,20),callbackEndpoints:t.callbackEndpoints.slice(0,20),apiVersionPins:t.apiVersionPins.slice(0,20),tokenExpirationPolicies:t.tokenExpirationPolicies.slice(0,20),rateLimitOverrides:t.rateLimitOverrides.slice(0,20),customHeaders:t.customHeaders.slice(0,20),corsPolicies:t.corsPolicies.slice(0,20),oauthScopes:t.oauthScopes.slice(0,20),apiTokens:[]}}function rp(t){return {faviconFiles:t.faviconFiles.slice(0,1),productLogos:[]}}function op(t){let e={...t};if(e.extended){let n={...e.extended};if(n.dataStores&&(n.dataStores=np(n.dataStores)),n.apiSurface&&(n.apiSurface=sp(n.apiSurface)),n.assetBranding&&(n.assetBranding=rp(n.assetBranding)),n.uiPurpose){let s=Ku(n.uiPurpose);n.uiPurpose={enabled:n.uiPurpose.enabled,detectedFrameworks:s.detectedFrameworks,evidenceCount:s.originalCount,capped:n.uiPurpose.capped,topEvidence:[],unknownSignals:[],compacted:s};}if(n.runtimeConfiguration&&(n.runtimeConfiguration={...n.runtimeConfiguration,environmentVariables:n.runtimeConfiguration.environmentVariables.slice(0,100),hiddenConfigFiles:n.runtimeConfiguration.hiddenConfigFiles.slice(0,ue),startupArguments:n.runtimeConfiguration.startupArguments.slice(0,100)}),n.operationalResilience){let s=n.operationalResilience;n.operationalResilience={implicitTimeouts:s.implicitTimeouts.slice(0,30),defaultPaginationSize:s.defaultPaginationSize.slice(0,30),implicitRetryLogic:s.implicitRetryLogic.slice(0,30),defaultLocale:s.defaultLocale.slice(0,20),defaultCurrency:s.defaultCurrency.slice(0,20),implicitTimezone:s.implicitTimezone.slice(0,20),defaultCharacterEncoding:s.defaultCharacterEncoding.slice(0,20),sessionStores:s.sessionStores.slice(0,20),distributedLocks:s.distributedLocks.slice(0,20),jobSchedulers:s.jobSchedulers.slice(0,30),idempotencyKeys:s.idempotencyKeys.slice(0,20),rateLimitingCounters:s.rateLimitingCounters.slice(0,20),circuitBreakerState:s.circuitBreakerState.slice(0,20),abTestToggles:s.abTestToggles.slice(0,20),regionalEnablementRules:s.regionalEnablementRules.slice(0,20),betaAccessGroups:s.betaAccessGroups.slice(0,20),licensingEnforcementLogic:s.licensingEnforcementLogic.slice(0,20),killSwitches:s.killSwitches.slice(0,20),connectorRetryLogic:s.connectorRetryLogic.slice(0,20),apiPollingIntervals:s.apiPollingIntervals.slice(0,20),fieldMappings:s.fieldMappings.slice(0,20),schemaRegistryRules:s.schemaRegistryRules.slice(0,20),deadLetterQueueBehavior:s.deadLetterQueueBehavior.slice(0,20),dataMaskingRules:s.dataMaskingRules.slice(0,20),transformationLogic:s.transformationLogic.slice(0,20),timezoneHandling:s.timezoneHandling.slice(0,20),encryptionSettings:s.encryptionSettings.slice(0,30),hardcodedSecretSignals:s.hardcodedSecretSignals.slice(0,20)};}n.dependencyGraph&&(n.dependencyGraph={...n.dependencyGraph,phantomDependencies:n.dependencyGraph.phantomDependencies.slice(0,ue),phantomDependencyDetails:n.dependencyGraph.phantomDependencyDetails?.slice(0,ue),duplicatedPackages:n.dependencyGraph.duplicatedPackages.slice(0,ue)}),e.extended=n;}return e}async function ip(t){let e=JSON.stringify(t);return tp(e,{level:9})}async function bf(t){let e=op(t);return {body:await ip(e),contentEncoding:"gzip"}}function ap(t){let n=t.replace(/[\x00-\x1F\x7F\uFEFF\u200B-\u200D\u2060]/g,"").trim().match(/^vibgrate\+(https?):?\/\/([^:]+):([^@]+)@([^/]+)\/(.+)$/);return n?{scheme:n[1],keyId:n[2],secret:n[3],host:n[4],workspaceId:n[5]}:null}async function vf(t,e,n){let s=e,r=new URL(`${t.scheme}://${s}/v1/ingest/scan/preflight`);n?.repositoryName&&r.searchParams.set("repository",n.repositoryName),n?.vcsSha&&r.searchParams.set("vcsSha",n.vcsSha);let o=String(Date.now()),a=await fetch(r.toString(),{method:"GET",headers:{"X-Vibgrate-Timestamp":o,Authorization:`VibgrateDSN ${t.keyId}:${t.secret}`}}),i=await a.json();if(!a.ok&&i.status!=="error")throw new Error(`HTTP ${a.status}: ${JSON.stringify(i)}`);return i}async function cp(t){let e=_.join(t,"package.json"),n$1=_.basename(t);if(await p(e))try{let s=await n(e);typeof s.name=="string"&&s.name.trim()&&(n$1=s.name.trim());}catch{}return n$1}var lp=new Set(["node_modules",".git",".vibgrate",".wrangler",".next","dist","build","out",".turbo",".cache","coverage","bin","obj",".vs","TestResults",".nuxt",".output",".svelte-kit"]);async function wf(t,e){let n=e??await Ao(t);if(n.type==="git"&&n.sha)return {vcsSha:n.sha,method:"git_sha"};let s=await up(t);return s?{treeHash:s,method:"tree_metadata"}:{method:"unknown"}}async function up(t,e){let n=e?.maxFilesPerDirectory??500,s=[];async function r(a,i){let c;try{c=await ye.readdir(a,{withFileTypes:!0});}catch{return}let l=c.filter(u=>u.isFile());if(l.length>n){s.push(`${i||"."}|dir_overflow|${l.length}`);return}for(let u of c){if(u.isDirectory()){if(lp.has(u.name))continue;let f=i?`${i}/${u.name}`:u.name;await r(_.join(a,u.name),f);continue}if(!u.isFile())continue;let p=i?`${i}/${u.name}`:u.name,d=_.join(a,u.name);try{let f=await ye.stat(d);s.push(`${p}|${f.size}|${f.mtimeMs}`);}catch{}}}if(await r(_.resolve(t),""),s.length===0)return;s.sort();let o=Ss.createHash("sha256");for(let a of s)o.update(a),o.update(`
|
|
62
|
+
`);return o.digest("hex")}var hp="https://api.vibgrate.com",mp=1e3*60*60*24,gp=5e3;function ms(t){return !!t&&typeof t=="object"&&typeof t.generatedAt=="string"&&typeof t.products=="object"&&t.products!==null}var yp=class{apiBase;offline;manifest;cacheDir;fetchImpl;resolution=null;constructor(t={}){this.apiBase=(t.apiBase??process.env.VIBGRATE_API_BASE??hp).replace(/\/+$/,""),this.offline=t.offline??false,this.manifest=t.manifest,this.cacheDir=t.cacheDir??_.join(on.homedir(),".vibgrate","cache"),this.fetchImpl=t.fetchImpl??globalThis.fetch;}resolve(){return this.resolution||(this.resolution=this.doResolve()),this.resolution}get cacheFile(){return _.join(this.cacheDir,"runtimes.json")}async doResolve(){let t;if(!this.offline){let n=await this.readCache();if(n){if(Date.now()-Date.parse(n.fetchedAt)<mp)return {catalog:n.catalog,source:"cache"};t=n.catalog;}let s=await this.fetchFromApi();if(s)return await this.writeCache(s),{catalog:s,source:"api"}}let e=this.manifest?.runtimes;return ms(e)?{catalog:e,source:"manifest"}:t&&Date.parse(t.generatedAt)>Date.parse(Ee.generatedAt)?{catalog:t,source:"cache"}:{catalog:Ee,source:"bundled"}}async fetchFromApi(){if(!this.fetchImpl)return null;let t=new AbortController,e=setTimeout(()=>t.abort(),gp);try{let n=await this.fetchImpl(`${this.apiBase}/v1/reference/runtimes`,{signal:t.signal,headers:{Accept:"application/json"}});if(!n.ok)return null;let s=await n.json();return ms(s)?s:null}catch{return null}finally{clearTimeout(e);}}async readCache(){try{let t=await readFile(this.cacheFile,"utf8"),e=JSON.parse(t);if(e&&typeof e.fetchedAt=="string"&&ms(e.catalog))return e}catch{}return null}async writeCache(t){try{await mkdir(this.cacheDir,{recursive:!0});let e={fetchedAt:new Date().toISOString(),catalog:t};await writeFile(this.cacheFile,JSON.stringify(e),"utf8");}catch{}}},kp=class Io{constructor(e){this.outPath=e;}events=[];start=Date.now();lastThrottled=new Map;flushed=false;static fromEnv(){let e=process.env.VIBGRATE_TRACE_EVENTS;return e?new Io(e):null}record(e,n={}){this.flushed||this.events.push({t:Date.now()-this.start,op:e,...n});}recordThrottled(e,n,s={},r=120){if(this.flushed)return;let o=Date.now(),a=this.lastThrottled.get(e)??0;o-a<r||(this.lastThrottled.set(e,o),this.record(n,s));}flush(e){if(this.flushed)return;this.flushed=true;let n={traceVersion:1,cliVersion:e.cliVersion,workspace:basename(e.rootDir)||e.rootDir,recordedAt:new Date().toISOString(),durationMs:Date.now()-this.start,events:this.events};try{mkdirSync(dirname(this.outPath),{recursive:!0}),writeFileSync(this.outPath,JSON.stringify(n));}catch{}}},In=[E.cyan(" \u256D\u2500\u2500\u2500\u256E")+E.greenBright("\u279C"),E.cyan(" \u256D\u2524")+E.greenBright("\u25C9 \u25C9")+E.cyan("\u251C\u256E"),E.cyan(" \u2570\u2524")+E.dim("\u2500\u2500\u2500")+E.cyan("\u251C\u256F"),E.cyan(" \u2570\u2500\u2500\u2500\u256F")];function eo(t){return [E.bold.white(" V I B G R A T E"),E.dim(" Drift Intelligence Engine")+E.dim(` v${t}`)]}var to=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],Ep=class{steps=[];stats={projects:0,dependencies:0,frameworks:0,findings:{warnings:0,errors:0,notes:0}};spinnerFrame=0;timer=null;lastRowCount=0;startTime=Date.now();isTTY;useLiveUpdates;rootDir="";lastFrame="";cursorHidden=false;estimatedTotalMs=null;stepEstimates=new Map;stepStartTimes=new Map;stepTimings=[];lastLoggedStates=new Map;version;trace;constructor(t,e="unknown"){if(this.version=e,this.trace=kp.fromEnv(),this.isTTY=process.stderr.isTTY??false,this.useLiveUpdates=this.isTTY&&process.env.VIBGRATE_PROGRESS_MODE!=="plain",this.rootDir=t,this.isTTY){let n=()=>{this.cursorHidden&&(process.stderr.write("\x1B[?25h"),this.cursorHidden=false);};process.on("exit",n),process.on("SIGINT",()=>{n(),process.exit(130);}),process.on("SIGTERM",()=>{n(),process.exit(143);});}}setEstimatedTotal(t){this.estimatedTotalMs=t,this.trace?.record("setEstimatedTotal",{estimatedMs:t});}setStepEstimates(t){this.stepEstimates=t;}getStepTimings(){return [...this.stepTimings]}setSteps(t){if(this.steps=t.map(e=>({...e,status:"pending",weight:e.weight??1})),this.trace?.record("setSteps",{steps:t.map(e=>({id:e.id,label:e.label,weight:e.weight??1}))}),this.isTTY){let e=["",` ${In[0]} ${eo(this.version)[0]}`,` ${In[1]} ${eo(this.version)[1]}`,` ${In[2]}`,` ${In[3]} ${E.dim(this.rootDir)}`,""].join(`
|
|
63
|
+
`)+`
|
|
64
|
+
`;process.stderr.write(e),this.useLiveUpdates&&this.startSpinner();}this.render();}insertStepBefore(t,e){let n=this.steps.findIndex(r=>r.id===t),s={...e,status:"pending",weight:e.weight??1};n>=0?this.steps.splice(n,0,s):this.steps.push(s),this.trace?.record("insertStepBefore",{beforeId:t,step:{id:e.id,label:e.label,weight:e.weight??1}});}startStep(t,e){let n=this.steps.find(s=>s.id===t);n&&(n.status="active",n.detail=void 0,n.count=void 0,n.subProgress=0,n.subTotal=e),this.stepStartTimes.set(t,Date.now()),this.trace?.record("startStep",{id:t,subTotal:e}),this.render();}completeStep(t,e,n){let s=this.steps.find(o=>o.id===t);s&&(s.status="done",s.detail=e,s.count=n);let r=this.stepStartTimes.get(t);r&&this.stepTimings.push({id:t,durationMs:Date.now()-r}),this.trace?.record("completeStep",{id:t,detail:e,count:n}),this.render();}skipStep(t){let e=this.steps.find(n=>n.id===t);e&&(e.status="skipped",e.detail="disabled"),this.trace?.record("skipStep",{id:t}),this.render();}updateStepProgress(t,e,n,s){let r=this.steps.find(o=>o.id===t);r&&(r.subProgress=e,n!==void 0&&(r.subTotal=n),s!==void 0&&(r.subLabel=s)),this.trace?.recordThrottled(`sub:${t}`,"updateStepProgress",{id:t,current:e,total:n,label:s}),this.render();}updateStats(t){Object.assign(this.stats,t),this.traceStats(true),this.render();}addProjects(t){this.stats.projects+=t,this.traceStats(),this.render();}addDependencies(t){this.stats.dependencies+=t,this.traceStats(),this.render();}addFrameworks(t){this.stats.frameworks+=t,this.traceStats(),this.render();}addFindings(t,e,n){this.stats.findings.warnings+=t,this.stats.findings.errors+=e,this.stats.findings.notes+=n,this.traceStats(),this.render();}traceStats(t=false){if(!this.trace)return;let e={stats:{...this.stats,findings:{...this.stats.findings},treeSummary:this.stats.treeSummary?{...this.stats.treeSummary}:void 0}};t?this.trace.record("stats",e):this.trace.recordThrottled("stats","stats",e);}finish(){if(this.timer&&(clearInterval(this.timer),this.timer=null),this.isTTY){let n="";this.lastRowCount>0&&(n+=`\x1B[${this.lastRowCount}A`,n+="\x1B[J"),n+="\x1B[?25h",n&&process.stderr.write(n),this.cursorHidden=false,this.lastRowCount=0;}let t=this.formatElapsed(Date.now()-this.startTime),e=this.steps.filter(n=>n.status==="done").length;process.stderr.write(E.dim(` \u2714 ${e} scanners completed in ${t}
|
|
65
|
+
|
|
66
|
+
`)),this.trace?.record("finish",{doneCount:e,elapsedMs:Date.now()-this.startTime,summary:`${e} scanners completed in ${t}`}),this.trace?.flush({cliVersion:this.version,rootDir:this.rootDir}),this.isTTY&&process.platform==="win32"&&process.stdout.write("\x1B[0G\x1B[K");}startSpinner(){this.cursorHidden||(process.stderr.write("\x1B[?25l"),this.cursorHidden=true),this.timer=setInterval(()=>{this.spinnerFrame=(this.spinnerFrame+1)%to.length,this.render();},120);}clearLines(){}render(){if(!this.useLiveUpdates){this.renderCI();return}let t=[];for(let g of this.steps)t.push(this.renderStep(g));t.push("");let e=this.steps.reduce((g,h)=>g+(h.weight??1),0),n=0;for(let g of this.steps){let h=g.weight??1;if(g.status==="done"||g.status==="skipped")n+=h;else if(g.status==="active"&&g.subTotal&&g.subTotal>0&&g.subProgress!==void 0)n+=h*Math.min(g.subProgress/g.subTotal,.99);else if(g.status==="active"){let y=this.stepStartTimes.get(g.id),j=this.stepEstimates.get(g.id);if(y&&j&&j>0){let C=Date.now()-y;n+=h*Math.min(C/j,.95);}}}let s=e>0?Math.min(Math.round(n/e*100),99):0,r=30,o=Math.round(n/Math.max(e,1)*r),a=E.greenBright("\u2501".repeat(Math.min(o,r)))+E.dim("\u254C".repeat(Math.max(r-o,0))),i=Date.now()-this.startTime,c=this.formatElapsed(i),l=this.computeEtaString(i,n,e),u=this.stats.treeSummary?E.dim(` \xB7 ${this.stats.treeSummary.totalFiles.toLocaleString()} files \xB7 ${this.stats.treeSummary.totalDirs.toLocaleString()} dirs`):"";t.push(` ${a} ${E.bold.white(`${s}%`)} ${E.dim(c)}${l}${u}`),t.push(""),t.push(this.renderStats()),t.push("");let p=t.join(`
|
|
67
|
+
`)+`
|
|
68
|
+
`,d=this.countRenderedRows(t);if(p===this.lastFrame&&this.lastRowCount===d)return;this.lastFrame=p;let f="";this.lastRowCount>0&&(f+=`\x1B[${this.lastRowCount}A`,f+="\x1B[J"),f+=p,process.stderr.write(f),this.lastRowCount=d;}countRenderedRows(t){let e=Math.max(process.stderr.columns??80,20);return t.reduce((n,s)=>n+this.countWrappedRows(s,e),0)}countWrappedRows(t,e){let n=Math.max(this.getDisplayWidth(t),1);return Math.max(1,Math.ceil(n/e))}getDisplayWidth(t){let e=this.stripAnsi(t).replace(/\r/g,""),n=0;for(let s of e){let r=s.codePointAt(0);r!==void 0&&(r>=0&&r<32||r>=127&&r<160||(n+=this.isWideCodePoint(r)?2:1));}return n}stripAnsi(t){return t.replace(/\x1b(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\))/g,"")}isWideCodePoint(t){return t>=4352&&(t<=4447||t===9001||t===9002||t>=11904&&t<=42191&&t!==12351||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65135||t>=65280&&t<=65376||t>=65504&&t<=65510||t>=127744&&t<=128591||t>=129280&&t<=129535||t>=131072&&t<=262141)}renderStep(t){let e=to[this.spinnerFrame],n,s,r="";switch(t.status){case "done":n=E.green("\u2714"),s=E.white(t.label);break;case "active":if(n=E.cyan(e),s=E.bold.white(t.label),t.subTotal&&t.subTotal>0&&t.subProgress!==void 0&&t.subProgress>0&&(r=E.dim(` \xB7 ${t.subProgress.toLocaleString()} / ${t.subTotal.toLocaleString()}`)),t.subLabel){let a=t.subLabel.length>50?"\u2026"+t.subLabel.slice(-49):t.subLabel;r+=E.dim(` ${a}`);}break;case "skipped":n=E.dim("\u25CC"),s=E.dim.strikethrough(t.label);break;default:n=E.dim("\u25CB"),s=E.dim(t.label);break}return t.detail&&(r=E.dim(` \xB7 ${t.detail}`)),t.count!==void 0&&t.count>0&&(r+=E.cyan(` (${t.count})`)),` ${n} ${s}${r}`}renderStats(){let t=this.stats.projects,e=this.stats.dependencies,n=this.stats.frameworks,s=this.stats.findings.warnings,r=this.stats.findings.errors,o=this.stats.findings.notes,a=[E.bold.white(` ${t}`)+E.dim(` project${t!==1?"s":""}`),E.white(`${e}`)+E.dim(` dep${e!==1?"s":""}`),E.white(`${n}`)+E.dim(` framework${n!==1?"s":""}`)],i=[];return r>0&&i.push(E.red(`${r} \u2716`)),s>0&&i.push(E.yellow(`${s} \u26A0`)),o>0&&i.push(E.blue(`${o} \u2139`)),i.length>0&&a.push(i.join(E.dim(" \xB7 "))),` ${E.dim("\u2503")} ${a.join(E.dim(" \u2502 "))}`}renderCI(){for(let t of this.steps){let e=t.status==="done"?[t.status,t.detail??"",t.count?.toString()??""].join("|"):t.status;if(this.lastLoggedStates.get(t.id)!==e){if(this.lastLoggedStates.set(t.id,e),t.status==="active"){process.stderr.write(` \u25C9 ${t.label}...
|
|
69
|
+
`);continue}if(t.status==="done"){let n=this.formatLoggedStepDetail(t);process.stderr.write(` \u2714 ${t.label}${n}
|
|
70
|
+
`);continue}if(t.status==="skipped"){let n=t.detail?` \xB7 ${t.detail}`:"";process.stderr.write(` \u25CC ${t.label}${n}
|
|
71
|
+
`);}}}}formatLoggedStepDetail(t){let e="";return t.detail&&(e+=` \xB7 ${t.detail}`),t.count!==void 0&&t.count>0&&(e+=` (${t.count})`),e}formatElapsed(t){let e=t/1e3;if(e<90)return `${e.toFixed(1)}s`;let n=Math.floor(e/60),s=Math.floor(e%60);return `${n}m ${s.toString().padStart(2,"0")}s`}computeEtaString(t,e,n){if(n===0||t<2e3)return "";let s=e/n;if(s<.03){if(this.estimatedTotalMs!==null&&this.estimatedTotalMs>0){let a=Math.max(0,this.estimatedTotalMs-t);if(a>1e3)return E.dim(` \xB7 ~${this.formatElapsed(a)} left`)}return ""}let r=t/s*(1-s),o;if(this.estimatedTotalMs!==null&&this.estimatedTotalMs>0){let a=Math.max(0,this.estimatedTotalMs-t),i=Math.max(.1,1-s),c=a*i+r*(1-i);o=Math.min(a,c);}else o=r;return o<1500?"":E.dim(` \xB7 ~${this.formatElapsed(o)} left`)}},_o="scan_history.json",no=10;async function Fo(t){let e=_.join(t,".vibgrate",_o);try{let n=await ye.readFile(e,"utf8"),s=JSON.parse(n);return s.version===1&&Array.isArray(s.records)?s:null}catch{return null}}async function jp(t,e){let n=_.join(t,".vibgrate"),s=_.join(n,_o),r,o=await Fo(t);o?(r=o,r.records.push(e),r.records.length>no&&(r.records=r.records.slice(-no))):r={version:1,records:[e]};try{await ye.mkdir(n,{recursive:!0}),await ye.writeFile(s,JSON.stringify(r,null,2)+`
|
|
72
|
+
`,"utf8");}catch{}}function xp(t,e){if(!t||t.records.length===0)return null;let n=t.records.filter(r=>{if(r.totalFiles===0||e===0)return false;let o=e/r.totalFiles;return o>=.33&&o<=3});if(n.length>0){let r=0,o=0;for(let a=0;a<n.length;a++){let i=n[a],c=a+1,l=e/i.totalFiles;r+=i.totalDurationMs*l*c,o+=c;}return Math.round(r/o)}let s=t.records[t.records.length-1];if(s.totalFiles>0&&e>0){let r=e/s.totalFiles;return Math.round(s.totalDurationMs*r)}return s.totalDurationMs}function Tp(t,e){let n=new Map;if(!t||t.records.length===0)return n;let s=null;for(let o=t.records.length-1;o>=0;o--){let a=t.records[o];if(a.steps.length>0){s=a;break}}if(!s)return n;let r=s.totalFiles>0&&e>0?e/s.totalFiles:1;for(let o of s.steps)n.set(o.id,Math.round(o.durationMs*r));return n}async function Cp(t,e){let n=await e.findSolutionFiles(t),s=[];for(let r of n)try{let o=await e.readTextFile(r),a=_.dirname(r),c=[_.basename(t),_.relative(t,r).replace(/\\/g,"/")].join("/"),l=new Set,u=/Project\("[^"]*"\)\s*=\s*"([^"]*)",\s*"([^"]+\.(?:cs|vb)proj)"/g,p;for(;(p=u.exec(o))!==null;){let f=p[2],g=_.resolve(a,f.replace(/\\/g,"/"));l.add(_.relative(t,g).replace(/\\/g,"/"));}let d=_.basename(r,_.extname(r));s.push({path:c,name:d,type:"dotnet-sln",projectPaths:[...l]});}catch{}return s}async function Tf(t,e$1,n$1){let s$1=e$1.vibgrateVersion??"unknown",r$1=Date.now(),o=await fa(t),a=new a$1(e$1.concurrency),i=e$1.packageManifest?await za(e$1.packageManifest):void 0,c=e$1.offline===true,l=e$1.maxPrivacy===true,u=new ec(t,a,i,c),p$1=new xu(a,i,c),d$1=new Tu(a,i,c),f=new Cu(a,i,c),g=new Au(a,i,c),h=new Pu(a,i,c),y=new Mu(a,i,c),j=new $u(a,i,c),C=new Lu(a,i,c),A=new Nu(a,i,c),T=new d,v=[...new Set([...o.exclude??[],...e$1.exclude??[]])];T.setExcludePatterns(v);let b=(e$1.projectScanTimeout??o.projectScanTimeout??180)*1e3;T.setMaxFileSize(o.maxFileSizeToScan??5242880),T.setProjectScanTimeout(b);let S=o.scanners,w=0,x=k=>{w+=k;},m=new Ep(t,s$1),P=[{id:"config",label:"Loading configuration"},{id:"discovery",label:"Discovering workspace",weight:3},{id:"vcs",label:"Detecting version control"},{id:"walk",label:"Indexing files",weight:8},{id:"drift",label:"Computing drift score"},{id:"findings",label:"Generating findings"}];if(m.setSteps(P),m.completeStep("config","loaded"),!(c?true:await tc(t))){m.finish();let k=["",E.red.bold(" \u2716 Vibgrate cannot connect to the npm registry to check package versions."),"",E.dim(" Possible causes:"),E.dim(" \u2022 No internet connection"),E.dim(" \u2022 Corporate proxy/firewall blocking registry.npmjs.org"),E.dim(" \u2022 npm is not installed or not in PATH"),"",E.dim(" Try running: ")+E.cyan("npm view npm dist-tags.latest"),""].join(`
|
|
73
|
+
`);throw new Error(k)}let ce=await new yp({offline:c,manifest:i}).resolve(),ne=ce.catalog,Cs=e(t,v);m.startStep("discovery");let se=await Cs;m.updateStats({treeSummary:se}),m.completeStep("discovery",`${se.totalFiles.toLocaleString()} files \xB7 ${se.totalDirs.toLocaleString()} dirs`);let As=await Fo(t),Oo=xp(As,se.totalFiles);m.setEstimatedTotal(Oo),m.setStepEstimates(Tp(As,se.totalFiles)),m.startStep("vcs");let ke=await Ao(t),Bo=ke.type!=="unknown"?`${ke.type}${ke.branch?` ${ke.branch}`:""}${ke.shortSha?` @ ${ke.shortSha}`:""}`:"none detected";m.completeStep("vcs",Bo),m.startStep("walk",se.totalFiles),await T.walkDir(t,(k,M)=>{m.updateStepProgress("walk",k,se.totalFiles,M);});let pn=T.getWalkSummary(t);pn&&(pn.totalFiles!==se.totalFiles||pn.totalDirs!==se.totalDirs)&&m.updateStats({treeSummary:pn}),m.completeStep("walk",`${se.totalFiles.toLocaleString()} files indexed`);let Re=await mc(t,u,T,b,ne);if(Re.length>0){m.insertStepBefore("drift",{id:"node",label:"Found Node projects",weight:4}),m.startStep("node");for(let k of Re)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Re.length,m.addProjects(Re.length),m.completeStep("node",`${Re.length} project${Re.length!==1?"s":""}`,Re.length);}let Ie=await wc(t,p$1,T,b,ne);if(Ie.length>0){m.insertStepBefore("drift",{id:"dotnet",label:"Found .NET projects",weight:2}),m.startStep("dotnet");for(let k of Ie)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Ie.length,m.addProjects(Ie.length),m.completeStep("dotnet",`${Ie.length} project${Ie.length!==1?"s":""}`,Ie.length);}let _e=await Ac(t,d$1,T,b,ne);if(_e.length>0){m.insertStepBefore("drift",{id:"python",label:"Found Python projects",weight:3}),m.startStep("python");for(let k of _e)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=_e.length,m.addProjects(_e.length),m.completeStep("python",`${_e.length} project${_e.length!==1?"s":""}`,_e.length);}let Fe=await Ic(t,f,T,b,ne);if(Fe.length>0){m.insertStepBefore("drift",{id:"java",label:"Found Java projects",weight:3}),m.startStep("java");for(let k of Fe)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Fe.length,m.addProjects(Fe.length),m.completeStep("java",`${Fe.length} project${Fe.length!==1?"s":""}`,Fe.length);}let Oe=await Gc(t,g,T,b,ne);if(Oe.length>0){m.insertStepBefore("drift",{id:"ruby",label:"Found Ruby projects",weight:2}),m.startStep("ruby");for(let k of Oe)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Oe.length,m.addProjects(Oe.length),m.completeStep("ruby",`${Oe.length} project${Oe.length!==1?"s":""}`,Oe.length);}let Be=await Qc(t,h,T,b);if(Be.length>0){m.insertStepBefore("drift",{id:"swift",label:"Found Swift projects",weight:2}),m.startStep("swift");for(let k of Be)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Be.length,m.addProjects(Be.length),m.completeStep("swift",`${Be.length} project${Be.length!==1?"s":""}`,Be.length);}let De=await el(t,y,T,b,ne);if(De.length>0){m.insertStepBefore("drift",{id:"go",label:"Found Go projects",weight:2}),m.startStep("go");for(let k of De)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=De.length,m.addProjects(De.length),m.completeStep("go",`${De.length} project${De.length!==1?"s":""}`,De.length);}let Ve=await ol(t,j,T,b);if(Ve.length>0){m.insertStepBefore("drift",{id:"rust",label:"Found Rust projects",weight:2}),m.startStep("rust");for(let k of Ve)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Ve.length,m.addProjects(Ve.length),m.completeStep("rust",`${Ve.length} project${Ve.length!==1?"s":""}`,Ve.length);}let Ue=await pl(t,C,T,b);if(Ue.length>0){m.insertStepBefore("drift",{id:"php",label:"Found PHP projects",weight:2}),m.startStep("php");for(let k of Ue)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Ue.length,m.addProjects(Ue.length),m.completeStep("php",`${Ue.length} project${Ue.length!==1?"s":""}`,Ue.length);}let qe=await yl(t,A,T,b);if(qe.length>0){m.insertStepBefore("drift",{id:"dart",label:"Found Dart projects",weight:2}),m.startStep("dart");for(let k of qe)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=qe.length,m.addProjects(qe.length),m.completeStep("dart",`${qe.length} project${qe.length!==1?"s":""}`,qe.length);}let Ge=await $l(t,i,T,b,c);if(Ge.length>0){m.insertStepBefore("drift",{id:"elixir",label:"Found Elixir projects",weight:2}),m.startStep("elixir");for(let k of Ge)m.addDependencies(k.dependencies.length),k.frameworks&&m.addFrameworks(k.frameworks.length);w+=Ge.length,m.addProjects(Ge.length),m.completeStep("elixir",`${Ge.length} project${Ge.length!==1?"s":""}`,Ge.length);}let He=await Gl(t,i,T,b,c);if(He.length>0){m.insertStepBefore("drift",{id:"docker",label:"Found Docker images",weight:2}),m.startStep("docker");for(let k of He)m.addDependencies(k.dependencies.length);w+=He.length,m.addProjects(He.length),m.completeStep("docker",`${He.length} project${He.length!==1?"s":""}`,He.length);}let We=await tu(t,i,T,b,c);if(We.length>0){m.insertStepBefore("drift",{id:"helm",label:"Found Helm charts",weight:2}),m.startStep("helm");for(let k of We)m.addDependencies(k.dependencies.length),k.frameworks&&m.addFrameworks(k.frameworks.length);w+=We.length,m.addProjects(We.length),m.completeStep("helm",`${We.length} project${We.length!==1?"s":""}`,We.length);}let ze=await lu(t,i,T,b,c);if(ze.length>0){m.insertStepBefore("drift",{id:"terraform",label:"Found Terraform configs",weight:2}),m.startStep("terraform");for(let k of ze)m.addDependencies(k.dependencies.length);w+=ze.length,m.addProjects(ze.length),m.completeStep("terraform",`${ze.length} project${ze.length!==1?"s":""}`,ze.length);}let Je=await mu(t,T);if(Je.length>0){m.insertStepBefore("drift",{id:"polyglot",label:"Found additional language projects",weight:2}),m.startStep("polyglot");for(let k of Je)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Je.length,m.addProjects(Je.length),m.completeStep("polyglot",`${Je.length} project${Je.length!==1?"s":""}`,Je.length);}let Do=new Set(["docker","helm","terraform"]),Hn=k=>Do.has(k.type)?`${k.type}:${k.path}`:k.path,Vo=[...Re,...Ie,..._e,...Fe,...Oe,...Be,...De,...Ve,...Ue,...qe,...Ge,...He,...We,...ze,...Je],dn=new Map;for(let k of Vo){let M=dn.get(Hn(k));if(!M)dn.set(Hn(k),k);else {let O=Kn=>Kn.dependencies.filter(tt=>tt.resolvedVersion||tt.latestStable).length,Is=O(k)>O(M)||O(k)===O(M)&&k.dependencies.length>M.dependencies.length,qt=Is?k:M,Jn=Is?M:k;if(Jn.projectReferences?.length)if(!qt.projectReferences)qt.projectReferences=Jn.projectReferences;else {let Kn=new Set(qt.projectReferences.map(tt=>tt.path));for(let tt of Jn.projectReferences)Kn.has(tt.path)||qt.projectReferences.push(tt);}dn.set(Hn(k),qt);}}let re=[...dn.values()],Ps=e$1.dsn||process.env.VIBGRATE_DSN,Ms=(Ps?ap(Ps):null)?.workspaceId;for(let k of re){k.drift=ps([k]),k.projectId=Aa(k.path,k.name,Ms);let M=_.resolve(t,k.path);try{let O=await T.sourceMetricsUnder(t,M);k.fileCount===void 0&&(k.fileCount=O.fileCount),k.sizeBytes=O.sizeBytes;}catch{}k.dependencyCount=k.dependencies.length,k.classification=ku({fileCount:k.fileCount,sizeBytes:k.sizeBytes,dependencyCount:k.dependencyCount});}let $s=_.join(t,".vibgrate","solutions.json"),Ls=new Map;if(await p($s))try{let k=await n($s);for(let M of k.solutions??[])M.path&&M.solutionId&&Ls.set(M.path,M.solutionId);}catch{}let xt=(await Cp(t,T)).map(k=>({solutionId:Ls.get(k.path)??Pa(k.path,k.name,Ms),path:k.path,name:k.name,type:k.type,projectPaths:k.projectPaths})),Wn=new Map(re.map(k=>[k.path,k]));for(let k of xt){let M=k.projectPaths.map(O=>Wn.get(O)??Wn.get(_.dirname(O).replace(/\\/g,"/"))).filter(O=>!!O);k.drift=M.length>0?ps(M):void 0;for(let O of M)O.solutionId=k.solutionId,O.solutionName=k.name;}for(let k of re)k.relationshipDiagram=Du(k,re);for(let k of xt)k.relationshipDiagram=Vu(k,re);let Uo=Bu(re),Ut={};n$1&&await n$1({rootDir:t,opts:e$1,config:o,scanners:S,maxPrivacyMode:l,allProjects:re,solutions:xt,projectsByPath:Wn,fileCache:T,progress:m,runtimeCatalog:ne,extended:Ut,addFilesScanned:x});let Ns=(Date.now()-Date.parse(ne.generatedAt))/(1e3*60*60*24),qo=Number.isFinite(Ns)&&Ns>30;Ut.runtimeCatalogInfo={generatedAt:ne.generatedAt,source:ce.source,stale:qo},m.startStep("drift");let zn=ps(re);m.completeStep("drift",`${zn.score}/100 \u2014 ${zn.riskLevel} risk`),m.startStep("findings");let fn=Ca(re,o),hn=fn.filter(k=>k.level==="warning").length,mn=fn.filter(k=>k.level==="error").length,gn=fn.filter(k=>k.level==="note").length;m.addFindings(hn,mn,gn);let yn=[];mn>0&&yn.push(`${mn} error${mn!==1?"s":""}`),hn>0&&yn.push(`${hn} warning${hn!==1?"s":""}`),gn>0&&yn.push(`${gn} note${gn!==1?"s":""}`),m.completeStep("findings",yn.join(", ")||"none"),m.finish();let Tt=T.stuckPaths,Ct=T.skippedLargeFiles;if(Tt.length>0){console.log(E.yellow(`
|
|
74
|
+
\u26A0 ${Tt.length} path${Tt.length===1?"":"s"} timed out (>${Math.round(b/1e3)}s) and ${Tt.length===1?"was":"were"} skipped:`));for(let O of Tt)console.log(E.dim(` \u2192 ${O}`));let k=Tt.map(O=>`${O}/**`);await ha(t,k)&&console.log(E.green("\u2714")+` Added ${k.length} pattern${k.length!==1?"s":""} to exclude list in config`);}if(Ct.length>0){let M=((o.maxFileSizeToScan??5242880)/1048576).toFixed(0);console.log(E.yellow(`
|
|
75
|
+
\u26A0 ${Ct.length} file${Ct.length===1?"":"s"} skipped (>${M} MB):`));for(let O of Ct.slice(0,10))console.log(E.dim(` \u2192 ${O}`));Ct.length>10&&console.log(E.dim(` \u2026 and ${Ct.length-10} more`));}T.clear(),re.length===0&&console.log(E.yellow("No projects found."));let Rs=Date.now()-r$1,Go=await Ap(t,ke.remoteUrl,Ut.buildDeploy?.ci,e$1.repositoryName),Ho=ju(re),ae={schemaVersion:"1.0",timestamp:new Date().toISOString(),vibgrateVersion:s$1,rootPath:_.basename(t),...ke.type!=="unknown"?{vcs:ke}:{},repository:Go,projects:re,...xt.length>0?{solutions:xt}:{},drift:zn,findings:fn,...Object.keys(Ut).length>0?{extended:Ut}:{},durationMs:Rs,filesScanned:w,treeSummary:se,relationshipDiagram:Uo,billing:Ho};if(e$1.baseline){let k=_.resolve(e$1.baseline);if(await p(k))try{let M=await n(k);ae.baseline=k,ae.delta=ae.drift.score-M.drift.score;}catch{console.error(E.yellow(`Warning: Could not read baseline file: ${k}`));}}if(!e$1.noLocalArtifacts&&!l){let k=_.join(t,".vibgrate");await q$1(k),await r(_.join(k,"scan_result.json"),ae),await r(_.join(k,"solutions.json"),{scannedAt:ae.timestamp,solutions:xt.map(M=>({solutionId:M.solutionId,name:M.name,path:M.path,type:M.type,projectPaths:M.projectPaths}))});}if(!e$1.noLocalArtifacts&&!l&&await jp(t,{timestamp:ae.timestamp,totalDurationMs:Rs,totalFiles:se.totalFiles,totalDirs:se.totalDirs,steps:m.getStepTimings()}),!e$1.noLocalArtifacts&&!l){let k={};for(let M of re)M.drift&&M.path&&(k[M.path]={projectId:M.projectId,name:M.name,type:M.type,path:M.path,score:M.drift.score,riskLevel:M.drift.riskLevel,components:M.drift.components,measured:M.drift.measured,scannedAt:ae.timestamp,vibgrateVersion:s$1,solutionId:M.solutionId,solutionName:M.solutionName});if(Object.keys(k).length>0){let M=_.join(t,".vibgrate");await q$1(M),await r(_.join(M,"project_scores.json"),k);}}if(e$1.format==="json"){let k=JSON.stringify(ae,null,2);e$1.out?(await s(_.resolve(e$1.out),k),console.log(E.green("\u2714")+` JSON written to ${e$1.out}`)):console.log(k);}else if(e$1.format==="sarif"){let k=Fa(ae),M=JSON.stringify(k,null,2);e$1.out?(await s(_.resolve(e$1.out),M),console.log(E.green("\u2714")+` SARIF written to ${e$1.out}`)):console.log(M);}else if(e$1.format==="md"){let k=Da(ae);console.log(k),e$1.out&&await s(_.resolve(e$1.out),k);}else {let k=La(ae);console.log(k),e$1.out&&await s(_.resolve(e$1.out),k);}return ae}async function Ap(t,e,n$1,s){let r=s?.trim()?s.trim():await cp(t),o,a=_.join(t,"package.json");if(await p(a))try{let i=await n(a);typeof i.version=="string"&&i.version.trim()&&(o=i.version.trim());}catch{}return {name:r,...o?{version:o}:{},...n$1&&n$1.length>0?{pipeline:n$1.join(",")}:{},...e?{remoteUrl:e}:{}}}export{xu as $,wc as A,Ac as B,Ic as C,Gc as D,Qc as E,el as F,ol as G,pl as H,yl as I,$l as J,Gl as K,tu as L,lu as M,mu as N,gu as O,yu as P,bu as Q,vu as R,wu as S,Su as T,bs as U,vs as V,pf as W,ku as X,Eu as Y,df as Z,ju as _,fa as a,Tu as aa,Zd as b,Cu as ba,ha as c,Au as ca,ya as d,Pu as da,ba as e,Mu as ea,va as f,$u as fa,wa as g,Lu as ga,Rr as h,Nu as ha,ps as i,Ao as ia,Ca as j,Bu as ja,Aa as k,Du as ka,Pa as l,Vu as la,Ma as m,gf as ma,$a as n,Ku as na,Fr as o,bf as oa,ef as p,ap as pa,tf as q,vf as qa,nf as r,cp as ra,sf as s,wf as sa,La as t,up as ta,Fa as u,Tf as ua,Da as v,za as w,ec as x,tc as y,mc as z};
|