@visulima/vis 1.0.0-alpha.26 → 1.0.0-alpha.27
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 +23 -0
- package/LICENSE.md +17 -17
- package/README.md +24 -22
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +176 -16
- package/dist/packem_chunks/bin.js +263 -263
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/config.js +12 -12
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +8 -9
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler22.js +1 -1
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler30.js +3 -3
- package/dist/packem_chunks/handler31.js +2 -2
- package/dist/packem_chunks/handler34.js +1 -1
- package/dist/packem_chunks/handler35.js +3 -22
- package/dist/packem_chunks/handler36.js +21 -60
- package/dist/packem_chunks/handler37.js +61 -6
- package/dist/packem_chunks/handler38.js +3 -24
- package/dist/packem_chunks/handler39.js +6 -153
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler40.js +24 -10
- package/dist/packem_chunks/handler41.js +153 -25
- package/dist/packem_chunks/handler42.js +10 -708
- package/dist/packem_chunks/handler43.js +25 -24
- package/dist/packem_chunks/handler44.js +659 -273
- package/dist/packem_chunks/handler45.js +24 -46
- package/dist/packem_chunks/handler46.js +322 -3
- package/dist/packem_chunks/handler47.js +48 -27
- package/dist/packem_chunks/handler48.js +3 -187
- package/dist/packem_chunks/handler49.js +23 -30
- package/dist/packem_chunks/handler5.js +6 -6
- package/dist/packem_chunks/handler50.js +196 -0
- package/dist/packem_chunks/handler51.js +34 -0
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/help-command.js +16 -16
- package/dist/packem_chunks/index.js +1 -1
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/{advisories-DS8JEB_g.js → advisories-xIOdLbAI.js} +1 -1
- package/dist/packem_shared/{cyclonedx-ja1cbU69.js → cyclonedx-B3ILsY74.js} +1 -1
- package/dist/packem_shared/{docker-Bw9gKo69.js → docker-BynKrOLe.js} +1 -1
- package/dist/packem_shared/{index-88UK-tt_.js → index-B_KtN1MB.js} +1 -1
- package/dist/packem_shared/{index-CS6a2wFB.js → index-efSniSRN.js} +1 -1
- package/dist/packem_shared/{lifecycle-ChCFTm5Q.js → lifecycle-CJRNbN3x.js} +2 -2
- package/dist/packem_shared/{min-release-age-heJgeP7o.js → min-release-age-aEn0x8Vy.js} +1 -1
- package/dist/packem_shared/{native-config-sync-BOeuyrBj.js → native-config-sync-DdhTLlKL.js} +1 -1
- package/dist/packem_shared/{osv-bloom-QSAn2Dcw.js → osv-bloom-BJhlc_I2.js} +2 -2
- package/dist/packem_shared/{pm-runner-BzGZmzYs.js → pm-runner-BwX5AL3W.js} +1 -1
- package/dist/packem_shared/{provenance-BsBn1f5S.js → provenance-BuiEsWbI.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-CBPr617N.js → resolve-explicit-RgRrUDZv.js} +1 -1
- package/dist/packem_shared/{s1ngularity-j_ArCZAs.js → s1ngularity-Bs9fUf3q.js} +1 -1
- package/dist/packem_shared/{scan-progress-EbvmIh4i.js → scan-progress-DjPT66jy.js} +2 -2
- package/dist/packem_shared/{signatures-CaXzNuEn.js → signatures-LYMy8OR5.js} +1 -1
- package/dist/packem_shared/{typosquats-C1e6RNjF.js → typosquats-znskIR5j.js} +1 -1
- package/dist/packem_shared/watch-BSVsZ_1I.js +1 -0
- package/dist/packem_shared/watch-loop-DLlMLg_J.js +11 -0
- package/index.js +751 -567
- package/package.json +11 -11
- package/schemas/project.schema.json +86 -1
- package/schemas/vis-config.schema.json +255 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Te=Object.defineProperty;var w=(e,t)=>Te(e,"name",{value:t,configurable:!0});import{createRequire as ze}from"node:module";import{o as Be,ac as Ie,p as Ne,aF as qe}from"./bin.js";import{z as he,M as me,$ as I}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";const Me=ze(import.meta.url),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fe=w(e=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[t,r]=z.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return z.getBuiltinModule(e)}return Me(e)},"__cjs_getBuiltinModule"),{createRequire:Ge}=Fe("node:module");var De=Object.defineProperty,Ke=w((e,t)=>De(e,"name",{value:t,configurable:!0}),"p$6"),Qe=Object.defineProperty,de=Ke((e,t)=>Qe(e,"name",{value:t,configurable:!0}),"e"),Ve=Object.defineProperty,He=de((e,t)=>Ve(e,"name",{value:t,configurable:!0}),"E");const ge=String.raw,re=ge`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Je=He(()=>new RegExp(ge`\p{RI}{2}|(?)${re}(?:\u200D${re})*`,"gu"),"default");var Ye=Object.defineProperty,Xe=de((e,t)=>Ye(e,"name",{value:t,configurable:!0}),"p");Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]]));const T=Je(),Ze=/[-_./\s]+/g,L=/(\u001B\[[0-9;]*[a-z])/i,ne=new RegExp("\\p{Script=Arabic}","u"),et=new RegExp("\\p{Script=Bengali}","u"),_=new RegExp("\\p{Script=Cyrillic}","u"),tt=new RegExp("\\p{Script=Devanagari}","u"),rt=new RegExp("\\p{Script=Ethiopic}","u"),Q=new RegExp("\\p{Script=Greek}","u"),ae=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),nt=new RegExp("\\p{Script=Gujarati}","u"),at=new RegExp("\\p{Script=Gurmukhi}","u"),ie=new RegExp("\\p{Script=Hangul}","u"),se=new RegExp("\\p{Script=Hebrew}","u"),it=new RegExp("\\p{Script=Hiragana}","u"),oe=new RegExp("\\p{Script=Han}","u"),st=new RegExp("\\p{Script=Kannada}","u"),ot=new RegExp("\\p{Script=Katakana}","u"),lt=new RegExp("\\p{Script=Khmer}","u"),ct=new RegExp("\\p{Script=Lao}","u"),O=new RegExp("\\p{Script=Latin}","u"),ut=new RegExp("\\p{Script=Malayalam}","u"),pt=new RegExp("\\p{Script=Myanmar}","u"),ft=new RegExp("\\p{Script=Oriya}","u"),ht=new RegExp("\\p{Script=Sinhala}","u"),mt=new RegExp("\\p{Script=Tamil}","u"),dt=new RegExp("\\p{Script=Telugu}","u"),gt=new RegExp("\\p{Script=Thai}","u"),yt=new RegExp("\\p{Script=Tibetan}","u"),le=/[\u02BB\u02BC\u0027]/u,bt=Xe(e=>e.replace(T,""),"stripEmoji");var $t=Object.defineProperty,ye=w((e,t)=>$t(e,"name",{value:t,configurable:!0}),"i$5"),vt=Object.defineProperty,be=ye((e,t)=>vt(e,"name",{value:t,configurable:!0}),"r"),wt=Object.defineProperty,jt=be((e,t)=>wt(e,"name",{value:t,configurable:!0}),"c");let W=class{static{w(this,"l")}static{ye(this,"y")}static{be(this,"s")}static{jt(this,"LRUCache")}capacity;cache;keyOrder;constructor(t){this.capacity=t,this.cache=new Map,this.keyOrder=[]}get(t){if(this.cache.has(t))return this.keyOrder=this.keyOrder.filter(r=>r!==t),this.keyOrder.push(t),this.cache.get(t)}has(t){return this.cache.has(t)}set(t,r){if(this.cache.has(t))this.keyOrder=this.keyOrder.filter(n=>n!==t);else if(this.cache.size>=this.capacity){const n=this.keyOrder.shift();n!==void 0&&this.cache.delete(n)}this.cache.set(t,r),this.keyOrder.push(t)}delete(t){this.cache.delete(t),this.keyOrder=this.keyOrder.filter(r=>r!==t)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var Et=Object.defineProperty,Ot=w((e,t)=>Et(e,"name",{value:t,configurable:!0}),"r$6"),kt=Object.defineProperty,xt=Ot((e,t)=>kt(e,"name",{value:t,configurable:!0}),"a"),Ct=Object.defineProperty,St=xt((e,t)=>Ct(e,"name",{value:t,configurable:!0}),"s");const Pt=St((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleLowerCase(t.locale):e[0].toLowerCase())+e.slice(1),"lowerFirst");var At=Object.defineProperty,Lt=w((e,t)=>At(e,"name",{value:t,configurable:!0}),"I"),Wt=Object.defineProperty,q=Lt((e,t)=>Wt(e,"name",{value:t,configurable:!0}),"W");const Rt=Ge(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_t=q(e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[t,r]=M.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return M.getBuiltinModule(e)}return Rt(e)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:Ut}=_t("node:util");var Tt=Object.defineProperty,zt=q((e,t)=>Tt(e,"name",{value:t,configurable:!0}),"g");const V=new W(1e3),Mt=/[.*+?^${}()|[\]\\]/g,Ft=zt(e=>{const t=e.join("");if(V.has(t))return V.get(t);const r=e.map(a=>a.replaceAll(Mt,String.raw`\$&`)).join("|"),n=new RegExp(r,"g");return V.set(t,n),n},"getSeparatorsRegex");var Bt=Object.defineProperty,It=q((e,t)=>Bt(e,"name",{value:t,configurable:!0}),"t");const Nt=It(e=>{const t=[];let r=0,n;for(T.lastIndex=0;(n=T.exec(e))!==null;)n.index>r&&t.push(e.slice(r,n.index)),t.push(n[0]),r=T.lastIndex;return r<e.length&&t.push(e.slice(r)),t.filter(Boolean)},"splitByEmoji");var qt=Object.defineProperty,$=q((e,t)=>qt(e,"name",{value:t,configurable:!0}),"u");const Gt=/[ČŠŽĐ]/i,$e=new Uint8Array(128),ve=new Uint8Array(128),we=new Uint8Array(128);for(let e=0;e<128;e++)$e[e]=e>=65&&e<=90?1:0,ve[e]=e>=97&&e<=122?1:0,we[e]=e>=48&&e<=57?1:0;const H=$(e=>$e[e],"isUpper"),ce=$(e=>ve[e],"isLower"),J=$(e=>we[e],"isDigit"),A=$((e,t,r,n,a)=>{if(e.length===0)return[];let i=!1;const l=Object.values(t);for(const u of l)if(u(e[0])){i=!0;break}if(!i&&!r)return[e];const o=[...e],h=[];let s=o[0],f="other";const m=Object.entries(t);for(const u of m){const[p,g]=u;if(g(o[0])){f=p;break}}let c=r&&n?o[0]===o[0].toLocaleUpperCase(n):!1;for(let u=1;u<o.length;u++){const p=o[u];let g="other";for(const b of m){const[v,E]=b;if(E(p)){g=v;break}}const y=r&&n?p===p.toLocaleUpperCase(n):!1;let d=!1;a?d=a(f,g,c,y,p,u,o):(f!==g&&f!=="other"&&g!=="other"&&(d=!0),r&&g!=="other"&&!c&&y&&(d=!0)),d?(h.push(s),s=p):s+=p,f=g,r&&(c=y)}return s&&s.length>0&&h.push(s),h.length>0?h:[e]},"handleScriptTransitions"),Dt=$((e,t,r,n)=>{if(r.size===0)return t;for(const a of r)if(e.startsWith(a,t))return n.push(a),t+a.length;return t},"detectAndProcessAcronym"),je=$((e,t=new Set)=>{if(e.length===0)return[];if(e.toUpperCase()===e)return[e];let r=0;const n=[],a=e.length;for(let i=1;i<a;i++){const l=Dt(e,r,t,n);if(l!==r){r=l,i=r-1;continue}const o=e.codePointAt(i-1),h=e.codePointAt(i),s=o&&o<128&&H(o),f=h&&h<128&&H(h),m=o&&o<128&&ce(o),c=o&&o<128&&J(o),u=h&&h<128&&J(h);if(m&&f){n.push(e.slice(r,i)),r=i;continue}if(c&&!u||!c&&u){n.push(e.slice(r,i)),r=i;continue}if(u&&!c){let p=!1,g=!1;if(i+1<a){const y=e.codePointAt(i+1);p=y&&y<128&&H(y),g=y&&y<128&&J(y)}if(!g&&p){n.push(e.slice(r,i),e.slice(i,i+1)),r=i+1;continue}}if(i+1<a){const p=e.codePointAt(i+1),g=p&&p<128&&ce(p);if(s&&f&&g){const y=e.slice(r,i+1);t.has(y)||(n.push(e.slice(r,i)),r=i)}}}return r<a&&n.push(e.slice(r)),n.filter(i=>i!=="")},"splitCamelCaseFast"),Ee=$((e,t,r)=>{if(e.length===0)return[];const n=e===e.toLocaleUpperCase(t);if(t.startsWith("de")){if(!n&&e.replaceAll("ß","SS")===e.toLocaleUpperCase(t))return[e];const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t),p=u,g=u?0:-1;for(let y=1;y<f;y++){const d=s[y],b=d===d.toLocaleUpperCase(t);if(b===u)c+=d;else if(b)c&&c.length>0&&(m.push(c),c=d),p=!0,g=y;else{if(p&&y-g>1){const v=s[y-1],E=c.slice(0,-1);E&&E.length>0&&m.push(E),c=v+d}else c+=d;p=!1,g=-1}u=b}return c&&c.length>0&&m.push(c),m}if(t.startsWith("uk")||t.startsWith("ru")||t.startsWith("bg")||t.startsWith("sr")||t.startsWith("mk")||t.startsWith("be")){if(!_.test(e)&&!O.test(e))return[e];const s=[...e],f=s.length,m=[];let c=s[0];const u=s[0];let p;_.test(u)?p=1:O.test(u)?p=2:p=0;let g=u===u.toLocaleUpperCase(t);for(let d=1;d<f;d++){const b=s[d];let v;_.test(b)?v=1:O.test(b)?v=2:v=0;const E=b===b.toLocaleUpperCase(t);p!==v&&(p===1||p===2)&&(v===1||v===2)||v===p&&!g&&E?(m.push(c),c=b):c+=b,p=v,g=E}c&&c.length>0&&m.push(c);const y=[];for(let d=0;d<m.length;d++)d<m.length-1&&m[d].length===1&&O.test(m[d])&&_.test(m[d+1][0])?(y.push(m[d]+m[d+1]),d+=1):y.push(m[d]);return y}if(t.startsWith("el")){if(!Q.test(e)&&!O.test(e))return[e];const s=[];ae.lastIndex=0;let f;for(;(f=ae.exec(e))!==null;)s.push(f[0]);s.length===0&&s.push(e);const m=[];if(s.length===1){const c=s[0];if(!c||!Q.test(c[0])||c.length===1)return[c??e]}for(const c of s){if(!c)continue;if(!Q.test(c[0])||c.length===1){m.push(c);continue}const u=c.length;let p=c[0],g=c[0]===c[0].toLocaleUpperCase(t);for(let y=1;y<u;y++){const d=c[y],b=d===d.toLocaleUpperCase(t);!g&&b?(m.push(p),p=d):p+=d,g=b}p&&m.push(p)}return m}if(t.startsWith("ja")||t.startsWith("ko")){const s=t.startsWith("ja"),f=s?{hiragana:$(c=>it.test(c),"hiragana"),kanji:$(c=>oe.test(c),"kanji"),katakana:$(c=>ot.test(c),"katakana"),latin:$(c=>O.test(c),"latin")}:{hangul:$(c=>ie.test(c),"hangul"),latin:$(c=>O.test(c),"latin")},m=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(s){const c=A(e,f,!1,t,(p,g)=>p==="hiragana"&&g==="katakana"||p==="katakana"&&g==="hiragana"||p==="hiragana"&&g==="latin"||p==="katakana"&&g==="latin"||p==="kanji"&&g==="latin"||p==="latin"&&(g==="hiragana"||g==="katakana"||g==="kanji")),u=[];for(const p of c){const g=p;g.length===1&&m.has(g)&&u.length>0?u[u.length-1]=u.at(-1)+g:u.push(g)}return u.length>0?u:[e]}return A(e,f,!1,t,(c,u)=>c==="hangul"&&u==="latin"||c==="latin"&&u==="hangul")}if(t.startsWith("sl")){const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t);for(let p=1;p<f;p++){const g=s[p],y=g===g.toLocaleUpperCase(t),d=Gt.test(g),b=p<f-1&&s[p+1]===s[p+1].toLocaleUpperCase(t);!u&&y||d&&b?(m.push(c),c=g,d&&b&&(m.push(c),c="")):c+=g,u=y}return c&&c.length>0&&m.push(c),m}if(t.startsWith("zh"))return A(e,{han:$(s=>oe.test(s),"han"),latin:$(s=>O.test(s),"latin")},!1,t);if(["ar","fa","he","ur"].includes(t.split("-")[0])){const s=$(f=>se.test(f)||ne.test(f),"isRtlChar");return A(e,{latin:$(f=>O.test(f),"latin"),rtl:$(f=>s(f),"rtl")},!1,t)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(t.split("-")[0])){const s=$(f=>tt.test(f)||et.test(f)||nt.test(f)||at.test(f)||st.test(f)||mt.test(f)||dt.test(f)||ut.test(f)||ht.test(f)||gt.test(f)||ct.test(f)||yt.test(f)||pt.test(f)||rt.test(f)||lt.test(f)||ft.test(f),"isIndicChar");return A(e,{indic:$(f=>s(f),"indic"),latin:$(f=>O.test(f),"latin")},!1,t)}if(["be","bg","ru","sr","uk"].includes(t))return A(e,{cyrillic:$(s=>_.test(s),"cyrillic"),latin:$(s=>O.test(s),"latin")},!0,t);if(["ar","fa","he"].includes(t))return A(e,{latin:$(s=>O.test(s),"latin"),rtl:$(s=>se.test(s)||ne.test(s),"rtl")},!1,t);if(t.startsWith("ko"))return A(e,{hangul:$(s=>ie.test(s),"hangul"),latin:$(s=>O.test(s),"latin")},!1,t);if(t.startsWith("uz")){if(!_.test(e)&&!O.test(e))return[e];const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t);for(let p=1;p<f;p++){const g=s[p],y=g===g.toLocaleUpperCase(t);if(le.test(g)||le.test(s[p-1])){c+=g;continue}!u&&y?(m.push(c),c=g):c+=g,u=y}return c&&c.length>0&&m.push(c),m}const a=[...e],i=a.length,l=[];let o=a[0],h=a[0]===a[0].toLocaleUpperCase(t);for(const s of r)if(e.startsWith(s)){l.push(s),o=a[s.length],h=o===o.toLocaleUpperCase(t);break}for(let s=1;s<i;s++){const f=a[s],m=f===f.toLocaleUpperCase(t);let c=0;for(const u of r)if(e.startsWith(u,s)){l.push(o,u),c=u.length,o="";const p=u.at(-1);p&&(h=p===p.toLocaleUpperCase(t));break}if(c>0){s+=c-1;continue}!h&&m?(l.push(o),o=f):o+=f,h=m}return o&&l.push(o),l},"splitCamelCaseLocale"),Kt=$((e,t,r)=>{const n=[],a=L.test(e)?e.split(L).filter(Boolean):[e];for(const i of a){const l=i;if(L.test(l))n.push(l);else{const o=T.test(l)?Nt(l).filter(Boolean):[l];for(const h of o)if(T.test(h))n.push(h);else if(t){const s=t.toLowerCase().split("-")[0];n.push(...Ee(h,s,r))}else n.push(...je(h,r))}}return n},"processTextWithAnsiEmoji"),G=$((e,t={})=>{if(!e||typeof e!="string")return[];const{handleAnsi:r=!1,handleEmoji:n=!1,knownAcronyms:a=[],locale:i,normalize:l=!1,separators:o,stripAnsi:h=!1,stripEmoji:s=!1}=t,f=new Set([...a].toSorted((d,b)=>b.length-d.length));let m=e;h&&(m=Ut(m)),s&&(m=bt(m));let c;Array.isArray(o)?c=Ft(o):o instanceof RegExp?c=o:c=Ze;const u=[];let p=m;const g=c.flags.includes("g")?c:new RegExp(c.source,`${c.flags}g`);for(;p.length>0;){const d=g.exec(p);if(!d){p===".."?u.push(".."):p==="."?u.push("."):p.length>0&&u.push(p);break}const b=d.index,v=d[0],E=v.length,B=p.slice(0,b),Ue=p.slice(b+E);if(v.startsWith("../"))u.push(".."),p=p.slice(b+3);else if(v.startsWith("./"))u.push("."),p=p.slice(b+2);else if(b===0&&v==="..")u.push(".."),p=p.slice(2);else if(b===0&&v===".")u.push("."),p=p.slice(1);else{B.length>0&&u.push(B);let S=0;for(;(S=v.indexOf("../",S))!==-1;)u.push(".."),S+=3;for(S=0;(S=v.indexOf("./",S))!==-1;)(S===0||v[S-1]!==".")&&u.push("."),S+=2;let P=Ue;for(;P.startsWith("../");)u.push(".."),P=P.slice(3);for(;P.startsWith("./");)u.push("."),P=P.slice(2);if(P===".."){u.push("..");break}else if(P==="."){u.push(".");break}else p=P}g.lastIndex=0}if(u.length===0){const d=m.split(c).filter(Boolean);u.push(...d)}let y=[];for(const d of u)r||n?y.push(...Kt(d,i,f)):i?y.push(...Ee(d,i,f)):y.push(...je(d,f));return l&&(y=y.map(d=>f.has(d)?d:i&&d===d.toLocaleUpperCase(i)?d[0]+d.slice(1).toLocaleLowerCase(i):d.toUpperCase()===d&&!f.has(d)?d.slice(0,1)+d.slice(1).toLowerCase():d)),y},"splitByCase");var Qt=Object.defineProperty,Vt=w((e,t)=>Qt(e,"name",{value:t,configurable:!0}),"r$5"),Ht=Object.defineProperty,Jt=Vt((e,t)=>Ht(e,"name",{value:t,configurable:!0}),"o"),Yt=Object.defineProperty,Xt=Jt((e,t)=>Yt(e,"name",{value:t,configurable:!0}),"s");const Z=Xt((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleUpperCase(t.locale):e[0].toUpperCase())+e.slice(1),"upperFirst");var Zt=Object.defineProperty,er=w((e,t)=>Zt(e,"name",{value:t,configurable:!0}),"r$4"),tr=Object.defineProperty,rr=er((e,t)=>tr(e,"name",{value:t,configurable:!0}),"r"),nr=Object.defineProperty,ar=rr((e,t)=>nr(e,"name",{value:t,configurable:!0}),"n");const D=ar((e,t)=>`${e}::${t?.joiner??""}::${t?.locale??""}::${t?.knownAcronyms?.join(",")??""}::${t?.normalize?"true":"false"}`,"generateCacheKey");var ir=Object.defineProperty,sr=w((e,t)=>ir(e,"name",{value:t,configurable:!0}),"i$3"),or=Object.defineProperty,lr=sr((e,t)=>or(e,"name",{value:t,configurable:!0}),"f"),cr=Object.defineProperty,ur=lr((e,t)=>cr(e,"name",{value:t,configurable:!0}),"l");const K=ur((e,t)=>{const{length:r}=e;if(r===0)return"";if(r===1)return e[0];const n=[];let a="",i="";for(let l=0;l<r;l++){const o=e[l];if(L.test(o)){a?(n.push(a+i+o),a="",i=""):(n.length>0&&n.push(t),a=o);continue}a?(i&&(i+=t),i+=o):(n.length>0&&n.push(t),n.push(o))}return n.join("")},"joinSegments");var pr=Object.defineProperty,fr=w((e,t)=>pr(e,"name",{value:t,configurable:!0}),"r$3"),hr=Object.defineProperty,mr=fr((e,t)=>hr(e,"name",{value:t,configurable:!0}),"a"),dr=Object.defineProperty,gr=mr((e,t)=>dr(e,"name",{value:t,configurable:!0}),"e");const yr=/(?<![a-zß])SS(?![a-z])/g,ee=gr(e=>e.replaceAll(yr,"ß"),"normalizeGermanEszett");var br=Object.defineProperty,$r=w((e,t)=>br(e,"name",{value:t,configurable:!0}),"c$3"),vr=Object.defineProperty,wr=$r((e,t)=>vr(e,"name",{value:t,configurable:!0}),"c"),jr=Object.defineProperty,Er=wr((e,t)=>jr(e,"name",{value:t,configurable:!0}),"o");const Or=new W(1e3),kr=Er((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??Or;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);let i=!0;const l=K(G(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=>{if(t?.handleAnsi&&L.test(o))return o;const h=t?.locale?.startsWith("de")?ee(o):o,s=t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase();return i?(i=!1,Pt(s,t)):Z(s,t)}),"");return r&&a&&n.set(a,l),l},"camelCase");var xr=Object.defineProperty,Cr=w((e,t)=>xr(e,"name",{value:t,configurable:!0}),"l$3"),Sr=Object.defineProperty,Pr=Cr((e,t)=>Sr(e,"name",{value:t,configurable:!0}),"l"),Ar=Object.defineProperty,Lr=Pr((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"o");const Wr=new W(1e3),te=Lr((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??Wr;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=G(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=>{if(t?.handleAnsi&&L.test(o))return o;if(t?.toUpperCase)return t.locale?o.toLocaleUpperCase(t.locale):o.toUpperCase();const h=t?.locale?.startsWith("de")?ee(o):o;return t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase()}),l=K(i,t?.joiner??"-");return r&&a&&n.set(a,l),l},"kebabCase");var Rr=Object.defineProperty,_r=w((e,t)=>Rr(e,"name",{value:t,configurable:!0}),"r$2"),Ur=Object.defineProperty,Tr=_r((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"a"),zr=Object.defineProperty,Mr=Tr((e,t)=>zr(e,"name",{value:t,configurable:!0}),"s");const Fr=new W(1e3),Br=Mr((e,t)=>te(e,{cacheStore:Fr,...t,joiner:"_",toUpperCase:!0}),"constantCase");var Ir=Object.defineProperty,Nr=w((e,t)=>Ir(e,"name",{value:t,configurable:!0}),"l$2"),qr=Object.defineProperty,Gr=Nr((e,t)=>qr(e,"name",{value:t,configurable:!0}),"l"),Dr=Object.defineProperty,Kr=Gr((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"i");const Qr=new W(1e3),Vr=Kr((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??Qr;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=K(G(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&&L.test(l))return l;const o=t?.locale?.startsWith("de")?ee(l):l;return Z(t?.locale?o.toLocaleLowerCase(t.locale):o.toLowerCase(),{locale:t?.locale})}),"");return r&&a&&n.set(a,i),i},"pascalCase");var Hr=Object.defineProperty,Jr=w((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"r$1"),Yr=Object.defineProperty,Xr=Jr((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"a"),Zr=Object.defineProperty,en=Xr((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"s");const tn=new W(1e3),rn=en((e,t)=>te(e,{cacheStore:tn,...t,joiner:"_"}),"snakeCase");var nn=Object.defineProperty,an=w((e,t)=>nn(e,"name",{value:t,configurable:!0}),"r"),sn=Object.defineProperty,on=an((e,t)=>sn(e,"name",{value:t,configurable:!0}),"e"),ln=Object.defineProperty,cn=on((e,t)=>ln(e,"name",{value:t,configurable:!0}),"i");const un=new W(1e3),pn=cn((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??un;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=K(G(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=>Z(l,{locale:t?.locale})),"-");return r&&a&&n.set(a,i),i},"trainCase");var fn=Object.defineProperty,k=w((e,t)=>fn(e,"name",{value:t,configurable:!0}),"e");const x=k(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),Y={camel_case:k(e=>kr(x(e)),"camel_case"),kebab_case:k(e=>te(x(e)),"kebab_case"),lower_case:k(e=>x(e).toLowerCase(),"lower_case"),pascal_case:k(e=>Vr(x(e)),"pascal_case"),path_join:k((e,...t)=>{const r=[x(e),...t.map(n=>x(n))];return me(...r)},"path_join"),path_relative:k((e,t)=>he(x(t),x(e)),"path_relative"),snake_case:k(e=>rn(x(e)),"snake_case"),upper_case:k(e=>x(e).toUpperCase(),"upper_case"),upper_kebab_case:k(e=>pn(x(e)),"upper_kebab_case"),upper_snake_case:k(e=>Br(x(e)),"upper_snake_case")};k(e=>Object.hasOwn(Y,e),"isKnownFilter");const Oe=k((e,t,r=[])=>{const n=Y[e];if(!n)throw new Error(`Unknown filter "${e}". Known filters: ${Object.keys(Y).sort().join(", ")}.`);return n(t,...r)},"applyFilter");var hn=Object.defineProperty,ke=w((e,t)=>hn(e,"name",{value:t,configurable:!0}),"d$1");const xe=ke(e=>{const t=[];let r=0,n=0,a,i=-1;for(const l of e){if(i+=1,a){l===a&&(a=void 0);continue}if(l==='"'||l==="'"){a=l;continue}l==="("?r+=1:l===")"?r-=1:l===","&&r===0&&(t.push(e.slice(n,i)),n=i+1)}return t.push(e.slice(n)),t},"splitCommaOutsideQuotes"),mn=ke(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes");var dn=Object.defineProperty,R=w((e,t)=>dn(e,"name",{value:t,configurable:!0}),"s$1");const gn=/\[([^\]]+)\]/g,yn=R(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(),a=t.slice(r+1,-1).trim();return a===""?{args:[],name:n}:{args:xe(a).map(i=>{const l=i.trim();return mn(l)??l}),name:n}},"parseFilterCall"),bn=R(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=>yn(n)),name:r}},"parsePipe"),$n=R(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),vn=R((e,t)=>{const r=e.replaceAll(gn,(n,a)=>{const{filters:i,name:l}=bn(a);if(!Object.hasOwn(t,l))throw new Error(`Variable "${l}" used in filename "${e}" but not defined`);let o=t[l];for(const h of i)o=Oe(h.name,o,h.args);return $n(o)});return Ce(r)},"interpolateFilename"),Ce=R(e=>e.split("/").map(t=>t.endsWith(".tera")||t.endsWith(".twig")?t.slice(0,-5):t).join("/"),"stripTeraSuffix"),wn=R(e=>e.endsWith(".raw")?e.slice(0,-4):e,"stripRawSuffix"),jn=R(e=>{const t=e.split("/");return(t.at(-1)??"").startsWith("_")?!0:t.slice(0,-1).includes("partials")},"isPartialPath");var En=Object.defineProperty,On=w((e,t)=>En(e,"name",{value:t,configurable:!0}),"i");const kn=On((e,t)=>{if(!e.startsWith(`---
|
|
1
|
+
var Te=Object.defineProperty;var w=(e,t)=>Te(e,"name",{value:t,configurable:!0});import{createRequire as ze}from"node:module";import{o as Be,ac as Ie,p as Ne,aH as qe}from"./bin.js";import{z as he,M as me,$ as I}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";const Me=ze(import.meta.url),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fe=w(e=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[t,r]=z.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return z.getBuiltinModule(e)}return Me(e)},"__cjs_getBuiltinModule"),{createRequire:Ge}=Fe("node:module");var De=Object.defineProperty,Ke=w((e,t)=>De(e,"name",{value:t,configurable:!0}),"p$6"),Qe=Object.defineProperty,de=Ke((e,t)=>Qe(e,"name",{value:t,configurable:!0}),"e"),Ve=Object.defineProperty,He=de((e,t)=>Ve(e,"name",{value:t,configurable:!0}),"E");const ge=String.raw,re=ge`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Je=He(()=>new RegExp(ge`\p{RI}{2}|(?)${re}(?:\u200D${re})*`,"gu"),"default");var Ye=Object.defineProperty,Xe=de((e,t)=>Ye(e,"name",{value:t,configurable:!0}),"p");Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]]));const T=Je(),Ze=/[-_./\s]+/g,L=/(\u001B\[[0-9;]*[a-z])/i,ne=new RegExp("\\p{Script=Arabic}","u"),et=new RegExp("\\p{Script=Bengali}","u"),_=new RegExp("\\p{Script=Cyrillic}","u"),tt=new RegExp("\\p{Script=Devanagari}","u"),rt=new RegExp("\\p{Script=Ethiopic}","u"),Q=new RegExp("\\p{Script=Greek}","u"),ae=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),nt=new RegExp("\\p{Script=Gujarati}","u"),at=new RegExp("\\p{Script=Gurmukhi}","u"),ie=new RegExp("\\p{Script=Hangul}","u"),se=new RegExp("\\p{Script=Hebrew}","u"),it=new RegExp("\\p{Script=Hiragana}","u"),oe=new RegExp("\\p{Script=Han}","u"),st=new RegExp("\\p{Script=Kannada}","u"),ot=new RegExp("\\p{Script=Katakana}","u"),lt=new RegExp("\\p{Script=Khmer}","u"),ct=new RegExp("\\p{Script=Lao}","u"),O=new RegExp("\\p{Script=Latin}","u"),ut=new RegExp("\\p{Script=Malayalam}","u"),pt=new RegExp("\\p{Script=Myanmar}","u"),ft=new RegExp("\\p{Script=Oriya}","u"),ht=new RegExp("\\p{Script=Sinhala}","u"),mt=new RegExp("\\p{Script=Tamil}","u"),dt=new RegExp("\\p{Script=Telugu}","u"),gt=new RegExp("\\p{Script=Thai}","u"),yt=new RegExp("\\p{Script=Tibetan}","u"),le=/[\u02BB\u02BC\u0027]/u,bt=Xe(e=>e.replace(T,""),"stripEmoji");var $t=Object.defineProperty,ye=w((e,t)=>$t(e,"name",{value:t,configurable:!0}),"i$5"),vt=Object.defineProperty,be=ye((e,t)=>vt(e,"name",{value:t,configurable:!0}),"r"),wt=Object.defineProperty,jt=be((e,t)=>wt(e,"name",{value:t,configurable:!0}),"c");let W=class{static{w(this,"l")}static{ye(this,"y")}static{be(this,"s")}static{jt(this,"LRUCache")}capacity;cache;keyOrder;constructor(t){this.capacity=t,this.cache=new Map,this.keyOrder=[]}get(t){if(this.cache.has(t))return this.keyOrder=this.keyOrder.filter(r=>r!==t),this.keyOrder.push(t),this.cache.get(t)}has(t){return this.cache.has(t)}set(t,r){if(this.cache.has(t))this.keyOrder=this.keyOrder.filter(n=>n!==t);else if(this.cache.size>=this.capacity){const n=this.keyOrder.shift();n!==void 0&&this.cache.delete(n)}this.cache.set(t,r),this.keyOrder.push(t)}delete(t){this.cache.delete(t),this.keyOrder=this.keyOrder.filter(r=>r!==t)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var Et=Object.defineProperty,Ot=w((e,t)=>Et(e,"name",{value:t,configurable:!0}),"r$6"),kt=Object.defineProperty,xt=Ot((e,t)=>kt(e,"name",{value:t,configurable:!0}),"a"),Ct=Object.defineProperty,St=xt((e,t)=>Ct(e,"name",{value:t,configurable:!0}),"s");const Pt=St((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleLowerCase(t.locale):e[0].toLowerCase())+e.slice(1),"lowerFirst");var At=Object.defineProperty,Lt=w((e,t)=>At(e,"name",{value:t,configurable:!0}),"I"),Wt=Object.defineProperty,q=Lt((e,t)=>Wt(e,"name",{value:t,configurable:!0}),"W");const Rt=Ge(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_t=q(e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[t,r]=M.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return M.getBuiltinModule(e)}return Rt(e)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:Ut}=_t("node:util");var Tt=Object.defineProperty,zt=q((e,t)=>Tt(e,"name",{value:t,configurable:!0}),"g");const V=new W(1e3),Mt=/[.*+?^${}()|[\]\\]/g,Ft=zt(e=>{const t=e.join("");if(V.has(t))return V.get(t);const r=e.map(a=>a.replaceAll(Mt,String.raw`\$&`)).join("|"),n=new RegExp(r,"g");return V.set(t,n),n},"getSeparatorsRegex");var Bt=Object.defineProperty,It=q((e,t)=>Bt(e,"name",{value:t,configurable:!0}),"t");const Nt=It(e=>{const t=[];let r=0,n;for(T.lastIndex=0;(n=T.exec(e))!==null;)n.index>r&&t.push(e.slice(r,n.index)),t.push(n[0]),r=T.lastIndex;return r<e.length&&t.push(e.slice(r)),t.filter(Boolean)},"splitByEmoji");var qt=Object.defineProperty,$=q((e,t)=>qt(e,"name",{value:t,configurable:!0}),"u");const Gt=/[ČŠŽĐ]/i,$e=new Uint8Array(128),ve=new Uint8Array(128),we=new Uint8Array(128);for(let e=0;e<128;e++)$e[e]=e>=65&&e<=90?1:0,ve[e]=e>=97&&e<=122?1:0,we[e]=e>=48&&e<=57?1:0;const H=$(e=>$e[e],"isUpper"),ce=$(e=>ve[e],"isLower"),J=$(e=>we[e],"isDigit"),A=$((e,t,r,n,a)=>{if(e.length===0)return[];let i=!1;const l=Object.values(t);for(const u of l)if(u(e[0])){i=!0;break}if(!i&&!r)return[e];const o=[...e],h=[];let s=o[0],f="other";const m=Object.entries(t);for(const u of m){const[p,g]=u;if(g(o[0])){f=p;break}}let c=r&&n?o[0]===o[0].toLocaleUpperCase(n):!1;for(let u=1;u<o.length;u++){const p=o[u];let g="other";for(const b of m){const[v,E]=b;if(E(p)){g=v;break}}const y=r&&n?p===p.toLocaleUpperCase(n):!1;let d=!1;a?d=a(f,g,c,y,p,u,o):(f!==g&&f!=="other"&&g!=="other"&&(d=!0),r&&g!=="other"&&!c&&y&&(d=!0)),d?(h.push(s),s=p):s+=p,f=g,r&&(c=y)}return s&&s.length>0&&h.push(s),h.length>0?h:[e]},"handleScriptTransitions"),Dt=$((e,t,r,n)=>{if(r.size===0)return t;for(const a of r)if(e.startsWith(a,t))return n.push(a),t+a.length;return t},"detectAndProcessAcronym"),je=$((e,t=new Set)=>{if(e.length===0)return[];if(e.toUpperCase()===e)return[e];let r=0;const n=[],a=e.length;for(let i=1;i<a;i++){const l=Dt(e,r,t,n);if(l!==r){r=l,i=r-1;continue}const o=e.codePointAt(i-1),h=e.codePointAt(i),s=o&&o<128&&H(o),f=h&&h<128&&H(h),m=o&&o<128&&ce(o),c=o&&o<128&&J(o),u=h&&h<128&&J(h);if(m&&f){n.push(e.slice(r,i)),r=i;continue}if(c&&!u||!c&&u){n.push(e.slice(r,i)),r=i;continue}if(u&&!c){let p=!1,g=!1;if(i+1<a){const y=e.codePointAt(i+1);p=y&&y<128&&H(y),g=y&&y<128&&J(y)}if(!g&&p){n.push(e.slice(r,i),e.slice(i,i+1)),r=i+1;continue}}if(i+1<a){const p=e.codePointAt(i+1),g=p&&p<128&&ce(p);if(s&&f&&g){const y=e.slice(r,i+1);t.has(y)||(n.push(e.slice(r,i)),r=i)}}}return r<a&&n.push(e.slice(r)),n.filter(i=>i!=="")},"splitCamelCaseFast"),Ee=$((e,t,r)=>{if(e.length===0)return[];const n=e===e.toLocaleUpperCase(t);if(t.startsWith("de")){if(!n&&e.replaceAll("ß","SS")===e.toLocaleUpperCase(t))return[e];const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t),p=u,g=u?0:-1;for(let y=1;y<f;y++){const d=s[y],b=d===d.toLocaleUpperCase(t);if(b===u)c+=d;else if(b)c&&c.length>0&&(m.push(c),c=d),p=!0,g=y;else{if(p&&y-g>1){const v=s[y-1],E=c.slice(0,-1);E&&E.length>0&&m.push(E),c=v+d}else c+=d;p=!1,g=-1}u=b}return c&&c.length>0&&m.push(c),m}if(t.startsWith("uk")||t.startsWith("ru")||t.startsWith("bg")||t.startsWith("sr")||t.startsWith("mk")||t.startsWith("be")){if(!_.test(e)&&!O.test(e))return[e];const s=[...e],f=s.length,m=[];let c=s[0];const u=s[0];let p;_.test(u)?p=1:O.test(u)?p=2:p=0;let g=u===u.toLocaleUpperCase(t);for(let d=1;d<f;d++){const b=s[d];let v;_.test(b)?v=1:O.test(b)?v=2:v=0;const E=b===b.toLocaleUpperCase(t);p!==v&&(p===1||p===2)&&(v===1||v===2)||v===p&&!g&&E?(m.push(c),c=b):c+=b,p=v,g=E}c&&c.length>0&&m.push(c);const y=[];for(let d=0;d<m.length;d++)d<m.length-1&&m[d].length===1&&O.test(m[d])&&_.test(m[d+1][0])?(y.push(m[d]+m[d+1]),d+=1):y.push(m[d]);return y}if(t.startsWith("el")){if(!Q.test(e)&&!O.test(e))return[e];const s=[];ae.lastIndex=0;let f;for(;(f=ae.exec(e))!==null;)s.push(f[0]);s.length===0&&s.push(e);const m=[];if(s.length===1){const c=s[0];if(!c||!Q.test(c[0])||c.length===1)return[c??e]}for(const c of s){if(!c)continue;if(!Q.test(c[0])||c.length===1){m.push(c);continue}const u=c.length;let p=c[0],g=c[0]===c[0].toLocaleUpperCase(t);for(let y=1;y<u;y++){const d=c[y],b=d===d.toLocaleUpperCase(t);!g&&b?(m.push(p),p=d):p+=d,g=b}p&&m.push(p)}return m}if(t.startsWith("ja")||t.startsWith("ko")){const s=t.startsWith("ja"),f=s?{hiragana:$(c=>it.test(c),"hiragana"),kanji:$(c=>oe.test(c),"kanji"),katakana:$(c=>ot.test(c),"katakana"),latin:$(c=>O.test(c),"latin")}:{hangul:$(c=>ie.test(c),"hangul"),latin:$(c=>O.test(c),"latin")},m=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(s){const c=A(e,f,!1,t,(p,g)=>p==="hiragana"&&g==="katakana"||p==="katakana"&&g==="hiragana"||p==="hiragana"&&g==="latin"||p==="katakana"&&g==="latin"||p==="kanji"&&g==="latin"||p==="latin"&&(g==="hiragana"||g==="katakana"||g==="kanji")),u=[];for(const p of c){const g=p;g.length===1&&m.has(g)&&u.length>0?u[u.length-1]=u.at(-1)+g:u.push(g)}return u.length>0?u:[e]}return A(e,f,!1,t,(c,u)=>c==="hangul"&&u==="latin"||c==="latin"&&u==="hangul")}if(t.startsWith("sl")){const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t);for(let p=1;p<f;p++){const g=s[p],y=g===g.toLocaleUpperCase(t),d=Gt.test(g),b=p<f-1&&s[p+1]===s[p+1].toLocaleUpperCase(t);!u&&y||d&&b?(m.push(c),c=g,d&&b&&(m.push(c),c="")):c+=g,u=y}return c&&c.length>0&&m.push(c),m}if(t.startsWith("zh"))return A(e,{han:$(s=>oe.test(s),"han"),latin:$(s=>O.test(s),"latin")},!1,t);if(["ar","fa","he","ur"].includes(t.split("-")[0])){const s=$(f=>se.test(f)||ne.test(f),"isRtlChar");return A(e,{latin:$(f=>O.test(f),"latin"),rtl:$(f=>s(f),"rtl")},!1,t)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(t.split("-")[0])){const s=$(f=>tt.test(f)||et.test(f)||nt.test(f)||at.test(f)||st.test(f)||mt.test(f)||dt.test(f)||ut.test(f)||ht.test(f)||gt.test(f)||ct.test(f)||yt.test(f)||pt.test(f)||rt.test(f)||lt.test(f)||ft.test(f),"isIndicChar");return A(e,{indic:$(f=>s(f),"indic"),latin:$(f=>O.test(f),"latin")},!1,t)}if(["be","bg","ru","sr","uk"].includes(t))return A(e,{cyrillic:$(s=>_.test(s),"cyrillic"),latin:$(s=>O.test(s),"latin")},!0,t);if(["ar","fa","he"].includes(t))return A(e,{latin:$(s=>O.test(s),"latin"),rtl:$(s=>se.test(s)||ne.test(s),"rtl")},!1,t);if(t.startsWith("ko"))return A(e,{hangul:$(s=>ie.test(s),"hangul"),latin:$(s=>O.test(s),"latin")},!1,t);if(t.startsWith("uz")){if(!_.test(e)&&!O.test(e))return[e];const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t);for(let p=1;p<f;p++){const g=s[p],y=g===g.toLocaleUpperCase(t);if(le.test(g)||le.test(s[p-1])){c+=g;continue}!u&&y?(m.push(c),c=g):c+=g,u=y}return c&&c.length>0&&m.push(c),m}const a=[...e],i=a.length,l=[];let o=a[0],h=a[0]===a[0].toLocaleUpperCase(t);for(const s of r)if(e.startsWith(s)){l.push(s),o=a[s.length],h=o===o.toLocaleUpperCase(t);break}for(let s=1;s<i;s++){const f=a[s],m=f===f.toLocaleUpperCase(t);let c=0;for(const u of r)if(e.startsWith(u,s)){l.push(o,u),c=u.length,o="";const p=u.at(-1);p&&(h=p===p.toLocaleUpperCase(t));break}if(c>0){s+=c-1;continue}!h&&m?(l.push(o),o=f):o+=f,h=m}return o&&l.push(o),l},"splitCamelCaseLocale"),Kt=$((e,t,r)=>{const n=[],a=L.test(e)?e.split(L).filter(Boolean):[e];for(const i of a){const l=i;if(L.test(l))n.push(l);else{const o=T.test(l)?Nt(l).filter(Boolean):[l];for(const h of o)if(T.test(h))n.push(h);else if(t){const s=t.toLowerCase().split("-")[0];n.push(...Ee(h,s,r))}else n.push(...je(h,r))}}return n},"processTextWithAnsiEmoji"),G=$((e,t={})=>{if(!e||typeof e!="string")return[];const{handleAnsi:r=!1,handleEmoji:n=!1,knownAcronyms:a=[],locale:i,normalize:l=!1,separators:o,stripAnsi:h=!1,stripEmoji:s=!1}=t,f=new Set([...a].toSorted((d,b)=>b.length-d.length));let m=e;h&&(m=Ut(m)),s&&(m=bt(m));let c;Array.isArray(o)?c=Ft(o):o instanceof RegExp?c=o:c=Ze;const u=[];let p=m;const g=c.flags.includes("g")?c:new RegExp(c.source,`${c.flags}g`);for(;p.length>0;){const d=g.exec(p);if(!d){p===".."?u.push(".."):p==="."?u.push("."):p.length>0&&u.push(p);break}const b=d.index,v=d[0],E=v.length,B=p.slice(0,b),Ue=p.slice(b+E);if(v.startsWith("../"))u.push(".."),p=p.slice(b+3);else if(v.startsWith("./"))u.push("."),p=p.slice(b+2);else if(b===0&&v==="..")u.push(".."),p=p.slice(2);else if(b===0&&v===".")u.push("."),p=p.slice(1);else{B.length>0&&u.push(B);let S=0;for(;(S=v.indexOf("../",S))!==-1;)u.push(".."),S+=3;for(S=0;(S=v.indexOf("./",S))!==-1;)(S===0||v[S-1]!==".")&&u.push("."),S+=2;let P=Ue;for(;P.startsWith("../");)u.push(".."),P=P.slice(3);for(;P.startsWith("./");)u.push("."),P=P.slice(2);if(P===".."){u.push("..");break}else if(P==="."){u.push(".");break}else p=P}g.lastIndex=0}if(u.length===0){const d=m.split(c).filter(Boolean);u.push(...d)}let y=[];for(const d of u)r||n?y.push(...Kt(d,i,f)):i?y.push(...Ee(d,i,f)):y.push(...je(d,f));return l&&(y=y.map(d=>f.has(d)?d:i&&d===d.toLocaleUpperCase(i)?d[0]+d.slice(1).toLocaleLowerCase(i):d.toUpperCase()===d&&!f.has(d)?d.slice(0,1)+d.slice(1).toLowerCase():d)),y},"splitByCase");var Qt=Object.defineProperty,Vt=w((e,t)=>Qt(e,"name",{value:t,configurable:!0}),"r$5"),Ht=Object.defineProperty,Jt=Vt((e,t)=>Ht(e,"name",{value:t,configurable:!0}),"o"),Yt=Object.defineProperty,Xt=Jt((e,t)=>Yt(e,"name",{value:t,configurable:!0}),"s");const Z=Xt((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleUpperCase(t.locale):e[0].toUpperCase())+e.slice(1),"upperFirst");var Zt=Object.defineProperty,er=w((e,t)=>Zt(e,"name",{value:t,configurable:!0}),"r$4"),tr=Object.defineProperty,rr=er((e,t)=>tr(e,"name",{value:t,configurable:!0}),"r"),nr=Object.defineProperty,ar=rr((e,t)=>nr(e,"name",{value:t,configurable:!0}),"n");const D=ar((e,t)=>`${e}::${t?.joiner??""}::${t?.locale??""}::${t?.knownAcronyms?.join(",")??""}::${t?.normalize?"true":"false"}`,"generateCacheKey");var ir=Object.defineProperty,sr=w((e,t)=>ir(e,"name",{value:t,configurable:!0}),"i$3"),or=Object.defineProperty,lr=sr((e,t)=>or(e,"name",{value:t,configurable:!0}),"f"),cr=Object.defineProperty,ur=lr((e,t)=>cr(e,"name",{value:t,configurable:!0}),"l");const K=ur((e,t)=>{const{length:r}=e;if(r===0)return"";if(r===1)return e[0];const n=[];let a="",i="";for(let l=0;l<r;l++){const o=e[l];if(L.test(o)){a?(n.push(a+i+o),a="",i=""):(n.length>0&&n.push(t),a=o);continue}a?(i&&(i+=t),i+=o):(n.length>0&&n.push(t),n.push(o))}return n.join("")},"joinSegments");var pr=Object.defineProperty,fr=w((e,t)=>pr(e,"name",{value:t,configurable:!0}),"r$3"),hr=Object.defineProperty,mr=fr((e,t)=>hr(e,"name",{value:t,configurable:!0}),"a"),dr=Object.defineProperty,gr=mr((e,t)=>dr(e,"name",{value:t,configurable:!0}),"e");const yr=/(?<![a-zß])SS(?![a-z])/g,ee=gr(e=>e.replaceAll(yr,"ß"),"normalizeGermanEszett");var br=Object.defineProperty,$r=w((e,t)=>br(e,"name",{value:t,configurable:!0}),"c$3"),vr=Object.defineProperty,wr=$r((e,t)=>vr(e,"name",{value:t,configurable:!0}),"c"),jr=Object.defineProperty,Er=wr((e,t)=>jr(e,"name",{value:t,configurable:!0}),"o");const Or=new W(1e3),kr=Er((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??Or;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);let i=!0;const l=K(G(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=>{if(t?.handleAnsi&&L.test(o))return o;const h=t?.locale?.startsWith("de")?ee(o):o,s=t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase();return i?(i=!1,Pt(s,t)):Z(s,t)}),"");return r&&a&&n.set(a,l),l},"camelCase");var xr=Object.defineProperty,Cr=w((e,t)=>xr(e,"name",{value:t,configurable:!0}),"l$3"),Sr=Object.defineProperty,Pr=Cr((e,t)=>Sr(e,"name",{value:t,configurable:!0}),"l"),Ar=Object.defineProperty,Lr=Pr((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"o");const Wr=new W(1e3),te=Lr((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??Wr;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=G(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=>{if(t?.handleAnsi&&L.test(o))return o;if(t?.toUpperCase)return t.locale?o.toLocaleUpperCase(t.locale):o.toUpperCase();const h=t?.locale?.startsWith("de")?ee(o):o;return t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase()}),l=K(i,t?.joiner??"-");return r&&a&&n.set(a,l),l},"kebabCase");var Rr=Object.defineProperty,_r=w((e,t)=>Rr(e,"name",{value:t,configurable:!0}),"r$2"),Ur=Object.defineProperty,Tr=_r((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"a"),zr=Object.defineProperty,Mr=Tr((e,t)=>zr(e,"name",{value:t,configurable:!0}),"s");const Fr=new W(1e3),Br=Mr((e,t)=>te(e,{cacheStore:Fr,...t,joiner:"_",toUpperCase:!0}),"constantCase");var Ir=Object.defineProperty,Nr=w((e,t)=>Ir(e,"name",{value:t,configurable:!0}),"l$2"),qr=Object.defineProperty,Gr=Nr((e,t)=>qr(e,"name",{value:t,configurable:!0}),"l"),Dr=Object.defineProperty,Kr=Gr((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"i");const Qr=new W(1e3),Vr=Kr((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??Qr;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=K(G(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&&L.test(l))return l;const o=t?.locale?.startsWith("de")?ee(l):l;return Z(t?.locale?o.toLocaleLowerCase(t.locale):o.toLowerCase(),{locale:t?.locale})}),"");return r&&a&&n.set(a,i),i},"pascalCase");var Hr=Object.defineProperty,Jr=w((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"r$1"),Yr=Object.defineProperty,Xr=Jr((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"a"),Zr=Object.defineProperty,en=Xr((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"s");const tn=new W(1e3),rn=en((e,t)=>te(e,{cacheStore:tn,...t,joiner:"_"}),"snakeCase");var nn=Object.defineProperty,an=w((e,t)=>nn(e,"name",{value:t,configurable:!0}),"r"),sn=Object.defineProperty,on=an((e,t)=>sn(e,"name",{value:t,configurable:!0}),"e"),ln=Object.defineProperty,cn=on((e,t)=>ln(e,"name",{value:t,configurable:!0}),"i");const un=new W(1e3),pn=cn((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??un;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=K(G(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=>Z(l,{locale:t?.locale})),"-");return r&&a&&n.set(a,i),i},"trainCase");var fn=Object.defineProperty,k=w((e,t)=>fn(e,"name",{value:t,configurable:!0}),"e");const x=k(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),Y={camel_case:k(e=>kr(x(e)),"camel_case"),kebab_case:k(e=>te(x(e)),"kebab_case"),lower_case:k(e=>x(e).toLowerCase(),"lower_case"),pascal_case:k(e=>Vr(x(e)),"pascal_case"),path_join:k((e,...t)=>{const r=[x(e),...t.map(n=>x(n))];return me(...r)},"path_join"),path_relative:k((e,t)=>he(x(t),x(e)),"path_relative"),snake_case:k(e=>rn(x(e)),"snake_case"),upper_case:k(e=>x(e).toUpperCase(),"upper_case"),upper_kebab_case:k(e=>pn(x(e)),"upper_kebab_case"),upper_snake_case:k(e=>Br(x(e)),"upper_snake_case")};k(e=>Object.hasOwn(Y,e),"isKnownFilter");const Oe=k((e,t,r=[])=>{const n=Y[e];if(!n)throw new Error(`Unknown filter "${e}". Known filters: ${Object.keys(Y).sort().join(", ")}.`);return n(t,...r)},"applyFilter");var hn=Object.defineProperty,ke=w((e,t)=>hn(e,"name",{value:t,configurable:!0}),"d$1");const xe=ke(e=>{const t=[];let r=0,n=0,a,i=-1;for(const l of e){if(i+=1,a){l===a&&(a=void 0);continue}if(l==='"'||l==="'"){a=l;continue}l==="("?r+=1:l===")"?r-=1:l===","&&r===0&&(t.push(e.slice(n,i)),n=i+1)}return t.push(e.slice(n)),t},"splitCommaOutsideQuotes"),mn=ke(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes");var dn=Object.defineProperty,R=w((e,t)=>dn(e,"name",{value:t,configurable:!0}),"s$1");const gn=/\[([^\]]+)\]/g,yn=R(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(),a=t.slice(r+1,-1).trim();return a===""?{args:[],name:n}:{args:xe(a).map(i=>{const l=i.trim();return mn(l)??l}),name:n}},"parseFilterCall"),bn=R(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=>yn(n)),name:r}},"parsePipe"),$n=R(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),vn=R((e,t)=>{const r=e.replaceAll(gn,(n,a)=>{const{filters:i,name:l}=bn(a);if(!Object.hasOwn(t,l))throw new Error(`Variable "${l}" used in filename "${e}" but not defined`);let o=t[l];for(const h of i)o=Oe(h.name,o,h.args);return $n(o)});return Ce(r)},"interpolateFilename"),Ce=R(e=>e.split("/").map(t=>t.endsWith(".tera")||t.endsWith(".twig")?t.slice(0,-5):t).join("/"),"stripTeraSuffix"),wn=R(e=>e.endsWith(".raw")?e.slice(0,-4):e,"stripRawSuffix"),jn=R(e=>{const t=e.split("/");return(t.at(-1)??"").startsWith("_")?!0:t.slice(0,-1).includes("partials")},"isPartialPath");var En=Object.defineProperty,On=w((e,t)=>En(e,"name",{value:t,configurable:!0}),"i");const kn=On((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,3 +1,3 @@
|
|
|
1
|
-
var x=Object.defineProperty;var w=(t,s)=>x(t,"name",{value:s,configurable:!0});import{createRequire as B}from"node:module";import{a6 as P,p as o,a7 as R}from"./bin.js";import{A as V}from"../packem_shared/pm-runner-
|
|
1
|
+
var x=Object.defineProperty;var w=(t,s)=>x(t,"name",{value:s,configurable:!0});import{createRequire as B}from"node:module";import{a6 as P,p as o,a7 as R}from"./bin.js";import{A as V}from"../packem_shared/pm-runner-BwX5AL3W.js";import{x as C}from"../packem_shared/build-scripts-3E2pmscY.js";import{M as y,i as k}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{n as q}from"./config.js";const D=B(import.meta.url),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=w(t=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[s,f]=v.versions.node.split(".").map(Number);if(s>22||s===22&&f>=3||s===20&&f>=16)return v.getBuiltinModule(t)}return D(t)},"__cjs_getBuiltinModule"),{readdirSync:j,statSync:O}=M("node:fs");var A=Object.defineProperty,_=w((t,s)=>A(t,"name",{value:s,configurable:!0}),"p$1");const N=_((t,s={})=>{const f=y(t,"node_modules");if(!k(f))return[];const l=new Map,p=new Set,b=_((n,i,a)=>{const e=`${i}@${a}`;if(p.has(e))return;p.add(e);const r=a.startsWith(t)?a.slice(t.length+1):a;let u=l.get(n);u||(u=[],l.set(n,u)),u.some($=>$.name===i)||u.push({name:i,relativePath:r})},"recordBin"),m=_((n,i="")=>{let a;try{a=j(n)}catch{return}for(const e of a){const r=y(n,e);if(e.startsWith("@")){m(r,`${e}/`);continue}if(e===".pnpm"&&i===""){let c;try{c=j(r)}catch{continue}for(const d of c){const h=y(r,d,"node_modules");k(h)&&m(h)}continue}if(e.startsWith("."))continue;const u=i+e,$=y(r,"package.json");try{if(!O(r).isDirectory()||!k($))continue;const c=q($),d=typeof c.name=="string"?c.name:u;if(typeof c.bin=="string"){const S=d.includes("/")?d.split("/").pop():d;b(S,d,r)}else if(c.bin&&typeof c.bin=="object")for(const S of Object.keys(c.bin))b(S,d,r);const h=y(r,"node_modules");k(h)&&m(h)}catch{}}},"scanDir");m(f);const g=[];for(const[n,i]of l)i.length<2||s[n]===!0||i.every(a=>s[`${a.name}#${n}`]===!0)||g.push({bin:n,packages:i});return g.sort((n,i)=>n.bin.localeCompare(i.bin))},"collectBinShadows");var T=Object.defineProperty,W=w((t,s)=>T(t,"name",{value:s,configurable:!0}),"p");const U=new Set(["bun","npm","pnpm","yarn"]),K=W(({options:t,visConfig:s,workspaceRoot:f})=>{const l=f??process.cwd(),p=V(l),b=s?.security?.policies?.installScripts?.allow??{},m=s?.security?.allowBins??{},g=s?.security?.pinVersions===!0,n=C(l,b,{pinVersions:g}),i=N(l,m),a=s&&U.has(p.name)?P(s,p.name,l):void 0;if(t.json){process.stdout.write(`${JSON.stringify({binConflicts:i,drift:a,excess:n.excess,installed:n.installed.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),packageManager:p.name,pinVersions:g,unapproved:n.unapproved.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),versionDrift:n.versionDrift},void 0,2)}
|
|
2
2
|
`);return}if(o.info(`Build-script status (${p.name}):
|
|
3
3
|
`),n.installed.length===0&&n.unapproved.length===0&&o.success(" No installed packages declare lifecycle scripts."),n.installed.length>0){o.success(` Approved (${String(n.installed.length)}):`);for(const e of n.installed)o.info(` ✓ ${e.name} — ${e.hooks.join(", ")}`)}if(n.unapproved.length>0){o.info(""),o.warn(` Unapproved (${String(n.unapproved.length)}):`);for(const e of n.unapproved)o.info(` ✗ ${e.name} — ${e.hooks.join(", ")}`);o.notice(" Run 'vis approve-builds' to review.")}if(n.excess.length>0){o.info(""),o.warn(` Stale allowlist entries (${String(n.excess.length)}):`);for(const e of n.excess)o.info(` ! ${e}`);o.notice(" Remove these from vis.config.ts security.policies.installScripts.allow.")}if(n.versionDrift.length>0){o.info(""),o.warn(` Version drift (pinVersions: true) — ${String(n.versionDrift.length)} entr${n.versionDrift.length===1?"y":"ies"} point at outdated versions:`);for(const{from:e,to:r}of n.versionDrift)o.info(` ${e} → ${r}`);o.notice(" Update vis.config.ts security.policies.installScripts.allow keys to migrate.")}if(i.length>0){o.info(""),o.warn(` Bin conflicts (${String(i.length)}) — multiple packages expose the same bin name:`);for(const e of i)o.info(` ${e.bin} ← ${e.packages.map(r=>r.name).join(", ")}`);o.notice(" Add the bin (or 'pkg#bin') to vis.config.ts security.allowBins to silence this.")}if(a?.hasDrift){o.info("");for(const e of R(a))o.warn(e)}},"execute");export{K as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var w=Object.defineProperty;var c=(e,t)=>w(e,"name",{value:t,configurable:!0});import{createRequire as y}from"node:module";import{A as m,P as $}from"../packem_shared/pm-runner-
|
|
1
|
+
var w=Object.defineProperty;var c=(e,t)=>w(e,"name",{value:t,configurable:!0});import{createRequire as y}from"node:module";import{A as m,P as $}from"../packem_shared/pm-runner-BwX5AL3W.js";const _=y(import.meta.url),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=c(e=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[t,s]=a.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return a.getBuiltinModule(e)}return _(e)},"__cjs_getBuiltinModule"),{createInterface:I}=v("node:readline");var h=Object.defineProperty,o=c((e,t)=>h(e,"name",{value:t,configurable:!0}),"n");const r="sigstore",b=o(()=>!!process.stdout.isTTY&&process.env.CI!=="true","isInteractive"),O=o(e=>new Promise(t=>{const s=I({input:process.stdin,output:process.stderr});s.question(`${e} (Y/n) `,i=>{s.close();const n=i.trim().toLowerCase();t(n===""||n==="y"||n==="yes")})}),"defaultPrompt"),D=o(e=>{const t=m(e),s=$(t,{exact:!1,filter:[],global:!1,optional:!1,packages:[r],peer:!1,saveDev:!0,workspace:!1,workspaceRoot:!1},e,console);return Promise.resolve({exitCode:s})},"defaultRunInstall"),k=o(()=>{try{return import.meta.resolve(r),!0}catch{return!1}},"isSigstoreInstalled"),P=o(e=>{let t="pnpm";try{t=m(e).name}catch{}switch(t){case"bun":return`bun add -d ${r}`;case"npm":return`npm install -D ${r}`;case"yarn":return`yarn add -D ${r}`;default:return`pnpm add -D ${r}`}},"installCommandFor"),R=o(()=>import("sigstore"),"defaultImport"),x=o(async(e={})=>{const t=e.interactive??b(),s=e.prompt??O,i=e.runInstall??D,n=e.importImpl??R,d=e.workspaceRoot??process.cwd(),l=P(d);try{return await n()}catch(p){const{code:f,message:g}=p;if(!(f==="ERR_MODULE_NOT_FOUND"||f==="MODULE_NOT_FOUND")||!g.includes(r))throw p}if(!t)throw new Error(`${r} is not installed. \`vis attest\` needs it for keyless signing/verification. Install it in your repo first:
|
|
2
2
|
${l}`);if(!await s(`${r} isn't installed. Install it now?`))throw new Error(`${r} install declined. Re-run \`vis attest\` after installing manually:
|
|
3
3
|
${l}`);const u=await i(d);if(u.exitCode!==0)throw new Error(`Install of ${r} failed (exit ${String(u.exitCode)}). Install manually and retry:
|
|
4
4
|
${l}`);return await n()},"loadOptionalSigstore");export{P as installCommandFor,k as isSigstoreInstalled,x as loadOptionalSigstore};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var d=Object.defineProperty;var u=(r,o)=>d(r,"name",{value:o,configurable:!0});import{p as s}from"./bin.js";import{r as m}from"../packem_shared/advisories-
|
|
1
|
+
var d=Object.defineProperty;var u=(r,o)=>d(r,"name",{value:o,configurable:!0});import{p as s}from"./bin.js";import{r as m}from"../packem_shared/advisories-xIOdLbAI.js";var p=Object.defineProperty,l=u((r,o)=>p(r,"name",{value:o,configurable:!0}),"a");const v=l(async({fs:r,logger:o,options:t,workspaceRoot:n})=>{if(!n)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const e=t.db??m(n),a=t.format==="json";if(!t.force){s.warn(`Prune is destructive. Will remove: ${e}`),s.info("Re-run with --force to proceed."),a&&process.stdout.write(`${JSON.stringify({dbPath:e,reason:"needs --force",removed:!1})}
|
|
2
2
|
`);return}const f=[e,`${e}-wal`,`${e}-shm`,`${e}-journal`],i=[];for(const c of f)try{await r.rm(c,{force:!0}),i.push(c)}catch{}if(a){process.stdout.write(`${JSON.stringify({dbPath:e,files:i,removed:!0})}
|
|
3
3
|
`);return}s.success(`Removed ${e}.`)},"execute"),b=v;export{b as advisoriesPruneExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var l=Object.defineProperty;var c=(s,e)=>l(s,"name",{value:e,configurable:!0});import{e as v,E as f,I as p}from"../packem_shared/index.server-B7ETiT4C.js";import{p as r}from"./bin.js";import{r as g,g as h}from"../packem_shared/advisories-
|
|
1
|
+
var l=Object.defineProperty;var c=(s,e)=>l(s,"name",{value:e,configurable:!0});import{e as v,E as f,I as p}from"../packem_shared/index.server-B7ETiT4C.js";import{p as r}from"./bin.js";import{r as g,g as h}from"../packem_shared/advisories-xIOdLbAI.js";var $=Object.defineProperty,i=c((s,e)=>$(s,"name",{value:e,configurable:!0}),"a");const B=i(s=>{if(s===0)return"0 B";const e=["B","KB","MB","GB"],a=Math.min(Math.floor(Math.log(s)/Math.log(1024)),e.length-1),o=s/1024**a;return`${o.toFixed(o<10&&a>0?1:0)} ${e[a]}`},"formatBytes"),w=i(s=>{if(!s)return"never";const e=Date.parse(s);if(Number.isNaN(e))return s;const a=Date.now()-e;if(a<0)return s;const o=Math.floor(a/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const t=Math.floor(o/60);return t<24?`${t}h ago`:`${Math.floor(t/24)}d ago`},"formatRelative"),S=i(async({logger:s,options:e,workspaceRoot:a})=>{if(!a)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const o=e.db??g(a),t=await h(a,o);if(e.format==="json"){process.stdout.write(`${JSON.stringify({dbPath:o,ecosystems:t.ecosystems.map(n=>({advisoryCount:n.advisoryCount,lastSyncIso:n.lastSyncIso,manifestEtag:n.manifestEtag??null,name:n.name})),exists:t.exists,schemaVersion:t.schemaVersion,sizeBytes:t.sizeBytes},void 0,2)}
|
|
2
2
|
`);return}if(r.info(`DB: ${o}`),!t.exists){r.warn(`No advisory DB yet. Run ${v("vis advisories sync")} to populate.`);return}if(r.info(`Schema: v${t.schemaVersion} Size: ${B(t.sizeBytes)}`),t.ecosystems.length===0){r.warn("DB exists but contains no ecosystems. Run `vis advisories sync`.");return}r.info(""),r.info("Ecosystem Advisories Last sync ETag"),r.info(f("────────── ────────── ───────────────── ──────"));for(const n of t.ecosystems){const m=n.name.padEnd(10),u=n.advisoryCount.toLocaleString().padStart(10),d=`${n.lastSyncIso||"never"} (${w(n.lastSyncIso)})`.padEnd(19),y=n.manifestEtag??f("—");r.info(`${p(m)} ${u} ${d} ${y}`)}},"execute"),D=S;export{D as advisoriesStatusExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var w=Object.defineProperty;var y=(e,o)=>w(e,"name",{value:o,configurable:!0});import{E as $}from"../packem_shared/index.server-B7ETiT4C.js";import{p as l}from"./bin.js";import{s as D}from"../packem_shared/scan-progress-
|
|
1
|
+
var w=Object.defineProperty;var y=(e,o)=>w(e,"name",{value:o,configurable:!0});import{E as $}from"../packem_shared/index.server-B7ETiT4C.js";import{p as l}from"./bin.js";import{s as D}from"../packem_shared/scan-progress-DjPT66jy.js";import{s as b,D as S}from"../packem_shared/advisories-xIOdLbAI.js";var E=Object.defineProperty,c=y((e,o)=>E(e,"name",{value:o,configurable:!0}),"c");const P=c(e=>e?.security?.audit?.advisories??{},"readAdvisoriesConfig"),k=c(e=>e?e.split(",").map(o=>o.trim()).filter(o=>o.length>0):["npm"],"parseEcosystems"),x=c(async({logger:e,options:o,visConfig:g,workspaceRoot:d})=>{if(!d)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const u=o.format==="json",m=P(g),f=o.source??m.source??S,p=k(o.ecosystem),v=p.map(s=>({id:s,label:`Sync ${s} advisories`})),n=D(v,{live:!u}),i=[];try{for(const s of p){n.start(s);const r=Date.now();try{const t=await b({allowedHosts:m.allowedHosts,dbPath:o.db,ecosystem:s,force:!!o.force,source:f,workspaceRoot:d});i.push({ecosystem:s,result:t}),t.upToDate?n.finish(s,"ok",`up to date · ${h(Date.now()-r)}`):n.finish(s,"ok",`${t.advisoriesIngested.toLocaleString()} advisories · ${h(t.durationMs)}`)}catch(t){const a=t instanceof Error?t.message:String(t);i.push({ecosystem:s,error:a}),n.finish(s,"error",a)}}}finally{n.stop()}if(u){const s={ecosystems:i.map(r=>({advisoriesIngested:r.result?.advisoriesIngested??0,dbPath:r.result?.dbPath??null,durationMs:r.result?.durationMs??0,ecosystem:r.ecosystem,error:r.error??null,upToDate:r.result?.upToDate??!1})),source:f};process.stdout.write(`${JSON.stringify(s,void 0,2)}
|
|
2
2
|
`)}else{const s=i.filter(a=>a.error),r=i.filter(a=>a.result),t=r[0];t?.result?.dbPath&&l.info($(`DB: ${t.result.dbPath}`)),s.length===0?l.success(`Synced ${r.length} ecosystem${r.length===1?"":"s"}.`):l.error(`${s.length} ecosystem${s.length===1?"":"s"} failed to sync.`)}i.some(s=>s.error)&&(process.exitCode=1)},"execute"),h=c(e=>e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`,"formatDuration"),O=x;export{O as advisoriesSyncExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var m=Object.defineProperty;var f=(e,n)=>m(e,"name",{value:n,configurable:!0});import{p as i}from"./bin.js";import{A as g}from"../packem_shared/pm-runner-
|
|
1
|
+
var m=Object.defineProperty;var f=(e,n)=>m(e,"name",{value:n,configurable:!0});import{p as i}from"./bin.js";import{A as g}from"../packem_shared/pm-runner-BwX5AL3W.js";import{N as y}from"../packem_shared/native-config-sync-DdhTLlKL.js";import{E as v}from"../packem_shared/min-release-age-aEn0x8Vy.js";var h=Object.defineProperty,w=f((e,n)=>h(e,"name",{value:n,configurable:!0}),"l");const b=new Set(["bun","npm","pnpm","yarn"]),x=w(({options:e,visConfig:n,workspaceRoot:u})=>{const o=u??process.cwd(),t=g(o);if(!b.has(t.name)){i.warn(`Package manager '${t.name}' has no native security config to sync.`);return}if(!n?.security){i.warn("vis.config has no `security` block — nothing to sync.");return}const r=n.security.policies??{},a=Object.fromEntries(Object.entries(r.installScripts?.allow??{}).filter(([,c])=>c)),p=r.firstSeen?.minutes,l=r.firstSeen?.exclude??[],s=[];if(Object.keys(a).length>0&&!e.skipAllowBuilds&&s.push(...y(t.name,o,a)),e.skipMinReleaseAge||s.push(...v(t.name,o,p,l)),s.length===0){i.success("Nothing to sync — vis.config and native PM config are aligned.");return}i.info(`Syncing vis.config security settings to ${t.name} native config…
|
|
2
2
|
`);for(const c of s)i.success(` ${c}`)},"execute");export{x as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var y=Object.defineProperty;var d=(r,n)=>y(r,"name",{value:n,configurable:!0});import{createRequire as w}from"node:module";import{M as u,i as f}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{n as m,
|
|
1
|
+
var y=Object.defineProperty;var d=(r,n)=>y(r,"name",{value:n,configurable:!0});import{createRequire as w}from"node:module";import{M as u,i as f}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{n as m,d as k}from"./config.js";import{p as e}from"./bin.js";import{A as j}from"../packem_shared/pm-runner-BwX5AL3W.js";const v=w(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=d(r=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,s]=c.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return c.getBuiltinModule(r)}return v(r)},"__cjs_getBuiltinModule"),{spawnSync:$}=h("node:child_process");var _=Object.defineProperty,l=d((r,n)=>_(r,"name",{value:n,configurable:!0}),"c");const t="@lavamoat/preinstall-always-fail",p=l(r=>{const n=u(r,"package.json");if(!f(n))return"no-package-json";try{const s=m(n);if(s.devDependencies?.[t]||s.dependencies?.[t])return"installed"}catch{}return"missing"},"tripwireStatus"),b=l(r=>{const n=u(r,"package.json");if(!f(n))return!1;try{const s=m(n);let o=!1;const a=l(i=>!i||!(t in i)?i:(o=!0,Object.fromEntries(Object.entries(i).filter(([g])=>g!==t))),"stripFrom");return s.devDependencies=a(s.devDependencies),s.dependencies=a(s.dependencies),o&&k(n,`${JSON.stringify(s,null,2)}
|
|
2
2
|
`),o}catch{return!1}},"removeFromPackageJson"),O=l(({options:r,workspaceRoot:n})=>{const s=n??process.cwd();if(r.status){switch(p(s)){case"installed":{e.success(`Preinstall tripwire is installed (${t}).`),e.info("Removing 'ignore-scripts=true' will cause future installs to fail loudly.");break}case"missing":{e.warn("Preinstall tripwire is not installed."),e.info(`Run 'vis security tripwire' to add ${t} as a devDependency.`);break}default:e.error("No package.json found at the workspace root."),process.exitCode=1}return}if(r.remove){b(s)?e.success(`Removed ${t} from package.json. Run your PM's install to clean node_modules.`):e.info(`${t} was not present in package.json.`);return}if(p(s)==="installed"){e.info(`${t} is already installed.`);return}const o=j(s),a={bun:["add","-d",t],npm:["install","--save-dev",t],pnpm:["add","-D","-w",t],yarn:["add","-D",t]}[o.name];if(!a){e.error(`Cannot install tripwire — unsupported package manager '${o.name}'.`),process.exitCode=1;return}e.info(`Installing ${t} via ${o.name}…`);const i=$(o.name,a,{cwd:s,stdio:"inherit"});if(i.error){e.error(`Failed to install tripwire: ${i.error.message}`),process.exitCode=1;return}if(i.signal!==null){e.error(`${o.name} was terminated by signal ${i.signal}`),process.exitCode=1;return}if(i.status!==0){e.error(`${o.name} exited with code ${String(i.status)}`),process.exitCode=i.status??1;return}e.success(`Installed ${t} as a devDependency.`),e.notice(""),e.notice("How the tripwire works:"),e.notice(` ${t} declares a preinstall script that always fails.`),e.notice(" When 'ignore-scripts=true' is set (.npmrc / bunfig.toml / .yarnrc.yml),"),e.notice(" the script is skipped and installs succeed normally. If someone deletes"),e.notice(" that setting, the next install fails — loudly — instead of silently"),e.notice(" running every dependency's lifecycle scripts.")},"execute");export{O as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var $=Object.defineProperty;var k=(e,o)=>$(e,"name",{value:o,configurable:!0});import{p}from"./bin.js";import{A as x}from"../packem_shared/pm-runner-
|
|
1
|
+
var $=Object.defineProperty;var k=(e,o)=>$(e,"name",{value:o,configurable:!0});import{p}from"./bin.js";import{A as x}from"../packem_shared/pm-runner-BwX5AL3W.js";import{r as v,l as C,L as S}from"../packem_shared/dependency-scan-s2MD0vi-.js";import{$ as M,M as h,i as L}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{F as E}from"../packem_shared/lockfile-BG1HvBzH.js";import{e as P}from"../packem_shared/index-B_KtN1MB.js";var D=Object.defineProperty,m=k((e,o)=>D(e,"name",{value:o,configurable:!0}),"r");const V=m(e=>{const o=e.trim();return o===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(o)||/^(?:github|gitlab|bitbucket|gist):/i.test(o)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(o)&&!o.includes("@")?!0:/^https?:\/\//i.test(o)},"isExoticSpecifier"),N=m((e,o)=>{for(const s of o)if(s===e||s.endsWith("*")&&e.startsWith(s.slice(0,-1)))return!0;return!1},"matchesAllow"),O=m((e,o,s={})=>{const t=v(e,o);if(!t)return[];let i;try{i=M(h(e,t.file))}catch{return[]}const n=E(i,t.type);if(n.length===0)return[];const c=s.allow??[],l=[],f=new Set;for(const r of n){const a=`${r.name}@${r.version}`;for(const g of[r.dependencies,r.optionalDependencies])if(g){for(const[u,w]of Object.entries(g))if(!N(u,c))for(const y of w){if(!V(y))continue;const b=`${a}->${u}@${y}`;f.has(b)||(f.add(b),l.push({declaredBy:a,packageName:u,source:y}))}}}return l.sort((r,a)=>r.packageName.localeCompare(a.packageName)||r.declaredBy.localeCompare(a.declaredBy))},"scanExoticSubdeps");var R=Object.defineProperty,d=k((e,o)=>R(e,"name",{value:o,configurable:!0}),"n");const j=new Set(["firstSeen","publisherChange"]),A=d(e=>e.severity==="block"&&e.acceptedRisk===void 0,"isGatingDecision"),B=d(e=>{const o=e.security?.policies?.firstSeen?.minutes,s=typeof o=="number"&&o>0,t=e.security?.policies?.publisherChange?.mode==="no-downgrade",i=e.security?.blockExoticSubdeps===!0;return s||t||i},"anyPolicyConfigured"),F=d(async e=>{const{offline:o=!1,packageManager:s,visConfig:t,workspaceRoot:i}=e,n=Date.now();if(!B(t))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const c=v(i,s);if(!c||!L(h(i,c.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=C(i,s,{includeDev:!0}),f=l.length,r=await P({offline:o,packageManager:s,packages:l,workspaceRoot:i},"install",{enabledPolicies:new Set(j),visConfig:t}),a=t.security?.blockExoticSubdeps===!0?O(i,s,{allow:t.security.exoticSubdepsAllow}):[],g=r.some(u=>A(u))||a.length>0;return{decisions:r,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:g?"fail":"pass"}},"verifyLockfile"),W=d(e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,"formatElapsed"),G=d(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 o=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${W(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${o}`];const s=[`✗ Lockfile failed supply-chain policy check ${o}`];for(const t of e.decisions)t.severity==="block"&&t.acceptedRisk===void 0&&s.push(` [${t.policy}] ${t.reason}`);for(const t of e.exoticViolations)s.push(` [blockExoticSubdeps] ${t.packageName} pulled from exotic source by ${t.declaredBy}: ${t.source}`);return s},"formatLockfileVerification");var I=Object.defineProperty,J=k((e,o)=>I(e,"name",{value:o,configurable:!0}),"a");const U=J(async({options:e,visConfig:o,workspaceRoot:s})=>{const t=s??process.cwd(),i=x(t);if(!S[i.name]){p.warn(`Package manager '${i.name}' has no lockfile vis can verify.`);return}const n=await F({offline:!!e.offline,packageManager:i.name,visConfig:o??{},workspaceRoot:t});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
|
|
2
2
|
`),n.status==="fail"&&(process.exitCode=1);return}const[c,...l]=G(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},"execute");export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var I=Object.defineProperty;var d=(s,e)=>I(s,"name",{value:e,configurable:!0});import{createRequire as $}from"node:module";import{
|
|
1
|
+
var I=Object.defineProperty;var d=(s,e)=>I(s,"name",{value:e,configurable:!0});import{createRequire as $}from"node:module";import{B as W}from"../packem_chunks/config.js";import{advisoriesStatus as E,NATIVE_BINDING_VERSION as A,advisoriesIngest as j,advisoriesQuery as q}from"#native";const T=$(import.meta.url),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=d(s=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[e,t]=v.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return v.getBuiltinModule(s)}return T(s)},"__cjs_getBuiltinModule"),{randomUUID:O}=l("node:crypto"),{createWriteStream:P,existsSync:k}=l("node:fs"),{mkdir:U,unlink:x,stat:B}=l("node:fs/promises"),{join:w,dirname:C}=l("node:path"),{Readable:L}=l("node:stream"),{pipeline:M}=l("node:stream/promises");var F=Object.defineProperty,r=d((s,e)=>F(s,"name",{value:e,configurable:!0}),"s");const b=5;if(A!==b)throw new Error(`vis native binding ABI mismatch in advisories: expected ${b}, got ${A}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const es="https://osv-vulnerabilities.storage.googleapis.com",V=new Set(["osv-vulnerabilities.storage.googleapis.com"]);class H extends Error{static{d(this,"AdvisoryDbNotFoundError")}static{r(this,"AdvisoryDbNotFoundError")}cause="DB_NOT_FOUND";constructor(e){super(`No local advisory DB at ${e}. Run 'vis advisories sync' first.`),this.name="AdvisoryDbNotFoundError"}}class p extends Error{static{d(this,"AdvisorySourceNotAllowedError")}static{r(this,"AdvisorySourceNotAllowedError")}cause="SOURCE_NOT_ALLOWED";constructor(e){super(`Advisory source host '${e}' is not in the built-in allowlist. Add it to \`security.audit.advisories.allowedHosts\` if intentional.`),this.name="AdvisorySourceNotAllowedError"}}class N extends Error{static{d(this,"AdvisorySyncNetworkError")}static{r(this,"AdvisorySyncNetworkError")}cause="SYNC_NETWORK";constructor(e,t){super(`Advisory sync failed for ${e}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="AdvisorySyncNetworkError"}}const g=r(s=>{const e=W("vis",{create:!0,cwd:s})??w(s,"node_modules",".cache","vis");return w(e,"advisories","db.sqlite")},"resolveAdvisoryDbPath"),z=r((s,e)=>{let t;try{t=new URL(s)}catch{throw new p(s)}if(t.protocol!=="https:")throw new p(`${t.protocol}//${t.host}`);if(!new Set([...V,...e??[]]).has(t.host))throw new p(t.host);return t},"validateAdvisorySource"),ts=r(async s=>{const e=s.dbPath??g(s.workspaceRoot);await U(C(e),{recursive:!0});const t=z(s.source,s.allowedHosts),u=new URL(`${s.ecosystem}/all.zip`,Q(t.toString())),y=await G(e,s.ecosystem);let i=null;if(!s.force){const n=await S(u,{method:"HEAD"});if(n.ok&&(i=n.headers.get("etag"),i&&y&&i===y))return{advisoriesIngested:0,dbPath:e,durationMs:0,upToDate:!0}}const a=`${e}.${s.ecosystem}.${process.pid}.${O()}.zip.tmp`,o=await S(u,{method:"GET"});if(!o.ok||!o.body)throw new N(u.toString(),o.status);i||(i=o.headers.get("etag"));const m=o.headers.get("content-length"),c=m?Number.parseInt(m,10):null;let h=0;const _=P(a),f=L.fromWeb(o.body);s.onProgress&&c&&f.on("data",n=>{h+=n.byteLength,s.onProgress?.(h,c,"download")}),await M(f,_);try{const n=await j({dbPath:e,ecosystem:s.ecosystem,manifestEtag:i??void 0,zipPath:a},(D,R)=>s.onProgress?.(D,R,"ingest"));return{advisoriesIngested:n.advisoriesIngested,dbPath:e,durationMs:n.durationMs,upToDate:!1}}finally{await x(a).catch(()=>{})}},"syncAdvisories"),rs=r((s,e)=>{if(s.length===0)return new Map;const t=e.dbPath??g(e.workspaceRoot),u=e.ecosystem??"npm";if(!k(t))throw new H(t);const y=s.map(o=>({ecosystem:u,name:o.name,version:o.version})),i=q(t,y),a=new Map;for(const[o,m]of s.entries()){const c=i[o];!c||c.vulnerabilities.length===0||a.set(m.name,c.vulnerabilities.map(h=>K(h)))}return a},"queryAdvisories"),os=r(async(s,e)=>{const t=e??g(s);return E(t)},"getAdvisoryStatus"),G=r(async(s,e)=>{try{await B(s)}catch{return null}return E(s).ecosystems.find(t=>t.name===e)?.manifestEtag??null},"readStoredEtag"),K=r(s=>({aliases:s.aliases.length>0?s.aliases:void 0,cvssScore:s.cvssScore??void 0,fixedVersions:s.fixedVersions,id:s.id,severity:Y(s.severity),summary:s.summary}),"toSecurityVulnerability"),Y=r(s=>{const e=s.toUpperCase();return e==="CRITICAL"||e==="HIGH"||e==="MODERATE"||e==="LOW"?e:"UNKNOWN"},"normalizeSeverity"),Q=r(s=>s.endsWith("/")?s:`${s}/`,"ensureTrailingSlash"),S=r(async(s,e)=>{try{return await fetch(s,e)}catch(t){throw new N(s.toString(),t instanceof Error?t.message:String(t))}},"safeFetch");export{H as A,es as D,os as g,rs as q,g as r,ts as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var de=Object.defineProperty;var w=(e,n)=>de(e,"name",{value:n,configurable:!0});import{createRequire as he}from"node:module";import{n as ie}from"../packem_chunks/config.js";import{M as B,$ as _e}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{r as be}from"./docker-
|
|
1
|
+
var de=Object.defineProperty;var w=(e,n)=>de(e,"name",{value:n,configurable:!0});import{createRequire as he}from"node:module";import{n as ie}from"../packem_chunks/config.js";import{M as B,$ as _e}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{r as be}from"./docker-BynKrOLe.js";import{e as $e}from"./license-zZU7aavK.js";import{F as Oe}from"./lockfile-BG1HvBzH.js";import{x as ke}from"./pm-runner-BwX5AL3W.js";const ge=he(import.meta.url),W=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ae=w(e=>{if(typeof W<"u"&&W.versions&&W.versions.node){const[n,t]=W.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return W.getBuiltinModule(e)}return ge(e)},"__cjs_getBuiltinModule"),{randomUUID:ye}=ae("node:crypto"),{readdirSync:ve}=ae("node:fs");var je=Object.defineProperty,pe=w((e,n)=>je(e,"name",{value:n,configurable:!0}),"r$1");const z=pe(e=>e.replaceAll(/[^\w.~-]/g,n=>`%${(n.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),"encodeSegment"),M=pe((e,n)=>{const t=e.toLowerCase();if(t.startsWith("@")){const o=t.indexOf("/");if(o>0){const r=t.slice(0,o),p=t.slice(o+1);return`pkg:npm/${z(r)}/${z(p)}@${z(n)}`}}return`pkg:npm/${z(t)}@${z(n)}`},"toNpmPurl");var Se=Object.defineProperty,j=w((e,n)=>Se(e,"name",{value:n,configurable:!0}),"a");const m={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},Te=[m.STRING,m.NUMBER,m.BOOLEAN],Ae='<?xml version="1.0" encoding="UTF-8"?>',se=["_selfCloseTag","_attrs"],xe=j((e="",n=0)=>e.repeat(n),"getIndentStr"),Q=j(e=>Array.isArray(e)&&m.ARRAY||typeof e===m.OBJECT&&e!==null&&e._name&&m.JSTOXML_OBJECT||e instanceof Date&&m.DATE||e===null&&m.NULL||typeof e,"getType"),le=j(e=>e.startsWith("<![CDATA["),"isCDATA"),ue=j((e="",n={},t)=>{let o=e;if(typeof e===m.STRING){if(le(e))return e;const r=new RegExp(`(${Object.keys(n).join("|")})(?!(\\w|#)*;)`,"g");o=String(e).replace(r,(p,g)=>n[g]||"")}return typeof t=="function"?t(o):o},"mapStr"),Ce=j((e={},n,t,o)=>(Array.isArray(e)?e:Object.entries(e).map(([r,p])=>({[r]:p}))).reduce((r,p)=>{const g=Object.keys(p)[0],y=p[g];if(typeof t===m.FUNCTION&&t(g,y))return r;const b=n?ue(y,n):y,$=!o&&b===!0?"":`="${b}"`;return r.push(`${g}${$}`),r},[]),"getAttributeKeyVals"),Ne=j((e={},n,t,o)=>{const r=Ce(e,n,t,o);return r.length===0?"":` ${r.join(" ")}`},"formatAttributes"),Re=j((e={})=>Object.keys(e).map(n=>({_name:n,_content:e[n]})),"objToArray"),we=j(e=>Te.includes(Q(e)),"isPrimitive"),Pe=j(e=>!e.match("<"),"isSimpleXML"),De=j(({header:e,isOutputStart:n})=>e&&n?typeof e===m.BOOLEAN?Ae:e:"","getHeaderString"),re={"<":"<",">":">","&":"&",'"':"""},J=j((e={},n={})=>{const{depth:t=0,indent:o,_isFirstItem:r,_isOutputStart:p=!0,header:g,attributeReplacements:y={},attributeFilter:b,attributeExplicitTrue:$=!1,contentReplacements:q={},contentMap:L,selfCloseTags:I=!0}=n,H=typeof y=="boolean"&&!y?{}:{...re,...y},Y=typeof q=="boolean"&&!q?{}:{...re,...q},P=typeof o=="string",T=xe(o,t),G=Q(e),U=De({header:g,indent:o,depth:t,isOutputStart:p}),D=p&&!U&&r&&t===0,E=P&&!D?`
|
|
2
2
|
`:"";let v="";switch(G){case m.JSTOXML_OBJECT:{const{_name:f,_content:l}=e;if(l===null&&typeof L!="function"){v=`${E}${T}${f}`;break}if(Array.isArray(l)&&l.every(we))return l.map(S=>J({_name:f,_content:S},{...n,depth:t,_isOutputStart:!1})).join("");if(se.includes(f))break;const _=J(l,{...n,depth:t+1,_isOutputStart:D}),N=Q(_),O=Pe(_),k=le(_),R=`${E}${T}`;if(f==="_comment"){v+=`${R}<!-- ${l} -->`;break}const K=N==="undefined"||_==="",c=I,s=e._selfCloseTag,i=typeof s===m.BOOLEAN?K&&s:K&&c,a=i?"/":"",u=Ne(e._attrs,H,b,$),d=`<${f}${u}${a}>`,A=P&&!O&&!k?`
|
|
3
3
|
${T}`:"",x=i?"":`${_}${A}</${f}>`;v+=`${R}${d}${x}`;break}case m.OBJECT:{const f=Object.keys(e);v=f.map((l,_)=>{const N={...n,_isFirstItem:_===0,_isLastItem:_+1===f.length,_isOutputStart:D},O={_name:l};if(Q(e[l])===m.OBJECT&&(se.forEach(k=>{const R=e[l][k];typeof R<"u"&&(O[k]=R,delete e[l][k])}),typeof e[l]._content<"u"&&Object.keys(e[l]).length>1)){const k=Object.assign({},e[l]);delete k._content,O._content=[...Re(k),e[l]._content]}return typeof O._content>"u"&&(O._content=e[l]),J(O,N)},n).join("");break}case m.FUNCTION:{const f=e(n);v=J(f,n);break}case m.ARRAY:{v=e.map((f,l)=>{const _={...n,_isFirstItem:l===0,_isLastItem:l+1===e.length,_isOutputStart:D};return J(f,_)}).join("");break}default:{v=ue(e,Y,L);break}}return`${U}${v}`},"toXML");var Ee=Object.defineProperty,X=w((e,n)=>Ee(e,"name",{value:n,configurable:!0}),"r");const te=X(e=>{try{return ie(e)}catch{return}},"readJsonSafe"),Me=X(e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const n=e.indexOf("/");return n>1&&!e.includes("/",n+1)}return!e.includes("/")},"isSafePackageName"),Be=X(e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),"isSafeVersion"),Le=X((e,n,t)=>{const o=`${n.replaceAll("/","+")}@${t}`,r=B(e,"node_modules",".pnpm"),p=te(B(r,o,"node_modules",n,"package.json"));if(p)return p;let g;try{g=ve(r)}catch{return}const y=`${o}_`;for(const b of g){if(!b.startsWith(y))continue;const $=te(B(r,b,"node_modules",n,"package.json"));if($)return $}},"readPnpmVirtualStore"),Ie=X((e,n,t)=>{const o=te(B(e,"node_modules",n,"package.json"));return o?.version===t?o:void 0},"readHoistedCopy"),Ue=X((e,n,t)=>{if(!(!Me(n)||!Be(t)))return Le(e,n,t)??Ie(e,n,t)},"readInstalledPackageMetadata");var Fe=Object.defineProperty,me=w((e,n)=>Fe(e,"name",{value:n,configurable:!0}),"t");const Je={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Xe={sha256:64,sha384:96,sha512:128},qe=me(e=>{const n={name:e.name,version:e.version},{integrity:t}=e;return t&&t.hex.length===Xe[t.algorithm]&&(n.hash={alg:Je[t.algorithm],content:t.hex}),e.dependencies&&(n.dependencies=e.dependencies),e.peerDependencies&&(n.peerDependencies=e.peerDependencies),e.optionalDependencies&&(n.optionalDependencies=e.optionalDependencies),n},"toResolvedPackage"),He=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Ve=me(e=>{for(const{file:n,type:t}of He){let o;try{o=_e(B(e,n))}catch{continue}const r=new Map;for(const p of Oe(o,t))r.set(`${p.name}@${p.version}`,qe(p));return{packages:r,type:t}}},"readLockfilePackages");var We=Object.defineProperty,fe=w((e,n)=>We(e,"name",{value:n,configurable:!0}),"s");const ze=fe(e=>{const n=e.indexOf(":");return n<=0?e:e.slice(0,n)==="npm"?e.slice(n+1):e},"stripProtocolPrefix"),ee=fe((e,n,t)=>{const o=t.get(e);if(!o||o.size===0)return;if(o.has(n))return n;const r=ze(n);if(r!==n&&o.has(r))return r;const p=[...o];return ke.maxSatisfying(p,r,{includePrerelease:!0})||p[0]},"resolveSpecifier");var Ye=Object.defineProperty,h=w((e,n)=>Ye(e,"name",{value:n,configurable:!0}),"p");const Ge="1.7",Ke="CycloneDX",Qe="http://cyclonedx.org/schema/bom-1.7.schema.json",Ze="@visulima/vis",ce=h(e=>{try{return ie(e)}catch{return}},"readPackageJson"),en=h(e=>{if(e){if(typeof e=="string")return e;if(typeof e=="object"&&e.name)return e.email?`${e.name} <${e.email}>`:e.name}},"toAuthorString"),nn=h(e=>{if(e)return typeof e=="string"?e:e.url},"toRepositoryUrl"),tn=h(e=>{if(e)return typeof e=="string"?e:e.url},"toBugsUrl"),on=h(e=>{const n=[];e.homepage&&n.push({type:"website",url:e.homepage});const t=nn(e.repository);t&&n.push({type:"vcs",url:t});const o=tn(e.bugs);return o&&n.push({type:"issue-tracker",url:o}),n.length>0?n:void 0},"buildExternalReferences"),sn=h(e=>e==="application"||e==="service"||e==="tool"?"application":"library","toCycloneDxComponentType"),ne=h((e,n)=>{if(!n)return;n.description&&(e.description=n.description);const t=en(n.author);t&&(e.author=t);const o=$e(n);o&&(e.licenses=o);const r=on(n);r&&(e.externalReferences=r)},"decoratePackageComponent"),yn=h(e=>{const{focus:n,generatorVersion:t,includeDev:o=!1,now:r=new Date,projectGraph:p,serialNumber:g,workspace:y,workspaceRoot:b}=e,$=n&&n.length>0?[...be(n,p)].sort():Object.keys(y.projects).sort(),q=new Set($),L=new Map;for(const c of $){const s=y.projects[c];s&&L.set(c,ce(B(b,s.root,"package.json")))}const I=[],H=new Map;for(const c of $){const s=y.projects[c];if(!s)continue;const i=L.get(c),a=i?.version??"0.0.0",u=M(c,a);H.set(c,u);const d={"bom-ref":u,name:c,purl:u,type:sn(s.projectType),version:a};ne(d,i),I.push(d)}const Y=Ve(b),P=new Map,T=new Map;if(Y)for(const c of Y.packages.values()){P.set(`${c.name}@${c.version}`,c);let s=T.get(c.name);s||(s=new Set,T.set(c.name,s)),s.add(c.version)}const G=[],U=[],D=new Map;for(const c of $){const s=L.get(c);if(!s)continue;const i=[s.dependencies,s.peerDependencies];o&&i.push(s.devDependencies);const a=new Set,u=h((d,A)=>{if(A)for(const[x,S]of Object.entries(A)){if(q.has(x)){const F=H.get(x);F&&a.add(F);continue}const C=ee(x,S,T);C&&(a.add(M(x,C)),d.push(`${x}@${C}`))}},"seedRef");for(const d of i)u(G,d);u(U,s.optionalDependencies),D.set(c,a)}const E=new Map,v=new Map,f=h((c,s)=>{const i=[...c];for(;i.length>0;){const a=i.pop(),u=E.get(a);if(u==="required"||u==="optional"&&s==="optional")continue;E.set(a,s);const d=P.get(a);if(!d)continue;const A=v.get(a)??new Set,x=[d.dependencies,d.peerDependencies];for(const S of x)if(S)for(const[C,F]of Object.entries(S))for(const V of F){const Z=ee(C,V,T);Z&&(A.add(M(C,Z)),i.push(`${C}@${Z}`))}if(d.optionalDependencies)for(const[S,C]of Object.entries(d.optionalDependencies))for(const F of C){const V=ee(S,F,T);V&&(A.add(M(S,V)),U.push(`${S}@${V}`))}A.size>0&&v.set(a,A)}},"walk");f(G,"required"),f(U,"optional");const l=[],_=[...E.keys()].sort();for(const c of _){const s=P.get(c);if(!s)continue;const i=M(s.name,s.version),a={"bom-ref":i,name:s.name,purl:i,scope:E.get(c)??"required",type:"library",version:s.version};s.hash&&(a.hashes=[s.hash]),ne(a,Ue(b,s.name,s.version)),l.push(a)}const N=[];for(const[c,s]of D){const i=H.get(c);if(!i)continue;const a=[...s].sort();N.push(a.length>0?{dependsOn:a,ref:i}:{ref:i})}for(const c of _){const s=P.get(c);if(!s)continue;const i=M(s.name,s.version),a=v.get(c),u=a?[...a].sort():[];N.push(u.length>0?{dependsOn:u,ref:i}:{ref:i})}N.sort((c,s)=>c.ref.localeCompare(s.ref));const O=ce(B(b,"package.json")),k=(()=>{if(n?.length===1){const u=I.find(d=>d.name===n[0]);if(u)return{"bom-ref":u["bom-ref"],name:u.name,purl:u.purl,type:u.type,version:u.version}}const c=O?.name??"workspace",s=O?.version??"0.0.0",i=M(c,s),a={"bom-ref":i,name:c,purl:i,type:"application",version:s};return ne(a,O),a})(),R=k["bom-ref"],K=R?I.filter(c=>c["bom-ref"]!==R):I;return{$schema:Qe,bomFormat:Ke,components:[...K,...l],dependencies:N,metadata:{component:k,lifecycles:[{phase:"build"}],timestamp:r.toISOString(),tools:{components:[{name:Ze,type:"application",...t?{version:t}:{}}]}},serialNumber:g??`urn:uuid:${ye()}`,specVersion:Ge,version:1}},"buildCycloneDxBom"),_n=h(e=>{const n={version:e.version??1,xmlns:"http://cyclonedx.org/schema/bom/1.7"};e.serialNumber&&(n.serialNumber=e.serialNumber);const t=[];return e.metadata&&t.push(rn(e.metadata)),e.components&&e.components.length>0&&t.push({_content:e.components.map(o=>oe(o)),_name:"components"}),e.dependencies&&e.dependencies.length>0&&t.push({_content:e.dependencies.map(o=>an(o)),_name:"dependencies"}),`${J({_attrs:n,_content:t,_name:"bom"},{header:!0,indent:" ",selfCloseTags:!0})}
|
|
4
4
|
`},"serializeBomToXml"),rn=h(e=>{const n=[];return e.timestamp&&n.push({timestamp:e.timestamp}),e.lifecycles&&e.lifecycles.length>0&&n.push({_content:e.lifecycles.map(t=>{const o=[];return t.phase&&o.push({phase:t.phase}),t.name&&o.push({name:t.name}),t.description&&o.push({description:t.description}),{_content:o,_name:"lifecycle"}}),_name:"lifecycles"}),e.tools?.components&&n.push({_content:[{_content:e.tools.components.map(t=>oe(t)),_name:"components"}],_name:"tools"}),e.component&&n.push(oe(e.component)),{_content:n,_name:"metadata"}},"metadataToXmlElement"),oe=h(e=>{const n={type:e.type};e["bom-ref"]&&(n["bom-ref"]=e["bom-ref"]);const t=[];e.group&&t.push({group:e.group}),t.push({name:e.name}),e.version&&t.push({version:e.version}),e.description&&t.push({description:e.description}),e.author&&t.push({author:e.author}),e.hashes&&e.hashes.length>0&&t.push({_content:e.hashes.map(r=>({_attrs:{alg:r.alg},_content:r.content,_name:"hash"})),_name:"hashes"});const o=cn(e.licenses);return o&&t.push(o),e.purl&&t.push({purl:e.purl}),e.scope&&t.push({scope:e.scope}),e.externalReferences&&e.externalReferences.length>0&&t.push({_content:e.externalReferences.map(r=>({_attrs:{type:r.type},_content:[{url:r.url}],_name:"reference"})),_name:"externalReferences"}),{_attrs:n,_content:t,_name:"component"}},"componentToXmlElement"),cn=h(e=>{if(!e||e.length===0)return;const n=[];for(const t of e){if("expression"in t){n.push({expression:t.expression});continue}const o=[];"id"in t.license&&t.license.id?o.push({id:t.license.id}):"name"in t.license&&t.license.name&&o.push({name:t.license.name}),n.push({_content:o,_name:"license"})}return{_content:n,_name:"licenses"}},"licensesToXmlElement"),an=h(e=>e.dependsOn&&e.dependsOn.length>0?{_attrs:{ref:e.ref},_content:e.dependsOn.map(n=>({_attrs:{ref:n},_name:"dependency"})),_name:"dependency"}:{_attrs:{ref:e.ref},_name:"dependency"},"dependencyToXmlElement");export{yn as b,_n as s,M as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var pa=Object.defineProperty;var c=(h,n)=>pa(h,"name",{value:n,configurable:!0});import{createRequire as da}from"node:module";import{b as va,n as Do,
|
|
1
|
+
var pa=Object.defineProperty;var c=(h,n)=>pa(h,"name",{value:n,configurable:!0});import{createRequire as da}from"node:module";import{b as va,n as Do,d as Ji}from"../packem_chunks/config.js";import{K as ci,M as Be,i as Aa,z as ba}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{bh as Ca,bi as $a}from"../packem_chunks/bin.js";import"./index-efSniSRN.js";const ha=da(import.meta.url),vr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ga=c(h=>{if(typeof vr<"u"&&vr.versions&&vr.versions.node){const[n,m]=vr.versions.node.split(".").map(Number);if(n>22||n===22&&m>=3||n===20&&m>=16)return vr.getBuiltinModule(h)}return ha(h)},"__cjs_getBuiltinModule"),{cpSync:No,lstatSync:ma,readdirSync:ya,existsSync:Mo,rmSync:si,readFileSync:Vi}=ga("node:fs");var Sa=Object.defineProperty,Ea=c((h,n)=>Sa(h,"name",{value:n,configurable:!0}),"t");class ft extends Error{static{c(this,"LockfilePruneError")}static{Ea(this,"LockfilePruneError")}constructor(n){super(n),this.name="LockfilePruneError"}}var wa=Object.defineProperty,Bt=c((h,n)=>wa(h,"name",{value:n,configurable:!0}),"p$2");const qo=Bt(h=>{let n=h.startsWith("/")?h.slice(1):h;const m=n.indexOf("(");return m!==-1&&(n=n.slice(0,m)),n},"canonicalKey"),ka=Bt((h,n)=>{if(!(n.startsWith("link:")||n.startsWith("file:")||n.startsWith("workspace:")))return`${h}@${n}`},"resolveDepKey"),xa=Bt(h=>{const n=[];for(const m of[h.dependencies,h.devDependencies,h.optionalDependencies])if(m)for(const[v,$]of Object.entries(m))$?.version&&n.push({name:v,version:$.version});return n},"collectImporterDeps"),Ki=Bt(h=>{const n=[];for(const m of[h.dependencies,h.optionalDependencies])if(m)for(const[v,$]of Object.entries(m))typeof $=="string"&&n.push({name:v,version:$});return n},"collectPackageDeps"),Gi=Bt(h=>{const n=new Map;if(!h)return n;for(const m of Object.keys(h)){const v=qo(m),$=n.get(v);$?$.push(m):n.set(v,[m])}return n},"buildKeyIndex"),Yo=Bt(h=>{const n=h.displayName??"pnpm-lock.yaml",m=typeof h.lockfileContent=="string"?h.lockfileContent:h.lockfileContent.toString("utf8");let v;try{v=Ca(m)}catch(oe){throw new ft(`${n}: parse failed — ${oe.message}`)}const $=Bt(oe=>oe.packages?Object.keys(oe.packages).length:0,"packageCount");let a;for(const oe of v){const[T]=oe.errors;if(T)throw new ft(`${n}: parse failed — ${T.message}`);const ne=oe.toJS();if(!ne||typeof ne!="object")continue;const me=ne;(a===void 0||$(me)>$(a))&&(a=me)}if(a===void 0)throw new ft(`${n}: top-level value is not an object`);const g=a.importers??{},e=Gi(a.packages),C=Gi(a.snapshots),k=new Set(["."]);for(const oe of h.closure)k.add(oe.relativeRoot===""?".":oe.relativeRoot);const b={};for(const[oe,T]of Object.entries(g))k.has(oe)&&(b[oe]=T);const S=new Set,O=new Set,H=[];for(const oe of Object.values(b))for(const T of xa(oe))H.push(T);for(;H.length>0;){const{name:oe,version:T}=H.shift(),ne=ka(oe,T);if(!ne)continue;const me=qo(ne),U=C.get(me)??C.get(ne)??[];for(const be of U){if(O.has(be))continue;O.add(be);const ye=a.snapshots?.[be];if(ye)for(const je of Ki(ye))H.push(je)}const ue=e.get(me)??e.get(ne)??[];for(const be of ue){if(S.has(be))continue;S.add(be);const ye=a.packages?.[be];if(ye&&!a.snapshots)for(const je of Ki(ye))H.push(je)}}const A={lockfileVersion:a.lockfileVersion};for(const oe of["settings","overrides","patchedDependencies","catalogs"])a[oe]!==void 0&&(A[oe]=a[oe]);if(A.importers=b,a.packages){const oe={};for(const T of Object.keys(a.packages))S.has(T)&&(oe[T]=a.packages[T]);A.packages=oe}if(a.snapshots){const oe={};for(const T of Object.keys(a.snapshots))O.has(T)&&(oe[T]=a.snapshots[T]);A.snapshots=oe}const y=Object.keys(a.packages??{}).length,E=Object.keys(A.packages??{}).length,X=y-E,fe=Object.keys(g).length-Object.keys(b).length;return{content:$a(A,{lineWidth:0}),message:`${n}: kept ${E}/${y} packages and ${Object.keys(b).length} importers (dropped ${X} packages, ${fe} importers)`,status:"pruned"}},"prunePnpmLockfile");var Oa=Object.defineProperty,ja=c((h,n)=>Oa(h,"name",{value:n,configurable:!0}),"p$1");const _a=ja(h=>Yo({...h,displayName:h.displayName??"aube-lock.yaml"}),"pruneAubeLockfile");var Ta=Object.defineProperty,Sr=c((h,n)=>Ta(h,"name",{value:n,configurable:!0}),"p");const Ra=Sr(h=>{let n="",m=!1,v=!1,$=!1;for(let a=0;a<h.length;a+=1){const g=h[a],e=h[a+1];if(v){g===`
|
|
2
2
|
`&&(v=!1,n+=g);continue}if($){g==="*"&&e==="/"&&($=!1,a+=1);continue}if(m){if(g==="\\"){n+=g,e!==void 0&&(n+=e,a+=1);continue}g==='"'&&(m=!1),n+=g;continue}if(g==='"'){m=!0,n+=g;continue}if(g==="/"&&e==="/"){v=!0,a+=1;continue}if(g==="/"&&e==="*"){$=!0,a+=1;continue}n+=g}return n},"stripJsonComments"),La=Sr(h=>{const n=[];for(const m of[h.dependencies,h.devDependencies,h.optionalDependencies,h.peerDependencies])if(m)for(const[v,$]of Object.entries(m))typeof $=="string"&&n.push({name:v,spec:$});return n},"collectWorkspaceDeps"),Fa=Sr(h=>{for(const n of h)if(typeof n=="object"&&!Array.isArray(n))return n},"extractMetadata"),Pa=Sr(h=>{if(!h)return[];const n=[];for(const m of["dependencies","optionalDependencies","peerDependencies"]){const v=h[m];v!==null&&typeof v=="object"&&!Array.isArray(v)&&n.push(...Object.keys(v))}return n},"collectMetadataDeps"),Ia=Sr(h=>{if(Buffer.isBuffer(h.lockfileContent))return{message:"bun.lockb is binary; run `bun install --save-text-lockfile` to regenerate as bun.lock, then rerun `vis docker scaffold`.",status:"skipped"};const n=Ra(h.lockfileContent);let m;try{m=JSON.parse(n)}catch(y){throw new ft(`bun.lock: parse failed — ${y.message}`)}if(!m||typeof m!="object")throw new ft("bun.lock: top-level value is not an object");const v=m.workspaces??{},$=m.packages??{},a=new Set([""]);for(const y of h.closure)a.add(y.relativeRoot===""?"":y.relativeRoot);const g={},e=[];for(const[y,E]of Object.entries(v))a.has(y)&&(g[y]=E,e.push(...La(E)));const C=new Set;for(const{name:y}of e)C.add(y);const k=[...C];for(;k.length>0;){const y=k.shift();for(const E of Object.keys($)){if(E.split("/")[0]!==y&&E!==y)continue;const X=Fa($[E]);for(const fe of Pa(X))C.has(fe)||(C.add(fe),k.push(fe))}}const b={};for(const[y,E]of Object.entries($)){const X=y.split("/")[0];(C.has(X)||C.has(y))&&(b[y]=E)}const S={...m,packages:b,workspaces:g},O=Object.keys($).length,H=Object.keys(b).length,A=O-H;return{content:`${JSON.stringify(S,null,2)}
|
|
3
3
|
`,message:`bun.lock: kept ${H}/${O} packages (dropped ${A})`,status:"pruned"}},"pruneBunLockfile");var Na=Object.defineProperty,li=c((h,n)=>Na(h,"name",{value:n,configurable:!0}),"k");const _n="node_modules/",Ma=li((h,n,m)=>{let v=n;for(;;){const $=v===""?`${_n}${m}`:`${v}/${_n}${m}`;if(h[$]!==void 0)return $;if(v==="")return;const a=v.lastIndexOf(`/${_n.slice(0,-1)}/`);v=a===-1?"":v.slice(0,a)}},"resolveDep"),Da=li(h=>{const n=[];for(const m of[h.dependencies,h.devDependencies,h.optionalDependencies,h.peerDependencies])if(m)for(const v of Object.keys(m))n.push(v);return n},"collectDepNames"),qa=li(h=>{const n=h.displayName??"package-lock.json",m=typeof h.lockfileContent=="string"?h.lockfileContent:h.lockfileContent.toString("utf8");let v;try{v=JSON.parse(m)}catch(A){throw new ft(`${n}: parse failed — ${A.message}`)}if(!v||typeof v!="object")throw new ft(`${n}: top-level value is not an object`);const $=v.packages??{},a=new Set([""]);for(const A of h.closure)A.relativeRoot!==""&&a.add(A.relativeRoot);const g=new Set,e=[];for(const A of Object.keys($))a.has(A)&&(g.add(A),e.push(A));for(const[A,y]of Object.entries($))y.link===!0&&typeof y.resolved=="string"&&a.has(y.resolved)&&g.add(A);for(;e.length>0;){const A=e.shift(),y=$[A];if(y)for(const E of Da(y)){const X=Ma($,A,E);if(!X||g.has(X))continue;g.add(X);const fe=$[X];fe.link===!0&&typeof fe.resolved=="string"&&$[fe.resolved]!==void 0&&!g.has(fe.resolved)?(g.add(fe.resolved),e.push(fe.resolved)):e.push(X)}}const C={};for(const A of Object.keys($))g.has(A)&&(C[A]=$[A]);const k=C[""];k&&Array.isArray(k.workspaces)&&(k.workspaces=k.workspaces.filter(A=>{if(typeof A!="string")return!1;const y=A.replace(/\/?\*+$/,"").replace(/\/$/,"");if(y===""||y==="*")return!0;for(const E of a)if(E===A||E===y||E.startsWith(`${y}/`))return!0;return!1}));const b={...v,packages:C};delete b.dependencies;const S=Object.keys($).length,O=Object.keys(C).length,H=S-O;return{content:`${JSON.stringify(b,null,2)}
|
|
4
4
|
`,message:`${n}: kept ${O}/${S} entries (dropped ${H})`,status:"pruned"}},"pruneNpmLockfile");var Tn={},Fe={},Rn,Qi;function Ya(){if(Qi)return Rn;Qi=1;var h=Object.defineProperty,n=c((a,g)=>h(a,"name",{value:g,configurable:!0}),"a");function m(a,g){function e(){this.constructor=a}c(e,"s"),n(e,"ctor"),e.prototype=g.prototype,a.prototype=new e}c(m,"peg$subclass"),n(m,"peg$subclass");function v(a,g,e,C){this.message=a,this.expected=g,this.found=e,this.location=C,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,v)}c(v,"peg$SyntaxError"),n(v,"peg$SyntaxError"),m(v,Error),v.buildMessage=function(a,g){var e={literal:n(function(A){return'"'+k(A.text)+'"'},"literal"),class:n(function(A){var y="",E;for(E=0;E<A.parts.length;E++)y+=A.parts[E]instanceof Array?b(A.parts[E][0])+"-"+b(A.parts[E][1]):b(A.parts[E]);return"["+(A.inverted?"^":"")+y+"]"},"class"),any:n(function(A){return"any character"},"any"),end:n(function(A){return"end of input"},"end"),other:n(function(A){return A.description},"other")};function C(A){return A.charCodeAt(0).toString(16).toUpperCase()}c(C,"T"),n(C,"hex");function k(A){return A.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+C(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+C(y)})}c(k,"q"),n(k,"literalEscape");function b(A){return A.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+C(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+C(y)})}c(b,"_"),n(b,"classEscape");function S(A){return e[A.type](A)}c(S,"re"),n(S,"describeExpectation");function O(A){var y=new Array(A.length),E,X;for(E=0;E<A.length;E++)y[E]=S(A[E]);if(y.sort(),y.length>0){for(E=1,X=1;E<y.length;E++)y[E-1]!==y[E]&&(y[X]=y[E],X++);y.length=X}switch(y.length){case 1:return y[0];case 2:return y[0]+" or "+y[1];default:return y.slice(0,-1).join(", ")+", or "+y[y.length-1]}}c(O,"le"),n(O,"describeExpected");function H(A){return A?'"'+k(A)+'"':"end of input"}return c(H,"te"),n(H,"describeFound"),"Expected "+O(a)+" but "+H(g)+" found."};function $(a,g){g=g!==void 0?g:{};var e={},C={Start:pn},k=pn,b=n(function(t){return t||[]},"peg$c0"),S=n(function(t,o,u){return[{command:t,type:o}].concat(u||[])},"peg$c1"),O=n(function(t,o){return[{command:t,type:o||";"}]},"peg$c2"),H=n(function(t){return t},"peg$c3"),A=";",y=ce(";",!1),E="&",X=ce("&",!1),fe=n(function(t,o){return o?{chain:t,then:o}:{chain:t}},"peg$c8"),oe=n(function(t,o){return{type:t,line:o}},"peg$c9"),T="&&",ne=ce("&&",!1),me="||",U=ce("||",!1),ue=n(function(t,o){return o?{...t,then:o}:t},"peg$c14"),be=n(function(t,o){return{type:t,chain:o}},"peg$c15"),ye="|&",je=ce("|&",!1),Me="|",De=ce("|",!1),qe="=",rt=ce("=",!1),Ee=n(function(t,o){return{name:t,args:[o]}},"peg$c22"),He=n(function(t){return{name:t,args:[]}},"peg$c23"),Ge="(",Qe=ce("(",!1),re=")",Pe=ce(")",!1),We=n(function(t,o){return{type:"subshell",subshell:t,args:o}},"peg$c28"),ke="{",xe=ce("{",!1),$e="}",Le=ce("}",!1),Ae=n(function(t,o){return{type:"group",group:t,args:o}},"peg$c33"),Ye=n(function(t,o){return{type:"command",args:o,envs:t}},"peg$c34"),Ue=n(function(t){return{type:"envs",envs:t}},"peg$c35"),Ve=n(function(t){return t},"peg$c36"),Je=n(function(t){return t},"peg$c37"),q=/^[0-9]/,W=Ze([["0","9"]],!1,!1),se=n(function(t,o,u){return{type:"redirection",subtype:o,fd:t!==null?parseInt(t):null,args:[u]}},"peg$c40"),Ce=">>",nt=ce(">>",!1),at=">&",st=ce(">&",!1),At=">",Ke=ce(">",!1),pt="<<<",et=ce("<<<",!1),ze="<&",dt=ce("<&",!1),bt="<",ht=ce("<",!1),r=n(function(t){return{type:"argument",segments:[].concat(...t)}},"peg$c53"),_=n(function(t){return t},"peg$c54"),R="$'",z=ce("$'",!1),Y="'",l=ce("'",!1),w=n(function(t){return[{type:"text",text:t}]},"peg$c59"),L='""',F=ce('""',!1),D=n(function(){return{type:"text",text:""}},"peg$c62"),V='"',P=ce('"',!1),Z=n(function(t){return t},"peg$c65"),J=n(function(t){return{type:"arithmetic",arithmetic:t,quoted:!0}},"peg$c66"),ie=n(function(t){return{type:"shell",shell:t,quoted:!0}},"peg$c67"),ve=n(function(t){return{type:"variable",...t,quoted:!0}},"peg$c68"),pe=n(function(t){return{type:"text",text:t}},"peg$c69"),_e=n(function(t){return{type:"arithmetic",arithmetic:t,quoted:!1}},"peg$c70"),Qr=n(function(t){return{type:"shell",shell:t,quoted:!1}},"peg$c71"),zr=n(function(t){return{type:"variable",...t,quoted:!1}},"peg$c72"),wr=n(function(t){return{type:"glob",pattern:t}},"peg$c73"),Ut=/^[^']/,Wt=Ze(["'"],!0,!1),wt=n(function(t){return t.join("")},"peg$c76"),kr=/^[^$"]/,xr=Ze(["$",'"'],!0,!1),tr=`\\
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var D=Object.defineProperty;var v=(t,e)=>D(t,"name",{value:e,configurable:!0});import{m as w,D as C,g as S,f as A}from"./provenance-BsBn1f5S.js";import{L as m}from"../packem_chunks/bin.js";import{x as W}from"./build-scripts-3E2pmscY.js";import{n as b}from"./license-zZU7aavK.js";import{a as j,C as F,$ as U}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{F as E}from"./lockfile-BG1HvBzH.js";import{L as N}from"./dependency-scan-s2MD0vi-.js";var I=Object.defineProperty,L=v((t,e)=>I(t,"name",{value:e,configurable:!0}),"i");const g={CRITICAL:0,HIGH:1,LOW:3,MODERATE:2,UNKNOWN:4},we=L((t,e)=>{const i=g[(t.vulnerability.severity??"UNKNOWN").toUpperCase()]??4,n=g[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??4;return i-n||t.packageName.localeCompare(e.packageName)||t.packageVersion.localeCompare(e.packageVersion)},"compareFindingsForDisplay"),M=L((t,e)=>{const i=g[e.toUpperCase()]??2;return(g[t.toUpperCase()]??4)<=i},"severityPassesFilter"),P=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"];var V=Object.defineProperty,R=v((t,e)=>V(t,"name",{value:e,configurable:!0}),"r");const $=6e4,_=R((t,e,i)=>{for(const n of i)if(n===t||n===`${t}@${e}`||n.endsWith("*")&&t.startsWith(n.slice(0,-1)))return!0;return!1},"isExcluded"),T=R(async(t,e)=>{const i=e.security?.policies?.firstSeen;if(i?.minutes===void 0||i.minutes<=0)return[];const{minutes:n}=i,a=i.exclude??[],o=e.security?.acceptedRisks,c=n*$,s=Date.now();return(await w(t.packages,C,async r=>{if(_(r.name,r.version,a))return;const l=await S(r.name,{workspaceRoot:t.workspaceRoot});if(l===void 0)return;const p=l.time?.[r.version];if(p===void 0)return;const u=Date.parse(p);if(Number.isNaN(u))return;const f=s-u;if(f>=c)return;const k=Math.max(0,Math.floor(f/$));return{acceptedRisk:m(r.name,r.version,o,"firstSeen"),data:{ageMinutes:k,minimumMinutes:n,publishedAt:p},packageName:r.name,policy:"firstSeen",reason:`${r.name}@${r.version} was published ${String(k)} min ago — below the ${String(n)} min firstSeen cooldown.`,severity:"block",version:r.version}})).filter(r=>r!==void 0)},"evaluateFirstSeenPolicy");var K=Object.defineProperty,H=v((t,e)=>K(t,"name",{value:e,configurable:!0}),"n");const q=H((t,e)=>{const i=e.security?.policies?.installScripts;if(!i)return[];const n=i.allow??{},a=i.strict===!0;if(!a&&Object.keys(n).length===0)return[];const o=W(t.workspaceRoot,n,{pinVersions:e.security?.pinVersions===!0});if(o.unapproved.length===0)return[];const c=e.security?.acceptedRisks,s=a?"block":"warn";return o.unapproved.map(r=>({acceptedRisk:m(r.name,r.version??"*",c,"installScripts"),data:{hooks:r.hooks},packageName:r.name,policy:"installScripts",reason:`${r.name}${r.version?`@${r.version}`:""} declares unapproved build script(s): ${r.hooks.join(", ")}`,severity:s,version:r.version??"*"}))},"evaluateInstallScriptsPolicy");var z=Object.defineProperty,y=v((t,e)=>z(t,"name",{value:e,configurable:!0}),"a");const Y=new Set(["AND","OR"]),B=y(t=>{const e=t.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(a=>a.trim()).filter(a=>a.length>0),i=[];let n=!1;for(const a of e){const o=a.toUpperCase();if(n){n=!1;continue}if(o==="WITH"){n=!0;continue}if(Y.has(o))continue;const c=a.endsWith("+"),s=c?a.slice(0,-1):a,r=b(s)??s;i.push(r),c&&i.push(`${r}-or-later`)}return i},"extractSpdxLeaves"),G=y(t=>{if(typeof t.license=="string"){const e=t.license.trim();return e.length>0?e:void 0}if(t.license&&typeof t.license=="object"&&typeof t.license.type=="string"){const e=t.license.type.trim();if(e.length>0)return e}if(Array.isArray(t.licenses)&&t.licenses.length>0){const e=t.licenses.map(i=>i&&typeof i.type=="string"?i.type.trim():"").filter(i=>i.length>0);if(e.length>0)return e.length===1?e[0]:`(${e.join(" OR ")})`}},"declaredLicense"),J=y((t,e)=>{if(e.length===0)return;const i=new Set(e.map(n=>b(n)??n).map(n=>n.toLowerCase()));for(const n of t)if(i.has(n.toLowerCase()))return n},"findDeniedLeaf"),Q=y((t,e)=>{if(e.length===0)return;const i=new Set(e.map(n=>b(n)??n).map(n=>n.toLowerCase()));for(const n of t)if(!i.has(n.toLowerCase()))return n},"findUnallowedLeaf"),X=y((t,e)=>{const i=e.security?.policies?.license;if(!i)return[];const n=i.allow??[],a=i.deny??[];if(n.length===0&&a.length===0)return[];const o=e.security?.acceptedRisks,c=[];for(const s of t.packages){const r=t.manifestData?.get(`${s.name}@${s.version}`),l=r?G(r):void 0;if(!l){n.length>0&&c.push({acceptedRisk:m(s.name,s.version,o,"license"),data:{declaredLicense:null},packageName:s.name,policy:"license",reason:`${s.name}@${s.version} declares no license; allow-list mode requires one of: ${n.join(", ")}`,severity:"block",version:s.version});continue}const p=B(l),u=J(p,a);if(u){c.push({acceptedRisk:m(s.name,s.version,o,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:s.name,policy:"license",reason:`${s.name}@${s.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:s.version});continue}const f=Q(p,n);f&&c.push({acceptedRisk:m(s.name,s.version,o,"license"),data:{allowList:n,declaredLicense:l,unallowedLicense:f},packageName:s.name,policy:"license",reason:`${s.name}@${s.version} uses license '${f}' which is not on the allow-list (declared: ${l})`,severity:"block",version:s.version})}return c},"evaluateLicensePolicy");var Z=Object.defineProperty,O=v((t,e)=>Z(t,"name",{value:e,configurable:!0}),"c$1");const ee=6e4,te=O((t,e,i)=>{for(const n of i)if(n===t||n===`${t}@${e}`||n.endsWith("*")&&t.startsWith(n.slice(0,-1)))return!0;return!1},"isExcluded"),ie=O(async(t,e)=>{const i=e.security?.policies?.publisherChange;if(i?.mode!=="no-downgrade")return[];const n=i.exclude??[],a=typeof i.ignoreAfter=="number"?i.ignoreAfter*ee:void 0,o=e.security?.acceptedRisks,c=Date.now();return(await w(t.packages,C,async s=>{if(te(s.name,s.version,n))return;const r=await S(s.name,{workspaceRoot:t.workspaceRoot});if(r===void 0)return;if(a!==void 0){const p=r.time?.[s.version],u=p===void 0?Number.NaN:Date.parse(p);if(!Number.isNaN(u)&&c-u>a)return}if(r.versions[s.version]?.dist?.attestations?.provenance!==void 0)return;const l=A(r,s.version);if(l!==void 0)return{acceptedRisk:m(s.name,s.version,o,"publisherChange"),data:{priorVersionWithProvenance:l},packageName:s.name,policy:"publisherChange",reason:`${s.name}@${s.version} dropped the provenance attestation that ${s.name}@${l} carried — publisher trust downgrade.`,severity:"block",version:s.version}})).filter(s=>s!==void 0)},"evaluatePublisherChangePolicy");var ne=Object.defineProperty,h=v((t,e)=>ne(t,"name",{value:e,configurable:!0}),"l$1");const se=h(t=>{for(const e of Object.values(N))for(const i of[e.file,...e.aliases??[]])if(t===i||t.endsWith(`/${i}`)||t.endsWith(`.${i}`))return e.type},"detectLockfileType"),re=h((t,e,i)=>{const n=j(e)?e:F(t,e);let a;try{a=U(n)}catch{return}const o=se(n)??N[i]?.type;if(!o)return;const c=E(a,o);if(c.length===0)return;const s=new Set;for(const r of c)s.add(`${r.name}@${r.version}`);return s},"loadBaselineKeys"),oe=h((t,e)=>{for(const i of e)if(i===t||i.endsWith("*")&&t.startsWith(i.slice(0,-1)))return!0;return!1},"matchesAllowList"),ae=h((t,e)=>{const i=e.security?.policies?.unexpectedDeps;if(!i)return[];const n=i.allow??[],a=i.baselineLockfile;if(n.length===0&&!a)return[];const o=a?re(t.workspaceRoot,a,t.packageManager):void 0,c=e.security?.acceptedRisks,s=[];for(const r of t.packages){const l=n.length===0||oe(r.name,n),p=o?o.has(`${r.name}@${r.version}`):!0;if(l&&p)continue;const u=[],f={};l||(u.push(`not on allow-list (${n.length} entr${n.length===1?"y":"ies"})`),f.allowList=n),!p&&o&&(u.push(`not present in baseline lockfile (${a})`),f.baselineLockfile=a),s.push({acceptedRisk:m(r.name,r.version,c,"unexpectedDeps"),data:f,packageName:r.name,policy:"unexpectedDeps",reason:`${r.name}@${r.version} is unexpected: ${u.join("; ")}`,severity:"block",version:r.version})}return s},"evaluateUnexpectedDepsPolicy");var ce=Object.defineProperty,le=v((t,e)=>ce(t,"name",{value:e,configurable:!0}),"c");const ue=le((t,e)=>{if(!t.osvFindings||t.osvFindings.size===0)return[];const i=e.security?.policies?.vulnerability?.failOn,n=e.security?.acceptedRisks,a=[];for(const o of t.packages){const c=t.osvFindings.get(o.name);if(!(!c||c.length===0))for(const s of c){const r=i?M(s.severity,i)?"block":"warn":"info";a.push({acceptedRisk:m(o.name,o.version,n,"vulnerability"),data:{advisoryId:s.id,aliases:s.aliases??[],cvssScore:s.cvssScore,fixedVersions:s.fixedVersions,severity:s.severity,summary:s.summary},packageName:o.name,policy:"vulnerability",reason:`${s.severity} ${s.id} affects ${o.name}@${o.version}: ${s.summary}`,severity:r,version:o.version})}}return a},"evaluateVulnerabilityPolicy");var pe=Object.defineProperty,d=v((t,e)=>pe(t,"name",{value:e,configurable:!0}),"t");const x=[{evaluate:ue,isConfigured:d(t=>t.security?.policies?.vulnerability!==void 0,"isConfigured"),name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:X,isConfigured:d(t=>{const e=t.security?.policies?.license;return!!(e&&(e.allow&&e.allow.length>0||e.deny&&e.deny.length>0))},"isConfigured"),name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:q,isConfigured:d(t=>{const e=t.security?.policies?.installScripts;return!!(e&&(e.allow&&Object.keys(e.allow).length>0||e.strict===!0))},"isConfigured"),name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:ae,isConfigured:d(t=>{const e=t.security?.policies?.unexpectedDeps;return!!(e&&(e.allow&&e.allow.length>0||typeof e.baselineLockfile=="string"))},"isConfigured"),name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:T,isConfigured:d(t=>{const e=t.security?.policies?.firstSeen?.minutes;return typeof e=="number"&&e>0},"isConfigured"),name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:ie,isConfigured:d(t=>t.security?.policies?.publisherChange?.mode==="no-downgrade","isConfigured"),name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],fe=d((t,e,i)=>x.filter(n=>n.surfaces.includes(t)?i!==void 0?i.has(n.name):n.isConfigured(e):!1),"selectModules"),Ce=d(async(t,e,i)=>{const n=fe(e,i.visConfig,i.enabledPolicies),a=[];for(const o of n){if(t.offline&&!o.offlineSupported){a.push({packageName:"*",policy:o.name,reason:`policy.${o.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const c=await o.evaluate(t,i.visConfig);a.push(...c)}catch(c){const s=c instanceof Error?c.message:String(c);a.push({packageName:"*",policy:o.name,reason:`policy.${o.name} failed: ${s}`,severity:"info",version:"*"})}}return a},"evaluatePolicies"),de=(()=>{const t=new Map;for(const e of P)t.set(e.toLowerCase(),e);return t})(),Se=d(()=>x.map(t=>t.name),"getRegisteredPolicyNames"),Ne=d((t,e)=>{if(t===void 0)return;const i=t.trim().toLowerCase();if(i===""||i==="none")return new Set;if(i==="all")return new Set(P);const n=new Set;for(const a of t.split(",").map(o=>o.trim()).filter(o=>o.length>0)){const o=a.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(s,r)=>r.toUpperCase()),c=de.get(o.toLowerCase());c===void 0?e?.(a):n.add(c)}return n},"parsePoliciesFlag");export{we as c,Ce as e,Se as g,Ne as p,M as s};
|
|
1
|
+
var D=Object.defineProperty;var v=(t,e)=>D(t,"name",{value:e,configurable:!0});import{m as w,D as C,g as S,f as A}from"./provenance-BuiEsWbI.js";import{L as m}from"../packem_chunks/bin.js";import{x as W}from"./build-scripts-3E2pmscY.js";import{n as b}from"./license-zZU7aavK.js";import{a as j,C as F,$ as U}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{F as E}from"./lockfile-BG1HvBzH.js";import{L as N}from"./dependency-scan-s2MD0vi-.js";var I=Object.defineProperty,L=v((t,e)=>I(t,"name",{value:e,configurable:!0}),"i");const g={CRITICAL:0,HIGH:1,LOW:3,MODERATE:2,UNKNOWN:4},we=L((t,e)=>{const i=g[(t.vulnerability.severity??"UNKNOWN").toUpperCase()]??4,n=g[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??4;return i-n||t.packageName.localeCompare(e.packageName)||t.packageVersion.localeCompare(e.packageVersion)},"compareFindingsForDisplay"),M=L((t,e)=>{const i=g[e.toUpperCase()]??2;return(g[t.toUpperCase()]??4)<=i},"severityPassesFilter"),P=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"];var V=Object.defineProperty,R=v((t,e)=>V(t,"name",{value:e,configurable:!0}),"r");const $=6e4,_=R((t,e,i)=>{for(const n of i)if(n===t||n===`${t}@${e}`||n.endsWith("*")&&t.startsWith(n.slice(0,-1)))return!0;return!1},"isExcluded"),T=R(async(t,e)=>{const i=e.security?.policies?.firstSeen;if(i?.minutes===void 0||i.minutes<=0)return[];const{minutes:n}=i,a=i.exclude??[],o=e.security?.acceptedRisks,c=n*$,s=Date.now();return(await w(t.packages,C,async r=>{if(_(r.name,r.version,a))return;const l=await S(r.name,{workspaceRoot:t.workspaceRoot});if(l===void 0)return;const p=l.time?.[r.version];if(p===void 0)return;const u=Date.parse(p);if(Number.isNaN(u))return;const f=s-u;if(f>=c)return;const k=Math.max(0,Math.floor(f/$));return{acceptedRisk:m(r.name,r.version,o,"firstSeen"),data:{ageMinutes:k,minimumMinutes:n,publishedAt:p},packageName:r.name,policy:"firstSeen",reason:`${r.name}@${r.version} was published ${String(k)} min ago — below the ${String(n)} min firstSeen cooldown.`,severity:"block",version:r.version}})).filter(r=>r!==void 0)},"evaluateFirstSeenPolicy");var K=Object.defineProperty,H=v((t,e)=>K(t,"name",{value:e,configurable:!0}),"n");const q=H((t,e)=>{const i=e.security?.policies?.installScripts;if(!i)return[];const n=i.allow??{},a=i.strict===!0;if(!a&&Object.keys(n).length===0)return[];const o=W(t.workspaceRoot,n,{pinVersions:e.security?.pinVersions===!0});if(o.unapproved.length===0)return[];const c=e.security?.acceptedRisks,s=a?"block":"warn";return o.unapproved.map(r=>({acceptedRisk:m(r.name,r.version??"*",c,"installScripts"),data:{hooks:r.hooks},packageName:r.name,policy:"installScripts",reason:`${r.name}${r.version?`@${r.version}`:""} declares unapproved build script(s): ${r.hooks.join(", ")}`,severity:s,version:r.version??"*"}))},"evaluateInstallScriptsPolicy");var z=Object.defineProperty,y=v((t,e)=>z(t,"name",{value:e,configurable:!0}),"a");const Y=new Set(["AND","OR"]),B=y(t=>{const e=t.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(a=>a.trim()).filter(a=>a.length>0),i=[];let n=!1;for(const a of e){const o=a.toUpperCase();if(n){n=!1;continue}if(o==="WITH"){n=!0;continue}if(Y.has(o))continue;const c=a.endsWith("+"),s=c?a.slice(0,-1):a,r=b(s)??s;i.push(r),c&&i.push(`${r}-or-later`)}return i},"extractSpdxLeaves"),G=y(t=>{if(typeof t.license=="string"){const e=t.license.trim();return e.length>0?e:void 0}if(t.license&&typeof t.license=="object"&&typeof t.license.type=="string"){const e=t.license.type.trim();if(e.length>0)return e}if(Array.isArray(t.licenses)&&t.licenses.length>0){const e=t.licenses.map(i=>i&&typeof i.type=="string"?i.type.trim():"").filter(i=>i.length>0);if(e.length>0)return e.length===1?e[0]:`(${e.join(" OR ")})`}},"declaredLicense"),J=y((t,e)=>{if(e.length===0)return;const i=new Set(e.map(n=>b(n)??n).map(n=>n.toLowerCase()));for(const n of t)if(i.has(n.toLowerCase()))return n},"findDeniedLeaf"),Q=y((t,e)=>{if(e.length===0)return;const i=new Set(e.map(n=>b(n)??n).map(n=>n.toLowerCase()));for(const n of t)if(!i.has(n.toLowerCase()))return n},"findUnallowedLeaf"),X=y((t,e)=>{const i=e.security?.policies?.license;if(!i)return[];const n=i.allow??[],a=i.deny??[];if(n.length===0&&a.length===0)return[];const o=e.security?.acceptedRisks,c=[];for(const s of t.packages){const r=t.manifestData?.get(`${s.name}@${s.version}`),l=r?G(r):void 0;if(!l){n.length>0&&c.push({acceptedRisk:m(s.name,s.version,o,"license"),data:{declaredLicense:null},packageName:s.name,policy:"license",reason:`${s.name}@${s.version} declares no license; allow-list mode requires one of: ${n.join(", ")}`,severity:"block",version:s.version});continue}const p=B(l),u=J(p,a);if(u){c.push({acceptedRisk:m(s.name,s.version,o,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:s.name,policy:"license",reason:`${s.name}@${s.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:s.version});continue}const f=Q(p,n);f&&c.push({acceptedRisk:m(s.name,s.version,o,"license"),data:{allowList:n,declaredLicense:l,unallowedLicense:f},packageName:s.name,policy:"license",reason:`${s.name}@${s.version} uses license '${f}' which is not on the allow-list (declared: ${l})`,severity:"block",version:s.version})}return c},"evaluateLicensePolicy");var Z=Object.defineProperty,O=v((t,e)=>Z(t,"name",{value:e,configurable:!0}),"c$1");const ee=6e4,te=O((t,e,i)=>{for(const n of i)if(n===t||n===`${t}@${e}`||n.endsWith("*")&&t.startsWith(n.slice(0,-1)))return!0;return!1},"isExcluded"),ie=O(async(t,e)=>{const i=e.security?.policies?.publisherChange;if(i?.mode!=="no-downgrade")return[];const n=i.exclude??[],a=typeof i.ignoreAfter=="number"?i.ignoreAfter*ee:void 0,o=e.security?.acceptedRisks,c=Date.now();return(await w(t.packages,C,async s=>{if(te(s.name,s.version,n))return;const r=await S(s.name,{workspaceRoot:t.workspaceRoot});if(r===void 0)return;if(a!==void 0){const p=r.time?.[s.version],u=p===void 0?Number.NaN:Date.parse(p);if(!Number.isNaN(u)&&c-u>a)return}if(r.versions[s.version]?.dist?.attestations?.provenance!==void 0)return;const l=A(r,s.version);if(l!==void 0)return{acceptedRisk:m(s.name,s.version,o,"publisherChange"),data:{priorVersionWithProvenance:l},packageName:s.name,policy:"publisherChange",reason:`${s.name}@${s.version} dropped the provenance attestation that ${s.name}@${l} carried — publisher trust downgrade.`,severity:"block",version:s.version}})).filter(s=>s!==void 0)},"evaluatePublisherChangePolicy");var ne=Object.defineProperty,h=v((t,e)=>ne(t,"name",{value:e,configurable:!0}),"l$1");const se=h(t=>{for(const e of Object.values(N))for(const i of[e.file,...e.aliases??[]])if(t===i||t.endsWith(`/${i}`)||t.endsWith(`.${i}`))return e.type},"detectLockfileType"),re=h((t,e,i)=>{const n=j(e)?e:F(t,e);let a;try{a=U(n)}catch{return}const o=se(n)??N[i]?.type;if(!o)return;const c=E(a,o);if(c.length===0)return;const s=new Set;for(const r of c)s.add(`${r.name}@${r.version}`);return s},"loadBaselineKeys"),oe=h((t,e)=>{for(const i of e)if(i===t||i.endsWith("*")&&t.startsWith(i.slice(0,-1)))return!0;return!1},"matchesAllowList"),ae=h((t,e)=>{const i=e.security?.policies?.unexpectedDeps;if(!i)return[];const n=i.allow??[],a=i.baselineLockfile;if(n.length===0&&!a)return[];const o=a?re(t.workspaceRoot,a,t.packageManager):void 0,c=e.security?.acceptedRisks,s=[];for(const r of t.packages){const l=n.length===0||oe(r.name,n),p=o?o.has(`${r.name}@${r.version}`):!0;if(l&&p)continue;const u=[],f={};l||(u.push(`not on allow-list (${n.length} entr${n.length===1?"y":"ies"})`),f.allowList=n),!p&&o&&(u.push(`not present in baseline lockfile (${a})`),f.baselineLockfile=a),s.push({acceptedRisk:m(r.name,r.version,c,"unexpectedDeps"),data:f,packageName:r.name,policy:"unexpectedDeps",reason:`${r.name}@${r.version} is unexpected: ${u.join("; ")}`,severity:"block",version:r.version})}return s},"evaluateUnexpectedDepsPolicy");var ce=Object.defineProperty,le=v((t,e)=>ce(t,"name",{value:e,configurable:!0}),"c");const ue=le((t,e)=>{if(!t.osvFindings||t.osvFindings.size===0)return[];const i=e.security?.policies?.vulnerability?.failOn,n=e.security?.acceptedRisks,a=[];for(const o of t.packages){const c=t.osvFindings.get(o.name);if(!(!c||c.length===0))for(const s of c){const r=i?M(s.severity,i)?"block":"warn":"info";a.push({acceptedRisk:m(o.name,o.version,n,"vulnerability"),data:{advisoryId:s.id,aliases:s.aliases??[],cvssScore:s.cvssScore,fixedVersions:s.fixedVersions,severity:s.severity,summary:s.summary},packageName:o.name,policy:"vulnerability",reason:`${s.severity} ${s.id} affects ${o.name}@${o.version}: ${s.summary}`,severity:r,version:o.version})}}return a},"evaluateVulnerabilityPolicy");var pe=Object.defineProperty,d=v((t,e)=>pe(t,"name",{value:e,configurable:!0}),"t");const x=[{evaluate:ue,isConfigured:d(t=>t.security?.policies?.vulnerability!==void 0,"isConfigured"),name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:X,isConfigured:d(t=>{const e=t.security?.policies?.license;return!!(e&&(e.allow&&e.allow.length>0||e.deny&&e.deny.length>0))},"isConfigured"),name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:q,isConfigured:d(t=>{const e=t.security?.policies?.installScripts;return!!(e&&(e.allow&&Object.keys(e.allow).length>0||e.strict===!0))},"isConfigured"),name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:ae,isConfigured:d(t=>{const e=t.security?.policies?.unexpectedDeps;return!!(e&&(e.allow&&e.allow.length>0||typeof e.baselineLockfile=="string"))},"isConfigured"),name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:T,isConfigured:d(t=>{const e=t.security?.policies?.firstSeen?.minutes;return typeof e=="number"&&e>0},"isConfigured"),name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:ie,isConfigured:d(t=>t.security?.policies?.publisherChange?.mode==="no-downgrade","isConfigured"),name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],fe=d((t,e,i)=>x.filter(n=>n.surfaces.includes(t)?i!==void 0?i.has(n.name):n.isConfigured(e):!1),"selectModules"),Ce=d(async(t,e,i)=>{const n=fe(e,i.visConfig,i.enabledPolicies),a=[];for(const o of n){if(t.offline&&!o.offlineSupported){a.push({packageName:"*",policy:o.name,reason:`policy.${o.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const c=await o.evaluate(t,i.visConfig);a.push(...c)}catch(c){const s=c instanceof Error?c.message:String(c);a.push({packageName:"*",policy:o.name,reason:`policy.${o.name} failed: ${s}`,severity:"info",version:"*"})}}return a},"evaluatePolicies"),de=(()=>{const t=new Map;for(const e of P)t.set(e.toLowerCase(),e);return t})(),Se=d(()=>x.map(t=>t.name),"getRegisteredPolicyNames"),Ne=d((t,e)=>{if(t===void 0)return;const i=t.trim().toLowerCase();if(i===""||i==="none")return new Set;if(i==="all")return new Set(P);const n=new Set;for(const a of t.split(",").map(o=>o.trim()).filter(o=>o.length>0)){const o=a.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(s,r)=>r.toUpperCase()),c=de.get(o.toLowerCase());c===void 0?e?.(a):n.add(c)}return n},"parsePoliciesFlag");export{we as c,Ce as e,Se as g,Ne as p,M as s};
|
|
@@ -26,4 +26,4 @@ ${s}`)}return`
|
|
|
26
26
|
${i}`},"getCause"),Nc=_((t,e)=>(t.length>0?`
|
|
27
27
|
`:"")+t.map(n=>et(n,e)).join(`
|
|
28
28
|
`),"getStacktrace"),Bn=_((t,e,n)=>{const i={cwd:Oc(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...e,color:{fileLine:_(l=>l,"fileLine"),gutter:_(l=>l,"gutter"),hint:_(l=>l,"hint"),marker:_(l=>l,"marker"),message:_(l=>l,"message"),method:_(l=>l,"method"),title:_(l=>l,"title"),...e.color}},r=Sn(t,{filter:e.filterStacktrace,frameLimit:i.framesMaxLimit}),o=r.shift();return[e.hideMessage?void 0:In(t,i,n),Mn(t,i,n),o?et(o,i,n):void 0,o&&!i.hideErrorCodeView?Vn(o,i,n):void 0,t instanceof AggregateError?Dn(t,i,n):void 0,t.cause===void 0?void 0:Un(t,i,n),r.length>0?Nc(r,i):void 0].filter(Boolean).join(`
|
|
29
|
-
`).replaceAll("\\","/")},"internalRenderError"),Cc=_((t,e={})=>{if(e.framesMaxLimit!==void 0&&e.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Bn(t,e,0)},"renderError");var jc=Object.defineProperty,kc=N((t,e)=>jc(t,"name",{value:e,configurable:!0}),"i$1"),_c=Object.defineProperty,Lc=kc((t,e)=>_c(t,"name",{value:e,configurable:!0}),"n"),Sc=Object.defineProperty,_t=Lc((t,e)=>Sc(t,"name",{value:e,configurable:!0}),"n");const Zc=_t((t={})=>({description:"Enhanced error handling and reporting with beautiful code frames",name:"error-handler",onError:_t((e,n)=>{const{logger:i,runtime:r}=n,{detailed:o=!1,exitOnError:l=!0,formatter:s,logErrors:p=!0,renderOptions:a={}}=t;if(p)if(s)i.error(s(e));else if(o){const c=r.getCwd(),d=Cc(e,{cwd:c,hideErrorCodeView:!1,hideErrorTitle:!1,hideMessage:!1,linesAbove:2,linesBelow:3,...a});i.error(d)}else i.error(e);l&&W(1)},"handleError"),version:"1.0.0"}),"errorHandlerPlugin");var Tc="1.0.0-alpha.
|
|
29
|
+
`).replaceAll("\\","/")},"internalRenderError"),Cc=_((t,e={})=>{if(e.framesMaxLimit!==void 0&&e.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Bn(t,e,0)},"renderError");var jc=Object.defineProperty,kc=N((t,e)=>jc(t,"name",{value:e,configurable:!0}),"i$1"),_c=Object.defineProperty,Lc=kc((t,e)=>_c(t,"name",{value:e,configurable:!0}),"n"),Sc=Object.defineProperty,_t=Lc((t,e)=>Sc(t,"name",{value:e,configurable:!0}),"n");const Zc=_t((t={})=>({description:"Enhanced error handling and reporting with beautiful code frames",name:"error-handler",onError:_t((e,n)=>{const{logger:i,runtime:r}=n,{detailed:o=!1,exitOnError:l=!0,formatter:s,logErrors:p=!0,renderOptions:a={}}=t;if(p)if(s)i.error(s(e));else if(o){const c=r.getCwd(),d=Cc(e,{cwd:c,hideErrorCodeView:!1,hideErrorTitle:!1,hideMessage:!1,linesAbove:2,linesBelow:3,...a});i.error(d)}else i.error(e);l&&W(1)},"handleError"),version:"1.0.0"}),"errorHandlerPlugin");var Tc="1.0.0-alpha.26";const Yc={version:Tc};var Ic=Object.defineProperty,Mc=N((t,e)=>Ic(t,"name",{value:e,configurable:!0}),"e");const Qc={argument:{description:"Package to execute (optionally with @version)",name:"package",type:String},description:"Execute a remote package without permanent installation",examples:[["vis dlx create-vite my-app","Scaffold a new project"],["vis dlx typescript@5.5.4 tsc --version","Run specific version"],["vis dlx -p cowsay -p lolcatjs -c 'echo hi | cowsay | lolcatjs'","Multiple packages with shell"],["vis install && vis dlx --offline typescript tsc --version","Hardened: pre-install + offline (no registry fetch on dlx)"]],group:"Run & Execute",loader:Mc(()=>import("../packem_chunks/handler9.js"),"loader"),name:"dlx",options:[{alias:"p",description:"Additional packages to install (repeatable)",multiple:!0,name:"package",type:String},{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output except command results",name:"silent",type:Boolean},{defaultValue:!1,description:"Resolve from local store only — fail rather than fetch from the registry. Pair with `vis install` for hardened npx-style workflows.",name:"offline",type:Boolean}]};export{Jc as N,Hc as T,Qc as a,H as b,Rc as c,A as d,al as e,Fc as f,il as g,Kc as i,Yc as m,se as n,Zc as w};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var z=Object.defineProperty;var n=(t,e)=>z(t,"name",{value:e,configurable:!0});import{createRequire as Q}from"node:module";import{f as tt,M as w}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{
|
|
2
|
-
`,{mode:R});try{await Nt(r,s)}catch(i){throw await M(r,{force:!0}).catch(()=>{}),i}},"writeEntry"),Ft=new Set(["EACCES","EBUSY","EPERM"]),Lt=8,Wt=20,Nt=h(async(t,e)=>{let o=0;for(;;)try{await it(t,e);return}catch(s){const{code:r}=s;if(!(r!==void 0&&Ft.has(r))||o>=Lt)throw s;const i=Wt*2**o;await new Promise(c=>{setTimeout(c,i)}),o+=1}},"renameWithRetry"),g=h(async(t,e,o)=>{const s=await k(t),r=o??await b(t,e);await M(D(s,e),{force:!0}),r&&await M(r.logFile,{force:!0}).catch(()=>{})},"deleteEntry"),
|
|
1
|
+
var z=Object.defineProperty;var n=(t,e)=>z(t,"name",{value:e,configurable:!0});import{createRequire as Q}from"node:module";import{f as tt,M as w}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{f as j}from"../packem_chunks/config.js";import{aD as ht,B as dt,aE as L}from"../packem_chunks/bin.js";import{withEnhancedPath as wt}from"@visulima/task-runner";const Z=Q(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=n(t=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[e,o]=m.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return m.getBuiltinModule(t)}return Z(t)},"__cjs_getBuiltinModule"),{Socket:et}=p("node:net"),{randomBytes:ot}=p("node:crypto"),{readdir:st,writeFile:rt,rm:M,rename:it,open:nt,readFile:at,stat:ct,unlink:O}=p("node:fs/promises"),{createRequire:lt}=p("node:module"),{spawn:ft}=p("node:child_process"),{openSync:ut,closeSync:pt}=p("node:fs");var kt=Object.defineProperty,mt=n((t,e)=>kt(t,"name",{value:e,configurable:!0}),"i$1"),vt=Object.defineProperty,W=mt((t,e)=>vt(t,"name",{value:e,configurable:!0}),"s");const gt=lt(import.meta.url),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,yt=W(t=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[e,o]=v.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return v.getBuiltinModule(t)}return gt(t)},"__cjs_getBuiltinModule"),{lstat:x,mkdir:_t}=yt("node:fs/promises");var bt=Object.defineProperty,$t=W((t,e)=>bt(t,"name",{value:e,configurable:!0}),"o");const Et=$t(async t=>{tt(t);try{const e=await x(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(j(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await _t(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const o=await x(t);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(j(o))}'`,{cause:e})}},"ensureDir");var St=Object.defineProperty,f=n((t,e)=>St(t,"name",{value:e,configurable:!0}),"s$1");const Ht=3e4,N=100;class Pt extends Error{static{n(this,"ServiceReadinessError")}constructor(e,o){super(e),this.elapsedMs=o,this.name="ServiceReadinessError"}elapsedMs;static{f(this,"ServiceReadinessError")}}const Mt=f(async t=>{const e=t.host??"127.0.0.1",{port:o}=t,s=t.timeoutMs??Ht,r=Date.now();for(;Date.now()-r<s;){if(await Rt(e,o))return;await Tt(N)}throw new Pt(`Timed out waiting for ${e}:${String(o)} to accept TCP connections (${String(s)}ms)`,Date.now()-r)},"waitForTcp"),Rt=f((t,e)=>new Promise(o=>{const s=new et,r=f(i=>{s.removeAllListeners(),s.destroy(),o(i)},"onDone");s.once("connect",()=>{r(!0)}),s.once("error",()=>{r(!1)}),s.setTimeout(N,()=>{r(!1)});try{s.connect(e,t)}catch{r(!1)}}),"tryConnect"),Tt=f(t=>new Promise(e=>{setTimeout(e,t)}),"delay"),Dt=f(async(t,e)=>{const o=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});o&&await Mt({host:o.tcp.host,port:o.tcp.port,timeoutMs:e?.timeoutMs??o.tcp.timeoutMs})},"runReadiness");var Ot=Object.defineProperty,h=n((t,e)=>Ot(t,"name",{value:e,configurable:!0}),"o");const R=384,C=5e3,jt=50,xt=3e4,k=h(async t=>{const e=w(ht(t),"services");try{await Et(e)}catch(o){throw o.code==="ENOTDIR"?new Error(`Service registry path ${e} exists but is not a directory. Remove it or move the conflicting file before running \`vis service\`.`,{cause:o}):o}return e},"getRegistryDir"),T=h(t=>t.replaceAll("/","_").replaceAll(":","__"),"slugify"),D=h((t,e)=>w(t,`${T(e)}.json`),"entryPath"),Ct=h((t,e)=>w(t,`${T(e)}.lock`),"lockPath"),b=h(async(t,e)=>{const o=await k(t),s=D(o,e);if(await dt(s))try{return await L(s)}catch{return}},"readEntry"),At=h(async t=>{const e=await k(t);let o;try{o=await st(e)}catch{return[]}const s=[];for(const r of o)if(r.endsWith(".json"))try{const i=await L(w(e,r));s.push(i)}catch{}return s},"readAllEntries"),It=h(async(t,e)=>{const o=await k(t),s=D(o,e.id),r=w(o,`.${ot(8).toString("hex")}.tmp`);await rt(r,`${JSON.stringify(e,void 0,2)}
|
|
2
|
+
`,{mode:R});try{await Nt(r,s)}catch(i){throw await M(r,{force:!0}).catch(()=>{}),i}},"writeEntry"),Ft=new Set(["EACCES","EBUSY","EPERM"]),Lt=8,Wt=20,Nt=h(async(t,e)=>{let o=0;for(;;)try{await it(t,e);return}catch(s){const{code:r}=s;if(!(r!==void 0&&Ft.has(r))||o>=Lt)throw s;const i=Wt*2**o;await new Promise(c=>{setTimeout(c,i)}),o+=1}},"renameWithRetry"),g=h(async(t,e,o)=>{const s=await k(t),r=o??await b(t,e);await M(D(s,e),{force:!0}),r&&await M(r.logFile,{force:!0}).catch(()=>{})},"deleteEntry"),u=h(t=>{try{return process.kill(t,0),!0}catch{return!1}},"isAlive"),le=h(async t=>{const e=await At(t),o=[],s=[];for(const r of e){if(u(r.pid)){s.push(r);continue}const i=await b(t,r.id);if(i&&i.pid!==r.pid){s.push(i);continue}await g(t,r.id,r).catch(()=>{}),o.push(r.id)}return{pruned:o,surviving:s}},"pruneDead"),Bt=h(t=>new Promise(e=>{setTimeout(e,t)}),"sleep"),Gt=h(async t=>{try{const e=await nt(t,"wx",R);try{await e.writeFile(String(process.pid))}finally{await e.close().catch(()=>{})}return!0}catch(e){if(e.code==="EEXIST")return!1;throw e}},"tryClaimLock"),Vt=h(async t=>{let e;try{const o=await at(t,"utf8"),s=Number.parseInt(o.trim(),10);e=Number.isFinite(s)?s:void 0}catch{return!0}if(e!==void 0&&!u(e))return!0;try{const o=await ct(t);return Date.now()-o.mtimeMs>xt}catch{return!0}},"isLockStale"),B=h(async(t,e,o)=>{const s=await k(t),r=Ct(s,e),i=Date.now();for(;!await Gt(r);){if(await Vt(r)){await O(r).catch(()=>{});continue}if(Date.now()-i>=C)throw new Error(`Could not acquire service lock for ${e} within ${String(C)}ms — another \`vis service\` invocation appears to be holding it.`);await Bt(jt)}try{return await o()}finally{await O(r).catch(()=>{})}},"withServiceLock");var qt=Object.defineProperty,l=n((t,e)=>qt(t,"name",{value:e,configurable:!0}),"r");function y(t,e={},o){for(const s in t){const r=t[s],i=o?`${o}:${s}`:s;typeof r=="object"&&r!==null?y(r,e,i):typeof r=="function"&&(e[i]=r)}return e}n(y,"c");l(y,"flatHooks");function Xt(...t){const e={};for(const o of t){const s=y(o);for(const r in s)e[r]?e[r].push(s[r]):e[r]=[s[r]]}for(const o in e)if(e[o].length>1){const s=e[o];e[o]=(...r)=>G(s,i=>i(...r))}else e[o]=e[o][0];return e}n(Xt,"v");l(Xt,"mergeHooks");function G(t,e){return t.reduce((o,s)=>o.then(()=>e(s)),Promise.resolve())}n(G,"d$1");l(G,"serial");const V=(()=>{if(console.createTask)return console.createTask;const t={run:l(e=>e(),"run")};return()=>t})();function $(t,e,o,s){for(let r=o;r<t.length;r+=1)try{const i=s?s.run(()=>t[r](...e)):t[r](...e);if(i&&typeof i.then=="function")return Promise.resolve(i).then(()=>$(t,e,r+1,s))}catch(i){return Promise.reject(i)}}n($,"k");l($,"callHooks");function q(t,e,o){if(t.length>0)return $(t,e,0,V(o))}n(q,"y");l(q,"serialTaskCaller");function X(t,e,o){if(t.length>0){const s=V(o);return Promise.all(t.map(r=>s.run(()=>r(...e))))}}n(X,"m");l(X,"parallelTaskCaller");function Yt(t,e){return t.reduce((o,s)=>o.then(()=>s(...e||[])),Promise.resolve())}n(Yt,"x");l(Yt,"serialCaller");function Jt(t,e){return Promise.all(t.map(o=>o(...e||[])))}n(Jt,"P");l(Jt,"parallelCaller");function _(t,e){for(const o of[...t])o(e)}n(_,"a");l(_,"callEachWith");var Kt=class{static{n(this,"p")}static{l(this,"Hookable")}_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,e,o={}){if(!t||typeof e!="function")return()=>{};const s=t;let r;for(;this._deprecatedHooks[t];)r=this._deprecatedHooks[t],t=r.to;if(r&&!o.allowDeprecated){let i=r.message;i||(i=`${s} hook has been deprecated`+(r.to?`, please use ${r.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!e.name)try{Object.defineProperty(e,"name",{get:l(()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb","get"),configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)}}hookOnce(t,e){let o,s=l((...r)=>(typeof o=="function"&&o(),o=void 0,s=void 0,e(...r)),"_function");return o=this.hook(t,s),o}removeHook(t,e){const o=this._hooks[t];if(o){const s=o.indexOf(e);s!==-1&&o.splice(s,1),o.length===0&&(this._hooks[t]=void 0)}}clearHook(t){this._hooks[t]=void 0}deprecateHook(t,e){this._deprecatedHooks[t]=typeof e=="string"?{to:e}:e;const o=this._hooks[t]||[];this._hooks[t]=void 0;for(const s of o)this.hook(t,s)}deprecateHooks(t){for(const e in t)this.deprecateHook(e,t[e])}addHooks(t){const e=y(t),o=Object.keys(e).map(s=>this.hook(s,e[s]));return()=>{for(const s of o)s();o.length=0}}removeHooks(t){const e=y(t);for(const o in e)this.removeHook(o,e[o])}removeAllHooks(){this._hooks={}}callHook(t,...e){return this.callHookWith(q,t,e)}callHookParallel(t,...e){return this.callHookWith(X,t,e)}callHookWith(t,e,o){const s=this._before||this._after?{name:e,args:o,context:{}}:void 0;this._before&&_(this._before,s);const r=t(this._hooks[e]?[...this._hooks[e]]:[],o,e);return r instanceof Promise?r.finally(()=>{this._after&&s&&_(this._after,s)}):(this._after&&s&&_(this._after,s),r)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const e=this._before.indexOf(t);e!==-1&&this._before.splice(e,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const e=this._after.indexOf(t);e!==-1&&this._after.splice(e,1)}}}};function Y(){return new Kt}n(Y,"w$1");l(Y,"createHooks");(class{static{l(this,"HookableCore")}_hooks;constructor(){this._hooks={}}hook(t,e){return!t||typeof e!="function"?()=>{}:(this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)})}removeHook(t,e){const o=this._hooks[t];if(o){const s=o.indexOf(e);s!==-1&&o.splice(s,1),o.length===0&&(this._hooks[t]=void 0)}}callHook(t,...e){const o=this._hooks[t];if(!(!o||o.length===0))return $(o,e,0)}});const A=typeof window<"u";function Ut(t,e={}){const o={inspect:A,group:A,filter:l(()=>!0,"filter"),...e},s=o.filter,r=typeof s=="string"?a=>a.startsWith(s):s,i=o.tag?`[${o.tag}] `:"",c=l(a=>i+a.name+"".padEnd(a._id,"\0"),"logPrefix"),d={},H=t.beforeEach(a=>{r!==void 0&&!r(a.name)||(d[a.name]=d[a.name]||0,a._id=d[a.name]++,console.time(c(a)))}),P=t.afterEach(a=>{r!==void 0&&!r(a.name)||(o.group&&console.groupCollapsed(a.name),o.inspect?console.timeLog(c(a),a.args):console.timeEnd(c(a)),o.group&&console.groupEnd(),d[a.name]--)});return{close:l(()=>{H(),P()},"close")}}n(Ut,"W");l(Ut,"createDebugger");var zt=Object.defineProperty,E=n((t,e)=>zt(t,"name",{value:e,configurable:!0}),"t$1");const he=E(()=>Y(),"createVisHooks"),de=E(async(t,e)=>{if(!(!e||e.length===0))for(const o of e){if(o.hooks)for(const[s,r]of Object.entries(o.hooks)){const i=Array.isArray(r)?r:[r];for(const c of i)t.hook(s,c)}o.setup&&await o.setup(t)}},"registerPlugins");class fe{static{n(this,"HookableLifeCycle")}static{E(this,"HookableLifeCycle")}#o;#e;#s=new Map;constructor(e,o){this.#o=e,this.#e=o}startTasks(e){for(const o of e)this.#s.set(o.id,o),this.#t("task:before",o)}endTasks(e){for(const o of e)this.#s.delete(o.task.id),this.#t("task:after",o.task,o),o.status==="failure"?this.#t("task:failure",o.task,o):Qt(o.status)&&this.#t("task:cacheHit",o.task,o)}printCacheMiss(e,o){this.#t("task:cacheMiss",e,o)}onTaskStdout(e,o){this.#t("task:stdout",e,o)}onTaskStderr(e,o){this.#t("task:stderr",e,o)}#t(e,...o){Promise.resolve(this.#o.callHook(e,...o)).catch(s=>{if(this.#e)try{this.#e(e,s)}catch{}})}}const Qt=E(t=>t==="local-cache"||t==="local-cache-kept-existing"||t==="remote-cache","isCacheStatus");var Zt=Object.defineProperty,te=n((t,e)=>Zt(t,"name",{value:e,configurable:!0}),"i");const I=process.platform==="win32",ee=te(async t=>{const{command:e,cwd:o,env:s,logFile:r}=t,i=ut(r,"a",R);let c;const d=I?"cmd":"/bin/sh",H=I?["/d","/s","/c",e]:["-c",e];try{c=ft(d,H,{cwd:o,detached:!0,env:wt({...process.env,...s},o),stdio:["ignore",i,i],windowsHide:!0})}finally{pt(i)}if(c.pid===void 0&&await new Promise((P,a)=>{c.once("spawn",()=>{P()}),c.once("error",U=>{a(U)})}),c.pid===void 0)throw new Error(`Failed to spawn detached process for command: ${e}`);return c.unref(),{pid:c.pid}},"spawnDetached");var oe=Object.defineProperty,S=n((t,e)=>oe(t,"name",{value:e,configurable:!0}),"t");const J=5e3,ue=S(async t=>B(t.workspaceRoot,t.id,async()=>{const e=await b(t.workspaceRoot,t.id);if(e&&u(e.pid))throw new Error(`Service ${t.id} is already running (pid ${String(e.pid)})`);e&&await g(t.workspaceRoot,t.id,e);const o=await k(t.workspaceRoot),s=T(t.id),r=w(o,`${s}.log`),{pid:i}=await ee({command:t.command,cwd:t.cwd,env:t.env,logFile:r}),c={command:t.command,config:t.config,cwd:t.cwd,env:t.config.env??{},id:t.id,logFile:r,pid:i,slug:s,startedAt:new Date().toISOString(),visVersion:process.env.VIS_VERSION??"0.0.0"};if(await It(t.workspaceRoot,c),t.skipReadiness!==!0)try{await Dt(t.config,{timeoutMs:t.readinessTimeoutMs})}catch(d){throw await K(i,t.config.killGracePeriodMs??J).catch(()=>{}),await g(t.workspaceRoot,t.id,c).catch(()=>{}),d}return{entry:c}}),"startService"),pe=S(async t=>B(t.workspaceRoot,t.id,async()=>{const e=await b(t.workspaceRoot,t.id);if(!e)return{stopped:!1};if(!u(e.pid))return await g(t.workspaceRoot,t.id,e),{stopped:!1};const o=t.graceMs??e.config.killGracePeriodMs??J;return await K(e.pid,o),await g(t.workspaceRoot,t.id,e),{stopped:!0}}),"stopService"),K=S(async(t,e)=>{F(t,"SIGTERM");const o=Date.now();for(;Date.now()-o<e;){if(!u(t))return;await new Promise(s=>{setTimeout(s,100)})}u(t)&&F(t,"SIGKILL")},"stopServiceByPid"),F=S((t,e)=>{try{process.platform==="win32"?process.kill(t,e):process.kill(-t,e)}catch(o){if(o.code==="ESRCH")return;throw o}},"sendSignalToServiceGroup");export{fe as H,Pt as S,b as a,pe as b,he as c,At as d,Dt as e,g as f,u as i,le as p,de as r,ue as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var E=Object.defineProperty;var R=(u,p)=>E(u,"name",{value:p,configurable:!0});import{M as d,i as o,$}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{
|
|
1
|
+
var E=Object.defineProperty;var R=(u,p)=>E(u,"name",{value:p,configurable:!0});import{M as d,i as o,$}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{d as h}from"../packem_chunks/config.js";import{m as x}from"../packem_chunks/bin.js";var S=Object.defineProperty,b=R((u,p)=>S(u,"name",{value:p,configurable:!0}),"k");const U=b((u,p,A,m=[])=>{const i=[];if(A===void 0)return i.push("minimumReleaseAge not set in vis.config; skipping native sync."),i;const r=Number.isFinite(A)?Math.max(0,Math.round(A)):0;switch(u){case"bun":{const n=d(p,"bunfig.toml");let e=o(n)?$(n):"";const a=r*60,t=`minimumReleaseAge = ${String(a)}`,s=m.length>0?`minimumReleaseAgeExcludes = [${m.map(c=>`"${c.replaceAll(String.raw`"`,String.raw`\"`)}"`).join(", ")}]`:void 0,g=/^\[install\][ \t]*\n/m.exec(e);if(g?.index===void 0){const c=s?`${t}
|
|
2
2
|
${s}`:t;e=`${e.trimEnd()?`${e.trimEnd()}
|
|
3
3
|
|
|
4
4
|
`:""}[install]
|