@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,23 @@
1
+ import{createRequire as se}from"node:module";import{m as g,f as b,v as A,a as U}from"../packem_shared/index-CE6MsgcV.js";import{a6 as z,a7 as ue,a8 as Y,a9 as E,aa as ge,ab as de,ac as he,ad as me,ae as W,af as pe,ag as Q,ah as X,ai as Z,aj as ee}from"./cli-main.js";import{m as ke}from"./ts-loader.js";import{E as $e}from"../packem_shared/public-api-WqUCiyIe.js";import{v as ye}from"./catalog.js";import{allKnownTags as ve,tagsFromPaths as be,NATIVE_BINDING_VERSION as P}from"#native";const ie=se(import.meta.url),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,N=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[o,t]=_.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return _.getBuiltinModule(e)}return ie(e)},{readdirSync:V,statSync:M,readFileSync:F,existsSync:O,writeFileSync:y,unlinkSync:ae,rmSync:ce,chmodSync:fe}=N("node:fs"),{cwd:j}=_,{createInterface:le}=N("node:readline"),{spawnSync:w}=N("node:child_process"),{basename:we}=N("node:path"),xe=/^# ([^:\s]\S*)(?::\s+(.+))?$/,Ee=e=>{const o=[],t=e.split(`
2
+ `);let n;for(const r of t){if(r.startsWith("#!")||r.startsWith("# Generated by")||r.startsWith("# NOTE:")||r==="set -e"||r==="")continue;const s=xe.exec(r);if(s){n&&o.push(n),n={command:"",id:s[1]??"",...s[2]?{name:s[2]}:{}};continue}n?n.command=n.command.length>0?`${n.command}
3
+ ${r}`:r:n={command:r,id:"(custom)"}}return n&&o.push(n),o},Se=(e,o)=>{const t=g(e,o),n=[],r=new Set(z);if(b(t))for(const s of V(t)){if(s.startsWith(".")||s==="_"||!r.has(s))continue;const i=g(t,s);if(!M(i).isFile())continue;const a=A(i),c=Ee(a);n.push({blocks:c,rawLineCount:a.split(`
4
+ `).length,stage:s})}return n.sort((s,i)=>s.stage.localeCompare(i.stage)),{hooksDirectory:o,stages:n}},Re=e=>{const o=[];if(e.stages.length===0)return o.push(`No hooks installed in ${e.hooksDirectory}/.`),o;o.push(`Hooks in ${e.hooksDirectory}/:`);for(const t of e.stages)if(o.push("",`${t.stage} (${t.rawLineCount} lines)`),t.blocks.length===0)o.push(" (empty)");else for(const n of t.blocks){const r=n.name?`${n.id} — ${n.name}`:n.id;o.push(` - ${r}`);const s=n.command.split(`
5
+ `).find(i=>i.trim()!=="");if(s){const i=s.length>120?`${s.slice(0,117)}...`:s;o.push(` ${i}`)}}return o},_e=(e,o)=>{const t=Se(j(),e);for(const n of Re(t))o.info(n)},L=6;if(P!==L)throw new Error(`vis native binding ABI mismatch: expected ${L}, got ${P}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const oe={".releaserc":["release-config","vis-config"],".releaserc.json":["release-config","vis-config"],"aube-lock.yaml":["aube-lock","lockfile"],"aube-workspace.yaml":["aube-workspace","vis-config"],"nx.json":["nx-workspace","vis-config"],"packem.config.js":["packem-config","vis-config"],"packem.config.mjs":["packem-config","vis-config"],"packem.config.ts":["packem-config","vis-config"],"pnpm-workspace.yaml":["pnpm-workspace","vis-config"],"project.json":["nx-project","vis-config"],"turbo.json":["turbo-config","vis-config"],"vis.config.js":["vis-config"],"vis.config.ts":["vis-config"]},te=[[".releaserc.json",["release-config","vis-config"]]],je=e=>{const o=new Set,t=we(e),n=oe[t];if(n)for(const s of n)o.add(s);const r=t.toLowerCase();for(const[s,i]of te)if(r.endsWith(s))for(const a of i)o.add(a);return o},Fe=new Set([...Object.values(oe).flat(),...te.flatMap(([,e])=>e)]);let C;const Ae=()=>(C||(C=new Set(ve())),C),Oe=e=>{const o=be([...e]),t=new Map;for(const[n,r]of e.entries()){const s=new Set(o[n]),i=je(r),a=new Set([...s,...i]);t.set(r,{all:a,prek:s,vis:i})}return t},Ne=e=>Ae().has(e)||Fe.has(e),Be=(e,o)=>{const{all:t}=e;if(o.types&&o.types.length>0){for(const n of o.types)if(!t.has(n))return!1}if(o.typesOr&&o.typesOr.length>0){let n=!1;for(const r of o.typesOr)if(t.has(r)){n=!0;break}if(!n)return!1}if(o.excludeTypes&&o.excludeTypes.length>0){for(const n of o.excludeTypes)if(t.has(n))return!1}return!0},Ce=e=>{let o=0;const{length:t}=e,n=()=>{for(;o<t&&/\s/.test(e[o]);)o+=1},r=()=>{if(e[o]!=='"')throw new Error(`expected string at ${o}`);o+=1;const c=o;for(;o<t&&e[o]!=='"';)o+=e[o]==="\\"?2:1;const l=e.slice(c,o);return o+=1,JSON.parse(`"${l}"`)},s=()=>{switch(n(),e[o]){case'"':{r();break}case"[":{i();break}case"{":{a();break}default:for(;o<t&&!",}]".includes(e[o])&&!/\s/.test(e[o]);)o+=1}},i=()=>{if(o+=1,n(),e[o]==="]"){o+=1;return}for(;o<t;)if(s(),n(),e[o]===",")o+=1,n();else if(e[o]==="]"){o+=1;return}},a=()=>{o+=1,n();const c=new Set;if(e[o]==="}"){o+=1;return}for(;o<t;){n();const l=r();if(c.has(l))throw new Error(`Duplicate key: ${l}`);if(c.add(l),n(),e[o]!==":")throw new Error(`expected colon at ${o}`);if(o+=1,s(),n(),e[o]===",")o+=1,n();else if(e[o]==="}"){o+=1;return}}};n(),s()},Ie=(e,o,t)=>{let n=0;for(const r of e){const s=F(g(t.root,r),"utf8");try{JSON.parse(s),Ce(s)}catch(i){const a=i instanceof Error?i.message:String(i);t.logger.info(`${r}: Failed to json decode (${a})`),n=1}}return n},Me=e=>{const o=w("git",["rev-parse","--git-dir"],{cwd:e,encoding:"utf8"});if(o.status!==0)return!1;const t=o.stdout.trim(),n=t.startsWith("/")?t:g(e,t);return O(g(n,"MERGE_MSG"))?O(g(n,"MERGE_HEAD"))||O(g(n,"rebase-apply"))||O(g(n,"rebase-merge")):!1},De=["<<<<<<< ","======= ",`=======\r
6
+ `,`=======
7
+ `,">>>>>>> "],We=(e,o,t)=>{if(!o.includes("--assume-in-merge")&&!Me(t.root))return 0;let n=0;for(const r of e){const s=F(g(t.root,r),"utf8").split(`
8
+ `);for(let i=0;i<s.length;i+=1){const a=s[i]+(i<s.length-1?`
9
+ `:"");for(const c of De)a.startsWith(c)&&(t.logger.info(`${r}:${i+1}: Merge conflict string ${JSON.stringify(c.trim())} found`),n=1)}}return n},He=(e,o,t)=>{let n=0;for(const r of e){const s=g(t.root,r),i=F(s);if(i.length===0)continue;let a=i.length;const c=i[a-1];if(c!==10&&c!==13){y(s,Buffer.concat([i,Buffer.from([10])])),t.logger.info(`Fixing ${r}`),n=1;continue}for(;a>0&&(i[a-1]===10||i[a-1]===13);)a-=1;if(a===0){y(s,Buffer.alloc(0)),t.logger.info(`Fixing ${r}`),n=1;continue}const l=i.subarray(a);let d;l[0]===13&&l[1]===10?d=Buffer.from([13,10]):l[0]===13?d=Buffer.from([13]):d=Buffer.from([10]),!l.equals(d)&&(y(s,Buffer.concat([i.subarray(0,a),d])),t.logger.info(`Fixing ${r}`),n=1)}return n},Te={cr:Buffer.from([13]),crlf:Buffer.from([13,10]),lf:Buffer.from([10])},Pe=new Set(["auto","cr","crlf","lf","no"]),Le=(e,o,t)=>{let n="auto";for(let s=0;s<o.length;s+=1){const i=o[s];if(i==="-f"||i==="--fix"){s+=1;const a=o[s];if(a===void 0)return t.logger.error(`mixed-line-ending: ${i} requires a value (auto|no|lf|crlf|cr)`),2;n=a}else i.startsWith("--fix=")&&(n=i.slice(6))}if(!Pe.has(n))return t.logger.error(`mixed-line-ending: invalid --fix value ${n}`),2;let r=0;for(const s of e){const i=g(t.root,s),a=F(i),c=[],l=f=>{const m=c.find(v=>v.kind===f);m?m.count+=1:c.push({count:1,kind:f})},d=[];let u=0;for(let f=0;f<a.length;f+=1){const m=a[f];m===13&&a[f+1]===10?(d.push({content:a.subarray(u,f),ending:"crlf"}),l("crlf"),f+=1,u=f+1):m===13?(d.push({content:a.subarray(u,f),ending:"cr"}),l("cr"),u=f+1):m===10&&(d.push({content:a.subarray(u,f),ending:"lf"}),l("lf"),u=f+1)}u<a.length&&d.push({content:a.subarray(u),ending:null});const k=c.length>1;if(n==="no"){k&&(t.logger.info(`${s}: mixed line endings`),r=1);continue}let $;if(n==="auto"){if(!k)continue;let f;for(const m of c)(!f||m.count>f.count)&&(f=m);$=f?.kind}else if($=n,!c.some(f=>f.kind!==$&&f.count>0))continue;const x=Te[$],h=[];for(const f of d)h.push(f.content),f.ending!==null&&h.push(x);y(i,Buffer.concat(h)),t.logger.info(`${s}: fixed mixed line endings`),r=1}return r},q=new Set([9,11,12,13,32]),qe=/\.(?:md|markdown|mdown|mdx)$/i,Ge=(e,o,t)=>{let n=0;for(const r of e){const s=qe.test(r),i=g(t.root,r),a=F(i),c=[];let l=0;for(;l<=a.length;){let u=l;for(;u<a.length&&a[u]!==10;)u+=1;const k=u<a.length&&a[u]===10;let $=u,x=!1;k&&u>l&&a[u-1]===13&&(x=!0,$=u-1);const h=a.subarray(l,$);let f=h.length;for(;f>0&&q.has(h[f-1]);)f-=1;const m=h.some(v=>!q.has(v));if(s&&h.length>=2&&h[h.length-1]===32&&h[h.length-2]===32&&m&&(f=Math.min(f+2,h.length)),c.push(h.subarray(0,f)),x&&c.push(Buffer.from([13])),k&&c.push(Buffer.from([10])),!k)break;l=u+1}const d=Buffer.concat(c);d.equals(a)||(y(i,d),t.logger.info(`Fixing ${r}`),n=1)}return n},ne={"check-json":Ie,"check-merge-conflict":We,"end-of-file-fixer":He,"mixed-line-ending":Le,"trailing-whitespace":Ge},Je=Object.keys(ne).sort(),Ke=e=>ne[e],Ve=new Map([["pre-commit/pre-commit-hooks#check-json","check-json"],["pre-commit/pre-commit-hooks#check-merge-conflict","check-merge-conflict"],["pre-commit/pre-commit-hooks#end-of-file-fixer","end-of-file-fixer"],["pre-commit/pre-commit-hooks#mixed-line-ending","mixed-line-ending"],["pre-commit/pre-commit-hooks#trailing-whitespace","trailing-whitespace"]]),Ue=/[<>=!~]=/,ze=/github\.com[/:]([^/\s]+\/[^/\s.]+)/i,Ye="# Generated by `vis hook migrate` from prek",Qe=e=>`#!/usr/bin/env sh
10
+ ${Ye}
11
+ exec vis hook run ${e} "$@"
12
+ `,H=e=>{for(const o of ue)if(b(g(e,o)))return o},Xe=e=>pe[e]??e,Ze=e=>ze.exec(e)?.[1]??e,eo=e=>{if(Ue.test(e))return;if(e.startsWith("@")){const n=e.indexOf("@",1);if(n===-1)return{name:e,version:"latest"};const r=e.slice(n+1).trim();return{name:e.slice(0,n),version:r||"latest"}}const o=e.indexOf("@");if(o===-1)return{name:e,version:"latest"};const t=e.slice(o+1).trim();return{name:e.slice(0,o),version:t||"latest"}},oo=e=>{const o=[];for(const t of[e.types,e.types_or,e.exclude_types])for(const n of t??[])Ne(n)||o.push(n);return o},to=(e,o)=>(e.stages&&e.stages.length>0?e.stages:o??["pre-commit"]).map(t=>Xe(t)),no=(e,o,t)=>{const n=e.id??"<unknown>",r=W.has(o),s={id:n};return e.name&&(s.name=e.name),e.language==="fail"?(s.fail=e.entry??e.name??n,s):(t?s.builtin=t:e.entry&&(s.entry=e.entry),Array.isArray(e.args)&&e.args.length>0&&(s.args=[...e.args]),r||(e.files&&(s.files=e.files),e.exclude&&(s.exclude=e.exclude),e.types&&e.types.length>0&&(s.types=[...e.types]),e.types_or&&e.types_or.length>0&&(s.typesOr=[...e.types_or]),e.exclude_types&&e.exclude_types.length>0&&(s.excludeTypes=[...e.exclude_types])),(e.pass_filenames===!1||r)&&(s.passFilenames=!1),(e.always_run||r)&&(s.alwaysRun=!0),e.verbose&&(s.verbose=!0),s)},ro=(e,o,t,n)=>{if(Array.isArray(e.additional_dependencies))for(const r of e.additional_dependencies){const s=eo(r);if(!s){n.push(`"${o}": additional_dependency "${r}" uses a pip-style pin and cannot be added to package.json — install manually.`);continue}t.push({hookId:o,name:s.name,raw:r,version:s.version})}},so=e=>{const o={},t=[],n=[],r=[],s=[];(e.files||e.exclude)&&n.push("top-level files/exclude filter dropped — apply it per hook if needed");for(const a of e.repos??[]){const c=a.repo??"<unknown>",l=c==="local",d=l?void 0:Ze(c);for(const u of a.hooks??[]){const k=u.id??"<unknown>";let $;if(l){const f=u.language??"system";if(!de.has(f)){t.push({hookId:k,reason:`language "${f}" needs an isolated toolchain — run via prek or reimplement as a system command`,repo:c});continue}if(f!=="fail"&&!u.entry){t.push({hookId:k,reason:"missing `entry`",repo:c});continue}}else if(d&&($=Ve.get(`${d}#${k}`)),!$){t.push({hookId:k,reason:`remote repo "${c}"@${a.rev??"?"} has no bundled equivalent — run via prek or replace with a system command`,repo:c});continue}ro(u,k,s,r);const x=oo(u);x.length>0&&n.push(`hook "${k}": unsupported types ${x.join(", ")} — those entries are ignored by the dispatcher`);const h=to(u,e.default_stages);for(const f of h){if(f==="manual")continue;if(!he.has(f)){t.push({hookId:k,reason:`unsupported stage "${f}"`,repo:c});continue}const m=no(u,f,$),v=o[f];v?v.push(m):o[f]=[m]}}}const i={stages:o,version:me};return e.fail_fast&&(i.failFast=!0),{additionalDeps:s,config:i,droppedFilters:n,manualSteps:r,skippedHooks:t}},io=e=>{const o=$e(e);if(o&&typeof o=="object")return o},ao=e=>{if(e.endsWith(".toml")){const t=ke(e);return t&&typeof t=="object"?t:void 0}const o=A(e);return io(o)},co=(e,o,t)=>{const n=g(e,"package.json"),r=[],s=[];if(!b(n)||o.length===0)return{added:r,skipped:s};const i=A(n),a=JSON.parse(i),c=a.devDependencies??{},l=a.dependencies??{};for(const u of o){if(u.name in c||u.name in l){s.push(u.name);continue}c[u.name]=u.version,r.push(u.name)}if(r.length===0)return{added:r,skipped:s};a.devDependencies=c;const d=ye(n,i,{defaultIndent:" ",useEditorconfig:t});return y(n,`${JSON.stringify(a,void 0,d)}
13
+ `,"utf8"),{added:r,skipped:s}},fo=(e,o)=>{const t=g(e,o);U(t),y(g(t,"README.md"),["# Vis hook config","","`config.json` is the single source of truth for what each stage","script runs. Auto-generated by `vis hook migrate`. Edit by hand","or re-run the migrator after updating your prek config.","",`Bundled builtins: ${Je.join(", ")}`,""].join(`
14
+ `),"utf8")},lo=(e,o)=>{w("prek",["--version"],{cwd:e,encoding:"utf8"}).status===0?w("prek",["uninstall"],{cwd:e,encoding:"utf8"}).status===0?o.info("Detached prek via `prek uninstall`."):o.info("`prek uninstall` did not exit cleanly — continuing. You may need to run it manually."):o.info("prek binary not found on PATH — skipping `prek uninstall`. Run it manually if prek is installed elsewhere.")},re=(e,o,t,n={})=>{const r=H(e),s=n.dryRun===!0;if(!r)return{isError:!0,message:"No prek configuration found (.pre-commit-config.yaml, .pre-commit-config.yml, or prek.toml)"};t.info(`Found prek config at ${r}`);const i=g(e,r),a=A(i),c=ao(i);if(!c)return{isError:!0,message:`Could not parse ${r}`};const{additionalDeps:l,config:d,droppedFilters:u,manualSteps:k,skippedHooks:$}=so(c),x=Object.keys(d.stages);if(x.length===0&&$.length===0)return{isError:!0,message:`${r} has no hooks to migrate`};if(!s){const p=w("git",["config","--local","core.hooksPath"],{cwd:e,encoding:"utf8"});if(p.status===0){const B=p.stdout?.toString().trim();B&&(B.includes(".prek")||B.includes("prek-hooks"))&&w("git",["config","--local","--unset","core.hooksPath"],{cwd:e})}const R=Y(o);if(R.isError)return R;R.message&&t.info(R.message)}const h=g(e,o);s||U(h),s?t.info(` (would write) ${o}/${E}`):(ge(e,o,d),fo(e,o),t.info(` Wrote ${o}/${E}`));let f=0;for(const p of x){const R=Qe(p);s?t.info(` (would write) ${o}/${p}`):(y(g(h,p),R,{mode:493}),t.info(` Wrote ${o}/${p}`)),f+=1}const{added:m,skipped:v}=s?{added:l.map(p=>p.name),skipped:[]}:co(e,l,n.useEditorconfig);if(m.length>0){const p=s?"would add":"Added";t.info(`${p} ${m.length} package${m.length===1?"":"s"} to devDependencies: ${m.join(", ")}`),s||t.info("Run your package manager's install (e.g. `pnpm install`) to pick up the new devDependencies.")}v.length>0&&t.info(`Skipped ${v.length} already-declared package${v.length===1?"":"s"}: ${v.join(", ")}`),s||lo(e,t);const T=`${i}.bak`;if(s?t.info(` (would remove) ${r} and back it up to ${r}.bak`):(b(T)||y(T,a,"utf8"),ae(i),t.info(`Removed ${r} (backup at ${r}.bak)`)),$.length>0){t.warn(`Skipped ${$.length} hook${$.length===1?"":"s"} that cannot run without prek:`);for(const p of $)t.warn(` - ${p.repo}::${p.hookId} — ${p.reason}`)}if(u.length>0){t.warn("Partial filter translations:");for(const p of u)t.warn(` - ${p}`)}if(k.length>0){t.warn("Manual follow-up required:");for(const p of k)t.warn(` - ${p}`)}return{isError:!1,message:`${s?"would migrate":"Migration complete:"} ${f} stage script${f===1?"":"s"} ${s?"into":"written to"} ${o}/`}},uo=e=>{const o=[];let t=0;for(let n=0;n<e.length;n+=1)e[n]===0&&(n>t&&o.push(e.subarray(t,n).toString("utf8")),t=n+1);return t<e.length&&o.push(e.subarray(t).toString("utf8")),o},I=(e,o,t)=>{const n=w("git",[...e],{cwd:t,encoding:"buffer"});if(n.status!==0){const r=n.stderr?n.stderr.toString():"";throw new Error(`git ${o} failed${r?`: ${r.trim()}`:""}`)}return n.stdout.length===0?[]:uo(n.stdout)},go=(e,o)=>{switch(e.kind){case"all":return I(["ls-files","-z"],"ls-files",o);case"range":return I(["diff","--name-only","--diff-filter=ACM","-z",e.fromRef,e.toRef],"diff --from-ref/--to-ref",o);case"staged":return I(["diff","--cached","--name-only","--diff-filter=ACM","-z"],"diff --cached",o);default:{const t=e;throw new Error(`unknown discover mode: ${JSON.stringify(t)}`)}}},G=(e,o)=>{try{return new RegExp(e)}catch(t){const n=t instanceof Error?t.message:String(t);throw new Error(`invalid ${o} regex ${JSON.stringify(e)}: ${n}`,{cause:t})}},ho=e=>e.types&&e.types.length>0||e.typesOr&&e.typesOr.length>0||e.excludeTypes&&e.excludeTypes.length>0||!1,mo=(e,o)=>{let t=e;if(o.files){const s=G(o.files,"files");t=t.filter(i=>s.test(i))}if(o.exclude){const s=G(o.exclude,"exclude");t=t.filter(i=>!s.test(i))}if(!ho(o))return[...t];const n=Oe(t),r={excludeTypes:o.excludeTypes,types:o.types,typesOr:o.typesOr};return t.filter(s=>{const i=n.get(s);return i?Be(i,r):!1})},po=32*1024,ko=(e,o)=>{const t=[],n=Math.max(1024,po-o);let r=[],s=0;for(const i of e){const a=Buffer.byteLength(i,"utf8")+8;s+a>n&&r.length>0&&(t.push(r),r=[],s=0),r.push(i),s+=a}return r.length>0&&t.push(r),t},$o=e=>({error:o=>{e.error(o)},info:o=>{e.info(o)}}),J=(e,o,t)=>t?t.message:o?`terminated by signal ${o}`:`exited with status ${String(e)}`,yo=(e,o,t,n,r)=>{const s=n?r.extraArgs:[];if(!t||o.length===0){const c=w("sh",["-c",e,"sh",...s],{cwd:r.root,stdio:"inherit"});return c.status===null?(r.logger.error(`hook command failed: ${J(c.status,c.signal,c.error)}`),1):c.status}const i=Buffer.byteLength(e,"utf8")+Buffer.byteLength("sh","utf8")+Buffer.byteLength("-c","utf8")+s.reduce((c,l)=>c+Buffer.byteLength(l,"utf8")+8,0)+64;let a=0;for(const c of ko(o,i)){const l=w("sh",["-c",`${e} "$@"`,"sh",...s,...c],{cwd:r.root,stdio:"inherit"});l.status===null?(r.logger.error(`hook command failed: ${J(l.status,l.signal,l.error)}`),a|=1):a|=l.status}return a},wo=(e,o,t)=>{if(e.fail!==void 0)return t.logger.info(e.fail),1;const n=W.has(t.stage);let r;try{r=mo(o,e)}catch(c){const l=c instanceof Error?c.message:String(c);return t.logger.error(`hook "${e.id}": ${l}`),2}if(r.length===0&&e.alwaysRun!==!0&&!n)return 0;const s=e.passFilenames!==!1;if(e.verbose){const c=e.name??e.id;t.logger.info(`+ ${c}`)}if(e.builtin){const c=Ke(e.builtin);if(!c)return t.logger.error(`unknown builtin "${e.builtin}" referenced by hook "${e.id}"`),2;const l={logger:$o(t.logger),root:t.root};try{return c(r,e.args??[],l)}catch(d){const u=d instanceof Error?d.message:String(d);return t.logger.error(`builtin "${e.builtin}" crashed: ${u}`),1}}if(e.entry===void 0)return t.logger.error(`hook "${e.id}" has no \`entry\`, \`builtin\`, or \`fail\` to run`),2;const i=(e.args??[]).map(c=>`'${c.replaceAll("'",String.raw`'\''`)}'`).join(" "),a=i?`${e.entry} ${i}`:e.entry;return yo(a,r,s,n,t)},vo=(e,o,t,n)=>{const r=e.stages[o];if(!r||r.length===0)return 0;let s=0;for(const i of r){const a=wo(i,t,n);if(a!==0&&(s|=a,e.failFast))return s}return s},bo="pre-commit",xo=e=>{if(e.lastCommit&&(e.fromRef||e.toRef))throw new Error("--last-commit cannot be combined with --from-ref or --to-ref");const o=e.lastCommit?"HEAD~1":e.fromRef,t=e.lastCommit?"HEAD":e.toRef;if(o&&!t||t&&!o)throw new Error("--from-ref and --to-ref must be specified together");return o&&t?{fromRef:o,kind:"range",toRef:t}:e.allFiles?{kind:"all"}:{kind:"staged"}},Eo=(e,o,t,n)=>{const r=t.stage??bo,s=Q(e,o);if(!s)throw new Error(`No hook config found at ${o}/config.json. Install or migrate hooks first.`);const i=s.stages[r];if(!i||i.length===0)return n.info(`No hooks configured for stage "${r}".`),0;const a=W.has(r)?void 0:xo(t),c=a?.kind==="all"?" (--all-files)":a?.kind==="range"?` (${a.fromRef}..${a.toRef})`:"";n.info(`Running ${r}${c}`);const l=a?go(a,e):[],d={extraArgs:t.extraArgs??[],logger:n,root:e,stage:r};return vo(s,r,l,d)},So=(e,o,t)=>{const n=Eo(j(),e,o,t);if(n!==0)throw new Error(`Hook stage exited with code ${n}`)},Ro=(e=X)=>{if(w("git",["config","--local","core.hooksPath"]).status!==0)return{isError:!1,message:"No custom hooks path configured"};const{status:o,stderr:t}=w("git",["config","--local","--unset","core.hooksPath"]);if(o===null)return{isError:!0,message:"git command not found"};if(o&&o!==5)return{isError:!0,message:String(t)};const n=g(e,"_");return b(n)&&ce(n,{force:!0,recursive:!0}),{isError:!1,message:""}},_o=new Set(z),jo=e=>{const o=w("sh",["-n",e],{encoding:"utf8"});if(o.status===null)return`failed to run "sh -n" (${o.error?.message??"unknown error"})`;if(o.status!==0)return o.stderr.trim()||`sh -n exited with ${o.status}`},Fo=(e,o)=>{const t=[],n=g(e,o),r=w("git",["config","--local","core.hooksPath"],{cwd:e,encoding:"utf8"});if(r.status===0){const i=r.stdout.trim(),a=`${o}/_`;i&&i!==a&&t.push({kind:"warning",message:`core.hooksPath is "${i}" — expected "${a}". Re-run \`vis hook install\` to fix.`})}else t.push({kind:"warning",message:"core.hooksPath is not set — run `vis hook install`."});if(b(g(n,"_"))||t.push({kind:"error",message:`Dispatcher directory ${o}/_ is missing. Run \`vis hook install\`.`}),!b(n))return t.push({kind:"error",message:`Hooks directory ${o}/ is missing.`}),{issues:t,ok:!1};let s=!1;for(const i of V(n)){if(i.startsWith(".")||i==="_"||i===E||i==="README.md")continue;if(!_o.has(i)){t.push({kind:"warning",message:`Unknown hook "${i}" — not a standard git hook.`,path:g(o,i)});continue}const a=g(n,i);if(!M(a).isFile())continue;s=!0;const c=M(a).mode&511;(c&64)===0&&t.push({kind:"warning",message:`Script is not owner-executable (mode ${c.toString(8)}).`,path:g(o,i)});const l=jo(a);l&&t.push({kind:"error",message:`Shell syntax error: ${l}`,path:g(o,i)})}if(s){const i=g(n,E);if(b(i))try{Q(e,o)}catch(a){t.push({kind:"error",message:`${E} is malformed: ${a instanceof Error?a.message:String(a)}`,path:g(o,E)})}else t.push({kind:"error",message:`Stage scripts are present but ${o}/${E} is missing. Re-run \`vis hook migrate\`.`})}return{issues:t,ok:!t.some(i=>i.kind==="error")}},Ao=(e,o)=>{if(e.issues.length===0)return[`Hook directory ${o}/ looks good.`];const t=[];for(const n of e.issues){const r=n.kind==="error"?"ERROR":"WARN ",s=n.path?` (${n.path})`:"";t.push(`${r} ${n.message}${s}`)}return t.push("",e.ok?"No errors — warnings only.":`${e.issues.filter(n=>n.kind==="error").length} error(s).`),t},Oo=(e,o)=>{const t=Fo(j(),e),n=Ao(t,e);for(const r of n)r.startsWith("ERROR")||r.startsWith("WARN")?o.warn(r):o.info(r);if(!t.ok)throw new Error("Hook validation failed")},S=e=>e.hooksDir??X,K=e=>new Promise(o=>{const t=le({input:process.stdin,output:process.stdout});t.question(`${e} (y/N) `,n=>{t.close();const r=n.trim().toLowerCase();o(r==="y"||r==="yes")})}),No=async(e,o,t)=>{const n=j(),r=Z(n),s=H(n);if(r&&s)throw new Error(`Found both husky (${r}/) and prek (${s}). Remove or migrate one before running \`vis hook install\`.`);if(r){if(o.info(`Existing husky installation found at ${r}/`),await K("Would you like to migrate your husky hooks to vis?")){const a=ee(n,e,o,{useEditorconfig:t});if(a.isError)throw new Error(a.message);a.message&&o.info(a.message);return}o.info("Aborting install. Remove husky first or run 'vis hook migrate' to migrate.");return}if(s){if(o.info(`Existing prek configuration found at ${s}`),await K("Would you like to migrate your prek hooks to vis?")){const a=re(n,e,o,{useEditorconfig:t});if(a.isError)throw new Error(a.message);a.message&&o.info(a.message);return}o.info("Aborting install. Remove the prek config first or run 'vis hook migrate' to migrate.");return}o.info(`Installing git hooks in ${e}/...`);const i=Y(e);if(i.message){if(i.isError)throw new Error(i.message);o.info(i.message);return}b(g(n,e,"pre-commit"))||y(g(n,e,"pre-commit"),`#!/usr/bin/env sh
15
+ `,{mode:493}),o.info("Git hooks installed successfully.")},Bo=(e,o,t,n)=>{const r=j(),s=Z(r),i=H(r);if(s&&i)throw new Error(`Found both husky (${s}/) and prek (${i}). Migrate one at a time — rename or remove one before retrying.`);if(!s&&!i)throw new Error("No husky (.husky/) or prek (.pre-commit-config.yaml / prek.toml) configuration found to migrate.");o&&t.info("(dry-run) no files will be written");const a=s?ee(r,e,t,{dryRun:o,useEditorconfig:n}):re(r,e,t,{dryRun:o,useEditorconfig:n});if(a.isError)throw new Error(a.message);a.message&&t.info(a.message)},D="# vis:secrets-hook",Co=`#!/usr/bin/env sh
16
+ ${D}
17
+ # Scan staged files for secrets before each commit. Remove this block or the whole file to disable.
18
+ pnpm exec vis secrets --staged --quiet || exit 1
19
+ `,Io=(e,o,t)=>{if(e!=="secrets")throw new Error(`Unknown hook add target "${String(e)}". Currently supported: "secrets".`);const n=j(),r=g(n,o,"pre-commit");if(!b(g(n,o)))throw new Error(`Hooks directory ${o}/ does not exist. Run \`vis hook install\` first.`);if(b(r)){const s=A(r);if(s.includes(D)){t.info(`Secrets hook already present in ${r}.`);return}if(/\bvis secrets\b/.test(s)){t.warn(`Found a \`vis secrets\` invocation in ${r} without the managed marker — leaving it untouched.`);return}const i=`${s.trimEnd()}
20
+
21
+ ${D}
22
+ pnpm exec vis secrets --staged --quiet || exit 1
23
+ `;y(r,i),fe(r,493),t.info(`Appended secrets scan to ${r}.`);return}y(r,Co,{mode:493}),t.info(`Created ${r} with a secrets-scan pre-commit check.`)},Mo=(e,o)=>{o.info("Removing git hooks...");const t=Ro(e);if(t.message){if(t.isError)throw new Error(t.message);o.info(t.message);return}o.info("Git hooks removed successfully.")},Do=async({logger:e,options:o,visConfig:t})=>{await No(S(o),e,t?.editorconfig??!0)},Wo=({logger:e,options:o})=>{Mo(S(o),e)},Ho=({logger:e,options:o,visConfig:t})=>{Bo(S(o),!!o.dryRun,e,t?.editorconfig??!0)},To=({logger:e,options:o})=>{_e(S(o),e)},Po=({logger:e,options:o})=>{Oo(S(o),e)},Lo=({argument:e,logger:o,options:t})=>{So(S(t),{allFiles:!!t.allFiles,extraArgs:e.slice(1),fromRef:t.fromRef,lastCommit:!!t.lastCommit,stage:e[0],toRef:t.toRef},o)},qo=({argument:e,logger:o,options:t})=>{Io(e[0],S(t),o)},Qo=Do,Xo=Wo,Zo=Ho,et=To,ot=Po,tt=Lo,nt=qo;export{nt as hookAddExecute,Qo as hookInstallExecute,et as hookListExecute,Zo as hookMigrateExecute,tt as hookRunExecute,Xo as hookUninstallExecute,ot as hookValidateExecute};