@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,30 @@
1
+ import{createRequire as It}from"node:module";import{b as he,u as Ut,c as W,h as jt,i as be,d as Vt,a as Dt,l as Tt,e as Ie}from"./package-version-Bb7KGF36.js";let St;const Lt=t=>(St??=It(import.meta.url))(t),ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Mt=t=>{if(typeof ne<"u"&&ne.versions&&ne.versions.node){const[e,n]=ne.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ne.getBuiltinModule(t)}return Lt(t)},{createRequire:Pt}=Mt("node:module"),Rt=16,fe=32,Bt=64,T=128,le="positionals";let te=class extends Error{loc;title;hint;type="VisulimaError";constructor({cause:e,hint:n,location:o,message:i,name:s,stack:l,title:a}){super(i,{cause:e}),this.title=a,this.name=s,this.stack=l??this.stack,this.loc=o,this.hint=n}setLocation(e){this.loc=e}setName(e){this.name=e}setMessage(e){this.message=e}setHint(e){this.hint=e}},b=class extends te{code;context;constructor(e,n,o){super({message:e,name:"CerebroError"}),this.code=n,this.context=o}};const nt=String.raw,Se=nt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,zt=()=>new RegExp(nt`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${Se}(?:\u200D${Se})*`,"gu");Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]]));const Zs=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Ys=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,F=zt(),Wt=/[-_./\s]+/g,ce=/(\u001B\[[0-9;]*[a-z])/i,Le=new RegExp("\\p{Script=Arabic}","u"),Ft=new RegExp("\\p{Script=Bengali}","u"),X=new RegExp("\\p{Script=Cyrillic}","u"),qt=new RegExp("\\p{Script=Devanagari}","u"),Gt=new RegExp("\\p{Script=Ethiopic}","u"),me=new RegExp("\\p{Script=Greek}","u"),Me=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),Jt=new RegExp("\\p{Script=Gujarati}","u"),Ht=new RegExp("\\p{Script=Gurmukhi}","u"),Pe=new RegExp("\\p{Script=Hangul}","u"),Ue=new RegExp("\\p{Script=Hebrew}","u"),Kt=new RegExp("\\p{Script=Hiragana}","u"),je=new RegExp("\\p{Script=Han}","u"),Zt=new RegExp("\\p{Script=Kannada}","u"),Yt=new RegExp("\\p{Script=Katakana}","u"),Xt=new RegExp("\\p{Script=Khmer}","u"),Qt=new RegExp("\\p{Script=Lao}","u"),L=new RegExp("\\p{Script=Latin}","u"),en=new RegExp("\\p{Script=Malayalam}","u"),tn=new RegExp("\\p{Script=Myanmar}","u"),nn=new RegExp("\\p{Script=Oriya}","u"),on=new RegExp("\\p{Script=Sinhala}","u"),sn=new RegExp("\\p{Script=Tamil}","u"),rn=new RegExp("\\p{Script=Telugu}","u"),an=new RegExp("\\p{Script=Thai}","u"),ln=new RegExp("\\p{Script=Tibetan}","u"),Ve=/[\u02BB\u02BC\u0027]/u,cn=t=>t.replace(F,""),R=new Uint32Array(65536),un=(t,e)=>{const n=t.length,o=e.length,i=1<<n-1;let s=-1,l=0,a=n,u=n;for(;u--;)R[t.charCodeAt(u)]|=1<<u;for(u=0;u<o;u++){let r=R[e.charCodeAt(u)];const c=r|l;r|=(r&s)+s^s,l|=~(r|s),s&=r,l&i&&a++,s&i&&a--,l=l<<1|1,s=s<<1|~(c|l),l&=c}for(u=n;u--;)R[t.charCodeAt(u)]=0;return a},hn=(t,e)=>{const n=e.length,o=t.length,i=[],s=[],l=Math.ceil(n/32),a=Math.ceil(o/32);for(let p=0;p<l;p++)s[p]=-1,i[p]=0;let u=0;for(;u<a-1;u++){let p=0,w=-1;const $=u*32,m=Math.min(32,o)+$;for(let v=$;v<m;v++)R[t.charCodeAt(v)]|=1<<v;for(let v=0;v<n;v++){const A=R[e.charCodeAt(v)],k=s[v/32|0]>>>v&1,C=i[v/32|0]>>>v&1,j=A|p,_=((A|C)&w)+w^w|A|C;let g=p|~(_|w),y=w&_;g>>>31^k&&(s[v/32|0]^=1<<v),y>>>31^C&&(i[v/32|0]^=1<<v),g=g<<1|k,y=y<<1|C,w=y|~(j|g),p=g&j}for(let v=$;v<m;v++)R[t.charCodeAt(v)]=0}let r=0,c=-1;const d=u*32,h=Math.min(32,o-d)+d;for(let p=d;p<h;p++)R[t.charCodeAt(p)]|=1<<p;let f=o;for(let p=0;p<n;p++){const w=R[e.charCodeAt(p)],$=s[p/32|0]>>>p&1,m=i[p/32|0]>>>p&1,v=w|r,A=((w|m)&c)+c^c|w|m;let k=r|~(A|c),C=c&A;f+=k>>>o-1&1,f-=C>>>o-1&1,k>>>31^$&&(s[p/32|0]^=1<<p),C>>>31^m&&(i[p/32|0]^=1<<p),k=k<<1|$,C=C<<1|m,c=C|~(v|k),r=k&v}for(let p=d;p<h;p++)R[t.charCodeAt(p)]=0;return f},pn=(t,e)=>{if(t.length<e.length){const n=e;e=t,t=n}return e.length===0?t.length:t.length<=32?un(t,e):hn(t,e)};let dn;const fn=t=>(dn??=Pt(import.meta.url))(t),oe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,mn=t=>{if(typeof oe<"u"&&oe.versions&&oe.versions.node){const[e,n]=oe.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return oe.getBuiltinModule(t)}return fn(t)},{writeFile:gn,stat:wn,rm:yn,readFile:De,readdir:vn,mkdir:$n,access:xn}=mn("node:fs/promises"),re=[{alias:"v",description:"Turn on verbose output",group:"global",name:"verbose",type:Boolean},{description:"Turn on debugging output",group:"global",name:"debug",type:Boolean},{alias:"h",description:"Print out helpful usage information",group:"global",name:"help",type:Boolean},{alias:"q",description:"Silence output",group:"global",name:"quiet",type:Boolean},{alias:"V",description:"Print version info",group:"global",name:"version",type:Boolean},{description:"Turn off colored output",group:"global",name:"no-color",type:Boolean},{description:"Force colored output",group:"global",name:"color",type:Boolean}];let G=class extends b{commandName;constructor(e,n=[]){const o=`Command "${e}" not found${n.length>0?`. Did you mean: ${n.join(", ")}?`:""}`;super(o,"COMMAND_NOT_FOUND",{commandName:e,suggestions:n}),this.name="CommandNotFoundError",this.commandName=e,n.length>0&&(this.hint=`Try one of these commands: ${n.join(", ")}`)}},ot=class extends b{option1;option2;constructor(e,n){super(`Options "${e}" and "${n}" cannot be used together`,"CONFLICTING_OPTIONS",{option1:e,option2:n}),this.name="ConflictingOptionsError",this.option1=e,this.option2=n,this.hint=`Remove either --${e} or --${n}`}};class An extends b{unknownOptions;constructor(e,n){const o=e.join(", "),i=`Found unknown ${e.length===1?"option":"options"}: ${o}`;super(i,"UNKNOWN_OPTION",{suggestions:n,unknownOptions:e}),this.name="UnknownOptionError",this.unknownOptions=e,n&&n.length>0&&(this.hint=`Did you mean: ${n.join(", ")}?`)}}class Nn extends b{pluginName;constructor(e,n,o){super(`Plugin "${e}" error: ${n}`,"PLUGIN_ERROR",{originalError:o,pluginName:e}),this.name="PluginError",this.pluginName=e,o&&(this.cause=o)}}class bn{logger;plugins=new Map;initialized=!1;cachedDependencyOrder=void 0;constructor(e){this.logger=e}hasPlugins(){return this.plugins.size>0}register(e){if(this.initialized)throw new Error(`Cannot register plugin "${e.name}" after initialization`);if(this.plugins.has(e.name))throw new Error(`Plugin "${e.name}" is already registered`);he().CEREBRO_OUTPUT_LEVEL===String(T)&&this.logger.debug(`registering plugin: ${e.name}`),this.plugins.set(e.name,e),this.cachedDependencyOrder=void 0}async init(e){if(this.initialized)throw new Error("PluginManager already initialized");if(this.plugins.size===0){this.logger.debug("no plugins registered, skipping initialization"),this.initialized=!0;return}this.validateDependencies();const n=this.getDependencyOrder();this.logger.debug(`initializing ${String(n.length)} plugin(s)...`);for(const o of n)if(typeof o.init=="function"){this.logger.debug(`initializing plugin: ${o.name}`);try{await o.init(e)}catch(i){const s=new Nn(o.name,`Failed to initialize: ${i instanceof Error?i.message:String(i)}`,i instanceof Error?i:void 0);throw this.logger.error(s.message),s}}this.initialized=!0}async executeLifecycle(e,n,o){if(!this.initialized)throw new Error("PluginManager not initialized");if(this.plugins.size===0)return;const i=this.getDependencyOrder();for(const s of i){const l=s[e];if(typeof l=="function"){this.logger.debug(`executing ${e} hook for plugin: ${s.name}`);try{await(e==="afterCommand"?l(n,o):l(n))}catch(a){throw this.logger.error(`Error in ${e} hook for plugin "${s.name}":`,a),a}}}}async executeErrorHandlers(e,n){if(!this.initialized||this.plugins.size===0)return;const o=this.getDependencyOrder();for(const i of o)if(typeof i.onError=="function"){this.logger.debug(`executing error handler for plugin: ${i.name}`);try{await i.onError(e,n)}catch(s){this.logger.error(`Error in error handler for plugin "${i.name}":`,s)}}}getDependencyOrder(){if(this.cachedDependencyOrder!==void 0)return this.cachedDependencyOrder;const e=[],n=new Set,o=new Set,i=s=>{if(n.has(s))return;if(o.has(s))throw new Error(`Circular dependency detected involving plugin "${s}"`);const l=this.plugins.get(s);if(!l)throw new Error(`Plugin "${s}" not found`);if(o.add(s),l.dependencies)for(const a of l.dependencies)i(a);o.delete(s),n.add(s),e.push(l)};for(const s of this.plugins.keys())i(s);return this.cachedDependencyOrder=e,e}validateDependencies(){for(const e of this.plugins.values())if(e.dependencies){for(const n of e.dependencies)if(!this.plugins.has(n))throw new Error(`Plugin "${e.name}" depends on "${n}" which is not registered`)}}}const se=t=>t.type?.name==="Boolean",Cn=t=>{let e=t.type?t.type.name.toLowerCase():"string";const n=t.multiple??t.lazyMultiple?"[]":"";return e&&(e=e==="boolean"?"":`{underline ${e}${n}}`),e},Te=t=>(se(t)||(t.typeLabel=t.typeLabel??Cn(t),t.defaultOption&&(t.typeLabel=`${t.typeLabel} (D)`),t.required&&(t.typeLabel=`${t.typeLabel} (R)`)),t),kn=new RegExp(/^-([^\d-])$/),En=new RegExp(/^--(\S+)/),On=new RegExp(/^-([^\d-]{2,})$/),_n=t=>kn.test(t)||En.test(t)||On.test(t),In=(t,e)=>{const n=e[0]&&_n(e[0])||e.length===0?null:e.shift()??null;if(!t.includes(n)){const o=new Error(`Command not recognised: ${String(n)}`);throw o.command=n,o.name="INVALID_COMMAND",o}return{argv:e,command:n}};let Sn=class st extends te{optionName;value;constructor(e,n,o){super({hint:`Pass a valid ${o} value for '${e}'.`,message:`Invalid ${o} value '${n}' for option '${e}'`,name:"INVALID_VALUE",title:"Invalid Value"}),this.optionName=e,this.value=n,Object.setPrototypeOf(this,st.prototype)}},Ln=class it extends te{optionName;constructor(e){super({cause:void 0,hint:`Remove the duplicate option '${e}' from your command line arguments.`,location:void 0,message:`Option '${e}' is already set`,name:"ALREADY_SET",stack:void 0,title:"Option Already Set"}),this.optionName=e,Object.setPrototypeOf(this,it.prototype)}},Re=class rt extends te{optionName;constructor(e){super({cause:void 0,hint:`Check your option definitions or remove the unknown option '${e}' from your command line arguments.`,location:void 0,message:`Unknown option: --${e}`,name:"UNKNOWN_OPTION",stack:void 0,title:"Unknown Option"}),this.optionName=`--${e}`,Object.setPrototypeOf(this,rt.prototype)}},Mn=class at extends te{value;constructor(e){super({hint:"Use a defined option or add a defaultOption to capture this value.",message:`Unknown value: ${e}`,name:"UNKNOWN_VALUE",title:"Unknown Value"}),this.value=e,Object.setPrototypeOf(this,at.prototype)}},M=class lt extends te{constructor(e,n){super({cause:void 0,hint:n,location:void 0,message:e,name:"INVALID_DEFINITIONS",stack:void 0,title:"Invalid Option Definition"}),Object.setPrototypeOf(this,lt.prototype)}};const H=t=>t===Boolean||typeof t=="function"&&t.name==="Boolean",Ce=t=>t===Number||typeof t=="function"&&t.name==="Number",Be=t=>t===String||typeof t=="function"&&t.name==="String",ze=(t,e,n)=>{const o=Number(t);if(e&&Number.isNaN(o)&&String(t).trim().toLowerCase()!=="nan")throw new Sn(n??"",String(t),"Number");return o},Pn=(t,e,n={})=>{const{optionName:o,strictTypes:i}=n;return Array.isArray(t)?H(e)?t.map(Boolean):Ce(e)?t.map(s=>ze(s,i,o)):Be(e)?t.map(String):t.map(s=>e(String(s))):t===null?null:H(e)?!!t:Ce(e)?ze(t,i,o):Be(e)?typeof t=="string"?t:String(t):e(typeof t=="string"?t:String(t))},O=(t,e,n,...o)=>{t&&console.debug(`[command-line-args:${n}] ${e}`,...o)},Un=/-([a-z])/g,jn=/^\d+$/,Vn=t=>t.codePointAt(0)===95,We=(t,e)=>Array.isArray(t)?[...t,...e]:[t,...e],Fe=t=>t==="__proto__"||t==="constructor"||t==="prototype",ge=(t,e,n,o=!1)=>{t[e]===void 0?t[e]=o?[n]:n:o&&Array.isArray(t[e])?t[e].push(n):t[e]=[t[e],n]},qe=(t,e,n,o,i)=>{let s=e.get(t)??n.get(t);if(!s&&o){const l=t.toLowerCase();s=o.get(l)??i?.get(l)}return s},Dn=(t,e,n,o)=>{const i=n.debug??!1;O(i,"resolveArgs called with options:","resolver",{partial:n.partial,stopAtFirstUnknown:n.stopAtFirstUnknown}),O(i,"Starting argument resolution","resolver"),O(i,"Tokens:","resolver",t),O(i,"Definitions:","resolver",e),O(i,"Processing tokens...","resolver");const s=new Map,l=new Map,a=n.caseInsensitive?new Map:void 0,u=n.caseInsensitive?new Map:void 0,r=n.camelCase?new Map:void 0,c=n.camelCase?new Map:void 0;for(const g of e)if(s.set(g.name,g),g.alias&&l.set(g.alias,g),n.caseInsensitive&&a&&(a.set(g.name.toLowerCase(),g),g.alias&&u&&u.set(g.alias.toLowerCase(),g)),n.camelCase&&r&&c){const y=g.name.replaceAll(Un,(x,I)=>I.toUpperCase());r.set(g.name,y),c.set(y,g.name)}const d=Object.create(null),h=Object.create(null),f=[],p=[],w=new Set;let $=!1;const m=e.find(g=>g.defaultOption),v=e.some(g=>g.group),A=e.find(g=>Ce(g.type));for(let g=0;g<t.length;g++){const y=t[g];if(y.kind==="option-terminator"){d._unknown=o.slice(y.index),$=!0;break}if(y.kind==="option"&&y.name){let x=qe(y.name,s,l,a,u);!x&&y.value===void 0&&A&&jn.test(y.name)&&(x=A,y.value=y.name,y.name=A.name);let I=!1;if(!x&&n.negation&&y.value===void 0&&y.name.startsWith("no-")){const E=y.name.slice(3),U=qe(E,s,l,a,u);U?.type&&H(U.type)&&(x=U,I=!0)}const N=x?x.name:y.name,S=x?.multiple,P=x?.lazyMultiple;if(Object.hasOwn(h,N)&&h[N]!==void 0&&!S&&!P&&!n.partial)throw new Ln(N);if(!x&&n.partial){const E=y.rawName??`--${y.name}${y.value!==void 0&&y.inlineValue?`=${y.value}`:""}`;f.push({index:y.index,value:E});continue}if(!x&&n.stopAtFirstUnknown){d._unknown=o.slice(y.index);break}if(!x&&!n.partial)throw new Re(y.name);if(y.value===void 0){const E=t[g+1],U=E?.kind==="option"&&!("name"in E)&&E.value!==void 0,V=E&&x&&!(x.type&&H(x.type))&&(E.kind==="positional"||U),_t=x&&x.defaultOption&&!x.multiple&&!x.lazyMultiple;if(V&&(!x?.defaultOption||_t))if(S){let D=g+1;const de=[];for(;D<t.length&&(t[D].kind==="positional"||t[D].kind==="option"&&!("name"in t[D])&&t[D].value!==void 0);)de.push(t[D].value),w.add(t[D].index),D++;h[N]=h[N]===void 0?de:We(h[N],de),g=D-1}else P?(ge(h,N,E.value,!0),w.add(E.index),g++):(h[N]=E.value,w.add(E.index),g++);else x?.type&&H(x.type)?ge(h,N,!I,S):(S||P)&&h[N]!==void 0?ge(h,N,null,!0):h[N]=S?[]:null}else{let{value:E}=y;if(x?.type&&H(x.type))switch(E){case"":{if(n.partial){const V=`${y.rawName??`--${y.name}`}${y.value?`=${y.value}`:""}`;p.push({index:y.index,value:V}),E=!0}else throw new Re(y.name);break}case"false":{E=!1;break}case"true":{E=!0;break}default:E=!0}const U=[E];if(S){let V=g+1;for(;V<t.length&&t[V].kind==="positional";)U.push(t[V].value),w.add(t[V].index),V++;g=V-1}h[N]===void 0?h[N]=S||P?U:E:S||P?h[N]=We(h[N],U):h[N]=E}}else if(y.kind==="positional"&&n.stopAtFirstUnknown&&!w.has(y.index)&&!m){O(i,`Found unconsumed positional token at index ${String(y.index)}, stopping processing`,"resolver"),d._unknown=o.slice(y.index);break}}for(const[g,y]of Object.entries(h)){const x=s.get(g);x&&(x.multiple||x.lazyMultiple)&&!Array.isArray(y)&&(h[g]=[y])}const k=g=>g.kind==="option"&&!s.has(g.name??"")&&!l.has(g.name??"")&&(!n.caseInsensitive||!a?.has(g.name?.toLowerCase()??"")&&!u?.has(g.name?.toLowerCase()??""));let C=-1,j=Number.POSITIVE_INFINITY;if(n.stopAtFirstUnknown&&!$&&(C=t.findIndex(g=>k(g)),C!==-1&&(j=t[C].index)),m){const g=[],y=[];for(const x of t)x.kind==="positional"&&!w.has(x.index)&&x.index<j&&(g.push(x.value),y.push(x));if(g.length>0){const x=h[m.name],I=m.multiple??m.lazyMultiple;x===void 0?I?(y.forEach(N=>w.add(N.index)),h[m.name]=g):(w.add(y[0].index),h[m.name]=g[0]):I&&(y.forEach(N=>w.add(N.index)),h[m.name]=Array.isArray(x)?[...g,...x]:[...g,x])}}if(!n.partial){for(const g of t)if(g.kind==="positional"&&!w.has(g.index))throw new Mn(o[g.index])}if(n.partial&&!n.stopAtFirstUnknown){const g=[...f];for(const y of p)g.push({index:y.index,value:y.value});for(const y of t)y.kind==="positional"&&!w.has(y.index)&&g.push({index:y.index,value:o[y.index]});g.length>0&&(g.sort((y,x)=>y.index-x.index),d._unknown=g.map(y=>y.value))}if(n.stopAtFirstUnknown&&!$){const g=t.findIndex(x=>x.kind==="positional"&&!w.has(x.index));let y=-1;if(C!==-1&&g!==-1?y=Math.min(C,g):C!==-1?y=C:g!==-1&&(y=g),y>=0){const x=t[y].index;d._unknown=o.slice(x)}}for(const[g,y]of Object.entries(h)){const x=n.camelCase?r?.get(g)??g:g,I=s.get(g);I?.type?d[x]=Pn(y,I.type,{optionName:I.name,strictTypes:n.strictTypes}):d[x]=y===void 0?null:y}for(const g of e){const y=n.camelCase?r?.get(g.name)??g.name:g.name;!(y in d)&&g.defaultValue!==void 0&&(g.multiple??g.lazyMultiple?d[y]=Array.isArray(g.defaultValue)?[...g.defaultValue]:[g.defaultValue]:d[y]=g.defaultValue)}if(v){const g={},y={},x={};for(const N of e)if(N.group){const S=Array.isArray(N.group)?N.group:[N.group];for(const P of S)Fe(P)||(g[P]??={})}for(const N of Object.keys(d))if(!Vn(N)){y[N]=d[N];let S=N;n.camelCase&&(S=c?.get(N)??N);const P=s.get(S);if(P?.group){const E=Array.isArray(P.group)?P.group:[P.group];for(const U of E)Fe(U)||g[U]&&(g[U][N]=d[N])}else x[N]=d[N]}const I={_all:y};for(const[N,S]of Object.entries(g))I[N]=S;Object.keys(x).length>0&&(I._none=x),d._unknown&&(I._unknown=d._unknown),Object.keys(d).forEach(N=>delete d[N]),Object.assign(d,I)}const _=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));return O(i,"Final parsed result:","resolver",_),_},ct="-",ee=ct.codePointAt(0),K="=",Tn=K.codePointAt(0),Rn="--",Bn=ct,zn="--",ut=t=>t.length>2&&t.startsWith(zn),Wn=t=>ut(t)&&!t.includes(K,3),Fn=t=>ut(t)&&t.includes(K,3),qn=t=>{if(t.length!==2||t.codePointAt(0)!==ee||t.codePointAt(1)===ee)return!1;const e=t.codePointAt(1);return e!==void 0&&(e<48||e>57)},Gn=t=>{if(t.length<=2||t.codePointAt(0)!==ee||t.codePointAt(1)===ee)return!1;const e=t.codePointAt(1);return!(e!==void 0&&e>=48&&e<=57)},Jn=t=>{const e=[];let n=0,o=[],i=0,s=-1,l=0;for(;i<o.length||n<t.length;){let a;if(i<o.length?(a=o[i],i++):(a=t[n],n++),l>0?l--:s++,a===Rn){e.push({index:s,kind:"option-terminator"});const u=[...o.slice(i),...t.slice(n)],r=u.map((c,d)=>({index:s+d+1,kind:"positional",value:c}));e.push(...r),s+=u.length;break}if(qn(a)){const u=a.charAt(1);e.push({index:s,kind:"option",name:u,rawName:a});continue}if(Gn(a)&&!a.includes(K)){const u=[];let r="",c=!1;for(let d=1;d<a.length;d++){const h=a.charAt(d);c?r+=h:h.codePointAt(0)===Tn?c=!0:u.push(`${Bn}${h}`)}if(c)if(u.length>0){const d=u.pop();u.push(`${d}=${r}`)}else u.push(r);o=i<o.length?[...u,...o.slice(i)]:u,i=0,l=u.length;continue}if(Wn(a)){const u=a.slice(2);e.push({index:s,kind:"option",name:u,rawName:a});continue}if(Fn(a)){const u=a.indexOf(K),r=a.slice(2,u),c=a.slice(u+1);e.push({index:s,inlineValue:!0,kind:"option",name:r,rawName:a,value:c});continue}if(a.length>2&&a.codePointAt(0)===ee&&a.codePointAt(1)!==ee&&a.includes(K)){const u=a.indexOf(K),r=a.charAt(1),c=a.slice(u+1);e.push({index:s,inlineValue:!0,kind:"option",name:r,rawName:a,value:c});continue}e.push({index:s,kind:"positional",value:a})}return e},Hn=/\d/,Kn=t=>typeof t=="function",Zn=(t,e,n)=>{const o=n?.debug??!1;O(o,"Validating definitions:","validation",t,"caseInsensitive:",e);const i=new Set,s=new Set,l=new Set,a=new Set;let u=0;for(const r of t){if(O(o,"Checking definition:","validation",r),!r.name)throw O(o,"Validation failed: name is required","validation"),new M("Invalid option definition: name is required");if(typeof r.name!="string")throw new M("Invalid option definition: name must be a string");if(r.name.trim()==="")throw new M("Invalid option definition: name cannot be empty");const c=e?r.name.toLowerCase():"";if(i.has(r.name)||e&&l.has(c))throw new M(`Invalid option definition: duplicate name '${r.name}'`);if(s.has(r.name)||e&&a.has(c))throw new M(`Invalid option definition: name '${r.name}' conflicts with an existing alias`);if(i.add(r.name),e&&l.add(c),r.alias!==void 0){if(typeof r.alias!="string")throw new M("Invalid option definition: alias must be a string");if(r.alias.length!==1)throw new M("Invalid option definition: alias must be a single character");if(Hn.test(r.alias))throw new M("Invalid option definition: alias cannot be numeric");if(r.alias==="-")throw new M('Invalid option definition: alias cannot be "-"');const d=e?r.alias.toLowerCase():"";if(s.has(r.alias)||e&&a.has(d))throw new M(`Invalid option definition: duplicate alias '${r.alias}'`);if(i.has(r.alias)||e&&l.has(d))throw new M(`Invalid option definition: alias '${r.alias}' conflicts with an existing option name`);s.add(r.alias),e&&a.add(d)}if(r.defaultOption&&(u++,r.type!==void 0&&H(r.type)))throw new M("Invalid option definition: defaultOption cannot be Boolean type");if(r.type!==void 0&&!(r.type===Boolean||r.type===Number||r.type===String||typeof r.type=="function"&&Kn(r.type)))throw new M("Invalid option definition: invalid type")}if(u>1)throw O(o,"Validation failed: multiple defaultOptions not allowed","validation"),new M("Invalid option definition: multiple defaultOptions not allowed");O(o,"Validation completed successfully","validation")};function Yn(t,e={}){const n=e.debug??!1;O(n,"Starting command-line-args parsing","index"),O(n,"Options:","index",e);const o={...e};o.stopAtFirstUnknown&&(o.partial=!0);const i=Array.isArray(t)?t:[t];O(n,"Normalized definitions:","index",i),Zn(i,o.caseInsensitive,n?o:void 0);let{argv:s}=o;s??=process.argv.slice(2),O(n,"Using argv:","index",s);let l=s;o.caseInsensitive&&(l=s.map(r=>{if(r.startsWith("--")){const c=r.indexOf("="),d=(c===-1?r.slice(2):r.slice(2,c)).toLowerCase();return c===-1?`--${d}`:`--${d}${r.slice(c)}`}if(r.startsWith("-")&&!r.startsWith("--")&&r.length>1){const c=r.indexOf("="),d=c===-1?r.slice(1):r.slice(1,c);if(!d)return r;const h=d.toLowerCase();return c===-1?`-${h}`:`-${h}${r.slice(c)}`}return r}));const a=Jn(l.map(String));O(n,"Tokenized arguments:","index",a);const u=Dn(a,i,o,s);return O(n,"Command-line-args parsing completed","index"),u}class Xn{result;argv;options;argument;command;commandName;env;logger;console;fs;process;runtime;rawUnknown;constructor(e,n){this.commandName=e,this.command=n}}let we=class extends b{commandName;constructor(e,n,o){super(`Failed to load command "${e}": ${n}`,"COMMAND_LOADER_ERROR",{commandName:e,reason:n}),this.name="CommandLoaderError",this.commandName=e,this.hint="Ensure the loader resolves to a module with a default export that is the command handler function.",o!==void 0&&(this.cause=o)}};const Qn=/^-{1,2}(\w+)(=(.+))?$/,ht=(t,e,n,o)=>{const i=Qn.exec(t);if(i===null)return{};const s=i[1];if(!s)return{};const l=n&&o?n.get(s)??o.get(s):e.find(a=>a.name===s||a.alias===s);return l!==void 0?{argName:l.name,argValue:i[3],option:l}:{}},Ge=(t,e)=>{if(e.type===void 0)return t;if(e.type.name==="Boolean"){if(t==="true"||t==="1")return e.type(!0);if(t==="false"||t==="0")return e.type(!1)}return e.type(t)},eo=new Set(["0","1","false","true"]),to=(t,e,n,o)=>{if(e.length===0||t.length===0)return{};const i=(s,l)=>{const{argName:a,argValue:u,option:r}=ht(l,e,n,o),{lastOption:c}=s;return r&&se(r)&&u&&a?s.partial[a]=Ge(u,r):s.lastName&&c&&se(c)&&eo.has(l)&&(s.partial[s.lastName]=Ge(l,c)),{lastName:a,lastOption:r,partial:s.partial}};return t.reduce(i,{partial:{}}).partial},no=new Set(["0","1","false","true"]),oo=(t,e,n,o)=>{if(e.length===0||t.length===0)return t;const i=(s,l)=>{const{argValue:a,option:u}=ht(l,e,n,o),{lastOption:r}=s;if(r&&se(r)&&no.has(l)){const{args:c}=s;return{args:c.slice(0,-1)}}return u&&se(u)&&a?{args:s.args}:{args:[...s.args,l],lastOption:u}};return t.reduce(i,{args:[]}).args},so=t=>{const e=new Map;for(const n of t){const o=e.get(n.name);o?e.set(n.name,{...o,...n}):e.set(n.name,n)}return[...e.values()]},io=t=>{if(t===void 0)return;const e=t.toLowerCase().trim();return e==="true"||e==="1"||e==="yes"||e==="on"},ro=(t,e)=>{if(!t.type)return e;if(e!==void 0){if(t.type===Boolean||typeof t.type=="function"&&t.type.name==="Boolean")return io(e);if(t.type===Number||typeof t.type=="function"&&t.type.name==="Number"){const n=Number.parseFloat(e);return Number.isNaN(n)?void 0:n}return t.type===String||typeof t.type=="function"&&t.type.name==="String"?e:t.type(e)}},ao=/_./g,lo=/^[A-Z]/,co=t=>t.toLowerCase().replaceAll(ao,e=>e[1]?.toUpperCase()??e).replace(lo,e=>e.toLowerCase()),uo=(t,e=he())=>{if(!t||t.length===0)return{};const n={};for(const o of t){const i=e[o.name],s=ro(o,i),l=s===void 0?o.defaultValue:s,a=co(o.name);n[a]=l}return n},ho=t=>{const e=new Map,n=new Map;for(const o of t)if(e.set(o.name,o),o.alias){const i=Array.isArray(o.alias)?o.alias:[o.alias];for(const s of i)n.set(s,o)}return{optionMapByAlias:n,optionMapByName:e}},pt=async t=>{if(typeof t.__resolvedExecute__=="function")return t.__resolvedExecute__;if(typeof t.loader!="function")throw new we(t.name,"no execute or loader defined");let e;try{e=await t.loader()}catch(o){throw new we(t.name,o instanceof Error?o.message:String(o),o)}const n=e.default;if(typeof n!="function")throw new we(t.name,"loader did not return a module with a default-exported handler function");return t.__resolvedExecute__=n,n},po=(t,e,n,o,i)=>{const s=new Xn(t.name,t),{_all:l,_unknown:a,positionals:u}=e,r=Object.keys(n).length>0?{...l,...n}:l;le in r&&delete r[le],s.argument=u?.[le]??[],s.rawUnknown=[...a??[]];const c=Object.keys(o).length>0;return s.options=c?{...r,...o}:r,s.env=uo(t.env,i),s},fo=(t,e,n)=>{const o=t.options??[],i=o.length>0;let s=so(i?[...o,...n]:n);if(s.length>0){for(const r of s)if(r.multiple&&r.lazyMultiple)throw new Error(`Argument "${r.name}" cannot have both multiple and lazyMultiple options, please choose one.`)}t.argument&&(s=[{defaultOption:!0,description:t.argument.description,group:"positionals",multiple:!0,name:le,type:t.argument.type,typeLabel:t.argument.typeLabel},...s]);let l,a;if(i){const{optionMapByAlias:r,optionMapByName:c}=ho(o);l=oo(e,o,c,r),a=to(e,o,c,r)}else l=e,a={};const u=Yn(s,{argv:l,camelCase:!0,partial:!0,stopAtFirstUnknown:!0});return{arguments_:s,booleanValues:a,parsedArgs:u}},ye=async(t,e,n)=>typeof t.execute=="function"?t.execute(e):(await pt(t))(e);let mo=class{capacity;cache;constructor(t){this.capacity=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;const e=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,e),e}has(t){return this.cache.has(t)}set(t,e){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.capacity){const n=this.cache.keys().next().value;n!==void 0&&this.cache.delete(n)}this.cache.set(t,e)}delete(t){this.cache.delete(t)}clear(){this.cache.clear()}size(){return this.cache.size}};const go=(t,e)=>typeof t!="string"||t===""?"":t[0].toLowerCase()+t.slice(1),wo=new RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))","g"),yo=t=>{if(typeof t!="string")throw new TypeError(`The "value" argument must be of type string. Received ${typeof t}`);return t.replaceAll(wo,"")},ve=new mo(1e3),vo=/[.*+?^${}()|[\]\\]/g,$o=t=>{const e=t.join("");if(ve.has(e)){const i=ve.get(e);return i.lastIndex=0,i}const n=t.map(i=>i.replaceAll(vo,String.raw`\$&`)).join("|"),o=new RegExp(n,"g");return ve.set(e,o),o},xo=t=>{const e=[];let n=0,o;for(F.lastIndex=0;(o=F.exec(t))!==null;)o.index>n&&e.push(t.slice(n,o.index)),e.push(o[0]),n=F.lastIndex;return n<t.length&&e.push(t.slice(n)),e.filter(Boolean)},Ao=/[ČŠŽĐ]/i,dt=new Uint8Array(128),ft=new Uint8Array(128),mt=new Uint8Array(128);for(let t=0;t<128;t++)dt[t]=t>=65&&t<=90?1:0,ft[t]=t>=97&&t<=122?1:0,mt[t]=t>=48&&t<=57?1:0;const $e=t=>dt[t],Je=t=>ft[t],xe=t=>mt[t],B=(t,e,n,o,i)=>{if(t.length===0)return[];let s=!1;const l=Object.values(e);for(const f of l)if(f(t[0])){s=!0;break}if(!s&&!n)return[t];const a=[...t],u=[];let r=a[0],c="other";const d=Object.entries(e);for(const f of d){const[p,w]=f;if(w(a[0])){c=p;break}}let h=n&&o?a[0]===a[0].toLocaleUpperCase(o):!1;for(let f=1;f<a.length;f++){const p=a[f];let w="other";for(const v of d){const[A,k]=v;if(k(p)){w=A;break}}const $=n&&o?p===p.toLocaleUpperCase(o):!1;let m=!1;i?m=i(c,w,h,$,p,f,a):(c!==w&&c!=="other"&&w!=="other"&&(m=!0),n&&w!=="other"&&!h&&$&&(m=!0)),m?(u.push(r),r=p):r+=p,c=w,n&&(h=$)}return r&&r.length>0&&u.push(r),u.length>0?u:[t]},No=(t,e,n,o)=>{if(n.size===0)return e;for(const i of n)if(t.startsWith(i,e))return o.push(i),e+i.length;return e},gt=(t,e=new Set)=>{if(t.length===0)return[];if(t.toUpperCase()===t)return[t];let n=0;const o=[],i=t.length;for(let s=1;s<i;s++){const l=No(t,n,e,o);if(l!==n){n=l,s=n-1;continue}const a=t.codePointAt(s-1),u=t.codePointAt(s),r=a&&a<128&&$e(a),c=u&&u<128&&$e(u),d=a&&a<128&&Je(a),h=a&&a<128&&xe(a),f=u&&u<128&&xe(u);if(d&&c){o.push(t.slice(n,s)),n=s;continue}if(h&&!f||!h&&f){o.push(t.slice(n,s)),n=s;continue}if(f&&!h){let p=!1,w=!1;if(s+1<i){const $=t.codePointAt(s+1);p=$&&$<128&&$e($),w=$&&$<128&&xe($)}if(!w&&p){o.push(t.slice(n,s),t.slice(s,s+1)),n=s+1;continue}}if(s+1<i){const p=t.codePointAt(s+1),w=p&&p<128&&Je(p);if(r&&c&&w){const $=t.slice(n,s+1);e.has($)||(o.push(t.slice(n,s)),n=s)}}}return n<i&&o.push(t.slice(n)),o.filter(s=>s!=="")},wt=(t,e,n)=>{if(t.length===0)return[];const o=t===t.toLocaleUpperCase(e);if(e.startsWith("de")){if(!o&&t.replaceAll("ß","SS")===t.toLocaleUpperCase(e))return[t];const r=[...t],c=r.length,d=[];let h=r[0],f=r[0]===r[0].toLocaleUpperCase(e),p=f,w=f?0:-1;for(let $=1;$<c;$++){const m=r[$],v=m===m.toLocaleUpperCase(e);if(v===f)h+=m;else if(v)h&&h.length>0&&(d.push(h),h=m),p=!0,w=$;else{if(p&&$-w>1){const A=r[$-1],k=h.slice(0,-1);k&&k.length>0&&d.push(k),h=A+m}else h+=m;p=!1,w=-1}f=v}return h&&h.length>0&&d.push(h),d}if(e.startsWith("uk")||e.startsWith("ru")||e.startsWith("bg")||e.startsWith("sr")||e.startsWith("mk")||e.startsWith("be")){if(!X.test(t)&&!L.test(t))return[t];const r=[...t],c=r.length,d=[];let h=r[0];const f=r[0];let p;X.test(f)?p=1:L.test(f)?p=2:p=0;let w=f===f.toLocaleUpperCase(e);for(let m=1;m<c;m++){const v=r[m];let A;X.test(v)?A=1:L.test(v)?A=2:A=0;const k=v===v.toLocaleUpperCase(e);p!==A&&(p===1||p===2)&&(A===1||A===2)||A===p&&!w&&k?(d.push(h),h=v):h+=v,p=A,w=k}h&&h.length>0&&d.push(h);const $=[];for(let m=0;m<d.length;m++)m<d.length-1&&d[m].length===1&&L.test(d[m])&&X.test(d[m+1][0])?($.push(d[m]+d[m+1]),m+=1):$.push(d[m]);return $}if(e.startsWith("el")){if(!me.test(t)&&!L.test(t))return[t];const r=[];Me.lastIndex=0;let c;for(;(c=Me.exec(t))!==null;)r.push(c[0]);r.length===0&&r.push(t);const d=[];if(r.length===1){const h=r[0];if(!h||!me.test(h[0])||h.length===1)return[h??t]}for(const h of r){if(!h)continue;if(!me.test(h[0])||h.length===1){d.push(h);continue}const f=h.length;let p=h[0],w=h[0]===h[0].toLocaleUpperCase(e);for(let $=1;$<f;$++){const m=h[$],v=m===m.toLocaleUpperCase(e);!w&&v?(d.push(p),p=m):p+=m,w=v}p&&d.push(p)}return d}if(e.startsWith("ja")||e.startsWith("ko")){const r=e.startsWith("ja"),c=r?{hiragana:h=>Kt.test(h),kanji:h=>je.test(h),katakana:h=>Yt.test(h),latin:h=>L.test(h)}:{hangul:h=>Pe.test(h),latin:h=>L.test(h)},d=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(r){const h=B(t,c,!1,e,(p,w)=>p==="hiragana"&&w==="katakana"||p==="katakana"&&w==="hiragana"||p==="hiragana"&&w==="latin"||p==="katakana"&&w==="latin"||p==="kanji"&&w==="latin"||p==="latin"&&(w==="hiragana"||w==="katakana"||w==="kanji")),f=[];for(const p of h){const w=p;w.length===1&&d.has(w)&&f.length>0?f[f.length-1]=f.at(-1)+w:f.push(w)}return f.length>0?f:[t]}return B(t,c,!1,e,(h,f)=>h==="hangul"&&f==="latin"||h==="latin"&&f==="hangul")}if(e.startsWith("sl")){const r=[...t],c=r.length,d=[];let h=r[0],f=r[0]===r[0].toLocaleUpperCase(e);for(let p=1;p<c;p++){const w=r[p],$=w===w.toLocaleUpperCase(e),m=Ao.test(w),v=p<c-1&&r[p+1]===r[p+1].toLocaleUpperCase(e);!f&&$||m&&v?(d.push(h),h=w,m&&v&&(d.push(h),h="")):h+=w,f=$}return h&&h.length>0&&d.push(h),d}if(e.startsWith("zh"))return B(t,{han:r=>je.test(r),latin:r=>L.test(r)},!1,e);if(["ar","fa","he","ur"].includes(e.split("-")[0])){const r=c=>Ue.test(c)||Le.test(c);return B(t,{latin:c=>L.test(c),rtl:c=>r(c)},!1,e)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(e.split("-")[0])){const r=c=>qt.test(c)||Ft.test(c)||Jt.test(c)||Ht.test(c)||Zt.test(c)||sn.test(c)||rn.test(c)||en.test(c)||on.test(c)||an.test(c)||Qt.test(c)||ln.test(c)||tn.test(c)||Gt.test(c)||Xt.test(c)||nn.test(c);return B(t,{indic:c=>r(c),latin:c=>L.test(c)},!1,e)}if(["be","bg","ru","sr","uk"].includes(e))return B(t,{cyrillic:r=>X.test(r),latin:r=>L.test(r)},!0,e);if(["ar","fa","he"].includes(e))return B(t,{latin:r=>L.test(r),rtl:r=>Ue.test(r)||Le.test(r)},!1,e);if(e.startsWith("ko"))return B(t,{hangul:r=>Pe.test(r),latin:r=>L.test(r)},!1,e);if(e.startsWith("uz")){if(!X.test(t)&&!L.test(t))return[t];const r=[...t],c=r.length,d=[];let h=r[0],f=r[0]===r[0].toLocaleUpperCase(e);for(let p=1;p<c;p++){const w=r[p],$=w===w.toLocaleUpperCase(e);if(Ve.test(w)||Ve.test(r[p-1])){h+=w;continue}!f&&$?(d.push(h),h=w):h+=w,f=$}return h&&h.length>0&&d.push(h),d}const i=[...t],s=i.length,l=[];let a=i[0],u=i[0]===i[0].toLocaleUpperCase(e);for(const r of n)if(t.startsWith(r)){l.push(r),a=i[r.length],u=a===a.toLocaleUpperCase(e);break}for(let r=1;r<s;r++){const c=i[r],d=c===c.toLocaleUpperCase(e);let h=0;for(const f of n)if(t.startsWith(f,r)){l.push(a,f),h=f.length,a="";const p=f.at(-1);p&&(u=p===p.toLocaleUpperCase(e));break}if(h>0){r+=h-1;continue}!u&&d?(l.push(a),a=c):a+=c,u=d}return a&&l.push(a),l},bo=(t,e,n)=>{const o=[],i=ce.test(t)?t.split(ce).filter(Boolean):[t];for(const s of i){const l=s;if(ce.test(l))o.push(l);else{F.lastIndex=0;const a=F.test(l)?xo(l).filter(Boolean):[l];for(const u of a)if(F.lastIndex=0,F.test(u))o.push(u);else if(e){const r=e.toLowerCase().split("-")[0];o.push(...wt(u,r,n))}else o.push(...gt(u,n))}}return o},Co=(t,e={})=>{if(!t||typeof t!="string")return[];const{handleAnsi:n=!1,handleEmoji:o=!1,knownAcronyms:i=[],locale:s,normalize:l=!1,separators:a,stripAnsi:u=!1,stripEmoji:r=!1}=e,c=new Set([...i].toSorted((m,v)=>v.length-m.length));let d=t;u&&(d=yo(d)),r&&(d=cn(d));let h;Array.isArray(a)?h=$o(a):a instanceof RegExp?h=a:h=Wt;const f=[];let p=d;const w=h.flags.includes("g")?h:new RegExp(h.source,`${h.flags}g`);for(;p.length>0;){const m=w.exec(p);if(!m){p===".."?f.push(".."):p==="."?f.push("."):p.length>0&&f.push(p);break}const v=m.index,A=m[0],k=A.length,C=p.slice(0,v),j=p.slice(v+k);if(A.startsWith("../"))f.push(".."),p=p.slice(v+3);else if(A.startsWith("./"))f.push("."),p=p.slice(v+2);else if(v===0&&A==="..")f.push(".."),p=p.slice(2);else if(v===0&&A===".")f.push("."),p=p.slice(1);else{C.length>0&&f.push(C);let _=0;for(;(_=A.indexOf("../",_))!==-1;)f.push(".."),_+=3;for(_=0;(_=A.indexOf("./",_))!==-1;)(_===0||A[_-1]!==".")&&f.push("."),_+=2;let g=j;for(;g.startsWith("../");)f.push(".."),g=g.slice(3);for(;g.startsWith("./");)f.push("."),g=g.slice(2);if(g===".."){f.push("..");break}else if(g==="."){f.push(".");break}else p=g}w.lastIndex=0}if(f.length===0){const m=d.split(h).filter(Boolean);f.push(...m)}let $=[];for(const m of f)n||o?$.push(...bo(m,s,c)):s?$.push(...wt(m,s,c)):$.push(...gt(m,c));return l&&($=$.map(m=>c.has(m)?m:s&&m===m.toLocaleUpperCase(s)?m[0]+m.slice(1).toLocaleLowerCase(s):m.toUpperCase()===m&&!c.has(m)?m.slice(0,1)+m.slice(1).toLowerCase():m)),$},ko=(t,e)=>typeof t!="string"||t===""?"":t[0].toUpperCase()+t.slice(1),Eo=(t,e)=>{const{length:n}=t;if(n===0)return"";if(n===1)return t[0];const o=[];let i="",s="";for(let l=0;l<n;l++){const a=t[l];if(ce.test(a)){i?(o.push(i+s+a),i="",s=""):(o.length>0&&o.push(e),i=a);continue}i?(s&&(s+=e),s+=a):(o.length>0&&o.push(e),o.push(a))}return o.join("")},Q=(t,e)=>{if(typeof t!="string"||!t)return"";let n=!0;return Eo(Co(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(o=>{const i=o,s=i.toLowerCase();return n?(n=!1,go(s)):ko(s)}),"")};class Oo extends b{commandName;missingOptions;constructor(e,n){super(`Command "${e}" is missing required options: ${n.join(", ")}`,"COMMAND_VALIDATION_ERROR",{commandName:e,missingOptions:n}),this.name="CommandValidationError",this.commandName=e,this.missingOptions=n,this.hint=`Provide the following required options: ${n.join(", ")}`}}class _o extends b{choices;option;value;constructor(e,n,o){super(`Invalid value "${n}" for option "${e}". Allowed values: ${o.join(", ")}`,"INVALID_CHOICE",{choices:o,option:e,value:n}),this.name="InvalidChoiceError",this.option=e,this.value=n,this.choices=o,this.hint=`Use one of: ${o.map(i=>`--${e} ${i}`).join(", ")}`}}const He=(t,e,n=!1)=>{const o=[],i=e._all??e;for(const s of t){if(!n&&!s.required)continue;const l=s.__camelCaseName__??s.name;if(i[l]===void 0){if(s.type?.name==="Boolean"){e[l]=!1;continue}o.push(s)}}return o},Io=(t,e)=>e.includes(t)?!0:Math.abs(t.length-e.length)>t.length/2?!1:pn(t,e)<=t.length/3,z=(t,e)=>{const n=t.toLowerCase();return e.filter(o=>Io(o.toLowerCase(),n))},So=(t,e)=>{const n=[];if(t._unknown&&t._unknown.forEach(o=>{const i=o.startsWith("--");let s=`Found unknown ${i?"option":"argument"} "${o}"`;if(i){const l=z(o.replace("--",""),(e.options??[]).map(a=>a.name));if(l.length>0){const[a,...u]=l.map(r=>`--${r}`);s+=u.length>0?`, did you mean ${a??""} or ${u.join(", ")}?`:`, did you mean ${a??""}?`}}n.push(s)}),n.length>0)throw new Error(n.join(`
2
+ `))},Lo=(t,e,n)=>{const o=n.__requiredOptions__,i=o?He(o,e,!0):He(t,e,!1);if(i.length>0)throw new Oo(n.name,i.map(s=>s.name));e._unknown&&e._unknown.length>0&&!n.argument&&So(e,n)},Mo=(t,e,n)=>{const o=n.__conflictingOptions__??t.filter(i=>i.conflicts!==void 0);if(o.length>0){const i=o.find(s=>{const l=s.__camelCaseName__??Q(s.name);return Array.isArray(s.conflicts)?s.conflicts.some(a=>e[Q(a)]!==void 0)&&e[l]!==void 0:e[Q(s.conflicts)]!==void 0&&e[l]!==void 0});if(i)throw new ot(i.name,typeof i.conflicts=="string"?i.conflicts:i.conflicts?.[0]??"unknown")}},Po=(t,e)=>{const n=e.options;if(n)for(const o of n){if(!o.choices||o.choices.length===0)continue;const i=o.__camelCaseName__??Q(o.name),s=t[i];if(s==null)continue;const l=Array.isArray(s)?s:[s];for(const a of l){const u=String(a);if(!o.choices.includes(u))throw new _o(o.name,u,o.choices)}}},Uo=t=>{if(!Array.isArray(t.options))return;const e=new Map,n=new Map;for(const i of t.options){if(i.name){const s=e.get(i.name)??[];s.push(i),e.set(i.name,s)}if(typeof i.alias=="string"&&i.alias.length>0){const s=n.get(i.alias)??[];s.push(i),n.set(i.alias,s)}else if(Array.isArray(i.alias)){for(const s of i.alias)if(s.length>0){const l=n.get(s)??[];l.push(i),n.set(s,l)}}}const o=[];for(const[i,s]of e)s.length>1&&o.push(`Duplicate option name "${i}" in command "${t.name}": ${JSON.stringify(s)}`);for(const[i,s]of n)s.length>1&&o.push(`Duplicate option alias "-${i}" used by options ${s.map(l=>`"${l.name}"`).join(", ")} in command "${t.name}"`);if(o.length>0)throw new Error(o.join(`
3
+ `))},jo=(t,e)=>{if(e.length===0)return{argv:[],commandPath:void 0};const n=[];let o;for(let i=1;i<=e.length;i+=1){const s=e[i-1];if(s===void 0||s.startsWith("-"))break;n.push(s);const l=n.join(" ");t.has(l)&&(o={commandPath:[...n],depth:i})}return o?{argv:e.slice(o.depth),commandPath:o.commandPath}:{argv:e,commandPath:void 0}},J=t=>t.join(" "),Ke=(t,e)=>e&&e.length>0?[...e,t]:[t],Vo=/^no-/,Do=t=>{t.options?.forEach(e=>{e.__camelCaseName__=Q(e.name)})},To=t=>{if(!Array.isArray(t.options)||t.options.length===0)return;const e=new Set;for(const o of t.options)e.add(o.name);const n=[];for(const o of t.options)if(o.name.startsWith("no-")){const i=o.name.replace(Vo,"");if(!e.has(i)){if(o.type!==Boolean)throw new Error(`Cannot add negated option "${o.name}" to command "${t.name}" because it is not a boolean.`);const s={...o,defaultValue:o.defaultValue===void 0?!0:!o.defaultValue,name:i};n.push(s),e.add(i)}}n.length>0&&t.options.push(...n)},Ro=(t,e)=>{if(!e.options||e.options.length===0)return;const{options:n}=t,o=new Map;for(const s of e.options)if(s.name.startsWith("no-")){const l=Q(s.name);o.set(l,s)}const i=Object.keys(n).filter(s=>o.has(s));if(i.length!==0)for(const s of i){const l=s.charAt(2);if(!l)continue;const a=l.toLowerCase()+s.slice(3),u=o.get(s);u&&(u.__negated__=!0),n[a]=!n[s],Reflect.deleteProperty(n,s)}},Bo=(t,e)=>{if(!e.options||e.options.length===0)return;const n=new Map;for(const i of e.options)i.__camelCaseName__&&i.__negated__===void 0&&i.implies!==void 0&&n.set(i.__camelCaseName__,i);if(n.size===0)return;const{options:o}=t;for(const i of Object.keys(o)){const s=n.get(i);if(s?.implies){const{implies:l}=s;for(const[a,u]of Object.entries(l))o[a]===void 0&&(o[a]=u)}}},zo=()=>!!process.versions.electron,Wo=()=>zo()&&!process.defaultApp,Fo=()=>Wo()?0:1,qo=t=>t.slice(Fo()+1),Go=" ",Jo=(t,e)=>t===e?!0:t.length!==e.length?!1:t.every((n,o)=>n===e[o]),Ho=t=>{if(typeof t=="string")return t.split(Go);const e=be();return Jo(t,e)?qo(t):t},Ko=t=>{const e=s=>{t.error(`Uncaught exception: ${s.message||s}`),s.stack&&t.error(s.stack),W(1)},n=(s,l)=>{if(s instanceof Error)t.error(`Promise rejection: ${s.message||s}`),s.stack&&t.error(s.stack);else{let a;if(typeof s=="string")a=s;else try{a=JSON.stringify(s)}catch{a=String(s)}t.error(`Promise rejection: ${a}`)}W(1)},o=Ie("uncaughtException",e),i=Ie("unhandledRejection",n);return()=>{o(),i()}},Ze=100,Zo=/^[a-z][\w-]*$/i,ke=(t,e)=>{if(typeof t!="string"||t.trim().length===0)throw new b(`${e} must be a non-empty string`,"INVALID_INPUT",{fieldName:e,value:t});return t.trim()},Ye=(t,e)=>{if(!Array.isArray(t)||!t.every(n=>typeof n=="string"))throw new b(`${e} must be an array of strings`,"INVALID_INPUT",{fieldName:e,value:t});return t},Ae=(t,e)=>{if(typeof t!="object"||t===null)throw new b(`${e} must be an object`,"INVALID_INPUT",{fieldName:e,value:t});return t},ae=t=>{const e=ke(t,"Command name");if(e.length>Ze)throw new b(`Command name is too long (maximum ${String(Ze)} characters)`,"INVALID_COMMAND_NAME",{commandName:e,length:e.length});if(e.includes("..")||e.includes("/")||e.includes("\\")||e.includes(";")||e.includes("|")||e.includes("&"))throw new b(`Command name "${e}" contains invalid characters`,"INVALID_COMMAND_NAME",{commandName:e});if(!Zo.test(e))throw new b(`Command name "${e}" must start with a letter and contain only letters, numbers, hyphens, and underscores`,"INVALID_COMMAND_NAME",{commandName:e});return e},Yo=1e6,Xo=1e5,Qo=new Set([`
4
+ `,"\r"," ","\0",'"',"$","&","'","(",")",";","<",">","[","\\","]","`","{","|","}"]),es=(t,e={})=>{if(typeof t!="string")throw new TypeError("Argument must be a string");const n=typeof e=="boolean"?{checkDangerousChars:e}:e,o=n.maxArgumentLength??Yo;if(Number.isFinite(o)&&o>0&&t.length>o)throw new Error(`Argument is too long (maximum ${String(o)} characters)`);if(n.checkDangerousChars){for(const i of t)if(Qo.has(i))throw new Error(`Argument contains dangerous character: ${i}`)}return n.trim?t.trim():t},Xe=(t,e={})=>{if(!Array.isArray(t))throw new TypeError("Arguments must be an array");const n=typeof e=="boolean"?{checkDangerousChars:e}:e,o=n.maxArguments??Xo;if(Number.isFinite(o)&&o>0&&t.length>o)throw new Error(`Too many arguments (maximum ${String(o)})`);return t.map(i=>es(i,n))},ts=/^-([^\d-])$/,ns=/^--(\S+)/,os=/^-([^\d-]{2,})$/,Ne=t=>ts.test(t)||ns.test(t)||os.test(t),ss={access:(t,e)=>xn(t,e),mkdir:(t,e)=>$n(t,e),readdir:t=>vn(t),readFile:(async(t,e)=>e===void 0?De(t):De(t,e)),rm:(t,e)=>yn(t,e),stat:t=>wn(t),writeFile:(t,e,n)=>gn(t,e,n)},is=(t,e,n)=>{const o=e.indexOf("--"),i=o===-1?new Set:new Set(e.slice(o+1)),s=n.filter(u=>u.startsWith("--")&&u!=="--"&&!i.has(u));if(s.length===0)return;const l=(t.options??[]).map(u=>u.name),a=s.flatMap(u=>z(u.slice(2),l).map(r=>`--${r}`));throw new An(s,a)};class Ee{#t;#e;#u;#p;#d;#f;#b;#C;#k;#$;#E;#x;#O;#A=fe;#h;#n;#o;#s;#i;#r;#_=!1;#I;#S=!1;#m;#g;#w;#l=[];#V(){return this.#m===void 0&&(this.#m=[...this.#o.keys()]),this.#m}#L(){return this.#g===void 0&&(this.#g=[...this.#n.keys()]),this.#g}#a(){return this.#w===void 0&&(this.#w=[...this.#V(),...this.#L()]),this.#w}#M(){return this.#l.length===0?re:[...re,...this.#l]}#P(){this.#m=void 0,this.#g=void 0,this.#w=void 0}#N(){if(this.#u===void 0){const e=Ho(this.#e.argv);this.#u=Xe(e,{maxArguments:this.#x}),this.#D()}return this.#u}#y(){return this.#$??he()}#v(e){this.#A=e,this.#y().CEREBRO_OUTPUT_LEVEL=String(e)}#c(){return this.#A}#D(){if(!this.#u)return;let e=!1;for(const n of this.#u){if(n==="--quiet"||n==="-q"){this.#v(Rt),e=!0;break}if(n==="--verbose"||n==="-v"){this.#v(Bt),e=!0;break}if(n==="--debug"){this.#v(T),e=!0;break}}e||this.#v(Object.hasOwn(this.#y(),"DEBUG")?T:fe)}#T(){this.#S||(this.#I=Ko(this.#t),this.#S=!0)}#R(){return{arch:jt(),argv:this.#N(),cwd:this.#p,env:this.#$??he(),exit:this.#k??(e=>W(e??0)),platform:Ut(),stdin:this.#E}}#U(e,n,o,i){this.#c()===T&&this.#t.debug(`command '${i}' found, parsing command args: ${n.join(", ")}`);const{arguments_:s,booleanValues:l,parsedArgs:a}=fo(e,n,this.#M()),u=Object.keys(l).length>0;let r=a;u&&(r={...a,_all:{...a._all,...l}}),Lo(s,r,e);const c=po(e,a,l,o,this.#y());c.runtime=this,c.argv=this.#N(),c.fs=this.#C??ss,c.process=this.#R(),c.console=this.#t;const d=e.options&&e.options.length>0;if(d&&e.options){const h=e.options.filter(f=>f.name.startsWith("no-"));for(const f of h){const p=f.name.slice(3),w=`--${f.name}`,$=`--${p}`,m=n.includes(w),v=n.includes($);if(m&&v)throw new ot(p,f.name)}}return d&&(Ro(c,e),Bo(c,e)),Mo(s,c.options,e),Po(c.options,e),this.#O&&is(e,n,c.rawUnknown),this.#c()===T&&(this.#t.debug("command options parsed from options:"),this.#t.debug(JSON.stringify(c.options,null,2)),this.#t.debug("command argument parsed from argument:"),this.#t.debug(JSON.stringify(c.argument,null,2))),{arguments_:s,booleanValues:l,commandArgs:r,parsedArgs:a,toolbox:c}}async#j(e,n,o){const i=this.getPluginManager();try{!this.#_&&i.hasPlugins()&&(await i.init({cli:this,cwd:this.#p,logger:this.#t}),this.#_=!0),await i.executeLifecycle("execute",n),await i.executeLifecycle("beforeCommand",n);let s;const l=o.global;if(l?.help){const a=this.#n.get("help");if(!a)throw new b("Help command not found","COMMAND_NOT_FOUND");s=await ye(a,n,o)}else if(l?.version??l?.V){const a=this.#n.get("version");if(!a)throw new b("Version command not found","COMMAND_NOT_FOUND");s=await ye(a,n,o)}else s=await ye(e,n,o);return await i.executeLifecycle("afterCommand",n,s),s}catch(s){throw await i.executeErrorHandlers(s,n),s}}constructor(e,n={}){if(typeof e!="string"||e.trim().length===0)throw new b("CLI name must be a non-empty string","INVALID_INPUT",{cliName:e});this.#d=e.trim();const o=n.argv??be(),i=n.cwd??Vt();if(this.#e={...n,argv:o,cwd:i},this.#e.argv&&!Array.isArray(this.#e.argv))throw new b("CLI argv option must be an array of strings","INVALID_INPUT",{argv:this.#e.argv});if(this.#e.cwd&&typeof this.#e.cwd!="string")throw new b("CLI cwd option must be a string","INVALID_INPUT",{cwd:this.#e.cwd});if(this.#e.packageName&&typeof this.#e.packageName!="string")throw new b("CLI packageName option must be a string","INVALID_INPUT",{packageName:this.#e.packageName});if(this.#e.packageVersion&&typeof this.#e.packageVersion!="string")throw new b("CLI packageVersion option must be a string","INVALID_INPUT",{packageVersion:this.#e.packageVersion});if(typeof this.#e.logger=="object"){const d=["debug","error","info","log","warn"],h=[],f=this.#e.logger;for(const p of d)typeof f[p]!="function"&&h.push(p);if(h.length>0)throw new b(`Logger object is missing required methods: ${h.join(", ")}`,"INVALID_INPUT",{logger:this.#e.logger,missingMethods:h});this.#t=this.#e.logger}else this.#t={...console,debug:(...d)=>{this.#c()===T&&console.debug(...d)}};this.#f=this.#e.packageVersion,this.#b=this.#e.packageName,this.#p=this.#e.cwd,this.#i="help",this.#r={};const s=n.fs;if(s!==void 0&&(typeof s!="object"||s===null))throw new b("CLI fs option must be an object implementing the CerebroFs interface","INVALID_INPUT",{fs:n.fs});const l=n.exit;if(l!==void 0&&typeof l!="function")throw new b("CLI exit option must be a function","INVALID_INPUT",{exit:n.exit});const a=n.env;if(a!==void 0&&(typeof a!="object"||a===null))throw new b("CLI env option must be a record of string keys","INVALID_INPUT",{env:n.env});const u=n.stdin;if(u!==void 0&&typeof u!="string")throw new b("CLI stdin option must be a string","INVALID_INPUT",{stdin:n.stdin});this.#C=n.fs,this.#k=n.exit,this.#$=n.env,this.#E=n.stdin??"",this.#x=n.maxArguments,this.#O=n.strictOptions??!1;const r=this.#y().CEREBRO_OUTPUT_LEVEL,c=r===void 0?Number.NaN:Number(r);this.#A=Number.isNaN(c)?fe:c,this.#n=new Map,this.#o=new Map,this.#s=new Map}setCommandSection(e){return this.#r=e,this}getCommandSection(){return this.#r.header||(this.#r.header=`${this.#d}${this.#f?` v${this.#f}`:""}`),this.#r}setDefaultCommand(e){return this.#i=e,this}get defaultCommand(){return this.#i}addCommand(e){Ae(e,"Command"),ae(e.name);const n=typeof e.execute=="function",o=typeof e.loader=="function";if(n&&o)throw new b(`Command "${e.name}" cannot define both "execute" and "loader" — choose one`,"INVALID_COMMAND",{commandName:e.name});if(!n&&!o)throw new b(`Command "${e.name}" must define either "execute" or "loader"`,"INVALID_COMMAND",{commandName:e.name});e.alias&&(typeof e.alias=="string"?ae(e.alias):Ye(e.alias,"Command alias").forEach(r=>ae(r))),e.argument&&Ae(e.argument,"Command argument"),e.options&&Ae(e.options,"Command options"),e.commandPath&&(Ye(e.commandPath,"Command commandPath"),e.commandPath.forEach(r=>{ae(r)}));const i=Ke(e.name,e.commandPath),s=J(i);if(this.#o.has(s))throw new b(`Command with path "${s}" already exists`,"DUPLICATE_COMMAND",{commandName:e.name,commandPath:e.commandPath});const l=Array.isArray(e.commandPath)&&e.commandPath.length>0,a=this.#n.get(e.name),u=a!==void 0&&(a.commandPath===void 0||a.commandPath.length===0);if(!l&&u)throw new b(`Command with name "${e.name}" already exists`,"DUPLICATE_COMMAND",{commandName:e.name});if(e.options)for(const r of e.options)Te(r);if(Uo(e),To(e),Do(e),e.options&&(e.__conflictingOptions__=e.options.filter(r=>r.conflicts!==void 0),e.__requiredOptions__=e.options.filter(r=>r.required===!0)),l&&a!==void 0)this.#n.set(s,e);else{if(!l&&a!==void 0&&!u){const r=Ke(a.name,a.commandPath);this.#n.set(J(r),a)}this.#n.set(e.name,e)}if(this.#o.set(s,i),this.#s.set(s,e),this.#P(),e.alias!==void 0){const r=typeof e.alias=="string"?[e.alias]:e.alias;for(const c of r){if(this.#c()===T&&this.#t.debug("adding alias",c),this.#n.has(c))throw new b(`Command alias "${c}" conflicts with existing command`,"DUPLICATE_COMMAND",{alias:c,commandName:e.name});this.#n.set(c,e)}}return this}addGlobalOption(e){const n=e,o=new Set(re.map(s=>s.name)),i=new Set(re.map(s=>s.alias).filter(Boolean));if(o.has(n.name))throw new b(`Cannot add global option "--${n.name}": it conflicts with a built-in global option`,"DUPLICATE_OPTION",{optionName:n.name});if(n.alias&&i.has(n.alias))throw new b(`Cannot add global option with alias "-${n.alias}": it conflicts with a built-in global option alias`,"DUPLICATE_OPTION",{alias:n.alias,optionName:n.name});if(new Set(this.#l.map(s=>s.name)).has(n.name))throw new b(`Global option "--${n.name}" has already been added`,"DUPLICATE_OPTION",{optionName:n.name});return n.group="global",Te(n),this.#l.push(n),this}getGlobalOptions(){return this.#M()}addPlugin(e){return this.getPluginManager().register(e),this}getPluginManager(){return this.#h?this.#h:(this.#h=new bn(this.#t),this.#h.register({description:"Attaches the logger to the toolbox",execute:e=>{e.logger=this.#t,e.console=e.logger},name:"logger"}),this.#h)}getCliName(){return this.#d}getPackageVersion(){return this.#f}getPackageName(){return this.#b}getCommands(){return this.#n}getCwd(){return this.#p}dispose(){this.#I?.()}async run(e={}){const{autoDispose:n=!0,shouldExitProcess:o=!0,...i}=e;if(!this.#n.has("help")){const{default:m}=await import("../packem_chunks/help-command.js");this.addCommand(new m(this.#n))}const s=this.#L(),l=this.#o;this.#T();const a=this.#N();let u,r=[...a];this.#c()===T&&(this.#t.debug(`process.execPath: ${Dt()}`),this.#t.debug(`process.execArgv: ${Tt().join(" ")}`),this.#t.debug(`process.argv: ${be().join(" ")}`));const c=jo(l,[...a]);if(c.commandPath)u=c.commandPath,r=c.argv;else{if(a.length>1&&a[0]&&a[1]&&!Ne(a[0])&&!Ne(a[1])){const v=[];let A=0;for(;A<a.length;){const C=a[A];if(!C||Ne(C))break;v.push(C),A+=1}const k=J(v);if(v[0]&&!s.includes(v[0])){const C=this.#a(),j=z(k,C);throw new G(k,j)}}let m;try{m=In([null,...s],[...a])}catch(v){if(v instanceof Error&&v.name==="INVALID_COMMAND"&&"command"in v){const A=v.command,k=this.#a(),C=z(A,k);throw new G(A,C)}throw v}m.command&&(u=[m.command],r=m.argv)}if(!u)if(this.#i)u=[this.#i];else{const m=this.#a();throw new G("",m)}const d=J(u),h=this.#o.get(d);let f;if(h){if(f=this.#s.get(d),!f||J(h)!==d){const m=this.#a(),v=z(d,m);throw new G(d,v)}}else{const m=u.at(-1);if(f=m?this.#n.get(m):void 0,!f){const v=this.#a(),A=z(d,v);throw new G(d,A)}}if(typeof f.execute!="function"&&typeof f.loader!="function")return this.#t.error(`Command "${f.name}" has no function to execute.`),o?W(1):void 0;const p=r;let w,$;try{({commandArgs:w,toolbox:$}=this.#U(f,p,i,d))}catch(m){if(this.#t.error(m),o)return W(1);throw m}try{return await this.#j(f,$,w),o?W(0):void 0}catch(m){if(o)return this.#t.error(m),W(1);throw m}finally{n&&this.dispose()}}async runCommand(e,n={}){const{argv:o=[],...i}=n;ke(e,"Command name");const s=e.split(" ").filter(Boolean),l=J(s),a=this.#o.get(l)?this.#s.get(l):this.#n.get(e);if(!a){const d=this.#a(),h=z(l||e,d);throw new G(e,h)}if(typeof a.execute!="function"&&typeof a.loader!="function")throw new b(`Command "${a.name}" has no function to execute`,"INVALID_COMMAND",{commandName:a.name});const u=[...Xe(o,{maxArguments:this.#x})];this.#c()===T&&this.#t.debug(`running command '${e}' programmatically with args: ${u.join(", ")}`);const{commandArgs:r,toolbox:c}=this.#U(a,u,i,l||e);return this.#j(a,c,r)}clone(e){const n={...this.#e,...e},o=new Ee(this.#d,n);for(const[i,s]of this.#n)o.#n.set(i,s);for(const[i,s]of this.#o)o.#o.set(i,[...s]);for(const[i,s]of this.#s)o.#s.set(i,s);for(const i of this.#l)o.#l.push(i);return o.#i=this.#i,o.#r={...this.#r},o.#P(),o}async getAction(e){ke(e,"Command name");const n=e.split(" ").filter(Boolean),o=J(n),i=this.#o.get(o)?this.#s.get(o):this.#n.get(e);if(!i){const s=this.#a(),l=z(o||e,s);throw new G(e,l)}if(typeof i.execute=="function")return i.execute;if(typeof i.loader=="function")return pt(i);throw new b(`Command "${i.name}" has no execute or loader defined`,"INVALID_COMMAND",{commandName:i.name})}}const ti=(t,e)=>new Ee(t,e),rs=globalThis.process??Object.create(null),Qe={versions:{}},ie=new Proxy(rs,{get(t,e){if(e in t)return t[e];if(e in Qe)return Qe[e]}}),as=t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
5
+ `),ls=(t,e,n,o)=>{const i={column:0,line:-1,...t.start},s={...i,...t.end},l=i.line,a=i.column,u=s.line,r=s.column;let c=Math.max(l-(n+1),0),d=Math.min(e.length,u+o);l===-1&&(c=0),u===-1&&(d=e.length);const h=u-l,f={};if(h)for(let p=0;p<=h;p++){const w=p+l;if(!a)f[w]=!0;else if(p===0){const $=e[w-1]?.length;f[w]=[a,($??0)-a+1]}else if(p===h)f[w]=[0,r];else{const $=e[w-p]?.length;f[w]=[0,$]}}else a===r?f[l]=a?[a,0]:!0:f[l]=[a,(r??0)-(a??0)];return{end:d,markerLines:f,start:c}},cs=ie.platform==="win32"&&!ie.env?.WT_SESSION?">":"❯",us=(t,e,n)=>{const o={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...n,color:{gutter:p=>p,marker:p=>p,message:p=>p,...n?.color}},i=typeof e.start.column=="number";let s=(t.includes("\r")?as(t):t).split(`
6
+ `);typeof o.tabWidth=="number"&&t.includes(" ")&&(s=s.map(p=>p.replaceAll(" "," ".repeat(o.tabWidth))));const{end:l,markerLines:a,start:u}=ls(e,s,o.linesAbove,o.linesBelow),r=String(l).length,{gutter:c,marker:d,message:h}=o.color;let f=s.slice(u,l).map((p,w)=>{const $=u+1+w,m=a[$],v=String($).padStart(r),A=!a[$+1],k=` ${v}${o.showGutter?" |":""}`;if(m){let C="";if(Array.isArray(m)){const j=p.replaceAll(/[^\t]/g," ").slice(0,Math.max(m[0]-1,0)),_=m[1]||1;C=[`
7
+ `,o.prefix+c(k.replaceAll(/\d/g," "))," ",j,d("^").repeat(_)].join(""),A&&o.message&&(C+=` ${h(o.message)}`)}return[o.prefix+d(cs),c(k),p.length>0?` ${p}`:"",C].join("")}return`${o.prefix} ${c(k)}${p.length>0?` ${p}`:""}`}).join(`
8
+ `);return o.message&&!i&&(f=`${o.prefix+" ".repeat(r+1)+o.message}
9
+ ${f}`),f},pe=t=>{let e;return()=>{if(e===void 0){if(typeof ie.getBuiltinModule!="function")throw new TypeError(`[@visulima/error] Cannot load ${t}: this runtime implements no process.getBuiltinModule(). Requires Node ^22.14.0 || >=24.10.0, or another runtime providing process.getBuiltinModule().`);e=ie.getBuiltinModule(t)}return e}},hs=()=>ie.env?.DEBUG==="true",Z=(t,...e)=>{if(hs()){const n=e.map(o=>typeof o=="function"?o():o);console.debug(`error:parse-stacktrace: ${t}`,...n)}},Y="<unknown>",ps=/^(?:node:internal\/|node:|internal\/)/,ds=t=>t!==void 0&&ps.test(t),fs=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ms=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,gs=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,ws=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,ys=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,vs=/in\s(.*)\s\(at\s(.+)\)\sat/,$s=/^(?:.*@)?(.*):(\d+):(\d+)$/,xs=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,As=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ns=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,et=/\(error: ([^)]*)\)/,bs=/at\s/,Cs=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,ks=/Error: |AggregateError:/,yt=/^Anonymous function$/,Es=/^\s*in\s.*/,Os=/^.*?\s*at\s.*/,_s=/^.*?\s*@.*|\[native code\]/,vt=(t,e)=>{const n=t.includes("safari-extension"),o=t.includes("safari-web-extension");return n||o?[t.includes("@")?t.split("@")[0]:Y,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},$t=(t,e)=>{const n=gs.exec(e);n&&(t.file=n[1],t.line=+n[2],t.column=+n[3])},Is=t=>{const e=vs.exec(t);if(e){Z(`parse nested node error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`);const o=e[2].split(":");return{column:o[2]?+o[2]:void 0,file:o[0],line:o[1]?+o[1]:void 0,methodName:e[1]??Y,raw:t,type:void 0}}const n=ys.exec(t);if(n){Z(`parse node error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`);const o={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(bs,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]??Y,raw:t,type:t.startsWith("internal")?"internal":void 0};return $t(o,`${n[2]}:${n[3]}:${n[4]}`),o}},Ss=t=>{const e=fs.exec(t);if(e){Z(`parse chrome error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`);const n=e[2]?.startsWith("native"),o=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let i,s;if(o){const r=ms.exec(t);if(r){const c=Cs.exec(r[1]);c?(e[2]=c[4]??c[1],e[3]=c[5]??c[2],e[4]=c[3]):r[2]&&(e[2]=r[1]),r[2]&&(i={column:r[4]?+r[4]:void 0,file:r[2],line:r[3]?+r[3]:void 0,methodName:"eval",raw:t,type:"eval"})}else{const c=ws.exec(t);c&&(s={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0},i={column:c[6]?+c[6]:void 0,file:c[1],line:c[5]?+c[5]:void 0,methodName:"eval",raw:c[0],type:"eval"})}}const[l,a]=vt(e[1]?e[1].replace(yt,"<anonymous>"):Y,e[2]),u={column:e[4]?+e[4]:void 0,evalOrigin:i,file:a,line:e[3]?+e[3]:void 0,methodName:l,raw:t,type:o?"eval":n?"native":ds(a)?"internal":void 0};return s?(u.column=s.column,u.file=s.file,u.line=s.line):$t(u,`${a}:${e[3]}:${e[4]}`),u}},Ls=(t,e)=>{const n=xs.exec(t);if(n){Z(`parse gecko error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`);const o=n[3]?.includes(" > eval"),i=o&&n[3]&&As.exec(n[3]);let s;o&&i&&(n[3]=i[1],s={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:t,type:"eval"},n[4]=i[2]);const[l,a]=vt(n[1]?n[1].replace(yt,"<anonymous>"):Y,n[3]);let u;(e?.type==="safari"||!o&&e?.type==="firefox")&&e.column?u=e.column:!o&&n[5]&&(u=+n[5]);let r;return(e?.type==="safari"||!o&&e?.type==="firefox")&&e.line?r=e.line:n[4]&&(r=+n[4]),{column:u,evalOrigin:s,file:a,line:r,methodName:l,raw:t,type:o?"eval":a.includes("[native code]")?"native":void 0}}},Ms=(t,e)=>{const n=Ns.exec(t);if(!(n&&n[2].includes(" > eval"))&&n)return Z(`parse firefox error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:e?.column??void 0,file:n[2],line:n[3]?+n[3]:e?.line??void 0,methodName:n[1]||Y,raw:t,type:void 0}},Ps=t=>{const e=$s.exec(t);if(e)return Z(`parse react android native error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:Y,raw:t,type:void 0}},xt=(t,{filter:e,frameLimit:n=50}={})=>{const o=t;let i=(typeof o.stacktrace=="string"?o.stacktrace:t.stack??"").split(`
10
+ `).map(s=>(et.test(s)?s.replace(et,"$1"):s).trim()).filter(s=>!ks.test(s)&&s!=="eval code");return e&&(i=i.filter(s=>e(s))),i=i.slice(0,n),i.reduce((s,l,a)=>{if(!l||l.length>1024)return s;let u;if(Es.test(l))u=Is(l);else if(Os.test(l))u=Ss(l);else if(_s.test(l)){let r;if(a===0){const c=t,d=c.columnNumber,h=c.lineNumber,f=c.line,p=c.column;d||h?r={column:d,line:h,type:"firefox"}:(f||p)&&(r={column:p,line:f,type:"safari"})}u=Ms(l,r)??Ls(l,r)}else u=Ps(l);return u?s.push(u):Z(`parse error stack line: "${l}"`,"not parser found"),s},[])},tt=pe("node:fs"),ue=pe("node:path"),Us=pe("node:process"),js=pe("node:url"),q=(t,e,n)=>n===0?t:e===" "?t+" ".repeat(n):t+" ".repeat(e*n),At=t=>t.replaceAll("\\","/"),Vs=t=>{if(!t.startsWith("file:"))return t;try{return js().fileURLToPath(t)}catch{return t}},Ds=(t,e)=>{const n=t.replace("async file:","file:");return At(ue().relative(e,Vs(n)))},Ts=(t,e,n)=>{if(e)return n.title(t.message);const o=t.message?`: ${t.message}`:"";return n.title(t.name+o)},Nt=(t,{color:e,hideErrorTitle:n,indentation:o,prefix:i},s)=>`${q(i,o,s)}${Ts(t,n,e)}
11
+ `,bt=(t,{color:e,indentation:n,prefix:o},i)=>{if(t.hint===void 0)return;const s=q(o,n,i);let l="";if(Array.isArray(t.hint))for(const a of t.hint)l+=`${s+a}
12
+ `;else l+=s+t.hint;return e.hint(l)},Oe=(t,e)=>{if(!e||t.file===void 0||t.line===void 0)return{trace:t};try{const n=e({column:t.column,file:t.file,line:t.line});return n?{source:n.source,trace:{...t,column:n.column??t.column,file:n.file??t.file,line:n.line??t.line}}:{trace:t}}catch{return{trace:t}}},_e=(t,e,n=0)=>{const{color:o,cwd:i,displayShortPath:s,indentation:l,prefix:a}=e,{trace:u}=t;let r;u.file===void 0?r="<unknown>":r=s?Ds(u.file,i):At(u.file);const{fileLine:c,method:d}=o;return`${q(a,l,n)}at ${u.methodName?`${d(u.methodName)} `:""}${c(r)}:${c(u.line?.toString()??"")}`},Rs=(t,e)=>{if(e.allowAllFilePaths)return!0;const n=ue().resolve(e.cwd),o=ue().resolve(n,t);return o===n||o.startsWith(n+ue().sep)},Bs=t=>{try{return tt().existsSync(t)?tt().readFileSync(t,"utf8"):void 0}catch{return}},Ct=(t,e,n)=>{const{color:o,indentation:i,linesAbove:s,linesBelow:l,prefix:a,showGutter:u,showLineNumbers:r,tabWidth:c}=e,{source:d,trace:h}=t;if(h.file===void 0)return;let f;if(d===void 0){const p=h.file.replace("file://","");if(!Rs(p,e))return;const w=Bs(p);if(w===void 0)return;f=w}else f=d;return us(f,{start:{column:h.column,line:h.line}},{color:o,linesAbove:s,linesBelow:l,prefix:q(a,i,n),showGutter:u,showLineNumbers:r,tabWidth:c})},kt=(t,e,n)=>{if(t.errors.length===0)return;let o=`${q(e.prefix,e.indentation,n)}Errors:
13
+
14
+ `,i=!0;for(const s of t.errors)i?i=!1:o+=`
15
+
16
+ `,o+=Ot(s,{...e,framesMaxLimit:1,hideErrorCodeView:e.hideErrorErrorsCodeView},n+1);return`
17
+ ${o}`},zs=t=>{if(typeof t=="object"&&t!==null)try{return JSON.stringify(t)}catch{return Object.prototype.toString.call(t)}return String(t)},Et=(t,e,n,o=new Set)=>{o.add(t);let i=`${q(e.prefix,e.indentation,n)}Caused by:
18
+
19
+ `;const{cause:s}=t;if(!(s instanceof Error)){const u=zs(s);return i+=`${q(e.prefix,e.indentation,n)}${e.color.title(u)}
20
+ `,`
21
+ ${i}`}i+=Nt(s,e,n);const l=xt(s).shift(),a=bt(s,e,n);if(a&&(i+=`${a}
22
+ `),l){const u=Oe(l,e.sourceMap);if(i+=_e(u,e,n),!e.hideErrorCauseCodeView){const r=Ct(u,e,n);r!==void 0&&(i+=`
23
+ ${r}`)}}if(s instanceof AggregateError){const u=kt(s,e,n);u!==void 0&&(i+=`
24
+ ${u}`)}return s.cause&&(i+=o.has(s)?`
25
+ ${q(e.prefix,e.indentation,n+1)}Caused by: [Circular]`:`
26
+ ${Et(s,e,n+1,o)}`),`
27
+ ${i}`},Ws=(t,e)=>(t.length>0?`
28
+ `:"")+t.map(n=>_e(Oe(n,e.sourceMap),e)).join(`
29
+ `),Ot=(t,e,n)=>{const o={allowAllFilePaths:!1,cwd:Us().cwd(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...e,color:{fileLine:a=>a,gutter:a=>a,hint:a=>a,marker:a=>a,message:a=>a,method:a=>a,title:a=>a,...e.color}},i=xt(t,{filter:e.filterStacktrace,frameLimit:o.framesMaxLimit}),s=i.shift(),l=s?Oe(s,o.sourceMap):void 0;return[e.hideMessage?void 0:Nt(t,o,n),bt(t,o,n),l?_e(l,o,n):void 0,l&&!o.hideErrorCodeView?Ct(l,o,n):void 0,t instanceof AggregateError?kt(t,o,n):void 0,t.cause===void 0||t.cause===null?void 0:Et(t,o,n),i.length>0?Ws(i,o):void 0].filter(Boolean).join(`
30
+ `)},Fs=(t,e={})=>{if(e.framesMaxLimit!==void 0&&e.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Ot(t,e,0)},ni=(t={})=>({description:"Enhanced error handling and reporting with beautiful code frames",name:"error-handler",onError:(e,n)=>{const{logger:o,runtime:i}=n,{concise:s,detailed:l=!1,exitOnError:a=!0,formatter:u,logErrors:r=!0,renderOptions:c={}}=t;if(r)if(u)o.error(u(e));else if(!l&&s?.(e))o.error(e.message);else if(l){const d=i.getCwd(),h=Fs(e,{cwd:d,hideErrorCodeView:!1,hideErrorTitle:!1,hideMessage:!1,linesAbove:2,linesBelow:3,...c});o.error(h)}else o.error(e);a&&W(1)},version:"1.0.0"}),oi=async t=>{try{await t.run({shouldExitProcess:!1})}catch{process.exitCode=process.exitCode||1}finally{process.exit(process.exitCode??0)}},si={argument:{description:"Package to execute (optionally with @version)",name:"package",type:String},description:"Execute a remote package without permanent installation",examples:[["vis dlx create-vite my-app","Scaffold a new project"],["vis dlx typescript@5.5.4 tsc --version","Run specific version"],["vis dlx -p cowsay -p lolcatjs -c 'echo hi | cowsay | lolcatjs'","Multiple packages with shell"],["vis install && vis dlx --offline typescript tsc --version","Hardened: pre-install + offline (no registry fetch on dlx)"],["vis dlx --info create-vite","Always show the first-run panel (size, score, permissions, changelog)"],["vis dlx --yes create-vite my-app","Skip the first-run panel and confirmation"]],group:"Run & Execute",loader:()=>import("../packem_chunks/handler66.js"),name:"dlx",options:[{alias:"p",description:"Additional packages to install (repeatable)",multiple:!0,name:"package",type:String},{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output except command results",name:"silent",type:Boolean},{defaultValue:!1,description:"Resolve from local store only — fail rather than fetch from the registry. Pair with `vis install` for hardened npx-style workflows.",name:"offline",type:Boolean},{alias:"y",defaultValue:!1,description:"Skip the first-run info panel and confirmation prompt (also via VIS_DLX_YES — note this auto-approves every package)",name:"yes",type:Boolean},{defaultValue:!1,description:"Always show the first-run info panel (size, security score, permissions, changelog), even for an approved package",name:"info",type:Boolean},{defaultValue:!1,description:"Disable the first-run info panel entirely (also via VIS_DLX_NO_INFO)",name:"no-info",type:Boolean}]};class qs extends Error{isVisUserError=!0;constructor(e,n){super(e,n),this.name="VisUserError"}}const ii=t=>t instanceof qs||t instanceof Error&&t.isVisUserError===!0;export{qs as V,Ys as a,F as c,si as d,ii as i,ti as m,b as n,oi as r,Zs as u,ni as w};
@@ -0,0 +1 @@
1
+ import{createRequire as b}from"node:module";import{U as v,m as j,a as R}from"./index-DHD8wb6Z.js";import{p as h}from"../packem_chunks/cli-main.js";let y;const $=o=>(y??=b(import.meta.url))(o),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=o=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[c,r]=m.versions.node.split(".").map(Number);if(c>22||c===22&&r>=3||c===20&&r>=16)return m.getBuiltinModule(o)}return $(o)},{watch:T}=w("node:fs"),{execFileSync:S}=w("node:child_process"),{createRequire:W}=w("node:module"),g=W(import.meta.url);let p;const q=()=>{if(p!==void 0)return p;try{g.resolve("fb-watchman")}catch{return p=!1,!1}try{S("watchman",["--version"],{stdio:"ignore",timeout:2e3})}catch{return p=!1,!1}return p=!0,!0},k=(o,c)=>{if(!q())return;let r;try{r=g("fb-watchman")}catch(s){h.warn(`[vis watch] fb-watchman failed to load, using native watcher: ${s.message}`);return}const a=new r.Client;a.on("error",s=>{h.warn(`[vis watch] watchman error: ${s.message}`)}),a.on("subscription",s=>{const t=s;if(!t.is_fresh_instance)for(const e of t.files??[])c(e)});for(const[s,t]of o.entries()){const e=v(t),i=`vis-watch-${s}-${process.pid}`;a.command(["watch-project",e],(l,u)=>{if(l){h.warn(`[vis watch] watchman could not watch ${t}: ${l.message}`);return}const f={expression:["allof",["type","f"]],fields:["name"]};u.relative_path&&(f.relative_root=u.relative_path),a.command(["subscribe",u.watch,i,f],n=>{n&&h.warn(`[vis watch] watchman subscribe failed for ${t}: ${n.message}`)})})}return{close:()=>{try{a.end()}catch{}}}},A=[/node_modules(?:\/|$)/,/\.git(?:\/|$)/,/\.vis(?:\/|$)/],M=(o,c)=>{const r=new Set,a=new Set;for(const[,e]of o){const i=e.task.hashDetails?.nodes;if(i)for(const l of Object.keys(i))r.add(l),a.add(j(v(c,l)))}const s=[...a].sort(),t=[];for(const e of s)t.some(i=>e===i||e.startsWith(`${i}/`))||t.push(e);return{directories:t,files:r}},z=(o,c,r)=>{const a=new Set;for(const s of o){const t=v(c,s);for(const e of r)if(t===e||t.startsWith(`${e}/`)){const i=R(e,t);i.length>0&&a.add(i)}}return s=>{const t=s.replaceAll("\\","/");return a.has(t)}},P=o=>{const c=o.replaceAll("\\","/");return A.some(r=>r.test(c))},B=o=>{const{debounceMs:c=150,filter:r,onChange:a,paths:s}=o;let t=new Set,e;const i=()=>{e=void 0;const n=[...t];t=new Set,n.length!==0&&Promise.resolve(a(n)).catch(d=>{h.error("[vis watch] onChange handler failed:",d)})},l=n=>{P(n)||r&&!r(n)||(t.add(n),e&&clearTimeout(e),e=setTimeout(i,c))},u=k(s,l);if(u)return{close:()=>{e&&clearTimeout(e),u.close()}};const f=[];for(const n of s)try{const d=T(n,{recursive:!0},(x,_)=>{_&&l(_)});f.push(d)}catch(d){h.warn(`[vis watch] unable to watch ${n}: ${d.message}`)}return{close:()=>{e&&clearTimeout(e);for(const n of f)try{n.close()}catch{}}}};export{z as a,M as c,B as s};
@@ -0,0 +1,11 @@
1
+ import{createRequire as K}from"node:module";import{e as h,z as H,v as S,U as Y,m as Q}from"./index-DHD8wb6Z.js";import{T as w}from"../packem_chunks/catalog.js";import{y as C}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as ee}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";import{h as le}from"./writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{s as ue}from"./watch-Dswvj6Zp.js";let z;const G=e=>(z??=K(import.meta.url))(e),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=e=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[t,n]=x.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return x.getBuiltinModule(e)}return G(e)},{createHash:g}=A("node:crypto"),{fileURLToPath:X,pathToFileURL:Z}=A("node:url"),{spawnSync:te,spawn:ne}=A("node:child_process"),{openSync:se,writeSync:re,closeSync:oe,statSync:ie,readFileSync:P,mkdirSync:ce,writeFileSync:ae}=A("node:fs"),{availableParallelism:k}=A("node:os"),D=(e,t)=>{for(const n of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const s=e[n];if(s&&typeof s[t]=="string")return s[t]}},F=(e,t)=>{for(const n of t){const s=h(e,n);if(C(s))return s}},de=e=>{const t=h(e,"package.json");if(!C(t))return{};try{return ee(t)}catch{return{}}},rt=(e,t)=>{const n=de(e),s=new Map;for(const o of t){const r=o.detect(e,n);r&&s.set(o.id,r)}return s},fe={error:"error",info:"info",information:"info",warning:"warning"},ot={argsCheck:(e,t)=>I(e,t,!1),argsFix:(e,t)=>I(e,t,!0),bin:()=>["pnpm","exec","biome"],cacheKey:(e,t)=>{const n=["biome",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:(e,t)=>{const n=D(t,w.biome.packageNames[0]),s=F(e,w.biome.configFiles);if(!(!n&&!s))return{adapter:"biome",configFile:s,declared:!!n,declaredVersion:n,root:e}},extensions:["astro","cjs","css","cts","js","json","jsonc","jsx","mjs","mts","svelte","ts","tsx","vue"],id:"biome",kind:"both",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"biome",file:t.root,fixable:!1,message:`biome output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const s=[];for(const o of n.diagnostics??[]){const r=o.location?.start,i=o.location?.end,c=pe(t.root,o.location?.path),u=o.category??"",a=u==="format"||u.startsWith("format/");s.push({adapter:"biome",column:r?.column&&r.column>0?r.column:void 0,endColumn:i?.column&&i.column>0?i.column:void 0,endLine:i?.line&&i.line>0?i.line:void 0,file:c,fixable:!0,line:r?.line&&r.line>0?r.line:void 0,message:a?"Code style issues would be auto-fixed":o.message??"",ruleId:u||void 0,severity:fe[o.severity??""]??"warning"})}return s}},I=(e,t,n)=>{const s=["check","--reporter=json"];return n&&s.push("--write"),typeof t.maxWarnings=="number"&&s.push(`--max-diagnostics=${String(t.maxWarnings)}`),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},pe=(e,t)=>{const n=typeof t=="string"?t:t?.file;return n?n.startsWith("/")||/^[a-z]:[\\/]/i.test(n)?n:h(e,n):e},N=e=>t=>{const n=F(t,w.deno.configFiles);if(n)return{adapter:e,configFile:n,declared:!1,root:t}},O=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),it={argsCheck:(e,t)=>b(e,t,!1),argsFix:(e,t)=>b(e,t,!0),bin:()=>["deno","lint"],cacheKey:(e,t)=>{const n=["deno-lint",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:N("deno-lint"),extensions:["js","jsx","mjs","mts","ts","tsx"],id:"deno-lint",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"deno-lint",file:t.root,fixable:!1,message:`deno lint output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const s=[];for(const o of n.diagnostics??[]){const r=o.range?.start,i=o.range?.end;s.push({adapter:"deno-lint",column:r?.col===void 0?void 0:r.col+1,endColumn:i?.col===void 0?void 0:i.col+1,endLine:i?.line===void 0?void 0:i.line+1,file:he(o.filename??t.root,t.root),fixable:!1,line:r?.line===void 0?void 0:r.line+1,message:o.message??"",ruleId:o.code,severity:"warning"})}return s}},ct={argsCheck:(e,t)=>R(e,t,!1),argsFix:(e,t)=>R(e,t,!0),bin:()=>["deno","fmt"],cacheKey:(e,t)=>{const n=["deno-fmt",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:N("deno-fmt"),extensions:["astro","cjs","css","cts","html","ipynb","js","json","jsonc","jsx","less","md","mjs","mts","sass","scss","sql","svelte","ts","tsx","vue","yaml","yml"],id:"deno-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const n=[],s=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=/^from (.+):$/.exec(o);if(!r)continue;const i=r[1];s.has(i)||(s.add(i),n.push({adapter:"deno-fmt",file:O(i)?i:`${t.root}/${i}`,fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return n}},b=(e,t,n)=>{const s=["--json"];return n&&s.push("--fix"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},R=(e,t,n)=>{const s=[];return n||s.push("--check"),t.quiet&&s.push("--quiet"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},he=(e,t)=>e.startsWith("file://")?X(e):O(e)?e:`${t}/${e}`,W="pyproject.toml",me=/^\[tool\.ruff(?:\.[\w-]+)*\]\s*$/m,ge=/^Would reformat:?\s+(.+)$/,ye=e=>{const t=h(e,W);if(!C(t))return!1;try{const n=H(t);return me.test(n)}catch{return!1}},B=e=>(t,n)=>{const s=w.ruff.packageNames.map(c=>D(n,c)).find(c=>c!==void 0),o=F(t,w.ruff.configFiles),r=o?void 0:ye(t)?h(t,W):void 0,i=o??r;if(!(!s&&!i))return{adapter:e,configFile:i,declared:!!s,declaredVersion:s,root:t}},xe=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),J=(e,t)=>e?xe(e)?e:h(t,e):t,ve=e=>ge.exec(e)?.[1]?.trim(),at={argsCheck:(e,t)=>T(e,t,!1),argsFix:(e,t)=>T(e,t,!0),bin:()=>["ruff","check"],cacheKey:(e,t)=>{const n=["ruff-check",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:B("ruff-check"),extensions:["py","pyi"],id:"ruff-check",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"ruff-check",file:t.root,fixable:!1,message:`ruff check output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const s=[];for(const o of n){const r=o.location,i=o.end_location;s.push({adapter:"ruff-check",column:r?.column,endColumn:i?.column,endLine:i?.row,file:J(o.filename,t.root),fixable:!!o.fix,line:r?.row,message:o.message??"",ruleId:o.code,severity:"warning"})}return s}},lt={argsCheck:(e,t)=>L(e,t,!1),argsFix:(e,t)=>L(e,t,!0),bin:()=>["ruff","format"],cacheKey:(e,t)=>{const n=["ruff-fmt",e.declaredVersion??"unknown",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:B("ruff-fmt"),extensions:["py","pyi"],id:"ruff-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const n=[],s=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=ve(o);!r||s.has(r)||(s.add(r),n.push({adapter:"ruff-fmt",file:J(r,t.root),fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return n}},T=(e,t,n)=>{const s=["--output-format=json"];return n&&s.push("--fix"),t.quiet&&s.push("--quiet"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},L=(e,t,n)=>{const s=[];return n||s.push("--check"),t.quiet&&s.push("--quiet"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},ut=(e,t)=>{const n=v(e,["diff","--name-only","--diff-filter=ACMR","-z",`${t}...HEAD`]);if(n===void 0)return;const s=v(e,["diff","--name-only","--diff-filter=ACMR","-z"]),o=v(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]),r=v(e,["ls-files","--others","--exclude-standard","-z"]),i=new Set;for(const c of[n,s??"",o??"",r??""])for(const u of c.split("\0"))u.length!==0&&i.add(S(u)?u:h(e,u));return[...i].sort()},dt=e=>{const t=v(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]);if(t===void 0)return;const n=new Set;for(const s of t.split("\0"))s.length!==0&&n.add(S(s)?s:h(e,s));return[...n].sort()},v=(e,t)=>{const n=te("git",[...t],{cwd:e,encoding:"utf8",timeout:1e4});if(n.status===0)return n.stdout},ft=(e,t)=>{const n=new Set(t.map(r=>r.toLowerCase())),s=[],o=new Set;for(const r of e){const i=r.lastIndexOf(".");if(i===-1||i===r.length-1)continue;const c=r.slice(i+1).toLowerCase();n.has(c)&&(o.has(r)||(o.add(r),s.push(r)))}return s},we=new Set(["-","stdout"]),_=e=>({close:()=>{},write:t=>{e.write(t)}}),Ae=e=>{le(Q(e));const t=se(e,"w");let n=[];return{close:()=>{n.length>0&&(re(t,n.join("")),n=[]),oe(t)},write:s=>{n.push(s)}}},pt=e=>{const{cwd:t,target:n}=e;if(n===void 0||we.has(n))return _(process.stdout);if(n==="stderr")return _(process.stderr);const s=S(n)?n:Y(t,n);return Ae(s)},j=["oxlint","oxfmt","biome","eslint","dprint","prettier","stylelint","ruff-check","ruff-fmt","markdownlint","shellcheck","deno-lint","deno-fmt"],ht=(e,t)=>{const n=new Map(e.map(i=>[i.id,i])),s=[],o=new Set,r=t&&t.length>0?t:j;for(const i of r){const c=n.get(i);c&&!o.has(i)&&(s.push(c),o.add(i))}if(t&&t.length>0)for(const i of j){const c=n.get(i);c&&!o.has(i)&&(s.push(c),o.add(i))}for(const i of e)o.has(i.id)||(s.push(i),o.add(i.id));return s},mt=(e,t,n)=>{const s=[];for(const o of t){const r=e.get(o.id);r&&Se(o.kind,n)&&s.push({adapter:o,presence:r})}return s},Se=(e,t)=>e===t||e==="both",gt=(e,t,n={})=>{const s=new Map;for(const o of e){const r=$e(o),i=Ce(r,t,n);if(!i)continue;const c=s.get(i);c?c.push(o):s.set(i,[o])}return s},$e=e=>{const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()},Ce=(e,t,n)=>{const s=n[e];if(s&&t.some(o=>o.adapter.id===s))return s;for(const{adapter:o}of t)if(o.extensions.includes(e))return o.id},Fe=e=>e==="error"?"error":e==="warning"?"warning":"notice",V=e=>e.replaceAll("%","%25").replaceAll("\r","%0D").replaceAll(`
2
+ `,"%0A"),M=e=>V(e).replaceAll(",","%2C").replaceAll(":","%3A").replaceAll("=","%3D"),ke=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,Ie=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),be=(e,t)=>{const n=Fe(e.severity),s=ke(e.file,t),o=e.ruleId?`${e.adapter}(${e.ruleId})`:e.adapter,r=[`file=${M(s)}`];return e.line!==void 0&&r.push(`line=${String(e.line)}`),e.endLine!==void 0&&r.push(`endLine=${String(e.endLine)}`),e.column!==void 0&&r.push(`col=${String(e.column)}`),e.endColumn!==void 0&&r.push(`endColumn=${String(e.endColumn)}`),r.push(`title=${M(o)}`),`::${n} ${r.join(",")}::${V(e.message)}
3
+ `},yt=e=>e.runs.flatMap(n=>[...n.findings]).sort(Ie).map(n=>be(n,e.workspaceRoot)).join(""),y=e=>e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;"),Re=e=>`<![CDATA[${e.replaceAll("]]>","]]]]><![CDATA[>")}]]>`,Te=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),Le=e=>e==="error"?"error":e==="warning"?"warning":"info",_e=(e,t)=>{let{file:n}=e;return t&&e.file.startsWith(`${t}/`)&&(n=e.file.slice(t.length+1)),e.line===void 0?n:e.column===void 0?`${n}:${String(e.line)}`:`${n}:${String(e.line)}:${String(e.column)}`},je=(e,t,n)=>{const s=_e(e,n),o=Le(e.severity),r=e.ruleId?`[${e.ruleId}] ${e.message}`:e.message;return[` <testcase classname="${y(t)}" name="${y(s)}">`,` <failure type="${y(o)}" message="${y(r)}">${Re(e.message)}</failure>`," </testcase>",""].join(`
4
+ `)},Me=(e,t,n)=>{const s=[...e.findings].sort(Te),o=s.filter(d=>d.severity==="error").length,r=s.filter(d=>d.severity==="warning").length,i=s.length,c=(e.durationMs/1e3).toFixed(3),u=s.map(d=>je(d,e.adapter,n)).join("");return` <testsuite ${[`name="${y(e.adapter)}"`,`tests="${String(i)}"`,`failures="${String(o)}"`,'errors="0"',`skipped="${String(r)}"`,`time="${c}"`,`timestamp="${t}"`].join(" ")}>
5
+ ${u} </testsuite>
6
+ `},xt=e=>{const t=(e.now??new Date).toISOString(),n=e.suiteName??"vis-lint-fmt",s=e.runs.map(a=>Me(a,t,e.workspaceRoot)).join(""),o=e.runs.reduce((a,d)=>a+d.findings.length,0),r=e.runs.reduce((a,d)=>a+d.findings.filter(l=>l.severity==="error").length,0),i=e.runs.reduce((a,d)=>a+d.findings.filter(l=>l.severity==="warning").length,0),c=(e.runs.reduce((a,d)=>a+d.durationMs,0)/1e3).toFixed(3);return`<?xml version="1.0" encoding="UTF-8"?>
7
+ <testsuites ${[`name="${y(n)}"`,`tests="${String(o)}"`,`failures="${String(r)}"`,'errors="0"',`skipped="${String(i)}"`,`time="${c}"`].join(" ")}>
8
+ ${s}</testsuites>
9
+ `},Ee="2.1.0",qe="https://json.schemastore.org/sarif-2.1.0.json",Pe=e=>e==="error"?"error":e==="warning"?"warning":"note",De=(e,t)=>t&&e.startsWith(`${t}/`)?{uri:e.slice(t.length+1),uriBaseId:"SRCROOT"}:{uri:e},Ne=e=>{const{href:t}=Z(e);return t.endsWith("/")?t:`${t}/`},Oe=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),We=e=>{const t=new Map;for(const n of e)n.ruleId&&(t.has(n.ruleId)||t.set(n.ruleId,{id:n.ruleId,name:n.ruleId}));return[...t.values()]},Be=(e,t)=>{const{uri:n,uriBaseId:s}=De(e.file,t),o={artifactLocation:s?{uri:n,uriBaseId:s}:{uri:n}};if(e.line!==void 0){const i={startLine:e.line};e.column!==void 0&&(i.startColumn=e.column),e.endLine!==void 0&&(i.endLine=e.endLine),e.endColumn!==void 0&&(i.endColumn=e.endColumn),o.region=i}const r={level:Pe(e.severity),locations:[{physicalLocation:o}],message:{text:e.message}};return e.ruleId&&(r.ruleId=e.ruleId),r},Je=(e,t)=>{const n=[...e.findings].sort(Oe),s=We(n),o={name:e.adapter,rules:s};e.presence?.declaredVersion&&(o.version=e.presence.declaredVersion);const r={results:n.map(i=>Be(i,t)),tool:{driver:o}};return t&&(r.originalUriBaseIds={SRCROOT:{uri:Ne(t)}}),r},vt=e=>{const t={$schema:qe,runs:e.runs.map(n=>Je(n,e.workspaceRoot)),version:Ee};return`${JSON.stringify(t,void 0,2)}
10
+ `},E={error:3,info:1,warning:2},wt=e=>{const t=[],n=[];let s,o=!1;for(const r of e){n.push({adapter:r.adapter,durationMs:r.durationMs,exitCode:r.exitCode,findingCount:r.findings.length}),r.exitCode!==0&&r.exitCode!==null&&r.findings.length===0&&(o=!0);for(const i of r.findings)t.push(i),(!s||E[i.severity]>E[s])&&(s=i.severity)}return{findings:t,hadProcessFailure:o,maxSeverity:s,runs:n}},At=e=>{const t=new Map;for(const n of e){const s=t.get(n.file);s?s.push(n):t.set(n.file,[n])}return t},St=e=>e.hadProcessFailure||e.maxSeverity==="error"?1:0,Ve=(e,t)=>{if(t==="fix"||process.env.VIS_NO_CACHE==="1"||e.length===0)return!1;for(const n of e)if(n==="."||n==="./"||n==="..")return!1;return!0},Ue=e=>{try{const t=P(e);return g("sha256").update(t).digest("hex")}catch{return}},Ke=(e,t,n,s,o)=>{const r=e.cacheKey(t,s),i=[];for(const u of[...n].sort()){const a=S(u)?u:h(t.root,u);try{ie(a)}catch{return}const d=Ue(a);if(!d)return;i.push({hash:d,path:a})}const c=g("sha256");c.update(e.id),c.update("\0"),c.update(r),c.update("\0"),c.update(o);for(const u of i)c.update("\0"),c.update(u.path),c.update("\0"),c.update(u.hash);return{fileHashes:i,key:c.digest("hex")}},U=(e,t)=>h(e,"lint-fmt",t),ze=(e,t,n)=>{const s=h(U(e,t.id),`${n}.json`);try{const o=P(s,"utf8"),r=JSON.parse(o);return r.schema!==1?void 0:r}catch{return}},Ge=(e,t,n,s,o)=>{const r=U(e,t.id),i={fileHashes:o,result:s,savedAt:Date.now(),schema:1};try{ce(r,{recursive:!0}),ae(h(r,`${n}.json`),JSON.stringify(i))}catch{}},q=async(e,t,n,s,o)=>{const r=e.bin(t),i=[...r.slice(1),...o==="fix"?e.argsFix(n,s):e.argsCheck(n,s)];return new Promise(c=>{const u=Date.now(),a=ne(r[0],i,{cwd:t.root}),d=[],l=[];let m=!1;const p=setTimeout(()=>{m=!0,a.kill("SIGKILL")},6e4);a.stdout.on("data",f=>d.push(f)),a.stderr.on("data",f=>l.push(f)),a.on("error",f=>{clearTimeout(p),c({durationMs:Date.now()-u,exitCode:null,stderr:f.message,stdout:""})}),a.on("close",f=>{clearTimeout(p),c({durationMs:Date.now()-u,exitCode:m?null:f,stderr:Buffer.concat(l).toString("utf8"),stdout:Buffer.concat(d).toString("utf8")})})})},$t=async(e,t,n,s=k())=>{if(e.length===0)return[];const{cacheRoot:o,concurrency:r}=typeof s=="number"?{concurrency:s}:{cacheRoot:s.cacheRoot,concurrency:s.concurrency??k()},i=async l=>{const m=l.options??t;if(o&&Ve(l.files,n)){const p=Ke(l.adapter,l.presence,l.files,m,n);if(p){const f=ze(o,l.adapter,p.key);if(f)return f.result;const $=await q(l.adapter,l.presence,l.files,m,n);return $.exitCode!==null&&Ge(o,l.adapter,p.key,$,p.fileHashes),$}}return q(l.adapter,l.presence,l.files,m,n)};if(process.env.VIS_LINT_FMT_SERIAL==="1"){const l=[];for(const m of e)l.push(await i(m));return l}const c=Math.max(1,Math.min(r,e.length)),u=Array.from({length:e.length});let a=0;const d=async()=>{for(;;){const l=a;if(a+=1,l>=e.length)return;u[l]=await i(e[l])}};return await Promise.all(Array.from({length:c},()=>d())),u},He=e=>{const t=new Set;for(const n of e)t.add(n.toLowerCase());return t},Ye=(e,t)=>{const n=e.lastIndexOf(".");return n===-1||n===e.length-1?!1:t.has(e.slice(n+1).toLowerCase())},Ct=async e=>{const{extensions:t,initialFiles:n,label:s,log:o,runCycle:r,workspaceRoot:i}=e,c=o??(p=>{process.stdout.write(`${p}
11
+ `)}),u=He(t);await r(n),c(`▸ ${s}: watching workspace — press Ctrl-C to exit`);let a=new Set,d=!1;const l=async()=>{for(;a.size>0;){const p=[...a];a=new Set;try{await r(p)}catch(f){c(`✗ ${s}: watch cycle failed — ${f.message}`)}}},m=ue({debounceMs:200,filter:p=>Ye(p,u),onChange:async p=>{for(const f of p)a.add(S(f)?f:h(i,f));if(!d){d=!0;try{await l()}finally{d=!1}}},paths:[i]});await new Promise(p=>{const f=()=>{m.close(),process.off("SIGINT",f),process.off("SIGTERM",f),p()};process.once("SIGINT",f),process.once("SIGTERM",f)})};export{rt as a,mt as b,ut as c,D as d,Ct as e,F as f,ot as g,lt as h,ct as i,gt as j,$t as k,wt as l,pt as m,vt as n,xt as o,yt as p,St as q,ht as r,dt as s,At as t,at as u,it as v,ft as w};
@@ -0,0 +1 @@
1
+ import{createRequire as v}from"node:module";import{n as w,C as x,o as B,m as A}from"./index-DHD8wb6Z.js";import{y}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";let S;const T=e=>(S??=v(import.meta.url))(e),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=e=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[r,t]=n.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return n.getBuiltinModule(e)}return T(e)},{createRequire:l}=_("node:module");let k=class extends Error{constructor(r){super(`EEXIST: ${r}`)}get code(){return"EEXIST"}set code(r){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(r){throw new Error("Cannot overwrite name of AlreadyExistsError")}};const m=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"};let j;const F=e=>(j??=l(import.meta.url))(e),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,N=e=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[r,t]=i.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return i.getBuiltinModule(e)}return F(e)},{lstatSync:g,mkdirSync:q}=N("node:fs"),re=e=>{w(e);try{const r=g(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(m(r))}'`);return}catch(r){if(r.code!=="ENOENT")throw r}try{q(e,{recursive:!0})}catch(r){if(r.code!=="EEXIST")throw r;const t=g(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(m(t))}'`,{cause:r})}},I=e=>{if(typeof e!="string"&&!(e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")};let M;const $=e=>(M??=l(import.meta.url))(e),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[r,t]=c.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return c.getBuiltinModule(e)}return $(e)},{randomBytes:U}=R("node:crypto"),X=e=>`${e}.${process.pid.toString(36)}.${U(6).toString("hex")}.tmp`,C=new TextEncoder,D=e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return C.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const r=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(r)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")};let O;const L=e=>(O??=l(import.meta.url))(e),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,V=e=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[r,t]=u.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return u.getBuiltinModule(e)}return L(e)},{mkdirSync:P,readFileSync:z,writeFileSync:G,statSync:H,renameSync:h,chownSync:J,chmodSync:K,unlinkSync:Q}=V("node:fs"),te=(e,r,t)=>{t={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...t},w(e),I(r),e=x(e);const f=y(e,B),d=t.flag??"w",b=d.includes("a"),E=d.includes("x");if(f&&(!t.overwrite||E))throw new k(`file already exists, open '${e}'`);const s=X(e);try{!f&&t.recursive&&P(A(e),{recursive:!0});let o,a=typeof r=="string"?Buffer.from(r,t.encoding??"utf8"):D(r);if(b&&f&&(a=Buffer.concat([z(e),a])),G(s,a,{flag:"wx"}),f&&t.backup&&(o=H(e),t.chown??={gid:o.gid,uid:o.uid},h(e,`${e}.bak`)),t.chown)try{J(s,t.chown.uid,t.chown.gid)}catch{}const p=o&&t.mode===void 0?o.mode:t.mode;p!==void 0&&K(s,p),h(s,e)}catch(o){throw new Error(`Failed to write file at: ${e} - ${o.message}`,{cause:o})}finally{y(s)&&Q(s)}};export{te as U,re as h,m as r};
@@ -1,5 +1,65 @@
1
1
  import { C as ChangelogFormatter } from "../../../packem_shared/api.d-BPftyU9r.js";
2
- export { type a as ChangeFileMeta, type b as ChangelogContext, type c as ChangelogFormatterModule, type d as ChangelogTarget, e as defineFormatter } from "../../../packem_shared/api.d-BPftyU9r.js";
2
+ export {
3
+ /**
4
+ * Public entry point for `@visulima/vis/release/changelog`.
5
+ *
6
+ * Exposes the changelog formatter contract (`ChangelogFormatter` /
7
+ * `ChangelogContext`), the `defineFormatter` authoring helper, and
8
+ * `resolveFormatter` which maps a `release.changelog` config value
9
+ * (`"default"`, `"github"`, `"keep-a-changelog"`, a path, a `[path, opts]`
10
+ * tuple, or `false`) to a concrete formatter function.
11
+ */
12
+ type a as ChangeFileMeta,
13
+ /**
14
+ * Public entry point for `@visulima/vis/release/changelog`.
15
+ *
16
+ * Exposes the changelog formatter contract (`ChangelogFormatter` /
17
+ * `ChangelogContext`), the `defineFormatter` authoring helper, and
18
+ * `resolveFormatter` which maps a `release.changelog` config value
19
+ * (`"default"`, `"github"`, `"keep-a-changelog"`, a path, a `[path, opts]`
20
+ * tuple, or `false`) to a concrete formatter function.
21
+ */
22
+ type b as ChangelogContext,
23
+ /**
24
+ * Public entry point for `@visulima/vis/release/changelog`.
25
+ *
26
+ * Exposes the changelog formatter contract (`ChangelogFormatter` /
27
+ * `ChangelogContext`), the `defineFormatter` authoring helper, and
28
+ * `resolveFormatter` which maps a `release.changelog` config value
29
+ * (`"default"`, `"github"`, `"keep-a-changelog"`, a path, a `[path, opts]`
30
+ * tuple, or `false`) to a concrete formatter function.
31
+ */
32
+ type c as ChangelogFormatterModule,
33
+ /**
34
+ * Public entry point for `@visulima/vis/release/changelog`.
35
+ *
36
+ * Exposes the changelog formatter contract (`ChangelogFormatter` /
37
+ * `ChangelogContext`), the `defineFormatter` authoring helper, and
38
+ * `resolveFormatter` which maps a `release.changelog` config value
39
+ * (`"default"`, `"github"`, `"keep-a-changelog"`, a path, a `[path, opts]`
40
+ * tuple, or `false`) to a concrete formatter function.
41
+ */
42
+ type d as ChangelogTarget,
43
+ /**
44
+ * Public entry point for `@visulima/vis/release/changelog`.
45
+ *
46
+ * Exposes the changelog formatter contract (`ChangelogFormatter` /
47
+ * `ChangelogContext`), the `defineFormatter` authoring helper, and
48
+ * `resolveFormatter` which maps a `release.changelog` config value
49
+ * (`"default"`, `"github"`, `"keep-a-changelog"`, a path, a `[path, opts]`
50
+ * tuple, or `false`) to a concrete formatter function.
51
+ */
52
+ e as defineFormatter } from "../../../packem_shared/api.d-BPftyU9r.js";
3
53
  import { VisReleaseConfig } from "../../types.js";
4
54
  declare const resolveFormatter: (setting: VisReleaseConfig["changelog"], cwd: string) => Promise<ChangelogFormatter>;
5
- export { type ChangelogFormatter, resolveFormatter };
55
+ export {
56
+ /**
57
+ * Public entry point for `@visulima/vis/release/changelog`.
58
+ *
59
+ * Exposes the changelog formatter contract (`ChangelogFormatter` /
60
+ * `ChangelogContext`), the `defineFormatter` authoring helper, and
61
+ * `resolveFormatter` which maps a `release.changelog` config value
62
+ * (`"default"`, `"github"`, `"keep-a-changelog"`, a path, a `[path, opts]`
63
+ * tuple, or `false`) to a concrete formatter function.
64
+ */
65
+ type ChangelogFormatter, resolveFormatter };
@@ -3,4 +3,28 @@ export type { I as InstallLockfileOnlyOptions, a as PackOptions, b as PackResult
3
3
  type PackageManagerId = "npm" | "pnpm" | "yarn" | "bun";
4
4
  declare const detectPackageManager: (cwd: string, _runner: CommandRunner) => Promise<PackageManagerId>;
5
5
  declare const createAdapter: (id: PackageManagerId, runner: CommandRunner) => PackageManagerAdapter;
6
- export { type CommandRunner, type PackageManagerAdapter, type PackageManagerId, createAdapter, detectPackageManager };
6
+ export { type CommandRunner, type PackageManagerAdapter,
7
+ /**
8
+ * Public entry point for `@visulima/vis/release/package-managers`.
9
+ *
10
+ * Exposes the `PackageManagerAdapter` contract (pack / publish / install /
11
+ * list / catalog) plus `detectPackageManager` and `createAdapter` for callers
12
+ * composing the publish pipeline directly.
13
+ */
14
+ type PackageManagerId,
15
+ /**
16
+ * Public entry point for `@visulima/vis/release/package-managers`.
17
+ *
18
+ * Exposes the `PackageManagerAdapter` contract (pack / publish / install /
19
+ * list / catalog) plus `detectPackageManager` and `createAdapter` for callers
20
+ * composing the publish pipeline directly.
21
+ */
22
+ createAdapter,
23
+ /**
24
+ * Public entry point for `@visulima/vis/release/package-managers`.
25
+ *
26
+ * Exposes the `PackageManagerAdapter` contract (pack / publish / install /
27
+ * list / catalog) plus `detectPackageManager` and `createAdapter` for callers
28
+ * composing the publish pipeline directly.
29
+ */
30
+ detectPackageManager };
@@ -1 +1 @@
1
- import{c as r,d as t}from"../../../packem_chunks/detect.js";export{r as createAdapter,t as detectPackageManager};
1
+ import{c as r,d as t}from"../../../packem_chunks/index3.js";export{r as createAdapter,t as detectPackageManager};
@@ -1,5 +1,41 @@
1
1
  import { V as VersionActions } from "../../../packem_shared/interface.d-CrHOtJc1.js";
2
- export { A as AfterAllProjectsVersioned, type a as AfterAllVersionedContext, type b as AfterAllVersionedResult, type P as PublishContext } from "../../../packem_shared/interface.d-CrHOtJc1.js";
2
+ export {
3
+ /**
4
+ * Public entry point for `@visulima/vis/release/version-actions`.
5
+ *
6
+ * Plugin authors implement `VersionActions` (and optionally
7
+ * `AfterAllProjectsVersioned`) to own a package's versioning + publish
8
+ * lifecycle, then point a package's `versionActions` config at the module.
9
+ * `createVersionActions` is the built-in id-to-implementation registry.
10
+ */
11
+ A as AfterAllProjectsVersioned,
12
+ /**
13
+ * Public entry point for `@visulima/vis/release/version-actions`.
14
+ *
15
+ * Plugin authors implement `VersionActions` (and optionally
16
+ * `AfterAllProjectsVersioned`) to own a package's versioning + publish
17
+ * lifecycle, then point a package's `versionActions` config at the module.
18
+ * `createVersionActions` is the built-in id-to-implementation registry.
19
+ */
20
+ type a as AfterAllVersionedContext,
21
+ /**
22
+ * Public entry point for `@visulima/vis/release/version-actions`.
23
+ *
24
+ * Plugin authors implement `VersionActions` (and optionally
25
+ * `AfterAllProjectsVersioned`) to own a package's versioning + publish
26
+ * lifecycle, then point a package's `versionActions` config at the module.
27
+ * `createVersionActions` is the built-in id-to-implementation registry.
28
+ */
29
+ type b as AfterAllVersionedResult,
30
+ /**
31
+ * Public entry point for `@visulima/vis/release/version-actions`.
32
+ *
33
+ * Plugin authors implement `VersionActions` (and optionally
34
+ * `AfterAllProjectsVersioned`) to own a package's versioning + publish
35
+ * lifecycle, then point a package's `versionActions` config at the module.
36
+ * `createVersionActions` is the built-in id-to-implementation registry.
37
+ */
38
+ type P as PublishContext } from "../../../packem_shared/interface.d-CrHOtJc1.js";
3
39
  import "../../types.js";
4
40
  import "../../../packem_shared/interface.d-CRqRz4jt.js";
5
41
  /**
@@ -11,4 +47,13 @@ import "../../../packem_shared/interface.d-CRqRz4jt.js";
11
47
  * @returns a fresh {@link VersionActions} instance.
12
48
  */
13
49
  declare const createVersionActions: (id: string) => VersionActions;
14
- export { VersionActions, createVersionActions };
50
+ export {
51
+ /**
52
+ * Public entry point for `@visulima/vis/release/version-actions`.
53
+ *
54
+ * Plugin authors implement `VersionActions` (and optionally
55
+ * `AfterAllProjectsVersioned`) to own a package's versioning + publish
56
+ * lifecycle, then point a package's `versionActions` config at the module.
57
+ * `createVersionActions` is the built-in id-to-implementation registry.
58
+ */
59
+ VersionActions, createVersionActions };
@@ -1 +1 @@
1
- import{AfterAllProjectsVersioned as r,VersionActions as s}from"../../../packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js";import{c}from"../../../packem_chunks/registry.js";export{r as AfterAllProjectsVersioned,s as VersionActions,c as createVersionActions};
1
+ import{AfterAllProjectsVersioned as r,VersionActions as s}from"../../../packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js";import{b as i}from"../../../packem_chunks/index2.js";export{r as AfterAllProjectsVersioned,s as VersionActions,i as createVersionActions};
@@ -230,4 +230,103 @@ declare class VisReleaseError extends Error {
230
230
  }
231
231
  /** Convenience factory — same as `new VisReleaseError(opts)` but more ergonomic at the call site. */
232
232
  declare const visReleaseError: (options: VisReleaseErrorOptions) => VisReleaseError;
233
- export { type ChangelogOptions, type ChangelogResult, type CleanPackageJsonConfig, DEFAULT_CLEAN_KEEP, DEFAULT_CLEAN_STRIP, DEFAULT_CONFIG, DEFAULT_DEPENDENCY_BUMP_RULES, type DependencyBumpRules, type PlannedRelease, type PublishOptions, type PublishResult, ReleaseClient, type ReleaseDraft, type ReleaseOptions, type ReleaseOptionsBase, type ReleasePlan, type SnapshotOptions, type SnapshotResult, type VersionOptions, type VersionResult, type VisReleaseConfig, VisReleaseError, type VisReleaseErrorCode, type VisReleaseErrorOptions, defineReleaseConfig, release, releaseChangelog, releaseDraft, releasePublish, releaseSnapshot, releaseVersion, resolveCleanStripList, visReleaseError };
233
+ export {
234
+ /**
235
+ * `@visulima/vis/release` — programmatic API for the vis release subsystem.
236
+ *
237
+ * See `packages/tooling/vis/rfc/design-release-manager.md` for the full design.
238
+ *
239
+ * Stability: every export here is part of vis's public API surface — breaking
240
+ * changes require a vis major version bump (RFC §21.1).
241
+ */
242
+ type ChangelogOptions,
243
+ /**
244
+ * `@visulima/vis/release` — programmatic API for the vis release subsystem.
245
+ *
246
+ * See `packages/tooling/vis/rfc/design-release-manager.md` for the full design.
247
+ *
248
+ * Stability: every export here is part of vis's public API surface — breaking
249
+ * changes require a vis major version bump (RFC §21.1).
250
+ */
251
+ type ChangelogResult, type CleanPackageJsonConfig, DEFAULT_CLEAN_KEEP, DEFAULT_CLEAN_STRIP, DEFAULT_CONFIG, DEFAULT_DEPENDENCY_BUMP_RULES, type DependencyBumpRules, type PlannedRelease,
252
+ /**
253
+ * `@visulima/vis/release` — programmatic API for the vis release subsystem.
254
+ *
255
+ * See `packages/tooling/vis/rfc/design-release-manager.md` for the full design.
256
+ *
257
+ * Stability: every export here is part of vis's public API surface — breaking
258
+ * changes require a vis major version bump (RFC §21.1).
259
+ */
260
+ type PublishOptions,
261
+ /**
262
+ * `@visulima/vis/release` — programmatic API for the vis release subsystem.
263
+ *
264
+ * See `packages/tooling/vis/rfc/design-release-manager.md` for the full design.
265
+ *
266
+ * Stability: every export here is part of vis's public API surface — breaking
267
+ * changes require a vis major version bump (RFC §21.1).
268
+ */
269
+ type PublishResult, ReleaseClient,
270
+ /**
271
+ * `@visulima/vis/release` — programmatic API for the vis release subsystem.
272
+ *
273
+ * See `packages/tooling/vis/rfc/design-release-manager.md` for the full design.
274
+ *
275
+ * Stability: every export here is part of vis's public API surface — breaking
276
+ * changes require a vis major version bump (RFC §21.1).
277
+ */
278
+ type ReleaseDraft,
279
+ /**
280
+ * `@visulima/vis/release` — programmatic API for the vis release subsystem.
281
+ *
282
+ * See `packages/tooling/vis/rfc/design-release-manager.md` for the full design.
283
+ *
284
+ * Stability: every export here is part of vis's public API surface — breaking
285
+ * changes require a vis major version bump (RFC §21.1).
286
+ */
287
+ type ReleaseOptions,
288
+ /**
289
+ * `@visulima/vis/release` — programmatic API for the vis release subsystem.
290
+ *
291
+ * See `packages/tooling/vis/rfc/design-release-manager.md` for the full design.
292
+ *
293
+ * Stability: every export here is part of vis's public API surface — breaking
294
+ * changes require a vis major version bump (RFC §21.1).
295
+ */
296
+ type ReleaseOptionsBase, type ReleasePlan,
297
+ /**
298
+ * `@visulima/vis/release` — programmatic API for the vis release subsystem.
299
+ *
300
+ * See `packages/tooling/vis/rfc/design-release-manager.md` for the full design.
301
+ *
302
+ * Stability: every export here is part of vis's public API surface — breaking
303
+ * changes require a vis major version bump (RFC §21.1).
304
+ */
305
+ type SnapshotOptions,
306
+ /**
307
+ * `@visulima/vis/release` — programmatic API for the vis release subsystem.
308
+ *
309
+ * See `packages/tooling/vis/rfc/design-release-manager.md` for the full design.
310
+ *
311
+ * Stability: every export here is part of vis's public API surface — breaking
312
+ * changes require a vis major version bump (RFC §21.1).
313
+ */
314
+ type SnapshotResult,
315
+ /**
316
+ * `@visulima/vis/release` — programmatic API for the vis release subsystem.
317
+ *
318
+ * See `packages/tooling/vis/rfc/design-release-manager.md` for the full design.
319
+ *
320
+ * Stability: every export here is part of vis's public API surface — breaking
321
+ * changes require a vis major version bump (RFC §21.1).
322
+ */
323
+ type VersionOptions,
324
+ /**
325
+ * `@visulima/vis/release` — programmatic API for the vis release subsystem.
326
+ *
327
+ * See `packages/tooling/vis/rfc/design-release-manager.md` for the full design.
328
+ *
329
+ * Stability: every export here is part of vis's public API surface — breaking
330
+ * changes require a vis major version bump (RFC §21.1).
331
+ */
332
+ type VersionResult, type VisReleaseConfig, VisReleaseError, type VisReleaseErrorCode, type VisReleaseErrorOptions, defineReleaseConfig, release, releaseChangelog, releaseDraft, releasePublish, releaseSnapshot, releaseVersion, resolveCleanStripList, visReleaseError };
@@ -1 +1 @@
1
- import{ReleaseClient as s,release as a,releaseChangelog as l,releaseDraft as o,releasePublish as E,releaseSnapshot as i,releaseVersion as n}from"../packem_shared/ReleaseClient-BY4OZNCK.js";import{DEFAULT_CLEAN_KEEP as L,DEFAULT_CLEAN_STRIP as f,DEFAULT_CONFIG as p,DEFAULT_DEPENDENCY_BUMP_RULES as _,defineReleaseConfig as m,resolveCleanStripList as C}from"../packem_chunks/DEFAULT_CLEAN_KEEP.js";import{defineReleasePlugin as D}from"../packem_chunks/defineReleasePlugin.js";import{VisReleaseError as U,visReleaseError as x}from"../packem_shared/VisReleaseError-DMGRBTNO.js";import{BUMP_LEVELS as F,bumpRank as N,maxBump as S}from"./types.js";export{F as BUMP_LEVELS,L as DEFAULT_CLEAN_KEEP,f as DEFAULT_CLEAN_STRIP,p as DEFAULT_CONFIG,_ as DEFAULT_DEPENDENCY_BUMP_RULES,s as ReleaseClient,U as VisReleaseError,N as bumpRank,m as defineReleaseConfig,D as defineReleasePlugin,S as maxBump,a as release,l as releaseChangelog,o as releaseDraft,E as releasePublish,i as releaseSnapshot,n as releaseVersion,C as resolveCleanStripList,x as visReleaseError};
1
+ import{ReleaseClient as s,release as a,releaseChangelog as l,releaseDraft as o,releasePublish as E,releaseSnapshot as i,releaseVersion as n}from"../packem_shared/ReleaseClient-DAvbxCdo.js";import{DEFAULT_CLEAN_KEEP as L,DEFAULT_CLEAN_STRIP as f,DEFAULT_CONFIG as p,DEFAULT_DEPENDENCY_BUMP_RULES as _,defineReleaseConfig as m,resolveCleanStripList as C}from"../packem_chunks/DEFAULT_CLEAN_KEEP.js";import{defineReleasePlugin as D}from"../packem_chunks/defineReleasePlugin.js";import{VisReleaseError as U,visReleaseError as x}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{BUMP_LEVELS as F,bumpRank as N,maxBump as S}from"./types.js";export{F as BUMP_LEVELS,L as DEFAULT_CLEAN_KEEP,f as DEFAULT_CLEAN_STRIP,p as DEFAULT_CONFIG,_ as DEFAULT_DEPENDENCY_BUMP_RULES,s as ReleaseClient,U as VisReleaseError,N as bumpRank,m as defineReleaseConfig,D as defineReleasePlugin,S as maxBump,a as release,l as releaseChangelog,o as releaseDraft,E as releasePublish,i as releaseSnapshot,n as releaseVersion,C as resolveCleanStripList,x as visReleaseError};
@@ -3,7 +3,22 @@ export type { b as ChangelogContext, c as ChangelogFormatterModule, d as Changel
3
3
  import { V as VersionActions } from "../packem_shared/interface.d-CrHOtJc1.js";
4
4
  export { A as AfterAllProjectsVersioned, type a as AfterAllVersionedContext, type b as AfterAllVersionedResult, type P as PublishContext } from "../packem_shared/interface.d-CrHOtJc1.js";
5
5
  export type { e as PublishResult } from "../packem_shared/interface.d-CRqRz4jt.js";
6
- export { d as defineReleasePlugin } from "../packem_shared/plugins.d-ND23R9I3.js";
6
+ export {
7
+ /**
8
+ * Author a lifecycle plugin (tegami parity). Unlike the single-purpose
9
+ * `define*` helpers above, a plugin hooks arbitrary points of the release
10
+ * lifecycle — `applyDraft`, `willPublish`, `afterPublish`, `afterPublishAll`.
11
+ *
12
+ * ```ts
13
+ * export default defineReleasePlugin({
14
+ * name: "build-before-publish",
15
+ * async willPublish({ package: pkg }) {
16
+ * await build(pkg.name);
17
+ * },
18
+ * });
19
+ * ```
20
+ */
21
+ d as defineReleasePlugin } from "../packem_shared/plugins.d-ND23R9I3.js";
7
22
  export type { PluginPackageInfo, PluginPublishSummary, ReleasePlugin, ReleasePluginContext } from "./types.js";
8
23
  interface NotificationPackage {
9
24
  /** Package name. */
@@ -1 +1 @@
1
- import{defineReleasePlugin as f}from"../packem_chunks/defineReleasePlugin.js";import{AfterAllProjectsVersioned as l,VersionActions as a}from"../packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js";const o=e=>e,n=e=>e,i=e=>e;export{l as AfterAllProjectsVersioned,a as VersionActions,i as defineChangelogFormatter,o as defineNotificationChannel,f as defineReleasePlugin,n as defineVersionActions};
1
+ import{defineReleasePlugin as s}from"../packem_chunks/defineReleasePlugin.js";import{AfterAllProjectsVersioned as c,VersionActions as l}from"../packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js";const o=e=>e,n=e=>e,t=e=>e;export{c as AfterAllProjectsVersioned,l as VersionActions,t as defineChangelogFormatter,o as defineNotificationChannel,s as defineReleasePlugin,n as defineVersionActions};
@@ -1 +1 @@
1
- const a=(r={})=>{const s=r.crateDir?`${r.crateDir}/Cargo.toml`:"Cargo.toml";return{cargoTomlPath:s,extraFiles:[{flags:"m",path:s,replace:"$1{version}$3",search:String.raw`^(version\s*=\s*")([^"]+)(")`},...r.extraFiles??[]],versionActions:"cargo"}},i=(r={})=>({extraFiles:[{flags:"m",path:r.projectDir?`${r.projectDir}/pyproject.toml`:"pyproject.toml",replace:"$1{version}$3",search:String.raw`^(version\s*=\s*")([^"]+)(")`},...r.extraFiles??[]],...r.projectDir?{pythonProjectDir:r.projectDir}:{},...r.uvLockPath?{uvLockPath:r.uvLockPath}:{},...r.uvWorkspace?{uvWorkspace:r.uvWorkspace}:{},versionActions:"python"}),n=(r={})=>{const s=r.projectDir?`${r.projectDir}/gradle.properties`:"gradle.properties",o=r.property??"version";return{extraFiles:[{flags:"m",path:s,replace:`${o}={version}`,search:String.raw`^${o}\s*=.*$`},...r.extraFiles??[]]}},l=(r={})=>({extraFiles:[{flags:"",path:r.pomDir?`${r.pomDir}/pom.xml`:"pom.xml",replace:"$1{version}$3",search:"(<version>)([^<]+)(</version>)"},...r.extraFiles??[]],versionActions:"maven"}),c=r=>({buildContext:r.buildContext,containerBuildArgs:r.buildArgs,containerImage:r.image,containerPlatforms:r.platforms,containerSigning:r.signing,containerSkipLatest:r.skipLatest,extraFiles:r.extraFiles??[],versionActions:"container"}),p=(r={})=>{const s=r.manifestPath??"jsr.json",o={flags:"m",path:s,replace:"$1{version}$3",search:String.raw`^(\s*"version"\s*:\s*")([^"]+)(")`},e=r.deno&&s!=="deno.json"?{flags:"m",path:"deno.json",replace:"$1{version}$3",search:String.raw`^(\s*"version"\s*:\s*")([^"]+)(")`}:void 0,t=[...r.allowSlowTypes?["--allow-slow-types"]:[],...r.publishArgs??[]];return{extraFiles:[o,...e?[e]:[],...r.extraFiles??[]],jsrConfigPath:s,...t.length>0?{jsrPublishArgs:t}:{},versionActions:"jsr"}},g=(r={})=>({extraFiles:r.extraFiles??[]});export{a as cargo,c as container,g as goMod,n as gradleProperties,p as jsr,l as pomXml,i as pyproject};
1
+ const c=(r={})=>{const e=r.crateDir?`${r.crateDir}/Cargo.toml`:"Cargo.toml";return{cargoTomlPath:e,extraFiles:[{flags:"m",path:e,replace:"$1{version}$3",search:String.raw`^(version\s*=\s*")([^"]+)(")`},...r.extraFiles??[]],versionActions:"cargo"}},n=(r={})=>({extraFiles:[{flags:"m",path:r.projectDir?`${r.projectDir}/pyproject.toml`:"pyproject.toml",replace:"$1{version}$3",search:String.raw`^(version\s*=\s*")([^"]+)(")`},...r.extraFiles??[]],...r.projectDir?{pythonProjectDir:r.projectDir}:{},...r.uvLockPath?{uvLockPath:r.uvLockPath}:{},...r.uvWorkspace?{uvWorkspace:r.uvWorkspace}:{},versionActions:"python"}),i=(r={})=>{const e=r.projectDir?`${r.projectDir}/gradle.properties`:"gradle.properties",a=r.property??"version";return{extraFiles:[{flags:"m",path:e,replace:`${a}={version}`,search:String.raw`^${a}\s*=.*$`},...r.extraFiles??[]]}},o=(r={})=>({extraFiles:[{flags:"",path:r.pomDir?`${r.pomDir}/pom.xml`:"pom.xml",replace:"$1{version}$3",search:"(<version>)([^<]+)(</version>)"},...r.extraFiles??[]],versionActions:"maven"}),l=r=>({buildContext:r.buildContext,containerBuildArgs:r.buildArgs,containerImage:r.image,containerPlatforms:r.platforms,containerSigning:r.signing,containerSkipLatest:r.skipLatest,extraFiles:r.extraFiles??[],versionActions:"container"}),g=(r={})=>{const e=r.manifestPath??"jsr.json",a={flags:"m",path:e,replace:"$1{version}$3",search:String.raw`^(\s*"version"\s*:\s*")([^"]+)(")`},s=r.deno&&e!=="deno.json"?{flags:"m",path:"deno.json",replace:"$1{version}$3",search:String.raw`^(\s*"version"\s*:\s*")([^"]+)(")`}:void 0,t=[...r.allowSlowTypes?["--allow-slow-types"]:[],...r.publishArgs??[]];return{extraFiles:[a,...s?[s]:[],...r.extraFiles??[]],jsrConfigPath:e,...t.length>0?{jsrPublishArgs:t}:{},versionActions:"jsr"}},p=(r={})=>({extraFiles:r.extraFiles??[]});export{c as cargo,l as container,p as goMod,i as gradleProperties,g as jsr,o as pomXml,n as pyproject};