@visulima/vis 1.0.0-alpha.40 → 1.0.0-alpha.42
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 +41 -0
- package/LICENSE.md +265 -35
- package/dist/bin.js +1 -1
- package/dist/binx.js +2 -2
- package/dist/config/index.d.ts +19 -1
- package/dist/config/index.js +1 -1
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cli-exec.js +1 -0
- package/dist/packem_chunks/{bin.js → cli-main.js} +282 -274
- package/dist/packem_chunks/config.js +8 -11
- package/dist/packem_chunks/devtools.js +1 -78
- package/dist/packem_chunks/dispatch.js +4 -0
- package/dist/packem_chunks/doctor-probe.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- 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 +3 -3
- package/dist/packem_chunks/handler14.js +1 -1
- 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 -4
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler22.js +2 -2
- package/dist/packem_chunks/handler23.js +5 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +1 -5
- package/dist/packem_chunks/handler27.js +5 -1
- package/dist/packem_chunks/handler28.js +1 -3
- package/dist/packem_chunks/handler29.js +3 -1
- package/dist/packem_chunks/handler3.js +1 -4
- package/dist/packem_chunks/handler30.js +1 -2
- package/dist/packem_chunks/handler31.js +1 -2
- package/dist/packem_chunks/handler32.js +2 -2
- package/dist/packem_chunks/handler33.js +2 -3
- package/dist/packem_chunks/handler34.js +2 -6
- package/dist/packem_chunks/handler35.js +3 -1
- package/dist/packem_chunks/handler36.js +6 -42
- package/dist/packem_chunks/handler37.js +1 -8
- package/dist/packem_chunks/handler38.js +42 -9
- package/dist/packem_chunks/handler39.js +7 -74
- package/dist/packem_chunks/handler4.js +4 -6
- package/dist/packem_chunks/handler40.js +9 -5
- package/dist/packem_chunks/handler41.js +75 -4
- package/dist/packem_chunks/handler42.js +5 -3
- package/dist/packem_chunks/handler43.js +4 -2
- package/dist/packem_chunks/handler44.js +3 -1
- package/dist/packem_chunks/handler45.js +2 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +1 -3
- package/dist/packem_chunks/handler48.js +1 -1
- package/dist/packem_chunks/handler49.js +3 -7
- package/dist/packem_chunks/handler5.js +4 -8
- package/dist/packem_chunks/handler50.js +1 -33
- package/dist/packem_chunks/handler51.js +7 -3
- package/dist/packem_chunks/handler52.js +33 -8
- package/dist/packem_chunks/handler53.js +3 -4
- package/dist/packem_chunks/handler54.js +8 -1
- package/dist/packem_chunks/handler55.js +4 -12
- package/dist/packem_chunks/handler56.js +1 -7
- package/dist/packem_chunks/handler57.js +12 -5
- package/dist/packem_chunks/handler58.js +5 -11
- package/dist/packem_chunks/handler59.js +11 -3
- package/dist/packem_chunks/handler6.js +6 -1
- package/dist/packem_chunks/handler60.js +3 -22
- package/dist/packem_chunks/handler61.js +21 -60
- package/dist/packem_chunks/handler62.js +61 -3
- package/dist/packem_chunks/handler63.js +3 -6
- package/dist/packem_chunks/handler64.js +6 -708
- package/dist/packem_chunks/handler65.js +8 -23
- package/dist/packem_chunks/handler66.js +24 -25
- package/dist/packem_chunks/handler67.js +25 -153
- package/dist/packem_chunks/handler68.js +153 -10
- package/dist/packem_chunks/handler69.js +10 -24
- package/dist/packem_chunks/handler7.js +8 -1
- package/dist/packem_chunks/handler70.js +24 -322
- package/dist/packem_chunks/handler71.js +322 -48
- package/dist/packem_chunks/handler72.js +700 -19
- package/dist/packem_chunks/handler73.js +48 -3
- package/dist/packem_chunks/handler74.js +21 -184
- package/dist/packem_chunks/handler75.js +3 -38
- package/dist/packem_chunks/handler76.js +190 -0
- package/dist/packem_chunks/handler77.js +38 -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/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +4 -4
- package/dist/packem_chunks/index2.js +1 -1
- package/dist/packem_chunks/index3.js +135 -0
- package/dist/packem_chunks/index4.js +74 -0
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +4 -0
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/loader2.js +1 -1
- package/dist/packem_chunks/orchestrator.js +3 -3
- package/dist/packem_chunks/prompts.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/registry.js +2 -2
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/shell-runner.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/tar.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/ts-loader.js +2 -0
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/version-resolver.js +2 -2
- package/dist/packem_shared/CONFIG_FILES-MsOntfYT.js +1 -0
- package/dist/packem_shared/{Table-CcVkyULl-B_ef6zfS.js → Table-CcVkyULl-DLWu6XHL.js} +25 -26
- package/dist/packem_shared/{advisories-DLeO5KMN.js → advisories-aiDtubZQ.js} +1 -1
- package/dist/packem_shared/{affected-shas-cVnX8-zs.js → affected-shas-C1XuRlvo.js} +1 -1
- package/dist/packem_shared/{ai-analysis-BUeX2J2H.js → ai-analysis-CubpCxZJ.js} +4 -4
- package/dist/packem_shared/{ai-fix-9Vzlp6XU.js → ai-fix-Btd5AnSr.js} +2 -2
- package/dist/packem_shared/augment-8fIWWGSc.js +3 -0
- package/dist/packem_shared/bin-CnDBuLh3.js +2 -0
- package/dist/packem_shared/build-scripts-Doxce2VM.js +1 -0
- package/dist/packem_shared/command-runtime-RiCMa2C8.js +1 -0
- package/dist/packem_shared/compile-cache-B_Vf_WxT.js +3 -0
- package/dist/packem_shared/{cyclonedx-kYozDyxp.js → cyclonedx-NUJ9R2GQ.js} +1 -1
- package/dist/packem_shared/dependency-scan-B0HV_qeB.js +1 -0
- package/dist/packem_shared/{docker-BMLrNtWm.js → docker-DKlF-gk3.js} +1 -1
- package/dist/packem_shared/failure-log-C7r6UZLP.js +2 -0
- package/dist/packem_shared/{giget-DHY1sQZC.js → giget-DVTFJlbR.js} +2 -2
- package/dist/packem_shared/glob-fqg4KepW-7Bs2kZuM.js +1 -0
- package/dist/packem_shared/index-BKFEWXU_.js +1 -0
- package/dist/packem_shared/index-CPhv-r4c.js +28 -0
- package/dist/packem_shared/{index-CgcF6_wo.js → index-Cb4x6lWY.js} +1 -1
- package/dist/packem_shared/index-DjTWo3sH.js +1 -0
- package/dist/packem_shared/{index-BDmTbWX1.js → index-OQZQyN5R.js} +1 -1
- package/dist/packem_shared/index.server-J83sowC4.js +2 -0
- package/dist/packem_shared/{lifecycle-4z9hHE5b.js → lifecycle-D5roTh0a.js} +2 -2
- package/dist/packem_shared/{lockfile-C8Q1_4KK.js → lockfile-DIGyLfmF.js} +1 -1
- package/dist/packem_shared/main-B3juSU5z.js +1 -0
- package/dist/packem_shared/manifests-pLwnVmCN.js +1 -0
- package/dist/packem_shared/{min-release-age-D1alDE3K.js → min-release-age-pUAqTiv3.js} +3 -3
- package/dist/packem_shared/missing-package-json-DhYzuKhD.js +1 -0
- package/dist/packem_shared/{native-config-sync-BEkJW7g3.js → native-config-sync-4K9wWTj5.js} +1 -1
- package/dist/packem_shared/{osv-bloom-B03tUWf3.js → osv-bloom-OuTfu_LE.js} +1 -1
- package/dist/packem_shared/{pm-runner-OGResYrA.js → pm-runner-Dws_Bw1y.js} +1 -1
- package/dist/packem_shared/provenance-C0P-UYOM.js +1 -0
- package/dist/packem_shared/readJsonSync-CvkZyKmL-CY7PZob_.js +4 -0
- package/dist/packem_shared/registry-keys-D4chF-Wj.js +1 -0
- package/dist/packem_shared/{resolve-explicit-CMDl55Nz.js → resolve-explicit-Cgheka3B.js} +3 -3
- package/dist/packem_shared/resolve-runtime-CJSWV-K8.js +1 -0
- package/dist/packem_shared/run-file-B4TqKa0X.js +1 -0
- package/dist/packem_shared/runtime-check-0lUJvgKt.js +1 -0
- package/dist/packem_shared/runtime-process-Dmz0vCJy-DUwTvH1J.js +1 -0
- package/dist/packem_shared/s1ngularity-Du1NnSFP.js +1 -0
- package/dist/packem_shared/scan-progress-CN9ONR0y.js +2 -0
- package/dist/packem_shared/{selectors-GCJIe342.js → selectors-UmnAuc26.js} +1 -1
- package/dist/packem_shared/{signatures-C730vkyK.js → signatures-BOUhghTv.js} +1 -1
- package/dist/packem_shared/{spinner-CV3WVJLv.js → spinner-lhXugSx3.js} +1 -1
- package/dist/packem_shared/tabs-DTiU3usb.js +1 -0
- package/dist/packem_shared/target-options-ChWcK60i.js +1 -0
- package/dist/packem_shared/toolchain-DyCKnGch.js +5 -0
- package/dist/packem_shared/typosquats-DBOvXwph.js +1 -0
- package/dist/packem_shared/use-measured-height-CK2Co3XI.js +1 -0
- package/dist/packem_shared/verify-CVPYlUrF.js +1 -0
- package/dist/packem_shared/vis-update-app-DtHkwBca.js +1 -0
- package/dist/packem_shared/watch-Bkp_AAbc.js +1 -0
- package/dist/packem_shared/watch-loop-D9zbXzRd.js +11 -0
- package/dist/runtime/preload.d.ts +1 -0
- package/dist/runtime/preload.js +1 -0
- package/index.d.ts +14 -0
- package/index.js +28 -27
- package/package.json +18 -27
- package/schemas/vis-config.schema.json +12 -0
- package/dist/packem_shared/CONFIG_FILES-BfaR0jKT.js +0 -1
- package/dist/packem_shared/build-scripts-CCCi8U66.js +0 -1
- package/dist/packem_shared/dependency-scan-DnTgYleU.js +0 -1
- package/dist/packem_shared/failure-log-CEWP3bP0.js +0 -2
- package/dist/packem_shared/glob-fqg4KepW-B7EjLRvw.js +0 -1
- package/dist/packem_shared/index-Du8RWawQ.js +0 -1
- package/dist/packem_shared/index-yBikBkHT.js +0 -30
- package/dist/packem_shared/manifests-Dj3pRKBT.js +0 -1
- package/dist/packem_shared/missing-package-json-8vNHwbqw.js +0 -1
- package/dist/packem_shared/provenance-_CJjMKwu.js +0 -1
- package/dist/packem_shared/registry-keys-BfFto6vI.js +0 -1
- package/dist/packem_shared/runtime-check-Stc9AI78.js +0 -1
- package/dist/packem_shared/s1ngularity-Dhr3bPk0.js +0 -1
- package/dist/packem_shared/scan-progress-CFhc0CMj.js +0 -2
- package/dist/packem_shared/tabs-BuTy5gPV.js +0 -1
- package/dist/packem_shared/toolchain-pR7AJ-tB.js +0 -5
- package/dist/packem_shared/typosquats-DN78xx1x.js +0 -1
- package/dist/packem_shared/use-measured-height-_eVGWtWt.js +0 -1
- package/dist/packem_shared/verify-6WCmFmy8.js +0 -1
- package/dist/packem_shared/vis-update-app-k3fDxech.js +0 -1
- package/dist/packem_shared/watch-BvIwLG4N.js +0 -1
- package/dist/packem_shared/watch-loop-DWkvv2tK.js +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aA as ae,a1 as e,a2 as l,m as r,aB as je,B as ue,aC as ge,aD as me,r as g,ab as fe,aE as _,aF as ne}from"../packem_chunks/cli-main.js";import{o as ye}from"./spinner-lhXugSx3.js";import{F as we,a as Ce}from"./tabs-DTiU3usb.js";import{u as ke}from"./use-measured-height-CK2Co3XI.js";const Ke=({current:a,total:t})=>{const{columns:i}=ae(),s=i||80,d=t>0?Math.min(1,a/t):0,h=`${String(Math.round(d*100)).padStart(3)}%`,f=`${String(a)}/${String(t)}`,y=Math.max(10,s-2-h.length-1),p=Math.round(y*d),j=y-p;return e.jsxs(l,{flexDirection:"column",paddingX:1,children:[e.jsxs(l,{children:[e.jsx(ye,{type:"dots"}),e.jsx(r,{children:" Checking catalog dependencies "}),e.jsx(r,{dimColor:!0,children:f})]}),e.jsxs(l,{children:[e.jsx(r,{color:"cyan",children:"━".repeat(p)}),e.jsx(r,{dimColor:!0,children:"─".repeat(j)}),e.jsxs(r,{dimColor:!0,children:[" ",h]})]})]})},J=["default","name","updateType","severity"],ce=a=>{const t=a.vulnerabilities?.map(i=>i.severity)??[];return t.includes("CRITICAL")?4:t.includes("HIGH")?3:t.includes("MODERATE")?2:t.includes("LOW")?1:0},de={digest:0,major:3,minor:2,patch:1,pin:0,unknown:0},he=(a,t)=>{if(t==="default")return a;const i=[...a];return t==="name"?i.sort((s,d)=>s.packageName.localeCompare(d.packageName)):t==="updateType"?i.sort((s,d)=>(de[d.updateType]??0)-(de[s.updateType]??0)||s.packageName.localeCompare(d.packageName)):i.sort((s,d)=>ce(d)-ce(s)||s.packageName.localeCompare(d.packageName)),i},Z=a=>`${a.ecosystem}|${a.file}:${String(a.line)}|${a.name}`,A=a=>`${a.catalogName} ${a.packageName}`,Y=a=>{const t=new Map;for(const i of a){const s=t.get(i.catalogName);s?s.push(i):t.set(i.catalogName,[i])}return t},G=(a,t,i)=>{let s=a;if(t!=="all"&&(s=t==="security"?s.filter(d=>d.vulnerabilities&&d.vulnerabilities.length>0||d.socketReport&&d.socketReport.alerts.length>0):s.filter(d=>d.updateType===t)),i){const d=i.toLowerCase();s=s.filter(h=>h.packageName.toLowerCase().includes(d))}return s};class He{#e;#l=new Set;#t;#s;#i=null;constructor(t,i=null,s=[]){this.#t=t,this.#s=s,i&&(this.#i=new Map(i.recommendations.map(d=>[d.package,d]))),this.#e={aiResult:i,allChecked:!0,applyProgress:null,checkedEcosystemKeys:new Set(s.map(d=>Z(d))),checkedEntries:new Set(t.map(d=>A(d))),ecosystemEntries:s,entries:t,error:null,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",groupedByCatalog:Y(t),phase:"browsing",selectedIndex:0,sortMode:"default"}}getSnapshot=()=>this.#e;subscribe=t=>(this.#l.add(t),()=>{this.#l.delete(t)});getFilteredEntries(){return he(G(this.#t,this.#e.filterType,this.#e.filterText),this.#e.sortMode)}setSortMode(t){if(t===this.#e.sortMode)return;const i=this.getFilteredEntries()[this.#e.selectedIndex]?.packageName,s=he(G(this.#t,this.#e.filterType,this.#e.filterText),t),d=i?Math.max(0,s.findIndex(h=>h.packageName===i)):0;this.#r({...this.#e,selectedIndex:d,sortMode:t})}cycleSortMode(){const t=J.indexOf(this.#e.sortMode),i=J[(t+1)%J.length]??"default";this.setSortMode(i)}getRecommendation(t){return this.#i?.get(t)}getCheckedEntries(){return this.#t.filter(t=>this.#e.checkedEntries.has(A(t)))}getCheckedEcosystemEntries(){return this.#s.filter(t=>this.#e.checkedEcosystemKeys.has(Z(t)))}toggleEcosystemCheck(t){const i=new Set(this.#e.checkedEcosystemKeys);i.has(t)?i.delete(t):i.add(t),this.#r({...this.#e,checkedEcosystemKeys:i})}checkAllEcosystem(){this.#r({...this.#e,checkedEcosystemKeys:new Set(this.#s.map(t=>Z(t)))})}uncheckAllEcosystem(){this.#r({...this.#e,checkedEcosystemKeys:new Set})}setSelectedIndex(t){const i=this.getFilteredEntries(),s=Math.max(0,Math.min(t,i.length-1));s!==this.#e.selectedIndex&&this.#r({...this.#e,selectedIndex:s})}setFocusedPanel(t){t!==this.#e.focusedPanel&&this.#r({...this.#e,focusedPanel:t})}setFilterType(t){if(t!==this.#e.filterType){const i=G(this.#t,t,this.#e.filterText);this.#r({...this.#e,entries:i,filterType:t,groupedByCatalog:Y(i),selectedIndex:0})}}setFilter(t){const i=G(this.#t,this.#e.filterType,t);this.#r({...this.#e,entries:i,filterText:t,groupedByCatalog:Y(i),selectedIndex:0})}setFilterActive(t){if(t!==this.#e.filterActive)if(t)this.#r({...this.#e,filterActive:!0});else{const i=G(this.#t,this.#e.filterType,"");this.#r({...this.#e,entries:i,filterActive:!1,filterText:"",groupedByCatalog:Y(i),selectedIndex:0})}}toggleCheck(t){const i=A(t),s=new Set(this.#e.checkedEntries);s.has(i)?s.delete(i):s.add(i),this.#r({...this.#e,allChecked:s.size===this.#t.length,checkedEntries:s})}checkAll(){this.#r({...this.#e,allChecked:!0,checkedEntries:new Set(this.#t.map(t=>A(t)))})}uncheckAll(){this.#r({...this.#e,allChecked:!1,checkedEntries:new Set})}toggleAll(){this.#e.allChecked?this.uncheckAll():this.checkAll()}startApply(){const t=this.getCheckedEntries();this.#r({...this.#e,applyProgress:{current:0,total:t.length},phase:"applying"})}updateApplyProgress(t){this.#e.applyProgress&&this.#r({...this.#e,applyProgress:{...this.#e.applyProgress,current:t}})}markDone(){this.#r({...this.#e,phase:"done"})}setError(t){this.#r({...this.#e,error:t,phase:"error"})}#r(t){this.#e=t;for(const i of this.#l)try{i()}catch{}}}const be={major:"red",minor:"yellow",patch:"green"},Te={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},Se={critical:"red",high:"red",low:"gray",medium:"yellow"},Ee={critical:"red",high:"red",low:"green",medium:"yellow"},ve={defer:"gray",review:"yellow",skip:"red",update:"green"},Re=({changelogUrl:a,entry:t,focused:i,recommendation:s,scrollRef:d})=>{const h=i?"white":"gray";if(!t)return e.jsx(l,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:e.jsx(r,{dimColor:!0,children:"No package selected"})});const f=be[t.updateType]??"white",y=t.vulnerabilities&&t.vulnerabilities.length>0,p=t.socketReport?.score.overall??0,j=t.socketReport?ue(p):"gray";return e.jsxs(l,{borderColor:h,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[e.jsx(l,{flexShrink:0,paddingTop:1,paddingX:2,children:e.jsx(r,{bold:!0,color:"white",children:t.displayName??t.packageName})}),e.jsxs(je,{flexGrow:1,flexShrink:1,paddingX:2,ref:d,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:[e.jsx(r,{}),e.jsxs(l,{children:[e.jsx(l,{width:12,children:e.jsx(r,{dimColor:!0,children:"Current:"})}),e.jsx(r,{children:t.currentRange})]}),e.jsxs(l,{children:[e.jsx(l,{width:12,children:e.jsx(r,{dimColor:!0,children:"Target:"})}),e.jsx(r,{children:t.newRange}),e.jsxs(r,{bold:!0,color:f,children:[" ","(",t.updateType,")"]})]}),e.jsxs(l,{children:[e.jsx(l,{width:12,children:e.jsx(r,{dimColor:!0,children:"Version:"})}),e.jsx(r,{children:t.targetVersion})]}),e.jsxs(l,{children:[e.jsx(l,{width:12,children:e.jsx(r,{dimColor:!0,children:t.kind==="ecosystem"?"Source:":"Catalog:"})}),e.jsx(r,{color:t.kind==="ecosystem"?"cyan":void 0,children:t.catalogName})]}),t.acceptedRisk&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{color:"gray",children:"── "}),e.jsx(r,{bold:!0,color:"gray",children:"ACKNOWLEDGED RISK"}),e.jsxs(l,{flexDirection:"column",paddingLeft:2,children:[e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Reason: "}),e.jsx(r,{children:t.acceptedRisk.reason})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Accepted: "}),e.jsx(r,{children:t.acceptedRisk.acceptedAt.slice(0,10)})]})]})]}),y&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"red",children:"SECURITY"}),e.jsx(r,{}),t.vulnerabilities.map(n=>e.jsxs(l,{flexDirection:"column",marginBottom:1,children:[e.jsxs(l,{gap:1,children:[e.jsxs(r,{bold:!0,color:Te[n.severity]??"gray",children:["⚠"," ",n.severity]}),e.jsx(r,{bold:!0,children:n.id})]}),e.jsx(l,{paddingLeft:2,children:e.jsx(r,{children:n.summary})}),e.jsxs(l,{gap:2,paddingLeft:2,children:[n.cvssScore!==void 0&&e.jsxs(r,{dimColor:!0,children:["CVSS:",String(n.cvssScore)]}),n.fixedVersions.length>0&&e.jsxs(r,{dimColor:!0,children:["Fixed in:",n.fixedVersions.join(", ")]})]})]},n.id))]}),t.socketReport&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"cyan",children:"SOCKET.DEV"}),e.jsx(r,{}),e.jsxs(l,{gap:2,children:[e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Overall: "}),e.jsxs(r,{bold:!0,color:j,children:[String(Math.round(p*100)),"%"]})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Supply Chain: "}),e.jsxs(r,{children:[String(Math.round(t.socketReport.score.supplyChain*100)),"%"]})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Quality: "}),e.jsxs(r,{children:[String(Math.round(t.socketReport.score.quality*100)),"%"]})]})]}),e.jsxs(l,{gap:2,children:[e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Maintenance: "}),e.jsxs(r,{children:[String(Math.round(t.socketReport.score.maintenance*100)),"%"]})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Vulnerability: "}),e.jsxs(r,{children:[String(Math.round(t.socketReport.score.vulnerability*100)),"%"]})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"License: "}),e.jsxs(r,{children:[t.socketReport.license||"unknown"," ","(",String(Math.round(t.socketReport.score.license*100)),"%)"]})]})]}),t.socketReport.alerts.length>0&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsxs(r,{bold:!0,color:"yellow",children:["⚠"," ",String(t.socketReport.alerts.length)," ","alert",t.socketReport.alerts.length===1?"":"s",":"]}),t.socketReport.alerts.map(n=>e.jsxs(l,{gap:1,paddingLeft:2,children:[e.jsxs(r,{bold:!0,color:Se[n.severity]??"gray",children:["[",n.severity.toUpperCase(),"]"]}),e.jsx(r,{children:n.type}),e.jsxs(r,{dimColor:!0,children:["(",n.category,")"]})]},n.key))]})]}),s&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"AI ANALYSIS"}),e.jsx(r,{}),e.jsxs(l,{gap:2,children:[e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Action: "}),e.jsx(r,{bold:!0,color:ve[s.action]??"white",children:s.action})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Risk: "}),e.jsx(r,{bold:!0,color:Ee[s.riskLevel]??"white",children:s.riskLevel})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Effort: "}),e.jsx(r,{bold:!0,children:s.effort})]})]}),s.reason&&e.jsx(l,{marginTop:1,paddingLeft:2,children:e.jsx(r,{children:s.reason})}),s.breakingChanges.length>0&&e.jsxs(l,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[e.jsx(r,{bold:!0,color:"yellow",children:"Breaking changes:"}),s.breakingChanges.map((n,I)=>e.jsxs(r,{children:[" ","•"," ",n]},String(I)))]})]}),a&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"CHANGELOG"}),e.jsx(l,{marginTop:1,paddingLeft:2,children:e.jsx(r,{color:"cyan",underline:!0,children:a})})]}),e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"LINKS"}),e.jsx(l,{flexDirection:"column",marginTop:1,paddingLeft:2,children:t.kind==="ecosystem"?e.jsx(r,{color:"cyan",underline:!0,children:t.detailUrl??t.displayName??t.packageName}):e.jsxs(r,{color:"cyan",underline:!0,children:["https://npmx.dev/",t.packageName]})})]}),!s&&t.kind!=="ecosystem"&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"GUIDANCE"}),e.jsxs(l,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[t.updateType==="major"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"red",children:["⚠"," ","Major update — likely contains breaking changes."]}),e.jsx(r,{dimColor:!0,children:" Review the changelog before updating."}),e.jsx(r,{dimColor:!0,children:" Use --changelog to fetch release URLs."})]}),t.updateType==="minor"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"yellow",children:["ℹ"," ","Minor update — new features, backward compatible."]}),e.jsx(r,{dimColor:!0,children:" Generally safe to update."})]}),t.updateType==="patch"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"green",children:["✓"," ","Patch update — bug fixes only."]}),e.jsx(r,{dimColor:!0,children:" Safe to update."})]}),!s&&e.jsx(r,{dimColor:!0,children:" Use --ai to get AI-powered analysis."})]})]})]})]})},Ae={major:"red",minor:"yellow",patch:"green"},Ie=[{id:"all",label:"All"},{id:"major",label:"Major"},{id:"minor",label:"Minor"},{id:"patch",label:"Patch"},{id:"security",label:"Security"}],De=({checked:a,entry:t,isSelected:i})=>{const s=Ae[t.updateType]??"white",d=t.vulnerabilities&&t.vulnerabilities.length>0,h=t.socketReport&&t.socketReport.alerts.length>0,f=!!t.acceptedRisk,y=a?"☑":"☐",p=t.socketReport?`${String(Math.round(t.socketReport.score.overall*100))}%`:"",j=t.socketReport?ue(t.socketReport.score.overall):"gray";return e.jsxs(l,{flexShrink:0,height:1,children:[e.jsx(r,{children:i?">":" "}),e.jsxs(r,{color:a?"white":"gray",children:[" ",y," "]}),d||h?e.jsx(r,{color:f?"gray":"red",children:f?"✓ ":"⚠ "}):e.jsx(r,{children:" "}),e.jsx(l,{flexGrow:1,children:e.jsxs(r,{bold:i,inverse:i,wrap:"truncate",children:[t.displayName??t.packageName,f?" [ack]":""]})}),p&&e.jsxs(r,{color:j,children:[" ",p]}),e.jsxs(r,{dimColor:!0,children:[" ",t.currentRange]}),e.jsxs(r,{dimColor:!0,children:[" ","→"," "]}),e.jsxs(r,{children:[t.newRange," "]}),e.jsx(r,{bold:!0,color:s,children:t.updateType})]})},Me=({count:a,ecosystem:t=!1,name:i})=>e.jsxs(l,{flexShrink:0,height:1,marginTop:1,children:[e.jsxs(r,{color:t?"cyan":void 0,dimColor:!t,children:[t?"◈":"▼"," "]}),e.jsx(r,{bold:!0,color:t?"cyan":"white",children:i.toUpperCase()}),e.jsxs(r,{dimColor:!0,children:[" ","(",a,")"]}),t&&e.jsxs(r,{color:"cyan",dimColor:!0,children:[" ","ci/cd refs"]})]}),Ne=({checkedEntries:a,entries:t,filterActive:i,filteredOutCount:s,filterText:d,filterType:h,focused:f,groupedByCatalog:y,isDryRun:p,onViewportHeightChange:j,scrollOffset:n,selectedIndex:I,totalCatalogEntries:D,totalChecked:E,totalEntries:H,viewportHeight:L})=>{const F=f?"white":"gray",{measuredHeight:m,ref:v}=ke(L,j);let P=0,S=0,M=0,R=0;for(const x of t)x.updateType==="major"?P++:x.updateType==="minor"?S++:M++,(x.vulnerabilities&&x.vulnerabilities.length>0||x.socketReport&&x.socketReport.alerts.length>0)&&R++;const C=[];P>0&&C.push(`${P} major`),S>0&&C.push(`${S} minor`),M>0&&C.push(`${M} patch`),R>0&&C.push(`${R} vulnerable`);const N=C.length>0?` (${C.join(", ")})`:"",w=t.filter(x=>x.kind==="ecosystem").length,k=t.length-w;let $=0;for(const x of t)a.has(A(x))&&$++;const O=[];let U=0;for(const[x,b]of y){O.push(e.jsx(Me,{count:b.length,ecosystem:b[0]?.kind==="ecosystem",name:x},`hdr-${x}`));for(const T of b){const W=U;O.push(e.jsx(De,{checked:a.has(A(T)),entry:T,isSelected:W===I},A(T))),U++}}let B=0;for(const[,x]of y)B+=2+x.length;const V=B>m&&m>0;return e.jsxs(l,{borderColor:F,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[e.jsxs(l,{flexShrink:0,gap:1,paddingX:1,children:[e.jsx(r,{bold:!0,inverse:!0,children:" VIS "}),e.jsxs(r,{wrap:"truncate",children:[w>0?k:H,E>0?`/${E}`:""," ",w>0?"pkgs":"outdated",N,D>E?` · ${D-E} dupes`:""]}),w>0&&e.jsxs(r,{color:"cyan",children:[" ","◈"," ",w," ","ci/cd"]}),!p&&$>0&&e.jsxs(r,{dimColor:!0,children:[" ","—",$," ","selected"]})]}),e.jsx(l,{flexShrink:0,paddingX:1,paddingY:1,children:e.jsx(we,{isFocused:f,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:()=>{},showIndex:!1,value:h,children:Ie.map(({id:x,label:b})=>e.jsx(Ce,{name:x,children:b},x))})}),i&&e.jsxs(l,{flexShrink:0,paddingX:1,children:[e.jsx(r,{bold:!0,color:"white",children:"/ "}),e.jsx(r,{children:d}),e.jsx(r,{inverse:!0,children:" "})]}),s>0&&e.jsx(l,{flexShrink:0,paddingX:1,children:e.jsxs(r,{color:"yellow",children:["⚠"," ",s," ","package",s===1?"":"s"," ","filtered out by target constraint — press"," ",e.jsx(r,{bold:!0,color:"white",children:"f"})," ","to view"]})}),e.jsxs(l,{flexDirection:"row",flexGrow:1,overflow:"hidden",ref:v,children:[e.jsx(l,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:e.jsx(l,{flexDirection:"column",marginTop:-n,children:O})}),V&&e.jsx(l,{flexShrink:0,marginLeft:1,marginRight:1,children:e.jsx(ge,{contentHeight:B,placement:"inset",scrollOffset:n,style:"block",viewportHeight:m})})]},`list-${h}-${d}`)]})},Be=100,Le=40,Fe=10,Pe=[],K=["all","major","minor","patch","security"],Ve=({autoExitSeconds:a=0,changelogUrls:t,checkedCount:i=0,filteredOutEntries:s=Pe,isDryRun:d,store:h,totalCatalogEntries:f=0})=>{const{exit:y}=me(),{columns:p,rows:j}=ae(),n=g.useSyncExternalStore(h.subscribe,h.getSnapshot),[I,D]=g.useState(!1),[E,H]=g.useState(!1),L=g.useRef(null),F=g.useRef(null),m=g.useRef(null),v=g.useRef(null),[P,S]=g.useState(0),[M,R]=g.useState(!1),[C,N]=g.useState(!1),w=g.useMemo(()=>h.getFilteredEntries(),[n.entries,n.filterType,n.filterText,n.sortMode]),k=w[n.selectedIndex]??null,$=k?h.getRecommendation(k.packageName):void 0,O=k&&t?t.get(k.packageName):void 0,U=g.useCallback(o=>{let c=0,u=0;for(const[,Q]of n.groupedByCatalog){c+=2;for(let oe=0;oe<Q.length;oe++){if(u===o)return c;c+=1,u++}}return c},[n.groupedByCatalog]),B=Math.max(1,j-8-(n.filterActive?1:0)),[V,x]=g.useState(B),b=V>0?V:B,T=g.useCallback(o=>{const c=U(o);S(u=>c>u+b-2?Math.max(0,c-b+2):c<u+1?Math.max(0,c-1):u)},[U,b]);if(g.useEffect(()=>{m.current?.scrollToTop()},[k?.packageName]),fe((o,c)=>{if(o==="c"&&c.ctrl){y();return}if(!C){if(E){c.escape||o==="f"||o==="q"?H(!1):c.downArrow||o==="j"?F.current?.scrollBy(1):(c.upArrow||o==="k")&&F.current?.scrollBy(-1);return}if(M){o==="u"||c.return?(R(!1),h.startApply(),y(h.getCheckedEntries())):c.escape||o==="q"?R(!1):c.downArrow||o==="j"?v.current?.scrollBy(1):c.upArrow||o==="k"?v.current?.scrollBy(-1):c.pageDown?v.current?.scrollBy(5):c.pageUp&&v.current?.scrollBy(-5);return}if(I){c.escape||o==="?"?D(!1):o==="q"?(D(!1),N(!0)):c.downArrow||o==="j"?L.current?.scrollBy(1):(c.upArrow||o==="k")&&L.current?.scrollBy(-1);return}if(o==="?"){D(!0);return}if(o==="q"){N(!0);return}if(c.tab){h.setFocusedPanel(n.focusedPanel==="list"?"detail":"list");return}if(n.focusedPanel==="list"&&(c.leftArrow||c.rightArrow)){const u=K.indexOf(n.filterType),Q=c.rightArrow?(u+1)%K.length:(u-1+K.length)%K.length;S(0),m.current?.scrollToTop(),h.setFilterType(K[Q]);return}if(o==="f"&&s.length>0){H(u=>!u);return}if(n.filterActive){if(c.escape){h.setFilterActive(!1);return}if(c.return){h.setFilterActive(!1);return}if(c.backspace){S(0),h.setFilter(n.filterText.slice(0,-1));return}if(o&&!c.ctrl&&!c.meta){S(0),h.setFilter(n.filterText+o);return}return}if(n.focusedPanel==="list"){if(c.downArrow||o==="j"){const u=Math.min(n.selectedIndex+1,w.length-1);h.setSelectedIndex(u),T(u);return}if(c.upArrow||o==="k"){const u=Math.max(n.selectedIndex-1,0);h.setSelectedIndex(u),T(u);return}if(c.pageDown){const u=Math.min(n.selectedIndex+10,w.length-1);h.setSelectedIndex(u),T(u);return}if(c.pageUp){const u=Math.max(n.selectedIndex-10,0);h.setSelectedIndex(u),T(u);return}if(c.home){h.setSelectedIndex(0),S(0);return}if(c.end){const u=w.length-1;h.setSelectedIndex(u),T(u);return}if(o===" "||c.return){k&&h.toggleCheck(k);return}if(o==="a"){h.toggleAll();return}if(o==="s"){h.cycleSortMode(),T(h.getSnapshot().selectedIndex);return}if(o==="/"){h.setFilterActive(!0);return}if(o==="u"&&!d&&n.checkedEntries.size>0){R(!0);return}if(c.rightArrow){h.setFocusedPanel("detail");return}return}if(n.focusedPanel==="detail"){if(c.escape||c.leftArrow){h.setFocusedPanel("list");return}if(c.downArrow||o==="j"){m.current?.scrollBy(1);return}if(c.upArrow||o==="k"){m.current?.scrollBy(-1);return}if(c.pageDown){m.current?.scrollBy(10);return}if(c.pageUp){m.current?.scrollBy(-10);return}if(c.home){m.current?.scrollToTop();return}c.end&&m.current?.scrollToBottom()}}},{isActive:!0}),p<Le||j<Fe)return e.jsx(l,{alignItems:"center",height:j,justifyContent:"center",width:p,children:e.jsxs(r,{color:"yellow",children:["Terminal too small (",p,"x",j,")"]})});const W=p>=Be,q=[e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"q"}),e.jsx(r,{dimColor:!0,children:"QUIT"})]},"q"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"?"}),e.jsx(r,{dimColor:!0,children:"HELP"})]},"?"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"}),e.jsx(r,{dimColor:!0,children:"NAV"})]},"nav"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"Space"}),e.jsx(r,{dimColor:!0,children:"CHECK"})]},"sp"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"a"}),e.jsx(r,{dimColor:!0,children:"ALL"})]},"a")];!d&&n.checkedEntries.size>0&&q.push(e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"green",children:"u"}),e.jsx(r,{dimColor:!0,children:"APPLY"})]},"u")),s.length>0&&q.push(e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"yellow",children:"f"}),e.jsxs(r,{dimColor:!0,children:["FILTERED (",s.length,")"]})]},"fo")),q.push(e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"←→"}),e.jsx(r,{dimColor:!0,children:"FILTER"})]},"lr"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"/"}),e.jsx(r,{dimColor:!0,children:"SEARCH"})]},"f"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"Tab"}),e.jsx(r,{dimColor:!0,children:"PANEL"})]},"t"));const ee=e.jsx(l,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:e.jsx(l,{flexWrap:"wrap",gap:2,paddingX:1,children:q})}),re=e.jsxs(_,{footer:e.jsxs(r,{dimColor:!0,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",e.jsx(r,{bold:!0,color:"white",children:"?"}),"/",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:L,title:"KEYBOARD SHORTCUTS",visible:I,width:52,children:[e.jsxs(l,{flexDirection:"column",marginBottom:1,children:[e.jsxs(l,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"NAVIGATION"})]}),e.jsxs(l,{children:[e.jsx(l,{width:24,children:e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","↑","/k"]}),e.jsx(r,{dimColor:!0,children:" Move up"})]})}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","↓","/j"]}),e.jsx(r,{dimColor:!0,children:" Move down"})]})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","Tab"]}),e.jsx(r,{dimColor:!0,children:" Switch panel"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","→","/","←"]}),e.jsx(r,{dimColor:!0,children:" Focus detail/list"})]})]}),e.jsxs(l,{flexDirection:"column",marginBottom:1,children:[e.jsxs(l,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"SELECTION"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","Space"]}),e.jsx(r,{dimColor:!0,children:" Toggle check on package"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","a"]}),e.jsx(r,{dimColor:!0,children:" Toggle check all"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","s"]}),e.jsx(r,{dimColor:!0,children:" Cycle sort (default / name / type / severity)"})]})]}),e.jsxs(l,{flexDirection:"column",marginBottom:1,children:[e.jsxs(l,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"FILTERS"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","←→"]}),e.jsx(r,{dimColor:!0,children:" Switch filter tab"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","/"]}),e.jsx(r,{dimColor:!0,children:" Text filter"})]}),s.length>0&&e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","f"]}),e.jsx(r,{dimColor:!0,children:" View filtered-out packages"})]})]}),e.jsxs(l,{flexDirection:"column",children:[e.jsxs(l,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"ACTIONS"})]}),!d&&e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","u"]}),e.jsx(r,{dimColor:!0,children:" Apply selected updates"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","q"]}),e.jsx(r,{dimColor:!0,children:" Quit"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","?"]}),e.jsx(r,{dimColor:!0,children:" Toggle help"})]})]})]}),X=h.getCheckedEntries(),z=X.filter(o=>o.updateType==="major").length,xe=e.jsxs(l,{alignItems:"center",flexDirection:"column",children:[z>0&&e.jsx(l,{marginBottom:1,marginTop:1,children:e.jsxs(r,{color:"yellow",children:["⚠"," ",z," ","major update",z===1?"":"s"," ","— review breaking changes"]})}),e.jsxs(r,{dimColor:!0,children:["Press"," ",e.jsx(r,{bold:!0,color:"white",children:"u"})," ","or"," ",e.jsx(r,{bold:!0,color:"white",children:"Enter"})," ","to confirm,"," ",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","to cancel"]})]}),te=e.jsx(_,{footer:xe,scrollRef:v,title:`Apply ${X.length} update${X.length===1?"":"s"}?`,visible:M,width:70,children:X.map(o=>e.jsxs(l,{gap:1,children:[e.jsxs(r,{children:[" ",o.displayName??o.packageName]}),e.jsxs(r,{dimColor:!0,children:[o.currentRange," ","→"," ",o.newRange]}),e.jsx(r,{bold:!0,color:o.updateType==="major"?"red":o.updateType==="minor"?"yellow":"green",children:o.updateType})]},o.packageName))}),le=s.length>0?e.jsx(_,{footer:e.jsxs(r,{dimColor:!0,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",e.jsx(r,{bold:!0,color:"white",children:"f"}),"/",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:F,title:`${s.length} PACKAGE${s.length===1?"":"S"} FILTERED BY TARGET`,visible:E,width:70,children:e.jsxs(l,{flexDirection:"column",children:[e.jsx(l,{marginBottom:1,children:e.jsxs(r,{dimColor:!0,children:["These packages have newer versions available but are excluded by the current target constraint. Use"," ",e.jsx(r,{bold:!0,color:"white",children:"--target latest"})," ","to include them."]})}),s.map(o=>e.jsxs(l,{gap:1,children:[e.jsxs(r,{children:[" ",o.packageName]}),e.jsxs(r,{dimColor:!0,children:[o.currentRange," ","→"," ",o.newRange]}),e.jsx(r,{bold:!0,color:o.updateType==="major"?"red":o.updateType==="minor"?"yellow":"green",children:o.updateType})]},o.packageName))]})}):null,se=e.jsx(Ne,{checkedEntries:n.checkedEntries,entries:w,filterActive:n.filterActive,filteredOutCount:s.length,filterText:n.filterText,filterType:n.filterType,focused:n.focusedPanel==="list",groupedByCatalog:n.groupedByCatalog,isDryRun:d,onViewportHeightChange:x,scrollOffset:P,selectedIndex:n.selectedIndex,totalCatalogEntries:f,totalChecked:i,totalEntries:w.length,viewportHeight:b}),ie=e.jsx(Re,{changelogUrl:O,entry:k,focused:n.focusedPanel==="detail",recommendation:$,scrollRef:m});if(W){const o=Math.floor(p*.35);return e.jsxs(l,{flexDirection:"column",height:j,width:p,children:[e.jsxs(l,{flexDirection:"row",flexGrow:1,children:[e.jsx(l,{flexGrow:1,children:se}),e.jsx(l,{width:o,children:ie})]}),ee,te,le,e.jsx(ne,{autoExitSeconds:a||3,onCancel:()=>{N(!1)},visible:C}),re]})}const pe=Math.floor(j*.55);return e.jsxs(l,{flexDirection:"column",height:j,width:p,children:[e.jsx(l,{height:pe,children:se}),e.jsx(l,{flexGrow:1,children:ie}),ee,te,le,e.jsx(ne,{autoExitSeconds:a||3,onCancel:()=>{N(!1)},visible:C}),re]})};export{He as U,Ve as b,Z as e,Ke as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as b}from"node:module";import{B as v,H as T,y as W}from"./index-OQZQyN5R.js";import{p as h}from"../packem_chunks/cli-main.js";const $=b(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=a=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[n,o]=m.versions.node.split(".").map(Number);if(n>22||n===22&&o>=3||n===20&&o>=16)return m.getBuiltinModule(a)}return $(a)},{watch:y}=p("node:fs"),{execFileSync:j}=p("node:child_process"),{createRequire:S}=p("node:module"),_=S(import.meta.url);let w;const k=()=>{if(w!==void 0)return w;try{_.resolve("fb-watchman")}catch{return w=!1,!1}try{j("watchman",["--version"],{stdio:"ignore",timeout:2e3})}catch{return w=!1,!1}return w=!0,!0},q=(a,n)=>{if(!k())return;let o;try{o=_("fb-watchman")}catch(s){h.warn(`[vis watch] fb-watchman failed to load, using native watcher: ${s.message}`);return}const c=new o.Client;c.on("error",s=>{h.warn(`[vis watch] watchman error: ${s.message}`)}),c.on("subscription",s=>{const t=s;if(!t.is_fresh_instance)for(const e of t.files??[])n(e)});for(const[s,t]of a.entries()){const e=v(t),i=`vis-watch-${s}-${process.pid}`;c.command(["watch-project",e],(l,f)=>{if(l){h.warn(`[vis watch] watchman could not watch ${t}: ${l.message}`);return}const u={expression:["allof",["type","f"]],fields:["name"]};f.relative_path&&(u.relative_root=f.relative_path),c.command(["subscribe",f.watch,i,u],r=>{r&&h.warn(`[vis watch] watchman subscribe failed for ${t}: ${r.message}`)})})}return{close:()=>{try{c.end()}catch{}}}},x=[/node_modules(?:\/|$)/,/\.git(?:\/|$)/,/\.vis(?:\/|$)/],R=(a,n)=>{const o=new Set,c=new Set;for(const[,e]of a){const i=e.task.hashDetails?.nodes;if(i)for(const l of Object.keys(i))o.add(l),c.add(T(v(n,l)))}const s=[...c].sort(),t=[];for(const e of s)t.some(i=>e===i||e.startsWith(`${i}/`))||t.push(e);return{directories:t,files:o}},P=(a,n,o)=>{const c=new Set;for(const s of a){const t=v(n,s);for(const e of o)if(t===e||t.startsWith(`${e}/`)){const i=W(e,t);i.length>0&&c.add(i)}}return s=>{const t=s.replaceAll("\\","/");return c.has(t)}},A=a=>{const n=a.replaceAll("\\","/");return x.some(o=>o.test(n))},D=a=>{const{debounceMs:n=150,filter:o,onChange:c,paths:s}=a;let t=new Set,e;const i=()=>{e=void 0;const r=[...t];t=new Set,r.length!==0&&Promise.resolve(c(r)).catch(d=>{h.error("[vis watch] onChange handler failed:",d)})},l=r=>{A(r)||o&&!o(r)||(t.add(r),e&&clearTimeout(e),e=setTimeout(i,n))},f=q(s,l);if(f)return{close:()=>{e&&clearTimeout(e),f.close()}};const u=[];for(const r of s)try{const d=y(r,{recursive:!0},(B,g)=>{g&&l(g)});u.push(d)}catch(d){h.warn(`[vis watch] unable to watch ${r}: ${d.message}`)}return{close:()=>{e&&clearTimeout(e);for(const r of u)try{r.close()}catch{}}}};export{P as a,R as c,D as s};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{createRequire as K}from"node:module";import{m as g,f as C,v as H,A as S,B as U,a as Q,H as X}from"./index-OQZQyN5R.js";import{aG as w}from"../packem_chunks/cli-main.js";import{a as ee}from"./readJsonSync-CvkZyKmL-CY7PZob_.js";import{s as le}from"./watch-Bkp_AAbc.js";const G=K(import.meta.url),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=e=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[t,s]=x.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return x.getBuiltinModule(e)}return G(e)},{createHash:m}=v("node:crypto"),{fileURLToPath:Y,pathToFileURL:Z}=v("node:url"),{spawnSync:te,spawn:se}=v("node:child_process"),{openSync:ne,writeSync:re,closeSync:oe,statSync:ie,readFileSync:N,mkdirSync:ae,writeFileSync:ce}=v("node:fs"),{availableParallelism:b}=v("node:os"),W=(e,t)=>{for(const s of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const n=e[s];if(n&&typeof n[t]=="string")return n[t]}},k=(e,t)=>{for(const s of t){const n=g(e,s);if(C(n))return n}},ue=e=>{const t=g(e,"package.json");if(!C(t))return{};try{return ee(t)}catch{return{}}},tt=(e,t)=>{const s=ue(e),n=new Map;for(const o of t){const r=o.detect(e,s);r&&n.set(o.id,r)}return n},de={error:"error",info:"info",information:"info",warning:"warning"},st={argsCheck:(e,t)=>j(e,t,!1),argsFix:(e,t)=>j(e,t,!0),bin:()=>["pnpm","exec","biome"],cacheKey:(e,t)=>{const s=["biome",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:(e,t)=>{const s=W(t,w.biome.packageNames[0]),n=k(e,w.biome.configFiles);if(!(!s&&!n))return{adapter:"biome",configFile:n,declared:!!s,declaredVersion:s,root:e}},extensions:["astro","cjs","css","cts","js","json","jsonc","jsx","mjs","mts","svelte","ts","tsx","vue"],id:"biome",kind:"both",parse:(e,t)=>{if(!e.stdout.trim())return[];let s;try{s=JSON.parse(e.stdout)}catch{return[{adapter:"biome",file:t.root,fixable:!1,message:`biome output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const n=[];for(const o of s.diagnostics??[]){const r=o.location?.start,i=o.location?.end,a=fe(t.root,o.location?.path),c=o.category??"",l=c==="format"||c.startsWith("format/");n.push({adapter:"biome",column:r?.column&&r.column>0?r.column:void 0,endColumn:i?.column&&i.column>0?i.column:void 0,endLine:i?.line&&i.line>0?i.line:void 0,file:a,fixable:!0,line:r?.line&&r.line>0?r.line:void 0,message:l?"Code style issues would be auto-fixed":o.message??"",ruleId:c||void 0,severity:de[o.severity??""]??"warning"})}return n}},j=(e,t,s)=>{const n=["check","--reporter=json"];return s&&n.push("--write"),typeof t.maxWarnings=="number"&&n.push(`--max-diagnostics=${String(t.maxWarnings)}`),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},fe=(e,t)=>{const s=typeof t=="string"?t:t?.file;return s?s.startsWith("/")||/^[a-z]:[\\/]/i.test(s)?s:g(e,s):e},B=e=>t=>{const s=k(t,w.deno.configFiles);if(s)return{adapter:e,configFile:s,declared:!1,root:t}},D=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),nt={argsCheck:(e,t)=>F(e,t,!1),argsFix:(e,t)=>F(e,t,!0),bin:()=>["deno","lint"],cacheKey:(e,t)=>{const s=["deno-lint",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:B("deno-lint"),extensions:["js","jsx","mjs","mts","ts","tsx"],id:"deno-lint",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let s;try{s=JSON.parse(e.stdout)}catch{return[{adapter:"deno-lint",file:t.root,fixable:!1,message:`deno lint output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const n=[];for(const o of s.diagnostics??[]){const r=o.range?.start,i=o.range?.end;n.push({adapter:"deno-lint",column:r?.col===void 0?void 0:r.col+1,endColumn:i?.col===void 0?void 0:i.col+1,endLine:i?.line===void 0?void 0:i.line+1,file:pe(o.filename??t.root,t.root),fixable:!1,line:r?.line===void 0?void 0:r.line+1,message:o.message??"",ruleId:o.code,severity:"warning"})}return n}},rt={argsCheck:(e,t)=>I(e,t,!1),argsFix:(e,t)=>I(e,t,!0),bin:()=>["deno","fmt"],cacheKey:(e,t)=>{const s=["deno-fmt",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:B("deno-fmt"),extensions:["astro","cjs","css","cts","html","ipynb","js","json","jsonc","jsx","less","md","mjs","mts","sass","scss","sql","svelte","ts","tsx","vue","yaml","yml"],id:"deno-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const s=[],n=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=/^from (.+):$/.exec(o);if(!r)continue;const i=r[1];n.has(i)||(n.add(i),s.push({adapter:"deno-fmt",file:D(i)?i:`${t.root}/${i}`,fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return s}},F=(e,t,s)=>{const n=["--json"];return s&&n.push("--fix"),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},I=(e,t,s)=>{const n=[];return s||n.push("--check"),t.quiet&&n.push("--quiet"),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},pe=(e,t)=>e.startsWith("file://")?Y(e):D(e)?e:`${t}/${e}`,J="pyproject.toml",ge=/^\[tool\.ruff(?:\.[\w-]+)*\]\s*$/m,he=/^Would reformat:?\s+(.+)$/,me=e=>{const t=g(e,J);if(!C(t))return!1;try{const s=H(t);return ge.test(s)}catch{return!1}},E=e=>(t,s)=>{const n=w.ruff.packageNames.map(a=>W(s,a)).find(a=>a!==void 0),o=k(t,w.ruff.configFiles),r=o?void 0:me(t)?g(t,J):void 0,i=o??r;if(!(!n&&!i))return{adapter:e,configFile:i,declared:!!n,declaredVersion:n,root:t}},ye=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),P=(e,t)=>e?ye(e)?e:g(t,e):t,xe=e=>he.exec(e)?.[1]?.trim(),ot={argsCheck:(e,t)=>L(e,t,!1),argsFix:(e,t)=>L(e,t,!0),bin:()=>["ruff","check"],cacheKey:(e,t)=>{const s=["ruff-check",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:E("ruff-check"),extensions:["py","pyi"],id:"ruff-check",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let s;try{s=JSON.parse(e.stdout)}catch{return[{adapter:"ruff-check",file:t.root,fixable:!1,message:`ruff check output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const n=[];for(const o of s){const r=o.location,i=o.end_location;n.push({adapter:"ruff-check",column:r?.column,endColumn:i?.column,endLine:i?.row,file:P(o.filename,t.root),fixable:!!o.fix,line:r?.row,message:o.message??"",ruleId:o.code,severity:"warning"})}return n}},it={argsCheck:(e,t)=>R(e,t,!1),argsFix:(e,t)=>R(e,t,!0),bin:()=>["ruff","format"],cacheKey:(e,t)=>{const s=["ruff-fmt",e.declaredVersion??"unknown",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:E("ruff-fmt"),extensions:["py","pyi"],id:"ruff-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const s=[],n=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=xe(o);!r||n.has(r)||(n.add(r),s.push({adapter:"ruff-fmt",file:P(r,t.root),fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return s}},L=(e,t,s)=>{const n=["--output-format=json"];return s&&n.push("--fix"),t.quiet&&n.push("--quiet"),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},R=(e,t,s)=>{const n=[];return s||n.push("--check"),t.quiet&&n.push("--quiet"),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},at=(e,t)=>{const s=$(e,["diff","--name-only","--diff-filter=ACMR","-z",`${t}...HEAD`]);if(s===void 0)return;const n=$(e,["diff","--name-only","--diff-filter=ACMR","-z"]),o=$(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]),r=$(e,["ls-files","--others","--exclude-standard","-z"]),i=new Set;for(const a of[s,n??"",o??"",r??""])for(const c of a.split("\0"))c.length!==0&&i.add(S(c)?c:g(e,c));return[...i].sort()},ct=e=>{const t=$(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]);if(t===void 0)return;const s=new Set;for(const n of t.split("\0"))n.length!==0&&s.add(S(n)?n:g(e,n));return[...s].sort()},$=(e,t)=>{const s=te("git",[...t],{cwd:e,encoding:"utf8",timeout:1e4});if(s.status===0)return s.stdout},lt=(e,t)=>{const s=new Set(t.map(r=>r.toLowerCase())),n=[],o=new Set;for(const r of e){const i=r.lastIndexOf(".");if(i===-1||i===r.length-1)continue;const a=r.slice(i+1).toLowerCase();s.has(a)&&(o.has(r)||(o.add(r),n.push(r)))}return n},$e=new Set(["-","stdout"]),M=e=>({close:()=>{},write:t=>{e.write(t)}}),we=e=>{Q(X(e));const t=ne(e,"w");let s=[];return{close:()=>{s.length>0&&(re(t,s.join("")),s=[]),oe(t)},write:n=>{s.push(n)}}},ut=e=>{const{cwd:t,target:s}=e;if(s===void 0||$e.has(s))return M(process.stdout);if(s==="stderr")return M(process.stderr);const n=S(s)?s:U(t,s);return we(n)},q=["oxlint","oxfmt","biome","eslint","dprint","prettier","stylelint","ruff-check","ruff-fmt","markdownlint","shellcheck","deno-lint","deno-fmt"],dt=(e,t)=>{const s=new Map(e.map(i=>[i.id,i])),n=[],o=new Set,r=t&&t.length>0?t:q;for(const i of r){const a=s.get(i);a&&!o.has(i)&&(n.push(a),o.add(i))}if(t&&t.length>0)for(const i of q){const a=s.get(i);a&&!o.has(i)&&(n.push(a),o.add(i))}for(const i of e)o.has(i.id)||(n.push(i),o.add(i.id));return n},ft=(e,t,s)=>{const n=[];for(const o of t){const r=e.get(o.id);r&&ve(o.kind,s)&&n.push({adapter:o,presence:r})}return n},ve=(e,t)=>e===t||e==="both",pt=(e,t,s={})=>{const n=new Map;for(const o of e){const r=Se(o),i=Ae(r,t,s);if(!i)continue;const a=n.get(i);a?a.push(o):n.set(i,[o])}return n},Se=e=>{const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()},Ae=(e,t,s)=>{const n=s[e];if(n&&t.some(o=>o.adapter.id===n))return n;for(const{adapter:o}of t)if(o.extensions.includes(e))return o.id},Ce=e=>e==="error"?"error":e==="warning"?"warning":"notice",V=e=>e.replaceAll("%","%25").replaceAll("\r","%0D").replaceAll(`
|
|
2
|
+
`,"%0A"),T=e=>V(e).replaceAll(",","%2C").replaceAll(":","%3A").replaceAll("=","%3D"),ke=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,be=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),je=(e,t)=>{const s=Ce(e.severity),n=ke(e.file,t),o=e.ruleId?`${e.adapter}(${e.ruleId})`:e.adapter,r=[`file=${T(n)}`];return e.line!==void 0&&r.push(`line=${String(e.line)}`),e.endLine!==void 0&&r.push(`endLine=${String(e.endLine)}`),e.column!==void 0&&r.push(`col=${String(e.column)}`),e.endColumn!==void 0&&r.push(`endColumn=${String(e.endColumn)}`),r.push(`title=${T(o)}`),`::${s} ${r.join(",")}::${V(e.message)}
|
|
3
|
+
`},gt=e=>e.runs.flatMap(t=>[...t.findings]).sort(be).map(t=>je(t,e.workspaceRoot)).join(""),y=e=>e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'"),Fe=e=>`<![CDATA[${e.replaceAll("]]>","]]]]><![CDATA[>")}]]>`,Ie=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),Le=e=>e==="error"?"error":e==="warning"?"warning":"info",Re=(e,t)=>{let{file:s}=e;return t&&e.file.startsWith(`${t}/`)&&(s=e.file.slice(t.length+1)),e.line===void 0?s:e.column===void 0?`${s}:${String(e.line)}`:`${s}:${String(e.line)}:${String(e.column)}`},Me=(e,t,s)=>{const n=Re(e,s),o=Le(e.severity),r=e.ruleId?`[${e.ruleId}] ${e.message}`:e.message;return[` <testcase classname="${y(t)}" name="${y(n)}">`,` <failure type="${y(o)}" message="${y(r)}">${Fe(e.message)}</failure>`," </testcase>",""].join(`
|
|
4
|
+
`)},qe=(e,t,s)=>{const n=[...e.findings].sort(Ie),o=n.filter(l=>l.severity==="error").length,r=n.filter(l=>l.severity==="warning").length,i=n.length,a=(e.durationMs/1e3).toFixed(3),c=n.map(l=>Me(l,e.adapter,s)).join("");return` <testsuite ${[`name="${y(e.adapter)}"`,`tests="${String(i)}"`,`failures="${String(o)}"`,'errors="0"',`skipped="${String(r)}"`,`time="${a}"`,`timestamp="${t}"`].join(" ")}>
|
|
5
|
+
${c} </testsuite>
|
|
6
|
+
`},ht=e=>{const t=(e.now??new Date).toISOString(),s=e.suiteName??"vis-lint-fmt",n=e.runs.map(c=>qe(c,t,e.workspaceRoot)).join(""),o=e.runs.reduce((c,l)=>c+l.findings.length,0),r=e.runs.reduce((c,l)=>c+l.findings.filter(p=>p.severity==="error").length,0),i=e.runs.reduce((c,l)=>c+l.findings.filter(p=>p.severity==="warning").length,0),a=(e.runs.reduce((c,l)=>c+l.durationMs,0)/1e3).toFixed(3);return`<?xml version="1.0" encoding="UTF-8"?>
|
|
7
|
+
<testsuites ${[`name="${y(s)}"`,`tests="${String(o)}"`,`failures="${String(r)}"`,'errors="0"',`skipped="${String(i)}"`,`time="${a}"`].join(" ")}>
|
|
8
|
+
${n}</testsuites>
|
|
9
|
+
`},Te="2.1.0",Oe="https://json.schemastore.org/sarif-2.1.0.json",_e=e=>e==="error"?"error":e==="warning"?"warning":"note",Ne=(e,t)=>t&&e.startsWith(`${t}/`)?{uri:e.slice(t.length+1),uriBaseId:"SRCROOT"}:{uri:e},We=e=>{const{href:t}=Z(e);return t.endsWith("/")?t:`${t}/`},Be=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),De=e=>{const t=new Map;for(const s of e)s.ruleId&&(t.has(s.ruleId)||t.set(s.ruleId,{id:s.ruleId,name:s.ruleId}));return[...t.values()]},Je=(e,t)=>{const{uri:s,uriBaseId:n}=Ne(e.file,t),o={artifactLocation:n?{uri:s,uriBaseId:n}:{uri:s}};if(e.line!==void 0){const i={startLine:e.line};e.column!==void 0&&(i.startColumn=e.column),e.endLine!==void 0&&(i.endLine=e.endLine),e.endColumn!==void 0&&(i.endColumn=e.endColumn),o.region=i}const r={level:_e(e.severity),locations:[{physicalLocation:o}],message:{text:e.message}};return e.ruleId&&(r.ruleId=e.ruleId),r},Ee=(e,t)=>{const s=[...e.findings].sort(Be),n=De(s),o={name:e.adapter,rules:n};e.presence?.declaredVersion&&(o.version=e.presence.declaredVersion);const r={results:s.map(i=>Je(i,t)),tool:{driver:o}};return t&&(r.originalUriBaseIds={SRCROOT:{uri:We(t)}}),r},mt=e=>{const t={$schema:Oe,runs:e.runs.map(s=>Ee(s,e.workspaceRoot)),version:Te};return`${JSON.stringify(t,void 0,2)}
|
|
10
|
+
`},O={error:3,info:1,warning:2},yt=e=>{const t=[],s=[];let n,o=!1;for(const r of e){s.push({adapter:r.adapter,durationMs:r.durationMs,exitCode:r.exitCode,findingCount:r.findings.length}),r.exitCode!==0&&r.exitCode!==null&&r.findings.length===0&&(o=!0);for(const i of r.findings)t.push(i),(!n||O[i.severity]>O[n])&&(n=i.severity)}return{findings:t,hadProcessFailure:o,maxSeverity:n,runs:s}},xt=e=>{const t=new Map;for(const s of e){const n=t.get(s.file);n?n.push(s):t.set(s.file,[s])}return t},$t=e=>e.hadProcessFailure||e.maxSeverity==="error"?1:0,Pe=(e,t)=>{if(t==="fix"||process.env.VIS_NO_CACHE==="1"||e.length===0)return!1;for(const s of e)if(s==="."||s==="./"||s==="..")return!1;return!0},Ve=e=>{try{const t=N(e);return m("sha256").update(t).digest("hex")}catch{return}},ze=(e,t,s,n,o)=>{const r=e.cacheKey(t,n),i=[];for(const c of[...s].sort()){const l=S(c)?c:g(t.root,c);try{ie(l)}catch{return}const p=Ve(l);if(!p)return;i.push({hash:p,path:l})}const a=m("sha256");a.update(e.id),a.update("\0"),a.update(r),a.update("\0"),a.update(o);for(const c of i)a.update("\0"),a.update(c.path),a.update("\0"),a.update(c.hash);return{fileHashes:i,key:a.digest("hex")}},z=(e,t)=>g(e,"lint-fmt",t),Ke=(e,t,s)=>{const n=g(z(e,t.id),`${s}.json`);try{const o=N(n,"utf8"),r=JSON.parse(o);return r.schema!==1?void 0:r}catch{return}},Ge=(e,t,s,n,o)=>{const r=z(e,t.id),i={fileHashes:o,result:n,savedAt:Date.now(),schema:1};try{ae(r,{recursive:!0}),ce(g(r,`${s}.json`),JSON.stringify(i))}catch{}},_=async(e,t,s,n,o)=>{const r=e.bin(t),i=[...r.slice(1),...o==="fix"?e.argsFix(s,n):e.argsCheck(s,n)];return new Promise(a=>{const c=Date.now(),l=se(r[0],i,{cwd:t.root}),p=[],u=[];let h=!1;const f=setTimeout(()=>{h=!0,l.kill("SIGKILL")},6e4);l.stdout.on("data",d=>p.push(d)),l.stderr.on("data",d=>u.push(d)),l.on("error",d=>{clearTimeout(f),a({durationMs:Date.now()-c,exitCode:null,stderr:d.message,stdout:""})}),l.on("close",d=>{clearTimeout(f),a({durationMs:Date.now()-c,exitCode:h?null:d,stderr:Buffer.concat(u).toString("utf8"),stdout:Buffer.concat(p).toString("utf8")})})})},wt=async(e,t,s,n=b())=>{if(e.length===0)return[];const{cacheRoot:o,concurrency:r}=typeof n=="number"?{concurrency:n}:{cacheRoot:n.cacheRoot,concurrency:n.concurrency??b()},i=async u=>{const h=u.options??t;if(o&&Pe(u.files,s)){const f=ze(u.adapter,u.presence,u.files,h,s);if(f){const d=Ke(o,u.adapter,f.key);if(d)return d.result;const A=await _(u.adapter,u.presence,u.files,h,s);return A.exitCode!==null&&Ge(o,u.adapter,f.key,A,f.fileHashes),A}}return _(u.adapter,u.presence,u.files,h,s)};if(process.env.VIS_LINT_FMT_SERIAL==="1"){const u=[];for(const h of e)u.push(await i(h));return u}const a=Math.max(1,Math.min(r,e.length)),c=Array.from({length:e.length});let l=0;const p=async()=>{for(;;){const u=l;if(l+=1,u>=e.length)return;c[u]=await i(e[u])}};return await Promise.all(Array.from({length:a},()=>p())),c},He=e=>{const t=new Set;for(const s of e)t.add(s.toLowerCase());return t},Ue=(e,t)=>{const s=e.lastIndexOf(".");return s===-1||s===e.length-1?!1:t.has(e.slice(s+1).toLowerCase())},vt=async e=>{const{extensions:t,initialFiles:s,label:n,log:o,runCycle:r,workspaceRoot:i}=e,a=o??(f=>{process.stdout.write(`${f}
|
|
11
|
+
`)}),c=He(t);await r(s),a(`▸ ${n}: watching workspace — press Ctrl-C to exit`);let l=new Set,p=!1;const u=async()=>{for(;l.size>0;){const f=[...l];l=new Set;try{await r(f)}catch(d){a(`✗ ${n}: watch cycle failed — ${d.message}`)}}},h=le({debounceMs:200,filter:f=>Ue(f,c),onChange:async f=>{for(const d of f)l.add(S(d)?d:g(i,d));if(!p){p=!0;try{await u()}finally{p=!1}}},paths:[i]});await new Promise(f=>{const d=()=>{h.close(),process.off("SIGINT",d),process.off("SIGTERM",d),f()};process.once("SIGINT",d),process.once("SIGTERM",d)})};export{tt as a,ft as b,at as c,W as d,vt as e,k as f,pt as g,wt as h,yt as i,ut as j,mt as k,ht as l,gt as m,st as n,it as o,rt as p,xt as q,dt as r,ct as s,$t as t,lt as u,ot as v,nt as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as r}from"../packem_shared/compile-cache-B_Vf_WxT.js";import{p as o}from"../packem_shared/augment-8fIWWGSc.js";import{registerTsHooks as p}from"../packem_chunks/ts-loader.js";r();p();await o(process.cwd());
|
package/index.d.ts
CHANGED
|
@@ -255,6 +255,8 @@ export interface InstallOptions {
|
|
|
255
255
|
* `advisories_status`. Backed by bundled SQLite (rusqlite) + zip.
|
|
256
256
|
* 5 — added osv-bloom prefilter: `osv_bloom_decode`, `osv_bloom_probe`,
|
|
257
257
|
* `osv_bloom_probe_batch`. Backed by `blake3` keyed-hash double-hashing.
|
|
258
|
+
* 6 — added `transform_ts`: oxc-based TS/JSX → JS transpile for the runtime
|
|
259
|
+
* loader (config / generators / `vis x`), replacing the `jiti` dependency.
|
|
258
260
|
*/
|
|
259
261
|
export const NATIVE_BINDING_VERSION: number
|
|
260
262
|
|
|
@@ -414,6 +416,18 @@ export declare function tagsFromPath(path: string): Array<string>
|
|
|
414
416
|
*/
|
|
415
417
|
export declare function tagsFromPaths(paths: Array<string>): Array<Array<string>>
|
|
416
418
|
|
|
419
|
+
export interface TransformResult {
|
|
420
|
+
/** Transpiled JavaScript source. */
|
|
421
|
+
code: string
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Transpile a TS/TSX/JS/JSX source string to JavaScript. `filename` selects the
|
|
426
|
+
* source dialect by extension (`.ts`/`.tsx`/`.mts`/`.cts`/`.js`/...). Returns the
|
|
427
|
+
* emitted JS; throws on a fatal parse failure.
|
|
428
|
+
*/
|
|
429
|
+
export declare function transformTs(filename: string, source: string): TransformResult
|
|
430
|
+
|
|
417
431
|
/**
|
|
418
432
|
* Finds the full path to a binary using `which`-style lookup.
|
|
419
433
|
* Returns None if not found.
|
package/index.js
CHANGED
|
@@ -82,7 +82,7 @@ function requireNative() {
|
|
|
82
82
|
const binding = require('@visulima/vis-binding-android-arm64')
|
|
83
83
|
const bindingPackageVersion = require('@visulima/vis-binding-android-arm64/package.json').version
|
|
84
84
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
85
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
85
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
86
86
|
}
|
|
87
87
|
return binding
|
|
88
88
|
} catch (e) {
|
|
@@ -98,7 +98,7 @@ function requireNative() {
|
|
|
98
98
|
const binding = require('@visulima/vis-binding-android-arm-eabi')
|
|
99
99
|
const bindingPackageVersion = require('@visulima/vis-binding-android-arm-eabi/package.json').version
|
|
100
100
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
101
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
101
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
102
102
|
}
|
|
103
103
|
return binding
|
|
104
104
|
} catch (e) {
|
|
@@ -119,7 +119,7 @@ function requireNative() {
|
|
|
119
119
|
const binding = require('@visulima/vis-binding-win32-x64-gnu')
|
|
120
120
|
const bindingPackageVersion = require('@visulima/vis-binding-win32-x64-gnu/package.json').version
|
|
121
121
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
122
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
122
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
123
123
|
}
|
|
124
124
|
return binding
|
|
125
125
|
} catch (e) {
|
|
@@ -135,7 +135,7 @@ function requireNative() {
|
|
|
135
135
|
const binding = require('@visulima/vis-binding-win32-x64-msvc')
|
|
136
136
|
const bindingPackageVersion = require('@visulima/vis-binding-win32-x64-msvc/package.json').version
|
|
137
137
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
138
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
138
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
139
139
|
}
|
|
140
140
|
return binding
|
|
141
141
|
} catch (e) {
|
|
@@ -152,7 +152,7 @@ function requireNative() {
|
|
|
152
152
|
const binding = require('@visulima/vis-binding-win32-ia32-msvc')
|
|
153
153
|
const bindingPackageVersion = require('@visulima/vis-binding-win32-ia32-msvc/package.json').version
|
|
154
154
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
155
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
155
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
156
156
|
}
|
|
157
157
|
return binding
|
|
158
158
|
} catch (e) {
|
|
@@ -168,7 +168,7 @@ function requireNative() {
|
|
|
168
168
|
const binding = require('@visulima/vis-binding-win32-arm64-msvc')
|
|
169
169
|
const bindingPackageVersion = require('@visulima/vis-binding-win32-arm64-msvc/package.json').version
|
|
170
170
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
171
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
171
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
172
172
|
}
|
|
173
173
|
return binding
|
|
174
174
|
} catch (e) {
|
|
@@ -187,7 +187,7 @@ function requireNative() {
|
|
|
187
187
|
const binding = require('@visulima/vis-binding-darwin-universal')
|
|
188
188
|
const bindingPackageVersion = require('@visulima/vis-binding-darwin-universal/package.json').version
|
|
189
189
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
190
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
190
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
191
191
|
}
|
|
192
192
|
return binding
|
|
193
193
|
} catch (e) {
|
|
@@ -203,7 +203,7 @@ function requireNative() {
|
|
|
203
203
|
const binding = require('@visulima/vis-binding-darwin-x64')
|
|
204
204
|
const bindingPackageVersion = require('@visulima/vis-binding-darwin-x64/package.json').version
|
|
205
205
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
206
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
206
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
207
207
|
}
|
|
208
208
|
return binding
|
|
209
209
|
} catch (e) {
|
|
@@ -219,7 +219,7 @@ function requireNative() {
|
|
|
219
219
|
const binding = require('@visulima/vis-binding-darwin-arm64')
|
|
220
220
|
const bindingPackageVersion = require('@visulima/vis-binding-darwin-arm64/package.json').version
|
|
221
221
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
222
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
222
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
223
223
|
}
|
|
224
224
|
return binding
|
|
225
225
|
} catch (e) {
|
|
@@ -239,7 +239,7 @@ function requireNative() {
|
|
|
239
239
|
const binding = require('@visulima/vis-binding-freebsd-x64')
|
|
240
240
|
const bindingPackageVersion = require('@visulima/vis-binding-freebsd-x64/package.json').version
|
|
241
241
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
242
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
242
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
243
243
|
}
|
|
244
244
|
return binding
|
|
245
245
|
} catch (e) {
|
|
@@ -255,7 +255,7 @@ function requireNative() {
|
|
|
255
255
|
const binding = require('@visulima/vis-binding-freebsd-arm64')
|
|
256
256
|
const bindingPackageVersion = require('@visulima/vis-binding-freebsd-arm64/package.json').version
|
|
257
257
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
258
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
258
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
259
259
|
}
|
|
260
260
|
return binding
|
|
261
261
|
} catch (e) {
|
|
@@ -276,7 +276,7 @@ function requireNative() {
|
|
|
276
276
|
const binding = require('@visulima/vis-binding-linux-x64-musl')
|
|
277
277
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-x64-musl/package.json').version
|
|
278
278
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
279
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
279
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
280
280
|
}
|
|
281
281
|
return binding
|
|
282
282
|
} catch (e) {
|
|
@@ -292,7 +292,7 @@ function requireNative() {
|
|
|
292
292
|
const binding = require('@visulima/vis-binding-linux-x64-gnu')
|
|
293
293
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-x64-gnu/package.json').version
|
|
294
294
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
295
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
295
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
296
296
|
}
|
|
297
297
|
return binding
|
|
298
298
|
} catch (e) {
|
|
@@ -310,7 +310,7 @@ function requireNative() {
|
|
|
310
310
|
const binding = require('@visulima/vis-binding-linux-arm64-musl')
|
|
311
311
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-arm64-musl/package.json').version
|
|
312
312
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
313
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
313
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
314
314
|
}
|
|
315
315
|
return binding
|
|
316
316
|
} catch (e) {
|
|
@@ -326,7 +326,7 @@ function requireNative() {
|
|
|
326
326
|
const binding = require('@visulima/vis-binding-linux-arm64-gnu')
|
|
327
327
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-arm64-gnu/package.json').version
|
|
328
328
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
329
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
329
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
330
330
|
}
|
|
331
331
|
return binding
|
|
332
332
|
} catch (e) {
|
|
@@ -344,7 +344,7 @@ function requireNative() {
|
|
|
344
344
|
const binding = require('@visulima/vis-binding-linux-arm-musleabihf')
|
|
345
345
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-arm-musleabihf/package.json').version
|
|
346
346
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
347
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
347
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
348
348
|
}
|
|
349
349
|
return binding
|
|
350
350
|
} catch (e) {
|
|
@@ -360,7 +360,7 @@ function requireNative() {
|
|
|
360
360
|
const binding = require('@visulima/vis-binding-linux-arm-gnueabihf')
|
|
361
361
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-arm-gnueabihf/package.json').version
|
|
362
362
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
363
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
363
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
364
364
|
}
|
|
365
365
|
return binding
|
|
366
366
|
} catch (e) {
|
|
@@ -378,7 +378,7 @@ function requireNative() {
|
|
|
378
378
|
const binding = require('@visulima/vis-binding-linux-loong64-musl')
|
|
379
379
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-loong64-musl/package.json').version
|
|
380
380
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
381
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
381
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
382
382
|
}
|
|
383
383
|
return binding
|
|
384
384
|
} catch (e) {
|
|
@@ -394,7 +394,7 @@ function requireNative() {
|
|
|
394
394
|
const binding = require('@visulima/vis-binding-linux-loong64-gnu')
|
|
395
395
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-loong64-gnu/package.json').version
|
|
396
396
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
397
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
397
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
398
398
|
}
|
|
399
399
|
return binding
|
|
400
400
|
} catch (e) {
|
|
@@ -412,7 +412,7 @@ function requireNative() {
|
|
|
412
412
|
const binding = require('@visulima/vis-binding-linux-riscv64-musl')
|
|
413
413
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-riscv64-musl/package.json').version
|
|
414
414
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
415
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
415
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
416
416
|
}
|
|
417
417
|
return binding
|
|
418
418
|
} catch (e) {
|
|
@@ -428,7 +428,7 @@ function requireNative() {
|
|
|
428
428
|
const binding = require('@visulima/vis-binding-linux-riscv64-gnu')
|
|
429
429
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-riscv64-gnu/package.json').version
|
|
430
430
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
431
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
431
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
432
432
|
}
|
|
433
433
|
return binding
|
|
434
434
|
} catch (e) {
|
|
@@ -445,7 +445,7 @@ function requireNative() {
|
|
|
445
445
|
const binding = require('@visulima/vis-binding-linux-ppc64-gnu')
|
|
446
446
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-ppc64-gnu/package.json').version
|
|
447
447
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
448
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
448
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
449
449
|
}
|
|
450
450
|
return binding
|
|
451
451
|
} catch (e) {
|
|
@@ -461,7 +461,7 @@ function requireNative() {
|
|
|
461
461
|
const binding = require('@visulima/vis-binding-linux-s390x-gnu')
|
|
462
462
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-s390x-gnu/package.json').version
|
|
463
463
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
464
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
464
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
465
465
|
}
|
|
466
466
|
return binding
|
|
467
467
|
} catch (e) {
|
|
@@ -481,7 +481,7 @@ function requireNative() {
|
|
|
481
481
|
const binding = require('@visulima/vis-binding-openharmony-arm64')
|
|
482
482
|
const bindingPackageVersion = require('@visulima/vis-binding-openharmony-arm64/package.json').version
|
|
483
483
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
484
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
484
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
485
485
|
}
|
|
486
486
|
return binding
|
|
487
487
|
} catch (e) {
|
|
@@ -497,7 +497,7 @@ function requireNative() {
|
|
|
497
497
|
const binding = require('@visulima/vis-binding-openharmony-x64')
|
|
498
498
|
const bindingPackageVersion = require('@visulima/vis-binding-openharmony-x64/package.json').version
|
|
499
499
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
500
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
500
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
501
501
|
}
|
|
502
502
|
return binding
|
|
503
503
|
} catch (e) {
|
|
@@ -513,7 +513,7 @@ function requireNative() {
|
|
|
513
513
|
const binding = require('@visulima/vis-binding-openharmony-arm')
|
|
514
514
|
const bindingPackageVersion = require('@visulima/vis-binding-openharmony-arm/package.json').version
|
|
515
515
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
516
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.
|
|
516
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.42 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
517
517
|
}
|
|
518
518
|
return binding
|
|
519
519
|
} catch (e) {
|
|
@@ -589,7 +589,7 @@ if (!nativeBinding) {
|
|
|
589
589
|
throw new Error(`Failed to load native binding`)
|
|
590
590
|
}
|
|
591
591
|
|
|
592
|
-
const { OsvBloomHandle, advisoriesIngest, advisoriesQuery, advisoriesStatus, allKnownTags, cleanWorkspace, detectPackageManager, execPmCommand, execPmCommandInteractive, NATIVE_BINDING_VERSION, osvBloomDecode, osvBloomProbe, osvBloomProbeBatch, parseShebang, resolveAdd, resolveDedupe, resolveDlx, resolveEditorconfigDefaults, resolveExec, resolveInstall, resolveLink, resolveOutdated, resolvePmCommand, resolveRemove, resolveUnlink, resolveWhy, sortPackageJsonString, sortPackageJsonStringWithOptions, tagsFromPath, tagsFromPaths, whichBin } = nativeBinding
|
|
592
|
+
const { OsvBloomHandle, advisoriesIngest, advisoriesQuery, advisoriesStatus, allKnownTags, cleanWorkspace, detectPackageManager, execPmCommand, execPmCommandInteractive, NATIVE_BINDING_VERSION, osvBloomDecode, osvBloomProbe, osvBloomProbeBatch, parseShebang, resolveAdd, resolveDedupe, resolveDlx, resolveEditorconfigDefaults, resolveExec, resolveInstall, resolveLink, resolveOutdated, resolvePmCommand, resolveRemove, resolveUnlink, resolveWhy, sortPackageJsonString, sortPackageJsonStringWithOptions, tagsFromPath, tagsFromPaths, transformTs, whichBin } = nativeBinding
|
|
593
593
|
export { OsvBloomHandle }
|
|
594
594
|
export { advisoriesIngest }
|
|
595
595
|
export { advisoriesQuery }
|
|
@@ -620,4 +620,5 @@ export { sortPackageJsonString }
|
|
|
620
620
|
export { sortPackageJsonStringWithOptions }
|
|
621
621
|
export { tagsFromPath }
|
|
622
622
|
export { tagsFromPaths }
|
|
623
|
+
export { transformTs }
|
|
623
624
|
export { whichBin }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/vis",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.42",
|
|
4
4
|
"description": "A monorepo dev toolkit — task runner, remote caching, security scanning, git hooks, and AI agent integrations — powered by @visulima/task-runner",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build",
|
|
@@ -55,6 +55,10 @@
|
|
|
55
55
|
"types": "./index.d.ts",
|
|
56
56
|
"default": "./index.js"
|
|
57
57
|
},
|
|
58
|
+
"./runtime/preload": {
|
|
59
|
+
"types": "./dist/runtime/preload.d.ts",
|
|
60
|
+
"default": "./dist/runtime/preload.js"
|
|
61
|
+
},
|
|
58
62
|
"./release": {
|
|
59
63
|
"types": "./dist/release/index.d.ts",
|
|
60
64
|
"default": "./dist/release/index.js"
|
|
@@ -107,29 +111,16 @@
|
|
|
107
111
|
"LICENSE.md"
|
|
108
112
|
],
|
|
109
113
|
"dependencies": {
|
|
110
|
-
"@
|
|
111
|
-
"@floating-ui/dom": "1.7.6",
|
|
112
|
-
"@hono/node-server": "^2.0.4",
|
|
113
|
-
"@visulima/error": "6.0.0-alpha.33",
|
|
114
|
+
"@visulima/error": "6.0.0-alpha.34",
|
|
114
115
|
"@visulima/secret-scanner": "1.0.0-alpha.6",
|
|
115
116
|
"@visulima/source-map": "3.0.0-alpha.12",
|
|
116
117
|
"@visulima/tabular": "4.0.0-alpha.14",
|
|
117
|
-
"@visulima/task-runner": "1.0.0-alpha.
|
|
118
|
-
"@visulima/tui": "1.0.0-alpha.
|
|
119
|
-
"conventional-commits-parser": "^6.2.0",
|
|
120
|
-
"graphology": "0.26.0",
|
|
121
|
-
"graphology-layout-forceatlas2": "0.10.1",
|
|
122
|
-
"graphology-types": "0.24.8",
|
|
123
|
-
"hono": "4.12.25",
|
|
124
|
-
"jiti": "^2.7.0",
|
|
118
|
+
"@visulima/task-runner": "1.0.0-alpha.24",
|
|
119
|
+
"@visulima/tui": "1.0.0-alpha.26",
|
|
125
120
|
"module-replacements": "^2.11.0",
|
|
126
|
-
"module-replacements-codemods": "^2.0.
|
|
121
|
+
"module-replacements-codemods": "^2.0.1",
|
|
127
122
|
"react": "19.2.7",
|
|
128
|
-
"react-reconciler": ">=0.33.0"
|
|
129
|
-
"sigma": "3.0.3",
|
|
130
|
-
"smol-toml": "^1.6.1",
|
|
131
|
-
"tinyexec": "^1.2.4",
|
|
132
|
-
"undici": "^7.16.0"
|
|
123
|
+
"react-reconciler": ">=0.33.0"
|
|
133
124
|
},
|
|
134
125
|
"peerDependencies": {
|
|
135
126
|
"@gitbeaker/rest": ">=43.8.0",
|
|
@@ -152,14 +143,14 @@
|
|
|
152
143
|
}
|
|
153
144
|
},
|
|
154
145
|
"optionalDependencies": {
|
|
155
|
-
"@visulima/vis-binding-darwin-
|
|
156
|
-
"@visulima/vis-binding-linux-arm64-gnu": "1.0.0-alpha.
|
|
157
|
-
"@visulima/vis-binding-darwin-
|
|
158
|
-
"@visulima/vis-binding-linux-
|
|
159
|
-
"@visulima/vis-binding-linux-
|
|
160
|
-
"@visulima/vis-binding-
|
|
161
|
-
"@visulima/vis-binding-
|
|
162
|
-
"@visulima/vis-binding-win32-
|
|
146
|
+
"@visulima/vis-binding-darwin-arm64": "1.0.0-alpha.42",
|
|
147
|
+
"@visulima/vis-binding-linux-arm64-gnu": "1.0.0-alpha.42",
|
|
148
|
+
"@visulima/vis-binding-darwin-x64": "1.0.0-alpha.42",
|
|
149
|
+
"@visulima/vis-binding-linux-x64-gnu": "1.0.0-alpha.42",
|
|
150
|
+
"@visulima/vis-binding-linux-arm64-musl": "1.0.0-alpha.42",
|
|
151
|
+
"@visulima/vis-binding-win32-arm64-msvc": "1.0.0-alpha.42",
|
|
152
|
+
"@visulima/vis-binding-linux-x64-musl": "1.0.0-alpha.42",
|
|
153
|
+
"@visulima/vis-binding-win32-x64-msvc": "1.0.0-alpha.42"
|
|
163
154
|
},
|
|
164
155
|
"engines": {
|
|
165
156
|
"node": "^22.14.0 || >=24.10.0"
|
|
@@ -870,6 +870,10 @@
|
|
|
870
870
|
"additionalProperties": false,
|
|
871
871
|
"description": "Behavior of `vis run` when invoked tasks declare service dependencies that aren't running in the workspace registry. CLI `--services=<mode>` overrides this block."
|
|
872
872
|
},
|
|
873
|
+
"runtime": {
|
|
874
|
+
"$ref": "#/$defs/RuntimeId",
|
|
875
|
+
"description": "Target JS runtime for this workspace/project — `\"node\"` (default) or `\"bun\"`. Overridden by the `--runtime` flag and the `VIS_RUNTIME` env var; falls back to lockfile detection when unset. Part of the cross-runtime multi-tool (see `rfc/design-runtime-multitool.md`)."
|
|
876
|
+
},
|
|
873
877
|
"scopedTasks": {
|
|
874
878
|
"type": "array",
|
|
875
879
|
"items": {
|
|
@@ -5309,6 +5313,14 @@
|
|
|
5309
5313
|
},
|
|
5310
5314
|
"additionalProperties": false
|
|
5311
5315
|
},
|
|
5316
|
+
"RuntimeId": {
|
|
5317
|
+
"type": "string",
|
|
5318
|
+
"enum": [
|
|
5319
|
+
"bun",
|
|
5320
|
+
"node"
|
|
5321
|
+
],
|
|
5322
|
+
"description": "JS runtimes vis can target today. `\"deno\"` is deferred."
|
|
5323
|
+
},
|
|
5312
5324
|
"ScopedTasksBlock": {
|
|
5313
5325
|
"type": "object",
|
|
5314
5326
|
"properties": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as e}from"node:module";import{m as f,q as l,C as _,h as p,k as d,r as u,o as c,b as g,j as m,Z as T,i as C}from"../packem_chunks/config.js";import"./index-BDmTbWX1.js";import"jiti";import{otelPlugin as F}from"./otelPlugin-DmKDBaPo.js";import{definePlugin as S}from"./definePlugin-DoUcoYSy.js";const i=e(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;export{f as CONFIG_FILES,l as DEFAULT_MIN_RELEASE_AGE_MINUTES,_ as SECURITY_DEFAULTS,p as TASK_CONFIG_FILES,d as applyDefaults,u as defineConfig,S as definePlugin,c as defineTaskConfig,g as findVisConfigFile,m as findVisTaskConfigFile,T as loadVisConfig,C as loadVisTaskConfig,F as otelPlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as j}from"node:module";import{m as h,f as y}from"./index-BDmTbWX1.js";import{a as q}from"../packem_chunks/config.js";const $=j(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[s,n]=g.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return g.getBuiltinModule(e)}return $(e)},{readdirSync:_,statSync:M}=k("node:fs"),w=["preinstall","install","postinstall","prepare"],x=e=>{const s=h(e,"node_modules");if(!y(s))return[];const n=new Map,o=(l,p="")=>{let u;try{u=_(l)}catch{return}for(const r of u){const i=h(l,r);if(r.startsWith("@")){o(i,`${r}/`);continue}if(r===".pnpm"&&p===""){let f;try{f=_(i)}catch{continue}for(const a of f){const c=h(i,a,"node_modules");y(c)&&o(c)}continue}if(r.startsWith("."))continue;const m=p+r,t=h(i,"package.json");try{if(!M(i).isDirectory()||!y(t))continue;const f=q(t),a=f.scripts??{},c=w.filter(v=>a[v]);!a.preinstall&&!a.install&&!a.postinstall&&y(h(i,"binding.gyp"))&&c.push("install (binding.gyp)"),c.length>0&&!n.has(m)&&n.set(m,{directory:i,hooks:c,name:m,version:typeof f.version=="string"?f.version:void 0});const d=h(i,"node_modules");y(d)&&o(d)}catch{}}};return o(s),[...n.values()]},W=e=>{const s=e.startsWith("@"),n=e.indexOf("@",s?1:0);return n===-1?{name:e}:{name:e.slice(0,n),version:e.slice(n+1)}},B=(e,s,n)=>{for(const[o,l]of Object.entries(s)){if(!l)continue;if(o.endsWith("@*")){if(o.slice(0,-2)===e.name)return!0;continue}if(o.endsWith("*")){if(e.name.startsWith(o.slice(0,-1)))return!0;continue}const{name:p,version:u}=W(o);if(p===e.name&&(!n||u===void 0||e.version===u))return!0}return!1},O=(e,s,n={})=>{const o=n.pinVersions===!0,l=x(e),p=[],u=[],r=new Map(l.map(t=>[t.name,t]));for(const t of l)B(t,s,o)?u.push(t):p.push(t);const i=[],m=[];for(const[t,f]of Object.entries(s)){if(!f)continue;if(t.endsWith("@*")){const v=t.slice(0,-2);r.has(v)||i.push(t);continue}if(t.endsWith("*")){const v=t.slice(0,-1);[...r.keys()].some(b=>b.startsWith(v))||i.push(t);continue}const{name:a,version:c}=W(t),d=r.get(a);if(!d){i.push(t);continue}o&&c!==void 0&&c!=="*"&&d.version&&d.version!==c&&m.push({from:t,to:`${a}@${d.version}`})}return{excess:i,installed:u,unapproved:p,versionDrift:m}},S=(e,s)=>O(e,s).unapproved.map(n=>`${n.name} (${n.hooks.join(", ")})`);export{O as W,S as w};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{v as u,m as l,f as g}from"./index-BDmTbWX1.js";import{D as d,i as D,W as v}from"../packem_chunks/bin.js";import"./public-api-WqUCiyIe.js";const w={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},j=o=>{const t=w[o];return t?[...t.aliases??[],t.file].map(e=>({file:e,type:t.type})):[]},m=(o,t)=>{const e=j(t);if(e.length!==0)return e.find(r=>g(l(o,r.file)))??e[e.length-1]},k=o=>{try{return JSON.parse(u(o))}catch{return}},y=o=>{const t=[],e=k(l(o,"package.json"));e&&t.push(e);const r=D(o);let c;if(r?c=r:e?.workspaces&&(Array.isArray(e.workspaces)?c=e.workspaces:e.workspaces.packages&&(c=e.workspaces.packages)),!c)return t;const a=v(o,c);for(const s of a){const n=k(l(o,s,"package.json"));n&&t.push(n)}return t},b=(o,t)=>{const e=new Set,r=[],c=new Map;for(const s of t){const n=c.get(s.name);n?n.push(s):c.set(s.name,[s])}const a=s=>{if(s)for(const n of Object.keys(s))e.has(n)||(e.add(n),r.push(n))};for(const s of y(o))a(s.dependencies),a(s.peerDependencies),a(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),n=c.get(s);if(n){for(const i of n)for(const p of[i.dependencies,i.peerDependencies,i.optionalDependencies])if(p)for(const f of Object.keys(p))e.has(f)||(e.add(f),r.push(f))}}return e},$=(o,t,e={})=>{const r=m(o,t);if(!r)return[];let c;try{c=u(l(o,r.file))}catch{return[]}const a=d(c,r.type);if(a.length===0)return[];const s=e.includeDev??!0?void 0:b(o,a),n=new Set,i=[];for(const p of a){if(s&&!s.has(p.name))continue;const f=`${p.name}@${p.version}`;n.has(f)||(n.add(f),i.push({isDev:!1,name:p.name,version:p.version}))}return i},A=(o,t)=>{const e=m(o,t);if(!e)return[];let r;try{r=u(l(o,e.file))}catch{return[]}const c=d(r,e.type);if(c.length===0)return[];const a=new Map;for(const n of c)a.has(n.name)||a.set(n.name,new Set),a.get(n.name).add(n.version);const s=[];for(const[n,i]of a)i.size<=1||s.push({name:n,versions:[...i]});return s.sort((n,i)=>n.name.localeCompare(i.name))},E=(o,t)=>{const e=m(o,t);if(!e)return;let r;try{r=u(l(o,e.file))}catch{return}const c=d(r,e.type);if(c.length===0)return;const a=[],s=new Set;for(const n of y(o))for(const i of[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies])if(i)for(const[p,f]of Object.entries(i)){const h=`${p}@${f}`;s.has(h)||(s.add(h),a.push({name:p,version:f}))}return{entries:c,roots:a}};export{w as L,E as a,A as f,$ as l,m as r};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as m}from"node:module";import{m as _}from"./index-BDmTbWX1.js";import{a as F}from"../packem_chunks/bin.js";const p=m(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=r=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,e]=o.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return o.getBuiltinModule(r)}return p(r)},{mkdirSync:f,writeFileSync:h,readdirSync:g}=c("node:fs"),{readFile:y}=c("node:fs/promises"),n=r=>F(r),a=(r,t)=>_(n(r),`${encodeURIComponent(t)}.json`);class S{#t;#e;constructor(t,e){this.#t=t,this.#e=e}printTaskTerminalOutput(t,e,s){if(e!=="failure")return;const i=n(this.#t);try{f(i,{recursive:!0})}catch{return}const u=t.overrides.command,d=t.projectRoot,l={command:u,cwd:d,exitCode:void 0,hash:t.hash,runId:this.#e,status:e,taskId:t.id,terminalOutput:s,timestamp:new Date().toISOString()};try{h(a(this.#t,t.id),`${JSON.stringify(l,void 0,2)}
|
|
2
|
-
`,"utf8")}catch{}}}const I=async(r,t)=>{const e=a(r,t);try{const s=await y(e,"utf8");return JSON.parse(s)}catch{return}},O=r=>{const t=n(r);let e;try{e=g(t)}catch{return[]}const s=[];for(const i of e)if(i.endsWith(".json"))try{s.push(decodeURIComponent(i.slice(0,-5)))}catch{}return s};export{S as F,I as a,O as l};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{W as o}from"./index-BDmTbWX1.js";const r=async(s,a)=>await o(s,a);export{r as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m as h,g as k,D as $,f as S}from"./provenance-_CJjMKwu.js";import{Z as d,D as N}from"../packem_chunks/bin.js";import{W as R}from"./build-scripts-CCCi8U66.js";import{n as v}from"./license-t5KnNX6v.js";import{A as L,B as D,v as A}from"./index-BDmTbWX1.js";import"./public-api-WqUCiyIe.js";import{L as w}from"./dependency-scan-DnTgYleU.js";const m={CRITICAL:0,HIGH:1,LOW:3,MODERATE:2,UNKNOWN:4},se=(t,e)=>{const n=m[(t.vulnerability.severity??"UNKNOWN").toUpperCase()]??4,s=m[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??4;return n-s||t.packageName.localeCompare(e.packageName)||t.packageVersion.localeCompare(e.packageVersion)},P=(t,e)=>{const n=m[e.toUpperCase()]??2;return(m[t.toUpperCase()]??4)<=n},b=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"],g=6e4,W=(t,e,n)=>{for(const s of n)if(s===t||s===`${t}@${e}`||s.endsWith("*")&&t.startsWith(s.slice(0,-1)))return!0;return!1},x=async(t,e)=>{const n=e.security?.policies?.firstSeen;if(n?.minutes===void 0||n.minutes<=0)return[];const{minutes:s}=n,a=n.exclude??[],r=e.security?.acceptedRisks,c=s*g,i=Date.now();return(await h(t.packages,$,async o=>{if(W(o.name,o.version,a))return;const l=await k(o.name,{workspaceRoot:t.workspaceRoot});if(l===void 0)return;const p=l.time?.[o.version];if(p===void 0)return;const u=Date.parse(p);if(Number.isNaN(u))return;const f=i-u;if(f>=c)return;const y=Math.max(0,Math.floor(f/g));return{acceptedRisk:d(o.name,o.version,r,"firstSeen"),data:{ageMinutes:y,minimumMinutes:s,publishedAt:p},packageName:o.name,policy:"firstSeen",reason:`${o.name}@${o.version} was published ${String(y)} min ago — below the ${String(s)} min firstSeen cooldown.`,severity:"block",version:o.version}})).filter(o=>o!==void 0)},O=(t,e)=>{const n=e.security?.policies?.installScripts;if(!n)return[];const s=n.allow??{},a=n.strict===!0;if(!a&&Object.keys(s).length===0)return[];const r=R(t.workspaceRoot,s,{pinVersions:e.security?.pinVersions===!0});if(r.unapproved.length===0)return[];const c=e.security?.acceptedRisks,i=a?"block":"warn";return r.unapproved.map(o=>({acceptedRisk:d(o.name,o.version??"*",c,"installScripts"),data:{hooks:o.hooks},packageName:o.name,policy:"installScripts",reason:`${o.name}${o.version?`@${o.version}`:""} declares unapproved build script(s): ${o.hooks.join(", ")}`,severity:i,version:o.version??"*"}))},U=new Set(["AND","OR"]),E=t=>{const e=t.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(a=>a.trim()).filter(a=>a.length>0),n=[];let s=!1;for(const a of e){const r=a.toUpperCase();if(s){s=!1;continue}if(r==="WITH"){s=!0;continue}if(U.has(r))continue;const c=a.endsWith("+"),i=c?a.slice(0,-1):a,o=v(i)??i;n.push(o),c&&n.push(`${o}-or-later`)}return n},F=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(n=>n&&typeof n.type=="string"?n.type.trim():"").filter(n=>n.length>0);if(e.length>0)return e.length===1?e[0]:`(${e.join(" OR ")})`}},I=(t,e)=>{if(e.length===0)return;const n=new Set(e.map(s=>v(s)??s).map(s=>s.toLowerCase()));for(const s of t)if(n.has(s.toLowerCase()))return s},M=(t,e)=>{if(e.length===0)return;const n=new Set(e.map(s=>v(s)??s).map(s=>s.toLowerCase()));for(const s of t)if(!n.has(s.toLowerCase()))return s},V=(t,e)=>{const n=e.security?.policies?.license;if(!n)return[];const s=n.allow??[],a=n.deny??[];if(s.length===0&&a.length===0)return[];const r=e.security?.acceptedRisks,c=[];for(const i of t.packages){const o=t.manifestData?.get(`${i.name}@${i.version}`),l=o?F(o):void 0;if(!l){s.length>0&&c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{declaredLicense:null},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} declares no license; allow-list mode requires one of: ${s.join(", ")}`,severity:"block",version:i.version});continue}const p=E(l),u=I(p,a);if(u){c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:i.version});continue}const f=M(p,s);f&&c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{allowList:s,declaredLicense:l,unallowedLicense:f},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} uses license '${f}' which is not on the allow-list (declared: ${l})`,severity:"block",version:i.version})}return c},j=6e4,_=(t,e,n)=>{for(const s of n)if(s===t||s===`${t}@${e}`||s.endsWith("*")&&t.startsWith(s.slice(0,-1)))return!0;return!1},H=async(t,e)=>{const n=e.security?.policies?.publisherChange;if(n?.mode!=="no-downgrade")return[];const s=n.exclude??[],a=typeof n.ignoreAfter=="number"?n.ignoreAfter*j:void 0,r=e.security?.acceptedRisks,c=Date.now();return(await h(t.packages,$,async i=>{if(_(i.name,i.version,s))return;const o=await k(i.name,{workspaceRoot:t.workspaceRoot});if(o===void 0)return;if(a!==void 0){const p=o.time?.[i.version],u=p===void 0?Number.NaN:Date.parse(p);if(!Number.isNaN(u)&&c-u>a)return}if(o.versions[i.version]?.dist?.attestations?.provenance!==void 0)return;const l=S(o,i.version);if(l!==void 0)return{acceptedRisk:d(i.name,i.version,r,"publisherChange"),data:{priorVersionWithProvenance:l},packageName:i.name,policy:"publisherChange",reason:`${i.name}@${i.version} dropped the provenance attestation that ${i.name}@${l} carried — publisher trust downgrade.`,severity:"block",version:i.version}})).filter(i=>i!==void 0)},T=t=>{for(const e of Object.values(w))for(const n of[e.file,...e.aliases??[]])if(t===n||t.endsWith(`/${n}`)||t.endsWith(`.${n}`))return e.type},K=(t,e,n)=>{const s=L(e)?e:D(t,e);let a;try{a=A(s)}catch{return}const r=T(s)??w[n]?.type;if(!r)return;const c=N(a,r);if(c.length===0)return;const i=new Set;for(const o of c)i.add(`${o.name}@${o.version}`);return i},z=(t,e)=>{for(const n of e)if(n===t||n.endsWith("*")&&t.startsWith(n.slice(0,-1)))return!0;return!1},Y=(t,e)=>{const n=e.security?.policies?.unexpectedDeps;if(!n)return[];const s=n.allow??[],a=n.baselineLockfile;if(s.length===0&&!a)return[];const r=a?K(t.workspaceRoot,a,t.packageManager):void 0,c=e.security?.acceptedRisks,i=[];for(const o of t.packages){const l=s.length===0||z(o.name,s),p=r?r.has(`${o.name}@${o.version}`):!0;if(l&&p)continue;const u=[],f={};l||(u.push(`not on allow-list (${s.length} entr${s.length===1?"y":"ies"})`),f.allowList=s),!p&&r&&(u.push(`not present in baseline lockfile (${a})`),f.baselineLockfile=a),i.push({acceptedRisk:d(o.name,o.version,c,"unexpectedDeps"),data:f,packageName:o.name,policy:"unexpectedDeps",reason:`${o.name}@${o.version} is unexpected: ${u.join("; ")}`,severity:"block",version:o.version})}return i},q=(t,e)=>{if(!t.osvFindings||t.osvFindings.size===0)return[];const n=e.security?.policies?.vulnerability?.failOn,s=e.security?.acceptedRisks,a=[];for(const r of t.packages){const c=t.osvFindings.get(r.name);if(!(!c||c.length===0))for(const i of c){const o=n?P(i.severity,n)?"block":"warn":"info";a.push({acceptedRisk:d(r.name,r.version,s,"vulnerability"),data:{advisoryId:i.id,aliases:i.aliases??[],cvssScore:i.cvssScore,fixedVersions:i.fixedVersions,severity:i.severity,summary:i.summary},packageName:r.name,policy:"vulnerability",reason:`${i.severity} ${i.id} affects ${r.name}@${r.version}: ${i.summary}`,severity:o,version:r.version})}}return a},C=[{evaluate:q,isConfigured:t=>t.security?.policies?.vulnerability!==void 0,name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:V,isConfigured:t=>{const e=t.security?.policies?.license;return!!(e&&(e.allow&&e.allow.length>0||e.deny&&e.deny.length>0))},name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:O,isConfigured:t=>{const e=t.security?.policies?.installScripts;return!!(e&&(e.allow&&Object.keys(e.allow).length>0||e.strict===!0))},name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:Y,isConfigured:t=>{const e=t.security?.policies?.unexpectedDeps;return!!(e&&(e.allow&&e.allow.length>0||typeof e.baselineLockfile=="string"))},name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:x,isConfigured:t=>{const e=t.security?.policies?.firstSeen?.minutes;return typeof e=="number"&&e>0},name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:H,isConfigured:t=>t.security?.policies?.publisherChange?.mode==="no-downgrade",name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],B=(t,e,n)=>C.filter(s=>s.surfaces.includes(t)?n!==void 0?n.has(s.name):s.isConfigured(e):!1),ie=async(t,e,n)=>{const s=B(e,n.visConfig,n.enabledPolicies),a=[];for(const r of s){if(t.offline&&!r.offlineSupported){a.push({packageName:"*",policy:r.name,reason:`policy.${r.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const c=await r.evaluate(t,n.visConfig);a.push(...c)}catch(c){const i=c instanceof Error?c.message:String(c);a.push({packageName:"*",policy:r.name,reason:`policy.${r.name} failed: ${i}`,severity:"info",version:"*"})}}return a},G=(()=>{const t=new Map;for(const e of b)t.set(e.toLowerCase(),e);return t})(),oe=()=>C.map(t=>t.name),re=(t,e)=>{if(t===void 0)return;const n=t.trim().toLowerCase();if(n===""||n==="none")return new Set;if(n==="all")return new Set(b);const s=new Set;for(const a of t.split(",").map(r=>r.trim()).filter(r=>r.length>0)){const r=a.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(i,o)=>o.toUpperCase()),c=G.get(r.toLowerCase());c===void 0?e?.(a):s.add(c)}return s};export{se as c,ie as e,oe as g,re as p,P as s};
|