@visulima/vis 6.1.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +1226 -1216
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cargo-lock.js +5 -0
- package/dist/packem_chunks/cargo-plan.js +3 -3
- package/dist/packem_chunks/catalog-detector.js +1 -1
- package/dist/packem_chunks/catalog.js +1 -94
- package/dist/packem_chunks/catalog2.js +11 -0
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +156 -174
- package/dist/packem_chunks/context.js +8 -0
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler19.js +5 -5
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler31.js +1 -1
- package/dist/packem_chunks/handler32.js +1 -1
- package/dist/packem_chunks/handler33.js +1 -1
- package/dist/packem_chunks/handler34.js +3 -3
- package/dist/packem_chunks/handler35.js +1 -1
- package/dist/packem_chunks/handler36.js +1 -1
- package/dist/packem_chunks/handler38.js +2 -2
- package/dist/packem_chunks/handler39.js +5 -5
- package/dist/packem_chunks/handler4.js +4 -4
- package/dist/packem_chunks/handler40.js +1 -1
- package/dist/packem_chunks/handler41.js +1 -1
- package/dist/packem_chunks/handler42.js +1 -1
- package/dist/packem_chunks/handler43.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/handler47.js +1 -1
- package/dist/packem_chunks/handler48.js +1 -1
- package/dist/packem_chunks/handler49.js +1 -1
- package/dist/packem_chunks/handler5.js +4 -4
- package/dist/packem_chunks/handler50.js +5 -5
- package/dist/packem_chunks/handler52.js +1 -1
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler56.js +3 -3
- package/dist/packem_chunks/handler57.js +4 -4
- package/dist/packem_chunks/handler58.js +4 -4
- package/dist/packem_chunks/handler59.js +2 -2
- package/dist/packem_chunks/handler6.js +7 -7
- package/dist/packem_chunks/handler60.js +1 -1
- package/dist/packem_chunks/handler61.js +2 -2
- package/dist/packem_chunks/handler62.js +1 -1
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +3 -3
- package/dist/packem_chunks/handler65.js +2 -2
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +5 -5
- package/dist/packem_chunks/handler68.js +12 -25
- package/dist/packem_chunks/handler69.js +25 -22
- package/dist/packem_chunks/handler70.js +22 -10
- package/dist/packem_chunks/handler71.js +10 -133
- package/dist/packem_chunks/handler72.js +133 -23
- package/dist/packem_chunks/handler73.js +23 -323
- package/dist/packem_chunks/handler74.js +274 -659
- package/dist/packem_chunks/handler75.js +708 -48
- package/dist/packem_chunks/handler76.js +48 -27
- package/dist/packem_chunks/handler77.js +27 -3
- package/dist/packem_chunks/handler78.js +3 -191
- package/dist/packem_chunks/handler79.js +191 -0
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/heal.js +2 -2
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/index2.js +3 -58
- package/dist/packem_chunks/index3.js +40 -3
- package/dist/packem_chunks/index6.js +135 -7
- package/dist/packem_chunks/index7.js +7 -135
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/python-plan.js +3 -3
- package/dist/packem_chunks/python-projects.js +1 -1
- package/dist/packem_chunks/python.js +1 -0
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/state.js +2 -2
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/version-resolver.js +1 -1
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/ReleaseClient-CWD9BC5w.js +1 -0
- package/dist/packem_shared/advisories-BodWQ5DQ.js +1 -0
- package/dist/packem_shared/{affected-selection-DGb6Xu5K.js → affected-selection-QaMUnFqe.js} +1 -1
- package/dist/packem_shared/{ai-analysis-pldoS_N4.js → ai-analysis-D7jlbJky.js} +3 -3
- package/dist/packem_shared/ai-cache-iSIyY3So.js +1 -0
- package/dist/packem_shared/{ai-fix-D9MxigBQ.js → ai-fix-CgCyO65Q.js} +6 -6
- package/dist/packem_shared/apply-DoeQAAGm.js +6 -0
- package/dist/packem_shared/apply-release-plan-BalHtK-g.js +15 -0
- package/dist/packem_shared/{bin-AZQv95jh.js → bin-LyW9KY0i.js} +1 -1
- package/dist/packem_shared/clean-package-json-rutwkKl-.js +1 -0
- package/dist/packem_shared/createAdapter-DMK4bBET.js +1 -0
- package/dist/packem_shared/createVersionActions-DXo4z8VN.js +1 -0
- package/dist/packem_shared/dependency-scan-DFnt1mni.js +1 -0
- package/dist/packem_shared/{ecosystem-gate-DiqQj0LJ.js → ecosystem-gate-Bdz-gK_Y.js} +1 -1
- package/dist/packem_shared/env-BSXG3QKH.js +4 -0
- package/dist/packem_shared/failure-log-DIsKBKaI.js +2 -0
- package/dist/packem_shared/formatBytes-_HvjOy8a-iHCer6uX.js +1 -0
- package/dist/packem_shared/glob-Cyk1H9ZL-DRlUeuow.js +1 -0
- package/dist/packem_shared/{index-JRb5wabN.js → index-B1ZsG3oa.js} +1 -1
- package/dist/packem_shared/index-CgNfNk12.js +1 -0
- package/dist/packem_shared/lifecycle-CQjeMPY0.js +2 -0
- package/dist/packem_shared/missing-package-json-dtwl6w-S.js +1 -0
- package/dist/packem_shared/multi-eco-lockfiles-CyIfYw4u.js +1 -0
- package/dist/packem_shared/npmrc-CHsOyMvA.js +2 -0
- package/dist/packem_shared/osv-C53WUoSW.js +1 -0
- package/dist/packem_shared/{package-version-KLwH0Ivy.js → package-version-DqYSd_ia.js} +1 -1
- package/dist/packem_shared/packument-CbTmbHU4.js +1 -0
- package/dist/packem_shared/{project-name-filter-B1ZCsbOW.js → project-name-filter-mwTJC1IK.js} +1 -1
- package/dist/packem_shared/{provenance-L1M2FPy_.js → provenance-SX1MxPUZ.js} +1 -1
- package/dist/packem_shared/publish-Dc0XGH3K.js +34 -0
- package/dist/packem_shared/registry-CkoaWkjP.js +81 -0
- package/dist/packem_shared/registry-keys-z038Ecb4.js +1 -0
- package/dist/packem_shared/removeSync-g1D5kONg-LbjATA8v.js +1 -0
- package/dist/packem_shared/renderToString-DR0zDUjh-C7p-L6AO.js +3 -0
- package/dist/packem_shared/{resolve-explicit-CQa37JSq.js → resolve-explicit-D9kdTNvl.js} +1 -1
- package/dist/packem_shared/{run-D-uVGHQ4.js → run-DLvd3RIZ.js} +1 -1
- package/dist/packem_shared/run-summary-utils-CMeURYtS.js +1 -0
- package/dist/packem_shared/s1ngularity-BuU9Cxpy.js +1 -0
- package/dist/packem_shared/{scaffold-files-DVyfB0yz.js → scaffold-files-Bje3_Ixv.js} +1 -1
- package/dist/packem_shared/scan-progress-D8ojNcKt.js +2 -0
- package/dist/packem_shared/{signatures-DIqFUOfs.js → signatures-CeL0bOEo.js} +1 -1
- package/dist/packem_shared/spinner-Bqjpz3i4.js +1 -0
- package/dist/packem_shared/table-DDAJalPF.js +1 -0
- package/dist/packem_shared/tabs-CC0GJLww.js +1 -0
- package/dist/packem_shared/{task-env-DzR4RkOj.js → task-env-C2lmxvzA.js} +1 -1
- package/dist/packem_shared/typosquats-BFKus_aM.js +1 -0
- package/dist/packem_shared/use-measured-height-_nYuZ-Au.js +1 -0
- package/dist/packem_shared/vis-update-app-Ba5ce8Jd.js +1 -0
- package/dist/packem_shared/{vis-user-error-CRmrBaD1.js → vis-user-error-D_ekz9rF.js} +1 -1
- package/dist/packem_shared/{watch-loop-D1_e-qIl.js → watch-loop-DWr41vHM.js} +1 -1
- package/dist/packem_shared/xxh3-BLHlvhgT.js +1 -0
- package/dist/release/core/package-managers/index.js +1 -1
- package/dist/release/core/version-actions/index.js +1 -1
- package/dist/release/index.js +1 -1
- package/index.js +26 -26
- package/package.json +9 -9
- package/dist/packem_chunks/orchestrator.js +0 -46
- package/dist/packem_shared/ReleaseClient-DAvbxCdo.js +0 -1
- package/dist/packem_shared/createAdapter-F7GidOzU.js +0 -1
- package/dist/packem_shared/createVersionActions-ByaJ1Nbv.js +0 -1
- package/dist/packem_shared/dependency-scan-CawAKoU_.js +0 -1
- package/dist/packem_shared/failure-log-BP-gCUb5.js +0 -2
- package/dist/packem_shared/formatBytes-_HvjOy8a-B_qQr4Hw.js +0 -4
- package/dist/packem_shared/glob-Cyk1H9ZL-Dxlf9Swz.js +0 -1
- package/dist/packem_shared/index-CDHP1kby.js +0 -1
- package/dist/packem_shared/lifecycle-DvmDIRbb.js +0 -2
- package/dist/packem_shared/missing-package-json-Cu5YVAot.js +0 -1
- package/dist/packem_shared/multi-eco-lockfiles-B2X3yhyo.js +0 -1
- package/dist/packem_shared/packument-zb18Jnlw.js +0 -1
- package/dist/packem_shared/registry-keys-DxdqMzyp.js +0 -1
- package/dist/packem_shared/s1ngularity-CO5GkkqX.js +0 -1
- package/dist/packem_shared/scan-progress-RwCRxJdX.js +0 -2
- package/dist/packem_shared/spinner-BJjbNl1F.js +0 -1
- package/dist/packem_shared/tabs--uxJGL8N.js +0 -1
- package/dist/packem_shared/typosquats-D4DEHhFy.js +0 -1
- package/dist/packem_shared/use-measured-height-DUZyyias.js +0 -1
- package/dist/packem_shared/vis-update-app-9b2kSk9f.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as _}from"node:module";import{e as l}from"./index-BzhrR_iC.js";import{g as T}from"./env-BSXG3QKH.js";import{y as d}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as b}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{h as j}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";let p;const g=e=>(p??=_(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,r]=o.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return o.getBuiltinModule(e)}return g(e)},{rmSync:f,writeFileSync:k}=v("node:fs"),C=1440*60*1e3,A=15e3,E="https://registry.npmjs.org/-/npm/v1/keys",m=()=>l(T(),"registry-keys"),c=()=>l(m(),"npmjs.json"),L=()=>{const e=c();if(d(e))try{const t=b(e),r=Date.now()-t.createdAt>t.ttlMs;return{entry:t,expired:r}}catch{f(e,{force:!0});return}},M=(e,t)=>{j(m());const r={createdAt:Date.now(),keys:e,ttlMs:t};k(c(),JSON.stringify(r),"utf8")},F=async(e={})=>{const t=e.ttlMs??C,r=e.keysUrl??process.env.VIS_NPM_KEYS_URL??E,s=L();if(s!==void 0&&!s.expired&&e.forceRefresh!==!0)return{fromCache:!0,keys:s.entry.keys};const n=new AbortController,h=setTimeout(()=>{n.abort()},A),i=()=>{n.abort()};e.signal?.addEventListener("abort",i,{once:!0});try{const a=await fetch(r,{headers:{Accept:"application/json"},signal:n.signal});if(!a.ok)return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0;const u=await a.json(),y=Array.isArray(u.keys)?u.keys:[];return M(y,t),{fromCache:!1,keys:y}}catch{return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0}finally{clearTimeout(h),e.signal?.removeEventListener("abort",i)}},P=()=>{const e=c();return d(e)?(f(e,{force:!0}),!0):!1};export{P as c,F as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as n}from"node:module";import{n as a}from"./index-BzhrR_iC.js";let i;const c=e=>(i??=n(import.meta.url))(e),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[r,o]=s.versions.node.split(".").map(Number);if(r>22||r===22&&o>=3||r===20&&o>=16)return s.getBuiltinModule(e)}return c(e)},{createRequire:l}=u("node:module"),p=e=>{const r={force:!0,recursive:!0};return e?.maxRetries!==void 0&&(r.maxRetries=e.maxRetries),e?.retryDelay!==void 0&&(r.retryDelay=e.retryDelay),r};let d;const f=e=>(d??=l(import.meta.url))(e),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[r,o]=t.versions.node.split(".").map(Number);if(r>22||r===22&&o>=3||r===20&&o>=16)return t.getBuiltinModule(e)}return f(e)},{rmSync:_}=m("node:fs"),v=(e,r={})=>{a(e),_(e,p(r))};export{v as f};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{w as m,Y as N,H as i,n as a,c as g,t as p,T as v}from"./registry-CkoaWkjP.js";const C=(u,y)=>{const f=y?.columns??80,e=m("ink-root");let l="";e.onComputeLayout=()=>{e.yogaNode.setWidth(f),e.yogaNode.calculateLayout(void 0,void 0,N.DIRECTION_LTR);const o=t=>{if(t.nodeName==="ink-box"){const s=t.style.overflow??"visible",d=t.style.overflowX??s,h=t.style.overflowY??s;(d==="scroll"||h==="scroll")&&v(t)}for(const s of t.childNodes)s.nodeName!=="#text"&&o(s)};o(e)},e.onImmediateRender=()=>{const{staticOutput:o}=i(e,!1);o&&(l+=o)};const n={has:!1},r=a.createContainer(e,g.LegacyRoot,null,!1,null,"render-to-string",o=>{n.has||(n.has=!0,n.error=o)},()=>{},()=>{},()=>{});let c=!1;try{let o="";try{a.updateContainerSync(u,r,null,()=>{}),a.flushSyncWork(),{output:o}=i(e,!1)}finally{a.updateContainerSync(null,r,null,()=>{}),a.flushSyncWork(),c=!0,e.yogaNode.free()}if(n.has)throw p(n.error);const t=l.endsWith(`
|
|
2
|
+
`)?l.slice(0,-1):l;return t&&o?`${t}
|
|
3
|
+
${o}`:t||o}finally{if(!c&&e.yogaNode)try{e.yogaNode.freeRecursive()}catch{}}};export{C as O};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as R}from"./index-BjdW45xX.js";import{k as A}from"./
|
|
1
|
+
import{i as R}from"./index-BjdW45xX.js";import{k as A}from"./env-BSXG3QKH.js";import{d as M,p as k}from"./prompt-DMzaQEVa.js";import{h as S,M as T,r as E,a as P,b as C,c as x,d as O,e as V,f as F}from"./s1ngularity-BuU9Cxpy.js";import{D as h,m as g,r as L}from"./provenance-SX1MxPUZ.js";import{g as y}from"./packument-CbTmbHU4.js";import{c as N,p as w}from"../packem_chunks/cli-main.js";import{r as _}from"./signatures-CeL0bOEo.js";import{s as I}from"./index-B4AjSxHU.js";import{p as U}from"./utils-DQFHJn72.js";const j=15,B=e=>{const a=(e.TERM??"").toLowerCase();return a!=="dumb"&&a!=="unknown"&&a!==""},W=async(e,a,t,r)=>new Promise(d=>{if(r?.aborted){d(!1);return}const o=B(t)&&a.isTTY!==!1;let s=e;const c=()=>{o?a.write(`\rContinuing in ${String(s)}s... press Ctrl-C to abort. `):s===e&&a.write(`Warnings present; proceeding in ${String(e)}s.
|
|
2
2
|
`)};c();const u=setInterval(()=>{if(s-=1,s<=0){clearInterval(u),r?.removeEventListener("abort",i),o&&a.write(`\rContinuing now.
|
|
3
3
|
`),d(!0);return}c()},1e3),i=()=>{clearInterval(u),o&&a.write(`\rAborted.
|
|
4
4
|
`),d(!1)};r?.addEventListener("abort",i,{once:!0})}),Y=async(e,a={})=>{if(e.length===0)return{proceed:!0};const t=a.env??process.env,r=a.isTty??!!process.stdin.isTTY,d=a.isCi??R,o=a.strict??!1,s=a.readline??M,c=a.output??{isTTY:!!process.stdout.isTTY,write:p=>process.stdout.write(p)},u=A(t.VIS_DISABLE_AUTO_CONTINUE),i=Number.parseInt(t.VIS_AUTO_CONTINUE_SECONDS??"",10),l=a.countdownSeconds??(Number.isFinite(i)&&i>0?i:j);return e.some(p=>p.severity==="error")?o?{proceed:!1,reason:"errors-present"}:d?{proceed:!1,reason:"errors-present"}:r?await k("Proceed despite errors? [y/N] ",s)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:{proceed:!1,reason:"non-tty"}:o?{proceed:!1,reason:"ci-strict"}:r?u?await k("Proceed despite warnings? [y/N] ",s)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:await W(l,c,t,a.signal)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:{proceed:!0}},Ne=async(e,a={})=>{if(e.isEmpty())return!0;const t=e.all(),r=a.output??{isTTY:!!process.stdout.isTTY,write:o=>process.stdout.write(o)};for(const o of S(t))r.write(`${o}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as J}from"node:module";import{DEFAULT_CHANGES_DIR as ee}from"../packem_chunks/DEFAULT_CLEAN_KEEP.js";import{maxBump as te}from"../release/types.js";import{f as re}from"../packem_chunks/
|
|
1
|
+
import{createRequire as J}from"node:module";import{DEFAULT_CHANGES_DIR as ee}from"../packem_chunks/DEFAULT_CLEAN_KEEP.js";import{maxBump as te}from"../release/types.js";import{f as re}from"../packem_chunks/context.js";import{r as ne}from"./slug-OBHcH7wV.js";import{resolveLastReleaseRef as se}from"../packem_chunks/version-resolver.js";let Y;const Z=r=>(Y??=J(import.meta.url))(r),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Q=r=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[e,t]=$.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return $.getBuiltinModule(r)}return Z(r)},{join:F}=Q("node:path"),K=/(?!.*)/;function ie(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function I(r){return r.map(e=>typeof e=="string"?ie(e.trim()):e.source).filter(Boolean).join("|")}function oe(r,e){if(!r)return K;const t=I(r);return e?e(t):new RegExp(`^(?:\\*\\s+)?(${t}):\\s*(.*)`,"i")}function ae(r,e){if(!r)return K;const t=e?"g":"gi";return new RegExp(`(?:.*?)??\\s*([\\w-\\.\\/]*?)??(${I(r)})([\\w-]+)(?=\\s|$|[,;.)\\]])`,t)}function ce(r){if(!r)return/()(.+)/gi;const e=I(r);return new RegExp(`(${e})(?:\\s+(.*?))(?=(?:${e})|$)`,"gi")}function le(r){const e=r?`|\\s+(?:${I(r)})`:"";return new RegExp(`^(?:BREAKING CHANGE|[\\w-]+)(?::\\s+${e}).+`,"i")}function fe(r={}){const e=oe(r.noteKeywords,r.notesPattern),t=ae(r.issuePrefixes,r.issuePrefixesCaseSensitive),n=ce(r.referenceActions),s=le(r.issuePrefixes);return{notes:e,referenceParts:t,references:n,footerToken:s,mentions:/@([\w-]+)/g,url:/\b(?:https?):\/\/(?:www\.)?([-a-zA-Z0-9@:%_+.~#?&//=])+\b/}}const he="------------------------ >8 ------------------------";function S(r){const e=r.match(/[^\r\n]/);if(typeof e?.index!="number")return"";const t=e.index;let n=r.length-1;for(;r[n]==="\r"||r[n]===`
|
|
2
2
|
`;)n--;return r.substring(t,n+1)}function k(r,e){return r?`${r}
|
|
3
3
|
${e||""}`:e||""}function ue(r){return r?e=>!e.startsWith(r):()=>!0}function de(r,e){const t=r.indexOf(`${e} ${he}`);return t===-1?r:r.slice(0,t)}function O(r){return!r.match(/^\s*gpg:/)}function M(r,e,t){const{groups:n}=e;for(let s=0,o=t.length,i;s<o;s++)i=t[s],r[i]=(n?n[i]:e[s+1])||null;return r}const me={noteKeywords:["BREAKING CHANGE","BREAKING-CHANGE"],issuePrefixes:["#"],referenceActions:["close","closes","closed","fix","fixes","fixed","resolve","resolves","resolved"],headerPattern:/^(\w*)(?:\(([\w$@.\-*/ ]*)\))?: (.*)$/,headerCorrespondence:["type","scope","subject"],revertPattern:/^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\.?/,revertCorrespondence:["header","hash"],fieldPattern:/^-(?=.*\w)(.*?)-$/};function G(r={}){return{merge:null,revert:null,header:null,body:null,footer:null,notes:[],mentions:[],references:[],...r}}class ge{options;regexes;lines=[];lineIndex=0;commit=G();constructor(e={}){this.options={...me,...e},this.regexes=fe(this.options)}currentLine(){return this.lines[this.lineIndex]}nextLine(){return this.lines[this.lineIndex++]}isLineAvailable(){return this.lineIndex<this.lines.length}parseReference(e,t){const{regexes:n}=this;if(n.url.test(e))return null;const s=n.referenceParts.exec(e);if(!s)return null;let[o,i=null,c,f]=s,u=null;if(i){const x=i.indexOf("/");x!==-1&&(u=i.slice(0,x),i=i.slice(x+1))}return{raw:o,action:t,owner:u,repository:i,prefix:c,issue:f}}parseReferences(e){const{regexes:t}=this,n=e.match(t.references)?t.references:/()(.+)/gi,s=[];let o,i,c,f;for(;o=n.exec(e),!!o;)for(i=o[1]||null,c=o[2]||"";f=this.parseReference(c,i),!!f;)s.push(f);return s}skipEmptyLines(){let e=this.currentLine();for(;e!==void 0&&!e.trim();)this.nextLine(),e=this.currentLine()}parseMerge(){const{commit:e,options:t}=this,n=t.mergeCorrespondence||[],s=this.currentLine(),o=s&&t.mergePattern?s.match(t.mergePattern):null;return o?(this.nextLine(),e.merge=o[0]||null,M(e,o,n),!0):!1}parseHeader(e){e&&this.skipEmptyLines();const{commit:t,options:n}=this,s=n.headerCorrespondence||[],o=t.header??this.nextLine();let i=null;o&&(n.breakingHeaderPattern&&(i=o.match(n.breakingHeaderPattern)),!i&&n.headerPattern&&(i=o.match(n.headerPattern))),o&&(t.header=o),i&&M(t,i,s)}parseMeta(){const{options:e,commit:t}=this;if(!e.fieldPattern||!this.isLineAvailable())return!1;let n,s=null,o=!1;for(;this.isLineAvailable();){if(n=this.currentLine().match(e.fieldPattern),n){s=n[1]||null,this.nextLine();continue}if(s)o=!0,t[s]=k(t[s],this.currentLine()),this.nextLine();else break}return o}parseNotes(){const{regexes:e,commit:t}=this;if(!this.isLineAvailable())return!1;const n=this.currentLine().match(e.notes);let s;if(n){const o={title:n[1],text:n[2]};for(t.notes.push(o),t.footer=k(t.footer,this.currentLine()),this.nextLine();this.isLineAvailable();){if(this.parseMeta()||this.parseNotes())return!0;if(s=e.footerToken.test(this.currentLine()),t.references.push(...this.parseReferences(this.currentLine())),s||(o.text=k(o.text,this.currentLine())),t.footer=k(t.footer,this.currentLine()),this.nextLine(),s)break}return!0}return!1}parseBodyAndFooter(e){const{commit:t,regexes:n}=this;if(!this.isLineAvailable())return e;const o=!n.footerToken.test(this.currentLine())&&e;return t.references.push(...this.parseReferences(this.currentLine())),o?t.body=k(t.body,this.currentLine()):t.footer=k(t.footer,this.currentLine()),this.nextLine(),o}parseBreakingHeader(){const{commit:e,options:t}=this;if(!t.breakingHeaderPattern||e.notes.length||!e.header)return;const n=e.header.match(t.breakingHeaderPattern);n&&e.notes.push({title:"BREAKING CHANGE",text:n[3]})}parseMentions(e){const{commit:t,regexes:n}=this;let s;for(;s=n.mentions.exec(e),!!s;)t.mentions.push(s[1])}parseRevert(e){const{commit:t,options:n}=this,s=n.revertCorrespondence||[],o=n.revertPattern?e.match(n.revertPattern):null;o&&(t.revert=M({},o,s))}cleanupCommit(){const{commit:e}=this;e.body&&=S(e.body),e.footer&&=S(e.footer),e.notes.forEach(n=>{n.text=S(n.text)});const t=new Set;e.references=e.references.filter(n=>{const s=`${n.action} ${n.raw}`.toLocaleLowerCase(),o=!t.has(s);return o&&t.add(s),o})}parse(e){if(!e.trim())throw new TypeError("Expected a raw commit");const{commentChar:t}=this.options,n=ue(t),s=S(e).split(/\r?\n/),o=t?de(s,t).filter(u=>n(u)&&O(u)):s.filter(u=>O(u)),i=G();this.lines=o,this.lineIndex=0,this.commit=i;const c=this.parseMerge();this.parseHeader(c),i.header&&(i.references=this.parseReferences(i.header));let f=!0;for(;this.isLineAvailable();)this.parseMeta(),this.parseNotes()&&(f=!1),this.parseBodyAndFooter(f)||(f=!1);return this.parseBreakingHeader(),this.parseMentions(e),this.parseRevert(e),this.cleanupCommit(),i}}const D={build:"patch",chore:"patch",ci:"patch",docs:"patch",feat:"minor",fix:"patch",perf:"patch",refactor:"patch",style:"patch",test:"patch"},pe=new ge,xe=/^Revert\s+"(.+)"\s*$/,we=/This reverts commit\s+([0-9a-f]{7,40})/i,be=/^(?:[\p{Emoji_Presentation}\p{Extended_Pictographic}]|:\w+:)\s+/u,Re=(r,e)=>{const t=r.replace(be,""),n=pe.parse(`${t}
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as h}from"node:module";import{e as d}from"./index-BzhrR_iC.js";import{a as u}from"./env-BSXG3QKH.js";let y;const _=s=>(y??=h(import.meta.url))(s),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,j=s=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[t,e]=c.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return c.getBuiltinModule(s)}return _(s)},{readFile:f,readdir:l,stat:p}=j("node:fs/promises"),v=(s,t)=>s.tasks.find(e=>e.taskId===t),m=(s,t)=>{const e=s??{},o=t??{},i=[],n=[],r=[];for(const a of Object.keys(e))a in o?e[a]!==o[a]&&r.push(a):i.push(a);for(const a of Object.keys(o))a in e||n.push(a);return i.sort(),n.sort(),r.sort(),{added:i,changed:r,removed:n}},D=(s,t)=>({commandChanged:(s?.command??"")!==(t?.command??""),implicitDeps:m(s?.implicitDeps,t?.implicitDeps),nodes:m(s?.nodes,t?.nodes),runtime:m(s?.runtime,t?.runtime)}),R=async(s,t)=>{const e=d(u(s),`${t}.json`);try{const o=await f(e,"utf8");return JSON.parse(o)}catch{return}},b=async(s,t)=>{const e=u(s);let o;try{o=await l(e)}catch{return}const i=[];for(const n of o){if(!n.endsWith(".json")||t!==void 0&&n===`${t}.json`)continue;const r=d(e,n);try{const a=await p(r);a.isFile()&&i.push({mtimeMs:a.mtimeMs,path:r})}catch{}}if(i.length!==0){i.sort((n,r)=>r.mtimeMs-n.mtimeMs);try{const n=await f(i[0].path,"utf8");return JSON.parse(n)}catch{return}}},w=async s=>{const t=u(s);let e;try{e=await l(t)}catch{return[]}const o=[];for(const i of e){if(!i.endsWith(".json"))continue;const n=d(t,i);try{const r=await p(n);r.isFile()&&o.push({id:i.slice(0,-5),mtimeMs:r.mtimeMs,path:n})}catch{}}return o.sort((i,n)=>n.mtimeMs-i.mtimeMs),o};export{b as a,D as d,v as f,w as l,R as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as X}from"node:module";import{X as j,b as T}from"./index.server-Ca_EEVfw.js";import{e as A}from"./index-BzhrR_iC.js";import{g as L}from"./env-BSXG3QKH.js";import{D as m,m as y}from"./provenance-SX1MxPUZ.js";import{g as E}from"./packument-CbTmbHU4.js";import{c as w}from"../packem_chunks/cli-main.js";import{y as U}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as O}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{h as C}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";import{s as p}from"./index-B4AjSxHU.js";let Y;const Q=r=>(Y??=X(import.meta.url))(r),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=r=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[e,t]=b.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return b.getBuiltinModule(r)}return Q(r)},{rmSync:D,writeFileSync:P}=$("node:fs"),{createHash:Z}=$("node:crypto"),{Resolver:ee}=$("node:dns/promises");class rr{entries=[];add(e){this.entries.push(e)}addMany(e){for(const t of e)this.entries.push(t)}all(){return this.entries}errors(){return this.entries.filter(e=>e.severity==="error")}warnings(){return this.entries.filter(e=>e.severity==="warning")}hasErrors(){return this.entries.some(e=>e.severity==="error")}hasWarnings(){return this.entries.some(e=>e.severity==="warning")}isEmpty(){return this.entries.length===0}size(){return this.entries.length}}const tr=r=>{if(r.length===0)return[];const e=[],t=r.filter(s=>s.severity==="error"),n=r.filter(s=>s.severity==="warning");if(t.length>0){e.push(j(`${String(t.length)} error${t.length===1?"":"s"}:`));for(const s of t)e.push(` ${j("✗")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${T("→")} ${s.suggestedAction}`)}if(n.length>0){t.length>0&&e.push(""),e.push(T(`${String(n.length)} warning${n.length===1?"":"s"}:`));for(const s of n)e.push(` ${T("⚠")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${T("→")} ${s.suggestedAction}`)}return e},nr=r=>({errors:r.filter(e=>e.severity==="error"),findings:[...r],summary:{errorCount:r.filter(e=>e.severity==="error").length,warningCount:r.filter(e=>e.severity==="warning").length},warnings:r.filter(e=>e.severity==="warning")}),re=1440*60*1e3,te=15e3,ne="https://api.github.com/repos",W=()=>A(L(),"archived-repo"),q=(r,e)=>A(W(),`${encodeURIComponent(r)}__${encodeURIComponent(e)}.json`),se=(r,e)=>{const t=q(r,e);if(U(t))try{const n=O(t);if(Date.now()-n.createdAt>n.ttlMs){D(t,{force:!0});return}return n}catch{D(t,{force:!0});return}},B=(r,e,t,n)=>{C(W());const s={createdAt:Date.now(),ttlMs:n,...t};P(q(r,e),JSON.stringify(s),"utf8")},oe=r=>{if(typeof r!="string"||r.trim()==="")return;const e=r.trim().replace(/^git\+/,""),t=/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(t)return{owner:t[1],repo:t[2]};const n=/^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(n)return{owner:n[1],repo:n[2]};const s=/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/?#]+?)(?:\.git)?\/?$/i.exec(e);if(s)return{owner:s[1],repo:s[2]}},ie=async(r,e,t,n)=>{const s=`${ne}/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,l=new AbortController,o=setTimeout(()=>{l.abort()},te),i=()=>{l.abort()};n?.addEventListener("abort",i,{once:!0});const a={Accept:"application/vnd.github+json","User-Agent":"visulima-vis-marshall"};t!==void 0&&t!==""&&(a.Authorization=`Bearer ${t}`);try{const c=await fetch(s,{headers:a,signal:l.signal});if(c.status===404)return{kind:"missing"};if(!c.ok)return{kind:"transient-error"};const d=await c.json(),u=d.archived===!0,f=typeof d.archived_at=="string"?d.archived_at:void 0;return{archived:u,archivedAt:f,kind:"ok"}}catch{return{kind:"transient-error"}}finally{clearTimeout(o),n?.removeEventListener("abort",i)}},ae=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),sr=async(r,e={})=>{if(w("archivedRepo"))return[];const t=new Set(e.allowlist),n=e.cacheTtlMs??re,s=e.githubToken??process.env.GITHUB_TOKEN,l=e.concurrency??m,o=new Map,i=async(c,d)=>{const u=`${c}/${d}`;let f=o.get(u);return f===void 0&&(f=(async()=>{const h=se(c,d);if(h!==void 0)return h.missing===!0?{archived:!1,kind:"missing"}:{archived:h.archived,archivedAt:h.archivedAt,kind:"ok"};const v=await ie(c,d,s,e.signal);return v.kind==="missing"?B(c,d,{archived:!1,missing:!0},n):v.kind==="ok"&&B(c,d,{archived:v.archived===!0,archivedAt:v.archivedAt},n),v})(),o.set(u,f)),f};return(await y(r,l,async({name:c,version:d})=>{if(t.has(c))return;const u=await E(c,{workspaceRoot:e.workspaceRoot});if(u===void 0)return;const f=u.versions[d]??u.versions[ae(Object.keys(u.versions),u["dist-tags"]?.latest)??""];if(f===void 0)return;const h=oe(f.repository?.url);if(h===void 0)return;const v=await i(h.owner,h.repo);if(v.kind!=="transient-error"){if(v.kind==="missing")return{kind:"missing-repo",owner:h.owner,packageName:c,repo:h.repo};if(v.archived===!0)return{...v.archivedAt===void 0?{}:{archivedAt:v.archivedAt},kind:"archived",owner:h.owner,packageName:c,repo:h.repo}}})).filter(c=>c!==void 0)},ce={dormantErrorDays:274,dormantWarnDays:183,newPublisherWindowDays:21,recentVersionErrorDays:7,recentVersionWarnDays:30},de=1440*60*1e3,F=(r,e)=>(r-e)/de,_=r=>{if(r!==void 0)return r.email??r.name},ue=(r,e,t,n,s)=>{const l=r.time?.[t];if(l===void 0)return;const o=new Date(l).getTime();if(!Number.isFinite(o))return;const i=F(n,o);if(i<s.recentVersionErrorDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (error threshold: ${String(s.recentVersionErrorDays)})`,packageName:e,severity:"error",version:t};if(i<s.recentVersionWarnDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (warn threshold: ${String(s.recentVersionWarnDays)})`,packageName:e,severity:"warning",version:t}},le=(r,e,t,n,s)=>{const l=r.versions[t],o=_(l?._npmUser);if(o===void 0)return;const a=Object.keys(r.versions).filter(h=>p.valid(h)!==null).filter(h=>p.lt(h,t));if(a.length===0||a.some(h=>_(r.versions[h]?._npmUser)===o))return;const d=r.time?.[a[0]??""];if(d===void 0)return;const u=new Date(d).getTime();if(!Number.isFinite(u))return;const f=F(n,u);if(!(f<=s.newPublisherWindowDays))return{kind:"new-publisher",message:`first publish by ${o} on a ${f.toFixed(0)}-day-old package`,packageName:e,severity:"error",version:t}},fe=(r,e,t,n,s)=>{const l=r.versions[t],o=_(l?._npmUser);if(o===void 0)return;const i=[];for(const[d,u]of Object.entries(r.versions)){if(d===t||_(u._npmUser)!==o)continue;const f=r.time?.[d];if(f===void 0)continue;const h=new Date(f).getTime();Number.isFinite(h)&&i.push(h)}if(i.length===0)return;const a=Math.max(...i),c=F(n,a);if(c>=s.dormantErrorDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${c.toFixed(0)} days ago (error threshold: ${String(s.dormantErrorDays)})`,packageName:e,severity:"error",version:t};if(c>=s.dormantWarnDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${c.toFixed(0)} days ago (warn threshold: ${String(s.dormantWarnDays)})`,packageName:e,severity:"warning",version:t}},or=async(r,e={})=>{if(w("author"))return[];const t=new Set(e.allowlist),n={...ce,...e.thresholds},s=e.now??(()=>Date.now()),l=e.concurrency??m;return(await y(r,l,async({name:i,version:a})=>{if(t.has(i))return[];const c=await E(i,{cacheTtlMs:e.cacheTtlMs,signal:e.signal,workspaceRoot:e.workspaceRoot});if(c===void 0)return[];const d=s(),u=[],f=ue(c,i,a,d,n);f!==void 0&&u.push(f);const h=le(c,i,a,d,n);h!==void 0&&u.push(h);const v=fe(c,i,a,d,n);return v!==void 0&&u.push(v),u})).flat()},he=1440*60*1e3,ve=15e3,ge=20,pe=1e4,me="https://api.npmjs.org/downloads/point/last-month",G=()=>A(L(),"downloads"),J=r=>A(G(),`${encodeURIComponent(r)}.json`),ye=r=>{const e=J(r);if(U(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){D(e,{force:!0});return}return t.downloads}catch{D(e,{force:!0});return}},we=(r,e,t)=>{C(G());const n={createdAt:Date.now(),downloads:e,observedAt:new Date().toISOString(),ttlMs:t};P(J(r),JSON.stringify(n),"utf8")},ke=async(r,e)=>{const t=`${me}/${encodeURIComponent(r)}`,n=new AbortController,s=setTimeout(()=>{n.abort()},ve),l=()=>{n.abort()};e?.addEventListener("abort",l,{once:!0});try{const o=await fetch(t,{signal:n.signal});if(o.status===404)return{kind:"no-data"};if(!o.ok)return{kind:"error"};const i=await o.json();return typeof i.downloads=="number"?{downloads:i.downloads,kind:"ok"}:{kind:"no-data"}}catch{return{kind:"error"}}finally{clearTimeout(s),e?.removeEventListener("abort",l)}},ir=async(r,e={})=>{if(w("downloads"))return[];const t=new Set(e.allowlist),n=e.errorThreshold??ge,s=e.warnThreshold??pe,l=e.cacheTtlMs??he,o=e.concurrency??m;return(await y(r,o,async a=>{if(t.has(a))return;let d=ye(a);if(d===void 0){const u=await ke(a,e.signal);if(u.kind==="no-data"||u.kind==="error")return{downloadsLastMonth:void 0,kind:"no-data",packageName:a,severity:"warning"};d=u.downloads??0,we(a,d,l)}if(d<n)return{downloadsLastMonth:d,kind:"below-error",packageName:a,severity:"error"};if(d<s)return{downloadsLastMonth:d,kind:"below-warning",packageName:a,severity:"warning"}})).filter(a=>a!==void 0)},De=1440*60*1e3,Ae=4e3,Ee=["1.1.1.1","8.8.8.8"],K=()=>A(L(),"expired-domains"),z=r=>{const e=Z("sha256").update(r).digest("hex").slice(0,12);return A(K(),`${e}.json`)},be=r=>{const e=z(r);if(U(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){D(e,{force:!0});return}return t}catch{D(e,{force:!0});return}},Re=(r,e,t)=>{C(K());const n={createdAt:Date.now(),outcome:e,ttlMs:t};P(z(r),JSON.stringify(n),"utf8")},Te=r=>{if(typeof r!="string")return;const e=r.lastIndexOf("@");if(e===-1||e===r.length-1)return;const t=r.slice(e+1).trim().toLowerCase();return t===""?void 0:t},_e=(r,e)=>{const t=[];e!==void 0&&t.push(e);for(const n of r??[])t.push(n);return t},Me=async(r,e)=>{let t;try{return await Promise.race([r,new Promise((n,s)=>{t=setTimeout(()=>{s(new Error("ETIMEDOUT"))},e)})])}finally{t!==void 0&&clearTimeout(t)}},Se=r=>{if(r===null||typeof r!="object")return!1;const{code:e}=r;return e==="ENOTFOUND"||e==="ENODATA"||e==="NXDOMAIN"},$e=async(r,e,t)=>{try{const n=await Me(r.resolveNs(e),t);return Array.isArray(n)&&n.length>0?{kind:"ok"}:{kind:"expired"}}catch(n){return Se(n)?{kind:"expired"}:{kind:"transient-error"}}},Pe=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),ar=async(r,e={})=>{if(w("expiredDomains"))return[];const t=new Set(e.allowlist),n=new Set((e.allowDomains??[]).map(f=>f.toLowerCase())),s=e.cacheTtlMs??De,l=e.perDomainTimeoutMs??Ae,o=e.dnsServers??Ee,i=e.concurrency??m,a=e.createResolver===void 0?new ee:e.createResolver();typeof a.setServers=="function"&&a.setServers(o);const c=new Map,d=async f=>{let h=c.get(f);return h===void 0&&(h=(async()=>{const v=be(f);if(v!==void 0)return{kind:v.outcome==="ok"?"ok":"expired"};const g=await $e(a,f,l);return g.kind!=="transient-error"&&Re(f,g.kind,s),g})(),c.set(f,h)),h};return(await y(r,i,async({name:f,version:h})=>{if(t.has(f))return[];const v=await E(f,{workspaceRoot:e.workspaceRoot});if(v===void 0)return[];const g=v.versions[h]??v.versions[Pe(Object.keys(v.versions),v["dist-tags"]?.latest)??""];if(g===void 0)return[];const M=_e(g.maintainers,g._npmUser),N=new Set,S=[];for(const R of M){const k=Te(R.email);if(k===void 0||n.has(k))continue;const I=`${k}:${R.email??""}`;if(N.has(I))continue;N.add(I);const x=await d(k);x.kind==="expired"?S.push({domain:k,kind:"expired",maintainer:R.email??"",packageName:f,severity:"error"}):x.kind==="transient-error"&&S.push({domain:k,kind:"unresolved",maintainer:R.email??"",packageName:f,severity:"warning"})}return S})).flat()},Le=["readme","license","repo"],Ue=["ERROR: No README data found!","# Security holding package"],Oe=r=>{const e=r.trim();return e===""?!0:Ue.some(t=>e.startsWith(t))},Ce=(r,e)=>{if(typeof e.readme=="string")return e.readme;if(typeof r.readme=="string")return r.readme},Fe=(r,e)=>{const t=Ce(r,e);if(t===void 0)return"missing-readme";if(Oe(t))return"placeholder-readme"},Ne=r=>{const{license:e}=r;return e===void 0?"missing-license":typeof e=="string"?e.trim()===""?"missing-license":void 0:typeof e.type=="string"&&e.type.trim()!==""?void 0:"missing-license"},Ie=r=>{const{repository:e}=r;if(e===void 0)return"missing-repo";const t=typeof e.url=="string"?e.url.trim():"";if(t==="")return"missing-repo";let n=t.replace(/^git\+/,"");const s=/^git@([^:]+):(.+?)(?:\.git)?$/.exec(n);return s&&(n=`https://${s[1]}/${s[2]}`),URL.canParse(n)?void 0:"invalid-repo-url"},xe=r=>{const e=r["dist-tags"]?.latest;return e!==void 0&&Object.hasOwn(r.versions,e)?e:Object.keys(r.versions).at(-1)},cr=async(r,e={})=>{if(w("metadata"))return[];const t=new Set(e.allowlist),n=new Set(e.checks??Le),s=e.concurrency??m;return(await y(r,s,async({name:o,version:i})=>{if(t.has(o))return;const a=await E(o,{workspaceRoot:e.workspaceRoot});if(a===void 0)return;const c=a.versions[i]??a.versions[xe(a)??""];if(c===void 0||c.private===!0)return;const d=[];if(n.has("readme")){const u=Fe(a,c);u!==void 0&&d.push(u)}if(n.has("license")){const u=Ne(c);u!==void 0&&d.push(u)}if(n.has("repo")){const u=Ie(c);u!==void 0&&d.push(u)}if(d.length!==0)return{issues:d,packageName:o,version:i}})).filter(o=>o!==void 0)},H=(r,e)=>r===void 0?{}:typeof r=="string"?{[e.startsWith("@")?e.split("/").at(1)??e:e]:r}:{...r},je=(r,e)=>p.valid(e)?Object.keys(r.versions).filter(n=>p.valid(n)!==null&&p.lt(n,e)).sort((n,s)=>p.lt(n,s)?1:-1)[0]:void 0,dr=async(r,e={})=>{if(w("newBin"))return[];const t=new Set(e.allowlist),n=new Set(e.allowBins),s=e.concurrency??m;return(await y(r,s,async({name:o,version:i})=>{if(t.has(o))return;const a=await E(o,{workspaceRoot:e.workspaceRoot});if(a===void 0)return;const c=a.versions[i];if(c===void 0)return;const d=je(a,i);if(d===void 0)return;const u=a.versions[d];if(u===void 0)return;const f=H(c.bin,o),h=H(u.bin,o),v=Object.entries(f).filter(([g])=>!(g in h)).filter(([g])=>!n.has(g)).map(([g,M])=>({command:M,name:g}));if(v.length!==0)return{fromVersion:d,newBins:v,packageName:o,toVersion:i}})).filter(o=>o!==void 0)},Be=["preinstall","install","postinstall"],V=(r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,He=(r,e)=>{if(p.valid(e)!==null)return Object.keys(r.versions).filter(t=>p.valid(t)!==null&&p.prerelease(t)===null&&p.lt(t,e)).sort((t,n)=>p.lt(t,n)?1:-1)[0]},Ve=(r,e)=>{const t=r??{},n=e??{},s=[];for(const l of Be){const o=t[l];if(o===void 0||o==="")continue;const i=n[l];i===void 0||i===""?s.push({command:o,hook:l,kind:"introduced"}):i!==o&&s.push({command:o,hook:l,kind:"changed"})}return s},ur=async(r,e={})=>{if(w("s1ngularity"))return[];const t=new Set(e.allowlist),n=e.concurrency??m;return(await y(r,n,async({name:l,version:o})=>{if(t.has(l))return;const i=await E(l,{workspaceRoot:e.workspaceRoot});if(i?.versions[o]===void 0)return;const a=He(i,o);if(a===void 0||!V(i,a)||V(i,o))return;const c=Ve(i.versions[o]?.scripts,i.versions[a]?.scripts);if(c.length!==0)return{hookChanges:c,packageName:l,priorVersion:a,trustSignal:"provenance-dropped",version:o}})).filter(l=>l!==void 0)};export{rr as M,ur as a,dr as b,cr as c,ir as d,ar as e,sr as f,nr as g,tr as h,or as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as d}from"./index-BzhrR_iC.js";import{V as f}from"./vis-user-error-
|
|
1
|
+
import{e as d}from"./index-BzhrR_iC.js";import{V as f}from"./vis-user-error-D_ekz9rF.js";import{p as n}from"../packem_chunks/cli-main.js";import{r as p}from"./detect-CbMRSXkM.js";import{h as m,U as c}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";import{y as u}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as g}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";const C=(s,i=!0)=>{if(!i){n.notice("Skipped .vscode: the project does not use oxfmt, so there is no editor setting to add.");return}const r=d(s,".vscode");m(r);const e=d(r,"settings.json"),o={"editor.defaultFormatter":"oxc.oxc-vscode","editor.formatOnSave":!0};if(u(e))try{const a=g(e);c(e,`${JSON.stringify({...o,...a},null,4)}
|
|
2
2
|
`),n.success("Merged .vscode/settings.json")}catch{n.warn("Could not merge .vscode/settings.json, skipping")}else c(e,`${JSON.stringify(o,null,4)}
|
|
3
3
|
`),n.success("Created .vscode/settings.json");const t=d(r,"extensions.json"),l={recommendations:["oxc.oxc-vscode"]};if(u(t))try{const a=g(t);c(t,`${JSON.stringify({...a,recommendations:[...new Set([...a.recommendations||[],...l.recommendations])]},null,4)}
|
|
4
4
|
`),n.success("Merged .vscode/extensions.json")}catch{n.warn("Could not merge .vscode/extensions.json, skipping")}else c(t,`${JSON.stringify(l,null,4)}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{F as h,b as T,J as C,X as k}from"./index.server-Ca_EEVfw.js";import{q as R,S as l}from"../packem_chunks/cli-main.js";import{i as $}from"./index-BjdW45xX.js";import{j as s,X as d,O as a,R as g}from"./registry-CkoaWkjP.js";import{l as v}from"./spinner-Bqjpz3i4.js";import{D as j,W as y,T as A,C as D}from"./symbols-BXDZ_sKt.js";const b=({rows:i})=>s.jsx(d,{flexDirection:"column",children:i.map(r=>{let t;switch(r.status){case"error":{t=s.jsx(a,{color:"red",children:D});break}case"ok":{t=s.jsx(a,{color:"green",children:A});break}case"running":{t=s.jsx(a,{color:"white",children:s.jsx(v,{type:"dots"})});break}case"warn":{t=s.jsx(a,{color:"yellow",children:y});break}default:{t=s.jsx(a,{dimColor:!0,children:j});break}}return s.jsxs(d,{children:[s.jsx(d,{width:3,children:t}),s.jsx(d,{flexGrow:1,children:s.jsx(a,{children:r.label})}),r.summary?s.jsx(d,{children:s.jsxs(a,{dimColor:!0,children:[j," ",r.summary]})}):null]},r.id)})}),I={error:k(l.failure),ok:C(l.success),pending:h(l.dash),skip:h(l.dash),warn:T(l.warning)},Y=(i,r,t)=>{const p=t?`${i} ${h(`— ${t}`)}`:i;return` ${I[r]} ${p}
|
|
2
|
+
`},H=(i,r={})=>{const t=r.stream??process.stderr,w=typeof t.isTTY=="boolean"&&t.isTTY&&!$,S=r.live??w,n=new Map;for(const e of i)n.set(e.id,{id:e.id,label:e.label,status:"pending"});if(!S||i.length===0)return{finish:(e,o,f)=>{const c=n.get(e);c&&(n.set(e,{...c,status:o,summary:f}),t.write(Y(c.label,o,f)))},start:e=>{const o=n.get(e);o&&n.set(e,{...o,status:"running"})},stop:()=>{}};const x=()=>i.map(e=>n.get(e.id));let u=R(g.createElement(b,{rows:x()}),{interactive:!0,patchConsole:!1});const m=()=>{u?.rerender(g.createElement(b,{rows:x()}))};return{finish:(e,o,f)=>{const c=n.get(e);c&&(n.set(e,{...c,status:o,summary:f}),m())},start:e=>{const o=n.get(e);o&&(n.set(e,{...o,status:"running"}),m())},stop:()=>{u&&(m(),u.unmount(),u=void 0)}}};export{H as s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as w}from"node:module";import{D as N,m as x}from"./provenance-
|
|
1
|
+
import{createRequire as w}from"node:module";import{D as N,m as x}from"./provenance-SX1MxPUZ.js";import{g as P}from"./packument-CbTmbHU4.js";import{c as b}from"../packem_chunks/cli-main.js";import{f as E}from"./registry-keys-z038Ecb4.js";let _;const $=s=>(_??=w(import.meta.url))(s),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=s=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,r]=u.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return u.getBuiltinModule(s)}return $(s)},{createPublicKey:M,createVerify:R}=v("node:crypto"),B=s=>{const e=["-----BEGIN PUBLIC KEY-----"],r=s.replaceAll(/\s+/g,"");for(let n=0;n<r.length;n+=64)e.push(r.slice(n,n+64));return e.push("-----END PUBLIC KEY-----"),e.join(`
|
|
2
2
|
`)},j=({keyBase64:s,message:e,signatureBase64:r})=>{try{const n=M({format:"pem",key:B(s)}),c=R("SHA256");return c.update(e),c.end(),c.verify(n,Buffer.from(r,"base64"))}catch{return!1}},A=(s,e)=>{if(s.expires===void 0||s.expires==="")return!1;const r=Date.parse(s.expires);return Number.isNaN(r)?!1:r<=e},C=(s,e,r)=>`${s}@${e}:${r}`,S=(s,e)=>e!==void 0&&s.includes(e)?e:s.at(-1),Y=async(s,e={})=>{if(b("signatures"))return[];const r=new Set(e.allowlist),n=e.treatExpiredAs??"warning",c=e.concurrency??N,p=await E({keysUrl:e.keysUrl,signal:e.signal,ttlMs:e.keysTtlMs});if(p===void 0)return s.filter(({name:t})=>!r.has(t)).map(({name:t,version:i})=>({code:"fetch-failed",message:"Could not fetch registry signing keys.",packageName:t,severity:"warning",version:i}));const k=new Map;for(const t of p.keys)k.set(t.keyid,t);const m=Date.now();return(await x(s,c,async({name:t,version:i})=>{if(r.has(t))return[];const o=await P(t,{workspaceRoot:e.workspaceRoot});if(o===void 0)return[];const y=o.versions[i]??o.versions[S(Object.keys(o.versions),o["dist-tags"]?.latest)??""];if(y===void 0)return[];const f=y.dist?.signatures,l=y.dist?.integrity;if(f===void 0||f.length===0)return[{code:"missing-signature",message:`Package ${t}@${i} has no dist.signatures from the registry.`,packageName:t,severity:"warning",version:i}];if(typeof l!="string"||l==="")return[{code:"missing-signature",message:`Package ${t}@${i} has signatures but no dist.integrity to verify against.`,packageName:t,severity:"warning",version:i}];const h=C(t,i,l),g=[];for(const a of f){const d=k.get(a.keyid);if(d===void 0){g.push({code:"unknown-keyid",keyid:a.keyid,message:`Package ${t}@${i} was signed with an unrecognized keyid (${a.keyid}).`,packageName:t,severity:"error",version:i});continue}if(A(d,m)){g.push({code:"expired-key",keyid:a.keyid,message:`Package ${t}@${i} was signed with an expired key (${a.keyid}, expired ${d.expires??"unknown"}).`,packageName:t,severity:n,version:i});continue}j({keyBase64:d.key,message:h,signatureBase64:a.sig})||g.push({code:"invalid-signature",keyid:a.keyid,message:`Package ${t}@${i} signature did not verify against ${a.keyid}.`,packageName:t,severity:"error",version:i})}return g})).flat()};export{Y as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,j as C,O as K}from"./registry-CkoaWkjP.js";import{A}from"./getRandomSpinner-DX11qCB2-CoIsn7ZU.js";import{j as S}from"../packem_chunks/cli-main.js";const h=100,T=2147483647,m={delta:0,frame:0,time:0};function k(n){const{interval:i=h,isActive:e=!0}=n??{},t=L(i),{renderThrottleMs:c,subscribe:v}=r.useContext(S),[s,M]=r.useState(0),[R,p]=r.useState(m),o=r.useRef(0),f=r.useRef(0),b=r.useRef({isActive:e,resetKey:s,safeInterval:t}),l=b.current,j=e&&(t!==l.safeInterval||!l.isActive||s!==l.resetKey),d=r.useCallback(()=>{M(u=>u+1)},[]);return r.useLayoutEffect(()=>{if(!e)return;p(m);let u=0;const{startTime:x,unsubscribe:E}=v(a=>{if(c>0&&a<o.current)return;const y=a-u,I=a-f.current;f.current=a,o.current=a+c,p({delta:I,frame:Math.floor(y/t),time:y})},t);return u=x,f.current=x,o.current=u+c,E},[t,e,v,c,s]),r.useLayoutEffect(()=>{b.current={isActive:e,resetKey:s,safeInterval:t}},[e,t,s]),j?{...m,reset:d}:{...R,reset:d}}function L(n){return Number.isFinite(n)?Math.min(T,Math.max(1,n)):h}function F({type:n="dots"}){const i=A(n)??A("dots"),e=i?.frames??[" "],{frame:t}=k({interval:i?.interval??80});return C.jsx(K,{children:e[t%e.length]})}export{F as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as W,j,O as H}from"./registry-CkoaWkjP.js";import{I as S,R as v,o as R,a as q,h as C,c as E,i as I,d as K,t as w,w as L,r as M}from"./Table-Bo1JKNCN-CGGet8ES.js";const _={ascii:M,block:L,default:w,dots:K,double:I,markdown:E,minimal:C,none:q,rounded:R,thick:v},z=e=>typeof e=="string"?{key:e}:e,A=({borderStyle:e="default",columns:d,data:n,formatCell:a,formatHeader:s,maxWidth:f,padding:i=1,showHeader:l=!0,skeleton:u="",wordWrap:h=!1})=>{const y=W.useMemo(()=>{if(n.length===0)return"";let o;if(d?o=d.map(t=>z(t)):o=Object.keys(n[0]).map(t=>({key:t})),o.length===0)return"";const x=typeof e=="string"?_[e]??w:e,g=o.map(t=>t.width),b=g.some(t=>t!==void 0),c=new S({columnWidths:b?g:void 0,maxWidth:f,showHeader:l,style:{border:x,paddingLeft:i,paddingRight:i},wordWrap:h});if(l){const t=o.map(r=>{const m=r.header??r.key;return s?s(r.key):m});c.setHeaders(t)}for(const[t,r]of n.entries()){const m=o.map(k=>{const p=r[k.key];return a?a(p,k.key,t):p==null?u:String(p)});c.addRow(m)}return c.toString()},[e,d,n,a,s,f,i,l,u,h]);return j.jsx(H,{children:y})},J=A;export{J as q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as u,r as o,X as y,O as A}from"./registry-CkoaWkjP.js";import{C as L}from"../packem_chunks/cli-main.js";function _({children:n}){return u.jsx(u.Fragment,{children:n})}const O=/^\d$/u,U=n=>n!=null&&typeof n=="object"&&"props"in n&&"name"in n.props,V=n=>{const s=[];for(const t of o.Children.toArray(n))U(t)&&s.push(t);return s},S=(n,s)=>n.some(t=>s[t]),W=(n,s,t)=>n?s?{backgroundColor:t?.activeTab?.backgroundColor??"green",color:t?.activeTab?.color??"black"}:{backgroundColor:"gray",color:"black"}:{backgroundColor:void 0,color:void 0};function J({children:n,colors:s,defaultValue:t,flexDirection:b="row",isFocused:x,keyMap:l,onChange:M,showIndex:q=!0,value:k,width:g}){const a=V(n),c=a.length,d=o.useRef(a);d.current=a;const i=b==="column"||b==="column-reverse",C=k!==void 0,[z,B]=o.useState(()=>{const r=k??t;if(r==null||c===0)return 0;const e=a.findIndex(p=>p.props.name===r);return e===-1?0:e}),h=C?Math.max(0,a.findIndex(r=>r.props.name===k)):z,G=o.useCallback(()=>{},[]),f=C?G:B,m=o.useRef(M);m.current=M,o.useEffect(()=>{if(C)return;const r=d.current[h];r&&m.current(r.props.name,r)},[]);const D=o.useMemo(()=>l?.previous??[i?"upArrow":"leftArrow"],[l?.previous,i]),I=o.useMemo(()=>l?.next??[i?"downArrow":"rightArrow"],[l?.next,i]),R=l?.useNumbers??!0,T=l?.useTab??!0,j=o.useRef(h);j.current=h;const E=o.useCallback(r=>{f(r);const e=d.current[r];e&&m.current(e.props.name,e)},[f]),w=o.useCallback(()=>{const r=(j.current+1)%c;f(r);const e=d.current[r];e&&m.current(e.props.name,e)},[c,f]),v=o.useCallback(()=>{const r=(j.current-1+c)%c;f(r);const e=d.current[r];e&&m.current(e.props.name,e)},[c,f]);L(o.useCallback((r,e)=>{if(S(D,e)){v();return}if(S(I,e)){w();return}if(e.tab&&T&&x==null){e.shift?v():w();return}if(R&&e.meta&&O.test(r)){const p=r==="0"?9:Number.parseInt(r,10)-1;p<c&&E(p)}},[D,I,T,R,x,v,w,c,E]),{isActive:x!==!1});const X=typeof g=="number"?g:6,H=o.useMemo(()=>i?"─".repeat(X):" | ",[i,X]);return u.jsx(y,{flexDirection:b,width:g,children:a.map((r,e)=>{const{name:p}=r.props,F=W(h===e,x!==!1,s);let N=null;return q&&(N=u.jsxs(A,{color:"grey",children:[e+1,"."," "]})),u.jsxs(y,{flexDirection:b,children:[e!==0&&u.jsx(A,{color:"dim",children:H}),u.jsxs(y,{children:[N,u.jsx(A,{backgroundColor:F.backgroundColor,color:F.color,children:r})]})]},p)})})}export{_ as a,J as n};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{childEnvNameFilter as d,resolveChildEnvPolicy as E,buildChildEnv as f}from"@visulima/task-runner";import{r as l,l as _}from"./target-options-DsHFmRZH.js";const S="VIS_AFFECTED_FILES",F="visTaskArgEnv",a=["FNM_*","FORCE_COLOR","NODE_EXTRA_CA_CERTS","NO_COLOR","VIS_MONOREPO_ROOT","VIS_VERSION"],h={INIT_CWD:"the directory `vis run` was invoked from",VIS_AFFECTED_FILES:"affected file paths, when `affectedFiles` is `env` or `both`",VIS_TASK_SLOTS:"the effective parallelism, for nested worker pools"},T=e=>({INIT_CWD:e.initCwd,VIS_TASK_SLOTS:String(e.taskSlots),...e.envFileVars,...e.serviceEnv,...e.execEnv,...e.affectedFilesEnv,...e.taskArgEnv}),u=(e,o)=>{const n=E(e,o);return n.mode==="clean"?{allow:[...n.allow,...a],mode:"clean"}:n},A=(e,o=process.platform)=>d({allow:[...e,...a],mode:"clean"},o),p=(e,o,n=process.platform)=>e.mode==="clean"?{env:f({injected:o,parentEnv:process.env,platform:n,policy:{allow:e.allow,mode:"clean"}}),inheritEnv:!1}:{env:o,inheritEnv:!0},c=e=>{const o=e.overrides.visOptions;if(o&&typeof o=="object")return o},C=(e,o,n)=>{const s=`${o}\0${typeof n=="string"?n:String(n)}`,r=e.get(s);if(r)return r;const t=_(o,n);return e.set(s,t),t},R=e=>({...e,envFileCache:new Map}),w=e=>e.segment===void 0?e.id:e.id.slice(0,e.id.lastIndexOf("#")),I=(e,o,n={})=>{const s=c(o),r=l(e.workspaceRoot,n.cwd??o.projectRoot,s?.runFromWorkspaceRoot===!0),t=s?.envFile?C(e.envFileCache,r,s.envFile):void 0,i={};e.affectedFiles&&e.affectedFiles.length>0&&(s?.affectedFiles==="env"||s?.affectedFiles==="both")&&(i[S]=e.affectedFiles.join(`
|
|
2
2
|
`));const v=T({affectedFilesEnv:i,envFileVars:t,execEnv:n.env,initCwd:e.initCwd,serviceEnv:e.serviceEnvByTaskId?.get(w(o)),taskArgEnv:o.overrides[F],taskSlots:e.taskSlots});return p(e.childEnvPolicy(o),v)},N=(e,o)=>{const n=l(e.workspaceRoot,o.projectRoot,c(o)?.runFromWorkspaceRoot===!0);return{cwd:n,...I(e,o,{cwd:n})}};export{S as A,F as T,a as V,h as a,R as b,A as c,N as d,u as e,c as g,I as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as $}from"node:module";import{X as j,b as k}from"./index.server-Ca_EEVfw.js";import{e as D}from"./index-BzhrR_iC.js";import{g as M}from"./_commonjsHelpers-DTfxOvZk.js";import{c as g,p as i}from"../packem_chunks/cli-main.js";import{y as A}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as R}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";let _;const z=e=>(_??=$(import.meta.url))(e),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=e=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[o,t]=l.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return l.getBuiltinModule(e)}return z(e)},{createInterface:S}=T("node:readline");var B=["aj","aju","av","avj","ejv","jav","jv"],C=["angula","angular-node","angularjs"],E=["auto-prefixer"],L=["aaxios","aios","axio","axioos","axios-node","axioss","axis","axiso","axois","axos","axxios"],O=["abel","babbel","babe","babel-js","babel-node","babl","bable","bbael","bebel"],F=["bcrpyt","bcrypt-node","brcypt","crypt","dcrypt"],I=["bcryptjs-node","dcryptjs"],P=["bunan","bunya","bunyan-node","buynan"],U=["cai","cha","chaijs","chal","chi","chia","hai"],W=["cahlk","calk","cchalk","ch4lk","cha1k","chaalk","chaik","chak","chakl","chalk-node","chalkk","challk","chhalk","chlak","chlk","halk","hcalk"],V=["cheero","cherio"],X=["c0lor","ccolor","clor","colo","coloor","color-js","colorjs","colorr","colr","coolor","coolr"],J=["ccolors","colors-node","colorss","colorz","colrs","coolors"],Y=["c0mmander","ccommander","cmmander","cmomander","co-mmander","comamnder","comander","comm4nder","commaander","commader","commadner","commamder","command3r","commandder","commande","commandeer","commander-js","commanderr","commandr","commandre","commanedr","commaner","commannder","commender","commmander","commnader","commnder","coommander","ocmmander","ommander"],G=["cor","corss","cos","cosr","cros","crs","ors"],H=["days"],K=["d3bug","dbeug","dbug","ddebug","debbug","debg","debgu","debu","debu9","debug-js","debug-node","debugg","debugjs","debuug","deebug","deubg","deug","ebug","edbug"],Q=["dot-env","dotenv-node","dotenvjs","dotevn"],Z=["3lectron","eectron","eelctron","eelectron","el3ctron","elcetron","elctron","elecctron","elecron","elecrton","electon","electorn","electr0n","electrn","electrno","electro","electrom","electron-node","electronn","electroon","electrron","electtron","eleectron","eletcron","eletron","ellectron","lectron","leectron"],N=["asbuild","ebuild","esbuild-node","esbuildjs","ezbuild","sbuild"],ee=["aslint","elint","eslint-js","eslint-node","eslit","ezlint","slint"],oe=["eexpress","epress","epxress","experss","expess","exppress","expreess","expres","express-node","expressjs","expresss","exprress","exprses","exprss","exress","exrpess","exxpress","xepress","xpress"],se=["astify"],te=["firebasejs"],re=["form1dable"],ae=["glb","glo","glob-js","globjs","gob","golb","lob"],ce=["go","goot","gotjs","gott","gt","gto","ogt","ot","qot"],ne=["helmetjs","helnet"],ie=["homo","hon","hoo","hoon","ohno","ono"],de=["inquire","inquirer-js","nquirer"],le=["io.redis","iredis"],me=["ejst","est","jast","jes","jestjs","jestt","jet","jets","jst"],pe=["imp","jim","jip","jmp"],ue=["ji","jio","jo","joii","jol","oi","oji"],he=["jdom","jsdm","jsdo","jsdom-js","jsdon","jsom","sdom"],ve=["jsonwebtoken-js","jsonwebtoken-node"],be=["ka","kao","ko","koaa","koajs","koe","oa","oka"],je=["1odash","iodash","l0dash","ldash","ldoash","llodash","lo-dash","loadsh","loash","lobash","lod4sh","lodaash","lodah","lodahs","lodas","lodash-node","lodashh","lodassh","loddash","lodesh","lodsah","lodsh","loodash","odash","oldash"],ke=["luca","luci","lucie"],fe=["luon","luxo","luxon-js"],ge=["imcromatch","mciromatch","micormatch","micrmoatch","micro-match","microamtch","micromacth","micromathc","micromtach","mircomatch"],ye=["minimath"],xe=["mcha","mmocha","moca","moch","mocha-js","moha","nocha","ocha"],we=["m0ment","mment","mmoent","mmoment","moemnt","moent","mom3nt","momeent","momemt","momen","momen7","momennt","moment-js","momentjs","momentt","momet","mometn","momment","momnet","momnt","monent","mooment","oment","omment"],qe=["mognoose","mogoose","mongoos","mongose","monqoose","moongoose"],$e=["moran","organ"],_e=["muler","multer-js","muter"],ze=["mysql"],Te=["ext","mext","n3xt","naxt","net","netx","nex","next-js","next-node","nextjs","nxt"],Se=["node-mailer","nodemailer-js"],De=["nodemo","nodemon-node","nodemonjs","nodmeon"],Me=["oar","or","ora-node","ore","ra","roa"],Ae=["arcel","parce","parceljs"],Re=["passport-js"],Be=["phase","phaser-node"],Ce=["ino","pimo","pin","pino-node","pinojs","pio","pion"],Ee=["playright","playwright-js"],Le=["postcss-js","postcss-node","potscss"],Oe=["pettier","pprettier","pretier","prettierjs","prettierr","prtetier"],Fe=["prima","prism","prisma-js","prismajs","prizma"],Ie=["pupeteer"],Pe=["rada","rama","ramd","randa"],Ue=["eact","eract","r3act","raact","ract","raect","re4ct","reaact","reac","reac7","reacct","react-node","reactjs","reactt","reat","reatc","recat","rect","reeact","reect","rreact"],We=["erdis","radis","rdis","redi","redis-js","redis-node","rediss","rediz","reds","reis","rredis"],Ve=["resen","rsend"],Xe=["ollup","rollup-js","rollup-node"],Je=["ass","asss","sas","sass-node","sess","ssas","sss"],Ye=["emver","seemver","semver-node","semvre","senver","sever"],Ge=["sequelize-js","sequelize-node"],He=["harp","shap","shar","sharp-js","sharpjs"],Ke=["stipe","strip","stripe-node","tripe"],Qe=["supabase-js"],Ze=["suelte","svelt3","svelte-js","sveltejs","velte"],Ne=["tailwindcss-js"],eo=["auri","taui"],oo=["hree","htree","thee","there","three-js","three-node","tree"],so=["stx","sx","ts","tsxx","ttsx","tx","txs","tzx"],to=["ttypescript","typecript","typescipt","typescript-node","typescriptjs","typescrit","typescritp"],ro=["udnerscore","under_score","undercore","underscoer","underscore-node","underscroe","undersocre","undesrcore"],ao=["uid","uud","uudi","uui","uuid-js","uuid-node","uuidjs","vuid"],co=["ite","vie","vit","vita","vite-node","vitee","vlte","vte"],no=["itest","uitest","vitestjs","vitezt","vittest","vtest"],io=["ue","uue","uve","ve","veu","vu","vu3","vua","vue-node","vuee","vuejs","vuue","vve","vvue"],lo=["web-pack","weback","webpac","webpack-node","webpackjs","webpak","weebpack","wepack","wepback"],mo=["winson","winston-js","winstoon"],po=["up","uyp","yp","yu","yupjs","yupp"],uo=["od","zd","zdo","zo","zob","zod-js","zodjs"];const ho={"@tanstack/start":["tanstack-cli"],ajv:B,angular:C,autoprefixer:E,"aws-sdk":["awssdk","ews-sdk"],axios:L,babel:O,bcrypt:F,bcryptjs:I,"body-parser":["body-paresr","body-parse","body-parser-js","body_parser"],bunyan:P,chai:U,chalk:W,cheerio:V,color:X,colors:J,commander:Y,"cookie-parser":["cookie-parse","cookie-parser-js","cookieparser"],cors:G,"cross-env":["crossenv"],"date-fns":["data-fns","date-fn"],dayjs:H,debug:K,dotenv:Q,electron:Z,esbuild:N,eslint:ee,express:oe,fastify:se,firebase:te,formidable:re,glob:ae,got:ce,helmet:ne,hono:ie,inquirer:de,ioredis:le,jest:me,jimp:pe,joi:ue,jsdom:he,jsonwebtoken:ve,koa:be,lodash:je,lucia:ke,luxon:fe,micromatch:ge,minimatch:ye,mocha:xe,moment:we,mongoose:qe,morgan:$e,multer:_e,mysql2:ze,next:Te,"node-fetch":["node-fecth","node-fethc","node.fetch"],nodemailer:Se,nodemon:De,ora:Me,parcel:Ae,passport:Re,phaser:Be,pino:Ce,playwright:Ee,postcss:Le,prettier:Oe,prisma:Fe,puppeteer:Ie,ramda:Pe,react:Ue,"react-dom":["eact-dom","eract-dom","r3act-dom","ract-dom","raect-dom","re4ct-dom","reaact-dom","reac-dom","reac7-dom","reacct-dom","react-bom","react-d0m","react-ddom","react-dm","react-dmo","react-do","react-domm","react-don","react-doom","react-odm","react-om","react.dom","reactdom","reactt-dom","reat-dom","reatc-dom","recat-dom","rect-dom","reeact-dom","rreact-dom"],redis:We,resend:Ve,rollup:Xe,sass:Je,semver:Ye,sequelize:Ge,sharp:He,"socket.io":["ocket.io","oscket.io","scket.io","scoket.io","soccket.io","socekt.io","socet.io","sock3t.io","socke.io","socke7.io","sockeet.io","socket-io","socket.1o","socket.i","socket.iio","socket.ioo","socket.lo","socket.o","socket.oi","socket_io","socketio","sockett.io","sockket.io","sockt.io","sockte.io","sokcet.io","soket.io","soocket.io","ssocket.io"],stripe:Ke,supabase:Qe,svelte:Ze,tailwindcss:Ne,tauri:eo,three:oo,"ts-node":["tts-node"],tsx:so,typescript:to,underscore:ro,uuid:ao,vite:co,vitest:no,vue:io,webpack:lo,winston:mo,yup:po,zod:uo};var h,f;function vo(){return f||(f=1,h={"@tanstack/start":["start-tanstack-app","tanstack","tanstack-app","tanstack-start"]}),h}var bo=vo();const jo=M(bo),ko={a:["4","e"],b:["d"],d:["b"],e:["3","a"],g:["9","q"],i:["1","l"],l:["1","i"],m:["n"],n:["m"],o:["0"],s:["5","z"],t:["7"],u:["v"],v:["u"]},fo=["app","cli","core","kit","lib","pkg","sdk"],go=e=>{const o=new Set;if(e.length<3)return o;for(let s=0;s<e.length;s++){const a=e[s],c=a==="-"||a==="."||a==="_";if(c||o.add(e.slice(0,s)+e.slice(s+1)),c||o.add(e.slice(0,s)+a+e.slice(s)),s<e.length-1&&e[s]!==e[s+1]){const u=e[s+1]==="-"||e[s+1]==="."||e[s+1]==="_";if(!c&&!u){const d=[...e];[d[s],d[s+1]]=[d[s+1],d[s]],o.add(d.join(""))}}const n=e[s].toLowerCase(),b=ko[n];if(b)for(const u of b)o.add(e.slice(0,s)+u+e.slice(s+1))}const t=/[-._]/g;if(t.test(e))o.add(e.replaceAll(t,"")),o.add(e.replaceAll(t,"-")),o.add(e.replaceAll(t,".")),o.add(e.replaceAll(t,"_"));else if(e.length>5)for(let s=2;s<e.length-2;s++)o.add(`${e.slice(0,s)}-${e.slice(s)}`),o.add(`${e.slice(0,s)}.${e.slice(s)}`),o.add(`${e.slice(0,s)}_${e.slice(s)}`);if(e.startsWith("@")||(o.add(`${e}-js`),o.add(`${e}js`),o.add(`${e}-node`)),e.startsWith("@")){const s=e.indexOf("/");if(s>1&&s<e.length-1){const a=e.slice(1,s),c=e.slice(s+1);a.length>=3&&o.add(a);for(const n of["","-",".","_"])o.add(`${a}${n}${c}`),o.add(`${c}${n}${a}`);for(const n of fo)o.add(`${a}-${n}`),o.add(`${c}-${a}-${n}`),o.add(`${n}-${a}-${c}`)}}return o.delete(e),o};let v,p,m;const y=()=>{if(!v){const e={};for(const o of[ho,jo])for(const[t,r]of Object.entries(o)){const s=e[t]??(e[t]=[]);for(const a of r)s.includes(a)||s.push(a)}v=e}return v},yo=()=>{if(!p){p=new Map;for(const[e,o]of Object.entries(y()))for(const t of o)p.set(t,e)}return p},xo=()=>{if(!m){m=new Map;for(const e of Object.keys(y()))for(const o of go(e))m.has(o)||m.set(o,e)}return m},wo=e=>e.startsWith("@")?e.split("/")[1]??e:e,qo=e=>{const o=wo(e),t=yo().get(o);if(t)return{input:e,legitimate:t,method:"blocklist"};const r=xo().get(o);if(r)return{input:e,legitimate:r,method:"heuristic"}},x=(e,o)=>{const t=o?new Set(o):void 0,r=[];for(const s of e){if(t?.has(s))continue;const a=qo(s);a&&r.push(a)}return r},w=(e,o)=>{i.warn(""),i.warn(j(`Possible typosquat${e.length===1?"":"s"} ${o}:`));for(const t of e){const r=t.method==="blocklist"?"known typosquat":"similar name";i.warn(` ${k("⚠")} ${j(t.input)} — did you mean ${k(t.legitimate)}? (${r})`)}i.warn("")},q=async e=>{if(!process.stdin.isTTY){i.warn("Aborting: potential typosquat detected in non-interactive mode. Use --no-typosquat-check to skip.");return}const o=S({input:process.stdin,output:process.stdout}),t=await new Promise(r=>{o.question(e,s=>{r(s.trim().toLowerCase())})});return o.close(),t},Co=async(e,o)=>{if(g("typosquats"))return{ok:!0,packages:e};const t=x(e,o);if(t.length===0)return{ok:!0,packages:e};w(t,"detected");const r=await q(`Use suggested package${t.length===1?"":"s"} instead? [S]uggested / [y]es, keep original / [N]o, abort (default: N) `);if(r===void 0)return{ok:!1,packages:e};if(r==="s"||r==="suggested"){const s=new Map(t.map(c=>[c.input,c.legitimate]));return{ok:!0,packages:e.map(c=>s.get(c)??c)}}return r==="y"||r==="yes"?{ok:!0,packages:e}:{ok:!1,packages:e}},$o=/^(?:npm|pnpm|yarn):(.+?)(?:@.*)?$/,_o=e=>$o.exec(e)?.[1],zo=e=>{if(!A(e))return[];const o=R(e),t={...o.dependencies,...o.devDependencies,...o.optionalDependencies,...o.peerDependencies},r=new Set;for(const[s,a]of Object.entries(t)){r.add(s);const c=_o(a);c&&r.add(c)}return[...r]},Eo=async(e,o)=>{if(g("typosquats"))return!0;const t=D(e,"package.json"),r=zo(t);if(r.length===0)return!0;const s=x(r,o);if(s.length===0)return!0;w(s,"in package.json dependencies"),i.warn("Fix the package name in package.json before proceeding.");const a=await q("Continue anyway? [y/N] ");return a==="y"||a==="yes"};export{Co as r,Eo as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,k as o}from"./registry-CkoaWkjP.js";const f=(u,a)=>{const t=r.useRef(null),[s,n]=r.useState(u);return r.useLayoutEffect(()=>{if(!t.current)return;const{height:e}=o(t.current);e>0&&e!==s&&(n(e),a?.(e))}),{measuredHeight:s,ref:t}};export{f as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,X as t,O as r,r as p}from"./registry-CkoaWkjP.js";import{J as ae,K as je,L as pe,M as fe,C as me,N as z,Q as ce}from"../packem_chunks/cli-main.js";import{l as we}from"./spinner-Bqjpz3i4.js";import{s as xe}from"./env-BSXG3QKH.js";import{n as Ce,a as be}from"./tabs-CC0GJLww.js";import{u as Te}from"./use-measured-height-_nYuZ-Au.js";const _e=({current:a,total:l})=>{const{columns:i}=ae(),s=i||80,d=l>0?Math.min(1,a/l):0,h=`${String(Math.round(d*100)).padStart(3)}%`,f=`${String(a)}/${String(l)}`,w=Math.max(10,s-2-h.length-1),g=Math.round(w*d),j=w-g;return e.jsxs(t,{flexDirection:"column",paddingX:1,children:[e.jsxs(t,{children:[e.jsx(we,{type:"dots"}),e.jsx(r,{children:" Checking catalog dependencies "}),e.jsx(r,{dimColor:!0,children:f})]}),e.jsxs(t,{children:[e.jsx(r,{color:"cyan",children:"━".repeat(g)}),e.jsx(r,{dimColor:!0,children:"─".repeat(j)}),e.jsxs(r,{dimColor:!0,children:[" ",h]})]})]})},J=["default","name","updateType","severity"],ne=a=>{const l=a.vulnerabilities?.map(i=>i.severity)??[];return l.includes("CRITICAL")?4:l.includes("HIGH")?3:l.includes("MODERATE")?2:l.includes("LOW")?1:0},de={digest:0,major:3,minor:2,patch:1,pin:0,unknown:0},he=(a,l)=>{if(l==="default")return a;const i=[...a];return l==="name"?i.sort((s,d)=>s.packageName.localeCompare(d.packageName)):l==="updateType"?i.sort((s,d)=>(de[d.updateType]??0)-(de[s.updateType]??0)||s.packageName.localeCompare(d.packageName)):i.sort((s,d)=>ne(d)-ne(s)||s.packageName.localeCompare(d.packageName)),i},Z=a=>`${a.ecosystem}|${a.file}:${String(a.line)}|${a.name}`,I=a=>`${a.catalogName} ${a.packageName}`,W=a=>{const l=new Map;for(const i of a){const s=l.get(i.catalogName);s?s.push(i):l.set(i.catalogName,[i])}return l},$=(a,l,i)=>{let s=a;if(l!=="all"&&(s=l==="security"?s.filter(d=>d.vulnerabilities&&d.vulnerabilities.length>0||d.socketReport&&d.socketReport.alerts.length>0):s.filter(d=>d.updateType===l)),i){const d=i.toLowerCase();s=s.filter(h=>h.packageName.toLowerCase().includes(d))}return s};class Ue{#e;#t=new Set;#l;#s;#i=null;constructor(l,i=null,s=[]){this.#l=l,this.#s=s,i&&(this.#i=new Map(i.recommendations.map(d=>[d.package,d]))),this.#e={aiResult:i,allChecked:!0,applyProgress:null,checkedEcosystemKeys:new Set(s.map(d=>Z(d))),checkedEntries:new Set(l.map(d=>I(d))),ecosystemEntries:s,entries:l,error:null,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",groupedByCatalog:W(l),phase:"browsing",selectedIndex:0,sortMode:"default"}}getSnapshot=()=>this.#e;subscribe=l=>(this.#t.add(l),()=>{this.#t.delete(l)});getFilteredEntries(){return he($(this.#l,this.#e.filterType,this.#e.filterText),this.#e.sortMode)}setSortMode(l){if(l===this.#e.sortMode)return;const s=this.getFilteredEntries()[this.#e.selectedIndex]?.packageName,d=he($(this.#l,this.#e.filterType,this.#e.filterText),l),h=s?Math.max(0,d.findIndex(f=>f.packageName===s)):0;this.#r({...this.#e,selectedIndex:h,sortMode:l})}cycleSortMode(){const l=J.indexOf(this.#e.sortMode),i=J[(l+1)%J.length]??"default";this.setSortMode(i)}getRecommendation(l){return this.#i?.get(l)}getCheckedEntries(){return this.#l.filter(l=>this.#e.checkedEntries.has(I(l)))}getCheckedEcosystemEntries(){return this.#s.filter(l=>this.#e.checkedEcosystemKeys.has(Z(l)))}toggleEcosystemCheck(l){const i=new Set(this.#e.checkedEcosystemKeys);i.has(l)?i.delete(l):i.add(l),this.#r({...this.#e,checkedEcosystemKeys:i})}checkAllEcosystem(){this.#r({...this.#e,checkedEcosystemKeys:new Set(this.#s.map(l=>Z(l)))})}uncheckAllEcosystem(){this.#r({...this.#e,checkedEcosystemKeys:new Set})}setSelectedIndex(l){const i=this.getFilteredEntries(),s=Math.max(0,Math.min(l,i.length-1));s!==this.#e.selectedIndex&&this.#r({...this.#e,selectedIndex:s})}setFocusedPanel(l){l!==this.#e.focusedPanel&&this.#r({...this.#e,focusedPanel:l})}setFilterType(l){if(l!==this.#e.filterType){const i=$(this.#l,l,this.#e.filterText);this.#r({...this.#e,entries:i,filterType:l,groupedByCatalog:W(i),selectedIndex:0})}}setFilter(l){const i=$(this.#l,this.#e.filterType,l);this.#r({...this.#e,entries:i,filterText:l,groupedByCatalog:W(i),selectedIndex:0})}setFilterActive(l){if(l!==this.#e.filterActive)if(l)this.#r({...this.#e,filterActive:!0});else{const i=$(this.#l,this.#e.filterType,"");this.#r({...this.#e,entries:i,filterActive:!1,filterText:"",groupedByCatalog:W(i),selectedIndex:0})}}toggleCheck(l){const i=I(l),s=new Set(this.#e.checkedEntries);s.has(i)?s.delete(i):s.add(i),this.#r({...this.#e,allChecked:s.size===this.#l.length,checkedEntries:s})}checkAll(){this.#r({...this.#e,allChecked:!0,checkedEntries:new Set(this.#l.map(l=>I(l)))})}uncheckAll(){this.#r({...this.#e,allChecked:!1,checkedEntries:new Set})}toggleAll(){this.#e.allChecked?this.uncheckAll():this.checkAll()}startApply(){const l=this.getCheckedEntries();this.#r({...this.#e,applyProgress:{current:0,total:l.length},phase:"applying"})}updateApplyProgress(l){this.#e.applyProgress&&this.#r({...this.#e,applyProgress:{...this.#e.applyProgress,current:l}})}markDone(){this.#r({...this.#e,phase:"done"})}setError(l){this.#r({...this.#e,error:l,phase:"error"})}#r(l){this.#e=l;for(const i of this.#t)try{i()}catch{}}}const Se={major:"red",minor:"yellow",patch:"green"},ke={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},ye={critical:"red",high:"red",low:"gray",medium:"yellow"},Ee={critical:"red",high:"red",low:"green",medium:"yellow"},Re={defer:"gray",review:"yellow",skip:"red",update:"green"},Ae=({changelogUrl:a,entry:l,focused:i,recommendation:s,scrollRef:d})=>{const h=i?"white":"gray";if(!l)return e.jsx(t,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:e.jsx(r,{dimColor:!0,children:"No package selected"})});const f=Se[l.updateType]??"white",w=l.vulnerabilities&&l.vulnerabilities.length>0,g=l.socketReport?.score.overall??0,j=l.socketReport?xe(g):"gray";return e.jsxs(t,{borderColor:h,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[e.jsx(t,{flexShrink:0,paddingTop:1,paddingX:2,children:e.jsx(r,{bold:!0,color:"white",children:l.displayName??l.packageName})}),e.jsxs(je,{flexGrow:1,flexShrink:1,paddingX:2,ref:d,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:[e.jsx(r,{}),e.jsxs(t,{children:[e.jsx(t,{width:12,children:e.jsx(r,{dimColor:!0,children:"Current:"})}),e.jsx(r,{children:l.currentRange})]}),e.jsxs(t,{children:[e.jsx(t,{width:12,children:e.jsx(r,{dimColor:!0,children:"Target:"})}),e.jsx(r,{children:l.newRange}),e.jsxs(r,{bold:!0,color:f,children:[" ","(",l.updateType,")"]})]}),e.jsxs(t,{children:[e.jsx(t,{width:12,children:e.jsx(r,{dimColor:!0,children:"Version:"})}),e.jsx(r,{children:l.targetVersion})]}),e.jsxs(t,{children:[e.jsx(t,{width:12,children:e.jsx(r,{dimColor:!0,children:l.kind==="ecosystem"?"Source:":"Catalog:"})}),e.jsx(r,{color:l.kind==="ecosystem"?"cyan":void 0,children:l.catalogName})]}),l.acceptedRisk&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{color:"gray",children:"── "}),e.jsx(r,{bold:!0,color:"gray",children:"ACKNOWLEDGED RISK"}),e.jsxs(t,{flexDirection:"column",paddingLeft:2,children:[e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Reason: "}),e.jsx(r,{children:l.acceptedRisk.reason})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Accepted: "}),e.jsx(r,{children:l.acceptedRisk.acceptedAt.slice(0,10)})]})]})]}),w&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"red",children:"SECURITY"}),e.jsx(r,{}),l.vulnerabilities.map(c=>e.jsxs(t,{flexDirection:"column",marginBottom:1,children:[e.jsxs(t,{gap:1,children:[e.jsxs(r,{bold:!0,color:ke[c.severity]??"gray",children:["⚠"," ",c.severity]}),e.jsx(r,{bold:!0,children:c.id})]}),e.jsx(t,{paddingLeft:2,children:e.jsx(r,{children:c.summary})}),e.jsxs(t,{gap:2,paddingLeft:2,children:[c.cvssScore!==void 0&&e.jsxs(r,{dimColor:!0,children:["CVSS:",String(c.cvssScore)]}),c.fixedVersions.length>0&&e.jsxs(r,{dimColor:!0,children:["Fixed in:",c.fixedVersions.join(", ")]})]})]},c.id))]}),l.socketReport&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"cyan",children:"SOCKET.DEV"}),e.jsx(r,{}),e.jsxs(t,{gap:2,children:[e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Overall: "}),e.jsxs(r,{bold:!0,color:j,children:[String(Math.round(g*100)),"%"]})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Supply Chain: "}),e.jsxs(r,{children:[String(Math.round(l.socketReport.score.supplyChain*100)),"%"]})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Quality: "}),e.jsxs(r,{children:[String(Math.round(l.socketReport.score.quality*100)),"%"]})]})]}),e.jsxs(t,{gap:2,children:[e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Maintenance: "}),e.jsxs(r,{children:[String(Math.round(l.socketReport.score.maintenance*100)),"%"]})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Vulnerability: "}),e.jsxs(r,{children:[String(Math.round(l.socketReport.score.vulnerability*100)),"%"]})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"License: "}),e.jsxs(r,{children:[l.socketReport.license||"unknown"," ","(",String(Math.round(l.socketReport.score.license*100)),"%)"]})]})]}),l.socketReport.alerts.length>0&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsxs(r,{bold:!0,color:"yellow",children:["⚠"," ",String(l.socketReport.alerts.length)," ","alert",l.socketReport.alerts.length===1?"":"s",":"]}),l.socketReport.alerts.map(c=>e.jsxs(t,{gap:1,paddingLeft:2,children:[e.jsxs(r,{bold:!0,color:ye[c.severity]??"gray",children:["[",c.severity.toUpperCase(),"]"]}),e.jsx(r,{children:c.type}),e.jsxs(r,{dimColor:!0,children:["(",c.category,")"]})]},c.key))]})]}),s&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"AI ANALYSIS"}),e.jsx(r,{}),e.jsxs(t,{gap:2,children:[e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Action: "}),e.jsx(r,{bold:!0,color:Re[s.action]??"white",children:s.action})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Risk: "}),e.jsx(r,{bold:!0,color:Ee[s.riskLevel]??"white",children:s.riskLevel})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Effort: "}),e.jsx(r,{bold:!0,children:s.effort})]})]}),s.reason&&e.jsx(t,{marginTop:1,paddingLeft:2,children:e.jsx(r,{children:s.reason})}),s.breakingChanges.length>0&&e.jsxs(t,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[e.jsx(r,{bold:!0,color:"yellow",children:"Breaking changes:"}),s.breakingChanges.map((c,v)=>e.jsxs(r,{children:[" ","•"," ",c]},String(v)))]})]}),a&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"CHANGELOG"}),e.jsx(t,{marginTop:1,paddingLeft:2,children:e.jsx(r,{color:"cyan",underline:!0,children:a})})]}),e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"LINKS"}),e.jsx(t,{flexDirection:"column",marginTop:1,paddingLeft:2,children:l.kind==="ecosystem"?e.jsx(r,{color:"cyan",underline:!0,children:l.detailUrl??l.displayName??l.packageName}):e.jsxs(r,{color:"cyan",underline:!0,children:["https://npmx.dev/",l.packageName]})})]}),!s&&l.kind!=="ecosystem"&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"GUIDANCE"}),e.jsxs(t,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[l.updateType==="major"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"red",children:["⚠"," ","Major update — likely contains breaking changes."]}),e.jsx(r,{dimColor:!0,children:" Review the changelog before updating."}),e.jsx(r,{dimColor:!0,children:" Use --changelog to fetch release URLs."})]}),l.updateType==="minor"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"yellow",children:["ℹ"," ","Minor update — new features, backward compatible."]}),e.jsx(r,{dimColor:!0,children:" Generally safe to update."})]}),l.updateType==="patch"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"green",children:["✓"," ","Patch update — bug fixes only."]}),e.jsx(r,{dimColor:!0,children:" Safe to update."})]}),!s&&e.jsx(r,{dimColor:!0,children:" Use --ai to get AI-powered analysis."})]})]})]})]})},Ie={major:"red",minor:"yellow",patch:"green"},ve=[{id:"all",label:"All"},{id:"major",label:"Major"},{id:"minor",label:"Minor"},{id:"patch",label:"Patch"},{id:"security",label:"Security"}],Me=({checked:a,entry:l,isSelected:i})=>{const s=Ie[l.updateType]??"white",d=l.vulnerabilities&&l.vulnerabilities.length>0,h=l.socketReport&&l.socketReport.alerts.length>0,f=!!l.acceptedRisk,w=a?"☑":"☐",g=l.socketReport?`${String(Math.round(l.socketReport.score.overall*100))}%`:"",j=l.socketReport?xe(l.socketReport.score.overall):"gray";return e.jsxs(t,{flexShrink:0,height:1,children:[e.jsx(r,{children:i?">":" "}),e.jsxs(r,{color:a?"white":"gray",children:[" ",w," "]}),d||h?e.jsx(r,{color:f?"gray":"red",children:f?"✓ ":"⚠ "}):e.jsx(r,{children:" "}),e.jsx(t,{flexGrow:1,children:e.jsxs(r,{bold:i,inverse:i,wrap:"truncate",children:[l.displayName??l.packageName,f?" [ack]":""]})}),g&&e.jsxs(r,{color:j,children:[" ",g]}),e.jsxs(r,{dimColor:!0,children:[" ",l.currentRange]}),e.jsxs(r,{dimColor:!0,children:[" ","→"," "]}),e.jsxs(r,{children:[l.newRange," "]}),e.jsx(r,{bold:!0,color:s,children:l.updateType})]})},Ne=({count:a,ecosystem:l=!1,name:i})=>e.jsxs(t,{flexShrink:0,height:1,marginTop:1,children:[e.jsxs(r,{color:l?"cyan":void 0,dimColor:!l,children:[l?"◈":"▼"," "]}),e.jsx(r,{bold:!0,color:l?"cyan":"white",children:i.toUpperCase()}),e.jsxs(r,{dimColor:!0,children:[" ","(",a,")"]}),l&&e.jsxs(r,{color:"cyan",dimColor:!0,children:[" ","ci/cd refs"]})]}),De=({checkedEntries:a,entries:l,filterActive:i,filteredOutCount:s,filterText:d,filterType:h,focused:f,groupedByCatalog:w,isDryRun:g,onViewportHeightChange:j,scrollOffset:c,selectedIndex:v,totalCatalogEntries:M,totalChecked:E,totalEntries:K,viewportHeight:P})=>{const B=f?"white":"gray",{measuredHeight:m,ref:R}=Te(P,j);let V=0,y=0,N=0,A=0;for(const u of l)u.updateType==="major"?V++:u.updateType==="minor"?y++:N++,(u.vulnerabilities&&u.vulnerabilities.length>0||u.socketReport&&u.socketReport.alerts.length>0)&&A++;const b=[];V>0&&b.push(`${V} major`),y>0&&b.push(`${y} minor`),N>0&&b.push(`${N} patch`),A>0&&b.push(`${A} vulnerable`);const D=b.length>0?` (${b.join(", ")})`:"",C=l.filter(u=>u.kind==="ecosystem").length,T=l.length-C;let F=0;for(const u of l)a.has(I(u))&&F++;const O=[];let H=0;for(const[u,S]of w){O.push(e.jsx(Ne,{count:S.length,ecosystem:S[0]?.kind==="ecosystem",name:u},`hdr-${u}`));for(const k of S){const q=H;O.push(e.jsx(Me,{checked:a.has(I(k)),entry:k,isSelected:q===v},I(k))),H++}}let L=0;for(const[,u]of w)L+=2+u.length;const _=L>m&&m>0;return e.jsxs(t,{borderColor:B,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[e.jsxs(t,{flexShrink:0,gap:1,paddingX:1,children:[e.jsx(r,{bold:!0,inverse:!0,children:" VIS "}),e.jsxs(r,{wrap:"truncate",children:[C>0?T:K,E>0?`/${E}`:""," ",C>0?"pkgs":"outdated",D,M>E?` · ${M-E} dupes`:""]}),C>0&&e.jsxs(r,{color:"cyan",children:[" ","◈",C," ","ci/cd"]}),!g&&F>0&&e.jsxs(r,{dimColor:!0,children:[" ","—",F," ","selected"]})]}),e.jsx(t,{flexShrink:0,paddingX:1,paddingY:1,children:e.jsx(Ce,{isFocused:f,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:()=>{},showIndex:!1,value:h,children:ve.map(({id:u,label:S})=>e.jsx(be,{name:u,children:S},u))})}),i&&e.jsxs(t,{flexShrink:0,paddingX:1,children:[e.jsx(r,{bold:!0,color:"white",children:"/ "}),e.jsx(r,{children:d}),e.jsx(r,{inverse:!0,children:" "})]}),s>0&&e.jsx(t,{flexShrink:0,paddingX:1,children:e.jsxs(r,{color:"yellow",children:["⚠"," ",s," ","package",s===1?"":"s"," ","filtered out by target constraint — press"," ",e.jsx(r,{bold:!0,color:"white",children:"f"})," ","to view"]})}),e.jsxs(t,{flexDirection:"row",flexGrow:1,overflow:"hidden",ref:R,children:[e.jsx(t,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:e.jsx(t,{flexDirection:"column",marginTop:-c,children:O})}),_&&e.jsx(t,{flexShrink:0,marginLeft:1,marginRight:1,children:e.jsx(pe,{contentHeight:L,placement:"inset",scrollOffset:c,style:"block",viewportHeight:m})})]},`list-${h}-${d}`)]})},Le=100,Pe=40,Be=10,Ve=[],G=["all","major","minor","patch","security"],Ye=({autoExitSeconds:a=0,changelogUrls:l,checkedCount:i=0,filteredOutEntries:s=Ve,isDryRun:d,store:h,totalCatalogEntries:f=0})=>{const{exit:w}=fe(),{columns:g,rows:j}=ae(),c=p.useSyncExternalStore(h.subscribe,h.getSnapshot),[v,M]=p.useState(!1),[E,K]=p.useState(!1),P=p.useRef(null),B=p.useRef(null),m=p.useRef(null),R=p.useRef(null),[V,y]=p.useState(0),[N,A]=p.useState(!1),[b,D]=p.useState(!1),C=p.useMemo(()=>h.getFilteredEntries(),[c.entries,c.filterType,c.filterText,c.sortMode]),T=C[c.selectedIndex]??null,F=T?h.getRecommendation(T.packageName):void 0,O=T&&l?l.get(T.packageName):void 0,H=p.useCallback(o=>{let n=0,x=0;for(const[,Q]of c.groupedByCatalog){n+=2;for(let oe=0;oe<Q.length;oe++){if(x===o)return n;n+=1,x++}}return n},[c.groupedByCatalog]),L=Math.max(1,j-8-(c.filterActive?1:0)),[_,u]=p.useState(L),S=_>0?_:L,k=p.useCallback(o=>{const n=H(o);y(x=>n>x+S-2?Math.max(0,n-S+2):n<x+1?Math.max(0,n-1):x)},[H,S]);if(p.useEffect(()=>{m.current?.scrollToTop()},[T?.packageName]),me((o,n)=>{if(o==="c"&&n.ctrl){w();return}if(!b){if(E){n.escape||o==="f"||o==="q"?K(!1):n.downArrow||o==="j"?B.current?.scrollBy(1):(n.upArrow||o==="k")&&B.current?.scrollBy(-1);return}if(N){o==="u"||n.return?(A(!1),h.startApply(),w(h.getCheckedEntries())):n.escape||o==="q"?A(!1):n.downArrow||o==="j"?R.current?.scrollBy(1):n.upArrow||o==="k"?R.current?.scrollBy(-1):n.pageDown?R.current?.scrollBy(5):n.pageUp&&R.current?.scrollBy(-5);return}if(v){n.escape||o==="?"?M(!1):o==="q"?(M(!1),D(!0)):n.downArrow||o==="j"?P.current?.scrollBy(1):(n.upArrow||o==="k")&&P.current?.scrollBy(-1);return}if(o==="?"){M(!0);return}if(o==="q"){D(!0);return}if(n.tab){h.setFocusedPanel(c.focusedPanel==="list"?"detail":"list");return}if(c.focusedPanel==="list"&&(n.leftArrow||n.rightArrow)){const x=G.indexOf(c.filterType),Q=n.rightArrow?(x+1)%G.length:(x-1+G.length)%G.length;y(0),m.current?.scrollToTop(),h.setFilterType(G[Q]);return}if(o==="f"&&s.length>0){K(x=>!x);return}if(c.filterActive){if(n.escape){h.setFilterActive(!1);return}if(n.return){h.setFilterActive(!1);return}if(n.backspace){y(0),h.setFilter(c.filterText.slice(0,-1));return}if(o&&!n.ctrl&&!n.meta){y(0),h.setFilter(c.filterText+o);return}return}if(c.focusedPanel==="list"){if(n.downArrow||o==="j"){const x=Math.min(c.selectedIndex+1,C.length-1);h.setSelectedIndex(x),k(x);return}if(n.upArrow||o==="k"){const x=Math.max(c.selectedIndex-1,0);h.setSelectedIndex(x),k(x);return}if(n.pageDown){const x=Math.min(c.selectedIndex+10,C.length-1);h.setSelectedIndex(x),k(x);return}if(n.pageUp){const x=Math.max(c.selectedIndex-10,0);h.setSelectedIndex(x),k(x);return}if(n.home){h.setSelectedIndex(0),y(0);return}if(n.end){const x=C.length-1;h.setSelectedIndex(x),k(x);return}if(o===" "||n.return){T&&h.toggleCheck(T);return}if(o==="a"){h.toggleAll();return}if(o==="s"){h.cycleSortMode(),k(h.getSnapshot().selectedIndex);return}if(o==="/"){h.setFilterActive(!0);return}if(o==="u"&&!d&&c.checkedEntries.size>0){A(!0);return}if(n.rightArrow){h.setFocusedPanel("detail");return}return}if(c.focusedPanel==="detail"){if(n.escape||n.leftArrow){h.setFocusedPanel("list");return}if(n.downArrow||o==="j"){m.current?.scrollBy(1);return}if(n.upArrow||o==="k"){m.current?.scrollBy(-1);return}if(n.pageDown){m.current?.scrollBy(10);return}if(n.pageUp){m.current?.scrollBy(-10);return}if(n.home){m.current?.scrollToTop();return}n.end&&m.current?.scrollToBottom()}}},{isActive:!0}),g<Pe||j<Be)return e.jsx(t,{alignItems:"center",height:j,justifyContent:"center",width:g,children:e.jsxs(r,{color:"yellow",children:["Terminal too small (",g,"x",j,")"]})});const q=g>=Le,U=[e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"q"}),e.jsx(r,{dimColor:!0,children:"QUIT"})]},"q"),e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"?"}),e.jsx(r,{dimColor:!0,children:"HELP"})]},"?"),e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"}),e.jsx(r,{dimColor:!0,children:"NAV"})]},"nav"),e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"Space"}),e.jsx(r,{dimColor:!0,children:"CHECK"})]},"sp"),e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"a"}),e.jsx(r,{dimColor:!0,children:"ALL"})]},"a")];!d&&c.checkedEntries.size>0&&U.push(e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"green",children:"u"}),e.jsx(r,{dimColor:!0,children:"APPLY"})]},"u")),s.length>0&&U.push(e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"yellow",children:"f"}),e.jsxs(r,{dimColor:!0,children:["FILTERED (",s.length,")"]})]},"fo")),U.push(e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"←→"}),e.jsx(r,{dimColor:!0,children:"FILTER"})]},"lr"),e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"/"}),e.jsx(r,{dimColor:!0,children:"SEARCH"})]},"f"),e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"Tab"}),e.jsx(r,{dimColor:!0,children:"PANEL"})]},"t"));const ee=e.jsx(t,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:e.jsx(t,{flexWrap:"wrap",gap:2,paddingX:1,children:U})}),re=e.jsxs(z,{footer:e.jsxs(r,{dimColor:!0,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",e.jsx(r,{bold:!0,color:"white",children:"?"}),"/",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:P,title:"KEYBOARD SHORTCUTS",visible:v,width:52,children:[e.jsxs(t,{flexDirection:"column",marginBottom:1,children:[e.jsxs(t,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"NAVIGATION"})]}),e.jsxs(t,{children:[e.jsx(t,{width:24,children:e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","↑","/k"]}),e.jsx(r,{dimColor:!0,children:" Move up"})]})}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","↓","/j"]}),e.jsx(r,{dimColor:!0,children:" Move down"})]})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","Tab"]}),e.jsx(r,{dimColor:!0,children:" Switch panel"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","→","/","←"]}),e.jsx(r,{dimColor:!0,children:" Focus detail/list"})]})]}),e.jsxs(t,{flexDirection:"column",marginBottom:1,children:[e.jsxs(t,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"SELECTION"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","Space"]}),e.jsx(r,{dimColor:!0,children:" Toggle check on package"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","a"]}),e.jsx(r,{dimColor:!0,children:" Toggle check all"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","s"]}),e.jsx(r,{dimColor:!0,children:" Cycle sort (default / name / type / severity)"})]})]}),e.jsxs(t,{flexDirection:"column",marginBottom:1,children:[e.jsxs(t,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"FILTERS"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","←→"]}),e.jsx(r,{dimColor:!0,children:" Switch filter tab"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","/"]}),e.jsx(r,{dimColor:!0,children:" Text filter"})]}),s.length>0&&e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","f"]}),e.jsx(r,{dimColor:!0,children:" View filtered-out packages"})]})]}),e.jsxs(t,{flexDirection:"column",children:[e.jsxs(t,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"ACTIONS"})]}),!d&&e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","u"]}),e.jsx(r,{dimColor:!0,children:" Apply selected updates"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","q"]}),e.jsx(r,{dimColor:!0,children:" Quit"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","?"]}),e.jsx(r,{dimColor:!0,children:" Toggle help"})]})]})]}),Y=h.getCheckedEntries(),X=Y.filter(o=>o.updateType==="major").length,ue=e.jsxs(t,{alignItems:"center",flexDirection:"column",children:[X>0&&e.jsx(t,{marginBottom:1,marginTop:1,children:e.jsxs(r,{color:"yellow",children:["⚠"," ",X," ","major update",X===1?"":"s"," ","— review breaking changes"]})}),e.jsxs(r,{dimColor:!0,children:["Press"," ",e.jsx(r,{bold:!0,color:"white",children:"u"})," ","or"," ",e.jsx(r,{bold:!0,color:"white",children:"Enter"})," ","to confirm,"," ",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","to cancel"]})]}),le=e.jsx(z,{footer:ue,scrollRef:R,title:`Apply ${Y.length} update${Y.length===1?"":"s"}?`,visible:N,width:70,children:Y.map(o=>e.jsxs(t,{gap:1,children:[e.jsxs(r,{children:[" ",o.displayName??o.packageName]}),e.jsxs(r,{dimColor:!0,children:[o.currentRange," ","→"," ",o.newRange]}),e.jsx(r,{bold:!0,color:o.updateType==="major"?"red":o.updateType==="minor"?"yellow":"green",children:o.updateType})]},o.packageName))}),te=s.length>0?e.jsx(z,{footer:e.jsxs(r,{dimColor:!0,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",e.jsx(r,{bold:!0,color:"white",children:"f"}),"/",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:B,title:`${s.length} PACKAGE${s.length===1?"":"S"} FILTERED BY TARGET`,visible:E,width:70,children:e.jsxs(t,{flexDirection:"column",children:[e.jsx(t,{marginBottom:1,children:e.jsxs(r,{dimColor:!0,children:["These packages have newer versions available but are excluded by the current target constraint. Use"," ",e.jsx(r,{bold:!0,color:"white",children:"--target latest"})," ","to include them."]})}),s.map(o=>e.jsxs(t,{gap:1,children:[e.jsxs(r,{children:[" ",o.packageName]}),e.jsxs(r,{dimColor:!0,children:[o.currentRange," ","→"," ",o.newRange]}),e.jsx(r,{bold:!0,color:o.updateType==="major"?"red":o.updateType==="minor"?"yellow":"green",children:o.updateType})]},o.packageName))]})}):null,se=e.jsx(De,{checkedEntries:c.checkedEntries,entries:C,filterActive:c.filterActive,filteredOutCount:s.length,filterText:c.filterText,filterType:c.filterType,focused:c.focusedPanel==="list",groupedByCatalog:c.groupedByCatalog,isDryRun:d,onViewportHeightChange:u,scrollOffset:V,selectedIndex:c.selectedIndex,totalCatalogEntries:f,totalChecked:i,totalEntries:C.length,viewportHeight:S}),ie=e.jsx(Ae,{changelogUrl:O,entry:T,focused:c.focusedPanel==="detail",recommendation:F,scrollRef:m});if(q){const o=Math.floor(g*.35);return e.jsxs(t,{flexDirection:"column",height:j,width:g,children:[e.jsxs(t,{flexDirection:"row",flexGrow:1,children:[e.jsx(t,{flexGrow:1,children:se}),e.jsx(t,{width:o,children:ie})]}),ee,le,te,e.jsx(ce,{autoExitSeconds:a||3,onCancel:()=>{D(!1)},visible:b}),re]})}const ge=Math.floor(j*.55);return e.jsxs(t,{flexDirection:"column",height:j,width:g,children:[e.jsx(t,{height:ge,children:se}),e.jsx(t,{flexGrow:1,children:ie}),ee,le,te,e.jsx(ce,{autoExitSeconds:a||3,onCancel:()=>{D(!1)},visible:b}),re]})};export{_e as C,Ue as U,Ye as V,Z as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as Dt}from"node:module";import{t as fe,b as Bt,u as F,p as Wt,c as Oe,n as zt,i as Ft,a as Gt,P as Me}from"./package-version-
|
|
1
|
+
import{createRequire as Dt}from"node:module";import{t as fe,b as Bt,u as F,p as Wt,c as Oe,n as zt,i as Ft,a as Gt,P as Me}from"./package-version-DqYSd_ia.js";let Tt;const Vt=t=>(Tt??=Dt(import.meta.url))(t),se=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,jt=t=>{if(typeof se<"u"&&se.versions&&se.versions.node){const[e,n]=se.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return se.getBuiltinModule(t)}return Vt(t)},{createRequire:Rt}=jt("node:module"),qt=16,we=32,Ht=64,R=128,he="positionals";let oe=class extends Error{loc;title;hint;type="VisulimaError";constructor({cause:e,hint:n,location:o,message:i,name:s,stack:l,title:r}){super(i,{cause:e}),this.title=r,this.name=s,this.stack=l??this.stack,this.loc=o,this.hint=n}setLocation(e){this.loc=e}setName(e){this.name=e}setMessage(e){this.message=e}setHint(e){this.hint=e}},C=class extends oe{code;context;constructor(e,n,o){super({message:e,name:"CerebroError"}),this.code=n,this.context=o}},Jt=class extends C{argument;choices;value;constructor(e,n,o){super(`Invalid value "${n}" for argument "${e}". Allowed values: ${o.join(", ")}`,"INVALID_CHOICE",{argument:e,choices:o,value:n}),this.name="InvalidArgumentChoiceError",this.argument=e,this.value=n,this.choices=o,this.hint=`Pass one of: ${o.join(", ")}`}},Kt=class extends C{commandName;missingArguments;constructor(e,n){super(`Command "${e}" is missing required arguments: ${n.join(", ")}`,"MISSING_ARGUMENT",{commandName:e,missingArguments:n}),this.name="MissingArgumentError",this.commandName=e,this.missingArguments=n,this.hint=`Provide the following positional arguments: ${n.join(", ")}`}},Zt=class extends C{commandName;surplusArguments;constructor(e,n,o){super(`Command "${e}" accepts ${String(o)} positional argument${o===1?"":"s"}, but got ${String(n.length)} extra: ${n.join(", ")}`,"SURPLUS_ARGUMENT",{commandName:e,surplusArguments:[...n]}),this.name="SurplusArgumentError",this.commandName=e,this.surplusArguments=n,this.hint=`Remove the extra argument${n.length===1?"":"s"}, or declare a trailing "multiple: true" argument to collect them.`}};const at=String.raw,Pe=at`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Yt=()=>new RegExp(at`\p{RI}{2}|(?)${Pe}(?:\u200D${Pe})*`,"gu"),$i=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,Ni=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,G=Yt(),Qt=/[-_./\s]+/g,pe=/(\u001B\[[0-9;]*[a-z])/i,Ue=new RegExp("\\p{Script=Arabic}","u"),Xt=new RegExp("\\p{Script=Bengali}","u"),ee=new RegExp("\\p{Script=Cyrillic}","u"),en=new RegExp("\\p{Script=Devanagari}","u"),tn=new RegExp("\\p{Script=Ethiopic}","u"),ve=new RegExp("\\p{Script=Greek}","u"),De=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),nn=new RegExp("\\p{Script=Gujarati}","u"),on=new RegExp("\\p{Script=Gurmukhi}","u"),Te=new RegExp("\\p{Script=Hangul}","u"),Ve=new RegExp("\\p{Script=Hebrew}","u"),sn=new RegExp("\\p{Script=Hiragana}","u"),je=new RegExp("\\p{Script=Han}","u"),rn=new RegExp("\\p{Script=Kannada}","u"),an=new RegExp("\\p{Script=Katakana}","u"),cn=new RegExp("\\p{Script=Khmer}","u"),ln=new RegExp("\\p{Script=Lao}","u"),L=new RegExp("\\p{Script=Latin}","u"),un=new RegExp("\\p{Script=Malayalam}","u"),hn=new RegExp("\\p{Script=Myanmar}","u"),pn=new RegExp("\\p{Script=Oriya}","u"),dn=new RegExp("\\p{Script=Sinhala}","u"),fn=new RegExp("\\p{Script=Tamil}","u"),mn=new RegExp("\\p{Script=Telugu}","u"),gn=new RegExp("\\p{Script=Thai}","u"),wn=new RegExp("\\p{Script=Tibetan}","u"),Re=/[\u02BB\u02BC\u0027]/u,vn=t=>t.replace(G,""),V={COMMAND_NOT_FOUND:"COMMAND_NOT_FOUND",COMMAND_VALIDATION_ERROR:"COMMAND_VALIDATION_ERROR",CONFLICTING_OPTIONS:"CONFLICTING_OPTIONS",INVALID_ARGUMENT:"INVALID_ARGUMENT",INVALID_CHOICE:"INVALID_CHOICE",INVALID_INPUT:"INVALID_INPUT",MISSING_ARGUMENT:"MISSING_ARGUMENT",SURPLUS_ARGUMENT:"SURPLUS_ARGUMENT",UNKNOWN_OPTION:"UNKNOWN_OPTION"},yn=new Set([V.COMMAND_NOT_FOUND,V.COMMAND_VALIDATION_ERROR,V.CONFLICTING_OPTIONS,V.INVALID_ARGUMENT,V.INVALID_CHOICE,V.INVALID_INPUT,V.MISSING_ARGUMENT,V.SURPLUS_ARGUMENT,V.UNKNOWN_OPTION]),$n=t=>{const e=t?.code;return typeof e=="string"&&yn.has(e)},_e=t=>{if(!$n(t))return;const{hint:e,message:n}=t,o=(Array.isArray(e)?e:[e]).filter(i=>typeof i=="string"&&i.length>0);return o.length>0?[n,...o].join(`
|
|
2
2
|
`):n},B=new Uint32Array(65536),Nn=(t,e)=>{const n=t.length,o=e.length,i=1<<n-1;let s=-1,l=0,r=n,u=n;for(;u--;)B[t.charCodeAt(u)]|=1<<u;for(u=0;u<o;u++){let a=B[e.charCodeAt(u)];const c=a|l;a|=(a&s)+s^s,l|=~(a|s),s&=a,l&i&&r++,s&i&&r--,l=l<<1|1,s=s<<1|~(c|l),l&=c}for(u=n;u--;)B[t.charCodeAt(u)]=0;return r},An=(t,e)=>{const n=e.length,o=t.length,i=[],s=[],l=Math.ceil(n/32),r=Math.ceil(o/32);for(let p=0;p<l;p++)s[p]=-1,i[p]=0;let u=0;for(;u<r-1;u++){let p=0,w=-1;const $=u*32,m=Math.min(32,o)+$;for(let y=$;y<m;y++)B[t.charCodeAt(y)]|=1<<y;for(let y=0;y<n;y++){const A=B[e.charCodeAt(y)],O=s[y/32|0]>>>y&1,b=i[y/32|0]>>>y&1,D=A|p,k=((A|b)&w)+w^w|A|b;let g=p|~(k|w),v=w&k;g>>>31^O&&(s[y/32|0]^=1<<y),v>>>31^b&&(i[y/32|0]^=1<<y),g=g<<1|O,v=v<<1|b,w=v|~(D|g),p=g&D}for(let y=$;y<m;y++)B[t.charCodeAt(y)]=0}let a=0,c=-1;const d=u*32,h=Math.min(32,o-d)+d;for(let p=d;p<h;p++)B[t.charCodeAt(p)]|=1<<p;let f=o;for(let p=0;p<n;p++){const w=B[e.charCodeAt(p)],$=s[p/32|0]>>>p&1,m=i[p/32|0]>>>p&1,y=w|a,A=((w|m)&c)+c^c|w|m;let O=a|~(A|c),b=c&A;f+=O>>>o-1&1,f-=b>>>o-1&1,O>>>31^$&&(s[p/32|0]^=1<<p),b>>>31^m&&(i[p/32|0]^=1<<p),O=O<<1|$,b=b<<1|m,c=b|~(y|O),a=O&y}for(let p=d;p<h;p++)B[t.charCodeAt(p)]=0;return f},xn=(t,e)=>{if(t.length<e.length){const n=e;e=t,t=n}return e.length===0?t.length:t.length<=32?Nn(t,e):An(t,e)};let Cn;const bn=t=>(Cn??=Rt(import.meta.url))(t),ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,On=t=>{if(typeof ie<"u"&&ie.versions&&ie.versions.node){const[e,n]=ie.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ie.getBuiltinModule(t)}return bn(t)},{writeFile:_n,stat:In,rm:kn,readFile:Be,readdir:En,mkdir:Sn,access:Ln}=On("node:fs/promises"),ce=[{alias:"v",description:"Turn on verbose output",group:"global",name:"verbose",type:Boolean},{description:"Turn on debugging output",group:"global",name:"debug",type:Boolean},{alias:"h",description:"Print out helpful usage information",group:"global",name:"help",type:Boolean},{alias:"q",description:"Silence output",group:"global",name:"quiet",type:Boolean},{alias:"V",description:"Print version info",group:"global",name:"version",type:Boolean},{description:"Turn off colored output",group:"global",name:"no-color",type:Boolean},{description:"Force colored output",group:"global",name:"color",type:Boolean}];let H=class extends C{commandName;constructor(e,n=[]){const o=`Command "${e}" not found${n.length>0?`. Did you mean: ${n.join(", ")}?`:""}`;super(o,"COMMAND_NOT_FOUND",{commandName:e,suggestions:n}),this.name="CommandNotFoundError",this.commandName=e,n.length>0&&(this.hint=`Try one of these commands: ${n.join(", ")}`)}};class ct extends C{option1;option2;constructor(e,n){super(`Options "${e}" and "${n}" cannot be used together`,"CONFLICTING_OPTIONS",{option1:e,option2:n}),this.name="ConflictingOptionsError",this.option1=e,this.option2=n,this.hint=`Remove either --${e} or --${n}`}}class Mn extends C{unknownOptions;constructor(e,n){const o=e.join(", "),i=`Found unknown ${e.length===1?"option":"options"}: ${o}`;super(i,"UNKNOWN_OPTION",{suggestions:n,unknownOptions:e}),this.name="UnknownOptionError",this.unknownOptions=e,n&&n.length>0&&(this.hint=`Did you mean: ${n.join(", ")}?`)}}class Pn extends C{pluginName;constructor(e,n,o){super(`Plugin "${e}" error: ${n}`,"PLUGIN_ERROR",{originalError:o,pluginName:e}),this.name="PluginError",this.pluginName=e,o&&(this.cause=o)}}class Un{logger;plugins=new Map;initialized=!1;cachedDependencyOrder=void 0;constructor(e){this.logger=e}hasPlugins(){return this.plugins.size>0}register(e){if(this.initialized)throw new Error(`Cannot register plugin "${e.name}" after initialization`);if(this.plugins.has(e.name))throw new Error(`Plugin "${e.name}" is already registered`);fe().CEREBRO_OUTPUT_LEVEL===String(R)&&this.logger.debug(`registering plugin: ${e.name}`),this.plugins.set(e.name,e),this.cachedDependencyOrder=void 0}async init(e){if(this.initialized)throw new Error("PluginManager already initialized");if(this.plugins.size===0){this.logger.debug("no plugins registered, skipping initialization"),this.initialized=!0;return}this.validateDependencies();const n=this.getDependencyOrder();this.logger.debug(`initializing ${String(n.length)} plugin(s)...`);for(const o of n)if(typeof o.init=="function"){this.logger.debug(`initializing plugin: ${o.name}`);try{await o.init(e)}catch(i){const s=new Pn(o.name,`Failed to initialize: ${i instanceof Error?i.message:String(i)}`,i instanceof Error?i:void 0);throw this.logger.error(s.message),s}}this.initialized=!0}async executeLifecycle(e,n,o){if(!this.initialized)throw new Error("PluginManager not initialized");if(this.plugins.size===0)return;const i=this.getDependencyOrder();for(const s of i){const l=s[e];if(typeof l=="function"){this.logger.debug(`executing ${e} hook for plugin: ${s.name}`);try{await(e==="afterCommand"?l(n,o):l(n))}catch(r){throw this.logger.error(`Error in ${e} hook for plugin "${s.name}":`,r),r}}}}async executeErrorHandlers(e,n){if(!this.initialized||this.plugins.size===0)return;const o=this.getDependencyOrder();for(const i of o)if(typeof i.onError=="function"){this.logger.debug(`executing error handler for plugin: ${i.name}`);try{await i.onError(e,n)}catch(s){this.logger.error(`Error in error handler for plugin "${i.name}":`,s)}}}getDependencyOrder(){if(this.cachedDependencyOrder!==void 0)return this.cachedDependencyOrder;const e=[],n=new Set,o=new Set,i=s=>{if(n.has(s))return;if(o.has(s))throw new Error(`Circular dependency detected involving plugin "${s}"`);const l=this.plugins.get(s);if(!l)throw new Error(`Plugin "${s}" not found`);if(o.add(s),l.dependencies)for(const r of l.dependencies)i(r);o.delete(s),n.add(s),e.push(l)};for(const s of this.plugins.keys())i(s);return this.cachedDependencyOrder=e,e}validateDependencies(){for(const e of this.plugins.values())if(e.dependencies){for(const n of e.dependencies)if(!this.plugins.has(n))throw new Error(`Plugin "${e.name}" depends on "${n}" which is not registered`)}}}const re=t=>t.type?.name==="Boolean",Dn=t=>{let e=t.type?t.type.name.toLowerCase():"string";const n=t.multiple??t.lazyMultiple?"[]":"";return e&&(e=e==="boolean"?"":`{underline ${e}${n}}`),e},We=t=>(re(t)||(t.typeLabel=t.typeLabel??Dn(t),t.defaultOption&&(t.typeLabel=`${t.typeLabel} (D)`),t.required&&(t.typeLabel=`${t.typeLabel} (R)`)),t),Tn=new RegExp(/^-([^\d-])$/),Vn=new RegExp(/^--(\S+)/),jn=new RegExp(/^-([^\d-]{2,})$/),Rn=t=>Tn.test(t)||Vn.test(t)||jn.test(t),Bn=(t,e)=>{const n=e[0]&&Rn(e[0])||e.length===0?null:e.shift()??null;if(!t.includes(n)){const o=new Error(`Command not recognised: ${String(n)}`);throw o.command=n,o.name="INVALID_COMMAND",o}return{argv:e,command:n}};let Wn=class lt extends oe{optionName;value;constructor(e,n,o){super({hint:`Pass a valid ${o} value for '${e}'.`,message:`Invalid ${o} value '${n}' for option '${e}'`,name:"INVALID_VALUE",title:"Invalid Value"}),this.optionName=e,this.value=n,Object.setPrototypeOf(this,lt.prototype)}},zn=class ut extends oe{optionName;constructor(e){super({cause:void 0,hint:`Remove the duplicate option '${e}' from your command line arguments.`,location:void 0,message:`Option '${e}' is already set`,name:"ALREADY_SET",stack:void 0,title:"Option Already Set"}),this.optionName=e,Object.setPrototypeOf(this,ut.prototype)}},ze=class ht extends oe{optionName;constructor(e){super({cause:void 0,hint:`Check your option definitions or remove the unknown option '${e}' from your command line arguments.`,location:void 0,message:`Unknown option: --${e}`,name:"UNKNOWN_OPTION",stack:void 0,title:"Unknown Option"}),this.optionName=`--${e}`,Object.setPrototypeOf(this,ht.prototype)}},Fn=class pt extends oe{value;constructor(e){super({hint:"Use a defined option or add a defaultOption to capture this value.",message:`Unknown value: ${e}`,name:"UNKNOWN_VALUE",title:"Unknown Value"}),this.value=e,Object.setPrototypeOf(this,pt.prototype)}},M=class dt extends oe{constructor(e,n){super({cause:void 0,hint:n,location:void 0,message:e,name:"INVALID_DEFINITIONS",stack:void 0,title:"Invalid Option Definition"}),Object.setPrototypeOf(this,dt.prototype)}};const Z=t=>t===Boolean||typeof t=="function"&&t.name==="Boolean",Ie=t=>t===Number||typeof t=="function"&&t.name==="Number",Fe=t=>t===String||typeof t=="function"&&t.name==="String",Ge=(t,e,n)=>{const o=Number(t);if(e&&Number.isNaN(o)&&String(t).trim().toLowerCase()!=="nan")throw new Wn(n??"",String(t),"Number");return o},Gn=(t,e,n={})=>{const{optionName:o,strictTypes:i}=n;return Array.isArray(t)?Z(e)?t.map(Boolean):Ie(e)?t.map(s=>Ge(s,i,o)):Fe(e)?t.map(String):t.map(s=>e(String(s))):t===null?null:Z(e)?!!t:Ie(e)?Ge(t,i,o):Fe(e)?typeof t=="string"?t:String(t):e(typeof t=="string"?t:String(t))},I=(t,e,n,...o)=>{t&&console.debug(`[command-line-args:${n}] ${e}`,...o)},qn=/-([a-z])/g,Hn=/^\d+$/,Jn=t=>t.codePointAt(0)===95,qe=(t,e)=>Array.isArray(t)?[...t,...e]:[t,...e],He=t=>t==="__proto__"||t==="constructor"||t==="prototype",ye=(t,e,n,o=!1)=>{t[e]===void 0?t[e]=o?[n]:n:o&&Array.isArray(t[e])?t[e].push(n):t[e]=[t[e],n]},Je=(t,e,n,o,i)=>{let s=e.get(t)??n.get(t);if(!s&&o){const l=t.toLowerCase();s=o.get(l)??i?.get(l)}return s},Kn=(t,e,n,o)=>{const i=n.debug??!1;I(i,"resolveArgs called with options:","resolver",{partial:n.partial,stopAtFirstUnknown:n.stopAtFirstUnknown}),I(i,"Starting argument resolution","resolver"),I(i,"Tokens:","resolver",t),I(i,"Definitions:","resolver",e),I(i,"Processing tokens...","resolver");const s=new Map,l=new Map,r=n.caseInsensitive?new Map:void 0,u=n.caseInsensitive?new Map:void 0,a=n.camelCase?new Map:void 0,c=n.camelCase?new Map:void 0;for(const g of e)if(s.set(g.name,g),g.alias&&l.set(g.alias,g),n.caseInsensitive&&r&&(r.set(g.name.toLowerCase(),g),g.alias&&u&&u.set(g.alias.toLowerCase(),g)),n.camelCase&&a&&c){const v=g.name.replaceAll(qn,(N,E)=>E.toUpperCase());a.set(g.name,v),c.set(v,g.name)}const d=Object.create(null),h=Object.create(null),f=[],p=[],w=new Set;let $=!1;const m=e.find(g=>g.defaultOption),y=e.some(g=>g.group),A=e.find(g=>Ie(g.type));for(let g=0;g<t.length;g++){const v=t[g];if(v.kind==="option-terminator"){d._unknown=o.slice(v.index),$=!0;break}if(v.kind==="option"&&v.name){let N=Je(v.name,s,l,r,u);!N&&v.value===void 0&&A&&Hn.test(v.name)&&(N=A,v.value=v.name,v.name=A.name);let E=!1;if(!N&&n.negation&&v.value===void 0&&v.name.startsWith("no-")){const _=v.name.slice(3),U=Je(_,s,l,r,u);U?.type&&Z(U.type)&&(N=U,E=!0)}const x=N?N.name:v.name,S=N?.multiple,P=N?.lazyMultiple;if(Object.hasOwn(h,x)&&h[x]!==void 0&&!S&&!P&&!n.partial)throw new zn(x);if(!N&&n.partial){const _=v.rawName??`--${v.name}${v.value!==void 0&&v.inlineValue?`=${v.value}`:""}`;f.push({index:v.index,value:_});continue}if(!N&&n.stopAtFirstUnknown){d._unknown=o.slice(v.index);break}if(!N&&!n.partial)throw new ze(v.name);if(v.value===void 0){const _=t[g+1],U=_?.kind==="option"&&!("name"in _)&&_.value!==void 0,T=_&&N&&!(N.type&&Z(N.type))&&(_.kind==="positional"||U),Ut=N&&N.defaultOption&&!N.multiple&&!N.lazyMultiple;if(T&&(!N?.defaultOption||Ut))if(S){let j=g+1;const ge=[];for(;j<t.length&&(t[j].kind==="positional"||t[j].kind==="option"&&!("name"in t[j])&&t[j].value!==void 0);)ge.push(t[j].value),w.add(t[j].index),j++;h[x]=h[x]===void 0?ge:qe(h[x],ge),g=j-1}else P?(ye(h,x,_.value,!0),w.add(_.index),g++):(h[x]=_.value,w.add(_.index),g++);else N?.type&&Z(N.type)?ye(h,x,!E,S):(S||P)&&h[x]!==void 0?ye(h,x,null,!0):h[x]=S?[]:null}else{let{value:_}=v;if(N?.type&&Z(N.type))switch(_){case"":{if(n.partial){const T=`${v.rawName??`--${v.name}`}${v.value?`=${v.value}`:""}`;p.push({index:v.index,value:T}),_=!0}else throw new ze(v.name);break}case"false":{_=!1;break}case"true":{_=!0;break}default:_=!0}const U=[_];if(S){let T=g+1;for(;T<t.length&&t[T].kind==="positional";)U.push(t[T].value),w.add(t[T].index),T++;g=T-1}h[x]===void 0?h[x]=S||P?U:_:S||P?h[x]=qe(h[x],U):h[x]=_}}else if(v.kind==="positional"&&n.stopAtFirstUnknown&&!w.has(v.index)&&!m){I(i,`Found unconsumed positional token at index ${String(v.index)}, stopping processing`,"resolver"),d._unknown=o.slice(v.index);break}}for(const[g,v]of Object.entries(h)){const N=s.get(g);N&&(N.multiple||N.lazyMultiple)&&!Array.isArray(v)&&(h[g]=[v])}const O=g=>g.kind==="option"&&!s.has(g.name??"")&&!l.has(g.name??"")&&(!n.caseInsensitive||!r?.has(g.name?.toLowerCase()??"")&&!u?.has(g.name?.toLowerCase()??""));let b=-1,D=Number.POSITIVE_INFINITY;if(n.stopAtFirstUnknown&&!$&&(b=t.findIndex(g=>O(g)),b!==-1&&(D=t[b].index)),m){const g=[],v=[];for(const N of t)N.kind==="positional"&&!w.has(N.index)&&N.index<D&&(g.push(N.value),v.push(N));if(g.length>0){const N=h[m.name],E=m.multiple??m.lazyMultiple;N===void 0?E?(v.forEach(x=>w.add(x.index)),h[m.name]=g):(w.add(v[0].index),h[m.name]=g[0]):E&&(v.forEach(x=>w.add(x.index)),h[m.name]=Array.isArray(N)?[...g,...N]:[...g,N])}}if(!n.partial){for(const g of t)if(g.kind==="positional"&&!w.has(g.index))throw new Fn(o[g.index])}if(n.partial&&!n.stopAtFirstUnknown){const g=[...f];for(const v of p)g.push({index:v.index,value:v.value});for(const v of t)v.kind==="positional"&&!w.has(v.index)&&g.push({index:v.index,value:o[v.index]});g.length>0&&(g.sort((v,N)=>v.index-N.index),d._unknown=g.map(v=>v.value))}if(n.stopAtFirstUnknown&&!$){const g=t.findIndex(N=>N.kind==="positional"&&!w.has(N.index));let v=-1;if(b!==-1&&g!==-1?v=Math.min(b,g):b!==-1?v=b:g!==-1&&(v=g),v>=0){const N=t[v].index;d._unknown=o.slice(N)}}for(const[g,v]of Object.entries(h)){const N=n.camelCase?a?.get(g)??g:g,E=s.get(g);E?.type?d[N]=Gn(v,E.type,{optionName:E.name,strictTypes:n.strictTypes}):d[N]=v===void 0?null:v}for(const g of e){const v=n.camelCase?a?.get(g.name)??g.name:g.name;!(v in d)&&g.defaultValue!==void 0&&(g.multiple??g.lazyMultiple?d[v]=Array.isArray(g.defaultValue)?[...g.defaultValue]:[g.defaultValue]:d[v]=g.defaultValue)}if(y){const g={},v={},N={};for(const x of e)if(x.group){const S=Array.isArray(x.group)?x.group:[x.group];for(const P of S)He(P)||(g[P]??={})}for(const x of Object.keys(d))if(!Jn(x)){v[x]=d[x];let S=x;n.camelCase&&(S=c?.get(x)??x);const P=s.get(S);if(P?.group){const _=Array.isArray(P.group)?P.group:[P.group];for(const U of _)He(U)||g[U]&&(g[U][x]=d[x])}else N[x]=d[x]}const E={_all:v};for(const[x,S]of Object.entries(g))E[x]=S;Object.keys(N).length>0&&(E._none=N),d._unknown&&(E._unknown=d._unknown),Object.keys(d).forEach(x=>delete d[x]),Object.assign(d,E)}const k=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));return I(i,"Final parsed result:","resolver",k),k},ft="-",ne=ft.codePointAt(0),Y="=",Zn=Y.codePointAt(0),Yn="--",Qn=ft,Xn="--",mt=t=>t.length>2&&t.startsWith(Xn),eo=t=>mt(t)&&!t.includes(Y,3),to=t=>mt(t)&&t.includes(Y,3),no=t=>{if(t.length!==2||t.codePointAt(0)!==ne||t.codePointAt(1)===ne)return!1;const e=t.codePointAt(1);return e!==void 0&&(e<48||e>57)},oo=t=>{if(t.length<=2||t.codePointAt(0)!==ne||t.codePointAt(1)===ne)return!1;const e=t.codePointAt(1);return!(e!==void 0&&e>=48&&e<=57)},so=t=>{const e=[];let n=0,o=[],i=0,s=-1,l=0;for(;i<o.length||n<t.length;){let r;if(i<o.length?(r=o[i],i++):(r=t[n],n++),l>0?l--:s++,r===Yn){e.push({index:s,kind:"option-terminator"});const u=[...o.slice(i),...t.slice(n)],a=u.map((c,d)=>({index:s+d+1,kind:"positional",value:c}));e.push(...a),s+=u.length;break}if(no(r)){const u=r.charAt(1);e.push({index:s,kind:"option",name:u,rawName:r});continue}if(oo(r)&&!r.includes(Y)){const u=[];let a="",c=!1;for(let d=1;d<r.length;d++){const h=r.charAt(d);c?a+=h:h.codePointAt(0)===Zn?c=!0:u.push(`${Qn}${h}`)}if(c)if(u.length>0){const d=u.pop();u.push(`${d}=${a}`)}else u.push(a);o=i<o.length?[...u,...o.slice(i)]:u,i=0,l=u.length;continue}if(eo(r)){const u=r.slice(2);e.push({index:s,kind:"option",name:u,rawName:r});continue}if(to(r)){const u=r.indexOf(Y),a=r.slice(2,u),c=r.slice(u+1);e.push({index:s,inlineValue:!0,kind:"option",name:a,rawName:r,value:c});continue}if(r.length>2&&r.codePointAt(0)===ne&&r.codePointAt(1)!==ne&&r.includes(Y)){const u=r.indexOf(Y),a=r.charAt(1),c=r.slice(u+1);e.push({index:s,inlineValue:!0,kind:"option",name:a,rawName:r,value:c});continue}e.push({index:s,kind:"positional",value:r})}return e},io=/\d/,ro=t=>typeof t=="function",ao=(t,e,n)=>{const o=n?.debug??!1;I(o,"Validating definitions:","validation",t,"caseInsensitive:",e);const i=new Set,s=new Set,l=new Set,r=new Set;let u=0;for(const a of t){if(I(o,"Checking definition:","validation",a),!a.name)throw I(o,"Validation failed: name is required","validation"),new M("Invalid option definition: name is required");if(typeof a.name!="string")throw new M("Invalid option definition: name must be a string");if(a.name.trim()==="")throw new M("Invalid option definition: name cannot be empty");const c=e?a.name.toLowerCase():"";if(i.has(a.name)||e&&l.has(c))throw new M(`Invalid option definition: duplicate name '${a.name}'`);if(s.has(a.name)||e&&r.has(c))throw new M(`Invalid option definition: name '${a.name}' conflicts with an existing alias`);if(i.add(a.name),e&&l.add(c),a.alias!==void 0){if(typeof a.alias!="string")throw new M("Invalid option definition: alias must be a string");if(a.alias.length!==1)throw new M("Invalid option definition: alias must be a single character");if(io.test(a.alias))throw new M("Invalid option definition: alias cannot be numeric");if(a.alias==="-")throw new M('Invalid option definition: alias cannot be "-"');const d=e?a.alias.toLowerCase():"";if(s.has(a.alias)||e&&r.has(d))throw new M(`Invalid option definition: duplicate alias '${a.alias}'`);if(i.has(a.alias)||e&&l.has(d))throw new M(`Invalid option definition: alias '${a.alias}' conflicts with an existing option name`);s.add(a.alias),e&&r.add(d)}if(a.defaultOption&&(u++,a.type!==void 0&&Z(a.type)))throw new M("Invalid option definition: defaultOption cannot be Boolean type");if(a.type!==void 0&&!(a.type===Boolean||a.type===Number||a.type===String||typeof a.type=="function"&&ro(a.type)))throw new M("Invalid option definition: invalid type")}if(u>1)throw I(o,"Validation failed: multiple defaultOptions not allowed","validation"),new M("Invalid option definition: multiple defaultOptions not allowed");I(o,"Validation completed successfully","validation")};function co(t,e={}){const n=e.debug??!1;I(n,"Starting command-line-args parsing","index"),I(n,"Options:","index",e);const o={...e};o.stopAtFirstUnknown&&(o.partial=!0);const i=Array.isArray(t)?t:[t];I(n,"Normalized definitions:","index",i),ao(i,o.caseInsensitive,n?o:void 0);let{argv:s}=o;s??=process.argv.slice(2),I(n,"Using argv:","index",s);let l=s;o.caseInsensitive&&(l=s.map(a=>{if(a.startsWith("--")){const c=a.indexOf("="),d=(c===-1?a.slice(2):a.slice(2,c)).toLowerCase();return c===-1?`--${d}`:`--${d}${a.slice(c)}`}if(a.startsWith("-")&&!a.startsWith("--")&&a.length>1){const c=a.indexOf("="),d=c===-1?a.slice(1):a.slice(1,c);if(!d)return a;const h=d.toLowerCase();return c===-1?`-${h}`:`-${h}${a.slice(c)}`}return a}));const r=so(l.map(String));I(n,"Tokenized arguments:","index",r);const u=Kn(r,i,o,s);return I(n,"Command-line-args parsing completed","index"),u}class lo{result;argv;options;argument;args;command;commandName;env;logger;console;fs;process;runtime;rawUnknown;rawArgv;constructor(e,n){this.commandName=e,this.command=n}}let $e=class extends C{commandName;constructor(e,n,o){super(`Failed to load command "${e}": ${n}`,"COMMAND_LOADER_ERROR",{commandName:e,reason:n}),this.name="CommandLoaderError",this.commandName=e,this.hint="Ensure the loader resolves to a module with a default export that is the command handler function.",o!==void 0&&(this.cause=o)}};const uo=/^-{1,2}(\w+)(=(.+))?$/,gt=(t,e,n,o)=>{const i=uo.exec(t);if(i===null)return{};const s=i[1];if(!s)return{};const l=n&&o?n.get(s)??o.get(s):e.find(r=>r.name===s||r.alias===s);return l!==void 0?{argName:l.name,argValue:i[3],option:l}:{}},Ke=(t,e)=>{if(e.type===void 0)return t;if(e.type.name==="Boolean"){if(t==="true"||t==="1")return e.type(!0);if(t==="false"||t==="0")return e.type(!1)}return e.type(t)},ho=new Set(["0","1","false","true"]),po=(t,e,n,o)=>{if(e.length===0||t.length===0)return{};const i=(s,l)=>{const{argName:r,argValue:u,option:a}=gt(l,e,n,o),{lastOption:c}=s;return a&&re(a)&&u&&r?s.partial[r]=Ke(u,a):s.lastName&&c&&re(c)&&ho.has(l)&&(s.partial[s.lastName]=Ke(l,c)),{lastName:r,lastOption:a,partial:s.partial}};return t.reduce(i,{partial:{}}).partial},fo=new Set(["0","1","false","true"]),mo=(t,e,n,o)=>{if(e.length===0||t.length===0)return t;const i=(s,l)=>{const{argValue:r,option:u}=gt(l,e,n,o),{lastOption:a}=s;if(a&&re(a)&&fo.has(l)){const{args:c}=s;return{args:c.slice(0,-1)}}return u&&re(u)&&r?{args:s.args}:{args:[...s.args,l],lastOption:u}};return t.reduce(i,{args:[]}).args},go=t=>{const e=new Map;for(const n of t){const o=e.get(n.name);o?e.set(n.name,{...o,...n}):e.set(n.name,n)}return[...e.values()]},wo=t=>{if(t===void 0)return;const e=t.toLowerCase().trim();return e==="true"||e==="1"||e==="yes"||e==="on"},vo=(t,e)=>{if(!t.type)return e;if(e!==void 0){if(t.type===Boolean||typeof t.type=="function"&&t.type.name==="Boolean")return wo(e);if(t.type===Number||typeof t.type=="function"&&t.type.name==="Number"){const n=Number.parseFloat(e);return Number.isNaN(n)?void 0:n}return t.type===String||typeof t.type=="function"&&t.type.name==="String"?e:t.type(e)}},yo=/_./g,$o=/^[A-Z]/,No=t=>t.toLowerCase().replaceAll(yo,e=>e[1]?.toUpperCase()??e).replace($o,e=>e.toLowerCase()),Ao=(t,e=fe())=>{if(!t||t.length===0)return{};const n={};for(const o of t){const i=e[o.name],s=vo(o,i),l=s===void 0?o.defaultValue:s,r=No(o.name);n[r]=l}return n},xo=/-([a-z])/g,wt=t=>t.replaceAll(xo,(e,n)=>n.toUpperCase()),Ze=(t,e)=>t.type===void 0?e:t.type(e),Co=(t,e)=>{const{choices:n}=t;if(!n||n.length===0)return[];const o=[];for(const i of e)n.includes(i)||o.push({choices:n,name:t.name,value:i});return o},bo=(t,e)=>e&&t.defaultValue!==void 0&&!Array.isArray(t.defaultValue)?[t.defaultValue]:t.defaultValue,Oo=(t,e)=>{const n={},o=[],i=[],s=t.length-1;let l=0;for(const[r,u]of t.entries()){const a=wt(u.name),c=r===s&&u.multiple===!0,d=c?e.slice(r):e.slice(r,r+1);if(d.length===0){u.required===!0&&o.push(u.name),n[a]=bo(u,c);continue}i.push(...Co(u,d)),l=r+d.length,n[a]=c?d.map(h=>Ze(u,h)):Ze(u,d[0])}return{invalid:i,missing:o,resolved:n,surplus:e.slice(l)}},_o=t=>{const e=new Map,n=new Map;for(const o of t)if(e.set(o.name,o),o.alias){const i=Array.isArray(o.alias)?o.alias:[o.alias];for(const s of i)n.set(s,o)}return{optionMapByAlias:n,optionMapByName:e}},vt=async t=>{if(typeof t.__resolvedExecute__=="function")return t.__resolvedExecute__;if(typeof t.loader!="function")throw new $e(t.name,"no execute or loader defined");let e;try{e=await t.loader()}catch(o){throw new $e(t.name,o instanceof Error?o.message:String(o),o)}const n=e.default;if(typeof n!="function")throw new $e(t.name,"loader did not return a module with a default-exported handler function");return t.__resolvedExecute__=n,n},Io=(t,e,n,o,i,s=[])=>{const l=new lo(t.name,t),{_all:r,_unknown:u,positionals:a}=e,c=Object.keys(n).length>0?{...r,...n}:r;he in c&&delete c[he],l.argument=a?.[he]??[],l.args={},l.rawUnknown=[...u??[]],l.rawArgv=[...s];const d=Object.keys(o).length>0;return l.options=d?{...c,...o}:c,l.env=Ao(t.env,i),l},ko=(t,e,n)=>{const o=t.options??[],i=o.length>0;let s=go(i?[...o,...n]:n);if(s.length>0){for(const c of s)if(c.multiple&&c.lazyMultiple)throw new Error(`Argument "${c.name}" cannot have both multiple and lazyMultiple options, please choose one.`)}const l=t.arguments!==void 0&&t.arguments.length>0;(t.argument||l)&&(s=[{defaultOption:!0,description:t.argument?.description,group:"positionals",multiple:!0,name:he,type:t.argument?.type??String,typeLabel:t.argument?.typeLabel},...s]);let r,u;if(i){const{optionMapByAlias:c,optionMapByName:d}=_o(o);r=mo(e,o,d,c),u=po(e,o,d,c)}else r=e,u={};const a=co(s,{argv:r,camelCase:!0,partial:!0,stopAtFirstUnknown:!0});return{arguments_:s,booleanValues:u,parsedArgs:a}},Ne=async(t,e,n)=>typeof t.execute=="function"?t.execute(e):(await vt(t))(e),Eo=(t,e)=>{if(!t.arguments||t.arguments.length===0)return;const n=e.rawUnknown.indexOf("--"),o=n===-1?[]:e.rawUnknown.slice(n+1),i=o.length===0?e.argument:e.argument.slice(0,Math.max(0,e.argument.length-o.length)),s=Oo(t.arguments,i);if(e.args=s.resolved,s.missing.length>0)throw new Kt(t.name,s.missing);const[l]=s.invalid;if(l)throw new Jt(l.name,l.value,l.choices);if(s.surplus.length>0)throw new Zt(t.name,s.surplus,t.arguments.length)};let So=class{capacity;cache;constructor(t){this.capacity=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;const e=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,e),e}has(t){return this.cache.has(t)}set(t,e){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.capacity){const n=this.cache.keys().next().value;n!==void 0&&this.cache.delete(n)}this.cache.set(t,e)}delete(t){this.cache.delete(t)}clear(){this.cache.clear()}size(){return this.cache.size}};const Lo=(t,e)=>typeof t!="string"||t===""?"":t[0].toLowerCase()+t.slice(1),Mo=new RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))","g"),Po=t=>{if(typeof t!="string")throw new TypeError(`The "value" argument must be of type string. Received ${typeof t}`);return t.replaceAll(Mo,"")},Ae=new So(1e3),Uo=/[.*+?^${}()|[\]\\]/g,Do=t=>{const e=t.join("");if(Ae.has(e)){const i=Ae.get(e);return i.lastIndex=0,i}const n=t.map(i=>i.replaceAll(Uo,String.raw`\$&`)).join("|"),o=new RegExp(n,"g");return Ae.set(e,o),o},To=t=>{const e=[];let n=0,o;for(G.lastIndex=0;(o=G.exec(t))!==null;)o.index>n&&e.push(t.slice(n,o.index)),e.push(o[0]),n=G.lastIndex;return n<t.length&&e.push(t.slice(n)),e.filter(Boolean)},Vo=/[ČŠŽĐ]/i,yt=new Uint8Array(128),$t=new Uint8Array(128),Nt=new Uint8Array(128);for(let t=0;t<128;t++)yt[t]=t>=65&&t<=90?1:0,$t[t]=t>=97&&t<=122?1:0,Nt[t]=t>=48&&t<=57?1:0;const xe=t=>yt[t],Ye=t=>$t[t],Ce=t=>Nt[t],W=(t,e,n,o,i)=>{if(t.length===0)return[];let s=!1;const l=Object.values(e);for(const f of l)if(f(t[0])){s=!0;break}if(!s&&!n)return[t];const r=[...t],u=[];let a=r[0],c="other";const d=Object.entries(e);for(const f of d){const[p,w]=f;if(w(r[0])){c=p;break}}let h=n&&o?r[0]===r[0].toLocaleUpperCase(o):!1;for(let f=1;f<r.length;f++){const p=r[f];let w="other";for(const y of d){const[A,O]=y;if(O(p)){w=A;break}}const $=n&&o?p===p.toLocaleUpperCase(o):!1;let m=!1;i?m=i(c,w,h,$,p,f,r):(c!==w&&c!=="other"&&w!=="other"&&(m=!0),n&&w!=="other"&&!h&&$&&(m=!0)),m?(u.push(a),a=p):a+=p,c=w,n&&(h=$)}return a&&a.length>0&&u.push(a),u.length>0?u:[t]},jo=(t,e,n,o)=>{if(n.size===0)return e;for(const i of n)if(t.startsWith(i,e))return o.push(i),e+i.length;return e},At=(t,e=new Set)=>{if(t.length===0)return[];if(t.toUpperCase()===t)return[t];let n=0;const o=[],i=t.length;for(let s=1;s<i;s++){const l=jo(t,n,e,o);if(l!==n){n=l,s=n-1;continue}const r=t.codePointAt(s-1),u=t.codePointAt(s),a=r&&r<128&&xe(r),c=u&&u<128&&xe(u),d=r&&r<128&&Ye(r),h=r&&r<128&&Ce(r),f=u&&u<128&&Ce(u);if(d&&c){o.push(t.slice(n,s)),n=s;continue}if(h&&!f||!h&&f){o.push(t.slice(n,s)),n=s;continue}if(f&&!h){let p=!1,w=!1;if(s+1<i){const $=t.codePointAt(s+1);p=$&&$<128&&xe($),w=$&&$<128&&Ce($)}if(!w&&p){o.push(t.slice(n,s),t.slice(s,s+1)),n=s+1;continue}}if(s+1<i){const p=t.codePointAt(s+1),w=p&&p<128&&Ye(p);if(a&&c&&w){const $=t.slice(n,s+1);e.has($)||(o.push(t.slice(n,s)),n=s)}}}return n<i&&o.push(t.slice(n)),o.filter(s=>s!=="")},xt=(t,e,n)=>{if(t.length===0)return[];const o=t===t.toLocaleUpperCase(e);if(e.startsWith("de")){if(!o&&t.replaceAll("ß","SS")===t.toLocaleUpperCase(e))return[t];const a=[...t],c=a.length,d=[];let h=a[0],f=a[0]===a[0].toLocaleUpperCase(e),p=f,w=f?0:-1;for(let $=1;$<c;$++){const m=a[$],y=m===m.toLocaleUpperCase(e);if(y===f)h+=m;else if(y)h&&h.length>0&&(d.push(h),h=m),p=!0,w=$;else{if(p&&$-w>1){const A=a[$-1],O=h.slice(0,-1);O&&O.length>0&&d.push(O),h=A+m}else h+=m;p=!1,w=-1}f=y}return h&&h.length>0&&d.push(h),d}if(e.startsWith("uk")||e.startsWith("ru")||e.startsWith("bg")||e.startsWith("sr")||e.startsWith("mk")||e.startsWith("be")){if(!ee.test(t)&&!L.test(t))return[t];const a=[...t],c=a.length,d=[];let h=a[0];const f=a[0];let p;ee.test(f)?p=1:L.test(f)?p=2:p=0;let w=f===f.toLocaleUpperCase(e);for(let m=1;m<c;m++){const y=a[m];let A;ee.test(y)?A=1:L.test(y)?A=2:A=0;const O=y===y.toLocaleUpperCase(e);p!==A&&(p===1||p===2)&&(A===1||A===2)||A===p&&!w&&O?(d.push(h),h=y):h+=y,p=A,w=O}h&&h.length>0&&d.push(h);const $=[];for(let m=0;m<d.length;m++)m<d.length-1&&d[m].length===1&&L.test(d[m])&&ee.test(d[m+1][0])?($.push(d[m]+d[m+1]),m+=1):$.push(d[m]);return $}if(e.startsWith("el")){if(!ve.test(t)&&!L.test(t))return[t];const a=[];De.lastIndex=0;let c;for(;(c=De.exec(t))!==null;)a.push(c[0]);a.length===0&&a.push(t);const d=[];if(a.length===1){const h=a[0];if(!h||!ve.test(h[0])||h.length===1)return[h??t]}for(const h of a){if(!h)continue;if(!ve.test(h[0])||h.length===1){d.push(h);continue}const f=h.length;let p=h[0],w=h[0]===h[0].toLocaleUpperCase(e);for(let $=1;$<f;$++){const m=h[$],y=m===m.toLocaleUpperCase(e);!w&&y?(d.push(p),p=m):p+=m,w=y}p&&d.push(p)}return d}if(e.startsWith("ja")||e.startsWith("ko")){const a=e.startsWith("ja"),c=a?{hiragana:h=>sn.test(h),kanji:h=>je.test(h),katakana:h=>an.test(h),latin:h=>L.test(h)}:{hangul:h=>Te.test(h),latin:h=>L.test(h)},d=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(a){const h=W(t,c,!1,e,(p,w)=>p==="hiragana"&&w==="katakana"||p==="katakana"&&w==="hiragana"||p==="hiragana"&&w==="latin"||p==="katakana"&&w==="latin"||p==="kanji"&&w==="latin"||p==="latin"&&(w==="hiragana"||w==="katakana"||w==="kanji")),f=[];for(const p of h){const w=p;w.length===1&&d.has(w)&&f.length>0?f[f.length-1]=f.at(-1)+w:f.push(w)}return f.length>0?f:[t]}return W(t,c,!1,e,(h,f)=>h==="hangul"&&f==="latin"||h==="latin"&&f==="hangul")}if(e.startsWith("sl")){const a=[...t],c=a.length,d=[];let h=a[0],f=a[0]===a[0].toLocaleUpperCase(e);for(let p=1;p<c;p++){const w=a[p],$=w===w.toLocaleUpperCase(e),m=Vo.test(w),y=p<c-1&&a[p+1]===a[p+1].toLocaleUpperCase(e);!f&&$||m&&y?(d.push(h),h=w,m&&y&&(d.push(h),h="")):h+=w,f=$}return h&&h.length>0&&d.push(h),d}if(e.startsWith("zh"))return W(t,{han:a=>je.test(a),latin:a=>L.test(a)},!1,e);if(["ar","fa","he","ur"].includes(e.split("-")[0])){const a=c=>Ve.test(c)||Ue.test(c);return W(t,{latin:c=>L.test(c),rtl:c=>a(c)},!1,e)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(e.split("-")[0])){const a=c=>en.test(c)||Xt.test(c)||nn.test(c)||on.test(c)||rn.test(c)||fn.test(c)||mn.test(c)||un.test(c)||dn.test(c)||gn.test(c)||ln.test(c)||wn.test(c)||hn.test(c)||tn.test(c)||cn.test(c)||pn.test(c);return W(t,{indic:c=>a(c),latin:c=>L.test(c)},!1,e)}if(["be","bg","ru","sr","uk"].includes(e))return W(t,{cyrillic:a=>ee.test(a),latin:a=>L.test(a)},!0,e);if(["ar","fa","he"].includes(e))return W(t,{latin:a=>L.test(a),rtl:a=>Ve.test(a)||Ue.test(a)},!1,e);if(e.startsWith("ko"))return W(t,{hangul:a=>Te.test(a),latin:a=>L.test(a)},!1,e);if(e.startsWith("uz")){if(!ee.test(t)&&!L.test(t))return[t];const a=[...t],c=a.length,d=[];let h=a[0],f=a[0]===a[0].toLocaleUpperCase(e);for(let p=1;p<c;p++){const w=a[p],$=w===w.toLocaleUpperCase(e);if(Re.test(w)||Re.test(a[p-1])){h+=w;continue}!f&&$?(d.push(h),h=w):h+=w,f=$}return h&&h.length>0&&d.push(h),d}const i=[...t],s=i.length,l=[];let r=i[0],u=i[0]===i[0].toLocaleUpperCase(e);for(const a of n)if(t.startsWith(a)){l.push(a),r=i[a.length],u=r===r.toLocaleUpperCase(e);break}for(let a=1;a<s;a++){const c=i[a],d=c===c.toLocaleUpperCase(e);let h=0;for(const f of n)if(t.startsWith(f,a)){l.push(r,f),h=f.length,r="";const p=f.at(-1);p&&(u=p===p.toLocaleUpperCase(e));break}if(h>0){a+=h-1;continue}!u&&d?(l.push(r),r=c):r+=c,u=d}return r&&l.push(r),l},Ro=(t,e,n)=>{const o=[],i=pe.test(t)?t.split(pe).filter(Boolean):[t];for(const s of i){const l=s;if(pe.test(l))o.push(l);else{G.lastIndex=0;const r=G.test(l)?To(l).filter(Boolean):[l];for(const u of r)if(G.lastIndex=0,G.test(u))o.push(u);else if(e){const a=e.toLowerCase().split("-")[0];o.push(...xt(u,a,n))}else o.push(...At(u,n))}}return o},Bo=(t,e={})=>{if(!t||typeof t!="string")return[];const{handleAnsi:n=!1,handleEmoji:o=!1,knownAcronyms:i=[],locale:s,normalize:l=!1,separators:r,stripAnsi:u=!1,stripEmoji:a=!1}=e,c=new Set([...i].toSorted((m,y)=>y.length-m.length));let d=t;u&&(d=Po(d)),a&&(d=vn(d));let h;Array.isArray(r)?h=Do(r):r instanceof RegExp?h=r:h=Qt;const f=[];let p=d;const w=h.flags.includes("g")?h:new RegExp(h.source,`${h.flags}g`);for(;p.length>0;){const m=w.exec(p);if(!m){p===".."?f.push(".."):p==="."?f.push("."):p.length>0&&f.push(p);break}const y=m.index,A=m[0],O=A.length,b=p.slice(0,y),D=p.slice(y+O);if(A.startsWith("../"))f.push(".."),p=p.slice(y+3);else if(A.startsWith("./"))f.push("."),p=p.slice(y+2);else if(y===0&&A==="..")f.push(".."),p=p.slice(2);else if(y===0&&A===".")f.push("."),p=p.slice(1);else{b.length>0&&f.push(b);let k=0;for(;(k=A.indexOf("../",k))!==-1;)f.push(".."),k+=3;for(k=0;(k=A.indexOf("./",k))!==-1;)(k===0||A[k-1]!==".")&&f.push("."),k+=2;let g=D;for(;g.startsWith("../");)f.push(".."),g=g.slice(3);for(;g.startsWith("./");)f.push("."),g=g.slice(2);if(g===".."){f.push("..");break}else if(g==="."){f.push(".");break}else p=g}w.lastIndex=0}if(f.length===0){const m=d.split(h).filter(Boolean);f.push(...m)}let $=[];for(const m of f)n||o?$.push(...Ro(m,s,c)):s?$.push(...xt(m,s,c)):$.push(...At(m,c));return l&&($=$.map(m=>c.has(m)?m:s&&m===m.toLocaleUpperCase(s)?m[0]+m.slice(1).toLocaleLowerCase(s):m.toUpperCase()===m&&!c.has(m)?m.slice(0,1)+m.slice(1).toLowerCase():m)),$},Wo=(t,e)=>typeof t!="string"||t===""?"":t[0].toUpperCase()+t.slice(1),zo=(t,e)=>{const{length:n}=t;if(n===0)return"";if(n===1)return t[0];const o=[];let i="",s="";for(let l=0;l<n;l++){const r=t[l];if(pe.test(r)){i?(o.push(i+s+r),i="",s=""):(o.length>0&&o.push(e),i=r);continue}i?(s&&(s+=e),s+=r):(o.length>0&&o.push(e),o.push(r))}return o.join("")},te=(t,e)=>{if(typeof t!="string"||!t)return"";let n=!0;return zo(Bo(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(o=>{const i=o,s=i.toLowerCase();return n?(n=!1,Lo(s)):Wo(s)}),"")};class Fo extends C{commandName;missingOptions;constructor(e,n){super(`Command "${e}" is missing required options: ${n.join(", ")}`,"COMMAND_VALIDATION_ERROR",{commandName:e,missingOptions:n}),this.name="CommandValidationError",this.commandName=e,this.missingOptions=n,this.hint=`Provide the following required options: ${n.join(", ")}`}}class Go extends C{choices;option;value;constructor(e,n,o){super(`Invalid value "${n}" for option "${e}". Allowed values: ${o.join(", ")}`,"INVALID_CHOICE",{choices:o,option:e,value:n}),this.name="InvalidChoiceError",this.option=e,this.value=n,this.choices=o,this.hint=`Use one of: ${o.map(i=>`--${e} ${i}`).join(", ")}`}}const Qe=(t,e,n=!1)=>{const o=[],i=e._all??e;for(const s of t){if(!n&&!s.required)continue;const l=s.__camelCaseName__??s.name;if(i[l]===void 0){if(s.type?.name==="Boolean"){e[l]=!1;continue}o.push(s)}}return o},qo=(t,e)=>e.includes(t)?!0:Math.abs(t.length-e.length)>t.length/2?!1:xn(t,e)<=t.length/3,z=(t,e)=>{const n=t.toLowerCase();return e.filter(o=>qo(o.toLowerCase(),n))},Ho=(t,e)=>{const n=[];if(t._unknown&&t._unknown.forEach(o=>{const i=o.startsWith("--");let s=`Found unknown ${i?"option":"argument"} "${o}"`;if(i){const l=z(o.replace("--",""),(e.options??[]).map(r=>r.name));if(l.length>0){const[r,...u]=l.map(a=>`--${a}`);s+=u.length>0?`, did you mean ${r??""} or ${u.join(", ")}?`:`, did you mean ${r??""}?`}}n.push(s)}),n.length>0)throw new C(n.join(`
|
|
3
3
|
`),V.UNKNOWN_OPTION,{unknownOptions:[...t._unknown??[]]})},K=(t,e)=>new C(`Command "${t}" ${e}`,"INVALID_COMMAND",{commandName:t}),Jo=(t,e)=>{const n=new Set;for(const[o,i]of t.entries()){if(typeof i!="object"||i===null)throw K(e,`has a positional argument at index ${String(o)} that is not an object`);const{name:s}=i;if(typeof s!="string"||s.length===0)throw K(e,`has a positional argument at index ${String(o)} without a name`);const l=wt(s);if(n.has(l))throw K(e,`declares duplicate positional argument "${s}"`);n.add(l);const r=o===0?void 0:t[o-1];if(i.required===!0&&r!==void 0&&r.required!==!0)throw K(e,`declares required positional "${s}" after an optional one, which can never be satisfied`);if(i.multiple===!0&&o!==t.length-1)throw K(e,`declares a variadic positional "${s}" that is not the last one`)}},Ko=(t,e,n)=>{const o=n.__requiredOptions__,i=o?Qe(o,e,!0):Qe(t,e,!1);if(i.length>0)throw new Fo(n.name,i.map(s=>s.name));e._unknown&&e._unknown.length>0&&!n.argument&&!n.arguments?.length&&Ho(e,n)},Zo=(t,e,n)=>{const o=n.__conflictingOptions__??t.filter(i=>i.conflicts!==void 0);if(o.length>0){const i=o.find(s=>{const l=s.__camelCaseName__??te(s.name);return Array.isArray(s.conflicts)?s.conflicts.some(r=>e[te(r)]!==void 0)&&e[l]!==void 0:e[te(s.conflicts)]!==void 0&&e[l]!==void 0});if(i)throw new ct(i.name,typeof i.conflicts=="string"?i.conflicts:i.conflicts?.[0]??"unknown")}},Yo=(t,e)=>{const n=e.options;if(n)for(const o of n){if(!o.choices||o.choices.length===0)continue;const i=o.__camelCaseName__??te(o.name),s=t[i];if(s==null)continue;const l=Array.isArray(s)?s:[s];for(const r of l){const u=String(r);if(!o.choices.includes(u))throw new Go(o.name,u,o.choices)}}},Qo=t=>{if(!Array.isArray(t.options))return;const e=new Map,n=new Map;for(const i of t.options){if(i.name){const s=e.get(i.name)??[];s.push(i),e.set(i.name,s)}if(typeof i.alias=="string"&&i.alias.length>0){const s=n.get(i.alias)??[];s.push(i),n.set(i.alias,s)}else if(Array.isArray(i.alias)){for(const s of i.alias)if(s.length>0){const l=n.get(s)??[];l.push(i),n.set(s,l)}}}const o=[];for(const[i,s]of e)s.length>1&&o.push(`Duplicate option name "${i}" in command "${t.name}": ${JSON.stringify(s)}`);for(const[i,s]of n)s.length>1&&o.push(`Duplicate option alias "-${i}" used by options ${s.map(l=>`"${l.name}"`).join(", ")} in command "${t.name}"`);if(o.length>0)throw new Error(o.join(`
|
|
4
4
|
`))},Xo=t=>{const{arguments:e}=t;if(e!==void 0){if(!Array.isArray(e))throw K(t.name,'must declare "arguments" as an array — slot order is significant, so a record cannot express it');if(t.argument!==void 0)throw K(t.name,'cannot define both "argument" and "arguments" — choose one');Jo(e,t.name)}},es=(t,e)=>{if(e.length===0)return{argv:[],commandPath:void 0};const n=[];let o;for(let i=1;i<=e.length;i+=1){const s=e[i-1];if(s===void 0||s.startsWith("-"))break;n.push(s);const l=n.join(" ");t.has(l)&&(o={commandPath:[...n],depth:i})}return o?{argv:e.slice(o.depth),commandPath:o.commandPath}:{argv:e,commandPath:void 0}},J=t=>t.join(" "),Xe=(t,e)=>e&&e.length>0?[...e,t]:[t],et=t=>t===void 0||Array.isArray(t)?t:Object.entries(t).map(([e,n])=>({...n,name:e})),ts=t=>{const e=et(t.options),n=et(t.env);return e===t.options&&n===t.env?t:Object.assign(Object.create(Object.getPrototypeOf(t)),t,{env:n,options:e})},ns=/^no-/,os=t=>{t.options?.forEach(e=>{e.__camelCaseName__=te(e.name)})},ss=t=>{if(!Array.isArray(t.options)||t.options.length===0)return;const e=new Set;for(const o of t.options)e.add(o.name);const n=[];for(const o of t.options)if(o.name.startsWith("no-")){const i=o.name.replace(ns,"");if(!e.has(i)){if(o.type!==Boolean)throw new Error(`Cannot add negated option "${o.name}" to command "${t.name}" because it is not a boolean.`);const s={...o,alias:void 0,defaultValue:o.defaultValue===void 0?!0:!o.defaultValue,description:`Inverse of --${o.name}.`,name:i};n.push(s),e.add(i)}}n.length>0&&t.options.push(...n)},is=(t,e)=>{if(!e.options||e.options.length===0)return;const{options:n}=t,o=new Map;for(const s of e.options)if(s.name.startsWith("no-")){const l=te(s.name);o.set(l,s)}const i=Object.keys(n).filter(s=>o.has(s));if(i.length!==0)for(const s of i){const l=s.charAt(2);if(!l)continue;const r=l.toLowerCase()+s.slice(3),u=o.get(s);u&&(u.__negated__=!0),n[r]=!n[s],Reflect.deleteProperty(n,s)}},rs=(t,e)=>{if(!e.options||e.options.length===0)return;const n=new Map;for(const i of e.options)i.__camelCaseName__&&i.__negated__===void 0&&i.implies!==void 0&&n.set(i.__camelCaseName__,i);if(n.size===0)return;const{options:o}=t;for(const i of Object.keys(o)){const s=n.get(i);if(s?.implies){const{implies:l}=s;for(const[r,u]of Object.entries(l))o[r]===void 0&&(o[r]=u)}}},as=()=>!!process.versions.electron,cs=()=>as()&&!process.defaultApp,ls=()=>cs()?0:1,us=t=>t.slice(ls()+1),hs=" ",ps=(t,e)=>t===e?!0:t.length!==e.length?!1:t.every((n,o)=>n===e[o]),ds=t=>{if(typeof t=="string")return t.split(hs);const e=Oe();return ps(t,e)?us(t):t},fs=t=>{const e=s=>{t.error(`Uncaught exception: ${s.message||s}`),s.stack&&t.error(s.stack),F(1)},n=(s,l)=>{if(s instanceof Error)t.error(`Promise rejection: ${s.message||s}`),s.stack&&t.error(s.stack);else{let r;if(typeof s=="string")r=s;else try{r=JSON.stringify(s)}catch{r=String(s)}t.error(`Promise rejection: ${r}`)}F(1)},o=Me("uncaughtException",e),i=Me("unhandledRejection",n);return()=>{o(),i()}},tt=100,ms=/^[a-z][\w-]*$/i,ke=(t,e)=>{if(typeof t!="string"||t.trim().length===0)throw new C(`${e} must be a non-empty string`,"INVALID_INPUT",{fieldName:e,value:t});return t.trim()},nt=(t,e)=>{if(!Array.isArray(t)||!t.every(n=>typeof n=="string"))throw new C(`${e} must be an array of strings`,"INVALID_INPUT",{fieldName:e,value:t});return t},le=(t,e)=>{if(typeof t!="object"||t===null)throw new C(`${e} must be an object`,"INVALID_INPUT",{fieldName:e,value:t});return t},ue=t=>{const e=ke(t,"Command name");if(e.length>tt)throw new C(`Command name is too long (maximum ${String(tt)} characters)`,"INVALID_COMMAND_NAME",{commandName:e,length:e.length});if(e.includes("..")||e.includes("/")||e.includes("\\")||e.includes(";")||e.includes("|")||e.includes("&"))throw new C(`Command name "${e}" contains invalid characters`,"INVALID_COMMAND_NAME",{commandName:e});if(!ms.test(e))throw new C(`Command name "${e}" must start with a letter and contain only letters, numbers, hyphens, and underscores`,"INVALID_COMMAND_NAME",{commandName:e});return e},gs=1e6,ws=1e5,vs=new Set([`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as q}from"node:module";import{e as m,z as U,v as S,U as J,m as z}from"./index-BzhrR_iC.js";import{
|
|
1
|
+
import{createRequire as q}from"node:module";import{e as m,z as U,v as S,U as J,m as z}from"./index-BzhrR_iC.js";import{s as A}from"./registry-CkoaWkjP.js";import{d as M,f as E}from"./detect-CbMRSXkM.js";import{y as K}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{h as ne}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";import{s as se}from"./watch-CcTketln.js";let B;const V=e=>(B??=q(import.meta.url))(e),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=e=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[t,n]=y.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return y.getBuiltinModule(e)}return V(e)},{createHash:v}=x("node:crypto"),{spawnSync:G,spawn:H}=x("node:child_process"),{openSync:Y,writeSync:Q,closeSync:X,statSync:Z,readFileSync:O,mkdirSync:ee,writeFileSync:te}=x("node:fs"),{pathToFileURL:re}=x("node:url"),{availableParallelism:F}=x("node:os"),oe={error:"error",info:"info",information:"info",warning:"warning"},Ye={argsCheck:(e,t)=>k(e,t,!1),argsFix:(e,t)=>k(e,t,!0),bin:()=>["pnpm","exec","biome"],cacheKey:(e,t)=>{const n=["biome",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return v("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:(e,t)=>{const n=M(t,A.biome.packageNames[0]),r=E(e,A.biome.configFiles);if(!(!n&&!r))return{adapter:"biome",configFile:r,declared:!!n,declaredVersion:n,root:e}},extensions:["astro","cjs","css","cts","js","json","jsonc","jsx","mjs","mts","svelte","ts","tsx","vue"],id:"biome",kind:"both",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"biome",file:t.root,fixable:!1,message:`biome output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const r=[];for(const o of n.diagnostics??[]){const s=o.location?.start,i=o.location?.end,c=ie(t.root,o.location?.path),u=o.category??"",a=u==="format"||u.startsWith("format/");r.push({adapter:"biome",column:s?.column&&s.column>0?s.column:void 0,endColumn:i?.column&&i.column>0?i.column:void 0,endLine:i?.line&&i.line>0?i.line:void 0,file:c,fixable:!0,line:s?.line&&s.line>0?s.line:void 0,message:a?"Code style issues would be auto-fixed":o.message??"",ruleId:u||void 0,severity:oe[o.severity??""]??"warning"})}return r}},k=(e,t,n)=>{const r=["check","--reporter=json"];return n&&r.push("--write"),typeof t.maxWarnings=="number"&&r.push(`--max-diagnostics=${String(t.maxWarnings)}`),t.extraArgs?.length&&r.push(...t.extraArgs),r.push(...e),r},ie=(e,t)=>{const n=typeof t=="string"?t:t?.file;return n?n.startsWith("/")||/^[a-z]:[\\/]/i.test(n)?n:m(e,n):e},j="pyproject.toml",ce=/^\[tool\.ruff(?:\.[\w-]+)*\]\s*$/m,ae=/^Would reformat:?\s+(.+)$/,le=e=>{const t=m(e,j);if(!K(t))return!1;try{const n=U(t);return ce.test(n)}catch{return!1}},N=e=>(t,n)=>{const r=A.ruff.packageNames.map(c=>M(n,c)).find(c=>c!==void 0),o=E(t,A.ruff.configFiles),s=o?void 0:le(t)?m(t,j):void 0,i=o??s;if(!(!r&&!i))return{adapter:e,configFile:i,declared:!!r,declaredVersion:r,root:t}},ue=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),P=(e,t)=>e?ue(e)?e:m(t,e):t,fe=e=>ae.exec(e)?.[1]?.trim(),Qe={argsCheck:(e,t)=>I(e,t,!1),argsFix:(e,t)=>I(e,t,!0),bin:()=>["ruff","check"],cacheKey:(e,t)=>{const n=["ruff-check",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return v("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:N("ruff-check"),extensions:["py","pyi"],id:"ruff-check",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"ruff-check",file:t.root,fixable:!1,message:`ruff check output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const r=[];for(const o of n){const s=o.location,i=o.end_location;r.push({adapter:"ruff-check",column:s?.column,endColumn:i?.column,endLine:i?.row,file:P(o.filename,t.root),fixable:!!o.fix,line:s?.row,message:o.message??"",ruleId:o.code,severity:"warning"})}return r}},Xe={argsCheck:(e,t)=>R(e,t,!1),argsFix:(e,t)=>R(e,t,!0),bin:()=>["ruff","format"],cacheKey:(e,t)=>{const n=["ruff-fmt",e.declaredVersion??"unknown",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return v("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:N("ruff-fmt"),extensions:["py","pyi"],id:"ruff-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const n=[],r=new Set;for(const o of e.stdout.split(/\r?\n/)){const s=fe(o);!s||r.has(s)||(r.add(s),n.push({adapter:"ruff-fmt",file:P(s,t.root),fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return n}},I=(e,t,n)=>{const r=["--output-format=json"];return n&&r.push("--fix"),t.quiet&&r.push("--quiet"),t.extraArgs?.length&&r.push(...t.extraArgs),r.push(...e),r},R=(e,t,n)=>{const r=[];return n||r.push("--check"),t.quiet&&r.push("--quiet"),t.extraArgs?.length&&r.push(...t.extraArgs),r.push(...e),r},Ze=(e,t)=>{const n=w(e,["diff","--name-only","--diff-filter=ACMR","-z",`${t}...HEAD`]);if(n===void 0)return;const r=w(e,["diff","--name-only","--diff-filter=ACMR","-z"]),o=w(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]),s=w(e,["ls-files","--others","--exclude-standard","-z"]),i=new Set;for(const c of[n,r??"",o??"",s??""])for(const u of c.split("\0"))u.length!==0&&i.add(S(u)?u:m(e,u));return[...i].sort()},et=e=>{const t=w(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]);if(t===void 0)return;const n=new Set;for(const r of t.split("\0"))r.length!==0&&n.add(S(r)?r:m(e,r));return[...n].sort()},w=(e,t)=>{const n=G("git",[...t],{cwd:e,encoding:"utf8",timeout:1e4});if(n.status===0)return n.stdout},tt=(e,t)=>{const n=new Set(t.map(s=>s.toLowerCase())),r=[],o=new Set;for(const s of e){const i=s.lastIndexOf(".");if(i===-1||i===s.length-1)continue;const c=s.slice(i+1).toLowerCase();n.has(c)&&(o.has(s)||(o.add(s),r.push(s)))}return r},de=new Set(["-","stdout"]),T=e=>({close:()=>{},write:t=>{e.write(t)}}),pe=e=>{ne(z(e));const t=Y(e,"w");let n=[];return{close:()=>{n.length>0&&(Q(t,n.join("")),n=[]),X(t)},write:r=>{n.push(r)}}},nt=e=>{const{cwd:t,target:n}=e;if(n===void 0||de.has(n))return T(process.stdout);if(n==="stderr")return T(process.stderr);const r=S(n)?n:J(t,n);return pe(r)},C=["oxlint","oxfmt","biome","eslint","dprint","prettier","stylelint","ruff-check","ruff-fmt","markdownlint","shellcheck","typecheck"],rt=(e,t)=>{const n=new Map(e.map(i=>[i.id,i])),r=[],o=new Set,s=t&&t.length>0?t:C;for(const i of s){const c=n.get(i);c&&!o.has(i)&&(r.push(c),o.add(i))}if(t&&t.length>0)for(const i of C){const c=n.get(i);c&&!o.has(i)&&(r.push(c),o.add(i))}for(const i of e)o.has(i.id)||(r.push(i),o.add(i.id));return r},st=(e,t,n)=>{const r=[];for(const o of t){const s=e.get(o.id);s&&me(o.kind,n)&&r.push({adapter:o,presence:s})}return r},me=(e,t)=>e===t||e==="both",ot=(e,t,n={})=>{const r=new Map;for(const o of e){const s=he(o),i=ge(s,t,n);if(!i)continue;const c=r.get(i);c?c.push(o):r.set(i,[o])}return r},he=e=>{const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()},ge=(e,t,n)=>{const r=n[e];if(r&&t.some(o=>o.adapter.id===r))return r;for(const{adapter:o}of t)if(o.extensions.includes(e))return o.id},it=(e,t,n)=>{const r=new Set(C),o=new Set([...n?.order??[],...Object.keys(n?.adapters??{})]);for(const s of o)r.has(s)||e.warn(`vis.config ${t}: unknown adapter "${s}" is ignored.`)},ye=e=>e==="error"?"error":e==="warning"?"warning":"notice",D=e=>e.replaceAll("%","%25").replaceAll("\r","%0D").replaceAll(`
|
|
2
2
|
`,"%0A"),_=e=>D(e).replaceAll(",","%2C").replaceAll(":","%3A").replaceAll("=","%3D"),we=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,xe=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),ve=(e,t)=>{const n=ye(e.severity),r=we(e.file,t),o=e.ruleId?`${e.adapter}(${e.ruleId})`:e.adapter,s=[`file=${_(r)}`];return e.line!==void 0&&s.push(`line=${String(e.line)}`),e.endLine!==void 0&&s.push(`endLine=${String(e.endLine)}`),e.column!==void 0&&s.push(`col=${String(e.column)}`),e.endColumn!==void 0&&s.push(`endColumn=${String(e.endColumn)}`),s.push(`title=${_(o)}`),`::${n} ${s.join(",")}::${D(e.message)}
|
|
3
3
|
`},ct=e=>e.runs.flatMap(n=>[...n.findings]).sort(xe).map(n=>ve(n,e.workspaceRoot)).join(""),g=e=>e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'"),Se=e=>`<![CDATA[${e.replaceAll("]]>","]]]]><![CDATA[>")}]]>`,Ae=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),$e=e=>e==="error"?"error":e==="warning"?"warning":"info",Ce=(e,t)=>{let{file:n}=e;return t&&e.file.startsWith(`${t}/`)&&(n=e.file.slice(t.length+1)),e.line===void 0?n:e.column===void 0?`${n}:${String(e.line)}`:`${n}:${String(e.line)}:${String(e.column)}`},Fe=(e,t,n)=>{const r=Ce(e,n),o=$e(e.severity),s=e.ruleId?`[${e.ruleId}] ${e.message}`:e.message;return[` <testcase classname="${g(t)}" name="${g(r)}">`,` <failure type="${g(o)}" message="${g(s)}">${Se(e.message)}</failure>`," </testcase>",""].join(`
|
|
4
4
|
`)},ke=(e,t,n)=>{const r=[...e.findings].sort(Ae),o=r.filter(f=>f.severity==="error").length,s=r.filter(f=>f.severity==="warning").length,i=r.length,c=(e.durationMs/1e3).toFixed(3),u=r.map(f=>Fe(f,e.adapter,n)).join("");return` <testsuite ${[`name="${g(e.adapter)}"`,`tests="${String(i)}"`,`failures="${String(o)}"`,'errors="0"',`skipped="${String(s)}"`,`time="${c}"`,`timestamp="${t}"`].join(" ")}>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const h=(1n<<128n)-1n,e=(1n<<64n)-1n,U=(1n<<32n)-1n,y=0x9E3779B1n,C=0x85EBCA77n,D=0xC2B2AE3Dn,E=0x9E3779B185EBCA87n,s=0xC2B2AE3D27D4EB4Fn,S=0x165667B19E3779F9n,A=0x85EBCA77C2B2AE63n,N=0x27D4EB2F165667C5n,T=0x165667919E3779F9n,H=0x9FB21C651E98DF25n,L=64,w=L/8,X=8,F=Buffer.from("b8fe6c3923a44bbe7c01812cf721ad1cded46de9839097db7240a4a4b7b3671fcb79e64eccc0e578825ad07dccff7221b8084674f743248ee03590e6813a264c3c2852bb91c300cb88d0658b1b532ea371644897a20df94e3819ef46a9deacd8a8fa763fe39c343ff9dcbbc7c70b4f1d8a51e04bcdb45931c89f7ec9d9787364eac5ac8334d3ebc3c581a0fffa1363eb170ddd51b7f0da49d316552629d4689e2b16be587d47a1fc8ff8b8d17ad031ce45cb3a8f95160428afd7fbcabb4b407e","hex"),V=t=>{let n=t&e;return n=(n&0x00000000FFFFFFFFn)<<32n|(n&0xFFFFFFFF00000000n)>>32n,n=(n&0x0000FFFF0000FFFFn)<<16n|(n&0xFFFF0000FFFF0000n)>>16n,n=(n&0x00FF00FF00FF00FFn)<<8n|(n&0xFF00FF00FF00FF00n)>>8n,n&e},d=t=>{let n=t;return n=(n&0x0000FFFFn)<<16n|(n&0xFFFF0000n)>>16n,n=(n&0x00FF00FFn)<<8n|(n&0xFF00FF00n)>>8n,n},Y=(t,n)=>(t&U)*(n&U)&e,j=(t,n)=>(t<<n|t>>32n-n)&U,m=(t,n)=>t^t>>n,M=t=>~t+1n&e,v=(t,n)=>{const o=t*n&h;return o&e^o>>64n},B=t=>{let n=t;return n^=n>>37n,n=n*T&e,n^=n>>32n,n},_=t=>{let n=t;return n^=n>>33n,n=n*s&e,n^=n>>29n,n=n*S&e,n^=n>>32n,n},K=(t,n,o,r=0,i=0)=>{for(let c=0;c<w;c++){const g=n.readBigUInt64LE(r+c*8),l=g^o.readBigUInt64LE(i+c*8);t[c^1]+=g,t[c]+=Y(l,l>>32n)}return t},P=(t,n,o,r,i=0)=>{for(let c=0;c<r;c++)K(t,n,o,i+c*L,c*8);return t},q=(t,n,o=0)=>{for(let r=0;r<w;r++){const i=n.readBigUInt64LE(o+r*8);let c=t[r];c=m(c,47n),c^=i,c*=y,t[r]=c&e}return t},f=(t,n,o,r)=>v(t[n]^o.readBigUInt64LE(r),t[n+1]^o.readBigUInt64LE(r+X)),R=(t,n,o,r)=>{let i=r;return i+=f(t,0,n,o+0),i+=f(t,2,n,o+16),i+=f(t,4,n,o+32),i+=f(t,6,n,o+48),B(i&e)},z=(t,n,o)=>{const r=Math.floor((o.byteLength-L)/8),i=L*r,c=Math.floor((n.byteLength-1)/i);for(let l=0;l<c;l++)P(t,n,o,r,l*i),q(t,o,o.byteLength-L);const g=Math.floor((n.byteLength-1-i*c)/L);return P(t,n,o,g,c*i),K(t,n,o,n.byteLength-L,o.byteLength-L-7),t},G=t=>{const n=Buffer.from(F),o=F.byteLength>>4;for(let r=0;r<o;r++){const i=n.readBigUInt64LE(r*16)+t&e,c=n.readBigUInt64LE(r*16+8)-t&e;n.writeBigUInt64LE(i,r*16),n.writeBigUInt64LE(c,r*16+8)}return n},J=(t,n)=>{const o=new BigUint64Array([D,E,s,S,A,C,N,y]);z(o,t,n);const r=R(o,n,11,BigInt(t.byteLength)*E&e);return R(o,n,n.byteLength-L-11,~(BigInt(t.byteLength)*s)&e)<<64n|r},p=(t,n,o,r,i)=>v((t.readBigUInt64LE(n)^o.readBigUInt64LE(r)+i)&e,(t.readBigUInt64LE(n+8)^o.readBigUInt64LE(r+8)-i)&e),x=(t,n,o,r,i,c,g)=>{let l=t&e,b=t>>64n&e;return l+=p(n,o,i,c,g),l^=n.readBigUInt64LE(r)+n.readBigUInt64LE(r+8),l&=e,b+=p(n,r,i,c+16,g),b^=n.readBigUInt64LE(o)+n.readBigUInt64LE(o+8),b&=e,b<<64n|l},Q=(t,n,o)=>{const r=t.byteLength,i=BigInt(t.readUInt8(r-1))|BigInt(r)<<8n|BigInt(t.readUInt8(0))<<16n|BigInt(t.readUInt8(r>>1))<<24n,c=(BigInt(n.readUInt32LE(0))^BigInt(n.readUInt32LE(4)))+o,g=(i^c)&e,l=(BigInt(n.readUInt32LE(8))^BigInt(n.readUInt32LE(12)))-o,b=(j(d(i),13n)^l)&e;return(_(b)&e)<<64n|_(g)},W=(t,n,o)=>{const r=t.byteLength;o=(o^d(o&U)<<32n)&e;const i=t.readUInt32LE(0),c=t.readUInt32LE(r-4),g=BigInt(i)|BigInt(c)<<32n,l=(n.readBigUInt64LE(16)^n.readBigUInt64LE(24))+o&e;let I=(g^l)*(E+(BigInt(r)<<2n))&h;return I+=(I&e)<<65n,I&=h,I^=I>>67n,m(m(I&e,35n)*H&e,28n)|B(I>>64n)<<64n},Z=(t,n,o)=>{const r=t.byteLength,i=(n.readBigUInt64LE(32)^n.readBigUInt64LE(40))-o&e,c=(n.readBigUInt64LE(48)^n.readBigUInt64LE(56))+o&e,g=t.readBigUInt64LE();let l=t.readBigUInt64LE(r-8),b=(g^l^i)*E;const I=(b&e)+(BigInt(r-1)<<54n);b=b&(h^e)|I,l^=c,b+=l+(l&U)*(C-1n)<<64n,b&=h,b^=V(b>>64n);let u=(b&e)*s;return u+=(b>>64n)*s<<64n,u&=h,B(u&e)|B(u>>64n)<<64n},$=(t,n)=>{const o=t.byteLength;return o>8?Z(t,F,n):o>=4?W(t,F,n):o>0?Q(t,F,n):_(n^F.readBigUInt64LE(64)^F.readBigUInt64LE(72))|_(n^F.readBigUInt64LE(80)^F.readBigUInt64LE(88))<<64n},O=(t,n,o)=>{let r=BigInt(t.byteLength)*E&e,i=BigInt(t.byteLength-1)/32n;for(;i>=0n;){const l=Number(i);r=x(r,t,16*l,t.byteLength-16*(l+1),n,32*l,o),i--}let c=r+(r>>64n)&e;c=B(c);let g=(r&e)*E+(r>>64n)*A+(BigInt(t.byteLength)-o&e)*s;return g&=e,g=M(B(g)),c|g<<64n},a=(t,n,o)=>{let r=BigInt(t.byteLength)*E&e;for(let g=32;g<160;g+=32)r=x(r,t,g-32,g-16,n,g-32,o);r=B(r&e)|B(r>>64n)<<64n;for(let g=160;g<=t.byteLength;g+=32)r=x(r,t,g-32,g-16,n,3+g-160,o);r=x(r,t,t.byteLength-16,t.byteLength-32,n,103,M(o));let i=r+(r>>64n)&e;i=B(i);let c=(r&e)*E+(r>>64n)*A+(BigInt(t.byteLength)-o&e)*s;return c&=e,c=M(B(c)),i|c<<64n},k=(t,n=0n)=>{const o=t.byteLength;return o<=16?$(t,n):o<=128?O(t,F,n):o<=240?a(t,F,n):J(t,n===0n?F:G(n))},nn=t=>{const n=t>>64n&e,o=t&e;return n.toString(16).padStart(16,"0")+o.toString(16).padStart(16,"0")},tn=(t,n=0n)=>nn(k(typeof t=="string"?Buffer.from(t):t,BigInt.asUintN(64,n)));export{tn as x};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,d as t}from"../../../packem_chunks/
|
|
1
|
+
import{c as r,d as t}from"../../../packem_chunks/index2.js";export{r as createAdapter,t as detectPackageManager};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AfterAllProjectsVersioned as r,VersionActions as s}from"../../../packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js";import{
|
|
1
|
+
import{AfterAllProjectsVersioned as r,VersionActions as s}from"../../../packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js";import{c}from"../../../packem_chunks/index3.js";export{r as AfterAllProjectsVersioned,s as VersionActions,c as createVersionActions};
|
package/dist/release/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ReleaseClient as s,release as a,releaseChangelog as l,releaseDraft as o,releasePublish as E,releaseSnapshot as i,releaseVersion as n}from"../packem_shared/ReleaseClient-
|
|
1
|
+
import{ReleaseClient as s,release as a,releaseChangelog as l,releaseDraft as o,releasePublish as E,releaseSnapshot as i,releaseVersion as n}from"../packem_shared/ReleaseClient-CWD9BC5w.js";import{DEFAULT_CLEAN_KEEP as L,DEFAULT_CLEAN_STRIP as f,DEFAULT_CONFIG as p,DEFAULT_DEPENDENCY_BUMP_RULES as _,defineReleaseConfig as m,resolveCleanStripList as C}from"../packem_chunks/DEFAULT_CLEAN_KEEP.js";import{defineReleasePlugin as D}from"../packem_chunks/defineReleasePlugin.js";import{VisReleaseError as U,visReleaseError as x}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{BUMP_LEVELS as F,bumpRank as N,maxBump as S}from"./types.js";export{F as BUMP_LEVELS,L as DEFAULT_CLEAN_KEEP,f as DEFAULT_CLEAN_STRIP,p as DEFAULT_CONFIG,_ as DEFAULT_DEPENDENCY_BUMP_RULES,s as ReleaseClient,U as VisReleaseError,N as bumpRank,m as defineReleaseConfig,D as defineReleasePlugin,S as maxBump,a as release,l as releaseChangelog,o as releaseDraft,E as releasePublish,i as releaseSnapshot,n as releaseVersion,C as resolveCleanStripList,x as visReleaseError};
|