@visulima/vis 5.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +2 -2
  4. package/dist/bin.js +1 -1
  5. package/dist/binx.js +1 -1
  6. package/dist/config/index.d.ts +16 -18
  7. package/dist/packem_chunks/bloom-status.js +1 -1
  8. package/dist/packem_chunks/bloom-sync.js +1 -1
  9. package/dist/packem_chunks/catalog.js +49 -48
  10. package/dist/packem_chunks/cli-exec.js +1 -1
  11. package/dist/packem_chunks/cli-main.js +200 -176
  12. package/dist/packem_chunks/doctor-probe.js +1 -1
  13. package/dist/packem_chunks/fix.js +1 -1
  14. package/dist/packem_chunks/handler.js +1 -1
  15. package/dist/packem_chunks/handler10.js +1 -1
  16. package/dist/packem_chunks/handler11.js +1 -1
  17. package/dist/packem_chunks/handler12.js +1 -1
  18. package/dist/packem_chunks/handler13.js +1 -1
  19. package/dist/packem_chunks/handler14.js +1 -1
  20. package/dist/packem_chunks/handler15.js +1 -1
  21. package/dist/packem_chunks/handler16.js +1 -1
  22. package/dist/packem_chunks/handler17.js +1 -1
  23. package/dist/packem_chunks/handler18.js +1 -1
  24. package/dist/packem_chunks/handler19.js +1 -1
  25. package/dist/packem_chunks/handler2.js +1 -1
  26. package/dist/packem_chunks/handler20.js +1 -1
  27. package/dist/packem_chunks/handler21.js +1 -1
  28. package/dist/packem_chunks/handler23.js +1 -1
  29. package/dist/packem_chunks/handler24.js +1 -1
  30. package/dist/packem_chunks/handler26.js +3 -3
  31. package/dist/packem_chunks/handler27.js +1 -1
  32. package/dist/packem_chunks/handler28.js +1 -1
  33. package/dist/packem_chunks/handler29.js +1 -1
  34. package/dist/packem_chunks/handler3.js +1 -1
  35. package/dist/packem_chunks/handler30.js +1 -1
  36. package/dist/packem_chunks/handler39.js +6 -6
  37. package/dist/packem_chunks/handler5.js +1 -1
  38. package/dist/packem_chunks/handler50.js +1 -1
  39. package/dist/packem_chunks/handler51.js +1 -1
  40. package/dist/packem_chunks/handler53.js +1 -1
  41. package/dist/packem_chunks/handler54.js +1 -1
  42. package/dist/packem_chunks/handler59.js +1 -1
  43. package/dist/packem_chunks/handler6.js +1 -1
  44. package/dist/packem_chunks/handler60.js +1 -1
  45. package/dist/packem_chunks/handler61.js +2 -2
  46. package/dist/packem_chunks/handler62.js +1 -1
  47. package/dist/packem_chunks/handler65.js +3 -3
  48. package/dist/packem_chunks/handler66.js +2 -2
  49. package/dist/packem_chunks/handler67.js +9 -9
  50. package/dist/packem_chunks/handler68.js +1 -1
  51. package/dist/packem_chunks/handler69.js +4 -4
  52. package/dist/packem_chunks/handler7.js +1 -1
  53. package/dist/packem_chunks/handler70.js +1 -1
  54. package/dist/packem_chunks/handler71.js +1 -1
  55. package/dist/packem_chunks/handler72.js +1 -1
  56. package/dist/packem_chunks/handler73.js +1 -1
  57. package/dist/packem_chunks/handler74.js +1 -1
  58. package/dist/packem_chunks/handler75.js +32 -32
  59. package/dist/packem_chunks/handler76.js +1 -1
  60. package/dist/packem_chunks/handler77.js +3 -3
  61. package/dist/packem_chunks/handler78.js +26 -26
  62. package/dist/packem_chunks/handler9.js +1 -1
  63. package/dist/packem_chunks/heal-accept.js +1 -1
  64. package/dist/packem_chunks/heal.js +1 -1
  65. package/dist/packem_chunks/help-command.js +1 -1
  66. package/dist/packem_chunks/index2.js +32 -32
  67. package/dist/packem_chunks/index6.js +1 -1
  68. package/dist/packem_chunks/keys-refresh.js +1 -1
  69. package/dist/packem_chunks/lean.js +3 -4
  70. package/dist/packem_chunks/list.js +1 -1
  71. package/dist/packem_chunks/loader.js +1 -1
  72. package/dist/packem_chunks/prompts.js +1 -1
  73. package/dist/packem_chunks/status.js +1 -1
  74. package/dist/packem_chunks/sync.js +1 -1
  75. package/dist/packem_chunks/sync2.js +1 -1
  76. package/dist/packem_chunks/tripwire.js +1 -1
  77. package/dist/packem_chunks/verify-lockfile.js +1 -1
  78. package/dist/packem_shared/Table-Bo1JKNCN-CGGet8ES.js +34 -0
  79. package/dist/packem_shared/{affected-selection-BJXJW_3Q.js → affected-selection-CrW7fWEd.js} +1 -1
  80. package/dist/packem_shared/{ai-fix-BC6aIRJT.js → ai-fix-D9MxigBQ.js} +1 -1
  81. package/dist/packem_shared/{bin-Dx8mjl3g.js → bin-D3TtXgz6.js} +1 -1
  82. package/dist/packem_shared/command-runtime-HSsYGCQd.js +1 -0
  83. package/dist/packem_shared/{ecosystem-gate-CeV20GSB.js → ecosystem-gate-ByxWtzPE.js} +1 -1
  84. package/dist/packem_shared/{failure-log-D2x5BT8S.js → failure-log-BP-gCUb5.js} +1 -1
  85. package/dist/packem_shared/{formatBytes-BHAzNIrn-CrusHOew.js → formatBytes-_HvjOy8a-B_qQr4Hw.js} +3 -3
  86. package/dist/packem_shared/{getRandomSpinner-4ZEcbTYv-DCyIuj19.js → getRandomSpinner-DX11qCB2-CoIsn7ZU.js} +1 -1
  87. package/dist/packem_shared/{index-C_ScJMpb.js → index-BKbMnn8K.js} +1 -1
  88. package/dist/packem_shared/{index-nEyN71oX.js → index-DGdD4w-b.js} +1 -1
  89. package/dist/packem_shared/index.server-Ca_EEVfw.js +2 -0
  90. package/dist/packem_shared/{lifecycle-D6PMPor-.js → lifecycle-DvmDIRbb.js} +1 -1
  91. package/dist/packem_shared/package-version-QFmE9anh.js +4 -0
  92. package/dist/packem_shared/{packument-Df46y5MY.js → packument-zb18Jnlw.js} +1 -1
  93. package/dist/packem_shared/pm-runner-RM72mDZg.js +1 -0
  94. package/dist/packem_shared/{project-name-filter-CH8Ih7Qr.js → project-name-filter-DIqpdsvP.js} +1 -1
  95. package/dist/packem_shared/{provenance-DKeR0Ig1.js → provenance-L1M2FPy_.js} +1 -1
  96. package/dist/packem_shared/{registry-keys-DwB3ZXS_.js → registry-keys-DxdqMzyp.js} +1 -1
  97. package/dist/packem_shared/{resolve-explicit-BmV8YBE-.js → resolve-explicit-CQa37JSq.js} +1 -1
  98. package/dist/packem_shared/resolve-runtime-DNukUjIr.js +1 -0
  99. package/dist/packem_shared/{s1ngularity-DZhkIqL4.js → s1ngularity-CO5GkkqX.js} +1 -1
  100. package/dist/packem_shared/{scan-progress-CkumcBG-.js → scan-progress-RwCRxJdX.js} +1 -1
  101. package/dist/packem_shared/{signatures-BxTMck2l.js → signatures-DIqFUOfs.js} +1 -1
  102. package/dist/packem_shared/spinner-BJjbNl1F.js +1 -0
  103. package/dist/packem_shared/toolchain-Bz70UIcp.js +5 -0
  104. package/dist/packem_shared/{typosquats-8u0drCqQ.js → typosquats-D4DEHhFy.js} +1 -1
  105. package/dist/packem_shared/{vis-update-app-BCIccZfA.js → vis-update-app-9b2kSk9f.js} +1 -1
  106. package/dist/packem_shared/{vis-user-error-Dd7hwxlW.js → vis-user-error-S0Fesz5y.js} +11 -11
  107. package/dist/packem_shared/watch-loop-BEnGuMBn.js +11 -0
  108. package/dist/release/core/version-actions/index.d.ts +1 -1
  109. package/dist/release/presets.d.ts +1 -55
  110. package/dist/release/presets.js +1 -1
  111. package/dist/release/types.d.ts +1 -18
  112. package/index.d.ts +204 -204
  113. package/index.js +26 -26
  114. package/package.json +13 -13
  115. package/schemas/vis-config.schema.json +6 -28
  116. package/schemas/vis-release-config.schema.json +1 -12
  117. package/dist/packem_shared/Table-BB8xHTU5-BLPS917D.js +0 -11
  118. package/dist/packem_shared/command-runtime-p4IXiIf6.js +0 -1
  119. package/dist/packem_shared/index.server-sXNQYpsl.js +0 -2
  120. package/dist/packem_shared/package-version-CiRZecQu.js +0 -4
  121. package/dist/packem_shared/pm-runner-3iiQayy-.js +0 -1
  122. package/dist/packem_shared/resolve-runtime-CNiHcVtx.js +0 -1
  123. package/dist/packem_shared/spinner-ukDEdGvp.js +0 -1
  124. package/dist/packem_shared/toolchain-BRdpaAC4.js +0 -5
  125. package/dist/packem_shared/watch-loop-BBkg02-Q.js +0 -11
@@ -1,4 +1,4 @@
1
- import{createRequire as f}from"node:module";import{d as p,c as I}from"../packem_shared/pm-runner-3iiQayy-.js";let _;const w=e=>(_??=f(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,r]=o.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return o.getBuiltinModule(e)}return w(e)},{createInterface:y}=g("node:readline"),s="sigstore",v=()=>!!process.stdout.isTTY&&process.env.CI!=="true",$=e=>new Promise(t=>{const r=y({input:process.stdin,output:process.stderr});r.question(`${e} (Y/n) `,a=>{r.close();const n=a.trim().toLowerCase();t(n===""||n==="y"||n==="yes")})}),h=e=>{const t=p(e),r=I(t,{exact:!1,filter:[],global:!1,optional:!1,packages:[s],peer:!1,saveDev:!0,workspace:!1,workspaceRoot:!1},e,console);return Promise.resolve({exitCode:r})},C=()=>{try{return import.meta.resolve(s),!0}catch{return!1}},R=e=>{let t="pnpm";try{t=p(e).name}catch{}switch(t){case"bun":return`bun add -d ${s}`;case"npm":return`npm install -D ${s}`;case"yarn":return`yarn add -D ${s}`;default:return`pnpm add -D ${s}`}},D=()=>import("sigstore"),E=async(e={})=>{const t=e.interactive??v(),r=e.prompt??$,a=e.runInstall??h,n=e.importImpl??D,l=e.workspaceRoot??process.cwd(),i=R(l);try{return await n()}catch(d){const{code:u,message:m}=d;if(!(u==="ERR_MODULE_NOT_FOUND"||u==="MODULE_NOT_FOUND")||!m.includes(s))throw d}if(!t)throw new Error(`${s} is not installed. \`vis attest\` needs it for keyless signing/verification. Install it in your repo first:
1
+ import{createRequire as f}from"node:module";import{d as p,c as I}from"../packem_shared/pm-runner-RM72mDZg.js";let _;const w=e=>(_??=f(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,r]=o.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return o.getBuiltinModule(e)}return w(e)},{createInterface:y}=g("node:readline"),s="sigstore",v=()=>!!process.stdout.isTTY&&process.env.CI!=="true",$=e=>new Promise(t=>{const r=y({input:process.stdin,output:process.stderr});r.question(`${e} (Y/n) `,a=>{r.close();const n=a.trim().toLowerCase();t(n===""||n==="y"||n==="yes")})}),h=e=>{const t=p(e),r=I(t,{exact:!1,filter:[],global:!1,optional:!1,packages:[s],peer:!1,saveDev:!0,workspace:!1,workspaceRoot:!1},e,console);return Promise.resolve({exitCode:r})},C=()=>{try{return import.meta.resolve(s),!0}catch{return!1}},R=e=>{let t="pnpm";try{t=p(e).name}catch{}switch(t){case"bun":return`bun add -d ${s}`;case"npm":return`npm install -D ${s}`;case"yarn":return`yarn add -D ${s}`;default:return`pnpm add -D ${s}`}},D=()=>import("sigstore"),E=async(e={})=>{const t=e.interactive??v(),r=e.prompt??$,a=e.runInstall??h,n=e.importImpl??D,l=e.workspaceRoot??process.cwd(),i=R(l);try{return await n()}catch(d){const{code:u,message:m}=d;if(!(u==="ERR_MODULE_NOT_FOUND"||u==="MODULE_NOT_FOUND")||!m.includes(s))throw d}if(!t)throw new Error(`${s} is not installed. \`vis attest\` needs it for keyless signing/verification. Install it in your repo first:
2
2
  ${i}`);if(!await r(`${s} isn't installed. Install it now?`))throw new Error(`${s} install declined. Re-run \`vis attest\` after installing manually:
3
3
  ${i}`);const c=await a(l);if(c.exitCode!==0)throw new Error(`Install of ${s} failed (exit ${String(c.exitCode)}). Install manually and retry:
4
4
  ${i}`);return await n()};export{R as installCommandFor,C as isSigstoreInstalled,E as loadOptionalSigstore};
@@ -1,4 +1,4 @@
1
- import{createRequire as p}from"node:module";import{F as i}from"../packem_shared/index.server-sXNQYpsl.js";let m;const d=r=>(m??=p(import.meta.url))(r),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=r=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[e,t]=c.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return c.getBuiltinModule(r)}return d(r)},{createInterface:a}=w("node:readline"),l=(r,e)=>new Promise(t=>{r.question(e,n=>{t(n.trim())})}),y=async(r,e=!0)=>{const t=a({input:process.stdin,output:process.stdout});try{const s=await l(t,`${r} ${i(e?"[Y/n]":"[y/N]")} `);return s===""?e:/^y(?:es)?$/i.test(s)}finally{t.close()}},$=async(r,e="")=>{const t=a({input:process.stdin,output:process.stdout});try{const n=e?` ${i(`(${e})`)}`:"",s=await l(t,`${r}${n} `);return s===""?e:s}finally{t.close()}},_=async(r,e)=>{if(e.length===0)throw new Error("selectPrompt called with no options.");const t=a({input:process.stdin,output:process.stdout});try{process.stdout.write(`${r}
1
+ import{createRequire as p}from"node:module";import{F as i}from"../packem_shared/index.server-Ca_EEVfw.js";let m;const d=r=>(m??=p(import.meta.url))(r),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=r=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[e,t]=c.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return c.getBuiltinModule(r)}return d(r)},{createInterface:a}=w("node:readline"),l=(r,e)=>new Promise(t=>{r.question(e,n=>{t(n.trim())})}),y=async(r,e=!0)=>{const t=a({input:process.stdin,output:process.stdout});try{const s=await l(t,`${r} ${i(e?"[Y/n]":"[y/N]")} `);return s===""?e:/^y(?:es)?$/i.test(s)}finally{t.close()}},$=async(r,e="")=>{const t=a({input:process.stdin,output:process.stdout});try{const n=e?` ${i(`(${e})`)}`:"",s=await l(t,`${r}${n} `);return s===""?e:s}finally{t.close()}},_=async(r,e)=>{if(e.length===0)throw new Error("selectPrompt called with no options.");const t=a({input:process.stdin,output:process.stdout});try{process.stdout.write(`${r}
2
2
  `);for(const[n,s]of e.entries())process.stdout.write(` ${n+1}) ${s.label}
3
3
  `);for(;;){const n=await l(t,i(` [1-${e.length}] `)),s=Number.parseInt(n,10);if(!Number.isNaN(s)&&s>=1&&s<=e.length)return e[s-1].value;process.stdout.write(i(` Please enter a number between 1 and ${e.length}.
4
4
  `))}}finally{t.close()}},b=async(r,e)=>{if(e.length===0)throw new Error("multiSelectPrompt called with no options.");const t=a({input:process.stdin,output:process.stdout});try{process.stdout.write(`${r}
@@ -1,2 +1,2 @@
1
- import{b as d,F as i,J as l}from"../packem_shared/index.server-sXNQYpsl.js";import{p as a}from"./cli-main.js";import{r as y,g}from"./catalog.js";const h=n=>{if(n===0)return"0 B";const r=["B","KB","MB","GB"],o=Math.min(Math.floor(Math.log(n)/Math.log(1024)),r.length-1),s=n/1024**o;return`${s.toFixed(s<10&&o>0?1:0)} ${r[o]}`},v=n=>{if(!n)return"never";const r=Date.parse(n);if(Number.isNaN(r))return n;const o=Date.now()-r;if(o<0)return n;const s=Math.floor(o/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const t=Math.floor(s/60);return t<24?`${t}h ago`:`${Math.floor(t/24)}d ago`},$=async({logger:n,options:r,workspaceRoot:o})=>{if(!o)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const s=r.db??y(o),t=await g(o,s);if(r.format==="json"){process.stdout.write(`${JSON.stringify({dbPath:s,ecosystems:t.ecosystems.map(e=>({advisoryCount:e.advisoryCount,lastSyncIso:e.lastSyncIso,manifestEtag:e.manifestEtag??null,name:e.name})),exists:t.exists,schemaVersion:t.schemaVersion,sizeBytes:t.sizeBytes},void 0,2)}
1
+ import{b as d,F as i,J as l}from"../packem_shared/index.server-Ca_EEVfw.js";import{p as a}from"./cli-main.js";import{r as y,g}from"./catalog.js";const h=n=>{if(n===0)return"0 B";const r=["B","KB","MB","GB"],o=Math.min(Math.floor(Math.log(n)/Math.log(1024)),r.length-1),s=n/1024**o;return`${s.toFixed(s<10&&o>0?1:0)} ${r[o]}`},v=n=>{if(!n)return"never";const r=Date.parse(n);if(Number.isNaN(r))return n;const o=Date.now()-r;if(o<0)return n;const s=Math.floor(o/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const t=Math.floor(s/60);return t<24?`${t}h ago`:`${Math.floor(t/24)}d ago`},$=async({logger:n,options:r,workspaceRoot:o})=>{if(!o)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const s=r.db??y(o),t=await g(o,s);if(r.format==="json"){process.stdout.write(`${JSON.stringify({dbPath:s,ecosystems:t.ecosystems.map(e=>({advisoryCount:e.advisoryCount,lastSyncIso:e.lastSyncIso,manifestEtag:e.manifestEtag??null,name:e.name})),exists:t.exists,schemaVersion:t.schemaVersion,sizeBytes:t.sizeBytes},void 0,2)}
2
2
  `);return}if(a.info(`DB: ${s}`),!t.exists){a.warn(`No advisory DB yet. Run ${d("vis advisories sync")} to populate.`);return}if(a.info(`Schema: v${t.schemaVersion} Size: ${h(t.sizeBytes)}`),t.ecosystems.length===0){a.warn("DB exists but contains no ecosystems. Run `vis advisories sync`.");return}a.info(""),a.info("Ecosystem Advisories Last sync ETag"),a.info(i("────────── ────────── ───────────────── ──────"));for(const e of t.ecosystems){const c=e.name.padEnd(10),u=e.advisoryCount.toLocaleString().padStart(10),m=`${e.lastSyncIso||"never"} (${v(e.lastSyncIso)})`.padEnd(19),f=e.manifestEtag??i("—");a.info(`${l(c)} ${u} ${m} ${f}`)}},E=$;export{E as advisoriesStatusExecute};
@@ -1,3 +1,3 @@
1
- import{F as v}from"../packem_shared/index.server-sXNQYpsl.js";import{p as c}from"./cli-main.js";import{s as S}from"../packem_shared/scan-progress-CkumcBG-.js";import{D as $,s as b,A as D}from"./catalog.js";import{c as w}from"../packem_shared/multi-eco-lockfiles-B2X3yhyo.js";const E=o=>o?.security?.audit?.advisories??{},A=o=>o?o.split(",").map(t=>t.trim()).filter(t=>t.length>0).map(t=>w(t)):["npm"],C=async({logger:o,options:t,visConfig:p,workspaceRoot:d})=>{if(!d)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const l=t.format==="json",u=E(p),m=t.source??u.source??$,f=A(t.ecosystem),y=f.map(s=>({id:s,label:`Sync ${s} advisories`})),n=S(y,{live:!l}),i=[];try{for(const s of f){n.start(s);const e=Date.now();try{const r=await b({allowedHosts:u.allowedHosts,dbPath:t.db,ecosystem:s,force:!!t.force,source:m,workspaceRoot:d});i.push({ecosystem:s,result:r}),r.upToDate?n.finish(s,"ok",`up to date · ${h(Date.now()-e)}`):n.finish(s,"ok",`${r.advisoriesIngested.toLocaleString()} advisories · ${h(r.durationMs)}`)}catch(r){const a=r instanceof Error?r.message:String(r);i.push({ecosystem:s,error:a}),n.finish(s,"error",a)}}}finally{n.stop()}const g=i.find(s=>s.result?.rebuiltFromSchema!==void 0)?.result?.rebuiltFromSchema;if(g!==void 0){const s=`advisory database is schema v${String(g)}; rebuilt to v${String(D)}`;l?process.stderr.write(`${s}
1
+ import{F as v}from"../packem_shared/index.server-Ca_EEVfw.js";import{p as c}from"./cli-main.js";import{s as S}from"../packem_shared/scan-progress-RwCRxJdX.js";import{D as $,s as b,A as D}from"./catalog.js";import{c as w}from"../packem_shared/multi-eco-lockfiles-B2X3yhyo.js";const E=o=>o?.security?.audit?.advisories??{},A=o=>o?o.split(",").map(t=>t.trim()).filter(t=>t.length>0).map(t=>w(t)):["npm"],C=async({logger:o,options:t,visConfig:p,workspaceRoot:d})=>{if(!d)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const l=t.format==="json",u=E(p),m=t.source??u.source??$,f=A(t.ecosystem),y=f.map(s=>({id:s,label:`Sync ${s} advisories`})),n=S(y,{live:!l}),i=[];try{for(const s of f){n.start(s);const e=Date.now();try{const r=await b({allowedHosts:u.allowedHosts,dbPath:t.db,ecosystem:s,force:!!t.force,source:m,workspaceRoot:d});i.push({ecosystem:s,result:r}),r.upToDate?n.finish(s,"ok",`up to date · ${h(Date.now()-e)}`):n.finish(s,"ok",`${r.advisoriesIngested.toLocaleString()} advisories · ${h(r.durationMs)}`)}catch(r){const a=r instanceof Error?r.message:String(r);i.push({ecosystem:s,error:a}),n.finish(s,"error",a)}}}finally{n.stop()}const g=i.find(s=>s.result?.rebuiltFromSchema!==void 0)?.result?.rebuiltFromSchema;if(g!==void 0){const s=`advisory database is schema v${String(g)}; rebuilt to v${String(D)}`;l?process.stderr.write(`${s}
2
2
  `):c.info(s)}if(l){const s={ecosystems:i.map(e=>({advisoriesIngested:e.result?.advisoriesIngested??0,dbPath:e.result?.dbPath??null,durationMs:e.result?.durationMs??0,ecosystem:e.ecosystem,error:e.error??null,upToDate:e.result?.upToDate??!1})),source:m};process.stdout.write(`${JSON.stringify(s,void 0,2)}
3
3
  `)}else{const s=i.filter(a=>a.error),e=i.filter(a=>a.result),r=e[0];r?.result?.dbPath&&c.info(v(`DB: ${r.result.dbPath}`)),s.length===0?c.success(`Synced ${e.length} ecosystem${e.length===1?"":"s"}.`):c.error(`${s.length} ecosystem${s.length===1?"":"s"} failed to sync.`)}i.some(s=>s.error)&&(process.exitCode=1)},h=o=>o>=1e3?`${(o/1e3).toFixed(1)}s`:`${Math.round(o)}ms`,M=C;export{M as advisoriesSyncExecute,A as parseEcosystems};
@@ -1,2 +1,2 @@
1
- import{p as n}from"./cli-main.js";import{d as u}from"../packem_shared/pm-runner-3iiQayy-.js";import{s as p}from"../packem_shared/native-config-sync-TdTWjVgI.js";import{s as g}from"../packem_shared/min-release-age-JViyQuBM.js";const y=new Set(["bun","npm","pnpm","yarn"]),S=({options:c,visConfig:a,workspaceRoot:l})=>{const i=l??process.cwd(),e=u(i);if(!y.has(e.name)){n.warn(`Package manager '${e.name}' has no native security config to sync.`);return}if(!a?.security){n.warn("vis.config has no `security` block — nothing to sync.");return}const t=a.security.policies??{},r=Object.fromEntries(Object.entries(t.installScripts?.allow??{}).filter(([,o])=>o)),f=t.firstSeen?.minutes,m=t.firstSeen?.exclude??[],s=[];if(Object.keys(r).length>0&&!c.skipAllowBuilds&&s.push(...p(e.name,i,r)),c.skipMinReleaseAge||s.push(...g(e.name,i,f,m)),s.length===0){n.success("Nothing to sync — vis.config and native PM config are aligned.");return}n.info(`Syncing vis.config security settings to ${e.name} native config…
1
+ import{p as n}from"./cli-main.js";import{d as u}from"../packem_shared/pm-runner-RM72mDZg.js";import{s as p}from"../packem_shared/native-config-sync-TdTWjVgI.js";import{s as g}from"../packem_shared/min-release-age-JViyQuBM.js";const y=new Set(["bun","npm","pnpm","yarn"]),S=({options:c,visConfig:a,workspaceRoot:l})=>{const i=l??process.cwd(),e=u(i);if(!y.has(e.name)){n.warn(`Package manager '${e.name}' has no native security config to sync.`);return}if(!a?.security){n.warn("vis.config has no `security` block — nothing to sync.");return}const t=a.security.policies??{},r=Object.fromEntries(Object.entries(t.installScripts?.allow??{}).filter(([,o])=>o)),f=t.firstSeen?.minutes,m=t.firstSeen?.exclude??[],s=[];if(Object.keys(r).length>0&&!c.skipAllowBuilds&&s.push(...p(e.name,i,r)),c.skipMinReleaseAge||s.push(...g(e.name,i,f,m)),s.length===0){n.success("Nothing to sync — vis.config and native PM config are aligned.");return}n.info(`Syncing vis.config security settings to ${e.name} native config…
2
2
  `);for(const o of s)n.success(` ${o}`)};export{S as default};
@@ -1,2 +1,2 @@
1
- import{createRequire as g}from"node:module";import{e as p}from"../packem_shared/index-BzhrR_iC.js";import{p as e}from"./cli-main.js";import{d as _}from"../packem_shared/pm-runner-3iiQayy-.js";import{y as u}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as m}from"../packem_shared/readJsonSync-CbryXYxN-EWl7_7KX.js";import{U as $}from"../packem_shared/writeFileSync-DJoHk3Ks-BPRoepNw.js";let y;const w=r=>(y??=g(import.meta.url))(r),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=r=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,s]=c.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return c.getBuiltinModule(r)}return w(r)},{spawnSync:h}=v("node:child_process"),t="@lavamoat/preinstall-always-fail",d=r=>{const n=p(r,"package.json");if(!u(n))return"no-package-json";try{const s=m(n);if(s.devDependencies?.[t]||s.dependencies?.[t])return"installed"}catch{}return"missing"},k=r=>{const n=p(r,"package.json");if(!u(n))return!1;try{const s=m(n);let i=!1;const l=a=>!a||!(t in a)?a:(i=!0,Object.fromEntries(Object.entries(a).filter(([o])=>o!==t)));return s.devDependencies=l(s.devDependencies),s.dependencies=l(s.dependencies),i&&$(n,`${JSON.stringify(s,null,2)}
1
+ import{createRequire as g}from"node:module";import{e as p}from"../packem_shared/index-BzhrR_iC.js";import{p as e}from"./cli-main.js";import{d as _}from"../packem_shared/pm-runner-RM72mDZg.js";import{y as u}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as m}from"../packem_shared/readJsonSync-CbryXYxN-EWl7_7KX.js";import{U as $}from"../packem_shared/writeFileSync-DJoHk3Ks-BPRoepNw.js";let y;const w=r=>(y??=g(import.meta.url))(r),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=r=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,s]=c.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return c.getBuiltinModule(r)}return w(r)},{spawnSync:h}=v("node:child_process"),t="@lavamoat/preinstall-always-fail",d=r=>{const n=p(r,"package.json");if(!u(n))return"no-package-json";try{const s=m(n);if(s.devDependencies?.[t]||s.dependencies?.[t])return"installed"}catch{}return"missing"},k=r=>{const n=p(r,"package.json");if(!u(n))return!1;try{const s=m(n);let i=!1;const l=a=>!a||!(t in a)?a:(i=!0,Object.fromEntries(Object.entries(a).filter(([o])=>o!==t)));return s.devDependencies=l(s.devDependencies),s.dependencies=l(s.dependencies),i&&$(n,`${JSON.stringify(s,null,2)}
2
2
  `),i}catch{return!1}},I=({options:r,workspaceRoot:n})=>{const s=n??process.cwd();if(r.status){switch(d(s)){case"installed":{e.success(`Preinstall tripwire is installed (${t}).`),e.info("Removing 'ignore-scripts=true' will cause future installs to fail loudly.");break}case"missing":{e.warn("Preinstall tripwire is not installed."),e.info(`Run 'vis security tripwire' to add ${t} as a devDependency.`);break}default:e.error("No package.json found at the workspace root."),process.exitCode=1}return}if(r.remove){k(s)?e.success(`Removed ${t} from package.json. Run your PM's install to clean node_modules.`):e.info(`${t} was not present in package.json.`);return}if(d(s)==="installed"){e.info(`${t} is already installed.`);return}const i=_(s),a={bun:["add","-d",t],npm:["install","--save-dev",t],pnpm:["add","-D","-w",t],yarn:["add","-D",t]}[i.name];if(!a){e.error(`Cannot install tripwire — unsupported package manager '${i.name}'.`),process.exitCode=1;return}e.info(`Installing ${t} via ${i.name}…`);const o=h(i.name,a,{cwd:s,stdio:"inherit"});if(o.error){e.error(`Failed to install tripwire: ${o.error.message}`),process.exitCode=1;return}if(o.signal!==null){e.error(`${i.name} was terminated by signal ${o.signal}`),process.exitCode=1;return}if(o.status!==0){e.error(`${i.name} exited with code ${String(o.status)}`),process.exitCode=o.status??1;return}e.success(`Installed ${t} as a devDependency.`),e.notice(""),e.notice("How the tripwire works:"),e.notice(` ${t} declares a preinstall script that always fails.`),e.notice(" When 'ignore-scripts=true' is set (.npmrc / bunfig.toml / .yarnrc.yml),"),e.notice(" the script is skipped and installs succeed normally. If someone deletes"),e.notice(" that setting, the next install fails — loudly — instead of silently"),e.notice(" running every dependency's lifecycle scripts.")};export{I as default};
@@ -1,2 +1,2 @@
1
- import{p}from"./cli-main.js";import{d as b}from"../packem_shared/pm-runner-3iiQayy-.js";import{r as m,l as w,L as v}from"../packem_shared/dependency-scan-B8jroa1D.js";import{z as S,e as g}from"../packem_shared/index-BzhrR_iC.js";import{S as $}from"../packem_shared/lockfile-DhHAaHN5.js";import{e as x}from"../packem_shared/index-nEyN71oX.js";import{y as C}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const E=e=>{const o=e.trim();return o===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(o)||/^(?:github|gitlab|bitbucket|gist):/i.test(o)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(o)&&!o.includes("@")?!0:/^https?:\/\//i.test(o)},M=(e,o)=>{for(const i of o)if(i===e||i.endsWith("*")&&e.startsWith(i.slice(0,-1)))return!0;return!1},L=(e,o,i={})=>{const t=m(e,o);if(!t)return[];let s;try{s=S(g(e,t.file))}catch{return[]}const n=$(s,t.type);if(n.length===0)return[];const r=i.allow??[],l=[],f=new Set;for(const c of n){const a=`${c.name}@${c.version}`;for(const d of[c.dependencies,c.optionalDependencies])if(d){for(const[u,h]of Object.entries(d))if(!M(u,r))for(const k of h){if(!E(k))continue;const y=`${a}->${u}@${k}`;f.has(y)||(f.add(y),l.push({declaredBy:a,packageName:u,source:k}))}}}return l.sort((c,a)=>c.packageName.localeCompare(a.packageName)||c.declaredBy.localeCompare(a.declaredBy))},D=new Set(["firstSeen","publisherChange"]),I=e=>e.severity==="block"&&e.acceptedRisk===void 0,N=e=>{const o=e.security?.policies?.firstSeen?.minutes,i=typeof o=="number"&&o>0,t=e.security?.policies?.publisherChange?.mode==="no-downgrade",s=e.security?.blockExoticSubdeps===!0;return i||t||s},O=async e=>{const{offline:o=!1,packageManager:i,visConfig:t,workspaceRoot:s}=e,n=Date.now();if(!N(t))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const r=m(s,i);if(!r||!C(g(s,r.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=w(s,i,{includeDev:!0}),f=l.length,c=await x({offline:o,packageManager:i,packages:l,workspaceRoot:s},"install",{enabledPolicies:new Set(D),visConfig:t}),a=t.security?.blockExoticSubdeps===!0?L(s,i,{allow:t.security.exoticSubdepsAllow}):[],d=c.some(u=>I(u))||a.length>0;return{decisions:c,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:d?"fail":"pass"}},P=e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,V=e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const o=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${P(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${o}`];const i=[`✗ Lockfile failed supply-chain policy check ${o}`];for(const t of e.decisions)t.severity==="block"&&t.acceptedRisk===void 0&&i.push(` [${t.policy}] ${t.reason}`);for(const t of e.exoticViolations)i.push(` [blockExoticSubdeps] ${t.packageName} pulled from exotic source by ${t.declaredBy}: ${t.source}`);return i},z=async({options:e,visConfig:o,workspaceRoot:i})=>{const t=i??process.cwd(),s=b(t);if(!v[s.name]){p.warn(`Package manager '${s.name}' has no lockfile vis can verify.`);return}const n=await O({offline:!!e.offline,packageManager:s.name,visConfig:o??{},workspaceRoot:t});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
1
+ import{p}from"./cli-main.js";import{d as b}from"../packem_shared/pm-runner-RM72mDZg.js";import{r as m,l as w,L as v}from"../packem_shared/dependency-scan-B8jroa1D.js";import{z as S,e as g}from"../packem_shared/index-BzhrR_iC.js";import{S as $}from"../packem_shared/lockfile-DhHAaHN5.js";import{e as x}from"../packem_shared/index-DGdD4w-b.js";import{y as C}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const E=e=>{const o=e.trim();return o===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(o)||/^(?:github|gitlab|bitbucket|gist):/i.test(o)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(o)&&!o.includes("@")?!0:/^https?:\/\//i.test(o)},M=(e,o)=>{for(const i of o)if(i===e||i.endsWith("*")&&e.startsWith(i.slice(0,-1)))return!0;return!1},L=(e,o,i={})=>{const t=m(e,o);if(!t)return[];let s;try{s=S(g(e,t.file))}catch{return[]}const n=$(s,t.type);if(n.length===0)return[];const r=i.allow??[],l=[],f=new Set;for(const c of n){const a=`${c.name}@${c.version}`;for(const d of[c.dependencies,c.optionalDependencies])if(d){for(const[u,h]of Object.entries(d))if(!M(u,r))for(const k of h){if(!E(k))continue;const y=`${a}->${u}@${k}`;f.has(y)||(f.add(y),l.push({declaredBy:a,packageName:u,source:k}))}}}return l.sort((c,a)=>c.packageName.localeCompare(a.packageName)||c.declaredBy.localeCompare(a.declaredBy))},D=new Set(["firstSeen","publisherChange"]),I=e=>e.severity==="block"&&e.acceptedRisk===void 0,N=e=>{const o=e.security?.policies?.firstSeen?.minutes,i=typeof o=="number"&&o>0,t=e.security?.policies?.publisherChange?.mode==="no-downgrade",s=e.security?.blockExoticSubdeps===!0;return i||t||s},O=async e=>{const{offline:o=!1,packageManager:i,visConfig:t,workspaceRoot:s}=e,n=Date.now();if(!N(t))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const r=m(s,i);if(!r||!C(g(s,r.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=w(s,i,{includeDev:!0}),f=l.length,c=await x({offline:o,packageManager:i,packages:l,workspaceRoot:s},"install",{enabledPolicies:new Set(D),visConfig:t}),a=t.security?.blockExoticSubdeps===!0?L(s,i,{allow:t.security.exoticSubdepsAllow}):[],d=c.some(u=>I(u))||a.length>0;return{decisions:c,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:d?"fail":"pass"}},P=e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,V=e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const o=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${P(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${o}`];const i=[`✗ Lockfile failed supply-chain policy check ${o}`];for(const t of e.decisions)t.severity==="block"&&t.acceptedRisk===void 0&&i.push(` [${t.policy}] ${t.reason}`);for(const t of e.exoticViolations)i.push(` [blockExoticSubdeps] ${t.packageName} pulled from exotic source by ${t.declaredBy}: ${t.source}`);return i},z=async({options:e,visConfig:o,workspaceRoot:i})=>{const t=i??process.cwd(),s=b(t);if(!v[s.name]){p.warn(`Package manager '${s.name}' has no lockfile vis can verify.`);return}const n=await O({offline:!!e.offline,packageManager:s.name,visConfig:o??{},workspaceRoot:t});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
2
2
  `),n.status==="fail"&&(process.exitCode=1);return}const[r,...l]=V(n);if(n.status==="skipped"){p.info(r);return}if(n.status==="pass"){p.success(r);return}p.error(r);for(const f of l)p.error(f);process.exitCode=1};export{z as default};