@visulima/vis 1.0.0-alpha.2 → 1.0.0-alpha.20

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.
Files changed (147) hide show
  1. package/CHANGELOG.md +830 -14
  2. package/LICENSE.md +7667 -0
  3. package/README.md +322 -19
  4. package/dist/bin.js +1 -146
  5. package/dist/config/index.d.ts +2795 -0
  6. package/dist/config/index.js +1 -0
  7. package/dist/generate/index.d.ts +157 -0
  8. package/dist/generate/index.js +1 -0
  9. package/dist/packem_chunks/bin.js +1295 -0
  10. package/dist/packem_chunks/config.js +19 -0
  11. package/dist/packem_chunks/doctor-probe.js +2 -0
  12. package/dist/packem_chunks/fix.js +11 -0
  13. package/dist/packem_chunks/handler.js +1 -0
  14. package/dist/packem_chunks/handler10.js +1 -0
  15. package/dist/packem_chunks/handler11.js +5 -0
  16. package/dist/packem_chunks/handler12.js +1 -0
  17. package/dist/packem_chunks/handler13.js +27 -0
  18. package/dist/packem_chunks/handler14.js +5 -0
  19. package/dist/packem_chunks/handler15.js +1 -0
  20. package/dist/packem_chunks/handler16.js +1 -0
  21. package/dist/packem_chunks/handler17.js +1 -0
  22. package/dist/packem_chunks/handler18.js +1 -0
  23. package/dist/packem_chunks/handler19.js +1 -0
  24. package/dist/packem_chunks/handler2.js +2 -0
  25. package/dist/packem_chunks/handler20.js +5 -0
  26. package/dist/packem_chunks/handler21.js +2 -0
  27. package/dist/packem_chunks/handler22.js +2 -0
  28. package/dist/packem_chunks/handler23.js +18 -0
  29. package/dist/packem_chunks/handler24.js +1 -0
  30. package/dist/packem_chunks/handler25.js +1 -0
  31. package/dist/packem_chunks/handler26.js +5 -0
  32. package/dist/packem_chunks/handler27.js +1 -0
  33. package/dist/packem_chunks/handler28.js +3 -0
  34. package/dist/packem_chunks/handler29.js +1 -0
  35. package/dist/packem_chunks/handler3.js +4 -0
  36. package/dist/packem_chunks/handler30.js +7 -0
  37. package/dist/packem_chunks/handler31.js +33 -0
  38. package/dist/packem_chunks/handler32.js +3 -0
  39. package/dist/packem_chunks/handler33.js +1 -0
  40. package/dist/packem_chunks/handler34.js +26 -0
  41. package/dist/packem_chunks/handler35.js +3 -0
  42. package/dist/packem_chunks/handler36.js +7 -0
  43. package/dist/packem_chunks/handler37.js +22 -0
  44. package/dist/packem_chunks/handler38.js +428 -0
  45. package/dist/packem_chunks/handler39.js +6 -0
  46. package/dist/packem_chunks/handler4.js +8 -0
  47. package/dist/packem_chunks/handler40.js +24 -0
  48. package/dist/packem_chunks/handler41.js +10 -0
  49. package/dist/packem_chunks/handler42.js +153 -0
  50. package/dist/packem_chunks/handler43.js +25 -0
  51. package/dist/packem_chunks/handler44.js +24 -0
  52. package/dist/packem_chunks/handler45.js +213 -0
  53. package/dist/packem_chunks/handler46.js +3 -0
  54. package/dist/packem_chunks/handler47.js +27 -0
  55. package/dist/packem_chunks/handler48.js +167 -0
  56. package/dist/packem_chunks/handler49.js +34 -0
  57. package/dist/packem_chunks/handler5.js +1 -0
  58. package/dist/packem_chunks/handler6.js +1 -0
  59. package/dist/packem_chunks/handler7.js +1 -0
  60. package/dist/packem_chunks/handler8.js +1 -0
  61. package/dist/packem_chunks/handler9.js +2 -0
  62. package/dist/packem_chunks/heal-accept.js +10 -0
  63. package/dist/packem_chunks/heal.js +14 -0
  64. package/dist/packem_chunks/help-command.js +18 -0
  65. package/dist/packem_chunks/index.js +7 -0
  66. package/dist/packem_chunks/keys-refresh.js +4 -0
  67. package/dist/packem_chunks/list.js +3 -0
  68. package/dist/packem_chunks/loader.js +1 -0
  69. package/dist/packem_chunks/prune.js +3 -0
  70. package/dist/packem_chunks/run.js +1 -0
  71. package/dist/packem_chunks/status.js +2 -0
  72. package/dist/packem_chunks/sync.js +2 -0
  73. package/dist/packem_chunks/sync2.js +2 -0
  74. package/dist/packem_chunks/tar.js +3 -0
  75. package/dist/packem_chunks/tripwire.js +2 -0
  76. package/dist/packem_shared/advisories-DsynpacV.js +1 -0
  77. package/dist/packem_shared/ai-analysis-uYuTIIXi.js +68 -0
  78. package/dist/packem_shared/ai-cache-DuwHYx2O.js +1 -0
  79. package/dist/packem_shared/ai-fix-DzrA-dVz.js +43 -0
  80. package/dist/packem_shared/applyDefaults-BOVDw1jD.js +1 -0
  81. package/dist/packem_shared/build-scripts-DsWMSWDs.js +1 -0
  82. package/dist/packem_shared/cache-directory-DQak1Vjc.js +1 -0
  83. package/dist/packem_shared/cyclonedx-CiHXuG8M.js +4 -0
  84. package/dist/packem_shared/definePlugin-CWm4Dv_t.js +1 -0
  85. package/dist/packem_shared/dependency-scan-DC3nAFHS.js +1 -0
  86. package/dist/packem_shared/docker-B-CIN_nj.js +60 -0
  87. package/dist/packem_shared/failure-log-C3LEMmkq.js +2 -0
  88. package/dist/packem_shared/flakiness-Dq6K4ymq.js +1 -0
  89. package/dist/packem_shared/giget-CcEy_Elm.js +2 -0
  90. package/dist/packem_shared/glob-MHJQjR39-CQ2GC0b_.js +1 -0
  91. package/dist/packem_shared/index-DH-5hsrC.js +1 -0
  92. package/dist/packem_shared/lifecycle-Dv3nAtoD.js +2 -0
  93. package/dist/packem_shared/lockfile-C5DYMHVq.js +1 -0
  94. package/dist/packem_shared/manifests-B0fMp872.js +1 -0
  95. package/dist/packem_shared/min-release-age-BFozFonQ.js +34 -0
  96. package/dist/packem_shared/native-config-sync-Dvi1g2nQ.js +21 -0
  97. package/dist/packem_shared/otelPlugin-CJR2T_lk.js +1 -0
  98. package/dist/packem_shared/registry-keys-CewRFW0e.js +1 -0
  99. package/dist/packem_shared/resolve-explicit-CC4Kifk5.js +5 -0
  100. package/dist/packem_shared/run-summary-utils-BaBGP3bo.js +1 -0
  101. package/dist/packem_shared/runtime-check-BusAwPb2.js +1 -0
  102. package/dist/packem_shared/scan-progress-CMynp3eA.js +2 -0
  103. package/dist/packem_shared/selectors-B2ISH581.js +3 -0
  104. package/dist/packem_shared/signatures-5ZdjJ2Pu.js +2 -0
  105. package/dist/packem_shared/symbols-CQmER5MT.js +1 -0
  106. package/dist/packem_shared/toolchain-Cc3cwyLP.js +5 -0
  107. package/dist/packem_shared/typosquats-BCeR-sLf.js +1 -0
  108. package/dist/packem_shared/use-measured-height-DjYgUOKk.js +1 -0
  109. package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
  110. package/dist/packem_shared/verify-07kUNTuP.js +1 -0
  111. package/dist/packem_shared/vis-update-app-CFrlJ3mW.js +1 -0
  112. package/dist/packem_shared/xxh3-DrAUNq4n.js +1 -0
  113. package/index.d.ts +358 -0
  114. package/index.js +609 -0
  115. package/package.json +57 -22
  116. package/schemas/project.schema.json +872 -0
  117. package/schemas/vis-config.schema.json +4306 -0
  118. package/skills/vis/SKILL.md +96 -0
  119. package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
  120. package/templates/buildkite-ci/template.yml +20 -0
  121. package/dist/ai-analysis.d.ts +0 -40
  122. package/dist/ai-cache.d.ts +0 -21
  123. package/dist/bin.d.ts +0 -1
  124. package/dist/catalog.d.ts +0 -110
  125. package/dist/commands/affected.d.ts +0 -3
  126. package/dist/commands/ai.d.ts +0 -3
  127. package/dist/commands/analyze.d.ts +0 -3
  128. package/dist/commands/check.d.ts +0 -3
  129. package/dist/commands/graph.d.ts +0 -3
  130. package/dist/commands/hook/constants.d.ts +0 -8
  131. package/dist/commands/hook/index.d.ts +0 -3
  132. package/dist/commands/hook/install.d.ts +0 -7
  133. package/dist/commands/hook/migrate.d.ts +0 -27
  134. package/dist/commands/hook/uninstall.d.ts +0 -3
  135. package/dist/commands/migrate/constants.d.ts +0 -12
  136. package/dist/commands/migrate/deps.d.ts +0 -32
  137. package/dist/commands/migrate/index.d.ts +0 -3
  138. package/dist/commands/migrate/json.d.ts +0 -20
  139. package/dist/commands/migrate/lint-staged.d.ts +0 -62
  140. package/dist/commands/migrate/types.d.ts +0 -20
  141. package/dist/commands/run.d.ts +0 -3
  142. package/dist/commands/staged.d.ts +0 -3
  143. package/dist/commands/update.d.ts +0 -3
  144. package/dist/config.d.ts +0 -40
  145. package/dist/config.js +0 -1
  146. package/dist/package-manager.d.ts +0 -23
  147. package/dist/workspace.d.ts +0 -58
@@ -0,0 +1 @@
1
+ var u=Object.defineProperty;var g=(n,s)=>u(n,"name",{value:s,configurable:!0});import{createRequire as m}from"node:module";import{M as i,i as a,$ as f}from"../packem_chunks/config.js";import{u as $}from"../packem_chunks/bin.js";const j=m(import.meta.url),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=g(n=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[s,o]=k.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return k.getBuiltinModule(n)}return j(n)},"__cjs_getBuiltinModule"),{readdirSync:v}=b("node:fs");var w=Object.defineProperty,l=g((n,s)=>w(n,"name",{value:s,configurable:!0}),"o");const _=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],D=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],S=[".syncpackrc",".syncpackrc.json",".syncpackrc.yaml",".syncpackrc.yml",".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],M=l(n=>{const s=i(n,"package.json");if(!a(s))return[];let o;try{o=JSON.parse(f(s))}catch{return[]}const e=[];if(o.scripts)for(const[t,c]of Object.entries(o.scripts))typeof c=="string"&&(/\bgitleaks\b/.test(c)&&e.push({detail:`Script "${t}" still invokes gitleaks: ${c}`,kind:"script",location:"package.json",tool:"gitleaks"}),/\bsecretlint\b/.test(c)&&e.push({detail:`Script "${t}" still invokes secretlint: ${c}`,kind:"script",location:"package.json",tool:"secretlint"}),/\bsyncpack\b/.test(c)&&e.push({detail:`Script "${t}" still invokes syncpack: ${c}`,kind:"script",location:"package.json",tool:"syncpack"}),/\bsherif\b/.test(c)&&e.push({detail:`Script "${t}" still invokes sherif: ${c}`,kind:"script",location:"package.json",tool:"sherif"}));if(o.devDependencies)for(const t of Object.keys(o.devDependencies))(t==="gitleaks"||t==="@gitleaks/cli")&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"gitleaks"}),(t==="secretlint"||t.startsWith("@secretlint/"))&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"secretlint"}),t==="syncpack"&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"syncpack"}),t==="sherif"&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"sherif"});return o.sherif&&e.push({detail:"`sherif` config block still present in package.json",kind:"config",location:"package.json",tool:"sherif"}),e},"scanPackageJson"),O=l(n=>{const s=[];for(const o of _){const e=i(n,o);if(!a(e))continue;const t=f(e);/\bgitleaks\b/.test(t)&&s.push({detail:"gitleaks invocation still present in hook",kind:"hook",location:o,tool:"gitleaks"}),/\bsecretlint\b/.test(t)&&s.push({detail:"secretlint invocation still present in hook",kind:"hook",location:o,tool:"secretlint"}),/\bsyncpack\b/.test(t)&&s.push({detail:"syncpack invocation still present in hook",kind:"hook",location:o,tool:"syncpack"}),/\bsherif\b/.test(t)&&s.push({detail:"sherif invocation still present in hook",kind:"hook",location:o,tool:"sherif"})}return s},"scanHooks"),C=l(n=>{const s=[];for(const o of D)a(i(n,o))&&s.push({detail:"secretlint config should be removed after migration",kind:"config",location:o,tool:"secretlint"});for(const o of S)a(i(n,o))&&s.push({detail:"syncpack config should be removed after migration",kind:"config",location:o,tool:"syncpack"});return s},"scanConfigs"),N=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],q=l(n=>{const s=[],o=l(e=>{const t=i(n,e);if(!a(t))return;const c=f(t);/\bsyncpack\b/.test(c)&&s.push({detail:"syncpack invocation still present in CI",kind:"ci",location:e,tool:"syncpack"}),/\bsherif\b/.test(c)&&s.push({detail:"sherif invocation still present in CI",kind:"ci",location:e,tool:"sherif"})},"scanFile");for(const e of N){const t=i(n,e);if(a(t)){if(e===".github/workflows"){try{for(const c of v(t))(c.endsWith(".yml")||c.endsWith(".yaml"))&&o(`.github/workflows/${c}`)}catch{}continue}o(e)}}return s},"scanCi"),I=l(n=>{const s=[],o=i(n,"pnpm-workspace.yaml");if(a(o)){let t;try{t=$(o)}catch{t=void 0}if(t&&typeof t=="object"){const c=t.catalog;c&&typeof c.syncpack=="string"&&s.push({detail:"`syncpack` still listed in pnpm-workspace.yaml#catalog",kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"});const r=t.catalogs;if(r&&typeof r=="object")for(const[d,p]of Object.entries(r))p&&typeof p.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in pnpm-workspace.yaml#catalogs.${d}`,kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"})}}const e=i(n,"package.json");if(a(e)){let t;try{t=JSON.parse(f(e))}catch{return s}const c=t.workspaces;if(c&&typeof c=="object"&&!Array.isArray(c)){const d=c.catalog;d&&typeof d.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#workspaces.catalog",kind:"catalog",location:"package.json",tool:"syncpack"});const p=c.catalogs;if(p&&typeof p=="object")for(const[h,y]of Object.entries(p))y&&typeof y.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in package.json#workspaces.catalogs.${h}`,kind:"catalog",location:"package.json",tool:"syncpack"})}const r=t.catalog;r&&typeof r.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#catalog",kind:"catalog",location:"package.json",tool:"syncpack"})}return s},"scanCatalogs"),J=l(n=>[...M(n),...O(n),...C(n),...q(n),...I(n)],"scanMigrationLeftovers"),B=l((n,s)=>{const o=J(n);if(o.length===0)return s.info("✓ No unmigrated gitleaks/secretlint/sherif/syncpack references found."),[];s.warn(`Found ${String(o.length)} unmigrated reference(s):`);for(const e of o)s.warn(` [${e.kind}] ${e.location} — ${e.detail}`);return o},"verifyMigration");export{J as s,B as v};
@@ -0,0 +1 @@
1
+ var fe=Object.defineProperty;var T=(s,l)=>fe(s,"name",{value:l,configurable:!0});import{jsxs as t,jsx as r,Fragment as Z}from"react/jsx-runtime";import{Box as i}from"@visulima/tui/components/box";import{Spinner as we}from"@visulima/tui/components/spinner";import{Text as e}from"@visulima/tui/components/text";import{useWindowSize as se}from"@visulima/tui/hooks/use-window-size";import{useSyncExternalStore as ye,useState as L,useRef as W,useMemo as be,useCallback as he,useEffect as Ce}from"react";import{Dialog as ee}from"@visulima/tui/components/dialog";import{useApp as ke}from"@visulima/tui/hooks/use-app";import{useInput as xe}from"@visulima/tui/hooks/use-input";import{W as ue,aT as ae}from"../packem_chunks/bin.js";import{ScrollView as Te}from"@visulima/tui/components/scroll-view";import{ScrollBar as Se}from"@visulima/tui/components/scroll-bar";import{Tab as ve}from"@visulima/tui/components/tab";import{Tabs as Ae}from"@visulima/tui/components/tabs";import{u as Re}from"./use-measured-height-DjYgUOKk.js";var Ee=Object.defineProperty,Ie=T((s,l)=>Ee(s,"name",{value:l,configurable:!0}),"a$1");const pr=Ie(({current:s,total:l})=>{const{columns:h}=se(),c=h||80,p=l>0?Math.min(1,s/l):0,a=`${String(Math.round(p*100)).padStart(3)}%`,y=`${String(s)}/${String(l)}`,b=Math.max(10,c-2-a.length-1),m=Math.round(b*p),f=b-m;return t(i,{flexDirection:"column",paddingX:1,children:[t(i,{children:[r(we,{type:"dots"}),r(e,{children:" Checking catalog dependencies "}),r(e,{dimColor:!0,children:y})]}),t(i,{children:[r(e,{color:"cyan",children:"━".repeat(m)}),r(e,{dimColor:!0,children:"─".repeat(f)}),t(e,{dimColor:!0,children:[" ",a]})]})]})},"CheckProgressApp");var De=Object.defineProperty,H=T((s,l)=>De(s,"name",{value:l,configurable:!0}),"r");const z=H(s=>{const l=new Map;for(const h of s){const c=l.get(h.catalogName);c?c.push(h):l.set(h.catalogName,[h])}return l},"groupByCatalog"),Q=H((s,l,h)=>{let c=s;if(l!=="all"&&(c=l==="security"?c.filter(p=>p.vulnerabilities&&p.vulnerabilities.length>0||p.socketReport&&p.socketReport.alerts.length>0):c.filter(p=>p.updateType===l)),h){const p=h.toLowerCase();c=c.filter(a=>a.packageName.toLowerCase().includes(p))}return c},"filterEntries");class gr{static{T(this,"UpdateStore")}static{H(this,"UpdateStore")}#e;#l=new Set;#t;#i=null;constructor(l,h=null){this.#t=l,h&&(this.#i=new Map(h.recommendations.map(c=>[c.package,c]))),this.#e={aiResult:h,allChecked:!0,applyProgress:null,checkedEntries:new Set(l.map(c=>c.packageName)),entries:l,error:null,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",groupedByCatalog:z(l),phase:"browsing",selectedIndex:0}}getSnapshot=H(()=>this.#e,"getSnapshot");subscribe=H(l=>(this.#l.add(l),()=>{this.#l.delete(l)}),"subscribe");getFilteredEntries(){return Q(this.#t,this.#e.filterType,this.#e.filterText)}getRecommendation(l){return this.#i?.get(l)}getCheckedEntries(){return this.#t.filter(l=>this.#e.checkedEntries.has(l.packageName))}setSelectedIndex(l){const h=this.getFilteredEntries(),c=Math.max(0,Math.min(l,h.length-1));c!==this.#e.selectedIndex&&this.#r({...this.#e,selectedIndex:c})}setFocusedPanel(l){l!==this.#e.focusedPanel&&this.#r({...this.#e,focusedPanel:l})}setFilterType(l){if(l!==this.#e.filterType){const h=Q(this.#t,l,this.#e.filterText);this.#r({...this.#e,entries:h,filterType:l,groupedByCatalog:z(h),selectedIndex:0})}}setFilter(l){const h=Q(this.#t,this.#e.filterType,l);this.#r({...this.#e,entries:h,filterText:l,groupedByCatalog:z(h),selectedIndex:0})}setFilterActive(l){if(l!==this.#e.filterActive)if(l)this.#r({...this.#e,filterActive:!0});else{const h=Q(this.#t,this.#e.filterType,"");this.#r({...this.#e,entries:h,filterActive:!1,filterText:"",groupedByCatalog:z(h),selectedIndex:0})}}toggleCheck(l){const h=new Set(this.#e.checkedEntries);h.has(l)?h.delete(l):h.add(l),this.#r({...this.#e,allChecked:h.size===this.#t.length,checkedEntries:h})}checkAll(){this.#r({...this.#e,allChecked:!0,checkedEntries:new Set(this.#t.map(l=>l.packageName))})}uncheckAll(){this.#r({...this.#e,allChecked:!1,checkedEntries:new Set})}toggleAll(){this.#e.allChecked?this.uncheckAll():this.checkAll()}startApply(){const l=this.getCheckedEntries();this.#r({...this.#e,applyProgress:{current:0,total:l.length},phase:"applying"})}updateApplyProgress(l){this.#e.applyProgress&&this.#r({...this.#e,applyProgress:{...this.#e.applyProgress,current:l}})}markDone(){this.#r({...this.#e,phase:"done"})}setError(l){this.#r({...this.#e,error:l,phase:"error"})}#r(l){this.#e=l;for(const h of this.#l)try{h()}catch{}}}var Be=Object.defineProperty,Ne=T((s,l)=>Be(s,"name",{value:l,configurable:!0}),"d");const Pe={major:"red",minor:"yellow",patch:"green"},Le={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},Me={critical:"red",high:"red",low:"gray",medium:"yellow"},je={critical:"red",high:"red",low:"green",medium:"yellow"},$e={defer:"gray",review:"yellow",skip:"red",update:"green"},Fe=Ne(({changelogUrl:s,entry:l,focused:h,recommendation:c,scrollRef:p})=>{const a=h?"white":"gray";if(!l)return r(i,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:r(e,{dimColor:!0,children:"No package selected"})});const y=Pe[l.updateType]??"white",b=l.vulnerabilities&&l.vulnerabilities.length>0,m=l.socketReport?.score.overall??0,f=l.socketReport?ue(m):"gray";return t(i,{borderColor:a,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[r(i,{flexShrink:0,paddingTop:1,paddingX:2,children:r(e,{bold:!0,color:"white",children:l.packageName})}),t(Te,{flexGrow:1,flexShrink:1,paddingX:2,ref:p,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:[r(e,{}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Current:"})}),r(e,{children:l.currentRange})]}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Target:"})}),r(e,{children:l.newRange}),t(e,{bold:!0,color:y,children:[" ","(",l.updateType,")"]})]}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Version:"})}),r(e,{children:l.targetVersion})]}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Catalog:"})}),r(e,{children:l.catalogName})]}),l.acceptedRisk&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{color:"gray",children:"── "}),r(e,{bold:!0,color:"gray",children:"ACKNOWLEDGED RISK"}),t(i,{flexDirection:"column",paddingLeft:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Reason: "}),r(e,{children:l.acceptedRisk.reason})]}),t(i,{children:[r(e,{dimColor:!0,children:"Accepted: "}),r(e,{children:l.acceptedRisk.acceptedAt.slice(0,10)})]})]})]}),b&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"red",children:"SECURITY"}),r(e,{}),l.vulnerabilities.map(o=>t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{gap:1,children:[t(e,{bold:!0,color:Le[o.severity]??"gray",children:["⚠"," ",o.severity]}),r(e,{bold:!0,children:o.id})]}),r(i,{paddingLeft:2,children:r(e,{children:o.summary})}),t(i,{gap:2,paddingLeft:2,children:[o.cvssScore!==void 0&&t(e,{dimColor:!0,children:["CVSS:",String(o.cvssScore)]}),o.fixedVersions.length>0&&t(e,{dimColor:!0,children:["Fixed in:",o.fixedVersions.join(", ")]})]})]},o.id))]}),l.socketReport&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"cyan",children:"SOCKET.DEV"}),r(e,{}),t(i,{gap:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Overall: "}),t(e,{bold:!0,color:f,children:[String(Math.round(m*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"Supply Chain: "}),t(e,{children:[String(Math.round(l.socketReport.score.supplyChain*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"Quality: "}),t(e,{children:[String(Math.round(l.socketReport.score.quality*100)),"%"]})]})]}),t(i,{gap:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Maintenance: "}),t(e,{children:[String(Math.round(l.socketReport.score.maintenance*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"Vulnerability: "}),t(e,{children:[String(Math.round(l.socketReport.score.vulnerability*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"License: "}),t(e,{children:[l.socketReport.license||"unknown"," ","(",String(Math.round(l.socketReport.score.license*100)),"%)"]})]})]}),l.socketReport.alerts.length>0&&t(i,{flexDirection:"column",marginTop:1,children:[t(e,{bold:!0,color:"yellow",children:["⚠"," ",String(l.socketReport.alerts.length)," ","alert",l.socketReport.alerts.length===1?"":"s",":"]}),l.socketReport.alerts.map(o=>t(i,{gap:1,paddingLeft:2,children:[t(e,{bold:!0,color:Me[o.severity]??"gray",children:["[",o.severity.toUpperCase(),"]"]}),r(e,{children:o.type}),t(e,{dimColor:!0,children:["(",o.category,")"]})]},o.key))]})]}),c&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"AI ANALYSIS"}),r(e,{}),t(i,{gap:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Action: "}),r(e,{bold:!0,color:$e[c.action]??"white",children:c.action})]}),t(i,{children:[r(e,{dimColor:!0,children:"Risk: "}),r(e,{bold:!0,color:je[c.riskLevel]??"white",children:c.riskLevel})]}),t(i,{children:[r(e,{dimColor:!0,children:"Effort: "}),r(e,{bold:!0,children:c.effort})]})]}),c.reason&&r(i,{marginTop:1,paddingLeft:2,children:r(e,{children:c.reason})}),c.breakingChanges.length>0&&t(i,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[r(e,{bold:!0,color:"yellow",children:"Breaking changes:"}),c.breakingChanges.map((o,I)=>t(e,{children:[" ","•"," ",o]},String(I)))]})]}),s&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"CHANGELOG"}),r(i,{marginTop:1,paddingLeft:2,children:r(e,{color:"cyan",underline:!0,children:s})})]}),t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"LINKS"}),r(i,{flexDirection:"column",marginTop:1,paddingLeft:2,children:t(e,{color:"cyan",underline:!0,children:["https://npmx.dev/",l.packageName]})})]}),!c&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"GUIDANCE"}),t(i,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[l.updateType==="major"&&t(Z,{children:[t(e,{color:"red",children:["⚠"," ","Major update — likely contains breaking changes."]}),r(e,{dimColor:!0,children:" Review the changelog before updating."}),r(e,{dimColor:!0,children:" Use --changelog to fetch release URLs."})]}),l.updateType==="minor"&&t(Z,{children:[t(e,{color:"yellow",children:["ℹ"," ","Minor update — new features, backward compatible."]}),r(e,{dimColor:!0,children:" Generally safe to update."})]}),l.updateType==="patch"&&t(Z,{children:[t(e,{color:"green",children:["✓"," ","Patch update — bug fixes only."]}),r(e,{dimColor:!0,children:" Safe to update."})]}),!c&&r(e,{dimColor:!0,children:" Use --ai to get AI-powered analysis."})]})]})]})]})},"PackageDetailPanel");var Oe=Object.defineProperty,re=T((s,l)=>Oe(s,"name",{value:l,configurable:!0}),"x");const Ue={major:"red",minor:"yellow",patch:"green"},Ge=[{id:"all",label:"All"},{id:"major",label:"Major"},{id:"minor",label:"Minor"},{id:"patch",label:"Patch"},{id:"security",label:"Security"}],He=re(({checked:s,entry:l,isSelected:h})=>{const c=Ue[l.updateType]??"white",p=l.vulnerabilities&&l.vulnerabilities.length>0,a=l.socketReport&&l.socketReport.alerts.length>0,y=!!l.acceptedRisk,b=s?"☑":"☐",m=l.socketReport?`${String(Math.round(l.socketReport.score.overall*100))}%`:"",f=l.socketReport?ue(l.socketReport.score.overall):"gray";return t(i,{flexShrink:0,height:1,children:[r(e,{children:h?">":" "}),t(e,{color:s?"white":"gray",children:[" ",b," "]}),p||a?r(e,{color:y?"gray":"red",children:y?"✓ ":"⚠ "}):r(e,{children:" "}),r(i,{flexGrow:1,children:t(e,{bold:h,inverse:h,wrap:"truncate",children:[l.packageName,y?" [ack]":""]})}),m&&t(e,{color:f,children:[" ",m]}),t(e,{dimColor:!0,children:[" ",l.currentRange]}),t(e,{dimColor:!0,children:[" ","→"," "]}),t(e,{children:[l.newRange," "]}),r(e,{bold:!0,color:c,children:l.updateType})]})},"PackageRow"),Ve=re(({count:s,name:l})=>t(i,{flexShrink:0,height:1,marginTop:1,children:[t(e,{dimColor:!0,children:["▼"," "]}),r(e,{bold:!0,color:"white",children:l.toUpperCase()}),t(e,{dimColor:!0,children:[" ","(",s,")"]})]}),"CatalogHeader"),qe=re(({checkedEntries:s,entries:l,filterActive:h,filteredOutCount:c,filterText:p,filterType:a,focused:y,groupedByCatalog:b,isDryRun:m,onViewportHeightChange:f,scrollOffset:o,selectedIndex:I,totalCatalogEntries:D,totalChecked:v,totalEntries:V,viewportHeight:M})=>{const j=y?"white":"gray",{measuredHeight:w,ref:A}=Re(M,f);let $=0,S=0,B=0,R=0;for(const g of l)g.updateType==="major"?$++:g.updateType==="minor"?S++:B++,(g.vulnerabilities&&g.vulnerabilities.length>0||g.socketReport&&g.socketReport.alerts.length>0)&&R++;const k=[];$>0&&k.push(`${$} major`),S>0&&k.push(`${S} minor`),B>0&&k.push(`${B} patch`),R>0&&k.push(`${R} vulnerable`);const N=k.length>0?` (${k.join(", ")})`:"";let x=0;for(const g of l)s.has(g.packageName)&&x++;const C=[];let q=0;for(const[g,E]of b){C.push(r(Ve,{count:E.length,name:g},`hdr-${g}`));for(const O of E){const P=q;C.push(r(He,{checked:s.has(O.packageName),entry:O,isSelected:P===I},O.packageName)),q++}}let F=0;for(const[,g]of b)F+=2+g.length;const K=F>w&&w>0;return t(i,{borderColor:j,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[t(i,{flexShrink:0,gap:1,paddingX:1,children:[r(e,{bold:!0,inverse:!0,children:" VIS "}),t(e,{wrap:"truncate",children:[V,v>0?`/${v}`:""," ","outdated",N,D>v?` · ${D-v} dupes`:""]}),!m&&x>0&&t(e,{dimColor:!0,children:[" ","—",x," ","selected"]})]}),r(i,{flexShrink:0,paddingX:1,paddingY:1,children:r(Ae,{isFocused:y,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:T(()=>{},"onChange"),showIndex:!1,value:a,children:Ge.map(({id:g,label:E})=>r(ve,{name:g,children:E},g))})}),h&&t(i,{flexShrink:0,paddingX:1,children:[r(e,{bold:!0,color:"white",children:"/ "}),r(e,{children:p}),r(e,{inverse:!0,children:" "})]}),c>0&&r(i,{flexShrink:0,paddingX:1,children:t(e,{color:"yellow",children:["⚠"," ",c," ","package",c===1?"":"s"," ","filtered out by target constraint — press"," ",r(e,{bold:!0,color:"white",children:"f"})," ","to view"]})}),t(i,{flexDirection:"row",flexGrow:1,overflow:"hidden",ref:A,children:[r(i,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:r(i,{flexDirection:"column",marginTop:-o,children:C})}),K&&r(i,{flexShrink:0,marginLeft:1,marginRight:1,children:r(Se,{contentHeight:F,placement:"inset",scrollOffset:o,style:"block",viewportHeight:w})})]},`list-${a}-${p}`)]})},"PackageListPanel");var Ke=Object.defineProperty,Xe=T((s,l)=>Ke(s,"name",{value:l,configurable:!0}),"X");const Ye=100,We=40,ze=10,Qe=[],G=["all","major","minor","patch","security"],mr=Xe(({autoExitSeconds:s=0,changelogUrls:l,checkedCount:h=0,filteredOutEntries:c=Qe,isDryRun:p,store:a,totalCatalogEntries:y=0})=>{const{exit:b}=ke(),{columns:m,rows:f}=se(),o=ye(a.subscribe,a.getSnapshot),[I,D]=L(!1),[v,V]=L(!1),M=W(null),j=W(null),w=W(null),A=W(null),[$,S]=L(0),[B,R]=L(!1),[k,N]=L(!1),x=be(()=>a.getFilteredEntries(),[o.entries,o.filterType,o.filterText]),C=x[o.selectedIndex]??null,q=C?a.getRecommendation(C.packageName):void 0,F=C&&l?l.get(C.packageName):void 0,K=he(n=>{let d=0,u=0;for(const[,J]of o.groupedByCatalog){d+=2;for(let de=0;de<J.length;de++){if(u===n)return d;d+=1,u++}}return d},[o.groupedByCatalog]),g=Math.max(1,f-8-(o.filterActive?1:0)),[E,O]=L(g),P=E>0?E:g,U=he(n=>{const d=K(n);S(u=>d>u+P-2?Math.max(0,d-P+2):d<u+1?Math.max(0,d-1):u)},[K,P]);if(Ce(()=>{w.current?.scrollToTop()},[C?.packageName]),xe((n,d)=>{if(n==="c"&&d.ctrl){b();return}if(!k){if(v){d.escape||n==="f"||n==="q"?V(!1):d.downArrow||n==="j"?j.current?.scrollBy(1):(d.upArrow||n==="k")&&j.current?.scrollBy(-1);return}if(B){n==="u"||d.return?(R(!1),a.startApply(),b(a.getCheckedEntries())):d.escape||n==="q"?R(!1):d.downArrow||n==="j"?A.current?.scrollBy(1):d.upArrow||n==="k"?A.current?.scrollBy(-1):d.pageDown?A.current?.scrollBy(5):d.pageUp&&A.current?.scrollBy(-5);return}if(I){d.escape||n==="?"?D(!1):n==="q"?(D(!1),N(!0)):d.downArrow||n==="j"?M.current?.scrollBy(1):(d.upArrow||n==="k")&&M.current?.scrollBy(-1);return}if(n==="?"){D(!0);return}if(n==="q"){N(!0);return}if(d.tab){a.setFocusedPanel(o.focusedPanel==="list"?"detail":"list");return}if(o.focusedPanel==="list"&&(d.leftArrow||d.rightArrow)){const u=G.indexOf(o.filterType),J=d.rightArrow?(u+1)%G.length:(u-1+G.length)%G.length;S(0),w.current?.scrollToTop(),a.setFilterType(G[J]);return}if(n==="f"&&c.length>0){V(u=>!u);return}if(o.filterActive){if(d.escape){a.setFilterActive(!1);return}if(d.return){a.setFilterActive(!1);return}if(d.backspace){S(0),a.setFilter(o.filterText.slice(0,-1));return}if(n&&!d.ctrl&&!d.meta){S(0),a.setFilter(o.filterText+n);return}return}if(o.focusedPanel==="list"){if(d.downArrow||n==="j"){const u=Math.min(o.selectedIndex+1,x.length-1);a.setSelectedIndex(u),U(u);return}if(d.upArrow||n==="k"){const u=Math.max(o.selectedIndex-1,0);a.setSelectedIndex(u),U(u);return}if(d.pageDown){const u=Math.min(o.selectedIndex+10,x.length-1);a.setSelectedIndex(u),U(u);return}if(d.pageUp){const u=Math.max(o.selectedIndex-10,0);a.setSelectedIndex(u),U(u);return}if(d.home){a.setSelectedIndex(0),S(0);return}if(d.end){const u=x.length-1;a.setSelectedIndex(u),U(u);return}if(n===" "||d.return){C&&a.toggleCheck(C.packageName);return}if(n==="a"){a.toggleAll();return}if(n==="/"){a.setFilterActive(!0);return}if(n==="u"&&!p&&o.checkedEntries.size>0){R(!0);return}if(d.rightArrow){a.setFocusedPanel("detail");return}return}if(o.focusedPanel==="detail"){if(d.escape||d.leftArrow){a.setFocusedPanel("list");return}if(d.downArrow||n==="j"){w.current?.scrollBy(1);return}if(d.upArrow||n==="k"){w.current?.scrollBy(-1);return}if(d.pageDown){w.current?.scrollBy(10);return}if(d.pageUp){w.current?.scrollBy(-10);return}if(d.home){w.current?.scrollToTop();return}d.end&&w.current?.scrollToBottom()}}},{isActive:!0}),m<We||f<ze)return r(i,{alignItems:"center",height:f,justifyContent:"center",width:m,children:t(e,{color:"yellow",children:["Terminal too small (",m,"x",f,")"]})});const pe=m>=Ye,X=[t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"q"}),r(e,{dimColor:!0,children:"QUIT"})]},"q"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"?"}),r(e,{dimColor:!0,children:"HELP"})]},"?"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"↑↓"}),r(e,{dimColor:!0,children:"NAV"})]},"nav"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"Space"}),r(e,{dimColor:!0,children:"CHECK"})]},"sp"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"a"}),r(e,{dimColor:!0,children:"ALL"})]},"a")];!p&&o.checkedEntries.size>0&&X.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"green",children:"u"}),r(e,{dimColor:!0,children:"APPLY"})]},"u")),c.length>0&&X.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"yellow",children:"f"}),t(e,{dimColor:!0,children:["FILTERED (",c.length,")"]})]},"fo")),X.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"←→"}),r(e,{dimColor:!0,children:"FILTER"})]},"lr"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"/"}),r(e,{dimColor:!0,children:"SEARCH"})]},"f"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"Tab"}),r(e,{dimColor:!0,children:"PANEL"})]},"t"));const te=r(i,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:r(i,{flexWrap:"wrap",gap:2,paddingX:1,children:X})}),le=t(ee,{footer:t(e,{dimColor:!0,children:[r(e,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",r(e,{bold:!0,color:"white",children:"?"}),"/",r(e,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:M,title:"KEYBOARD SHORTCUTS",visible:I,width:52,children:[t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"NAVIGATION"})]}),t(i,{children:[r(i,{width:24,children:t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","↑","/k"]}),r(e,{dimColor:!0,children:" Move up"})]})}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","↓","/j"]}),r(e,{dimColor:!0,children:" Move down"})]})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","Tab"]}),r(e,{dimColor:!0,children:" Switch panel"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","→","/","←"]}),r(e,{dimColor:!0,children:" Focus detail/list"})]})]}),t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"SELECTION"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","Space"]}),r(e,{dimColor:!0,children:" Toggle check on package"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","a"]}),r(e,{dimColor:!0,children:" Toggle check all"})]})]}),t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"FILTERS"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","←→"]}),r(e,{dimColor:!0,children:" Switch filter tab"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","/"]}),r(e,{dimColor:!0,children:" Text filter"})]}),c.length>0&&t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","f"]}),r(e,{dimColor:!0,children:" View filtered-out packages"})]})]}),t(i,{flexDirection:"column",children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"ACTIONS"})]}),!p&&t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","u"]}),r(e,{dimColor:!0,children:" Apply selected updates"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","q"]}),r(e,{dimColor:!0,children:" Quit"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","?"]}),r(e,{dimColor:!0,children:" Toggle help"})]})]})]}),Y=a.getCheckedEntries(),_=Y.filter(n=>n.updateType==="major").length,ge=t(i,{alignItems:"center",flexDirection:"column",children:[_>0&&r(i,{marginBottom:1,marginTop:1,children:t(e,{color:"yellow",children:["⚠"," ",_," ","major update",_===1?"":"s"," ","— review breaking changes"]})}),t(e,{dimColor:!0,children:["Press"," ",r(e,{bold:!0,color:"white",children:"u"})," ","or"," ",r(e,{bold:!0,color:"white",children:"Enter"})," ","to confirm,"," ",r(e,{bold:!0,color:"white",children:"Esc"})," ","to cancel"]})]}),ie=r(ee,{footer:ge,scrollRef:A,title:`Apply ${Y.length} update${Y.length===1?"":"s"}?`,visible:B,width:70,children:Y.map(n=>t(i,{gap:1,children:[t(e,{children:[" ",n.packageName]}),t(e,{dimColor:!0,children:[n.currentRange," ","→"," ",n.newRange]}),r(e,{bold:!0,color:n.updateType==="major"?"red":n.updateType==="minor"?"yellow":"green",children:n.updateType})]},n.packageName))}),oe=c.length>0?r(ee,{footer:t(e,{dimColor:!0,children:[r(e,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",r(e,{bold:!0,color:"white",children:"f"}),"/",r(e,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:j,title:`${c.length} PACKAGE${c.length===1?"":"S"} FILTERED BY TARGET`,visible:v,width:70,children:t(i,{flexDirection:"column",children:[r(i,{marginBottom:1,children:t(e,{dimColor:!0,children:["These packages have newer versions available but are excluded by the current target constraint. Use"," ",r(e,{bold:!0,color:"white",children:"--target latest"})," ","to include them."]})}),c.map(n=>t(i,{gap:1,children:[t(e,{children:[" ",n.packageName]}),t(e,{dimColor:!0,children:[n.currentRange," ","→"," ",n.newRange]}),r(e,{bold:!0,color:n.updateType==="major"?"red":n.updateType==="minor"?"yellow":"green",children:n.updateType})]},n.packageName))]})}):null,ne=r(qe,{checkedEntries:o.checkedEntries,entries:x,filterActive:o.filterActive,filteredOutCount:c.length,filterText:o.filterText,filterType:o.filterType,focused:o.focusedPanel==="list",groupedByCatalog:o.groupedByCatalog,isDryRun:p,onViewportHeightChange:O,scrollOffset:$,selectedIndex:o.selectedIndex,totalCatalogEntries:y,totalChecked:h,totalEntries:x.length,viewportHeight:P}),ce=r(Fe,{changelogUrl:F,entry:C,focused:o.focusedPanel==="detail",recommendation:q,scrollRef:w});if(pe){const n=Math.floor(m*.35);return t(i,{flexDirection:"column",height:f,width:m,children:[t(i,{flexDirection:"row",flexGrow:1,children:[r(i,{flexGrow:1,children:ne}),r(i,{width:n,children:ce})]}),te,ie,oe,r(ae,{autoExitSeconds:s||3,onCancel:T(()=>{N(!1)},"onCancel"),visible:k}),le]})}const me=Math.floor(f*.55);return t(i,{flexDirection:"column",height:f,width:m,children:[r(i,{height:me,children:ne}),r(i,{flexGrow:1,children:ce}),te,ie,oe,r(ae,{autoExitSeconds:s||3,onCancel:T(()=>{N(!1)},"onCancel"),visible:k}),le]})},"VisUpdateApp");export{mr as C,gr as U,pr as a};
@@ -0,0 +1 @@
1
+ var X=Object.defineProperty;var F=(n,e)=>X(n,"name",{value:e,configurable:!0});var j=Object.defineProperty,b=F((n,e)=>j(n,"name",{value:e,configurable:!0}),"f");const s=(1n<<128n)-1n,a=(1n<<64n)-1n,x=(1n<<32n)-1n,w=0x9E3779B1n,D=0x85EBCA77n,N=0xC2B2AE3Dn,h=0x9E3779B185EBCA87n,l=0xC2B2AE3D27D4EB4Fn,H=0x165667B19E3779F9n,A=0x85EBCA77C2B2AE63n,P=0x27D4EB2F165667C5n,V=0x165667919E3779F9n,k=0x9FB21C651E98DF25n,I=64,S=I/8,q=8,L=Buffer.from("b8fe6c3923a44bbe7c01812cf721ad1cded46de9839097db7240a4a4b7b3671fcb79e64eccc0e578825ad07dccff7221b8084674f743248ee03590e6813a264c3c2852bb91c300cb88d0658b1b532ea371644897a20df94e3819ef46a9deacd8a8fa763fe39c343ff9dcbbc7c70b4f1d8a51e04bcdb45931c89f7ec9d9787364eac5ac8334d3ebc3c581a0fffa1363eb170ddd51b7f0da49d316552629d4689e2b16be587d47a1fc8ff8b8d17ad031ce45cb3a8f95160428afd7fbcabb4b407e","hex"),d=b((n,e=0)=>Buffer.from(n.buffer,n.byteOffset+e,n.length-e),"getView"),z=b(n=>{const e=Buffer.allocUnsafe(8);return e.writeBigUInt64LE(n),e.readBigUInt64BE()},"bswap64"),G=b(n=>{let e=n;return e=(e&0x0000FFFFn)<<16n|(e&0xFFFF0000n)>>16n,e=(e&0x00FF00FFn)<<8n|(e&0xFF00FF00n)>>8n,e},"bswap32"),J=b((n,e)=>(n&x)*(e&x)&a,"multU32ToU64"),K=b((n,e)=>(n<<e|n>>32n-e)&x,"rotl32"),m=b((n,e)=>n^n>>e,"xorshift64"),p=b(n=>~n+1n&a,"inv64"),M=b((n,e)=>{const t=n*e&s;return t&a^t>>64n},"mul128Fold64"),f=b(n=>{let e=n;return e^=e>>37n,e=e*V&a,e^=e>>32n,e},"avalanche"),y=b(n=>{let e=n;return e^=e>>33n,e=e*l&a,e^=e>>29n,e=e*H&a,e^=e>>32n,e},"avalanche64"),O=b((n,e,t)=>{for(let r=0;r<S;r++){const g=e.readBigUInt64LE(r*8),B=g^t.readBigUInt64LE(r*8);n[r^1]+=g,n[r]+=J(B,B>>32n)}return n},"accumulate512"),C=b((n,e,t,r)=>{for(let g=0;g<r;g++)O(n,d(e,g*I),d(t,g*8));return n},"accumulate"),Q=b((n,e)=>{for(let t=0;t<S;t++){const r=e.readBigUInt64LE(t*8);let g=n[t];g=m(g,47n),g^=r,g*=w,n[t]=g&a}return n},"scrambleAcc"),u=b((n,e)=>M(n[0]^e.readBigUInt64LE(0),n[1]^e.readBigUInt64LE(q)),"mix2Accs"),_=b((n,e,t)=>{let r=t;return r+=u(n.slice(0),d(e,0)),r+=u(n.slice(2),d(e,16)),r+=u(n.slice(4),d(e,32)),r+=u(n.slice(6),d(e,48)),f(r&a)},"mergeAccs"),R=b((n,e,t)=>{const r=Math.floor((t.byteLength-I)/8),g=I*r,B=Math.floor((e.byteLength-1)/g);for(let o=0;o<B;o++)C(n,d(e,o*g),t,r),Q(n,d(t,t.byteLength-I));const c=Math.floor((e.byteLength-1-g*B)/I);return C(n,d(e,B*g),t,c),O(n,d(e,e.byteLength-I),d(t,t.byteLength-I-7)),n},"hashLong"),W=b((n,e)=>{const t=new BigUint64Array([N,h,l,H,A,D,P,w]);R(t,n,e);const r=_(t,d(e,11),BigInt(n.byteLength)*h&a);return _(t,d(e,e.byteLength-I-11),~(BigInt(n.byteLength)*l)&a)<<64n|r},"hashLong128b"),v=b((n,e,t)=>M((n.readBigUInt64LE(0)^e.readBigUInt64LE(0)+t)&a,(n.readBigUInt64LE(8)^e.readBigUInt64LE(8)-t)&a),"mix16B"),U=b((n,e,t,r,g)=>{let B=n&a,c=n>>64n&a;return B+=v(e,r,g),B^=t.readBigUInt64LE(0)+t.readBigUInt64LE(8),B&=a,c+=v(t,d(r,16),g),c^=e.readBigUInt64LE(0)+e.readBigUInt64LE(8),c&=a,c<<64n|B},"mix32B"),Y=b((n,e,t)=>{const r=n.byteLength,g=BigInt(n.readUInt8(r-1))|BigInt(r<<8)|BigInt(n.readUInt8(0)<<16)|BigInt(n.readUInt8(r>>1)<<24),B=(BigInt(e.readUInt32LE(0))^BigInt(e.readUInt32LE(4)))+t,c=(g^B)&a,o=(BigInt(e.readUInt32LE(8))^BigInt(e.readUInt32LE(12)))-t,i=(K(G(g),13n)^o)&a;return(y(i)&a)<<64n|y(c)},"len1to3_128b"),Z=b((n,e,t)=>{const r=n.byteLength,g=n.readUInt32LE(0),B=n.readUInt32LE(r-4),c=BigInt(g)|BigInt(B)<<32n,o=(e.readBigUInt64LE(16)^e.readBigUInt64LE(24))+t&a;let i=(c^o)*(h+(BigInt(r)<<2n))&s;return i+=(i&a)<<65n,i&=s,i^=i>>67n,m(m(i&a,35n)*k&a,28n)|f(i>>64n)<<64n},"len4to8_128b"),$=b((n,e,t)=>{const r=n.byteLength,g=(e.readBigUInt64LE(32)^e.readBigUInt64LE(40))+t&a,B=(e.readBigUInt64LE(48)^e.readBigUInt64LE(56))-t&a,c=n.readBigUInt64LE();let o=n.readBigUInt64LE(r-8),i=(c^o^g)*h;const T=(i&a)+(BigInt(r-1)<<54n);i=i&(s^a)|T,o^=B,i+=o+(o&x)*(D-1n)<<64n,i&=s,i^=z(i>>64n);let E=(i&a)*l;return E+=(i>>64n)*l<<64n,E&=s,f(E&a)|f(E>>64n)<<64n},"len9to16_128b"),ee=b((n,e)=>{const t=n.byteLength;return t>8?$(n,L,e):t>=4?Z(n,L,e):t>0?Y(n,L,e):y(e^L.readBigUInt64LE(64)^L.readBigUInt64LE(72))|y(e^L.readBigUInt64LE(80)^L.readBigUInt64LE(88))<<64n},"len0to16_128b"),ne=b((n,e,t)=>{let r=BigInt(n.byteLength)*h&a,g=BigInt(n.byteLength-1)/32n;for(;g>=0n;){const o=Number(g);r=U(r,d(n,16*o),d(n,n.byteLength-16*(o+1)),d(e,32*o),t),g--}let B=r+(r>>64n)&a;B=f(B);let c=(r&a)*h+(r>>64n)*A+(BigInt(n.byteLength)-t&a)*l;return c&=a,c=p(f(c)),B|c<<64n},"len17to128_128b"),te=b((n,e,t)=>{let r=BigInt(n.byteLength)*h&a;for(let c=32;c<160;c+=32)r=U(r,d(n,c-32),d(n,c-16),d(e,c-32),t);r=f(r&a)|f(r>>64n)<<64n;for(let c=160;c<=n.byteLength;c+=32)r=U(r,d(n,c-32),d(n,c-16),d(e,3+c-160),t);r=U(r,d(n,n.byteLength-16),d(n,n.byteLength-32),d(e,103),p(t));let g=r+(r>>64n)&a;g=f(g);let B=(r&a)*h+(r>>64n)*A+(BigInt(n.byteLength)-t&a)*l;return B&=a,B=p(f(B)),g|B<<64n},"len129to240_128b"),re=b((n,e=0n)=>{const t=n.byteLength;return t<=16?ee(n,e):t<=128?ne(n,L,e):t<=240?te(n,L,e):W(n,L)},"xxh3_128"),ae=b(n=>{const e=n>>64n&a,t=n&a;return e.toString(16).padStart(16,"0")+t.toString(16).padStart(16,"0")},"bigintToHex"),ge=b(n=>ae(re(n)),"xxh3Hash");class be{static{F(this,"gn")}static{b(this,"Xxh3Hasher")}#e=[];update(e){return typeof e=="string"?this.#e.push(Buffer.from(e)):this.#e.push(e),this}digest(){return ge(Buffer.concat(this.#e))}}b(()=>new be,"createXxh3Hasher");export{ge as X};
package/index.d.ts ADDED
@@ -0,0 +1,358 @@
1
+ /* auto-generated by NAPI-RS */
2
+ /* eslint-disable */
3
+ export interface AddOptions {
4
+ packages: Array<string>
5
+ saveDev: boolean
6
+ exact: boolean
7
+ peer: boolean
8
+ optional: boolean
9
+ global: boolean
10
+ workspace: boolean
11
+ workspaceRoot: boolean
12
+ filter: Array<string>
13
+ }
14
+
15
+ /**
16
+ * Ingest one OSV ecosystem dump into the local SQLite. Async because the
17
+ * zip → JSON → INSERT pipeline can take seconds; we run it on a libuv worker
18
+ * so the main JS thread is free.
19
+ */
20
+ export declare function advisoriesIngest(options: AdvisoryIngestOptions, onProgress: (current: number, total: number) => void): Promise<AdvisoryIngestResult>
21
+
22
+ /**
23
+ * Synchronous query path. Returns one `AdvisoryQueryResult` per input,
24
+ * preserving order, so callers can zip back to their lockfile rows by index.
25
+ */
26
+ export declare function advisoriesQuery(dbPath: string, queries: Array<AdvisoryQuery>): Array<AdvisoryQueryResult>
27
+
28
+ export declare function advisoriesStatus(dbPath: string): AdvisoryDbStatus
29
+
30
+ export interface AdvisoryDbStatus {
31
+ exists: boolean
32
+ ecosystems: Array<AdvisoryEcosystemStatus>
33
+ sizeBytes: number
34
+ schemaVersion: number
35
+ }
36
+
37
+ export interface AdvisoryEcosystemStatus {
38
+ name: string
39
+ advisoryCount: number
40
+ lastSyncIso: string
41
+ manifestEtag?: string
42
+ }
43
+
44
+ export interface AdvisoryIngestOptions {
45
+ /** Path to a previously-downloaded OSV dump zip on disk. */
46
+ zipPath: string
47
+ dbPath: string
48
+ ecosystem: string
49
+ /**
50
+ * HTTP ETag header to write into the `manifest_etag` meta row for this
51
+ * ecosystem. `null` when the server didn't send one.
52
+ */
53
+ manifestEtag?: string
54
+ }
55
+
56
+ export interface AdvisoryIngestResult {
57
+ advisoriesIngested: number
58
+ durationMs: number
59
+ }
60
+
61
+ export interface AdvisoryQuery {
62
+ ecosystem: string
63
+ name: string
64
+ version: string
65
+ }
66
+
67
+ export interface AdvisoryQueryResult {
68
+ name: string
69
+ version: string
70
+ vulnerabilities: Array<NativeVulnerabilityJs>
71
+ }
72
+
73
+ /**
74
+ * Returns the full prek-identify tag universe. Used by the vis migrator
75
+ * to validate `types:` / `types_or:` / `exclude_types:` filters in
76
+ * migrated `.pre-commit-config.yaml` files — anything outside this set
77
+ * (and outside the vis-specific overlay) is surfaced as a warning.
78
+ */
79
+ export declare function allKnownTags(): Array<string>
80
+
81
+ export interface CleanResult {
82
+ /** Directories that were removed */
83
+ removed: Array<string>
84
+ /** Directories that failed to remove (with error messages) */
85
+ errors: Array<string>
86
+ /** Lockfiles that were removed (when --lockfile flag used) */
87
+ lockfilesRemoved: Array<string>
88
+ }
89
+
90
+ /**
91
+ * Safely removes all node_modules directories in a workspace.
92
+ *
93
+ * Uses Rust's `fs::remove_dir_all` which correctly handles symlinks and
94
+ * NTFS junctions on Windows without following them into targets.
95
+ *
96
+ * When `remove_lockfile` is true, also removes lockfiles from the root.
97
+ */
98
+ export declare function cleanWorkspace(root: string, removeLockfile: boolean): CleanResult
99
+
100
+ export interface DetectedPackageManager {
101
+ /** The package manager name: "pnpm", "npm", "yarn", "bun", or "deno" */
102
+ name: string
103
+ /** The version string from packageManager field, or None if unknown */
104
+ version?: string
105
+ /**
106
+ * Build metadata (sha256 hash) appended to packageManager field by
107
+ * corepack. `parts[1].split('+').next()` strips it from `version`;
108
+ * this field preserves it for callers that want to verify the pin.
109
+ */
110
+ buildMeta?: string
111
+ /** Whether this is a monorepo/workspace */
112
+ isWorkspace: boolean
113
+ }
114
+
115
+ /**
116
+ * Detects the package manager for the project at the given path.
117
+ * Priority: packageManager field > lockfiles > config files >
118
+ * `npm_config_user_agent` env var > default (pnpm).
119
+ *
120
+ * `opts` lets callers skip individual sources. `None` opts default
121
+ * to "use the source".
122
+ *
123
+ * Returns `napi::Result` so any I/O errors surface as JS exceptions.
124
+ */
125
+ export declare function detectPackageManager(cwd: string, opts?: DetectPackageManagerOptions | undefined | null): DetectedPackageManager
126
+
127
+ /**
128
+ * Options controlling which detection sources to consult.
129
+ *
130
+ * Matches nypm's `detectPackageManager` opts. All flags are
131
+ * `Option<bool>` so callers can omit them; `None` is treated as the
132
+ * default (use the source). Mirrors the JS-side ergonomics where
133
+ * `{}` enables every source.
134
+ */
135
+ export interface DetectPackageManagerOptions {
136
+ /** Skip reading the `packageManager` field in package.json. */
137
+ ignorePackageJson?: boolean
138
+ /** Skip lockfile walk (pnpm-lock.yaml, yarn.lock, …). */
139
+ ignoreLockFile?: boolean
140
+ /**
141
+ * Skip the `npm_config_user_agent` env-var fallback. Set by every
142
+ * PM when running scripts; lets a tool spawned from `pnpm run x`
143
+ * know it's pnpm even without a lockfile.
144
+ */
145
+ ignoreArgv?: boolean
146
+ }
147
+
148
+ export interface DlxOptions {
149
+ package: string
150
+ args: Array<string>
151
+ additionalPackages: Array<string>
152
+ shellMode: boolean
153
+ silent: boolean
154
+ }
155
+
156
+ export interface EditorconfigDefaults {
157
+ indent?: string
158
+ lineEnding?: string
159
+ }
160
+
161
+ export interface ExecOptions {
162
+ command: string
163
+ args: Array<string>
164
+ shellMode: boolean
165
+ recursive: boolean
166
+ workspaceRoot: boolean
167
+ parallel: boolean
168
+ reverse: boolean
169
+ filter: Array<string>
170
+ }
171
+
172
+ /**
173
+ * Executes a package manager command synchronously.
174
+ * Uses Rust's std::process::Command for maximum performance.
175
+ * Only allowed binaries can be executed (see ALLOWED_BINS).
176
+ *
177
+ * Returns `napi::Result<ExecResult>` -- throws a JS error for disallowed
178
+ * binaries or spawn failures, returns ExecResult with exit code otherwise.
179
+ */
180
+ export declare function execPmCommand(bin: string, args: Array<string>, cwd: string): ExecResult
181
+
182
+ /**
183
+ * Executes a package manager command with inherited stdio (interactive).
184
+ * Returns exit code. Throws JS error for disallowed binaries or spawn failures.
185
+ */
186
+ export declare function execPmCommandInteractive(bin: string, args: Array<string>, cwd: string): number
187
+
188
+ export interface ExecResult {
189
+ code: number
190
+ stdout: string
191
+ stderr: string
192
+ }
193
+
194
+ export interface InstallOptions {
195
+ frozenLockfile: boolean
196
+ prod: boolean
197
+ dev: boolean
198
+ noOptional: boolean
199
+ force: boolean
200
+ ignoreScripts: boolean
201
+ lockfileOnly: boolean
202
+ offline: boolean
203
+ silent: boolean
204
+ recursive: boolean
205
+ workspaceRoot: boolean
206
+ filter: Array<string>
207
+ }
208
+
209
+ /**
210
+ * ABI compatibility version. Bump this whenever any `#[napi]` function
211
+ * signature changes so the TypeScript loader can reject stale `.node`
212
+ * files (e.g. a local build from before the change) that would
213
+ * otherwise silently misinterpret arguments.
214
+ *
215
+ * Version history:
216
+ * 1 — initial versioned ABI. `resolve_link` gained a `version` parameter.
217
+ * 2 — added `resolve_editorconfig_defaults` (replaces the `editorconfig` npm package).
218
+ * 3 — added prek-identify bindings: `tags_from_path`, `tags_from_paths`,
219
+ * `parse_shebang`, `all_known_tags`.
220
+ * 4 — added offline advisories: `advisories_ingest`, `advisories_query`,
221
+ * `advisories_status`. Backed by bundled SQLite (rusqlite) + zip.
222
+ */
223
+ export const NATIVE_BINDING_VERSION: number
224
+
225
+ export interface NativeSortPackageJsonOptions {
226
+ /** Enable formatted output with newlines (default: true) */
227
+ pretty?: boolean
228
+ /** Alphabetize script commands (default: false) */
229
+ sortScripts?: boolean
230
+ }
231
+
232
+ export interface NativeVulnerabilityJs {
233
+ id: string
234
+ aliases: Array<string>
235
+ /** Normalized severity: "CRITICAL" | "HIGH" | "MODERATE" | "LOW" | "UNKNOWN". */
236
+ severity: string
237
+ summary: string
238
+ fixedVersions: Array<string>
239
+ cvssScore?: number
240
+ }
241
+
242
+ export interface OutdatedOptions {
243
+ packages: Array<string>
244
+ long: boolean
245
+ format: string
246
+ recursive: boolean
247
+ filter: Array<string>
248
+ workspaceRoot: boolean
249
+ prod: boolean
250
+ dev: boolean
251
+ noOptional: boolean
252
+ compatible: boolean
253
+ global: boolean
254
+ }
255
+
256
+ /**
257
+ * Parses the shebang line of an executable file, returning the
258
+ * interpreter argv (e.g. `["python3"]`, `["env", "node"]`). Returns an
259
+ * empty vector when the file has no shebang or cannot be read — mirrors
260
+ * pre-commit's behavior of treating "no shebang" as "no interpreter
261
+ * tags" rather than as an error.
262
+ */
263
+ export declare function parseShebang(path: string): Array<string>
264
+
265
+ export interface ProgressPayload {
266
+ current: number
267
+ total: number
268
+ }
269
+
270
+ export interface RemoveOptions {
271
+ packages: Array<string>
272
+ saveDev: boolean
273
+ global: boolean
274
+ recursive: boolean
275
+ workspaceRoot: boolean
276
+ filter: Array<string>
277
+ }
278
+
279
+ export declare function resolveAdd(pm: string, version: string, opts: AddOptions): ResolvedCommand
280
+
281
+ export interface ResolvedCommand {
282
+ bin: string
283
+ args: Array<string>
284
+ warnings: Array<string>
285
+ }
286
+
287
+ export declare function resolveDedupe(pm: string, version: string, check: boolean): ResolvedCommand
288
+
289
+ export declare function resolveDlx(pm: string, version: string, opts: DlxOptions): ResolvedCommand
290
+
291
+ /**
292
+ * Resolves `.editorconfig` defaults for `file_path` using the spec-compliant
293
+ * `ec4rs` parser. Mirrors the previous `editorconfig` npm package surface
294
+ * consumed by `src/util/editorconfig.ts`: returns the indent string and a
295
+ * normalized line-ending tag, or `None` for either when no usable value is
296
+ * configured. Parse / IO failures collapse to an empty result so callers can
297
+ * fall back to content sniffing without try/catch noise.
298
+ */
299
+ export declare function resolveEditorconfigDefaults(filePath: string): EditorconfigDefaults
300
+
301
+ export declare function resolveExec(pm: string, version: string, opts: ExecOptions): ResolvedCommand
302
+
303
+ export declare function resolveInstall(pm: string, version: string, opts: InstallOptions): ResolvedCommand
304
+
305
+ export declare function resolveLink(pm: string, version: string, target?: string | undefined | null): ResolvedCommand
306
+
307
+ export declare function resolveOutdated(pm: string, version: string, opts: OutdatedOptions): ResolvedCommand
308
+
309
+ export declare function resolvePmCommand(pm: string, version: string, subcommand: string, extraArgs: Array<string>): ResolvedCommand
310
+
311
+ export declare function resolveRemove(pm: string, version: string, opts: RemoveOptions): ResolvedCommand
312
+
313
+ export declare function resolveUnlink(pm: string, version: string, packages: Array<string>, recursive: boolean): ResolvedCommand
314
+
315
+ export declare function resolveWhy(pm: string, version: string, opts: WhyOptions): ResolvedCommand
316
+
317
+ export declare function sortPackageJsonString(contents: string): string
318
+
319
+ export declare function sortPackageJsonStringWithOptions(contents: string, options: NativeSortPackageJsonOptions): string
320
+
321
+ /**
322
+ * Classifies a single file path using `prek-identify`. Returns the set of
323
+ * tags (extensions, interpreters, metadata) that pre-commit / prek would
324
+ * associate with the file. Errors collapse to an empty vector so callers
325
+ * don't need try/catch — the vis hook runtime treats "unclassified" and
326
+ * "no tags" identically.
327
+ */
328
+ export declare function tagsFromPath(path: string): Array<string>
329
+
330
+ /**
331
+ * Batch variant of [`tags_from_path`]. Returns one tag list per input
332
+ * path in the same order. Errors for individual paths collapse to empty
333
+ * vectors so partial classification failures don't fail the whole batch
334
+ * (the same behavior pre-commit applies when stat-ing a deleted staged
335
+ * file mid-run).
336
+ */
337
+ export declare function tagsFromPaths(paths: Array<string>): Array<Array<string>>
338
+
339
+ /**
340
+ * Finds the full path to a binary using `which`-style lookup.
341
+ * Returns None if not found.
342
+ */
343
+ export declare function whichBin(name: string): string | null
344
+
345
+ export interface WhyOptions {
346
+ packages: Array<string>
347
+ json: boolean
348
+ long: boolean
349
+ parseable: boolean
350
+ recursive: boolean
351
+ dev: boolean
352
+ prod: boolean
353
+ noOptional: boolean
354
+ global: boolean
355
+ /** Depth limit. Uses Option<i32> directly (napi supports it). */
356
+ depth?: number
357
+ filter: Array<string>
358
+ }