@visulima/vis 6.4.0 → 6.4.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.
- package/CHANGELOG.md +6 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/catalog2.js +1 -1
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler32.js +1 -1
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler50.js +1 -1
- package/dist/packem_chunks/handler51.js +1 -1
- package/dist/packem_chunks/handler52.js +1 -1
- package/dist/packem_chunks/handler54.js +1 -1
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler56.js +4 -4
- package/dist/packem_chunks/handler58.js +1 -1
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler60.js +1 -1
- package/dist/packem_chunks/handler61.js +1 -1
- package/dist/packem_chunks/handler62.js +1 -1
- package/dist/packem_chunks/handler63.js +1 -1
- package/dist/packem_chunks/handler64.js +1 -1
- package/dist/packem_chunks/handler65.js +1 -1
- package/dist/packem_chunks/handler66.js +1 -1
- package/dist/packem_chunks/handler67.js +1 -1
- package/dist/packem_chunks/handler68.js +1 -1
- package/dist/packem_chunks/handler69.js +1 -1
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +1 -1
- package/dist/packem_chunks/handler71.js +1 -1
- package/dist/packem_chunks/handler72.js +1 -1
- package/dist/packem_chunks/handler73.js +1 -1
- package/dist/packem_chunks/handler74.js +1 -1
- package/dist/packem_chunks/handler75.js +1 -1
- package/dist/packem_chunks/handler76.js +1 -1
- package/dist/packem_chunks/handler77.js +1 -1
- package/dist/packem_chunks/handler78.js +1 -1
- package/dist/packem_chunks/handler79.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/index7.js +1 -1
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/ReleaseClient-MyutNe6z.js +1 -0
- package/dist/packem_shared/{advisories-DyHTz-me.js → advisories-DTwACNnG.js} +1 -1
- package/dist/packem_shared/{affected-selection-C3eYhoTa.js → affected-selection-D_APcBUH.js} +1 -1
- package/dist/packem_shared/{ai-analysis-y1glEwHU.js → ai-analysis-CXV3P9IN.js} +1 -1
- package/dist/packem_shared/{ai-cache-Bq3dQd87.js → ai-cache-CAwR0t_H.js} +1 -1
- package/dist/packem_shared/{ai-fix-BQUNIOMp.js → ai-fix-CZSdH72D.js} +1 -1
- package/dist/packem_shared/{bin-DEQ52GkZ.js → bin-BUpNU4sc.js} +1 -1
- package/dist/packem_shared/{build-scripts-wF0ykoin.js → build-scripts-BedOAAkJ.js} +1 -1
- package/dist/packem_shared/{dependency-scan-BNqHSRaA.js → dependency-scan-CIhI1eyk.js} +1 -1
- package/dist/packem_shared/{detect-B9mLzG9L.js → detect-DHj8Ofgf.js} +1 -1
- package/dist/packem_shared/{docker-CpJj7VQ6.js → docker-aU0BWfDE.js} +1 -1
- package/dist/packem_shared/{ecosystem-gate-DI5TKrtm.js → ecosystem-gate-B4JHFwgQ.js} +1 -1
- package/dist/packem_shared/{env-CsENUmRe.js → env-B5goXAfs.js} +1 -1
- package/dist/packem_shared/{env-consistency-HvLV2yQ6.js → env-consistency-C8bLhpjg.js} +1 -1
- package/dist/packem_shared/{failure-log-C8Vh0Vtk.js → failure-log-CcPGcBQL.js} +1 -1
- package/dist/packem_shared/glob-Cyk1H9ZL-CWIhTwGz.js +1 -0
- package/dist/packem_shared/{index-CLcQ8Xe4.js → index-D089GoZ9.js} +1 -1
- package/dist/packem_shared/{index-CFglig6K.js → index-D1clv9vM.js} +1 -1
- package/dist/packem_shared/{lifecycle-DNz4d7ND.js → lifecycle-B-0T5Yuq.js} +1 -1
- package/dist/packem_shared/{manifests-CgyI-i-c.js → manifests-D7c5FRMX.js} +1 -1
- package/dist/packem_shared/{min-release-age-BpvYMZuT.js → min-release-age-D4LRTLUm.js} +1 -1
- package/dist/packem_shared/{missing-package-json-Bg72nt4h.js → missing-package-json-B9Xir-Vw.js} +1 -1
- package/dist/packem_shared/{multi-eco-lockfiles-BCGfTwHy.js → multi-eco-lockfiles-DT7U-DYp.js} +1 -1
- package/dist/packem_shared/{native-config-sync-em22UAUQ.js → native-config-sync-BKbgIItW.js} +1 -1
- package/dist/packem_shared/{osv-CjtVHCRP.js → osv-Bio6kt4F.js} +1 -1
- package/dist/packem_shared/{package-version-BzkcrNVE.js → package-version-DSr8JAeI.js} +1 -1
- package/dist/packem_shared/{packument-BvTjAHsy.js → packument-DbQ_r11E.js} +1 -1
- package/dist/packem_shared/{project-name-filter-DKFmLbwE.js → project-name-filter-BcztXZE-.js} +1 -1
- package/dist/packem_shared/{provenance-DFN3qbB3.js → provenance-DMbTd536.js} +1 -1
- package/dist/packem_shared/publish-missing-BCp0_pj1.js +35 -0
- package/dist/packem_shared/publish-report-DOXKGOAj.js +3 -0
- package/dist/packem_shared/{registry-CIfr2njA.js → registry-DSnDqaMj.js} +1 -1
- package/dist/packem_shared/{registry-keys-Cq92YoCx.js → registry-keys-AfmCDN0t.js} +1 -1
- package/dist/packem_shared/{renderToString-DR0zDUjh-BUpUCnJt.js → renderToString-DR0zDUjh-tkxcyz0F.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-CZlkR05q.js → resolve-explicit-58Z6lTQV.js} +1 -1
- package/dist/packem_shared/{run-summary-utils-BYPm6bUE.js → run-summary-utils-DkFMNNG6.js} +1 -1
- package/dist/packem_shared/{runtime-check-DUxn-Idd.js → runtime-check-B7QxGpK0.js} +1 -1
- package/dist/packem_shared/{s1ngularity-CPXsMMnh.js → s1ngularity-Cpp6-qlj.js} +1 -1
- package/dist/packem_shared/{scaffold-files-ojq9leuZ.js → scaffold-files-CHFgRMFa.js} +1 -1
- package/dist/packem_shared/{scan-progress-DBaFUryq.js → scan-progress-CvsykB5m.js} +1 -1
- package/dist/packem_shared/{selectors-aT_XJTrh.js → selectors-0QAupVtN.js} +1 -1
- package/dist/packem_shared/{signatures-C2HaWfZn.js → signatures-CoEhOr9P.js} +1 -1
- package/dist/packem_shared/{spinner-C23pifwn.js → spinner-qG4qR4qA.js} +1 -1
- package/dist/packem_shared/{table-CAjUuSN2.js → table-2p7PFkBg.js} +1 -1
- package/dist/packem_shared/{tabs-CogGAIWQ.js → tabs-DbOgtQo8.js} +1 -1
- package/dist/packem_shared/{toolchain-BF6NEQJ2.js → toolchain-COSpTkfG.js} +1 -1
- package/dist/packem_shared/{typosquats-MPA4DNWt.js → typosquats-2YY_t-BX.js} +1 -1
- package/dist/packem_shared/{use-measured-height-BHJ8aL73.js → use-measured-height-BHsk7UvV.js} +1 -1
- package/dist/packem_shared/{vis-update-app--aolEPqW.js → vis-update-app-BtSSrY1T.js} +1 -1
- package/dist/packem_shared/{vis-user-error-DUyARIaA.js → vis-user-error-BrIWyJ2j.js} +1 -1
- package/dist/packem_shared/{watch-loop-C7VCU587.js → watch-loop-ipSruNM2.js} +1 -1
- package/dist/release/index.d.ts +2 -0
- package/dist/release/index.js +1 -1
- package/index.js +26 -26
- package/package.json +9 -9
- package/dist/packem_shared/ReleaseClient-1hH9OIcb.js +0 -1
- package/dist/packem_shared/glob-Cyk1H9ZL-ChoYoZKK.js +0 -1
- package/dist/packem_shared/publish-missing-MxqARUPC.js +0 -35
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as n}from"./cli-main.js";import{d as u}from"../packem_shared/pm-runner-BXRi4ZM9.js";import{s as p}from"../packem_shared/native-config-sync-
|
|
1
|
+
import{p as n}from"./cli-main.js";import{d as u}from"../packem_shared/pm-runner-BXRi4ZM9.js";import{s as p}from"../packem_shared/native-config-sync-BKbgIItW.js";import{s as g}from"../packem_shared/min-release-age-D4LRTLUm.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-0dnGN3GP.js";import{p as e}from"./cli-main.js";import{d as _}from"../packem_shared/pm-runner-BXRi4ZM9.js";import{y as u}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as m}from"../packem_shared/package-version-
|
|
1
|
+
import{createRequire as g}from"node:module";import{e as p}from"../packem_shared/index-0dnGN3GP.js";import{p as e}from"./cli-main.js";import{d as _}from"../packem_shared/pm-runner-BXRi4ZM9.js";import{y as u}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as m}from"../packem_shared/package-version-DSr8JAeI.js";import{U as $}from"../packem_shared/env-B5goXAfs.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-BXRi4ZM9.js";import{r as m,l as w,L as v}from"../packem_shared/dependency-scan-
|
|
1
|
+
import{p}from"./cli-main.js";import{d as b}from"../packem_shared/pm-runner-BXRi4ZM9.js";import{r as m,l as w,L as v}from"../packem_shared/dependency-scan-CIhI1eyk.js";import{z as S,e as g}from"../packem_shared/index-0dnGN3GP.js";import{S as $}from"../packem_shared/lockfile-DhHAaHN5.js";import{e as x}from"../packem_shared/index-D1clv9vM.js";import{y as C}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{VisReleaseError as m}from"./VisReleaseError-DZtgcKf8.js";import{b as l}from"../packem_chunks/context.js";import{p as f,a as w}from"./publish-missing-BCp0_pj1.js";import{a as p}from"./apply-DA-Dv8Pq.js";const b=async(a={})=>{const e=await l(a),n=await p(e,{dryRun:a.dryRun});return{changedFiles:n.changedFiles,deletedFiles:n.deletedFiles,plan:n.plan}},F=async(a={})=>{const e=await l(a),{resolveFormatter:n}=await import("../packem_chunks/resolveFormatter.js"),t=await n(e.config.changelog,e.cwd),r=new Date().toISOString().slice(0,10),s=[];for(const c of e.plan.releases){const o=e.depGraph.getPackage(c.name);if(!o)continue;const g=await t({changeFiles:c.changeFiles,date:r,release:c,target:"changelog"});s.push({content:g,file:`${o.dir}/CHANGELOG.md`,package:c.name})}return{projectChangelogs:s}},R=async(a={})=>{const e=await l(a),n={dryRun:a.dryRun,otp:a.otp,tag:a.tag};return a.missing?await f(e,{...n,projects:a.projects}):{...await w(e,n),warnings:e.plan.warnings}},k=async(a={})=>{const e=await l(a);let n=!1,t;const r=async()=>{if(t)return t;n=!0;const s=await p(e,{dryRun:a.dryRun});return t={changedFiles:s.changedFiles,deletedFiles:s.deletedFiles,plan:s.plan},t};return{apply:r,discard:()=>{n=!0},plan:e.plan,[Symbol.asyncDispose]:async()=>{n||await r()}}},x=async a=>{const e=await l(a),{runSnapshot:n}=await import("../packem_chunks/snapshot.js"),t=await n({context:e,dryRun:a.dryRun,registry:a.registry,tag:a.tag});return{failed:t.failed,published:t.published,skipped:t.skipped,snapshotVersion:t.snapshotVersion,tag:t.tag}},P=async(a={})=>{const e=a.publishMissing&&!a.skipPublish?await f(await l(a),{dryRun:a.dryRun,projects:a.projects}):void 0;if(e&&e.failed.length>0)throw new m({code:"PUBLISH_FAILED",message:`Recovering unpublished versions failed, nothing new was versioned: ${e.failed.map(i=>`${i.name}: ${i.reason}`).join("; ")}`});const n=await l(a),t=await p(n,{dryRun:a.dryRun}),r={changedFiles:t.changedFiles,deletedFiles:t.deletedFiles,plan:t.plan},{resolveFormatter:s}=await import("../packem_chunks/resolveFormatter.js"),c=await s(n.config.changelog,n.cwd),o=new Date().toISOString().slice(0,10),g=[];for(const i of t.plan.releases){const h=n.depGraph.getPackage(i.name);if(!h)continue;const y=await c({changeFiles:i.changeFiles,date:o,release:i,target:"changelog"});g.push({content:y,file:`${h.dir}/CHANGELOG.md`,package:i.name})}const u={projectChangelogs:g};if(a.skipPublish)return{changelog:u,publish:{failed:[],published:[],skipped:[]},version:r};const d=await w(n,{dryRun:a.dryRun,otp:void 0,tag:void 0});return e&&(d.published.unshift(...e.published),d.skipped.unshift(...e.skipped)),{changelog:u,publish:{...d,warnings:[...new Set([...e?.warnings??[],...n.plan.warnings])]},version:r}};class D{constructor(e={}){this.config=e}config;releaseVersion(e={}){return b({...e,config:this.config})}releaseChangelog(e={}){return F({...e,config:this.config})}releasePublish(e={}){return R({...e,config:this.config})}releaseDraft(e={}){return k({...e,config:this.config})}releaseSnapshot(e){return x({...e,config:this.config})}}export{D as ReleaseClient,P as release,F as releaseChangelog,k as releaseDraft,R as releasePublish,x as releaseSnapshot,b as releaseVersion};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as N}from"node:module";import{L as M}from"./index-CIdjkZgt.js";import{advisoriesStatus as h,advisoriesQuery as k,NATIVE_BINDING_VERSION as E,advisoriesIngest as z}from"#native";import{V as S}from"./vis-user-error-
|
|
1
|
+
import{createRequire as N}from"node:module";import{L as M}from"./index-CIdjkZgt.js";import{advisoriesStatus as h,advisoriesQuery as k,NATIVE_BINDING_VERSION as E,advisoriesIngest as z}from"#native";import{V as S}from"./vis-user-error-BrIWyJ2j.js";let R;const T=e=>(R??=N(import.meta.url))(e),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=e=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[s,r]=m.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return m.getBuiltinModule(e)}return T(e)},{randomUUID:D}=l("node:crypto"),{existsSync:_,createWriteStream:U}=l("node:fs"),{mkdir:P,rm:w,rename:O,stat:L,unlink:V}=l("node:fs/promises"),{join:p,dirname:B}=l("node:path"),{Readable:x}=l("node:stream"),{pipeline:C}=l("node:stream/promises"),b=6;if(E!==b)throw new Error(`vis native binding ABI mismatch in advisories: expected ${b}, got ${E}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const oe="https://osv-vulnerabilities.storage.googleapis.com",W=new Set(["osv-vulnerabilities.storage.googleapis.com"]);class j extends Error{cause="DB_NOT_FOUND";constructor(s){super(`No local advisory DB at ${s}. Run 'vis advisories sync' first.`),this.name="AdvisoryDbNotFoundError"}}const v=2;class H extends Error{cause="DB_SCHEMA_OUTDATED";constructor(s,r){super(`Advisory DB at ${s} uses schema v${String(r)}; this build of vis needs v${String(v)}. Run 'vis advisories sync' to rebuild it.`),this.name="AdvisoryDbSchemaError"}}class F extends Error{cause="DB_REBUILD_FAILED";constructor(s,r,o){super(`Could not rebuild advisory DB at ${s} from schema v${String(r)} to v${String(v)}: ${o}. The existing file was left unchanged.`),this.name="AdvisoryDbRebuildError"}}const ne=e=>{const{schemaVersion:s}=h(e);return s<v?new H(e,s):void 0};class y extends Error{cause="SOURCE_NOT_ALLOWED";constructor(s){super(`Advisory source host '${s}' is not in the built-in allowlist. Add it to \`security.audit.advisories.allowedHosts\` if intentional.`),this.name="AdvisorySourceNotAllowedError"}}class $ extends Error{cause="SYNC_NETWORK";constructor(s,r){super(`Advisory sync failed for ${s}: ${r}. Check connectivity, proxy env vars, or --source.`),this.name="AdvisorySyncNetworkError"}}const f=e=>{const r=M("vis",{create:!0,cwd:e})??p(e,"node_modules",".cache","vis");return p(r,"advisories","db.sqlite")},G=(e,s)=>{let r;try{r=new URL(e)}catch{throw new y(e)}if(r.protocol!=="https:")throw new y(`${r.protocol}//${r.host}`);if(!new Set([...W,...s??[]]).has(r.host))throw new y(r.host);return r},A=["-wal","-shm","-journal"],g=async e=>{const s=`${e.dbPath}.${e.ecosystem}.${process.pid}.${D()}.zip.tmp`;try{const r=await I(e.zipUrl,{method:"GET"});if(!r.ok||!r.body)throw new $(e.zipUrl.toString(),r.status);const o=e.etag??r.headers.get("etag"),a=r.headers.get("content-length"),n=a?Number.parseInt(a,10):null;let i=0;const t=U(s),d=x.fromWeb(r.body);return e.onProgress&&n&&d.on("data",c=>{i+=c.byteLength,e.onProgress?.(i,n,"download")}),await C(d,t),await z({dbPath:e.dbPath,ecosystem:e.ecosystem,manifestEtag:o??void 0,zipPath:s},(c,u)=>e.onProgress?.(c,u,"ingest"))}finally{await V(s).catch(()=>{})}},K=async(e,s,r,o,a)=>{const n=`${s}.rebuild.${process.pid}.${D()}.tmp`;try{const i=await g({dbPath:n,ecosystem:e.ecosystem,etag:null,onProgress:e.onProgress,zipUrl:a(e.ecosystem)});for(const t of o)t!==e.ecosystem&&await g({dbPath:n,ecosystem:t,etag:null,onProgress:e.onProgress,zipUrl:a(t)});return await Promise.all(A.map(t=>w(`${s}${t}`,{force:!0}))),await O(n,s),i}catch(i){throw await Promise.all(["",...A].map(t=>w(`${n}${t}`,{force:!0}).catch(()=>{}))),new F(s,r,i instanceof Error?i.message:String(i))}},Y=(e,s)=>{if(!/^[A-Z0-9][\w.:-]*$/i.test(s))throw new S(`Advisory ecosystem "${s}" is not a valid OSV name.`);const r=J(e.toString()),o=new URL(`${s}/all.zip`,r);if(o.origin!==e.origin||!o.pathname.startsWith(new URL(r).pathname))throw new S(`Advisory ecosystem "${s}" resolves outside the configured advisory source.`);return o},ie=async e=>{const s=e.dbPath??f(e.workspaceRoot),r=G(e.source,e.allowedHosts),o=t=>Y(r,t);if(_(s)){const t=h(s);if(t.schemaVersion<v){const d=t.ecosystems.map(u=>u.name),c=await K(e,s,t.schemaVersion,d,o);return{advisoriesIngested:c.advisoriesIngested,dbPath:s,durationMs:c.durationMs,rebuiltFromSchema:t.schemaVersion,upToDate:!1}}}await P(B(s),{recursive:!0});const a=await Z(s,e.ecosystem);let n=null;if(!e.force){const t=await I(o(e.ecosystem),{method:"HEAD"});if(t.ok&&(n=t.headers.get("etag"),n&&a&&n===a))return{advisoriesIngested:0,dbPath:s,durationMs:0,upToDate:!0}}const i=await g({dbPath:s,ecosystem:e.ecosystem,etag:n,onProgress:e.onProgress,zipUrl:o(e.ecosystem)});return{advisoriesIngested:i.advisoriesIngested,dbPath:s,durationMs:i.durationMs,upToDate:!1}},Q=(e,s)=>`${e}@${s}`,ae=(e,s)=>{if(e.length===0)return new Map;const r=s.dbPath??f(s.workspaceRoot),o=s.ecosystem??"npm";if(!_(r))throw new j(r);const a=e.map(t=>({ecosystem:o,name:t.name,version:t.version})),n=k(r,a),i=new Map;for(const[t,d]of e.entries()){const c=n[t];!c||c.vulnerabilities.length===0||i.set(Q(d.name,d.version),c.vulnerabilities.map(u=>X(u)))}return i},ce=async(e,s)=>{const r=s??f(e);return h(r)},Z=async(e,s)=>{try{await L(e)}catch{return null}return h(e).ecosystems.find(a=>a.name===s)?.manifestEtag??null},X=e=>({aliases:e.aliases.length>0?e.aliases:void 0,cvssScore:e.cvssScore??void 0,fixedVersions:e.fixedVersions,id:e.id,severity:q(e.severity),summary:e.summary}),q=e=>{const s=e.toUpperCase();return s==="CRITICAL"||s==="HIGH"||s==="MODERATE"||s==="LOW"?s:"UNKNOWN"},J=e=>e.endsWith("/")?e:`${e}/`,I=async(e,s)=>{try{return await fetch(e,s)}catch(r){throw new $(e.toString(),r instanceof Error?r.message:String(r))}};export{v as A,oe as D,Q as a,ne as b,j as c,ce as g,ae as q,f as r,ie as s};
|
package/dist/packem_shared/{affected-selection-C3eYhoTa.js → affected-selection-D_APcBUH.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as F}from"node:module";import{m as q,e as M}from"./index-0dnGN3GP.js";import{collectExternalInputs as N,getAffectedProjects as U}from"@visulima/task-runner";import{i as J}from"./index-BjdW45xX.js";import{V as E}from"./vis-user-error-
|
|
1
|
+
import{createRequire as F}from"node:module";import{m as q,e as M}from"./index-0dnGN3GP.js";import{collectExternalInputs as N,getAffectedProjects as U}from"@visulima/task-runner";import{i as J}from"./index-BjdW45xX.js";import{V as E}from"./vis-user-error-BrIWyJ2j.js";import{r as L}from"./affected-shas-CycHU3nr.js";import{D as z}from"./env-B5goXAfs.js";let O;const P=e=>(O??=F(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,S=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[n,t]=h.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return h.getBuiltinModule(e)}return P(e)},{spawnSync:H}=S("node:child_process"),{mkdir:W,writeFile:D,rename:B,rm:C,readFile:V}=S("node:fs/promises"),k=new Set(["deep","direct","none"]),G=e=>{const n=[],t=e.split("\0");for(let s=0;s<t.length;s++){const r=t[s];if(!r||r.length<4)continue;const l=r.slice(0,2),f=r.slice(3);if(f&&n.push(f),l.includes("R")||l.includes("C")){s+=1;const g=t[s];g&&n.push(g)}}return n},K=e=>{const n=H("git",["status","--porcelain","-z"],{cwd:e,encoding:"utf8"});return n.error||n.status!==0||typeof n.stdout!="string"?[]:G(n.stdout)},Y=async e=>{try{const n=await V(e,"utf8"),t=JSON.parse(n);return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}catch{return}},Q=async(e,n)=>{const t=`${e}.${process.pid}.tmp`;try{await W(q(e),{recursive:!0}),await D(t,JSON.stringify(n)),await B(t,e)}catch{await C(t,{force:!0}).catch(()=>{})}},oe=async e=>{await C(e,{force:!0}).catch(()=>{})},ae=async(e,n,t={})=>{const s=e.downstream??"deep",r=e.upstream??"none";if(!k.has(s))throw new E(`Invalid --downstream value: "${s}". Must be "none", "direct", or "deep".`);if(!k.has(r))throw new E(`Invalid --upstream value: "${r}". Must be "none", "direct", or "deep".`);const{fileOwners:l,namedInputs:f,projectGraph:g,projects:I,targetDefaults:$,workspaceRoot:u}=n,i=[];let{base:m}=e,{head:c}=e;if(!m||!c){const p=L({defaultBase:t.defaultBase,workspaceRoot:u});m=m||p.base,c=c||p.head,i.push(`Resolved affected refs from ${p.provider} (${p.notes.join("; ")})`)}const b=t.runningInCi??J,y=c==="HEAD"||c==="",R=e.uncommitted??(!b&&y);let d=[];if(R)if(y){const _=(t.readWorkingTreeChanges??K)(u),A=Object.values(I).map(a=>a.root?.replace(/\/$/,"")).filter(a=>!!a&&a!==".");d=_.filter(a=>l!==void 0&&Object.hasOwn(l,a)||A.some(x=>a===x||a.startsWith(`${x}/`)));const j=_.length-d.length;d.length>0&&i.push(`including ${d.length} uncommitted working-tree file(s)`),j>0&&i.push(`ignoring ${j} uncommitted path(s) outside any project (untracked scratch would otherwise mark every project affected)`)}else i.push(`ignoring --uncommitted: --head=${c} pins the comparison to a commit, not the working tree`);const w=N(u,I,{namedInputs:f,targetDefaults:$}),v=t.externalInputStatePath??M(u,z,"external-inputs.json"),T=w.length>0?await Y(v):void 0,o=await U({additionalChangedFiles:d,base:m,downstream:s,externalInputs:w,fileOwners:l,head:c,ignoredFiles:t.affectedIgnore,previousExternalInputHashes:T,projectGraph:g,projects:I,upstream:r,workspaceRoot:u});return w.length>0&&o.externalInputHashes&&t.persistExternalInputState!==!1&&await Q(v,o.externalInputHashes),o.changedExternalInputs&&o.changedExternalInputs.length>0&&i.push(`including ${o.changedExternalInputs.length} changed external input(s) outside the workspace`),o.ignoredFiles.length>0&&i.push(`ignoring ${o.ignoredFiles.length} changed path(s) outside any project matching affectedIgnore`),{...o,externalInputStatePath:w.length>0?v:void 0,notes:i,uncommittedFileCount:d.length}};export{oe as i,Q as p,ae as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as Z}from"node:module";import{O as ie}from"./renderToString-DR0zDUjh-
|
|
1
|
+
import{createRequire as Z}from"node:module";import{O as ie}from"./renderToString-DR0zDUjh-tkxcyz0F.js";import{R as v,X as ce,O as k}from"./registry-DSnDqaMj.js";import{q as de}from"./table-2p7PFkBg.js";import{a as le,c as ue,d as pe,e as me}from"./ai-cache-CAwR0t_H.js";let ee;const te=e=>(ee??=Z(import.meta.url))(e),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,E=e=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[n,t]=y.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return y.getBuiltinModule(e)}return te(e)},{spawn:ne,execFileSync:G,execFile:se}=E("node:child_process"),{existsSync:_,readFileSync:oe}=E("node:fs"),{platform:re,homedir:q}=E("node:os"),{join:h,win32:R}=E("node:path"),{StringDecoder:$}=E("node:string_decoder"),{promisify:ae}=E("node:util"),fe=/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/,he=5e3,ge=1e4,ve=3e5,be=4096,O=re()==="win32",U=["amp","claude","codex","copilot","crush","cursor","droid","gemini","kimi","opencode","qwen"],ke={alternateCommands:[],buildArgs:(e,{dangerous:n})=>{const t=["-x",e];return n&&t.push("--dangerously-allow-all"),t},command:"amp",defaultModel:"",displayName:"Amp",envVariable:"AMP_PATH",sessionMarkers:[{confidence:"definite",variable:"AMP_CURRENT_THREAD_ID"},{confidence:"definite",equals:"amp",variable:"AGENT"}],supportsMaxTokens:!1,supportsModel:!1},Ae={alternateCommands:[],buildArgs:(e,{dangerous:n,model:t})=>{const s=[];return n&&s.push("--dangerously-skip-permissions"),t&&s.push("--model",t),s.push("--output-format","text","-p",e),s},command:"claude",defaultModel:"",displayName:"Claude Code",envVariable:"CLAUDE_PATH",sessionMarkers:[{confidence:"definite",variable:"CLAUDECODE"},{confidence:"definite",variable:"CLAUDE_CODE"}],supportsMaxTokens:!1,supportsModel:!0},Ee={alternateCommands:["openai-codex"],buildArgs:(e,{dangerous:n,model:t})=>{const s=["exec"];return t&&s.push("--model",t),n&&s.push("--dangerously-bypass-approvals-and-sandbox"),s.push("--",e),s},command:"codex",defaultModel:"",displayName:"Codex",envVariable:"CODEX_PATH",sessionMarkers:[{confidence:"definite",variable:"CODEX_SANDBOX"},{confidence:"definite",variable:"CODEX_THREAD_ID"},{confidence:"definite",variable:"CODEX_CI"}],supportsMaxTokens:!1,supportsModel:!0},Ce={alternateCommands:[],buildArgs:(e,{dangerous:n,model:t})=>{const s=["-p",e];return n&&s.push("--allow-all-tools"),t&&s.push("--model",t),s},command:"copilot",defaultModel:"",displayName:"GitHub Copilot CLI",envVariable:"COPILOT_PATH",sessionMarkers:[{confidence:"definite",variable:"COPILOT_MODEL"},{confidence:"definite",variable:"COPILOT_ALLOW_ALL"},{confidence:"definite",variable:"COPILOT_GITHUB_TOKEN"},{agent:"GitHub Copilot in VS Code",confidence:"definite",label:"TERM_PROGRAM+GIT_PAGER",match:{all:[["TERM_PROGRAM","vscode"],["GIT_PAGER","cat"]],none:["CURSOR_TRACE_ID"]}}],supportsMaxTokens:!1,supportsModel:!0},ye={alternateCommands:[],buildArgs:(e,{dangerous:n,model:t})=>{const s=["run"];return n&&s.push("--yolo"),t&&s.push("-m",t),s.push("--",e),s},command:"crush",defaultModel:"",displayName:"Crush",envVariable:"CRUSH_PATH",sessionMarkers:[{confidence:"definite",equals:"1",variable:"CRUSH"},{confidence:"definite",equals:"crush",variable:"AGENT"}],supportsMaxTokens:!1,supportsModel:!0},we={alternateCommands:["cursor"],buildArgs:(e,{dangerous:n,model:t})=>{const s=["-p"];return n&&s.push("--force"),s.push("--output-format","text"),t&&s.push("--model",t),s.push("--",e),s},command:"agent",defaultModel:"",displayName:"Cursor Agent",envVariable:"CURSOR_PATH",sessionMarkers:[{confidence:"definite",variable:"CURSOR_AGENT"},{confidence:"definite",label:"CURSOR_TRACE_ID+PAGER",match:{all:["CURSOR_TRACE_ID",["PAGER","head -n 10000 | cat"]]}},{agent:"Cursor editor",confidence:"ambient",variable:"CURSOR_TRACE_ID"}],supportsMaxTokens:!1,supportsModel:!0},Se={alternateCommands:[],buildArgs:(e,{dangerous:n,model:t})=>{const s=[];return n&&s.push("--skip-permissions-unsafe"),s.push("-o","text"),t&&s.push("-m",t),s.push("--",e),s},command:"droid",defaultModel:"",displayName:"Droid",envVariable:"DROID_PATH",sessionMarkers:[],supportsMaxTokens:!1,supportsModel:!0},Me={alternateCommands:["gemini-cli"],buildArgs:(e,{dangerous:n,maxTokens:t,model:s})=>{const o=[];return n||o.push("--sandbox"),s&&o.push("--model",s),o.push("--max-output-tokens",String(t),"-p",e),o},command:"gemini",defaultModel:"gemini-2.5-pro",displayName:"Gemini CLI",envVariable:"GEMINI_PATH",sessionMarkers:[{confidence:"definite",label:"GEMINI_CLI",match:{all:["GEMINI_CLI"],none:["QWEN_CODE"]}}],supportsMaxTokens:!0,supportsModel:!0},_e={alternateCommands:[],buildArgs:(e,{model:n})=>{const t=["--quiet","-p",e];return n&&t.push("-m",n),t},command:"kimi",defaultModel:"",displayName:"Kimi CLI",envVariable:"KIMI_PATH",sessionMarkers:[],supportsMaxTokens:!1,supportsModel:!0},Re={alternateCommands:[],buildArgs:(e,{model:n})=>{const t=["run"];return n&&t.push("-m",n),t.push("--",e),t},command:"opencode",defaultModel:"",displayName:"opencode",envVariable:"OPENCODE_PATH",sessionMarkers:[{confidence:"definite",label:"OPENCODE",match:{any:["OPENCODE","OPENCODE_BIN_PATH","OPENCODE_SERVER","OPENCODE_APP_INFO","OPENCODE_MODES","OPENCODE_CLIENT"]}}],supportsMaxTokens:!1,supportsModel:!0},Oe={alternateCommands:["qwen-code"],buildArgs:(e,{dangerous:n,model:t})=>{const s=["-p",e];return n&&s.push("--yolo"),s.push("-o","text"),t&&s.push("-m",t),s},command:"qwen",defaultModel:"",displayName:"Qwen Code",envVariable:"QWEN_PATH",sessionMarkers:[{confidence:"definite",equals:"1",variable:"QWEN_CODE"}],supportsMaxTokens:!1,supportsModel:!0},F={amp:ke,claude:Ae,codex:Ee,copilot:Ce,crush:ye,cursor:we,droid:Se,gemini:Me,kimi:_e,opencode:Re,qwen:Oe};class A extends Error{exitCode;durationMs;provider;stderr;stdout;timedOut;aborted;constructor(n,t){super(n),this.name="AiRunError",this.provider=t.provider,this.exitCode=t.exitCode??null,this.durationMs=t.durationMs,this.stdout=t.stdout??"",this.stderr=t.stderr??"",this.timedOut=t.timedOut??!1,this.aborted=t.aborted??!1}}const Te=/"%~?dp0%?\\?([^"]+?\.[cm]?js)"/i,Ie=(e,n)=>{const t=Te.exec(e)?.[1];if(t!==void 0)return R.resolve(R.dirname(n),t)},Ne=e=>{let n;try{n=oe(e,"utf8")}catch{return}const t=Ie(n,e);if(t!==void 0)return _(t)?t:void 0},Le=e=>{const n=R.join(R.dirname(e),"node.exe");return _(n)?n:"node"};ae(se);const xe=/\.(?:bat|cmd)$/i,j=e=>`"${e.replaceAll('"','""')}"`,B=(e,n=O)=>{if(!n||!xe.test(e))return{file:e,mode:"direct",prefixArguments:[]};const t=Ne(e);return t!==void 0?{file:Le(e),mode:"direct",prefixArguments:[t]}:{commandPath:e,mode:"shell"}},K=(e,n)=>e.mode==="shell"?{file:j(e.commandPath),shell:!0,spawnArguments:n.map(t=>j(t))}:{file:e.file,shell:!1,spawnArguments:[...e.prefixArguments,...n]},V=e=>e==="~"||e.startsWith("~/")||O&&e.startsWith("~\\")?h(q(),e.slice(2)):e,Pe=e=>{try{const n=G(O?"where":"which",[e],{encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:he}).trim().split(`
|
|
2
2
|
`)[0]?.trim();return n&&n.length>0?n:void 0}catch{return}},De=e=>{const n=q();if(O){const t=process.env.APPDATA??"",s=process.env.LOCALAPPDATA??"",o=process.env.ProgramFiles??"";return[h(t,"npm",`${e}.cmd`),h(t,"npm",e),h(s,"Programs",e,`${e}.exe`),h(o,e,`${e}.exe`),h(n,".npm-global","bin",`${e}.cmd`)]}return[`/opt/homebrew/bin/${e}`,`/usr/local/bin/${e}`,h(n,".npm-global","bin",e),h(n,".local","bin",e),h(n,".cargo","bin",e)]},$e=e=>{try{const{file:n,shell:t,spawnArguments:s}=K(B(e),["--version"]),o=G(n,s,{encoding:"utf8",shell:t,stdio:["pipe","pipe","pipe"],timeout:ge}),r=fe.exec(o);return r?r[1]:void 0}catch{return}},X=(e,n={})=>{const t=F[e],s={available:!1,name:e},o=n.version!==!1,r=i=>{if(o)return $e(i)},a=process.env[t.envVariable];if(a&&_(V(a))){const i=V(a);return{...s,available:!0,detectionMethod:"envvar",path:i,version:r(i)}}const l=[t.command,...t.alternateCommands];for(const i of l){const c=Pe(i);if(c)return{...s,available:!0,detectionMethod:"which",path:c,version:r(c)}}for(const i of l)for(const c of De(i))if(_(c))return{...s,available:!0,detectionMethod:"known-path",path:c,version:r(c)};return s},je=(e={})=>U.map(n=>X(n,e)),Ve=(e={})=>je(e).filter(n=>n.available),He=(e,n,t={})=>{const s=F[e],o=t.model??s.defaultModel,r=t.maxTokens!==void 0&&Number.isFinite(t.maxTokens)?t.maxTokens:be;return s.buildArgs(n,{dangerous:t.dangerous===!0,maxTokens:r,model:o})},Ge=async(e,n,t={})=>{if(!e.available||!e.path)throw new A(`AI provider "${e.name}" is not available.`,{durationMs:0,provider:e.name});const s=He(e.name,n,t),o=t.timeoutMs!==void 0&&Number.isFinite(t.timeoutMs)?t.timeoutMs:ve,r=e.path,a=K(B(r),s),l=Date.now();if(t.signal?.aborted)throw new A(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:0,provider:e.name});return new Promise((i,c)=>{const f={cwd:t.cwd,env:{...process.env,...t.env,FORCE_COLOR:"0",NO_COLOR:"1"},shell:a.shell,stdio:["pipe","pipe","pipe"]},d=ne(a.file,a.spawnArguments,f);d.stdin?.end();let m="",g="",b=!1;const N=new $("utf8"),L=new $("utf8");let w,x,S;const T=()=>{clearTimeout(x),S&&t.signal?.removeEventListener("abort",S)},Q=()=>{d.kill("SIGKILL")},P=p=>{if(b)return;b=!0,d.kill("SIGTERM"),w=setTimeout(Q,5e3),w.unref(),T();const u=Date.now()-l,C=p?new A(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:u,provider:e.name,stderr:g,stdout:m}):new A(`${e.name} CLI timed out after ${String(o)}ms`,{durationMs:u,provider:e.name,stderr:g,stdout:m,timedOut:!0});c(C)};x=setTimeout(P,o,!1),S=()=>{P(!0)},t.signal?.addEventListener("abort",S,{once:!0}),d.stdout?.on("data",p=>{const u=N.write(p);u&&(m+=u,t.onStdout?.(u))}),d.stderr?.on("data",p=>{const u=L.write(p);u&&(g+=u,t.onStderr?.(u))}),d.on("close",p=>{clearTimeout(w);const u=N.end();u&&(m+=u,t.onStdout?.(u));const C=L.end();if(C&&(g+=C,t.onStderr?.(C)),b)return;b=!0,T();const D=Date.now()-l;p===0?i({durationMs:D,exitCode:p,provider:e.name,stderr:g,stdout:m}):c(new A(`${e.name} CLI exited with code ${String(p)}: ${g||m}`,{durationMs:D,exitCode:p,provider:e.name,stderr:g,stdout:m}))}),d.on("error",p=>{clearTimeout(w),!b&&(b=!0,T(),c(new A(`Failed to spawn ${e.name} CLI: ${p.message}`,{durationMs:Date.now()-l,provider:e.name,stderr:g,stdout:m})))})})},qe=12e4,Ue=2,Fe=1e3,Be=e=>new Promise(n=>{setTimeout(n,e)}),J=async(e,n,t=Ue)=>{let s;for(let o=0;o<=t;o+=1)try{return(await Ge(e,n,{timeoutMs:qe})).stdout}catch(r){if(s=r instanceof Error?r:new Error(String(r)),s.message.includes("timed out"))throw s;if(o<t){const a=Fe*2**o;await Be(a)}}throw s??new Error("AI request failed after retries")},Ke={amp:30,claude:80,codex:60,copilot:50,crush:35,cursor:40,droid:20,gemini:100,kimi:25,opencode:35,qwen:30},Xe=e=>{if(e?.provider){if(!U.includes(e.provider))return;const s=X(e.provider);return s.available?s:void 0}const n=Ve();if(n.length===0)return;const t={...Ke,...e?.priority};return n.toSorted((s,o)=>(t[o.name]??0)-(t[s.name]??0))[0]},Je=new Set(["defer","review","skip","update"]),We=new Set(["critical","high","low","medium"]),Ye=new Set(["high","low","medium"]),ze=50,I=30,Qe=e=>e.map(n=>{const t=n.vulnerabilities&&n.vulnerabilities.length>0?` [VULNERABILITIES: ${n.vulnerabilities.map(o=>`${o.severity} ${o.id}`).join(", ")}]`:"";let s="";if(n.socketReport){const o=Math.round(n.socketReport.score.overall*100),r=[`score:${String(o)}%`];if(n.socketReport.alerts.length>0){const a={};for(const i of n.socketReport.alerts)a[i.severity]=(a[i.severity]??0)+1;const l=Object.entries(a).map(([i,c])=>`${String(c)} ${i}`).join(", ");r.push(`alerts: ${l}`)}r.push(`supply-chain:${String(Math.round(n.socketReport.score.supplyChain*100))}%`),r.push(`quality:${String(Math.round(n.socketReport.score.quality*100))}%`),s=` [SOCKET.DEV: ${r.join(", ")}]`}return`- ${n.packageName}: ${n.currentRange} → ${n.newRange} (${n.updateType})${t}${s}`}).join(`
|
|
3
3
|
`),M=`Respond ONLY with valid JSON in this exact structure:
|
|
4
4
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as v}from"node:module";import{x as p}from"./xxh3-BLHlvhgT.js";import{e as c}from"./index-0dnGN3GP.js";import{g as M,h as $}from"./env-
|
|
1
|
+
import{createRequire as v}from"node:module";import{x as p}from"./xxh3-BLHlvhgT.js";import{e as c}from"./index-0dnGN3GP.js";import{g as M,h as $}from"./env-B5goXAfs.js";import{y as d}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as g}from"./package-version-DSr8JAeI.js";let C;const D=t=>(C??=v(import.meta.url))(t),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=t=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[e,r]=a.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return a.getBuiltinModule(t)}return D(t)},{randomUUID:j}=h("node:crypto"),{rmSync:f,writeFileSync:w,renameSync:T,unlinkSync:A,readdirSync:m,statSync:b}=h("node:fs"),i=()=>c(M(),"ai"),B=3600*1e3,E=1800*1e3,_=()=>{$(i())},S=(t,e)=>{const r=`${t}.${String(process.pid)}.${j()}.tmp`;try{w(r,e,"utf8"),T(r,t)}catch(o){try{A(r)}catch{}throw o}},P=(t,e,r)=>{const o=r.map(n=>({currentRange:n.currentRange,name:n.packageName,targetVersion:n.targetVersion})).toSorted((n,l)=>n.name.localeCompare(l.name)),s=JSON.stringify({analysisType:e,packages:o,provider:t});return p(Buffer.from(s))},U=t=>{const e=c(i(),`${t}.json`);if(d(e))try{const r=g(e);if(Date.now()-r.createdAt>r.ttlMs){f(e,{force:!0});return}return r.result}catch{f(e,{force:!0});return}},k=(t,e,r)=>{_();const o=i(),s={createdAt:Date.now(),result:e,ttlMs:r};S(c(o,`${t}.json`),JSON.stringify(s,void 0,2))},z=(t,e)=>e!==void 0&&e>0?e:t==="security"?E:B,F=()=>{const t=i();if(!d(t))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const e=m(t).filter(n=>n.endsWith(".json"));let r=0,o,s;for(const n of e){const l=c(t,n),y=b(l);r+=y.size;const{mtimeMs:u}=y;(o===void 0||u<o)&&(o=u),(s===void 0||u>s)&&(s=u)}return{entries:e.length,newestEntry:s,oldestEntry:o,totalSizeBytes:r}},L=t=>p(Buffer.from(JSON.stringify(t))),V=t=>{const e=c(i(),`${t}.json`);if(d(e))try{const r=g(e);if(Date.now()-r.createdAt>r.ttlMs){f(e,{force:!0});return}return r.result}catch{f(e,{force:!0});return}},W=(t,e,r)=>{_();const o=i(),s={createdAt:Date.now(),result:e,ttlMs:r};S(c(o,`${t}.json`),JSON.stringify(s,void 0,2))},H=()=>{const t=i();if(!d(t))return 0;const e=m(t).filter(r=>r.endsWith(".json"));for(const r of e)f(c(t,r),{force:!0});return e.length};export{P as a,L as b,U as c,k as d,z as e,H as f,V as g,F as h,W as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as T}from"node:module";import{readLastRunSummary as _}from"@visulima/task-runner";import{a as $}from"./failure-log-
|
|
1
|
+
import{createRequire as T}from"node:module";import{readLastRunSummary as _}from"@visulima/task-runner";import{a as $}from"./failure-log-CcPGcBQL.js";import{f as v,a as P,d as D,r as j}from"./run-summary-utils-DkFMNNG6.js";import{d as E}from"./env-B5goXAfs.js";import{v as x,U as y,e as R,a as L}from"./index-0dnGN3GP.js";import{a as M,b as B,e as H}from"./ai-analysis-CXV3P9IN.js";import{g as C,s as U,b as k}from"./ai-cache-CAwR0t_H.js";let I;const F=e=>(I??=T(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,O=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[t,n]=h.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return h.getBuiltinModule(e)}return F(e)},{readFile:N,writeFile:A}=O("node:fs/promises"),q=32*1024,W=(e,t)=>{if(e.length<=t)return e;const n=e.slice(-t),o=e.length-n.length;return`[…${String(o)} bytes truncated from head…]
|
|
2
2
|
${n}`},J=async(e,t)=>t===void 0?_(e,{dataDirectory:E(e)}):j(e,t),le=async(e,t,n={})=>{const o=n.terminalOutputLimit??q,[r,i]=await Promise.all([$(e,t),J(e,n.runId)]),s=i?v(i,t):void 0;if(!r&&!s)return;let a,c;if(i&&s){const u=await P(e,i.id),f=u?v(u,t):void 0;a=D(s.hashDetails,f?.hashDetails),c=u?.id}const d=r?.terminalOutput??"";return{command:r?.command??void 0,cwd:r?.cwd??void 0,dependencies:s?.dependencies??[],duration:s?.duration,exitCode:r?.exitCode??s?.exitCode,hash:s?.hash??r?.hash,hashDetails:s?.hashDetails,hashDiff:a,previousRunId:c,project:s?.target.project,runId:i?.id??r?.runId,status:r?.status??(s?K(s):void 0),target:s?.target.target,taskId:t,terminalOutput:W(d,o),terminalOutputCaptured:!!r,timestamp:r?.timestamp??s?.endTime??s?.startTime}},K=e=>{if(e.exitCode!==void 0&&e.exitCode!==0)return"failure";switch(e.cacheStatus){case"HIT":return"local-cache";case"REMOTE_HIT":return"remote-cache";case"SKIPPED":return"skipped";default:return e.exitCode===0?"success":void 0}},Y=3600*1e3,w=80,V=new Set(["high","low","medium"]),X=()=>`You are an expert software engineer helping fix a failing build/test/lint task.
|
|
3
3
|
|
|
4
4
|
You will be given:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as v}from"node:module";import{t as T}from"./compile-cache-DoMHRsRZ.js";import{a as w,c as R,i as $,t as M,u as m,g as S}from"./package-version-
|
|
1
|
+
import{createRequire as v}from"node:module";import{t as T}from"./compile-cache-DoMHRsRZ.js";import{a as w,c as R,i as $,t as M,u as m,g as S}from"./package-version-DSr8JAeI.js";import{i as j}from"./index-BjdW45xX.js";let _;const x=s=>(_??=v(import.meta.url))(s),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=s=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[e,o]=t.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return t.getBuiltinModule(s)}return x(s)},{createRequire:y}=b("node:module");let N;const O=s=>(N??=y(import.meta.url))(s),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=s=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[e,o]=r.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return r.getBuiltinModule(s)}return O(s)},{execFileSync:C}=f("node:child_process"),{totalmem:I}=f("node:os"),q=/--max-old-space-size=(\d+)/,z=/--max-semi-space-size=(\d+)/,E=s=>Math.floor(I()/1024/1024*s),P=s=>s<=512?4:s<=1024?8:s<=2048?16:s<=4096?32:s<=8192?64:Math.floor(Math.log2(s))*8,d=(s,e)=>{for(const o of e){const n=s.exec(o);if(n)return Number.parseInt(n[1],10)}},B=s=>{const o=[...w()],n=[...R()],a=d(q,o),p=d(z,o);if(a!==void 0&&p!==void 0)return;const l=a??E(.75),g=p??P(l),c=[];if(a===void 0&&c.push(`--max-old-space-size=${String(l)}`),p===void 0&&c.push(`--max-semi-space-size=${String(g)}`),c.length!==0)try{C($(),[...c,...o,...n.slice(1)],{env:M(),stdio:"inherit"}),m(0)}catch(h){const u=h.status;m(typeof u=="number"?u:1)}},V=()=>{process.env.VIS_VERSION=S()},H=s=>{!process.stdout.isTTY||j||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${s}\x07`)},A=new Set(["","--help","--version","-h","-v","completion","dlx","exec","x"]),i=process.argv[2]??"";!A.has(i)&&!process.argv.includes("--help")&&!process.argv.includes("-h")&&B();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");V();T();(async()=>{if(i==="__pm-shim"){const{dispatchShim:e}=await import("../packem_chunks/dispatch.js");e(process.argv[3]??"",process.argv.slice(4));return}if(i==="x"){const{runLeanX:e}=await import("../packem_chunks/lean.js");await e(process.argv.slice(3));return}if(i==="exec"||i==="dlx"){const{runExecCli:e}=await import("../packem_chunks/cli-exec.js");await e();return}const{runCli:s}=await import("../packem_chunks/cli-main.js").then(e=>e.ap);await s()})();export{H as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as W}from"node:module";import{e as h}from"./index-0dnGN3GP.js";import{y as g}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as O}from"./package-version-
|
|
1
|
+
import{createRequire as W}from"node:module";import{e as h}from"./index-0dnGN3GP.js";import{y as g}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as O}from"./package-version-DSr8JAeI.js";let S;const B=e=>(S??=W(import.meta.url))(e),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[s,n]=_.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return _.getBuiltinModule(e)}return B(e)},{readdirSync:y,statSync:M}=w("node:fs"),P=["preinstall","install","postinstall","prepare"],$=e=>{const s=h(e,"node_modules");if(!g(s))return[];const n=new Map,o=(p,f="")=>{let l;try{l=y(p)}catch{return}for(const r of l){const i=h(p,r);if(r.startsWith("@")){o(i,`${r}/`);continue}if(r===".pnpm"&&f===""){let u;try{u=y(i)}catch{continue}for(const a of u){const c=h(i,a,"node_modules");g(c)&&o(c)}continue}if(r.startsWith("."))continue;const m=f+r,t=h(i,"package.json");try{if(!M(i).isDirectory()||!g(t))continue;const u=O(t),a=u.scripts??{},c=P.filter(v=>a[v]);!a.preinstall&&!a.install&&!a.postinstall&&g(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 u.version=="string"?u.version:void 0});const d=h(i,"node_modules");g(d)&&o(d)}catch{}}};return o(s),[...n.values()]},b=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)}},k=(e,s,n)=>{for(const[o,p]of Object.entries(s)){if(!p)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:f,version:l}=b(o);if(f===e.name&&(!n||l===void 0||e.version===l))return!0}return!1},q=(e,s,n={})=>{const o=n.pinVersions===!0,p=$(e),f=[],l=[],r=new Map(p.map(t=>[t.name,t]));for(const t of p)k(t,s,o)?l.push(t):f.push(t);const i=[],m=[];for(const[t,u]of Object.entries(s)){if(!u)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(j=>j.startsWith(v))||i.push(t);continue}const{name:a,version:c}=b(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:l,unapproved:f,versionDrift:m}},T=(e,s)=>q(e,s).unapproved.map(n=>`${n.name} (${n.hooks.join(", ")})`);export{q as a,T as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as l,z as d}from"./index-0dnGN3GP.js";import{S as m}from"./lockfile-DhHAaHN5.js";import{h as g,i as D}from"./registry-
|
|
1
|
+
import{e as l,z as d}from"./index-0dnGN3GP.js";import{S as m}from"./lockfile-DhHAaHN5.js";import{h as g,i as D}from"./registry-DSnDqaMj.js";import{y as S}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";const k={vite:"Separate vite copies each load their own plugin and config state. Pin one version with a package manager override.",vitest:"Separate vitest copies each keep their own expect, mocks and runner state. Pin one version with a package manager override."},P={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"}},b=t=>{const o=P[t];return o?[...o.aliases??[],o.file].map(n=>({file:n,type:o.type})):[]},h=(t,o)=>{const n=b(o);if(n.length!==0)return n.find(r=>S(l(t,r.file)))??n[n.length-1]},v=t=>{try{return JSON.parse(d(t))}catch{return}},y=t=>{const o=[],n=v(l(t,"package.json"));n&&o.push(n);const r=g(t);let c;if(r?c=r:n?.workspaces&&(Array.isArray(n.workspaces)?c=n.workspaces:n.workspaces.packages&&(c=n.workspaces.packages)),!c)return o;const i=D(t,c);for(const s of i){const e=v(l(t,s,"package.json"));e&&o.push(e)}return o},w=(t,o)=>{const n=new Set,r=[],c=new Map;for(const s of o){const e=c.get(s.name);e?e.push(s):c.set(s.name,[s])}const i=s=>{if(s)for(const e of Object.keys(s))n.has(e)||(n.add(e),r.push(e))};for(const s of y(t))i(s.dependencies),i(s.peerDependencies),i(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),e=c.get(s);if(e){for(const a of e)for(const f of[a.dependencies,a.peerDependencies,a.optionalDependencies])if(f)for(const p of Object.keys(f))n.has(p)||(n.add(p),r.push(p))}}return n},L=(t,o,n={})=>{const r=h(t,o);if(!r)return[];let c;try{c=d(l(t,r.file))}catch{return[]}const i=m(c,r.type);if(i.length===0)return[];const e=n.includeDev??!0?void 0:w(t,i),a=new Set,f=[];for(const p of i){if(e&&!e.has(p.name))continue;const u=`${p.name}@${p.version}`;a.has(u)||(a.add(u),f.push({isDev:!1,name:p.name,version:p.version}))}return f},O=(t,o)=>{const n=h(t,o);if(!n)return[];let r;try{r=d(l(t,n.file))}catch{return[]}const c=m(r,n.type);if(c.length===0)return[];const i=new Map;for(const e of c)i.has(e.name)||i.set(e.name,new Set),i.get(e.name).add(e.version);const s=[];for(const[e,a]of i){if(a.size<=1)continue;const f={name:e,versions:[...a]};k[e]&&(f.hint=k[e]),s.push(f)}return s.sort((e,a)=>e.name.localeCompare(a.name))},M=(t,o)=>{const n=h(t,o);if(!n)return;let r;try{r=d(l(t,n.file))}catch{return}const c=m(r,n.type);if(c.length===0)return;const i=[],s=new Set;for(const e of y(t))for(const a of[e.dependencies,e.devDependencies,e.peerDependencies,e.optionalDependencies])if(a)for(const[f,p]of Object.entries(a)){const u=`${f}@${p}`;s.has(u)||(s.add(u),i.push({name:f,version:p}))}return{entries:c,roots:i}};export{P as L,M as a,O as f,L as l,h as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c}from"./index-0dnGN3GP.js";import{y as a}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as i}from"./package-version-
|
|
1
|
+
import{e as c}from"./index-0dnGN3GP.js";import{y as a}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as i}from"./package-version-DSr8JAeI.js";const g=(n,e)=>{for(const o of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const t=n[o];if(t&&typeof t[e]=="string")return t[e]}},k=(n,e)=>{for(const o of e){const t=c(n,o);if(a(t))return t}},d=n=>{const e=c(n,"package.json");if(!a(e))return{};try{return i(e)}catch{return{}}},l=(n,e)=>{const o=d(n),t=new Map;for(const r of e){const s=r.detect(n,o);s&&t.set(r.id,s)}return t};export{l as a,g as d,k as f,d as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as Xs}from"node:module";import{e as Le,a as to,m as _i}from"./index-0dnGN3GP.js";import{h as so,S as oo}from"./index-BisalDCf.js";import{y as fo}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as ns}from"./package-version-
|
|
1
|
+
import{createRequire as Xs}from"node:module";import{e as Le,a as to,m as _i}from"./index-0dnGN3GP.js";import{h as so,S as oo}from"./index-BisalDCf.js";import{y as fo}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as ns}from"./package-version-DSr8JAeI.js";import{U as ut,h as lo}from"./env-B5goXAfs.js";let Zs;const eo=a=>(Zs??=Xs(import.meta.url))(a),zr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ro=a=>{if(typeof zr<"u"&&zr.versions&&zr.versions.node){const[g,C]=zr.versions.node.split(".").map(Number);if(g>22||g===22&&C>=3||g===20&&C>=16)return zr.getBuiltinModule(a)}return eo(a)},{rmSync:ki,existsSync:es,readFileSync:at,cpSync:rs,lstatSync:no,readdirSync:io}=ro("node:fs");class Ze extends Error{constructor(g){super(g),this.name="LockfilePruneError"}}const is=a=>{let g=a.startsWith("/")?a.slice(1):a;const C=g.indexOf("(");return C!==-1&&(g=g.slice(0,C)),g},co=(a,g)=>{if(!(g.startsWith("link:")||g.startsWith("file:")||g.startsWith("workspace:")))return`${a}@${g}`},ao=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))h?.version&&g.push({name:s,version:h.version});return g},pt=a=>{const g=[];for(const C of[a.dependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))typeof h=="string"&&g.push({name:s,version:h});return g},ht=a=>{const g=new Map;if(!a)return g;for(const C of Object.keys(a)){const s=is(C),h=g.get(s);h?h.push(C):g.set(s,[C])}return g},ts=a=>{const g=a.displayName??"pnpm-lock.yaml",C=typeof a.lockfileContent=="string"?a.lockfileContent:a.lockfileContent.toString("utf8");let s;try{s=so(C)}catch(V){throw new Ze(`${g}: parse failed — ${V.message}`)}const h=V=>V.packages?Object.keys(V.packages).length:0;let e;for(const V of s){const[ne]=V.errors;if(ne)throw new Ze(`${g}: parse failed — ${ne.message}`);const M=V.toJS();if(!M||typeof M!="object")continue;const le=M;(e===void 0||h(le)>h(e))&&(e=le)}if(e===void 0)throw new Ze(`${g}: top-level value is not an object`);const d=e.importers??{},w=ht(e.packages),m=ht(e.snapshots),A=new Set(["."]);for(const V of a.closure)A.add(V.relativeRoot===""?".":V.relativeRoot);const x={};for(const[V,ne]of Object.entries(d))A.has(V)&&(x[V]=ne);const Y=new Set,y=new Set,v=[];for(const V of Object.values(x))for(const ne of ao(V))v.push(ne);for(;v.length>0;){const{name:V,version:ne}=v.shift(),M=co(V,ne);if(!M)continue;const le=is(M),we=m.get(le)??m.get(M)??[];for(const ve of we){if(y.has(ve))continue;y.add(ve);const Se=e.snapshots?.[ve];if(Se)for(const xe of pt(Se))v.push(xe)}const ge=w.get(le)??w.get(M)??[];for(const ve of ge){if(Y.has(ve))continue;Y.add(ve);const Se=e.packages?.[ve];if(Se&&!e.snapshots)for(const xe of pt(Se))v.push(xe)}}const $={lockfileVersion:e.lockfileVersion};for(const V of["settings","overrides","patchedDependencies","catalogs"])e[V]!==void 0&&($[V]=e[V]);if($.importers=x,e.packages){const V={};for(const ne of Object.keys(e.packages))Y.has(ne)&&(V[ne]=e.packages[ne]);$.packages=V}if(e.snapshots){const V={};for(const ne of Object.keys(e.snapshots))y.has(ne)&&(V[ne]=e.snapshots[ne]);$.snapshots=V}const P=Object.keys(e.packages??{}).length,ie=Object.keys($.packages??{}).length,oe=P-ie,R=Object.keys(d).length-Object.keys(x).length;return{content:oo($,{lineWidth:0}),message:`${g}: kept ${ie}/${P} packages and ${Object.keys(x).length} importers (dropped ${oe} packages, ${R} importers)`,status:"pruned"}},uo=a=>ts({...a,displayName:a.displayName??"aube-lock.yaml"}),po=a=>{let g="",C=!1,s=!1,h=!1;for(let e=0;e<a.length;e+=1){const d=a[e],w=a[e+1];if(s){d===`
|
|
2
2
|
`&&(s=!1,g+=d);continue}if(h){d==="*"&&w==="/"&&(h=!1,e+=1);continue}if(C){if(d==="\\"){g+=d,w!==void 0&&(g+=w,e+=1);continue}d==='"'&&(C=!1),g+=d;continue}if(d==='"'){C=!0,g+=d;continue}if(d==="/"&&w==="/"){s=!0,e+=1;continue}if(d==="/"&&w==="*"){h=!0,e+=1;continue}g+=d}return g},ho=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies,a.peerDependencies])if(C)for(const[s,h]of Object.entries(C))typeof h=="string"&&g.push({name:s,spec:h});return g},go=a=>{for(const g of a)if(typeof g=="object"&&!Array.isArray(g))return g},mo=a=>{if(!a)return[];const g=[];for(const C of["dependencies","optionalDependencies","peerDependencies"]){const s=a[C];s!==null&&typeof s=="object"&&!Array.isArray(s)&&g.push(...Object.keys(s))}return g},yo=a=>{if(Buffer.isBuffer(a.lockfileContent))return{message:"bun.lockb is binary; run `bun install --save-text-lockfile` to regenerate as bun.lock, then rerun `vis docker scaffold`.",status:"skipped"};const g=po(a.lockfileContent);let C;try{C=JSON.parse(g)}catch(P){throw new Ze(`bun.lock: parse failed — ${P.message}`)}if(!C||typeof C!="object")throw new Ze("bun.lock: top-level value is not an object");const s=C.workspaces??{},h=C.packages??{},e=new Set([""]);for(const P of a.closure)e.add(P.relativeRoot===""?"":P.relativeRoot);const d={},w=[];for(const[P,ie]of Object.entries(s))e.has(P)&&(d[P]=ie,w.push(...ho(ie)));const m=new Set;for(const{name:P}of w)m.add(P);const A=[...m];for(;A.length>0;){const P=A.shift();for(const ie of Object.keys(h)){if(ie.split("/")[0]!==P&&ie!==P)continue;const R=go(h[ie]);for(const V of mo(R))m.has(V)||(m.add(V),A.push(V))}}const x={};for(const[P,ie]of Object.entries(h)){const oe=P.split("/")[0];(m.has(oe)||m.has(P))&&(x[P]=ie)}const Y={...C,packages:x,workspaces:d},y=Object.keys(h).length,v=Object.keys(x).length,$=y-v;return{content:`${JSON.stringify(Y,null,2)}
|
|
3
3
|
`,message:`bun.lock: kept ${v}/${y} packages (dropped ${$})`,status:"pruned"}},Jn="node_modules/",$o=(a,g,C)=>{let s=g;for(;;){const h=s===""?`${Jn}${C}`:`${s}/${Jn}${C}`;if(a[h]!==void 0)return h;if(s==="")return;const e=s.lastIndexOf(`/${Jn.slice(0,-1)}/`);s=e===-1?"":s.slice(0,e)}},vo=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies,a.peerDependencies])if(C)for(const s of Object.keys(C))g.push(s);return g},Ao=a=>{const g=a.displayName??"package-lock.json",C=typeof a.lockfileContent=="string"?a.lockfileContent:a.lockfileContent.toString("utf8");let s;try{s=JSON.parse(C)}catch($){throw new Ze(`${g}: parse failed — ${$.message}`)}if(!s||typeof s!="object")throw new Ze(`${g}: top-level value is not an object`);const h=s.packages??{},e=new Set([""]);for(const $ of a.closure)$.relativeRoot!==""&&e.add($.relativeRoot);const d=new Set,w=[];for(const $ of Object.keys(h))e.has($)&&(d.add($),w.push($));for(const[$,P]of Object.entries(h))P.link===!0&&typeof P.resolved=="string"&&e.has(P.resolved)&&d.add($);for(;w.length>0;){const $=w.shift(),P=h[$];if(P)for(const ie of vo(P)){const oe=$o(h,$,ie);if(!oe||d.has(oe))continue;d.add(oe);const R=h[oe];R.link===!0&&typeof R.resolved=="string"&&h[R.resolved]!==void 0&&!d.has(R.resolved)?(d.add(R.resolved),w.push(R.resolved)):w.push(oe)}}const m={};for(const $ of Object.keys(h))d.has($)&&(m[$]=h[$]);const A=m[""];A&&Array.isArray(A.workspaces)&&(A.workspaces=A.workspaces.filter($=>{if(typeof $!="string")return!1;const P=$.replace(/\/?\*+$/,"").replace(/\/$/,"");if(P===""||P==="*")return!0;for(const ie of e)if(ie===$||ie===P||ie.startsWith(`${P}/`))return!0;return!1}));const x={...s,packages:m};delete x.dependencies;const Y=Object.keys(h).length,y=Object.keys(m).length,v=Y-y;return{content:`${JSON.stringify(x,null,2)}
|
|
4
4
|
`,message:`${g}: kept ${y}/${Y} entries (dropped ${v})`,status:"pruned"}};var Qn={},Fe={},zn,gt;function wo(){if(gt)return zn;gt=1;function a(s,h){function e(){this.constructor=s}e.prototype=h.prototype,s.prototype=new e}function g(s,h,e,d){this.message=s,this.expected=h,this.found=e,this.location=d,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,g)}a(g,Error),g.buildMessage=function(s,h){var e={literal:function(y){return'"'+w(y.text)+'"'},class:function(y){var v="",$;for($=0;$<y.parts.length;$++)v+=y.parts[$]instanceof Array?m(y.parts[$][0])+"-"+m(y.parts[$][1]):m(y.parts[$]);return"["+(y.inverted?"^":"")+v+"]"},any:function(y){return"any character"},end:function(y){return"end of input"},other:function(y){return y.description}};function d(y){return y.charCodeAt(0).toString(16).toUpperCase()}function w(y){return y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+d(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+d(v)})}function m(y){return y.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+d(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+d(v)})}function A(y){return e[y.type](y)}function x(y){var v=new Array(y.length),$,P;for($=0;$<y.length;$++)v[$]=A(y[$]);if(v.sort(),v.length>0){for($=1,P=1;$<v.length;$++)v[$-1]!==v[$]&&(v[P]=v[$],P++);v.length=P}switch(v.length){case 1:return v[0];case 2:return v[0]+" or "+v[1];default:return v.slice(0,-1).join(", ")+", or "+v[v.length-1]}}function Y(y){return y?'"'+w(y)+'"':"end of input"}return"Expected "+x(s)+" but "+Y(h)+" found."};function C(s,h){h=h!==void 0?h:{};var e={},d={Start:Vi},w=Vi,m=function(r){return r||[]},A=function(r,t,o){return[{command:r,type:t}].concat(o||[])},x=function(r,t){return[{command:r,type:t||";"}]},Y=function(r){return r},y=";",v=ce(";",!1),$="&",P=ce("&",!1),ie=function(r,t){return t?{chain:r,then:t}:{chain:r}},oe=function(r,t){return{type:r,line:t}},R="&&",V=ce("&&",!1),ne="||",M=ce("||",!1),le=function(r,t){return t?{...r,then:t}:r},we=function(r,t){return{type:r,chain:t}},ge="|&",ve=ce("|&",!1),Se="|",xe=ce("|",!1),je="=",Be=ce("=",!1),$e=function(r,t){return{name:r,args:[t]}},Ne=function(r){return{name:r,args:[]}},Qe="(",Ee=ce("(",!1),re=")",Ie=ce(")",!1),De=function(r,t){return{type:"subshell",subshell:r,args:t}},Oe="{",Pe=ce("{",!1),_e="}",B=ce("}",!1),G=function(r,t){return{type:"group",group:r,args:t}},X=function(r,t){return{type:"command",args:t,envs:r}},me=function(r){return{type:"envs",envs:r}},qe=function(r){return r},ze=function(r){return r},Me=/^[0-9]/,Ye=We([["0","9"]],!1,!1),er=function(r,t,o){return{type:"redirection",subtype:t,fd:r!==null?parseInt(r):null,args:[o]}},or=">>",hr=ce(">>",!1),fr=">&",lr=ce(">&",!1),Cr=">",gr=ce(">",!1),Ke="<<<",rr=ce("<<<",!1),Ge="<&",dr=ce("<&",!1),mr="<",yr=ce("<",!1),Ue=function(r){return{type:"argument",segments:[].concat(...r)}},n=function(r){return r},k="$'",j=ce("$'",!1),J="'",l=ce("'",!1),b=function(r){return[{type:"text",text:r}]},E='""',T=ce('""',!1),O=function(){return{type:"text",text:""}},q='"',U=ce('"',!1),N=function(r){return r},Z=function(r){return{type:"arithmetic",arithmetic:r,quoted:!0}},Q=function(r){return{type:"shell",shell:r,quoted:!0}},ae=function(r){return{type:"variable",...r,quoted:!0}},de=function(r){return{type:"text",text:r}},se=function(r){return{type:"arithmetic",arithmetic:r,quoted:!1}},En=function(r){return{type:"shell",shell:r,quoted:!1}},kn=function(r){return{type:"variable",...r,quoted:!1}},tn=function(r){return{type:"glob",pattern:r}},jr=/^[^']/,Fr=We(["'"],!0,!1),$r=function(r){return r.join("")},sn=/^[^$"]/,on=We(["$",'"'],!0,!1),Kr=`\\
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as ze}from"node:module";import{e as M,z as Fe}from"./index-0dnGN3GP.js";import{r as qe}from"./docker-
|
|
1
|
+
import{createRequire as ze}from"node:module";import{e as M,z as Fe}from"./index-0dnGN3GP.js";import{r as qe}from"./docker-aU0BWfDE.js";import{parse as We}from"../packem_chunks/index4.js";import Re from"../packem_chunks/index.js";import{b as fe,l as Ke,a as Ze,d as Qe,e as en,f as nn,g as tn}from"./multi-eco-lockfiles-DT7U-DYp.js";import{p as ke,r as ue,c as sn}from"./composer-DR3D-Psb.js";import{p as Ie}from"./package-version-DSr8JAeI.js";import{e as on}from"./license-DvlYdo6T.js";import{S as rn}from"./lockfile-DhHAaHN5.js";import{s as cn}from"./index--eV4qIz5.js";import{V as Le}from"./vis-user-error-BrIWyJ2j.js";import{w as an,r as pn,Z as Ce}from"./zig-manifest-P7ydLEOa.js";let He;const Ve=e=>(He??=ze(import.meta.url))(e),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=e=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[t,n]=ee.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return ee.getBuiltinModule(e)}return Ve(e)},{randomUUID:Be}=be("node:crypto"),{readFileSync:G,readdirSync:Pe,statSync:Xe,existsSync:Je}=be("node:fs"),{join:A,relative:$e,resolve:De,basename:Ye}=be("node:path"),ne=e=>e.replaceAll(/[^\w.~-]/g,t=>`%${(t.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),j=(e,t)=>{const n=e.toLowerCase();if(n.startsWith("@")){const s=n.indexOf("/");if(s>0){const o=n.slice(0,s),r=n.slice(s+1);return`pkg:npm/${ne(o)}/${ne(r)}@${ne(t)}`}}return`pkg:npm/${ne(n)}@${ne(t)}`},_={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},ln=[_.STRING,_.NUMBER,_.BOOLEAN],un='<?xml version="1.0" encoding="UTF-8"?>',Ee=["_selfCloseTag","_attrs"],fn=(e="",t=0)=>e.repeat(t),pe=e=>Array.isArray(e)&&_.ARRAY||typeof e===_.OBJECT&&e!==null&&e._name&&_.JSTOXML_OBJECT||e instanceof Date&&_.DATE||e===null&&_.NULL||typeof e,Ue=e=>e.startsWith("<![CDATA["),je=(e="",t={},n)=>{let s=e;if(typeof e===_.STRING){if(Ue(e))return e;const o=new RegExp(`(${Object.keys(t).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(o,(r,l)=>t[l]||"")}return typeof n=="function"?n(s):s},dn=(e={},t,n,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,l])=>({[r]:l}))).reduce((r,l)=>{const c=Object.keys(l)[0],i=l[c];if(typeof n===_.FUNCTION&&n(c,i))return r;const a=t?je(i,t):i,f=!s&&a===!0?"":`="${a}"`;return r.push(`${c}${f}`),r},[]),mn=(e={},t,n,s)=>{const o=dn(e,t,n,s);return o.length===0?"":` ${o.join(" ")}`},hn=(e={})=>Object.keys(e).map(t=>({_name:t,_content:e[t]})),gn=e=>ln.includes(pe(e)),vn=e=>!e.match("<"),yn=({header:e,isOutputStart:t})=>e&&t?typeof e===_.BOOLEAN?un:e:"",Ae={"<":"<",">":">","&":"&",'"':"""},q=(e={},t={})=>{const{depth:n=0,indent:s,_isFirstItem:o,_isOutputStart:r=!0,header:l,attributeReplacements:c={},attributeFilter:i,attributeExplicitTrue:a=!1,contentReplacements:f={},contentMap:g,selfCloseTags:y=!0}=t,X=typeof c=="boolean"&&!c?{}:{...Ae,...c},z=typeof f=="boolean"&&!f?{}:{...Ae,...f},N=typeof s=="string",H=fn(s,n),J=pe(e),Y=yn({header:l,isOutputStart:r}),O=r&&!Y&&o&&n===0,V=N&&!O?`
|
|
2
2
|
`:"";let k="";switch(J){case _.JSTOXML_OBJECT:{const{_name:b,_content:S}=e;if(S===null&&typeof g!="function"){k=`${V}${H}${b}`;break}if(Array.isArray(S)&&S.every(gn))return S.map(ae=>q({_name:b,_content:ae},{...t,depth:n,_isOutputStart:!1})).join("");if(Ee.includes(b))break;const $=q(S,{...t,depth:n+1,_isOutputStart:O}),B=pe($),E=vn($),oe=Ue($),T=`${V}${H}`;if(b==="_comment"){k+=`${T}<!-- ${S} -->`;break}const R=B==="undefined"||$==="",D=y,W=e._selfCloseTag,K=typeof W===_.BOOLEAN?R&&W:R&&D,I=K?"/":"",re=mn(e._attrs,X,i,a),Z=`<${b}${re}${I}>`,ce=N&&!E&&!oe?`
|
|
3
3
|
${H}`:"",ie=K?"":`${$}${ce}</${b}>`;k+=`${T}${Z}${ie}`;break}case _.OBJECT:{const b=Object.keys(e);k=b.map((v,$)=>{const B={...t,_isFirstItem:$===0,_isLastItem:$+1===b.length,_isOutputStart:O},E={_name:v};if(pe(e[v])===_.OBJECT&&(Ee.forEach(R=>{const D=e[v][R];typeof D<"u"&&(E[R]=D,delete e[v][R])}),typeof e[v]._content<"u"&&Object.keys(e[v]).length>1)){const R=Object.assign({},e[v]);delete R._content,E._content=[...hn(R),e[v]._content]}return typeof E._content>"u"&&(E._content=e[v]),q(E,B)},t).join("");break}case _.FUNCTION:{const b=e(t);k=q(b,t);break}case _.ARRAY:{k=e.map((S,v)=>{const $={...t,_isFirstItem:v===0,_isLastItem:v+1===e.length,_isOutputStart:O};return q(S,$)}).join("");break}default:{k=je(e,z,g);break}}return`${Y}${k}`},_n=(e,t)=>`pkg:cargo/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,se=e=>e,bn=e=>{const t=e.split(" ")[0];if(t===void 0||t==="")return;const n=/^\S+\s+(\d[^\s(]*)/.exec(e)?.[1],s=/\(([^)]+)\)/.exec(e)?.[1];return{kind:"main",name:t,source:s,version:n}},$n=e=>{const t=[];let n,s=!1;const o=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.source===void 0,name:n.name,source:n.source,version:n.version})};for(const r of e.split(`
|
|
4
4
|
`)){const l=r.trim();if(l==="[[package]]"){o(),n={deps:[]},s=!1;continue}if(n===void 0)continue;if(s){const i=/^"([^"]+)",?$/.exec(l);if(i){const a=bn(i[1]);a!==void 0&&n.deps.push(a)}else l==="]"&&(s=!1);continue}if(l==="dependencies = ["){s=!0;continue}const c=/^(name|version|source)\s*=\s*"([^"]*)"$/.exec(l);if(c){const[,i="",a=""]=c;i==="name"?n.name=a:i==="version"?n.version=a:n.source=a}}return o(),t},Cn=(e,t)=>{const n=typeof t=="object"&&t!==null?t.package:void 0;return typeof n=="string"?n:e},Sn=(e,t)=>{const n=Array.isArray(t.workspace?.members)?t.workspace.members.filter(r=>typeof r=="string"):[],s=Array.isArray(t.workspace?.exclude)?t.workspace.exclude.filter(r=>typeof r=="string"):[],o=new Set;for(const r of n){let l=[e];for(const c of r.split("/").filter(i=>i!==""&&i!==".")){const i=[];for(const a of l){if(!/[*?[{]/.test(c)){i.push(A(a,c));continue}let f;try{f=Pe(a)}catch{f=[]}for(const g of f){const y=A(a,g);Re(c,g)&&Xe(y).isDirectory()&&i.push(y)}}l=i}for(const c of l){const i=c.slice(e.length+1).split("\\").join("/");s.some(a=>Re(a,i))||o.add(c)}}return[...o]},Rn=e=>{const t=new Map;let n;try{n=Oe(G(A(e,"Cargo.toml"),"utf8"))}catch{return t}const s=Sn(e,n);n.package?.name!==void 0&&s.push(e);for(const o of s){let r;try{r=Oe(G(A(o,"Cargo.toml"),"utf8"))}catch{continue}if(typeof r.package?.name!="string")continue;const l=new Set,c=i=>{for(const[a,f]of Object.entries(i??{}))l.add(se(Cn(a,f)))};c(r.dependencies),c(r["build-dependencies"]);for(const i of Object.values(r.target??{}))c(i.dependencies),c(i["build-dependencies"]);t.set(se(r.package.name),l)}return t},Oe=e=>We(e),kn=(e,t={})=>{let n;try{n=G(A(e,"Cargo.lock"),"utf8")}catch{return{components:[],dependencies:[]}}const s=Rn(e),o=$n(n).map(r=>{const l=r.member?s.get(se(r.name)):void 0;return l===void 0?r:{...r,deps:r.deps.map(c=>l.has(se(c.name))?c:{...c,kind:"dev"})}});return fe(o,{focusNames:t.focusNames,includeDev:t.includeDev,normalize:se,purl:_n})},En=(e,t)=>`pkg:composer/${e.split("/").map(n=>encodeURIComponent(n)).join("/")}@${encodeURIComponent(t)}`,te=e=>e.toLowerCase(),An=e=>{const t=[];for(const[n,s]of[["packages",!1],["packages-dev",!0]]){const o=e[n];if(Array.isArray(o))for(const r of o){if(typeof r.name!="string"||typeof r.version!="string")continue;const l=[...ue(r,"require").map(c=>({kind:s?"dev":"main",name:c})),...ue(r,"require-dev").map(c=>({kind:"dev",name:c}))];t.push({deps:l,member:!1,name:r.name,version:sn(r.version)})}}return t},On=(e,t={})=>{const n={components:[],dependencies:[]};let s,o;try{s=ke(G(A(e,"composer.lock"),"utf8")),o=ke(G(A(e,"composer.json"),"utf8"))}catch{return n}const r=typeof o.name=="string"?te(o.name):void 0;if(t.focusNames!==void 0&&!t.focusNames.some(i=>te(i)===r))return n;const l=new Set([...ue(o,"require"),...t.includeDev?ue(o,"require-dev"):[]].map(i=>te(i))),c=An(s).map(i=>({...i,member:l.has(te(i.name))}));return fe(c,{includeDev:t.includeDev,normalize:te,purl:En})},Te=e=>e.split("/").map(t=>encodeURIComponent(t)).join("/"),Tn={Go:(e,t)=>`pkg:golang/${Te(e)}@${encodeURIComponent(t)}`,Pub:(e,t)=>`pkg:pub/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,SwiftURL:(e,t)=>`pkg:swift/${Te(e)}@${encodeURIComponent(t)}`},wn=(e,t)=>{const n=Ke(e,t).map(s=>{const o=Tn[t](s.name,s.version);return{"bom-ref":o,name:s.name,purl:o,type:"library",version:s.version}}).sort((s,o)=>(s["bom-ref"]??"").localeCompare(o["bom-ref"]??""));return{components:n,dependencies:n.map(s=>({ref:s["bom-ref"]??""}))}},xn=(e,t)=>`pkg:gem/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,Nn=/^ {4}(\S+) \(([^()]+)\)\s*$/,Pn=/^ {6}(\S+)(?: \(.*\))?\s*$/,Dn=e=>{const t=new Map;let n,s,o;for(const r of e.split(/\r?\n/)){if(r.length>0&&!r.startsWith(" ")){n=r.trim(),s=void 0,o=void 0;continue}if(n!=="PATH"&&n!=="GEM"&&n!=="GIT")continue;const l=/^ {2}remote: (.+)$/.exec(r);if(l?.[1]!==void 0){s=l[1].trim();continue}const c=Nn.exec(r);if(c?.[1]!==void 0&&c[2]!==void 0){const a=c[1],f=c[2].split("-")[0]??c[2],g=n==="GIT"&&s!==void 0?`git:${s}`:void 0,y=`${a}\0${f}\0${g??""}`;o=t.get(y)??{deps:[],member:n==="PATH",name:a,source:g,version:f},t.set(y,o);continue}const i=Pn.exec(r);i?.[1]!==void 0&&o!==void 0&&o.deps.push({kind:"main",name:i[1]})}return[...t.values()]},In=(e,t={})=>{let n;try{n=G(A(e,"Gemfile.lock"),"utf8")}catch{return{components:[],dependencies:[]}}return fe(Dn(n),{focusNames:t.focusNames,includeDev:t.includeDev,normalize:s=>s,purl:xn})},ye=e=>{try{return Ie(e)}catch{return}},Ln=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const t=e.indexOf("/");return t>1&&!e.includes("/",t+1)}return!e.includes("/")},Un=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),jn=(e,t,n)=>{const o=`${t.replaceAll("/","+")}@${n}`,r=M(e,"node_modules",".pnpm"),l=ye(M(r,o,"node_modules",t,"package.json"));if(l)return l;let c;try{c=Pe(r)}catch{return}const i=`${o}_`;for(const a of c){if(!a.startsWith(i))continue;const f=ye(M(r,a,"node_modules",t,"package.json"));if(f)return f}},Mn=(e,t,n)=>{const s=ye(M(e,"node_modules",t,"package.json"));return s?.version===n?s:void 0},Gn=(e,t,n)=>{if(!(!Ln(t)||!Un(n)))return jn(e,t,n)??Mn(e,t,n)},zn={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Hn={sha256:64,sha384:96,sha512:128},Vn=e=>{const t={name:e.name,version:e.version},{integrity:n}=e;return n&&n.hex.length===Hn[n.algorithm]&&(t.hash={alg:zn[n.algorithm],content:n.hex}),e.dependencies&&(t.dependencies=e.dependencies),e.peerDependencies&&(t.peerDependencies=e.peerDependencies),e.optionalDependencies&&(t.optionalDependencies=e.optionalDependencies),t},Bn=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Fn=e=>{for(const{file:t,type:n}of Bn){let s;try{s=Fe(M(e,t))}catch{continue}const o=new Map;for(const r of rn(s,n))o.set(`${r.name}@${r.version}`,Vn(r));return{packages:o,type:n}}},Me=e=>e.toLowerCase().replaceAll(/[-_.]+/g,"-"),qn=(e,t)=>`pkg:pypi/${encodeURIComponent(Me(e))}@${encodeURIComponent(t)}`,Xn=/^source\s*=\s*\{\s*(?:editable|virtual|directory)\s*=/,Jn=/\{\s*name\s*=\s*"([^"]+)"([^}]*)\}/,Yn=e=>{const t=[];let n,s="none",o=!1;const r=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.member,name:n.name,source:n.source,version:n.version})};for(const l of e.split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as oe}from"node:module";import{n as q,C as ue,o as le,m as de,e as f}from"./index-0dnGN3GP.js";import{y as B}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as ye}from"./package-version-BzkcrNVE.js";let ce;const ae=e=>(ce??=oe(import.meta.url))(e),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=e=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[n,t]=S.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return S.getBuiltinModule(e)}return ae(e)},{createRequire:N}=x("node:module"),{existsSync:fe,readdirSync:G,statSync:pe,rmSync:Y,writeFileSync:he}=x("node:fs"),{spawn:O}=x("node:child_process"),{createHash:we}=x("node:crypto"),{homedir:me,platform:ge}=x("node:os");let Se=class extends Error{constructor(n){super(`EEXIST: ${n}`)}get code(){return"EEXIST"}set code(n){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(n){throw new Error("Cannot overwrite name of AlreadyExistsError")}};const L=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"};let $e;const Ee=e=>($e??=N(import.meta.url))(e),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=e=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[n,t]=$.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return $.getBuiltinModule(e)}return Ee(e)},{lstatSync:P,mkdirSync:xe}=be("node:fs"),ve=e=>{q(e);try{const n=P(e);if(!n.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(L(n))}'`);return}catch(n){if(n.code!=="ENOENT")throw n}try{xe(e,{recursive:!0})}catch(n){if(n.code!=="EEXIST")throw n;const t=P(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(L(t))}'`,{cause:n})}},ke=e=>{if(typeof e!="string"&&!(e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")};let Te;const Ie=e=>(Te??=N(import.meta.url))(e),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Re=e=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[n,t]=E.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return E.getBuiltinModule(e)}return Ie(e)},{randomBytes:Be}=Re("node:crypto"),We=e=>`${e}.${process.pid.toString(36)}.${Be(6).toString("hex")}.tmp`,Ae=new TextEncoder,Me=e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return Ae.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const n=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(n)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")};let _e;const Ce=e=>(_e??=N(import.meta.url))(e),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ne=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[n,t]=b.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return b.getBuiltinModule(e)}return Ce(e)},{mkdirSync:Fe,readFileSync:je,writeFileSync:De,statSync:Oe,renameSync:V,chownSync:Le,chmodSync:Pe,unlinkSync:Ve}=Ne("node:fs"),jt=(e,n,t)=>{t={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...t},q(e),ke(n),e=ue(e);const i=B(e,le),c=t.flag??"w",a=c.includes("a"),s=c.includes("x");if(i&&(!t.overwrite||s))throw new Se(`file already exists, open '${e}'`);const r=We(e);try{!i&&t.recursive&&Fe(de(e),{recursive:!0});let o,u=typeof n=="string"?Buffer.from(n,t.encoding??"utf8"):Me(n);if(a&&i&&(u=Buffer.concat([je(e),u])),De(r,u,{flag:"wx"}),i&&t.backup&&(o=Oe(e),t.chown??={gid:o.gid,uid:o.uid},V(e,`${e}.bak`)),t.chown)try{Le(r,t.chown.uid,t.chown.gid)}catch{}const d=o&&t.mode===void 0?o.mode:t.mode;d!==void 0&&Pe(r,d),V(r,e)}catch(o){throw new Error(`Failed to write file at: ${e} - ${o.message}`,{cause:o})}finally{B(r)&&Ve(r)}},ze=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Ue=12288,He=65510,Ke=[12288,12288,65281,65376,65504,65510],qe=8361,Ge=65518,Ye=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Xe=32,Je=10630,Ze=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Qe=4352,et=262141,X=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],v=(e,n)=>{let t=0,i=Math.floor(e.length/2)-1;for(;t<=i;){const c=Math.floor((t+i)/2),a=c*2;if(n<e[a])i=c-1;else if(n>e[a+1])t=c+1;else return!0}return!1},z=19968,[tt,nt]=st(X);function st(e){let n=e[0],t=e[1];for(let i=0;i<e.length;i+=2){const c=e[i],a=e[i+1];if(z>=c&&z<=a)return[c,a];a-c>t-n&&(n=c,t=a)}return[n,t]}const it=e=>e<161||e>1114109?!1:v(ze,e),rt=e=>e<Ue||e>He?!1:v(Ke,e),ot=e=>e<qe||e>Ge?!1:v(Ye,e),ct=e=>e<Xe||e>Je?!1:v(Ze,e),at=e=>e>=tt&&e<=nt?!0:e<Qe||e>et?!1:v(X,e);function ut(e){return it(e)?"ambiguous":rt(e)?"fullwidth":ot(e)?"halfwidth":ct(e)?"narrow":at(e)?"wide":"neutral"}function lt(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function J(e){return lt(e),ut(e)}const Z=String.raw,U=Z`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,dt=()=>new RegExp(Z`\p{RI}{2}|(?)${U}(?:\u200D${U})*`,"gu"),Dt=new Set(["\x1B",""]),Ot="\x07",Lt="]8;;",Pt=/[\u200B\uFEFF\u2060-\u2064]/g,Q=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,Vt=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,zt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,T=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,ee=dt(),Ut=/[-_./\s]+/g,Ht=/(\u001B\[[0-9;]*[a-z])/i,Kt=new RegExp("\\p{Script=Arabic}","u"),qt=new RegExp("\\p{Script=Bengali}","u"),Gt=new RegExp("\\p{Script=Cyrillic}","u"),Yt=new RegExp("\\p{Script=Devanagari}","u"),Xt=new RegExp("\\p{Script=Ethiopic}","u"),Jt=new RegExp("\\p{Script=Greek}","u"),Zt=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),Qt=new RegExp("\\p{Script=Gujarati}","u"),en=new RegExp("\\p{Script=Gurmukhi}","u"),tn=new RegExp("\\p{Script=Hangul}","u"),nn=new RegExp("\\p{Script=Hebrew}","u"),sn=new RegExp("\\p{Script=Hiragana}","u"),rn=new RegExp("\\p{Script=Han}","u"),on=new RegExp("\\p{Script=Kannada}","u"),cn=new RegExp("\\p{Script=Katakana}","u"),an=new RegExp("\\p{Script=Khmer}","u"),un=new RegExp("\\p{Script=Lao}","u"),ln=new RegExp("\\p{Script=Latin}","u"),dn=new RegExp("\\p{Script=Malayalam}","u"),fn=new RegExp("\\p{Script=Myanmar}","u"),pn=new RegExp("\\p{Script=Oriya}","u"),hn=new RegExp("\\p{Script=Sinhala}","u"),wn=new RegExp("\\p{Script=Tamil}","u"),mn=new RegExp("\\p{Script=Telugu}","u"),gn=new RegExp("\\p{Script=Thai}","u"),yn=new RegExp("\\p{Script=Tibetan}","u"),Sn=/[\u02BB\u02BC\u0027]/u,$n=e=>e.replace(ee,""),H=new Map,ft=e=>[e.ambiguousIsNarrow?1:0,e.control,e.fullWidth,e.regular,e.wide].join("|"),pt=e=>{const n=ft(e.width);let t=H.get(n);return t||(t=new Map,H.set(n,t)),t},I=new RegExp(Q.source,"y"),_=new RegExp(ee.source,"uy"),R=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,te=e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other",ht=(e,n)=>{const t=pt(n),i=Math.floor(e/65536),c=e%65536;let a=t.get(i);if(a||(a=new Map,t.set(i,a)),a.has(c))return a.get(c);let s;switch(te(e)){case"control":{s=n.width.control;break}case"latin":{s=n.width.regular;break}case"wide":{s=n.width.wide;break}case"zero":{s=0;break}default:switch(J(e)){case"ambiguous":{s=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{s=n.width.fullWidth;break}case"wide":{s=n.width.wide;break}default:s=n.width.regular}}return a.set(c,s),s},wt=e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,C=(e,n={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const t={truncation:{countAnsiEscapeCodes:n.countAnsiEscapeCodes??!1,ellipsis:n.ellipsis??"",ellipsisWidth:n.ellipsisWidth??(n.ellipsis?C(n.ellipsis,{...n,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:n.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:n.ambiguousIsNarrow??!1,ansi:n.ansiWidth??0,control:n.controlWidth??0,emoji:n.emojiWidth??2,fullWidth:n.fullWidth??2,halfWidth:n.halfWidth??1,regular:n.regularWidth??1,tab:n.tabWidth??8,wide:n.wideWidth??2}},i=Math.max(0,t.truncation.limit-t.truncation.ellipsisWidth),{length:c}=e,a=c>1e4;let s=0,r=0,o=c,u=!1;const d=e.includes("\x1B")||e.includes("");for(;s<c;){if(d&&(e[s]==="\x1B"||e[s]==="")){if(e.startsWith("\x1B]8;;",s)){const h="\x1B]8;;\x07",w=h.length,W=e.indexOf("\x07",s+5);if(W!==-1){const A=e.indexOf(h,W+1);if(A!==-1){const ie=A+w,re=e.slice(W+1,A).replace(Q,""),D=C(re,{ambiguousIsNarrow:t.width.ambiguousIsNarrow,ansiWidth:t.width.ansi,controlWidth:t.width.control,countAnsiEscapeCodes:!1,ellipsis:t.truncation.ellipsis,ellipsisWidth:t.truncation.ellipsisWidth,emojiWidth:t.width.emoji,fullWidth:t.width.fullWidth,halfWidth:t.width.halfWidth,limit:Math.max(0,i-r),regularWidth:t.width.regular,tabWidth:t.width.tab,wideWidth:t.width.wide}),M=D.width;if(D.truncated)u=!0,o=Math.min(o,s);else if(r+M>i&&(o=Math.min(o,s),u=!0,r+M>t.truncation.limit))break;if(r+=M,s=ie,u&&r>=t.truncation.limit)break;continue}}}if(I.lastIndex=s,I.test(e)){const h=I.lastIndex-s,w=t.truncation.countAnsiEscapeCodes?h:t.width.ansi;if(r+w>i&&(o=Math.min(o,s),r+w>t.truncation.limit)){u=!0;break}r+=w,s=I.lastIndex;continue}}const l=e.codePointAt(s);if(l===8203||l===65279||l>=8288&&l<=8292){s+=1;continue}if(l===9){if(r+t.width.tab>i&&(o=Math.min(o,s),r+t.width.tab>t.truncation.limit)){u=!0;break}r+=t.width.tab,s+=1;continue}if(R.lastIndex=s,R.test(e)){const h=(R.lastIndex-s)*t.width.regular;if(r+h>i){const w=t.width.regular>0?Math.floor((i-r)/t.width.regular):0;if(o=Math.min(o,s+w),r+h>t.truncation.limit){u=!0;break}}r+=h,s=R.lastIndex;continue}if((l<=31||l>=127&&l<=159)&&(T.lastIndex=s,T.test(e))){const h=(T.lastIndex-s)*t.width.control;if(r+h>i){const w=t.width.control>0?Math.floor((i-r)/t.width.control):0;if(o=Math.min(o,s+w),r+h>t.truncation.limit){u=!0;break}}r+=h,s=T.lastIndex;continue}if(_.lastIndex=s,_.test(e)){if(r+t.width.emoji>i&&(o=Math.min(o,s),r+t.width.emoji>t.truncation.limit)){u=!0;break}r+=t.width.emoji,s=_.lastIndex;continue}const g=e.codePointAt(s)??0;if(wt(g)){s+=g>65535?2:1;continue}let p;if(a)p=ht(g,t);else switch(te(g)){case"control":{p=t.width.control;break}case"latin":{p=t.width.regular;break}case"wide":{p=t.width.wide;break}case"zero":{p=0;break}default:switch(J(g)){case"ambiguous":{p=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{p=t.width.fullWidth;break}case"wide":{p=t.width.wide;break}default:p=t.width.regular}}if(r+p>i&&(o=Math.min(o,s),r+p>t.truncation.limit)){u=!0;break}r+=p,s+=g>65535?2:1}let m=r,y=!1;return u&&t.truncation.limit>=t.truncation.ellipsisWidth&&(m=t.truncation.limit,y=!0),{ellipsed:y,index:u?o:c,truncated:u,width:m}},En=(e,n={})=>C(e,{...n,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,F=()=>f(me(),".vis"),mt=()=>f(F(),"cache"),bn=()=>f(F(),"state"),gt=e=>we("sha256").update(e).digest("hex").slice(0,12),xn=e=>f(F(),"workspaces",gt(e)),yt=".vis",j=e=>f(e,yt),vn="node_modules/.cache/vis",kn=e=>f(j(e),"runs"),Tn=e=>f(j(e),"last-summary.json"),In=e=>f(j(e),"last-failures"),Rn=e=>{const n=ge()==="win32";for(const t of[".task-runner",".task-runner-cache"]){const i=f(e,t);if(fe(i))try{const c=n?O("cmd.exe",["/c","rmdir","/s","/q",i],{detached:!0,stdio:"ignore"}):O("rm",["-rf",i],{detached:!0,stdio:"ignore"});c.on("error",()=>{}),c.unref()}catch{}}},St="https://api.socket.dev/v0/purl?alerts=true",k=()=>f(mt(),"socket-security"),$t=3600*1e3,ne=.4,K=100,Et=e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"name"in e&&"version"in e&&"alerts"in e&&"score"in e&&e.type==="npm",bt=()=>{ve(k())},se=(e,n)=>`${encodeURIComponent(e)}@${encodeURIComponent(n)}`,xt=(e,n)=>{const t=se(e,n),i=f(k(),`${t}.json`);try{const c=ye(i);if(Date.now()-c.createdAt>c.ttlMs){Y(i,{force:!0});return}return c.report}catch{return}},vt=(e,n,t,i)=>{const c=se(e,n),a={createdAt:Date.now(),report:t,ttlMs:i};he(f(k(),`${c}.json`),JSON.stringify(a),"utf8")},kt=e=>{const n=[e.license,e.maintenance,e.quality,e.supplyChain,e.vulnerability];return Number((n.reduce((t,i)=>t+i,0)/n.length).toFixed(2))},Tt=async(e,n={})=>{const{apiToken:t,cacheTtlMs:i=$t,timeoutMs:c=15e3}=n,a=new Map;if(e.length===0||!t)return a;const s=[];for(const u of e){const d=xt(u.name,u.version);d?a.set(`${u.name}@${u.version}`,d):s.push(u)}if(s.length===0)return a;const r=`Basic ${Buffer.from(`${t}:`).toString("base64")}`;bt();const o=[];for(let u=0;u<s.length;u+=K)o.push(s.slice(u,u+K));for(const u of o){const d=u.map(l=>({purl:`pkg:npm/${l.name}@${l.version}`})),m=new AbortController,y=setTimeout(()=>{m.abort()},c);try{const l=await fetch(St,{body:JSON.stringify({components:d}),headers:{Authorization:r,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:m.signal});if(!l.ok)continue;const g=await l.text();It(g,u,a,i)}catch{}finally{clearTimeout(y)}}return a},It=(e,n,t,i)=>{const c=new Map;for(const s of n)c.set(`${s.name}@${s.version}`,s);const a=e.split(`}
|
|
1
|
+
import{createRequire as oe}from"node:module";import{n as q,C as ue,o as le,m as de,e as f}from"./index-0dnGN3GP.js";import{y as B}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as ye}from"./package-version-DSr8JAeI.js";let ce;const ae=e=>(ce??=oe(import.meta.url))(e),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=e=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[n,t]=S.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return S.getBuiltinModule(e)}return ae(e)},{createRequire:N}=x("node:module"),{existsSync:fe,readdirSync:G,statSync:pe,rmSync:Y,writeFileSync:he}=x("node:fs"),{spawn:O}=x("node:child_process"),{createHash:we}=x("node:crypto"),{homedir:me,platform:ge}=x("node:os");let Se=class extends Error{constructor(n){super(`EEXIST: ${n}`)}get code(){return"EEXIST"}set code(n){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(n){throw new Error("Cannot overwrite name of AlreadyExistsError")}};const L=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"};let $e;const Ee=e=>($e??=N(import.meta.url))(e),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=e=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[n,t]=$.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return $.getBuiltinModule(e)}return Ee(e)},{lstatSync:P,mkdirSync:xe}=be("node:fs"),ve=e=>{q(e);try{const n=P(e);if(!n.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(L(n))}'`);return}catch(n){if(n.code!=="ENOENT")throw n}try{xe(e,{recursive:!0})}catch(n){if(n.code!=="EEXIST")throw n;const t=P(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(L(t))}'`,{cause:n})}},ke=e=>{if(typeof e!="string"&&!(e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")};let Te;const Ie=e=>(Te??=N(import.meta.url))(e),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Re=e=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[n,t]=E.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return E.getBuiltinModule(e)}return Ie(e)},{randomBytes:Be}=Re("node:crypto"),We=e=>`${e}.${process.pid.toString(36)}.${Be(6).toString("hex")}.tmp`,Ae=new TextEncoder,Me=e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return Ae.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const n=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(n)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")};let _e;const Ce=e=>(_e??=N(import.meta.url))(e),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ne=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[n,t]=b.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return b.getBuiltinModule(e)}return Ce(e)},{mkdirSync:Fe,readFileSync:je,writeFileSync:De,statSync:Oe,renameSync:V,chownSync:Le,chmodSync:Pe,unlinkSync:Ve}=Ne("node:fs"),jt=(e,n,t)=>{t={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...t},q(e),ke(n),e=ue(e);const i=B(e,le),c=t.flag??"w",a=c.includes("a"),s=c.includes("x");if(i&&(!t.overwrite||s))throw new Se(`file already exists, open '${e}'`);const r=We(e);try{!i&&t.recursive&&Fe(de(e),{recursive:!0});let o,u=typeof n=="string"?Buffer.from(n,t.encoding??"utf8"):Me(n);if(a&&i&&(u=Buffer.concat([je(e),u])),De(r,u,{flag:"wx"}),i&&t.backup&&(o=Oe(e),t.chown??={gid:o.gid,uid:o.uid},V(e,`${e}.bak`)),t.chown)try{Le(r,t.chown.uid,t.chown.gid)}catch{}const d=o&&t.mode===void 0?o.mode:t.mode;d!==void 0&&Pe(r,d),V(r,e)}catch(o){throw new Error(`Failed to write file at: ${e} - ${o.message}`,{cause:o})}finally{B(r)&&Ve(r)}},ze=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Ue=12288,He=65510,Ke=[12288,12288,65281,65376,65504,65510],qe=8361,Ge=65518,Ye=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Xe=32,Je=10630,Ze=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Qe=4352,et=262141,X=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],v=(e,n)=>{let t=0,i=Math.floor(e.length/2)-1;for(;t<=i;){const c=Math.floor((t+i)/2),a=c*2;if(n<e[a])i=c-1;else if(n>e[a+1])t=c+1;else return!0}return!1},z=19968,[tt,nt]=st(X);function st(e){let n=e[0],t=e[1];for(let i=0;i<e.length;i+=2){const c=e[i],a=e[i+1];if(z>=c&&z<=a)return[c,a];a-c>t-n&&(n=c,t=a)}return[n,t]}const it=e=>e<161||e>1114109?!1:v(ze,e),rt=e=>e<Ue||e>He?!1:v(Ke,e),ot=e=>e<qe||e>Ge?!1:v(Ye,e),ct=e=>e<Xe||e>Je?!1:v(Ze,e),at=e=>e>=tt&&e<=nt?!0:e<Qe||e>et?!1:v(X,e);function ut(e){return it(e)?"ambiguous":rt(e)?"fullwidth":ot(e)?"halfwidth":ct(e)?"narrow":at(e)?"wide":"neutral"}function lt(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function J(e){return lt(e),ut(e)}const Z=String.raw,U=Z`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,dt=()=>new RegExp(Z`\p{RI}{2}|(?)${U}(?:\u200D${U})*`,"gu"),Dt=new Set(["\x1B",""]),Ot="\x07",Lt="]8;;",Pt=/[\u200B\uFEFF\u2060-\u2064]/g,Q=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,Vt=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,zt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,T=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,ee=dt(),Ut=/[-_./\s]+/g,Ht=/(\u001B\[[0-9;]*[a-z])/i,Kt=new RegExp("\\p{Script=Arabic}","u"),qt=new RegExp("\\p{Script=Bengali}","u"),Gt=new RegExp("\\p{Script=Cyrillic}","u"),Yt=new RegExp("\\p{Script=Devanagari}","u"),Xt=new RegExp("\\p{Script=Ethiopic}","u"),Jt=new RegExp("\\p{Script=Greek}","u"),Zt=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),Qt=new RegExp("\\p{Script=Gujarati}","u"),en=new RegExp("\\p{Script=Gurmukhi}","u"),tn=new RegExp("\\p{Script=Hangul}","u"),nn=new RegExp("\\p{Script=Hebrew}","u"),sn=new RegExp("\\p{Script=Hiragana}","u"),rn=new RegExp("\\p{Script=Han}","u"),on=new RegExp("\\p{Script=Kannada}","u"),cn=new RegExp("\\p{Script=Katakana}","u"),an=new RegExp("\\p{Script=Khmer}","u"),un=new RegExp("\\p{Script=Lao}","u"),ln=new RegExp("\\p{Script=Latin}","u"),dn=new RegExp("\\p{Script=Malayalam}","u"),fn=new RegExp("\\p{Script=Myanmar}","u"),pn=new RegExp("\\p{Script=Oriya}","u"),hn=new RegExp("\\p{Script=Sinhala}","u"),wn=new RegExp("\\p{Script=Tamil}","u"),mn=new RegExp("\\p{Script=Telugu}","u"),gn=new RegExp("\\p{Script=Thai}","u"),yn=new RegExp("\\p{Script=Tibetan}","u"),Sn=/[\u02BB\u02BC\u0027]/u,$n=e=>e.replace(ee,""),H=new Map,ft=e=>[e.ambiguousIsNarrow?1:0,e.control,e.fullWidth,e.regular,e.wide].join("|"),pt=e=>{const n=ft(e.width);let t=H.get(n);return t||(t=new Map,H.set(n,t)),t},I=new RegExp(Q.source,"y"),_=new RegExp(ee.source,"uy"),R=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,te=e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other",ht=(e,n)=>{const t=pt(n),i=Math.floor(e/65536),c=e%65536;let a=t.get(i);if(a||(a=new Map,t.set(i,a)),a.has(c))return a.get(c);let s;switch(te(e)){case"control":{s=n.width.control;break}case"latin":{s=n.width.regular;break}case"wide":{s=n.width.wide;break}case"zero":{s=0;break}default:switch(J(e)){case"ambiguous":{s=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{s=n.width.fullWidth;break}case"wide":{s=n.width.wide;break}default:s=n.width.regular}}return a.set(c,s),s},wt=e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,C=(e,n={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const t={truncation:{countAnsiEscapeCodes:n.countAnsiEscapeCodes??!1,ellipsis:n.ellipsis??"",ellipsisWidth:n.ellipsisWidth??(n.ellipsis?C(n.ellipsis,{...n,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:n.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:n.ambiguousIsNarrow??!1,ansi:n.ansiWidth??0,control:n.controlWidth??0,emoji:n.emojiWidth??2,fullWidth:n.fullWidth??2,halfWidth:n.halfWidth??1,regular:n.regularWidth??1,tab:n.tabWidth??8,wide:n.wideWidth??2}},i=Math.max(0,t.truncation.limit-t.truncation.ellipsisWidth),{length:c}=e,a=c>1e4;let s=0,r=0,o=c,u=!1;const d=e.includes("\x1B")||e.includes("");for(;s<c;){if(d&&(e[s]==="\x1B"||e[s]==="")){if(e.startsWith("\x1B]8;;",s)){const h="\x1B]8;;\x07",w=h.length,W=e.indexOf("\x07",s+5);if(W!==-1){const A=e.indexOf(h,W+1);if(A!==-1){const ie=A+w,re=e.slice(W+1,A).replace(Q,""),D=C(re,{ambiguousIsNarrow:t.width.ambiguousIsNarrow,ansiWidth:t.width.ansi,controlWidth:t.width.control,countAnsiEscapeCodes:!1,ellipsis:t.truncation.ellipsis,ellipsisWidth:t.truncation.ellipsisWidth,emojiWidth:t.width.emoji,fullWidth:t.width.fullWidth,halfWidth:t.width.halfWidth,limit:Math.max(0,i-r),regularWidth:t.width.regular,tabWidth:t.width.tab,wideWidth:t.width.wide}),M=D.width;if(D.truncated)u=!0,o=Math.min(o,s);else if(r+M>i&&(o=Math.min(o,s),u=!0,r+M>t.truncation.limit))break;if(r+=M,s=ie,u&&r>=t.truncation.limit)break;continue}}}if(I.lastIndex=s,I.test(e)){const h=I.lastIndex-s,w=t.truncation.countAnsiEscapeCodes?h:t.width.ansi;if(r+w>i&&(o=Math.min(o,s),r+w>t.truncation.limit)){u=!0;break}r+=w,s=I.lastIndex;continue}}const l=e.codePointAt(s);if(l===8203||l===65279||l>=8288&&l<=8292){s+=1;continue}if(l===9){if(r+t.width.tab>i&&(o=Math.min(o,s),r+t.width.tab>t.truncation.limit)){u=!0;break}r+=t.width.tab,s+=1;continue}if(R.lastIndex=s,R.test(e)){const h=(R.lastIndex-s)*t.width.regular;if(r+h>i){const w=t.width.regular>0?Math.floor((i-r)/t.width.regular):0;if(o=Math.min(o,s+w),r+h>t.truncation.limit){u=!0;break}}r+=h,s=R.lastIndex;continue}if((l<=31||l>=127&&l<=159)&&(T.lastIndex=s,T.test(e))){const h=(T.lastIndex-s)*t.width.control;if(r+h>i){const w=t.width.control>0?Math.floor((i-r)/t.width.control):0;if(o=Math.min(o,s+w),r+h>t.truncation.limit){u=!0;break}}r+=h,s=T.lastIndex;continue}if(_.lastIndex=s,_.test(e)){if(r+t.width.emoji>i&&(o=Math.min(o,s),r+t.width.emoji>t.truncation.limit)){u=!0;break}r+=t.width.emoji,s=_.lastIndex;continue}const g=e.codePointAt(s)??0;if(wt(g)){s+=g>65535?2:1;continue}let p;if(a)p=ht(g,t);else switch(te(g)){case"control":{p=t.width.control;break}case"latin":{p=t.width.regular;break}case"wide":{p=t.width.wide;break}case"zero":{p=0;break}default:switch(J(g)){case"ambiguous":{p=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{p=t.width.fullWidth;break}case"wide":{p=t.width.wide;break}default:p=t.width.regular}}if(r+p>i&&(o=Math.min(o,s),r+p>t.truncation.limit)){u=!0;break}r+=p,s+=g>65535?2:1}let m=r,y=!1;return u&&t.truncation.limit>=t.truncation.ellipsisWidth&&(m=t.truncation.limit,y=!0),{ellipsed:y,index:u?o:c,truncated:u,width:m}},En=(e,n={})=>C(e,{...n,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,F=()=>f(me(),".vis"),mt=()=>f(F(),"cache"),bn=()=>f(F(),"state"),gt=e=>we("sha256").update(e).digest("hex").slice(0,12),xn=e=>f(F(),"workspaces",gt(e)),yt=".vis",j=e=>f(e,yt),vn="node_modules/.cache/vis",kn=e=>f(j(e),"runs"),Tn=e=>f(j(e),"last-summary.json"),In=e=>f(j(e),"last-failures"),Rn=e=>{const n=ge()==="win32";for(const t of[".task-runner",".task-runner-cache"]){const i=f(e,t);if(fe(i))try{const c=n?O("cmd.exe",["/c","rmdir","/s","/q",i],{detached:!0,stdio:"ignore"}):O("rm",["-rf",i],{detached:!0,stdio:"ignore"});c.on("error",()=>{}),c.unref()}catch{}}},St="https://api.socket.dev/v0/purl?alerts=true",k=()=>f(mt(),"socket-security"),$t=3600*1e3,ne=.4,K=100,Et=e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"name"in e&&"version"in e&&"alerts"in e&&"score"in e&&e.type==="npm",bt=()=>{ve(k())},se=(e,n)=>`${encodeURIComponent(e)}@${encodeURIComponent(n)}`,xt=(e,n)=>{const t=se(e,n),i=f(k(),`${t}.json`);try{const c=ye(i);if(Date.now()-c.createdAt>c.ttlMs){Y(i,{force:!0});return}return c.report}catch{return}},vt=(e,n,t,i)=>{const c=se(e,n),a={createdAt:Date.now(),report:t,ttlMs:i};he(f(k(),`${c}.json`),JSON.stringify(a),"utf8")},kt=e=>{const n=[e.license,e.maintenance,e.quality,e.supplyChain,e.vulnerability];return Number((n.reduce((t,i)=>t+i,0)/n.length).toFixed(2))},Tt=async(e,n={})=>{const{apiToken:t,cacheTtlMs:i=$t,timeoutMs:c=15e3}=n,a=new Map;if(e.length===0||!t)return a;const s=[];for(const u of e){const d=xt(u.name,u.version);d?a.set(`${u.name}@${u.version}`,d):s.push(u)}if(s.length===0)return a;const r=`Basic ${Buffer.from(`${t}:`).toString("base64")}`;bt();const o=[];for(let u=0;u<s.length;u+=K)o.push(s.slice(u,u+K));for(const u of o){const d=u.map(l=>({purl:`pkg:npm/${l.name}@${l.version}`})),m=new AbortController,y=setTimeout(()=>{m.abort()},c);try{const l=await fetch(St,{body:JSON.stringify({components:d}),headers:{Authorization:r,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:m.signal});if(!l.ok)continue;const g=await l.text();It(g,u,a,i)}catch{}finally{clearTimeout(y)}}return a},It=(e,n,t,i)=>{const c=new Map;for(const s of n)c.set(`${s.name}@${s.version}`,s);const a=e.split(`}
|
|
2
2
|
`);for(const s of a){const r=s.trim();if(r)try{const o=JSON.parse(r.endsWith("}")?r:`${r}}`),d=`${o.namespace?`${o.namespace}/`:""}${o.name}`,m=`${d}@${o.version}`;if(!c.has(m))continue;const y=o.score.overall??kt(o.score),l={alerts:o.alerts,author:o.author,id:o.id,license:o.license,name:o.name,score:{...o.score,overall:y},size:o.size,type:"npm",version:o.version};o.namespace&&(l.namespace=o.namespace),Et(l)&&(t.set(m,l),vt(d,o.version,l,i))}catch{}}},Rt=e=>e.namespace?`${e.namespace}/${e.name}`:e.name,Bn=e=>e>=.8?"excellent":e>=.6?"good":e>=.4?"fair":e>=.2?"poor":"critical",Wn=e=>e>=.6?"green":e>=.4?"yellow":"red",An=e=>{const n=Rt(e),t=`score: ${String(Math.round(e.score.overall*100))}%`,i=e.alerts.length,c=i>0?`${String(i)} alert${i===1?"":"s"}`:"no alerts";return`${n}@${e.version} (${t}, ${c})`},Mn=(e,n=ne)=>{if(e.size===0)return"";let t=0,i=0,c=0,a=0,s=0,r=0;for(const u of e.values()){for(const d of u.alerts)switch(t++,d.severity){case"critical":{i++;break}case"high":{c++;break}case"medium":{a++;break}default:s++}u.score.overall<n&&r++}const o=[`Socket.dev: scanned ${String(e.size)} package${e.size===1?"":"s"}`];if(t>0){const u=[];i>0&&u.push(`${String(i)} critical`),c>0&&u.push(`${String(c)} high`),a>0&&u.push(`${String(a)} medium`),s>0&&u.push(`${String(s)} low`),o.push(` Alerts: ${String(t)} total (${u.join(", ")})`)}else o.push(" No security alerts found.");if(r>0){const u=Math.round(n*100);o.push(` ${String(r)} package${r===1?"":"s"} with low security score (<${String(u)}%)`)}return o.join(`
|
|
3
3
|
`)},Bt=()=>{const e=k();if(!B(e))return 0;const n=G(e).filter(t=>t.endsWith(".json"));for(const t of n)Y(f(e,t),{force:!0});return n.length},Wt=()=>{const e=k();if(!B(e))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const n=G(e).filter(a=>a.endsWith(".json"));let t=0,i,c;for(const a of n){const s=pe(f(e,a));t+=s.size;const{mtimeMs:r}=s;(i===void 0||r<i)&&(i=r),(c===void 0||r>c)&&(c=r)}return{entries:n.length,newestEntry:c,oldestEntry:i,totalSizeBytes:t}},At=(e,n)=>e?.enabled?{apiToken:e.apiToken??process.env.VIS_SOCKET_TOKEN,cacheTtlMs:e.cacheTtlMs,minimumScore:n??ne,timeoutMs:e.timeoutMs}:void 0,_n=(e,n,t,i)=>{if(!t)return;const c=Date.now(),a=r=>{if(r.expiresAt){const o=Date.parse(r.expiresAt);if(!Number.isNaN(o)&&o<c)return!1}return!(i&&r.policies&&!r.policies.includes(i))},s=`${e}@${n}`;if(t[s]&&a(t[s]))return t[s];if(t[e]&&a(t[e]))return t[e];for(const[r,o]of Object.entries(t))if(r.endsWith("*")&&e.startsWith(r.slice(0,-1))&&a(o))return o},Cn=(e,n,t,i)=>[" // Add to security.acceptedRisks in vis.config.ts:",` ${`"${e}"`}: {`,` reason: "${i}",`,` acceptedAt: "${new Date().toISOString()}",`,` acceptedScore: ${String(t)},`,' policies: ["score"],'," },"].join(`
|
|
4
4
|
`),Nn=(e,n={})=>{const t=At(e,n.minimumScore);if(t)return{clearCache:Bt,displayName:"Socket.dev",fetchReports:i=>Tt(i,t),getCacheStats:Wt,id:"socket"}},Fn=e=>{if(e===void 0)return!1;const n=e.trim().toLowerCase();return n!==""&&n!=="0"&&n!=="false"&&n!=="no"};export{fn as $,nn as A,Gt as B,Kt as C,vn as D,qt as E,tn as F,en as G,Yt as H,wn as I,mn as J,Zt as K,Ut as L,Qt as M,hn as N,Jt as O,on as P,gn as Q,ee as R,un as S,Ht as T,jt as U,yn as V,cn as W,Xt as X,dn as Y,Sn as Z,an as _,kn as a,pn as a0,Rn as a1,Vt as a2,zt as a3,Q as a4,C as a5,rt as a6,at as a7,Pt as a8,Dt as a9,Lt as aa,Ot as ab,Nn as ac,Mn as ad,Tn as ae,In as b,F as c,j as d,ne as e,Rt as f,mt as g,ve as h,_n as i,An as j,Bn as k,Cn as l,Fn as m,bn as n,kt as o,Tt as p,En as q,Bt as r,Wn as s,Wt as t,L as u,xn as v,$n as w,ln as x,rn as y,sn as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as d,z as u}from"./index-0dnGN3GP.js";import{a as l}from"./index--eV4qIz5.js";import{y as f}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as m}from"./package-version-
|
|
1
|
+
import{e as d,z as u}from"./index-0dnGN3GP.js";import{a as l}from"./index--eV4qIz5.js";import{y as f}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as m}from"./package-version-DSr8JAeI.js";const v={sha1:40,sha224:56,sha256:64,sha384:96,sha512:128},p=o=>{const n=o.indexOf("+");if(n===-1)return;const t=o.slice(n+1),e=/^([a-z0-9]+)\.([0-9a-f]+)$/.exec(t),s=e?v[e[1]]:void 0;if(!(e&&s!==void 0&&e[2].length===s))return`packageManager "${o}" has a malformed integrity suffix. Expected "+<algo>.<hex>" with algo sha1, sha224, sha256, sha384 or sha512 and lowercase hex of the matching length (sha512 = 128 characters).`},k=[".nvmrc",".node-version"],y=o=>{const n=d(o,"package.json");if(!f(n))return{};try{return m(n)??{}}catch{return{}}},c=(o,n)=>{const t=[];for(const{name:e,version:s}of n){const a=typeof s=="string"&&s.trim()!==""?s.trim():"*";l.validRange(a)!==null&&t.push({name:e,range:a})}if(t.length!==0)return{entries:t,label:o,value:n.map(e=>typeof e.version=="string"&&e.version!==""?`${e.name}@${e.version}`:e.name).join(" | ")}},h=(o,n)=>{const t=Array.isArray(o)?o:[o],e=[];for(const s of t){if(typeof s!="object"||s===null)continue;const{name:a,onFail:r,version:i}=s;typeof a!="string"||n!==void 0&&a!==n||e.push({name:a,onFail:typeof r=="string"?r:void 0,version:i})}return e},E=(o,n)=>{const t=d(o,n);if(f(t))try{const e=u(t).trim();return e===""?void 0:e}catch{return}},x=(o,n)=>{const t=[];for(const r of k){const i=E(o,r);i!==void 0&&t.push(c(r,[{name:"node",version:i}]))}const e=n.engines;e&&typeof e.node=="string"&&t.push(c("engines.node",[{name:"node",version:e.node}]));const s=n.devEngines;s?.runtime!==void 0&&t.push(c("devEngines.runtime",h(s.runtime,"node")));const a=n.volta;return a&&typeof a.node=="string"&&t.push(c("volta.node",[{name:"node",version:a.node}])),t.filter(r=>r!==void 0)},$=o=>{const n=[],t=[];if(typeof o.packageManager=="string"){const s=o.packageManager,a=p(s);a&&t.push(a);const[r]=s.split("+",1),i=/^([^@]+)@(.+)$/.exec(r??"");i&&n.push(c("packageManager",[{name:i[1],version:i[2]}]))}const e=o.devEngines;if(e?.packageManager!==void 0){const s=h(e.packageManager);n.push(c("devEngines.packageManager",s))}return{declarations:n.filter(s=>s!==void 0),integrityIssues:t}},M=(o,n)=>o.entries.some(t=>n.entries.some(e=>t.name===e.name&&l.intersects(t.range,e.range))),g=(o,n)=>{const t=[];for(let e=0;e<n.length;e++)for(let s=e+1;s<n.length;s++){const a=n[e],r=n[s];M(a,r)||t.push(`Conflicting ${o} declarations: ${a.label} (${a.value}) and ${r.label} (${r.value}) have no version in common. vis does not pick one; align them.`)}return t},P=o=>{const n=y(o),t=x(o,n),{declarations:e,integrityIssues:s}=$(n),a=t.length+e.length;if(a===0&&s.length===0)return[{id:"env-declarations",message:"No Node.js or package-manager declarations to cross-check.",status:"skip"}];const r=[...g("Node.js",t),...g("package-manager",e)].map(i=>({id:"env-conflict",message:i,status:"warn"}));for(const i of s)r.push({id:"env-integrity",message:i,status:"warn"});return r.length===0?[{id:"env-declarations",message:`Node.js and package-manager declarations agree (${a} checked).`,status:"ok"}]:r};export{P as c,h as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as p}from"node:module";import{e as j}from"./index-0dnGN3GP.js";import{b as F}from"./env-
|
|
1
|
+
import{createRequire as p}from"node:module";import{e as j}from"./index-0dnGN3GP.js";import{b as F}from"./env-B5goXAfs.js";let h;const m=t=>(h??=p(import.meta.url))(t),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,r]=s.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return s.getBuiltinModule(t)}return m(t)},{mkdirSync:f,writeFileSync:y,readdirSync:g}=c("node:fs"),{readFile:_}=c("node:fs/promises"),i=t=>F(t),a=(t,e)=>j(i(t),`${encodeURIComponent(e)}.json`);class R{#e;#t;constructor(e,r){this.#e=e,this.#t=r}printTaskTerminalOutput(e,r,o){if(r!=="failure")return;const n=i(this.#e);try{f(n,{recursive:!0})}catch{return}const u=e.overrides.command,d=e.projectRoot,l={command:u,cwd:d,exitCode:void 0,hash:e.hash,runId:this.#t,status:r,taskId:e.id,terminalOutput:o,timestamp:new Date().toISOString()};try{y(a(this.#e,e.id),`${JSON.stringify(l,void 0,2)}
|
|
2
2
|
`,"utf8")}catch{}}}const S=async(t,e)=>{const r=a(t,e);try{const o=await _(r,"utf8");return JSON.parse(o)}catch{return}},b=t=>{const e=i(t);let r;try{r=g(e)}catch{return[]}const o=[];for(const n of r)if(n.endsWith(".json"))try{o.push(decodeURIComponent(n.slice(0,-5)))}catch{}return o};export{R as F,S as a,b as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as t}from"./registry-DSnDqaMj.js";const s=async(a,o)=>await t(a,o);export{s as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./vis-user-error-
|
|
1
|
+
import{b as e}from"./vis-user-error-BrIWyJ2j.js";const o={filter:{alias:"F",description:"Filter packages by name pattern",multiple:!0,type:String},parallel:{defaultValue:!1,description:"Run concurrently without topological ordering",type:Boolean},recursive:{alias:"r",defaultValue:!1,description:"Run in every workspace package",type:Boolean},reverse:{defaultValue:!1,description:"Reverse topological execution order",type:Boolean},"shell-mode":{alias:"c",defaultValue:!1,description:"Execute within shell environment",type:Boolean},"workspace-root":{alias:"w",defaultValue:!1,description:"Run on workspace root only",type:Boolean}},l=e({argument:{description:"Command to execute followed by arguments",name:"command",type:String},description:"Execute a local node_modules/.bin command (no remote fallback)",examples:[["vis exec eslint .","Run local eslint"],["vis exec tsc --noEmit","Run local TypeScript check"],["vis exec -r -- eslint .","Run in all workspace packages"],["vis exec -c 'echo $PATH'","Shell mode"]],group:"Run & Execute",loader:()=>import("../packem_chunks/handler.js"),name:"exec",options:o});export{l as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as k,D as S,f as L}from"./provenance-
|
|
1
|
+
import{m as k,D as S,f as L}from"./provenance-DMbTd536.js";import{g as $}from"./packument-DbQ_r11E.js";import{i as f}from"./env-B5goXAfs.js";import{a as E}from"./build-scripts-BedOAAkJ.js";import{n as h}from"./license-DvlYdo6T.js";import{v as A,U as P,z as x}from"./index-0dnGN3GP.js";import{S as O}from"./lockfile-DhHAaHN5.js";import{L as b}from"./dependency-scan-CIhI1eyk.js";import{a as M}from"./advisories-DTwACNnG.js";const C=2,m=4,y={CRITICAL:0,HIGH:1,LOW:3,MODERATE:C,UNKNOWN:m},le=(e,s)=>{const n=y[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??m,t=y[(s.vulnerability.severity??"UNKNOWN").toUpperCase()]??m;return n-t||e.packageName.localeCompare(s.packageName)||e.packageVersion.localeCompare(s.packageVersion)},D=(e,s)=>{const n=y[s.toUpperCase()]??C;return(y[e.toUpperCase()]??m)<=n},R=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"],w=6e4,W=(e,s,n)=>{for(const t of n)if(t===e||t===`${e}@${s}`||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},U=async(e,s)=>{const n=s.security?.policies?.firstSeen;if(n?.minutes===void 0||n.minutes<=0)return[];const{minutes:t}=n,r=n.exclude??[],c=s.security?.acceptedRisks,a=t*w,o=Date.now();return(await k(e.packages,S,async l=>{if(W(l.name,l.version,r))return;const p=await $(l.name,{workspaceRoot:e.workspaceRoot});if(p===void 0)return;const u=p.time?.[l.version];if(u===void 0)return;const d=Date.parse(u);if(Number.isNaN(d))return;const v=o-d;if(v>=a)return;const g=Math.max(0,Math.floor(v/w));return{acceptedRisk:f(l.name,l.version,c,"firstSeen"),data:{ageMinutes:g,minimumMinutes:t,publishedAt:u},packageName:l.name,policy:"firstSeen",reason:`${l.name}@${l.version} was published ${String(g)} min ago — below the ${String(t)} min firstSeen cooldown.`,severity:"block",version:l.version}})).filter(l=>l!==void 0)},_=(e,s)=>{const n=s.security?.policies?.installScripts;if(!n)return[];const t=n.allow??{},r=n.strict===!0;if(!r&&Object.keys(t).length===0)return[];const c=E(e.workspaceRoot,t,{pinVersions:s.security?.pinVersions===!0});if(c.unapproved.length===0)return[];const a=s.security?.acceptedRisks,o=r?"block":"warn";return c.unapproved.map(i=>({acceptedRisk:f(i.name,i.version??"*",a,"installScripts"),data:{hooks:i.hooks},packageName:i.name,policy:"installScripts",reason:`${i.name}${i.version?`@${i.version}`:""} declares unapproved build script(s): ${i.hooks.join(", ")}`,severity:o,version:i.version??"*"}))},I=new Set(["AND","OR"]),F=e=>{const s=e.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(r=>r.trim()).filter(r=>r.length>0),n=[];let t=!1;for(const r of s){const c=r.toUpperCase();if(t){t=!1;continue}if(c==="WITH"){t=!0;continue}if(I.has(c))continue;const a=r.endsWith("+"),o=a?r.slice(0,-1):r,i=h(o)??o;n.push(i),a&&n.push(`${i}-or-later`)}return n},T=e=>{if(typeof e.license=="string"){const s=e.license.trim();return s.length>0?s:void 0}if(e.license&&typeof e.license=="object"&&typeof e.license.type=="string"){const s=e.license.type.trim();if(s.length>0)return s}if(Array.isArray(e.licenses)&&e.licenses.length>0){const s=e.licenses.map(n=>n&&typeof n.type=="string"?n.type.trim():"").filter(n=>n.length>0);if(s.length>0)return s.length===1?s[0]:`(${s.join(" OR ")})`}},V=(e,s)=>{if(s.length===0)return;const n=new Set(s.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of e)if(n.has(t.toLowerCase()))return t},K=(e,s)=>{if(s.length===0)return;const n=new Set(s.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of e)if(!n.has(t.toLowerCase()))return t},j=(e,s)=>{const n=s.security?.policies?.license;if(!n)return[];const t=n.allow??[],r=n.deny??[];if(t.length===0&&r.length===0)return[];const c=s.security?.acceptedRisks,a=[];for(const o of e.packages){const i=e.manifestData?.get(`${o.name}@${o.version}`),l=i?T(i):void 0;if(!l){t.length>0&&a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{declaredLicense:null},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} declares no license; allow-list mode requires one of: ${t.join(", ")}`,severity:"block",version:o.version});continue}const p=F(l),u=V(p,r);if(u){a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:o.version});continue}const d=K(p,t);d&&a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{allowList:t,declaredLicense:l,unallowedLicense:d},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses license '${d}' which is not on the allow-list (declared: ${l})`,severity:"block",version:o.version})}return a},z=6e4,B=(e,s,n)=>{for(const t of n)if(t===e||t===`${e}@${s}`||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},Y=async(e,s)=>{const n=s.security?.policies?.publisherChange;if(n?.mode!=="no-downgrade")return[];const t=n.exclude??[],r=typeof n.ignoreAfter=="number"?n.ignoreAfter*z:void 0,c=s.security?.acceptedRisks,a=Date.now();return(await k(e.packages,S,async i=>{if(B(i.name,i.version,t))return;const l=await $(i.name,{workspaceRoot:e.workspaceRoot});if(l===void 0)return;if(r!==void 0){const d=l.time?.[i.version],v=d===void 0?Number.NaN:Date.parse(d);if(!Number.isNaN(v)&&a-v>r)return}if(l.versions[i.version]?.dist?.attestations?.provenance!==void 0)return;const u=L(l,i.version);if(u!==void 0)return{acceptedRisk:f(i.name,i.version,c,"publisherChange"),data:{priorVersionWithProvenance:u},packageName:i.name,policy:"publisherChange",reason:`${i.name}@${i.version} dropped the provenance attestation that ${i.name}@${u} carried — publisher trust downgrade.`,severity:"block",version:i.version}})).filter(i=>i!==void 0)},H=e=>{for(const s of Object.values(b))for(const n of[s.file,...s.aliases??[]])if(e===n||e.endsWith(`/${n}`)||e.endsWith(`.${n}`))return s.type},q=(e,s,n)=>{const t=A(s)?s:P(e,s);let r;try{r=x(t)}catch{return}const c=H(t)??b[n]?.type;if(!c)return;const a=O(r,c);if(a.length===0)return;const o=new Set;for(const i of a)o.add(`${i.name}@${i.version}`);return o},G=(e,s)=>{for(const n of s)if(n===e||n.endsWith("*")&&e.startsWith(n.slice(0,-1)))return!0;return!1},X=(e,s)=>{const n=s.security?.policies?.unexpectedDeps;if(!n)return[];const t=n.allow??[],r=n.baselineLockfile;if(t.length===0&&!r)return[];const c=r?q(e.workspaceRoot,r,e.packageManager):void 0,a=s.security?.acceptedRisks,o=[];for(const i of e.packages){const l=t.length===0||G(i.name,t),p=c?c.has(`${i.name}@${i.version}`):!0;if(l&&p)continue;const u=[],d={};l||(u.push(`not on allow-list (${t.length} entr${t.length===1?"y":"ies"})`),d.allowList=t),!p&&c&&(u.push(`not present in baseline lockfile (${r})`),d.baselineLockfile=r),o.push({acceptedRisk:f(i.name,i.version,a,"unexpectedDeps"),data:d,packageName:i.name,policy:"unexpectedDeps",reason:`${i.name}@${i.version} is unexpected: ${u.join("; ")}`,severity:"block",version:i.version})}return o},J=(e,s)=>{if(!e.osvFindings||e.osvFindings.size===0)return[];const t=s.security?.policies?.vulnerability?.failOn,r=s.security?.acceptedRisks,c=[];for(const a of e.packages){const o=e.osvFindings.get(M(a.name,a.version))??e.osvFindings.get(a.name);if(!(!o||o.length===0))for(const i of o){const l=t?D(i.severity,t)?"block":"warn":"info";c.push({acceptedRisk:f(a.name,a.version,r,"vulnerability"),data:{advisoryId:i.id,aliases:i.aliases??[],cvssScore:i.cvssScore,fixedVersions:i.fixedVersions,severity:i.severity,summary:i.summary},packageName:a.name,policy:"vulnerability",reason:`${i.severity} ${i.id} affects ${a.name}@${a.version}: ${i.summary}`,severity:l,version:a.version})}}return c},N=[{evaluate:J,isConfigured:e=>e.security?.policies?.vulnerability!==void 0,name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:j,isConfigured:e=>{const s=e.security?.policies?.license;return!!(s&&(s.allow&&s.allow.length>0||s.deny&&s.deny.length>0))},name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:_,isConfigured:e=>{const s=e.security?.policies?.installScripts;return!!(s&&(s.allow&&Object.keys(s.allow).length>0||s.strict===!0))},name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:X,isConfigured:e=>{const s=e.security?.policies?.unexpectedDeps;return!!(s&&(s.allow&&s.allow.length>0||typeof s.baselineLockfile=="string"))},name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:U,isConfigured:e=>{const s=e.security?.policies?.firstSeen?.minutes;return typeof s=="number"&&s>0},name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:Y,isConfigured:e=>e.security?.policies?.publisherChange?.mode==="no-downgrade",name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],Q=(e,s,n)=>N.filter(t=>t.surfaces.includes(e)?n!==void 0?n.has(t.name):t.isConfigured(s):!1),ue=async(e,s,n)=>{const t=Q(s,n.visConfig,n.enabledPolicies),r=[];for(const c of t){if(e.offline&&!c.offlineSupported){r.push({packageName:"*",policy:c.name,reason:`policy.${c.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const a=await c.evaluate(e,n.visConfig);r.push(...a)}catch(a){const o=a instanceof Error?a.message:String(a);r.push({packageName:"*",policy:c.name,reason:`policy.${c.name} failed: ${o}`,severity:"info",version:"*"})}}return r},Z=(()=>{const e=new Map;for(const s of R)e.set(s.toLowerCase(),s);return e})(),de=()=>N.map(e=>e.name),pe=(e,s)=>{if(e===void 0)return;const n=e.trim().toLowerCase();if(n===""||n==="none")return new Set;if(n==="all")return new Set(R);const t=new Set;for(const r of e.split(",").map(c=>c.trim()).filter(c=>c.length>0)){const c=r.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(o,i)=>i.toUpperCase()),a=Z.get(c.toLowerCase());a===void 0?s?.(r):t.add(a)}return t};export{le as c,ue as e,de as g,pe as p,D as s};
|