@visulima/vis 1.0.0-alpha.46 → 1.0.0-alpha.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +2 -2
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/catalog.js +1 -1
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +2 -2
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler50.js +3 -3
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler60.js +2 -2
- package/dist/packem_chunks/handler62.js +1 -1
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +4 -4
- package/dist/packem_chunks/handler66.js +1 -1
- package/dist/packem_chunks/handler67.js +5 -5
- package/dist/packem_chunks/handler68.js +4 -4
- package/dist/packem_chunks/handler70.js +4 -4
- package/dist/packem_chunks/handler72.js +1 -1
- package/dist/packem_chunks/handler73.js +1 -1
- package/dist/packem_chunks/handler74.js +1 -1
- package/dist/packem_chunks/handler75.js +1 -1
- package/dist/packem_chunks/handler76.js +1 -1
- package/dist/packem_chunks/handler77.js +19 -19
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/index3.js +1 -1
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/ai-analysis-BpVdn20h.js +68 -0
- package/dist/packem_shared/{ai-fix-D1bFLkfk.js → ai-fix-CeGzAT9m.js} +1 -1
- package/dist/packem_shared/{env-DJlbJiFh.js → env-DdQRnEIy.js} +8 -8
- package/dist/packem_shared/{failure-log-Bt7sW4p7.js → failure-log-CKMhqLWr.js} +1 -1
- package/dist/packem_shared/{index-C6tpgeIV.js → index-B_2SjXsl.js} +1 -1
- package/dist/packem_shared/{index-D6fJJDli.js → index-Cg71MisW.js} +1 -1
- package/dist/packem_shared/{lifecycle-XeMei1ED.js → lifecycle-aDTZ8dW1.js} +1 -1
- package/dist/packem_shared/{packument-CY2QDFml.js → packument-aGzYwXKn.js} +1 -1
- package/dist/packem_shared/{provenance-DVHiWZrW.js → provenance-S7y0BRAt.js} +1 -1
- package/dist/packem_shared/{registry-keys-BKEq72qX.js → registry-keys-CRnXATt2.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-UtkNrGKq.js → resolve-explicit-CJGazevw.js} +1 -1
- package/dist/packem_shared/{s1ngularity-DUZtU95L.js → s1ngularity-BLj4Jy8z.js} +1 -1
- package/dist/packem_shared/{scan-progress-BgtHexnt.js → scan-progress-BDcl7Kty.js} +1 -1
- package/dist/packem_shared/{signatures-QoCuUv9E.js → signatures-DoNG2hEr.js} +1 -1
- package/dist/packem_shared/{use-measured-height-BpKmrlkw.js → use-measured-height-CjS7Tks7.js} +1 -1
- package/dist/packem_shared/{vis-update-app-BoCQ4ute.js → vis-update-app-BlocL713.js} +1 -1
- package/index.js +52 -52
- package/package.json +11 -11
- package/dist/packem_shared/ai-analysis-DF_AfeS3.js +0 -68
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as nt}from"node:module";import{U as gt,$ as dt,j as tt,O as U,q as oe,I as mi,s as Ie}from"../packem_shared/index.server-J83sowC4.js";import{o as pe,p as We,L as Jo,t as st,s as ht,i as lt,n as vt,a as yt,b as ct}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as nt}from"node:module";import{U as gt,$ as dt,j as tt,O as U,q as oe,I as mi,s as Ie}from"../packem_shared/index.server-J83sowC4.js";import{o as pe,p as We,L as Jo,t as st,s as ht,i as lt,n as vt,a as yt,b as ct}from"../packem_shared/index-B_2SjXsl.js";import{N as Ke,r as Oe}from"../packem_shared/Table-CcVkyULl-DLWu6XHL.js";import{t as bt}from"../packem_shared/runtime-process-Dmz0vCJy-DUwTvH1J.js";const at=nt(import.meta.url),be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ut=i=>{if(typeof be<"u"&&be.versions&&be.versions.node){const[e,o]=be.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return be.getBuiltinModule(i)}return at(i)},{createRequire:rt}=ut("node:module"),pt=/^#?([a-f\d]{3}|[a-f\d]{6})$/i,Fo=i=>{let[,e]=pt.exec(i)??[];const o=e?e.length:0;if(o===3){const a=e.charAt(0),u=e.charAt(1),g=e.charAt(2);e=a+a+u+u+g+g}else if(o!==6)return globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`[@visulima/colorize] Invalid hex color "${i}"; expected a 3- or 6-digit hex string (e.g. "#96C" or "#E0115F"). Falling back to black.`),[0,0,0];const n=Number.parseInt(e,16);return[n>>16&255,n>>8&255,n&255]},ku=(i,e,o)=>i===e&&e===o?i<8?16:i>248?231:Math.round((i-8)/247*24)+232:16+36*Math.round(i/51)+6*Math.round(e/51)+Math.round(o/51),Ko=i=>{let e,o,n;if(i<8)return 30+i;if(i<16)return 90+(i-8);if(i>=232)e=o=n=((i-232)*10+8)/255;else{i-=16;const g=i%36;e=Math.floor(i/36)/5,o=Math.floor(g/6)/5,n=g%6/5}const a=Math.max(e,o,n)*2;if(a===0)return 30;const u=30+(Math.round(n)<<2|Math.round(o)<<1|Math.round(e));return a===2?u+60:u},na=(i,e,o)=>Ko(ku(i,e,o));function wt({onlyFirst:i=!1}={}){const e="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(e,i?void 0:"g")}const Mi=(i,e,o)=>e>i?e:Math.min(i,o),N=39,W=49,aa=10,ua={close:"",open:""},Lu=i=>{const e=i>0?(h,v)=>({close:`\x1B[${String(v)}m`,open:`\x1B[${String(h)}m`}):()=>ua,o=h=>(v,y,c)=>h(ku(Number(v),Number(y),Number(c))),n=h=>v=>{const[y,c,b]=Fo(v);return h(y,c,b)};let a=h=>e(`38;5;${String(h)}`,N),u=h=>e(`48;5;${String(h)}`,W),g=(h,v,y)=>e(`38;2;${String(h)};${String(v)};${String(y)}`,N),d=(h,v,y)=>e(`48;2;${String(h)};${String(v)};${String(y)}`,W);i===1?(a=h=>e(Ko(Number(h)),N),u=h=>e(Ko(Number(h))+aa,W),g=(h,v,y)=>e(na(Number(h),Number(v),Number(y)),N),d=(h,v,y)=>e(na(Number(h),Number(v),Number(y))+aa,W)):i===2&&(g=o(a),d=o(u));const r={bold:e(1,22),dim:e(2,22),hidden:e(8,28),inverse:e(7,27),italic:e(3,23),overline:e(53,55),reset:e(0,0),strike:e(9,29),strikethrough:e(9,29),underline:e(4,24),visible:ua},s={bgBlack:e(40,W),bgBlackBright:e(100,W),bgBlue:e(44,W),bgBlueBright:e(104,W),bgCyan:e(46,W),bgCyanBright:e(106,W),bgGray:e(100,W),bgGreen:e(42,W),bgGreenBright:e(102,W),bgGrey:e(100,W),bgMagenta:e(45,W),bgMagentaBright:e(105,W),bgRed:e(41,W),bgRedBright:e(101,W),bgWhite:e(47,W),bgWhiteBright:e(107,W),bgYellow:e(43,W),bgYellowBright:e(103,W),black:e(30,N),blackBright:e(90,N),blue:e(34,N),blueBright:e(94,N),cyan:e(36,N),cyanBright:e(96,N),gray:e(90,N),green:e(32,N),greenBright:e(92,N),grey:e(90,N),magenta:e(35,N),magentaBright:e(95,N),red:e(31,N),redBright:e(91,N),white:e(37,N),whiteBright:e(97,N),yellow:e(33,N),yellowBright:e(93,N)},l={bg:h=>u(Mi(h,0,255)),bgHex:n(d),bgRgb:(h,v,y)=>d(Mi(h,0,255),Mi(v,0,255),Mi(y,0,255)),fg:h=>a(Mi(h,0,255)),hex:n(g),rgb:(h,v,y)=>g(Mi(h,0,255),Mi(v,0,255),Mi(y,0,255))};return{baseColors:s,baseStyles:r,styleMethods:l}},Zu=gt();dt();Lu(Zu);const jt=(i,e,o)=>{if(e==="")return i;let n=i.indexOf(e);if(n<0)return i;const a=e.length;let u=0,g="";for(;~n;)g+=i.slice(u,n)+o,u=n+a,n=i.indexOf(e,u);return g+i.slice(u)},mt=(i,e,o)=>{if(!i)return"";let n;if(i.raw===void 0?n=String(i):n=String.raw(i,...e),n.includes("\x1B"))for(let a=o;a;a=a.props)n=jt(n,a.close,a.open);return n.includes(`
|
|
2
2
|
`)&&(n=n.replace(/(\r*\n)/g,`${o.closeStack}$1${o.openStack}`)),o.openStack+n+o.closeStack},ft=function(i){const e=i?.level??Zu,{baseColors:o,baseStyles:n,styleMethods:a}=Lu(e),u={};let g=null;const d=({props:s},{close:l,open:h})=>{const v=(s?.openStack??"")+h,y=l+(s?.closeStack??""),c=(b,...p)=>mt(b,p,c.props);return Object.setPrototypeOf(c,g),c.props={close:l,closeStack:y,open:h,openStack:v,props:s},c.open=v,c.close=y,c},r=s=>String(s);r.strip=s=>s.replaceAll(wt(),"");for(const s in o)u[s]={get(){const l=d(this,o[s]);return Object.defineProperty(this,s,{value:l}),l}};for(const s in n)u[s]={get(){const l=d(this,n[s]);return Object.defineProperty(this,s,{value:l}),l}};for(const s in a)u[s]={get(){return(...l)=>d(this,a[s](...l))}};return u.ansi256=u.fg,u.bgAnsi256=u.bg,g=Object.defineProperties({},u),Object.setPrototypeOf(r,g),r},Yt=i=>(e,...o)=>{if(!Array.isArray(e)||!Array.isArray(e.raw))throw new TypeError("A tagged template literal must be provided");const n=[e.raw[0]];for(let a=1;a<e.raw.length;a+=1)n.push(String(o[a-1]).replaceAll(/[{}\\]/g,String.raw`\$&`),String(e.raw[a]));return i(n.join(""))},kt=new Map([["0","\0"],["\\","\\"],["a","\x07"],["b","\b"],["e","\x1B"],["f","\f"],["n",`
|
|
3
3
|
`],["r","\r"],["t"," "],["v","\v"]]),Su=i=>{const e=i.startsWith("u"),o=i[1]==="{";return e&&!o&&i.length===5||i.startsWith("x")&&i.length===3?String.fromCodePoint(Number.parseInt(i.slice(1),16)):e&&o?String.fromCodePoint(Number.parseInt(i.slice(2,-1),16)):kt.get(i)??i},Lt=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|\{(~)?(#?[\w:]+(?:\([^)]*\))?(?:\.#?[\w:]+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n))|(\})|((?:.|[\r\n\f])+?)/gi,ga=/(?:^|\.)(?:(\w+)(?:\(([^)]*)\))?|#(?=[:a-f\d]{2,})([a-f\d]{6})?(?::([a-f\d]{6}))?)/gi,Zt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,St=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,Jt=/\s*,\s*/,Ct=(i,e)=>{const o=[],n=e.trim().split(Jt);let a;for(const u of n){const g=Number(u);if(!Number.isNaN(g))o.push(g);else if(a=Zt.exec(u))o.push(a[2].replaceAll(St,(d,r,s)=>r?Su(r):s));else throw new Error(`Invalid template style argument: ${u} (in style '${i}')`)}return o},Xt=i=>{ga.lastIndex=0;const e=[];let o;for(;(o=ga.exec(i))!==null;){const n=o[1];o[2]?e.push([n,...Ct(n,o[2])]):o[3]||o[4]?(o[3]&&e.push(["rgb",...Fo(o[3])]),o[4]&&e.push(["bgRgb",...Fo(o[4])])):e.push([n])}return e},da=(i,e)=>{const o={};for(const a of e)for(const u of a.styles)o[u[0]]=a.inverse?void 0:u.slice(1);let n=i;for(const[a,u]of Object.entries(o))if(Array.isArray(u)){if(!(a in n))throw new Error(`Unknown style: ${a}`);n=u.length>0?n[a](...u):n[a]}return n},Ht=i=>e=>{const o=[],n=[];let a=[];if(e.replaceAll(Lt,(u,g,d,r,s,l)=>{if(g)a.push(Su(g));else if(r){const h=a.join("");a=[],n.push(o.length===0?h:da(i,o)(h)),o.push({inverse:d,styles:Xt(r)})}else if(s){if(o.length===0)throw new Error("Found extraneous } in template literal");n.push(da(i,o)(a.join(""))),a=[],o.pop()}else a.push(l)}),n.push(a.join("")),o.length>0)throw new Error(`template literal is missing ${String(o.length)} closing bracket${o.length===1?"":"s"} (\`}\`)`);return n.join("")},Dt=new ft,Tt=Ht(Dt),Bt=Yt(Tt),Qt=rt(import.meta.url),Vi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xe=i=>{if(typeof Vi<"u"&&Vi.versions&&Vi.versions.node){const[e,o]=Vi.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return Vi.getBuiltinModule(i)}return Qt(i)},{createRequire:Mt}=Xe("node:module"),Ri=Vi,{execFileSync:Gt}=Xe("node:child_process"),Ye=Xe("node:fs"),Nt=Xe("node:tty"),Wt=Xe("node:os"),xt=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Pt=12288,Ft=65510,Kt=[12288,12288,65281,65376,65504,65510],Ot=8361,At=65518,Rt=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],_t=32,zt=10630,Et=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],qt=4352,It=262141,Ju=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],He=(i,e)=>{let o=0,n=Math.floor(i.length/2)-1;for(;o<=n;){const a=Math.floor((o+n)/2),u=a*2;if(e<i[u])n=a-1;else if(e>i[u+1])o=a+1;else return!0}return!1},ta=19968,[Ut,$t]=Vt(Ju);function Vt(i){let e=i[0],o=i[1];for(let n=0;n<i.length;n+=2){const a=i[n],u=i[n+1];if(ta>=a&&ta<=u)return[a,u];u-a>o-e&&(e=a,o=u)}return[e,o]}const ir=i=>i<161||i>1114109?!1:He(xt,i),er=i=>i<Pt||i>Ft?!1:He(Kt,i),or=i=>i<Ot||i>At?!1:He(Rt,i),nr=i=>i<_t||i>zt?!1:He(Et,i),ar=i=>i>=Ut&&i<=$t?!0:i<qt||i>It?!1:He(Ju,i);function ur(i){return ir(i)?"ambiguous":er(i)?"fullwidth":or(i)?"halfwidth":nr(i)?"narrow":ar(i)?"wide":"neutral"}function gr(i){if(!Number.isSafeInteger(i))throw new TypeError(`Expected a code point, got \`${typeof i}\`.`)}function Cu(i){return gr(i),ur(i)}const ra=new Map,dr=i=>[i.ambiguousIsNarrow?1:0,i.control,i.fullWidth,i.regular,i.wide].join("|"),tr=i=>{const e=dr(i.width);let o=ra.get(e);return o||(o=new Map,ra.set(e,o)),o},xe=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Xu=i=>i>=32&&i<=126?"latin":i===8203||i===8204||i===8205||i===8288?"zero":i<=31||i>=127&&i<=159?"control":i>=160&&i<=255||i>=9472&&i<=9599?"latin":i>=4352&&i<=4607||i>=11904&&i<=40959||i>=44032&&i<=55215||i>=63744&&i<=64255||i>=65280&&i<=65519&&!(i>=65377&&i<=65439)||i>=12352&&i<=12543?"wide":i===8230?"latin":"other",rr=(i,e)=>{const o=tr(e),n=Math.floor(i/65536),a=i%65536;let u=o.get(n);if(u||(u=new Map,o.set(n,u)),u.has(a))return u.get(a);let g;switch(Xu(i)){case"control":{g=e.width.control;break}case"latin":{g=e.width.regular;break}case"wide":{g=e.width.wide;break}case"zero":{g=0;break}default:switch(Cu(i)){case"ambiguous":{g=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{g=e.width.fullWidth;break}case"wide":{g=e.width.wide;break}default:g=e.width.regular}}return u.set(a,g),g},sr=i=>i>=768&&i<=879||i>=6832&&i<=6911||i>=7616&&i<=7679||i>=8400&&i<=8447||i>=65056&&i<=65071||i>=917760&&i<=917999||i>=65024&&i<=65039||i>=3633&&i<=3642||i>=3655&&i<=3662||i>=3761&&i<=3769||i>=3771&&i<=3772||i>=3784&&i<=3789||i>=2304&&i<=2307||i>=2362&&i<=2383||i>=2385&&i<=2391||i>=2402&&i<=2403||i>=2433&&i<=2435||i>=2492&&i<=2500||i>=2509&&i<=2509||i>=2561&&i<=2563||i>=2620&&i<=2637||i>=1611&&i<=1631||i>=1648&&i<=1648||i>=1750&&i<=1773||i>=2276&&i<=2302||i>=1425&&i<=1469||i>=1471&&i<=1471||i>=1473&&i<=1474||i>=1476&&i<=1477||i>=1479&&i<=1479||i>=3893&&i<=3893||i>=3895&&i<=3895||i>=3897&&i<=3897||i>=3953&&i<=3966||i>=3968&&i<=3972||i>=3974&&i<=3975?!0:i>=768&&i<=777||i>=803&&i<=803,Oo=(i,e={})=>{if(!i||i.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const o={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?Oo(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},n=Math.max(0,o.truncation.limit-o.truncation.ellipsisWidth),{length:a}=i,u=a>1e4;let g=0,d=0,r=a,s=!1;const l=i.includes("\x1B")||i.includes("");for(;g<a;){if(l&&(i[g]==="\x1B"||i[g]==="")){if(i.startsWith("\x1B]8;;",g)){const p="\x1B]8;;\x07",j=p.length,L=i.indexOf("\x07",g+5);if(L!==-1){const R=i.indexOf(p,L+1);if(R!==-1){const _=R+j,q=i.slice(L+1,R).replace(pe,""),Q=Oo(q,{ambiguousIsNarrow:o.width.ambiguousIsNarrow,ansiWidth:o.width.ansi,controlWidth:o.width.control,countAnsiEscapeCodes:!1,ellipsis:o.truncation.ellipsis,ellipsisWidth:o.truncation.ellipsisWidth,emojiWidth:o.width.emoji,fullWidth:o.width.fullWidth,halfWidth:o.width.halfWidth,limit:Math.max(0,n-d),regularWidth:o.width.regular,tabWidth:o.width.tab,wideWidth:o.width.wide}),I=Q.width;if(Q.truncated)s=!0,r=Math.min(r,g);else if(d+I>n&&(r=Math.min(r,g),s=!0,d+I>o.truncation.limit))break;if(d+=I,g=_,s&&d>=o.truncation.limit)break;continue}}}if(pe.lastIndex=g,pe.test(i)){const p=pe.lastIndex-g,j=o.truncation.countAnsiEscapeCodes?p:o.width.ansi;if(d+j>n&&(r=Math.min(r,g),d+j>o.truncation.limit)){s=!0;break}d+=j,g=pe.lastIndex;continue}}const y=i.codePointAt(g);if(y===8203||y===65279||y>=8288&&y<=8292){g+=1;continue}if(y===9){if(d+o.width.tab>n&&(r=Math.min(r,g),d+o.width.tab>o.truncation.limit)){s=!0;break}d+=o.width.tab,g+=1;continue}if(xe.lastIndex=g,xe.test(i)){const p=(xe.lastIndex-g)*o.width.regular;if(d+p>n){const j=Math.floor((n-d)/o.width.regular);if(r=Math.min(r,g+j),d+p>o.truncation.limit){s=!0;break}}d+=p,g=xe.lastIndex;continue}if((y<=31||y>=127&&y<=159)&&(We.lastIndex=g,We.test(i))){const p=(We.lastIndex-g)*o.width.control;if(d+p>n&&(r=Math.min(r,g+Math.floor((n-d)/o.width.control)),d+p>o.truncation.limit)){s=!0;break}d+=p,g=We.lastIndex;continue}if(Jo.lastIndex=g,Jo.test(i)){if(d+o.width.emoji>n&&(r=Math.min(r,g),d+o.width.emoji>o.truncation.limit)){s=!0;break}d+=o.width.emoji,g=Jo.lastIndex;continue}const c=i.codePointAt(g)??0;if(sr(c)){g+=c>65535?2:1;continue}let b;if(u)b=rr(c,o);else switch(Xu(c)){case"control":{b=o.width.control;break}case"latin":{b=o.width.regular;break}case"wide":{b=o.width.wide;break}case"zero":{b=0;break}default:switch(Cu(c)){case"ambiguous":{b=o.width.ambiguousIsNarrow?o.width.regular:o.width.wide;break}case"fullwidth":{b=o.width.fullWidth;break}case"wide":{b=o.width.wide;break}default:b=o.width.regular}}if(d+b>n&&(r=Math.min(r,g),d+b>o.truncation.limit)){s=!0;break}d+=b,g+=c>65535?2:1}let h=d,v=!1;return s&&o.truncation.limit>=o.truncation.ellipsisWidth&&(h=o.truncation.limit,v=!0),{ellipsed:v,index:s?r:a,truncated:s,width:h}},hr=(i,e={})=>Oo(i,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,lr=Mt(import.meta.url),we=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,vr=i=>{if(typeof we<"u"&&we.versions&&we.versions.node){const[e,o]=we.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return we.getBuiltinModule(i)}return lr(i)};vr("node:util");function yr(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Co,sa;function cr(){if(sa)return Co;sa=1,Co=e;function i(n){return n instanceof Buffer?Buffer.from(n):new n.constructor(n.buffer.slice(),n.byteOffset,n.length)}function e(n){if(n=n||{},n.circles)return o(n);const a=new Map;if(a.set(Date,s=>new Date(s)),a.set(Map,(s,l)=>new Map(g(Array.from(s),l))),a.set(Set,(s,l)=>new Set(g(Array.from(s),l))),n.constructorHandlers)for(const s of n.constructorHandlers)a.set(s[0],s[1]);let u=null;return n.proto?r:d;function g(s,l){const h=Object.keys(s),v=new Array(h.length);for(let y=0;y<h.length;y++){const c=h[y],b=s[c];typeof b!="object"||b===null?v[c]=b:b.constructor!==Object&&(u=a.get(b.constructor))?v[c]=u(b,l):ArrayBuffer.isView(b)?v[c]=i(b):v[c]=l(b)}return v}function d(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return g(s,d);if(s.constructor!==Object&&(u=a.get(s.constructor)))return u(s,d);const l={};for(const h in s){if(Object.hasOwnProperty.call(s,h)===!1)continue;const v=s[h];typeof v!="object"||v===null?l[h]=v:v.constructor!==Object&&(u=a.get(v.constructor))?l[h]=u(v,d):ArrayBuffer.isView(v)?l[h]=i(v):l[h]=d(v)}return l}function r(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return g(s,r);if(s.constructor!==Object&&(u=a.get(s.constructor)))return u(s,r);const l={};for(const h in s){const v=s[h];typeof v!="object"||v===null?l[h]=v:v.constructor!==Object&&(u=a.get(v.constructor))?l[h]=u(v,r):ArrayBuffer.isView(v)?l[h]=i(v):l[h]=r(v)}return l}}function o(n){const a=[],u=[],g=new Map;if(g.set(Date,h=>new Date(h)),g.set(Map,(h,v)=>new Map(r(Array.from(h),v))),g.set(Set,(h,v)=>new Set(r(Array.from(h),v))),n.constructorHandlers)for(const h of n.constructorHandlers)g.set(h[0],h[1]);let d=null;return n.proto?l:s;function r(h,v){const y=Object.keys(h),c=new Array(y.length);for(let b=0;b<y.length;b++){const p=y[b],j=h[p];if(typeof j!="object"||j===null)c[p]=j;else if(j.constructor!==Object&&(d=g.get(j.constructor)))c[p]=d(j,v);else if(ArrayBuffer.isView(j))c[p]=i(j);else{const L=a.indexOf(j);L!==-1?c[p]=u[L]:c[p]=v(j)}}return c}function s(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return r(h,s);if(h.constructor!==Object&&(d=g.get(h.constructor)))return d(h,s);const v={};a.push(h),u.push(v);for(const y in h){if(Object.hasOwnProperty.call(h,y)===!1)continue;const c=h[y];if(typeof c!="object"||c===null)v[y]=c;else if(c.constructor!==Object&&(d=g.get(c.constructor)))v[y]=d(c,s);else if(ArrayBuffer.isView(c))v[y]=i(c);else{const b=a.indexOf(c);b!==-1?v[y]=u[b]:v[y]=s(c)}}return a.pop(),u.pop(),v}function l(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return r(h,l);if(h.constructor!==Object&&(d=g.get(h.constructor)))return d(h,l);const v={};a.push(h),u.push(v);for(const y in h){const c=h[y];if(typeof c!="object"||c===null)v[y]=c;else if(c.constructor!==Object&&(d=g.get(c.constructor)))v[y]=d(c,l);else if(ArrayBuffer.isView(c))v[y]=i(c);else{const b=a.indexOf(c);b!==-1?v[y]=u[b]:v[y]=l(c)}}return a.pop(),u.pop(),v}}return Co}var br=cr();const Hu=yr(br);Hu();var Du=typeof global=="object"&&global&&global.Object===Object&&global,pr=typeof self=="object"&&self&&self.Object===Object&&self,O=Du||pr||Function("return this")(),E=O.Symbol,Tu=Object.prototype,wr=Tu.hasOwnProperty,jr=Tu.toString,je=E?E.toStringTag:void 0;function mr(i){var e=wr.call(i,je),o=i[je];try{i[je]=void 0;var n=!0}catch{}var a=jr.call(i);return n&&(e?i[je]=o:delete i[je]),a}var fr=Object.prototype,Yr=fr.toString;function kr(i){return Yr.call(i)}var Lr="[object Null]",Zr="[object Undefined]",ha=E?E.toStringTag:void 0;function V(i){return i==null?i===void 0?Zr:Lr:ha&&ha in Object(i)?mr(i):kr(i)}function x(i){return i!=null&&typeof i=="object"}var Sr="[object Symbol]";function ui(i){return typeof i=="symbol"||x(i)&&V(i)==Sr}var Jr=NaN;function la(i){return typeof i=="number"?i:ui(i)?Jr:+i}function M(i,e){for(var o=-1,n=i==null?0:i.length,a=Array(n);++o<n;)a[o]=e(i[o],o,i);return a}var k=Array.isArray,va=E?E.prototype:void 0,ya=va?va.toString:void 0;function gi(i){if(typeof i=="string")return i;if(k(i))return M(i,gi)+"";if(ui(i))return ya?ya.call(i):"";var e=i+"";return e=="0"&&1/i==-1/0?"-0":e}function eo(i,e){return function(o,n){var a;if(o===void 0&&n===void 0)return e;if(o!==void 0&&(a=o),n!==void 0){if(a===void 0)return n;typeof o=="string"||typeof n=="string"?(o=gi(o),n=gi(n)):(o=la(o),n=la(n)),a=i(o,n)}return a}}var Cr=eo(function(i,e){return i+e},0),Xr=/\s/;function Bu(i){for(var e=i.length;e--&&Xr.test(i.charAt(e)););return e}var Hr=/^\s+/;function Qu(i){return i&&i.slice(0,Bu(i)+1).replace(Hr,"")}function G(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}var ca=NaN,Dr=/^[-+]0x[0-9a-f]+$/i,Tr=/^0b[01]+$/i,Br=/^0o[0-7]+$/i,Qr=parseInt;function si(i){if(typeof i=="number")return i;if(ui(i))return ca;if(G(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=G(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=Qu(i);var o=Tr.test(i);return o||Br.test(i)?Qr(i.slice(2),o?2:8):Dr.test(i)?ca:+i}var ba=1/0,Mr=17976931348623157e292;function Ci(i){if(!i)return i===0?i:0;if(i=si(i),i===ba||i===-ba){var e=i<0?-1:1;return e*Mr}return i===i?i:0}function Z(i){var e=Ci(i),o=e%1;return e===e?o?e-o:e:0}var Gr="Expected a function";function Nr(i,e){if(typeof e!="function")throw new TypeError(Gr);return i=Z(i),function(){if(--i<1)return e.apply(this,arguments)}}function oi(i){return i}var Wr="[object AsyncFunction]",xr="[object Function]",Pr="[object GeneratorFunction]",Fr="[object Proxy]";function Xi(i){if(!G(i))return!1;var e=V(i);return e==xr||e==Pr||e==Wr||e==Fr}var Ae=O["__core-js_shared__"],pa=(function(){var i=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function Kr(i){return!!pa&&pa in i}var Or=Function.prototype,Ar=Or.toString;function qi(i){if(i!=null){try{return Ar.call(i)}catch{}try{return i+""}catch{}}return""}var Rr=/[\\^$.*+?()[\]{}|]/g,_r=/^\[object .+?Constructor\]$/,zr=Function.prototype,Er=Object.prototype,qr=zr.toString,Ir=Er.hasOwnProperty,Ur=RegExp("^"+qr.call(Ir).replace(Rr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mu(i){if(!G(i)||Kr(i))return!1;var e=Xi(i)?Ur:_r;return e.test(qi(i))}function $r(i,e){return i?.[e]}function Ii(i,e){var o=$r(i,e);return Mu(o)?o:void 0}var Le=Ii(O,"WeakMap"),Ue=Le&&new Le,Gu=Ue?function(i,e){return Ue.set(i,e),i}:oi,wa=Object.create,de=(function(){function i(){}return function(e){if(!G(e))return{};if(wa)return wa(e);i.prototype=e;var o=new i;return i.prototype=void 0,o}})();function Ze(i){return function(){var e=arguments;switch(e.length){case 0:return new i;case 1:return new i(e[0]);case 2:return new i(e[0],e[1]);case 3:return new i(e[0],e[1],e[2]);case 4:return new i(e[0],e[1],e[2],e[3]);case 5:return new i(e[0],e[1],e[2],e[3],e[4]);case 6:return new i(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new i(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var o=de(i.prototype),n=i.apply(o,e);return G(n)?n:o}}var Vr=1;function is(i,e,o){var n=e&Vr,a=Ze(i);function u(){var g=this&&this!==O&&this instanceof u?a:i;return g.apply(n?o:this,arguments)}return u}function di(i,e,o){switch(o.length){case 0:return i.call(e);case 1:return i.call(e,o[0]);case 2:return i.call(e,o[0],o[1]);case 3:return i.call(e,o[0],o[1],o[2])}return i.apply(e,o)}var es=Math.max;function Nu(i,e,o,n){for(var a=-1,u=i.length,g=o.length,d=-1,r=e.length,s=es(u-g,0),l=Array(r+s),h=!n;++d<r;)l[d]=e[d];for(;++a<g;)(h||a<u)&&(l[o[a]]=i[a]);for(;s--;)l[d++]=i[a++];return l}var os=Math.max;function Wu(i,e,o,n){for(var a=-1,u=i.length,g=-1,d=o.length,r=-1,s=e.length,l=os(u-d,0),h=Array(l+s),v=!n;++a<l;)h[a]=i[a];for(var y=a;++r<s;)h[y+r]=e[r];for(;++g<d;)(v||a<u)&&(h[y+o[g]]=i[a++]);return h}function ns(i,e){for(var o=i.length,n=0;o--;)i[o]===e&&++n;return n}function oo(){}var as=4294967295;function J(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=as,this.__views__=[]}J.prototype=de(oo.prototype);J.prototype.constructor=J;function gn(){}var dn=Ue?function(i){return Ue.get(i)}:gn,ne={},us=Object.prototype,gs=us.hasOwnProperty;function Re(i){for(var e=i.name+"",o=ne[e],n=gs.call(ne,e)?o.length:0;n--;){var a=o[n],u=a.func;if(u==null||u==i)return a.name}return e}function li(i,e){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}li.prototype=de(oo.prototype);li.prototype.constructor=li;function ei(i,e){var o=-1,n=i.length;for(e||(e=Array(n));++o<n;)e[o]=i[o];return e}function xu(i){if(i instanceof J)return i.clone();var e=new li(i.__wrapped__,i.__chain__);return e.__actions__=ei(i.__actions__),e.__index__=i.__index__,e.__values__=i.__values__,e}var ds=Object.prototype,ts=ds.hasOwnProperty;function t(i){if(x(i)&&!k(i)&&!(i instanceof J)){if(i instanceof li)return i;if(ts.call(i,"__wrapped__"))return xu(i)}return new li(i)}t.prototype=oo.prototype;t.prototype.constructor=t;function Ao(i){var e=Re(i),o=t[e];if(typeof o!="function"||!(e in J.prototype))return!1;if(i===o)return!0;var n=dn(o);return!!n&&i===n[0]}var rs=800,ss=16,hs=Date.now;function Pu(i){var e=0,o=0;return function(){var n=hs(),a=ss-(n-o);if(o=n,a>0){if(++e>=rs)return arguments[0]}else e=0;return i.apply(void 0,arguments)}}var Fu=Pu(Gu),ls=/\{\n\/\* \[wrapped with (.+)\] \*/,vs=/,? & /;function ys(i){var e=i.match(ls);return e?e[1].split(vs):[]}var cs=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function bs(i,e){var o=e.length;if(!o)return i;var n=o-1;return e[n]=(o>1?"& ":"")+e[n],e=e.join(o>2?", ":" "),i.replace(cs,`{
|
|
4
4
|
/* [wrapped with `+e+`] */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{y as U,m as I,I as H,v as b}from"../packem_shared/index-CE6MsgcV.js";import{E as K}from"../packem_shared/public-api-WqUCiyIe.js";import{u as X}from"./ts-loader.js";import{p as Z}from"./cli-main.js";import{k as N,j as A,l as x}from"../packem_shared/env-
|
|
1
|
+
import{y as U,m as I,I as H,v as b}from"../packem_shared/index-CE6MsgcV.js";import{E as K}from"../packem_shared/public-api-WqUCiyIe.js";import{u as X}from"./ts-loader.js";import{p as Z}from"./cli-main.js";import{k as N,j as A,l as x}from"../packem_shared/env-DdQRnEIy.js";const ee=(e,t)=>typeof e!="string"||e===""?"":e[0].toLowerCase()+e.slice(1),k=(e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleUpperCase(t.locale):e[0].toUpperCase())+e.slice(1),te=(e,t)=>`${e}::${t?.joiner??""}::${t?.locale??""}::${t?.knownAcronyms?.join(",")??""}::${t?.normalize?"true":"false"}`,$=(e,t)=>{const{length:r}=e;if(r===0)return"";if(r===1)return e[0];const n=[];let o="",s="";for(let i=0;i<r;i++){const l=e[i];if(N.test(l)){o?(n.push(o+s+l),o="",s=""):(n.length>0&&n.push(t),o=l);continue}o?(s&&(s+=t),s+=l):(n.length>0&&n.push(t),n.push(l))}return n.join("")},ne=/(?<![a-zß])SS(?![a-z])/g,re=e=>e.replaceAll(ne,"ß"),oe=(e,t)=>{if(typeof e!="string"||!e)return"";let r=!0;return $(A(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(o=>{const s=o,i=s.toLowerCase();return r?(r=!1,ee(i)):k(i,t)}),"")},se=new x(1e3),S=(e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??se;let o;if(r&&(o=te(e,t)),r&&o&&n.has(o))return n.get(o);const s=A(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>{if(t?.handleAnsi&&N.test(l))return l;if(t?.toUpperCase)return t.locale?l.toLocaleUpperCase(t.locale):l.toUpperCase();const a=t?.locale?.startsWith("de")?re(l):l;return t?.locale?a.toLocaleLowerCase(t.locale):a.toLowerCase()}),i=$(s,t?.joiner??"-");return r&&o&&n.set(o,i),i},ie=new x(1e3),le=(e,t)=>S(e,{cacheStore:ie,...t,joiner:"_",toUpperCase:!0}),ae=(e,t)=>typeof e!="string"||!e?"":$(A(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(n=>k(n.toLowerCase(),{locale:t?.locale})),""),ce=new x(1e3),fe=(e,t)=>S(e,{cacheStore:ce,...t,joiner:"_"}),ue=(e,t)=>typeof e!="string"?"":$(A(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(n=>k(n,{locale:t?.locale})),"-"),m=e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),T={camel_case:e=>oe(m(e)),kebab_case:e=>S(m(e)),lower_case:e=>m(e).toLowerCase(),pascal_case:e=>ae(m(e)),path_join:(e,...t)=>{const r=[m(e),...t.map(n=>m(n))];return I(...r)},path_relative:(e,t)=>U(m(t),m(e)),snake_case:e=>fe(m(e)),upper_case:e=>m(e).toUpperCase(),upper_kebab_case:e=>ue(m(e)),upper_snake_case:e=>le(m(e))},R=(e,t,r=[])=>{const n=T[e];if(!n)throw new Error(`Unknown filter "${e}". Known filters: ${Object.keys(T).sort().join(", ")}.`);return n(t,...r)},z=e=>{const t=[];let r=0,n=0,o,s=-1;for(const i of e){if(s+=1,o){i===o&&(o=void 0);continue}if(i==='"'||i==="'"){o=i;continue}i==="("?r+=1:i===")"?r-=1:i===","&&r===0&&(t.push(e.slice(n,s)),n=s+1)}return t.push(e.slice(n)),t},pe=e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},me=/\[([^\]]+)\]/g,de=e=>{const t=e.trim(),r=t.indexOf("(");if(r===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const n=t.slice(0,r).trim(),o=t.slice(r+1,-1).trim();return o===""?{args:[],name:n}:{args:z(o).map(s=>{const i=s.trim();return pe(i)??i}),name:n}},he=e=>{const t=e.split("|").map(n=>n.trim()),r=t[0]??"";if(!r)throw new Error(`Empty variable name in expression "${e}"`);return{filters:t.slice(1).map(n=>de(n)),name:r}},ye=e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),ge=(e,t)=>{const r=e.replaceAll(me,(n,o)=>{const{filters:s,name:i}=he(o);if(!Object.hasOwn(t,i))throw new Error(`Variable "${i}" used in filename "${e}" but not defined`);let l=t[i];for(const a of s)l=R(a.name,l,a.args);return ye(l)});return P(r)},P=e=>e.split("/").map(t=>t.endsWith(".tera")||t.endsWith(".twig")?t.slice(0,-5):t).join("/"),we=e=>e.endsWith(".raw")?e.slice(0,-4):e,be=e=>{const t=e.split("/");return(t.at(-1)??"").startsWith("_")?!0:t.slice(0,-1).includes("partials")},Ee=(e,t)=>{if(!e.startsWith(`---
|
|
2
2
|
`)&&!e.startsWith(`---\r
|
|
3
3
|
`))return{body:e};const r=e.indexOf(`
|
|
4
4
|
---`,3);if(r===-1)return{body:e};let n=r+1+3;e[n]==="\r"&&(n+=1),e[n]===`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as r}from"./cli-main.js";import{c as i,f as a}from"../packem_shared/registry-keys-
|
|
1
|
+
import{p as r}from"./cli-main.js";import{c as i,f as a}from"../packem_shared/registry-keys-CRnXATt2.js";const n=async({options:s})=>{if(s.clear){const t=i();if(s.json){process.stdout.write(`${JSON.stringify({cleared:t,refetched:!1},void 0,2)}
|
|
2
2
|
`);return}r.success(t?"Cleared cached npm signing keys.":"No cached npm signing keys to clear.");return}const e=await a({forceRefresh:!0});if(e===void 0){if(s.json){process.stdout.write(`${JSON.stringify({cleared:!1,error:"fetch-failed",refetched:!1},void 0,2)}
|
|
3
3
|
`),process.exitCode=1;return}r.error("Failed to fetch npm signing keys (network error and no cached keys available)."),process.exitCode=1;return}if(s.json){process.stdout.write(`${JSON.stringify({cleared:!1,fromCache:e.fromCache,keyCount:e.keys.length,refetched:!e.fromCache,stale:e.stale??!1},void 0,2)}
|
|
4
4
|
`);return}if(e.fromCache&&e.stale===!0){r.warn(`Network fetch failed — falling back to expired cache (${String(e.keys.length)} keys).`);return}r.success(`Refreshed npm signing keys (${String(e.keys.length)} keys).`)};export{n as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{E as g}from"../packem_shared/index.server-J83sowC4.js";import{p as c}from"./cli-main.js";import{s as $}from"../packem_shared/scan-progress-
|
|
1
|
+
import{E as g}from"../packem_shared/index.server-J83sowC4.js";import{p as c}from"./cli-main.js";import{s as $}from"../packem_shared/scan-progress-BDcl7Kty.js";import{s as w,D as v}from"../packem_shared/advisories-B76fBVL-.js";const S=t=>t?.security?.audit?.advisories??{},D=t=>t?t.split(",").map(r=>r.trim()).filter(r=>r.length>0):["npm"],b=async({logger:t,options:r,visConfig:h,workspaceRoot:d})=>{if(!d)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const l=r.format==="json",u=S(h),m=r.source??u.source??v,p=D(r.ecosystem),y=p.map(s=>({id:s,label:`Sync ${s} advisories`})),n=$(y,{live:!l}),i=[];try{for(const s of p){n.start(s);const o=Date.now();try{const e=await w({allowedHosts:u.allowedHosts,dbPath:r.db,ecosystem:s,force:!!r.force,source:m,workspaceRoot:d});i.push({ecosystem:s,result:e}),e.upToDate?n.finish(s,"ok",`up to date · ${f(Date.now()-o)}`):n.finish(s,"ok",`${e.advisoriesIngested.toLocaleString()} advisories · ${f(e.durationMs)}`)}catch(e){const a=e instanceof Error?e.message:String(e);i.push({ecosystem:s,error:a}),n.finish(s,"error",a)}}}finally{n.stop()}if(l){const s={ecosystems:i.map(o=>({advisoriesIngested:o.result?.advisoriesIngested??0,dbPath:o.result?.dbPath??null,durationMs:o.result?.durationMs??0,ecosystem:o.ecosystem,error:o.error??null,upToDate:o.result?.upToDate??!1})),source:m};process.stdout.write(`${JSON.stringify(s,void 0,2)}
|
|
2
2
|
`)}else{const s=i.filter(a=>a.error),o=i.filter(a=>a.result),e=o[0];e?.result?.dbPath&&c.info(g(`DB: ${e.result.dbPath}`)),s.length===0?c.success(`Synced ${o.length} ecosystem${o.length===1?"":"s"}.`):c.error(`${s.length} ecosystem${s.length===1?"":"s"} failed to sync.`)}i.some(s=>s.error)&&(process.exitCode=1)},f=t=>t>=1e3?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`,R=b;export{R as advisoriesSyncExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{D as b,p}from"./cli-main.js";import{A as w}from"../packem_shared/pm-runner-CQcraCcu.js";import{r as y,l as $,L as v}from"../packem_shared/dependency-scan-DpOFiZuI.js";import{v as C,m,f as S}from"../packem_shared/index-CE6MsgcV.js";import"../packem_shared/public-api-WqUCiyIe.js";import{e as x}from"../packem_shared/index-
|
|
1
|
+
import{D as b,p}from"./cli-main.js";import{A as w}from"../packem_shared/pm-runner-CQcraCcu.js";import{r as y,l as $,L as v}from"../packem_shared/dependency-scan-DpOFiZuI.js";import{v as C,m,f as S}from"../packem_shared/index-CE6MsgcV.js";import"../packem_shared/public-api-WqUCiyIe.js";import{e as x}from"../packem_shared/index-Cg71MisW.js";const M=e=>{const s=e.trim();return s===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(s)||/^(?:github|gitlab|bitbucket|gist):/i.test(s)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(s)&&!s.includes("@")?!0:/^https?:\/\//i.test(s)},L=(e,s)=>{for(const t of s)if(t===e||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},D=(e,s,t={})=>{const o=y(e,s);if(!o)return[];let i;try{i=C(m(e,o.file))}catch{return[]}const n=b(i,o.type);if(n.length===0)return[];const c=t.allow??[],l=[],f=new Set;for(const r of n){const a=`${r.name}@${r.version}`;for(const d of[r.dependencies,r.optionalDependencies])if(d){for(const[u,h]of Object.entries(d))if(!L(u,c))for(const k of h){if(!M(k))continue;const g=`${a}->${u}@${k}`;f.has(g)||(f.add(g),l.push({declaredBy:a,packageName:u,source:k}))}}}return l.sort((r,a)=>r.packageName.localeCompare(a.packageName)||r.declaredBy.localeCompare(a.declaredBy))},E=new Set(["firstSeen","publisherChange"]),N=e=>e.severity==="block"&&e.acceptedRisk===void 0,R=e=>{const s=e.security?.policies?.firstSeen?.minutes,t=typeof s=="number"&&s>0,o=e.security?.policies?.publisherChange?.mode==="no-downgrade",i=e.security?.blockExoticSubdeps===!0;return t||o||i},V=async e=>{const{offline:s=!1,packageManager:t,visConfig:o,workspaceRoot:i}=e,n=Date.now();if(!R(o))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const c=y(i,t);if(!c||!S(m(i,c.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=$(i,t,{includeDev:!0}),f=l.length,r=await x({offline:s,packageManager:t,packages:l,workspaceRoot:i},"install",{enabledPolicies:new Set(E),visConfig:o}),a=o.security?.blockExoticSubdeps===!0?D(i,t,{allow:o.security.exoticSubdepsAllow}):[],d=r.some(u=>N(u))||a.length>0;return{decisions:r,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:d?"fail":"pass"}},B=e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,P=e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const s=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${B(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${s}`];const t=[`✗ Lockfile failed supply-chain policy check ${s}`];for(const o of e.decisions)o.severity==="block"&&o.acceptedRisk===void 0&&t.push(` [${o.policy}] ${o.reason}`);for(const o of e.exoticViolations)t.push(` [blockExoticSubdeps] ${o.packageName} pulled from exotic source by ${o.declaredBy}: ${o.source}`);return t},J=async({options:e,visConfig:s,workspaceRoot:t})=>{const o=t??process.cwd(),i=w(o);if(!v[i.name]){p.warn(`Package manager '${i.name}' has no lockfile vis can verify.`);return}const n=await V({offline:!!e.offline,packageManager:i.name,visConfig:s??{},workspaceRoot:o});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
|
|
2
2
|
`),n.status==="fail"&&(process.exitCode=1);return}const[c,...l]=P(n);if(n.status==="skipped"){p.info(c);return}if(n.status==="pass"){p.success(c);return}p.error(c);for(const f of l)p.error(f);process.exitCode=1};export{J as default};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import{createRequire as J}from"node:module";import{h as ee,d as h,n as te,i as k,E as ae}from"../packem_chunks/catalog.js";import"./env-DdQRnEIy.js";import{W as re,X as ne,Z as se,a0 as oe}from"../packem_chunks/cli-main.js";const X=J(import.meta.url),A=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=e=>{if(typeof A<"u"&&A.versions&&A.versions.node){const[a,t]=A.versions.node.split(".").map(Number);if(a>22||a===22&&t>=3||a===20&&t>=16)return A.getBuiltinModule(e)}return X(e)},{spawn:z,execFileSync:D,execFile:Y}=M("node:child_process"),{existsSync:R}=M("node:fs"),{platform:Z,homedir:j}=M("node:os"),{join:f}=M("node:path"),{promisify:Q}=M("node:util"),ie=/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/,de=5e3,ce=1e4,le=3e5,ue=4096,E=Z()==="win32",q=["amp","claude","codex","copilot","crush","cursor","droid","gemini","kimi","opencode","qwen"],pe={alternateCommands:[],buildArgs:(e,{dangerous:a})=>{const t=["-x",e];return a&&t.push("--dangerously-allow-all"),t},command:"amp",defaultModel:"",displayName:"Amp",envVariable:"AMP_PATH",sessionMarkers:[{confidence:"definite",equals:"amp",variable:"AGENT"}],supportsMaxTokens:!1,supportsModel:!1},me={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=[];return a&&r.push("--dangerously-skip-permissions"),t&&r.push("--model",t),r.push("--output-format","text","-p",e),r},command:"claude",defaultModel:"",displayName:"Claude Code",envVariable:"CLAUDE_PATH",sessionMarkers:[{confidence:"definite",variable:"CLAUDECODE"},{confidence:"definite",variable:"CLAUDE_CODE"}],supportsMaxTokens:!1,supportsModel:!0},ge={alternateCommands:["openai-codex"],buildArgs:(e,{dangerous:a,model:t})=>{const r=["exec"];return t&&r.push("--model",t),a&&r.push("--dangerously-bypass-approvals-and-sandbox"),r.push(e),r},command:"codex",defaultModel:"",displayName:"Codex",envVariable:"CODEX_PATH",sessionMarkers:[{confidence:"definite",variable:"CODEX_SANDBOX"},{confidence:"definite",variable:"CODEX_THREAD_ID"},{confidence:"definite",variable:"CODEX_CI"}],supportsMaxTokens:!1,supportsModel:!0},fe={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=["-p",e];return a&&r.push("--allow-all-tools"),t&&r.push("--model",t),r},command:"copilot",defaultModel:"",displayName:"GitHub Copilot CLI",envVariable:"COPILOT_PATH",sessionMarkers:[{confidence:"definite",variable:"COPILOT_MODEL"},{confidence:"definite",variable:"COPILOT_ALLOW_ALL"},{confidence:"definite",variable:"COPILOT_GITHUB_TOKEN"}],supportsMaxTokens:!1,supportsModel:!0},he={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=["run"];return a&&r.push("--yolo"),t&&r.push("-m",t),r.push(e),r},command:"crush",defaultModel:"",displayName:"Crush",envVariable:"CRUSH_PATH",sessionMarkers:[],supportsMaxTokens:!1,supportsModel:!0},ve={alternateCommands:["cursor"],buildArgs:(e,{dangerous:a,model:t})=>{const r=["-p"];return a&&r.push("--force"),r.push("--output-format","text"),t&&r.push("--model",t),r.push(e),r},command:"agent",defaultModel:"",displayName:"Cursor Agent",envVariable:"CURSOR_PATH",sessionMarkers:[{confidence:"definite",variable:"CURSOR_AGENT"},{agent:"Cursor editor",confidence:"ambient",variable:"CURSOR_TRACE_ID"}],supportsMaxTokens:!1,supportsModel:!0},ye={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=[e];return a&&r.push("--skip-permissions-unsafe"),r.push("-o","text"),t&&r.push("-m",t),r},command:"droid",defaultModel:"",displayName:"Droid",envVariable:"DROID_PATH",sessionMarkers:[],supportsMaxTokens:!1,supportsModel:!0},be={alternateCommands:["gemini-cli"],buildArgs:(e,{dangerous:a,maxTokens:t,model:r})=>{const n=[];return a||n.push("--sandbox"),r&&n.push("--model",r),n.push("--max-output-tokens",String(t),"-p",e),n},command:"gemini",defaultModel:"gemini-2.5-pro",displayName:"Gemini CLI",envVariable:"GEMINI_PATH",sessionMarkers:[{confidence:"definite",variable:"GEMINI_CLI"}],supportsMaxTokens:!0,supportsModel:!0},ke={alternateCommands:[],buildArgs:(e,{model:a})=>{const t=["--quiet","-p",e];return a&&t.push("-m",a),t},command:"kimi",defaultModel:"",displayName:"Kimi CLI",envVariable:"KIMI_PATH",sessionMarkers:[],supportsMaxTokens:!1,supportsModel:!0},we={alternateCommands:[],buildArgs:(e,{model:a})=>{const t=["run",e];return a&&t.push("-m",a),t},command:"opencode",defaultModel:"",displayName:"opencode",envVariable:"OPENCODE_PATH",sessionMarkers:[{confidence:"definite",variable:"OPENCODE_CLIENT"}],supportsMaxTokens:!1,supportsModel:!0},Ae={alternateCommands:["qwen-code"],buildArgs:(e,{dangerous:a,model:t})=>{const r=["-p",e];return a&&r.push("--yolo"),r.push("-o","text"),t&&r.push("-m",t),r},command:"qwen",defaultModel:"",displayName:"Qwen Code",envVariable:"QWEN_PATH",sessionMarkers:[],supportsMaxTokens:!1,supportsModel:!0},S={amp:pe,claude:me,codex:ge,copilot:fe,crush:he,cursor:ve,droid:ye,gemini:be,kimi:ke,opencode:we,qwen:Ae};class w extends Error{exitCode;durationMs;provider;stderr;stdout;timedOut;aborted;constructor(a,t){super(a),this.name="AiRunError",this.provider=t.provider,this.exitCode=t.exitCode??null,this.durationMs=t.durationMs,this.stdout=t.stdout??"",this.stderr=t.stderr??"",this.timedOut=t.timedOut??!1,this.aborted=t.aborted??!1}}const Me=[{agent:"Cline",confidence:"definite",variable:"CLINE_ACTIVE"},{agent:"Aider",confidence:"definite",equals:"Aider",variable:"OR_APP_NAME"},{agent:"Antigravity",confidence:"definite",variable:"ANTIGRAVITY_AGENT"},{agent:"Augment",confidence:"definite",variable:"AUGMENT_AGENT"},{agent:"Replit Agent",confidence:"definite",variable:"REPLIT_CLI"},{agent:"Replit workspace",confidence:"ambient",variable:"REPL_ID"}],Ce=(e,a)=>a.sessionMarkers.map(t=>({agent:t.agent??a.displayName,confidence:t.confidence,equals:t.equals,provider:e,variable:t.variable}));[...Object.keys(S).flatMap(e=>Ce(e,S[e])),...Me].toSorted((e,a)=>e.confidence===a.confidence?0:e.confidence==="definite"?-1:1);Q(Y);const Te=/\.(?:bat|cmd)$/i,V=e=>E&&Te.test(e),O=e=>`"${e.replaceAll('"','""')}"`,L=e=>e==="~"||e.startsWith("~/")||E&&e.startsWith("~\\")?f(j(),e.slice(2)):e,Se=e=>{try{const a=D(E?"where":"which",[e],{encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:de}).trim().split(`
|
|
2
|
+
`)[0]?.trim();return a&&a.length>0?a:void 0}catch{return}},Ee=e=>{const a=j();if(E){const t=process.env.APPDATA??"",r=process.env.LOCALAPPDATA??"",n=process.env.ProgramFiles??"";return[f(t,"npm",`${e}.cmd`),f(t,"npm",e),f(r,"Programs",e,`${e}.exe`),f(n,e,`${e}.exe`),f(a,".npm-global","bin",`${e}.cmd`)]}return[`/opt/homebrew/bin/${e}`,`/usr/local/bin/${e}`,f(a,".npm-global","bin",e),f(a,".local","bin",e),f(a,".cargo","bin",e)]},$e=e=>{try{const a=D(e,["--version"],{encoding:"utf8",shell:V(e),stdio:["pipe","pipe","pipe"],timeout:ce}),t=ie.exec(a);return t?t[1]:void 0}catch{return}},F=(e,a={})=>{const t=S[e],r={available:!1,name:e},n=a.version!==!1,s=i=>{if(n)return $e(i)},o=process.env[t.envVariable];if(o&&R(L(o))){const i=L(o);return{...r,available:!0,detectionMethod:"envvar",path:i,version:s(i)}}const c=[t.command,...t.alternateCommands];for(const i of c){const d=Se(i);if(d)return{...r,available:!0,detectionMethod:"which",path:d,version:s(d)}}for(const i of c)for(const d of Ee(i))if(R(d))return{...r,available:!0,detectionMethod:"known-path",path:d,version:s(d)};return r},xe=(e={})=>q.map(a=>F(a,e)),Ie=(e={})=>xe(e).filter(a=>a.available),_e=(e,a,t={})=>{const r=S[e],n=t.model??r.defaultModel,s=t.maxTokens!==void 0&&Number.isFinite(t.maxTokens)?t.maxTokens:ue;return r.buildArgs(a,{dangerous:t.dangerous===!0,maxTokens:s,model:n})},Ne=async(e,a,t={})=>{if(!e.available||!e.path)throw new w(`AI provider "${e.name}" is not available.`,{durationMs:0,provider:e.name});const r=_e(e.name,a,t),n=t.timeoutMs!==void 0&&Number.isFinite(t.timeoutMs)?t.timeoutMs:le,s=e.path,o=V(s),c=Date.now();if(t.signal?.aborted)throw new w(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:0,provider:e.name});return new Promise((i,d)=>{const m={cwd:t.cwd,env:{...process.env,...t.env,FORCE_COLOR:"0",NO_COLOR:"1"},shell:o,stdio:["pipe","pipe","pipe"]},u=o?r.map(l=>O(l)):r,g=z(o?O(s):s,u,m);g.stdin?.end();let v="",y="",b=!1,I,_,C;const $=()=>{clearTimeout(_),clearTimeout(I),C&&t.signal?.removeEventListener("abort",C)},W=()=>{g.kill("SIGKILL")},N=l=>{if(b)return;b=!0,g.kill("SIGTERM"),I=setTimeout(W,5e3),$();const p=Date.now()-c,K=l?new w(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:p,provider:e.name,stderr:y,stdout:v}):new w(`${e.name} CLI timed out after ${String(n)}ms`,{durationMs:p,provider:e.name,stderr:y,stdout:v,timedOut:!0});d(K)};_=setTimeout(N,n,!1),C=()=>{N(!0)},t.signal?.addEventListener("abort",C,{once:!0}),g.stdout?.on("data",l=>{const p=l.toString("utf8");v+=p,t.onStdout?.(p)}),g.stderr?.on("data",l=>{const p=l.toString("utf8");y+=p,t.onStderr?.(p)}),g.on("close",l=>{if(b)return;b=!0,$();const p=Date.now()-c;l===0?i({durationMs:p,exitCode:l,provider:e.name,stderr:y,stdout:v}):d(new w(`${e.name} CLI exited with code ${String(l)}: ${y||v}`,{durationMs:p,exitCode:l,provider:e.name,stderr:y,stdout:v}))}),g.on("error",l=>{b||(b=!0,$(),d(new w(`Failed to spawn ${e.name} CLI: ${l.message}`,{durationMs:Date.now()-c,provider:e.name,stderr:y,stdout:v})))})})},Re=12e4,Oe=2,Le=1e3,Pe=e=>new Promise(a=>{setTimeout(a,e)}),G=async(e,a,t=Oe)=>{let r;for(let n=0;n<=t;n+=1)try{return(await Ne(e,a,{timeoutMs:Re})).stdout}catch(s){if(r=s instanceof Error?s:new Error(String(s)),r.message.includes("timed out"))throw r;if(n<t){const o=Le*2**n;await Pe(o)}}throw r??new Error("AI request failed after retries")},De={amp:30,claude:80,codex:60,copilot:50,crush:35,cursor:40,droid:20,gemini:100,kimi:25,opencode:35,qwen:30},je=e=>{if(e?.provider){if(!q.includes(e.provider))return;const r=F(e.provider);return r.available?r:void 0}const a=Ie();if(a.length===0)return;const t={...De,...e?.priority};return a.toSorted((r,n)=>(t[n.name]??0)-(t[r.name]??0))[0]},qe=new Set(["defer","review","skip","update"]),Ve=new Set(["critical","high","low","medium"]),Fe=new Set(["high","low","medium"]),Ge=50,x=30,He=e=>e.map(a=>{const t=a.vulnerabilities&&a.vulnerabilities.length>0?` [VULNERABILITIES: ${a.vulnerabilities.map(n=>`${n.severity} ${n.id}`).join(", ")}]`:"";let r="";if(a.socketReport){const n=Math.round(a.socketReport.score.overall*100),s=[`score:${String(n)}%`];if(a.socketReport.alerts.length>0){const o={};for(const i of a.socketReport.alerts)o[i.severity]=(o[i.severity]??0)+1;const c=Object.entries(o).map(([i,d])=>`${String(d)} ${i}`).join(", ");s.push(`alerts: ${c}`)}s.push(`supply-chain:${String(Math.round(a.socketReport.score.supplyChain*100))}%`),s.push(`quality:${String(Math.round(a.socketReport.score.quality*100))}%`),r=` [SOCKET.DEV: ${s.join(", ")}]`}return`- ${a.packageName}: ${a.currentRange} → ${a.newRange} (${a.updateType})${t}${r}`}).join(`
|
|
3
|
+
`),T=`Respond ONLY with valid JSON in this exact structure:
|
|
4
|
+
{
|
|
5
|
+
"summary": "Brief overall summary",
|
|
6
|
+
"recommendations": [
|
|
7
|
+
{
|
|
8
|
+
"package": "package-name",
|
|
9
|
+
"action": "update|skip|review|defer",
|
|
10
|
+
"reason": "explanation",
|
|
11
|
+
"riskLevel": "low|medium|high|critical",
|
|
12
|
+
"breakingChanges": ["change1"],
|
|
13
|
+
"effort": "low|medium|high"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"warnings": ["warning1"]
|
|
17
|
+
}`,Ue={compatibility:e=>`Analyze the compatibility of these package updates:
|
|
18
|
+
|
|
19
|
+
${e}
|
|
20
|
+
|
|
21
|
+
For each package:
|
|
22
|
+
1. Check peer dependency compatibility
|
|
23
|
+
2. Identify potential conflicts with other packages in the list
|
|
24
|
+
3. Assess API compatibility between current and target versions
|
|
25
|
+
4. Check for deprecated features being removed
|
|
26
|
+
5. Evaluate Node.js version requirements
|
|
27
|
+
|
|
28
|
+
${T}`,impact:e=>`Analyze the impact of updating these npm packages:
|
|
29
|
+
|
|
30
|
+
${e}
|
|
31
|
+
|
|
32
|
+
For each package, provide:
|
|
33
|
+
1. Risk level (low/medium/high/critical)
|
|
34
|
+
2. Recommended action (update/skip/review/defer)
|
|
35
|
+
3. Reason for recommendation
|
|
36
|
+
4. Known breaking changes (if any)
|
|
37
|
+
5. Estimated migration effort (low/medium/high)
|
|
38
|
+
|
|
39
|
+
${T}`,recommend:e=>`Provide smart recommendations for updating these packages:
|
|
40
|
+
|
|
41
|
+
${e}
|
|
42
|
+
|
|
43
|
+
Consider:
|
|
44
|
+
1. Update priority based on security, features, and stability
|
|
45
|
+
2. Grouping related packages for atomic updates
|
|
46
|
+
3. Best practices for the specific package ecosystem
|
|
47
|
+
4. Risk vs. benefit analysis
|
|
48
|
+
5. Suggested update order
|
|
49
|
+
6. If Socket.dev scores are provided, prioritize packages with low supply chain or quality scores
|
|
50
|
+
|
|
51
|
+
${T}`,security:e=>`Analyze the security implications of these package updates:
|
|
52
|
+
|
|
53
|
+
${e}
|
|
54
|
+
|
|
55
|
+
For each package:
|
|
56
|
+
1. Check if the update fixes known vulnerabilities (use the vulnerability data above)
|
|
57
|
+
2. Assess if the new version introduces security risks
|
|
58
|
+
3. Evaluate if this is a security-sensitive package (auth, crypto, session, etc.)
|
|
59
|
+
4. Recommend urgency of the update based on vulnerability severity
|
|
60
|
+
5. Flag any packages where skipping the update poses security risk
|
|
61
|
+
6. If Socket.dev scores are provided, factor in supply chain and quality scores — low scores indicate higher risk
|
|
62
|
+
|
|
63
|
+
${T}`},Be=new Set(["compatibility","impact","recommend","security"]),nt=e=>Be.has(e)?e:"impact",H=(e,a="impact")=>{const t=He(e);return Ue[a](t)},We=/```(?:json)?\s*([\s\S]*?)```/,Ke=/\{[\s\S]*\}/,Je=e=>{try{return JSON.parse(e)}catch{}const a=We.exec(e);if(a?.[1])try{return JSON.parse(a[1])}catch{}const t=Ke.exec(e);if(t?.[0])try{return JSON.parse(t[0])}catch{}},Xe=e=>({action:qe.has(e.action)?e.action:"review",breakingChanges:Array.isArray(e.breakingChanges)?e.breakingChanges:[],effort:Fe.has(e.effort)?e.effort:"medium",package:typeof e.package=="string"?e.package:"",reason:typeof e.reason=="string"?e.reason:"",riskLevel:Ve.has(e.riskLevel)?e.riskLevel:"medium"}),U=(e,a,t)=>{const r=Je(e);if(!r||typeof r!="object")return{analysisType:t,provider:a,recommendations:[],summary:"Failed to parse AI response.",warnings:["AI response was not valid JSON."]};const n=r,s=Array.isArray(n.recommendations)?n.recommendations:[];return{analysisType:t,provider:a,recommendations:s.map(o=>Xe(o)),summary:typeof n.summary=="string"?n.summary:"",warnings:Array.isArray(n.warnings)?n.warnings:[]}},ze={eslint:["ESLint 9.0: Flat config required","ESLint 8.0+: New rule formats"],next:["Next.js 13+: App router changes","Next.js 14+: Server components default"],react:["React 17 to 18: Concurrent features","React 18+: Strict mode changes"],typescript:["TypeScript 5.0: New decorators","TypeScript 4.7+: ESM changes"],vite:["Vite 5: Node.js 18+ required"],vue:["Vue 3: Composition API","Vue 3: Breaking template changes"],webpack:["Webpack 5: Node.js polyfills removed"]},Ye=new Set(["bcrypt","cors","crypto-js","express-session","helmet","jose","jsonwebtoken","node-forge","oauth","passport"]),P=(e,a)=>{const t=e.map(r=>{const n=r.vulnerabilities&&r.vulnerabilities.length>0,s=Ye.has(r.packageName),o=ze[r.packageName]??[];let c="low",i="update",d="low",m="Patch/minor update, safe to apply.";return r.updateType==="major"?(c="high",i=o.length>0?"review":"update",d="medium",m=o.length>0?`Major update with known breaking changes: ${o[0]}`:"Major version update, review changelog before applying."):r.updateType==="minor"&&(c="medium",m="Minor update, generally safe."),n&&(c="high",i="update",m="Security update — current version has known vulnerabilities."),s&&r.updateType==="major"&&(i="review",m="Security-sensitive package with major update, careful review needed.",d="high"),{action:i,breakingChanges:o,effort:d,package:r.packageName,reason:m,riskLevel:c}});return{analysisType:a,provider:"rule-engine",recommendations:t,summary:`Rule-based ${a} analysis for ${String(e.length)} packages.`,warnings:["No AI provider available — using built-in rule engine."]}},Ze=async(e,a,t)=>{const r=H(a,t),n=await G(e,r);return U(n,e.name,t)},Qe=(e,a,t)=>{const r=[],n=[],s=[];for(const o of e)r.push(...o.recommendations),n.push(...o.warnings),o.summary&&s.push(o.summary);return{analysisType:t,provider:a,recommendations:r,summary:s.length===1?s[0]??"":`Analyzed ${String(r.length)} packages in ${String(e.length)} batches.`,warnings:[...new Set(n)]}},B={compatibility:"Compatibility",impact:"Impact",recommend:"Recommendations",security:"Security"},st=e=>{const a=`${B[e.analysisType]??e.analysisType} Analysis (${e.provider})`,t=e.recommendations.flatMap(n=>{const s=[{action:n.action,effort:n.effort,package:n.package,reason:n.reason,risk:n.riskLevel}];return n.breakingChanges.length>0&&s.push({action:"",effort:"",package:"",reason:`Breaking: ${n.breakingChanges.join("; ")}`,risk:""}),s}),r=process.stdout.columns||80;return ee(h.createElement(te,{borderStyle:"round",flexDirection:"column",paddingLeft:1,paddingRight:1},h.createElement(k,{bold:!0},a),h.createElement(k,null,""),h.createElement(k,null,e.summary),h.createElement(k,null,""),h.createElement(ae,{borderStyle:"none",data:t}),...e.warnings.length>0?[h.createElement(k,null,""),...e.warnings.map((n,s)=>h.createElement(k,{dimColor:!0,key:String(s)},` ${n}`))]:[]),{columns:r})},ot=async(e,a,t,r="impact")=>{const n=je(t);if(!n)return a.info(`No AI CLI tool found, using rule-based analysis.
|
|
64
|
+
`),P(e,r);const s=re(n.name,r,e),o=ne(s);if(o)return a.info(`Using cached ${r} analysis from ${o.provider}.
|
|
65
|
+
`),o;const c=B[r]??r;a.info(`Running ${c.toLowerCase()} analysis with ${n.name}...
|
|
66
|
+
`);try{let i;if(e.length>Ge){a.info(`Splitting ${String(e.length)} packages into batches of ${String(x)}...
|
|
67
|
+
`);const d=[];for(let u=0;u<e.length;u+=x)d.push(e.slice(u,u+x));const m=[];for(let u=0;u<d.length;u+=1){a.info(` Batch ${String(u+1)}/${String(d.length)}...`);const g=d[u];g&&m.push(await Ze(n,g,r))}i=Qe(m,n.name,r)}else{const d=await G(n,H(e,r));i=U(d,n.name,r)}return se(s,i,oe(r,t?.cacheTtl)),i}catch(i){const d=i instanceof Error?i.message:String(i);return a.warn(`AI analysis failed (${d}), falling back to rule engine.
|
|
68
|
+
`),P(e,r)}};export{xe as F,nt as K,je as R,De as S,st as W,ot as Z,Je as b,Ne as d,G as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as b}from"node:module";import{readLastRunSummary as O}from"@visulima/task-runner";import{a as T}from"./failure-log-
|
|
1
|
+
import{createRequire as b}from"node:module";import{readLastRunSummary as O}from"@visulima/task-runner";import{a as T}from"./failure-log-CKMhqLWr.js";import{c as w,d as j,e as k,r as C,O as D,B as P,N as F}from"../packem_chunks/cli-main.js";import{c as N}from"./env-DdQRnEIy.js";import{A as y,B as x,m as R,y as A}from"./index-CE6MsgcV.js";import{R as E,r as M,b as q}from"./ai-analysis-BpVdn20h.js";const $=b(import.meta.url),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[e,a]=d.versions.node.split(".").map(Number);if(e>22||e===22&&a>=3||e===20&&a>=16)return d.getBuiltinModule(t)}return $(t)},{readFile:_,writeFile:B}=I("node:fs/promises"),H=32*1024,W=(t,e)=>{if(t.length<=e)return t;const a=t.slice(-e),o=t.length-a.length;return`[…${String(o)} bytes truncated from head…]
|
|
2
2
|
${a}`},L=async(t,e)=>e===void 0?O(t,{dataDirectory:N(t)}):C(t,e),ht=async(t,e,a={})=>{const o=a.terminalOutputLimit??H,[s,n]=await Promise.all([T(t,e),L(t,a.runId)]),i=n?w(n,e):void 0;if(!s&&!i)return;let r,c;if(n&&i){const h=await j(t,n.id),p=h?w(h,e):void 0;r=k(i.hashDetails,p?.hashDetails),c=h?.id}const u=s?.terminalOutput??"";return{command:s?.command??void 0,cwd:s?.cwd??void 0,dependencies:i?.dependencies??[],duration:i?.duration,exitCode:s?.exitCode??i?.exitCode,hash:i?.hash??s?.hash,hashDetails:i?.hashDetails,hashDiff:r,previousRunId:c,project:i?.target.project,runId:n?.id??s?.runId,status:s?.status??(i?Y(i):void 0),target:i?.target.target,taskId:e,terminalOutput:W(u,o),terminalOutputCaptured:!!s,timestamp:s?.timestamp??i?.endTime??i?.startTime}},Y=t=>{if(t.exitCode!==void 0&&t.exitCode!==0)return"failure";switch(t.cacheStatus){case"HIT":return"local-cache";case"REMOTE_HIT":return"remote-cache";case"SKIPPED":return"skipped";default:return t.exitCode===0?"success":void 0}},J=3600*1e3,v=80,K=new Set(["high","low","medium"]),U=()=>`You are an expert software engineer helping fix a failing build/test/lint task.
|
|
3
3
|
|
|
4
4
|
You will be given:
|