@visulima/vis 1.0.0-alpha.10 → 1.0.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/CHANGELOG.md +185 -42
  2. package/LICENSE.md +586 -0
  3. package/README.md +26 -4
  4. package/dist/config/index.d.ts +1739 -0
  5. package/dist/config/index.js +1 -0
  6. package/dist/generate/index.d.ts +1 -1
  7. package/dist/packem_chunks/applyDefaults.js +2 -0
  8. package/dist/packem_chunks/bin.js +232 -60
  9. package/dist/packem_chunks/doctor-probe.js +2 -0
  10. package/dist/packem_chunks/fix.js +11 -53
  11. package/dist/packem_chunks/handler.js +1 -1
  12. package/dist/packem_chunks/handler10.js +2 -1
  13. package/dist/packem_chunks/handler11.js +1 -1
  14. package/dist/packem_chunks/handler12.js +5 -2
  15. package/dist/packem_chunks/handler13.js +1 -1
  16. package/dist/packem_chunks/handler14.js +18 -5
  17. package/dist/packem_chunks/handler15.js +20 -1
  18. package/dist/packem_chunks/handler16.js +1 -20
  19. package/dist/packem_chunks/handler17.js +1 -1
  20. package/dist/packem_chunks/handler18.js +1 -1
  21. package/dist/packem_chunks/handler19.js +1 -1
  22. package/dist/packem_chunks/handler2.js +2 -1
  23. package/dist/packem_chunks/handler20.js +5 -1
  24. package/dist/packem_chunks/handler21.js +1 -1
  25. package/dist/packem_chunks/handler22.js +1 -5
  26. package/dist/packem_chunks/handler23.js +5 -1
  27. package/dist/packem_chunks/handler24.js +1 -1
  28. package/dist/packem_chunks/handler25.js +3 -5
  29. package/dist/packem_chunks/handler26.js +1 -1
  30. package/dist/packem_chunks/handler27.js +1 -3
  31. package/dist/packem_chunks/handler28.js +7 -1
  32. package/dist/packem_chunks/handler29.js +22 -6
  33. package/dist/packem_chunks/handler3.js +4 -2
  34. package/dist/packem_chunks/handler30.js +3 -23
  35. package/dist/packem_chunks/handler31.js +1 -3
  36. package/dist/packem_chunks/handler32.js +2 -2
  37. package/dist/packem_chunks/handler33.js +24 -23
  38. package/dist/packem_chunks/handler34.js +2 -2
  39. package/dist/packem_chunks/handler35.js +3 -19
  40. package/dist/packem_chunks/handler36.js +22 -428
  41. package/dist/packem_chunks/handler37.js +428 -22
  42. package/dist/packem_chunks/handler38.js +20 -20
  43. package/dist/packem_chunks/handler39.js +21 -21
  44. package/dist/packem_chunks/handler4.js +2 -4
  45. package/dist/packem_chunks/handler40.js +22 -3
  46. package/dist/packem_chunks/handler41.js +6 -10
  47. package/dist/packem_chunks/handler42.js +5 -153
  48. package/dist/packem_chunks/handler43.js +10 -42
  49. package/dist/packem_chunks/handler44.js +153 -3
  50. package/dist/packem_chunks/handler45.js +25 -27
  51. package/dist/packem_chunks/handler46.js +3 -0
  52. package/dist/packem_chunks/handler47.js +27 -0
  53. package/dist/packem_chunks/handler48.js +42 -0
  54. package/dist/packem_chunks/handler5.js +8 -2
  55. package/dist/packem_chunks/handler6.js +1 -13
  56. package/dist/packem_chunks/handler7.js +1 -8
  57. package/dist/packem_chunks/handler8.js +1 -1
  58. package/dist/packem_chunks/handler9.js +1 -1
  59. package/dist/packem_chunks/heal-accept.js +10 -0
  60. package/dist/packem_chunks/heal.js +14 -0
  61. package/dist/packem_chunks/index.js +3 -3
  62. package/dist/packem_chunks/tar.js +3 -0
  63. package/dist/packem_shared/ai-analysis-hm8d2W7z.js +67 -0
  64. package/dist/packem_shared/{ai-cache-Bynt6Y9x.js → ai-cache-DoiF80AR.js} +1 -1
  65. package/dist/packem_shared/ai-fix-nn4zOE95.js +43 -0
  66. package/dist/packem_shared/cache-directory-CwHlJhgx.js +1 -0
  67. package/dist/packem_shared/dependency-scan-COr5n63B.js +2 -0
  68. package/dist/packem_shared/{docker-BcfqH4Av.js → docker-D6OGr5_S.js} +1 -1
  69. package/dist/packem_shared/{failure-log-DqYen0LC.js → failure-log-iUVLf6ts.js} +1 -1
  70. package/dist/packem_shared/flakiness-D9wf0t56.js +1 -0
  71. package/dist/packem_shared/giget-CcEy_Elm.js +2 -0
  72. package/dist/packem_shared/index-DH-5hsrC.js +1 -0
  73. package/dist/packem_shared/otel-DxDUPJJH.js +6 -0
  74. package/dist/packem_shared/otelPlugin-CQq6poq8.js +1 -0
  75. package/dist/packem_shared/registry-CkubDdiY.js +2 -0
  76. package/dist/packem_shared/run-summary-utils-BfBvjzhY.js +1 -0
  77. package/dist/packem_shared/{runtime-check-CGHal8SO.js → runtime-check-BXZ43CBW.js} +1 -1
  78. package/dist/packem_shared/{selectors-CfH9ZY08.js → selectors-BylODRiM.js} +1 -1
  79. package/dist/packem_shared/toolchain-BgBOUHII.js +5 -0
  80. package/dist/packem_shared/typosquats-CcZl99B1.js +1 -0
  81. package/dist/packem_shared/verify-Baj5mFJ7.js +1 -0
  82. package/dist/packem_shared/vis-update-app-D1jl0UZZ.js +1 -0
  83. package/index.js +54 -53
  84. package/package.json +34 -26
  85. package/schemas/project.schema.json +739 -299
  86. package/schemas/vis-config.schema.json +3383 -278
  87. package/skills/vis/SKILL.md +96 -0
  88. package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
  89. package/templates/buildkite-ci/template.yml +20 -0
  90. package/dist/errors/index.d.ts +0 -26
  91. package/dist/errors/index.js +0 -1
  92. package/dist/packem_chunks/config.js +0 -2
  93. package/dist/packem_shared/VisConfigCycleError-CAYNC7d-.js +0 -1
  94. package/dist/packem_shared/VisConfigError-B5LP1zRf.js +0 -1
  95. package/dist/packem_shared/VisConfigLoadError-CeqBSd2Z.js +0 -2
  96. package/dist/packem_shared/VisConfigNotFoundError-DZ9KC527.js +0 -5
  97. package/dist/packem_shared/VisUpdateApp-D-L4_-Iu.js +0 -1
  98. package/dist/packem_shared/_commonjsHelpers-D6W6KoPK.js +0 -1
  99. package/dist/packem_shared/ai-analysis-CGuy7dfE.js +0 -67
  100. package/dist/packem_shared/cache-directory-D72ZEag2.js +0 -1
  101. package/dist/packem_shared/catalog-BVPerCwG.js +0 -12
  102. package/dist/packem_shared/dependency-scan-Du0tBu64.js +0 -2
  103. package/dist/packem_shared/flakiness-DSIHZGBT.js +0 -1
  104. package/dist/packem_shared/run-summary-utils-C24Aaf9E.js +0 -1
  105. package/dist/packem_shared/target-merge-DNa-6eWu.js +0 -1
  106. package/dist/packem_shared/toolchain-DQfTQY8E.js +0 -5
  107. package/dist/packem_shared/typosquats-DOR8izpX.js +0 -1
@@ -1,4 +1,4 @@
1
- var Gn=Object.defineProperty;var f=(e,t)=>Gn(e,"name",{value:t,configurable:!0});import{createRequire as Hn}from"node:module";import{lazyNamed as K,createCerebro as Kn}from"@visulima/cerebro";import Yn from"@visulima/cerebro/command/completion";import Qn from"@visulima/cerebro/compile-cache";import{applyHeapTuning as Xn}from"@visulima/cerebro/heap-tuning";import{errorHandlerPlugin as Zn}from"@visulima/cerebro/plugins/error-handler";import{ensureDirSync as Ve,isAccessibleSync as u,readFileSync as j,walkSync as Qt,readJsonSync as U,writeFileSync as A}from"@visulima/fs";import{findMonorepoRootSync as Xt}from"@visulima/package";import{join as d,resolve as st,dirname as eo,parse as to}from"@visulima/path";import{useApp as Zt,useInput as en,Dialog as et,Text as g,Box as S,ScrollView as no,ScrollBar as oo,useWindowSize as ao,render as ro}from"@visulima/tui";import io,{useState as Pe,useRef as Ie,useEffect as tt,useCallback as tn,useSyncExternalStore as so}from"react";import{jsx as m,jsxs as b}from"react/jsx-runtime";import{m as Me}from"../packem_shared/target-merge-DNa-6eWu.js";import{findVisConfigFile as Ae,loadVisConfig as jt}from"./config.js";import{readYamlSync as nn}from"@visulima/fs/yaml";import{hyperlink as mo}from"@visulima/ansi";import{dim as De,red as Xe,bold as oe,yellow as Re,cyan as pe,green as go}from"@visulima/colorize";import{validRange as ko,satisfies as bo,coerce as wo,lt as $o,gt as So}from"semver";import{createPail as xo}from"@visulima/pail";import{resolveAdd as jo,whichBin as Co,execPmCommandInteractive as Oo,resolveInstall as Po,resolveDedupe as Ro,resolveDlx as Io,resolveExec as Bo,resolveLink as Vo,resolvePmCommand as Ao,resolveRemove as Eo,resolveUnlink as To,resolveWhy as Do,detectPackageManager as Mo,resolveOutdated as No}from"#native";const qn=Hn(import.meta.url),ve=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Be=f(e=>{if(typeof ve<"u"&&ve.versions&&ve.versions.node){const[t,n]=ve.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return ve.getBuiltinModule(e)}return qn(e)},"__cjs_getBuiltinModule"),{env:Qe}=ve,{spawnSync:ke,execSync:lo}=Be("node:child_process"),{writeFileSync:E,statSync:we,readdirSync:ae,rmSync:lt,copyFileSync:co,unlinkSync:Fe,mkdirSync:po,cpSync:uo}=Be("node:fs"),{platform:fo,homedir:Le}=Be("node:os"),{resolve:ho,join:yo}=Be("node:path"),{createInterface:vo}=Be("node:readline");var Wo="1.0.0-alpha.9";const Ne={version:Wo};var Fo=Object.defineProperty,Lo=f((e,t)=>Fo(e,"name",{value:t,configurable:!0}),"e$H");const _o={argument:{description:"Target selector (same syntax as `vis run`): `build`, `:build`, `~:test`, `#tag:lint`, …",name:"selector",type:String},description:"Show the execution plan for a target without running it",examples:[["vis action-graph build","Print the task plan for `build` on every project"],["vis action-graph :test","Moon-style selector"],["vis action-graph build --json","Emit a JSON description of the plan"],['vis action-graph lint --query "tag=frontend"',"Filter projects by query"]],group:"Workspace",loader:Lo(()=>import("./handler.js"),"loader"),name:"action-graph",options:[{defaultValue:!1,description:"Emit JSON instead of ASCII",name:"json",type:Boolean},{description:"Filter matched projects by a query",name:"query",type:String}]};var zo=Object.defineProperty,Uo=f((e,t)=>zo(e,"name",{value:t,configurable:!0}),"e$G");const Jo={argument:{description:"Packages to add (e.g., react react-dom)",name:"packages",type:String},description:"Add packages using the detected package manager",examples:[["vis add react react-dom","Add packages"],["vis add -D typescript @types/react","Add as dev dependencies"],["vis add react --filter app","Add to specific workspace package"],["vis add -g typescript","Add globally (uses npm)"],["vis add lodash -w","Add to workspace root"],["vis add lodash --no-socket-check","Add without Socket.dev check"],["vis add lodash --no-typosquat-check","Skip typosquat name check"],["vis add lodash --run-scripts","Run lifecycle scripts (opts out of vis's default block-by-default policy)"]],group:"Dependencies",loader:Uo(()=>import("./handler2.js"),"loader"),name:"add",options:[{alias:"D",defaultValue:!1,description:"Add as dev dependency",name:"save-dev",type:Boolean},{alias:"E",defaultValue:!1,description:"Save exact version",name:"exact",type:Boolean},{alias:"P",defaultValue:!1,description:"Add as peer dependency",name:"save-peer",type:Boolean},{alias:"O",defaultValue:!1,description:"Add as optional dependency",name:"save-optional",type:Boolean},{alias:"g",defaultValue:!1,description:"Install globally (uses npm)",name:"global",type:Boolean},{alias:"w",defaultValue:!1,description:"Add to workspace root",name:"workspace-root",type:Boolean},{defaultValue:!1,description:"Use workspace protocol (pnpm)",name:"workspace",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String},{defaultValue:!1,description:"Skip typosquat name check before adding",name:"no-typosquat-check",type:Boolean},{defaultValue:!1,description:"Skip Socket.dev security check before adding",name:"no-socket-check",type:Boolean},{defaultValue:!1,description:"Run lifecycle scripts during add (opts out of vis's default block-by-default policy; allowlisted packages run via security.allowBuilds)",name:"run-scripts",type:Boolean}]};var Go=Object.defineProperty,Ho=f((e,t)=>Go(e,"name",{value:t,configurable:!0}),"e$F");const qo={argument:{description:"The target to run (e.g., build, test, lint)",name:"target",type:String},description:"Run a target only on projects affected by recent changes",examples:[["vis affected build","Run build on affected projects"],["vis affected test --base=main","Run tests on projects changed since main"]],group:"Run & Execute",loader:Ho(()=>import("./handler3.js"),"loader"),name:"affected",options:[{defaultValue:"HEAD~1",description:"Git base ref for comparison",name:"base",type:String},{defaultValue:"HEAD",description:"Git head ref for comparison",name:"head",type:String},{defaultValue:"deep",description:'Downstream scope: "none", "direct", or "deep" — controls how far to include dependents of changed projects',name:"downstream",type:String},{defaultValue:"none",description:'Upstream scope: "none", "direct", or "deep" — controls how far to include dependencies of changed projects',name:"upstream",type:String},{defaultValue:3,description:"Maximum number of parallel tasks",name:"parallel",type:Number},{defaultValue:!0,description:"Enable caching (use --no-cache to disable)",name:"cache",type:Boolean},{defaultValue:!1,description:"Show what would run without executing",name:"dry-run",type:Boolean},{description:'Partition tasks for distributed CI (e.g., "1/4" for first of four runners). Falls back to VIS_PARTITION env var.',name:"partition",type:String},{description:"Filter affected projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String}]},ct={description:"Output format: table or json (default: table)",name:"format",type:String},Ko={commandPath:["ai"],description:"List detected AI providers and show which one is selected",examples:[["vis ai providers","List all AI providers and their status"],["vis ai providers --format json","Output as JSON"]],group:"System",loader:K(()=>import("./handler29.js"),"aiProvidersExecute"),name:"providers",options:[ct]},Yo={commandPath:["ai"],description:"Test the best available AI provider with a quick prompt",examples:[["vis ai test","Test the selected provider"]],group:"System",loader:K(()=>import("./handler29.js"),"aiTestExecute"),name:"test",options:[]},Qo={argument:{description:"Task ID to propose a fix for (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["ai"],description:"Read a failed task's logs and propose a structured patch (Phase 1: local-only, no git)",examples:[["vis ai fix @myorg/app:build","Print proposed patch for the failed task"],["vis ai fix @myorg/app:build --apply","Apply the patch to disk after confirming"],["vis ai fix @myorg/app:build --format json","Machine-readable patch output"],["vis ai fix @myorg/app:build --run 2026-04-28T...","Inspect a specific historical run"]],group:"System",loader:K(()=>import("./handler29.js"),"aiFixExecute"),name:"fix",options:[ct,{description:"Use a specific run ID from .task-runner/runs/ instead of the latest run",name:"run",type:String},{defaultValue:!1,description:"Apply the proposed patch to disk after printing it",name:"apply",type:Boolean},{defaultValue:!1,description:"Bypass the AI response cache",name:"no-cache",type:Boolean},{defaultValue:!1,description:"Skip the confirmation prompt before applying",name:"yes",type:Boolean}]},Xo={description:"AI-assisted commands: provider detection and failure-fix proposals (cache management lives under `vis cache`)",examples:[["vis ai","List all AI subcommands"],["vis ai --format json","Machine-readable subcommand catalogue (for AI agents)"]],group:"System",loader:K(()=>import("./handler29.js"),"aiRootExecute"),name:"ai",options:[ct]},on=[Xo,Ko,Yo,Qo],yp=Object.defineProperty({__proto__:null,default:on},Symbol.toStringTag,{value:"Module"});var Zo=Object.defineProperty,ea=f((e,t)=>Zo(e,"name",{value:t,configurable:!0}),"e$E");const ta={argument:{description:"Package name to analyze (e.g., react)",name:"package",required:!0,type:String},description:"Analyze a single package update with AI",examples:[["vis analyze react","Analyze updating react to latest"],["vis analyze react 19.0.0","Analyze updating react to specific version"],["vis analyze react --ai-type security","Run security-focused analysis"],["vis analyze react --format json","Output as JSON"]],group:"System",loader:ea(()=>import("./handler4.js"),"loader"),name:"analyze",options:[{description:"AI analysis type: impact, security, compatibility, or recommend (default: impact)",name:"ai-type",type:String},{defaultValue:!1,description:"Check for known security vulnerabilities",name:"security",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var na=Object.defineProperty,oa=f((e,t)=>na(e,"name",{value:t,configurable:!0}),"e$D");const aa={description:"Review and approve dependencies with build scripts",examples:[["vis approve-builds","Scan and list unapproved build scripts"],["vis approve-builds --all","Approve all pending builds (pnpm)"],["vis approve-builds --sync-native","Sync allowBuilds to native PM config"]],group:"Security & Health",loader:oa(()=>import("./handler5.js"),"loader"),name:"approve-builds",options:[{defaultValue:!1,description:"Approve all pending builds without prompting (pnpm only)",name:"all",type:Boolean},{defaultValue:!1,description:"Force vis scanning even for pnpm (instead of delegating)",name:"scan",type:Boolean},{defaultValue:!1,description:"Sync allowBuilds to native PM config (bun: trustedDependencies, npm: .npmrc, yarn: .yarnrc.yml)",name:"sync-native",type:Boolean}]};var ra=Object.defineProperty,ia=f((e,t)=>ra(e,"name",{value:t,configurable:!0}),"e$C");const sa={description:"Audit installed packages for vulnerabilities and supply chain risks",examples:[["vis audit","Full audit of all installed packages"],["vis audit --severity high","Show only high/critical issues"],["vis audit --format json","Output as JSON for CI integration"],["vis audit --fix","Show fix suggestions for vulnerabilities"],["vis audit --exit-code","Exit with code 1 if issues found (for CI)"],["vis audit --show-accepted","Include acknowledged risks in output"],["vis audit --sync","Sync accepted risks to native PM config (pnpm-workspace.yaml / .yarnrc.yml)"]],group:"Security & Health",loader:ia(()=>import("./handler30.js"),"loader"),name:"audit",options:[{description:"Minimum severity to report: low, medium, high, critical (default: low)",name:"severity",type:String},{description:"Output format: table or json (default: table)",name:"format",type:String},{defaultValue:!1,description:"Show fix suggestions for vulnerabilities",name:"fix",type:Boolean},{defaultValue:!1,description:"Exit with code 1 if any issues found (for CI)",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Include acknowledged (accepted risk) issues in output",name:"show-accepted",type:Boolean},{defaultValue:!1,description:"Sync vis accepted risks to native PM config (pnpm-workspace.yaml / .yarnrc.yml)",name:"sync",type:Boolean}]},_e={description:"Cache directory (overrides config and default). Relative paths are resolved against the workspace root.",name:"cache-dir",type:String},dt={description:"Cache scope: 'shared' (default — main worktree's cache), 'worktree' (this checkout's local cache), or 'all' (both)",name:"scope",type:String},an={description:"Cache type: 'task' (workspace task cache), 'ai' (AI response cache), 'socket' (Socket.dev report cache), or 'all' (default)",name:"type",type:String},la={commandPath:["cache"],description:"List all cache entries",examples:[["vis cache list","List all cache entries"]],group:"Workspace",loader:K(()=>import("./handler6.js"),"cacheListExecute"),name:"list",options:[_e,dt,{description:"Output format: table or json (default: table)",name:"format",type:String}]},ca={commandPath:["cache"],description:"Remove cache entries (defaults to all stores: workspace task cache, AI responses, Socket.dev reports)",examples:[["vis cache clean","Remove all cache entries from every store"],["vis cache clean --type=ai","Clear only the AI response cache"],["vis cache clean --type=task","Clear only the workspace task cache"],["vis cache clean --dry-run","Preview what clean would remove"]],group:"Workspace",loader:K(()=>import("./handler6.js"),"cacheCleanExecute"),name:"clean",options:[_e,an,{defaultValue:!1,description:"Preview without deleting",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Skip the confirmation prompt for out-of-workspace cache directories",name:"force",type:Boolean}]},da={commandPath:["cache"],description:"Remove old and oversized cache entries",examples:[["vis cache prune","Remove old and oversized entries"],["vis cache prune --max-age-days=3 --max-size=500MB","Prune with custom limits"],["vis cache prune --keep-last=30","Keep only the 30 most recent entries"]],group:"Workspace",loader:K(()=>import("./handler6.js"),"cachePruneExecute"),name:"prune",options:[_e,dt,{description:"Remove entries older than N days",name:"max-age-days",type:Number},{description:"Evict oldest entries until cache is under this size (e.g. 500MB)",name:"max-size",type:String},{description:"Keep only the N most recent entries (sorted newest-first by mtime)",name:"keep-last",type:Number}]},pa={commandPath:["cache"],description:"Print on-disk footprint and stats for one or more cache stores (task / ai / socket)",examples:[["vis cache size","Show stats for every cache store"],["vis cache size --type=ai","Show only the AI response cache (entries, size, oldest, newest)"],["vis cache size --type=task --format=json","Machine-readable task cache size"]],group:"Workspace",loader:K(()=>import("./handler6.js"),"cacheSizeExecute"),name:"size",options:[_e,dt,an,{description:"Output format: table or json (default: table)",name:"format",type:String}]},rn={description:"Output format: table or json (default: table)",name:"format",type:String},sn={description:"Use a specific run ID from .task-runner/runs/ instead of the latest run",name:"run",type:String},ua={argument:{description:"Task ID to explain (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Explain why a task missed the cache by diffing hash inputs against the previous run",examples:[["vis cache why @myorg/app:build","Show which inputs changed since the last run"],["vis cache why @myorg/app:build --json","Machine-readable output for CI"],["vis cache why @myorg/app:build --run 2026-04-28T...","Inspect a specific historical run"]],group:"Workspace",loader:K(()=>import("./handler6.js"),"cacheWhyExecute"),name:"why",options:[rn,sn]},fa={argument:{description:"Task ID to print the hash for (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Print the recorded hash and per-input hash details for a task",examples:[["vis cache hash @myorg/app:build","Show the resolved hash + contributing inputs"],["vis cache hash @myorg/app:build --json","Machine-readable output"]],group:"Workspace",loader:K(()=>import("./handler6.js"),"cacheHashExecute"),name:"hash",options:[rn,sn]},ma=[la,ca,da,pa,ua,fa];var ga=Object.defineProperty,ha=f((e,t)=>ga(e,"name",{value:t,configurable:!0}),"e$B");const ya={alias:["c","outdated"],argument:{description:"Specific packages to check (checks all if omitted)",name:"packages",type:String},description:"Check for outdated dependencies, security vulnerabilities, and supply chain settings",examples:[["vis check","Check all catalog dependencies"],["vis check react","Check specific packages"],["vis check --target minor","Only show minor/patch updates"],["vis check --exclude '@types/*'","Exclude packages by pattern"],["vis check --no-security","Skip vulnerability scanning"],["vis check --security-config","Audit supply chain security settings"],["vis check --security-config --sync","Sync security config to pnpm-workspace.yaml"]],group:"Security & Health",loader:ha(()=>import("./handler7.js"),"loader"),name:"check",options:[{alias:"t",description:"Update target: latest, minor, or patch (default: latest)",name:"target",type:String},{description:"Glob pattern to include packages (repeatable)",lazyMultiple:!0,name:"include",type:String},{description:"Glob pattern to exclude packages (repeatable)",lazyMultiple:!0,name:"exclude",type:String},{defaultValue:!1,description:"Include prerelease versions",name:"prerelease",type:Boolean},{defaultValue:!1,description:"Skip security vulnerability scanning",name:"no-security",type:Boolean},{defaultValue:!1,description:"Audit supply chain security settings",name:"security-config",type:Boolean},{defaultValue:!1,description:"Sync security settings to pnpm-workspace.yaml (pnpm only, requires --security-config)",name:"sync",type:Boolean},{description:"Output format: table, json, or minimal (default: table)",name:"format",type:String},{defaultValue:!1,description:"Exit with code 1 if outdated dependencies found (for CI)",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Run AI analysis on outdated packages",name:"ai",type:Boolean},{description:"AI analysis type: impact, security, compatibility, or recommend",name:"ai-type",type:String},{alias:"D",defaultValue:!1,description:"Check only devDependencies (npm/yarn mode)",name:"dev",type:Boolean},{alias:"P",defaultValue:!1,description:"Check only dependencies (npm/yarn mode)",name:"prod",type:Boolean}]};var va=Object.defineProperty,ka=f((e,t)=>va(e,"name",{value:t,configurable:!0}),"e$A");const ba={argument:{description:"Comma-separated list of targets to run (e.g., lint,test,build)",name:"targets",type:String},description:"Run affected targets in a CI-optimized pipeline",examples:[["vis ci lint,test,build","Run lint, test, and build on affected projects"],["vis ci test --base=origin/main","Override the base ref"],["vis ci build --no-install","Skip the install step (assume deps already present)"],["vis ci build --parallel=6","Increase concurrency"]],group:"Run & Execute",loader:ka(()=>import("./handler8.js"),"loader"),name:"ci",options:[{defaultValue:!0,description:"Install dependencies before running targets (use --no-install to skip)",name:"install",type:Boolean},{defaultValue:!1,description:"Skip the toolchain pre-flight (no auto-install for any pinned tool: node / pnpm / yarn / npm / bun / deno / go / python / ruby / rust)",name:"skip-toolchain",type:Boolean},{description:"Git base ref for affected detection (default: auto-detected from CI env)",name:"base",type:String},{description:"Git head ref for affected detection (default: HEAD)",name:"head",type:String},{defaultValue:"none",description:"Upstream scope: none | direct | deep",name:"upstream",type:String},{defaultValue:"deep",description:"Downstream scope: none | direct | deep",name:"downstream",type:String},{defaultValue:4,description:"Maximum number of parallel tasks per target",name:"parallel",type:Number},{description:'Partition tasks for distributed CI (e.g., "1/4")',name:"partition",type:String},{description:"Filter affected projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String}]};var wa=Object.defineProperty,$a=f((e,t)=>wa(e,"name",{value:t,configurable:!0}),"e$z");const Sa={description:"Remove node_modules from all workspace projects",examples:[["vis clean","Remove all node_modules directories"],["vis clean --lockfile","Also remove lockfiles"],["vis clean --dry-run","Preview what would be removed"]],group:"Workspace",loader:$a(()=>import("./handler9.js"),"loader"),name:"clean",options:[{alias:"l",defaultValue:!1,description:"Also remove lockfiles (pnpm-lock.yaml, package-lock.json, etc.)",name:"lockfile",type:Boolean},{defaultValue:!1,description:"Preview what would be removed without deleting",name:"dry-run",type:Boolean}]};var xa=Object.defineProperty,ja=f((e,t)=>xa(e,"name",{value:t,configurable:!0}),"e$y");const Ca={argument:{description:"Template to use (e.g., vis:app, create-vite, user/repo) — omit for interactive mode",name:"template",type:String},description:"Create a new project from a template",examples:[["vis create","Interactive project scaffolding"],["vis create vis:monorepo my-workspace","Create a monorepo workspace"],["vis create vis:app my-app","Scaffold a Vite application"],["vis create vis:library my-lib","Create a TypeScript library"],["vis create vite my-app -- --template react-ts","Use create-vite with React TypeScript"],["vis create user/repo my-project","Clone a GitHub template"],["vis create --list","Show available templates"]],group:"Scaffold & Config",loader:ja(()=>import("./handler42.js"),"loader"),name:"create",options:[{defaultValue:!1,description:"Show available templates",name:"list",type:Boolean},{description:"Generate editor configs (vscode)",name:"editor",type:String},{defaultValue:!1,description:"Initialize a git repository",name:"git-init",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts",name:"no-interactive",type:Boolean}]};var Oa=Object.defineProperty,Pa=f((e,t)=>Oa(e,"name",{value:t,configurable:!0}),"e$x");const Ra={description:"Deduplicate dependencies using the detected package manager",examples:[["vis dedupe","Run deduplication"],["vis dedupe --check","Preview changes without modifying (CI-friendly)"]],group:"Dependencies",loader:Pa(()=>import("./handler10.js"),"loader"),name:"dedupe",options:[{defaultValue:!1,description:"Preview changes without modifying files (dry-run)",name:"check",type:Boolean}]};var Ia=Object.defineProperty,Ba=f((e,t)=>Ia(e,"name",{value:t,configurable:!0}),"e$w");const Va={alias:"dc",description:"Create or update .devcontainer/devcontainer.json interactively",examples:[["vis devcontainer","Launch interactive devcontainer config editor"],["vis dc","Alias for devcontainer"],["vis devcontainer --template node-pnpm","Start from Node.js + pnpm template"]],group:"Scaffold & Config",loader:Ba(()=>import("./handler44.js"),"loader"),name:"devcontainer",options:[{alias:"t",description:"Start from a template: node, node-pnpm, node-postgres, node-dind, fullstack, python, go, rust, java, devops, minimal, custom",name:"template",type:String},{alias:"o",description:"Output path (default: .devcontainer/devcontainer.json)",name:"output",type:String}]};var Aa=Object.defineProperty,Ea=f((e,t)=>Aa(e,"name",{value:t,configurable:!0}),"e$v");const Ta={argument:{description:"Package to execute (optionally with @version)",name:"package",type:String},description:"Execute a remote package without permanent installation",examples:[["vis dlx create-vite my-app","Scaffold a new project"],["vis dlx typescript@5.5.4 tsc --version","Run specific version"],["vis dlx -p cowsay -p lolcatjs -c 'echo hi | cowsay | lolcatjs'","Multiple packages with shell"]],group:"Run & Execute",loader:Ea(()=>import("./handler11.js"),"loader"),name:"dlx",options:[{alias:"p",description:"Additional packages to install (repeatable)",multiple:!0,name:"package",type:String},{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output except command results",name:"silent",type:Boolean}]};var Da=Object.defineProperty,Ma=f((e,t)=>Da(e,"name",{value:t,configurable:!0}),"e$u");const Na={argument:{description:"Docker subcommand: scaffold | prune",name:"subcommand",type:String},description:"Docker integration — scaffold a minimal context or prune unfocused deps",examples:[["vis docker scaffold --focus=my-app","Generate .vis/docker/workspace for my-app + its deps"],["vis docker scaffold --focus=my-app --include-sources","Also copy focus source trees"],["vis docker scaffold --focus=my-app,other --out=.vis/docker","Focus multiple projects"],["vis docker prune --context=.vis/docker","Strip unfocused projects inside a build stage"]],group:"Workspace",loader:Ma(()=>import("./handler12.js"),"loader"),name:"docker",options:[{description:"Project name(s) to focus on — comma-separated for multiple",name:"focus",type:String},{description:"Output directory for the scaffold (default: .vis/docker)",name:"out",type:String},{defaultValue:!1,description:"Also copy focus project source trees to <out>/sources",name:"include-sources",type:Boolean},{description:"Scaffold root for `vis docker prune` (default: .vis/docker)",name:"context",type:String}]};var Wa=Object.defineProperty,Fa=f((e,t)=>Wa(e,"name",{value:t,configurable:!0}),"e$t");const La={description:"Run a full project health check (outdated, security, duplicates, optimizations)",examples:[["vis doctor","Full project health check"],["vis doctor --fix","Check and auto-apply safe fixes"],["vis doctor --format json","Machine-readable output for CI"],["vis doctor --only security","Only run the security scans"],["vis doctor --skip optimization,runtime","Skip the listed sections"],["vis doctor --quiet","Summary only, no per-section breakdown"],["vis doctor --no-progress","Disable live progress UI (sequential logs)"],["vis doctor --exit-code","Exit with code 1 if security issues found"],["vis doctor --exit-code --strict","Fail on any issue (outdated, duplicates, security)"]],group:"Security & Health",loader:Fa(()=>import("./handler41.js"),"loader"),name:"doctor",options:[{description:"Output format: table or json (default: table). Alias: --json",name:"format",type:String},{defaultValue:!1,description:"Shorthand for --format json",name:"json",type:Boolean},{defaultValue:!1,description:"Exit with code 1 if issues found",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Auto-apply safe fixes (security overrides + codemods, SIGTERM orphans)",name:"fix",type:Boolean},{defaultValue:!1,description:"With --fix: escalate orphan cleanup to SIGKILL / taskkill /F (use when SIGTERM is ignored)",name:"fix-force",type:Boolean},{defaultValue:!1,description:"With --exit-code: also fail on outdated and duplicate deps",name:"strict",type:Boolean},{description:"Comma-separated sections to run: dependencies,security,optimization,runtime",name:"only",type:String},{description:"Comma-separated sections to skip",name:"skip",type:String},{defaultValue:!1,description:"Suppress per-section detail; print summary only",name:"quiet",type:Boolean},{defaultValue:!1,description:"Disable live progress UI (forces sequential logs)",name:"no-progress",type:Boolean},{defaultValue:!1,description:"Bypass the doctor result cache (~/.vis/cache/doctor)",name:"no-cache",type:Boolean},{description:"Comma-separated package name patterns to scope findings (supports * globs, e.g. '@types/*,react')",name:"filter",type:String}]};var _a=Object.defineProperty,za=f((e,t)=>_a(e,"name",{value:t,configurable:!0}),"e$s");const Ua={argument:{description:"Command to execute followed by arguments",name:"command",type:String},description:"Execute a local node_modules/.bin command (no remote fallback)",examples:[["vis exec eslint .","Run local eslint"],["vis exec tsc --noEmit","Run local TypeScript check"],["vis exec -r -- eslint .","Run in all workspace packages"],["vis exec -c 'echo $PATH'","Shell mode"]],group:"Run & Execute",loader:za(()=>import("./handler13.js"),"loader"),name:"exec",options:[{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"r",defaultValue:!1,description:"Run in every workspace package",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Run on workspace root only",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter packages by name pattern",multiple:!0,name:"filter",type:String},{defaultValue:!1,description:"Run concurrently without topological ordering",name:"parallel",type:Boolean},{defaultValue:!1,description:"Reverse topological execution order",name:"reverse",type:Boolean}]};var Ja=Object.defineProperty,Ga=f((e,t)=>Ja(e,"name",{value:t,configurable:!0}),"e$r");const Ha={argument:{description:"Template name (or remote source like git://… or npm://…) — omit for interactive picker",name:"template",type:String},description:"Scaffold files from an in-repo template",examples:[["vis generate","Pick a template interactively"],["vis generate package","Run the 'package' template"],["vis generate component -- --name=Button --style=primary","Pre-fill option values"],["vis generate package --to=./packages/new --force","Custom destination + overwrite"],["vis generate package --dry-run","Print planned writes without touching disk"],["vis generate git://github.com/org/template#main","Fetch and run a remote template"],["vis generate --list","Show discovered templates"]],group:"Scaffold & Config",loader:Ga(()=>import("./handler35.js"),"loader"),name:"generate",options:[{defaultValue:!1,description:"List discovered templates",name:"list",type:Boolean},{description:"Destination directory",name:"to",type:String},{defaultValue:!1,description:"Print planned writes without touching disk",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Overwrite existing files without prompting",name:"force",type:Boolean},{defaultValue:!1,description:"Skip prompts; use template defaults",name:"defaults",type:Boolean},{defaultValue:!1,description:"Skip running post-generation scripts",name:"skip-scripts",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts (errors on missing required values)",name:"no-interactive",type:Boolean},{defaultValue:!1,description:"Prefer locally cached remote templates over re-downloading",name:"prefer-offline",type:Boolean}]};var qa=Object.defineProperty,Ka=f((e,t)=>qa(e,"name",{value:t,configurable:!0}),"t$h");const Ya={description:"Visualize the project dependency graph",examples:[["vis graph","Show colored dependency graph (TUI in TTY, ASCII otherwise)"],["vis graph --format=ascii","Force ASCII tree output"],["vis graph --format=dot","Output in Graphviz DOT format"],["vis graph --format=html --output=graph.html","Generate interactive HTML graph"],["vis graph --format=json --output=graph.json","Save JSON graph to file"]],group:"Workspace",loader:Ka(()=>import("./handler36.js"),"loader"),name:"graph",options:[{alias:"f",defaultValue:void 0,description:"Output format: tui, ascii, dot, json, html (default: tui in TTY, ascii otherwise)",name:"format",type:String},{alias:"o",description:"Write output to file instead of stdout",name:"output",type:String},{alias:"d",description:"Maximum dependency tree depth for ASCII output (default: unlimited)",name:"depth",type:Number}]},ln=["pre-commit","pre-merge-commit","prepare-commit-msg","commit-msg","post-commit","applypatch-msg","pre-applypatch","post-applypatch","pre-rebase","post-rewrite","post-checkout","post-merge","pre-push","pre-auto-gc"],cn=".vis-hooks",vp=[".pre-commit-config.yaml",".pre-commit-config.yml","prek.toml"],kp={commit:"pre-commit","merge-commit":"pre-merge-commit",push:"pre-push"},bp=new Set(["commit-msg","post-checkout","post-commit","post-merge","post-rewrite","pre-commit","pre-merge-commit","pre-push","pre-rebase","prepare-commit-msg"]),wp=new Set(["commit-msg","post-checkout","post-merge","post-rewrite","pre-rebase","prepare-commit-msg"]),$p=new Set(["fail","script","system"]);var Qa=Object.defineProperty,fe=f((e,t)=>Qa(e,"name",{value:t,configurable:!0}),"e$p");const me={defaultValue:cn,description:"Custom hooks directory",name:"hooks-dir",type:String},ge=[{defaultValue:void 0,description:"Set to 0 to disable git hooks, set to 2 for debug output",name:"VIS_GIT_HOOKS",type:String}],Xa={commandPath:["hook"],description:"Install git hooks for the workspace (migrates husky / prek on prompt)",env:[...ge],examples:[["vis hook install","Install git hooks in .vis-hooks/"],["vis hook install --hooks-dir=.githooks","Install hooks in a custom directory"]],group:"Scaffold & Config",loader:fe(()=>import("./handler38.js").then(e=>({default:e.hookInstallExecute})),"loader"),name:"install",options:[me]},Za={commandPath:["hook"],description:"Remove git hooks and reset core.hooksPath",env:[...ge],examples:[["vis hook uninstall","Remove git hooks and reset core.hooksPath"]],group:"Scaffold & Config",loader:fe(()=>import("./handler38.js").then(e=>({default:e.hookUninstallExecute})),"loader"),name:"uninstall",options:[me]},er={commandPath:["hook"],description:"Migrate from husky or prek to vis hooks (auto-detected)",env:[...ge],examples:[["vis hook migrate","Migrate from husky or prek to vis hooks (auto-detected)"],["vis hook migrate --dry-run","Preview what a migration would write without touching disk"]],group:"Scaffold & Config",loader:fe(()=>import("./handler38.js").then(e=>({default:e.hookMigrateExecute})),"loader"),name:"migrate",options:[me,{defaultValue:!1,description:"Preview migrate without writing files",name:"dry-run",type:Boolean}]},tr={commandPath:["hook"],description:"Show configured hooks grouped by stage",env:[...ge],examples:[["vis hook list","Show configured hooks grouped by stage"]],group:"Scaffold & Config",loader:fe(()=>import("./handler38.js").then(e=>({default:e.hookListExecute})),"loader"),name:"list",options:[me]},nr={commandPath:["hook"],description:"Sanity-check installed hooks and the bundled runner",env:[...ge],examples:[["vis hook validate","Sanity-check installed hooks and the bundled runner"]],group:"Scaffold & Config",loader:fe(()=>import("./handler38.js").then(e=>({default:e.hookValidateExecute})),"loader"),name:"validate",options:[me]},or={argument:{description:"Hook stage to run (e.g. pre-commit, commit-msg). Defaults to pre-commit.",name:"stage",type:String},commandPath:["hook"],description:"Run a specific hook stage against tracked files",env:[...ge],examples:[["vis hook run pre-commit --all-files","Run the pre-commit hooks against every tracked file"],["vis hook run pre-commit --from-ref=main --to-ref=HEAD","Run pre-commit hooks on files changed between two refs"],["vis hook run pre-commit --last-commit","Shortcut for --from-ref HEAD~1 --to-ref HEAD"]],group:"Scaffold & Config",loader:fe(()=>import("./handler38.js").then(e=>({default:e.hookRunExecute})),"loader"),name:"run",options:[me,{defaultValue:!1,description:"Run against every tracked file",name:"all-files",type:Boolean},{defaultValue:void 0,description:"Include files changed since this ref",name:"from-ref",type:String},{defaultValue:void 0,description:"Include files changed up to this ref",name:"to-ref",type:String},{defaultValue:!1,description:"Shortcut for --from-ref HEAD~1 --to-ref HEAD",name:"last-commit",type:Boolean}]},ar={argument:{description:"Target to add (currently: `secrets`)",name:"target",type:String},commandPath:["hook"],description:"Add a managed hook snippet (e.g. `vis secrets --staged`)",env:[...ge],examples:[["vis hook add secrets","Add a pre-commit hook that runs `vis secrets --staged`"]],group:"Scaffold & Config",loader:fe(()=>import("./handler38.js").then(e=>({default:e.hookAddExecute})),"loader"),name:"add",options:[me]},rr=[Xa,Za,er,tr,nr,or,ar];var ir=Object.defineProperty,sr=f((e,t)=>ir(e,"name",{value:t,configurable:!0}),"e$o");const lr={argument:{description:"Project name to check (required)",name:"project",type:String},description:'Exit with inverted codes for CI "Ignored Build Step" gating (Vercel/Netlify)',examples:[["vis ignore my-app","Check if my-app is affected and decide whether to build"],["vis ignore my-app --base $VERCEL_GIT_PREVIOUS_SHA","Explicit base ref"],["vis ignore my-app --json","Emit the decision as JSON instead of text"],["vis ignore my-app --verbose","Print debug info about the decision path"],["vis ignore my-app --exit-zero-on-build","Normal exit semantics (0=build, 0=skip)"]],group:"Run & Execute",loader:sr(()=>import("./handler31.js"),"loader"),name:"ignore",options:[{description:"Git base ref for comparison. Defaults to CI provider env vars, then HEAD~1.",name:"base",type:String},{defaultValue:"HEAD",description:"Git head ref for comparison",name:"head",type:String},{defaultValue:"deep",description:'Downstream scope: "none", "direct", or "deep"',name:"downstream",type:String},{defaultValue:"none",description:'Upstream scope: "none", "direct", or "deep"',name:"upstream",type:String},{defaultValue:!1,description:"Emit the decision as JSON on stdout instead of human text",name:"json",type:Boolean},{defaultValue:!1,description:"Exit 0 on build (normal semantics) instead of 1 (inverted Vercel/Netlify semantics)",name:"exit-zero-on-build",type:Boolean},{defaultValue:!1,description:"Enable verbose debug output",name:"verbose",type:Boolean}]};var cr=Object.defineProperty,dr=f((e,t)=>cr(e,"name",{value:t,configurable:!0}),"e$n");const pr={description:"Remove vis from the system (self-uninstall)",examples:[["vis implode","Interactive uninstall"],["vis implode --yes","Non-interactive uninstall (CI)"]],group:"System",loader:dr(()=>import("./handler14.js"),"loader"),name:"implode",options:[{alias:"y",defaultValue:!1,description:"Skip confirmation prompt",name:"yes",type:Boolean}]};var ur=Object.defineProperty,fr=f((e,t)=>ur(e,"name",{value:t,configurable:!0}),"e$m");const mr={alias:"view",argument:{description:"Package name followed by optional metadata fields (e.g. 'react version dependencies')",name:"args",type:String},description:"Show npm registry metadata for a package (alias of `npm view` / `pnpm view` / `yarn info` / `bun pm view`)",examples:[["vis info react","Full registry metadata for react"],["vis info react version","Latest version only"],["vis info react versions","All published versions"],["vis info react@18 dependencies","Dependencies of react@18"],["vis info react --json","Emit JSON"],["vis view react","Alias matching npm/pnpm"]],group:"Dependencies",loader:fr(()=>import("./handler15.js"),"loader"),name:"info",options:[{defaultValue:!1,description:"Output as JSON",name:"json",type:Boolean}]};var gr=Object.defineProperty,hr=f((e,t)=>gr(e,"name",{value:t,configurable:!0}),"e$l");const yr={description:"Initialize vis.config.ts with best-practice security defaults",examples:[["vis init","Interactive setup wizard"],["vis init --no-interactive","Create minimal config without prompts"],["vis init --force","Overwrite existing config"],["vis init --sync-native","Also sync to native PM config files"]],group:"Scaffold & Config",loader:hr(()=>import("./handler16.js"),"loader"),name:"init",options:[{defaultValue:!1,description:"Overwrite existing config file",name:"force",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts",name:"no-interactive",type:Boolean},{defaultValue:!1,description:"Sync settings to native PM config files",name:"sync-native",type:Boolean}]};var vr=Object.defineProperty,kr=f((e,t)=>vr(e,"name",{value:t,configurable:!0}),"e$k");const br={alias:"i",description:"Install dependencies using the detected package manager",examples:[["vis install","Install all dependencies (frozen-lockfile by default when a lockfile is present)"],["vis i --no-frozen-lockfile","Allow lockfile updates (escape hatch for the default)"],["vis install --ci","Clean install: wipe node_modules + frozen lockfile (mirrors npm ci / pnpm ci)"],["vis install --prefer-offline","Use cached packages when available, fall back to network"],["vis install --prod","Install production dependencies only"],["vis install --filter app","Install for specific workspace package"],["vis install --run-scripts","Run lifecycle scripts (opts out of vis's default block-by-default policy; allowlisted packages run via security.allowBuilds)"],["vis install --no-typosquat-check","Skip typosquat name check"],["vis install --installer aube","Force aube as the installer (errors if not on PATH)"],["vis install --no-aube","Bypass aube; use the lockfile-detected PM"]],group:"Dependencies",loader:kr(()=>import("./handler17.js"),"loader"),name:"install",options:[{alias:"P",defaultValue:!1,description:"Skip devDependencies",name:"prod",type:Boolean},{alias:"D",defaultValue:!1,description:"Install devDependencies only",name:"dev",type:Boolean},{defaultValue:!1,description:"Use frozen lockfile (CI mode, maps to npm ci)",name:"frozen-lockfile",type:Boolean},{defaultValue:!1,description:"Opt out of vis's default frozen-lockfile behavior and allow lockfile updates",name:"no-frozen-lockfile",type:Boolean},{defaultValue:!1,description:"Clean install: wipe node_modules then install with frozen lockfile",name:"ci",type:Boolean},{alias:"f",defaultValue:!1,description:"Force reinstall all dependencies",name:"force",type:Boolean},{defaultValue:!1,description:"Run lifecycle scripts (opts out of vis's default block-by-default policy; allowlisted packages run via security.allowBuilds)",name:"run-scripts",type:Boolean},{defaultValue:!1,description:"Update lockfile without installing",name:"lockfile-only",type:Boolean},{defaultValue:!1,description:"Skip optional dependencies",name:"no-optional",type:Boolean},{defaultValue:!1,description:"Use only cached packages",name:"offline",type:Boolean},{defaultValue:!1,description:"Prefer cached packages, fall back to network when missing",name:"prefer-offline",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output",name:"silent",type:Boolean},{alias:"r",defaultValue:!1,description:"Install in all workspace packages",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Target workspace root",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String},{defaultValue:!1,description:"Skip typosquat name check",name:"no-typosquat-check",type:Boolean},{description:"Pick the installer explicitly. One of: auto, aube, pnpm, npm, yarn, bun. Overrides VIS_INSTALLER and install.backend in vis.config.",name:"installer",type:String},{defaultValue:!1,description:"Skip aube and use the lockfile-detected PM. Wins over --installer / VIS_INSTALLER / install.backend.",name:"no-aube",type:Boolean}]};var wr=Object.defineProperty,$r=f((e,t)=>wr(e,"name",{value:t,configurable:!0}),"e$j");const Sr={alias:"ln",argument:{description:"Package name or directory path to link (omit to register current package)",name:"target",type:String},description:"Link a local package for development",examples:[["vis link ./packages/utils","Link local directory package (works on all PMs)"],["vis link","Register current package globally (pnpm <=10, yarn, npm, bun)"],["vis link react","Link global package into current project (pnpm <=10, yarn, npm, bun)"]],group:"Dependencies",loader:$r(()=>import("./handler18.js"),"loader"),name:"link"};var xr=Object.defineProperty,jr=f((e,t)=>xr(e,"name",{value:t,configurable:!0}),"e$i");const Cr={description:"List all workspace projects with metadata",examples:[["vis list","Show all projects"],["vis list --json","Machine-readable output"],['vis list --query "tag=frontend"',"Filter by query"]],group:"Workspace",loader:jr(()=>import("./handler19.js"),"loader"),name:"list",options:[{defaultValue:!1,description:"Emit JSON instead of a table",name:"json",type:Boolean},{description:"Filter projects by query",name:"query",type:String}]};var Or=Object.defineProperty,Y=f((e,t)=>Or(e,"name",{value:t,configurable:!0}),"t$c");const ee=[{defaultValue:!1,description:"Preview changes without applying",name:"dry-run",type:Boolean},{alias:"y",defaultValue:!1,description:"Skip the confirmation prompt",name:"yes",type:Boolean}],Pr={commandPath:["migrate"],description:"Migrate dependencies and scripts to vis",group:"Scaffold & Config",loader:Y(()=>import("./handler34.js").then(e=>({default:e.migrateDepsExecute})),"loader"),name:"deps",options:[...ee]},Rr={commandPath:["migrate"],description:"Inline lint-staged configuration into vis",group:"Scaffold & Config",loader:Y(()=>import("./handler34.js").then(e=>({default:e.migrateLintStagedExecute})),"loader"),name:"lint-staged",options:[...ee]},Ir={commandPath:["migrate"],description:"Inline nano-staged configuration into vis",group:"Scaffold & Config",loader:Y(()=>import("./handler34.js").then(e=>({default:e.migrateNanoStagedExecute})),"loader"),name:"nano-staged",options:[...ee]},Br={commandPath:["migrate"],description:"Migrate turborepo tasks/config to vis",group:"Scaffold & Config",loader:Y(()=>import("./handler34.js").then(e=>({default:e.migrateTurborepoExecute})),"loader"),name:"turborepo",options:[...ee]},Vr={commandPath:["migrate"],description:"Migrate nx targets/config to vis",group:"Scaffold & Config",loader:Y(()=>import("./handler34.js").then(e=>({default:e.migrateNxExecute})),"loader"),name:"nx",options:[...ee]},Ar={commandPath:["migrate"],description:"Migrate moon tasks/templates to vis",group:"Scaffold & Config",loader:Y(()=>import("./handler34.js").then(e=>({default:e.migrateMoonExecute})),"loader"),name:"moon",options:[...ee,{defaultValue:!1,description:"Copy .moon/templates/* into .vis/templates/* so `vis generate` works without .moon/",name:"copy-templates",type:Boolean}]},Er={commandPath:["migrate"],description:"Migrate gitleaks config/baseline/hooks to `vis secrets`",examples:[["vis migrate gitleaks","Migrate gitleaks config/baseline/hooks to `vis secrets`"]],group:"Scaffold & Config",loader:Y(()=>import("./handler34.js").then(e=>({default:e.migrateGitleaksExecute})),"loader"),name:"gitleaks",options:[...ee]},Tr={commandPath:["migrate"],description:"Migrate Kingfisher baseline/hooks/scripts to `vis secrets`",examples:[["vis migrate kingfisher","Migrate Kingfisher baseline/hooks/scripts to `vis secrets`"]],group:"Scaffold & Config",loader:Y(()=>import("./handler34.js").then(e=>({default:e.migrateKingfisherExecute})),"loader"),name:"kingfisher",options:[...ee]},Dr={commandPath:["migrate"],description:"Replace secretlint with `vis secrets`",examples:[["vis migrate secretlint","Replace secretlint with `vis secrets`"]],group:"Scaffold & Config",loader:Y(()=>import("./handler34.js").then(e=>({default:e.migrateSecretlintExecute})),"loader"),name:"secretlint",options:[...ee]},Mr={commandPath:["migrate"],description:"Audit the workspace for stray gitleaks/secretlint references (exit 1 on issues)",examples:[["vis migrate verify","Audit the workspace for stray gitleaks/secretlint references (exit 1 on issues)"]],group:"Scaffold & Config",loader:Y(()=>import("./handler34.js").then(e=>({default:e.migrateVerifyExecute})),"loader"),name:"verify",options:[]},Nr=[Pr,Rr,Ir,Br,Vr,Ar,Er,Tr,Dr,Mr];var Wr=Object.defineProperty,Fr=f((e,t)=>Wr(e,"name",{value:t,configurable:!0}),"r$b");const Lr=new Set(["--cwd"]),_r=new Set(["--help","--version","-h","-V"]),zr=Fr(e=>{const t=[];for(let n=0;n<e.length;n+=1){const o=e[n];if(o!==void 0){if(_r.has(o))return!1;if(o.startsWith("-")){const a=o.indexOf("="),r=a===-1?o:o.slice(0,a);if(Lr.has(r)&&a===-1){const i=e[n+1];i!==void 0&&!i.startsWith("-")&&(n+=1)}continue}t.push(o)}}return t.length===1&&t[0]==="migrate"},"isBareMigrateInvocation");var Ur=Object.defineProperty,Jr=f((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"t$b");const Ct=Jr(e=>e in Qe&&Qe[e]!=="0"&&Qe[e]!=="false","check"),ue=Ct("CI")||Ct("CONTINUOUS_INTEGRATION");var Gr=Object.defineProperty,Ze=f((e,t)=>Gr(e,"name",{value:t,configurable:!0}),"i$b");class Hr{static{f(this,"MigrateStore")}static{Ze(this,"MigrateStore")}#e;#n=new Set;constructor(t){this.#e={applyProgress:null,checkedItems:new Set(t.map(n=>n.entry.id)),error:null,focusedPanel:"list",items:t,phase:"browsing",selectedIndex:0}}getSnapshot=Ze(()=>this.#e,"getSnapshot");subscribe=Ze(t=>(this.#n.add(t),()=>{this.#n.delete(t)}),"subscribe");getCheckedItems(){return this.#e.items.filter(t=>this.#e.checkedItems.has(t.entry.id))}getSelectedItem(){return this.#e.items[this.#e.selectedIndex]??null}setSelectedIndex(t){const n=Math.max(0,Math.min(t,this.#e.items.length-1));n!==this.#e.selectedIndex&&this.#t({...this.#e,selectedIndex:n})}setFocusedPanel(t){t!==this.#e.focusedPanel&&this.#t({...this.#e,focusedPanel:t})}toggleCheck(t){const n=new Set(this.#e.checkedItems);n.has(t)?n.delete(t):n.add(t),this.#t({...this.#e,checkedItems:n})}checkAll(){this.#t({...this.#e,checkedItems:new Set(this.#e.items.map(t=>t.entry.id))})}uncheckAll(){this.#t({...this.#e,checkedItems:new Set})}toggleAll(){this.#e.checkedItems.size===this.#e.items.length?this.uncheckAll():this.checkAll()}startApply(){const t=this.getCheckedItems().length;this.#t({...this.#e,applyProgress:{current:0,total:t},phase:"applying"})}updateApplyProgress(t){this.#e.applyProgress&&this.#t({...this.#e,applyProgress:{...this.#e.applyProgress,current:t}})}markDone(){this.#t({...this.#e,phase:"done"})}setError(t){this.#t({...this.#e,error:t,phase:"error"})}#t(t){this.#e=t;for(const n of this.#n)try{n()}catch{}}}var qr=Object.defineProperty,Kr=f((e,t)=>qr(e,"name",{value:t,configurable:!0}),"f$7");const Ot=Kr(({autoExitSeconds:e,onCancel:t,visible:n})=>{const{exit:o}=Zt(),[a,r]=Pe(e||3),i=Ie(null),s=Ie(0);tt(()=>(n&&(r(e||3),s.current=Date.now(),i.current=setInterval(()=>{r(c=>Math.max(0,c-1))},1e3)),()=>{i.current&&(clearInterval(i.current),i.current=null)}),[n,e]),tt(()=>{a<=0&&n&&(i.current&&(clearInterval(i.current),i.current=null),o())},[a,n,o]);const l=tn(()=>{i.current&&(clearInterval(i.current),i.current=null),t()},[t]);return en((c,p)=>{Date.now()-s.current<200||(c==="q"?o():l())},{isActive:n}),m(et,{backgroundColor:"#1e1e1e",footer:b(g,{dimColor:!0,children:["Press"," ",m(g,{bold:!0,color:"white",children:"q"})," ","to exit,"," ",m(g,{bold:!0,color:"white",children:"any key"})," ","to stay"]}),title:`Exiting in ${a}…`,visible:n,width:50,children:m(g,{dimColor:!0,children:"Stay to explore the results interactively."})})},"QuitDialog");var Yr=Object.defineProperty,dn=f((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"n$b");const Qr=dn(e=>{if(e.startsWith("⚠"))return"yellow";e.startsWith("── ")||e.startsWith("[dry-run]")},"colorForPreviewLine"),Xr=dn(({focused:e,item:t,scrollRef:n})=>t?b(S,{borderColor:e?"white":"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,children:[m(S,{flexShrink:0,paddingTop:1,paddingX:2,children:m(g,{bold:!0,color:"white",children:t.entry.title})}),m(S,{flexShrink:0,paddingBottom:1,paddingX:2,children:m(g,{dimColor:!0,children:t.entry.description})}),m(no,{flexGrow:1,flexShrink:1,paddingX:2,ref:n,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:b(S,{flexDirection:"column",children:[m(g,{dimColor:!0,children:"── What will change ──"}),m(g,{}),t.preview.length===0&&m(g,{dimColor:!0,children:"(no preview available)"}),t.preview.map((a,r)=>{const i=Qr(a);return a===""?m(g,{},`blank-${String(r)}`):m(g,{color:i,children:a},`${String(r)}-${a.slice(0,20)}`)})]})})]}):m(S,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:m(g,{dimColor:!0,children:"No migration selected"})}),"MigrateDetailPanel");var Zr=Object.defineProperty,pn=f((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"g$9");const ei=pn(({checked:e,isSelected:t,item:n})=>{const o=e?"☑":"☐",a=n.preview.length;return b(S,{flexShrink:0,height:1,children:[m(g,{children:t?">":" "}),b(g,{color:e?"white":"gray",children:[" ",o," "]}),m(S,{flexGrow:1,children:m(g,{bold:t,inverse:t,wrap:"truncate",children:n.entry.title})}),b(g,{dimColor:!0,children:[" ",a," ","change",a===1?"":"s"," "]})]})},"MigrationRow"),ti=pn(({checkedItems:e,focused:t,isDryRun:n,items:o,scrollOffset:a,selectedIndex:r,viewportHeight:i})=>{const s=t?"white":"gray",l=o.filter(v=>e.has(v.entry.id)).length,c=o.map((v,$)=>m(ei,{checked:e.has(v.entry.id),isSelected:$===r,item:v},v.entry.id)),p=o.length,h=p>i&&i>0;return b(S,{borderColor:s,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[b(S,{flexShrink:0,gap:1,paddingX:1,children:[m(g,{bold:!0,inverse:!0,children:" MIGRATE "}),b(g,{wrap:"truncate",children:[o.length," ","applicable"]}),l>0&&b(g,{dimColor:!0,children:[" — ",l," selected"]}),n&&m(g,{color:"yellow",children:" (dry-run)"})]}),b(S,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[m(S,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:m(S,{flexDirection:"column",marginTop:-a,children:c})}),h&&m(S,{flexShrink:0,marginLeft:1,marginRight:1,children:m(oo,{contentHeight:p,placement:"inset",scrollOffset:a,style:"block",viewportHeight:i})})]})]})},"MigrateListPanel");var ni=Object.defineProperty,oi=f((e,t)=>ni(e,"name",{value:t,configurable:!0}),"N$6");const ai=100,ri=40,ii=10,si=oi(({autoExitSeconds:e=0,isDryRun:t,store:n})=>{const{exit:o}=Zt(),{columns:a,rows:r}=ao(),i=so(n.subscribe,n.getSnapshot),[s,l]=Pe(!1),[c,p]=Pe(!1),[h,v]=Pe(!1),[$,P]=Pe(0),R=Ie(null),G=Ie(null),xe=Ie(null),le=i.items[i.selectedIndex]??null,ce=Math.max(1,r-6),de=tn(C=>{P(O=>C>=O+ce?Math.max(0,C-ce+1):C<O?Math.max(0,C):O)},[ce]);if(tt(()=>{G.current?.scrollToTop()},[le?.entry.id]),en((C,O)=>{if(C==="c"&&O.ctrl){o();return}if(!h){if(c){C==="u"||O.return?(p(!1),n.startApply(),o(n.getCheckedItems())):O.escape||C==="q"?p(!1):O.downArrow||C==="j"?xe.current?.scrollBy(1):(O.upArrow||C==="k")&&xe.current?.scrollBy(-1);return}if(s){O.escape||C==="?"?l(!1):C==="q"?(l(!1),v(!0)):O.downArrow||C==="j"?R.current?.scrollBy(1):(O.upArrow||C==="k")&&R.current?.scrollBy(-1);return}if(C==="?"){l(!0);return}if(C==="q"){v(!0);return}if(O.tab){n.setFocusedPanel(i.focusedPanel==="list"?"detail":"list");return}if(i.focusedPanel==="list"){if(O.downArrow||C==="j"){const W=Math.min(i.selectedIndex+1,i.items.length-1);n.setSelectedIndex(W),de(W);return}if(O.upArrow||C==="k"){const W=Math.max(i.selectedIndex-1,0);n.setSelectedIndex(W),de(W);return}if(O.pageDown){const W=Math.min(i.selectedIndex+10,i.items.length-1);n.setSelectedIndex(W),de(W);return}if(O.pageUp){const W=Math.max(i.selectedIndex-10,0);n.setSelectedIndex(W),de(W);return}if(O.home){n.setSelectedIndex(0),P(0);return}if(O.end){const W=i.items.length-1;n.setSelectedIndex(W),de(W);return}if(C===" "||O.return){le&&n.toggleCheck(le.entry.id);return}if(C==="a"){n.toggleAll();return}if(C==="u"&&!t&&i.checkedItems.size>0){p(!0);return}O.rightArrow&&n.setFocusedPanel("detail");return}if(i.focusedPanel==="detail"){if(O.escape||O.leftArrow){n.setFocusedPanel("list");return}if(O.downArrow||C==="j"){G.current?.scrollBy(1);return}if(O.upArrow||C==="k"){G.current?.scrollBy(-1);return}if(O.pageDown){G.current?.scrollBy(10);return}if(O.pageUp){G.current?.scrollBy(-10);return}if(O.home){G.current?.scrollToTop();return}O.end&&G.current?.scrollToBottom()}}},{isActive:!0}),a<ri||r<ii)return m(S,{alignItems:"center",height:r,justifyContent:"center",width:a,children:b(g,{color:"yellow",children:["Terminal too small (",a,"x",r,")"]})});const je=a>=ai,ye=[b(S,{gap:1,children:[m(g,{bold:!0,color:"white",children:"q"}),m(g,{dimColor:!0,children:"QUIT"})]},"q"),b(S,{gap:1,children:[m(g,{bold:!0,color:"white",children:"?"}),m(g,{dimColor:!0,children:"HELP"})]},"?"),b(S,{gap:1,children:[m(g,{bold:!0,color:"white",children:"↑↓"}),m(g,{dimColor:!0,children:"NAV"})]},"nav"),b(S,{gap:1,children:[m(g,{bold:!0,color:"white",children:"Space"}),m(g,{dimColor:!0,children:"CHECK"})]},"sp"),b(S,{gap:1,children:[m(g,{bold:!0,color:"white",children:"a"}),m(g,{dimColor:!0,children:"ALL"})]},"a")];!t&&i.checkedItems.size>0&&ye.push(b(S,{gap:1,children:[m(g,{bold:!0,color:"green",children:"u"}),m(g,{dimColor:!0,children:"APPLY"})]},"u")),ye.push(b(S,{gap:1,children:[m(g,{bold:!0,color:"white",children:"Tab"}),m(g,{dimColor:!0,children:"PANEL"})]},"tab"));const Ke=m(S,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:m(S,{flexWrap:"wrap",gap:2,paddingX:1,children:ye})}),Ye=b(et,{footer:b(g,{dimColor:!0,children:[m(g,{bold:!0,color:"white",children:"↑↓"})," scroll ",m(g,{bold:!0,color:"white",children:"?"}),"/",m(g,{bold:!0,color:"white",children:"Esc"})," close"]}),scrollRef:R,title:"KEYBOARD SHORTCUTS",visible:s,width:52,children:[b(S,{flexDirection:"column",marginBottom:1,children:[m(g,{bold:!0,color:"white",children:"NAVIGATION"}),b(g,{children:[m(g,{bold:!0,color:"white",children:" ↑/k"}),m(g,{dimColor:!0,children:" Move up"})]}),b(g,{children:[m(g,{bold:!0,color:"white",children:" ↓/j"}),m(g,{dimColor:!0,children:" Move down"})]}),b(g,{children:[m(g,{bold:!0,color:"white",children:" Tab"}),m(g,{dimColor:!0,children:" Switch panel"})]}),b(g,{children:[m(g,{bold:!0,color:"white",children:" →/←"}),m(g,{dimColor:!0,children:" Focus detail/list"})]})]}),b(S,{flexDirection:"column",marginBottom:1,children:[m(g,{bold:!0,color:"white",children:"SELECTION"}),b(g,{children:[m(g,{bold:!0,color:"white",children:" Space"}),m(g,{dimColor:!0,children:" Toggle migration"})]}),b(g,{children:[m(g,{bold:!0,color:"white",children:" a"}),m(g,{dimColor:!0,children:" Toggle all"})]})]}),b(S,{flexDirection:"column",children:[m(g,{bold:!0,color:"white",children:"ACTIONS"}),!t&&b(g,{children:[m(g,{bold:!0,color:"white",children:" u"}),m(g,{dimColor:!0,children:" Apply selected migrations"})]}),b(g,{children:[m(g,{bold:!0,color:"white",children:" q"}),m(g,{dimColor:!0,children:" Quit"})]}),b(g,{children:[m(g,{bold:!0,color:"white",children:" ?"}),m(g,{dimColor:!0,children:" Toggle help"})]})]})]}),Ce=n.getCheckedItems(),Te=m(S,{alignItems:"center",flexDirection:"column",children:b(g,{dimColor:!0,children:["Press ",m(g,{bold:!0,color:"white",children:"u"})," or ",m(g,{bold:!0,color:"white",children:"Enter"})," to confirm, ",m(g,{bold:!0,color:"white",children:"Esc"})," to cancel"]})}),$t=m(et,{footer:Te,scrollRef:xe,title:`Apply ${String(Ce.length)} migration${Ce.length===1?"":"s"}?`,visible:c,width:70,children:Ce.map(C=>b(S,{gap:1,children:[b(g,{children:[" ",C.entry.title]}),b(g,{dimColor:!0,children:["(",C.preview.length," ","change",C.preview.length===1?"":"s",")"]})]},C.entry.id))}),St=m(ti,{checkedItems:i.checkedItems,focused:i.focusedPanel==="list",isDryRun:t,items:i.items,scrollOffset:$,selectedIndex:i.selectedIndex,viewportHeight:ce}),xt=m(Xr,{focused:i.focusedPanel==="detail",item:le,scrollRef:G});if(je){const C=Math.floor(a*.55);return b(S,{flexDirection:"column",height:r,width:a,children:[b(S,{flexDirection:"row",flexGrow:1,children:[m(S,{flexGrow:1,children:St}),m(S,{width:C,children:xt})]}),Ke,$t,m(Ot,{autoExitSeconds:e||3,onCancel:f(()=>{v(!1)},"onCancel"),visible:h}),Ye]})}const Jn=Math.floor(r*.45);return b(S,{flexDirection:"column",height:r,width:a,children:[m(S,{height:Jn,children:St}),m(S,{flexGrow:1,children:xt}),Ke,$t,m(Ot,{autoExitSeconds:e||3,onCancel:f(()=>{v(!1)},"onCancel"),visible:h}),Ye]})},"VisMigrateApp");var li=Object.defineProperty,ci=f((e,t)=>li(e,"name",{value:t,configurable:!0}),"t$a");const un=[".lintstagedrc.json",".lintstagedrc"],fn=[".lintstagedrc.yaml",".lintstagedrc.yml",".lintstagedrc.mjs","lint-staged.config.mjs",".lintstagedrc.cjs","lint-staged.config.cjs",".lintstagedrc.js","lint-staged.config.js",".lintstagedrc.ts","lint-staged.config.ts",".lintstagedrc.mts","lint-staged.config.mts",".lintstagedrc.cts","lint-staged.config.cts"],pt=[...un,...fn],di=[/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)(pnpm|pnpm exec|npx|yarn|yarn run|npm exec|npm run|bunx|bun run|bun x)\s+lint-staged\b/,/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)lint-staged\b/],mn=[".nano-staged.json",".nanostagedrc"],gn=[".nano-staged.mjs",".nano-staged.cjs",".nano-staged.js","nano-staged.config.mjs","nano-staged.config.cjs","nano-staged.config.js","nano-staged.config.mts","nano-staged.config.cts","nano-staged.config.ts"],ut=[...mn,...gn],pi=[/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)(pnpm|pnpm exec|npx|yarn|yarn run|npm exec|npm run|bunx|bun run|bun x)\s+nano-staged\b/,/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)nano-staged\b/],hn=["husky","lint-staged","nano-staged"],ui=/\(is-ci \|\| husky \|\| exit 0\)\s*&&\s*/g,fi=/\bhusky(?:\s+install)?\s*&&\s*/g,mi=/\s*&&\s*husky(?:\s+install)?/g,gi=/\s*\|\|\s*husky(?:\s+install)?/g,hi=[ui,fi,mi,gi],yn=ci(e=>{if(e==="husky"||e==="husky install")return;let t=e;for(const n of hi)t=t.replace(n,"");return t=t.trim(),t===e?e:t||void 0},"cleanHuskyFromScript");var yi=Object.defineProperty,We=f((e,t)=>yi(e,"name",{value:t,configurable:!0}),"o$b");const vi=/\/$/,ki=We(e=>{let t='"$0"';for(let n=0;n<e;n+=1)t=`"$(dirname ${t})"`;return t},"nestedDirname"),bi=We(e=>{const t=e.split("/").filter(n=>n!==""&&n!==".").length+2;return`#!/usr/bin/env sh
1
+ var Ru=Object.defineProperty;var d=(e,t)=>Ru(e,"name",{value:t,configurable:!0});import{createRequire as Cu}from"node:module";import{lazyNamed as de,createCerebro as Nu}from"@visulima/cerebro";import Iu from"@visulima/cerebro/command/completion";import Pu from"@visulima/cerebro/compile-cache";import{applyHeapTuning as Au}from"@visulima/cerebro/heap-tuning";import{errorHandlerPlugin as Tu}from"@visulima/cerebro/plugins/error-handler";import{isAccessibleSync as k,readFileSync as P,ensureDirSync as rt,readJsonSync as le,walkSync as yn,writeFileSync as oe,writeJsonSync as vn,removeSync as Du}from"@visulima/fs";import{findMonorepoRootSync as Dc}from"@visulima/package";import{join as y,resolve as jr,dirname as Ar,relative as Lc,parse as So}from"@visulima/path";import{useApp as Bc,useInput as Mc,Dialog as Hs,Text as C,Box as K,ScrollView as Lu,ScrollBar as Bu,useWindowSize as Mu,renderToString as Vc,Table as Vu,render as _u}from"@visulima/tui";import qt,{useState as gr,useRef as kr,useEffect as _c,useCallback as Fc,useSyncExternalStore as Fu}from"react";import{jsx as R,jsxs as G}from"react/jsx-runtime";import{resolveEditorconfigDefaults as Ku,resolveInstall as zu,resolveAdd as Hu,whichBin as Yu,execPmCommandInteractive as Xu,resolveDedupe as Qu,resolveDlx as Zu,resolveExec as ed,resolveLink as td,resolvePmCommand as rd,resolveRemove as nd,resolveUnlink as sd,resolveWhy as od,detectPackageManager as id,resolveOutdated as ad}from"#native";import{looksLikeInputUri as cd,parseInputUri as ld}from"@visulima/task-runner";import{m as cn}from"../packem_shared/otel-DxDUPJJH.js";import{findVisConfigFile as Nt,loadVisConfig as Xi}from"./applyDefaults.js";import{readYamlSync as Dr,writeYamlSync as ud}from"@visulima/fs/yaml";import{findCacheDirSync as Uc}from"@visulima/find-cache-dir";import{hyperlink as dd}from"@visulima/ansi";import{dim as Wt,red as Xn,bold as Ze,yellow as hr,cyan as gt,magenta as fd,green as md}from"@visulima/colorize";import{createPail as gd}from"@visulima/pail";const xu=Cu(import.meta.url),_t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,hn=d(e=>{if(typeof _t<"u"&&_t.versions&&_t.versions.node){const[t,r]=_t.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return _t.getBuiltinModule(e)}return xu(e)},"__cjs_getBuiltinModule"),{env:Yn}=_t,{spawnSync:St,execSync:qu}=hn("node:child_process"),{writeFileSync:ue,statSync:Kt,readdirSync:Ge,rmSync:jo,existsSync:Uu,copyFileSync:Wu,unlinkSync:Tr,mkdirSync:Gu,cpSync:Ju}=hn("node:fs"),{platform:pd,homedir:Zt}=hn("node:os"),{createInterface:qc}=hn("node:readline");var hd="1.0.0-alpha.11";const ln={version:hd};var yd=Object.defineProperty,vd=d((e,t)=>yd(e,"name",{value:t,configurable:!0}),"e$Z");const bd={argument:{description:"Target selector (same syntax as `vis run`): `build`, `:build`, `~:test`, `#tag:lint`, …",name:"selector",type:String},description:"Show the execution plan for a target without running it",examples:[["vis action-graph build","Print the task plan for `build` on every project"],["vis action-graph :test","Moon-style selector"],["vis action-graph build --json","Emit a JSON description of the plan"],['vis action-graph lint --query "tag=frontend"',"Filter projects by query"]],group:"Workspace",loader:vd(()=>import("./handler.js"),"loader"),name:"action-graph",options:[{defaultValue:!1,description:"Emit JSON instead of ASCII",name:"json",type:Boolean},{description:"Filter matched projects by a query",name:"query",type:String}]};var kd=Object.defineProperty,$d=d((e,t)=>kd(e,"name",{value:t,configurable:!0}),"e$Y");const wd={argument:{description:"Packages to add (e.g., react react-dom)",name:"packages",type:String},description:"Add packages using the detected package manager",examples:[["vis add react react-dom","Add packages"],["vis add -D typescript @types/react","Add as dev dependencies"],["vis add react --filter app","Add to specific workspace package"],["vis add react --to web","Add to one package, auto-conforming the version to existing catalogs / sibling deps"],["vis add -g typescript","Add globally (uses npm)"],["vis add lodash -w","Add to workspace root"],["vis add lodash --no-socket-check","Add without Socket.dev check"],["vis add lodash --no-typosquat-check","Skip typosquat name check"],["vis add lodash --run-scripts","Run lifecycle scripts (opts out of vis's default block-by-default policy)"]],group:"Dependencies",loader:$d(()=>import("./handler27.js"),"loader"),name:"add",options:[{alias:"D",defaultValue:!1,description:"Add as dev dependency",name:"save-dev",type:Boolean},{alias:"E",defaultValue:!1,description:"Save exact version",name:"exact",type:Boolean},{alias:"P",defaultValue:!1,description:"Add as peer dependency",name:"save-peer",type:Boolean},{alias:"O",defaultValue:!1,description:"Add as optional dependency",name:"save-optional",type:Boolean},{alias:"g",defaultValue:!1,description:"Install globally (uses npm)",name:"global",type:Boolean},{alias:"w",defaultValue:!1,description:"Add to workspace root",name:"workspace-root",type:Boolean},{defaultValue:!1,description:"Use workspace protocol (pnpm)",name:"workspace",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String},{description:"Target a single workspace package and auto-conform the version to existing catalogs / sibling deps (syncpack#285)",name:"to",type:String},{defaultValue:!1,description:"Skip typosquat name check before adding",name:"no-typosquat-check",type:Boolean},{defaultValue:!1,description:"Skip Socket.dev security check before adding",name:"no-socket-check",type:Boolean},{defaultValue:!1,description:"Run lifecycle scripts during add (opts out of vis's default block-by-default policy; allowlisted packages run via security.allowBuilds)",name:"run-scripts",type:Boolean},{defaultValue:!1,description:"After adding, recursively install non-optional peer dependencies that aren't already in the workspace (matches nypm's installPeerDependencies)",name:"auto-install-peers",type:Boolean}]};var Sd=Object.defineProperty,jd=d((e,t)=>Sd(e,"name",{value:t,configurable:!0}),"e$X");const Od={argument:{description:"The target to run (e.g., build, test, lint)",name:"target",type:String},description:"Run a target only on projects affected by recent changes",examples:[["vis affected build","Run build on affected projects"],["vis affected test --base=main","Run tests on projects changed since main"],["vis affected destroy --reverse","Tear down affected projects leaves-first"]],group:"Run & Execute",loader:jd(()=>import("./handler2.js"),"loader"),name:"affected",options:[{defaultValue:"HEAD~1",description:"Git base ref for comparison",name:"base",type:String},{defaultValue:"HEAD",description:"Git head ref for comparison",name:"head",type:String},{defaultValue:"deep",description:'Downstream scope: "none", "direct", or "deep" — controls how far to include dependents of changed projects',name:"downstream",type:String},{defaultValue:"none",description:'Upstream scope: "none", "direct", or "deep" — controls how far to include dependencies of changed projects',name:"upstream",type:String},{defaultValue:3,description:"Maximum number of parallel tasks",name:"parallel",type:Number},{defaultValue:!0,description:"Enable caching (use --no-cache to disable)",name:"cache",type:Boolean},{defaultValue:!1,description:"Show what would run without executing",name:"dry-run",type:Boolean},{description:'Partition tasks for distributed CI (e.g., "1/4" for first of four runners). Falls back to VIS_PARTITION env var.',name:"partition",type:String},{description:"Filter affected projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String},{defaultValue:!1,description:"Run the dependency graph in reverse (leaves first, then their dependents). Useful for teardown targets like `destroy`/`undeploy` where dependents must run before the things they depend on.",name:"reverse",type:Boolean},{description:"Comma-separated tags this runner advertises (e.g. 'gpu,slow'). Forwarded verbatim to the downstream `vis run` so capability-gated tasks resolve identically. Falls back to VIS_RUNNER_TAGS env var.",name:"runner-tags",type:String}]},Wc={description:"Output format: table or json (default: table)",name:"format",type:String},Ed={commandPath:["ai"],description:"List detected AI providers and show which one is selected",examples:[["vis ai providers","List all AI providers and their status"],["vis ai providers --format json","Output as JSON"]],group:"System",loader:de(()=>import("./handler28.js"),"aiProvidersExecute"),name:"providers",options:[Wc]},Rd={commandPath:["ai"],description:"Test the best available AI provider with a quick prompt",examples:[["vis ai test","Test the selected provider"]],group:"System",loader:de(()=>import("./handler28.js"),"aiTestExecute"),name:"test",options:[]},Cd={argument:{description:"Task ID to propose a fix for (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["ai"],description:"Read a failed task's logs and propose a structured patch (Phase 1: local-only, no git)",examples:[["vis ai fix @myorg/app:build","Print proposed patch for the failed task"],["vis ai fix @myorg/app:build --apply","Apply the patch to disk after confirming"],["vis ai fix @myorg/app:build --format json","Machine-readable patch output"],["vis ai fix @myorg/app:build --run 2026-04-28T...","Inspect a specific historical run"]],group:"System",loader:de(()=>import("./handler28.js"),"aiFixExecute"),name:"fix",options:[Wc,{description:"Use a specific run ID from .task-runner/runs/ instead of the latest run",name:"run",type:String},{defaultValue:!1,description:"Apply the proposed patch to disk after printing it",name:"apply",type:Boolean},{defaultValue:!1,description:"Bypass the AI response cache",name:"no-cache",type:Boolean},{defaultValue:!1,description:"Skip the confirmation prompt before applying",name:"yes",type:Boolean}]},xd={description:"AI-assisted commands: provider detection and failure-fix proposals (cache management lives under `vis cache`)",examples:[["vis ai","List all AI subcommands"],["vis ai discover-help","Machine-readable subcommand catalogue (for AI agents)"]],group:"System",loader:de(()=>import("./handler28.js"),"aiRootExecute"),name:"ai",options:[]},Nd={commandPath:["ai"],description:"Print the machine-readable AI subcommand catalogue (JSON to stdout, designed for AI agents)",examples:[["vis ai discover-help","Emit the discovery payload as JSON"],["vis ai discover-help | jq '.subcommands[].path'","List all available paths"]],group:"System",loader:de(()=>import("./handler28.js"),"aiDiscoverHelpExecute"),name:"discover-help",options:[]},Id={commandPath:["ai"],description:"Diagnose the most recent failed task and post a structured patch as a PR/MR comment (or Buildkite annotation)",examples:[["vis ai heal","Heal the most recent failure"],["vis ai heal --dry-run","Propose a patch but skip apply / validate / post"],["vis ai heal --run 2026-04-28T...","Heal a specific historical run"]],group:"System",loader:de(()=>import("./heal.js").then(e=>e.h),"aiHeal"),name:"heal",options:[{defaultValue:!1,description:"Show the proposal and exit without applying or posting it",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Bypass the AI response cache",name:"no-cache",type:Boolean},{description:"Use a specific run ID from .task-runner/runs/ instead of the latest run",name:"run",type:String},{description:"Per-task validation timeout in seconds (default: 1800)",name:"validation-timeout",type:Number}]},Pd={commandPath:["ai","heal"],description:"Re-run the proposed fix and commit it to the PR/MR branch when validation passes",examples:[["vis ai heal accept","Triggered automatically by a `/vis heal accept` PR comment (GitHub/GitLab) or a Buildkite block-step unblock"]],group:"System",loader:de(()=>import("./heal-accept.js"),"aiHealAccept"),name:"accept",options:[{description:"Use a specific run ID from .task-runner/runs/ instead of the latest run",name:"run",type:String},{description:"Per-task validation timeout in seconds (default: 1800)",name:"validation-timeout",type:Number}]},Gc=[xd,Nd,Ed,Rd,Cd,Id,Pd],bE=Object.defineProperty({__proto__:null,default:Gc},Symbol.toStringTag,{value:"Module"});var Ad=Object.defineProperty,Td=d((e,t)=>Ad(e,"name",{value:t,configurable:!0}),"e$W");const Dd={argument:{description:"Package name to analyze (e.g., react)",name:"package",required:!0,type:String},description:"Analyze a single package update with AI",examples:[["vis analyze react","Analyze updating react to latest"],["vis analyze react 19.0.0","Analyze updating react to specific version"],["vis analyze react --ai-type security","Run security-focused analysis"],["vis analyze react --format json","Output as JSON"]],group:"System",loader:Td(()=>import("./handler3.js"),"loader"),name:"analyze",options:[{description:"AI analysis type: impact, security, compatibility, or recommend (default: impact)",name:"ai-type",type:String},{defaultValue:!1,description:"Check for known security vulnerabilities",name:"security",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var Ld=Object.defineProperty,Bd=d((e,t)=>Ld(e,"name",{value:t,configurable:!0}),"e$V");const Md={description:"Review and approve dependencies with build scripts",examples:[["vis approve-builds","Scan and list unapproved build scripts"],["vis approve-builds --all","Approve all pending builds (pnpm)"],["vis approve-builds --sync-native","Sync allowBuilds to native PM config"]],group:"Security & Health",loader:Bd(()=>import("./handler4.js"),"loader"),name:"approve-builds",options:[{defaultValue:!1,description:"Approve all pending builds without prompting (pnpm only)",name:"all",type:Boolean},{defaultValue:!1,description:"Force vis scanning even for pnpm (instead of delegating)",name:"scan",type:Boolean},{defaultValue:!1,description:"Sync allowBuilds to native PM config (bun: trustedDependencies, npm: .npmrc, yarn: .yarnrc.yml)",name:"sync-native",type:Boolean}]};var Vd=Object.defineProperty,_d=d((e,t)=>Vd(e,"name",{value:t,configurable:!0}),"e$U");const Fd={description:"Audit installed packages for vulnerabilities and supply chain risks",examples:[["vis audit","Full audit of all installed packages"],["vis audit --severity high","Show only high/critical issues"],["vis audit --format json","Output as JSON for CI integration"],["vis audit --fix","Show fix suggestions for vulnerabilities"],["vis audit --exit-code","Exit with code 1 if issues found (for CI)"],["vis audit --show-accepted","Include acknowledged risks in output"],["vis audit --sync","Sync accepted risks to native PM config (pnpm-workspace.yaml / .yarnrc.yml)"]],group:"Security & Health",loader:_d(()=>import("./handler29.js"),"loader"),name:"audit",options:[{description:"Minimum severity to report: low, medium, high, critical (default: low)",name:"severity",type:String},{description:"Output format: table or json (default: table)",name:"format",type:String},{defaultValue:!1,description:"Show fix suggestions for vulnerabilities",name:"fix",type:Boolean},{defaultValue:!1,description:"Exit with code 1 if any issues found (for CI)",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Include acknowledged (accepted risk) issues in output",name:"show-accepted",type:Boolean},{defaultValue:!1,description:"Sync vis accepted risks to native PM config (pnpm-workspace.yaml / .yarnrc.yml)",name:"sync",type:Boolean}]},Lr={description:"Cache directory (overrides config and default). Relative paths are resolved against the workspace root.",name:"cache-dir",type:String},bn={description:"Cache scope: 'shared' (default — main worktree's cache), 'worktree' (this checkout's local cache), or 'all' (both)",name:"scope",type:String},Jc={description:"Cache type: 'task' (workspace task cache), 'ai' (AI response cache), 'socket' (Socket.dev report cache), or 'all' (default)",name:"type",type:String},qd={commandPath:["cache"],description:"List all cache entries",examples:[["vis cache list","List all cache entries"]],group:"Workspace",loader:de(()=>import("./handler14.js"),"cacheListExecute"),name:"list",options:[Lr,bn,{description:"Output format: table or json (default: table)",name:"format",type:String}]},Ud={commandPath:["cache"],description:"Remove cache entries (defaults to all stores: workspace task cache, AI responses, Socket.dev reports)",examples:[["vis cache clean","Remove all cache entries from every store"],["vis cache clean --type=ai","Clear only the AI response cache"],["vis cache clean --type=task","Clear only the workspace task cache"],["vis cache clean --dry-run","Preview what clean would remove"]],group:"Workspace",loader:de(()=>import("./handler14.js"),"cacheCleanExecute"),name:"clean",options:[Lr,Jc,{defaultValue:!1,description:"Preview without deleting",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Skip the confirmation prompt for out-of-workspace cache directories",name:"force",type:Boolean}]},Wd={commandPath:["cache"],description:"Remove old and oversized cache entries",examples:[["vis cache prune","Remove old and oversized entries"],["vis cache prune --max-age-days=3 --max-size=500MB","Prune with custom limits"],["vis cache prune --keep-last=30","Keep only the 30 most recent entries"]],group:"Workspace",loader:de(()=>import("./handler14.js"),"cachePruneExecute"),name:"prune",options:[Lr,bn,{description:"Remove entries older than N days",name:"max-age-days",type:Number},{description:"Evict oldest entries until cache is under this size (e.g. 500MB)",name:"max-size",type:String},{description:"Keep only the N most recent entries (sorted newest-first by mtime)",name:"keep-last",type:Number}]},Gd={commandPath:["cache"],description:"Print on-disk footprint and stats for one or more cache stores (task / ai / socket)",examples:[["vis cache size","Show stats for every cache store"],["vis cache size --type=ai","Show only the AI response cache (entries, size, oldest, newest)"],["vis cache size --type=task --format=json","Machine-readable task cache size"]],group:"Workspace",loader:de(()=>import("./handler14.js"),"cacheSizeExecute"),name:"size",options:[Lr,bn,Jc,{description:"Output format: table or json (default: table)",name:"format",type:String}]},Oo={description:"Output format: table or json (default: table)",name:"format",type:String},Kc={description:"Use a specific run ID from .task-runner/runs/ instead of the latest run",name:"run",type:String},Jd={argument:{description:"Task ID to explain (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Explain why a task missed the cache by diffing hash inputs against the previous run",examples:[["vis cache why @myorg/app:build","Show which inputs changed since the last run"],["vis cache why @myorg/app:build --json","Machine-readable output for CI"],["vis cache why @myorg/app:build --run 2026-04-28T...","Inspect a specific historical run"]],group:"Workspace",loader:de(()=>import("./handler14.js"),"cacheWhyExecute"),name:"why",options:[Oo,Kc]},Kd={argument:{description:"Task ID to print the hash for (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Print the recorded hash and per-input hash details for a task",examples:[["vis cache hash @myorg/app:build","Show the resolved hash + contributing inputs"],["vis cache hash @myorg/app:build --json","Machine-readable output"]],group:"Workspace",loader:de(()=>import("./handler14.js"),"cacheHashExecute"),name:"hash",options:[Oo,Kc]},zd={argument:{description:"Task ID to verify (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Verify cache restore fidelity: extract the cached entry into a tmp directory and diff each file's content, mode, and mtime against the live workspace. Exits 1 on any drift (changed content, mode, mtime) or if a cached output is missing from the workspace. With --scope=all, the first cache directory containing the task is used.",examples:[["vis cache verify @myorg/app:build","Diff cached outputs vs live workspace files"],["vis cache verify @myorg/app:build --format=json","Machine-readable diff (status: ok | drift)"],["vis cache verify @myorg/app:build --cache-dir=.alt-cache","Verify against a non-default cache directory"],["vis cache verify @myorg/app:build --scope=all","Search shared and worktree caches for the task"]],group:"Workspace",loader:de(()=>import("./handler14.js"),"cacheVerifyExecute"),name:"verify",options:[Lr,bn,Oo]},Hd={commandPath:["cache"],description:"Probe the configured remote cache (HTTP HEAD or REAPI Capabilities) and report reachability, latency, and negotiated capabilities",examples:[["vis cache doctor","Probe the remoteCache configured in vis.config.ts"],["vis cache doctor --url=grpcs://cache.example.com:443 --backend=reapi","Override URL/backend ad-hoc"],["vis cache doctor --json","Machine-readable output"]],group:"Workspace",loader:de(()=>import("./doctor-probe.js"),"cacheDoctorExecute"),name:"doctor",options:[{description:"Override remote cache URL (otherwise read from vis.config.ts remoteCache.url)",name:"url",type:String},{description:"Override backend selector: 'http' or 'reapi'",name:"backend",type:String},{description:"Output format: table or json (default: table)",name:"format",type:String},{defaultValue:5e3,description:"Probe timeout in milliseconds (default: 5000)",name:"timeout",type:Number}]},Yd=[qd,Ud,Wd,Gd,Jd,Kd,zd,Hd];var Xd=Object.defineProperty,Qd=d((e,t)=>Xd(e,"name",{value:t,configurable:!0}),"e$T");const Zd={alias:["c","outdated"],argument:{description:"Specific packages to check (checks all if omitted)",name:"packages",type:String},description:"Check for outdated dependencies, security vulnerabilities, and supply chain settings",examples:[["vis check","Check all catalog dependencies"],["vis check react","Check specific packages"],["vis check --target minor","Only show minor/patch updates"],["vis check --exclude '@types/*'","Exclude packages by pattern"],["vis check --no-security","Skip vulnerability scanning"],["vis check --security-config","Audit supply chain security settings"],["vis check --security-config --sync","Sync security config to pnpm-workspace.yaml"]],group:"Security & Health",loader:Qd(()=>import("./handler5.js"),"loader"),name:"check",options:[{alias:"t",description:"Update target: latest, minor, or patch (default: latest)",name:"target",type:String},{description:"Glob pattern to include packages (repeatable)",lazyMultiple:!0,name:"include",type:String},{description:"Glob pattern to exclude packages (repeatable)",lazyMultiple:!0,name:"exclude",type:String},{defaultValue:!1,description:"Include prerelease versions",name:"prerelease",type:Boolean},{defaultValue:!1,description:"Skip security vulnerability scanning",name:"no-security",type:Boolean},{defaultValue:!1,description:"Audit supply chain security settings",name:"security-config",type:Boolean},{defaultValue:!1,description:"Sync security settings to pnpm-workspace.yaml (pnpm only, requires --security-config)",name:"sync",type:Boolean},{description:"Output format: table, json, or minimal (default: table)",name:"format",type:String},{defaultValue:!1,description:"Exit with code 1 if outdated dependencies found (for CI)",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Run AI analysis on outdated packages",name:"ai",type:Boolean},{description:"AI analysis type: impact, security, compatibility, or recommend",name:"ai-type",type:String},{alias:"D",defaultValue:!1,description:"Check only devDependencies (npm/yarn mode)",name:"dev",type:Boolean},{alias:"P",defaultValue:!1,description:"Check only dependencies (npm/yarn mode)",name:"prod",type:Boolean}]};var ef=Object.defineProperty,tf=d((e,t)=>ef(e,"name",{value:t,configurable:!0}),"e$S");const rf={argument:{description:"Comma-separated list of targets to run (e.g., lint,test,build)",name:"targets",type:String},description:"Run affected targets in a CI-optimized pipeline",examples:[["vis ci lint,test,build","Run lint, test, and build on affected projects"],["vis ci test --base=origin/main","Override the base ref"],["vis ci build --no-install","Skip the install step (assume deps already present)"],["vis ci build --parallel=6","Increase concurrency"]],group:"Run & Execute",loader:tf(()=>import("./handler6.js"),"loader"),name:"ci",options:[{defaultValue:!0,description:"Install dependencies before running targets (use --no-install to skip)",name:"install",type:Boolean},{defaultValue:!1,description:"Skip the toolchain pre-flight (no auto-install for any pinned tool: node / pnpm / yarn / npm / bun / deno / go / python / ruby / rust)",name:"skip-toolchain",type:Boolean},{description:"Git base ref for affected detection (default: auto-detected from CI env)",name:"base",type:String},{description:"Git head ref for affected detection (default: HEAD)",name:"head",type:String},{defaultValue:"none",description:"Upstream scope: none | direct | deep",name:"upstream",type:String},{defaultValue:"deep",description:"Downstream scope: none | direct | deep",name:"downstream",type:String},{defaultValue:4,description:"Maximum number of parallel tasks per target",name:"parallel",type:Number},{description:'Partition tasks for distributed CI (e.g., "1/4")',name:"partition",type:String},{description:"Filter affected projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String}]};var nf=Object.defineProperty,sf=d((e,t)=>nf(e,"name",{value:t,configurable:!0}),"e$R");const of={description:"Remove node_modules from all workspace projects",examples:[["vis clean","Remove all node_modules directories"],["vis clean --lockfile","Also remove lockfiles"],["vis clean --dry-run","Preview what would be removed"]],group:"Workspace",loader:sf(()=>import("./handler7.js"),"loader"),name:"clean",options:[{alias:"l",defaultValue:!1,description:"Also remove lockfiles (pnpm-lock.yaml, package-lock.json, etc.)",name:"lockfile",type:Boolean},{defaultValue:!1,description:"Preview what would be removed without deleting",name:"dry-run",type:Boolean}]};var af=Object.defineProperty,cf=d((e,t)=>af(e,"name",{value:t,configurable:!0}),"e$Q");const lf={argument:{description:"Template to use (e.g., vis:app, create-vite, user/repo) — omit for interactive mode",name:"template",type:String},description:"Create a new project from a template",examples:[["vis create","Interactive project scaffolding"],["vis create vis:monorepo my-workspace","Create a monorepo workspace"],["vis create vis:app my-app","Scaffold a Vite application"],["vis create vis:library my-lib","Create a TypeScript library"],["vis create vite my-app -- --template react-ts","Use create-vite with React TypeScript"],["vis create user/repo my-project","Clone a GitHub template"],["vis create --list","Show available templates"]],group:"Scaffold & Config",loader:cf(()=>import("./handler44.js"),"loader"),name:"create",options:[{defaultValue:!1,description:"Show available templates",name:"list",type:Boolean},{description:"Generate editor configs (vscode)",name:"editor",type:String},{defaultValue:!1,description:"Initialize a git repository",name:"git-init",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts",name:"no-interactive",type:Boolean}]};var pf=Object.defineProperty,uf=d((e,t)=>pf(e,"name",{value:t,configurable:!0}),"e$P");const df={description:"Deduplicate dependencies using the detected package manager",examples:[["vis dedupe","Run deduplication"],["vis dedupe --check","Preview changes without modifying (CI-friendly)"]],group:"Dependencies",loader:uf(()=>import("./handler8.js"),"loader"),name:"dedupe",options:[{defaultValue:!1,description:"Preview changes without modifying files (dry-run)",name:"check",type:Boolean}]};var ff=Object.defineProperty,mf=d((e,t)=>ff(e,"name",{value:t,configurable:!0}),"e$O");const gf={alias:"dc",description:"Create or update .devcontainer/devcontainer.json interactively",examples:[["vis devcontainer","Launch interactive devcontainer config editor"],["vis dc","Alias for devcontainer"],["vis devcontainer --template node-pnpm","Start from Node.js + pnpm template"]],group:"Scaffold & Config",loader:mf(()=>import("./handler46.js"),"loader"),name:"devcontainer",options:[{alias:"t",description:"Start from a template: node, node-pnpm, node-postgres, node-dind, fullstack, python, go, rust, java, devops, minimal, custom",name:"template",type:String},{alias:"o",description:"Output path (default: .devcontainer/devcontainer.json)",name:"output",type:String}]};var hf=Object.defineProperty,yf=d((e,t)=>hf(e,"name",{value:t,configurable:!0}),"e$N");const vf={argument:{description:"Package to execute (optionally with @version)",name:"package",type:String},description:"Execute a remote package without permanent installation",examples:[["vis dlx create-vite my-app","Scaffold a new project"],["vis dlx typescript@5.5.4 tsc --version","Run specific version"],["vis dlx -p cowsay -p lolcatjs -c 'echo hi | cowsay | lolcatjs'","Multiple packages with shell"]],group:"Run & Execute",loader:yf(()=>import("./handler9.js"),"loader"),name:"dlx",options:[{alias:"p",description:"Additional packages to install (repeatable)",multiple:!0,name:"package",type:String},{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output except command results",name:"silent",type:Boolean}]};var bf=Object.defineProperty,kf=d((e,t)=>bf(e,"name",{value:t,configurable:!0}),"e$M");const $f={argument:{description:"Docker subcommand: scaffold | prune",name:"subcommand",type:String},description:"Docker integration — scaffold a minimal context or prune unfocused deps",examples:[["vis docker scaffold --focus=my-app","Generate .vis/docker/workspace for my-app + its deps"],["vis docker scaffold --focus=my-app --include-sources","Also copy focus source trees"],["vis docker scaffold --focus=my-app,other --out=.vis/docker","Focus multiple projects"],["vis docker prune --context=.vis/docker","Strip unfocused projects inside a build stage"]],group:"Workspace",loader:kf(()=>import("./handler10.js"),"loader"),name:"docker",options:[{description:"Project name(s) to focus on — comma-separated for multiple",name:"focus",type:String},{description:"Output directory for the scaffold (default: .vis/docker)",name:"out",type:String},{defaultValue:!1,description:"Also copy focus project source trees to <out>/sources",name:"include-sources",type:Boolean},{description:"Scaffold root for `vis docker prune` (default: .vis/docker)",name:"context",type:String}]};var wf=Object.defineProperty,Sf=d((e,t)=>wf(e,"name",{value:t,configurable:!0}),"e$L");const jf={description:"Run a full project health check (outdated, security, duplicates, optimizations)",examples:[["vis doctor","Full project health check"],["vis doctor --fix","Check and auto-apply safe fixes"],["vis doctor --format json","Machine-readable output for CI"],["vis doctor --only security","Only run the security scans"],["vis doctor --skip optimization,runtime","Skip the listed sections"],["vis doctor --quiet","Summary only, no per-section breakdown"],["vis doctor --no-progress","Disable live progress UI (sequential logs)"],["vis doctor --exit-code","Exit with code 1 if security issues found"],["vis doctor --exit-code --strict","Fail on any issue (outdated, duplicates, security)"]],group:"Security & Health",loader:Sf(()=>import("./handler43.js"),"loader"),name:"doctor",options:[{description:"Output format: table or json (default: table). Alias: --json",name:"format",type:String},{defaultValue:!1,description:"Shorthand for --format json",name:"json",type:Boolean},{defaultValue:!1,description:"Exit with code 1 if issues found",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Auto-apply safe fixes (security overrides + codemods, SIGTERM orphans)",name:"fix",type:Boolean},{defaultValue:!1,description:"With --fix: escalate orphan cleanup to SIGKILL / taskkill /F (use when SIGTERM is ignored)",name:"fix-force",type:Boolean},{defaultValue:!1,description:"With --exit-code: also fail on outdated and duplicate deps",name:"strict",type:Boolean},{description:"Comma-separated sections to run: dependencies,security,optimization,runtime",name:"only",type:String},{description:"Comma-separated sections to skip",name:"skip",type:String},{defaultValue:!1,description:"Suppress per-section detail; print summary only",name:"quiet",type:Boolean},{defaultValue:!1,description:"Disable live progress UI (forces sequential logs)",name:"no-progress",type:Boolean},{defaultValue:!1,description:"Bypass the doctor result cache (~/.vis/cache/doctor)",name:"no-cache",type:Boolean},{description:"Comma-separated package name patterns to scope findings (supports * globs, e.g. '@types/*,react')",name:"filter",type:String}]};var Of=Object.defineProperty,Ef=d((e,t)=>Of(e,"name",{value:t,configurable:!0}),"e$K");const Rf={argument:{description:"Command to execute followed by arguments",name:"command",type:String},description:"Execute a local node_modules/.bin command (no remote fallback)",examples:[["vis exec eslint .","Run local eslint"],["vis exec tsc --noEmit","Run local TypeScript check"],["vis exec -r -- eslint .","Run in all workspace packages"],["vis exec -c 'echo $PATH'","Shell mode"]],group:"Run & Execute",loader:Ef(()=>import("./handler11.js"),"loader"),name:"exec",options:[{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"r",defaultValue:!1,description:"Run in every workspace package",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Run on workspace root only",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter packages by name pattern",multiple:!0,name:"filter",type:String},{defaultValue:!1,description:"Run concurrently without topological ordering",name:"parallel",type:Boolean},{defaultValue:!1,description:"Reverse topological execution order",name:"reverse",type:Boolean}]};var Cf=Object.defineProperty,xf=d((e,t)=>Cf(e,"name",{value:t,configurable:!0}),"e$J");const Nf={argument:{description:"Template name (or remote source like git://… or npm://…) — omit for interactive picker",name:"template",type:String},description:"Scaffold files from an in-repo template",examples:[["vis generate","Pick a template interactively"],["vis generate package","Run the 'package' template"],["vis generate component -- --name=Button --style=primary","Pre-fill option values"],["vis generate package --to=./packages/new --force","Custom destination + overwrite"],["vis generate package --dry-run","Print planned writes without touching disk"],["vis generate git://github.com/org/template#main","Fetch and run a remote template"],["vis generate --list","Show discovered templates"],["vis generate --list --json","Machine-readable template list"],["vis generate package --describe --json","Print template metadata (variables, destination) as JSON"]],group:"Scaffold & Config",loader:xf(()=>import("./handler36.js"),"loader"),name:"generate",options:[{defaultValue:!1,description:"List discovered templates",name:"list",type:Boolean},{defaultValue:!1,description:"Print template metadata (about, destination, variables) without running produce",name:"describe",type:Boolean},{defaultValue:!1,description:"Emit JSON output (with --list or --describe)",name:"json",type:Boolean},{description:"Destination directory",name:"to",type:String},{defaultValue:!1,description:"Print planned writes without touching disk",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Overwrite existing files without prompting",name:"force",type:Boolean},{defaultValue:!1,description:"Skip prompts; use template defaults",name:"defaults",type:Boolean},{defaultValue:!1,description:"Skip running post-generation scripts",name:"skip-scripts",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts (errors on missing required values)",name:"no-interactive",type:Boolean},{defaultValue:!1,description:"Prefer locally cached remote templates over re-downloading",name:"prefer-offline",type:Boolean}]};var If=Object.defineProperty,Pf=d((e,t)=>If(e,"name",{value:t,configurable:!0}),"t$x");const Af={description:"Visualize the project dependency graph",examples:[["vis graph","Show colored dependency graph (TUI in TTY, ASCII otherwise)"],["vis graph --format=ascii","Force ASCII tree output"],["vis graph --format=dot","Output in Graphviz DOT format"],["vis graph --format=html --output=graph.html","Generate interactive HTML graph"],["vis graph --format=json --output=graph.json","Save JSON graph to file"]],group:"Workspace",loader:Pf(()=>import("./handler37.js"),"loader"),name:"graph",options:[{alias:"f",defaultValue:void 0,description:"Output format: tui, ascii, dot, json, html (default: tui in TTY, ascii otherwise)",name:"format",type:String},{alias:"o",description:"Write output to file instead of stdout",name:"output",type:String},{alias:"d",description:"Maximum dependency tree depth for ASCII output (default: unlimited)",name:"depth",type:Number}]},zc=["pre-commit","pre-merge-commit","prepare-commit-msg","commit-msg","post-commit","applypatch-msg","pre-applypatch","post-applypatch","pre-rebase","post-rewrite","post-checkout","post-merge","pre-push","pre-auto-gc"],Hc=".vis-hooks",kE=[".pre-commit-config.yaml",".pre-commit-config.yml","prek.toml"],$E={commit:"pre-commit","merge-commit":"pre-merge-commit",push:"pre-push"},wE=new Set(["commit-msg","post-checkout","post-commit","post-merge","post-rewrite","pre-commit","pre-merge-commit","pre-push","pre-rebase","prepare-commit-msg"]),SE=new Set(["commit-msg","post-checkout","post-merge","post-rewrite","pre-rebase","prepare-commit-msg"]),jE=new Set(["fail","script","system"]);var Tf=Object.defineProperty,It=d((e,t)=>Tf(e,"name",{value:t,configurable:!0}),"e$H");const Pt={defaultValue:Hc,description:"Custom hooks directory",name:"hooks-dir",type:String},At=[{defaultValue:void 0,description:"Set to 0 to disable git hooks, set to 2 for debug output",name:"VIS_GIT_HOOKS",type:String}],Df={commandPath:["hook"],description:"Install git hooks for the workspace (migrates husky / prek on prompt)",env:[...At],examples:[["vis hook install","Install git hooks in .vis-hooks/"],["vis hook install --hooks-dir=.githooks","Install hooks in a custom directory"]],group:"Scaffold & Config",loader:It(()=>import("./handler39.js").then(e=>({default:e.hookInstallExecute})),"loader"),name:"install",options:[Pt]},Lf={commandPath:["hook"],description:"Remove git hooks and reset core.hooksPath",env:[...At],examples:[["vis hook uninstall","Remove git hooks and reset core.hooksPath"]],group:"Scaffold & Config",loader:It(()=>import("./handler39.js").then(e=>({default:e.hookUninstallExecute})),"loader"),name:"uninstall",options:[Pt]},Bf={commandPath:["hook"],description:"Migrate from husky or prek to vis hooks (auto-detected)",env:[...At],examples:[["vis hook migrate","Migrate from husky or prek to vis hooks (auto-detected)"],["vis hook migrate --dry-run","Preview what a migration would write without touching disk"]],group:"Scaffold & Config",loader:It(()=>import("./handler39.js").then(e=>({default:e.hookMigrateExecute})),"loader"),name:"migrate",options:[Pt,{defaultValue:!1,description:"Preview migrate without writing files",name:"dry-run",type:Boolean}]},Mf={commandPath:["hook"],description:"Show configured hooks grouped by stage",env:[...At],examples:[["vis hook list","Show configured hooks grouped by stage"]],group:"Scaffold & Config",loader:It(()=>import("./handler39.js").then(e=>({default:e.hookListExecute})),"loader"),name:"list",options:[Pt]},Vf={commandPath:["hook"],description:"Sanity-check installed hooks and the bundled runner",env:[...At],examples:[["vis hook validate","Sanity-check installed hooks and the bundled runner"]],group:"Scaffold & Config",loader:It(()=>import("./handler39.js").then(e=>({default:e.hookValidateExecute})),"loader"),name:"validate",options:[Pt]},_f={argument:{description:"Hook stage to run (e.g. pre-commit, commit-msg). Defaults to pre-commit.",name:"stage",type:String},commandPath:["hook"],description:"Run a specific hook stage against tracked files",env:[...At],examples:[["vis hook run pre-commit --all-files","Run the pre-commit hooks against every tracked file"],["vis hook run pre-commit --from-ref=main --to-ref=HEAD","Run pre-commit hooks on files changed between two refs"],["vis hook run pre-commit --last-commit","Shortcut for --from-ref HEAD~1 --to-ref HEAD"]],group:"Scaffold & Config",loader:It(()=>import("./handler39.js").then(e=>({default:e.hookRunExecute})),"loader"),name:"run",options:[Pt,{defaultValue:!1,description:"Run against every tracked file",name:"all-files",type:Boolean},{defaultValue:void 0,description:"Include files changed since this ref",name:"from-ref",type:String},{defaultValue:void 0,description:"Include files changed up to this ref",name:"to-ref",type:String},{defaultValue:!1,description:"Shortcut for --from-ref HEAD~1 --to-ref HEAD",name:"last-commit",type:Boolean}]},Ff={argument:{description:"Target to add (currently: `secrets`)",name:"target",type:String},commandPath:["hook"],description:"Add a managed hook snippet (e.g. `vis secrets --staged`)",env:[...At],examples:[["vis hook add secrets","Add a pre-commit hook that runs `vis secrets --staged`"]],group:"Scaffold & Config",loader:It(()=>import("./handler39.js").then(e=>({default:e.hookAddExecute})),"loader"),name:"add",options:[Pt]},qf=[Df,Lf,Bf,Mf,Vf,_f,Ff];var Uf=Object.defineProperty,Wf=d((e,t)=>Uf(e,"name",{value:t,configurable:!0}),"e$G");const Gf={argument:{description:"Project name to check (required)",name:"project",type:String},description:'Exit with inverted codes for CI "Ignored Build Step" gating (Vercel/Netlify)',examples:[["vis ignore my-app","Check if my-app is affected and decide whether to build"],["vis ignore my-app --base $VERCEL_GIT_PREVIOUS_SHA","Explicit base ref"],["vis ignore my-app --json","Emit the decision as JSON instead of text"],["vis ignore my-app --verbose","Print debug info about the decision path"],["vis ignore my-app --exit-zero-on-build","Normal exit semantics (0=build, 0=skip)"]],group:"Run & Execute",loader:Wf(()=>import("./handler30.js"),"loader"),name:"ignore",options:[{description:"Git base ref for comparison. Defaults to CI provider env vars, then HEAD~1.",name:"base",type:String},{defaultValue:"HEAD",description:"Git head ref for comparison",name:"head",type:String},{defaultValue:"deep",description:'Downstream scope: "none", "direct", or "deep"',name:"downstream",type:String},{defaultValue:"none",description:'Upstream scope: "none", "direct", or "deep"',name:"upstream",type:String},{defaultValue:!1,description:"Emit the decision as JSON on stdout instead of human text",name:"json",type:Boolean},{defaultValue:!1,description:"Exit 0 on build (normal semantics) instead of 1 (inverted Vercel/Netlify semantics)",name:"exit-zero-on-build",type:Boolean},{defaultValue:!1,description:"Enable verbose debug output",name:"verbose",type:Boolean}]};var Jf=Object.defineProperty,Kf=d((e,t)=>Jf(e,"name",{value:t,configurable:!0}),"e$F");const zf={description:"Remove vis from the system (self-uninstall)",examples:[["vis implode","Interactive uninstall"],["vis implode --yes","Non-interactive uninstall (CI)"]],group:"System",loader:Kf(()=>import("./handler12.js"),"loader"),name:"implode",options:[{alias:"y",defaultValue:!1,description:"Skip confirmation prompt",name:"yes",type:Boolean}]};var Hf=Object.defineProperty,Yf=d((e,t)=>Hf(e,"name",{value:t,configurable:!0}),"e$E");const Xf={alias:"view",argument:{description:"Package name followed by optional metadata fields (e.g. 'react version dependencies')",name:"args",type:String},description:"Show npm registry metadata for a package (alias of `npm view` / `pnpm view` / `yarn info` / `bun pm view`)",examples:[["vis info react","Full registry metadata for react"],["vis info react version","Latest version only"],["vis info react versions","All published versions"],["vis info react@18 dependencies","Dependencies of react@18"],["vis info react --json","Emit JSON"],["vis view react","Alias matching npm/pnpm"]],group:"Dependencies",loader:Yf(()=>import("./handler13.js"),"loader"),name:"info",options:[{defaultValue:!1,description:"Output as JSON",name:"json",type:Boolean}]};var Qf=Object.defineProperty,Zf=d((e,t)=>Qf(e,"name",{value:t,configurable:!0}),"e$D");const em={description:"Initialize vis.config.ts with best-practice security defaults",examples:[["vis init","Interactive setup wizard"],["vis init --no-interactive","Create minimal config without prompts"],["vis init --force","Overwrite existing config"],["vis init --sync-native","Also sync to native PM config files"]],group:"Scaffold & Config",loader:Zf(()=>import("./handler15.js"),"loader"),name:"init",options:[{defaultValue:!1,description:"Overwrite existing config file",name:"force",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts",name:"no-interactive",type:Boolean},{defaultValue:!1,description:"Sync settings to native PM config files",name:"sync-native",type:Boolean}]};var tm=Object.defineProperty,rm=d((e,t)=>tm(e,"name",{value:t,configurable:!0}),"e$C");const nm={alias:"i",description:"Install dependencies using the detected package manager",examples:[["vis install","Install all dependencies (frozen-lockfile by default when a lockfile is present)"],["vis i --no-frozen-lockfile","Allow lockfile updates (escape hatch for the default)"],["vis install --ci","Clean install: wipe node_modules + frozen lockfile (mirrors npm ci / pnpm ci)"],["vis install --prefer-offline","Use cached packages when available, fall back to network"],["vis install --prod","Install production dependencies only"],["vis install --filter app","Install for specific workspace package"],["vis install --run-scripts","Run lifecycle scripts (opts out of vis's default block-by-default policy; allowlisted packages run via security.allowBuilds)"],["vis install --no-typosquat-check","Skip typosquat name check"],["vis install --installer aube","Force aube as the installer (errors if not on PATH)"],["vis install --no-aube","Bypass aube; use the lockfile-detected PM"]],group:"Dependencies",loader:rm(()=>import("./handler16.js"),"loader"),name:"install",options:[{alias:"P",defaultValue:!1,description:"Skip devDependencies",name:"prod",type:Boolean},{alias:"D",defaultValue:!1,description:"Install devDependencies only",name:"dev",type:Boolean},{defaultValue:!1,description:"Use frozen lockfile (CI mode, maps to npm ci)",name:"frozen-lockfile",type:Boolean},{defaultValue:!1,description:"Opt out of vis's default frozen-lockfile behavior and allow lockfile updates",name:"no-frozen-lockfile",type:Boolean},{defaultValue:!1,description:"Clean install: wipe node_modules then install with frozen lockfile",name:"ci",type:Boolean},{alias:"f",defaultValue:!1,description:"Force reinstall all dependencies",name:"force",type:Boolean},{defaultValue:!1,description:"Run lifecycle scripts (opts out of vis's default block-by-default policy; allowlisted packages run via security.allowBuilds)",name:"run-scripts",type:Boolean},{defaultValue:!1,description:"Update lockfile without installing",name:"lockfile-only",type:Boolean},{defaultValue:!1,description:"Skip optional dependencies",name:"no-optional",type:Boolean},{defaultValue:!1,description:"Use only cached packages",name:"offline",type:Boolean},{defaultValue:!1,description:"Prefer cached packages, fall back to network when missing",name:"prefer-offline",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output",name:"silent",type:Boolean},{alias:"r",defaultValue:!1,description:"Install in all workspace packages",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Target workspace root",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String},{defaultValue:!1,description:"Skip typosquat name check",name:"no-typosquat-check",type:Boolean},{description:"Pick the installer explicitly. One of: auto, aube, pnpm, npm, yarn, bun. Overrides VIS_INSTALLER and install.backend in vis.config.",name:"installer",type:String},{defaultValue:!1,description:"Skip aube and use the lockfile-detected PM. Wins over --installer / VIS_INSTALLER / install.backend.",name:"no-aube",type:Boolean}]};var sm=Object.defineProperty,om=d((e,t)=>sm(e,"name",{value:t,configurable:!0}),"e$B");const im={alias:"ln",argument:{description:"Package name or directory path to link (omit to register current package)",name:"target",type:String},description:"Link a local package for development",examples:[["vis link ./packages/utils","Link local directory package (works on all PMs)"],["vis link","Register current package globally (pnpm <=10, yarn, npm, bun)"],["vis link react","Link global package into current project (pnpm <=10, yarn, npm, bun)"]],group:"Dependencies",loader:om(()=>import("./handler17.js"),"loader"),name:"link"};var am=Object.defineProperty,cm=d((e,t)=>am(e,"name",{value:t,configurable:!0}),"e$A");const lm={description:"Lint workspace dependency policies (workspace-protocol, banned-deps, redefine-root, workspace-versions, custom-types, empty-deps, root-private, root-package-manager, root-deps, missing-package-json, dead-workspace-patterns, types-in-deps, similar-deps)",examples:[["vis lint","Run every enabled lint and exit non-zero on failures"],["vis lint --workspace-protocol","Only check that internal deps use workspace:*"],["vis lint --workspace-protocol --fix","Auto-rewrite internal deps to use workspace:*"],["vis lint --redefine-root","Flag deps duplicated between root and child packages"],["vis lint --banned-deps","Flag deps matching policy.bannedDeps in vis config"],["vis lint --workspace-versions","Flag external deps declared at different versions across packages"],["vis lint --workspace-versions --fix","Rewrite drifting deps to the highest sibling version"],["vis lint --workspace-versions --dep react","Limit version-drift check to a single dep"],["vis lint --workspace-versions --resolve catalog --fix","Rewrite drifting deps to catalog: when a catalog already pins them"],["vis lint --workspace-versions --resolve catalog --propose-min 3","Suggest new catalog entries for deps ≥3 packages already agree on"],["vis lint --custom-types","Flag drift in engines.{node,pnpm}, packageManager, volta.{node,pnpm,yarn}, devEngines"],["vis lint --custom-types --fix","Align all engines/packageManager/volta versions to the highest sibling"],["vis lint --empty-deps --fix","Drop empty `dependencies` / `devDependencies` / etc. blocks across the workspace"],["vis lint --root-private --fix",'Ensure the workspace root package.json has "private": true'],["vis lint --root-package-manager","Ensure the root package.json declares a `packageManager` field"],["vis lint --root-deps --fix","Move runtime deps off the private workspace root into devDependencies"],["vis lint --missing-package-json","Flag workspace dirs that don't contain a package.json"],["vis lint --dead-workspace-patterns --fix","Drop workspace patterns that match zero packages"],["vis lint --types-in-deps --fix","Move @types/* out of dependencies on private packages"],["vis lint --similar-deps","Flag drift across related dep families (react+react-dom, @babel/*, …)"],["vis lint --ban left-pad --ban request","One-off ban: flag any package declaring left-pad or request"],["vis lint --pin react@18.2.0","One-off pin: flag any package declaring react at a different version"],["vis lint --format json","Emit findings as JSON for CI / editor integrations"]],group:"Security & Health",loader:cm(()=>import("./handler45.js"),"loader"),name:"lint",options:[{defaultValue:!1,description:"Lint that internal deps use the workspace: protocol",name:"workspace-protocol",type:Boolean},{defaultValue:!1,description:"Lint that no child re-declares a dep already pinned in the workspace root",name:"redefine-root",type:Boolean},{defaultValue:!1,description:"Lint deps against policy.bannedDeps in vis config",name:"banned-deps",type:Boolean},{defaultValue:!1,description:"Lint that all packages declare external deps at the same version",name:"workspace-versions",type:Boolean},{defaultValue:!1,description:"Lint engines.{node,pnpm}, packageManager, volta.*, devEngines.* for drift across packages",name:"custom-types",type:Boolean},{defaultValue:!1,description:"Flag empty dependency blocks (`dependencies: {}`, `devDependencies: {}`, …) across the workspace",name:"empty-deps",type:Boolean},{defaultValue:!1,description:'Ensure the workspace root package.json sets `"private": true`',name:"root-private",type:Boolean},{defaultValue:!1,description:"Ensure the workspace root package.json declares a `packageManager` field",name:"root-package-manager",type:Boolean},{defaultValue:!1,description:"Flag runtime dependencies on the private workspace root (move them to devDependencies)",name:"root-deps",type:Boolean},{defaultValue:!1,description:"Flag workspace directories that lack a package.json",name:"missing-package-json",type:Boolean},{defaultValue:!1,description:"Flag workspace patterns (in `pnpm-workspace.yaml` / `package.json#workspaces`) that match zero packages",name:"dead-workspace-patterns",type:Boolean},{defaultValue:!1,description:"Flag `@types/*` declared in `dependencies` on a private package (should be in devDependencies)",name:"types-in-deps",type:Boolean},{defaultValue:!1,description:"Flag version drift across related dep families (react+react-dom, @babel/*, @storybook/*, …)",name:"similar-deps",type:Boolean},{description:"Restrict --workspace-versions to a single dep",name:"dep",type:String},{description:"Ban a dep name or glob for this run (repeatable). Auto-enables --banned-deps.",multiple:!0,name:"ban",type:String},{description:"Pin a dep to an exact specifier for this run, e.g. react@^18.2.0 (repeatable). Auto-enables --workspace-versions.",multiple:!0,name:"pin",type:String},{description:"Conflict resolution for --workspace-versions: highest, lowest, or catalog (default: highest)",name:"resolve",type:String},{description:"Propose catalog entries for deps ≥N packages already agree on. Activates with --resolve catalog.",name:"propose-min",type:Number},{defaultValue:!1,description:"Auto-fix violations in place (writes package.json files)",name:"fix",type:Boolean},{description:"Specifier used by --fix for workspace-protocol (default: workspace:*)",name:"fix-specifier",type:String},{description:"Output format: human, json, or minimal (default: human)",name:"format",type:String},{defaultValue:!1,description:"Suppress all output except errors",name:"quiet",type:Boolean}]};var pm=Object.defineProperty,um=d((e,t)=>pm(e,"name",{value:t,configurable:!0}),"e$z");const dm={description:"List all workspace projects with metadata",examples:[["vis list","Show all projects"],["vis list --targets","Per-target rows with type, cache status and description"],["vis list --targets --inferred","Only show targets synthesized by Project Crystal-style inference"],["vis list --deps","Human-readable table of every dep-instance across the workspace"],["vis list --deps --internal-only","Only workspace deps in human form"],["vis list --deps --format=ndjson","Stream every dep-instance as NDJSON for jq pipelines"],["vis list --deps --format=json --pretty","Single pretty-printed JSON array of dep-instances"],["vis list --format=json","Machine-readable project listing"],['vis list --query "tag=frontend"',"Filter by query"]],group:"Workspace",loader:um(()=>import("./handler31.js"),"loader"),name:"list",options:[{defaultValue:!1,description:"Filter target rows to only inferred targets (implies --targets)",name:"inferred",type:Boolean},{description:"Output format: table (default), json (single document), or ndjson (one record per line; --deps only)",name:"format",type:String},{defaultValue:!1,description:"Pretty-print with 2-space indent (only meaningful with --format=json)",name:"pretty",type:Boolean},{description:"Filter projects by query",name:"query",type:String},{defaultValue:!1,description:"Show per-target rows (type, cache, description)",name:"targets",type:Boolean},{defaultValue:!1,description:"Render a dep-instance view (table by default; use --format=ndjson|json for jq-friendly streams)",name:"deps",type:Boolean},{description:"Restrict --deps to specific dep blocks (repeatable)",multiple:!0,name:"dep-type",type:String},{defaultValue:!1,description:"With --deps: only show internal/workspace deps",name:"internal-only",type:Boolean},{defaultValue:!1,description:"With --deps: only show external/registry deps",name:"external-only",type:Boolean},{description:"With --deps: glob of declaring package names to keep (repeatable)",multiple:!0,name:"include",type:String},{description:"With --deps: glob of declaring package names to drop (repeatable)",multiple:!0,name:"exclude",type:String}]};var fm=Object.defineProperty,Ae=d((e,t)=>fm(e,"name",{value:t,configurable:!0}),"t$r");const Me=[{defaultValue:!1,description:"Preview changes without applying",name:"dry-run",type:Boolean},{alias:"y",defaultValue:!1,description:"Skip the confirmation prompt",name:"yes",type:Boolean}],mm={commandPath:["migrate"],description:"Migrate dependencies and scripts to vis",group:"Scaffold & Config",loader:Ae(()=>import("./handler32.js").then(e=>({default:e.migrateDepsExecute})),"loader"),name:"deps",options:[...Me]},gm={commandPath:["migrate"],description:"Inline lint-staged configuration into vis",group:"Scaffold & Config",loader:Ae(()=>import("./handler32.js").then(e=>({default:e.migrateLintStagedExecute})),"loader"),name:"lint-staged",options:[...Me]},hm={commandPath:["migrate"],description:"Inline nano-staged configuration into vis",group:"Scaffold & Config",loader:Ae(()=>import("./handler32.js").then(e=>({default:e.migrateNanoStagedExecute})),"loader"),name:"nano-staged",options:[...Me]},ym={commandPath:["migrate"],description:"Migrate turborepo tasks/config to vis",group:"Scaffold & Config",loader:Ae(()=>import("./handler32.js").then(e=>({default:e.migrateTurborepoExecute})),"loader"),name:"turborepo",options:[...Me]},vm={commandPath:["migrate"],description:"Migrate nx targets/config to vis",group:"Scaffold & Config",loader:Ae(()=>import("./handler32.js").then(e=>({default:e.migrateNxExecute})),"loader"),name:"nx",options:[...Me]},bm={commandPath:["migrate"],description:"Migrate moon tasks/templates to vis",group:"Scaffold & Config",loader:Ae(()=>import("./handler32.js").then(e=>({default:e.migrateMoonExecute})),"loader"),name:"moon",options:[...Me,{defaultValue:!1,description:"Copy .moon/templates/* into .vis/templates/* so `vis generate` works without .moon/",name:"copy-templates",type:Boolean}]},km={commandPath:["migrate"],description:"Migrate gitleaks config/baseline/hooks to `vis secrets`",examples:[["vis migrate gitleaks","Migrate gitleaks config/baseline/hooks to `vis secrets`"]],group:"Scaffold & Config",loader:Ae(()=>import("./handler32.js").then(e=>({default:e.migrateGitleaksExecute})),"loader"),name:"gitleaks",options:[...Me]},$m={commandPath:["migrate"],description:"Migrate Kingfisher baseline/hooks/scripts to `vis secrets`",examples:[["vis migrate kingfisher","Migrate Kingfisher baseline/hooks/scripts to `vis secrets`"]],group:"Scaffold & Config",loader:Ae(()=>import("./handler32.js").then(e=>({default:e.migrateKingfisherExecute})),"loader"),name:"kingfisher",options:[...Me]},wm={commandPath:["migrate"],description:"Replace secretlint with `vis secrets`",examples:[["vis migrate secretlint","Replace secretlint with `vis secrets`"]],group:"Scaffold & Config",loader:Ae(()=>import("./handler32.js").then(e=>({default:e.migrateSecretlintExecute})),"loader"),name:"secretlint",options:[...Me]},Sm={commandPath:["migrate"],description:"Translate syncpack customTypes into vis policy and strip the syncpack dep/scripts",examples:[["vis migrate syncpack","Translate syncpack customTypes into vis policy and strip the syncpack dep/scripts"]],group:"Scaffold & Config",loader:Ae(()=>import("./handler32.js").then(e=>({default:e.migrateSyncpackExecute})),"loader"),name:"syncpack",options:[...Me]},jm={commandPath:["migrate"],description:"Strip sherif config/dep/scripts and surface ignore-rules as a positive `vis lint --<rule>` command",examples:[["vis migrate sherif","Strip sherif config/dep/scripts and surface ignore-rules as a positive `vis lint --<rule>` command"]],group:"Scaffold & Config",loader:Ae(()=>import("./handler32.js").then(e=>({default:e.migrateSherifExecute})),"loader"),name:"sherif",options:[...Me]},Om={commandPath:["migrate"],description:"Audit the workspace for stray gitleaks/secretlint/sherif/syncpack references (exit 1 on issues)",examples:[["vis migrate verify","Audit the workspace for stray gitleaks/secretlint/sherif/syncpack references (exit 1 on issues)"]],group:"Scaffold & Config",loader:Ae(()=>import("./handler32.js").then(e=>({default:e.migrateVerifyExecute})),"loader"),name:"verify",options:[]},Em=[mm,gm,hm,ym,vm,bm,km,$m,wm,Sm,jm,Om];var Rm=Object.defineProperty,Cm=d((e,t)=>Rm(e,"name",{value:t,configurable:!0}),"r$C");const xm=new Set(["--cwd"]),Nm=new Set(["--help","--version","-h","-V"]),Im=Cm(e=>{const t=[];for(let r=0;r<e.length;r+=1){const n=e[r];if(n!==void 0){if(Nm.has(n))return!1;if(n.startsWith("-")){const s=n.indexOf("="),o=s===-1?n:n.slice(0,s);if(xm.has(o)&&s===-1){const i=e[r+1];i!==void 0&&!i.startsWith("-")&&(r+=1)}continue}t.push(n)}}return t.length===1&&t[0]==="migrate"},"isBareMigrateInvocation");var Pm=Object.defineProperty,Am=d((e,t)=>Pm(e,"name",{value:t,configurable:!0}),"t$q");const Qi=Am(e=>e in Yn&&Yn[e]!=="0"&&Yn[e]!=="false","check"),pt=Qi("CI")||Qi("CONTINUOUS_INTEGRATION");var Tm=Object.defineProperty,Qn=d((e,t)=>Tm(e,"name",{value:t,configurable:!0}),"i$r");class Dm{static{d(this,"MigrateStore")}static{Qn(this,"MigrateStore")}#e;#r=new Set;constructor(t){this.#e={applyProgress:null,checkedItems:new Set(t.map(r=>r.entry.id)),error:null,focusedPanel:"list",items:t,phase:"browsing",selectedIndex:0}}getSnapshot=Qn(()=>this.#e,"getSnapshot");subscribe=Qn(t=>(this.#r.add(t),()=>{this.#r.delete(t)}),"subscribe");getCheckedItems(){return this.#e.items.filter(t=>this.#e.checkedItems.has(t.entry.id))}getSelectedItem(){return this.#e.items[this.#e.selectedIndex]??null}setSelectedIndex(t){const r=Math.max(0,Math.min(t,this.#e.items.length-1));r!==this.#e.selectedIndex&&this.#t({...this.#e,selectedIndex:r})}setFocusedPanel(t){t!==this.#e.focusedPanel&&this.#t({...this.#e,focusedPanel:t})}toggleCheck(t){const r=new Set(this.#e.checkedItems);r.has(t)?r.delete(t):r.add(t),this.#t({...this.#e,checkedItems:r})}checkAll(){this.#t({...this.#e,checkedItems:new Set(this.#e.items.map(t=>t.entry.id))})}uncheckAll(){this.#t({...this.#e,checkedItems:new Set})}toggleAll(){this.#e.checkedItems.size===this.#e.items.length?this.uncheckAll():this.checkAll()}startApply(){const t=this.getCheckedItems().length;this.#t({...this.#e,applyProgress:{current:0,total:t},phase:"applying"})}updateApplyProgress(t){this.#e.applyProgress&&this.#t({...this.#e,applyProgress:{...this.#e.applyProgress,current:t}})}markDone(){this.#t({...this.#e,phase:"done"})}setError(t){this.#t({...this.#e,error:t,phase:"error"})}#t(t){this.#e=t;for(const r of this.#r)try{r()}catch{}}}var Lm=Object.defineProperty,Bm=d((e,t)=>Lm(e,"name",{value:t,configurable:!0}),"f$s");const Zi=Bm(({autoExitSeconds:e,onCancel:t,visible:r})=>{const{exit:n}=Bc(),[s,o]=gr(e||3),i=kr(null),a=kr(0);_c(()=>{if(!r)return;const l=e||3;o(l),a.current=Date.now();let p=l;return i.current=setInterval(()=>{p-=1,p<=0?(i.current&&(clearInterval(i.current),i.current=null),o(0),n()):o(p)},1e3),()=>{i.current&&(clearInterval(i.current),i.current=null)}},[r,e,n]);const c=Fc(()=>{i.current&&(clearInterval(i.current),i.current=null),t()},[t]);return Mc((l,p)=>{Date.now()-a.current<200||(l==="q"?n():c())},{isActive:r}),R(Hs,{backgroundColor:"#1e1e1e",footer:G(C,{dimColor:!0,children:["Press"," ",R(C,{bold:!0,color:"white",children:"q"})," ","to exit,"," ",R(C,{bold:!0,color:"white",children:"any key"})," ","to stay"]}),title:`Exiting in ${s}…`,visible:r,width:50,children:R(C,{dimColor:!0,children:"Stay to explore the results interactively."})})},"QuitDialog");var Mm=Object.defineProperty,Yc=d((e,t)=>Mm(e,"name",{value:t,configurable:!0}),"n$r");const Vm=Yc(e=>{if(e.startsWith("⚠"))return"yellow";e.startsWith("── ")||e.startsWith("[dry-run]")},"colorForPreviewLine"),_m=Yc(({focused:e,item:t,scrollRef:r})=>t?G(K,{borderColor:e?"white":"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,children:[R(K,{flexShrink:0,paddingTop:1,paddingX:2,children:R(C,{bold:!0,color:"white",children:t.entry.title})}),R(K,{flexShrink:0,paddingBottom:1,paddingX:2,children:R(C,{dimColor:!0,children:t.entry.description})}),R(Lu,{flexGrow:1,flexShrink:1,paddingX:2,ref:r,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:G(K,{flexDirection:"column",children:[R(C,{dimColor:!0,children:"── What will change ──"}),R(C,{}),t.preview.length===0&&R(C,{dimColor:!0,children:"(no preview available)"}),t.preview.map((s,o)=>{const i=Vm(s);return s===""?R(C,{},`blank-${String(o)}`):R(C,{color:i,children:s},`${String(o)}-${s.slice(0,20)}`)})]})})]}):R(K,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:R(C,{dimColor:!0,children:"No migration selected"})}),"MigrateDetailPanel");var Fm=Object.defineProperty,Xc=d((e,t)=>Fm(e,"name",{value:t,configurable:!0}),"g$l");const qm=Xc(({checked:e,isSelected:t,item:r})=>{const n=e?"☑":"☐",s=r.preview.length;return G(K,{flexShrink:0,height:1,children:[R(C,{children:t?">":" "}),G(C,{color:e?"white":"gray",children:[" ",n," "]}),R(K,{flexGrow:1,children:R(C,{bold:t,inverse:t,wrap:"truncate",children:r.entry.title})}),G(C,{dimColor:!0,children:[" ",s," ","change",s===1?"":"s"," "]})]})},"MigrationRow"),Um=Xc(({checkedItems:e,focused:t,isDryRun:r,items:n,scrollOffset:s,selectedIndex:o,viewportHeight:i})=>{const a=t?"white":"gray",c=n.filter(u=>e.has(u.entry.id)).length,l=n.map((u,m)=>R(qm,{checked:e.has(u.entry.id),isSelected:m===o,item:u},u.entry.id)),p=n.length,f=p>i&&i>0;return G(K,{borderColor:a,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[G(K,{flexShrink:0,gap:1,paddingX:1,children:[R(C,{bold:!0,inverse:!0,children:" MIGRATE "}),G(C,{wrap:"truncate",children:[n.length," ","applicable"]}),c>0&&G(C,{dimColor:!0,children:[" — ",c," selected"]}),r&&R(C,{color:"yellow",children:" (dry-run)"})]}),G(K,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[R(K,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:R(K,{flexDirection:"column",marginTop:-s,children:l})}),f&&R(K,{flexShrink:0,marginLeft:1,marginRight:1,children:R(Bu,{contentHeight:p,placement:"inset",scrollOffset:s,style:"block",viewportHeight:i})})]})]})},"MigrateListPanel");var Wm=Object.defineProperty,Gm=d((e,t)=>Wm(e,"name",{value:t,configurable:!0}),"N$f");const Jm=100,Km=40,zm=10,Hm=Gm(({autoExitSeconds:e=0,isDryRun:t,store:r})=>{const{exit:n}=Bc(),{columns:s,rows:o}=Mu(),i=Fu(r.subscribe,r.getSnapshot),[a,c]=gr(!1),[l,p]=gr(!1),[f,u]=gr(!1),[m,h]=gr(0),g=kr(null),b=kr(null),v=kr(null),$=i.items[i.selectedIndex]??null,j=Math.max(1,o-6),x=Fc(z=>{h(S=>z>=S+j?Math.max(0,z-j+1):z<S?Math.max(0,z):S)},[j]);if(_c(()=>{b.current?.scrollToTop()},[$?.entry.id]),Mc((z,S)=>{if(z==="c"&&S.ctrl){n();return}if(!f){if(l){z==="u"||S.return?(p(!1),r.startApply(),n(r.getCheckedItems())):S.escape||z==="q"?p(!1):S.downArrow||z==="j"?v.current?.scrollBy(1):(S.upArrow||z==="k")&&v.current?.scrollBy(-1);return}if(a){S.escape||z==="?"?c(!1):z==="q"?(c(!1),u(!0)):S.downArrow||z==="j"?g.current?.scrollBy(1):(S.upArrow||z==="k")&&g.current?.scrollBy(-1);return}if(z==="?"){c(!0);return}if(z==="q"){u(!0);return}if(S.tab){r.setFocusedPanel(i.focusedPanel==="list"?"detail":"list");return}if(i.focusedPanel==="list"){if(S.downArrow||z==="j"){const O=Math.min(i.selectedIndex+1,i.items.length-1);r.setSelectedIndex(O),x(O);return}if(S.upArrow||z==="k"){const O=Math.max(i.selectedIndex-1,0);r.setSelectedIndex(O),x(O);return}if(S.pageDown){const O=Math.min(i.selectedIndex+10,i.items.length-1);r.setSelectedIndex(O),x(O);return}if(S.pageUp){const O=Math.max(i.selectedIndex-10,0);r.setSelectedIndex(O),x(O);return}if(S.home){r.setSelectedIndex(0),h(0);return}if(S.end){const O=i.items.length-1;r.setSelectedIndex(O),x(O);return}if(z===" "||S.return){$&&r.toggleCheck($.entry.id);return}if(z==="a"){r.toggleAll();return}if(z==="u"&&!t&&i.checkedItems.size>0){p(!0);return}S.rightArrow&&r.setFocusedPanel("detail");return}if(i.focusedPanel==="detail"){if(S.escape||S.leftArrow){r.setFocusedPanel("list");return}if(S.downArrow||z==="j"){b.current?.scrollBy(1);return}if(S.upArrow||z==="k"){b.current?.scrollBy(-1);return}if(S.pageDown){b.current?.scrollBy(10);return}if(S.pageUp){b.current?.scrollBy(-10);return}if(S.home){b.current?.scrollToTop();return}S.end&&b.current?.scrollToBottom()}}},{isActive:!0}),s<Km||o<zm)return R(K,{alignItems:"center",height:o,justifyContent:"center",width:s,children:G(C,{color:"yellow",children:["Terminal too small (",s,"x",o,")"]})});const N=s>=Jm,I=[G(K,{gap:1,children:[R(C,{bold:!0,color:"white",children:"q"}),R(C,{dimColor:!0,children:"QUIT"})]},"q"),G(K,{gap:1,children:[R(C,{bold:!0,color:"white",children:"?"}),R(C,{dimColor:!0,children:"HELP"})]},"?"),G(K,{gap:1,children:[R(C,{bold:!0,color:"white",children:"↑↓"}),R(C,{dimColor:!0,children:"NAV"})]},"nav"),G(K,{gap:1,children:[R(C,{bold:!0,color:"white",children:"Space"}),R(C,{dimColor:!0,children:"CHECK"})]},"sp"),G(K,{gap:1,children:[R(C,{bold:!0,color:"white",children:"a"}),R(C,{dimColor:!0,children:"ALL"})]},"a")];!t&&i.checkedItems.size>0&&I.push(G(K,{gap:1,children:[R(C,{bold:!0,color:"green",children:"u"}),R(C,{dimColor:!0,children:"APPLY"})]},"u")),I.push(G(K,{gap:1,children:[R(C,{bold:!0,color:"white",children:"Tab"}),R(C,{dimColor:!0,children:"PANEL"})]},"tab"));const _=R(K,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:R(K,{flexWrap:"wrap",gap:2,paddingX:1,children:I})}),w=G(Hs,{footer:G(C,{dimColor:!0,children:[R(C,{bold:!0,color:"white",children:"↑↓"})," scroll ",R(C,{bold:!0,color:"white",children:"?"}),"/",R(C,{bold:!0,color:"white",children:"Esc"})," close"]}),scrollRef:g,title:"KEYBOARD SHORTCUTS",visible:a,width:52,children:[G(K,{flexDirection:"column",marginBottom:1,children:[R(C,{bold:!0,color:"white",children:"NAVIGATION"}),G(C,{children:[R(C,{bold:!0,color:"white",children:" ↑/k"}),R(C,{dimColor:!0,children:" Move up"})]}),G(C,{children:[R(C,{bold:!0,color:"white",children:" ↓/j"}),R(C,{dimColor:!0,children:" Move down"})]}),G(C,{children:[R(C,{bold:!0,color:"white",children:" Tab"}),R(C,{dimColor:!0,children:" Switch panel"})]}),G(C,{children:[R(C,{bold:!0,color:"white",children:" →/←"}),R(C,{dimColor:!0,children:" Focus detail/list"})]})]}),G(K,{flexDirection:"column",marginBottom:1,children:[R(C,{bold:!0,color:"white",children:"SELECTION"}),G(C,{children:[R(C,{bold:!0,color:"white",children:" Space"}),R(C,{dimColor:!0,children:" Toggle migration"})]}),G(C,{children:[R(C,{bold:!0,color:"white",children:" a"}),R(C,{dimColor:!0,children:" Toggle all"})]})]}),G(K,{flexDirection:"column",children:[R(C,{bold:!0,color:"white",children:"ACTIONS"}),!t&&G(C,{children:[R(C,{bold:!0,color:"white",children:" u"}),R(C,{dimColor:!0,children:" Apply selected migrations"})]}),G(C,{children:[R(C,{bold:!0,color:"white",children:" q"}),R(C,{dimColor:!0,children:" Quit"})]}),G(C,{children:[R(C,{bold:!0,color:"white",children:" ?"}),R(C,{dimColor:!0,children:" Toggle help"})]})]})]}),M=r.getCheckedItems(),L=R(K,{alignItems:"center",flexDirection:"column",children:G(C,{dimColor:!0,children:["Press ",R(C,{bold:!0,color:"white",children:"u"})," or ",R(C,{bold:!0,color:"white",children:"Enter"})," to confirm, ",R(C,{bold:!0,color:"white",children:"Esc"})," to cancel"]})}),be=R(Hs,{footer:L,scrollRef:v,title:`Apply ${String(M.length)} migration${M.length===1?"":"s"}?`,visible:l,width:70,children:M.map(z=>G(K,{gap:1,children:[G(C,{children:[" ",z.entry.title]}),G(C,{dimColor:!0,children:["(",z.preview.length," ","change",z.preview.length===1?"":"s",")"]})]},z.entry.id))}),ee=R(Um,{checkedItems:i.checkedItems,focused:i.focusedPanel==="list",isDryRun:t,items:i.items,scrollOffset:m,selectedIndex:i.selectedIndex,viewportHeight:j}),Xe=R(_m,{focused:i.focusedPanel==="detail",item:$,scrollRef:b});if(N){const z=Math.floor(s*.55);return G(K,{flexDirection:"column",height:o,width:s,children:[G(K,{flexDirection:"row",flexGrow:1,children:[R(K,{flexGrow:1,children:ee}),R(K,{width:z,children:Xe})]}),_,be,R(Zi,{autoExitSeconds:e||3,onCancel:d(()=>{u(!1)},"onCancel"),visible:f}),w]})}const dr=Math.floor(o*.45);return G(K,{flexDirection:"column",height:o,width:s,children:[R(K,{height:dr,children:ee}),R(K,{flexGrow:1,children:Xe}),_,be,R(Zi,{autoExitSeconds:e||3,onCancel:d(()=>{u(!1)},"onCancel"),visible:f}),w]})},"VisMigrateApp");var Ym=Object.defineProperty,Eo=d((e,t)=>Ym(e,"name",{value:t,configurable:!0}),"r$A");const Xm=/\n([ \t]+)/,Qm=Eo(e=>{const{indent:t,lineEnding:r}=Ku(e),n={};return t!==void 0&&(n.indent=t),(r==="lf"||r==="crlf")&&(n.lineEnding=r),n},"resolveEditorConfigDefaults"),He=Eo((e,t,r={})=>{const{defaultIndent:n=" ",useEditorconfig:s=!0}=r;if(s){const{indent:o}=Qm(e);if(o!==void 0)return o}if(t!==void 0){const o=Xm.exec(t);if(o?.[1]!==void 0)return o[1]}return n},"resolveIndentForFile"),Ro=Eo((e,t={})=>{const r=k(e)?P(e):void 0;return He(e,r,t)},"resolveIndentForExistingFile");var Zm=Object.defineProperty,eg=d((e,t)=>Zm(e,"name",{value:t,configurable:!0}),"t$p");const Qc=[".lintstagedrc.json",".lintstagedrc"],Zc=[".lintstagedrc.yaml",".lintstagedrc.yml",".lintstagedrc.mjs","lint-staged.config.mjs",".lintstagedrc.cjs","lint-staged.config.cjs",".lintstagedrc.js","lint-staged.config.js",".lintstagedrc.ts","lint-staged.config.ts",".lintstagedrc.mts","lint-staged.config.mts",".lintstagedrc.cts","lint-staged.config.cts"],Co=[...Qc,...Zc],tg=[/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)(pnpm|pnpm exec|npx|yarn|yarn run|npm exec|npm run|bunx|bun run|bun x)\s+lint-staged\b/,/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)lint-staged\b/],el=[".nano-staged.json",".nanostagedrc"],tl=[".nano-staged.mjs",".nano-staged.cjs",".nano-staged.js","nano-staged.config.mjs","nano-staged.config.cjs","nano-staged.config.js","nano-staged.config.mts","nano-staged.config.cts","nano-staged.config.ts"],xo=[...el,...tl],rg=[/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)(pnpm|pnpm exec|npx|yarn|yarn run|npm exec|npm run|bunx|bun run|bun x)\s+nano-staged\b/,/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)nano-staged\b/],rl=["husky","lint-staged","nano-staged"],ng=/\(is-ci \|\| husky \|\| exit 0\)\s*&&\s*/g,sg=/\bhusky(?:\s+install)?\s*&&\s*/g,og=/\s*&&\s*husky(?:\s+install)?/g,ig=/\s*\|\|\s*husky(?:\s+install)?/g,ag=[ng,sg,og,ig],nl=eg(e=>{if(e==="husky"||e==="husky install")return;let t=e;for(const r of ag)t=t.replace(r,"");return t=t.trim(),t===e?e:t||void 0},"cleanHuskyFromScript");var cg=Object.defineProperty,pn=d((e,t)=>cg(e,"name",{value:t,configurable:!0}),"o$u");const lg=/\/$/,pg=pn(e=>{let t='"$0"';for(let r=0;r<e;r+=1)t=`"$(dirname ${t})"`;return t},"nestedDirname"),ug=pn(e=>{const t=e.split("/").filter(r=>r!==""&&r!==".").length+2;return`#!/usr/bin/env sh
2
2
  { [ "$VIS_GIT_HOOKS" = "2" ]; } && set -x
3
3
  n=$(basename "$0")
4
4
  s=$(dirname "$(dirname "$0")")/$n
@@ -7,81 +7,253 @@ s=$(dirname "$(dirname "$0")")/$n
7
7
 
8
8
  { [ "\${VIS_GIT_HOOKS-}" = "0" ]; } && exit 0
9
9
 
10
- d=${ki(t)}
10
+ d=${pg(t)}
11
11
  export PATH="$d/node_modules/.bin:$PATH"
12
12
  sh -e "$s" "$@"
13
13
  c=$?
14
14
 
15
15
  [ $c != 0 ] && echo "vis - $n script failed (code $c)"
16
16
  [ $c = 127 ] && echo "vis - command not found in PATH=$PATH"
17
- exit $c`},"hookScript"),wi=We((e=cn)=>{if(process.env.VIS_GIT_HOOKS==="0")return{isError:!1,message:"skip install (git hooks disabled via VIS_GIT_HOOKS=0)"};if(e.includes(".."))return{isError:!0,message:'".." is not allowed in hooks directory path'};const t=ke("git",["rev-parse","--show-prefix"]);if(t.status===void 0||t.status===null)return{isError:!0,message:"git command not found"};if(t.status!==0)return{isError:!1,message:".git directory not found (not a git repository)"};const n=We((c="")=>d(e,"_",c),"internal"),o=t.stdout.toString().trim().replace(vi,""),a=o?`${o}/${e}/_`:`${e}/_`,r=ke("git",["config","--local","core.hooksPath"]),i=r.status===0?r.stdout?.toString().trim():"";if(i&&i!==a)return{isError:!1,message:`core.hooksPath is already set to "${i}", skipping`};const{status:s,stderr:l}=ke("git",["config","core.hooksPath",a]);if(s==null)return{isError:!0,message:"git command not found"};if(s)return{isError:!0,message:String(l)};Ve(n()),E(n(".gitignore"),"*"),E(n("h"),bi(e),{mode:493});for(const c of ln)E(n(c),`#!/usr/bin/env sh
18
- . "$(dirname "$0")/h"`,{mode:493});return{isError:!1,message:""}},"installHooks");var $i=Object.defineProperty,re=f((e,t)=>$i(e,"name",{value:t,configurable:!0}),"u$7");const Si=[".husky",".config/husky"],xi=/^\. "\$\(dirname "\$0"\)\/common\.sh"\s*/m,ji=re(e=>{for(const t of Si)if(u(d(e,t))&&we(d(e,t)).isDirectory())return t},"detectHuskyDirectory"),Ci=re((e,t)=>{const n=new Map,o=d(e,t),a=new Set(ln);for(const r of ae(o)){if(r==="_"||r===".gitignore"||r.startsWith("."))continue;const i=d(o,r);we(i).isFile()&&(!a.has(r)&&r!=="common.sh"||n.set(r,j(i)))}return n},"readHuskyHooks"),Oi=re(e=>e.replace(xi,""),"transformHookScript"),vn=re(e=>u(d(e,"pnpm-lock.yaml"))||u(d(e,"pnpm-workspace.yaml"))?"pnpm":u(d(e,"yarn.lock"))?"yarn":u(d(e,"bun.lockb"))||u(d(e,"bun.lock"))?"bun":"npm","detectPackageManager"),Pi=re((e,t)=>{const n=vn(e),o={bun:["bun","remove","husky"],npm:["npm","uninstall","husky"],pnpm:["pnpm","remove","husky"],yarn:["yarn","remove","husky"]},[a,...r]=o[n];t.info(`Removing husky package via ${n}...`);const i=ke(a,r,{cwd:e,encoding:"utf8",stdio:"pipe"});return i.status!==0?(t.info(`Warning: failed to remove husky via ${n} (${i.stderr?.trim()??"unknown error"})`),!1):!0},"uninstallHuskyPackage"),Ri=re((e,t,n)=>{const o=yn(n);if(o!==n)return o?(e[t]=o,`updated "${t}" script`):(delete e[t],`removed "${t}" script (was: "${n}")`)},"processScript"),Ii=re(e=>{const t=d(e,"package.json");if(!u(t))return{modified:!1,removedScriptReferences:[]};const n=j(t),o=JSON.parse(n),a=[],r=o.scripts;if(r)for(const[i,s]of Object.entries(r)){if(typeof s!="string")continue;const l=Ri(r,i,s);l&&a.push(l)}return a.length>0&&E(t,`${JSON.stringify(o,void 0,4)}
19
- `,"utf8"),{modified:a.length>0,removedScriptReferences:a}},"cleanPackageJsonScripts"),Sp=re((e,t,n,o={})=>{const a=ji(e),r=o.dryRun===!0;if(!a)return{isError:!0,message:"No husky installation found (.husky/ or .config/husky/)"};n.info(`Found husky at ${a}/`);const i=Ci(e,a);if(i.size===0&&n.info("No user-defined hooks found in husky directory."),!r){const c=ke("git",["config","--local","core.hooksPath"]),p=c.status===0?c.stdout?.toString().trim():"";p&&(p===".husky/_"||p.startsWith(".husky"))&&ke("git",["config","--local","--unset","core.hooksPath"]);const h=wi(t);if(h.isError)return h;h.message&&n.info(h.message)}const s=d(e,t);r||Ve(s);let l=0;for(const[c,p]of i){if(c==="common.sh"){r?n.info(" (would copy) common.sh"):(E(d(s,c),p,{mode:493}),n.info(" Copied common.sh"));continue}if(r)n.info(` (would migrate) ${c}`);else{const h=Oi(p);E(d(s,c),h,{mode:493}),n.info(` Migrated ${c}`)}l+=1}if(r)n.info(" (would remove) husky npm package and clean package.json scripts"),n.info(` (would remove) ${a}/ directory`);else{Pi(e,n);const c=Ii(e);if(c.modified){n.info("Updated package.json scripts:");for(const h of c.removedScriptReferences)n.info(` ${h}`)}const p=d(e,a);lt(p,{force:!0,recursive:!0}),n.info(`Removed ${a}/`)}return{isError:!1,message:`${r?"would migrate":"Migration complete:"} ${l} hook${l===1?"":"s"} ${r?"from":"migrated from"} ${a}/ to ${t}/`}},"migrateFromHusky");var Bi=Object.defineProperty,ie=f((e,t)=>Bi(e,"name",{value:t,configurable:!0}),"s$7");const Vi={server:{cache:!1,interactive:!1,persistent:!0,runInCI:!1},utility:{cache:!1,runInCI:!1}},Ai=ie(e=>{const t=e.preset??e.options?.preset;if(!t)return e;const n=Vi[t];if(!n)return e;const{cache:o,...a}=n;return{...e,cache:e.cache??o,options:{...a,...e.options}}},"applyPreset"),Ei=ie(()=>{const e=fo();return e==="darwin"?"macos":e==="win32"?"windows":"linux"},"detectCurrentOs"),xp=ie((e,t,n=!0)=>{const o=e?.runInCI??!0;return o===!0||o==="always"?!0:o===!1?!t:o==="affected"?!t||n:!0},"shouldRunInCI"),jp=ie((e,t)=>{if(t===!1)return{};const n=t===!0?Ti("production"):Array.isArray(t)?t:[t],o={};for(const a of n)Object.assign(o,Di(e,a));return o},"loadEnvFile"),Ti=ie(e=>{const t=[".env"];return e&&t.push(`.env.${e}`),e!=="test"&&t.push(".env.local"),e&&e!=="test"&&t.push(`.env.${e}.local`),t},"resolveEnvCascade"),Di=ie((e,t)=>{const n=t.startsWith("/")?t:d(e,t);if(!u(n))return{};let o;try{o=j(n)}catch{return{}}const a={};for(const r of o.split(/\r?\n/)){const i=r.trim();if(i===""||i.startsWith("#"))continue;const s=i.indexOf("=");if(s===-1)continue;const l=i.slice(0,s).trim();if(l==="")continue;let c=i.slice(s+1).trim();(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),a[l]=c}return a},"loadSingleEnvFile"),Cp=ie((e,t=Ei())=>{if(e)return t==="windows"&&e.windowsShell?e.windowsShell:(t==="linux"||t==="macos")&&e.unixShell?e.unixShell:e.shell},"resolveTargetShell"),Mi=ie(e=>{if(e==="run")return!1;if(e==="build"||e==="test")return!0},"defaultCacheForType");var Ni=Object.defineProperty,T=f((e,t)=>Ni(e,"name",{value:t,configurable:!0}),"c$7");const Wi=/\/+$/,Fi=/\/\*\*$/,Li=/\/\*\/\*$/,_i=/^['"]|['"]$/g,kn=/node_modules/,bn=/\.git/,be=T(e=>{try{return U(e)}catch{return}},"readJsonFileSafe"),zi=T((e,t,n)=>{for(const o of Qt(e,{includeFiles:!1,includeSymlinks:!1,skip:[kn,bn]}))if(o.path!==e&&u(d(o.path,"package.json"))){const a=o.path.slice(e.length+1);n.push(`${t}/${a}`)}},"scanDirectoryRecursive"),Ui=T((e,t,n)=>{const o=t.slice(0,-2),a=st(e,o);if(u(a))for(const r of Qt(a,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[kn,bn]}))r.path!==a&&u(d(r.path,"package.json"))&&n.push(d(o,r.name))},"resolveSimpleGlob"),Ji=T((e,t,n)=>{const o=t.replace(Fi,"").replace(Li,""),a=st(e,o);u(a)&&zi(a,o,n)},"resolveDoubleGlob"),Gi=T((e,t,n)=>{const o=st(e,t);u(o)&&u(d(o,"package.json"))&&n.push(t)},"resolveExactDirectory"),wn=T((e,t)=>{const n=[];for(const o of t){const a=o.replace(Wi,"");a.startsWith("!")||(a.endsWith("/*")?Ui(e,a,n):a.endsWith("/**")||a.endsWith("/*/*")?Ji(e,a,n):Gi(e,a,n))}return n},"resolveWorkspacePatterns"),$n=T((e,t,n=new Set)=>{if(!e)return[];const o=[];for(const a of e){if(typeof a=="object"&&a&&"group"in a){const r=a.group;if(n.has(r))throw new Error(`Cycle detected in vis.config taskGroups: ${[...n,r].join(" → ")}`);const i=t?.[r];if(!i)throw new Error(`Unknown taskGroup "${r}" referenced in dependsOn. Declare it under \`taskGroups\` in vis.config.ts.`);o.push(...$n(i,t,new Set([...n,r])));continue}o.push(a)}return o},"expandTaskGroups"),ft=T(e=>{if(Array.isArray(e)){if(e.length===0)throw new Error('Invalid package.json `workspaces`: empty array. Add at least one pattern like "packages/*" or remove the field.');for(const t of e)if(typeof t!="string"||t.trim().length===0)throw new TypeError(`Invalid package.json \`workspaces\` entry: expected a non-empty glob string, got ${JSON.stringify(t)}.`);return e}if(e&&typeof e=="object"){const{packages:t}=e;if(t===void 0)throw new Error('Invalid package.json `workspaces`: object form requires a `packages` array (e.g. `{ "packages": ["packages/*"] }`).');if(!Array.isArray(t))throw new TypeError(`Invalid package.json \`workspaces.packages\`: expected an array of glob strings, got ${typeof t}.`);return ft(t)}throw new TypeError(`Invalid package.json \`workspaces\`: expected an array or { packages: string[] } object, got ${typeof e}.`)},"validateWorkspacesField"),Sn=T(e=>{const t=d(e,"pnpm-workspace.yaml");if(!u(t))return;const n=j(t),o=[];let a=!1;for(const r of n.split(`
20
- `)){const i=r.trim();if(i==="packages:"){a=!0;continue}if(a){if(i.startsWith("- ")){const s=i.slice(2).replaceAll(_i,"");o.push(s)}else if(i&&!i.startsWith("#"))break}}return o.length>0?o:void 0},"readPnpmWorkspacePatterns"),Pt="@filegroup:",Hi=T((e,t,n)=>{if(!e)return!0;if(e.projectType&&e.projectType!==n)return!1;if(e.tags&&e.tags.length>0){const o=new Set(t?.tags);if(!e.tags.some(a=>o.has(a)))return!1}if(e.layer){const o=Array.isArray(e.layer)?e.layer:[e.layer];if(t?.layer===void 0||!o.includes(t.layer))return!1}if(e.stack){const o=Array.isArray(e.stack)?e.stack:[e.stack];if(t?.stack===void 0||!o.includes(t.stack))return!1}if(e.language){const o=Array.isArray(e.language)?e.language:[e.language];if(t?.language===void 0||!o.includes(t.language))return!1}return!0},"scopeMatches"),qi=T((e,t,n)=>{const o={};for(const[a,r]of Object.entries(e.targetDefaults??{}))o[a]=Me(void 0,r);for(const a of e.taskDefaults??[])if(Hi(a.scope,t,n))for(const[r,i]of Object.entries(a.targets))o[r]=Me(o[r],i);return o},"collectTargetDefaults"),Ki=T((e,t)=>{if(!e)return e;const n=[];for(const o of e){if(typeof o=="string"&&o.startsWith(Pt)){const a=o.slice(Pt.length),r=t?.[a];r&&n.push(...r);continue}n.push(o)}return n},"resolveFileGroupInputs"),Rt=T((e,t,n,o,a)=>{const r={...Me(o,n),options:{...o?.options,...n?.options}};t&&r.command===void 0&&r.executor===void 0&&(r.command=t),r.inputs&&(r.inputs=Ki(r.inputs,a));const i=Ai(r);return i.cache===void 0&&(i.cache=Mi(i.type)),i},"mergeTarget"),Yi=T((e,t,n,o)=>{const a={},r=new Set;for(const[i,s]of Object.entries(e??{}))r.add(i),a[i]=Rt(i,s,t?.[i],n[i],o);for(const[i,s]of Object.entries(t??{}))r.has(i)||(a[i]=Rt(i,void 0,s,n[i],o));return a},"createTargetsFromScripts"),Qi=T((e,t)=>{if(e===void 0&&t===void 0)return;const n=new Set([...Object.keys(e??{}),...Object.keys(t??{})]),o={};for(const a of n)o[a]=Me(e?.[a],t?.[a]);return o},"mergeProjectTargets"),Xi=T((e,t={},n)=>{const o={},a=new Map,r=new Map,i=Sn(e),s=be(d(e,"package.json"));let l;if(i?l=i:s?.workspaces!==void 0&&(l=ft(s.workspaces)),!l)throw new Error("No workspace configuration found. Expected pnpm-workspace.yaml or package.json workspaces field.");const c=wn(e,l);for(const p of c){const h=d(e,p,"package.json"),v=be(h);if(!v?.name)continue;r.set(v.name,v);const $=d(e,p,"project.json"),P=be($);let R="library";P?.projectType?R=P.projectType:v.bin!==void 0&&(R="application");const G=qi(t,P,R),xe=Qi(P?.targets,n?.get(p)?.targets),le=Yi(v.scripts,xe,G,t.fileGroups);a.set(v.name,le);const ce={};for(const[de,je]of Object.entries(le)){const{options:ye,preset:Ke,type:Ye,...Ce}=je,Te=je.dependsOn?$n(je.dependsOn,t.taskGroups):void 0;ce[de]={...Ce,...Te?{dependsOn:Te}:{},...ye?{options:ye}:{}}}o[v.name]={implicitDependencies:P?.implicitDependencies,language:P?.language,layer:P?.layer,owners:P?.owners,project:P?.project,projectType:R,root:p,sourceRoot:P?.sourceRoot??`${p}/src`,stack:P?.stack,tags:P?.tags,targets:ce}}return{config:t,packageJsons:r,projectOptions:a,workspace:{projects:o}}},"discoverWorkspace"),Op=T((e,t,n)=>{const o={},a={},r=new Set(Object.keys(t.projects));for(const[i,s]of Object.entries(t.projects)){o[i]={data:s,name:i,type:s.projectType??"library"},a[i]=[];const l=n?.get(i)??be(d(e,s.root,"package.json"));if(!l)continue;const c=[[l.dependencies,"static"],[l.devDependencies,"devDependency"],[l.peerDependencies,"peerDependency"]],p=new Set;for(const[h,v]of c)if(h)for(const $ of Object.keys(h))r.has($)&&!p.has($)&&(p.add($),a[i]?.push({source:i,target:$,type:v}))}return{dependencies:a,nodes:o}},"buildProjectGraph"),Pp=T(async e=>{const{loadVisTaskConfig:t}=await import("./config.js"),n=Sn(e),o=be(d(e,"package.json"));let a;if(n?a=n:o?.workspaces!==void 0&&(a=ft(o.workspaces)),!a)return new Map;const r=wn(e,a),i=new Map;return await Promise.all(r.map(async s=>{const l=be(d(e,s,"package.json"));if(!l?.name)return;const c=await t(e,d(e,s),l.name);c!==void 0&&i.set(s,c)})),i},"loadVisTaskConfigsForWorkspace");var Zi=Object.defineProperty,es=f((e,t)=>Zi(e,"name",{value:t,configurable:!0}),"t$9");const B=es((e,t)=>{if(!u(e))return;const n=`${e}.bak`;u(n)||(t?.backupsCreated.includes(n)??!1)||(co(e,n),t&&t.backupsCreated.push(n))},"backupFile");var ts=Object.defineProperty,ze=f((e,t)=>ts(e,"name",{value:t,configurable:!0}),"e$g");const J=ze(e=>{try{const t=j(e);return JSON.parse(t)}catch{return}},"readJsonFile"),Ue=ze(e=>{if(!u(e))return!1;try{return JSON.parse(j(e)),!0}catch{return!1}},"isJsonFile"),ns=/\n([ \t]+)"/,mt=ze(e=>ns.exec(e)?.[1]?.length??4,"detectJsonIndent"),os=ze((e,t,n)=>{if(!u(e))return!1;const o=j(e);let a;try{a=JSON.parse(o)}catch{return!1}const r=t(a);if(r===void 0)return!1;const i=mt(o);return n&&B(e,n),E(e,`${JSON.stringify(r,void 0,i)}
21
- `,"utf8"),!0},"editJsonFile");var as=Object.defineProperty,se=f((e,t)=>as(e,"name",{value:t,configurable:!0}),"f$5");const rs=/\blint-staged\b/g,is=se((e,t)=>{let n=!1;const o={...e};for(const[a,r]of Object.entries(o)){if(typeof r!="string")continue;let i=yn(r);i&&(i=i.replaceAll(rs,"vis staged").trim()||void 0),i!==r&&(i?o[a]=i:delete o[a],n=!0,t.rewrittenScriptCount+=1)}return{modified:n,scripts:o}},"rewriteScripts"),xn=se((e,t,n,o)=>{const a=d(e,"package.json");u(a)&&os(a,r=>{let i=!1;for(const l of hn){const c=r.dependencies,p=r.devDependencies;c?.[l]&&(delete c[l],i=!0,o.removedPackageCount+=1),p?.[l]&&(delete p[l],i=!0,o.removedPackageCount+=1)}if(Object.keys(n).length>0)switch(t){case"bun":{const l=r.workspaces,c=l&&!Array.isArray(l)?l:void 0,p={...c?.catalog??r.catalog};for(const[v,$]of Object.entries(n))p[v]=$;c?.catalog==null?r.catalog=p:c.catalog=p;const h=r.overrides??{};for(const v of Object.keys(n))h[v]="catalog:";r.overrides=h,i=!0;break}case"npm":{const l=r.overrides??{};r.overrides={...l,...n},i=!0;break}case"pnpm":{const l=r.pnpm??{},c=l.overrides??{};l.overrides={...c,...n},r.pnpm=l,i=!0;break}case"yarn":{const l=r.resolutions??{};r.resolutions={...l,...n},i=!0;break}}const s=r.scripts;if(s){const l=is(s,o);l.modified&&(r.scripts=l.scripts,i=!0)}return i?r:void 0})},"rewritePackageJson"),ss=se((e,t,n,o)=>{try{const{workspace:a}=Xi(e);for(const r of Object.values(a.projects)){const i=d(e,r.root);xn(i,t,n,o)}}catch{}},"migrateMonorepoPackages"),ls=se(e=>e.startsWith("- ")||e!==""&&!e.includes(":")&&!e.startsWith("#"),"isCatalogSectionEnd"),cs=se(e=>{let t=!1,n="";const o=new Set;for(const a of e){const r=a.trim();if(r==="catalog:"){t=!0;continue}if(!t)continue;if(ls(r))break;const i=r.includes(":")?r.split(":")[0]?.trim():void 0;i&&(o.add(i),n=n||a.slice(0,a.indexOf(r)))}return{entries:o,indent:n||" "}},"parseCatalogEntries"),ds=se((e,t,n)=>{const o=[];let a=!1,r=!1;for(let i=0;i<e.length;i+=1){const s=e[i],l=s.trim();if(o.push(s),l==="catalog:"){r=!0;continue}if(r&&!a){const c=e[i+1]?.trim()??"";(!c.includes(":")||c.startsWith("- ")||!c||c==="catalog:")&&(o.push(...t),a=!0,r=!1)}}return a||(n.includes("catalog:")||o.push("catalog:"),o.push(...t)),o},"insertCatalogEntries"),ps=se((e,t)=>{const n=d(e,"pnpm-workspace.yaml");if(!u(n)||Object.keys(t).length===0)return;const o=j(n),a=o.split(`
22
- `),{entries:r,indent:i}=cs(a),s=[];for(const[c,p]of Object.entries(t))r.has(c)||s.push(`${i}${c}: "${p}"`);if(s.length===0)return;const l=ds(a,s,o);B(n),E(n,l.join(`
23
- `),"utf8")},"updatePnpmWorkspaceCatalog"),It=se((e,t,n,o,a,r)=>{const i=n.overrides??{};if(o.dryRun){a.info("[dry-run] Would rewrite package.json files (remove husky/lint-staged, rewrite scripts)"),Object.keys(i).length>0&&a.info(`[dry-run] Would add overrides: ${JSON.stringify(i)}`);return}xn(e,t,i,r),a.info("Rewritten root package.json"),ss(e,t,i,r),t==="pnpm"&&ps(e,i)},"migrateDeps");var us=Object.defineProperty,Je=f((e,t)=>us(e,"name",{value:t,configurable:!0}),"t$8");const H=Je(()=>({backupsCreated:[],gitHooksConfigured:!1,inlinedLintStagedConfigCount:0,manualSteps:[],mergedStagedConfigCount:0,perMigration:{},removedConfigCount:0,removedPackageCount:0,rewrittenScriptCount:0,warnings:[]}),"createMigrationReport"),D=Je((e,t)=>{!e||e.warnings.includes(t)||e.warnings.push(t)},"addMigrationWarning"),F=Je((e,t)=>{!e||e.manualSteps.includes(t)||e.manualSteps.push(t)},"addManualStep"),q=Je((e,t,n,o=1)=>{const a=e.perMigration[t]??{removedConfigCount:0,removedPackageCount:0,rewrittenScriptCount:0};a[n]+=o,e.perMigration[t]=a,e[n]+=o},"bumpPerMigration");var fs=Object.defineProperty,Q=f((e,t)=>fs(e,"name",{value:t,configurable:!0}),"d$3");const ms=["gitleaks.toml",".gitleaks.toml"],gs=["gitleaks-report.json",".gitleaks-report.json","baseline.json"],Ge=Q(e=>ms.find(t=>u(d(e,t))),"detectGitleaksConfig"),gt=Q(e=>{const t=d(e,".gitleaksignore");return u(t)?t:void 0},"detectGitleaksIgnore"),ht=Q(e=>{for(const t of gs){const n=d(e,t);if(u(n))try{const o=JSON.parse(j(n));if(Array.isArray(o)&&o.length>0&&typeof o[0]=="object"&&o[0]!==null&&"RuleID"in o[0])return n}catch{}}},"detectGitleaksBaseline"),hs=Q(e=>e.map(t=>({description:t.Description??"",endColumn:t.EndColumn??0,endLine:t.EndLine??t.StartLine??0,entropy:t.Entropy??0,file:t.File??"",match:t.Match??"",ruleId:t.RuleID??"",secret:t.Secret??"",startColumn:t.StartColumn??0,startLine:t.StartLine??0,tags:t.Tags??[]})),"convertBaseline"),ys=Q((e,t,n,o)=>{const a=ht(e);if(!a)return;const r=d(e,".secrets-baseline.json");if(u(r)&&a!==r){D(o,`.secrets-baseline.json already exists — leaving ${a} in place`);return}const i=J(a);if(!Array.isArray(i)){D(o,`Could not parse ${a} as a gitleaks baseline`);return}const s=hs(i);if(t){n.info(`[dry-run] Would convert ${a} -> ${r} (${String(s.length)} findings)`);return}B(a,o),A(r,`${JSON.stringify(s,null,4)}
24
- `),n.info(`Converted ${a} -> ${r} (${String(s.length)} findings)`),q(o,"gitleaks","rewrittenScriptCount")},"migrateBaseline"),vs=Q((e,t,n,o)=>{const a=d(e,"package.json");if(!u(a))return;const r=J(a);if(!r)return;const i=Ge(e),s=i?`vis secrets --config ${i}`:"vis secrets";let l=!1;if(r.scripts){for(const[c,p]of Object.entries(r.scripts))if(typeof p=="string"&&/\bgitleaks\b/.test(p)){const h=p.replaceAll(/\bgitleaks(?:\s+(?:detect|protect))?\b[^\n&|;]*/g,s).trim();h!==p&&(r.scripts[c]=h,l=!0,n.info(` scripts.${c}: "${p}" -> "${h}"`),q(o,"gitleaks","rewrittenScriptCount"))}}if(r.devDependencies){const c=r.devDependencies;for(const p of["gitleaks","@gitleaks/cli"])p in c&&(delete c[p],l=!0,q(o,"gitleaks","removedPackageCount"),n.info(` removed devDependency: ${p}`))}if(l){if(t){n.info(`[dry-run] Would update ${a}`);return}B(a,o),A(a,`${JSON.stringify(r,null,4)}
25
- `)}},"rewriteScripts"),ks=Q((e,t,n,o)=>{const a=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],r=Ge(e),i=r?`vis secrets --staged --config ${r}`:"vis secrets --staged";for(const s of a){const l=d(e,s);if(!u(l))continue;const c=j(l);if(!/\bgitleaks\b/.test(c))continue;const p=c.replaceAll(/\bgitleaks(?:\s+(?:detect|protect))?\b[^\n&|;]*/g,i);if(t){n.info(`[dry-run] Would rewrite ${l}`);continue}B(l,o),A(l,p),o.gitHooksConfigured=!0,n.info(`Rewrote gitleaks invocation in ${s}`)}},"rewriteHooks"),bs=/^([^:#][^:]*):([^:]+):(\d+)$/,ws=Q(e=>{const t=bs.exec(e.trim());if(!t)return;const[,n,o,a]=t,r=Number.parseInt(a??"0",10);return{description:"",endColumn:0,endLine:r,entropy:0,file:n??"",match:"",ruleId:o??"",secret:"",startColumn:0,startLine:r,tags:[]}},"fingerprintToBaselineEntry"),$s=Q((e,t,n,o)=>{const a=gt(e);if(!a)return;const r=j(a).split(/\r?\n/).map(p=>p.trim()).filter(p=>p.length>0&&!p.startsWith("#")).map(p=>ws(p)).filter(p=>p!==void 0);r.length===0&&D(o,`${a} contained no recognisable fingerprint lines — deleting it.`);const i=d(e,".secrets-baseline.json"),s=u(i)?J(i)??[]:[],l=new Set(s.map(p=>`${p.file}:${p.ruleId}:${String(p.startLine)}`)),c=[...s];for(const p of r){const h=`${p.file}:${p.ruleId}:${String(p.startLine)}`;l.has(h)||(l.add(h),c.push(p))}if(t){n.info(`[dry-run] Would merge ${String(r.length)} .gitleaksignore fingerprint(s) into ${i}, then delete ${a}.`);return}B(a,o),u(i)&&B(i,o),A(i,`${JSON.stringify(c,null,4)}
26
- `),Fe(a),n.info(`Merged ${String(r.length)} fingerprint(s) from ${a} into ${i}; removed .gitleaksignore.`),q(o,"gitleaks","rewrittenScriptCount",r.length)},"migrateIgnoreFile"),Bt=Q((e,t,n,o)=>{const a=Ge(e),r=gt(e);return a??r??ht(e)?(a&&(n.info(`Keeping ${a} as-is (compatible with vis secrets --config).`),F(o,`Run \`vis secrets --config ${a}\` or rename to .gitleaksignore-compatible defaults.`)),r&&$s(e,t.dryRun,n,o),ys(e,t.dryRun,n,o),vs(e,t.dryRun,n,o),ks(e,t.dryRun,n,o),F(o,"Review CI workflows (.github/workflows/*.yml) for gitleaks-action calls — replace with `vis secrets`."),!0):(t.silent||n.info("No gitleaks artifacts found — nothing to migrate."),!1)},"migrateGitleaks");var Ss=Object.defineProperty,te=f((e,t)=>Ss(e,"name",{value:t,configurable:!0}),"g$4");const xs=["kingfisher-baseline.yaml",".kingfisher-baseline.yaml","kingfisher-baseline.yml",".kingfisher-baseline.yml"],js=["kingfisher-rules.yml","kingfisher-rules.yaml",".kingfisher-rules.yml",".kingfisher-rules.yaml"],yt=te(e=>xs.find(t=>u(d(e,t))),"detectKingfisherBaseline"),He=te(e=>js.find(t=>u(d(e,t))),"detectKingfisherRules"),Cs=te(e=>{const t=[];let n={};for(const o of e.split(/\r?\n/)){const a=o.replace(/#.*$/,"");(/^\s*-\s*filepath\s*:/.test(a)||/^\s*-\s*$/.test(a))&&(n.filepath&&typeof n.linenum=="number"&&n.fingerprint&&t.push(n),n={});const r=/filepath\s*:\s*(.+?)\s*$/.exec(a);if(r?.[1]){n.filepath=r[1].replaceAll(/^["']|["']$/g,"");continue}const i=/fingerprint\s*:\s*(.+?)\s*$/.exec(a);if(i?.[1]){n.fingerprint=i[1].replaceAll(/^["']|["']$/g,"");continue}const s=/linenum\s*:\s*(\d+)/.exec(a);s?.[1]&&(n.linenum=Number.parseInt(s[1],10))}return n.filepath&&typeof n.linenum=="number"&&n.fingerprint&&t.push(n),t},"parseKingfisherBaseline"),Os=te(e=>({_kingfisherMigration:{legacyFingerprint:e.fingerprint,note:"Kingfisher xxhash — regenerate by running `vis secrets --update-baseline`."},description:"",endColumn:0,endLine:e.linenum,entropy:0,file:e.filepath,match:"",ruleId:"",secret:"",startColumn:0,startLine:e.linenum,tags:[]}),"toPlaceholderEntry"),Ps=te((e,t,n,o)=>{const a=yt(e);if(!a)return;const r=d(e,a);let i;try{i=Cs(j(r))}catch(c){const p=c instanceof Error?c.message:String(c);D(o,`Could not parse ${a} as a Kingfisher baseline: ${p}`);return}if(i.length===0){D(o,`${a} contained no recognisable records — leaving it in place for manual review.`);return}const s=d(e,".secrets-baseline.json");if(u(s)){D(o,`.secrets-baseline.json already exists — leaving Kingfisher baseline at ${a} for manual merge.`);return}const l=i.map(c=>Os(c));if(t){n.info(`[dry-run] Would convert ${a} -> .secrets-baseline.json (${String(l.length)} placeholder finding(s))`),F(o,"Run `vis secrets --update-baseline` after migration — Kingfisher xxhash fingerprints aren't interchangeable with our content-hash.");return}B(r,o),A(s,`${JSON.stringify(l,null,4)}
27
- `),n.info(`Converted ${a} -> .secrets-baseline.json (${String(l.length)} placeholder finding(s))`),F(o,"Run `vis secrets --update-baseline` — the converted entries are placeholders until the scanner computes real fingerprints."),q(o,"kingfisher","rewrittenScriptCount")},"migrateBaseline"),jn=/\bkingfisher(?:\s+(?:scan|validate|rules|update|manage-baseline|report|github|gitlab|bitbucket))?\b[^\n&|;]*/g,Rs=te((e,t,n,o)=>{const a=d(e,"package.json");if(!u(a))return;const r=J(a);if(!r)return;const i=He(e),s=i?`vis secrets --config ${i}`:"vis secrets";let l=!1;if(r.scripts)for(const[c,p]of Object.entries(r.scripts)){if(typeof p!="string"||!/\bkingfisher\b/.test(p))continue;const h=p.replaceAll(jn,v=>v.includes("validate")?`${s} --validate`:s).trim();h!==p&&(r.scripts[c]=h,l=!0,n.info(` scripts.${c}: "${p}" -> "${h}"`),q(o,"kingfisher","rewrittenScriptCount"))}if(r.devDependencies){const c=r.devDependencies;for(const p of["kingfisher","@mongodb/kingfisher","kingfisher-scanner"])p in c&&(delete c[p],l=!0,q(o,"kingfisher","removedPackageCount"),n.info(` removed devDependency: ${p}`))}if(l){if(t){n.info(`[dry-run] Would update ${a}`);return}B(a,o),A(a,`${JSON.stringify(r,null,4)}
28
- `)}},"rewriteScripts"),Is=te((e,t,n,o)=>{const a=He(e),r=a?`vis secrets --staged --config ${a}`:"vis secrets --staged";for(const i of Cn){const s=d(e,i);if(!u(s))continue;const l=j(s);if(!/\bkingfisher\b/.test(l))continue;const c=l.replaceAll(jn,r);if(t){n.info(`[dry-run] Would rewrite ${s}`);continue}B(s,o),A(s,c),o.gitHooksConfigured=!0,n.info(`Rewrote kingfisher invocation in ${i}`)}},"rewriteHooks"),Cn=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],Vt=te(e=>{if(!u(e))return!1;try{return/\bkingfisher\b/.test(j(e))}catch{return!1}},"hasKingfisherRef"),At=te((e,t,n,o)=>{const a=yt(e),r=He(e),i=Vt(d(e,"package.json")),s=Cn.some(l=>Vt(d(e,l)));return(a??r)||i||s?(r&&(n.info(`Found custom Kingfisher ruleset at ${r} — keeping it for now.`),F(o,`Convert ${r} to gitleaks-shaped JSON using \`packages/tooling/secret-scanner/scripts/kingfisher-converter.mjs\`, then point \`vis secrets --config\` at the result.`)),a&&Ps(e,t.dryRun,n,o),Rs(e,t.dryRun,n,o),Is(e,t.dryRun,n,o),F(o,"Replace `# kingfisher:ignore` markers with `# secret-scanner:allow` (or keep `# gitleaks:allow` — the scanner accepts both)."),F(o,"Review CI workflows (.github/workflows/*.yml) for Kingfisher action/docker invocations — replace with `vis secrets`."),!0):(t.silent||n.info("No Kingfisher artifacts found — nothing to migrate."),!1)},"migrateKingfisher");var Bs=Object.defineProperty,M=f((e,t)=>Bs(e,"name",{value:t,configurable:!0}),"r$8");const Vs=/\bstaged\s*:/,Et=/(defineConfig\(\{)/,Tt=/(export\s+default\s+\{)/;M(e=>pt.some(t=>u(d(e,t))),"hasStandaloneLintStagedConfig");const As=M(e=>{for(const n of fn)if(u(d(e,n)))return!0;const t=d(e,".lintstagedrc");return u(t)&&!Ue(t)},"hasUnsupportedLintStagedConfig"),Es=M(e=>{const t=Ae(e);if(!t)return!1;const n=j(t);return Vs.test(n)},"hasStagedConfigInVisConfig"),On=M(e=>{const t=d(e,"package.json");if(u(t)&&J(t)?.["lint-staged"])return"package.json";for(const n of pt)if(u(d(e,n)))return n},"detectLintStagedConfig"),Ts=M(e=>J(d(e,"package.json"))?.["lint-staged"],"extractLintStagedFromPackageJson"),Ds=M(e=>J(e),"parseLintStagedJsonFile"),nt=M(e=>` staged: {
29
- ${Object.entries(e).map(([t,n])=>{const o=Array.isArray(n)?`[${n.map(a=>JSON.stringify(a)).join(", ")}]`:JSON.stringify(n);return` ${JSON.stringify(t)}: ${o}`}).join(`,
17
+ exit $c`},"hookScript"),dg=pn((e=Hc)=>{if(process.env.VIS_GIT_HOOKS==="0")return{isError:!1,message:"skip install (git hooks disabled via VIS_GIT_HOOKS=0)"};if(e.includes(".."))return{isError:!0,message:'".." is not allowed in hooks directory path'};const t=St("git",["rev-parse","--show-prefix"]);if(t.status===null)return{isError:!0,message:"git command not found"};if(t.status!==0)return{isError:!1,message:".git directory not found (not a git repository)"};const r=pn((l="")=>y(e,"_",l),"internal"),n=t.stdout.toString().trim().replace(lg,""),s=n?`${n}/${e}/_`:`${e}/_`,o=St("git",["config","--local","core.hooksPath"]),i=o.status===0?o.stdout?.toString().trim():"";if(i&&i!==s)return{isError:!1,message:`core.hooksPath is already set to "${i}", skipping`};const{status:a,stderr:c}=St("git",["config","core.hooksPath",s]);if(a===null)return{isError:!0,message:"git command not found"};if(a)return{isError:!0,message:String(c)};rt(r()),ue(r(".gitignore"),"*"),ue(r("h"),ug(e),{mode:493});for(const l of zc)ue(r(l),`#!/usr/bin/env sh
18
+ . "$(dirname "$0")/h"`,{mode:493});return{isError:!1,message:""}},"installHooks");var fg=Object.defineProperty,ut=d((e,t)=>fg(e,"name",{value:t,configurable:!0}),"f$r");const mg=[".husky",".config/husky"],gg=/^\. "\$\(dirname "\$0"\)\/common\.sh"\s*/m,hg=ut(e=>{for(const t of mg)if(k(y(e,t))&&Kt(y(e,t)).isDirectory())return t},"detectHuskyDirectory"),yg=ut((e,t)=>{const r=new Map,n=y(e,t),s=new Set(zc);for(const o of Ge(n)){if(o==="_"||o===".gitignore"||o.startsWith("."))continue;const i=y(n,o);Kt(i).isFile()&&(!s.has(o)&&o!=="common.sh"||r.set(o,P(i)))}return r},"readHuskyHooks"),vg=ut(e=>e.replace(gg,""),"transformHookScript"),sl=ut(e=>k(y(e,"pnpm-lock.yaml"))||k(y(e,"pnpm-workspace.yaml"))?"pnpm":k(y(e,"yarn.lock"))?"yarn":k(y(e,"bun.lockb"))||k(y(e,"bun.lock"))?"bun":"npm","detectPackageManager"),bg=ut((e,t)=>{const r=sl(e),n={bun:["bun","remove","husky"],npm:["npm","uninstall","husky"],pnpm:["pnpm","remove","husky"],yarn:["yarn","remove","husky"]},[s,...o]=n[r];t.info(`Removing husky package via ${r}...`);const i=St(s,o,{cwd:e,encoding:"utf8",stdio:"pipe"});return i.status!==0?(t.info(`Warning: failed to remove husky via ${r} (${i.stderr?.trim()??"unknown error"})`),!1):!0},"uninstallHuskyPackage"),kg=ut((e,t,r)=>{const n=nl(r);if(n!==r)return n?(e[t]=n,`updated "${t}" script`):(delete e[t],`removed "${t}" script (was: "${r}")`)},"processScript"),$g=ut((e,t)=>{const r=y(e,"package.json");if(!k(r))return{modified:!1,removedScriptReferences:[]};const n=P(r),s=JSON.parse(n),o=[],i=s.scripts;if(i)for(const[a,c]of Object.entries(i)){if(typeof c!="string")continue;const l=kg(i,a,c);l&&o.push(l)}if(o.length>0){const a=He(r,n,{defaultIndent:" ",useEditorconfig:t});ue(r,`${JSON.stringify(s,void 0,a)}
19
+ `,"utf8")}return{modified:o.length>0,removedScriptReferences:o}},"cleanPackageJsonScripts"),OE=ut((e,t,r,n={})=>{const s=hg(e),o=n.dryRun===!0;if(!s)return{isError:!0,message:"No husky installation found (.husky/ or .config/husky/)"};r.info(`Found husky at ${s}/`);const i=yg(e,s);if(i.size===0&&r.info("No user-defined hooks found in husky directory."),!o){const l=St("git",["config","--local","core.hooksPath"]),p=l.status===0?l.stdout?.toString().trim():"";p&&(p===".husky/_"||p.startsWith(".husky"))&&St("git",["config","--local","--unset","core.hooksPath"]);const f=dg(t);if(f.isError)return f;f.message&&r.info(f.message)}const a=y(e,t);o||rt(a);let c=0;for(const[l,p]of i){if(l==="common.sh"){o?r.info(" (would copy) common.sh"):(ue(y(a,l),p,{mode:493}),r.info(" Copied common.sh"));continue}if(o)r.info(` (would migrate) ${l}`);else{const f=vg(p);ue(y(a,l),f,{mode:493}),r.info(` Migrated ${l}`)}c+=1}if(o)r.info(" (would remove) husky npm package and clean package.json scripts"),r.info(` (would remove) ${s}/ directory`);else{bg(e,r);const l=$g(e,n.useEditorconfig);if(l.modified){r.info("Updated package.json scripts:");for(const f of l.removedScriptReferences)r.info(` ${f}`)}const p=y(e,s);jo(p,{force:!0,recursive:!0}),r.info(`Removed ${s}/`)}return{isError:!1,message:`${o?"would migrate":"Migration complete:"} ${c} hook${c===1?"":"s"} ${o?"from":"migrated from"} ${s}/ to ${t}/`}},"migrateFromHusky");var wg=Object.defineProperty,ot=d((e,t)=>wg(e,"name",{value:t,configurable:!0}),"c$C");const No=Symbol.for("yaml.alias"),Ys=Symbol.for("yaml.document"),lt=Symbol.for("yaml.map"),ol=Symbol.for("yaml.pair"),Je=Symbol.for("yaml.scalar"),er=Symbol.for("yaml.seq"),Pe=Symbol.for("yaml.node.type"),tr=ot(e=>!!e&&typeof e=="object"&&e[Pe]===No,"isAlias"),rr=ot(e=>!!e&&typeof e=="object"&&e[Pe]===Ys,"isDocument"),Br=ot(e=>!!e&&typeof e=="object"&&e[Pe]===lt,"isMap"),pe=ot(e=>!!e&&typeof e=="object"&&e[Pe]===ol,"isPair"),te=ot(e=>!!e&&typeof e=="object"&&e[Pe]===Je,"isScalar"),Mr=ot(e=>!!e&&typeof e=="object"&&e[Pe]===er,"isSeq");function ae(e){if(e&&typeof e=="object")switch(e[Pe]){case lt:case er:return!0}return!1}d(ae,"i$p");ot(ae,"isCollection");function ce(e){if(e&&typeof e=="object")switch(e[Pe]){case No:case lt:case Je:case er:return!0}return!1}d(ce,"A$i");ot(ce,"isNode");const il=ot(e=>(te(e)||ae(e))&&!!e.anchor,"hasAnchor");var Sg=Object.defineProperty,Tt=d((e,t)=>Sg(e,"name",{value:t,configurable:!0}),"r$x");const $e=Symbol("break visit"),al=Symbol("skip children"),Ue=Symbol("remove node");function Dt(e,t){const r=Io(t);rr(e)?vt(null,e.contents,r,Object.freeze([e]))===Ue&&(e.contents=null):vt(null,e,r,Object.freeze([]))}d(Dt,"S$e");Tt(Dt,"visit");Dt.BREAK=$e;Dt.SKIP=al;Dt.REMOVE=Ue;function vt(e,t,r,n){const s=Po(e,t,r,n);if(ce(s)||pe(s))return Ao(e,n,s),vt(e,s,r,n);if(typeof s!="symbol"){if(ae(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){const i=vt(o,t.items[o],r,n);if(typeof i=="number")o=i-1;else{if(i===$e)return $e;i===Ue&&(t.items.splice(o,1),o-=1)}}}else if(pe(t)){n=Object.freeze(n.concat(t));const o=vt("key",t.key,r,n);if(o===$e)return $e;o===Ue&&(t.key=null);const i=vt("value",t.value,r,n);if(i===$e)return $e;i===Ue&&(t.value=null)}}return s}d(vt,"a$v");Tt(vt,"visit_");async function kn(e,t){const r=Io(t);rr(e)?await bt(null,e.contents,r,Object.freeze([e]))===Ue&&(e.contents=null):await bt(null,e,r,Object.freeze([]))}d(kn,"y$j");Tt(kn,"visitAsync");kn.BREAK=$e;kn.SKIP=al;kn.REMOVE=Ue;async function bt(e,t,r,n){const s=await Po(e,t,r,n);if(ce(s)||pe(s))return Ao(e,n,s),bt(e,s,r,n);if(typeof s!="symbol"){if(ae(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){const i=await bt(o,t.items[o],r,n);if(typeof i=="number")o=i-1;else{if(i===$e)return $e;i===Ue&&(t.items.splice(o,1),o-=1)}}}else if(pe(t)){n=Object.freeze(n.concat(t));const o=await bt("key",t.key,r,n);if(o===$e)return $e;o===Ue&&(t.key=null);const i=await bt("value",t.value,r,n);if(i===$e)return $e;i===Ue&&(t.value=null)}}return s}d(bt,"b$n");Tt(bt,"visitAsync_");function Io(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}d(Io,"z$6");Tt(Io,"initVisitor");function Po(e,t,r,n){if(typeof r=="function")return r(e,t,n);if(Br(t))return r.Map?.(e,t,n);if(Mr(t))return r.Seq?.(e,t,n);if(pe(t))return r.Pair?.(e,t,n);if(te(t))return r.Scalar?.(e,t,n);if(tr(t))return r.Alias?.(e,t,n)}d(Po,"A$h");Tt(Po,"callVisitor");function Ao(e,t,r){const n=t[t.length-1];if(ae(n))n.items[e]=r;else if(pe(n))e==="key"?n.key=r:n.value=r;else if(rr(n))n.contents=r;else{const s=tr(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}d(Ao,"M$f");Tt(Ao,"replaceNode");var jg=Object.defineProperty,cl=d((e,t)=>jg(e,"name",{value:t,configurable:!0}),"h$i");const Og={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Eg=cl(e=>e.replace(/[!,[\]{}]/g,t=>Og[t]),"escapeTagName");let Gt=class Qe{static{d(this,"n")}static{cl(this,"Directives")}constructor(t,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Qe.defaultYaml,t),this.tags=Object.assign({},Qe.defaultTags,r)}clone(){const t=new Qe(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Qe(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Qe.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Qe.defaultTags);break}return t}add(t,r){this.atNextDocument&&(this.yaml={explicit:Qe.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Qe.defaultTags),this.atNextDocument=!1);const n=t.trim().split(/[ \t]+/),s=n.shift();switch(s){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[o,i]=n;return this.tags[o]=i,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;const[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const i=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,i),!1}}default:return r(0,`Unknown directive ${s}`,!0),!1}}tagName(t,r){if(t==="!")return"!";if(t[0]!=="!")return r(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const i=t.slice(2,-1);return i==="!"||i==="!!"?(r(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&r("Verbatim tags must end with a >"),i)}const[,n,s]=t.match(/^(.*!)([^!]*)$/s);s||r(`The ${t} tag has no suffix`);const o=this.tags[n];if(o)try{return o+decodeURIComponent(s)}catch(i){return r(String(i)),null}return n==="!"?t:(r(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[r,n]of Object.entries(this.tags))if(t.startsWith(n))return r+Eg(t.substring(n.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let s;if(t&&n.length>0&&ce(t.contents)){const o={};Dt(t.contents,(i,a)=>{ce(a)&&a.tag&&(o[a.tag]=!0)}),s=Object.keys(o)}else s=[];for(const[o,i]of n)o==="!!"&&i==="tag:yaml.org,2002:"||(!t||s.some(a=>a.startsWith(i)))&&r.push(`%TAG ${o} ${i}`);return r.join(`
20
+ `)}};Gt.defaultYaml={explicit:!1,version:"1.2"};Gt.defaultTags={"!!":"tag:yaml.org,2002:"};var Rg=Object.defineProperty,zt=d((e,t)=>Rg(e,"name",{value:t,configurable:!0}),"c$B");function To(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(t)}return!0}d(To,"m$f");zt(To,"anchorIsValid");function Do(e){const t=new Set;return Dt(e,{Value(r,n){n.anchor&&t.add(n.anchor)}}),t}d(Do,"h$h");zt(Do,"anchorNames");function Lo(e,t){for(let r=1;;++r){const n=`${e}${r}`;if(!t.has(n))return n}}d(Lo,"u$w");zt(Lo,"findNewAnchor");function ll(e,t){const r=[],n=new Map;let s=null;return{onAnchor:zt(o=>{r.push(o),s??(s=Do(e));const i=Lo(t,s);return s.add(i),i},"onAnchor"),setAnchors:zt(()=>{for(const o of r){const i=n.get(o);if(typeof i=="object"&&i.anchor&&(te(i.node)||ae(i.node)))i.node.anchor=i.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},"setAnchors"),sourceObjects:n}}d(ll,"w$a");zt(ll,"createNodeAnchors");var Cg=Object.defineProperty,xg=d((e,t)=>Cg(e,"name",{value:t,configurable:!0}),"d$i");function kt(e,t,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let s=0,o=n.length;s<o;++s){const i=n[s],a=kt(e,n,String(s),i);a===void 0?delete n[s]:a!==i&&(n[s]=a)}else if(n instanceof Map)for(const s of Array.from(n.keys())){const o=n.get(s),i=kt(e,n,s,o);i===void 0?n.delete(s):i!==o&&n.set(s,i)}else if(n instanceof Set)for(const s of Array.from(n)){const o=kt(e,n,s,s);o===void 0?n.delete(s):o!==s&&(n.delete(s),n.add(o))}else for(const[s,o]of Object.entries(n)){const i=kt(e,n,s,o);i===void 0?delete n[s]:i!==o&&(n[s]=i)}return e.call(t,r,n)}d(kt,"s$w");xg(kt,"applyReviver");var Ng=Object.defineProperty,Ig=d((e,t)=>Ng(e,"name",{value:t,configurable:!0}),"i$n");function je(e,t,r){if(Array.isArray(e))return e.map((n,s)=>je(n,String(s),r));if(e&&typeof e.toJSON=="function"){if(!r||!il(e))return e.toJSON(t,r);const n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n),r.onCreate=o=>{n.res=o,delete r.onCreate};const s=e.toJSON(t,r);return r.onCreate&&r.onCreate(s),s}return typeof e=="bigint"&&!r?.keep?Number(e):e}d(je,"f$o");Ig(je,"toJS");var Pg=Object.defineProperty,Ag=d((e,t)=>Pg(e,"name",{value:t,configurable:!0}),"i$m");let Bo=class{static{d(this,"O")}static{Ag(this,"NodeBase")}constructor(t){Object.defineProperty(this,Pe,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:r,maxAliasCount:n,onAnchor:s,reviver:o}={}){if(!rr(t))throw new TypeError("A document argument is required");const i={anchors:new Map,doc:t,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=je(this,"",i);if(typeof s=="function")for(const{count:c,res:l}of i.anchors.values())s(l,c);return typeof o=="function"?kt(o,{"":a},"",a):a}};var Tg=Object.defineProperty,Xs=d((e,t)=>Tg(e,"name",{value:t,configurable:!0}),"u$u");let Mo=class extends Bo{static{d(this,"b")}static{Xs(this,"Alias")}constructor(t){super(No),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Dt(t,{Node:Xs((o,i)=>{(tr(i)||il(i))&&n.push(i)},"Node")}),r&&(r.aliasResolveCache=n));let s;for(const o of n){if(o===this)break;o.anchor===this.source&&(s=o)}return s}toJSON(t,r){if(!r)return{source:this.source};const{anchors:n,doc:s,maxAliasCount:o}=r,i=this.resolve(s,r);if(!i){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(i);if(a||(je(i,null,r),a=n.get(i)),a?.res===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=$r(s,i,n)),a.count*a.aliasCount>o)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(t,r,n){const s=`*${this.source}`;if(t){if(To(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${s} `}return s}};function $r(e,t,r){if(tr(t)){const n=t.resolve(e),s=r&&n&&r.get(n);return s?s.count*s.aliasCount:0}else if(ae(t)){let n=0;for(const s of t.items){const o=$r(e,s,r);o>n&&(n=o)}return n}else if(pe(t)){const n=$r(e,t.key,r),s=$r(e,t.value,r);return Math.max(n,s)}return 1}d($r,"c$A");Xs($r,"getAliasCount");var Dg=Object.defineProperty,pl=d((e,t)=>Dg(e,"name",{value:t,configurable:!0}),"L$e");const ul=pl(e=>!e||typeof e!="function"&&typeof e!="object","isScalarValue");let W=class extends Bo{static{d(this,"o")}static{pl(this,"Scalar")}constructor(t){super(Je),this.value=t}toJSON(t,r){return r?.keep?this.value:je(this.value,t,r)}toString(){return String(this.value)}};W.BLOCK_FOLDED="BLOCK_FOLDED";W.BLOCK_LITERAL="BLOCK_LITERAL";W.PLAIN="PLAIN";W.QUOTE_DOUBLE="QUOTE_DOUBLE";W.QUOTE_SINGLE="QUOTE_SINGLE";var Lg=Object.defineProperty,dl=d((e,t)=>Lg(e,"name",{value:t,configurable:!0}),"h$f");const Bg="tag:yaml.org,2002:";function fl(e,t,r){if(t){const n=r.filter(o=>o.tag===t),s=n.find(o=>!o.format)??n[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return r.find(n=>n.identify?.(e)&&!n.format)}d(fl,"A$g");dl(fl,"findTagObject");function Ht(e,t,r){if(rr(e)&&(e=e.contents),ce(e))return e;if(pe(e)){const f=r.schema[lt].createNode?.(r.schema,null,r);return f.items.push(e),f}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:n,onAnchor:s,onTagObj:o,schema:i,sourceObjects:a}=r;let c;if(n&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=s(e)),new Mo(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=Bg+t.slice(2));let l=fl(e,t,i.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const f=new W(e);return c&&(c.node=f),f}l=e instanceof Map?i[lt]:Symbol.iterator in Object(e)?i[er]:i[lt]}o&&(o(l),delete r.onTagObj);const p=l?.createNode?l.createNode(r.schema,e,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,e,r):new W(e);return t?p.tag=t:l.default||(p.tag=l.tag),c&&(c.node=p),p}d(Ht,"B$9");dl(Ht,"createNode");var Mg=Object.defineProperty,$n=d((e,t)=>Mg(e,"name",{value:t,configurable:!0}),"i$l");function Or(e,t,r){let n=r;for(let s=t.length-1;s>=0;--s){const o=t[s];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const i=[];i[o]=n,n=i}else n=new Map([[o,n]])}return Ht(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:$n(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:e,sourceObjects:new Map})}d(Or,"c$z");$n(Or,"collectionFromPath");const yr=$n(e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,"isEmptyPath");let ml=class extends Bo{static{d(this,"b")}static{$n(this,"Collection")}constructor(t,r){super(t),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(t){const r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(r.schema=t),r.items=r.items.map(n=>ce(n)||pe(n)?n.clone(t):n),this.range&&(r.range=this.range.slice()),r}addIn(t,r){if(yr(t))this.add(r);else{const[n,...s]=t,o=this.get(n,!0);if(ae(o))o.addIn(s,r);else if(o===void 0&&this.schema)this.set(n,Or(this.schema,s,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}}deleteIn(t){const[r,...n]=t;if(n.length===0)return this.delete(r);const s=this.get(r,!0);if(ae(s))return s.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(t,r){const[n,...s]=t,o=this.get(n,!0);return s.length===0?!r&&te(o)?o.value:o:ae(o)?o.getIn(s,r):void 0}hasAllNullValues(t){return this.items.every(r=>{if(!pe(r))return!1;const n=r.value;return n==null||t&&te(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(t){const[r,...n]=t;if(n.length===0)return this.has(r);const s=this.get(r,!0);return ae(s)?s.hasIn(n):!1}setIn(t,r){const[n,...s]=t;if(s.length===0)this.set(n,r);else{const o=this.get(n,!0);if(ae(o))o.setIn(s,r);else if(o===void 0&&this.schema)this.set(n,Or(this.schema,s,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}}};var Vg=Object.defineProperty,Vo=d((e,t)=>Vg(e,"name",{value:t,configurable:!0}),"r$w");const _g=Vo(e=>e.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function qe(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}d(qe,"s$v");Vo(qe,"indentComment");const $t=Vo((e,t,r)=>e.endsWith(`
21
+ `)?qe(r,t):r.includes(`
22
+ `)?`
23
+ `+qe(r,t):(e.endsWith(" ")?"":" ")+r,"lineComment");var Fg=Object.defineProperty,gl=d((e,t)=>Fg(e,"name",{value:t,configurable:!0}),"O$e");const hl="flow",Qs="block",en="quoted";function Vr(e,t,r="flow",{indentAtStart:n,lineWidth:s=80,minContentWidth:o=20,onFold:i,onOverflow:a}={}){if(!s||s<0)return e;s<o&&(o=0);const c=Math.max(1+o,1+s-t.length);if(e.length<=c)return e;const l=[],p={};let f=s-t.length;typeof n=="number"&&(n>s-Math.max(2,o)?l.push(0):f=s-n);let u,m,h=!1,g=-1,b=-1,v=-1;r===Qs&&(g=Zs(e,g,t.length),g!==-1&&(f=g+c));for(let j;j=e[g+=1];){if(r===en&&j==="\\"){switch(b=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}v=g}if(j===`
24
+ `)r===Qs&&(g=Zs(e,g,t.length)),f=g+t.length+c,u=void 0;else{if(j===" "&&m&&m!==" "&&m!==`
25
+ `&&m!==" "){const x=e[g+1];x&&x!==" "&&x!==`
26
+ `&&x!==" "&&(u=g)}if(g>=f)if(u)l.push(u),f=u+c,u=void 0;else if(r===en){for(;m===" "||m===" ";)m=j,j=e[g+=1],h=!0;const x=g>v+1?g-2:b-1;if(p[x])return e;l.push(x),p[x]=!0,f=x+c,u=void 0}else h=!0}m=j}if(h&&a&&a(),l.length===0)return e;i&&i();let $=e.slice(0,l[0]);for(let j=0;j<l.length;++j){const x=l[j],N=l[j+1]||e.length;x===0?$=`
27
+ ${t}${e.slice(0,N)}`:(r===en&&p[x]&&($+=`${e[x]}\\`),$+=`
28
+ ${t}${e.slice(x+1,N)}`)}return $}d(Vr,"q$7");gl(Vr,"foldFlowLines");function Zs(e,t,r){let n=t,s=t+1,o=e[s];for(;o===" "||o===" ";)if(t<s+r)o=e[++t];else{do o=e[++t];while(o&&o!==`
29
+ `);n=t,s=t+1,o=e[s]}return n}d(Zs,"E$d");gl(Zs,"consumeMoreIndentedLines");var qg=Object.defineProperty,Ve=d((e,t)=>qg(e,"name",{value:t,configurable:!0}),"d$g");const wn=Ve((e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),"getFoldOptions"),Sn=Ve(e=>/^(%|---|\.\.\.)/m.test(e),"containsDocumentMarker");function yl(e,t,r){if(!t||t<0)return!1;const n=t-r,s=e.length;if(s<=n)return!1;for(let o=0,i=0;o<s;++o)if(e[o]===`
30
+ `){if(o-i>n)return!0;if(i=o+1,s-i<=n)return!1}return!0}d(yl,"M$e");Ve(yl,"lineLengthOverLimit");function Jt(e,t){const r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;const{implicitKey:n}=t,s=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(Sn(e)?" ":"");let i="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(i+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{i+=r.slice(a,c);const p=r.substr(c+2,4);switch(p){case"0000":i+="\\0";break;case"0007":i+="\\a";break;case"000b":i+="\\v";break;case"001b":i+="\\e";break;case"0085":i+="\\N";break;case"00a0":i+="\\_";break;case"2028":i+="\\L";break;case"2029":i+="\\P";break;default:p.substr(0,2)==="00"?i+="\\x"+p.substr(2):i+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length<s)c+=1;else{for(i+=r.slice(a,c)+`
31
+
32
+ `;r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"';)i+=`
33
+ `,c+=2;i+=o,r[c+2]===" "&&(i+="\\"),c+=1,a=c+1}break;default:c+=1}return i=a?i+r.slice(a):r,n?i:Vr(i,o,en,wn(t,!1))}d(Jt,"k$e");Ve(Jt,"doubleQuotedString");function un(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
34
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Jt(e,t);const r=t.indent||(Sn(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
35
+ ${r}`)+"'";return t.implicitKey?n:Vr(n,r,hl,wn(t,!1))}d(un,"B$8");Ve(un,"singleQuotedString");function wt(e,t){const{singleQuote:r}=t.options;let n;if(r===!1)n=Jt;else{const s=e.includes('"'),o=e.includes("'");s&&!o?n=un:o&&!s?n=Jt:n=r?un:Jt}return n(e,t)}d(wt,"S$d");Ve(wt,"quotedString");let eo;try{eo=new RegExp(`(^|(?<!
36
+ ))
37
+ +(?!
38
+ |$)`,"g")}catch{eo=/\n+(?!\n|$)/g}function wr({comment:e,type:t,value:r},n,s,o){const{blockQuote:i,commentString:a,lineWidth:c}=n.options;if(!i||/\n[\t ]+$/.test(r))return wt(r,n);const l=n.indent||(n.forceBlockIndent||Sn(r)?" ":""),p=i==="literal"?!0:i==="folded"||t===W.BLOCK_FOLDED?!1:t===W.BLOCK_LITERAL?!0:!yl(r,c,l.length);if(!r)return p?`|
39
+ `:`>
40
+ `;let f,u;for(u=r.length;u>0;--u){const x=r[u-1];if(x!==`
41
+ `&&x!==" "&&x!==" ")break}let m=r.substring(u);const h=m.indexOf(`
42
+ `);h===-1?f="-":r===m||h!==m.length-1?(f="+",o&&o()):f="",m&&(r=r.slice(0,-m.length),m[m.length-1]===`
43
+ `&&(m=m.slice(0,-1)),m=m.replace(eo,`$&${l}`));let g=!1,b,v=-1;for(b=0;b<r.length;++b){const x=r[b];if(x===" ")g=!0;else if(x===`
44
+ `)v=b;else break}let $=r.substring(0,v<b?v+1:b);$&&(r=r.substring($.length),$=$.replace(/\n+/g,`$&${l}`));let j=(g?l?"2":"1":"")+f;if(e&&(j+=" "+a(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!p){const x=r.replace(/\n+/g,`
45
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`);let N=!1;const I=wn(n,!0);i!=="folded"&&t!==W.BLOCK_FOLDED&&(I.onOverflow=()=>{N=!0});const _=Vr(`${$}${x}${m}`,l,Qs,I);if(!N)return`>${j}
46
+ ${l}${_}`}return r=r.replace(/\n+/g,`$&${l}`),`|${j}
47
+ ${l}${$}${r}${m}`}d(wr,"D$b");Ve(wr,"blockString");function vl(e,t,r,n){const{type:s,value:o}=e,{actualString:i,implicitKey:a,indent:c,indentStep:l,inFlow:p}=t;if(a&&o.includes(`
48
+ `)||p&&/[[\]{},]/.test(o))return wt(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||p||!o.includes(`
49
+ `)?wt(o,t):wr(e,t,r,n);if(!a&&!p&&s!==W.PLAIN&&o.includes(`
50
+ `))return wr(e,t,r,n);if(Sn(o)){if(c==="")return t.forceBlockIndent=!0,wr(e,t,r,n);if(a&&c===l)return wt(o,t)}const f=o.replace(/\n+/g,`$&
51
+ ${c}`);if(i){const u=Ve(g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(f),"test"),{compat:m,tags:h}=t.doc.schema;if(h.some(u)||m?.some(u))return wt(o,t)}return a?f:Vr(f,c,hl,wn(t,!1))}d(vl,"m$e");Ve(vl,"plainString");function nr(e,t,r,n){const{implicitKey:s,inFlow:o}=t,i=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==W.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(i.value)&&(a=W.QUOTE_DOUBLE);const c=Ve(p=>{switch(p){case W.BLOCK_FOLDED:case W.BLOCK_LITERAL:return s||o?wt(i.value,t):wr(i,t,r,n);case W.QUOTE_DOUBLE:return Jt(i.value,t);case W.QUOTE_SINGLE:return un(i.value,t);case W.PLAIN:return vl(i,t,r,n);default:return null}},"_stringify");let l=c(a);if(l===null){const{defaultKeyType:p,defaultStringType:f}=t.options,u=s&&p||f;if(l=c(u),l===null)throw new Error(`Unsupported default string type ${u}`)}return l}d(nr,"R$9");Ve(nr,"stringifyString");var Ug=Object.defineProperty,_r=d((e,t)=>Ug(e,"name",{value:t,configurable:!0}),"s$u");function _o(e,t){const r=Object.assign({blockQuote:!0,commentString:_g,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}d(_o,"w$9");_r(_o,"createStringifyContext");function bl(e,t){if(t.tag){const s=e.filter(o=>o.tag===t.tag);if(s.length>0)return s.find(o=>o.format===t.format)??s[0]}let r,n;if(te(t)){n=t.value;let s=e.filter(o=>o.identify?.(n));if(s.length>1){const o=s.filter(i=>i.test);o.length>0&&(s=o)}r=s.find(o=>o.format===t.format)??s.find(o=>!o.format)}else n=t,r=e.find(s=>s.nodeClass&&n instanceof s.nodeClass);if(!r){const s=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${s} value`)}return r}d(bl,"b$k");_r(bl,"getTagObject");function kl(e,t,{anchors:r,doc:n}){if(!n.directives)return"";const s=[],o=(te(e)||ae(e))&&e.anchor;o&&To(o)&&(r.add(o),s.push(`&${o}`));const i=e.tag??(t.default?null:t.tag);return i&&s.push(n.directives.tagString(i)),s.join(" ")}d(kl,"A$f");_r(kl,"stringifyProps");function Et(e,t,r,n){if(pe(e))return e.toString(t,r,n);if(tr(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const o=ce(e)?e:t.doc.createNode(e,{onTagObj:_r(c=>s=c,"onTagObj")});s??(s=bl(t.doc.schema.tags,o));const i=kl(o,s,t);i.length>0&&(t.indentAtStart=(t.indentAtStart??0)+i.length+1);const a=typeof s.stringify=="function"?s.stringify(o,t,r,n):te(o)?nr(o,t,r,n):o.toString(t,r,n);return i?te(o)||a[0]==="{"||a[0]==="["?`${i} ${a}`:`${i}
52
+ ${t.indent}${a}`:a}d(Et,"O$d");_r(Et,"stringify");var Wg=Object.defineProperty,Gg=d((e,t)=>Wg(e,"name",{value:t,configurable:!0}),"D$a");function $l({key:e,value:t},r,n,s){const{allNullValues:o,doc:i,indent:a,indentStep:c,options:{commentString:l,indentSeq:p,simpleKeys:f}}=r;let u=ce(e)&&e.comment||null;if(f){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(ae(e)||!ce(e)&&typeof e=="object"){const _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let m=!f&&(!e||u&&t==null&&!r.inFlow||ae(e)||(te(e)?e.type===W.BLOCK_FOLDED||e.type===W.BLOCK_LITERAL:typeof e=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!m&&(f||!o),indent:a+c});let h=!1,g=!1,b=Et(e,r,()=>h=!0,()=>g=!0);if(!m&&!r.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(r.inFlow){if(o||t==null)return h&&n&&n(),b===""?"?":m?`? ${b}`:b}else if(o&&!f||t==null&&m)return b=`? ${b}`,u&&!h?b+=$t(b,r.indent,l(u)):g&&s&&s(),b;h&&(u=null),m?(u&&(b+=$t(b,r.indent,l(u))),b=`? ${b}
53
+ ${a}:`):(b=`${b}:`,u&&(b+=$t(b,r.indent,l(u))));let v,$,j;ce(t)?(v=!!t.spaceBefore,$=t.commentBefore,j=t.comment):(v=!1,$=null,j=null,t&&typeof t=="object"&&(t=i.createNode(t))),r.implicitKey=!1,!m&&!u&&te(t)&&(r.indentAtStart=b.length+1),g=!1,!p&&c.length>=2&&!r.inFlow&&!m&&Mr(t)&&!t.flow&&!t.tag&&!t.anchor&&(r.indent=r.indent.substring(2));let x=!1;const N=Et(t,r,()=>x=!0,()=>g=!0);let I=" ";if(u||v||$){if(I=v?`
54
+ `:"",$){const _=l($);I+=`
55
+ ${qe(_,r.indent)}`}N===""&&!r.inFlow?I===`
56
+ `&&j&&(I=`
57
+
58
+ `):I+=`
59
+ ${r.indent}`}else if(!m&&ae(t)){const _=N[0],w=N.indexOf(`
60
+ `),M=w!==-1,L=r.inFlow??t.flow??t.items.length===0;if(M||!L){let be=!1;if(M&&(_==="&"||_==="!")){let ee=N.indexOf(" ");_==="&"&&ee!==-1&&ee<w&&N[ee+1]==="!"&&(ee=N.indexOf(" ",ee+1)),(ee===-1||w<ee)&&(be=!0)}be||(I=`
61
+ ${r.indent}`)}}else(N===""||N[0]===`
62
+ `)&&(I="");return b+=I+N,r.inFlow?x&&n&&n():j&&!x?b+=$t(b,r.indent,l(j)):g&&s&&s(),b}d($l,"R$8");Gg($l,"stringifyPair");var Jg=Object.defineProperty,wl=d((e,t)=>Jg(e,"name",{value:t,configurable:!0}),"u$r");function Kg(e,...t){e==="debug"&&console.log(...t)}d(Kg,"e$w");wl(Kg,"debug");function Fo(e,t){(e==="debug"||e==="warn")&&console.warn(t)}d(Fo,"f$m");wl(Fo,"warn");var zg=Object.defineProperty,jt=d((e,t)=>zg(e,"name",{value:t,configurable:!0}),"s$t");const Hr="<<",tt={identify:jt(e=>e===Hr||typeof e=="symbol"&&e.description===Hr,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:jt(()=>Object.assign(new W(Symbol(Hr)),{addToJSMap:qo}),"resolve"),stringify:jt(()=>Hr,"stringify")},Hg=jt((e,t)=>(tt.identify(t)||te(t)&&(!t.type||t.type===W.PLAIN)&&tt.identify(t.value))&&e?.doc.schema.tags.some(r=>r.tag===tt.tag&&r.default),"isMergeKey");function qo(e,t,r){const n=Uo(e,r);if(Mr(n))for(const s of n.items)tn(e,t,s);else if(Array.isArray(n))for(const s of n)tn(e,t,s);else tn(e,t,n)}d(qo,"d$f");jt(qo,"addMergeToJSMap");function tn(e,t,r){const n=Uo(e,r);if(!Br(n))throw new Error("Merge sources must be maps or map aliases");const s=n.toJSON(null,e,Map);for(const[o,i]of s)t instanceof Map?t.has(o)||t.set(o,i):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:i,writable:!0,enumerable:!0,configurable:!0});return t}d(tn,"l$k");jt(tn,"mergeValue");function Uo(e,t){return e&&tr(t)?t.resolve(e.doc,e):t}d(Uo,"g$f");jt(Uo,"resolveAliasValue");var Yg=Object.defineProperty,Sl=d((e,t)=>Yg(e,"name",{value:t,configurable:!0}),"s$s");function Wo(e,t,{key:r,value:n}){if(ce(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if(Hg(e,r))qo(e,t,n);else{const s=je(r,"",e);if(t instanceof Map)t.set(s,je(n,s,e));else if(t instanceof Set)t.add(s);else{const o=jl(r,s,e),i=je(n,o,e);o in t?Object.defineProperty(t,o,{value:i,writable:!0,enumerable:!0,configurable:!0}):t[o]=i}}return t}d(Wo,"b$j");Sl(Wo,"addPairToJSMap");function jl(e,t,r){if(t===null)return"";if(typeof t!="object")return String(t);if(ce(e)&&r?.doc){const n=_o(r.doc,{});n.anchors=new Set;for(const o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;const s=e.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(s);o.length>40&&(o=o.substring(0,36)+'..."'),Fo(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return s}return JSON.stringify(t)}d(jl,"p$k");Sl(jl,"stringifyKey");var Xg=Object.defineProperty,Ol=d((e,t)=>Xg(e,"name",{value:t,configurable:!0}),"o$r");function jn(e,t,r){const n=Ht(e,void 0,r),s=Ht(t,void 0,r);return new Oe(n,s)}d(jn,"m$d");Ol(jn,"createPair");let Oe=class El{static{d(this,"i")}static{Ol(this,"Pair")}constructor(t,r=null){Object.defineProperty(this,Pe,{value:ol}),this.key=t,this.value=r}clone(t){let{key:r,value:n}=this;return ce(r)&&(r=r.clone(t)),ce(n)&&(n=n.clone(t)),new El(r,n)}toJSON(t,r){const n=r?.mapAsMap?new Map:{};return Wo(r,n,this)}toString(t,r,n){return t?.doc?$l(this,t,r,n):JSON.stringify(this)}};var Qg=Object.defineProperty,On=d((e,t)=>Qg(e,"name",{value:t,configurable:!0}),"$$8");function Go(e,t,r){return(t.inFlow??e.flow?Cl:Rl)(e,t,r)}d(Go,"P$b");On(Go,"stringifyCollection");function Rl({comment:e,items:t},r,{blockItemPrefix:n,flowChars:s,itemIndent:o,onChompKeep:i,onComment:a}){const{indent:c,options:{commentString:l}}=r,p=Object.assign({},r,{indent:o,type:null});let f=!1;const u=[];for(let h=0;h<t.length;++h){const g=t[h];let b=null;if(ce(g))!f&&g.spaceBefore&&u.push(""),Er(r,u,g.commentBefore,f),g.comment&&(b=g.comment);else if(pe(g)){const $=ce(g.key)?g.key:null;$&&(!f&&$.spaceBefore&&u.push(""),Er(r,u,$.commentBefore,f))}f=!1;let v=Et(g,p,()=>b=null,()=>f=!0);b&&(v+=$t(v,o,l(b))),f&&b&&(f=!1),u.push(n+v)}let m;if(u.length===0)m=s.start+s.end;else{m=u[0];for(let h=1;h<u.length;++h){const g=u[h];m+=g?`
63
+ ${c}${g}`:`
64
+ `}}return e?(m+=`
65
+ `+qe(l(e),c),a&&a()):f&&i&&i(),m}d(Rl,"b$i");On(Rl,"stringifyBlockCollection");function Cl({items:e},t,{flowChars:r,itemIndent:n}){const{indent:s,indentStep:o,flowCollectionPadding:i,options:{commentString:a}}=t;n+=o;const c=Object.assign({},t,{indent:n,inFlow:!0,type:null});let l=!1,p=0;const f=[];for(let h=0;h<e.length;++h){const g=e[h];let b=null;if(ce(g))g.spaceBefore&&f.push(""),Er(t,f,g.commentBefore,!1),g.comment&&(b=g.comment);else if(pe(g)){const $=ce(g.key)?g.key:null;$&&($.spaceBefore&&f.push(""),Er(t,f,$.commentBefore,!1),$.comment&&(l=!0));const j=ce(g.value)?g.value:null;j?(j.comment&&(b=j.comment),j.commentBefore&&(l=!0)):g.value==null&&$?.comment&&(b=$.comment)}b&&(l=!0);let v=Et(g,c,()=>b=null);l||(l=f.length>p||v.includes(`
66
+ `)),h<e.length-1?v+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=f.reduce(($,j)=>$+j.length+2,2)+(v.length+2)>t.options.lineWidth)),l&&(v+=",")),b&&(v+=$t(v,n,a(b))),f.push(v),p=f.length}const{start:u,end:m}=r;if(f.length===0)return u+m;if(!l){const h=f.reduce((g,b)=>g+b.length+2,2);l=t.options.lineWidth>0&&h>t.options.lineWidth}if(l){let h=u;for(const g of f)h+=g?`
67
+ ${o}${s}${g}`:`
68
+ `;return`${h}
69
+ ${s}${m}`}else return`${u}${i}${f.join(" ")}${i}${m}`}d(Cl,"N$a");On(Cl,"stringifyFlowCollection");function Er({indent:e,options:{commentString:t}},r,n,s){if(n&&s&&(n=n.replace(/^\n+/,"")),n){const o=qe(t(n),e);r.push(o.trimStart())}}d(Er,"C$b");On(Er,"addCommentBefore");var Zg=Object.defineProperty,to=d((e,t)=>Zg(e,"name",{value:t,configurable:!0}),"m$c");function ct(e,t){const r=te(t)?t.value:t;for(const n of e)if(pe(n)&&(n.key===t||n.key===r||te(n.key)&&n.key.value===r))return n}d(ct,"f$k");to(ct,"findPair");let Ie=class extends ml{static{d(this,"N")}static{to(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(lt,t),this.items=[]}static from(t,r,n){const{keepUndefined:s,replacer:o}=n,i=new this(t),a=to((c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||s)&&i.items.push(jn(c,l,n))},"add");if(r instanceof Map)for(const[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(const c of Object.keys(r))a(c,r[c]);return typeof t.sortMapEntries=="function"&&i.items.sort(t.sortMapEntries),i}add(t,r){let n;pe(t)?n=t:!t||typeof t!="object"||!("key"in t)?n=new Oe(t,t?.value):n=new Oe(t.key,t.value);const s=ct(this.items,n.key),o=this.schema?.sortMapEntries;if(s){if(!r)throw new Error(`Key ${n.key} already set`);te(s.value)&&ul(n.value)?s.value.value=n.value:s.value=n.value}else if(o){const i=this.items.findIndex(a=>o(n,a)<0);i===-1?this.items.push(n):this.items.splice(i,0,n)}else this.items.push(n)}delete(t){const r=ct(this.items,t);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(t,r){const n=ct(this.items,t)?.value;return(!r&&te(n)?n.value:n)??void 0}has(t){return!!ct(this.items,t)}set(t,r){this.add(new Oe(t,r),!0)}toJSON(t,r,n){const s=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(s);for(const o of this.items)Wo(r,s,o);return s}toString(t,r,n){if(!t)return JSON.stringify(this);for(const s of this.items)if(!pe(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Go(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:n,onComment:r})}};var eh=Object.defineProperty,th=d((e,t)=>eh(e,"name",{value:t,configurable:!0}),"a$s");const sr={collection:"map",default:!0,nodeClass:Ie,tag:"tag:yaml.org,2002:map",resolve(e,t){return Br(e)||t("Expected a mapping for this tag"),e},createNode:th((e,t,r)=>Ie.from(e,t,r),"createNode")};var rh=Object.defineProperty,xl=d((e,t)=>rh(e,"name",{value:t,configurable:!0}),"m$b");let Rt=class extends ml{static{d(this,"b")}static{xl(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(er,t),this.items=[]}add(t){this.items.push(t)}delete(t){const r=vr(t);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(t,r){const n=vr(t);if(typeof n!="number")return;const s=this.items[n];return!r&&te(s)?s.value:s}has(t){const r=vr(t);return typeof r=="number"&&r<this.items.length}set(t,r){const n=vr(t);if(typeof n!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[n];te(s)&&ul(r)?s.value=r:this.items[n]=r}toJSON(t,r){const n=[];r?.onCreate&&r.onCreate(n);let s=0;for(const o of this.items)n.push(je(o,String(s++),r));return n}toString(t,r,n){return t?Go(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(t,r,n){const{replacer:s}=n,o=new this(t);if(r&&Symbol.iterator in Object(r)){let i=0;for(let a of r){if(typeof s=="function"){const c=r instanceof Set?a:String(i++);a=s.call(r,c,a)}o.items.push(Ht(a,void 0,n))}}return o}};function vr(e){let t=te(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}d(vr,"f$j");xl(vr,"asItemIndex");var nh=Object.defineProperty,sh=d((e,t)=>nh(e,"name",{value:t,configurable:!0}),"t$n");const or={collection:"seq",default:!0,nodeClass:Rt,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Mr(e)||t("Expected a sequence for this tag"),e},createNode:sh((e,t,r)=>Rt.from(e,t,r),"createNode")};var oh=Object.defineProperty,ea=d((e,t)=>oh(e,"name",{value:t,configurable:!0}),"i$i");const En={identify:ea(e=>typeof e=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:ea(e=>e,"resolve"),stringify(e,t,r,n){return t=Object.assign({actualString:!0},t),nr(e,t,r,n)}};var ih=Object.defineProperty,Yr=d((e,t)=>ih(e,"name",{value:t,configurable:!0}),"l$j");const Rn={identify:Yr(e=>e==null,"identify"),createNode:Yr(()=>new W(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:Yr(()=>new W(null),"resolve"),stringify:Yr(({source:e},t)=>typeof e=="string"&&Rn.test.test(e)?e:t.options.nullStr,"stringify")};var ah=Object.defineProperty,ta=d((e,t)=>ah(e,"name",{value:t,configurable:!0}),"e$v");const Jo={identify:ta(e=>typeof e=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:ta(e=>new W(e[0]==="t"||e[0]==="T"),"resolve"),stringify({source:e,value:t},r){if(e&&Jo.test.test(e)){const n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?r.options.trueStr:r.options.falseStr}};var ch=Object.defineProperty,lh=d((e,t)=>ch(e,"name",{value:t,configurable:!0}),"g$e");function Te({format:e,minFractionDigits:t,tag:r,value:n}){if(typeof n=="bigint")return String(n);const s=typeof n=="number"?n:Number(n);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let i=o.indexOf(".");i<0&&(i=o.length,o+=".");let a=t-(o.length-i-1);for(;a-- >0;)o+="0"}return o}d(Te,"y$g");lh(Te,"stringifyNumber");var ph=Object.defineProperty,Rr=d((e,t)=>ph(e,"name",{value:t,configurable:!0}),"o$q");const Nl={identify:Rr(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:Rr(e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:Te},Il={identify:Rr(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:Rr(e=>parseFloat(e),"resolve"),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Te(e)}},Pl={identify:Rr(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new W(parseFloat(e)),r=e.indexOf(".");return r!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-r-1),t},stringify:Te};var uh=Object.defineProperty,We=d((e,t)=>uh(e,"name",{value:t,configurable:!0}),"r$t");const Cn=We(e=>typeof e=="bigint"||Number.isInteger(e),"intIdentify"),Ko=We((e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r),"intResolve");function zo(e,t,r){const{value:n}=e;return Cn(n)&&n>=0?r+n.toString(t):Te(e)}d(zo,"g$d");We(zo,"intStringify");const Al={identify:We(e=>Cn(e)&&e>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:We((e,t,r)=>Ko(e,2,8,r),"resolve"),stringify:We(e=>zo(e,8,"0o"),"stringify")},Tl={identify:Cn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:We((e,t,r)=>Ko(e,0,10,r),"resolve"),stringify:Te},Dl={identify:We(e=>Cn(e)&&e>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:We((e,t,r)=>Ko(e,2,16,r),"resolve"),stringify:We(e=>zo(e,16,"0x"),"stringify")},dh=[sr,or,En,Rn,Jo,Al,Tl,Dl,Nl,Il,Pl];var fh=Object.defineProperty,Se=d((e,t)=>fh(e,"name",{value:t,configurable:!0}),"e$u");function ro(e){return typeof e=="bigint"||Number.isInteger(e)}d(ro,"i$h");Se(ro,"intIdentify");const Xr=Se(({value:e})=>JSON.stringify(e),"stringifyJSON"),mh=[{identify:Se(e=>typeof e=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:Se(e=>e,"resolve"),stringify:Xr},{identify:Se(e=>e==null,"identify"),createNode:Se(()=>new W(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:Se(()=>null,"resolve"),stringify:Xr},{identify:Se(e=>typeof e=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:Se(e=>e==="true","resolve"),stringify:Xr},{identify:ro,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:Se((e,t,{intAsBigInt:r})=>r?BigInt(e):parseInt(e,10),"resolve"),stringify:Se(({value:e})=>ro(e)?e.toString():JSON.stringify(e),"stringify")},{identify:Se(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:Se(e=>parseFloat(e),"resolve"),stringify:Xr}],gh={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},hh=[sr,or].concat(mh,gh);var yh=Object.defineProperty,vh=d((e,t)=>yh(e,"name",{value:t,configurable:!0}),"b$f");const Ho={identify:vh(e=>e instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const r=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let s=0;s<r.length;++s)n[s]=r.charCodeAt(s);return n}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:r},n,s,o){if(!r)return"";const i=r;let a;if(typeof btoa=="function"){let c="";for(let l=0;l<i.length;++l)c+=String.fromCharCode(i[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=W.BLOCK_LITERAL),t!==W.QUOTE_DOUBLE){const c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),p=new Array(l);for(let f=0,u=0;f<l;++f,u+=c)p[f]=a.substr(u,c);a=p.join(t===W.BLOCK_LITERAL?`
70
+ `:" ")}return nr({comment:e,type:t,value:a},n,s,o)}};var bh=Object.defineProperty,Ll=d((e,t)=>bh(e,"name",{value:t,configurable:!0}),"f$f");function Yo(e,t){if(Mr(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(!pe(n)){if(Br(n)){n.items.length>1&&t("Each pair must have its own sequence indicator");const s=n.items[0]||new Oe(new W(null));if(n.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${n.commentBefore}
71
+ ${s.key.commentBefore}`:n.commentBefore),n.comment){const o=s.value??s.key;o.comment=o.comment?`${n.comment}
72
+ ${o.comment}`:n.comment}n=s}e.items[r]=pe(n)?n:new Oe(n)}}else t("Expected a sequence for this tag");return e}d(Yo,"y$c");Ll(Yo,"resolvePairs");function Xo(e,t,r){const{replacer:n}=r,s=new Rt(e);s.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let i of t){typeof n=="function"&&(i=n.call(t,String(o++),i));let a,c;if(Array.isArray(i))if(i.length===2)a=i[0],c=i[1];else throw new TypeError(`Expected [key, value] tuple: ${i}`);else if(i&&i instanceof Object){const l=Object.keys(i);if(l.length===1)a=l[0],c=i[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=i;s.items.push(jn(a,c,r))}return s}d(Xo,"u$m");Ll(Xo,"createPairs");const Qo={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Yo,createNode:Xo};var kh=Object.defineProperty,no=d((e,t)=>kh(e,"name",{value:t,configurable:!0}),"p$h");let rn=class Bl extends Rt{static{d(this,"a")}static{no(this,"YAMLOMap")}constructor(){super(),this.add=Ie.prototype.add.bind(this),this.delete=Ie.prototype.delete.bind(this),this.get=Ie.prototype.get.bind(this),this.has=Ie.prototype.has.bind(this),this.set=Ie.prototype.set.bind(this),this.tag=Bl.tag}toJSON(t,r){if(!r)return super.toJSON(t);const n=new Map;r?.onCreate&&r.onCreate(n);for(const s of this.items){let o,i;if(pe(s)?(o=je(s.key,"",r),i=je(s.value,o,r)):o=je(s,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,i)}return n}static from(t,r,n){const s=Xo(t,r,n),o=new this;return o.items=s.items,o}};rn.tag="tag:yaml.org,2002:omap";const Zo={collection:"seq",identify:no(e=>e instanceof Map,"identify"),nodeClass:rn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const r=Yo(e,t),n=[];for(const{key:s}of r.items)te(s)&&(n.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):n.push(s.value));return Object.assign(new rn,r)},createNode:no((e,t,r)=>rn.from(e,t,r),"createNode")};var $h=Object.defineProperty,Cr=d((e,t)=>$h(e,"name",{value:t,configurable:!0}),"e$t");function ei({value:e,source:t},r){return t&&(e?Ml:Vl).test.test(t)?t:e?r.options.trueStr:r.options.falseStr}d(ei,"f$e");Cr(ei,"boolStringify");const Ml={identify:Cr(e=>e===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:Cr(()=>new W(!0),"resolve"),stringify:ei},Vl={identify:Cr(e=>e===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:Cr(()=>new W(!1),"resolve"),stringify:ei};var wh=Object.defineProperty,xr=d((e,t)=>wh(e,"name",{value:t,configurable:!0}),"a$k");const Sh={identify:xr(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:xr(e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:Te},jh={identify:xr(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:xr(e=>parseFloat(e.replace(/_/g,"")),"resolve"),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Te(e)}},Oh={identify:xr(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new W(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(r!==-1){const n=e.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(t.minFractionDigits=n.length)}return t},stringify:Te};var Eh=Object.defineProperty,Ke=d((e,t)=>Eh(e,"name",{value:t,configurable:!0}),"i$f");const Fr=Ke(e=>typeof e=="bigint"||Number.isInteger(e),"intIdentify");function qr(e,t,r,{intAsBigInt:n}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const i=BigInt(e);return s==="-"?BigInt(-1)*i:i}const o=parseInt(e,r);return s==="-"?-1*o:o}d(qr,"g$8");Ke(qr,"intResolve");function xn(e,t,r){const{value:n}=e;if(Fr(n)){const s=n.toString(t);return n<0?"-"+r+s.substr(1):r+s}return Te(e)}d(xn,"s$n");Ke(xn,"intStringify");const Rh={identify:Fr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:Ke((e,t,r)=>qr(e,2,2,r),"resolve"),stringify:Ke(e=>xn(e,2,"0b"),"stringify")},Ch={identify:Fr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:Ke((e,t,r)=>qr(e,1,8,r),"resolve"),stringify:Ke(e=>xn(e,8,"0"),"stringify")},xh={identify:Fr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:Ke((e,t,r)=>qr(e,0,10,r),"resolve"),stringify:Te},Nh={identify:Fr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:Ke((e,t,r)=>qr(e,2,16,r),"resolve"),stringify:Ke(e=>xn(e,16,"0x"),"stringify")};var Ih=Object.defineProperty,so=d((e,t)=>Ih(e,"name",{value:t,configurable:!0}),"n$l");let nn=class _l extends Ie{static{d(this,"l")}static{so(this,"YAMLSet")}constructor(t){super(t),this.tag=_l.tag}add(t){let r;pe(t)?r=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?r=new Oe(t.key,null):r=new Oe(t,null),ct(this.items,r.key)||this.items.push(r)}get(t,r){const n=ct(this.items,t);return!r&&pe(n)?te(n.key)?n.key.value:n.key:n}set(t,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);const n=ct(this.items,t);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Oe(t))}toJSON(t,r){return super.toJSON(t,r,Set)}toString(t,r,n){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(t,r,n){const{replacer:s}=n,o=new this(t);if(r&&Symbol.iterator in Object(r))for(let i of r)typeof s=="function"&&(i=s.call(r,i,i)),o.items.push(jn(i,null,n));return o}};nn.tag="tag:yaml.org,2002:set";const ti={collection:"map",identify:so(e=>e instanceof Set,"identify"),nodeClass:nn,default:!1,tag:"tag:yaml.org,2002:set",createNode:so((e,t,r)=>nn.from(e,t,r),"createNode"),resolve(e,t){if(Br(e)){if(e.hasAllNullValues(!0))return Object.assign(new nn,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};var Ph=Object.defineProperty,Le=d((e,t)=>Ph(e,"name",{value:t,configurable:!0}),"n$k");function Nn(e,t){const r=e[0],n=r==="-"||r==="+"?e.substring(1):e,s=Le(i=>t?BigInt(i):Number(i),"num"),o=n.replace(/_/g,"").split(":").reduce((i,a)=>i*s(60)+s(a),s(0));return r==="-"?s(-1)*o:o}d(Nn,"l$d");Le(Nn,"parseSexagesimal");function ri(e){let{value:t}=e,r=Le(i=>i,"num");if(typeof t=="bigint")r=Le(i=>BigInt(i),"num");else if(isNaN(t)||!isFinite(t))return Te(e);let n="";t<0&&(n="-",t*=r(-1));const s=r(60),o=[t%s];return t<60?o.unshift(0):(t=(t-o[0])/s,o.unshift(t%s),t>=60&&(t=(t-o[0])/s,o.unshift(t))),n+o.map(i=>String(i).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}d(ri,"c$u");Le(ri,"stringifySexagesimal");const Fl={identify:Le(e=>typeof e=="bigint"||Number.isInteger(e),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:Le((e,t,{intAsBigInt:r})=>Nn(e,r),"resolve"),stringify:ri},ql={identify:Le(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:Le(e=>Nn(e,!1),"resolve"),stringify:ri},In={identify:Le(e=>e instanceof Date,"identify"),default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(In.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,r,n,s,o,i,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let l=Date.UTC(r,n-1,s,o||0,i||0,a||0,c);const p=t[8];if(p&&p!=="Z"){let f=Nn(p,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:Le(({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")},ra=[sr,or,En,Rn,Ml,Vl,Rh,Ch,xh,Nh,Sh,jh,Oh,Ho,tt,Zo,Qo,ti,Fl,ql,In];var Ah=Object.defineProperty,Th=d((e,t)=>Ah(e,"name",{value:t,configurable:!0}),"s$m");const na=new Map([["core",dh],["failsafe",[sr,or,En]],["json",hh],["yaml11",ra],["yaml-1.1",ra]]),sa={binary:Ho,bool:Jo,float:Pl,floatExp:Il,floatNaN:Nl,floatTime:ql,int:Tl,intHex:Dl,intOct:Al,intTime:Fl,map:sr,merge:tt,null:Rn,omap:Zo,pairs:Qo,seq:or,set:ti,timestamp:In},Dh={"tag:yaml.org,2002:binary":Ho,"tag:yaml.org,2002:merge":tt,"tag:yaml.org,2002:omap":Zo,"tag:yaml.org,2002:pairs":Qo,"tag:yaml.org,2002:set":ti,"tag:yaml.org,2002:timestamp":In};function sn(e,t,r){const n=na.get(t);if(n&&!e)return r&&!n.includes(tt)?n.concat(tt):n.slice();let s=n;if(!s)if(Array.isArray(e))s=[];else{const o=Array.from(na.keys()).filter(i=>i!=="yaml11").map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(const o of e)s=s.concat(o);else typeof e=="function"&&(s=e(s.slice()));return r&&(s=s.concat(tt)),s.reduce((o,i)=>{const a=typeof i=="string"?sa[i]:i;if(!a){const c=JSON.stringify(i),l=Object.keys(sa).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}d(sn,"C$a");Th(sn,"getTags");var Lh=Object.defineProperty,Ul=d((e,t)=>Lh(e,"name",{value:t,configurable:!0}),"o$o");const Bh=Ul((e,t)=>e.key<t.key?-1:e.key>t.key?1:0,"sortMapEntriesByKey");let Mh=class Wl{static{d(this,"i")}static{Ul(this,"Schema")}constructor({compat:t,customTags:r,merge:n,resolveKnownTags:s,schema:o,sortMapEntries:i,toStringDefaults:a}){this.compat=Array.isArray(t)?sn(t,"compat"):t?sn(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=s?Dh:{},this.tags=sn(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,lt,{value:sr}),Object.defineProperty(this,Je,{value:En}),Object.defineProperty(this,er,{value:or}),this.sortMapEntries=typeof i=="function"?i:i===!0?Bh:null}clone(){const t=Object.create(Wl.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};var Vh=Object.defineProperty,_h=d((e,t)=>Vh(e,"name",{value:t,configurable:!0}),"u$l");function Gl(e,t){const r=[];let n=t.directives===!0;if(t.directives!==!1&&e.directives){const c=e.directives.toString(e);c?(r.push(c),n=!0):e.directives.docStart&&(n=!0)}n&&r.push("---");const s=_o(e,t),{commentString:o}=s.options;if(e.commentBefore){r.length!==1&&r.unshift("");const c=o(e.commentBefore);r.unshift(qe(c,""))}let i=!1,a=null;if(e.contents){if(ce(e.contents)){if(e.contents.spaceBefore&&n&&r.push(""),e.contents.commentBefore){const p=o(e.contents.commentBefore);r.push(qe(p,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const c=a?void 0:()=>i=!0;let l=Et(e.contents,s,()=>a=null,c);a&&(l+=$t(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(Et(e.contents,s));if(e.directives?.docEnd)if(e.comment){const c=o(e.comment);c.includes(`
73
+ `)?(r.push("..."),r.push(qe(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=e.comment;c&&i&&(c=c.replace(/^\n+/,"")),c&&((!i||a)&&r[r.length-1]!==""&&r.push(""),r.push(qe(o(c),"")))}return r.join(`
74
+ `)+`
75
+ `}d(Gl,"C$9");_h(Gl,"stringifyDocument");var Fh=Object.defineProperty,oo=d((e,t)=>Fh(e,"name",{value:t,configurable:!0}),"f$d");let ni=class Jl{static{d(this,"b")}static{oo(this,"Document")}constructor(t,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Pe,{value:Ys});let s=null;typeof r=="function"||Array.isArray(r)?s=r:n===void 0&&r&&(n=r,r=void 0);const o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:i}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(i=this.directives.yaml.version)):this.directives=new Gt({version:i}),this.setSchema(i,n),this.contents=t===void 0?null:this.createNode(t,s,n)}clone(){const t=Object.create(Jl.prototype,{[Pe]:{value:Ys}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=ce(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){ht(this.contents)&&this.contents.add(t)}addIn(t,r){ht(this.contents)&&this.contents.addIn(t,r)}createAlias(t,r){if(!t.anchor){const n=Do(this);t.anchor=!r||n.has(r)?Lo(r||"a",n):r}return new Mo(t.anchor)}createNode(t,r,n){let s;if(typeof r=="function")t=r.call({"":t},"",t),s=r;else if(Array.isArray(r)){const b=oo($=>typeof $=="number"||$ instanceof String||$ instanceof Number,"keyToStr"),v=r.filter(b).map(String);v.length>0&&(r=r.concat(v)),s=r}else n===void 0&&r&&(n=r,r=void 0);const{aliasDuplicateObjects:o,anchorPrefix:i,flow:a,keepUndefined:c,onTagObj:l,tag:p}=n??{},{onAnchor:f,setAnchors:u,sourceObjects:m}=ll(this,i||"a"),h={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:m},g=Ht(t,p,h);return a&&ae(g)&&(g.flow=!0),u(),g}createPair(t,r,n={}){const s=this.createNode(t,null,n),o=this.createNode(r,null,n);return new Oe(s,o)}delete(t){return ht(this.contents)?this.contents.delete(t):!1}deleteIn(t){return yr(t)?this.contents==null?!1:(this.contents=null,!0):ht(this.contents)?this.contents.deleteIn(t):!1}get(t,r){return ae(this.contents)?this.contents.get(t,r):void 0}getIn(t,r){return yr(t)?!r&&te(this.contents)?this.contents.value:this.contents:ae(this.contents)?this.contents.getIn(t,r):void 0}has(t){return ae(this.contents)?this.contents.has(t):!1}hasIn(t){return yr(t)?this.contents!==void 0:ae(this.contents)?this.contents.hasIn(t):!1}set(t,r){this.contents==null?this.contents=Or(this.schema,[t],r):ht(this.contents)&&this.contents.set(t,r)}setIn(t,r){yr(t)?this.contents=r:this.contents==null?this.contents=Or(this.schema,Array.from(t),r):ht(this.contents)&&this.contents.setIn(t,r)}setSchema(t,r={}){typeof t=="number"&&(t=String(t));let n;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Gt({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Gt({version:t}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new Mh(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:r,mapAsMap:n,maxAliasCount:s,onAnchor:o,reviver:i}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=je(this.contents,r??"",a);if(typeof o=="function")for(const{count:l,res:p}of a.anchors.values())o(p,l);return typeof i=="function"?kt(i,{"":c},"",c):c}toJSON(t,r){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:r})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const r=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Gl(this,t)}};function ht(e){if(ae(e))return!0;throw new Error("Expected a YAML collection as document contents")}d(ht,"o$n");oo(ht,"assertCollection");var qh=Object.defineProperty,Pn=d((e,t)=>qh(e,"name",{value:t,configurable:!0}),"l$b");let Kl=class extends Error{static{d(this,"g")}static{Pn(this,"YAMLError")}constructor(t,r,n,s){super(),this.name=t,this.code=n,this.message=s,this.pos=r}},Ut=class extends Kl{static{d(this,"h")}static{Pn(this,"YAMLParseError")}constructor(t,r,n){super("YAMLParseError",t,r,n)}},Uh=class extends Kl{static{d(this,"m")}static{Pn(this,"YAMLWarning")}constructor(t,r,n){super("YAMLWarning",t,r,n)}};const dn=Pn((e,t)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>t.linePos(a));const{line:n,col:s}=r.linePos[0];r.message+=` at line ${n}, column ${s}`;let o=s-1,i=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&i.length>80){const a=Math.min(o-39,i.length-79);i="…"+i.substring(a),o-=a-1}if(i.length>80&&(i=i.substring(0,79)+"…"),n>1&&/^ *$/.test(i.substring(0,o))){let a=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`…
76
+ `),i=a+i}if(/[^ ]/.test(i)){let a=1;const c=r.linePos[1];c?.line===n&&c.col>s&&(a=Math.max(1,Math.min(c.col-s,80-o)));const l=" ".repeat(o)+"^".repeat(a);r.message+=`:
77
+
78
+ ${i}
79
+ ${l}
80
+ `}},"prettifyError");var Wh=Object.defineProperty,Gh=d((e,t)=>Wh(e,"name",{value:t,configurable:!0}),"g$5");function Ct(e,{flow:t,indicator:r,next:n,offset:s,onError:o,parentIndent:i,startOnNewline:a}){let c=!1,l=a,p=a,f="",u="",m=!1,h=!1,g=null,b=null,v=null,$=null,j=null,x=null,N=null;for(const w of e)switch(h&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&o(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h=!1),g&&(l&&w.type!=="comment"&&w.type!=="newline"&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),w.type){case"space":!t&&(r!=="doc-start"||n?.type!=="flow-collection")&&w.source.includes(" ")&&(g=w),p=!0;break;case"comment":{p||o(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const M=w.source.substring(1)||" ";f?f+=u+M:f=M,u="",l=!1;break}case"newline":l?f?f+=w.source:(!x||r!=="seq-item-ind")&&(c=!0):u+=w.source,l=!0,m=!0,(b||v)&&($=w),p=!0;break;case"anchor":b&&o(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&o(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),b=w,N??(N=w.offset),l=!1,p=!1,h=!0;break;case"tag":{v&&o(w,"MULTIPLE_TAGS","A node can have at most one tag"),v=w,N??(N=w.offset),l=!1,p=!1,h=!0;break}case r:(b||v)&&o(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),x&&o(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${t??"collection"}`),x=w,l=r==="seq-item-ind"||r==="explicit-key-ind",p=!1;break;case"comma":if(t){j&&o(w,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),j=w,l=!1,p=!1;break}default:o(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),l=!1,p=!1}const I=e[e.length-1],_=I?I.offset+I.source.length:s;return h&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(l&&g.indent<=i||n?.type==="block-map"||n?.type==="block-seq")&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:j,found:x,spaceBefore:c,comment:f,hasNewline:m,anchor:b,tag:v,newlineAfterProp:$,end:_,start:N??_}}d(Ct,"C$8");Gh(Ct,"resolveProps");var Jh=Object.defineProperty,Kh=d((e,t)=>Jh(e,"name",{value:t,configurable:!0}),"s$l");function Yt(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
81
+ `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const r of t.start)if(r.type==="newline")return!0;if(t.sep){for(const r of t.sep)if(r.type==="newline")return!0}if(Yt(t.key)||Yt(t.value))return!0}return!1;default:return!0}}d(Yt,"n$j");Kh(Yt,"containsNewline");var zh=Object.defineProperty,Hh=d((e,t)=>zh(e,"name",{value:t,configurable:!0}),"t$m");function fn(e,t,r){if(t?.type==="flow-collection"){const n=t.end[0];n.indent===e&&(n.source==="]"||n.source==="}")&&Yt(t)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}d(fn,"c$s");Hh(fn,"flowIndentCheck");var Yh=Object.defineProperty,Xh=d((e,t)=>Yh(e,"name",{value:t,configurable:!0}),"u$j");function si(e,t,r){const{uniqueKeys:n}=e.options;if(n===!1)return!1;const s=typeof n=="function"?n:(o,i)=>o===i||te(o)&&te(i)&&o.value===i.value;return t.some(o=>s(o.key,r))}d(si,"a$h");Xh(si,"mapIncludes");var Qh=Object.defineProperty,Zh=d((e,t)=>Qh(e,"name",{value:t,configurable:!0}),"w$8");const oa="All mapping items must start at the same column";function zl({composeNode:e,composeEmptyNode:t},r,n,s,o){const i=o?.nodeClass??Ie,a=new i(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(const p of n.items){const{start:f,key:u,sep:m,value:h}=p,g=Ct(f,{indicator:"explicit-key-ind",next:u??m?.[0],offset:c,onError:s,parentIndent:n.indent,startOnNewline:!0}),b=!g.found;if(b){if(u&&(u.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==n.indent&&s(c,"BAD_INDENT",oa)),!g.anchor&&!g.tag&&!m){l=g.end,g.comment&&(a.comment?a.comment+=`
82
+ `+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||Yt(u))&&s(u??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==n.indent&&s(c,"BAD_INDENT",oa);r.atKey=!0;const v=g.end,$=u?e(r,u,g,s):t(r,v,f,null,g,s);r.schema.compat&&fn(n.indent,u,s),r.atKey=!1,si(r,a.items,$)&&s(v,"DUPLICATE_KEY","Map keys must be unique");const j=Ct(m??[],{indicator:"map-value-ind",next:h,offset:$.range[2],onError:s,parentIndent:n.indent,startOnNewline:!u||u.type==="block-scalar"});if(c=j.end,j.found){b&&(h?.type==="block-map"&&!j.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&g.start<j.found.offset-1024&&s($.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const x=h?e(r,h,j,s):t(r,c,m,null,j,s);r.schema.compat&&fn(n.indent,h,s),c=x.range[2];const N=new Oe($,x);r.options.keepSourceTokens&&(N.srcToken=p),a.items.push(N)}else{b&&s($.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),j.comment&&($.comment?$.comment+=`
83
+ `+j.comment:$.comment=j.comment);const x=new Oe($);r.options.keepSourceTokens&&(x.srcToken=p),a.items.push(x)}}return l&&l<c&&s(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,c,l??c],a}d(zl,"v$7");Zh(zl,"resolveBlockMap");var ey=Object.defineProperty,ty=d((e,t)=>ey(e,"name",{value:t,configurable:!0}),"u$i");function Hl({composeNode:e,composeEmptyNode:t},r,n,s,o){const i=o?.nodeClass??Rt,a=new i(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(const{start:p,value:f}of n.items){const u=Ct(p,{indicator:"seq-item-ind",next:f,offset:c,onError:s,parentIndent:n.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||f)f?.type==="block-seq"?s(u.end,"BAD_INDENT","All sequence items must start at the same column"):s(c,"MISSING_CHAR","Sequence item without - indicator");else{l=u.end,u.comment&&(a.comment=u.comment);continue}const m=f?e(r,f,u,s):t(r,u.end,p,null,u,s);r.schema.compat&&fn(n.indent,f,s),c=m.range[2],a.items.push(m)}return a.range=[n.offset,c,l??c],a}d(Hl,"S$b");ty(Hl,"resolveBlockSeq");var ry=Object.defineProperty,ny=d((e,t)=>ry(e,"name",{value:t,configurable:!0}),"f$b");function ir(e,t,r,n){let s="";if(e){let o=!1,i="";for(const a of e){const{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=c.substring(1)||" ";s?s+=i+p:s=p,i="";break}case"newline":s&&(i+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:s,offset:t}}d(ir,"u$h");ny(ir,"resolveEnd");var sy=Object.defineProperty,Yl=d((e,t)=>sy(e,"name",{value:t,configurable:!0}),"T$a");const Zn="Block collections are not allowed within flow collections",es=Yl(e=>e&&(e.type==="block-map"||e.type==="block-seq"),"isBlock");function Xl({composeNode:e,composeEmptyNode:t},r,n,s,o){const i=n.start.source==="{",a=i?"flow map":"flow sequence",c=o?.nodeClass??(i?Ie:Rt),l=new c(r.schema);l.flow=!0;const p=r.atRoot;p&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset+n.start.source.length;for(let b=0;b<n.items.length;++b){const v=n.items[b],{start:$,key:j,sep:x,value:N}=v,I=Ct($,{flow:a,indicator:"explicit-key-ind",next:j??x?.[0],offset:f,onError:s,parentIndent:n.indent,startOnNewline:!1});if(!I.found){if(!I.anchor&&!I.tag&&!x&&!N){b===0&&I.comma?s(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):b<n.items.length-1&&s(I.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),I.comment&&(l.comment?l.comment+=`
84
+ `+I.comment:l.comment=I.comment),f=I.end;continue}!i&&r.options.strict&&Yt(j)&&s(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(b===0)I.comma&&s(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(I.comma||s(I.start,"MISSING_CHAR",`Missing , between ${a} items`),I.comment){let _="";e:for(const w of $)switch(w.type){case"comma":case"space":break;case"comment":_=w.source.substring(1);break e;default:break e}if(_){let w=l.items[l.items.length-1];pe(w)&&(w=w.value??w.key),w.comment?w.comment+=`
85
+ `+_:w.comment=_,I.comment=I.comment.substring(_.length+1)}}if(!i&&!x&&!I.found){const _=N?e(r,N,I,s):t(r,I.end,x,null,I,s);l.items.push(_),f=_.range[2],es(N)&&s(_.range,"BLOCK_IN_FLOW",Zn)}else{r.atKey=!0;const _=I.end,w=j?e(r,j,I,s):t(r,_,$,null,I,s);es(j)&&s(w.range,"BLOCK_IN_FLOW",Zn),r.atKey=!1;const M=Ct(x??[],{flow:a,indicator:"map-value-ind",next:N,offset:w.range[2],onError:s,parentIndent:n.indent,startOnNewline:!1});if(M.found){if(!i&&!I.found&&r.options.strict){if(x)for(const ee of x){if(ee===M.found)break;if(ee.type==="newline"){s(ee,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}I.start<M.found.offset-1024&&s(M.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else N&&("source"in N&&N.source?.[0]===":"?s(N,"MISSING_CHAR",`Missing space after : in ${a}`):s(M.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const L=N?e(r,N,M,s):M.found?t(r,M.end,x,null,M,s):null;L?es(N)&&s(L.range,"BLOCK_IN_FLOW",Zn):M.comment&&(w.comment?w.comment+=`
86
+ `+M.comment:w.comment=M.comment);const be=new Oe(w,L);if(r.options.keepSourceTokens&&(be.srcToken=v),i){const ee=l;si(r,ee.items,w)&&s(_,"DUPLICATE_KEY","Map keys must be unique"),ee.items.push(be)}else{const ee=new Ie(r.schema);ee.flow=!0,ee.items.push(be);const Xe=(L??w).range;ee.range=[w.range[0],Xe[1],Xe[2]],l.items.push(ee)}f=L?L.range[2]:M.end}}const u=i?"}":"]",[m,...h]=n.end;let g=f;if(m?.source===u)g=m.offset+m.source.length;else{const b=a[0].toUpperCase()+a.substring(1),v=p?`${b} must end with a ${u}`:`${b} in block collection must be sufficiently indented and end with a ${u}`;s(f,p?"MISSING_CHAR":"BAD_INDENT",v),m&&m.source.length!==1&&h.unshift(m)}if(h.length>0){const b=ir(h,g,r.options.strict,s);b.comment&&(l.comment?l.comment+=`
87
+ `+b.comment:l.comment=b.comment),l.range=[n.offset,g,b.offset]}else l.range=[n.offset,g,g];return l}d(Xl,"F$a");Yl(Xl,"resolveFlowCollection");var oy=Object.defineProperty,Ql=d((e,t)=>oy(e,"name",{value:t,configurable:!0}),"u$g");function on(e,t,r,n,s,o){const i=r.type==="block-map"?zl(e,t,r,n,o):r.type==="block-seq"?Hl(e,t,r,n,o):Xl(e,t,r,n,o),a=i.constructor;return s==="!"||s===a.tagName?(i.tag=a.tagName,i):(s&&(i.tag=s),i)}d(on,"A$e");Ql(on,"resolveCollection");function Zl(e,t,r,n,s){const o=n.tag,i=o?t.directives.tagName(o.source,u=>s(o,"TAG_RESOLVE_FAILED",u)):null;if(r.type==="block-seq"){const{anchor:u,newlineAfterProp:m}=n,h=u&&o?u.offset>o.offset?u:o:u??o;h&&(!m||m.offset<h.offset)&&s(h,"MISSING_CHAR","Missing newline after block sequence props")}const a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!o||!i||i==="!"||i===Ie.tagName&&a==="map"||i===Rt.tagName&&a==="seq")return on(e,t,r,s,i);let c=t.schema.tags.find(u=>u.tag===i&&u.collection===a);if(!c){const u=t.schema.knownTags[i];if(u?.collection===a)t.schema.tags.push(Object.assign({},u,{default:!1})),c=u;else return u?s(o,"BAD_COLLECTION_TYPE",`${u.tag} used for ${a} collection, but expects ${u.collection??"scalar"}`,!0):s(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,!0),on(e,t,r,s,i)}const l=on(e,t,r,s,i,c),p=c.resolve?.(l,u=>s(o,"TAG_RESOLVE_FAILED",u),t.options)??l,f=ce(p)?p:new W(p);return f.range=l.range,f.tag=i,c?.format&&(f.format=c.format),f}d(Zl,"I$8");Ql(Zl,"composeCollection");var iy=Object.defineProperty,oi=d((e,t)=>iy(e,"name",{value:t,configurable:!0}),"B$6");function ii(e,t,r){const n=t.offset,s=ep(t,e.options.strict,r);if(!s)return{value:"",type:null,comment:"",range:[n,n,n]};const o=s.mode===">"?W.BLOCK_FOLDED:W.BLOCK_LITERAL,i=t.source?tp(t.source):[];let a=i.length;for(let g=i.length-1;g>=0;--g){const b=i[g][1];if(b===""||b==="\r")a=g;else break}if(a===0){const g=s.chomp==="+"&&i.length>0?`
88
+ `.repeat(Math.max(1,i.length-1)):"";let b=n+s.length;return t.source&&(b+=t.source.length),{value:g,type:o,comment:s.comment,range:[n,b,b]}}let c=t.indent+s.indent,l=t.offset+s.length,p=0;for(let g=0;g<a;++g){const[b,v]=i[g];if(v===""||v==="\r")s.indent===0&&b.length>c&&(c=b.length);else{b.length<c&&r(l+b.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(c=b.length),p=g,c===0&&!e.atRoot&&r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=b.length+v.length+1}for(let g=i.length-1;g>=a;--g)i[g][0].length>c&&(a=g+1);let f="",u="",m=!1;for(let g=0;g<p;++g)f+=i[g][0].slice(c)+`
89
+ `;for(let g=p;g<a;++g){let[b,v]=i[g];l+=b.length+v.length+1;const $=v[v.length-1]==="\r";if($&&(v=v.slice(0,-1)),v&&b.length<c){const j=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;r(l-v.length-($?2:1),"BAD_INDENT",j),b=""}o===W.BLOCK_LITERAL?(f+=u+b.slice(c)+v,u=`
90
+ `):b.length>c||v[0]===" "?(u===" "?u=`
91
+ `:!m&&u===`
92
+ `&&(u=`
93
+
94
+ `),f+=u+b.slice(c)+v,u=`
95
+ `,m=!0):v===""?u===`
96
+ `?f+=`
97
+ `:u=`
98
+ `:(f+=u+v,u=" ",m=!1)}switch(s.chomp){case"-":break;case"+":for(let g=a;g<i.length;++g)f+=`
99
+ `+i[g][0].slice(c);f[f.length-1]!==`
100
+ `&&(f+=`
101
+ `);break;default:f+=`
102
+ `}const h=n+s.length+t.source.length;return{value:f,type:o,comment:s.comment,range:[n,h,h]}}d(ii,"E$c");oi(ii,"resolveBlockScalar");function ep({offset:e,props:t},r,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],o=s[0];let i=0,a="",c=-1;for(let u=1;u<s.length;++u){const m=s[u];if(!a&&(m==="-"||m==="+"))a=m;else{const h=Number(m);!i&&h?i=h:c===-1&&(c=e+u)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let l=!1,p="",f=s.length;for(let u=1;u<t.length;++u){const m=t[u];switch(m.type){case"space":l=!0;case"newline":f+=m.source.length;break;case"comment":r&&!l&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=m.source.length,p=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),f+=m.source.length;break;default:{const h=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",h);const g=m.source;g&&typeof g=="string"&&(f+=g.length)}}}return{mode:o,indent:i,chomp:a,comment:p,length:f}}d(ep,"L$b");oi(ep,"parseBlockScalarHeader");function tp(e){const t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let o=1;o<t.length;o+=2)s.push([t[o],t[o+1]]);return s}d(tp,"T$9");oi(tp,"splitLines");var ay=Object.defineProperty,dt=d((e,t)=>ay(e,"name",{value:t,configurable:!0}),"r$s");function ai(e,t,r){const{offset:n,type:s,source:o,end:i}=e;let a,c;const l=dt((u,m,h)=>r(n+u,m,h),"_onError");switch(s){case"scalar":a=W.PLAIN,c=rp(o,l);break;case"single-quoted-scalar":a=W.QUOTE_SINGLE,c=np(o,l);break;case"double-quoted-scalar":a=W.QUOTE_DOUBLE,c=sp(o,l);break;default:return r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}const p=n+o.length,f=ir(i,p,t,r);return{value:c,type:a,comment:f.comment,range:[n,p,f.offset]}}d(ai,"_$7");dt(ai,"resolveFlowScalar");function rp(e,t){let r="";switch(e[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${e[0]}`;break}case"@":case"`":{r=`reserved character ${e[0]}`;break}}return r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),ci(e)}d(rp,"v$6");dt(rp,"plainValue");function np(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),ci(e.slice(1,-1)).replace(/''/g,"'")}d(np,"I$7");dt(np,"singleQuotedValue");function ci(e){let t,r;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
103
+ `,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
104
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=t.exec(e);if(!n)return e;let s=n[1],o=" ",i=t.lastIndex;for(r.lastIndex=i;n=r.exec(e);)n[1]===""?o===`
105
+ `?s+=o:o=`
106
+ `:(s+=o+n[1],o=" "),i=r.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=i,n=a.exec(e),s+o+(n?.[1]??"")}d(ci,"b$c");dt(ci,"foldLines");function sp(e,t){let r="";for(let n=1;n<e.length-1;++n){const s=e[n];if(!(s==="\r"&&e[n+1]===`
107
+ `))if(s===`
108
+ `){const{fold:o,offset:i}=op(e,n);r+=o,n=i}else if(s==="\\"){let o=e[++n];const i=cy[o];if(i)r+=i;else if(o===`
109
+ `)for(o=e[n+1];o===" "||o===" ";)o=e[++n+1];else if(o==="\r"&&e[n+1]===`
110
+ `)for(o=e[++n+1];o===" "||o===" ";)o=e[++n+1];else if(o==="x"||o==="u"||o==="U"){const a=o==="x"?2:o==="u"?4:8;r+=ip(e,n+1,a,t),n+=a}else{const a=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(s===" "||s===" "){const o=n;let i=e[n+1];for(;i===" "||i===" ";)i=e[++n+1];i!==`
111
+ `&&!(i==="\r"&&e[n+2]===`
112
+ `)&&(r+=n>o?e.slice(o,n+1):s)}else r+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),r}d(sp,"S$9");dt(sp,"doubleQuotedValue");function op(e,t){let r="",n=e[t+1];for(;(n===" "||n===" "||n===`
113
+ `||n==="\r")&&!(n==="\r"&&e[t+2]!==`
114
+ `);)n===`
115
+ `&&(r+=`
116
+ `),t+=1,n=e[t+1];return r||(r=" "),{fold:r,offset:t}}d(op,"k$b");dt(op,"foldNewline");const cy={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
117
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function ip(e,t,r,n){const s=e.substr(t,r),o=s.length===r&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(o)}catch{const i=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),i}}d(ip,"A$d");dt(ip,"parseCharCode");var ly=Object.defineProperty,li=d((e,t)=>ly(e,"name",{value:t,configurable:!0}),"m$6");function pi(e,t,r,n){const{value:s,type:o,comment:i,range:a}=t.type==="block-scalar"?ii(e,t,n):ai(t,e.options.strict,n),c=r?e.directives.tagName(r.source,f=>n(r,"TAG_RESOLVE_FAILED",f)):null;let l;e.options.stringKeys&&e.atKey?l=e.schema[Je]:c?l=ap(e.schema,s,c,r,n):t.type==="scalar"?l=cp(e,s,t,n):l=e.schema[Je];let p;try{const f=l.resolve(s,u=>n(r??t,"TAG_RESOLVE_FAILED",u),e.options);p=te(f)?f:new W(f)}catch(f){const u=f instanceof Error?f.message:String(f);n(r??t,"TAG_RESOLVE_FAILED",u),p=new W(s)}return p.range=a,p.source=s,o&&(p.type=o),c&&(p.tag=c),l.format&&(p.format=l.format),i&&(p.comment=i),p}d(pi,"E$b");li(pi,"composeScalar");function ap(e,t,r,n,s){if(r==="!")return e[Je];const o=[];for(const a of e.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(const a of o)if(a.test?.test(t))return a;const i=e.knownTags[r];return i&&!i.collection?(e.tags.push(Object.assign({},i,{default:!1,test:void 0})),i):(s(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),e[Je])}d(ap,"_$6");li(ap,"findScalarTagByName");function cp({atKey:e,directives:t,schema:r},n,s,o){const i=r.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(n))||r[Je];if(r.compat){const a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Je];if(i.tag!==a.tag){const c=t.tagString(i.tag),l=t.tagString(a.tag),p=`Value may be parsed as either ${c} or ${l}`;o(s,"TAG_RESOLVE_FAILED",p,!0)}}return i}d(cp,"F$9");li(cp,"findScalarTagByTest");var py=Object.defineProperty,uy=d((e,t)=>py(e,"name",{value:t,configurable:!0}),"a$g");function lp(e,t,r){if(t){r??(r=t.length);for(let n=r-1;n>=0;--n){let s=t[n];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++n];s?.type==="space";)e+=s.source.length,s=t[++n];break}}return e}d(lp,"s$k");uy(lp,"emptyScalarPosition");var dy=Object.defineProperty,ui=d((e,t)=>dy(e,"name",{value:t,configurable:!0}),"u$f");const fy={composeNode:di,composeEmptyNode:An};function di(e,t,r,n){const s=e.atKey,{spaceBefore:o,comment:i,anchor:a,tag:c}=r;let l,p=!0;switch(t.type){case"alias":l=pp(e,t,n),(a||c)&&n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=pi(e,t,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Zl(fy,e,t,r,n),a&&(l.anchor=a.source.substring(1))}catch(f){const u=f instanceof Error?f.message:String(f);n(t,"RESOURCE_EXHAUSTION",u)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",f),p=!1}}return l??(l=An(e,t.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!te(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),i&&(t.type==="scalar"&&t.source===""?l.comment=i:l.commentBefore=i),e.options.keepSourceTokens&&p&&(l.srcToken=t),l}d(di,"A$c");ui(di,"composeNode");function An(e,t,r,n,{spaceBefore:s,comment:o,anchor:i,tag:a,end:c},l){const p={type:"scalar",offset:lp(t,r,n),indent:-1,source:""},f=pi(e,p,a,l);return i&&(f.anchor=i.source.substring(1),f.anchor===""&&l(i,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(f.spaceBefore=!0),o&&(f.comment=o,f.range[2]=c),f}d(An,"p$d");ui(An,"composeEmptyNode");function pp({options:e},{offset:t,source:r,end:n},s){const o=new Mo(r.substring(1));o.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&s(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const i=t+r.length,a=ir(n,i,e.strict,s);return o.range=[t,i,a.offset],a.comment&&(o.comment=a.comment),o}d(pp,"I$6");ui(pp,"composeAlias");var my=Object.defineProperty,gy=d((e,t)=>my(e,"name",{value:t,configurable:!0}),"f$a");function up(e,t,{offset:r,start:n,value:s,end:o},i){const a=Object.assign({_directives:t},e),c=new ni(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},p=Ct(n,{indicator:"doc-start",next:s??o?.[0],offset:r,onError:i,parentIndent:0,startOnNewline:!0});p.found&&(c.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!p.hasNewline&&i(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=s?di(l,s,p,i):An(l,p.end,n,null,p,i);const f=c.contents.range[2],u=ir(o,f,!1,i);return u.comment&&(c.comment=u.comment),c.range=[r,f,u.offset],c}d(up,"b$b");gy(up,"composeDoc");var hy=Object.defineProperty,fi=d((e,t)=>hy(e,"name",{value:t,configurable:!0}),"h$b");function Ft(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:r}=e;return[t,t+(typeof r=="string"?r.length:1)]}d(Ft,"c$r");fi(Ft,"getErrorPos");function io(e){let t="",r=!1,n=!1;for(let s=0;s<e.length;++s){const o=e[s];switch(o[0]){case"#":t+=(t===""?"":n?`
118
+
119
+ `:`
120
+ `)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":e[s+1]?.[0]!=="#"&&(s+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:t,afterEmptyLine:n}}d(io,"m$5");fi(io,"parsePrelude");let dp=class{static{d(this,"w")}static{fi(this,"Composer")}constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,s,o)=>{const i=Ft(r);o?this.warnings.push(new Uh(i,n,s)):this.errors.push(new Ut(i,n,s))},this.directives=new Gt({version:t.version||"1.2"}),this.options=t}decorate(t,r){const{comment:n,afterEmptyLine:s}=io(this.prelude);if(n){const o=t.contents;if(r)t.comment=t.comment?`${t.comment}
121
+ ${n}`:n;else if(s||t.directives.docStart||!o)t.commentBefore=n;else if(ae(o)&&!o.flow&&o.items.length>0){let i=o.items[0];pe(i)&&(i=i.key);const a=i.commentBefore;i.commentBefore=a?`${n}
122
+ ${a}`:n}else{const i=o.commentBefore;o.commentBefore=i?`${n}
123
+ ${i}`:n}}r?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:io(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,r=!1,n=-1){for(const s of t)yield*this.next(s);yield*this.end(r,n)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(r,n,s)=>{const o=Ft(t);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const r=up(this.options,this.directives,t,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const r=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new Ut(Ft(t),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const n="Unexpected doc-end without preceding document";this.errors.push(new Ut(Ft(t),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const r=ir(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){const n=this.doc.comment;this.doc.comment=n?`${n}
124
+ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Ut(Ft(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const n=Object.assign({_directives:this.directives},this.options),s=new ni(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,r,r],this.decorate(s,!1),yield s}}};var yy=Object.defineProperty,Lt=d((e,t)=>yy(e,"name",{value:t,configurable:!0}),"i$d");function vy(e,t=!0,r){if(e){const n=Lt((s,o,i)=>{const a=typeof s=="number"?s:Array.isArray(s)?s[0]:s.offset;if(r)r(a,o,i);else throw new Ut([a,a+1],o,i)},"_onError");switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return ai(e,t,n);case"block-scalar":return ii({options:{strict:t}},e,n)}}return null}d(vy,"q$5");Lt(vy,"resolveAsScalar");function by(e,t){const{implicitKey:r=!1,indent:n,inFlow:s=!1,offset:o=-1,type:i="PLAIN"}=t,a=nr({type:i,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:n,source:`
125
+ `}];switch(a[0]){case"|":case">":{const l=a.indexOf(`
126
+ `),p=a.substring(0,l),f=a.substring(l+1)+`
127
+ `,u=[{type:"block-scalar-header",offset:o,indent:n,source:p}];return mi(u,c)||u.push({type:"newline",offset:-1,indent:n,source:`
128
+ `}),{type:"block-scalar",offset:o,indent:n,props:u,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}d(by,"E$a");Lt(by,"createScalarToken");function ky(e,t,r={}){let{afterKey:n=!1,implicitKey:s=!1,inFlow:o=!1,type:i}=r,a="indent"in e?e.indent:null;if(n&&typeof a=="number"&&(a+=2),!i)switch(e.type){case"single-quoted-scalar":i="QUOTE_SINGLE";break;case"double-quoted-scalar":i="QUOTE_DOUBLE";break;case"block-scalar":{const l=e.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:i="PLAIN"}const c=nr({type:i,value:t},{implicitKey:s||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":fp(e,c);break;case'"':an(e,c,"double-quoted-scalar");break;case"'":an(e,c,"single-quoted-scalar");break;default:an(e,c,"scalar")}}d(ky,"L$a");Lt(ky,"setScalarValue");function fp(e,t){const r=t.indexOf(`
129
+ `),n=t.substring(0,r),s=t.substring(r+1)+`
130
+ `;if(e.type==="block-scalar"){const o=e.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=n,e.source=s}else{const{offset:o}=e,i="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:i,source:n}];mi(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:i,source:`
131
+ `});for(const c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:i,props:a,source:s})}}d(fp,"A$b");Lt(fp,"setBlockScalarValue");function mi(e,t){if(t)for(const r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}d(mi,"b$a");Lt(mi,"addEndtoBlockProps");function an(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{const n=e.props.slice(1);let s=t.length;e.props[0].type==="block-scalar-header"&&(s-=e.props[0].source.length);for(const o of n)o.offset+=s;delete e.props,Object.assign(e,{type:r,source:t,end:n});break}case"block-map":case"block-seq":{const n={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
132
+ `};delete e.items,Object.assign(e,{type:r,source:t,end:[n]});break}default:{const n="indent"in e?e.indent:-1,s="end"in e&&Array.isArray(e.end)?e.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(const o of Object.keys(e))o!=="type"&&o!=="offset"&&delete e[o];Object.assign(e,{type:r,indent:n,source:t,end:s})}}}d(an,"u$e");Lt(an,"setFlowScalarValue");var $y=Object.defineProperty,gi=d((e,t)=>$y(e,"name",{value:t,configurable:!0}),"t$l");gi(e=>"type"in e?Nr(e):Sr(e),"stringify");function Nr(e){switch(e.type){case"block-scalar":{let t="";for(const r of e.props)t+=Nr(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(const r of e.items)t+=Sr(r);return t}case"flow-collection":{let t=e.start.source;for(const r of e.items)t+=Sr(r);for(const r of e.end)t+=r.source;return t}case"document":{let t=Sr(e);if(e.end)for(const r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const r of e.end)t+=r.source;return t}}}d(Nr,"f$8");gi(Nr,"stringifyToken");function Sr({start:e,key:t,sep:r,value:n}){let s="";for(const o of e)s+=o.source;if(t&&(s+=Nr(t)),r)for(const o of r)s+=o.source;return n&&(s+=Nr(n)),s}d(Sr,"c$q");gi(Sr,"stringifyItem");var wy=Object.defineProperty,mp=d((e,t)=>wy(e,"name",{value:t,configurable:!0}),"s$j");const ao=Symbol("break visit"),Sy=Symbol("skip children"),gp=Symbol("remove item");function xt(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),hi(Object.freeze([]),e,t)}d(xt,"l$8");mp(xt,"visit");xt.BREAK=ao;xt.SKIP=Sy;xt.REMOVE=gp;xt.itemAtPath=(e,t)=>{let r=e;for(const[n,s]of t){const o=r?.[n];if(o&&"items"in o)r=o.items[s];else return}return r};xt.parentCollection=(e,t)=>{const r=xt.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],s=r?.[n];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function hi(e,t,r){let n=r(t,e);if(typeof n=="symbol")return n;for(const s of["key","value"]){const o=t[s];if(o&&"items"in o){for(let i=0;i<o.items.length;++i){const a=hi(Object.freeze(e.concat([[s,i]])),o.items[i],r);if(typeof a=="number")i=a-1;else{if(a===ao)return ao;a===gp&&(o.items.splice(i,1),i-=1)}}typeof n=="function"&&s==="key"&&(n=n(t,e))}}return typeof n=="function"?n(t,e):n}d(hi,"y$9");mp(hi,"_visit");var jy=Object.defineProperty,Tn=d((e,t)=>jy(e,"name",{value:t,configurable:!0}),"r$r");const yi="\uFEFF",vi="",bi="",mn="";Tn(e=>!!e&&"items"in e,"isCollection");Tn(e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar"),"isScalar");function Oy(e){switch(e){case yi:return"<BOM>";case vi:return"<DOC>";case bi:return"<FLOW_END>";case mn:return"<SCALAR>";default:return JSON.stringify(e)}}d(Oy,"i$c");Tn(Oy,"prettyToken");function hp(e){switch(e){case yi:return"byte-order-mark";case vi:return"doc-mode";case bi:return"flow-error-end";case mn:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
133
+ `:case`\r
134
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}d(hp,"d$8");Tn(hp,"tokenType");var Ey=Object.defineProperty,ki=d((e,t)=>Ey(e,"name",{value:t,configurable:!0}),"a$e");function xe(e){switch(e){case void 0:case" ":case`
135
+ `:case"\r":case" ":return!0;default:return!1}}d(xe,"n$i");ki(xe,"isEmpty");const ia=new Set("0123456789ABCDEFabcdef"),Ry=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Qr=new Set(",[]{}"),Cy=new Set(` ,[]{}
136
+ \r `),ts=ki(e=>!e||Cy.has(e),"isNotAnchorChar");let xy=class{static{d(this,"k")}static{ki(this,"Lexer")}constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,r=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let t=this.pos,r=this.buffer[t];for(;r===" "||r===" ";)r=this.buffer[++t];return!r||r==="#"||r===`
137
+ `?!0:r==="\r"?this.buffer[t+1]===`
138
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let r=this.buffer[t];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+t];if(r==="\r"){const s=this.buffer[n+t+1];if(s===`
139
+ `||!s&&!this.atEnd)return t+n+1}return r===`
140
+ `||n>=this.indentNext||!r&&!this.atEnd?t+n:-1}if(r==="-"||r==="."){const n=this.buffer.substr(t,3);if((n==="---"||n==="...")&&xe(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
141
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===yi&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let r=t.length,n=t.indexOf("#");for(;n!==-1;){const o=t[n-1];if(o===" "||o===" "){r=n-1;break}else n=t.indexOf("#",n+1)}for(;;){const o=t[r-1];if(o===" "||o===" ")r-=1;else break}const s=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const r=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-r),yield*this.pushNewline(),"stream"}return yield vi,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const r=this.peek(3);if((r==="---"||r==="...")&&xe(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!xe(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&xe(r)){const n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(t[r]){case"#":yield*this.pushCount(t.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(ts),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,r,n=-1;do t=yield*this.pushNewline(),t>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(t+r>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&s[0]!=="#"||n===0&&(s.startsWith("---")||s.startsWith("..."))&&xe(s[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield bi,yield*this.parseLineStart();let o=0;for(;s[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),s[o]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(ts),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const i=this.charAt(1);if(this.flowKey||xe(i)||i===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let r=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let o=0;for(;this.buffer[r-1-o]==="\\";)o+=1;if(o%2===0)break;r=this.buffer.indexOf('"',r+1)}const n=this.buffer.substring(0,r);let s=n.indexOf(`
142
+ `,this.pos);if(s!==-1){for(;s!==-1;){const o=this.continueScalar(s+1);if(o===-1)break;s=n.indexOf(`
143
+ `,o)}s!==-1&&(r=s-(n[s-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const r=this.buffer[++t];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>xe(r)||r==="#")}*parseBlockScalar(){let t=this.pos-1,r=0,n;e:for(let o=this.pos;n=this.buffer[o];++o)switch(n){case" ":r+=1;break;case`
144
+ `:t=o,r=0;break;case"\r":{const i=this.buffer[o+1];if(!i&&!this.atEnd)return this.setNext("block-scalar");if(i===`
145
+ `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(`
146
+ `,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(n=this.buffer[s];n===" ";)n=this.buffer[++s];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
147
+ `;)n=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let o=t-1,i=this.buffer[o];i==="\r"&&(i=this.buffer[--o]);const a=o;for(;i===" ";)i=this.buffer[--o];if(i===`
148
+ `&&o>=this.pos&&o+1+r>a)t=o;else break}while(!0);return yield mn,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let r=this.pos-1,n=this.pos-1,s;for(;s=this.buffer[++n];)if(s===":"){const o=this.buffer[n+1];if(xe(o)||t&&Qr.has(o))break;r=n}else if(xe(s)){let o=this.buffer[n+1];if(s==="\r"&&(o===`
149
+ `?(n+=1,s=`
150
+ `,o=this.buffer[n+1]):r=n),o==="#"||t&&Qr.has(o))break;if(s===`
151
+ `){const i=this.continueScalar(n+1);if(i===-1)break;n=Math.max(n,i-2)}}else{if(t&&Qr.has(s))break;r=n}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield mn,yield*this.pushToIndex(r+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,r){const n=this.buffer.slice(this.pos,t);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(ts))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,r=this.charAt(1);if(xe(r)||t&&Qr.has(r))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,r=this.buffer[t];for(;!xe(r)&&r!==">";)r=this.buffer[++t];return yield*this.pushToIndex(r===">"?t+1:t,!1)}else{let t=this.pos+1,r=this.buffer[t];for(;r;)if(Ry.has(r))r=this.buffer[++t];else if(r==="%"&&ia.has(this.buffer[t+1])&&ia.has(this.buffer[t+2]))r=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
152
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
153
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||t&&n===" ");const s=r-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=r),s}*pushUntil(t){let r=this.pos,n=this.buffer[r];for(;!t(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};var Ny=Object.defineProperty,Iy=d((e,t)=>Ny(e,"name",{value:t,configurable:!0}),"s$h");let Py=class{static{d(this,"a")}static{Iy(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let r=0,n=this.lineStarts.length;for(;r<n;){const o=r+n>>1;this.lineStarts[o]<t?r=o+1:n=o}if(this.lineStarts[r]===t)return{line:r+1,col:1};if(r===0)return{line:0,col:t};const s=this.lineStarts[r-1];return{line:r,col:t-s+1}}}};var Ay=Object.defineProperty,Bt=d((e,t)=>Ay(e,"name",{value:t,configurable:!0}),"c$o");function et(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}d(et,"r$q");Bt(et,"includesToken");function co(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}d(co,"f$6");Bt(co,"findNonEmptyIndex");function $i(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}d($i,"y$8");Bt($i,"isFlowToken");function br(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}d(br,"u$9");Bt(br,"getPrevProps");function yt(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}d(yt,"h$9");Bt(yt,"getFirstKeyStartProps");function lo(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!et(t.start,"explicit-key-ind")&&!et(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,$i(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}d(lo,"d$7");Bt(lo,"fixFlowSeqItems");let yp=class{static{d(this,"b")}static{Bt(this,"Parser")}constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new xy,this.onNewLine=t}*parse(t,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const n of this.lexer.lex(t,r))yield*this.next(n);r||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const r=hp(t);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const n=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const r=t??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{const n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&lo(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{const s=n.items[n.items.length-1];if(s.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=r;else{Object.assign(s,{key:r,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=n.items[n.items.length-1];s.value?n.items.push({start:[],value:r}):s.value=r;break}case"flow-collection":{const s=n.items[n.items.length-1];!s||s.value?n.items.push({start:[],key:r,sep:[]}):s.sep?s.value=r:Object.assign(s,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){const s=r.items[r.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&co(s.start)===-1&&(r.indent===0||s.start.every(o=>o.type!=="comment"||o.indent<r.indent))&&(n.type==="document"?n.end=s.start:n.items.push({start:s.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{co(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const r=br(this.peek(2)),n=yt(r);let s;t.end?(s=t.end,s.push(this.sourceToken),delete t.end):s=[this.sourceToken];const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:n,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
154
+ `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
155
+ `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const r=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){const n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)t.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,t.indent)){const n=t.items[t.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,r.start),n.push(this.sourceToken),t.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const n=!this.onKeyLine&&this.indent===t.indent,s=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(s&&r.sep&&!r.value){const i=[];for(let a=0;a<r.sep.length;++a){const c=r.sep[a];switch(c.type){case"newline":i.push(a);break;case"space":break;case"comment":c.indent>t.indent&&(i.length=0);break;default:i.length=0}}i.length>=2&&(o=r.sep.splice(i[1]))}switch(this.type){case"anchor":case"tag":s||r.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):s||r.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(et(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if($i(r.key)&&!et(r.sep,"newline")){const i=yt(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(et(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{const i=yt(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||s?t.items.push({start:o,key:null,sep:[this.sourceToken]}):et(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);s||r.value?(t.items.push({start:o,key:i,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(i):(Object.assign(r,{key:i,sep:[]}),this.onKeyLine=!0);return}default:{const i=this.startBlockValue(t);if(i){if(i.type==="block-seq"){if(!r.explicitKey&&r.sep&&!et(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&t.items.push({start:o});this.stack.push(i);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const r=t.items[t.items.length-1];switch(this.type){case"newline":if(r.value){const n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,t.indent)){const n=t.items[t.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,r.start),n.push(this.sourceToken),t.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=t.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;r.value||et(r.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>t.indent){const n=this.startBlockValue(t);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const r=t.items[t.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?t.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?t.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!r||r.value?t.items.push({start:[],key:s,sep:[]}):r.sep?this.stack.push(s):Object.assign(r,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===t.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){const s=br(n),o=yt(s);lo(t);const i=t.end.splice(1,t.end.length);i.push(this.sourceToken);const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let r=this.source.indexOf(`
156
+ `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
157
+ `,r)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const r=br(t),n=yt(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const r=br(t),n=yt(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,r){return this.type!=="comment"||this.indent<=r?!1:t.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};var Ty=Object.defineProperty,Ur=d((e,t)=>Ty(e,"name",{value:t,configurable:!0}),"s$g");function wi(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Py||null,prettyErrors:t}}d(wi,"a$c");Ur(wi,"parseOptions");function Dy(e,t={}){const{lineCounter:r,prettyErrors:n}=wi(t),s=new yp(r?.addNewLine),o=new dp(t),i=Array.from(o.compose(s.parse(e)));if(n&&r)for(const a of i)a.errors.forEach(dn(e,r)),a.warnings.forEach(dn(e,r));return i.length>0?i:Object.assign([],{empty:!0},o.streamInfo())}d(Dy,"L$9");Ur(Dy,"parseAllDocuments");function vp(e,t={}){const{lineCounter:r,prettyErrors:n}=wi(t),s=new yp(r?.addNewLine),o=new dp(t);let i=null;for(const a of o.compose(s.parse(e),!0,e.length))if(!i)i=a;else if(i.options.logLevel!=="silent"){i.errors.push(new Ut(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(i.errors.forEach(dn(e,r)),i.warnings.forEach(dn(e,r))),i}d(vp,"d$6");Ur(vp,"parseDocument");function bp(e,t,r){let n;typeof t=="function"?n=t:r===void 0&&t&&typeof t=="object"&&(r=t);const s=vp(e,r);if(!s)return null;if(s.warnings.forEach(o=>Fo(s.options.logLevel,o)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:n},r))}d(bp,"C$7");Ur(bp,"parse");function Ly(e,t,r){let n=null;if(typeof t=="function"||Array.isArray(t)?n=t:r===void 0&&t&&(r=t),typeof r=="string"&&(r=r.length),typeof r=="number"){const s=Math.round(r);r=s<1?void 0:s>8?{indent:8}:{indent:s}}if(e===void 0){const{keepUndefined:s}=r??t??{};if(!s)return}return rr(e)&&!n?e.toString(r):new ni(e,n,r).toString(r)}d(Ly,"A$a");Ur(Ly,"stringify");var By=Object.defineProperty,My=d((e,t)=>By(e,"name",{value:t,configurable:!0}),"e$s");const Vy={configFiles:["api-extractor.json"],detect:My(({matchedConfigs:e})=>({targets:{"api-extract":{command:"api-extractor run --local",description:"api-extractor (inferred)",inputs:["{projectRoot}/dist/**/*.d.ts","{projectRoot}/lib/**/*.d.ts",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist/*.api.json","{projectRoot}/etc/*.api.md","{projectRoot}/temp"],type:"build"}}}),"detect"),fallbackDependency:"@microsoft/api-extractor",name:"api-extractor"};var _y=Object.defineProperty,Fy=d((e,t)=>_y(e,"name",{value:t,configurable:!0}),"s$f");const qy={configFiles:["astro.config.ts","astro.config.js","astro.config.mjs","astro.config.mts","astro.config.cjs"],detect:Fy(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"astro build",description:"astro build (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/public/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/dist"],type:"build"}};return e&&(n.dev={command:"astro dev",description:"astro dev (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"astro",name:"astro"};var Uy=Object.defineProperty,Wy=d((e,t)=>Uy(e,"name",{value:t,configurable:!0}),"o$l");const Gy={configFiles:["biome.json","biome.jsonc"],detect:Wy(({matchedConfigs:e})=>{const t=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(r=>`{projectRoot}/${r}`),"{projectRoot}/package.json"];return{targets:{format:{command:"biome format --write .",description:"biome format (inferred)"},lint:{command:"biome check .",description:"biome check (inferred)",inputs:t,outputs:[],type:"build"}}}},"detect"),fallbackDependency:"@biomejs/biome",name:"biome"};var Jy=Object.defineProperty,Ky=d((e,t)=>Jy(e,"name",{value:t,configurable:!0}),"o$k");const zy={configFiles:["bunfig.toml"],detect:Ky(({matchedConfigs:e})=>({targets:{test:{command:"bun test",description:"bun test (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"test"}}}),"detect"),name:"bun"};var Hy=Object.defineProperty,Yy=d((e,t)=>Hy(e,"name",{value:t,configurable:!0}),"e$r");const Xy={configFiles:[".changeset/config.json"],detect:Yy(()=>({targets:{"changeset:publish":{command:"changeset publish",description:"changeset publish (inferred)"},"changeset:status":{command:"changeset status",description:"changeset status (inferred)"},"changeset:version":{command:"changeset version",description:"changeset version (inferred)"}}}),"detect"),name:"changeset"};var Qy=Object.defineProperty,Zy=d((e,t)=>Qy(e,"name",{value:t,configurable:!0}),"r$n");const ev={configFiles:["cypress.config.ts","cypress.config.js","cypress.config.mjs","cypress.config.mts","cypress.config.cjs"],detect:Zy(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={"test:e2e":{command:"cypress run",description:"cypress run (inferred)",inputs:["{projectRoot}/cypress/**/*","{projectRoot}/e2e/**/*","{projectRoot}/src/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/cypress/screenshots","{projectRoot}/cypress/videos"],type:"test"}};return e&&(n["cypress:open"]={command:"cypress open",description:"cypress open (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"cypress",name:"cypress"};var tv=Object.defineProperty,rv=d((e,t)=>tv(e,"name",{value:t,configurable:!0}),"n$g");const nv={configFiles:["deno.json","deno.jsonc"],detect:rv(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0,r=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...t?[t]:[]];return{targets:{check:{command:"deno check **/*.ts",description:"deno check (inferred)",inputs:r,outputs:[],type:"build"},fmt:{command:"deno fmt",description:"deno fmt (inferred)"},lint:{command:"deno lint",description:"deno lint (inferred)",inputs:r,outputs:[],type:"build"},test:{command:"deno test",description:"deno test (inferred)",inputs:r,outputs:[],type:"test"}}}},"detect"),name:"deno"};var sv=Object.defineProperty,ov=d((e,t)=>sv(e,"name",{value:t,configurable:!0}),"r$m");const iv={configFiles:["docusaurus.config.ts","docusaurus.config.js","docusaurus.config.mjs","docusaurus.config.mts","docusaurus.config.cjs"],detect:ov(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"docusaurus build",description:"docusaurus build (inferred)",inputs:["{projectRoot}/blog/**/*","{projectRoot}/docs/**/*","{projectRoot}/src/**/*","{projectRoot}/static/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/build"],type:"build"}};return e&&(n.start={command:"docusaurus start",description:"docusaurus start (inferred)",preset:"server"},n.serve={command:"docusaurus serve",description:"docusaurus serve (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"@docusaurus/core",name:"docusaurus"};var av=Object.defineProperty,cv=d((e,t)=>av(e,"name",{value:t,configurable:!0}),"r$l");const lv={configFiles:["drizzle.config.ts","drizzle.config.js","drizzle.config.mjs","drizzle.config.mts","drizzle.config.cjs"],detect:cv(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"db:generate":{command:"drizzle-kit generate",description:"drizzle-kit generate (inferred)",inputs:["{projectRoot}/src/**/*",...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/drizzle"],type:"build"},"db:migrate":{command:"drizzle-kit migrate",description:"drizzle-kit migrate (inferred)"},"db:push":{command:"drizzle-kit push",description:"drizzle-kit push (inferred)"},"db:studio":{command:"drizzle-kit studio",description:"drizzle-kit studio (inferred)",preset:"server"}}}},"detect"),fallbackDependency:"drizzle-kit",name:"drizzle"};var pv=Object.defineProperty,uv=d((e,t)=>pv(e,"name",{value:t,configurable:!0}),"o$i");const dv={configFiles:["eslint.config.ts","eslint.config.js","eslint.config.mjs","eslint.config.mts","eslint.config.cjs",".eslintrc.json",".eslintrc.js",".eslintrc.cjs",".eslintrc"],detect:uv(({matchedConfigs:e})=>({targets:{lint:{command:"eslint .",description:"eslint . (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"eslint",name:"eslint"};var fv=Object.defineProperty,mv=d((e,t)=>fv(e,"name",{value:t,configurable:!0}),"r$k");const gv={configFiles:["gatsby-config.ts","gatsby-config.js","gatsby-config.mjs","gatsby-config.mts","gatsby-config.cjs"],detect:mv(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"gatsby build",description:"gatsby build (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/static/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/gatsby-node.js","{projectRoot}/gatsby-node.ts","{projectRoot}/gatsby-browser.js","{projectRoot}/gatsby-ssr.js"],outputs:["{projectRoot}/public","{projectRoot}/.cache"],type:"build"}};return e&&(n.develop={command:"gatsby develop",description:"gatsby develop (inferred)",preset:"server"},n.serve={command:"gatsby serve",description:"gatsby serve (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"gatsby",name:"gatsby"};var hv=Object.defineProperty,yv=d((e,t)=>hv(e,"name",{value:t,configurable:!0}),"c$k");const vv={configFiles:["codegen.ts","codegen.js","codegen.mjs","codegen.mts","codegen.cjs","codegen.yml","codegen.yaml","codegen.json",".graphqlrc",".graphqlrc.json",".graphqlrc.yml",".graphqlrc.yaml",".graphqlrc.ts",".graphqlrc.js"],detect:yv(({matchedConfigs:e})=>({targets:{codegen:{command:"graphql-codegen",description:"graphql-codegen (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/schema/**/*","{projectRoot}/**/*.graphql","{projectRoot}/**/*.gql",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:["{projectRoot}/src/generated","{projectRoot}/src/__generated__","{projectRoot}/src/gql"],type:"build"}}}),"detect"),fallbackDependency:"@graphql-codegen/cli",name:"graphql-codegen"};var bv=Object.defineProperty,kv=d((e,t)=>bv(e,"name",{value:t,configurable:!0}),"c$j");const $v={configFiles:["jest.config.ts","jest.config.js","jest.config.mjs","jest.config.mts","jest.config.cjs","jest.config.json"],detect:kv(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={test:{command:"jest",description:"jest (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/coverage"],type:"test"}};return e&&(n["test:watch"]={command:"jest --watch",description:"jest watch mode (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"jest",name:"jest"};var wv=Object.defineProperty,Sv=d((e,t)=>wv(e,"name",{value:t,configurable:!0}),"n$f");const jv={configFiles:["knip.config.ts","knip.config.js","knip.config.mjs","knip.config.mts","knip.config.cjs","knip.json","knip.jsonc",".knip.json",".knip.jsonc"],detect:Sv(({matchedConfigs:e})=>({targets:{knip:{command:"knip",description:"knip (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"knip",name:"knip"};var Ov=Object.defineProperty,Ev=d((e,t)=>Ov(e,"name",{value:t,configurable:!0}),"s$c");const Rv={configFiles:["nest-cli.json"],detect:Ev(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"nest build",description:"nest build (inferred)",inputs:["{projectRoot}/src/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json","{projectRoot}/tsconfig.build.json"],outputs:["{projectRoot}/dist"],type:"build"}};return e&&(n.start={command:"nest start",description:"nest start (inferred)",preset:"server"},n["start:dev"]={command:"nest start --watch",description:"nest start --watch (inferred)",preset:"server"}),{targets:n}},"detect"),name:"nest"};var Cv=Object.defineProperty,xv=d((e,t)=>Cv(e,"name",{value:t,configurable:!0}),"r$h");const Nv={configFiles:["next.config.ts","next.config.js","next.config.mjs","next.config.mts","next.config.cjs"],detect:xv(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"next build",description:"next build (inferred)",inputs:["{projectRoot}/app/**/*","{projectRoot}/pages/**/*","{projectRoot}/src/**/*","{projectRoot}/public/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/.next","!{projectRoot}/.next/cache"],type:"build"}};return e&&(n.dev={command:"next dev",description:"next dev (inferred)",preset:"server"},n.start={command:"next start",description:"next start (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"next",name:"next"};var Iv=Object.defineProperty,Pv=d((e,t)=>Iv(e,"name",{value:t,configurable:!0}),"c$h");const Av={configFiles:["nuxt.config.ts","nuxt.config.js","nuxt.config.mjs","nuxt.config.mts","nuxt.config.cjs"],detect:Pv(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n=["{projectRoot}/app/**/*","{projectRoot}/components/**/*","{projectRoot}/composables/**/*","{projectRoot}/layouts/**/*","{projectRoot}/pages/**/*","{projectRoot}/plugins/**/*","{projectRoot}/public/**/*","{projectRoot}/server/**/*","{projectRoot}/src/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],s={build:{command:"nuxt build",description:"nuxt build (inferred)",inputs:n,outputs:["{projectRoot}/.output","{projectRoot}/.nuxt"],type:"build"},generate:{command:"nuxt generate",description:"nuxt generate static site (inferred)",inputs:n,outputs:["{projectRoot}/.output","{projectRoot}/dist"],type:"build"}};return e&&(s.dev={command:"nuxt dev",description:"nuxt dev (inferred)",preset:"server"},s.preview={command:"nuxt preview",description:"nuxt preview (inferred)",preset:"server"}),{targets:s}},"detect"),fallbackDependency:"nuxt",name:"nuxt"};var Tv=Object.defineProperty,Dv=d((e,t)=>Tv(e,"name",{value:t,configurable:!0}),"e$p");const Lv={configFiles:[".oxfmtrc.json",".oxfmtrc.jsonc","oxfmt.config.ts","oxfmt.config.js","oxfmt.config.mjs","oxfmt.config.mts","oxfmt.config.cjs"],detect:Dv(({matchedConfigs:e})=>{const t=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(r=>`{projectRoot}/${r}`),"{projectRoot}/package.json"];return{targets:{format:{command:"oxfmt",description:"oxfmt (inferred)"},"format:check":{command:"oxfmt --check",description:"oxfmt --check (inferred)",inputs:t,outputs:[],type:"build"}}}},"detect"),fallbackDependency:"oxfmt",name:"oxfmt"};var Bv=Object.defineProperty,Mv=d((e,t)=>Bv(e,"name",{value:t,configurable:!0}),"e$o");const Vv={configFiles:[".oxlintrc.json","oxlint.json"],detect:Mv(({matchedConfigs:e})=>({targets:{lint:{command:"oxlint",description:"oxlint (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"oxlint",name:"oxlint"};var _v=Object.defineProperty,Fv=d((e,t)=>_v(e,"name",{value:t,configurable:!0}),"c$g");const qv={configFiles:["packem.config.ts","packem.config.js","packem.config.mjs","packem.config.mts","packem.config.cjs"],detect:Fv(({matchedConfigs:e})=>({targets:{build:{command:"packem build",description:"@visulima/packem build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]??"packem.config.ts"}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),fallbackDependency:"@visulima/packem",name:"packem"};var Uv=Object.defineProperty,Wv=d((e,t)=>Uv(e,"name",{value:t,configurable:!0}),"o$g");const Gv={configFiles:["playwright.config.ts","playwright.config.js","playwright.config.mjs","playwright.config.mts","playwright.config.cjs"],detect:Wv(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"test:e2e":{command:"playwright test",description:"playwright test (inferred)",inputs:["{projectRoot}/e2e/**/*","{projectRoot}/tests/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/src/**/*",...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/playwright-report","{projectRoot}/test-results"],type:"test"}}}},"detect"),fallbackDependency:"@playwright/test",name:"playwright"};var Jv=Object.defineProperty,Kv=d((e,t)=>Jv(e,"name",{value:t,configurable:!0}),"r$e");const zv={configFiles:["prettier.config.ts","prettier.config.js","prettier.config.mjs","prettier.config.mts","prettier.config.cjs",".prettierrc",".prettierrc.json",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.yml",".prettierrc.yaml"],detect:Kv(({matchedConfigs:e})=>{const t=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(r=>`{projectRoot}/${r}`),"{projectRoot}/package.json"];return{targets:{format:{command:"prettier --write .",description:"prettier --write (inferred)"},"format:check":{command:"prettier --check .",description:"prettier --check (inferred)",inputs:t,outputs:[],type:"build"}}}},"detect"),fallbackDependency:"prettier",name:"prettier"};var Hv=Object.defineProperty,Yv=d((e,t)=>Hv(e,"name",{value:t,configurable:!0}),"t$j");const Xv={configFiles:["prisma/schema.prisma","schema.prisma"],detect:Yv(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"db:generate":{command:"prisma generate",description:"prisma generate (inferred)",inputs:[...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/node_modules/.prisma","{projectRoot}/node_modules/@prisma/client"],type:"build"},"db:migrate":{command:"prisma migrate dev",description:"prisma migrate dev (inferred)"},"db:push":{command:"prisma db push",description:"prisma db push (inferred)"},"db:studio":{command:"prisma studio",description:"prisma studio (inferred)",preset:"server"}}}},"detect"),fallbackDependency:"prisma",name:"prisma"};var Qv=Object.defineProperty,Zv=d((e,t)=>Qv(e,"name",{value:t,configurable:!0}),"o$f");const eb={configFiles:["remix.config.ts","remix.config.js","remix.config.mjs","remix.config.cjs"],detect:Zv(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"remix vite:build",description:"remix build (inferred)",inputs:["{projectRoot}/app/**/*","{projectRoot}/public/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/build"],type:"build"}};return e&&(n.dev={command:"remix vite:dev",description:"remix dev (inferred)",preset:"server"},n.start={command:"remix-serve ./build/server/index.js",description:"remix-serve (inferred)",preset:"server"}),{targets:n}},"detect"),name:"remix"};var tb=Object.defineProperty,rb=d((e,t)=>tb(e,"name",{value:t,configurable:!0}),"t$i");const nb={configFiles:["rolldown.config.ts","rolldown.config.js","rolldown.config.mjs","rolldown.config.mts","rolldown.config.cjs"],detect:rb(({matchedConfigs:e})=>({targets:{build:{command:"rolldown -c",description:"rolldown build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),name:"rolldown"};var sb=Object.defineProperty,ob=d((e,t)=>sb(e,"name",{value:t,configurable:!0}),"t$h");const ib={configFiles:["rollup.config.ts","rollup.config.js","rollup.config.mjs","rollup.config.mts","rollup.config.cjs"],detect:ob(({matchedConfigs:e})=>({targets:{build:{command:"rollup -c",description:"rollup build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),name:"rollup"};var ab=Object.defineProperty,cb=d((e,t)=>ab(e,"name",{value:t,configurable:!0}),"r$d");const lb={configFiles:[".storybook/main.ts",".storybook/main.js",".storybook/main.mjs",".storybook/main.mts",".storybook/main.cjs"],detect:cb(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"build-storybook":{command:"storybook build",description:"storybook build (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/.storybook/**/*","{projectRoot}/stories/**/*",...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/storybook-static"],type:"build"},storybook:{command:"storybook dev -p 6006",description:"storybook dev (inferred)",preset:"server"}}}},"detect"),name:"storybook"};var pb=Object.defineProperty,ub=d((e,t)=>pb(e,"name",{value:t,configurable:!0}),"e$k");const db={configFiles:["stylelint.config.ts","stylelint.config.js","stylelint.config.mjs","stylelint.config.cjs",".stylelintrc",".stylelintrc.json",".stylelintrc.js",".stylelintrc.cjs",".stylelintrc.yml",".stylelintrc.yaml"],detect:ub(({matchedConfigs:e})=>({targets:{"lint:css":{command:'stylelint "**/*.{css,scss,sass,less,vue,svelte,astro}"',description:"stylelint (inferred)",inputs:["{projectRoot}/src/**/*.css","{projectRoot}/src/**/*.scss","{projectRoot}/src/**/*.sass","{projectRoot}/src/**/*.less","{projectRoot}/src/**/*.vue","{projectRoot}/src/**/*.svelte","{projectRoot}/src/**/*.astro",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"stylelint",name:"stylelint"};var fb=Object.defineProperty,mb=d((e,t)=>fb(e,"name",{value:t,configurable:!0}),"o$d");const gb={configFiles:["tsdown.config.ts","tsdown.config.js","tsdown.config.mjs","tsdown.config.mts","tsdown.config.cjs"],detect:mb(({matchedConfigs:e})=>({targets:{build:{command:"tsdown",description:"tsdown build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]??"tsdown.config.ts"}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),fallbackDependency:"tsdown",name:"tsdown"};var hb=Object.defineProperty,yb=d((e,t)=>hb(e,"name",{value:t,configurable:!0}),"o$c");const vb={configFiles:["tsup.config.ts","tsup.config.js","tsup.config.mjs","tsup.config.mts","tsup.config.cjs"],detect:yb(({matchedConfigs:e})=>({targets:{build:{command:"tsup",description:"tsup build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]??"tsup.config.ts"}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),fallbackDependency:"tsup",name:"tsup"};var bb=Object.defineProperty,kb=d((e,t)=>bb(e,"name",{value:t,configurable:!0}),"e$i");const $b={configFiles:["typedoc.json","typedoc.jsonc","typedoc.config.ts","typedoc.config.js","typedoc.config.mjs","typedoc.config.mts","typedoc.config.cjs"],detect:kb(({matchedConfigs:e})=>({targets:{docs:{command:"typedoc",description:"typedoc (inferred)",inputs:["{projectRoot}/src/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/docs"],type:"build"}}}),"detect"),fallbackDependency:"typedoc",name:"typedoc"};var wb=Object.defineProperty,Sb=d((e,t)=>wb(e,"name",{value:t,configurable:!0}),"e$h");const jb={configFiles:["tsconfig.json","tsconfig.build.json"],detect:Sb(({matchedConfigs:e})=>({targets:{typecheck:{command:"tsc --noEmit",description:"tsc --noEmit (inferred)",inputs:["{projectRoot}/src/**/*.ts","{projectRoot}/src/**/*.tsx","{projectRoot}/__tests__/**/*.ts","{projectRoot}/__tests__/**/*.tsx","{projectRoot}/test/**/*.ts","{projectRoot}/tests/**/*.ts",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"typescript",name:"typescript"};var Ob=Object.defineProperty,Eb=d((e,t)=>Ob(e,"name",{value:t,configurable:!0}),"t$g");const Rb={configFiles:["vite.config.ts","vite.config.js","vite.config.mjs","vite.config.mts","vite.config.cjs"],detect:Eb(({matchedConfigs:e})=>({targets:{build:{command:"vite build",description:"vite production build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json"],outputs:["{projectRoot}/dist"],type:"build"},dev:{command:"vite",description:"vite dev server (inferred)",preset:"server"},preview:{command:"vite preview",description:"vite preview server (inferred)",preset:"server"}}}),"detect"),name:"vite"};var Cb=Object.defineProperty,xb=d((e,t)=>Cb(e,"name",{value:t,configurable:!0}),"r$b");const Nb={configFiles:[".vitepress/config.ts",".vitepress/config.js",".vitepress/config.mjs",".vitepress/config.mts",".vitepress/config.cjs","docs/.vitepress/config.ts","docs/.vitepress/config.js","docs/.vitepress/config.mjs","docs/.vitepress/config.mts","docs/.vitepress/config.cjs"],detect:xb(({matchedConfigs:e})=>{const t=e[0]?.startsWith("docs/"),r=t?"docs":".",n=e[0]?`{projectRoot}/${e[0]}`:void 0,s=["{projectRoot}/.vitepress/**/*","{projectRoot}/docs/**/*",...n?[n]:[],"{projectRoot}/package.json"];return{targets:{"docs:build":{command:`vitepress build ${r}`,description:"vitepress build (inferred)",inputs:s,outputs:[`{projectRoot}/${t?"docs/":""}.vitepress/dist`],type:"build"},"docs:dev":{command:`vitepress dev ${r}`,description:"vitepress dev (inferred)",preset:"server"},"docs:preview":{command:`vitepress preview ${r}`,description:"vitepress preview (inferred)",preset:"server"}}}},"detect"),name:"vitepress"};var Ib=Object.defineProperty,Pb=d((e,t)=>Ib(e,"name",{value:t,configurable:!0}),"c$c");const Ab={configFiles:["vitest.config.ts","vitest.config.js","vitest.config.mjs","vitest.config.mts","vitest.config.cjs"],detect:Pb(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={test:{command:"vitest run",description:"vitest run (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/coverage"],type:"test"}};return e&&(n["test:watch"]={command:"vitest",description:"vitest watch mode (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"vitest",name:"vitest"};var Tb=Object.defineProperty,Db=d((e,t)=>Tb(e,"name",{value:t,configurable:!0}),"t$f");const Lb={configFiles:["webpack.config.ts","webpack.config.js","webpack.config.mjs","webpack.config.mts","webpack.config.cjs"],detect:Db(({matchedConfigs:e})=>({targets:{build:{command:"webpack --mode=production",description:"webpack production build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),name:"webpack"};var Bb=Object.defineProperty,Si=d((e,t)=>Bb(e,"name",{value:t,configurable:!0}),"n$c");const ji=[Av,Nv,eb,qy,gv,iv,Rb,Nb,Rv,nb,gb,vb,qv,ib,Lb,Ab,$v,zy,Gv,ev,lb,jb,$b,dv,zv,Gy,Vv,Lv,db,jv,nv,Xv,lv,vv,Vy,Xy],Mb=Si((e,t)=>e.dependencies!==void 0&&Object.hasOwn(e.dependencies,t)||e.devDependencies!==void 0&&Object.hasOwn(e.devDependencies,t)||e.peerDependencies!==void 0&&Object.hasOwn(e.peerDependencies,t)||e.optionalDependencies!==void 0&&Object.hasOwn(e.optionalDependencies,t),"hasDependency"),Vb=Si((e,t)=>{const r=[];for(const n of t)Uu(y(e,n))&&r.push(n);return r},"matchConfigFiles"),_b=Si((e,t=ji)=>{const r={},n=[];for(const s of t){const o=Vb(e.projectRoot,s.configFiles),i=s.fallbackDependency!==void 0&&Mb(e.pkg,s.fallbackDependency);if(o.length===0&&!i)continue;const a=s.detect({...e,hasConfigFile:o.length>0,matchedConfigs:o});let c=!1;for(const[l,p]of Object.entries(a.targets))r[l]===void 0&&(r[l]=p,c=!0);c&&n.push(s.name)}return{sources:n,targets:r}},"inferProjectTargets");var Fb=Object.defineProperty,it=d((e,t)=>Fb(e,"name",{value:t,configurable:!0}),"s$8");const qb={server:{cache:!1,interactive:!1,persistent:!0,runInCI:!1},utility:{cache:!1,runInCI:!1}},Ub=it(e=>{const t=e.preset??e.options?.preset;if(!t)return e;const r=qb[t];if(!r)return e;const{cache:n,...s}=r;return{...e,cache:e.cache??n,options:{...s,...e.options}}},"applyPreset"),Wb=it(()=>{const e=pd();return e==="darwin"?"macos":e==="win32"?"windows":"linux"},"detectCurrentOs"),VE=it((e,t)=>{if(!t||t.size===0)return!0;const r=e?.runnerTags;return!r||r.length===0?!0:r.some(n=>t.has(n))},"matchesRunnerTags"),_E=it((e,t,r=!0)=>{const n=e?.runInCI??!0;return n===!0||n==="always"?!0:n===!1?!t:n==="affected"?!t||r:!0},"shouldRunInCI"),FE=it((e,t)=>{if(t===!1)return{};const r=t===!0?Gb("production"):Array.isArray(t)?t:[t],n={};for(const s of r)Object.assign(n,Jb(e,s));return n},"loadEnvFile"),Gb=it(e=>{const t=[".env"];return e&&t.push(`.env.${e}`),e!=="test"&&t.push(".env.local"),e&&e!=="test"&&t.push(`.env.${e}.local`),t},"resolveEnvCascade"),Jb=it((e,t)=>{const r=t.startsWith("/")?t:y(e,t);if(!k(r))return{};let n;try{n=P(r)}catch{return{}}const s={};for(const o of n.split(/\r?\n/)){const i=o.trim();if(i===""||i.startsWith("#"))continue;const a=i.indexOf("=");if(a===-1)continue;const c=i.slice(0,a).trim();if(c==="")continue;let l=i.slice(a+1).trim();(l.startsWith('"')&&l.endsWith('"')||l.startsWith("'")&&l.endsWith("'"))&&(l=l.slice(1,-1)),s[c]=l}return s},"loadSingleEnvFile"),qE=it((e,t=Wb())=>{if(e)return t==="windows"&&e.windowsShell?e.windowsShell:(t==="linux"||t==="macos")&&e.unixShell?e.unixShell:e.shell},"resolveTargetShell"),Kb=it(e=>{if(e==="run")return!1;if(e==="build"||e==="test")return!0},"defaultCacheForType");var zb=Object.defineProperty,fe=d((e,t)=>zb(e,"name",{value:t,configurable:!0}),"a$b");const Hb=/\/+$/,Yb=/\/\*\*$/,Xb=/\/\*\/\*$/,Qb=/^['"]|['"]$/g,Oi=/node_modules/,Ei=/\.git/,Ot=fe(e=>{try{return le(e)}catch{return}},"readJsonFileSafe"),Zb=fe((e,t,r)=>{for(const n of yn(e,{includeFiles:!1,includeSymlinks:!1,skip:[Oi,Ei]}))if(n.path!==e&&k(y(n.path,"package.json"))){const s=n.path.slice(e.length+1);r.push(`${t}/${s}`)}},"scanDirectoryRecursive"),ek=fe((e,t,r)=>{const n=t.slice(0,-2),s=jr(e,n);if(k(s))for(const o of yn(s,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[Oi,Ei]}))o.path!==s&&k(y(o.path,"package.json"))&&r.push(y(n,o.name))},"resolveSimpleGlob"),tk=fe((e,t,r)=>{const n=t.replace(Yb,"").replace(Xb,""),s=jr(e,n);k(s)&&Zb(s,n,r)},"resolveDoubleGlob"),rk=fe((e,t,r)=>{const n=jr(e,t);k(n)&&k(y(n,"package.json"))&&r.push(t)},"resolveExactDirectory"),nk=/[$()+.?[\\\]^{|}]/g,sk=fe((e,t,r)=>{const n=t.replaceAll(nk,"\\$&").replaceAll("*",".*"),s=new RegExp(`^${n}$`);for(const o of yn(e,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[Oi,Ei]}))o.path!==e&&s.test(o.name)&&k(y(o.path,"package.json"))&&r.push(o.name)},"resolveBareGlob"),Xt=fe((e,t)=>{const r=[];for(const n of t){const s=n.replace(Hb,"");s.startsWith("!")||(s.endsWith("/*")?ek(e,s,r):s.endsWith("/**")||s.endsWith("/*/*")?tk(e,s,r):!s.includes("/")&&s.includes("*")?sk(e,s,r):rk(e,s,r))}return r},"resolveWorkspacePatterns"),kp=fe((e,t,r=new Set)=>{if(!e)return[];const n=[];for(const s of e){if(typeof s=="object"&&s&&"group"in s){const o=s.group;if(r.has(o))throw new Error(`Cycle detected in vis.config taskGroups: ${[...r,o].join(" → ")}`);const i=t?.[o];if(!i)throw new Error(`Unknown taskGroup "${o}" referenced in dependsOn. Declare it under \`taskGroups\` in vis.config.ts.`);n.push(...kp(i,t,new Set([...r,o])));continue}n.push(s)}return n},"expandTaskGroups"),Dn=fe(e=>{if(Array.isArray(e)){if(e.length===0)throw new Error('Invalid package.json `workspaces`: empty array. Add at least one pattern like "packages/*" or remove the field.');for(const t of e)if(typeof t!="string"||t.trim().length===0)throw new TypeError(`Invalid package.json \`workspaces\` entry: expected a non-empty glob string, got ${JSON.stringify(t)}.`);return e}if(e&&typeof e=="object"){const{packages:t}=e;if(t===void 0)throw new Error('Invalid package.json `workspaces`: object form requires a `packages` array (e.g. `{ "packages": ["packages/*"] }`).');if(!Array.isArray(t))throw new TypeError(`Invalid package.json \`workspaces.packages\`: expected an array of glob strings, got ${typeof t}.`);return Dn(t)}throw new TypeError(`Invalid package.json \`workspaces\`: expected an array or { packages: string[] } object, got ${typeof e}.`)},"validateWorkspacesField"),ok=fe(e=>{const t=y(e,"pnpm-workspace.yaml");if(!k(t))return;let r;try{r=bp(P(t))}catch{return}if(typeof r!="object"||r===null)return;const{overrides:n}=r;if(typeof n!="object"||n===null||Array.isArray(n))return;const s={};for(const[o,i]of Object.entries(n))typeof i=="string"&&(s[o]=i);return Object.keys(s).length>0?s:void 0},"readPnpmWorkspaceOverrides"),Wr=fe(e=>{const t=y(e,"pnpm-workspace.yaml");if(!k(t))return;const r=P(t),n=[];let s=!1;for(const o of r.split(`
158
+ `)){const i=o.trim();if(i==="packages:"){s=!0;continue}if(s){if(i.startsWith("- ")){const a=i.slice(2).replaceAll(Qb,"");n.push(a)}else if(i&&!i.startsWith("#"))break}}return n.length>0?n:void 0},"readPnpmWorkspacePatterns"),UE=fe(e=>{const t=Wr(e);if(t)return t;const r=Ot(y(e,"package.json"));if(r?.workspaces!==void 0)try{return Dn(r.workspaces)}catch{return}},"readWorkspacePatterns"),aa="@filegroup:",ik=fe((e,t,r)=>{if(!e)return!0;if(e.projectType&&e.projectType!==r)return!1;if(e.tags&&e.tags.length>0){const n=new Set(t?.tags);if(!e.tags.some(s=>n.has(s)))return!1}if(e.layer){const n=Array.isArray(e.layer)?e.layer:[e.layer];if(t?.layer===void 0||!n.includes(t.layer))return!1}if(e.stack){const n=Array.isArray(e.stack)?e.stack:[e.stack];if(t?.stack===void 0||!n.includes(t.stack))return!1}if(e.language){const n=Array.isArray(e.language)?e.language:[e.language];if(t?.language===void 0||!n.includes(t.language))return!1}return!0},"scopeMatches"),ak=fe((e,t,r)=>{const n={};for(const[s,o]of Object.entries(e.targetDefaults??{}))n[s]=cn(void 0,o);for(const s of e.taskDefaults??[])if(ik(s.scope,t,r))for(const[o,i]of Object.entries(s.targets))n[o]=cn(n[o],i);return n},"collectTargetDefaults"),ck=fe((e,t)=>{if(!e)return e;const r=[];for(const n of e){if(typeof n=="string"&&n.startsWith(aa)){const s=n.slice(aa.length),o=t?.[s];o&&r.push(...o);continue}r.push(n)}for(const n of r)typeof n=="string"&&cd(n)&&ld(n);return r},"resolveFileGroupInputs"),ca=new Set,lk=fe(e=>{if(e===!0)return()=>!0;if(e===void 0||e===!1)return;const t=new Set(ji.map(n=>n.name)),r=Object.keys(e).filter(n=>!t.has(n));if(r.length>0){const n=[...r].sort().join(",");ca.has(n)||(ca.add(n),process.emitWarning(`vis: inferTargets references unknown detector(s): ${r.join(", ")}. Known detectors: ${[...t].join(", ")}.`,"VisConfigWarning"))}return n=>e[n]!==!1},"resolveInferTargetOption"),po=fe((e,t,r,n,s)=>{const o={...cn(n,r),options:{...n?.options,...r?.options}};t&&o.command===void 0&&o.executor===void 0&&(o.command=t),o.inputs&&(o.inputs=ck(o.inputs,s));const i=Ub(o);return i.cache===void 0&&(i.cache=Kb(i.type)),i},"mergeTarget"),pk=fe((e,t,r,n)=>{const s={},o=new Set;for(const[i,a]of Object.entries(e??{}))o.add(i),s[i]=po(i,a,t?.[i],r[i],n);for(const[i,a]of Object.entries(t??{}))o.has(i)||(s[i]=po(i,void 0,a,r[i],n));return s},"createTargetsFromScripts"),uk=fe((e,t)=>{if(e===void 0&&t===void 0)return;const r=new Set([...Object.keys(e??{}),...Object.keys(t??{})]),n={};for(const s of r)n[s]=cn(e?.[s],t?.[s]);return n},"mergeProjectTargets"),dk=fe((e,t={},r)=>{const n={},s=new Map,o=new Map,i=Wr(e),a=Ot(y(e,"package.json"));let c;if(i?c=i:a?.workspaces!==void 0&&(c=Dn(a.workspaces)),!c)throw new Error("No workspace configuration found. Expected pnpm-workspace.yaml or package.json workspaces field.");const l=Xt(e,c);for(const p of l){const f=y(e,p,"package.json"),u=Ot(f);if(!u?.name)continue;o.set(u.name,u);const m=y(e,p,"project.json"),h=Ot(m);let g="library";h?.projectType?g=h.projectType:u.bin!==void 0&&(g="application");const b=ak(t,h,g),v=uk(h?.targets,r?.get(p)?.targets),$=pk(u.scripts,v,b,t.fileGroups),j=lk(t.inferTargets);if(j!==void 0){const N=y(e,p),I=ji.filter(w=>j(w.name)),_=_b({pkg:u,projectDirectory:p,projectRoot:N},I);for(const[w,M]of Object.entries(_.targets))$[w]===void 0&&($[w]={...po(w,M.command,M,b[w],t.fileGroups),inferred:!0})}s.set(u.name,$);const x={};for(const[N,I]of Object.entries($)){const{options:_}=I,w={...I};delete w.inferred,delete w.options,delete w.preset,delete w.type;const M=I.dependsOn?kp(I.dependsOn,t.taskGroups):void 0;x[N]={...w,...M?{dependsOn:M}:{},..._?{options:_}:{}}}n[u.name]={implicitDependencies:h?.implicitDependencies,language:h?.language,layer:h?.layer,owners:h?.owners,project:h?.project,projectType:g,root:p,sourceRoot:h?.sourceRoot??`${p}/src`,stack:h?.stack,tags:h?.tags,targets:x}}return{config:t,packageJsons:o,projectOptions:s,workspace:{projects:n}}},"discoverWorkspace"),WE=fe((e,t,r)=>{const n={},s={},o=new Set(Object.keys(t.projects));for(const[i,a]of Object.entries(t.projects)){n[i]={data:a,name:i,type:a.projectType??"library"},s[i]=[];const c=r?.get(i)??Ot(y(e,a.root,"package.json"));if(!c)continue;const l=[[c.dependencies,"static"],[c.devDependencies,"devDependency"],[c.peerDependencies,"peerDependency"]],p=new Set;for(const[f,u]of l)if(f)for(const m of Object.keys(f))o.has(m)&&!p.has(m)&&(p.add(m),s[i]?.push({source:i,target:m,type:u}))}return{dependencies:s,nodes:n}},"buildProjectGraph"),GE=fe(async e=>{const{loadVisTaskConfig:t}=await import("./applyDefaults.js"),r=Wr(e),n=Ot(y(e,"package.json"));let s;if(r?s=r:n?.workspaces!==void 0&&(s=Dn(n.workspaces)),!s)return new Map;const o=Xt(e,s),i=new Map;return await Promise.all(o.map(async a=>{const c=Ot(y(e,a,"package.json"));if(!c?.name)return;const l=await t(e,y(e,a),c.name);l!==void 0&&i.set(a,l)})),i},"loadVisTaskConfigsForWorkspace");var fk=Object.defineProperty,mk=d((e,t)=>fk(e,"name",{value:t,configurable:!0}),"t$e");const re=mk((e,t)=>{if(!k(e))return;const r=`${e}.bak`;k(r)||(t?.backupsCreated.includes(r)??!1)||(Wu(e,r),t&&t.backupsCreated.push(r))},"backupFile");var gk=Object.defineProperty,Ln=d((e,t)=>gk(e,"name",{value:t,configurable:!0}),"e$g");const ge=Ln(e=>{try{const t=P(e);return JSON.parse(t)}catch{return}},"readJsonFile"),ar=Ln(e=>{if(!k(e))return!1;try{return JSON.parse(P(e)),!0}catch{return!1}},"isJsonFile"),Gr=Ln((e,t,r={})=>He(e,t,{defaultIndent:" ",useEditorconfig:r.useEditorconfig}),"detectJsonIndent"),hk=Ln((e,t,r,n={})=>{if(!k(e))return!1;const s=P(e);let o;try{o=JSON.parse(s)}catch{return!1}const i=t(o);if(i===void 0)return!1;const a=Gr(e,s,n);return r&&re(e,r),ue(e,`${JSON.stringify(i,void 0,a)}
159
+ `,"utf8"),!0},"editJsonFile");var yk=Object.defineProperty,ft=d((e,t)=>yk(e,"name",{value:t,configurable:!0}),"f$5");const vk=/\blint-staged\b/g,bk=ft((e,t)=>{let r=!1;const n={...e};for(const[s,o]of Object.entries(n)){if(typeof o!="string")continue;let i=nl(o);i&&(i=i.replaceAll(vk,"vis staged").trim()||void 0),i!==o&&(i?n[s]=i:delete n[s],r=!0,t.rewrittenScriptCount+=1)}return{modified:r,scripts:n}},"rewriteScripts"),$p=ft((e,t,r,n)=>{const s=y(e,"package.json");k(s)&&hk(s,o=>{let i=!1;for(const c of rl){const l=o.dependencies,p=o.devDependencies;l?.[c]&&(delete l[c],i=!0,n.removedPackageCount+=1),p?.[c]&&(delete p[c],i=!0,n.removedPackageCount+=1)}if(Object.keys(r).length>0)switch(t){case"bun":{const c=o.workspaces,l=c&&!Array.isArray(c)?c:void 0,p={...l?.catalog??o.catalog};for(const[u,m]of Object.entries(r))p[u]=m;l?.catalog===void 0?o.catalog=p:l.catalog=p;const f=o.overrides??{};for(const u of Object.keys(r))f[u]="catalog:";o.overrides=f,i=!0;break}case"npm":{const c=o.overrides??{};o.overrides={...c,...r},i=!0;break}case"pnpm":{const c=o.pnpm??{},l=c.overrides??{};c.overrides={...l,...r},o.pnpm=c,i=!0;break}case"yarn":{const c=o.resolutions??{};o.resolutions={...c,...r},i=!0;break}}const a=o.scripts;if(a){const c=bk(a,n);c.modified&&(o.scripts=c.scripts,i=!0)}return i?o:void 0})},"rewritePackageJson"),kk=ft((e,t,r,n)=>{try{const{workspace:s}=dk(e);for(const o of Object.values(s.projects)){const i=y(e,o.root);$p(i,t,r,n)}}catch{}},"migrateMonorepoPackages"),$k=ft(e=>e.startsWith("- ")||e!==""&&!e.includes(":")&&!e.startsWith("#"),"isCatalogSectionEnd"),wk=ft(e=>{let t=!1,r="";const n=new Set;for(const s of e){const o=s.trim();if(o==="catalog:"){t=!0;continue}if(!t)continue;if($k(o))break;const i=o.includes(":")?o.split(":")[0]?.trim():void 0;i&&(n.add(i),r=r||s.slice(0,s.indexOf(o)))}return{entries:n,indent:r||" "}},"parseCatalogEntries"),Sk=ft((e,t,r)=>{const n=[];let s=!1,o=!1;for(let i=0;i<e.length;i+=1){const a=e[i],c=a.trim();if(n.push(a),c==="catalog:"){o=!0;continue}if(o&&!s){const l=e[i+1]?.trim()??"";(!l.includes(":")||l.startsWith("- ")||!l||l==="catalog:")&&(n.push(...t),s=!0,o=!1)}}return s||(r.includes("catalog:")||n.push("catalog:"),n.push(...t)),n},"insertCatalogEntries"),jk=ft((e,t)=>{const r=y(e,"pnpm-workspace.yaml");if(!k(r)||Object.keys(t).length===0)return;const n=P(r),s=n.split(`
160
+ `),{entries:o,indent:i}=wk(s),a=[];for(const[l,p]of Object.entries(t))o.has(l)||a.push(`${i}${l}: "${p}"`);if(a.length===0)return;const c=Sk(s,a,n);re(r),ue(r,c.join(`
161
+ `),"utf8")},"updatePnpmWorkspaceCatalog"),la=ft((e,t,r,n,s,o)=>{const i=r.overrides??{};if(n.dryRun){s.info("[dry-run] Would rewrite package.json files (remove husky/lint-staged, rewrite scripts)"),Object.keys(i).length>0&&s.info(`[dry-run] Would add overrides: ${JSON.stringify(i)}`);return}$p(e,t,i,o),s.info("Rewritten root package.json"),kk(e,t,i,o),t==="pnpm"&&jk(e,i)},"migrateDeps");var Ok=Object.defineProperty,Bn=d((e,t)=>Ok(e,"name",{value:t,configurable:!0}),"t$d");const Ne=Bn(()=>({backupsCreated:[],gitHooksConfigured:!1,inlinedLintStagedConfigCount:0,manualSteps:[],mergedStagedConfigCount:0,perMigration:{},removedConfigCount:0,removedPackageCount:0,rewrittenScriptCount:0,warnings:[]}),"createMigrationReport"),J=Bn((e,t)=>{!e||e.warnings.includes(t)||e.warnings.push(t)},"addMigrationWarning"),Q=Bn((e,t)=>{!e||e.manualSteps.includes(t)||e.manualSteps.push(t)},"addManualStep"),he=Bn((e,t,r,n=1)=>{const s=e.perMigration[t]??{removedConfigCount:0,removedPackageCount:0,rewrittenScriptCount:0};s[r]+=n,e.perMigration[t]=s,e[r]+=n},"bumpPerMigration");var Ek=Object.defineProperty,Ye=d((e,t)=>Ek(e,"name",{value:t,configurable:!0}),"d$4");const Rk=["gitleaks.toml",".gitleaks.toml"],Ck=["gitleaks-report.json",".gitleaks-report.json","baseline.json"],Mn=Ye(e=>Rk.find(t=>k(y(e,t))),"detectGitleaksConfig"),Ri=Ye(e=>{const t=y(e,".gitleaksignore");return k(t)?t:void 0},"detectGitleaksIgnore"),Ci=Ye(e=>{for(const t of Ck){const r=y(e,t);if(k(r))try{const n=JSON.parse(P(r));if(Array.isArray(n)&&n.length>0&&typeof n[0]=="object"&&n[0]!==null&&"RuleID"in n[0])return r}catch{}}},"detectGitleaksBaseline"),xk=Ye(e=>e.map(t=>({description:t.Description??"",endColumn:t.EndColumn??0,endLine:t.EndLine??t.StartLine??0,entropy:t.Entropy??0,file:t.File??"",match:t.Match??"",ruleId:t.RuleID??"",secret:t.Secret??"",startColumn:t.StartColumn??0,startLine:t.StartLine??0,tags:t.Tags??[]})),"convertBaseline"),Nk=Ye((e,t,r,n,s)=>{const o=Ci(e);if(!o)return;const i=y(e,".secrets-baseline.json");if(k(i)&&o!==i){J(n,`.secrets-baseline.json already exists — leaving ${o} in place`);return}const a=ge(o);if(!Array.isArray(a)){J(n,`Could not parse ${o} as a gitleaks baseline`);return}const c=xk(a);if(t){r.info(`[dry-run] Would convert ${o} -> ${i} (${String(c.length)} findings)`);return}re(o,n),oe(i,`${JSON.stringify(c,null,He(i,void 0,{defaultIndent:" ",useEditorconfig:s}))}
162
+ `),r.info(`Converted ${o} -> ${i} (${String(c.length)} findings)`),he(n,"gitleaks","rewrittenScriptCount")},"migrateBaseline"),Ik=Ye((e,t,r,n,s)=>{const o=y(e,"package.json");if(!k(o))return;const i=ge(o);if(!i)return;const a=Mn(e),c=a?`vis secrets --config ${a}`:"vis secrets";let l=!1;if(i.scripts){for(const[f,u]of Object.entries(i.scripts))if(typeof u=="string"&&/\bgitleaks\b/.test(u)){const m=u.replaceAll(/\bgitleaks(?:\s+(?:detect|protect))?\b[^\n&|;]*/g,c).trim();m!==u&&(i.scripts[f]=m,l=!0,r.info(` scripts.${f}: "${u}" -> "${m}"`),he(n,"gitleaks","rewrittenScriptCount"))}}if(i.devDependencies){const f=i.devDependencies;for(const u of["gitleaks","@gitleaks/cli"])u in f&&(delete f[u],l=!0,he(n,"gitleaks","removedPackageCount"),r.info(` removed devDependency: ${u}`))}if(!l)return;if(t){r.info(`[dry-run] Would update ${o}`);return}const p=He(o,P(o),{defaultIndent:" ",useEditorconfig:s});re(o,n),oe(o,`${JSON.stringify(i,null,p)}
163
+ `)},"rewriteScripts"),Pk=Ye((e,t,r,n)=>{const s=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],o=Mn(e),i=o?`vis secrets --staged --config ${o}`:"vis secrets --staged";for(const a of s){const c=y(e,a);if(!k(c))continue;const l=P(c);if(!/\bgitleaks\b/.test(l))continue;const p=l.replaceAll(/\bgitleaks(?:\s+(?:detect|protect))?\b[^\n&|;]*/g,i);if(t){r.info(`[dry-run] Would rewrite ${c}`);continue}re(c,n),oe(c,p),n.gitHooksConfigured=!0,r.info(`Rewrote gitleaks invocation in ${a}`)}},"rewriteHooks"),Ak=/^([^:#][^:]*):([^:]+):(\d+)$/,Tk=Ye(e=>{const t=Ak.exec(e.trim());if(!t)return;const[,r,n,s]=t,o=Number.parseInt(s??"0",10);return{description:"",endColumn:0,endLine:o,entropy:0,file:r??"",match:"",ruleId:n??"",secret:"",startColumn:0,startLine:o,tags:[]}},"fingerprintToBaselineEntry"),Dk=Ye((e,t,r,n,s)=>{const o=Ri(e);if(!o)return;const i=P(o).split(/\r?\n/).map(m=>m.trim()).filter(m=>m.length>0&&!m.startsWith("#")).map(m=>Tk(m)).filter(m=>m!==void 0);i.length===0&&J(n,`${o} contained no recognisable fingerprint lines — deleting it.`);const a=y(e,".secrets-baseline.json"),c=k(a)?ge(a)??[]:[],l=new Set(c.map(m=>`${m.file}:${m.ruleId}:${String(m.startLine)}`)),p=[...c];for(const m of i){const h=`${m.file}:${m.ruleId}:${String(m.startLine)}`;l.has(h)||(l.add(h),p.push(m))}if(t){r.info(`[dry-run] Would merge ${String(i.length)} .gitleaksignore fingerprint(s) into ${a}, then delete ${o}.`);return}re(o,n);const f=k(a)?P(a):void 0;f!==void 0&&re(a,n);const u=He(a,f,{defaultIndent:" ",useEditorconfig:s});oe(a,`${JSON.stringify(p,null,u)}
164
+ `),Tr(o),r.info(`Merged ${String(i.length)} fingerprint(s) from ${o} into ${a}; removed .gitleaksignore.`),he(n,"gitleaks","rewrittenScriptCount",i.length)},"migrateIgnoreFile"),pa=Ye((e,t,r,n)=>{const s=Mn(e),o=Ri(e);return s??o??Ci(e)?(s&&(r.info(`Keeping ${s} as-is (compatible with vis secrets --config).`),Q(n,`Run \`vis secrets --config ${s}\` or rename to .gitleaksignore-compatible defaults.`)),o&&Dk(e,t.dryRun,r,n,t.useEditorconfig),Nk(e,t.dryRun,r,n,t.useEditorconfig),Ik(e,t.dryRun,r,n,t.useEditorconfig),Pk(e,t.dryRun,r,n),Q(n,"Review CI workflows (.github/workflows/*.yml) for gitleaks-action calls — replace with `vis secrets`."),!0):(t.silent||r.info("No gitleaks artifacts found — nothing to migrate."),!1)},"migrateGitleaks");var Lk=Object.defineProperty,at=d((e,t)=>Lk(e,"name",{value:t,configurable:!0}),"f$4");const Bk=["kingfisher-baseline.yaml",".kingfisher-baseline.yaml","kingfisher-baseline.yml",".kingfisher-baseline.yml"],Mk=["kingfisher-rules.yml","kingfisher-rules.yaml",".kingfisher-rules.yml",".kingfisher-rules.yaml"],xi=at(e=>Bk.find(t=>k(y(e,t))),"detectKingfisherBaseline"),Vn=at(e=>Mk.find(t=>k(y(e,t))),"detectKingfisherRules"),Vk=at(e=>{const t=[];let r={};for(const n of e.split(/\r?\n/)){const s=n.replace(/#.*$/,"");(/^\s*-\s*filepath\s*:/.test(s)||/^\s*-\s*$/.test(s))&&(r.filepath&&typeof r.linenum=="number"&&r.fingerprint&&t.push(r),r={});const o=/filepath\s*:\s*(.+?)\s*$/.exec(s);if(o?.[1]){r.filepath=o[1].replaceAll(/^["']|["']$/g,"");continue}const i=/fingerprint\s*:\s*(.+?)\s*$/.exec(s);if(i?.[1]){r.fingerprint=i[1].replaceAll(/^["']|["']$/g,"");continue}const a=/linenum\s*:\s*(\d+)/.exec(s);a?.[1]&&(r.linenum=Number.parseInt(a[1],10))}return r.filepath&&typeof r.linenum=="number"&&r.fingerprint&&t.push(r),t},"parseKingfisherBaseline"),_k=at(e=>({_kingfisherMigration:{legacyFingerprint:e.fingerprint,note:"Kingfisher xxhash — regenerate by running `vis secrets --update-baseline`."},description:"",endColumn:0,endLine:e.linenum,entropy:0,file:e.filepath,match:"",ruleId:"",secret:"",startColumn:0,startLine:e.linenum,tags:[]}),"toPlaceholderEntry"),Fk=at((e,t,r,n,s)=>{const o=xi(e);if(!o)return;const i=y(e,o);let a;try{a=Vk(P(i))}catch(p){const f=p instanceof Error?p.message:String(p);J(n,`Could not parse ${o} as a Kingfisher baseline: ${f}`);return}if(a.length===0){J(n,`${o} contained no recognisable records — leaving it in place for manual review.`);return}const c=y(e,".secrets-baseline.json");if(k(c)){J(n,`.secrets-baseline.json already exists — leaving Kingfisher baseline at ${o} for manual merge.`);return}const l=a.map(p=>_k(p));if(t){r.info(`[dry-run] Would convert ${o} -> .secrets-baseline.json (${String(l.length)} placeholder finding(s))`),Q(n,"Run `vis secrets --update-baseline` after migration — Kingfisher xxhash fingerprints aren't interchangeable with our content-hash.");return}re(i,n),oe(c,`${JSON.stringify(l,null,He(c,void 0,{defaultIndent:" ",useEditorconfig:s}))}
165
+ `),r.info(`Converted ${o} -> .secrets-baseline.json (${String(l.length)} placeholder finding(s))`),Q(n,"Run `vis secrets --update-baseline` — the converted entries are placeholders until the scanner computes real fingerprints."),he(n,"kingfisher","rewrittenScriptCount")},"migrateBaseline"),wp=/\bkingfisher(?:\s+(?:scan|validate|rules|update|manage-baseline|report|github|gitlab|bitbucket))?\b[^\n&|;]*/g,qk=at((e,t,r,n,s)=>{const o=y(e,"package.json");if(!k(o))return;const i=ge(o);if(!i)return;const a=Vn(e),c=a?`vis secrets --config ${a}`:"vis secrets";let l=!1;if(i.scripts)for(const[f,u]of Object.entries(i.scripts)){if(typeof u!="string"||!/\bkingfisher\b/.test(u))continue;const m=u.replaceAll(wp,h=>h.includes("validate")?`${c} --validate`:c).trim();m!==u&&(i.scripts[f]=m,l=!0,r.info(` scripts.${f}: "${u}" -> "${m}"`),he(n,"kingfisher","rewrittenScriptCount"))}if(i.devDependencies){const f=i.devDependencies;for(const u of["kingfisher","@mongodb/kingfisher","kingfisher-scanner"])u in f&&(delete f[u],l=!0,he(n,"kingfisher","removedPackageCount"),r.info(` removed devDependency: ${u}`))}if(!l)return;if(t){r.info(`[dry-run] Would update ${o}`);return}const p=He(o,P(o),{defaultIndent:" ",useEditorconfig:s});re(o,n),oe(o,`${JSON.stringify(i,null,p)}
166
+ `)},"rewriteScripts"),Uk=at((e,t,r,n)=>{const s=Vn(e),o=s?`vis secrets --staged --config ${s}`:"vis secrets --staged";for(const i of Sp){const a=y(e,i);if(!k(a))continue;const c=P(a);if(!/\bkingfisher\b/.test(c))continue;const l=c.replaceAll(wp,o);if(t){r.info(`[dry-run] Would rewrite ${a}`);continue}re(a,n),oe(a,l),n.gitHooksConfigured=!0,r.info(`Rewrote kingfisher invocation in ${i}`)}},"rewriteHooks"),Sp=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],ua=at(e=>{if(!k(e))return!1;try{return/\bkingfisher\b/.test(P(e))}catch{return!1}},"hasKingfisherRef"),da=at((e,t,r,n)=>{const s=xi(e),o=Vn(e),i=ua(y(e,"package.json")),a=Sp.some(c=>ua(y(e,c)));return(s??o)||i||a?(o&&(r.info(`Found custom Kingfisher ruleset at ${o} — keeping it for now.`),Q(n,`Convert ${o} to gitleaks-shaped JSON using \`packages/tooling/secret-scanner/scripts/kingfisher-converter.mjs\`, then point \`vis secrets --config\` at the result.`)),s&&Fk(e,t.dryRun,r,n,t.useEditorconfig),qk(e,t.dryRun,r,n,t.useEditorconfig),Uk(e,t.dryRun,r,n),Q(n,"Replace `# kingfisher:ignore` markers with `# secret-scanner:allow` (or keep `# gitleaks:allow` — the scanner accepts both)."),Q(n,"Review CI workflows (.github/workflows/*.yml) for Kingfisher action/docker invocations — replace with `vis secrets`."),!0):(t.silent||r.info("No Kingfisher artifacts found — nothing to migrate."),!1)},"migrateKingfisher");var Wk=Object.defineProperty,ye=d((e,t)=>Wk(e,"name",{value:t,configurable:!0}),"r$9");const Gk=/\bstaged\s*:/,fa=/(defineConfig\(\{)/,ma=/(export\s+default\s+\{)/;ye(e=>Co.some(t=>k(y(e,t))),"hasStandaloneLintStagedConfig");const Jk=ye(e=>{for(const r of Zc)if(k(y(e,r)))return!0;const t=y(e,".lintstagedrc");return k(t)&&!ar(t)},"hasUnsupportedLintStagedConfig"),Kk=ye(e=>{const t=Nt(e);if(!t)return!1;const r=P(t);return Gk.test(r)},"hasStagedConfigInVisConfig"),jp=ye(e=>{const t=y(e,"package.json");if(k(t)&&ge(t)?.["lint-staged"])return"package.json";for(const r of Co)if(k(y(e,r)))return r},"detectLintStagedConfig"),zk=ye(e=>ge(y(e,"package.json"))?.["lint-staged"],"extractLintStagedFromPackageJson"),Hk=ye(e=>ge(e),"parseLintStagedJsonFile"),uo=ye(e=>` staged: {
167
+ ${Object.entries(e).map(([t,r])=>{const n=Array.isArray(r)?`[${r.map(s=>JSON.stringify(s)).join(", ")}]`:JSON.stringify(r);return` ${JSON.stringify(t)}: ${n}`}).join(`,
168
+ `)},
169
+ }`,"generateStagedConfigSnippet"),Yk=ye((e,t,r)=>{const n=Nt(e);if(n){const i=P(n),a=uo(t);let c;return fa.test(i)?c=i.replace(fa,`$1
170
+ ${a},`):ma.test(i)&&(c=i.replace(ma,`$1
171
+ ${a},`)),c?(re(n),ue(n,c,"utf8"),r.info(`Merged staged config into ${n}`),!0):(r.warn(`Could not auto-insert staged config into ${n} — please add manually`),!1)}const s=y(e,"vis.config.ts"),o=`import { defineConfig } from "@visulima/vis/config";
172
+
173
+ export default defineConfig({
174
+ ${uo(t)},
175
+ });
176
+ `;return ue(s,o,"utf8"),r.info(`Created ${s} with staged config`),!0},"insertStagedIntoVisConfig"),Xk=ye((e,t)=>{const r=y(e,"package.json"),n={configRemoved:!1,dependencyRemoved:!1};if(!k(r))return n;const s=P(r),o=JSON.parse(s);let i=!1;o["lint-staged"]&&(delete o["lint-staged"],i=!0,n.configRemoved=!0);const a=o.devDependencies,c=o.dependencies;if(a?.["lint-staged"]&&(delete a["lint-staged"],i=!0,n.dependencyRemoved=!0),c?.["lint-staged"]&&(delete c["lint-staged"],i=!0,n.dependencyRemoved=!0),i){const l=Gr(r,s,{useEditorconfig:t});re(r),ue(r,`${JSON.stringify(o,void 0,l)}
177
+ `,"utf8")}return n},"removeLintStagedFromPackageJson"),Qk=ye((e,t)=>{for(const r of Co){const n=y(e,r);k(n)&&(re(n,t),Tr(n),t.removedConfigCount+=1)}},"removeLintStagedConfigFiles"),Zk=ye((e,t)=>{const r=y(e,t,"pre-commit");if(!k(r))return!1;const n=P(r);if(n.includes("vis staged"))return!1;const s=n.split(`
178
+ `);let o=!1;const i=[];for(const a of s){const c=a.trim();if(!o){let l=!1;for(const p of tg){const f=p.exec(c);if(f){const u=a.slice(0,a.length-a.trimStart().length),m=f[1]?.trim()??"",h=c.slice(f[0].length).trim(),g=[m,"vis staged",h].filter(Boolean);i.push(`${u}${g.join(" ")}`),o=!0,l=!0;break}}if(l)continue}i.push(a)}return o?(re(r),ue(r,i.join(`
179
+ `)),!0):!1},"rewritePreCommitHook"),e$=ye((e,t,r)=>{if(t==="package.json")return zk(e);const n=y(e,t);if(!Qc.includes(t)){J(r,`${t} cannot be auto-migrated — please add "staged" config to vis.config.ts manually`),Q(r,`Manually convert ${t} to staged config in vis.config.ts`);return}if(t===".lintstagedrc"&&!ar(n)){J(r,".lintstagedrc is not JSON format — please migrate manually");return}return Hk(n)},"extractConfig"),Op=ye((e,t,r)=>{const{configRemoved:n,dependencyRemoved:s}=Xk(e,r);n&&(t.inlinedLintStagedConfigCount+=1),s&&(t.removedPackageCount+=1),Qk(e,t)},"cleanupLintStagedArtifacts"),t$=ye((e,t,r,n)=>{const s=[".vis-hooks",".husky"];for(const o of s)k(y(e,o))&&Zk(e,o)&&(n.gitHooksConfigured=!0,t.silent||r.info(`Rewrote pre-commit hook in ${o}/ to use "vis staged"`))},"rewriteHooks"),r$=ye((e,t,r,n,s)=>{Yk(e,t,n)&&(s.mergedStagedConfigCount+=1),Op(e,s,r.useEditorconfig),t$(e,r,n,s)},"applyMigration"),ga=ye((e,t,r,n)=>{const s=jp(e);if(!s)return t.silent||r.info("No lint-staged configuration found — nothing to migrate."),!1;if(Jk(e)&&(J(n,'Non-JSON lint-staged config found — please migrate to "staged" in vis.config.ts manually'),Q(n,"Convert your lint-staged config file to JSON format or add staged config to vis.config.ts manually")),Kk(e))return J(n,'vis.config.ts already has a "staged" config — skipping lint-staged merge'),t.silent||r.warn('vis.config.ts already has a "staged" config — skipping'),t.dryRun||Op(e,n,t.useEditorconfig),!0;const o=e$(e,s,n);return!o||Object.keys(o).length===0?(t.silent||r.warn("lint-staged config is empty — skipping"),!1):t.dryRun?(t.silent||(r.info("[dry-run] Would insert staged config into vis.config.ts:"),r.info(uo(o))),!0):(r$(e,o,t,r,n),!0)},"migrateLintStaged");var n$=Object.defineProperty,Ni=d((e,t)=>n$(e,"name",{value:t,configurable:!0}),"t$c");const Ii=Ni((e,t,r)=>{const n=t?He(t,void 0,{defaultIndent:" ",useEditorconfig:r}):" ";return JSON.stringify(e,null,n).replaceAll(/"(\w+)":/g,"$1:")},"serializeConfigObject"),Pi=Ni((e,t,r,n,s)=>{const o=y(e,"vis.config.ts");return k(o)&&!r.dryRun?(n.warn("vis.config.ts already exists — refusing to overwrite. Remove it first or run with --dry-run."),s.warnings.push("vis.config.ts already exists; migration skipped writing the file."),!1):(r.dryRun?(n.info("── vis.config.ts (preview) ──"),n.info(t),n.info("── end preview ──")):(oe(o,t),n.info(`Wrote ${o}`)),!0)},"writeVisConfig"),Ep=Ni((e,t)=>{const r=y(e,t);if(k(r))try{return JSON.parse(P(r))}catch(n){throw new Error(`Failed to parse ${r}: ${n.message}`,{cause:n})}},"readJsonConfig");var s$=Object.defineProperty,cr=d((e,t)=>s$(e,"name",{value:t,configurable:!0}),"c$9");const o$=cr(e=>{const t={};return e.command&&(t.command=Array.isArray(e.args)?`${e.command} ${e.args.join(" ")}`:e.args?`${e.command} ${e.args}`:e.command),e.deps&&e.deps.length>0&&(t.dependsOn=e.deps),e.inputs&&e.inputs.length>0&&(t.inputs=e.inputs),e.outputs&&e.outputs.length>0&&(t.outputs=e.outputs),e.type&&(t.type=e.type),e.preset&&(t.preset=e.preset),e.options&&(t.options=e.options),t},"taskToVisTarget"),i$=cr((e,t,r)=>{const n={};e.fileGroups&&(n.fileGroups=e.fileGroups);const s={};for(const[o,i]of Object.entries(e.tasks??{}))s[o]=o$(i);return Object.keys(s).length>0&&(n.targetDefaults=s),e.implicitInputs&&e.implicitInputs.length>0&&(n.namedInputs={default:e.implicitInputs}),["// Migrated from moon's .moon/tasks.yml by `vis migrate moon`.","// Per-project moon.yml files can be converted to project.json —","// review the generated file and move project-specific tasks there.","",'import { defineConfig } from "@visulima/vis/config";',"",`export default defineConfig(${Ii(n,y(t,"vis.config.ts"),r)});`,""].join(`
180
+ `)},"renderVisConfig"),a$=cr(e=>{const t=y(e,".moon");if(!k(t))return;for(const n of["tasks.yml","tasks.yaml"]){const s=y(t,n);if(k(s))return s}const r=y(t,"tasks");if(k(r)){const n=Ge(r).filter(s=>s.endsWith(".yml")||s.endsWith(".yaml")).sort();if(n.length>0)return y(r,n[0])}},"findMoonTasksFile"),c$=cr(e=>{const t=y(e,".moon","templates");if(!k(t))return[];const r=[];try{for(const n of Ge(t,{withFileTypes:!0}))n.isDirectory()&&k(y(t,n.name,"template.yml"))&&r.push(n.name)}catch{}return r.sort()},"findMoonTemplates"),l$=cr((e,t,r,n,s)=>{const o=y(e,".moon","templates"),i=y(e,".vis","templates");r||Gu(i,{recursive:!0});for(const a of t){const c=y(o,a),l=y(i,a);if(k(l)){s.warnings.push(`Template "${a}" already exists at .vis/templates/${a} — left untouched. Remove or rename either copy to resolve.`);continue}if(r){n.info(`Would copy .moon/templates/${a} → .vis/templates/${a}`);continue}try{Ju(c,l,{recursive:!0}),n.info(`Copied .moon/templates/${a} → .vis/templates/${a}`)}catch(p){const f=p instanceof Error?p.message:String(p);s.warnings.push(`Failed to copy template "${a}": ${f}`)}}!r&&t.length>0&&s.manualSteps.push(`Copied ${String(t.length)} template${t.length===1?"":"s"} from .moon/templates/ to .vis/templates/. Remove the .moon/templates/ directory when ready.`)},"copyMoonTemplatesToVis"),ha=cr((e,t,r,n)=>{const s=a$(e);if(!s){r.warn("No .moon/tasks.yml (or .moon/tasks/<scope>.yml) found — nothing to migrate."),n.warnings.push("No moon tasks file at workspace root.");return}let o;try{o=Dr(s)}catch(l){throw new Error(`Failed to parse ${s}: ${l.message}`,{cause:l})}for(const[l,p]of Object.entries(o.tasks??{}))p.env&&Object.keys(p.env).length>0&&n.warnings.push(`Task "${l}" has an \`env\` block which vis does not support — set environment variables in the command or a wrapper script.`),p.platform&&n.warnings.push(`Task "${l}" has a \`platform\` field ("${p.platform}") which vis does not support — review and remove.`),p.toolchain&&n.warnings.push(`Task "${l}" has a \`toolchain\` field ("${p.toolchain}") which vis does not support — review and remove.`),Array.isArray(p.args)&&p.args.some(f=>f.includes(" "))&&n.warnings.push(`Task "${l}" has \`args\` entries containing spaces — vis flattens args into the command string so quoting may need manual adjustment.`);o.extends&&o.extends.length>0&&n.warnings.push("`extends` was found in the moon config but has no direct vis equivalent — inline the referenced files or use vis's `taskDefaults` blocks."),o.implicitDeps&&o.implicitDeps.length>0&&n.warnings.push("`implicitDeps` was found in the moon config but has no direct vis equivalent — add explicit `dependsOn` entries in project.json instead."),o.taskOptions&&Object.keys(o.taskOptions).length>0&&n.warnings.push("`taskOptions` was found in the moon config but has no direct vis equivalent — review and apply settings per-target in vis.config.ts.");const i=i$(o,e,t.useEditorconfig);if(!Pi(e,i,t,r,n))return;n.manualSteps.push("moon's per-project `moon.yml` files should be converted to `project.json`. vis reads targets, tags, layer, stack, language, and owners from project.json — the field names match."),n.manualSteps.push("Scoped `.moon/tasks/<scope>.yml` files map to vis's `taskDefaults` with a `scope` block. Only the first scope file was parsed — review the generated file."),n.manualSteps.push("vis tasks support `when: { os, env, branch, ci, not.* }` for conditional execution and `always: true` for cleanup tasks that fire even when upstream fails. Review tasks that used moon's `local: true`, `options.runInCI`, or shell-based platform gating — the new surface is more expressive and may simplify them. See docs/guides/conditional-and-finally-tasks.mdx.");const a=c$(e);if(a.length===0)return;const c=a.map(l=>`"${l}"`).join(", ");t.copyTemplates?l$(e,a,!!t.dryRun,r,n):n.manualSteps.push(`Detected ${String(a.length)} template${a.length===1?"":"s"} under .moon/templates/ (${c}). They are already usable via \`vis generate <name>\` — vis auto-discovers moon-format template directories at runtime. To decouple from moon entirely, re-run \`vis migrate moon --copy-templates\` to physically move them to .vis/templates/.`)},"migrateMoon");var p$=Object.defineProperty,ve=d((e,t)=>p$(e,"name",{value:t,configurable:!0}),"r$8");const u$=/\bstaged\s*:/,ya=/(defineConfig\(\{)/,va=/(export\s+default\s+\{)/;ve(e=>xo.some(t=>k(y(e,t))),"hasStandaloneNanoStagedConfig");const d$=ve(e=>{for(const r of tl)if(k(y(e,r)))return!0;const t=y(e,".nanostagedrc");return k(t)&&!ar(t)},"hasUnsupportedNanoStagedConfig"),f$=ve(e=>{const t=Nt(e);return t?u$.test(P(t)):!1},"hasStagedConfigInVisConfig"),Rp=ve(e=>{const t=y(e,"package.json");if(k(t)&&ge(t)?.["nano-staged"])return"package.json";for(const r of xo)if(k(y(e,r)))return r},"detectNanoStagedConfig"),m$=ve(e=>ge(y(e,"package.json"))?.["nano-staged"],"extractNanoStagedFromPackageJson"),g$=ve(e=>ge(e),"parseNanoStagedJsonFile"),fo=ve(e=>` staged: {
181
+ ${Object.entries(e).map(([t,r])=>{const n=Array.isArray(r)?`[${r.map(s=>JSON.stringify(s)).join(", ")}]`:JSON.stringify(r);return` ${JSON.stringify(t)}: ${n}`}).join(`,
30
182
  `)},
31
- }`,"generateStagedConfigSnippet"),Ms=M((e,t,n)=>{const o=Ae(e);if(o){const i=j(o),s=nt(t);let l;return Et.test(i)?l=i.replace(Et,`$1
32
- ${s},`):Tt.test(i)&&(l=i.replace(Tt,`$1
33
- ${s},`)),l?(B(o),E(o,l,"utf8"),n.info(`Merged staged config into ${o}`),!0):(n.warn(`Could not auto-insert staged config into ${o} — please add manually`),!1)}const a=d(e,"vis.config.ts"),r=`import { defineConfig } from "@visulima/vis/config";
183
+ }`,"generateStagedConfigSnippet"),h$=ve((e,t,r)=>{const n=Nt(e);if(n){const i=P(n),a=fo(t);let c;return ya.test(i)?c=i.replace(ya,`$1
184
+ ${a},`):va.test(i)&&(c=i.replace(va,`$1
185
+ ${a},`)),c?(re(n),ue(n,c,"utf8"),r.info(`Merged staged config into ${n}`),!0):(r.warn(`Could not auto-insert staged config into ${n} — please add manually`),!1)}const s=y(e,"vis.config.ts"),o=`import { defineConfig } from "@visulima/vis/config";
34
186
 
35
187
  export default defineConfig({
36
- ${nt(t)},
188
+ ${fo(t)},
37
189
  });
38
- `;return E(a,r,"utf8"),n.info(`Created ${a} with staged config`),!0},"insertStagedIntoVisConfig"),Ns=M(e=>{const t=d(e,"package.json"),n={configRemoved:!1,dependencyRemoved:!1};if(!u(t))return n;const o=j(t),a=JSON.parse(o);let r=!1;a["lint-staged"]&&(delete a["lint-staged"],r=!0,n.configRemoved=!0);const i=a.devDependencies,s=a.dependencies;if(i?.["lint-staged"]&&(delete i["lint-staged"],r=!0,n.dependencyRemoved=!0),s?.["lint-staged"]&&(delete s["lint-staged"],r=!0,n.dependencyRemoved=!0),r){const l=mt(o);B(t),E(t,`${JSON.stringify(a,void 0,l)}
39
- `,"utf8")}return n},"removeLintStagedFromPackageJson"),Ws=M((e,t)=>{for(const n of pt){const o=d(e,n);u(o)&&(B(o,t),Fe(o),t.removedConfigCount+=1)}},"removeLintStagedConfigFiles"),Fs=M((e,t)=>{const n=d(e,t,"pre-commit");if(!u(n))return!1;const o=j(n);if(o.includes("vis staged"))return!1;const a=o.split(`
40
- `);let r=!1;const i=[];for(const s of a){const l=s.trim();if(!r){let c=!1;for(const p of di){const h=p.exec(l);if(h){const v=s.slice(0,s.length-s.trimStart().length),$=h[1]?.trim()??"",P=l.slice(h[0].length).trim(),R=[$,"vis staged",P].filter(Boolean);i.push(`${v}${R.join(" ")}`),r=!0,c=!0;break}}if(c)continue}i.push(s)}return r?(B(n),E(n,i.join(`
41
- `)),!0):!1},"rewritePreCommitHook"),Ls=M((e,t,n)=>{if(t==="package.json")return Ts(e);const o=d(e,t);if(!un.includes(t)){D(n,`${t} cannot be auto-migrated — please add "staged" config to vis.config.ts manually`),F(n,`Manually convert ${t} to staged config in vis.config.ts`);return}if(t===".lintstagedrc"&&!Ue(o)){D(n,".lintstagedrc is not JSON format — please migrate manually");return}return Ds(o)},"extractConfig"),Pn=M((e,t)=>{const{configRemoved:n,dependencyRemoved:o}=Ns(e);n&&(t.inlinedLintStagedConfigCount+=1),o&&(t.removedPackageCount+=1),Ws(e,t)},"cleanupLintStagedArtifacts"),_s=M((e,t,n,o)=>{const a=[".vis-hooks",".husky"];for(const r of a)u(d(e,r))&&Fs(e,r)&&(o.gitHooksConfigured=!0,t.silent||n.info(`Rewrote pre-commit hook in ${r}/ to use "vis staged"`))},"rewriteHooks"),zs=M((e,t,n,o,a)=>{Ms(e,t,o)&&(a.mergedStagedConfigCount+=1),Pn(e,a),_s(e,n,o,a)},"applyMigration"),Dt=M((e,t,n,o)=>{const a=On(e);if(!a)return t.silent||n.info("No lint-staged configuration found — nothing to migrate."),!1;if(As(e)&&(D(o,'Non-JSON lint-staged config found — please migrate to "staged" in vis.config.ts manually'),F(o,"Convert your lint-staged config file to JSON format or add staged config to vis.config.ts manually")),Es(e))return D(o,'vis.config.ts already has a "staged" config — skipping lint-staged merge'),t.silent||n.warn('vis.config.ts already has a "staged" config — skipping'),t.dryRun||Pn(e,o),!0;const r=Ls(e,a,o);return!r||Object.keys(r).length===0?(t.silent||n.warn("lint-staged config is empty — skipping"),!1):t.dryRun?(t.silent||(n.info("[dry-run] Would insert staged config into vis.config.ts:"),n.info(nt(r))),!0):(zs(e,r,t,n,o),!0)},"migrateLintStaged");var Us=Object.defineProperty,vt=f((e,t)=>Us(e,"name",{value:t,configurable:!0}),"t$7");const kt=vt(e=>JSON.stringify(e,null,4).replaceAll(/"(\w+)":/g,"$1:"),"serializeConfigObject"),bt=vt((e,t,n,o,a)=>{const r=d(e,"vis.config.ts");return u(r)&&!n.dryRun?(o.warn("vis.config.ts already exists — refusing to overwrite. Remove it first or run with --dry-run."),a.warnings.push("vis.config.ts already exists; migration skipped writing the file."),!1):(n.dryRun?(o.info("── vis.config.ts (preview) ──"),o.info(t),o.info("── end preview ──")):(A(r,t),o.info(`Wrote ${r}`)),!0)},"writeVisConfig"),Rn=vt((e,t)=>{const n=d(e,t);if(u(n))try{return JSON.parse(j(n))}catch(o){throw new Error(`Failed to parse ${n}: ${o.message}`)}},"readJsonConfig");var Js=Object.defineProperty,$e=f((e,t)=>Js(e,"name",{value:t,configurable:!0}),"c$5");const Gs=$e(e=>{const t={};return e.command&&(t.command=Array.isArray(e.args)?`${e.command} ${e.args.join(" ")}`:e.args?`${e.command} ${e.args}`:e.command),e.deps&&e.deps.length>0&&(t.dependsOn=e.deps),e.inputs&&e.inputs.length>0&&(t.inputs=e.inputs),e.outputs&&e.outputs.length>0&&(t.outputs=e.outputs),e.type&&(t.type=e.type),e.preset&&(t.preset=e.preset),e.options&&(t.options=e.options),t},"taskToVisTarget"),Hs=$e(e=>{const t={};e.fileGroups&&(t.fileGroups=e.fileGroups);const n={};for(const[o,a]of Object.entries(e.tasks??{}))n[o]=Gs(a);return Object.keys(n).length>0&&(t.targetDefaults=n),e.implicitInputs&&e.implicitInputs.length>0&&(t.namedInputs={default:e.implicitInputs}),["// Migrated from moon's .moon/tasks.yml by `vis migrate moon`.","// Per-project moon.yml files can be converted to project.json —","// review the generated file and move project-specific tasks there.","",'import { defineConfig } from "@visulima/vis/config";',"",`export default defineConfig(${kt(t)});`,""].join(`
42
- `)},"renderVisConfig"),qs=$e(e=>{const t=d(e,".moon");if(!u(t))return;for(const o of["tasks.yml","tasks.yaml"]){const a=d(t,o);if(u(a))return a}const n=d(t,"tasks");if(u(n)){const o=ae(n).filter(a=>a.endsWith(".yml")||a.endsWith(".yaml")).sort();if(o.length>0)return d(n,o[0])}},"findMoonTasksFile"),Ks=$e(e=>{const t=d(e,".moon","templates");if(!u(t))return[];const n=[];try{for(const o of ae(t,{withFileTypes:!0}))o.isDirectory()&&u(d(t,o.name,"template.yml"))&&n.push(o.name)}catch{}return n.sort()},"findMoonTemplates"),Ys=$e((e,t,n,o,a)=>{const r=d(e,".moon","templates"),i=d(e,".vis","templates");n||po(i,{recursive:!0});for(const s of t){const l=d(r,s),c=d(i,s);if(u(c)){a.warnings.push(`Template "${s}" already exists at .vis/templates/${s} left untouched. Remove or rename either copy to resolve.`);continue}if(n){o.info(`Would copy .moon/templates/${s} → .vis/templates/${s}`);continue}try{uo(l,c,{recursive:!0}),o.info(`Copied .moon/templates/${s} .vis/templates/${s}`)}catch(p){const h=p instanceof Error?p.message:String(p);a.warnings.push(`Failed to copy template "${s}": ${h}`)}}!n&&t.length>0&&a.manualSteps.push(`Copied ${String(t.length)} template${t.length===1?"":"s"} from .moon/templates/ to .vis/templates/. Remove the .moon/templates/ directory when ready.`)},"copyMoonTemplatesToVis"),Mt=$e((e,t,n,o)=>{const a=qs(e);if(!a){n.warn("No .moon/tasks.yml (or .moon/tasks/<scope>.yml) found nothing to migrate."),o.warnings.push("No moon tasks file at workspace root.");return}let r;try{r=nn(a)}catch(c){throw new Error(`Failed to parse ${a}: ${c.message}`)}for(const[c,p]of Object.entries(r.tasks??{}))p.env&&Object.keys(p.env).length>0&&o.warnings.push(`Task "${c}" has an \`env\` block which vis does not support set environment variables in the command or a wrapper script.`),p.platform&&o.warnings.push(`Task "${c}" has a \`platform\` field ("${p.platform}") which vis does not support — review and remove.`),p.toolchain&&o.warnings.push(`Task "${c}" has a \`toolchain\` field ("${p.toolchain}") which vis does not support — review and remove.`),Array.isArray(p.args)&&p.args.some(h=>h.includes(" "))&&o.warnings.push(`Task "${c}" has \`args\` entries containing spaces — vis flattens args into the command string so quoting may need manual adjustment.`);r.extends&&r.extends.length>0&&o.warnings.push("`extends` was found in the moon config but has no direct vis equivalent inline the referenced files or use vis's `taskDefaults` blocks."),r.implicitDeps&&r.implicitDeps.length>0&&o.warnings.push("`implicitDeps` was found in the moon config but has no direct vis equivalent add explicit `dependsOn` entries in project.json instead."),r.taskOptions&&Object.keys(r.taskOptions).length>0&&o.warnings.push("`taskOptions` was found in the moon config but has no direct vis equivalent — review and apply settings per-target in vis.config.ts.");const i=Hs(r);if(!bt(e,i,t,n,o))return;o.manualSteps.push("moon's per-project `moon.yml` files should be converted to `project.json`. vis reads targets, tags, layer, stack, language, and owners from project.json — the field names match."),o.manualSteps.push("Scoped `.moon/tasks/<scope>.yml` files map to vis's `taskDefaults` with a `scope` block. Only the first scope file was parsed — review the generated file."),o.manualSteps.push("vis tasks support `when: { os, env, branch, ci, not.* }` for conditional execution and `always: true` for cleanup tasks that fire even when upstream fails. Review tasks that used moon's `local: true`, `options.runInCI`, or shell-based platform gating — the new surface is more expressive and may simplify them. See docs/guides/conditional-and-finally-tasks.mdx.");const s=Ks(e);if(s.length===0)return;const l=s.map(c=>`"${c}"`).join(", ");t.copyTemplates?Ys(e,s,!!t.dryRun,n,o):o.manualSteps.push(`Detected ${String(s.length)} template${s.length===1?"":"s"} under .moon/templates/ (${l}). They are already usable via \`vis generate <name>\` vis auto-discovers moon-format template directories at runtime. To decouple from moon entirely, re-run \`vis migrate moon --copy-templates\` to physically move them to .vis/templates/.`)},"migrateMoon");var Qs=Object.defineProperty,N=f((e,t)=>Qs(e,"name",{value:t,configurable:!0}),"r$7");const Xs=/\bstaged\s*:/,Nt=/(defineConfig\(\{)/,Wt=/(export\s+default\s+\{)/;N(e=>ut.some(t=>u(d(e,t))),"hasStandaloneNanoStagedConfig");const Zs=N(e=>{for(const n of gn)if(u(d(e,n)))return!0;const t=d(e,".nanostagedrc");return u(t)&&!Ue(t)},"hasUnsupportedNanoStagedConfig"),el=N(e=>{const t=Ae(e);return t?Xs.test(j(t)):!1},"hasStagedConfigInVisConfig"),In=N(e=>{const t=d(e,"package.json");if(u(t)&&J(t)?.["nano-staged"])return"package.json";for(const n of ut)if(u(d(e,n)))return n},"detectNanoStagedConfig"),tl=N(e=>J(d(e,"package.json"))?.["nano-staged"],"extractNanoStagedFromPackageJson"),nl=N(e=>J(e),"parseNanoStagedJsonFile"),ot=N(e=>` staged: {
43
- ${Object.entries(e).map(([t,n])=>{const o=Array.isArray(n)?`[${n.map(a=>JSON.stringify(a)).join(", ")}]`:JSON.stringify(n);return` ${JSON.stringify(t)}: ${o}`}).join(`,
190
+ `;return ue(s,o,"utf8"),r.info(`Created ${s} with staged config`),!0},"insertStagedIntoVisConfig"),y$=ve((e,t)=>{const r=y(e,"package.json"),n={configRemoved:!1,dependencyRemoved:!1};if(!k(r))return n;const s=P(r),o=JSON.parse(s);let i=!1;o["nano-staged"]&&(delete o["nano-staged"],i=!0,n.configRemoved=!0);const a=o.devDependencies,c=o.dependencies;if(a?.["nano-staged"]&&(delete a["nano-staged"],i=!0,n.dependencyRemoved=!0),c?.["nano-staged"]&&(delete c["nano-staged"],i=!0,n.dependencyRemoved=!0),i){const l=Gr(r,s,{useEditorconfig:t});re(r),ue(r,`${JSON.stringify(o,void 0,l)}
191
+ `,"utf8")}return n},"removeNanoStagedFromPackageJson"),v$=ve((e,t)=>{for(const r of xo){const n=y(e,r);k(n)&&(re(n,t),Tr(n),t.removedConfigCount+=1)}},"removeNanoStagedConfigFiles"),b$=ve((e,t)=>{const r=y(e,t,"pre-commit");if(!k(r))return!1;const n=P(r);if(n.includes("vis staged"))return!1;const s=n.split(`
192
+ `);let o=!1;const i=[];for(const a of s){const c=a.trim();if(!o){let l=!1;for(const p of rg){const f=p.exec(c);if(f){const u=a.slice(0,a.length-a.trimStart().length),m=f[1]?.trim()??"",h=c.slice(f[0].length).trim(),g=[m,"vis staged",h].filter(Boolean);i.push(`${u}${g.join(" ")}`),o=!0,l=!0;break}}if(l)continue}i.push(a)}return o?(re(r),ue(r,i.join(`
193
+ `)),!0):!1},"rewritePreCommitHook"),k$=ve((e,t,r)=>{if(t==="package.json")return m$(e);const n=y(e,t);if(!el.includes(t)){J(r,`${t} cannot be auto-migrated — please add "staged" config to vis.config.ts manually`),Q(r,`Manually convert ${t} to staged config in vis.config.ts`);return}if(t===".nanostagedrc"&&!ar(n)){J(r,".nanostagedrc is not JSON format — please migrate manually");return}return g$(n)},"extractConfig"),Cp=ve((e,t,r)=>{const{configRemoved:n,dependencyRemoved:s}=y$(e,r);n&&(t.inlinedLintStagedConfigCount+=1),s&&(t.removedPackageCount+=1),v$(e,t)},"cleanupNanoStagedArtifacts"),$$=ve((e,t,r,n)=>{const s=[".vis-hooks",".husky"];for(const o of s)k(y(e,o))&&b$(e,o)&&(n.gitHooksConfigured=!0,t.silent||r.info(`Rewrote pre-commit hook in ${o}/ to use "vis staged"`))},"rewriteHooks"),w$=ve((e,t,r,n,s)=>{h$(e,t,n)&&(s.mergedStagedConfigCount+=1),Cp(e,s,r.useEditorconfig),$$(e,r,n,s)},"applyMigration"),ba=ve((e,t,r,n)=>{const s=Rp(e);if(!s)return t.silent||r.info("No nano-staged configuration found — nothing to migrate."),!1;if(d$(e)&&(J(n,'Non-JSON nano-staged config found — please migrate to "staged" in vis.config.ts manually'),Q(n,"Convert your nano-staged config file to JSON format or add staged config to vis.config.ts manually")),f$(e))return J(n,'vis.config.ts already has a "staged" config — skipping nano-staged merge'),t.silent||r.warn('vis.config.ts already has a "staged" config — skipping'),t.dryRun||Cp(e,n,t.useEditorconfig),!0;const o=k$(e,s,n);return!o||Object.keys(o).length===0?(t.silent||r.warn("nano-staged config is empty — skipping"),!1):t.dryRun?(t.silent||(r.info("[dry-run] Would insert staged config into vis.config.ts:"),r.info(fo(o))),!0):(w$(e,o,t,r,n),!0)},"migrateNanoStaged");var S$=Object.defineProperty,xp=d((e,t)=>S$(e,"name",{value:t,configurable:!0}),"a$9");const j$=xp((e,t,r)=>{const n={};return e.namedInputs&&Object.keys(e.namedInputs).length>0&&(n.namedInputs=e.namedInputs),e.targetDefaults&&Object.keys(e.targetDefaults).length>0&&(n.targetDefaults=e.targetDefaults),["// Migrated from nx.json by `vis migrate nx`.","// Per-project project.json files are compatible with vis and do not need to be rewritten —","// vis already reads targets, tags, implicitDependencies, and sourceRoot.","",'import { defineConfig } from "@visulima/vis/config";',"",`export default defineConfig(${Ii(n,y(t,"vis.config.ts"),r)});`,""].join(`
194
+ `)},"renderVisConfig"),ka=xp((e,t,r,n)=>{const s=Ep(e,"nx.json");if(!s){r.warn("No nx.json found in workspace root — nothing to migrate."),n.warnings.push("No nx.json at workspace root.");return}const o=j$(s,e,t.useEditorconfig);Pi(e,o,t,r,n)&&(n.manualSteps.push("Existing project.json files are vis-compatible and have been left untouched. Rename `sourceRoot` -> `sourceRoot` is identical; `tags`, `implicitDependencies`, and `targets` translate directly."),n.manualSteps.push("vis adds two task primitives nx doesn't expose declaratively: `when: { os, env, branch, ci, not.* }` for conditional execution (replaces ad-hoc `configurations`) and `always: true` for finally/teardown tasks that run even when upstream fails. See docs/guides/conditional-and-finally-tasks.mdx."),(s.affected?.defaultBase||s.defaultBase)&&n.manualSteps.push(`nx's default base branch (${s.affected?.defaultBase??s.defaultBase}) is honoured by vis via the --base flag; no vis config change needed.`))},"migrateNx");var O$=Object.defineProperty,nt=d((e,t)=>O$(e,"name",{value:t,configurable:!0}),"a$8");const Np=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],Ip=[".secretlintignore"],Pp=nt(e=>Np.find(t=>k(y(e,t))),"detectSecretlintConfig"),Ap=nt(e=>Ip.find(t=>k(y(e,t))),"detectSecretlintIgnore"),E$=nt((e,t,r)=>{if(t.endsWith(".js")||t.endsWith(".mjs")||t.endsWith(".cjs"))return J(r,`${t} is a JS config — cannot auto-extract rule IDs. Review manually to confirm coverage.`),[];if(t.endsWith(".yml")||t.endsWith(".yaml"))return J(r,`${t} is YAML cannot auto-extract rule IDs without a YAML parser. Review manually.`),[];const n=ge(y(e,t));if(!n)return[];const s=new Set,o=nt(i=>{if(i)for(const a of i)a.id&&s.add(a.id),a.rules&&o(a.rules)},"walk");return o(n.rules),[...s]},"extractRuleIds"),R$=nt((e,t,r,n)=>{for(const s of[...Np,...Ip]){const o=y(e,s);if(k(o)){if(t){r.info(`[dry-run] Would remove ${o}`);continue}re(o,n),Tr(o),he(n,"secretlint","removedConfigCount"),r.info(`Removed ${o}`)}}},"removeSecretlintConfigFiles"),C$=nt((e,t,r,n)=>{const s=y(e,".secretlintignore");if(!k(s))return;const o=P(s).split(/\r?\n/).map(i=>i.trim()).filter(i=>i&&!i.startsWith("#"));o.length!==0&&(Q(n,`.secretlintignore contained ${String(o.length)} path pattern(s). vis secrets uses .gitignore + --exclude / --exclude-from; add these globs to your .gitignore or pass --exclude: ${o.slice(0,5).join(", ")}${o.length>5?", ...":""}`),t&&r.info(`[dry-run] Would consume ${s} (${String(o.length)} patterns) and surface as manual step.`))},"convertIgnoreFile"),x$=nt((e,t,r,n,s)=>{const o=y(e,"package.json");if(!k(o))return;const i=ge(o);if(!i)return;let a=!1;if(i.scripts){for(const[l,p]of Object.entries(i.scripts))if(typeof p=="string"&&/\bsecretlint\b/.test(p)){const f=p.replaceAll(/\bsecretlint\b[^\n&|;]*/g,"vis secrets").trim();f!==p&&(i.scripts[l]=f,a=!0,he(n,"secretlint","rewrittenScriptCount"),r.info(` scripts.${l}: "${p}" -> "${f}"`))}}if(i.devDependencies){const l=i.devDependencies,p=[];for(const f of Object.keys(l))(f==="secretlint"||f.startsWith("@secretlint/"))&&(delete l[f],p.push(f),a=!0,he(n,"secretlint","removedPackageCount"));p.length>0&&r.info(` removed ${String(p.length)} secretlint devDependencies: ${p.join(", ")}`)}if(!a)return;if(t){r.info(`[dry-run] Would update ${o}`);return}const c=He(o,P(o),{defaultIndent:" ",useEditorconfig:s});re(o,n),oe(o,`${JSON.stringify(i,null,c)}
195
+ `)},"rewriteScripts"),N$=nt((e,t,r,n)=>{const s=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"];for(const o of s){const i=y(e,o);if(!k(i))continue;const a=P(i);if(!/\bsecretlint\b/.test(a))continue;const c=a.replaceAll(/\bsecretlint\b[^\n&|;]*/g,"vis secrets --staged");if(t){r.info(`[dry-run] Would rewrite ${i}`);continue}re(i,n),oe(i,c),n.gitHooksConfigured=!0,r.info(`Rewrote secretlint invocation in ${o}`)}},"rewriteHooks"),$a=nt((e,t,r,n)=>{const s=Pp(e),o=Ap(e);if(!(s??o))return t.silent||r.info("No secretlint artifacts found — nothing to migrate."),!1;if(s){const i=E$(e,s,n);r.info(`Found ${s}`),i.length>0?(r.info(` active rules/presets: ${i.join(", ")}`),Q(n,`secretlint used these rules: ${i.join(", ")}. vis secrets ships the gitleaks ruleset (177 rules covering AWS/GCP/Azure/GitHub/Slack/Stripe and more). Verify parity before removing secretlint.`)):Q(n,`Rule IDs could not be auto-extracted from ${s}. Verify that the bundled gitleaks ruleset covers your secretlint rule set.`)}return C$(e,t.dryRun,r,n),x$(e,t.dryRun,r,n,t.useEditorconfig),N$(e,t.dryRun,r,n),R$(e,t.dryRun,r,n),!0},"migrateSecretlint");var I$=Object.defineProperty,Be=d((e,t)=>I$(e,"name",{value:t,configurable:!0}),"c$8");const rs="sherif",_n=/\bsherif\b/,mo={"empty-dependencies":"empty-deps","multiple-dependency-versions":"workspace-versions","non-existant-packages":"dead-workspace-patterns","packages-without-package-json":"missing-package-json","root-package-dependencies":"root-deps","root-package-manager-field":"root-package-manager","root-package-private-field":"root-private","types-in-dependencies":"types-in-deps","unordered-dependencies":void 0,"unsync-similar-dependencies":"similar-deps"},P$=Object.values(mo).filter(e=>e!==void 0),Tp=Be(e=>{const t=y(e,"package.json");return k(t)&&ge(t)?.sherif?"package.json":void 0},"detectSherifConfig"),Dp=Be(e=>{const t=y(e,"package.json");if(!k(t))return!1;const r=ge(t);if(!r)return!1;if(r.devDependencies?.sherif||r.dependencies?.sherif)return!0;if(r.scripts){for(const n of Object.values(r.scripts))if(typeof n=="string"&&_n.test(n))return!0}return!1},"detectSherifInstallation"),A$=Be(e=>ge(y(e,"package.json"))?.sherif,"extractSherifFromPackageJson"),Lp=Be((e,t)=>{const r={unmapped:[],visDisabled:[]};if(!Array.isArray(e["ignore-rules"]))return r;for(const n of e["ignore-rules"]){if(typeof n!="string"||n.length===0)continue;const s=mo[n];if(s===void 0){n==="unordered-dependencies"?J(t,"sherif rule `unordered-dependencies` has no `vis lint` equivalent — vis covers ordering via `vis sort-package-json` (separate command). No migration needed; skip running it if you don't want it."):Object.hasOwn(mo,n)?r.unmapped.push(n):J(t,`sherif rule \`${n}\` is unknown to vis migrate — skipped.`);continue}r.visDisabled.push(s)}return r},"translateIgnoreRules"),Bp=Be(e=>{const t=P$.filter(r=>!e.includes(r));return t.length===0?"vis lint":`vis lint ${t.map(r=>`--${r}`).join(" ")}`},"buildPositiveLintCommand"),T$=Be((e,t)=>{const r=y(e,"package.json"),n={configRemoved:!1,dependencyRemoved:!1,removedScripts:[],scriptCount:0};if(!k(r))return n;const s=P(r),o=JSON.parse(s);let i=!1;o.sherif&&(delete o.sherif,i=!0,n.configRemoved=!0);for(const c of["dependencies","devDependencies"]){const l=o[c];l?.sherif&&(delete l.sherif,i=!0,n.dependencyRemoved=!0)}const a=o.scripts;if(a){const c={};for(const[l,p]of Object.entries(a))typeof p=="string"&&_n.test(p)?(n.scriptCount+=1,n.removedScripts.push({name:l,value:p}),i=!0):c[l]=p;n.scriptCount>0&&(Object.keys(c).length===0?delete o.scripts:o.scripts=c)}if(i){const c=Gr(r,s,{useEditorconfig:t});re(r),ue(r,`${JSON.stringify(o,void 0,c)}
196
+ `,"utf8")}return n},"removeSherifFromPackageJson"),D$=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],L$=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],Mp=Be((e,t)=>{const r=[];for(const n of D$){const s=y(e,n);k(s)&&_n.test(P(s))&&(r.push(n),Q(t,`Update ${n} — replace \`sherif\` invocation with \`vis lint\`.`))}return r},"detectHookReferences"),Vp=Be((e,t)=>{const r=[],n=Be(s=>{const o=y(e,s);k(o)&&_n.test(P(o))&&(r.push(s),Q(t,`Update ${s} — replace \`sherif\` invocation with \`vis lint\`.`))},"scanFile");for(const s of L$){const o=y(e,s);if(k(o)){if(s===".github/workflows"){try{for(const i of Ge(o))(i.endsWith(".yml")||i.endsWith(".yaml"))&&n(`.github/workflows/${i}`)}catch{}continue}n(s)}}return r},"detectCiReferences"),B$=Be((e,t,r,n,s)=>{const o=Lp(t,s);if(o.visDisabled.length>0){const u=Bp(o.visDisabled);Q(s,`sherif's \`ignore-rules\` was set to [${o.visDisabled.map(m=>JSON.stringify(m)).join(", ")}] (vis names). vis has no global rule-disable; replace any \`sherif\` script with the explicit positive list: \`${u}\`.`)}o.unmapped.length>0&&J(s,`sherif rule(s) [${o.unmapped.map(u=>JSON.stringify(u)).join(", ")}] could not be mapped — please re-evaluate manually.`),Array.isArray(t["ignore-dependencies"])&&t["ignore-dependencies"].length>0&&Q(s,`sherif's \`ignore-dependencies\` was set to [${t["ignore-dependencies"].map(u=>JSON.stringify(u)).join(", ")}]. Mirror this in vis.config.ts under \`policy.workspaceVersions.ignore\`, \`policy.customTypes.ignore\`, \`policy.typesInDeps.ignore\` (and \`policy.redefineRoot.ignore\`) for the lints where it applies.`),Array.isArray(t["ignore-packages"])&&t["ignore-packages"].length>0&&(J(s,`sherif's \`ignore-packages\` was set to [${t["ignore-packages"].map(u=>JSON.stringify(u)).join(", ")}] — vis has no global package-skip yet (only per-rule scoping via policy.bannedDeps.{packages,paths}). Tracked alongside the dep filter work.`),Q(s,"Re-evaluate sherif `ignore-packages` — vis has no equivalent global filter yet.")),Array.isArray(t["ignore-paths"])&&t["ignore-paths"].length>0&&(J(s,`sherif's \`ignore-paths\` was set to [${t["ignore-paths"].map(u=>JSON.stringify(u)).join(", ")}] — vis has no global path-skip yet.`),Q(s,"Re-evaluate sherif `ignore-paths` — vis has no equivalent global filter yet."));const i=Mp(e,s);i.length>0&&!r.silent&&n.warn(`Found sherif reference in ${String(i.length)} hook file(s) — see manualSteps for details.`);const a=Vp(e,s);a.length>0&&!r.silent&&n.warn(`Found sherif reference in ${String(a.length)} CI file(s) — see manualSteps for details.`);const{configRemoved:c,dependencyRemoved:l,removedScripts:p,scriptCount:f}=T$(e,r.useEditorconfig);if(c&&!r.silent&&n.info("Removed `sherif` block from package.json"),c&&he(s,rs,"removedConfigCount"),l&&he(s,rs,"removedPackageCount"),f>0){he(s,rs,"rewrittenScriptCount",f);for(const{name:u,value:m}of p)Q(s,`Recreate script \`${u}\` (removed; was \`${m}\`). Replace \`sherif\` with \`vis lint\` (sherif's lint surface ≈ \`vis lint\`).`);r.silent||n.info(`Removed ${String(f)} script(s) referencing \`sherif\`. Replace with \`vis lint\`.`)}},"applyMigration"),wa=Be((e,t,r,n)=>{const s=Tp(e),o=Dp(e);if(!s&&!o)return t.silent||r.info("No sherif configuration or installation found — nothing to migrate."),!1;const i=A$(e)??{};if(t.dryRun){const a=Lp(i,n);if(Mp(e,n),Vp(e,n),!t.silent&&(s&&r.info("[dry-run] Would remove `sherif` block from package.json"),o&&r.info("[dry-run] Would strip `sherif` from devDependencies/scripts"),a.visDisabled.length>0)){const c=Bp(a.visDisabled);r.info(`[dry-run] Suggested replacement script: ${c}`)}return!0}return B$(e,i,t,r,n),!0},"migrateSherif");var M$=Object.defineProperty,Qt=d((e,t)=>M$(e,"name",{value:t,configurable:!0}),"t$b");function _p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}d(_p,"getDefaultExportFromCjs");Qt(_p,"getDefaultExportFromCjs");function V$(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}d(V$,"getDefaultExportFromNamespaceIfPresent");Qt(V$,"getDefaultExportFromNamespaceIfPresent");function _$(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}d(_$,"getDefaultExportFromNamespaceIfNotNamed");Qt(_$,"getDefaultExportFromNamespaceIfNotNamed");function F$(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=Qt(d(function n(){var s=!1;try{s=this instanceof n}catch{}return s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"a"),"a");r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:Qt(function(){return e[n]},"get")})}),r}d(F$,"getAugmentedNamespace");Qt(F$,"getAugmentedNamespace");var Zr={exports:{}},ns,Sa;function Fn(){return Sa||(Sa=1,ns={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}),ns}d(Fn,"requireConstants");var ss,ja;function qn(){return ja||(ja=1,ss=process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),ss}d(qn,"requireDebug");var Oa;function Jr(){return Oa||(Oa=1,(function(e,t){var r=Object.defineProperty,n=d(($,j)=>r($,"name",{value:j,configurable:!0}),"O");const{MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:i}=Fn(),a=qn();t=e.exports={};const c=t.re=[],l=t.safeRe=[],p=t.src=[],f=t.safeSrc=[],u=t.t={};let m=0;const h="[a-zA-Z0-9-]",g=[["\\s",1],["\\d",i],[h,o]],b=n($=>{for(const[j,x]of g)$=$.split(`${j}*`).join(`${j}{0,${x}}`).split(`${j}+`).join(`${j}{1,${x}}`);return $},"makeSafeRegex"),v=n(($,j,x)=>{const N=b(j),I=m++;a($,I,j),u[$]=I,p[I]=j,f[I]=N,c[I]=new RegExp(j,x?"g":void 0),l[I]=new RegExp(N,x?"g":void 0)},"createToken");v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),v("MAINVERSION",`(${p[u.NUMERICIDENTIFIER]})\\.(${p[u.NUMERICIDENTIFIER]})\\.(${p[u.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${p[u.NUMERICIDENTIFIERLOOSE]})\\.(${p[u.NUMERICIDENTIFIERLOOSE]})\\.(${p[u.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${p[u.NONNUMERICIDENTIFIER]}|${p[u.NUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${p[u.NONNUMERICIDENTIFIER]}|${p[u.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASE",`(?:-(${p[u.PRERELEASEIDENTIFIER]}(?:\\.${p[u.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${p[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[u.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${h}+`),v("BUILD",`(?:\\+(${p[u.BUILDIDENTIFIER]}(?:\\.${p[u.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${p[u.MAINVERSION]}${p[u.PRERELEASE]}?${p[u.BUILD]}?`),v("FULL",`^${p[u.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${p[u.MAINVERSIONLOOSE]}${p[u.PRERELEASELOOSE]}?${p[u.BUILD]}?`),v("LOOSE",`^${p[u.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${p[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${p[u.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${p[u.XRANGEIDENTIFIER]})(?:\\.(${p[u.XRANGEIDENTIFIER]})(?:\\.(${p[u.XRANGEIDENTIFIER]})(?:${p[u.PRERELEASE]})?${p[u.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${p[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[u.XRANGEIDENTIFIERLOOSE]})(?:${p[u.PRERELEASELOOSE]})?${p[u.BUILD]}?)?)?`),v("XRANGE",`^${p[u.GTLT]}\\s*${p[u.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${p[u.GTLT]}\\s*${p[u.XRANGEPLAINLOOSE]}$`),v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${s}})(?:\\.(\\d{1,${s}}))?(?:\\.(\\d{1,${s}}))?`),v("COERCE",`${p[u.COERCEPLAIN]}(?:$|[^\\d])`),v("COERCEFULL",p[u.COERCEPLAIN]+`(?:${p[u.PRERELEASE]})?(?:${p[u.BUILD]})?(?:$|[^\\d])`),v("COERCERTL",p[u.COERCE],!0),v("COERCERTLFULL",p[u.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${p[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",v("TILDE",`^${p[u.LONETILDE]}${p[u.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${p[u.LONETILDE]}${p[u.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${p[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",v("CARET",`^${p[u.LONECARET]}${p[u.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${p[u.LONECARET]}${p[u.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${p[u.GTLT]}\\s*(${p[u.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${p[u.GTLT]}\\s*(${p[u.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${p[u.GTLT]}\\s*(${p[u.LOOSEPLAIN]}|${p[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${p[u.XRANGEPLAIN]})\\s+-\\s+(${p[u.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${p[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[u.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Zr,Zr.exports)),Zr.exports}d(Jr,"requireRe");var os,Ea;function Ai(){if(Ea)return os;Ea=1;var e=Object.defineProperty,t=d((o,i)=>e(o,"name",{value:i,configurable:!0}),"t");const r=Object.freeze({loose:!0}),n=Object.freeze({});return os=t(o=>o?typeof o!="object"?r:o:n,"parseOptions"),os}d(Ai,"requireParseOptions");var is,Ra;function Fp(){if(Ra)return is;Ra=1;var e=Object.defineProperty,t=d((o,i)=>e(o,"name",{value:i,configurable:!0}),"s");const r=/^[0-9]+$/,n=t((o,i)=>{if(typeof o=="number"&&typeof i=="number")return o===i?0:o<i?-1:1;const a=r.test(o),c=r.test(i);return a&&c&&(o=+o,i=+i),o===i?0:a&&!c?-1:c&&!a?1:o<i?-1:1},"compareIdentifiers"),s=t((o,i)=>n(i,o),"rcompareIdentifiers");return is={compareIdentifiers:n,rcompareIdentifiers:s},is}d(Fp,"requireIdentifiers");var as,Ca;function ke(){if(Ca)return as;Ca=1;var e=Object.defineProperty,t=d((p,f)=>e(p,"name",{value:f,configurable:!0}),"a");const r=qn(),{MAX_LENGTH:n,MAX_SAFE_INTEGER:s}=Fn(),{safeRe:o,t:i}=Jr(),a=Ai(),{compareIdentifiers:c}=Fp();class l{static{d(this,"SemVer")}static{t(this,"SemVer")}constructor(f,u){if(u=a(u),f instanceof l){if(f.loose===!!u.loose&&f.includePrerelease===!!u.includePrerelease)return f;f=f.version}else if(typeof f!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof f}".`);if(f.length>n)throw new TypeError(`version is longer than ${n} characters`);r("SemVer",f,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const m=f.trim().match(u.loose?o[i.LOOSE]:o[i.FULL]);if(!m)throw new TypeError(`Invalid Version: ${f}`);if(this.raw=f,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(h=>{if(/^[0-9]+$/.test(h)){const g=+h;if(g>=0&&g<s)return g}return h}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(f){if(r("SemVer.compare",this.version,this.options,f),!(f instanceof l)){if(typeof f=="string"&&f===this.version)return 0;f=new l(f,this.options)}return f.version===this.version?0:this.compareMain(f)||this.comparePre(f)}compareMain(f){return f instanceof l||(f=new l(f,this.options)),this.major<f.major?-1:this.major>f.major?1:this.minor<f.minor?-1:this.minor>f.minor?1:this.patch<f.patch?-1:this.patch>f.patch?1:0}comparePre(f){if(f instanceof l||(f=new l(f,this.options)),this.prerelease.length&&!f.prerelease.length)return-1;if(!this.prerelease.length&&f.prerelease.length)return 1;if(!this.prerelease.length&&!f.prerelease.length)return 0;let u=0;do{const m=this.prerelease[u],h=f.prerelease[u];if(r("prerelease compare",u,m,h),m===void 0&&h===void 0)return 0;if(h===void 0)return 1;if(m===void 0)return-1;if(m!==h)return c(m,h)}while(++u)}compareBuild(f){f instanceof l||(f=new l(f,this.options));let u=0;do{const m=this.build[u],h=f.build[u];if(r("build compare",u,m,h),m===void 0&&h===void 0)return 0;if(h===void 0)return 1;if(m===void 0)return-1;if(m!==h)return c(m,h)}while(++u)}inc(f,u,m){if(f.startsWith("pre")){if(!u&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(u){const h=`-${u}`.match(this.options.loose?o[i.PRERELEASELOOSE]:o[i.PRERELEASE]);if(!h||h[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(f){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,m),this.inc("pre",u,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,m),this.inc("pre",u,m);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const h=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[h];else{let g=this.prerelease.length;for(;--g>=0;)typeof this.prerelease[g]=="number"&&(this.prerelease[g]++,g=-2);if(g===-1){if(u===this.prerelease.join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(h)}}if(u){let g=[u,h];m===!1&&(g=[u]),c(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=g):this.prerelease=g}break}default:throw new Error(`invalid increment argument: ${f}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return as=l,as}d(ke,"requireSemver$1");var cs,xa;function lr(){if(xa)return cs;xa=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"t");const r=ke();return cs=t((s,o,i=!1)=>{if(s instanceof r)return s;try{return new r(s,o)}catch(a){if(!i)return null;throw a}},"parse"),cs}d(lr,"requireParse");var ls,Na;function q$(){if(Na)return ls;Na=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"t");const r=lr();return ls=t((s,o)=>{const i=r(s,o);return i?i.version:null},"valid"),ls}d(q$,"requireValid$1");var ps,Ia;function U$(){if(Ia)return ps;Ia=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"t");const r=lr();return ps=t((s,o)=>{const i=r(s.trim().replace(/^[=v]+/,""),o);return i?i.version:null},"clean"),ps}d(U$,"requireClean");var us,Pa;function W$(){if(Pa)return us;Pa=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"u");const r=ke();return us=t((s,o,i,a,c)=>{typeof i=="string"&&(c=a,a=i,i=void 0);try{return new r(s instanceof r?s.version:s,i).inc(o,a,c).version}catch{return null}},"inc"),us}d(W$,"requireInc");var ds,Aa;function G$(){if(Aa)return ds;Aa=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"u");const r=lr();return ds=t((s,o)=>{const i=r(s,null,!0),a=r(o,null,!0),c=i.compare(a);if(c===0)return null;const l=c>0,p=l?i:a,f=l?a:i,u=!!p.prerelease.length;if(f.prerelease.length&&!u){if(!f.patch&&!f.minor)return"major";if(f.compareMain(p)===0)return f.minor&&!f.patch?"minor":"patch"}const m=u?"pre":"";return i.major!==a.major?m+"major":i.minor!==a.minor?m+"minor":i.patch!==a.patch?m+"patch":"prerelease"},"diff"),ds}d(G$,"requireDiff");var fs,Ta;function J$(){if(Ta)return fs;Ta=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"r");const r=ke();return fs=t((s,o)=>new r(s,o).major,"major"),fs}d(J$,"requireMajor");var ms,Da;function K$(){if(Da)return ms;Da=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"r");const r=ke();return ms=t((s,o)=>new r(s,o).minor,"minor"),ms}d(K$,"requireMinor");var gs,La;function z$(){if(La)return gs;La=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"t");const r=ke();return gs=t((s,o)=>new r(s,o).patch,"patch"),gs}d(z$,"requirePatch");var hs,Ba;function H$(){if(Ba)return hs;Ba=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"t");const r=lr();return hs=t((s,o)=>{const i=r(s,o);return i&&i.prerelease.length?i.prerelease:null},"prerelease"),hs}d(H$,"requirePrerelease");var ys,Ma;function _e(){if(Ma)return ys;Ma=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"c");const r=ke();return ys=t((s,o,i)=>new r(s,i).compare(new r(o,i)),"compare"),ys}d(_e,"requireCompare");var vs,Va;function Y$(){if(Va)return vs;Va=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"o");const r=_e();return vs=t((s,o,i)=>r(o,s,i),"rcompare"),vs}d(Y$,"requireRcompare");var bs,_a;function X$(){if(_a)return bs;_a=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"r");const r=_e();return bs=t((s,o)=>r(s,o,!0),"compareLoose"),bs}d(X$,"requireCompareLoose");var ks,Fa;function Ti(){if(Fa)return ks;Fa=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"o");const r=ke();return ks=t((s,o,i)=>{const a=new r(s,i),c=new r(o,i);return a.compare(c)||a.compareBuild(c)},"compareBuild"),ks}d(Ti,"requireCompareBuild");var $s,qa;function Q$(){if(qa)return $s;qa=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"e");const r=Ti();return $s=t((s,o)=>s.sort((i,a)=>r(i,a,o)),"sort"),$s}d(Q$,"requireSort");var ws,Ua;function Z$(){if(Ua)return ws;Ua=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"e");const r=Ti();return ws=t((s,o)=>s.sort((i,a)=>r(a,i,o)),"rsort"),ws}d(Z$,"requireRsort");var Ss,Wa;function Un(){if(Wa)return Ss;Wa=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"r");const r=_e();return Ss=t((s,o,i)=>r(s,o,i)>0,"gt"),Ss}d(Un,"requireGt");var js,Ga;function Di(){if(Ga)return js;Ga=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"r");const r=_e();return js=t((s,o,i)=>r(s,o,i)<0,"lt"),js}d(Di,"requireLt");var Os,Ja;function qp(){if(Ja)return Os;Ja=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"r");const r=_e();return Os=t((s,o,i)=>r(s,o,i)===0,"eq"),Os}d(qp,"requireEq");var Es,Ka;function Up(){if(Ka)return Es;Ka=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"r");const r=_e();return Es=t((s,o,i)=>r(s,o,i)!==0,"neq"),Es}d(Up,"requireNeq");var Rs,za;function Li(){if(za)return Rs;za=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"r");const r=_e();return Rs=t((s,o,i)=>r(s,o,i)>=0,"gte"),Rs}d(Li,"requireGte");var Cs,Ha;function Bi(){if(Ha)return Cs;Ha=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"r");const r=_e();return Cs=t((s,o,i)=>r(s,o,i)<=0,"lte"),Cs}d(Bi,"requireLte");var xs,Ya;function Wp(){if(Ya)return xs;Ya=1;var e=Object.defineProperty,t=d((l,p)=>e(l,"name",{value:p,configurable:!0}),"n");const r=qp(),n=Up(),s=Un(),o=Li(),i=Di(),a=Bi();return xs=t((l,p,f,u)=>{switch(p){case"===":return typeof l=="object"&&(l=l.version),typeof f=="object"&&(f=f.version),l===f;case"!==":return typeof l=="object"&&(l=l.version),typeof f=="object"&&(f=f.version),l!==f;case"":case"=":case"==":return r(l,f,u);case"!=":return n(l,f,u);case">":return s(l,f,u);case">=":return o(l,f,u);case"<":return i(l,f,u);case"<=":return a(l,f,u);default:throw new TypeError(`Invalid operator: ${p}`)}},"cmp"),xs}d(Wp,"requireCmp");var Ns,Xa;function ew(){if(Xa)return Ns;Xa=1;var e=Object.defineProperty,t=d((a,c)=>e(a,"name",{value:c,configurable:!0}),"u");const r=ke(),n=lr(),{safeRe:s,t:o}=Jr();return Ns=t((a,c)=>{if(a instanceof r)return a;if(typeof a=="number"&&(a=String(a)),typeof a!="string")return null;c=c||{};let l=null;if(!c.rtl)l=a.match(c.includePrerelease?s[o.COERCEFULL]:s[o.COERCE]);else{const g=c.includePrerelease?s[o.COERCERTLFULL]:s[o.COERCERTL];let b;for(;(b=g.exec(a))&&(!l||l.index+l[0].length!==a.length);)(!l||b.index+b[0].length!==l.index+l[0].length)&&(l=b),g.lastIndex=b.index+b[1].length+b[2].length;g.lastIndex=-1}if(l===null)return null;const p=l[2],f=l[3]||"0",u=l[4]||"0",m=c.includePrerelease&&l[5]?`-${l[5]}`:"",h=c.includePrerelease&&l[6]?`+${l[6]}`:"";return n(`${p}.${f}.${u}${m}${h}`,c)},"coerce"),Ns}d(ew,"requireCoerce");var Is,Qa;function tw(){if(Qa)return Is;Qa=1;var e=Object.defineProperty,t=d((n,s)=>e(n,"name",{value:s,configurable:!0}),"i");class r{static{d(this,"LRUCache")}static{t(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(s){const o=this.map.get(s);if(o!==void 0)return this.map.delete(s),this.map.set(s,o),o}delete(s){return this.map.delete(s)}set(s,o){if(!this.delete(s)&&o!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(s,o)}return this}}return Is=r,Is}d(tw,"requireLrucache");var Ps,Za;function Fe(){if(Za)return Ps;Za=1;var e=Object.defineProperty,t=d((S,O)=>e(S,"name",{value:O,configurable:!0}),"o");const r=/\s+/g;class n{static{d(this,"Range")}static{t(this,"Range")}constructor(O,B){if(B=i(B),O instanceof n)return O.loose===!!B.loose&&O.includePrerelease===!!B.includePrerelease?O:new n(O.raw,B);if(O instanceof a)return this.raw=O.value,this.set=[[O]],this.formatted=void 0,this;if(this.options=B,this.loose=!!B.loose,this.includePrerelease=!!B.includePrerelease,this.raw=O.trim().replace(r," "),this.set=this.raw.split("||").map(T=>this.parseRange(T.trim())).filter(T=>T.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const T=this.set[0];if(this.set=this.set.filter(V=>!v(V[0])),this.set.length===0)this.set=[T];else if(this.set.length>1){for(const V of this.set)if(V.length===1&&$(V[0])){this.set=[V];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let O=0;O<this.set.length;O++){O>0&&(this.formatted+="||");const B=this.set[O];for(let T=0;T<B.length;T++)T>0&&(this.formatted+=" "),this.formatted+=B[T].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(O){const B=((this.options.includePrerelease&&g)|(this.options.loose&&b))+":"+O,T=o.get(B);if(T)return T;const V=this.options.loose,D=V?p[f.HYPHENRANGELOOSE]:p[f.HYPHENRANGE];O=O.replace(D,dr(this.options.includePrerelease)),c("hyphen replace",O),O=O.replace(p[f.COMPARATORTRIM],u),c("comparator trim",O),O=O.replace(p[f.TILDETRIM],m),c("tilde trim",O),O=O.replace(p[f.CARETTRIM],h),c("caret trim",O);let F=O.split(" ").map(se=>x(se,this.options)).join(" ").split(/\s+/).map(se=>Xe(se,this.options));V&&(F=F.filter(se=>(c("loose invalid filter",se,this.options),!!se.match(p[f.COMPARATORLOOSE])))),c("range list",F);const Z=new Map,H=F.map(se=>new a(se,this.options));for(const se of H){if(v(se))return[se];Z.set(se.value,se)}Z.size>1&&Z.has("")&&Z.delete("");const ne=[...Z.values()];return o.set(B,ne),ne}intersects(O,B){if(!(O instanceof n))throw new TypeError("a Range is required");return this.set.some(T=>j(T,B)&&O.set.some(V=>j(V,B)&&T.every(D=>V.every(F=>D.intersects(F,B)))))}test(O){if(!O)return!1;if(typeof O=="string")try{O=new l(O,this.options)}catch{return!1}for(let B=0;B<this.set.length;B++)if(z(this.set[B],O,this.options))return!0;return!1}}Ps=n;const s=tw(),o=new s,i=Ai(),a=Wn(),c=qn(),l=ke(),{safeRe:p,t:f,comparatorTrimReplace:u,tildeTrimReplace:m,caretTrimReplace:h}=Jr(),{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:b}=Fn(),v=t(S=>S.value==="<0.0.0-0","isNullSet"),$=t(S=>S.value==="","isAny"),j=t((S,O)=>{let B=!0;const T=S.slice();let V=T.pop();for(;B&&T.length;)B=T.every(D=>V.intersects(D,O)),V=T.pop();return B},"isSatisfiable"),x=t((S,O)=>(S=S.replace(p[f.BUILD],""),c("comp",S,O),S=w(S,O),c("caret",S),S=I(S,O),c("tildes",S),S=L(S,O),c("xrange",S),S=ee(S,O),c("stars",S),S),"parseComparator"),N=t(S=>!S||S.toLowerCase()==="x"||S==="*","isX"),I=t((S,O)=>S.trim().split(/\s+/).map(B=>_(B,O)).join(" "),"replaceTildes"),_=t((S,O)=>{const B=O.loose?p[f.TILDELOOSE]:p[f.TILDE];return S.replace(B,(T,V,D,F,Z)=>{c("tilde",S,T,V,D,F,Z);let H;return N(V)?H="":N(D)?H=`>=${V}.0.0 <${+V+1}.0.0-0`:N(F)?H=`>=${V}.${D}.0 <${V}.${+D+1}.0-0`:Z?(c("replaceTilde pr",Z),H=`>=${V}.${D}.${F}-${Z} <${V}.${+D+1}.0-0`):H=`>=${V}.${D}.${F} <${V}.${+D+1}.0-0`,c("tilde return",H),H})},"replaceTilde"),w=t((S,O)=>S.trim().split(/\s+/).map(B=>M(B,O)).join(" "),"replaceCarets"),M=t((S,O)=>{c("caret",S,O);const B=O.loose?p[f.CARETLOOSE]:p[f.CARET],T=O.includePrerelease?"-0":"";return S.replace(B,(V,D,F,Z,H)=>{c("caret",S,V,D,F,Z,H);let ne;return N(D)?ne="":N(F)?ne=`>=${D}.0.0${T} <${+D+1}.0.0-0`:N(Z)?D==="0"?ne=`>=${D}.${F}.0${T} <${D}.${+F+1}.0-0`:ne=`>=${D}.${F}.0${T} <${+D+1}.0.0-0`:H?(c("replaceCaret pr",H),D==="0"?F==="0"?ne=`>=${D}.${F}.${Z}-${H} <${D}.${F}.${+Z+1}-0`:ne=`>=${D}.${F}.${Z}-${H} <${D}.${+F+1}.0-0`:ne=`>=${D}.${F}.${Z}-${H} <${+D+1}.0.0-0`):(c("no pr"),D==="0"?F==="0"?ne=`>=${D}.${F}.${Z}${T} <${D}.${F}.${+Z+1}-0`:ne=`>=${D}.${F}.${Z}${T} <${D}.${+F+1}.0-0`:ne=`>=${D}.${F}.${Z} <${+D+1}.0.0-0`),c("caret return",ne),ne})},"replaceCaret"),L=t((S,O)=>(c("replaceXRanges",S,O),S.split(/\s+/).map(B=>be(B,O)).join(" ")),"replaceXRanges"),be=t((S,O)=>{S=S.trim();const B=O.loose?p[f.XRANGELOOSE]:p[f.XRANGE];return S.replace(B,(T,V,D,F,Z,H)=>{c("xRange",S,T,V,D,F,Z,H);const ne=N(D),se=ne||N(F),Vt=se||N(Z),fr=Vt;return V==="="&&fr&&(V=""),H=O.includePrerelease?"-0":"",ne?V===">"||V==="<"?T="<0.0.0-0":T="*":V&&fr?(se&&(F=0),Z=0,V===">"?(V=">=",se?(D=+D+1,F=0,Z=0):(F=+F+1,Z=0)):V==="<="&&(V="<",se?D=+D+1:F=+F+1),V==="<"&&(H="-0"),T=`${V+D}.${F}.${Z}${H}`):se?T=`>=${D}.0.0${H} <${+D+1}.0.0-0`:Vt&&(T=`>=${D}.${F}.0${H} <${D}.${+F+1}.0-0`),c("xRange return",T),T})},"replaceXRange"),ee=t((S,O)=>(c("replaceStars",S,O),S.trim().replace(p[f.STAR],"")),"replaceStars"),Xe=t((S,O)=>(c("replaceGTE0",S,O),S.trim().replace(p[O.includePrerelease?f.GTE0PRE:f.GTE0],"")),"replaceGTE0"),dr=t(S=>(O,B,T,V,D,F,Z,H,ne,se,Vt,fr)=>(N(T)?B="":N(V)?B=`>=${T}.0.0${S?"-0":""}`:N(D)?B=`>=${T}.${V}.0${S?"-0":""}`:F?B=`>=${B}`:B=`>=${B}${S?"-0":""}`,N(ne)?H="":N(se)?H=`<${+ne+1}.0.0-0`:N(Vt)?H=`<${ne}.${+se+1}.0-0`:fr?H=`<=${ne}.${se}.${Vt}-${fr}`:S?H=`<${ne}.${se}.${+Vt+1}-0`:H=`<=${H}`,`${B} ${H}`.trim()),"hyphenReplace"),z=t((S,O,B)=>{for(let T=0;T<S.length;T++)if(!S[T].test(O))return!1;if(O.prerelease.length&&!B.includePrerelease){for(let T=0;T<S.length;T++)if(c(S[T].semver),S[T].semver!==a.ANY&&S[T].semver.prerelease.length>0){const V=S[T].semver;if(V.major===O.major&&V.minor===O.minor&&V.patch===O.patch)return!0}return!1}return!0},"testSet");return Ps}d(Fe,"requireRange");var As,ec;function Wn(){if(ec)return As;ec=1;var e=Object.defineProperty,t=d((f,u)=>e(f,"name",{value:u,configurable:!0}),"i");const r=Symbol("SemVer ANY");class n{static{d(this,"Comparator")}static{t(this,"Comparator")}static get ANY(){return r}constructor(u,m){if(m=s(m),u instanceof n){if(u.loose===!!m.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),c("comparator",u,m),this.options=m,this.loose=!!m.loose,this.parse(u),this.semver===r?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(u){const m=this.options.loose?o[i.COMPARATORLOOSE]:o[i.COMPARATOR],h=u.match(m);if(!h)throw new TypeError(`Invalid comparator: ${u}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new l(h[2],this.options.loose):this.semver=r}toString(){return this.value}test(u){if(c("Comparator.test",u,this.options.loose),this.semver===r||u===r)return!0;if(typeof u=="string")try{u=new l(u,this.options)}catch{return!1}return a(u,this.operator,this.semver,this.options)}intersects(u,m){if(!(u instanceof n))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new p(u.value,m).test(this.value):u.operator===""?u.value===""?!0:new p(this.value,m).test(u.semver):(m=s(m),m.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||a(this.semver,"<",u.semver,m)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||a(this.semver,">",u.semver,m)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}As=n;const s=Ai(),{safeRe:o,t:i}=Jr(),a=Wp(),c=qn(),l=ke(),p=Fe();return As}d(Wn,"requireComparator");var Ts,tc;function Gn(){if(tc)return Ts;tc=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"t");const r=Fe();return Ts=t((s,o,i)=>{try{o=new r(o,i)}catch{return!1}return o.test(s)},"satisfies"),Ts}d(Gn,"requireSatisfies");var Ds,rc;function rw(){if(rc)return Ds;rc=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"t");const r=Fe();return Ds=t((s,o)=>new r(s,o).set.map(i=>i.map(a=>a.value).join(" ").trim().split(" ")),"toComparators"),Ds}d(rw,"requireToComparators");var Ls,nc;function nw(){if(nc)return Ls;nc=1;var e=Object.defineProperty,t=d((o,i)=>e(o,"name",{value:i,configurable:!0}),"c");const r=ke(),n=Fe();return Ls=t((o,i,a)=>{let c=null,l=null,p=null;try{p=new n(i,a)}catch{return null}return o.forEach(f=>{p.test(f)&&(!c||l.compare(f)===-1)&&(c=f,l=new r(c,a))}),c},"maxSatisfying"),Ls}d(nw,"requireMaxSatisfying");var Bs,sc;function sw(){if(sc)return Bs;sc=1;var e=Object.defineProperty,t=d((o,i)=>e(o,"name",{value:i,configurable:!0}),"u");const r=ke(),n=Fe();return Bs=t((o,i,a)=>{let c=null,l=null,p=null;try{p=new n(i,a)}catch{return null}return o.forEach(f=>{p.test(f)&&(!c||l.compare(f)===1)&&(c=f,l=new r(c,a))}),c},"minSatisfying"),Bs}d(sw,"requireMinSatisfying");var Ms,oc;function ow(){if(oc)return Ms;oc=1;var e=Object.defineProperty,t=d((i,a)=>e(i,"name",{value:a,configurable:!0}),"i");const r=ke(),n=Fe(),s=Un();return Ms=t((i,a)=>{i=new n(i,a);let c=new r("0.0.0");if(i.test(c)||(c=new r("0.0.0-0"),i.test(c)))return c;c=null;for(let l=0;l<i.set.length;++l){const p=i.set[l];let f=null;p.forEach(u=>{const m=new r(u.semver.version);switch(u.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!f||s(m,f))&&(f=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${u.operator}`)}}),f&&(!c||s(c,f))&&(c=f)}return c&&i.test(c)?c:null},"minVersion"),Ms}d(ow,"requireMinVersion");var Vs,ic;function iw(){if(ic)return Vs;ic=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"n");const r=Fe();return Vs=t((s,o)=>{try{return new r(s,o).range||"*"}catch{return null}},"validRange"),Vs}d(iw,"requireValid");var _s,ac;function Mi(){if(ac)return _s;ac=1;var e=Object.defineProperty,t=d((u,m)=>e(u,"name",{value:m,configurable:!0}),"m");const r=ke(),n=Wn(),{ANY:s}=n,o=Fe(),i=Gn(),a=Un(),c=Di(),l=Bi(),p=Li();return _s=t((u,m,h,g)=>{u=new r(u,g),m=new o(m,g);let b,v,$,j,x;switch(h){case">":b=a,v=l,$=c,j=">",x=">=";break;case"<":b=c,v=p,$=a,j="<",x="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(u,m,g))return!1;for(let N=0;N<m.set.length;++N){const I=m.set[N];let _=null,w=null;if(I.forEach(M=>{M.semver===s&&(M=new n(">=0.0.0")),_=_||M,w=w||M,b(M.semver,_.semver,g)?_=M:$(M.semver,w.semver,g)&&(w=M)}),_.operator===j||_.operator===x||(!w.operator||w.operator===j)&&v(u,w.semver)||w.operator===x&&$(u,w.semver))return!1}return!0},"outside"),_s}d(Mi,"requireOutside");var Fs,cc;function aw(){if(cc)return Fs;cc=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"s");const r=Mi();return Fs=t((s,o,i)=>r(s,o,">",i),"gtr"),Fs}d(aw,"requireGtr");var qs,lc;function cw(){if(lc)return qs;lc=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"s");const r=Mi();return qs=t((s,o,i)=>r(s,o,"<",i),"ltr"),qs}d(cw,"requireLtr");var Us,pc;function lw(){if(pc)return Us;pc=1;var e=Object.defineProperty,t=d((s,o)=>e(s,"name",{value:o,configurable:!0}),"n");const r=Fe();return Us=t((s,o,i)=>(s=new r(s,i),o=new r(o,i),s.intersects(o,i)),"intersects"),Us}d(lw,"requireIntersects");var Ws,uc;function pw(){if(uc)return Ws;uc=1;const e=Gn(),t=_e();return Ws=d((r,n,s)=>{const o=[];let i=null,a=null;const c=r.sort((u,m)=>t(u,m,s));for(const u of c)e(u,n,s)?(a=u,i||(i=u)):(a&&o.push([i,a]),a=null,i=null);i&&o.push([i,null]);const l=[];for(const[u,m]of o)u===m?l.push(u):!m&&u===c[0]?l.push("*"):m?u===c[0]?l.push(`<=${m}`):l.push(`${u} - ${m}`):l.push(`>=${u}`);const p=l.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return p.length<f.length?p:n},"simplify"),Ws}d(pw,"requireSimplify");var Gs,dc;function uw(){if(dc)return Gs;dc=1;var e=Object.defineProperty,t=d((m,h)=>e(m,"name",{value:h,configurable:!0}),"u");const r=Fe(),n=Wn(),{ANY:s}=n,o=Gn(),i=_e(),a=t((m,h,g={})=>{if(m===h)return!0;m=new r(m,g),h=new r(h,g);let b=!1;e:for(const v of m.set){for(const $ of h.set){const j=p(v,$,g);if(b=b||j!==null,j)continue e}if(b)return!1}return!0},"subset"),c=[new n(">=0.0.0-0")],l=[new n(">=0.0.0")],p=t((m,h,g)=>{if(m===h)return!0;if(m.length===1&&m[0].semver===s){if(h.length===1&&h[0].semver===s)return!0;g.includePrerelease?m=c:m=l}if(h.length===1&&h[0].semver===s){if(g.includePrerelease)return!0;h=l}const b=new Set;let v,$;for(const L of m)L.operator===">"||L.operator===">="?v=f(v,L,g):L.operator==="<"||L.operator==="<="?$=u($,L,g):b.add(L.semver);if(b.size>1)return null;let j;if(v&&$&&(j=i(v.semver,$.semver,g),j>0||j===0&&(v.operator!==">="||$.operator!=="<=")))return null;for(const L of b){if(v&&!o(L,String(v),g)||$&&!o(L,String($),g))return null;for(const be of h)if(!o(L,String(be),g))return!1;return!0}let x,N,I,_,w=$&&!g.includePrerelease&&$.semver.prerelease.length?$.semver:!1,M=v&&!g.includePrerelease&&v.semver.prerelease.length?v.semver:!1;w&&w.prerelease.length===1&&$.operator==="<"&&w.prerelease[0]===0&&(w=!1);for(const L of h){if(_=_||L.operator===">"||L.operator===">=",I=I||L.operator==="<"||L.operator==="<=",v){if(M&&L.semver.prerelease&&L.semver.prerelease.length&&L.semver.major===M.major&&L.semver.minor===M.minor&&L.semver.patch===M.patch&&(M=!1),L.operator===">"||L.operator===">="){if(x=f(v,L,g),x===L&&x!==v)return!1}else if(v.operator===">="&&!o(v.semver,String(L),g))return!1}if($){if(w&&L.semver.prerelease&&L.semver.prerelease.length&&L.semver.major===w.major&&L.semver.minor===w.minor&&L.semver.patch===w.patch&&(w=!1),L.operator==="<"||L.operator==="<="){if(N=u($,L,g),N===L&&N!==$)return!1}else if($.operator==="<="&&!o($.semver,String(L),g))return!1}if(!L.operator&&($||v)&&j!==0)return!1}return!(v&&I&&!$&&j!==0||$&&_&&!v&&j!==0||M||w)},"simpleSubset"),f=t((m,h,g)=>{if(!m)return h;const b=i(m.semver,h.semver,g);return b>0?m:b<0||h.operator===">"&&m.operator===">="?h:m},"higherGT"),u=t((m,h,g)=>{if(!m)return h;const b=i(m.semver,h.semver,g);return b<0?m:b>0||h.operator==="<"&&m.operator==="<="?h:m},"lowerLT");return Gs=a,Gs}d(uw,"requireSubset");var Js,fc;function dw(){if(fc)return Js;fc=1;const e=Jr(),t=Fn(),r=ke(),n=Fp(),s=lr(),o=q$(),i=U$(),a=W$(),c=G$(),l=J$(),p=K$(),f=z$(),u=H$(),m=_e(),h=Y$(),g=X$(),b=Ti(),v=Q$(),$=Z$(),j=Un(),x=Di(),N=qp(),I=Up(),_=Li(),w=Bi(),M=Wp(),L=ew(),be=Wn(),ee=Fe(),Xe=Gn(),dr=rw(),z=nw(),S=sw(),O=ow(),B=iw(),T=Mi(),V=aw(),D=cw(),F=lw(),Z=pw(),H=uw();return Js={parse:s,valid:o,clean:i,inc:a,diff:c,major:l,minor:p,patch:f,prerelease:u,compare:m,rcompare:h,compareLoose:g,compareBuild:b,sort:v,rsort:$,gt:j,lt:x,eq:N,neq:I,gte:_,lte:w,cmp:M,coerce:L,Comparator:be,Range:ee,satisfies:Xe,toComparators:dr,maxSatisfying:z,minSatisfying:S,minVersion:O,validRange:B,outside:T,gtr:V,ltr:D,intersects:F,simplifyRange:Z,subset:H,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Js}d(dw,"requireSemver");var st=dw();const JE=_p(st);var fw=Object.defineProperty,me=d((e,t)=>fw(e,"name",{value:t,configurable:!0}),"o$b");const mw="https://api.socket.dev/v0/purl?alerts=true",Kr=me(()=>y(Zt(),".vis","cache","socket-security"),"getCacheDirectory"),gw=3600*1e3,go=.4,mc=100,hw=me(e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"name"in e&&"version"in e&&"alerts"in e&&"score"in e&&e.type==="npm","isPackageReportData"),yw=me(()=>{rt(Kr())},"ensureCacheDirectory"),Gp=me((e,t)=>`${encodeURIComponent(e)}@${encodeURIComponent(t)}`,"buildCacheKey"),vw=me((e,t)=>{const r=Gp(e,t),n=y(Kr(),`${r}.json`);try{const s=le(n);if(Date.now()-s.createdAt>s.ttlMs){jo(n,{force:!0});return}return s.report}catch{return}},"getCachedReport"),bw=me((e,t,r,n)=>{const s=Gp(e,t),o={createdAt:Date.now(),report:r,ttlMs:n};ue(y(Kr(),`${s}.json`),JSON.stringify(o),"utf8")},"setCachedReport"),kw=me(e=>{const t=[e.license,e.maintenance,e.quality,e.supplyChain,e.vulnerability];return Number((t.reduce((r,n)=>r+n,0)/t.length).toFixed(2))},"calculateOverallScore"),Jp=me(async(e,t={})=>{const{apiToken:r,cacheTtlMs:n=gw,timeoutMs:s=15e3}=t,o=new Map;if(e.length===0||!r)return o;const i=[];for(const l of e){const p=vw(l.name,l.version);p?o.set(`${l.name}@${l.version}`,p):i.push(l)}if(i.length===0)return o;const a=`Basic ${Buffer.from(`${r}:`).toString("base64")}`;yw();const c=[];for(let l=0;l<i.length;l+=mc)c.push(i.slice(l,l+mc));for(const l of c){const p=l.map(m=>({purl:`pkg:npm/${m.name}@${m.version}`})),f=new AbortController,u=setTimeout(()=>{f.abort()},s);try{const m=await fetch(mw,{body:JSON.stringify({components:p}),headers:{Authorization:a,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:f.signal});if(!m.ok)continue;const h=await m.text();$w(h,l,o,n)}catch{}finally{clearTimeout(u)}}return o},"fetchSocketReports"),$w=me((e,t,r,n)=>{const s=new Map;for(const i of t)s.set(`${i.name}@${i.version}`,i);const o=e.split(`}
197
+ `);for(const i of o){const a=i.trim();if(a)try{const c=JSON.parse(a.endsWith("}")?a:`${a}}`),l=`${c.namespace?`${c.namespace}/`:""}${c.name}`,p=`${l}@${c.version}`;if(!s.has(p))continue;const f=c.score.overall??kw(c.score),u={alerts:c.alerts,author:c.author,id:c.id,license:c.license,name:c.name,score:{...c.score,overall:f},size:c.size,type:"npm",version:c.version};c.namespace&&(u.namespace=c.namespace),hw(u)&&(r.set(p,u),bw(l,c.version,u,n))}catch{}}},"parseNdjsonResponse"),Kp=me(e=>e.namespace?`${e.namespace}/${e.name}`:e.name,"getFullPackageName"),ww=me(e=>e>=.8?"excellent":e>=.6?"good":e>=.4?"fair":e>=.2?"poor":"critical","scoreLabel"),KE=me(e=>e>=.6?"green":e>=.4?"yellow":"red","scoreColor"),zE=me(e=>{const t=Kp(e),r=`score: ${String(Math.round(e.score.overall*100))}%`,n=e.alerts.length,s=n>0?`${String(n)} alert${n===1?"":"s"}`:"no alerts";return`${t}@${e.version} (${r}, ${s})`},"formatReportSummary");me(e=>{const t=[`${Kp(e)}@${e.version}`,` License: ${e.license||"unknown"}`,` Overall Score: ${String(Math.round(e.score.overall*100))}% (${ww(e.score.overall)})`,` Supply Chain: ${String(Math.round(e.score.supplyChain*100))}%`,` Quality: ${String(Math.round(e.score.quality*100))}%`,` Maintenance: ${String(Math.round(e.score.maintenance*100))}%`,` Vulnerability: ${String(Math.round(e.score.vulnerability*100))}%`,` License: ${String(Math.round(e.score.license*100))}%`];if(e.alerts.length>0){t.push(` Alerts (${String(e.alerts.length)}):`);for(const r of e.alerts){const n=r.props?.cveId?` (${r.props.cveId})`:"";t.push(` [${r.severity.toUpperCase()}] ${r.type}${n} — ${r.category}`)}}return t.join(`
198
+ `)},"formatReportDetailed");const Sw=me(e=>{if(e.size===0)return"";let t=0,r=0,n=0,s=0,o=0,i=0;for(const c of e.values()){for(const l of c.alerts)switch(t++,l.severity){case"critical":{r++;break}case"high":{n++;break}case"medium":{s++;break}default:o++}c.score.overall<go&&i++}const a=[`Socket.dev: scanned ${String(e.size)} package${e.size===1?"":"s"}`];if(t>0){const c=[];r>0&&c.push(`${String(r)} critical`),n>0&&c.push(`${String(n)} high`),s>0&&c.push(`${String(s)} medium`),o>0&&c.push(`${String(o)} low`),a.push(` Alerts: ${String(t)} total (${c.join(", ")})`)}else a.push(" No security alerts found.");return i>0&&a.push(` ${String(i)} package${i===1?"":"s"} with low security score (<40%)`),a.join(`
199
+ `)},"formatSecurityOverview"),HE=me(()=>{const e=Kr();if(!k(e))return 0;const t=Ge(e).filter(r=>r.endsWith(".json"));for(const r of t)jo(y(e,r),{force:!0});return t.length},"clearSocketCache"),YE=me(()=>{const e=Kr();if(!k(e))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const t=Ge(e).filter(o=>o.endsWith(".json"));let r=0,n,s;for(const o of t){const i=Kt(y(e,o));r+=i.size;const{mtimeMs:a}=i;(n===void 0||a<n)&&(n=a),(s===void 0||a>s)&&(s=a)}return{entries:t.length,newestEntry:s,oldestEntry:n,totalSizeBytes:r}},"getSocketCacheStats"),jw=me(e=>e?.enabled?{apiToken:e.apiToken??process.env.VIS_SOCKET_TOKEN,cacheTtlMs:e.cacheTtlMs,minimumScore:e.minimumScore,timeoutMs:e.timeoutMs}:void 0,"buildSocketOptions"),Ow=me((e,t,r)=>{if(!r)return;const n=`${e}@${t}`;if(r[n])return r[n];if(r[e])return r[e];for(const[s,o]of Object.entries(r))if(s.endsWith("*")&&e.startsWith(s.slice(0,-1)))return o},"findAcceptedRisk"),XE=me((e,t,r,n)=>[" // Add to security.socket.acceptedRisks in vis.config.ts:",` ${`"${e}"`}: {`,` reason: "${n}",`,` acceptedAt: "${new Date().toISOString()}",`,` acceptedScore: ${String(r)},`," },"].join(`
200
+ `),"formatAcceptedRiskSnippet");var Ew=Object.defineProperty,E=d((e,t)=>Ew(e,"name",{value:t,configurable:!0}),"c$7");const Rw=/^([\^~]|>=|<=|[><=])/,Cw=/^(?:'([^']+)'|"([^"]+)"|([^:\s]+)):\s*(?:'([^']+)'|"([^"]+)"|(\S+))/,xw=/^catalog:/m,Nw=/^catalogs:/m,Iw=/^(@[^:]+):registry$/,Pw=/^\/\/(.+)\/:_authToken$/,Aw=/\*+/g,Tw=/[.+^${}()|[\]\\]/g,gc=/[.*+?^${}()|[\]\\]/g,zp=/^['"]|['"]$/g,Dw=/^https?:\/\//,Vi=/\/$/,Lw=/\n(\s+)/,Hp=["dependencies","devDependencies","optionalDependencies","peerDependencies"],Bw=new Set([...Hp,"overrides","pnpm.overrides","resolutions"]),_i=E(e=>{const t=Uc("vis",{create:!0,cwd:e});if(!t)throw new Error("Cannot resolve cache directory. Ensure node_modules exists in your workspace. Run your package manager's install command first.");return y(t,"backup")},"getBackupDir"),ze=E(e=>{const t=e.replace(/^[\^~]|^>=|^<=|^[><]/,""),r=st.parse(t);if(r)return{major:r.major,minor:r.minor,patch:r.patch,prerelease:Array.isArray(r.prerelease)?r.prerelease.join("."):String(r.prerelease??"")};const n=st.coerce(e);if(n)return{major:n.major,minor:n.minor,patch:n.patch,prerelease:""}},"parseVersion"),Yp=E(e=>Rw.exec(e)?.[1]??"","extractPrefix"),hc=E(e=>{if(!e.prerelease)return"";const t=e.prerelease.split(".")[0]??"";return/^\d+$/.test(t)?"":t},"extractChannel"),Xp=E((e,t,r)=>r==="any"?!0:r==="same"?hc(e)===hc(t):e.prerelease==="","matchesReleaseChannel"),Mw=E(e=>{const t=`${String(e.major)}.${String(e.minor)}.${String(e.patch)}`;return e.prerelease?`${t}-${e.prerelease}`:t},"versionToString"),Vw=E((e,t)=>e.major!==t.major?"major":e.minor!==t.minor?"minor":e.patch!==t.patch||e.prerelease!==t.prerelease?"patch":"none","getUpdateType"),_w=E((e,t)=>e.major!==t.major?e.major-t.major:e.minor!==t.minor?e.minor-t.minor:e.patch!==t.patch?e.patch-t.patch:!e.prerelease&&t.prerelease?1:e.prerelease&&!t.prerelease?-1:e.prerelease&&t.prerelease?e.prerelease<t.prerelease?-1:e.prerelease>t.prerelease?1:0:0,"compareVersions"),gn=E((e,t)=>_w(t,e)>0,"isNewer"),Ir=E((e,t)=>{const r=t.replaceAll(Aw,"*").replaceAll(Tw,String.raw`\$&`);return new RegExp(`^${r.replaceAll("*",".*").replaceAll("?",".")}$`).test(e)},"matchesPattern"),Fw=E((e,t,r)=>r.some(n=>Ir(e,n))?!1:t.length>0?t.some(n=>Ir(e,n)):!0,"matchesFilters"),Qp=E(e=>{const t=Cw.exec(e);if(!t)return;const r=t[1]??t[2]??t[3],n=t[4]??t[5]??t[6];if(!(!r||!n))return[r,n]},"parseYamlEntry"),Zp=E((e,t,r,n)=>{e.has(t)||e.set(t,new Map);const s=e.get(t);s&&s.set(r,n)},"setCatalogEntry"),qw=E((e,t,r)=>{if(r<2)return;const n=Qp(t);n&&Zp(e,"default",n[0],n[1])},"parseCatalogSection"),Uw=E((e,t,r,n)=>{if(r===2&&t.endsWith(":"))return t.slice(0,-1).trim().replaceAll(zp,"");if(r>=4&&n){const s=Qp(t);s&&Zp(e,n,s[0],s[1])}return n},"parseCatalogsSection"),eu=E(e=>e==="catalog:"||e.startsWith("catalog:")?"catalog":e==="catalogs:"||e.startsWith("catalogs:")?"catalogs":"none","detectTopLevelSection"),Ww=E(e=>{const t=new Map;let r="none",n="";for(const s of e.split(`
201
+ `)){const o=s.trimStart(),i=s.length-o.length;if(i===0&&o.length>0&&!o.startsWith("#")){r=eu(o),r==="catalogs"&&(n="");continue}o.length===0||o.startsWith("#")||(r==="catalog"&&qw(t,o,i),r==="catalogs"&&(n=Uw(t,o,i,n)))}return t},"parseCatalogsFromYaml"),Gw=E(e=>{const t=y(e,"pnpm-workspace.yaml");if(!k(t))return!1;const r=P(t);return xw.test(r)||Nw.test(r)},"hasPnpmCatalogs"),Jw=E(e=>{const t=y(e,"pnpm-workspace.yaml");if(!k(t))return new Map;const r=P(t);return Ww(r)},"readPnpmCatalogs"),tu=E(e=>{if(k(e))try{return le(e)}catch{return}},"readPackageJsonSafe"),Kw=E(e=>{const t=tu(y(e,"package.json"));return!!(t?.workspaces?.catalog||t?.workspaces?.catalogs)},"hasBunCatalogs"),zw=E(e=>{const t=new Map;if(e.workspaces?.catalog&&typeof e.workspaces.catalog=="object"&&t.set("default",new Map(Object.entries(e.workspaces.catalog))),e.workspaces?.catalogs&&typeof e.workspaces.catalogs=="object")for(const[r,n]of Object.entries(e.workspaces.catalogs))n&&typeof n=="object"&&t.set(r,new Map(Object.entries(n)));return t},"parseBunCatalogs"),Hw=E(e=>{const t=tu(y(e,"package.json"));return t?zw(t):new Map},"readBunCatalogs"),zr=E(e=>{const t=e.lastIndexOf(":");if(t===-1)return;const r=e.slice(t+1);if(Bw.has(r))return{depType:r,relativePath:e.slice(0,t)}},"parseCompositeCatalogName"),Yw=E(e=>e?.dev?["devDependencies"]:e?.prod?["dependencies"]:e?.depFields&&e.depFields.length>0?e.depFields:Hp,"getDepTypesToInclude"),Xw=E((e,t,r)=>{const n=new Set;t&&n.add(t);for(const s of r){const o=y(e,s,"package.json");if(k(o))try{const i=le(o);i.name&&n.add(i.name)}catch{}}return n},"collectInternalPackageNames"),ru=E((e,t)=>{const r=t.split(".");let n=e;for(const s of r)if(n&&typeof n=="object")n=n[s];else return;return typeof n=="object"&&n!==null?n:void 0},"getNestedField"),Qw=E((e,t,r,n)=>{const s=t.split(".");let o=e;for(const a of s.slice(0,-1))(!o[a]||typeof o[a]!="object")&&(o[a]={}),o=o[a];const i=s.at(-1);(!o[i]||typeof o[i]!="object")&&(o[i]={}),o[i][r]=n},"setNestedField"),Zw=E((e,t)=>{const r=new Map;for(const[n,s]of Object.entries(e))t.has(n)||s.startsWith("workspace:")||s.startsWith("file:")||s.startsWith("link:")||s.startsWith("catalog:")||s.startsWith("$")||r.set(n,s);return r},"filterExternalDeps"),eS=E((e,t,r,n,s,o)=>{const i=t==="."?r:y(e,t,"package.json");if(!k(i))return;let a;try{a=le(i)}catch{return}for(const c of n){const l=c.includes(".")?ru(a,c):a[c];if(!l||typeof l!="object")continue;const p=Zw(l,s);p.size>0&&o.set(`${t}:${c}`,p)}},"scanDirectoryDeps"),tS=E((e,t)=>{const r=new Map,n=y(e,"package.json");if(!k(n))return r;const s=le(n);let o=[];const i=s.workspaces;if(i){const p=Array.isArray(i)?i:i.packages;p&&(o=Xt(e,p))}if(o.length===0){const p=Wr(e);p&&(o=Xt(e,p))}const a=Xw(e,s.name,o),c=Yw(t),l=[".",...o];for(const p of l)eS(e,p,n,c,a,r);return r},"readPackageJsonDeps"),Ks=E(e=>{const t=y(e,"package.json");if(!k(t))return!1;try{const r=le(t);return!!(r.dependencies||r.devDependencies||r.peerDependencies||r.optionalDependencies||r.overrides||r.resolutions||ru(r,"pnpm.overrides"))}catch{return!1}},"hasPackageJsonDeps"),yc=E((e,t,r)=>{const n=new Map;for(const s of t){const o=zr(s.catalogName);if(!o)continue;const i=o.relativePath==="."?y(e,"package.json"):y(e,o.relativePath,"package.json");n.has(i)||n.set(i,[]);const a=n.get(i);a&&a.push({depType:o.depType,newRange:s.newRange,packageName:s.packageName})}for(const[s,o]of n){const i=le(s);for(const{depType:a,newRange:c,packageName:l}of o)a.includes(".")?Qw(i,a,l,c):i[a]&&(i[a][l]=c);vn(s,i,{indent:Ro(s,{useEditorconfig:r}),overwrite:!0})}},"applyPackageJsonUpdates"),QE=E((e,t)=>t==="bun"?Kw(e)||Ks(e):t==="npm"||t==="yarn"?Ks(e):Gw(e)||Ks(e),"hasCatalogs"),ZE=E((e,t,r)=>{let n;t==="bun"?n=Hw(e):t==="npm"||t==="yarn"?n=new Map:n=Jw(e);const s=tS(e,r);for(const[o,i]of s)n.has(o)||n.set(o,i);return n},"readCatalogs"),vc=E(e=>{const t=new Map,r=new Map;let n="https://registry.npmjs.org";for(const s of e.split(`
202
+ `)){const o=s.trim();if(!o||o.startsWith("#")||o.startsWith(";"))continue;const i=o.indexOf("=");if(i===-1)continue;const a=o.slice(0,i).trim(),c=o.slice(i+1).trim(),l=Iw.exec(a);if(l?.[1]){t.set(l[1],c);continue}if(a==="registry"){n=c;continue}const p=Pw.exec(a);p?.[1]&&r.set(p[1],c)}return{authTokens:r,defaultRegistry:n,registries:t}},"parseNpmrc"),rS=E((e,t)=>({authTokens:new Map([...e.authTokens,...t.authTokens]),defaultRegistry:t.defaultRegistry==="https://registry.npmjs.org"?e.defaultRegistry:t.defaultRegistry,registries:new Map([...e.registries,...t.registries])}),"mergeNpmrcConfigs"),eR=E(e=>{const t={authTokens:new Map,defaultRegistry:"https://registry.npmjs.org",registries:new Map},r=process.env.HOME??process.env.USERPROFILE??"",n=y(r,".npmrc");let s=r&&k(n)?vc(P(n)):t;const o=y(e,".npmrc");return k(o)&&(s=rS(s,vc(P(o)))),s},"loadNpmrc"),nu=E((e,t)=>{let r=t.defaultRegistry;if(e.startsWith("@")){const s=e.split("/")[0];if(s&&t.registries.has(s)){const o=t.registries.get(s);o&&(r=o)}}const n=r.replace(Dw,"").replace(Vi,"");return{token:t.authTokens.get(n),url:r}},"getRegistryForPackage"),su=15e3,nS=E(async(e,t,r=su,n=!1)=>{const s=`${(t?.url??"https://registry.npmjs.org").replace(Vi,"")}/${e}`,o=n?{Accept:"application/json"}:{Accept:"application/vnd.npm.install-v1+json"};t?.authToken&&(o.Authorization=`Bearer ${t.authToken}`);const i=new AbortController,a=setTimeout(()=>{i.abort()},r);try{const c=await fetch(s,{headers:o,signal:i.signal});if(!c.ok)throw new Error(`Failed to fetch ${e}: ${String(c.status)} ${c.statusText}`);const l=await c.json(),p={latest:l["dist-tags"]?.latest??"",versions:Object.keys(l.versions??{})};return n&&l.time&&(p.publishTimes=new Map(Object.entries(l.time))),p}finally{clearTimeout(a)}},"fetchPackageVersions"),sS=E(e=>{const t=e.database_specific?.severity?.toUpperCase();if(t==="CRITICAL"||t==="HIGH"||t==="MODERATE"||t==="LOW")return t;const r=e.severity?.find(n=>n.type==="CVSS_V3")?.score;if(r){const n=Number.parseFloat(r);return n>=9?"CRITICAL":n>=7?"HIGH":n>=4?"MODERATE":"LOW"}return"UNKNOWN"},"mapOsvSeverity"),oS=E(e=>{const t=e.severity?.find(r=>r.type==="CVSS_V3")?.score;return t?Number.parseFloat(t):void 0},"mapOsvCvss"),iS=E(e=>{const t=[];for(const r of e.affected??[])for(const n of r.ranges??[])for(const s of n.events??[])s.fixed&&t.push(s.fixed);return t},"mapOsvFixedVersions"),aS=E(e=>({aliases:e.aliases?.length?e.aliases:void 0,cvssScore:oS(e),fixedVersions:iS(e),id:e.id,severity:sS(e),summary:e.summary??""}),"mapOsvVuln"),cS=E(async(e,t=1e4)=>{if(e.length===0)return new Map;const r=e.map(o=>({package:{ecosystem:"npm",name:o.name},version:o.version})),n=new AbortController,s=setTimeout(()=>{n.abort()},t);try{const o=await fetch("https://api.osv.dev/v1/querybatch",{body:JSON.stringify({queries:r}),headers:{"Content-Type":"application/json"},method:"POST",signal:n.signal});if(!o.ok)return new Map;const i=await o.json(),a=new Map;for(const[c,l]of e.entries()){const p=i.results[c]?.vulns;p&&p.length>0&&a.set(l.name,p.map(f=>aS(f)))}return a}catch{return new Map}finally{clearTimeout(s)}},"fetchVulnerabilities"),bc=new Map,lS=E((e,t,r)=>{if(!r)return t;const n=r[e];if(n!==void 0)return n;for(const[s,o]of Object.entries(r))if(s!==e){if(s.startsWith("/")&&s.endsWith("/")){let i=bc.get(s);if(i||(i=new RegExp(s.slice(1,-1)),bc.set(s,i)),i.test(e))return o}else if(Ir(e,s))return o}return t},"resolvePackageTarget"),ou=E((e,t,r)=>{const n=t?.get(e);return n?Date.now()-new Date(n).getTime()<r:!1},"isTooNew"),pS=E(e=>e?.minimumReleaseAge?e.packageName&&e.minimumReleaseAgeExclude?.some(t=>Ir(e.packageName,t))?0:e.minimumReleaseAge*60*1e3:0,"resolveMinAgeMs"),iu=E((e,t)=>t??(e?"any":"stable"),"resolveReleaseChannel"),zs=E((e,t,r,n,s,o,i)=>{const a=iu(r,i);return e.map(c=>({parsed:ze(c),raw:c})).filter(c=>!c.parsed||!Xp(c.parsed,t,a)||!gn(t,c.parsed)||n&&ou(c.raw,s,n)?!1:o?o(c.parsed):!0).toSorted((c,l)=>st.rcompare(c.raw,l.raw))[0]?.raw},"filterCandidates"),uS=E((e,t,r,n,s,o,i)=>{const a=ze(r);if(!a)return;const c=pS(o),l=iu(s,i);if(n==="latest"){const f=ze(t);return f?Xp(f,a,l)?gn(a,f)?!c||!ou(t,o?.publishTimes,c)?t:zs(e,a,s,c,o?.publishTimes,void 0,l):void 0:zs(e,a,s,c,o?.publishTimes,void 0,l):void 0}const p=n==="patch"?f=>f.major===a.major&&f.minor===a.minor:f=>f.major===a.major;return zs(e,a,s,c,o?.publishTimes,p,l)},"findTargetVersion"),dS=E((e,t)=>{const r=[],n=new Set;for(const[s,o]of e)for(const[i,a]of o)if(!(a.startsWith("workspace:")||a.startsWith("file:")||a.startsWith("link:")||a==="*")&&!(!t.includeLocked&&!Yp(a))){if(t.ignore.some(c=>Ir(i,c))){n.add(i);continue}Fw(i,t.include,t.exclude)&&r.push({catalogName:s,packageName:i,range:a})}return{entries:r,ignored:[...n]}},"collectEntries"),fS=E(async(e,t,r,n=!1,s)=>{const o=new Map,i=[],a=Math.max(1,Math.min(64,Math.floor(s??8)||8));let c=0;for(let l=0;l<e.length;l+=a){const p=e.slice(l,l+a),f=await Promise.allSettled(p.map(async u=>{const m=t?nu(u,t):void 0,h=await nS(u,m?{authToken:m.token,url:m.url}:void 0,su,n);return o.set(u,h),u}));for(const[u,m]of f.entries())if(c+=1,m.status==="rejected"){const h=p[u];h&&i.push(h)}r&&r(c,e.length)}return{failed:i,versionCache:o}},"fetchVersionsBatched"),kc=E((e,t,r)=>{const n=[];for(const s of e){const o=t.get(s.packageName);if(!o)continue;const i=lS(s.packageName,r.target,r.packageMode),a=uS(o.versions,o.latest,s.range,i,r.includePrerelease,{minimumReleaseAge:r.minimumReleaseAge,minimumReleaseAgeExclude:r.minimumReleaseAgeExclude,packageName:s.packageName,publishTimes:o.publishTimes},r.releaseChannel);if(!a)continue;const c=ze(s.range),l=ze(a);if(!c||!l)continue;const p=Vw(c,l);if(p==="none")continue;const f=Yp(s.range);n.push({catalogName:s.catalogName,currentRange:s.range,newRange:`${f}${a}`,packageName:s.packageName,targetVersion:a,updateType:p})}return n},"buildOutdatedEntries"),$c=E(e=>e?Mw(e):"","formatVersionString"),mS=E(async(e,t,r,n)=>{const s=[...new Map(t.map(c=>{const l=ze(c.range);return[c.packageName,{name:c.packageName,version:$c(l)}]})).values()].filter(c=>c.version),o=r?Jp(s,r):void 0,[i,a]=await Promise.all([cS(s),o]);for(const c of e){const l=i.get(c.packageName);l&&l.length>0&&(c.vulnerabilities=l);const p=ze(c.currentRange),f=$c(p);if(a){const u=a.get(`${c.packageName}@${f}`);u&&(c.socketReport={alerts:u.alerts,license:u.license,score:u.score})}if(n){const u=Ow(c.packageName,f,n);u&&(c.acceptedRisk=u)}}},"enrichWithSecurity"),gS=6e4,hS=E((e,t,r,n)=>{const s=[];for(const[a,c]of e)for(const[l,p]of c)s.push(`${a}:${l}=${p}`);if(s.push(`target=${t.target},pre=${String(t.includePrerelease)},chan=${t.releaseChannel??"_"},sec=${String(t.security??!1)}`),s.push(`in=${t.include.join(",")},ex=${t.exclude.join(",")},ig=${t.ignore.join(",")}`),s.push(`locked=${String(t.includeLocked)}`),s.push(`mra=${String(t.minimumReleaseAge??0)}`),t.packageMode){const a=Object.entries(t.packageMode).map(([c,l])=>`${c}=${l}`).toSorted().join(",");s.push(`pkgMode=${a}`)}s.push(`socket=${String(r??!1)}`),n&&n.length>0&&s.push(`risks=${n.toSorted().join(",")}`);let o=5381;const i=s.join("|");for(let a=0;a<i.length;a++)o=(o<<5)+o+i.charCodeAt(a)|0;return String(o)},"computeCacheHash"),au=E(e=>{const t=Uc("vis",{create:!0,cwd:e});return t?y(t,"outdated-cache.json"):void 0},"getOutdatedCachePath"),yS=E((e,t)=>{const r=au(e);if(!(!r||!k(r)))try{const n=le(r);if(n.hash===t&&Date.now()-n.timestamp<gS)return n.result}catch{}},"readOutdatedCache"),vS=E((e,t,r)=>{const n=au(e);if(n)try{rt(Ar(n)),vn(n,{hash:t,result:r,timestamp:Date.now()})}catch{}},"writeOutdatedCache"),tR=E(async(e,t,r,n,s,o,i)=>{const a=hS(e,t,!!o,i?Object.keys(i):void 0);if(s){const v=yS(s,a);if(v)return v}const{entries:c,ignored:l}=dS(e,t),p=[...new Set(c.map(v=>v.packageName))],f=!!(t.minimumReleaseAge&&t.minimumReleaseAge>0),{failed:u,versionCache:m}=await fS(p,r,n,f,t.maxConcurrentRequests),h=kc(c,m,t);let g=[];if(t.target!=="latest"){const v=new Set(h.map(j=>j.packageName)),$={...t,packageMode:void 0,target:"latest"};g=kc(c,m,$).filter(j=>!v.has(j.packageName))}(t.security||o)&&h.length>0&&await mS(h,c,o,i);const b={checkedCount:p.length,failed:u,filteredByTarget:g,ignored:l,outdated:h};return s&&vS(s,a,b),b},"checkOutdated"),Fi=E((e,t)=>t==="bun"?y(e,"package.json"):y(e,"pnpm-workspace.yaml"),"getCatalogFilePath"),wc=E((e,t)=>{const r=_i(e),n=new Set;for(const s of t){const o=zr(s.catalogName);o&&n.add(o.relativePath==="."?"package.json":y(o.relativePath,"package.json"))}if(n.size!==0){rt(r);for(const s of n){const o=y(e,s);if(k(o)){const i=y(r,s),a=Ar(i);rt(a),oe(i,P(o))}}return r}},"createPackageJsonBackup"),bS=E((e,t,r)=>{if((t==="npm"||t==="yarn")&&r)return wc(e,r);let n;const s=Fi(e,t);if(k(s)&&(n=`${s}.bak`,oe(n,P(s))),r){const o=r.filter(i=>zr(i.catalogName));o.length>0&&wc(e,o)}return n},"createBackup"),kS=E(e=>{const t=_i(e);if(!k(t))return!1;for(const r of yn(t,{includeDirs:!1})){const n=r.path.slice(t.length+1),s=y(e,n);oe(s,P(r.path))}return Du(t),!0},"restorePackageJsonBackup"),rR=E((e,t)=>{if(t==="npm"||t==="yarn")return kS(e);const r=Fi(e,t),n=`${r}.bak`;if(!k(n))return!1;const s=P(n);return oe(r,s),!0},"restoreFromBackup"),nR=E((e,t)=>{if(t==="npm"||t==="yarn")try{const n=_i(e);return k(n)}catch{return!1}const r=Fi(e,t);return k(`${r}.bak`)},"hasBackup"),sR=E(e=>JSON.stringify(e,void 0,2),"formatOutdatedJson"),oR=E(e=>e.map(t=>`${t.packageName} ${t.currentRange} → ${t.newRange}`).join(`
203
+ `),"formatOutdatedMinimal"),iR=E(e=>e?Array.isArray(e)?e:[e]:[],"toFilterArray"),$S=E(e=>{const t=new Map;for(const r of e){t.has(r.catalogName)||t.set(r.catalogName,[]);const n=t.get(r.catalogName);n&&n.push(r)}return t},"groupByCatalog"),wS=E(e=>{const t=zr(e);return t?`${t.relativePath==="."?"root":t.relativePath} (${t.depType})`:`Catalog: ${e}`},"formatCatalogDisplayName"),aR=E((e,t)=>{const r=$S(e),n=process.stdout.columns||80,s=e.some(o=>o.socketReport);for(const[o,i]of r){const a=i.flatMap(p=>{const f=p.vulnerabilities&&p.vulnerabilities.length>0,u=p.socketReport&&p.socketReport.alerts.length>0,m=`${f||u?"[SEC] ":""}${p.packageName}`,h=p.socketReport?`${String(Math.round(p.socketReport.score.overall*100))}%`:"",g={current:p.currentRange,package:m,target:p.newRange,type:p.updateType};s&&(g.score=h);const b=[g];if(p.vulnerabilities)for(const v of p.vulnerabilities){const $={current:v.summary,package:` ${v.severity} ${v.id}`,target:"",type:""};s&&($.score=""),b.push($)}if(p.socketReport)for(const v of p.socketReport.alerts){const $={current:v.category,package:` [${v.severity.toUpperCase()}] ${v.type}`,target:"",type:""};s&&($.score=""),b.push($)}return b}),c=wS(o),l=Vc(qt.createElement(Vu,{data:a}),{columns:n});t.info(`${c}
204
+ ${l}
205
+ `)}},"formatOutdatedTable"),cR=E(e=>{let t=0,r=0,n=0,s=0,o=0,i=0;for(const f of e)f.updateType==="major"?t++:f.updateType==="minor"?r++:n++,f.vulnerabilities&&f.vulnerabilities.length>0&&s++,f.socketReport?.alerts.length&&o++,f.socketReport&&f.socketReport.score.overall<go&&i++;const a=[];t&&a.push(`${String(t)} major`),r&&a.push(`${String(r)} minor`),n&&a.push(`${String(n)} patch`),s&&a.push(`${String(s)} with vulnerabilities`),o&&a.push(`${String(o)} with Socket.dev alerts`);const c=`Found ${String(e.length)} outdated (${a.join(", ")})`,l=process.stdout.columns||80,p=[qt.createElement(C,{bold:!0},"─ Summary"),qt.createElement(C,null,` ${c}`)];return i>0&&p.push(qt.createElement(C,{color:"yellow"},` ${String(i)} package${i===1?"":"s"} with low Socket.dev score (<${String(go*100)}%)`)),Vc(qt.createElement(K,{flexDirection:"column",paddingX:1},...p),{columns:l})},"formatSummary"),SS=E((e,t)=>{const r=e.replaceAll(gc,String.raw`\$&`),n=t.replaceAll(gc,String.raw`\$&`);return new RegExp(String.raw`^(?:'${r}'|"${r}"|${r}):\s*['"]?${n}['"]?`)},"buildLineMatchRegex"),jS=E((e,t,r)=>SS(t,r).test(e),"lineMatchesPackage"),OS=E(e=>{const t=new Map;for(const r of e){t.has(r.catalogName)||t.set(r.catalogName,new Map);const n=t.get(r.catalogName);n&&n.set(r.packageName,{newRange:r.newRange,oldRange:r.currentRange})}return t},"buildUpdateMap"),Sc=E((e,t,r)=>{if(!r)return e;for(const[n,{newRange:s,oldRange:o}]of r)if(jS(t,n,o))return e.replace(o,s);return e},"applyLineUpdate"),ES=E((e,t,r,n)=>{const s=e.trimStart(),o=e.length-s.length;return s.length===0||s.startsWith("#")?e:t==="catalog"&&o>=2?Sc(e,s,n.get("default")):t==="catalogs"&&o>=4&&r?Sc(e,s,n.get(r)):e},"processYamlLineForUpdate"),RS=E((e,t)=>{const r=y(e,"pnpm-workspace.yaml"),n=P(r).split(`
206
+ `),s=OS(t);let o="none",i="";const a=[];for(const c of n){const l=c.trimStart(),p=c.length-l.length;p===0&&l.length>0&&!l.startsWith("#")&&(o=eu(l),o==="catalogs"&&(i="")),o==="catalogs"&&p===2&&l.endsWith(":")&&(i=l.slice(0,-1).trim().replaceAll(zp,"")),a.push(ES(c,o,i,s))}oe(r,a.join(`
207
+ `))},"applyPnpmCatalogUpdates");E(e=>{const t=Lw.exec(e);if(!t)return 2;const r=t[1];return r?r.includes(" ")?r:r.length:2},"detectJsonIndent");const CS=E((e,t,r)=>{const n=y(e,"package.json"),s=le(n);for(const o of t)if(o.catalogName==="default")s.workspaces?.catalog&&(s.workspaces.catalog[o.packageName]=o.newRange);else{const i=s.workspaces?.catalogs?.[o.catalogName];i&&(i[o.packageName]=o.newRange)}vn(n,s,{indent:Ro(n,{useEditorconfig:r}),overwrite:!0})},"applyBunCatalogUpdates"),lR=E((e,t,r,n=!0,s={})=>{const{useEditorconfig:o}=s;let i;n&&(i=bS(e,r,t));const a=[],c=[];for(const l of t)zr(l.catalogName)?c.push(l):a.push(l);return a.length>0&&(r==="npm"||r==="yarn"?yc(e,a,o):r==="bun"?CS(e,a,o):RS(e,a)),c.length>0&&yc(e,c,o),i},"applyCatalogUpdates"),pR=E(async e=>{const t=qc({input:process.stdin,output:process.stdout}),r=E(s=>new Promise(o=>{t.question(s,i=>{o(i.trim())})}),"ask");process.stdout.write(`
208
+ Outdated catalog dependencies:
209
+ `);for(const[s,o]of e.entries())o&&process.stdout.write(` ${String(s+1)}. ${o.packageName}: ${o.currentRange} → ${o.newRange} (${o.updateType})
210
+ `);process.stdout.write(`
211
+ `);const n=await r("Apply updates? [a]ll / [n]one / [s]elect: ");if(n.toLowerCase()==="a"||n.toLowerCase()==="all")return t.close(),e;if(n.toLowerCase()==="n"||n.toLowerCase()==="none")return t.close(),[];if(n.toLowerCase()==="s"||n.toLowerCase()==="select"){const s=await r("Enter numbers to apply (comma-separated): ");return t.close(),s.split(",").map(o=>Number.parseInt(o.trim(),10)-1).filter(o=>o>=0&&o<e.length).map(o=>e[o]).filter(o=>o!==void 0)}return t.close(),[]},"promptPackageSelection"),xS=/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git|\/|$)/,uR=E(async(e,t=1e4,r)=>{const n=[],s=new AbortController,o=setTimeout(()=>{s.abort()},t);try{const i=e.map(async a=>{const c=`https://www.npmjs.com/package/${a.packageName}`;try{const l=r?nu(a.packageName,r):{url:"https://registry.npmjs.org"},p=l.url.replace(Vi,""),f={Accept:"application/json"};l.token&&(f.Authorization=`Bearer ${l.token}`);const u=await fetch(`${p}/${a.packageName}`,{headers:f,signal:s.signal});if(!u.ok)return{npmUrl:c,packageName:a.packageName};const m=(await u.json()).repository?.url;if(!m)return{npmUrl:c,packageName:a.packageName};const h=xS.exec(m);if(!h)return{npmUrl:c,packageName:a.packageName,repoUrl:m};const g=h[1],b=h[2],v=`https://github.com/${g}/${b}/releases/tag/v${a.targetVersion}`;return{npmUrl:c,packageName:a.packageName,releaseUrl:v,repoUrl:`https://github.com/${g}/${b}`}}catch{return{npmUrl:c,packageName:a.packageName}}});n.push(...await Promise.all(i))}finally{clearTimeout(o)}return n},"fetchChangelogInfo");var NS=Object.defineProperty,pr=d((e,t)=>NS(e,"name",{value:t,configurable:!0}),"c$6");const IS=["dependencies","devDependencies","peerDependencies","optionalDependencies","overrides","resolutions","pnpm.overrides"],PS=pr((e,t)=>{const r=t.split(".");let n=e;for(const s of r){if(typeof n!="object"||n===null)return;n=n[s]}return typeof n=="object"&&n!==null?n:void 0},"getNested"),qi=pr(e=>{const t=y(e,"package.json");if(!k(t))return["."];const r=le(t).workspaces;let n=[];if(r){const s=Array.isArray(r)?r:r.packages;s&&(n=Xt(e,s))}if(n.length===0){const s=Wr(e);s&&(n=Xt(e,s))}return[".",...n]},"collectWorkspaceDirectories"),Jn=pr(e=>{if(k(e))try{return le(e)}catch{return}},"readPkg"),AS=pr(e=>{const t=new Set,r=qi(e);for(const n of r){const s=Jn(y(e,n,"package.json"));s&&typeof s.name=="string"&&t.add(s.name)}return t},"collectWorkspacePackageNames"),dR=pr((e,t={})=>{const r=t.includeInternal??!0,n=t.depTypes??IS,s=qi(e),o=AS(e),i=[],a=n.includes("pnpm.overrides")?ok(e):void 0,c=a?y(e,"pnpm-workspace.yaml"):void 0;for(const l of s){const p=y(e,l,"package.json"),f=Jn(p);if(!f)continue;const u=typeof f.name=="string"?f.name:void 0,m=l==="."?".":Lc(e,y(e,l));for(const h of n){const g=h.includes(".")?PS(f,h):f[h];if(!(!g||typeof g!="object"))for(const[b,v]of Object.entries(g)){if(typeof v!="string")continue;const $=o.has(b);!r&&$||i.push({depName:b,depType:h,isInternal:$,packageDir:m,packageJsonPath:p,packageName:u,specifier:v})}}}if(a&&c)for(const[l,p]of Object.entries(a)){const f=o.has(l);!r&&f||i.push({depName:l,depType:"pnpm.overrides",isInternal:f,packageDir:".",packageJsonPath:c,packageName:void 0,specifier:p})}return i},"iterateWorkspaceDeps");pr(e=>{const t=new Map;for(const r of e){const n=t.get(r.depName);n?n.push(r):t.set(r.depName,[r])}return t},"groupInstancesByDep");var TS=Object.defineProperty,Ce=d((e,t)=>TS(e,"name",{value:t,configurable:!0}),"u$3");const Ui=new Set(["devEngines.packageManager","devEngines.runtime","engines","packageManager","volta"]),DS=["engines","volta"],LS=new Set(["extends"]),BS=/^([@\w./-]+?)@([^+]+)(\+.+)?$/,MS=/^([@\w./-]+)~(.+)$/,Kn=Ce(e=>{const t=BS.exec(e.trim());if(!(!t?.[1]||!t[2]))return{hash:t[3]??"",name:t[1],version:t[2]}},"parsePackageManager"),cu=Ce(e=>{const t=MS.exec(e.trim());if(!(!t?.[1]||!t[2]))return{name:t[1],version:t[2]}},"parseNameTildeVersion"),Pr=Ce(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),lu=Ce(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.name=="string","isDevEnginesEntry"),VS=new Set(["name@version","name~version","string","versionsByName"]),fR=Ce(e=>{const t=[];if(!e)return t;const r=new Set;for(const n of e){const s=typeof n?.name=="string"&&n.name.length>0?n.name:"<unnamed>";if(typeof n?.name!="string"||n.name.length===0){t.push("extraTypes entry missing 'name'");continue}Ui.has(n.name)&&t.push(`extraTypes[${s}]: name collides with a built-in customType`),r.has(n.name)&&t.push(`extraTypes[${s}]: duplicate name`),r.add(n.name),(typeof n.path!="string"||n.path.length===0)&&t.push(`extraTypes[${s}]: missing 'path'`),VS.has(n.strategy)||t.push(`extraTypes[${s}]: invalid strategy "${String(n.strategy)}" (expected name@version | name~version | string | versionsByName)`),n.strategy==="string"&&(typeof n.depName!="string"||n.depName.length===0)&&t.push(`extraTypes[${s}]: strategy 'string' requires 'depName'`)}return t},"validateExtraTypes"),_S=Ce((e,t)=>{if(t.length===0)return;let r=e;for(const n of t.split(".")){if(typeof r!="object"||r===null||Array.isArray(r))return;r=r[n]}return r},"getNested"),FS=Ce((e,t,r,n,s)=>{const o=_S(t,e.path);if(o===void 0)return[];const i=Object.freeze({depName:e.depName,path:e.path,strategy:e.strategy});if(e.strategy==="versionsByName"){if(!Pr(o))return[];const a=[];for(const[c,l]of Object.entries(o))typeof l=="string"&&a.push({customType:e.name,depName:c,extra:i,packageDir:r,packageJsonPath:n,packageName:s,rawValue:l,specifier:l});return a}if(e.strategy==="name@version"){if(typeof o!="string")return[];const a=Kn(o);return a?[{customType:e.name,depName:a.name,extra:i,packageDir:r,packageJsonPath:n,packageName:s,rawValue:o,specifier:a.version}]:[]}if(e.strategy==="name~version"){if(typeof o!="string")return[];const a=cu(o);return a?[{customType:e.name,depName:a.name,extra:i,packageDir:r,packageJsonPath:n,packageName:s,rawValue:o,specifier:a.version}]:[]}return typeof o!="string"||typeof e.depName!="string"||e.depName.length===0?[]:[{customType:e.name,depName:e.depName,extra:i,packageDir:r,packageJsonPath:n,packageName:s,rawValue:o,specifier:o}]},"iterateExtraType"),mR=Ce((e,t)=>{const r=qi(e),n=[];for(const s of r){const o=y(e,s,"package.json"),i=Jn(o);if(!i)continue;const a=typeof i.name=="string"?i.name:void 0,c=s==="."?".":Lc(e,y(e,s));for(const p of DS){const f=i[p];if(Pr(f))for(const[u,m]of Object.entries(f))typeof m=="string"&&(p==="volta"&&LS.has(u)||n.push({customType:p,depName:u,packageDir:c,packageJsonPath:o,packageName:a,rawValue:m,specifier:m}))}if(typeof i.packageManager=="string"){const p=Kn(i.packageManager);p&&n.push({customType:"packageManager",depName:p.name,packageDir:c,packageJsonPath:o,packageName:a,rawValue:i.packageManager,specifier:p.version})}const{devEngines:l}=i;if(typeof l=="object"&&l!==null&&!Array.isArray(l))for(const p of["runtime","packageManager"]){const f=l[p];if(f===void 0)continue;const u=Array.isArray(f)?f:[f];for(const m of u)!lu(m)||typeof m.version!="string"||n.push({customType:p==="runtime"?"devEngines.runtime":"devEngines.packageManager",depName:m.name,packageDir:c,packageJsonPath:o,packageName:a,rawValue:m.version,specifier:m.version})}if(t){for(const p of t)if(!(typeof p?.name!="string"||p.name.length===0)&&!Ui.has(p.name))for(const f of FS(p,i,c,o,a))n.push(f)}}return n},"iterateCustomTypeDeps"),qS=Ce((e,t)=>`${e} ${t}`,"pinKey"),US=Ce((e,t)=>{const r=[...e].sort((s,o)=>(s.packageName??s.packageDir).localeCompare(o.packageName??o.packageDir));let n;for(const s of r){const o=ze(s.specifier);if(!o)continue;if(!n){n=s;continue}const i=ze(n.specifier);if(!i){n=s;continue}const a=gn(i,o),c=gn(o,i);(t==="highest"&&a||t==="lowest"&&c)&&(n=s)}return n},"pickCanonical"),gR=Ce((e,t={})=>{const r=new Set(t.ignoreDeps),n=t.resolve??"highest",s=[],o=e.filter(a=>t.dep!==void 0&&a.depName!==t.dep?!1:!r.has(a.depName)),i=new Map;for(const a of o){const c=qS(a.customType,a.depName),l=i.get(c);l?l.push(a):i.set(c,[a])}for(const[,a]of i){if(a.length<2||new Set(a.map(l=>l.specifier)).size<=1)continue;const c=US(a,n);if(c)for(const l of a)l.specifier!==c.specifier&&ze(l.specifier)!==void 0&&s.push({canonicalSource:c.packageName??c.packageDir,customType:l.customType,depName:l.depName,...l.extra?{extra:l.extra}:{},fix:c.specifier,packageDir:l.packageDir,packageJsonPath:l.packageJsonPath,packageName:l.packageName,specifier:l.specifier})}return s},"lintCustomTypes"),WS=Ce((e,t)=>{const r=t.extra;if(!r)return!1;const n=r.path.split(".");if(n.length===0||n.some(i=>i.length===0))return!1;let s=e;for(let i=0;i<n.length-1;i+=1){const a=s[n[i]];if(typeof a!="object"||a===null||Array.isArray(a))return!1;s=a}const o=n.at(-1);if(r.strategy==="versionsByName"){const i=s[o];return Pr(i)?(i[t.depName]=t.fix,!0):!1}if(r.strategy==="name@version"){const i=s[o];if(typeof i!="string")return!1;const a=Kn(i);return a?(s[o]=`${a.name}@${t.fix}`,!0):!1}if(r.strategy==="name~version"){const i=s[o];if(typeof i!="string")return!1;const a=cu(i);return a?(s[o]=`${a.name}~${t.fix}`,!0):!1}return typeof s[o]!="string"?!1:(s[o]=t.fix,!0)},"applyExtraTypeFix"),hR=Ce((e,t={})=>{const{useEditorconfig:r}=t,n=new Map;for(const o of e){const i=n.get(o.packageJsonPath);i?i.push(o):n.set(o.packageJsonPath,[o])}const s=[];for(const[o,i]of n){const a=Jn(o);if(!a)continue;let c=!1;for(const l of i){if(l.extra){WS(a,l)&&(c=!0);continue}if(l.customType==="engines"||l.customType==="volta"){const h=a[l.customType];Pr(h)&&(h[l.depName]=l.fix,c=!0);continue}if(l.customType==="packageManager"){const h=a.packageManager;if(typeof h=="string"){const g=Kn(h);g&&(a.packageManager=`${g.name}@${l.fix}`,c=!0)}continue}const p=l.customType==="devEngines.runtime"?"runtime":"packageManager",{devEngines:f}=a;if(!Pr(f))continue;const u=f[p];if(u===void 0)continue;const m=Array.isArray(u)?u:[u];for(const h of m)lu(h)&&h.name===l.depName&&(h.version=l.fix,c=!0)}c&&(vn(o,a,{indent:Ro(o,{useEditorconfig:r}),overwrite:!0}),s.push(o))}return s},"applyCustomTypeFixes");var GS=Object.defineProperty,ie=d((e,t)=>GS(e,"name",{value:t,configurable:!0}),"a$7");const ho="syncpack",pu=[".syncpackrc",".syncpackrc.json"],Wi=[".syncpackrc.yaml",".syncpackrc.yml"],Gi=[".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],JS=[...pu,...Wi,...Gi],KS=/\bextraTypes\s*:/,zS=/\bpolicy\s*:/,jc=/(defineConfig\(\{)/,Oc=/(export\s+default\s+\{)/,Ji=/\bsyncpack\b/,uu=ie(e=>{const t=y(e,"package.json");if(k(t)&&ge(t)?.syncpack)return"package.json";for(const r of JS)if(k(y(e,r)))return r},"detectSyncpackConfig"),HS=ie(e=>{for(const r of Gi)if(k(y(e,r)))return r;const t=y(e,".syncpackrc");if(k(t)&&!ar(t))try{Dr(t);return}catch{return".syncpackrc"}},"hasUnsupportedSyncpackConfig"),YS=ie(e=>{const t=Nt(e);return t?KS.test(P(t)):!1},"hasPolicyExtraTypesInVisConfig"),XS=ie(e=>ge(y(e,"package.json"))?.syncpack,"extractSyncpackFromPackageJson"),QS=ie(e=>ge(e),"parseSyncpackJsonFile"),Ec=ie(e=>{try{return Dr(e)}catch{return}},"parseSyncpackYamlFile"),ZS=ie((e,t,r)=>{if(t==="package.json")return XS(e);if(Gi.includes(t)){J(r,`${t} is a TS/JS config and cannot be auto-migrated — vis migrate does not load executable config. Convert to .syncpackrc.json and re-run, or translate directly into vis.config.ts. Tracked in https://github.com/visulima/visulima/issues/622.`),Q(r,`Translate ${t} into vis.config.ts (policy.* and security.*) — see https://github.com/visulima/visulima/issues/622`);return}const n=y(e,t);if(Wi.includes(t))return Ec(n);if(t===".syncpackrc"&&!ar(n)){const s=Ec(n);if(s)return s;J(r,".syncpackrc is neither valid JSON nor YAML — please migrate manually.");return}return QS(n)},"extractConfig"),du=ie((e,t)=>{const r=[];if(!e.customTypes)return r;for(const[n,s]of Object.entries(e.customTypes)){if(!s||typeof s!="object")continue;const{strategy:o}=s,{path:i}=s;if(typeof i!="string"||i.length===0){J(t,`customType "${n}" has no \`path\` — skipped.`);continue}if(o!=="name@version"&&o!=="string"&&o!=="versionsByName"){J(t,`customType "${n}" has unsupported strategy ${JSON.stringify(o)} — skipped.`);continue}if(Ui.has(n)){J(t,`customType "${n}" collides with a vis built-in and was dropped — vis already lints this surface.`);continue}const a={name:n,path:i,strategy:o};if(o==="string"){const{depName:c}=s;typeof c=="string"&&c.length>0?a.depName=c:(J(t,`customType "${n}" uses strategy "string" but has no \`depName\` — vis requires it. Add it manually after migration.`),Q(t,`Set policy.customTypes.extraTypes[name="${n}"].depName before running vis lint`))}r.push(a)}return r},"translateCustomTypes"),fu=ie(e=>e.isBanned===!0,"isVersionGroupBanned"),mu=ie((e,t)=>{if(Array.isArray(e.versionGroups)&&e.versionGroups.length>0){const r=e.versionGroups.filter(n=>n&&typeof n=="object"&&!fu(n));r.length>0&&(J(t,`${String(r.length)} versionGroups rule(s) cannot be migrated — \`pinVersion\`, \`snapTo\`, and \`policy: "sameRange"\` (and other versionGroups DSL surfaces) are tracked in https://github.com/visulima/visulima/issues/622.`),Q(t,'Re-implement versionGroups rules using `pinVersion` / `snapTo` / `policy: "sameRange"` once the vis DSL ships (issue #622).'))}Array.isArray(e.semverGroups)&&e.semverGroups.length>0&&(J(t,`${String(e.semverGroups.length)} semverGroups rule(s) cannot be migrated — semverGroups DSL is tracked in https://github.com/visulima/visulima/issues/622.`),Q(t,"Re-implement semverGroups rules manually once the vis DSL ships (issue #622)")),Array.isArray(e.dependencyTypes)&&e.dependencyTypes.length>0&&Q(t,"Review syncpack `dependencyTypes` — vis applies policies to dependencies/devDependencies/peerDependencies/optionalDependencies/overrides by default. Narrow via policy.* filters if needed."),Array.isArray(e.specifierTypes)&&e.specifierTypes.length>0&&Q(t,"Review syncpack `specifierTypes` — vis has no direct equivalent today; specifier filtering belongs in versionGroups (issue #622)."),typeof e.filter=="string"&&e.filter.length>0&&Q(t,`Re-implement syncpack \`filter\` regex (${e.filter}) once vis exposes a top-level dep filter.`),(Array.isArray(e.sortAz)&&e.sortAz.length>0||Array.isArray(e.sortFirst)&&e.sortFirst.length>0||Array.isArray(e.sortExports)&&e.sortExports.length>0)&&J(t,"syncpack sort options (sortAz / sortFirst / sortExports) are superseded by `vis sort-package-json` — no migration needed."),(e.sortPackages!==void 0||e.formatBugs!==void 0||e.formatRepository!==void 0)&&J(t,"syncpack package.json shape options (sortPackages / formatBugs / formatRepository) are superseded by `vis sort-package-json` — no migration needed."),(e.lintFormatting!==void 0||e.lintSemverRanges!==void 0||e.lintVersions!==void 0)&&J(t,"syncpack lint toggles (lintFormatting / lintSemverRanges / lintVersions) are covered by `vis lint` by default — no migration needed."),Array.isArray(e.source)&&e.source.length>0&&Q(t,`syncpack \`source\` was set to [${e.source.map(r=>JSON.stringify(r)).join(", ")}]. vis derives workspace globs from pnpm-workspace.yaml / package.json#workspaces — verify they match before relying on \`vis lint\`.`),typeof e.indent=="string"&&e.indent.length>0&&J(t,"syncpack `indent` is implicit in vis — JSON writers honor `.editorconfig` (and the source file's existing indentation). No migration needed.")},"noteUnsupportedKeys"),gu=ie((e,t)=>{const r={};if(!Array.isArray(e.versionGroups))return r;for(const n of e.versionGroups){if(!n||typeof n!="object")continue;const s=n;if(!fu(s))continue;const o=Array.isArray(s.dependencies)?s.dependencies.filter(l=>typeof l=="string"&&l.length>0):[];if(o.length===0){J(t,"versionGroup with `isBanned: true` has no `dependencies` entries — skipped.");continue}const i=Array.isArray(s.packages)?s.packages.filter(l=>typeof l=="string"&&l.length>0):[],a=s.label,c=typeof a=="string"&&a.length>0?a:"banned via syncpack versionGroups";for(const l of o){if(r[l]!==void 0){J(t,`Multiple banned versionGroups target "${l}" — kept the first match; merge manually if needed.`);continue}r[l]=i.length>0?{packages:i,reason:c}:c}}return r},"translateBannedDeps"),ej=ie(e=>{const t=[`name: ${JSON.stringify(e.name)}`,`path: ${JSON.stringify(e.path)}`,`strategy: ${JSON.stringify(e.strategy)}`];return e.depName!==void 0&&t.push(`depName: ${JSON.stringify(e.depName)}`),` { ${t.join(", ")} }`},"formatExtraTypeLiteral"),tj=ie((e,t)=>{if(typeof t=="string")return` ${JSON.stringify(e)}: ${JSON.stringify(t)}`;const r=[`reason: ${JSON.stringify(t.reason)}`];return t.packages&&t.packages.length>0&&r.push(`packages: [${t.packages.map(n=>JSON.stringify(n)).join(", ")}]`),t.paths&&t.paths.length>0&&r.push(`paths: [${t.paths.map(n=>JSON.stringify(n)).join(", ")}]`),t.replacement!==void 0&&r.push(`replacement: ${JSON.stringify(t.replacement)}`),` ${JSON.stringify(e)}: { ${r.join(", ")} }`},"formatBannedDepRule"),yo=ie((e,t={})=>{const r=[],n=Object.entries(t);if(n.length>0){const s=n.map(([o,i])=>tj(o,i)).join(`,
212
+ `);r.push(` bannedDeps: {
213
+ ${s},
214
+ }`)}if(e.length>0){const s=e.map(o=>ej(o)).join(`,
215
+ `);r.push(` customTypes: {
216
+ extraTypes: [
217
+ ${s},
218
+ ],
219
+ }`)}return` policy: {
220
+ ${r.join(`,
44
221
  `)},
45
- }`,"generateStagedConfigSnippet"),ol=N((e,t,n)=>{const o=Ae(e);if(o){const i=j(o),s=ot(t);let l;return Nt.test(i)?l=i.replace(Nt,`$1
46
- ${s},`):Wt.test(i)&&(l=i.replace(Wt,`$1
47
- ${s},`)),l?(B(o),E(o,l,"utf8"),n.info(`Merged staged config into ${o}`),!0):(n.warn(`Could not auto-insert staged config into ${o} — please add manually`),!1)}const a=d(e,"vis.config.ts"),r=`import { defineConfig } from "@visulima/vis/config";
222
+ }`},"generatePolicySnippet"),hu=ie((e,t)=>{const r=[],n=Object.keys(t).length;return e.length>0&&r.push(`${String(e.length)} customType(s)`),n>0&&r.push(`${String(n)} bannedDep(s)`),r.join(" + ")},"summarizePolicyContents"),rj=ie((e,t,r,n={})=>{const s=hu(t,n);if(s==="")return!1;const o=Nt(e);if(o){const c=P(o);if(zS.test(c))return r.warn(`vis.config.ts already has a "policy" block — please merge ${s} manually.`),!1;const l=yo(t,n);let p;return jc.test(c)?p=c.replace(jc,`$1
223
+ ${l},`):Oc.test(c)&&(p=c.replace(Oc,`$1
224
+ ${l},`)),p?(re(o),ue(o,p,"utf8"),r.info(`Merged ${s} into ${o}`),!0):(r.warn(`Could not auto-insert policy block into ${o} — please add manually`),!1)}const i=y(e,"vis.config.ts"),a=`import { defineConfig } from "@visulima/vis/config";
48
225
 
49
226
  export default defineConfig({
50
- ${ot(t)},
227
+ ${yo(t,n)},
51
228
  });
52
- `;return E(a,r,"utf8"),n.info(`Created ${a} with staged config`),!0},"insertStagedIntoVisConfig"),al=N(e=>{const t=d(e,"package.json"),n={configRemoved:!1,dependencyRemoved:!1};if(!u(t))return n;const o=j(t),a=JSON.parse(o);let r=!1;a["nano-staged"]&&(delete a["nano-staged"],r=!0,n.configRemoved=!0);const i=a.devDependencies,s=a.dependencies;if(i?.["nano-staged"]&&(delete i["nano-staged"],r=!0,n.dependencyRemoved=!0),s?.["nano-staged"]&&(delete s["nano-staged"],r=!0,n.dependencyRemoved=!0),r){const l=mt(o);B(t),E(t,`${JSON.stringify(a,void 0,l)}
53
- `,"utf8")}return n},"removeNanoStagedFromPackageJson"),rl=N((e,t)=>{for(const n of ut){const o=d(e,n);u(o)&&(B(o,t),Fe(o),t.removedConfigCount+=1)}},"removeNanoStagedConfigFiles"),il=N((e,t)=>{const n=d(e,t,"pre-commit");if(!u(n))return!1;const o=j(n);if(o.includes("vis staged"))return!1;const a=o.split(`
54
- `);let r=!1;const i=[];for(const s of a){const l=s.trim();if(!r){let c=!1;for(const p of pi){const h=p.exec(l);if(h){const v=s.slice(0,s.length-s.trimStart().length),$=h[1]?.trim()??"",P=l.slice(h[0].length).trim(),R=[$,"vis staged",P].filter(Boolean);i.push(`${v}${R.join(" ")}`),r=!0,c=!0;break}}if(c)continue}i.push(s)}return r?(B(n),E(n,i.join(`
55
- `)),!0):!1},"rewritePreCommitHook"),sl=N((e,t,n)=>{if(t==="package.json")return tl(e);const o=d(e,t);if(!mn.includes(t)){D(n,`${t} cannot be auto-migrated — please add "staged" config to vis.config.ts manually`),F(n,`Manually convert ${t} to staged config in vis.config.ts`);return}if(t===".nanostagedrc"&&!Ue(o)){D(n,".nanostagedrc is not JSON format — please migrate manually");return}return nl(o)},"extractConfig"),Bn=N((e,t)=>{const{configRemoved:n,dependencyRemoved:o}=al(e);n&&(t.inlinedLintStagedConfigCount+=1),o&&(t.removedPackageCount+=1),rl(e,t)},"cleanupNanoStagedArtifacts"),ll=N((e,t,n,o)=>{const a=[".vis-hooks",".husky"];for(const r of a)u(d(e,r))&&il(e,r)&&(o.gitHooksConfigured=!0,t.silent||n.info(`Rewrote pre-commit hook in ${r}/ to use "vis staged"`))},"rewriteHooks"),cl=N((e,t,n,o,a)=>{ol(e,t,o)&&(a.mergedStagedConfigCount+=1),Bn(e,a),ll(e,n,o,a)},"applyMigration"),Ft=N((e,t,n,o)=>{const a=In(e);if(!a)return t.silent||n.info("No nano-staged configuration found — nothing to migrate."),!1;if(Zs(e)&&(D(o,'Non-JSON nano-staged config found — please migrate to "staged" in vis.config.ts manually'),F(o,"Convert your nano-staged config file to JSON format or add staged config to vis.config.ts manually")),el(e))return D(o,'vis.config.ts already has a "staged" config — skipping nano-staged merge'),t.silent||n.warn('vis.config.ts already has a "staged" config — skipping'),t.dryRun||Bn(e,o),!0;const r=sl(e,a,o);return!r||Object.keys(r).length===0?(t.silent||n.warn("nano-staged config is empty — skipping"),!1):t.dryRun?(t.silent||(n.info("[dry-run] Would insert staged config into vis.config.ts:"),n.info(ot(r))),!0):(cl(e,r,t,n,o),!0)},"migrateNanoStaged");var dl=Object.defineProperty,Vn=f((e,t)=>dl(e,"name",{value:t,configurable:!0}),"a$7");const pl=Vn(e=>{const t={};return e.namedInputs&&Object.keys(e.namedInputs).length>0&&(t.namedInputs=e.namedInputs),e.targetDefaults&&Object.keys(e.targetDefaults).length>0&&(t.targetDefaults=e.targetDefaults),["// Migrated from nx.json by `vis migrate nx`.","// Per-project project.json files are compatible with vis and do not need to be rewritten —","// vis already reads targets, tags, implicitDependencies, and sourceRoot.","",'import { defineConfig } from "@visulima/vis/config";',"",`export default defineConfig(${kt(t)});`,""].join(`
56
- `)},"renderVisConfig"),Lt=Vn((e,t,n,o)=>{const a=Rn(e,"nx.json");if(!a){n.warn("No nx.json found in workspace root — nothing to migrate."),o.warnings.push("No nx.json at workspace root.");return}const r=pl(a);bt(e,r,t,n,o)&&(o.manualSteps.push("Existing project.json files are vis-compatible and have been left untouched. Rename `sourceRoot` -> `sourceRoot` is identical; `tags`, `implicitDependencies`, and `targets` translate directly."),o.manualSteps.push("vis adds two task primitives nx doesn't expose declaratively: `when: { os, env, branch, ci, not.* }` for conditional execution (replaces ad-hoc `configurations`) and `always: true` for finally/teardown tasks that run even when upstream fails. See docs/guides/conditional-and-finally-tasks.mdx."),(a.affected?.defaultBase||a.defaultBase)&&o.manualSteps.push(`nx's default base branch (${a.affected?.defaultBase??a.defaultBase}) is honoured by vis via the --base flag; no vis config change needed.`))},"migrateNx");var ul=Object.defineProperty,Z=f((e,t)=>ul(e,"name",{value:t,configurable:!0}),"a$6");const An=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],En=[".secretlintignore"],Tn=Z(e=>An.find(t=>u(d(e,t))),"detectSecretlintConfig"),Dn=Z(e=>En.find(t=>u(d(e,t))),"detectSecretlintIgnore"),fl=Z((e,t,n)=>{if(t.endsWith(".js")||t.endsWith(".mjs")||t.endsWith(".cjs"))return D(n,`${t} is a JS config — cannot auto-extract rule IDs. Review manually to confirm coverage.`),[];if(t.endsWith(".yml")||t.endsWith(".yaml"))return D(n,`${t} is YAML — cannot auto-extract rule IDs without a YAML parser. Review manually.`),[];const o=J(d(e,t));if(!o)return[];const a=new Set,r=Z(i=>{if(i)for(const s of i)s.id&&a.add(s.id),s.rules&&r(s.rules)},"walk");return r(o.rules),[...a]},"extractRuleIds"),ml=Z((e,t,n,o)=>{for(const a of[...An,...En]){const r=d(e,a);if(u(r)){if(t){n.info(`[dry-run] Would remove ${r}`);continue}B(r,o),Fe(r),q(o,"secretlint","removedConfigCount"),n.info(`Removed ${r}`)}}},"removeSecretlintConfigFiles"),gl=Z((e,t,n,o)=>{const a=d(e,".secretlintignore");if(!u(a))return;const r=j(a).split(/\r?\n/).map(i=>i.trim()).filter(i=>i&&!i.startsWith("#"));r.length!==0&&(F(o,`.secretlintignore contained ${String(r.length)} path pattern(s). vis secrets uses .gitignore + --exclude / --exclude-from; add these globs to your .gitignore or pass --exclude: ${r.slice(0,5).join(", ")}${r.length>5?", ...":""}`),t&&n.info(`[dry-run] Would consume ${a} (${String(r.length)} patterns) and surface as manual step.`))},"convertIgnoreFile"),hl=Z((e,t,n,o)=>{const a=d(e,"package.json");if(!u(a))return;const r=J(a);if(!r)return;let i=!1;if(r.scripts){for(const[s,l]of Object.entries(r.scripts))if(typeof l=="string"&&/\bsecretlint\b/.test(l)){const c=l.replaceAll(/\bsecretlint\b[^\n&|;]*/g,"vis secrets").trim();c!==l&&(r.scripts[s]=c,i=!0,q(o,"secretlint","rewrittenScriptCount"),n.info(` scripts.${s}: "${l}" -> "${c}"`))}}if(r.devDependencies){const s=r.devDependencies,l=[];for(const c of Object.keys(s))(c==="secretlint"||c.startsWith("@secretlint/"))&&(delete s[c],l.push(c),i=!0,q(o,"secretlint","removedPackageCount"));l.length>0&&n.info(` removed ${String(l.length)} secretlint devDependencies: ${l.join(", ")}`)}if(i){if(t){n.info(`[dry-run] Would update ${a}`);return}B(a,o),A(a,`${JSON.stringify(r,null,4)}
57
- `)}},"rewriteScripts"),yl=Z((e,t,n,o)=>{const a=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"];for(const r of a){const i=d(e,r);if(!u(i))continue;const s=j(i);if(!/\bsecretlint\b/.test(s))continue;const l=s.replaceAll(/\bsecretlint\b[^\n&|;]*/g,"vis secrets --staged");if(t){n.info(`[dry-run] Would rewrite ${i}`);continue}B(i,o),A(i,l),o.gitHooksConfigured=!0,n.info(`Rewrote secretlint invocation in ${r}`)}},"rewriteHooks"),_t=Z((e,t,n,o)=>{const a=Tn(e),r=Dn(e);if(!(a??r))return t.silent||n.info("No secretlint artifacts found — nothing to migrate."),!1;if(a){const i=fl(e,a,o);n.info(`Found ${a}`),i.length>0?(n.info(` active rules/presets: ${i.join(", ")}`),F(o,`secretlint used these rules: ${i.join(", ")}. vis secrets ships the gitleaks ruleset (177 rules covering AWS/GCP/Azure/GitHub/Slack/Stripe and more). Verify parity before removing secretlint.`)):F(o,`Rule IDs could not be auto-extracted from ${a}. Verify that the bundled gitleaks ruleset covers your secretlint rule set.`)}return gl(e,t.dryRun,n,o),hl(e,t.dryRun,n,o),yl(e,t.dryRun,n,o),ml(e,t.dryRun,n,o),!0},"migrateSecretlint");var vl=Object.defineProperty,wt=f((e,t)=>vl(e,"name",{value:t,configurable:!0}),"u$4");const kl=wt(e=>e.map(t=>{if(t.startsWith("^"))return{dependencies:!0,target:t.slice(1)};if(t.includes("#")){const[n,o]=t.split("#");return{projects:n,target:o}}return t}),"convertDependsOn"),bl=wt(e=>{const t=e.tasks??e.pipeline??{},n={};for(const[r,i]of Object.entries(t)){if(r.includes("#"))continue;const s={};i.persistent&&(s.persistent=!0),i.interactive&&(s.interactive=!0);const l={};i.cache===!1&&(l.cache=!1),i.dependsOn&&i.dependsOn.length>0&&(l.dependsOn=kl(i.dependsOn)),i.inputs&&i.inputs.length>0&&(l.inputs=i.inputs),i.outputs&&i.outputs.length>0&&(l.outputs=i.outputs),i.env&&i.env.length>0&&(l.env=i.env),i.passThroughEnv&&i.passThroughEnv.length>0&&(l.passThroughEnv=i.passThroughEnv),Object.keys(s).length>0&&(l.options=s),n[r]=l}const o={};Object.keys(n).length>0&&(o.targetDefaults=n);const a={};return e.globalDependencies&&e.globalDependencies.length>0&&(a.globalInputs=e.globalDependencies),e.globalEnv&&e.globalEnv.length>0&&(a.globalEnv=e.globalEnv),e.globalPassThroughEnv&&e.globalPassThroughEnv.length>0&&(a.globalPassThroughEnv=e.globalPassThroughEnv),Object.keys(a).length>0&&(o.taskRunnerOptions=a),["// Migrated from turbo.json by `vis migrate turborepo`.","// Review the generated targetDefaults and move project-specific tasks","// into each project's project.json.","",'import { defineConfig } from "@visulima/vis/config";',"",`export default defineConfig(${kt(o)});`,""].join(`
58
- `)},"renderVisConfig"),zt=wt((e,t,n,o)=>{const a=Rn(e,"turbo.json");if(!a){n.warn("No turbo.json found in workspace root — nothing to migrate."),o.warnings.push("No turbo.json at workspace root.");return}const r=bl(a);if(!bt(e,r,t,n,o))return;o.manualSteps.push("Review targetDefaults in vis.config.ts project-specific tasks (turbo's project#task syntax) were skipped and should be moved into each project's project.json."),o.manualSteps.push("vis adds two task primitives turbo doesn't have: `when: { os, env, branch, ci, not.* }` for conditional execution and `always: true` for finally/teardown tasks that run even when upstream fails. See docs/guides/conditional-and-finally-tasks.mdx.");const i=a.tasks??a.pipeline??{};Object.values(i).some(s=>s.outputLogs!==void 0)&&o.warnings.push("`outputLogs` was found on one or more tasks but vis has no equivalent setting — review and remove."),a.remoteCache?.enabled&&o.manualSteps.push("turbo remote cache detected. vis speaks the same HTTP protocol — set taskRunnerOptions.remoteCache { url, token, teamId } in vis.config.ts.")},"migrateTurborepo");var wl=Object.defineProperty,w=f((e,t)=>wl(e,"name",{value:t,configurable:!0}),"n$a");const $l=/\b(?:husky|lint-staged|nano-staged)\b/,Sl=w(e=>{const t=d(e,"package.json");if(u(t))try{return JSON.parse(j(t))}catch{return}},"readPackageJson"),xl=w((e,t)=>{const n=Sl(e);if(!n)return!1;const o={...n.dependencies,...n.devDependencies};for(const r of hn)if(o[r])return!0;if(n.scripts){for(const r of Object.values(n.scripts))if(typeof r=="string"&&$l.test(r))return!0}const{overrides:a}=t;return a?Object.keys(a).length>0:!1},"detectDepsNeedsMigration"),jl=w(e=>u(d(e,"turbo.json")),"detectTurborepo"),Cl=w(e=>u(d(e,"nx.json")),"detectNx"),Ol=w(e=>u(d(e,".moon")),"detectMoon"),X=w(()=>{const e=[];return{lines:e,logger:{info:w(t=>{e.push(t)},"info"),warn:w(t=>{e.push(`⚠ ${t}`)},"warn")}}},"createCapturingLogger"),Pl=[{apply:w(({packageManager:e,root:t,visConfig:n},o,a)=>{It(t,e,n,{dryRun:!1},a,o)},"apply"),description:"Remove husky/lint-staged/nano-staged from package.json and rewrite scripts to `vis staged`.",detect:w(({root:e,visConfig:t})=>xl(e,t),"detect"),id:"deps",probe:w(({packageManager:e,root:t,visConfig:n})=>{const{lines:o,logger:a}=X(),r=H();return It(t,e,n,{dryRun:!0},a,r),o},"probe"),title:"Dependencies & scripts"},{apply:w(({root:e},t,n)=>{Dt(e,{dryRun:!1},n,t)},"apply"),description:"Inline lint-staged configuration into vis.config.ts.",detect:w(({root:e})=>!!On(e),"detect"),id:"lint-staged",probe:w(({root:e})=>{const{lines:t,logger:n}=X(),o=H();return Dt(e,{dryRun:!0},n,o),t},"probe"),title:"lint-staged"},{apply:w(({root:e},t,n)=>{Ft(e,{dryRun:!1},n,t)},"apply"),description:"Inline nano-staged configuration into vis.config.ts.",detect:w(({root:e})=>!!In(e),"detect"),id:"nano-staged",probe:w(({root:e})=>{const{lines:t,logger:n}=X(),o=H();return Ft(e,{dryRun:!0},n,o),t},"probe"),title:"nano-staged"},{apply:w(({root:e},t,n)=>{zt(e,{dryRun:!1},n,t)},"apply"),description:"Translate turbo.json tasks into vis.config.ts.",detect:w(({root:e})=>jl(e),"detect"),id:"turborepo",probe:w(({root:e})=>{const{lines:t,logger:n}=X(),o=H();return zt(e,{dryRun:!0},n,o),t},"probe"),title:"Turborepo"},{apply:w(({root:e},t,n)=>{Lt(e,{dryRun:!1},n,t)},"apply"),description:"Translate nx.json targets into vis.config.ts.",detect:w(({root:e})=>Cl(e),"detect"),id:"nx",probe:w(({root:e})=>{const{lines:t,logger:n}=X(),o=H();return Lt(e,{dryRun:!0},n,o),t},"probe"),title:"Nx"},{apply:w(({root:e},t,n)=>{Mt(e,{copyTemplates:!1,dryRun:!1},n,t)},"apply"),description:"Translate .moon/tasks.yml into vis.config.ts.",detect:w(({root:e})=>Ol(e),"detect"),id:"moon",probe:w(({root:e})=>{const{lines:t,logger:n}=X(),o=H();return Mt(e,{copyTemplates:!1,dryRun:!0},n,o),t},"probe"),title:"Moon"},{apply:w(({root:e},t,n)=>{Bt(e,{dryRun:!1},n,t)},"apply"),description:"Convert gitleaks config/baseline/hooks to `vis secrets`.",detect:w(({root:e})=>!!(Ge(e)??gt(e)??ht(e)),"detect"),id:"gitleaks",probe:w(({root:e})=>{const{lines:t,logger:n}=X(),o=H();return Bt(e,{dryRun:!0},n,o),t},"probe"),title:"Gitleaks"},{apply:w(({root:e},t,n)=>{At(e,{dryRun:!1},n,t)},"apply"),description:"Convert Kingfisher baseline/rules/hooks to `vis secrets`.",detect:w(({root:e})=>!!(yt(e)??He(e)),"detect"),id:"kingfisher",probe:w(({root:e})=>{const{lines:t,logger:n}=X(),o=H();return At(e,{dryRun:!0},n,o),t},"probe"),title:"Kingfisher"},{apply:w(({root:e},t,n)=>{_t(e,{dryRun:!1},n,t)},"apply"),description:"Replace secretlint config/hooks with `vis secrets`.",detect:w(({root:e})=>!!(Tn(e)??Dn(e)),"detect"),id:"secretlint",probe:w(({root:e})=>{const{lines:t,logger:n}=X(),o=H();return _t(e,{dryRun:!0},n,o),t},"probe"),title:"Secretlint"}],Rl=w(e=>Pl.filter(t=>t.detect(e)),"getApplicableMigrations"),Il=w((e,t)=>({packageManager:vn(e),root:e,visConfig:t}),"buildProbeContext");var Bl=Object.defineProperty,Vl=f((e,t)=>Bl(e,"name",{value:t,configurable:!0}),"s$4");const Al=Vl((e,t)=>{t.info("── Migration Summary ──");const n=[["Staged configs merged into vis.config.ts",e.mergedStagedConfigCount],["Lint-staged configs inlined",e.inlinedLintStagedConfigCount],["Config files removed",e.removedConfigCount],["Packages removed",e.removedPackageCount],["Scripts rewritten",e.rewrittenScriptCount]];for(const[a,r]of n)r>0&&t.info(` ${a}: ${String(r)}`);e.gitHooksConfigured&&t.info(" Pre-commit hook updated to use vis staged");const o=Object.entries(e.perMigration);if(o.length>0){t.info(""),t.info("By migration:");for(const[a,r]of o){const i=[];r.removedConfigCount>0&&i.push(`${String(r.removedConfigCount)} config(s) removed`),r.removedPackageCount>0&&i.push(`${String(r.removedPackageCount)} package(s) removed`),r.rewrittenScriptCount>0&&i.push(`${String(r.rewrittenScriptCount)} script(s) rewritten`),t.info(` ${a}: ${i.join(", ")||"no changes"}`)}}if(e.backupsCreated.length>0&&(t.info(""),t.info(`Created ${String(e.backupsCreated.length)} .bak file(s) for rollback. Remove them once you're happy.`)),e.warnings.length>0){t.info(""),t.warn("Warnings:");for(const a of e.warnings)t.warn(` - ${a}`)}if(e.manualSteps.length>0){t.info(""),t.info("Manual steps required:");for(const a of e.manualSteps)t.info(` - ${a}`)}},"printSummary");var El=Object.defineProperty,Mn=f((e,t)=>El(e,"name",{value:t,configurable:!0}),"c$3");const Tl=Mn((e,t)=>{if(e.length===0){t.info("No applicable migrations detected in this workspace.");return}t.info(`Detected migrations (non-interactive preview):
59
- `);for(const n of e){t.info(` • ${n.entry.title} — ${n.entry.description}`);for(const o of n.preview)t.info(` ${o}`);t.info("")}t.info("Run a specific migration with `vis migrate <name>` (e.g. `vis migrate deps`).")},"renderFallbackTable"),Dl=Mn(async e=>{const t=e.workspaceRoot??process.cwd(),n=e.visConfig??{},o=Il(t,n),a=Rl(o).map(h=>({entry:h,preview:h.probe(o)}));if(!(process.stdout.isTTY&&!ue)){Tl(a,e.logger);return}if(a.length===0){e.logger.info("No applicable migrations detected in this workspace.");return}const r=new Hr(a),i=n.tui?.autoExit??!1,s=i===!0?3:typeof i=="number"?i:0,l=await ro(io.createElement(si,{autoExitSeconds:s,isDryRun:!1,store:r}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit();if(!l||l.length===0){e.logger.info("No migrations selected — exiting.");return}const c=H(),p=[];for(const h of l)try{e.logger.info(`── Applying ${h.entry.title} ──`),h.entry.apply(o,c,e.logger),e.logger.info("")}catch(v){p.push({entry:h.entry,error:v}),e.logger.warn(`Failed to apply ${h.entry.title}: ${v.message}`)}Al(c,e.logger),p.length>0&&(e.logger.warn(""),e.logger.warn(`${String(p.length)} migration(s) failed — see messages above.`),process.exitCode=1)},"runMigrateInteractive");var Ml=Object.defineProperty,Nl=f((e,t)=>Ml(e,"name",{value:t,configurable:!0}),"e$f");const Wl={description:"Analyze and optimize dependencies using e18e replacements and @socketregistry overrides",examples:[["vis optimize","Interactive TUI to select and apply optimizations"],["vis optimize --dry-run","Preview available optimizations"],["vis optimize --pin","Pin Socket.dev overrides to exact versions"],["vis optimize --prod","Only optimize production dependencies"]],group:"Workspace",loader:Nl(()=>import("./handler39.js").then(e=>e.h),"loader"),name:"optimize",options:[{alias:"d",defaultValue:!1,description:"Preview available optimizations without applying",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Pin Socket.dev overrides to exact versions",name:"pin",type:Boolean},{defaultValue:!1,description:"Only optimize production dependencies",name:"prod",type:Boolean},{defaultValue:!1,description:"Skip running install after applying overrides",name:"no-install",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var Fl=Object.defineProperty,Ll=f((e,t)=>Fl(e,"name",{value:t,configurable:!0}),"e$e");const _l={argument:{description:"Subcommand and arguments (e.g., cache dir, publish --dry-run, list --depth 0)",name:"args",type:String},description:"Package manager utilities (cache, publish, audit, list, config, etc.)",examples:[["vis pm cache dir","Show cache directory"],["vis pm cache clean","Clean cache"],["vis pm publish --dry-run","Preview publishing"],["vis pm list --depth 0","List direct dependencies"],["vis pm audit","Run security audit"],["vis pm whoami","Show logged-in user"]],group:"System",loader:Ll(()=>import("./handler20.js"),"loader"),name:"pm"};var zl=Object.defineProperty,Ul=f((e,t)=>zl(e,"name",{value:t,configurable:!0}),"e$d");const Jl={alias:["rm","un","uninstall"],argument:{description:"Packages to remove",name:"packages",type:String},description:"Remove packages using the detected package manager",examples:[["vis remove lodash","Remove a package"],["vis rm old-package","Remove using alias"],["vis remove --filter app react","Remove from specific workspace"],["vis remove -g typescript","Remove global package"]],group:"Dependencies",loader:Ul(()=>import("./handler21.js"),"loader"),name:"remove",options:[{alias:"D",defaultValue:!1,description:"Remove from devDependencies",name:"save-dev",type:Boolean},{alias:"g",defaultValue:!1,description:"Remove global package",name:"global",type:Boolean},{alias:"r",defaultValue:!1,description:"Remove from all workspace packages",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Remove from workspace root",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String}]};var Gl=Object.defineProperty,Hl=f((e,t)=>Gl(e,"name",{value:t,configurable:!0}),"e$c");const ql={argument:{description:"The target to run (e.g., build, test, lint)",name:"target",type:String},description:"Run a target across workspace projects",examples:[["vis run","List all available targets"],["vis run build","Run build on all projects"],["vis run :build","Run build on all projects (moon-style)"],["vis run ~:test","Run test on the project closest to the current directory"],['vis run "#frontend:build"',"Run build on projects tagged 'frontend'"],['vis run :build --query "language=typescript"',"Filter by project metadata"],["vis run test --affected","Run test only on git-changed projects"],["vis run build --fail-fast","Stop on first failure"],["vis run build --dry-run","Show execution plan without running"]],group:"Run & Execute",loader:Hl(()=>import("./handler43.js"),"loader"),name:"run",options:[{alias:"p",description:"Comma-separated list of projects to run",name:"projects",type:String},{defaultValue:!1,description:"Skip the toolchain pre-flight (no auto-install for any pinned tool: node / pnpm / yarn / npm / bun / deno / go / python / ruby / rust)",name:"skip-toolchain",type:Boolean},{defaultValue:3,description:"Maximum number of parallel tasks (falls back to VIS_RUN_CONCURRENCY_LIMIT env var, then 3)",name:"parallel",type:Number},{defaultValue:!0,description:"Enable caching (use --no-cache to disable)",name:"cache",type:Boolean},{description:"Custom cache directory",name:"cache-dir",type:String},{defaultValue:!1,description:"Show what would run without executing",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Generate a run summary after execution",name:"summarize",type:Boolean},{description:'Partition tasks for distributed CI (e.g., "1/4" for first of four runners). Falls back to VIS_PARTITION env var.',name:"partition",type:String},{defaultValue:!1,description:"Skip project constraint validation",name:"skip-constraints",type:Boolean},{description:"Filter matched projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String},{defaultValue:!1,description:"Only run on projects affected by git changes (shorthand for vis affected)",name:"affected",type:Boolean},{defaultValue:!1,description:"Rerun affected tasks on file change. Ctrl+C to exit.",name:"watch",type:Boolean},{defaultValue:!1,description:"Stop all tasks on first failure",name:"fail-fast",type:Boolean},{description:"Output mode: interleaved (pass-through), labeled (prefix each line with [pkg#task]), or grouped (vite-task-style block)",name:"log",type:String},{description:"Output style: normal (print every task) or quiet (skip output for successful/cached tasks; failed tasks still print in CI mode, and remain in TUI scrollback in interactive mode). Per-target options.outputStyle overrides this.",name:"output-style",type:String},{defaultValue:!1,description:"Run every task through a pseudo-terminal so color-aware tools render as if attached to a TTY (disables caching)",name:"pty",type:Boolean},{description:"Global retry budget: cap on total task retries across the run (per-target retryCount is still honored up to the budget)",name:"retry-budget",type:Number},{description:"Write a Chrome Tracing JSON profile of the run to this path (open in chrome://tracing or Perfetto)",name:"profile",type:String},{defaultValue:!1,description:"Render the most-recent run's saved summary (from .task-runner/last-summary.json) and exit without executing any tasks",name:"last-details",type:Boolean},{defaultValue:!0,description:"Show flaky task report on failure (use --no-flaky to suppress)",name:"flaky",type:Boolean}]};var Kl=Object.defineProperty,Yl=f((e,t)=>Kl(e,"name",{value:t,configurable:!0}),"e$b");const Ql={description:"Generate a CycloneDX 1.6 Software Bill of Materials for the workspace",examples:[["vis sbom","Write the full-workspace SBOM to sbom.cdx.json"],["vis sbom --focus=my-app","Scope the SBOM to my-app's transitive closure"],["vis sbom --focus=my-app,other","Focus multiple projects"],["vis sbom --format=xml --output=sbom.cdx.xml","Emit XML instead of JSON"],["vis sbom --include-dev","Include devDependencies (default: production only)"],["vis sbom --output=-","Write to stdout"]],group:"Security & Health",loader:Yl(()=>import("./handler40.js"),"loader"),name:"sbom",options:[{description:"Project name(s) to focus on — comma-separated for multiple",name:"focus",type:String},{defaultValue:"json",description:"Output format: json (default) or xml",name:"format",type:String},{description:"Output path (use '-' for stdout; default: sbom.cdx.json)",name:"output",type:String},{defaultValue:!1,description:"Include devDependencies (default: production only)",name:"include-dev",type:Boolean}]};var Xl=Object.defineProperty,Zl=f((e,t)=>Xl(e,"name",{value:t,configurable:!0}),"e$a");const ec={argument:{description:"One or more paths to scan (defaults to workspace root)",name:"paths",type:String},description:"Scan a repository for hardcoded secrets and credentials",examples:[["vis secrets","Scan the workspace with grouped, colourised output"],["vis secrets --staged","Scan only files staged for the current commit (pre-commit hooks)"],["vis secrets --since main","Scan only files changed since the `main` branch"],["vis secrets --affected","Scan only projects affected by the current branch"],["vis secrets --init","Write an initial baseline from current findings"],["vis secrets --list-rules","Print all bundled detection rules"],["vis secrets --list-validators","Print non-HTTP validator types in the ruleset + install hints for each"],["vis secrets --exclude-rule generic-api-key --exclude-rule aws-access-token","Drop noisy rules"],["vis secrets --include-rule stripe-access-token","Check a single rule"],["vis secrets --enable-rule tag:preset:weak-passwords","Enable an opt-in rule group additively (defaults still fire)"],["vis secrets --include-rule tag:preset:password-manager","Restrict output to one opt-in group only"],["vis secrets --min-confidence high","Drop rules without a high confidence label (CI-friendly precision filter)"],["vis secrets --validate --only-verified","Live-verify each finding against its provider (one HTTP call per finding)"],["vis secrets --exclude 'dist/**' --exclude-from .secretsignore","Extra gitignore-syntax exclusions for the walker"],["vis secrets --config ./leaks.json --no-extend-bundled","Use only the supplied config, skip the bundled ruleset"],["vis secrets --concurrency 4","Cap the rayon thread pool (0 / omit = auto)"],["vis secrets --baseline .secrets-baseline.json","Suppress known findings; print diff vs. baseline"],["vis secrets --update-baseline","Merge current findings into the baseline (use --replace-baseline to overwrite)"],["vis secrets --format sarif > report.sarif","SARIF output for GitHub code-scanning"]],group:"Security",loader:Zl(()=>import("./handler37.js"),"loader"),name:"secrets",options:[{description:"Path to a JSON config (gitleaks-compatible shape). Defaults to the bundled ruleset.",name:"config",type:String},{description:"Drop rules below this author-declared confidence: low (default), medium, high. Rules without a declared confidence (every gitleaks rule) are treated as low, so --min-confidence medium or higher drops them along with explicit low-confidence rules.",name:"min-confidence",type:String},{defaultValue:!1,description:"Live-verify each finding against its provider (one HTTP call per finding, max 8 concurrent). Only supports Kingfisher-style HTTP validators with StatusMatch / WordMatch response matchers; other types (gRPC, multi-step, checksum) mark the finding as validation=skipped. WARNING: sends candidate secrets to the provider — some providers alert their security team on failed auth attempts.",name:"validate",type:Boolean},{defaultValue:!1,description:"With --validate, drop every finding whose validation is not 'verified'. Useful for CI gating.",name:"only-verified",type:Boolean},{defaultValue:!1,description:"With --config, do not merge on top of the bundled ruleset — replace it.",name:"no-extend-bundled",type:Boolean},{defaultValue:"text",description:"Output format: text (default), json, sarif",name:"format",type:String},{description:"Path to a baseline JSON of previously-triaged findings",name:"baseline",type:String},{defaultValue:!1,description:"Scan only files staged for commit",name:"staged",type:Boolean},{description:"Scan only files changed since <ref> (e.g. main, origin/HEAD)",name:"since",type:String},{defaultValue:!1,description:"Scan only projects affected by the current branch",name:"affected",type:Boolean},{description:"Enable an opt-in rule or tag without restricting output — additive (e.g. tag:preset:weak-passwords, tag:preset:password-manager). Repeatable.",multiple:!0,name:"enable-rule",type:String},{description:"Rule id or tag:<name> selector — whitelist, only matching findings are emitted. Implies enablement. Repeatable.",multiple:!0,name:"include-rule",type:String},{description:"Rule id or tag:<name> selector — drop matching findings. Repeatable.",multiple:!0,name:"exclude-rule",type:String},{description:"Gitignore-syntax pattern to exclude from the walk (repeatable)",multiple:!0,name:"exclude",type:String},{description:"Path to a gitignore-shaped file the walker should honor (repeatable)",multiple:!0,name:"exclude-from",type:String},{defaultValue:!1,description:"Mask secret values in output",name:"redact",type:Boolean},{defaultValue:!1,description:"Scan dotfiles",name:"include-hidden",type:Boolean},{defaultValue:!1,description:"Do not respect .gitignore",name:"no-gitignore",type:Boolean},{description:"Skip files larger than this (bytes). Default: 10 MiB",name:"max-size",type:Number},{description:"Rayon worker threads (0 / omit = auto)",name:"concurrency",type:Number},{defaultValue:!1,description:"Merge current findings into the baseline and exit 0",name:"update-baseline",type:Boolean},{defaultValue:!1,description:"With --update-baseline, replace rather than merge",name:"replace-baseline",type:Boolean},{defaultValue:!1,description:"Scaffold a baseline from current findings",name:"init",type:Boolean},{defaultValue:!1,description:"With --init, preview the baseline without writing files",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Print all bundled detection rules and exit",name:"list-rules",type:Boolean},{defaultValue:!1,description:"Print non-HTTP validator types referenced by the current ruleset, with install hints for their optional peer dependencies.",name:"list-validators",type:Boolean},{defaultValue:!1,description:"Suppress all progress output (only emit findings)",name:"quiet",type:Boolean},{defaultValue:!1,description:"Print diagnostic info (skipped rules, etc.)",name:"verbose",type:Boolean}]};var tc=Object.defineProperty,nc=f((e,t)=>tc(e,"name",{value:t,configurable:!0}),"e$9");const oc={description:"Sort package.json files across the workspace using the sort-package-json Rust crate",examples:[["vis sort-package-json","Sort all package.json files in the workspace"],["vis sort-package-json --check","Check if files are already sorted (exit 1 if not)"],["vis sort-package-json --sort-scripts","Also sort the scripts field alphabetically"],["vis sort-package-json --indent 4","Force 4-space indentation (overrides per-file detection)"],["vis sort-package-json --indent tab","Force tab indentation"],["vis sort-package-json --ignore '**/fixtures/**'","Skip files matching one or more glob patterns"],["vis sort-package-json --sort-order name,version,license","Pin a custom prefix order before the default field order"],["vis sort-package-json --unsorted dependencies,devDependencies","Preserve original key order for the listed top-level sections"],["vis sort-package-json --no-final-newline","Do not append a trailing newline"],["vis sort-package-json --line-ending crlf","Force CRLF line endings (default: auto-detect per file)"]],group:"Workspace",loader:nc(()=>import("./handler22.js"),"loader"),name:"sort-package-json",options:[{alias:"c",defaultValue:!1,description:"Check if package.json files are sorted without writing (exits 1 if unsorted)",name:"check",type:Boolean},{defaultValue:!1,description:"Also sort the scripts field alphabetically",name:"sort-scripts",type:Boolean},{description:"Indent override: a number of spaces, the literal `tab`, or a literal whitespace string. When unset, the original file's indent is preserved.",name:"indent",type:String},{description:"Glob pattern of files to skip (basename match, or path-relative when the pattern contains `/`). Repeatable.",multiple:!0,name:"ignore",type:String},{description:"Comma-separated list of top-level keys to place first, before the default field order. Repeatable.",multiple:!0,name:"sort-order",type:String},{description:"Comma-separated list of top-level sections whose key order should be preserved (e.g. dependencies,devDependencies). Repeatable.",multiple:!0,name:"unsorted",type:String},{defaultValue:!1,description:"Do not append a trailing newline to the output (default: append one).",name:"no-final-newline",type:Boolean},{defaultValue:"auto",description:"Line ending to write: auto (per-file detection, default), lf, or crlf.",name:"line-ending",type:String}]};var ac=Object.defineProperty,rc=f((e,t)=>ac(e,"name",{value:t,configurable:!0}),"e$8");const ic={description:"Run linters on staged files using config from vis.config.ts",examples:[["vis staged","Run staged linters"],["vis staged --verbose","Run with verbose output"],["vis staged --no-stash","Run without backup stash"],["vis staged --diff HEAD~1","Run against a specific diff"]],group:"Run & Execute",loader:rc(()=>import("./handler45.js"),"loader"),name:"staged",options:[{defaultValue:!1,description:"Allow empty commits when tasks revert all staged changes",name:"allow-empty",type:Boolean},{defaultValue:!1,description:"Automatically stage new files that tasks create during the run",name:"auto-stage",type:Boolean},{description:"Number of concurrent tasks or false for serial",name:"concurrent",type:String},{defaultValue:!1,description:"Run all tasks to completion even if one fails",name:"continue-on-error",type:Boolean},{description:"Working directory to run all tasks in",name:"cwd",type:String},{defaultValue:!1,description:"Enable debug output",name:"debug",type:Boolean},{description:"Override the default --staged flag of git diff",name:"diff",type:String},{description:"Override the default diff-filter",name:"diff-filter",type:String},{defaultValue:!1,description:"Fail with exit code 1 when tasks modify tracked files",name:"fail-on-changes",type:Boolean},{defaultValue:!1,description:"Kill in-flight tasks with SIGKILL on fast-fail instead of the default SIGTERM",name:"force-kill",type:Boolean},{defaultValue:!1,description:"Hide unstaged changes from partially staged files",name:"hide-partially-staged",type:Boolean},{defaultValue:!1,description:"Hide all unstaged changes before running tasks",name:"hide-unstaged",type:Boolean},{defaultValue:!1,description:"Suppress console output",name:"quiet",type:Boolean},{defaultValue:!1,description:"Pass filepaths relative to cwd to tasks",name:"relative",type:Boolean},{defaultValue:!1,description:"Revert to original state in case of errors",name:"revert",type:Boolean},{defaultValue:!0,description:"Enable backup stash",name:"stash",type:Boolean},{defaultValue:!1,description:"Show task output even when tasks succeed",name:"verbose",type:Boolean}]};var sc=Object.defineProperty,lc=f((e,t)=>sc(e,"name",{value:t,configurable:!0}),"t$4");const cc={description:"Show a workspace health dashboard at a glance",examples:[["vis status","Full status overview"],["vis status --json","Machine-readable output"]],group:"Workspace",loader:lc(()=>import("./handler23.js"),"loader"),name:"status",options:[{defaultValue:!1,description:"Emit JSON output",name:"json",type:Boolean}]};var dc=Object.defineProperty,pc=f((e,t)=>dc(e,"name",{value:t,configurable:!0}),"e$7");const uc={argument:{description:"What to sync: codeowners",name:"kind",type:String},description:"Synchronise derived workspace artefacts (codeowners, tsconfig refs, …)",examples:[["vis sync codeowners","Generate CODEOWNERS at the repository root"],["vis sync codeowners --out=.github/CODEOWNERS","Write to .github/CODEOWNERS instead"],["vis sync codeowners --check","Fail if the existing file is stale"]],group:"Workspace",loader:pc(()=>import("./handler32.js"),"loader"),name:"sync",options:[{description:"Output path for the generated file (default: <workspace>/CODEOWNERS)",name:"out",type:String},{defaultValue:!1,description:"Verify the existing file is up to date (exit non-zero if stale)",name:"check",type:Boolean}]};var fc=Object.defineProperty,mc=f((e,t)=>fc(e,"name",{value:t,configurable:!0}),"t$3");const gc={argument:{description:"Task ID to explain (e.g. @my/app:build)",name:"taskId",type:String},description:"Explain why a task is included in the graph by walking its dependency chain to a root",examples:[["vis task-why @myorg/app:build","Show what pulls build in"],["vis task-why lib-a:test","Check the test task's triggers"]],group:"Workspace",loader:mc(()=>import("./handler24.js"),"loader"),name:"task-why"};var hc=Object.defineProperty,yc=f((e,t)=>hc(e,"name",{value:t,configurable:!0}),"e$6");const vc={argument:{description:"Subcommand: status | detect | install | use | which",name:"action",type:String},description:"Inspect and delegate to the workspace version managers (proto, mise, fnm, volta, asdf, nvm, corepack)",examples:[["vis toolchain status","Show every detected manager + expected vs actual tool versions"],["vis toolchain install","Install pinned versions — per-tool delegation"],["vis toolchain use node@22.13.0","Pin node 22.13.0 via the best runtime manager"],["vis toolchain use pnpm@10.32.1","Update the packageManager field; pnpm self-activates"],["vis toolchain which node","Resolve the node binary the manager would launch"],["vis toolchain detect","Print the primary manager's name"]],group:"Workspace",loader:yc(()=>import("./handler25.js"),"loader"),name:"toolchain",options:[{defaultValue:!1,description:"With `status`: exit 1 if any tool mismatches",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Print the command that would run, but don't execute",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Emit JSON (status subcommand only)",name:"json",type:Boolean},{defaultValue:!0,description:"With `use`: also mirror the version into engines.<tool> when that field already exists. --no-engines to skip.",name:"engines",type:Boolean}]};var kc=Object.defineProperty,bc=f((e,t)=>kc(e,"name",{value:t,configurable:!0}),"e$5");const wc={argument:{description:"Packages to unlink (omit for current package)",name:"packages",type:String},description:"Unlink a previously linked package",examples:[["vis unlink","Unlink current package"],["vis unlink react","Unlink specific package"],["vis unlink -r","Unlink in all workspace packages"]],group:"Dependencies",loader:bc(()=>import("./handler26.js"),"loader"),name:"unlink",options:[{alias:"r",defaultValue:!1,description:"Unlink in all workspace packages",name:"recursive",type:Boolean}]};var $c=Object.defineProperty,Sc=f((e,t)=>$c(e,"name",{value:t,configurable:!0}),"e$4");const xc={alias:"up",argument:{description:"Packages to update (updates all if omitted)",name:"packages",type:String},description:"Update packages to their latest versions",examples:[["vis update react","Update react within semver range"],["vis up react -L","Update react to latest"],["vis update -i","Interactive mode"],["vis update --filter app","Update in specific workspace"],["vis update -r","Update in all workspaces"],["vis update --target minor","Only apply minor/patch updates (catalog mode)"],["vis update --dry-run","Preview changes without applying"],["vis update --exclude '@types/*'","Exclude packages by pattern"],["vis update --changelog","Show changelog links after updating"],["vis update --rollback","Restore catalog from last backup"],["vis update --ai","Run AI analysis before applying updates"]],group:"Dependencies",loader:Sc(()=>import("./handler33.js"),"loader"),name:"update",options:[{alias:"L",defaultValue:!1,description:"Update to latest version (ignore semver range)",name:"latest",type:Boolean},{alias:"t",description:"Update target: latest, minor, or patch (default: latest, catalog mode)",name:"target",type:String},{alias:"d",defaultValue:!1,description:"Preview changes without applying",name:"dry-run",type:Boolean},{alias:"g",defaultValue:!1,description:"Update global packages",name:"global",type:Boolean},{alias:"r",defaultValue:!1,description:"Update recursively in all workspace packages",name:"recursive",type:Boolean},{description:"Filter packages in monorepo",name:"filter",type:String},{alias:"w",defaultValue:!1,description:"Include workspace root",name:"workspace-root",type:Boolean},{alias:"D",defaultValue:!1,description:"Update only devDependencies",name:"dev",type:Boolean},{alias:"P",defaultValue:!1,description:"Update only dependencies",name:"prod",type:Boolean},{alias:"i",defaultValue:!1,description:"Interactive mode",name:"interactive",type:Boolean},{defaultValue:!1,description:"Don't update optionalDependencies",name:"no-optional",type:Boolean},{alias:"l",defaultValue:!1,description:"Include packages with pinned/exact versions (no ^ or ~ prefix)",name:"include-locked",type:Boolean},{defaultValue:!1,description:"Update lockfile only",name:"no-save",type:Boolean},{description:"Glob pattern to include packages (repeatable, catalog mode)",lazyMultiple:!0,name:"include",type:String},{description:"Glob pattern to exclude packages (repeatable, catalog mode)",lazyMultiple:!0,name:"exclude",type:String},{defaultValue:!1,description:"Include prerelease versions (catalog mode)",name:"prerelease",type:Boolean},{defaultValue:!1,description:"Check for known security vulnerabilities (via OSV.dev)",name:"security",type:Boolean},{defaultValue:!1,description:"Skip catalog mode, use package manager directly",name:"no-catalog",type:Boolean},{description:"Output format: table, json, or minimal (default: table)",name:"format",type:String},{defaultValue:!1,description:"Show changelog URLs for updated packages",name:"changelog",type:Boolean},{description:"Run install after catalog update, --no-install to skip (default: true)",name:"install",type:Boolean},{defaultValue:!1,description:"Restore catalog file from the last backup",name:"rollback",type:Boolean},{defaultValue:!1,description:"Run AI analysis on outdated packages before updating (catalog mode)",name:"ai",type:Boolean},{description:"AI analysis type: impact, security, compatibility, or recommend (default: impact)",name:"ai-type",type:String},{defaultValue:!1,description:"Skip typosquat name check for package arguments",name:"no-typosquat-check",type:Boolean}]};var jc=Object.defineProperty,Cc=f((e,t)=>jc(e,"name",{value:t,configurable:!0}),"e$3");const Oc={argument:{description:"Target version (defaults to latest)",name:"version",type:String},description:"Update vis itself to the latest version",examples:[["vis self-update","Update to latest"],["vis self-update 2.0.0","Install specific version"],["vis self-update --check","Check for updates without installing"]],group:"System",loader:Cc(()=>import("./handler27.js"),"loader"),name:"self-update",options:[{defaultValue:!1,description:"Check for updates without installing",name:"check",type:Boolean},{defaultValue:!1,description:"Reinstall even if already current",name:"force",type:Boolean},{defaultValue:!1,description:"Suppress output (CI mode)",name:"silent",type:Boolean}]};var Pc=Object.defineProperty,Rc=f((e,t)=>Pc(e,"name",{value:t,configurable:!0}),"e$2");const Ic={alias:"explain",argument:{description:"Package(s) to explain",name:"packages",type:String},description:"Show why a package is installed (dependency chain)",examples:[["vis why react","Show why react is installed"],["vis why react --json","Output as JSON"],["vis why react -r","Check across all workspaces"],["vis explain react","Alias matching npm's command"]],group:"Dependencies",loader:Rc(()=>import("./handler28.js"),"loader"),name:"why",options:[{defaultValue:!1,description:"Output as JSON",name:"json",type:Boolean},{defaultValue:!1,description:"Show extended information (pnpm)",name:"long",type:Boolean},{defaultValue:!1,description:"Machine-readable output (pnpm)",name:"parseable",type:Boolean},{alias:"r",defaultValue:!1,description:"Check across all workspaces",name:"recursive",type:Boolean},{alias:"D",defaultValue:!1,description:"Filter to dev dependencies (pnpm)",name:"dev",type:Boolean},{alias:"P",defaultValue:!1,description:"Filter to production dependencies (pnpm)",name:"prod",type:Boolean},{defaultValue:!1,description:"Exclude optional dependencies (pnpm)",name:"no-optional",type:Boolean},{alias:"g",defaultValue:!1,description:"Check globally installed packages (pnpm)",name:"global",type:Boolean},{description:"Limit dependency tree depth",name:"depth",type:Number},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String}]};var Bc=Object.defineProperty,qe=f((e,t)=>Bc(e,"name",{value:t,configurable:!0}),"e$1");qe((e,t)=>!process.stderr.isTTY||process.env.TERM==="dumb"?e===t?t:`${e} (${De(t)})`:mo(e,t),"link");const Vc=qe(()=>{if(process.env.VIS_VERSION)return process.env.VIS_VERSION;try{const e=new URL("../../package.json",import.meta.url);return U(e).version}catch{return"0.0.0"}},"getVersion"),Ac=qe(()=>{process.env.VIS_VERSION=Vc()},"injectVersion"),Ec=qe(e=>{!process.stdout.isTTY||ue||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${e}\x07`)},"setTerminalTitle");var Tc=Object.defineProperty,Dc=f((e,t)=>Tc(e,"name",{value:t,configurable:!0}),"m$3");const Mc={beforeCommand:Dc(async e=>{try{const t=e.options?.cwd;let n;if(t)n=ho(process.cwd(),t);else{const r=process.env.VIS_MONOREPO_ROOT;n=r&&r.length>0?r:Xt(process.cwd()).path}e.workspaceRoot=n;let o=Ae(n);try{e.visConfig=await jt(n);const r=e.visConfig?.versionConstraint;if(r&&!ko(r)){e.logger.error(""),e.logger.error(Xe(oe("✖ Invalid versionConstraint"))),e.logger.error(` vis.config.ts has versionConstraint ${oe(JSON.stringify(r))}, which is not a valid semver range.`),e.logger.error(""),process.exitCode=1;return}if(r&&!bo(Ne.version,r)){e.logger.error(""),e.logger.error(Xe(oe("✖ vis version too old"))),e.logger.error(` vis.config.ts requires vis ${oe(r)}, but the current version is ${oe(Ne.version)}.`),e.logger.error(` ${Re("→")} Upgrade: ${pe("pnpm add -D @visulima/vis@latest")}`),e.logger.error(""),process.exitCode=1;return}}catch(r){const i=o,s=r instanceof Error?r.message:String(r);e.visConfigError={file:i??void 0,message:s};const l=!!process.stdout.isTTY&&!ue;if(i&&!l){if(e.logger.error(""),e.logger.error(Xe(oe(`✖ Failed to load ${i}`))),e.logger.error(` ${s}`),e.logger.error(""),s.includes("Cannot find module")){const c=/Cannot find module '([^']+)'/.exec(s)?.[1]??"unknown";e.logger.error(`${Re("→ Hint:")} The module ${oe(c)} could not be resolved.`),c.includes("@visulima/vis")?(e.logger.error(" This usually means the package isn't installed or the export path changed."),e.logger.error(` Try: ${pe("pnpm add @visulima/vis")}`),e.logger.error(` Or regenerate: ${pe("vis init --force")}`)):e.logger.error(` Try: ${pe(`pnpm add ${c}`)}`)}else s.includes("SyntaxError")||s.includes("Unexpected token")?(e.logger.error(`${Re("→ Hint:")} The config file has a syntax error.`),e.logger.error(" Check your config for typos or invalid syntax."),e.logger.error(` Or regenerate: ${pe("vis init --force")}`)):(e.logger.error(`${Re("→ Hint:")} Delete the broken config and recreate it:`),e.logger.error(` ${pe(`rm ${i} && vis init`)}`));e.logger.error(""),e.logger.error(` Continuing with default settings.
60
- `)}e.visConfig={}}const a=process.argv[2]??"";if(!new Set(["--help","--version","-h","-V","create","help","implode","init"]).has(a)&&!o&&!ue)if(process.stdin.isTTY){const r=vo({input:process.stdin,output:process.stderr}),i=await new Promise(s=>{r.question("\x1B[36;1m?\x1B[0m \x1B[1mNo vis.config.ts found. Create one with best-practice security defaults?\x1B[0m \x1B[90m(\x1B[92mY\x1B[90m/n)\x1B[0m ",s),r.on("SIGINT",()=>{r.close(),s("n")})});if(r.close(),!i.trim()||i.trim().toLowerCase()==="y"||i.trim().toLowerCase()==="yes"){const s=yo(n,"vis.config.ts"),l=['import { defineConfig } from "@visulima/vis/config";',"","// Secure defaults are applied automatically by defineConfig().","// You only need to add allowBuilds for packages with build scripts.","// Run 'vis check --security-config' to see all active settings.","export default defineConfig({"," security: {"," allowBuilds: {",' // "esbuild": true,'," },"," },","});",""].join(`
61
- `);E(s,l),e.logger.info(`✓ Created ${s}
62
- `),e.visConfig=await jt(n),o=s}}else e.logger.warn("No vis.config.ts found. Run 'vis init' to create one with best-practice security defaults.")}catch(t){t instanceof Error&&!t.message.includes("monorepo root")&&e.logger.warn(`Failed to detect workspace: ${t.message}`),e.visConfig={}}},"beforeCommand"),name:"config-loader"};var Nc=Object.defineProperty,x=f((e,t)=>Nc(e,"name",{value:t,configurable:!0}),"e");const Ut=300*1e3,at=d(Le(),".vis",".tip-state.json"),Wc=x(()=>{try{if(u(at))return U(at)}catch{}return{lastGlobal:0,perTip:{}}},"readState"),Fc=x(e=>{try{Ve(d(Le(),".vis")),A(at,JSON.stringify(e))}catch{}},"writeState"),Lc=[{cooldownMs:1800*1e3,id:"short-aliases",matches:x(e=>["install","link","remove","uninstall","update"].includes(e.command),"matches"),message:x(e=>{const t={install:"i",link:"ln",remove:"rm",uninstall:"rm",update:"up"}[e.command];return t?`You can use 'vis ${t}' as a shorthand for 'vis ${e.command}'`:""},"message"),probability:.5},{id:"use-exec",matches:x(e=>e.command==="dlx"&&e.success,"matches"),message:x(()=>"Use 'vis exec' to run locally installed binaries without downloading.","message")},{id:"security-check",matches:x(e=>(e.command==="check"||e.command==="update")&&e.success&&!e.args.includes("--security"),"matches"),message:x(()=>"Add --security to check for known vulnerabilities via OSV.dev","message"),probability:.3},{cooldownMs:3600*1e3,id:"ai-analysis",matches:x(e=>(e.command==="check"||e.command==="update")&&e.success&&!e.args.includes("--ai"),"matches"),message:x(()=>"Add --ai to run AI analysis on outdated packages before updating.","message"),probability:.2},{cooldownMs:1440*60*1e3,id:"socket-security",matches:x(e=>(e.command==="install"||e.command==="update"||e.command==="check")&&e.success,"matches"),message:x(()=>"Enable Socket.dev in vis.config.ts for security scores and supply chain alerts: security.socket.enabled = true","message"),probability:.15},{id:"dedupe-after-install",matches:x(e=>e.command==="install"&&e.success,"matches"),message:x(()=>"Run 'vis dedupe' periodically to remove duplicate dependencies.","message"),probability:.15},{cooldownMs:720*60*1e3,id:"doctor-checkup",matches:x(e=>(e.command==="install"||e.command==="add"||e.command==="update")&&e.success,"matches"),message:x(()=>"Run 'vis doctor' for a full project health check — outdated, security, duplicates, and optimizations in one view.","message"),probability:.25},{cooldownMs:10080*60*1e3,id:"init-config",matches:x(e=>(e.command==="install"||e.command==="run")&&e.success&&!e.hasVisConfig,"matches"),message:x(()=>"Run 'vis init' to create a vis.config.ts with secure defaults — supply chain protection enabled automatically.","message"),probability:.4},{id:"why-command",matches:x(e=>e.command==="outdated"&&e.success,"matches"),message:x(()=>"Use 'vis why <package>' to understand why a dependency is installed.","message"),probability:.3},{id:"graph-command",matches:x(e=>e.command==="run"&&e.success,"matches"),message:x(()=>"Use 'vis graph' to visualize your project dependency graph.","message"),probability:.1},{id:"affected-command",matches:x(e=>e.command==="run"&&e.success&&!e.args.includes("--projects"),"matches"),message:x(()=>"Use 'vis affected <target>' to run tasks only on changed projects.","message"),probability:.2},{id:"pm-cache",matches:x(e=>e.command==="install"&&e.success,"matches"),message:x(()=>"Use 'vis pm cache dir' to find your package manager's cache location.","message"),probability:.1},{id:"create-editor",matches:x(e=>e.command==="create"&&e.success,"matches"),message:x(()=>"Add --editor vscode to generate VS Code configuration during project creation.","message"),probability:.5},{id:"env-pin",matches:x(e=>e.command==="env"&&e.args.includes("install")&&e.success,"matches"),message:x(()=>"Use 'vis env pin <version>' to pin the Node.js version for your project.","message"),probability:.5},{id:"upgrade-check",matches:x(e=>e.command!=="self-update"&&e.success,"matches"),message:x(()=>"Run 'vis self-update --check' to see if a newer version of vis is available.","message"),probability:.05}],_c=x(e=>{if(process.env.VIS_CLI_TEST||ue)return;const t=Date.now(),n=Wc();if(t-n.lastGlobal<Ut)return;const o=Lc.filter(i=>{if(!i.matches(e))return!1;const s=n.perTip[i.id]??0,l=i.cooldownMs??Ut;return t-s>=l});if(o.length===0)return;const a=o.find(i=>{const s=i.probability??1;return Math.random()<s});if(!a)return;const r=a.message(e);r&&(process.stderr.write(`
63
- \x1B[2mtip: ${r}\x1B[0m
64
- `),n.lastGlobal=t,n.perTip[a.id]=t,Fc(n))},"showTip");var zc=Object.defineProperty,Jt=f((e,t)=>zc(e,"name",{value:t,configurable:!0}),"o$3");const Uc=Jt(e=>({afterCommand:Jt(async t=>{const n=process.argv.slice(2),o=n[0]??"";e&&e(),_c({args:n,command:o,hasVisConfig:t.visConfig!==void 0&&Object.keys(t.visConfig).length>0,success:process.exitCode===void 0||process.exitCode===0})},"afterCommand"),name:"post-command"}),"postCommandPlugin"),k=xo();var Jc=Object.defineProperty,L=f((e,t)=>Jc(e,"name",{value:t,configurable:!0}),"n$2");const he=L((e,t,n,o)=>{for(const a of t)e.push("--filter",a);n&&e.push("--recursive"),o&&e.push("--workspace-root")},"pushFilterGlobals"),Gc=L(e=>{const t=[],n=[];return he(t,e.filter,e.recursive,e.workspaceRoot),e.silent&&t.push("--silent"),e.frozenLockfile&&t.push("--frozen-lockfile"),t.push("install"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.force&&t.push("--force"),e.ignoreScripts&&t.push("--ignore-scripts"),e.lockfileOnly&&t.push("--lockfile-only"),e.noOptional&&t.push("--no-optional"),e.offline&&t.push("--offline"),{args:t,bin:"aube",warnings:n}},"resolveAubeInstall"),Hc=L(e=>{const t=[],n=[];return he(t,e.filter,!1,!1),t.push("add"),e.saveDev&&t.push("--save-dev"),e.exact&&t.push("--save-exact"),e.global&&t.push("--global"),e.optional&&t.push("--save-optional"),e.peer&&t.push("--save-peer"),e.workspace&&n.push("aube has no flag for the `workspace:` protocol; it auto-detects local workspace members during add. Ignoring --workspace."),e.workspaceRoot&&t.push("--workspace"),t.push(...e.packages),{args:t,bin:"aube",warnings:n}},"resolveAubeAdd"),qc=L(e=>{const t=[];return he(t,e.filter,e.recursive,!1),t.push("remove"),e.saveDev&&t.push("--save-dev"),e.global&&t.push("--global"),e.workspaceRoot&&t.push("--workspace"),t.push(...e.packages),{args:t,bin:"aube",warnings:[]}},"resolveAubeRemove"),Kc=L(e=>{const t=["dedupe"];return e&&t.push("--check"),{args:t,bin:"aube",warnings:[]}},"resolveAubeDedupe"),Yc=L(e=>{const t=[],n=[];he(t,e.filter,e.recursive,!1),t.push("why"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.json&&t.push("--json"),e.long&&t.push("--long"),e.parseable&&t.push("--parseable"),e.depth!==void 0&&n.push("aube why does not accept --depth; ignoring."),e.noOptional&&n.push("aube why does not accept --no-optional; ignoring."),e.global&&n.push("aube why does not accept --global; ignoring.");const[o,...a]=e.packages;return o===void 0?n.push("aube why requires a package name; none provided."):(a.length>0&&n.push("aube why takes a single package; using the first."),t.push(o)),{args:t,bin:"aube",warnings:n}},"resolveAubeWhy"),Qc=L(e=>{const t=[],n=[];e.workspaceRoot&&n.push("aube outdated has no `--include-workspace-root` equivalent. Run `vis outdated` separately at the workspace root if you need its outdated list."),he(t,e.filter,e.recursive,!1),t.push("outdated"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.long&&t.push("--long"),e.format==="json"?t.push("--json"):e.format&&e.format!=="table"&&n.push(`aube outdated does not support format "${e.format}"; falling back to default table output.`),e.compatible&&n.push("aube outdated does not accept --compatible; ignoring."),e.noOptional&&n.push("aube outdated does not accept --no-optional; ignoring."),e.global&&n.push("aube outdated does not accept --global; ignoring.");const[o,...a]=e.packages;return o!==void 0&&(a.length>0&&n.push("aube outdated takes a single pattern argument; using the first."),t.push(o)),{args:t,bin:"aube",warnings:n}},"resolveAubeOutdated"),Xc=L(e=>{const t=[];e.silent&&t.push("--silent"),t.push("dlx");for(const n of e.additionalPackages)t.push("--package",n);return e.shellMode&&t.push("--shell-mode"),t.push(e.package),t.push(...e.args),{args:t,bin:"aube",warnings:[]}},"resolveAubeDlx"),Zc=L(e=>{const t=[];return he(t,e.filter,e.recursive,e.workspaceRoot),t.push("exec"),e.parallel&&t.push("--parallel"),e.reverse&&t.push("--reverse"),e.shellMode&&t.push("--shell-mode"),t.push(e.command),t.push(...e.args),{args:t,bin:"aube",warnings:[]}},"resolveAubeExec"),ed=L(e=>{const t=["link"];return e!==null&&t.push(e),{args:t,bin:"aube",warnings:[]}},"resolveAubeLink"),td=L((e,t)=>{const n=[],o=[];return t&&n.push("--recursive"),n.push("unlink"),e.length>1&&o.push("aube unlink takes a single package; using the first."),e.length>0&&n.push(e[0]),{args:n,bin:"aube",warnings:o}},"resolveAubeUnlink"),nd=L(e=>{const t=["view","--",e.package],n=[],[o,...a]=e.fields;return o!==void 0?(a.length>0&&n.push("aube view only supports a single field; using the first."),e.json&&n.push("aube view does not support --json with a field selector; printing the field without --json."),t.push(o)):e.json&&t.push("--json"),{args:t,bin:"aube",warnings:n}},"resolveAubeInfo"),Rp=L(e=>{const t=[],n=[];return he(t,e.filters,e.recursive,e.workspaceRoot),t.push("update"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.global&&t.push("--global"),e.interactive&&t.push("--interactive"),e.latest&&t.push("--latest"),e.noOptional&&t.push("--no-optional"),e.noSave&&t.push("--no-save"),t.push(...e.packages),{args:t,bin:"aube",warnings:n}},"resolveAubeUpdate"),od=new Set(["fund","ping","search","token"]),ad=L((e,t)=>od.has(e)?{args:[e,...t],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...t],bin:"aube",warnings:[]},"resolveAubePmCommand");var rd=Object.defineProperty,I=f((e,t)=>rd(e,"name",{value:t,configurable:!0}),"t");const Gt=I(e=>Co(e)!==null,"hasBinaryOnPath"),id=I(e=>{const t=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["bun.lock","bun"],["bun.lockb","bun"]];let n=e;for(;;){for(const[a,r]of t)if(u(d(n,a)))return r;const o=eo(n);if(o===n||to(n).root===n)return;n=o}},"findNonAubeLockfile"),Ip=I((e,t)=>{if(t.name!=="aube")return;const n=id(e);if(n!==void 0)return`Resolved installer is aube but the workspace has a ${n} lockfile. Aube reads and writes ${n}'s lockfile format in place, but its byte output may differ subtly — expect a one-time churn diff on the first install, and ongoing drift if your team mixes tools on the same lockfile. To pin the choice across the team, set \`install.backend\` in vis.config; to bypass aube for this run, pass --no-aube.`},"detectLockfileDrift"),Bp=I((e,t)=>{const n=t.backend,o=process.env.VIS_INSTALLER,a=n??o??t.configBackend;if(a&&a!=="auto"){if(a==="aube"&&!Gt("aube"))throw new Error('install.backend is set to "aube" but the `aube` binary is not on PATH. Install it via `npm i -g @endevco/aube`, `mise use -g aube`, or `brew install endevco/tap/aube`.');return{name:a,version:"latest"}}return Gt("aube")?{name:"aube",version:"latest"}:Nn(e)},"resolveInstaller"),Nn=I(e=>{if(!u(e))throw new Error(`Could not detect package manager in ${e}. Directory does not exist.`);const t=Mo(e);return{name:t.name,version:t.version||"latest"}},"detectPm"),z=I((e,t,n)=>{for(const o of e.warnings)n.warn(`warning: ${o}`);return Oo(e.bin,e.args,t)},"runResolved"),ne=I((e,t,n)=>z(e(),t,n),"resolveAndRun"),sd=I((e,t)=>t==="aube"?e:{...e,args:[...e.args,"--prefer-offline"]},"applyPreferOffline"),Vp=I((e,t,n,o,a={})=>{let r=e.name==="aube"?Gc(t):Po(e.name,e.version,t);return a.preferOffline&&(r=sd(r,e.name)),z(r,n,o)},"runInstall"),ld=I((e,t)=>t==="aube"?{...e,args:[...e.args,"--ignore-scripts"]}:{...e,args:[...e.args,"--ignore-scripts"]},"applyIgnoreScripts"),Ap=I((e,t,n,o,a={})=>{let r=e.name==="aube"?Hc(t):jo(e.name,e.version,t);return a.ignoreScripts&&(r=ld(r,e.name)),z(r,n,o)},"runAdd"),Ep=I((e,t,n,o)=>e.name==="aube"?z(qc(t),n,o):ne(()=>Eo(e.name,e.version,t),n,o),"runRemove"),Tp=I((e,t,n,o)=>e.name==="aube"?z(Kc(t),n,o):ne(()=>Ro(e.name,e.version,t),n,o),"runDedupe"),Dp=I((e,t,n,o)=>e.name==="aube"?z(Yc(t),n,o):ne(()=>Do(e.name,e.version,t),n,o),"runWhy");I((e,t,n,o)=>e.name==="aube"?z(Qc(t),n,o):ne(()=>No(e.name,e.version,t),n,o),"runOutdated");const cd=I((e,t)=>{if(e.name==="aube")return nd(t);const n=[],o=[],a=e.name;switch(e.name){case"bun":{const r=wo(e.version);r&&$o(r,"1.3.0")&&o.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${t.package}\` instead.`),n.push("pm","view","--",t.package,...t.fields),t.json&&n.push("--json");break}case"npm":case"pnpm":{n.push("view","--",t.package,...t.fields),t.json&&n.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){n.push("info","--",t.package);const[r,...i]=t.fields;r!==void 0&&(i.length>0&&o.push("yarn v1 only supports querying one field at a time; using the first."),n.push(r)),t.json&&n.push("--json")}else n.push("npm","info","--",t.package),t.fields.length>0&&o.push("yarn berry does not support field arguments to 'npm info'; ignoring."),t.json&&n.push("--json");break}default:{const r=e.name;throw new Error(`Unsupported package manager: ${r}`)}}return{args:n,bin:a,warnings:o}},"resolveInfo"),Mp=I((e,t,n,o)=>z(cd(e,t),n,o),"runInfo"),Np=I((e,t,n,o)=>e.name==="aube"?z(ed(t),n,o):ne(()=>Vo(e.name,e.version,t),n,o),"runLink"),Wp=I((e,t,n,o,a)=>e.name==="aube"?z(td(t,n),o,a):ne(()=>To(e.name,e.version,t,n),o,a),"runUnlink"),Fp=I((e,t,n,o)=>e.name==="aube"?z(Xc(t),n,o):ne(()=>Io(e.name,e.version,t),n,o),"runDlx"),Lp=I((e,t,n,o)=>e.name==="aube"?z(Zc(t),n,o):ne(()=>Bo(e.name,e.version,t),n,o),"runExec"),_p=I((e,t,n,o,a)=>e.name==="aube"?z(ad(t,n),o,a):ne(()=>Ao(e.name,e.version,t,n),o,a),"runPmSubcommand");var dd=Object.defineProperty,_=f((e,t)=>dd(e,"name",{value:t,configurable:!0}),"d$1");const Wn=_((e,t)=>{const n={errors:[],warnings:[]},{security:o}=e;if(!o)return n.warnings.push("No security settings configured. Use defineConfig() from '@visulima/vis/config' to get secure defaults automatically."),n;if((!o.allowBuilds||Object.keys(o.allowBuilds).length===0)&&n.warnings.push(t==="pnpm"?"security.allowBuilds is not configured. pnpm blocks build scripts by default since v10. Run 'vis approve-builds' to review.":"security.allowBuilds is not configured. Consider listing which packages are allowed to run install/postinstall scripts."),o.minimumReleaseAge===0&&n.warnings.push("security.minimumReleaseAge is explicitly set to 0. New packages can be installed immediately after publishing."),o.trustPolicy==="off"&&n.warnings.push("security.trustPolicy is explicitly set to 'off'. Packages whose trust level has decreased will not be blocked."),o.blockExoticSubdeps===!1&&n.warnings.push("security.blockExoticSubdeps is explicitly disabled. Transitive dependencies can pull code from git repos or tarball URLs."),o.strictDepBuilds===!1&&n.warnings.push("security.strictDepBuilds is explicitly disabled. Unapproved build scripts will only produce warnings, not errors."),o.strictDepBuilds&&(!o.allowBuilds||Object.keys(o.allowBuilds).length===0)&&n.errors.push("security.strictDepBuilds is enabled but security.allowBuilds is empty. All dependencies with build scripts will be blocked. Run 'vis approve-builds' to review and add packages."),o.socket?.acceptedRisks){const a=Date.now();for(const[r,i]of Object.entries(o.socket.acceptedRisks)){const s=new Date(i.acceptedAt).getTime();a-s>7776e6&&n.warnings.push(`Accepted risk for "${r}" is over 90 days old (accepted ${i.acceptedAt}). Consider re-evaluating with 'vis audit'.`)}}return n},"checkSecurityConfig"),pd=_((e,t)=>{if(ue&&!process.env.VIS_SECURITY_WARNINGS)return;const n=Wn(e,t);for(const o of n.errors)k.error(o);n.warnings.length>0&&k.warn(`${n.warnings.length} security recommendation${n.warnings.length===1?"":"s"} found. Run 'vis check --security-config' for details.`)},"emitSecurityWarnings"),zp=_((e,t)=>{const n=Wn(e,t),{security:o}=e;if(o){if(k.info("Active security settings:"),k.info(` minimumReleaseAge: ${o.minimumReleaseAge??"not set"} minutes`),k.info(` trustPolicy: ${o.trustPolicy??"not set"}`),k.info(` trustPolicyIgnoreAfter: ${o.trustPolicyIgnoreAfter??"not set"} minutes`),k.info(` blockExoticSubdeps: ${o.blockExoticSubdeps??!1}`),k.info(` strictDepBuilds: ${o.strictDepBuilds??!1}`),k.info(` allowBuilds: ${o.allowBuilds?`${Object.keys(o.allowBuilds).length} entries`:"not configured"}`),k.info(""),k.info("Socket.dev integration:"),k.info(` socket.enabled: ${o.socket?.enabled??!1}`),k.info(` socket.apiToken: ${o.socket?.apiToken||process.env.VIS_SOCKET_TOKEN?"configured":"using public token"}`),k.info(` socket.minimumScore: ${o.socket?.minimumScore??"default (0.4)"}`),k.info(` socket.cacheTtlMs: ${o.socket?.cacheTtlMs??"default (1 hour)"}`),k.info(` socket.timeoutMs: ${o.socket?.timeoutMs??"default (15s)"}`),o.socket?.acceptedRisks){const a=Object.entries(o.socket.acceptedRisks);k.info(` socket.acceptedRisks: ${String(a.length)} entr${a.length===1?"y":"ies"}`);for(const[r,i]of a)k.info(` ${r}: ${i.reason} (accepted ${i.acceptedAt.slice(0,10)})`)}else k.info(" socket.acceptedRisks: none");k.info("")}if(n.errors.length===0&&n.warnings.length===0){k.info("All recommended security settings are configured.");return}for(const a of n.errors)k.error(a);for(const a of n.warnings)k.warn(a);k.notice(""),k.notice("Secure defaults are applied by defineConfig(). You only need to add allowBuilds:"),k.notice(""),k.notice(" import { defineConfig } from '@visulima/vis/config';"),k.notice(""),k.notice(" export default defineConfig({"),k.notice(" security: {"),k.notice(" allowBuilds: {"),k.notice(" esbuild: true,"),k.notice(" '@prisma/client': true,"),k.notice(" },"),k.notice(" },"),k.notice(" });")},"printSecurityReport"),Up=_(e=>{const{security:t}=e;if(!t)return[];const n=[];return t.minimumReleaseAge!==void 0&&n.push(`minimumReleaseAge: ${t.minimumReleaseAge}`),t.trustPolicy&&t.trustPolicy!=="off"&&n.push(`trustPolicy: ${t.trustPolicy}`),t.blockExoticSubdeps&&n.push("blockExoticSubdeps: true"),t.allowBuilds&&n.push(`allowBuilds: ${Object.keys(t.allowBuilds).length} entries`),t.strictDepBuilds&&n.push("strictDepBuilds: true"),t.trustPolicyIgnoreAfter!==void 0&&n.push(`trustPolicyIgnoreAfter: ${t.trustPolicyIgnoreAfter}`),n},"previewPnpmSync"),Jp=_((e,t)=>{const n=d(e,"node_modules");if(!u(n))return[];const o=[],a=_((r,i="")=>{let s;try{s=ae(r)}catch{return}for(const l of s){const c=d(r,l);if(l.startsWith("@")){a(c,`${l}/`);continue}if(l.startsWith("."))continue;const p=i+l,h=d(c,"package.json");try{if(!we(c).isDirectory()||!u(h))continue;const v=U(h).scripts??{};if(!v.preinstall&&!v.install&&!v.postinstall&&!v.prepare)continue;if(!Object.entries(t).some(([$,P])=>P?$===p?!0:$.endsWith("*")?p.startsWith($.slice(0,-1)):!1:!1)){const $=["preinstall","install","postinstall","prepare"].filter(P=>v[P]);o.push(`${p} (${$.join(", ")})`)}}catch{}}},"scanDir");return a(n),o},"scanUnapprovedBuildScripts"),Fn=_(e=>u(d(e,".yarnrc.yml")),"isYarnBerry"),ud=_((e,t,n)=>{const o={extraArgs:[],postInstallPackages:[],scriptsBlockedByDefault:!1,warnings:[]},a=n.security?.allowBuilds??{},r=Object.keys(a).length>0;switch(e){case"bun":{if(o.scriptsBlockedByDefault=!0,r){const i=d(t,"package.json");try{(u(i)?U(i):{}).trustedDependencies?.length||o.warnings.push("vis security.allowBuilds is configured but trustedDependencies is empty. Run 'vis approve-builds --sync-native'.")}catch{}}break}case"npm":{o.scriptsBlockedByDefault=!1;const i=d(t,".npmrc"),s=u(i)&&/^\s*ignore-scripts\s*=\s*true\s*$/m.test(j(i));if(!s&&r?(o.warnings.push("npm does not block lifecycle scripts. vis will add --ignore-scripts automatically."),o.extraArgs.push("--ignore-scripts")):!s&&!r&&o.warnings.push("npm does not block lifecycle scripts. Add 'ignore-scripts=true' to .npmrc and configure security.allowBuilds."),r)for(const[l,c]of Object.entries(a))c&&o.postInstallPackages.push(l);break}case"pnpm":{o.scriptsBlockedByDefault=!0,r||o.warnings.push("pnpm blocks build scripts by default. Run 'vis approve-builds' to review packages that need scripts.");break}case"yarn":{if(o.scriptsBlockedByDefault=!1,Fn(t)){const i=j(d(t,".yarnrc.yml"));/^\s*enableScripts\s*:\s*false\s*$/m.test(i)?o.scriptsBlockedByDefault=!0:o.warnings.push("yarn berry supports enableScripts. Add 'enableScripts: false' to .yarnrc.yml.")}else if(o.warnings.push("yarn classic does not support blocking lifecycle scripts. Consider upgrading to yarn berry."),r){o.extraArgs.push("--ignore-scripts");for(const[i,s]of Object.entries(a))s&&o.postInstallPackages.push(i)}break}}return o},"enforceScriptSecurity"),Gp=_((e,t,n)=>{const o=[],a=Object.entries(n).filter(([,r])=>r).map(([r])=>r);switch(e){case"bun":{const r=d(t,"package.json");if(u(r))try{const i=U(r);i.trustedDependencies=a,A(r,`${JSON.stringify(i,null,2)}
65
- `),o.push(`Updated package.json trustedDependencies with ${a.length} packages`)}catch(i){o.push(`Failed to update package.json: ${i instanceof Error?i.message:String(i)}`)}break}case"npm":{const r=d(t,".npmrc");let i=u(r)?j(r):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(i)?o.push(".npmrc already has ignore-scripts=true"):(i=`${i.trimEnd()}
229
+ `;return ue(i,a,"utf8"),r.info(`Created ${i} with ${s}`),!0},"insertPolicyIntoVisConfig"),nj=ie((e,t)=>{const r=y(e,"package.json"),n={catalogStripped:!1,configRemoved:!1,dependencyRemoved:!1,removedScripts:[],scriptCount:0};if(!k(r))return n;const s=P(r),o=JSON.parse(s);let i=!1;o.syncpack&&(delete o.syncpack,i=!0,n.configRemoved=!0);for(const p of["dependencies","devDependencies"]){const f=o[p];f?.syncpack&&(delete f.syncpack,i=!0,n.dependencyRemoved=!0)}const a=o.workspaces;if(a&&typeof a=="object"&&!Array.isArray(a)){const p=a.catalog;p&&typeof p.syncpack=="string"&&(delete p.syncpack,i=!0,n.catalogStripped=!0);const f=a.catalogs;if(f&&typeof f=="object")for(const u of Object.values(f))u&&typeof u.syncpack=="string"&&(delete u.syncpack,i=!0,n.catalogStripped=!0)}const c=o.catalog;c&&typeof c.syncpack=="string"&&(delete c.syncpack,i=!0,n.catalogStripped=!0);const l=o.scripts;if(l){const p={};for(const[f,u]of Object.entries(l))typeof u=="string"&&Ji.test(u)?(n.scriptCount+=1,n.removedScripts.push({name:f,value:u}),i=!0):p[f]=u;n.scriptCount>0&&(Object.keys(p).length===0?delete o.scripts:o.scripts=p)}if(i){const p=Gr(r,s,{useEditorconfig:t});re(r),ue(r,`${JSON.stringify(o,void 0,p)}
230
+ `,"utf8")}return n},"removeSyncpackFromPackageJson"),sj=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],oj=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],yu=ie((e,t)=>{const r=[],n=ie(s=>{const o=y(e,s);k(o)&&Ji.test(P(o))&&(r.push(s),Q(t,`Update ${s} — replace \`syncpack\` invocation(s) with \`vis lint\` / \`vis sort-package-json\` as appropriate.`))},"scanFile");for(const s of oj){const o=y(e,s);if(k(o)){if(s===".github/workflows"){try{for(const i of Ge(o))(i.endsWith(".yml")||i.endsWith(".yaml"))&&n(`.github/workflows/${i}`)}catch{}continue}n(s)}}return r},"detectCiReferences"),vu=ie((e,t)=>{const r=[];for(const n of sj){const s=y(e,n);k(s)&&Ji.test(P(s))&&(r.push(n),Q(t,`Update ${n} — replace \`syncpack\` invocation with \`vis lint\` / \`vis sort-package-json\` as appropriate.`))}return r},"detectHookReferences"),ij=ie(e=>{const t=y(e,"pnpm-workspace.yaml");if(!k(t))return!1;let r;try{r=Dr(t)}catch{return!1}if(!r||typeof r!="object")return!1;let n=!1;const s=r.catalog;s&&typeof s.syncpack=="string"&&(delete s.syncpack,n=!0);const o=r.catalogs;if(o&&typeof o=="object")for(const i of Object.values(o))i&&typeof i.syncpack=="string"&&(delete i.syncpack,n=!0);return n&&(re(t),ud(t,r)),n},"removeSyncpackFromPnpmCatalogs"),aj=ie((e,t)=>{for(const r of[...pu,...Wi]){const n=y(e,r);k(n)&&(re(n,t),Tr(n),he(t,ho,"removedConfigCount"))}},"removeSyncpackConfigFiles"),cj=ie((e,t,r,n,s)=>{const o=du(t,s);mu(t,s);const i=vu(e,s);i.length>0&&!r.silent&&n.warn(`Found syncpack reference in ${String(i.length)} hook file(s) — see manualSteps for details.`);const a=yu(e,s);a.length>0&&!r.silent&&n.warn(`Found syncpack reference in ${String(a.length)} CI file(s) — see manualSteps for details.`);const c=gu(t,s);(o.length>0||Object.keys(c).length>0)&&rj(e,o,n,c);const{catalogStripped:l,configRemoved:p,dependencyRemoved:f,removedScripts:u,scriptCount:m}=nj(e,r.useEditorconfig);p&&!r.silent&&n.info("Removed `syncpack` block from package.json"),f&&he(s,ho,"removedPackageCount");const h=ij(e);if((l||h)&&!r.silent&&n.info("Stripped `syncpack` from catalog protocol entries."),m>0){he(s,ho,"rewrittenScriptCount",m);for(const{name:g,value:b}of u)Q(s,`Recreate script \`${g}\` (removed; was \`${b}\`). Replace \`syncpack\` with \`vis lint\` / \`vis sort-package-json\` as appropriate.`);r.silent||n.info(`Removed ${String(m)} script(s) referencing \`syncpack\`. Replace with \`vis lint\` / \`vis sort-package-json\` as appropriate.`)}aj(e,s)},"applyMigration"),Rc=ie((e,t,r,n)=>{const s=uu(e);if(!s)return t.silent||r.info("No syncpack configuration found — nothing to migrate."),!1;const o=HS(e);o&&(J(n,`Syncpack config ${o} is a TS/JS format vis migrate cannot load — executable config support is tracked in https://github.com/visulima/visulima/issues/622. Convert to .syncpackrc.json and re-run.`),Q(n,`Convert ${o} to .syncpackrc.json (or translate it directly into policy.customTypes.extraTypes in vis.config.ts) — see https://github.com/visulima/visulima/issues/622`),t.silent||r.warn(`Cannot read ${o} — manual migration required (https://github.com/visulima/visulima/issues/622).`)),YS(e)&&(J(n,"vis.config.ts already declares `policy.customTypes.extraTypes` — skipping syncpack customTypes merge to avoid duplicates."),t.silent||r.warn("vis.config.ts already has policy.customTypes.extraTypes — skipping merge"));const i=ZS(e,s,n);if(!i)return!1;if(t.dryRun){const a=du(i,n),c=gu(i,n);mu(i,n),vu(e,n),yu(e,n);const l=hu(a,c);return t.silent||(l===""?r.info("[dry-run] No policy entries to merge — manualSteps will surface the rest."):(r.info(`[dry-run] Would merge ${l} into vis.config.ts:`),r.info(yo(a,c)))),!0}return cj(e,i,t,r,n),!0},"migrateSyncpack");var lj=Object.defineProperty,Ki=d((e,t)=>lj(e,"name",{value:t,configurable:!0}),"c$5");const pj=Ki(e=>e.map(t=>{if(t.startsWith("^"))return{dependencies:!0,target:t.slice(1)};if(t.includes("#")){const[r,n]=t.split("#");return{projects:r,target:n}}return t}),"convertDependsOn"),uj=Ki((e,t,r)=>{const n=e.tasks??e.pipeline??{},s={};for(const[a,c]of Object.entries(n)){if(a.includes("#"))continue;const l={};c.persistent&&(l.persistent=!0),c.interactive&&(l.interactive=!0);const p={};c.cache===!1&&(p.cache=!1),c.dependsOn&&c.dependsOn.length>0&&(p.dependsOn=pj(c.dependsOn)),c.inputs&&c.inputs.length>0&&(p.inputs=c.inputs),c.outputs&&c.outputs.length>0&&(p.outputs=c.outputs),c.env&&c.env.length>0&&(p.env=c.env),c.passThroughEnv&&c.passThroughEnv.length>0&&(p.passThroughEnv=c.passThroughEnv),Object.keys(l).length>0&&(p.options=l),s[a]=p}const o={};Object.keys(s).length>0&&(o.targetDefaults=s);const i={};return e.globalDependencies&&e.globalDependencies.length>0&&(i.globalInputs=e.globalDependencies),e.globalEnv&&e.globalEnv.length>0&&(i.globalEnv=e.globalEnv),e.globalPassThroughEnv&&e.globalPassThroughEnv.length>0&&(i.globalPassThroughEnv=e.globalPassThroughEnv),Object.keys(i).length>0&&(o.taskRunnerOptions=i),["// Migrated from turbo.json by `vis migrate turborepo`.","// Review the generated targetDefaults and move project-specific tasks","// into each project's project.json.","",'import { defineConfig } from "@visulima/vis/config";',"",`export default defineConfig(${Ii(o,y(t,"vis.config.ts"),r)});`,""].join(`
231
+ `)},"renderVisConfig"),Cc=Ki((e,t,r,n)=>{const s=Ep(e,"turbo.json");if(!s){r.warn("No turbo.json found in workspace root — nothing to migrate."),n.warnings.push("No turbo.json at workspace root.");return}const o=uj(s,e,t.useEditorconfig);if(!Pi(e,o,t,r,n))return;n.manualSteps.push("Review targetDefaults in vis.config.ts — project-specific tasks (turbo's project#task syntax) were skipped and should be moved into each project's project.json."),n.manualSteps.push("vis adds two task primitives turbo doesn't have: `when: { os, env, branch, ci, not.* }` for conditional execution and `always: true` for finally/teardown tasks that run even when upstream fails. See docs/guides/conditional-and-finally-tasks.mdx.");const i=s.tasks??s.pipeline??{};Object.values(i).some(a=>a.outputLogs!==void 0)&&n.warnings.push("`outputLogs` was found on one or more tasks but vis has no equivalent setting — review and remove."),s.remoteCache?.enabled&&n.manualSteps.push("turbo remote cache detected. vis speaks the same HTTP protocol — set taskRunnerOptions.remoteCache { url, token, teamId } in vis.config.ts.")},"migrateTurborepo");var dj=Object.defineProperty,U=d((e,t)=>dj(e,"name",{value:t,configurable:!0}),"n$b");const fj=/\b(?:husky|lint-staged|nano-staged)\b/,mj=U(e=>{const t=y(e,"package.json");if(k(t))try{return JSON.parse(P(t))}catch{return}},"readPackageJson"),gj=U((e,t)=>{const r=mj(e);if(!r)return!1;const n={...r.dependencies,...r.devDependencies};for(const o of rl)if(n[o])return!0;if(r.scripts){for(const o of Object.values(r.scripts))if(typeof o=="string"&&fj.test(o))return!0}const{overrides:s}=t;return s?Object.keys(s).length>0:!1},"detectDepsNeedsMigration"),hj=U(e=>k(y(e,"turbo.json")),"detectTurborepo"),yj=U(e=>k(y(e,"nx.json")),"detectNx"),vj=U(e=>k(y(e,".moon")),"detectMoon"),De=U(()=>{const e=[];return{lines:e,logger:{info:U(t=>{e.push(t)},"info"),warn:U(t=>{e.push(`⚠ ${t}`)},"warn")}}},"createCapturingLogger"),bj=[{apply:U(({packageManager:e,root:t,visConfig:r},n,s)=>{la(t,e,r,{dryRun:!1},s,n)},"apply"),description:"Remove husky/lint-staged/nano-staged from package.json and rewrite scripts to `vis staged`.",detect:U(({root:e,visConfig:t})=>gj(e,t),"detect"),id:"deps",probe:U(({packageManager:e,root:t,visConfig:r})=>{const{lines:n,logger:s}=De(),o=Ne();return la(t,e,r,{dryRun:!0},s,o),n},"probe"),title:"Dependencies & scripts"},{apply:U(({root:e},t,r)=>{ga(e,{dryRun:!1},r,t)},"apply"),description:"Inline lint-staged configuration into vis.config.ts.",detect:U(({root:e})=>!!jp(e),"detect"),id:"lint-staged",probe:U(({root:e})=>{const{lines:t,logger:r}=De(),n=Ne();return ga(e,{dryRun:!0},r,n),t},"probe"),title:"lint-staged"},{apply:U(({root:e},t,r)=>{ba(e,{dryRun:!1},r,t)},"apply"),description:"Inline nano-staged configuration into vis.config.ts.",detect:U(({root:e})=>!!Rp(e),"detect"),id:"nano-staged",probe:U(({root:e})=>{const{lines:t,logger:r}=De(),n=Ne();return ba(e,{dryRun:!0},r,n),t},"probe"),title:"nano-staged"},{apply:U(({root:e},t,r)=>{Cc(e,{dryRun:!1},r,t)},"apply"),description:"Translate turbo.json tasks into vis.config.ts.",detect:U(({root:e})=>hj(e),"detect"),id:"turborepo",probe:U(({root:e})=>{const{lines:t,logger:r}=De(),n=Ne();return Cc(e,{dryRun:!0},r,n),t},"probe"),title:"Turborepo"},{apply:U(({root:e},t,r)=>{ka(e,{dryRun:!1},r,t)},"apply"),description:"Translate nx.json targets into vis.config.ts.",detect:U(({root:e})=>yj(e),"detect"),id:"nx",probe:U(({root:e})=>{const{lines:t,logger:r}=De(),n=Ne();return ka(e,{dryRun:!0},r,n),t},"probe"),title:"Nx"},{apply:U(({root:e},t,r)=>{ha(e,{copyTemplates:!1,dryRun:!1},r,t)},"apply"),description:"Translate .moon/tasks.yml into vis.config.ts.",detect:U(({root:e})=>vj(e),"detect"),id:"moon",probe:U(({root:e})=>{const{lines:t,logger:r}=De(),n=Ne();return ha(e,{copyTemplates:!1,dryRun:!0},r,n),t},"probe"),title:"Moon"},{apply:U(({root:e},t,r)=>{pa(e,{dryRun:!1},r,t)},"apply"),description:"Convert gitleaks config/baseline/hooks to `vis secrets`.",detect:U(({root:e})=>!!(Mn(e)??Ri(e)??Ci(e)),"detect"),id:"gitleaks",probe:U(({root:e})=>{const{lines:t,logger:r}=De(),n=Ne();return pa(e,{dryRun:!0},r,n),t},"probe"),title:"Gitleaks"},{apply:U(({root:e},t,r)=>{da(e,{dryRun:!1},r,t)},"apply"),description:"Convert Kingfisher baseline/rules/hooks to `vis secrets`.",detect:U(({root:e})=>!!(xi(e)??Vn(e)),"detect"),id:"kingfisher",probe:U(({root:e})=>{const{lines:t,logger:r}=De(),n=Ne();return da(e,{dryRun:!0},r,n),t},"probe"),title:"Kingfisher"},{apply:U(({root:e},t,r)=>{$a(e,{dryRun:!1},r,t)},"apply"),description:"Replace secretlint config/hooks with `vis secrets`.",detect:U(({root:e})=>!!(Pp(e)??Ap(e)),"detect"),id:"secretlint",probe:U(({root:e})=>{const{lines:t,logger:r}=De(),n=Ne();return $a(e,{dryRun:!0},r,n),t},"probe"),title:"Secretlint"},{apply:U(({root:e},t,r)=>{Rc(e,{dryRun:!1},r,t)},"apply"),description:"Translate syncpack customTypes into policy.customTypes.extraTypes and strip the syncpack dep/scripts.",detect:U(({root:e})=>!!uu(e),"detect"),id:"syncpack",probe:U(({root:e})=>{const{lines:t,logger:r}=De(),n=Ne();return Rc(e,{dryRun:!0},r,n),t},"probe"),title:"Syncpack"},{apply:U(({root:e},t,r)=>{wa(e,{dryRun:!1},r,t)},"apply"),description:"Strip sherif config/dep/scripts and surface ignore-rules as a positive `vis lint --<rule>` command.",detect:U(({root:e})=>!!Tp(e)||Dp(e),"detect"),id:"sherif",probe:U(({root:e})=>{const{lines:t,logger:r}=De(),n=Ne();return wa(e,{dryRun:!0},r,n),t},"probe"),title:"Sherif"}],kj=U(e=>bj.filter(t=>t.detect(e)),"getApplicableMigrations"),$j=U((e,t)=>({packageManager:sl(e),root:e,visConfig:t}),"buildProbeContext");var wj=Object.defineProperty,Sj=d((e,t)=>wj(e,"name",{value:t,configurable:!0}),"s$5");const jj=Sj((e,t)=>{t.info("── Migration Summary ──");const r=[["Staged configs merged into vis.config.ts",e.mergedStagedConfigCount],["Lint-staged configs inlined",e.inlinedLintStagedConfigCount],["Config files removed",e.removedConfigCount],["Packages removed",e.removedPackageCount],["Scripts rewritten",e.rewrittenScriptCount]];for(const[s,o]of r)o>0&&t.info(` ${s}: ${String(o)}`);e.gitHooksConfigured&&t.info(" Pre-commit hook updated to use vis staged");const n=Object.entries(e.perMigration);if(n.length>0){t.info(""),t.info("By migration:");for(const[s,o]of n){const i=[];o.removedConfigCount>0&&i.push(`${String(o.removedConfigCount)} config(s) removed`),o.removedPackageCount>0&&i.push(`${String(o.removedPackageCount)} package(s) removed`),o.rewrittenScriptCount>0&&i.push(`${String(o.rewrittenScriptCount)} script(s) rewritten`),t.info(` ${s}: ${i.join(", ")||"no changes"}`)}}if(e.backupsCreated.length>0&&(t.info(""),t.info(`Created ${String(e.backupsCreated.length)} .bak file(s) for rollback. Remove them once you're happy.`)),e.warnings.length>0){t.info(""),t.warn("Warnings:");for(const s of e.warnings)t.warn(` - ${s}`)}if(e.manualSteps.length>0){t.info(""),t.info("Manual steps required:");for(const s of e.manualSteps)t.info(` - ${s}`)}},"printSummary");var Oj=Object.defineProperty,bu=d((e,t)=>Oj(e,"name",{value:t,configurable:!0}),"c$4");const Ej=bu((e,t)=>{if(e.length===0){t.info("No applicable migrations detected in this workspace.");return}t.info(`Detected migrations (non-interactive preview):
232
+ `);for(const r of e){t.info(` • ${r.entry.title} — ${r.entry.description}`);for(const n of r.preview)t.info(` ${n}`);t.info("")}t.info("Run a specific migration with `vis migrate <name>` (e.g. `vis migrate deps`).")},"renderFallbackTable"),Rj=bu(async e=>{const t=e.workspaceRoot??process.cwd(),r=e.visConfig??{},n=$j(t,r),s=kj(n).map(f=>({entry:f,preview:f.probe(n)}));if(!(process.stdout.isTTY&&!pt)){Ej(s,e.logger);return}if(s.length===0){e.logger.info("No applicable migrations detected in this workspace.");return}const o=new Dm(s),i=r.tui?.autoExit??!1,a=i===!0?3:typeof i=="number"?i:0,c=await _u(qt.createElement(Hm,{autoExitSeconds:a,isDryRun:!1,store:o}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit();if(!c||c.length===0){e.logger.info("No migrations selected — exiting.");return}const l=Ne(),p=[];for(const f of c)try{e.logger.info(`── Applying ${f.entry.title} ──`),f.entry.apply(n,l,e.logger),e.logger.info("")}catch(u){p.push({entry:f.entry,error:u}),e.logger.warn(`Failed to apply ${f.entry.title}: ${u.message}`)}jj(l,e.logger),p.length>0&&(e.logger.warn(""),e.logger.warn(`${String(p.length)} migration(s) failed — see messages above.`),process.exitCode=1)},"runMigrateInteractive");var Cj=Object.defineProperty,xj=d((e,t)=>Cj(e,"name",{value:t,configurable:!0}),"e$f");const Nj={description:"Analyze and optimize dependencies using e18e replacements and @socketregistry overrides",examples:[["vis optimize","Interactive TUI to select and apply optimizations"],["vis optimize --dry-run","Preview available optimizations"],["vis optimize --pin","Pin Socket.dev overrides to exact versions"],["vis optimize --prod","Only optimize production dependencies"]],group:"Workspace",loader:xj(()=>import("./handler40.js").then(e=>e.h),"loader"),name:"optimize",options:[{alias:"d",defaultValue:!1,description:"Preview available optimizations without applying",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Pin Socket.dev overrides to exact versions",name:"pin",type:Boolean},{defaultValue:!1,description:"Only optimize production dependencies",name:"prod",type:Boolean},{defaultValue:!1,description:"Skip running install after applying overrides",name:"no-install",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var Ij=Object.defineProperty,Pj=d((e,t)=>Ij(e,"name",{value:t,configurable:!0}),"e$e");const Aj={argument:{description:"Subcommand and arguments (e.g., cache dir, publish --dry-run, list --depth 0)",name:"args",type:String},description:"Package manager utilities (cache, publish, audit, list, config, etc.)",examples:[["vis pm cache dir","Show cache directory"],["vis pm cache clean","Clean cache"],["vis pm publish --dry-run","Preview publishing"],["vis pm list --depth 0","List direct dependencies"],["vis pm audit","Run security audit"],["vis pm whoami","Show logged-in user"]],group:"System",loader:Pj(()=>import("./handler18.js"),"loader"),name:"pm"};var Tj=Object.defineProperty,Dj=d((e,t)=>Tj(e,"name",{value:t,configurable:!0}),"e$d");const Lj={alias:["rm","un","uninstall"],argument:{description:"Packages to remove",name:"packages",type:String},description:"Remove packages using the detected package manager",examples:[["vis remove lodash","Remove a package"],["vis rm old-package","Remove using alias"],["vis remove --filter app react","Remove from specific workspace"],["vis remove -g typescript","Remove global package"]],group:"Dependencies",loader:Dj(()=>import("./handler19.js"),"loader"),name:"remove",options:[{alias:"D",defaultValue:!1,description:"Remove from devDependencies",name:"save-dev",type:Boolean},{alias:"g",defaultValue:!1,description:"Remove global package",name:"global",type:Boolean},{alias:"r",defaultValue:!1,description:"Remove from all workspace packages",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Remove from workspace root",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String}]},Bj={description:"Replay a previous task run from .task-runner/runs/ — show task results without re-executing",examples:[["vis replay","Show the most recent run summary"],["vis replay --run 2026-04-28T12-34-56_ab12","Inspect a specific historical run"],["vis replay --list","List every recorded run, newest first"],["vis replay --task @myorg/app:build","Focus on one task within the loaded run"],["vis replay --failed","Filter to only failed tasks"],["vis replay --format=json","Machine-readable output for CI"]],group:"Workspace",loader:de(()=>import("./handler20.js"),"replayExecute"),name:"replay",options:[{description:"Run id to replay (defaults to the most recent run)",name:"run",type:String},{defaultValue:!1,description:"List every available run instead of replaying one",name:"list",type:Boolean},{description:"Filter the replay to a single task id (e.g. @my/app:build)",name:"task",type:String},{defaultValue:!1,description:"Filter the replay to failed tasks only",name:"failed",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var Mj=Object.defineProperty,Vj=d((e,t)=>Mj(e,"name",{value:t,configurable:!0}),"e$c");const _j={argument:{description:"The target to run (e.g., build, test, lint)",name:"target",type:String},description:"Run a target across workspace projects",examples:[["vis run","List all available targets"],["vis run build","Run build on all projects"],["vis run :build","Run build on all projects (moon-style)"],["vis run ~:test","Run test on the project closest to the current directory"],['vis run "#frontend:build"',"Run build on projects tagged 'frontend'"],['vis run :build --query "language=typescript"',"Filter by project metadata"],["vis run test --affected","Run test only on git-changed projects"],["vis run build --fail-fast","Stop on first failure"],["vis run build --dry-run","Show execution plan without running"],["vis run destroy --reverse","Run leaves-first (teardown order, e.g. CDK/Pulumi destroy)"]],group:"Run & Execute",loader:Vj(()=>import("./handler48.js"),"loader"),name:"run",options:[{alias:"p",description:"Comma-separated list of projects to run",name:"projects",type:String},{defaultValue:!1,description:"Skip the toolchain pre-flight (no auto-install for any pinned tool: node / pnpm / yarn / npm / bun / deno / go / python / ruby / rust)",name:"skip-toolchain",type:Boolean},{description:"Detect lockfile/node_modules drift before running (warns in TTY, fails in CI). Use --no-preflight to disable.",name:"preflight",type:Boolean},{defaultValue:3,description:"Maximum number of parallel tasks (falls back to VIS_RUN_CONCURRENCY_LIMIT env var, then 3)",name:"parallel",type:Number},{defaultValue:!0,description:"Enable caching (use --no-cache to disable)",name:"cache",type:Boolean},{description:"Comma-separated selectors of tasks to bypass cache for (e.g. 'app:test', ':e2e', '#flaky:lint'). Other tasks in the run still cache normally. --no-cache wins when both are set.",name:"skip-cache",type:String},{description:"Custom cache directory",name:"cache-dir",type:String},{description:"Remote cache mode: read | write | readwrite (defaults to readwrite when remoteCache is configured)",name:"cache-mode",type:String},{description:"Remote cache wire backend: http (Turborepo-compatible) or reapi (Bazel Remote Execution API gRPC)",name:"cache-backend",type:String},{defaultValue:!1,description:"Show what would run without executing",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Generate a run summary after execution",name:"summarize",type:Boolean},{description:'Partition tasks for distributed CI (e.g., "1/4" for first of four runners). Falls back to VIS_PARTITION env var.',name:"partition",type:String},{defaultValue:!1,description:"Skip project constraint validation",name:"skip-constraints",type:Boolean},{description:"Filter matched projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String},{defaultValue:!1,description:"Only run on projects affected by git changes (shorthand for vis affected)",name:"affected",type:Boolean},{defaultValue:!1,description:"Rerun affected tasks on file change. Ctrl+C to exit.",name:"watch",type:Boolean},{defaultValue:!1,description:"Stop all tasks on first failure",name:"fail-fast",type:Boolean},{defaultValue:!1,description:"Run the dependency graph in reverse (leaves first, then their dependents). Useful for teardown targets like `destroy`/`undeploy` where dependents must run before the things they depend on.",name:"reverse",type:Boolean},{description:"Output mode: interleaved (pass-through), labeled (prefix each line with [pkg#task]), or grouped (vite-task-style block)",name:"log",type:String},{description:"Output style: normal (print every task) or quiet (skip output for successful/cached tasks; failed tasks still print in CI mode, and remain in TUI scrollback in interactive mode). Per-target options.outputStyle overrides this.",name:"output-style",type:String},{defaultValue:!1,description:"Run every task through a pseudo-terminal so color-aware tools render as if attached to a TTY (disables caching)",name:"pty",type:Boolean},{description:"Global retry budget: cap on total task retries across the run (per-target retryCount is still honored up to the budget)",name:"retry-budget",type:Number},{description:"Write a Chrome Tracing JSON profile of the run to this path (open in chrome://tracing or Perfetto)",name:"profile",type:String},{defaultValue:!1,description:"Render the most-recent run's saved summary (from .task-runner/last-summary.json) and exit without executing any tasks",name:"last-details",type:Boolean},{defaultValue:!0,description:"Show flaky task report on failure (use --no-flaky to suppress)",name:"flaky",type:Boolean},{description:"Fail a task if its command references an env var that is unset (no silent empty-string substitution). Use --no-strict-env to disable when set in config.",name:"strict-env",type:Boolean},{description:"Comma-separated tags this runner advertises (e.g. 'gpu,slow'). Tasks declaring `options.runnerTags` only run when at least one tag overlaps. Untagged tasks always run. Falls back to VIS_RUNNER_TAGS env var.",name:"runner-tags",type:String}]};var Fj=Object.defineProperty,qj=d((e,t)=>Fj(e,"name",{value:t,configurable:!0}),"e$b");const Uj={description:"Generate a CycloneDX 1.6 Software Bill of Materials for the workspace",examples:[["vis sbom","Write the full-workspace SBOM to sbom.cdx.json"],["vis sbom --focus=my-app","Scope the SBOM to my-app's transitive closure"],["vis sbom --focus=my-app,other","Focus multiple projects"],["vis sbom --format=xml --output=sbom.cdx.xml","Emit XML instead of JSON"],["vis sbom --include-dev","Include devDependencies (default: production only)"],["vis sbom --output=-","Write to stdout"]],group:"Security & Health",loader:qj(()=>import("./handler42.js"),"loader"),name:"sbom",options:[{description:"Project name(s) to focus on — comma-separated for multiple",name:"focus",type:String},{defaultValue:"json",description:"Output format: json (default) or xml",name:"format",type:String},{description:"Output path (use '-' for stdout; default: sbom.cdx.json)",name:"output",type:String},{defaultValue:!1,description:"Include devDependencies (default: production only)",name:"include-dev",type:Boolean}]};var Wj=Object.defineProperty,Gj=d((e,t)=>Wj(e,"name",{value:t,configurable:!0}),"e$a");const Jj={argument:{description:"One or more paths to scan (defaults to workspace root)",name:"paths",type:String},description:"Scan a repository for hardcoded secrets and credentials",examples:[["vis secrets","Scan the workspace with grouped, colourised output"],["vis secrets --staged","Scan only files staged for the current commit (pre-commit hooks)"],["vis secrets --since main","Scan only files changed since the `main` branch"],["vis secrets --affected","Scan only projects affected by the current branch"],["vis secrets --init","Write an initial baseline from current findings"],["vis secrets --list-rules","Print all bundled detection rules"],["vis secrets --list-validators","Print non-HTTP validator types in the ruleset + install hints for each"],["vis secrets --exclude-rule generic-api-key --exclude-rule aws-access-token","Drop noisy rules"],["vis secrets --include-rule stripe-access-token","Check a single rule"],["vis secrets --enable-rule tag:preset:weak-passwords","Enable an opt-in rule group additively (defaults still fire)"],["vis secrets --include-rule tag:preset:password-manager","Restrict output to one opt-in group only"],["vis secrets --min-confidence high","Drop rules without a high confidence label (CI-friendly precision filter)"],["vis secrets --validate --only-verified","Live-verify each finding against its provider (one HTTP call per finding)"],["vis secrets --exclude 'dist/**' --exclude-from .secretsignore","Extra gitignore-syntax exclusions for the walker"],["vis secrets --config ./leaks.json --no-extend-bundled","Use only the supplied config, skip the bundled ruleset"],["vis secrets --concurrency 4","Cap the rayon thread pool (0 / omit = auto)"],["vis secrets --baseline .secrets-baseline.json","Suppress known findings; print diff vs. baseline"],["vis secrets --update-baseline","Merge current findings into the baseline (use --replace-baseline to overwrite)"],["vis secrets --format sarif > report.sarif","SARIF output for GitHub code-scanning"]],group:"Security",loader:Gj(()=>import("./handler38.js"),"loader"),name:"secrets",options:[{description:"Path to a JSON config (gitleaks-compatible shape). Defaults to the bundled ruleset.",name:"config",type:String},{description:"Drop rules below this author-declared confidence: low (default), medium, high. Rules without a declared confidence (every gitleaks rule) are treated as low, so --min-confidence medium or higher drops them along with explicit low-confidence rules.",name:"min-confidence",type:String},{defaultValue:!1,description:"Live-verify each finding against its provider (one HTTP call per finding, max 8 concurrent). Only supports Kingfisher-style HTTP validators with StatusMatch / WordMatch response matchers; other types (gRPC, multi-step, checksum) mark the finding as validation=skipped. WARNING: sends candidate secrets to the provider — some providers alert their security team on failed auth attempts.",name:"validate",type:Boolean},{defaultValue:!1,description:"With --validate, drop every finding whose validation is not 'verified'. Useful for CI gating.",name:"only-verified",type:Boolean},{defaultValue:!1,description:"With --config, do not merge on top of the bundled ruleset — replace it.",name:"no-extend-bundled",type:Boolean},{defaultValue:"text",description:"Output format: text (default), json, sarif",name:"format",type:String},{description:"Path to a baseline JSON of previously-triaged findings",name:"baseline",type:String},{defaultValue:!1,description:"Scan only files staged for commit",name:"staged",type:Boolean},{description:"Scan only files changed since <ref> (e.g. main, origin/HEAD)",name:"since",type:String},{defaultValue:!1,description:"Scan only projects affected by the current branch",name:"affected",type:Boolean},{description:"Enable an opt-in rule or tag without restricting output — additive (e.g. tag:preset:weak-passwords, tag:preset:password-manager). Repeatable.",multiple:!0,name:"enable-rule",type:String},{description:"Rule id or tag:<name> selector — whitelist, only matching findings are emitted. Implies enablement. Repeatable.",multiple:!0,name:"include-rule",type:String},{description:"Rule id or tag:<name> selector — drop matching findings. Repeatable.",multiple:!0,name:"exclude-rule",type:String},{description:"Gitignore-syntax pattern to exclude from the walk (repeatable)",multiple:!0,name:"exclude",type:String},{description:"Path to a gitignore-shaped file the walker should honor (repeatable)",multiple:!0,name:"exclude-from",type:String},{defaultValue:!1,description:"Mask secret values in output",name:"redact",type:Boolean},{defaultValue:!1,description:"Scan dotfiles",name:"include-hidden",type:Boolean},{defaultValue:!1,description:"Do not respect .gitignore",name:"no-gitignore",type:Boolean},{description:"Skip files larger than this (bytes). Default: 10 MiB",name:"max-size",type:Number},{description:"Rayon worker threads (0 / omit = auto)",name:"concurrency",type:Number},{defaultValue:!1,description:"Merge current findings into the baseline and exit 0",name:"update-baseline",type:Boolean},{defaultValue:!1,description:"With --update-baseline, replace rather than merge",name:"replace-baseline",type:Boolean},{defaultValue:!1,description:"Scaffold a baseline from current findings",name:"init",type:Boolean},{defaultValue:!1,description:"With --init, preview the baseline without writing files",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Print all bundled detection rules and exit",name:"list-rules",type:Boolean},{defaultValue:!1,description:"Print non-HTTP validator types referenced by the current ruleset, with install hints for their optional peer dependencies.",name:"list-validators",type:Boolean},{defaultValue:!1,description:"Suppress all progress output (only emit findings)",name:"quiet",type:Boolean},{defaultValue:!1,description:"Print diagnostic info (skipped rules, etc.)",name:"verbose",type:Boolean}]},zn={description:"Target id, e.g. @my/api:db",name:"targetId",type:String},Kj={description:"Output format: table or json (default: table)",name:"format",type:String},zj={argument:zn,commandPath:["service"],description:"Start a service target detached so it survives across `vis run` invocations",examples:[["vis service start @my/api:db","Boot the db target as a long-lived service"],["vis service start @my/api:db --timeout=60000","Override readiness timeout"],["vis service start @my/api:db --no-readiness","Skip the readiness probe"]],group:"Workspace",loader:de(()=>import("./handler34.js"),"serviceStartExecute"),name:"start",options:[{description:"Readiness probe timeout in milliseconds",name:"timeout",type:Number},{defaultValue:!1,description:"Skip the readiness probe",name:"no-readiness",type:Boolean}]},Hj={argument:{description:"Target id to stop, or omit when using --all",name:"targetId",required:!1,type:String},commandPath:["service"],description:"Stop a running service",examples:[["vis service stop @my/api:db","Stop the db service"],["vis service stop --all","Stop every running service in this workspace"]],group:"Workspace",loader:de(()=>import("./handler34.js"),"serviceStopExecute"),name:"stop",options:[{defaultValue:!1,description:"Stop every service registered for this workspace",name:"all",type:Boolean},{description:"Override the SIGTERM→SIGKILL grace period in milliseconds",name:"grace-ms",type:Number}]},Yj={commandPath:["service"],description:"List services registered for this workspace",examples:[["vis service list","Print running services"],["vis service list --format=json","Machine-readable list"]],group:"Workspace",loader:de(()=>import("./handler34.js"),"serviceListExecute"),name:"list",options:[Kj]},Xj={argument:zn,commandPath:["service"],description:"Re-run the readiness probe and report a service's health",examples:[["vis service status @my/api:db","Check whether the db service is reachable"]],group:"Workspace",loader:de(()=>import("./handler34.js"),"serviceStatusExecute"),name:"status",options:[{description:"Probe timeout in milliseconds",name:"timeout",type:Number}]},Qj={argument:zn,commandPath:["service"],description:"Stop and re-start a running service",examples:[["vis service restart @my/api:db","Recycle the db service"],["vis service restart @my/api:db --no-readiness","Recycle and skip the readiness probe"]],group:"Workspace",loader:de(()=>import("./handler34.js"),"serviceRestartExecute"),name:"restart",options:[{description:"Readiness probe timeout in milliseconds",name:"timeout",type:Number},{description:"Override the SIGTERM→SIGKILL grace period in milliseconds",name:"grace-ms",type:Number},{defaultValue:!1,description:"Skip the readiness probe after restart",name:"no-readiness",type:Boolean}]},Zj={argument:zn,commandPath:["service"],description:"Print or tail a service's captured stdout/stderr",examples:[["vis service logs @my/api:db","Print the captured log"],["vis service logs @my/api:db -f","Tail the log (Ctrl-C to exit)"]],group:"Workspace",loader:de(()=>import("./handler34.js"),"serviceLogsExecute"),name:"logs",options:[{alias:"f",defaultValue:!1,description:"Follow the log file (like `tail -f`)",name:"follow",type:Boolean}]},e0=[zj,Hj,Yj,Xj,Qj,Zj];var t0=Object.defineProperty,r0=d((e,t)=>t0(e,"name",{value:t,configurable:!0}),"e$9");const n0={description:"Sort package.json files across the workspace using the sort-package-json Rust crate",examples:[["vis sort-package-json","Sort all package.json files in the workspace"],["vis sort-package-json --check","Check if files are already sorted (exit 1 if not)"],["vis sort-package-json --sort-scripts","Also sort the scripts field alphabetically"],["vis sort-package-json --indent 4","Force 4-space indentation (overrides per-file detection)"],["vis sort-package-json --indent tab","Force tab indentation"],["vis sort-package-json --ignore '**/fixtures/**'","Skip files matching one or more glob patterns"],["vis sort-package-json --sort-order name,version,license","Pin a custom prefix order before the default field order"],["vis sort-package-json --unsorted dependencies,devDependencies","Preserve original key order for the listed top-level sections"],["vis sort-package-json --no-final-newline","Do not append a trailing newline"],["vis sort-package-json --line-ending crlf","Force CRLF line endings (default: auto-detect per file)"]],group:"Workspace",loader:r0(()=>import("./handler41.js"),"loader"),name:"sort-package-json",options:[{alias:"c",defaultValue:!1,description:"Check if package.json files are sorted without writing (exits 1 if unsorted)",name:"check",type:Boolean},{defaultValue:!1,description:"Also sort the scripts field alphabetically",name:"sort-scripts",type:Boolean},{description:"Indent override: a number of spaces, the literal `tab`, or a literal whitespace string. When unset, the original file's indent is preserved.",name:"indent",type:String},{description:"Glob pattern of files to skip (basename match, or path-relative when the pattern contains `/`). Repeatable.",multiple:!0,name:"ignore",type:String},{description:"Comma-separated list of top-level keys to place first, before the default field order. Repeatable.",multiple:!0,name:"sort-order",type:String},{description:"Comma-separated list of top-level sections whose key order should be preserved (e.g. dependencies,devDependencies). Repeatable.",multiple:!0,name:"unsorted",type:String},{defaultValue:!1,description:"Do not append a trailing newline to the output (default: append one).",name:"no-final-newline",type:Boolean},{defaultValue:"auto",description:"Line ending to write: auto (per-file detection, default), lf, or crlf.",name:"line-ending",type:String},{description:"Disable collapsing `bugs: { url }` to the bare string form (default: enabled).",name:"no-format-bugs",type:Boolean},{description:"Disable collapsing `repository: { type, url }` to the GitHub `owner/repo` shorthand (default: enabled).",name:"no-format-repository",type:Boolean},{description:"Disable canonical sorting of `exports` condition keys (default: enabled).",name:"no-sort-exports",type:Boolean},{description:"Disable .editorconfig discovery for indent / line-ending defaults (default: enabled).",name:"no-editorconfig",type:Boolean}]};var s0=Object.defineProperty,o0=d((e,t)=>s0(e,"name",{value:t,configurable:!0}),"e$8");const i0={description:"Run linters on staged files using config from vis.config.ts",examples:[["vis staged","Run staged linters"],["vis staged --verbose","Run with verbose output"],["vis staged --no-stash","Run without backup stash"],["vis staged --diff HEAD~1","Run against a specific diff"]],group:"Run & Execute",loader:o0(()=>import("./handler47.js"),"loader"),name:"staged",options:[{defaultValue:!1,description:"Allow empty commits when tasks revert all staged changes",name:"allow-empty",type:Boolean},{defaultValue:!1,description:"Automatically stage new files that tasks create during the run",name:"auto-stage",type:Boolean},{description:"Number of concurrent tasks or false for serial",name:"concurrent",type:String},{defaultValue:!1,description:"Run all tasks to completion even if one fails",name:"continue-on-error",type:Boolean},{description:"Working directory to run all tasks in",name:"cwd",type:String},{defaultValue:!1,description:"Enable debug output",name:"debug",type:Boolean},{description:"Override the default --staged flag of git diff",name:"diff",type:String},{description:"Override the default diff-filter",name:"diff-filter",type:String},{defaultValue:!1,description:"Fail with exit code 1 when tasks modify tracked files",name:"fail-on-changes",type:Boolean},{defaultValue:!1,description:"Kill in-flight tasks with SIGKILL on fast-fail instead of the default SIGTERM",name:"force-kill",type:Boolean},{defaultValue:!1,description:"Hide unstaged changes from partially staged files",name:"hide-partially-staged",type:Boolean},{defaultValue:!1,description:"Hide all unstaged changes before running tasks",name:"hide-unstaged",type:Boolean},{defaultValue:!1,description:"Suppress console output",name:"quiet",type:Boolean},{defaultValue:!1,description:"Pass filepaths relative to cwd to tasks",name:"relative",type:Boolean},{defaultValue:!1,description:"Revert to original state in case of errors",name:"revert",type:Boolean},{defaultValue:!0,description:"Enable backup stash",name:"stash",type:Boolean},{defaultValue:!1,description:"Show task output even when tasks succeed",name:"verbose",type:Boolean}]};var a0=Object.defineProperty,c0=d((e,t)=>a0(e,"name",{value:t,configurable:!0}),"t$6");const l0={description:"Show a workspace health dashboard at a glance",examples:[["vis status","Full status overview"],["vis status --json","Machine-readable output"]],group:"Workspace",loader:c0(()=>import("./handler21.js"),"loader"),name:"status",options:[{defaultValue:!1,description:"Emit JSON output",name:"json",type:Boolean}]};var p0=Object.defineProperty,u0=d((e,t)=>p0(e,"name",{value:t,configurable:!0}),"e$7");const d0={argument:{description:"What to sync: codeowners | package-json-fields",name:"kind",type:String},description:"Synchronise derived workspace artefacts (codeowners, package.json fields, tsconfig refs, …)",examples:[["vis sync codeowners","Generate CODEOWNERS at the repository root"],["vis sync codeowners --out=.github/CODEOWNERS","Write to .github/CODEOWNERS instead"],["vis sync codeowners --check","Fail if the existing file is stale"],["vis sync package-json-fields","Mirror license/author/repository/bugs/homepage/engines from root to every workspace package"],["vis sync package-json-fields --check","Fail if any workspace package.json is out of sync"],["vis sync package-json-fields --fields license,engines","Override the default field list for this run"]],group:"Workspace",loader:u0(()=>import("./handler35.js"),"loader"),name:"sync",options:[{description:"Output path for the generated file (default: <workspace>/CODEOWNERS) — codeowners kind only",name:"out",type:String},{defaultValue:!1,description:"Verify state without writing (exit non-zero if drift is found)",name:"check",type:Boolean},{description:"Comma-separated list of fields to mirror from root → workspace packages (package-json-fields kind only). Repeatable.",multiple:!0,name:"fields",type:String},{description:"Glob pattern of package names to skip (package-json-fields kind only). Repeatable.",multiple:!0,name:"ignore-package-name",type:String},{defaultValue:"human",description:"Output format for package-json-fields: human | json",name:"format",type:String},{defaultValue:!1,description:"Suppress per-package log lines; print only the summary (package-json-fields kind only)",name:"quiet",type:Boolean}]};var f0=Object.defineProperty,m0=d((e,t)=>f0(e,"name",{value:t,configurable:!0}),"t$4");const g0={argument:{description:"Task ID to explain (e.g. @my/app:build)",name:"taskId",type:String},description:"Explain why a task is included in the graph by walking its dependency chain to a root",examples:[["vis task-why @myorg/app:build","Show what pulls build in"],["vis task-why lib-a:test","Check the test task's triggers"]],group:"Workspace",loader:m0(()=>import("./handler22.js"),"loader"),name:"task-why"};var h0=Object.defineProperty,y0=d((e,t)=>h0(e,"name",{value:t,configurable:!0}),"e$6");const v0={argument:{description:"Subcommand: status | detect | install | use | which",name:"action",type:String},description:"Inspect and delegate to the workspace version managers (proto, mise, fnm, volta, asdf, nvm, corepack)",examples:[["vis toolchain status","Show every detected manager + expected vs actual tool versions"],["vis toolchain install","Install pinned versions — per-tool delegation"],["vis toolchain use node@22.13.0","Pin node 22.13.0 via the best runtime manager"],["vis toolchain use pnpm@10.32.1","Update the packageManager field; pnpm self-activates"],["vis toolchain which node","Resolve the node binary the manager would launch"],["vis toolchain detect","Print the primary manager's name"]],group:"Workspace",loader:y0(()=>import("./handler23.js"),"loader"),name:"toolchain",options:[{defaultValue:!1,description:"With `status`: exit 1 if any tool mismatches",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Print the command that would run, but don't execute",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Emit JSON (status subcommand only)",name:"json",type:Boolean},{defaultValue:!0,description:"With `use`: also mirror the version into engines.<tool> when that field already exists. --no-engines to skip.",name:"engines",type:Boolean}]};var b0=Object.defineProperty,k0=d((e,t)=>b0(e,"name",{value:t,configurable:!0}),"e$5");const $0={argument:{description:"Packages to unlink (omit for current package)",name:"packages",type:String},description:"Unlink a previously linked package",examples:[["vis unlink","Unlink current package"],["vis unlink react","Unlink specific package"],["vis unlink -r","Unlink in all workspace packages"]],group:"Dependencies",loader:k0(()=>import("./handler24.js"),"loader"),name:"unlink",options:[{alias:"r",defaultValue:!1,description:"Unlink in all workspace packages",name:"recursive",type:Boolean}]};var w0=Object.defineProperty,S0=d((e,t)=>w0(e,"name",{value:t,configurable:!0}),"e$4");const j0={alias:"up",argument:{description:"Packages to update (updates all if omitted)",name:"packages",type:String},description:"Update packages to their latest versions",examples:[["vis update react","Update react within semver range"],["vis up react -L","Update react to latest"],["vis update -i","Interactive mode"],["vis update --filter app","Update in specific workspace"],["vis update -r","Update in all workspaces"],["vis update --target minor","Only apply minor/patch updates (catalog mode)"],["vis update --dry-run","Preview changes without applying"],["vis update --exclude '@types/*'","Exclude packages by pattern"],["vis update --changelog","Show changelog links after updating"],["vis update --rollback","Restore catalog from last backup"],["vis update --ai","Run AI analysis before applying updates"]],group:"Dependencies",loader:S0(()=>import("./handler33.js"),"loader"),name:"update",options:[{alias:"L",defaultValue:!1,description:"Update to latest version (ignore semver range)",name:"latest",type:Boolean},{alias:"t",description:"Update target: latest, minor, or patch (default: latest, catalog mode)",name:"target",type:String},{alias:"d",defaultValue:!1,description:"Preview changes without applying",name:"dry-run",type:Boolean},{alias:"g",defaultValue:!1,description:"Update global packages",name:"global",type:Boolean},{alias:"r",defaultValue:!1,description:"Update recursively in all workspace packages",name:"recursive",type:Boolean},{description:"Filter packages in monorepo",name:"filter",type:String},{alias:"w",defaultValue:!1,description:"Include workspace root",name:"workspace-root",type:Boolean},{alias:"D",defaultValue:!1,description:"Update only devDependencies",name:"dev",type:Boolean},{alias:"P",defaultValue:!1,description:"Update only dependencies",name:"prod",type:Boolean},{alias:"i",defaultValue:!1,description:"Interactive mode",name:"interactive",type:Boolean},{defaultValue:!1,description:"Don't update optionalDependencies",name:"no-optional",type:Boolean},{alias:"l",defaultValue:!1,description:"Include packages with pinned/exact versions (no ^ or ~ prefix)",name:"include-locked",type:Boolean},{defaultValue:!1,description:"Update lockfile only",name:"no-save",type:Boolean},{description:"Glob pattern to include packages (repeatable, catalog mode)",lazyMultiple:!0,name:"include",type:String},{description:"Glob pattern to exclude packages (repeatable, catalog mode)",lazyMultiple:!0,name:"exclude",type:String},{defaultValue:!1,description:"Include prerelease versions (catalog mode)",name:"prerelease",type:Boolean},{defaultValue:!1,description:"Check for known security vulnerabilities (via OSV.dev)",name:"security",type:Boolean},{defaultValue:!1,description:"Skip catalog mode, use package manager directly",name:"no-catalog",type:Boolean},{description:"Output format: table, json, or minimal (default: table)",name:"format",type:String},{defaultValue:!1,description:"Show changelog URLs for updated packages",name:"changelog",type:Boolean},{description:"Run install after catalog update, --no-install to skip (default: true)",name:"install",type:Boolean},{defaultValue:!1,description:"Restore catalog file from the last backup",name:"rollback",type:Boolean},{defaultValue:!1,description:"Run AI analysis on outdated packages before updating (catalog mode)",name:"ai",type:Boolean},{description:"AI analysis type: impact, security, compatibility, or recommend (default: impact)",name:"ai-type",type:String},{defaultValue:!1,description:"Skip typosquat name check for package arguments",name:"no-typosquat-check",type:Boolean},{description:"Cap concurrent registry requests during outdated checks (default: 8)",name:"max-concurrent-requests",type:Number},{description:"Release channel filter: stable (default), same (match current's prerelease channel), or any",name:"release-channel",type:String}]};var O0=Object.defineProperty,E0=d((e,t)=>O0(e,"name",{value:t,configurable:!0}),"e$3");const R0={argument:{description:"Target version (defaults to latest)",name:"version",type:String},description:"Update vis itself to the latest version",examples:[["vis self-update","Update to latest"],["vis self-update 2.0.0","Install specific version"],["vis self-update --check","Check for updates without installing"]],group:"System",loader:E0(()=>import("./handler25.js"),"loader"),name:"self-update",options:[{defaultValue:!1,description:"Check for updates without installing",name:"check",type:Boolean},{defaultValue:!1,description:"Reinstall even if already current",name:"force",type:Boolean},{defaultValue:!1,description:"Suppress output (CI mode)",name:"silent",type:Boolean}]};var C0=Object.defineProperty,x0=d((e,t)=>C0(e,"name",{value:t,configurable:!0}),"e$2");const N0={alias:"explain",argument:{description:"Package(s) to explain",name:"packages",type:String},description:"Show why a package is installed (dependency chain)",examples:[["vis why react","Show why react is installed"],["vis why react --json","Output as JSON"],["vis why react -r","Check across all workspaces"],["vis explain react","Alias matching npm's command"]],group:"Dependencies",loader:x0(()=>import("./handler26.js"),"loader"),name:"why",options:[{defaultValue:!1,description:"Output as JSON",name:"json",type:Boolean},{defaultValue:!1,description:"Show extended information (pnpm)",name:"long",type:Boolean},{defaultValue:!1,description:"Machine-readable output (pnpm)",name:"parseable",type:Boolean},{alias:"r",defaultValue:!1,description:"Check across all workspaces",name:"recursive",type:Boolean},{alias:"D",defaultValue:!1,description:"Filter to dev dependencies (pnpm)",name:"dev",type:Boolean},{alias:"P",defaultValue:!1,description:"Filter to production dependencies (pnpm)",name:"prod",type:Boolean},{defaultValue:!1,description:"Exclude optional dependencies (pnpm)",name:"no-optional",type:Boolean},{alias:"g",defaultValue:!1,description:"Check globally installed packages (pnpm)",name:"global",type:Boolean},{description:"Limit dependency tree depth",name:"depth",type:Number},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String}]};var I0=Object.defineProperty,Hn=d((e,t)=>I0(e,"name",{value:t,configurable:!0}),"e$1");Hn((e,t)=>!process.stderr.isTTY||process.env.TERM==="dumb"?e===t?t:`${e} (${Wt(t)})`:dd(e,t),"link");const P0=Hn(()=>{if(process.env.VIS_VERSION)return process.env.VIS_VERSION;try{const e=new URL("../../package.json",import.meta.url);return le(e).version}catch{return"0.0.0"}},"getVersion"),A0=Hn(()=>{process.env.VIS_VERSION=P0()},"injectVersion"),T0=Hn(e=>{!process.stdout.isTTY||pt||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${e}\x07`)},"setTerminalTitle");var D0=Object.defineProperty,L0=d((e,t)=>D0(e,"name",{value:t,configurable:!0}),"v$2");const B0={beforeCommand:L0(async e=>{try{const t=e.options?.cwd,r=e.options?.config;let n;if(t)n=jr(process.cwd(),t);else{const a=process.env.VIS_MONOREPO_ROOT;n=a&&a.length>0?a:Dc(process.cwd()).path}e.workspaceRoot=n;const s=r?jr(process.cwd(),r):void 0;let o=s??Nt(n);try{e.visConfig=await Xi(n,s?{explicitConfigPath:s}:void 0);const a=e.visConfig?.versionConstraint;if(a&&!st.validRange(a)){e.logger.error(""),e.logger.error(Xn(Ze("✖ Invalid versionConstraint"))),e.logger.error(` vis.config.ts has versionConstraint ${Ze(JSON.stringify(a))}, which is not a valid semver range.`),e.logger.error(""),process.exitCode=1;return}if(a&&!st.satisfies(ln.version,a)){e.logger.error(""),e.logger.error(Xn(Ze("✖ vis version too old"))),e.logger.error(` vis.config.ts requires vis ${Ze(a)}, but the current version is ${Ze(ln.version)}.`),e.logger.error(` ${hr("→")} Upgrade: ${gt("pnpm add -D @visulima/vis@latest")}`),e.logger.error(""),process.exitCode=1;return}}catch(a){const c=o,l=a instanceof Error?a.message:String(a);e.visConfigError={file:c??void 0,message:l};const p=!!process.stdout.isTTY&&!pt;if(c&&!p){if(e.logger.error(""),e.logger.error(Xn(Ze(`✖ Failed to load ${c}`))),e.logger.error(` ${l}`),e.logger.error(""),l.includes("Cannot find module")){const f=/Cannot find module '([^']+)'/.exec(l)?.[1]??"unknown";e.logger.error(`${hr("→ Hint:")} The module ${Ze(f)} could not be resolved.`),f.includes("@visulima/vis")?(e.logger.error(" This usually means the package isn't installed or the export path changed."),e.logger.error(` Try: ${gt("pnpm add @visulima/vis")}`),e.logger.error(` Or regenerate: ${gt("vis init --force")}`)):e.logger.error(` Try: ${gt(`pnpm add ${f}`)}`)}else l.includes("SyntaxError")||l.includes("Unexpected token")?(e.logger.error(`${hr("→ Hint:")} The config file has a syntax error.`),e.logger.error(" Check your config for typos or invalid syntax."),e.logger.error(` Or regenerate: ${gt("vis init --force")}`)):(e.logger.error(`${hr("→ Hint:")} Delete the broken config and recreate it:`),e.logger.error(` ${gt(`rm ${c} && vis init`)}`));e.logger.error(""),e.logger.error(` Continuing with default settings.
233
+ `)}e.visConfig={}}const i=process.argv[2]??"";if(!new Set(["--help","--version","-h","-V","create","help","implode","init"]).has(i)&&!o&&!pt)if(process.stdin.isTTY){const a=qc({input:process.stdin,output:process.stderr}),c=await new Promise(l=>{a.question("\x1B[36;1m?\x1B[0m \x1B[1mNo vis.config.ts found. Create one with best-practice security defaults?\x1B[0m \x1B[90m(\x1B[92mY\x1B[90m/n)\x1B[0m ",l),a.on("SIGINT",()=>{a.close(),l("n")})});if(a.close(),!c.trim()||c.trim().toLowerCase()==="y"||c.trim().toLowerCase()==="yes"){const l=y(n,"vis.config.ts"),p=['import { defineConfig } from "@visulima/vis/config";',"","// Secure defaults are applied automatically by defineConfig().","// You only need to add allowBuilds for packages with build scripts.","// Run 'vis check --security-config' to see all active settings.","export default defineConfig({"," security: {"," allowBuilds: {",' // "esbuild": true,'," },"," },","});",""].join(`
234
+ `);ue(l,p),e.logger.info(`✓ Created ${l}
235
+ `),e.visConfig=await Xi(n),o=l}}else e.logger.warn("No vis.config.ts found. Run 'vis init' to create one with best-practice security defaults.")}catch(t){t instanceof Error&&!t.message.includes("monorepo root")&&e.logger.warn(`Failed to detect workspace: ${t.message}`),e.visConfig={}}},"beforeCommand"),name:"config-loader"};var M0=Object.defineProperty,zi=d((e,t)=>M0(e,"name",{value:t,configurable:!0}),"n$3");const V0=336*60*60*1e3,_0="https://github.com/sponsors/prisis",vo=y(Zt(),".vis",".sponsor-state.json"),F0=zi(()=>{try{if(k(vo))return le(vo)}catch{}return{lastShown:0}},"readState"),q0=zi(e=>{try{rt(y(Zt(),".vis")),oe(vo,JSON.stringify(e))}catch{}},"writeState"),U0=zi(e=>{if(!e.success||process.env.VIS_CLI_TEST||pt||process.env.VIS_NO_SPONSOR==="1"||e.visConfig?.sponsor?.enabled===!1||!process.stderr.isTTY)return;const t=Date.now(),r=F0();t-r.lastShown<V0||(process.stderr.write(`
236
+ ${fd("♥")} ${Ze("Enjoying visulima?")} ${Wt(`Consider sponsoring at ${_0}`)}
237
+ ${Wt(" Hide this with VIS_NO_SPONSOR=1 or sponsor.enabled = false in vis.config.ts")}
238
+ `),q0({lastShown:t}))},"showSponsorNotice");var W0=Object.defineProperty,X=d((e,t)=>W0(e,"name",{value:t,configurable:!0}),"e");const xc=300*1e3,bo=y(Zt(),".vis",".tip-state.json"),G0=X(()=>{try{if(k(bo))return le(bo)}catch{}return{lastGlobal:0,perTip:{}}},"readState"),J0=X(e=>{try{rt(y(Zt(),".vis")),oe(bo,JSON.stringify(e))}catch{}},"writeState"),K0=[{cooldownMs:1800*1e3,id:"short-aliases",matches:X(e=>["install","link","remove","uninstall","update"].includes(e.command),"matches"),message:X(e=>{const t={install:"i",link:"ln",remove:"rm",uninstall:"rm",update:"up"}[e.command];return t?`You can use 'vis ${t}' as a shorthand for 'vis ${e.command}'`:""},"message"),probability:.5},{id:"use-exec",matches:X(e=>e.command==="dlx"&&e.success,"matches"),message:X(()=>"Use 'vis exec' to run locally installed binaries without downloading.","message")},{id:"security-check",matches:X(e=>(e.command==="check"||e.command==="update")&&e.success&&!e.args.includes("--security"),"matches"),message:X(()=>"Add --security to check for known vulnerabilities via OSV.dev","message"),probability:.3},{cooldownMs:3600*1e3,id:"ai-analysis",matches:X(e=>(e.command==="check"||e.command==="update")&&e.success&&!e.args.includes("--ai"),"matches"),message:X(()=>"Add --ai to run AI analysis on outdated packages before updating.","message"),probability:.2},{cooldownMs:1440*60*1e3,id:"socket-security",matches:X(e=>(e.command==="install"||e.command==="update"||e.command==="check")&&e.success,"matches"),message:X(()=>"Enable Socket.dev in vis.config.ts for security scores and supply chain alerts: security.socket.enabled = true","message"),probability:.15},{id:"dedupe-after-install",matches:X(e=>e.command==="install"&&e.success,"matches"),message:X(()=>"Run 'vis dedupe' periodically to remove duplicate dependencies.","message"),probability:.15},{cooldownMs:720*60*1e3,id:"doctor-checkup",matches:X(e=>(e.command==="install"||e.command==="add"||e.command==="update")&&e.success,"matches"),message:X(()=>"Run 'vis doctor' for a full project health check — outdated, security, duplicates, and optimizations in one view.","message"),probability:.25},{cooldownMs:10080*60*1e3,id:"init-config",matches:X(e=>(e.command==="install"||e.command==="run")&&e.success&&!e.hasVisConfig,"matches"),message:X(()=>"Run 'vis init' to create a vis.config.ts with secure defaults — supply chain protection enabled automatically.","message"),probability:.4},{id:"why-command",matches:X(e=>e.command==="outdated"&&e.success,"matches"),message:X(()=>"Use 'vis why <package>' to understand why a dependency is installed.","message"),probability:.3},{id:"graph-command",matches:X(e=>e.command==="run"&&e.success,"matches"),message:X(()=>"Use 'vis graph' to visualize your project dependency graph.","message"),probability:.1},{id:"affected-command",matches:X(e=>e.command==="run"&&e.success&&!e.args.includes("--projects"),"matches"),message:X(()=>"Use 'vis affected <target>' to run tasks only on changed projects.","message"),probability:.2},{id:"pm-cache",matches:X(e=>e.command==="install"&&e.success,"matches"),message:X(()=>"Use 'vis pm cache dir' to find your package manager's cache location.","message"),probability:.1},{id:"create-editor",matches:X(e=>e.command==="create"&&e.success,"matches"),message:X(()=>"Add --editor vscode to generate VS Code configuration during project creation.","message"),probability:.5},{id:"env-pin",matches:X(e=>e.command==="env"&&e.args.includes("install")&&e.success,"matches"),message:X(()=>"Use 'vis env pin <version>' to pin the Node.js version for your project.","message"),probability:.5},{id:"upgrade-check",matches:X(e=>e.command!=="self-update"&&e.success,"matches"),message:X(()=>"Run 'vis self-update --check' to see if a newer version of vis is available.","message"),probability:.05}],z0=X(e=>{if(process.env.VIS_CLI_TEST||pt)return;const t=Date.now(),r=G0();if(t-r.lastGlobal<xc)return;const n=K0.filter(i=>{if(!i.matches(e))return!1;const a=r.perTip[i.id]??0,c=i.cooldownMs??xc;return t-a>=c});if(n.length===0)return;const s=n.find(i=>{const a=i.probability??1;return Math.random()<a});if(!s)return;const o=s.message(e);o&&(process.stderr.write(`
239
+ \x1B[2mtip: ${o}\x1B[0m
240
+ `),r.lastGlobal=t,r.perTip[s.id]=t,J0(r))},"showTip");var H0=Object.defineProperty,Nc=d((e,t)=>H0(e,"name",{value:t,configurable:!0}),"i$1");const Y0=Nc(e=>({afterCommand:Nc(async t=>{const r=process.argv.slice(2),n=r[0]??"",s=process.exitCode===void 0||process.exitCode===0;e&&e(),z0({args:r,command:n,hasVisConfig:t.visConfig!==void 0&&Object.keys(t.visConfig).length>0,success:s}),U0({success:s,visConfig:t.visConfig})},"afterCommand"),name:"post-command"}),"postCommandPlugin"),q=gd();var X0=Object.defineProperty,we=d((e,t)=>X0(e,"name",{value:t,configurable:!0}),"n$2");const Mt=we((e,t,r,n)=>{for(const s of t)e.push("--filter",s);r&&e.push("--recursive"),n&&e.push("--workspace-root")},"pushFilterGlobals"),Q0=we(e=>{const t=[],r=[];return Mt(t,e.filter,e.recursive,e.workspaceRoot),e.silent&&t.push("--silent"),e.frozenLockfile&&t.push("--frozen-lockfile"),t.push("install"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.force&&t.push("--force"),e.ignoreScripts&&t.push("--ignore-scripts"),e.lockfileOnly&&t.push("--lockfile-only"),e.noOptional&&t.push("--no-optional"),e.offline&&t.push("--offline"),{args:t,bin:"aube",warnings:r}},"resolveAubeInstall"),Z0=we(e=>{const t=[],r=[];return Mt(t,e.filter,!1,!1),t.push("add"),e.saveDev&&t.push("--save-dev"),e.exact&&t.push("--save-exact"),e.global&&t.push("--global"),e.optional&&t.push("--save-optional"),e.peer&&t.push("--save-peer"),e.workspace&&r.push("aube has no flag for the `workspace:` protocol; it auto-detects local workspace members during add. Ignoring --workspace."),e.workspaceRoot&&t.push("--workspace"),t.push(...e.packages),{args:t,bin:"aube",warnings:r}},"resolveAubeAdd"),eO=we(e=>{const t=[];return Mt(t,e.filter,e.recursive,!1),t.push("remove"),e.saveDev&&t.push("--save-dev"),e.global&&t.push("--global"),e.workspaceRoot&&t.push("--workspace"),t.push(...e.packages),{args:t,bin:"aube",warnings:[]}},"resolveAubeRemove"),tO=we(e=>{const t=["dedupe"];return e&&t.push("--check"),{args:t,bin:"aube",warnings:[]}},"resolveAubeDedupe"),rO=we(e=>{const t=[],r=[];Mt(t,e.filter,e.recursive,!1),t.push("why"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.json&&t.push("--json"),e.long&&t.push("--long"),e.parseable&&t.push("--parseable"),e.depth!==void 0&&r.push("aube why does not accept --depth; ignoring."),e.noOptional&&r.push("aube why does not accept --no-optional; ignoring."),e.global&&r.push("aube why does not accept --global; ignoring.");const[n,...s]=e.packages;return n===void 0?r.push("aube why requires a package name; none provided."):(s.length>0&&r.push("aube why takes a single package; using the first."),t.push(n)),{args:t,bin:"aube",warnings:r}},"resolveAubeWhy"),nO=we(e=>{const t=[],r=[];e.workspaceRoot&&r.push("aube outdated has no `--include-workspace-root` equivalent. Run `vis outdated` separately at the workspace root if you need its outdated list."),Mt(t,e.filter,e.recursive,!1),t.push("outdated"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.long&&t.push("--long"),e.format==="json"?t.push("--json"):e.format&&e.format!=="table"&&r.push(`aube outdated does not support format "${e.format}"; falling back to default table output.`),e.compatible&&r.push("aube outdated does not accept --compatible; ignoring."),e.noOptional&&r.push("aube outdated does not accept --no-optional; ignoring."),e.global&&r.push("aube outdated does not accept --global; ignoring.");const[n,...s]=e.packages;return n!==void 0&&(s.length>0&&r.push("aube outdated takes a single pattern argument; using the first."),t.push(n)),{args:t,bin:"aube",warnings:r}},"resolveAubeOutdated"),sO=we(e=>{const t=[];e.silent&&t.push("--silent"),t.push("dlx");for(const r of e.additionalPackages)t.push("--package",r);return e.shellMode&&t.push("--shell-mode"),t.push(e.package),t.push(...e.args),{args:t,bin:"aube",warnings:[]}},"resolveAubeDlx"),oO=we(e=>{const t=[];return Mt(t,e.filter,e.recursive,e.workspaceRoot),t.push("exec"),e.parallel&&t.push("--parallel"),e.reverse&&t.push("--reverse"),e.shellMode&&t.push("--shell-mode"),t.push(e.command),t.push(...e.args),{args:t,bin:"aube",warnings:[]}},"resolveAubeExec"),iO=we(e=>{const t=["link"];return e!==null&&t.push(e),{args:t,bin:"aube",warnings:[]}},"resolveAubeLink"),aO=we((e,t)=>{const r=[],n=[];return t&&r.push("--recursive"),r.push("unlink"),e.length>1&&n.push("aube unlink takes a single package; using the first."),e.length>0&&r.push(e[0]),{args:r,bin:"aube",warnings:n}},"resolveAubeUnlink"),cO=we(e=>{const t=["view","--",e.package],r=[],[n,...s]=e.fields;return n!==void 0?(s.length>0&&r.push("aube view only supports a single field; using the first."),e.json&&r.push("aube view does not support --json with a field selector; printing the field without --json."),t.push(n)):e.json&&t.push("--json"),{args:t,bin:"aube",warnings:r}},"resolveAubeInfo"),yR=we(e=>{const t=[],r=[];return Mt(t,e.filters,e.recursive,e.workspaceRoot),t.push("update"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.global&&t.push("--global"),e.interactive&&t.push("--interactive"),e.latest&&t.push("--latest"),e.noOptional&&t.push("--no-optional"),e.noSave&&t.push("--no-save"),t.push(...e.packages),{args:t,bin:"aube",warnings:r}},"resolveAubeUpdate"),lO=new Set(["fund","ping","search","token"]),pO=we((e,t)=>lO.has(e)?{args:[e,...t],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...t],bin:"aube",warnings:[]},"resolveAubePmCommand");var uO=Object.defineProperty,Y=d((e,t)=>uO(e,"name",{value:t,configurable:!0}),"o$2");const ko=Y(e=>Yu(e)!==null,"hasBinaryOnPath"),dO=Y(e=>{const t=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["bun.lock","bun"],["bun.lockb","bun"],["deno.lock","deno"]];let r=e;for(;;){for(const[s,o]of t)if(k(y(r,s)))return o;const n=Ar(r);if(n===r||So(r).root===r)return;r=n}},"findNonAubeLockfile"),vR=Y((e,t)=>{if(t.name!=="aube")return;const r=dO(e);if(r!==void 0)return`Resolved installer is aube but the workspace has a ${r} lockfile. Aube reads and writes ${r}'s lockfile format in place, but its byte output may differ subtly — expect a one-time churn diff on the first install, and ongoing drift if your team mixes tools on the same lockfile. To pin the choice across the team, set \`install.backend\` in vis.config; to bypass aube for this run, pass --no-aube.`},"detectLockfileDrift"),Hi=Y(e=>{if(k(e))try{return JSON.parse(P(e,{buffer:!1}))}catch{return}},"readJson"),fO=Y(e=>{let t=e;for(;;){const r=y(t,"package.json"),n=Hi(r);if(n&&typeof n.packageManager=="string"&&n.packageManager.length>0)return n.packageManager;const s=Ar(t);if(s===t||So(t).root===t)return;t=s}},"readPackageManagerField"),ku=new Set(["npm","pnpm","yarn"]),Ic=Y((e,t,r)=>r===!1||!ku.has(t)||!ko("corepack")?!1:r===!0?!0:fO(e)!==void 0,"shouldUseCorepack"),bR=Y((e,t)=>{const r=t.backend,n=process.env.VIS_INSTALLER,s=r??n??t.configBackend,o=t.configCorepack??"auto";if(s&&s!=="auto"){if(s==="aube"&&!ko("aube"))throw new Error('install.backend is set to "aube" but the `aube` binary is not on PATH. Install it via `npm i -g @endevco/aube`, `mise use -g aube`, or `brew install endevco/tap/aube`.');return{name:s,useCorepack:Ic(e,s,o),version:"latest"}}if(ko("aube"))return{name:"aube",useCorepack:!1,version:"latest"};const i=$u(e);return{...i,useCorepack:Ic(e,i.name,o)}},"resolveInstaller"),$u=Y(e=>{if(!k(e))throw new Error(`Could not detect package manager in ${e}. Directory does not exist.`);const t=id(e);return{name:t.name,version:t.version||"latest"}},"detectPm"),mO=Y((e,t)=>t.useCorepack!==!0||!ku.has(t.name)||e.bin==="corepack"?e:{...e,args:[t.name,...e.args],bin:"corepack"},"applyCorepack"),gO=Y((e,t,r)=>{if(r===void 0)return Xu(e.bin,e.args,t);const n=St(e.bin,e.args,{cwd:t,env:{...process.env,...r},stdio:"inherit"});if(n.error)throw n.error;return n.status??1},"spawnResolved"),Ee=Y((e,t,r,n,s={})=>{const o=mO(t,e);for(const i of o.warnings)n.warn(`warning: ${i}`);return s.dry?(n.log(`[dry-run] ${o.bin} ${o.args.join(" ")}`),0):gO(o,r,s.env)},"runResolved"),mt=Y((e,t,r,n,s={})=>Ee(e,t(),r,n,s),"resolveAndRun"),hO=Y((e,t)=>t==="aube"||t==="deno"?e:{...e,args:[...e.args,"--prefer-offline"]},"applyPreferOffline"),kR=Y((e,t,r,n,s={})=>{let o=e.name==="aube"?Q0(t):zu(e.name,e.version,{...t,silent:t.silent||s.silent===!0});return s.preferOffline&&(o=hO(o,e.name)),Yi(e,o,r,n,{dry:s.dry,env:s.env})},"runInstall"),wu=Y((e,t)=>{const r=t==="deno"?"--quiet":"--silent";return{...e,args:[...e.args,r]}},"applySilent"),yO=Y((e,t)=>t==="yarn"||t==="aube"?null:{...e,args:[...e.args,"--dry-run"]},"applyDryRun"),Yi=Y((e,t,r,n,s)=>{if(s.dry!==!0)return Ee(e,t,r,n,s);const o=yO(t,e.name);return o===null?Ee(e,t,r,n,s):Ee(e,o,r,n,{env:s.env})},"runWithNativeDryRun"),vO=Y((e,t)=>t==="aube"?{...e,args:[...e.args,"--ignore-scripts"]}:t==="deno"?e:{...e,args:[...e.args,"--ignore-scripts"]},"applyIgnoreScripts"),bO=Y((e,t,r,n,s={})=>{let o=e.name==="aube"?Z0(t):Hu(e.name,e.version,t);s.ignoreScripts&&(o=vO(o,e.name)),s.silent&&(o=wu(o,e.name));const i=Yi(e,o,r,n,{dry:s.dry,env:s.env});return i===0&&s.autoInstallPeers&&SO(e,t,r,n,s),i},"runAdd"),kO=Y(e=>{if(e.startsWith("@")){const r=e.indexOf("/");if(r===-1)return e;const n=e.indexOf("@",r);return n===-1?e:e.slice(0,n)}const t=e.indexOf("@");return t===-1?e:e.slice(0,t)},"stripVersionRange"),$O=Y((e,t)=>{let r=e;for(;;){const n=y(r,"node_modules",t,"package.json"),s=Hi(n);if(s)return s;const o=Ar(r);if(o===r||So(r).root===r)return;r=o}},"findInstalledManifest"),wO=Y(e=>{const t=Hi(y(e,"package.json")),r=new Set;if(!t)return r;for(const n of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const s=t[n];if(s)for(const o of Object.keys(s))r.add(o)}return r},"collectExistingDeps"),SO=Y((e,t,r,n,s)=>{if(e.name==="deno")return;const o=wO(r),i=new Map;for(const l of t.packages){const p=kO(l),f=$O(r,p);if(!f?.peerDependencies)continue;const u=f.peerDependenciesMeta??{};for(const[m,h]of Object.entries(f.peerDependencies))u[m]?.optional||o.has(m)||i.has(m)||i.set(m,h)}if(i.size===0)return;const a=[...i.entries()].map(([l,p])=>`${l}@${p}`);n.log(`auto-installing peer dependencies: ${a.join(", ")}`);const c={exact:!1,filter:t.filter,global:!1,optional:!1,packages:a,peer:!1,saveDev:t.saveDev,workspace:!1,workspaceRoot:t.workspaceRoot};bO(e,c,r,n,{ignoreScripts:s.ignoreScripts})},"installMissingPeers"),$R=Y((e,t,r,n,s={})=>{let o=e.name==="aube"?eO(t):nd(e.name,e.version,t);return s.silent&&(o=wu(o,e.name)),Yi(e,o,r,n,{dry:s.dry,env:s.env})},"runRemove"),wR=Y((e,t,r,n,s={})=>e.name==="aube"?Ee(e,tO(t),r,n,s):mt(e,()=>Qu(e.name,e.version,t),r,n,s),"runDedupe"),SR=Y((e,t,r,n,s={})=>e.name==="aube"?Ee(e,rO(t),r,n,s):mt(e,()=>od(e.name,e.version,t),r,n,s),"runWhy");Y((e,t,r,n,s={})=>e.name==="aube"?Ee(e,nO(t),r,n,s):mt(e,()=>ad(e.name,e.version,t),r,n,s),"runOutdated");const jO=Y((e,t)=>{if(e.name==="aube")return cO(t);const r=[],n=[],s=e.name;switch(e.name){case"bun":{const o=st.coerce(e.version);o&&st.lt(o,"1.3.0")&&n.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${t.package}\` instead.`),r.push("pm","view","--",t.package,...t.fields),t.json&&r.push("--json");break}case"deno":{const o=t.package.startsWith("npm:")||t.package.startsWith("jsr:")||t.package.startsWith("https://")||t.package.startsWith("http://")||t.package.startsWith("file:")?t.package:`npm:${t.package}`;r.push("info","--",o),t.json&&r.push("--json"),t.fields.length>0&&n.push("deno info does not accept field selectors; ignoring.");break}case"npm":case"pnpm":{r.push("view","--",t.package,...t.fields),t.json&&r.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){r.push("info","--",t.package);const[o,...i]=t.fields;o!==void 0&&(i.length>0&&n.push("yarn v1 only supports querying one field at a time; using the first."),r.push(o)),t.json&&r.push("--json")}else r.push("npm","info","--",t.package),t.fields.length>0&&n.push("yarn berry does not support field arguments to 'npm info'; ignoring."),t.json&&r.push("--json");break}default:{const o=e.name;throw new Error(`Unsupported package manager: ${o}`)}}return{args:r,bin:s,warnings:n}},"resolveInfo"),jR=Y((e,t,r,n,s={})=>Ee(e,jO(e,t),r,n,s),"runInfo"),OR=Y((e,t,r,n,s={})=>e.name==="aube"?Ee(e,iO(t),r,n,s):mt(e,()=>td(e.name,e.version,t),r,n,s),"runLink"),ER=Y((e,t,r,n,s,o={})=>e.name==="aube"?Ee(e,aO(t,r),n,s,o):mt(e,()=>sd(e.name,e.version,t,r),n,s,o),"runUnlink"),RR=Y((e,t,r,n,s={})=>e.name==="aube"?Ee(e,sO(t),r,n,s):mt(e,()=>Zu(e.name,e.version,t),r,n,s),"runDlx"),CR=Y((e,t,r,n,s={})=>e.name==="aube"?Ee(e,oO(t),r,n,s):mt(e,()=>ed(e.name,e.version,t),r,n,s),"runExec"),xR=Y((e,t,r,n,s,o={})=>e.name==="aube"?Ee(e,pO(t,r),n,s,o):mt(e,()=>rd(e.name,e.version,t,r),n,s,o),"runPmSubcommand");var OO=Object.defineProperty,Re=d((e,t)=>OO(e,"name",{value:t,configurable:!0}),"d$1");const Su=Re((e,t)=>{const r={errors:[],warnings:[]},{security:n}=e;if(!n)return r.warnings.push("No security settings configured. Use defineConfig() from '@visulima/vis/config' to get secure defaults automatically."),r;if((!n.allowBuilds||Object.keys(n.allowBuilds).length===0)&&r.warnings.push(t==="pnpm"?"security.allowBuilds is not configured. pnpm blocks build scripts by default since v10. Run 'vis approve-builds' to review.":"security.allowBuilds is not configured. Consider listing which packages are allowed to run install/postinstall scripts."),n.minimumReleaseAge===0&&r.warnings.push("security.minimumReleaseAge is explicitly set to 0. New packages can be installed immediately after publishing."),n.trustPolicy==="off"&&r.warnings.push("security.trustPolicy is explicitly set to 'off'. Packages whose trust level has decreased will not be blocked."),n.blockExoticSubdeps===!1&&r.warnings.push("security.blockExoticSubdeps is explicitly disabled. Transitive dependencies can pull code from git repos or tarball URLs."),n.strictDepBuilds===!1&&r.warnings.push("security.strictDepBuilds is explicitly disabled. Unapproved build scripts will only produce warnings, not errors."),n.strictDepBuilds&&(!n.allowBuilds||Object.keys(n.allowBuilds).length===0)&&r.errors.push("security.strictDepBuilds is enabled but security.allowBuilds is empty. All dependencies with build scripts will be blocked. Run 'vis approve-builds' to review and add packages."),n.socket?.acceptedRisks){const s=Date.now();for(const[o,i]of Object.entries(n.socket.acceptedRisks)){const a=new Date(i.acceptedAt).getTime();s-a>7776e6&&r.warnings.push(`Accepted risk for "${o}" is over 90 days old (accepted ${i.acceptedAt}). Consider re-evaluating with 'vis audit'.`)}}return r},"checkSecurityConfig"),EO=Re((e,t,r=!1)=>{if(pt&&!process.env.VIS_SECURITY_WARNINGS)return;const n=Su(e,t);for(const o of n.errors)q.error(o);const s=r?n.warnings.filter(o=>!o.startsWith("security.allowBuilds is not configured")):n.warnings;s.length>0&&q.warn(`${s.length} security recommendation${s.length===1?"":"s"} found. Run 'vis check --security-config' for details.`)},"emitSecurityWarnings"),NR=Re((e,t)=>{const r=Su(e,t),{security:n}=e;if(n){if(q.info("Active security settings:"),q.info(` minimumReleaseAge: ${n.minimumReleaseAge??"not set"} minutes`),q.info(` trustPolicy: ${n.trustPolicy??"not set"}`),q.info(` trustPolicyIgnoreAfter: ${n.trustPolicyIgnoreAfter??"not set"} minutes`),q.info(` blockExoticSubdeps: ${n.blockExoticSubdeps??!1}`),q.info(` strictDepBuilds: ${n.strictDepBuilds??!1}`),q.info(` allowBuilds: ${n.allowBuilds?`${Object.keys(n.allowBuilds).length} entries`:"not configured"}`),q.info(""),q.info("Socket.dev integration:"),q.info(` socket.enabled: ${n.socket?.enabled??!1}`),q.info(` socket.apiToken: ${n.socket?.apiToken||process.env.VIS_SOCKET_TOKEN?"configured":"using public token"}`),q.info(` socket.minimumScore: ${n.socket?.minimumScore??"default (0.4)"}`),q.info(` socket.cacheTtlMs: ${n.socket?.cacheTtlMs??"default (1 hour)"}`),q.info(` socket.timeoutMs: ${n.socket?.timeoutMs??"default (15s)"}`),n.socket?.acceptedRisks){const s=Object.entries(n.socket.acceptedRisks);q.info(` socket.acceptedRisks: ${String(s.length)} entr${s.length===1?"y":"ies"}`);for(const[o,i]of s)q.info(` ${o}: ${i.reason} (accepted ${i.acceptedAt.slice(0,10)})`)}else q.info(" socket.acceptedRisks: none");q.info("")}if(r.errors.length===0&&r.warnings.length===0){q.info("All recommended security settings are configured.");return}for(const s of r.errors)q.error(s);for(const s of r.warnings)q.warn(s);q.notice(""),q.notice("Secure defaults are applied by defineConfig(). You only need to add allowBuilds:"),q.notice(""),q.notice(" import { defineConfig } from '@visulima/vis/config';"),q.notice(""),q.notice(" export default defineConfig({"),q.notice(" security: {"),q.notice(" allowBuilds: {"),q.notice(" esbuild: true,"),q.notice(" '@prisma/client': true,"),q.notice(" },"),q.notice(" },"),q.notice(" });")},"printSecurityReport"),IR=Re(e=>{const{security:t}=e;if(!t)return[];const r=[];return t.minimumReleaseAge!==void 0&&r.push(`minimumReleaseAge: ${t.minimumReleaseAge}`),t.trustPolicy&&t.trustPolicy!=="off"&&r.push(`trustPolicy: ${t.trustPolicy}`),t.blockExoticSubdeps&&r.push("blockExoticSubdeps: true"),t.allowBuilds&&r.push(`allowBuilds: ${Object.keys(t.allowBuilds).length} entries`),t.strictDepBuilds&&r.push("strictDepBuilds: true"),t.trustPolicyIgnoreAfter!==void 0&&r.push(`trustPolicyIgnoreAfter: ${t.trustPolicyIgnoreAfter}`),r},"previewPnpmSync"),PR=Re((e,t)=>{const r=y(e,"node_modules");if(!k(r))return[];const n=[],s=Re((o,i="")=>{let a;try{a=Ge(o)}catch{return}for(const c of a){const l=y(o,c);if(c.startsWith("@")){s(l,`${c}/`);continue}if(c.startsWith("."))continue;const p=i+c,f=y(l,"package.json");try{if(!Kt(l).isDirectory()||!k(f))continue;const u=le(f).scripts??{};if(!u.preinstall&&!u.install&&!u.postinstall&&!u.prepare)continue;if(!Object.entries(t).some(([m,h])=>h?m===p?!0:m.endsWith("*")?p.startsWith(m.slice(0,-1)):!1:!1)){const m=["preinstall","install","postinstall","prepare"].filter(h=>u[h]);n.push(`${p} (${m.join(", ")})`)}}catch{}}},"scanDir");return s(r),n},"scanUnapprovedBuildScripts"),ju=Re(e=>k(y(e,".yarnrc.yml")),"isYarnBerry"),RO=Re((e,t,r)=>{const n={extraArgs:[],postInstallPackages:[],scriptsBlockedByDefault:!1,warnings:[]},s=r.security?.allowBuilds??{},o=Object.keys(s).length>0;switch(e){case"bun":{if(n.scriptsBlockedByDefault=!0,o){const i=y(t,"package.json");try{(k(i)?le(i):{}).trustedDependencies?.length||n.warnings.push("vis security.allowBuilds is configured but trustedDependencies is empty. Run 'vis approve-builds --sync-native'.")}catch{}}break}case"npm":{n.scriptsBlockedByDefault=!1;const i=y(t,".npmrc"),a=k(i)&&/^\s*ignore-scripts\s*=\s*true\s*$/m.test(P(i));if(!a&&o?(n.warnings.push("npm does not block lifecycle scripts. vis will add --ignore-scripts automatically."),n.extraArgs.push("--ignore-scripts")):!a&&!o&&n.warnings.push("npm does not block lifecycle scripts. Add 'ignore-scripts=true' to .npmrc and configure security.allowBuilds."),o)for(const[c,l]of Object.entries(s))l&&n.postInstallPackages.push(c);break}case"pnpm":{n.scriptsBlockedByDefault=!0,o||n.warnings.push("pnpm blocks build scripts by default. Run 'vis approve-builds' to review packages that need scripts.");break}case"yarn":{if(n.scriptsBlockedByDefault=!1,ju(t)){const i=P(y(t,".yarnrc.yml"));/^\s*enableScripts\s*:\s*false\s*$/m.test(i)?n.scriptsBlockedByDefault=!0:n.warnings.push("yarn berry supports enableScripts. Add 'enableScripts: false' to .yarnrc.yml.")}else if(n.warnings.push("yarn classic does not support blocking lifecycle scripts. Consider upgrading to yarn berry."),o){n.extraArgs.push("--ignore-scripts");for(const[i,a]of Object.entries(s))a&&n.postInstallPackages.push(i)}break}}return n},"enforceScriptSecurity"),AR=Re((e,t,r)=>{const n=[],s=Object.entries(r).filter(([,o])=>o).map(([o])=>o);switch(e){case"bun":{const o=y(t,"package.json");if(k(o))try{const i=le(o);i.trustedDependencies=s,oe(o,`${JSON.stringify(i,null,2)}
241
+ `),n.push(`Updated package.json trustedDependencies with ${s.length} packages`)}catch(i){n.push(`Failed to update package.json: ${i instanceof Error?i.message:String(i)}`)}break}case"npm":{const o=y(t,".npmrc");let i=k(o)?P(o):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(i)?n.push(".npmrc already has ignore-scripts=true"):(i=`${i.trimEnd()}
66
242
  ignore-scripts=true
67
- `,A(r,i),o.push("Added ignore-scripts=true to .npmrc"));break}case"pnpm":{const r=d(t,"pnpm-workspace.yaml");if(!u(r)){o.push("pnpm-workspace.yaml not found. Cannot sync allowBuilds.");break}let i={};try{i=nn(r)?.allowBuilds??{}}catch{}const s={...i,...n},l=Object.keys(n).filter(R=>i[R]!==n[R]).length;if(l===0){o.push(`All ${String(Object.keys(n).length)} allowBuilds entries already present in pnpm-workspace.yaml.`);break}const c=Object.keys(s).sort(),p=_(R=>R.startsWith("@")||R.includes("/")||/[:#\s]/.test(R),"needsQuote"),h=_(R=>p(R)?`'${R.replaceAll("'","''")}'`:R,"renderKey"),v=`allowBuilds:
68
- ${c.map(R=>` ${h(R)}: ${String(s[R])}`).join(`
243
+ `,oe(o,i),n.push("Added ignore-scripts=true to .npmrc"));break}case"pnpm":{const o=y(t,"pnpm-workspace.yaml");if(!k(o)){n.push("pnpm-workspace.yaml not found. Cannot sync allowBuilds.");break}let i={};try{i=Dr(o)?.allowBuilds??{}}catch{}const a={...i,...r},c=Object.keys(r).filter(g=>i[g]!==r[g]).length;if(c===0){n.push(`All ${String(Object.keys(r).length)} allowBuilds entries already present in pnpm-workspace.yaml.`);break}const l=Object.keys(a).sort(),p=Re(g=>g.startsWith("@")||g.includes("/")||/[:#\s]/.test(g),"needsQuote"),f=Re(g=>p(g)?`'${g.replaceAll("'","''")}'`:g,"renderKey"),u=`allowBuilds:
244
+ ${l.map(g=>` ${f(g)}: ${String(a[g])}`).join(`
69
245
  `)}
70
- `;let $=j(r);$.endsWith(`
71
- `)||($+=`
72
- `);const P=/^allowBuilds:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;$=P.test($)?$.replace(P,v):`${$.trimEnd()}
246
+ `;let m=P(o);m.endsWith(`
247
+ `)||(m+=`
248
+ `);const h=/^allowBuilds:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;m=h.test(m)?m.replace(h,u):`${m.trimEnd()}
73
249
 
74
- ${v}`,A(r,$),o.push(`Updated pnpm-workspace.yaml allowBuilds (${String(l)} new, ${String(c.length)} total)`);break}case"yarn":{if(Fn(t)){const r=d(t,".yarnrc.yml");let i=j(r);const s=/^\s*enableScripts\s*:/m.test(i),l=/^\s*enableScripts\s*:\s*false\s*$/m.test(i);s?l?o.push(".yarnrc.yml already has enableScripts: false"):(i=i.replace(/^\s*enableScripts\s*:.+$/m,"enableScripts: false"),A(r,i),o.push("Changed enableScripts to false in .yarnrc.yml")):(i=`${i.trimEnd()}
250
+ ${u}`,oe(o,m),n.push(`Updated pnpm-workspace.yaml allowBuilds (${String(c)} new, ${String(l.length)} total)`);break}case"yarn":{if(ju(t)){const o=y(t,".yarnrc.yml");let i=P(o);const a=/^\s*enableScripts\s*:/m.test(i),c=/^\s*enableScripts\s*:\s*false\s*$/m.test(i);a?c?n.push(".yarnrc.yml already has enableScripts: false"):(i=i.replace(/^\s*enableScripts\s*:.+$/m,"enableScripts: false"),oe(o,i),n.push("Changed enableScripts to false in .yarnrc.yml")):(i=`${i.trimEnd()}
75
251
  enableScripts: false
76
- `,A(r,i),o.push("Added enableScripts: false to .yarnrc.yml"))}else{const r=d(t,".npmrc");let i=u(r)?j(r):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(i)?o.push(".npmrc already has ignore-scripts=true"):(i=`${i.trimEnd()}
252
+ `,oe(o,i),n.push("Added enableScripts: false to .yarnrc.yml"))}else{const o=y(t,".npmrc");let i=k(o)?P(o):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(i)?n.push(".npmrc already has ignore-scripts=true"):(i=`${i.trimEnd()}
77
253
  ignore-scripts=true
78
- `,A(r,i),o.push("Added ignore-scripts=true to .npmrc (yarn classic lacks enableScripts)"))}break}}return o},"syncAllowBuildsToNativeConfig"),fd=_((e,t)=>{const n=d(e,"node_modules"),o=[];for(const a of t){if(!a.endsWith("*")){o.push(a);continue}const r=a.slice(0,-1);try{if(r.startsWith("@")&&r.endsWith("/")){const i=d(n,r.slice(0,-1));for(const s of ae(i))!s.startsWith(".")&&we(d(i,s)).isDirectory()&&o.push(`${r.slice(0,-1)}/${s}`)}else for(const i of ae(n))i.startsWith(r)&&we(d(n,i)).isDirectory()&&o.push(i)}catch{}}return o},"expandPatterns"),md=_((e,t)=>{if(t.length===0)return;const n=fd(e,t);if(n.length===0)return;const o=d(e,"node_modules");let a=!1;for(const r of n){if(r.includes("..")||r.startsWith("/")||r.startsWith("\\")){k.warn(`Skipping invalid package name: ${r}`);continue}const i=(r.match(/\//g)||[]).length;if(i>1||i===1&&!r.startsWith("@")){k.warn(`Skipping invalid package name: ${r}`);continue}const s=d(o,r),l=d(s,"package.json");if(u(l))try{const c=U(l).scripts??{};for(const p of["preinstall","install","postinstall"])if(c[p]){k.info(`Running ${p} for ${r}...`);try{lo(c[p],{cwd:s,env:{...process.env},stdio:"inherit"})}catch{k.error(`${p} script failed for ${r}`),a=!0}}}catch{}}a&&(process.exitCode=1)},"runApprovedScripts");var gd=Object.defineProperty,V=f((e,t)=>gd(e,"name",{value:t,configurable:!0}),"o$1");const hd="https://api.socket.dev/v0/purl?alerts=true",Ee=V(()=>d(Le(),".vis","cache","socket-security"),"getCacheDirectory"),yd=3600*1e3,vd=.4,Ht=100,kd=V(e=>typeof e=="object"&&e!=null&&"id"in e&&"type"in e&&"name"in e&&"version"in e&&"alerts"in e&&"score"in e&&e.type==="npm","isPackageReportData"),bd=V(()=>{Ve(Ee())},"ensureCacheDirectory"),Ln=V((e,t)=>`${encodeURIComponent(e)}@${encodeURIComponent(t)}`,"buildCacheKey"),wd=V((e,t)=>{const n=Ln(e,t),o=d(Ee(),`${n}.json`);try{const a=U(o);if(Date.now()-a.createdAt>a.ttlMs){lt(o,{force:!0});return}return a.report}catch{return}},"getCachedReport"),$d=V((e,t,n,o)=>{const a=Ln(e,t),r={createdAt:Date.now(),report:n,ttlMs:o};E(d(Ee(),`${a}.json`),JSON.stringify(r),"utf8")},"setCachedReport"),Sd=V(e=>{const t=[e.license,e.maintenance,e.quality,e.supplyChain,e.vulnerability];return Number((t.reduce((n,o)=>n+o,0)/t.length).toFixed(2))},"calculateOverallScore"),xd=V(async(e,t={})=>{const{apiToken:n,cacheTtlMs:o=yd,timeoutMs:a=15e3}=t,r=new Map;if(e.length===0||!n)return r;const i=[];for(const c of e){const p=wd(c.name,c.version);p?r.set(`${c.name}@${c.version}`,p):i.push(c)}if(i.length===0)return r;const s=`Basic ${Buffer.from(`${n}:`).toString("base64")}`;bd();const l=[];for(let c=0;c<i.length;c+=Ht)l.push(i.slice(c,c+Ht));for(const c of l){const p=c.map($=>({purl:`pkg:npm/${$.name}@${$.version}`})),h=new AbortController,v=setTimeout(()=>{h.abort()},a);try{const $=await fetch(hd,{body:JSON.stringify({components:p}),headers:{Authorization:s,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:h.signal});if(!$.ok)continue;const P=await $.text();jd(P,c,r,o)}catch{}finally{clearTimeout(v)}}return r},"fetchSocketReports"),jd=V((e,t,n,o)=>{const a=new Map;for(const i of t)a.set(`${i.name}@${i.version}`,i);const r=e.split(`}
79
- `);for(const i of r){const s=i.trim();if(s)try{const l=JSON.parse(s.endsWith("}")?s:`${s}}`),c=`${l.namespace?`${l.namespace}/`:""}${l.name}`,p=`${c}@${l.version}`;if(!a.has(p))continue;const h=l.score.overall??Sd(l.score),v={alerts:l.alerts,author:l.author,id:l.id,license:l.license,name:l.name,score:{...l.score,overall:h},size:l.size,type:"npm",version:l.version};l.namespace&&(v.namespace=l.namespace),kd(v)&&(n.set(p,v),$d(c,l.version,v,o))}catch{}}},"parseNdjsonResponse"),_n=V(e=>e.namespace?`${e.namespace}/${e.name}`:e.name,"getFullPackageName"),Cd=V(e=>e>=.8?"excellent":e>=.6?"good":e>=.4?"fair":e>=.2?"poor":"critical","scoreLabel"),Hp=V(e=>e>=.6?"green":e>=.4?"yellow":"red","scoreColor"),qp=V(e=>{const t=_n(e),n=`score: ${String(Math.round(e.score.overall*100))}%`,o=e.alerts.length,a=o>0?`${String(o)} alert${o===1?"":"s"}`:"no alerts";return`${t}@${e.version} (${n}, ${a})`},"formatReportSummary");V(e=>{const t=[`${_n(e)}@${e.version}`,` License: ${e.license||"unknown"}`];if(t.push(` Overall Score: ${String(Math.round(e.score.overall*100))}% (${Cd(e.score.overall)})`),t.push(` Supply Chain: ${String(Math.round(e.score.supplyChain*100))}%`),t.push(` Quality: ${String(Math.round(e.score.quality*100))}%`),t.push(` Maintenance: ${String(Math.round(e.score.maintenance*100))}%`),t.push(` Vulnerability: ${String(Math.round(e.score.vulnerability*100))}%`),t.push(` License: ${String(Math.round(e.score.license*100))}%`),e.alerts.length>0){t.push(` Alerts (${String(e.alerts.length)}):`);for(const n of e.alerts){const o=n.props?.cveId?` (${n.props.cveId})`:"";t.push(` [${n.severity.toUpperCase()}] ${n.type}${o} — ${n.category}`)}}return t.join(`
80
- `)},"formatReportDetailed");const Od=V(e=>{if(e.size===0)return"";let t=0,n=0,o=0,a=0,r=0,i=0;for(const l of e.values()){for(const c of l.alerts)switch(t++,c.severity){case"critical":{n++;break}case"high":{o++;break}case"medium":{a++;break}default:r++}l.score.overall<vd&&i++}const s=[];if(s.push(`Socket.dev: scanned ${String(e.size)} package${e.size===1?"":"s"}`),t>0){const l=[];n>0&&l.push(`${String(n)} critical`),o>0&&l.push(`${String(o)} high`),a>0&&l.push(`${String(a)} medium`),r>0&&l.push(`${String(r)} low`),s.push(` Alerts: ${String(t)} total (${l.join(", ")})`)}else s.push(" No security alerts found.");return i>0&&s.push(` ${String(i)} package${i===1?"":"s"} with low security score (<40%)`),s.join(`
81
- `)},"formatSecurityOverview"),Kp=V(()=>{const e=Ee();if(!u(e))return 0;const t=ae(e).filter(n=>n.endsWith(".json"));for(const n of t)lt(d(e,n),{force:!0});return t.length},"clearSocketCache"),Yp=V(()=>{const e=Ee();if(!u(e))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const t=ae(e).filter(r=>r.endsWith(".json"));let n=0,o,a;for(const r of t){const i=we(d(e,r));n+=i.size;const{mtimeMs:s}=i;(o===void 0||s<o)&&(o=s),(a===void 0||s>a)&&(a=s)}return{entries:t.length,newestEntry:a,oldestEntry:o,totalSizeBytes:n}},"getSocketCacheStats"),Pd=V(e=>e?.enabled?{apiToken:e.apiToken??process.env.VIS_SOCKET_TOKEN,cacheTtlMs:e.cacheTtlMs,minimumScore:e.minimumScore,timeoutMs:e.timeoutMs}:void 0,"buildSocketOptions"),Qp=V((e,t,n)=>{if(!n)return;const o=`${e}@${t}`;if(n[o])return n[o];if(n[e])return n[e];for(const[a,r]of Object.entries(n))if(a.endsWith("*")&&e.startsWith(a.slice(0,-1)))return r},"findAcceptedRisk"),Xp=V((e,t,n,o)=>[" // Add to security.socket.acceptedRisks in vis.config.ts:",` ${`"${e}"`}: {`,` reason: "${o}",`,` acceptedAt: "${new Date().toISOString()}",`,` acceptedScore: ${String(n)},`," },"].join(`
82
- `),"formatAcceptedRiskSnippet");var Rd=Object.defineProperty,rt=f((e,t)=>Rd(e,"name",{value:t,configurable:!0}),"f$1");const qt=new Set(["add","install","update"]),Id=new Set(["add","dedupe","install","remove","update"]),Bd=/(\d+\.\d+\.\d+)/,Vd=rt(e=>{const t=d(e,"package.json");if(!u(t))return[];const n=[];try{const o=U(t),a={...o.dependencies,...o.devDependencies};for(const[r,i]of Object.entries(a)){const s=d(e,"node_modules",r,"package.json");if(u(s))try{const c=U(s);if(c.version){n.push({name:r,version:c.version});continue}}catch{}const l=Bd.exec(i);l?.[1]&&n.push({name:r,version:l[1]})}}catch{}return n},"resolveInstalledPackages"),Ad={afterCommand:rt(async e=>{if(process.exitCode&&process.exitCode!==0)return;const t=e.scriptEnforcement;t?.postInstallPackages.length&&e.workspaceRoot&&md(e.workspaceRoot,t.postInstallPackages);const n=process.argv[2]??"",o=Pd(e.visConfig?.security?.socket);if(qt.has(n)&&o&&e.workspaceRoot)try{const a=Vd(e.workspaceRoot);if(a.length>0){const r=await xd(a,o);if(r.size>0){const i=Od(r);if(i){k.info(""),k.info(i);let s=0;for(const l of r.values())for(const c of l.alerts)(c.severity==="critical"||c.severity==="high")&&s++;s>0&&k.warn(`${String(s)} critical/high severity alert${s===1?"":"s"} detected. Run 'vis check --security' for details.`)}}}}catch{}},"afterCommand"),beforeCommand:rt(async e=>{const t=process.argv[2]??"";if(Id.has(t)&&e.visConfig&&e.workspaceRoot){const n=Nn(e.workspaceRoot);if(pd(e.visConfig,n.name),qt.has(t)){const o=ud(n.name,e.workspaceRoot,e.visConfig);for(const a of o.warnings)e.logger.warn(`security: ${a}`);e.scriptEnforcement=o}}},"beforeCommand"),name:"security-enforcement"};var Ed=Object.defineProperty,Td=f((e,t)=>Ed(e,"name",{value:t,configurable:!0}),"n$1");const Dd=Td(()=>process.platform==="win32"?!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color":process.env.TERM!=="linux","isUnicodeSupported"),Oe=Dd(),Md={arrow:Oe?"→":"->",dash:Oe?"—":"-",failure:Oe?"✗":"x",success:Oe?"✓":"v",warning:Oe?"⚠":"!"};var Nd=Object.defineProperty,Se=f((e,t)=>Nd(e,"name",{value:t,configurable:!0}),"s");const zn=d(Le(),".vis"),it=d(zn,".upgrade-check.json"),Wd=1440*60*1e3,Fd=1440*60*1e3,Ld=500,_d=new Set(["--help","--version","-h","-V","help","implode","self-update","upgrade"]),zd=Se(()=>{try{if(u(it))return U(it)}catch{}},"readCache"),Un=Se(e=>{try{Ve(zn),A(it,JSON.stringify(e))}catch{}},"writeCache"),Ud=Se(async e=>{try{const t=new AbortController,n=setTimeout(()=>{t.abort()},Ld),o=await fetch(`https://registry.npmjs.org/${e}/latest`,{headers:{accept:"application/json"},signal:t.signal});return clearTimeout(n),o.ok?(await o.json()).version:void 0}catch{return}},"fetchLatestVersion"),Kt=Se((e,t)=>{let n=!1;try{n=So(t.latestVersion,e,{loose:!0})}catch{return}if(!n)return;const o=Date.now();o-t.lastNoticeAt<Fd||(process.stderr.write(`
83
- ${De("vis update available:")} ${Re(e)} ${De(Md.arrow)} ${go(oe(t.latestVersion))}${De(", run")} ${pe("vis upgrade")}
84
- `),t.lastNoticeAt=o,Un(t))},"showUpgradeNotice"),Jd=Se(e=>{if(ue||process.env.VIS_CLI_TEST||process.env.VIS_NO_UPDATE_CHECK==="1"||!process.stderr.isTTY||_d.has(e))return!1;const t=new Set(process.argv.slice(2));return!(t.has("--silent")||t.has("-s")||t.has("--json"))},"shouldCheck"),Gd=Se((e,t)=>{if(!Jd(t))return;const n=zd(),o=Date.now();if(n&&o-n.lastQueryAt<Wd)return()=>{Kt(e,n)};let a=n;return Ud("@visulima/vis").then(r=>{r&&(a={lastNoticeAt:n?.lastNoticeAt??0,lastQueryAt:o,latestVersion:r},Un(a))}).catch(()=>{}),()=>{a&&Kt(e,a)}},"startUpgradeCheck");var Hd=Object.defineProperty,Yt=f((e,t)=>Hd(e,"name",{value:t,configurable:!0}),"n");Xn();Ac();try{const e=Xt(process.cwd()).path;process.env.VIS_MONOREPO_ROOT=e;const t=U(d(e,"package.json"));t.name&&Ec(t.name)}catch{}const qd=Gd(Ne.version,process.argv[2]??"");Qn();const y=Kn("vis",{packageName:"vis",packageVersion:Ne.version}),Kd=process.argv.includes("--debug")||!!process.env.DEBUG;y.addPlugin(Zn({detailed:Kd,exitOnError:!1}));y.addGlobalOption({description:"Override workspace root directory",name:"cwd",type:String});y.addPlugin(Mc);y.addPlugin(Ad);y.addCommand(ql);y.addCommand(ba);y.addCommand(Ya);y.addCommand(_o);y.addCommand(qo);y.addCommand(gc);y.addCommand(lr);y.addCommand(xc);y.addCommand(ya);y.addCommand(ta);y.addCommand(oc);y.addCommand(ic);y.addCommand(cc);y.addCommand(uc);y.addCommand(Na);y.addCommand(Cr);y.addCommand(vc);y.addCommand(Yn);y.addCommand(br);y.addCommand(Jo);y.addCommand(Jl);y.addCommand(Ra);y.addCommand(Ic);y.addCommand(mr);y.addCommand(Sr);y.addCommand(wc);y.addCommand(Ta);y.addCommand(Ua);y.addCommand(_l);y.addCommand(yr);y.addCommand(Sa);y.addCommand(Ca);y.addCommand(Ha);y.addCommand(Va);y.addCommand(Oc);y.addCommand(pr);y.addCommand(aa);y.addCommand(sa);y.addCommand(La);y.addCommand(Wl);y.addCommand(Ql);y.addCommand(ec);for(const e of rr)y.addCommand(e);for(const e of Nr)y.addCommand(e);for(const e of ma)y.addCommand(e);for(const e of on)y.addCommand(e);y.addPlugin(Uc(qd));if(zr(process.argv.slice(2))){const{loadVisConfig:e}=await import("./config.js"),t=process.env.VIS_MONOREPO_ROOT||process.cwd();let n;try{n=await e(t)}catch{n=void 0}try{await Dl({logger:{info:Yt(o=>{process.stdout.write(`${o}
85
- `)},"info"),warn:Yt(o=>{process.stderr.write(`${o}
86
- `)},"warn")},visConfig:n,workspaceRoot:t})}catch(o){process.stderr.write(`${o.message}
87
- `),process.exitCode=1}}else(async()=>{try{await y.run({shouldExitProcess:!1})}catch{process.exitCode=process.exitCode||1}})();export{vn as $,zt as A,Hp as B,Lt as C,Sn as D,Mt as E,Bt as F,Ip as G,Kp as H,Jp as I,Bp as J,At as K,_t as L,Ot as M,qp as N,zp as O,ln as P,Xp as Q,Cd as R,_n as S,Gp as T,xd as U,Pd as V,Up as W,vp as X,Ap as Y,Ep as Z,kp as _,Yp as a,wp as a0,$p as a1,bp as a2,wi as a3,cn as a4,ji as a5,Sp as a6,jp as a7,Cp as a8,Pp as a9,Ei as aa,xp as ab,yp as ac,vd as b,Nn as c,ue as d,Mp as e,wn as f,Vp as g,Wp as h,Dp as i,Md as j,Rp as k,Lp as l,Ne as m,Tp as n,Fp as o,k as p,Qp as q,Xi as r,Op as s,Np as t,_p as u,H as v,It as w,Al as x,Dt as y,Ft as z};
254
+ `,oe(o,i),n.push("Added ignore-scripts=true to .npmrc (yarn classic lacks enableScripts)"))}break}}return n},"syncAllowBuildsToNativeConfig"),CO=Re((e,t)=>{const r=y(e,"node_modules"),n=[];for(const s of t){if(!s.endsWith("*")){n.push(s);continue}const o=s.slice(0,-1);try{if(o.startsWith("@")&&o.endsWith("/")){const i=y(r,o.slice(0,-1));for(const a of Ge(i))!a.startsWith(".")&&Kt(y(i,a)).isDirectory()&&n.push(`${o.slice(0,-1)}/${a}`)}else for(const i of Ge(r))i.startsWith(o)&&Kt(y(r,i)).isDirectory()&&n.push(i)}catch{}}return n},"expandPatterns"),xO=Re((e,t)=>{if(t.length===0)return;const r=CO(e,t);if(r.length===0)return;const n=y(e,"node_modules");let s=!1;for(const o of r){if(o.includes("..")||o.startsWith("/")||o.startsWith("\\")){q.warn(`Skipping invalid package name: ${o}`);continue}const i=(o.match(/\//g)||[]).length;if(i>1||i===1&&!o.startsWith("@")){q.warn(`Skipping invalid package name: ${o}`);continue}const a=y(n,o),c=y(a,"package.json");if(k(c))try{const l=le(c).scripts??{};for(const p of["preinstall","install","postinstall"])if(l[p]){q.info(`Running ${p} for ${o}...`);try{const f=l[p];qu(f,{cwd:a,env:{...process.env},stdio:"inherit"})}catch{q.error(`${p} script failed for ${o}`),s=!0}}}catch{}}s&&(process.exitCode=1)},"runApprovedScripts");var NO=Object.defineProperty,$o=d((e,t)=>NO(e,"name",{value:t,configurable:!0}),"f$1");const Pc=new Set(["add","install","update"]),IO=new Set(["add","dedupe","install","remove","update"]),PO=/(\d+\.\d+\.\d+)/,AO=$o(e=>{const t=y(e,"package.json");if(!k(t))return[];const r=[];try{const n=le(t),s={...n.dependencies,...n.devDependencies};for(const[o,i]of Object.entries(s)){const a=y(e,"node_modules",o,"package.json");if(k(a))try{const l=le(a);if(l.version){r.push({name:o,version:l.version});continue}}catch{}const c=PO.exec(i);c?.[1]&&r.push({name:o,version:c[1]})}}catch{}return r},"resolveInstalledPackages"),TO={afterCommand:$o(async e=>{if(process.exitCode&&process.exitCode!==0)return;const t=e.scriptEnforcement;t?.postInstallPackages.length&&e.workspaceRoot&&xO(e.workspaceRoot,t.postInstallPackages);const r=process.argv[2]??"",n=jw(e.visConfig?.security?.socket);if(Pc.has(r)&&n&&e.workspaceRoot)try{const s=AO(e.workspaceRoot);if(s.length>0){const o=await Jp(s,n);if(o.size>0){const i=Sw(o);if(i){q.info(""),q.info(i);let a=0;for(const c of o.values())for(const l of c.alerts)(l.severity==="critical"||l.severity==="high")&&a++;a>0&&q.warn(`${String(a)} critical/high severity alert${a===1?"":"s"} detected. Run 'vis check --security' for details.`)}}}}catch{}},"afterCommand"),beforeCommand:$o(async e=>{const t=process.argv[2]??"";if(IO.has(t)&&e.visConfig&&e.workspaceRoot){const r=$u(e.workspaceRoot),n=Pc.has(t);if(EO(e.visConfig,r.name,n),n){const s=RO(r.name,e.workspaceRoot,e.visConfig);for(const o of s.warnings)e.logger.warn(`security: ${o}`);e.scriptEnforcement=s}}},"beforeCommand"),name:"security-enforcement"};var DO=Object.defineProperty,LO=d((e,t)=>DO(e,"name",{value:t,configurable:!0}),"n$1");const BO=LO(()=>process.platform==="win32"?!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color":process.env.TERM!=="linux","isUnicodeSupported"),mr=BO(),MO={arrow:mr?"→":"->",dash:mr?"—":"-",failure:mr?"✗":"x",success:mr?"✓":"v",warning:mr?"⚠":"!"};var VO=Object.defineProperty,ur=d((e,t)=>VO(e,"name",{value:t,configurable:!0}),"s");const Ou=y(Zt(),".vis"),wo=y(Ou,".upgrade-check.json"),_O=1440*60*1e3,FO=1440*60*1e3,qO=500,UO=new Set(["--help","--version","-h","-V","help","implode","self-update","upgrade"]),WO=ur(()=>{try{if(k(wo))return le(wo)}catch{}},"readCache"),Eu=ur(e=>{try{rt(Ou),oe(wo,JSON.stringify(e))}catch{}},"writeCache"),GO=ur(async e=>{try{const t=new AbortController,r=setTimeout(()=>{t.abort()},qO),n=await fetch(`https://registry.npmjs.org/${e}/latest`,{headers:{accept:"application/json"},signal:t.signal});return clearTimeout(r),n.ok?(await n.json()).version:void 0}catch{return}},"fetchLatestVersion"),Ac=ur((e,t)=>{let r;try{r=st.gt(t.latestVersion,e,{loose:!0})}catch{return}if(!r)return;const n=Date.now();n-t.lastNoticeAt<FO||(process.stderr.write(`
255
+ ${Wt("vis update available:")} ${hr(e)} ${Wt(MO.arrow)} ${md(Ze(t.latestVersion))}${Wt(", run")} ${gt("vis upgrade")}
256
+ `),t.lastNoticeAt=n,Eu(t))},"showUpgradeNotice"),JO=ur(e=>{if(pt||process.env.VIS_CLI_TEST||process.env.VIS_NO_UPDATE_CHECK==="1"||!process.stderr.isTTY||UO.has(e))return!1;const t=new Set(process.argv.slice(2));return!(t.has("--silent")||t.has("-s")||t.has("--json"))},"shouldCheck"),KO=ur((e,t)=>{if(!JO(t))return;const r=WO(),n=Date.now();if(r&&n-r.lastQueryAt<_O)return()=>{Ac(e,r)};let s=r;return GO("@visulima/vis").then(o=>{o&&(s={lastNoticeAt:r?.lastNoticeAt??0,lastQueryAt:n,latestVersion:o},Eu(s))}).catch(()=>{}),()=>{s&&Ac(e,s)}},"startUpgradeCheck");var zO=Object.defineProperty,Tc=d((e,t)=>zO(e,"name",{value:t,configurable:!0}),"n");Au();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");A0();try{const e=Dc(process.cwd()).path;process.env.VIS_MONOREPO_ROOT=e;const t=le(y(e,"package.json"));t.name&&T0(t.name)}catch{}const HO=KO(ln.version,process.argv[2]??"");Pu();const A=Nu("vis",{packageName:"vis",packageVersion:ln.version}),YO=process.argv.includes("--debug")||!!process.env.DEBUG;A.addPlugin(Tu({detailed:YO,exitOnError:!1}));A.addGlobalOption({description:"Override workspace root directory",name:"cwd",type:String});A.addGlobalOption({description:"Path to a vis config file (overrides discovery)",name:"config",type:String});A.addPlugin(B0);A.addPlugin(TO);A.addCommand(_j);A.addCommand(rf);A.addCommand(Af);A.addCommand(bd);A.addCommand(Od);A.addCommand(g0);A.addCommand(Bj);A.addCommand(Gf);A.addCommand(j0);A.addCommand(Zd);A.addCommand(lm);A.addCommand(Dd);A.addCommand(n0);A.addCommand(i0);A.addCommand(l0);A.addCommand(d0);A.addCommand($f);A.addCommand(dm);A.addCommand(v0);A.addCommand(Iu);A.addCommand(nm);A.addCommand(wd);A.addCommand(Lj);A.addCommand(df);A.addCommand(N0);A.addCommand(Xf);A.addCommand(im);A.addCommand($0);A.addCommand(vf);A.addCommand(Rf);A.addCommand(Aj);A.addCommand(em);A.addCommand(of);A.addCommand(lf);A.addCommand(Nf);A.addCommand(gf);A.addCommand(R0);A.addCommand(zf);A.addCommand(Md);A.addCommand(Fd);A.addCommand(jf);A.addCommand(Nj);A.addCommand(Uj);A.addCommand(Jj);for(const e of qf)A.addCommand(e);for(const e of Em)A.addCommand(e);for(const e of Yd)A.addCommand(e);for(const e of Gc)A.addCommand(e);for(const e of e0)A.addCommand(e);A.addPlugin(Y0(HO));if(Im(process.argv.slice(2))){const{loadVisConfig:e}=await import("./applyDefaults.js"),t=process.env.VIS_MONOREPO_ROOT||process.cwd();let r;try{r=await e(t)}catch{r=void 0}try{await Rj({logger:{info:Tc(n=>{process.stdout.write(`${n}
257
+ `)},"info"),warn:Tc(n=>{process.stderr.write(`${n}
258
+ `)},"warn")},visConfig:r,workspaceRoot:t})}catch(n){process.stderr.write(`${n.message}
259
+ `),process.exitCode=1}}else(async()=>{try{await A.run({shouldExitProcess:!1})}catch{process.exitCode=process.exitCode||1}})();export{ga as $,$u as A,KE as B,SR as C,jR as D,ze as E,go as F,bO as G,HE as H,PR as I,YE as J,dR as K,Yp as L,iR as M,zE as N,NR as O,CR as P,XE as Q,ww as R,tR as S,AR as T,Jp as U,jw as V,IR as W,Ne as X,sl as Y,la as Z,jj as _,nS as a,ba as a0,Cc as a1,ka as a2,ha as a3,pa as a4,da as a5,$a as a6,Rc as a7,wa as a8,yR as a9,Wr as aA,Xt as aB,UE as aC,Qm as aD,JE as aE,gn as aF,fR as aG,mR as aH,gR as aI,hR as aJ,qE as aK,Wb as aL,_E as aM,VE as aN,bE as aO,sR as aa,lR as ab,uR as ac,pR as ad,nR as ae,rR as af,QE as ag,MO as ah,GE as ai,FE as aj,Jn as ak,qi as al,_p as am,Zi as an,bp as ao,zc as ap,kE as aq,$E as ar,SE as as,jE as at,wE as au,He as av,dg as aw,Hc as ax,hg as ay,OE as az,cS as b,cR as c,wR as d,RR as e,vR as f,ZE as g,kR as h,Vw as i,aR as j,dk as k,OR as l,bR as m,$R as n,ER as o,q as p,ln as q,Kp as r,pt as s,Ow as t,eR as u,oR as v,st as w,xR as x,WE as y,Ro as z};