@visulima/vis 1.0.0-alpha.9 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1854 -3
- package/LICENSE.md +13515 -10
- package/README.md +215 -39
- package/bin/resolve-binary.mjs +85 -0
- package/bin/vis.mjs +76 -0
- package/dashboard/dist/index.html +152 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +1 -2
- package/dist/binx.js +3 -0
- package/dist/config/index.d.ts +3276 -0
- package/dist/config/index.js +1 -0
- package/dist/generate/index.d.ts +1 -1
- package/dist/generate/index.js +1 -1
- package/dist/packem_chunks/CONFIG_FILES.js +8 -0
- package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -0
- package/dist/packem_chunks/agent-instructions.js +11 -0
- package/dist/packem_chunks/bloom-status.js +2 -0
- package/dist/packem_chunks/bloom-sync.js +2 -0
- package/dist/packem_chunks/cache-attestation.js +1 -0
- package/dist/packem_chunks/catalog-detector.js +1 -0
- package/dist/packem_chunks/catalog.js +114 -0
- package/dist/packem_chunks/cli-exec.js +1 -0
- package/dist/packem_chunks/cli-main.js +268 -0
- package/dist/packem_chunks/defineReleasePlugin.js +3 -0
- package/dist/packem_chunks/detect.js +3 -0
- package/dist/packem_chunks/detect2.js +8 -0
- package/dist/packem_chunks/devtools.js +4 -0
- package/dist/packem_chunks/discord.js +4 -0
- package/dist/packem_chunks/dispatch.js +4 -0
- package/dist/packem_chunks/doctor-probe.js +2 -0
- package/dist/packem_chunks/dynamic-import.js +1 -0
- package/dist/packem_chunks/extra-files.js +3 -0
- package/dist/packem_chunks/fix.js +11 -0
- package/dist/packem_chunks/git.js +3 -0
- package/dist/packem_chunks/group-tags.js +1 -0
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -1
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +26 -152
- package/dist/packem_chunks/handler13.js +5 -1
- package/dist/packem_chunks/handler14.js +1 -3
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -2
- package/dist/packem_chunks/handler17.js +1 -7
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +5 -19
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -428
- package/dist/packem_chunks/handler21.js +2 -22
- package/dist/packem_chunks/handler22.js +14 -3
- package/dist/packem_chunks/handler23.js +1 -5
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -20
- package/dist/packem_chunks/handler26.js +5 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +3 -1
- package/dist/packem_chunks/handler29.js +1 -2
- package/dist/packem_chunks/handler3.js +4 -2
- package/dist/packem_chunks/handler30.js +1 -22
- package/dist/packem_chunks/handler31.js +2 -1
- package/dist/packem_chunks/handler32.js +2 -1
- package/dist/packem_chunks/handler33.js +2 -37
- package/dist/packem_chunks/handler34.js +3 -3
- package/dist/packem_chunks/handler35.js +6 -23
- package/dist/packem_chunks/handler36.js +1 -5
- package/dist/packem_chunks/handler37.js +36 -21
- package/dist/packem_chunks/handler38.js +8 -1
- package/dist/packem_chunks/handler39.js +9 -2
- package/dist/packem_chunks/handler4.js +4 -5
- package/dist/packem_chunks/handler40.js +75 -1
- package/dist/packem_chunks/handler41.js +5 -5
- package/dist/packem_chunks/handler42.js +4 -1
- package/dist/packem_chunks/handler43.js +3 -24
- package/dist/packem_chunks/handler44.js +2 -3
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -0
- package/dist/packem_chunks/handler47.js +1 -0
- package/dist/packem_chunks/handler48.js +3 -0
- package/dist/packem_chunks/handler49.js +1 -0
- package/dist/packem_chunks/handler5.js +6 -4
- package/dist/packem_chunks/handler50.js +7 -0
- package/dist/packem_chunks/handler51.js +33 -0
- package/dist/packem_chunks/handler52.js +3 -0
- package/dist/packem_chunks/handler53.js +8 -0
- package/dist/packem_chunks/handler54.js +4 -0
- package/dist/packem_chunks/handler55.js +1 -0
- package/dist/packem_chunks/handler56.js +12 -0
- package/dist/packem_chunks/handler57.js +11 -0
- package/dist/packem_chunks/handler58.js +5 -0
- package/dist/packem_chunks/handler59.js +11 -0
- package/dist/packem_chunks/handler6.js +8 -2
- package/dist/packem_chunks/handler60.js +3 -0
- package/dist/packem_chunks/handler61.js +22 -0
- package/dist/packem_chunks/handler62.js +61 -0
- package/dist/packem_chunks/handler63.js +3 -0
- package/dist/packem_chunks/handler64.js +6 -0
- package/dist/packem_chunks/handler65.js +9 -0
- package/dist/packem_chunks/handler66.js +2 -0
- package/dist/packem_chunks/handler67.js +24 -0
- package/dist/packem_chunks/handler68.js +25 -0
- package/dist/packem_chunks/handler69.js +153 -0
- package/dist/packem_chunks/handler7.js +1 -24
- package/dist/packem_chunks/handler70.js +10 -0
- package/dist/packem_chunks/handler71.js +23 -0
- package/dist/packem_chunks/handler72.js +322 -0
- package/dist/packem_chunks/handler73.js +708 -0
- package/dist/packem_chunks/handler74.js +48 -0
- package/dist/packem_chunks/handler75.js +27 -0
- package/dist/packem_chunks/handler76.js +3 -0
- package/dist/packem_chunks/handler77.js +190 -0
- package/dist/packem_chunks/handler78.js +38 -0
- package/dist/packem_chunks/handler8.js +1 -6
- package/dist/packem_chunks/handler9.js +1 -8
- package/dist/packem_chunks/heal-accept.js +10 -0
- package/dist/packem_chunks/heal.js +14 -0
- package/dist/packem_chunks/help-command.js +31 -0
- package/dist/packem_chunks/index.js +1 -7
- package/dist/packem_chunks/index2.js +802 -0
- package/dist/packem_chunks/index3.js +7 -0
- package/dist/packem_chunks/index4.js +135 -0
- package/dist/packem_chunks/index5.js +73 -0
- package/dist/packem_chunks/interface.js +2 -0
- package/dist/packem_chunks/keys-refresh.js +4 -0
- package/dist/packem_chunks/lean.js +4 -0
- package/dist/packem_chunks/list.js +3 -0
- package/dist/packem_chunks/loader.js +4 -1
- package/dist/packem_chunks/loader2.js +1 -0
- package/dist/packem_chunks/orchestrator.js +42 -0
- package/dist/packem_chunks/pre-mode.js +2 -0
- package/dist/packem_chunks/print-config.js +2 -0
- package/dist/packem_chunks/prompts.js +7 -0
- package/dist/packem_chunks/prune.js +3 -0
- package/dist/packem_chunks/publish-guards.js +1 -0
- package/dist/packem_chunks/registry.js +48 -0
- package/dist/packem_chunks/resolveFormatter.js +9 -0
- package/dist/packem_chunks/run.js +1 -0
- package/dist/packem_chunks/security.js +1 -0
- package/dist/packem_chunks/shell-runner.js +1 -0
- package/dist/packem_chunks/slack.js +2 -0
- package/dist/packem_chunks/snapshot.js +2 -0
- package/dist/packem_chunks/stage-publisher.js +1 -0
- package/dist/packem_chunks/staged-registry.js +2 -0
- package/dist/packem_chunks/state.js +3 -0
- package/dist/packem_chunks/status.js +2 -0
- package/dist/packem_chunks/success-walk.js +8 -0
- package/dist/packem_chunks/sync.js +2 -0
- package/dist/packem_chunks/sync2.js +2 -0
- package/dist/packem_chunks/tar.js +3 -0
- package/dist/packem_chunks/tripwire.js +2 -0
- package/dist/packem_chunks/ts-loader.js +22 -0
- package/dist/packem_chunks/verify-lockfile.js +2 -0
- package/dist/packem_chunks/version-resolver.js +2 -0
- package/dist/packem_chunks/webhook.js +1 -0
- package/dist/packem_chunks/workflow-templates.js +167 -0
- package/dist/packem_chunks/workspace.js +2 -0
- package/dist/packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js +1 -0
- package/dist/packem_shared/MultiSpinner-B9U0-aE3-B-gIXhFk.js +3 -0
- package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +1 -0
- package/dist/packem_shared/Table-BGIHvenQ-D2oJtNQj.js +34 -0
- package/dist/packem_shared/VisReleaseError-DMGRBTNO.js +1 -0
- package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +1 -0
- package/dist/packem_shared/advisories-CaP4uNhD.js +1 -0
- package/dist/packem_shared/affected-shas-BfO3PDJq.js +1 -0
- package/dist/packem_shared/ai-analysis-CO7No4rt.js +68 -0
- package/dist/packem_shared/ai-fix-B4u2zlVG.js +43 -0
- package/dist/packem_shared/anolilab-text-CAM_E6uK.js +13 -0
- package/dist/packem_shared/api.d-BPftyU9r.d.ts +27 -0
- package/dist/packem_shared/augment-8z86AwtF.js +4 -0
- package/dist/packem_shared/bin-Cv8vsMEo.js +1 -0
- package/dist/packem_shared/build-scripts-D477Ou-x.js +1 -0
- package/dist/packem_shared/command-runtime-EWjmSxPj.js +1 -0
- package/dist/packem_shared/compile-cache-B_Vf_WxT.js +3 -0
- package/dist/packem_shared/createAdapter-bU4DIP3F.js +1 -0
- package/dist/packem_shared/createVersionActions-BK43SNDH.js +1 -0
- package/dist/packem_shared/cyclonedx-CDWHbD9s.js +4 -0
- package/dist/packem_shared/defineFormatter-D5dCp6Kv.js +1 -0
- package/dist/packem_shared/definePlugin-DoUcoYSy.js +1 -0
- package/dist/packem_shared/dependency-scan-P52jY0pU.js +1 -0
- package/dist/packem_shared/docker-CD7o1D1o.js +59 -0
- package/dist/packem_shared/env-Cpxa_7UE.js +27 -0
- package/dist/packem_shared/failure-log-MOhz-TBv.js +2 -0
- package/dist/packem_shared/giget-DVTFJlbR.js +2 -0
- package/dist/packem_shared/glob-DMbPwGSj-uzODoE-1.js +1 -0
- package/dist/packem_shared/index-B0EsgdzO.js +1 -0
- package/dist/packem_shared/index-BAUIIRZJ.js +1 -0
- package/dist/packem_shared/index-BVuCxe14.js +22 -0
- package/dist/packem_shared/index-CdTXvj-V.js +1 -0
- package/dist/packem_shared/index-CgXLAAVI.js +28 -0
- package/dist/packem_shared/index-DjTWo3sH.js +1 -0
- package/dist/packem_shared/index.server-J83sowC4.js +2 -0
- package/dist/packem_shared/interface.d-B7VK2rcH.d.ts +148 -0
- package/dist/packem_shared/interface.d-Cezzifoh.d.ts +106 -0
- package/dist/packem_shared/license-t5KnNX6v.js +1 -0
- package/dist/packem_shared/lifecycle-hzwghh5a.js +2 -0
- package/dist/packem_shared/lockfile-CWcVTdRc.js +1 -0
- package/dist/packem_shared/main-B3juSU5z.js +1 -0
- package/dist/packem_shared/manifests-CaPqgQxW.js +1 -0
- package/dist/packem_shared/min-release-age-skpcnlpk.js +34 -0
- package/dist/packem_shared/missing-package-json-_hOp4AW5.js +1 -0
- package/dist/packem_shared/native-config-sync-CFi1iQNG.js +21 -0
- package/dist/packem_shared/osv-bloom-BAyJUnRx.js +2 -0
- package/dist/packem_shared/otelPlugin-DmKDBaPo.js +1 -0
- package/dist/packem_shared/packument-CYxvm590.js +1 -0
- package/dist/packem_shared/peer-warnings-BXAzXqY3.js +1 -0
- package/dist/packem_shared/plugins.d-ND23R9I3.d.ts +4 -0
- package/dist/packem_shared/pm-runner-mVFjedM6.js +1 -0
- package/dist/packem_shared/prompt-DjXHVgYU.js +1 -0
- package/dist/packem_shared/provenance-CI_WQx7G.js +1 -0
- package/dist/packem_shared/public-api-WqUCiyIe.js +131 -0
- package/dist/packem_shared/readJsonSync-DuMMeB3s-Cx08VBQg.js +1 -0
- package/dist/packem_shared/registry-keys-AGlSEY6R.js +1 -0
- package/dist/packem_shared/resolve-explicit-DVE9cfkm.js +5 -0
- package/dist/packem_shared/resolve-runtime-CGHf-wHz.js +1 -0
- package/dist/packem_shared/run-file-Bs_E9O6O.js +1 -0
- package/dist/packem_shared/runtime-check-pS2XH4BO.js +1 -0
- package/dist/packem_shared/runtime-process-Dmz0vCJy-DUwTvH1J.js +1 -0
- package/dist/packem_shared/s1ngularity-xmrq5T5r.js +1 -0
- package/dist/packem_shared/scan-progress-DQ4TMXcb.js +2 -0
- package/dist/packem_shared/selectors-CRgS4bU9.js +3 -0
- package/dist/packem_shared/signatures-Dp3th1DB.js +2 -0
- package/dist/packem_shared/slug-DoueYuLo.js +1 -0
- package/dist/packem_shared/spinner-DuJJvFTl.js +1 -0
- package/dist/packem_shared/sticky-comment-D6_7-w8T.js +1 -0
- package/dist/packem_shared/subtree-C7bZuiSQ.js +2 -0
- package/dist/packem_shared/symbols-DPTlrJ3B.js +1 -0
- package/dist/packem_shared/tabs-CgxCvjCY.js +1 -0
- package/dist/packem_shared/target-merge-D2eTghgd.js +11 -0
- package/dist/packem_shared/target-options-TM6ETDAS.js +1 -0
- package/dist/packem_shared/toolchain-B5KwUZfq.js +5 -0
- package/dist/packem_shared/typosquats-C0layQsP.js +1 -0
- package/dist/packem_shared/use-measured-height-Drobr4fe.js +1 -0
- package/dist/packem_shared/utils-CRueU43T.js +1 -0
- package/dist/packem_shared/verify-Cjo4EBFZ.js +1 -0
- package/dist/packem_shared/vis-update-app-qIkyvrd1.js +1 -0
- package/dist/packem_shared/watch-BnE1TzYn.js +1 -0
- package/dist/packem_shared/watch-loop-Irf3Pm-1.js +11 -0
- package/dist/release/core/changelog/index.d.ts +5 -0
- package/dist/release/core/changelog/index.js +1 -0
- package/dist/release/core/package-managers/index.d.ts +6 -0
- package/dist/release/core/package-managers/index.js +1 -0
- package/dist/release/core/version-actions/index.d.ts +14 -0
- package/dist/release/core/version-actions/index.js +1 -0
- package/dist/release/index.d.ts +233 -0
- package/dist/release/index.js +1 -0
- package/dist/release/plugin-sdk.d.ts +128 -0
- package/dist/release/plugin-sdk.js +1 -0
- package/dist/release/presets.d.ts +225 -0
- package/dist/release/presets.js +1 -0
- package/dist/release/types.d.ts +1493 -0
- package/dist/release/types.js +1 -0
- package/dist/runtime/preload.d.ts +1 -0
- package/dist/runtime/preload.js +1 -0
- package/index.d.ts +450 -0
- package/index.js +663 -556
- package/package.json +105 -62
- package/schemas/project.schema.json +872 -225
- package/schemas/vis-config.schema.json +6309 -264
- package/schemas/vis-release-config.schema.json +1423 -0
- package/skills/vis/SKILL.md +96 -0
- package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
- package/templates/buildkite-ci/template.yml +20 -0
- package/dist/config.d.ts +0 -1087
- package/dist/config.js +0 -1
- package/dist/packem_shared/VisUpdateApp-BBx3idMI.js +0 -1
- package/dist/packem_shared/ai-analysis-DDqXRFxY.js +0 -67
- package/dist/packem_shared/bin-BaZZ32BK.js +0 -93
- package/dist/packem_shared/cache-directory-DL8hfXeG.js +0 -1
- package/dist/packem_shared/catalog-CuSpuB_R.js +0 -12
- package/dist/packem_shared/dependency-scan-BoLG2Fez.js +0 -1
- package/dist/packem_shared/docker-BcfqH4Av.js +0 -2
- package/dist/packem_shared/flakiness-DSIHZGBT.js +0 -1
- package/dist/packem_shared/otelPlugin-DxyvBcXO.js +0 -1
- package/dist/packem_shared/runtime-check-CGHal8SO.js +0 -1
- package/dist/packem_shared/selectors-CfH9ZY08.js +0 -3
- package/dist/packem_shared/symbols-CIMw60-G.js +0 -1
- package/dist/packem_shared/toolchain-C3ZG0o_X.js +0 -5
- package/dist/packem_shared/typosquats-Bpq4zcWL.js +0 -1
- package/dist/packem_shared/utils-DrNg0XTR.js +0 -1
package/dist/config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var C=Object.defineProperty;var u=(e,t)=>C(e,"name",{value:t,configurable:!0});import{createRequire as v}from"node:module";import{findCacheDirSync as D}from"@visulima/find-cache-dir";import{isAccessibleSync as y,ensureDirSync as p,readJsonSync as T,writeJsonSync as x}from"@visulima/fs";import{join as o,dirname as E}from"@visulima/path";import{createJiti as I}from"jiti";import{otelPlugin as X}from"./packem_shared/otelPlugin-DxyvBcXO.js";const S=v(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=u(e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[t,n]=r.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return r.getBuiltinModule(e)}return S(e)},"__cjs_getBuiltinModule"),{createHash:_}=d("node:crypto"),{readdirSync:j,copyFileSync:b,unlinkSync:w,readFileSync:F}=d("node:fs"),{tmpdir:P}=d("node:os");var A=Object.defineProperty,s=u((e,t)=>A(e,"name",{value:t,configurable:!0}),"s");const h=["vis.config.ts","vis.config.mts","vis.config.cts","vis.config.js","vis.config.mjs","vis.config.cjs"],J=new Set(h),O={blockExoticSubdeps:!0,strictDepBuilds:!0,trustPolicy:"no-downgrade",trustPolicyIgnoreAfter:43200},V=s(e=>({...O,...e}),"mergeSecurityDefaults"),l=s(e=>({...e,security:V(e.security),update:{security:!0,target:"minor",...e.update}}),"applyDefaults"),k=s(e=>{let t;try{t=j(e)}catch{return}const n=new Set(t.filter(i=>J.has(i)));for(const i of h)if(n.has(i))return o(e,i)},"findVisConfigFile"),q=s(e=>_("sha256").update(F(e)).digest("hex"),"hashFileContents"),B=s(e=>{const t=o(e,"node_modules");if(y(t)){const i=o(t,".cache","vis");return p(i),o(i,"vis-config-cache.json")}const n=D("vis",{create:!0,cwd:e});return n?o(n,"vis-config-cache.json"):void 0},"getConfigCachePath"),N=s((e,t)=>{if(y(e))try{const n=T(e);if(n.hash===t)return n.config}catch{}},"readConfigCache"),R=s((e,t,n)=>{try{p(E(e)),x(e,{config:n,hash:t})}catch{}},"writeConfigCache"),Y=s(async e=>{const t=k(e);if(!t)return l({});const n=q(t),i=B(e);if(i){const g=N(i,n);if(g)return g}const m=t.slice(t.lastIndexOf(".")),a=o(P(),`vis-config-${n}${m}`);b(t,a);let c;try{c=await I(e,{fsCache:!1,moduleCache:!1}).import(a,{default:!0,try:!0})??{}}finally{try{w(a)}catch{}}let f;return f=l(typeof c=="function"?await c()??{}:c),i&&R(i,n,f),f},"loadVisConfig"),z=s(e=>l(e),"defineConfig"),K=s(e=>e,"definePlugin");export{h as CONFIG_FILES,O as SECURITY_DEFAULTS,l as applyDefaults,z as defineConfig,K as definePlugin,k as findVisConfigFile,Y as loadVisConfig,X as otelPlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var ue=Object.defineProperty;var k=(s,l)=>ue(s,"name",{value:l,configurable:!0});import{jsxs as t,jsx as r,Fragment as Q}from"react/jsx-runtime";import{useWindowSize as ce,Box as i,Spinner as pe,Text as e,ScrollView as ge,Tabs as fe,Tab as me,ScrollBar as we,useApp as ye,useInput as be,Dialog as _}from"@visulima/tui";import{useSyncExternalStore as Ce,useState as O,useRef as K,useMemo as ke,useCallback as oe,useEffect as xe}from"react";import{N as de,C as ne}from"./bin-BaZZ32BK.js";var Te=Object.defineProperty,Se=k((s,l)=>Te(s,"name",{value:l,configurable:!0}),"a$1");function ve({current:s,total:l}){const{columns:h}=ce(),c=h||80,p=l>0?s/l:0,a=`${String(Math.round(p*100))}%`,w=Math.max(10,c-4),b=Math.round(w*p),f=w-b;return t(i,{flexDirection:"column",paddingX:1,children:[t(i,{children:[r(pe,{type:"dots"}),t(e,{children:["Checking ",String(l)," catalog dependencies"]}),t(e,{dimColor:!0,children:[String(s),"/",String(l)]})]}),t(i,{children:[r(e,{color:"cyan",children:"━".repeat(b)}),r(e,{dimColor:!0,children:"─".repeat(f)}),t(e,{children:[" ",a]})]})]})}k(ve,"f$1");Se(ve,"CheckProgressApp");var Ae=Object.defineProperty,U=k((s,l)=>Ae(s,"name",{value:l,configurable:!0}),"r");const Y=U(s=>{const l=new Map;for(const h of s){const c=l.get(h.catalogName);c?c.push(h):l.set(h.catalogName,[h])}return l},"groupByCatalog"),W=U((s,l,h)=>{let c=s;if(l!=="all"&&(c=l==="security"?c.filter(p=>p.vulnerabilities&&p.vulnerabilities.length>0||p.socketReport&&p.socketReport.alerts.length>0):c.filter(p=>p.updateType===l)),h){const p=h.toLowerCase();c=c.filter(a=>a.packageName.toLowerCase().includes(p))}return c},"filterEntries");class Je{static{k(this,"UpdateStore")}static{U(this,"UpdateStore")}#e;#l=new Set;#t;#i=null;constructor(l,h=null){this.#t=l,h&&(this.#i=new Map(h.recommendations.map(c=>[c.package,c]))),this.#e={aiResult:h,allChecked:!0,applyProgress:null,checkedEntries:new Set(l.map(c=>c.packageName)),entries:l,error:null,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",groupedByCatalog:Y(l),phase:"browsing",selectedIndex:0}}getSnapshot=U(()=>this.#e,"getSnapshot");subscribe=U(l=>(this.#l.add(l),()=>{this.#l.delete(l)}),"subscribe");getFilteredEntries(){return W(this.#t,this.#e.filterType,this.#e.filterText)}getRecommendation(l){return this.#i?.get(l)}getCheckedEntries(){return this.#t.filter(l=>this.#e.checkedEntries.has(l.packageName))}setSelectedIndex(l){const h=this.getFilteredEntries(),c=Math.max(0,Math.min(l,h.length-1));c!==this.#e.selectedIndex&&this.#r({...this.#e,selectedIndex:c})}setFocusedPanel(l){l!==this.#e.focusedPanel&&this.#r({...this.#e,focusedPanel:l})}setFilterType(l){if(l!==this.#e.filterType){const h=W(this.#t,l,this.#e.filterText);this.#r({...this.#e,entries:h,filterType:l,groupedByCatalog:Y(h),selectedIndex:0})}}setFilter(l){const h=W(this.#t,this.#e.filterType,l);this.#r({...this.#e,entries:h,filterText:l,groupedByCatalog:Y(h),selectedIndex:0})}setFilterActive(l){if(l!==this.#e.filterActive)if(l)this.#r({...this.#e,filterActive:!0});else{const h=W(this.#t,this.#e.filterType,"");this.#r({...this.#e,entries:h,filterActive:!1,filterText:"",groupedByCatalog:Y(h),selectedIndex:0})}}toggleCheck(l){const h=new Set(this.#e.checkedEntries);h.has(l)?h.delete(l):h.add(l),this.#r({...this.#e,allChecked:h.size===this.#t.length,checkedEntries:h})}checkAll(){this.#r({...this.#e,allChecked:!0,checkedEntries:new Set(this.#t.map(l=>l.packageName))})}uncheckAll(){this.#r({...this.#e,allChecked:!1,checkedEntries:new Set})}toggleAll(){this.#e.allChecked?this.uncheckAll():this.checkAll()}startApply(){const l=this.getCheckedEntries();this.#r({...this.#e,applyProgress:{current:0,total:l.length},phase:"applying"})}updateApplyProgress(l){this.#e.applyProgress&&this.#r({...this.#e,applyProgress:{...this.#e.applyProgress,current:l}})}markDone(){this.#r({...this.#e,phase:"done"})}setError(l){this.#r({...this.#e,error:l,phase:"error"})}#r(l){this.#e=l;for(const h of this.#l)try{h()}catch{}}}var Re=Object.defineProperty,Ee=k((s,l)=>Re(s,"name",{value:l,configurable:!0}),"d");const De={major:"red",minor:"yellow",patch:"green"},Ie={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},Ne={critical:"red",high:"red",low:"gray",medium:"yellow"},Pe={critical:"red",high:"red",low:"green",medium:"yellow"},Be={defer:"gray",review:"yellow",skip:"red",update:"green"},Le=Ee(({changelogUrl:s,entry:l,focused:h,recommendation:c,scrollRef:p})=>{const a=h?"white":"gray";if(!l)return r(i,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:r(e,{dimColor:!0,children:"No package selected"})});const w=De[l.updateType]??"white",b=l.vulnerabilities&&l.vulnerabilities.length>0,f=l.socketReport?.score.overall??0,m=l.socketReport?de(f):"gray";return t(i,{borderColor:a,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[r(i,{flexShrink:0,paddingTop:1,paddingX:2,children:r(e,{bold:!0,color:"white",children:l.packageName})}),t(ge,{flexGrow:1,flexShrink:1,paddingX:2,ref:p,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:[r(e,{}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Current:"})}),r(e,{children:l.currentRange})]}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Target:"})}),r(e,{children:l.newRange}),t(e,{bold:!0,color:w,children:[" ","(",l.updateType,")"]})]}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Version:"})}),r(e,{children:l.targetVersion})]}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Catalog:"})}),r(e,{children:l.catalogName})]}),l.acceptedRisk&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{color:"gray",children:"── "}),r(e,{bold:!0,color:"gray",children:"ACKNOWLEDGED RISK"}),t(i,{flexDirection:"column",paddingLeft:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Reason: "}),r(e,{children:l.acceptedRisk.reason})]}),t(i,{children:[r(e,{dimColor:!0,children:"Accepted: "}),r(e,{children:l.acceptedRisk.acceptedAt.slice(0,10)})]})]})]}),b&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"red",children:"SECURITY"}),r(e,{}),l.vulnerabilities.map(n=>t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{gap:1,children:[t(e,{bold:!0,color:Ie[n.severity]??"gray",children:["⚠"," ",n.severity]}),r(e,{bold:!0,children:n.id})]}),r(i,{paddingLeft:2,children:r(e,{children:n.summary})}),t(i,{gap:2,paddingLeft:2,children:[n.cvssScore!==void 0&&t(e,{dimColor:!0,children:["CVSS:",String(n.cvssScore)]}),n.fixedVersions.length>0&&t(e,{dimColor:!0,children:["Fixed in:",n.fixedVersions.join(", ")]})]})]},n.id))]}),l.socketReport&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"cyan",children:"SOCKET.DEV"}),r(e,{}),t(i,{gap:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Overall: "}),t(e,{bold:!0,color:m,children:[String(Math.round(f*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"Supply Chain: "}),t(e,{children:[String(Math.round(l.socketReport.score.supplyChain*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"Quality: "}),t(e,{children:[String(Math.round(l.socketReport.score.quality*100)),"%"]})]})]}),t(i,{gap:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Maintenance: "}),t(e,{children:[String(Math.round(l.socketReport.score.maintenance*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"Vulnerability: "}),t(e,{children:[String(Math.round(l.socketReport.score.vulnerability*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"License: "}),t(e,{children:[l.socketReport.license||"unknown"," ","(",String(Math.round(l.socketReport.score.license*100)),"%)"]})]})]}),l.socketReport.alerts.length>0&&t(i,{flexDirection:"column",marginTop:1,children:[t(e,{bold:!0,color:"yellow",children:["⚠"," ",String(l.socketReport.alerts.length)," ","alert",l.socketReport.alerts.length===1?"":"s",":"]}),l.socketReport.alerts.map(n=>t(i,{gap:1,paddingLeft:2,children:[t(e,{bold:!0,color:Ne[n.severity]??"gray",children:["[",n.severity.toUpperCase(),"]"]}),r(e,{children:n.type}),t(e,{dimColor:!0,children:["(",n.category,")"]})]},n.key))]})]}),c&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"AI ANALYSIS"}),r(e,{}),t(i,{gap:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Action: "}),r(e,{bold:!0,color:Be[c.action]??"white",children:c.action})]}),t(i,{children:[r(e,{dimColor:!0,children:"Risk: "}),r(e,{bold:!0,color:Pe[c.riskLevel]??"white",children:c.riskLevel})]}),t(i,{children:[r(e,{dimColor:!0,children:"Effort: "}),r(e,{bold:!0,children:c.effort})]})]}),c.reason&&r(i,{marginTop:1,paddingLeft:2,children:r(e,{children:c.reason})}),c.breakingChanges.length>0&&t(i,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[r(e,{bold:!0,color:"yellow",children:"Breaking changes:"}),c.breakingChanges.map((n,A)=>t(e,{children:[" ","•"," ",n]},String(A)))]})]}),s&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"CHANGELOG"}),r(i,{marginTop:1,paddingLeft:2,children:r(e,{color:"cyan",underline:!0,children:s})})]}),t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"LINKS"}),r(i,{flexDirection:"column",marginTop:1,paddingLeft:2,children:t(e,{color:"cyan",underline:!0,children:["https://npmx.dev/",l.packageName]})})]}),!c&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"GUIDANCE"}),t(i,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[l.updateType==="major"&&t(Q,{children:[t(e,{color:"red",children:["⚠"," ","Major update — likely contains breaking changes."]}),r(e,{dimColor:!0,children:" Review the changelog before updating."}),r(e,{dimColor:!0,children:" Use --changelog to fetch release URLs."})]}),l.updateType==="minor"&&t(Q,{children:[t(e,{color:"yellow",children:["ℹ"," ","Minor update — new features, backward compatible."]}),r(e,{dimColor:!0,children:" Generally safe to update."})]}),l.updateType==="patch"&&t(Q,{children:[t(e,{color:"green",children:["✓"," ","Patch update — bug fixes only."]}),r(e,{dimColor:!0,children:" Safe to update."})]}),!c&&r(e,{dimColor:!0,children:" Use --ai to get AI-powered analysis."})]})]})]})]})},"PackageDetailPanel");var Me=Object.defineProperty,J=k((s,l)=>Me(s,"name",{value:l,configurable:!0}),"b");const je={major:"red",minor:"yellow",patch:"green"},Fe=[{id:"all",label:"All"},{id:"major",label:"Major"},{id:"minor",label:"Minor"},{id:"patch",label:"Patch"},{id:"security",label:"Security"}],Oe=J(({checked:s,entry:l,isSelected:h})=>{const c=je[l.updateType]??"white",p=l.vulnerabilities&&l.vulnerabilities.length>0,a=l.socketReport&&l.socketReport.alerts.length>0,w=!!l.acceptedRisk,b=s?"☑":"☐",f=l.socketReport?`${String(Math.round(l.socketReport.score.overall*100))}%`:"",m=l.socketReport?de(l.socketReport.score.overall):"gray";return t(i,{flexShrink:0,height:1,children:[r(e,{children:h?">":" "}),t(e,{color:s?"white":"gray",children:[" ",b," "]}),p||a?r(e,{color:w?"gray":"red",children:w?"✓ ":"⚠ "}):r(e,{children:" "}),r(i,{flexGrow:1,children:t(e,{bold:h,inverse:h,wrap:"truncate",children:[l.packageName,w?" [ack]":""]})}),f&&t(e,{color:m,children:[" ",f]}),t(e,{dimColor:!0,children:[" ",l.currentRange]}),t(e,{dimColor:!0,children:[" ","→"," "]}),t(e,{children:[l.newRange," "]}),r(e,{bold:!0,color:c,children:l.updateType})]})},"PackageRow"),Ue=J(({count:s,name:l})=>t(i,{flexShrink:0,height:1,marginTop:1,children:[t(e,{dimColor:!0,children:["▼"," "]}),r(e,{bold:!0,color:"white",children:l.toUpperCase()}),t(e,{dimColor:!0,children:[" ","(",s,")"]})]}),"CatalogHeader"),$e=J(({checkedEntries:s,entries:l,filterActive:h,filteredOutCount:c,filterText:p,filterType:a,focused:w,groupedByCatalog:b,isDryRun:f,scrollOffset:m,selectedIndex:n,totalCatalogEntries:A,totalChecked:v,totalEntries:$,viewportHeight:N})=>{const M=w?"white":"gray";let R=0,y=0,S=0,j=0;for(const g of l)g.updateType==="major"?R++:g.updateType==="minor"?y++:S++,(g.vulnerabilities&&g.vulnerabilities.length>0||g.socketReport&&g.socketReport.alerts.length>0)&&j++;const C=[];R>0&&C.push(`${R} major`),y>0&&C.push(`${y} minor`),S>0&&C.push(`${S} patch`),j>0&&C.push(`${j} vulnerable`);const G=C.length>0?` (${C.join(", ")})`:"";let E=0;for(const g of l)s.has(g.packageName)&&E++;const D=[];let I=0;for(const[g,P]of b){D.push(r(Ue,{count:P.length,name:g},`hdr-${g}`));for(const B of P){const L=I;D.push(r(Oe,{checked:s.has(B.packageName),entry:B,isSelected:L===n},B.packageName)),I++}}let x=0;for(const[,g]of b)x+=2+g.length;const T=x>N&&N>0;return t(i,{borderColor:M,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[t(i,{flexShrink:0,gap:1,paddingX:1,children:[r(e,{bold:!0,inverse:!0,children:" VIS "}),t(e,{wrap:"truncate",children:[$,v>0?`/${v}`:""," ","outdated",G,A>v?` · ${A-v} dupes`:""]}),!f&&E>0&&t(e,{dimColor:!0,children:[" ","—",E," ","selected"]})]}),r(i,{flexShrink:0,paddingX:1,paddingY:1,children:r(fe,{isFocused:w,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:k(()=>{},"onChange"),showIndex:!1,value:a,children:Fe.map(({id:g,label:P})=>r(me,{name:g,children:P},g))})}),h&&t(i,{flexShrink:0,paddingX:1,children:[r(e,{bold:!0,color:"white",children:"/ "}),r(e,{children:p}),r(e,{inverse:!0,children:" "})]}),c>0&&r(i,{flexShrink:0,paddingX:1,children:t(e,{color:"yellow",children:["⚠"," ",c," ","package",c===1?"":"s"," ","filtered out by target constraint — press"," ",r(e,{bold:!0,color:"white",children:"f"})," ","to view"]})}),t(i,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[r(i,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:r(i,{flexDirection:"column",marginTop:-m,children:D})}),T&&r(i,{flexShrink:0,marginLeft:1,marginRight:1,children:r(we,{contentHeight:x,placement:"inset",scrollOffset:m,style:"block",viewportHeight:N})})]},`list-${a}-${p}`)]})},"PackageListPanel");var Ge=Object.defineProperty,Ve=k((s,l)=>Ge(s,"name",{value:l,configurable:!0}),"Y");const He=100,qe=40,Xe=10,Ke=[],Ze=Ve(({autoExitSeconds:s=0,changelogUrls:l,checkedCount:h=0,filteredOutEntries:c=Ke,isDryRun:p,store:a,totalCatalogEntries:w=0})=>{const{exit:b}=ye(),{columns:f,rows:m}=ce(),n=Ce(a.subscribe,a.getSnapshot),[A,v]=O(!1),[$,N]=O(!1),M=K(null),R=K(null),y=K(null),S=K(null),[j,C]=O(0),[G,E]=O(!1),[D,I]=O(!1),x=ke(()=>a.getFilteredEntries(),[n.entries,n.filterType,n.filterText]),T=x[n.selectedIndex]??null,g=T?a.getRecommendation(T.packageName):void 0,P=T&&l?l.get(T.packageName):void 0,B=oe(o=>{let d=0,u=0;for(const[,q]of n.groupedByCatalog){d+=2;for(let X=0;X<q.length;X++){if(u===o)return d;d+=1,u++}}return d},[n.groupedByCatalog]),L=Math.max(1,m-8-(n.filterActive?1:0)),F=oe(o=>{const d=B(o);C(u=>d>u+L-2?Math.max(0,d-L+2):d<u+1?Math.max(0,d-1):u)},[B,L]);if(xe(()=>{y.current?.scrollToTop()},[T?.packageName]),be((o,d)=>{if(o==="c"&&d.ctrl){b();return}if(!D){if($){d.escape||o==="f"||o==="q"?N(!1):d.downArrow||o==="j"?R.current?.scrollBy(1):(d.upArrow||o==="k")&&R.current?.scrollBy(-1);return}if(G){o==="u"||d.return?(E(!1),a.startApply(),b(a.getCheckedEntries())):d.escape||o==="q"?E(!1):d.downArrow||o==="j"?S.current?.scrollBy(1):d.upArrow||o==="k"?S.current?.scrollBy(-1):d.pageDown?S.current?.scrollBy(5):d.pageUp&&S.current?.scrollBy(-5);return}if(A){d.escape||o==="?"?v(!1):o==="q"?(v(!1),I(!0)):d.downArrow||o==="j"?M.current?.scrollBy(1):(d.upArrow||o==="k")&&M.current?.scrollBy(-1);return}if(o==="?"){v(!0);return}if(o==="q"){I(!0);return}if(d.tab){a.setFocusedPanel(n.focusedPanel==="list"?"detail":"list");return}if(n.focusedPanel==="list"&&(d.leftArrow||d.rightArrow)){const u=["all","major","minor","patch","security"],q=u.indexOf(n.filterType),X=d.rightArrow?(q+1)%u.length:(q-1+u.length)%u.length;C(0),y.current?.scrollToTop(),a.setFilterType(u[X]);return}if(o==="f"&&c.length>0){N(u=>!u);return}if(n.filterActive){if(d.escape){a.setFilterActive(!1);return}if(d.return){a.setFilterActive(!1);return}if(d.backspace){C(0),a.setFilter(n.filterText.slice(0,-1));return}if(o&&!d.ctrl&&!d.meta){C(0),a.setFilter(n.filterText+o);return}return}if(n.focusedPanel==="list"){if(d.downArrow||o==="j"){const u=Math.min(n.selectedIndex+1,x.length-1);a.setSelectedIndex(u),F(u);return}if(d.upArrow||o==="k"){const u=Math.max(n.selectedIndex-1,0);a.setSelectedIndex(u),F(u);return}if(d.pageDown){const u=Math.min(n.selectedIndex+10,x.length-1);a.setSelectedIndex(u),F(u);return}if(d.pageUp){const u=Math.max(n.selectedIndex-10,0);a.setSelectedIndex(u),F(u);return}if(d.home){a.setSelectedIndex(0),C(0);return}if(d.end){const u=x.length-1;a.setSelectedIndex(u),F(u);return}if(o===" "||d.return){T&&a.toggleCheck(T.packageName);return}if(o==="a"){a.toggleAll();return}if(o==="/"){a.setFilterActive(!0);return}if(o==="u"&&!p&&n.checkedEntries.size>0){E(!0);return}if(d.rightArrow){a.setFocusedPanel("detail");return}return}if(n.focusedPanel==="detail"){if(d.escape||d.leftArrow){a.setFocusedPanel("list");return}if(d.downArrow||o==="j"){y.current?.scrollBy(1);return}if(d.upArrow||o==="k"){y.current?.scrollBy(-1);return}if(d.pageDown){y.current?.scrollBy(10);return}if(d.pageUp){y.current?.scrollBy(-10);return}if(d.home){y.current?.scrollToTop();return}d.end&&y.current?.scrollToBottom()}}},{isActive:!0}),f<qe||m<Xe)return r(i,{alignItems:"center",height:m,justifyContent:"center",width:f,children:t(e,{color:"yellow",children:["Terminal too small (",f,"x",m,")"]})});const he=f>=He,V=[t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"q"}),r(e,{dimColor:!0,children:"QUIT"})]},"q"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"?"}),r(e,{dimColor:!0,children:"HELP"})]},"?"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"↑↓"}),r(e,{dimColor:!0,children:"NAV"})]},"nav"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"Space"}),r(e,{dimColor:!0,children:"CHECK"})]},"sp"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"a"}),r(e,{dimColor:!0,children:"ALL"})]},"a")];!p&&n.checkedEntries.size>0&&V.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"green",children:"u"}),r(e,{dimColor:!0,children:"APPLY"})]},"u")),c.length>0&&V.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"yellow",children:"f"}),t(e,{dimColor:!0,children:["FILTERED (",c.length,")"]})]},"fo")),V.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"←→"}),r(e,{dimColor:!0,children:"FILTER"})]},"lr"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"/"}),r(e,{dimColor:!0,children:"SEARCH"})]},"f"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"Tab"}),r(e,{dimColor:!0,children:"PANEL"})]},"t"));const Z=r(i,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:r(i,{flexWrap:"wrap",gap:2,paddingX:1,children:V})}),ee=t(_,{footer:t(e,{dimColor:!0,children:[r(e,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",r(e,{bold:!0,color:"white",children:"?"}),"/",r(e,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:M,title:"KEYBOARD SHORTCUTS",visible:A,width:52,children:[t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"NAVIGATION"})]}),t(i,{children:[r(i,{width:24,children:t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","↑","/k"]}),r(e,{dimColor:!0,children:" Move up"})]})}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","↓","/j"]}),r(e,{dimColor:!0,children:" Move down"})]})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","Tab"]}),r(e,{dimColor:!0,children:" Switch panel"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","→","/","←"]}),r(e,{dimColor:!0,children:" Focus detail/list"})]})]}),t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"SELECTION"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","Space"]}),r(e,{dimColor:!0,children:" Toggle check on package"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","a"]}),r(e,{dimColor:!0,children:" Toggle check all"})]})]}),t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"FILTERS"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","←→"]}),r(e,{dimColor:!0,children:" Switch filter tab"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","/"]}),r(e,{dimColor:!0,children:" Text filter"})]}),c.length>0&&t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","f"]}),r(e,{dimColor:!0,children:" View filtered-out packages"})]})]}),t(i,{flexDirection:"column",children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"ACTIONS"})]}),!p&&t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","u"]}),r(e,{dimColor:!0,children:" Apply selected updates"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","q"]}),r(e,{dimColor:!0,children:" Quit"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","?"]}),r(e,{dimColor:!0,children:" Toggle help"})]})]})]}),H=a.getCheckedEntries(),z=H.filter(o=>o.updateType==="major").length,ae=t(i,{alignItems:"center",flexDirection:"column",children:[z>0&&r(i,{marginBottom:1,marginTop:1,children:t(e,{color:"yellow",children:["⚠"," ",z," ","major update",z===1?"":"s"," ","— review breaking changes"]})}),t(e,{dimColor:!0,children:["Press"," ",r(e,{bold:!0,color:"white",children:"u"})," ","or"," ",r(e,{bold:!0,color:"white",children:"Enter"})," ","to confirm,"," ",r(e,{bold:!0,color:"white",children:"Esc"})," ","to cancel"]})]}),re=r(_,{footer:ae,scrollRef:S,title:`Apply ${H.length} update${H.length===1?"":"s"}?`,visible:G,width:70,children:H.map(o=>t(i,{gap:1,children:[t(e,{children:[" ",o.packageName]}),t(e,{dimColor:!0,children:[o.currentRange," ","→"," ",o.newRange]}),r(e,{bold:!0,color:o.updateType==="major"?"red":o.updateType==="minor"?"yellow":"green",children:o.updateType})]},o.packageName))}),te=c.length>0?r(_,{footer:t(e,{dimColor:!0,children:[r(e,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",r(e,{bold:!0,color:"white",children:"f"}),"/",r(e,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:R,title:`${c.length} PACKAGE${c.length===1?"":"S"} FILTERED BY TARGET`,visible:$,width:70,children:t(i,{flexDirection:"column",children:[r(i,{marginBottom:1,children:t(e,{dimColor:!0,children:["These packages have newer versions available but are excluded by the current target constraint. Use"," ",r(e,{bold:!0,color:"white",children:"--target latest"})," ","to include them."]})}),c.map(o=>t(i,{gap:1,children:[t(e,{children:[" ",o.packageName]}),t(e,{dimColor:!0,children:[o.currentRange," ","→"," ",o.newRange]}),r(e,{bold:!0,color:o.updateType==="major"?"red":o.updateType==="minor"?"yellow":"green",children:o.updateType})]},o.packageName))]})}):null,le=r($e,{checkedEntries:n.checkedEntries,entries:x,filterActive:n.filterActive,filteredOutCount:c.length,filterText:n.filterText,filterType:n.filterType,focused:n.focusedPanel==="list",groupedByCatalog:n.groupedByCatalog,isDryRun:p,scrollOffset:j,selectedIndex:n.selectedIndex,totalCatalogEntries:w,totalChecked:h,totalEntries:x.length,viewportHeight:L}),ie=r(Le,{changelogUrl:P,entry:T,focused:n.focusedPanel==="detail",recommendation:g,scrollRef:y});if(he){const o=Math.floor(f*.35);return t(i,{flexDirection:"column",height:m,width:f,children:[t(i,{flexDirection:"row",flexGrow:1,children:[r(i,{flexGrow:1,children:le}),r(i,{width:o,children:ie})]}),Z,re,te,r(ne,{autoExitSeconds:s||3,onCancel:k(()=>{I(!1)},"onCancel"),visible:D}),ee]})}const se=Math.floor(m*.55);return t(i,{flexDirection:"column",height:m,width:f,children:[r(i,{height:se,children:le}),r(i,{flexGrow:1,children:ie}),Z,re,te,r(ne,{autoExitSeconds:s||3,onCancel:k(()=>{I(!1)},"onCancel"),visible:D}),ee]})},"VisUpdateApp");export{Je as U,ve as f,Ze as p};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
var ae=Object.defineProperty;var w=(e,t)=>ae(e,"name",{value:t,configurable:!0});import{createRequire as ie}from"node:module";import{runProvider as oe,PROVIDER_NAMES as ce,detectProvider as le,detectAvailableProviders as de}from"@visulima/find-ai-runner";import{renderToString as ue,Box as ge,Text as E,Table as pe}from"@visulima/tui";import v from"react";import{isAccessibleSync as M,readJsonSync as ye,ensureDirSync as be}from"@visulima/fs";import{join as S}from"@visulima/path";const se=ie(import.meta.url),L=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,V=w(e=>{if(typeof L<"u"&&L.versions&&L.versions.node){const[t,r]=L.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return L.getBuiltinModule(e)}return se(e)},"__cjs_getBuiltinModule"),{rmSync:T,writeFileSync:me,readdirSync:H,statSync:he}=V("node:fs"),{homedir:fe}=V("node:os");var ve=Object.defineProperty,l=w((e,t)=>ve(e,"name",{value:t,configurable:!0}),"f$1");const I=(1n<<128n)-1n,c=(1n<<64n)-1n,j=(1n<<32n)-1n,W=0x9E3779B1n,K=0x85EBCA77n,ke=0xC2B2AE3Dn,k=0x9E3779B185EBCA87n,$=0xC2B2AE3D27D4EB4Fn,X=0x165667B19E3779F9n,O=0x85EBCA77C2B2AE63n,Be=0x27D4EB2F165667C5n,$e=0x165667919E3779F9n,we=0x9FB21C651E98DF25n,b=64,G=b/8,Ee=8,h=Buffer.from("b8fe6c3923a44bbe7c01812cf721ad1cded46de9839097db7240a4a4b7b3671fcb79e64eccc0e578825ad07dccff7221b8084674f743248ee03590e6813a264c3c2852bb91c300cb88d0658b1b532ea371644897a20df94e3819ef46a9deacd8a8fa763fe39c343ff9dcbbc7c70b4f1d8a51e04bcdb45931c89f7ec9d9787364eac5ac8334d3ebc3c581a0fffa1363eb170ddd51b7f0da49d316552629d4689e2b16be587d47a1fc8ff8b8d17ad031ce45cb3a8f95160428afd7fbcabb4b407e","hex"),u=l((e,t=0)=>Buffer.from(e.buffer,e.byteOffset+t,e.length-t),"getView"),Ie=l(e=>{const t=Buffer.allocUnsafe(8);return t.writeBigUInt64LE(e),t.readBigUInt64BE()},"bswap64"),Le=l(e=>{let t=e;return t=(t&0x0000FFFFn)<<16n|(t&0xFFFF0000n)>>16n,t=(t&0x00FF00FFn)<<8n|(t&0xFF00FF00n)>>8n,t},"bswap32"),Se=l((e,t)=>(e&j)*(t&j)&c,"multU32ToU64"),Ae=l((e,t)=>(e<<t|e>>32n-t)&j,"rotl32"),N=l((e,t)=>e^e>>t,"xorshift64"),_=l(e=>~e+1n&c,"inv64"),Y=l((e,t)=>{const r=e*t&I;return r&c^r>>64n},"mul128Fold64"),f=l(e=>{let t=e;return t^=t>>37n,t=t*$e&c,t^=t>>32n,t},"avalanche"),R=l(e=>{let t=e;return t^=t>>33n,t=t*$&c,t^=t>>29n,t=t*X&c,t^=t>>32n,t},"avalanche64"),Q=l((e,t,r)=>{for(let n=0;n<G;n++){const a=t.readBigUInt64LE(n*8),i=a^r.readBigUInt64LE(n*8);e[n^1]+=a,e[n]+=Se(i,i>>32n)}return e},"accumulate512"),D=l((e,t,r,n)=>{for(let a=0;a<n;a++)Q(e,u(t,a*b),u(r,a*8));return e},"accumulate"),Ue=l((e,t)=>{for(let r=0;r<G;r++){const n=t.readBigUInt64LE(r*8);let a=e[r];a=N(a,47n),a^=n,a*=W,e[r]=a&c}return e},"scrambleAcc"),U=l((e,t)=>Y(e[0]^t.readBigUInt64LE(0),e[1]^t.readBigUInt64LE(Ee)),"mix2Accs"),q=l((e,t,r)=>{let n=r;return n+=U(e.slice(0),u(t,0)),n+=U(e.slice(2),u(t,16)),n+=U(e.slice(4),u(t,32)),n+=U(e.slice(6),u(t,48)),f(n&c)},"mergeAccs"),xe=l((e,t,r)=>{const n=Math.floor((r.byteLength-b)/8),a=b*n,i=Math.floor((t.byteLength-1)/a);for(let d=0;d<i;d++)D(e,u(t,d*a),r,n),Ue(e,u(r,r.byteLength-b));const s=Math.floor((t.byteLength-1-a*i)/b);return D(e,u(t,i*a),r,s),Q(e,u(t,t.byteLength-b),u(r,r.byteLength-b-7)),e},"hashLong"),Ce=l((e,t)=>{const r=new BigUint64Array([ke,k,$,X,O,K,Be,W]);xe(r,e,t);const n=q(r,u(t,11),BigInt(e.byteLength)*k&c);return q(r,u(t,t.byteLength-b-11),~(BigInt(e.byteLength)*$)&c)<<64n|n},"hashLong128b"),J=l((e,t,r)=>Y((e.readBigUInt64LE(0)^t.readBigUInt64LE(0)+r)&c,(e.readBigUInt64LE(8)^t.readBigUInt64LE(8)-r)&c),"mix16B"),C=l((e,t,r,n,a)=>{let i=e&c,s=e>>64n&c;return i+=J(t,n,a),i^=r.readBigUInt64LE(0)+r.readBigUInt64LE(8),i&=c,s+=J(r,u(n,16),a),s^=t.readBigUInt64LE(0)+t.readBigUInt64LE(8),s&=c,s<<64n|i},"mix32B"),je=l((e,t,r)=>{const n=e.byteLength,a=BigInt(e.readUInt8(n-1))|BigInt(n<<8)|BigInt(e.readUInt8(0)<<16)|BigInt(e.readUInt8(n>>1)<<24),i=(BigInt(t.readUInt32LE(0))^BigInt(t.readUInt32LE(4)))+r,s=(a^i)&c,d=(BigInt(t.readUInt32LE(8))^BigInt(t.readUInt32LE(12)))-r,o=(Ae(Le(a),13n)^d)&c;return(R(o)&c)<<64n|R(s)},"len1to3_128b"),Re=l((e,t,r)=>{const n=e.byteLength,a=e.readUInt32LE(0),i=e.readUInt32LE(n-4),s=BigInt(a)|BigInt(i)<<32n,d=(t.readBigUInt64LE(16)^t.readBigUInt64LE(24))+r&c;let o=(s^d)*(k+(BigInt(n)<<2n))&I;return o+=(o&c)<<65n,o&=I,o^=o>>67n,N(N(o&c,35n)*we&c,28n)|f(o>>64n)<<64n},"len4to8_128b"),Fe=l((e,t,r)=>{const n=e.byteLength,a=(t.readBigUInt64LE(32)^t.readBigUInt64LE(40))+r&c,i=(t.readBigUInt64LE(48)^t.readBigUInt64LE(56))-r&c,s=e.readBigUInt64LE();let d=e.readBigUInt64LE(n-8),o=(s^d^a)*k;const g=(o&c)+(BigInt(n-1)<<54n);o=o&(I^c)|g,d^=i,o+=d+(d&j)*(K-1n)<<64n,o&=I,o^=Ie(o>>64n);let m=(o&c)*$;return m+=(o>>64n)*$<<64n,m&=I,f(m&c)|f(m>>64n)<<64n},"len9to16_128b"),Te=l((e,t)=>{const r=e.byteLength;return r>8?Fe(e,h,t):r>=4?Re(e,h,t):r>0?je(e,h,t):R(t^h.readBigUInt64LE(64)^h.readBigUInt64LE(72))|R(t^h.readBigUInt64LE(80)^h.readBigUInt64LE(88))<<64n},"len0to16_128b"),Ne=l((e,t,r)=>{let n=BigInt(e.byteLength)*k&c,a=BigInt(e.byteLength-1)/32n;for(;a>=0n;){const d=Number(a);n=C(n,u(e,16*d),u(e,e.byteLength-16*(d+1)),u(t,32*d),r),a--}let i=n+(n>>64n)&c;i=f(i);let s=(n&c)*k+(n>>64n)*O+(BigInt(e.byteLength)-r&c)*$;return s&=c,s=_(f(s)),i|s<<64n},"len17to128_128b"),_e=l((e,t,r)=>{let n=BigInt(e.byteLength)*k&c;for(let s=32;s<160;s+=32)n=C(n,u(e,s-32),u(e,s-16),u(t,s-32),r);n=f(n&c)|f(n>>64n)<<64n;for(let s=160;s<=e.byteLength;s+=32)n=C(n,u(e,s-32),u(e,s-16),u(t,3+s-160),r);n=C(n,u(e,e.byteLength-16),u(e,e.byteLength-32),u(t,103),_(r));let a=n+(n>>64n)&c;a=f(a);let i=(n&c)*k+(n>>64n)*O+(BigInt(e.byteLength)-r&c)*$;return i&=c,i=_(f(i)),a|i<<64n},"len129to240_128b"),Me=l((e,t=0n)=>{const r=e.byteLength;return r<=16?Te(e,t):r<=128?Ne(e,h,t):r<=240?_e(e,h,t):Ce(e,h)},"xxh3_128"),Oe=l(e=>{const t=e>>64n&c,r=e&c;return t.toString(16).padStart(16,"0")+r.toString(16).padStart(16,"0")},"bigintToHex"),Z=l(e=>Oe(Me(e)),"xxh3Hash");class Pe{static{w(this,"gn")}static{l(this,"Xxh3Hasher")}#e=[];update(t){return typeof t=="string"?this.#e.push(Buffer.from(t)):this.#e.push(t),this}digest(){return Z(Buffer.concat(this.#e))}}l(()=>new Pe,"createXxh3Hasher");var De=Object.defineProperty,B=w((e,t)=>De(e,"name",{value:t,configurable:!0}),"s");const A=B(()=>S(fe(),".vis","cache","ai"),"getCacheDirectory"),qe=3600*1e3,Je=1800*1e3,ze=B(()=>{be(A())},"ensureCacheDirectory"),Ve=B((e,t,r)=>{const n=r.map(i=>({currentRange:i.currentRange,name:i.packageName,targetVersion:i.targetVersion})).toSorted((i,s)=>i.name.localeCompare(s.name)),a=JSON.stringify({analysisType:t,packages:n,provider:e});return Z(Buffer.from(a))},"buildCacheKey"),He=B(e=>{const t=S(A(),`${e}.json`);if(M(t))try{const r=ye(t);if(Date.now()-r.createdAt>r.ttlMs){T(t,{force:!0});return}return r.result}catch{T(t,{force:!0});return}},"getCachedAnalysis"),We=B((e,t,r)=>{ze();const n=A(),a={createdAt:Date.now(),result:t,ttlMs:r};me(S(n,`${e}.json`),JSON.stringify(a,void 0,2),"utf8")},"setCachedAnalysis"),Ke=B((e,t)=>t!==void 0&&t>0?t:e==="security"?Je:qe,"getTtlForAnalysisType"),Et=B(()=>{const e=A();if(!M(e))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const t=H(e).filter(i=>i.endsWith(".json"));let r=0,n,a;for(const i of t){const s=S(e,i),d=he(s);r+=d.size;const{mtimeMs:o}=d;(n===void 0||o<n)&&(n=o),(a===void 0||o>a)&&(a=o)}return{entries:t.length,newestEntry:a,oldestEntry:n,totalSizeBytes:r}},"getCacheStats"),It=B(()=>{const e=A();if(!M(e))return 0;const t=H(e).filter(r=>r.endsWith(".json"));for(const r of t)T(S(e,r),{force:!0});return t.length},"clearCache");var Xe=Object.defineProperty,p=w((e,t)=>Xe(e,"name",{value:t,configurable:!0}),"o");const Ge={amp:30,claude:80,codex:60,copilot:50,crush:35,cursor:40,droid:20,gemini:100,kimi:25,opencode:35,qwen:30},Ye=p(e=>{if(e?.provider){if(!ce.includes(e.provider))return;const n=le(e.provider);return n.available?n:void 0}const t=de();if(t.length===0)return;const r={...Ge,...e?.priority};return t.toSorted((n,a)=>(r[a.name]??0)-(r[n.name]??0))[0]},"resolveProvider"),Qe=new Set(["defer","review","skip","update"]),Ze=new Set(["critical","high","low","medium"]),et=new Set(["high","low","medium"]),tt=50,F=30,nt=2,rt=1e3,at=12e4,it=p(e=>e.map(t=>{const r=t.vulnerabilities&&t.vulnerabilities.length>0?` [VULNERABILITIES: ${t.vulnerabilities.map(a=>`${a.severity} ${a.id}`).join(", ")}]`:"";let n="";if(t.socketReport){const a=Math.round(t.socketReport.score.overall*100),i=[`score:${String(a)}%`];if(t.socketReport.alerts.length>0){const s=t.socketReport.alerts.reduce((o,g)=>(o[g.severity]=(o[g.severity]??0)+1,o),{}),d=Object.entries(s).map(([o,g])=>`${String(g)} ${o}`).join(", ");i.push(`alerts: ${d}`)}i.push(`supply-chain:${String(Math.round(t.socketReport.score.supplyChain*100))}%`),i.push(`quality:${String(Math.round(t.socketReport.score.quality*100))}%`),n=` [SOCKET.DEV: ${i.join(", ")}]`}return`- ${t.packageName}: ${t.currentRange} → ${t.newRange} (${t.updateType})${r}${n}`}).join(`
|
|
2
|
-
`),"buildPackageList"),x=`Respond ONLY with valid JSON in this exact structure:
|
|
3
|
-
{
|
|
4
|
-
"summary": "Brief overall summary",
|
|
5
|
-
"recommendations": [
|
|
6
|
-
{
|
|
7
|
-
"package": "package-name",
|
|
8
|
-
"action": "update|skip|review|defer",
|
|
9
|
-
"reason": "explanation",
|
|
10
|
-
"riskLevel": "low|medium|high|critical",
|
|
11
|
-
"breakingChanges": ["change1"],
|
|
12
|
-
"effort": "low|medium|high"
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"warnings": ["warning1"]
|
|
16
|
-
}`,st={compatibility:p(e=>`Analyze the compatibility of these package updates:
|
|
17
|
-
|
|
18
|
-
${e}
|
|
19
|
-
|
|
20
|
-
For each package:
|
|
21
|
-
1. Check peer dependency compatibility
|
|
22
|
-
2. Identify potential conflicts with other packages in the list
|
|
23
|
-
3. Assess API compatibility between current and target versions
|
|
24
|
-
4. Check for deprecated features being removed
|
|
25
|
-
5. Evaluate Node.js version requirements
|
|
26
|
-
|
|
27
|
-
${x}`,"compatibility"),impact:p(e=>`Analyze the impact of updating these npm packages:
|
|
28
|
-
|
|
29
|
-
${e}
|
|
30
|
-
|
|
31
|
-
For each package, provide:
|
|
32
|
-
1. Risk level (low/medium/high/critical)
|
|
33
|
-
2. Recommended action (update/skip/review/defer)
|
|
34
|
-
3. Reason for recommendation
|
|
35
|
-
4. Known breaking changes (if any)
|
|
36
|
-
5. Estimated migration effort (low/medium/high)
|
|
37
|
-
|
|
38
|
-
${x}`,"impact"),recommend:p(e=>`Provide smart recommendations for updating these packages:
|
|
39
|
-
|
|
40
|
-
${e}
|
|
41
|
-
|
|
42
|
-
Consider:
|
|
43
|
-
1. Update priority based on security, features, and stability
|
|
44
|
-
2. Grouping related packages for atomic updates
|
|
45
|
-
3. Best practices for the specific package ecosystem
|
|
46
|
-
4. Risk vs. benefit analysis
|
|
47
|
-
5. Suggested update order
|
|
48
|
-
6. If Socket.dev scores are provided, prioritize packages with low supply chain or quality scores
|
|
49
|
-
|
|
50
|
-
${x}`,"recommend"),security:p(e=>`Analyze the security implications of these package updates:
|
|
51
|
-
|
|
52
|
-
${e}
|
|
53
|
-
|
|
54
|
-
For each package:
|
|
55
|
-
1. Check if the update fixes known vulnerabilities (use the vulnerability data above)
|
|
56
|
-
2. Assess if the new version introduces security risks
|
|
57
|
-
3. Evaluate if this is a security-sensitive package (auth, crypto, session, etc.)
|
|
58
|
-
4. Recommend urgency of the update based on vulnerability severity
|
|
59
|
-
5. Flag any packages where skipping the update poses security risk
|
|
60
|
-
6. If Socket.dev scores are provided, factor in supply chain and quality scores — low scores indicate higher risk
|
|
61
|
-
|
|
62
|
-
${x}`,"security")},ot=new Set(["compatibility","impact","recommend","security"]),Lt=p(e=>ot.has(e)?e:"impact","validateAnalysisType"),ee=p((e,t="impact")=>{const r=it(e);return st[t](r)},"buildAnalysisPrompt"),ct=/```(?:json)?\s*([\s\S]*?)```/,lt=/\{[\s\S]*\}/,dt=p(e=>{try{return JSON.parse(e)}catch{}const t=ct.exec(e);if(t?.[1])try{return JSON.parse(t[1])}catch{}const r=lt.exec(e);if(r?.[0])try{return JSON.parse(r[0])}catch{}},"extractJson"),ut=p(e=>({action:Qe.has(e.action)?e.action:"review",breakingChanges:Array.isArray(e.breakingChanges)?e.breakingChanges:[],effort:et.has(e.effort)?e.effort:"medium",package:typeof e.package=="string"?e.package:"",reason:typeof e.reason=="string"?e.reason:"",riskLevel:Ze.has(e.riskLevel)?e.riskLevel:"medium"}),"normalizeRecommendation"),te=p((e,t,r)=>{const n=dt(e);if(!n||typeof n!="object")return{analysisType:r,provider:t,recommendations:[],summary:"Failed to parse AI response.",warnings:["AI response was not valid JSON."]};const a=n,i=Array.isArray(a.recommendations)?a.recommendations:[];return{analysisType:r,provider:t,recommendations:i.map(s=>ut(s)),summary:typeof a.summary=="string"?a.summary:"",warnings:Array.isArray(a.warnings)?a.warnings:[]}},"parseAiResponse"),gt={eslint:["ESLint 9.0: Flat config required","ESLint 8.0+: New rule formats"],next:["Next.js 13+: App router changes","Next.js 14+: Server components default"],react:["React 17 to 18: Concurrent features","React 18+: Strict mode changes"],typescript:["TypeScript 5.0: New decorators","TypeScript 4.7+: ESM changes"],vite:["Vite 5: Node.js 18+ required"],vue:["Vue 3: Composition API","Vue 3: Breaking template changes"],webpack:["Webpack 5: Node.js polyfills removed"]},pt=new Set(["bcrypt","cors","crypto-js","express-session","helmet","jose","jsonwebtoken","node-forge","oauth","passport"]),z=p((e,t)=>{const r=e.map(n=>{const a=n.vulnerabilities&&n.vulnerabilities.length>0,i=pt.has(n.packageName),s=gt[n.packageName]??[];let d="low",o="update",g="low",m="Patch/minor update, safe to apply.";return n.updateType==="major"?(d="high",o=s.length>0?"review":"update",g="medium",m=s.length>0?`Major update with known breaking changes: ${s[0]}`:"Major version update, review changelog before applying."):n.updateType==="minor"&&(d="medium",m="Minor update, generally safe."),a&&(d="high",o="update",m="Security update — current version has known vulnerabilities."),i&&n.updateType==="major"&&(o="review",m="Security-sensitive package with major update, careful review needed.",g="high"),{action:o,breakingChanges:s,effort:g,package:n.packageName,reason:m,riskLevel:d}});return{analysisType:t,provider:"rule-engine",recommendations:r,summary:`Rule-based ${t} analysis for ${String(e.length)} packages.`,warnings:["No AI provider available — using built-in rule engine."]}},"ruleBasedAnalysis"),mt=p(e=>new Promise(t=>{setTimeout(t,e)}),"sleep"),ne=p(async(e,t,r=nt)=>{let n;for(let a=0;a<=r;a+=1)try{return(await oe(e,t,{timeoutMs:at})).stdout}catch(i){if(n=i instanceof Error?i:new Error(String(i)),n.message.includes("timed out"))throw n;if(a<r){const s=rt*2**a;await mt(s)}}throw n??new Error("AI analysis failed after retries")},"runWithRetry"),ht=p(async(e,t,r)=>{const n=ee(t,r),a=await ne(e,n);return te(a,e.name,r)},"analyzeChunk"),ft=p((e,t,r)=>{const n=[],a=[],i=[];for(const s of e)n.push(...s.recommendations),a.push(...s.warnings),s.summary&&i.push(s.summary);return{analysisType:r,provider:t,recommendations:n,summary:i.length===1?i[0]??"":`Analyzed ${String(n.length)} packages in ${String(e.length)} batches.`,warnings:[...new Set(a)]}},"mergeResults"),re={compatibility:"Compatibility",impact:"Impact",recommend:"Recommendations",security:"Security"},St=p(e=>{const t=`${re[e.analysisType]??e.analysisType} Analysis (${e.provider})`,r=e.recommendations.flatMap(a=>{const i=[{action:a.action,effort:a.effort,package:a.package,reason:a.reason,risk:a.riskLevel}];return a.breakingChanges.length>0&&i.push({action:"",effort:"",package:"",reason:`Breaking: ${a.breakingChanges.join("; ")}`,risk:""}),i}),n=process.stdout.columns||80;return ue(v.createElement(ge,{borderStyle:"round",flexDirection:"column",paddingLeft:1,paddingRight:1},v.createElement(E,{bold:!0},t),v.createElement(E,null,""),v.createElement(E,null,e.summary),v.createElement(E,null,""),v.createElement(pe,{borderStyle:"none",data:r}),...e.warnings.length>0?[v.createElement(E,null,""),...e.warnings.map((a,i)=>v.createElement(E,{dimColor:!0,key:String(i)},` ${a}`))]:[]),{columns:n})},"formatAiAnalysis");p(e=>JSON.stringify(e,void 0,2),"formatAiAnalysisJson");const At=p(async(e,t,r,n="impact")=>{const a=Ye(r);if(!a)return t.info(`No AI CLI tool found, using rule-based analysis.
|
|
63
|
-
`),z(e,n);const i=Ve(a.name,n,e),s=He(i);if(s)return t.info(`Using cached ${n} analysis from ${s.provider}.
|
|
64
|
-
`),s;const d=re[n]??n;t.info(`Running ${d.toLowerCase()} analysis with ${a.name}...
|
|
65
|
-
`);try{let o;if(e.length>tt){t.info(`Splitting ${String(e.length)} packages into batches of ${String(F)}...
|
|
66
|
-
`);const g=[];for(let y=0;y<e.length;y+=F)g.push(e.slice(y,y+F));const m=[];for(let y=0;y<g.length;y+=1){t.info(` Batch ${String(y+1)}/${String(g.length)}...`);const P=g[y];P&&m.push(await ht(a,P,n))}o=ft(m,a.name,n)}else{const g=await ne(a,ee(e,n));o=te(g,a.name,n)}return We(i,o,Ke(n,r?.cacheTtl)),o}catch(o){const g=o instanceof Error?o.message:String(o);return t.warn(`AI analysis failed (${g}), falling back to rule engine.
|
|
67
|
-
`),z(e,n)}},"runAiAnalysis");export{Lt as G,Et as M,Ye as R,Ge as S,St as i,At as r,It as x};
|