@visulima/vis 1.0.0-alpha.25 → 1.0.0-alpha.26
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 +17 -0
- package/LICENSE.md +2 -135
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/bin.js +123 -123
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/config.js +15 -15
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.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/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler22.js +1 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler31.js +1 -1
- package/dist/packem_chunks/handler38.js +1 -1
- package/dist/packem_chunks/handler39.js +1 -1
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler40.js +1 -1
- package/dist/packem_chunks/handler42.js +1 -1
- package/dist/packem_chunks/handler44.js +1 -1
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler48.js +58 -57
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/{advisories-U1QKY_tg.js → advisories-DS8JEB_g.js} +1 -1
- package/dist/packem_shared/{cyclonedx-D6F9rAay.js → cyclonedx-ja1cbU69.js} +1 -1
- package/dist/packem_shared/{docker-BU-7veP5.js → docker-Bw9gKo69.js} +1 -1
- package/dist/packem_shared/{index-PexbdLyT.js → index-88UK-tt_.js} +1 -1
- package/dist/packem_shared/{index-D9ZIw4ra.js → index-CS6a2wFB.js} +1 -1
- package/dist/packem_shared/{osv-bloom-CyCDpXBl.js → osv-bloom-QSAn2Dcw.js} +2 -2
- package/dist/packem_shared/{pm-runner-Cj76BV8q.js → pm-runner-BzGZmzYs.js} +1 -1
- package/dist/packem_shared/{provenance-CdvMwB2R.js → provenance-BsBn1f5S.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-CRFybyxv.js → resolve-explicit-CBPr617N.js} +1 -1
- package/dist/packem_shared/{s1ngularity-CiZla5EP.js → s1ngularity-j_ArCZAs.js} +1 -1
- package/dist/packem_shared/{signatures-BsEDWhME.js → signatures-CaXzNuEn.js} +1 -1
- package/dist/packem_shared/{typosquats-_7T7U2q2.js → typosquats-C1e6RNjF.js} +1 -1
- package/index.d.ts +201 -201
- package/index.js +26 -26
- package/package.json +10 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var J=Object.defineProperty;var j=(c,o)=>J(c,"name",{value:o,configurable:!0});import{c as W,y as q,p as m,U as B,O as K,R as Z,F as f,i as U,b as Q,V as X,K as _,H as A,W as ee,G as te,s as oe}from"./bin.js";import{render as O,renderToString as re}from"@visulima/tui";import{Text as y}from"@visulima/tui/components/text";import i from"react";import{H as se,e as ne,Z as ae}from"../packem_shared/ai-analysis-Csn82p17.js";import{A as ie}from"../packem_shared/pm-runner-
|
|
1
|
+
var J=Object.defineProperty;var j=(c,o)=>J(c,"name",{value:o,configurable:!0});import{c as W,y as q,p as m,U as B,O as K,R as Z,F as f,i as U,b as Q,V as X,K as _,H as A,W as ee,G as te,s as oe}from"./bin.js";import{render as O,renderToString as re}from"@visulima/tui";import{Text as y}from"@visulima/tui/components/text";import i from"react";import{H as se,e as ne,Z as ae}from"../packem_shared/ai-analysis-Csn82p17.js";import{A as ie}from"../packem_shared/pm-runner-BzGZmzYs.js";import{U as ce,C as le,a as D}from"../packem_shared/vis-update-app-qhQPV97i.js";var de=Object.defineProperty,ue=j((c,o)=>de(c,"name",{value:o,configurable:!0}),"A");const ke=ue(async({argument:c,logger:o,options:e,visConfig:a,workspaceRoot:x})=>{if(!x)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const u=x;if(e.securityConfig){const t=ie(u);if(W(a??{},t.name),e.sync&&t.name==="pnpm"){const r=q(a??{});if(r.length>0){m.info(`
|
|
2
2
|
Settings that would sync to pnpm-workspace.yaml:`);for(const $ of r)m.success(` ${$}`)}else m.info("No security settings to sync.")}else e.sync&&t.name!=="pnpm"&&(m.info(`--sync is only available for pnpm projects. Your project uses ${t.name}.`),m.info("vis enforces security settings at the vis layer for non-pnpm projects."));if(!e.security&&!c?.length)return}const{packageManager:F}=B(u),M=K(u),l=a?.update??{},v=Z(u,F,{dev:e.dev,includeInternal:e["include-internal"],peer:e.peer,prod:e.prod});if(v.size===0){o.info("No catalogs found.");return}const w=e.target??l.target??"latest";if(!["latest","minor","patch"].includes(w))throw new Error(`Invalid target "${w}". Use: latest, minor, or patch.`);const N={exclude:[...f(e.exclude),...f(l.exclude)],ignore:f(l.ignore),include:[...f(e.include),...f(l.include),...c],includeLocked:!!e.includeLocked,includePrerelease:e.prerelease||l.prerelease||!1,security:e.security!==!1,target:w};let R=0;for(const t of v.values())R+=t.size;const h=!!process.stdout.isTTY&&!oe;let d;const z=h?(t,r)=>{d?d.rerender(i.createElement(D,{current:t,total:r})):d=O(i.createElement(D,{current:t,total:r}),{interactive:!0,patchConsole:!1})}:(t,r)=>{o.info(`Checking ${String(t)}/${String(r)} dependencies...`)};h||o.info(`Checking ${String(R)} catalog dependencies against npm registry...
|
|
3
3
|
`);const k=new Set;U("socket")&&k.add("socket"),U("depsDev")&&k.add("deps-dev");const C=a?.security?.policies?.score?.minimum,H=Q(a?.security,{disabled:k,minimumScore:C}),{failed:b,outdated:n}=await X(v,N,M,z,u,H,a?.security?.acceptedRisks);if(d&&(d.clear(),d.unmount()),b.length>0&&o.warn(`Failed to fetch: ${b.join(", ")}`),n.length===0){o.info("All catalog dependencies are up to date.");return}const E=e.format??l.format??"table",I=se(e.aiType??"impact"),p=e.ai?await ne(n,o,a?.ai,I):void 0;if(h&&E==="table"){const t=new ce(n,p??null),r=a?.tui?.autoExit??!1,$=r===!0?3:typeof r=="number"?r:0;await O(i.createElement(le,{autoExitSeconds:$,isDryRun:!0,store:t}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit();const L=process.stdout.columns||80;process.stdout.write(`
|
|
4
4
|
`);for(const s of n){const P=s.vulnerabilities?.length||s.socketReport&&s.socketReport.alerts.length>0,S=!!s.acceptedRisk,V=P?S?"✓":"⚠":"✓",Y=S?"gray":s.updateType==="major"?"red":s.updateType==="minor"?"yellow":"green",g=s.socketReport?.score.overall,G=g===void 0?"":` [${String(Math.round(g*100))}%]`,T=g===void 0?void 0:_(g);process.stdout.write(`${re(i.createElement(y,null," ",i.createElement(y,{color:Y},V),` ${s.packageName} ${s.currentRange} → ${s.newRange}`,i.createElement(y,{dimColor:!0},` ${s.updateType}`),T?i.createElement(y,{color:T},G):null),{columns:L})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var i=Object.defineProperty;var s=(e,o)=>i(e,"name",{value:o,configurable:!0});import{R as l,M as p}from"../packem_shared/pm-runner-
|
|
1
|
+
var i=Object.defineProperty;var s=(e,o)=>i(e,"name",{value:o,configurable:!0});import{R as l,M as p}from"../packem_shared/pm-runner-BzGZmzYs.js";var f=Object.defineProperty,d=s((e,o)=>f(e,"name",{value:o,configurable:!0}),"n");const u=d(async({logger:e,options:o,visConfig:a,workspaceRoot:r})=>{const c=r??process.cwd(),t=l(c,{configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),n=p(t,o.check||!1,c,e);n!==0&&(process.exitCode=n)},"execute");export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var d=Object.defineProperty;var i=(e,s)=>d(e,"name",{value:s,configurable:!0});import{R as k,B as u}from"../packem_shared/pm-runner-
|
|
1
|
+
var d=Object.defineProperty;var i=(e,s)=>d(e,"name",{value:s,configurable:!0});import{R as k,B as u}from"../packem_shared/pm-runner-BzGZmzYs.js";var v=Object.defineProperty,x=i((e,s)=>v(e,"name",{value:s,configurable:!0}),"n");const w=x(async({argument:e,logger:s,options:a,visConfig:r,workspaceRoot:l})=>{const o=e;if(!o||o.length===0)throw new Error("No package specified. Usage: vis dlx <package[@version]> [args...]");const[t,...g]=o,n=l??process.cwd(),p=k(n,{configBackend:r?.install?.backend,configCorepack:r?.install?.corepack}),f=a.package?Array.isArray(a.package)?a.package:[a.package]:[],c=u(p,{additionalPackages:f,args:g,package:t,shellMode:a.shellMode||!1,silent:a.silent||!1},n,s,{offline:a.offline||!1});c!==0&&(process.exitCode=c)},"execute");export{w as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var H=Object.defineProperty;var I=(e,t)=>H(e,"name",{value:t,configurable:!0});import{createRequire as U}from"node:module";import{C as O,z as F}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{d as D,P as K,R as S,w as j,p as V}from"./heal.js";import{A as q,P as Y}from"../packem_shared/pm-runner-
|
|
1
|
+
var H=Object.defineProperty;var I=(e,t)=>H(e,"name",{value:t,configurable:!0});import{createRequire as U}from"node:module";import{C as O,z as F}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{d as D,P as K,R as S,w as j,p as V}from"./heal.js";import{A as q,P as Y}from"../packem_shared/pm-runner-BzGZmzYs.js";import{p as a}from"./bin.js";const P=U(import.meta.url),T=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=I(e=>{if(typeof T<"u"&&T.versions&&T.versions.node){const[t,o]=T.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return T.getBuiltinModule(e)}return P(e)},"__cjs_getBuiltinModule"),{readFile:B}=A("node:fs/promises"),{createInterface:M}=A("node:readline");var J=Object.defineProperty,k=I((e,t)=>J(e,"name",{value:t,configurable:!0}),"o");const z=k(()=>!!process.stdout.isTTY&&process.env.CI!=="true","isInteractive"),W=k(e=>new Promise(t=>{const o=M({input:process.stdin,output:process.stderr});o.question(`${e} (Y/n) `,i=>{o.close();const s=i.trim().toLowerCase();t(s===""||s==="y"||s==="yes")})}),"defaultPrompt"),X=k((e,t)=>{const o=q(t),i=Y(o,{exact:!1,filter:[],global:!1,optional:!1,packages:[e],peer:!1,saveDev:!1,workspace:!1,workspaceRoot:!1},t,console);return Promise.resolve({exitCode:i})},"defaultRunInstall"),y=k(e=>`pnpm add ${e}`,"installCommandFor"),Q=k(e=>e==="@gitbeaker/rest"?import("@gitbeaker/rest"):import("@octokit/rest"),"defaultImport"),L=k(async(e,t={})=>{const o=t.interactive??z(),i=t.prompt??W,s=t.runInstall??X,l=t.importImpl??Q,d=t.workspaceRoot??process.cwd();try{return await l(e)}catch(n){const{code:p}=n;if(p!=="ERR_MODULE_NOT_FOUND"&&p!=="MODULE_NOT_FOUND")throw n}if(!o)throw new Error(`${e} is not installed. \`vis ai heal accept\` needs it to talk to the host. Install it in your repo first:
|
|
2
2
|
${y(e)}`);if(!await i(`${e} isn't installed. Install it now?`))throw new Error(`${e} install declined. Re-run \`vis ai heal accept\` after installing manually:
|
|
3
3
|
${y(e)}`);const r=await s(e,d);if(r.exitCode!==0)throw new Error(`Install of ${e} failed (exit ${String(r.exitCode)}). Install manually and retry:
|
|
4
4
|
${y(e)}`);return await l(e)},"loadOptionalSdk");var Z=Object.defineProperty,_=I((e,t)=>Z(e,"name",{value:t,configurable:!0}),"s");const ee=_(e=>{const t=e.indexOf("/");if(t<=0||t===e.length-1)throw new Error(`Expected GITHUB_REPOSITORY in "owner/repo" form, got: ${e}`);return{owner:e.slice(0,t),repo:e.slice(t+1)}},"splitGithubRepo"),te=_(async(e,t)=>{if(t.githubClient)return t.githubClient;const o=(await(t.loadSdk??L)("@octokit/rest")).Octokit;if(!o)throw new TypeError("Loaded `@octokit/rest` but no `Octokit` export was found. Reinstall the package or pin to a supported major.");return new o({auth:e})},"loadGithubClient"),oe=_(async(e,t,o)=>{if(o.gitlabClient)return o.gitlabClient;const i=(await(o.loadSdk??L)("@gitbeaker/rest")).Gitlab;if(!i)throw new TypeError("Loaded `@gitbeaker/rest` but no `Gitlab` export was found. Reinstall the package or pin to a supported major.");return new i({host:t,token:e})},"loadGitlabClient"),re=_(e=>e.replace(/\/api\/v\d+\/?$/,""),"apiBaseToHost"),ie=_(async e=>{const{branch:t,ciContext:o,files:i,message:s,workspaceRoot:l}=e,d=e.readFile??(w=>B(w,"utf8"));if(!o.repo)throw new Error("Cannot commit on GitHub: GITHUB_REPOSITORY (owner/repo) is not set.");if(!o.token)throw new Error("Cannot commit on GitHub: GITHUB_TOKEN is not set. Grant the workflow `contents: write` and pass the token through.");const{owner:r,repo:n}=ee(o.repo),p=await te(o.token,e),u=(await p.rest.git.getRef({owner:r,ref:`heads/${t}`,repo:n})).data.object.sha,h=(await p.rest.git.getCommit({commit_sha:u,owner:r,repo:n})).data.tree.sha,m=await Promise.all(i.map(async w=>{const v=O(l,w),E=await d(v),C=await p.rest.git.createBlob({content:Buffer.from(E,"utf8").toString("base64"),encoding:"base64",owner:r,repo:n});return{mode:"100644",path:w,sha:C.data.sha,type:"blob"}})),f=await p.rest.git.createTree({base_tree:h,owner:r,repo:n,tree:m}),b=await p.rest.git.createCommit({message:s,owner:r,parents:[u],repo:n,tree:f.data.sha});return await p.rest.git.updateRef({owner:r,ref:`heads/${t}`,repo:n,sha:b.data.sha}),{sha:b.data.sha,url:b.data.html_url}},"commitToGithub"),ae=_(async e=>{const{branch:t,ciContext:o,files:i,message:s,workspaceRoot:l}=e,d=e.readFile??(m=>B(m,"utf8"));if(!o.repo)throw new Error("Cannot commit on GitLab: CI_PROJECT_ID / CI_PROJECT_PATH is not set.");if(!o.token)throw new Error("Cannot commit on GitLab: no token. CI_JOB_TOKEN cannot push commits — set GITLAB_TOKEN to a PAT/project-token with `api` scope.");if(!o.apiBaseUrl)throw new Error("Cannot commit on GitLab: CI_API_V4_URL is not set.");const r=re(o.apiBaseUrl),n=await oe(o.token,r,e),p=await Promise.all(i.map(async m=>{const f=O(l,m);return{action:"update",content:await d(f),filePath:m}})),u=await n.Commits.create(o.repo,t,s,p),h=u.id??u.sha;if(!h)throw new Error("GitLab Commits.create returned no commit ID — cannot reference the new commit.");return{sha:h,url:u.web_url??u.webUrl}},"commitToGitlab"),ne=_(async e=>{if(e.files.length===0)throw new Error("Cannot commit: no files to include.");if(e.ciContext.provider==="github-actions")return await ie(e);if(e.ciContext.provider==="gitlab-ci")return await ae(e);throw new Error(`Cannot commit: unsupported CI provider \`${e.ciContext.provider}\`. Run \`vis ai heal accept\` from a recognised CI environment.`)},"commitFiles");var se=Object.defineProperty,g=I((e,t)=>se(e,"name",{value:t,configurable:!0}),"u");const G="/vis heal accept",ce=g(async e=>{if(!e)return;let t;try{t=await B(e,"utf8")}catch{return}const o=JSON.parse(t),i=o.comment?.body??"",s=o.comment?.user?.login??"",l=o.pull_request?.head?.repo?.full_name,d=o.pull_request?.base?.repo?.full_name??o.repository?.full_name,r=l!==void 0&&d!==void 0&&l!==d;return{actor:s,body:i,headRef:o.pull_request?.head?.ref,isFork:r}},"loadGithubTrigger"),le=g(e=>{const t=e.VIS_HEAL_TRIGGER_BODY,o=e.VIS_HEAL_TRIGGER_ACTOR;if(!(!t||!o))return{actor:o,body:t,headRef:e.VIS_HEAL_HEAD_REF,isFork:!1}},"loadGitlabTrigger"),de=g(e=>{const t=e.BUILDKITE_UNBLOCKER_EMAIL??e.BUILDKITE_UNBLOCKER;if(t)return{actor:t,body:G,headRef:e.BUILDKITE_BRANCH,isFork:!1}},"loadBuildkiteTrigger"),pe=g(async(e,t)=>{if(e.provider==="github-actions")return await ce(t.GITHUB_EVENT_PATH);if(e.provider==="gitlab-ci")return le(t);if(e.provider==="buildkite")return de(t)},"loadTrigger"),ue=g((e,t)=>{const o=t.BUILDKITE_REPO;if(!o)return;const i=/(?:^|@|\/\/)github\.com[:/]([^/]+)\/([^/]+?)(?:\.git)?\/?$/i.exec(o);if(i&&t.GITHUB_TOKEN)return{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:e.prNumber,provider:"github-actions",repo:`${i[1]}/${i[2]}`,sha:e.sha,token:t.GITHUB_TOKEN};const s=/\/\/([^/]*gitlab[^/]*)\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(o),l=s?null:/@([^/:]*gitlab[^/:]*):([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(o),d=s??l;if(d&&t.GITLAB_TOKEN){const r=d[1];return{apiBaseUrl:t.CI_API_V4_URL??`https://${r}/api/v4`,buildId:void 0,buildNumber:void 0,prNumber:e.prNumber,provider:"gitlab-ci",repo:`${d[2]}/${d[3]}`,sha:e.sha,token:t.GITLAB_TOKEN}}},"deriveBuildkiteCommitContext"),me=g(async e=>{const t=e.fetchImpl??globalThis.fetch,o=`${(e.apiBaseUrl??"https://api.github.com").replace(/\/+$/,"")}/repos/${e.repo}/pulls/${String(e.prNumber)}`;try{const i=await t(o,{headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${e.token}`,"X-GitHub-Api-Version":"2022-11-28"}});return i.ok?(await i.json()).head?.ref:void 0}catch{return}},"fetchGithubHeadRef"),fe=g((e,t,o,i)=>{const s=t.map(l=>`- \`${l}\``).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var pr=Object.defineProperty;var O=(e,t)=>pr(e,"name",{value:t,configurable:!0});import{createRequire as gr}from"node:module";import{B as wr,j as yr,I as V,N as M,q as ge,e as et}from"../packem_shared/index.server-B7ETiT4C.js";import{b as vr,c as Be,f as Me,n as Wt}from"../packem_shared/index-D9ZIw4ra.js";const br=gr(import.meta.url),me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,st=O(e=>{if(typeof me<"u"&&me.versions&&me.versions.node){const[t,i]=me.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return me.getBuiltinModule(e)}return br(e)},"__cjs_getBuiltinModule"),{createRequire:Bi}=st("node:module"),ee=me,{execFileSync:xr}=st("node:child_process"),Ie=st("node:fs"),$r=st("node:tty");var Wr=Object.defineProperty,J=O((e,t)=>Wr(e,"name",{value:t,configurable:!0}),"j$3"),Or=Object.defineProperty,A=J((e,t)=>Or(e,"name",{value:t,configurable:!0}),"$");const Br=Bi(import.meta.url),pe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Lt=A(e=>{if(typeof pe<"u"&&pe.versions&&pe.versions.node){const[t,i]=pe.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return pe.getBuiltinModule(e)}return Br(e)},"__cjs_getBuiltinModule"),te=pe,{execFileSync:Sr}=Lt("node:child_process"),Ce=Lt("node:fs"),Ar=Lt("node:tty");var jr=Object.defineProperty,_t=A((e,t)=>jr(e,"name",{value:t,configurable:!0}),"u$5"),Ir=Object.defineProperty,at=_t((e,t)=>Ir(e,"name",{value:t,configurable:!0}),"l");const Cr=[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],Nr=12288,Er=65510,kr=[12288,12288,65281,65376,65504,65510],Rr=8361,Pr=65518,Mr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Tr=32,Fr=10630,Lr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],_r=4352,Hr=262141,Si=[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];var Gr=Object.defineProperty,Vr=at((e,t)=>Gr(e,"name",{value:t,configurable:!0}),"r$1");const Ee=Vr((e,t)=>{let i=0,r=Math.floor(e.length/2)-1;for(;i<=r;){const s=Math.floor((i+r)/2),o=s*2;if(t<e[o])r=s-1;else if(t>e[o+1])i=s+1;else return!0}return!1},"isInRange");var Jr=Object.defineProperty,ne=at((e,t)=>Jr(e,"name",{value:t,configurable:!0}),"r");const Yt=19968,[zr,qr]=we(Si);function we(e){let t=e[0],i=e[1];for(let r=0;r<e.length;r+=2){const s=e[r],o=e[r+1];if(Yt>=s&&Yt<=o)return[s,o];o-s>i-t&&(t=s,i=o)}return[t,i]}O(we,"nt");J(we,"ge");A(we,"c$2");_t(we,"f");at(we,"k");ne(we,"findWideFastPathRange");const Ai=ne(e=>e<161||e>1114109?!1:Ee(Cr,e),"isAmbiguous"),ji=ne(e=>e<Nr||e>Er?!1:Ee(kr,e),"isFullWidth"),Dr=ne(e=>e<Rr||e>Pr?!1:Ee(Mr,e),"isHalfWidth"),Ur=ne(e=>e<Tr||e>Fr?!1:Ee(Lr,e),"isNarrow"),Ii=ne(e=>e>=zr&&e<=qr?!0:e<_r||e>Hr?!1:Ee(Si,e),"isWide");function ye(e){return Ai(e)?"ambiguous":ji(e)?"fullwidth":Dr(e)?"halfwidth":Ur(e)?"narrow":Ii(e)?"wide":"neutral"}O(ye,"rt");J(ye,"be");A(ye,"g$4");_t(ye,"S");at(ye,"getCategory");ne(ye,"getCategory");var Yr=Object.defineProperty,lt=A((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"i$4"),Kr=Object.defineProperty,ct=lt((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"a"),Zr=Object.defineProperty,Ht=ct((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"e");function oe(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}O(oe,"U$2");J(oe,"ee");A(oe,"s$1");lt(oe,"s");ct(oe,"r");Ht(oe,"validate");function se(e){return oe(e),ye(e)}O(se,"Z$2");J(se,"te");A(se,"r$3");lt(se,"p");ct(se,"eastAsianWidthType");Ht(se,"eastAsianWidthType");function ke(e,{ambiguousAsWide:t=!1}={}){return oe(e),ji(e)||Ii(e)||t&&Ai(e)?2:1}O(ke,"yt$1");J(ke,"je");A(ke,"o$2");lt(ke,"W");ct(ke,"eastAsianWidth");Ht(ke,"eastAsianWidth");var Xr=Object.defineProperty,Qr=A((e,t)=>Xr(e,"name",{value:t,configurable:!0}),"p$3"),en=Object.defineProperty,Ci=Qr((e,t)=>en(e,"name",{value:t,configurable:!0}),"e"),tn=Object.defineProperty,rn=Ci((e,t)=>tn(e,"name",{value:t,configurable:!0}),"E");const Ni=String.raw,Kt=Ni`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,nn=rn(()=>new RegExp(Ni`\p{RI}{2}|(?)${Kt}(?:\u200D${Kt})*`,"gu"),"default");var on=Object.defineProperty,sn=Ci((e,t)=>on(e,"name",{value:t,configurable:!0}),"p");const ve=new Set(["\x1B",""]),ht="\x07",Ei="[",Gt="m",tt="]8;;",an=39,ln=/[\u200B\uFEFF\u2060-\u2064]/g,cn=new RegExp(`(?:\\${Ei}(?<code>\\d+)m|\\${tt}(?<uri>.*)${ht})`),hn=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),Q=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Zt=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,Xt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,Te=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,qe=nn();sn(e=>e.replace(qe,""),"stripEmoji");var un=Object.defineProperty,dn=A((e,t)=>un(e,"name",{value:t,configurable:!0}),"E$1"),fn=Object.defineProperty,mn=dn((e,t)=>fn(e,"name",{value:t,configurable:!0}),"A"),pn=Object.defineProperty,ut=mn((e,t)=>pn(e,"name",{value:t,configurable:!0}),"d");const Qt=new Map,Fe=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,De=ut(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","getCharType"),gn=ut((e,t)=>{const i=Math.floor(e/65536),r=e%65536;let s=Qt.get(i);if(s||(s=new Map,Qt.set(i,s)),s.has(r))return s.get(r);let o;if(De(e)==="latin")o=t.width.regular;else if(De(e)==="control")o=t.width.control;else if(De(e)==="wide")o=t.width.wide;else switch(se(e)){case"ambiguous":{o=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{o=t.width.fullWidth;break}case"wide":{o=t.width.wide;break}default:o=t.width.regular}return s.set(r,o),o},"getCachedCharWidth"),bn=ut(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,"isCombiningCharacter"),be=ut((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const i={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?be(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},r=Math.max(0,i.truncation.limit-i.truncation.ellipsisWidth),{length:s}=e,o=s>1e4;let n=0,a=0,l=s,h=!1;const c=e.includes("\x1B")||e.includes("");for(;n<s;){if(c&&(e[n]==="\x1B"||e[n]==="")){if(e.startsWith("\x1B]8;;",n)){const m="\x1B]8;;\x07",d=m.length,x=e.indexOf("\x07",n+5);if(x!==-1){const w=e.indexOf(m,x+1);if(w!==-1){const v=w+d,$=e.slice(x+1,w).replace(Q,""),W=be($,{ambiguousIsNarrow:i.width.ambiguousIsNarrow,ansiWidth:i.width.ansi,controlWidth:i.width.control,countAnsiEscapeCodes:!1,ellipsis:i.truncation.ellipsis,ellipsisWidth:i.truncation.ellipsisWidth,emojiWidth:i.width.emoji,fullWidth:i.width.fullWidth,halfWidth:i.width.halfWidth,limit:Math.max(0,r-a),regularWidth:i.width.regular,tabWidth:i.width.tab,wideWidth:i.width.wide}),B=W.width;if(W.truncated)h=!0,l=Math.min(l,n);else if(a+B>r&&(l=Math.min(l,n),h=!0,a+B>i.truncation.limit))break;if(a+=B,n=v,h&&a>=i.truncation.limit)break;continue}}}if(Q.lastIndex=n,Q.test(e)){const m=Q.lastIndex-n,d=i.truncation.countAnsiEscapeCodes?m:i.width.ansi;if(a+d>r&&(l=Math.min(l,n),a+d>i.truncation.limit)){h=!0;break}a+=d,n=Q.lastIndex;continue}}const b=e.codePointAt(n);if(b===8203||b===65279||b>=8288&&b<=8292){n+=1;continue}if(b===9){if(a+i.width.tab>r&&(l=Math.min(l,n),a+i.width.tab>i.truncation.limit)){h=!0;break}a+=i.width.tab,n+=1;continue}if(Fe.lastIndex=n,Fe.test(e)){const m=(Fe.lastIndex-n)*i.width.regular;if(a+m>r){const d=Math.floor((r-a)/i.width.regular);if(l=Math.min(l,n+d),a+m>i.truncation.limit){h=!0;break}}a+=m,n=Fe.lastIndex;continue}if((b<=31||b>=127&&b<=159)&&(Te.lastIndex=n,Te.test(e))){const m=(Te.lastIndex-n)*i.width.control;if(a+m>r&&(l=Math.min(l,n+Math.floor((r-a)/i.width.control)),a+m>i.truncation.limit)){h=!0;break}a+=m,n=Te.lastIndex;continue}if(qe.lastIndex=n,qe.test(e)){if(a+i.width.emoji>r&&(l=Math.min(l,n),a+i.width.emoji>i.truncation.limit)){h=!0;break}a+=i.width.emoji,n=qe.lastIndex;continue}const f=e.codePointAt(n)??0;if(bn(f)){n+=f>65535?2:1;continue}let p;if(o)p=gn(f,i);else switch(De(f)){case"control":{p=i.width.control;break}case"latin":{p=i.width.regular;break}case"wide":{p=i.width.wide;break}case"zero":{p=0;break}default:switch(se(f)){case"ambiguous":{p=i.width.ambiguousIsNarrow?i.width.regular:i.width.wide;break}case"fullwidth":{p=i.width.fullWidth;break}case"wide":{p=i.width.wide;break}default:p=i.width.regular}}if(a+p>r&&(l=Math.min(l,n),a+p>i.truncation.limit)){h=!0;break}a+=p,n+=f>65535?2:1}let u=a,g=!1;return h&&i.truncation.limit>=i.truncation.ellipsisWidth&&(u=i.truncation.limit,g=!0),{ellipsed:g,index:h?l:s,truncated:h,width:u}},"getStringTruncatedWidth");var wn=Object.defineProperty,yn=A((e,t)=>wn(e,"name",{value:t,configurable:!0}),"i$2"),vn=Object.defineProperty,xn=yn((e,t)=>vn(e,"name",{value:t,configurable:!0}),"e"),$n=Object.defineProperty,Wn=xn((e,t)=>$n(e,"name",{value:t,configurable:!0}),"r");const E=Wn((e,t={})=>be(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var On=Object.defineProperty,ki=A((e,t)=>On(e,"name",{value:t,configurable:!0}),"i$1"),Bn=Object.defineProperty,Ri=ki((e,t)=>Bn(e,"name",{value:t,configurable:!0}),"r"),Sn=Object.defineProperty,An=Ri((e,t)=>Sn(e,"name",{value:t,configurable:!0}),"c");let jn=class{static{O(this,"ki")}static{J(this,"Si")}static{A(this,"l")}static{ki(this,"y")}static{Ri(this,"s")}static{An(this,"LRUCache")}capacity;cache;keyOrder;constructor(e){this.capacity=e,this.cache=new Map,this.keyOrder=[]}get(e){if(this.cache.has(e))return this.keyOrder=this.keyOrder.filter(t=>t!==e),this.keyOrder.push(e),this.cache.get(e)}has(e){return this.cache.has(e)}set(e,t){if(this.cache.has(e))this.keyOrder=this.keyOrder.filter(i=>i!==e);else if(this.cache.size>=this.capacity){const i=this.keyOrder.shift();i!==void 0&&this.cache.delete(i)}this.cache.set(e,t),this.keyOrder.push(e)}delete(e){this.cache.delete(e),this.keyOrder=this.keyOrder.filter(t=>t!==e)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var In=Object.defineProperty,Cn=A((e,t)=>In(e,"name",{value:t,configurable:!0}),"S$1"),Nn=Object.defineProperty,En=Cn((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"w"),kn=Object.defineProperty,xe=En((e,t)=>kn(e,"name",{value:t,configurable:!0}),"y");const ei=new jn(100),Rn=new Intl.Segmenter("en",{granularity:"grapheme"}),Pn=/^[\u0000-\u007F]*$/,Mn=new Set(["0","22","23","24","27","28","29","39","49"]),Tn=new Set(["1","3","4","7","8","9"]),ti=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),Le=xe(e=>e>="30"&&e<="37"||e>="90"&&e<="97"||e.startsWith("38;"),"isForegroundColor"),_e=xe(e=>e>="40"&&e<="47"||e>="100"&&e<="107"||e.startsWith("48;"),"isBackgroundColor"),Fn=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],ii=xe((e,t)=>{let i=-1;for(const r of t){const s=e.indexOf(r);s!==-1&&(i===-1||s<i)&&(i=s)}return i},"findFirstPositionOfAny"),Ln=xe((e,t)=>{if(!e.includes("\x1B"))return[{after:"",before:"",content:e,visibleLength:E(e,t.width)}];const i=ei.get(e);if(i)return i;const r=[],s=[];let o=0,n;for(Q.lastIndex=0;(n=Q.exec(e))!==null;){const c=n[0];r.push(e.slice(o,n.index)),s.push(c),o=n.index+c.length}o<e.length&&r.push(e.slice(o));const a=[];for(const c of s){if(c==="\x1B[0m"||c==="\x1B]8;;\x07"){a.push(c);continue}if(c.startsWith("\x1B[")&&c.endsWith("m")){const u=c.slice(2,-1);if(Mn.has(u)){a.push(c);continue}}}const l=new Set,h=[];for(const[c,u]of r.entries()){if(c>0&&s[c-1]){const f=s[c-1];if(f==="\x1B[0m")l.clear();else if(f==="\x1B]8;;\x07"){for(const p of l)if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){l.delete(p);break}}else if(f.startsWith("\x1B[")&&f.endsWith("m")){const p=f.slice(2,-1);if(p==="39"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(Le(d)){l.delete(m);break}}}else if(p==="49"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(_e(d)){l.delete(m);break}}}else if(ti.has(p)){const m=ti.get(p);for(const d of l)if(d===`\x1B[${m}m`){l.delete(d);break}}else{if(Le(p)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(Le(d)){l.delete(m);break}}}else if(_e(p)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(_e(d)){l.delete(m);break}}}else if(Tn.has(p)){const m=`\x1B[${p}m`;l.has(m)&&l.delete(m)}l.add(f)}}else if(f.startsWith("\x1B]8;;")&&!f.endsWith("\x1B]8;;\x07")){for(const p of l)if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){l.delete(p);break}l.add(f)}}if(u==="")continue;let g="";if(l.size>0)if(a.includes("\x1B[0m"))g="\x1B[0m";else{const f=[];let p=!1;for(const w of l)if(w.startsWith("\x1B]8;;")&&!w.endsWith("\x1B]8;;\x07")){p=!0;break}p&&a.includes("\x1B]8;;\x07")&&f.push("\x1B]8;;\x07");let m=!1,d=!1;for(const w of l)if(w.startsWith("\x1B[")&&w.endsWith("m")){const v=w.slice(2,-1);Le(v)?m=!0:_e(v)&&(d=!0)}if(m&&d){const w=ii(e,["\x1B[3","\x1B[9","\x1B[38;"]),v=ii(e,["\x1B[4","\x1B[10","\x1B[48;"]);w>=0&&v>=0?w>v?f.push("\x1B[39m","\x1B[49m"):f.push("\x1B[49m","\x1B[39m"):f.push("\x1B[39m","\x1B[49m")}else m&&f.push("\x1B[39m"),d&&f.push("\x1B[49m");m&&d&&e.includes("\x1B[39m")&&e.includes("\x1B[49m")&&(e.indexOf("\x1B[39m")<e.indexOf("\x1B[49m")?(f.length-=2,f.push("\x1B[39m","\x1B[49m")):e.indexOf("\x1B[49m")<e.indexOf("\x1B[39m")&&(f.length-=2,f.push("\x1B[49m","\x1B[39m")));const x=Fn.filter(w=>l.has(w.open)).map(w=>({position:e.indexOf(w.open),style:w})).filter(w=>w.position>=0).toSorted((w,v)=>v.position-w.position);for(const w of x){const v=w;a.includes(v.style.close)&&f.push(v.style.close)}g=f.join("")}const b=[...l].join("");h.push({after:g,before:b,content:u,visibleLength:E(u,{fullWidth:1,wideWidth:1})})}return ei.set(e,h),h},"processIntoStyledSegments"),_n=xe((e,t,i,r)=>{const s=[...r.segmenter.segment(e)],o=[];let n=0,a=!1;for(const l of s){const h=E(l.segment,r.width),c=n,u=n+h;if(!a)if(c<t){n=u;continue}else a=!0;if(c>=i||u>i)break;o.push(l.segment),n=u}return o.join("")},"fastSlice"),D=xe((e,t=0,i=Number.MAX_SAFE_INTEGER,r={})=>{const s={segmenter:Rn,...r};if(t>=i||e==="")return"";const o=E(e,s.width);if(t===0&&i>=o)return e;if(t<0||i<0)throw new RangeError("Negative indices aren't supported");if(!e.includes("\x1B"))return Pn.test(e)?e.slice(t,i):_n(e,t,i,s);if(Zt.lastIndex=0,Xt.lastIndex=0,!Zt.test(e)&&!Xt.test(e))return e;const n=Ln(e,s);if(n.length===0)return"";let a=0;const l=[];for(const[u,g]of n.entries()){const b=a,f=a+g.visibleLength;if(f>t&&b<i){const p=Math.max(0,t-b),m=Math.min(g.visibleLength,i-b);l.push({end:m,index:u,segment:g,start:p})}a=f}if(l.length===0)return"";const h=[],c=l[0].segment;h.push(c.before);for(let u=0;u<l.length;u++){const{end:g,segment:b,start:f}=l[u];if(f===0&&g===b.visibleLength)h.push(b.content);else{const p=[...s.segmenter.segment(b.content)];h.push(p.slice(f,g).map(m=>m.segment).join(""))}if(u<l.length-1){const p=l[u+1].segment,m=b.after,d=p.before;m!==d&&(m||d)&&h.push(m,d)}}return h.push(l.at(-1).segment.after),h.join("")},"slice");var Hn=Object.defineProperty,Gn=A((e,t)=>Hn(e,"name",{value:t,configurable:!0}),"x"),Vn=Object.defineProperty,Jn=Gn((e,t)=>Vn(e,"name",{value:t,configurable:!0}),"T"),zn=Object.defineProperty,dt=Jn((e,t)=>zn(e,"name",{value:t,configurable:!0}),"f");const ri="…",qn=3,He=dt((e,t,i=!1)=>{if(e.charAt(t)===" ")return t;const r=i?1:-1,s=Math.min(qn,i?e.length-t:t);for(let o=1;o<=s;o++){const n=t+o*r;if(e.charAt(n)===" ")return n}return t},"findNearestSpace"),Ge=dt((e,t,i)=>be(e,{...i,ellipsis:"",ellipsisWidth:0,limit:t}).index,"widthToIndex"),Ve=dt((e,t,i)=>E(e.slice(0,t),i),"indexToWidth"),ni=dt((e,t,i={})=>{if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof t}`);if(e===""||t<=0)return"";const r=e.normalize("NFC"),{ellipsis:s=ri,position:o="end",preferTruncationOnSpace:n=!1}=i;let a=i.ellipsisWidth??s===ri?1:void 0;a??=be(s,{...i.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:l}=be(r,{...i.width,ellipsis:s,ellipsisWidth:a});if(l<=t)return r;switch(o){case"end":{if(n){const h=t-a,c=Ge(r,h,i.width),u=He(r,c),g=Ve(r,u,i.width);return D(r,0,g,{width:i.width})+s}return D(r,0,t-a,{width:i.width})+s}case"middle":{const h=Math.floor(t/2),c=Math.max(0,t-a),u=Math.min(h,c),g=Math.max(0,c-u);if(n){const b=Ge(r,u,i.width),f=He(r,b),p=Ve(r,f,i.width),m=l-g,d=Ge(r,m,i.width),x=He(r,d,!0),w=Ve(r,x,i.width);return D(r,0,p,{width:i.width})+s+D(r,w,l,{width:i.width}).trim()}return D(r,0,u,{width:i.width})+s+D(r,l-g,l,{width:i.width})}case"start":{if(n){const h=l-t+a,c=Ge(r,h,i.width),u=He(r,c,!0),g=Ve(r,u,i.width);return s+D(r,g,l,{width:i.width}).trim()}return s+D(r,l-t+a,l,{width:i.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${o}'`)}},"truncate");var Dn=Object.defineProperty,Pi=A((e,t)=>Dn(e,"name",{value:t,configurable:!0}),"b$2"),Un=Object.defineProperty,ae=Pi((e,t)=>Un(e,"name",{value:t,configurable:!0}),"d"),Yn=Object.defineProperty,Kn=ae((e,t)=>Yn(e,"name",{value:t,configurable:!0}),"a");const Zn=/\x1B\[(\d+)m/;class Mi{static{O(this,"he")}static{J(this,"at")}static{A(this,"T")}static{Pi(this,"T")}static{ae(this,"d")}static{Kn(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const i=Zn.exec(t);if(!i)return;const r=Number.parseInt(i[1],10);switch(r){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(r>=30&&r<=37||r>=90&&r<=97)this.activeForeground=t;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(r)){const s={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];s&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(s)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const i={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(r=>{const s=i[r];s&&t.push(s)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}var Xn=Object.defineProperty,Ti=ae((e,t)=>Xn(e,"name",{value:t,configurable:!0}),"o");const Fi=Ti((e,t)=>{if(!ve.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const i=!0,r=e.slice(t+1,t+1+tt.length).join("")===tt;return{isInsideEscape:i,isInsideLinkEscape:r}},"checkEscapeSequence"),Qn=Ti((e,t={})=>{const i=new Mi;let r="",s=!1,o="",n="",a=!1;const l=[...e];for(let h=0;h<l.length;h++){const c=l[h];if(c&&ve.has(c)){if(r){const p=t.getWidth?.(r)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:r,width:p};if(a&&(m.isHyperlink=!0,m.hyperlinkUrl=n),t.onSegment?.(m,i)===!1)return;r=""}s=!0,o=c;const b=Fi(l,h),{isInsideLinkEscape:f}=b;if(f){let p=h+1;for(n="";p<l.length;){const d=l[p];if(d===ht)break;n+=d,p+=1}n=n.slice(4);const m={hyperlinkUrl:n,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,i)===!1)return;h=p,a=!0,s=!1,o="";continue}if(h+1<l.length&&l[h+1]==="\\"&&a){const p={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(p,i)===!1)return;a=!1,n="",h+=1,s=!1,o="";continue}}if(s){if(o!==c&&(o+=c),c===Gt){s=!1,i.processEscape(o);const b={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(t.onSegment?.(b,i)===!1)return;o=""}continue}r+=c;const u=t.getWidth?.(r)??0,g={isEscapeSequence:!1,isGrapheme:!0,text:r,width:u};if(a&&(g.isHyperlink=!0,g.hyperlinkUrl=n),t.onSegment?.(g,i)===!1)return;r=""}if(r){const h=t.getWidth?.(r)??0,c={isEscapeSequence:!1,isGrapheme:!0,text:r,width:h};a&&(c.isHyperlink=!0,c.hyperlinkUrl=n),t.onSegment?.(c,i)}if(o){const h={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};t.onSegment?.(h,i)}},"processAnsiString");var eo=Object.defineProperty,to=ae((e,t)=>eo(e,"name",{value:t,configurable:!0}),"t$1");const oi=to(e=>`${ve.values().next().value}${Ei}${String(e)}${Gt}`,"wrapAnsiCode");var io=Object.defineProperty,ro=ae((e,t)=>io(e,"name",{value:t,configurable:!0}),"s");const si=ro(e=>`${ve.values().next().value}${tt}${e}${ht}`,"wrapAnsiHyperlink");var no=Object.defineProperty,oo=ae((e,t)=>no(e,"name",{value:t,configurable:!0}),"l");const so=oo(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",i,r;const s=e.join(`
|
|
1
|
+
var pr=Object.defineProperty;var O=(e,t)=>pr(e,"name",{value:t,configurable:!0});import{createRequire as gr}from"node:module";import{B as wr,j as yr,I as V,N as M,q as ge,e as et}from"../packem_shared/index.server-B7ETiT4C.js";import{b as vr,c as Be,f as Me,n as Wt}from"../packem_shared/index-CS6a2wFB.js";const br=gr(import.meta.url),me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,st=O(e=>{if(typeof me<"u"&&me.versions&&me.versions.node){const[t,i]=me.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return me.getBuiltinModule(e)}return br(e)},"__cjs_getBuiltinModule"),{createRequire:Bi}=st("node:module"),ee=me,{execFileSync:xr}=st("node:child_process"),Ie=st("node:fs"),$r=st("node:tty");var Wr=Object.defineProperty,J=O((e,t)=>Wr(e,"name",{value:t,configurable:!0}),"j$3"),Or=Object.defineProperty,A=J((e,t)=>Or(e,"name",{value:t,configurable:!0}),"$");const Br=Bi(import.meta.url),pe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Lt=A(e=>{if(typeof pe<"u"&&pe.versions&&pe.versions.node){const[t,i]=pe.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return pe.getBuiltinModule(e)}return Br(e)},"__cjs_getBuiltinModule"),te=pe,{execFileSync:Sr}=Lt("node:child_process"),Ce=Lt("node:fs"),Ar=Lt("node:tty");var jr=Object.defineProperty,_t=A((e,t)=>jr(e,"name",{value:t,configurable:!0}),"u$5"),Ir=Object.defineProperty,at=_t((e,t)=>Ir(e,"name",{value:t,configurable:!0}),"l");const Cr=[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],Nr=12288,Er=65510,kr=[12288,12288,65281,65376,65504,65510],Rr=8361,Pr=65518,Mr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Tr=32,Fr=10630,Lr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],_r=4352,Hr=262141,Si=[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];var Gr=Object.defineProperty,Vr=at((e,t)=>Gr(e,"name",{value:t,configurable:!0}),"r$1");const Ee=Vr((e,t)=>{let i=0,r=Math.floor(e.length/2)-1;for(;i<=r;){const s=Math.floor((i+r)/2),o=s*2;if(t<e[o])r=s-1;else if(t>e[o+1])i=s+1;else return!0}return!1},"isInRange");var Jr=Object.defineProperty,ne=at((e,t)=>Jr(e,"name",{value:t,configurable:!0}),"r");const Yt=19968,[zr,qr]=we(Si);function we(e){let t=e[0],i=e[1];for(let r=0;r<e.length;r+=2){const s=e[r],o=e[r+1];if(Yt>=s&&Yt<=o)return[s,o];o-s>i-t&&(t=s,i=o)}return[t,i]}O(we,"nt");J(we,"ge");A(we,"c$2");_t(we,"f");at(we,"k");ne(we,"findWideFastPathRange");const Ai=ne(e=>e<161||e>1114109?!1:Ee(Cr,e),"isAmbiguous"),ji=ne(e=>e<Nr||e>Er?!1:Ee(kr,e),"isFullWidth"),Dr=ne(e=>e<Rr||e>Pr?!1:Ee(Mr,e),"isHalfWidth"),Ur=ne(e=>e<Tr||e>Fr?!1:Ee(Lr,e),"isNarrow"),Ii=ne(e=>e>=zr&&e<=qr?!0:e<_r||e>Hr?!1:Ee(Si,e),"isWide");function ye(e){return Ai(e)?"ambiguous":ji(e)?"fullwidth":Dr(e)?"halfwidth":Ur(e)?"narrow":Ii(e)?"wide":"neutral"}O(ye,"rt");J(ye,"be");A(ye,"g$4");_t(ye,"S");at(ye,"getCategory");ne(ye,"getCategory");var Yr=Object.defineProperty,lt=A((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"i$4"),Kr=Object.defineProperty,ct=lt((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"a"),Zr=Object.defineProperty,Ht=ct((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"e");function oe(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}O(oe,"U$2");J(oe,"ee");A(oe,"s$1");lt(oe,"s");ct(oe,"r");Ht(oe,"validate");function se(e){return oe(e),ye(e)}O(se,"Z$2");J(se,"te");A(se,"r$3");lt(se,"p");ct(se,"eastAsianWidthType");Ht(se,"eastAsianWidthType");function ke(e,{ambiguousAsWide:t=!1}={}){return oe(e),ji(e)||Ii(e)||t&&Ai(e)?2:1}O(ke,"yt$1");J(ke,"je");A(ke,"o$2");lt(ke,"W");ct(ke,"eastAsianWidth");Ht(ke,"eastAsianWidth");var Xr=Object.defineProperty,Qr=A((e,t)=>Xr(e,"name",{value:t,configurable:!0}),"p$3"),en=Object.defineProperty,Ci=Qr((e,t)=>en(e,"name",{value:t,configurable:!0}),"e"),tn=Object.defineProperty,rn=Ci((e,t)=>tn(e,"name",{value:t,configurable:!0}),"E");const Ni=String.raw,Kt=Ni`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,nn=rn(()=>new RegExp(Ni`\p{RI}{2}|(?)${Kt}(?:\u200D${Kt})*`,"gu"),"default");var on=Object.defineProperty,sn=Ci((e,t)=>on(e,"name",{value:t,configurable:!0}),"p");const ve=new Set(["\x1B",""]),ht="\x07",Ei="[",Gt="m",tt="]8;;",an=39,ln=/[\u200B\uFEFF\u2060-\u2064]/g,cn=new RegExp(`(?:\\${Ei}(?<code>\\d+)m|\\${tt}(?<uri>.*)${ht})`),hn=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),Q=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Zt=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,Xt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,Te=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,qe=nn();sn(e=>e.replace(qe,""),"stripEmoji");var un=Object.defineProperty,dn=A((e,t)=>un(e,"name",{value:t,configurable:!0}),"E$1"),fn=Object.defineProperty,mn=dn((e,t)=>fn(e,"name",{value:t,configurable:!0}),"A"),pn=Object.defineProperty,ut=mn((e,t)=>pn(e,"name",{value:t,configurable:!0}),"d");const Qt=new Map,Fe=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,De=ut(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","getCharType"),gn=ut((e,t)=>{const i=Math.floor(e/65536),r=e%65536;let s=Qt.get(i);if(s||(s=new Map,Qt.set(i,s)),s.has(r))return s.get(r);let o;if(De(e)==="latin")o=t.width.regular;else if(De(e)==="control")o=t.width.control;else if(De(e)==="wide")o=t.width.wide;else switch(se(e)){case"ambiguous":{o=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{o=t.width.fullWidth;break}case"wide":{o=t.width.wide;break}default:o=t.width.regular}return s.set(r,o),o},"getCachedCharWidth"),bn=ut(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,"isCombiningCharacter"),be=ut((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const i={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?be(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},r=Math.max(0,i.truncation.limit-i.truncation.ellipsisWidth),{length:s}=e,o=s>1e4;let n=0,a=0,l=s,h=!1;const c=e.includes("\x1B")||e.includes("");for(;n<s;){if(c&&(e[n]==="\x1B"||e[n]==="")){if(e.startsWith("\x1B]8;;",n)){const m="\x1B]8;;\x07",d=m.length,x=e.indexOf("\x07",n+5);if(x!==-1){const w=e.indexOf(m,x+1);if(w!==-1){const v=w+d,$=e.slice(x+1,w).replace(Q,""),W=be($,{ambiguousIsNarrow:i.width.ambiguousIsNarrow,ansiWidth:i.width.ansi,controlWidth:i.width.control,countAnsiEscapeCodes:!1,ellipsis:i.truncation.ellipsis,ellipsisWidth:i.truncation.ellipsisWidth,emojiWidth:i.width.emoji,fullWidth:i.width.fullWidth,halfWidth:i.width.halfWidth,limit:Math.max(0,r-a),regularWidth:i.width.regular,tabWidth:i.width.tab,wideWidth:i.width.wide}),B=W.width;if(W.truncated)h=!0,l=Math.min(l,n);else if(a+B>r&&(l=Math.min(l,n),h=!0,a+B>i.truncation.limit))break;if(a+=B,n=v,h&&a>=i.truncation.limit)break;continue}}}if(Q.lastIndex=n,Q.test(e)){const m=Q.lastIndex-n,d=i.truncation.countAnsiEscapeCodes?m:i.width.ansi;if(a+d>r&&(l=Math.min(l,n),a+d>i.truncation.limit)){h=!0;break}a+=d,n=Q.lastIndex;continue}}const b=e.codePointAt(n);if(b===8203||b===65279||b>=8288&&b<=8292){n+=1;continue}if(b===9){if(a+i.width.tab>r&&(l=Math.min(l,n),a+i.width.tab>i.truncation.limit)){h=!0;break}a+=i.width.tab,n+=1;continue}if(Fe.lastIndex=n,Fe.test(e)){const m=(Fe.lastIndex-n)*i.width.regular;if(a+m>r){const d=Math.floor((r-a)/i.width.regular);if(l=Math.min(l,n+d),a+m>i.truncation.limit){h=!0;break}}a+=m,n=Fe.lastIndex;continue}if((b<=31||b>=127&&b<=159)&&(Te.lastIndex=n,Te.test(e))){const m=(Te.lastIndex-n)*i.width.control;if(a+m>r&&(l=Math.min(l,n+Math.floor((r-a)/i.width.control)),a+m>i.truncation.limit)){h=!0;break}a+=m,n=Te.lastIndex;continue}if(qe.lastIndex=n,qe.test(e)){if(a+i.width.emoji>r&&(l=Math.min(l,n),a+i.width.emoji>i.truncation.limit)){h=!0;break}a+=i.width.emoji,n=qe.lastIndex;continue}const f=e.codePointAt(n)??0;if(bn(f)){n+=f>65535?2:1;continue}let p;if(o)p=gn(f,i);else switch(De(f)){case"control":{p=i.width.control;break}case"latin":{p=i.width.regular;break}case"wide":{p=i.width.wide;break}case"zero":{p=0;break}default:switch(se(f)){case"ambiguous":{p=i.width.ambiguousIsNarrow?i.width.regular:i.width.wide;break}case"fullwidth":{p=i.width.fullWidth;break}case"wide":{p=i.width.wide;break}default:p=i.width.regular}}if(a+p>r&&(l=Math.min(l,n),a+p>i.truncation.limit)){h=!0;break}a+=p,n+=f>65535?2:1}let u=a,g=!1;return h&&i.truncation.limit>=i.truncation.ellipsisWidth&&(u=i.truncation.limit,g=!0),{ellipsed:g,index:h?l:s,truncated:h,width:u}},"getStringTruncatedWidth");var wn=Object.defineProperty,yn=A((e,t)=>wn(e,"name",{value:t,configurable:!0}),"i$2"),vn=Object.defineProperty,xn=yn((e,t)=>vn(e,"name",{value:t,configurable:!0}),"e"),$n=Object.defineProperty,Wn=xn((e,t)=>$n(e,"name",{value:t,configurable:!0}),"r");const E=Wn((e,t={})=>be(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var On=Object.defineProperty,ki=A((e,t)=>On(e,"name",{value:t,configurable:!0}),"i$1"),Bn=Object.defineProperty,Ri=ki((e,t)=>Bn(e,"name",{value:t,configurable:!0}),"r"),Sn=Object.defineProperty,An=Ri((e,t)=>Sn(e,"name",{value:t,configurable:!0}),"c");let jn=class{static{O(this,"ki")}static{J(this,"Si")}static{A(this,"l")}static{ki(this,"y")}static{Ri(this,"s")}static{An(this,"LRUCache")}capacity;cache;keyOrder;constructor(e){this.capacity=e,this.cache=new Map,this.keyOrder=[]}get(e){if(this.cache.has(e))return this.keyOrder=this.keyOrder.filter(t=>t!==e),this.keyOrder.push(e),this.cache.get(e)}has(e){return this.cache.has(e)}set(e,t){if(this.cache.has(e))this.keyOrder=this.keyOrder.filter(i=>i!==e);else if(this.cache.size>=this.capacity){const i=this.keyOrder.shift();i!==void 0&&this.cache.delete(i)}this.cache.set(e,t),this.keyOrder.push(e)}delete(e){this.cache.delete(e),this.keyOrder=this.keyOrder.filter(t=>t!==e)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var In=Object.defineProperty,Cn=A((e,t)=>In(e,"name",{value:t,configurable:!0}),"S$1"),Nn=Object.defineProperty,En=Cn((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"w"),kn=Object.defineProperty,xe=En((e,t)=>kn(e,"name",{value:t,configurable:!0}),"y");const ei=new jn(100),Rn=new Intl.Segmenter("en",{granularity:"grapheme"}),Pn=/^[\u0000-\u007F]*$/,Mn=new Set(["0","22","23","24","27","28","29","39","49"]),Tn=new Set(["1","3","4","7","8","9"]),ti=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),Le=xe(e=>e>="30"&&e<="37"||e>="90"&&e<="97"||e.startsWith("38;"),"isForegroundColor"),_e=xe(e=>e>="40"&&e<="47"||e>="100"&&e<="107"||e.startsWith("48;"),"isBackgroundColor"),Fn=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],ii=xe((e,t)=>{let i=-1;for(const r of t){const s=e.indexOf(r);s!==-1&&(i===-1||s<i)&&(i=s)}return i},"findFirstPositionOfAny"),Ln=xe((e,t)=>{if(!e.includes("\x1B"))return[{after:"",before:"",content:e,visibleLength:E(e,t.width)}];const i=ei.get(e);if(i)return i;const r=[],s=[];let o=0,n;for(Q.lastIndex=0;(n=Q.exec(e))!==null;){const c=n[0];r.push(e.slice(o,n.index)),s.push(c),o=n.index+c.length}o<e.length&&r.push(e.slice(o));const a=[];for(const c of s){if(c==="\x1B[0m"||c==="\x1B]8;;\x07"){a.push(c);continue}if(c.startsWith("\x1B[")&&c.endsWith("m")){const u=c.slice(2,-1);if(Mn.has(u)){a.push(c);continue}}}const l=new Set,h=[];for(const[c,u]of r.entries()){if(c>0&&s[c-1]){const f=s[c-1];if(f==="\x1B[0m")l.clear();else if(f==="\x1B]8;;\x07"){for(const p of l)if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){l.delete(p);break}}else if(f.startsWith("\x1B[")&&f.endsWith("m")){const p=f.slice(2,-1);if(p==="39"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(Le(d)){l.delete(m);break}}}else if(p==="49"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(_e(d)){l.delete(m);break}}}else if(ti.has(p)){const m=ti.get(p);for(const d of l)if(d===`\x1B[${m}m`){l.delete(d);break}}else{if(Le(p)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(Le(d)){l.delete(m);break}}}else if(_e(p)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(_e(d)){l.delete(m);break}}}else if(Tn.has(p)){const m=`\x1B[${p}m`;l.has(m)&&l.delete(m)}l.add(f)}}else if(f.startsWith("\x1B]8;;")&&!f.endsWith("\x1B]8;;\x07")){for(const p of l)if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){l.delete(p);break}l.add(f)}}if(u==="")continue;let g="";if(l.size>0)if(a.includes("\x1B[0m"))g="\x1B[0m";else{const f=[];let p=!1;for(const w of l)if(w.startsWith("\x1B]8;;")&&!w.endsWith("\x1B]8;;\x07")){p=!0;break}p&&a.includes("\x1B]8;;\x07")&&f.push("\x1B]8;;\x07");let m=!1,d=!1;for(const w of l)if(w.startsWith("\x1B[")&&w.endsWith("m")){const v=w.slice(2,-1);Le(v)?m=!0:_e(v)&&(d=!0)}if(m&&d){const w=ii(e,["\x1B[3","\x1B[9","\x1B[38;"]),v=ii(e,["\x1B[4","\x1B[10","\x1B[48;"]);w>=0&&v>=0?w>v?f.push("\x1B[39m","\x1B[49m"):f.push("\x1B[49m","\x1B[39m"):f.push("\x1B[39m","\x1B[49m")}else m&&f.push("\x1B[39m"),d&&f.push("\x1B[49m");m&&d&&e.includes("\x1B[39m")&&e.includes("\x1B[49m")&&(e.indexOf("\x1B[39m")<e.indexOf("\x1B[49m")?(f.length-=2,f.push("\x1B[39m","\x1B[49m")):e.indexOf("\x1B[49m")<e.indexOf("\x1B[39m")&&(f.length-=2,f.push("\x1B[49m","\x1B[39m")));const x=Fn.filter(w=>l.has(w.open)).map(w=>({position:e.indexOf(w.open),style:w})).filter(w=>w.position>=0).toSorted((w,v)=>v.position-w.position);for(const w of x){const v=w;a.includes(v.style.close)&&f.push(v.style.close)}g=f.join("")}const b=[...l].join("");h.push({after:g,before:b,content:u,visibleLength:E(u,{fullWidth:1,wideWidth:1})})}return ei.set(e,h),h},"processIntoStyledSegments"),_n=xe((e,t,i,r)=>{const s=[...r.segmenter.segment(e)],o=[];let n=0,a=!1;for(const l of s){const h=E(l.segment,r.width),c=n,u=n+h;if(!a)if(c<t){n=u;continue}else a=!0;if(c>=i||u>i)break;o.push(l.segment),n=u}return o.join("")},"fastSlice"),D=xe((e,t=0,i=Number.MAX_SAFE_INTEGER,r={})=>{const s={segmenter:Rn,...r};if(t>=i||e==="")return"";const o=E(e,s.width);if(t===0&&i>=o)return e;if(t<0||i<0)throw new RangeError("Negative indices aren't supported");if(!e.includes("\x1B"))return Pn.test(e)?e.slice(t,i):_n(e,t,i,s);if(Zt.lastIndex=0,Xt.lastIndex=0,!Zt.test(e)&&!Xt.test(e))return e;const n=Ln(e,s);if(n.length===0)return"";let a=0;const l=[];for(const[u,g]of n.entries()){const b=a,f=a+g.visibleLength;if(f>t&&b<i){const p=Math.max(0,t-b),m=Math.min(g.visibleLength,i-b);l.push({end:m,index:u,segment:g,start:p})}a=f}if(l.length===0)return"";const h=[],c=l[0].segment;h.push(c.before);for(let u=0;u<l.length;u++){const{end:g,segment:b,start:f}=l[u];if(f===0&&g===b.visibleLength)h.push(b.content);else{const p=[...s.segmenter.segment(b.content)];h.push(p.slice(f,g).map(m=>m.segment).join(""))}if(u<l.length-1){const p=l[u+1].segment,m=b.after,d=p.before;m!==d&&(m||d)&&h.push(m,d)}}return h.push(l.at(-1).segment.after),h.join("")},"slice");var Hn=Object.defineProperty,Gn=A((e,t)=>Hn(e,"name",{value:t,configurable:!0}),"x"),Vn=Object.defineProperty,Jn=Gn((e,t)=>Vn(e,"name",{value:t,configurable:!0}),"T"),zn=Object.defineProperty,dt=Jn((e,t)=>zn(e,"name",{value:t,configurable:!0}),"f");const ri="…",qn=3,He=dt((e,t,i=!1)=>{if(e.charAt(t)===" ")return t;const r=i?1:-1,s=Math.min(qn,i?e.length-t:t);for(let o=1;o<=s;o++){const n=t+o*r;if(e.charAt(n)===" ")return n}return t},"findNearestSpace"),Ge=dt((e,t,i)=>be(e,{...i,ellipsis:"",ellipsisWidth:0,limit:t}).index,"widthToIndex"),Ve=dt((e,t,i)=>E(e.slice(0,t),i),"indexToWidth"),ni=dt((e,t,i={})=>{if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof t}`);if(e===""||t<=0)return"";const r=e.normalize("NFC"),{ellipsis:s=ri,position:o="end",preferTruncationOnSpace:n=!1}=i;let a=i.ellipsisWidth??s===ri?1:void 0;a??=be(s,{...i.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:l}=be(r,{...i.width,ellipsis:s,ellipsisWidth:a});if(l<=t)return r;switch(o){case"end":{if(n){const h=t-a,c=Ge(r,h,i.width),u=He(r,c),g=Ve(r,u,i.width);return D(r,0,g,{width:i.width})+s}return D(r,0,t-a,{width:i.width})+s}case"middle":{const h=Math.floor(t/2),c=Math.max(0,t-a),u=Math.min(h,c),g=Math.max(0,c-u);if(n){const b=Ge(r,u,i.width),f=He(r,b),p=Ve(r,f,i.width),m=l-g,d=Ge(r,m,i.width),x=He(r,d,!0),w=Ve(r,x,i.width);return D(r,0,p,{width:i.width})+s+D(r,w,l,{width:i.width}).trim()}return D(r,0,u,{width:i.width})+s+D(r,l-g,l,{width:i.width})}case"start":{if(n){const h=l-t+a,c=Ge(r,h,i.width),u=He(r,c,!0),g=Ve(r,u,i.width);return s+D(r,g,l,{width:i.width}).trim()}return s+D(r,l-t+a,l,{width:i.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${o}'`)}},"truncate");var Dn=Object.defineProperty,Pi=A((e,t)=>Dn(e,"name",{value:t,configurable:!0}),"b$2"),Un=Object.defineProperty,ae=Pi((e,t)=>Un(e,"name",{value:t,configurable:!0}),"d"),Yn=Object.defineProperty,Kn=ae((e,t)=>Yn(e,"name",{value:t,configurable:!0}),"a");const Zn=/\x1B\[(\d+)m/;class Mi{static{O(this,"he")}static{J(this,"at")}static{A(this,"T")}static{Pi(this,"T")}static{ae(this,"d")}static{Kn(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const i=Zn.exec(t);if(!i)return;const r=Number.parseInt(i[1],10);switch(r){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(r>=30&&r<=37||r>=90&&r<=97)this.activeForeground=t;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(r)){const s={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];s&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(s)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const i={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(r=>{const s=i[r];s&&t.push(s)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}var Xn=Object.defineProperty,Ti=ae((e,t)=>Xn(e,"name",{value:t,configurable:!0}),"o");const Fi=Ti((e,t)=>{if(!ve.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const i=!0,r=e.slice(t+1,t+1+tt.length).join("")===tt;return{isInsideEscape:i,isInsideLinkEscape:r}},"checkEscapeSequence"),Qn=Ti((e,t={})=>{const i=new Mi;let r="",s=!1,o="",n="",a=!1;const l=[...e];for(let h=0;h<l.length;h++){const c=l[h];if(c&&ve.has(c)){if(r){const p=t.getWidth?.(r)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:r,width:p};if(a&&(m.isHyperlink=!0,m.hyperlinkUrl=n),t.onSegment?.(m,i)===!1)return;r=""}s=!0,o=c;const b=Fi(l,h),{isInsideLinkEscape:f}=b;if(f){let p=h+1;for(n="";p<l.length;){const d=l[p];if(d===ht)break;n+=d,p+=1}n=n.slice(4);const m={hyperlinkUrl:n,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,i)===!1)return;h=p,a=!0,s=!1,o="";continue}if(h+1<l.length&&l[h+1]==="\\"&&a){const p={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(p,i)===!1)return;a=!1,n="",h+=1,s=!1,o="";continue}}if(s){if(o!==c&&(o+=c),c===Gt){s=!1,i.processEscape(o);const b={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(t.onSegment?.(b,i)===!1)return;o=""}continue}r+=c;const u=t.getWidth?.(r)??0,g={isEscapeSequence:!1,isGrapheme:!0,text:r,width:u};if(a&&(g.isHyperlink=!0,g.hyperlinkUrl=n),t.onSegment?.(g,i)===!1)return;r=""}if(r){const h=t.getWidth?.(r)??0,c={isEscapeSequence:!1,isGrapheme:!0,text:r,width:h};a&&(c.isHyperlink=!0,c.hyperlinkUrl=n),t.onSegment?.(c,i)}if(o){const h={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};t.onSegment?.(h,i)}},"processAnsiString");var eo=Object.defineProperty,to=ae((e,t)=>eo(e,"name",{value:t,configurable:!0}),"t$1");const oi=to(e=>`${ve.values().next().value}${Ei}${String(e)}${Gt}`,"wrapAnsiCode");var io=Object.defineProperty,ro=ae((e,t)=>io(e,"name",{value:t,configurable:!0}),"s");const si=ro(e=>`${ve.values().next().value}${tt}${e}${ht}`,"wrapAnsiHyperlink");var no=Object.defineProperty,oo=ae((e,t)=>no(e,"name",{value:t,configurable:!0}),"l");const so=oo(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",i,r;const s=e.join(`
|
|
2
2
|
`),o=[...s];let n=0;for(const[a,l]of o.entries()){if(t+=l,ve.has(l)){const c=cn.exec(s.slice(n))?.groups??{};if(c.code!==void 0){const u=Number.parseFloat(c.code);i=u===an?void 0:u}else c.uri!==void 0&&(r=c.uri.length===0?void 0:c.uri)}const h=hn.get(Number(i));o[a+1]===`
|
|
3
3
|
`?(r&&(t+=si("")),i&&h&&(t+=oi(h))):l===`
|
|
4
4
|
`&&(i&&h&&(t+=oi(i)),r&&(t+=si(r))),n+=l.length}return t},"preserveAnsi");var ao=Object.defineProperty,K=ae((e,t)=>ao(e,"name",{value:t,configurable:!0}),"f");const Li=/(?=\s)|(?<=\s)/,_i=/^\s+$/,Ot=K(e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},"resetAnsiAtLineBreak"),ie=K(e=>{const t=e.split(" ");let i=t.length;for(;i>0&&E(t[i-1])===0;)i--;return i===t.length?e:t.slice(0,i).join(" ")+t.slice(i).join("")},"stringVisibleTrimSpacesRight"),Hi=K((e,t,i)=>{if(e.length===0)return[""];if(t<=0)return[e];const r=[],s=new Mi;let o="",n=0,a=!1,l=!1,h="",c=0;for(;c<e.length;){const u=e[c];if(ve.has(u)){a=!0,h=u,o+=u,l=Fi([...e],c).isInsideLinkEscape,c+=1;continue}if(a){h+=u,o+=u,l?u===ht&&(a=l=!1):u===Gt&&(a=!1,s.processEscape(h)),c+=1;continue}const g=E(u),b=u===" ";if(g===0){o+=u,c+=1;continue}if(n+g>t&&(o&&r.push(o+s.getEndEscapesForAllActiveAttributes()),o=s.getStartEscapesForAllActiveAttributes(),n=E(o),b&&i)){for(;c<e.length&&e[c]===" ";)c+=1;continue}if(o+=u,n+=g,n===t&&c<e.length-1&&(r.push(o+s.getEndEscapesForAllActiveAttributes()),o=s.getStartEscapesForAllActiveAttributes(),n=E(o),c+1<e.length&&e[c+1]===" "&&i)){for(c+=1;c<e.length&&e[c]===" ";)c+=1;continue}c+=1}return o&&r.push(o+s.getEndEscapesForAllActiveAttributes()),i?r.map(u=>ie(u)):r},"wrapWithBreakAtWidth"),lo=K((e,t,i)=>{if(e.length===0)return[];const r=i?e.trim():e;if(r.length===0)return[];const s=[];let o="",n=0;return Qn(r,{getWidth:E,onSegment:K((a,l)=>{const h=a.text??"";if(a.isEscapeSequence)o+=h;else{const c=h===" ";if(a.width===0)return o+=h,!0;if(n+a.width>t&&(o&&s.push(o),o=l.getStartEscapesForAllActiveAttributes(),n=0,c))return i||s.push(l.getStartEscapesForAllActiveAttributes()+h),!0;o+=h,n+=a.width}return!0},"onSegment")}),o&&s.push(o),i?s.map(a=>ie(a)):s},"wrapCharByChar"),co=K((e,t,i)=>{if(e.length===0)return[];const r=i?e.trim():e;if(r.length===0)return[];const s=r.split(Li),o=[];let n="",a=0,l=0;for(;l<s.length;){const h=s[l],c=_i.test(h),u=E(h);if(h.length===0){l+=1;continue}if(i&&c&&a===0){l+=1;continue}if(a+u>t&&a>0){i?o.push(ie(n)):o.push(n),n="",a=0;continue}n+=h,a+=u,l+=1}return n&&(i?o.push(ie(n)):o.push(n)),o},"wrapWithWordBoundaries"),ho=K((e,t,i)=>{if(e.length===0)return[];const r=i?e.trim():e;if(r.length===0)return[];const s=r.split(Li),o=[];let n="",a=0,l=0;for(;l<s.length;){const h=s[l],c=_i.test(h),u=E(h);if(h.length===0){l+=1;continue}if(i&&c&&a===0){l+=1;continue}if(u>t){n&&o.push(Ot(i?ie(n):n));const g=Hi(h,t,i);if(g.length>0){for(let b=0;b<g.length-1;b+=1)o.push(g[b]);n=g.at(-1),a=E(n)}else n="",a=0;l+=1;continue}if(a+u>t&&a>0&&(o.push(Ot(i?ie(n):n)),n="",a=0,i&&c)){l+=1;continue}n+=h,a+=u,l+=1}return n&&o.push(Ot(i?ie(n):n)),o},"wrapAndBreakWords"),Je={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},uo=K((e,t={})=>{const{removeZeroWidthCharacters:i=!0,trim:r=!0,width:s=80,wrapMode:o=Je.PRESERVE_WORDS}=t;if(r&&e.trim()==="")return"";let n=e.normalize("NFC").replaceAll(`\r
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var x=Object.defineProperty;var w=(t,s)=>x(t,"name",{value:s,configurable:!0});import{createRequire as B}from"node:module";import{a6 as P,p as o,a7 as R}from"./bin.js";import{A as V}from"../packem_shared/pm-runner-
|
|
1
|
+
var x=Object.defineProperty;var w=(t,s)=>x(t,"name",{value:s,configurable:!0});import{createRequire as B}from"node:module";import{a6 as P,p as o,a7 as R}from"./bin.js";import{A as V}from"../packem_shared/pm-runner-BzGZmzYs.js";import{x as C}from"../packem_shared/build-scripts-3E2pmscY.js";import{M as y,i as k}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{n as q}from"./config.js";const D=B(import.meta.url),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=w(t=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[s,f]=v.versions.node.split(".").map(Number);if(s>22||s===22&&f>=3||s===20&&f>=16)return v.getBuiltinModule(t)}return D(t)},"__cjs_getBuiltinModule"),{readdirSync:j,statSync:O}=M("node:fs");var A=Object.defineProperty,_=w((t,s)=>A(t,"name",{value:s,configurable:!0}),"p$1");const N=_((t,s={})=>{const f=y(t,"node_modules");if(!k(f))return[];const l=new Map,p=new Set,b=_((n,i,a)=>{const e=`${i}@${a}`;if(p.has(e))return;p.add(e);const r=a.startsWith(t)?a.slice(t.length+1):a;let u=l.get(n);u||(u=[],l.set(n,u)),u.some($=>$.name===i)||u.push({name:i,relativePath:r})},"recordBin"),m=_((n,i="")=>{let a;try{a=j(n)}catch{return}for(const e of a){const r=y(n,e);if(e.startsWith("@")){m(r,`${e}/`);continue}if(e===".pnpm"&&i===""){let c;try{c=j(r)}catch{continue}for(const d of c){const h=y(r,d,"node_modules");k(h)&&m(h)}continue}if(e.startsWith("."))continue;const u=i+e,$=y(r,"package.json");try{if(!O(r).isDirectory()||!k($))continue;const c=q($),d=typeof c.name=="string"?c.name:u;if(typeof c.bin=="string"){const S=d.includes("/")?d.split("/").pop():d;b(S,d,r)}else if(c.bin&&typeof c.bin=="object")for(const S of Object.keys(c.bin))b(S,d,r);const h=y(r,"node_modules");k(h)&&m(h)}catch{}}},"scanDir");m(f);const g=[];for(const[n,i]of l)i.length<2||s[n]===!0||i.every(a=>s[`${a.name}#${n}`]===!0)||g.push({bin:n,packages:i});return g.sort((n,i)=>n.bin.localeCompare(i.bin))},"collectBinShadows");var T=Object.defineProperty,W=w((t,s)=>T(t,"name",{value:s,configurable:!0}),"p");const U=new Set(["bun","npm","pnpm","yarn"]),K=W(({options:t,visConfig:s,workspaceRoot:f})=>{const l=f??process.cwd(),p=V(l),b=s?.security?.policies?.installScripts?.allow??{},m=s?.security?.allowBins??{},g=s?.security?.pinVersions===!0,n=C(l,b,{pinVersions:g}),i=N(l,m),a=s&&U.has(p.name)?P(s,p.name,l):void 0;if(t.json){process.stdout.write(`${JSON.stringify({binConflicts:i,drift:a,excess:n.excess,installed:n.installed.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),packageManager:p.name,pinVersions:g,unapproved:n.unapproved.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),versionDrift:n.versionDrift},void 0,2)}
|
|
2
2
|
`);return}if(o.info(`Build-script status (${p.name}):
|
|
3
3
|
`),n.installed.length===0&&n.unapproved.length===0&&o.success(" No installed packages declare lifecycle scripts."),n.installed.length>0){o.success(` Approved (${String(n.installed.length)}):`);for(const e of n.installed)o.info(` ✓ ${e.name} — ${e.hooks.join(", ")}`)}if(n.unapproved.length>0){o.info(""),o.warn(` Unapproved (${String(n.unapproved.length)}):`);for(const e of n.unapproved)o.info(` ✗ ${e.name} — ${e.hooks.join(", ")}`);o.notice(" Run 'vis approve-builds' to review.")}if(n.excess.length>0){o.info(""),o.warn(` Stale allowlist entries (${String(n.excess.length)}):`);for(const e of n.excess)o.info(` ! ${e}`);o.notice(" Remove these from vis.config.ts security.policies.installScripts.allow.")}if(n.versionDrift.length>0){o.info(""),o.warn(` Version drift (pinVersions: true) — ${String(n.versionDrift.length)} entr${n.versionDrift.length===1?"y":"ies"} point at outdated versions:`);for(const{from:e,to:r}of n.versionDrift)o.info(` ${e} → ${r}`);o.notice(" Update vis.config.ts security.policies.installScripts.allow keys to migrate.")}if(i.length>0){o.info(""),o.warn(` Bin conflicts (${String(i.length)}) — multiple packages expose the same bin name:`);for(const e of i)o.info(` ${e.bin} ← ${e.packages.map(r=>r.name).join(", ")}`);o.notice(" Add the bin (or 'pkg#bin') to vis.config.ts security.allowBins to silence this.")}if(a?.hasDrift){o.info("");for(const e of R(a))o.warn(e)}},"execute");export{K as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var w=Object.defineProperty;var c=(e,t)=>w(e,"name",{value:t,configurable:!0});import{createRequire as y}from"node:module";import{A as m,P as $}from"../packem_shared/pm-runner-
|
|
1
|
+
var w=Object.defineProperty;var c=(e,t)=>w(e,"name",{value:t,configurable:!0});import{createRequire as y}from"node:module";import{A as m,P as $}from"../packem_shared/pm-runner-BzGZmzYs.js";const _=y(import.meta.url),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=c(e=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[t,s]=a.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return a.getBuiltinModule(e)}return _(e)},"__cjs_getBuiltinModule"),{createInterface:I}=v("node:readline");var h=Object.defineProperty,o=c((e,t)=>h(e,"name",{value:t,configurable:!0}),"n");const r="sigstore",b=o(()=>!!process.stdout.isTTY&&process.env.CI!=="true","isInteractive"),O=o(e=>new Promise(t=>{const s=I({input:process.stdin,output:process.stderr});s.question(`${e} (Y/n) `,i=>{s.close();const n=i.trim().toLowerCase();t(n===""||n==="y"||n==="yes")})}),"defaultPrompt"),D=o(e=>{const t=m(e),s=$(t,{exact:!1,filter:[],global:!1,optional:!1,packages:[r],peer:!1,saveDev:!0,workspace:!1,workspaceRoot:!1},e,console);return Promise.resolve({exitCode:s})},"defaultRunInstall"),k=o(()=>{try{return import.meta.resolve(r),!0}catch{return!1}},"isSigstoreInstalled"),P=o(e=>{let t="pnpm";try{t=m(e).name}catch{}switch(t){case"bun":return`bun add -d ${r}`;case"npm":return`npm install -D ${r}`;case"yarn":return`yarn add -D ${r}`;default:return`pnpm add -D ${r}`}},"installCommandFor"),R=o(()=>import("sigstore"),"defaultImport"),x=o(async(e={})=>{const t=e.interactive??b(),s=e.prompt??O,i=e.runInstall??D,n=e.importImpl??R,d=e.workspaceRoot??process.cwd(),l=P(d);try{return await n()}catch(p){const{code:f,message:g}=p;if(!(f==="ERR_MODULE_NOT_FOUND"||f==="MODULE_NOT_FOUND")||!g.includes(r))throw p}if(!t)throw new Error(`${r} is not installed. \`vis attest\` needs it for keyless signing/verification. Install it in your repo first:
|
|
2
2
|
${l}`);if(!await s(`${r} isn't installed. Install it now?`))throw new Error(`${r} install declined. Re-run \`vis attest\` after installing manually:
|
|
3
3
|
${l}`);const u=await i(d);if(u.exitCode!==0)throw new Error(`Install of ${r} failed (exit ${String(u.exitCode)}). Install manually and retry:
|
|
4
4
|
${l}`);return await n()},"loadOptionalSigstore");export{P as installCommandFor,k as isSigstoreInstalled,x as loadOptionalSigstore};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var d=Object.defineProperty;var u=(r,o)=>d(r,"name",{value:o,configurable:!0});import{p as s}from"./bin.js";import{r as m}from"../packem_shared/advisories-
|
|
1
|
+
var d=Object.defineProperty;var u=(r,o)=>d(r,"name",{value:o,configurable:!0});import{p as s}from"./bin.js";import{r as m}from"../packem_shared/advisories-DS8JEB_g.js";var p=Object.defineProperty,l=u((r,o)=>p(r,"name",{value:o,configurable:!0}),"a");const v=l(async({fs:r,logger:o,options:t,workspaceRoot:n})=>{if(!n)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const e=t.db??m(n),a=t.format==="json";if(!t.force){s.warn(`Prune is destructive. Will remove: ${e}`),s.info("Re-run with --force to proceed."),a&&process.stdout.write(`${JSON.stringify({dbPath:e,reason:"needs --force",removed:!1})}
|
|
2
2
|
`);return}const f=[e,`${e}-wal`,`${e}-shm`,`${e}-journal`],i=[];for(const c of f)try{await r.rm(c,{force:!0}),i.push(c)}catch{}if(a){process.stdout.write(`${JSON.stringify({dbPath:e,files:i,removed:!0})}
|
|
3
3
|
`);return}s.success(`Removed ${e}.`)},"execute"),b=v;export{b as advisoriesPruneExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var l=Object.defineProperty;var c=(s,e)=>l(s,"name",{value:e,configurable:!0});import{e as v,E as f,I as p}from"../packem_shared/index.server-B7ETiT4C.js";import{p as r}from"./bin.js";import{r as g,g as h}from"../packem_shared/advisories-
|
|
1
|
+
var l=Object.defineProperty;var c=(s,e)=>l(s,"name",{value:e,configurable:!0});import{e as v,E as f,I as p}from"../packem_shared/index.server-B7ETiT4C.js";import{p as r}from"./bin.js";import{r as g,g as h}from"../packem_shared/advisories-DS8JEB_g.js";var $=Object.defineProperty,i=c((s,e)=>$(s,"name",{value:e,configurable:!0}),"a");const B=i(s=>{if(s===0)return"0 B";const e=["B","KB","MB","GB"],a=Math.min(Math.floor(Math.log(s)/Math.log(1024)),e.length-1),o=s/1024**a;return`${o.toFixed(o<10&&a>0?1:0)} ${e[a]}`},"formatBytes"),w=i(s=>{if(!s)return"never";const e=Date.parse(s);if(Number.isNaN(e))return s;const a=Date.now()-e;if(a<0)return s;const o=Math.floor(a/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const t=Math.floor(o/60);return t<24?`${t}h ago`:`${Math.floor(t/24)}d ago`},"formatRelative"),S=i(async({logger:s,options:e,workspaceRoot:a})=>{if(!a)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const o=e.db??g(a),t=await h(a,o);if(e.format==="json"){process.stdout.write(`${JSON.stringify({dbPath:o,ecosystems:t.ecosystems.map(n=>({advisoryCount:n.advisoryCount,lastSyncIso:n.lastSyncIso,manifestEtag:n.manifestEtag??null,name:n.name})),exists:t.exists,schemaVersion:t.schemaVersion,sizeBytes:t.sizeBytes},void 0,2)}
|
|
2
2
|
`);return}if(r.info(`DB: ${o}`),!t.exists){r.warn(`No advisory DB yet. Run ${v("vis advisories sync")} to populate.`);return}if(r.info(`Schema: v${t.schemaVersion} Size: ${B(t.sizeBytes)}`),t.ecosystems.length===0){r.warn("DB exists but contains no ecosystems. Run `vis advisories sync`.");return}r.info(""),r.info("Ecosystem Advisories Last sync ETag"),r.info(f("────────── ────────── ───────────────── ──────"));for(const n of t.ecosystems){const m=n.name.padEnd(10),u=n.advisoryCount.toLocaleString().padStart(10),d=`${n.lastSyncIso||"never"} (${w(n.lastSyncIso)})`.padEnd(19),y=n.manifestEtag??f("—");r.info(`${p(m)} ${u} ${d} ${y}`)}},"execute"),D=S;export{D as advisoriesStatusExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var w=Object.defineProperty;var y=(e,o)=>w(e,"name",{value:o,configurable:!0});import{E as $}from"../packem_shared/index.server-B7ETiT4C.js";import{p as l}from"./bin.js";import{s as D}from"../packem_shared/scan-progress-EbvmIh4i.js";import{s as b,D as S}from"../packem_shared/advisories-
|
|
1
|
+
var w=Object.defineProperty;var y=(e,o)=>w(e,"name",{value:o,configurable:!0});import{E as $}from"../packem_shared/index.server-B7ETiT4C.js";import{p as l}from"./bin.js";import{s as D}from"../packem_shared/scan-progress-EbvmIh4i.js";import{s as b,D as S}from"../packem_shared/advisories-DS8JEB_g.js";var E=Object.defineProperty,c=y((e,o)=>E(e,"name",{value:o,configurable:!0}),"c");const P=c(e=>e?.security?.audit?.advisories??{},"readAdvisoriesConfig"),k=c(e=>e?e.split(",").map(o=>o.trim()).filter(o=>o.length>0):["npm"],"parseEcosystems"),x=c(async({logger:e,options:o,visConfig:g,workspaceRoot:d})=>{if(!d)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const u=o.format==="json",m=P(g),f=o.source??m.source??S,p=k(o.ecosystem),v=p.map(s=>({id:s,label:`Sync ${s} advisories`})),n=D(v,{live:!u}),i=[];try{for(const s of p){n.start(s);const r=Date.now();try{const t=await b({allowedHosts:m.allowedHosts,dbPath:o.db,ecosystem:s,force:!!o.force,source:f,workspaceRoot:d});i.push({ecosystem:s,result:t}),t.upToDate?n.finish(s,"ok",`up to date · ${h(Date.now()-r)}`):n.finish(s,"ok",`${t.advisoriesIngested.toLocaleString()} advisories · ${h(t.durationMs)}`)}catch(t){const a=t instanceof Error?t.message:String(t);i.push({ecosystem:s,error:a}),n.finish(s,"error",a)}}}finally{n.stop()}if(u){const s={ecosystems:i.map(r=>({advisoriesIngested:r.result?.advisoriesIngested??0,dbPath:r.result?.dbPath??null,durationMs:r.result?.durationMs??0,ecosystem:r.ecosystem,error:r.error??null,upToDate:r.result?.upToDate??!1})),source:f};process.stdout.write(`${JSON.stringify(s,void 0,2)}
|
|
2
2
|
`)}else{const s=i.filter(a=>a.error),r=i.filter(a=>a.result),t=r[0];t?.result?.dbPath&&l.info($(`DB: ${t.result.dbPath}`)),s.length===0?l.success(`Synced ${r.length} ecosystem${r.length===1?"":"s"}.`):l.error(`${s.length} ecosystem${s.length===1?"":"s"} failed to sync.`)}i.some(s=>s.error)&&(process.exitCode=1)},"execute"),h=c(e=>e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`,"formatDuration"),O=x;export{O as advisoriesSyncExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var m=Object.defineProperty;var f=(e,n)=>m(e,"name",{value:n,configurable:!0});import{p as i}from"./bin.js";import{A as g}from"../packem_shared/pm-runner-
|
|
1
|
+
var m=Object.defineProperty;var f=(e,n)=>m(e,"name",{value:n,configurable:!0});import{p as i}from"./bin.js";import{A as g}from"../packem_shared/pm-runner-BzGZmzYs.js";import{N as y}from"../packem_shared/native-config-sync-BOeuyrBj.js";import{E as v}from"../packem_shared/min-release-age-heJgeP7o.js";var h=Object.defineProperty,w=f((e,n)=>h(e,"name",{value:n,configurable:!0}),"l");const b=new Set(["bun","npm","pnpm","yarn"]),x=w(({options:e,visConfig:n,workspaceRoot:u})=>{const o=u??process.cwd(),t=g(o);if(!b.has(t.name)){i.warn(`Package manager '${t.name}' has no native security config to sync.`);return}if(!n?.security){i.warn("vis.config has no `security` block — nothing to sync.");return}const r=n.security.policies??{},a=Object.fromEntries(Object.entries(r.installScripts?.allow??{}).filter(([,c])=>c)),p=r.firstSeen?.minutes,l=r.firstSeen?.exclude??[],s=[];if(Object.keys(a).length>0&&!e.skipAllowBuilds&&s.push(...y(t.name,o,a)),e.skipMinReleaseAge||s.push(...v(t.name,o,p,l)),s.length===0){i.success("Nothing to sync — vis.config and native PM config are aligned.");return}i.info(`Syncing vis.config security settings to ${t.name} native config…
|
|
2
2
|
`);for(const c of s)i.success(` ${c}`)},"execute");export{x as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var y=Object.defineProperty;var d=(r,n)=>y(r,"name",{value:n,configurable:!0});import{createRequire as w}from"node:module";import{M as u,i as f}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{n as m,B as k}from"./config.js";import{p as e}from"./bin.js";import{A as j}from"../packem_shared/pm-runner-
|
|
1
|
+
var y=Object.defineProperty;var d=(r,n)=>y(r,"name",{value:n,configurable:!0});import{createRequire as w}from"node:module";import{M as u,i as f}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{n as m,B as k}from"./config.js";import{p as e}from"./bin.js";import{A as j}from"../packem_shared/pm-runner-BzGZmzYs.js";const v=w(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=d(r=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,s]=c.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return c.getBuiltinModule(r)}return v(r)},"__cjs_getBuiltinModule"),{spawnSync:$}=h("node:child_process");var _=Object.defineProperty,l=d((r,n)=>_(r,"name",{value:n,configurable:!0}),"c");const t="@lavamoat/preinstall-always-fail",p=l(r=>{const n=u(r,"package.json");if(!f(n))return"no-package-json";try{const s=m(n);if(s.devDependencies?.[t]||s.dependencies?.[t])return"installed"}catch{}return"missing"},"tripwireStatus"),b=l(r=>{const n=u(r,"package.json");if(!f(n))return!1;try{const s=m(n);let o=!1;const a=l(i=>!i||!(t in i)?i:(o=!0,Object.fromEntries(Object.entries(i).filter(([g])=>g!==t))),"stripFrom");return s.devDependencies=a(s.devDependencies),s.dependencies=a(s.dependencies),o&&k(n,`${JSON.stringify(s,null,2)}
|
|
2
2
|
`),o}catch{return!1}},"removeFromPackageJson"),O=l(({options:r,workspaceRoot:n})=>{const s=n??process.cwd();if(r.status){switch(p(s)){case"installed":{e.success(`Preinstall tripwire is installed (${t}).`),e.info("Removing 'ignore-scripts=true' will cause future installs to fail loudly.");break}case"missing":{e.warn("Preinstall tripwire is not installed."),e.info(`Run 'vis security tripwire' to add ${t} as a devDependency.`);break}default:e.error("No package.json found at the workspace root."),process.exitCode=1}return}if(r.remove){b(s)?e.success(`Removed ${t} from package.json. Run your PM's install to clean node_modules.`):e.info(`${t} was not present in package.json.`);return}if(p(s)==="installed"){e.info(`${t} is already installed.`);return}const o=j(s),a={bun:["add","-d",t],npm:["install","--save-dev",t],pnpm:["add","-D","-w",t],yarn:["add","-D",t]}[o.name];if(!a){e.error(`Cannot install tripwire — unsupported package manager '${o.name}'.`),process.exitCode=1;return}e.info(`Installing ${t} via ${o.name}…`);const i=$(o.name,a,{cwd:s,stdio:"inherit"});if(i.error){e.error(`Failed to install tripwire: ${i.error.message}`),process.exitCode=1;return}if(i.signal!==null){e.error(`${o.name} was terminated by signal ${i.signal}`),process.exitCode=1;return}if(i.status!==0){e.error(`${o.name} exited with code ${String(i.status)}`),process.exitCode=i.status??1;return}e.success(`Installed ${t} as a devDependency.`),e.notice(""),e.notice("How the tripwire works:"),e.notice(` ${t} declares a preinstall script that always fails.`),e.notice(" When 'ignore-scripts=true' is set (.npmrc / bunfig.toml / .yarnrc.yml),"),e.notice(" the script is skipped and installs succeed normally. If someone deletes"),e.notice(" that setting, the next install fails — loudly — instead of silently"),e.notice(" running every dependency's lifecycle scripts.")},"execute");export{O as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var $=Object.defineProperty;var k=(e,o)=>$(e,"name",{value:o,configurable:!0});import{p}from"./bin.js";import{A as x}from"../packem_shared/pm-runner-
|
|
1
|
+
var $=Object.defineProperty;var k=(e,o)=>$(e,"name",{value:o,configurable:!0});import{p}from"./bin.js";import{A as x}from"../packem_shared/pm-runner-BzGZmzYs.js";import{r as v,l as C,L as S}from"../packem_shared/dependency-scan-s2MD0vi-.js";import{$ as M,M as h,i as L}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{F as E}from"../packem_shared/lockfile-BG1HvBzH.js";import{e as P}from"../packem_shared/index-88UK-tt_.js";var D=Object.defineProperty,m=k((e,o)=>D(e,"name",{value:o,configurable:!0}),"r");const V=m(e=>{const o=e.trim();return o===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(o)||/^(?:github|gitlab|bitbucket|gist):/i.test(o)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(o)&&!o.includes("@")?!0:/^https?:\/\//i.test(o)},"isExoticSpecifier"),N=m((e,o)=>{for(const s of o)if(s===e||s.endsWith("*")&&e.startsWith(s.slice(0,-1)))return!0;return!1},"matchesAllow"),O=m((e,o,s={})=>{const t=v(e,o);if(!t)return[];let i;try{i=M(h(e,t.file))}catch{return[]}const n=E(i,t.type);if(n.length===0)return[];const c=s.allow??[],l=[],f=new Set;for(const r of n){const a=`${r.name}@${r.version}`;for(const g of[r.dependencies,r.optionalDependencies])if(g){for(const[u,w]of Object.entries(g))if(!N(u,c))for(const y of w){if(!V(y))continue;const b=`${a}->${u}@${y}`;f.has(b)||(f.add(b),l.push({declaredBy:a,packageName:u,source:y}))}}}return l.sort((r,a)=>r.packageName.localeCompare(a.packageName)||r.declaredBy.localeCompare(a.declaredBy))},"scanExoticSubdeps");var R=Object.defineProperty,d=k((e,o)=>R(e,"name",{value:o,configurable:!0}),"n");const j=new Set(["firstSeen","publisherChange"]),A=d(e=>e.severity==="block"&&e.acceptedRisk===void 0,"isGatingDecision"),B=d(e=>{const o=e.security?.policies?.firstSeen?.minutes,s=typeof o=="number"&&o>0,t=e.security?.policies?.publisherChange?.mode==="no-downgrade",i=e.security?.blockExoticSubdeps===!0;return s||t||i},"anyPolicyConfigured"),F=d(async e=>{const{offline:o=!1,packageManager:s,visConfig:t,workspaceRoot:i}=e,n=Date.now();if(!B(t))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const c=v(i,s);if(!c||!L(h(i,c.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=C(i,s,{includeDev:!0}),f=l.length,r=await P({offline:o,packageManager:s,packages:l,workspaceRoot:i},"install",{enabledPolicies:new Set(j),visConfig:t}),a=t.security?.blockExoticSubdeps===!0?O(i,s,{allow:t.security.exoticSubdepsAllow}):[],g=r.some(u=>A(u))||a.length>0;return{decisions:r,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:g?"fail":"pass"}},"verifyLockfile"),W=d(e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,"formatElapsed"),G=d(e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const o=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${W(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${o}`];const s=[`✗ Lockfile failed supply-chain policy check ${o}`];for(const t of e.decisions)t.severity==="block"&&t.acceptedRisk===void 0&&s.push(` [${t.policy}] ${t.reason}`);for(const t of e.exoticViolations)s.push(` [blockExoticSubdeps] ${t.packageName} pulled from exotic source by ${t.declaredBy}: ${t.source}`);return s},"formatLockfileVerification");var I=Object.defineProperty,J=k((e,o)=>I(e,"name",{value:o,configurable:!0}),"a");const U=J(async({options:e,visConfig:o,workspaceRoot:s})=>{const t=s??process.cwd(),i=x(t);if(!S[i.name]){p.warn(`Package manager '${i.name}' has no lockfile vis can verify.`);return}const n=await F({offline:!!e.offline,packageManager:i.name,visConfig:o??{},workspaceRoot:t});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
|
|
2
2
|
`),n.status==="fail"&&(process.exitCode=1);return}const[c,...l]=G(n);if(n.status==="skipped"){p.info(c);return}if(n.status==="pass"){p.success(c);return}p.error(c);for(const f of l)p.error(f);process.exitCode=1},"execute");export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var I=Object.defineProperty;var d=(s,e)=>I(s,"name",{value:e,configurable:!0});import{createRequire as $}from"node:module";import{
|
|
1
|
+
var I=Object.defineProperty;var d=(s,e)=>I(s,"name",{value:e,configurable:!0});import{createRequire as $}from"node:module";import{D as j}from"../packem_chunks/config.js";import{advisoriesStatus as E,NATIVE_BINDING_VERSION as A,advisoriesIngest as q,advisoriesQuery as B}from"#native";const T=$(import.meta.url),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=d(s=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[e,t]=v.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return v.getBuiltinModule(s)}return T(s)},"__cjs_getBuiltinModule"),{randomUUID:O}=l("node:crypto"),{createWriteStream:P,existsSync:k}=l("node:fs"),{mkdir:U,unlink:x,stat:C}=l("node:fs/promises"),{join:w,dirname:L}=l("node:path"),{Readable:M}=l("node:stream"),{pipeline:W}=l("node:stream/promises");var F=Object.defineProperty,r=d((s,e)=>F(s,"name",{value:e,configurable:!0}),"s");const b=5;if(A!==b)throw new Error(`vis native binding ABI mismatch in advisories: expected ${b}, got ${A}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const es="https://osv-vulnerabilities.storage.googleapis.com",V=new Set(["osv-vulnerabilities.storage.googleapis.com"]);class H extends Error{static{d(this,"AdvisoryDbNotFoundError")}static{r(this,"AdvisoryDbNotFoundError")}cause="DB_NOT_FOUND";constructor(e){super(`No local advisory DB at ${e}. Run 'vis advisories sync' first.`),this.name="AdvisoryDbNotFoundError"}}class p extends Error{static{d(this,"AdvisorySourceNotAllowedError")}static{r(this,"AdvisorySourceNotAllowedError")}cause="SOURCE_NOT_ALLOWED";constructor(e){super(`Advisory source host '${e}' is not in the built-in allowlist. Add it to \`security.audit.advisories.allowedHosts\` if intentional.`),this.name="AdvisorySourceNotAllowedError"}}class N extends Error{static{d(this,"AdvisorySyncNetworkError")}static{r(this,"AdvisorySyncNetworkError")}cause="SYNC_NETWORK";constructor(e,t){super(`Advisory sync failed for ${e}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="AdvisorySyncNetworkError"}}const g=r(s=>{const e=j("vis",{create:!0,cwd:s})??w(s,"node_modules",".cache","vis");return w(e,"advisories","db.sqlite")},"resolveAdvisoryDbPath"),z=r((s,e)=>{let t;try{t=new URL(s)}catch{throw new p(s)}if(t.protocol!=="https:")throw new p(`${t.protocol}//${t.host}`);if(!new Set([...V,...e??[]]).has(t.host))throw new p(t.host);return t},"validateAdvisorySource"),ts=r(async s=>{const e=s.dbPath??g(s.workspaceRoot);await U(L(e),{recursive:!0});const t=z(s.source,s.allowedHosts),u=new URL(`${s.ecosystem}/all.zip`,Q(t.toString())),y=await G(e,s.ecosystem);let i=null;if(!s.force){const n=await S(u,{method:"HEAD"});if(n.ok&&(i=n.headers.get("etag"),i&&y&&i===y))return{advisoriesIngested:0,dbPath:e,durationMs:0,upToDate:!0}}const a=`${e}.${s.ecosystem}.${process.pid}.${O()}.zip.tmp`,o=await S(u,{method:"GET"});if(!o.ok||!o.body)throw new N(u.toString(),o.status);i||(i=o.headers.get("etag"));const m=o.headers.get("content-length"),c=m?Number.parseInt(m,10):null;let h=0;const _=P(a),f=M.fromWeb(o.body);s.onProgress&&c&&f.on("data",n=>{h+=n.byteLength,s.onProgress?.(h,c,"download")}),await W(f,_);try{const n=await q({dbPath:e,ecosystem:s.ecosystem,manifestEtag:i??void 0,zipPath:a},(D,R)=>s.onProgress?.(D,R,"ingest"));return{advisoriesIngested:n.advisoriesIngested,dbPath:e,durationMs:n.durationMs,upToDate:!1}}finally{await x(a).catch(()=>{})}},"syncAdvisories"),rs=r((s,e)=>{if(s.length===0)return new Map;const t=e.dbPath??g(e.workspaceRoot),u=e.ecosystem??"npm";if(!k(t))throw new H(t);const y=s.map(o=>({ecosystem:u,name:o.name,version:o.version})),i=B(t,y),a=new Map;for(const[o,m]of s.entries()){const c=i[o];!c||c.vulnerabilities.length===0||a.set(m.name,c.vulnerabilities.map(h=>K(h)))}return a},"queryAdvisories"),os=r(async(s,e)=>{const t=e??g(s);return E(t)},"getAdvisoryStatus"),G=r(async(s,e)=>{try{await C(s)}catch{return null}return E(s).ecosystems.find(t=>t.name===e)?.manifestEtag??null},"readStoredEtag"),K=r(s=>({aliases:s.aliases.length>0?s.aliases:void 0,cvssScore:s.cvssScore??void 0,fixedVersions:s.fixedVersions,id:s.id,severity:Y(s.severity),summary:s.summary}),"toSecurityVulnerability"),Y=r(s=>{const e=s.toUpperCase();return e==="CRITICAL"||e==="HIGH"||e==="MODERATE"||e==="LOW"?e:"UNKNOWN"},"normalizeSeverity"),Q=r(s=>s.endsWith("/")?s:`${s}/`,"ensureTrailingSlash"),S=r(async(s,e)=>{try{return await fetch(s,e)}catch(t){throw new N(s.toString(),t instanceof Error?t.message:String(t))}},"safeFetch");export{H as A,es as D,os as g,rs as q,g as r,ts as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var de=Object.defineProperty;var w=(e,n)=>de(e,"name",{value:n,configurable:!0});import{createRequire as he}from"node:module";import{n as ie}from"../packem_chunks/config.js";import{M as B,$ as _e}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{r as be}from"./docker-
|
|
1
|
+
var de=Object.defineProperty;var w=(e,n)=>de(e,"name",{value:n,configurable:!0});import{createRequire as he}from"node:module";import{n as ie}from"../packem_chunks/config.js";import{M as B,$ as _e}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{r as be}from"./docker-Bw9gKo69.js";import{e as $e}from"./license-zZU7aavK.js";import{F as Oe}from"./lockfile-BG1HvBzH.js";import{x as ke}from"./pm-runner-BzGZmzYs.js";const ge=he(import.meta.url),W=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ae=w(e=>{if(typeof W<"u"&&W.versions&&W.versions.node){const[n,t]=W.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return W.getBuiltinModule(e)}return ge(e)},"__cjs_getBuiltinModule"),{randomUUID:ye}=ae("node:crypto"),{readdirSync:ve}=ae("node:fs");var je=Object.defineProperty,pe=w((e,n)=>je(e,"name",{value:n,configurable:!0}),"r$1");const z=pe(e=>e.replaceAll(/[^\w.~-]/g,n=>`%${(n.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),"encodeSegment"),M=pe((e,n)=>{const t=e.toLowerCase();if(t.startsWith("@")){const o=t.indexOf("/");if(o>0){const r=t.slice(0,o),p=t.slice(o+1);return`pkg:npm/${z(r)}/${z(p)}@${z(n)}`}}return`pkg:npm/${z(t)}@${z(n)}`},"toNpmPurl");var Se=Object.defineProperty,j=w((e,n)=>Se(e,"name",{value:n,configurable:!0}),"a");const m={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},Te=[m.STRING,m.NUMBER,m.BOOLEAN],Ae='<?xml version="1.0" encoding="UTF-8"?>',se=["_selfCloseTag","_attrs"],xe=j((e="",n=0)=>e.repeat(n),"getIndentStr"),Q=j(e=>Array.isArray(e)&&m.ARRAY||typeof e===m.OBJECT&&e!==null&&e._name&&m.JSTOXML_OBJECT||e instanceof Date&&m.DATE||e===null&&m.NULL||typeof e,"getType"),le=j(e=>e.startsWith("<![CDATA["),"isCDATA"),ue=j((e="",n={},t)=>{let o=e;if(typeof e===m.STRING){if(le(e))return e;const r=new RegExp(`(${Object.keys(n).join("|")})(?!(\\w|#)*;)`,"g");o=String(e).replace(r,(p,g)=>n[g]||"")}return typeof t=="function"?t(o):o},"mapStr"),Ce=j((e={},n,t,o)=>(Array.isArray(e)?e:Object.entries(e).map(([r,p])=>({[r]:p}))).reduce((r,p)=>{const g=Object.keys(p)[0],y=p[g];if(typeof t===m.FUNCTION&&t(g,y))return r;const b=n?ue(y,n):y,$=!o&&b===!0?"":`="${b}"`;return r.push(`${g}${$}`),r},[]),"getAttributeKeyVals"),Ne=j((e={},n,t,o)=>{const r=Ce(e,n,t,o);return r.length===0?"":` ${r.join(" ")}`},"formatAttributes"),Re=j((e={})=>Object.keys(e).map(n=>({_name:n,_content:e[n]})),"objToArray"),we=j(e=>Te.includes(Q(e)),"isPrimitive"),Pe=j(e=>!e.match("<"),"isSimpleXML"),De=j(({header:e,isOutputStart:n})=>e&&n?typeof e===m.BOOLEAN?Ae:e:"","getHeaderString"),re={"<":"<",">":">","&":"&",'"':"""},J=j((e={},n={})=>{const{depth:t=0,indent:o,_isFirstItem:r,_isOutputStart:p=!0,header:g,attributeReplacements:y={},attributeFilter:b,attributeExplicitTrue:$=!1,contentReplacements:q={},contentMap:L,selfCloseTags:I=!0}=n,H=typeof y=="boolean"&&!y?{}:{...re,...y},Y=typeof q=="boolean"&&!q?{}:{...re,...q},P=typeof o=="string",T=xe(o,t),G=Q(e),U=De({header:g,indent:o,depth:t,isOutputStart:p}),D=p&&!U&&r&&t===0,E=P&&!D?`
|
|
2
2
|
`:"";let v="";switch(G){case m.JSTOXML_OBJECT:{const{_name:f,_content:l}=e;if(l===null&&typeof L!="function"){v=`${E}${T}${f}`;break}if(Array.isArray(l)&&l.every(we))return l.map(S=>J({_name:f,_content:S},{...n,depth:t,_isOutputStart:!1})).join("");if(se.includes(f))break;const _=J(l,{...n,depth:t+1,_isOutputStart:D}),N=Q(_),O=Pe(_),k=le(_),R=`${E}${T}`;if(f==="_comment"){v+=`${R}<!-- ${l} -->`;break}const K=N==="undefined"||_==="",c=I,s=e._selfCloseTag,i=typeof s===m.BOOLEAN?K&&s:K&&c,a=i?"/":"",u=Ne(e._attrs,H,b,$),d=`<${f}${u}${a}>`,A=P&&!O&&!k?`
|
|
3
3
|
${T}`:"",x=i?"":`${_}${A}</${f}>`;v+=`${R}${d}${x}`;break}case m.OBJECT:{const f=Object.keys(e);v=f.map((l,_)=>{const N={...n,_isFirstItem:_===0,_isLastItem:_+1===f.length,_isOutputStart:D},O={_name:l};if(Q(e[l])===m.OBJECT&&(se.forEach(k=>{const R=e[l][k];typeof R<"u"&&(O[k]=R,delete e[l][k])}),typeof e[l]._content<"u"&&Object.keys(e[l]).length>1)){const k=Object.assign({},e[l]);delete k._content,O._content=[...Re(k),e[l]._content]}return typeof O._content>"u"&&(O._content=e[l]),J(O,N)},n).join("");break}case m.FUNCTION:{const f=e(n);v=J(f,n);break}case m.ARRAY:{v=e.map((f,l)=>{const _={...n,_isFirstItem:l===0,_isLastItem:l+1===e.length,_isOutputStart:D};return J(f,_)}).join("");break}default:{v=ue(e,Y,L);break}}return`${U}${v}`},"toXML");var Ee=Object.defineProperty,X=w((e,n)=>Ee(e,"name",{value:n,configurable:!0}),"r");const te=X(e=>{try{return ie(e)}catch{return}},"readJsonSafe"),Me=X(e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const n=e.indexOf("/");return n>1&&!e.includes("/",n+1)}return!e.includes("/")},"isSafePackageName"),Be=X(e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),"isSafeVersion"),Le=X((e,n,t)=>{const o=`${n.replaceAll("/","+")}@${t}`,r=B(e,"node_modules",".pnpm"),p=te(B(r,o,"node_modules",n,"package.json"));if(p)return p;let g;try{g=ve(r)}catch{return}const y=`${o}_`;for(const b of g){if(!b.startsWith(y))continue;const $=te(B(r,b,"node_modules",n,"package.json"));if($)return $}},"readPnpmVirtualStore"),Ie=X((e,n,t)=>{const o=te(B(e,"node_modules",n,"package.json"));return o?.version===t?o:void 0},"readHoistedCopy"),Ue=X((e,n,t)=>{if(!(!Me(n)||!Be(t)))return Le(e,n,t)??Ie(e,n,t)},"readInstalledPackageMetadata");var Fe=Object.defineProperty,me=w((e,n)=>Fe(e,"name",{value:n,configurable:!0}),"t");const Je={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Xe={sha256:64,sha384:96,sha512:128},qe=me(e=>{const n={name:e.name,version:e.version},{integrity:t}=e;return t&&t.hex.length===Xe[t.algorithm]&&(n.hash={alg:Je[t.algorithm],content:t.hex}),e.dependencies&&(n.dependencies=e.dependencies),e.peerDependencies&&(n.peerDependencies=e.peerDependencies),e.optionalDependencies&&(n.optionalDependencies=e.optionalDependencies),n},"toResolvedPackage"),He=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Ve=me(e=>{for(const{file:n,type:t}of He){let o;try{o=_e(B(e,n))}catch{continue}const r=new Map;for(const p of Oe(o,t))r.set(`${p.name}@${p.version}`,qe(p));return{packages:r,type:t}}},"readLockfilePackages");var We=Object.defineProperty,fe=w((e,n)=>We(e,"name",{value:n,configurable:!0}),"s");const ze=fe(e=>{const n=e.indexOf(":");return n<=0?e:e.slice(0,n)==="npm"?e.slice(n+1):e},"stripProtocolPrefix"),ee=fe((e,n,t)=>{const o=t.get(e);if(!o||o.size===0)return;if(o.has(n))return n;const r=ze(n);if(r!==n&&o.has(r))return r;const p=[...o];return ke.maxSatisfying(p,r,{includePrerelease:!0})||p[0]},"resolveSpecifier");var Ye=Object.defineProperty,h=w((e,n)=>Ye(e,"name",{value:n,configurable:!0}),"p");const Ge="1.7",Ke="CycloneDX",Qe="http://cyclonedx.org/schema/bom-1.7.schema.json",Ze="@visulima/vis",ce=h(e=>{try{return ie(e)}catch{return}},"readPackageJson"),en=h(e=>{if(e){if(typeof e=="string")return e;if(typeof e=="object"&&e.name)return e.email?`${e.name} <${e.email}>`:e.name}},"toAuthorString"),nn=h(e=>{if(e)return typeof e=="string"?e:e.url},"toRepositoryUrl"),tn=h(e=>{if(e)return typeof e=="string"?e:e.url},"toBugsUrl"),on=h(e=>{const n=[];e.homepage&&n.push({type:"website",url:e.homepage});const t=nn(e.repository);t&&n.push({type:"vcs",url:t});const o=tn(e.bugs);return o&&n.push({type:"issue-tracker",url:o}),n.length>0?n:void 0},"buildExternalReferences"),sn=h(e=>e==="application"||e==="service"||e==="tool"?"application":"library","toCycloneDxComponentType"),ne=h((e,n)=>{if(!n)return;n.description&&(e.description=n.description);const t=en(n.author);t&&(e.author=t);const o=$e(n);o&&(e.licenses=o);const r=on(n);r&&(e.externalReferences=r)},"decoratePackageComponent"),yn=h(e=>{const{focus:n,generatorVersion:t,includeDev:o=!1,now:r=new Date,projectGraph:p,serialNumber:g,workspace:y,workspaceRoot:b}=e,$=n&&n.length>0?[...be(n,p)].sort():Object.keys(y.projects).sort(),q=new Set($),L=new Map;for(const c of $){const s=y.projects[c];s&&L.set(c,ce(B(b,s.root,"package.json")))}const I=[],H=new Map;for(const c of $){const s=y.projects[c];if(!s)continue;const i=L.get(c),a=i?.version??"0.0.0",u=M(c,a);H.set(c,u);const d={"bom-ref":u,name:c,purl:u,type:sn(s.projectType),version:a};ne(d,i),I.push(d)}const Y=Ve(b),P=new Map,T=new Map;if(Y)for(const c of Y.packages.values()){P.set(`${c.name}@${c.version}`,c);let s=T.get(c.name);s||(s=new Set,T.set(c.name,s)),s.add(c.version)}const G=[],U=[],D=new Map;for(const c of $){const s=L.get(c);if(!s)continue;const i=[s.dependencies,s.peerDependencies];o&&i.push(s.devDependencies);const a=new Set,u=h((d,A)=>{if(A)for(const[x,S]of Object.entries(A)){if(q.has(x)){const F=H.get(x);F&&a.add(F);continue}const C=ee(x,S,T);C&&(a.add(M(x,C)),d.push(`${x}@${C}`))}},"seedRef");for(const d of i)u(G,d);u(U,s.optionalDependencies),D.set(c,a)}const E=new Map,v=new Map,f=h((c,s)=>{const i=[...c];for(;i.length>0;){const a=i.pop(),u=E.get(a);if(u==="required"||u==="optional"&&s==="optional")continue;E.set(a,s);const d=P.get(a);if(!d)continue;const A=v.get(a)??new Set,x=[d.dependencies,d.peerDependencies];for(const S of x)if(S)for(const[C,F]of Object.entries(S))for(const V of F){const Z=ee(C,V,T);Z&&(A.add(M(C,Z)),i.push(`${C}@${Z}`))}if(d.optionalDependencies)for(const[S,C]of Object.entries(d.optionalDependencies))for(const F of C){const V=ee(S,F,T);V&&(A.add(M(S,V)),U.push(`${S}@${V}`))}A.size>0&&v.set(a,A)}},"walk");f(G,"required"),f(U,"optional");const l=[],_=[...E.keys()].sort();for(const c of _){const s=P.get(c);if(!s)continue;const i=M(s.name,s.version),a={"bom-ref":i,name:s.name,purl:i,scope:E.get(c)??"required",type:"library",version:s.version};s.hash&&(a.hashes=[s.hash]),ne(a,Ue(b,s.name,s.version)),l.push(a)}const N=[];for(const[c,s]of D){const i=H.get(c);if(!i)continue;const a=[...s].sort();N.push(a.length>0?{dependsOn:a,ref:i}:{ref:i})}for(const c of _){const s=P.get(c);if(!s)continue;const i=M(s.name,s.version),a=v.get(c),u=a?[...a].sort():[];N.push(u.length>0?{dependsOn:u,ref:i}:{ref:i})}N.sort((c,s)=>c.ref.localeCompare(s.ref));const O=ce(B(b,"package.json")),k=(()=>{if(n?.length===1){const u=I.find(d=>d.name===n[0]);if(u)return{"bom-ref":u["bom-ref"],name:u.name,purl:u.purl,type:u.type,version:u.version}}const c=O?.name??"workspace",s=O?.version??"0.0.0",i=M(c,s),a={"bom-ref":i,name:c,purl:i,type:"application",version:s};return ne(a,O),a})(),R=k["bom-ref"],K=R?I.filter(c=>c["bom-ref"]!==R):I;return{$schema:Qe,bomFormat:Ke,components:[...K,...l],dependencies:N,metadata:{component:k,lifecycles:[{phase:"build"}],timestamp:r.toISOString(),tools:{components:[{name:Ze,type:"application",...t?{version:t}:{}}]}},serialNumber:g??`urn:uuid:${ye()}`,specVersion:Ge,version:1}},"buildCycloneDxBom"),_n=h(e=>{const n={version:e.version??1,xmlns:"http://cyclonedx.org/schema/bom/1.7"};e.serialNumber&&(n.serialNumber=e.serialNumber);const t=[];return e.metadata&&t.push(rn(e.metadata)),e.components&&e.components.length>0&&t.push({_content:e.components.map(o=>oe(o)),_name:"components"}),e.dependencies&&e.dependencies.length>0&&t.push({_content:e.dependencies.map(o=>an(o)),_name:"dependencies"}),`${J({_attrs:n,_content:t,_name:"bom"},{header:!0,indent:" ",selfCloseTags:!0})}
|
|
4
4
|
`},"serializeBomToXml"),rn=h(e=>{const n=[];return e.timestamp&&n.push({timestamp:e.timestamp}),e.lifecycles&&e.lifecycles.length>0&&n.push({_content:e.lifecycles.map(t=>{const o=[];return t.phase&&o.push({phase:t.phase}),t.name&&o.push({name:t.name}),t.description&&o.push({description:t.description}),{_content:o,_name:"lifecycle"}}),_name:"lifecycles"}),e.tools?.components&&n.push({_content:[{_content:e.tools.components.map(t=>oe(t)),_name:"components"}],_name:"tools"}),e.component&&n.push(oe(e.component)),{_content:n,_name:"metadata"}},"metadataToXmlElement"),oe=h(e=>{const n={type:e.type};e["bom-ref"]&&(n["bom-ref"]=e["bom-ref"]);const t=[];e.group&&t.push({group:e.group}),t.push({name:e.name}),e.version&&t.push({version:e.version}),e.description&&t.push({description:e.description}),e.author&&t.push({author:e.author}),e.hashes&&e.hashes.length>0&&t.push({_content:e.hashes.map(r=>({_attrs:{alg:r.alg},_content:r.content,_name:"hash"})),_name:"hashes"});const o=cn(e.licenses);return o&&t.push(o),e.purl&&t.push({purl:e.purl}),e.scope&&t.push({scope:e.scope}),e.externalReferences&&e.externalReferences.length>0&&t.push({_content:e.externalReferences.map(r=>({_attrs:{type:r.type},_content:[{url:r.url}],_name:"reference"})),_name:"externalReferences"}),{_attrs:n,_content:t,_name:"component"}},"componentToXmlElement"),cn=h(e=>{if(!e||e.length===0)return;const n=[];for(const t of e){if("expression"in t){n.push({expression:t.expression});continue}const o=[];"id"in t.license&&t.license.id?o.push({id:t.license.id}):"name"in t.license&&t.license.name&&o.push({name:t.license.name}),n.push({_content:o,_name:"license"})}return{_content:n,_name:"licenses"}},"licensesToXmlElement"),an=h(e=>e.dependsOn&&e.dependsOn.length>0?{_attrs:{ref:e.ref},_content:e.dependsOn.map(n=>({_attrs:{ref:n},_name:"dependency"})),_name:"dependency"}:{_attrs:{ref:e.ref},_name:"dependency"},"dependencyToXmlElement");export{yn as b,_n as s,M as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var pa=Object.defineProperty;var c=(h,n)=>pa(h,"name",{value:n,configurable:!0});import{createRequire as da}from"node:module";import{b as va,n as Do,B as Ji}from"../packem_chunks/config.js";import{K as ci,M as Be,i as Aa,z as ba}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{bf as Ca,bg as $a}from"../packem_chunks/bin.js";import"./index-
|
|
1
|
+
var pa=Object.defineProperty;var c=(h,n)=>pa(h,"name",{value:n,configurable:!0});import{createRequire as da}from"node:module";import{b as va,n as Do,B as Ji}from"../packem_chunks/config.js";import{K as ci,M as Be,i as Aa,z as ba}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{bf as Ca,bg as $a}from"../packem_chunks/bin.js";import"./index-CS6a2wFB.js";const ha=da(import.meta.url),vr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ga=c(h=>{if(typeof vr<"u"&&vr.versions&&vr.versions.node){const[n,m]=vr.versions.node.split(".").map(Number);if(n>22||n===22&&m>=3||n===20&&m>=16)return vr.getBuiltinModule(h)}return ha(h)},"__cjs_getBuiltinModule"),{cpSync:No,lstatSync:ma,readdirSync:ya,existsSync:Mo,rmSync:si,readFileSync:Vi}=ga("node:fs");var Sa=Object.defineProperty,Ea=c((h,n)=>Sa(h,"name",{value:n,configurable:!0}),"t");class ft extends Error{static{c(this,"LockfilePruneError")}static{Ea(this,"LockfilePruneError")}constructor(n){super(n),this.name="LockfilePruneError"}}var wa=Object.defineProperty,Bt=c((h,n)=>wa(h,"name",{value:n,configurable:!0}),"p$2");const qo=Bt(h=>{let n=h.startsWith("/")?h.slice(1):h;const m=n.indexOf("(");return m!==-1&&(n=n.slice(0,m)),n},"canonicalKey"),ka=Bt((h,n)=>{if(!(n.startsWith("link:")||n.startsWith("file:")||n.startsWith("workspace:")))return`${h}@${n}`},"resolveDepKey"),xa=Bt(h=>{const n=[];for(const m of[h.dependencies,h.devDependencies,h.optionalDependencies])if(m)for(const[v,$]of Object.entries(m))$?.version&&n.push({name:v,version:$.version});return n},"collectImporterDeps"),Ki=Bt(h=>{const n=[];for(const m of[h.dependencies,h.optionalDependencies])if(m)for(const[v,$]of Object.entries(m))typeof $=="string"&&n.push({name:v,version:$});return n},"collectPackageDeps"),Gi=Bt(h=>{const n=new Map;if(!h)return n;for(const m of Object.keys(h)){const v=qo(m),$=n.get(v);$?$.push(m):n.set(v,[m])}return n},"buildKeyIndex"),Yo=Bt(h=>{const n=h.displayName??"pnpm-lock.yaml",m=typeof h.lockfileContent=="string"?h.lockfileContent:h.lockfileContent.toString("utf8");let v;try{v=Ca(m)}catch(oe){throw new ft(`${n}: parse failed — ${oe.message}`)}const $=Bt(oe=>oe.packages?Object.keys(oe.packages).length:0,"packageCount");let a;for(const oe of v){const[T]=oe.errors;if(T)throw new ft(`${n}: parse failed — ${T.message}`);const ne=oe.toJS();if(!ne||typeof ne!="object")continue;const me=ne;(a===void 0||$(me)>$(a))&&(a=me)}if(a===void 0)throw new ft(`${n}: top-level value is not an object`);const g=a.importers??{},e=Gi(a.packages),C=Gi(a.snapshots),k=new Set(["."]);for(const oe of h.closure)k.add(oe.relativeRoot===""?".":oe.relativeRoot);const b={};for(const[oe,T]of Object.entries(g))k.has(oe)&&(b[oe]=T);const S=new Set,O=new Set,H=[];for(const oe of Object.values(b))for(const T of xa(oe))H.push(T);for(;H.length>0;){const{name:oe,version:T}=H.shift(),ne=ka(oe,T);if(!ne)continue;const me=qo(ne),U=C.get(me)??C.get(ne)??[];for(const be of U){if(O.has(be))continue;O.add(be);const ye=a.snapshots?.[be];if(ye)for(const je of Ki(ye))H.push(je)}const ue=e.get(me)??e.get(ne)??[];for(const be of ue){if(S.has(be))continue;S.add(be);const ye=a.packages?.[be];if(ye&&!a.snapshots)for(const je of Ki(ye))H.push(je)}}const A={lockfileVersion:a.lockfileVersion};for(const oe of["settings","overrides","patchedDependencies","catalogs"])a[oe]!==void 0&&(A[oe]=a[oe]);if(A.importers=b,a.packages){const oe={};for(const T of Object.keys(a.packages))S.has(T)&&(oe[T]=a.packages[T]);A.packages=oe}if(a.snapshots){const oe={};for(const T of Object.keys(a.snapshots))O.has(T)&&(oe[T]=a.snapshots[T]);A.snapshots=oe}const y=Object.keys(a.packages??{}).length,E=Object.keys(A.packages??{}).length,X=y-E,fe=Object.keys(g).length-Object.keys(b).length;return{content:$a(A,{lineWidth:0}),message:`${n}: kept ${E}/${y} packages and ${Object.keys(b).length} importers (dropped ${X} packages, ${fe} importers)`,status:"pruned"}},"prunePnpmLockfile");var Oa=Object.defineProperty,ja=c((h,n)=>Oa(h,"name",{value:n,configurable:!0}),"p$1");const _a=ja(h=>Yo({...h,displayName:h.displayName??"aube-lock.yaml"}),"pruneAubeLockfile");var Ta=Object.defineProperty,Sr=c((h,n)=>Ta(h,"name",{value:n,configurable:!0}),"p");const Ra=Sr(h=>{let n="",m=!1,v=!1,$=!1;for(let a=0;a<h.length;a+=1){const g=h[a],e=h[a+1];if(v){g===`
|
|
2
2
|
`&&(v=!1,n+=g);continue}if($){g==="*"&&e==="/"&&($=!1,a+=1);continue}if(m){if(g==="\\"){n+=g,e!==void 0&&(n+=e,a+=1);continue}g==='"'&&(m=!1),n+=g;continue}if(g==='"'){m=!0,n+=g;continue}if(g==="/"&&e==="/"){v=!0,a+=1;continue}if(g==="/"&&e==="*"){$=!0,a+=1;continue}n+=g}return n},"stripJsonComments"),La=Sr(h=>{const n=[];for(const m of[h.dependencies,h.devDependencies,h.optionalDependencies,h.peerDependencies])if(m)for(const[v,$]of Object.entries(m))typeof $=="string"&&n.push({name:v,spec:$});return n},"collectWorkspaceDeps"),Fa=Sr(h=>{for(const n of h)if(typeof n=="object"&&!Array.isArray(n))return n},"extractMetadata"),Pa=Sr(h=>{if(!h)return[];const n=[];for(const m of["dependencies","optionalDependencies","peerDependencies"]){const v=h[m];v!==null&&typeof v=="object"&&!Array.isArray(v)&&n.push(...Object.keys(v))}return n},"collectMetadataDeps"),Ia=Sr(h=>{if(Buffer.isBuffer(h.lockfileContent))return{message:"bun.lockb is binary; run `bun install --save-text-lockfile` to regenerate as bun.lock, then rerun `vis docker scaffold`.",status:"skipped"};const n=Ra(h.lockfileContent);let m;try{m=JSON.parse(n)}catch(y){throw new ft(`bun.lock: parse failed — ${y.message}`)}if(!m||typeof m!="object")throw new ft("bun.lock: top-level value is not an object");const v=m.workspaces??{},$=m.packages??{},a=new Set([""]);for(const y of h.closure)a.add(y.relativeRoot===""?"":y.relativeRoot);const g={},e=[];for(const[y,E]of Object.entries(v))a.has(y)&&(g[y]=E,e.push(...La(E)));const C=new Set;for(const{name:y}of e)C.add(y);const k=[...C];for(;k.length>0;){const y=k.shift();for(const E of Object.keys($)){if(E.split("/")[0]!==y&&E!==y)continue;const X=Fa($[E]);for(const fe of Pa(X))C.has(fe)||(C.add(fe),k.push(fe))}}const b={};for(const[y,E]of Object.entries($)){const X=y.split("/")[0];(C.has(X)||C.has(y))&&(b[y]=E)}const S={...m,packages:b,workspaces:g},O=Object.keys($).length,H=Object.keys(b).length,A=O-H;return{content:`${JSON.stringify(S,null,2)}
|
|
3
3
|
`,message:`bun.lock: kept ${H}/${O} packages (dropped ${A})`,status:"pruned"}},"pruneBunLockfile");var Na=Object.defineProperty,li=c((h,n)=>Na(h,"name",{value:n,configurable:!0}),"k");const _n="node_modules/",Ma=li((h,n,m)=>{let v=n;for(;;){const $=v===""?`${_n}${m}`:`${v}/${_n}${m}`;if(h[$]!==void 0)return $;if(v==="")return;const a=v.lastIndexOf(`/${_n.slice(0,-1)}/`);v=a===-1?"":v.slice(0,a)}},"resolveDep"),Da=li(h=>{const n=[];for(const m of[h.dependencies,h.devDependencies,h.optionalDependencies,h.peerDependencies])if(m)for(const v of Object.keys(m))n.push(v);return n},"collectDepNames"),qa=li(h=>{const n=h.displayName??"package-lock.json",m=typeof h.lockfileContent=="string"?h.lockfileContent:h.lockfileContent.toString("utf8");let v;try{v=JSON.parse(m)}catch(A){throw new ft(`${n}: parse failed — ${A.message}`)}if(!v||typeof v!="object")throw new ft(`${n}: top-level value is not an object`);const $=v.packages??{},a=new Set([""]);for(const A of h.closure)A.relativeRoot!==""&&a.add(A.relativeRoot);const g=new Set,e=[];for(const A of Object.keys($))a.has(A)&&(g.add(A),e.push(A));for(const[A,y]of Object.entries($))y.link===!0&&typeof y.resolved=="string"&&a.has(y.resolved)&&g.add(A);for(;e.length>0;){const A=e.shift(),y=$[A];if(y)for(const E of Da(y)){const X=Ma($,A,E);if(!X||g.has(X))continue;g.add(X);const fe=$[X];fe.link===!0&&typeof fe.resolved=="string"&&$[fe.resolved]!==void 0&&!g.has(fe.resolved)?(g.add(fe.resolved),e.push(fe.resolved)):e.push(X)}}const C={};for(const A of Object.keys($))g.has(A)&&(C[A]=$[A]);const k=C[""];k&&Array.isArray(k.workspaces)&&(k.workspaces=k.workspaces.filter(A=>{if(typeof A!="string")return!1;const y=A.replace(/\/?\*+$/,"").replace(/\/$/,"");if(y===""||y==="*")return!0;for(const E of a)if(E===A||E===y||E.startsWith(`${y}/`))return!0;return!1}));const b={...v,packages:C};delete b.dependencies;const S=Object.keys($).length,O=Object.keys(C).length,H=S-O;return{content:`${JSON.stringify(b,null,2)}
|
|
4
4
|
`,message:`${n}: kept ${O}/${S} entries (dropped ${H})`,status:"pruned"}},"pruneNpmLockfile");var Tn={},Fe={},Rn,Qi;function Ya(){if(Qi)return Rn;Qi=1;var h=Object.defineProperty,n=c((a,g)=>h(a,"name",{value:g,configurable:!0}),"a");function m(a,g){function e(){this.constructor=a}c(e,"s"),n(e,"ctor"),e.prototype=g.prototype,a.prototype=new e}c(m,"peg$subclass"),n(m,"peg$subclass");function v(a,g,e,C){this.message=a,this.expected=g,this.found=e,this.location=C,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,v)}c(v,"peg$SyntaxError"),n(v,"peg$SyntaxError"),m(v,Error),v.buildMessage=function(a,g){var e={literal:n(function(A){return'"'+k(A.text)+'"'},"literal"),class:n(function(A){var y="",E;for(E=0;E<A.parts.length;E++)y+=A.parts[E]instanceof Array?b(A.parts[E][0])+"-"+b(A.parts[E][1]):b(A.parts[E]);return"["+(A.inverted?"^":"")+y+"]"},"class"),any:n(function(A){return"any character"},"any"),end:n(function(A){return"end of input"},"end"),other:n(function(A){return A.description},"other")};function C(A){return A.charCodeAt(0).toString(16).toUpperCase()}c(C,"T"),n(C,"hex");function k(A){return A.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+C(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+C(y)})}c(k,"q"),n(k,"literalEscape");function b(A){return A.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+C(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+C(y)})}c(b,"_"),n(b,"classEscape");function S(A){return e[A.type](A)}c(S,"re"),n(S,"describeExpectation");function O(A){var y=new Array(A.length),E,X;for(E=0;E<A.length;E++)y[E]=S(A[E]);if(y.sort(),y.length>0){for(E=1,X=1;E<y.length;E++)y[E-1]!==y[E]&&(y[X]=y[E],X++);y.length=X}switch(y.length){case 1:return y[0];case 2:return y[0]+" or "+y[1];default:return y.slice(0,-1).join(", ")+", or "+y[y.length-1]}}c(O,"le"),n(O,"describeExpected");function H(A){return A?'"'+k(A)+'"':"end of input"}return c(H,"te"),n(H,"describeFound"),"Expected "+O(a)+" but "+H(g)+" found."};function $(a,g){g=g!==void 0?g:{};var e={},C={Start:pn},k=pn,b=n(function(t){return t||[]},"peg$c0"),S=n(function(t,o,u){return[{command:t,type:o}].concat(u||[])},"peg$c1"),O=n(function(t,o){return[{command:t,type:o||";"}]},"peg$c2"),H=n(function(t){return t},"peg$c3"),A=";",y=ce(";",!1),E="&",X=ce("&",!1),fe=n(function(t,o){return o?{chain:t,then:o}:{chain:t}},"peg$c8"),oe=n(function(t,o){return{type:t,line:o}},"peg$c9"),T="&&",ne=ce("&&",!1),me="||",U=ce("||",!1),ue=n(function(t,o){return o?{...t,then:o}:t},"peg$c14"),be=n(function(t,o){return{type:t,chain:o}},"peg$c15"),ye="|&",je=ce("|&",!1),Me="|",De=ce("|",!1),qe="=",rt=ce("=",!1),Ee=n(function(t,o){return{name:t,args:[o]}},"peg$c22"),He=n(function(t){return{name:t,args:[]}},"peg$c23"),Ge="(",Qe=ce("(",!1),re=")",Pe=ce(")",!1),We=n(function(t,o){return{type:"subshell",subshell:t,args:o}},"peg$c28"),ke="{",xe=ce("{",!1),$e="}",Le=ce("}",!1),Ae=n(function(t,o){return{type:"group",group:t,args:o}},"peg$c33"),Ye=n(function(t,o){return{type:"command",args:o,envs:t}},"peg$c34"),Ue=n(function(t){return{type:"envs",envs:t}},"peg$c35"),Ve=n(function(t){return t},"peg$c36"),Je=n(function(t){return t},"peg$c37"),q=/^[0-9]/,W=Ze([["0","9"]],!1,!1),se=n(function(t,o,u){return{type:"redirection",subtype:o,fd:t!==null?parseInt(t):null,args:[u]}},"peg$c40"),Ce=">>",nt=ce(">>",!1),at=">&",st=ce(">&",!1),At=">",Ke=ce(">",!1),pt="<<<",et=ce("<<<",!1),ze="<&",dt=ce("<&",!1),bt="<",ht=ce("<",!1),r=n(function(t){return{type:"argument",segments:[].concat(...t)}},"peg$c53"),_=n(function(t){return t},"peg$c54"),R="$'",z=ce("$'",!1),Y="'",l=ce("'",!1),w=n(function(t){return[{type:"text",text:t}]},"peg$c59"),L='""',F=ce('""',!1),D=n(function(){return{type:"text",text:""}},"peg$c62"),V='"',P=ce('"',!1),Z=n(function(t){return t},"peg$c65"),J=n(function(t){return{type:"arithmetic",arithmetic:t,quoted:!0}},"peg$c66"),ie=n(function(t){return{type:"shell",shell:t,quoted:!0}},"peg$c67"),ve=n(function(t){return{type:"variable",...t,quoted:!0}},"peg$c68"),pe=n(function(t){return{type:"text",text:t}},"peg$c69"),_e=n(function(t){return{type:"arithmetic",arithmetic:t,quoted:!1}},"peg$c70"),Qr=n(function(t){return{type:"shell",shell:t,quoted:!1}},"peg$c71"),zr=n(function(t){return{type:"variable",...t,quoted:!1}},"peg$c72"),wr=n(function(t){return{type:"glob",pattern:t}},"peg$c73"),Ut=/^[^']/,Wt=Ze(["'"],!0,!1),wt=n(function(t){return t.join("")},"peg$c76"),kr=/^[^$"]/,xr=Ze(["$",'"'],!0,!1),tr=`\\
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var D=Object.defineProperty;var v=(t,e)=>D(t,"name",{value:e,configurable:!0});import{m as w,D as C,g as S,f as A}from"./provenance-CdvMwB2R.js";import{L as m}from"../packem_chunks/bin.js";import{x as W}from"./build-scripts-3E2pmscY.js";import{n as b}from"./license-zZU7aavK.js";import{a as j,C as F,$ as U}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{F as E}from"./lockfile-BG1HvBzH.js";import{L as N}from"./dependency-scan-s2MD0vi-.js";var I=Object.defineProperty,L=v((t,e)=>I(t,"name",{value:e,configurable:!0}),"i");const g={CRITICAL:0,HIGH:1,LOW:3,MODERATE:2,UNKNOWN:4},we=L((t,e)=>{const i=g[(t.vulnerability.severity??"UNKNOWN").toUpperCase()]??4,n=g[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??4;return i-n||t.packageName.localeCompare(e.packageName)||t.packageVersion.localeCompare(e.packageVersion)},"compareFindingsForDisplay"),M=L((t,e)=>{const i=g[e.toUpperCase()]??2;return(g[t.toUpperCase()]??4)<=i},"severityPassesFilter"),P=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"];var V=Object.defineProperty,R=v((t,e)=>V(t,"name",{value:e,configurable:!0}),"r");const $=6e4,_=R((t,e,i)=>{for(const n of i)if(n===t||n===`${t}@${e}`||n.endsWith("*")&&t.startsWith(n.slice(0,-1)))return!0;return!1},"isExcluded"),T=R(async(t,e)=>{const i=e.security?.policies?.firstSeen;if(i?.minutes===void 0||i.minutes<=0)return[];const{minutes:n}=i,a=i.exclude??[],o=e.security?.acceptedRisks,c=n*$,s=Date.now();return(await w(t.packages,C,async r=>{if(_(r.name,r.version,a))return;const l=await S(r.name,{workspaceRoot:t.workspaceRoot});if(l===void 0)return;const p=l.time?.[r.version];if(p===void 0)return;const u=Date.parse(p);if(Number.isNaN(u))return;const f=s-u;if(f>=c)return;const k=Math.max(0,Math.floor(f/$));return{acceptedRisk:m(r.name,r.version,o,"firstSeen"),data:{ageMinutes:k,minimumMinutes:n,publishedAt:p},packageName:r.name,policy:"firstSeen",reason:`${r.name}@${r.version} was published ${String(k)} min ago — below the ${String(n)} min firstSeen cooldown.`,severity:"block",version:r.version}})).filter(r=>r!==void 0)},"evaluateFirstSeenPolicy");var K=Object.defineProperty,H=v((t,e)=>K(t,"name",{value:e,configurable:!0}),"n");const q=H((t,e)=>{const i=e.security?.policies?.installScripts;if(!i)return[];const n=i.allow??{},a=i.strict===!0;if(!a&&Object.keys(n).length===0)return[];const o=W(t.workspaceRoot,n,{pinVersions:e.security?.pinVersions===!0});if(o.unapproved.length===0)return[];const c=e.security?.acceptedRisks,s=a?"block":"warn";return o.unapproved.map(r=>({acceptedRisk:m(r.name,r.version??"*",c,"installScripts"),data:{hooks:r.hooks},packageName:r.name,policy:"installScripts",reason:`${r.name}${r.version?`@${r.version}`:""} declares unapproved build script(s): ${r.hooks.join(", ")}`,severity:s,version:r.version??"*"}))},"evaluateInstallScriptsPolicy");var z=Object.defineProperty,y=v((t,e)=>z(t,"name",{value:e,configurable:!0}),"a");const Y=new Set(["AND","OR"]),B=y(t=>{const e=t.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(a=>a.trim()).filter(a=>a.length>0),i=[];let n=!1;for(const a of e){const o=a.toUpperCase();if(n){n=!1;continue}if(o==="WITH"){n=!0;continue}if(Y.has(o))continue;const c=a.endsWith("+"),s=c?a.slice(0,-1):a,r=b(s)??s;i.push(r),c&&i.push(`${r}-or-later`)}return i},"extractSpdxLeaves"),G=y(t=>{if(typeof t.license=="string"){const e=t.license.trim();return e.length>0?e:void 0}if(t.license&&typeof t.license=="object"&&typeof t.license.type=="string"){const e=t.license.type.trim();if(e.length>0)return e}if(Array.isArray(t.licenses)&&t.licenses.length>0){const e=t.licenses.map(i=>i&&typeof i.type=="string"?i.type.trim():"").filter(i=>i.length>0);if(e.length>0)return e.length===1?e[0]:`(${e.join(" OR ")})`}},"declaredLicense"),J=y((t,e)=>{if(e.length===0)return;const i=new Set(e.map(n=>b(n)??n).map(n=>n.toLowerCase()));for(const n of t)if(i.has(n.toLowerCase()))return n},"findDeniedLeaf"),Q=y((t,e)=>{if(e.length===0)return;const i=new Set(e.map(n=>b(n)??n).map(n=>n.toLowerCase()));for(const n of t)if(!i.has(n.toLowerCase()))return n},"findUnallowedLeaf"),X=y((t,e)=>{const i=e.security?.policies?.license;if(!i)return[];const n=i.allow??[],a=i.deny??[];if(n.length===0&&a.length===0)return[];const o=e.security?.acceptedRisks,c=[];for(const s of t.packages){const r=t.manifestData?.get(`${s.name}@${s.version}`),l=r?G(r):void 0;if(!l){n.length>0&&c.push({acceptedRisk:m(s.name,s.version,o,"license"),data:{declaredLicense:null},packageName:s.name,policy:"license",reason:`${s.name}@${s.version} declares no license; allow-list mode requires one of: ${n.join(", ")}`,severity:"block",version:s.version});continue}const p=B(l),u=J(p,a);if(u){c.push({acceptedRisk:m(s.name,s.version,o,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:s.name,policy:"license",reason:`${s.name}@${s.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:s.version});continue}const f=Q(p,n);f&&c.push({acceptedRisk:m(s.name,s.version,o,"license"),data:{allowList:n,declaredLicense:l,unallowedLicense:f},packageName:s.name,policy:"license",reason:`${s.name}@${s.version} uses license '${f}' which is not on the allow-list (declared: ${l})`,severity:"block",version:s.version})}return c},"evaluateLicensePolicy");var Z=Object.defineProperty,O=v((t,e)=>Z(t,"name",{value:e,configurable:!0}),"c$1");const ee=6e4,te=O((t,e,i)=>{for(const n of i)if(n===t||n===`${t}@${e}`||n.endsWith("*")&&t.startsWith(n.slice(0,-1)))return!0;return!1},"isExcluded"),ie=O(async(t,e)=>{const i=e.security?.policies?.publisherChange;if(i?.mode!=="no-downgrade")return[];const n=i.exclude??[],a=typeof i.ignoreAfter=="number"?i.ignoreAfter*ee:void 0,o=e.security?.acceptedRisks,c=Date.now();return(await w(t.packages,C,async s=>{if(te(s.name,s.version,n))return;const r=await S(s.name,{workspaceRoot:t.workspaceRoot});if(r===void 0)return;if(a!==void 0){const p=r.time?.[s.version],u=p===void 0?Number.NaN:Date.parse(p);if(!Number.isNaN(u)&&c-u>a)return}if(r.versions[s.version]?.dist?.attestations?.provenance!==void 0)return;const l=A(r,s.version);if(l!==void 0)return{acceptedRisk:m(s.name,s.version,o,"publisherChange"),data:{priorVersionWithProvenance:l},packageName:s.name,policy:"publisherChange",reason:`${s.name}@${s.version} dropped the provenance attestation that ${s.name}@${l} carried — publisher trust downgrade.`,severity:"block",version:s.version}})).filter(s=>s!==void 0)},"evaluatePublisherChangePolicy");var ne=Object.defineProperty,h=v((t,e)=>ne(t,"name",{value:e,configurable:!0}),"l$1");const se=h(t=>{for(const e of Object.values(N))for(const i of[e.file,...e.aliases??[]])if(t===i||t.endsWith(`/${i}`)||t.endsWith(`.${i}`))return e.type},"detectLockfileType"),re=h((t,e,i)=>{const n=j(e)?e:F(t,e);let a;try{a=U(n)}catch{return}const o=se(n)??N[i]?.type;if(!o)return;const c=E(a,o);if(c.length===0)return;const s=new Set;for(const r of c)s.add(`${r.name}@${r.version}`);return s},"loadBaselineKeys"),oe=h((t,e)=>{for(const i of e)if(i===t||i.endsWith("*")&&t.startsWith(i.slice(0,-1)))return!0;return!1},"matchesAllowList"),ae=h((t,e)=>{const i=e.security?.policies?.unexpectedDeps;if(!i)return[];const n=i.allow??[],a=i.baselineLockfile;if(n.length===0&&!a)return[];const o=a?re(t.workspaceRoot,a,t.packageManager):void 0,c=e.security?.acceptedRisks,s=[];for(const r of t.packages){const l=n.length===0||oe(r.name,n),p=o?o.has(`${r.name}@${r.version}`):!0;if(l&&p)continue;const u=[],f={};l||(u.push(`not on allow-list (${n.length} entr${n.length===1?"y":"ies"})`),f.allowList=n),!p&&o&&(u.push(`not present in baseline lockfile (${a})`),f.baselineLockfile=a),s.push({acceptedRisk:m(r.name,r.version,c,"unexpectedDeps"),data:f,packageName:r.name,policy:"unexpectedDeps",reason:`${r.name}@${r.version} is unexpected: ${u.join("; ")}`,severity:"block",version:r.version})}return s},"evaluateUnexpectedDepsPolicy");var ce=Object.defineProperty,le=v((t,e)=>ce(t,"name",{value:e,configurable:!0}),"c");const ue=le((t,e)=>{if(!t.osvFindings||t.osvFindings.size===0)return[];const i=e.security?.policies?.vulnerability?.failOn,n=e.security?.acceptedRisks,a=[];for(const o of t.packages){const c=t.osvFindings.get(o.name);if(!(!c||c.length===0))for(const s of c){const r=i?M(s.severity,i)?"block":"warn":"info";a.push({acceptedRisk:m(o.name,o.version,n,"vulnerability"),data:{advisoryId:s.id,aliases:s.aliases??[],cvssScore:s.cvssScore,fixedVersions:s.fixedVersions,severity:s.severity,summary:s.summary},packageName:o.name,policy:"vulnerability",reason:`${s.severity} ${s.id} affects ${o.name}@${o.version}: ${s.summary}`,severity:r,version:o.version})}}return a},"evaluateVulnerabilityPolicy");var pe=Object.defineProperty,d=v((t,e)=>pe(t,"name",{value:e,configurable:!0}),"t");const x=[{evaluate:ue,isConfigured:d(t=>t.security?.policies?.vulnerability!==void 0,"isConfigured"),name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:X,isConfigured:d(t=>{const e=t.security?.policies?.license;return!!(e&&(e.allow&&e.allow.length>0||e.deny&&e.deny.length>0))},"isConfigured"),name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:q,isConfigured:d(t=>{const e=t.security?.policies?.installScripts;return!!(e&&(e.allow&&Object.keys(e.allow).length>0||e.strict===!0))},"isConfigured"),name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:ae,isConfigured:d(t=>{const e=t.security?.policies?.unexpectedDeps;return!!(e&&(e.allow&&e.allow.length>0||typeof e.baselineLockfile=="string"))},"isConfigured"),name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:T,isConfigured:d(t=>{const e=t.security?.policies?.firstSeen?.minutes;return typeof e=="number"&&e>0},"isConfigured"),name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:ie,isConfigured:d(t=>t.security?.policies?.publisherChange?.mode==="no-downgrade","isConfigured"),name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],fe=d((t,e,i)=>x.filter(n=>n.surfaces.includes(t)?i!==void 0?i.has(n.name):n.isConfigured(e):!1),"selectModules"),Ce=d(async(t,e,i)=>{const n=fe(e,i.visConfig,i.enabledPolicies),a=[];for(const o of n){if(t.offline&&!o.offlineSupported){a.push({packageName:"*",policy:o.name,reason:`policy.${o.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const c=await o.evaluate(t,i.visConfig);a.push(...c)}catch(c){const s=c instanceof Error?c.message:String(c);a.push({packageName:"*",policy:o.name,reason:`policy.${o.name} failed: ${s}`,severity:"info",version:"*"})}}return a},"evaluatePolicies"),de=(()=>{const t=new Map;for(const e of P)t.set(e.toLowerCase(),e);return t})(),Se=d(()=>x.map(t=>t.name),"getRegisteredPolicyNames"),Ne=d((t,e)=>{if(t===void 0)return;const i=t.trim().toLowerCase();if(i===""||i==="none")return new Set;if(i==="all")return new Set(P);const n=new Set;for(const a of t.split(",").map(o=>o.trim()).filter(o=>o.length>0)){const o=a.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(s,r)=>r.toUpperCase()),c=de.get(o.toLowerCase());c===void 0?e?.(a):n.add(c)}return n},"parsePoliciesFlag");export{we as c,Ce as e,Se as g,Ne as p,M as s};
|
|
1
|
+
var D=Object.defineProperty;var v=(t,e)=>D(t,"name",{value:e,configurable:!0});import{m as w,D as C,g as S,f as A}from"./provenance-BsBn1f5S.js";import{L as m}from"../packem_chunks/bin.js";import{x as W}from"./build-scripts-3E2pmscY.js";import{n as b}from"./license-zZU7aavK.js";import{a as j,C as F,$ as U}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{F as E}from"./lockfile-BG1HvBzH.js";import{L as N}from"./dependency-scan-s2MD0vi-.js";var I=Object.defineProperty,L=v((t,e)=>I(t,"name",{value:e,configurable:!0}),"i");const g={CRITICAL:0,HIGH:1,LOW:3,MODERATE:2,UNKNOWN:4},we=L((t,e)=>{const i=g[(t.vulnerability.severity??"UNKNOWN").toUpperCase()]??4,n=g[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??4;return i-n||t.packageName.localeCompare(e.packageName)||t.packageVersion.localeCompare(e.packageVersion)},"compareFindingsForDisplay"),M=L((t,e)=>{const i=g[e.toUpperCase()]??2;return(g[t.toUpperCase()]??4)<=i},"severityPassesFilter"),P=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"];var V=Object.defineProperty,R=v((t,e)=>V(t,"name",{value:e,configurable:!0}),"r");const $=6e4,_=R((t,e,i)=>{for(const n of i)if(n===t||n===`${t}@${e}`||n.endsWith("*")&&t.startsWith(n.slice(0,-1)))return!0;return!1},"isExcluded"),T=R(async(t,e)=>{const i=e.security?.policies?.firstSeen;if(i?.minutes===void 0||i.minutes<=0)return[];const{minutes:n}=i,a=i.exclude??[],o=e.security?.acceptedRisks,c=n*$,s=Date.now();return(await w(t.packages,C,async r=>{if(_(r.name,r.version,a))return;const l=await S(r.name,{workspaceRoot:t.workspaceRoot});if(l===void 0)return;const p=l.time?.[r.version];if(p===void 0)return;const u=Date.parse(p);if(Number.isNaN(u))return;const f=s-u;if(f>=c)return;const k=Math.max(0,Math.floor(f/$));return{acceptedRisk:m(r.name,r.version,o,"firstSeen"),data:{ageMinutes:k,minimumMinutes:n,publishedAt:p},packageName:r.name,policy:"firstSeen",reason:`${r.name}@${r.version} was published ${String(k)} min ago — below the ${String(n)} min firstSeen cooldown.`,severity:"block",version:r.version}})).filter(r=>r!==void 0)},"evaluateFirstSeenPolicy");var K=Object.defineProperty,H=v((t,e)=>K(t,"name",{value:e,configurable:!0}),"n");const q=H((t,e)=>{const i=e.security?.policies?.installScripts;if(!i)return[];const n=i.allow??{},a=i.strict===!0;if(!a&&Object.keys(n).length===0)return[];const o=W(t.workspaceRoot,n,{pinVersions:e.security?.pinVersions===!0});if(o.unapproved.length===0)return[];const c=e.security?.acceptedRisks,s=a?"block":"warn";return o.unapproved.map(r=>({acceptedRisk:m(r.name,r.version??"*",c,"installScripts"),data:{hooks:r.hooks},packageName:r.name,policy:"installScripts",reason:`${r.name}${r.version?`@${r.version}`:""} declares unapproved build script(s): ${r.hooks.join(", ")}`,severity:s,version:r.version??"*"}))},"evaluateInstallScriptsPolicy");var z=Object.defineProperty,y=v((t,e)=>z(t,"name",{value:e,configurable:!0}),"a");const Y=new Set(["AND","OR"]),B=y(t=>{const e=t.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(a=>a.trim()).filter(a=>a.length>0),i=[];let n=!1;for(const a of e){const o=a.toUpperCase();if(n){n=!1;continue}if(o==="WITH"){n=!0;continue}if(Y.has(o))continue;const c=a.endsWith("+"),s=c?a.slice(0,-1):a,r=b(s)??s;i.push(r),c&&i.push(`${r}-or-later`)}return i},"extractSpdxLeaves"),G=y(t=>{if(typeof t.license=="string"){const e=t.license.trim();return e.length>0?e:void 0}if(t.license&&typeof t.license=="object"&&typeof t.license.type=="string"){const e=t.license.type.trim();if(e.length>0)return e}if(Array.isArray(t.licenses)&&t.licenses.length>0){const e=t.licenses.map(i=>i&&typeof i.type=="string"?i.type.trim():"").filter(i=>i.length>0);if(e.length>0)return e.length===1?e[0]:`(${e.join(" OR ")})`}},"declaredLicense"),J=y((t,e)=>{if(e.length===0)return;const i=new Set(e.map(n=>b(n)??n).map(n=>n.toLowerCase()));for(const n of t)if(i.has(n.toLowerCase()))return n},"findDeniedLeaf"),Q=y((t,e)=>{if(e.length===0)return;const i=new Set(e.map(n=>b(n)??n).map(n=>n.toLowerCase()));for(const n of t)if(!i.has(n.toLowerCase()))return n},"findUnallowedLeaf"),X=y((t,e)=>{const i=e.security?.policies?.license;if(!i)return[];const n=i.allow??[],a=i.deny??[];if(n.length===0&&a.length===0)return[];const o=e.security?.acceptedRisks,c=[];for(const s of t.packages){const r=t.manifestData?.get(`${s.name}@${s.version}`),l=r?G(r):void 0;if(!l){n.length>0&&c.push({acceptedRisk:m(s.name,s.version,o,"license"),data:{declaredLicense:null},packageName:s.name,policy:"license",reason:`${s.name}@${s.version} declares no license; allow-list mode requires one of: ${n.join(", ")}`,severity:"block",version:s.version});continue}const p=B(l),u=J(p,a);if(u){c.push({acceptedRisk:m(s.name,s.version,o,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:s.name,policy:"license",reason:`${s.name}@${s.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:s.version});continue}const f=Q(p,n);f&&c.push({acceptedRisk:m(s.name,s.version,o,"license"),data:{allowList:n,declaredLicense:l,unallowedLicense:f},packageName:s.name,policy:"license",reason:`${s.name}@${s.version} uses license '${f}' which is not on the allow-list (declared: ${l})`,severity:"block",version:s.version})}return c},"evaluateLicensePolicy");var Z=Object.defineProperty,O=v((t,e)=>Z(t,"name",{value:e,configurable:!0}),"c$1");const ee=6e4,te=O((t,e,i)=>{for(const n of i)if(n===t||n===`${t}@${e}`||n.endsWith("*")&&t.startsWith(n.slice(0,-1)))return!0;return!1},"isExcluded"),ie=O(async(t,e)=>{const i=e.security?.policies?.publisherChange;if(i?.mode!=="no-downgrade")return[];const n=i.exclude??[],a=typeof i.ignoreAfter=="number"?i.ignoreAfter*ee:void 0,o=e.security?.acceptedRisks,c=Date.now();return(await w(t.packages,C,async s=>{if(te(s.name,s.version,n))return;const r=await S(s.name,{workspaceRoot:t.workspaceRoot});if(r===void 0)return;if(a!==void 0){const p=r.time?.[s.version],u=p===void 0?Number.NaN:Date.parse(p);if(!Number.isNaN(u)&&c-u>a)return}if(r.versions[s.version]?.dist?.attestations?.provenance!==void 0)return;const l=A(r,s.version);if(l!==void 0)return{acceptedRisk:m(s.name,s.version,o,"publisherChange"),data:{priorVersionWithProvenance:l},packageName:s.name,policy:"publisherChange",reason:`${s.name}@${s.version} dropped the provenance attestation that ${s.name}@${l} carried — publisher trust downgrade.`,severity:"block",version:s.version}})).filter(s=>s!==void 0)},"evaluatePublisherChangePolicy");var ne=Object.defineProperty,h=v((t,e)=>ne(t,"name",{value:e,configurable:!0}),"l$1");const se=h(t=>{for(const e of Object.values(N))for(const i of[e.file,...e.aliases??[]])if(t===i||t.endsWith(`/${i}`)||t.endsWith(`.${i}`))return e.type},"detectLockfileType"),re=h((t,e,i)=>{const n=j(e)?e:F(t,e);let a;try{a=U(n)}catch{return}const o=se(n)??N[i]?.type;if(!o)return;const c=E(a,o);if(c.length===0)return;const s=new Set;for(const r of c)s.add(`${r.name}@${r.version}`);return s},"loadBaselineKeys"),oe=h((t,e)=>{for(const i of e)if(i===t||i.endsWith("*")&&t.startsWith(i.slice(0,-1)))return!0;return!1},"matchesAllowList"),ae=h((t,e)=>{const i=e.security?.policies?.unexpectedDeps;if(!i)return[];const n=i.allow??[],a=i.baselineLockfile;if(n.length===0&&!a)return[];const o=a?re(t.workspaceRoot,a,t.packageManager):void 0,c=e.security?.acceptedRisks,s=[];for(const r of t.packages){const l=n.length===0||oe(r.name,n),p=o?o.has(`${r.name}@${r.version}`):!0;if(l&&p)continue;const u=[],f={};l||(u.push(`not on allow-list (${n.length} entr${n.length===1?"y":"ies"})`),f.allowList=n),!p&&o&&(u.push(`not present in baseline lockfile (${a})`),f.baselineLockfile=a),s.push({acceptedRisk:m(r.name,r.version,c,"unexpectedDeps"),data:f,packageName:r.name,policy:"unexpectedDeps",reason:`${r.name}@${r.version} is unexpected: ${u.join("; ")}`,severity:"block",version:r.version})}return s},"evaluateUnexpectedDepsPolicy");var ce=Object.defineProperty,le=v((t,e)=>ce(t,"name",{value:e,configurable:!0}),"c");const ue=le((t,e)=>{if(!t.osvFindings||t.osvFindings.size===0)return[];const i=e.security?.policies?.vulnerability?.failOn,n=e.security?.acceptedRisks,a=[];for(const o of t.packages){const c=t.osvFindings.get(o.name);if(!(!c||c.length===0))for(const s of c){const r=i?M(s.severity,i)?"block":"warn":"info";a.push({acceptedRisk:m(o.name,o.version,n,"vulnerability"),data:{advisoryId:s.id,aliases:s.aliases??[],cvssScore:s.cvssScore,fixedVersions:s.fixedVersions,severity:s.severity,summary:s.summary},packageName:o.name,policy:"vulnerability",reason:`${s.severity} ${s.id} affects ${o.name}@${o.version}: ${s.summary}`,severity:r,version:o.version})}}return a},"evaluateVulnerabilityPolicy");var pe=Object.defineProperty,d=v((t,e)=>pe(t,"name",{value:e,configurable:!0}),"t");const x=[{evaluate:ue,isConfigured:d(t=>t.security?.policies?.vulnerability!==void 0,"isConfigured"),name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:X,isConfigured:d(t=>{const e=t.security?.policies?.license;return!!(e&&(e.allow&&e.allow.length>0||e.deny&&e.deny.length>0))},"isConfigured"),name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:q,isConfigured:d(t=>{const e=t.security?.policies?.installScripts;return!!(e&&(e.allow&&Object.keys(e.allow).length>0||e.strict===!0))},"isConfigured"),name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:ae,isConfigured:d(t=>{const e=t.security?.policies?.unexpectedDeps;return!!(e&&(e.allow&&e.allow.length>0||typeof e.baselineLockfile=="string"))},"isConfigured"),name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:T,isConfigured:d(t=>{const e=t.security?.policies?.firstSeen?.minutes;return typeof e=="number"&&e>0},"isConfigured"),name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:ie,isConfigured:d(t=>t.security?.policies?.publisherChange?.mode==="no-downgrade","isConfigured"),name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],fe=d((t,e,i)=>x.filter(n=>n.surfaces.includes(t)?i!==void 0?i.has(n.name):n.isConfigured(e):!1),"selectModules"),Ce=d(async(t,e,i)=>{const n=fe(e,i.visConfig,i.enabledPolicies),a=[];for(const o of n){if(t.offline&&!o.offlineSupported){a.push({packageName:"*",policy:o.name,reason:`policy.${o.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const c=await o.evaluate(t,i.visConfig);a.push(...c)}catch(c){const s=c instanceof Error?c.message:String(c);a.push({packageName:"*",policy:o.name,reason:`policy.${o.name} failed: ${s}`,severity:"info",version:"*"})}}return a},"evaluatePolicies"),de=(()=>{const t=new Map;for(const e of P)t.set(e.toLowerCase(),e);return t})(),Se=d(()=>x.map(t=>t.name),"getRegisteredPolicyNames"),Ne=d((t,e)=>{if(t===void 0)return;const i=t.trim().toLowerCase();if(i===""||i==="none")return new Set;if(i==="all")return new Set(P);const n=new Set;for(const a of t.split(",").map(o=>o.trim()).filter(o=>o.length>0)){const o=a.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(s,r)=>r.toUpperCase()),c=de.get(o.toLowerCase());c===void 0?e?.(a):n.add(c)}return n},"parsePoliciesFlag");export{we as c,Ce as e,Se as g,Ne as p,M as s};
|
|
@@ -26,4 +26,4 @@ ${s}`)}return`
|
|
|
26
26
|
${i}`},"getCause"),Nc=_((t,e)=>(t.length>0?`
|
|
27
27
|
`:"")+t.map(n=>et(n,e)).join(`
|
|
28
28
|
`),"getStacktrace"),Bn=_((t,e,n)=>{const i={cwd:Oc(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...e,color:{fileLine:_(l=>l,"fileLine"),gutter:_(l=>l,"gutter"),hint:_(l=>l,"hint"),marker:_(l=>l,"marker"),message:_(l=>l,"message"),method:_(l=>l,"method"),title:_(l=>l,"title"),...e.color}},r=Sn(t,{filter:e.filterStacktrace,frameLimit:i.framesMaxLimit}),o=r.shift();return[e.hideMessage?void 0:In(t,i,n),Mn(t,i,n),o?et(o,i,n):void 0,o&&!i.hideErrorCodeView?Vn(o,i,n):void 0,t instanceof AggregateError?Dn(t,i,n):void 0,t.cause===void 0?void 0:Un(t,i,n),r.length>0?Nc(r,i):void 0].filter(Boolean).join(`
|
|
29
|
-
`).replaceAll("\\","/")},"internalRenderError"),Cc=_((t,e={})=>{if(e.framesMaxLimit!==void 0&&e.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Bn(t,e,0)},"renderError");var jc=Object.defineProperty,kc=N((t,e)=>jc(t,"name",{value:e,configurable:!0}),"i$1"),_c=Object.defineProperty,Lc=kc((t,e)=>_c(t,"name",{value:e,configurable:!0}),"n"),Sc=Object.defineProperty,_t=Lc((t,e)=>Sc(t,"name",{value:e,configurable:!0}),"n");const Zc=_t((t={})=>({description:"Enhanced error handling and reporting with beautiful code frames",name:"error-handler",onError:_t((e,n)=>{const{logger:i,runtime:r}=n,{detailed:o=!1,exitOnError:l=!0,formatter:s,logErrors:p=!0,renderOptions:a={}}=t;if(p)if(s)i.error(s(e));else if(o){const c=r.getCwd(),d=Cc(e,{cwd:c,hideErrorCodeView:!1,hideErrorTitle:!1,hideMessage:!1,linesAbove:2,linesBelow:3,...a});i.error(d)}else i.error(e);l&&W(1)},"handleError"),version:"1.0.0"}),"errorHandlerPlugin");var Tc="1.0.0-alpha.
|
|
29
|
+
`).replaceAll("\\","/")},"internalRenderError"),Cc=_((t,e={})=>{if(e.framesMaxLimit!==void 0&&e.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Bn(t,e,0)},"renderError");var jc=Object.defineProperty,kc=N((t,e)=>jc(t,"name",{value:e,configurable:!0}),"i$1"),_c=Object.defineProperty,Lc=kc((t,e)=>_c(t,"name",{value:e,configurable:!0}),"n"),Sc=Object.defineProperty,_t=Lc((t,e)=>Sc(t,"name",{value:e,configurable:!0}),"n");const Zc=_t((t={})=>({description:"Enhanced error handling and reporting with beautiful code frames",name:"error-handler",onError:_t((e,n)=>{const{logger:i,runtime:r}=n,{detailed:o=!1,exitOnError:l=!0,formatter:s,logErrors:p=!0,renderOptions:a={}}=t;if(p)if(s)i.error(s(e));else if(o){const c=r.getCwd(),d=Cc(e,{cwd:c,hideErrorCodeView:!1,hideErrorTitle:!1,hideMessage:!1,linesAbove:2,linesBelow:3,...a});i.error(d)}else i.error(e);l&&W(1)},"handleError"),version:"1.0.0"}),"errorHandlerPlugin");var Tc="1.0.0-alpha.25";const Yc={version:Tc};var Ic=Object.defineProperty,Mc=N((t,e)=>Ic(t,"name",{value:e,configurable:!0}),"e");const Qc={argument:{description:"Package to execute (optionally with @version)",name:"package",type:String},description:"Execute a remote package without permanent installation",examples:[["vis dlx create-vite my-app","Scaffold a new project"],["vis dlx typescript@5.5.4 tsc --version","Run specific version"],["vis dlx -p cowsay -p lolcatjs -c 'echo hi | cowsay | lolcatjs'","Multiple packages with shell"],["vis install && vis dlx --offline typescript tsc --version","Hardened: pre-install + offline (no registry fetch on dlx)"]],group:"Run & Execute",loader:Mc(()=>import("../packem_chunks/handler9.js"),"loader"),name:"dlx",options:[{alias:"p",description:"Additional packages to install (repeatable)",multiple:!0,name:"package",type:String},{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output except command results",name:"silent",type:Boolean},{defaultValue:!1,description:"Resolve from local store only — fail rather than fetch from the registry. Pair with `vis install` for hardened npx-style workflows.",name:"offline",type:Boolean}]};export{Jc as N,Hc as T,Qc as a,H as b,Rc as c,A as d,al as e,Fc as f,il as g,Kc as i,Yc as m,se as n,Zc as w};
|