@visulima/vis 7.1.0-next.5 → 7.1.0-next.6

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 (126) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/bin/route.mjs +154 -27
  3. package/dist/bin.js +1 -1
  4. package/dist/binx.js +1 -1
  5. package/dist/packem_chunks/bloom-sync.js +1 -1
  6. package/dist/packem_chunks/catalog.js +1 -1
  7. package/dist/packem_chunks/cli-exec.js +1 -1
  8. package/dist/packem_chunks/cli-main.js +1 -1
  9. package/dist/packem_chunks/fix.js +1 -1
  10. package/dist/packem_chunks/handler10.js +1 -1
  11. package/dist/packem_chunks/handler12.js +1 -1
  12. package/dist/packem_chunks/handler13.js +1 -1
  13. package/dist/packem_chunks/handler14.js +1 -1
  14. package/dist/packem_chunks/handler15.js +1 -1
  15. package/dist/packem_chunks/handler19.js +1 -1
  16. package/dist/packem_chunks/handler2.js +1 -1
  17. package/dist/packem_chunks/handler20.js +1 -1
  18. package/dist/packem_chunks/handler21.js +1 -1
  19. package/dist/packem_chunks/handler23.js +1 -1
  20. package/dist/packem_chunks/handler24.js +1 -1
  21. package/dist/packem_chunks/handler25.js +1 -1
  22. package/dist/packem_chunks/handler26.js +1 -1
  23. package/dist/packem_chunks/handler28.js +1 -1
  24. package/dist/packem_chunks/handler3.js +1 -1
  25. package/dist/packem_chunks/handler32.js +1 -1
  26. package/dist/packem_chunks/handler4.js +1 -1
  27. package/dist/packem_chunks/handler46.js +1 -1
  28. package/dist/packem_chunks/handler5.js +1 -1
  29. package/dist/packem_chunks/handler50.js +1 -1
  30. package/dist/packem_chunks/handler51.js +1 -1
  31. package/dist/packem_chunks/handler52.js +1 -1
  32. package/dist/packem_chunks/handler54.js +1 -1
  33. package/dist/packem_chunks/handler55.js +1 -1
  34. package/dist/packem_chunks/handler56.js +1 -1
  35. package/dist/packem_chunks/handler58.js +1 -1
  36. package/dist/packem_chunks/handler59.js +1 -1
  37. package/dist/packem_chunks/handler6.js +1 -1
  38. package/dist/packem_chunks/handler60.js +1 -1
  39. package/dist/packem_chunks/handler61.js +1 -1
  40. package/dist/packem_chunks/handler62.js +1 -1
  41. package/dist/packem_chunks/handler63.js +1 -1
  42. package/dist/packem_chunks/handler64.js +1 -1
  43. package/dist/packem_chunks/handler65.js +1 -1
  44. package/dist/packem_chunks/handler66.js +1 -1
  45. package/dist/packem_chunks/handler67.js +1 -1
  46. package/dist/packem_chunks/handler68.js +1 -1
  47. package/dist/packem_chunks/handler69.js +1 -1
  48. package/dist/packem_chunks/handler7.js +1 -1
  49. package/dist/packem_chunks/handler70.js +1 -1
  50. package/dist/packem_chunks/handler71.js +1 -1
  51. package/dist/packem_chunks/handler72.js +1 -1
  52. package/dist/packem_chunks/handler73.js +1 -1
  53. package/dist/packem_chunks/handler74.js +1 -1
  54. package/dist/packem_chunks/handler75.js +1 -1
  55. package/dist/packem_chunks/handler76.js +1 -1
  56. package/dist/packem_chunks/handler77.js +1 -1
  57. package/dist/packem_chunks/handler78.js +1 -1
  58. package/dist/packem_chunks/handler79.js +1 -1
  59. package/dist/packem_chunks/handler8.js +1 -1
  60. package/dist/packem_chunks/heal.js +1 -1
  61. package/dist/packem_chunks/help-command.js +1 -1
  62. package/dist/packem_chunks/index7.js +1 -1
  63. package/dist/packem_chunks/keys-refresh.js +1 -1
  64. package/dist/packem_chunks/list.js +1 -1
  65. package/dist/packem_chunks/prune.js +1 -1
  66. package/dist/packem_chunks/status.js +1 -1
  67. package/dist/packem_chunks/sync.js +1 -1
  68. package/dist/packem_chunks/sync2.js +1 -1
  69. package/dist/packem_chunks/tripwire.js +1 -1
  70. package/dist/packem_chunks/verify-lockfile.js +1 -1
  71. package/dist/packem_shared/{ReleaseClient-C2xIJ6LK.js → ReleaseClient-CqGLb7S4.js} +1 -1
  72. package/dist/packem_shared/{advisories-DoJg1aO9.js → advisories-BnFPhsl1.js} +1 -1
  73. package/dist/packem_shared/{affected-selection-vthRDY8k.js → affected-selection-Bd03KJU3.js} +1 -1
  74. package/dist/packem_shared/{ai-analysis-BQXQSrpM.js → ai-analysis-GjV2rF4U.js} +1 -1
  75. package/dist/packem_shared/{ai-cache-_pgEsibl.js → ai-cache-DFKUyj11.js} +1 -1
  76. package/dist/packem_shared/{ai-fix-Bc5SFN7s.js → ai-fix-DpBEXHZT.js} +1 -1
  77. package/dist/packem_shared/{bin-N12LFeEP.js → bin-D1zq7wxi.js} +1 -1
  78. package/dist/packem_shared/{build-scripts-Dff0s5AH.js → build-scripts-mKGcgTzp.js} +1 -1
  79. package/dist/packem_shared/{dependency-scan-DheQqeil.js → dependency-scan-BGKZYS_i.js} +1 -1
  80. package/dist/packem_shared/{detect-CknQIlyA.js → detect-CaA92iu_.js} +1 -1
  81. package/dist/packem_shared/{docker-w_1gOq50.js → docker-Cs174Imq.js} +1 -1
  82. package/dist/packem_shared/{ecosystem-gate-BKRW_EF3.js → ecosystem-gate-DcpvfgEi.js} +1 -1
  83. package/dist/packem_shared/{env-consistency-2UlhhMn5.js → env-consistency-nSuzisQe.js} +1 -1
  84. package/dist/packem_shared/{env-CGTN0BFz.js → env-sb3SOT-b.js} +1 -1
  85. package/dist/packem_shared/{failure-log-DwZ4pNmp.js → failure-log-AtaeZOrx.js} +1 -1
  86. package/dist/packem_shared/glob-Cyk1H9ZL-QtJl508G.js +1 -0
  87. package/dist/packem_shared/{index-DGll9r9W.js → index-C_7lOmB0.js} +1 -1
  88. package/dist/packem_shared/{index-CypvJE1G.js → index-CclzWrJ5.js} +1 -1
  89. package/dist/packem_shared/{lifecycle-B2m1OncV.js → lifecycle-BzenugED.js} +1 -1
  90. package/dist/packem_shared/{manifests-hpWznbs9.js → manifests-DPwVdkqB.js} +1 -1
  91. package/dist/packem_shared/{min-release-age-Dy7mkYsY.js → min-release-age-BH4JKSXA.js} +1 -1
  92. package/dist/packem_shared/{missing-package-json-SDyf6fjC.js → missing-package-json-ByjsDBbk.js} +1 -1
  93. package/dist/packem_shared/{multi-eco-lockfiles-DDjCxn43.js → multi-eco-lockfiles-Bz9ViPBV.js} +1 -1
  94. package/dist/packem_shared/{native-config-sync-DlljvZ64.js → native-config-sync-DI7_xs-Q.js} +1 -1
  95. package/dist/packem_shared/{osv-C4Vn7VCy.js → osv-DaMZpVWl.js} +1 -1
  96. package/dist/packem_shared/{package-version-DteJxz6k.js → package-version-VdULnxr1.js} +1 -1
  97. package/dist/packem_shared/{packument-BHB4BqzR.js → packument-zeKEhTaX.js} +1 -1
  98. package/dist/packem_shared/{project-name-filter-yTiFERfc.js → project-name-filter-BklluD5Y.js} +1 -1
  99. package/dist/packem_shared/{provenance-BLycrdW2.js → provenance-CwyZDw8A.js} +1 -1
  100. package/dist/packem_shared/publish-missing-DgPXeH9w.js +38 -0
  101. package/dist/packem_shared/{registry-48vkYPJB.js → registry-TXpTtpgS.js} +1 -1
  102. package/dist/packem_shared/{registry-keys-DdqAOng1.js → registry-keys-B4CNE38T.js} +1 -1
  103. package/dist/packem_shared/{renderToString-DR0zDUjh-AcCpRdMt.js → renderToString-DR0zDUjh-CdBv7J9a.js} +1 -1
  104. package/dist/packem_shared/{resolve-explicit-BbIYCI43.js → resolve-explicit-Cg3eqSqr.js} +1 -1
  105. package/dist/packem_shared/{run-summary-utils-BIFZ0_Qf.js → run-summary-utils-CZ2pIIOZ.js} +1 -1
  106. package/dist/packem_shared/{runtime-check-B2u8WTUY.js → runtime-check-By5NHR00.js} +1 -1
  107. package/dist/packem_shared/{s1ngularity-CTb560h1.js → s1ngularity-CXTWGOvX.js} +1 -1
  108. package/dist/packem_shared/{scaffold-files-CnWTGzav.js → scaffold-files-CC1M9Gje.js} +1 -1
  109. package/dist/packem_shared/{scan-progress-BEB4T6jo.js → scan-progress-BaCJp5nr.js} +1 -1
  110. package/dist/packem_shared/{selectors-DFzKNlk8.js → selectors-DdvjAetv.js} +1 -1
  111. package/dist/packem_shared/{signatures-CoRC1HW7.js → signatures-Bm-ySKmD.js} +1 -1
  112. package/dist/packem_shared/{spinner-uH0pr4ln.js → spinner-D8Eugb6Y.js} +1 -1
  113. package/dist/packem_shared/{table-DL8yVcm3.js → table-Dc3wOjzc.js} +1 -1
  114. package/dist/packem_shared/{tabs-C1RRtWUi.js → tabs-Ch5hj2ow.js} +1 -1
  115. package/dist/packem_shared/{toolchain-BdYvWNPz.js → toolchain-DQIOCPht.js} +1 -1
  116. package/dist/packem_shared/{typosquats-D0yqKvP6.js → typosquats-Dw02Q55Q.js} +1 -1
  117. package/dist/packem_shared/{use-measured-height-Cq0aFDqE.js → use-measured-height-wtekNTLa.js} +1 -1
  118. package/dist/packem_shared/{vis-update-app-B0FW7Sl_.js → vis-update-app-it6zkxW1.js} +1 -1
  119. package/dist/packem_shared/{vis-user-error-Bdcaov20.js → vis-user-error-6sSghaC9.js} +1 -1
  120. package/dist/packem_shared/{watch-loop-B2vH6Ae0.js → watch-loop-q7f9ukDX.js} +1 -1
  121. package/dist/release/index.js +1 -1
  122. package/index.d.ts +204 -213
  123. package/index.js +54 -54
  124. package/package.json +9 -9
  125. package/dist/packem_shared/glob-Cyk1H9ZL-DV-XWFct.js +0 -1
  126. package/dist/packem_shared/publish-missing-CZK1BpWt.js +0 -38
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## @visulima/vis [7.1.0-next.6](https://github.com/visulima/vis/compare/@visulima/vis@7.1.0-next.5...@visulima/vis@7.1.0-next.6) (2026-11-22)
2
+
3
+ ### Features
4
+
5
+ * **vis:** answer `affected --sparse-checkout` natively ([#155](https://github.com/visulima/vis/issues/155)) ([54d0fc7](https://github.com/visulima/vis/commit/54d0fc7d097f118d3299f29091087144f304823b))
6
+ * **vis:** answer the working-tree vis secrets scan natively ([#159](https://github.com/visulima/vis/issues/159)) ([c1ed22c](https://github.com/visulima/vis/commit/c1ed22cce1c80c65836c66abc4efed9ba4af10b4))
7
+ * **vis:** answer vis cache hash natively from the recorded run summary ([#156](https://github.com/visulima/vis/issues/156)) ([22b9a4c](https://github.com/visulima/vis/commit/22b9a4c958b6d687c8ca8d27bc5cf2f2157df0fb))
8
+
9
+ ### Bug Fixes
10
+
11
+ * **vis:** publish the manifest the version step wrote ([#160](https://github.com/visulima/vis/issues/160)) ([0cca730](https://github.com/visulima/vis/commit/0cca730e29fd66ad63af358d1d4939b343305348))
12
+
13
+ ### Code Refactoring
14
+
15
+ * **vis:** pull the always-native launcher cases into a helper ([#161](https://github.com/visulima/vis/issues/161)) ([f5916eb](https://github.com/visulima/vis/commit/f5916eb1b88dcbab5e09ad6335866464f4119fb9))
16
+
17
+ ### Tests
18
+
19
+ * **vis:** keep the runner's colour variables out of the secrets parity environment ([#163](https://github.com/visulima/vis/issues/163)) ([1bb0bb3](https://github.com/visulima/vis/commit/1bb0bb3b27c58a4fd4270287e81f2d63d80a8be7))
20
+ * **vis:** set the minute-aged cache entry's age again before each parity pair ([#164](https://github.com/visulima/vis/issues/164)) ([88ef067](https://github.com/visulima/vis/commit/88ef067f7ded3929f651b921aa952e60e298a868))
21
+
1
22
  ## @visulima/vis [7.1.0-next.5](https://github.com/visulima/vis/compare/@visulima/vis@7.1.0-next.4...@visulima/vis@7.1.0-next.5) (2026-11-22)
2
23
 
3
24
  ### Features
package/bin/route.mjs CHANGED
@@ -96,6 +96,19 @@ const plainTerm = (environment) => {
96
96
  return term === undefined || term.includes("dumb") || term.includes("mono");
97
97
  };
98
98
 
99
+ // Whether the launcher's root search ends at `cwd`, so a binary that computes the root from the working
100
+ // directory finds the same one as Node. The inherited `VIS_MONOREPO_ROOT` is only a reason to delegate,
101
+ // never the root itself.
102
+ const cwdIsRoot = (environment, cwd, holdsMarker) => {
103
+ const inheritedRoot = environment.VIS_MONOREPO_ROOT;
104
+
105
+ if (inheritedRoot && inheritedRoot !== cwd) {
106
+ return false;
107
+ }
108
+
109
+ return rootIsCwd(cwd, holdsMarker);
110
+ };
111
+
99
112
  // Whether `vis ignore` can pass the binary's native gate (`native_context` in `ignore.rs`). The
100
113
  // binary re-checks everything; this only skips the extra process when it would delegate anyway.
101
114
  // It never answers `ignore` on Windows (Node's colour detection and path handling differ there).
@@ -108,14 +121,7 @@ const ignoreMayRunNatively = (platform, environment, cwd, interactive, holdsMark
108
121
  return false;
109
122
  }
110
123
 
111
- // The inherited variable is only a reason to delegate, never the root itself.
112
- const inheritedRoot = environment.VIS_MONOREPO_ROOT;
113
-
114
- if (inheritedRoot && inheritedRoot !== cwd) {
115
- return false;
116
- }
117
-
118
- if (!rootIsCwd(cwd, holdsMarker)) {
124
+ if (!cwdIsRoot(environment, cwd, holdsMarker)) {
119
125
  return false;
120
126
  }
121
127
 
@@ -161,10 +167,123 @@ const listMayRunNatively = (platform, environment, args, interactive) => {
161
167
  return LIST_NATIVE_SHAPES.some((shape) => shape.length === flags.length && shape.every((flag, index) => flags[index] === flag));
162
168
  };
163
169
 
170
+ // Whether `vis cache hash` can pass the binary's native gate (`native` in `cache_hash.rs`). The
171
+ // binary re-checks the context and every shape (one task id, `--format json|table`, `--run <id>`),
172
+ // so this only skips the extra process for a call that would be delegated anyway: no task id, a
173
+ // flag the binary does not know, or a table in a context where Node may colour it (the binary does
174
+ // not; the JSON is written raw, so colour does not matter there). It stays in Node on Windows
175
+ // (pail's clock is unix-only there).
176
+ const CACHE_HASH_FLAG = /^--(?:format|run)(?:=.*)?$/;
177
+
178
+ const cacheHashAsksForJson = (flags) => flags.includes("--format=json") || flags.some((flag, index) => flag === "--format" && flags[index + 1] === "json");
179
+
180
+ const cacheHashMayRunNatively = (platform, environment, args, interactive) => {
181
+ const flags = args.slice(2);
182
+
183
+ if (platform === "win32" || interactive || !inCi(environment) || flags.length === 0 || !flags.every((token) => !token.startsWith("-") || CACHE_HASH_FLAG.test(token))) {
184
+ return false;
185
+ }
186
+
187
+ return cacheHashAsksForJson(flags) || (!IGNORE_COLOUR_ENVIRONMENT.some((key) => environment[key] !== undefined) && plainTerm(environment));
188
+ };
189
+
190
+ const CACHE_NATIVE_SUBCOMMANDS = new Set(["hash", "list", "size"]);
191
+
164
192
  // Whether `vis cache list|size` can pass the binary's native gate (`answer` in `cache.rs`). The binary
165
193
  // re-checks everything, including the flags, the root and the config; this only skips the extra process
166
- // when it would delegate anyway: not on Windows, not in a terminal, and only in a CI context.
167
- const cacheMayRunNatively = (platform, environment, interactive) => platform !== "win32" && !interactive && inCi(environment);
194
+ // when it would delegate anyway: not on Windows, not in a terminal, and only in a CI context. `hash` has
195
+ // its own, stricter gate above.
196
+ const cacheMayRunNatively = (subcommand, platform, environment, args, interactive) => {
197
+ if (subcommand === "hash") {
198
+ return cacheHashMayRunNatively(platform, environment, args, interactive);
199
+ }
200
+
201
+ return platform !== "win32" && !interactive && inCi(environment);
202
+ };
203
+
204
+ // Whether `vis affected` can pass the binary's native gate (`answer` in `affected.rs`). Only the
205
+ // `--sparse-checkout` shape is native, in a CI context; every other shape forwards to `vis run
206
+ // --affected`, which the binary hands to Node itself. The binary re-checks everything, so this only
207
+ // skips the extra process when it would delegate anyway.
208
+ const affectedMayRunNatively = (platform, environment, args, interactive) =>
209
+ platform !== "win32" && !interactive && inCi(environment) && args.includes("--sparse-checkout");
210
+
211
+ // The value of a `--name value` or `--name=value` option at `args[index]`, as `[value, next index]`:
212
+ // `undefined` when the argument is not that option, `false` when its value is missing or looks like a flag.
213
+ const optionValue = (args, index, name) => {
214
+ if (args[index] === name) {
215
+ const value = args[index + 1];
216
+
217
+ return value === undefined || value === "" || value.startsWith("-") ? false : [value, index + 2];
218
+ }
219
+
220
+ if (args[index].startsWith(`${name}=`)) {
221
+ const value = args[index].slice(name.length + 1);
222
+
223
+ return value === "" || value.startsWith("-") ? false : [value, index + 1];
224
+ }
225
+
226
+ return undefined;
227
+ };
228
+
229
+ // Whether `vis secrets` can pass the binary's native gate (`parse` and `context` in `secrets.rs`): the
230
+ // working-tree scan with `--format json|sarif|text`, `--quiet` and `--baseline <file>`, each at most once,
231
+ // and the text view only with `--quiet`. The binary re-checks everything, including the workspace root
232
+ // and the ignore and config files; this only skips the extra process when it would delegate anyway. Like
233
+ // `ignore`, it stays in Node when the working directory is not the workspace root. Like `clean`, it never
234
+ // answers on Windows or on a terminal, and not where Node's colour, `NODE_ENV`, `DEBUG`, `PAIL_LOG_LEVEL`
235
+ // or `CEREBRO_*` output settings could change what the status lines look like.
236
+ const secretsMayRunNatively = (platform, environment, args, cwd, interactive, holdsMarker) => {
237
+ if (platform === "win32" || interactive || !inCi(environment) || !cwdIsRoot(environment, cwd, holdsMarker) || IGNORE_COLOUR_ENVIRONMENT.some((key) => environment[key] !== undefined) || !plainTerm(environment)) {
238
+ return false;
239
+ }
240
+
241
+ if (
242
+ ["debug", "test"].includes(environment.NODE_ENV)
243
+ || environment.DEBUG !== undefined
244
+ || environment.PAIL_LOG_LEVEL !== undefined
245
+ || Object.keys(environment).some((key) => key.startsWith("CEREBRO_"))
246
+ ) {
247
+ return false;
248
+ }
249
+
250
+ let format;
251
+ let quiet = false;
252
+ let baseline = false;
253
+ let index = 1;
254
+
255
+ while (index < args.length) {
256
+ if (args[index] === "--quiet" && !quiet) {
257
+ quiet = true;
258
+ index += 1;
259
+
260
+ continue;
261
+ }
262
+
263
+ const given = optionValue(args, index, "--format");
264
+
265
+ if (given === false || (given !== undefined && (format !== undefined || !["json", "sarif", "text"].includes(given[0])))) {
266
+ return false;
267
+ }
268
+
269
+ if (given !== undefined) {
270
+ [format, index] = given;
271
+
272
+ continue;
273
+ }
274
+
275
+ const base = optionValue(args, index, "--baseline");
276
+
277
+ if (!Array.isArray(base) || baseline) {
278
+ return false;
279
+ }
280
+
281
+ baseline = true;
282
+ [, index] = base;
283
+ }
284
+
285
+ return (format ?? "text") !== "text" || quiet;
286
+ };
168
287
 
169
288
  // Commands with a native gate answer help through the binary on every platform (it enables
170
289
  // virtual-terminal processing on a Windows console), and otherwise follow the gate.
@@ -177,24 +296,20 @@ const helpOrNative = (args, mayRunNatively) => {
177
296
  return mayRunNatively();
178
297
  };
179
298
 
299
+ // Commands whose routing needs no flag check here, because the binary decides every shape itself: the
300
+ // native command set, `hook run` (the other `hook` subcommands - install, migrate, ... - are not native,
301
+ // so routing them through the binary would only add a second Node boot) and `advisories bloom status`.
302
+ // The binary answers that one natively only for `--format json --cache-dir <dir>` and hands every other
303
+ // shape to Node, as it does for `hook run`; the launcher does not check those flags.
304
+ const alwaysNative = (command, subcommand, args) =>
305
+ NATIVE_COMMANDS.has(command) || (command === "hook" && subcommand === "run") || (command === "advisories" && subcommand === "bloom" && args[2] === "status");
306
+
180
307
  // The routing of the commands that have their own native shapes: `true` or `false` when the
181
308
  // command decides, `undefined` when it is left to the help-surface rule in `routesToNative`.
182
309
  const routesCommandToNative = (args, platform, environment, cwd, interactive, holdsMarker = holdsRootMarker) => {
183
310
  const [command = "", subcommand] = args;
184
311
 
185
- if (NATIVE_COMMANDS.has(command)) {
186
- return true;
187
- }
188
-
189
- // `hook run` is native, but the other `hook` subcommands (install, migrate, …)
190
- // are not: sending those through the binary would only add a second Node boot.
191
- if (command === "hook" && subcommand === "run") {
192
- return true;
193
- }
194
-
195
- // `advisories bloom status` is answered natively for `--format json --cache-dir <dir>`.
196
- // The binary hands every other shape of it to Node itself, as it does for `hook run`.
197
- if (command === "advisories" && subcommand === "bloom" && args[2] === "status") {
312
+ if (alwaysNative(command, subcommand, args)) {
198
313
  return true;
199
314
  }
200
315
 
@@ -210,10 +325,16 @@ const routesCommandToNative = (args, platform, environment, cwd, interactive, ho
210
325
  return helpOrNative(args, () => listMayRunNatively(platform, environment, args, interactive));
211
326
  }
212
327
 
213
- // `cache list` and `cache size` are native for their plain shapes in a CI context
214
- // (`native/cli/src/cache.rs`); the binary hands every other shape to Node itself.
215
- if (command === "cache" && (subcommand === "list" || subcommand === "size")) {
216
- return helpOrNative(args, () => cacheMayRunNatively(platform, environment, interactive));
328
+ // `cache list`, `cache size` (`native/cli/src/cache.rs`) and `cache hash` (`native/cli/src/cache_hash.rs`)
329
+ // are native for their plain shapes in a CI context; the binary hands every other shape to Node itself.
330
+ if (command === "cache" && CACHE_NATIVE_SUBCOMMANDS.has(subcommand)) {
331
+ return helpOrNative(args, () => cacheMayRunNatively(subcommand, platform, environment, args, interactive));
332
+ }
333
+
334
+ // `affected <target> --sparse-checkout` is native in a CI context (`native/cli/src/affected.rs`); any
335
+ // other run would be delegated by the binary, which costs a second Node boot.
336
+ if (command === "affected") {
337
+ return helpOrNative(args, () => affectedMayRunNatively(platform, environment, args, interactive));
217
338
  }
218
339
 
219
340
  // `clean` (no flags, `--dry-run`, `--lockfile`) is answered natively; the binary hands every
@@ -223,6 +344,12 @@ const routesCommandToNative = (args, platform, environment, cwd, interactive, ho
223
344
  return helpOrNative(args, () => cleanMayRunNatively(platform, environment, args, interactive));
224
345
  }
225
346
 
347
+ // `secrets` is native for the plain working-tree scan (`native/cli/src/secrets.rs`); any other
348
+ // run would be delegated by the binary, which costs a second Node boot.
349
+ if (command === "secrets") {
350
+ return helpOrNative(args, () => secretsMayRunNatively(platform, environment, args, cwd, interactive, holdsMarker));
351
+ }
352
+
226
353
  // A bare command group lists its subcommands, which the binary answers like `<group> --help` (any
227
354
  // other shape is Node's, which prints the same listing). The binary enables virtual-terminal
228
355
  // processing, so Windows answers it natively too.
package/dist/bin.js CHANGED
@@ -1 +1 @@
1
- import"./packem_shared/compile-cache-DoMHRsRZ.js";import"./packem_shared/bin-N12LFeEP.js";
1
+ import"./packem_shared/compile-cache-DoMHRsRZ.js";import"./packem_shared/bin-D1zq7wxi.js";
package/dist/binx.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as r,x as i,i as c,d as a,r as d}from"./packem_shared/vis-user-error-Bdcaov20.js";import{t as n}from"./packem_shared/compile-cache-DoMHRsRZ.js";import{g as o}from"./packem_shared/package-version-DteJxz6k.js";process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");process.argv.slice(2).some(s=>s==="--version"||s==="-v"||s==="-V")&&(process.stdout.write(`${o()}
2
+ import{a as r,x as i,i as c,d as a,r as d}from"./packem_shared/vis-user-error-6sSghaC9.js";import{t as n}from"./packem_shared/compile-cache-DoMHRsRZ.js";import{g as o}from"./packem_shared/package-version-VdULnxr1.js";process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");process.argv.slice(2).some(s=>s==="--version"||s==="-v"||s==="-V")&&(process.stdout.write(`${o()}
3
3
  `),process.exit(0));process.argv.splice(2,0,"dlx");n();const e=r("visx",{packageName:"visx",packageVersion:o()}),p=process.argv.includes("--debug")||!!process.env.DEBUG;e.addPlugin(i({concise:c,detailed:p,exitOnError:!1}));e.addCommand(a);d(e);
@@ -1,2 +1,2 @@
1
- import{F as f}from"../packem_shared/index.server-Ca_EEVfw.js";import{p as i}from"./cli-main.js";import{s as d}from"../packem_shared/scan-progress-BEB4T6jo.js";import{D as p,s as D}from"../packem_shared/osv-bloom-DU6avR2k.js";const h=o=>o?.security?.audit?.advisories?.bloom??{},u=o=>o>=1e3?`${(o/1e3).toFixed(1)}s`:`${Math.round(o)}ms`,$=o=>o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/(1024*1024)).toFixed(1)} MB`,b=async({options:o,visConfig:m,workspaceRoot:n})=>{if(!n)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const a=o.format==="json",c=h(m),l=o.source??c.source??p,r=d([{id:"bloom",label:"Sync osv-bloom prefilter"}],{live:!a});let e,t;try{r.start("bloom");const s=Date.now();e=await D({allowedHosts:c.allowedHosts,cacheDir:o.cacheDir,force:!!o.force,source:l,workspaceRoot:n}),e.upToDate?r.finish("bloom","ok",`up to date · ${u(Date.now()-s)}`):r.finish("bloom","ok",`${e.manifest.entryCount.toLocaleString()} entries · ${$(e.bytesOnDisk)} · ${u(e.durationMs)}`)}catch(s){t=s instanceof Error?s.message:String(s),r.finish("bloom","error",t)}finally{r.stop()}a?process.stdout.write(`${JSON.stringify({bytesOnDisk:e?.bytesOnDisk??0,cacheDir:e?.cacheDir??null,durationMs:e?.durationMs??0,error:t??null,manifest:e?.manifest??null,source:l,upToDate:e?.upToDate??!1},void 0,2)}
1
+ import{F as f}from"../packem_shared/index.server-Ca_EEVfw.js";import{p as i}from"./cli-main.js";import{s as d}from"../packem_shared/scan-progress-BaCJp5nr.js";import{D as p,s as D}from"../packem_shared/osv-bloom-DU6avR2k.js";const h=o=>o?.security?.audit?.advisories?.bloom??{},u=o=>o>=1e3?`${(o/1e3).toFixed(1)}s`:`${Math.round(o)}ms`,$=o=>o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/(1024*1024)).toFixed(1)} MB`,b=async({options:o,visConfig:m,workspaceRoot:n})=>{if(!n)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const a=o.format==="json",c=h(m),l=o.source??c.source??p,r=d([{id:"bloom",label:"Sync osv-bloom prefilter"}],{live:!a});let e,t;try{r.start("bloom");const s=Date.now();e=await D({allowedHosts:c.allowedHosts,cacheDir:o.cacheDir,force:!!o.force,source:l,workspaceRoot:n}),e.upToDate?r.finish("bloom","ok",`up to date · ${u(Date.now()-s)}`):r.finish("bloom","ok",`${e.manifest.entryCount.toLocaleString()} entries · ${$(e.bytesOnDisk)} · ${u(e.durationMs)}`)}catch(s){t=s instanceof Error?s.message:String(s),r.finish("bloom","error",t)}finally{r.stop()}a?process.stdout.write(`${JSON.stringify({bytesOnDisk:e?.bytesOnDisk??0,cacheDir:e?.cacheDir??null,durationMs:e?.durationMs??0,error:t??null,manifest:e?.manifest??null,source:l,upToDate:e?.upToDate??!1},void 0,2)}
2
2
  `):e&&(i.info(f(`Cache: ${e.cacheDir}`)),i.info(f(`Built: ${e.manifest.builtAtRfc3339}`)),t||i.success(e.upToDate?"osv-bloom prefilter up to date.":"osv-bloom prefilter synced.")),t&&(process.exitCode=1)},g=b;export{g as advisoriesBloomSyncExecute};
@@ -1,4 +1,4 @@
1
- import{createRequire as je}from"node:module";import{z as N,e as g,$ as _e,m as V}from"../packem_shared/index-0dnGN3GP.js";import{L as Re,q as X,u as oe,R as C,O as W,X as De,e as J,p as P,g as ce,F as I,f as Oe,G as ie,J as H,h as le,i as D}from"../packem_shared/registry-48vkYPJB.js";import{L as ue}from"../packem_shared/index-CIdjkZgt.js";import{y as h}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{U as A,h as O,e as Le,i as Me}from"../packem_shared/env-CGTN0BFz.js";import{f as Ue}from"../packem_shared/removeSync-g1D5kONg-jOsRSIIv.js";import{p as b}from"../packem_shared/package-version-DteJxz6k.js";import{g as pe,T as fe,l as Wt}from"../packem_shared/npmrc-CIvOb61L.js";import{p as cn}from"../packem_shared/npmrc-CIvOb61L.js";import{O as ge}from"../packem_shared/renderToString-DR0zDUjh-AcCpRdMt.js";import{q as We}from"../packem_shared/table-DL8yVcm3.js";import{f as Ie}from"../packem_shared/osv-C4Vn7VCy.js";import{a as Be}from"../packem_shared/index--eV4qIz5.js";import{a as Z}from"../packem_shared/advisories-DoJg1aO9.js";let Ce;const Ae=t=>(Ce??=je(import.meta.url))(t),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xe=t=>{if(typeof j<"u"&&j.versions&&j.versions.node){const[e,n]=j.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return j.getBuiltinModule(t)}return Ae(t)},{createInterface:Fe}=xe("node:readline"),G=["dependencies","devDependencies","optionalDependencies"],Ge=new Set([...G,"overrides","peerDependencies","pnpm.overrides","resolutions"]),x=t=>{const e=t.lastIndexOf(":");if(e===-1)return;const n=t.slice(e+1);if(Ge.has(n))return{depType:n,relativePath:t.slice(0,e)}},L=t=>{const e=ue("vis",{create:!0,cwd:t});if(!e)throw new Error("Cannot resolve cache directory. Ensure node_modules exists in your workspace. Run your package manager's install command first.");return g(e,"backup")},Y=(t,e)=>e==="bun"?g(t,"package.json"):g(t,"pnpm-workspace.yaml"),K=(t,e)=>{const n=L(t),s=new Set;for(const a of e){const r=x(a.catalogName);r&&s.add(r.relativePath==="."?"package.json":g(r.relativePath,"package.json"))}if(s.size!==0){O(n);for(const a of s){const r=g(t,a);if(h(r)){const o=g(n,a),c=V(o);O(c),A(o,N(r))}}return n}},q=(t,e)=>{const n=Y(t,e),s=L(t);return g(s,`${_e(n)}.bak`)},Ve=(t,e,n)=>{if((e==="npm"||e==="yarn")&&n)return K(t,n);let s;const a=Y(t,e);if(h(a)&&(s=q(t,e),O(V(s)),A(s,N(a))),n){const r=n.filter(o=>x(o.catalogName));r.length>0&&K(t,r)}return s},Xe=t=>{const e=L(t);if(!h(e))return!1;for(const n of Re(e,{includeDirs:!1})){const s=n.path.slice(e.length+1),a=g(t,s);A(a,N(n.path))}return Ue(e),!0},Xt=(t,e)=>{if(e==="npm"||e==="yarn")return Xe(t);const n=Y(t,e),s=q(t,e);if(!h(s))return!1;const a=N(s);return A(n,a),!0},Jt=(t,e)=>{if(e==="npm"||e==="yarn")try{const n=L(t);return h(n)}catch{return!1}try{return h(q(t,e))}catch{return!1}},de=t=>{if(h(t))try{return b(t)}catch{return}},Je=t=>{const e=de(g(t,"package.json"));return!!(e?.workspaces?.catalog||e?.workspaces?.catalogs)},He=t=>{const e=new Map;if(t.workspaces?.catalog&&typeof t.workspaces.catalog=="object"&&e.set("default",new Map(Object.entries(t.workspaces.catalog))),t.workspaces?.catalogs&&typeof t.workspaces.catalogs=="object")for(const[n,s]of Object.entries(t.workspaces.catalogs))s&&typeof s=="object"&&e.set(n,new Map(Object.entries(s)));return e},Ye=t=>{const e=de(g(t,"package.json"));return e?He(e):new Map},qe=(t,e,n)=>{const s=g(t,"package.json"),a=b(s);for(const r of e)if(r.catalogName==="default")a.workspaces?.catalog&&(a.workspaces.catalog[r.packageName]=r.newRange);else{const o=a.workspaces?.catalogs?.[r.catalogName];o&&(o[r.packageName]=r.newRange)}X(s,a,{indent:oe(s,{useEditorconfig:n}),overwrite:!0})},ze=/\*+/g,Qe=/[.+^${}()|[\]\\]/g,ee=new Map,E=(t,e)=>{let n=ee.get(e);if(!n){const a=e.replaceAll(ze,"*").replaceAll(Qe,String.raw`\$&`);n=new RegExp(`^${a.replaceAll("*",".*").replaceAll("?",".")}$`),ee.set(e,n)}return n.test(t)},me=(t,e,n)=>n.some(s=>E(t,s))?!1:e.length>0?e.some(s=>E(t,s)):!0,te=new Map,he=(t,e,n)=>{if(!n)return e;const s=n[t];if(s!==void 0)return s;for(const[a,r]of Object.entries(n))if(a!==t){if(a.startsWith("/")&&a.endsWith("/")){let o=te.get(a);if(o||(o=new RegExp(a.slice(1,-1)),te.set(a,o)),o.test(t))return r}else if(E(t,a))return r}return e},Ze=/^(?:'([^']+)'|"([^"]+)"|([^:\s]+)):\s*(?:'([^']+)'|"([^"]+)"|(\S+))/,Ke=/^catalog:/m,et=/^catalogs:/m,ke=/^['"]|['"]$/g,we=t=>{const e=Ze.exec(t);if(!e)return;const n=e[1]??e[2]??e[3],s=e[4]??e[5]??e[6];if(!(!n||!s))return[n,s]},ye=(t,e,n,s)=>{t.has(e)||t.set(e,new Map);const a=t.get(e);a&&a.set(n,s)},tt=(t,e,n)=>{if(n<2)return;const s=we(e);s&&ye(t,"default",s[0],s[1])},nt=(t,e,n,s)=>{if(n===2&&e.endsWith(":"))return e.slice(0,-1).trim().replaceAll(ke,"");if(n>=4&&s){const a=we(e);a&&ye(t,s,a[0],a[1])}return s},$e=t=>t==="catalog:"||t.startsWith("catalog:")?"catalog":t==="catalogs:"||t.startsWith("catalogs:")?"catalogs":"none",st=t=>{const e=new Map;let n="none",s="";for(const a of t.split(`
1
+ import{createRequire as je}from"node:module";import{z as N,e as g,$ as _e,m as V}from"../packem_shared/index-0dnGN3GP.js";import{L as Re,q as X,u as oe,R as C,O as W,X as De,e as J,p as P,g as ce,F as I,f as Oe,G as ie,J as H,h as le,i as D}from"../packem_shared/registry-TXpTtpgS.js";import{L as ue}from"../packem_shared/index-CIdjkZgt.js";import{y as h}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{U as A,h as O,e as Le,i as Me}from"../packem_shared/env-sb3SOT-b.js";import{f as Ue}from"../packem_shared/removeSync-g1D5kONg-jOsRSIIv.js";import{p as b}from"../packem_shared/package-version-VdULnxr1.js";import{g as pe,T as fe,l as Wt}from"../packem_shared/npmrc-CIvOb61L.js";import{p as cn}from"../packem_shared/npmrc-CIvOb61L.js";import{O as ge}from"../packem_shared/renderToString-DR0zDUjh-CdBv7J9a.js";import{q as We}from"../packem_shared/table-Dc3wOjzc.js";import{f as Ie}from"../packem_shared/osv-DaMZpVWl.js";import{a as Be}from"../packem_shared/index--eV4qIz5.js";import{a as Z}from"../packem_shared/advisories-BnFPhsl1.js";let Ce;const Ae=t=>(Ce??=je(import.meta.url))(t),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xe=t=>{if(typeof j<"u"&&j.versions&&j.versions.node){const[e,n]=j.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return j.getBuiltinModule(t)}return Ae(t)},{createInterface:Fe}=xe("node:readline"),G=["dependencies","devDependencies","optionalDependencies"],Ge=new Set([...G,"overrides","peerDependencies","pnpm.overrides","resolutions"]),x=t=>{const e=t.lastIndexOf(":");if(e===-1)return;const n=t.slice(e+1);if(Ge.has(n))return{depType:n,relativePath:t.slice(0,e)}},L=t=>{const e=ue("vis",{create:!0,cwd:t});if(!e)throw new Error("Cannot resolve cache directory. Ensure node_modules exists in your workspace. Run your package manager's install command first.");return g(e,"backup")},Y=(t,e)=>e==="bun"?g(t,"package.json"):g(t,"pnpm-workspace.yaml"),K=(t,e)=>{const n=L(t),s=new Set;for(const a of e){const r=x(a.catalogName);r&&s.add(r.relativePath==="."?"package.json":g(r.relativePath,"package.json"))}if(s.size!==0){O(n);for(const a of s){const r=g(t,a);if(h(r)){const o=g(n,a),c=V(o);O(c),A(o,N(r))}}return n}},q=(t,e)=>{const n=Y(t,e),s=L(t);return g(s,`${_e(n)}.bak`)},Ve=(t,e,n)=>{if((e==="npm"||e==="yarn")&&n)return K(t,n);let s;const a=Y(t,e);if(h(a)&&(s=q(t,e),O(V(s)),A(s,N(a))),n){const r=n.filter(o=>x(o.catalogName));r.length>0&&K(t,r)}return s},Xe=t=>{const e=L(t);if(!h(e))return!1;for(const n of Re(e,{includeDirs:!1})){const s=n.path.slice(e.length+1),a=g(t,s);A(a,N(n.path))}return Ue(e),!0},Xt=(t,e)=>{if(e==="npm"||e==="yarn")return Xe(t);const n=Y(t,e),s=q(t,e);if(!h(s))return!1;const a=N(s);return A(n,a),!0},Jt=(t,e)=>{if(e==="npm"||e==="yarn")try{const n=L(t);return h(n)}catch{return!1}try{return h(q(t,e))}catch{return!1}},de=t=>{if(h(t))try{return b(t)}catch{return}},Je=t=>{const e=de(g(t,"package.json"));return!!(e?.workspaces?.catalog||e?.workspaces?.catalogs)},He=t=>{const e=new Map;if(t.workspaces?.catalog&&typeof t.workspaces.catalog=="object"&&e.set("default",new Map(Object.entries(t.workspaces.catalog))),t.workspaces?.catalogs&&typeof t.workspaces.catalogs=="object")for(const[n,s]of Object.entries(t.workspaces.catalogs))s&&typeof s=="object"&&e.set(n,new Map(Object.entries(s)));return e},Ye=t=>{const e=de(g(t,"package.json"));return e?He(e):new Map},qe=(t,e,n)=>{const s=g(t,"package.json"),a=b(s);for(const r of e)if(r.catalogName==="default")a.workspaces?.catalog&&(a.workspaces.catalog[r.packageName]=r.newRange);else{const o=a.workspaces?.catalogs?.[r.catalogName];o&&(o[r.packageName]=r.newRange)}X(s,a,{indent:oe(s,{useEditorconfig:n}),overwrite:!0})},ze=/\*+/g,Qe=/[.+^${}()|[\]\\]/g,ee=new Map,E=(t,e)=>{let n=ee.get(e);if(!n){const a=e.replaceAll(ze,"*").replaceAll(Qe,String.raw`\$&`);n=new RegExp(`^${a.replaceAll("*",".*").replaceAll("?",".")}$`),ee.set(e,n)}return n.test(t)},me=(t,e,n)=>n.some(s=>E(t,s))?!1:e.length>0?e.some(s=>E(t,s)):!0,te=new Map,he=(t,e,n)=>{if(!n)return e;const s=n[t];if(s!==void 0)return s;for(const[a,r]of Object.entries(n))if(a!==t){if(a.startsWith("/")&&a.endsWith("/")){let o=te.get(a);if(o||(o=new RegExp(a.slice(1,-1)),te.set(a,o)),o.test(t))return r}else if(E(t,a))return r}return e},Ze=/^(?:'([^']+)'|"([^"]+)"|([^:\s]+)):\s*(?:'([^']+)'|"([^"]+)"|(\S+))/,Ke=/^catalog:/m,et=/^catalogs:/m,ke=/^['"]|['"]$/g,we=t=>{const e=Ze.exec(t);if(!e)return;const n=e[1]??e[2]??e[3],s=e[4]??e[5]??e[6];if(!(!n||!s))return[n,s]},ye=(t,e,n,s)=>{t.has(e)||t.set(e,new Map);const a=t.get(e);a&&a.set(n,s)},tt=(t,e,n)=>{if(n<2)return;const s=we(e);s&&ye(t,"default",s[0],s[1])},nt=(t,e,n,s)=>{if(n===2&&e.endsWith(":"))return e.slice(0,-1).trim().replaceAll(ke,"");if(n>=4&&s){const a=we(e);a&&ye(t,s,a[0],a[1])}return s},$e=t=>t==="catalog:"||t.startsWith("catalog:")?"catalog":t==="catalogs:"||t.startsWith("catalogs:")?"catalogs":"none",st=t=>{const e=new Map;let n="none",s="";for(const a of t.split(`
2
2
  `)){const r=a.trimStart(),o=a.length-r.length;if(o===0&&r.length>0&&!r.startsWith("#")){n=$e(r),n==="catalogs"&&(s="");continue}r.length===0||r.startsWith("#")||(n==="catalog"&&tt(e,r,o),n==="catalogs"&&(s=nt(e,r,o,s)))}return e},at=t=>{const e=g(t,"pnpm-workspace.yaml");if(!h(e))return!1;const n=N(e);return Ke.test(n)||et.test(n)},rt=t=>{const e=g(t,"pnpm-workspace.yaml");if(!h(e))return new Map;const n=N(e);return st(n)},ne=/[.*+?^${}()|[\]\\]/g,ot=(t,e)=>{const n=t.replaceAll(ne,String.raw`\$&`),s=e.replaceAll(ne,String.raw`\$&`);return new RegExp(String.raw`^(?:'${n}'|"${n}"|${n}):\s*['"]?${s}['"]?`)},ct=(t,e,n)=>ot(e,n).test(t),it=t=>{const e=new Map;for(const n of t){e.has(n.catalogName)||e.set(n.catalogName,new Map);const s=e.get(n.catalogName);s&&s.set(n.packageName,{newRange:n.newRange,oldRange:n.currentRange})}return e},se=(t,e,n)=>{if(!n)return t;for(const[s,{newRange:a,oldRange:r}]of n)if(ct(e,s,r))return t.replace(r,a);return t},lt=(t,e,n,s)=>{const a=t.trimStart(),r=t.length-a.length;return a.length===0||a.startsWith("#")?t:e==="catalog"&&r>=2?se(t,a,s.get("default")):e==="catalogs"&&r>=4&&n?se(t,a,s.get(n)):t},ut=(t,e)=>{const n=g(t,"pnpm-workspace.yaml"),a=N(n).split(`
3
3
  `),r=it(e);let o="none",c="";const i=[];for(const l of a){const u=l.trimStart(),p=l.length-u.length;p===0&&u.length>0&&!u.startsWith("#")&&(o=$e(u),o==="catalogs"&&(c="")),o==="catalogs"&&p===2&&u.endsWith(":")&&(c=u.slice(0,-1).trim().replaceAll(ke,"")),i.push(lt(l,o,c,r))}A(n,i.join(`
4
4
  `))},pt=/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git|\/|$)/,Ht=async(t,e=1e4,n)=>{const s=[],a=new AbortController,r=setTimeout(()=>{a.abort()},e),o=async u=>{const p=`https://www.npmjs.com/package/${u.packageName}`;try{const f=n?pe(u.packageName,n):{url:"https://registry.npmjs.org"},w=f.url.replace(fe,""),y={Accept:"application/json"};f.token&&(y.Authorization=`Bearer ${f.token}`);const m=await fetch(`${w}/${u.packageName}/latest`,{headers:y,signal:a.signal});if(!m.ok)return{npmUrl:p,packageName:u.packageName};const $=(await m.json()).repository?.url;if(!$)return{npmUrl:p,packageName:u.packageName};const d=pt.exec($);if(!d)return{npmUrl:p,packageName:u.packageName,repoUrl:$};const v=d[1],T=d[2],k=`https://github.com/${v}/${T}/releases/tag/v${u.targetVersion}`;return{npmUrl:p,packageName:u.packageName,releaseUrl:k,repoUrl:`https://github.com/${v}/${T}`}}catch{return{npmUrl:p,packageName:u.packageName}}},c=Math.min(8,t.length);let i=0;const l=async()=>{for(;i<t.length;){const u=i;i+=1,s[u]=await o(t[u])}};try{await Promise.all(Array.from({length:c},()=>l()))}finally{clearTimeout(r)}return s},Yt=t=>JSON.stringify(t,void 0,2),qt=t=>t.map(e=>`${e.packageName} ${e.currentRange} → ${e.newRange}`).join(`
@@ -1 +1 @@
1
- import{a as r,x as o,d as i,r as n,i as s}from"../packem_shared/vis-user-error-Bdcaov20.js";import{e as t}from"../packem_shared/index-DGll9r9W.js";import{g as d}from"../packem_shared/package-version-DteJxz6k.js";const g=async()=>{const e=r("vis",{packageName:"vis",packageVersion:d()}),a=process.argv.includes("--debug")||!!process.env.DEBUG;e.addPlugin(o({concise:s,detailed:a,exitOnError:!1})),e.addGlobalOption({description:"Target JS runtime: node (default) or bun. Overrides VIS_RUNTIME; falls back to lockfile detection.",name:"runtime",type:String}),e.addCommand(t),e.addCommand(i),await n(e)};export{g as runExecCli};
1
+ import{a as r,x as o,d as i,r as n,i as s}from"../packem_shared/vis-user-error-6sSghaC9.js";import{e as t}from"../packem_shared/index-C_7lOmB0.js";import{g as d}from"../packem_shared/package-version-VdULnxr1.js";const g=async()=>{const e=r("vis",{packageName:"vis",packageVersion:d()}),a=process.argv.includes("--debug")||!!process.env.DEBUG;e.addPlugin(o({concise:s,detailed:a,exitOnError:!1})),e.addGlobalOption({description:"Target JS runtime: node (default) or bun. Overrides VIS_RUNTIME; falls back to lockfile detection.",name:"runtime",type:String}),e.addCommand(t),e.addCommand(i),await n(e)};export{g as runExecCli};
@@ -1,4 +1,4 @@
1
- import{createRequire as $b}from"node:module";import{b as Y,n as Jb,V as Pb,d as Zb,a as Nb,x as Ab,r as Mb,i as Hb}from"../packem_shared/vis-user-error-Bdcaov20.js";import{k as Sp,e as w,g as Hr,m as un,z as q,v as Xu,a as za,l as Ib,U as Yt}from"../packem_shared/index-0dnGN3GP.js";import{N as Cp,p as Be,g as Ra,r as Xb}from"../packem_shared/package-version-DteJxz6k.js";import{r as C,j as k,X,O as E,t as _b,w as Gb,c as Ac,n as qe,Q as Wb,S as Fb,Y as Mi,T as Qb,U as zb,V as Kb,H as Vb,W as qb,Z as Ub,_ as ew,$ as iw,a0 as nw,k as Lp,K as wn,d as tw,a1 as ow,i as Mc,h as aw,q as sw,u as rw,p as Ir,J as Hc,R as uw,a as lw,f as cw}from"../packem_shared/registry-48vkYPJB.js";import{parseStacktrace as dw}from"@visulima/error/stacktrace";import{i as fn}from"../packem_shared/index-BjdW45xX.js";import{y as x}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{U as Xe,h as zn,n as kn,m as Xc,ad as ww,D as Dp,a as _u,ae as Ep}from"../packem_shared/env-CGTN0BFz.js";import{findVisConfigFile as Kn,loadVisConfig as _c}from"./CONFIG_FILES.js";import{l as An,f as kw}from"./ts-loader.js";import{S as jw}from"../packem_shared/index-BisalDCf.js";import{s as Sw}from"../packem_shared/bin-N12LFeEP.js";import{X as As,j as xi,b as co,q as rn,F as wt,T as Lw,t as Ka,J as xw}from"../packem_shared/index.server-Ca_EEVfw.js";import{a as _r}from"../packem_shared/index--eV4qIz5.js";import{d as Gc}from"../packem_shared/pm-runner-BXRi4ZM9.js";import{getMainWorktreeRoot as Dw}from"@visulima/task-runner";import{e as Zw}from"../packem_shared/index-DGll9r9W.js";let Bb;const Ob=e=>(Bb??=$b(import.meta.url))(e),Vt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pi=e=>{if(typeof Vt<"u"&&Vt.versions&&Vt.versions.node){const[i,n]=Vt.versions.node.split(".").map(Number);if(i>22||i===22&&n>=3||i===20&&n>=16)return Vt.getBuiltinModule(e)}return Ob(e)},{createRequire:ji}=pi("node:module"),{spawnSync:_i,execSync:xp,execFileSync:gw,execFile:hw}=pi("node:child_process"),{writeFileSync:Ye,existsSync:Xr,renameSync:pw,readFileSync:Tp,readdirSync:Ue,statSync:Dt,rmSync:fw,copyFileSync:vw,unlinkSync:Pt,mkdirSync:yw,cpSync:mw,watch:bw}=pi("node:fs"),{dirname:Yp,delimiter:Ic,resolve:$a}=pi("node:path"),{createInterface:Cw}=pi("node:readline"),{homedir:Tw,platform:Yw}=pi("node:os"),{readdir:Rp,stat:$p,mkdir:Ew}=pi("node:fs/promises"),{isIP:Rw}=pi("node:net"),{createServer:$w,ServerResponse:Bw,STATUS_CODES:Ow}=pi("node:http"),{Http2ServerRequest:Gi,constants:Jw}=pi("node:http2"),{Readable:Wc}=pi("node:stream"),{fileURLToPath:Pw}=pi("node:url"),Nw=["pnpm-lock.yaml","package-lock.json","npm-shrinkwrap.json","yarn.lock","bun.lock","bun.lockb"];let Aw;const Mw=e=>(Aw??=ji(import.meta.url))(e),qt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Bp=e=>{if(typeof qt<"u"&&qt.versions&&qt.versions.node){const[i,n]=qt.versions.node.split(".").map(Number);if(i>22||i===22&&n>=3||i===20&&n>=16)return qt.getBuiltinModule(e)}return Mw(e)},{execFileSync:Hw}=Bp("node:child_process"),{existsSync:Fc,readFileSync:Iw}=Bp("node:fs"),Xw=[...Nw],Qc=new Set(["bun","npm","pnpm","yarn"]),Op=e=>{const i=Cp(Iw(e,"utf8"));return typeof i?.packageManager=="string"?i.packageManager:void 0},_w=e=>{let i;if(Xw.forEach(t=>{!i&&Fc(w(e,t))&&(i=w(e,t))}),i)return i;const n=w(e,"package.json");if(Fc(n)&&Op(n)!==void 0)return n},Gw=e=>{if(!e)throw new Hr("Could not find a package manager");if(e.endsWith("package.json")){const i=Op(e);if(i){const n=["npm","yarn","pnpm","bun"].find(t=>i.startsWith(t));if(n)return{packageManager:n,path:un(e)}}}if(e.endsWith("yarn.lock"))return{packageManager:"yarn",path:un(e)};if(e.endsWith("package-lock.json")||e.endsWith("npm-shrinkwrap.json"))return{packageManager:"npm",path:un(e)};if(e.endsWith("pnpm-lock.yaml"))return{packageManager:"pnpm",path:un(e)};if(e.endsWith("bun.lock")||e.endsWith("bun.lockb"))return{packageManager:"bun",path:un(e)};throw new Hr("Could not find a package manager")},Ww=e=>{const i=Sp(_w,{...e&&{cwd:e}});return Gw(i)},$q=e=>{if(!Qc.has(e))throw new Error(`Unsupported package manager "${e}". Expected one of: ${[...Qc].join(", ")}.`);return Hw(e,["--version"]).toString("utf8").trim()};let Fw;const Qw=e=>(Fw??=ji(import.meta.url))(e),Ut=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,zw=e=>{if(typeof Ut<"u"&&Ut.versions&&Ut.versions.node){const[i,n]=Ut.versions.node.split(".").map(Number);if(i>22||i===22&&n>=3||i===20&&n>=16)return Ut.getBuiltinModule(e)}return Qw(e)},{existsSync:zc,readFileSync:Kw}=zw("node:fs"),Vw=e=>{let i;try{i=Cp(e)}catch{return!1}if(!i||typeof i!="object"||Array.isArray(i))return!1;const{workspaces:n}=i;return typeof n=="object"&&n!==null},Jp=e=>{const i=Sp(["lerna.json","turbo.json"],{type:"file",...e&&{cwd:e}});if(i?.endsWith("lerna.json")){const t=Be(i);if(t&&typeof t=="object"&&!Array.isArray(t)){const o=t;if(o.useWorkspaces||o.packages)return{path:un(i),strategy:"lerna"}}}const n=i?.endsWith("turbo.json");try{const{packageManager:t,path:o}=Ww(e);if(["npm","yarn"].includes(t)){const a=w(o,"package.json");if(zc(a)){const s=Kw(w(o,"package.json"),"utf8");if(Vw(s))return{path:o,strategy:n?"turbo":t}}}else if(t==="pnpm"){const a=w(o,"pnpm-workspace.yaml");if(zc(a))return{path:o,strategy:n?"turbo":"pnpm"}}}catch(t){if(!(t instanceof Hr))throw t}throw new Error(`No monorepo root could be found upwards from the directory ${String(e??process.cwd())} using lerna, yarn, pnpm, or npm as indicators.`)},W=(e,i)=>async()=>({default:(await e())[i]});function Pp(e,i,n,t){let o,a,s;a=n,s=t;const r=jw(i,a,s??o);Xe(e,r,o)}const qw=["cache"],Kc=new Set(["--color","--debug","--no-color","--quiet","--verbose","-q","-v"]),Ms=new Set(["--help","-h"]),Zp=e=>{const i=e.findIndex(a=>!Kc.has(a)),n=e[i];if(n===void 0||!qw.includes(n))return;const t=e.slice(i+1);if(!t.every(a=>Ms.has(a)||Kc.has(a)))return;const o=e.filter(a=>a!==n&&!Ms.has(a));return{argv:["help",n,...o],exitCode:t.some(a=>Ms.has(a))?0:1}},Uw=new Set(["--cwd"]),ek=new Set(["--help","--version","-h","-V"]),ik=e=>{const i=[];for(let n=0;n<e.length;n+=1){const t=e[n];if(t!==void 0){if(ek.has(t))return!1;if(t.startsWith("-")){const o=t.indexOf("="),a=o===-1?t:t.slice(0,o);if(Uw.has(a)&&o===-1){const s=e[n+1];s!==void 0&&!s.startsWith("-")&&(n+=1)}continue}i.push(t)}}return i.length===1&&i[0]==="migrate"},nk=e=>{if(e.length===0)return!1;for(const i of e){const n=i.codePointAt(0)??0;return!(n<=127||n<=255)}return!1};let tk=class{buffer="";timer;onFlush;timeout;constructor({onFlush:i,timeout:n}){this.onFlush=i,this.timeout=n}add(i){this.buffer+=i,this.timer!==void 0&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.flush()},this.timeout)}flush(){if(this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0),this.buffer.length>0){const i=this.buffer;this.buffer="",this.onFlush(i)}}destroy(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0),this.buffer=""}};const Vc={disambiguateEscapeCodes:1,reportAllKeysAsEscapeCodes:8,reportAlternateKeys:4,reportAssociatedText:16,reportEventTypes:2};function qc(e){let i=0;for(const n of e)i|=Vc[n];return e.includes("reportAssociatedText")&&(i|=Vc.reportAllKeysAsEscapeCodes),i}const on={alt:2,capsLock:64,ctrl:4,hyper:16,meta:32,numLock:128,shift:1,super:8},ok="\x1B",Re="\x1B[",ak=";",Uc=`${Re}?1049h`,ed=`${Re}?1049l`,Np=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,sk=/^(?:msys|cygwin)$/,Ap=process,Gr=Ap?.env??{};!Np&&Gr.TERM_PROGRAM;const rk=!Np&&(Ap?.platform==="win32"||Gr.OSTYPE!==void 0&&sk.test(Gr.OSTYPE)),Mp=(e=1)=>`${Re}${String(e)}B`,cn=`${Re}?25l`,uk=`${Re}G`,lk=(e=1)=>`${Re}${String(e)}G`,ck=(e=1)=>`${Re}${String(e)}E`,Mn=`${Re}?25h`,Qi=(e,i)=>i===void 0?lk(e+1):`${Re}${String(i+1)}${ak}${String(e+1)}H`,No=(e=1)=>`${Re}${String(e)}A`;var dk=(e=>(e[e.Default=0]="Default",e[e.BlinkingBlock=1]="BlinkingBlock",e[e.SteadyBlock=2]="SteadyBlock",e[e.BlinkingUnderline=3]="BlinkingUnderline",e[e.SteadyUnderline=4]="SteadyUnderline",e[e.BlinkingBar=5]="BlinkingBar",e[e.SteadyBar=6]="SteadyBar",e))(dk||{});const gk=e=>`${Re}${String(e)} q`;var kt=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireScreen=2]="EntireScreen",e[e.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",e))(kt||{});const jt=e=>{const i=e>=0&&e<=3?e:0;return`${Re}${i===0?"":String(i)}J`};var Hp=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireLine=2]="EntireLine",e))(Hp||{});const Gu=e=>{const i=e>=0&&e<=2?e:0;return`${Re}${i===0?"":String(i)}K`},Ip=jt(0),hk=Gu(2),pk=Gu(0),Lo=e=>{if(e<=0)return"";let i="";for(let n=0;n<e;n+=1)i+=hk,n<e-1&&(i+=No());return i+=uk,i};Qi(0,0)+jt(kt.ToEnd);`${Gu(Hp.EntireLine)}${Re}`;const id=`${Re}H${jt(kt.EntireScreen)}`;rk?`${jt(kt.EntireScreen)}${Re}`:`${jt(kt.EntireScreen)}${jt(kt.EntireScreenAndScrollback)}${Re}${ok}`;let fk=class{code;isDecMode=!0;constructor(i){this.code=i}};const Xp=(e,...i)=>{if(i.length===0)return"";const n=e?"l":"h";if(i.length===1){const s=i[0];let r=Re;return s.isDecMode&&(r+="?"),r+String(s.code)+n}const t=i.filter(s=>!s.isDecMode).map(s=>s.code),o=i.filter(s=>s.isDecMode).map(s=>s.code);let a="";return t.length>0&&(a+=`${Re}${t.join(";")}${n}`),o.length>0&&(a+=`${Re}?${o.join(";")}${n}`),a};var vk=(e=>(e[e.NotRecognized=0]="NotRecognized",e[e.Set=1]="Set",e[e.Reset=2]="Reset",e[e.PermanentlySet=3]="PermanentlySet",e[e.PermanentlyReset=4]="PermanentlyReset",e))(vk||{});const _p=e=>new fk(e),Gp=(...e)=>Xp(!1,...e),Wp=(...e)=>Xp(!0,...e),Fp=_p(2004),yk={aliceblue:"f0f8ff",antiquewhite:"faebd7",antiquewhite1:"ffefdb",antiquewhite2:"eedfcc",antiquewhite3:"cdc0b0",antiquewhite4:"8b8378",aqua:"00ffff",aquamarine:"7fffd4",aquamarine1:"7fffd4",aquamarine2:"76eec6",aquamarine3:"66cdaa",aquamarine4:"458b74",azure:"f0ffff",azure1:"f0ffff",azure2:"e0eeee",azure3:"c1cdcd",azure4:"838b8b",beige:"f5f5dc",bisque:"ffe4c4",bisque1:"ffe4c4",bisque2:"eed5b7",bisque3:"cdb79e",bisque4:"8b7d6b",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blue1:"0000ff",blue2:"0000ee",blue3:"0000cd",blue4:"00008b",blueviolet:"8a2be2",brown:"a52a2a",brown1:"ff4040",brown2:"ee3b3b",brown3:"cd3333",brown4:"8b2323",burlywood:"deb887",burlywood1:"ffd39b",burlywood2:"eec591",burlywood3:"cdaa7d",burlywood4:"8b7355",cadetblue:"5f9ea0",cadetblue1:"98f5ff",cadetblue2:"8ee5ee",cadetblue3:"7ac5cd",cadetblue4:"53868b",chartreuse:"7fff00",chartreuse1:"7fff00",chartreuse2:"76ee00",chartreuse3:"66cd00",chartreuse4:"458b00",chocolate:"d2691e",chocolate1:"ff7f24",chocolate2:"ee7621",chocolate3:"cd661d",chocolate4:"8b4513",coral:"ff7f50",coral1:"ff7256",coral2:"ee6a50",coral3:"cd5b45",coral4:"8b3e2f",cornflowerblue:"6495ed",cornsilk:"fff8dc",cornsilk1:"fff8dc",cornsilk2:"eee8cd",cornsilk3:"cdc8b1",cornsilk4:"8b8878",crimson:"dc143c",cyan:"00ffff",cyan1:"00ffff",cyan2:"00eeee",cyan3:"00cdcd",cyan4:"008b8b",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgoldenrod1:"ffb90f",darkgoldenrod2:"eead0e",darkgoldenrod3:"cd950c",darkgoldenrod4:"8b6508",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkolivegreen1:"caff70",darkolivegreen2:"bcee68",darkolivegreen3:"a2cd5a",darkolivegreen4:"6e8b3d",darkorange:"ff8c00",darkorange1:"ff7f00",darkorange2:"ee7600",darkorange3:"cd6600",darkorange4:"8b4500",darkorchid:"9932cc",darkorchid1:"bf3eff",darkorchid2:"b23aee",darkorchid3:"9a32cd",darkorchid4:"68228b",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkseagreen1:"c1ffc1",darkseagreen2:"b4eeb4",darkseagreen3:"9bcd9b",darkseagreen4:"698b69",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategray1:"97ffff",darkslategray2:"8deeee",darkslategray3:"79cdcd",darkslategray4:"528b8b",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deeppink1:"ff1493",deeppink2:"ee1289",deeppink3:"cd1076",deeppink4:"8b0a50",deepskyblue:"00bfff",deepskyblue1:"00bfff",deepskyblue2:"00b2ee",deepskyblue3:"009acd",deepskyblue4:"00688b",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",dodgerblue1:"1e90ff",dodgerblue2:"1c86ee",dodgerblue3:"1874cd",dodgerblue4:"104e8b",firebrick:"b22222",firebrick1:"ff3030",firebrick2:"ee2c2c",firebrick3:"cd2626",firebrick4:"8b1a1a",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",gold1:"ffd700",gold2:"eec900",gold3:"cdad00",gold4:"8b7500",goldenrod:"daa520",goldenrod1:"ffc125",goldenrod2:"eeb422",goldenrod3:"cd9b1d",goldenrod4:"8b6914",gray:"bebebe",gray0:"000000",gray1:"030303",gray2:"050505",gray3:"080808",gray4:"0a0a0a",gray5:"0d0d0d",gray6:"0f0f0f",gray7:"121212",gray8:"141414",gray9:"171717",gray10:"1a1a1a",gray11:"1c1c1c",gray12:"1f1f1f",gray13:"212121",gray14:"242424",gray15:"262626",gray16:"292929",gray17:"2b2b2b",gray18:"2e2e2e",gray19:"303030",gray20:"333333",gray21:"363636",gray22:"383838",gray23:"3b3b3b",gray24:"3d3d3d",gray25:"404040",gray26:"424242",gray27:"454545",gray28:"474747",gray29:"4a4a4a",gray30:"4d4d4d",gray31:"4f4f4f",gray32:"525252",gray33:"545454",gray34:"575757",gray35:"595959",gray36:"5c5c5c",gray37:"5e5e5e",gray38:"616161",gray39:"636363",gray40:"666666",gray41:"696969",gray42:"6b6b6b",gray43:"6e6e6e",gray44:"707070",gray45:"737373",gray46:"757575",gray47:"787878",gray48:"7a7a7a",gray49:"7d7d7d",gray50:"7f7f7f",gray51:"828282",gray52:"858585",gray53:"878787",gray54:"8a8a8a",gray55:"8c8c8c",gray56:"8f8f8f",gray57:"919191",gray58:"949494",gray59:"969696",gray60:"999999",gray61:"9c9c9c",gray62:"9e9e9e",gray63:"a1a1a1",gray64:"a3a3a3",gray65:"a6a6a6",gray66:"a8a8a8",gray67:"ababab",gray68:"adadad",gray69:"b0b0b0",gray70:"b3b3b3",gray71:"b5b5b5",gray72:"b8b8b8",gray73:"bababa",gray74:"bdbdbd",gray75:"bfbfbf",gray76:"c2c2c2",gray77:"c4c4c4",gray78:"c7c7c7",gray79:"c9c9c9",gray80:"cccccc",gray81:"cfcfcf",gray82:"d1d1d1",gray83:"d4d4d4",gray84:"d6d6d6",gray85:"d9d9d9",gray86:"dbdbdb",gray87:"dedede",gray88:"e0e0e0",gray89:"e3e3e3",gray90:"e5e5e5",gray91:"e8e8e8",gray92:"ebebeb",gray93:"ededed",gray94:"f0f0f0",gray95:"f2f2f2",gray96:"f5f5f5",gray97:"f7f7f7",gray98:"fafafa",gray99:"fcfcfc",gray100:"ffffff",green:"00ff00",green1:"00ff00",green2:"00ee00",green3:"00cd00",green4:"008b00",greenyellow:"adff2f",grey:"bebebe",grey0:"000000",grey1:"030303",grey2:"050505",grey3:"080808",grey4:"0a0a0a",grey5:"0d0d0d",grey6:"0f0f0f",grey7:"121212",grey8:"141414",grey9:"171717",grey10:"1a1a1a",grey11:"1c1c1c",grey12:"1f1f1f",grey13:"212121",grey14:"242424",grey15:"262626",grey16:"292929",grey17:"2b2b2b",grey18:"2e2e2e",grey19:"303030",grey20:"333333",grey21:"363636",grey22:"383838",grey23:"3b3b3b",grey24:"3d3d3d",grey25:"404040",grey26:"424242",grey27:"454545",grey28:"474747",grey29:"4a4a4a",grey30:"4d4d4d",grey31:"4f4f4f",grey32:"525252",grey33:"545454",grey34:"575757",grey35:"595959",grey36:"5c5c5c",grey37:"5e5e5e",grey38:"616161",grey39:"636363",grey40:"666666",grey41:"696969",grey42:"6b6b6b",grey43:"6e6e6e",grey44:"707070",grey45:"737373",grey46:"757575",grey47:"787878",grey48:"7a7a7a",grey49:"7d7d7d",grey50:"7f7f7f",grey51:"828282",grey52:"858585",grey53:"878787",grey54:"8a8a8a",grey55:"8c8c8c",grey56:"8f8f8f",grey57:"919191",grey58:"949494",grey59:"969696",grey60:"999999",grey61:"9c9c9c",grey62:"9e9e9e",grey63:"a1a1a1",grey64:"a3a3a3",grey65:"a6a6a6",grey66:"a8a8a8",grey67:"ababab",grey68:"adadad",grey69:"b0b0b0",grey70:"b3b3b3",grey71:"b5b5b5",grey72:"b8b8b8",grey73:"bababa",grey74:"bdbdbd",grey75:"bfbfbf",grey76:"c2c2c2",grey77:"c4c4c4",grey78:"c7c7c7",grey79:"c9c9c9",grey80:"cccccc",grey81:"cfcfcf",grey82:"d1d1d1",grey83:"d4d4d4",grey84:"d6d6d6",grey85:"d9d9d9",grey86:"dbdbdb",grey87:"dedede",grey88:"e0e0e0",grey89:"e3e3e3",grey90:"e5e5e5",grey91:"e8e8e8",grey92:"ebebeb",grey93:"ededed",grey94:"f0f0f0",grey95:"f2f2f2",grey96:"f5f5f5",grey97:"f7f7f7",grey98:"fafafa",grey99:"fcfcfc",grey100:"ffffff",honeydew:"f0fff0",honeydew1:"f0fff0",honeydew2:"e0eee0",honeydew3:"c1cdc1",honeydew4:"838b83",hotpink:"ff69b4",hotpink1:"ff6eb4",hotpink2:"ee6aa7",hotpink3:"cd6090",hotpink4:"8b3a62",indianred:"cd5c5c",indianred1:"ff6a6a",indianred2:"ee6363",indianred3:"cd5555",indianred4:"8b3a3a",indigo:"4b0082",ivory:"fffff0",ivory1:"fffff0",ivory2:"eeeee0",ivory3:"cdcdc1",ivory4:"8b8b83",khaki:"f0e68c",khaki1:"fff68f",khaki2:"eee685",khaki3:"cdc673",khaki4:"8b864e",lavender:"e6e6fa",lavenderblush:"fff0f5",lavenderblush1:"fff0f5",lavenderblush2:"eee0e5",lavenderblush3:"cdc1c5",lavenderblush4:"8b8386",lawngreen:"7cfc00",lemonchiffon:"fffacd",lemonchiffon1:"fffacd",lemonchiffon2:"eee9bf",lemonchiffon3:"cdc9a5",lemonchiffon4:"8b8970",lightblue:"add8e6",lightblue1:"bfefff",lightblue2:"b2dfee",lightblue3:"9ac0cd",lightblue4:"68838b",lightcoral:"f08080",lightcyan:"e0ffff",lightcyan1:"e0ffff",lightcyan2:"d1eeee",lightcyan3:"b4cdcd",lightcyan4:"7a8b8b",lightgoldenrod:"eedd82",lightgoldenrod1:"ffec8b",lightgoldenrod2:"eedc82",lightgoldenrod3:"cdbe70",lightgoldenrod4:"8b814c",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightpink1:"ffaeb9",lightpink2:"eea2ad",lightpink3:"cd8c95",lightpink4:"8b5f65",lightsalmon:"ffa07a",lightsalmon1:"ffa07a",lightsalmon2:"ee9572",lightsalmon3:"cd8162",lightsalmon4:"8b5742",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightskyblue1:"b0e2ff",lightskyblue2:"a4d3ee",lightskyblue3:"8db6cd",lightskyblue4:"607b8b",lightslateblue:"8470ff",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightsteelblue1:"cae1ff",lightsteelblue2:"bcd2ee",lightsteelblue3:"a2b5cd",lightsteelblue4:"6e7b8b",lightyellow:"ffffe0",lightyellow1:"ffffe0",lightyellow2:"eeeed1",lightyellow3:"cdcdb4",lightyellow4:"8b8b7a",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",magenta1:"ff00ff",magenta2:"ee00ee",magenta3:"cd00cd",magenta4:"8b008b",maroon:"b03060",maroon1:"ff34b3",maroon2:"ee30a7",maroon3:"cd2990",maroon4:"8b1c62",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumorchid1:"e066ff",mediumorchid2:"d15fee",mediumorchid3:"b452cd",mediumorchid4:"7a378b",mediumpurple:"9370db",mediumpurple1:"ab82ff",mediumpurple2:"9f79ee",mediumpurple3:"8968cd",mediumpurple4:"5d478b",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",mistyrose1:"ffe4e1",mistyrose2:"eed5d2",mistyrose3:"cdb7b5",mistyrose4:"8b7d7b",moccasin:"ffe4b5",navajowhite:"ffdead",navajowhite1:"ffdead",navajowhite2:"eecfa1",navajowhite3:"cdb38b",navajowhite4:"8b795e",navy:"000080",navyblue:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",olivedrab1:"c0ff3e",olivedrab2:"b3ee3a",olivedrab3:"9acd32",olivedrab4:"698b22",orange:"ffa500",orange1:"ffa500",orange2:"ee9a00",orange3:"cd8500",orange4:"8b5a00",orangered:"ff4500",orangered1:"ff4500",orangered2:"ee4000",orangered3:"cd3700",orangered4:"8b2500",orchid:"da70d6",orchid1:"ff83fa",orchid2:"ee7ae9",orchid3:"cd69c9",orchid4:"8b4789",palegoldenrod:"eee8aa",palegreen:"98fb98",palegreen1:"9aff9a",palegreen2:"90ee90",palegreen3:"7ccd7c",palegreen4:"548b54",paleturquoise:"afeeee",paleturquoise1:"bbffff",paleturquoise2:"aeeeee",paleturquoise3:"96cdcd",paleturquoise4:"668b8b",palevioletred:"db7093",palevioletred1:"ff82ab",palevioletred2:"ee799f",palevioletred3:"cd6889",palevioletred4:"8b475d",papayawhip:"ffefd5",peachpuff:"ffdab9",peachpuff1:"ffdab9",peachpuff2:"eecbad",peachpuff3:"cdaf95",peachpuff4:"8b7765",peru:"cd853f",pink:"ffc0cb",pink1:"ffb5c5",pink2:"eea9b8",pink3:"cd919e",pink4:"8b636c",plum:"dda0dd",plum1:"ffbbff",plum2:"eeaeee",plum3:"cd96cd",plum4:"8b668b",powderblue:"b0e0e6",purple:"a020f0",purple1:"9b30ff",purple2:"912cee",purple3:"7d26cd",purple4:"551a8b",rebeccapurple:"663399",red:"ff0000",red1:"ff0000",red2:"ee0000",red3:"cd0000",red4:"8b0000",rosybrown:"bc8f8f",rosybrown1:"ffc1c1",rosybrown2:"eeb4b4",rosybrown3:"cd9b9b",rosybrown4:"8b6969",royalblue:"4169e1",royalblue1:"4876ff",royalblue2:"436eee",royalblue3:"3a5fcd",royalblue4:"27408b",saddlebrown:"8b4513",salmon:"fa8072",salmon1:"ff8c69",salmon2:"ee8262",salmon3:"cd7054",salmon4:"8b4c39",sandybrown:"f4a460",seagreen:"2e8b57",seagreen1:"54ff9f",seagreen2:"4eee94",seagreen3:"43cd80",seagreen4:"2e8b57",seashell:"fff5ee",seashell1:"fff5ee",seashell2:"eee5de",seashell3:"cdc5bf",seashell4:"8b8682",sienna:"a0522d",sienna1:"ff8247",sienna2:"ee7942",sienna3:"cd6839",sienna4:"8b4726",silver:"c0c0c0",skyblue:"87ceeb",skyblue1:"87ceff",skyblue2:"7ec0ee",skyblue3:"6ca6cd",skyblue4:"4a708b",slateblue:"6a5acd",slateblue1:"836fff",slateblue2:"7a67ee",slateblue3:"6959cd",slateblue4:"473c8b",slategray:"708090",slategray1:"c6e2ff",slategray2:"b9d3ee",slategray3:"9fb6cd",slategray4:"6c7b8b",slategrey:"708090",snow:"fffafa",snow1:"fffafa",snow2:"eee9e9",snow3:"cdc9c9",snow4:"8b8989",springgreen:"00ff7f",springgreen1:"00ff7f",springgreen2:"00ee76",springgreen3:"00cd66",springgreen4:"008b45",steelblue:"4682b4",steelblue1:"63b8ff",steelblue2:"5cacee",steelblue3:"4f94cd",steelblue4:"36648b",tan:"d2b48c",tan1:"ffa54f",tan2:"ee9a49",tan3:"cd853f",tan4:"8b5a2b",teal:"008080",thistle:"d8bfd8",thistle1:"ffe1ff",thistle2:"eed2ee",thistle3:"cdb5cd",thistle4:"8b7b8b",tomato:"ff6347",tomato1:"ff6347",tomato2:"ee5c42",tomato3:"cd4f39",tomato4:"8b3626",turquoise:"40e0d0",turquoise1:"00f5ff",turquoise2:"00e5ee",turquoise3:"00c5cd",turquoise4:"00868b",violet:"ee82ee",violetred:"d02090",violetred1:"ff3e96",violetred2:"ee3a8c",violetred3:"cd3278",violetred4:"8b2252",webgray:"808080",webgreen:"008000",webgrey:"808080",webmaroon:"800000",webpurple:"800080",wheat:"f5deb3",wheat1:"ffe7ba",wheat2:"eed8ae",wheat3:"cdba96",wheat4:"8b7e66",white:"ffffff",whitesmoke:"f5f5f5",x11gray:"bebebe",x11green:"00ff00",x11grey:"bebebe",x11maroon:"b03060",x11purple:"a020f0",yellow:"ffff00",yellow1:"ffff00",yellow2:"eeee00",yellow3:"cdcd00",yellow4:"8b8b00",yellowgreen:"9acd32"},mk=e=>{const i=yk[e.toLowerCase().replaceAll(" ","")];return i===void 0?void 0:`#${i}`},bk=/^rgba?:([\da-f]{1,4})\/([\da-f]{1,4})\/([\da-f]{1,4})(?:\/[\da-f]{1,4})?$/i,wk=/^#((?:[\da-f]{3}){1,4})$/i,ot=e=>{const i=16**e.length-1;return Math.round(Number.parseInt(e,16)/i*255)},kk=e=>{const i=e.trim(),n=bk.exec(i);if(n)return{b:ot(n[3]),g:ot(n[2]),r:ot(n[1])};const t=i.startsWith("#")?i:mk(i);if(t===void 0)return;const o=wk.exec(t);if(!o)return;const a=o[1],s=a.length/3;return{b:ot(a.slice(s*2)),g:ot(a.slice(s,s*2)),r:ot(a.slice(0,s))}},jk=(e=1)=>e===0?"":`${Re}${e<=1?"":String(e)}S`;let Sk;const Ck=e=>(Sk??=ji(import.meta.url))(e),eo=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Lk=e=>{if(typeof eo<"u"&&eo.versions&&eo.versions.node){const[i,n]=eo.versions.node.split(".").map(Number);if(i>22||i===22&&n>=3||i===20&&n>=16)return eo.getBuiltinModule(e)}return Ck(e)},{Buffer:xk}=Lk("node:buffer"),Tk=/^\u001B([a-z0-9])$/i,Yk=/^\u001B+([ON[]|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,Qp={"[1~":"home","[2$":"insert","[2^":"insert","[2~":"insert","[3$":"delete","[3^":"delete","[3~":"delete","[4~":"end","[5$":"pageup","[5^":"pageup","[5~":"pageup","[6$":"pagedown","[6^":"pagedown","[6~":"pagedown","[7$":"home","[7^":"home","[7~":"home","[8$":"end","[8^":"end","[8~":"end","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[[5~":"pageup","[[6~":"pagedown","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[A":"up","[a":"up","[B":"down","[b":"down","[C":"right","[c":"right","[D":"left","[d":"left","[E":"clear","[e":"clear","[F":"end","[H":"home","[P":"f1","[Q":"f2","[R":"f3","[S":"f4","[Z":"tab",OA:"up",Oa:"up",OB:"down",Ob:"down",OC:"right",Oc:"right",OD:"left",Od:"left",OE:"clear",Oe:"clear",OF:"end",OH:"home",OP:"f1",OQ:"f2",OR:"f3",OS:"f4"},Dk=[...Object.values(Qp),"backspace"],Ek=e=>["[2$","[3$","[5$","[6$","[7$","[8$","[a","[b","[c","[d","[e","[Z"].includes(e),Rk=e=>["[2^","[3^","[5^","[6^","[7^","[8^","Oa","Ob","Oc","Od","Oe"].includes(e),zp=/^\u001B\[(\d+)(?::[\d:]*)?(?:;(\d*)(?::(\d+))?(?:;([\d:]+))?)?u$/,$k=/^\u001B\[(\d+)(?:;(\d+)(?::(\d+))?)?([A-Z~])$/i,Bk={A:"up",B:"down",C:"right",D:"left",E:"clear",F:"end",H:"home",P:"f1",Q:"f2",S:"f4"},Ok={2:"insert",3:"delete",5:"pageup",6:"pagedown",7:"home",8:"end",11:"f1",12:"f2",13:"f3",14:"f4",15:"f5",17:"f6",18:"f7",19:"f8",20:"f9",21:"f10",23:"f11",24:"f12",57427:"clear"},nd={9:"tab",27:"escape",127:"backspace",57358:"capslock",57359:"scrolllock",57360:"numlock",57361:"printscreen",57362:"pause",57363:"menu",57376:"f13",57377:"f14",57378:"f15",57379:"f16",57380:"f17",57381:"f18",57382:"f19",57383:"f20",57384:"f21",57385:"f22",57386:"f23",57387:"f24",57388:"f25",57389:"f26",57390:"f27",57391:"f28",57392:"f29",57393:"f30",57394:"f31",57395:"f32",57396:"f33",57397:"f34",57398:"f35",57399:"kp0",57400:"kp1",57401:"kp2",57402:"kp3",57403:"kp4",57404:"kp5",57405:"kp6",57406:"kp7",57407:"kp8",57408:"kp9",57409:"kpdecimal",57410:"kpdivide",57411:"kpmultiply",57412:"kpsubtract",57413:"kpadd",57414:"kpenter",57415:"kpequal",57416:"kpseparator",57417:"left",57418:"right",57419:"up",57420:"down",57421:"pageup",57422:"pagedown",57423:"home",57424:"end",57425:"insert",57426:"delete",57427:"kpbegin",57428:"mediaplay",57429:"mediapause",57430:"mediaplaypause",57431:"mediareverse",57432:"mediastop",57433:"mediafastforward",57434:"mediarewind",57435:"mediatracknext",57436:"mediatrackprevious",57437:"mediarecord",57438:"lowervolume",57439:"raisevolume",57440:"mutevolume",57441:"leftshift",57442:"leftcontrol",57443:"leftalt",57444:"leftsuper",57445:"lefthyper",57446:"leftmeta",57447:"rightshift",57448:"rightcontrol",57449:"rightalt",57450:"rightsuper",57451:"righthyper",57452:"rightmeta",57453:"isoLevel3Shift",57454:"isoLevel5Shift"},Kp=e=>e>=0&&e<=1114111&&!(e>=55296&&e<=57343),Hs=e=>Kp(e)?String.fromCodePoint(e):"?";function Vp(e){return e===3?"release":e===2?"repeat":"press"}function qp(e){return{capsLock:!!(e&on.capsLock),ctrl:!!(e&on.ctrl),hyper:!!(e&on.hyper),meta:!!(e&on.meta),numLock:!!(e&on.numLock),option:!!(e&on.alt),shift:!!(e&on.shift),super:!!(e&on.super)}}const Jk=e=>{const i=zp.exec(e);if(!i)return null;let n=Number.parseInt(i[1],10);n===57414&&(n=13);const t=i[2]?Math.max(0,Number.parseInt(i[2],10)-1):0,o=i[3]?Number.parseInt(i[3],10):1,a=i[4];if(!Kp(n))return null;let s;a&&(s=a.split(":").map(l=>Hs(Number.parseInt(l,10))).join(""));let r,u;return n===32?(r="space",u=!0):n===13?(r="return",u=!0):nd[n]?(r=nd[n],u=!1):n<32||n>=127&&n<=159||n>=57344&&n<=63743?(r="",u=!1):(r=Hs(n).toLowerCase(),u=!0),u&&!s&&(s=Hs(n)),{name:r,...qp(t),eventType:Vp(o),isKittyProtocol:!0,isPrintable:u||s!==void 0,raw:e,sequence:e,text:s}},Pk=e=>{const i=$k.exec(e);if(!i)return null;const n=Number.parseInt(i[1],10),t=i[2]?Math.max(0,Number.parseInt(i[2],10)-1):0,o=i[3]?Number.parseInt(i[3],10):1,a=i[4];if(a!=="~"&&n!==1)return null;const s=a==="~"?Ok[n]:Bk[a];return s?{name:s,...qp(t),eventType:Vp(o),isKittyProtocol:!0,isPrintable:!1,raw:e,sequence:e}:null},Ba=(e="")=>{let i;xk.isBuffer(e)?e=e[0]>127&&e[1]===void 0?`\x1B${String.fromCharCode(e[0]-128)}`:String(e):e!==void 0&&typeof e!="string"?e=String(e):e||(e="");const n=Jk(e);if(n)return n;const t=Pk(e);if(t)return t;if(zp.test(e))return{ctrl:!1,isKittyProtocol:!0,isPrintable:!1,meta:!1,name:"",option:!1,raw:e,sequence:e,shift:!1};const o={ctrl:!1,meta:!1,name:"",option:!1,raw:e,sequence:e,shift:!1};switch(o.sequence=o.sequence||e||o.name,e){case"\r":case"\x1B\r":{o.raw=void 0,o.name="return",o.option=e.length===2;break}case`
1
+ import{createRequire as $b}from"node:module";import{b as Y,n as Jb,V as Pb,d as Zb,a as Nb,x as Ab,r as Mb,i as Hb}from"../packem_shared/vis-user-error-6sSghaC9.js";import{k as Sp,e as w,g as Hr,m as un,z as q,v as Xu,a as za,l as Ib,U as Yt}from"../packem_shared/index-0dnGN3GP.js";import{N as Cp,p as Be,g as Ra,r as Xb}from"../packem_shared/package-version-VdULnxr1.js";import{r as C,j as k,X,O as E,t as _b,w as Gb,c as Ac,n as qe,Q as Wb,S as Fb,Y as Mi,T as Qb,U as zb,V as Kb,H as Vb,W as qb,Z as Ub,_ as ew,$ as iw,a0 as nw,k as Lp,K as wn,d as tw,a1 as ow,i as Mc,h as aw,q as sw,u as rw,p as Ir,J as Hc,R as uw,a as lw,f as cw}from"../packem_shared/registry-TXpTtpgS.js";import{parseStacktrace as dw}from"@visulima/error/stacktrace";import{i as fn}from"../packem_shared/index-BjdW45xX.js";import{y as x}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{U as Xe,h as zn,n as kn,m as Xc,ad as ww,D as Dp,a as _u,ae as Ep}from"../packem_shared/env-sb3SOT-b.js";import{findVisConfigFile as Kn,loadVisConfig as _c}from"./CONFIG_FILES.js";import{l as An,f as kw}from"./ts-loader.js";import{S as jw}from"../packem_shared/index-BisalDCf.js";import{s as Sw}from"../packem_shared/bin-D1zq7wxi.js";import{X as As,j as xi,b as co,q as rn,F as wt,T as Lw,t as Ka,J as xw}from"../packem_shared/index.server-Ca_EEVfw.js";import{a as _r}from"../packem_shared/index--eV4qIz5.js";import{d as Gc}from"../packem_shared/pm-runner-BXRi4ZM9.js";import{getMainWorktreeRoot as Dw}from"@visulima/task-runner";import{e as Zw}from"../packem_shared/index-C_7lOmB0.js";let Bb;const Ob=e=>(Bb??=$b(import.meta.url))(e),Vt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pi=e=>{if(typeof Vt<"u"&&Vt.versions&&Vt.versions.node){const[i,n]=Vt.versions.node.split(".").map(Number);if(i>22||i===22&&n>=3||i===20&&n>=16)return Vt.getBuiltinModule(e)}return Ob(e)},{createRequire:ji}=pi("node:module"),{spawnSync:_i,execSync:xp,execFileSync:gw,execFile:hw}=pi("node:child_process"),{writeFileSync:Ye,existsSync:Xr,renameSync:pw,readFileSync:Tp,readdirSync:Ue,statSync:Dt,rmSync:fw,copyFileSync:vw,unlinkSync:Pt,mkdirSync:yw,cpSync:mw,watch:bw}=pi("node:fs"),{dirname:Yp,delimiter:Ic,resolve:$a}=pi("node:path"),{createInterface:Cw}=pi("node:readline"),{homedir:Tw,platform:Yw}=pi("node:os"),{readdir:Rp,stat:$p,mkdir:Ew}=pi("node:fs/promises"),{isIP:Rw}=pi("node:net"),{createServer:$w,ServerResponse:Bw,STATUS_CODES:Ow}=pi("node:http"),{Http2ServerRequest:Gi,constants:Jw}=pi("node:http2"),{Readable:Wc}=pi("node:stream"),{fileURLToPath:Pw}=pi("node:url"),Nw=["pnpm-lock.yaml","package-lock.json","npm-shrinkwrap.json","yarn.lock","bun.lock","bun.lockb"];let Aw;const Mw=e=>(Aw??=ji(import.meta.url))(e),qt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Bp=e=>{if(typeof qt<"u"&&qt.versions&&qt.versions.node){const[i,n]=qt.versions.node.split(".").map(Number);if(i>22||i===22&&n>=3||i===20&&n>=16)return qt.getBuiltinModule(e)}return Mw(e)},{execFileSync:Hw}=Bp("node:child_process"),{existsSync:Fc,readFileSync:Iw}=Bp("node:fs"),Xw=[...Nw],Qc=new Set(["bun","npm","pnpm","yarn"]),Op=e=>{const i=Cp(Iw(e,"utf8"));return typeof i?.packageManager=="string"?i.packageManager:void 0},_w=e=>{let i;if(Xw.forEach(t=>{!i&&Fc(w(e,t))&&(i=w(e,t))}),i)return i;const n=w(e,"package.json");if(Fc(n)&&Op(n)!==void 0)return n},Gw=e=>{if(!e)throw new Hr("Could not find a package manager");if(e.endsWith("package.json")){const i=Op(e);if(i){const n=["npm","yarn","pnpm","bun"].find(t=>i.startsWith(t));if(n)return{packageManager:n,path:un(e)}}}if(e.endsWith("yarn.lock"))return{packageManager:"yarn",path:un(e)};if(e.endsWith("package-lock.json")||e.endsWith("npm-shrinkwrap.json"))return{packageManager:"npm",path:un(e)};if(e.endsWith("pnpm-lock.yaml"))return{packageManager:"pnpm",path:un(e)};if(e.endsWith("bun.lock")||e.endsWith("bun.lockb"))return{packageManager:"bun",path:un(e)};throw new Hr("Could not find a package manager")},Ww=e=>{const i=Sp(_w,{...e&&{cwd:e}});return Gw(i)},$q=e=>{if(!Qc.has(e))throw new Error(`Unsupported package manager "${e}". Expected one of: ${[...Qc].join(", ")}.`);return Hw(e,["--version"]).toString("utf8").trim()};let Fw;const Qw=e=>(Fw??=ji(import.meta.url))(e),Ut=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,zw=e=>{if(typeof Ut<"u"&&Ut.versions&&Ut.versions.node){const[i,n]=Ut.versions.node.split(".").map(Number);if(i>22||i===22&&n>=3||i===20&&n>=16)return Ut.getBuiltinModule(e)}return Qw(e)},{existsSync:zc,readFileSync:Kw}=zw("node:fs"),Vw=e=>{let i;try{i=Cp(e)}catch{return!1}if(!i||typeof i!="object"||Array.isArray(i))return!1;const{workspaces:n}=i;return typeof n=="object"&&n!==null},Jp=e=>{const i=Sp(["lerna.json","turbo.json"],{type:"file",...e&&{cwd:e}});if(i?.endsWith("lerna.json")){const t=Be(i);if(t&&typeof t=="object"&&!Array.isArray(t)){const o=t;if(o.useWorkspaces||o.packages)return{path:un(i),strategy:"lerna"}}}const n=i?.endsWith("turbo.json");try{const{packageManager:t,path:o}=Ww(e);if(["npm","yarn"].includes(t)){const a=w(o,"package.json");if(zc(a)){const s=Kw(w(o,"package.json"),"utf8");if(Vw(s))return{path:o,strategy:n?"turbo":t}}}else if(t==="pnpm"){const a=w(o,"pnpm-workspace.yaml");if(zc(a))return{path:o,strategy:n?"turbo":"pnpm"}}}catch(t){if(!(t instanceof Hr))throw t}throw new Error(`No monorepo root could be found upwards from the directory ${String(e??process.cwd())} using lerna, yarn, pnpm, or npm as indicators.`)},W=(e,i)=>async()=>({default:(await e())[i]});function Pp(e,i,n,t){let o,a,s;a=n,s=t;const r=jw(i,a,s??o);Xe(e,r,o)}const qw=["cache"],Kc=new Set(["--color","--debug","--no-color","--quiet","--verbose","-q","-v"]),Ms=new Set(["--help","-h"]),Zp=e=>{const i=e.findIndex(a=>!Kc.has(a)),n=e[i];if(n===void 0||!qw.includes(n))return;const t=e.slice(i+1);if(!t.every(a=>Ms.has(a)||Kc.has(a)))return;const o=e.filter(a=>a!==n&&!Ms.has(a));return{argv:["help",n,...o],exitCode:t.some(a=>Ms.has(a))?0:1}},Uw=new Set(["--cwd"]),ek=new Set(["--help","--version","-h","-V"]),ik=e=>{const i=[];for(let n=0;n<e.length;n+=1){const t=e[n];if(t!==void 0){if(ek.has(t))return!1;if(t.startsWith("-")){const o=t.indexOf("="),a=o===-1?t:t.slice(0,o);if(Uw.has(a)&&o===-1){const s=e[n+1];s!==void 0&&!s.startsWith("-")&&(n+=1)}continue}i.push(t)}}return i.length===1&&i[0]==="migrate"},nk=e=>{if(e.length===0)return!1;for(const i of e){const n=i.codePointAt(0)??0;return!(n<=127||n<=255)}return!1};let tk=class{buffer="";timer;onFlush;timeout;constructor({onFlush:i,timeout:n}){this.onFlush=i,this.timeout=n}add(i){this.buffer+=i,this.timer!==void 0&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.flush()},this.timeout)}flush(){if(this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0),this.buffer.length>0){const i=this.buffer;this.buffer="",this.onFlush(i)}}destroy(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0),this.buffer=""}};const Vc={disambiguateEscapeCodes:1,reportAllKeysAsEscapeCodes:8,reportAlternateKeys:4,reportAssociatedText:16,reportEventTypes:2};function qc(e){let i=0;for(const n of e)i|=Vc[n];return e.includes("reportAssociatedText")&&(i|=Vc.reportAllKeysAsEscapeCodes),i}const on={alt:2,capsLock:64,ctrl:4,hyper:16,meta:32,numLock:128,shift:1,super:8},ok="\x1B",Re="\x1B[",ak=";",Uc=`${Re}?1049h`,ed=`${Re}?1049l`,Np=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,sk=/^(?:msys|cygwin)$/,Ap=process,Gr=Ap?.env??{};!Np&&Gr.TERM_PROGRAM;const rk=!Np&&(Ap?.platform==="win32"||Gr.OSTYPE!==void 0&&sk.test(Gr.OSTYPE)),Mp=(e=1)=>`${Re}${String(e)}B`,cn=`${Re}?25l`,uk=`${Re}G`,lk=(e=1)=>`${Re}${String(e)}G`,ck=(e=1)=>`${Re}${String(e)}E`,Mn=`${Re}?25h`,Qi=(e,i)=>i===void 0?lk(e+1):`${Re}${String(i+1)}${ak}${String(e+1)}H`,No=(e=1)=>`${Re}${String(e)}A`;var dk=(e=>(e[e.Default=0]="Default",e[e.BlinkingBlock=1]="BlinkingBlock",e[e.SteadyBlock=2]="SteadyBlock",e[e.BlinkingUnderline=3]="BlinkingUnderline",e[e.SteadyUnderline=4]="SteadyUnderline",e[e.BlinkingBar=5]="BlinkingBar",e[e.SteadyBar=6]="SteadyBar",e))(dk||{});const gk=e=>`${Re}${String(e)} q`;var kt=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireScreen=2]="EntireScreen",e[e.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",e))(kt||{});const jt=e=>{const i=e>=0&&e<=3?e:0;return`${Re}${i===0?"":String(i)}J`};var Hp=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireLine=2]="EntireLine",e))(Hp||{});const Gu=e=>{const i=e>=0&&e<=2?e:0;return`${Re}${i===0?"":String(i)}K`},Ip=jt(0),hk=Gu(2),pk=Gu(0),Lo=e=>{if(e<=0)return"";let i="";for(let n=0;n<e;n+=1)i+=hk,n<e-1&&(i+=No());return i+=uk,i};Qi(0,0)+jt(kt.ToEnd);`${Gu(Hp.EntireLine)}${Re}`;const id=`${Re}H${jt(kt.EntireScreen)}`;rk?`${jt(kt.EntireScreen)}${Re}`:`${jt(kt.EntireScreen)}${jt(kt.EntireScreenAndScrollback)}${Re}${ok}`;let fk=class{code;isDecMode=!0;constructor(i){this.code=i}};const Xp=(e,...i)=>{if(i.length===0)return"";const n=e?"l":"h";if(i.length===1){const s=i[0];let r=Re;return s.isDecMode&&(r+="?"),r+String(s.code)+n}const t=i.filter(s=>!s.isDecMode).map(s=>s.code),o=i.filter(s=>s.isDecMode).map(s=>s.code);let a="";return t.length>0&&(a+=`${Re}${t.join(";")}${n}`),o.length>0&&(a+=`${Re}?${o.join(";")}${n}`),a};var vk=(e=>(e[e.NotRecognized=0]="NotRecognized",e[e.Set=1]="Set",e[e.Reset=2]="Reset",e[e.PermanentlySet=3]="PermanentlySet",e[e.PermanentlyReset=4]="PermanentlyReset",e))(vk||{});const _p=e=>new fk(e),Gp=(...e)=>Xp(!1,...e),Wp=(...e)=>Xp(!0,...e),Fp=_p(2004),yk={aliceblue:"f0f8ff",antiquewhite:"faebd7",antiquewhite1:"ffefdb",antiquewhite2:"eedfcc",antiquewhite3:"cdc0b0",antiquewhite4:"8b8378",aqua:"00ffff",aquamarine:"7fffd4",aquamarine1:"7fffd4",aquamarine2:"76eec6",aquamarine3:"66cdaa",aquamarine4:"458b74",azure:"f0ffff",azure1:"f0ffff",azure2:"e0eeee",azure3:"c1cdcd",azure4:"838b8b",beige:"f5f5dc",bisque:"ffe4c4",bisque1:"ffe4c4",bisque2:"eed5b7",bisque3:"cdb79e",bisque4:"8b7d6b",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blue1:"0000ff",blue2:"0000ee",blue3:"0000cd",blue4:"00008b",blueviolet:"8a2be2",brown:"a52a2a",brown1:"ff4040",brown2:"ee3b3b",brown3:"cd3333",brown4:"8b2323",burlywood:"deb887",burlywood1:"ffd39b",burlywood2:"eec591",burlywood3:"cdaa7d",burlywood4:"8b7355",cadetblue:"5f9ea0",cadetblue1:"98f5ff",cadetblue2:"8ee5ee",cadetblue3:"7ac5cd",cadetblue4:"53868b",chartreuse:"7fff00",chartreuse1:"7fff00",chartreuse2:"76ee00",chartreuse3:"66cd00",chartreuse4:"458b00",chocolate:"d2691e",chocolate1:"ff7f24",chocolate2:"ee7621",chocolate3:"cd661d",chocolate4:"8b4513",coral:"ff7f50",coral1:"ff7256",coral2:"ee6a50",coral3:"cd5b45",coral4:"8b3e2f",cornflowerblue:"6495ed",cornsilk:"fff8dc",cornsilk1:"fff8dc",cornsilk2:"eee8cd",cornsilk3:"cdc8b1",cornsilk4:"8b8878",crimson:"dc143c",cyan:"00ffff",cyan1:"00ffff",cyan2:"00eeee",cyan3:"00cdcd",cyan4:"008b8b",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgoldenrod1:"ffb90f",darkgoldenrod2:"eead0e",darkgoldenrod3:"cd950c",darkgoldenrod4:"8b6508",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkolivegreen1:"caff70",darkolivegreen2:"bcee68",darkolivegreen3:"a2cd5a",darkolivegreen4:"6e8b3d",darkorange:"ff8c00",darkorange1:"ff7f00",darkorange2:"ee7600",darkorange3:"cd6600",darkorange4:"8b4500",darkorchid:"9932cc",darkorchid1:"bf3eff",darkorchid2:"b23aee",darkorchid3:"9a32cd",darkorchid4:"68228b",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkseagreen1:"c1ffc1",darkseagreen2:"b4eeb4",darkseagreen3:"9bcd9b",darkseagreen4:"698b69",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategray1:"97ffff",darkslategray2:"8deeee",darkslategray3:"79cdcd",darkslategray4:"528b8b",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deeppink1:"ff1493",deeppink2:"ee1289",deeppink3:"cd1076",deeppink4:"8b0a50",deepskyblue:"00bfff",deepskyblue1:"00bfff",deepskyblue2:"00b2ee",deepskyblue3:"009acd",deepskyblue4:"00688b",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",dodgerblue1:"1e90ff",dodgerblue2:"1c86ee",dodgerblue3:"1874cd",dodgerblue4:"104e8b",firebrick:"b22222",firebrick1:"ff3030",firebrick2:"ee2c2c",firebrick3:"cd2626",firebrick4:"8b1a1a",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",gold1:"ffd700",gold2:"eec900",gold3:"cdad00",gold4:"8b7500",goldenrod:"daa520",goldenrod1:"ffc125",goldenrod2:"eeb422",goldenrod3:"cd9b1d",goldenrod4:"8b6914",gray:"bebebe",gray0:"000000",gray1:"030303",gray2:"050505",gray3:"080808",gray4:"0a0a0a",gray5:"0d0d0d",gray6:"0f0f0f",gray7:"121212",gray8:"141414",gray9:"171717",gray10:"1a1a1a",gray11:"1c1c1c",gray12:"1f1f1f",gray13:"212121",gray14:"242424",gray15:"262626",gray16:"292929",gray17:"2b2b2b",gray18:"2e2e2e",gray19:"303030",gray20:"333333",gray21:"363636",gray22:"383838",gray23:"3b3b3b",gray24:"3d3d3d",gray25:"404040",gray26:"424242",gray27:"454545",gray28:"474747",gray29:"4a4a4a",gray30:"4d4d4d",gray31:"4f4f4f",gray32:"525252",gray33:"545454",gray34:"575757",gray35:"595959",gray36:"5c5c5c",gray37:"5e5e5e",gray38:"616161",gray39:"636363",gray40:"666666",gray41:"696969",gray42:"6b6b6b",gray43:"6e6e6e",gray44:"707070",gray45:"737373",gray46:"757575",gray47:"787878",gray48:"7a7a7a",gray49:"7d7d7d",gray50:"7f7f7f",gray51:"828282",gray52:"858585",gray53:"878787",gray54:"8a8a8a",gray55:"8c8c8c",gray56:"8f8f8f",gray57:"919191",gray58:"949494",gray59:"969696",gray60:"999999",gray61:"9c9c9c",gray62:"9e9e9e",gray63:"a1a1a1",gray64:"a3a3a3",gray65:"a6a6a6",gray66:"a8a8a8",gray67:"ababab",gray68:"adadad",gray69:"b0b0b0",gray70:"b3b3b3",gray71:"b5b5b5",gray72:"b8b8b8",gray73:"bababa",gray74:"bdbdbd",gray75:"bfbfbf",gray76:"c2c2c2",gray77:"c4c4c4",gray78:"c7c7c7",gray79:"c9c9c9",gray80:"cccccc",gray81:"cfcfcf",gray82:"d1d1d1",gray83:"d4d4d4",gray84:"d6d6d6",gray85:"d9d9d9",gray86:"dbdbdb",gray87:"dedede",gray88:"e0e0e0",gray89:"e3e3e3",gray90:"e5e5e5",gray91:"e8e8e8",gray92:"ebebeb",gray93:"ededed",gray94:"f0f0f0",gray95:"f2f2f2",gray96:"f5f5f5",gray97:"f7f7f7",gray98:"fafafa",gray99:"fcfcfc",gray100:"ffffff",green:"00ff00",green1:"00ff00",green2:"00ee00",green3:"00cd00",green4:"008b00",greenyellow:"adff2f",grey:"bebebe",grey0:"000000",grey1:"030303",grey2:"050505",grey3:"080808",grey4:"0a0a0a",grey5:"0d0d0d",grey6:"0f0f0f",grey7:"121212",grey8:"141414",grey9:"171717",grey10:"1a1a1a",grey11:"1c1c1c",grey12:"1f1f1f",grey13:"212121",grey14:"242424",grey15:"262626",grey16:"292929",grey17:"2b2b2b",grey18:"2e2e2e",grey19:"303030",grey20:"333333",grey21:"363636",grey22:"383838",grey23:"3b3b3b",grey24:"3d3d3d",grey25:"404040",grey26:"424242",grey27:"454545",grey28:"474747",grey29:"4a4a4a",grey30:"4d4d4d",grey31:"4f4f4f",grey32:"525252",grey33:"545454",grey34:"575757",grey35:"595959",grey36:"5c5c5c",grey37:"5e5e5e",grey38:"616161",grey39:"636363",grey40:"666666",grey41:"696969",grey42:"6b6b6b",grey43:"6e6e6e",grey44:"707070",grey45:"737373",grey46:"757575",grey47:"787878",grey48:"7a7a7a",grey49:"7d7d7d",grey50:"7f7f7f",grey51:"828282",grey52:"858585",grey53:"878787",grey54:"8a8a8a",grey55:"8c8c8c",grey56:"8f8f8f",grey57:"919191",grey58:"949494",grey59:"969696",grey60:"999999",grey61:"9c9c9c",grey62:"9e9e9e",grey63:"a1a1a1",grey64:"a3a3a3",grey65:"a6a6a6",grey66:"a8a8a8",grey67:"ababab",grey68:"adadad",grey69:"b0b0b0",grey70:"b3b3b3",grey71:"b5b5b5",grey72:"b8b8b8",grey73:"bababa",grey74:"bdbdbd",grey75:"bfbfbf",grey76:"c2c2c2",grey77:"c4c4c4",grey78:"c7c7c7",grey79:"c9c9c9",grey80:"cccccc",grey81:"cfcfcf",grey82:"d1d1d1",grey83:"d4d4d4",grey84:"d6d6d6",grey85:"d9d9d9",grey86:"dbdbdb",grey87:"dedede",grey88:"e0e0e0",grey89:"e3e3e3",grey90:"e5e5e5",grey91:"e8e8e8",grey92:"ebebeb",grey93:"ededed",grey94:"f0f0f0",grey95:"f2f2f2",grey96:"f5f5f5",grey97:"f7f7f7",grey98:"fafafa",grey99:"fcfcfc",grey100:"ffffff",honeydew:"f0fff0",honeydew1:"f0fff0",honeydew2:"e0eee0",honeydew3:"c1cdc1",honeydew4:"838b83",hotpink:"ff69b4",hotpink1:"ff6eb4",hotpink2:"ee6aa7",hotpink3:"cd6090",hotpink4:"8b3a62",indianred:"cd5c5c",indianred1:"ff6a6a",indianred2:"ee6363",indianred3:"cd5555",indianred4:"8b3a3a",indigo:"4b0082",ivory:"fffff0",ivory1:"fffff0",ivory2:"eeeee0",ivory3:"cdcdc1",ivory4:"8b8b83",khaki:"f0e68c",khaki1:"fff68f",khaki2:"eee685",khaki3:"cdc673",khaki4:"8b864e",lavender:"e6e6fa",lavenderblush:"fff0f5",lavenderblush1:"fff0f5",lavenderblush2:"eee0e5",lavenderblush3:"cdc1c5",lavenderblush4:"8b8386",lawngreen:"7cfc00",lemonchiffon:"fffacd",lemonchiffon1:"fffacd",lemonchiffon2:"eee9bf",lemonchiffon3:"cdc9a5",lemonchiffon4:"8b8970",lightblue:"add8e6",lightblue1:"bfefff",lightblue2:"b2dfee",lightblue3:"9ac0cd",lightblue4:"68838b",lightcoral:"f08080",lightcyan:"e0ffff",lightcyan1:"e0ffff",lightcyan2:"d1eeee",lightcyan3:"b4cdcd",lightcyan4:"7a8b8b",lightgoldenrod:"eedd82",lightgoldenrod1:"ffec8b",lightgoldenrod2:"eedc82",lightgoldenrod3:"cdbe70",lightgoldenrod4:"8b814c",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightpink1:"ffaeb9",lightpink2:"eea2ad",lightpink3:"cd8c95",lightpink4:"8b5f65",lightsalmon:"ffa07a",lightsalmon1:"ffa07a",lightsalmon2:"ee9572",lightsalmon3:"cd8162",lightsalmon4:"8b5742",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightskyblue1:"b0e2ff",lightskyblue2:"a4d3ee",lightskyblue3:"8db6cd",lightskyblue4:"607b8b",lightslateblue:"8470ff",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightsteelblue1:"cae1ff",lightsteelblue2:"bcd2ee",lightsteelblue3:"a2b5cd",lightsteelblue4:"6e7b8b",lightyellow:"ffffe0",lightyellow1:"ffffe0",lightyellow2:"eeeed1",lightyellow3:"cdcdb4",lightyellow4:"8b8b7a",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",magenta1:"ff00ff",magenta2:"ee00ee",magenta3:"cd00cd",magenta4:"8b008b",maroon:"b03060",maroon1:"ff34b3",maroon2:"ee30a7",maroon3:"cd2990",maroon4:"8b1c62",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumorchid1:"e066ff",mediumorchid2:"d15fee",mediumorchid3:"b452cd",mediumorchid4:"7a378b",mediumpurple:"9370db",mediumpurple1:"ab82ff",mediumpurple2:"9f79ee",mediumpurple3:"8968cd",mediumpurple4:"5d478b",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",mistyrose1:"ffe4e1",mistyrose2:"eed5d2",mistyrose3:"cdb7b5",mistyrose4:"8b7d7b",moccasin:"ffe4b5",navajowhite:"ffdead",navajowhite1:"ffdead",navajowhite2:"eecfa1",navajowhite3:"cdb38b",navajowhite4:"8b795e",navy:"000080",navyblue:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",olivedrab1:"c0ff3e",olivedrab2:"b3ee3a",olivedrab3:"9acd32",olivedrab4:"698b22",orange:"ffa500",orange1:"ffa500",orange2:"ee9a00",orange3:"cd8500",orange4:"8b5a00",orangered:"ff4500",orangered1:"ff4500",orangered2:"ee4000",orangered3:"cd3700",orangered4:"8b2500",orchid:"da70d6",orchid1:"ff83fa",orchid2:"ee7ae9",orchid3:"cd69c9",orchid4:"8b4789",palegoldenrod:"eee8aa",palegreen:"98fb98",palegreen1:"9aff9a",palegreen2:"90ee90",palegreen3:"7ccd7c",palegreen4:"548b54",paleturquoise:"afeeee",paleturquoise1:"bbffff",paleturquoise2:"aeeeee",paleturquoise3:"96cdcd",paleturquoise4:"668b8b",palevioletred:"db7093",palevioletred1:"ff82ab",palevioletred2:"ee799f",palevioletred3:"cd6889",palevioletred4:"8b475d",papayawhip:"ffefd5",peachpuff:"ffdab9",peachpuff1:"ffdab9",peachpuff2:"eecbad",peachpuff3:"cdaf95",peachpuff4:"8b7765",peru:"cd853f",pink:"ffc0cb",pink1:"ffb5c5",pink2:"eea9b8",pink3:"cd919e",pink4:"8b636c",plum:"dda0dd",plum1:"ffbbff",plum2:"eeaeee",plum3:"cd96cd",plum4:"8b668b",powderblue:"b0e0e6",purple:"a020f0",purple1:"9b30ff",purple2:"912cee",purple3:"7d26cd",purple4:"551a8b",rebeccapurple:"663399",red:"ff0000",red1:"ff0000",red2:"ee0000",red3:"cd0000",red4:"8b0000",rosybrown:"bc8f8f",rosybrown1:"ffc1c1",rosybrown2:"eeb4b4",rosybrown3:"cd9b9b",rosybrown4:"8b6969",royalblue:"4169e1",royalblue1:"4876ff",royalblue2:"436eee",royalblue3:"3a5fcd",royalblue4:"27408b",saddlebrown:"8b4513",salmon:"fa8072",salmon1:"ff8c69",salmon2:"ee8262",salmon3:"cd7054",salmon4:"8b4c39",sandybrown:"f4a460",seagreen:"2e8b57",seagreen1:"54ff9f",seagreen2:"4eee94",seagreen3:"43cd80",seagreen4:"2e8b57",seashell:"fff5ee",seashell1:"fff5ee",seashell2:"eee5de",seashell3:"cdc5bf",seashell4:"8b8682",sienna:"a0522d",sienna1:"ff8247",sienna2:"ee7942",sienna3:"cd6839",sienna4:"8b4726",silver:"c0c0c0",skyblue:"87ceeb",skyblue1:"87ceff",skyblue2:"7ec0ee",skyblue3:"6ca6cd",skyblue4:"4a708b",slateblue:"6a5acd",slateblue1:"836fff",slateblue2:"7a67ee",slateblue3:"6959cd",slateblue4:"473c8b",slategray:"708090",slategray1:"c6e2ff",slategray2:"b9d3ee",slategray3:"9fb6cd",slategray4:"6c7b8b",slategrey:"708090",snow:"fffafa",snow1:"fffafa",snow2:"eee9e9",snow3:"cdc9c9",snow4:"8b8989",springgreen:"00ff7f",springgreen1:"00ff7f",springgreen2:"00ee76",springgreen3:"00cd66",springgreen4:"008b45",steelblue:"4682b4",steelblue1:"63b8ff",steelblue2:"5cacee",steelblue3:"4f94cd",steelblue4:"36648b",tan:"d2b48c",tan1:"ffa54f",tan2:"ee9a49",tan3:"cd853f",tan4:"8b5a2b",teal:"008080",thistle:"d8bfd8",thistle1:"ffe1ff",thistle2:"eed2ee",thistle3:"cdb5cd",thistle4:"8b7b8b",tomato:"ff6347",tomato1:"ff6347",tomato2:"ee5c42",tomato3:"cd4f39",tomato4:"8b3626",turquoise:"40e0d0",turquoise1:"00f5ff",turquoise2:"00e5ee",turquoise3:"00c5cd",turquoise4:"00868b",violet:"ee82ee",violetred:"d02090",violetred1:"ff3e96",violetred2:"ee3a8c",violetred3:"cd3278",violetred4:"8b2252",webgray:"808080",webgreen:"008000",webgrey:"808080",webmaroon:"800000",webpurple:"800080",wheat:"f5deb3",wheat1:"ffe7ba",wheat2:"eed8ae",wheat3:"cdba96",wheat4:"8b7e66",white:"ffffff",whitesmoke:"f5f5f5",x11gray:"bebebe",x11green:"00ff00",x11grey:"bebebe",x11maroon:"b03060",x11purple:"a020f0",yellow:"ffff00",yellow1:"ffff00",yellow2:"eeee00",yellow3:"cdcd00",yellow4:"8b8b00",yellowgreen:"9acd32"},mk=e=>{const i=yk[e.toLowerCase().replaceAll(" ","")];return i===void 0?void 0:`#${i}`},bk=/^rgba?:([\da-f]{1,4})\/([\da-f]{1,4})\/([\da-f]{1,4})(?:\/[\da-f]{1,4})?$/i,wk=/^#((?:[\da-f]{3}){1,4})$/i,ot=e=>{const i=16**e.length-1;return Math.round(Number.parseInt(e,16)/i*255)},kk=e=>{const i=e.trim(),n=bk.exec(i);if(n)return{b:ot(n[3]),g:ot(n[2]),r:ot(n[1])};const t=i.startsWith("#")?i:mk(i);if(t===void 0)return;const o=wk.exec(t);if(!o)return;const a=o[1],s=a.length/3;return{b:ot(a.slice(s*2)),g:ot(a.slice(s,s*2)),r:ot(a.slice(0,s))}},jk=(e=1)=>e===0?"":`${Re}${e<=1?"":String(e)}S`;let Sk;const Ck=e=>(Sk??=ji(import.meta.url))(e),eo=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Lk=e=>{if(typeof eo<"u"&&eo.versions&&eo.versions.node){const[i,n]=eo.versions.node.split(".").map(Number);if(i>22||i===22&&n>=3||i===20&&n>=16)return eo.getBuiltinModule(e)}return Ck(e)},{Buffer:xk}=Lk("node:buffer"),Tk=/^\u001B([a-z0-9])$/i,Yk=/^\u001B+([ON[]|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,Qp={"[1~":"home","[2$":"insert","[2^":"insert","[2~":"insert","[3$":"delete","[3^":"delete","[3~":"delete","[4~":"end","[5$":"pageup","[5^":"pageup","[5~":"pageup","[6$":"pagedown","[6^":"pagedown","[6~":"pagedown","[7$":"home","[7^":"home","[7~":"home","[8$":"end","[8^":"end","[8~":"end","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[[5~":"pageup","[[6~":"pagedown","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[A":"up","[a":"up","[B":"down","[b":"down","[C":"right","[c":"right","[D":"left","[d":"left","[E":"clear","[e":"clear","[F":"end","[H":"home","[P":"f1","[Q":"f2","[R":"f3","[S":"f4","[Z":"tab",OA:"up",Oa:"up",OB:"down",Ob:"down",OC:"right",Oc:"right",OD:"left",Od:"left",OE:"clear",Oe:"clear",OF:"end",OH:"home",OP:"f1",OQ:"f2",OR:"f3",OS:"f4"},Dk=[...Object.values(Qp),"backspace"],Ek=e=>["[2$","[3$","[5$","[6$","[7$","[8$","[a","[b","[c","[d","[e","[Z"].includes(e),Rk=e=>["[2^","[3^","[5^","[6^","[7^","[8^","Oa","Ob","Oc","Od","Oe"].includes(e),zp=/^\u001B\[(\d+)(?::[\d:]*)?(?:;(\d*)(?::(\d+))?(?:;([\d:]+))?)?u$/,$k=/^\u001B\[(\d+)(?:;(\d+)(?::(\d+))?)?([A-Z~])$/i,Bk={A:"up",B:"down",C:"right",D:"left",E:"clear",F:"end",H:"home",P:"f1",Q:"f2",S:"f4"},Ok={2:"insert",3:"delete",5:"pageup",6:"pagedown",7:"home",8:"end",11:"f1",12:"f2",13:"f3",14:"f4",15:"f5",17:"f6",18:"f7",19:"f8",20:"f9",21:"f10",23:"f11",24:"f12",57427:"clear"},nd={9:"tab",27:"escape",127:"backspace",57358:"capslock",57359:"scrolllock",57360:"numlock",57361:"printscreen",57362:"pause",57363:"menu",57376:"f13",57377:"f14",57378:"f15",57379:"f16",57380:"f17",57381:"f18",57382:"f19",57383:"f20",57384:"f21",57385:"f22",57386:"f23",57387:"f24",57388:"f25",57389:"f26",57390:"f27",57391:"f28",57392:"f29",57393:"f30",57394:"f31",57395:"f32",57396:"f33",57397:"f34",57398:"f35",57399:"kp0",57400:"kp1",57401:"kp2",57402:"kp3",57403:"kp4",57404:"kp5",57405:"kp6",57406:"kp7",57407:"kp8",57408:"kp9",57409:"kpdecimal",57410:"kpdivide",57411:"kpmultiply",57412:"kpsubtract",57413:"kpadd",57414:"kpenter",57415:"kpequal",57416:"kpseparator",57417:"left",57418:"right",57419:"up",57420:"down",57421:"pageup",57422:"pagedown",57423:"home",57424:"end",57425:"insert",57426:"delete",57427:"kpbegin",57428:"mediaplay",57429:"mediapause",57430:"mediaplaypause",57431:"mediareverse",57432:"mediastop",57433:"mediafastforward",57434:"mediarewind",57435:"mediatracknext",57436:"mediatrackprevious",57437:"mediarecord",57438:"lowervolume",57439:"raisevolume",57440:"mutevolume",57441:"leftshift",57442:"leftcontrol",57443:"leftalt",57444:"leftsuper",57445:"lefthyper",57446:"leftmeta",57447:"rightshift",57448:"rightcontrol",57449:"rightalt",57450:"rightsuper",57451:"righthyper",57452:"rightmeta",57453:"isoLevel3Shift",57454:"isoLevel5Shift"},Kp=e=>e>=0&&e<=1114111&&!(e>=55296&&e<=57343),Hs=e=>Kp(e)?String.fromCodePoint(e):"?";function Vp(e){return e===3?"release":e===2?"repeat":"press"}function qp(e){return{capsLock:!!(e&on.capsLock),ctrl:!!(e&on.ctrl),hyper:!!(e&on.hyper),meta:!!(e&on.meta),numLock:!!(e&on.numLock),option:!!(e&on.alt),shift:!!(e&on.shift),super:!!(e&on.super)}}const Jk=e=>{const i=zp.exec(e);if(!i)return null;let n=Number.parseInt(i[1],10);n===57414&&(n=13);const t=i[2]?Math.max(0,Number.parseInt(i[2],10)-1):0,o=i[3]?Number.parseInt(i[3],10):1,a=i[4];if(!Kp(n))return null;let s;a&&(s=a.split(":").map(l=>Hs(Number.parseInt(l,10))).join(""));let r,u;return n===32?(r="space",u=!0):n===13?(r="return",u=!0):nd[n]?(r=nd[n],u=!1):n<32||n>=127&&n<=159||n>=57344&&n<=63743?(r="",u=!1):(r=Hs(n).toLowerCase(),u=!0),u&&!s&&(s=Hs(n)),{name:r,...qp(t),eventType:Vp(o),isKittyProtocol:!0,isPrintable:u||s!==void 0,raw:e,sequence:e,text:s}},Pk=e=>{const i=$k.exec(e);if(!i)return null;const n=Number.parseInt(i[1],10),t=i[2]?Math.max(0,Number.parseInt(i[2],10)-1):0,o=i[3]?Number.parseInt(i[3],10):1,a=i[4];if(a!=="~"&&n!==1)return null;const s=a==="~"?Ok[n]:Bk[a];return s?{name:s,...qp(t),eventType:Vp(o),isKittyProtocol:!0,isPrintable:!1,raw:e,sequence:e}:null},Ba=(e="")=>{let i;xk.isBuffer(e)?e=e[0]>127&&e[1]===void 0?`\x1B${String.fromCharCode(e[0]-128)}`:String(e):e!==void 0&&typeof e!="string"?e=String(e):e||(e="");const n=Jk(e);if(n)return n;const t=Pk(e);if(t)return t;if(zp.test(e))return{ctrl:!1,isKittyProtocol:!0,isPrintable:!1,meta:!1,name:"",option:!1,raw:e,sequence:e,shift:!1};const o={ctrl:!1,meta:!1,name:"",option:!1,raw:e,sequence:e,shift:!1};switch(o.sequence=o.sequence||e||o.name,e){case"\r":case"\x1B\r":{o.raw=void 0,o.name="return",o.option=e.length===2;break}case`
2
2
  `:{o.name="enter";break}case" ":case"\x1B ":{o.name="tab",o.meta=e.length===2;break}case" ":case"\x1B ":{o.name="space",o.meta=e.length===2;break}case"\b":case"\x1B\b":{o.name="backspace",o.meta=e.charAt(0)==="\x1B";break}case"\x1B":case"\x1B\x1B":{o.name="escape",o.meta=e.length===2;break}case"\x1BOM":{o.raw=void 0,o.name="return",o.sequence="\r";break}case"\x1B":case"":{o.name="backspace",o.meta=e.charAt(0)==="\x1B";break}default:if(/^\u001B?[\u0000-\u001F]$/.test(e)){const a=e.codePointAt(e.length-1),s=a<=26?a+96:a+64;o.name=a===0?"space":String.fromCharCode(s),o.ctrl=!0,o.meta=e.length===2}else if(e.length===1&&e>="0"&&e<="9")o.name="number";else if(e.length===1&&e>="a"&&e<="z")o.name=e;else if(e.length===1&&e>="A"&&e<="Z")o.name=e.toLowerCase(),o.shift=!0;else if(i=Tk.exec(e))o.meta=!0,o.shift=/^[A-Z]$/.test(i[1]);else if(i=Yk.exec(e)){const a=[...e];a[0]==="\x1B"&&a[1]==="\x1B"&&(o.option=!0);const s=[i[1],i[2],i[4],i[6]].filter(Boolean).join(""),r=(i[3]||i[5]||1)-1;o.ctrl=!!(r&4),o.meta=!!(r&10),o.shift=!!(r&1),o.code=s,o.name=Qp[s]??"",o.shift=Ek(s)||o.shift,o.ctrl=Rk(s)||o.ctrl}}return o},Up=C.createContext({renderThrottleMs:0,subscribe(){return{startTime:0,unsubscribe(){}}}});Up.displayName="InternalAnimationContext";const Wu=C.createContext({exit(){},suspendTerminal:(()=>Promise.resolve(void 0)),async waitUntilRenderFlush(){}});Wu.displayName="InternalAppContext";const ef=C.createContext({setCursorPosition(){}});ef.displayName="InternalCursorContext";let Zk;const Nk=e=>(Zk??=ji(import.meta.url))(e),lt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nf=e=>{if(typeof lt<"u"&&lt.versions&&lt.versions.node){const[i,n]=lt.versions.node.split(".").map(Number);if(i>22||i===22&&n>=3||i===20&&n>=16)return lt.getBuiltinModule(e)}return Nk(e)},{existsSync:Ak,readFileSync:Mk}=nf("node:fs"),{cwd:Hk}=lt,{fileURLToPath:Ik}=nf("node:url"),Xk=(e,i=2)=>e.replace(/^\t+/gm,n=>" ".repeat(n.length*i)),_k=(e,i)=>{const n=[],t=e-i,o=e+i;for(let a=t;a<=o;a++)n.push(a);return n},Gk=(e,i,n={})=>{var t;if(typeof e!="string")throw new TypeError("Source code is missing.");if(!i||i<1)throw new TypeError("Line number must start from `1`.");const o=Xk(e).split(/\r?\n/);if(!(i>o.length))return _k(i,(t=n.around)!==null&&t!==void 0?t:3).filter(a=>o[a-1]!==void 0).map(a=>({line:a,value:o[a-1]}))},Is=e=>{if(!e)return e;const i=Hk();let n=e;if(e.startsWith("file://"))try{n=Ik(e)}catch{}return n.replace(`${i}/`,"")},Xs=e=>!!(e?.file&&e.line&&e.column);function Wk({error:e}){const i=dw(e),n=new Map,t=i.map(u=>{const l=Xs(u)?`${Is(u.file)??""}:${u.line}:${u.column}:${u.methodName??""}`:`raw:${u.raw}`,c=n.get(l)??0;return n.set(l,c+1),{key:`${l}#${c}`,trace:u}}),o=Xs(i[0])?i[0]:void 0,a=Is(o?.file);let s,r=0;if(a&&o?.line&&Ak(a)){try{s=Gk(Mk(a,"utf8"),o.line)}catch{}if(s)for(const{line:u}of s)r=Math.max(r,String(u).length)}return k.jsxs(X,{flexDirection:"column",padding:1,children:[k.jsxs(X,{children:[k.jsxs(E,{backgroundColor:"red",color:"white",children:[" ","ERROR"," "]}),k.jsxs(E,{children:[" ",e.message]})]}),o&&a?k.jsx(X,{marginTop:1,children:k.jsxs(E,{dimColor:!0,children:[a,":",o.line,":",o.column]})}):null,o&&s?k.jsx(X,{flexDirection:"column",marginTop:1,children:s.map(({line:u,value:l})=>k.jsxs(X,{children:[k.jsx(X,{width:r+1,children:k.jsxs(E,{"aria-label":u===o.line?`Line ${u}, error`:`Line ${u}`,backgroundColor:u===o.line?"red":void 0,color:u===o.line?"white":void 0,dimColor:u!==o.line,children:[String(u).padStart(r," "),":"]})}),k.jsx(E,{backgroundColor:u===o.line?"red":void 0,color:u===o.line?"white":void 0,children:` ${l}`})]},`excerpt-${u}`))}):null,i.length>0?k.jsx(X,{flexDirection:"column",marginTop:1,children:t.map(({key:u,trace:l})=>{const c=Is(l.file)??"";return Xs(l)?k.jsxs(X,{children:[k.jsx(E,{dimColor:!0,children:"- "}),k.jsx(E,{bold:!0,dimColor:!0,children:l.methodName??"<anonymous>"}),k.jsxs(E,{"aria-label":`at ${c} line ${l.line} column ${l.column}`,color:"gray",dimColor:!0,children:[" ","(",c,":",l.line,":",l.column,")"]})]},u):k.jsxs(X,{children:[k.jsx(E,{dimColor:!0,children:"- "}),k.jsx(E,{bold:!0,dimColor:!0,children:l.raw})]},u)})}):null]})}let Fk=class extends C.PureComponent{static displayName="InternalErrorBoundary";static getDerivedStateFromError(i){return{error:_b(i)}}state={error:void 0};componentDidCatch(){this.props.onError(this.state.error)}render(){return this.state.error?k.jsx(Wk,{error:this.state.error}):this.props.children}};const Fu=C.createContext({activate(){},activeId:void 0,add(){},deactivate(){},disableFocus(){},enableFocus(){},focus(){},focusNext(){},focusPrevious(){},remove(){}});Fu.displayName="InternalFocusContext";const Qk=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:tf,tf=Qk,of=C.createContext({stderr:tf.stderr,write(){}});of.displayName="InternalStderrContext";let zk;const Kk=e=>(zk??=ji(import.meta.url))(e),ct=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:af,Vk=e=>{if(typeof ct<"u"&&ct.versions&&ct.versions.node){const[i,n]=ct.versions.node.split(".").map(Number);if(i>22||i===22&&n>=3||i===20&&n>=16)return ct.getBuiltinModule(e)}return Kk(e)},{EventEmitter:qk}=Vk("node:events"),af=ct,Va=C.createContext({internal_eventEmitter:new qk,internal_exitOnCtrlC:!0,isRawModeSupported:!1,setBracketedPasteMode(){},setRawMode(){},stdin:af.stdin});Va.displayName="InternalStdinContext";const Uk=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:sf,sf=Uk,Qu=C.createContext({stdout:sf.stdout,write(){}});Qu.displayName="InternalStdoutContext";const ej={bar:6,"blinking-bar":5,"blinking-block":1,"blinking-underline":3,block:2,default:0,underline:4},td=e=>gk(ej[e]),od=(e,i)=>e?.x!==i?.x||e?.y!==i?.y,qa=(e,i)=>{if(!i)return"";const n=e-i.y;return(n>0?No(n):"")+Qi(i.x)+Mn},zu=(e,i)=>{if(!i)return"";const n=e-1-i.y;return(n>0?Mp(n):"")+Qi(0)},ij=e=>{const i=e.cursorWasShown?cn:"",n=zu(e.previousLineCount,e.previousCursorPosition),t=qa(e.visibleLineCount,e.cursorPosition);return i+n+t},nj=(e,i,n)=>e?cn+zu(i,n):"";let tj;const oj=e=>(tj??=ji(import.meta.url))(e),io=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ua=e=>{if(typeof io<"u"&&io.versions&&io.versions.node){const[i,n]=io.versions.node.split(".").map(Number);if(i>22||i===22&&n>=3||i===20&&n>=16)return io.getBuiltinModule(e)}return oj(e)},{existsSync:ad}=Ua("node:fs"),{createRequire:aj}=Ua("node:module"),{dirname:sd,join:na}=Ua("node:path"),{fileURLToPath:sj}=Ua("node:url"),rj=12,uj=e=>{const i=aj(e),n=sd(sj(e));let t=n;for(let o=0;o<rj;o+=1){if(ad(na(t,"package.json"))&&ad(na(t,"index.js")))return i(na(t,"index.js"));const a=sd(t);if(a===t)break;t=a}return i(na(n,"..","index.js"))},ta=new WeakMap,lj=async(e,i)=>(await e,i()),rf=(e,i)=>{const n=ta.get(e),t=n===void 0?i():lj(n,i);let o;return o=(async()=>{try{await t}catch{}ta.get(e)===o&&ta.delete(e)})(),ta.set(e,o),t};let cj=class{constructor(i,n){this.target=i,this.contentRect=n}target;contentRect};function dj(e,i,n=!1){const t=e.resizeObservers&&e.resizeObservers.size>0;if((t||n)&&e.yogaNode){const o=Math.round(e.yogaNode.getComputedWidth()),a=Math.round(e.yogaNode.getComputedHeight());if(!Number.isNaN(o)&&!Number.isNaN(a)){const s=e.internal_lastMeasuredSize;if((s?.width!==o||s.height!==a)&&(e.internal_lastMeasuredSize={height:a,width:o},t)){const r=new cj(e,{height:a,width:o});for(const u of e.resizeObservers)i.has(u)||i.set(u,[]),i.get(u).push(r)}}}}let gj;const hj=e=>(gj??=ji(import.meta.url))(e),dt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:dn,Ku=e=>{if(typeof dt<"u"&&dt.versions&&dt.versions.node){const[i,n]=dt.versions.node.split(".").map(Number);if(i>22||i===22&&n>=3||i===20&&n>=16)return dt.getBuiltinModule(e)}return hj(e)},dn=dt,{execFileSync:pj}=Ku("node:child_process"),go=Ku("node:fs"),fj=Ku("node:tty"),uf=80,lf=24,Wr=(e,i,{shell:n,env:t}={})=>pj(e,i,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:n,env:t}).trim(),ma=(e,i)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(i,10)}),cf=(e,i)=>{const{columns:n,rows:t}=ma(e,i);if(!(Number.isNaN(n)||Number.isNaN(t))&&!(n===uf&&t===lf))return{columns:n,rows:t}},vj=()=>{if(dn.platform!=="linux")return!0;try{const e=go.readFileSync("/proc/self/stat","utf8"),i=e.lastIndexOf(") ");if(i===-1)return!1;const n=e.slice(i+2).trim().split(/\s+/),t=Number.parseInt(n[2],10),o=Number.parseInt(n[5],10);return Number.isNaN(t)||Number.isNaN(o)||o<=0?!1:t===o}catch{return!1}};function yj(){const{env:e,stdout:i,stderr:n}=dn;if(i?.columns&&i?.rows)return ma(i.columns,i.rows);if(n?.columns&&n?.rows)return ma(n.columns,n.rows);if(e.COLUMNS&&e.LINES)return ma(e.COLUMNS,e.LINES);const t={columns:uf,rows:lf};return dn.platform==="win32"?_s()??t:dn.platform==="darwin"?rd()??_s()??t:rd()??_s()??mj()??t}const rd=()=>{try{const e=dn.platform==="darwin"?go.constants.O_EVTONLY|go.constants.O_NONBLOCK:go.constants.O_NONBLOCK,{columns:i,rows:n}=fj.WriteStream(go.openSync("/dev/tty",e));return{columns:i,rows:n}}catch{}},_s=()=>{try{const e=Wr("tput",["cols"],{env:{TERM:"dumb",...dn.env}}),i=Wr("tput",["lines"],{env:{TERM:"dumb",...dn.env}});if(e&&i)return cf(e,i)}catch{}},mj=()=>{try{if(!vj())return;const e=Wr("resize",["-u"]).match(/\d+/g);if(e.length===2)return cf(e[0],e[1])}catch{}},Ci=e=>{const{columns:i,rows:n}=e;if(i&&n)return{columns:i,rows:n};const t=yj();return{columns:i||t.columns||80,rows:n||t.rows||24}};let bj;const wj=e=>(bj??=ji(import.meta.url))(e),gt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vu=e=>{if(typeof gt<"u"&&gt.versions&&gt.versions.node){const[i,n]=gt.versions.node.split(".").map(Number);if(i>22||i===22&&n>=3||i===20&&n>=16)return gt.getBuiltinModule(e)}return wj(e)},ri=gt,{env:Gs}=ri,{PassThrough:ud,Stream:kj}=Vu("node:stream"),{Console:jj}=Vu("node:console"),{EventEmitter:Sj}=Vu("node:events"),ld=e=>e in Gs&&Gs[e]!=="0"&&Gs[e]!=="false",df=ld("CI")||ld("CONTINUOUS_INTEGRATION"),cd=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"];let Ws={};const Cj=e=>{const i=new ud,n=new ud;i.write=o=>{e("stdout",o)},n.write=o=>{e("stderr",o)};const t=new console.Console(i,n);for(const o of cd)Ws[o]=console[o],console[o]=t[o];return()=>{for(const o of cd)console[o]=Ws[o];Ws={}}},St=[];St.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&St.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&St.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const ba=e=>!!e&&!0&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Fs=Symbol.for("signal-exit emitter"),Qs=globalThis,Lj=Object.defineProperty.bind(Object);class xj{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Qs[Fs])return Qs[Fs];Lj(Qs,Fs,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(i,n){this.listeners[i].push(n)}removeListener(i,n){const t=this.listeners[i],o=t.indexOf(n);o!==-1&&(o===0&&t.length===1?t.length=0:t.splice(o,1))}emit(i,n,t){if(this.emitted[i])return!1;this.emitted[i]=!0;let o=!1;for(const a of this.listeners[i])o=a(n,t)===!0||o;return i==="exit"&&(o=this.emit("afterExit",n,t)||o),o}}let gf=class{};const Tj=e=>({onExit(i,n){return e.onExit(i,n)},load(){return e.load()},unload(){return e.unload()}});let Yj=class extends gf{onExit(){return()=>{}}load(){}unload(){}},Dj=class extends gf{#n=Fr.platform==="win32"?"SIGINT":"SIGHUP";#e=new xj;#i;#a;#t;#o={};#s=!1;constructor(i){super(),this.#i=i,this.#o={};for(const n of St)this.#o[n]=()=>{const t=this.#i.listeners(n);let{count:o}=this.#e;const a=i;if(typeof a.__signal_exit_emitter__=="object"&&typeof a.__signal_exit_emitter__.count=="number"&&(o+=a.__signal_exit_emitter__.count),t.length===o){this.unload();const s=this.#e.emit("exit",null,n),r=n==="SIGHUP"?this.#n:n;s||i.kill(i.pid,r)}};this.#t=i.reallyExit,this.#a=i.emit}onExit(i,n){if(!ba(this.#i))return()=>{};this.#s===!1&&this.load();const t=n?.alwaysLast?"afterExit":"exit";return this.#e.on(t,i),()=>{this.#e.removeListener(t,i),this.#e.listeners.exit.length===0&&this.#e.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#e.count+=1;for(const i of St)try{const n=this.#o[i];n&&this.#i.on(i,n)}catch{}this.#i.emit=(i,...n)=>this.#u(i,...n),this.#i.reallyExit=i=>this.#r(i)}}unload(){this.#s&&(this.#s=!1,St.forEach(i=>{const n=this.#o[i];if(!n)throw new Error("Listener not defined for signal: "+i);try{this.#i.removeListener(i,n)}catch{}}),this.#i.emit=this.#a,this.#i.reallyExit=this.#t,this.#e.count-=1)}#r(i){return ba(this.#i)?(this.#i.exitCode=i||0,this.#e.emit("exit",this.#i.exitCode,null),this.#t.call(this.#i,this.#i.exitCode)):0}#u(i,...n){const t=this.#a;if(i==="exit"&&ba(this.#i)){typeof n[0]=="number"&&(this.#i.exitCode=n[0]);const o=t.call(this.#i,i,...n);return this.#e.emit("exit",this.#i.exitCode,null),o}else return t.call(this.#i,i,...n)}};const Fr=globalThis.process,{onExit:Ej}=Tj(ba(Fr)?new Dj(Fr):new Yj),Oa="\x1B",hf="\x1B[200~",dd="\x1B[201~",Rj=e=>e>=48&&e<=63,$j=e=>e>=32&&e<=47,pf=e=>e>=64&&e<=126,Bj=(e,i,n)=>{const t=i+n+1;let o=t;for(;o<e.length;o++){const a=e.codePointAt(o);if(a===void 0)return"pending";if(a===91&&o===t)continue;const s=a===36&&o===t+1&&"235678".includes(e[t]);if(pf(a)||s)return{nextIndex:o+1,sequence:e.slice(i,o+1)};if(!(Rj(a)||$j(a)))return}return"pending"},Oj=(e,i,n)=>{for(let t=i+n+1;t<e.length;t++){const o=e.codePointAt(t);if(pf(o))return{nextIndex:t+1,sequence:e.slice(i,t+1)};if((o<48||o>57)&&o!==59)return}return"pending"},gd=(e,i,n)=>{const t=e[i+n];if(t===void 0)return"pending";if(t==="[")return Bj(e,i,n);if(t==="O")return Oj(e,i,n)},Jj=(e,i)=>{const n=e.codePointAt(i+1),t=n!==void 0&&n>65535?2:1,o=i+1+t;return{nextIndex:o,sequence:e.slice(i,o)}},Pj=(e,i)=>{if(i===e.length-1)return"pending";if(e[i+1]===Oa){if(i+2>=e.length)return"pending";const t=gd(e,i,2);return t==="pending"?"pending":t||{nextIndex:i+2,sequence:e.slice(i,i+2)}}const n=gd(e,i,1);return n==="pending"?"pending":n||Jj(e,i)},hd=(e,i)=>{let n=0;for(let t=0;t<e.length;t++){const o=e[t];(o===""||o==="\b"||o==="")&&(t>n&&i.push(e.slice(n,t)),i.push(o),n=t+1)}n<e.length&&i.push(e.slice(n))},Zj=e=>{const i=[];let n=0;const t=o=>({events:i,pending:e.slice(o)});for(;n<e.length;){const o=e.indexOf(Oa,n);if(o===-1)return hd(e.slice(n),i),{events:i,pending:""};o>n&&hd(e.slice(n,o),i);const a=Pj(e,o);if(a==="pending")return t(o);if(a.sequence===hf){const s=a.nextIndex,r=e.indexOf(dd,s);if(r===-1)return t(o);i.push({paste:e.slice(s,r)}),n=r+dd.length;continue}i.push(a.sequence),n=a.nextIndex}return{events:i,pending:""}},Nj=()=>{let e="";return{flushPendingEscape(){if(!e.startsWith(Oa))return;const i=e;return e="",i},hasPendingEscape(){return e.startsWith(Oa)&&!e.startsWith(hf)&&e!=="\x1B[200"},push(i){const n=Zj(e+i);return e=n.pending,n.events},reset(){e=""}}},Aj=/^\u001B\[\?\d+u$/,pd=e=>{const i=Ba(e);return i.name==="c"&&i.ctrl&&i.eventType!=="release"},fd=Gp(Fp),zs=Wp(Fp),Ks=(e,i)=>{const n=i.count??e.count,t=i.inactive??e.inactive;return{...e,count:n,inactive:t,isActive:t.size<n}},vd=(e,i,n)=>e.id!==i?e:n(e),yd=(e,i,n)=>{const t=new Set(e);return n?t.add(i):t.delete(i),t},ff=({children:e,exitOnCtrlC:i,interactive:n,onExit:t,onKittyQueryResponse:o,onRegisterInputControl:a,onSuspendTerminal:s,onWaitUntilRenderFlush:r,renderThrottleMs:u,setCursorPosition:l,stderr:c,stdin:d,stdout:g,writeToStderr:h,writeToStdout:p})=>{const[v,y]=C.useState(!0),b=C.useRef(!0),[m,j]=C.useState(void 0),[,L]=C.useState([]),D=C.useRef(0),T=C.useRef([]),R=C.useRef(new Map),O=C.useRef(void 0),H=C.useRef(0),ae=C.useRef(!1),me=C.useRef(!1),ce=C.useRef(0),[de]=C.useState(()=>{const N=new Sj;return N.setMaxListeners(1/0),N}),ye=C.useRef(void 0),M=C.useRef(void 0);M.current??=Nj();const S=C.useRef(void 0),J=C.useRef(!1),Q=20,$=C.useCallback(()=>{S.current&&(clearTimeout(S.current),S.current=void 0)},[]),P=C.useCallback(()=>{O.current&&(clearTimeout(O.current),O.current=void 0)},[]),B=C.useCallback(()=>{if(P(),R.current.size===0)return;let N=Number.POSITIVE_INFINITY;for(const te of R.current.values())N=Math.min(N,te.nextDueTime);const ne=Math.max(0,N-performance.now());O.current=setTimeout(()=>{O.current=void 0;const te=performance.now(),se=[...R.current.values()];for(const ke of se){if(te<ke.nextDueTime)continue;ke.callback(te);const Pi=te-ke.startTime,tt=Math.floor(Pi/ke.interval)+1;ke.nextDueTime=ke.startTime+tt*ke.interval}B()},ne)},[P]),_=C.useCallback((N,ne)=>{const te=performance.now();return R.current.set(N,{callback:N,interval:ne,nextDueTime:te+ne,startTime:te}),B(),{startTime:te,unsubscribe(){if(R.current.delete(N),R.current.size===0){P();return}B()}}},[P,B]);C.useEffect(()=>()=>{P()},[P]);const A=d.isTTY?typeof d.setRawMode=="function":!1,V=C.useCallback(()=>{ye.current&&(d.removeListener("readable",ye.current),ye.current=void 0)},[d]),z=C.useCallback(()=>{M.current?.reset(),$(),V()},[$,V]),Z=C.useCallback(()=>{ae.current=!1,A&&d.setRawMode(!1),d.unref?.(),H.current=0,z()},[d,A,z]),K=C.useCallback(N=>{A&&(H.current>0||ae.current)&&Z(),t(N)},[A,Z,t]),Ce=C.useCallback(N=>{if(i&&pd(N)){K();return}const ne=Ba(N);v&&ne.name==="escape"&&ne.eventType!=="release"&&!ne.shift&&!ne.ctrl&&!ne.meta&&!ne.option&&ne.super!==!0&&ne.hyper!==!0&&j(void 0)},[i,K,v]),Te=C.useCallback(N=>{Ce(N),de.emit("input",N)},[Ce,de]),Pe=C.useCallback(()=>{$(),S.current=setTimeout(()=>{S.current=void 0;const N=M.current.flushPendingEscape();N&&Te(N)},Q)},[$,Te]),We=C.useCallback(()=>{$();let N;for(;(N=d.read())!==null;){const ne=M.current.push(N);for(const te of ne)if(typeof te=="string"){if(Aj.test(te)){o?.();continue}if(Te(te),i&&pd(te))return}else{if(de.listenerCount("paste")===0){J.current||(J.current=!0,h(`Warning: useInput() received bracketed paste because no usePaste() handler is active. This fallback is deprecated and will be removed in the next major version. Migrate paste handling to usePaste().
3
3
  `)),Te(te.paste);continue}de.emit("paste",te.paste)}}M.current.hasPendingEscape()&&Pe()},[d,Te,i,$,Pe,h,de,o]),Me=C.useCallback(()=>{ye.current||(ye.current=We,d.addListener("readable",We))},[d,We]),Dn=C.useCallback(N=>{if(!A)throw d===ri.stdin?new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
4
4
  Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`):new Error(`Raw mode is not supported on the stdin provided to Ink.
@@ -1,4 +1,4 @@
1
- import{createRequire as T}from"node:module";import{j as $,F as R,b as P,q as L,X as S,J as k}from"../packem_shared/index.server-Ca_EEVfw.js";import{a as N}from"../packem_shared/index-0dnGN3GP.js";import{a as B,r as D,b as y,c as M}from"../packem_shared/ai-fix-Bc5SFN7s.js";import{p as c}from"./cli-main.js";import{l as _}from"../packem_shared/failure-log-DwZ4pNmp.js";let A;const O=s=>(A??=T(import.meta.url))(s),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=s=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[t,i]=d.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return d.getBuiltinModule(s)}return O(s)},{createInterface:J}=q("node:readline"),U={"ambiguous-match":"ambiguous match",applied:"applied",error:"error","missing-file":"missing file","no-match":"no match","outside-workspace":"outside workspace"},j=(s,t,i)=>{const e=M(s,t,i),r=N(s,e);return r===""||r.startsWith("..")?e:r},W=(s,t,i)=>{const e=[$(`Fix proposal (${s.provider}, confidence: ${s.confidence})`),"",s.explanation||R("<no explanation>")];if(s.cannotFix)return e.push(""),e.push(P(`Cannot fix automatically: ${s.cannotFix}`)),e.join(`
1
+ import{createRequire as T}from"node:module";import{j as $,F as R,b as P,q as L,X as S,J as k}from"../packem_shared/index.server-Ca_EEVfw.js";import{a as N}from"../packem_shared/index-0dnGN3GP.js";import{a as B,r as D,b as y,c as M}from"../packem_shared/ai-fix-DpBEXHZT.js";import{p as c}from"./cli-main.js";import{l as _}from"../packem_shared/failure-log-AtaeZOrx.js";let A;const O=s=>(A??=T(import.meta.url))(s),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=s=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[t,i]=d.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return d.getBuiltinModule(s)}return O(s)},{createInterface:J}=q("node:readline"),U={"ambiguous-match":"ambiguous match",applied:"applied",error:"error","missing-file":"missing file","no-match":"no match","outside-workspace":"outside workspace"},j=(s,t,i)=>{const e=M(s,t,i),r=N(s,e);return r===""||r.startsWith("..")?e:r},W=(s,t,i)=>{const e=[$(`Fix proposal (${s.provider}, confidence: ${s.confidence})`),"",s.explanation||R("<no explanation>")];if(s.cannotFix)return e.push(""),e.push(P(`Cannot fix automatically: ${s.cannotFix}`)),e.join(`
2
2
  `);if(s.patches.length===0)return e.push(""),e.push(P("No patches were proposed.")),e.join(`
3
3
  `);e.push(""),e.push($(`Patches (${String(s.patches.length)}):`));for(const[r,o]of s.patches.entries()){const a=j(t,i,o.file);e.push(""),e.push(L(`[${String(r+1)}] ${a}`)),o.reason&&e.push(R(` reason: ${o.reason}`));for(const h of o.oldString.split(`
4
4
  `))e.push(S(` - ${h}`));for(const h of o.newString.split(`
@@ -1,4 +1,4 @@
1
- import{createRequire as _}from"node:module";import{z as m,e as t}from"../packem_shared/index-0dnGN3GP.js";import{c as b,U as j}from"../packem_shared/env-CGTN0BFz.js";import{y as a}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";let v;const w=o=>(v??=_(import.meta.url))(o),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=o=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,s]=c.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return c.getBuiltinModule(o)}return w(o)},{homedir:i}=d("node:os"),{createInterface:y}=d("node:readline"),f=b(),p=[t(i(),".zshrc"),t(i(),".zshenv"),t(i(),".bashrc"),t(i(),".bash_profile"),t(i(),".profile"),t(i(),".config","fish","config.fish")],E=o=>{const n=[];for(const s of p)if(a(s))try{const l=m(s).split(`
1
+ import{createRequire as _}from"node:module";import{z as m,e as t}from"../packem_shared/index-0dnGN3GP.js";import{c as b,U as j}from"../packem_shared/env-sb3SOT-b.js";import{y as a}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";let v;const w=o=>(v??=_(import.meta.url))(o),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=o=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,s]=c.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return c.getBuiltinModule(o)}return w(o)},{homedir:i}=d("node:os"),{createInterface:y}=d("node:readline"),f=b(),p=[t(i(),".zshrc"),t(i(),".zshenv"),t(i(),".bashrc"),t(i(),".bash_profile"),t(i(),".profile"),t(i(),".config","fish","config.fish")],E=o=>{const n=[];for(const s of p)if(a(s))try{const l=m(s).split(`
2
2
  `),e=l.filter(r=>!r.includes(".vis/bin")&&!r.includes("VIS_HOME")&&!r.includes("# vis "));e.length!==l.length&&(j(s,e.join(`
3
3
  `)),n.push(s))}catch{o.warn(`warning: could not clean ${s}`)}return n},R=async({fs:o,logger:n,options:s})=>{if(!a(f)){n.info("vis is not installed (no ~/.vis directory found).");return}n.info("This will remove:"),n.info(` ${f}/`);const u=p.filter(e=>a(e)&&m(e).includes(".vis"));for(const e of u)n.info(` Lines in ${e}`);if(!s.yes){if(!process.stdin.isTTY)throw new Error("Non-interactive terminal. Use --yes to confirm.");const e=y({input:process.stdin,output:process.stdout}),r=await new Promise(h=>{e.question(`
4
4
  Type "uninstall" to confirm: `,h)});if(e.close(),r.trim()!=="uninstall"){n.info("Aborted.");return}}const l=E(n);for(const e of l)n.info(`Cleaned ${e}`);try{await o.rm(f,{force:!0,recursive:!0}),n.info(`
@@ -1,4 +1,4 @@
1
- import{createRequire as A}from"node:module";import{e as m,a as O}from"../packem_shared/index-0dnGN3GP.js";import{findVisConfigFile as F,DEFAULT_MIN_RELEASE_AGE_MINUTES as h}from"./CONFIG_FILES.js";import{p as e,e as V}from"./cli-main.js";import{d as q,r as G}from"../packem_shared/detect-CknQIlyA.js";import{d as K}from"../packem_shared/pm-runner-BXRi4ZM9.js";import{a as P,g as U,b as L}from"../packem_shared/scaffold-files-CnWTGzav.js";import{s as Y}from"../packem_shared/build-scripts-Dff0s5AH.js";import{y as S}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{U as j}from"../packem_shared/env-CGTN0BFz.js";import{s as R}from"../packem_shared/native-config-sync-DlljvZ64.js";import{s as T}from"../packem_shared/min-release-age-Dy7mkYsY.js";let M;const N=n=>(M??=A(import.meta.url))(n),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=n=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[s,t]=g.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return g.getBuiltinModule(n)}return N(n)},{execFileSync:I}=x("node:child_process"),{createInterface:D}=x("node:readline"),W=n=>{const s=[];return S(m(n,"turbo.json"))&&s.push("turborepo"),S(m(n,"nx.json"))&&s.push("nx"),S(m(n,".moon"))&&s.push("moon"),s},B=(n,s)=>new Promise(t=>{n.question(s,i=>{t(i.trim())})}),d=async(n,s,t=!0)=>{const o=await B(n,`${s} ${t?"[Y/n]":"[y/N]"} `);return o===""?t:o.toLowerCase()==="y"||o.toLowerCase()==="yes"},w=(n,s)=>{const t=[],i=Object.entries(s.allowBuilds).filter(([,c])=>c).map(([c])=>` "${c}": true,`).join(`
1
+ import{createRequire as A}from"node:module";import{e as m,a as O}from"../packem_shared/index-0dnGN3GP.js";import{findVisConfigFile as F,DEFAULT_MIN_RELEASE_AGE_MINUTES as h}from"./CONFIG_FILES.js";import{p as e,e as V}from"./cli-main.js";import{d as q,r as G}from"../packem_shared/detect-CaA92iu_.js";import{d as K}from"../packem_shared/pm-runner-BXRi4ZM9.js";import{a as P,g as U,b as L}from"../packem_shared/scaffold-files-CC1M9Gje.js";import{s as Y}from"../packem_shared/build-scripts-mKGcgTzp.js";import{y as S}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{U as j}from"../packem_shared/env-sb3SOT-b.js";import{s as R}from"../packem_shared/native-config-sync-DI7_xs-Q.js";import{s as T}from"../packem_shared/min-release-age-BH4JKSXA.js";let M;const N=n=>(M??=A(import.meta.url))(n),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=n=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[s,t]=g.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return g.getBuiltinModule(n)}return N(n)},{execFileSync:I}=x("node:child_process"),{createInterface:D}=x("node:readline"),W=n=>{const s=[];return S(m(n,"turbo.json"))&&s.push("turborepo"),S(m(n,"nx.json"))&&s.push("nx"),S(m(n,".moon"))&&s.push("moon"),s},B=(n,s)=>new Promise(t=>{n.question(s,i=>{t(i.trim())})}),d=async(n,s,t=!0)=>{const o=await B(n,`${s} ${t?"[Y/n]":"[y/N]"} `);return o===""?t:o.toLowerCase()==="y"||o.toLowerCase()==="yes"},w=(n,s)=>{const t=[],i=Object.entries(s.allowBuilds).filter(([,c])=>c).map(([c])=>` "${c}": true,`).join(`
2
2
  `),a=[` installScripts: {
3
3
  allow: ${i?`{
4
4
  ${i}