@visulima/vis 1.0.0-alpha.8 → 1.0.0

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 (471) hide show
  1. package/CHANGELOG.md +1915 -41
  2. package/LICENSE.md +13554 -6
  3. package/README.md +264 -32
  4. package/bin/resolve-binary.mjs +85 -0
  5. package/bin/vis.mjs +76 -0
  6. package/dashboard/dist/index.html +152 -0
  7. package/dist/bin.d.ts +1 -1
  8. package/dist/bin.js +1 -1004
  9. package/dist/binx.js +3 -0
  10. package/dist/config/index.d.ts +3276 -0
  11. package/dist/config/index.js +1 -0
  12. package/dist/generate/index.d.ts +155 -30
  13. package/dist/generate/index.js +1 -1
  14. package/dist/packem_chunks/CONFIG_FILES.js +8 -0
  15. package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -0
  16. package/dist/packem_chunks/agent-instructions.js +11 -0
  17. package/dist/packem_chunks/bloom-status.js +2 -0
  18. package/dist/packem_chunks/bloom-sync.js +2 -0
  19. package/dist/packem_chunks/cache-attestation.js +1 -0
  20. package/dist/packem_chunks/catalog-detector.js +1 -0
  21. package/dist/packem_chunks/catalog.js +114 -0
  22. package/dist/packem_chunks/cli-exec.js +1 -0
  23. package/dist/packem_chunks/cli-main.js +268 -0
  24. package/dist/packem_chunks/defineReleasePlugin.js +3 -0
  25. package/dist/packem_chunks/detect.js +3 -0
  26. package/dist/packem_chunks/detect2.js +8 -0
  27. package/dist/packem_chunks/devtools.js +4 -0
  28. package/dist/packem_chunks/discord.js +4 -0
  29. package/dist/packem_chunks/dispatch.js +4 -0
  30. package/dist/packem_chunks/doctor-probe.js +2 -0
  31. package/dist/packem_chunks/dynamic-import.js +1 -0
  32. package/dist/packem_chunks/extra-files.js +3 -0
  33. package/dist/packem_chunks/fix.js +11 -0
  34. package/dist/packem_chunks/git.js +3 -0
  35. package/dist/packem_chunks/group-tags.js +1 -0
  36. package/dist/packem_chunks/handler.js +1 -0
  37. package/dist/packem_chunks/handler10.js +5 -0
  38. package/dist/packem_chunks/handler11.js +1 -0
  39. package/dist/packem_chunks/handler12.js +27 -0
  40. package/dist/packem_chunks/handler13.js +5 -0
  41. package/dist/packem_chunks/handler14.js +1 -0
  42. package/dist/packem_chunks/handler15.js +1 -0
  43. package/dist/packem_chunks/handler16.js +1 -0
  44. package/dist/packem_chunks/handler17.js +1 -0
  45. package/dist/packem_chunks/handler18.js +1 -0
  46. package/dist/packem_chunks/handler19.js +5 -0
  47. package/dist/packem_chunks/handler2.js +1 -0
  48. package/dist/packem_chunks/handler20.js +2 -0
  49. package/dist/packem_chunks/handler21.js +2 -0
  50. package/dist/packem_chunks/handler22.js +14 -0
  51. package/dist/packem_chunks/handler23.js +1 -0
  52. package/dist/packem_chunks/handler24.js +1 -0
  53. package/dist/packem_chunks/handler25.js +1 -0
  54. package/dist/packem_chunks/handler26.js +5 -0
  55. package/dist/packem_chunks/handler27.js +1 -0
  56. package/dist/packem_chunks/handler28.js +3 -0
  57. package/dist/packem_chunks/handler29.js +1 -0
  58. package/dist/packem_chunks/handler3.js +4 -0
  59. package/dist/packem_chunks/handler30.js +1 -0
  60. package/dist/packem_chunks/handler31.js +2 -0
  61. package/dist/packem_chunks/handler32.js +2 -0
  62. package/dist/packem_chunks/handler33.js +2 -0
  63. package/dist/packem_chunks/handler34.js +3 -0
  64. package/dist/packem_chunks/handler35.js +6 -0
  65. package/dist/packem_chunks/handler36.js +1 -0
  66. package/dist/packem_chunks/handler37.js +42 -0
  67. package/dist/packem_chunks/handler38.js +8 -0
  68. package/dist/packem_chunks/handler39.js +9 -0
  69. package/dist/packem_chunks/handler4.js +4 -0
  70. package/dist/packem_chunks/handler40.js +75 -0
  71. package/dist/packem_chunks/handler41.js +5 -0
  72. package/dist/packem_chunks/handler42.js +4 -0
  73. package/dist/packem_chunks/handler43.js +3 -0
  74. package/dist/packem_chunks/handler44.js +2 -0
  75. package/dist/packem_chunks/handler45.js +1 -0
  76. package/dist/packem_chunks/handler46.js +1 -0
  77. package/dist/packem_chunks/handler47.js +1 -0
  78. package/dist/packem_chunks/handler48.js +3 -0
  79. package/dist/packem_chunks/handler49.js +1 -0
  80. package/dist/packem_chunks/handler5.js +6 -0
  81. package/dist/packem_chunks/handler50.js +7 -0
  82. package/dist/packem_chunks/handler51.js +33 -0
  83. package/dist/packem_chunks/handler52.js +3 -0
  84. package/dist/packem_chunks/handler53.js +8 -0
  85. package/dist/packem_chunks/handler54.js +4 -0
  86. package/dist/packem_chunks/handler55.js +1 -0
  87. package/dist/packem_chunks/handler56.js +12 -0
  88. package/dist/packem_chunks/handler57.js +11 -0
  89. package/dist/packem_chunks/handler58.js +5 -0
  90. package/dist/packem_chunks/handler59.js +11 -0
  91. package/dist/packem_chunks/handler6.js +8 -0
  92. package/dist/packem_chunks/handler60.js +3 -0
  93. package/dist/packem_chunks/handler61.js +22 -0
  94. package/dist/packem_chunks/handler62.js +61 -0
  95. package/dist/packem_chunks/handler63.js +3 -0
  96. package/dist/packem_chunks/handler64.js +6 -0
  97. package/dist/packem_chunks/handler65.js +9 -0
  98. package/dist/packem_chunks/handler66.js +2 -0
  99. package/dist/packem_chunks/handler67.js +24 -0
  100. package/dist/packem_chunks/handler68.js +25 -0
  101. package/dist/packem_chunks/handler69.js +153 -0
  102. package/dist/packem_chunks/handler7.js +1 -0
  103. package/dist/packem_chunks/handler70.js +10 -0
  104. package/dist/packem_chunks/handler71.js +23 -0
  105. package/dist/packem_chunks/handler72.js +322 -0
  106. package/dist/packem_chunks/handler73.js +708 -0
  107. package/dist/packem_chunks/handler74.js +48 -0
  108. package/dist/packem_chunks/handler75.js +27 -0
  109. package/dist/packem_chunks/handler76.js +3 -0
  110. package/dist/packem_chunks/handler77.js +190 -0
  111. package/dist/packem_chunks/handler78.js +38 -0
  112. package/dist/packem_chunks/handler8.js +1 -0
  113. package/dist/packem_chunks/handler9.js +1 -0
  114. package/dist/packem_chunks/heal-accept.js +10 -0
  115. package/dist/packem_chunks/heal.js +14 -0
  116. package/dist/packem_chunks/help-command.js +31 -0
  117. package/dist/packem_chunks/index.js +1 -7
  118. package/dist/packem_chunks/index2.js +802 -0
  119. package/dist/packem_chunks/index3.js +7 -0
  120. package/dist/packem_chunks/index4.js +135 -0
  121. package/dist/packem_chunks/index5.js +74 -0
  122. package/dist/packem_chunks/interface.js +2 -0
  123. package/dist/packem_chunks/keys-refresh.js +4 -0
  124. package/dist/packem_chunks/lean.js +4 -0
  125. package/dist/packem_chunks/list.js +3 -0
  126. package/dist/packem_chunks/loader.js +4 -1
  127. package/dist/packem_chunks/loader2.js +1 -0
  128. package/dist/packem_chunks/orchestrator.js +42 -0
  129. package/dist/packem_chunks/pre-mode.js +2 -0
  130. package/dist/packem_chunks/print-config.js +2 -0
  131. package/dist/packem_chunks/prompts.js +7 -0
  132. package/dist/packem_chunks/prune.js +3 -0
  133. package/dist/packem_chunks/publish-guards.js +1 -0
  134. package/dist/packem_chunks/registry.js +48 -0
  135. package/dist/packem_chunks/resolveFormatter.js +9 -0
  136. package/dist/packem_chunks/run.js +1 -0
  137. package/dist/packem_chunks/security.js +1 -0
  138. package/dist/packem_chunks/shell-runner.js +1 -0
  139. package/dist/packem_chunks/slack.js +2 -0
  140. package/dist/packem_chunks/snapshot.js +2 -0
  141. package/dist/packem_chunks/stage-publisher.js +1 -0
  142. package/dist/packem_chunks/staged-registry.js +2 -0
  143. package/dist/packem_chunks/state.js +3 -0
  144. package/dist/packem_chunks/status.js +2 -0
  145. package/dist/packem_chunks/success-walk.js +8 -0
  146. package/dist/packem_chunks/sync.js +2 -0
  147. package/dist/packem_chunks/sync2.js +2 -0
  148. package/dist/packem_chunks/tar.js +3 -0
  149. package/dist/packem_chunks/tripwire.js +2 -0
  150. package/dist/packem_chunks/ts-loader.js +22 -0
  151. package/dist/packem_chunks/verify-lockfile.js +2 -0
  152. package/dist/packem_chunks/version-resolver.js +2 -0
  153. package/dist/packem_chunks/webhook.js +1 -0
  154. package/dist/packem_chunks/workflow-templates.js +167 -0
  155. package/dist/packem_chunks/workspace.js +2 -0
  156. package/dist/packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js +1 -0
  157. package/dist/packem_shared/MultiSpinner-B9U0-aE3-B-gIXhFk.js +3 -0
  158. package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +1 -0
  159. package/dist/packem_shared/Table-CcVkyULl-DLWu6XHL.js +34 -0
  160. package/dist/packem_shared/VisReleaseError-DMGRBTNO.js +1 -0
  161. package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +1 -0
  162. package/dist/packem_shared/advisories-B76fBVL-.js +1 -0
  163. package/dist/packem_shared/affected-shas-CCxG4tvm.js +1 -0
  164. package/dist/packem_shared/ai-analysis-BpVdn20h.js +68 -0
  165. package/dist/packem_shared/ai-fix-CeGzAT9m.js +43 -0
  166. package/dist/packem_shared/anolilab-text-CAM_E6uK.js +13 -0
  167. package/dist/packem_shared/api.d-BPftyU9r.d.ts +27 -0
  168. package/dist/packem_shared/augment-DaSS2Lgs.js +4 -0
  169. package/dist/packem_shared/bin-BlGVEhl8.js +1 -0
  170. package/dist/packem_shared/build-scripts-q__dKE2y.js +1 -0
  171. package/dist/packem_shared/command-runtime-3FTGuUsK.js +1 -0
  172. package/dist/packem_shared/compile-cache-B_Vf_WxT.js +3 -0
  173. package/dist/packem_shared/createAdapter-bU4DIP3F.js +1 -0
  174. package/dist/packem_shared/createVersionActions-BK43SNDH.js +1 -0
  175. package/dist/packem_shared/cyclonedx-CmrYQ0vx.js +4 -0
  176. package/dist/packem_shared/defineFormatter-D5dCp6Kv.js +1 -0
  177. package/dist/packem_shared/definePlugin-DoUcoYSy.js +1 -0
  178. package/dist/packem_shared/dependency-scan-DpOFiZuI.js +1 -0
  179. package/dist/packem_shared/docker-BYqiD711.js +59 -0
  180. package/dist/packem_shared/env-DdQRnEIy.js +27 -0
  181. package/dist/packem_shared/failure-log-CKMhqLWr.js +2 -0
  182. package/dist/packem_shared/giget-DVTFJlbR.js +2 -0
  183. package/dist/packem_shared/glob-fqg4KepW-1S3z30c8.js +1 -0
  184. package/dist/packem_shared/index-B0EsgdzO.js +1 -0
  185. package/dist/packem_shared/index-CE6MsgcV.js +22 -0
  186. package/dist/packem_shared/index-Cg0IHaFI.js +1 -0
  187. package/dist/packem_shared/index-Cg71MisW.js +1 -0
  188. package/dist/packem_shared/index-DjTWo3sH.js +1 -0
  189. package/dist/packem_shared/index-jJNulo5i.js +28 -0
  190. package/dist/packem_shared/index.server-J83sowC4.js +2 -0
  191. package/dist/packem_shared/interface.d-B7VK2rcH.d.ts +148 -0
  192. package/dist/packem_shared/interface.d-Cezzifoh.d.ts +106 -0
  193. package/dist/packem_shared/license-t5KnNX6v.js +1 -0
  194. package/dist/packem_shared/lifecycle-aDTZ8dW1.js +2 -0
  195. package/dist/packem_shared/lockfile-C1qCKGH6.js +1 -0
  196. package/dist/packem_shared/main-B3juSU5z.js +1 -0
  197. package/dist/packem_shared/manifests-DSBr3-dw.js +1 -0
  198. package/dist/packem_shared/min-release-age-C71MO72F.js +34 -0
  199. package/dist/packem_shared/missing-package-json-CTF71tE5.js +1 -0
  200. package/dist/packem_shared/native-config-sync-D-z2Uwqu.js +21 -0
  201. package/dist/packem_shared/osv-bloom-DMhXP184.js +2 -0
  202. package/dist/packem_shared/otelPlugin-DmKDBaPo.js +1 -0
  203. package/dist/packem_shared/packument-aGzYwXKn.js +1 -0
  204. package/dist/packem_shared/peer-warnings-BXAzXqY3.js +1 -0
  205. package/dist/packem_shared/plugins.d-ND23R9I3.d.ts +4 -0
  206. package/dist/packem_shared/pm-runner-CQcraCcu.js +1 -0
  207. package/dist/packem_shared/prompt-DjXHVgYU.js +1 -0
  208. package/dist/packem_shared/provenance-S7y0BRAt.js +1 -0
  209. package/dist/packem_shared/public-api-WqUCiyIe.js +131 -0
  210. package/dist/packem_shared/readJsonSync-DuMMeB3s-ihoybKvs.js +1 -0
  211. package/dist/packem_shared/registry-keys-CRnXATt2.js +1 -0
  212. package/dist/packem_shared/resolve-explicit-CJGazevw.js +5 -0
  213. package/dist/packem_shared/resolve-runtime-QRaQucfL.js +1 -0
  214. package/dist/packem_shared/run-file-DD7Ne23Z.js +1 -0
  215. package/dist/packem_shared/runtime-check-qnrPTlma.js +1 -0
  216. package/dist/packem_shared/runtime-process-Dmz0vCJy-DUwTvH1J.js +1 -0
  217. package/dist/packem_shared/s1ngularity-BLj4Jy8z.js +1 -0
  218. package/dist/packem_shared/scan-progress-BDcl7Kty.js +2 -0
  219. package/dist/packem_shared/selectors-D4iCvITE.js +3 -0
  220. package/dist/packem_shared/signatures-DoNG2hEr.js +2 -0
  221. package/dist/packem_shared/slug-DoueYuLo.js +1 -0
  222. package/dist/packem_shared/spinner-DuJJvFTl.js +1 -0
  223. package/dist/packem_shared/sticky-comment-D6_7-w8T.js +1 -0
  224. package/dist/packem_shared/subtree-C7bZuiSQ.js +2 -0
  225. package/dist/packem_shared/symbols-DPTlrJ3B.js +1 -0
  226. package/dist/packem_shared/tabs-CgxCvjCY.js +1 -0
  227. package/dist/packem_shared/target-merge-Dg25Izl5.js +11 -0
  228. package/dist/packem_shared/target-options-CR0OuYJr.js +1 -0
  229. package/dist/packem_shared/toolchain-Zb3VzZb4.js +5 -0
  230. package/dist/packem_shared/typosquats-C12CP_2G.js +1 -0
  231. package/dist/packem_shared/use-measured-height-CjS7Tks7.js +1 -0
  232. package/dist/packem_shared/utils-CRueU43T.js +1 -0
  233. package/dist/packem_shared/verify-DStfg3nb.js +1 -0
  234. package/dist/packem_shared/vis-update-app-BlocL713.js +1 -0
  235. package/dist/packem_shared/watch-BXNI7dC6.js +1 -0
  236. package/dist/packem_shared/watch-loop-BZudYfcl.js +11 -0
  237. package/dist/release/core/changelog/index.d.ts +5 -0
  238. package/dist/release/core/changelog/index.js +1 -0
  239. package/dist/release/core/package-managers/index.d.ts +6 -0
  240. package/dist/release/core/package-managers/index.js +1 -0
  241. package/dist/release/core/version-actions/index.d.ts +14 -0
  242. package/dist/release/core/version-actions/index.js +1 -0
  243. package/dist/release/index.d.ts +233 -0
  244. package/dist/release/index.js +1 -0
  245. package/dist/release/plugin-sdk.d.ts +128 -0
  246. package/dist/release/plugin-sdk.js +1 -0
  247. package/dist/release/presets.d.ts +225 -0
  248. package/dist/release/presets.js +1 -0
  249. package/dist/release/types.d.ts +1493 -0
  250. package/dist/release/types.js +1 -0
  251. package/dist/runtime/preload.d.ts +1 -0
  252. package/dist/runtime/preload.js +1 -0
  253. package/index.d.ts +450 -0
  254. package/index.js +579 -728
  255. package/package.json +103 -52
  256. package/schemas/project.schema.json +873 -226
  257. package/schemas/vis-config.schema.json +6332 -241
  258. package/schemas/vis-release-config.schema.json +1423 -0
  259. package/skills/vis/SKILL.md +96 -0
  260. package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
  261. package/templates/buildkite-ci/template.yml +20 -0
  262. package/dist/ai-analysis.d.ts +0 -26
  263. package/dist/ai-cache.d.ts +0 -21
  264. package/dist/ai-types.d.ts +0 -16
  265. package/dist/audit-config.d.ts +0 -24
  266. package/dist/cache-directory.d.ts +0 -73
  267. package/dist/catalog.d.ts +0 -136
  268. package/dist/codeowners.d.ts +0 -30
  269. package/dist/commands/action-graph.d.ts +0 -8
  270. package/dist/commands/add.d.ts +0 -3
  271. package/dist/commands/affected.d.ts +0 -3
  272. package/dist/commands/ai.d.ts +0 -3
  273. package/dist/commands/analyze.d.ts +0 -3
  274. package/dist/commands/approve-builds.d.ts +0 -3
  275. package/dist/commands/audit.d.ts +0 -23
  276. package/dist/commands/cache.d.ts +0 -86
  277. package/dist/commands/check.d.ts +0 -3
  278. package/dist/commands/ci.d.ts +0 -19
  279. package/dist/commands/clean.d.ts +0 -3
  280. package/dist/commands/create/discovery.d.ts +0 -42
  281. package/dist/commands/create/index.d.ts +0 -13
  282. package/dist/commands/create/prompts.d.ts +0 -31
  283. package/dist/commands/create/random-name.d.ts +0 -15
  284. package/dist/commands/create/templates/builtin.d.ts +0 -15
  285. package/dist/commands/create/templates/generator.d.ts +0 -14
  286. package/dist/commands/create/templates/index.d.ts +0 -13
  287. package/dist/commands/create/templates/monorepo.d.ts +0 -16
  288. package/dist/commands/create/templates/remote.d.ts +0 -41
  289. package/dist/commands/create/templates/types.d.ts +0 -46
  290. package/dist/commands/create/utils.d.ts +0 -42
  291. package/dist/commands/dedupe.d.ts +0 -3
  292. package/dist/commands/devcontainer.d.ts +0 -3
  293. package/dist/commands/dlx.d.ts +0 -3
  294. package/dist/commands/docker.d.ts +0 -22
  295. package/dist/commands/doctor.d.ts +0 -15
  296. package/dist/commands/exec.d.ts +0 -3
  297. package/dist/commands/generate.d.ts +0 -10
  298. package/dist/commands/graph.d.ts +0 -3
  299. package/dist/commands/hook/constants.d.ts +0 -13
  300. package/dist/commands/hook/index.d.ts +0 -3
  301. package/dist/commands/hook/install.d.ts +0 -7
  302. package/dist/commands/hook/list.d.ts +0 -28
  303. package/dist/commands/hook/migrate.d.ts +0 -30
  304. package/dist/commands/hook/prek-builtins.d.ts +0 -8
  305. package/dist/commands/hook/prek.d.ts +0 -129
  306. package/dist/commands/hook/run.d.ts +0 -21
  307. package/dist/commands/hook/uninstall.d.ts +0 -3
  308. package/dist/commands/hook/validate.d.ts +0 -17
  309. package/dist/commands/ignore-helpers.d.ts +0 -157
  310. package/dist/commands/ignore.d.ts +0 -17
  311. package/dist/commands/implode.d.ts +0 -3
  312. package/dist/commands/info.d.ts +0 -3
  313. package/dist/commands/init.d.ts +0 -14
  314. package/dist/commands/install.d.ts +0 -3
  315. package/dist/commands/link.d.ts +0 -3
  316. package/dist/commands/list.d.ts +0 -3
  317. package/dist/commands/migrate/backup.d.ts +0 -8
  318. package/dist/commands/migrate/constants.d.ts +0 -16
  319. package/dist/commands/migrate/deps.d.ts +0 -32
  320. package/dist/commands/migrate/gitleaks.d.ts +0 -29
  321. package/dist/commands/migrate/index.d.ts +0 -3
  322. package/dist/commands/migrate/json.d.ts +0 -22
  323. package/dist/commands/migrate/kingfisher.d.ts +0 -14
  324. package/dist/commands/migrate/lint-staged.d.ts +0 -62
  325. package/dist/commands/migrate/moon.d.ts +0 -5
  326. package/dist/commands/migrate/nano-staged.d.ts +0 -30
  327. package/dist/commands/migrate/nx.d.ts +0 -12
  328. package/dist/commands/migrate/prompt.d.ts +0 -2
  329. package/dist/commands/migrate/secretlint.d.ts +0 -14
  330. package/dist/commands/migrate/shared.d.ts +0 -29
  331. package/dist/commands/migrate/turborepo.d.ts +0 -11
  332. package/dist/commands/migrate/types.d.ts +0 -27
  333. package/dist/commands/migrate/verify.d.ts +0 -12
  334. package/dist/commands/optimize.d.ts +0 -38
  335. package/dist/commands/pm.d.ts +0 -3
  336. package/dist/commands/remove.d.ts +0 -3
  337. package/dist/commands/run.d.ts +0 -16
  338. package/dist/commands/sbom.d.ts +0 -10
  339. package/dist/commands/secrets.d.ts +0 -3
  340. package/dist/commands/sort-package-json.d.ts +0 -3
  341. package/dist/commands/staged.d.ts +0 -10
  342. package/dist/commands/status.d.ts +0 -3
  343. package/dist/commands/sync.d.ts +0 -16
  344. package/dist/commands/task-why.d.ts +0 -3
  345. package/dist/commands/unlink.d.ts +0 -3
  346. package/dist/commands/update.d.ts +0 -3
  347. package/dist/commands/upgrade.d.ts +0 -3
  348. package/dist/commands/why.d.ts +0 -3
  349. package/dist/config.d.ts +0 -82
  350. package/dist/config.js +0 -1
  351. package/dist/docker.d.ts +0 -73
  352. package/dist/flakiness.d.ts +0 -40
  353. package/dist/generate/discover.d.ts +0 -29
  354. package/dist/generate/loader.d.ts +0 -15
  355. package/dist/generate/moon-adapter/filename-interp.d.ts +0 -42
  356. package/dist/generate/moon-adapter/filters.d.ts +0 -22
  357. package/dist/generate/moon-adapter/frontmatter.d.ts +0 -39
  358. package/dist/generate/moon-adapter/index.d.ts +0 -19
  359. package/dist/generate/moon-adapter/tera-subset.d.ts +0 -85
  360. package/dist/generate/moon-adapter/util.d.ts +0 -14
  361. package/dist/generate/prompts.d.ts +0 -25
  362. package/dist/generate/remote.d.ts +0 -43
  363. package/dist/generate/runner.d.ts +0 -37
  364. package/dist/generate/types.d.ts +0 -152
  365. package/dist/hooks.d.ts +0 -118
  366. package/dist/native-binding.d.ts +0 -158
  367. package/dist/output.d.ts +0 -40
  368. package/dist/overrides.d.ts +0 -82
  369. package/dist/package-manager.d.ts +0 -23
  370. package/dist/packem_shared/otelPlugin-CJLkguJ8.js +0 -1
  371. package/dist/plugins/config-loader.d.ts +0 -3
  372. package/dist/plugins/otel.d.ts +0 -63
  373. package/dist/plugins/post-command.d.ts +0 -3
  374. package/dist/plugins/security-enforcement.d.ts +0 -3
  375. package/dist/pm-runner.d.ts +0 -44
  376. package/dist/run-report.d.ts +0 -40
  377. package/dist/runtime-check.d.ts +0 -27
  378. package/dist/sbom/cyclonedx.d.ts +0 -39
  379. package/dist/sbom/installed-package.d.ts +0 -49
  380. package/dist/sbom/license.d.ts +0 -31
  381. package/dist/sbom/lockfile.d.ts +0 -34
  382. package/dist/sbom/purl.d.ts +0 -25
  383. package/dist/sbom/resolve-specifier.d.ts +0 -24
  384. package/dist/sbom/types.d.ts +0 -196
  385. package/dist/secrets/baseline.d.ts +0 -20
  386. package/dist/secrets/format.d.ts +0 -14
  387. package/dist/secrets/git.d.ts +0 -6
  388. package/dist/secrets/spinner.d.ts +0 -9
  389. package/dist/security.d.ts +0 -64
  390. package/dist/selectors.d.ts +0 -81
  391. package/dist/shell-history.d.ts +0 -16
  392. package/dist/socket-security.d.ts +0 -129
  393. package/dist/staged/cli-parse.d.ts +0 -18
  394. package/dist/staged/config.d.ts +0 -14
  395. package/dist/staged/errors/apply-empty-commit-error.d.ts +0 -4
  396. package/dist/staged/errors/config-error.d.ts +0 -4
  397. package/dist/staged/errors/get-backup-stash-error.d.ts +0 -4
  398. package/dist/staged/errors/git-error.d.ts +0 -6
  399. package/dist/staged/errors/index.d.ts +0 -12
  400. package/dist/staged/errors/restore-original-state-error.d.ts +0 -4
  401. package/dist/staged/errors/staged-error.d.ts +0 -8
  402. package/dist/staged/errors/task-error.d.ts +0 -6
  403. package/dist/staged/git/diff.d.ts +0 -76
  404. package/dist/staged/git/exec.d.ts +0 -43
  405. package/dist/staged/git/index.d.ts +0 -77
  406. package/dist/staged/git/stash.d.ts +0 -37
  407. package/dist/staged/index.d.ts +0 -13
  408. package/dist/staged/match.d.ts +0 -12
  409. package/dist/staged/renderer/index.d.ts +0 -9
  410. package/dist/staged/renderer/ink/index.d.ts +0 -4
  411. package/dist/staged/renderer/plain.d.ts +0 -12
  412. package/dist/staged/tasks/build.d.ts +0 -13
  413. package/dist/staged/tasks/exec.d.ts +0 -56
  414. package/dist/staged/tasks/run.d.ts +0 -26
  415. package/dist/staged/types.d.ts +0 -173
  416. package/dist/target-discovery.d.ts +0 -59
  417. package/dist/target-options.d.ts +0 -261
  418. package/dist/tips.d.ts +0 -41
  419. package/dist/tui/components/CheckProgressApp.d.ts +0 -6
  420. package/dist/tui/components/CommandSummary.d.ts +0 -17
  421. package/dist/tui/components/Header.d.ts +0 -13
  422. package/dist/tui/components/OutputPanel.d.ts +0 -17
  423. package/dist/tui/components/QuitDialog.d.ts +0 -15
  424. package/dist/tui/components/TaskListPanel.d.ts +0 -19
  425. package/dist/tui/components/TaskRow.d.ts +0 -12
  426. package/dist/tui/components/TaskStore.d.ts +0 -80
  427. package/dist/tui/components/VisTaskRunnerApp.d.ts +0 -17
  428. package/dist/tui/components/devcontainer/DevcontainerStore.d.ts +0 -66
  429. package/dist/tui/components/devcontainer/VisDevcontainerApp.d.ts +0 -9
  430. package/dist/tui/components/devcontainer/catalogs/extensions.d.ts +0 -8
  431. package/dist/tui/components/devcontainer/catalogs/features.d.ts +0 -8
  432. package/dist/tui/components/devcontainer/catalogs/filters.d.ts +0 -4
  433. package/dist/tui/components/devcontainer/catalogs/mount-suggestions.d.ts +0 -19
  434. package/dist/tui/components/devcontainer/catalogs/templates.d.ts +0 -8
  435. package/dist/tui/components/devcontainer/devcontainer-io.d.ts +0 -14
  436. package/dist/tui/components/devcontainer/sections/DockerComposeSection.d.ts +0 -11
  437. package/dist/tui/components/devcontainer/sections/EnvironmentSection.d.ts +0 -16
  438. package/dist/tui/components/devcontainer/sections/ExtensionsSection.d.ts +0 -11
  439. package/dist/tui/components/devcontainer/sections/FeaturesSection.d.ts +0 -11
  440. package/dist/tui/components/devcontainer/sections/GeneralSection.d.ts +0 -12
  441. package/dist/tui/components/devcontainer/sections/LifecycleSection.d.ts +0 -13
  442. package/dist/tui/components/devcontainer/sections/MountsSection.d.ts +0 -16
  443. package/dist/tui/components/devcontainer/sections/PortsSection.d.ts +0 -10
  444. package/dist/tui/components/devcontainer/sections/PreviewPanel.d.ts +0 -11
  445. package/dist/tui/components/devcontainer/types.d.ts +0 -53
  446. package/dist/tui/components/devcontainer/validate.d.ts +0 -16
  447. package/dist/tui/components/graph/GraphStore.d.ts +0 -42
  448. package/dist/tui/components/graph/ProjectDetailPanel.d.ts +0 -10
  449. package/dist/tui/components/graph/ProjectListPanel.d.ts +0 -20
  450. package/dist/tui/components/graph/VisGraphApp.d.ts +0 -8
  451. package/dist/tui/components/optimize/OptimizeDetailPanel.d.ts +0 -9
  452. package/dist/tui/components/optimize/OptimizeListPanel.d.ts +0 -16
  453. package/dist/tui/components/optimize/OptimizeStore.d.ts +0 -50
  454. package/dist/tui/components/optimize/VisOptimizeApp.d.ts +0 -8
  455. package/dist/tui/components/optimize/constants.d.ts +0 -7
  456. package/dist/tui/components/update/PackageDetailPanel.d.ts +0 -12
  457. package/dist/tui/components/update/PackageListPanel.d.ts +0 -21
  458. package/dist/tui/components/update/UpdateStore.d.ts +0 -62
  459. package/dist/tui/components/update/VisUpdateApp.d.ts +0 -18
  460. package/dist/tui/dynamic-life-cycle.d.ts +0 -22
  461. package/dist/tui/formatting-utils.d.ts +0 -17
  462. package/dist/tui/pretty-time.d.ts +0 -8
  463. package/dist/tui/static-life-cycle.d.ts +0 -28
  464. package/dist/tui/status-utils.d.ts +0 -20
  465. package/dist/tui/symbols.d.ts +0 -7
  466. package/dist/tui/types.d.ts +0 -11
  467. package/dist/typosquats.d.ts +0 -70
  468. package/dist/upgrade-check.d.ts +0 -30
  469. package/dist/utils.d.ts +0 -22
  470. package/dist/watch.d.ts +0 -65
  471. package/dist/workspace.d.ts +0 -675
@@ -0,0 +1,25 @@
1
+ import{createRequire as X}from"node:module";import{I as w,j as P,E as u,q as T,s as v,V as D}from"../packem_shared/index.server-J83sowC4.js";import{m as j,f as A,v as ee,T as te,O as R,y as $}from"../packem_shared/index-CE6MsgcV.js";import H from"./index.js";import{V as oe,U as C,g as se,a1 as ne,a2 as ae,a3 as re,a4 as ie}from"./cli-main.js";import{e as pe,W as B,l as I,a as L,U,R as ce}from"./catalog.js";import{a as S}from"../packem_shared/readJsonSync-DuMMeB3s-ihoybKvs.js";import{l as fe}from"../packem_shared/missing-package-json-CTF71tE5.js";const Y=X(import.meta.url),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Z=e=>{if(typeof V<"u"&&V.versions&&V.versions.node){const[a,o]=V.versions.node.split(".").map(Number);if(a>22||a===22&&o>=3||a===20&&o>=16)return V.getBuiltinModule(e)}return Y(e)},{readFileSync:K,writeFileSync:z}=Z("node:fs"),le=e=>/[*?[\]{}!]/.test(e),ge=e=>typeof e=="string"?e:e.reason,de=e=>typeof e=="string"?void 0:e.replacement,q=(e,a)=>e.some(o=>H(o,a)),G=(e,a)=>{if(typeof e=="string")return!0;const o=Array.isArray(e.packages)&&e.packages.length>0,t=Array.isArray(e.paths)&&e.paths.length>0;return!!(!o&&!t||o&&a.packageName!==void 0&&q(e.packages,a.packageName)||t&&q(e.paths,a.packageDir))},ue=(e,a)=>{const o=a[e.depName];if(o!==void 0&&G(o,e))return{pattern:e.depName,rule:o};for(const[t,r]of Object.entries(a))if(le(t)&&H(t,e.depName)&&G(r,e))return{pattern:t,rule:r}},me=(e,a)=>{if(Object.keys(a).length===0)return[];const o=[];for(const t of e){if(t.isInternal)continue;const r=ue(t,a);r&&o.push({depName:t.depName,depType:t.depType,matchedPattern:r.pattern,packageDir:t.packageDir,packageJsonPath:t.packageJsonPath,packageName:t.packageName,reason:ge(r.rule),replacement:de(r.rule),specifier:t.specifier})}return o},he=new Set(["dependencies","devDependencies","peerDependencies"]),ke=e=>e.startsWith("catalog:"),ye=e=>e.startsWith("workspace:"),$e=(e,a)=>{if(!e)return!1;for(const o of e.values())if(o.has(a))return!0;return!1},Pe=(e,a={})=>{const o=a.min??3,t=new Set(a.ignoreDeps),r=e.filter(i=>i.isInternal||!he.has(i.depType)||ye(i.specifier)||a.dep!==void 0&&i.depName!==a.dep?!1:!t.has(i.depName)),n=new Map;for(const i of r){const p=n.get(i.depName);p?p.push(i):n.set(i.depName,[i])}const s=[];for(const[i,p]of n){if($e(a.catalogs,i)||p.some(m=>ke(m.specifier)))continue;const c=new Map;for(const m of p){let d=c.get(m.specifier);d||(d=new Set,c.set(m.specifier,d)),d.add(m.packageJsonPath)}const f=[...c.entries()].sort((m,d)=>m[1].size!==d[1].size?d[1].size-m[1].size:m[0].localeCompare(d[0]))[0];!f||f[1].size<o||s.push({catalogName:"default",depName:i,instanceCount:f[1].size,specifier:f[0]})}return s.sort((i,p)=>i.depName.localeCompare(p.depName))},we=(e,a)=>{if(a.length===0)return;const o=j(e,"pnpm-workspace.yaml"),t=A(o)?K(o,"utf8"):"",r=t.includes(`\r
2
+ `)?`\r
3
+ `:`
4
+ `,n=a.filter(d=>d.catalogName==="default").sort((d,g)=>d.depName.localeCompare(g.depName));if(n.length===0)return;const s=t.length>0?t.split(r):[],i=s.findIndex(d=>/^catalog\s*:\s*$/.test(d));if(i===-1){const d=["catalog:"];for(const y of n)d.push(` ${y.depName}: "${y.specifier}"`);let g=0;for(;g<s.length&&(s[g]??"").trim().length===0;)g+=1;const h=[...s.slice(0,g),...d,"",...s.slice(g)].join(r);return z(o,h.endsWith(r)?h:`${h}${r}`),o}let p=s.length;const c=new Set;for(let d=i+1;d<s.length;d+=1){const g=s[d]??"",h=g.trimStart();if(g.length===0)continue;if(g.length-h.length===0&&h.length>0&&!h.startsWith("#")){p=d;break}const y=/^([\w./@-]+)\s*:/.exec(h);y?.[1]&&c.add(y[1])}const f=[];for(const d of n)c.has(d.depName)||f.push(` ${d.depName}: "${d.specifier}"`);if(f.length===0)return;const m=[...s.slice(0,p),...f,...s.slice(p)].join(r);return z(o,m.endsWith(r)?m:`${m}${r}`),o},De=(e,a)=>{if(a.length===0)return"";const o=j(e,"pnpm-workspace.yaml"),t=A(o)?K(o,"utf8"):"",r=[...a].sort((i,p)=>i.depName.localeCompare(p.depName)),n=["--- pnpm-workspace.yaml","+++ pnpm-workspace.yaml"],s=t.includes(`\r
5
+ `)?`\r
6
+ `:`
7
+ `;if((t.length>0?t.split(s):[]).findIndex(i=>/^catalog\s*:\s*$/.test(i))===-1){n.push("@@ +1 @@","+catalog:");for(const i of r)n.push(`+ ${i.depName}: "${i.specifier}"`)}else{n.push("@@ catalog: @@");for(const i of r)n.push(`+ ${i.depName}: "${i.specifier}"`)}return n.join(s)},ve=e=>{const a=[],o=pe(e);if(o){const r=j(e,"pnpm-workspace.yaml");for(const n of o)n.startsWith("!")||B(e,[n]).length===0&&a.push({pattern:n,source:"pnpm-workspace.yaml",sourcePath:r})}const t=j(e,"package.json");if(A(t)){const r=S(t).workspaces,n=Array.isArray(r)?r:r?.packages;if(n)for(const s of n)typeof s!="string"||s.startsWith("!")||B(e,[s]).length===0&&a.push({pattern:s,source:"package.json",sourcePath:t})}return a},Ne=(e,a={})=>{const{useEditorconfig:o}=a,t=new Map;for(const n of e){const s=t.get(n.sourcePath);s?s.push(n):t.set(n.sourcePath,[n])}const r=[];for(const[n,s]of t){const i=new Set(s.map(f=>f.pattern));if(n.endsWith(".yaml")||n.endsWith(".yml")){const f=ee(n).split(`
8
+ `).filter(m=>{const d=m.trim();if(!d.startsWith("- "))return!0;const g=d.slice(2).replaceAll(/^['"]|['"]$/g,"");return!i.has(g)}).join(`
9
+ `);te(n,f,{overwrite:!0}),r.push(n);continue}const p=S(n),c=p.workspaces;Array.isArray(c)?p.workspaces=c.filter(f=>typeof f!="string"||!i.has(f)):c&&Array.isArray(c.packages)&&(c.packages=c.packages.filter(f=>typeof f!="string"||!i.has(f))),R(n,p,{indent:I(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},be=["dependencies","devDependencies","peerDependencies","optionalDependencies"],xe=(e,a={})=>{const o=new Set(a.ignoreBlocks),t=oe(e),r=[];for(const n of t){const s=j(e,n,"package.json"),i=C(s);if(!i)continue;const p=typeof i.name=="string"?i.name:void 0;for(const c of be){if(o.has(c))continue;const f=i[c];typeof f=="object"&&f!==null&&!Array.isArray(f)&&Object.keys(f).length===0&&r.push({depType:c,packageDir:n,packageJsonPath:s,packageName:p})}}return r},Je=(e,a={})=>{const{useEditorconfig:o}=a,t=new Map;for(const n of e){const s=t.get(n.packageJsonPath);s?s.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,s]of t){const i=S(n);for(const p of s){const c=i[p.depType];typeof c=="object"&&c!==null&&!Array.isArray(c)&&Object.keys(c).length===0&&Reflect.deleteProperty(i,p.depType)}R(n,i,{indent:I(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},Te=["dependencies","devDependencies","optionalDependencies","peerDependencies"],Se=(e,a={})=>{const o=new Set(a.depTypes??Te),t=new Set(a.ignoreDeps),r=new Map;for(const s of e)s.packageDir!=="."||!o.has(s.depType)||r.set(s.depName,{depType:s.depType,specifier:s.specifier});if(r.size===0)return[];const n=[];for(const s of e){if(s.packageDir==="."||!o.has(s.depType)||t.has(s.depName))continue;const i=r.get(s.depName);i&&n.push({childSpecifier:s.specifier,depName:s.depName,depType:s.depType,packageDir:s.packageDir,packageJsonPath:s.packageJsonPath,packageName:s.packageName,rootDepType:i.depType,rootSpecifier:i.specifier})}return n},Me=(e,a)=>{if(!a)return[];const o=j(e,"package.json"),t=C(o);if(!t)return[];if(t.private!==!0)return[];const r=t.dependencies;if(typeof r!="object"||r===null||Array.isArray(r))return[];const n=Object.keys(r);return n.length===0?[]:[{depNames:n,packageJsonPath:o}]},je=(e,a={})=>{const{useEditorconfig:o}=a,t=[];for(const r of e){const n=S(r.packageJsonPath),s=n.dependencies;if(typeof s!="object"||s===null)continue;const i=s;n.devDependencies??={};const p=n.devDependencies;for(const c of r.depNames){const f=i[c];typeof f=="string"&&(c in p||(p[c]=f),Reflect.deleteProperty(i,c))}Object.keys(i).length===0&&Reflect.deleteProperty(n,"dependencies"),R(r.packageJsonPath,n,{indent:I(r.packageJsonPath,{useEditorconfig:o}),overwrite:!0}),t.push(r.packageJsonPath)}return t},We=/^[a-z][\w-]*@\S+$/i,Re=(e,a,o={})=>{if(!a)return[];const t=j(e,"package.json"),r=C(t);if(!r)return[];const n=r.packageManager;return typeof n=="string"&&We.test(n)?[]:[{packageJsonPath:t,suggested:o.suggested}]},Ie=(e,a={})=>{const{useEditorconfig:o}=a,t=[];for(const r of e){if(!r.suggested)continue;const n=S(r.packageJsonPath);n.packageManager=r.suggested,R(r.packageJsonPath,n,{indent:I(r.packageJsonPath,{useEditorconfig:o}),overwrite:!0}),t.push(r.packageJsonPath)}return t},Ee=(e,a)=>{if(!a)return[];const o=j(e,"package.json"),t=C(o);return t?t.private===!0?[]:[{packageJsonPath:o,rawValue:t.private}]:[]},Fe=(e,a={})=>{const{useEditorconfig:o}=a,t=[];for(const r of e){const n=S(r.packageJsonPath);let s=n;if("private"in n)n.private=!0;else{const{name:i,version:p,...c}=n,f={};i!==void 0&&(f.name=i),p!==void 0&&(f.version=p),f.private=!0;for(const[m,d]of Object.entries(c))f[m]=d;s=f}R(r.packageJsonPath,s,{indent:I(r.packageJsonPath,{useEditorconfig:o}),overwrite:!0}),t.push(r.packageJsonPath)}return t},Ve=[{id:"react",label:"React",members:["react","react-dom","react-test-renderer"]},{id:"next",label:"Next.js",members:["next","@next/font","@next/bundle-analyzer","@next/mdx","@next/third-parties","@next/eslint-plugin-next","eslint-config-next"]},{id:"babel",label:"Babel",prefixes:["@babel/"]},{id:"storybook",label:"Storybook",members:["storybook","sb"],prefixes:["@storybook/"]},{id:"vitest",label:"Vitest",members:["vitest"],prefixes:["@vitest/"]},{id:"playwright",label:"Playwright",members:["playwright","@playwright/test"]},{id:"trpc",label:"tRPC",prefixes:["@trpc/"]},{id:"prisma",label:"Prisma",members:["prisma"],prefixes:["@prisma/"]},{id:"turborepo",label:"Turborepo",members:["turbo","turbo-ignore","@turbo/gen","eslint-config-turbo","eslint-plugin-turbo"]},{id:"typescript-eslint",label:"typescript-eslint",members:["typescript-eslint"],prefixes:["@typescript-eslint/"]},{id:"eslint-stylistic",label:"ESLint Stylistic",prefixes:["@stylistic/"]},{id:"lexical",label:"Lexical",members:["lexical"],prefixes:["@lexical/"]},{id:"nx",label:"Nx",prefixes:["@nx/","@nrwl/"]}],Ae=new Set(["dependencies","devDependencies","peerDependencies"]),Ce=(e,a)=>{for(const o of e)if(o.members?.includes(a)||o.prefixes?.some(t=>a.startsWith(t)))return o},Oe=e=>e.startsWith("workspace:")||e.startsWith("catalog:"),_e=(e,a={})=>{const o=new Set(a.ignoreFamilies),t=new Map;for(const i of Ve)t.set(i.id,i);for(const i of a.extraFamilies??[])t.set(i.id,i);const r=[...t.values()],n=new Map;for(const i of e){if(i.isInternal||!Ae.has(i.depType)||Oe(i.specifier))continue;const p=Ce(r,i.depName);if(!p||o.has(p.id))continue;const c=n.get(p.id),f={depName:i.depName,depType:i.depType,packageDir:i.packageDir,packageJsonPath:i.packageJsonPath,packageName:i.packageName,specifier:i.specifier};c?c.push(f):n.set(p.id,[f])}const s=[];for(const[i,p]of n){const c=[...new Set(p.map(m=>m.specifier))];if(c.length<2)continue;const f=t.get(i);f&&s.push({family:i,familyLabel:f.label??i,members:p,specifiers:c})}return s},ze=e=>e.startsWith("@types/"),Be=(e,a={})=>{const o=new Set(a.ignoreDeps),t=new Map,r=s=>{const i=t.get(s);if(i!==void 0)return i;try{const p=S(s).private===!0;return t.set(s,p),p}catch{return t.set(s,!1),!1}},n=[];for(const s of e)s.depType==="dependencies"&&ze(s.depName)&&(o.has(s.depName)||r(s.packageJsonPath)&&n.push({childSpecifier:s.specifier,depName:s.depName,packageDir:s.packageDir,packageJsonPath:s.packageJsonPath,packageName:s.packageName}));return n},Le=(e,a={})=>{const{useEditorconfig:o}=a,t=new Map;for(const n of e){const s=t.get(n.packageJsonPath);s?s.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,s]of t){const i=S(n),p=i.dependencies;if(typeof p!="object"||p===null)continue;const c=p;i.devDependencies??={};const f=i.devDependencies;for(const m of s){const d=c[m.depName];typeof d=="string"&&(m.depName in f||(f[m.depName]=d),Reflect.deleteProperty(c,m.depName))}Object.keys(c).length===0&&Reflect.deleteProperty(i,"dependencies"),R(n,i,{indent:I(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},Ue=e=>e.startsWith("workspace:"),qe=(e,a={})=>{const o=a.fixSpecifier??"workspace:*",t=[];for(const r of e)r.isInternal&&(Ue(r.specifier)||t.push({depName:r.depName,depType:r.depType,fix:o,packageDir:r.packageDir,packageJsonPath:r.packageJsonPath,packageName:r.packageName,specifier:r.specifier}));return t},Ge=(e,a,o,t)=>{const r=a.split(".");let n=e;for(let p=0;p<r.length-1;p+=1){const c=r[p],f=n[c];(typeof f!="object"||f===null)&&(n[c]={}),n=n[c]}const s=r.at(-1);let i=n[s];(typeof i!="object"||i===null)&&(i={},n[s]=i),i[o]=t},He=(e,a={})=>{const{useEditorconfig:o}=a,t=new Map;for(const n of e){const s=t.get(n.packageJsonPath);s?s.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,s]of t){const i=S(n);for(const p of s)if(p.depType.includes("."))Ge(i,p.depType,p.depName,p.fix);else{const c=i[p.depType];typeof c=="object"&&c!==null&&(c[p.depName]=p.fix)}R(n,i,{indent:I(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},Ke=new Set(["dependencies","devDependencies","peerDependencies"]),Qe=e=>e.startsWith("catalog:"),Xe=e=>e.startsWith("workspace:"),Ye=e=>{if(!e.startsWith("catalog:"))return;const a=e.slice(8);return a===""?"default":a},Ze=(e,a)=>{if(e.get("default")?.has(a))return"default";const o=[...e.keys()].filter(t=>t!=="default").sort();for(const t of o)if(e.get(t)?.has(a))return t},et=e=>e==="default"?"catalog:":`catalog:${e}`,tt=(e,a)=>{const o=[...e].sort((r,n)=>(r.packageName??r.packageDir).localeCompare(n.packageName??n.packageDir));let t;for(const r of o){const n=L(r.specifier);if(!n)continue;if(!t){t=r;continue}const s=L(t.specifier);if(!s){t=r;continue}const i=U(s,n),p=U(n,s);(a==="highest"&&i||a==="lowest"&&p)&&(t=r)}if(t)return{canonical:t,canonicalSource:t.packageName??t.packageDir}},ot=(e,a={})=>{const o=a.resolve??"highest",t=new Set(a.ignoreDeps),r=[],n=e.filter(i=>i.isInternal||!Ke.has(i.depType)||Xe(i.specifier)||a.dep!==void 0&&i.depName!==a.dep?!1:!t.has(i.depName)),s=new Map;for(const i of n){const p=s.get(i.depName);p?p.push(i):s.set(i.depName,[i])}for(const[i,p]of s){const c=a.pinned?.get(i);if(c!==void 0){for(const g of p)g.specifier!==c&&r.push({canonicalSource:"cli:--pin",depName:i,depType:g.depType,fix:c,packageDir:g.packageDir,packageJsonPath:g.packageJsonPath,packageName:g.packageName,specifier:g.specifier});continue}if(o==="catalog"){const{catalogs:g}=a;if(!g)continue;const h=Ze(g,i);if(!h)continue;const y=et(h);for(const x of p)Ye(x.specifier)!==h&&r.push({canonicalSource:`catalog:${h}`,depName:i,depType:x.depType,fix:y,packageDir:x.packageDir,packageJsonPath:x.packageJsonPath,packageName:x.packageName,specifier:x.specifier});continue}const f=p.filter(g=>!Qe(g.specifier));if(f.length<2||new Set(f.map(g=>g.specifier)).size<=1)continue;const m=tt(f,o);if(!m)continue;const d=m.canonical.specifier;for(const g of f)g.specifier!==d&&r.push({canonicalSource:m.canonicalSource,depName:i,depType:g.depType,fix:d,packageDir:g.packageDir,packageJsonPath:g.packageJsonPath,packageName:g.packageName,specifier:g.specifier})}return r},st=(e,a={})=>{const{useEditorconfig:o}=a,t=new Map;for(const n of e){const s=t.get(n.packageJsonPath);s?s.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,s]of t){const i=S(n);for(const p of s){const c=i[p.depType];typeof c=="object"&&c!==null&&(c[p.depName]=p.fix)}R(n,i,{indent:I(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},nt=e=>{if(A(j(e,"pnpm-workspace.yaml")))return!0;const a=j(e,"package.json");if(!A(a))return!1;try{return S(a).workspaces!==void 0}catch{return!1}},E=(e,a)=>{const o=new Map;for(const t of e){const r=a(t),n=o.get(r);n?n.push(t):o.set(r,[t])}return o},at=(e,a,o,t)=>{if(e.length===0){t.info(w("✓ workspace-protocol: no violations"));return}const r=o?"Fixed":"Found",n=o?T:v;t.info(n(P(`${r} ${String(e.length)} workspace-protocol violation${e.length===1?"":"s"}`)));for(const[s,i]of E(e,p=>p.packageName??p.packageJsonPath)){const p=$(a,i[0].packageJsonPath);t.info(` ${P(s)} ${u(`(${p})`)}`);for(const c of i){const f=o?T("→"):v("→");t.info(` ${u(c.depType)} ${c.depName}: ${D(c.specifier)} ${f} ${w(c.fix)}`)}}o||t.info(u(" Run with --fix to rewrite specifiers in place."))},rt=(e,a,o)=>{if(e.length===0){o.info(w("✓ redefine-root: no violations"));return}o.info(v(P(`Found ${String(e.length)} dep${e.length===1?"":"s"} re-declared from root`)));for(const[t,r]of E(e,n=>n.packageName??n.packageJsonPath)){const n=$(a,r[0].packageJsonPath);o.info(` ${P(t)} ${u(`(${n})`)}`);for(const s of r)o.info(` ${u(s.depType)} ${s.depName}: ${D(s.childSpecifier)} ${u(`(root ${s.rootDepType}: ${s.rootSpecifier})`)}`)}o.info(u(" Remove these from child package.json files — root pin will resolve."))},it=(e,a,o,t)=>{if(e.length===0){t.info(w("✓ workspace-versions: no drift"));return}const r=o?"Fixed":"Found",n=o?T:v;t.info(n(P(`${r} ${String(e.length)} workspace-version drift${e.length===1?"":"s"}`)));for(const[s,i]of E(e,p=>p.depName)){const p=i[0].fix,c=i[0].canonicalSource;t.info(` ${P(s)} ${u(`canonical: ${p} (from ${c})`)}`);for(const f of i){const m=$(a,f.packageJsonPath),d=f.packageName??m,g=o?T("→"):v("→");t.info(` ${d} ${u(`(${m})`)} ${u(f.depType)}: ${D(f.specifier)} ${g} ${w(f.fix)}`)}}o||t.info(u(" Run with --fix to align drifting specifiers."))},pt=(e,a,o)=>{if(e.length===0){o.info(w("✓ banned-deps: no violations"));return}o.info(D(P(`Found ${String(e.length)} banned dep${e.length===1?"":"s"}`)));for(const[t,r]of E(e,n=>n.packageName??n.packageJsonPath)){const n=$(a,r[0].packageJsonPath);o.info(` ${P(t)} ${u(`(${n})`)}`);for(const s of r){const i=s.replacement?` ${u("→")} ${w(s.replacement)}`:"";o.info(` ${u(s.depType)} ${D(s.depName)}${i}`),o.info(` ${u(s.reason)}`)}}},ct=(e,a,o,t)=>{if(e.length===0){t.info(w("✓ catalog-proposals: nothing worth promoting"));return}const r=o?"Added":"Would add",n=o?T:v;t.info(n(P(`${r} ${String(e.length)} catalog entr${e.length===1?"y":"ies"}`)));for(const s of e)t.info(` ${P(s.depName)}: ${w(s.specifier)} ${u(`(${String(s.instanceCount)} packages agree)`)}`);if(!o){const s=De(a,e);if(s){t.info(""),t.info(u("Proposed pnpm-workspace.yaml changes:"));for(const i of s.split(`
10
+ `))i.startsWith("+")?t.info(w(i)):i.startsWith("-")?t.info(D(i)):t.info(u(i))}t.info(u(" Run with --fix to write these entries to pnpm-workspace.yaml."))}},ft=(e,a,o,t)=>{if(e.length===0){t.info(w("✓ custom-types: no engines / packageManager / volta drift"));return}const r=o?"Fixed":"Found",n=o?T:v;t.info(n(P(`${r} ${String(e.length)} custom-type drift${e.length===1?"":"s"}`)));for(const[s,i]of E(e,p=>`${p.customType} ${p.depName}`)){const p=i[0].fix,c=i[0].canonicalSource;t.info(` ${P(s)} ${u(`canonical: ${p} (from ${c})`)}`);for(const f of i){const m=$(a,f.packageJsonPath),d=f.packageName??m,g=o?T("→"):v("→");t.info(` ${d} ${u(`(${m})`)}: ${D(f.specifier)} ${g} ${w(f.fix)}`)}}o||t.info(u(" Run with --fix to align engines/packageManager/volta versions."))},lt=(e,a,o,t)=>{if(e.length===0){t.info(w("✓ empty-deps: no empty dependency blocks"));return}const r=o?"Removed":"Found",n=o?T:v;t.info(n(P(`${r} ${String(e.length)} empty dependency block${e.length===1?"":"s"}`)));for(const[s,i]of E(e,p=>p.packageName??p.packageJsonPath)){const p=$(a,i[0].packageJsonPath);t.info(` ${P(s)} ${u(`(${p})`)}`);for(const c of i)t.info(` ${u(c.depType)}: ${D("{}")}`)}o||t.info(u(" Run with --fix to drop empty blocks."))},gt=(e,a,o,t)=>{if(e.length===0){t.info(w('✓ root-private: root package.json is "private": true'));return}const r=o?"Set":"Missing",n=o?T:D;for(const s of e){const i=$(a,s.packageJsonPath);if(t.info(n(P(`${r} "private": true on root ${u(`(${i})`)}`))),!o){const p=s.rawValue===void 0?"absent":JSON.stringify(s.rawValue);t.info(` ${u("current:")} ${D(p)}`)}}o||t.info(u(' Run with --fix to set "private": true.'))},dt=(e,a,o,t)=>{if(e.length===0){t.info(w("✓ root-package-manager: packageManager field present"));return}const r=o?"Set":"Missing",n=o?T:D;for(const s of e){const i=$(a,s.packageJsonPath);t.info(n(P(`${r} packageManager on root ${u(`(${i})`)}`))),!o&&!s.suggested&&t.info(u(" no canonical specifier configured (set policy.rootPackageManager.suggested to enable --fix)"))}o||t.info(u(' e.g. "packageManager": "pnpm@10.32.1"'))},ut=(e,a,o,t)=>{if(e.length===0){t.info(w("✓ root-deps: no runtime dependencies on private root"));return}const r=o?"Moved":"Found",n=o?T:v;for(const s of e){const i=$(a,s.packageJsonPath);t.info(n(P(`${r} ${String(s.depNames.length)} runtime dep${s.depNames.length===1?"":"s"} on private root ${u(`(${i})`)}`)));for(const p of s.depNames)t.info(` ${D(p)}`)}o||t.info(u(" Run with --fix to move them to devDependencies."))},mt=(e,a)=>{if(e.length===0){a.info(w("✓ missing-package-json: every workspace dir has a package.json"));return}a.info(v(P(`Found ${String(e.length)} workspace dir${e.length===1?"":"s"} without a package.json`)));for(const o of e)a.info(` ${D(o.packageDir)}`);a.info(u(" Either delete the directory or scaffold a package.json (vis create)."))},ht=(e,a,o)=>{if(e.length===0){o.info(w("✓ dead-workspace-pattern: every workspace pattern matches at least one package"));return}const t=a?"Removed":"Found",r=a?T:v;o.info(r(P(`${t} ${String(e.length)} unmatched workspace pattern${e.length===1?"":"s"}`)));for(const[n,s]of E(e,i=>i.source)){o.info(` ${P(n)}`);for(const i of s)o.info(` ${D(i.pattern)}`)}a||o.info(u(" Run with --fix to drop dead patterns."))},kt=(e,a,o,t)=>{if(e.length===0){t.info(w("✓ types-in-deps: no @types/* in dependencies of private packages"));return}const r=o?"Moved":"Found",n=o?T:v;t.info(n(P(`${r} ${String(e.length)} @types/* dep${e.length===1?"":"s"} in dependencies`)));for(const[s,i]of E(e,p=>p.packageName??p.packageJsonPath)){const p=$(a,i[0].packageJsonPath);t.info(` ${P(s)} ${u(`(${p})`)}`);for(const c of i)t.info(` ${D(c.depName)} ${u(c.childSpecifier)}`)}o||t.info(u(" Run with --fix to move them to devDependencies."))},yt=(e,a,o)=>{if(e.length===0){o.info(w("✓ similar-deps: every related dep family is in sync"));return}o.info(v(P(`Found ${String(e.length)} family${e.length===1?"":" families"} with version drift`)));for(const t of e){o.info(` ${P(t.familyLabel)} ${u(`(${t.specifiers.join(", ")})`)}`);for(const r of t.members){const n=$(a,r.packageJsonPath),s=r.packageName??n;o.info(` ${s} ${u(`(${n})`)} ${u(r.depType)}: ${D(r.depName)}@${v(r.specifier)}`)}}o.info(u(" Pick a single specifier per family and align by hand — auto-fix is unsafe across name boundaries."))},$t=(e,a,o,t,r)=>{let n=!0;const s=i=>{n||r.info(""),n=!1,i()};t.workspaceProtocol&&s(()=>{at(e.workspaceProtocol??[],a,o.workspaceProtocol,r)}),t.redefineRoot&&s(()=>{rt(e.redefineRoot??[],a,r)}),t.workspaceVersions&&s(()=>{it(e.workspaceVersions??[],a,o.workspaceVersions,r)}),t.customTypes&&s(()=>{ft(e.customTypes??[],a,o.customTypes,r)}),e.catalogProposals!==void 0&&s(()=>{ct(e.catalogProposals??[],a,o.catalogProposals,r)}),t.bannedDeps&&s(()=>{pt(e.bannedDeps??[],a,r)}),t.emptyDeps&&s(()=>{lt(e.emptyDeps??[],a,o.emptyDeps,r)}),t.rootPrivate&&s(()=>{gt(e.rootPrivate??[],a,o.rootPrivate,r)}),t.rootPackageManager&&s(()=>{dt(e.rootPackageManager??[],a,o.rootPackageManager,r)}),t.rootDeps&&s(()=>{ut(e.rootDeps??[],a,o.rootDeps,r)}),t.missingPackageJson&&s(()=>{mt(e.missingPackageJson??[],r)}),t.deadWorkspacePatterns&&s(()=>{ht(e.deadWorkspacePatterns??[],o.deadWorkspacePatterns,r)}),t.typesInDeps&&s(()=>{kt(e.typesInDeps??[],a,o.typesInDeps,r)}),t.similarDeps&&s(()=>{yt(e.similarDeps??[],a,r)})},Pt=(e,a)=>{for(const o of e.workspaceProtocol??[]){const t=$(a,o.packageJsonPath);process.stdout.write(`workspace-protocol ${t} ${o.depType} ${o.depName} ${o.specifier} → ${o.fix}
11
+ `)}for(const o of e.redefineRoot??[]){const t=$(a,o.packageJsonPath);process.stdout.write(`redefine-root ${t} ${o.depType} ${o.depName} ${o.childSpecifier}
12
+ `)}for(const o of e.workspaceVersions??[]){const t=$(a,o.packageJsonPath);process.stdout.write(`workspace-versions ${t} ${o.depType} ${o.depName} ${o.specifier} → ${o.fix}
13
+ `)}for(const o of e.customTypes??[]){const t=$(a,o.packageJsonPath);process.stdout.write(`custom-types ${t} ${o.customType} ${o.depName} ${o.specifier} → ${o.fix}
14
+ `)}for(const o of e.bannedDeps??[]){const t=$(a,o.packageJsonPath);process.stdout.write(`banned-deps ${t} ${o.depType} ${o.depName} ${o.reason}
15
+ `)}for(const o of e.catalogProposals??[])process.stdout.write(`catalog-proposal ${o.catalogName} ${o.depName} ${o.specifier} ${String(o.instanceCount)}
16
+ `);for(const o of e.emptyDeps??[]){const t=$(a,o.packageJsonPath);process.stdout.write(`empty-deps ${t} ${o.depType}
17
+ `)}for(const o of e.rootPrivate??[]){const t=$(a,o.packageJsonPath);process.stdout.write(`root-private ${t}
18
+ `)}for(const o of e.rootPackageManager??[]){const t=$(a,o.packageJsonPath);process.stdout.write(`root-package-manager ${t} ${o.suggested??""}
19
+ `)}for(const o of e.rootDeps??[]){const t=$(a,o.packageJsonPath);for(const r of o.depNames)process.stdout.write(`root-deps ${t} ${r}
20
+ `)}for(const o of e.missingPackageJson??[])process.stdout.write(`missing-package-json ${o.packageDir}
21
+ `);for(const o of e.deadWorkspacePatterns??[])process.stdout.write(`dead-workspace-pattern ${o.source} ${o.pattern}
22
+ `);for(const o of e.typesInDeps??[]){const t=$(a,o.packageJsonPath);process.stdout.write(`types-in-deps ${t} ${o.depName} ${o.childSpecifier}
23
+ `)}for(const o of e.similarDeps??[])for(const t of o.members){const r=$(a,t.packageJsonPath);process.stdout.write(`similar-deps ${o.family} ${r} ${t.depType} ${t.depName} ${t.specifier}
24
+ `)}},wt=(e,a,o,t)=>{const r=s=>({...s,packageJsonPath:$(a,s.packageJsonPath)}),n={fixed:o};if(t.workspaceProtocol){const s=(e.workspaceProtocol??[]).map(i=>r(i));n.workspaceProtocol={issues:s,total:s.length}}if(t.redefineRoot){const s=(e.redefineRoot??[]).map(i=>r(i));n.redefineRoot={issues:s,total:s.length}}if(t.workspaceVersions){const s=(e.workspaceVersions??[]).map(i=>r(i));n.workspaceVersions={issues:s,total:s.length}}if(t.customTypes){const s=(e.customTypes??[]).map(i=>r(i));n.customTypes={issues:s,total:s.length}}if(t.bannedDeps){const s=(e.bannedDeps??[]).map(i=>r(i));n.bannedDeps={issues:s,total:s.length}}if(e.catalogProposals!==void 0){const s=e.catalogProposals;n.catalogProposals={proposals:s,total:s.length}}if(t.emptyDeps){const s=(e.emptyDeps??[]).map(i=>r(i));n.emptyDeps={issues:s,total:s.length}}if(t.rootPrivate){const s=(e.rootPrivate??[]).map(i=>r(i));n.rootPrivate={issues:s,total:s.length}}if(t.rootPackageManager){const s=(e.rootPackageManager??[]).map(i=>r(i));n.rootPackageManager={issues:s,total:s.length}}if(t.rootDeps){const s=(e.rootDeps??[]).map(i=>r(i));n.rootDeps={issues:s,total:s.length}}if(t.missingPackageJson){const s=e.missingPackageJson??[];n.missingPackageJson={issues:s,total:s.length}}if(t.deadWorkspacePatterns){const s=e.deadWorkspacePatterns??[];n.deadWorkspacePatterns={issues:s,total:s.length}}if(t.typesInDeps){const s=(e.typesInDeps??[]).map(i=>r(i));n.typesInDeps={issues:s,total:s.length}}if(t.similarDeps){const s=(e.similarDeps??[]).map(i=>({...i,members:i.members.map(p=>({...p,packageJsonPath:$(a,p.packageJsonPath)}))}));n.similarDeps={issues:s,total:s.length}}process.stdout.write(`${JSON.stringify(n,void 0,2)}
25
+ `)},J=(e,a,o)=>{const t=e[a];return typeof t=="boolean"?t:e[o]===!0},Dt=e=>{const a=e,o=(e.ban?.length??0)>0,t=(e.pin?.length??0)>0,r=J(a,"workspaceProtocol","workspace-protocol"),n=J(a,"redefineRoot","redefine-root"),s=J(a,"bannedDeps","banned-deps"),i=J(a,"workspaceVersions","workspace-versions"),p=J(a,"customTypes","custom-types"),c=J(a,"emptyDeps","empty-deps"),f=J(a,"rootPrivate","root-private"),m=J(a,"rootPackageManager","root-package-manager"),d=J(a,"rootDeps","root-deps"),g=J(a,"missingPackageJson","missing-package-json"),h=J(a,"deadWorkspacePatterns","dead-workspace-patterns"),y=J(a,"typesInDeps","types-in-deps"),x=J(a,"similarDeps","similar-deps");return r||n||s||i||p||c||f||m||d||g||h||y||x||o||t?{bannedDeps:s||o,customTypes:p,deadWorkspacePatterns:h,emptyDeps:c,missingPackageJson:g,redefineRoot:n,rootDeps:d,rootPackageManager:m,rootPrivate:f,similarDeps:x,typesInDeps:y,workspaceProtocol:r,workspaceVersions:i||t}:{bannedDeps:!0,customTypes:!0,deadWorkspacePatterns:!0,emptyDeps:!0,missingPackageJson:!0,redefineRoot:!0,rootDeps:!0,rootPackageManager:!0,rootPrivate:!0,similarDeps:!0,typesInDeps:!0,workspaceProtocol:!0,workspaceVersions:!0}},vt=e=>{const a=new Map;for(const o of e??[]){const t=o.lastIndexOf("@");if(t<=0||t===o.length-1)throw new Error(`Invalid --pin "${o}". Use: name@<specifier> (e.g. react@^18.2.0).`);const r=o.slice(0,t),n=o.slice(t+1);a.set(r,n)}return a},Nt=new Set(["catalog","highest","lowest"]),bt=e=>{if(e===void 0)return"highest";if(!Nt.has(e))throw new Error(`Invalid --resolve "${e}". Use: highest, lowest, or catalog.`);return e},W=(e,a)=>e?a===void 0||a===!0:!1,xt={"custom-types":"policy.customTypes.autofix","workspace-protocol":"policy.workspaceProtocol.autofix","workspace-versions":"policy.workspaceVersions.autofix"},_=(e,a,o,t)=>{const r=xt[a],n=o==="prompt"?`${r} = "prompt" (interactive mode not yet implemented; report-only)`:`${r} = false`,s=`Set "${r}": true (or remove it) to enable rewrites.`;e.warn(`${a}: ${String(t)} issue${t===1?"":"s"} not rewritten — ${n}. ${s}`)},Et=async({logger:e,options:a,visConfig:o,workspaceRoot:t})=>{if(!t)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const r=t,n=a.fix??!1,s=a.format??"human",i=a.quiet??!1;if(!["human","json","minimal"].includes(s))throw new Error(`Invalid --format "${s}". Use: human, json, or minimal.`);const p=Dt(a),c=o?.policy??{},f=o?.editorconfig??!0,m=vt(a.pin),d=a.ban??[];(a.dep!==void 0||a.resolve!==void 0)&&!p.workspaceVersions&&!i&&e.warn("--dep / --resolve only apply to --workspace-versions; ignored.");const g=se(r),h={},y={catalogProposals:!1,customTypes:!1,deadWorkspacePatterns:!1,emptyDeps:!1,rootDeps:!1,rootPackageManager:!1,rootPrivate:!1,typesInDeps:!1,workspaceProtocol:!1,workspaceVersions:!1},x=nt(r);let N=0;if(p.workspaceProtocol){const l=qe(g,{fixSpecifier:a.fixSpecifier}),k=W(n,c.workspaceProtocol?.autofix);k&&l.length>0&&(He(l,{useEditorconfig:f}),y.workspaceProtocol=!0),h.workspaceProtocol=l,k||(N+=l.length),n&&!k&&l.length>0&&!i&&_(e,"workspace-protocol",c.workspaceProtocol?.autofix,l.length)}if(p.redefineRoot){const l=Se(g,{ignoreDeps:c.redefineRoot?.ignore});h.redefineRoot=l,N+=l.length}if(p.workspaceVersions){const l=bt(a.resolve??c.workspaceVersions?.resolve),k=l==="catalog"?ce(r):void 0;l==="catalog"&&(!k||k.size===0)&&!i&&e.warn("--resolve catalog: no catalog found in pnpm-workspace.yaml or root package.json — nothing to align.");const b=ot(g,{catalogs:k,dep:a.dep,ignoreDeps:c.workspaceVersions?.ignore,pinned:m.size>0?m:void 0,resolve:l}),F=W(n,c.workspaceVersions?.autofix);if(F&&b.length>0&&(st(b,{useEditorconfig:f}),y.workspaceVersions=!0),h.workspaceVersions=b,F||(N+=b.length),n&&!F&&b.length>0&&!i&&_(e,"workspace-versions",c.workspaceVersions?.autofix,b.length),a.proposeMin!==void 0){if(l!=="catalog"&&!i)e.warn("--propose-min only runs under --resolve catalog; ignored.");else if(l==="catalog"){const M=Pe(g,{catalogs:k,ignoreDeps:c.workspaceVersions?.ignore,min:a.proposeMin});F&&M.length>0&&(we(r,M),y.catalogProposals=!0),h.catalogProposals=M}}}if(p.customTypes){const l=c.customTypes?.extraTypes,k=ne(l);if(k.length>0){for(const Q of k)e.error(`policy.customTypes.${Q}`);process.exitCode=1;return}const b=ae(r,l),F=(a.resolve??c.customTypes?.resolve)==="lowest"?"lowest":"highest",M=re(b,{dep:a.dep,ignoreDeps:c.customTypes?.ignore,resolve:F}),O=W(n,c.customTypes?.autofix);O&&M.length>0&&(ie(M,{useEditorconfig:f}),y.customTypes=!0),h.customTypes=M,O||(N+=M.length),n&&!O&&M.length>0&&!i&&_(e,"custom-types",c.customTypes?.autofix,M.length)}if(p.bannedDeps){const l={...c.bannedDeps};for(const b of d)l[b]={reason:"banned via --ban CLI flag"};Object.keys(l).length===0&&a.bannedDeps&&!i&&e.warn("--banned-deps: no policy.bannedDeps in vis config, nothing to check.");const k=me(g,l);h.bannedDeps=k,N+=k.length}if(p.emptyDeps){const l=xe(r,{ignoreBlocks:c.emptyDeps?.ignoreBlocks}),k=W(n,c.emptyDeps?.autofix);k&&l.length>0&&(Je(l,{useEditorconfig:f}),y.emptyDeps=!0),h.emptyDeps=l,k||(N+=l.length)}if(p.rootPrivate){const l=Ee(r,x),k=W(n,c.rootPrivate?.autofix);k&&l.length>0&&(Fe(l,{useEditorconfig:f}),y.rootPrivate=!0),h.rootPrivate=l,k||(N+=l.length)}if(p.rootPackageManager){const l=Re(r,x,{suggested:c.rootPackageManager?.suggested}),k=W(n,c.rootPackageManager?.autofix);k&&l.some(b=>b.suggested!==void 0)&&(Ie(l,{useEditorconfig:f}),y.rootPackageManager=!0),h.rootPackageManager=l,(!k||!y.rootPackageManager)&&(N+=l.filter(b=>b.suggested===void 0||!y.rootPackageManager).length)}if(p.rootDeps){const l=Me(r,x),k=W(n,c.rootDeps?.autofix);k&&l.length>0&&(je(l,{useEditorconfig:f}),y.rootDeps=!0),h.rootDeps=l,k||(N+=l.length)}if(p.missingPackageJson){const l=fe(r);h.missingPackageJson=l,N+=l.length}if(p.deadWorkspacePatterns){const l=ve(r),k=W(n,c.deadWorkspacePatterns?.autofix);k&&l.length>0&&(Ne(l,{useEditorconfig:f}),y.deadWorkspacePatterns=!0),h.deadWorkspacePatterns=l,k||(N+=l.length)}if(p.typesInDeps){const l=Be(g,{ignoreDeps:c.typesInDeps?.ignore}),k=W(n,c.typesInDeps?.autofix);k&&l.length>0&&(Le(l,{useEditorconfig:f}),y.typesInDeps=!0),h.typesInDeps=l,k||(N+=l.length)}if(p.similarDeps){const l=_e(g,{extraFamilies:c.similarDeps?.extraFamilies,ignoreFamilies:c.similarDeps?.ignoreFamilies});h.similarDeps=l,N+=l.length}i||(s==="json"?wt(h,r,y,p):s==="minimal"?Pt(h,r):$t(h,r,y,p,e)),N>0&&(process.exitCode=1)};export{Et as default};
@@ -0,0 +1,153 @@
1
+ import{createRequire as ae}from"node:module";import{j as b,q as k,E as p}from"../packem_shared/index.server-J83sowC4.js";import{B as $,J as se,f as j,a as y,m as l,T as u,y as L,o as ce,A as le}from"../packem_shared/index-CE6MsgcV.js";import{p as a}from"./cli-main.js";import{W as Z,A as pe,y as ue}from"../packem_shared/pm-runner-CQcraCcu.js";import{g as he}from"../packem_shared/_commonjsHelpers-B5Y90VFO.js";import{f as fe}from"../packem_shared/giget-DVTFJlbR.js";import{a as J}from"../packem_shared/readJsonSync-DuMMeB3s-ihoybKvs.js";const ne=ae(import.meta.url),q=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,z=e=>{if(typeof q<"u"&&q.versions&&q.versions.node){const[t,r]=q.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return q.getBuiltinModule(e)}return ne(e)},{spawnSync:oe}=z("node:child_process"),{createInterface:de}=z("node:readline"),{readdirSync:me,chmodSync:ge}=z("node:fs"),ye={"vis:app":"builtin:app","vis:application":"builtin:app","vis:generator":"builtin:generator","vis:lib":"builtin:library","vis:library":"builtin:library","vis:monorepo":"builtin:monorepo"},ve=["https://github.com/","https://gitlab.com/","https://bitbucket.org/","https://raw.githubusercontent.com/","https://git.sr.ht/","git@github.com:","git@gitlab.com:","git@bitbucket.org:","git@git.sr.ht:","github:","gh:","gitlab:","bitbucket:","sourcehut:","git:","http://","https://"],be=e=>{for(const t of ve)if(e.startsWith(t))return!0;return!e.startsWith("@")&&/^[^/#@][^/#]*\/[^/#]+/.test(e)},we=new Set(["sv"]),ke=e=>{if(we.has(e)||e.startsWith("create-")||e.startsWith("@")&&e.includes("/create-"))return e;if(e.startsWith("@")){const t=e.indexOf("/");if(t!==-1){const r=e.slice(0,t),i=e.slice(t+1);return`${r}/create-${i}`}return e}return`create-${e}`},xe=(e,t=[])=>{if(!e)throw new Error("No template specified.");const r=e.toLowerCase(),i=ye[r];return i?{args:t,source:r,type:i}:be(e)?{args:t,source:e,type:"remote:git"}:{args:t,source:ke(e),type:"remote:npm"}},$e=e=>{switch(e){case"builtin:app":return"apps";case"builtin:generator":case"builtin:library":return"packages";default:return"."}},V=["ability","able","about","above","abroad","absence","absolute","absolutely","absorb","academic","accept","access","accompany","accomplish","according","account","accurate","achieve","achievement","acid","acknowledge","acquire","across","act","action","active","activist","activity","actor","actress","actual","actually","adapt","add","addition","additional","address","adequate","adjust","adjustment","administration","administrator","admire","admission","admit","adolescent","adopt","adult","advance","advanced","advantage","adventure","advertising","advice","advise","adviser","advocate","affair","affect","afford","after","afternoon","again","against","age","agency","agenda","agent","ago","agree","agreement","agricultural","ahead","aid","aide","aim","air","aircraft","airline","airport","album","alive","all","alliance","allow","ally","almost","alone","along","already","also","alter","alternative","although","always","amazing","among","amount","analysis","analyst","analyze","ancient","and","angle","animal","anniversary","announce","annual","another","answer","anticipate","any","anybody","anymore","anyone","anything","anyway","anywhere","apart","apartment","apparent","apparently","appeal","appear","appearance","apple","application","apply","appoint","appointment","appreciate","approach","appropriate","approval","approve","approximately","architect","area","argue","argument","arise","arm","armed","around","arrange","arrangement","arrival","arrive","art","article","artist","artistic","aside","ask","asleep","aspect","assert","assess","assessment","asset","assign","assignment","assist","assistance","assistant","associate","association","assume","assumption","assure","athlete","athletic","atmosphere","attach","attempt","attend","attention","attitude","attorney","attract","attractive","attribute","audience","author","authority","auto","available","average","avoid","award","aware","awareness","away","awesome","baby","back","background","bag","bake","balance","ball","ban","band","bank","bar","barely","barrel","base","baseball","basic","basically","basis","basket","basketball","bathroom","battery","beach","bean","bear","beat","beautiful","beauty","because","become","bed","bedroom","beer","before","begin","beginning","behavior","behind","being","belief","believe","bell","belong","below","belt","bench","bend","beneath","benefit","beside","besides","best","bet","better","between","beyond","big","bike","bill","billion","bind","biological","bird","birth","birthday","bit","bite","black","blade","blanket","blind","block","blow","blue","board","boat","body","bond","bone","book","boom","boot","border","born","borrow","boss","both","bother","bottle","bottom","boundary","bowl","box","boy","boyfriend","brain","branch","brand","bread","break","breakfast","breast","breath","breathe","brick","bridge","brief","briefly","bright","brilliant","bring","broad","brother","brown","brush","buck","budget","build","building","bullet","bunch","bury","bus","business","busy","but","butter","button","buy","buyer","cabin","cabinet","cable","cake","calculate","call","camera","camp","campaign","campus","can","candidate","cap","capability","capable","capacity","capital","captain","capture","car","carbon","card","care","career","careful","carefully","carrier","carry","case","cash","cast","cat","catch","category","cause","ceiling","celebrate","celebration","celebrity","cell","center","central","century","ceremony","certain","certainly","chain","chair","chairman","challenge","chamber","champion","championship","chance","change","changing","channel","chapter","character","characteristic","characterize","charge","charity","chart","chase","cheap","check","cheek","cheese","chef","chemical","chest","chicken","chief","child","childhood","chip","chocolate","choice","cholesterol","choose","church","cigarette","circle","circumstance","cite","citizen","city","civil","civilian","claim","class","classic","classroom","clean","clear","clearly","client","climate","climb","clinic","clinical","clock","close","closely","closer","clothes","clothing","cloud","club","clue","cluster","coach","coal","coalition","coast","coat","code","coffee","cognitive","cold","colleague","collect","collection","collective","college","colonial","color","column","combination","combine","come","comedy","comfort","comfortable","command","commander","comment","commercial","commission","commit","commitment","committee","common","communicate","communication","community","company","compare","comparison","compete","competition","competitive","competitor","complete","completely","complex","complicated","component","compose","composition","comprehensive","computer","concentrate","concentration","concept","concern","concerned","concert","conclude","conclusion","concrete","condition","conduct","conference","confidence","confident","confirm","confront","confusion","congressional","connect","connection","consciousness","consensus","consequence","conservative","consider","considerable","consideration","consist","consistent","constant","constantly","constitute","constitutional","construct","construction","consultant","consume","consumer","consumption","contact","contain","container","contemporary","content","contest","context","continue","continued","contract","contrast","contribute","contribution","control","convention","conventional","conversation","convert","conviction","convince","cook","cookie","cooking","cool","cooperation","cop","cope","copy","core","corn","corner","corporate","corporation","correct","correspondent","cost","cotton","couch","could","council","counselor","count","counter","country","county","couple","courage","course","court","cousin","cover","coverage","cow","crack","craft","cream","create","creation","creative","creature","credit","crew","criteria","crop","cross","crowd","crucial","cultural","culture","cup","curious","current","currently","curriculum","custom","customer","cut","cycle","dad","daily","dance","dare","dark","darkness","data","date","daughter","day","deal","dealer","dear","debate","decade","decide","decision","deck","declare","decrease","deep","deeply","deer","defend","defendant","defense","defensive","define","definitely","definition","degree","delay","deliver","delivery","demand","democracy","democratic","demonstrate","demonstration","deny","department","depend","dependent","depending","depict","depth","deputy","derive","describe","description","desert","deserve","design","designer","desire","desk","desperate","despite","detail","detailed","detect","determine","develop","developing","development","device","devote","dialogue","diet","differ","difference","different","differently","difficult","difficulty","dig","digital","dimension","dining","dinner","direct","direction","directly","director","disability","disagree","disappear","discipline","discourse","discover","discovery","discuss","discussion","dish","dismiss","display","distance","distant","distinct","distinction","distinguish","distribute","distribution","district","diverse","diversity","divide","division","doctor","document","dog","domestic","dominant","dominate","door","double","down","downtown","dozen","draft","drag","drama","dramatic","dramatically","draw","drawing","dream","dress","drink","drive","driver","drop","dry","due","during","dust","duty","each","eager","ear","early","earn","earnings","earth","ease","easily","east","eastern","easy","eat","economic","economics","economist","economy","edge","edition","editor","educate","education","educational","educator","effect","effective","effectively","efficiency","efficient","effort","egg","eight","either","elderly","elect","election","electric","electricity","electronic","element","elementary","eliminate","elite","else","elsewhere","embrace","emerge","emission","emotion","emotional","emphasis","emphasize","employ","employee","employer","employment","empty","enable","encounter","encourage","end","energy","enforcement","engage","engine","engineer","engineering","enhance","enjoy","enormous","enough","ensure","enter","enterprise","entertainment","entire","entirely","entrance","entry","environment","environmental","episode","equal","equally","equipment","era","escape","especially","essay","essential","essentially","establish","establishment","estate","estimate","etc","ethics","ethnic","evaluate","evaluation","even","evening","event","eventually","ever","every","everybody","everyday","everyone","everything","everywhere","evidence","evolution","evolve","exact","exactly","examination","examine","example","exceed","excellent","except","exception","exchange","exciting","executive","exercise","exhibit","exhibition","exist","existence","existing","expand","expansion","expect","expectation","expense","expensive","experience","experiment","expert","explain","explanation","explore","expose","express","expression","extend","extension","extensive","extent","external","extra","extraordinary","extreme","extremely","eye","fabric","face","facility","fact","factor","factory","faculty","fade","fair","fairly","faith","fall","false","familiar","family","famous","fan","fantasy","far","farm","farmer","fashion","fast","fate","father","favor","favorite","feature","federal","fee","feed","feel","feeling","fellow","female","fence","few","fewer","fiber","fiction","field","fifteen","fifth","fifty","figure","file","fill","film","final","finally","finance","financial","find","finding","fine","finger","finish","firm","first","fish","fishing","fit","fitness","five","fix","flag","flame","flat","flavor","flesh","flight","float","floor","flow","flower","fly","focus","folk","follow","following","food","foot","football","for","force","foreign","forest","forever","forget","form","formal","formation","former","formula","forth","fortune","forward","found","foundation","founder","four","fourth","frame","framework","free","freedom","freeze","frequency","frequent","frequently","fresh","friend","friendly","friendship","from","front","fruit","fuel","full","fully","fun","function","fund","fundamental","funding","funeral","funny","furniture","furthermore","future","gain","galaxy","gallery","game","gap","garage","garden","garlic","gas","gate","gather","gaze","gear","gender","gene","general","generally","generate","generation","genetic","gentleman","gently","gesture","get","ghost","giant","gift","gifted","girl","girlfriend","give","given","glad","glance","glass","global","glove","goal","gold","golden","golf","good","government","governor","grab","grade","gradually","graduate","grain","grand","grandfather","grandmother","grant","grass","grave","gray","great","greatest","green","grocery","ground","group","grow","growing","growth","guarantee","guard","guess","guest","guide","guideline","guy","habit","habitat","hair","half","hall","hand","handful","handle","hang","happen","happy","hard","hardly","hat","have","head","headline","headquarters","health","healthy","hear","hearing","heart","heat","heaven","heavily","heavy","heel","height","helicopter","hello","help","helpful","here","heritage","hero","herself","hey","hide","high","highlight","highly","highway","hill","himself","hip","hire","historian","historic","historical","history","hit","hold","hole","holiday","holy","home","honest","honey","honor","hope","horizon","horse","hospital","host","hot","hotel","hour","house","household","housing","how","however","huge","human","humor","hundred","hungry","hunter","hunting","husband","hypothesis","ice","idea","ideal","identification","identify","identity","ignore","illustrate","image","imagination","imagine","immediate","immediately","immigrant","immigration","impact","implement","implication","imply","importance","important","impose","impossible","impress","impression","impressive","improve","improvement","incentive","incident","include","including","income","incorporate","increase","increased","increasing","increasingly","incredible","indeed","independence","independent","index","indicate","indication","individual","industrial","industry","infant","inflation","influence","inform","information","ingredient","initial","initially","initiative","inner","innocent","inquiry","inside","insight","insist","inspire","install","instance","instead","institution","institutional","instruction","instructor","instrument","insurance","intellectual","intelligence","intend","intense","intensity","intention","interaction","interest","interested","interesting","internal","international","interpret","interpretation","intervention","interview","into","introduce","introduction","invest","investigate","investigation","investigator","investment","investor","invite","involve","involved","involvement","iron","island","issue","item","its","itself","jacket","jet","job","join","joint","joke","journal","journalist","journey","joy","judge","judgment","juice","jump","junior","jury","just","justice","justify","keep","key","kick","kid","kind","king","kiss","kitchen","knee","knife","knock","know","knowledge","lab","label","labor","laboratory","lady","lake","land","landscape","language","lap","large","largely","last","late","later","latter","laugh","launch","law","lawn","lawsuit","lawyer","lay","layer","lead","leader","leadership","leading","leaf","league","lean","learn","learning","least","leather","leave","left","leg","legacy","legal","legend","legislation","legitimate","lemon","length","less","lesson","let","letter","level","liberal","library","license","lie","life","lifestyle","lifetime","lift","light","like","likely","limit","limitation","limited","line","link","lip","list","listen","literally","literary","literature","little","live","living","load","loan","local","locate","location","lock","long","look","loose","lose","lost","lot","lots","loud","love","lovely","lover","low","lower","luck","lucky","lunch","lung","machine","magazine","mail","main","mainly","maintain","maintenance","major","majority","make","maker","makeup","male","mall","man","manage","management","manager","manner","manufacturer","manufacturing","many","map","margin","mark","market","marketing","marriage","married","marry","mask","mass","massive","master","match","material","math","matter","may","maybe","mayor","meal","mean","meaning","meanwhile","measure","measurement","meat","mechanism","media","medical","medication","medicine","medium","meet","meeting","member","membership","memory","mental","mention","menu","mere","merely","message","metal","meter","method","middle","might","military","milk","million","mind","mine","minister","minor","minority","minute","miracle","mirror","miss","missile","mission","mix","mixture","mode","model","moderate","modern","modest","mom","moment","money","monitor","month","mood","moon","moral","more","moreover","morning","mortgage","most","mostly","mother","motion","motivation","motor","mount","mountain","mouse","mouth","move","movement","movie","much","multiple","muscle","museum","music","musical","musician","must","mutual","myself","mystery","myth","naked","name","narrative","narrow","nation","national","native","natural","naturally","nature","near","nearby","nearly","necessarily","necessary","neck","need","negative","negotiate","negotiation","neighbor","neighborhood","neither","nerve","net","network","never","nevertheless","new","newly","news","newspaper","next","nice","night","nine","nobody","nod","nomination","none","nonetheless","nor","normal","normally","north","northern","nose","not","note","nothing","notice","notion","novel","now","nowhere","nuclear","number","numerous","nurse","nut","object","objective","obligation","observation","observe","observer","obtain","obvious","obviously","occasion","occasionally","occupation","occupy","occur","ocean","odd","odds","off","offer","office","officer","official","often","oil","okay","old","once","one","ongoing","onion","online","only","onto","open","opening","operate","operating","operation","operator","opinion","opponent","opportunity","oppose","opposite","opposition","option","orange","order","ordinary","organic","organization","organize","orientation","origin","original","originally","other","others","otherwise","ought","our","ourselves","out","outcome","outside","oven","over","overall","overcome","overlook","owe","own","owner","pace","pack","package","page","paint","painter","painting","pair","pale","palm","pan","panel","pant","paper","parent","park","parking","part","participant","participate","participation","particular","particularly","partly","partner","partnership","party","pass","passage","passenger","passion","past","patch","path","patient","pattern","pause","pay","payment","peace","peak","peer","people","pepper","per","perceive","percentage","perception","perfect","perfectly","perform","performance","perhaps","period","permanent","permission","permit","person","personal","personality","personally","personnel","perspective","persuade","pet","phase","phenomenon","philosophy","phone","photo","photograph","photographer","phrase","physical","physically","physician","piano","pick","picture","pie","piece","pile","pilot","pine","pink","pipe","pitch","place","plan","plane","planet","planning","plant","plastic","plate","platform","play","player","please","pleasure","plenty","plot","plus","pocket","poem","poet","poetry","point","pole","police","policy","political","politically","politician","politics","poll","pool","pop","popular","population","porch","port","portion","portrait","portray","pose","position","positive","possess","possibility","possible","possibly","post","pot","potato","potential","potentially","pound","pour","powder","power","powerful","practical","practice","pray","prayer","precisely","predict","prefer","preference","pregnancy","pregnant","preparation","prepare","prescription","presence","present","presentation","preserve","president","presidential","press","pretend","pretty","prevent","previous","previously","price","pride","priest","primarily","primary","prime","principal","principle","print","prior","priority","privacy","private","probably","procedure","proceed","process","produce","producer","product","production","profession","professional","professor","profile","profit","program","progress","project","prominent","promise","promote","prompt","proof","proper","properly","property","proportion","proposal","propose","proposed","prosecutor","prospect","protect","protection","protein","protest","proud","prove","provide","provider","province","provision","psychological","psychologist","psychology","public","publication","publicly","publish","publisher","pull","purchase","pure","purpose","pursue","push","put","qualify","quality","quarter","quarterback","question","quick","quickly","quiet","quietly","quit","quite","quote","race","racial","radical","radio","rail","rain","raise","range","rank","rapid","rapidly","rare","rarely","rate","rather","rating","ratio","raw","reach","react","reaction","read","reader","reading","ready","real","reality","realize","really","reason","reasonable","recall","receive","recent","recently","recipe","recognition","recognize","recommend","recommendation","record","recording","recover","recovery","recruit","red","reduce","reduction","refer","reference","reflect","reflection","reform","refugee","refuse","regard","regarding","regardless","regime","region","regional","register","regular","regularly","regulate","regulation","reinforce","relate","relation","relationship","relative","relatively","relax","release","relevant","relief","religion","religious","rely","remain","remaining","remarkable","remember","remind","remote","remove","repeat","repeatedly","replace","reply","report","reporter","represent","representation","representative","reputation","request","require","requirement","research","researcher","resemble","reservation","resident","resist","resolution","resolve","resort","resource","respect","respond","respondent","response","responsibility","responsible","rest","restaurant","restore","restriction","result","retain","retire","retirement","return","reveal","revenue","review","revolution","rhythm","rice","rich","rid","ride","rifle","right","ring","rise","river","road","rock","role","roll","romantic","roof","room","root","rope","rose","roughly","round","route","routine","row","rub","rule","run","running","rural","rush","sacred","safe","safety","sake","salad","salary","sale","sales","salt","same","sample","sanction","sand","satellite","satisfaction","satisfy","sauce","save","saving","say","scale","scenario","scene","schedule","scheme","scholar","scholarship","school","science","scientific","scientist","scope","score","screen","script","sea","search","season","seat","second","secret","secretary","section","sector","secure","security","see","seed","seek","seem","segment","seize","select","selection","self","sell","senator","send","senior","sense","sensitive","sentence","separate","sequence","series","serious","seriously","serve","service","session","set","setting","settle","settlement","seven","several","shade","shadow","shake","shall","shape","share","sharp","sheet","shelf","shell","shelter","shift","shine","ship","shirt","shoe","shop","shopping","shore","short","shortly","shot","should","shoulder","shout","show","shower","shrug","shut","side","sigh","sight","sign","signal","significance","significant","significantly","silence","silent","silver","similar","similarly","simple","simply","since","sing","singer","single","sink","sir","sister","sit","site","situation","six","size","ski","skill","skin","sky","sleep","slice","slide","slight","slightly","slip","slow","slowly","small","smart","smell","smile","smooth","snap","snow","soccer","social","society","soft","software","soil","solar","solid","solution","solve","some","somebody","somehow","someone","something","sometimes","somewhat","somewhere","son","song","soon","sophisticated","sorry","sort","soul","sound","soup","source","south","southern","space","speak","speaker","special","specialist","species","specific","specifically","speech","speed","spend","spending","spin","spirit","spiritual","split","spokesman","sport","spot","spread","spring","square","squeeze","stability","stable","staff","stage","stair","stake","stand","standard","standing","star","stare","start","state","statement","station","statistics","status","stay","steady","steal","steel","step","stick","still","stir","stock","stomach","stone","stop","storage","store","storm","story","straight","strange","stranger","strategic","strategy","stream","street","strength","strengthen","stretch","string","strip","strong","strongly","structure","student","studio","study","stuff","style","subject","submit","subsequent","substance","substantial","succeed","success","successful","successfully","such","sudden","suddenly","sue","sufficient","sugar","suggest","suggestion","suit","summer","summit","sun","super","supply","support","supporter","suppose","supposed","sure","surely","surface","surgery","surprise","surprised","surprising","surprisingly","surround","survey","survival","survive","survivor","sustain","swear","sweep","sweet","swim","swing","switch","symbol","system","table","tablespoon","tactic","tail","take","tale","talent","talk","tall","tank","tap","tape","target","task","taste","tax","taxpayer","tea","teach","teacher","teaching","team","tear","teaspoon","technical","technique","technology","teen","teenager","telephone","telescope","television","tell","temperature","temporary","ten","tend","tendency","tennis","tent","term","terms","territory","test","testify","testimony","testing","text","than","thank","thanks","that","the","theater","their","them","theme","themselves","then","theory","therapy","there","therefore","thick","thin","thing","think","thinking","third","thirty","though","thought","thousand","three","throat","through","throughout","throw","ticket","tie","tight","time","tiny","tip","tire","tired","tissue","title","today","toe","together","tomato","tomorrow","tone","tongue","tonight","too","tool","tooth","top","topic","toss","total","totally","touch","tough","tour","tourist","tournament","tower","town","toy","trace","track","trade","tradition","traditional","traffic","trail","train","training","transfer","transform","transformation","transition","translate","transportation","travel","treat","treatment","treaty","tree","tremendous","trend","trial","tribe","trip","troop","truck","true","truly","trust","truth","try","tube","tunnel","turn","twelve","twenty","twice","twin","two","type","typical","typically","ultimate","ultimately","unable","uncle","under","undergo","understand","understanding","unfortunately","uniform","union","unique","unit","universal","universe","university","unknown","unless","unlike","unlikely","until","unusual","upon","upper","urban","urge","use","used","useful","user","usual","usually","utility","vacation","valley","valuable","value","variable","variation","variety","various","vary","vast","vegetable","vehicle","venture","version","versus","very","vessel","veteran","via","victory","video","view","viewer","village","virtually","virtue","visible","vision","visit","visitor","visual","vital","voice","volume","volunteer","vote","voter","wage","wait","wake","walk","wall","wander","want","warm","warn","warning","wash","watch","water","wave","way","wealth","wealthy","wear","weather","wedding","week","weekend","weekly","weigh","weight","welcome","welfare","well","west","western","wet","what","whatever","wheel","when","whenever","where","whereas","whether","which","while","whisper","white","who","whole","whom","whose","why","wide","widely","widespread","wife","wild","will","willing","win","wind","window","wine","wing","winner","winter","wipe","wire","wisdom","wise","wish","with","withdraw","within","without","witness","woman","wonder","wonderful","wood","wooden","word","work","worker","working","works","workshop","world","worried","worth","would","wrap","write","writer","writing","yard","yeah","year","yell","yellow","yes","yesterday","yield","young","your","yours","yourself","youth","zone"],_e=(e,t)=>Math.floor(e+Math.random()*(t-e+1));function K(){return V[_e(0,V.length-1)]}const je=()=>`${K()}-${K()}`;var I,Y;function Ce(){return Y||(Y=1,I=["_http_agent","_http_client","_http_common","_http_incoming","_http_outgoing","_http_server","_stream_duplex","_stream_passthrough","_stream_readable","_stream_transform","_stream_wrap","_stream_writable","_tls_common","_tls_wrap","assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib","node:sea","node:sqlite","node:test","node:test/reporters"]),I}var M,Q;function Se(){if(Q)return M;Q=1;const e=Ce();var t=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),r=["node_modules","favicon.ico"];function i(n){var c=[],s=[];if(n===null)return s.push("name cannot be null"),o(c,s);if(n===void 0)return s.push("name cannot be undefined"),o(c,s);if(typeof n!="string")return s.push("name must be a string"),o(c,s);if(n.length||s.push("name length must be greater than zero"),n.startsWith(".")&&s.push("name cannot start with a period"),n.startsWith("-")&&s.push("name cannot start with a hyphen"),n.match(/^_/)&&s.push("name cannot start with an underscore"),n.trim()!==n&&s.push("name cannot contain leading or trailing spaces"),r.forEach(function(x){n.toLowerCase()===x&&s.push(x+" is not a valid package name")}),e.includes(n.toLowerCase())&&c.push(n+" is a core module name"),n.length>214&&c.push("name can no longer contain more than 214 characters"),n.toLowerCase()!==n&&c.push("name can no longer contain capital letters"),/[~'!()*]/.test(n.split("/").slice(-1)[0])&&c.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(n)!==n){var m=n.match(t);if(m){var w=m[1],v=m[2];if(v.startsWith(".")&&s.push("name cannot start with a period"),encodeURIComponent(w)===w&&encodeURIComponent(v)===v)return o(c,s)}s.push("name can only contain URL-friendly characters")}return o(c,s)}var o=function(n,c){var s={validForNewPackages:c.length===0&&n.length===0,validForOldPackages:c.length===0,warnings:n,errors:c};return s.warnings.length||delete s.warnings,s.errors.length||delete s.errors,s};return M=i,M}var qe=Se();const Ee=he(qe),ee=e=>e?Ee(e).validForNewPackages:!1,N=e=>e.toLowerCase().trim().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d\-~]/g,"-").replace(/^[._-]+/,"").replaceAll(/-{2,}/g,"-").replace(/-$/,""),Ne=new Set([".DS_Store",".git",".gitkeep","Thumbs.db"]),te=e=>j(e)?me(e).every(t=>Ne.has(t)):!0,De=(e,t)=>{const r=$(t,e);return{packageName:N(se(r)),targetDir:r}},Oe=e=>te(e),E=(e,t)=>new Promise(r=>{e.question(t,i=>{r(i.trim())})}),R=async(e,t,r=!0)=>{const i=await E(e,` ${t} ${p(r?"[Y/n]":"[y/N]")} `);return i===""?r:i.toLowerCase()==="y"||i.toLowerCase()==="yes"},X=async(e,t,r)=>{process.stderr.write(` ${t}
2
+ `);for(const[i,o]of r.entries()){const n=b(k(` ${String(i+1)}.`)),c=o.hint?p(` — ${o.hint}`):"";process.stderr.write(`${n} ${o.label}${c}
3
+ `)}for(;;){const i=await E(e,`
4
+ ${p(`Enter choice (1-${String(r.length)}):`)} `),o=Number.parseInt(i,10);if(o>=1&&o<=r.length)return r[o-1].value;const n=r.find(c=>c.value===i||c.label.toLowerCase()===i.toLowerCase());if(n)return n.value;process.stderr.write(` ${p("Invalid choice. Try again.")}
5
+ `)}},Te=async e=>{const t=de({input:process.stdin,output:process.stdout});try{process.stderr.write(`
6
+ ${b(k("vis create"))} ${p("— project scaffolding")}
7
+
8
+ `);const r=e.inMonorepo?[{hint:"Scaffold via create-vite",label:"Vis Application",value:"vis:app"},{hint:"Reusable package scaffold",label:"Vis Library",value:"vis:library"},{hint:"Code generator scaffold",label:"Vis Generator",value:"vis:generator"},{hint:"Enter an npm create-* package or GitHub URL",label:"Custom template",value:"__custom__"}]:[{hint:"Full workspace setup",label:"Vis Monorepo",value:"vis:monorepo"},{hint:"Scaffold via create-vite",label:"Vis Application",value:"vis:app"},{hint:"Reusable package scaffold",label:"Vis Library",value:"vis:library"},{hint:"Code generator scaffold",label:"Vis Generator",value:"vis:generator"},{hint:"Enter an npm create-* package or GitHub URL",label:"Custom template",value:"__custom__"}];let i=await X(t,"Select a template:",r);if(i==="__custom__"&&(i=await E(t,`
9
+ ${p("Template (npm package or GitHub URL):")} `),!i))throw new Error("No template specified.");const o=je(),n=await E(t,`
10
+ ${p(`Project name (${o}):`)} `)||o;if(!ee(N(n)))throw new Error(`Invalid project name: "${n}". Must be a valid npm package name.`);const c=N(n),s=await E(t,` ${p(`Target directory (${c}):`)} `)||c;let m=!1;const w=$(e.cwd,s);if(!te(w)&&(m=await R(t,`Directory "${s}" is not empty. Overwrite?`,!1),!m))throw new Error("Aborted — directory not empty.");let v;e.inMonorepo||(e.defaultPm?(v=e.defaultPm,process.stderr.write(` ${p(`Package manager: ${v} (from config)`)}
11
+ `)):v=await X(t,"Package manager:",[{label:"pnpm",value:"pnpm"},{label:"npm",value:"npm"},{label:"yarn",value:"yarn"},{label:"bun",value:"bun"}]));let x=!1;e.inMonorepo||(x=await R(t,"Initialize a git repository?",e.defaultGitInit??!1));const f=e.defaultEditor==="vscode",h=await R(t,"Generate VS Code configuration?",f)?"vscode":void 0;return process.stderr.write(`
12
+ `),{editor:h,gitInit:x,overwrite:m,pm:v,projectName:n,targetDir:s,template:i}}finally{t.close()}},Ie=(e,t)=>{a.info("Scaffolding application via create-vite...");const r=[L(t.cwd,t.targetDir)||".",...e.args];return r.includes("--no-immediate")||r.push("--no-immediate"),Z(t.pm,{additionalPackages:[],args:r,package:"create-vite",shellMode:!1,silent:!1},t.cwd,t.logger)},Me=e=>`${JSON.stringify({devDependencies:{typescript:"^5.0.0",vitest:"^3.0.0"},exports:{".":{default:"./dist/index.js",types:"./dist/index.d.ts"}},files:["dist"],main:"./dist/index.js",name:e,scripts:{build:"tsc",dev:"tsc --watch",test:"vitest run","test:watch":"vitest"},type:"module",types:"./dist/index.d.ts",version:"0.0.1"},null,4)}
13
+ `,Re=()=>`${JSON.stringify({compilerOptions:{declaration:!0,declarationMap:!0,esModuleInterop:!0,module:"Node16",moduleResolution:"Node16",outDir:"./dist",rootDir:"./src",skipLibCheck:!0,sourceMap:!0,strict:!0,target:"ES2022"},include:["src/**/*"]},null,4)}
14
+ `,ze=e=>`/**
15
+ * ${e} — library entry point.
16
+ */
17
+
18
+ export const greet = (name: string): string => \`Hello from ${e}, \${name}!\`;
19
+ `,Le=e=>`import { describe, expect, it } from "vitest";
20
+
21
+ import { greet } from "../src/index";
22
+
23
+ describe("${e}", () => {
24
+ it("should greet", () => {
25
+ expect(greet("world")).toBe("Hello from ${e}, world!");
26
+ });
27
+ });
28
+ `,Pe=(e,t)=>{const{projectName:r,targetDir:i}=t;return a.info("Scaffolding library package..."),y(i),y(l(i,"src")),y(l(i,"__tests__")),u(l(i,"package.json"),Me(r)),a.success("Created package.json"),u(l(i,"tsconfig.json"),Re()),a.success("Created tsconfig.json"),u(l(i,"src","index.ts"),ze(r)),a.success("Created src/index.ts"),u(l(i,"__tests__","index.test.ts"),Le(r)),a.success("Created __tests__/index.test.ts"),u(l(i,".gitignore"),`node_modules/
29
+ dist/
30
+ .env
31
+ .DS_Store
32
+ `),a.success("Created .gitignore"),0},Ae=(e,t)=>{switch(e.type){case"builtin:app":return Ie(e,t);case"builtin:library":return Pe(e,t);default:throw new Error(`Unknown built-in template type: ${e.type}`)}},Ue=(e,t)=>`${JSON.stringify({bin:{[e]:"./bin/index.js"},description:t,devDependencies:{typescript:"^5.0.0"},name:e,private:!0,scripts:{build:"tsc",dev:"tsc --watch"},type:"module",version:"0.0.1"},null,4)}
33
+ `,Ge=e=>`#!/usr/bin/env node
34
+
35
+ /**
36
+ * ${e} — code generator
37
+ *
38
+ * Usage: npx ${e} [options]
39
+ */
40
+
41
+ console.log("Hello from ${e}!");
42
+ `,Be=()=>`${JSON.stringify({compilerOptions:{declaration:!0,esModuleInterop:!0,module:"Node16",moduleResolution:"Node16",outDir:"./dist",rootDir:"./src",skipLibCheck:!0,strict:!0,target:"ES2022"},include:["src/**/*","bin/**/*"]},null,4)}
43
+ `,Fe=()=>`/**
44
+ * Generator core logic — export functions used by the CLI entry point.
45
+ */
46
+
47
+ export const generate = (): void => {
48
+ // TODO: Implement your generator logic here
49
+ };
50
+ `,We=(e,t="")=>{const{projectName:r,targetDir:i}=e;a.info("Scaffolding code generator..."),y(i),y(l(i,"bin")),y(l(i,"src")),u(l(i,"package.json"),Ue(r,t||`Code generator: ${r}`)),a.success("Created package.json");const o=l(i,"bin","index.js");return u(o,Ge(r)),ge(o,493),a.success("Created bin/index.js (executable)"),u(l(i,"tsconfig.json"),Be()),a.success("Created tsconfig.json"),u(l(i,"src","index.ts"),Fe()),a.success("Created src/index.ts"),0},He=e=>`${JSON.stringify({devDependencies:{"@visulima/vis":"latest"},name:e,packageManager:"pnpm@latest",private:!0,scripts:{build:"vis run build",dev:"vis run dev",lint:"vis run lint",test:"vis run test"},type:"module",version:"0.0.0"},null,4)}
51
+ `,Je=()=>`packages:
52
+ - "apps/*"
53
+ - "packages/*"
54
+ `,Ve=()=>`# Dependencies
55
+ node_modules/
56
+
57
+ # Build output
58
+ dist/
59
+ .output/
60
+
61
+ # Environment
62
+ .env
63
+ .env.local
64
+ .env.*.local
65
+
66
+ # IDE
67
+ .vscode/*
68
+ !.vscode/settings.json
69
+ !.vscode/extensions.json
70
+ .idea/
71
+
72
+ # OS
73
+ .DS_Store
74
+ Thumbs.db
75
+
76
+ # Logs
77
+ *.log
78
+ npm-debug.log*
79
+ pnpm-debug.log*
80
+
81
+ # Cache
82
+ .turbo/
83
+ .cache/
84
+ `,Ke=()=>`root = true
85
+
86
+ [*]
87
+ indent_style = space
88
+ indent_size = 4
89
+ end_of_line = lf
90
+ charset = utf-8
91
+ trim_trailing_whitespace = true
92
+ insert_final_newline = true
93
+
94
+ [*.{yml,yaml}]
95
+ indent_size = 2
96
+
97
+ [*.md]
98
+ trim_trailing_whitespace = false
99
+ `,Ye=e=>`# ${e}
100
+
101
+ A monorepo powered by [vis](https://visulima.com/packages/vis).
102
+
103
+ ## Getting Started
104
+
105
+ \`\`\`bash
106
+ # Install dependencies
107
+ pnpm install
108
+
109
+ # Run all apps in development mode
110
+ pnpm dev
111
+
112
+ # Build all packages
113
+ pnpm build
114
+
115
+ # Run tests
116
+ pnpm test
117
+ \`\`\`
118
+
119
+ ## Structure
120
+
121
+ \`\`\`
122
+ ├── apps/ # Applications
123
+ ├── packages/ # Shared packages & libraries
124
+ ├── pnpm-workspace.yaml
125
+ └── package.json
126
+ \`\`\`
127
+ `,Qe=e=>{const{projectName:t,targetDir:r}=e;return a.info("Scaffolding monorepo workspace..."),y(r),y(l(r,"apps")),y(l(r,"packages")),u(l(r,"package.json"),He(t)),a.success("Created package.json"),u(l(r,"pnpm-workspace.yaml"),Je()),a.success("Created pnpm-workspace.yaml"),u(l(r,".gitignore"),Ve()),a.success("Created .gitignore"),u(l(r,".editorconfig"),Ke()),a.success("Created .editorconfig"),u(l(r,"README.md"),Ye(t)),a.success("Created README.md"),u(l(r,"apps",".gitkeep"),""),u(l(r,"packages",".gitkeep"),""),0},Xe={"create-nuxt":{monoArgs:["--no-gitInit"]},"create-vite":{args:["--no-immediate"]},sv:{args:["--no-install"],prependCommand:"create"}},Ze=(e,t,r)=>{const i=Xe[e];if(!i)return t;const o=[...t];if(i.prependCommand&&!o.includes(i.prependCommand)&&o.unshift(i.prependCommand),i.args)for(const n of i.args)o.includes(n)||o.push(n);if(r&&i.monoArgs)for(const n of i.monoArgs)o.includes(n)||o.push(n);return o},et=(e,t)=>{const r=L(t.cwd,t.targetDir)||".",i=[...e.args];i.includes(r)||i.unshift(r);const o=Ze(e.source,i,t.inMonorepo);return a.info(`Running ${e.source} via ${t.pm.name} dlx...`),Z(t.pm,{additionalPackages:[],args:o,package:e.source,shellMode:!1,silent:!1},t.cwd,t.logger)},tt=async(e,t)=>{const{createConfig:r}=t;a.info(`Downloading template from ${e.source}...`);try{const i=await fe(e.source,{auth:r?.auth||process.env.GIGET_AUTH||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,dir:t.targetDir,force:!0,preferOffline:r?.preferOffline,provider:r?.defaultProvider,registry:r?.registry});return a.info(`Downloaded to ${i.dir}`),0}catch(i){const o=i instanceof Error?i.message:String(i);return a.warn(`Failed to download template: ${o}`),1}},rt=async(e,t)=>{switch(e.type){case"builtin:app":case"builtin:library":return Ae(e,t);case"builtin:generator":return We(t);case"builtin:monorepo":return Qe(t);case"remote:git":return tt(e,t);case"remote:npm":return et(e,t);default:throw new Error(`Unknown template type: ${e.type}`)}},it=e=>{const t=l(e,".vscode");y(t);const r=l(t,"settings.json"),i={"editor.defaultFormatter":"oxc.oxc-vscode","editor.formatOnSave":!0};if(j(r))try{const c=J(r);u(r,`${JSON.stringify({...i,...c},null,4)}
128
+ `),a.success("Merged .vscode/settings.json")}catch{a.warn("Could not merge .vscode/settings.json, skipping")}else u(r,`${JSON.stringify(i,null,4)}
129
+ `),a.success("Created .vscode/settings.json");const o=l(t,"extensions.json"),n={recommendations:["oxc.oxc-vscode"]};if(j(o))try{const c=J(o);u(o,`${JSON.stringify({...c,recommendations:[...new Set([...c.recommendations||[],...n.recommendations])]},null,4)}
130
+ `),a.success("Merged .vscode/extensions.json")}catch{a.warn("Could not merge .vscode/extensions.json, skipping")}else u(o,`${JSON.stringify(n,null,4)}
131
+ `),a.success("Created .vscode/extensions.json")},at=(e,t)=>{const r=l(e,".ai");y(r);const i=l(r,"instructions");if(j(i))return;const o=`# Project Instructions
132
+
133
+ This project was scaffolded with vis create.
134
+
135
+ ## Development
136
+
137
+ - Package manager: ${t}
138
+ - Build: \`${t} run build\`
139
+ - Test: \`${t} run test\`
140
+ - Lint: \`${t} run lint\`
141
+
142
+ ## Conventions
143
+
144
+ - Use TypeScript strict mode
145
+ - ESM modules (\`"type": "module"\`)
146
+ - Follow Angular-style conventional commits
147
+ `;u(i,o),a.success("Created .ai/instructions")},nt=e=>{oe("git",["init"],{cwd:e,stdio:"pipe"}).status===0?a.success("Initialized git repository"):a.warn("Failed to initialize git repository")},ot=(e,t,r,i=!1)=>(a.info("Installing dependencies..."),ue(t,{dev:!1,filter:[],force:!1,frozenLockfile:!1,ignoreScripts:!1,lockfileOnly:!1,noOptional:!1,offline:i,prod:!1,recursive:!1,silent:!1,workspaceRoot:!1},e,r)===0?(a.success("Dependencies installed"),!0):(a.warn("Dependency installation failed (you can run install manually)"),!1)),st=e=>{const t=e.split("#")[0].split("?")[0].replace(/\/+$/,"").replace(/\.git$/,"").split("/").filter(Boolean).at(-1)??"",r=t.includes(":")?t.split(":").pop()??t:t;return N(r)||"my-project"},ct=e=>{if(a.info(""),a.info(" Built-in templates:"),a.info(` ${b(k("vis:monorepo"))} ${p("Full pnpm workspace setup")}`),a.info(` ${b(k("vis:app"))} ${p("Application scaffold via create-vite")}`),a.info(` ${b(k("vis:library"))} ${p("Reusable TypeScript library package")}`),a.info(` ${b(k("vis:generator"))} ${p("Code generator scaffold with bin entry")}`),e&&Object.keys(e).length>0){a.info(""),a.info(" Config aliases (vis.config.ts → create.templates):");for(const[t,r]of Object.entries(e))a.info(` ${b(k(t))}${" ".repeat(Math.max(1,16-t.length))}${p(r)}`)}a.info(""),a.info(" Remote templates:"),a.info(` ${p("Any npm create-* package:")} vis create vite`),a.info(` ${p("GitHub repository:")} vis create user/repo`),a.info(` ${p("GitLab / Bitbucket:")} vis create gitlab:user/repo`),a.info(` ${p("Full URL:")} vis create https://github.com/user/repo`),a.info(""),a.info(` ${p("Template args after --:")} vis create vite -- --template react-ts`),a.info("")},lt=(e,t,r,i)=>{const o=$(t)===$(e)?"":e;process.stderr.write(`
148
+ `),a.success("Project created successfully!"),process.stderr.write(`
149
+ `),a.notice("Next steps:"),o&&a.info(` cd ${o}`),i||a.info(` ${r} install`),a.info(` ${r} run dev`),process.stderr.write(`
150
+ `)},vt=async({argument:e,logger:t,options:r,rawUnknown:i,visConfig:o,workspaceRoot:n})=>{const c=Array.isArray(e)?e:e?[e]:[],s=o?.create;if(r.list){ct(s?.templates);return}const m=r.cwd||n||process.cwd(),w=!!n,v=!!process.stdin.isTTY,x=pe(m);let f,h,d,C=s?.defaultEditor,D=s?.gitInit??!1,P=[],S=x,A=!1;if(c.length===0&&v&&r.interactive!==!1){const g=await Te({cwd:m,defaultEditor:s?.defaultEditor,defaultGitInit:s?.gitInit,defaultPm:s?.defaultPm,inMonorepo:w});f=g.template,h=g.projectName,d=$(m,g.targetDir),C=g.editor??C,D=g.gitInit,A=g.overwrite,g.pm&&(S={name:g.pm,version:x.version})}else{if(c.length===0)throw new Error(`No template specified. Usage: vis create <template> [name] [-- args...]
151
+ Use --list to see available templates, or run interactively in a terminal.`);{let g=[...i??[]];if(g.length===0){const W=process.argv.slice(2),H=W.indexOf("--");H!==-1&&(g=W.slice(H+1))}const _=c.indexOf("--"),ie=_===-1?c:c.slice(0,_);P=[..._===-1?[]:c.slice(_+1),...g],[f,h]=ie,!h&&f&&(h=st(f)),C=r.editor==="vscode"?"vscode":C,D=!!r.gitInit||D}}if(!f)throw new Error("No template specified.");const O=s?.templates?.[f]??f,U=xe(O,P);if(!d){const g=w?$e(U.type):".",_=De(h??"",$(m,g));d=_.targetDir,h=_.packageName}const G=N(h??"");if(!ee(G))throw new Error(`Invalid project name: "${h}". Use lowercase alphanumeric characters and hyphens.`);h=G;const re=$(d),T=L($(m),re);if(T===".."||T.startsWith(`..${ce}`)||le(T))throw new Error(`Target directory "${d}" is outside the working directory. Use a name without "../" path segments.`);if(!A&&!Oe(d))throw new Error(`Target directory "${d}" is not empty.
152
+ Use a different name or clear the directory first.`);O!==f&&a.info(`Alias: ${b(k(f))} → ${p(O)}`),a.info(`Template: ${b(k(O))}`),a.info(`Project: ${b(h)}`),a.info(`Target: ${p(d)}`),process.stderr.write(`
153
+ `);const B=await rt(U,{createConfig:s,cwd:m,inMonorepo:w,logger:t,pm:S,projectName:h,targetDir:d});if(B!==0){process.exitCode=B;return}C==="vscode"&&it(d),j(d)&&at(d,S.name),D&&!w&&nt(d);let F=!1;s?.install!==!1&&j(l(d,"package.json"))&&(F=ot(d,S,t,s?.preferOffline)),lt(d,m,S.name,F)};export{vt as default};
@@ -0,0 +1 @@
1
+ import{r as g}from"../packem_shared/affected-shas-CCxG4tvm.js";import{r as m}from"../packem_shared/toolchain-Zb3VzZb4.js";const w=async({argument:d,logger:t,options:o,runtime:r,visConfig:s,workspaceRoot:e})=>{const l=d[0];if(!l)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");const f=l.split(",").map(a=>a.trim()).filter(Boolean);if(f.length===0)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");if(!e)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const i=g({defaultBase:s?.defaultBase,workspaceRoot:e}),p=o.base??i.base,c=o.head??i.head;!o.base&&!o.head&&t.info(`▸ Resolved affected refs from ${i.provider} (${i.notes.join("; ")})`),o.skipToolchain||t.info("▸ Toolchain pre-flight"),await m(e,s?.toolchain,{error:a=>{t.error(a)},info:a=>{t.info(a)},warn:a=>{t.warn(a)}},!!o.skipToolchain),o.install===!1?t.info("▸ Skipping install (--no-install)"):(t.info("▸ Installing dependencies"),await r.runCommand("install",{argv:["--ci","--frozen-lockfile"]}));for(const a of f){t.info(`▸ Running affected ${a} (base=${p}, head=${c})`);const n=[a,`--base=${p}`,`--head=${c}`,`--upstream=${String(o.upstream??"none")}`,`--downstream=${String(o.downstream??"deep")}`];o.parallel!==void 0&&n.push(`--parallel=${String(o.parallel)}`),o.partition&&n.push(`--partition=${String(o.partition)}`),o.query&&n.push(`--query=${String(o.query)}`),await r.runCommand("affected",{argv:n})}t.info("▸ CI pipeline complete")};export{w as default};
@@ -0,0 +1,10 @@
1
+ import{createRequire as mt}from"node:module";import{E as v,j as le,q as ke,I as fe,V as ve,s as Re}from"../packem_shared/index.server-J83sowC4.js";import{a5 as yt,J as wt,_ as kt,K as vt,I as bt,y as jt,M as $t,Q as Pe,p as d,P as We,S as N}from"./cli-main.js";import{m as W,f as be,a as St,v as Ct,A as Rt,B as Ke}from"../packem_shared/index-CE6MsgcV.js";import{E as At}from"../packem_shared/public-api-WqUCiyIe.js";import{m as s,n as u,i as r,r as O,R as Xe,c as Je,$ as It,d as Tt,g as Nt,V as Mt,N as Et,f as Dt}from"./catalog.js";import{g as Ft,B as ze,h as Qe}from"../packem_shared/env-DdQRnEIy.js";import{I as Ot}from"../packem_shared/index-B0EsgdzO.js";import{a as et}from"../packem_shared/readJsonSync-DuMMeB3s-ihoybKvs.js";import{findVisConfigFile as Bt}from"./CONFIG_FILES.js";import{A as tt,x as Be,N as Lt,F as _t,T as Vt,a as Gt,I as Ut,U as Ht}from"./handler67.js";import{A as it,y as Yt}from"../packem_shared/pm-runner-CQcraCcu.js";import{c as qt}from"../packem_shared/runtime-check-qnrPTlma.js";import{s as Wt}from"../packem_shared/scan-progress-BDcl7Kty.js";import{l as Kt,r as Xt,f as Jt}from"../packem_shared/dependency-scan-DpOFiZuI.js";import{o as st}from"../packem_shared/spinner-DuJJvFTl.js";import{F as Qt,a as Zt}from"../packem_shared/tabs-CgxCvjCY.js";import{u as ei}from"../packem_shared/use-measured-height-CjS7Tks7.js";import{u as ti}from"./ts-loader.js";import{s as ii}from"../packem_shared/verify-DStfg3nb.js";const xt=mt(import.meta.url),ye=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qe=e=>{if(typeof ye<"u"&&ye.versions&&ye.versions.node){const[t,i]=ye.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return ye.getBuiltinModule(e)}return xt(e)},{spawnSync:Ae}=qe("node:child_process"),{rmSync:Oe,writeFileSync:Pt,statSync:zt,readFileSync:Ze}=qe("node:fs"),Te=()=>W(Ft(),"doctor"),si=1800*1e3,Le=e=>{if(!e)return"";try{return String(zt(e).mtimeMs)}catch{return""}},ri=2,ni=e=>{const t=JSON.stringify({configMtime:Le(e.configPath),lockfileMtime:Le(e.lockfilePath),schema:ri,sections:[...e.sections].toSorted(),socketEnabled:e.socketEnabled,workspaceRoot:e.workspaceRoot});return yt(Buffer.from(t))},oi=e=>{const t=W(Te(),`${e}.json`);if(be(t))try{const i=et(t);if(Date.now()-i.createdAt>i.ttlMs){Oe(t,{force:!0});return}return{...i.results,sections:new Set(i.results.sections)}}catch{Oe(t,{force:!0});return}},li=(e,t,i=si)=>{St(Te());const l={createdAt:Date.now(),results:{...t,sections:[...t.sections]},ttlMs:i};Pt(W(Te(),`${e}.json`),JSON.stringify(l,void 0,2),"utf8")},$e="orphans",ai=()=>{if(process.platform!=="linux")return{id:"inotify",message:"inotify capacity check skipped (not Linux).",status:"skip"};let e;try{const t=Ze("/proc/sys/fs/inotify/max_user_watches","utf8").trim(),i=Number.parseInt(t,10);Number.isFinite(i)&&i>0&&(e=i)}catch{return{id:"inotify",message:"Could not read /proc/sys/fs/inotify/max_user_watches.",status:"warn"}}return e===void 0?{id:"inotify",message:"inotify max_user_watches reported a non-numeric value.",status:"warn"}:e<65536?{detail:{maxWatches:e},id:"inotify",message:`inotify watcher limit is ${String(e)} — large monorepos can exhaust this. Bump now with \`sudo sysctl fs.inotify.max_user_watches=524288\` and persist via \`/etc/sysctl.d/99-vis.conf\` so it survives reboot.`,status:"warn"}:{detail:{maxWatches:e},id:"inotify",message:`inotify capacity OK (${String(e)} watches).`,status:"ok"}},ci=()=>{const e=!!process.stdin.isTTY,t=!!process.stdout.isTTY;return e&&t?{id:"tty",message:"Interactive TTY available — watch keybinds enabled.",status:"ok"}:!e&&!t?{id:"tty",message:"No TTY on stdin/stdout — running in CI / piped mode (keybinds disabled).",status:"skip"}:{detail:{stdin:String(e),stdout:String(t)},id:"tty",message:e?"stdin is a TTY but stdout is not — output is being captured; keybinds still work.":"stdout is a TTY but stdin is not — keybinds disabled (input is piped).",status:"skip"}},di=()=>{const e=process.pid;try{return process.platform==="win32"?ot(e):nt(e)}catch{return[]}},ui=()=>{const e=process.pid;let t;try{t=process.platform==="win32"?ot(e):nt(e)}catch{return{id:$e,message:"Could not enumerate processes (ps/tasklist failed).",status:"warn"}}if(t.length===0)return{id:$e,message:"No orphaned vis/task-runner processes detected.",status:"ok"};if(t.length<=2)return{detail:{count:t.length,pids:t.join(",")},id:$e,message:`${String(t.length)} possibly orphaned process(es) detected (PIDs: ${t.join(", ")}). Likely benign.`,status:"skip"};const i=process.platform==="win32"?t.map(l=>`taskkill /F /PID ${String(l)}`).join(" & "):`kill ${t.join(" ")}`;return{detail:{count:t.length,pids:t.join(",")},id:"orphans",message:`${String(t.length)} possibly orphaned vis/task-runner processes — run \`vis doctor --fix\` to clean them up, or kill them manually: ${i}`,status:"warn"}},hi=(e={})=>{const t=e.enumerate??di,i=e.force===!0?"SIGKILL":"SIGTERM",l=e.kill??xi,n=t(),o=[],c=[];for(const h of n)try{l(h,i),o.push(h)}catch(a){const p=a.code??a.message;if(p==="ESRCH"){o.push(h);continue}c.push({pid:h,reason:p})}return{failed:c,killed:o}},pi=e=>Ae("taskkill",e,{encoding:"utf8",timeout:1e4}),gi=(e,t)=>{process.kill(e,t)},fi=(e,t,i=pi)=>{const l=t==="SIGKILL"?["/F","/PID",String(e)]:["/PID",String(e)],n=i(l);if(n.error)throw n.error;if(typeof n.status=="number"&&n.status!==0){const o=n.status===128?"ESRCH":`taskkill exited with code ${String(n.status)}`,c=new Error(o);throw c.code=o,c}},mi=(e,t,i=gi)=>{i(e,t)},xi=(e,t)=>{if(process.platform==="win32"){fi(e,t);return}mi(e,t)},rt=(e,t)=>{const i=Ae(e,t,{encoding:"utf8",timeout:1e4});if(i.error)throw i.error;if(typeof i.status=="number"&&i.status!==0)throw new Error(`${e} exited with code ${String(i.status)}`);return typeof i.stdout=="string"?i.stdout:""},nt=e=>{const t=rt("ps",["-Ao","pid=,command="]),i=[];for(const l of t.split(`
2
+ `)){if(l.length===0)continue;const n=/^\s*(\d+)\s+(.+)$/.exec(l);if(!n)continue;const o=Number.parseInt(n[1]??"",10),c=(n[2]??"").toLowerCase();!Number.isFinite(o)||o===e||(/(?:^|[ /])vis-native(?:\s|$|[-.])/.test(c)||/(?:^|[ /])vis\s+run\b/.test(c)||/(?:^|[ /])task-runner(?:\s|$|[-.])/.test(c))&&i.push(o)}return i},ot=e=>{const t=rt("tasklist",["/FO","CSV","/NH"]),i=[];for(const l of t.split(/\r?\n/)){if(l.length===0)continue;const n=l.split(/","/).map(h=>h.replaceAll(/^"|"$/g,"")),o=(n[0]??"").toLowerCase(),c=Number.parseInt(n[1]??"",10);!Number.isFinite(c)||c===e||(o==="vis.exe"||o.startsWith("vis-native")||o.includes("task-runner"))&&i.push(c)}return i},yi=()=>{let e;try{const t=Ae("watchman",["--version"],{encoding:"utf8",timeout:2e3});if(t.error||typeof t.status=="number"&&t.status!==0)throw t.error??new Error("watchman exited non-zero");e=typeof t.stdout=="string"?t.stdout.trim():void 0}catch{return{id:"watchman",message:"Watchman not found — `vis` uses native fs.watch (fine for small repos). Install Watchman + `fb-watchman` to scale watch mode on large monorepos.",status:"skip"}}return{detail:e?{version:e}:void 0,id:"watchman",message:e?`Watchman available (${e}) — scalable watch backend in use.`:"Watchman available — scalable watch backend in use.",status:"ok"}},wi=(e=process.cwd())=>{let t="";try{t=Ze(W(e,".gitattributes"),"utf8")}catch(i){if(i.code!=="ENOENT")return{id:"git-lfs",message:"Could not read .gitattributes.",status:"warn"}}if(!t.includes("filter=lfs"))return{id:"git-lfs",message:"No Git LFS tracking declared in .gitattributes.",status:"skip"};try{const i=Ae("git",["lfs","version"],{encoding:"utf8",timeout:2e3});if(i.error||typeof i.status=="number"&&i.status!==0)throw i.error??new Error("git-lfs not available")}catch{return{id:"git-lfs",message:"Repo tracks files via Git LFS but `git-lfs` is not installed — checked-out LFS files are pointer stubs, not real content. Install git-lfs and run `git lfs pull`.",status:"warn"}}return{id:"git-lfs",message:"Git LFS tracking declared and `git-lfs` is installed.",status:"ok"}},ki=e=>[ai(),ci(),yi(),wi(e),ui()],ge=[{id:"dependencies",label:"Deps"},{id:"security",label:"Security"},{id:"optimization",label:"Optimize"},{id:"runtime",label:"Runtime"}],Ce=["dependencies","security","optimization","runtime"],he=e=>{const t=new Map;for(const i of Ce)t.set(i,[]);for(const i of e)t.get(i.section).push(i);for(const[i,l]of t)l.length===0&&t.delete(i);return t},pe=(e,t,i,l)=>{let n=e.filter(o=>o.section===t);if(l&&(n=n.filter(o=>o.severity===l)),i){const o=i.toLowerCase();n=n.filter(c=>c.title.toLowerCase().includes(o))}return[...n]},vi=e=>{const t={dependencies:"idle",optimization:"idle",runtime:"idle",security:"idle"};for(const i of Ce)e.has(i)&&(t[i]="idle");return t};class _e{#e;#i=new Set;constructor(t=[]){const i=Array.isArray(t)?{findings:t}:t,l=i.findings??[],n=i.activeSections??new Set(Ce),o=Ce.find(a=>n.has(a))??"dependencies",c=pe(l,o,"",void 0),h=vi(n);if(l.length>0)for(const a of l)h[a.section]="done";this.#e={all:l,entries:c,filterActive:!1,filterText:"",filterType:o,focusedPanel:"list",grouped:he(c),pendingAction:void 0,sectionError:{},sectionMessage:{},sectionStatus:h,selectedIndex:0,severityFilter:void 0}}getSnapshot=()=>this.#e;subscribe=t=>(this.#i.add(t),()=>{this.#i.delete(t)});setSelectedIndex(t){const i=Math.max(0,Math.min(t,this.#e.entries.length-1));i!==this.#e.selectedIndex&&this.#t({...this.#e,selectedIndex:i})}setFocusedPanel(t){t!==this.#e.focusedPanel&&this.#t({...this.#e,focusedPanel:t})}setFilterType(t){if(t===this.#e.filterType)return;const i=pe(this.#e.all,t,this.#e.filterText,this.#e.severityFilter);this.#t({...this.#e,entries:i,filterType:t,grouped:he(i),selectedIndex:0})}setFilter(t){const i=pe(this.#e.all,this.#e.filterType,t,this.#e.severityFilter);this.#t({...this.#e,entries:i,filterText:t,grouped:he(i),selectedIndex:0})}setFilterActive(t){if(t===this.#e.filterActive)return;if(t){this.#t({...this.#e,filterActive:!0});return}const i=pe(this.#e.all,this.#e.filterType,"",this.#e.severityFilter);this.#t({...this.#e,entries:i,filterActive:!1,filterText:"",grouped:he(i),selectedIndex:0})}setPendingAction(t){this.#t({...this.#e,pendingAction:t})}setSeverityFilter(t){if(t===this.#e.severityFilter)return;const i=pe(this.#e.all,this.#e.filterType,this.#e.filterText,t);this.#t({...this.#e,entries:i,grouped:he(i),selectedIndex:0,severityFilter:t})}startSection(t,i){this.#t({...this.#e,sectionMessage:{...this.#e.sectionMessage,[t]:i},sectionStatus:{...this.#e.sectionStatus,[t]:"running"}})}completeSection(t,i){const l=[...this.#e.all,...i],n=pe(l,this.#e.filterType,this.#e.filterText,this.#e.severityFilter),o={...this.#e.sectionMessage};delete o[t],this.#t({...this.#e,all:l,entries:n,grouped:he(n),sectionMessage:o,sectionStatus:{...this.#e.sectionStatus,[t]:"done"}})}failSection(t,i){this.#t({...this.#e,sectionError:{...this.#e.sectionError,[t]:i},sectionStatus:{...this.#e.sectionStatus,[t]:"error"}})}#t(t){this.#e=t;for(const i of this.#i)try{i()}catch{}}}const Ve={error:0,warn:1},bi=e=>!!e.acceptedRisk,lt=e=>{const t=[];if(e.sections.has("dependencies")){for(const i of e.outdated)t.push({entry:i,id:`outdated:${i.packageName}`,kind:"outdated",section:"dependencies",severity:"warn",subtitle:`${i.currentRange} → ${i.newRange} (${i.updateType})`,title:i.packageName});for(const i of e.duplicates)t.push({id:`duplicate:${i.name}`,kind:"duplicate",pkg:i,section:"dependencies",severity:"warn",subtitle:`${String(i.versions.length)} versions installed`,title:i.name})}if(e.sections.has("security"))for(const i of e.outdated){if(i.vulnerabilities&&i.vulnerabilities.length>0){const l=i.vulnerabilities[0],n=bi(i)?"warn":"error",o=i.vulnerabilities.length;t.push({entry:i,id:`vuln:${i.packageName}`,kind:"vulnerability",packageName:i.packageName,section:"security",severity:n,subtitle:o===1?`${l.severity} · ${l.id}`:`${String(o)} advisories · top: ${l.severity} ${l.id}`,title:i.packageName})}if(i.socketReport&&i.socketReport.alerts.length>0){const l=Math.round(i.socketReport.score.overall*100);t.push({entry:i,id:`socket:${i.packageName}`,kind:"socket",packageName:i.packageName,section:"security",severity:"warn",subtitle:`${String(i.socketReport.alerts.length)} alert${i.socketReport.alerts.length===1?"":"s"} · score ${String(l)}%`,title:i.packageName})}}if(e.sections.has("optimization"))for(const i of e.optimizations)t.push({entry:i,id:`opt:${i.packageName}`,kind:"optimization",section:"optimization",severity:"warn",subtitle:`${i.category} → ${i.replacement}`,title:i.packageName});if(e.sections.has("runtime"))for(const i of e.runtime)i.status==="warn"&&t.push({diagnostic:i,id:`runtime:${i.id}`,kind:"runtime",section:"runtime",severity:"warn",title:i.message});return t.sort((i,l)=>{if(i.section!==l.section){const n=["dependencies","security","optimization","runtime"];return n.indexOf(i.section)-n.indexOf(l.section)}return Ve[i.severity]-Ve[l.severity]}),t},at={dependencies:"Dependencies",optimization:"Optimization",runtime:"Runtime",security:"Security"},ji={error:"red",warn:"yellow"},$i={error:"✖",warn:"⚠"},Si={error:" ERROR ",warn:" WARN "},Ci=({children:e,hint:t,message:i,severity:l,title:n})=>{const o=ji[l];return s.jsxs(u,{borderColor:o,borderStyle:"single",flexDirection:"column",flexShrink:0,paddingX:1,children:[s.jsxs(u,{gap:1,children:[s.jsx(r,{backgroundColor:o,bold:!0,color:"black",children:Si[l]}),s.jsx(r,{bold:!0,color:o,children:$i[l]}),s.jsx(r,{bold:!0,wrap:"truncate-end",children:n})]}),s.jsx(r,{wrap:"truncate-end",children:i}),t?s.jsx(r,{dimColor:!0,wrap:"truncate-end",children:t}):null,e]})},Ri={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},Ai={critical:"red",high:"red",low:"gray",medium:"yellow"},Ii={major:"red",minor:"yellow",patch:"green"},C=({children:e,label:t,width:i=14})=>s.jsxs(u,{children:[s.jsx(u,{width:i,children:s.jsxs(r,{dimColor:!0,children:[t,":"]})}),typeof e=="string"?s.jsx(r,{children:e}):e]}),re=({children:e})=>s.jsx(u,{marginTop:1,children:s.jsx(r,{bold:!0,color:"white",children:e})}),Ti=({finding:e})=>{const{entry:t}=e,i=Ii[t.updateType]??"white";return s.jsxs(u,{flexDirection:"column",children:[s.jsx(C,{label:"Current",children:t.currentRange}),s.jsxs(C,{label:"Target",children:[s.jsx(r,{children:t.newRange}),s.jsxs(r,{bold:!0,color:i,children:[" (",t.updateType,")"]})]}),s.jsx(C,{label:"Catalog",children:t.catalogName}),t.acceptedRisk?s.jsx(C,{label:"Risk ack",children:s.jsx(r,{dimColor:!0,children:t.acceptedRisk.reason??"(no reason recorded)"})}):null,s.jsx(re,{children:"Action"}),s.jsxs(r,{dimColor:!0,children:["Run"," ",s.jsx(r,{bold:!0,color:"white",children:"vis update"})," ","to apply this change."]})]})},Ni=({finding:e})=>s.jsxs(u,{flexDirection:"column",children:[s.jsx(C,{label:"Versions",children:s.jsx(r,{children:String(e.pkg.versions.length)})}),s.jsx(re,{children:"Installed versions"}),e.pkg.versions.map(t=>s.jsxs(r,{children:[" · ",t]},t)),s.jsx(re,{children:"Action"}),s.jsxs(r,{dimColor:!0,children:["Run"," ",s.jsx(r,{bold:!0,color:"white",children:"vis dedupe"})," ","to consolidate to a single resolution."]})]}),Mi=({finding:e})=>{const t=e.entry.vulnerabilities??[];return s.jsxs(u,{flexDirection:"column",children:[s.jsx(C,{label:"Package",children:e.packageName}),s.jsx(C,{label:"Current",children:e.entry.currentRange}),s.jsx(C,{label:"Advisories",children:String(t.length)}),e.entry.acceptedRisk?s.jsx(C,{label:"Risk ack",children:s.jsx(r,{dimColor:!0,children:e.entry.acceptedRisk.reason??"(no reason recorded)"})}):null,t.map(i=>{const l=Ri[i.severity]??"gray";return s.jsxs(u,{flexDirection:"column",marginTop:1,children:[s.jsxs(u,{children:[s.jsx(r,{bold:!0,color:l,children:i.severity}),s.jsx(r,{children:" "}),s.jsx(r,{children:i.id}),typeof i.cvssScore=="number"?s.jsxs(r,{dimColor:!0,children:[" · CVSS ",i.cvssScore.toFixed(1)]}):null]}),s.jsx(r,{wrap:"wrap",children:i.summary}),i.fixedVersions.length>0?s.jsxs(r,{dimColor:!0,children:["Fixed in: ",i.fixedVersions.join(", ")]}):null,i.aliases&&i.aliases.length>0?s.jsxs(r,{dimColor:!0,children:["Aliases: ",i.aliases.join(", ")]}):null]},i.id)})]})},Ei=({finding:e})=>{const t=e.entry.socketReport;if(!t)return s.jsx(r,{dimColor:!0,children:"No Socket report attached."});const i=Math.round(t.score.overall*100),l=ze(t.score.overall);return s.jsxs(u,{flexDirection:"column",children:[s.jsx(C,{label:"Package",children:e.packageName}),s.jsx(C,{label:"Overall",children:s.jsxs(r,{color:l,children:[String(i),"%"]})}),s.jsx(C,{label:"Alerts",children:String(t.alerts.length)}),e.entry.acceptedRisk?s.jsx(C,{label:"Risk ack",children:s.jsx(r,{dimColor:!0,children:e.entry.acceptedRisk.reason??"(no reason recorded)"})}):null,s.jsx(re,{children:"Score breakdown"}),Object.entries(t.score).map(([n,o])=>{if(n==="overall")return null;const c=typeof o=="number"?o:0,h=Math.round(c*100),a=ze(c);return s.jsxs(u,{children:[s.jsx(u,{width:14,children:s.jsxs(r,{dimColor:!0,children:[n,":"]})}),s.jsxs(r,{color:a,children:[String(h),"%"]})]},n)}),s.jsx(re,{children:"Alerts"}),t.alerts.map((n,o)=>{const c=Ai[n.severity]??"gray";return s.jsxs(u,{flexDirection:"column",marginBottom:1,children:[s.jsxs(u,{children:[s.jsx(r,{bold:!0,color:c,children:n.severity}),s.jsx(r,{children:" "}),s.jsx(r,{children:n.type})]}),n.props?s.jsx(r,{dimColor:!0,wrap:"wrap",children:JSON.stringify(n.props)}):null]},`${n.type}-${String(o)}`)})]})},Di=({finding:e})=>{const{entry:t}=e;return s.jsxs(u,{flexDirection:"column",children:[s.jsx(C,{label:"Package",children:t.packageName}),s.jsx(C,{label:"Category",children:t.category}),s.jsx(C,{label:"Replacement",children:t.replacement}),t.overrideSpec?s.jsx(C,{label:"Override",children:t.overrideSpec}):null,s.jsx(C,{label:"Codemod",children:s.jsx(r,{color:t.hasCodemod?"green":"gray",children:t.hasCodemod?"available":"not available"})}),t.docUrl?s.jsx(C,{label:"Guide",children:s.jsx(r,{color:"cyan",underline:!0,children:t.docUrl})}):null,s.jsx(re,{children:"Action"}),t.hasCodemod?s.jsxs(r,{dimColor:!0,children:["Run"," ",s.jsx(r,{bold:!0,color:"white",children:"vis optimize"})," ","to apply the codemod interactively."]}):t.overrideSpec?s.jsxs(r,{dimColor:!0,children:["Run"," ",s.jsx(r,{bold:!0,color:"white",children:"vis optimize"})," ","to install the package override."]}):t.docUrl?s.jsx(r,{dimColor:!0,children:"No automated codemod. Open the migration guide above for the recommended alternative and steps."}):s.jsx(r,{dimColor:!0,children:"No automated codemod. Consult the package's docs or the e18e module-replacements guide for an alternative."})]})},Fi=({finding:e})=>{const{diagnostic:t}=e,i=t.status==="warn"?"yellow":t.status==="ok"?"green":"gray";return s.jsxs(u,{flexDirection:"column",children:[s.jsx(C,{label:"Check",children:t.id}),s.jsx(C,{label:"Status",children:s.jsx(r,{color:i,children:t.status})}),s.jsx(re,{children:"Message"}),s.jsx(r,{wrap:"wrap",children:t.message}),t.detail&&Object.keys(t.detail).length>0?s.jsxs(s.Fragment,{children:[s.jsx(re,{children:"Details"}),Object.entries(t.detail).map(([l,n])=>s.jsxs(u,{children:[s.jsx(u,{width:20,children:s.jsxs(r,{dimColor:!0,children:[l,":"]})}),s.jsx(r,{children:String(n)})]},l))]}):null]})},Pi=({finding:e,focused:t,scrollRef:i})=>{const l=t?"white":"gray";if(!e)return s.jsx(u,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:s.jsx(r,{dimColor:!0,children:"No finding selected"})});let n;switch(e.kind){case"duplicate":{n=s.jsx(Ni,{finding:e});break}case"optimization":{n=s.jsx(Di,{finding:e});break}case"outdated":{n=s.jsx(Ti,{finding:e});break}case"runtime":{n=s.jsx(Fi,{finding:e});break}case"socket":{n=s.jsx(Ei,{finding:e});break}case"vulnerability":{n=s.jsx(Mi,{finding:e});break}default:{n=s.jsx(r,{dimColor:!0,children:"Unknown finding kind."});break}}return s.jsxs(u,{borderColor:l,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[s.jsxs(u,{flexShrink:0,paddingTop:1,paddingX:2,children:[s.jsx(r,{bold:!0,color:"white",children:e.title}),s.jsxs(r,{dimColor:!0,children:[" ",at[e.section]]})]}),s.jsxs(wt,{flexGrow:1,flexShrink:1,paddingX:2,ref:i,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:[s.jsx(r,{}),n]})]})},ct={error:"red",warn:"yellow"},zi={error:"✖",warn:"⚠"},Oi=e=>e.kind==="outdated"||e.kind==="vulnerability"||e.kind==="socket"?!!e.entry.acceptedRisk:!1,Bi=({finding:e,isSelected:t})=>{const i=ct[e.severity],l=Oi(e);return s.jsxs(u,{flexShrink:0,height:1,children:[s.jsx(r,{children:t?">":" "}),s.jsxs(r,{color:i,children:[" ",zi[e.severity]," "]}),s.jsx(u,{flexGrow:1,children:s.jsx(r,{bold:t,inverse:t,wrap:"truncate",children:e.title})}),l?s.jsx(r,{color:"cyan",children:" ack"}):null,e.subtitle?s.jsxs(r,{dimColor:!0,wrap:"truncate",children:[" ",e.subtitle]}):null]})},Li=({count:e,section:t})=>s.jsxs(u,{flexShrink:0,height:1,marginTop:1,children:[s.jsx(r,{dimColor:!0,children:"▼ "}),s.jsx(r,{bold:!0,color:"white",children:at[t].toUpperCase()}),s.jsxs(r,{dimColor:!0,children:[" (",e,")"]})]}),_i=({count:e,label:t,status:i})=>s.jsxs(r,{children:[t,i==="running"?s.jsxs(r,{children:[" ",s.jsx(st,{type:"dots"})]}):null,i==="error"?s.jsx(r,{bold:!0,color:"red",children:" ✖"}):s.jsxs(r,{dimColor:!0,children:[" (",String(e),")"]})]}),Vi=({elapsedMs:e,entries:t,filterActive:i,filterText:l,filterType:n,focused:o,fromCache:c=!1,grouped:h,onViewportHeightChange:a,scrollOffset:p,sectionCounts:y,sectionMessage:j,sectionStatus:k,selectedIndex:D,severityFilter:$,totalAll:f,viewportHeight:A})=>{const M=o?"white":"gray",{measuredHeight:F,ref:E}=ei(A,a);let R=0,P=0;for(const b of t)b.severity==="error"?R+=1:b.severity==="warn"&&(P+=1);const Y=[];R>0&&Y.push(`${String(R)} error${R===1?"":"s"}`),P>0&&Y.push(`${String(P)} warn${P===1?"":"s"}`);const Z=Y.length>0?` (${Y.join(", ")})`:"",ee=(e/1e3).toFixed(1),q=[];for(const[b,S]of h){q.push(s.jsx(Li,{count:S.length,section:b},`hdr-${b}`));for(const _ of S){const V=t.indexOf(_);q.push(s.jsx(Bi,{finding:_,isSelected:V===D},_.id))}}let B=0;for(const[,b]of h)B+=2+b.length;const L=B>F&&F>0;return s.jsxs(u,{borderColor:M,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[s.jsxs(u,{flexShrink:0,gap:1,paddingX:1,children:[s.jsx(r,{bold:!0,inverse:!0,children:" DOCTOR "}),s.jsxs(r,{wrap:"truncate",children:[t.length,t.length===f?"":`/${String(f)}`," finding",t.length===1?"":"s",Z]}),$?s.jsx(r,{bold:!0,color:ct[$],inverse:!0,children:` ${$.toUpperCase()} ONLY `}):null,c?s.jsx(r,{bold:!0,color:"cyan",inverse:!0,children:" CACHED "}):null,s.jsxs(r,{dimColor:!0,children:[" · ",ee,"s"]})]}),s.jsx(u,{flexShrink:0,paddingX:1,paddingY:1,children:s.jsx(Qt,{isFocused:o,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:()=>{},showIndex:!1,value:n,children:ge.map(({id:b,label:S})=>s.jsx(Zt,{name:b,children:s.jsx(_i,{count:y[b],label:S,status:k[b]})},b))})}),(()=>{const b=Object.keys(k).filter(S=>k[S]==="running"&&j[S]).map(S=>j[S]);return b.length===0?null:s.jsx(u,{flexShrink:0,paddingX:1,children:s.jsxs(r,{dimColor:!0,wrap:"truncate",children:[s.jsx(st,{type:"dots"})," ",b.join(" · ")]})})})(),i&&s.jsxs(u,{flexShrink:0,paddingX:1,children:[s.jsx(r,{bold:!0,color:"white",children:"/ "}),s.jsx(r,{children:l}),s.jsx(r,{inverse:!0,children:" "})]}),s.jsxs(u,{flexDirection:"row",flexGrow:1,overflow:"hidden",ref:E,children:[s.jsx(u,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:s.jsx(u,{flexDirection:"column",marginTop:-p,children:q.length>0?q:s.jsx(u,{marginTop:1,children:s.jsx(r,{dimColor:!0,children:"No findings match the current filter."})})})}),L&&s.jsx(u,{flexShrink:0,marginLeft:1,marginRight:1,children:s.jsx(kt,{contentHeight:B,placement:"inset",scrollOffset:p,style:"block",viewportHeight:F})})]},`list-${n}-${l}`)]})},Gi=e=>{if(e.kind==="outdated")return{command:`vis update ${e.entry.packageName}`,description:`Update ${e.entry.packageName} to ${e.entry.newRange}`};if(e.kind==="duplicate")return{command:`vis dedupe ${e.pkg.name}`,description:`Dedupe ${e.pkg.name} (${String(e.pkg.versions.length)} versions)`}},Ui=e=>{if(e.kind==="optimization")return{command:`vis optimize ${e.entry.packageName}`,description:`Replace ${e.entry.packageName} with ${e.entry.replacement}`}},Hi=e=>{if(e.kind!=="outdated"&&e.kind!=="vulnerability"&&e.kind!=="socket")return;const t=e.kind==="outdated"?e.entry.packageName:e.packageName,i=["// Add to vis.config.ts:","security: {"," acceptedRisks: {",` "${t}": {`,' reason: "explain why this risk is acceptable",',' expiresAt: "YYYY-MM-DD",'," },"," },","},"].join(`
3
+ `);return{command:i,configSnippet:i,description:`Acknowledge risk for ${t}`}},Yi=100,qi=40,Wi=10,Ki=({autoExitSeconds:e=0,banner:t,fromCache:i=!1,startedAt:l,store:n})=>{const{exit:o}=vt(),{columns:c,rows:h}=bt(),a=O.useSyncExternalStore(n.subscribe,n.getSnapshot),[p,y]=O.useState(!1),[j,k]=O.useState(!1),[D,$]=O.useState(0),[f,A]=O.useState(()=>Date.now());O.useEffect(()=>{const x=setInterval(()=>{A(Date.now())},1e3);return()=>{clearInterval(x)}},[]);const M=f-l,F=O.useRef(null),E=O.useRef(null),R=a.entries[a.selectedIndex]??null,P=O.useMemo(()=>{const x={dependencies:0,optimization:0,runtime:0,security:0};for(const m of a.all)x[m.section]+=1;return x},[a.all]),Y=t?t.hint?5:4:0,Z=O.useMemo(()=>{for(const x of Object.keys(a.sectionStatus))if(a.sectionStatus[x]==="running"&&a.sectionMessage[x])return 1;return 0},[a.sectionStatus,a.sectionMessage]),ee=c>=Yi,q=ee?Math.max(1,h-Y-2):Math.floor(h*.55),B=Math.max(1,q-6-Z-(a.filterActive?1:0)),[L,b]=O.useState(B),S=L>0?L:B,_=O.useMemo(()=>{let x=0;for(const[,m]of a.grouped)x+=2+m.length;return x},[a.grouped]),V=Math.max(0,_-S),G=Math.min(D,V),ne=O.useCallback(x=>{let m=0,w=0;for(const[,xe]of a.grouped){m+=2;for(let oe=0;oe<xe.length;oe++){if(w===x)return m;m+=1,w+=1}}return m},[a.grouped]),Q=O.useCallback(x=>{const m=ne(x);$(w=>m>w+S-2?Math.min(V,Math.max(0,m-S+2)):m<w+1?Math.max(0,m-1):w)},[ne,S,V]);if(O.useEffect(()=>{E.current?.scrollToTop()},[R?.id]),jt((x,m)=>{if(x==="c"&&m.ctrl){o();return}if(!j){if(p){m.escape||x==="?"?y(!1):x==="q"?(y(!1),k(!0)):m.downArrow||x==="j"?F.current?.scrollBy(1):(m.upArrow||x==="k")&&F.current?.scrollBy(-1);return}if(x==="?"){y(!0);return}if(x==="q"){k(!0);return}if(m.tab){n.setFocusedPanel(a.focusedPanel==="list"?"detail":"list");return}if(a.filterActive){if(m.escape||m.return){n.setFilterActive(!1);return}if(m.backspace){$(0),n.setFilter(a.filterText.slice(0,-1));return}x&&!m.ctrl&&!m.meta&&($(0),n.setFilter(a.filterText+x));return}if(a.focusedPanel==="list"&&(m.leftArrow||m.rightArrow)){const w=ge.findIndex(oe=>oe.id===a.filterType),xe=m.rightArrow?(w+1)%ge.length:(w-1+ge.length)%ge.length;$(0),E.current?.scrollToTop(),n.setFilterType(ge[xe].id);return}if(a.focusedPanel==="list"){if(m.downArrow||x==="j"){const w=Math.min(a.selectedIndex+1,a.entries.length-1);n.setSelectedIndex(w),Q(w);return}if(m.upArrow||x==="k"){const w=Math.max(a.selectedIndex-1,0);n.setSelectedIndex(w),Q(w);return}if(m.pageDown){const w=Math.min(a.selectedIndex+10,a.entries.length-1);n.setSelectedIndex(w),Q(w);return}if(m.pageUp){const w=Math.max(a.selectedIndex-10,0);n.setSelectedIndex(w),Q(w);return}if(m.home){n.setSelectedIndex(0),$(0);return}if(m.end){const w=a.entries.length-1;n.setSelectedIndex(w),Q(w);return}if(x==="/"){n.setFilterActive(!0);return}if(x==="e"){n.setSeverityFilter(a.severityFilter==="error"?void 0:"error"),$(0);return}if(x==="w"){n.setSeverityFilter(a.severityFilter==="warn"?void 0:"warn"),$(0);return}if(x==="u"&&R){const w=Gi(R);w&&(n.setPendingAction(w),o());return}if(x==="o"&&R){const w=Ui(R);w&&(n.setPendingAction(w),o());return}if(x==="a"&&R){const w=Hi(R);w&&(n.setPendingAction(w),o());return}if(x==="d"){n.setFocusedPanel("detail");return}return}if(m.escape||m.leftArrow){n.setFocusedPanel("list");return}if(m.downArrow||x==="j"){E.current?.scrollBy(1);return}if(m.upArrow||x==="k"){E.current?.scrollBy(-1);return}if(m.pageDown){E.current?.scrollBy(10);return}if(m.pageUp){E.current?.scrollBy(-10);return}if(m.home){E.current?.scrollToTop();return}m.end&&E.current?.scrollToBottom()}},{isActive:!0}),c<qi||h<Wi)return s.jsx(u,{alignItems:"center",height:h,justifyContent:"center",width:c,children:s.jsxs(r,{color:"yellow",children:["Terminal too small (",c,"x",h,")"]})});const z=a.focusedPanel==="detail",U=[s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"q"}),s.jsx(r,{dimColor:!0,children:"QUIT"})]},"q"),s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"?"}),s.jsx(r,{dimColor:!0,children:"HELP"})]},"?"),s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"↑↓"}),s.jsx(r,{dimColor:!0,children:z?"SCROLL":"NAV"})]},"nav"),z?s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"←/Esc"}),s.jsx(r,{dimColor:!0,children:"LIST"})]},"lr"):s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"←→"}),s.jsx(r,{dimColor:!0,children:"SECTION"})]},"lr"),s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"/"}),s.jsx(r,{dimColor:!0,children:"SEARCH"})]},"search"),s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"e/w"}),s.jsx(r,{dimColor:!0,children:"SEVERITY"})]},"sev"),s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"u/o/a"}),s.jsx(r,{dimColor:!0,children:"ACTION"})]},"actions"),s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"Tab"}),s.jsx(r,{dimColor:!0,children:"PANEL"})]},"tab")],te=s.jsx(u,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:s.jsx(u,{gap:2,overflow:"hidden",paddingX:1,children:U})}),ce=s.jsxs($t,{footer:s.jsxs(r,{dimColor:!0,children:[s.jsx(r,{bold:!0,color:"white",children:"↑↓"})," scroll ",s.jsx(r,{bold:!0,color:"white",children:"?"}),"/",s.jsx(r,{bold:!0,color:"white",children:"Esc"})," close"]}),scrollRef:F,title:"DOCTOR — KEYBOARD SHORTCUTS",visible:p,width:56,children:[s.jsxs(u,{flexDirection:"column",marginBottom:1,children:[s.jsxs(u,{marginBottom:1,children:[s.jsx(r,{dimColor:!0,children:"── "}),s.jsx(r,{bold:!0,color:"white",children:"NAVIGATION"})]}),s.jsxs(u,{children:[s.jsx(u,{width:26,children:s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" ↑/k "}),s.jsx(r,{dimColor:!0,children:"Move up"})]})}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" ↓/j "}),s.jsx(r,{dimColor:!0,children:"Move down"})]})]}),s.jsxs(u,{children:[s.jsx(u,{width:26,children:s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" PgUp"}),s.jsx(r,{dimColor:!0,children:" Jump up 10"})]})}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" PgDn"}),s.jsx(r,{dimColor:!0,children:" Jump down 10"})]})]}),s.jsxs(u,{children:[s.jsx(u,{width:26,children:s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" Home"}),s.jsx(r,{dimColor:!0,children:" Jump to top"})]})}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" End"}),s.jsx(r,{dimColor:!0,children:" Jump to bottom"})]})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" Tab"}),s.jsx(r,{dimColor:!0,children:" Switch panel"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" →/←"}),s.jsx(r,{dimColor:!0,children:" Section tabs (list) / Focus list (detail)"})]})]}),s.jsxs(u,{flexDirection:"column",marginBottom:1,children:[s.jsxs(u,{marginBottom:1,children:[s.jsx(r,{dimColor:!0,children:"── "}),s.jsx(r,{bold:!0,color:"white",children:"FILTER"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" /"}),s.jsx(r,{dimColor:!0,children:" Open text filter (Esc/Enter to close)"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" e"}),s.jsx(r,{dimColor:!0,children:" Toggle errors-only filter"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" w"}),s.jsx(r,{dimColor:!0,children:" Toggle warns-only filter"})]})]}),s.jsxs(u,{flexDirection:"column",marginBottom:1,children:[s.jsxs(u,{marginBottom:1,children:[s.jsx(r,{dimColor:!0,children:"── "}),s.jsx(r,{bold:!0,color:"white",children:"ACTIONS"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" u"}),s.jsx(r,{dimColor:!0,children:" Exit + suggest update / dedupe command"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" o"}),s.jsx(r,{dimColor:!0,children:" Exit + suggest optimize command"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" a"}),s.jsx(r,{dimColor:!0,children:" Exit + print risk-ack snippet"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" d"}),s.jsx(r,{dimColor:!0,children:" Focus detail panel"})]})]}),s.jsxs(u,{flexDirection:"column",children:[s.jsxs(u,{marginBottom:1,children:[s.jsx(r,{dimColor:!0,children:"── "}),s.jsx(r,{bold:!0,color:"white",children:"EXIT"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" q"}),s.jsx(r,{dimColor:!0,children:" Quit (with countdown)"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" Ctrl+C"}),s.jsx(r,{dimColor:!0,children:" Quit immediately"})]})]})]}),de=s.jsx(Vi,{elapsedMs:M,entries:a.entries,filterActive:a.filterActive,filterText:a.filterText,filterType:a.filterType,focused:a.focusedPanel==="list",fromCache:i,grouped:a.grouped,onViewportHeightChange:b,scrollOffset:G,sectionCounts:P,sectionMessage:a.sectionMessage,sectionStatus:a.sectionStatus,selectedIndex:a.selectedIndex,severityFilter:a.severityFilter,totalAll:a.all.length,viewportHeight:S}),ue=t?s.jsx(Ci,{hint:t.hint,message:t.message,severity:t.severity,title:t.title}):null,me=s.jsx(Pi,{finding:R,focused:a.focusedPanel==="detail",scrollRef:E});if(ee){const x=Math.floor(c*.4);return s.jsxs(u,{flexDirection:"column",height:h,width:c,children:[ue,s.jsxs(u,{flexDirection:"row",flexGrow:1,children:[s.jsx(u,{flexGrow:1,children:de}),s.jsx(u,{width:x,children:me})]}),te,s.jsx(Pe,{autoExitSeconds:e||3,onCancel:()=>{k(!1)},visible:j}),ce]})}return s.jsxs(u,{flexDirection:"column",height:h,width:c,children:[ue,s.jsx(u,{height:q,children:de}),s.jsx(u,{flexGrow:1,children:me}),te,s.jsx(Pe,{autoExitSeconds:e||3,onCancel:()=>{k(!1)},visible:j}),ce]})},Xi=e=>e.replaceAll(/[$()+.?[\\\]^{|}]/g,String.raw`\$&`),Ji=e=>{const t=e.split("*").map(i=>Xi(i));return new RegExp(`^${t.join(".*")}$`,"i")},Qi=e=>e?e.split(",").map(t=>t.trim()).filter(t=>t.length>0).map(t=>Ji(t)):[],Se=(e,t)=>{for(const i of t)if(i.test(e))return!0;return!1},Zi=(e,t,i)=>{if(t.length===0)return e;const l=e.outdated.filter(p=>Se(p.packageName,t)),n=e.duplicates.filter(p=>Se(p.name,t)),o=e.optimizations.filter(p=>Se(p.packageName,t));let c=0,h=0,a=0;for(const p of l)p.vulnerabilities&&(c+=p.vulnerabilities.length),p.socketReport&&(h+=p.socketReport.alerts.length,p.socketReport.score.overall<i&&(a+=1));return{...e,duplicates:n,optimizations:o,outdated:l,socketIssues:{alerts:h,lowScore:a},vulnCount:c}},dt=(e,t)=>t.length===0?[...e]:e.filter(i=>{if(i.kind==="runtime")return!0;const l=i.kind==="duplicate"?i.pkg.name:i.kind==="outdated"||i.kind==="optimization"?i.entry.packageName:i.packageName;return Se(l,t)}),ut=["dependencies","security","optimization","runtime"],Ge=e=>{const t=new Set;if(!e)return t;for(const i of e.split(",")){const l=i.trim().toLowerCase();ut.includes(l)&&t.add(l)}return t},es=(e,t)=>{if(e!==void 0&&e!=="")return Ge(e);const i=Ge(t);return new Set(ut.filter(l=>!i.has(l)))},ht=e=>{const t={micro:0,native:0,preferred:0,socket:0,total:e.length};for(const i of e)switch(i.category){case"micro-utility":{t.micro+=1;break}case"native":{t.native+=1;break}case"preferred":{t.preferred+=1;break}case"socket":{t.socket+=1;break}}return t},se=(e,t)=>{if(!e.sections.has(t))return"skip";switch(t){case"dependencies":return e.outdated.length>0||e.duplicates.length>0?"warn":"ok";case"optimization":return e.optimizations.length>0?"warn":"ok";case"runtime":return e.runtime.some(i=>i.status==="warn")?"warn":"ok";case"security":return e.vulnCount>0||e.socketIssues.alerts>0?"error":e.socketIssues.lowScore>0?"warn":"ok";default:return"ok"}},ts=(e,t)=>{const i=ht(e.optimizations),l={dependencies:se(e,"dependencies"),optimization:se(e,"optimization"),runtime:se(e,"runtime"),security:se(e,"security")},n=new Set([...Object.values(l),e.supplyChain.status]),o=n.has("error")?"error":n.has("warn")?"warn":"ok";return{dependencies:{duplicates:e.duplicates.length,installed:e.installedCount,outdated:e.outdated.length,status:l.dependencies},elapsedMs:e.elapsedMs,optimizations:{microUtilities:i.micro,native:i.native,preferred:i.preferred,socket:i.socket,status:l.optimization,total:i.total},packageManager:t,runtime:e.runtime.map(c=>({detail:c.detail,id:c.id,message:c.message,status:c.status})),runtimeStatus:l.runtime,security:{alerts:e.socketIssues.alerts,lowScorePackages:e.socketIssues.lowScore,status:l.security,vulnerabilities:e.vulnCount},status:o,supplyChain:{findings:e.supplyChain.findings.map(c=>({detail:c.detail,label:c.label,severity:c.severity})),status:e.supplyChain.status},workspaces:e.workspaceCount}},Ue=(e,t)=>{const i=e.runtime.some(n=>n.status==="warn"),l=e.vulnCount>0||e.socketIssues.alerts>0;return t?l||e.outdated.length>0||e.duplicates.length>0||i:l},is=["aube-workspace.yaml","pnpm-workspace.yaml"],we=e=>typeof e=="boolean"?e:void 0,ss=e=>{if(e==="no-downgrade"||e==="off")return e},rs=e=>{const t={allowBuildsCount:0,blockExoticSubdeps:void 0,jailBuilds:void 0,minimumReleaseAge:void 0,minimumReleaseAgeStrict:void 0,paranoid:void 0,source:void 0,strictDepBuilds:void 0,trustPolicy:void 0};for(const i of is){const l=W(e,i);if(!be(l))continue;let n;try{n=At(Ct(l))}catch{continue}if(typeof n!="object"||n===null)continue;const o=n;return t.source=i,t.paranoid=we(o.paranoid),t.trustPolicy=ss(o.trustPolicy),t.blockExoticSubdeps=we(o.blockExoticSubdeps),t.jailBuilds=we(o.jailBuilds),t.strictDepBuilds=we(o.strictDepBuilds),t.minimumReleaseAgeStrict=we(o.minimumReleaseAgeStrict),typeof o.minimumReleaseAge=="number"&&Number.isFinite(o.minimumReleaseAge)&&(t.minimumReleaseAge=o.minimumReleaseAge),o.allowBuilds&&typeof o.allowBuilds=="object"&&!Array.isArray(o.allowBuilds)&&(t.allowBuildsCount=Object.keys(o.allowBuilds).length),t}return t},ns=e=>e.paranoid?{...e,jailBuilds:!0,minimumReleaseAgeStrict:!0,strictDepBuilds:!0,trustPolicy:"no-downgrade"}:e,os=/^(@[\w./-]+\/[\w./-]+|[\w.-]+)@(.+)$/,ls=e=>{const t=os.exec(e);if(t)return{name:t[1],version:t[2]}},as=(e,t)=>{let i;try{if(t==="pnpm"){const n=W(e,"pnpm-workspace.yaml");be(n)&&(i=ti(n)?.patchedDependencies)}else if(t==="bun"){const n=W(e,"package.json");be(n)&&(i=et(n)?.patchedDependencies)}}catch{return[]}if(!i||typeof i!="object")return[];const l=[];for(const[n,o]of Object.entries(i)){if(typeof o!="string"||o.length===0)continue;const c=ls(n);c&&l.push({name:c.name,patchFile:o,resolvedPatchFile:Rt(o)?o:Ke(e,o),version:c.version})}return l},cs=e=>{const t=[];for(const i of e)be(i.resolvedPatchFile)||t.push({entry:i,kind:"missing-file"});return t},He=e=>e.some(t=>t.severity==="error")?"error":e.some(t=>t.severity==="warn")?"warn":"ok",ds=(e,t={})=>{const i=[],l=e?.security;if(!l)return i.push({detail:"Use defineConfig() from '@visulima/vis/config' to apply secure defaults.",label:"No security config — running with the PM's native defaults",severity:"warn"}),{findings:i,status:He(i)};const n=l.policies?.firstSeen?.minutes,o=l.policies?.publisherChange,c=l.policies?.installScripts;n===void 0?i.push({detail:"Set security.policies.firstSeen.minutes to block packages published in the last N minutes (mitigates supply-chain attacks).",label:"policies.firstSeen.minutes is not set",severity:"warn"}):n===0?i.push({detail:"New packages can be installed immediately after publishing. Consider setting a non-zero cooldown.",label:"policies.firstSeen.minutes is explicitly 0",severity:"warn"}):i.push({label:`policies.firstSeen.minutes: ${String(n)} minutes`,severity:"ok"}),o?.mode===void 0||o.mode==="off"?i.push({detail:"Packages whose trust level has decreased will not be blocked. Consider 'no-downgrade'.",label:`policies.publisherChange.mode: ${o?.mode??"not set"}`,severity:"warn"}):i.push({label:`policies.publisherChange.mode: ${o.mode}`,severity:"ok"}),l.blockExoticSubdeps===void 0||!l.blockExoticSubdeps?i.push({detail:"Transitive dependencies can pull code from git repos or tarball URLs. Set to true to block.",label:`blockExoticSubdeps: ${String(l.blockExoticSubdeps??!1)}`,severity:"warn"}):i.push({label:"blockExoticSubdeps: true",severity:"ok"});const h=c?.allow?Object.keys(c.allow).length:0;if(h===0?i.push({detail:"Lifecycle scripts are blocked by default. List trusted packages here to opt them back in (e.g. esbuild, @prisma/client).",label:"policies.installScripts.allow: not configured",severity:"warn"}):i.push({label:`policies.installScripts.allow: ${String(h)} ${h===1?"entry":"entries"}`,severity:"ok"}),c?.strict&&h===0&&i.push({detail:"All dependencies with build scripts will be blocked. Run 'vis approve-builds' to populate the allow list.",label:"policies.installScripts.strict is on but allow is empty",severity:"error"}),t.workspaceRoot){const a=ii(t.workspaceRoot);if(a.length>0){const p=[...new Set(a.map(y=>y.tool))].sort((y,j)=>y.localeCompare(j)).join(", ");i.push({detail:"Run `vis migrate verify` for the full list, then re-run `vis migrate <tool>` to clean up.",label:`${String(a.length)} leftover ${a.length===1?"reference":"references"} to ${p}`,severity:"warn"})}}if(t.workspaceRoot&&t.packageManager==="aube"){const a=rs(t.workspaceRoot),p=ns(a),y=p.source?` (from ${p.source})`:"";p.paranoid===!0&&i.push({detail:"Forces jailBuilds, trustPolicy=no-downgrade, minimumReleaseAgeStrict, strictStoreIntegrity, and strictDepBuilds on.",label:`aube paranoid: true${y}`,severity:"ok"}),p.trustPolicy==="off"&&i.push({detail:"Trust downgrades between releases will not be blocked. Set trustPolicy: no-downgrade in aube-workspace.yaml.",label:`aube trustPolicy: off${y}`,severity:"warn"}),p.blockExoticSubdeps===!1&&i.push({detail:"Transitive deps from git+, file:, and tarball URLs will not be blocked. Re-enable with blockExoticSubdeps: true.",label:`aube blockExoticSubdeps: false${y}`,severity:"warn"}),p.minimumReleaseAge===0&&i.push({detail:"Newly published versions are not held in a cooling window. Restore with minimumReleaseAge: 1440 (24h) or higher.",label:`aube minimumReleaseAge: 0${y}`,severity:"warn"}),p.jailBuilds===!0&&i.push({label:`aube jailBuilds: true${y}`,severity:"ok"}),p.strictDepBuilds===!0&&i.push({label:`aube strictDepBuilds: true${y}`,severity:"ok"}),p.allowBuildsCount>0&&i.push({label:`aube allowBuilds: ${String(p.allowBuildsCount)} ${p.allowBuildsCount===1?"entry":"entries"}${y}`,severity:"ok"})}if(t.workspaceRoot&&t.packageManager){const a=as(t.workspaceRoot,t.packageManager);if(a.length>0){const p=cs(a);if(p.length===0)i.push({label:`patchedDependencies: ${String(a.length)} ${a.length===1?"entry":"entries"} resolved`,severity:"ok"});else for(const y of p)i.push({detail:`Referenced from ${t.packageManager==="pnpm"?"pnpm-workspace.yaml":"package.json"} but the file is not present at ${y.entry.patchFile}.`,label:`patchedDependencies: missing patch file for ${y.entry.name}@${y.entry.version}`,severity:"error"})}}return{findings:i,status:He(i)}},H=e=>e>=1e3?`${(e/1e3).toFixed(1)}s`:`${String(Math.round(e))}ms`,je=async(e,t,i,l)=>{if(!e)return i();e.start(t);const n=Date.now();try{const o=await i(),c=Date.now()-n,{status:h,summary:a}=l(o,c);return e.finish(t,h,a),o}catch(o){const c=Date.now()-n,h=o instanceof Error?o.message:String(o);throw e.finish(t,"error",`${h} (${H(c)})`),o}},us=(e,t)=>{const i={duplicates:t.duplicates,optimizations:t.optimizations,outdated:t.outdated,runtime:t.runtime,sections:new Set([e])};return lt(i)},Ye=async e=>{const{filterPatterns:t,installed:i,progress:l,resolveCodemods:n,sections:o,store:c,visConfig:h,workspaceRoot:a}=e,p=o.has("dependencies"),y=o.has("security"),j=o.has("optimization"),k=o.has("runtime"),D=(g,I)=>dt(us(g,I),t),$=it(a),{packageManager:f}=We(a),A=Be(W(a,"package.json"),!1),M=tt(a),F=new Set(A);for(const g of M){const I=Be(W(Ke(a,g),"package.json"),!1);for(const T of I)F.add(T)}const E=Nt(a),R=Xe(a,f),P=Je(h?.security,{minimumScore:h?.security?.policies?.score?.minimum}),Y=h?.security?.policies?.score?.minimum??Qe,Z=h?.security?.acceptedRisks,ee=Lt(a,$.name),q={exclude:[],ignore:[],include:[],includeLocked:!1,includePrerelease:!1,security:!0,target:"latest"},B=p?Jt(a,$.name):[],L=j?_t(F):[],b=j?Vt(F,ee,$,!1):[],S=new Set(L.map(g=>g.packageName)),_=b.filter(g=>!S.has(g.packageName)),V=[...L,..._],G=k?ki(a):[];c&&(p&&c.startSection("dependencies",R.size>0?"checking outdated catalog dependencies":"scanning duplicates"),y&&c.startSection("security",i.length>0?`scanning ${String(i.length)} packages for advisories`:"no installed packages to scan"),j&&c.startSection("optimization","matching e18e + socket overrides"),k&&c.startSection("runtime","running runtime diagnostics")),c&&k&&c.completeSection("runtime",D("runtime",{duplicates:[],optimizations:[],outdated:[],runtime:G}));const ne=(p||y)&&R.size>0?je(l,"outdated",()=>Mt(R,q,E,void 0,a,P,Z),(g,I)=>{const T=g.outdated.length;return{status:T>0?"warn":"ok",summary:T>0?`${String(T)} outdated · ${H(I)}`:`up to date · ${H(I)}`}}):Promise.resolve({failed:[],ignored:[],outdated:[]}),Q=y&&i.length>0?je(l,"vulnerabilities",()=>Et(i.map(g=>({name:g.name,version:g.version}))),(g,I)=>{let T=0;for(const ie of g.values())T+=ie.length;return{status:T>0?"error":"ok",summary:T>0?`${String(T)} found · ${H(I)}`:`none found · ${H(I)}`}}):Promise.resolve(new Map),z=y&&P.length>0&&i.length>0?je(l,"socket",()=>Dt(P,i.map(g=>({name:g.name,version:g.version}))),(g,I)=>{let T=0,ie=0;for(const Fe of g.values())T+=Fe.alerts.length,Fe.score.overall<Y&&(ie+=1);const De=T+ie;return{status:De>0?"warn":"ok",summary:De>0?`${String(T)} alert${T===1?"":"s"}, ${String(ie)} low-score · ${H(I)}`:`clean · ${H(I)}`}}):Promise.resolve(new Map);let U,te,ce,de;const ue=ne.catch(g=>(U=g instanceof Error?g.message:String(g),c||d.warn(`Outdated scan failed: ${U}`),{failed:[],ignored:[],outdated:[]})),me=Q.catch(g=>(te=g instanceof Error?g.message:String(g),c||d.warn(`Vulnerability scan failed: ${te}`),new Map)),x=z.catch(g=>(ce=g instanceof Error?g.message:String(g),c||d.warn(`Socket scan failed: ${ce}`),new Map)),m=c&&p?ue.then(g=>{if(U){c.failSection("dependencies",U);return}c.completeSection("dependencies",D("dependencies",{duplicates:B,optimizations:[],outdated:g.outdated,runtime:[]}))}):void 0,w=c&&y?Promise.all([ue,me,x]).then(([g])=>{const I=U??te??ce;if(I){c.failSection("security",I);return}c.completeSection("security",D("security",{duplicates:[],optimizations:[],outdated:g.outdated,runtime:[]}))}):void 0,xe=(async()=>{if(n&&j&&V.length>0&&await je(l,"codemods",async()=>(await Ht(V),V),(g,I)=>{const T=g.filter(ie=>ie.hasCodemod||ie.category==="socket").length;return{status:"ok",summary:`${String(T)} auto-fixable · ${H(I)}`}}).catch(g=>{de=g instanceof Error?g.message:String(g)}),c&&j){if(de){c.failSection("optimization",de);return}c.completeSection("optimization",D("optimization",{duplicates:[],optimizations:V,outdated:[],runtime:[]}))}})(),[oe,gt,ft]=await Promise.all([ue,me,x]);await Promise.all([m,w,xe]);let Me=0,Ee=0;if(y&&P.length>0)for(const g of ft.values())Me+=g.alerts.length,g.score.overall<Y&&(Ee+=1);let Ie=0;if(y){for(const g of oe.outdated)g.vulnerabilities&&g.vulnerabilities.length>0&&(Ie+=g.vulnerabilities.length);for(const g of gt.values())Ie+=g.length}return{duplicates:B,installedCount:i.length,optimizations:j?V:[],outdated:p?oe.outdated:[],runtime:G,sections:o,socketIssues:{alerts:Me,lowScore:Ee},supplyChain:ds(h,{packageManager:f,workspaceRoot:a}),vulnCount:Ie,workspaceCount:M.length}},hs=e=>{switch(e){case"error":return ve(N.failure);case"skip":return v(N.dash);case"warn":return Re(N.warning);default:return fe(N.success)}},ae=(e,t)=>{const i=process.stderr.columns??80,l=Math.max(20,Math.min(i-2,60)),n=N.dash.repeat(2),o=`${hs(t)} ${le(e)}`,c=o.replaceAll(/\[[0-9;]*m/g,"").length,h=Math.max(0,l-c-n.length-2);return`${n} ${o} ${v(N.dash.repeat(h))}`},J=e=>` ${fe(N.success)} ${e}`,K=e=>` ${Re(N.warning)} ${e}`,Ne=e=>` ${ve(N.failure)} ${e}`,pt=e=>` ${v(N.dash)} ${v(e)}`,X=(e,t,i)=>{const l=`${le(String(e))} ${v(t)}`;return i?`${l} ${v(`(${i})`)}`:l},ps=e=>{if(e.sections.has("dependencies")){if(d.log(""),d.log(ae("Dependencies",se(e,"dependencies"))),d.log(J(X(e.installedCount,"packages installed"))),e.outdated.length>0){const t=e.outdated.filter(o=>o.updateType==="major").length,i=e.outdated.filter(o=>o.updateType==="minor").length,l=e.outdated.filter(o=>o.updateType==="patch").length,n=[];t>0&&n.push(`${String(t)} major`),i>0&&n.push(`${String(i)} minor`),l>0&&n.push(`${String(l)} patch`),d.log(K(X(e.outdated.length,"outdated",n.join(", "))))}else d.log(J("All dependencies up to date"));e.duplicates.length>0?d.log(K(X(e.duplicates.length,"packages with duplicate versions"))):d.log(J("No duplicate dependencies"))}},gs=e=>{e.sections.has("security")&&(d.log(""),d.log(ae("Security",se(e,"security"))),e.vulnCount>0?d.log(Ne(X(e.vulnCount,`vulnerabilit${e.vulnCount===1?"y":"ies"} found`))):d.log(J("No known vulnerabilities")),e.socketIssues.alerts>0&&d.log(K(X(e.socketIssues.alerts,`Socket.dev security alert${e.socketIssues.alerts===1?"":"s"}`))),e.socketIssues.lowScore>0&&d.log(K(X(e.socketIssues.lowScore,`package${e.socketIssues.lowScore===1?"":"s"} with low security score`))),e.socketIssues.alerts===0&&e.socketIssues.lowScore===0&&e.vulnCount===0&&d.log(J("No security issues detected")))},fs=e=>{if(!e.sections.has("optimization"))return;d.log(""),d.log(ae("Optimization",se(e,"optimization")));const t=ht(e.optimizations);if(t.total===0){d.log(J("No optimizations available"));return}t.native>0&&d.log(K(X(t.native,"replaceable with native APIs"))),t.preferred>0&&d.log(K(X(t.preferred,"with lighter alternatives"))),t.micro>0&&d.log(K(X(t.micro,"trivial micro-utilities"))),t.socket>0&&d.log(K(X(t.socket,"@socketregistry overrides available")))},ms=e=>{d.log(""),d.log(ae("Supply Chain",e.supplyChain.status));for(const t of e.supplyChain.findings){const i=t.severity==="ok"?J(t.label):t.severity==="error"?Ne(t.label):K(t.label);d.log(i),t.detail&&d.log(` ${v(N.arrow)} ${v(t.detail)}`)}e.supplyChain.status!=="ok"&&d.log(` ${v(N.arrow)} ${v("Configure with security.* in vis.config.ts. See `vis check --security-config` for details.")}`)},xs=e=>{if(e.sections.has("runtime")){d.log(""),d.log(ae("Runtime",se(e,"runtime")));for(const t of e.runtime)t.status==="ok"?d.log(J(t.message)):t.status==="skip"?d.log(pt(t.message)):d.log(K(t.message))}},ys=(e,t)=>{const i=e.vulnCount,l=e.runtime.filter(o=>o.status==="warn").length,n=e.outdated.length+e.duplicates.length+e.optimizations.length+l;if(t){if(i===0&&n===0)d.success(`Everything looks good! ${v(`(${H(e.elapsedMs)})`)}`);else{const o=[];i>0&&o.push(ve(`${String(i)} security`)),n>0&&o.push(Re(`${String(n)} improvement${n===1?"":"s"}`)),d.log(`${ve(N.failure)} ${o.join(", ")} ${v(`(${H(e.elapsedMs)})`)}`)}return}d.log(""),d.log(ae("Summary","ok")),i===0&&n===0?d.success(`Everything looks good! ${v(`(${H(e.elapsedMs)})`)}`):(i>0&&d.error(`${String(i)} security issue${i===1?"":"s"}`),n>0&&d.log(` ${ke(N.arrow)} ${le(String(n))} ${v(`improvement${n===1?"":"s"} available`)} ${v(`(${H(e.elapsedMs)})`)}`))},ws=e=>{const t=[];if(e.outdated.length>0&&t.push("vis update — update outdated dependencies"),(e.vulnCount>0||e.socketIssues.alerts>0)&&t.push("vis audit — detailed security analysis"),e.optimizations.length>0&&t.push("vis optimize — apply optimizations interactively"),e.duplicates.length>0&&t.push("vis dedupe — reduce duplicate versions"),t.length>0){d.log(""),d.log(le("Next steps:"));for(const i of t)d.log(` ${v(N.arrow)} ${i}`)}d.log("")},ks=(e,t)=>{t||(ps(e),gs(e),fs(e),xs(e),ms(e)),ys(e,t)},vs=(e,t,i,l,n)=>{const o=[],c=e.has("dependencies"),h=e.has("security"),a=e.has("optimization");return(c||h)&&t>0&&o.push({id:"outdated",label:"Outdated catalog dependencies"}),h&&l>0&&o.push({id:"vulnerabilities",label:"Known vulnerabilities (OSV)"}),h&&i&&l>0&&o.push({id:"socket",label:"Socket.dev supply-chain reports"}),a&&n&&o.push({id:"codemods",label:"Codemod availability"}),o},bs=e=>{if(d.log(""),d.log(`${le(ke("vis doctor"))} ${v("— project health check")}`),d.log(J(`Detected ${e.packageManagerName} v${e.packageManagerVersion}`)),e.runtimeFindings.length===0)d.log(J(`Node.js ${e.nodeVersion}`));else{for(const t of e.runtimeFindings){const i=t.severity==="error"?ve:Re;d.log(Ne(`Runtime: ${i(t.message)}`))}d.log(` ${v(N.arrow)} Run ${fe("vis toolchain install")} to install pinned versions, or ${fe("vis toolchain status")} for the per-tool breakdown.`)}d.log("")},Us=async({fs:e,logger:t,options:i,visConfig:l,visConfigError:n,workspaceRoot:o})=>{if(!o)throw new Error("Could not determine workspace root.");const c=i.format==="json"||i.json===!0,h=es(i.only,i.skip),a=!!i.quiet,p=i.progress===!1,y=Qi(i.filter);if(h.size===0){d.error("No sections selected. Check your --only / --skip values."),process.exitCode=2;return}const j=Date.now(),k=it(o),D=qt(o),$=!!process.stdout.isTTY,f=!c&&$&&!Ot&&!a&&!p;!c&&!f&&bs({nodeVersion:process.versions.node,packageManagerName:k.name,packageManagerVersion:k.version,runtimeFindings:D});const A=Xe(o,We(o).packageManager),M=Kt(o,k.name),F=M.length,E=Je(l?.security).length>0,R=l?.security?.policies?.score?.minimum??Qe,P=tt(o);if(!c&&!a&&!f){const z=P.length>0?v(` · ${String(P.length)} workspace package${P.length===1?"":"s"}`):"";d.log(`${v("·")} ${v("Found")} ${le(String(F))} ${v(`installed package${F===1?"":"s"}`)}${z}`)}const Y=n?{hint:n.file?`Continuing with default settings — fix or regenerate ${n.file} (vis init --force).`:"Continuing with default settings.",message:n.message,severity:"error",title:n.file?`Failed to load ${n.file}`:"Failed to load vis.config"}:void 0,Z=Xt(o,k.name)?.file,ee=Z?W(o,Z):void 0,q=Bt(o),B=i.cache!==!1&&!i.fix?ni({configPath:q,lockfilePath:ee,sections:h,socketEnabled:E,workspaceRoot:o}):void 0,L=B?oi(B):void 0,b=L!==void 0;let S,_;if(f){const z=L?new _e({activeSections:h,findings:dt(lt(L),y)}):new _e({activeSections:h}),U=It(Tt.createElement(Ki,{banner:Y,fromCache:b,startedAt:j,store:z}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0});try{S=L??await Ye({filterPatterns:y,installed:M,resolveCodemods:!!i.fix,sections:h,store:z,visConfig:l,workspaceRoot:o})}catch(te){throw U.unmount(),te}await U.waitUntilExit(),_=z.getSnapshot().pendingAction}else if(L)S=L;else{const z=vs(h,A.size,E,F,!!i.fix),U=Wt(z,{live:!c&&!a&&!p});try{S=await Ye({filterPatterns:y,installed:M,progress:U,resolveCodemods:!!i.fix,sections:h,visConfig:l,workspaceRoot:o})}finally{U.stop()}}const V={...S,elapsedMs:Date.now()-j};if(B&&!b)try{li(B,V)}catch{}const G=Zi(V,y,R);if(c){process.stdout.write(`${JSON.stringify(ts(G,k.name),void 0,2)}
4
+ `),i.exitCode&&Ue(G,!!i.strict)&&(process.exitCode=1);return}b&&!a&&d.log(`${v("·")} Cached results (use --no-cache to refresh)`),y.length>0&&!a&&d.log(`${v("·")} Filter active: ${ke(i.filter??"")}`),ks(G,a);const ne=G.runtime.some(z=>z.id===$e&&z.status==="warn"),Q=G.sections.has("optimization")&&G.optimizations.length>0;i.fix&&(Q||ne)?await js({force:!!i.fixForce,fs:e,logger:t,pm:k,recoverOrphans:ne,results:G,useEditorconfig:l?.editorconfig??!0,workspaceRoot:o}):a||ws(G),_&&(process.stdout.write(`
5
+ `),process.stdout.write(`${le("→ ")}${_.description}
6
+ `),_.configSnippet?(process.stdout.write(`
7
+ `),process.stdout.write(`${v(_.configSnippet)}
8
+ `)):process.stdout.write(` ${ke(_.command)}
9
+ `),process.stdout.write(`
10
+ `)),i.exitCode&&Ue(G,!!i.strict)&&(process.exitCode=1)},js=async e=>{const{force:t,fs:i,logger:l,pm:n,recoverOrphans:o,results:c,useEditorconfig:h,workspaceRoot:a}=e;d.log(""),d.log(ae("Applying fixes","ok"));const p=c.optimizations.filter(f=>f.category==="socket"&&f.overrideSpec).map(f=>({original:f.packageName,spec:f.overrideSpec})),y=c.optimizations.filter(f=>f.category!=="socket"&&f.hasCodemod),j=c.optimizations.filter(f=>f.category!=="socket"&&!f.hasCodemod);let k=!1,D=0;const $=[];if(o){const f=hi({force:t});if(f.killed.length>0&&(d.success(`Cleaned up ${String(f.killed.length)} orphaned process${f.killed.length===1?"":"es"} (PIDs: ${f.killed.join(", ")}).`),k=!0),f.failed.length>0){const A=t?"":" Re-run with `--fix --fix-force` to escalate to SIGKILL.";d.warn(`Could not signal ${String(f.failed.length)} orphan${f.failed.length===1?"":"s"}: ${f.failed.map(M=>`${String(M.pid)} (${M.reason})`).join(", ")}.${A}`)}}if(p.length>0){const f=Gt(a,W(a,"package.json"),p,n,h);f.added.length>0&&(d.success(`Added ${String(f.added.length)} security override${f.added.length===1?"":"s"}.`),k=!0),f.updated.length>0&&(d.success(`Updated ${String(f.updated.length)} override${f.updated.length===1?"":"s"}.`),k=!0)}for(const f of y)try{const A=await Ut(i,a,f.packageName);A.filesChanged>0&&(d.success(`${f.packageName}: ${String(A.filesChanged)} file${A.filesChanged===1?"":"s"} updated`),D+=1,k=!0)}catch(A){const M=A instanceof Error?A.message:String(A);$.push({error:M,package:f.packageName}),d.warn(`${f.packageName}: codemod failed — ${M}`)}p.length>0&&(d.log(`${ke(N.arrow)} Running ${n.name} install to update lockfile…`),Yt(n,{dev:!1,filter:[],force:!1,frozenLockfile:!1,ignoreScripts:!1,lockfileOnly:!1,noOptional:!1,offline:!1,prod:!1,recursive:!1,silent:!1,workspaceRoot:!1},a,l),k=!0),d.log(""),k?d.success(`Fixes applied. ${D>0?`${String(D)} codemod${D===1?"":"s"} applied.`:""}`.trim()):d.log(pt("No auto-fixable items in the current run.")),$.length>0&&d.warn(`${String($.length)} codemod${$.length===1?"":"s"} failed (run ${fe("vis optimize")} for the interactive picker).`),j.length>0&&d.notice(`${String(j.length)} optimization${j.length===1?"":"s"} need manual review (no codemod). Run ${fe("vis optimize")} to inspect them.`)};export{Us as default};