@visulima/vis 3.0.0 → 3.0.2

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 (306) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE.md +5760 -4562
  3. package/dashboard/dist/index.html +12 -12
  4. package/dist/bin.js +1 -1
  5. package/dist/binx.js +2 -2
  6. package/dist/config/index.js +1 -1
  7. package/dist/packem_chunks/CONFIG_FILES.js +6 -6
  8. package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -1
  9. package/dist/packem_chunks/agent-instructions.js +7 -7
  10. package/dist/packem_chunks/bloom-status.js +2 -2
  11. package/dist/packem_chunks/bloom-sync.js +2 -2
  12. package/dist/packem_chunks/cache-attestation.js +1 -1
  13. package/dist/packem_chunks/catalog-detector.js +1 -1
  14. package/dist/packem_chunks/catalog.js +87 -111
  15. package/dist/packem_chunks/cli-exec.js +1 -1
  16. package/dist/packem_chunks/cli-main.js +192 -217
  17. package/dist/packem_chunks/defineReleasePlugin.js +3 -3
  18. package/dist/packem_chunks/detect.js +8 -3
  19. package/dist/packem_chunks/devtools.js +1 -1
  20. package/dist/packem_chunks/discord.js +4 -4
  21. package/dist/packem_chunks/dispatch.js +4 -4
  22. package/dist/packem_chunks/doctor-probe.js +2 -2
  23. package/dist/packem_chunks/extra-files.js +3 -3
  24. package/dist/packem_chunks/fix.js +11 -11
  25. package/dist/packem_chunks/git.js +3 -3
  26. package/dist/packem_chunks/group-tags.js +1 -1
  27. package/dist/packem_chunks/handler.js +1 -1
  28. package/dist/packem_chunks/handler10.js +5 -5
  29. package/dist/packem_chunks/handler11.js +1 -1
  30. package/dist/packem_chunks/handler12.js +16 -16
  31. package/dist/packem_chunks/handler13.js +5 -5
  32. package/dist/packem_chunks/handler14.js +1 -1
  33. package/dist/packem_chunks/handler15.js +1 -1
  34. package/dist/packem_chunks/handler16.js +1 -1
  35. package/dist/packem_chunks/handler17.js +1 -1
  36. package/dist/packem_chunks/handler18.js +1 -1
  37. package/dist/packem_chunks/handler19.js +5 -5
  38. package/dist/packem_chunks/handler2.js +1 -1
  39. package/dist/packem_chunks/handler20.js +2 -2
  40. package/dist/packem_chunks/handler21.js +2 -2
  41. package/dist/packem_chunks/handler22.js +8 -8
  42. package/dist/packem_chunks/handler23.js +1 -1
  43. package/dist/packem_chunks/handler24.js +1 -1
  44. package/dist/packem_chunks/handler25.js +1 -1
  45. package/dist/packem_chunks/handler26.js +5 -5
  46. package/dist/packem_chunks/handler27.js +1 -1
  47. package/dist/packem_chunks/handler28.js +3 -3
  48. package/dist/packem_chunks/handler29.js +1 -1
  49. package/dist/packem_chunks/handler3.js +2 -2
  50. package/dist/packem_chunks/handler30.js +1 -1
  51. package/dist/packem_chunks/handler31.js +2 -2
  52. package/dist/packem_chunks/handler32.js +2 -2
  53. package/dist/packem_chunks/handler33.js +2 -2
  54. package/dist/packem_chunks/handler34.js +3 -3
  55. package/dist/packem_chunks/handler35.js +5 -5
  56. package/dist/packem_chunks/handler36.js +1 -1
  57. package/dist/packem_chunks/handler37.js +2 -2
  58. package/dist/packem_chunks/handler38.js +6 -6
  59. package/dist/packem_chunks/handler39.js +8 -8
  60. package/dist/packem_chunks/handler4.js +4 -4
  61. package/dist/packem_chunks/handler40.js +34 -34
  62. package/dist/packem_chunks/handler41.js +5 -5
  63. package/dist/packem_chunks/handler42.js +4 -4
  64. package/dist/packem_chunks/handler43.js +3 -3
  65. package/dist/packem_chunks/handler44.js +2 -2
  66. package/dist/packem_chunks/handler45.js +1 -1
  67. package/dist/packem_chunks/handler46.js +1 -1
  68. package/dist/packem_chunks/handler47.js +1 -1
  69. package/dist/packem_chunks/handler48.js +3 -3
  70. package/dist/packem_chunks/handler49.js +1 -1
  71. package/dist/packem_chunks/handler5.js +6 -6
  72. package/dist/packem_chunks/handler50.js +6 -6
  73. package/dist/packem_chunks/handler51.js +13 -13
  74. package/dist/packem_chunks/handler52.js +3 -3
  75. package/dist/packem_chunks/handler53.js +5 -5
  76. package/dist/packem_chunks/handler54.js +2 -2
  77. package/dist/packem_chunks/handler55.js +1 -1
  78. package/dist/packem_chunks/handler56.js +4 -4
  79. package/dist/packem_chunks/handler57.js +5 -5
  80. package/dist/packem_chunks/handler58.js +5 -5
  81. package/dist/packem_chunks/handler59.js +8 -8
  82. package/dist/packem_chunks/handler6.js +7 -7
  83. package/dist/packem_chunks/handler60.js +3 -3
  84. package/dist/packem_chunks/handler61.js +21 -21
  85. package/dist/packem_chunks/handler62.js +12 -12
  86. package/dist/packem_chunks/handler63.js +3 -3
  87. package/dist/packem_chunks/handler64.js +5 -5
  88. package/dist/packem_chunks/handler65.js +8 -8
  89. package/dist/packem_chunks/handler66.js +2 -2
  90. package/dist/packem_chunks/handler67.js +25 -24
  91. package/dist/packem_chunks/handler68.js +153 -25
  92. package/dist/packem_chunks/handler69.js +10 -153
  93. package/dist/packem_chunks/handler7.js +1 -1
  94. package/dist/packem_chunks/handler70.js +22 -10
  95. package/dist/packem_chunks/handler71.js +17 -17
  96. package/dist/packem_chunks/handler72.js +104 -104
  97. package/dist/packem_chunks/handler73.js +20 -20
  98. package/dist/packem_chunks/handler74.js +45 -45
  99. package/dist/packem_chunks/handler75.js +27 -3
  100. package/dist/packem_chunks/handler76.js +3 -27
  101. package/dist/packem_chunks/handler77.js +68 -68
  102. package/dist/packem_chunks/handler78.js +30 -30
  103. package/dist/packem_chunks/handler8.js +1 -1
  104. package/dist/packem_chunks/handler9.js +1 -1
  105. package/dist/packem_chunks/heal-accept.js +9 -9
  106. package/dist/packem_chunks/heal.js +11 -11
  107. package/dist/packem_chunks/help-command.js +7 -63
  108. package/dist/packem_chunks/index.js +1 -1
  109. package/dist/packem_chunks/index2.js +48 -804
  110. package/dist/packem_chunks/index3.js +3 -7
  111. package/dist/packem_chunks/index4.js +801 -134
  112. package/dist/packem_chunks/index5.js +7 -73
  113. package/dist/packem_chunks/index6.js +73 -0
  114. package/dist/packem_chunks/index7.js +135 -0
  115. package/dist/packem_chunks/interface.js +2 -2
  116. package/dist/packem_chunks/keys-refresh.js +4 -4
  117. package/dist/packem_chunks/lean.js +3 -3
  118. package/dist/packem_chunks/list.js +3 -3
  119. package/dist/packem_chunks/loader.js +4 -4
  120. package/dist/packem_chunks/loader2.js +1 -1
  121. package/dist/packem_chunks/orchestrator.js +27 -27
  122. package/dist/packem_chunks/pre-mode.js +2 -2
  123. package/dist/packem_chunks/print-config.js +1 -1
  124. package/dist/packem_chunks/prompts.js +7 -7
  125. package/dist/packem_chunks/prune.js +3 -3
  126. package/dist/packem_chunks/publish-guards.js +1 -1
  127. package/dist/packem_chunks/resolveFormatter.js +5 -5
  128. package/dist/packem_chunks/run.js +1 -1
  129. package/dist/packem_chunks/security.js +1 -1
  130. package/dist/packem_chunks/shell-runner.js +1 -1
  131. package/dist/packem_chunks/slack.js +2 -2
  132. package/dist/packem_chunks/snapshot.js +2 -2
  133. package/dist/packem_chunks/stage-publisher.js +1 -1
  134. package/dist/packem_chunks/staged-registry.js +2 -2
  135. package/dist/packem_chunks/state.js +3 -3
  136. package/dist/packem_chunks/status.js +2 -2
  137. package/dist/packem_chunks/success-walk.js +4 -4
  138. package/dist/packem_chunks/sync.js +2 -2
  139. package/dist/packem_chunks/sync2.js +2 -2
  140. package/dist/packem_chunks/tar.js +3 -3
  141. package/dist/packem_chunks/tripwire.js +2 -2
  142. package/dist/packem_chunks/ts-loader.js +5 -9
  143. package/dist/packem_chunks/verify-lockfile.js +2 -2
  144. package/dist/packem_chunks/version-resolver.js +2 -2
  145. package/dist/packem_chunks/webhook.js +1 -1
  146. package/dist/packem_chunks/workflow-templates.js +5 -5
  147. package/dist/packem_chunks/workspace.js +2 -2
  148. package/dist/packem_shared/ReleaseClient-DAvbxCdo.js +1 -0
  149. package/dist/packem_shared/Table-DyORjLji-CC9cYgCG.js +11 -0
  150. package/dist/packem_shared/{VisReleaseError-DMGRBTNO.js → VisReleaseError-DZtgcKf8.js} +1 -1
  151. package/dist/packem_shared/_commonjsHelpers-DTfxOvZk.js +1 -0
  152. package/dist/packem_shared/advisories-DZd1uGqa.js +1 -0
  153. package/dist/packem_shared/affected-selection-CoRXp5H4.js +1 -0
  154. package/dist/packem_shared/affected-shas-Dd0P7fGD.js +1 -0
  155. package/dist/packem_shared/ai-analysis-DSQQDFU9.js +68 -0
  156. package/dist/packem_shared/ai-fix-6nXZbecQ.js +43 -0
  157. package/dist/packem_shared/augment-COAiXSIx.js +4 -0
  158. package/dist/packem_shared/bin-C2eYtJ_N.js +1 -0
  159. package/dist/packem_shared/build-scripts-pdVmqXRm.js +1 -0
  160. package/dist/packem_shared/clean-DRiLimTx.js +1 -0
  161. package/dist/packem_shared/command-runtime-CiLVo4ED.js +1 -0
  162. package/dist/packem_shared/{compile-cache-B_Vf_WxT.js → compile-cache-DoMHRsRZ.js} +1 -1
  163. package/dist/packem_shared/createAdapter-F7GidOzU.js +1 -0
  164. package/dist/packem_shared/createVersionActions-ByaJ1Nbv.js +1 -0
  165. package/dist/packem_shared/cyclonedx-B1vzerwP.js +4 -0
  166. package/dist/packem_shared/dependency-scan-DBH2Qo4I.js +1 -0
  167. package/dist/packem_shared/docker-Bex05Qcn.js +59 -0
  168. package/dist/packem_shared/failure-log-D92tM0ie.js +2 -0
  169. package/dist/packem_shared/formatBytes-BHAzNIrn-DFIppnY0.js +4 -0
  170. package/dist/packem_shared/getRandomSpinner-4ZEcbTYv-DCyIuj19.js +1 -0
  171. package/dist/packem_shared/giget-D8Kwb0kD.js +2 -0
  172. package/dist/packem_shared/glob-Cyk1H9ZL-ox19CSsT.js +1 -0
  173. package/dist/packem_shared/index-B4AjSxHU.js +1 -0
  174. package/dist/packem_shared/index-BisalDCf.js +39 -0
  175. package/dist/packem_shared/{index-BWl4DbMp.js → index-BjdW45xX.js} +1 -1
  176. package/dist/packem_shared/index-DHD8wb6Z.js +22 -0
  177. package/dist/packem_shared/index-DXPSWMbG.js +1 -0
  178. package/dist/packem_shared/index.server-BAjDJSEu.js +2 -0
  179. package/dist/packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js +1 -0
  180. package/dist/packem_shared/license-DvlYdo6T.js +1 -0
  181. package/dist/packem_shared/lifecycle-CfTZQHOG.js +2 -0
  182. package/dist/packem_shared/lockfile-35RFsJDs.js +1 -0
  183. package/dist/packem_shared/lockfile-DhHAaHN5.js +1 -0
  184. package/dist/packem_shared/main-BP-w-K-6.js +1 -0
  185. package/dist/packem_shared/manifests-BNSmpPF_.js +1 -0
  186. package/dist/packem_shared/min-release-age-ChzTC7_I.js +34 -0
  187. package/dist/packem_shared/missing-package-json-C0keIt78.js +1 -0
  188. package/dist/packem_shared/native-config-sync-BSzU4qUO.js +21 -0
  189. package/dist/packem_shared/osv-bloom-1JS__1or.js +2 -0
  190. package/dist/packem_shared/otelPlugin-D8LL2-4L.js +1 -0
  191. package/dist/packem_shared/package-version-Bb7KGF36.js +4 -0
  192. package/dist/packem_shared/packument-C55kVxcQ.js +1 -0
  193. package/dist/packem_shared/{peer-warnings-BXAzXqY3.js → peer-warnings-CmYSxvql.js} +1 -1
  194. package/dist/packem_shared/pm-runner-de-jCq8q.js +1 -0
  195. package/dist/packem_shared/project-name-filter-DYaIbrXa.js +7 -0
  196. package/dist/packem_shared/{prompt-BSAy8SMH.js → prompt-DMzaQEVa.js} +1 -1
  197. package/dist/packem_shared/provenance-CvfQEJPQ.js +1 -0
  198. package/dist/packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js +1 -0
  199. package/dist/packem_shared/registry-keys-DmBrAlhg.js +1 -0
  200. package/dist/packem_shared/resolve-explicit-DYaHAVDg.js +5 -0
  201. package/dist/packem_shared/resolve-runtime-C7NBCA1C.js +1 -0
  202. package/dist/packem_shared/run-file-jMngGQhs.js +1 -0
  203. package/dist/packem_shared/runtime-check-BklgEMkC.js +1 -0
  204. package/dist/packem_shared/s1ngularity-C8sva2SO.js +1 -0
  205. package/dist/packem_shared/scan-progress-aVHGZYWf.js +2 -0
  206. package/dist/packem_shared/selectors-B7lSFz7l.js +3 -0
  207. package/dist/packem_shared/signatures-oZ_2IneN.js +2 -0
  208. package/dist/packem_shared/{slug-DoueYuLo.js → slug-OBHcH7wV.js} +1 -1
  209. package/dist/packem_shared/spinner-CbJfWYwB.js +1 -0
  210. package/dist/packem_shared/sticky-comment-DjhyCIZt.js +1 -0
  211. package/dist/packem_shared/subtree-DtmcKAJK.js +2 -0
  212. package/dist/packem_shared/symbols-BXDZ_sKt.js +1 -0
  213. package/dist/packem_shared/tabs-BilwonkM.js +1 -0
  214. package/dist/packem_shared/target-merge-DCGow6Kw.js +4 -0
  215. package/dist/packem_shared/target-options-d_rIrLyq.js +1 -0
  216. package/dist/packem_shared/toolchain-DY11tPCw.js +5 -0
  217. package/dist/packem_shared/typosquats-Cdsnf6aN.js +1 -0
  218. package/dist/packem_shared/use-measured-height-BPQg2q_p.js +1 -0
  219. package/dist/packem_shared/utils-DQFHJn72.js +1 -0
  220. package/dist/packem_shared/verify-D8wYvB85.js +1 -0
  221. package/dist/packem_shared/vis-update-app-ngwL2mRv.js +1 -0
  222. package/dist/packem_shared/vis-user-error-CAu9wIbe.js +30 -0
  223. package/dist/packem_shared/watch-Dswvj6Zp.js +1 -0
  224. package/dist/packem_shared/watch-loop-COWvvSbR.js +11 -0
  225. package/dist/packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js +1 -0
  226. package/dist/release/core/changelog/index.d.ts +62 -2
  227. package/dist/release/core/package-managers/index.d.ts +25 -1
  228. package/dist/release/core/package-managers/index.js +1 -1
  229. package/dist/release/core/version-actions/index.d.ts +47 -2
  230. package/dist/release/core/version-actions/index.js +1 -1
  231. package/dist/release/index.d.ts +100 -1
  232. package/dist/release/index.js +1 -1
  233. package/dist/release/plugin-sdk.d.ts +16 -1
  234. package/dist/release/plugin-sdk.js +1 -1
  235. package/dist/release/presets.js +1 -1
  236. package/dist/release/types.js +1 -1
  237. package/dist/runtime/preload.js +1 -1
  238. package/index.js +26 -26
  239. package/package.json +14 -14
  240. package/dist/packem_chunks/detect2.js +0 -8
  241. package/dist/packem_chunks/registry.js +0 -48
  242. package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +0 -1
  243. package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +0 -1
  244. package/dist/packem_shared/advisories-DsXRmIA5.js +0 -1
  245. package/dist/packem_shared/affected-selection-BE6VFCDV.js +0 -1
  246. package/dist/packem_shared/affected-shas-BKEu4RZc.js +0 -1
  247. package/dist/packem_shared/ai-analysis-DikAj6rX.js +0 -68
  248. package/dist/packem_shared/ai-fix-bfWo0cZX.js +0 -43
  249. package/dist/packem_shared/augment-BkJxi_GW.js +0 -4
  250. package/dist/packem_shared/bin-B-TytgzW.js +0 -1
  251. package/dist/packem_shared/build-scripts-DWypBQ--.js +0 -1
  252. package/dist/packem_shared/clean-DWjQl14S.js +0 -1
  253. package/dist/packem_shared/command-runtime-DQ7ZpLYL.js +0 -1
  254. package/dist/packem_shared/createAdapter-bU4DIP3F.js +0 -1
  255. package/dist/packem_shared/createVersionActions-BK43SNDH.js +0 -1
  256. package/dist/packem_shared/cyclonedx-DLBi65MV.js +0 -4
  257. package/dist/packem_shared/dependency-scan-ZLOuLkGN.js +0 -1
  258. package/dist/packem_shared/docker-B4zAZCZG.js +0 -59
  259. package/dist/packem_shared/en-BDYMmM2_.js +0 -27
  260. package/dist/packem_shared/failure-log-DyhWPqno.js +0 -2
  261. package/dist/packem_shared/giget-CAxjpwew.js +0 -2
  262. package/dist/packem_shared/glob-BUjyjdE8-Dp_QcayW.js +0 -1
  263. package/dist/packem_shared/index-BAe6e0XE.js +0 -1
  264. package/dist/packem_shared/index-BLtnel38.js +0 -35
  265. package/dist/packem_shared/index-CuKDxOCI.js +0 -1
  266. package/dist/packem_shared/index-tNFGWxc0.js +0 -39
  267. package/dist/packem_shared/index.server-CusjRLCh.js +0 -2
  268. package/dist/packem_shared/license-t5KnNX6v.js +0 -1
  269. package/dist/packem_shared/lifecycle-KY9umOg6.js +0 -2
  270. package/dist/packem_shared/lockfile-YAuZf1gh.js +0 -1
  271. package/dist/packem_shared/main-D_cam4hv.js +0 -1
  272. package/dist/packem_shared/manifests-BwTn_1ad.js +0 -1
  273. package/dist/packem_shared/min-release-age-6avfn81h.js +0 -34
  274. package/dist/packem_shared/missing-package-json-Cl0vdz6K.js +0 -1
  275. package/dist/packem_shared/native-config-sync-CHMCJx7H.js +0 -21
  276. package/dist/packem_shared/osv-bloom-DdqDnLCt.js +0 -2
  277. package/dist/packem_shared/otelPlugin-DmKDBaPo.js +0 -1
  278. package/dist/packem_shared/package-version-BNRJ3o9C.js +0 -4
  279. package/dist/packem_shared/packument-B9-WqReu.js +0 -1
  280. package/dist/packem_shared/pm-runner-DRybtzOV.js +0 -1
  281. package/dist/packem_shared/project-name-filter-Dw0fC6IO.js +0 -7
  282. package/dist/packem_shared/provenance-CLxuqCfL.js +0 -1
  283. package/dist/packem_shared/readJsonSync-DweZd5ZA-CtrDlqpb.js +0 -1
  284. package/dist/packem_shared/registry-keys-cTN24144.js +0 -1
  285. package/dist/packem_shared/resolve-explicit-Uw6WQl9R.js +0 -5
  286. package/dist/packem_shared/resolve-runtime-DztanwkZ.js +0 -1
  287. package/dist/packem_shared/run-file-CaE5_xBY.js +0 -1
  288. package/dist/packem_shared/runtime-check-C32yE57I.js +0 -1
  289. package/dist/packem_shared/s1ngularity-BIYhg82u.js +0 -1
  290. package/dist/packem_shared/scan-progress-DWfY4zkp.js +0 -2
  291. package/dist/packem_shared/selectors-D2j4M9Ul.js +0 -3
  292. package/dist/packem_shared/signatures-C8iQ5fUq.js +0 -2
  293. package/dist/packem_shared/sticky-comment-D6_7-w8T.js +0 -1
  294. package/dist/packem_shared/subtree-DSm0QEoE.js +0 -2
  295. package/dist/packem_shared/symbols-DPTlrJ3B.js +0 -1
  296. package/dist/packem_shared/target-merge-DLxJTcxn.js +0 -11
  297. package/dist/packem_shared/target-options-3t4-2F-F.js +0 -1
  298. package/dist/packem_shared/toolchain-BPzbahcQ.js +0 -5
  299. package/dist/packem_shared/typosquats-BWrmhh36.js +0 -1
  300. package/dist/packem_shared/use-measured-height-BwAwGHjw.js +0 -1
  301. package/dist/packem_shared/utils-CRueU43T.js +0 -1
  302. package/dist/packem_shared/verify-CzUPT6Uk.js +0 -1
  303. package/dist/packem_shared/vis-update-app-D6Wq8ZHM.js +0 -1
  304. package/dist/packem_shared/vis-user-error-CfM4_ORo.js +0 -30
  305. package/dist/packem_shared/watch-D_oAxW_Z.js +0 -1
  306. package/dist/packem_shared/watch-loop-BrjblOz5.js +0 -11
@@ -0,0 +1 @@
1
+ import{createRequire as X}from"node:module";import{X as j,b as T}from"./index.server-BAjDJSEu.js";import{e as A}from"./index-DHD8wb6Z.js";import{g as L}from"./formatBytes-BHAzNIrn-DFIppnY0.js";import{D as m,m as y}from"./provenance-CvfQEJPQ.js";import{g as E}from"./packument-C55kVxcQ.js";import{c as w}from"../packem_chunks/cli-main.js";import{y as U}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as O}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";import{h as C}from"./writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{s as p}from"./index-B4AjSxHU.js";let Y;const Q=r=>(Y??=X(import.meta.url))(r),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=r=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[e,t]=b.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return b.getBuiltinModule(r)}return Q(r)},{rmSync:D,writeFileSync:P}=$("node:fs"),{createHash:Z}=$("node:crypto"),{Resolver:ee}=$("node:dns/promises");class rr{entries=[];add(e){this.entries.push(e)}addMany(e){for(const t of e)this.entries.push(t)}all(){return this.entries}errors(){return this.entries.filter(e=>e.severity==="error")}warnings(){return this.entries.filter(e=>e.severity==="warning")}hasErrors(){return this.entries.some(e=>e.severity==="error")}hasWarnings(){return this.entries.some(e=>e.severity==="warning")}isEmpty(){return this.entries.length===0}size(){return this.entries.length}}const tr=r=>{if(r.length===0)return[];const e=[],t=r.filter(s=>s.severity==="error"),n=r.filter(s=>s.severity==="warning");if(t.length>0){e.push(j(`${String(t.length)} error${t.length===1?"":"s"}:`));for(const s of t)e.push(` ${j("✗")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${T("→")} ${s.suggestedAction}`)}if(n.length>0){t.length>0&&e.push(""),e.push(T(`${String(n.length)} warning${n.length===1?"":"s"}:`));for(const s of n)e.push(` ${T("⚠")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${T("→")} ${s.suggestedAction}`)}return e},nr=r=>({errors:r.filter(e=>e.severity==="error"),findings:[...r],summary:{errorCount:r.filter(e=>e.severity==="error").length,warningCount:r.filter(e=>e.severity==="warning").length},warnings:r.filter(e=>e.severity==="warning")}),re=1440*60*1e3,te=15e3,ne="https://api.github.com/repos",W=()=>A(L(),"archived-repo"),q=(r,e)=>A(W(),`${encodeURIComponent(r)}__${encodeURIComponent(e)}.json`),se=(r,e)=>{const t=q(r,e);if(U(t))try{const n=O(t);if(Date.now()-n.createdAt>n.ttlMs){D(t,{force:!0});return}return n}catch{D(t,{force:!0});return}},B=(r,e,t,n)=>{C(W());const s={createdAt:Date.now(),ttlMs:n,...t};P(q(r,e),JSON.stringify(s),"utf8")},oe=r=>{if(typeof r!="string"||r.trim()==="")return;const e=r.trim().replace(/^git\+/,""),t=/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(t)return{owner:t[1],repo:t[2]};const n=/^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(n)return{owner:n[1],repo:n[2]};const s=/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/?#]+?)(?:\.git)?\/?$/i.exec(e);if(s)return{owner:s[1],repo:s[2]}},ie=async(r,e,t,n)=>{const s=`${ne}/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,l=new AbortController,o=setTimeout(()=>{l.abort()},te),i=()=>{l.abort()};n?.addEventListener("abort",i,{once:!0});const a={Accept:"application/vnd.github+json","User-Agent":"visulima-vis-marshall"};t!==void 0&&t!==""&&(a.Authorization=`Bearer ${t}`);try{const c=await fetch(s,{headers:a,signal:l.signal});if(c.status===404)return{kind:"missing"};if(!c.ok)return{kind:"transient-error"};const d=await c.json(),u=d.archived===!0,f=typeof d.archived_at=="string"?d.archived_at:void 0;return{archived:u,archivedAt:f,kind:"ok"}}catch{return{kind:"transient-error"}}finally{clearTimeout(o),n?.removeEventListener("abort",i)}},ae=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),sr=async(r,e={})=>{if(w("archivedRepo"))return[];const t=new Set(e.allowlist),n=e.cacheTtlMs??re,s=e.githubToken??process.env.GITHUB_TOKEN,l=e.concurrency??m,o=new Map,i=async(c,d)=>{const u=`${c}/${d}`;let f=o.get(u);return f===void 0&&(f=(async()=>{const h=se(c,d);if(h!==void 0)return h.missing===!0?{archived:!1,kind:"missing"}:{archived:h.archived,archivedAt:h.archivedAt,kind:"ok"};const v=await ie(c,d,s,e.signal);return v.kind==="missing"?B(c,d,{archived:!1,missing:!0},n):v.kind==="ok"&&B(c,d,{archived:v.archived===!0,archivedAt:v.archivedAt},n),v})(),o.set(u,f)),f};return(await y(r,l,async({name:c,version:d})=>{if(t.has(c))return;const u=await E(c,{workspaceRoot:e.workspaceRoot});if(u===void 0)return;const f=u.versions[d]??u.versions[ae(Object.keys(u.versions),u["dist-tags"]?.latest)??""];if(f===void 0)return;const h=oe(f.repository?.url);if(h===void 0)return;const v=await i(h.owner,h.repo);if(v.kind!=="transient-error"){if(v.kind==="missing")return{kind:"missing-repo",owner:h.owner,packageName:c,repo:h.repo};if(v.archived===!0)return{...v.archivedAt===void 0?{}:{archivedAt:v.archivedAt},kind:"archived",owner:h.owner,packageName:c,repo:h.repo}}})).filter(c=>c!==void 0)},ce={dormantErrorDays:274,dormantWarnDays:183,newPublisherWindowDays:21,recentVersionErrorDays:7,recentVersionWarnDays:30},de=1440*60*1e3,F=(r,e)=>(r-e)/de,_=r=>{if(r!==void 0)return r.email??r.name},ue=(r,e,t,n,s)=>{const l=r.time?.[t];if(l===void 0)return;const o=new Date(l).getTime();if(!Number.isFinite(o))return;const i=F(n,o);if(i<s.recentVersionErrorDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (error threshold: ${String(s.recentVersionErrorDays)})`,packageName:e,severity:"error",version:t};if(i<s.recentVersionWarnDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (warn threshold: ${String(s.recentVersionWarnDays)})`,packageName:e,severity:"warning",version:t}},le=(r,e,t,n,s)=>{const l=r.versions[t],o=_(l?._npmUser);if(o===void 0)return;const a=Object.keys(r.versions).filter(h=>p.valid(h)!==null).filter(h=>p.lt(h,t));if(a.length===0||a.some(h=>_(r.versions[h]?._npmUser)===o))return;const d=r.time?.[a[0]??""];if(d===void 0)return;const u=new Date(d).getTime();if(!Number.isFinite(u))return;const f=F(n,u);if(!(f<=s.newPublisherWindowDays))return{kind:"new-publisher",message:`first publish by ${o} on a ${f.toFixed(0)}-day-old package`,packageName:e,severity:"error",version:t}},fe=(r,e,t,n,s)=>{const l=r.versions[t],o=_(l?._npmUser);if(o===void 0)return;const i=[];for(const[d,u]of Object.entries(r.versions)){if(d===t||_(u._npmUser)!==o)continue;const f=r.time?.[d];if(f===void 0)continue;const h=new Date(f).getTime();Number.isFinite(h)&&i.push(h)}if(i.length===0)return;const a=Math.max(...i),c=F(n,a);if(c>=s.dormantErrorDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${c.toFixed(0)} days ago (error threshold: ${String(s.dormantErrorDays)})`,packageName:e,severity:"error",version:t};if(c>=s.dormantWarnDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${c.toFixed(0)} days ago (warn threshold: ${String(s.dormantWarnDays)})`,packageName:e,severity:"warning",version:t}},or=async(r,e={})=>{if(w("author"))return[];const t=new Set(e.allowlist),n={...ce,...e.thresholds},s=e.now??(()=>Date.now()),l=e.concurrency??m;return(await y(r,l,async({name:i,version:a})=>{if(t.has(i))return[];const c=await E(i,{cacheTtlMs:e.cacheTtlMs,signal:e.signal,workspaceRoot:e.workspaceRoot});if(c===void 0)return[];const d=s(),u=[],f=ue(c,i,a,d,n);f!==void 0&&u.push(f);const h=le(c,i,a,d,n);h!==void 0&&u.push(h);const v=fe(c,i,a,d,n);return v!==void 0&&u.push(v),u})).flat()},he=1440*60*1e3,ve=15e3,ge=20,pe=1e4,me="https://api.npmjs.org/downloads/point/last-month",G=()=>A(L(),"downloads"),J=r=>A(G(),`${encodeURIComponent(r)}.json`),ye=r=>{const e=J(r);if(U(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){D(e,{force:!0});return}return t.downloads}catch{D(e,{force:!0});return}},we=(r,e,t)=>{C(G());const n={createdAt:Date.now(),downloads:e,observedAt:new Date().toISOString(),ttlMs:t};P(J(r),JSON.stringify(n),"utf8")},ke=async(r,e)=>{const t=`${me}/${encodeURIComponent(r)}`,n=new AbortController,s=setTimeout(()=>{n.abort()},ve),l=()=>{n.abort()};e?.addEventListener("abort",l,{once:!0});try{const o=await fetch(t,{signal:n.signal});if(o.status===404)return{kind:"no-data"};if(!o.ok)return{kind:"error"};const i=await o.json();return typeof i.downloads=="number"?{downloads:i.downloads,kind:"ok"}:{kind:"no-data"}}catch{return{kind:"error"}}finally{clearTimeout(s),e?.removeEventListener("abort",l)}},ir=async(r,e={})=>{if(w("downloads"))return[];const t=new Set(e.allowlist),n=e.errorThreshold??ge,s=e.warnThreshold??pe,l=e.cacheTtlMs??he,o=e.concurrency??m;return(await y(r,o,async a=>{if(t.has(a))return;let d=ye(a);if(d===void 0){const u=await ke(a,e.signal);if(u.kind==="no-data"||u.kind==="error")return{downloadsLastMonth:void 0,kind:"no-data",packageName:a,severity:"warning"};d=u.downloads??0,we(a,d,l)}if(d<n)return{downloadsLastMonth:d,kind:"below-error",packageName:a,severity:"error"};if(d<s)return{downloadsLastMonth:d,kind:"below-warning",packageName:a,severity:"warning"}})).filter(a=>a!==void 0)},De=1440*60*1e3,Ae=4e3,Ee=["1.1.1.1","8.8.8.8"],K=()=>A(L(),"expired-domains"),z=r=>{const e=Z("sha256").update(r).digest("hex").slice(0,12);return A(K(),`${e}.json`)},be=r=>{const e=z(r);if(U(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){D(e,{force:!0});return}return t}catch{D(e,{force:!0});return}},Re=(r,e,t)=>{C(K());const n={createdAt:Date.now(),outcome:e,ttlMs:t};P(z(r),JSON.stringify(n),"utf8")},Te=r=>{if(typeof r!="string")return;const e=r.lastIndexOf("@");if(e===-1||e===r.length-1)return;const t=r.slice(e+1).trim().toLowerCase();return t===""?void 0:t},_e=(r,e)=>{const t=[];e!==void 0&&t.push(e);for(const n of r??[])t.push(n);return t},Me=async(r,e)=>{let t;try{return await Promise.race([r,new Promise((n,s)=>{t=setTimeout(()=>{s(new Error("ETIMEDOUT"))},e)})])}finally{t!==void 0&&clearTimeout(t)}},Se=r=>{if(r===null||typeof r!="object")return!1;const{code:e}=r;return e==="ENOTFOUND"||e==="ENODATA"||e==="NXDOMAIN"},$e=async(r,e,t)=>{try{const n=await Me(r.resolveNs(e),t);return Array.isArray(n)&&n.length>0?{kind:"ok"}:{kind:"expired"}}catch(n){return Se(n)?{kind:"expired"}:{kind:"transient-error"}}},Pe=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),ar=async(r,e={})=>{if(w("expiredDomains"))return[];const t=new Set(e.allowlist),n=new Set((e.allowDomains??[]).map(f=>f.toLowerCase())),s=e.cacheTtlMs??De,l=e.perDomainTimeoutMs??Ae,o=e.dnsServers??Ee,i=e.concurrency??m,a=e.createResolver===void 0?new ee:e.createResolver();typeof a.setServers=="function"&&a.setServers(o);const c=new Map,d=async f=>{let h=c.get(f);return h===void 0&&(h=(async()=>{const v=be(f);if(v!==void 0)return{kind:v.outcome==="ok"?"ok":"expired"};const g=await $e(a,f,l);return g.kind!=="transient-error"&&Re(f,g.kind,s),g})(),c.set(f,h)),h};return(await y(r,i,async({name:f,version:h})=>{if(t.has(f))return[];const v=await E(f,{workspaceRoot:e.workspaceRoot});if(v===void 0)return[];const g=v.versions[h]??v.versions[Pe(Object.keys(v.versions),v["dist-tags"]?.latest)??""];if(g===void 0)return[];const M=_e(g.maintainers,g._npmUser),N=new Set,S=[];for(const R of M){const k=Te(R.email);if(k===void 0||n.has(k))continue;const I=`${k}:${R.email??""}`;if(N.has(I))continue;N.add(I);const x=await d(k);x.kind==="expired"?S.push({domain:k,kind:"expired",maintainer:R.email??"",packageName:f,severity:"error"}):x.kind==="transient-error"&&S.push({domain:k,kind:"unresolved",maintainer:R.email??"",packageName:f,severity:"warning"})}return S})).flat()},Le=["readme","license","repo"],Ue=["ERROR: No README data found!","# Security holding package"],Oe=r=>{const e=r.trim();return e===""?!0:Ue.some(t=>e.startsWith(t))},Ce=(r,e)=>{if(typeof e.readme=="string")return e.readme;if(typeof r.readme=="string")return r.readme},Fe=(r,e)=>{const t=Ce(r,e);if(t===void 0)return"missing-readme";if(Oe(t))return"placeholder-readme"},Ne=r=>{const{license:e}=r;return e===void 0?"missing-license":typeof e=="string"?e.trim()===""?"missing-license":void 0:typeof e.type=="string"&&e.type.trim()!==""?void 0:"missing-license"},Ie=r=>{const{repository:e}=r;if(e===void 0)return"missing-repo";const t=typeof e.url=="string"?e.url.trim():"";if(t==="")return"missing-repo";let n=t.replace(/^git\+/,"");const s=/^git@([^:]+):(.+?)(?:\.git)?$/.exec(n);return s&&(n=`https://${s[1]}/${s[2]}`),URL.canParse(n)?void 0:"invalid-repo-url"},xe=r=>{const e=r["dist-tags"]?.latest;return e!==void 0&&Object.hasOwn(r.versions,e)?e:Object.keys(r.versions).at(-1)},cr=async(r,e={})=>{if(w("metadata"))return[];const t=new Set(e.allowlist),n=new Set(e.checks??Le),s=e.concurrency??m;return(await y(r,s,async({name:o,version:i})=>{if(t.has(o))return;const a=await E(o,{workspaceRoot:e.workspaceRoot});if(a===void 0)return;const c=a.versions[i]??a.versions[xe(a)??""];if(c===void 0||c.private===!0)return;const d=[];if(n.has("readme")){const u=Fe(a,c);u!==void 0&&d.push(u)}if(n.has("license")){const u=Ne(c);u!==void 0&&d.push(u)}if(n.has("repo")){const u=Ie(c);u!==void 0&&d.push(u)}if(d.length!==0)return{issues:d,packageName:o,version:i}})).filter(o=>o!==void 0)},H=(r,e)=>r===void 0?{}:typeof r=="string"?{[e.startsWith("@")?e.split("/").at(1)??e:e]:r}:{...r},je=(r,e)=>p.valid(e)?Object.keys(r.versions).filter(n=>p.valid(n)!==null&&p.lt(n,e)).sort((n,s)=>p.lt(n,s)?1:-1)[0]:void 0,dr=async(r,e={})=>{if(w("newBin"))return[];const t=new Set(e.allowlist),n=new Set(e.allowBins),s=e.concurrency??m;return(await y(r,s,async({name:o,version:i})=>{if(t.has(o))return;const a=await E(o,{workspaceRoot:e.workspaceRoot});if(a===void 0)return;const c=a.versions[i];if(c===void 0)return;const d=je(a,i);if(d===void 0)return;const u=a.versions[d];if(u===void 0)return;const f=H(c.bin,o),h=H(u.bin,o),v=Object.entries(f).filter(([g])=>!(g in h)).filter(([g])=>!n.has(g)).map(([g,M])=>({command:M,name:g}));if(v.length!==0)return{fromVersion:d,newBins:v,packageName:o,toVersion:i}})).filter(o=>o!==void 0)},Be=["preinstall","install","postinstall"],V=(r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,He=(r,e)=>{if(p.valid(e)!==null)return Object.keys(r.versions).filter(t=>p.valid(t)!==null&&p.prerelease(t)===null&&p.lt(t,e)).sort((t,n)=>p.lt(t,n)?1:-1)[0]},Ve=(r,e)=>{const t=r??{},n=e??{},s=[];for(const l of Be){const o=t[l];if(o===void 0||o==="")continue;const i=n[l];i===void 0||i===""?s.push({command:o,hook:l,kind:"introduced"}):i!==o&&s.push({command:o,hook:l,kind:"changed"})}return s},ur=async(r,e={})=>{if(w("s1ngularity"))return[];const t=new Set(e.allowlist),n=e.concurrency??m;return(await y(r,n,async({name:l,version:o})=>{if(t.has(l))return;const i=await E(l,{workspaceRoot:e.workspaceRoot});if(i?.versions[o]===void 0)return;const a=He(i,o);if(a===void 0||!V(i,a)||V(i,o))return;const c=Ve(i.versions[o]?.scripts,i.versions[a]?.scripts);if(c.length!==0)return{hookChanges:c,packageName:l,priorVersion:a,trustSignal:"provenance-dropped",version:o}})).filter(l=>l!==void 0)};export{rr as M,ur as a,dr as b,cr as c,ir as d,ar as e,sr as f,nr as g,tr as h,or as r};
@@ -0,0 +1,2 @@
1
+ import{F as h,b as S,J as T,X as R}from"./index.server-BAjDJSEu.js";import{C as k,S as l}from"../packem_chunks/cli-main.js";import{i as y}from"./index-BjdW45xX.js";import{y as s,X as d,m as a,R as g}from"../packem_chunks/catalog.js";import{l as $}from"./spinner-CbJfWYwB.js";import{D as j,W as v,T as A,C as D}from"./symbols-BXDZ_sKt.js";const b=({rows:i})=>s.jsx(d,{flexDirection:"column",children:i.map(r=>{let t;switch(r.status){case"error":{t=s.jsx(a,{color:"red",children:D});break}case"ok":{t=s.jsx(a,{color:"green",children:A});break}case"running":{t=s.jsx(a,{color:"white",children:s.jsx($,{type:"dots"})});break}case"warn":{t=s.jsx(a,{color:"yellow",children:v});break}default:{t=s.jsx(a,{dimColor:!0,children:j});break}}return s.jsxs(d,{children:[s.jsx(d,{width:3,children:t}),s.jsx(d,{flexGrow:1,children:s.jsx(a,{children:r.label})}),r.summary?s.jsx(d,{children:s.jsxs(a,{dimColor:!0,children:[j," ",r.summary]})}):null]},r.id)})}),I={error:R(l.failure),ok:T(l.success),pending:h(l.dash),skip:h(l.dash),warn:S(l.warning)},Y=(i,r,t)=>{const p=t?`${i} ${h(`— ${t}`)}`:i;return` ${I[r]} ${p}
2
+ `},M=(i,r={})=>{const t=r.stream??process.stderr,w=typeof t.isTTY=="boolean"&&t.isTTY&&!y,C=r.live??w,n=new Map;for(const e of i)n.set(e.id,{id:e.id,label:e.label,status:"pending"});if(!C||i.length===0)return{finish:(e,o,m)=>{const c=n.get(e);c&&(n.set(e,{...c,status:o,summary:m}),t.write(Y(c.label,o,m)))},start:e=>{const o=n.get(e);o&&n.set(e,{...o,status:"running"})},stop:()=>{}};const x=()=>i.map(e=>n.get(e.id));let u=k(g.createElement(b,{rows:x()}),{interactive:!0,patchConsole:!1});const f=()=>{u?.rerender(g.createElement(b,{rows:x()}))};return{finish:(e,o,m)=>{const c=n.get(e);c&&(n.set(e,{...c,status:o,summary:m}),f())},start:e=>{const o=n.get(e);o&&(n.set(e,{...o,status:"running"}),f())},stop:()=>{u&&(f(),u.unmount(),u=void 0)}}};export{M as s};
@@ -0,0 +1,3 @@
1
+ import{createRequire as m}from"node:module";import{a as E}from"./index-DHD8wb6Z.js";let _;const w=t=>(_??=m(import.meta.url))(t),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=t=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[r,e]=g.versions.node.split(".").map(Number);if(r>22||r===22&&e>=3||r===20&&e>=16)return g.getBuiltinModule(t)}return w(t)},{createInterface:v}=y("node:readline"),T=/^#([\w\-/]+):(.+)$/,$=/^([@\w\-/]+):(.+)$/,b=t=>{if(t==="")return;if(t.startsWith(":"))return{kind:"all",target:t.slice(1)};if(t.startsWith("~:"))return{kind:"closest",target:t.slice(2)};const r=T.exec(t);if(r?.[1]&&r[2])return{kind:"tag",tag:r[1],target:r[2]};const e=$.exec(t);return e?.[1]&&e[2]&&(e[1].startsWith("@")||e[1].includes("/")||e[1].includes("-"))?{kind:"project",projects:[e[1]],target:e[2]}:{kind:"all",target:t}},x=async(t,r,e,a)=>{const s=b(t);if(!s)throw new Error(`Invalid target selector: "${t}"`);const o=Object.keys(r.projects);if(s.kind==="all")return{projects:o,target:s.target};if(s.kind==="project")return{projects:s.projects??[],target:s.target};if(s.kind==="tag"){const c=s.tag;return{projects:o.filter(l=>r.projects[l]?.tags?.includes(c)??!1),target:s.target}}const n=E(a,e)||".";let u,f=-1;for(const[c,i]of Object.entries(r.projects)){const l=i.root;if(!l)continue;(n===l||n.startsWith(`${l}/`))&&l.length>f&&(f=l.length,u=c)}if(!u){if(process.stdout.isTTY){const c=v({input:process.stdin,output:process.stderr}),i=Object.keys(r.projects).sort();process.stderr.write(`No project found at ${n}. Pick one:
2
+ `);for(const[d,h]of i.entries())process.stderr.write(` ${String(d+1)}) ${h}
3
+ `);const l=await new Promise(d=>{c.question("> ",d)});c.close();const p=Number.parseInt(l,10)-1;if(p>=0&&p<i.length)return{projects:[i[p]],target:s.target}}throw new Error(`No project found at or above ${n} for selector "${t}".`)}return{projects:[u],target:s.target}},P=/^(\w+)\s*(!?=)\s*(.+)$/,R=t=>{const r=t.trim();if(r==="")return;const e=r.split("&&").map(c=>c.trim()),a=r.split("||").map(c=>c.trim()),s=e.length>1,o=a.length>1;if(s&&o)throw new Error("Query language does not support mixed && / || — split into multiple --query flags or simplify.");const n=o?a:e,u=o?"||":"&&",f=[];for(const c of n){const i=P.exec(c);if(!i)throw new Error(`Invalid query clause: "${c}". Expected <field>=<value> or <field>!=<value>.`);const[,l,p,d]=i;f.push({field:l,op:p==="!="?"!=":"=",value:d.trim().replaceAll(/^["']|["']$/g,"")})}return{clauses:f,op:u}},j=(t,r,e)=>{const{field:a,op:s,value:o}=t,n=f=>{const c=f===o;return s==="="?c:!c},u=f=>{const i=(f??[]).includes(o);return s==="="?i:!i};switch(a){case"id":case"project":return n(r);case"language":return n(e.language);case"layer":return n(e.layer);case"projectType":case"type":return n(e.projectType);case"stack":return n(e.stack);case"tag":case"tags":return u(e.tags);default:return!1}},A=(t,r,e)=>{const a=(e??[]).flatMap(o=>o.split(",")).map(o=>o.trim()).filter(Boolean);if(a.length===0)return t;const s=new Set(a);return t.filter(o=>{const n=r.projects[o]?.tags;return Array.isArray(n)&&n.some(u=>s.has(u))})},O=(t,r,e)=>{if(!e||e.trim()==="")return t;const a=R(e);return a?t.filter(s=>{const o=r.projects[s];return o?a.op==="&&"?a.clauses.every(n=>j(n,s,o)):a.clauses.some(n=>j(n,s,o)):!1}):t};export{A as a,O as f,b as p,x as r};
@@ -0,0 +1,2 @@
1
+ import{createRequire as w}from"node:module";import{D as N,m as x}from"./provenance-CvfQEJPQ.js";import{g as P}from"./packument-C55kVxcQ.js";import{c as b}from"../packem_chunks/cli-main.js";import{f as E}from"./registry-keys-DmBrAlhg.js";let _;const $=s=>(_??=w(import.meta.url))(s),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=s=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,r]=u.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return u.getBuiltinModule(s)}return $(s)},{createPublicKey:M,createVerify:R}=v("node:crypto"),B=s=>{const e=["-----BEGIN PUBLIC KEY-----"],r=s.replaceAll(/\s+/g,"");for(let n=0;n<r.length;n+=64)e.push(r.slice(n,n+64));return e.push("-----END PUBLIC KEY-----"),e.join(`
2
+ `)},j=({keyBase64:s,message:e,signatureBase64:r})=>{try{const n=M({format:"pem",key:B(s)}),c=R("SHA256");return c.update(e),c.end(),c.verify(n,Buffer.from(r,"base64"))}catch{return!1}},A=(s,e)=>{if(s.expires===void 0||s.expires==="")return!1;const r=Date.parse(s.expires);return Number.isNaN(r)?!1:r<=e},C=(s,e,r)=>`${s}@${e}:${r}`,S=(s,e)=>e!==void 0&&s.includes(e)?e:s.at(-1),Y=async(s,e={})=>{if(b("signatures"))return[];const r=new Set(e.allowlist),n=e.treatExpiredAs??"warning",c=e.concurrency??N,p=await E({keysUrl:e.keysUrl,signal:e.signal,ttlMs:e.keysTtlMs});if(p===void 0)return s.filter(({name:t})=>!r.has(t)).map(({name:t,version:i})=>({code:"fetch-failed",message:"Could not fetch registry signing keys.",packageName:t,severity:"warning",version:i}));const k=new Map;for(const t of p.keys)k.set(t.keyid,t);const m=Date.now();return(await x(s,c,async({name:t,version:i})=>{if(r.has(t))return[];const o=await P(t,{workspaceRoot:e.workspaceRoot});if(o===void 0)return[];const y=o.versions[i]??o.versions[S(Object.keys(o.versions),o["dist-tags"]?.latest)??""];if(y===void 0)return[];const f=y.dist?.signatures,l=y.dist?.integrity;if(f===void 0||f.length===0)return[{code:"missing-signature",message:`Package ${t}@${i} has no dist.signatures from the registry.`,packageName:t,severity:"warning",version:i}];if(typeof l!="string"||l==="")return[{code:"missing-signature",message:`Package ${t}@${i} has signatures but no dist.integrity to verify against.`,packageName:t,severity:"warning",version:i}];const h=C(t,i,l),g=[];for(const a of f){const d=k.get(a.keyid);if(d===void 0){g.push({code:"unknown-keyid",keyid:a.keyid,message:`Package ${t}@${i} was signed with an unrecognized keyid (${a.keyid}).`,packageName:t,severity:"error",version:i});continue}if(A(d,m)){g.push({code:"expired-key",keyid:a.keyid,message:`Package ${t}@${i} was signed with an expired key (${a.keyid}, expired ${d.expires??"unknown"}).`,packageName:t,severity:n,version:i});continue}j({keyBase64:d.key,message:h,signatureBase64:a.sig})||g.push({code:"invalid-signature",keyid:a.keyid,message:`Package ${t}@${i} signature did not verify against ${a.keyid}.`,packageName:t,severity:"error",version:i})}return g})).flat()};export{Y as r};
@@ -1 +1 @@
1
- const e=["amber","azure","blue","brave","calm","clever","cool","dazzle","eager","fancy","gentle","happy","icy","jolly","keen","lively","merry","neat","ocean","polite","quiet","rapid","sleek","tidy","upbeat","vivid","warm","xenial","yummy","zesty","fox","owl","lynx","otter","deer","hawk","wren","seal","newt","frog"],a=()=>e[Math.floor(Math.random()*e.length)]??"neat",l=()=>`${a()}-${a()}`,r=t=>`${t}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`;export{r as a,l as r};
1
+ const e=["amber","azure","blue","brave","calm","clever","cool","dazzle","eager","fancy","gentle","happy","icy","jolly","keen","lively","merry","neat","ocean","polite","quiet","rapid","sleek","tidy","upbeat","vivid","warm","xenial","yummy","zesty","fox","owl","lynx","otter","deer","hawk","wren","seal","newt","frog"],a=()=>e[Math.floor(Math.random()*e.length)]??"neat",o=()=>`${a()}-${a()}`,n=t=>`${t}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`;export{n as a,o as r};
@@ -0,0 +1 @@
1
+ import{u as r,y as C,m as K}from"../packem_chunks/catalog.js";import{W as h}from"./getRandomSpinner-4ZEcbTYv-DCyIuj19.js";import{k as S}from"../packem_chunks/cli-main.js";const R=100,T=2147483647,l={delta:0,frame:0,time:0};function j(s){const{interval:i=R,isActive:e=!0}=s??{},t=L(i),{renderThrottleMs:c,subscribe:v}=r.useContext(S),[n,A]=r.useState(0),[M,p]=r.useState(l),o=r.useRef(0),f=r.useRef(0),y=r.useRef({isActive:e,resetKey:n,safeInterval:t}),m=y.current,E=e&&(t!==m.safeInterval||!m.isActive||n!==m.resetKey),b=r.useCallback(()=>{A(u=>u+1)},[]);return r.useLayoutEffect(()=>{if(!e)return;p(l);let u=0;const{startTime:d,unsubscribe:I}=v(a=>{if(c>0&&a<o.current)return;const x=a-u,k=a-f.current;f.current=a,o.current=a+c,p({delta:k,frame:Math.floor(x/t),time:x})},t);return u=d,f.current=d,o.current=u+c,I},[t,e,v,c,n]),r.useLayoutEffect(()=>{y.current={isActive:e,resetKey:n,safeInterval:t}},[e,t,n]),E?{...l,reset:b}:{...M,reset:b}}function L(s){return Number.isFinite(s)?Math.min(T,Math.max(1,s)):R}function D({type:s="dots"}){const i=h(s)??h("dots"),e=i?.frames??[" "],{frame:t}=j({interval:i?.interval??80});return C.jsx(K,{children:e[t%e.length]})}export{D as l};
@@ -0,0 +1 @@
1
+ import{detectRemoteProvider as n,createRemoteClient as s}from"../packem_chunks/detect.js";const i=t=>t??process.env.GITLAB_HOST,a=async t=>{const e=await n(t.cwd,t.runner,void 0),r=s(e,{gitlabHost:i(t.gitlabHost)}),{runner:o,...c}=t;return delete c.gitlabHost,r.upsertStickyComment(o,c)},d=async(t,e,r={})=>{const o=await n(e,t,void 0);return s(o,{gitlabHost:i(r.gitlabHost)}).detectRepoSlug(e,t)},b=(t,e={})=>{const r=l(t);return s(r,{gitlabHost:i(e.gitlabHost)}).detectPullRequestNumber(t)},l=t=>t.GITHUB_ACTIONS==="true"||t.GITHUB_REPOSITORY||t.GITHUB_REF?"github":t.GITLAB_CI==="true"||t.CI_PROJECT_PATH||t.CI_MERGE_REQUEST_IID?"gitlab":"github";export{b as a,d,a as u};
@@ -0,0 +1,2 @@
1
+ import{createRequire as p}from"node:module";let m;const f=s=>(m??=p(import.meta.url))(s),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=s=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[e,t]=a.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return a.getBuiltinModule(s)}return f(s)},{spawnSync:h}=l("node:child_process"),g=64*1024*1024,n=(s,e)=>{const t=h("git",s,{cwd:e,encoding:"utf8",maxBuffer:g});if(t.error)throw new Error(`Failed to spawn git ${s.join(" ")}: ${t.error.message}`,{cause:t.error});return{status:typeof t.status=="number"?t.status:1,stderr:typeof t.stderr=="string"?t.stderr:"",stdout:typeof t.stdout=="string"?t.stdout:""}},_=(s,e)=>{const t=(e.stderr||e.stdout).trim();return`git ${s.join(" ")} failed (exit ${e.status})${t?`:
2
+ ${t}`:""}`},o=(s,e,t=n)=>{const r=t(s,e);if(r.status!==0)throw new Error(_(s,r));return r.stdout.trim()},w=(s,e=n)=>{const t=e(["rev-parse","--is-inside-work-tree"],s);if(t.status!==0||t.stdout.trim()!=="true")throw new Error(`Not a git repository: ${s}. Run inside a git working tree.`)},b=(s,e=n)=>o(["status","--porcelain"],s,e).length===0,R=(s,e=n)=>{if(!b(s,e))throw new Error("Working tree has uncommitted changes. Commit or stash them before running this command.")},j=({annotate:s,branch:e,cwd:t,prefix:r,runner:i=n})=>{const u=["subtree","split",`--prefix=${r}`];return s&&u.push(`--annotate=${s}`),u.push("-b",e),o(u,t,i),o(["rev-parse",e],t,i)},y=({cwd:s,message:e,prefix:t,ref:r,repo:i,runner:u=n,squash:d})=>{const c=["subtree","add",`--prefix=${t}`];d&&c.push("--squash"),e&&c.push("-m",e),c.push(i,r),o(c,s,u)},v=({branch:s,runner:e=n,source:t,sourceBranch:r,target:i})=>{o(["init","-b",s],i,e),o(["pull",t,r],i,e)},B=(s,e,t=n)=>{o(["branch","-D",s],e,t)},E=(s,e,t,r=n)=>{o(["remote","add",s,e],t,r)},N=(s,e,t,r=n)=>{o(["push","-u",s,e],t,r)},k=(s,e,t=n)=>{const r=o(["rev-list","--count",s],e,t),i=Number.parseInt(r,10);return Number.isNaN(i)?0:i},q=(s,e,t,r=n)=>{o(["rm","-r",s],t,r),o(["commit","-m",e],t,r)};export{w as a,R as b,E as c,k as d,B as e,y as f,v as i,N as p,q as r,j as s};
@@ -0,0 +1 @@
1
+ const o=()=>process.platform==="win32"?!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color":process.env.TERM!=="linux",s=o(),e=s?"✓":"√",n=s?"✖":"×",c=s?"…":"...",r=s?"—":"-",t=s?"⚠":"!";export{n as C,r as D,c as E,e as T,t as W};
@@ -0,0 +1 @@
1
+ import{y as u,u as o,X as y,m as A}from"../packem_chunks/catalog.js";import{u as H}from"../packem_chunks/cli-main.js";function _({children:n}){return u.jsx(u.Fragment,{children:n})}const L=/^\d$/u,U=n=>n!=null&&typeof n=="object"&&"props"in n&&"name"in n.props,V=n=>{const s=[];for(const t of o.Children.toArray(n))U(t)&&s.push(t);return s},S=(n,s)=>n.some(t=>s[t]),W=(n,s,t)=>n?s?{backgroundColor:t?.activeTab?.backgroundColor??"green",color:t?.activeTab?.color??"black"}:{backgroundColor:"gray",color:"black"}:{backgroundColor:void 0,color:void 0};function J({children:n,colors:s,defaultValue:t,flexDirection:b="row",isFocused:x,keyMap:a,onChange:M,showIndex:$=!0,value:k,width:g}){const l=V(n),c=l.length,d=o.useRef(l);d.current=l;const i=b==="column"||b==="column-reverse",C=k!==void 0,[q,z]=o.useState(()=>{const r=k??t;if(r==null||c===0)return 0;const e=l.findIndex(p=>p.props.name===r);return e===-1?0:e}),h=C?Math.max(0,l.findIndex(r=>r.props.name===k)):q,B=o.useCallback(()=>{},[]),f=C?B:z,m=o.useRef(M);m.current=M,o.useEffect(()=>{if(C)return;const r=d.current[h];r&&m.current(r.props.name,r)},[]);const R=o.useMemo(()=>a?.previous??[i?"upArrow":"leftArrow"],[a?.previous,i]),D=o.useMemo(()=>a?.next??[i?"downArrow":"rightArrow"],[a?.next,i]),I=a?.useNumbers??!0,T=a?.useTab??!0,w=o.useRef(h);w.current=h;const E=o.useCallback(r=>{f(r);const e=d.current[r];e&&m.current(e.props.name,e)},[f]),j=o.useCallback(()=>{const r=(w.current+1)%c;f(r);const e=d.current[r];e&&m.current(e.props.name,e)},[c,f]),v=o.useCallback(()=>{const r=(w.current-1+c)%c;f(r);const e=d.current[r];e&&m.current(e.props.name,e)},[c,f]);H(o.useCallback((r,e)=>{if(S(R,e)){v();return}if(S(D,e)){j();return}if(e.tab&&T&&x==null){e.shift?v():j();return}if(I&&e.meta&&L.test(r)){const p=r==="0"?9:Number.parseInt(r,10)-1;p<c&&E(p)}},[R,D,T,I,x,v,j,c,E]),{isActive:x!==!1});const X=typeof g=="number"?g:6,G=o.useMemo(()=>i?"─".repeat(X):" | ",[i,X]);return u.jsx(y,{flexDirection:b,width:g,children:l.map((r,e)=>{const{name:p}=r.props,F=W(h===e,x!==!1,s);let N=null;return $&&(N=u.jsxs(A,{color:"grey",children:[e+1,"."," "]})),u.jsxs(y,{flexDirection:b,children:[e!==0&&u.jsx(A,{color:"dim",children:G}),u.jsxs(y,{children:[N,u.jsx(A,{backgroundColor:F.backgroundColor,color:F.color,children:r})]})]},p)})})}export{_ as a,J as n};
@@ -0,0 +1,4 @@
1
+ import{createRequire as re}from"node:module";import{_ as ue}from"./index-DHD8wb6Z.js";import{y as ae}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{U as fe}from"./writeFileSync-DJoHk3Ks-CgQ-VNNT.js";let ie;const ce=e=>(ie??=re(import.meta.url))(e),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,le=e=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[t,s]=x.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return x.getBuiltinModule(e)}return ce(e)},{createRequire:ee}=le("node:module"),pe=/^(?:( )+|\t+)/,M="space";function W(e,t,s){return e&&t===M&&s===1}function H(e,t){const s=new Map;let o=0,r,n;for(const c of e.split(/\n/g)){if(!c)continue;const i=c.match(pe);if(i===null)o=0,r="";else{const d=i[0].length,a=i[1]?M:"tab";if(W(t,a,d))continue;a!==r&&(o=0),r=a;let l=1,u=0;const f=d-o;if(o=d,f===0)l=0,u=1;else{const g=Math.abs(f);if(W(t,a,g))continue;n=de(a,g)}const p=s.get(n);s.set(n,p===void 0?[1,0]:[p[0]+l,p[1]+u])}}return s}function de(e,t){return(e===M?"s":"t")+String(t)}function me(e){const t=e[0]==="s"?M:"tab",s=Number(e.slice(1));return{type:t,amount:s}}function ge(e){let t,s=0,o=0;for(const[r,[n,c]]of e)(n>s||n===s&&c>o)&&(s=n,o=c,t=r);return t}function he(e,t){return(e===M?" ":" ").repeat(t)}function be(e){if(typeof e!="string")throw new TypeError("Expected a string");let t=H(e,!0);t.size===0&&(t=H(e,!1));const s=ge(t);let o,r=0,n="";return s!==void 0&&({type:o,amount:r}=me(s),n=he(o,r)),{amount:r,type:o,indent:n}}let ye;const ve=e=>(ye??=ee(import.meta.url))(e),T=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,we=e=>{if(typeof T<"u"&&T.versions&&T.versions.node){const[t,s]=T.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return T.getBuiltinModule(e)}return ve(e)},{readFileSync:xe}=we("node:fs"),Ot=(e,t,s={})=>{const{detectIndent:o,indent:r,replacer:n,stringify:c=JSON.stringify,...i}={indent:" ",...s};let d=r,a=`
2
+ `;if(ae(e,ue))try{const u=xe(e,"utf8");if(o){const{indent:f}=be(u);d=f}a=u.endsWith(`
3
+ `)?`
4
+ `:""}catch(u){if(u.code!=="ENOENT")throw u}const l=c(t,n,d);fe(e,`${l}${a}`,i)};let Te;const ke=e=>(Te??=ee(import.meta.url))(e),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,te=e=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[t,s]=v.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return v.getBuiltinModule(e)}return ke(e)},{homedir:Ee,tmpdir:D}=te("node:os"),{env:A,cwd:$e,platform:G}=v,{createRequire:h}=te("node:module"),Ne=0,se=2,Se=Symbol("findUpStop"),_e=/^[A-Z]:\//i,y=(e="")=>e&&e.replaceAll("\\","/").replace(_e,t=>t.toUpperCase()),Ce=/^[/\\]{2}/,ze=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,L=/^[A-Z]:$/i,je=/[^/](\.[^./]+)$/,Ie=/^[/\\]|^[a-z]:[/\\]/i,Ae=/\/$/,Me=()=>{if(typeof process.cwd=="function")try{const e=process.cwd();if(typeof e=="string")return y(e)}catch{}return"/"},F="/",oe=(e,t)=>{let s="",o=0,r=-1,n=0,c;for(let i=0;i<=e.length;++i){if(i<e.length)c=e[i];else{if(c==="/")break;c="/"}if(c==="/"){if(!(r===i-1||n===1))if(n===2){if(s.length<2||o!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const d=s.lastIndexOf("/");d===-1?(s="",o=0):(s=s.slice(0,d),o=s.length-1-s.lastIndexOf("/")),r=i,n=0;continue}else if(s.length>0){s="",o=0,r=i,n=0;continue}}t&&(s+=s.length>0?"/..":"..",o=2)}else s.length>0?s+=`/${e.slice(r+1,i)}`:s=e.slice(r+1,i),o=i-r-1;r=i,n=0}else c==="."&&n!==-1?++n:n=-1}return s},b=e=>ze.test(e),Oe=function(e){if(e.length===0)return".";e=y(e);const t=Ce.exec(e),s=b(e),o=e.at(-1)==="/";return e=oe(e,!s),e.length===0?s?"/":o?"./":".":(o&&(e+="/"),L.test(e)&&(e+="/"),t?s?`//${e}`:`//./${e}`:s&&!b(e)?`/${e}`:e)},m=(...e)=>{let t="";for(const s of e)if(s)if(t.length>0){const o=t.at(-1)==="/",r=s[0]==="/";o&&r?t+=s.slice(1):t+=o||r?s:`/${s}`}else t+=s;return Oe(t)},O=function(...e){e=e.map(o=>y(o));let t="",s=!1;for(let o=e.length-1;o>=-1&&!s;o--){const r=o>=0?e[o]:Me();!r||r.length===0||(t=`${r}/${t}`,s=b(r))}return t=oe(t,!s),L.test(t)?`${t}/`:s&&!b(t)?`/${t}`:t.length>0?t:"."},Re=function(e){return je.exec(y(e))?.[1]??""},U=e=>{const t=y(e).replace(Ae,""),s=t.lastIndexOf("/");if(s===-1)return b(e)?"/":".";const o=t.slice(0,s);return L.test(o)?`${o}/`:o||(b(e)?"/":".")},De=(e,t)=>{const s=y(e);return s.slice(s.lastIndexOf("/")+1)},Fe=function(e){const t=Ie.exec(e)?.[0]?.replaceAll("\\","/")??"",s=De(e),o=Re(s);return{base:s,dir:U(e),ext:o,name:s.slice(0,s.length-o.length),root:t}};let Be;const Le=e=>(Be??=h(import.meta.url))(e),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ue=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[t,s]=k.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return k.getBuiltinModule(e)}return Le(e)},{fileURLToPath:Pe}=Ue("node:url");function qe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V,Z;function We(){return Z||(Z=1,V=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),V}var He=We();const Ge=qe(He);new Set(Ge);const w=e=>y(e instanceof URL?Pe(e):e),ne=e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},X=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"};let Ve;const Ze=e=>(Ve??=h(import.meta.url))(e),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xe=e=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[t,s]=E.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return E.getBuiltinModule(e)}return Ze(e)},{lstat:Rt,mkdir:Dt}=Xe("node:fs/promises");let Ye;const Je=e=>(Ye??=h(import.meta.url))(e),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ke=e=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[t,s]=$.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return $.getBuiltinModule(e)}return Je(e)},{lstatSync:Y,mkdirSync:Qe}=Ke("node:fs"),N=e=>{ne(e);try{const t=Y(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(X(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{Qe(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const s=Y(e);if(!s.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(X(s))}'`,{cause:t})}};let et;const tt=e=>(et??=h(import.meta.url))(e),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,st=e=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[t,s]=S.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return S.getBuiltinModule(e)}return tt(e)},{stat:Ft,lstat:Bt}=st("node:fs/promises");let ot;const nt=e=>(ot??=h(import.meta.url))(e),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,rt=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[t,s]=_.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return _.getBuiltinModule(e)}return nt(e)},{statSync:it,lstatSync:ct}=rt("node:fs"),lt=(e,t={})=>{const s=t.cwd?w(t.cwd):process.cwd();let o=O(s);const{root:r}=Fe(o),n=w(t.stopAt??r),c=O(o,n),i=t.type??"file",d=function(l){return[e]};t.allowSymlinks??=!0;const a=t.allowSymlinks?it:ct;for(;o;){for(let l of d()){if(l===Se)return;if(l===void 0)continue;Buffer.isBuffer(l)?l=l.toString():l instanceof URL&&(l=w(l));const u=b(l)?l:O(o,l);try{const f=a(u);if(i==="file"&&f.isFile()||i==="directory"&&f.isDirectory())return u}catch{}}if(o===c||o===r)break;o=U(o)}};let ut;const at=e=>(ut??=h(import.meta.url))(e),C=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ft=e=>{if(typeof C<"u"&&C.versions&&C.versions.node){const[t,s]=C.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return C.getBuiltinModule(e)}return at(e)},{access:Lt}=ft("node:fs/promises");let pt;const dt=e=>(pt??=h(import.meta.url))(e),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,mt=e=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[t,s]=z.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return z.getBuiltinModule(e)}return dt(e)},{accessSync:gt}=mt("node:fs");function R(e,t=Ne){ne(e),e=w(e);try{return gt(e,t),!0}catch{return!1}}class ht extends Error{constructor(t){super(`ENOENT: ${t}`)}get code(){return"ENOENT"}set code(t){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(t){throw new Error("Cannot overwrite name of NotFoundError")}}let bt;const yt=e=>(bt??=h(import.meta.url))(e),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,P=e=>{if(typeof j<"u"&&j.versions&&j.versions.node){const[t,s]=j.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return j.getBuiltinModule(e)}return yt(e)},vt=P("fs"),wt=P("os"),xt=P("path");var B={},J;function Tt(){if(J)return B;J=1;var e=Object.defineProperty,t=(l,u)=>e(l,"name",{value:u,configurable:!0}),s=vt,o=wt,r=xt;const n=t(l=>{let u="";for(let f=0;f<l.length;f+=1){const p=l[f],g=p.toUpperCase();u+=p===g?p.toLowerCase():g}return u},"invertCase"),c=new Map,i=t((l,u)=>{const f=r.join(l,`.is-fs-case-sensitive-test-${process.pid}`);try{return u.writeFileSync(f,""),!u.existsSync(n(f))}finally{try{u.unlinkSync(f)}catch{}}},"checkDirectoryCaseWithWrite"),d=t((l,u,f)=>{try{return i(l,f)}catch(p){if(u===void 0)return i(o.tmpdir(),f);throw p}},"checkDirectoryCaseWithFallback"),a=t((l,u=s,f=!0)=>{const p=l??process.cwd();if(f&&c.has(p))return c.get(p);let g;const q=n(p);return q!==p&&u.existsSync(p)?g=!u.existsSync(q):g=d(p,l,u),f&&c.set(p,g),g},"isFsCaseSensitive");return B.isFsCaseSensitive=a,B}var kt=Tt();kt.isFsCaseSensitive;const K=e=>{const t=Ee();if(G==="win32"){const n=A.LOCALAPPDATA,c=t?m(t,"AppData","Local"):D(),i=n&&n.length>0?n:c;return m(i,e,"Cache")}if(G==="darwin"){const n=t?m(t,"Library","Caches"):D();return m(n,e)}const s=A.XDG_CACHE_HOME,o=t?m(t,".cache"):D(),r=s&&s.length>0?s:o;return m(r,e)},Et=e=>{if(e.length===0)return;const t=e.map(n=>O(w(n)).split(F));let s=Number.POSITIVE_INFINITY;for(const n of t)n.length<s&&(s=n.length);const o=[];for(let n=0;n<s;n+=1){const c=t[0][n];if(t.every(i=>i[n]===c))o.push(c);else break}const r=o.join(F);return r===""?F:r},I=(e,t)=>{if(e!==void 0)return t?(...s)=>m(e,...s):e},$t=e=>{if(e?.files&&e.files.length>0){const t=Et(e.files);if(t!==void 0)return t}return e?.cwd??$e()},Nt=e=>new ht(`No package.json found searching upwards from '${w(e)}'.`),St=e=>!R(e,se)&&R(e),_t=(e,t)=>{if(A.CACHE_DIR&&!["0","1","false","true"].includes(A.CACHE_DIR)){const a=m(A.CACHE_DIR,e);return t?.create&&N(a),I(a,t?.thunk)}const s=$t(t),o=lt("package.json",{cwd:s,type:"file"});if(!o){if(t?.useGlobalCacheFallback){const a=K(e);return t.create&&N(a),I(a,t.thunk)}if(t?.throwError)throw Nt(s);return}const r=U(o),n=m(r,"node_modules"),c=m(n,".cache"),i=m(c,e);if(R(i,se))return t?.create&&N(i),I(i,t?.thunk);const d=[i,c,n];if(R(n)||d.push(r),d.some(a=>St(a))){if(t?.useGlobalCacheFallback){const a=K(e);return t.create&&N(a),I(a,t.thunk)}return}return t?.create&&N(i),I(i,t?.thunk)},Ut=_t,Q="@inherit",Ct=["aliases","dependsOn","inputs","outputs"],zt=(e,t)=>{if(t===void 0)return e===void 0?void 0:[...e];if(!t.includes(Q))return[...t];const s=[];for(const o of t){if(o===Q){e!==void 0&&s.push(...e);continue}s.push(o)}return s},Pt=(e,t)=>{const s={...e,...t};for(const o of Ct){const r=e?.[o],n=t?.[o],c=zt(r,n);c===void 0?delete s[o]:s[o]=c}return s};export{Ot as T,Pt as m,Ut as w};
@@ -0,0 +1 @@
1
+ import{createRequire as b}from"node:module";import{v as m,e as _,z as C}from"./index-DHD8wb6Z.js";import{y as T}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";let g;const y=e=>(g??=b(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[s,r]=h.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return h.getBuiltinModule(e)}return y(e)},{platform:S}=I("node:os"),k={server:{cache:!1,interactive:!1,persistent:!0,runInCI:!1},utility:{cache:!1,runInCI:!1}},A=e=>{const s=e.preset??e.options?.preset;if(!s)return e;const r=k[s];if(!r)return e;const{cache:t,...n}=r;return{...e,cache:e.cache??t,options:{...n,...e.options}}},v=()=>{const e=S();return e==="darwin"?"macos":e==="win32"?"windows":"linux"},D=(e,s)=>{if(!s||s.size===0)return!0;const r=e?.runnerTags;return!r||r.length===0?!0:r.some(t=>s.has(t))},E=(e,s,r=!0)=>{const t=e?.runInCI??!0;return t===!0||t==="always"?!0:t===!1?!s:t==="affected"?!s||r:!0},N=(e,s,r)=>r||!s?e:m(s)?s:_(e,s),O=(e,s)=>{if(s===!1)return{};const r=s===!0?P(process.env.NODE_ENV):Array.isArray(s)?s:[s],t={};for(const n of r)Object.assign(t,$(e,n,t));return t},w=(e,s)=>{const r=n=>{const c=s[n];return c!==void 0?c:process.env[n]??""};let t="";for(let n=0;n<e.length;n+=1){const c=e[n];if(c==="\\"&&e[n+1]==="$"){t+="$",n+=1;continue}if(c!=="$"){t+=c;continue}const u=e[n+1];if(u==="{"){let i=1,l=n+2;for(;l<e.length;){const d=e[l];if(d==="}"){if(i-=1,i===0)break}else d==="{"&&e[l-1]==="$"&&(i+=1);l+=1}if(i!==0){t+=e.slice(n);break}const a=l,o=e.slice(n+2,a),f=o.indexOf(":-");if(f===-1)t+=r(o);else{const d=o.slice(0,f),x=o.slice(f+2),p=s[d]??process.env[d];t+=p!==void 0&&p!==""?p:w(x,s)}n=a;continue}if(u!==void 0&&/[A-Z_]/i.test(u)){let i=n+1;for(;i<e.length&&/\w/.test(e[i]);)i+=1;t+=r(e.slice(n+1,i)),n=i-1;continue}t+=c}return t},P=e=>{const s=[".env"];return e&&s.push(`.env.${e}`),e!=="test"&&s.push(".env.local"),e&&e!=="test"&&s.push(`.env.${e}.local`),s},$=(e,s,r={})=>{const t=m(s)?s:_(e,s);if(!T(t))return{};let n;try{n=C(t)}catch{return{}}const c={};for(const u of n.split(/\r?\n/)){const i=u.trim();if(i===""||i.startsWith("#"))continue;const l=i.indexOf("=");if(l===-1)continue;const a=i.slice(0,l).trim();if(a==="")continue;let o=i.slice(l+1).trim();const f=o.length>=2&&o.startsWith("'")&&o.endsWith("'");(o.startsWith('"')&&o.endsWith('"')||f)&&(o=o.slice(1,-1)),f||(o=w(o,{...r,...c})),c[a]=o}return c},z=(e,s=v())=>{if(e)return s==="windows"&&e.windowsShell?e.windowsShell:(s==="linux"||s==="macos")&&e.unixShell?e.unixShell:e.shell},B=e=>{if(e==="run")return!1;if(e==="build"||e==="test")return!0};export{z as a,A as b,B as c,v as d,O as l,D as m,N as r,E as s};
@@ -0,0 +1,5 @@
1
+ import{createRequire as z}from"node:module";import{e as p,b as H,z as M}from"./index-DHD8wb6Z.js";import{y as v}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as A}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";let B;const D=e=>(B??=z(import.meta.url))(e),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[n,t]=k.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return k.getBuiltinModule(e)}return D(e)},{execFileSync:P}=T("node:child_process"),{randomBytes:L}=T("node:crypto"),{writeFileSync:V,renameSync:q,unlinkSync:R}=T("node:fs"),{delimiter:U}=T("node:path"),J=["proto","mise","fnm","volta","asdf","nvm","corepack"],G={asdf:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],corepack:["npm","pnpm","yarn"],fnm:["node"],mise:["aube","bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],nvm:["node"],proto:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],volta:["node","npm","pnpm","yarn"]},Z=["proto","mise","fnm","volta","asdf","nvm","corepack"],O={asdf:[".tool-versions"],corepack:[],fnm:[".nvmrc",".node-version"],mise:[".mise.toml",".config/mise.toml","mise.toml"],nvm:[".nvmrc"],proto:[".prototools"],volta:[]},y=new Map,b=e=>{const n=y.get(e);if(n!==void 0||y.has(e))return n;const t=process.env.PATH;if(!t){y.set(e,void 0);return}const o=process.platform==="win32"?["",...(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";")]:[""];for(const i of t.split(U)){const c=i.replaceAll(/^["']|["']$/g,"").trim();if(c!=="")for(const s of o){const a=`${c}${H}${e}${s}`;if(v(a))return y.set(e,a),a}}y.set(e,void 0)},S=(e,n=["--version"])=>{try{const t=P(e,n,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}),r=/\d+\.\d+(?:\.\d+)?/.exec(t);return r?r[0]:t.trim()||void 0}catch{return}},j=(e,n)=>{const t=p(e,"package.json");if(!v(t))return[];try{const o=A(t)[n];if(n==="volta"&&typeof o=="object"&&o!==null&&Object.keys(o).length>0)return["package.json"];if(n==="packageManager"&&typeof o=="string"&&o.length>0)return["package.json"]}catch{}return[]},X=(e,n)=>e==="volta"?j(n,"volta"):e==="corepack"?j(n,"packageManager"):O[e].filter(t=>v(p(n,t))),x=new Map,Y=()=>{x.clear(),y.clear()},N=(e,n)=>{{const i=x.get(e);if(i)return i}const t=[],r=!!b("pnpm")||!!b("yarn");for(const i of Z){const c=i==="nvm"?void 0:b(i),s=i==="nvm"&&!!process.env.NVM_DIR,a=X(i,e),l=!!c||s;i==="corepack"&&!l&&(!(a.length>0)||r)||!l&&a.length===0||t.push({binPath:c,configFiles:a,installed:l,name:i,version:c?S(c):void 0})}const o=Object.freeze(t);return x.set(e,o),o},$n=(e,n,t)=>{const r=N(e);return n?.preferredManager&&n.preferredManager!=="none"?r.find(o=>o.name===n.preferredManager)??{configFiles:[],installed:!1,name:n.preferredManager}:r.find(o=>o.installed&&o.configFiles.length>0)??r.find(o=>o.installed)??r.find(o=>o.configFiles.length>0)??{configFiles:[],installed:!1,name:"none"}},K=(e,n)=>{for(const t of n){const r=p(e,t);if(v(r))try{const o=M(r).trim();if(o!=="")return{name:t,value:o.replace(/^v/,"")}}catch{}}},Q=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,nn=e=>{const n=p(e,".prototools");if(!v(n))return[];const t=M(n),r=[];let o=!1;for(const i of t.split(/\r?\n/)){const c=i.trim();if(c===""||c.startsWith("#"))continue;if(c.startsWith("[")){o=!0;continue}if(o)continue;const s=Q.exec(c);if(!s)continue;const[,a,l]=s,f=g(a);f&&r.push({source:".prototools",tool:f,version:l.trim()})}return r},en=/^\[tools\]\s*$/i,tn=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,on=e=>{for(const n of O.mise){const t=p(e,n);if(!v(t))continue;const r=[],o=M(t);let i=!1;for(const c of o.split(/\r?\n/)){const s=c.trim();if(s===""||s.startsWith("#"))continue;if(s.startsWith("[")){i=en.test(s);continue}if(!i)continue;const a=tn.exec(s);if(!a)continue;const[,l,f]=a,d=g(l);d&&r.push({source:".mise.toml",tool:d,version:f.trim()})}if(r.length>0)return r}return[]},rn=e=>{const n=p(e,".tool-versions");if(!v(n))return[];const t=M(n),r=[];for(const o of t.split(/\r?\n/)){const i=o.trim();if(i===""||i.startsWith("#"))continue;const c=i.split(/\s+/);if(c.length<2)continue;const[s,...a]=c,l=g(s);l&&a[0]&&r.push({source:".tool-versions",tool:l,version:a[0]})}return r},g=e=>{switch(e.toLowerCase()){case"aube":return"aube";case"bun":return"bun";case"deno":return"deno";case"go":case"golang":return"go";case"node":case"nodejs":return"node";case"npm":return"npm";case"pnpm":return"pnpm";case"python":case"python3":return"python";case"ruby":return"ruby";case"rust":case"rustc":return"rust";case"yarn":return"yarn";default:return}},sn=e=>{const[n]=e.split("+",1),t=/^(pnpm|yarn|npm|bun)@(.+)$/.exec(n??"");if(!t)return;const r=g(t[1]);if(r)return{source:"packageManager",tool:r,version:t[2]}},an=(e,n)=>{const t=new Map,r=s=>{t.set(s.tool,s)},o=p(e,"package.json");let i={};try{v(o)&&(i=A(o))}catch{}if(i.engines)for(const[s,a]of Object.entries(i.engines)){const l=g(s);l&&typeof a=="string"&&r({source:"engines",tool:l,version:a})}if(i.packageManager){const s=sn(i.packageManager);s&&r(s)}if(i.volta)for(const[s,a]of Object.entries(i.volta)){const l=g(s);l&&typeof a=="string"&&r({source:"volta",tool:l,version:a})}const c=K(e,[".nvmrc",".node-version"]);c&&r({source:c.name===".nvmrc"?".nvmrc":".node-version",tool:"node",version:c.value});for(const s of rn(e))r(s);for(const s of on(e))r(s);for(const s of nn(e))r(s);if(n?.tools)for(const[s,a]of Object.entries(n.tools)){const l=g(s);l&&typeof a=="string"&&r({source:"vis.config.ts",tool:l,version:a})}return[...t.values()]},E={aube:{args:["--version"],binaries:["aube"]},bun:{args:["--version"],binaries:["bun"]},deno:{args:["--version"],binaries:["deno"]},go:{args:["version"],binaries:["go"]},node:{args:["--version"],binaries:["node"]},npm:{args:["--version"],binaries:["npm"]},pnpm:{args:["--version"],binaries:["pnpm"]},python:{args:["--version"],binaries:["python","python3"]},ruby:{args:["--version"],binaries:["ruby"]},rust:{args:["--version"],binaries:["rustc"]},yarn:{args:["--version"],binaries:["yarn"]}},F=e=>{const n=E[e];for(const t of n.binaries){const r=b(t);if(r)return S(r,n.args)}if(e==="node")return process.versions.node},W=(e,n)=>{const t=n.trim();if(t===""||t==="*"||t==="latest")return!0;if(/^\d[\d.]*$/.test(t))return e===t||e.startsWith(`${t}.`);const r=s=>s.split(/[.\-+]/).map(a=>Number.parseInt(a,10)||0),o=(s,a)=>{const l=r(s),f=r(a),d=Math.max(l.length,f.length);for(let h=0;h<d;h++){const $=l[h]??0,u=f[h]??0;if($!==u)return $-u}return 0},i=s=>{for(const a of s)if(a.startsWith(">=")){if(o(e,a.slice(2).trim())<0)return!1}else if(a.startsWith("<=")){if(o(e,a.slice(2).trim())>0)return!1}else if(a.startsWith(">")){if(o(e,a.slice(1).trim())<=0)return!1}else if(a.startsWith("<")){if(o(e,a.slice(1).trim())>=0)return!1}else if(a.startsWith("^")||a.startsWith("~")){const l=a.slice(1).trim(),[f,d]=r(l),[h,$]=r(e);if(h!==f||a.startsWith("~")&&$!==d||o(e,l)<0)return!1}return!0},c=t.split("||").map(s=>s.trim().split(/\s+/).filter(Boolean)).filter(s=>s.length>0);return c.length===0?!0:c.some(s=>i(s))},cn=(e,n)=>{switch(e){case".mise.toml":return["mise"];case".node-version":case".nvmrc":return["fnm","nvm","volta","proto","mise","asdf"];case".prototools":return["proto"];case".tool-versions":return["asdf","mise"];case"packageManager":return n==="pnpm"||n==="yarn"?["self-activate","volta","proto","mise","corepack"]:n==="npm"?["volta","proto","mise","asdf","corepack"]:n==="aube"?["mise"]:n==="bun"?["proto","mise","asdf"]:["volta","proto","mise"];case"volta":return["volta"];default:return["proto","mise","fnm","volta","asdf","nvm","corepack"]}},ln=(e,n,t)=>{if(t?.preferredManager&&t.preferredManager!=="none"&&_(t.preferredManager,e.tool)){const o=n.find(i=>i.name===t.preferredManager);return o?{installed:o.installed,name:o.name}:{installed:!1,name:t.preferredManager,note:`${t.preferredManager} is the preferred manager but isn't on PATH`}}const r=cn(e.source,e.tool);for(const o of r){if(o==="self-activate"){if((e.tool==="pnpm"||e.tool==="yarn")&&b(e.tool))return{installed:!0,name:"self-activate",note:`${e.tool} will activate ${e.version} from the packageManager field on next invocation`};continue}if(!_(o,e.tool))continue;if(n.find(c=>c.name===o)?.installed)return{installed:!0,name:o}}for(const o of r)if(!(o==="self-activate"||!_(o,e.tool)))return{installed:!1,name:o,note:`${o} can install ${e.tool} — run \`vis toolchain install\` after adding it to PATH`};return{installed:!1,name:"none",note:"No manager knows how to install this tool"}},_=(e,n)=>e==="none"?!1:e==="self-activate"?n==="pnpm"||n==="yarn":G[e].includes(n),fn=(e,n)=>{const t=N(e),o=an(e,n).map(i=>{const c=F(i.tool),s=c!==void 0&&W(c,i.version),a=ln(i,t,n);return{actual:c,expected:i,manager:a,matches:s}});return{detected:t,tools:o}},un=(e,n)=>{switch(e){case"asdf":return n?{args:["install",n.tool,n.version],bin:"asdf"}:void 0;case"corepack":return n?{args:["prepare",`${n.tool}@${n.version}`,"--activate"],bin:"corepack"}:{args:["prepare","--activate"],bin:"corepack",hint:"reads the packageManager field in package.json"};case"fnm":return n?.tool!=="node"?void 0:{args:["install",n.version],bin:"fnm"};case"mise":return n?{args:["install",`${n.tool}@${n.version}`],bin:"mise"}:void 0;case"none":return;case"nvm":return{args:[],bin:"nvm",hint:"nvm is a shell function — run `nvm install` / `nvm use` from your shell"};case"proto":return n?{args:["install",n.tool,n.version],bin:"proto"}:void 0;case"self-activate":return{args:[],bin:n?.tool??"pnpm",hint:`${n?.tool??"pnpm"} will self-activate on next invocation — no install needed`};case"volta":return n?{args:["install",`${n.tool}@${n.version}`],bin:"volta"}:{args:["install","node@lts"],bin:"volta",hint:"volta pins per-tool; specify <tool>@<version>"};default:{const t=e;throw new Error(`Unknown manager: ${t}`)}}},yn=(e,n)=>{switch(e){case"asdf":return{args:["local",n.tool,n.version],bin:"asdf",configChange:{file:".tool-versions",hint:`Pins ${n.tool} ${n.version}`}};case"corepack":return n.tool!=="npm"&&n.tool!=="pnpm"&&n.tool!=="yarn"?void 0:{args:["use",`${n.tool}@${n.version}`],bin:"corepack",configChange:{file:"package.json",hint:`Writes packageManager: "${n.tool}@${n.version}"`}};case"fnm":return n.tool==="node"?{args:["use",n.version],bin:"fnm"}:void 0;case"mise":return{args:["use","--",`${n.tool}@${n.version}`],bin:"mise",configChange:{file:".mise.toml",hint:`Pins ${n.tool} ${n.version}`}};case"none":return;case"nvm":return n.tool==="node"?{args:[],bin:"nvm",configChange:{file:".nvmrc",hint:"Write version to .nvmrc manually (nvm doesn't persist)."}}:void 0;case"proto":return{args:["pin",n.tool,n.version],bin:"proto",configChange:{file:".prototools",hint:`Pins ${n.tool} ${n.version}`}};case"self-activate":return{args:[],bin:n.tool,configChange:{file:"package.json",hint:`Set packageManager: "${n.tool}@${n.version}" — ${n.tool} will self-activate on next invocation`}};case"volta":return{args:["pin",`${n.tool}@${n.version}`],bin:"volta",configChange:{file:"package.json",hint:`Writes volta.${n.tool}`}};default:{const t=e;throw new Error(`Unknown manager: ${t}`)}}},Mn=e=>{for(const n of E[e].binaries){const t=b(n);if(t)return t}},wn=(e,n)=>{const t=E[n].binaries;if(e.installed&&e.binPath&&(e.name==="proto"||e.name==="mise"||e.name==="asdf"||e.name==="volta"||e.name==="fnm"))for(const r of t)try{const i=P(e.binPath,["which",r],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}).trim();if(i)return i}catch{}for(const r of t){const o=b(r);if(o)return o}},I=(e,n)=>{const t=`${e}.${process.pid}.${L(6).toString("hex")}.tmp`;V(t,n);try{q(t,e)}catch(r){try{R(t)}catch{}throw r}},dn=(e,n)=>{if("packageManager"in e)return e.packageManager=n,e;const t={};let r=!1;for(const[o,i]of Object.entries(e))!r&&(o==="dependencies"||o==="devDependencies"||o==="peerDependencies"||o==="optionalDependencies")&&(t.packageManager=n,r=!0),t[o]=i;return r||(t.packageManager=n),t},kn=(e,n)=>{if(n.tool!=="pnpm"&&n.tool!=="yarn"&&n.tool!=="npm"&&n.tool!=="bun")return;const t=p(e,"package.json");if(!v(t))throw new Error(`Cannot pin ${n.tool}: ${t} does not exist.`);const r=M(t),i=/\n([ \t]+)/.exec(r)?.[1]??" ";let c;try{c=JSON.parse(r)}catch(f){throw new Error(`${t} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${f.message}`,{cause:f})}const s=`${n.tool}@${n.version}`,a=dn(c,s),l=r.endsWith(`
2
+ `)?`
3
+ `:"";return I(t,`${JSON.stringify(a,void 0,i)}${l}`),s},Tn=(e,n)=>{const t=p(e,"package.json");if(!v(t))return;const r=M(t);let o;try{o=JSON.parse(r)}catch(a){throw new Error(`${t} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${a.message}`,{cause:a})}if(o.engines?.[n.tool]===void 0||o.engines[n.tool]===n.version)return;o.engines[n.tool]=n.version;const c=/\n([ \t]+)/.exec(r)?.[1]??" ",s=r.endsWith(`
4
+ `)?`
5
+ `:"";return I(t,`${JSON.stringify(o,void 0,c)}${s}`),n.version},Pn=e=>{const n=/^([a-z][\w-]*)@(.+)$/i.exec(e.trim());if(!n)return;const t=g(n[1]);if(t)return{source:"vis.config.ts",tool:t,version:n[2]}},mn=async(e,n,t)=>{const r=fn(e,n),o=r.tools.filter(f=>!f.matches);if(o.length===0)return{attempted:[],failed:[],upToDate:!0};const i=r.detected.some(f=>f.installed);if(!(n?.autoInstall??i))return{attempted:[],failed:[],upToDate:!1};const s=[],a=[],l=new Map;for(const f of o){const d=l.get(f.manager.name);d?d.push(f):l.set(f.manager.name,[f])}for(const[f,d]of l){if(f==="self-activate"){for(const{expected:u}of d)t.info(`toolchain: ${u.tool} ${u.version} will self-activate on next ${u.tool} invocation`),s.push(u);continue}if(f==="none"){for(const{expected:u}of d)a.push({error:`no manager can install ${u.tool} — install one of ${J.join(", ")}`,spec:u});continue}if(!r.detected.find(u=>u.name===f)?.installed){for(const{expected:u}of d)a.push({error:`${f} is not on PATH`,spec:u});continue}const $=d.map(u=>({invocation:un(f,u.expected),tool:u})).filter(u=>u.invocation!==void 0);for(const{invocation:u,tool:C}of $){const{expected:m}=C;if(u.bin==="nvm"&&u.args.length===0){const w=F(m.tool);if(w!==void 0&&W(w,m.version)){t.info(`toolchain: ${m.tool} ${w} already satisfies ${m.version}; skipping nvm shell activation`),s.push(m);continue}t.warn(`toolchain: nvm requires a shell-side activation for ${m.tool} ${m.version}. Run \`nvm install\` / \`nvm use\` manually.`),a.push({error:"nvm requires shell-side activation",spec:m});continue}t.info(`toolchain: $ ${u.bin} ${u.args.join(" ")}`);try{P(u.bin,u.args,{cwd:e,stdio:"inherit"}),s.push(m),f==="fnm"&&vn(u.bin,t)}catch(w){a.push({error:w.message,spec:m});break}}}return Y(),{attempted:s,failed:a,upToDate:!1}},_n=async(e,n,t,r=!1)=>{if(r)return;const o=await mn(e,n,t);for(const i of o.failed)t.warn(`toolchain: ${i.spec.tool} ${i.spec.version} — ${i.error}`)},vn=(e,n)=>{const t=process.platform==="win32"?"powershell":"bash";try{const r=P(e,["env","--shell",t],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3});for(const o of r.split(/\r?\n/)){const i=o.trim();if(i==="")continue;const c=/^\$env:([A-Z_]\w*)\s*=\s*(.+)$/i.exec(i);if(c){const[,l,f]=c;process.env[l]=f.replaceAll(/^["']|["']$/g,"");continue}const s=/^set\s+"?([A-Z_]\w*)=(.*?)"?$/i.exec(i);if(s){const[,l,f]=s;process.env[l]=f;continue}const a=/^(?:export\s+)?([A-Z_]\w*)=(.+)$/i.exec(i);if(a){const[,l,f]=a;process.env[l]=f.replaceAll(/^["']|["']$/g,"")}}}catch(r){n.warn(`toolchain: could not activate fnm env (${r.message}). Subsequent tasks may use the previous Node version.`)}};export{J as S,Pn as a,un as b,ln as c,yn as d,wn as e,N as f,fn as g,Mn as h,$n as p,_n as r,Tn as u,kn as w};
@@ -0,0 +1 @@
1
+ import{createRequire as $}from"node:module";import{X as j,b as k}from"./index.server-BAjDJSEu.js";import{e as D}from"./index-DHD8wb6Z.js";import{g as M}from"./_commonjsHelpers-DTfxOvZk.js";import{c as g,p as i}from"../packem_chunks/cli-main.js";import{y as A}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as R}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";let _;const z=e=>(_??=$(import.meta.url))(e),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=e=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[o,r]=l.versions.node.split(".").map(Number);if(o>22||o===22&&r>=3||o===20&&r>=16)return l.getBuiltinModule(e)}return z(e)},{createInterface:S}=T("node:readline");var B=["aj","aju","av","avj","ejv","jav","jv"],C=["angula","angular-node","angularjs"],E=["auto-prefixer"],L=["aaxios","aios","axio","axioos","axios-node","axioss","axis","axiso","axois","axos","axxios"],O=["abel","babbel","babe","babel-js","babel-node","babl","bable","bbael","bebel"],F=["bcrpyt","bcrypt-node","brcypt","crypt","dcrypt"],I=["bcryptjs-node","dcryptjs"],P=["bunan","bunya","bunyan-node","buynan"],U=["cai","cha","chaijs","chal","chi","chia","hai"],W=["cahlk","calk","cchalk","ch4lk","cha1k","chaalk","chaik","chak","chakl","chalk-node","chalkk","challk","chhalk","chlak","chlk","halk","hcalk"],V=["cheero","cherio"],X=["c0lor","ccolor","clor","colo","coloor","color-js","colorjs","colorr","colr","coolor","coolr"],J=["ccolors","colors-node","colorss","colorz","colrs","coolors"],Y=["c0mmander","ccommander","cmmander","cmomander","co-mmander","comamnder","comander","comm4nder","commaander","commader","commadner","commamder","command3r","commandder","commande","commandeer","commander-js","commanderr","commandr","commandre","commanedr","commaner","commannder","commender","commmander","commnader","commnder","coommander","ocmmander","ommander"],G=["cor","corss","cos","cosr","cros","crs","ors"],H=["days"],K=["d3bug","dbeug","dbug","ddebug","debbug","debg","debgu","debu","debu9","debug-js","debug-node","debugg","debugjs","debuug","deebug","deubg","deug","ebug","edbug"],Q=["dot-env","dotenv-node","dotenvjs","dotevn"],Z=["3lectron","eectron","eelctron","eelectron","el3ctron","elcetron","elctron","elecctron","elecron","elecrton","electon","electorn","electr0n","electrn","electrno","electro","electrom","electron-node","electronn","electroon","electrron","electtron","eleectron","eletcron","eletron","ellectron","lectron","leectron"],N=["asbuild","ebuild","esbuild-node","esbuildjs","ezbuild","sbuild"],ee=["aslint","elint","eslint-js","eslint-node","eslit","ezlint","slint"],oe=["eexpress","epress","epxress","experss","expess","exppress","expreess","expres","express-node","expressjs","expresss","exprress","exprses","exprss","exress","exrpess","exxpress","xepress","xpress"],se=["astify"],re=["firebasejs"],te=["form1dable"],ae=["glb","glo","glob-js","globjs","gob","golb","lob"],ce=["go","goot","gotjs","gott","gt","gto","ogt","ot","qot"],ne=["helmetjs","helnet"],ie=["homo","hon","hoo","hoon","ohno","ono"],de=["inquire","inquirer-js","nquirer"],le=["iredis"],me=["ejst","est","jast","jes","jestjs","jestt","jet","jets","jst"],pe=["imp","jim","jip","jmp"],ue=["ji","jio","jo","joii","jol","oi","oji"],he=["jdom","jsdm","jsdo","jsdom-js","jsdon","jsom","sdom"],ve=["jsonwebtoken-js","jsonwebtoken-node"],be=["ka","kao","ko","koaa","koajs","koe","oa","oka"],je=["1odash","iodash","l0dash","ldash","ldoash","llodash","lo-dash","loadsh","loash","lobash","lod4sh","lodaash","lodah","lodahs","lodas","lodash-node","lodashh","lodassh","loddash","lodesh","lodsah","lodsh","loodash","odash","oldash"],ke=["luca","luci","lucie"],fe=["luon","luxo","luxon-js"],ge=["imcromatch","mciromatch","micormatch","micrmoatch","micro-match","microamtch","micromacth","micromathc","micromtach","mircomatch"],ye=["minimath"],xe=["mcha","mmocha","moca","moch","mocha-js","moha","nocha","ocha"],we=["m0ment","mment","mmoent","mmoment","moemnt","moent","mom3nt","momeent","momemt","momen","momen7","momennt","moment-js","momentjs","momentt","momet","mometn","momment","momnet","momnt","monent","mooment","oment","omment"],qe=["mognoose","mogoose","mongoos","mongose","monqoose","moongoose"],$e=["moran","organ"],_e=["muler","multer-js","muter"],ze=["mysql"],Te=["ext","mext","n3xt","naxt","net","netx","nex","next-js","next-node","nextjs","nxt"],Se=["node-mailer","nodemailer-js"],De=["nodemo","nodemonjs","nodmeon"],Me=["oar","or","ora-node","ore","ra","roa"],Ae=["arcel","parce","parceljs"],Re=["passport-js"],Be=["phase","phaser-node"],Ce=["ino","pimo","pin","pino-node","pinojs","pio","pion"],Ee=["playright","playwright-js"],Le=["postcss-js","postcss-node","potscss"],Oe=["pettier","pprettier","pretier","prettierjs","prettierr","prtetier"],Fe=["prima","prism","prisma-js","prismajs","prizma"],Ie=["pupeteer"],Pe=["rada","rama","ramd","randa"],Ue=["eact","eract","r3act","raact","ract","raect","re4ct","reaact","reac","reac7","reacct","react-node","reactjs","reactt","reat","reatc","recat","rect","reeact","reect","rreact"],We=["erdis","radis","rdis","redi","redis-js","redis-node","rediss","rediz","reds","reis","rredis"],Ve=["resen","rsend"],Xe=["ollup","rollup-js","rollup-node"],Je=["ass","asss","sas","sass-node","sess","ssas","sss"],Ye=["emver","seemver","semver-node","semvre","senver","sever"],Ge=["sequelize-js","sequelize-node"],He=["harp","shap","shar","sharp-js","sharpjs"],Ke=["stipe","strip","stripe-node","tripe"],Qe=["supabase-js"],Ze=["suelte","svelt3","svelte-js","sveltejs","velte"],Ne=["tailwindcss-js"],eo=["auri","taui"],oo=["hree","htree","thee","there","three-js","three-node","tree"],so=["stx","sx","ts","tsxx","ttsx","tx","txs","tzx"],ro=["ttypescript","typecript","typescipt","typescript-node","typescriptjs","typescrit","typescritp"],to=["udnerscore","undercore","underscoer","underscore-node","underscroe","undersocre","undesrcore"],ao=["uid","uud","uudi","uui","uuid-js","uuid-node","uuidjs","vuid"],co=["ite","vie","vit","vita","vite-node","vitee","vlte","vte"],no=["itest","uitest","vitestjs","vitezt","vittest","vtest"],io=["ue","uue","uve","ve","veu","vu","vu3","vua","vue-node","vuee","vuejs","vuue","vve","vvue"],lo=["web-pack","weback","webpac","webpack-node","webpackjs","webpak","weebpack","wepack","wepback"],mo=["winson","winston-js","winstoon"],po=["up","uyp","yp","yu","yupjs","yupp"],uo=["od","zd","zdo","zo","zob","zod-js","zodjs"];const ho={ajv:B,angular:C,autoprefixer:E,"aws-sdk":["awssdk","ews-sdk"],axios:L,babel:O,bcrypt:F,bcryptjs:I,"body-parser":["body-paresr","body-parse","body-parser-js","body_parser"],bunyan:P,chai:U,chalk:W,cheerio:V,color:X,colors:J,commander:Y,"cookie-parser":["cookie-parse","cookieparser"],cors:G,"cross-env":["crossenv"],"date-fns":["data-fns","date-fn"],dayjs:H,debug:K,dotenv:Q,electron:Z,esbuild:N,eslint:ee,express:oe,fastify:se,firebase:re,formidable:te,glob:ae,got:ce,helmet:ne,hono:ie,inquirer:de,ioredis:le,jest:me,jimp:pe,joi:ue,jsdom:he,jsonwebtoken:ve,koa:be,lodash:je,lucia:ke,luxon:fe,micromatch:ge,minimatch:ye,mocha:xe,moment:we,mongoose:qe,morgan:$e,multer:_e,mysql2:ze,next:Te,"node-fetch":["node-fecth","node-fethc","node.fetch"],nodemailer:Se,nodemon:De,ora:Me,parcel:Ae,passport:Re,phaser:Be,pino:Ce,playwright:Ee,postcss:Le,prettier:Oe,prisma:Fe,puppeteer:Ie,ramda:Pe,react:Ue,"react-dom":["eact-dom","eract-dom","r3act-dom","ract-dom","raect-dom","re4ct-dom","reaact-dom","reac-dom","reac7-dom","reacct-dom","react-bom","react-d0m","react-ddom","react-dm","react-dmo","react-do","react-domm","react-don","react-doom","react-odm","react-om","react.dom","reactdom","reactt-dom","reat-dom","reatc-dom","recat-dom","rect-dom","reeact-dom","rreact-dom"],redis:We,resend:Ve,rollup:Xe,sass:Je,semver:Ye,sequelize:Ge,sharp:He,"socket.io":["ocket.io","oscket.io","scket.io","scoket.io","soccket.io","socekt.io","socet.io","sock3t.io","socke.io","socke7.io","sockeet.io","socket.1o","socket.i","socket.iio","socket.ioo","socket.lo","socket.o","socket.oi","sockett.io","sockket.io","sockt.io","sockte.io","sokcet.io","soket.io","soocket.io","ssocket.io"],stripe:Ke,supabase:Qe,svelte:Ze,tailwindcss:Ne,tauri:eo,three:oo,"ts-node":["tts-node"],tsx:so,typescript:ro,underscore:to,uuid:ao,vite:co,vitest:no,vue:io,webpack:lo,winston:mo,yup:po,zod:uo};var h,f;function vo(){return f||(f=1,h={"@tanstack/start":["start-tanstack-app","tanstack","tanstack-app","tanstack-start"]}),h}var bo=vo();const jo=M(bo),ko={a:["4","e"],b:["d"],d:["b"],e:["3","a"],g:["9","q"],i:["1","l"],l:["1","i"],m:["n"],n:["m"],o:["0"],s:["5","z"],t:["7"],u:["v"],v:["u"]},fo=["app","cli","core","kit","lib","pkg","sdk"],go=e=>{const o=new Set;if(e.length<3)return o;for(let s=0;s<e.length;s++){const a=e[s],c=a==="-"||a==="."||a==="_";if(c||o.add(e.slice(0,s)+e.slice(s+1)),c||o.add(e.slice(0,s)+a+e.slice(s)),s<e.length-1&&e[s]!==e[s+1]){const u=e[s+1]==="-"||e[s+1]==="."||e[s+1]==="_";if(!c&&!u){const d=[...e];[d[s],d[s+1]]=[d[s+1],d[s]],o.add(d.join(""))}}const n=e[s].toLowerCase(),b=ko[n];if(b)for(const u of b)o.add(e.slice(0,s)+u+e.slice(s+1))}const r=/[-._]/g;if(r.test(e))o.add(e.replaceAll(r,"")),o.add(e.replaceAll(r,"-")),o.add(e.replaceAll(r,".")),o.add(e.replaceAll(r,"_"));else if(e.length>5)for(let s=2;s<e.length-2;s++)o.add(`${e.slice(0,s)}-${e.slice(s)}`),o.add(`${e.slice(0,s)}.${e.slice(s)}`),o.add(`${e.slice(0,s)}_${e.slice(s)}`);if(e.startsWith("@")||(o.add(`${e}-js`),o.add(`${e}js`),o.add(`${e}-node`)),e.startsWith("@")){const s=e.indexOf("/");if(s>1&&s<e.length-1){const a=e.slice(1,s),c=e.slice(s+1);a.length>=3&&o.add(a);for(const n of["","-",".","_"])o.add(`${a}${n}${c}`),o.add(`${c}${n}${a}`);for(const n of fo)o.add(`${a}-${n}`),o.add(`${c}-${a}-${n}`),o.add(`${n}-${a}-${c}`)}}return o.delete(e),o};let v,p,m;const y=()=>{if(!v){const e={};for(const o of[ho,jo])for(const[r,t]of Object.entries(o)){const s=e[r]??(e[r]=[]);for(const a of t)s.includes(a)||s.push(a)}v=e}return v},yo=()=>{if(!p){p=new Map;for(const[e,o]of Object.entries(y()))for(const r of o)p.set(r,e)}return p},xo=()=>{if(!m){m=new Map;for(const e of Object.keys(y()))for(const o of go(e))m.has(o)||m.set(o,e)}return m},wo=e=>e.startsWith("@")?e.split("/")[1]??e:e,qo=e=>{const o=wo(e),r=yo().get(o);if(r)return{input:e,legitimate:r,method:"blocklist"};const t=xo().get(o);if(t)return{input:e,legitimate:t,method:"heuristic"}},x=(e,o)=>{const r=o?new Set(o):void 0,t=[];for(const s of e){if(r?.has(s))continue;const a=qo(s);a&&t.push(a)}return t},w=(e,o)=>{i.warn(""),i.warn(j(`Possible typosquat${e.length===1?"":"s"} ${o}:`));for(const r of e){const t=r.method==="blocklist"?"known typosquat":"similar name";i.warn(` ${k("⚠")} ${j(r.input)} — did you mean ${k(r.legitimate)}? (${t})`)}i.warn("")},q=async e=>{if(!process.stdin.isTTY){i.warn("Aborting: potential typosquat detected in non-interactive mode. Use --no-typosquat-check to skip.");return}const o=S({input:process.stdin,output:process.stdout}),r=await new Promise(t=>{o.question(e,s=>{t(s.trim().toLowerCase())})});return o.close(),r},Co=async(e,o)=>{if(g("typosquats"))return{ok:!0,packages:e};const r=x(e,o);if(r.length===0)return{ok:!0,packages:e};w(r,"detected");const t=await q(`Use suggested package${r.length===1?"":"s"} instead? [S]uggested / [y]es, keep original / [N]o, abort (default: N) `);if(t===void 0)return{ok:!1,packages:e};if(t==="s"||t==="suggested"){const s=new Map(r.map(c=>[c.input,c.legitimate]));return{ok:!0,packages:e.map(c=>s.get(c)??c)}}return t==="y"||t==="yes"?{ok:!0,packages:e}:{ok:!1,packages:e}},$o=/^(?:npm|pnpm|yarn):(.+?)(?:@.*)?$/,_o=e=>$o.exec(e)?.[1],zo=e=>{if(!A(e))return[];const o=R(e),r={...o.dependencies,...o.devDependencies,...o.optionalDependencies,...o.peerDependencies},t=new Set;for(const[s,a]of Object.entries(r)){t.add(s);const c=_o(a);c&&t.add(c)}return[...t]},Eo=async(e,o)=>{if(g("typosquats"))return!0;const r=D(e,"package.json"),t=zo(r);if(t.length===0)return!0;const s=x(t,o);if(s.length===0)return!0;w(s,"in package.json dependencies"),i.warn("Fix the package name in package.json before proceeding.");const a=await q("Continue anyway? [y/N] ");return a==="y"||a==="yes"};export{Co as r,Eo as s};
@@ -0,0 +1 @@
1
+ import{u as r,z as a}from"../packem_chunks/catalog.js";const f=(u,n)=>{const t=r.useRef(null),[s,o]=r.useState(u);return r.useLayoutEffect(()=>{if(!t.current)return;const{height:e}=a(t.current);e>0&&e!==s&&(o(e),n?.(e))}),{measuredHeight:s,ref:t}};export{f as u};
@@ -0,0 +1 @@
1
+ const o=e=>e?Array.isArray(e)?e:[e]:[],a=(e,n)=>{const s=n??[];return s[0]==="--"?[...e??[]]:[...e??[],...s]},l=e=>e instanceof Error?e.message:typeof e=="string"?e:String(e),p=e=>e.replace(/^\.\//,"").replace(/\/+$/,""),t=/[\u0000-\u001F\u007F ~^:?*[\\]/g,f=e=>{const n=e.replaceAll("@{","-").replaceAll("..","-").replaceAll(t,"-").replace(/\.lock$/i,"").replace(/^[./-]+/,"").replace(/[./-]+$/,"");return n.length>0?n:"split"},i=/^(.+?)(?:@(.+))?$/,S=e=>{if(e.startsWith("@")){const s=e.indexOf("/");if(s===-1)return{name:e,versionSpec:void 0};const c=e.slice(s+1),r=c.indexOf("@");return r===-1?{name:e,versionSpec:void 0}:{name:e.slice(0,s+1+r),versionSpec:c.slice(r+1)}}const n=i.exec(e);return n?{name:n[1]??e,versionSpec:n[2]}:{name:e,versionSpec:void 0}};export{l as e,a as m,p as n,S as p,f as s,o as t};
@@ -0,0 +1 @@
1
+ import{createRequire as y}from"node:module";import{e as o,z as f,l as b}from"./index-DHD8wb6Z.js";import{y as a}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";let u;const h=c=>(u??=y(import.meta.url))(c),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=c=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[t,e]=p.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return p.getBuiltinModule(c)}return h(c)},{readdirSync:j}=m("node:fs"),v=[".husky/pre-commit",".vis/hooks/pre-commit",".git/hooks/pre-commit"],_=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],$=[".syncpackrc",".syncpackrc.json",".syncpackrc.yaml",".syncpackrc.yml",".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],w=c=>{const t=o(c,"package.json");if(!a(t))return[];let e;try{e=JSON.parse(f(t))}catch{return[]}const n=[];if(e.scripts)for(const[s,i]of Object.entries(e.scripts))typeof i=="string"&&(/\bgitleaks\b/.test(i)&&n.push({detail:`Script "${s}" still invokes gitleaks: ${i}`,kind:"script",location:"package.json",tool:"gitleaks"}),/\bsecretlint\b/.test(i)&&n.push({detail:`Script "${s}" still invokes secretlint: ${i}`,kind:"script",location:"package.json",tool:"secretlint"}),/\bsyncpack\b/.test(i)&&n.push({detail:`Script "${s}" still invokes syncpack: ${i}`,kind:"script",location:"package.json",tool:"syncpack"}),/\bsherif\b/.test(i)&&n.push({detail:`Script "${s}" still invokes sherif: ${i}`,kind:"script",location:"package.json",tool:"sherif"}));if(e.devDependencies)for(const s of Object.keys(e.devDependencies))(s==="gitleaks"||s==="@gitleaks/cli")&&n.push({detail:`devDependency \`${s}\` is still installed`,kind:"devDep",location:"package.json",tool:"gitleaks"}),(s==="secretlint"||s.startsWith("@secretlint/"))&&n.push({detail:`devDependency \`${s}\` is still installed`,kind:"devDep",location:"package.json",tool:"secretlint"}),s==="syncpack"&&n.push({detail:`devDependency \`${s}\` is still installed`,kind:"devDep",location:"package.json",tool:"syncpack"}),s==="sherif"&&n.push({detail:`devDependency \`${s}\` is still installed`,kind:"devDep",location:"package.json",tool:"sherif"});return e.sherif&&n.push({detail:"`sherif` config block still present in package.json",kind:"config",location:"package.json",tool:"sherif"}),n},C=c=>{const t=[];for(const e of v){const n=o(c,e);if(!a(n))continue;const s=f(n);/\bgitleaks\b/.test(s)&&t.push({detail:"gitleaks invocation still present in hook",kind:"hook",location:e,tool:"gitleaks"}),/\bsecretlint\b/.test(s)&&t.push({detail:"secretlint invocation still present in hook",kind:"hook",location:e,tool:"secretlint"}),/\bsyncpack\b/.test(s)&&t.push({detail:"syncpack invocation still present in hook",kind:"hook",location:e,tool:"syncpack"}),/\bsherif\b/.test(s)&&t.push({detail:"sherif invocation still present in hook",kind:"hook",location:e,tool:"sherif"})}return t},D=c=>{const t=[];for(const e of _)a(o(c,e))&&t.push({detail:"secretlint config should be removed after migration",kind:"config",location:e,tool:"secretlint"});for(const e of $)a(o(c,e))&&t.push({detail:"syncpack config should be removed after migration",kind:"config",location:e,tool:"syncpack"});return t},S=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],I=c=>{const t=[],e=n=>{const s=o(c,n);if(!a(s))return;const i=f(s);/\bsyncpack\b/.test(i)&&t.push({detail:"syncpack invocation still present in CI",kind:"ci",location:n,tool:"syncpack"}),/\bsherif\b/.test(i)&&t.push({detail:"sherif invocation still present in CI",kind:"ci",location:n,tool:"sherif"})};for(const n of S){const s=o(c,n);if(a(s)){if(n===".github/workflows"){try{for(const i of j(s))(i.endsWith(".yml")||i.endsWith(".yaml"))&&e(`.github/workflows/${i}`)}catch{}continue}e(n)}}return t},N=c=>{const t=[],e=o(c,"pnpm-workspace.yaml");if(a(e)){let s;try{s=b(e)}catch{s=void 0}if(s&&typeof s=="object"){const i=s.catalog;i&&typeof i.syncpack=="string"&&t.push({detail:"`syncpack` still listed in pnpm-workspace.yaml#catalog",kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"});const l=s.catalogs;if(l&&typeof l=="object")for(const[k,r]of Object.entries(l))r&&typeof r.syncpack=="string"&&t.push({detail:`\`syncpack\` still listed in pnpm-workspace.yaml#catalogs.${k}`,kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"})}}const n=o(c,"package.json");if(a(n)){let s;try{s=JSON.parse(f(n))}catch{return t}const i=s.workspaces;if(i&&typeof i=="object"&&!Array.isArray(i)){const k=i.catalog;k&&typeof k.syncpack=="string"&&t.push({detail:"`syncpack` still listed in package.json#workspaces.catalog",kind:"catalog",location:"package.json",tool:"syncpack"});const r=i.catalogs;if(r&&typeof r=="object")for(const[g,d]of Object.entries(r))d&&typeof d.syncpack=="string"&&t.push({detail:`\`syncpack\` still listed in package.json#workspaces.catalogs.${g}`,kind:"catalog",location:"package.json",tool:"syncpack"})}const l=s.catalog;l&&typeof l.syncpack=="string"&&t.push({detail:"`syncpack` still listed in package.json#catalog",kind:"catalog",location:"package.json",tool:"syncpack"})}return t},O=c=>[...w(c),...C(c),...D(c),...I(c),...N(c)],E=(c,t)=>{const e=O(c);if(e.length===0)return t.info("✓ No unmigrated gitleaks/secretlint/sherif/syncpack references found."),[];t.warn(`Found ${String(e.length)} unmigrated reference(s):`);for(const n of e)t.warn(` [${n.kind}] ${n.location} — ${n.detail}`);return e};export{O as s,E as v};
@@ -0,0 +1 @@
1
+ import{y as e,X as t,m as r,u as p}from"../packem_chunks/catalog.js";import{T as ae,U as je,V as pe,W as fe,u as me,X as z,Y as ce}from"../packem_chunks/cli-main.js";import{l as we}from"./spinner-CbJfWYwB.js";import{s as xe}from"./formatBytes-BHAzNIrn-DFIppnY0.js";import{n as Ce,a as be}from"./tabs-BilwonkM.js";import{u as Te}from"./use-measured-height-BPQg2q_p.js";const _e=({current:a,total:l})=>{const{columns:i}=ae(),s=i||80,d=l>0?Math.min(1,a/l):0,h=`${String(Math.round(d*100)).padStart(3)}%`,f=`${String(a)}/${String(l)}`,w=Math.max(10,s-2-h.length-1),g=Math.round(w*d),j=w-g;return e.jsxs(t,{flexDirection:"column",paddingX:1,children:[e.jsxs(t,{children:[e.jsx(we,{type:"dots"}),e.jsx(r,{children:" Checking catalog dependencies "}),e.jsx(r,{dimColor:!0,children:f})]}),e.jsxs(t,{children:[e.jsx(r,{color:"cyan",children:"━".repeat(g)}),e.jsx(r,{dimColor:!0,children:"─".repeat(j)}),e.jsxs(r,{dimColor:!0,children:[" ",h]})]})]})},Z=["default","name","updateType","severity"],ne=a=>{const l=a.vulnerabilities?.map(i=>i.severity)??[];return l.includes("CRITICAL")?4:l.includes("HIGH")?3:l.includes("MODERATE")?2:l.includes("LOW")?1:0},de={digest:0,major:3,minor:2,patch:1,pin:0,unknown:0},he=(a,l)=>{if(l==="default")return a;const i=[...a];return l==="name"?i.sort((s,d)=>s.packageName.localeCompare(d.packageName)):l==="updateType"?i.sort((s,d)=>(de[d.updateType]??0)-(de[s.updateType]??0)||s.packageName.localeCompare(d.packageName)):i.sort((s,d)=>ne(d)-ne(s)||s.packageName.localeCompare(d.packageName)),i},J=a=>`${a.ecosystem}|${a.file}:${String(a.line)}|${a.name}`,I=a=>`${a.catalogName} ${a.packageName}`,W=a=>{const l=new Map;for(const i of a){const s=l.get(i.catalogName);s?s.push(i):l.set(i.catalogName,[i])}return l},$=(a,l,i)=>{let s=a;if(l!=="all"&&(s=l==="security"?s.filter(d=>d.vulnerabilities&&d.vulnerabilities.length>0||d.socketReport&&d.socketReport.alerts.length>0):s.filter(d=>d.updateType===l)),i){const d=i.toLowerCase();s=s.filter(h=>h.packageName.toLowerCase().includes(d))}return s};class Ke{#e;#t=new Set;#l;#s;#i=null;constructor(l,i=null,s=[]){this.#l=l,this.#s=s,i&&(this.#i=new Map(i.recommendations.map(d=>[d.package,d]))),this.#e={aiResult:i,allChecked:!0,applyProgress:null,checkedEcosystemKeys:new Set(s.map(d=>J(d))),checkedEntries:new Set(l.map(d=>I(d))),ecosystemEntries:s,entries:l,error:null,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",groupedByCatalog:W(l),phase:"browsing",selectedIndex:0,sortMode:"default"}}getSnapshot=()=>this.#e;subscribe=l=>(this.#t.add(l),()=>{this.#t.delete(l)});getFilteredEntries(){return he($(this.#l,this.#e.filterType,this.#e.filterText),this.#e.sortMode)}setSortMode(l){if(l===this.#e.sortMode)return;const s=this.getFilteredEntries()[this.#e.selectedIndex]?.packageName,d=he($(this.#l,this.#e.filterType,this.#e.filterText),l),h=s?Math.max(0,d.findIndex(f=>f.packageName===s)):0;this.#r({...this.#e,selectedIndex:h,sortMode:l})}cycleSortMode(){const l=Z.indexOf(this.#e.sortMode),i=Z[(l+1)%Z.length]??"default";this.setSortMode(i)}getRecommendation(l){return this.#i?.get(l)}getCheckedEntries(){return this.#l.filter(l=>this.#e.checkedEntries.has(I(l)))}getCheckedEcosystemEntries(){return this.#s.filter(l=>this.#e.checkedEcosystemKeys.has(J(l)))}toggleEcosystemCheck(l){const i=new Set(this.#e.checkedEcosystemKeys);i.has(l)?i.delete(l):i.add(l),this.#r({...this.#e,checkedEcosystemKeys:i})}checkAllEcosystem(){this.#r({...this.#e,checkedEcosystemKeys:new Set(this.#s.map(l=>J(l)))})}uncheckAllEcosystem(){this.#r({...this.#e,checkedEcosystemKeys:new Set})}setSelectedIndex(l){const i=this.getFilteredEntries(),s=Math.max(0,Math.min(l,i.length-1));s!==this.#e.selectedIndex&&this.#r({...this.#e,selectedIndex:s})}setFocusedPanel(l){l!==this.#e.focusedPanel&&this.#r({...this.#e,focusedPanel:l})}setFilterType(l){if(l!==this.#e.filterType){const i=$(this.#l,l,this.#e.filterText);this.#r({...this.#e,entries:i,filterType:l,groupedByCatalog:W(i),selectedIndex:0})}}setFilter(l){const i=$(this.#l,this.#e.filterType,l);this.#r({...this.#e,entries:i,filterText:l,groupedByCatalog:W(i),selectedIndex:0})}setFilterActive(l){if(l!==this.#e.filterActive)if(l)this.#r({...this.#e,filterActive:!0});else{const i=$(this.#l,this.#e.filterType,"");this.#r({...this.#e,entries:i,filterActive:!1,filterText:"",groupedByCatalog:W(i),selectedIndex:0})}}toggleCheck(l){const i=I(l),s=new Set(this.#e.checkedEntries);s.has(i)?s.delete(i):s.add(i),this.#r({...this.#e,allChecked:s.size===this.#l.length,checkedEntries:s})}checkAll(){this.#r({...this.#e,allChecked:!0,checkedEntries:new Set(this.#l.map(l=>I(l)))})}uncheckAll(){this.#r({...this.#e,allChecked:!1,checkedEntries:new Set})}toggleAll(){this.#e.allChecked?this.uncheckAll():this.checkAll()}startApply(){const l=this.getCheckedEntries();this.#r({...this.#e,applyProgress:{current:0,total:l.length},phase:"applying"})}updateApplyProgress(l){this.#e.applyProgress&&this.#r({...this.#e,applyProgress:{...this.#e.applyProgress,current:l}})}markDone(){this.#r({...this.#e,phase:"done"})}setError(l){this.#r({...this.#e,error:l,phase:"error"})}#r(l){this.#e=l;for(const i of this.#t)try{i()}catch{}}}const Se={major:"red",minor:"yellow",patch:"green"},ke={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},ye={critical:"red",high:"red",low:"gray",medium:"yellow"},Re={critical:"red",high:"red",low:"green",medium:"yellow"},Ee={defer:"gray",review:"yellow",skip:"red",update:"green"},Ae=({changelogUrl:a,entry:l,focused:i,recommendation:s,scrollRef:d})=>{const h=i?"white":"gray";if(!l)return e.jsx(t,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:e.jsx(r,{dimColor:!0,children:"No package selected"})});const f=Se[l.updateType]??"white",w=l.vulnerabilities&&l.vulnerabilities.length>0,g=l.socketReport?.score.overall??0,j=l.socketReport?xe(g):"gray";return e.jsxs(t,{borderColor:h,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[e.jsx(t,{flexShrink:0,paddingTop:1,paddingX:2,children:e.jsx(r,{bold:!0,color:"white",children:l.displayName??l.packageName})}),e.jsxs(je,{flexGrow:1,flexShrink:1,paddingX:2,ref:d,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:[e.jsx(r,{}),e.jsxs(t,{children:[e.jsx(t,{width:12,children:e.jsx(r,{dimColor:!0,children:"Current:"})}),e.jsx(r,{children:l.currentRange})]}),e.jsxs(t,{children:[e.jsx(t,{width:12,children:e.jsx(r,{dimColor:!0,children:"Target:"})}),e.jsx(r,{children:l.newRange}),e.jsxs(r,{bold:!0,color:f,children:[" ","(",l.updateType,")"]})]}),e.jsxs(t,{children:[e.jsx(t,{width:12,children:e.jsx(r,{dimColor:!0,children:"Version:"})}),e.jsx(r,{children:l.targetVersion})]}),e.jsxs(t,{children:[e.jsx(t,{width:12,children:e.jsx(r,{dimColor:!0,children:l.kind==="ecosystem"?"Source:":"Catalog:"})}),e.jsx(r,{color:l.kind==="ecosystem"?"cyan":void 0,children:l.catalogName})]}),l.acceptedRisk&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{color:"gray",children:"── "}),e.jsx(r,{bold:!0,color:"gray",children:"ACKNOWLEDGED RISK"}),e.jsxs(t,{flexDirection:"column",paddingLeft:2,children:[e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Reason: "}),e.jsx(r,{children:l.acceptedRisk.reason})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Accepted: "}),e.jsx(r,{children:l.acceptedRisk.acceptedAt.slice(0,10)})]})]})]}),w&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"red",children:"SECURITY"}),e.jsx(r,{}),l.vulnerabilities.map(c=>e.jsxs(t,{flexDirection:"column",marginBottom:1,children:[e.jsxs(t,{gap:1,children:[e.jsxs(r,{bold:!0,color:ke[c.severity]??"gray",children:["⚠"," ",c.severity]}),e.jsx(r,{bold:!0,children:c.id})]}),e.jsx(t,{paddingLeft:2,children:e.jsx(r,{children:c.summary})}),e.jsxs(t,{gap:2,paddingLeft:2,children:[c.cvssScore!==void 0&&e.jsxs(r,{dimColor:!0,children:["CVSS:",String(c.cvssScore)]}),c.fixedVersions.length>0&&e.jsxs(r,{dimColor:!0,children:["Fixed in:",c.fixedVersions.join(", ")]})]})]},c.id))]}),l.socketReport&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"cyan",children:"SOCKET.DEV"}),e.jsx(r,{}),e.jsxs(t,{gap:2,children:[e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Overall: "}),e.jsxs(r,{bold:!0,color:j,children:[String(Math.round(g*100)),"%"]})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Supply Chain: "}),e.jsxs(r,{children:[String(Math.round(l.socketReport.score.supplyChain*100)),"%"]})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Quality: "}),e.jsxs(r,{children:[String(Math.round(l.socketReport.score.quality*100)),"%"]})]})]}),e.jsxs(t,{gap:2,children:[e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Maintenance: "}),e.jsxs(r,{children:[String(Math.round(l.socketReport.score.maintenance*100)),"%"]})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Vulnerability: "}),e.jsxs(r,{children:[String(Math.round(l.socketReport.score.vulnerability*100)),"%"]})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"License: "}),e.jsxs(r,{children:[l.socketReport.license||"unknown"," ","(",String(Math.round(l.socketReport.score.license*100)),"%)"]})]})]}),l.socketReport.alerts.length>0&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsxs(r,{bold:!0,color:"yellow",children:["⚠"," ",String(l.socketReport.alerts.length)," ","alert",l.socketReport.alerts.length===1?"":"s",":"]}),l.socketReport.alerts.map(c=>e.jsxs(t,{gap:1,paddingLeft:2,children:[e.jsxs(r,{bold:!0,color:ye[c.severity]??"gray",children:["[",c.severity.toUpperCase(),"]"]}),e.jsx(r,{children:c.type}),e.jsxs(r,{dimColor:!0,children:["(",c.category,")"]})]},c.key))]})]}),s&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"AI ANALYSIS"}),e.jsx(r,{}),e.jsxs(t,{gap:2,children:[e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Action: "}),e.jsx(r,{bold:!0,color:Ee[s.action]??"white",children:s.action})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Risk: "}),e.jsx(r,{bold:!0,color:Re[s.riskLevel]??"white",children:s.riskLevel})]}),e.jsxs(t,{children:[e.jsx(r,{dimColor:!0,children:"Effort: "}),e.jsx(r,{bold:!0,children:s.effort})]})]}),s.reason&&e.jsx(t,{marginTop:1,paddingLeft:2,children:e.jsx(r,{children:s.reason})}),s.breakingChanges.length>0&&e.jsxs(t,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[e.jsx(r,{bold:!0,color:"yellow",children:"Breaking changes:"}),s.breakingChanges.map((c,v)=>e.jsxs(r,{children:[" ","•"," ",c]},String(v)))]})]}),a&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"CHANGELOG"}),e.jsx(t,{marginTop:1,paddingLeft:2,children:e.jsx(r,{color:"cyan",underline:!0,children:a})})]}),e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"LINKS"}),e.jsx(t,{flexDirection:"column",marginTop:1,paddingLeft:2,children:l.kind==="ecosystem"?e.jsx(r,{color:"cyan",underline:!0,children:l.detailUrl??l.displayName??l.packageName}):e.jsxs(r,{color:"cyan",underline:!0,children:["https://npmx.dev/",l.packageName]})})]}),!s&&l.kind!=="ecosystem"&&e.jsxs(t,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"GUIDANCE"}),e.jsxs(t,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[l.updateType==="major"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"red",children:["⚠"," ","Major update — likely contains breaking changes."]}),e.jsx(r,{dimColor:!0,children:" Review the changelog before updating."}),e.jsx(r,{dimColor:!0,children:" Use --changelog to fetch release URLs."})]}),l.updateType==="minor"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"yellow",children:["ℹ"," ","Minor update — new features, backward compatible."]}),e.jsx(r,{dimColor:!0,children:" Generally safe to update."})]}),l.updateType==="patch"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"green",children:["✓"," ","Patch update — bug fixes only."]}),e.jsx(r,{dimColor:!0,children:" Safe to update."})]}),!s&&e.jsx(r,{dimColor:!0,children:" Use --ai to get AI-powered analysis."})]})]})]})]})},Ie={major:"red",minor:"yellow",patch:"green"},ve=[{id:"all",label:"All"},{id:"major",label:"Major"},{id:"minor",label:"Minor"},{id:"patch",label:"Patch"},{id:"security",label:"Security"}],Me=({checked:a,entry:l,isSelected:i})=>{const s=Ie[l.updateType]??"white",d=l.vulnerabilities&&l.vulnerabilities.length>0,h=l.socketReport&&l.socketReport.alerts.length>0,f=!!l.acceptedRisk,w=a?"☑":"☐",g=l.socketReport?`${String(Math.round(l.socketReport.score.overall*100))}%`:"",j=l.socketReport?xe(l.socketReport.score.overall):"gray";return e.jsxs(t,{flexShrink:0,height:1,children:[e.jsx(r,{children:i?">":" "}),e.jsxs(r,{color:a?"white":"gray",children:[" ",w," "]}),d||h?e.jsx(r,{color:f?"gray":"red",children:f?"✓ ":"⚠ "}):e.jsx(r,{children:" "}),e.jsx(t,{flexGrow:1,children:e.jsxs(r,{bold:i,inverse:i,wrap:"truncate",children:[l.displayName??l.packageName,f?" [ack]":""]})}),g&&e.jsxs(r,{color:j,children:[" ",g]}),e.jsxs(r,{dimColor:!0,children:[" ",l.currentRange]}),e.jsxs(r,{dimColor:!0,children:[" ","→"," "]}),e.jsxs(r,{children:[l.newRange," "]}),e.jsx(r,{bold:!0,color:s,children:l.updateType})]})},Ne=({count:a,ecosystem:l=!1,name:i})=>e.jsxs(t,{flexShrink:0,height:1,marginTop:1,children:[e.jsxs(r,{color:l?"cyan":void 0,dimColor:!l,children:[l?"◈":"▼"," "]}),e.jsx(r,{bold:!0,color:l?"cyan":"white",children:i.toUpperCase()}),e.jsxs(r,{dimColor:!0,children:[" ","(",a,")"]}),l&&e.jsxs(r,{color:"cyan",dimColor:!0,children:[" ","ci/cd refs"]})]}),De=({checkedEntries:a,entries:l,filterActive:i,filteredOutCount:s,filterText:d,filterType:h,focused:f,groupedByCatalog:w,isDryRun:g,onViewportHeightChange:j,scrollOffset:c,selectedIndex:v,totalCatalogEntries:M,totalChecked:R,totalEntries:U,viewportHeight:P})=>{const B=f?"white":"gray",{measuredHeight:m,ref:E}=Te(P,j);let V=0,y=0,N=0,A=0;for(const u of l)u.updateType==="major"?V++:u.updateType==="minor"?y++:N++,(u.vulnerabilities&&u.vulnerabilities.length>0||u.socketReport&&u.socketReport.alerts.length>0)&&A++;const b=[];V>0&&b.push(`${V} major`),y>0&&b.push(`${y} minor`),N>0&&b.push(`${N} patch`),A>0&&b.push(`${A} vulnerable`);const D=b.length>0?` (${b.join(", ")})`:"",C=l.filter(u=>u.kind==="ecosystem").length,T=l.length-C;let F=0;for(const u of l)a.has(I(u))&&F++;const O=[];let H=0;for(const[u,S]of w){O.push(e.jsx(Ne,{count:S.length,ecosystem:S[0]?.kind==="ecosystem",name:u},`hdr-${u}`));for(const k of S){const X=H;O.push(e.jsx(Me,{checked:a.has(I(k)),entry:k,isSelected:X===v},I(k))),H++}}let L=0;for(const[,u]of w)L+=2+u.length;const _=L>m&&m>0;return e.jsxs(t,{borderColor:B,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[e.jsxs(t,{flexShrink:0,gap:1,paddingX:1,children:[e.jsx(r,{bold:!0,inverse:!0,children:" VIS "}),e.jsxs(r,{wrap:"truncate",children:[C>0?T:U,R>0?`/${R}`:""," ",C>0?"pkgs":"outdated",D,M>R?` · ${M-R} dupes`:""]}),C>0&&e.jsxs(r,{color:"cyan",children:[" ","◈",C," ","ci/cd"]}),!g&&F>0&&e.jsxs(r,{dimColor:!0,children:[" ","—",F," ","selected"]})]}),e.jsx(t,{flexShrink:0,paddingX:1,paddingY:1,children:e.jsx(Ce,{isFocused:f,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:()=>{},showIndex:!1,value:h,children:ve.map(({id:u,label:S})=>e.jsx(be,{name:u,children:S},u))})}),i&&e.jsxs(t,{flexShrink:0,paddingX:1,children:[e.jsx(r,{bold:!0,color:"white",children:"/ "}),e.jsx(r,{children:d}),e.jsx(r,{inverse:!0,children:" "})]}),s>0&&e.jsx(t,{flexShrink:0,paddingX:1,children:e.jsxs(r,{color:"yellow",children:["⚠"," ",s," ","package",s===1?"":"s"," ","filtered out by target constraint — press"," ",e.jsx(r,{bold:!0,color:"white",children:"f"})," ","to view"]})}),e.jsxs(t,{flexDirection:"row",flexGrow:1,overflow:"hidden",ref:E,children:[e.jsx(t,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:e.jsx(t,{flexDirection:"column",marginTop:-c,children:O})}),_&&e.jsx(t,{flexShrink:0,marginLeft:1,marginRight:1,children:e.jsx(pe,{contentHeight:L,placement:"inset",scrollOffset:c,style:"block",viewportHeight:m})})]},`list-${h}-${d}`)]})},Le=100,Pe=40,Be=10,Ve=[],G=["all","major","minor","patch","security"],Ye=({autoExitSeconds:a=0,changelogUrls:l,checkedCount:i=0,filteredOutEntries:s=Ve,isDryRun:d,store:h,totalCatalogEntries:f=0})=>{const{exit:w}=fe(),{columns:g,rows:j}=ae(),c=p.useSyncExternalStore(h.subscribe,h.getSnapshot),[v,M]=p.useState(!1),[R,U]=p.useState(!1),P=p.useRef(null),B=p.useRef(null),m=p.useRef(null),E=p.useRef(null),[V,y]=p.useState(0),[N,A]=p.useState(!1),[b,D]=p.useState(!1),C=p.useMemo(()=>h.getFilteredEntries(),[c.entries,c.filterType,c.filterText,c.sortMode]),T=C[c.selectedIndex]??null,F=T?h.getRecommendation(T.packageName):void 0,O=T&&l?l.get(T.packageName):void 0,H=p.useCallback(o=>{let n=0,x=0;for(const[,Q]of c.groupedByCatalog){n+=2;for(let oe=0;oe<Q.length;oe++){if(x===o)return n;n+=1,x++}}return n},[c.groupedByCatalog]),L=Math.max(1,j-8-(c.filterActive?1:0)),[_,u]=p.useState(L),S=_>0?_:L,k=p.useCallback(o=>{const n=H(o);y(x=>n>x+S-2?Math.max(0,n-S+2):n<x+1?Math.max(0,n-1):x)},[H,S]);if(p.useEffect(()=>{m.current?.scrollToTop()},[T?.packageName]),me((o,n)=>{if(o==="c"&&n.ctrl){w();return}if(!b){if(R){n.escape||o==="f"||o==="q"?U(!1):n.downArrow||o==="j"?B.current?.scrollBy(1):(n.upArrow||o==="k")&&B.current?.scrollBy(-1);return}if(N){o==="u"||n.return?(A(!1),h.startApply(),w(h.getCheckedEntries())):n.escape||o==="q"?A(!1):n.downArrow||o==="j"?E.current?.scrollBy(1):n.upArrow||o==="k"?E.current?.scrollBy(-1):n.pageDown?E.current?.scrollBy(5):n.pageUp&&E.current?.scrollBy(-5);return}if(v){n.escape||o==="?"?M(!1):o==="q"?(M(!1),D(!0)):n.downArrow||o==="j"?P.current?.scrollBy(1):(n.upArrow||o==="k")&&P.current?.scrollBy(-1);return}if(o==="?"){M(!0);return}if(o==="q"){D(!0);return}if(n.tab){h.setFocusedPanel(c.focusedPanel==="list"?"detail":"list");return}if(c.focusedPanel==="list"&&(n.leftArrow||n.rightArrow)){const x=G.indexOf(c.filterType),Q=n.rightArrow?(x+1)%G.length:(x-1+G.length)%G.length;y(0),m.current?.scrollToTop(),h.setFilterType(G[Q]);return}if(o==="f"&&s.length>0){U(x=>!x);return}if(c.filterActive){if(n.escape){h.setFilterActive(!1);return}if(n.return){h.setFilterActive(!1);return}if(n.backspace){y(0),h.setFilter(c.filterText.slice(0,-1));return}if(o&&!n.ctrl&&!n.meta){y(0),h.setFilter(c.filterText+o);return}return}if(c.focusedPanel==="list"){if(n.downArrow||o==="j"){const x=Math.min(c.selectedIndex+1,C.length-1);h.setSelectedIndex(x),k(x);return}if(n.upArrow||o==="k"){const x=Math.max(c.selectedIndex-1,0);h.setSelectedIndex(x),k(x);return}if(n.pageDown){const x=Math.min(c.selectedIndex+10,C.length-1);h.setSelectedIndex(x),k(x);return}if(n.pageUp){const x=Math.max(c.selectedIndex-10,0);h.setSelectedIndex(x),k(x);return}if(n.home){h.setSelectedIndex(0),y(0);return}if(n.end){const x=C.length-1;h.setSelectedIndex(x),k(x);return}if(o===" "||n.return){T&&h.toggleCheck(T);return}if(o==="a"){h.toggleAll();return}if(o==="s"){h.cycleSortMode(),k(h.getSnapshot().selectedIndex);return}if(o==="/"){h.setFilterActive(!0);return}if(o==="u"&&!d&&c.checkedEntries.size>0){A(!0);return}if(n.rightArrow){h.setFocusedPanel("detail");return}return}if(c.focusedPanel==="detail"){if(n.escape||n.leftArrow){h.setFocusedPanel("list");return}if(n.downArrow||o==="j"){m.current?.scrollBy(1);return}if(n.upArrow||o==="k"){m.current?.scrollBy(-1);return}if(n.pageDown){m.current?.scrollBy(10);return}if(n.pageUp){m.current?.scrollBy(-10);return}if(n.home){m.current?.scrollToTop();return}n.end&&m.current?.scrollToBottom()}}},{isActive:!0}),g<Pe||j<Be)return e.jsx(t,{alignItems:"center",height:j,justifyContent:"center",width:g,children:e.jsxs(r,{color:"yellow",children:["Terminal too small (",g,"x",j,")"]})});const X=g>=Le,K=[e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"q"}),e.jsx(r,{dimColor:!0,children:"QUIT"})]},"q"),e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"?"}),e.jsx(r,{dimColor:!0,children:"HELP"})]},"?"),e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"}),e.jsx(r,{dimColor:!0,children:"NAV"})]},"nav"),e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"Space"}),e.jsx(r,{dimColor:!0,children:"CHECK"})]},"sp"),e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"a"}),e.jsx(r,{dimColor:!0,children:"ALL"})]},"a")];!d&&c.checkedEntries.size>0&&K.push(e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"green",children:"u"}),e.jsx(r,{dimColor:!0,children:"APPLY"})]},"u")),s.length>0&&K.push(e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"yellow",children:"f"}),e.jsxs(r,{dimColor:!0,children:["FILTERED (",s.length,")"]})]},"fo")),K.push(e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"←→"}),e.jsx(r,{dimColor:!0,children:"FILTER"})]},"lr"),e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"/"}),e.jsx(r,{dimColor:!0,children:"SEARCH"})]},"f"),e.jsxs(t,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"Tab"}),e.jsx(r,{dimColor:!0,children:"PANEL"})]},"t"));const ee=e.jsx(t,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:e.jsx(t,{flexWrap:"wrap",gap:2,paddingX:1,children:K})}),re=e.jsxs(z,{footer:e.jsxs(r,{dimColor:!0,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",e.jsx(r,{bold:!0,color:"white",children:"?"}),"/",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:P,title:"KEYBOARD SHORTCUTS",visible:v,width:52,children:[e.jsxs(t,{flexDirection:"column",marginBottom:1,children:[e.jsxs(t,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"NAVIGATION"})]}),e.jsxs(t,{children:[e.jsx(t,{width:24,children:e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","↑","/k"]}),e.jsx(r,{dimColor:!0,children:" Move up"})]})}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","↓","/j"]}),e.jsx(r,{dimColor:!0,children:" Move down"})]})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","Tab"]}),e.jsx(r,{dimColor:!0,children:" Switch panel"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","→","/","←"]}),e.jsx(r,{dimColor:!0,children:" Focus detail/list"})]})]}),e.jsxs(t,{flexDirection:"column",marginBottom:1,children:[e.jsxs(t,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"SELECTION"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","Space"]}),e.jsx(r,{dimColor:!0,children:" Toggle check on package"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","a"]}),e.jsx(r,{dimColor:!0,children:" Toggle check all"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","s"]}),e.jsx(r,{dimColor:!0,children:" Cycle sort (default / name / type / severity)"})]})]}),e.jsxs(t,{flexDirection:"column",marginBottom:1,children:[e.jsxs(t,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"FILTERS"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","←→"]}),e.jsx(r,{dimColor:!0,children:" Switch filter tab"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","/"]}),e.jsx(r,{dimColor:!0,children:" Text filter"})]}),s.length>0&&e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","f"]}),e.jsx(r,{dimColor:!0,children:" View filtered-out packages"})]})]}),e.jsxs(t,{flexDirection:"column",children:[e.jsxs(t,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"ACTIONS"})]}),!d&&e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","u"]}),e.jsx(r,{dimColor:!0,children:" Apply selected updates"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","q"]}),e.jsx(r,{dimColor:!0,children:" Quit"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","?"]}),e.jsx(r,{dimColor:!0,children:" Toggle help"})]})]})]}),Y=h.getCheckedEntries(),q=Y.filter(o=>o.updateType==="major").length,ue=e.jsxs(t,{alignItems:"center",flexDirection:"column",children:[q>0&&e.jsx(t,{marginBottom:1,marginTop:1,children:e.jsxs(r,{color:"yellow",children:["⚠"," ",q," ","major update",q===1?"":"s"," ","— review breaking changes"]})}),e.jsxs(r,{dimColor:!0,children:["Press"," ",e.jsx(r,{bold:!0,color:"white",children:"u"})," ","or"," ",e.jsx(r,{bold:!0,color:"white",children:"Enter"})," ","to confirm,"," ",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","to cancel"]})]}),le=e.jsx(z,{footer:ue,scrollRef:E,title:`Apply ${Y.length} update${Y.length===1?"":"s"}?`,visible:N,width:70,children:Y.map(o=>e.jsxs(t,{gap:1,children:[e.jsxs(r,{children:[" ",o.displayName??o.packageName]}),e.jsxs(r,{dimColor:!0,children:[o.currentRange," ","→"," ",o.newRange]}),e.jsx(r,{bold:!0,color:o.updateType==="major"?"red":o.updateType==="minor"?"yellow":"green",children:o.updateType})]},o.packageName))}),te=s.length>0?e.jsx(z,{footer:e.jsxs(r,{dimColor:!0,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",e.jsx(r,{bold:!0,color:"white",children:"f"}),"/",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:B,title:`${s.length} PACKAGE${s.length===1?"":"S"} FILTERED BY TARGET`,visible:R,width:70,children:e.jsxs(t,{flexDirection:"column",children:[e.jsx(t,{marginBottom:1,children:e.jsxs(r,{dimColor:!0,children:["These packages have newer versions available but are excluded by the current target constraint. Use"," ",e.jsx(r,{bold:!0,color:"white",children:"--target latest"})," ","to include them."]})}),s.map(o=>e.jsxs(t,{gap:1,children:[e.jsxs(r,{children:[" ",o.packageName]}),e.jsxs(r,{dimColor:!0,children:[o.currentRange," ","→"," ",o.newRange]}),e.jsx(r,{bold:!0,color:o.updateType==="major"?"red":o.updateType==="minor"?"yellow":"green",children:o.updateType})]},o.packageName))]})}):null,se=e.jsx(De,{checkedEntries:c.checkedEntries,entries:C,filterActive:c.filterActive,filteredOutCount:s.length,filterText:c.filterText,filterType:c.filterType,focused:c.focusedPanel==="list",groupedByCatalog:c.groupedByCatalog,isDryRun:d,onViewportHeightChange:u,scrollOffset:V,selectedIndex:c.selectedIndex,totalCatalogEntries:f,totalChecked:i,totalEntries:C.length,viewportHeight:S}),ie=e.jsx(Ae,{changelogUrl:O,entry:T,focused:c.focusedPanel==="detail",recommendation:F,scrollRef:m});if(X){const o=Math.floor(g*.35);return e.jsxs(t,{flexDirection:"column",height:j,width:g,children:[e.jsxs(t,{flexDirection:"row",flexGrow:1,children:[e.jsx(t,{flexGrow:1,children:se}),e.jsx(t,{width:o,children:ie})]}),ee,le,te,e.jsx(ce,{autoExitSeconds:a||3,onCancel:()=>{D(!1)},visible:b}),re]})}const ge=Math.floor(j*.55);return e.jsxs(t,{flexDirection:"column",height:j,width:g,children:[e.jsx(t,{height:ge,children:se}),e.jsx(t,{flexGrow:1,children:ie}),ee,le,te,e.jsx(ce,{autoExitSeconds:a||3,onCancel:()=>{D(!1)},visible:b}),re]})};export{_e as C,Ke as U,Ye as V,J as e};